@domino-sdk/relay 1.54.0 → 1.55.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 (64) hide show
  1. package/CHANGELOG.md +1848 -0
  2. package/dist/analytics-URV-mxjH.d.ts +482 -0
  3. package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
  4. package/dist/authoring.d.ts +233 -78
  5. package/dist/authoring.js +112 -14
  6. package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +7 -7
  9. package/dist/browser.js +10 -10
  10. package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
  11. package/dist/{chunk-53JMTUWG.js → chunk-56DBFNR2.js} +1 -1
  12. package/dist/chunk-C7QZ4UBB.js +937 -0
  13. package/dist/chunk-F6HECAXA.js +661 -0
  14. package/dist/{chunk-JL7J3EQQ.js → chunk-GL43VQ5D.js} +16 -16
  15. package/dist/{chunk-GTQJSDBS.js → chunk-IUF7DW76.js} +27 -16
  16. package/dist/{chunk-QIDQWXSF.js → chunk-IZRITLVV.js} +2 -2
  17. package/dist/{chunk-S2PMKZSX.js → chunk-SABMNPF2.js} +21 -2
  18. package/dist/{chunk-XFAYQFRO.js → chunk-TLK2MD4S.js} +1 -1
  19. package/dist/{chunk-ZJ3FVZRP.js → chunk-UY6KMLQG.js} +10 -3
  20. package/dist/{chunk-RP4LLEON.js → chunk-VFBQVY4X.js} +1 -1
  21. package/dist/{chunk-YVC3B72P.js → chunk-WHG5WE43.js} +1 -1
  22. package/dist/chunk-WHMXXHPX.js +344 -0
  23. package/dist/{chunk-TL5TL5RD.js → chunk-WUEQOKJH.js} +4 -4
  24. package/dist/{chunk-7BNCLWAO.js → chunk-XALIFNMD.js} +1 -1
  25. package/dist/{chunk-IELNFM3V.js → chunk-YCOKTQ4E.js} +96 -7
  26. package/dist/{chunk-LPHXTZDA.js → chunk-YE3XYB2F.js} +2 -2
  27. package/dist/{chunk-K6TVMNU4.js → chunk-YEVD4A5X.js} +1 -1
  28. package/dist/{client-CzNtl8UO.d.ts → client-C4zUZKpj.d.ts} +35 -7
  29. package/dist/{deployments-ovtqtAcx.d.ts → deployments-B32QS1CI.d.ts} +1060 -233
  30. package/dist/{groups-B5R1RCsl.d.ts → groups-O6onGPmC.d.ts} +131 -137
  31. package/dist/index.d.ts +8 -8
  32. package/dist/index.js +9 -9
  33. package/dist/integrations-C6_uUh-s.d.ts +584 -0
  34. package/dist/internal.d.ts +11 -10
  35. package/dist/internal.js +8 -8
  36. package/dist/{offers-CH1RZekg.d.ts → offers-BMDNcvwB.d.ts} +2 -2
  37. package/dist/{pages-BTlOg8sl.d.ts → pages-BFloMpyQ.d.ts} +25 -1
  38. package/dist/portal-proxy.d.ts +11 -1
  39. package/dist/portal-proxy.js +26 -5
  40. package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
  41. package/dist/react/index.d.ts +488 -13
  42. package/dist/react/index.js +50 -15
  43. package/dist/runtime/authoring.js +1 -1
  44. package/dist/runtime/chunks/WKATKZXE.js +1 -0
  45. package/dist/runtime/manifest.json +3 -3
  46. package/dist/runtime/schema.js +1 -1
  47. package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
  48. package/dist/schema.d.ts +392 -334
  49. package/dist/schema.js +84 -40
  50. package/dist/server/index.d.ts +11 -10
  51. package/dist/server/index.js +1109 -854
  52. package/dist/{submission-input-BNah53go.d.ts → submission-input-BbdawqVy.d.ts} +2 -2
  53. package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-CwaxROAZ.d.ts} +1 -1
  54. package/dist/testing.d.ts +85 -12
  55. package/dist/testing.js +322 -37
  56. package/dist/{transport-C8BlCzmF.d.ts → transport-CZJOW5Sr.d.ts} +7648 -3529
  57. package/dist/vite.d.ts +54 -1
  58. package/dist/vite.js +35 -0
  59. package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
  60. package/package.json +3 -2
  61. package/dist/chunk-2NUD237O.js +0 -102
  62. package/dist/chunk-CCE2JWES.js +0 -1083
  63. package/dist/integrations-CllF-kWg.d.ts +0 -314
  64. package/dist/runtime/chunks/AVRVSLHX.js +0 -1
