scryfall-api 3.2.0 → 3.2.2
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/dist/scryfall-api.js +1 -0
- package/dist/scryfall-api.mjs +307 -0
- package/dist/scryfall-api.umd.js +1 -0
- package/dist/types/src/api/CardIdentifierBuilder.d.ts +28 -0
- package/dist/types/src/api/Cards.d.ts +17 -0
- package/dist/types/src/api/Catalog.d.ts +18 -0
- package/dist/types/src/api/Rulings.d.ts +10 -0
- package/dist/types/src/api/Sets.d.ts +9 -0
- package/dist/types/src/api/Symbology.d.ts +7 -0
- package/dist/types/src/error/MagicQueryError.d.ts +3 -0
- package/dist/types/src/index.d.ts +10 -0
- package/dist/types/src/query/MagicPageResult.d.ts +12 -0
- package/dist/types/src/query/MagicQuery.d.ts +13 -0
- package/dist/types/src/types/Border.d.ts +1 -0
- package/dist/types/src/types/BulkDataDefinition.d.ts +0 -0
- package/dist/types/src/types/BulkDataType.d.ts +0 -0
- package/dist/types/src/types/BulkDataTypes.d.ts +1 -0
- package/dist/types/src/types/Card.d.ts +0 -0
- package/dist/types/src/types/CardFace.d.ts +0 -0
- package/dist/types/src/types/CardIdentifier.d.ts +0 -0
- package/dist/types/src/types/CardSymbol.d.ts +0 -0
- package/dist/types/src/types/Color.d.ts +1 -0
- package/dist/types/src/types/Format.d.ts +1 -0
- package/dist/types/src/types/FrameEffect.d.ts +1 -0
- package/dist/types/src/types/Game.d.ts +1 -0
- package/dist/types/src/types/HomepageLink.d.ts +0 -0
- package/dist/types/src/types/ImageUris.d.ts +0 -0
- package/dist/types/src/types/Layout.d.ts +1 -0
- package/dist/types/src/types/Legalties.d.ts +0 -0
- package/dist/types/src/types/Legalty.d.ts +1 -0
- package/dist/types/src/types/ManaCost.d.ts +0 -0
- package/dist/types/src/types/PageQuery.d.ts +0 -0
- package/dist/types/src/types/PageQueryValue.d.ts +0 -0
- package/dist/types/src/types/Preview.d.ts +0 -0
- package/dist/types/src/types/Prices.d.ts +0 -0
- package/dist/types/src/types/PromoType.d.ts +1 -0
- package/dist/types/src/types/PurchaseUris.d.ts +0 -0
- package/dist/types/src/types/Query.d.ts +0 -0
- package/dist/types/src/types/Rarity.d.ts +1 -0
- package/dist/types/src/types/RelatedCard.d.ts +0 -0
- package/dist/types/src/types/RelatedCardComponent.d.ts +1 -0
- package/dist/types/src/types/RelatedUris.d.ts +0 -0
- package/dist/types/src/types/ResultCatalog.d.ts +0 -0
- package/dist/types/src/types/ResultData.d.ts +0 -0
- package/dist/types/src/types/ResultList.d.ts +0 -0
- package/dist/types/src/types/RetryStrategy.d.ts +0 -0
- package/dist/types/src/types/Ruling.d.ts +0 -0
- package/dist/types/src/types/SearchError.d.ts +0 -0
- package/dist/types/src/types/SearchOptions.d.ts +0 -0
- package/dist/types/src/types/Set.d.ts +0 -0
- package/dist/types/src/types/SetType.d.ts +1 -0
- package/dist/types/src/types/Sort.d.ts +1 -0
- package/dist/types/src/types/SortDirection.d.ts +1 -0
- package/dist/types/src/types/TOrArrayOfT.d.ts +0 -0
- package/dist/types/src/types/UniqueStrategy.d.ts +1 -0
- package/dist/types/src/types/index.d.ts +42 -0
- package/package.json +35 -48
- package/dist/declarations/dist/src/api/CardIdentifierBuilder.d.ts +0 -10
- package/dist/declarations/dist/src/api/Cards.d.ts +0 -19
- package/dist/declarations/dist/src/api/Catalog.d.ts +0 -18
- package/dist/declarations/dist/src/api/Rulings.d.ts +0 -11
- package/dist/declarations/dist/src/api/Sets.d.ts +0 -10
- package/dist/declarations/dist/src/api/Symbology.d.ts +0 -8
- package/dist/declarations/dist/src/error/MagicQueryError.d.ts +0 -5
- package/dist/declarations/dist/src/index.d.ts +0 -10
- package/dist/declarations/dist/src/query/MagicPageResult.d.ts +0 -18
- package/dist/declarations/dist/src/query/MagicQuery.d.ts +0 -13
- package/dist/declarations/dist/src/types/Border.d.ts +0 -7
- package/dist/declarations/dist/src/types/BulkDataDefinition.d.ts +0 -14
- package/dist/declarations/dist/src/types/BulkDataType.d.ts +0 -2
- package/dist/declarations/dist/src/types/BulkDataTypes.d.ts +0 -7
- package/dist/declarations/dist/src/types/Card.d.ts +0 -91
- package/dist/declarations/dist/src/types/CardFace.d.ts +0 -22
- package/dist/declarations/dist/src/types/CardIdentifier.d.ts +0 -10
- package/dist/declarations/dist/src/types/CardSymbol.d.ts +0 -13
- package/dist/declarations/dist/src/types/Color.d.ts +0 -9
- package/dist/declarations/dist/src/types/Format.d.ts +0 -15
- package/dist/declarations/dist/src/types/FrameEffect.d.ts +0 -17
- package/dist/declarations/dist/src/types/Game.d.ts +0 -5
- package/dist/declarations/dist/src/types/HomepageLink.d.ts +0 -9
- package/dist/declarations/dist/src/types/ImageUris.d.ts +0 -8
- package/dist/declarations/dist/src/types/Layout.d.ts +0 -22
- package/dist/declarations/dist/src/types/Legalties.d.ts +0 -5
- package/dist/declarations/dist/src/types/Legalty.d.ts +0 -6
- package/dist/declarations/dist/src/types/ManaCost.d.ts +0 -9
- package/dist/declarations/dist/src/types/PageQuery.d.ts +0 -5
- package/dist/declarations/dist/src/types/PageQueryValue.d.ts +0 -1
- package/dist/declarations/dist/src/types/Preview.d.ts +0 -5
- package/dist/declarations/dist/src/types/Prices.d.ts +0 -6
- package/dist/declarations/dist/src/types/PromoType.d.ts +0 -27
- package/dist/declarations/dist/src/types/PurchaseUris.d.ts +0 -6
- package/dist/declarations/dist/src/types/Query.d.ts +0 -4
- package/dist/declarations/dist/src/types/Rarity.d.ts +0 -6
- package/dist/declarations/dist/src/types/RelatedCard.d.ts +0 -9
- package/dist/declarations/dist/src/types/RelatedCardComponent.d.ts +0 -6
- package/dist/declarations/dist/src/types/RelatedUris.d.ts +0 -7
- package/dist/declarations/dist/src/types/ResultCatalog.d.ts +0 -2
- package/dist/declarations/dist/src/types/ResultData.d.ts +0 -4
- package/dist/declarations/dist/src/types/ResultList.d.ts +0 -7
- package/dist/declarations/dist/src/types/RetryStrategy.d.ts +0 -11
- package/dist/declarations/dist/src/types/Ruling.d.ts +0 -5
- package/dist/declarations/dist/src/types/SearchError.d.ts +0 -7
- package/dist/declarations/dist/src/types/SearchOptions.d.ts +0 -15
- package/dist/declarations/dist/src/types/Set.d.ts +0 -20
- package/dist/declarations/dist/src/types/SetType.d.ts +0 -22
- package/dist/declarations/dist/src/types/Sort.d.ts +0 -15
- package/dist/declarations/dist/src/types/SortDirection.d.ts +0 -5
- package/dist/declarations/dist/src/types/TOrArrayOfT.d.ts +0 -1
- package/dist/declarations/dist/src/types/UniqueStrategy.d.ts +0 -5
- package/dist/declarations/dist/src/types/index.d.ts +0 -42
- package/dist/scryfall-api.cjs.d.ts +0 -1
- package/dist/scryfall-api.cjs.dev.js +0 -645
- package/dist/scryfall-api.cjs.js +0 -7
- package/dist/scryfall-api.cjs.prod.js +0 -645
- package/dist/scryfall-api.esm.js +0 -631
- package/dist/scryfall-api.umd.min.js +0 -2
- package/dist/scryfall-api.umd.min.js.map +0 -1
package/dist/scryfall-api.esm.js
DELETED
|
@@ -1,631 +0,0 @@
|
|
|
1
|
-
import Axios from 'axios';
|
|
2
|
-
|
|
3
|
-
class MagicPageResult {
|
|
4
|
-
constructor(q, apiPath, query, post) {
|
|
5
|
-
this.q = q;
|
|
6
|
-
this.apiPath = apiPath;
|
|
7
|
-
this.query = query;
|
|
8
|
-
this.post = post;
|
|
9
|
-
this._hasMore = true;
|
|
10
|
-
this._count = 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
get count() {
|
|
14
|
-
return this._count;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
get hasMore() {
|
|
18
|
-
return this._hasMore;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async all() {
|
|
22
|
-
const r = [];
|
|
23
|
-
|
|
24
|
-
while (this._hasMore) {
|
|
25
|
-
const result = await this.next();
|
|
26
|
-
r.push(...result);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return r;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async get(limit) {
|
|
33
|
-
const r = [];
|
|
34
|
-
|
|
35
|
-
while (this._hasMore) {
|
|
36
|
-
const result = await this.next();
|
|
37
|
-
r.push(...result);
|
|
38
|
-
|
|
39
|
-
if (r.length == limit) {
|
|
40
|
-
return r;
|
|
41
|
-
} else if (r.length > limit) {
|
|
42
|
-
return r.slice(0, limit);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return r;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async next() {
|
|
50
|
-
const results = await this.q.query(this.apiPath, this.query, this.post);
|
|
51
|
-
this._hasMore = results?.has_more || false;
|
|
52
|
-
this._count = Number.parseInt((results?.total_cards || 0) + '');
|
|
53
|
-
|
|
54
|
-
if (this._hasMore) {
|
|
55
|
-
this.setNextPage();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return results?.data || [];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async page(page) {
|
|
62
|
-
this.query.page = page;
|
|
63
|
-
return this.next();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
setNextPage() {
|
|
67
|
-
this.query.page = this.query.page + 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
class MagicQueryError extends Error {
|
|
73
|
-
constructor(data) {
|
|
74
|
-
super(data?.details);
|
|
75
|
-
this.data = data;
|
|
76
|
-
Object.setPrototypeOf(this, MagicQueryError.prototype);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
class MagicQuery {
|
|
82
|
-
static retry = {
|
|
83
|
-
attempts: 1
|
|
84
|
-
}; // the path to the api
|
|
85
|
-
|
|
86
|
-
static endpoint = 'https://api.scryfall.com'; // time where the last api call was made
|
|
87
|
-
|
|
88
|
-
static lastQuery = 100; // the api requests 50-100 ms between calls, we go on the generous side and never wait less than 100 ms between calls
|
|
89
|
-
|
|
90
|
-
static rateLimit = 100;
|
|
91
|
-
|
|
92
|
-
static canRetry(error) {
|
|
93
|
-
if (error?.code == 'not_found' || error?.code == 'bad_request') return false;
|
|
94
|
-
return !MagicQuery.retry.canRetry ;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
static async debounce() {
|
|
98
|
-
const now = Date.now();
|
|
99
|
-
const timeSinceLastQuery = now - MagicQuery.lastQuery;
|
|
100
|
-
|
|
101
|
-
if (timeSinceLastQuery >= MagicQuery.rateLimit) {
|
|
102
|
-
MagicQuery.lastQuery = now;
|
|
103
|
-
} else {
|
|
104
|
-
const timeUntilNextQuery = MagicQuery.rateLimit - timeSinceLastQuery;
|
|
105
|
-
MagicQuery.lastQuery += timeUntilNextQuery;
|
|
106
|
-
await MagicQuery.sleep(timeUntilNextQuery);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
static sleep(ms = 0) {
|
|
111
|
-
return new Promise(resolve => setTimeout(resolve, ms));
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
static async tryQuery(apiPath, query, post, requestOptions) {
|
|
115
|
-
await MagicQuery.debounce();
|
|
116
|
-
const config = {
|
|
117
|
-
data: post,
|
|
118
|
-
method: post ? 'POST' : 'GET',
|
|
119
|
-
params: query,
|
|
120
|
-
url: `${MagicQuery.endpoint}/${apiPath}`,
|
|
121
|
-
...requestOptions
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
try {
|
|
125
|
-
return await Axios.request(config);
|
|
126
|
-
} catch (e) {
|
|
127
|
-
if (e['isAxiosError']) {
|
|
128
|
-
const error = e;
|
|
129
|
-
throw new MagicQueryError(error.response?.data);
|
|
130
|
-
} else {
|
|
131
|
-
throw e;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
async query(apiPath, query, post, requestOptions) {
|
|
137
|
-
if (Array.isArray(apiPath)) {
|
|
138
|
-
apiPath = apiPath.join('/');
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
let retries;
|
|
142
|
-
let result;
|
|
143
|
-
|
|
144
|
-
for (retries = 0; retries < MagicQuery.retry.attempts; retries++) {
|
|
145
|
-
let error;
|
|
146
|
-
|
|
147
|
-
try {
|
|
148
|
-
result = await MagicQuery.tryQuery(`${apiPath}`, query, post, requestOptions);
|
|
149
|
-
} catch (e) {
|
|
150
|
-
if (e instanceof MagicQueryError) {
|
|
151
|
-
error = e.data;
|
|
152
|
-
} else {
|
|
153
|
-
throw e;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (result || !MagicQuery.canRetry(error)) break;
|
|
158
|
-
await MagicQuery.sleep(MagicQuery.retry.timeout);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return result?.data;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
class Cards extends MagicQuery {
|
|
167
|
-
async autoCompleteName(name) {
|
|
168
|
-
const result = await this.query('cards/autocomplete', {
|
|
169
|
-
q: name
|
|
170
|
-
});
|
|
171
|
-
return result?.data || [];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
async byArenaId(id) {
|
|
175
|
-
return this.query(['cards/arena', id]);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
async byId(id) {
|
|
179
|
-
return this.query(['cards', id]);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
async byMtgoId(id) {
|
|
183
|
-
return this.query(['cards/mtgo', id]);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
async byMultiverseId(id) {
|
|
187
|
-
return this.query(['cards/multiverse', id]);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
async byName(name, set, fuzzy = false) {
|
|
191
|
-
if (typeof set === 'boolean') {
|
|
192
|
-
fuzzy = set;
|
|
193
|
-
set = undefined;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return this.query('cards/named', {
|
|
197
|
-
[fuzzy ? 'fuzzy' : 'exact']: name,
|
|
198
|
-
set
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
async bySet(setCode, collectorNumber, lang) {
|
|
203
|
-
const path = ['cards', setCode, collectorNumber];
|
|
204
|
-
if (lang) path.push(lang);
|
|
205
|
-
return this.query(path);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
async byTcgPlayerId(id) {
|
|
209
|
-
return this.query(['cards/tcgplayer', id]);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
async collection(...identifiers) {
|
|
213
|
-
const cards = [];
|
|
214
|
-
|
|
215
|
-
for (let i = 0; i < identifiers.length; i += 75) {
|
|
216
|
-
// the api only supports a max collection size of 75, so we take the list of identifiers (any length)
|
|
217
|
-
// and split it into 75 card-max requests
|
|
218
|
-
const collectionSection = {
|
|
219
|
-
identifiers: identifiers.slice(i, i + 75)
|
|
220
|
-
};
|
|
221
|
-
const result = await this.query('cards/collection', undefined, collectionSection);
|
|
222
|
-
cards.push(...(result?.data || []));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
return cards;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
async random() {
|
|
229
|
-
return this.query('cards/random');
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
search(query, options) {
|
|
233
|
-
return new MagicPageResult(this, 'cards/search', {
|
|
234
|
-
q: query,
|
|
235
|
-
...(typeof options === 'number' ? {
|
|
236
|
-
page: options
|
|
237
|
-
} : {
|
|
238
|
-
page: 1,
|
|
239
|
-
...options
|
|
240
|
-
})
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
var Cards$1 = new Cards();
|
|
247
|
-
|
|
248
|
-
class Catalog extends MagicQuery {
|
|
249
|
-
async artifactTypes() {
|
|
250
|
-
return (await this.query('catalog/artifact-types'))?.data || [];
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
async artistNames() {
|
|
254
|
-
return (await this.query('catalog/artist-names'))?.data || [];
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
async cardNames() {
|
|
258
|
-
return (await this.query('catalog/card-names'))?.data || [];
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
async creatureTypes() {
|
|
262
|
-
return (await this.query('catalog/creature-types'))?.data || [];
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
async enchantmentTypes() {
|
|
266
|
-
return (await this.query('catalog/enchantment-types'))?.data || [];
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
async landTypes() {
|
|
270
|
-
return (await this.query('catalog/land-types'))?.data || [];
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
async loyalties() {
|
|
274
|
-
return (await this.query('catalog/loyalties'))?.data || [];
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
async planeswalkerTypes() {
|
|
278
|
-
return (await this.query('catalog/planeswalker-types'))?.data || [];
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
async powers() {
|
|
282
|
-
return (await this.query('catalog/powers'))?.data || [];
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
async spellTypes() {
|
|
286
|
-
return (await this.query('catalog/spell-types'))?.data || [];
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
async toughnesses() {
|
|
290
|
-
return (await this.query('catalog/toughnesses'))?.data || [];
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
async watermarks() {
|
|
294
|
-
return (await this.query('catalog/watermarks'))?.data || [];
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
async wordBank() {
|
|
298
|
-
return (await this.query('catalog/word-bank'))?.data || [];
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
var Catalog$1 = new Catalog();
|
|
304
|
-
|
|
305
|
-
class Rulings extends MagicQuery {
|
|
306
|
-
async byArenaId(id) {
|
|
307
|
-
return (await this.query(['cards/arena', id, 'rulings']))?.data || [];
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
async byId(id) {
|
|
311
|
-
return (await this.query(['cards', id, 'rulings']))?.data || [];
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
async byMtgoId(id) {
|
|
315
|
-
return (await this.query(['cards/mtgo', id, 'rulings']))?.data || [];
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
async byMultiverseId(id) {
|
|
319
|
-
return (await this.query(['cards/multiverse', id, 'rulings']))?.data || [];
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
async bySet(setCode, collectorNumber) {
|
|
323
|
-
return (await this.query(['cards', setCode, `${collectorNumber}`, 'rulings']))?.data || [];
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
var Rulings$1 = new Rulings();
|
|
329
|
-
|
|
330
|
-
class Sets extends MagicQuery {
|
|
331
|
-
async all() {
|
|
332
|
-
const result = await this.query('sets');
|
|
333
|
-
return result?.data || [];
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
async byCode(code) {
|
|
337
|
-
return await this.query(['sets', code]);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
async byId(id) {
|
|
341
|
-
return this.query(['sets', id]);
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
async byTcgPlayerId(id) {
|
|
345
|
-
return this.query(['sets/tcgplayer', id]);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
var Sets$1 = new Sets();
|
|
351
|
-
|
|
352
|
-
class Symbology extends MagicQuery {
|
|
353
|
-
async all() {
|
|
354
|
-
return (await this.query('symbology'))?.data || [];
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
async parseMana(shorthand) {
|
|
358
|
-
return await this.query('symbology/parse-mana', {
|
|
359
|
-
cost: shorthand
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
var Symbology$1 = new Symbology();
|
|
366
|
-
|
|
367
|
-
class CardIdentifierBuilder {
|
|
368
|
-
static byId(id) {
|
|
369
|
-
return {
|
|
370
|
-
id
|
|
371
|
-
};
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
static byIllustrationId(id) {
|
|
375
|
-
return {
|
|
376
|
-
illustration_id: id
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
static byMtgoId(id) {
|
|
381
|
-
return {
|
|
382
|
-
mtgo_id: id
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
static byMultiverseId(id) {
|
|
387
|
-
return {
|
|
388
|
-
multiverse_id: id
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
static byName(name, set) {
|
|
393
|
-
return {
|
|
394
|
-
name,
|
|
395
|
-
set
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
static byOracleId(id) {
|
|
400
|
-
return {
|
|
401
|
-
oracle_id: id
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
static bySet(set, collectorNumber) {
|
|
406
|
-
return {
|
|
407
|
-
collector_number: `${collectorNumber}`,
|
|
408
|
-
set
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
let Border;
|
|
415
|
-
|
|
416
|
-
(function (Border) {
|
|
417
|
-
Border[Border["black"] = 0] = "black";
|
|
418
|
-
Border[Border["borderless"] = 1] = "borderless";
|
|
419
|
-
Border[Border["gold"] = 2] = "gold";
|
|
420
|
-
Border[Border["silver"] = 3] = "silver";
|
|
421
|
-
Border[Border["white"] = 4] = "white";
|
|
422
|
-
})(Border || (Border = {}));
|
|
423
|
-
|
|
424
|
-
let BulkDataTypes;
|
|
425
|
-
|
|
426
|
-
(function (BulkDataTypes) {
|
|
427
|
-
BulkDataTypes[BulkDataTypes["oracle_cards"] = 0] = "oracle_cards";
|
|
428
|
-
BulkDataTypes[BulkDataTypes["unique_artwork"] = 1] = "unique_artwork";
|
|
429
|
-
BulkDataTypes[BulkDataTypes["default_cards"] = 2] = "default_cards";
|
|
430
|
-
BulkDataTypes[BulkDataTypes["all_cards"] = 3] = "all_cards";
|
|
431
|
-
BulkDataTypes[BulkDataTypes["rulings"] = 4] = "rulings";
|
|
432
|
-
})(BulkDataTypes || (BulkDataTypes = {}));
|
|
433
|
-
|
|
434
|
-
var Colors;
|
|
435
|
-
|
|
436
|
-
(function (Colors) {
|
|
437
|
-
Colors[Colors["W"] = 0] = "W";
|
|
438
|
-
Colors[Colors["B"] = 1] = "B";
|
|
439
|
-
Colors[Colors["R"] = 2] = "R";
|
|
440
|
-
Colors[Colors["U"] = 3] = "U";
|
|
441
|
-
Colors[Colors["G"] = 4] = "G";
|
|
442
|
-
})(Colors || (Colors = {}));
|
|
443
|
-
|
|
444
|
-
let Format;
|
|
445
|
-
|
|
446
|
-
(function (Format) {
|
|
447
|
-
Format[Format["standard"] = 0] = "standard";
|
|
448
|
-
Format[Format["future"] = 1] = "future";
|
|
449
|
-
Format[Format["historic"] = 2] = "historic";
|
|
450
|
-
Format[Format["pioneer"] = 3] = "pioneer";
|
|
451
|
-
Format[Format["modern"] = 4] = "modern";
|
|
452
|
-
Format[Format["legacy"] = 5] = "legacy";
|
|
453
|
-
Format[Format["pauper"] = 6] = "pauper";
|
|
454
|
-
Format[Format["vintage"] = 7] = "vintage";
|
|
455
|
-
Format[Format["penny"] = 8] = "penny";
|
|
456
|
-
Format[Format["commander"] = 9] = "commander";
|
|
457
|
-
Format[Format["brawl"] = 10] = "brawl";
|
|
458
|
-
Format[Format["duel"] = 11] = "duel";
|
|
459
|
-
Format[Format["oldschool"] = 12] = "oldschool";
|
|
460
|
-
})(Format || (Format = {}));
|
|
461
|
-
|
|
462
|
-
let FrameEffect;
|
|
463
|
-
|
|
464
|
-
(function (FrameEffect) {
|
|
465
|
-
FrameEffect[FrameEffect["legendary"] = 0] = "legendary";
|
|
466
|
-
FrameEffect[FrameEffect["miracle"] = 1] = "miracle";
|
|
467
|
-
FrameEffect[FrameEffect["nyxtouched"] = 2] = "nyxtouched";
|
|
468
|
-
FrameEffect[FrameEffect["draft"] = 3] = "draft";
|
|
469
|
-
FrameEffect[FrameEffect["devoid"] = 4] = "devoid";
|
|
470
|
-
FrameEffect[FrameEffect["tombstone"] = 5] = "tombstone";
|
|
471
|
-
FrameEffect[FrameEffect["colorshifted"] = 6] = "colorshifted";
|
|
472
|
-
FrameEffect[FrameEffect["inverted"] = 7] = "inverted";
|
|
473
|
-
FrameEffect[FrameEffect["sunmoondfc"] = 8] = "sunmoondfc";
|
|
474
|
-
FrameEffect[FrameEffect["compasslanddfc"] = 9] = "compasslanddfc";
|
|
475
|
-
FrameEffect[FrameEffect["originpwdfc"] = 10] = "originpwdfc";
|
|
476
|
-
FrameEffect[FrameEffect["mooneldrazidfc"] = 11] = "mooneldrazidfc";
|
|
477
|
-
FrameEffect[FrameEffect["moonreversemoondfc"] = 12] = "moonreversemoondfc";
|
|
478
|
-
FrameEffect[FrameEffect["showcase"] = 13] = "showcase";
|
|
479
|
-
FrameEffect[FrameEffect["extendedart"] = 14] = "extendedart";
|
|
480
|
-
})(FrameEffect || (FrameEffect = {}));
|
|
481
|
-
|
|
482
|
-
let Game;
|
|
483
|
-
|
|
484
|
-
(function (Game) {
|
|
485
|
-
Game[Game["paper"] = 0] = "paper";
|
|
486
|
-
Game[Game["arena"] = 1] = "arena";
|
|
487
|
-
Game[Game["mtgo"] = 2] = "mtgo";
|
|
488
|
-
})(Game || (Game = {}));
|
|
489
|
-
|
|
490
|
-
let Layout;
|
|
491
|
-
|
|
492
|
-
(function (Layout) {
|
|
493
|
-
Layout[Layout["normal"] = 0] = "normal";
|
|
494
|
-
Layout[Layout["split"] = 1] = "split";
|
|
495
|
-
Layout[Layout["flip"] = 2] = "flip";
|
|
496
|
-
Layout[Layout["transform"] = 3] = "transform";
|
|
497
|
-
Layout[Layout["modal_dfc"] = 4] = "modal_dfc";
|
|
498
|
-
Layout[Layout["meld"] = 5] = "meld";
|
|
499
|
-
Layout[Layout["leveler"] = 6] = "leveler";
|
|
500
|
-
Layout[Layout["class"] = 7] = "class";
|
|
501
|
-
Layout[Layout["saga"] = 8] = "saga";
|
|
502
|
-
Layout[Layout["adventure"] = 9] = "adventure";
|
|
503
|
-
Layout[Layout["planar"] = 10] = "planar";
|
|
504
|
-
Layout[Layout["scheme"] = 11] = "scheme";
|
|
505
|
-
Layout[Layout["vanguard"] = 12] = "vanguard";
|
|
506
|
-
Layout[Layout["token"] = 13] = "token";
|
|
507
|
-
Layout[Layout["double_faced_token"] = 14] = "double_faced_token";
|
|
508
|
-
Layout[Layout["emblem"] = 15] = "emblem";
|
|
509
|
-
Layout[Layout["augment"] = 16] = "augment";
|
|
510
|
-
Layout[Layout["host"] = 17] = "host";
|
|
511
|
-
Layout[Layout["art_series"] = 18] = "art_series";
|
|
512
|
-
Layout[Layout["reversible_card"] = 19] = "reversible_card";
|
|
513
|
-
})(Layout || (Layout = {}));
|
|
514
|
-
|
|
515
|
-
let Legality;
|
|
516
|
-
|
|
517
|
-
(function (Legality) {
|
|
518
|
-
Legality[Legality["legal"] = 0] = "legal";
|
|
519
|
-
Legality[Legality["not_legal"] = 1] = "not_legal";
|
|
520
|
-
Legality[Legality["restricted"] = 2] = "restricted";
|
|
521
|
-
Legality[Legality["banned"] = 3] = "banned";
|
|
522
|
-
})(Legality || (Legality = {}));
|
|
523
|
-
|
|
524
|
-
let PromoType;
|
|
525
|
-
|
|
526
|
-
(function (PromoType) {
|
|
527
|
-
PromoType[PromoType["tourney"] = 0] = "tourney";
|
|
528
|
-
PromoType[PromoType["prerelease"] = 1] = "prerelease";
|
|
529
|
-
PromoType[PromoType["datestamped"] = 2] = "datestamped";
|
|
530
|
-
PromoType[PromoType["planeswalkerdeck"] = 3] = "planeswalkerdeck";
|
|
531
|
-
PromoType[PromoType["buyabox"] = 4] = "buyabox";
|
|
532
|
-
PromoType[PromoType["judgegift"] = 5] = "judgegift";
|
|
533
|
-
PromoType[PromoType["event"] = 6] = "event";
|
|
534
|
-
PromoType[PromoType["convention"] = 7] = "convention";
|
|
535
|
-
PromoType[PromoType["starterdeck"] = 8] = "starterdeck";
|
|
536
|
-
PromoType[PromoType["instore"] = 9] = "instore";
|
|
537
|
-
PromoType[PromoType["setpromo"] = 10] = "setpromo";
|
|
538
|
-
PromoType[PromoType["fnm"] = 11] = "fnm";
|
|
539
|
-
PromoType[PromoType["openhouse"] = 12] = "openhouse";
|
|
540
|
-
PromoType[PromoType["league"] = 13] = "league";
|
|
541
|
-
PromoType[PromoType["draftweekend"] = 14] = "draftweekend";
|
|
542
|
-
PromoType[PromoType["gameday"] = 15] = "gameday";
|
|
543
|
-
PromoType[PromoType["release"] = 16] = "release";
|
|
544
|
-
PromoType[PromoType["intropack"] = 17] = "intropack";
|
|
545
|
-
PromoType[PromoType["giftbox"] = 18] = "giftbox";
|
|
546
|
-
PromoType[PromoType["duels"] = 19] = "duels";
|
|
547
|
-
PromoType[PromoType["wizardsplaynetwork"] = 20] = "wizardsplaynetwork";
|
|
548
|
-
PromoType[PromoType["premiereshop"] = 21] = "premiereshop";
|
|
549
|
-
PromoType[PromoType["playerrewards"] = 22] = "playerrewards";
|
|
550
|
-
PromoType[PromoType["gateway"] = 23] = "gateway";
|
|
551
|
-
PromoType[PromoType["arenaleague"] = 24] = "arenaleague";
|
|
552
|
-
})(PromoType || (PromoType = {}));
|
|
553
|
-
|
|
554
|
-
let Rarity;
|
|
555
|
-
|
|
556
|
-
(function (Rarity) {
|
|
557
|
-
Rarity[Rarity["common"] = 0] = "common";
|
|
558
|
-
Rarity[Rarity["uncommon"] = 1] = "uncommon";
|
|
559
|
-
Rarity[Rarity["rare"] = 2] = "rare";
|
|
560
|
-
Rarity[Rarity["mythic"] = 3] = "mythic";
|
|
561
|
-
})(Rarity || (Rarity = {}));
|
|
562
|
-
|
|
563
|
-
let RelatedCardComponent;
|
|
564
|
-
|
|
565
|
-
(function (RelatedCardComponent) {
|
|
566
|
-
RelatedCardComponent[RelatedCardComponent["token"] = 0] = "token";
|
|
567
|
-
RelatedCardComponent[RelatedCardComponent["meld_part"] = 1] = "meld_part";
|
|
568
|
-
RelatedCardComponent[RelatedCardComponent["meld_result"] = 2] = "meld_result";
|
|
569
|
-
RelatedCardComponent[RelatedCardComponent["combo_piece"] = 3] = "combo_piece";
|
|
570
|
-
})(RelatedCardComponent || (RelatedCardComponent = {}));
|
|
571
|
-
|
|
572
|
-
let SetType;
|
|
573
|
-
|
|
574
|
-
(function (SetType) {
|
|
575
|
-
SetType[SetType["core"] = 0] = "core";
|
|
576
|
-
SetType[SetType["expansion"] = 1] = "expansion";
|
|
577
|
-
SetType[SetType["masters"] = 2] = "masters";
|
|
578
|
-
SetType[SetType["masterpiece"] = 3] = "masterpiece";
|
|
579
|
-
SetType[SetType["from_the_vault"] = 4] = "from_the_vault";
|
|
580
|
-
SetType[SetType["spellbook"] = 5] = "spellbook";
|
|
581
|
-
SetType[SetType["premium_deck"] = 6] = "premium_deck";
|
|
582
|
-
SetType[SetType["duel_deck"] = 7] = "duel_deck";
|
|
583
|
-
SetType[SetType["draft_innovation"] = 8] = "draft_innovation";
|
|
584
|
-
SetType[SetType["treasure_chest"] = 9] = "treasure_chest";
|
|
585
|
-
SetType[SetType["commander"] = 10] = "commander";
|
|
586
|
-
SetType[SetType["planechase"] = 11] = "planechase";
|
|
587
|
-
SetType[SetType["archenemy"] = 12] = "archenemy";
|
|
588
|
-
SetType[SetType["vanguard"] = 13] = "vanguard";
|
|
589
|
-
SetType[SetType["funny"] = 14] = "funny";
|
|
590
|
-
SetType[SetType["starter"] = 15] = "starter";
|
|
591
|
-
SetType[SetType["box"] = 16] = "box";
|
|
592
|
-
SetType[SetType["promo"] = 17] = "promo";
|
|
593
|
-
SetType[SetType["token"] = 18] = "token";
|
|
594
|
-
SetType[SetType["memorabilia"] = 19] = "memorabilia";
|
|
595
|
-
})(SetType || (SetType = {}));
|
|
596
|
-
|
|
597
|
-
let Sort;
|
|
598
|
-
|
|
599
|
-
(function (Sort) {
|
|
600
|
-
Sort[Sort["name"] = 0] = "name";
|
|
601
|
-
Sort[Sort["set"] = 1] = "set";
|
|
602
|
-
Sort[Sort["released"] = 2] = "released";
|
|
603
|
-
Sort[Sort["rarity"] = 3] = "rarity";
|
|
604
|
-
Sort[Sort["color"] = 4] = "color";
|
|
605
|
-
Sort[Sort["usd"] = 5] = "usd";
|
|
606
|
-
Sort[Sort["tix"] = 6] = "tix";
|
|
607
|
-
Sort[Sort["eur"] = 7] = "eur";
|
|
608
|
-
Sort[Sort["cmc"] = 8] = "cmc";
|
|
609
|
-
Sort[Sort["power"] = 9] = "power";
|
|
610
|
-
Sort[Sort["toughness"] = 10] = "toughness";
|
|
611
|
-
Sort[Sort["edhrec"] = 11] = "edhrec";
|
|
612
|
-
Sort[Sort["artist"] = 12] = "artist";
|
|
613
|
-
})(Sort || (Sort = {}));
|
|
614
|
-
|
|
615
|
-
let SortDirection;
|
|
616
|
-
|
|
617
|
-
(function (SortDirection) {
|
|
618
|
-
SortDirection[SortDirection["auto"] = 0] = "auto";
|
|
619
|
-
SortDirection[SortDirection["asc"] = 1] = "asc";
|
|
620
|
-
SortDirection[SortDirection["desc"] = 2] = "desc";
|
|
621
|
-
})(SortDirection || (SortDirection = {}));
|
|
622
|
-
|
|
623
|
-
let UniqueStrategy;
|
|
624
|
-
|
|
625
|
-
(function (UniqueStrategy) {
|
|
626
|
-
UniqueStrategy[UniqueStrategy["cards"] = 0] = "cards";
|
|
627
|
-
UniqueStrategy[UniqueStrategy["art"] = 1] = "art";
|
|
628
|
-
UniqueStrategy[UniqueStrategy["prints"] = 2] = "prints";
|
|
629
|
-
})(UniqueStrategy || (UniqueStrategy = {}));
|
|
630
|
-
|
|
631
|
-
export { Border, BulkDataTypes, CardIdentifierBuilder, Cards$1 as Cards, Catalog$1 as Catalog, Format, FrameEffect, Game, Layout, Legality, MagicQueryError, PromoType, Rarity, RelatedCardComponent, Rulings$1 as Rulings, SetType, Sets$1 as Sets, Sort, SortDirection, Symbology$1 as Symbology, UniqueStrategy };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).scryfall={},e.axios)}(this,(function(e,t){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}var r=a(t);class s{constructor(e,t,a,r){this.q=e,this.apiPath=t,this.query=a,this.post=r,this._hasMore=!0,this._count=0}get count(){return this._count}get hasMore(){return this._hasMore}async all(){const e=[];for(;this._hasMore;){const t=await this.next();e.push(...t)}return e}async get(e){const t=[];for(;this._hasMore;){const a=await this.next();if(t.push(...a),t.length==e)return t;if(t.length>e)return t.slice(0,e)}return t}async next(){const e=await this.q.query(this.apiPath,this.query,this.post);return this._hasMore=e?.has_more||!1,this._count=Number.parseInt((e?.total_cards||0)+""),this._hasMore&&this.setNextPage(),e?.data||[]}async page(e){return this.query.page=e,this.next()}setNextPage(){this.query.page=this.query.page+1}}class n extends Error{constructor(e){super(e?.details),this.data=e,Object.setPrototypeOf(this,n.prototype)}}class o{static retry={attempts:1};static endpoint="https://api.scryfall.com";static lastQuery=100;static rateLimit=100;static canRetry(e){return"not_found"!=e?.code&&"bad_request"!=e?.code&&!o.retry.canRetry}static async debounce(){const e=Date.now(),t=e-o.lastQuery;if(t>=o.rateLimit)o.lastQuery=e;else{const e=o.rateLimit-t;o.lastQuery+=e,await o.sleep(e)}}static sleep(e=0){return new Promise((t=>setTimeout(t,e)))}static async tryQuery(e,t,a,s){await o.debounce();const i={data:a,method:a?"POST":"GET",params:t,url:`${o.endpoint}/${e}`,...s};try{return await r.default.request(i)}catch(e){if(e.isAxiosError){throw new n(e.response?.data)}throw e}}async query(e,t,a,r){let s,i;for(Array.isArray(e)&&(e=e.join("/")),s=0;s<o.retry.attempts;s++){let s;try{i=await o.tryQuery(`${e}`,t,a,r)}catch(e){if(!(e instanceof n))throw e;s=e.data}if(i||!o.canRetry(s))break;await o.sleep(o.retry.timeout)}return i?.data}}var i=new class extends o{async autoCompleteName(e){return(await this.query("cards/autocomplete",{q:e}))?.data||[]}async byArenaId(e){return this.query(["cards/arena",e])}async byId(e){return this.query(["cards",e])}async byMtgoId(e){return this.query(["cards/mtgo",e])}async byMultiverseId(e){return this.query(["cards/multiverse",e])}async byName(e,t,a=!1){return"boolean"==typeof t&&(a=t,t=void 0),this.query("cards/named",{[a?"fuzzy":"exact"]:e,set:t})}async bySet(e,t,a){const r=["cards",e,t];return a&&r.push(a),this.query(r)}async byTcgPlayerId(e){return this.query(["cards/tcgplayer",e])}async collection(...e){const t=[];for(let a=0;a<e.length;a+=75){const r={identifiers:e.slice(a,a+75)},s=await this.query("cards/collection",void 0,r);t.push(...s?.data||[])}return t}async random(){return this.query("cards/random")}search(e,t){return new s(this,"cards/search",{q:e,..."number"==typeof t?{page:t}:{page:1,...t}})}};var c=new class extends o{async artifactTypes(){return(await this.query("catalog/artifact-types"))?.data||[]}async artistNames(){return(await this.query("catalog/artist-names"))?.data||[]}async cardNames(){return(await this.query("catalog/card-names"))?.data||[]}async creatureTypes(){return(await this.query("catalog/creature-types"))?.data||[]}async enchantmentTypes(){return(await this.query("catalog/enchantment-types"))?.data||[]}async landTypes(){return(await this.query("catalog/land-types"))?.data||[]}async loyalties(){return(await this.query("catalog/loyalties"))?.data||[]}async planeswalkerTypes(){return(await this.query("catalog/planeswalker-types"))?.data||[]}async powers(){return(await this.query("catalog/powers"))?.data||[]}async spellTypes(){return(await this.query("catalog/spell-types"))?.data||[]}async toughnesses(){return(await this.query("catalog/toughnesses"))?.data||[]}async watermarks(){return(await this.query("catalog/watermarks"))?.data||[]}async wordBank(){return(await this.query("catalog/word-bank"))?.data||[]}};var d=new class extends o{async byArenaId(e){return(await this.query(["cards/arena",e,"rulings"]))?.data||[]}async byId(e){return(await this.query(["cards",e,"rulings"]))?.data||[]}async byMtgoId(e){return(await this.query(["cards/mtgo",e,"rulings"]))?.data||[]}async byMultiverseId(e){return(await this.query(["cards/multiverse",e,"rulings"]))?.data||[]}async bySet(e,t){return(await this.query(["cards",e,`${t}`,"rulings"]))?.data||[]}};var u=new class extends o{async all(){return(await this.query("sets"))?.data||[]}async byCode(e){return await this.query(["sets",e])}async byId(e){return this.query(["sets",e])}async byTcgPlayerId(e){return this.query(["sets/tcgplayer",e])}};var l,y,m,p,h,g,f,w,b,_,v,q,k,x,T,I=new class extends o{async all(){return(await this.query("symbology"))?.data||[]}async parseMana(e){return await this.query("symbology/parse-mana",{cost:e})}};e.Border=void 0,(l=e.Border||(e.Border={}))[l.black=0]="black",l[l.borderless=1]="borderless",l[l.gold=2]="gold",l[l.silver=3]="silver",l[l.white=4]="white",e.BulkDataTypes=void 0,(y=e.BulkDataTypes||(e.BulkDataTypes={}))[y.oracle_cards=0]="oracle_cards",y[y.unique_artwork=1]="unique_artwork",y[y.default_cards=2]="default_cards",y[y.all_cards=3]="all_cards",y[y.rulings=4]="rulings",function(e){e[e.W=0]="W",e[e.B=1]="B",e[e.R=2]="R",e[e.U=3]="U",e[e.G=4]="G"}(m||(m={})),e.Format=void 0,(p=e.Format||(e.Format={}))[p.standard=0]="standard",p[p.future=1]="future",p[p.historic=2]="historic",p[p.pioneer=3]="pioneer",p[p.modern=4]="modern",p[p.legacy=5]="legacy",p[p.pauper=6]="pauper",p[p.vintage=7]="vintage",p[p.penny=8]="penny",p[p.commander=9]="commander",p[p.brawl=10]="brawl",p[p.duel=11]="duel",p[p.oldschool=12]="oldschool",e.FrameEffect=void 0,(h=e.FrameEffect||(e.FrameEffect={}))[h.legendary=0]="legendary",h[h.miracle=1]="miracle",h[h.nyxtouched=2]="nyxtouched",h[h.draft=3]="draft",h[h.devoid=4]="devoid",h[h.tombstone=5]="tombstone",h[h.colorshifted=6]="colorshifted",h[h.inverted=7]="inverted",h[h.sunmoondfc=8]="sunmoondfc",h[h.compasslanddfc=9]="compasslanddfc",h[h.originpwdfc=10]="originpwdfc",h[h.mooneldrazidfc=11]="mooneldrazidfc",h[h.moonreversemoondfc=12]="moonreversemoondfc",h[h.showcase=13]="showcase",h[h.extendedart=14]="extendedart",e.Game=void 0,(g=e.Game||(e.Game={}))[g.paper=0]="paper",g[g.arena=1]="arena",g[g.mtgo=2]="mtgo",e.Layout=void 0,(f=e.Layout||(e.Layout={}))[f.normal=0]="normal",f[f.split=1]="split",f[f.flip=2]="flip",f[f.transform=3]="transform",f[f.modal_dfc=4]="modal_dfc",f[f.meld=5]="meld",f[f.leveler=6]="leveler",f[f.class=7]="class",f[f.saga=8]="saga",f[f.adventure=9]="adventure",f[f.planar=10]="planar",f[f.scheme=11]="scheme",f[f.vanguard=12]="vanguard",f[f.token=13]="token",f[f.double_faced_token=14]="double_faced_token",f[f.emblem=15]="emblem",f[f.augment=16]="augment",f[f.host=17]="host",f[f.art_series=18]="art_series",f[f.reversible_card=19]="reversible_card",e.Legality=void 0,(w=e.Legality||(e.Legality={}))[w.legal=0]="legal",w[w.not_legal=1]="not_legal",w[w.restricted=2]="restricted",w[w.banned=3]="banned",e.PromoType=void 0,(b=e.PromoType||(e.PromoType={}))[b.tourney=0]="tourney",b[b.prerelease=1]="prerelease",b[b.datestamped=2]="datestamped",b[b.planeswalkerdeck=3]="planeswalkerdeck",b[b.buyabox=4]="buyabox",b[b.judgegift=5]="judgegift",b[b.event=6]="event",b[b.convention=7]="convention",b[b.starterdeck=8]="starterdeck",b[b.instore=9]="instore",b[b.setpromo=10]="setpromo",b[b.fnm=11]="fnm",b[b.openhouse=12]="openhouse",b[b.league=13]="league",b[b.draftweekend=14]="draftweekend",b[b.gameday=15]="gameday",b[b.release=16]="release",b[b.intropack=17]="intropack",b[b.giftbox=18]="giftbox",b[b.duels=19]="duels",b[b.wizardsplaynetwork=20]="wizardsplaynetwork",b[b.premiereshop=21]="premiereshop",b[b.playerrewards=22]="playerrewards",b[b.gateway=23]="gateway",b[b.arenaleague=24]="arenaleague",e.Rarity=void 0,(_=e.Rarity||(e.Rarity={}))[_.common=0]="common",_[_.uncommon=1]="uncommon",_[_.rare=2]="rare",_[_.mythic=3]="mythic",e.RelatedCardComponent=void 0,(v=e.RelatedCardComponent||(e.RelatedCardComponent={}))[v.token=0]="token",v[v.meld_part=1]="meld_part",v[v.meld_result=2]="meld_result",v[v.combo_piece=3]="combo_piece",e.SetType=void 0,(q=e.SetType||(e.SetType={}))[q.core=0]="core",q[q.expansion=1]="expansion",q[q.masters=2]="masters",q[q.masterpiece=3]="masterpiece",q[q.from_the_vault=4]="from_the_vault",q[q.spellbook=5]="spellbook",q[q.premium_deck=6]="premium_deck",q[q.duel_deck=7]="duel_deck",q[q.draft_innovation=8]="draft_innovation",q[q.treasure_chest=9]="treasure_chest",q[q.commander=10]="commander",q[q.planechase=11]="planechase",q[q.archenemy=12]="archenemy",q[q.vanguard=13]="vanguard",q[q.funny=14]="funny",q[q.starter=15]="starter",q[q.box=16]="box",q[q.promo=17]="promo",q[q.token=18]="token",q[q.memorabilia=19]="memorabilia",e.Sort=void 0,(k=e.Sort||(e.Sort={}))[k.name=0]="name",k[k.set=1]="set",k[k.released=2]="released",k[k.rarity=3]="rarity",k[k.color=4]="color",k[k.usd=5]="usd",k[k.tix=6]="tix",k[k.eur=7]="eur",k[k.cmc=8]="cmc",k[k.power=9]="power",k[k.toughness=10]="toughness",k[k.edhrec=11]="edhrec",k[k.artist=12]="artist",e.SortDirection=void 0,(x=e.SortDirection||(e.SortDirection={}))[x.auto=0]="auto",x[x.asc=1]="asc",x[x.desc=2]="desc",e.UniqueStrategy=void 0,(T=e.UniqueStrategy||(e.UniqueStrategy={}))[T.cards=0]="cards",T[T.art=1]="art",T[T.prints=2]="prints",e.CardIdentifierBuilder=class{static byId(e){return{id:e}}static byIllustrationId(e){return{illustration_id:e}}static byMtgoId(e){return{mtgo_id:e}}static byMultiverseId(e){return{multiverse_id:e}}static byName(e,t){return{name:e,set:t}}static byOracleId(e){return{oracle_id:e}}static bySet(e,t){return{collector_number:`${t}`,set:e}}},e.Cards=i,e.Catalog=c,e.MagicQueryError=n,e.Rulings=d,e.Sets=u,e.Symbology=I,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
|
-
//# sourceMappingURL=scryfall-api.umd.min.js.map
|