@domino-sdk/relay 1.7.0 → 1.9.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 (32) hide show
  1. package/dist/action-9Xl0StBg.d.ts +33 -0
  2. package/dist/{activity-Br6vyYze.d.ts → activity-CCe1e_7a.d.ts} +115 -115
  3. package/dist/authoring.d.ts +45 -45
  4. package/dist/authoring.js +1 -1
  5. package/dist/{automatic-outcomes-C1Q9LrDb.d.ts → automatic-outcomes-Dyk0VTUs.d.ts} +1 -1
  6. package/dist/browser.d.ts +7 -6
  7. package/dist/browser.js +5 -4
  8. package/dist/{chunk-C25TDFHN.js → chunk-2N464DDE.js} +1 -1
  9. package/dist/{chunk-GMPPLZKH.js → chunk-2V74CHDL.js} +191 -191
  10. package/dist/{chunk-6RBF3UDA.js → chunk-734LYHWP.js} +2 -2
  11. package/dist/chunk-ETPL6AAJ.js +98 -0
  12. package/dist/{chunk-ZOUEEK5L.js → chunk-FWSSMSIA.js} +49 -21
  13. package/dist/{chunk-BFZHJA2B.js → chunk-L3QFIRGO.js} +2 -2
  14. package/dist/{client-pfml_XAa.d.ts → client-CbASImpi.d.ts} +42 -36
  15. package/dist/{groups-BpWEqaPn.d.ts → groups-Dvmd4CYk.d.ts} +1 -1
  16. package/dist/{images-BaKYd0fl.d.ts → images-Dekv3DYF.d.ts} +1 -1
  17. package/dist/index.d.ts +8 -7
  18. package/dist/index.js +7 -3
  19. package/dist/internal.d.ts +3 -3
  20. package/dist/{offers-CYtal8jO.d.ts → offers-BEGVSOTD.d.ts} +2 -2
  21. package/dist/{pages-CixTNnF4.d.ts → pages-HmS6eedC.d.ts} +38 -38
  22. package/dist/react/index.d.ts +197 -10
  23. package/dist/react/index.js +253 -111
  24. package/dist/{referral-reward-kinds-ClxAuCGx.d.ts → referral-reward-kinds-Flbb1D2q.d.ts} +2 -2
  25. package/dist/schema.d.ts +8 -8
  26. package/dist/schema.js +3 -3
  27. package/dist/server/index.d.ts +592 -46
  28. package/dist/server/index.js +166 -43
  29. package/dist/{sign-in-options-CtXUFV7E.d.ts → sign-in-options-z3wsfizk.d.ts} +2 -2
  30. package/dist/{submission-input-CLefHTrj.d.ts → submission-input-Bs14jIsu.d.ts} +2 -2
  31. package/package.json +1 -1
  32. package/dist/{schema-CQydLqw4.d.ts → schema-BCuiO7eD.d.ts} +15 -15
