@domino-sdk/relay 1.0.0-next.7 → 1.0.0-next.8

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 (30) hide show
  1. package/dist/authoring.d.ts +11 -11
  2. package/dist/authoring.js +2 -2
  3. package/dist/avatar.d.ts +2 -2
  4. package/dist/browser.d.ts +217 -2285
  5. package/dist/browser.js +6 -6
  6. package/dist/{chunk-AWLLGCKU.js → chunk-6A6K5RUD.js} +22 -8
  7. package/dist/{chunk-SKETUPST.js → chunk-77H7APVD.js} +1 -1
  8. package/dist/{chunk-UFXBQ6FN.js → chunk-MRIURJE3.js} +2 -2
  9. package/dist/{chunk-ADSP377G.js → chunk-QBOHLT7M.js} +26 -5
  10. package/dist/{chunk-X6FJIPXR.js → chunk-V5R2DMGY.js} +553 -435
  11. package/dist/{chunk-DJZB5RY5.js → chunk-V7EZUZ3Z.js} +345 -243
  12. package/dist/{chunk-UW6R2QGT.js → chunk-VARGF4JS.js} +619 -610
  13. package/dist/{chunk-7HSTFBMO.js → chunk-ZWY3R6B3.js} +5 -3
  14. package/dist/{client-BufGakEt.d.ts → client-CK4nwt7V.d.ts} +307 -2253
  15. package/dist/{images-e6FW9QSx.d.ts → images--vZ9U0kr.d.ts} +2 -2
  16. package/dist/index.d.ts +6 -6
  17. package/dist/index.js +19 -7
  18. package/dist/internal.d.ts +16 -5
  19. package/dist/internal.js +12 -5
  20. package/dist/{catalog-C09gnPYT.d.ts → pages-BzqJuI69.d.ts} +79 -21
  21. package/dist/portal-proxy.js +6 -6
  22. package/dist/{profiles-BtOXMGcC.d.ts → profiles-DDMFBRKe.d.ts} +1 -1
  23. package/dist/react/index.d.ts +156 -2224
  24. package/dist/react/index.js +12 -10
  25. package/dist/{schema-DCapSPHz.d.ts → schema-pnuWqvGn.d.ts} +8 -8
  26. package/dist/schema.d.ts +64 -64
  27. package/dist/schema.js +15 -5
  28. package/dist/{submission-input-Bter6XiI.d.ts → submission-input-C9qm9ixd.d.ts} +8 -8
  29. package/dist/{wallet-Bu6sqJvQ.d.ts → wallet-BGOfFkG9.d.ts} +1 -1
  30. package/package.json +1 -1
@@ -1,21 +1,125 @@
1
- import { V as ValueEvidence, i as referralAcceptSchema, d as LeaderboardQuery, a as AuthProvider, j as engagementPageQuerySchema, k as contentQualificationQuerySchema, m as contentAdmissionQuerySchema, n as contentEnrollmentInputSchema, o as contentReleaseInputSchema } from './submission-input-Bter6XiI.js';
1
+ import { V as ValueEvidence, i as referralAcceptSchema, d as LeaderboardQuery, a as AuthProvider, j as engagementPageQuerySchema, k as contentQualificationQuerySchema, m as contentAdmissionQuerySchema, n as contentEnrollmentInputSchema, o as contentReleaseInputSchema } from './submission-input-C9qm9ixd.js';
2
+ import { b as QuizEvidence, A as Attempt, M as MemberProgress, s as submitSchema, g as contentPerformanceQuerySchema } from './schema-pnuWqvGn.js';
3
+ import { c as ParticipantSession, e as QuestView, a as PageQuery, q as questExperienceSchema, f as exchangeSchema } from './pages-BzqJuI69.js';
2
4
  import { z } from 'zod';
