@domino-sdk/relay 1.7.0 → 1.10.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 (45) hide show
  1. package/dist/action-9Xl0StBg.d.ts +33 -0
  2. package/dist/{activity-Br6vyYze.d.ts → activity-C0O3g7VJ.d.ts} +9 -9
  3. package/dist/authoring.d.ts +12 -12
  4. package/dist/authoring.js +3 -3
  5. package/dist/{automatic-outcomes-C1Q9LrDb.d.ts → automatic-outcomes-kPIDv6X_.d.ts} +1 -1
  6. package/dist/avatar.d.ts +2 -2
  7. package/dist/browser.d.ts +9 -8
  8. package/dist/browser.js +8 -6
  9. package/dist/{capability-error-Bv996M-h.d.ts → capability-error-ty3SqD_b.d.ts} +1 -1
  10. package/dist/{chunk-KGJSKGKI.js → chunk-23JUD56J.js} +1119 -910
  11. package/dist/{chunk-ZOUEEK5L.js → chunk-7BRHUUVB.js} +83 -26
  12. package/dist/{chunk-C25TDFHN.js → chunk-BKLGWPPD.js} +48 -37
  13. package/dist/{chunk-6ON4RMEN.js → chunk-BUXNTVER.js} +1 -1
  14. package/dist/{chunk-BFZHJA2B.js → chunk-GEPSEVQO.js} +2 -2
  15. package/dist/chunk-GFAFH7XR.js +98 -0
  16. package/dist/{chunk-6RBF3UDA.js → chunk-GPS546KR.js} +232 -7
  17. package/dist/{chunk-5ECM6AWV.js → chunk-MMWTHVXW.js} +3 -3
  18. package/dist/chunk-N2HXMTVA.js +13 -0
  19. package/dist/{chunk-23QJ7WH4.js → chunk-QL77V77D.js} +1 -1
  20. package/dist/{chunk-GMPPLZKH.js → chunk-UIR6NSYZ.js} +243 -228
  21. package/dist/{chunk-JW4G3SY5.js → chunk-WRBPLXVP.js} +60 -47
  22. package/dist/{client-pfml_XAa.d.ts → client-Yq11HA_f.d.ts} +64 -43
  23. package/dist/{groups-BpWEqaPn.d.ts → groups-BK8ts2yK.d.ts} +94 -6
  24. package/dist/{images-BaKYd0fl.d.ts → images-aw6W7vFZ.d.ts} +2 -2
  25. package/dist/index.d.ts +10 -9
  26. package/dist/index.js +10 -5
  27. package/dist/internal.d.ts +3 -3
  28. package/dist/internal.js +5 -5
  29. package/dist/{offers-CYtal8jO.d.ts → offers-C2FANzrG.d.ts} +3 -3
  30. package/dist/{pages-CixTNnF4.d.ts → pages-D00JDZB-.d.ts} +70 -39
  31. package/dist/portal-proxy.js +8 -2
  32. package/dist/react/index.d.ts +203 -19
  33. package/dist/react/index.js +256 -113
  34. package/dist/{referral-reward-kinds-ClxAuCGx.d.ts → referral-reward-kinds-M3f0PdiR.d.ts} +2 -2
  35. package/dist/{schema-CQydLqw4.d.ts → schema-DEM8y8Fm.d.ts} +16 -16
  36. package/dist/schema.d.ts +11239 -13
  37. package/dist/schema.js +38 -6
  38. package/dist/server/index.d.ts +43693 -52
  39. package/dist/server/index.js +465 -53
  40. package/dist/{sign-in-options-CtXUFV7E.d.ts → sign-in-options-Coim0G1u.d.ts} +3 -3
  41. package/dist/{submission-input-CLefHTrj.d.ts → submission-input-BbBJTVlT.d.ts} +3 -3
  42. package/dist/util.d-w9f9t3ua.d.ts +5 -0
  43. package/dist/{wallet-YssWxGg8.d.ts → wallet-CDyo-U4n.d.ts} +1 -1
  44. package/package.json +1 -1
  45. package/dist/{profiles-D2aFcOxu.d.ts → profiles-BHMVj0kM.d.ts} +5 -5
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  identifier,
3
+ responseShape,
3
4
  xTweetSchema
4
- } from "./chunk-KGJSKGKI.js";
5
+ } from "./chunk-23JUD56J.js";
5
6
 
6
7
  // src/x.ts
7
8
  import { z } from "zod";
@@ -85,33 +86,41 @@ var imageRequestSchema = z2.discriminatedUnion("operation", [
85
86
  })
86
87
  ]);
87
88
  var hash = z2.string().regex(/^[0-9a-f]{16}$/);
88
- var imageInspectionSchema = z2.strictObject({
89
- width: z2.number().int().positive(),
90
- height: z2.number().int().positive(),
91
- format: z2.enum(["jpeg", "png", "webp", "gif", "avif"]),
92
- bytes: z2.number().int().positive(),
93
- sha256: z2.string().regex(/^[0-9a-f]{64}$/),
94
- phash: hash,
95
- dhash: hash
96
- });
89
+ var imageInspectionSchema = responseShape(
90
+ z2.strictObject({
91
+ width: z2.number().int().positive(),
92
+ height: z2.number().int().positive(),
93
+ format: z2.enum(["jpeg", "png", "webp", "gif", "avif"]),
94
+ bytes: z2.number().int().positive(),
95
+ sha256: z2.string().regex(/^[0-9a-f]{64}$/),
96
+ phash: hash,
97
+ dhash: hash
98
+ })
99
+ );
97
100
  var distance = z2.number().int().min(0).max(64);