@@ -1,3 +1,7 @@
1
+ import {
2
+ createRelayAction,
3
+ withActionId
4
+ } from "./chunk-ETPL6AAJ.js";
1
5
  import {
2
6
  collectionPassSchema,
3
7
  participantActivityQuerySchema,
@@ -12,7 +16,7 @@ import {
12
16
  questOutcomeQuerySchema,
13
17
  questOutcomeSchema,
14
18
  rewardDeliveriesSchema
15
- } from "./chunk-C25TDFHN.js";
19
+ } from "./chunk-2N464DDE.js";
16
20
  import {
17
21
  AVATAR_UPLOAD_LIMIT,
18
22
  RelayError,
@@ -51,7 +55,7 @@ import {
51
55
  walletSignInNetworksSchema,
52
56
  walletSignatureSchema,
53
57
  walletUnlinkInputSchema
54
- } from "./chunk-GMPPLZKH.js";
58
+ } from "./chunk-2V74CHDL.js";
55
59
  import {
56
60
  PARTICIPANT_TIMEOUT,
57
61
  lifetime,
@@ -1070,6 +1074,8 @@ function relayClient(options) {
1070
1074
  const ok = z2.object({ ok: z2.literal(true) });
1071
1075
  const acknowledged = z2.object({ ok: z2.boolean() });
1072
1076
  return {
1077
+ /** Owns one action key across uncertain writes. Reuse the helper until a definite answer. */
1078
+ action: createRelayAction,
1073
1079
  offers: {
1074
1080
  /** Offers available to this participant, including stock and per-member availability. */
1075
1081
  list: (requestOptions) => request("/v1/offers", z2.array(offerSchema), {
@@ -1103,7 +1109,7 @@ function relayClient(options) {
1103
1109
  { options: requestOptions }
1104
1110
  ),
1105
1111
  accept: async (value, requestOptions) => {
1106
- const body2 = parseInput(referralAcceptSchema, value);
1112
+ const body2 = parseInput(referralAcceptSchema, withActionId(value));
1107
1113
  return request("/v1/referrals/accept", ok, {
1108
1114
  json: body2,
1109
1115
  options: requestOptions,
@@ -1174,10 +1180,15 @@ function relayClient(options) {
1174
1180
  * Changes the member's own name, avatar choice or visibility; omitted fields stay, and null
1175
1181
  * returns to the default.
1176
1182
  */
1177
- update: async (value, requestOptions) => request("/v1/me/profile", ownProfileSchema, {
1178
- json: parseInput(profileUpdateSchema, value),
1179
- options: requestOptions
1180
- }),
1183
+ update: async (value, requestOptions) => {
1184
+ const { actionId, ...profile } = value;
1185
+ return request("/v1/me/profile", ownProfileSchema, {
1186
+ json: parseInput(profileUpdateSchema, profile),
1187
+ options: requestOptions,
1188
+ operationId: parseInput(identifier, actionId ?? crypto.randomUUID()),
1189
+ replaySafe: false
1190
+ });
1191
+ },
1181
1192
  /**
1182
1193
  * Uploads a JPEG, PNG or WebP of at most 5 MB as the member's avatar. The server crops it to
1183
1194
  * a 512×512 WebP without metadata. The client never resends it: retrying with the same
@@ -1196,8 +1207,11 @@ function relayClient(options) {
1196
1207
  RelayErrorCode.InvalidInput
1197
1208
  );
1198
1209
  }
1199
- const { uploadId, ...rest } = requestOptions;
1200
- const operationId = parseInput(identifier, uploadId ?? crypto.randomUUID());
1210
+ const { actionId, uploadId, ...rest } = requestOptions;
1211
+ const operationId = parseInput(
1212
+ identifier,
1213
+ actionId ?? uploadId ?? crypto.randomUUID()
1214
+ );
1201
1215
  return request("/v1/me/profile/avatar", ownProfileSchema, {
1202
1216
  method: "POST",
1203
1217
  body: file,
@@ -1251,7 +1265,7 @@ function relayClient(options) {
1251
1265
  * on a quest that counts from enrollment. Enrolling again returns the first enrollment.
1252
1266
  */
1253
1267
  enroll: async (value, requestOptions) => {
1254
- const body2 = parseInput(questEnrollmentInputSchema, value);
1268
+ const body2 = parseInput(questEnrollmentInputSchema, withActionId(value));
1255
1269
  return request("/v1/quests/enrollments", questEnrollmentSchema, {
1256
1270
  json: body2,
1257
1271
  options: requestOptions,
@@ -1265,7 +1279,7 @@ function relayClient(options) {
1265
1279
  * with a `RelayError` whose code is that rule's skip code.
1266
1280
  */
1267
1281
  claim: async (value, requestOptions) => {
1268
- const body2 = parseInput(questClaimInputSchema, value);
1282
+ const body2 = parseInput(questClaimInputSchema, withActionId(value));
1269
1283
  return request("/v1/quests/claims", questOutcomeSchema, {
1270
1284
  json: body2,
1271
1285
  options: requestOptions,
@@ -1335,7 +1349,7 @@ function relayClient(options) {
1335
1349
  campaigns: {
1336
1350
  /** Enrolls the signed-in member once in every quest of a campaign that requires it. */
1337
1351
  enroll: async (value, requestOptions) => {
1338
- const body2 = parseInput(campaignEnrollmentInputSchema, value);
1352
+ const body2 = parseInput(campaignEnrollmentInputSchema, withActionId(value));
1339
1353
  return request("/v1/campaigns/enrollments", campaignEnrollmentSchema, {
1340
1354
  json: body2,
1341
1355
  options: requestOptions,
@@ -1344,7 +1358,7 @@ function relayClient(options) {
1344
1358
  },
1345
1359
  /** Pauses the signed-in member's campaign enrollment without erasing its history. */
1346
1360
  withdraw: async (value, requestOptions) => {
1347
- const body2 = parseInput(campaignWithdrawalInputSchema, value);
1361
+ const body2 = parseInput(campaignWithdrawalInputSchema, withActionId(value));
1348
1362
  return request(
1349
1363
  "/v1/campaigns/enrollments/withdraw",
1350
1364
  campaignEnrollmentSchema,
@@ -1624,20 +1638,34 @@ function relayClient(options) {
1624
1638
  },
1625
1639
  /** Claims a quest for the signed-in member. Quest controllers (`quests.open`) call this. */
1626
1640
  claim: async (value, requestOptions) => {
1627
- const claim = parseInput(submitSchema.omit({ member: true }), value);
1641
+ const claim = parseInput(
1642
+ submitSchema.omit({ member: true }),
1643
+ withActionId(value)
1644
+ );
1628
1645
  return request("/v1/me/attempts", attemptSchema, {
1629
1646
  json: claim,
1630
1647
  options: requestOptions,
1631
1648
  operationId: claim.actionId
1632
1649
  });
1633
1650
  },
1634
- /** Uploads a photo as the signed-in member's evidence. */
1635
- upload: (file, requestOptions) => request("/v1/me/evidence", evidenceSchema, {
1636
- method: "POST",
1637
- body: file,
1638
- headers: { "Content-Type": file.type },
1639
- options: requestOptions
1640
- })
1651
+ /** Uploads evidence with a generated key; reuse `actionId` and the same file to replay. */
1652
+ upload: (file, requestOptions = {}) => {
1653
+ const { actionId, uploadId, ...options2 } = requestOptions;
1654
+ const operationId = parseInput(
1655
+ identifier,
1656
+ actionId ?? uploadId ?? crypto.randomUUID()
1657
+ );
1658
+ return request("/v1/me/evidence", evidenceSchema, {
1659
+ method: "POST",
1660
+ body: file,
1661
+ headers: {
1662
+ "Content-Type": file.type,
1663
+ "X-Relay-Upload-ID": operationId
1664
+ },
1665
+ options: options2,
1666
+ operationId
1667
+ });
1668
+ }
1641
1669
  },
1642
1670
  evidence: {
1643
1671
  /**
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRelayClient
3
- } from "./chunk-ZOUEEK5L.js";
3
+ } from "./chunk-FWSSMSIA.js";
4
4
  import {
5
5
  RelayErrorCode,
6
6
  asRelayError,
7
7
  clientError,
8
8
  cosmosChain
9
- } from "./chunk-GMPPLZKH.js";
9
+ } from "./chunk-2V74CHDL.js";
10
10
 
11
11
  // src/base58.ts
12
12
  var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@@ -1,10 +1,11 @@
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 { aW as referralAcceptSchema, g as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, m as PointHistoryQuery, k as PointEntryKind, a2 as engagementPageQuerySchema } from './groups-Dvmd4CYk.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-HmS6eedC.js';
3
+ import { M as MissingPrerequisite, V as ValueEvidence, a as AuthProvider } from './submission-input-Bs14jIsu.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, bW as submitSchema, aW as contentPerformanceQuerySchema } from './schema-BCuiO7eD.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 { c as createRelayAction, O as OptionalActionId } from './action-9Xl0StBg.js';
8
9
  import { F as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-D2aFcOxu.js';
9
10
  import { y as walletAddressInputSchema, I as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-YssWxGg8.js';
10
11
 
@@ -268,6 +269,8 @@ type RelayClientOptions = {
268
269
  };
269
270
  declare function createRelayClient(options: RelayClientOptions): RelayClient;
270
271
  declare function relayClient(options: RelayClientOptions): {
272
+ /** Owns one action key across uncertain writes. Reuse the helper until a definite answer. */
273
+ action: typeof createRelayAction;
271
274
  offers: {
272
275
  /** Offers available to this participant, including stock and per-member availability. */
273
276
  list: (requestOptions?: RelayRequestOptions) => Promise<{
@@ -631,7 +634,7 @@ declare function relayClient(options: RelayClientOptions): {
631
634
  }[];
632
635
  nextCursor: string | null;
633
636
  }>;
634
- accept: (value: z.input<typeof referralAcceptSchema>, requestOptions?: RelayRequestOptions) => Promise<{
637
+ accept: (value: OptionalActionId<z.input<typeof referralAcceptSchema>>, requestOptions?: RelayRequestOptions) => Promise<{
635
638
  ok: true;
636
639
  }>;
637
640
  };
@@ -1235,7 +1238,9 @@ declare function relayClient(options: RelayClientOptions): {
1235
1238
  * Changes the member's own name, avatar choice or visibility; omitted fields stay, and null
1236
1239
  * returns to the default.
1237
1240
  */
1238
- update: (value: z.input<typeof profileUpdateSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1241
+ update: (value: z.input<typeof profileUpdateSchema> & {
1242
+ actionId?: string;
1243
+ }, requestOptions?: RelayRequestOptions) => Promise<{
1239
1244
  id: string;
1240
1245
  name: string;
1241
1246
  avatar: {
@@ -1269,6 +1274,7 @@ declare function relayClient(options: RelayClientOptions): {
1269
1274
  * `uploadId` and file stores no second picture, but only before another upload replaces it.
1270
1275
  */
1271
1276
  uploadAvatar: (file: Blob, requestOptions?: RelayRequestOptions & {
1277
+ actionId?: string;
1272
1278
  uploadId?: string;
1273
1279
  }) => Promise<{
1274
1280
  id: string;
@@ -1439,14 +1445,14 @@ declare function relayClient(options: RelayClientOptions): {
1439
1445
  equals: string | number | boolean;
1440
1446
  })[] | undefined;
1441
1447
  enrollment?: "none" | "required" | undefined;
1442
- since?: "activation" | "window" | "enrollment" | undefined;
1448
+ since?: "window" | "activation" | "enrollment" | undefined;
1443
1449
  historical?: "staff" | "claim" | "automatic" | undefined;
1444
1450
  content?: true | undefined;
1445
1451
  } | undefined;
1446
1452
  };
1447
1453
  availability: {
1448
1454
  kind: "available";
1449
- input: "text" | "none" | "url" | "quiz" | "photo";
1455
+ input: "url" | "text" | "none" | "quiz" | "photo";
1450
1456
  } | {
1451
1457
  kind: "completed";
1452
1458
  } | {
@@ -1476,7 +1482,7 @@ declare function relayClient(options: RelayClientOptions): {
1476
1482
  })[];
1477
1483
  } | {
1478
1484
  kind: "blocked";
1479
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
1485
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
1480
1486
  window?: "quest" | "tracker" | undefined;
1481
1487
  resetsAt?: number | undefined;
1482
1488
  } | {
@@ -1639,7 +1645,7 @@ declare function relayClient(options: RelayClientOptions): {
1639
1645
  } | undefined;
1640
1646
  } | null;
1641
1647
  release: string;
1642
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
1648
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
1643
1649
  lifecycle: "paused" | "active" | "archived";
1644
1650
  rewards: ({
1645
1651
  kind: "points";
@@ -1734,7 +1740,7 @@ declare function relayClient(options: RelayClientOptions): {
1734
1740
  * counts from then on; earlier activity is historical, or skipped with `before-enrollment`
1735
1741
  * on a quest that counts from enrollment. Enrolling again returns the first enrollment.
1736
1742
  */
1737
- enroll: (value: QuestEnrollmentInput, requestOptions?: RelayRequestOptions) => Promise<{
1743
+ enroll: (value: OptionalActionId<QuestEnrollmentInput>, requestOptions?: RelayRequestOptions) => Promise<{
1738
1744
  quest: string;
1739
1745
  member: string;
1740
1746
  enrolledAt: number;
@@ -1745,7 +1751,7 @@ declare function relayClient(options: RelayClientOptions): {
1745
1751
  * historical activity released and returns the outcome; a rule that still fails rejects
1746
1752
  * with a `RelayError` whose code is that rule's skip code.
1747
1753
  */
1748
- claim: (value: QuestClaimInput, requestOptions?: RelayRequestOptions) => Promise<{
1754
+ claim: (value: OptionalActionId<QuestClaimInput>, requestOptions?: RelayRequestOptions) => Promise<{
1749
1755
  quest: string;
1750
1756
  tracker: string | null;
1751
1757
  record: string | null;
@@ -2092,14 +2098,14 @@ declare function relayClient(options: RelayClientOptions): {
2092
2098
  equals: string | number | boolean;
2093
2099
  })[] | undefined;
2094
2100
  enrollment?: "none" | "required" | undefined;
2095
- since?: "activation" | "window" | "enrollment" | undefined;
2101
+ since?: "window" | "activation" | "enrollment" | undefined;
2096
2102
  historical?: "staff" | "claim" | "automatic" | undefined;
2097
2103
  content?: true | undefined;
2098
2104
  } | undefined;
2099
2105
  };
2100
2106
  availability: {
2101
2107
  kind: "available";
2102
- input: "text" | "none" | "url" | "quiz" | "photo";
2108
+ input: "url" | "text" | "none" | "quiz" | "photo";
2103
2109
  } | {
2104
2110
  kind: "completed";
2105
2111
  } | {
@@ -2129,7 +2135,7 @@ declare function relayClient(options: RelayClientOptions): {
2129
2135
  })[];
2130
2136
  } | {
2131
2137
  kind: "blocked";
2132
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2138
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
2133
2139
  window?: "quest" | "tracker" | undefined;
2134
2140
  resetsAt?: number | undefined;
2135
2141
  } | {
@@ -2292,7 +2298,7 @@ declare function relayClient(options: RelayClientOptions): {
2292
2298
  } | undefined;
2293
2299
  } | null;
2294
2300
  release: string;
2295
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
2301
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
2296
2302
  lifecycle: "paused" | "active" | "archived";
2297
2303
  rewards: ({
2298
2304
  kind: "points";
@@ -2473,14 +2479,14 @@ declare function relayClient(options: RelayClientOptions): {
2473
2479
  equals: string | number | boolean;
2474
2480
  })[] | undefined;
2475
2481
  enrollment?: "none" | "required" | undefined;
2476
- since?: "activation" | "window" | "enrollment" | undefined;
2482
+ since?: "window" | "activation" | "enrollment" | undefined;
2477
2483
  historical?: "staff" | "claim" | "automatic" | undefined;
2478
2484
  content?: true | undefined;
2479
2485
  } | undefined;
2480
2486
  };
2481
2487
  availability: {
2482
2488
  kind: "available";
2483
- input: "text" | "none" | "url" | "quiz" | "photo";
2489
+ input: "url" | "text" | "none" | "quiz" | "photo";
2484
2490
  } | {
2485
2491
  kind: "completed";
2486
2492
  } | {
@@ -2510,7 +2516,7 @@ declare function relayClient(options: RelayClientOptions): {
2510
2516
  })[];
2511
2517
  } | {
2512
2518
  kind: "blocked";
2513
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2519
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
2514
2520
  window?: "quest" | "tracker" | undefined;
2515
2521
  resetsAt?: number | undefined;
2516
2522
  } | {
@@ -2673,7 +2679,7 @@ declare function relayClient(options: RelayClientOptions): {
2673
2679
  } | undefined;
2674
2680
  } | null;
2675
2681
  release: string;
2676
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
2682
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
2677
2683
  lifecycle: "paused" | "active" | "archived";
2678
2684
  rewards: ({
2679
2685
  kind: "points";
@@ -2857,14 +2863,14 @@ declare function relayClient(options: RelayClientOptions): {
2857
2863
  equals: string | number | boolean;
2858
2864
  })[] | undefined;
2859
2865
  enrollment?: "none" | "required" | undefined;
2860
- since?: "activation" | "window" | "enrollment" | undefined;
2866
+ since?: "window" | "activation" | "enrollment" | undefined;
2861
2867
  historical?: "staff" | "claim" | "automatic" | undefined;
2862
2868
  content?: true | undefined;
2863
2869
  } | undefined;
2864
2870
  };
2865
2871
  availability: {
2866
2872
  kind: "available";
2867
- input: "text" | "none" | "url" | "quiz" | "photo";
2873
+ input: "url" | "text" | "none" | "quiz" | "photo";
2868
2874
  } | {
2869
2875
  kind: "completed";
2870
2876
  } | {
@@ -2894,7 +2900,7 @@ declare function relayClient(options: RelayClientOptions): {
2894
2900
  })[];
2895
2901
  } | {
2896
2902
  kind: "blocked";
2897
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2903
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
2898
2904
  window?: "quest" | "tracker" | undefined;
2899
2905
  resetsAt?: number | undefined;
2900
2906
  } | {
@@ -3057,7 +3063,7 @@ declare function relayClient(options: RelayClientOptions): {
3057
3063
  } | undefined;
3058
3064
  } | null;
3059
3065
  release: string;
3060
- interaction: "text" | "staff" | "claim" | "automatic" | "url" | "quiz" | "photo";
3066
+ interaction: "url" | "text" | "staff" | "claim" | "automatic" | "quiz" | "photo";
3061
3067
  lifecycle: "paused" | "active" | "archived";
3062
3068
  rewards: ({
3063
3069
  kind: "points";
@@ -3157,7 +3163,7 @@ declare function relayClient(options: RelayClientOptions): {
3157
3163
  };
3158
3164
  campaigns: {
3159
3165
  /** Enrolls the signed-in member once in every quest of a campaign that requires it. */
3160
- enroll: (value: CampaignEnrollmentInput, requestOptions?: RelayRequestOptions) => Promise<{
3166
+ enroll: (value: OptionalActionId<CampaignEnrollmentInput>, requestOptions?: RelayRequestOptions) => Promise<{
3161
3167
  campaign: string;
3162
3168
  member: string;
3163
3169
  enrolledAt: number;
@@ -3165,7 +3171,7 @@ declare function relayClient(options: RelayClientOptions): {
3165
3171
  withdrawalReason: string | null;
3166
3172
  }>;
3167
3173
  /** Pauses the signed-in member's campaign enrollment without erasing its history. */
3168
- withdraw: (value: CampaignWithdrawalInput, requestOptions?: RelayRequestOptions) => Promise<{
3174
+ withdraw: (value: OptionalActionId<CampaignWithdrawalInput>, requestOptions?: RelayRequestOptions) => Promise<{
3169
3175
  campaign: string;
3170
3176
  member: string;
3171
3177
  enrolledAt: number;
@@ -3468,10 +3474,7 @@ declare function relayClient(options: RelayClientOptions): {
3468
3474
  }): Promise<QuizSubmission>;
3469
3475
  (quest: string, options: {
3470
3476
  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;
3477
+ release?: string;
3475
3478
  recoverPrevious?: boolean;
3476
3479
  repeatable?: boolean;
3477
3480
  }): Promise<ClaimSubmission>;
@@ -3577,14 +3580,14 @@ declare function relayClient(options: RelayClientOptions): {
3577
3580
  equals: string | number | boolean;
3578
3581
  })[] | undefined;
3579
3582
  enrollment?: "none" | "required" | undefined;
3580
- since?: "activation" | "window" | "enrollment" | undefined;
3583
+ since?: "window" | "activation" | "enrollment" | undefined;
3581
3584
  historical?: "staff" | "claim" | "automatic" | undefined;
3582
3585
  content?: true | undefined;
3583
3586
  } | undefined;
3584
3587
  };
3585
3588
  availability: {
3586
3589
  kind: "available";
3587
- input: "text" | "none" | "url" | "quiz" | "photo";
3590
+ input: "url" | "text" | "none" | "quiz" | "photo";
3588
3591
  } | {
3589
3592
  kind: "completed";
3590
3593
  } | {
@@ -3614,7 +3617,7 @@ declare function relayClient(options: RelayClientOptions): {
3614
3617
  })[];
3615
3618
  } | {
3616
3619
  kind: "blocked";
3617
- reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
3620
+ reason: "outside-window" | "enrollment-required" | "budget-exhausted" | "paused" | "connection-required" | "wallet-required";
3618
3621
  window?: "quest" | "tracker" | undefined;
3619
3622
  resetsAt?: number | undefined;
3620
3623
  } | {
@@ -4075,7 +4078,7 @@ declare function relayClient(options: RelayClientOptions): {
4075
4078
  nextCursor: string | null;
4076
4079
  }>;
4077
4080
  /** 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<{
4081
+ claim: (value: OptionalActionId<Omit<z.input<typeof submitSchema>, "member">>, requestOptions?: RelayRequestOptions) => Promise<{
4079
4082
  id: string;
4080
4083
  release: string;
4081
4084
  quest: string;
@@ -4141,8 +4144,11 @@ declare function relayClient(options: RelayClientOptions): {
4141
4144
  release?: string | undefined;
4142
4145
  } | undefined;
4143
4146
  }>;
4144
- /** Uploads a photo as the signed-in member's evidence. */
4145
- upload: (file: Blob, requestOptions?: RelayRequestOptions) => Promise<{
4147
+ /** Uploads evidence with a generated key; reuse `actionId` and the same file to replay. */
4148
+ upload: (file: Blob, requestOptions?: RelayRequestOptions & {
4149
+ actionId?: string;
4150
+ uploadId?: string;
4151
+ }) => Promise<{
4146
4152
  id: string;
4147
4153
  member: string;
4148
4154
  type: "image/jpeg" | "image/png";
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { cV as ResourceHandle, cY as GroupHandle } from './schema-CQydLqw4.js';
2
+ import { cV as ResourceHandle, cY as GroupHandle } from './schema-BCuiO7eD.js';
3
3
 
4
4
  declare const pointLedgerPropertiesSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { P as PhotoResult } from './schema-CQydLqw4.js';
2
+ import { P as PhotoResult } from './schema-BCuiO7eD.js';
3
3
 
4
4
  /**
5
5
  * Quest code names an image; the platform fetches, decodes and pins it. No bytes or URLs cross the
package/dist/index.d.ts CHANGED
@@ -1,13 +1,14 @@
1
- export { C as ClaimSubmission, K as KnownRelayErrorCode, P as PhotoSubmission, a as ProgressObservation, b as ProgressObserver, Q as QuestActionResult, c as QuestController, d as QuestUpdatedError, e as QuizSubmission, R as RelayClient, f as RelayClientOptions, g as RelayError, h as RelayErrorCode, i as RelayErrorDetails, j as RelayErrorKind, k as RelayRequestOptions, S as SubmissionDraft, l as SubmissionStatus, m as SubmissionStore, V as ValueSubmission, n as createRelayClient, o as isRelayError } from './client-pfml_XAa.js';
1
+ export { R as RelayAction, c as createRelayAction } from './action-9Xl0StBg.js';
2
+ export { C as ClaimSubmission, K as KnownRelayErrorCode, P as PhotoSubmission, a as ProgressObservation, b as ProgressObserver, Q as QuestActionResult, c as QuestController, d as QuestUpdatedError, e as QuizSubmission, R as RelayClient, f as RelayClientOptions, g as RelayError, h as RelayErrorCode, i as RelayErrorDetails, j as RelayErrorKind, k as RelayRequestOptions, S as SubmissionDraft, l as SubmissionStatus, m as SubmissionStore, V as ValueSubmission, n as createRelayClient, o as isRelayError } from './client-CbASImpi.js';
2
3
  export { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind, c as RequestRecovery, i as isRequestError } from './request-error-D_dUPLwo.js';
3
- export { A as Attempt, a as AttemptStatus, E as Entitlement, b as EvaluatorProgress, K as KnownAttemptStatus, c as KnownTrackerSkipCode, M as MemberProgress, Q as QuestBudgetView, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, R as Reward, S as SubmissionEvidence, g as SubmitInput, T as TieredRewardReference, h as TrackerSkipCode } from './schema-CQydLqw4.js';
4
+ export { A as Attempt, a as AttemptStatus, E as Entitlement, b as EvaluatorProgress, K as KnownAttemptStatus, c as KnownTrackerSkipCode, M as MemberProgress, Q as QuestBudgetView, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, R as Reward, S as SubmissionEvidence, g as SubmitInput, T as TieredRewardReference, h as TrackerSkipCode } from './schema-BCuiO7eD.js';
4
5
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
5
- export { A as AccountConnection, a as AuthProvider, M as MissingPrerequisite, P as Prerequisite, T as TextEvidence, b as TextOptions, U as UrlEvidence, c as UrlOptions, V as ValueEvidence } from './submission-input-CLefHTrj.js';
6
+ export { A as AccountConnection, a as AuthProvider, M as MissingPrerequisite, P as Prerequisite, T as TextEvidence, b as TextOptions, U as UrlEvidence, c as UrlOptions, V as ValueEvidence } from './submission-input-Bs14jIsu.js';
6
7
  export { E as ExchangeInput, M as MemberSummary, P as ParticipantActivity, a as ParticipantPrincipal, b as ParticipantSession, R as RelayEvent, S as Session, s as sessionMember } from './participant-activity-DkL3nY5a.js';
7
- export { P as Page, a as PageQuery, Q as QuestClaimInput, b as QuestEnrollment, c as QuestEnrollmentInput, d as QuestInteraction, e as QuestOutcome, f as QuestOutcomePage, g as QuestOutcomeQuery, h as QuestOutcomeState, i as QuestRewardView, j as QuestView } from './pages-CixTNnF4.js';
8
- export { A as AvailabilityWindow, C as CampaignDefinition, a as CampaignEnrollment, b as CampaignEnrollmentInput, c as CampaignView, d as CampaignWithdrawalInput, K as KnownPointEntryKind, L as LeaderboardDefinition, e as LeaderboardPage, f as LeaderboardPlacement, g as LeaderboardQuery, M as MemberCampaignEnrollmentInput, h as MemberCampaignWithdrawalInput, P as PointBalance, i as PointBalances, j as PointEntry, k as PointEntryKind, l as PointHistoryPage, m as PointHistoryQuery, n as PointLedgerReference, o as ProjectGroup, p as ProjectGroupReference, R as ReferralDefinition } from './groups-BpWEqaPn.js';
9
- export { A as AutomaticCatchUpPreview, a as AutomaticEvent, b as AutomaticOutcome, C as CollectionPass, c as CounterAchievement, d as CounterPolicy, e as CounterProgress } from './automatic-outcomes-C1Q9LrDb.js';
10
- export { O as Offer, a as OfferDefinition, b as OfferPrice, R as RedeemOfferInput, c as Redemption } from './offers-CYtal8jO.js';
8
+ export { P as Page, a as PageQuery, Q as QuestClaimInput, b as QuestEnrollment, c as QuestEnrollmentInput, d as QuestInteraction, e as QuestOutcome, f as QuestOutcomePage, g as QuestOutcomeQuery, h as QuestOutcomeState, i as QuestRewardView, j as QuestView } from './pages-HmS6eedC.js';
9
+ export { A as AvailabilityWindow, C as CampaignDefinition, a as CampaignEnrollment, b as CampaignEnrollmentInput, c as CampaignView, d as CampaignWithdrawalInput, K as KnownPointEntryKind, L as LeaderboardDefinition, e as LeaderboardPage, f as LeaderboardPlacement, g as LeaderboardQuery, M as MemberCampaignEnrollmentInput, h as MemberCampaignWithdrawalInput, P as PointBalance, i as PointBalances, j as PointEntry, k as PointEntryKind, l as PointHistoryPage, m as PointHistoryQuery, n as PointLedgerReference, o as ProjectGroup, p as ProjectGroupReference, R as ReferralDefinition } from './groups-Dvmd4CYk.js';
10
+ export { A as AutomaticCatchUpPreview, a as AutomaticEvent, b as AutomaticOutcome, C as CollectionPass, c as CounterAchievement, d as CounterPolicy, e as CounterProgress } from './automatic-outcomes-Dyk0VTUs.js';
11
+ export { O as Offer, a as OfferDefinition, b as OfferPrice, R as RedeemOfferInput, c as Redemption } from './offers-BEGVSOTD.js';
11
12
  export { A as AvatarProvider, O as OwnProfile, P as ProfileAvatar, a as ProfileCompletion, b as ProfileCompletionPage, c as ProfileCompletionQuery, d as ProfileReferral, e as ProfileSummary, f as ProfileUpdate, g as ProfileVisibility } from './profiles-D2aFcOxu.js';
12
13
  export { Q as QuizContent, S as StreakProgress } from './streaks-CWyq8Px5.js';
13
14
  export { C as CosmosChain, a as CosmosNetwork, L as LinkedWallet, W as WalletAddressInput, b as WalletChain, c as WalletMessageChallenge, d as WalletSignInNetwork, e as WalletSignature, f as WalletSigner, g as WalletUnlinkInput } from './wallet-YssWxGg8.js';
package/dist/index.js CHANGED
@@ -5,16 +5,19 @@ import {
5
5
  import {
6
6
  QuestUpdatedError,
7
7
  createRelayClient
8
- } from "./chunk-ZOUEEK5L.js";
8
+ } from "./chunk-FWSSMSIA.js";
9
+ import {
10
+ createRelayAction
11
+ } from "./chunk-ETPL6AAJ.js";
9
12
  import {
10
13
  QuestOutcomeState
11
- } from "./chunk-C25TDFHN.js";
14
+ } from "./chunk-2N464DDE.js";
12
15
  import {
13
16
  PointEntryKind,
14
17
  RelayError,
15
18
  RelayErrorCode,
16
19
  isRelayError
17
- } from "./chunk-GMPPLZKH.js";
20
+ } from "./chunk-2V74CHDL.js";
18
21
  import "./chunk-6QJ3LADK.js";
19
22
  import {
20
23
  RequestError,
@@ -34,6 +37,7 @@ export {
34
37
  RelayError,
35
38
  RelayErrorCode,
36
39
  RequestError,
40
+ createRelayAction,
37
41
  createRelayClient,
38
42
  formatUnits,
39
43
  isRelayError,
@@ -1,7 +1,7 @@
1
- export { I as IdentityKindClaim, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, m as sourceRoles, v as validateQuestShape } from './referral-reward-kinds-ClxAuCGx.js';
2
- export { E as Extracted } from './images-BaKYd0fl.js';
1
+ export { I as IdentityKindClaim, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, m as sourceRoles, v as validateQuestShape } from './referral-reward-kinds-Flbb1D2q.js';
2
+ export { E as Extracted } from './images-Dekv3DYF.js';
3
3
  import { b as RequestErrorKind } from './request-error-D_dUPLwo.js';
4
- export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-CQydLqw4.js';
4
+ export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-BCuiO7eD.js';
5
5
  import 'zod';
6
6
 
7
7
  /** The management client's and the CLI's default deadline per call. */
@@ -1,5 +1,5 @@
1
- import { cV as ResourceHandle } from './schema-CQydLqw4.js';
2
- import { b9 as AuthoringIdentity } from './groups-BpWEqaPn.js';
1
+ import { cV as ResourceHandle } from './schema-BCuiO7eD.js';
2
+ import { b9 as AuthoringIdentity } from './groups-Dvmd4CYk.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const offerPriceSchema: z.ZodObject<{