dupr-js-client 0.1.1 → 1.0.1

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/index.cjs DELETED
@@ -1,603 +0,0 @@
1
- 'use strict';
2
-
3
- // src/config.ts
4
- function resolveConfig(opts) {
5
- const cfg = {
6
- baseUrl: opts.baseUrl ?? "https://uat.mydupr.com/api",
7
- version: opts.version ?? "v1.0",
8
- timeoutMs: opts.timeoutMs ?? 3e4,
9
- auth: opts.auth ?? { type: "none" },
10
- userAgent: opts.userAgent ?? "dupr-js-client/0.1.0",
11
- customFetch: opts.customFetch ?? globalThis.fetch.bind(globalThis),
12
- retry: opts.retry === false ? false : {
13
- maxRetries: opts.retry?.maxRetries ?? 3,
14
- baseDelayMs: opts.retry?.baseDelayMs ?? 1e3,
15
- maxDelayMs: opts.retry?.maxDelayMs ?? 3e4
16
- }
17
- };
18
- if (opts.onRequest) cfg.onRequest = opts.onRequest;
19
- if (opts.onResponse) cfg.onResponse = opts.onResponse;
20
- return cfg;
21
- }
22
-
23
- // src/errors.ts
24
- var DuprApiError = class extends Error {
25
- constructor(message, statusCode, details, duprRequestId) {
26
- super(message);
27
- this.statusCode = statusCode;
28
- this.details = details;
29
- this.duprRequestId = duprRequestId;
30
- this.name = "DuprApiError";
31
- Object.setPrototypeOf(this, new.target.prototype);
32
- }
33
- };
34
- var AuthenticationError = class extends DuprApiError {
35
- constructor(message, statusCode, details, duprRequestId) {
36
- super(message, statusCode, details, duprRequestId);
37
- this.name = "AuthenticationError";
38
- Object.setPrototypeOf(this, new.target.prototype);
39
- }
40
- };
41
- var ValidationError = class extends DuprApiError {
42
- constructor(message, statusCode, details, duprRequestId) {
43
- super(message, statusCode, details, duprRequestId);
44
- this.name = "ValidationError";
45
- Object.setPrototypeOf(this, new.target.prototype);
46
- }
47
- };
48
- var NotFoundError = class extends DuprApiError {
49
- constructor(message, statusCode, details, duprRequestId) {
50
- super(message, statusCode, details, duprRequestId);
51
- this.name = "NotFoundError";
52
- Object.setPrototypeOf(this, new.target.prototype);
53
- }
54
- };
55
- var RateLimitError = class extends DuprApiError {
56
- constructor(message, statusCode, details, duprRequestId) {
57
- super(message, statusCode, details, duprRequestId);
58
- this.name = "RateLimitError";
59
- Object.setPrototypeOf(this, new.target.prototype);
60
- }
61
- };
62
- var ServerError = class extends DuprApiError {
63
- constructor(message, statusCode, details, duprRequestId) {
64
- super(message, statusCode, details, duprRequestId);
65
- this.name = "ServerError";
66
- Object.setPrototypeOf(this, new.target.prototype);
67
- }
68
- };
69
- async function buildError(res) {
70
- let body;
71
- const requestId = res.headers.get("x-request-id") ?? res.headers.get("x-dupr-request-id") ?? void 0;
72
- try {
73
- body = await res.json();
74
- } catch {
75
- }
76
- const msg = (typeof body === "object" && body !== null && "message" in body && typeof body["message"] === "string" ? body["message"] : null) ?? `DUPR API error ${res.status}`;
77
- switch (true) {
78
- case (res.status === 401 || res.status === 403):
79
- return new AuthenticationError(msg, res.status, body, requestId);
80
- case res.status === 404:
81
- return new NotFoundError(msg, res.status, body, requestId);
82
- case res.status === 400:
83
- return new ValidationError(msg, res.status, body, requestId);
84
- case res.status === 429:
85
- return new RateLimitError(msg, res.status, body, requestId);
86
- case res.status >= 500:
87
- return new ServerError(msg, res.status, body, requestId);
88
- default:
89
- return new DuprApiError(msg, res.status, body, requestId);
90
- }
91
- }
92
-
93
- // src/http.ts
94
- function sleep(ms) {
95
- return new Promise((resolve) => setTimeout(resolve, ms));
96
- }
97
- function retryDelayMs(attempt, baseDelayMs, maxDelayMs) {
98
- const exp = Math.min(baseDelayMs * 2 ** attempt, maxDelayMs);
99
- return exp * (0.8 + Math.random() * 0.4);
100
- }
101
- function isRetryable(err) {
102
- if (err instanceof RateLimitError) return true;
103
- if (err instanceof ServerError) return true;
104
- if (err instanceof TypeError) return true;
105
- return false;
106
- }
107
- var HttpClient = class {
108
- constructor(config) {
109
- this.config = config;
110
- this.token = null;
111
- this.tokenExpiresAt = 0;
112
- }
113
- async getBearerToken() {
114
- if (this.config.overrideBearerToken) {
115
- return this.config.overrideBearerToken;
116
- }
117
- if (this.config.auth.type === "staticBearer") {
118
- return this.config.auth.bearerToken;
119
- }
120
- if (this.config.auth.type !== "clientCredentials") {
121
- throw new AuthenticationError("No auth configured \u2014 set auth in DuprClientOptions or call setBearerToken()", 401);
122
- }
123
- if (this.token && Date.now() < this.tokenExpiresAt) {
124
- return this.token;
125
- }
126
- const { clientKey, clientSecret } = this.config.auth;
127
- const encoded = Buffer.from(`${clientKey}:${clientSecret}`).toString("base64");
128
- const url = `${this.config.baseUrl}/auth/${this.config.version}/token`;
129
- const start = Date.now();
130
- const res = await this.config.customFetch(url, {
131
- method: "POST",
132
- headers: {
133
- "x-authorization": encoded,
134
- "User-Agent": this.config.userAgent
135
- },
136
- signal: AbortSignal.timeout(this.config.timeoutMs)
137
- });
138
- this.config.onResponse?.({ status: res.status, url, durationMs: Date.now() - start });
139
- if (!res.ok) throw await buildError(res);
140
- const body = await res.json();
141
- this.token = body.token ?? body.accessToken ?? null;
142
- if (!this.token) throw new AuthenticationError("Token response contained no token", 401);
143
- const ttlSec = body.expiresIn ?? 3600;
144
- this.tokenExpiresAt = Date.now() + (ttlSec - 60) * 1e3;
145
- return this.token;
146
- }
147
- async get(path, init) {
148
- return this.request("GET", path, init);
149
- }
150
- async post(path, body, init) {
151
- const extra = { headers: { "Content-Type": "application/json", ...init?.headers ?? {} } };
152
- if (body !== void 0) extra.body = JSON.stringify(body);
153
- return this.request("POST", path, { ...init, ...extra });
154
- }
155
- async delete(path, body, init) {
156
- const extra = { headers: { "Content-Type": "application/json", ...init?.headers ?? {} } };
157
- if (body !== void 0) extra.body = JSON.stringify(body);
158
- return this.request("DELETE", path, { ...init, ...extra });
159
- }
160
- async request(method, path, init) {
161
- const retryCfg = this.config.retry;
162
- const maxAttempts = retryCfg === false ? 1 : retryCfg.maxRetries + 1;
163
- let lastErr;
164
- for (let attempt = 0; attempt < maxAttempts; attempt++) {
165
- try {
166
- return await this.rawRequest(method, path, init);
167
- } catch (err) {
168
- lastErr = err;
169
- if (attempt >= maxAttempts - 1) break;
170
- if (!isRetryable(err)) break;
171
- if (retryCfg === false) break;
172
- let delay;
173
- if (err instanceof RateLimitError) {
174
- const retryAfterSec = err.details !== null && typeof err.details === "object" && "retryAfterSeconds" in err.details ? Number(err.details.retryAfterSeconds) : NaN;
175
- delay = Number.isFinite(retryAfterSec) && retryAfterSec > 0 ? retryAfterSec * 1e3 : retryDelayMs(attempt, retryCfg.baseDelayMs, retryCfg.maxDelayMs);
176
- } else {
177
- delay = retryDelayMs(attempt, retryCfg.baseDelayMs, retryCfg.maxDelayMs);
178
- }
179
- await sleep(delay);
180
- }
181
- }
182
- throw lastErr;
183
- }
184
- async rawRequest(method, path, init) {
185
- const token = await this.getBearerToken();
186
- const url = `${this.config.baseUrl}${path}`;
187
- const headers = {
188
- Authorization: `Bearer ${token}`,
189
- "User-Agent": this.config.userAgent,
190
- ...init?.headers ?? {}
191
- };
192
- this.config.onRequest?.({ method, url, headers });
193
- const start = Date.now();
194
- const res = await this.config.customFetch(url, {
195
- method,
196
- ...init,
197
- headers,
198
- signal: AbortSignal.timeout(this.config.timeoutMs)
199
- });
200
- this.config.onResponse?.({ status: res.status, url, durationMs: Date.now() - start });
201
- if (!res.ok) {
202
- const err = await buildError(res);
203
- if (err instanceof RateLimitError) {
204
- const retryAfter = res.headers.get("Retry-After");
205
- if (retryAfter) {
206
- err.details = typeof err.details === "object" && err.details !== null ? { ...err.details, retryAfterSeconds: Number(retryAfter) } : { retryAfterSeconds: Number(retryAfter) };
207
- }
208
- }
209
- throw err;
210
- }
211
- if (res.status === 204 || res.headers.get("content-length") === "0") {
212
- return void 0;
213
- }
214
- return res.json();
215
- }
216
- };
217
-
218
- // src/auth.ts
219
- var AuthModule = class {
220
- constructor(http, config) {
221
- this.http = http;
222
- this.config = config;
223
- }
224
- /**
225
- * Explicitly request a new access token using client credentials.
226
- * Normally you don't need to call this — the HTTP client handles token refresh automatically.
227
- */
228
- async getToken() {
229
- if (this.config.auth.type !== "clientCredentials") {
230
- throw new AuthenticationError("getToken() requires clientCredentials auth mode", 401);
231
- }
232
- const { clientKey, clientSecret } = this.config.auth;
233
- const encoded = Buffer.from(`${clientKey}:${clientSecret}`).toString("base64");
234
- const url = `${this.config.baseUrl}/auth/${this.config.version}/token`;
235
- const res = await this.config.customFetch(url, {
236
- method: "POST",
237
- headers: {
238
- "x-authorization": encoded,
239
- "User-Agent": this.config.userAgent
240
- },
241
- signal: AbortSignal.timeout(this.config.timeoutMs)
242
- });
243
- if (!res.ok) {
244
- const body = await res.json().catch(() => void 0);
245
- throw new AuthenticationError(
246
- body?.["message"] ?? `Auth failed: ${res.status}`,
247
- res.status,
248
- body
249
- );
250
- }
251
- return res.json();
252
- }
253
- // ── Authorization Code Flow ───────────────────────────────────────────────
254
- //
255
- // Use this flow to let end-users authorise your app to act on their behalf
256
- // (e.g. the "Connect DUPR" button). The user is redirected to DUPR's login
257
- // page, then back to your redirectUri with an authorization code.
258
- //
259
- // NOTE: This requires a DUPR OAuth application with an authorization endpoint
260
- // separate from the Partner API client credentials. Confirm the exact
261
- // authorization URL with DUPR support.
262
- //
263
- // Typical flow:
264
- // 1. client.auth.getAuthorizationUrl({ redirectUri, state }) → redirect user
265
- // 2. User approves → DUPR calls back to redirectUri?code=xxx&state=yyy
266
- // 3. client.auth.exchangeCode({ code, redirectUri }) → tokens
267
- // 4. Store access_token + refresh_token; call client.setBearerToken(access_token)
268
- // 5. When access_token expires: client.auth.refreshToken(refresh_token)
269
- /**
270
- * Build the DUPR authorization URL to redirect the user to for login.
271
- * The `authorizationUrl` config option must be set (see above note).
272
- */
273
- getAuthorizationUrl(params) {
274
- const authUrl = this.config.authorizationUrl;
275
- if (!authUrl) {
276
- throw new Error(
277
- "authorizationUrl is not configured. Pass it in DuprClientOptions to use the Authorization Code flow."
278
- );
279
- }
280
- const url = new URL(authUrl);
281
- const clientId = this.config.auth.type === "clientCredentials" ? this.config.auth.clientKey : "";
282
- url.searchParams.set("response_type", "code");
283
- url.searchParams.set("client_id", clientId);
284
- url.searchParams.set("redirect_uri", params.redirectUri);
285
- if (params.scopes?.length) url.searchParams.set("scope", params.scopes.join(" "));
286
- if (params.state) url.searchParams.set("state", params.state);
287
- return url.toString();
288
- }
289
- /**
290
- * Exchange an authorization code (from the OAuth callback) for access + refresh tokens.
291
- * Uses `POST /auth/{version}/token` with `grant_type=authorization_code`.
292
- */
293
- async exchangeCode(params) {
294
- if (this.config.auth.type !== "clientCredentials") {
295
- throw new AuthenticationError("exchangeCode() requires clientCredentials auth configured with clientKey/clientSecret", 401);
296
- }
297
- const { clientKey, clientSecret } = this.config.auth;
298
- const url = `${this.config.baseUrl}/auth/${this.config.version}/token`;
299
- const body = new URLSearchParams({
300
- grant_type: "authorization_code",
301
- code: params.code,
302
- redirect_uri: params.redirectUri,
303
- client_id: clientKey,
304
- client_secret: clientSecret
305
- });
306
- const res = await this.config.customFetch(url, {
307
- method: "POST",
308
- headers: {
309
- "Content-Type": "application/x-www-form-urlencoded",
310
- "User-Agent": this.config.userAgent
311
- },
312
- body: body.toString(),
313
- signal: AbortSignal.timeout(this.config.timeoutMs)
314
- });
315
- if (!res.ok) {
316
- const errBody = await res.json().catch(() => void 0);
317
- throw new AuthenticationError(
318
- errBody?.["message"] ?? `Code exchange failed: ${res.status}`,
319
- res.status,
320
- errBody
321
- );
322
- }
323
- return res.json();
324
- }
325
- /**
326
- * Obtain a new access token using a refresh token from a previous Authorization Code flow.
327
- * Uses `POST /auth/{version}/token` with `grant_type=refresh_token`.
328
- */
329
- async refreshToken(refreshToken) {
330
- if (this.config.auth.type !== "clientCredentials") {
331
- throw new AuthenticationError("refreshToken() requires clientCredentials auth configured", 401);
332
- }
333
- const { clientKey, clientSecret } = this.config.auth;
334
- const url = `${this.config.baseUrl}/auth/${this.config.version}/token`;
335
- const body = new URLSearchParams({
336
- grant_type: "refresh_token",
337
- refresh_token: refreshToken,
338
- client_id: clientKey,
339
- client_secret: clientSecret
340
- });
341
- const res = await this.config.customFetch(url, {
342
- method: "POST",
343
- headers: {
344
- "Content-Type": "application/x-www-form-urlencoded",
345
- "User-Agent": this.config.userAgent
346
- },
347
- body: body.toString(),
348
- signal: AbortSignal.timeout(this.config.timeoutMs)
349
- });
350
- if (!res.ok) {
351
- const errBody = await res.json().catch(() => void 0);
352
- throw new AuthenticationError(
353
- errBody?.["message"] ?? `Token refresh failed: ${res.status}`,
354
- res.status,
355
- errBody
356
- );
357
- }
358
- return res.json();
359
- }
360
- };
361
-
362
- // src/resources/users.ts
363
- var UsersModule = class {
364
- constructor(http, cfg) {
365
- this.http = http;
366
- this.cfg = cfg;
367
- }
368
- /** GET /user/{version}/{id} — basic player profile */
369
- getUser(duprId) {
370
- return this.http.get(`/user/${this.cfg.version}/${duprId}`);
371
- }
372
- /** GET /user/{version}/{id}/details — extended profile (requires USER_EMAIL::VIEW permission) */
373
- getExtendedUser(duprId) {
374
- return this.http.get(`/user/${this.cfg.version}/${duprId}/details`);
375
- }
376
- /** GET /user/{version}/{id}/clubs — club memberships for a player */
377
- getClubMemberships(duprId) {
378
- return this.http.get(`/user/${this.cfg.version}/${duprId}/clubs`);
379
- }
380
- /** POST /user/{version}/search — full-text player search with optional filters */
381
- search(req) {
382
- return this.http.post(`/user/${this.cfg.version}/search`, req);
383
- }
384
- /** POST /user/{version}/batch — fetch multiple players by DUPR ID in one request */
385
- getBatch(req) {
386
- return this.http.post(`/user/${this.cfg.version}/batch`, req);
387
- }
388
- /** POST /user/{version}/invite — pre-generate a DUPR ID and send an invite email */
389
- invite(req) {
390
- return this.http.post(`/user/${this.cfg.version}/invite`, req);
391
- }
392
- /** POST /user/{version}/subscription/grants — grant a subscription to a user */
393
- grantSubscription(req) {
394
- return this.http.post(`/user/${this.cfg.version}/subscription/grants`, req);
395
- }
396
- // ── Provisional ratings ──────────────────────────────────────
397
- /** POST /user/{version}/provisional_rating — get provisional ratings for a player */
398
- getProvisionalRating(req) {
399
- return this.http.post(`/user/${this.cfg.version}/provisional_rating`, req);
400
- }
401
- /** POST /user/{version}/provisional_rating/create */
402
- createProvisionalRating(req) {
403
- return this.http.post(`/user/${this.cfg.version}/provisional_rating/create`, req);
404
- }
405
- /** POST /user/{version}/provisional_rating/update */
406
- updateProvisionalRating(req) {
407
- return this.http.post(`/user/${this.cfg.version}/provisional_rating/update`, req);
408
- }
409
- /** DELETE /user/{version}/provisional_rating/delete */
410
- deleteProvisionalRating(req) {
411
- return this.http.delete(`/user/${this.cfg.version}/provisional_rating/delete`, req);
412
- }
413
- };
414
-
415
- // src/resources/players.ts
416
- var PlayersModule = class {
417
- constructor(http, cfg) {
418
- this.http = http;
419
- this.cfg = cfg;
420
- }
421
- /** POST /{version}/player/duprid-by-email — resolve a DUPR ID from an email address */
422
- getDuprIdByEmail(req) {
423
- return this.http.post(`/${this.cfg.version}/player/duprid-by-email`, req);
424
- }
425
- };
426
-
427
- // src/resources/playerRating.ts
428
- var PlayerRatingModule = class {
429
- constructor(http, cfg) {
430
- this.http = http;
431
- this.cfg = cfg;
432
- }
433
- /** POST /history — get rating history for a player */
434
- getHistory(req) {
435
- return this.http.post(`/history`, req);
436
- }
437
- /** GET /{version}/subscribe/rating-changes — list currently subscribed DUPR IDs */
438
- getSubscriptions() {
439
- return this.http.get(`/${this.cfg.version}/subscribe/rating-changes`);
440
- }
441
- /** POST /{version}/subscribe/rating-changes — subscribe to rating-change events for a list of players */
442
- subscribe(req) {
443
- return this.http.post(`/${this.cfg.version}/subscribe/rating-changes`, req);
444
- }
445
- /** DELETE /{version}/subscribe/rating-changes — unsubscribe from rating-change events */
446
- unsubscribe(req) {
447
- return this.http.delete(`/${this.cfg.version}/subscribe/rating-changes`, req);
448
- }
449
- };
450
-
451
- // src/resources/matches.ts
452
- var MatchesModule = class {
453
- constructor(http, cfg) {
454
- this.http = http;
455
- this.cfg = cfg;
456
- }
457
- /** GET /match/{version}/{id} — view a single match */
458
- get(matchId) {
459
- return this.http.get(`/match/${this.cfg.version}/${matchId}`);
460
- }
461
- /** POST /match/{version}/create — submit a new match result */
462
- create(match) {
463
- return this.http.post(`/match/${this.cfg.version}/create`, match);
464
- }
465
- /** POST /match/{version}/batch — submit multiple match results in one call */
466
- createBulk(matches) {
467
- return this.http.post(`/match/${this.cfg.version}/batch`, matches);
468
- }
469
- /** POST /match/{version}/update — update an existing match */
470
- update(req) {
471
- return this.http.post(`/match/${this.cfg.version}/update`, req);
472
- }
473
- /** DELETE /match/{version}/delete — delete a match */
474
- delete(req) {
475
- return this.http.delete(`/match/${this.cfg.version}/delete`, req);
476
- }
477
- /** POST /match/{version}/annotate — attach vendor-specific metadata to a match */
478
- annotate(req) {
479
- return this.http.post(`/match/${this.cfg.version}/annotate`, req);
480
- }
481
- /** DELETE /match/{version}/annotate/{matchId} — remove a match annotation */
482
- deleteAnnotation(matchId) {
483
- return this.http.delete(`/match/${this.cfg.version}/annotate/${matchId}`);
484
- }
485
- /** POST /match/history/search — search a player's match history */
486
- searchHistory(req) {
487
- return this.http.post(`/match/history/search`, req);
488
- }
489
- };
490
-
491
- // src/resources/clubs.ts
492
- var ClubsModule = class {
493
- constructor(http, cfg) {
494
- this.http = http;
495
- this.cfg = cfg;
496
- }
497
- /** POST /club/{version}/members — get ratings for all members of a club */
498
- membersRating(req) {
499
- return this.http.post(`/club/${this.cfg.version}/members`, req);
500
- }
501
- /** POST /club/{version}/match/search — search matches associated with a club */
502
- searchMatches(req) {
503
- return this.http.post(`/club/${this.cfg.version}/match/search`, req);
504
- }
505
- };
506
-
507
- // src/resources/events.ts
508
- var EventsModule = class {
509
- constructor(http, cfg) {
510
- this.http = http;
511
- this.cfg = cfg;
512
- }
513
- /** POST /events/{version}/create */
514
- create(req) {
515
- return this.http.post(`/events/${this.cfg.version}/create`, req);
516
- }
517
- /** GET /events/{version}/get */
518
- get(req) {
519
- return this.http.post(`/events/${this.cfg.version}/get`, req);
520
- }
521
- /** POST /events/{version}/update */
522
- update(req) {
523
- return this.http.post(`/events/${this.cfg.version}/update`, req);
524
- }
525
- /** POST /events/{version}/delete */
526
- delete(req) {
527
- return this.http.post(`/events/${this.cfg.version}/delete`, req);
528
- }
529
- };
530
-
531
- // src/resources/webhooks.ts
532
- var WebhooksModule = class {
533
- constructor(http, cfg) {
534
- this.http = http;
535
- this.cfg = cfg;
536
- }
537
- /** POST /{version}/webhook — register a webhook endpoint */
538
- register(req) {
539
- return this.http.post(`/${this.cfg.version}/webhook`, req);
540
- }
541
- /** GET /{version}/topic — list all available webhook topics */
542
- getTopics() {
543
- return this.http.get(`/${this.cfg.version}/topic`);
544
- }
545
- /** GET /{version}/webhook/schema — list available webhook schemas */
546
- listSchemas() {
547
- return this.http.get(`/${this.cfg.version}/webhook/schema`);
548
- }
549
- /** GET /{version}/webhook/schema/{topic} — get the JSON schema for a specific topic */
550
- getSchema(topic) {
551
- return this.http.get(`/${this.cfg.version}/webhook/schema/${topic}`);
552
- }
553
- /** POST /user/{version}/subscribe/webhook-event — subscribe specific users to a webhook topic */
554
- subscribeUsers(req) {
555
- return this.http.post(`/user/${this.cfg.version}/subscribe/webhook-event`, req);
556
- }
557
- /** DELETE /user/{version}/subscribe/webhook-event — unsubscribe specific users from a webhook topic */
558
- unsubscribeUsers(req) {
559
- return this.http.delete(`/user/${this.cfg.version}/subscribe/webhook-event`, req);
560
- }
561
- };
562
-
563
- // src/client.ts
564
- var DuprClient = class {
565
- constructor(opts = {}) {
566
- this.config = resolveConfig(opts);
567
- const http = new HttpClient(this.config);
568
- this.auth = new AuthModule(http, this.config);
569
- this.users = new UsersModule(http, this.config);
570
- this.players = new PlayersModule(http, this.config);
571
- this.playerRating = new PlayerRatingModule(http, this.config);
572
- this.matches = new MatchesModule(http, this.config);
573
- this.clubs = new ClubsModule(http, this.config);
574
- this.events = new EventsModule(http, this.config);
575
- this.webhooks = new WebhooksModule(http, this.config);
576
- }
577
- /** Override the bearer token at runtime — useful when your backend handles auth separately. */
578
- setBearerToken(token) {
579
- this.config.overrideBearerToken = token;
580
- }
581
- /** Clear the runtime bearer token override and fall back to configured auth. */
582
- clearBearerToken() {
583
- delete this.config.overrideBearerToken;
584
- }
585
- };
586
-
587
- exports.AuthModule = AuthModule;
588
- exports.AuthenticationError = AuthenticationError;
589
- exports.ClubsModule = ClubsModule;
590
- exports.DuprApiError = DuprApiError;
591
- exports.DuprClient = DuprClient;
592
- exports.EventsModule = EventsModule;
593
- exports.MatchesModule = MatchesModule;
594
- exports.NotFoundError = NotFoundError;
595
- exports.PlayerRatingModule = PlayerRatingModule;
596
- exports.PlayersModule = PlayersModule;
597
- exports.RateLimitError = RateLimitError;
598
- exports.ServerError = ServerError;
599
- exports.UsersModule = UsersModule;
600
- exports.ValidationError = ValidationError;
601
- exports.WebhooksModule = WebhooksModule;
602
- //# sourceMappingURL=index.cjs.map
603
- //# sourceMappingURL=index.cjs.map