98
- var imageComparisonSchema = z2.strictObject({
99
- identical: z2.boolean(),
100
- phashDistance: distance,
101
- dhashDistance: distance
102
- });
103
- var imageExtractionSchema = z2.strictObject({
104
- values: z2.record(
105
- z2.string(),
106
- z2.union([z2.string().max(2e3), z2.number(), z2.boolean(), z2.null()])
107
- ),
108
- reason: z2.string().min(1).max(2e3)
109
- });
110
- var imageSightingsSchema = z2.strictObject({
111
- matches: z2.number().int().nonnegative(),
112
- closestDistance: distance.nullable(),
113
- firstSeenAt: z2.number().int().nonnegative().nullable()
114
- });
101
+ var imageComparisonSchema = responseShape(
102
+ z2.strictObject({
103
+ identical: z2.boolean(),
104
+ phashDistance: distance,
105
+ dhashDistance: distance
106
+ })
107
+ );
108
+ var imageExtractionSchema = responseShape(
109
+ z2.strictObject({
110
+ values: z2.record(
111
+ z2.string(),
112
+ z2.union([z2.string().max(2e3), z2.number(), z2.boolean(), z2.null()])
113
+ ),
114
+ reason: z2.string().min(1).max(2e3)
115
+ })
116
+ );
117
+ var imageSightingsSchema = responseShape(
118
+ z2.strictObject({
119
+ matches: z2.number().int().nonnegative(),
120
+ closestDistance: distance.nullable(),
121
+ firstSeenAt: z2.number().int().nonnegative().nullable()
122
+ })
123
+ );
115
124
  var sha256 = z2.string().regex(/^[0-9a-f]{64}$/);
116
125
  var imageSize = z2.number().int().positive().max(5 * 1024 * 1024);
117
126
  var imageAssetArtifactSchema = z2.strictObject({
@@ -129,26 +138,30 @@ var imageUploadRequestSchema = z2.strictObject({
129
138
  })
130
139
  ).min(1).max(10)
131
140
  });
132
- var imageUploadsSchema = z2.strictObject({
133
- images: z2.array(
134
- z2.strictObject({
135
- sha256,
136
- upload: z2.strictObject({
137
- url: z2.string().url(),
138
- headers: z2.record(z2.string(), z2.string()),
139
- expiresAt: z2.number().int().positive()
140
- }).nullable()
141
- })
142
- )
143
- });
144
- var publishedImageSchema = z2.strictObject({
145
- key: identifier,
146
- sha256,
147
- type: z2.enum(["image/jpeg", "image/png", "image/webp"]),
148
- size: imageSize,
149
- width: z2.number().int().positive(),
150
- height: z2.number().int().positive()
151
- });
141
+ var imageUploadsSchema = responseShape(
142
+ z2.strictObject({
143
+ images: z2.array(
144
+ z2.strictObject({
145
+ sha256,
146
+ upload: z2.strictObject({
147
+ url: z2.string().url(),
148
+ headers: z2.record(z2.string(), z2.string()),
149
+ expiresAt: z2.number().int().positive()
150
+ }).nullable()
151
+ })
152
+ )
153
+ })
154
+ );
155
+ var publishedImageSchema = responseShape(
156
+ z2.strictObject({
157
+ key: identifier,
158
+ sha256,
159
+ type: z2.enum(["image/jpeg", "image/png", "image/webp"]),
160
+ size: imageSize,
161
+ width: z2.number().int().positive(),
162
+ height: z2.number().int().positive()
163
+ })
164
+ );
152
165
 
