mtgjson-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +463 -0
- package/dist/index.cjs +1874 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1043 -0
- package/dist/index.d.ts +1043 -0
- package/dist/index.js +1840 -0
- package/dist/index.js.map +1 -0
- package/package.json +47 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1043 @@
|
|
|
1
|
+
import { DuckDBInstance } from '@duckdb/node-api';
|
|
2
|
+
|
|
3
|
+
type ProgressCallback = (filename: string, bytesDownloaded: number, totalBytes: number | null) => void;
|
|
4
|
+
declare class CacheManager {
|
|
5
|
+
readonly cacheDir: string;
|
|
6
|
+
readonly offline: boolean;
|
|
7
|
+
readonly timeout: number;
|
|
8
|
+
private _remoteVersion;
|
|
9
|
+
private _onProgress;
|
|
10
|
+
constructor(options?: {
|
|
11
|
+
cacheDir?: string;
|
|
12
|
+
offline?: boolean;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
onProgress?: ProgressCallback;
|
|
15
|
+
});
|
|
16
|
+
init(): Promise<void>;
|
|
17
|
+
close(): void;
|
|
18
|
+
private _localVersion;
|
|
19
|
+
private _saveVersion;
|
|
20
|
+
remoteVersion(): Promise<string | null>;
|
|
21
|
+
isStale(): Promise<boolean>;
|
|
22
|
+
private _downloadFile;
|
|
23
|
+
private _handleDownloadResponse;
|
|
24
|
+
ensureParquet(viewName: string): Promise<string>;
|
|
25
|
+
ensureJson(name: string): Promise<string>;
|
|
26
|
+
loadJson(name: string): Promise<Record<string, unknown>>;
|
|
27
|
+
clear(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type DuckDBConnection = Awaited<ReturnType<DuckDBInstance["connect"]>>;
|
|
31
|
+
declare class Connection {
|
|
32
|
+
private _conn;
|
|
33
|
+
private _instance;
|
|
34
|
+
_registeredViews: Set<string>;
|
|
35
|
+
cache: CacheManager;
|
|
36
|
+
private constructor();
|
|
37
|
+
static create(cache: CacheManager): Promise<Connection>;
|
|
38
|
+
close(): Promise<void>;
|
|
39
|
+
private _ensureView;
|
|
40
|
+
private _buildCsvReplace;
|
|
41
|
+
private _registerLegalitiesView;
|
|
42
|
+
registerTableFromData(tableName: string, data: Record<string, unknown>[]): Promise<void>;
|
|
43
|
+
registerTableFromNdjson(tableName: string, ndjsonPath: string): Promise<void>;
|
|
44
|
+
ensureViews(...viewNames: string[]): Promise<void>;
|
|
45
|
+
execute(sql: string, params?: unknown[]): Promise<Record<string, unknown>[]>;
|
|
46
|
+
executeJson(sql: string, params?: unknown[]): Promise<string>;
|
|
47
|
+
executeScalar(sql: string, params?: unknown[]): Promise<unknown>;
|
|
48
|
+
get raw(): DuckDBConnection;
|
|
49
|
+
private _run;
|
|
50
|
+
private _runWithParams;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type ForeignDataIdentifiers = {
|
|
54
|
+
multiverseId?: string;
|
|
55
|
+
scryfallId?: string;
|
|
56
|
+
};
|
|
57
|
+
type ForeignData = {
|
|
58
|
+
faceName?: string;
|
|
59
|
+
flavorText?: string;
|
|
60
|
+
identifiers?: ForeignDataIdentifiers;
|
|
61
|
+
language: string;
|
|
62
|
+
multiverseId?: number;
|
|
63
|
+
name: string;
|
|
64
|
+
text?: string;
|
|
65
|
+
type?: string;
|
|
66
|
+
uuid?: string;
|
|
67
|
+
};
|
|
68
|
+
type Identifiers = {
|
|
69
|
+
abuId?: string;
|
|
70
|
+
cardKingdomEtchedId?: string;
|
|
71
|
+
cardKingdomFoilId?: string;
|
|
72
|
+
cardKingdomId?: string;
|
|
73
|
+
cardsphereFoilId?: string;
|
|
74
|
+
cardsphereId?: string;
|
|
75
|
+
cardtraderId?: string;
|
|
76
|
+
csiId?: string;
|
|
77
|
+
deckboxId?: string;
|
|
78
|
+
mcmId?: string;
|
|
79
|
+
mcmMetaId?: string;
|
|
80
|
+
miniaturemarketId?: string;
|
|
81
|
+
mtgArenaId?: string;
|
|
82
|
+
mtgjsonFoilVersionId?: string;
|
|
83
|
+
mtgjsonNonFoilVersionId?: string;
|
|
84
|
+
mtgjsonV4Id?: string;
|
|
85
|
+
mtgoFoilId?: string;
|
|
86
|
+
mtgoId?: string;
|
|
87
|
+
multiverseId?: string;
|
|
88
|
+
mvpId?: string;
|
|
89
|
+
scgId?: string;
|
|
90
|
+
scryfallCardBackId?: string;
|
|
91
|
+
scryfallId?: string;
|
|
92
|
+
scryfallIllustrationId?: string;
|
|
93
|
+
scryfallOracleId?: string;
|
|
94
|
+
tcgplayerEtchedProductId?: string;
|
|
95
|
+
tcgplayerProductId?: string;
|
|
96
|
+
tntId?: string;
|
|
97
|
+
};
|
|
98
|
+
type LeadershipSkills = {
|
|
99
|
+
brawl: boolean;
|
|
100
|
+
commander: boolean;
|
|
101
|
+
oathbreaker: boolean;
|
|
102
|
+
};
|
|
103
|
+
type Legalities = {
|
|
104
|
+
alchemy?: string;
|
|
105
|
+
brawl?: string;
|
|
106
|
+
commander?: string;
|
|
107
|
+
duel?: string;
|
|
108
|
+
explorer?: string;
|
|
109
|
+
future?: string;
|
|
110
|
+
gladiator?: string;
|
|
111
|
+
historic?: string;
|
|
112
|
+
historicbrawl?: string;
|
|
113
|
+
legacy?: string;
|
|
114
|
+
modern?: string;
|
|
115
|
+
oathbreaker?: string;
|
|
116
|
+
oldschool?: string;
|
|
117
|
+
pauper?: string;
|
|
118
|
+
paupercommander?: string;
|
|
119
|
+
penny?: string;
|
|
120
|
+
pioneer?: string;
|
|
121
|
+
predh?: string;
|
|
122
|
+
premodern?: string;
|
|
123
|
+
standard?: string;
|
|
124
|
+
standardbrawl?: string;
|
|
125
|
+
timeless?: string;
|
|
126
|
+
vintage?: string;
|
|
127
|
+
};
|
|
128
|
+
type PurchaseUrls = {
|
|
129
|
+
cardKingdom?: string;
|
|
130
|
+
cardKingdomEtched?: string;
|
|
131
|
+
cardKingdomFoil?: string;
|
|
132
|
+
cardmarket?: string;
|
|
133
|
+
tcgplayer?: string;
|
|
134
|
+
tcgplayerEtched?: string;
|
|
135
|
+
};
|
|
136
|
+
type RelatedCards = {
|
|
137
|
+
reverseRelated?: string[];
|
|
138
|
+
spellbook?: string[];
|
|
139
|
+
tokens?: string[];
|
|
140
|
+
};
|
|
141
|
+
type Rulings = {
|
|
142
|
+
date: string;
|
|
143
|
+
text: string;
|
|
144
|
+
};
|
|
145
|
+
type SourceProducts = {
|
|
146
|
+
etched?: string[];
|
|
147
|
+
foil?: string[];
|
|
148
|
+
nonfoil?: string[];
|
|
149
|
+
};
|
|
150
|
+
type Meta = {
|
|
151
|
+
date: string;
|
|
152
|
+
version: string;
|
|
153
|
+
};
|
|
154
|
+
type Translations = {
|
|
155
|
+
"Ancient Greek"?: string;
|
|
156
|
+
Arabic?: string;
|
|
157
|
+
"Chinese Simplified"?: string;
|
|
158
|
+
"Chinese Traditional"?: string;
|
|
159
|
+
French?: string;
|
|
160
|
+
German?: string;
|
|
161
|
+
Hebrew?: string;
|
|
162
|
+
Italian?: string;
|
|
163
|
+
Japanese?: string;
|
|
164
|
+
Korean?: string;
|
|
165
|
+
Latin?: string;
|
|
166
|
+
Phyrexian?: string;
|
|
167
|
+
"Portuguese (Brazil)"?: string;
|
|
168
|
+
Russian?: string;
|
|
169
|
+
Sanskrit?: string;
|
|
170
|
+
Spanish?: string;
|
|
171
|
+
};
|
|
172
|
+
type TcgplayerSkus = {
|
|
173
|
+
condition: string;
|
|
174
|
+
finish?: string;
|
|
175
|
+
language: string;
|
|
176
|
+
printing: string;
|
|
177
|
+
productId: number;
|
|
178
|
+
skuId: number;
|
|
179
|
+
};
|
|
180
|
+
type BoosterSheet = {
|
|
181
|
+
allowDuplicates?: boolean;
|
|
182
|
+
balanceColors?: boolean;
|
|
183
|
+
cards: Record<string, number>;
|
|
184
|
+
fixed?: boolean;
|
|
185
|
+
foil: boolean;
|
|
186
|
+
totalWeight: number;
|
|
187
|
+
};
|
|
188
|
+
type BoosterPack = {
|
|
189
|
+
contents: Record<string, number>;
|
|
190
|
+
weight: number;
|
|
191
|
+
};
|
|
192
|
+
type BoosterConfig = {
|
|
193
|
+
boosters: BoosterPack[];
|
|
194
|
+
boostersTotalWeight: number;
|
|
195
|
+
name?: string;
|
|
196
|
+
sheets: Record<string, BoosterSheet>;
|
|
197
|
+
sourceSetCodes: string[];
|
|
198
|
+
};
|
|
199
|
+
type PricePoints = {
|
|
200
|
+
etched?: Record<string, number>;
|
|
201
|
+
foil?: Record<string, number>;
|
|
202
|
+
normal?: Record<string, number>;
|
|
203
|
+
};
|
|
204
|
+
type PriceList = {
|
|
205
|
+
buylist?: PricePoints;
|
|
206
|
+
currency: string;
|
|
207
|
+
retail?: PricePoints;
|
|
208
|
+
};
|
|
209
|
+
type PriceFormats = {
|
|
210
|
+
mtgo?: Record<string, PriceList>;
|
|
211
|
+
paper?: Record<string, PriceList>;
|
|
212
|
+
};
|
|
213
|
+
type SealedProductCard = {
|
|
214
|
+
finishes?: string[];
|
|
215
|
+
foil?: boolean;
|
|
216
|
+
name: string;
|
|
217
|
+
number: string;
|
|
218
|
+
set: string;
|
|
219
|
+
uuid: string;
|
|
220
|
+
};
|
|
221
|
+
type SealedProductDeck = {
|
|
222
|
+
name: string;
|
|
223
|
+
set: string;
|
|
224
|
+
};
|
|
225
|
+
type SealedProductOther = {
|
|
226
|
+
name: string;
|
|
227
|
+
};
|
|
228
|
+
type SealedProductPack = {
|
|
229
|
+
code: string;
|
|
230
|
+
set: string;
|
|
231
|
+
};
|
|
232
|
+
type SealedProductSealed = {
|
|
233
|
+
count: number;
|
|
234
|
+
name: string;
|
|
235
|
+
set: string;
|
|
236
|
+
uuid?: string;
|
|
237
|
+
};
|
|
238
|
+
type SealedProductVariableConfig = {
|
|
239
|
+
chance?: number;
|
|
240
|
+
weight?: number;
|
|
241
|
+
};
|
|
242
|
+
type SealedProductVariableItem = {
|
|
243
|
+
card?: SealedProductCard[];
|
|
244
|
+
deck?: SealedProductDeck[];
|
|
245
|
+
other?: SealedProductOther[];
|
|
246
|
+
pack?: SealedProductPack[];
|
|
247
|
+
sealed?: SealedProductSealed[];
|
|
248
|
+
variable_config?: SealedProductVariableConfig[];
|
|
249
|
+
};
|
|
250
|
+
type SealedProductVariableEntry = {
|
|
251
|
+
configs?: SealedProductVariableItem[];
|
|
252
|
+
};
|
|
253
|
+
type SealedProductContents = {
|
|
254
|
+
card?: SealedProductCard[];
|
|
255
|
+
deck?: SealedProductDeck[];
|
|
256
|
+
other?: SealedProductOther[];
|
|
257
|
+
pack?: SealedProductPack[];
|
|
258
|
+
sealed?: SealedProductSealed[];
|
|
259
|
+
variable?: SealedProductVariableEntry[];
|
|
260
|
+
};
|
|
261
|
+
type Keywords = {
|
|
262
|
+
abilityWords: string[];
|
|
263
|
+
keywordAbilities: string[];
|
|
264
|
+
keywordActions: string[];
|
|
265
|
+
};
|
|
266
|
+
type CardType = {
|
|
267
|
+
subTypes: string[];
|
|
268
|
+
superTypes: string[];
|
|
269
|
+
};
|
|
270
|
+
type CardTypes = {
|
|
271
|
+
artifact: CardType;
|
|
272
|
+
battle: CardType;
|
|
273
|
+
conspiracy: CardType;
|
|
274
|
+
creature: CardType;
|
|
275
|
+
enchantment: CardType;
|
|
276
|
+
instant: CardType;
|
|
277
|
+
land: CardType;
|
|
278
|
+
phenomenon: CardType;
|
|
279
|
+
plane: CardType;
|
|
280
|
+
planeswalker: CardType;
|
|
281
|
+
scheme: CardType;
|
|
282
|
+
sorcery: CardType;
|
|
283
|
+
tribal: CardType;
|
|
284
|
+
vanguard: CardType;
|
|
285
|
+
};
|
|
286
|
+
type CardSetDeck = {
|
|
287
|
+
count: number;
|
|
288
|
+
isFoil?: boolean;
|
|
289
|
+
uuid: string;
|
|
290
|
+
};
|
|
291
|
+
type CardToken = {
|
|
292
|
+
artist?: string;
|
|
293
|
+
artistIds?: string[];
|
|
294
|
+
asciiName?: string;
|
|
295
|
+
attractionLights?: number[];
|
|
296
|
+
availability: string[];
|
|
297
|
+
boosterTypes?: string[];
|
|
298
|
+
borderColor: string;
|
|
299
|
+
cardParts?: string[];
|
|
300
|
+
colorIdentity: string[];
|
|
301
|
+
colorIndicator?: string[];
|
|
302
|
+
colors: string[];
|
|
303
|
+
edhrecSaltiness?: number;
|
|
304
|
+
faceFlavorName?: string;
|
|
305
|
+
faceName?: string;
|
|
306
|
+
facePrintedName?: string;
|
|
307
|
+
finishes: string[];
|
|
308
|
+
flavorName?: string;
|
|
309
|
+
flavorText?: string;
|
|
310
|
+
frameEffects?: string[];
|
|
311
|
+
frameVersion: string;
|
|
312
|
+
identifiers: Identifiers;
|
|
313
|
+
isFullArt?: boolean;
|
|
314
|
+
isFunny?: boolean;
|
|
315
|
+
isOnlineOnly?: boolean;
|
|
316
|
+
isOversized?: boolean;
|
|
317
|
+
isPromo?: boolean;
|
|
318
|
+
isReprint?: boolean;
|
|
319
|
+
isTextless?: boolean;
|
|
320
|
+
keywords?: string[];
|
|
321
|
+
language: string;
|
|
322
|
+
layout: string;
|
|
323
|
+
loyalty?: string;
|
|
324
|
+
manaCost?: string;
|
|
325
|
+
name: string;
|
|
326
|
+
number: string;
|
|
327
|
+
orientation?: string;
|
|
328
|
+
originalText?: string;
|
|
329
|
+
originalType?: string;
|
|
330
|
+
otherFaceIds?: string[];
|
|
331
|
+
power?: string;
|
|
332
|
+
printedName?: string;
|
|
333
|
+
printedText?: string;
|
|
334
|
+
printedType?: string;
|
|
335
|
+
producedMana?: string[];
|
|
336
|
+
promoTypes?: string[];
|
|
337
|
+
relatedCards?: RelatedCards;
|
|
338
|
+
reverseRelated?: string[];
|
|
339
|
+
securityStamp?: string;
|
|
340
|
+
setCode: string;
|
|
341
|
+
side?: string;
|
|
342
|
+
signature?: string;
|
|
343
|
+
sourceProducts?: SourceProducts;
|
|
344
|
+
subsets?: string[];
|
|
345
|
+
subtypes: string[];
|
|
346
|
+
supertypes: string[];
|
|
347
|
+
text?: string;
|
|
348
|
+
tokenProducts?: unknown[];
|
|
349
|
+
toughness?: string;
|
|
350
|
+
type: string;
|
|
351
|
+
types: string[];
|
|
352
|
+
uuid: string;
|
|
353
|
+
watermark?: string;
|
|
354
|
+
};
|
|
355
|
+
type CardAtomic = {
|
|
356
|
+
asciiName?: string;
|
|
357
|
+
colorIdentity: string[];
|
|
358
|
+
colorIndicator?: string[];
|
|
359
|
+
colors: string[];
|
|
360
|
+
convertedManaCost: number;
|
|
361
|
+
defense?: string;
|
|
362
|
+
edhrecRank?: number;
|
|
363
|
+
edhrecSaltiness?: number;
|
|
364
|
+
faceConvertedManaCost?: number;
|
|
365
|
+
faceManaValue?: number;
|
|
366
|
+
faceName?: string;
|
|
367
|
+
firstPrinting?: string;
|
|
368
|
+
foreignData?: ForeignData[];
|
|
369
|
+
hand?: string;
|
|
370
|
+
hasAlternativeDeckLimit?: boolean;
|
|
371
|
+
identifiers: Identifiers;
|
|
372
|
+
isFunny?: boolean;
|
|
373
|
+
isGameChanger?: boolean;
|
|
374
|
+
isReserved?: boolean;
|
|
375
|
+
keywords?: string[];
|
|
376
|
+
layout: string;
|
|
377
|
+
leadershipSkills?: LeadershipSkills;
|
|
378
|
+
legalities: Legalities;
|
|
379
|
+
life?: string;
|
|
380
|
+
loyalty?: string;
|
|
381
|
+
manaCost?: string;
|
|
382
|
+
manaValue: number;
|
|
383
|
+
name: string;
|
|
384
|
+
power?: string;
|
|
385
|
+
printings?: string[];
|
|
386
|
+
producedMana?: string[];
|
|
387
|
+
purchaseUrls: PurchaseUrls;
|
|
388
|
+
relatedCards?: RelatedCards;
|
|
389
|
+
rulings?: Rulings[];
|
|
390
|
+
side?: string;
|
|
391
|
+
subsets?: string[];
|
|
392
|
+
subtypes: string[];
|
|
393
|
+
supertypes: string[];
|
|
394
|
+
text?: string;
|
|
395
|
+
toughness?: string;
|
|
396
|
+
type: string;
|
|
397
|
+
types: string[];
|
|
398
|
+
};
|
|
399
|
+
type CardSet = {
|
|
400
|
+
artist?: string;
|
|
401
|
+
artistIds?: string[];
|
|
402
|
+
asciiName?: string;
|
|
403
|
+
attractionLights?: number[];
|
|
404
|
+
availability: string[];
|
|
405
|
+
boosterTypes?: string[];
|
|
406
|
+
borderColor: string;
|
|
407
|
+
cardParts?: string[];
|
|
408
|
+
colorIdentity: string[];
|
|
409
|
+
colorIndicator?: string[];
|
|
410
|
+
colors: string[];
|
|
411
|
+
convertedManaCost: number;
|
|
412
|
+
defense?: string;
|
|
413
|
+
duelDeck?: string;
|
|
414
|
+
edhrecRank?: number;
|
|
415
|
+
edhrecSaltiness?: number;
|
|
416
|
+
faceConvertedManaCost?: number;
|
|
417
|
+
faceFlavorName?: string;
|
|
418
|
+
faceManaValue?: number;
|
|
419
|
+
faceName?: string;
|
|
420
|
+
facePrintedName?: string;
|
|
421
|
+
finishes: string[];
|
|
422
|
+
flavorName?: string;
|
|
423
|
+
flavorText?: string;
|
|
424
|
+
foreignData?: ForeignData[];
|
|
425
|
+
frameEffects?: string[];
|
|
426
|
+
frameVersion: string;
|
|
427
|
+
hand?: string;
|
|
428
|
+
hasAlternativeDeckLimit?: boolean;
|
|
429
|
+
hasContentWarning?: boolean;
|
|
430
|
+
identifiers: Identifiers;
|
|
431
|
+
isAlternative?: boolean;
|
|
432
|
+
isFullArt?: boolean;
|
|
433
|
+
isFunny?: boolean;
|
|
434
|
+
isGameChanger?: boolean;
|
|
435
|
+
isOnlineOnly?: boolean;
|
|
436
|
+
isOversized?: boolean;
|
|
437
|
+
isPromo?: boolean;
|
|
438
|
+
isRebalanced?: boolean;
|
|
439
|
+
isReprint?: boolean;
|
|
440
|
+
isReserved?: boolean;
|
|
441
|
+
isStorySpotlight?: boolean;
|
|
442
|
+
isTextless?: boolean;
|
|
443
|
+
isTimeshifted?: boolean;
|
|
444
|
+
keywords?: string[];
|
|
445
|
+
language: string;
|
|
446
|
+
layout: string;
|
|
447
|
+
leadershipSkills?: LeadershipSkills;
|
|
448
|
+
legalities: Legalities;
|
|
449
|
+
life?: string;
|
|
450
|
+
loyalty?: string;
|
|
451
|
+
manaCost?: string;
|
|
452
|
+
manaValue: number;
|
|
453
|
+
name: string;
|
|
454
|
+
number: string;
|
|
455
|
+
originalPrintings?: string[];
|
|
456
|
+
originalReleaseDate?: string;
|
|
457
|
+
originalText?: string;
|
|
458
|
+
originalType?: string;
|
|
459
|
+
otherFaceIds?: string[];
|
|
460
|
+
power?: string;
|
|
461
|
+
printedName?: string;
|
|
462
|
+
printedText?: string;
|
|
463
|
+
printedType?: string;
|
|
464
|
+
printings?: string[];
|
|
465
|
+
producedMana?: string[];
|
|
466
|
+
promoTypes?: string[];
|
|
467
|
+
purchaseUrls: PurchaseUrls;
|
|
468
|
+
rarity: string;
|
|
469
|
+
rebalancedPrintings?: string[];
|
|
470
|
+
relatedCards?: RelatedCards;
|
|
471
|
+
rulings?: Rulings[];
|
|
472
|
+
securityStamp?: string;
|
|
473
|
+
setCode: string;
|
|
474
|
+
side?: string;
|
|
475
|
+
signature?: string;
|
|
476
|
+
sourceProducts?: SourceProducts;
|
|
477
|
+
subsets?: string[];
|
|
478
|
+
subtypes: string[];
|
|
479
|
+
supertypes: string[];
|
|
480
|
+
text?: string;
|
|
481
|
+
toughness?: string;
|
|
482
|
+
type: string;
|
|
483
|
+
types: string[];
|
|
484
|
+
uuid: string;
|
|
485
|
+
variations?: string[];
|
|
486
|
+
watermark?: string;
|
|
487
|
+
};
|
|
488
|
+
type CardDeck = {
|
|
489
|
+
artist?: string;
|
|
490
|
+
artistIds?: string[];
|
|
491
|
+
asciiName?: string;
|
|
492
|
+
attractionLights?: number[];
|
|
493
|
+
availability: string[];
|
|
494
|
+
boosterTypes?: string[];
|
|
495
|
+
borderColor: string;
|
|
496
|
+
cardParts?: string[];
|
|
497
|
+
colorIdentity: string[];
|
|
498
|
+
colorIndicator?: string[];
|
|
499
|
+
colors: string[];
|
|
500
|
+
convertedManaCost: number;
|
|
501
|
+
count: number;
|
|
502
|
+
defense?: string;
|
|
503
|
+
duelDeck?: string;
|
|
504
|
+
edhrecRank?: number;
|
|
505
|
+
edhrecSaltiness?: number;
|
|
506
|
+
faceConvertedManaCost?: number;
|
|
507
|
+
faceFlavorName?: string;
|
|
508
|
+
faceManaValue?: number;
|
|
509
|
+
faceName?: string;
|
|
510
|
+
facePrintedName?: string;
|
|
511
|
+
finishes: string[];
|
|
512
|
+
flavorName?: string;
|
|
513
|
+
flavorText?: string;
|
|
514
|
+
foreignData?: ForeignData[];
|
|
515
|
+
frameEffects?: string[];
|
|
516
|
+
frameVersion: string;
|
|
517
|
+
hand?: string;
|
|
518
|
+
hasAlternativeDeckLimit?: boolean;
|
|
519
|
+
hasContentWarning?: boolean;
|
|
520
|
+
identifiers: Identifiers;
|
|
521
|
+
isAlternative?: boolean;
|
|
522
|
+
isEtched?: boolean;
|
|
523
|
+
isFoil: boolean;
|
|
524
|
+
isFullArt?: boolean;
|
|
525
|
+
isFunny?: boolean;
|
|
526
|
+
isGameChanger?: boolean;
|
|
527
|
+
isOnlineOnly?: boolean;
|
|
528
|
+
isOversized?: boolean;
|
|
529
|
+
isPromo?: boolean;
|
|
530
|
+
isRebalanced?: boolean;
|
|
531
|
+
isReprint?: boolean;
|
|
532
|
+
isReserved?: boolean;
|
|
533
|
+
isStorySpotlight?: boolean;
|
|
534
|
+
isTextless?: boolean;
|
|
535
|
+
isTimeshifted?: boolean;
|
|
536
|
+
keywords?: string[];
|
|
537
|
+
language: string;
|
|
538
|
+
layout: string;
|
|
539
|
+
leadershipSkills?: LeadershipSkills;
|
|
540
|
+
legalities: Legalities;
|
|
541
|
+
life?: string;
|
|
542
|
+
loyalty?: string;
|
|
543
|
+
manaCost?: string;
|
|
544
|
+
manaValue: number;
|
|
545
|
+
name: string;
|
|
546
|
+
number: string;
|
|
547
|
+
originalPrintings?: string[];
|
|
548
|
+
originalReleaseDate?: string;
|
|
549
|
+
originalText?: string;
|
|
550
|
+
originalType?: string;
|
|
551
|
+
otherFaceIds?: string[];
|
|
552
|
+
power?: string;
|
|
553
|
+
printedName?: string;
|
|
554
|
+
printedText?: string;
|
|
555
|
+
printedType?: string;
|
|
556
|
+
printings?: string[];
|
|
557
|
+
producedMana?: string[];
|
|
558
|
+
promoTypes?: string[];
|
|
559
|
+
purchaseUrls: PurchaseUrls;
|
|
560
|
+
rarity: string;
|
|
561
|
+
rebalancedPrintings?: string[];
|
|
562
|
+
relatedCards?: RelatedCards;
|
|
563
|
+
rulings?: Rulings[];
|
|
564
|
+
securityStamp?: string;
|
|
565
|
+
setCode: string;
|
|
566
|
+
side?: string;
|
|
567
|
+
signature?: string;
|
|
568
|
+
sourceProducts?: SourceProducts;
|
|
569
|
+
subsets?: string[];
|
|
570
|
+
subtypes: string[];
|
|
571
|
+
supertypes: string[];
|
|
572
|
+
text?: string;
|
|
573
|
+
toughness?: string;
|
|
574
|
+
type: string;
|
|
575
|
+
types: string[];
|
|
576
|
+
uuid: string;
|
|
577
|
+
variations?: string[];
|
|
578
|
+
watermark?: string;
|
|
579
|
+
};
|
|
580
|
+
type DeckSet = {
|
|
581
|
+
code: string;
|
|
582
|
+
commander?: CardSetDeck[];
|
|
583
|
+
displayCommander?: CardSetDeck[];
|
|
584
|
+
mainBoard: CardSetDeck[];
|
|
585
|
+
name: string;
|
|
586
|
+
planes?: CardSetDeck[];
|
|
587
|
+
releaseDate: string;
|
|
588
|
+
schemes?: CardSetDeck[];
|
|
589
|
+
sealedProductUuids: string[] | null;
|
|
590
|
+
sideBoard: CardSetDeck[];
|
|
591
|
+
sourceSetCodes?: string[];
|
|
592
|
+
tokens?: CardSetDeck[];
|
|
593
|
+
type: string;
|
|
594
|
+
};
|
|
595
|
+
type SetList = {
|
|
596
|
+
baseSetSize: number;
|
|
597
|
+
block?: string;
|
|
598
|
+
cardsphereSetId?: number;
|
|
599
|
+
code: string;
|
|
600
|
+
decks?: DeckSet[];
|
|
601
|
+
isFoilOnly: boolean;
|
|
602
|
+
isForeignOnly?: boolean;
|
|
603
|
+
isNonFoilOnly?: boolean;
|
|
604
|
+
isOnlineOnly: boolean;
|
|
605
|
+
isPaperOnly?: boolean;
|
|
606
|
+
isPartialPreview?: boolean;
|
|
607
|
+
keyruneCode: string;
|
|
608
|
+
languages?: string[];
|
|
609
|
+
mcmId?: number;
|
|
610
|
+
mcmIdExtras?: number;
|
|
611
|
+
mcmName?: string;
|
|
612
|
+
mtgoCode?: string;
|
|
613
|
+
name: string;
|
|
614
|
+
parentCode?: string;
|
|
615
|
+
releaseDate: string;
|
|
616
|
+
sealedProduct?: SealedProduct[];
|
|
617
|
+
tcgplayerGroupId?: number;
|
|
618
|
+
tokenSetCode?: string;
|
|
619
|
+
totalSetSize: number;
|
|
620
|
+
translations: Translations;
|
|
621
|
+
type: string;
|
|
622
|
+
};
|
|
623
|
+
type MtgSet = {
|
|
624
|
+
baseSetSize: number;
|
|
625
|
+
block?: string;
|
|
626
|
+
booster?: Record<string, BoosterConfig>;
|
|
627
|
+
cards: CardSet[];
|
|
628
|
+
cardsphereSetId?: number;
|
|
629
|
+
code: string;
|
|
630
|
+
decks?: DeckSet[];
|
|
631
|
+
isFoilOnly: boolean;
|
|
632
|
+
isForeignOnly?: boolean;
|
|
633
|
+
isNonFoilOnly?: boolean;
|
|
634
|
+
isOnlineOnly: boolean;
|
|
635
|
+
isPaperOnly?: boolean;
|
|
636
|
+
isPartialPreview?: boolean;
|
|
637
|
+
keyruneCode: string;
|
|
638
|
+
languages?: string[];
|
|
639
|
+
mcmId?: number;
|
|
640
|
+
mcmIdExtras?: number;
|
|
641
|
+
mcmName?: string;
|
|
642
|
+
mtgoCode?: string;
|
|
643
|
+
name: string;
|
|
644
|
+
parentCode?: string;
|
|
645
|
+
releaseDate: string;
|
|
646
|
+
sealedProduct?: SealedProduct[];
|
|
647
|
+
tcgplayerGroupId?: number;
|
|
648
|
+
tokenSetCode?: string;
|
|
649
|
+
tokens: CardToken[];
|
|
650
|
+
totalSetSize: number;
|
|
651
|
+
translations: Translations;
|
|
652
|
+
type: string;
|
|
653
|
+
};
|
|
654
|
+
type SealedProduct = {
|
|
655
|
+
cardCount?: number;
|
|
656
|
+
category?: string;
|
|
657
|
+
contents?: SealedProductContents;
|
|
658
|
+
identifiers: Identifiers;
|
|
659
|
+
language?: string;
|
|
660
|
+
name: string;
|
|
661
|
+
productSize?: number;
|
|
662
|
+
purchaseUrls: PurchaseUrls;
|
|
663
|
+
releaseDate?: string;
|
|
664
|
+
setCode?: string;
|
|
665
|
+
subtype?: string;
|
|
666
|
+
uuid: string;
|
|
667
|
+
};
|
|
668
|
+
type DeckList = {
|
|
669
|
+
code: string;
|
|
670
|
+
fileName: string;
|
|
671
|
+
name: string;
|
|
672
|
+
releaseDate: string;
|
|
673
|
+
type: string;
|
|
674
|
+
};
|
|
675
|
+
type Deck = {
|
|
676
|
+
code: string;
|
|
677
|
+
commander?: CardDeck[];
|
|
678
|
+
displayCommander?: CardDeck[];
|
|
679
|
+
mainBoard: CardDeck[];
|
|
680
|
+
name: string;
|
|
681
|
+
planes?: CardDeck[];
|
|
682
|
+
releaseDate: string;
|
|
683
|
+
schemes?: CardDeck[];
|
|
684
|
+
sealedProductUuids: string[] | null;
|
|
685
|
+
sideBoard: CardDeck[];
|
|
686
|
+
sourceSetCodes?: string[];
|
|
687
|
+
tokens?: CardToken[];
|
|
688
|
+
type: string;
|
|
689
|
+
};
|
|
690
|
+
type AllPricesFile = {
|
|
691
|
+
meta: Meta;
|
|
692
|
+
data: Record<string, PriceFormats>;
|
|
693
|
+
};
|
|
694
|
+
type AllPrintingsFile = {
|
|
695
|
+
meta: Meta;
|
|
696
|
+
data: Record<string, MtgSet>;
|
|
697
|
+
};
|
|
698
|
+
type CardTypesFile = {
|
|
699
|
+
meta: Meta;
|
|
700
|
+
data: CardTypes;
|
|
701
|
+
};
|
|
702
|
+
type DeckListFile = {
|
|
703
|
+
meta: Meta;
|
|
704
|
+
data: DeckList[];
|
|
705
|
+
};
|
|
706
|
+
type KeywordsFile = {
|
|
707
|
+
meta: Meta;
|
|
708
|
+
data: Keywords;
|
|
709
|
+
};
|
|
710
|
+
type SetListFile = {
|
|
711
|
+
meta: Meta;
|
|
712
|
+
data: SetList[];
|
|
713
|
+
};
|
|
714
|
+
type TcgplayerSkusFile = {
|
|
715
|
+
meta: Meta;
|
|
716
|
+
data: Record<string, TcgplayerSkus[]>;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
declare class BoosterSimulator {
|
|
720
|
+
private _conn;
|
|
721
|
+
constructor(conn: Connection);
|
|
722
|
+
private _ensure;
|
|
723
|
+
private _getBoosterConfig;
|
|
724
|
+
availableTypes(setCode: string): Promise<string[]>;
|
|
725
|
+
openPack(setCode: string, boosterType?: string): Promise<CardSet[]>;
|
|
726
|
+
openBox(setCode: string, boosterType?: string, packs?: number): Promise<CardSet[][]>;
|
|
727
|
+
sheetContents(setCode: string, boosterType: string, sheetName: string): Promise<Record<string, number> | null>;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
declare class CardQuery {
|
|
731
|
+
private _conn;
|
|
732
|
+
constructor(conn: Connection);
|
|
733
|
+
private _ensure;
|
|
734
|
+
getByUuid(uuid: string): Promise<CardSet | null>;
|
|
735
|
+
getByUuids(uuids: string[]): Promise<CardSet[]>;
|
|
736
|
+
getByName(name: string, options?: {
|
|
737
|
+
setCode?: string;
|
|
738
|
+
}): Promise<CardSet[]>;
|
|
739
|
+
search(options?: {
|
|
740
|
+
name?: string;
|
|
741
|
+
fuzzyName?: string;
|
|
742
|
+
localizedName?: string;
|
|
743
|
+
setCode?: string;
|
|
744
|
+
colors?: string[];
|
|
745
|
+
colorIdentity?: string[];
|
|
746
|
+
types?: string;
|
|
747
|
+
rarity?: string;
|
|
748
|
+
legalIn?: string;
|
|
749
|
+
manaValue?: number;
|
|
750
|
+
manaValueLte?: number;
|
|
751
|
+
manaValueGte?: number;
|
|
752
|
+
text?: string;
|
|
753
|
+
textRegex?: string;
|
|
754
|
+
power?: string;
|
|
755
|
+
toughness?: string;
|
|
756
|
+
artist?: string;
|
|
757
|
+
keyword?: string;
|
|
758
|
+
isPromo?: boolean;
|
|
759
|
+
availability?: string;
|
|
760
|
+
language?: string;
|
|
761
|
+
layout?: string;
|
|
762
|
+
setType?: string;
|
|
763
|
+
limit?: number;
|
|
764
|
+
offset?: number;
|
|
765
|
+
}): Promise<CardSet[]>;
|
|
766
|
+
getPrintings(name: string): Promise<CardSet[]>;
|
|
767
|
+
getAtomic(name: string): Promise<CardAtomic[]>;
|
|
768
|
+
findByScryfallId(scryfallId: string): Promise<CardSet[]>;
|
|
769
|
+
random(count?: number): Promise<CardSet[]>;
|
|
770
|
+
count(filters?: Record<string, unknown>): Promise<number>;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
declare class SetQuery {
|
|
774
|
+
private _conn;
|
|
775
|
+
constructor(conn: Connection);
|
|
776
|
+
private _ensure;
|
|
777
|
+
get(code: string): Promise<SetList | null>;
|
|
778
|
+
list(options?: {
|
|
779
|
+
setType?: string;
|
|
780
|
+
name?: string;
|
|
781
|
+
limit?: number;
|
|
782
|
+
offset?: number;
|
|
783
|
+
}): Promise<SetList[]>;
|
|
784
|
+
search(options?: {
|
|
785
|
+
name?: string;
|
|
786
|
+
setType?: string;
|
|
787
|
+
block?: string;
|
|
788
|
+
releaseYear?: number;
|
|
789
|
+
limit?: number;
|
|
790
|
+
}): Promise<SetList[]>;
|
|
791
|
+
getFinancialSummary(setCode: string, options?: {
|
|
792
|
+
provider?: string;
|
|
793
|
+
currency?: string;
|
|
794
|
+
finish?: string;
|
|
795
|
+
priceType?: string;
|
|
796
|
+
}): Promise<Record<string, unknown> | null>;
|
|
797
|
+
count(): Promise<number>;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
declare class TokenQuery {
|
|
801
|
+
private _conn;
|
|
802
|
+
constructor(conn: Connection);
|
|
803
|
+
private _ensure;
|
|
804
|
+
getByUuid(uuid: string): Promise<CardToken | null>;
|
|
805
|
+
getByUuids(uuids: string[]): Promise<CardToken[]>;
|
|
806
|
+
getByName(name: string, options?: {
|
|
807
|
+
setCode?: string;
|
|
808
|
+
}): Promise<CardToken[]>;
|
|
809
|
+
search(options?: {
|
|
810
|
+
name?: string;
|
|
811
|
+
setCode?: string;
|
|
812
|
+
colors?: string[];
|
|
813
|
+
types?: string;
|
|
814
|
+
artist?: string;
|
|
815
|
+
limit?: number;
|
|
816
|
+
offset?: number;
|
|
817
|
+
}): Promise<CardToken[]>;
|
|
818
|
+
forSet(setCode: string): Promise<CardToken[]>;
|
|
819
|
+
count(filters?: Record<string, unknown>): Promise<number>;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
declare class PriceQuery {
|
|
823
|
+
private _conn;
|
|
824
|
+
constructor(conn: Connection);
|
|
825
|
+
private _ensure;
|
|
826
|
+
get(uuid: string): Promise<Record<string, unknown> | null>;
|
|
827
|
+
today(uuid: string, options?: {
|
|
828
|
+
provider?: string;
|
|
829
|
+
finish?: string;
|
|
830
|
+
priceType?: string;
|
|
831
|
+
}): Promise<Record<string, unknown>[]>;
|
|
832
|
+
history(uuid: string, options?: {
|
|
833
|
+
provider?: string;
|
|
834
|
+
finish?: string;
|
|
835
|
+
priceType?: string;
|
|
836
|
+
dateFrom?: string;
|
|
837
|
+
dateTo?: string;
|
|
838
|
+
}): Promise<Record<string, unknown>[]>;
|
|
839
|
+
priceTrend(uuid: string, options?: {
|
|
840
|
+
provider?: string;
|
|
841
|
+
finish?: string;
|
|
842
|
+
priceType?: string;
|
|
843
|
+
}): Promise<Record<string, unknown> | null>;
|
|
844
|
+
cheapestPrinting(name: string, options?: {
|
|
845
|
+
provider?: string;
|
|
846
|
+
finish?: string;
|
|
847
|
+
priceType?: string;
|
|
848
|
+
}): Promise<Record<string, unknown> | null>;
|
|
849
|
+
cheapestPrintings(options?: {
|
|
850
|
+
provider?: string;
|
|
851
|
+
finish?: string;
|
|
852
|
+
priceType?: string;
|
|
853
|
+
limit?: number;
|
|
854
|
+
offset?: number;
|
|
855
|
+
}): Promise<Record<string, unknown>[]>;
|
|
856
|
+
mostExpensivePrintings(options?: {
|
|
857
|
+
provider?: string;
|
|
858
|
+
finish?: string;
|
|
859
|
+
priceType?: string;
|
|
860
|
+
limit?: number;
|
|
861
|
+
offset?: number;
|
|
862
|
+
}): Promise<Record<string, unknown>[]>;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
declare class LegalityQuery {
|
|
866
|
+
private _conn;
|
|
867
|
+
constructor(conn: Connection);
|
|
868
|
+
private _ensure;
|
|
869
|
+
private _cardsByStatus;
|
|
870
|
+
formatsForCard(uuid: string): Promise<Record<string, string>>;
|
|
871
|
+
legalIn(formatName: string, options?: {
|
|
872
|
+
limit?: number;
|
|
873
|
+
offset?: number;
|
|
874
|
+
}): Promise<CardSet[]>;
|
|
875
|
+
isLegal(uuid: string, formatName: string): Promise<boolean>;
|
|
876
|
+
bannedIn(formatName: string, options?: {
|
|
877
|
+
limit?: number;
|
|
878
|
+
offset?: number;
|
|
879
|
+
}): Promise<Record<string, unknown>[]>;
|
|
880
|
+
restrictedIn(formatName: string, options?: {
|
|
881
|
+
limit?: number;
|
|
882
|
+
offset?: number;
|
|
883
|
+
}): Promise<Record<string, unknown>[]>;
|
|
884
|
+
suspendedIn(formatName: string, options?: {
|
|
885
|
+
limit?: number;
|
|
886
|
+
offset?: number;
|
|
887
|
+
}): Promise<Record<string, unknown>[]>;
|
|
888
|
+
notLegalIn(formatName: string, options?: {
|
|
889
|
+
limit?: number;
|
|
890
|
+
offset?: number;
|
|
891
|
+
}): Promise<Record<string, unknown>[]>;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
declare class IdentifierQuery {
|
|
895
|
+
private _conn;
|
|
896
|
+
constructor(conn: Connection);
|
|
897
|
+
private _ensure;
|
|
898
|
+
private _findBy;
|
|
899
|
+
findBy(idType: string, value: string): Promise<CardSet[]>;
|
|
900
|
+
findByScryfallId(scryfallId: string): Promise<CardSet[]>;
|
|
901
|
+
findByScryfallOracleId(oracleId: string): Promise<CardSet[]>;
|
|
902
|
+
findByScryfallIllustrationId(illustrationId: string): Promise<CardSet[]>;
|
|
903
|
+
findByTcgplayerId(tcgplayerId: string): Promise<CardSet[]>;
|
|
904
|
+
findByTcgplayerEtchedId(tcgplayerEtchedId: string): Promise<CardSet[]>;
|
|
905
|
+
findByMtgoId(mtgoId: string): Promise<CardSet[]>;
|
|
906
|
+
findByMtgoFoilId(mtgoFoilId: string): Promise<CardSet[]>;
|
|
907
|
+
findByMtgArenaId(arenaId: string): Promise<CardSet[]>;
|
|
908
|
+
findByMultiverseId(multiverseId: string): Promise<CardSet[]>;
|
|
909
|
+
findByMcmId(mcmId: string): Promise<CardSet[]>;
|
|
910
|
+
findByMcmMetaId(mcmMetaId: string): Promise<CardSet[]>;
|
|
911
|
+
findByCardKingdomId(ckId: string): Promise<CardSet[]>;
|
|
912
|
+
findByCardKingdomFoilId(ckFoilId: string): Promise<CardSet[]>;
|
|
913
|
+
findByCardKingdomEtchedId(ckEtchedId: string): Promise<CardSet[]>;
|
|
914
|
+
findByCardsphereId(csId: string): Promise<CardSet[]>;
|
|
915
|
+
findByCardsphereFoilId(csFoilId: string): Promise<CardSet[]>;
|
|
916
|
+
getIdentifiers(uuid: string): Promise<Record<string, unknown> | null>;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
declare class DeckQuery {
|
|
920
|
+
private _cache;
|
|
921
|
+
private _data;
|
|
922
|
+
constructor(cache: CacheManager);
|
|
923
|
+
private _ensure;
|
|
924
|
+
list(options?: {
|
|
925
|
+
setCode?: string;
|
|
926
|
+
deckType?: string;
|
|
927
|
+
}): Promise<DeckList[]>;
|
|
928
|
+
search(options?: {
|
|
929
|
+
name?: string;
|
|
930
|
+
setCode?: string;
|
|
931
|
+
}): Promise<DeckList[]>;
|
|
932
|
+
count(): Promise<number>;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
declare class SealedQuery {
|
|
936
|
+
private _conn;
|
|
937
|
+
constructor(conn: Connection);
|
|
938
|
+
private _ensure;
|
|
939
|
+
list(options?: {
|
|
940
|
+
setCode?: string;
|
|
941
|
+
category?: string;
|
|
942
|
+
limit?: number;
|
|
943
|
+
}): Promise<Record<string, unknown>[]>;
|
|
944
|
+
get(uuid: string): Promise<Record<string, unknown> | null>;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
declare class SkuQuery {
|
|
948
|
+
private _conn;
|
|
949
|
+
constructor(conn: Connection);
|
|
950
|
+
private _ensure;
|
|
951
|
+
get(uuid: string): Promise<TcgplayerSkus[]>;
|
|
952
|
+
findBySkuId(skuId: number): Promise<Record<string, unknown> | null>;
|
|
953
|
+
findByProductId(productId: number): Promise<Record<string, unknown>[]>;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
declare class EnumQuery {
|
|
957
|
+
private _cache;
|
|
958
|
+
constructor(cache: CacheManager);
|
|
959
|
+
keywords(): Promise<Keywords>;
|
|
960
|
+
cardTypes(): Promise<CardTypes>;
|
|
961
|
+
enumValues(): Promise<Record<string, unknown>>;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
interface MtgjsonSDKOptions {
|
|
965
|
+
cacheDir?: string;
|
|
966
|
+
offline?: boolean;
|
|
967
|
+
timeout?: number;
|
|
968
|
+
onProgress?: ProgressCallback;
|
|
969
|
+
}
|
|
970
|
+
declare class MtgjsonSDK {
|
|
971
|
+
private _cache;
|
|
972
|
+
private _conn;
|
|
973
|
+
private _cards;
|
|
974
|
+
private _sets;
|
|
975
|
+
private _prices;
|
|
976
|
+
private _decks;
|
|
977
|
+
private _sealed;
|
|
978
|
+
private _skus;
|
|
979
|
+
private _identifiers;
|
|
980
|
+
private _legalities;
|
|
981
|
+
private _tokens;
|
|
982
|
+
private _enums;
|
|
983
|
+
private _booster;
|
|
984
|
+
private constructor();
|
|
985
|
+
static create(options?: MtgjsonSDKOptions): Promise<MtgjsonSDK>;
|
|
986
|
+
get cards(): CardQuery;
|
|
987
|
+
get sets(): SetQuery;
|
|
988
|
+
get prices(): PriceQuery;
|
|
989
|
+
get decks(): DeckQuery;
|
|
990
|
+
get sealed(): SealedQuery;
|
|
991
|
+
get skus(): SkuQuery;
|
|
992
|
+
get identifiers(): IdentifierQuery;
|
|
993
|
+
get legalities(): LegalityQuery;
|
|
994
|
+
get tokens(): TokenQuery;
|
|
995
|
+
get enums(): EnumQuery;
|
|
996
|
+
get booster(): BoosterSimulator;
|
|
997
|
+
get meta(): Promise<Record<string, unknown>>;
|
|
998
|
+
get views(): string[];
|
|
999
|
+
sql(query: string, params?: unknown[]): Promise<Record<string, unknown>[]>;
|
|
1000
|
+
refresh(): Promise<boolean>;
|
|
1001
|
+
exportDb(path: string): Promise<string>;
|
|
1002
|
+
close(): Promise<void>;
|
|
1003
|
+
/** For `await using sdk = await MtgjsonSDK.create()` */
|
|
1004
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/** SQL builder with parameterized query construction. */
|
|
1008
|
+
declare class SQLBuilder {
|
|
1009
|
+
private _select;
|
|
1010
|
+
private _distinct;
|
|
1011
|
+
private _from;
|
|
1012
|
+
private _joins;
|
|
1013
|
+
/** WHERE clauses (public for direct manipulation by query modules). */
|
|
1014
|
+
_where: string[];
|
|
1015
|
+
/** Bound parameter values (public for direct manipulation by query modules). */
|
|
1016
|
+
_params: unknown[];
|
|
1017
|
+
private _groupBy;
|
|
1018
|
+
private _having;
|
|
1019
|
+
private _orderBy;
|
|
1020
|
+
private _limit;
|
|
1021
|
+
private _offset;
|
|
1022
|
+
constructor(baseTable: string);
|
|
1023
|
+
select(...columns: string[]): this;
|
|
1024
|
+
distinct(): this;
|
|
1025
|
+
join(clause: string): this;
|
|
1026
|
+
where(condition: string, ...params: unknown[]): this;
|
|
1027
|
+
whereLike(column: string, value: string): this;
|
|
1028
|
+
whereIn(column: string, values: unknown[]): this;
|
|
1029
|
+
whereEq(column: string, value: unknown): this;
|
|
1030
|
+
whereGte(column: string, value: unknown): this;
|
|
1031
|
+
whereLte(column: string, value: unknown): this;
|
|
1032
|
+
whereRegex(column: string, pattern: string): this;
|
|
1033
|
+
whereFuzzy(column: string, value: string, threshold?: number): this;
|
|
1034
|
+
whereOr(...conditions: [string, unknown][]): this;
|
|
1035
|
+
groupBy(...columns: string[]): this;
|
|
1036
|
+
having(condition: string, ...params: unknown[]): this;
|
|
1037
|
+
orderBy(...clauses: string[]): this;
|
|
1038
|
+
limit(n: number): this;
|
|
1039
|
+
offset(n: number): this;
|
|
1040
|
+
build(): [string, unknown[]];
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
export { type AllPricesFile, type AllPrintingsFile, type BoosterConfig, type BoosterPack, type BoosterSheet, BoosterSimulator, CacheManager, type CardAtomic, type CardDeck, CardQuery, type CardSet, type CardSetDeck, type CardToken, type CardType, type CardTypes, type CardTypesFile, Connection, type Deck, type DeckList, type DeckListFile, DeckQuery, type DeckSet, EnumQuery, type ForeignData, type ForeignDataIdentifiers, IdentifierQuery, type Identifiers, type Keywords, type KeywordsFile, type LeadershipSkills, type Legalities, LegalityQuery, type Meta, type MtgSet, MtgjsonSDK, type MtgjsonSDKOptions, type PriceFormats, type PriceList, type PricePoints, PriceQuery, type ProgressCallback, type PurchaseUrls, type RelatedCards, type Rulings, SQLBuilder, type SealedProduct, type SealedProductCard, type SealedProductContents, type SealedProductDeck, type SealedProductOther, type SealedProductPack, type SealedProductSealed, SealedQuery, type SetList, type SetListFile, SetQuery, SkuQuery, type SourceProducts, type TcgplayerSkus, type TcgplayerSkusFile, TokenQuery, type Translations };
|