3
- import { J as errorSchema, b as QuizEvidence, A as Attempt, M as MemberProgress, c as SubmitInput, g as ReleaseInput, h as beginHandoverSchema, i as contentPerformanceQuerySchema } from './schema-DCapSPHz.js';
4
- import { S as Session, b as QuestView, q as questExperienceSchema, E as ExchangeInput } from './catalog-C09gnPYT.js';
5
- import { f as ProfileUpdate, c as ProfileCompletionQuery } from './profiles-BtOXMGcC.js';
6
- import { W as WalletAddressInput, w as walletSignatureSchema, L as LinkedWallet, g as WalletSigner, l as walletChallengeInputSchema, m as walletProofSchema, f as WalletSignature } from './wallet-Bu6sqJvQ.js';
5
+ import { p as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-DDMFBRKe.js';
6
+ import { w as walletAddressInputSchema, l as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-BGOfFkG9.js';
7
7
 
8
- declare class RelayError extends Error {
9
- readonly status: number;
10
- readonly missing: {
8
+ /**
9
+ * The request-error core every Domino client error extends: the participant `RelayError` and the
10
+ * management client's error share these fields, so one handler serves both.
11
+ *
12
+ * `kind` says what happened:
13
+ *
14
+ * - `http`: the server answered with an error status.
15
+ * - `network`: the transport failed, including a response body cut off after its headers.
16
+ * - `timeout`: the client's deadline passed.
17
+ * - `aborted`: the caller cancelled the request.
18
+ * - `invalid-response`: a 2xx answer that is not JSON, or not the shape this SDK version expects.
19
+ * - `client`: the client refused the call without sending it, such as for invalid input.
20
+ */
21
+ type RequestErrorKind = "http" | "network" | "timeout" | "aborted" | "invalid-response" | "client";
22
+ /**
23
+ * What to do when `uncertain` is true. `replay`: sending the call again with the same
24
+ * `operationId` is safe, because the server applies it at most once. `reconcile`: read the state
25
+ * first, since repeating the call could apply it twice.
26
+ */
27
+ type RequestRecovery = "replay" | "reconcile";
28
+ type RequestErrorDetails = {
29
+ kind: RequestErrorKind;
30
+ /** True only when a write may have been applied. Reads are never uncertain. */
31
+ uncertain?: boolean;
32
+ /** The HTTP status, whenever response headers arrived. Never invented. */
33
+ status?: number;
34
+ /** A machine-readable code: open, so a newer server's codes are kept. */
35
+ code?: string;
36
+ /** The call's idempotency or action ID, to replay it with. */
37
+ operationId?: string;
38
+ cause?: unknown;
39
+ };
40
+ declare const requestErrorBrand: unique symbol;
41
+ /**
42
+ * Whether `value` is a `RequestError` from any copy of the SDK. Prefer it to `instanceof`, which
43
+ * fails when an app bundles two copies of the package.
44
+ */
45
+ declare function isRequestError(value: unknown): value is RequestError;
46
+ declare class RequestError extends Error {
47
+ readonly name: string;
48
+ readonly [requestErrorBrand] = true;
49
+ readonly kind: RequestErrorKind;
50
+ readonly uncertain: boolean;
51
+ readonly status: number | undefined;
52
+ readonly code: string | undefined;
53
+ readonly operationId: string | undefined;
54
+ /** `replay` when there is an `operationId`, else `reconcile`; only when `uncertain`. */
55
+ readonly recovery: RequestRecovery | undefined;
56
+ constructor(message: string, details: RequestErrorDetails);
57
+ }
58
+
59
+ /** What happened, as in every Domino client error (see `RequestError`). */
60
+ type RelayErrorKind = RequestErrorKind;
61
+ type KnownRelayErrorCode = (typeof RelayErrorCode)[keyof typeof RelayErrorCode];
62
+ /**
63
+ * The machine-readable codes this SDK knows. `RelayError.code` is an open string: Relay can add
64
+ * codes, and the error keeps a code this SDK does not list, with the server's message.
65
+ */
66
+ declare const RelayErrorCode: {
67
+ /** The call needs a signed-in member. */
68
+ readonly NotSignedIn: "not-signed-in";
69
+ /** The session changed since the app read it (the `session` option). Reload before retrying. */
70
+ readonly StaleSession: "stale-session";
71
+ /** The input failed validation before it was sent. */
72
+ readonly InvalidInput: "invalid-input";
73
+ /** Relay's answer was not JSON or not the expected shape (kind `invalid-response`). */
74
+ readonly InvalidResponse: "invalid-response";
75
+ /** The transport failed, before a response or while reading its body (kind `network`). */
76
+ readonly Network: "network";
77
+ /** The client's deadline elapsed (kind `timeout`). */
78
+ readonly Timeout: "timeout";
79
+ /** The caller cancelled the request (kind `aborted`). */
80
+ readonly Aborted: "aborted";
81
+ /** A quest or collection the call named is not in the member's experience. */
82
+ readonly NotFound: "not-found";
83
+ /** The quest has no failed attempt the member can retry. */
84
+ readonly RetryUnavailable: "retry-unavailable";
85
+ /** Durable submission storage is missing, blocked or unreadable. */
86
+ readonly SubmissionStorage: "submission-storage";
87
+ /** The saved submission is in a state that does not allow this action. */
88
+ readonly SubmissionConflict: "submission-conflict";
89
+ /** The quest changed since the member saw it; review it before submitting again. */
90
+ readonly QuestUpdated: "quest-updated";
91
+ /** The quiz changed since the member answered it. */
92
+ readonly StaleQuiz: "stale-quiz";
93
+ /** Relay refused the submitted evidence. */
94
+ readonly InvalidSubmission: "invalid-submission";
95
+ /** A page cursor Relay cannot read; start again from the first page. */
96
+ readonly InvalidCursor: "invalid-cursor";
97
+ /** A wallet signer failed or the member refused to sign; `cause` is the wallet's own error. */
98
+ readonly WalletSigner: "wallet-signer";
99
+ };
100
+ /** A known code, or one a newer Relay sends. */
101
+ type RelayErrorCode = KnownRelayErrorCode | (string & {});
102
+ type RelayErrorDetails = RequestErrorDetails & {
103
+ code?: RelayErrorCode;
104
+ missing?: {
11
105
  quest: string;
12
106
  title: string;
13
107
  }[];
14
- readonly code?: z.infer<typeof errorSchema>["code"];
15
- constructor(message: string, status: number, missing?: {
108
+ };
109
+ declare const relayErrorBrand: unique symbol;
110
+ /** Whether `value` is a `RelayError` from any copy of the SDK. Prefer it to `instanceof`. */
111
+ declare function isRelayError(value: unknown): value is RelayError;
112
+ /** Every error the participant client throws: the shared `RequestError` fields, and `missing`. */
113
+ declare class RelayError extends RequestError {
114
+ readonly name: string;
115
+ readonly [relayErrorBrand] = true;
116
+ readonly code: RelayErrorCode | undefined;
117
+ /** Prerequisite quests the member has not completed, when Relay refused for that reason. */
118
+ readonly missing: {
16
119
  quest: string;
17
120
  title: string;
18
- }[], code?: z.infer<typeof errorSchema>["code"]);
121
+ }[];
122
+ constructor(message: string, details: RelayErrorDetails);
19
123
  }
20
124
 
21
125
  type SubmissionStatus = {
@@ -61,19 +165,26 @@ type SubmissionDraft = {
61
165
  } | QuizEvidence | ValueEvidence | {
62
166
  kind: "none";
63
167
  };
168
+ /**
169
+ * The quest or quiz changed since the member saw it, so Relay admitted nothing. `draft` holds what
170
+ * the member entered, to show again once they review the quest.
171
+ */
64
172
  declare class QuestUpdatedError extends RelayError {
65
173
  readonly draft: SubmissionDraft | null;
66
- constructor(message: string, code: "quest-updated" | "stale-quiz", draft: SubmissionDraft | null);
174
+ readonly name: string;
175
+ constructor(message: string, code: "quest-updated" | "stale-quiz", draft: SubmissionDraft | null,
176
+ /** The HTTP error Relay answered with; omitted when a saved review state is replayed. */
177
+ source?: RelayError);
67
178
  }
68
179
 
69
180
  type ProgressObservation<T = MemberProgress> = {
70
181
  kind: "loading";
71
182
  } | {
72
183
  kind: "session";
73
- session: Session | null;
184
+ session: ParticipantSession | null;
74
185
  } | {
75
186
  kind: "ready";
76
- session: Session;
187
+ session: ParticipantSession;
77
188
  progress: T;
78
189
  } | {
79
190
  kind: "error";
@@ -115,16 +226,28 @@ type QuestController = (ActiveController & {
115
226
  submit(): Promise<QuestActionResult>;
116
227
  });
117
228
 
118
- declare function createRelayClient(options: {
229
+ /** Options every participant client method takes as its last argument. */
230
+ type RelayRequestOptions = {
231
+ /**
232
+ * The session ID the app read (`auth.session()`). Relay refuses the call with a `RelayError`
233
+ * whose code is `stale-session` if the member's session changed since. Calls Relay binds to a
234
+ * session (wallet linking, collection passes, retries) read the current session when omitted.
235
+ */
236
+ session?: string;
237
+ /** Cancels the call, which rejects with a `RelayError` of kind `aborted`. */
238
+ signal?: AbortSignal;
239
+ };
240
+ type RelayClientOptions = {
119
241
  baseUrl: string;
120
242
  token?: string;
121
243
  submissionStore?: SubmissionStore;
122
244
  organization?: string;
123
245
  project?: string;
124
246
  environment?: "test" | "live";
125
- }): {
247
+ };
248
+ declare function createRelayClient(options: RelayClientOptions): {
126
249
  referrals: {
127
- list: () => Promise<{
250
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
128
251
  id: string;
129
252
  title: string;
130
253
  enabled: boolean;
@@ -220,7 +343,7 @@ declare function createRelayClient(options: {
220
343
  key?: string | undefined;
221
344
  inviterGroup?: string | undefined;
222
345
  }[]>;
223
- summary: () => Promise<{
346
+ summary: (requestOptions?: RelayRequestOptions) => Promise<{
224
347
  code: string;
225
348
  attributed: number;
226
349
  programs: {
@@ -337,7 +460,8 @@ declare function createRelayClient(options: {
337
460
  outstanding: number;
338
461
  }[];
339
462
  }>;
340
- history: (before?: number) => Promise<{
463
+ /** The member's referral point history, newest first. */
464
+ history: (query?: PageQuery, requestOptions?: RelayRequestOptions) => Promise<{
341
465
  items: {
342
466
  id: number;
343
467
  program: string;
@@ -346,9 +470,9 @@ declare function createRelayClient(options: {
346
470
  at: number;
347
471
  reason: string;
348
472
  }[];
349
- next: number | null;
473
+ nextCursor: string | null;
350
474
  }>;
351
- accept: (input: z.input<typeof referralAcceptSchema>) => Promise<{
475
+ accept: (value: z.input<typeof referralAcceptSchema>, requestOptions?: RelayRequestOptions) => Promise<{
352
476
  ok: true;
353
477
  }>;
354
478
  };
@@ -357,7 +481,7 @@ declare function createRelayClient(options: {
357
481
  * The project's tiered rewards with their keys. Entitlements and reward
358
482
  * definitions name them by ID: use this to find the ID for a key.
359
483
  */
360
- list: () => Promise<{
484
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
361
485
  id: string;
362
486
  key: string | null;
363
487
  }[]>;
@@ -367,14 +491,14 @@ declare function createRelayClient(options: {
367
491
  * The project's point ledgers with their keys and names. Reads return
368
492
  * ledger IDs: use this to find the ID for a key, or a ledger's name.
369
493
  */
370
- list: () => Promise<{
494
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
371
495
  id: string;
372
496
  key: string | null;
373
497
  name: string;
374
498
  }[]>;
375
499
  };
376
500
  leaderboards: {
377
- list: () => Promise<{
501
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
378
502
  id: string;
379
503
  title: string;
380
504
  balance: string;
@@ -418,7 +542,7 @@ declare function createRelayClient(options: {
418
542
  key?: string | undefined;
419
543
  group?: string | undefined;
420
544
  }[]>;
421
- standings: (board: string, options?: LeaderboardQuery) => Promise<{
545
+ standings: (board: string, query?: LeaderboardQuery, requestOptions?: RelayRequestOptions) => Promise<{
422
546
  leaderboard: string;
423
547
  title: string;
424
548
  version: string;
@@ -509,7 +633,7 @@ declare function createRelayClient(options: {
509
633
  * `profiles.mine()`). Needs the board's access, like `standings`; a profile this viewer
510
634
  * cannot see is a 404, as in `profiles.get`.
511
635
  */
512
- placement: (board: string, profile: string) => Promise<{
636
+ placement: (board: string, profile: string, requestOptions?: RelayRequestOptions) => Promise<{
513
637
  leaderboard: string;
514
638
  title: string;
515
639
  profile: string;
@@ -521,11 +645,12 @@ declare function createRelayClient(options: {
521
645
  };
522
646
  /**
523
647
  * Participant profiles: the display name and avatar other participants see where the project
524
- * enables profiles in Console. Render an avatar with `avatarSrc(profile.avatar)`.
648
+ * enables profiles in Console. Render an avatar with `avatarSrc(profile.avatar)` from
649
+ * `@domino-sdk/relay/avatar`.
525
650
  */
526
651
  profiles: {
527
652
  /** The signed-in member's own profile, whatever the project shows to others. */
528
- mine: () => Promise<{
653
+ mine: (requestOptions?: RelayRequestOptions) => Promise<{
529
654
  id: string;
530
655
  name: string;
531
656
  avatar: {
@@ -555,11 +680,9 @@ declare function createRelayClient(options: {
555
680
  }>;
556
681
  /**
557
682
  * Changes the member's own name, avatar choice or visibility; omitted fields stay, and null
558
- * returns to the default. `session` (the ID the app read) makes a changed session a 409.
683
+ * returns to the default.
559
684
  */
560
- update: (input: ProfileUpdate, options?: {
561
- session?: string;
562
- }) => Promise<{
685
+ update: (value: z.input<typeof profileUpdateSchema>, requestOptions?: RelayRequestOptions) => Promise<{
563
686
  id: string;
564
687
  name: string;
565
688
  avatar: {
@@ -591,9 +714,8 @@ declare function createRelayClient(options: {
591
714
  * Uploads a JPEG, PNG or WebP of at most 5 MB as the member's avatar. The server crops it to
592
715
  * a 512×512 WebP without metadata. Retrying with the same `uploadId` is idempotent.
593
716
  */
594
- uploadAvatar: (file: Blob, options?: {
717
+ uploadAvatar: (file: Blob, requestOptions?: RelayRequestOptions & {
595
718
  uploadId?: string;
596
- session?: string;
597
719
  }) => Promise<{
598
720
  id: string;
599
721
  name: string;
@@ -626,7 +748,7 @@ declare function createRelayClient(options: {
626
748
  * A profile's name and avatar by its public ID (`profile.id` from a leaderboard row or
627
749
  * `mine()`). A profile that is missing, hidden or not visible to this viewer is a 404.
628
750
  */
629
- get: (profile: string) => Promise<{
751
+ get: (profile: string, requestOptions?: RelayRequestOptions) => Promise<{
630
752
  id: string;
631
753
  name: string;
632
754
  avatar: {
@@ -645,9 +767,9 @@ declare function createRelayClient(options: {
645
767
  }>;
646
768
  /**
647
769
  * A page of the profile's completions of quests that show on profiles, most recently
648
- * completed first. Pass the page's `nextCursor` as `cursor` for the next one.
770
+ * completed first.
649
771
  */
650
- completions: (profile: string, options?: ProfileCompletionQuery) => Promise<{
772
+ completions: (profile: string, query?: ProfileCompletionQuery, requestOptions?: RelayRequestOptions) => Promise<{
651
773
  items: {
652
774
  quest: string;
653
775
  title: string;
@@ -661,7 +783,7 @@ declare function createRelayClient(options: {
661
783
  * The profile's invited and qualified counts and milestones in one referral program. Needs
662
784
  * a signed-in participant, as referral programs do.
663
785
  */
664
- referral: (profile: string, program: string) => Promise<{
786
+ referral: (profile: string, program: string, requestOptions?: RelayRequestOptions) => Promise<{
665
787
  program: string;
666
788
  title: string;
667
789
  invited: number;
@@ -675,7 +797,7 @@ declare function createRelayClient(options: {
675
797
  }>;
676
798
  };
677
799
  quests: {
678
- get: (id: string) => Promise<{
800
+ get: (id: string, requestOptions?: RelayRequestOptions) => Promise<{
679
801
  quest: string;
680
802
  title: string;
681
803
  presentation: {
@@ -917,7 +1039,8 @@ declare function createRelayClient(options: {
917
1039
  };
918
1040
  } | null | undefined;
919
1041
  }>;
920
- retry: (view: QuestView) => Promise<{
1042
+ /** Retries verification of the quest's failed attempt. */
1043
+ retry: (view: QuestView, requestOptions?: RelayRequestOptions) => Promise<{
921
1044
  id: string;
922
1045
  release: string;
923
1046
  quest: string;
@@ -971,7 +1094,7 @@ declare function createRelayClient(options: {
971
1094
  release?: string | undefined;
972
1095
  } | undefined;
973
1096
  }>;
974
- experience: () => Promise<{
1097
+ experience: (requestOptions?: RelayRequestOptions) => Promise<{
975
1098
  member: string;
976
1099
  quests: {
977
1100
  quest: string;
@@ -1463,7 +1586,7 @@ declare function createRelayClient(options: {
1463
1586
  key?: string | undefined;
1464
1587
  }[];
1465
1588
  }>;
1466
- collection: (id: string) => Promise<{
1589
+ collection: (id: string, requestOptions?: RelayRequestOptions) => Promise<{
1467
1590
  id: string;
1468
1591
  title: string;
1469
1592
  quests: {
@@ -1711,14 +1834,14 @@ declare function createRelayClient(options: {
1711
1834
  key?: string | undefined;
1712
1835
  }>;
1713
1836
  open: (view: QuestView) => Promise<QuestController>;
1714
- observe: (listener: (value: ProgressObservation<z.infer<typeof questExperienceSchema>>) => void, options?: {
1837
+ observe: (listener: (value: ProgressObservation<z.infer<typeof questExperienceSchema>>) => void, observeOptions?: {
1715
1838
  intervalMs?: number;
1716
1839
  maxBackoffMs?: number;
1717
1840
  }) => ProgressObserver;
1718
1841
  };
1719
1842
  /** The signed-in member's linked Solana, EVM and Cosmos wallets for this project. */
1720
1843
  wallets: {
1721
- list: () => Promise<{
1844
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
1722
1845
  chain: "solana" | "eip155" | "cosmos";
1723
1846
  network: `cosmos:${string}` | null;
1724
1847
  address: string;
@@ -1726,7 +1849,7 @@ declare function createRelayClient(options: {
1726
1849
  revision: number;
1727
1850
  signIn: boolean;
1728
1851
  }[]>;
1729
- challenge: (input: WalletAddressInput, session: string) => Promise<{
1852
+ challenge: (value: z.input<typeof walletAddressInputSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1730
1853
  id: string;
1731
1854
  purpose: "link" | "sign-in";
1732
1855
  chain: "solana" | "eip155" | "cosmos";
@@ -1735,7 +1858,7 @@ declare function createRelayClient(options: {
1735
1858
  message: string;
1736
1859
  expiresAt: number;
1737
1860
  }>;
1738
- verify: (input: z.input<typeof walletSignatureSchema>, session: string) => Promise<{
1861
+ verify: (value: z.input<typeof walletSignatureSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1739
1862
  chain: "solana" | "eip155" | "cosmos";
1740
1863
  network: `cosmos:${string}` | null;
1741
1864
  address: string;
@@ -1744,11 +1867,11 @@ declare function createRelayClient(options: {
1744
1867
  signIn: boolean;
1745
1868
  }>;
1746
1869
  /** The address stays bound to this member: another member still cannot link it. */
1747
- unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<{
1870
+ unlink: (wallet: Pick<LinkedWallet, "chain" | "address">, requestOptions?: RelayRequestOptions) => Promise<{
1748
1871
  ok: true;
1749
1872
  }>;
1750
1873
  /** Asks the signer for its address, signs the returned challenge, and links the wallet. */
1751
- link: (signer: WalletSigner) => Promise<{
1874
+ link: (signer: WalletSigner, requestOptions?: RelayRequestOptions) => Promise<{
1752
1875
  chain: "solana" | "eip155" | "cosmos";
1753
1876
  network: `cosmos:${string}` | null;
1754
1877
  address: string;
@@ -1757,30 +1880,8 @@ declare function createRelayClient(options: {
1757
1880
  signIn: boolean;
1758
1881
  }>;
1759
1882
  };
1760
- /** @deprecated Use `wallets` (multi-chain). This reads and replaces the newest Solana wallet. */
1761
- wallet: {
1762
- connection: () => Promise<{
1763
- chain: "solana";
1764
- address: string;
1765
- verifiedAt: number;
1766
- revision: number;
1767
- } | null>;
1768
- challenge: (input: z.input<typeof walletChallengeInputSchema>, session: string) => Promise<{
1769
- chain: "solana";
1770
- address: string;
1771
- id: string;
1772
- message: string;
1773
- expiresAt: number;
1774
- }>;
1775
- verify: (input: z.input<typeof walletProofSchema>, session: string) => Promise<{
1776
- chain: "solana";
1777
- address: string;
1778
- verifiedAt: number;
1779
- revision: number;
1780
- }>;
1781
- };
1782
1883
  auth: {
1783
- providers: () => Promise<{
1884
+ providers: (requestOptions?: RelayRequestOptions) => Promise<{
1784
1885
  providers: {
1785
1886
  provider: "google" | "apple" | "x" | "discord";
1786
1887
  configured: boolean;
@@ -1789,16 +1890,13 @@ declare function createRelayClient(options: {
1789
1890
  wallets: ("solana" | "eip155" | "cosmos")[];
1790
1891
  demo: boolean;
1791
1892
  }>;
1792
- start: (provider: AuthProvider, mode: "sign-in" | "connect") => Promise<{
1893
+ start: (provider: AuthProvider, mode: "sign-in" | "connect", requestOptions?: RelayRequestOptions) => Promise<{
1793
1894
  url: string;
1794
1895
  }>;
1795
- emailStart: (email: string) => Promise<{
1896
+ emailStart: (email: string, requestOptions?: RelayRequestOptions) => Promise<{
1796
1897
  challenge: string;
1797
1898
  }>;
1798
- emailVerify: (challenge: string, code: string) => Promise<{
1799
- organization: string;
1800
- project: string;
1801
- environment: "test" | "live";
1899
+ emailVerify: (challenge: string, code: string, requestOptions?: RelayRequestOptions) => Promise<{
1802
1900
  id: string;
1803
1901
  principal: {
1804
1902
  kind: "member";
@@ -1809,8 +1907,13 @@ declare function createRelayClient(options: {
1809
1907
  } | {
1810
1908
  kind: "operator";
1811
1909
  subject: string;
1910
+ } | {
1911
+ kind: string;
1812
1912
  };
1813
1913
  expiresAt: number;
1914
+ organization: string;
1915
+ project: string;
1916
+ environment: "test" | "live";
1814
1917
  }>;
1815
1918
  /**
1816
1919
  * Sign in, or sign up, with a Solana, EVM or Cosmos wallet where the project enabled it
@@ -1818,7 +1921,7 @@ declare function createRelayClient(options: {
1818
1921
  */
1819
1922
  wallet: {
1820
1923
  /** A sign-in challenge for the wallet's address; binds the flow to this browser. */
1821
- start: (input: WalletAddressInput) => Promise<{
1924
+ start: (value: z.input<typeof walletAddressInputSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1822
1925
  id: string;
1823
1926
  purpose: "link" | "sign-in";
1824
1927
  chain: "solana" | "eip155" | "cosmos";
@@ -1828,10 +1931,7 @@ declare function createRelayClient(options: {
1828
1931
  expiresAt: number;
1829
1932
  }>;
1830
1933
  /** Verifies the signed challenge and starts the session. Not retried: start again instead. */
1831
- verify: (proof: WalletSignature) => Promise<{
1832
- organization: string;
1833
- project: string;
1834
- environment: "test" | "live";
1934
+ verify: (proof: z.input<typeof walletSignatureSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1835
1935
  id: string;
1836
1936
  principal: {
1837
1937
  kind: "member";
@@ -1842,17 +1942,19 @@ declare function createRelayClient(options: {
1842
1942
  } | {
1843
1943
  kind: "operator";
1844
1944
  subject: string;
1945
+ } | {
1946
+ kind: string;
1845
1947
  };
1846
1948
  expiresAt: number;
1847
- }>;
1848
- /**
1849
- * Asks the signer for its address, signs the challenge and starts the session. Throws a
1850
- * `RelayError` with status 403 when the project has not enabled this wallet family.
1851
- */
1852
- signIn: (signer: WalletSigner) => Promise<{
1853
1949
  organization: string;
1854
1950
  project: string;
1855
1951
  environment: "test" | "live";
1952
+ }>;
1953
+ /**
1954
+ * Asks the signer for its address, signs the challenge and starts the session. Rejects with
1955
+ * an `http` `RelayError` (status 403) when the project has not enabled this wallet family.
1956
+ */
1957
+ signIn: (signer: WalletSigner, requestOptions?: RelayRequestOptions) => Promise<{
1856
1958
  id: string;
1857
1959
  principal: {
1858
1960
  kind: "member";
@@ -1863,29 +1965,27 @@ declare function createRelayClient(options: {
1863
1965
  } | {
1864
1966
  kind: "operator";
1865
1967
  subject: string;
1968
+ } | {
1969
+ kind: string;
1866
1970
  };
1867
1971
  expiresAt: number;
1972
+ organization: string;
1973
+ project: string;
1974
+ environment: "test" | "live";
1868
1975
  }>;
1869
1976
  };
1870
- accounts: () => Promise<{
1977
+ /** The member's connected sign-in accounts, one per provider. */
1978
+ accounts: (requestOptions?: RelayRequestOptions) => Promise<{
1871
1979
  provider: "google" | "apple" | "x" | "discord";
1872
1980
  configured: boolean;
1873
1981
  status: "disconnected" | "connected" | "reconnect";
1874
1982
  subject: string | null;
1875
1983
  revision: number;
1876
1984
  }[]>;
1877
- disconnect: (provider: AuthProvider) => Promise<{
1985
+ disconnect: (provider: AuthProvider, requestOptions?: RelayRequestOptions) => Promise<{
1878
1986
  ok: boolean;
1879
1987
  }>;
1880
- connections: () => Promise<{
1881
- provider: string;
1882
- subject: string;
1883
- signInEnabled: boolean;
1884
- }[]>;
1885
- session: () => Promise<{
1886
- organization: string;
1887
- project: string;
1888
- environment: "test" | "live";
1988
+ session: (requestOptions?: RelayRequestOptions) => Promise<{
1889
1989
  id: string;
1890
1990
  principal: {
1891
1991
  kind: "member";
@@ -1896,19 +1996,21 @@ declare function createRelayClient(options: {
1896
1996
  } | {
1897
1997
  kind: "operator";
1898
1998
  subject: string;
1999
+ } | {
2000
+ kind: string;
1899
2001
  };
1900
2002
  expiresAt: number;
2003
+ organization: string;
2004
+ project: string;
2005
+ environment: "test" | "live";
1901
2006
  } | null>;
1902
- signOut: () => Promise<{
2007
+ signOut: (requestOptions?: RelayRequestOptions) => Promise<{
1903
2008
  ok: boolean;
1904
2009
  }>;
1905
2010
  /** Local development only. Existing hosted apps use createParticipantBackend from /portal-proxy. */
1906
- exchange: (input: ExchangeInput) => Promise<{
2011
+ exchange: (value: z.input<typeof exchangeSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1907
2012
  token: string;
1908
2013
  session: {
1909
- organization: string;
1910
- project: string;
1911
- environment: "test" | "live";
1912
2014
  id: string;
1913
2015
  principal: {
1914
2016
  kind: "member";
@@ -1921,16 +2023,19 @@ declare function createRelayClient(options: {
1921
2023
  subject: string;
1922
2024
  };
1923
2025
  expiresAt: number;
2026
+ organization: string;
2027
+ project: string;
2028
+ environment: "test" | "live";
1924
2029
  };
1925
2030
  }>;
1926
2031
  };
1927
2032
  me: {
1928
2033
  /** The signed-in member, and the seed of their generated avatar: `defaultAvatar(avatarSeed)`. */
1929
- get: () => Promise<{
2034
+ get: (requestOptions?: RelayRequestOptions) => Promise<{
1930
2035
  member: string;
1931
2036
  avatarSeed: string;
1932
2037
  }>;
1933
- observeProgress: (listener: (value: ProgressObservation) => void, options?: {
2038
+ observeProgress: (listener: (value: ProgressObservation) => void, observeOptions?: {
1934
2039
  intervalMs?: number;
1935
2040
  maxBackoffMs?: number;
1936
2041
  }) => ProgressObserver;
@@ -1960,67 +2065,12 @@ declare function createRelayClient(options: {
1960
2065
  repeatable?: boolean;
1961
2066
  }): Promise<ValueSubmission>;
1962
2067
  };
1963
- collectionPass: (entitlement: string, session: string) => Promise<{
2068
+ collectionPass: (entitlement: string, requestOptions?: RelayRequestOptions) => Promise<{
1964
2069
  code: string;
1965
2070
  expiresAt: number;
1966
2071
  entitlement: string;
1967
2072
  }>;
1968
- /** @deprecated The participant API does not verify passes. Verify them on your server and call `POST /management/v1/passes/verify`. */
1969
- linkPass: (code: string) => Promise<{
1970
- id: string;
1971
- release: string;
1972
- quest: string;
1973
- member: string;
1974
- evidence: string | null;
1975
- status: "needs-review" | "failed" | "queued" | "evaluating" | "accepted" | "progressed" | "rejected";
1976
- reason: string | null;
1977
- retries: number;
1978
- generation: number;
1979
- completion: string | null;
1980
- reviewRewards: ({
1981
- kind: "tier";
1982
- reward: {
1983
- id: string;
1984
- title: string;
1985
- tiers: {
1986
- id: string;
1987
- title: string;
1988
- }[];
1989
- inventory: {
1990
- kind: "untracked";
1991
- };
1992
- fulfillment: {
1993
- kind: "staff-handover";
1994
- };
1995
- };
1996
- tier: string;
1997
- } | {
1998
- kind: "points";
1999
- balance: string;
2000
- amount: number;
2001
- } | {
2002
- kind: "integration";
2003
- provider: "discord";
2004
- action: "grant-role";
2005
- roleId: string;
2006
- })[] | null;
2007
- requestedReview: boolean;
2008
- createdAt: number;
2009
- input?: {
2010
- kind: "text";
2011
- value: string;
2012
- } | {
2013
- kind: "url";
2014
- value: string;
2015
- } | {
2016
- kind: "quiz";
2017
- answers: {
2018
- [k: string]: string;
2019
- };
2020
- release?: string | undefined;
2021
- } | undefined;
2022
- }>;
2023
- progress: () => Promise<{
2073
+ progress: (requestOptions?: RelayRequestOptions) => Promise<{
2024
2074
  member: string;
2025
2075
  quests: {
2026
2076
  quest: string;
@@ -2318,7 +2368,7 @@ declare function createRelayClient(options: {
2318
2368
  } | undefined;
2319
2369
  })[];
2320
2370
  }>;
2321
- rewardDeliveries: () => Promise<{
2371
+ rewardDeliveries: (requestOptions?: RelayRequestOptions) => Promise<{
2322
2372
  deliveries: {
2323
2373
  id: string;
2324
2374
  quest: string;
@@ -2335,9 +2385,8 @@ declare function createRelayClient(options: {
2335
2385
  deliveredAt: number | null;
2336
2386
  }[];
2337
2387
  }>;
2338
- claim: (input: Omit<SubmitInput, "member">, options?: {
2339
- session: string;
2340
- }) => Promise<{
2388
+ /** Claims a quest for the signed-in member. Quest controllers (`quests.open`) call this. */
2389
+ claim: (value: Omit<z.input<typeof submitSchema>, "member">, requestOptions?: RelayRequestOptions) => Promise<{
2341
2390
  id: string;
2342
2391
  release: string;
2343
2392
  quest: string;
@@ -2391,7 +2440,8 @@ declare function createRelayClient(options: {
2391
2440
  release?: string | undefined;
2392
2441
  } | undefined;
2393
2442
  }>;
2394
- upload: (file: File) => Promise<{
2443
+ /** Uploads a photo as the signed-in member's evidence. */
2444
+ upload: (file: Blob, requestOptions?: RelayRequestOptions) => Promise<{
2395
2445
  id: string;
2396
2446
  member: string;
2397
2447
  type: "image/jpeg" | "image/png";
@@ -2399,1872 +2449,87 @@ declare function createRelayClient(options: {
2399
2449
  }>;
2400
2450
  };
2401
2451
  evidence: {
2402
- download(id: string, requestOptions?: {
2403
- signal?: AbortSignal;
2404
- }): Promise<Blob>;
2452
+ download(id: string, requestOptions?: RelayRequestOptions): Promise<Blob>;
2405
2453
  };
2406
- /** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
2407
- lookupMember: (issuer: string, subject: string) => Promise<{
2408
- member: string;
2409
- }>;
2410
- /** @deprecated Removed from the participant API. Build quests with `domino` and `@domino-sdk/relay/build`. */
2411
- journeyTemplate: () => Promise<{
2412
- code: string;
2413
- definition: {
2414
- quest: string;
2415
- runtimeVersion: 1 | 2;
2416
- title: string;
2417
- presentation: {
2418
- quiz?: {
2419
- id: string;
2420
- prompt: string;
2421
- choices: {
2422
- id: string;
2423
- label: string;
2424
- }[];
2425
- }[] | undefined;
2426
- instructions?: string | undefined;
2427
- video?: {
2428
- url: string;
2429
- poster?: string | undefined;
2430
- captions?: {
2431
- url: string;
2432
- language: string;
2433
- label: string;
2434
- } | undefined;
2435
- } | undefined;
2436
- };
2437
- integrations: "discord"[];
2438
- fields: Record<string, {
2439
- kind: "point-ledger";
2440
- default: string;
2441
- label: string;
2442
- description?: string | undefined;
2443
- } | {
2444
- kind: "datetime";
2445
- default: string;
2446
- label: string;
2447
- description?: string | undefined;
2448
- } | {
2449
- kind: "resource";
2450
- default: string;
2451
- source: {
2452
- provider: "discord";
2453
- resource: "channel";
2454
- types: ("text" | "announcement")[];
2455
- } | {
2456
- provider: "domino";
2457
- resource: "point-ledger";
2458
- } | {
2459
- provider: "discord";
2460
- resource: "role";
2461
- assignable: boolean;
2454
+ engagement: {
2455
+ /** The member's engagement settlements for one post under one rule, newest first. */
2456
+ page: (query: z.input<typeof engagementPageQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
2457
+ rule: {
2458
+ version: string;
2459
+ definition: {
2460
+ key: string;
2461
+ qualifiedBy: string;
2462
+ balance: string;
2463
+ metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2464
+ baseline: "historical";
2465
+ maxAgeMs: number;
2466
+ budget: {
2467
+ projectDaily?: number | undefined;
2468
+ memberDaily?: number | undefined;
2469
+ projectLifetime?: number | undefined;
2470
+ };
2462
2471
  };
2463
- label: string;
2464
- description?: string | undefined;
2465
- } | {
2466
- kind: "quiz";
2467
- default: {
2468
- id: string;
2469
- prompt: string;
2470
- choices: {
2471
- id: string;
2472
- label: string;
2473
- }[];
2474
- correct: string;
2475
- }[];
2476
- label: string;
2477
- description?: string | undefined;
2478
- } | {
2479
- kind: "text";
2480
- default: string;
2481
- minLength: number;
2482
- maxLength: number;
2483
- multiline: boolean;
2484
- label: string;
2485
- description?: string | undefined;
2486
- } | {
2487
- kind: "integer";
2488
- default: number;
2489
- min: number;
2490
- max: number;
2491
- label: string;
2492
- description?: string | undefined;
2493
- } | {
2494
- kind: "boolean";
2495
- default: boolean;
2496
- label: string;
2497
- description?: string | undefined;
2498
- } | {
2499
- kind: "choice";
2500
- default: string;
2501
- options: string[];
2502
- label: string;
2503
- description?: string | undefined;
2504
- }>;
2505
- values: Record<string, string | number | boolean | {
2472
+ publishedAt: number;
2473
+ };
2474
+ account: {
2475
+ member: string;
2476
+ earned: number;
2477
+ accounted: number;
2478
+ paid: number;
2479
+ excluded: number;
2480
+ pending: number;
2481
+ counters: Partial<Record<"likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks", number>>;
2482
+ baseline: Partial<Record<"likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks", number>>;
2483
+ observation: string | null;
2484
+ nextSettlementAt: number | null;
2485
+ reason: string | null;
2486
+ } | null;
2487
+ items: {
2506
2488
  id: string;
2507
- prompt: string;
2508
- choices: {
2509
- id: string;
2510
- label: string;
2511
- }[];
2512
- correct: string;
2513
- }[]>;
2514
- rewards: ({
2515
- kind: "tier";
2516
- reward: {
2517
- id: string;
2518
- title: string;
2519
- tiers: {
2520
- id: string;
2521
- title: string;
2522
- }[];
2523
- inventory: {
2524
- kind: "untracked";
2489
+ day: string;
2490
+ observation: string;
2491
+ qualification: string;
2492
+ earned: number;
2493
+ growth: number;
2494
+ paid: number;
2495
+ excluded: number;
2496
+ entry: string | null;
2497
+ createdAt: number;
2498
+ }[];
2499
+ nextCursor: string | null;
2500
+ }>;
2501
+ /** The formula boundaries the member's settlements for one post crossed, newest first. */
2502
+ boundaries: (query: z.input<typeof engagementPageQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
2503
+ current: {
2504
+ version: string;
2505
+ definition: {
2506
+ key: string;
2507
+ qualifiedBy: string;
2508
+ balance: string;
2509
+ metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2510
+ baseline: "historical";
2511
+ maxAgeMs: number;
2512
+ budget: {
2513
+ projectDaily?: number | undefined;
2514
+ memberDaily?: number | undefined;
2515
+ projectLifetime?: number | undefined;
2525
2516
  };
2526
- fulfillment: {
2527
- kind: "staff-handover";
2528
- };
2529
- };
2530
- tier: string;
2531
- } | {
2532
- kind: "points";
2533
- balance: string;
2534
- amount: number;
2535
- } | {
2536
- kind: "integration";
2537
- provider: "discord";
2538
- action: "grant-role";
2539
- roleId: string;
2540
- })[];
2541
- humanReview: boolean;
2542
- trigger: {
2543
- kind: "automatic";
2544
- observation?: {
2545
- source: string;
2546
- type: string;
2547
- } | undefined;
2548
- content?: {
2549
- tracker: string;
2550
- window: {
2551
- start: number;
2552
- end?: number | undefined;
2553
- };
2554
- enrollment: "none" | "required";
2555
- posts: "after-enrollment" | "since-start";
2556
- historical: "automatic" | "claim" | "staff";
2557
- } | undefined;
2558
- tracker?: {
2559
- tracker: string;
2560
- source: "custom" | "x-search";
2561
- beneficiary: string;
2562
- on?: "new-record" | "new-observation" | "data-changed" | undefined;
2563
- where?: {
2564
- path: string;
2565
- gt?: number | {
2566
- setting: string;
2567
- } | undefined;
2568
- gte?: number | {
2569
- setting: string;
2570
- } | undefined;
2571
- lt?: number | {
2572
- setting: string;
2573
- } | undefined;
2574
- lte?: number | {
2575
- setting: string;
2576
- } | undefined;
2577
- } | {
2578
- path: string;
2579
- equals: string | number | boolean;
2580
- } | undefined;
2581
- } | undefined;
2582
- } | {
2583
- kind: "manual";
2584
- input: "text";
2585
- constraints: {
2586
- required: boolean;
2587
- minLength: number;
2588
- maxLength: number;
2589
- };
2590
- actor?: "member" | "staff" | undefined;
2591
- } | {
2592
- kind: "manual";
2593
- input: "url";
2594
- constraints: {
2595
- required: boolean;
2596
- allowedHosts?: string[] | undefined;
2597
- };
2598
- actor?: "member" | "staff" | undefined;
2599
- } | {
2600
- kind: "manual";
2601
- input: "none" | "quiz" | "photo";
2602
- actor?: "member" | "staff" | undefined;
2603
- };
2604
- requires: {
2605
- quest: string;
2606
- }[];
2607
- completion: {
2608
- kind: "streak";
2609
- days: number;
2610
- timeZone: string;
2611
- } | {
2612
- kind: "once";
2613
- } | {
2614
- kind: "keyed";
2615
- };
2616
- visibility: "visible" | "hidden";
2617
- budgets: {
2618
- id: string;
2619
- scope: "member" | "project";
2620
- period: "day" | "lifetime" | "week";
2621
- limit: number;
2622
- cost: number | {
2623
- balance: string;
2624
- };
2625
- }[];
2626
- performance?: {
2627
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2628
- maxAgeMs: number;
2629
- } | undefined;
2630
- profile?: {
2631
- visible: boolean;
2632
- } | undefined;
2633
- };
2634
- }[]>;
2635
- /** @deprecated Removed from the participant API. Build quests with `domino` and `@domino-sdk/relay/build`. */
2636
- template: () => Promise<{
2637
- code: string;
2638
- definition: {
2639
- quest: string;
2640
- runtimeVersion: 1 | 2;
2641
- title: string;
2642
- presentation: {
2643
- quiz?: {
2644
- id: string;
2645
- prompt: string;
2646
- choices: {
2647
- id: string;
2648
- label: string;
2649
- }[];
2650
- }[] | undefined;
2651
- instructions?: string | undefined;
2652
- video?: {
2653
- url: string;
2654
- poster?: string | undefined;
2655
- captions?: {
2656
- url: string;
2657
- language: string;
2658
- label: string;
2659
- } | undefined;
2660
- } | undefined;
2661
- };
2662
- integrations: "discord"[];
2663
- fields: Record<string, {
2664
- kind: "point-ledger";
2665
- default: string;
2666
- label: string;
2667
- description?: string | undefined;
2668
- } | {
2669
- kind: "datetime";
2670
- default: string;
2671
- label: string;
2672
- description?: string | undefined;
2673
- } | {
2674
- kind: "resource";
2675
- default: string;
2676
- source: {
2677
- provider: "discord";
2678
- resource: "channel";
2679
- types: ("text" | "announcement")[];
2680
- } | {
2681
- provider: "domino";
2682
- resource: "point-ledger";
2683
- } | {
2684
- provider: "discord";
2685
- resource: "role";
2686
- assignable: boolean;
2687
- };
2688
- label: string;
2689
- description?: string | undefined;
2690
- } | {
2691
- kind: "quiz";
2692
- default: {
2693
- id: string;
2694
- prompt: string;
2695
- choices: {
2696
- id: string;
2697
- label: string;
2698
- }[];
2699
- correct: string;
2700
- }[];
2701
- label: string;
2702
- description?: string | undefined;
2703
- } | {
2704
- kind: "text";
2705
- default: string;
2706
- minLength: number;
2707
- maxLength: number;
2708
- multiline: boolean;
2709
- label: string;
2710
- description?: string | undefined;
2711
- } | {
2712
- kind: "integer";
2713
- default: number;
2714
- min: number;
2715
- max: number;
2716
- label: string;
2717
- description?: string | undefined;
2718
- } | {
2719
- kind: "boolean";
2720
- default: boolean;
2721
- label: string;
2722
- description?: string | undefined;
2723
- } | {
2724
- kind: "choice";
2725
- default: string;
2726
- options: string[];
2727
- label: string;
2728
- description?: string | undefined;
2729
- }>;
2730
- values: Record<string, string | number | boolean | {
2731
- id: string;
2732
- prompt: string;
2733
- choices: {
2734
- id: string;
2735
- label: string;
2736
- }[];
2737
- correct: string;
2738
- }[]>;
2739
- rewards: ({
2740
- kind: "tier";
2741
- reward: {
2742
- id: string;
2743
- title: string;
2744
- tiers: {
2745
- id: string;
2746
- title: string;
2747
- }[];
2748
- inventory: {
2749
- kind: "untracked";
2750
- };
2751
- fulfillment: {
2752
- kind: "staff-handover";
2753
- };
2754
- };
2755
- tier: string;
2756
- } | {
2757
- kind: "points";
2758
- balance: string;
2759
- amount: number;
2760
- } | {
2761
- kind: "integration";
2762
- provider: "discord";
2763
- action: "grant-role";
2764
- roleId: string;
2765
- })[];
2766
- humanReview: boolean;
2767
- trigger: {
2768
- kind: "automatic";
2769
- observation?: {
2770
- source: string;
2771
- type: string;
2772
- } | undefined;
2773
- content?: {
2774
- tracker: string;
2775
- window: {
2776
- start: number;
2777
- end?: number | undefined;
2778
- };
2779
- enrollment: "none" | "required";
2780
- posts: "after-enrollment" | "since-start";
2781
- historical: "automatic" | "claim" | "staff";
2782
- } | undefined;
2783
- tracker?: {
2784
- tracker: string;
2785
- source: "custom" | "x-search";
2786
- beneficiary: string;
2787
- on?: "new-record" | "new-observation" | "data-changed" | undefined;
2788
- where?: {
2789
- path: string;
2790
- gt?: number | {
2791
- setting: string;
2792
- } | undefined;
2793
- gte?: number | {
2794
- setting: string;
2795
- } | undefined;
2796
- lt?: number | {
2797
- setting: string;
2798
- } | undefined;
2799
- lte?: number | {
2800
- setting: string;
2801
- } | undefined;
2802
- } | {
2803
- path: string;
2804
- equals: string | number | boolean;
2805
- } | undefined;
2806
- } | undefined;
2807
- } | {
2808
- kind: "manual";
2809
- input: "text";
2810
- constraints: {
2811
- required: boolean;
2812
- minLength: number;
2813
- maxLength: number;
2814
- };
2815
- actor?: "member" | "staff" | undefined;
2816
- } | {
2817
- kind: "manual";
2818
- input: "url";
2819
- constraints: {
2820
- required: boolean;
2821
- allowedHosts?: string[] | undefined;
2822
- };
2823
- actor?: "member" | "staff" | undefined;
2824
- } | {
2825
- kind: "manual";
2826
- input: "none" | "quiz" | "photo";
2827
- actor?: "member" | "staff" | undefined;
2828
- };
2829
- requires: {
2830
- quest: string;
2831
- }[];
2832
- completion: {
2833
- kind: "streak";
2834
- days: number;
2835
- timeZone: string;
2836
- } | {
2837
- kind: "once";
2838
- } | {
2839
- kind: "keyed";
2840
- };
2841
- visibility: "visible" | "hidden";
2842
- budgets: {
2843
- id: string;
2844
- scope: "member" | "project";
2845
- period: "day" | "lifetime" | "week";
2846
- limit: number;
2847
- cost: number | {
2848
- balance: string;
2849
- };
2850
- }[];
2851
- performance?: {
2852
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2853
- maxAgeMs: number;
2854
- } | undefined;
2855
- profile?: {
2856
- visible: boolean;
2857
- } | undefined;
2858
- };
2859
- }>;
2860
- /** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
2861
- snapshot: () => Promise<{
2862
- releases: {
2863
- quest: string;
2864
- runtimeVersion: 1 | 2;
2865
- title: string;
2866
- presentation: {
2867
- quiz?: {
2868
- id: string;
2869
- prompt: string;
2870
- choices: {
2871
- id: string;
2872
- label: string;
2873
- }[];
2874
- }[] | undefined;
2875
- instructions?: string | undefined;
2876
- video?: {
2877
- url: string;
2878
- poster?: string | undefined;
2879
- captions?: {
2880
- url: string;
2881
- language: string;
2882
- label: string;
2883
- } | undefined;
2884
- } | undefined;
2885
- };
2886
- integrations: "discord"[];
2887
- fields: Record<string, {
2888
- kind: "point-ledger";
2889
- default: string;
2890
- label: string;
2891
- description?: string | undefined;
2892
- } | {
2893
- kind: "datetime";
2894
- default: string;
2895
- label: string;
2896
- description?: string | undefined;
2897
- } | {
2898
- kind: "resource";
2899
- default: string;
2900
- source: {
2901
- provider: "discord";
2902
- resource: "channel";
2903
- types: ("text" | "announcement")[];
2904
- } | {
2905
- provider: "domino";
2906
- resource: "point-ledger";
2907
- } | {
2908
- provider: "discord";
2909
- resource: "role";
2910
- assignable: boolean;
2911
- };
2912
- label: string;
2913
- description?: string | undefined;
2914
- } | {
2915
- kind: "quiz";
2916
- default: {
2917
- id: string;
2918
- prompt: string;
2919
- choices: {
2920
- id: string;
2921
- label: string;
2922
- }[];
2923
- correct: string;
2924
- }[];
2925
- label: string;
2926
- description?: string | undefined;
2927
- } | {
2928
- kind: "text";
2929
- default: string;
2930
- minLength: number;
2931
- maxLength: number;
2932
- multiline: boolean;
2933
- label: string;
2934
- description?: string | undefined;
2935
- } | {
2936
- kind: "integer";
2937
- default: number;
2938
- min: number;
2939
- max: number;
2940
- label: string;
2941
- description?: string | undefined;
2942
- } | {
2943
- kind: "boolean";
2944
- default: boolean;
2945
- label: string;
2946
- description?: string | undefined;
2947
- } | {
2948
- kind: "choice";
2949
- default: string;
2950
- options: string[];
2951
- label: string;
2952
- description?: string | undefined;
2953
- }>;
2954
- values: Record<string, string | number | boolean | {
2955
- id: string;
2956
- prompt: string;
2957
- choices: {
2958
- id: string;
2959
- label: string;
2960
- }[];
2961
- correct: string;
2962
- }[]>;
2963
- rewards: ({
2964
- kind: "tier";
2965
- reward: {
2966
- id: string;
2967
- title: string;
2968
- tiers: {
2969
- id: string;
2970
- title: string;
2971
- }[];
2972
- inventory: {
2973
- kind: "untracked";
2974
- };
2975
- fulfillment: {
2976
- kind: "staff-handover";
2977
- };
2978
- };
2979
- tier: string;
2980
- } | {
2981
- kind: "points";
2982
- balance: string;
2983
- amount: number;
2984
- } | {
2985
- kind: "integration";
2986
- provider: "discord";
2987
- action: "grant-role";
2988
- roleId: string;
2989
- })[];
2990
- humanReview: boolean;
2991
- trigger: {
2992
- kind: "automatic";
2993
- observation?: {
2994
- source: string;
2995
- type: string;
2996
- } | undefined;
2997
- content?: {
2998
- tracker: string;
2999
- window: {
3000
- start: number;
3001
- end?: number | undefined;
3002
- };
3003
- enrollment: "none" | "required";
3004
- posts: "after-enrollment" | "since-start";
3005
- historical: "automatic" | "claim" | "staff";
3006
- } | undefined;
3007
- tracker?: {
3008
- tracker: string;
3009
- source: "custom" | "x-search";
3010
- beneficiary: string;
3011
- on?: "new-record" | "new-observation" | "data-changed" | undefined;
3012
- where?: {
3013
- path: string;
3014
- gt?: number | {
3015
- setting: string;
3016
- } | undefined;
3017
- gte?: number | {
3018
- setting: string;
3019
- } | undefined;
3020
- lt?: number | {
3021
- setting: string;
3022
- } | undefined;
3023
- lte?: number | {
3024
- setting: string;
3025
- } | undefined;
3026
- } | {
3027
- path: string;
3028
- equals: string | number | boolean;
3029
- } | undefined;
3030
- } | undefined;
3031
- } | {
3032
- kind: "manual";
3033
- input: "text";
3034
- constraints: {
3035
- required: boolean;
3036
- minLength: number;
3037
- maxLength: number;
3038
- };
3039
- actor?: "member" | "staff" | undefined;
3040
- } | {
3041
- kind: "manual";
3042
- input: "url";
3043
- constraints: {
3044
- required: boolean;
3045
- allowedHosts?: string[] | undefined;
3046
- };
3047
- actor?: "member" | "staff" | undefined;
3048
- } | {
3049
- kind: "manual";
3050
- input: "none" | "quiz" | "photo";
3051
- actor?: "member" | "staff" | undefined;
3052
- };
3053
- requires: {
3054
- quest: string;
3055
- }[];
3056
- completion: {
3057
- kind: "streak";
3058
- days: number;
3059
- timeZone: string;
3060
- } | {
3061
- kind: "once";
3062
- } | {
3063
- kind: "keyed";
3064
- };
3065
- visibility: "visible" | "hidden";
3066
- budgets: {
3067
- id: string;
3068
- scope: "member" | "project";
3069
- period: "day" | "lifetime" | "week";
3070
- limit: number;
3071
- cost: number | {
3072
- balance: string;
3073
- };
3074
- }[];
3075
- code: string;
3076
- provider: "workers-ai" | "fixture-pass" | "fixture-fail" | "fixture-unclear" | "fixture-error";
3077
- id: string;
3078
- createdAt: number;
3079
- legacy: boolean;
3080
- lifecycle: "paused" | "active" | "archived";
3081
- performance?: {
3082
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
3083
- maxAgeMs: number;
3084
- } | undefined;
3085
- profile?: {
3086
- visible: boolean;
3087
- } | undefined;
3088
- key?: string | undefined;
3089
- origin?: {
3090
- typeVersion: string;
3091
- } | undefined;
3092
- configuration?: {
3093
- defaults: Record<string, string | number | boolean | {
3094
- id: string;
3095
- prompt: string;
3096
- choices: {
3097
- id: string;
3098
- label: string;
3099
- }[];
3100
- correct: string;
3101
- }[]>;
3102
- overrides: Record<string, string | number | boolean | {
3103
- id: string;
3104
- prompt: string;
3105
- choices: {
3106
- id: string;
3107
- label: string;
3108
- }[];
3109
- correct: string;
3110
- }[]>;
3111
- preserved: string[];
3112
- } | undefined;
3113
- }[];
3114
- completions: {
3115
- key: string;
3116
- id: string;
3117
- quest: string;
3118
- member: string;
3119
- }[];
3120
- entitlements: ({
3121
- status: "available";
3122
- id: string;
3123
- member: string;
3124
- reward: {
3125
- id: string;
3126
- title: string;
3127
- tiers: {
3128
- id: string;
3129
- title: string;
3130
- }[];
3131
- inventory: {
3132
- kind: "untracked";
3133
- };
3134
- fulfillment: {
3135
- kind: "staff-handover";
3136
- };
3137
- };
3138
- earnedTier: string;
3139
- tier: string;
3140
- revision: number;
3141
- } | {
3142
- status: "handing-over";
3143
- handover: string;
3144
- startedAt: number;
3145
- id: string;
3146
- member: string;
3147
- reward: {
3148
- id: string;
3149
- title: string;
3150
- tiers: {
3151
- id: string;
3152
- title: string;
3153
- }[];
3154
- inventory: {
3155
- kind: "untracked";
3156
- };
3157
- fulfillment: {
3158
- kind: "staff-handover";
3159
- };
3160
- };
3161
- earnedTier: string;
3162
- tier: string;
3163
- revision: number;
3164
- allocation?: {
3165
- item: string;
3166
- label: string;
3167
- } | undefined;
3168
- } | {
3169
- status: "collected";
3170
- handover: string;
3171
- startedAt: number;
3172
- collectedAt: number;
3173
- id: string;
3174
- member: string;
3175
- reward: {
3176
- id: string;
3177
- title: string;
3178
- tiers: {
3179
- id: string;
3180
- title: string;
3181
- }[];
3182
- inventory: {
3183
- kind: "untracked";
3184
- };
3185
- fulfillment: {
3186
- kind: "staff-handover";
3187
- };
3188
- };
3189
- earnedTier: string;
3190
- tier: string;
3191
- revision: number;
3192
- allocation?: {
3193
- item: string;
3194
- label: string;
3195
- } | undefined;
3196
- })[];
3197
- attempts: {
3198
- id: string;
3199
- release: string;
3200
- quest: string;
3201
- member: string;
3202
- evidence: string | null;
3203
- status: "needs-review" | "failed" | "queued" | "evaluating" | "accepted" | "progressed" | "rejected";
3204
- reason: string | null;
3205
- retries: number;
3206
- generation: number;
3207
- completion: string | null;
3208
- reviewRewards: ({
3209
- kind: "tier";
3210
- reward: {
3211
- id: string;
3212
- title: string;
3213
- tiers: {
3214
- id: string;
3215
- title: string;
3216
- }[];
3217
- inventory: {
3218
- kind: "untracked";
3219
- };
3220
- fulfillment: {
3221
- kind: "staff-handover";
3222
- };
3223
- };
3224
- tier: string;
3225
- } | {
3226
- kind: "points";
3227
- balance: string;
3228
- amount: number;
3229
- } | {
3230
- kind: "integration";
3231
- provider: "discord";
3232
- action: "grant-role";
3233
- roleId: string;
3234
- })[] | null;
3235
- requestedReview: boolean;
3236
- createdAt: number;
3237
- input?: {
3238
- kind: "text";
3239
- value: string;
3240
- } | {
3241
- kind: "url";
3242
- value: string;
3243
- } | {
3244
- kind: "quiz";
3245
- answers: {
3246
- [k: string]: string;
3247
- };
3248
- release?: string | undefined;
3249
- } | undefined;
3250
- }[];
3251
- balances: {
3252
- member: string;
3253
- balance: string;
3254
- earned: number;
3255
- held: number;
3256
- available: number;
3257
- }[];
3258
- events: {
3259
- id: number;
3260
- attempt: string | null;
3261
- kind: string;
3262
- detail: string;
3263
- actor: string | null;
3264
- at: number;
3265
- }[];
3266
- }>;
3267
- /** @deprecated The participant API rejects publication. Publish with `domino deploy` or the management API. */
3268
- publish: (release: ReleaseInput) => Promise<{
3269
- quest: string;
3270
- runtimeVersion: 1 | 2;
3271
- title: string;
3272
- presentation: {
3273
- quiz?: {
3274
- id: string;
3275
- prompt: string;
3276
- choices: {
3277
- id: string;
3278
- label: string;
3279
- }[];
3280
- }[] | undefined;
3281
- instructions?: string | undefined;
3282
- video?: {
3283
- url: string;
3284
- poster?: string | undefined;
3285
- captions?: {
3286
- url: string;
3287
- language: string;
3288
- label: string;
3289
- } | undefined;
3290
- } | undefined;
3291
- };
3292
- integrations: "discord"[];
3293
- fields: Record<string, {
3294
- kind: "point-ledger";
3295
- default: string;
3296
- label: string;
3297
- description?: string | undefined;
3298
- } | {
3299
- kind: "datetime";
3300
- default: string;
3301
- label: string;
3302
- description?: string | undefined;
3303
- } | {
3304
- kind: "resource";
3305
- default: string;
3306
- source: {
3307
- provider: "discord";
3308
- resource: "channel";
3309
- types: ("text" | "announcement")[];
3310
- } | {
3311
- provider: "domino";
3312
- resource: "point-ledger";
3313
- } | {
3314
- provider: "discord";
3315
- resource: "role";
3316
- assignable: boolean;
3317
- };
3318
- label: string;
3319
- description?: string | undefined;
3320
- } | {
3321
- kind: "quiz";
3322
- default: {
3323
- id: string;
3324
- prompt: string;
3325
- choices: {
3326
- id: string;
3327
- label: string;
3328
- }[];
3329
- correct: string;
3330
- }[];
3331
- label: string;
3332
- description?: string | undefined;
3333
- } | {
3334
- kind: "text";
3335
- default: string;
3336
- minLength: number;
3337
- maxLength: number;
3338
- multiline: boolean;
3339
- label: string;
3340
- description?: string | undefined;
3341
- } | {
3342
- kind: "integer";
3343
- default: number;
3344
- min: number;
3345
- max: number;
3346
- label: string;
3347
- description?: string | undefined;
3348
- } | {
3349
- kind: "boolean";
3350
- default: boolean;
3351
- label: string;
3352
- description?: string | undefined;
3353
- } | {
3354
- kind: "choice";
3355
- default: string;
3356
- options: string[];
3357
- label: string;
3358
- description?: string | undefined;
3359
- }>;
3360
- values: Record<string, string | number | boolean | {
3361
- id: string;
3362
- prompt: string;
3363
- choices: {
3364
- id: string;
3365
- label: string;
3366
- }[];
3367
- correct: string;
3368
- }[]>;
3369
- rewards: ({
3370
- kind: "tier";
3371
- reward: {
3372
- id: string;
3373
- title: string;
3374
- tiers: {
3375
- id: string;
3376
- title: string;
3377
- }[];
3378
- inventory: {
3379
- kind: "untracked";
3380
- };
3381
- fulfillment: {
3382
- kind: "staff-handover";
3383
- };
3384
- };
3385
- tier: string;
3386
- } | {
3387
- kind: "points";
3388
- balance: string;
3389
- amount: number;
3390
- } | {
3391
- kind: "integration";
3392
- provider: "discord";
3393
- action: "grant-role";
3394
- roleId: string;
3395
- })[];
3396
- humanReview: boolean;
3397
- trigger: {
3398
- kind: "automatic";
3399
- observation?: {
3400
- source: string;
3401
- type: string;
3402
- } | undefined;
3403
- content?: {
3404
- tracker: string;
3405
- window: {
3406
- start: number;
3407
- end?: number | undefined;
3408
- };
3409
- enrollment: "none" | "required";
3410
- posts: "after-enrollment" | "since-start";
3411
- historical: "automatic" | "claim" | "staff";
3412
- } | undefined;
3413
- tracker?: {
3414
- tracker: string;
3415
- source: "custom" | "x-search";
3416
- beneficiary: string;
3417
- on?: "new-record" | "new-observation" | "data-changed" | undefined;
3418
- where?: {
3419
- path: string;
3420
- gt?: number | {
3421
- setting: string;
3422
- } | undefined;
3423
- gte?: number | {
3424
- setting: string;
3425
- } | undefined;
3426
- lt?: number | {
3427
- setting: string;
3428
- } | undefined;
3429
- lte?: number | {
3430
- setting: string;
3431
- } | undefined;
3432
- } | {
3433
- path: string;
3434
- equals: string | number | boolean;
3435
- } | undefined;
3436
- } | undefined;
3437
- } | {
3438
- kind: "manual";
3439
- input: "text";
3440
- constraints: {
3441
- required: boolean;
3442
- minLength: number;
3443
- maxLength: number;
3444
- };
3445
- actor?: "member" | "staff" | undefined;
3446
- } | {
3447
- kind: "manual";
3448
- input: "url";
3449
- constraints: {
3450
- required: boolean;
3451
- allowedHosts?: string[] | undefined;
3452
- };
3453
- actor?: "member" | "staff" | undefined;
3454
- } | {
3455
- kind: "manual";
3456
- input: "none" | "quiz" | "photo";
3457
- actor?: "member" | "staff" | undefined;
3458
- };
3459
- requires: {
3460
- quest: string;
3461
- }[];
3462
- completion: {
3463
- kind: "streak";
3464
- days: number;
3465
- timeZone: string;
3466
- } | {
3467
- kind: "once";
3468
- } | {
3469
- kind: "keyed";
3470
- };
3471
- visibility: "visible" | "hidden";
3472
- budgets: {
3473
- id: string;
3474
- scope: "member" | "project";
3475
- period: "day" | "lifetime" | "week";
3476
- limit: number;
3477
- cost: number | {
3478
- balance: string;
3479
- };
3480
- }[];
3481
- code: string;
3482
- provider: "workers-ai" | "fixture-pass" | "fixture-fail" | "fixture-unclear" | "fixture-error";
3483
- id: string;
3484
- createdAt: number;
3485
- legacy: boolean;
3486
- lifecycle: "paused" | "active" | "archived";
3487
- performance?: {
3488
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
3489
- maxAgeMs: number;
3490
- } | undefined;
3491
- profile?: {
3492
- visible: boolean;
3493
- } | undefined;
3494
- key?: string | undefined;
3495
- origin?: {
3496
- typeVersion: string;
3497
- } | undefined;
3498
- configuration?: {
3499
- defaults: Record<string, string | number | boolean | {
3500
- id: string;
3501
- prompt: string;
3502
- choices: {
3503
- id: string;
3504
- label: string;
3505
- }[];
3506
- correct: string;
3507
- }[]>;
3508
- overrides: Record<string, string | number | boolean | {
3509
- id: string;
3510
- prompt: string;
3511
- choices: {
3512
- id: string;
3513
- label: string;
3514
- }[];
3515
- correct: string;
3516
- }[]>;
3517
- preserved: string[];
3518
- } | undefined;
3519
- }>;
3520
- /** @deprecated The participant API rejects publication. Publish with `domino deploy` or the management API. */
3521
- publishBatch: (releases: ReleaseInput[]) => Promise<{
3522
- quest: string;
3523
- runtimeVersion: 1 | 2;
3524
- title: string;
3525
- presentation: {
3526
- quiz?: {
3527
- id: string;
3528
- prompt: string;
3529
- choices: {
3530
- id: string;
3531
- label: string;
3532
- }[];
3533
- }[] | undefined;
3534
- instructions?: string | undefined;
3535
- video?: {
3536
- url: string;
3537
- poster?: string | undefined;
3538
- captions?: {
3539
- url: string;
3540
- language: string;
3541
- label: string;
3542
- } | undefined;
3543
- } | undefined;
3544
- };
3545
- integrations: "discord"[];
3546
- fields: Record<string, {
3547
- kind: "point-ledger";
3548
- default: string;
3549
- label: string;
3550
- description?: string | undefined;
3551
- } | {
3552
- kind: "datetime";
3553
- default: string;
3554
- label: string;
3555
- description?: string | undefined;
3556
- } | {
3557
- kind: "resource";
3558
- default: string;
3559
- source: {
3560
- provider: "discord";
3561
- resource: "channel";
3562
- types: ("text" | "announcement")[];
3563
- } | {
3564
- provider: "domino";
3565
- resource: "point-ledger";
3566
- } | {
3567
- provider: "discord";
3568
- resource: "role";
3569
- assignable: boolean;
3570
- };
3571
- label: string;
3572
- description?: string | undefined;
3573
- } | {
3574
- kind: "quiz";
3575
- default: {
3576
- id: string;
3577
- prompt: string;
3578
- choices: {
3579
- id: string;
3580
- label: string;
3581
- }[];
3582
- correct: string;
3583
- }[];
3584
- label: string;
3585
- description?: string | undefined;
3586
- } | {
3587
- kind: "text";
3588
- default: string;
3589
- minLength: number;
3590
- maxLength: number;
3591
- multiline: boolean;
3592
- label: string;
3593
- description?: string | undefined;
3594
- } | {
3595
- kind: "integer";
3596
- default: number;
3597
- min: number;
3598
- max: number;
3599
- label: string;
3600
- description?: string | undefined;
3601
- } | {
3602
- kind: "boolean";
3603
- default: boolean;
3604
- label: string;
3605
- description?: string | undefined;
3606
- } | {
3607
- kind: "choice";
3608
- default: string;
3609
- options: string[];
3610
- label: string;
3611
- description?: string | undefined;
3612
- }>;
3613
- values: Record<string, string | number | boolean | {
3614
- id: string;
3615
- prompt: string;
3616
- choices: {
3617
- id: string;
3618
- label: string;
3619
- }[];
3620
- correct: string;
3621
- }[]>;
3622
- rewards: ({
3623
- kind: "tier";
3624
- reward: {
3625
- id: string;
3626
- title: string;
3627
- tiers: {
3628
- id: string;
3629
- title: string;
3630
- }[];
3631
- inventory: {
3632
- kind: "untracked";
3633
- };
3634
- fulfillment: {
3635
- kind: "staff-handover";
3636
- };
3637
- };
3638
- tier: string;
3639
- } | {
3640
- kind: "points";
3641
- balance: string;
3642
- amount: number;
3643
- } | {
3644
- kind: "integration";
3645
- provider: "discord";
3646
- action: "grant-role";
3647
- roleId: string;
3648
- })[];
3649
- humanReview: boolean;
3650
- trigger: {
3651
- kind: "automatic";
3652
- observation?: {
3653
- source: string;
3654
- type: string;
3655
- } | undefined;
3656
- content?: {
3657
- tracker: string;
3658
- window: {
3659
- start: number;
3660
- end?: number | undefined;
3661
- };
3662
- enrollment: "none" | "required";
3663
- posts: "after-enrollment" | "since-start";
3664
- historical: "automatic" | "claim" | "staff";
3665
- } | undefined;
3666
- tracker?: {
3667
- tracker: string;
3668
- source: "custom" | "x-search";
3669
- beneficiary: string;
3670
- on?: "new-record" | "new-observation" | "data-changed" | undefined;
3671
- where?: {
3672
- path: string;
3673
- gt?: number | {
3674
- setting: string;
3675
- } | undefined;
3676
- gte?: number | {
3677
- setting: string;
3678
- } | undefined;
3679
- lt?: number | {
3680
- setting: string;
3681
- } | undefined;
3682
- lte?: number | {
3683
- setting: string;
3684
- } | undefined;
3685
- } | {
3686
- path: string;
3687
- equals: string | number | boolean;
3688
- } | undefined;
3689
- } | undefined;
3690
- } | {
3691
- kind: "manual";
3692
- input: "text";
3693
- constraints: {
3694
- required: boolean;
3695
- minLength: number;
3696
- maxLength: number;
3697
- };
3698
- actor?: "member" | "staff" | undefined;
3699
- } | {
3700
- kind: "manual";
3701
- input: "url";
3702
- constraints: {
3703
- required: boolean;
3704
- allowedHosts?: string[] | undefined;
3705
- };
3706
- actor?: "member" | "staff" | undefined;
3707
- } | {
3708
- kind: "manual";
3709
- input: "none" | "quiz" | "photo";
3710
- actor?: "member" | "staff" | undefined;
3711
- };
3712
- requires: {
3713
- quest: string;
3714
- }[];
3715
- completion: {
3716
- kind: "streak";
3717
- days: number;
3718
- timeZone: string;
3719
- } | {
3720
- kind: "once";
3721
- } | {
3722
- kind: "keyed";
3723
- };
3724
- visibility: "visible" | "hidden";
3725
- budgets: {
3726
- id: string;
3727
- scope: "member" | "project";
3728
- period: "day" | "lifetime" | "week";
3729
- limit: number;
3730
- cost: number | {
3731
- balance: string;
3732
- };
3733
- }[];
3734
- code: string;
3735
- provider: "workers-ai" | "fixture-pass" | "fixture-fail" | "fixture-unclear" | "fixture-error";
3736
- id: string;
3737
- createdAt: number;
3738
- legacy: boolean;
3739
- lifecycle: "paused" | "active" | "archived";
3740
- performance?: {
3741
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
3742
- maxAgeMs: number;
3743
- } | undefined;
3744
- profile?: {
3745
- visible: boolean;
3746
- } | undefined;
3747
- key?: string | undefined;
3748
- origin?: {
3749
- typeVersion: string;
3750
- } | undefined;
3751
- configuration?: {
3752
- defaults: Record<string, string | number | boolean | {
3753
- id: string;
3754
- prompt: string;
3755
- choices: {
3756
- id: string;
3757
- label: string;
3758
- }[];
3759
- correct: string;
3760
- }[]>;
3761
- overrides: Record<string, string | number | boolean | {
3762
- id: string;
3763
- prompt: string;
3764
- choices: {
3765
- id: string;
3766
- label: string;
3767
- }[];
3768
- correct: string;
3769
- }[]>;
3770
- preserved: string[];
3771
- } | undefined;
3772
- }[]>;
3773
- progress: (member: string) => Promise<{
3774
- member: string;
3775
- quests: {
3776
- quest: string;
3777
- title: string;
3778
- presentation: {
3779
- quiz?: {
3780
- id: string;
3781
- prompt: string;
3782
- choices: {
3783
- id: string;
3784
- label: string;
3785
- }[];
3786
- }[] | undefined;
3787
- instructions?: string | undefined;
3788
- video?: {
3789
- url: string;
3790
- poster?: string | undefined;
3791
- captions?: {
3792
- url: string;
3793
- language: string;
3794
- label: string;
3795
- } | undefined;
3796
- } | undefined;
3797
- };
3798
- connections: ("google" | "apple" | "x" | "discord")[];
3799
- trigger: {
3800
- kind: "automatic";
3801
- observation?: {
3802
- source: string;
3803
- type: string;
3804
- } | undefined;
3805
- content?: {
3806
- tracker: string;
3807
- window: {
3808
- start: number;
3809
- end?: number | undefined;
3810
- };
3811
- enrollment: "none" | "required";
3812
- posts: "after-enrollment" | "since-start";
3813
- historical: "automatic" | "claim" | "staff";
3814
- } | undefined;
3815
- tracker?: {
3816
- tracker: string;
3817
- source: "custom" | "x-search";
3818
- beneficiary: string;
3819
- on?: "new-record" | "new-observation" | "data-changed" | undefined;
3820
- where?: {
3821
- path: string;
3822
- gt?: number | {
3823
- setting: string;
3824
- } | undefined;
3825
- gte?: number | {
3826
- setting: string;
3827
- } | undefined;
3828
- lt?: number | {
3829
- setting: string;
3830
- } | undefined;
3831
- lte?: number | {
3832
- setting: string;
3833
- } | undefined;
3834
- } | {
3835
- path: string;
3836
- equals: string | number | boolean;
3837
- } | undefined;
3838
- } | undefined;
3839
- } | {
3840
- kind: "manual";
3841
- input: "text";
3842
- constraints: {
3843
- required: boolean;
3844
- minLength: number;
3845
- maxLength: number;
3846
- };
3847
- actor?: "member" | "staff" | undefined;
3848
- } | {
3849
- kind: "manual";
3850
- input: "url";
3851
- constraints: {
3852
- required: boolean;
3853
- allowedHosts?: string[] | undefined;
3854
- };
3855
- actor?: "member" | "staff" | undefined;
3856
- } | {
3857
- kind: "manual";
3858
- input: "none" | "quiz" | "photo";
3859
- actor?: "member" | "staff" | undefined;
3860
- };
3861
- availability: {
3862
- kind: "available";
3863
- input: "text" | "url" | "none" | "quiz" | "photo";
3864
- } | {
3865
- kind: "completed";
3866
- } | {
3867
- kind: "locked";
3868
- missing: {
3869
- quest: string;
3870
- title: string;
3871
- }[];
3872
- } | {
3873
- kind: "staff-required";
3874
- } | {
3875
- kind: "automatic";
3876
- observation?: {
3877
- source: string;
3878
- type: string;
3879
- } | undefined;
3880
- } | {
3881
- kind: "checking";
3882
- attempt: string;
3883
- } | {
3884
- kind: "needs-review";
3885
- attempt: string;
3886
- } | {
3887
- kind: "retryable";
3888
- attempt: string;
3889
- };
3890
- completed: boolean;
3891
- completion: {
3892
- kind: "streak";
3893
- days: number;
3894
- timeZone: string;
3895
- } | {
3896
- kind: "once";
3897
- } | {
3898
- kind: "keyed";
3899
- };
3900
- completionCount: number;
3901
- visibility: "visible" | "hidden";
3902
- missing: {
3903
- quest: string;
3904
- title: string;
3905
- }[];
3906
- attempt: {
3907
- id: string;
3908
- release: string;
3909
- quest: string;
3910
- member: string;
3911
- evidence: string | null;
3912
- status: "needs-review" | "failed" | "queued" | "evaluating" | "accepted" | "progressed" | "rejected";
3913
- reason: string | null;
3914
- retries: number;
3915
- generation: number;
3916
- completion: string | null;
3917
- reviewRewards: ({
3918
- kind: "tier";
3919
- reward: {
3920
- id: string;
3921
- title: string;
3922
- tiers: {
3923
- id: string;
3924
- title: string;
3925
- }[];
3926
- inventory: {
3927
- kind: "untracked";
3928
- };
3929
- fulfillment: {
3930
- kind: "staff-handover";
3931
- };
3932
- };
3933
- tier: string;
3934
- } | {
3935
- kind: "points";
3936
- balance: string;
3937
- amount: number;
3938
- } | {
3939
- kind: "integration";
3940
- provider: "discord";
3941
- action: "grant-role";
3942
- roleId: string;
3943
- })[] | null;
3944
- requestedReview: boolean;
3945
- createdAt: number;
3946
- input?: {
3947
- kind: "text";
3948
- value: string;
3949
- } | {
3950
- kind: "url";
3951
- value: string;
3952
- } | {
3953
- kind: "quiz";
3954
- answers: {
3955
- [k: string]: string;
3956
- };
3957
- release?: string | undefined;
3958
- } | undefined;
3959
- } | null;
3960
- key?: string | undefined;
3961
- release?: string | undefined;
3962
- streak?: {
3963
- goal: number;
3964
- current: number;
3965
- best: number;
3966
- today: string;
3967
- todayQualified: boolean;
3968
- timeZone: string;
3969
- nextBoundary: number;
3970
- pendingTimeZone: {
3971
- timeZone: string;
3972
- effectiveAt: number;
3973
- } | null;
3974
- days: {
3975
- day: number;
3976
- date: string;
3977
- timeZone: string;
3978
- occurredAt: number;
3979
- }[];
3980
- milestone: {
3981
- status: "pending";
3982
- } | {
3983
- status: "awarded";
3984
- completion: string;
3985
- achievedAt: number;
3986
- } | {
3987
- status: "budget-exhausted";
3988
- budget: string;
3989
- achievedAt: number;
3990
- };
3991
- } | null | undefined;
3992
- }[];
3993
- entitlements: ({
3994
- status: "available";
3995
- id: string;
3996
- member: string;
3997
- reward: {
3998
- id: string;
3999
- title: string;
4000
- tiers: {
4001
- id: string;
4002
- title: string;
4003
- }[];
4004
- inventory: {
4005
- kind: "untracked";
4006
- };
4007
- fulfillment: {
4008
- kind: "staff-handover";
4009
- };
4010
- };
4011
- earnedTier: string;
4012
- tier: string;
4013
- revision: number;
4014
- } | {
4015
- status: "handing-over";
4016
- handover: string;
4017
- startedAt: number;
4018
- id: string;
4019
- member: string;
4020
- reward: {
4021
- id: string;
4022
- title: string;
4023
- tiers: {
4024
- id: string;
4025
- title: string;
4026
- }[];
4027
- inventory: {
4028
- kind: "untracked";
4029
- };
4030
- fulfillment: {
4031
- kind: "staff-handover";
4032
- };
4033
- };
4034
- earnedTier: string;
4035
- tier: string;
4036
- revision: number;
4037
- allocation?: {
4038
- item: string;
4039
- label: string;
4040
- } | undefined;
4041
- } | {
4042
- status: "collected";
4043
- handover: string;
4044
- startedAt: number;
4045
- collectedAt: number;
4046
- id: string;
4047
- member: string;
4048
- reward: {
4049
- id: string;
4050
- title: string;
4051
- tiers: {
4052
- id: string;
4053
- title: string;
4054
- }[];
4055
- inventory: {
4056
- kind: "untracked";
4057
- };
4058
- fulfillment: {
4059
- kind: "staff-handover";
4060
- };
4061
- };
4062
- earnedTier: string;
4063
- tier: string;
4064
- revision: number;
4065
- allocation?: {
4066
- item: string;
4067
- label: string;
4068
- } | undefined;
4069
- })[];
4070
- }>;
4071
- /** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
4072
- beginHandover: (id: string, input: z.input<typeof beginHandoverSchema>) => Promise<{
4073
- status: "available";
4074
- id: string;
4075
- member: string;
4076
- reward: {
4077
- id: string;
4078
- title: string;
4079
- tiers: {
4080
- id: string;
4081
- title: string;
4082
- }[];
4083
- inventory: {
4084
- kind: "untracked";
4085
- };
4086
- fulfillment: {
4087
- kind: "staff-handover";
4088
- };
4089
- };
4090
- earnedTier: string;
4091
- tier: string;
4092
- revision: number;
4093
- } | {
4094
- status: "handing-over";
4095
- handover: string;
4096
- startedAt: number;
4097
- id: string;
4098
- member: string;
4099
- reward: {
4100
- id: string;
4101
- title: string;
4102
- tiers: {
4103
- id: string;
4104
- title: string;
4105
- }[];
4106
- inventory: {
4107
- kind: "untracked";
4108
- };
4109
- fulfillment: {
4110
- kind: "staff-handover";
4111
- };
4112
- };
4113
- earnedTier: string;
4114
- tier: string;
4115
- revision: number;
4116
- allocation?: {
4117
- item: string;
4118
- label: string;
4119
- } | undefined;
4120
- } | {
4121
- status: "collected";
4122
- handover: string;
4123
- startedAt: number;
4124
- collectedAt: number;
4125
- id: string;
4126
- member: string;
4127
- reward: {
4128
- id: string;
4129
- title: string;
4130
- tiers: {
4131
- id: string;
4132
- title: string;
4133
- }[];
4134
- inventory: {
4135
- kind: "untracked";
4136
- };
4137
- fulfillment: {
4138
- kind: "staff-handover";
4139
- };
4140
- };
4141
- earnedTier: string;
4142
- tier: string;
4143
- revision: number;
4144
- allocation?: {
4145
- item: string;
4146
- label: string;
4147
- } | undefined;
4148
- }>;
4149
- /** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
4150
- confirmHandover: (id: string, input: {
4151
- actionId: string;
4152
- handover: string;
4153
- }) => Promise<{
4154
- status: "available";
4155
- id: string;
4156
- member: string;
4157
- reward: {
4158
- id: string;
4159
- title: string;
4160
- tiers: {
4161
- id: string;
4162
- title: string;
4163
- }[];
4164
- inventory: {
4165
- kind: "untracked";
4166
- };
4167
- fulfillment: {
4168
- kind: "staff-handover";
4169
- };
4170
- };
4171
- earnedTier: string;
4172
- tier: string;
4173
- revision: number;
4174
- } | {
4175
- status: "handing-over";
4176
- handover: string;
4177
- startedAt: number;
4178
- id: string;
4179
- member: string;
4180
- reward: {
4181
- id: string;
4182
- title: string;
4183
- tiers: {
4184
- id: string;
4185
- title: string;
4186
- }[];
4187
- inventory: {
4188
- kind: "untracked";
4189
- };
4190
- fulfillment: {
4191
- kind: "staff-handover";
4192
- };
4193
- };
4194
- earnedTier: string;
4195
- tier: string;
4196
- revision: number;
4197
- allocation?: {
4198
- item: string;
4199
- label: string;
4200
- } | undefined;
4201
- } | {
4202
- status: "collected";
4203
- handover: string;
4204
- startedAt: number;
4205
- collectedAt: number;
4206
- id: string;
4207
- member: string;
4208
- reward: {
4209
- id: string;
4210
- title: string;
4211
- tiers: {
4212
- id: string;
4213
- title: string;
4214
- }[];
4215
- inventory: {
4216
- kind: "untracked";
4217
- };
4218
- fulfillment: {
4219
- kind: "staff-handover";
4220
- };
4221
- };
4222
- earnedTier: string;
4223
- tier: string;
4224
- revision: number;
4225
- allocation?: {
4226
- item: string;
4227
- label: string;
4228
- } | undefined;
4229
- }>;
4230
- upload: (member: string, file: File) => Promise<{
4231
- id: string;
4232
- member: string;
4233
- type: "image/jpeg" | "image/png";
4234
- size: number;
4235
- }>;
4236
- engagement: {
4237
- boundaries: (input: z.output<typeof engagementPageQuerySchema>) => Promise<{
4238
- current: {
4239
- version: string;
4240
- definition: {
4241
- key: string;
4242
- qualifiedBy: string;
4243
- balance: string;
4244
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
4245
- baseline: "historical";
4246
- maxAgeMs: number;
4247
- budget: {
4248
- projectDaily?: number | undefined;
4249
- memberDaily?: number | undefined;
4250
- projectLifetime?: number | undefined;
4251
- };
4252
- };
4253
- publishedAt: number;
4254
- } | null;
4255
- requested: {
4256
- version: string;
4257
- definition: {
4258
- key: string;
4259
- qualifiedBy: string;
4260
- balance: string;
4261
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
4262
- baseline: "historical";
4263
- maxAgeMs: number;
4264
- budget: {
4265
- projectDaily?: number | undefined;
4266
- memberDaily?: number | undefined;
4267
- projectLifetime?: number | undefined;
2517
+ };
2518
+ publishedAt: number;
2519
+ } | null;
2520
+ requested: {
2521
+ version: string;
2522
+ definition: {
2523
+ key: string;
2524
+ qualifiedBy: string;
2525
+ balance: string;
2526
+ metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
2527
+ baseline: "historical";
2528
+ maxAgeMs: number;
2529
+ budget: {
2530
+ projectDaily?: number | undefined;
2531
+ memberDaily?: number | undefined;
2532
+ projectLifetime?: number | undefined;
4268
2533
  };
4269
2534
  };
4270
2535
  publishedAt: number;
@@ -4287,56 +2552,11 @@ declare function createRelayClient(options: {
4287
2552
  createdAt: number;
4288
2553
  };
4289
2554
  }[];
4290
- next: number | null;
4291
- }>;
4292
- page: (input: z.output<typeof engagementPageQuerySchema>) => Promise<{
4293
- rule: {
4294
- version: string;
4295
- definition: {
4296
- key: string;
4297
- qualifiedBy: string;
4298
- balance: string;
4299
- metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
4300
- baseline: "historical";
4301
- maxAgeMs: number;
4302
- budget: {
4303
- projectDaily?: number | undefined;
4304
- memberDaily?: number | undefined;
4305
- projectLifetime?: number | undefined;
4306
- };
4307
- };
4308
- publishedAt: number;
4309
- };
4310
- account: {
4311
- member: string;
4312
- earned: number;
4313
- accounted: number;
4314
- paid: number;
4315
- excluded: number;
4316
- pending: number;
4317
- counters: Partial<Record<"likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks", number>>;
4318
- baseline: Partial<Record<"likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks", number>>;
4319
- observation: string | null;
4320
- nextSettlementAt: number | null;
4321
- reason: string | null;
4322
- } | null;
4323
- items: {
4324
- id: string;
4325
- day: string;
4326
- observation: string;
4327
- qualification: string;
4328
- earned: number;
4329
- growth: number;
4330
- paid: number;
4331
- excluded: number;
4332
- entry: string | null;
4333
- createdAt: number;
4334
- }[];
4335
- next: number | null;
2555
+ nextCursor: string | null;
4336
2556
  }>;
4337
2557
  };
4338
2558
  content: {
4339
- performance: (input: z.output<typeof contentPerformanceQuerySchema>) => Promise<{
2559
+ performance: (query: z.input<typeof contentPerformanceQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
4340
2560
  current: {
4341
2561
  state: "pending" | "superseded" | "qualified" | "unqualified" | "needs-review" | "failed" | "content-pending" | "content-unqualified" | "waiting";
4342
2562
  reason: string | null;
@@ -4357,9 +2577,9 @@ declare function createRelayClient(options: {
4357
2577
  state: "pending" | "superseded" | "qualified" | "unqualified" | "needs-review" | "failed";
4358
2578
  reason: string | null;
4359
2579
  }[];
4360
- next: number | null;
2580
+ nextCursor: string | null;
4361
2581
  }>;
4362
- qualifications: (input: z.output<typeof contentQualificationQuerySchema>) => Promise<{
2582
+ qualifications: (query: z.input<typeof contentQualificationQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
4363
2583
  items: {
4364
2584
  quest: string;
4365
2585
  content: string;
@@ -4377,9 +2597,9 @@ declare function createRelayClient(options: {
4377
2597
  state: "excluded" | "unresolved" | "awarded";
4378
2598
  };
4379
2599
  }[];
4380
- next: number | null;
2600
+ nextCursor: string | null;
4381
2601
  }>;
4382
- admissions: (input: z.input<typeof contentAdmissionQuerySchema>) => Promise<{
2602
+ admissions: (query: z.input<typeof contentAdmissionQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
4383
2603
  items: {
4384
2604
  quest: string;
4385
2605
  content: string;
@@ -4388,14 +2608,14 @@ declare function createRelayClient(options: {
4388
2608
  reason: string | null;
4389
2609
  attempt: string | null;
4390
2610
  }[];
4391
- next: string | null;
2611
+ nextCursor: string | null;
4392
2612
  }>;
4393
- enroll: (input: z.input<typeof contentEnrollmentInputSchema>) => Promise<{
2613
+ enroll: (value: z.input<typeof contentEnrollmentInputSchema>, requestOptions?: RelayRequestOptions) => Promise<{
4394
2614
  quest: string;
4395
2615
  member: string;
4396
2616
  enrolledAt: number;
4397
2617
  }>;
4398
- claim: (input: z.input<typeof contentReleaseInputSchema>) => Promise<{
2618
+ claim: (value: z.input<typeof contentReleaseInputSchema>, requestOptions?: RelayRequestOptions) => Promise<{
4399
2619
  quest: string;
4400
2620
  content: string;
4401
2621
  release: string;
@@ -4404,174 +2624,8 @@ declare function createRelayClient(options: {
4404
2624
  attempt: string | null;
4405
2625
  }>;
4406
2626
  };
4407
- submit: (input: SubmitInput) => Promise<{
4408
- id: string;
4409
- release: string;
4410
- quest: string;
4411
- member: string;
4412
- evidence: string | null;
4413
- status: "needs-review" | "failed" | "queued" | "evaluating" | "accepted" | "progressed" | "rejected";
4414
- reason: string | null;
4415
- retries: number;
4416
- generation: number;
4417
- completion: string | null;
4418
- reviewRewards: ({
4419
- kind: "tier";
4420
- reward: {
4421
- id: string;
4422
- title: string;
4423
- tiers: {
4424
- id: string;
4425
- title: string;
4426
- }[];
4427
- inventory: {
4428
- kind: "untracked";
4429
- };
4430
- fulfillment: {
4431
- kind: "staff-handover";
4432
- };
4433
- };
4434
- tier: string;
4435
- } | {
4436
- kind: "points";
4437
- balance: string;
4438
- amount: number;
4439
- } | {
4440
- kind: "integration";
4441
- provider: "discord";
4442
- action: "grant-role";
4443
- roleId: string;
4444
- })[] | null;
4445
- requestedReview: boolean;
4446
- createdAt: number;
4447
- input?: {
4448
- kind: "text";
4449
- value: string;
4450
- } | {
4451
- kind: "url";
4452
- value: string;
4453
- } | {
4454
- kind: "quiz";
4455
- answers: {
4456
- [k: string]: string;
4457
- };
4458
- release?: string | undefined;
4459
- } | undefined;
4460
- }>;
4461
- retry: (id: string) => Promise<{
4462
- id: string;
4463
- release: string;
4464
- quest: string;
4465
- member: string;
4466
- evidence: string | null;
4467
- status: "needs-review" | "failed" | "queued" | "evaluating" | "accepted" | "progressed" | "rejected";
4468
- reason: string | null;
4469
- retries: number;
4470
- generation: number;
4471
- completion: string | null;
4472
- reviewRewards: ({
4473
- kind: "tier";
4474
- reward: {
4475
- id: string;
4476
- title: string;
4477
- tiers: {
4478
- id: string;
4479
- title: string;
4480
- }[];
4481
- inventory: {
4482
- kind: "untracked";
4483
- };
4484
- fulfillment: {
4485
- kind: "staff-handover";
4486
- };
4487
- };
4488
- tier: string;
4489
- } | {
4490
- kind: "points";
4491
- balance: string;
4492
- amount: number;
4493
- } | {
4494
- kind: "integration";
4495
- provider: "discord";
4496
- action: "grant-role";
4497
- roleId: string;
4498
- })[] | null;
4499
- requestedReview: boolean;
4500
- createdAt: number;
4501
- input?: {
4502
- kind: "text";
4503
- value: string;
4504
- } | {
4505
- kind: "url";
4506
- value: string;
4507
- } | {
4508
- kind: "quiz";
4509
- answers: {
4510
- [k: string]: string;
4511
- };
4512
- release?: string | undefined;
4513
- } | undefined;
4514
- }>;
4515
- /** @deprecated The participant API accepts only member sessions and rejects this staff call. Use the management API with a management key instead. */
4516
- decide: (id: string, input: {
4517
- actionId: string;
4518
- generation: number;
4519
- decision: "accept" | "reject";
4520
- reason: string;
4521
- }) => Promise<{
4522
- id: string;
4523
- release: string;
4524
- quest: string;
4525
- member: string;
4526
- evidence: string | null;
4527
- status: "needs-review" | "failed" | "queued" | "evaluating" | "accepted" | "progressed" | "rejected";
4528
- reason: string | null;
4529
- retries: number;
4530
- generation: number;
4531
- completion: string | null;
4532
- reviewRewards: ({
4533
- kind: "tier";
4534
- reward: {
4535
- id: string;
4536
- title: string;
4537
- tiers: {
4538
- id: string;
4539
- title: string;
4540
- }[];
4541
- inventory: {
4542
- kind: "untracked";
4543
- };
4544
- fulfillment: {
4545
- kind: "staff-handover";
4546
- };
4547
- };
4548
- tier: string;
4549
- } | {
4550
- kind: "points";
4551
- balance: string;
4552
- amount: number;
4553
- } | {
4554
- kind: "integration";
4555
- provider: "discord";
4556
- action: "grant-role";
4557
- roleId: string;
4558
- })[] | null;
4559
- requestedReview: boolean;
4560
- createdAt: number;
4561
- input?: {
4562
- kind: "text";
4563
- value: string;
4564
- } | {
4565
- kind: "url";
4566
- value: string;
4567
- } | {
4568
- kind: "quiz";
4569
- answers: {
4570
- [k: string]: string;
4571
- };
4572
- release?: string | undefined;
4573
- } | undefined;
4574
- }>;
4575
2627
  };
2628
+ /** The participant client `createRelayClient` returns. */
2629
+ type RelayClient = ReturnType<typeof createRelayClient>;
4576
2630
 
4577
- export { type ClaimSubmission as C, type PhotoSubmission as P, type QuestActionResult as Q, RelayError as R, type SubmissionDraft as S, type ValueSubmission as V, type ProgressObservation as a, type ProgressObserver as b, type QuestController as c, QuestUpdatedError as d, type QuizSubmission as e, type SubmissionStatus as f, type SubmissionStore as g, createRelayClient as h };
2631
+ export { type ClaimSubmission as C, type KnownRelayErrorCode as K, type PhotoSubmission as P, type QuestActionResult as Q, type RelayClient as R, type SubmissionDraft as S, type ValueSubmission as V, type ProgressObservation as a, type ProgressObserver as b, type QuestController as c, QuestUpdatedError as d, type QuizSubmission as e, type RelayClientOptions as f, RelayError as g, RelayErrorCode as h, type RelayErrorDetails as i, type RelayErrorKind as j, type RelayRequestOptions as k, RequestError as l, type RequestErrorDetails as m, type RequestErrorKind as n, type RequestRecovery as o, type SubmissionStatus as p, type SubmissionStore as q, createRelayClient as r, isRelayError as s, isRequestError as t };