153
166
  export {
154
167
  xIdSchema,
@@ -1,12 +1,13 @@
1
- import { aW as referralAcceptSchema, g as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, m as PointHistoryQuery, k as PointEntryKind, a2 as engagementPageQuerySchema } from './groups-BpWEqaPn.js';
2
- import { j as QuestView, a as PageQuery, c as QuestEnrollmentInput, Q as QuestClaimInput, g as QuestOutcomeQuery, V as questExperienceSchema, o as RewardDeliveryAction, B as contentQualificationQuerySchema } from './pages-CixTNnF4.js';
3
- import { M as MissingPrerequisite, V as ValueEvidence, a as AuthProvider } from './submission-input-CLefHTrj.js';
1
+ import { aZ as referralAcceptSchema, g as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, m as PointHistoryQuery, k as PointEntryKind, a6 as engagementPageQuerySchema } from './groups-BK8ts2yK.js';
2
+ import { j as QuestView, k as ResponseSchema, a as PageQuery, c as QuestEnrollmentInput, Q as QuestClaimInput, g as QuestOutcomeQuery, Y as questExperienceSchema, l as RewardDeliveryAction, E as contentQualificationQuerySchema } from './pages-D00JDZB-.js';
3
+ import { M as MissingPrerequisite, V as ValueEvidence, a as AuthProvider } from './submission-input-BbBJTVlT.js';
4
4
  import { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind } from './request-error-D_dUPLwo.js';
5
- import { f as QuizEvidence, A as Attempt, M as MemberProgress, a as AttemptStatus, h as TrackerSkipCode, bW as submitSchema, aW as contentPerformanceQuerySchema } from './schema-CQydLqw4.js';
5
+ import { f as QuizEvidence, A as Attempt, M as MemberProgress, a as AttemptStatus, h as TrackerSkipCode, c6 as submitSchema, b8 as contentPerformanceQuerySchema } from './schema-DEM8y8Fm.js';
6
6
  import { b as ParticipantSession, d as exchangeSchema, R as RelayEvent, P as ParticipantActivity } from './participant-activity-DkL3nY5a.js';
7
7
  import { z } from 'zod';
8
- import { F as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-D2aFcOxu.js';
9
- import { y as walletAddressInputSchema, I as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-YssWxGg8.js';
8
+ import { c as createRelayAction, O as OptionalActionId } from './action-9Xl0StBg.js';
9
+ import { F as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-BHMVj0kM.js';
10
+ import { y as walletAddressInputSchema, I as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-CDyo-U4n.js';
10
11
 
11
12
  /** What happened, as in every Domino client error (see `RequestError`). */
12
13
  type RelayErrorKind = RequestErrorKind;
@@ -266,8 +267,25 @@ type RelayClientOptions = {
266
267
  */
267
268
  timeout?: number;
268
269
  };
270
+ /** @compat input */
271
+ type RelayResponseOptions = RelayRequestOptions & {
272
+ method?: "GET" | "POST";
273
+ input?: unknown;
274
+ /** Persist this identity before sending a write. */
275
+ operationId?: string;
276
+ /** Use only when the route records a receipt for the supplied operation identity. */
277
+ replaySafe?: boolean;
278
+ };
269
279
  declare function createRelayClient(options: RelayClientOptions): RelayClient;
270
280
  declare function relayClient(options: RelayClientOptions): {
281
+ /** Owns one action key across uncertain writes. Reuse the helper until a definite answer. */
282
+ action: typeof createRelayAction;
283
+ /** A JSON call using an explicit tolerant response schema from `@domino-sdk/relay/schema`. */
284
+ response: <T>(path: string, schema: ResponseSchema<T>, call?: RelayResponseOptions) => Promise<{
285
+ status: number;
286
+ operationId: string | undefined;
287
+ result: Awaited<T>;
288
+ }>;
271
289
  offers: {
272
290
  /** Offers available to this participant, including stock and per-member availability. */
273
291
  list: (requestOptions?: RelayRequestOptions) => Promise<{
@@ -631,7 +649,7 @@ declare function relayClient(options: RelayClientOptions): {
631
649
  }[];
632
650
  nextCursor: string | null;
633
651
  }>;
634
- accept: (value: z.input<typeof referralAcceptSchema>, requestOptions?: RelayRequestOptions) => Promise<{
652
+ accept: (value: OptionalActionId<z.input<typeof referralAcceptSchema>>, requestOptions?: RelayRequestOptions) => Promise<{
635
653
  ok: true;
636
654
  }>;
637
655
  };
@@ -1060,7 +1078,7 @@ declare function relayClient(options: RelayClientOptions): {
1060
1078
  period: "day" | "week" | "month";
1061
1079
  };
1062
1080
  };
1063
- access: "participants" | "public";
1081
+ access: "public" | "participants";
1064
1082
  key?: string | undefined;
1065
1083
  group?: string | undefined;
1066
1084
  settle?: {
@@ -1224,7 +1242,7 @@ declare function relayClient(options: RelayClientOptions): {
1224
1242
  avatarProvider: "discord" | "google" | "x" | null;
1225
1243
  hidden: boolean;
1226
1244
  locked: boolean;
1227
- visibility: "private" | "participants" | "public";
1245
+ visibility: "public" | "private" | "participants";
1228
1246
  options: {
1229
1247
  provider: "discord" | "google" | "x";
1230
1248
  name: string | null;
@@ -1235,7 +1253,9 @@ declare function relayClient(options: RelayClientOptions): {
1235
1253
  * Changes the member's own name, avatar choice or visibility; omitted fields stay, and null
1236
1254
  * returns to the default.
1237
1255
  */
1238
- update: (value: z.input<typeof profileUpdateSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1256
+ update: (value: z.input<typeof profileUpdateSchema> & {
1257
+ actionId?: string;
1258
+ }, requestOptions?: RelayRequestOptions) => Promise<{
1239
1259
  id: string;
1240
1260
  name: string;
1241
1261
  avatar: {
@@ -1256,7 +1276,7 @@ declare function relayClient(options: RelayClientOptions): {
1256
1276
  avatarProvider: "discord" | "google" | "x" | null;
1257
1277
  hidden: boolean;
1258
1278
  locked: boolean;
1259
- visibility: "private" | "participants" | "public";
1279
+ visibility: "public" | "private" | "participants";
1260
1280
  options: {
1261
1281
  provider: "discord" | "google" | "x";
1262
1282
  name: string | null;
@@ -1269,6 +1289,7 @@ declare function relayClient(options: RelayClientOptions): {
1269
1289
  * `uploadId` and file stores no second picture, but only before another upload replaces it.
1270
1290
  */
1271
1291
  uploadAvatar: (file: Blob, requestOptions?: RelayRequestOptions & {
1292
+ actionId?: string;
1272
1293
  uploadId?: string;
1273
1294
  }) => Promise<{
1274
1295
  id: string;
@@ -1291,7 +1312,7 @@ declare function relayClient(options: RelayClientOptions): {
1291
1312
  avatarProvider: "discord" | "google" | "x" | null;
1292
1313
  hidden: boolean;
1293
1314
  locked: boolean;
1294
- visibility: "private" | "participants" | "public";
1315
+ visibility: "public" | "private" | "participants";
1295
1316
  options: {
1296
1317
  provider: "discord" | "google" | "x";
1297
1318
  name: string | null;
@@ -1439,14 +1460,14 @@ declare function relayClient(options: RelayClientOptions): {
1439
1460
  equals: string | number | boolean;
1440
1461
  })[] | undefined;
1441
1462
  enrollment?: "none" | "required" | undefined;
1442
- since?: "activation" | "window" | "enrollment" | undefined;
1463
+ since?: "window" | "activation" | "enrollment" | undefined;
1443
1464
  historical?: "staff" | "claim" | "automatic" | undefined;
1444
1465
  content?: true | undefined;
1445
1466
  } | undefined;
1446
1467
  };
1447
1468
  availability: {
1448
1469
  kind: "available";
1449
- input: "text" | "none" | "url" | "quiz" | "photo";
1470
+ input: "url" | "text" | "none" | "quiz" | "photo";
1450
1471
  } | {
1451
1472
  kind: "completed";
1452
1473
  } | {
@@ -1476,7 +1497,7 @@ declare function relayClient(options: RelayClientOptions): {
1476
1497
  })[];
1477
1498
  } | {
1478
1499
  kind: "blocked";
1479
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
1500
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
1480
1501
  window?: "quest" | "tracker" | undefined;
1481
1502
  resetsAt?: number | undefined;
1482
1503
  } | {
@@ -1639,7 +1660,7 @@ declare function relayClient(options: RelayClientOptions): {
1639
1660
  } | undefined;
1640
1661
  } | null;
1641
1662
  release: string;
1642
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
1663
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
1643
1664
  lifecycle: "paused" | "active" | "archived";
1644
1665
  rewards: ({
1645
1666
  kind: "points";
@@ -1734,7 +1755,7 @@ declare function relayClient(options: RelayClientOptions): {
1734
1755
  * counts from then on; earlier activity is historical, or skipped with `before-enrollment`
1735
1756
  * on a quest that counts from enrollment. Enrolling again returns the first enrollment.
1736
1757
  */
1737
- enroll: (value: QuestEnrollmentInput, requestOptions?: RelayRequestOptions) => Promise<{
1758
+ enroll: (value: OptionalActionId<QuestEnrollmentInput>, requestOptions?: RelayRequestOptions) => Promise<{
1738
1759
  quest: string;
1739
1760
  member: string;
1740
1761
  enrolledAt: number;
@@ -1745,7 +1766,7 @@ declare function relayClient(options: RelayClientOptions): {
1745
1766
  * historical activity released and returns the outcome; a rule that still fails rejects
1746
1767
  * with a `RelayError` whose code is that rule's skip code.
1747
1768
  */
1748
- claim: (value: QuestClaimInput, requestOptions?: RelayRequestOptions) => Promise<{
1769
+ claim: (value: OptionalActionId<QuestClaimInput>, requestOptions?: RelayRequestOptions) => Promise<{
1749
1770
  quest: string;
1750
1771
  tracker: string | null;
1751
1772
  record: string | null;
@@ -2092,14 +2113,14 @@ declare function relayClient(options: RelayClientOptions): {
2092
2113
  equals: string | number | boolean;
2093
2114
  })[] | undefined;
2094
2115
  enrollment?: "none" | "required" | undefined;
2095
- since?: "activation" | "window" | "enrollment" | undefined;
2116
+ since?: "window" | "activation" | "enrollment" | undefined;
2096
2117
  historical?: "staff" | "claim" | "automatic" | undefined;
2097
2118
  content?: true | undefined;
2098
2119
  } | undefined;
2099
2120
  };
2100
2121
  availability: {
2101
2122
  kind: "available";
2102
- input: "text" | "none" | "url" | "quiz" | "photo";
2123
+ input: "url" | "text" | "none" | "quiz" | "photo";
2103
2124
  } | {
2104
2125
  kind: "completed";
2105
2126
  } | {
@@ -2129,7 +2150,7 @@ declare function relayClient(options: RelayClientOptions): {
2129
2150
  })[];
2130
2151
  } | {
2131
2152
  kind: "blocked";
2132
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2153
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
2133
2154
  window?: "quest" | "tracker" | undefined;
2134
2155
  resetsAt?: number | undefined;
2135
2156
  } | {
@@ -2292,7 +2313,7 @@ declare function relayClient(options: RelayClientOptions): {
2292
2313
  } | undefined;
2293
2314
  } | null;
2294
2315
  release: string;
2295
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
2316
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
2296
2317
  lifecycle: "paused" | "active" | "archived";
2297
2318
  rewards: ({
2298
2319
  kind: "points";
@@ -2473,14 +2494,14 @@ declare function relayClient(options: RelayClientOptions): {
2473
2494
  equals: string | number | boolean;
2474
2495
  })[] | undefined;
2475
2496
  enrollment?: "none" | "required" | undefined;
2476
- since?: "activation" | "window" | "enrollment" | undefined;
2497
+ since?: "window" | "activation" | "enrollment" | undefined;
2477
2498
  historical?: "staff" | "claim" | "automatic" | undefined;
2478
2499
  content?: true | undefined;
2479
2500
  } | undefined;
2480
2501
  };
2481
2502
  availability: {
2482
2503
  kind: "available";
2483
- input: "text" | "none" | "url" | "quiz" | "photo";
2504
+ input: "url" | "text" | "none" | "quiz" | "photo";
2484
2505
  } | {
2485
2506
  kind: "completed";
2486
2507
  } | {
@@ -2510,7 +2531,7 @@ declare function relayClient(options: RelayClientOptions): {
2510
2531
  })[];
2511
2532
  } | {
2512
2533
  kind: "blocked";
2513
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2534
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
2514
2535
  window?: "quest" | "tracker" | undefined;
2515
2536
  resetsAt?: number | undefined;
2516
2537
  } | {
@@ -2673,7 +2694,7 @@ declare function relayClient(options: RelayClientOptions): {
2673
2694
  } | undefined;
2674
2695
  } | null;
2675
2696
  release: string;
2676
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
2697
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
2677
2698
  lifecycle: "paused" | "active" | "archived";
2678
2699
  rewards: ({
2679
2700
  kind: "points";
@@ -2857,14 +2878,14 @@ declare function relayClient(options: RelayClientOptions): {
2857
2878
  equals: string | number | boolean;
2858
2879
  })[] | undefined;
2859
2880
  enrollment?: "none" | "required" | undefined;
2860
- since?: "activation" | "window" | "enrollment" | undefined;
2881
+ since?: "window" | "activation" | "enrollment" | undefined;
2861
2882
  historical?: "staff" | "claim" | "automatic" | undefined;
2862
2883
  content?: true | undefined;
2863
2884
  } | undefined;
2864
2885
  };
2865
2886
  availability: {
2866
2887
  kind: "available";
2867
- input: "text" | "none" | "url" | "quiz" | "photo";
2888
+ input: "url" | "text" | "none" | "quiz" | "photo";
2868
2889
  } | {
2869
2890
  kind: "completed";
2870
2891
  } | {
@@ -2894,7 +2915,7 @@ declare function relayClient(options: RelayClientOptions): {
2894
2915
  })[];
2895
2916
  } | {
2896
2917
  kind: "blocked";
2897
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2918
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
2898
2919
  window?: "quest" | "tracker" | undefined;
2899
2920
  resetsAt?: number | undefined;
2900
2921
  } | {
@@ -3057,7 +3078,7 @@ declare function relayClient(options: RelayClientOptions): {
3057
3078
  } | undefined;
3058
3079
  } | null;
3059
3080
  release: string;
3060
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
3081
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
3061
3082
  lifecycle: "paused" | "active" | "archived";
3062
3083
  rewards: ({
3063
3084
  kind: "points";
@@ -3157,7 +3178,7 @@ declare function relayClient(options: RelayClientOptions): {
3157
3178
  };
3158
3179
  campaigns: {
3159
3180
  /** Enrolls the signed-in member once in every quest of a campaign that requires it. */
3160
- enroll: (value: CampaignEnrollmentInput, requestOptions?: RelayRequestOptions) => Promise<{
3181
+ enroll: (value: OptionalActionId<CampaignEnrollmentInput>, requestOptions?: RelayRequestOptions) => Promise<{
3161
3182
  campaign: string;
3162
3183
  member: string;
3163
3184
  enrolledAt: number;
@@ -3165,7 +3186,7 @@ declare function relayClient(options: RelayClientOptions): {
3165
3186
  withdrawalReason: string | null;
3166
3187
  }>;
3167
3188
  /** Pauses the signed-in member's campaign enrollment without erasing its history. */
3168
- withdraw: (value: CampaignWithdrawalInput, requestOptions?: RelayRequestOptions) => Promise<{
3189
+ withdraw: (value: OptionalActionId<CampaignWithdrawalInput>, requestOptions?: RelayRequestOptions) => Promise<{
3169
3190
  campaign: string;
3170
3191
  member: string;
3171
3192
  enrolledAt: number;
@@ -3468,10 +3489,7 @@ declare function relayClient(options: RelayClientOptions): {
3468
3489
  }): Promise<QuizSubmission>;
3469
3490
  (quest: string, options: {
3470
3491
  input: "none";
3471
- release? /**
3472
- * Cancels the call, which rejects with a `RelayError` of kind `aborted`. Cancelling stops any
3473
- * retry; a write already sent stays `uncertain`, since Relay may have applied it.
3474
- */: string;
3492
+ release?: string;
3475
3493
  recoverPrevious?: boolean;
3476
3494
  repeatable?: boolean;
3477
3495
  }): Promise<ClaimSubmission>;
@@ -3577,14 +3595,14 @@ declare function relayClient(options: RelayClientOptions): {
3577
3595
  equals: string | number | boolean;
3578
3596
  })[] | undefined;
3579
3597
  enrollment?: "none" | "required" | undefined;
3580
- since?: "activation" | "window" | "enrollment" | undefined;
3598
+ since?: "window" | "activation" | "enrollment" | undefined;
3581
3599
  historical?: "staff" | "claim" | "automatic" | undefined;
3582
3600
  content?: true | undefined;
3583
3601
  } | undefined;
3584
3602
  };
3585
3603
  availability: {
3586
3604
  kind: "available";
3587
- input: "text" | "none" | "url" | "quiz" | "photo";
3605
+ input: "url" | "text" | "none" | "quiz" | "photo";
3588
3606
  } | {
3589
3607
  kind: "completed";
3590
3608
  } | {
@@ -3614,7 +3632,7 @@ declare function relayClient(options: RelayClientOptions): {
3614
3632
  })[];
3615
3633
  } | {
3616
3634
  kind: "blocked";
3617
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
3635
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
3618
3636
  window?: "quest" | "tracker" | undefined;
3619
3637
  resetsAt?: number | undefined;
3620
3638
  } | {
@@ -4075,7 +4093,7 @@ declare function relayClient(options: RelayClientOptions): {
4075
4093
  nextCursor: string | null;
4076
4094
  }>;
4077
4095
  /** Claims a quest for the signed-in member. Quest controllers (`quests.open`) call this. */
4078
- claim: (value: Omit<z.input<typeof submitSchema>, "member">, requestOptions?: RelayRequestOptions) => Promise<{
4096
+ claim: (value: OptionalActionId<Omit<z.input<typeof submitSchema>, "member">>, requestOptions?: RelayRequestOptions) => Promise<{
4079
4097
  id: string;
4080
4098
  release: string;
4081
4099
  quest: string;
@@ -4141,8 +4159,11 @@ declare function relayClient(options: RelayClientOptions): {
4141
4159
  release?: string | undefined;
4142
4160
  } | undefined;
4143
4161
  }>;
4144
- /** Uploads a photo as the signed-in member's evidence. */
4145
- upload: (file: Blob, requestOptions?: RelayRequestOptions) => Promise<{
4162
+ /** Uploads evidence with a generated key; reuse `actionId` and the same file to replay. */
4163
+ upload: (file: Blob, requestOptions?: RelayRequestOptions & {
4164
+ actionId?: string;
4165
+ uploadId?: string;
4166
+ }) => Promise<{
4146
4167
  id: string;
4147
4168
  member: string;
4148
4169
  type: "image/jpeg" | "image/png";
@@ -4317,4 +4338,4 @@ declare function relayClient(options: RelayClientOptions): {
4317
4338
  interface RelayClient extends ReturnType<typeof relayClient> {
4318
4339
  }
4319
4340
 
4320
- 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, type SubmissionStatus as l, type SubmissionStore as m, createRelayClient as n, isRelayError as o };
4341
+ 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, type RelayResponseOptions as l, type SubmissionStatus as m, type SubmissionStore as n, createRelayClient as o, isRelayError as p };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { cV as ResourceHandle, cY as GroupHandle } from './schema-CQydLqw4.js';
2
+ import { n as ResourceHandle, G as GroupHandle } from './schema-DEM8y8Fm.js';
3
3
 
4
4
  declare const pointLedgerPropertiesSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -755,8 +755,96 @@ declare const leaderboardDefinitionSchema: z.ZodObject<{
755
755
  }, z.core.$strip>], "kind">>;
756
756
  }, z.core.$strict>], "kind">>;
757
757
  access: z.ZodDefault<z.ZodEnum<{
758
+ public: "public";
758
759
  participants: "participants";
760
+ }>>;
761
+ group: z.ZodOptional<z.ZodString>;
762
+ settle: z.ZodOptional<z.ZodObject<{
763
+ at: z.ZodLiteral<"window-end">;
764
+ ties: z.ZodEnum<{
765
+ shared: "shared";
766
+ earliest: "earliest";
767
+ }>;
768
+ prizes: z.ZodArray<z.ZodObject<{
769
+ ranks: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
770
+ rewards: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
771
+ kind: z.ZodDefault<z.ZodLiteral<"points">>;
772
+ balance: z.ZodString;
773
+ amount: z.ZodNumber;
774
+ }, z.core.$strict>, z.ZodObject<{
775
+ kind: z.ZodLiteral<"tier">;
776
+ reward: z.ZodObject<{
777
+ id: z.ZodString;
778
+ title: z.ZodString;
779
+ tiers: z.ZodArray<z.ZodObject<{
780
+ id: z.ZodString;
781
+ title: z.ZodString;
782
+ }, z.core.$strict>>;
783
+ inventory: z.ZodObject<{
784
+ kind: z.ZodLiteral<"untracked">;
785
+ }, z.core.$strict>;
786
+ fulfillment: z.ZodDiscriminatedUnion<[z.ZodObject<{
787
+ kind: z.ZodLiteral<"staff-handover">;
788
+ }, z.core.$strict>, z.ZodObject<{
789
+ kind: z.ZodLiteral<"automatic">;
790
+ }, z.core.$strict>], "kind">;
791
+ }, z.core.$strict>;
792
+ tier: z.ZodString;
793
+ }, z.core.$strict>]>>;
794
+ }, z.core.$strict>>;
795
+ }, z.core.$strict>>;
796
+ }, z.core.$strict>;
797
+ /** Known leaderboard data is read separately from its strict authoring definition. */
798
+ declare const leaderboardDefinitionResponseSchema: z.ZodObject<{
799
+ id: z.ZodString;
800
+ key: z.ZodOptional<z.ZodString>;
801
+ title: z.ZodString;
802
+ balance: z.ZodString;
803
+ score: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
804
+ kind: z.ZodLiteral<"balance">;
805
+ }, z.core.$strict>, z.ZodObject<{
806
+ window: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
807
+ kind: z.ZodLiteral<"all-time">;
808
+ }, z.core.$strict>, z.ZodObject<{
809
+ kind: z.ZodLiteral<"fixed">;
810
+ start: z.ZodNumber;
811
+ end: z.ZodNumber;
812
+ }, z.core.$strict>, z.ZodObject<{
813
+ kind: z.ZodLiteral<"rolling">;
814
+ days: z.ZodNumber;
815
+ }, z.core.$strict>, z.ZodObject<{
816
+ kind: z.ZodLiteral<"calendar">;
817
+ period: z.ZodEnum<{
818
+ day: "day";
819
+ week: "week";
820
+ month: "month";
821
+ }>;
822
+ }, z.core.$strip>], "kind">>;
823
+ quests: z.ZodOptional<z.ZodArray<z.ZodString>>;
824
+ kind: z.ZodLiteral<"earned">;
825
+ }, z.core.$strict>, z.ZodObject<{
826
+ kind: z.ZodLiteral<"net">;
827
+ window: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
828
+ kind: z.ZodLiteral<"all-time">;
829
+ }, z.core.$strict>, z.ZodObject<{
830
+ kind: z.ZodLiteral<"fixed">;
831
+ start: z.ZodNumber;
832
+ end: z.ZodNumber;
833
+ }, z.core.$strict>, z.ZodObject<{
834
+ kind: z.ZodLiteral<"rolling">;
835
+ days: z.ZodNumber;
836
+ }, z.core.$strict>, z.ZodObject<{
837
+ kind: z.ZodLiteral<"calendar">;
838
+ period: z.ZodEnum<{
839
+ day: "day";
840
+ week: "week";
841
+ month: "month";
842
+ }>;
843
+ }, z.core.$strip>], "kind">>;
844
+ }, z.core.$strict>], "kind">>;
845
+ access: z.ZodDefault<z.ZodEnum<{
759
846
  public: "public";
847
+ participants: "participants";
760
848
  }>>;
761
849
  group: z.ZodOptional<z.ZodString>;
762
850
  settle: z.ZodOptional<z.ZodObject<{
@@ -799,8 +887,8 @@ declare const leaderboardAuthoringSchema: z.ZodObject<{
799
887
  title: z.ZodString;
800
888
  balance: z.ZodString;
801
889
  access: z.ZodDefault<z.ZodEnum<{
802
- participants: "participants";
803
890
  public: "public";
891
+ participants: "participants";
804
892
  }>>;
805
893
  settle: z.ZodOptional<z.ZodObject<{
806
894
  at: z.ZodLiteral<"window-end">;
@@ -885,8 +973,8 @@ declare const leaderboardArtifactSchema: z.ZodUnion<readonly [z.ZodObject<{
885
973
  title: z.ZodString;
886
974
  balance: z.ZodString;
887
975
  access: z.ZodDefault<z.ZodEnum<{
888
- participants: "participants";
889
976
  public: "public";
977
+ participants: "participants";
890
978
  }>>;
891
979
  settle: z.ZodOptional<z.ZodObject<{
892
980
  at: z.ZodLiteral<"window-end">;
@@ -1020,8 +1108,8 @@ declare const publishedLeaderboardSchema: z.ZodObject<{
1020
1108
  }, z.core.$strip>], "kind">>;
1021
1109
  }, z.core.$strict>], "kind">>;
1022
1110
  access: z.ZodDefault<z.ZodEnum<{
1023
- participants: "participants";
1024
1111
  public: "public";
1112
+ participants: "participants";
1025
1113
  }>>;
1026
1114
  group: z.ZodOptional<z.ZodString>;
1027
1115
  settle: z.ZodOptional<z.ZodObject<{
@@ -1264,8 +1352,8 @@ declare const leaderboardPreviewSchema: z.ZodObject<{
1264
1352
  }, z.core.$strip>], "kind">>;
1265
1353
  }, z.core.$strict>], "kind">>;
1266
1354
  access: z.ZodDefault<z.ZodEnum<{
1267
- participants: "participants";
1268
1355
  public: "public";
1356
+ participants: "participants";
1269
1357
  }>>;
1270
1358
  group: z.ZodOptional<z.ZodString>;
1271
1359
  settle: z.ZodOptional<z.ZodObject<{
@@ -2618,4 +2706,4 @@ declare const groupMemberPageSchema: z.ZodObject<{
2618
2706
  /** @compat output */
2619
2707
  type GroupMemberPage = z.infer<typeof groupMemberPageSchema>;
2620
2708
 
2621
- export { engagementChangeSchema as $, type AvailabilityWindow as A, type ManagedPointLedger as B, type CampaignDefinition as C, type PointLedger as D, type EngagementBudget as E, addGroupMemberSchema as F, type GroupMember as G, availabilityWindowSchema as H, campaignDefinitionSchema as I, campaignEnrollmentInputSchema as J, type KnownPointEntryKind as K, type LeaderboardDefinition as L, type MemberCampaignEnrollmentInput as M, campaignEnrollmentSchema as N, campaignViewSchema as O, type PointBalance as P, campaignWithdrawalInputSchema as Q, type ReferralDefinition as R, createGroupSchema as S, createPointLedgerSchema as T, defineCampaign as U, defineGroup as V, engagementArtifactSchema as W, engagementBoundaryPageSchema as X, engagementBudgetSchema as Y, engagementChangePreviewInputSchema as Z, engagementChangePreviewSchema as _, type CampaignEnrollment as a, referralDefinitionSchema as a$, engagementDefinitionSchema as a0, engagementDeploymentEntrySchema as a1, engagementPageQuerySchema as a2, engagementPageSchema as a3, engagementPublishSchema as a4, engagementRuleSchema as a5, engagementRuleVersionPageSchema as a6, engagementScoreInputSchema as a7, engagementScoreSchema as a8, engagementSettlementSchema as a9, managedPointHistoryPageSchema as aA, managedPointLedgerSchema as aB, memberCampaignEnrollmentInputSchema as aC, memberCampaignWithdrawalInputSchema as aD, pointBalanceSchema as aE, pointBalancesSchema as aF, pointEntrySchema as aG, pointHistoryPageSchema as aH, pointHistoryQuerySchema as aI, pointLedgerArtifactSchema as aJ, pointLedgerDeclarationSchema as aK, pointLedgerPropertiesSchema as aL, pointLedgerReferenceSchema as aM, pointLedgerSchema as aN, pointsAccountSchema as aO, pointsEntrySchema as aP, pointsMutationSchema as aQ, pointsResultSchema as aR, projectGroupKey as aS, projectGroupSchema as aT, publishedLeaderboardSchema as aU, publishedReferralSchema as aV, referralAcceptSchema as aW, referralAccountSchema as aX, referralArtifactSchema as aY, referralAuthoringSchema as aZ, referralControlSchema as a_, engagementVersionPageSchema as aa, engagementVersionQuerySchema as ab, groupMemberPageSchema as ac, groupMemberSchema as ad, groupPageQuerySchema as ae, groupPageSchema as af, leaderboardArtifactSchema as ag, leaderboardAuthoringSchema as ah, leaderboardDefinitionSchema as ai, leaderboardExclusionSchema as aj, leaderboardGroupSchema as ak, leaderboardPageSchema as al, leaderboardPlacementSchema as am, leaderboardPreviewSchema as an, leaderboardPrizeRewardSchema as ao, leaderboardPrizeSchema as ap, leaderboardQuerySchema as aq, leaderboardRowSchema as ar, leaderboardSettlementApprovalSchema as as, leaderboardSettlementPolicySchema as at, leaderboardSettlementRowSchema as au, leaderboardSettlementSchema as av, leaderboardSettlementStatusSchema as aw, leaderboardSettlementSummarySchema as ax, leaderboardWindowSchema as ay, managedGroupSchema as az, type CampaignEnrollmentInput as b, referralHistorySchema as b0, referralManagementSchema as b1, referralQualificationSchema as b2, referralRelationshipSchema as b3, referralRewardResolutionSchema as b4, referralSummarySchema as b5, referralSuspensionSchema as b6, removeGroupMemberSchema as b7, updateGroupSchema as b8, type AuthoringIdentity as b9, type CampaignView as c, type CampaignWithdrawalInput as d, type LeaderboardPage as e, type LeaderboardPlacement as f, type LeaderboardQuery as g, type MemberCampaignWithdrawalInput as h, type PointBalances as i, type PointEntry as j, PointEntryKind as k, type PointHistoryPage as l, type PointHistoryQuery as m, type PointLedgerReference as n, type ProjectGroup as o, type ProjectGroupReference as p, type EngagementDefinition as q, type EngagementRuleVersionPage as r, type GroupMemberPage as s, type GroupPage as t, type GroupPageQuery as u, type LeaderboardSettlement as v, type LeaderboardSettlementPolicy as w, type LeaderboardSettlementSummary as x, type ManagedGroup as y, type ManagedPointHistoryPage as z };
2709
+ export { engagementBoundaryPageSchema as $, type AvailabilityWindow as A, type GroupPageQuery as B, type CampaignDefinition as C, type LeaderboardSettlement as D, type EngagementBudget as E, type LeaderboardSettlementPolicy as F, type GroupMember as G, type LeaderboardSettlementSummary as H, type ManagedGroup as I, type ManagedPointHistoryPage as J, type KnownPointEntryKind as K, type LeaderboardDefinition as L, type MemberCampaignEnrollmentInput as M, type ManagedPointLedger as N, type PointLedger as O, type PointBalance as P, addGroupMemberSchema as Q, type ReferralDefinition as R, availabilityWindowSchema as S, campaignDefinitionSchema as T, campaignEnrollmentInputSchema as U, campaignEnrollmentSchema as V, campaignViewSchema as W, campaignWithdrawalInputSchema as X, createGroupSchema as Y, createPointLedgerSchema as Z, engagementArtifactSchema as _, type CampaignEnrollment as a, referralArtifactSchema as a$, engagementBudgetSchema as a0, engagementChangePreviewInputSchema as a1, engagementChangePreviewSchema as a2, engagementChangeSchema as a3, engagementDefinitionSchema as a4, engagementDeploymentEntrySchema as a5, engagementPageQuerySchema as a6, engagementPageSchema as a7, engagementPublishSchema as a8, engagementRuleSchema as a9, leaderboardSettlementStatusSchema as aA, leaderboardSettlementSummarySchema as aB, leaderboardWindowSchema as aC, managedGroupSchema as aD, managedPointHistoryPageSchema as aE, managedPointLedgerSchema as aF, memberCampaignEnrollmentInputSchema as aG, memberCampaignWithdrawalInputSchema as aH, pointBalanceSchema as aI, pointBalancesSchema as aJ, pointEntrySchema as aK, pointHistoryPageSchema as aL, pointHistoryQuerySchema as aM, pointLedgerArtifactSchema as aN, pointLedgerPropertiesSchema as aO, pointLedgerReferenceSchema as aP, pointLedgerSchema as aQ, pointsAccountSchema as aR, pointsEntrySchema as aS, pointsMutationSchema as aT, pointsResultSchema as aU, projectGroupKey as aV, projectGroupSchema as aW, publishedLeaderboardSchema as aX, publishedReferralSchema as aY, referralAcceptSchema as aZ, referralAccountSchema as a_, engagementRuleVersionPageSchema as aa, engagementScoreInputSchema as ab, engagementScoreSchema as ac, engagementSettlementSchema as ad, engagementVersionPageSchema as ae, engagementVersionQuerySchema as af, groupMemberPageSchema as ag, groupMemberSchema as ah, groupPageQuerySchema as ai, groupPageSchema as aj, leaderboardArtifactSchema as ak, leaderboardAuthoringSchema as al, leaderboardDefinitionResponseSchema as am, leaderboardExclusionSchema as an, leaderboardGroupSchema as ao, leaderboardPageSchema as ap, leaderboardPlacementSchema as aq, leaderboardPreviewSchema as ar, leaderboardPrizeRewardSchema as as, leaderboardPrizeSchema as at, leaderboardQuerySchema as au, leaderboardRowSchema as av, leaderboardSettlementApprovalSchema as aw, leaderboardSettlementPolicySchema as ax, leaderboardSettlementRowSchema as ay, leaderboardSettlementSchema as az, type CampaignEnrollmentInput as b, referralControlSchema as b0, referralDefinitionSchema as b1, referralHistorySchema as b2, referralManagementSchema as b3, referralQualificationSchema as b4, referralRelationshipSchema as b5, referralRewardResolutionSchema as b6, referralSummarySchema as b7, referralSuspensionSchema as b8, removeGroupMemberSchema as b9, updateGroupSchema as ba, type CampaignView as c, type CampaignWithdrawalInput as d, type LeaderboardPage as e, type LeaderboardPlacement as f, type LeaderboardQuery as g, type MemberCampaignWithdrawalInput as h, type PointBalances as i, type PointEntry as j, PointEntryKind as k, type PointHistoryPage as l, type PointHistoryQuery as m, type PointLedgerReference as n, type ProjectGroup as o, type ProjectGroupReference as p, type AuthoringIdentity as q, leaderboardDefinitionSchema as r, pointLedgerDeclarationSchema as s, referralAuthoringSchema as t, defineCampaign as u, defineGroup as v, type EngagementDefinition as w, type EngagementRuleVersionPage as x, type GroupMemberPage as y, type GroupPage as z };