@carddex/sdk 0.1.0 → 0.2.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 +155 -0
- package/dist/index.cjs +444 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +583 -0
- package/dist/index.d.ts +583 -3
- package/dist/index.js +420 -1
- package/dist/index.js.map +1 -1
- package/package.json +48 -11
- package/dist/client.d.ts +0 -85
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -119
- package/dist/client.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -161
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,421 @@
|
|
|
1
|
-
|
|
1
|
+
// src/errors.ts
|
|
2
|
+
function parseRateLimitHeaders(headers) {
|
|
3
|
+
const num = (name) => {
|
|
4
|
+
const raw = headers.get(name);
|
|
5
|
+
if (raw == null) return null;
|
|
6
|
+
const n = Number(raw);
|
|
7
|
+
return Number.isFinite(n) ? n : null;
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
limit: num("X-RateLimit-Limit"),
|
|
11
|
+
dailyLimit: num("X-RateLimit-Daily-Limit"),
|
|
12
|
+
dailyRemaining: num("X-RateLimit-Daily-Remaining")
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
var CardDexError = class _CardDexError extends Error {
|
|
16
|
+
/** HTTP status code. `0` for a request that never got a response (network failure, abort). */
|
|
17
|
+
status;
|
|
18
|
+
/**
|
|
19
|
+
* The API's own `error.code`. For a response the API actually produced,
|
|
20
|
+
* this is the same number as `status` (see the note on `ApiErrorBody` in
|
|
21
|
+
* `types.ts`) — kept as its own field because a transport-level failure
|
|
22
|
+
* (no response at all) sets it to a string like `NETWORK_ERROR` instead.
|
|
23
|
+
*/
|
|
24
|
+
code;
|
|
25
|
+
/** Seconds to wait before retrying, parsed from `Retry-After` on a 429. `null` otherwise. */
|
|
26
|
+
retryAfter;
|
|
27
|
+
/** Rate-limit headers on the response, when there was one. */
|
|
28
|
+
rateLimit;
|
|
29
|
+
constructor(message, options) {
|
|
30
|
+
super(message, options.cause !== void 0 ? { cause: options.cause } : void 0);
|
|
31
|
+
this.name = "CardDexError";
|
|
32
|
+
this.status = options.status;
|
|
33
|
+
this.code = options.code;
|
|
34
|
+
this.retryAfter = options.retryAfter ?? null;
|
|
35
|
+
this.rateLimit = options.rateLimit ?? null;
|
|
36
|
+
Object.setPrototypeOf(this, _CardDexError.prototype);
|
|
37
|
+
}
|
|
38
|
+
/** Whether this is a 429 (either the per-minute or the daily cap). */
|
|
39
|
+
get isRateLimited() {
|
|
40
|
+
return this.status === 429;
|
|
41
|
+
}
|
|
42
|
+
static async fromResponse(response) {
|
|
43
|
+
const rateLimit = parseRateLimitHeaders(response.headers);
|
|
44
|
+
const retryAfterHeader = response.headers.get("Retry-After");
|
|
45
|
+
const retryAfter = retryAfterHeader != null ? Number(retryAfterHeader) : null;
|
|
46
|
+
let message = `CardDex API error (${response.status})`;
|
|
47
|
+
let code = response.status;
|
|
48
|
+
try {
|
|
49
|
+
const body = await response.clone().json();
|
|
50
|
+
if (body?.error) {
|
|
51
|
+
if (typeof body.error.message === "string") message = body.error.message;
|
|
52
|
+
if (typeof body.error.code === "number" || typeof body.error.code === "string") {
|
|
53
|
+
code = body.error.code;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
}
|
|
58
|
+
return new _CardDexError(message, {
|
|
59
|
+
status: response.status,
|
|
60
|
+
code,
|
|
61
|
+
retryAfter: Number.isFinite(retryAfter) ? retryAfter : null,
|
|
62
|
+
rateLimit
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
static network(cause) {
|
|
66
|
+
const message = cause instanceof Error ? cause.message : "Network request failed";
|
|
67
|
+
return new _CardDexError(message, { status: 0, code: "NETWORK_ERROR", cause });
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/http.ts
|
|
72
|
+
var DEFAULT_MAX_RETRIES = 2;
|
|
73
|
+
var DEFAULT_MAX_WAIT_SECONDS = 60;
|
|
74
|
+
function buildQueryString(params) {
|
|
75
|
+
if (!params) return "";
|
|
76
|
+
const search = new URLSearchParams();
|
|
77
|
+
for (const [key, value] of Object.entries(params)) {
|
|
78
|
+
if (value === void 0 || value === null) continue;
|
|
79
|
+
if (Array.isArray(value)) {
|
|
80
|
+
if (value.length === 0) continue;
|
|
81
|
+
search.set(key, value.join(","));
|
|
82
|
+
} else {
|
|
83
|
+
search.set(key, String(value));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const qs = search.toString();
|
|
87
|
+
return qs ? `?${qs}` : "";
|
|
88
|
+
}
|
|
89
|
+
function sleep(ms) {
|
|
90
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
91
|
+
}
|
|
92
|
+
var HttpClient = class {
|
|
93
|
+
baseUrl;
|
|
94
|
+
apiKey;
|
|
95
|
+
fetchImpl;
|
|
96
|
+
retryConfig;
|
|
97
|
+
constructor(options) {
|
|
98
|
+
this.baseUrl = options.baseUrl.replace(/\/+$/, "");
|
|
99
|
+
this.apiKey = options.apiKey;
|
|
100
|
+
this.fetchImpl = options.fetch;
|
|
101
|
+
if (options.retry === true) {
|
|
102
|
+
this.retryConfig = {
|
|
103
|
+
maxRetries: DEFAULT_MAX_RETRIES,
|
|
104
|
+
maxWaitSeconds: DEFAULT_MAX_WAIT_SECONDS
|
|
105
|
+
};
|
|
106
|
+
} else if (options.retry && typeof options.retry === "object") {
|
|
107
|
+
this.retryConfig = {
|
|
108
|
+
maxRetries: options.retry.maxRetries ?? DEFAULT_MAX_RETRIES,
|
|
109
|
+
maxWaitSeconds: options.retry.maxWaitSeconds ?? DEFAULT_MAX_WAIT_SECONDS
|
|
110
|
+
};
|
|
111
|
+
} else {
|
|
112
|
+
this.retryConfig = null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async get(path, query, signal) {
|
|
116
|
+
return this.request("GET", path, { query, signal });
|
|
117
|
+
}
|
|
118
|
+
async post(path, body, signal) {
|
|
119
|
+
return this.request("POST", path, { body, signal });
|
|
120
|
+
}
|
|
121
|
+
async request(method, path, opts) {
|
|
122
|
+
const url = `${this.baseUrl}${path}${buildQueryString(opts.query)}`;
|
|
123
|
+
const headers = { Accept: "application/json" };
|
|
124
|
+
if (this.apiKey) headers["X-API-Key"] = this.apiKey;
|
|
125
|
+
if (opts.body !== void 0) headers["Content-Type"] = "application/json";
|
|
126
|
+
let attempt = 0;
|
|
127
|
+
for (; ; ) {
|
|
128
|
+
let response;
|
|
129
|
+
try {
|
|
130
|
+
response = await this.fetchImpl(url, {
|
|
131
|
+
method,
|
|
132
|
+
headers,
|
|
133
|
+
body: opts.body !== void 0 ? JSON.stringify(opts.body) : void 0,
|
|
134
|
+
signal: opts.signal
|
|
135
|
+
});
|
|
136
|
+
} catch (cause) {
|
|
137
|
+
throw CardDexError.network(cause);
|
|
138
|
+
}
|
|
139
|
+
if (response.status === 429 && this.retryConfig && attempt < this.retryConfig.maxRetries) {
|
|
140
|
+
const retryAfterHeader = response.headers.get("Retry-After");
|
|
141
|
+
const retryAfterSeconds = retryAfterHeader != null ? Number(retryAfterHeader) : Number.NaN;
|
|
142
|
+
if (Number.isFinite(retryAfterSeconds) && retryAfterSeconds <= this.retryConfig.maxWaitSeconds) {
|
|
143
|
+
attempt++;
|
|
144
|
+
await sleep(retryAfterSeconds * 1e3);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (!response.ok) {
|
|
149
|
+
throw await CardDexError.fromResponse(response);
|
|
150
|
+
}
|
|
151
|
+
if (response.status === 204) return void 0;
|
|
152
|
+
return await response.json();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// src/resources/auth.ts
|
|
158
|
+
var AuthResource = class {
|
|
159
|
+
constructor(http) {
|
|
160
|
+
this.http = http;
|
|
161
|
+
}
|
|
162
|
+
http;
|
|
163
|
+
/**
|
|
164
|
+
* `POST /v1/auth/register` — claim a free API key. The key is returned
|
|
165
|
+
* exactly once, so store it immediately. A lost key can be replaced by signing
|
|
166
|
+
* in at https://carddex.dev/account (create, rotate or revoke keys there).
|
|
167
|
+
*/
|
|
168
|
+
async register(email, name) {
|
|
169
|
+
const res = await this.http.post("/v1/auth/register", {
|
|
170
|
+
email,
|
|
171
|
+
name
|
|
172
|
+
});
|
|
173
|
+
return res.data;
|
|
174
|
+
}
|
|
175
|
+
/** `GET /v1/auth/usage` — usage stats for the API key this client was constructed with. Requires an `apiKey`. */
|
|
176
|
+
async usage() {
|
|
177
|
+
const res = await this.http.get("/v1/auth/usage");
|
|
178
|
+
return res.data;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// src/pagination.ts
|
|
183
|
+
async function* paginate(fetchPage, startPage = 1) {
|
|
184
|
+
let page = startPage;
|
|
185
|
+
for (; ; ) {
|
|
186
|
+
const response = await fetchPage(page);
|
|
187
|
+
if (response.data.length === 0) return;
|
|
188
|
+
yield* response.data;
|
|
189
|
+
if (page >= response.meta.totalPages) return;
|
|
190
|
+
page++;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// src/resources/cards.ts
|
|
195
|
+
var CardsResource = class {
|
|
196
|
+
constructor(http) {
|
|
197
|
+
this.http = http;
|
|
198
|
+
}
|
|
199
|
+
http;
|
|
200
|
+
/** `GET /v1/cards` — list, search, filter and sort cards. */
|
|
201
|
+
list(params) {
|
|
202
|
+
return this.http.get("/v1/cards", params);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Iterates every card matching `params` across all pages, fetching pages
|
|
206
|
+
* lazily as you consume them.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* for await (const card of client.cards.listAll({ set: 'sv06' })) { ... }
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
listAll(params) {
|
|
214
|
+
return paginate((page) => this.list({ ...params, page }));
|
|
215
|
+
}
|
|
216
|
+
/** `GET /v1/cards/random` */
|
|
217
|
+
async random() {
|
|
218
|
+
const res = await this.http.get("/v1/cards/random");
|
|
219
|
+
return res.data;
|
|
220
|
+
}
|
|
221
|
+
/** `GET /v1/cards/{id}` */
|
|
222
|
+
async get(id, params) {
|
|
223
|
+
const res = await this.http.get(
|
|
224
|
+
`/v1/cards/${encodeURIComponent(id)}`,
|
|
225
|
+
params
|
|
226
|
+
);
|
|
227
|
+
return res.data;
|
|
228
|
+
}
|
|
229
|
+
/** `GET /v1/cards/{id}/prices` — the latest price row(s) for a card. */
|
|
230
|
+
async prices(id, params) {
|
|
231
|
+
const res = await this.http.get(
|
|
232
|
+
`/v1/cards/${encodeURIComponent(id)}/prices`,
|
|
233
|
+
params
|
|
234
|
+
);
|
|
235
|
+
return res.data;
|
|
236
|
+
}
|
|
237
|
+
/** `GET /v1/cards/{id}/prices/history` — one row per day per price guide, oldest first. */
|
|
238
|
+
async priceHistory(id, params) {
|
|
239
|
+
const res = await this.http.get(
|
|
240
|
+
`/v1/cards/${encodeURIComponent(id)}/prices/history`,
|
|
241
|
+
params
|
|
242
|
+
);
|
|
243
|
+
return res.data;
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// src/resources/prices.ts
|
|
248
|
+
var PricesResource = class {
|
|
249
|
+
constructor(http) {
|
|
250
|
+
this.http = http;
|
|
251
|
+
}
|
|
252
|
+
http;
|
|
253
|
+
/**
|
|
254
|
+
* `GET /v1/prices` — latest price rows for up to 100 card ids (and/or up
|
|
255
|
+
* to 100 print/variant ids) in one request. Keyed by the id you asked for;
|
|
256
|
+
* an id with no price data maps to `[]`.
|
|
257
|
+
*/
|
|
258
|
+
async bulk(params) {
|
|
259
|
+
const res = await this.http.get(
|
|
260
|
+
"/v1/prices",
|
|
261
|
+
params
|
|
262
|
+
);
|
|
263
|
+
return res.data;
|
|
264
|
+
}
|
|
265
|
+
/** `GET /v1/prices/top` — highest-valued cards. */
|
|
266
|
+
async top(params) {
|
|
267
|
+
const res = await this.http.get("/v1/prices/top", params);
|
|
268
|
+
return res.data;
|
|
269
|
+
}
|
|
270
|
+
/** `GET /v1/prices/trends` — biggest movers against the card's own rolling average. */
|
|
271
|
+
async trends(params) {
|
|
272
|
+
const res = await this.http.get("/v1/prices/trends", params);
|
|
273
|
+
return res.data;
|
|
274
|
+
}
|
|
275
|
+
/** `GET /v1/prices/bargains` — cards trading below a reference price, best discount first. */
|
|
276
|
+
async bargains(params) {
|
|
277
|
+
const res = await this.http.get(
|
|
278
|
+
"/v1/prices/bargains",
|
|
279
|
+
params
|
|
280
|
+
);
|
|
281
|
+
return res.data;
|
|
282
|
+
}
|
|
283
|
+
/** `GET /v1/prices/{cardId}/history` — one row per day per guide, oldest first. */
|
|
284
|
+
async history(cardId, params) {
|
|
285
|
+
const res = await this.http.get(
|
|
286
|
+
`/v1/prices/${encodeURIComponent(cardId)}/history`,
|
|
287
|
+
params
|
|
288
|
+
);
|
|
289
|
+
return res.data;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
// src/resources/sealed.ts
|
|
294
|
+
var SealedResource = class {
|
|
295
|
+
constructor(http) {
|
|
296
|
+
this.http = http;
|
|
297
|
+
}
|
|
298
|
+
http;
|
|
299
|
+
/** `GET /v1/sealed` — list sealed products with their latest price. */
|
|
300
|
+
list(params) {
|
|
301
|
+
return this.http.get("/v1/sealed", params);
|
|
302
|
+
}
|
|
303
|
+
/** Iterates every sealed product matching `params` across all pages. */
|
|
304
|
+
listAll(params) {
|
|
305
|
+
return paginate((page) => this.list({ ...params, page }));
|
|
306
|
+
}
|
|
307
|
+
/** `GET /v1/sealed/{id}` */
|
|
308
|
+
async get(id, params) {
|
|
309
|
+
const res = await this.http.get(
|
|
310
|
+
`/v1/sealed/${encodeURIComponent(id)}`,
|
|
311
|
+
params
|
|
312
|
+
);
|
|
313
|
+
return res.data;
|
|
314
|
+
}
|
|
315
|
+
/** `GET /v1/sealed/{id}/prices` — one row per synced day, oldest first. */
|
|
316
|
+
async prices(id, params) {
|
|
317
|
+
const res = await this.http.get(
|
|
318
|
+
`/v1/sealed/${encodeURIComponent(id)}/prices`,
|
|
319
|
+
params
|
|
320
|
+
);
|
|
321
|
+
return res.data;
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
// src/resources/sets.ts
|
|
326
|
+
var SetsResource = class {
|
|
327
|
+
constructor(http) {
|
|
328
|
+
this.http = http;
|
|
329
|
+
}
|
|
330
|
+
http;
|
|
331
|
+
/** `GET /v1/sets` — every set. */
|
|
332
|
+
async list() {
|
|
333
|
+
const res = await this.http.get("/v1/sets");
|
|
334
|
+
return res.data;
|
|
335
|
+
}
|
|
336
|
+
/** `GET /v1/sets/{id}` */
|
|
337
|
+
async get(id) {
|
|
338
|
+
const res = await this.http.get(
|
|
339
|
+
`/v1/sets/${encodeURIComponent(id)}`
|
|
340
|
+
);
|
|
341
|
+
return res.data;
|
|
342
|
+
}
|
|
343
|
+
/** `GET /v1/sets/{id}/cards` */
|
|
344
|
+
cards(id, params) {
|
|
345
|
+
return this.http.get(
|
|
346
|
+
`/v1/sets/${encodeURIComponent(id)}/cards`,
|
|
347
|
+
params
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
/** Iterates every card in a set across all pages. */
|
|
351
|
+
cardsAll(id, params) {
|
|
352
|
+
return paginate((page) => this.cards(id, { ...params, page }));
|
|
353
|
+
}
|
|
354
|
+
/** `GET /v1/sets/{id}/cards/{cardId}/neighbors` — the 2 previous / 2 next card ids. */
|
|
355
|
+
async neighbors(setId, cardId) {
|
|
356
|
+
const res = await this.http.get(
|
|
357
|
+
`/v1/sets/${encodeURIComponent(setId)}/cards/${encodeURIComponent(cardId)}/neighbors`
|
|
358
|
+
);
|
|
359
|
+
return res.data;
|
|
360
|
+
}
|
|
361
|
+
/** `GET /v1/sets/{id}/sealed` — sealed products attached to a set, each with its latest price. */
|
|
362
|
+
async sealed(id, params) {
|
|
363
|
+
const res = await this.http.get(
|
|
364
|
+
`/v1/sets/${encodeURIComponent(id)}/sealed`,
|
|
365
|
+
params
|
|
366
|
+
);
|
|
367
|
+
return res.data;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// src/client.ts
|
|
372
|
+
var DEFAULT_BASE_URL = "https://api.carddex.dev";
|
|
373
|
+
function isBrowserLike() {
|
|
374
|
+
return typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
375
|
+
}
|
|
376
|
+
var CardDex = class {
|
|
377
|
+
cards;
|
|
378
|
+
sets;
|
|
379
|
+
sealed;
|
|
380
|
+
prices;
|
|
381
|
+
auth;
|
|
382
|
+
http;
|
|
383
|
+
constructor(options = {}) {
|
|
384
|
+
if (options.apiKey && isBrowserLike()) {
|
|
385
|
+
console.warn(
|
|
386
|
+
"[@carddex/sdk] An apiKey was passed in what looks like a browser environment. API keys shipped in frontend code are visible to every visitor. Omit apiKey for CardDex's anonymous browser mode, or proxy authenticated requests through your own backend."
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
const fetchImpl = options.fetch ?? globalThis.fetch;
|
|
390
|
+
if (!fetchImpl) {
|
|
391
|
+
throw new Error(
|
|
392
|
+
"@carddex/sdk requires a global fetch implementation. On Node < 18, pass one via `fetch` in the options."
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
this.http = new HttpClient({
|
|
396
|
+
baseUrl: options.baseUrl ?? DEFAULT_BASE_URL,
|
|
397
|
+
apiKey: options.apiKey,
|
|
398
|
+
fetch: fetchImpl.bind(globalThis),
|
|
399
|
+
retry: options.retry
|
|
400
|
+
});
|
|
401
|
+
this.cards = new CardsResource(this.http);
|
|
402
|
+
this.sets = new SetsResource(this.http);
|
|
403
|
+
this.sealed = new SealedResource(this.http);
|
|
404
|
+
this.prices = new PricesResource(this.http);
|
|
405
|
+
this.auth = new AuthResource(this.http);
|
|
406
|
+
}
|
|
407
|
+
/** `GET /v1/auth/usage` — shorthand for `client.auth.usage()`. Requires an `apiKey`. */
|
|
408
|
+
usage() {
|
|
409
|
+
return this.auth.usage();
|
|
410
|
+
}
|
|
411
|
+
/** `GET /v1/health` — API health, price freshness, and cron status. */
|
|
412
|
+
async health() {
|
|
413
|
+
return this.http.get("/v1/health");
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
export {
|
|
417
|
+
CardDex,
|
|
418
|
+
CardDexError,
|
|
419
|
+
paginate
|
|
420
|
+
};
|
|
2
421
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/http.ts","../src/resources/auth.ts","../src/pagination.ts","../src/resources/cards.ts","../src/resources/prices.ts","../src/resources/sealed.ts","../src/resources/sets.ts","../src/client.ts"],"sourcesContent":["/** Rate-limit info parsed from response headers, when present. */\nexport interface RateLimitInfo {\n /** `X-RateLimit-Limit`: requests allowed per minute. */\n limit: number | null;\n /** `X-RateLimit-Daily-Limit`: requests allowed per UTC day, or `null` when the tier is uncapped. */\n dailyLimit: number | null;\n /** `X-RateLimit-Daily-Remaining`: approximate, can lag by about a minute. `null` when the API couldn't compute it. */\n dailyRemaining: number | null;\n}\n\nfunction parseRateLimitHeaders(headers: Headers): RateLimitInfo {\n const num = (name: string): number | null => {\n const raw = headers.get(name);\n if (raw == null) return null;\n const n = Number(raw);\n return Number.isFinite(n) ? n : null;\n };\n return {\n limit: num('X-RateLimit-Limit'),\n dailyLimit: num('X-RateLimit-Daily-Limit'),\n dailyRemaining: num('X-RateLimit-Daily-Remaining'),\n };\n}\n\n/**\n * Thrown for any non-2xx response, and for network/parse failures the fetch\n * layer can't attribute to the API itself.\n */\nexport class CardDexError extends Error {\n /** HTTP status code. `0` for a request that never got a response (network failure, abort). */\n readonly status: number;\n /**\n * The API's own `error.code`. For a response the API actually produced,\n * this is the same number as `status` (see the note on `ApiErrorBody` in\n * `types.ts`) — kept as its own field because a transport-level failure\n * (no response at all) sets it to a string like `NETWORK_ERROR` instead.\n */\n readonly code: number | string;\n /** Seconds to wait before retrying, parsed from `Retry-After` on a 429. `null` otherwise. */\n readonly retryAfter: number | null;\n /** Rate-limit headers on the response, when there was one. */\n readonly rateLimit: RateLimitInfo | null;\n\n constructor(\n message: string,\n options: {\n status: number;\n code: number | string;\n retryAfter?: number | null;\n rateLimit?: RateLimitInfo | null;\n cause?: unknown;\n },\n ) {\n super(message, options.cause !== undefined ? { cause: options.cause } : undefined);\n this.name = 'CardDexError';\n this.status = options.status;\n this.code = options.code;\n this.retryAfter = options.retryAfter ?? null;\n this.rateLimit = options.rateLimit ?? null;\n Object.setPrototypeOf(this, CardDexError.prototype);\n }\n\n /** Whether this is a 429 (either the per-minute or the daily cap). */\n get isRateLimited(): boolean {\n return this.status === 429;\n }\n\n static async fromResponse(response: Response): Promise<CardDexError> {\n const rateLimit = parseRateLimitHeaders(response.headers);\n const retryAfterHeader = response.headers.get('Retry-After');\n const retryAfter = retryAfterHeader != null ? Number(retryAfterHeader) : null;\n\n let message = `CardDex API error (${response.status})`;\n let code: number | string = response.status;\n try {\n const body = (await response.clone().json()) as {\n error?: { code?: unknown; message?: unknown };\n };\n if (body?.error) {\n if (typeof body.error.message === 'string') message = body.error.message;\n if (typeof body.error.code === 'number' || typeof body.error.code === 'string') {\n code = body.error.code;\n }\n }\n } catch {\n // Non-JSON or empty error body — fall back to the status-derived message above.\n }\n\n return new CardDexError(message, {\n status: response.status,\n code,\n retryAfter: Number.isFinite(retryAfter) ? retryAfter : null,\n rateLimit,\n });\n }\n\n static network(cause: unknown): CardDexError {\n const message = cause instanceof Error ? cause.message : 'Network request failed';\n return new CardDexError(message, { status: 0, code: 'NETWORK_ERROR', cause });\n }\n}\n","import { CardDexError } from './errors.js';\n\nexport type QueryValue =\n | string\n | number\n | boolean\n | undefined\n | null\n | readonly (string | number)[];\nexport type QueryParams = Record<string, QueryValue>;\n\nexport interface RetryOptions {\n /** Max retry attempts on 429. Default 2. */\n maxRetries?: number;\n /**\n * A computed `Retry-After` above this many seconds is never honoured — the\n * request fails immediately instead of sleeping (this is what keeps a\n * daily-quota 429, whose `Retry-After` can be most of a day, from blocking\n * for hours). Default 60, matching the per-minute limiter's own\n * `Retry-After: 60`.\n */\n maxWaitSeconds?: number;\n}\n\nexport interface HttpClientOptions {\n baseUrl: string;\n apiKey?: string;\n fetch: typeof fetch;\n /** `false` (default) disables retries; `true` enables them with the defaults below. */\n retry?: boolean | RetryOptions;\n}\n\nconst DEFAULT_MAX_RETRIES = 2;\nconst DEFAULT_MAX_WAIT_SECONDS = 60;\n\nfunction buildQueryString(params?: QueryParams): string {\n if (!params) return '';\n const search = new URLSearchParams();\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined || value === null) continue;\n if (Array.isArray(value)) {\n if (value.length === 0) continue;\n search.set(key, value.join(','));\n } else {\n search.set(key, String(value));\n }\n }\n const qs = search.toString();\n return qs ? `?${qs}` : '';\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\n/**\n * Minimal fetch wrapper: builds URLs, attaches auth, parses JSON, and turns\n * non-2xx responses into `CardDexError`. No dependency beyond global `fetch`.\n */\nexport class HttpClient {\n private readonly baseUrl: string;\n private readonly apiKey: string | undefined;\n private readonly fetchImpl: typeof fetch;\n private readonly retryConfig: Required<RetryOptions> | null;\n\n constructor(options: HttpClientOptions) {\n this.baseUrl = options.baseUrl.replace(/\\/+$/, '');\n this.apiKey = options.apiKey;\n this.fetchImpl = options.fetch;\n if (options.retry === true) {\n this.retryConfig = {\n maxRetries: DEFAULT_MAX_RETRIES,\n maxWaitSeconds: DEFAULT_MAX_WAIT_SECONDS,\n };\n } else if (options.retry && typeof options.retry === 'object') {\n this.retryConfig = {\n maxRetries: options.retry.maxRetries ?? DEFAULT_MAX_RETRIES,\n maxWaitSeconds: options.retry.maxWaitSeconds ?? DEFAULT_MAX_WAIT_SECONDS,\n };\n } else {\n this.retryConfig = null;\n }\n }\n\n async get<T>(path: string, query?: QueryParams, signal?: AbortSignal): Promise<T> {\n return this.request<T>('GET', path, { query, signal });\n }\n\n async post<T>(path: string, body?: unknown, signal?: AbortSignal): Promise<T> {\n return this.request<T>('POST', path, { body, signal });\n }\n\n private async request<T>(\n method: string,\n path: string,\n opts: { query?: QueryParams; body?: unknown; signal?: AbortSignal },\n ): Promise<T> {\n const url = `${this.baseUrl}${path}${buildQueryString(opts.query)}`;\n const headers: Record<string, string> = { Accept: 'application/json' };\n if (this.apiKey) headers['X-API-Key'] = this.apiKey;\n if (opts.body !== undefined) headers['Content-Type'] = 'application/json';\n\n let attempt = 0;\n for (;;) {\n let response: Response;\n try {\n response = await this.fetchImpl(url, {\n method,\n headers,\n body: opts.body !== undefined ? JSON.stringify(opts.body) : undefined,\n signal: opts.signal,\n });\n } catch (cause) {\n throw CardDexError.network(cause);\n }\n\n if (response.status === 429 && this.retryConfig && attempt < this.retryConfig.maxRetries) {\n const retryAfterHeader = response.headers.get('Retry-After');\n const retryAfterSeconds = retryAfterHeader != null ? Number(retryAfterHeader) : Number.NaN;\n if (\n Number.isFinite(retryAfterSeconds) &&\n retryAfterSeconds <= this.retryConfig.maxWaitSeconds\n ) {\n attempt++;\n await sleep(retryAfterSeconds * 1000);\n continue;\n }\n // Retry-After is missing or longer than we're willing to wait\n // (typically the daily cap, which resets at UTC midnight) — surface\n // the error instead of blocking.\n }\n\n if (!response.ok) {\n throw await CardDexError.fromResponse(response);\n }\n\n if (response.status === 204) return undefined as T;\n return (await response.json()) as T;\n }\n }\n}\n","import type { HttpClient } from '../http.js';\nimport type { RegisterResponse, SingleResponse, UsageResponse } from '../types.js';\n\nexport class AuthResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * `POST /v1/auth/register` — claim a free API key. The key is returned\n * exactly once, so store it immediately. A lost key can be replaced by signing\n * in at https://carddex.dev/account (create, rotate or revoke keys there).\n */\n async register(email: string, name?: string): Promise<RegisterResponse> {\n const res = await this.http.post<SingleResponse<RegisterResponse>>('/v1/auth/register', {\n email,\n name,\n });\n return res.data;\n }\n\n /** `GET /v1/auth/usage` — usage stats for the API key this client was constructed with. Requires an `apiKey`. */\n async usage(): Promise<UsageResponse> {\n const res = await this.http.get<SingleResponse<UsageResponse>>('/v1/auth/usage');\n return res.data;\n }\n}\n","import type { PaginatedResponse } from './types.js';\n\n/**\n * Turns a page-fetching function into an async iterator over every item,\n * fetching the next page lazily as the caller consumes items.\n *\n * @example\n * ```ts\n * for await (const card of paginate((page) => client.cards.list({ set: 'sv06', page }))) {\n * console.log(card.name);\n * }\n * ```\n */\nexport async function* paginate<T>(\n fetchPage: (page: number) => Promise<PaginatedResponse<T>>,\n startPage = 1,\n): AsyncGenerator<T, void, void> {\n let page = startPage;\n for (;;) {\n const response = await fetchPage(page);\n if (response.data.length === 0) return;\n yield* response.data;\n if (page >= response.meta.totalPages) return;\n page++;\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { paginate } from '../pagination.js';\nimport type {\n CardGetParams,\n CardListParams,\n CardPriceHistoryParams,\n CardPricesParams,\n} from '../params.js';\nimport type {\n Card,\n CardPrice,\n CardWithRelations,\n PaginatedResponse,\n SingleResponse,\n} from '../types.js';\n\nexport class CardsResource {\n constructor(private readonly http: HttpClient) {}\n\n /** `GET /v1/cards` — list, search, filter and sort cards. */\n list(params?: CardListParams): Promise<PaginatedResponse<Card>> {\n return this.http.get<PaginatedResponse<Card>>('/v1/cards', params);\n }\n\n /**\n * Iterates every card matching `params` across all pages, fetching pages\n * lazily as you consume them.\n *\n * @example\n * ```ts\n * for await (const card of client.cards.listAll({ set: 'sv06' })) { ... }\n * ```\n */\n listAll(params?: Omit<CardListParams, 'page'>): AsyncGenerator<Card, void, void> {\n return paginate((page) => this.list({ ...params, page }));\n }\n\n /** `GET /v1/cards/random` */\n async random(): Promise<CardWithRelations> {\n const res = await this.http.get<SingleResponse<CardWithRelations>>('/v1/cards/random');\n return res.data;\n }\n\n /** `GET /v1/cards/{id}` */\n async get(id: string, params?: CardGetParams): Promise<CardWithRelations> {\n const res = await this.http.get<SingleResponse<CardWithRelations>>(\n `/v1/cards/${encodeURIComponent(id)}`,\n params,\n );\n return res.data;\n }\n\n /** `GET /v1/cards/{id}/prices` — the latest price row(s) for a card. */\n async prices(id: string, params?: CardPricesParams): Promise<CardPrice[]> {\n const res = await this.http.get<SingleResponse<CardPrice[]>>(\n `/v1/cards/${encodeURIComponent(id)}/prices`,\n params,\n );\n return res.data;\n }\n\n /** `GET /v1/cards/{id}/prices/history` — one row per day per price guide, oldest first. */\n async priceHistory(id: string, params?: CardPriceHistoryParams): Promise<CardPrice[]> {\n const res = await this.http.get<SingleResponse<CardPrice[]>>(\n `/v1/cards/${encodeURIComponent(id)}/prices/history`,\n params,\n );\n return res.data;\n }\n}\n","import type { HttpClient } from '../http.js';\nimport type {\n BargainsParams,\n BulkPricesParams,\n PriceHistoryParams,\n RankingParams,\n TrendsParams,\n} from '../params.js';\nimport type { BargainCardPrice, CardPrice, SingleResponse } from '../types.js';\n\nexport class PricesResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * `GET /v1/prices` — latest price rows for up to 100 card ids (and/or up\n * to 100 print/variant ids) in one request. Keyed by the id you asked for;\n * an id with no price data maps to `[]`.\n */\n async bulk(params: BulkPricesParams): Promise<Record<string, CardPrice[]>> {\n const res = await this.http.get<SingleResponse<Record<string, CardPrice[]>>>(\n '/v1/prices',\n params,\n );\n return res.data;\n }\n\n /** `GET /v1/prices/top` — highest-valued cards. */\n async top(params?: RankingParams): Promise<CardPrice[]> {\n const res = await this.http.get<SingleResponse<CardPrice[]>>('/v1/prices/top', params);\n return res.data;\n }\n\n /** `GET /v1/prices/trends` — biggest movers against the card's own rolling average. */\n async trends(params?: TrendsParams): Promise<CardPrice[]> {\n const res = await this.http.get<SingleResponse<CardPrice[]>>('/v1/prices/trends', params);\n return res.data;\n }\n\n /** `GET /v1/prices/bargains` — cards trading below a reference price, best discount first. */\n async bargains(params?: BargainsParams): Promise<BargainCardPrice[]> {\n const res = await this.http.get<SingleResponse<BargainCardPrice[]>>(\n '/v1/prices/bargains',\n params,\n );\n return res.data;\n }\n\n /** `GET /v1/prices/{cardId}/history` — one row per day per guide, oldest first. */\n async history(cardId: string, params?: PriceHistoryParams): Promise<CardPrice[]> {\n const res = await this.http.get<SingleResponse<CardPrice[]>>(\n `/v1/prices/${encodeURIComponent(cardId)}/history`,\n params,\n );\n return res.data;\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { paginate } from '../pagination.js';\nimport type { SealedListParams, SealedPriceHistoryParams } from '../params.js';\nimport type { PaginatedResponse, SealedPrice, SealedProduct, SingleResponse } from '../types.js';\n\nexport class SealedResource {\n constructor(private readonly http: HttpClient) {}\n\n /** `GET /v1/sealed` — list sealed products with their latest price. */\n list(params?: SealedListParams): Promise<PaginatedResponse<SealedProduct>> {\n return this.http.get<PaginatedResponse<SealedProduct>>('/v1/sealed', params);\n }\n\n /** Iterates every sealed product matching `params` across all pages. */\n listAll(params?: Omit<SealedListParams, 'page'>): AsyncGenerator<SealedProduct, void, void> {\n return paginate((page) => this.list({ ...params, page }));\n }\n\n /** `GET /v1/sealed/{id}` */\n async get(id: string, params?: { source?: SealedListParams['source'] }): Promise<SealedProduct> {\n const res = await this.http.get<SingleResponse<SealedProduct>>(\n `/v1/sealed/${encodeURIComponent(id)}`,\n params,\n );\n return res.data;\n }\n\n /** `GET /v1/sealed/{id}/prices` — one row per synced day, oldest first. */\n async prices(id: string, params?: SealedPriceHistoryParams): Promise<SealedPrice[]> {\n const res = await this.http.get<SingleResponse<SealedPrice[]>>(\n `/v1/sealed/${encodeURIComponent(id)}/prices`,\n params,\n );\n return res.data;\n }\n}\n","import type { HttpClient } from '../http.js';\nimport { paginate } from '../pagination.js';\nimport type { SealedPriceSource, SetCardsParams } from '../params.js';\nimport type {\n Card,\n CardDexSet,\n CardNeighbors,\n PaginatedResponse,\n SealedProduct,\n SingleResponse,\n} from '../types.js';\n\nexport class SetsResource {\n constructor(private readonly http: HttpClient) {}\n\n /** `GET /v1/sets` — every set. */\n async list(): Promise<CardDexSet[]> {\n const res = await this.http.get<SingleResponse<CardDexSet[]>>('/v1/sets');\n return res.data;\n }\n\n /** `GET /v1/sets/{id}` */\n async get(id: string): Promise<CardDexSet> {\n const res = await this.http.get<SingleResponse<CardDexSet>>(\n `/v1/sets/${encodeURIComponent(id)}`,\n );\n return res.data;\n }\n\n /** `GET /v1/sets/{id}/cards` */\n cards(id: string, params?: SetCardsParams): Promise<PaginatedResponse<Card>> {\n return this.http.get<PaginatedResponse<Card>>(\n `/v1/sets/${encodeURIComponent(id)}/cards`,\n params,\n );\n }\n\n /** Iterates every card in a set across all pages. */\n cardsAll(id: string, params?: Omit<SetCardsParams, 'page'>): AsyncGenerator<Card, void, void> {\n return paginate((page) => this.cards(id, { ...params, page }));\n }\n\n /** `GET /v1/sets/{id}/cards/{cardId}/neighbors` — the 2 previous / 2 next card ids. */\n async neighbors(setId: string, cardId: string): Promise<CardNeighbors> {\n const res = await this.http.get<SingleResponse<CardNeighbors>>(\n `/v1/sets/${encodeURIComponent(setId)}/cards/${encodeURIComponent(cardId)}/neighbors`,\n );\n return res.data;\n }\n\n /** `GET /v1/sets/{id}/sealed` — sealed products attached to a set, each with its latest price. */\n async sealed(id: string, params?: { source?: SealedPriceSource }): Promise<SealedProduct[]> {\n const res = await this.http.get<SingleResponse<SealedProduct[]>>(\n `/v1/sets/${encodeURIComponent(id)}/sealed`,\n params,\n );\n return res.data;\n }\n}\n","import type { RetryOptions } from './http.js';\nimport { HttpClient } from './http.js';\nimport { AuthResource } from './resources/auth.js';\nimport { CardsResource } from './resources/cards.js';\nimport { PricesResource } from './resources/prices.js';\nimport { SealedResource } from './resources/sealed.js';\nimport { SetsResource } from './resources/sets.js';\nimport type { HealthResponse, UsageResponse } from './types.js';\n\nconst DEFAULT_BASE_URL = 'https://api.carddex.dev';\n\nexport interface CardDexOptions {\n /**\n * A `pk_live_...` key from `POST /v1/auth/register`. Omit it to call the\n * API anonymously — CardDex allows this at a lower rate (30 req/min,\n * 5,000 req/day per IP), specifically so a browser can call it without a\n * key. **Never ship a real API key in public frontend code**: it would be\n * readable by anyone who opens dev tools and shared by every visitor to\n * your site. Proxy through your own backend instead if you need the\n * higher, keyed limits from a browser context.\n */\n apiKey?: string;\n /** Defaults to `https://api.carddex.dev`. Override for a local/staging API or a CORS proxy. */\n baseUrl?: string;\n /** Defaults to the global `fetch`. Override to inject a custom implementation (proxies, logging, tests). */\n fetch?: typeof fetch;\n /**\n * Automatic retry on `429`, honouring `Retry-After`. **Off by default.**\n * Pass `true` for the defaults (up to 2 retries, never waiting more than\n * 60s), or an object to tune them. A `Retry-After` longer than\n * `maxWaitSeconds` — typically the daily-quota reset, which can be most of\n * a day away — is never honoured; the request fails immediately instead.\n */\n retry?: boolean | RetryOptions;\n}\n\nfunction isBrowserLike(): boolean {\n return (\n typeof window !== 'undefined' &&\n typeof (window as { document?: unknown }).document !== 'undefined'\n );\n}\n\n/**\n * CardDex API client.\n *\n * ```ts\n * import { CardDex } from '@carddex/sdk';\n *\n * const client = new CardDex({ apiKey: process.env.CARDDEX_API_KEY });\n * const { data } = await client.cards.list({ name: 'Charizard' });\n * ```\n */\nexport class CardDex {\n readonly cards: CardsResource;\n readonly sets: SetsResource;\n readonly sealed: SealedResource;\n readonly prices: PricesResource;\n readonly auth: AuthResource;\n\n private readonly http: HttpClient;\n\n constructor(options: CardDexOptions = {}) {\n if (options.apiKey && isBrowserLike()) {\n // biome-ignore lint/suspicious/noConsole: deliberate one-time safety warning, not app logging\n console.warn(\n '[@carddex/sdk] An apiKey was passed in what looks like a browser environment. ' +\n 'API keys shipped in frontend code are visible to every visitor. Omit apiKey for ' +\n \"CardDex's anonymous browser mode, or proxy authenticated requests through your own backend.\",\n );\n }\n\n const fetchImpl = options.fetch ?? globalThis.fetch;\n if (!fetchImpl) {\n throw new Error(\n '@carddex/sdk requires a global fetch implementation. On Node < 18, pass one via `fetch` in the options.',\n );\n }\n\n this.http = new HttpClient({\n baseUrl: options.baseUrl ?? DEFAULT_BASE_URL,\n apiKey: options.apiKey,\n fetch: fetchImpl.bind(globalThis),\n retry: options.retry,\n });\n\n this.cards = new CardsResource(this.http);\n this.sets = new SetsResource(this.http);\n this.sealed = new SealedResource(this.http);\n this.prices = new PricesResource(this.http);\n this.auth = new AuthResource(this.http);\n }\n\n /** `GET /v1/auth/usage` — shorthand for `client.auth.usage()`. Requires an `apiKey`. */\n usage(): Promise<UsageResponse> {\n return this.auth.usage();\n }\n\n /** `GET /v1/health` — API health, price freshness, and cron status. */\n async health(): Promise<HealthResponse> {\n return this.http.get<HealthResponse>('/v1/health');\n }\n}\n"],"mappings":";AAUA,SAAS,sBAAsB,SAAiC;AAC9D,QAAM,MAAM,CAAC,SAAgC;AAC3C,UAAM,MAAM,QAAQ,IAAI,IAAI;AAC5B,QAAI,OAAO,KAAM,QAAO;AACxB,UAAM,IAAI,OAAO,GAAG;AACpB,WAAO,OAAO,SAAS,CAAC,IAAI,IAAI;AAAA,EAClC;AACA,SAAO;AAAA,IACL,OAAO,IAAI,mBAAmB;AAAA,IAC9B,YAAY,IAAI,yBAAyB;AAAA,IACzC,gBAAgB,IAAI,6BAA6B;AAAA,EACnD;AACF;AAMO,IAAM,eAAN,MAAM,sBAAqB,MAAM;AAAA;AAAA,EAE7B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAET,YACE,SACA,SAOA;AACA,UAAM,SAAS,QAAQ,UAA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|
2
2
|
"name": "@carddex/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "TypeScript
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Official TypeScript/JavaScript client for the CardDex Pokémon TCG API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pokemon",
|
|
7
|
+
"tcg",
|
|
8
|
+
"trading cards",
|
|
9
|
+
"api",
|
|
10
|
+
"sdk",
|
|
11
|
+
"carddex"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://carddex.dev/docs",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"email": "api@carddex.dev",
|
|
16
|
+
"url": "https://carddex.dev/docs"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "CardDex",
|
|
5
20
|
"type": "module",
|
|
6
|
-
"
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"main": "./dist/index.cjs",
|
|
23
|
+
"module": "./dist/index.js",
|
|
7
24
|
"types": "./dist/index.d.ts",
|
|
8
25
|
"exports": {
|
|
9
26
|
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
10
28
|
"import": "./dist/index.js",
|
|
11
|
-
"
|
|
12
|
-
}
|
|
29
|
+
"require": "./dist/index.cjs"
|
|
30
|
+
},
|
|
31
|
+
"./package.json": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE"
|
|
37
|
+
],
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
13
43
|
},
|
|
14
|
-
"files": ["dist"],
|
|
15
44
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"
|
|
45
|
+
"generate": "node scripts/generate.mjs",
|
|
46
|
+
"build": "tsup",
|
|
47
|
+
"dev": "tsup --watch",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"lint": "biome check .",
|
|
50
|
+
"format": "biome check --write .",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"test:watch": "vitest"
|
|
18
53
|
},
|
|
19
|
-
"
|
|
20
|
-
"license": "MIT",
|
|
54
|
+
"dependencies": {},
|
|
21
55
|
"devDependencies": {
|
|
22
|
-
"typescript": "^
|
|
56
|
+
"openapi-typescript": "^7.9.1",
|
|
57
|
+
"tsup": "^8.5.1",
|
|
58
|
+
"typescript": "^5.9.3",
|
|
59
|
+
"vitest": "^4.1.11"
|
|
23
60
|
}
|
|
24
61
|
}
|
package/dist/client.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { Card, CardWithRelations, CardListParams, CardPrice, Set, CardMeta, PaginatedResponse, CardDexClientOptions, WebhookSubscription } from './types.js';
|
|
2
|
-
export declare class CardDexClient {
|
|
3
|
-
private baseUrl;
|
|
4
|
-
private headers;
|
|
5
|
-
constructor(options?: CardDexClientOptions);
|
|
6
|
-
private fetch;
|
|
7
|
-
cards: {
|
|
8
|
-
list: (params?: CardListParams) => Promise<PaginatedResponse<Card>>;
|
|
9
|
-
get: (id: string, include?: CardListParams["include"]) => Promise<{
|
|
10
|
-
data: CardWithRelations;
|
|
11
|
-
}>;
|
|
12
|
-
random: () => Promise<{
|
|
13
|
-
data: CardWithRelations;
|
|
14
|
-
}>;
|
|
15
|
-
prices: (id: string, variantId?: string) => Promise<{
|
|
16
|
-
data: any[];
|
|
17
|
-
}>;
|
|
18
|
-
priceHistory: (id: string, options?: {
|
|
19
|
-
variantId?: string;
|
|
20
|
-
days?: number;
|
|
21
|
-
}) => Promise<{
|
|
22
|
-
data: any[];
|
|
23
|
-
}>;
|
|
24
|
-
rarities: () => Promise<{
|
|
25
|
-
data: string[];
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
sets: {
|
|
29
|
-
list: () => Promise<{
|
|
30
|
-
data: Set[];
|
|
31
|
-
}>;
|
|
32
|
-
get: (id: string) => Promise<{
|
|
33
|
-
data: Set;
|
|
34
|
-
}>;
|
|
35
|
-
cards: (id: string, params?: {
|
|
36
|
-
page?: number;
|
|
37
|
-
pageSize?: number;
|
|
38
|
-
}) => Promise<PaginatedResponse<Card>>;
|
|
39
|
-
};
|
|
40
|
-
prices: {
|
|
41
|
-
top: (limit?: number) => Promise<{
|
|
42
|
-
data: CardPrice[];
|
|
43
|
-
}>;
|
|
44
|
-
trends: (limit?: number) => Promise<{
|
|
45
|
-
data: CardPrice[];
|
|
46
|
-
}>;
|
|
47
|
-
};
|
|
48
|
-
meta: {
|
|
49
|
-
formats: () => Promise<{
|
|
50
|
-
data: {
|
|
51
|
-
id: string;
|
|
52
|
-
name: string;
|
|
53
|
-
}[];
|
|
54
|
-
}>;
|
|
55
|
-
top: (format: "standard" | "expanded" | "unlimited", limit?: number) => Promise<{
|
|
56
|
-
data: CardMeta[];
|
|
57
|
-
}>;
|
|
58
|
-
};
|
|
59
|
-
webhooks: {
|
|
60
|
-
subscribe: (url: string, events?: string[]) => Promise<{
|
|
61
|
-
data: WebhookSubscription;
|
|
62
|
-
}>;
|
|
63
|
-
list: () => Promise<{
|
|
64
|
-
data: WebhookSubscription[];
|
|
65
|
-
}>;
|
|
66
|
-
unsubscribe: (id: string) => Promise<{
|
|
67
|
-
data: {
|
|
68
|
-
message: string;
|
|
69
|
-
};
|
|
70
|
-
}>;
|
|
71
|
-
};
|
|
72
|
-
auth: {
|
|
73
|
-
register: (email: string, name?: string) => Promise<{
|
|
74
|
-
data: {
|
|
75
|
-
api_key: string;
|
|
76
|
-
tier: string;
|
|
77
|
-
rate_limit: number;
|
|
78
|
-
};
|
|
79
|
-
}>;
|
|
80
|
-
usage: () => Promise<{
|
|
81
|
-
data: any;
|
|
82
|
-
}>;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":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