@@ -75,6 +75,11 @@ var RelayErrorCode = {
75
75
  * says when they may submit again.
76
76
  */
77
77
  RetryCooldown: "retry-cooldown",
78
+ /**
79
+ * The member's last accepted completion of the quest is more recent than its completion
80
+ * cooldown; `retryAt` says when they may submit again.
81
+ */
82
+ CompletionCooldown: "completion-cooldown",
78
83
  /** The quiz changed since the member answered it. */
79
84
  StaleQuiz: "stale-quiz",
80
85
  /** Relay refused the submitted evidence. */
@@ -135,7 +140,10 @@ var RelayError = class extends RequestError {
135
140
  window;
136
141
  /** Prerequisites the member does not currently meet, when Relay refused for that reason. */
137
142
  missing;
138
- /** Unix milliseconds when the member may submit again, when `code` is `retry-cooldown`. */
143
+ /**
144
+ * Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
145
+ * `completion-cooldown`.
146
+ */
139
147
  retryAt;
140
148
  constructor(message, details) {
141
149
  super(message, details);
@@ -1346,6 +1354,21 @@ var trackerStatusSchema = z8.object({
1346
1354
  archivedAt: z8.number().int().nonnegative().nullable().optional(),
1347
1355
  published: publishedTrackerSchema,
1348
1356
  paused: z8.boolean(),
1357
+ /**
1358
+ * Why a paused tracker is paused, null when it isn't: `operator` (paused by hand),
1359
+ * `x-budget-exhausted` (the project's monthly X budget, or in test the organization's, is spent;
1360
+ * it resumes on its own at `resumesAt`, or sooner on a plan that allows more), or
1361
+ * `test-window-ended` (a test X tracker collects for 14 days; resume it for another 14). Treat an
1362
+ * unknown reason, which a newer Relay can add, as paused. Older servers leave it out.
1363
+ */
1364
+ pauseReason: z8.string().nullable().optional(),
1365
+ /** When a tracker paused on its X budget resumes on its own: the start of the next UTC month. */
1366
+ resumesAt: timestamp.nullable().optional(),
1367
+ /**
1368
+ * The interval a scheduled tracker actually runs at: `refreshSeconds`, but no shorter than the
1369
+ * project's plan allows (6 hours, shorter on Enterprise). Older servers leave it out.
1370
+ */
1371
+ effectiveRefreshSeconds: z8.number().int().positive().optional(),
1349
1372
  state: z8.enum(["idle", "syncing", "error", "complete"]),
1350
1373
  lastStartedAt: timestamp.nullable(),
1351
1374
  lastCompletedAt: timestamp.nullable(),
@@ -2112,7 +2135,9 @@ var reservedAttemptCodes = Object.freeze([
2112
2135
  "integration-required",
2113
2136
  "not-linked",
2114
2137
  "provider-unavailable",
2115
- "author-error"
2138
+ "author-error",
2139
+ "evaluator-error",
2140
+ "capability-limit"
2116
2141
  ]);
2117
2142
  var rejectCodeMaxLength = 64;
2118
2143
  var rejectCodePattern = /^[a-z0-9-]+$/;
@@ -2198,6 +2223,12 @@ var budgetSchema = z16.object({
2198
2223
  z16.object({ balance: name }).strict()
2199
2224
  ])
2200
2225
  }).strict();
2226
+ var memberCompletionSchema = z16.object({
2227
+ quest: z16.string().min(1).max(200),
2228
+ key: completionKeySchema,
2229
+ completedAt: z16.number().int().nonnegative().safe().nullable()
2230
+ });
2231
+ var maxMemberCompletions = 100;
2201
2232
 
2202
2233
  // src/integrations.ts
2203
2234
  import * as z17 from "zod";
@@ -2554,9 +2585,17 @@ var settingFieldSchema = z23.discriminatedUnion("kind", [
2554
2585
  multiline: z23.boolean(),
2555
2586
  /**
2556
2587
  * A list Console offers the value from, beside free text: `telegram-chat` lists the
2557
- * project's connected Telegram chats. Unknown pickers read as free text.
2588
+ * project's connected Telegram chats. Unknown pickers read as free text. Two pickers also
2589
+ * constrain the value, at publication and when an operator edits it: `amount`, a
2590
+ * non-negative integer in a token's base units (`settings.amount()`), and `chain`, a chain
2591
+ * `ctx.wallet.balance()` reads (`settings.chain()`).
2592
+ */
2593
+ picker: z23.string().optional(),
2594
+ /**
2595
+ * On an `amount` setting, the token's decimals: Console shows and edits the value in whole
2596
+ * tokens.
2558
2597
  */
2559
- picker: z23.string().optional()
2598
+ decimals: z23.number().int().min(0).max(255).optional()
2560
2599
  }).strict(),
2561
2600
  z23.object({
2562
2601
  ...base,
@@ -2581,6 +2620,32 @@ var settingsValuesSchema = z23.record(
2581
2620
  z23.string(),
2582
2621
  z23.union([z23.string(), z23.number().finite(), z23.boolean(), quizContentSchema])
2583
2622
  );
2623
+ function isAmount(value) {
2624
+ return value.length <= 100 && /^(0|[1-9][0-9]*)$/.test(value);
2625
+ }
2626
+ function isBalanceChain(value) {
2627
+ return value === "solana" || value === solanaMainnet || isEvmChainId(value);
2628
+ }
2629
+ function isBoundSetting(field) {
2630
+ return field?.kind === "integer" || field?.kind === "text" && field.picker === "amount";
2631
+ }
2632
+ function textSettingSchema(field) {
2633
+ const text = z23.string().min(field.minLength).max(field.maxLength);
2634
+ switch (field.picker) {
2635
+ case "amount":
2636
+ return text.refine(
2637
+ isAmount,
2638
+ "Use a whole number of base units, such as 1000000"
2639
+ );
2640
+ case "chain":
2641
+ return text.refine(
2642
+ isBalanceChain,
2643
+ 'Use "solana" or an EVM chain ID such as "eip155:8453"'
2644
+ );
2645
+ default:
2646
+ return text;
2647
+ }
2648
+ }
2584
2649
  function parseSettings(fields2, input) {
2585
2650
  const shape = {};
2586
2651
  for (const [key, field] of Object.entries(fields2)) {
@@ -2598,7 +2663,7 @@ function parseSettings(fields2, input) {
2598
2663
  shape[key] = quizContentSchema.default(field.default);
2599
2664
  break;
2600
2665
  case "text":
2601
- shape[key] = z23.string().min(field.minLength).max(field.maxLength).default(field.default);
2666
+ shape[key] = textSettingSchema(field).default(field.default);
2602
2667
  break;
2603
2668
  case "integer":
2604
2669
  shape[key] = z23.number().int().min(field.min).max(field.max).default(field.default);
@@ -3107,7 +3172,13 @@ var questDescriptionSchema = z28.object({
3107
3172
  * Milliseconds a member waits after an attempt is rejected (by the evaluator or a reviewer)
3108
3173
  * before submitting this quest again. Only for quests members submit. Omitted: no cooldown.
3109
3174
  */
3110
- retryCooldownMs: retryCooldownMsSchema.optional()
3175
+ retryCooldownMs: retryCooldownMsSchema.optional(),
3176
+ /**
3177
+ * Milliseconds a member waits after an accepted completion of this quest, of any key, before
3178
+ * submitting it again. Only for repeatable quests members submit; same bounds as
3179
+ * `retryCooldownMs`. Omitted: no cooldown.
3180
+ */
3181
+ completionCooldownMs: retryCooldownMsSchema.optional()
3111
3182
  }).strict();
3112
3183
  var artifactSchema = z28.object({ code: z28.string().min(1).max(1e6) }).strict();
3113
3184
  var releaseSchema = artifactSchema.extend({
@@ -3522,6 +3593,15 @@ var memberProgressSchema = responseShape(
3522
3593
  * `retry-cooldown`. Absent when no cooldown is running.
3523
3594
  */
3524
3595
  retryAt: z28.number().int().safe().optional(),
3596
+ /**
3597
+ * Unix milliseconds when the member may next submit the quest, while it waits on something
3598
+ * that ends by itself: the retry cooldown after a rejection, the completion cooldown after
3599
+ * an accepted completion, an exhausted budget's next reset, or the next window of a counter
3600
+ * that pays once per window. The latest of these when
3601
+ * several apply; use it for countdowns. Absent when the member can submit now, or when
3602
+ * nothing will reopen the quest (a used-up lifetime budget, a closed window).
3603
+ */
3604
+ nextAvailableAt: z28.number().int().safe().optional(),
3525
3605
  attempt: attemptSchema.nullable()
3526
3606
  })
3527
3607
  ),
@@ -3558,7 +3638,10 @@ var errorSchema = z28.object({
3558
3638
  /** Which window refused admission when `code` is `outside-window`. */
3559
3639
  window: z28.enum(["tracker", "quest"]).optional(),
3560
3640
  missing: z28.array(missingPrerequisiteSchema).optional(),
3561
- /** Unix milliseconds when the member may submit again, when `code` is `retry-cooldown`. */
3641
+ /**
3642
+ * Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
3643
+ * `completion-cooldown`.
3644
+ */
3562
3645
  retryAt: z28.number().int().safe().optional()
3563
3646
  });
3564
3647
  var staffDecisionSchema = z28.object({
@@ -3810,6 +3893,8 @@ export {
3810
3893
  completionPolicySchema,
3811
3894
  completionKeySchema,
3812
3895
  budgetSchema,
3896
+ memberCompletionSchema,
3897
+ maxMemberCompletions,
3813
3898
  evaluatorIntegrationProviderSchema,
3814
3899
  integrationProviderSchema,
3815
3900
  discordServerSchema,
@@ -3856,6 +3941,10 @@ export {
3856
3941
  settingFieldSchema,
3857
3942
  settingsFieldsSchema,
3858
3943
  settingsValuesSchema,
3944
+ isAmount,
3945
+ isBalanceChain,
3946
+ isBoundSetting,
3947
+ textSettingSchema,
3859
3948
  parseSettings,
3860
3949
  missingResourceSettings,
3861
3950
  compatibleSettingKinds,
@@ -4,10 +4,10 @@ import {
4
4
  imageFieldsSchema,
5
5
  imageInspectionSchema,
6
6
  imageSightingsSchema
7
- } from "./chunk-K6TVMNU4.js";
7
+ } from "./chunk-YEVD4A5X.js";
8
8
  import {
9
9
  photoResultSchema
10
- } from "./chunk-IELNFM3V.js";
10
+ } from "./chunk-YCOKTQ4E.js";
11
11
 
12
12
  // src/image-results.ts
13
13
  import * as z from "zod";
@@ -2,7 +2,7 @@ import {
2
2
  identifier,
3
3
  responseShape,
4
4
  xTweetSchema
5
- } from "./chunk-IELNFM3V.js";
5
+ } from "./chunk-YCOKTQ4E.js";
6
6
 
7
7
  // src/x.ts
8
8
  import * as z from "zod";
@@ -1,12 +1,12 @@
1
- import { y as referralAcceptSchema, i as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, o as PointHistoryQuery, m as PointEntryKind, f as LeaderboardHistoryQuery, z as engagementPageQuerySchema } from './groups-B5R1RCsl.js';
2
- import { j as QuestView, k as ResponseSchema, a as PageQuery, c as QuestEnrollmentInput, Q as QuestClaimInput, g as QuestOutcomeQuery, q as questExperienceSchema, l as RewardDeliveryQuery, m as RewardDeliveryAction, n as contentQualificationQuerySchema } from './pages-BTlOg8sl.js';
3
- import { M as MissingPrerequisite, V as ValueEvidence } from './submission-input-BNah53go.js';
1
+ import { m as QuizEvidence, A as Attempt, M as MemberProgress, a as AttemptStatus, o as TrackerSkipCode, i as PointHistoryQuery, g as PointEntryKind, ao as submitSchema, ap as contentPerformanceQuerySchema } from './schema-C4m9RhCR.js';
2
+ import { j as QuestView, k as ResponseSchema, a as PageQuery, c as QuestEnrollmentInput, Q as QuestClaimInput, g as QuestOutcomeQuery, q as questExperienceSchema, l as RewardDeliveryQuery, m as RewardDeliveryAction, n as contentQualificationQuerySchema } from './pages-BFloMpyQ.js';
3
+ import { M as MissingPrerequisite, V as ValueEvidence } from './submission-input-BbdawqVy.js';
4
4
  import { a as RequestError, b as RequestErrorDetails, c as RequestErrorKind, e as createRelayAction, O as OptionalActionId } from './action-DBzILFx9.js';
5
- import { f as QuizEvidence, A as Attempt, M as MemberProgress, a as AttemptStatus, h as TrackerSkipCode, ae as submitSchema, af as contentPerformanceQuerySchema } from './schema-BJ9bOgpN.js';
6
5
  import { b as ParticipantSession, e as exchangeSchema, R as RelayEvent, P as ParticipantActivity } from './participant-activity-iciCEs_8.js';
7
6
  import * as z from 'zod';
8
7
  import { a as AuthProvider } from './accounts-DRPENuZe.js';
9
- import { p as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-Cdv4BSd_.js';
8
+ import { p as referralAcceptSchema, i as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, f as LeaderboardHistoryQuery, q as engagementPageQuerySchema } from './groups-O6onGPmC.js';
9
+ import { p as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-BoOK03cR.js';
10
10
  import { w as walletAddressInputSchema, o as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-Ac7OFpOr.js';
11
11
 
12
12
  /** What happened, as in every Domino client error (see `RequestError`). */
@@ -59,6 +59,11 @@ declare const RelayErrorCode: {
59
59
  * says when they may submit again.
60
60
  */
61
61
  readonly RetryCooldown: "retry-cooldown";
62
+ /**
63
+ * The member's last accepted completion of the quest is more recent than its completion
64
+ * cooldown; `retryAt` says when they may submit again.
65
+ */
66
+ readonly CompletionCooldown: "completion-cooldown";
62
67
  /** The quiz changed since the member answered it. */
63
68
  readonly StaleQuiz: "stale-quiz";
64
69
  /** Relay refused the submitted evidence. */
@@ -115,7 +120,10 @@ type RelayErrorDetails = RequestErrorDetails & {
115
120
  /** Which window refused admission when `code` is `outside-window`. */
116
121
  window?: "tracker" | "quest";
117
122
  missing?: MissingPrerequisite[];
118
- /** Unix milliseconds when the member may submit again, when `code` is `retry-cooldown`. */
123
+ /**
124
+ * Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
125
+ * `completion-cooldown`.
126
+ */
119
127
  retryAt?: number;
120
128
  };
121
129
  declare const relayErrorBrand: unique symbol;
@@ -134,7 +142,10 @@ declare class RelayError extends RequestError {
134
142
  readonly window: "tracker" | "quest" | undefined;
135
143
  /** Prerequisites the member does not currently meet, when Relay refused for that reason. */
136
144
  readonly missing: MissingPrerequisite[];
137
- /** Unix milliseconds when the member may submit again, when `code` is `retry-cooldown`. */
145
+ /**
146
+ * Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
147
+ * `completion-cooldown`.
148
+ */
138
149
  readonly retryAt: number | undefined;
139
150
  constructor(message: string, details: RelayErrorDetails);
140
151
  }
@@ -1217,6 +1228,15 @@ declare function relayClient(options: RelayClientOptions): {
1217
1228
  amount: number;
1218
1229
  })[];
1219
1230
  }[];
1231
+ pool?: {
1232
+ amount: string;
1233
+ unit: "points" | {
1234
+ code: string;
1235
+ decimals: number;
1236
+ };
1237
+ ledger?: string | undefined;
1238
+ minScore?: number | undefined;
1239
+ } | undefined;
1220
1240
  } | undefined;
1221
1241
  }[]>;
1222
1242
  standings: (board: string, query?: LeaderboardQuery, requestOptions?: RelayRequestOptions) => Promise<{
@@ -1364,6 +1384,7 @@ declare function relayClient(options: RelayClientOptions): {
1364
1384
  options: {
1365
1385
  provider: "discord" | "google" | "x";
1366
1386
  name: string | null;
1387
+ givenName: string | null;
1367
1388
  imageUrl: string | null;
1368
1389
  }[];
1369
1390
  }>;
@@ -1398,6 +1419,7 @@ declare function relayClient(options: RelayClientOptions): {
1398
1419
  options: {
1399
1420
  provider: "discord" | "google" | "x";
1400
1421
  name: string | null;
1422
+ givenName: string | null;
1401
1423
  imageUrl: string | null;
1402
1424
  }[];
1403
1425
  }>;
@@ -1434,6 +1456,7 @@ declare function relayClient(options: RelayClientOptions): {
1434
1456
  options: {
1435
1457
  provider: "discord" | "google" | "x";
1436
1458
  name: string | null;
1459
+ givenName: string | null;
1437
1460
  imageUrl: string | null;
1438
1461
  }[];
1439
1462
  }>;
@@ -1899,6 +1922,7 @@ declare function relayClient(options: RelayClientOptions): {
1899
1922
  } | null;
1900
1923
  } | null | undefined;
1901
1924
  retryAt?: number | undefined;
1925
+ nextAvailableAt?: number | undefined;
1902
1926
  }>;
1903
1927
  /**
1904
1928
  * Enrolls the signed-in member in a quest whose tracker trigger requires enrollment. Activity
@@ -2586,6 +2610,7 @@ declare function relayClient(options: RelayClientOptions): {
2586
2610
  } | null;
2587
2611
  } | null | undefined;
2588
2612
  retryAt?: number | undefined;
2613
+ nextAvailableAt?: number | undefined;
2589
2614
  }[];
2590
2615
  collections: {
2591
2616
  id: string;
@@ -2999,6 +3024,7 @@ declare function relayClient(options: RelayClientOptions): {
2999
3024
  } | null;
3000
3025
  } | null | undefined;
3001
3026
  retryAt?: number | undefined;
3027
+ nextAvailableAt?: number | undefined;
3002
3028
  }[];
3003
3029
  key?: string | undefined;
3004
3030
  description?: string | undefined;
@@ -3418,6 +3444,7 @@ declare function relayClient(options: RelayClientOptions): {
3418
3444
  } | null;
3419
3445
  } | null | undefined;
3420
3446
  retryAt?: number | undefined;
3447
+ nextAvailableAt?: number | undefined;
3421
3448
  }[];
3422
3449
  key?: string | undefined;
3423
3450
  description?: string | undefined;
@@ -4224,6 +4251,7 @@ declare function relayClient(options: RelayClientOptions): {
4224
4251
  } | null;
4225
4252
  } | null | undefined;
4226
4253
  retryAt?: number | undefined;
4254
+ nextAvailableAt?: number | undefined;
4227
4255
  }[];
4228
4256
  entitlements: ({
4229
4257
  [x: string]: unknown;