@domino-sdk/relay 1.5.2 → 1.6.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 (43) hide show
  1. package/dist/{activity-DeKJsRry.d.ts → activity-mPUN4v5Q.d.ts} +147 -116
  2. package/dist/authoring.d.ts +59 -47
  3. package/dist/authoring.js +3 -3
  4. package/dist/{automatic-outcomes-B1xrETxm.d.ts → automatic-outcomes-DmuqzQiH.d.ts} +224 -13
  5. package/dist/browser.d.ts +22 -10
  6. package/dist/browser.js +6 -6
  7. package/dist/{capability-error-DNMwKmlL.d.ts → capability-error-Bv996M-h.d.ts} +2 -0
  8. package/dist/{chunk-GQKYAQM6.js → chunk-23QJ7WH4.js} +1 -1
  9. package/dist/{chunk-XFMSUPNS.js → chunk-6ON4RMEN.js} +1 -1
  10. package/dist/{chunk-VFHHLN6A.js → chunk-6RBF3UDA.js} +49 -6
  11. package/dist/chunk-AXRMT33W.js +112 -0
  12. package/dist/{chunk-24AFCBZN.js → chunk-BFZHJA2B.js} +2 -2
  13. package/dist/{chunk-EYH5RDIE.js → chunk-C25TDFHN.js} +4 -2
  14. package/dist/{chunk-36HTX2BM.js → chunk-GMPPLZKH.js} +61 -4
  15. package/dist/{chunk-BGGKNIRP.js → chunk-JW4G3SY5.js} +1 -1
  16. package/dist/{chunk-JON5SESL.js → chunk-KGJSKGKI.js} +84 -6
  17. package/dist/{chunk-WJSSJ7AF.js → chunk-QGLHZ2E5.js} +24 -4
  18. package/dist/{chunk-DGWMLN35.js → chunk-ZOUEEK5L.js} +16 -5
  19. package/dist/{client-gqnRUHpC.d.ts → client-CQuTAjSs.d.ts} +88 -41
  20. package/dist/{groups-Ck-OxzjD.d.ts → groups-D08JtrZu.d.ts} +175 -3
  21. package/dist/{identity-integration-GxAHdKR2.d.ts → identity-integration-BPovus6e.d.ts} +1 -1
  22. package/dist/{images-Dv-P5VBw.d.ts → images-D7en0Awp.d.ts} +1 -1
  23. package/dist/index.d.ts +9 -9
  24. package/dist/index.js +5 -5
  25. package/dist/internal.d.ts +34 -27
  26. package/dist/internal.js +18 -24
  27. package/dist/{offers-Cy-e4o5x.d.ts → offers-BENZl5l5.d.ts} +3 -2
  28. package/dist/{outcomes-kVB-Juzs.d.ts → pages-CBa-_u_n.d.ts} +142 -99
  29. package/dist/{pages-BBYD21IE.d.ts → participant-activity-DkL3nY5a.d.ts} +1 -14
  30. package/dist/portal-proxy.js +48 -36
  31. package/dist/react/index.d.ts +25 -3949
  32. package/dist/react/index.js +8 -7
  33. package/dist/{request-error-DWduJCGV.d.ts → request-error-D_dUPLwo.d.ts} +5 -0
  34. package/dist/{schema-DfJzH2ci.d.ts → schema-BPdHSCAc.d.ts} +122 -37
  35. package/dist/schema.d.ts +10 -10
  36. package/dist/schema.js +48 -6
  37. package/dist/server/index.d.ts +9672 -66110
  38. package/dist/server/index.js +1009 -548
  39. package/dist/sign-in-options-FPKoZMfo.d.ts +202 -0
  40. package/dist/{submission-input-BZkm6ohU.d.ts → submission-input-BzIWutQi.d.ts} +2 -2
  41. package/package.json +1 -1
  42. package/dist/browser-D_3s8B5e.d.ts +0 -4154
  43. package/dist/chunk-GUP7YRR4.js +0 -42
@@ -4,15 +4,15 @@ import {
4
4
  imageFieldsSchema,
5
5
  imageInspectionSchema,
6
6
  imageSightingsSchema
7
- } from "./chunk-BGGKNIRP.js";
7
+ } from "./chunk-JW4G3SY5.js";
8
8
  import {
9
9
  authScopeSchema
10
- } from "./chunk-XFMSUPNS.js";
10
+ } from "./chunk-6ON4RMEN.js";
11
11
  import {
12
12
  appIdentityKindSchema,
13
13
  openIdentityKindSchema,
14
14
  photoResultSchema
15
- } from "./chunk-JON5SESL.js";
15
+ } from "./chunk-KGJSKGKI.js";
16
16
 
17
17
  // src/configuration.ts
