@fundedfast/sdk 1.3.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +104 -0
  2. package/README.md +352 -0
  3. package/dist/cjs/client.d.ts +130 -0
  4. package/dist/cjs/client.d.ts.map +1 -0
  5. package/dist/cjs/client.js +362 -0
  6. package/dist/cjs/client.js.map +1 -0
  7. package/dist/cjs/index.d.ts +27 -0
  8. package/dist/cjs/index.d.ts.map +1 -0
  9. package/dist/cjs/index.js +33 -0
  10. package/dist/cjs/index.js.map +1 -0
  11. package/dist/cjs/package.json +1 -0
  12. package/dist/cjs/resources/admin.d.ts +597 -0
  13. package/dist/cjs/resources/admin.d.ts.map +1 -0
  14. package/dist/cjs/resources/admin.js +842 -0
  15. package/dist/cjs/resources/admin.js.map +1 -0
  16. package/dist/cjs/resources/public.d.ts +519 -0
  17. package/dist/cjs/resources/public.d.ts.map +1 -0
  18. package/dist/cjs/resources/public.js +588 -0
  19. package/dist/cjs/resources/public.js.map +1 -0
  20. package/dist/cjs/types.d.ts +651 -0
  21. package/dist/cjs/types.d.ts.map +1 -0
  22. package/dist/cjs/types.js +11 -0
  23. package/dist/cjs/types.js.map +1 -0
  24. package/dist/cjs/webhooks.d.ts +104 -0
  25. package/dist/cjs/webhooks.d.ts.map +1 -0
  26. package/dist/cjs/webhooks.js +199 -0
  27. package/dist/cjs/webhooks.js.map +1 -0
  28. package/dist/esm/client.d.ts +130 -0
  29. package/dist/esm/client.d.ts.map +1 -0
  30. package/dist/esm/client.js +355 -0
  31. package/dist/esm/client.js.map +1 -0
  32. package/dist/esm/index.d.ts +27 -0
  33. package/dist/esm/index.d.ts.map +1 -0
  34. package/dist/esm/index.js +26 -0
  35. package/dist/esm/index.js.map +1 -0
  36. package/dist/esm/resources/admin.d.ts +597 -0
  37. package/dist/esm/resources/admin.d.ts.map +1 -0
  38. package/dist/esm/resources/admin.js +816 -0
  39. package/dist/esm/resources/admin.js.map +1 -0
  40. package/dist/esm/resources/public.d.ts +519 -0
  41. package/dist/esm/resources/public.d.ts.map +1 -0
  42. package/dist/esm/resources/public.js +578 -0
  43. package/dist/esm/resources/public.js.map +1 -0
  44. package/dist/esm/types.d.ts +651 -0
  45. package/dist/esm/types.d.ts.map +1 -0
  46. package/dist/esm/types.js +10 -0
  47. package/dist/esm/types.js.map +1 -0
  48. package/dist/esm/webhooks.d.ts +104 -0
  49. package/dist/esm/webhooks.d.ts.map +1 -0
  50. package/dist/esm/webhooks.js +159 -0
  51. package/dist/esm/webhooks.js.map +1 -0
  52. package/package.json +72 -0
