forked from Liquipedia/Lua-Modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathliquipedia_db.lua
More file actions
332 lines (308 loc) · 8.56 KB
/
Copy pathliquipedia_db.lua
File metadata and controls
332 lines (308 loc) · 8.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
---@meta
-- luacheck: ignore
local lpdb = {}
---@class LpdbBaseData
---@field pageid integer
---@field pagename string
---@field namespace integer
---@field objectname string
---@field extradata table
---@field [any] any
---@class broadcasters:LpdbBaseData
---@field id string
---@field name string
---@field page string
---@field position string
---@field language string
---@field flag string
---@field weight number
---@field date string
---@field parent string
---@field year_date string
---@class datapoint:LpdbBaseData
---@field type string
---@field name string
---@field information string
---@field image string
---@field imagedark string
---@field date string
---@class placement:LpdbBaseData
---@field tournament string
---@field series string
---@field parent string
---@field startdate string
---@field date string #end date
---@field placement string
---@field prizemoney number
---@field individualprizemoney number
---@field prizepoolindex integer
---@field weight number
---@field mode string
---@field type string
---@field liquipediatier string # to be converted to integer
---@field liquipediatiertype string
---@field publishertier string
---@field icon string
---@field icondark string
---@field game string
---@field lastvsdata table
---@field opponentname string
---@field opponenttemplate string
---@field opponenttype OpponentType
---@field opponentplayers table
---@field qualifier string
---@field qualifierpage string
---@field qualifierurl string
---@class player:LpdbBaseData
---@field id string
---@field alternativeid string
---@field name string
---@field localizedname string
---@field iamge string
---@field type string
---@field nationality string
---@field nationality2 string
---@field nationality3 string
---@field region string
---@field birthdate string
---@field deathdate string
---@field teampagename string
---@field teamtemplate string
---@field links table
---@field status string
---@field earnings integer
---@field earningsbyyear table
---@class squadplayer:LpdbBaseData
---@field id string
---@field link string
---@field name string
---@field nationality string
---@field position string
---@field role string
---@field type 'player'|'staff'
---@field newteam string
---@field teamtemplate string
---@field newteamtemplate string
---@field joindate string
---@field leavedate string
---@field inactivedate string
---@class team:LpdbBaseData
---@field name string
---@field locations table
---@field region string
---@field logo string
---@field logodark string
---@field status string
---@field createdate string
---@field disbanddate string
---@field earnings integer
---@field earnignsbyyear table
---@field template string
---@field links table
---@class tournament:LpdbBaseData
---@field name string
---@field shortname string
---@field tickername string
---@field banner string
---@field bannerdark string
---@field icon string
---@field icondark string
---@field seriespage string
---@field previous string
---@field previous2 string
---@field next string
---@field next2 string
---@field game string
---@field mode string
---@field patch string
---@field endpatch string
---@field type string
---@field organizers table
---@field startdate string
---@field enddate string
---@field sortdate string
---@field locations table
---@field prizepool number
---@field participantsnumber integer
---@field liquipediatier string # to be converted to integer
---@field liquipediatiertype string
---@field publishertier string
---@field status string
---@field maps string
---@field format string
---@field sponsors table
---@class company:LpdbBaseData
---@field name string
---@field image string
---@field imagedark string
---@field locations table
---@field parentcompany string
---@field sistercompany string
---@field industry string
---@field foundeddate string
---@field defunctdate string
---@field defunctfate string
---@field links table
---@class externalmedialink:LpdbBaseData
---@field title string
---@field translatedtitle string
---@field link string
---@field date string
---@field authors table
---@field language string
---@field publisher string
---@field type string
---@class series:LpdbBaseData
---@field name string
---@field abbreviation string
---@field image string
---@field imagedark string
---@field icon string
---@field icondark string
---@field game string
---@field type string
---@field organizers table
---@field locations table
---@field prizepool number
---@field liquipediatier string # to be converted to integer
---@field liquipediatiertype string
---@field publishertier string
---@field launcheddate string
---@field defunctdate string
---@field defunctfate string
---@field links table
---@class settings:LpdbBaseData
---@field name string
---@field reference string
---@field lastupdated string
---@field keys table
---@field gamesettings table
---@field viewsettings table
---@field type string
---@class scoreBoard
---@field match {w: number, d: number, l: number}
---@field overtime {w: number, d: number, l: number}
---@field game {w: number, d: number, l: number}
---@field points number
---@field diff number
---@field buchholz number
---@class standingsentry:LpdbBaseData
---@field parent string
---@field standingsindex integer
---@field opponenttype OpponentType
---@field opponentname string
---@field opponenttemplate string
---@field opponentplayers table
---@field placement string
---@field definitestatus string
---@field currentstatus string
---@field placementchange string
---@field scoreboard scoreBoard
---@field roundindex integer
---@field slotindex integer
---@class standingstable:LpdbBaseData
---@field parent string
---@field standingsindex integer
---@field title string
---@field tournament string
---@field section string
---@field type 'league'|'swiss'
---@field matches string[]
---@field config {hasdraw: string, hasovertime: string, haspoints: string}
---@class transfer:LpdbBaseData
---@field staticid string # not yet in use
---@field player string
---@field nationality string
---@field fromteamtemplate string
---@field toteamtemplate string
---@field role1 string
---@field role2 string
---@field reference table
---@field date string
---@field wholeteam integer
---@class gear:LpdbBaseData
---@field date string
---@field reference string
---@field input table
---@field display string
---@field audio table
---@field chair table
---@class match2:LpdbBaseData
---@field match2id string
---@field match2bracketid string
---@field winner integer
---@field walkover WalkoverType
---@field resulttype ResultType
---@field finished integer
---@field mode string
---@field type string
---@field section string
---@field game string
---@field patch string
---@field date string
---@field dateexact integer
---@field stream table
---@field links table
---@field bestof integer
---@field vod string
---@field tournament string
---@field parent string
---@field tickername string
---@field shortname string
---@field series string
---@field icon string
---@field icondark string
---@field liquipediatier string # to be converted to integer
---@field liquipediatiertype string
---@field publishertier string
---@field match2bracketdata table
---@field match2opponents match2opponent[]
---@field match2games match2game[]
---@class match2opponent:LpdbBaseData
---@field match2id string
---@field match2opponentid integer
---@field type OpponentType
---@field name string
---@field template string
---@field score number
---@field placement integer
---@field status string
---@field match2players match2player[]
---@class match2game:LpdbBaseData
---@field match2id string
---@field match2gameid integer
---@field subgroup integer
---@field scores number[]
---@field participants table
---@field winner integer
---@field walkover WalkoverType
---@field resulttype ResultType
---@field mode string
---@field type string
---@field game string
---@field patch string
---@field tournament string
---@field date string
---@field vod string
---@field map string
---@field length string
---@field parent string
---@class match2player:LpdbBaseData
---@field match2id string
---@field match2opponentid integer
---@field match2playerid integer
---@field name string
---@field displayname string
---@field flag string
---@param obj table
---@return string
---Encode a table to a JSON object. Errors are raised if the passed value cannot be encoded in JSON.
function lpdb.lpdb_create_json(obj)
-- TODO This is not fully correct mock (should be {"1": ..., "2": ...} instead of [...,...])
return require('3rd.jsonlua.mock_json'):encode(obj)
end
---@param obj any[]
---@return string
---Encode an Array to a JSON array. Errors are raised if the passed value cannot be encoded in JSON.
function lpdb.lpdb_create_array(obj) end
return lpdb