18
18
  function questConfiguration(release) {
@@ -138,6 +138,24 @@ function parseImageResult(request, value) {
138
138
  import { z as z3 } from "zod";
139
139
  var sequenceCursorSchema = z3.string().regex(/^[1-9][0-9]{0,15}$/, "Invalid cursor").transform(Number).pipe(z3.number().int().positive().safe());
140
140
 
141
+ // src/referral-reward-kinds.ts
142
+ var REFERRAL_INTEGRATION_REWARD_ERROR = "Referral programs can grant points and tiered rewards; Discord roles need a quest";
143
+ var isRecord = (value) => typeof value === "object" && value !== null;
144
+ function containsReferralIntegrationReward(value) {
145
+ if (Array.isArray(value)) {
146
+ return value.some(
147
+ (reward) => isRecord(reward) && reward.kind === "integration"
148
+ );
149
+ }
150
+ if (!isRecord(value)) {
151
+ return false;
152
+ }
153
+ const definition = isRecord(value.definition) ? value.definition : value;
154
+ return isRecord(definition.rewards) && (containsReferralIntegrationReward(definition.rewards.inviter) || containsReferralIntegrationReward(definition.rewards.invitee)) || Array.isArray(definition.milestones) && definition.milestones.some(
155
+ (milestone) => isRecord(milestone) && containsReferralIntegrationReward(milestone.rewards)
156
+ );
157
+ }
158
+
141
159
  export {
142
160
  questConfiguration,
143
161
  identityIntegrationInputSchema,
@@ -147,5 +165,7 @@ export {
147
165
  participantExchangeSchema,
148
166
  parseImageExtraction,
149
167
  parseImageResult,
150
- sequenceCursorSchema
168
+ sequenceCursorSchema,
169
+ REFERRAL_INTEGRATION_REWARD_ERROR,
170
+ containsReferralIntegrationReward
151
171
  };
@@ -12,7 +12,7 @@ import {
12
12
  questOutcomeQuerySchema,
13
13
  questOutcomeSchema,
14
14
  rewardDeliveriesSchema
15
- } from "./chunk-EYH5RDIE.js";
15
+ } from "./chunk-C25TDFHN.js";
16
16
  import {
17
17
  AVATAR_UPLOAD_LIMIT,
18
18
  RelayError,
@@ -51,7 +51,7 @@ import {
51
51
  walletSignInNetworksSchema,
52
52
  walletSignatureSchema,
53
53
  walletUnlinkInputSchema
54
- } from "./chunk-36HTX2BM.js";
54
+ } from "./chunk-GMPPLZKH.js";
55
55
  import {
56
56
  PARTICIPANT_TIMEOUT,
57
57
  lifetime,
@@ -65,7 +65,7 @@ import {
65
65
  memberSummarySchema,
66
66
  participantSessionSchema,
67
67
  sessionMember
68
- } from "./chunk-XFMSUPNS.js";
68
+ } from "./chunk-6ON4RMEN.js";
69
69
  import {
70
70
  accountConnectionSchema,
71
71
  attemptSchema,
@@ -88,7 +88,7 @@ import {
88
88
  tieredRewardReferenceSchema,
89
89
  validateSubmissionValue,
90
90
  valueEvidenceSchema
91
- } from "./chunk-JON5SESL.js";
91
+ } from "./chunk-KGJSKGKI.js";
92
92
 
93
93
  // src/submissions.ts
94
94
  import { z } from "zod";
@@ -746,9 +746,11 @@ function questActions(submission, latest) {
746
746
  // src/client.ts
747
747
  function errorBody(value) {
748
748
  const body = value !== null && typeof value === "object" ? value : {};
749
+ const window = body.window === "tracker" ? "tracker" : body.window === "quest" ? "quest" : void 0;
749
750
  return {
750
751
  message: typeof body.error === "string" && body.error.trim() ? body.error : void 0,
751
752
  code: typeof body.code === "string" && body.code.trim() ? body.code : void 0,
753
+ window,
752
754
  missing: Array.isArray(body.missing) ? body.missing.flatMap((entry) => {
753
755
  const parsed = missingPrerequisiteSchema.safeParse(entry);
754
756
  return parsed.success ? [parsed.data] : [];
@@ -836,6 +838,9 @@ function interrupted(call, life, error, stage) {
836
838
  );
837
839
  }
838
840
  function createRelayClient(options) {
841
+ return relayClient(options);
842
+ }
843
+ function relayClient(options) {
839
844
  if (options.timeout !== void 0 && !validTimeout(options.timeout)) {
840
845
  throw invalidTimeout();
841
846
  }
@@ -897,11 +902,12 @@ function createRelayClient(options) {
897
902
  value = JSON.parse(text);
898
903
  } catch {
899
904
  }
900
- const { message, code, missing } = errorBody(value);
905
+ const { message, code, window, missing } = errorBody(value);
901
906
  throw new RelayError(message ?? `Request failed (${response.status})`, {
902
907
  kind: "http",
903
908
  status: response.status,
904
909
  code,
910
+ window,
905
911
  missing,
906
912
  operationId: call.operationId,
907
913
  replaySafe: call.replaySafe,
@@ -1634,6 +1640,11 @@ function createRelayClient(options) {
1634
1640
  })
1635
1641
  },
1636
1642
  evidence: {
1643
+ /**
1644
+ * @deprecated Never reachable through participant gates: Relay does not serve evidence back
1645
+ * to members, so this always fails with 404. Reviewers download evidence through the
1646
+ * management API. Removed in 2.0.0.
1647
+ */
1637
1648
  async download(id, requestOptions) {
1638
1649
  const call = { options: requestOptions };
1639
1650
  return exchange(
@@ -1,15 +1,16 @@
1
- import { aG as referralAcceptSchema, g as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, m as PointHistoryQuery, k as PointEntryKind, V as engagementPageQuerySchema } from './groups-Ck-OxzjD.js';
2
- import { i as QuestView, b as QuestEnrollmentInput, Q as QuestClaimInput, f as QuestOutcomeQuery, P as questExperienceSchema, n as RewardDeliveryAction, A as contentQualificationQuerySchema } from './outcomes-kVB-Juzs.js';
3
- import { M as MissingPrerequisite, V as ValueEvidence, a as AuthProvider } from './submission-input-BZkm6ohU.js';
4
- import { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind } from './request-error-DWduJCGV.js';
5
- import { f as QuizEvidence, A as Attempt, M as MemberProgress, a as AttemptStatus, h as TrackerSkipCode, bI as submitSchema, aI as contentPerformanceQuerySchema } from './schema-DfJzH2ci.js';
6
- import { d as ParticipantSession, a as PageQuery, g as exchangeSchema, R as RelayEvent, b as ParticipantActivity } from './pages-BBYD21IE.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-D08JtrZu.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-CBa-_u_n.js';
3
+ import { M as MissingPrerequisite, V as ValueEvidence, a as AuthProvider } from './submission-input-BzIWutQi.js';
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, bO as submitSchema, aO as contentPerformanceQuerySchema } from './schema-BPdHSCAc.js';
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
8
  import { F as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-D2aFcOxu.js';
9
9
  import { y as walletAddressInputSchema, I as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-YssWxGg8.js';
10
10
 
11
11
  /** What happened, as in every Domino client error (see `RequestError`). */
12
12
  type RelayErrorKind = RequestErrorKind;
13
+ /** @compat open */
13
14
  type KnownRelayErrorCode = (typeof RelayErrorCode)[keyof typeof RelayErrorCode];
14
15
  /**
15
16
  * The machine-readable codes this SDK knows. `RelayError.code` is an open string: Relay can add
@@ -75,21 +76,47 @@ declare const RelayErrorCode: {
75
76
  readonly InsufficientPoints: "insufficient-points";
76
77
  /** A wallet signer failed or the member refused to sign; `cause` is the wallet's own error. */
77
78
  readonly WalletSigner: "wallet-signer";
79
+ /** The member has not met the quest's prerequisites; `missing` lists them. */
80
+ readonly PrerequisitesIncomplete: "prerequisites-incomplete";
81
+ /** The quest is archived or retired: it takes no new participation. */
82
+ readonly QuestClosed: "quest-closed";
83
+ /** An operator paused the quest. */
84
+ readonly QuestPaused: "quest-paused";
85
+ /** An operator locked the member's profile; hiding it is still allowed. */
86
+ readonly ProfileLocked: "profile-locked";
87
+ /** No member in the project has the invitation code the member accepted. */
88
+ readonly InvitationNotFound: "invitation-not-found";
89
+ /** The email sign-in code is wrong; the member can type it again. */
90
+ readonly InvalidCode: "invalid-code";
91
+ /** The email sign-in code expired, was used or had too many attempts; request another. */
92
+ readonly CodeExpired: "code-expired";
93
+ /** The wallet sign-in challenge expired, was used or changed; start sign-in again. */
94
+ readonly ChallengeExpired: "challenge-expired";
95
+ /** Too many requests; `retryAfter` says how long to wait when Relay knows. */
96
+ readonly RateLimited: "rate-limited";
78
97
  };
79
98
  /** A known code, or one a newer Relay sends. */
80
99
  type RelayErrorCode = KnownRelayErrorCode | (string & {});
81
100
  type RelayErrorDetails = RequestErrorDetails & {
82
101
  code?: RelayErrorCode;
102
+ /** Which window refused admission when `code` is `outside-window`. */
103
+ window?: "tracker" | "quest";
83
104
  missing?: MissingPrerequisite[];
84
105
  };
85
106
  declare const relayErrorBrand: unique symbol;
86
107
  /** Whether `value` is a `RelayError` from any copy of the SDK. Prefer it to `instanceof`. */
87
108
  declare function isRelayError(value: unknown): value is RelayError;
88
- /** Every error the participant client throws: the shared `RequestError` fields, and `missing`. */
109
+ /**
110
+ * Every error the participant client throws: the shared `RequestError` fields, and `missing`.
111
+ *
112
+ * @compat sealed
113
+ */
89
114
  declare class RelayError extends RequestError {
90
115
  readonly name: string;
91
116
  readonly [relayErrorBrand] = true;
92
117
  readonly code: RelayErrorCode | undefined;
118
+ /** Which window refused admission when `code` is `outside-window`. */
119
+ readonly window: "tracker" | "quest" | undefined;
93
120
  /** Prerequisites the member does not currently meet, when Relay refused for that reason. */
94
121
  readonly missing: MissingPrerequisite[];
95
122
  constructor(message: string, details: RelayErrorDetails);
@@ -142,6 +169,8 @@ type SubmissionDraft = {
142
169
  /**
143
170
  * The quest or quiz changed since the member saw it, so Relay admitted nothing. `draft` holds what
144
171
  * the member entered, to show again once they review the quest.
172
+ *
173
+ * @compat sealed
145
174
  */
146
175
  declare class QuestUpdatedError extends RelayError {
147
176
  readonly draft: SubmissionDraft | null;
@@ -151,24 +180,6 @@ declare class QuestUpdatedError extends RelayError {
151
180
  source?: RelayError);
152
181
  }
153
182
 
154
- type ProgressObservation<T = MemberProgress> = {
155
- kind: "loading";
156
- } | {
157
- kind: "session";
158
- session: ParticipantSession | null;
159
- } | {
160
- kind: "ready";
161
- session: ParticipantSession;
162
- progress: T;
163
- } | {
164
- kind: "error";
165
- error: Error;
166
- };
167
- type ProgressObserver = {
168
- refresh(): Promise<void>;
169
- dispose(): void;
170
- };
171
-
172
183
  type QuestActionResult = {
173
184
  kind: "submitted";
174
185
  attempt: Attempt;
@@ -200,7 +211,29 @@ type QuestController = (ActiveController & {
200
211
  submit(): Promise<QuestActionResult>;
201
212
  });
202
213
 
203
- /** Options every participant client method takes as its last argument. */
214
+ type ProgressObservation<T = MemberProgress> = {
215
+ kind: "loading";
216
+ } | {
217
+ kind: "session";
218
+ session: ParticipantSession | null;
219
+ } | {
220
+ kind: "ready";
221
+ session: ParticipantSession;
222
+ progress: T;
223
+ } | {
224
+ kind: "error";
225
+ error: Error;
226
+ };
227
+ type ProgressObserver = {
228
+ refresh(): Promise<void>;
229
+ dispose(): void;
230
+ };
231
+
232
+ /**
233
+ * Options every participant client method takes as its last argument.
234
+ *
235
+ * @compat input
236
+ */
204
237
  type RelayRequestOptions = {
205
238
  /**
206
239
  * The session ID the app read (`auth.session()`). Relay refuses the call with a `RelayError`
@@ -219,6 +252,7 @@ type RelayRequestOptions = {
219
252
  */
220
253
  timeout?: number;
221
254
  };
255
+ /** @compat input */
222
256
  type RelayClientOptions = {
223
257
  baseUrl: string;
224
258
  token?: string;
@@ -232,7 +266,8 @@ type RelayClientOptions = {
232
266
  */
233
267
  timeout?: number;
234
268
  };
235
- declare function createRelayClient(options: RelayClientOptions): {
269
+ declare function createRelayClient(options: RelayClientOptions): RelayClient;
270
+ declare function relayClient(options: RelayClientOptions): {
236
271
  offers: {
237
272
  /** Offers available to this participant, including stock and per-member availability. */
238
273
  list: (requestOptions?: RelayRequestOptions) => Promise<{
@@ -1442,6 +1477,7 @@ declare function createRelayClient(options: RelayClientOptions): {
1442
1477
  } | {
1443
1478
  kind: "blocked";
1444
1479
  reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
1480
+ window?: "quest" | "tracker" | undefined;
1445
1481
  resetsAt?: number | undefined;
1446
1482
  } | {
1447
1483
  kind: "staff-required";
@@ -1722,6 +1758,7 @@ declare function createRelayClient(options: RelayClientOptions): {
1722
1758
  createdAt: number;
1723
1759
  updatedAt: number;
1724
1760
  automatic?: string | undefined;
1761
+ window?: "quest" | "tracker" | undefined;
1725
1762
  }>;
1726
1763
  /**
1727
1764
  * Why automatic quests did or did not run for the signed-in member's activity, newest first:
@@ -1741,6 +1778,7 @@ declare function createRelayClient(options: RelayClientOptions): {
1741
1778
  createdAt: number;
1742
1779
  updatedAt: number;
1743
1780
  automatic?: string | undefined;
1781
+ window?: "quest" | "tracker" | undefined;
1744
1782
  }[];
1745
1783
  nextCursor: string | null;
1746
1784
  }>;
@@ -2092,6 +2130,7 @@ declare function createRelayClient(options: RelayClientOptions): {
2092
2130
  } | {
2093
2131
  kind: "blocked";
2094
2132
  reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2133
+ window?: "quest" | "tracker" | undefined;
2095
2134
  resetsAt?: number | undefined;
2096
2135
  } | {
2097
2136
  kind: "staff-required";
@@ -2472,6 +2511,7 @@ declare function createRelayClient(options: RelayClientOptions): {
2472
2511
  } | {
2473
2512
  kind: "blocked";
2474
2513
  reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2514
+ window?: "quest" | "tracker" | undefined;
2475
2515
  resetsAt?: number | undefined;
2476
2516
  } | {
2477
2517
  kind: "staff-required";
@@ -2855,6 +2895,7 @@ declare function createRelayClient(options: RelayClientOptions): {
2855
2895
  } | {
2856
2896
  kind: "blocked";
2857
2897
  reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2898
+ window?: "quest" | "tracker" | undefined;
2858
2899
  resetsAt?: number | undefined;
2859
2900
  } | {
2860
2901
  kind: "staff-required";
@@ -3416,17 +3457,7 @@ declare function createRelayClient(options: RelayClientOptions): {
3416
3457
  (quest: string, options?: {
3417
3458
  input: "photo";
3418
3459
  release?: string;
3419
- recoverPrevious
3420
- /**
3421
- * The session ID the app read (`auth.session()`). Relay refuses the call with a `RelayError`
3422
- * whose code is `stale-session` if the member's session changed since. Calls Relay binds to a
3423
- * session (wallet linking, collection passes, retries) read the current session when omitted.
3424
- */
3425
- ? /**
3426
- * The session ID the app read (`auth.session()`). Relay refuses the call with a `RelayError`
3427
- * whose code is `stale-session` if the member's session changed since. Calls Relay binds to a
3428
- * session (wallet linking, collection passes, retries) read the current session when omitted.
3429
- */: boolean;
3460
+ recoverPrevious?: boolean;
3430
3461
  repeatable?: boolean;
3431
3462
  }): Promise<PhotoSubmission>;
3432
3463
  (quest: string, options: {
@@ -3437,7 +3468,10 @@ declare function createRelayClient(options: RelayClientOptions): {
3437
3468
  }): Promise<QuizSubmission>;
3438
3469
  (quest: string, options: {
3439
3470
  input: "none";
3440
- release?: string;
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;
3441
3475
  recoverPrevious?: boolean;
3442
3476
  repeatable?: boolean;
3443
3477
  }): Promise<ClaimSubmission>;
@@ -3581,6 +3615,7 @@ declare function createRelayClient(options: RelayClientOptions): {
3581
3615
  } | {
3582
3616
  kind: "blocked";
3583
3617
  reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
3618
+ window?: "quest" | "tracker" | undefined;
3584
3619
  resetsAt?: number | undefined;
3585
3620
  } | {
3586
3621
  kind: "staff-required";
@@ -4115,6 +4150,11 @@ declare function createRelayClient(options: RelayClientOptions): {
4115
4150
  }>;
4116
4151
  };
4117
4152
  evidence: {
4153
+ /**
4154
+ * @deprecated Never reachable through participant gates: Relay does not serve evidence back
4155
+ * to members, so this always fails with 404. Reviewers download evidence through the
4156
+ * management API. Removed in 2.0.0.
4157
+ */
4118
4158
  download(id: string, requestOptions?: RelayRequestOptions): Promise<Blob>;
4119
4159
  };
4120
4160
  engagement: {
@@ -4267,7 +4307,14 @@ declare function createRelayClient(options: RelayClientOptions): {
4267
4307
  }>;
4268
4308
  };
4269
4309
  };
4270
- /** The participant client `createRelayClient` returns. */
4271
- type RelayClient = ReturnType<typeof createRelayClient>;
4310
+ /**
4311
+ * The participant client `createRelayClient` and `createBrowserRelayClient` return. Not for
4312
+ * implementation: only these factories create it, and a 1.x minor release can add methods, so an
4313
+ * object written by hand as a `RelayClient` may stop compiling.
4314
+ *
4315
+ * @compat sealed
4316
+ */
4317
+ interface RelayClient extends ReturnType<typeof relayClient> {
4318
+ }
4272
4319
 
4273
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 };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { cF as ResourceHandle, cI as GroupHandle } from './schema-DfJzH2ci.js';
2
+ import { cN as ResourceHandle, cQ as GroupHandle } from './schema-BPdHSCAc.js';
3
3
 
4
4
  declare const pointLedgerPropertiesSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -72,6 +72,7 @@ declare const pointBalancesSchema: z.ZodObject<{
72
72
  available: z.ZodNumber;
73
73
  }, z.core.$strip>>;
74
74
  }, z.core.$strip>;
75
+ /** @compat open */
75
76
  type KnownPointEntryKind = (typeof PointEntryKind)[keyof typeof PointEntryKind];
76
77
  /**
77
78
  * The point entry kinds this SDK knows. `PointEntry.kind` is an open string: Relay can add kinds,
@@ -333,6 +334,42 @@ declare const engagementChangePreviewSchema: z.ZodObject<{
333
334
  pending: z.ZodString;
334
335
  }, z.core.$strict>;
335
336
  }, z.core.$strict>;
337
+ /**
338
+ * One page of an engagement rule's published versions, newest first. Unlike the strict definition
339
+ * authoring validates, a published version as read keeps parsing when a newer server adds fields.
340
+ */
341
+ declare const engagementRuleVersionPageSchema: z.ZodObject<{
342
+ items: z.ZodArray<z.ZodObject<{
343
+ version: z.ZodString;
344
+ definition: z.ZodObject<{
345
+ budgets: z.ZodDefault<z.ZodArray<z.ZodObject<{
346
+ scope: z.ZodEnum<{
347
+ member: "member";
348
+ project: "project";
349
+ }>;
350
+ period: z.ZodEnum<{
351
+ lifetime: "lifetime";
352
+ day: "day";
353
+ week: "week";
354
+ month: "month";
355
+ }>;
356
+ limit: z.ZodNumber;
357
+ }, z.core.$strip>>>;
358
+ key: z.ZodString;
359
+ qualifiedBy: z.ZodString;
360
+ balance: z.ZodString;
361
+ metrics: z.ZodArray<z.ZodString>;
362
+ baseline: z.ZodLiteral<"historical">;
363
+ maxAgeMs: z.ZodDefault<z.ZodNumber>;
364
+ }, z.core.$strip>;
365
+ publishedAt: z.ZodNumber;
366
+ previousVersion: z.ZodNullable<z.ZodString>;
367
+ }, z.core.$strip>>;
368
+ nextCursor: z.ZodNullable<z.ZodString>;
369
+ }, z.core.$strip>;
370
+ /** @compat output */
371
+ type EngagementRuleVersionPage = z.infer<typeof engagementRuleVersionPageSchema>;
372
+ /** @deprecated Use `engagementRuleVersionPageSchema`. Removed in 2.0.0. */
336
373
  declare const engagementVersionPageSchema: z.ZodObject<{
337
374
  items: z.ZodArray<z.ZodObject<{
338
375
  version: z.ZodString;
@@ -362,6 +399,7 @@ declare const engagementVersionPageSchema: z.ZodObject<{
362
399
  }, z.core.$strict>>;
363
400
  next: z.ZodNullable<z.ZodNumber>;
364
401
  }, z.core.$strict>;
402
+ /** @deprecated Use `management.engagement.ruleVersions(rule, { cursor })`. Removed in 2.0.0. */
365
403
  declare const engagementVersionQuerySchema: z.ZodObject<{
366
404
  rule: z.ZodString;
367
405
  before: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
@@ -1539,6 +1577,35 @@ declare const pointsEntrySchema: z.ZodObject<{
1539
1577
  reason: z.ZodString;
1540
1578
  actor: z.ZodNullable<z.ZodString>;
1541
1579
  }, z.core.$strip>;
1580
+ /**
1581
+ * One page of a member's entries in one point ledger, as operators read them, the most recently
1582
+ * recorded first. Pass `nextCursor` back as `cursor` for the next page.
1583
+ */
1584
+ declare const managedPointHistoryPageSchema: z.ZodObject<{
1585
+ items: z.ZodArray<z.ZodObject<{
1586
+ id: z.ZodString;
1587
+ completion: z.ZodNullable<z.ZodString>;
1588
+ member: z.ZodString;
1589
+ balance: z.ZodString;
1590
+ amount: z.ZodNumber;
1591
+ kind: z.ZodEnum<{
1592
+ reverse: "reverse";
1593
+ award: "award";
1594
+ spend: "spend";
1595
+ adjust: "adjust";
1596
+ }>;
1597
+ effectiveAt: z.ZodNumber;
1598
+ receivedAt: z.ZodNumber;
1599
+ quest: z.ZodNullable<z.ZodString>;
1600
+ original: z.ZodNullable<z.ZodString>;
1601
+ reason: z.ZodString;
1602
+ actor: z.ZodNullable<z.ZodString>;
1603
+ }, z.core.$strip>>;
1604
+ nextCursor: z.ZodNullable<z.ZodString>;
1605
+ next: z.ZodNullable<z.ZodNumber>;
1606
+ }, z.core.$strip>;
1607
+ /** @compat output */
1608
+ type ManagedPointHistoryPage = z.infer<typeof managedPointHistoryPageSchema>;
1542
1609
  declare const pointsResultSchema: z.ZodObject<{
1543
1610
  entry: z.ZodObject<{
1544
1611
  id: z.ZodString;
@@ -1573,6 +1640,10 @@ declare const leaderboardExclusionSchema: z.ZodObject<{
1573
1640
  excluded: z.ZodBoolean;
1574
1641
  reason: z.ZodString;
1575
1642
  }, z.core.$strict>;
1643
+ /**
1644
+ * @deprecated Use `addGroupMemberSchema` and `removeGroupMemberSchema` (`management.groups`)
1645
+ * instead. Removed in 2.0.0.
1646
+ */
1576
1647
  declare const leaderboardGroupSchema: z.ZodObject<{
1577
1648
  actionId: z.ZodString;
1578
1649
  member: z.ZodString;
@@ -2105,6 +2176,27 @@ declare const referralAcceptSchema: z.ZodObject<{
2105
2176
  actionId: z.ZodString;
2106
2177
  code: z.ZodString;
2107
2178
  }, z.core.$strict>;
2179
+ /** `management.referrals.suspend(member, input)`: suspends or restores a member's referral. */
2180
+ declare const referralSuspensionSchema: z.ZodObject<{
2181
+ actionId: z.ZodString;
2182
+ suspended: z.ZodBoolean;
2183
+ reason: z.ZodString;
2184
+ }, z.core.$strict>;
2185
+ /** `management.referrals.qualify(program, member, input)`: qualifies or unqualifies a member. */
2186
+ declare const referralQualificationSchema: z.ZodObject<{
2187
+ actionId: z.ZodString;
2188
+ qualified: z.ZodBoolean;
2189
+ reason: z.ZodString;
2190
+ }, z.core.$strict>;
2191
+ /** `management.referrals.resolveReward(entitlement, input)`: clears a referral reward's review. */
2192
+ declare const referralRewardResolutionSchema: z.ZodObject<{
2193
+ actionId: z.ZodString;
2194
+ reason: z.ZodString;
2195
+ }, z.core.$strict>;
2196
+ /**
2197
+ * The 1.0 body of `POST /referrals/control`, with every ID in the body.
2198
+ * @deprecated Use `referralSuspensionSchema`, `referralQualificationSchema` or `referralRewardResolutionSchema` with `management.referrals.suspend`, `qualify` or `resolveReward`. Removed in 2.0.0.
2199
+ */
2108
2200
  declare const referralControlSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2109
2201
  kind: z.ZodLiteral<"suspend">;
2110
2202
  actionId: z.ZodString;
@@ -2281,6 +2373,11 @@ declare const referralHistorySchema: z.ZodObject<{
2281
2373
  }, z.core.$strip>>;
2282
2374
  nextCursor: z.ZodNullable<z.ZodString>;
2283
2375
  }, z.core.$strip>;
2376
+ /**
2377
+ * One page of the project's referral relationships, newest first, with the qualifications and
2378
+ * accounts of the members they name and the referral rewards waiting for review. Pass `nextCursor`
2379
+ * back as `cursor` for the next page.
2380
+ */
2284
2381
  declare const referralManagementSchema: z.ZodObject<{
2285
2382
  relationships: z.ZodArray<z.ZodObject<{
2286
2383
  member: z.ZodString;
@@ -2315,6 +2412,7 @@ declare const referralManagementSchema: z.ZodObject<{
2315
2412
  program: z.ZodString;
2316
2413
  reason: z.ZodString;
2317
2414
  }, z.core.$strip>>;
2415
+ nextCursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2318
2416
  next: z.ZodNullable<z.ZodNumber>;
2319
2417
  }, z.core.$strip>;
2320
2418
 
@@ -2438,12 +2536,86 @@ declare const projectGroupAuthoringSchema: z.ZodPipe<z.ZodObject<{
2438
2536
  key: string;
2439
2537
  title?: string | undefined;
2440
2538
  }>>;
2441
- /** Define one project group for prerequisites, leaderboards, and referrals. */
2539
+ /**
2540
+ * Define one project group for prerequisites, leaderboards, and referrals. The handle names the
2541
+ * group by its key; operators create the group and manage its members in Console or with
2542
+ * `management.groups`.
2543
+ */
2442
2544
  declare function defineGroup(input: Omit<z.input<typeof projectGroupAuthoringSchema>, "key" | "id"> & AuthoringIdentity): {
2443
2545
  key: string;
2444
2546
  title: string;
2445
2547
  } & ResourceHandle<"group">;
2446
2548
  type ProjectGroupReference = GroupHandle;
2447
2549
  declare function projectGroupKey(group: ProjectGroupReference): string;
2550
+ /** Creates a group under `key`, the name prerequisites, leaderboards and referral rules use. */
2551
+ declare const createGroupSchema: z.ZodObject<{
2552
+ actionId: z.ZodString;
2553
+ key: z.ZodString;
2554
+ title: z.ZodString;
2555
+ }, z.core.$strict>;
2556
+ /** Renames a group. Its key, members and history stay. */
2557
+ declare const updateGroupSchema: z.ZodObject<{
2558
+ title: z.ZodString;
2559
+ }, z.core.$strict>;
2560
+ /** Adds `member` to a group, with a reason for the audit history. */
2561
+ declare const addGroupMemberSchema: z.ZodObject<{
2562
+ actionId: z.ZodString;
2563
+ member: z.ZodString;
2564
+ reason: z.ZodString;
2565
+ }, z.core.$strict>;
2566
+ /** Removes the member the path names from a group, with a reason for the audit history. */
2567
+ declare const removeGroupMemberSchema: z.ZodObject<{
2568
+ actionId: z.ZodString;
2569
+ reason: z.ZodString;
2570
+ }, z.core.$strict>;
2571
+ /** One page of groups or of a group's members: pass `nextCursor` back as `cursor`. */
2572
+ declare const groupPageQuerySchema: z.ZodObject<{
2573
+ cursor: z.ZodOptional<z.ZodString>;
2574
+ /** Items per page, 1–100; the default is 50. */
2575
+ limit: z.ZodOptional<z.ZodNumber>;
2576
+ }, z.core.$strict>;
2577
+ type GroupPageQuery = z.input<typeof groupPageQuerySchema>;
2578
+ /**
2579
+ * A group as operators manage it, with the number of its current members. An archived group
2580
+ * keeps its members, and prerequisites, leaderboards and referral rules still read them, but its
2581
+ * membership cannot change until it is unarchived.
2582
+ */
2583
+ declare const managedGroupSchema: z.ZodObject<{
2584
+ key: z.ZodString;
2585
+ title: z.ZodString;
2586
+ members: z.ZodNumber;
2587
+ createdAt: z.ZodNumber;
2588
+ archivedAt: z.ZodNullable<z.ZodNumber>;
2589
+ }, z.core.$strip>;
2590
+ /** @compat output */
2591
+ type ManagedGroup = z.infer<typeof managedGroupSchema>;
2592
+ declare const groupPageSchema: z.ZodObject<{
2593
+ items: z.ZodArray<z.ZodObject<{
2594
+ key: z.ZodString;
2595
+ title: z.ZodString;
2596
+ members: z.ZodNumber;
2597
+ createdAt: z.ZodNumber;
2598
+ archivedAt: z.ZodNullable<z.ZodNumber>;
2599
+ }, z.core.$strip>>;
2600
+ nextCursor: z.ZodNullable<z.ZodString>;
2601
+ }, z.core.$strip>;
2602
+ /** @compat output */
2603
+ type GroupPage = z.infer<typeof groupPageSchema>;
2604
+ /** A current member of a group. `addedAt` is null when Relay has no record of when they joined. */
2605
+ declare const groupMemberSchema: z.ZodObject<{
2606
+ member: z.ZodString;
2607
+ addedAt: z.ZodNullable<z.ZodNumber>;
2608
+ }, z.core.$strip>;
2609
+ /** @compat output */
2610
+ type GroupMember = z.infer<typeof groupMemberSchema>;
2611
+ declare const groupMemberPageSchema: z.ZodObject<{
2612
+ items: z.ZodArray<z.ZodObject<{
2613
+ member: z.ZodString;
2614
+ addedAt: z.ZodNullable<z.ZodNumber>;
2615
+ }, z.core.$strip>>;
2616
+ nextCursor: z.ZodNullable<z.ZodString>;
2617
+ }, z.core.$strip>;
2618
+ /** @compat output */
2619
+ type GroupMemberPage = z.infer<typeof groupMemberPageSchema>;
2448
2620
 
2449
- export { engagementSettlementSchema as $, type AvailabilityWindow as A, campaignViewSchema as B, type CampaignDefinition as C, campaignWithdrawalInputSchema as D, type EngagementBudget as E, createPointLedgerSchema as F, defineCampaign as G, defineGroup as H, engagementArtifactSchema as I, engagementBoundaryPageSchema as J, type KnownPointEntryKind as K, type LeaderboardDefinition as L, type MemberCampaignEnrollmentInput as M, engagementBudgetSchema as N, engagementChangePreviewInputSchema as O, type PointBalance as P, engagementChangePreviewSchema as Q, type ReferralDefinition as R, engagementChangeSchema as S, engagementDefinitionSchema as T, engagementDeploymentEntrySchema as U, engagementPageQuerySchema as V, engagementPageSchema as W, engagementPublishSchema as X, engagementRuleSchema as Y, engagementScoreInputSchema as Z, engagementScoreSchema as _, type CampaignEnrollment as a, engagementVersionPageSchema as a0, engagementVersionQuerySchema as a1, leaderboardArtifactSchema as a2, leaderboardAuthoringSchema as a3, leaderboardDefinitionSchema as a4, leaderboardExclusionSchema as a5, leaderboardGroupSchema as a6, leaderboardPageSchema as a7, leaderboardPlacementSchema as a8, leaderboardPreviewSchema as a9, pointsMutationSchema as aA, pointsResultSchema as aB, projectGroupKey as aC, projectGroupSchema as aD, publishedLeaderboardSchema as aE, publishedReferralSchema as aF, referralAcceptSchema as aG, referralAccountSchema as aH, referralArtifactSchema as aI, referralAuthoringSchema as aJ, referralControlSchema as aK, referralDefinitionSchema as aL, referralHistorySchema as aM, referralManagementSchema as aN, referralRelationshipSchema as aO, referralSummarySchema as aP, type AuthoringIdentity as aQ, leaderboardPrizeRewardSchema as aa, leaderboardPrizeSchema as ab, leaderboardQuerySchema as ac, leaderboardRowSchema as ad, leaderboardSettlementApprovalSchema as ae, leaderboardSettlementPolicySchema as af, leaderboardSettlementRowSchema as ag, leaderboardSettlementSchema as ah, leaderboardSettlementStatusSchema as ai, leaderboardSettlementSummarySchema as aj, leaderboardWindowSchema as ak, managedPointLedgerSchema as al, memberCampaignEnrollmentInputSchema as am, memberCampaignWithdrawalInputSchema as an, pointBalanceSchema as ao, pointBalancesSchema as ap, pointEntrySchema as aq, pointHistoryPageSchema as ar, pointHistoryQuerySchema as as, pointLedgerArtifactSchema as at, pointLedgerDeclarationSchema as au, pointLedgerPropertiesSchema as av, pointLedgerReferenceSchema as aw, pointLedgerSchema as ax, pointsAccountSchema as ay, pointsEntrySchema as az, type CampaignEnrollmentInput as b, 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 LeaderboardSettlement as r, type LeaderboardSettlementPolicy as s, type LeaderboardSettlementSummary as t, type ManagedPointLedger as u, type PointLedger as v, availabilityWindowSchema as w, campaignDefinitionSchema as x, campaignEnrollmentInputSchema as y, campaignEnrollmentSchema as z };
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 };
@@ -1,4 +1,4 @@
1
- import { O as OpenIdentityKind } from './schema-DfJzH2ci.js';
1
+ import { O as OpenIdentityKind } from './schema-BPdHSCAc.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  declare const identityIntegrationInputSchema: z.ZodObject<{