@@ -0,0 +1,578 @@
1
+ export class ChallengesApi {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ /**
7
+ * List all enabled challenge tiers available for purchase.
8
+ *
9
+ * @returns Array of challenge tiers with pricing, rules, and configuration.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const tiers = await fast.challenges.listTiers();
14
+ * for (const tier of tiers) {
15
+ * console.log(`${tier.name}: ${tier.purchasePrice} ${tier.currency}`);
16
+ * }
17
+ * ```
18
+ */
19
+ async listTiers() {
20
+ const res = await this.client.request('GET', '/challenge-tiers');
21
+ return res.challengeTiers;
22
+ }
23
+ /**
24
+ * Get terms, rules, and disclosures for a tier.
25
+ * Display these to the user before purchase for regulatory compliance.
26
+ *
27
+ * @param tierId - UUID of the challenge tier
28
+ */
29
+ async getTierTerms(tierId) {
30
+ return this.client.request('GET', `/challenge-tiers/${tierId}/terms`);
31
+ }
32
+ /**
33
+ * Purchase a challenge for a user.
34
+ *
35
+ * Your sportsbook collects payment first, then calls this endpoint to activate
36
+ * the challenge in FAST. If an approvalUrl is configured, FAST will call your
37
+ * backend for approval (type: 'purchase') before proceeding.
38
+ *
39
+ * @param data - Purchase details (userId + challengeTierId)
40
+ * @returns The created challenge with starting balance and expiry
41
+ *
42
+ * @throws {FastApiError} 409 if user already has an active challenge or funded account
43
+ * @throws {FastApiError} 400 if tier is disabled or not found
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * const challenge = await fast.challenges.purchase({
48
+ * userId: 'player-42',
49
+ * challengeTierId: 'tier-uuid',
50
+ * referralCode: 'PARTNER-100',
51
+ * });
52
+ * console.log(`Challenge started, expires: ${challenge.expiresAt}`);
53
+ * ```
54
+ */
55
+ async purchase(data) {
56
+ const res = await this.client.request('POST', '/challenges/purchase', { body: data });
57
+ return res.challenge;
58
+ }
59
+ /**
60
+ * Get the public leaderboard.
61
+ *
62
+ * Returns top challengers by balance. User IDs are anonymized.
63
+ *
64
+ * @param period - Time window: 'week', 'month', or 'all' (default: 'week')
65
+ * @param limit - Max entries to return (default: 10, max: 50)
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * const leaders = await fast.challenges.leaderboard('week', 10);
70
+ * for (const entry of leaders) {
71
+ * console.log(`${entry.displayName}: ${entry.currentBalance}`);
72
+ * }
73
+ * ```
74
+ */
75
+ async leaderboard(period, limit) {
76
+ const query = {};
77
+ if (period)
78
+ query.period = period;
79
+ if (limit)
80
+ query.limit = String(limit);
81
+ const res = await this.client.request('GET', '/leaderboard', { query });
82
+ return res.leaderboard;
83
+ }
84
+ }
85
+ /**
86
+ * Bet validation and ingestion.
87
+ */
88
+ export class BetsApi {
89
+ client;
90
+ constructor(client) {
91
+ this.client = client;
92
+ }
93
+ /**
94
+ * Validate a bet against the active ruleset without recording it.
95
+ *
96
+ * Call this before confirming a bet placement. Returns accept/reject
97
+ * with specific reason codes. Does not affect balance or counters.
98
+ *
99
+ * @param bet - The bet to validate
100
+ * @returns Validation result with status and reason codes
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * const result = await fast.bets.validate({
105
+ * userId: 'player-42',
106
+ * externalBetId: 'BET-001',
107
+ * stakeAmount: 5.00,
108
+ * odds: 2.10,
109
+ * status: 'placed',
110
+ * });
111
+ *
112
+ * if (result.status === 'rejected') {
113
+ * console.log('Rejected:', result.reasonCodes);
114
+ * // Show rejection reason to user in sportsbook UI
115
+ * }
116
+ * ```
117
+ */
118
+ async validate(bet) {
119
+ const res = await this.client.request('POST', '/bets/validate', { body: bet });
120
+ return res.validationResult;
121
+ }
122
+ /**
123
+ * Ingest a bet event (placement or settlement).
124
+ *
125
+ * Send ALL bet events here: placements, settlements (won/lost), and voids.
126
+ * Behavior depends on your integration mode:
127
+ * - **sync**: Validates, records in shadow ledger, returns full result (200)
128
+ * - **async**: Accepts immediately (202), processes in background
129
+ *
130
+ * @param bet - The bet event to ingest
131
+ * @returns Processing result with mode and optional validation result
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * // Placement
136
+ * await fast.bets.ingest({
137
+ * userId: 'player-42',
138
+ * externalBetId: 'BET-001',
139
+ * stakeAmount: 5.00,
140
+ * odds: 2.10,
141
+ * status: 'placed',
142
+ * });
143
+ *
144
+ * // Settlement
145
+ * await fast.bets.ingest({
146
+ * userId: 'player-42',
147
+ * externalBetId: 'BET-001',
148
+ * stakeAmount: 5.00,
149
+ * odds: 2.10,
150
+ * status: 'settled-won',
151
+ * settlementAmount: 10.50,
152
+ * });
153
+ * ```
154
+ */
155
+ async ingest(bet) {
156
+ return this.client.request('POST', '/bets', { body: bet });
157
+ }
158
+ /**
159
+ * Ingest a batch of bet events (up to 100 per request).
160
+ *
161
+ * Supports partial success - some bets may fail while others succeed.
162
+ * Check the `results` array for per-bet status.
163
+ *
164
+ * @param bets - Array of bet events (max 100)
165
+ * @returns Batch result with per-bet status
166
+ *
167
+ * @throws {FastApiError} 400 if batch exceeds 100 bets
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * const result = await fast.bets.ingestBatch(betEvents);
172
+ * console.log(`${result.processed}/${result.total} processed`);
173
+ * for (const r of result.results.filter(r => r.status === 'failed')) {
174
+ * console.error(`${r.externalBetId}: ${r.error}`);
175
+ * }
176
+ * ```
177
+ */
178
+ async ingestBatch(bets) {
179
+ return this.client.request('POST', '/bets/batch', { body: { bets } });
180
+ }
181
+ }
182
+ /**
183
+ * User progress, history, and withdrawals.
184
+ */
185
+ export class UsersApi {
186
+ client;
187
+ constructor(client) {
188
+ this.client = client;
189
+ }
190
+ /**
191
+ * Get user progress (challenge, funded account, or none).
192
+ *
193
+ * Returns a discriminated union - check the `type` field:
194
+ * - `challenge`: user has an active challenge
195
+ * - `funded_account`: user has an active funded account
196
+ * - `none`: user has no active position
197
+ *
198
+ * @param userId - Your sportsbook user identifier
199
+ *
200
+ * @example
201
+ * ```typescript
202
+ * const progress = await fast.users.getProgress('player-42');
203
+ *
204
+ * switch (progress.type) {
205
+ * case 'challenge':
206
+ * showChallengeUI(progress.currentBalance, progress.targetBalance);
207
+ * break;
208
+ * case 'funded_account':
209
+ * showFundedUI(progress.withdrawableProfit);
210
+ * break;
211
+ * case 'none':
212
+ * showChallengePurchaseUI();
213
+ * break;
214
+ * }
215
+ * ```
216
+ */
217
+ async getProgress(userId) {
218
+ return this.client.request('GET', `/users/${userId}/progress`);
219
+ }
220
+ /**
221
+ * Get the active ruleset for a user.
222
+ *
223
+ * Returns the full ruleset currently governing this user's bets.
224
+ * Useful for displaying bet limits in your sportsbook UI.
225
+ *
226
+ * @param userId - Your sportsbook user identifier
227
+ * @throws {FastApiError} 404 if user has no active challenge or funded account
228
+ */
229
+ async getRuleset(userId) {
230
+ const res = await this.client.request('GET', `/users/${userId}/ruleset`);
231
+ return res.ruleset;
232
+ }
233
+ /**
234
+ * Get user challenge and funded account history.
235
+ *
236
+ * Returns all past challenges and funded accounts ordered by creation date descending.
237
+ *
238
+ * @param userId - Your sportsbook user identifier
239
+ */
240
+ async getHistory(userId) {
241
+ return this.client.request('GET', `/users/${userId}/history`);
242
+ }
243
+ /**
244
+ * Get detailed withdrawable profit calculation.
245
+ *
246
+ * Shows the exact amount the user can withdraw right now, factoring in
247
+ * profit split, payout cap, active day requirements, and pending bets.
248
+ *
249
+ * @param userId - Your sportsbook user identifier
250
+ * @throws {FastApiError} 404 if user has no active funded account
251
+ */
252
+ async getWithdrawable(userId) {
253
+ return this.client.request('GET', `/users/${userId}/withdrawable`);
254
+ }
255
+ /**
256
+ * Process a withdrawal from a funded account.
257
+ *
258
+ * Deducts the amount from the user's funded account balance and returns
259
+ * the profit split breakdown. Your sportsbook handles the actual payout.
260
+ *
261
+ * If an approvalUrl is configured, FAST will call your backend for approval
262
+ * (type: 'withdrawal') before proceeding.
263
+ *
264
+ * @param userId - Your sportsbook user identifier
265
+ * @param data - Withdrawal amount
266
+ * @returns Balance after withdrawal and profit split breakdown
267
+ *
268
+ * @throws {FastApiError} 400 if amount exceeds withdrawable profit
269
+ * @throws {FastApiError} 400 if active day requirement not met
270
+ *
271
+ * @example
272
+ * ```typescript
273
+ * const result = await fast.users.withdraw('player-42', { amount: 200 });
274
+ * console.log(`Paid user: ${result.userPayout}, kept: ${result.operatorShare}`);
275
+ * // Now process the actual payout in your payment system
276
+ * ```
277
+ */
278
+ async withdraw(userId, data) {
279
+ return this.client.request('POST', `/users/${userId}/withdraw`, { body: data });
280
+ }
281
+ /**
282
+ * Get user event timeline.
283
+ *
284
+ * Chronological timeline of all events: purchases, bets, settlements,
285
+ * state changes, achievements, rewards. Designed for dispute resolution.
286
+ *
287
+ * @param userId - Your sportsbook user identifier
288
+ */
289
+ async getTimeline(userId) {
290
+ const res = await this.client.request('GET', `/users/${userId}/timeline`);
291
+ return res.timeline;
292
+ }
293
+ /**
294
+ * Get user achievements with progress.
295
+ *
296
+ * Returns earned and locked achievements, streak info, total points, and level.
297
+ *
298
+ * @param userId - Your sportsbook user identifier
299
+ *
300
+ * @example
301
+ * ```typescript
302
+ * const data = await fast.users.getAchievements('player-42');
303
+ * console.log(`Level ${data.level}, ${data.totalPoints} points`);
304
+ * for (const a of data.achievements.filter(a => a.earned)) {
305
+ * console.log(`Earned: ${a.name} (${a.rarity})`);
306
+ * }
307
+ * ```
308
+ */
309
+ async getAchievements(userId) {
310
+ return this.client.request('GET', `/users/${userId}/achievements`);
311
+ }
312
+ /**
313
+ * Get user rewards (active and claimable).
314
+ *
315
+ * Returns two lists: rewards already applied (auto-mode) and rewards
316
+ * waiting for the user to claim.
317
+ *
318
+ * @param userId - Your sportsbook user identifier
319
+ */
320
+ async getRewards(userId) {
321
+ return this.client.request('GET', `/users/${userId}/rewards`);
322
+ }
323
+ /**
324
+ * Claim a pending reward.
325
+ *
326
+ * Only works for rewards with applyMode='claim'. For balance_boost_percent
327
+ * rewards, applies the boost immediately to the active challenge/funded account.
328
+ *
329
+ * @param userId - Your sportsbook user identifier
330
+ * @param rewardId - UUID of the reward to claim
331
+ *
332
+ * @throws {FastApiError} 404 if reward not found or already claimed
333
+ */
334
+ async claimReward(userId, rewardId) {
335
+ return this.client.request('POST', `/users/${userId}/rewards/${rewardId}/claim`);
336
+ }
337
+ /**
338
+ * Notify FAST of a sportsbook withdrawal.
339
+ *
340
+ * Triggers engagement side-effects (e.g. forfeiting bonuses with
341
+ * forfeitOnWithdrawal flag). Independent of FAST funded accounts.
342
+ *
343
+ * @param userId - Your sportsbook user identifier
344
+ * @param amount - Withdrawal amount in base currency
345
+ * @param currency - ISO 4217 currency code (default: EUR)
346
+ */
347
+ async notifyWithdrawal(userId, amount, currency) {
348
+ return this.client.request('POST', `/users/${userId}/withdrawal-event`, {
349
+ body: { amount, currency },
350
+ });
351
+ }
352
+ /**
353
+ * Continue a passed challenge into the Reward (funded) Account.
354
+ *
355
+ * Call when a challenge is in `passed_pending_choice` and the user chooses
356
+ * to continue instead of exiting with a stake refund. Creates the funded
357
+ * account and marks the challenge completed.
358
+ *
359
+ * @param userId - Your sportsbook user identifier
360
+ * @returns The id of the created funded account
361
+ *
362
+ * @throws {FastApiError} 404 if no challenge is awaiting a continue/refund choice
363
+ * @throws {FastApiError} 409 if the funded account could not be created
364
+ *
365
+ * @example
366
+ * ```typescript
367
+ * const { fundedAccountId } = await fast.users.continueChallenge('player-42');
368
+ * ```
369
+ */
370
+ async continueChallenge(userId) {
371
+ return this.client.request('POST', `/users/${userId}/challenge/continue`);
372
+ }
373
+ /**
374
+ * Exit a passed challenge and refund ONLY the user's own stake.
375
+ *
376
+ * The alternative to {@link continueChallenge}: the user takes back their
377
+ * own stake and the entire bonus is voided. Irreversible - the SDK sends
378
+ * `confirm: true` on your behalf. FAST records the exit and emits
379
+ * `challenge.stake_refunded` + `challenge.bonus_voided`; your sportsbook
380
+ * executes the actual refund payout.
381
+ *
382
+ * If a withdrawal approval URL is configured, FAST calls your backend for
383
+ * approval before proceeding.
384
+ *
385
+ * @param userId - Your sportsbook user identifier
386
+ * @returns The own stake to refund and the voided bonus amount
387
+ *
388
+ * @throws {FastApiError} 404 if no challenge is awaiting a continue/refund choice
389
+ * @throws {FastApiError} 402 if your approval endpoint rejected the refund
390
+ */
391
+ async refundChallengeStake(userId) {
392
+ return this.client.request('POST', `/users/${userId}/challenge/refund-stake`, { body: { confirm: true } });
393
+ }
394
+ /**
395
+ * Refund the own stake during the Reward (funded) Account phase.
396
+ *
397
+ * Only available when the tier was configured with `fundedStakeRefundable`.
398
+ * Voids the bonus, closes the funded account, and forfeits any accrued
399
+ * profit above the funded base. Irreversible - the SDK sends `confirm: true`
400
+ * on your behalf. FAST emits `funded_account.stake_refunded`; your
401
+ * sportsbook executes the refund payout.
402
+ *
403
+ * @param userId - Your sportsbook user identifier
404
+ * @returns The own stake to refund
405
+ *
406
+ * @throws {FastApiError} 404 if the user has no active funded account
407
+ * @throws {FastApiError} 409 if the tier does not allow an own-stake refund
408
+ */
409
+ async refundFundedStake(userId) {
410
+ return this.client.request('POST', `/users/${userId}/funded/refund-stake`, { body: { confirm: true } });
411
+ }
412
+ /**
413
+ * Get the user's tournament participation.
414
+ *
415
+ * Returns active, upcoming (entered or invited), and completed tournaments.
416
+ *
417
+ * @param userId - Your sportsbook user identifier
418
+ */
419
+ async getTournaments(userId) {
420
+ return this.client.request('GET', `/users/${userId}/tournaments`);
421
+ }
422
+ /**
423
+ * Get the user's loyalty status (points, tier, cashback).
424
+ *
425
+ * Returns null if the tenant has no loyalty program configured or the
426
+ * user has no loyalty record yet.
427
+ *
428
+ * @param userId - Your sportsbook user identifier
429
+ */
430
+ async getLoyalty(userId) {
431
+ const res = await this.client.request('GET', `/users/${userId}/loyalty`);
432
+ return res.loyalty;
433
+ }
434
+ /**
435
+ * Cancel an active challenge. No refunds are issued.
436
+ * Stake is forfeited, bonus is voided, challenge status becomes 'cancelled'.
437
+ *
438
+ * @param userId - Your sportsbook user identifier
439
+ */
440
+ async cancelChallenge(userId) {
441
+ return this.client.request('POST', `/users/${userId}/challenge/cancel`, {
442
+ body: { confirm: true },
443
+ });
444
+ }
445
+ /**
446
+ * Cancel an active reward (funded) account. No refunds are issued.
447
+ * Everything is forfeited, account status becomes 'revoked'.
448
+ *
449
+ * @param userId - Your sportsbook user identifier
450
+ */
451
+ async cancelFundedAccount(userId) {
452
+ return this.client.request('POST', `/users/${userId}/funded/cancel`, {
453
+ body: { confirm: true },
454
+ });
455
+ }
456
+ }
457
+ /**
458
+ * Bet event reconciliation for cross-referencing with sportsbook records.
459
+ */
460
+ export class ReconciliationApi {
461
+ client;
462
+ constructor(client) {
463
+ this.client = client;
464
+ }
465
+ /**
466
+ * Get bet events and current balances for reconciliation.
467
+ *
468
+ * Use to cross-reference FAST shadow ledger data with your sportsbook records.
469
+ * Supports optional date range filtering.
470
+ *
471
+ * @param userId - Your sportsbook user identifier
472
+ * @param options - Optional date range (ISO 8601)
473
+ */
474
+ async getForUser(userId, options) {
475
+ const query = {};
476
+ if (options?.from)
477
+ query.from = options.from;
478
+ if (options?.to)
479
+ query.to = options.to;
480
+ return this.client.request('GET', `/reconciliation/${userId}`, { query });
481
+ }
482
+ }
483
+ /**
484
+ * Real-time event streaming (Server-Sent Events).
485
+ */
486
+ export class EventsApi {
487
+ client;
488
+ constructor(client) {
489
+ this.client = client;
490
+ }
491
+ /**
492
+ * Issue an SSE connection token.
493
+ *
494
+ * Call from your backend, then pass the token to your frontend for SSE connection.
495
+ * Tokens are HMAC-signed, user-scoped, and expire after 1 hour.
496
+ *
497
+ * @param userId - The user to scope the event stream to
498
+ *
499
+ * @example
500
+ * ```typescript
501
+ * // Backend: issue token
502
+ * const { token } = await fast.events.issueToken('player-42');
503
+ *
504
+ * // Frontend: connect
505
+ * const url = fast.events.getStreamUrl(token, 'player-42');
506
+ * const source = new EventSource(url);
507
+ * ```
508
+ */
509
+ async issueToken(userId) {
510
+ return this.client.request('POST', '/sse/token', { body: { userId } });
511
+ }
512
+ /**
513
+ * Build the SSE stream URL for EventSource connection.
514
+ *
515
+ * @param token - Token from issueToken()
516
+ * @param userId - Same userId used to issue the token
517
+ * @returns Full URL for EventSource constructor
518
+ */
519
+ getStreamUrl(token, userId) {
520
+ return `${this.client['baseUrl']}/events?token=${encodeURIComponent(token)}&userId=${encodeURIComponent(userId)}`;
521
+ }
522
+ }
523
+ /**
524
+ * Widget configuration.
525
+ */
526
+ export class WidgetApi {
527
+ client;
528
+ constructor(client) {
529
+ this.client = client;
530
+ }
531
+ /**
532
+ * Get the widget module and branding configuration for the tenant.
533
+ *
534
+ * Returns which widget modules are enabled (challenges, bonuses, missions,
535
+ * tournaments, loyalty, leaderboard, badges, rewards, history) and the
536
+ * branding config (colors, font, logo, currency). The hosted widget calls
537
+ * this itself on init; use it directly if you build your own UI.
538
+ *
539
+ * @example
540
+ * ```typescript
541
+ * const { modules, branding } = await fast.widget.getConfig();
542
+ * if (modules.tournaments) showTournamentsTab();
543
+ * ```
544
+ */
545
+ async getConfig() {
546
+ return this.client.request('GET', '/widget/config');
547
+ }
548
+ }
549
+ /**
550
+ * Sandbox operations for staging tenants.
551
+ */
552
+ export class SandboxApi {
553
+ client;
554
+ constructor(client) {
555
+ this.client = client;
556
+ }
557
+ /**
558
+ * Reset all data for the staging tenant.
559
+ *
560
+ * Deletes all challenges, funded accounts, bet events, webhook deliveries,
561
+ * and reconciliation flags. Only works on staging tenants.
562
+ *
563
+ * @throws {FastApiError} 403 if tenant is not staging
564
+ */
565
+ async reset() {
566
+ return this.client.request('POST', '/sandbox/reset');
567
+ }
568
+ /**
569
+ * Reset data for a specific user on a staging tenant.
570
+ *
571
+ * @param userId - The user to reset
572
+ * @throws {FastApiError} 403 if tenant is not staging
573
+ */
574
+ async resetUser(userId) {
575
+ return this.client.request('POST', `/sandbox/reset/${userId}`);
576
+ }
577
+ }
578
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/resources/public.ts"],"names":[],"mappings":"AA4BA,MAAM,OAAO,aAAa;IACK;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,SAAS;QACb,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAsC,KAAK,EAAE,kBAAkB,CAAC,CAAC;QACtG,OAAO,GAAG,CAAC,cAAc,CAAC;IAC5B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,YAAY,CAAC,MAAc;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAY,KAAK,EAAE,oBAAoB,MAAM,QAAQ,CAAC,CAAC;IACnF,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,QAAQ,CAAC,IAAqB;QAClC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAA2B,MAAM,EAAE,sBAAsB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAChH,OAAO,GAAG,CAAC,SAAS,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,WAAW,CAAC,MAA0B,EAAE,KAAc;QAC1D,MAAM,KAAK,GAAuC,EAAE,CAAC;QACrD,IAAI,MAAM;YAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QAClC,IAAI,KAAK;YAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;Q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