@domino-sdk/relay 1.62.0 → 1.63.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 (74) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/dist/{accounts-CCqCKCVx.d.ts → accounts-nz3mzfRQ.d.ts} +21 -3
  3. package/dist/{attempt-captures-Cm-5G0PC.d.ts → attempt-captures-DMi8oR9T.d.ts} +1 -1
  4. package/dist/authoring.d.ts +54 -20
  5. package/dist/authoring.js +58 -24
  6. package/dist/{automatic-outcomes-pAsOyIVp.d.ts → automatic-outcomes-C_LLQU1p.d.ts} +11 -1
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +9 -9
  9. package/dist/browser.js +15 -13
  10. package/dist/capability-error-CuI_F7yM.d.ts +296 -0
  11. package/dist/{catalog--ZIlskAo.d.ts → catalog-BaTOKpNw.d.ts} +21 -10
  12. package/dist/{chunk-3PYYGFSB.js → chunk-3RFP6GT5.js} +3 -3
  13. package/dist/{chunk-HTZHBTIL.js → chunk-4GQW43UU.js} +193 -357
  14. package/dist/{chunk-D26YNACF.js → chunk-4NOFSGAL.js} +56 -56
  15. package/dist/{chunk-UW5232GG.js → chunk-5XLZ34PV.js} +5 -5
  16. package/dist/{chunk-QYPMPWVX.js → chunk-7X67QLPB.js} +43 -43
  17. package/dist/{chunk-5TEYFX6X.js → chunk-7Z4SZ6YM.js} +2 -2
  18. package/dist/{chunk-Y322OTCH.js → chunk-AQOL3SK5.js} +1 -1
  19. package/dist/{chunk-CICDIBOF.js → chunk-EHUSD3O2.js} +76 -72
  20. package/dist/chunk-FO2LCZTL.js +19 -0
  21. package/dist/{chunk-3KLC4AMA.js → chunk-FU5CGNTR.js} +135 -173
  22. package/dist/{chunk-K2KS3JLY.js → chunk-GLH6MEI2.js} +7 -2
  23. package/dist/chunk-ICXZZNPS.js +199 -0
  24. package/dist/{chunk-MK425RXJ.js → chunk-ID3BZXFZ.js} +709 -640
  25. package/dist/{chunk-UAKYDVT3.js → chunk-KP2MCX3R.js} +111 -89
  26. package/dist/{chunk-GKIFABGN.js → chunk-LZWXCBUB.js} +74 -247
  27. package/dist/{chunk-6WCIWXUV.js → chunk-MTKRIQEU.js} +2 -2
  28. package/dist/{chunk-4OC7REYX.js → chunk-MWMCQLCG.js} +3 -3
  29. package/dist/{chunk-XJFYAXET.js → chunk-N4BDKS6Y.js} +19 -19
  30. package/dist/{chunk-E6IKQHTX.js → chunk-N4LNEGQX.js} +2 -2
  31. package/dist/chunk-NQDEWJWE.js +554 -0
  32. package/dist/{chunk-GTDW453U.js → chunk-QR6HH4DI.js} +100 -114
  33. package/dist/chunk-TLSQETTY.js +41 -0
  34. package/dist/{chunk-CZFXGGEK.js → chunk-U66GUVSG.js} +2 -2
  35. package/dist/{chunk-KDR2VAJP.js → chunk-UYVJZR33.js} +2 -2
  36. package/dist/chunk-UZ765UGH.js +18 -0
  37. package/dist/{chunk-XNKSSE32.js → chunk-VWQGWGCH.js} +7 -7
  38. package/dist/{chunk-WSBYWVTZ.js → chunk-W7YSMSGC.js} +166 -158
  39. package/dist/{client-B-hbHX30.d.ts → client-DHmG7rn6.d.ts} +25 -61
  40. package/dist/{capability-error-DFMwSuSf.d.ts → dashboards-CLemT6kj.d.ts} +14 -294
  41. package/dist/{deployments-M4OHn7G3.d.ts → deployments-DTULi7dF.d.ts} +46 -3
  42. package/dist/{identity-integration-3mX6b5iH.d.ts → identity-integration-DOeNZaxF.d.ts} +32 -2
  43. package/dist/index.d.ts +10 -10
  44. package/dist/index.js +13 -11
  45. package/dist/internal.d.ts +27 -13
  46. package/dist/internal.js +41 -13
  47. package/dist/{analytics-BwAKLi7O.d.ts → limits-kNzYdZ00.d.ts} +124 -3
  48. package/dist/{offers-DhAtss4_.d.ts → offers-CYeN_I0Y.d.ts} +3 -2
  49. package/dist/portal-proxy.d.ts +19 -3
  50. package/dist/portal-proxy.js +64 -22
  51. package/dist/react/index.d.ts +21 -14
  52. package/dist/react/index.js +55 -29
  53. package/dist/{pages-B8q8Y_dQ.d.ts → reward-deliveries-drp-x1G-.d.ts} +300 -233
  54. package/dist/runtime/authoring.js +1 -1
  55. package/dist/runtime/chunks/UGDV5W4N.js +1 -0
  56. package/dist/runtime/manifest.json +3 -3
  57. package/dist/runtime/schema.js +1 -1
  58. package/dist/schema.d.ts +193 -18
  59. package/dist/schema.js +31 -26
  60. package/dist/server/index.d.ts +13 -13
  61. package/dist/server/index.js +5885 -6224
  62. package/dist/{sign-in-providers-BkjcDsFF.d.ts → sign-in-providers-B1Q9eDRm.d.ts} +7 -2
  63. package/dist/{submission-input-DHGKhXfp.d.ts → submission-input-DZCbjQUH.d.ts} +3 -2
  64. package/dist/{telegram-browser-BCE7zdOb.d.ts → telegram-browser-NL0Asmsi.d.ts} +4 -4
  65. package/dist/telegram.d.ts +8 -8
  66. package/dist/telegram.js +2 -2
  67. package/dist/testing.d.ts +228 -26
  68. package/dist/testing.js +137 -92
  69. package/dist/{tracker-data-Hb1uQnk5.d.ts → tracker-data-esm3WG8R.d.ts} +34 -8
  70. package/dist/{transport-DkhX2Cbs.d.ts → transport-Czht_irp.d.ts} +41259 -39835
  71. package/dist/{wallet-DTO7SXj7.d.ts → wallet-B7e06v4m.d.ts} +14 -4
  72. package/package.json +1 -1
  73. package/dist/chunk-UPQPUJOU.js +0 -457
  74. package/dist/runtime/chunks/Y4OAVXFR.js +0 -1
package/dist/authoring.js CHANGED
@@ -3,34 +3,38 @@ import {
3
3
  parseUnits
4
4
  } from "./chunk-V7UKZLHA.js";
5
5
  import {
6
- defineDashboard,
7
6
  tiktokVideoBodySchema,
8
7
  tiktokVideoMetrics,
9
8
  youtubeShortBodySchema,
10
9
  youtubeShortMetrics
11
- } from "./chunk-3KLC4AMA.js";
10
+ } from "./chunk-TLSQETTY.js";
12
11
  import {
13
12
  CapabilityError,
14
13
  capabilityErrorCodes
15
- } from "./chunk-4OC7REYX.js";
14
+ } from "./chunk-MWMCQLCG.js";
16
15
  import {
17
16
  sourceDataSchema,
18
17
  sourceRoles,
19
18
  validateQuestShape
20
- } from "./chunk-5TEYFX6X.js";
19
+ } from "./chunk-7Z4SZ6YM.js";
20
+ import {
21
+ defineDashboard
22
+ } from "./chunk-FU5CGNTR.js";
21
23
  import {
22
24
  engagementDefinitionSchema,
23
25
  engagementScoreInputSchema,
24
26
  engagementScoreSchema,
25
27
  offerAuthoringSchema,
26
- parseDefinition,
27
28
  referralAuthoringSchema
28
- } from "./chunk-GTDW453U.js";
29
+ } from "./chunk-QR6HH4DI.js";
29
30
  import {
30
31
  badgeDeclarationSchema,
31
32
  leaderboardAuthoringSchema,
32
33
  pointLedgerDeclarationSchema
33
- } from "./chunk-WSBYWVTZ.js";
34
+ } from "./chunk-W7YSMSGC.js";
35
+ import {
36
+ parseDefinition
37
+ } from "./chunk-FO2LCZTL.js";
34
38
  import {
35
39
  announcementSchema,
36
40
  authorBudgetSchema,
@@ -72,6 +76,7 @@ import {
72
76
  isSolanaProgram,
73
77
  ledgerKey,
74
78
  ledgerSettingSchema,
79
+ limits,
75
80
  maxWalletEventLogs,
76
81
  maxWalletEventLookback,
77
82
  maxWalletTransactionLookback,
@@ -122,8 +127,8 @@ import {
122
127
  whereSettings,
123
128
  xSearchSourceSchema,
124
129
  youtubeShortsNamespace
125
- } from "./chunk-MK425RXJ.js";
126
- import "./chunk-K2KS3JLY.js";
130
+ } from "./chunk-ID3BZXFZ.js";
131
+ import "./chunk-GLH6MEI2.js";
127
132
 
128
133
  // src/builders.ts
129
134
  import * as z from "zod";
@@ -199,21 +204,21 @@ var questCompleted = (quest) => ({
199
204
  kind: "quest",
200
205
  quest
201
206
  });
202
- var offerBuilderSchema = offerAuthoringSchema.superRefine(
207
+ var offerBuilderSchema = /* @__PURE__ */ (() => offerAuthoringSchema.superRefine(
203
208
  (offer, context) => {
204
209
  const message = questOnlyRewardError(offer.reward, "offers");
205
210
  if (message) {
206
211
  context.addIssue({ code: "custom", message, path: ["reward"] });
207
212
  }
208
213
  }
209
- );
214
+ ))();
210
215
  function defineOffer(input) {
211
216
  return resourceHandle(
212
217
  "offer",
213
218
  parseDefinition("Offer", offerBuilderSchema, input)
214
219
  );
215
220
  }
216
- var referralBuilderSchema = referralAuthoringSchema.superRefine(
221
+ var referralBuilderSchema = /* @__PURE__ */ (() => referralAuthoringSchema.superRefine(
217
222
  (referral, context) => {
218
223
  for (const side of ["inviter", "invitee"]) {
219
224
  refuseQuestOnlyRewards(
@@ -232,7 +237,7 @@ var referralBuilderSchema = referralAuthoringSchema.superRefine(
232
237
  );
233
238
  }
234
239
  }
235
- );
240
+ ))();
236
241
  function defineReferral(input) {
237
242
  const { qualification, inviterGroup, milestones, bonuses, ...properties } = input;
238
243
  const definition = parseDefinition("Referral", referralBuilderSchema, {
@@ -255,7 +260,7 @@ function defineReferral(input) {
255
260
  function earned(options = {}) {
256
261
  return { kind: "earned", ...options };
257
262
  }
258
- var leaderboardBuilderSchema = leaderboardAuthoringSchema.superRefine(
263
+ var leaderboardBuilderSchema = /* @__PURE__ */ (() => leaderboardAuthoringSchema.superRefine(
259
264
  (board, context) => {
260
265
  for (const [index, prize] of (board.settle?.prizes ?? []).entries()) {
261
266
  refuseQuestOnlyRewards(
@@ -266,7 +271,14 @@ var leaderboardBuilderSchema = leaderboardAuthoringSchema.superRefine(
266
271
  );
267
272
  }
268
273
  }
269
- );
274
+ ))();
275
+ function leaderboardTiesWarning(board) {
276
+ const live = board.ties ?? "shared";
277
+ if (!board.settle || board.settle.ties === live) {
278
+ return null;
279
+ }
280
+ return `Leaderboard${board.key ? ` "${board.key}"` : ""} orders equal scores "${live}" in its live standings${board.ties === void 0 ? " (ties left out)" : ""} but "${board.settle.ties}" when it settles, so the ranks members see are not the ranks prizes pay. Set ties: "${board.settle.ties}" beside settle.ties to show the order prizes pay.`;
281
+ }
270
282
  function defineLeaderboard(input) {
271
283
  const { ledger, group, score, settle, ...properties } = input;
272
284
  const pool = settle?.pool;
@@ -288,6 +300,10 @@ function defineLeaderboard(input) {
288
300
  ...group ? { group: identifier.parse(group.key) } : {},
289
301
  score: score?.kind === "earned" ? { ...score, quests: score.quests?.map((quest) => quest.key) } : score
290
302
  });
303
+ const ties = leaderboardTiesWarning(definition);
304
+ if (ties) {
305
+ console.warn(ties);
306
+ }
291
307
  return resourceHandle("leaderboard", definition);
292
308
  }
293
309
  var x = {
@@ -553,17 +569,25 @@ var settings = {
553
569
  quizContentSchema.default(value).meta({ ...options, default: value, kind: "quiz" })
554
570
  );
555
571
  },
572
+ /**
573
+ * Free text. With `secret: true`, operators set the value in Console and it never leaves Relay:
574
+ * management responses, `domino deploy` and Console withhold it, and the quest's code reads it as
575
+ * usual. A secret setting has no default, so it reads `""` until an operator sets it.
576
+ */
556
577
  text(options) {
578
+ const { secret, ...rest } = options;
557
579
  const field = {
558
- ...options,
580
+ ...rest,
559
581
  kind: "text",
560
- minLength: options.minLength ?? 1,
582
+ default: "default" in options ? options.default : "",
583
+ minLength: options.minLength ?? (secret ? 0 : 1),
561
584
  maxLength: options.maxLength ?? 2e3,
562
- multiline: options.multiline ?? false
585
+ multiline: options.multiline ?? false,
586
+ ...secret ? { secret } : {}
563
587
  };
564
588
  return setting(
565
589
  "text",
566
- z.string().min(field.minLength).max(field.maxLength).default(field.default).meta(field)
590
+ textSettingSchema(field).default(field.default).meta(field)
567
591
  );
568
592
  },
569
593
  /**
@@ -833,8 +857,8 @@ function manual(options) {
833
857
  ...options?.actor ? { actor: options.actor } : {}
834
858
  };
835
859
  }
836
- var triggerDataSchemas = /* @__PURE__ */ new WeakMap();
837
- var triggerContentMetrics = /* @__PURE__ */ new WeakMap();
860
+ var triggerDataSchemas = /* @__PURE__ */ (() => /* @__PURE__ */ new WeakMap())();
861
+ var triggerContentMetrics = /* @__PURE__ */ (() => /* @__PURE__ */ new WeakMap())();
838
862
  function trackerTrigger(input, constructor) {
839
863
  const {
840
864
  tracker,
@@ -877,7 +901,10 @@ function trackerTrigger(input, constructor) {
877
901
  tracker: tracker.key,
878
902
  source: source.kind,
879
903
  // A content item is decided by its first observation; later observations run its stage.
880
- on: content2 ? "new-record" : on ?? defaultTriggerMode(source.kind),
904
+ on: content2 ? "new-record" : on ?? defaultTriggerMode(
905
+ source.kind,
906
+ source.kind === "custom" ? source.namespace : void 0
907
+ ),
881
908
  ...where ? { where } : {},
882
909
  beneficiary,
883
910
  // Defaults are left out too: "none", "activation", and "staff" ("claim" on content).
@@ -1098,6 +1125,11 @@ function questBuilder(template) {
1098
1125
  `Setting "${key2}" is not a quest setting: build it with a settings builder, such as settings.integer({ label, default, min, max })`
1099
1126
  );
1100
1127
  }
1128
+ if (field.data.kind === "text" && field.data.secret && field.data.default !== "") {
1129
+ throw new Error(
1130
+ `Secret setting "${key2}" must default to "": set its value in Console, not in source or deploy settings`
1131
+ );
1132
+ }
1101
1133
  return [key2, field.data];
1102
1134
  })
1103
1135
  );
@@ -1309,8 +1341,8 @@ function ignoredCompletionKey(completion, key) {
1309
1341
  return `progress(...) keys each contribution with its distinct(...) and ${ignored}: derive the key in distinct(...)`;
1310
1342
  }
1311
1343
  }
1312
- var defineQuest = questBuilder(false);
1313
- var defineQuestType = questBuilder(true);
1344
+ var defineQuest = /* @__PURE__ */ (() => questBuilder(false))();
1345
+ var defineQuestType = /* @__PURE__ */ (() => questBuilder(true))();
1314
1346
  export {
1315
1347
  CapabilityError,
1316
1348
  automatic,
@@ -1355,6 +1387,8 @@ export {
1355
1387
  isNftCollection,
1356
1388
  isSolanaProgram,
1357
1389
  keyed,
1390
+ leaderboardTiesWarning,
1391
+ limits,
1358
1392
  manual,
1359
1393
  maxWalletEventLogs,
1360
1394
  maxWalletEventLookback,
@@ -1,5 +1,6 @@
1
1
  import * as z from 'zod';
2
- import { b as AttemptStatus, X as RewardType } from './accounts-CCqCKCVx.js';
2
+ import { b as AttemptStatus, X as RewardType } from './accounts-nz3mzfRQ.js';
3
+ import { S as SkipEnrollment } from './tracker-data-esm3WG8R.js';
3
4
 
4
5
  declare const collectionCodeSchema: z.ZodString;
5
6
  declare const collectionPassSchema: z.ZodObject<{
@@ -472,6 +473,7 @@ declare const automaticOutcomeSchema: z.ZodUnion<readonly [z.ZodObject<{
472
473
  quest: "quest";
473
474
  tracker: "tracker";
474
475
  }>>;
476
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
475
477
  revision: z.ZodNumber;
476
478
  createdAt: z.ZodNumber;
477
479
  updatedAt: z.ZodNumber;
@@ -518,6 +520,7 @@ declare const automaticOutcomeSchema: z.ZodUnion<readonly [z.ZodObject<{
518
520
  quest: "quest";
519
521
  tracker: "tracker";
520
522
  }>>;
523
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
521
524
  revision: z.ZodNumber;
522
525
  createdAt: z.ZodNumber;
523
526
  updatedAt: z.ZodNumber;
@@ -578,6 +581,7 @@ declare const automaticOutcomePageSchema: z.ZodObject<{
578
581
  quest: "quest";
579
582
  tracker: "tracker";
580
583
  }>>;
584
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
581
585
  revision: z.ZodNumber;
582
586
  createdAt: z.ZodNumber;
583
587
  updatedAt: z.ZodNumber;
@@ -624,6 +628,7 @@ declare const automaticOutcomePageSchema: z.ZodObject<{
624
628
  quest: "quest";
625
629
  tracker: "tracker";
626
630
  }>>;
631
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
627
632
  revision: z.ZodNumber;
628
633
  createdAt: z.ZodNumber;
629
634
  updatedAt: z.ZodNumber;
@@ -678,6 +683,7 @@ declare const automaticCatchUpPreviewSchema: z.ZodObject<{
678
683
  quest: "quest";
679
684
  tracker: "tracker";
680
685
  }>>;
686
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
681
687
  revision: z.ZodNumber;
682
688
  createdAt: z.ZodNumber;
683
689
  updatedAt: z.ZodNumber;
@@ -724,6 +730,7 @@ declare const automaticCatchUpPreviewSchema: z.ZodObject<{
724
730
  quest: "quest";
725
731
  tracker: "tracker";
726
732
  }>>;
733
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
727
734
  revision: z.ZodNumber;
728
735
  createdAt: z.ZodNumber;
729
736
  updatedAt: z.ZodNumber;
@@ -734,6 +741,7 @@ declare const automaticCatchUpPreviewSchema: z.ZodObject<{
734
741
  quest: "quest";
735
742
  tracker: "tracker";
736
743
  }>>;
744
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
737
745
  attempt: z.ZodNullable<z.ZodString>;
738
746
  wouldAdmit: z.ZodBoolean;
739
747
  budgets: z.ZodArray<z.ZodObject<{
@@ -840,6 +848,7 @@ declare const automaticCatchUpResultSchema: z.ZodObject<{
840
848
  quest: "quest";
841
849
  tracker: "tracker";
842
850
  }>>;
851
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
843
852
  revision: z.ZodNumber;
844
853
  createdAt: z.ZodNumber;
845
854
  updatedAt: z.ZodNumber;
@@ -886,6 +895,7 @@ declare const automaticCatchUpResultSchema: z.ZodObject<{
886
895
  quest: "quest";
887
896
  tracker: "tracker";
888
897
  }>>;
898
+ enrollment: z.ZodOptional<z.ZodType<SkipEnrollment, unknown, z.core.$ZodTypeInternals<SkipEnrollment, unknown>>>;
889
899
  revision: z.ZodNumber;
890
900
  createdAt: z.ZodNumber;
891
901
  updatedAt: z.ZodNumber;
package/dist/avatar.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { P as ProfileAvatar, L as LinkedWallet } from './wallet-DTO7SXj7.js';
1
+ import { P as ProfileAvatar, L as LinkedWallet } from './wallet-B7e06v4m.js';
2
2
  import 'zod';
3
3
 
4
4
  /**
package/dist/browser.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-B-hbHX30.js';
2
- export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, P as ProviderSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-BCE7zdOb.js';
1
+ import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-DHmG7rn6.js';
2
+ export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, P as ProviderSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-NL0Asmsi.js';
3
3
  export { H as HostEnvironment, g as getHostEnvironment } from './host-environment-FN4zg3hw.js';
4
4
  import { M as MemberSummary } from './participant-activity-D-Drp24G.js';
5
- import './accounts-CCqCKCVx.js';
5
+ import './accounts-nz3mzfRQ.js';
6
6
  import 'zod';
7
- import './tracker-data-Hb1uQnk5.js';
8
- import './wallet-DTO7SXj7.js';
9
- import './pages-B8q8Y_dQ.js';
10
- import './submission-input-DHGKhXfp.js';
7
+ import './tracker-data-esm3WG8R.js';
8
+ import './wallet-B7e06v4m.js';
9
+ import './submission-input-DZCbjQUH.js';
11
10
  import './request-error-D_dUPLwo.js';
12
- import './catalog--ZIlskAo.js';
11
+ import './reward-deliveries-drp-x1G-.js';
12
+ import './catalog-BaTOKpNw.js';
13
13
  import './action-9Xl0StBg.js';
14
- import './sign-in-providers-BkjcDsFF.js';
14
+ import './sign-in-providers-B1Q9eDRm.js';
15
15
 
16
16
  /**
17
17
  * The member's time at the real instant `at` (default now), in epoch milliseconds: what an app
package/dist/browser.js CHANGED
@@ -12,24 +12,26 @@ import {
12
12
  signInOptions,
13
13
  solanaSigner,
14
14
  walletStandardSolanaSigner
15
- } from "./chunk-UW5232GG.js";
15
+ } from "./chunk-5XLZ34PV.js";
16
16
  import {
17
17
  telegramMiniAppInitData
18
18
  } from "./chunk-FWLQ5XCS.js";
19
- import "./chunk-GKIFABGN.js";
20
- import "./chunk-Y322OTCH.js";
21
- import "./chunk-6WCIWXUV.js";
22
- import "./chunk-CICDIBOF.js";
23
- import "./chunk-D26YNACF.js";
24
- import "./chunk-GTDW453U.js";
25
- import "./chunk-WSBYWVTZ.js";
19
+ import "./chunk-LZWXCBUB.js";
20
+ import "./chunk-AQOL3SK5.js";
21
+ import "./chunk-MTKRIQEU.js";
22
+ import "./chunk-EHUSD3O2.js";
23
+ import "./chunk-4NOFSGAL.js";
24
+ import "./chunk-QR6HH4DI.js";
25
+ import "./chunk-W7YSMSGC.js";
26
26
  import {
27
27
  getHostEnvironment
28
- } from "./chunk-KDR2VAJP.js";
29
- import "./chunk-3PYYGFSB.js";
30
- import "./chunk-XJFYAXET.js";
31
- import "./chunk-MK425RXJ.js";
32
- import "./chunk-K2KS3JLY.js";
28
+ } from "./chunk-UYVJZR33.js";
29
+ import "./chunk-ICXZZNPS.js";
30
+ import "./chunk-FO2LCZTL.js";
31
+ import "./chunk-3RFP6GT5.js";
32
+ import "./chunk-N4BDKS6Y.js";
33
+ import "./chunk-ID3BZXFZ.js";
34
+ import "./chunk-GLH6MEI2.js";
33
35
  export {
34
36
  browserSubmissionStore,
35
37
  cosmosChainList,
@@ -0,0 +1,296 @@
1
+ import * as z from 'zod';
2
+
3
+ declare const completionPolicySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
+ kind: z.ZodLiteral<"streak">;
5
+ days: z.ZodNumber;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ kind: z.ZodLiteral<"progress">;
8
+ goal: z.ZodObject<{
9
+ kind: z.ZodLiteral<"count">;
10
+ count: z.ZodNumber;
11
+ }, z.core.$strict>;
12
+ window: z.ZodDiscriminatedUnion<[z.ZodObject<{
13
+ kind: z.ZodLiteral<"lifetime">;
14
+ }, z.core.$strict>, z.ZodObject<{
15
+ kind: z.ZodLiteral<"calendar">;
16
+ period: z.ZodEnum<{
17
+ day: "day";
18
+ week: "week";
19
+ month: "month";
20
+ }>;
21
+ latenessMs: z.ZodDefault<z.ZodNumber>;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ kind: z.ZodLiteral<"rolling">;
24
+ durationMs: z.ZodNumber;
25
+ }, z.core.$strict>], "kind">;
26
+ repeat: z.ZodDefault<z.ZodEnum<{
27
+ repeat: "repeat";
28
+ once: "once";
29
+ }>>;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"once">;
32
+ }, z.core.$strict>, z.ZodObject<{
33
+ kind: z.ZodLiteral<"keyed">;
34
+ across: z.ZodOptional<z.ZodLiteral<"members">>;
35
+ }, z.core.$strict>], "kind">;
36
+ declare const completionKeySchema: z.ZodString;
37
+ declare const budgetSchema: z.ZodObject<{
38
+ id: z.ZodString;
39
+ scope: z.ZodEnum<{
40
+ member: "member";
41
+ project: "project";
42
+ }>;
43
+ period: z.ZodEnum<{
44
+ lifetime: "lifetime";
45
+ day: "day";
46
+ week: "week";
47
+ month: "month";
48
+ }>;
49
+ limit: z.ZodNumber;
50
+ cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
51
+ balance: z.ZodString;
52
+ }, z.core.$strict>]>;
53
+ }, z.core.$strict>;
54
+ type Budget = z.infer<typeof budgetSchema>;
55
+ /**
56
+ * A budget counted per tracker record author: the account that caused the record, such as a
57
+ * reaction's reactor, whether or not it belongs to a member. It caps what one person gives when a
58
+ * quest pays someone else. Only quests with a tracker trigger take one, in their `authorBudgets`.
59
+ */
60
+ declare const authorBudgetSchema: z.ZodObject<{
61
+ id: z.ZodString;
62
+ period: z.ZodEnum<{
63
+ lifetime: "lifetime";
64
+ day: "day";
65
+ week: "week";
66
+ month: "month";
67
+ }>;
68
+ limit: z.ZodNumber;
69
+ cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
70
+ balance: z.ZodString;
71
+ }, z.core.$strict>]>;
72
+ scope: z.ZodLiteral<"author">;
73
+ }, z.core.$strict>;
74
+ type AuthorBudget = z.infer<typeof authorBudgetSchema>;
75
+ /**
76
+ * One of the member's accepted, unrevoked quest completions, as `ctx.member.completions()` reads
77
+ * it. `quest` is the quest's key and `key` the completion key. `completedAt` is when it was
78
+ * recorded, in epoch milliseconds on the member's clock (a test member's advanced one); null for
79
+ * older completions recorded without a time.
80
+ */
81
+ declare const memberCompletionSchema: z.ZodObject<{
82
+ quest: z.ZodString;
83
+ key: z.ZodString;
84
+ completedAt: z.ZodNullable<z.ZodNumber>;
85
+ }, z.core.$strip>;
86
+ type MemberCompletion = z.infer<typeof memberCompletionSchema>;
87
+ /**
88
+ * The most completions one `ctx.member.completions()` call returns, and its default `limit`.
89
+ *
90
+ * @deprecated Use `limits.memberCompletions`, which a 1.x release can raise.
91
+ */
92
+ declare const maxMemberCompletions = 100;
93
+
94
+ declare const resourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
95
+ provider: z.ZodLiteral<"domino">;
96
+ resource: z.ZodLiteral<"point-ledger">;
97
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
98
+ provider: z.ZodLiteral<"discord">;
99
+ resource: z.ZodLiteral<"channel">;
100
+ types: z.ZodArray<z.ZodEnum<{
101
+ text: "text";
102
+ announcement: "announcement";
103
+ }>>;
104
+ postable: z.ZodOptional<z.ZodLiteral<true>>;
105
+ }, z.core.$strict>, z.ZodObject<{
106
+ provider: z.ZodLiteral<"discord">;
107
+ resource: z.ZodLiteral<"role">;
108
+ assignable: z.ZodDefault<z.ZodBoolean>;
109
+ }, z.core.$strict>]>]>;
110
+ type ResourceSource = z.infer<typeof resourceSourceSchema>;
111
+ declare const resourceRequestSchema: z.ZodObject<{
112
+ source: z.ZodUnion<readonly [z.ZodObject<{
113
+ provider: z.ZodLiteral<"domino">;
114
+ resource: z.ZodLiteral<"point-ledger">;
115
+ }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
116
+ provider: z.ZodLiteral<"discord">;
117
+ resource: z.ZodLiteral<"channel">;
118
+ types: z.ZodArray<z.ZodEnum<{
119
+ text: "text";
120
+ announcement: "announcement";
121
+ }>>;
122
+ postable: z.ZodOptional<z.ZodLiteral<true>>;
123
+ }, z.core.$strict>, z.ZodObject<{
124
+ provider: z.ZodLiteral<"discord">;
125
+ resource: z.ZodLiteral<"role">;
126
+ assignable: z.ZodDefault<z.ZodBoolean>;
127
+ }, z.core.$strict>]>]>;
128
+ query: z.ZodOptional<z.ZodString>;
129
+ cursor: z.ZodOptional<z.ZodString>;
130
+ ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
131
+ }, z.core.$strict>;
132
+ declare const resourceOptionsSchema: z.ZodObject<{
133
+ revision: z.ZodNumber;
134
+ options: z.ZodArray<z.ZodObject<{
135
+ id: z.ZodString;
136
+ label: z.ZodString;
137
+ description: z.ZodOptional<z.ZodString>;
138
+ group: z.ZodOptional<z.ZodString>;
139
+ disabledReason: z.ZodOptional<z.ZodString>;
140
+ }, z.core.$strip>>;
141
+ nextCursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
142
+ cursor: z.ZodNullable<z.ZodString>;
143
+ }, z.core.$strip>;
144
+ type ResourceOption = z.infer<typeof resourceOptionsSchema>["options"][number];
145
+
146
+ /**
147
+ * A YouTube Short's body, as `content()` quests read it in `ctx.tracker.content.body`. Every field
148
+ * is what YouTube reported when Relay last read the video.
149
+ *
150
+ * @compat output
151
+ */
152
+ declare const youtubeShortBodySchema: z.ZodObject<{
153
+ title: z.ZodString;
154
+ description: z.ZodString;
155
+ tags: z.ZodArray<z.ZodString>;
156
+ durationSeconds: z.ZodNumber;
157
+ publishedAt: z.ZodNumber;
158
+ }, z.core.$strip>;
159
+ type YouTubeShortBody = z.infer<typeof youtubeShortBodySchema>;
160
+ /** The counters a YouTube Short's samples measure. A counter YouTube hides is unknown, never zero. */
161
+ declare const youtubeShortMetrics: readonly ["views", "likes", "comments"];
162
+ type YouTubeShortMetric = (typeof youtubeShortMetrics)[number];
163
+
164
+ /**
165
+ * A TikTok video's body, as `content()` quests read it in `ctx.tracker.content.body`. Every field
166
+ * is what TikTok reported when Relay last read the video.
167
+ *
168
+ * @compat output
169
+ */
170
+ declare const tiktokVideoBodySchema: z.ZodObject<{
171
+ title: z.ZodString;
172
+ description: z.ZodString;
173
+ durationSeconds: z.ZodNumber;
174
+ width: z.ZodNumber;
175
+ height: z.ZodNumber;
176
+ createdAt: z.ZodNumber;
177
+ shareUrl: z.ZodString;
178
+ isAigc: z.ZodBoolean;
179
+ }, z.core.$strip>;
180
+ type TikTokVideoBody = z.infer<typeof tiktokVideoBodySchema>;
181
+ /** The counters a TikTok video's samples measure. A counter TikTok omits is unknown, never zero. */
182
+ declare const tiktokVideoMetrics: readonly ["views", "likes", "comments", "shares"];
183
+ type TikTokVideoMetric = (typeof tiktokVideoMetrics)[number];
184
+
185
+ /**
186
+ * An announcement's text, at most 1000 characters, with `{placeholder}`s (`announcementPlaceholders`)
187
+ * that Relay fills when it posts. `{{` and `}}` are literal braces.
188
+ */
189
+ declare const announcementTextSchema: z.ZodString;
190
+ /** An announcement Domino's bot posts in one of the project's connected Telegram chats. */
191
+ declare const telegramAnnouncementSchema: z.ZodObject<{
192
+ action: z.ZodLiteral<"post-message">;
193
+ text: z.ZodString;
194
+ replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
195
+ provider: z.ZodLiteral<"telegram">;
196
+ chat: z.ZodString;
197
+ }, z.core.$strict>;
198
+ /** An announcement Domino's bot posts in a channel of the project's connected Discord server. */
199
+ declare const discordAnnouncementSchema: z.ZodObject<{
200
+ action: z.ZodLiteral<"post-message">;
201
+ text: z.ZodString;
202
+ replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
203
+ provider: z.ZodLiteral<"discord">;
204
+ channel: z.ZodString;
205
+ }, z.core.$strict>;
206
+ /**
207
+ * A message Relay posts when a completion of the quest pays, after its rewards commit. A failed
208
+ * post never undoes the rewards. Build one with `telegram.postMessage()` or
209
+ * `discord.postMessage()`.
210
+ */
211
+ declare const announcementSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
212
+ action: z.ZodLiteral<"post-message">;
213
+ text: z.ZodString;
214
+ replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
215
+ provider: z.ZodLiteral<"telegram">;
216
+ chat: z.ZodString;
217
+ }, z.core.$strict>, z.ZodObject<{
218
+ action: z.ZodLiteral<"post-message">;
219
+ text: z.ZodString;
220
+ replyToTriggeringMessage: z.ZodOptional<z.ZodBoolean>;
221
+ provider: z.ZodLiteral<"discord">;
222
+ channel: z.ZodString;
223
+ }, z.core.$strict>], "provider">;
224
+ type Announcement = z.infer<typeof announcementSchema>;
225
+
226
+ /**
227
+ * Why an evaluator capability could not answer:
228
+ *
229
+ * - `not-linked`: the call needs a member account that is not linked, and its result cannot be
230
+ * null, such as an image check of the member's X profile picture. Readers of the member's own
231
+ * accounts return `null` instead.
232
+ * - `provider-unavailable`: the provider (X, Discord, a chain RPC, AI review) did not answer, or
233
+ * the project's integration cannot reach it.
234
+ * - `author-error`: the call cannot be answered as written: invalid input, an undeclared
235
+ * integration, an unknown tracker, a chain Relay does not read, a wallet the member never
236
+ * linked, or an image that does not exist.
237
+ *
238
+ * Later versions can add codes. Relay also sends codes this tuple does not list, as SDK 1.x keeps
239
+ * it fixed:
240
+ *
241
+ * - `integration-required`: the project's integration needs configuration before the call can
242
+ * answer.
243
+ * - `capability-limit`: the evaluation run already made its eight capability calls, which all
244
+ * capabilities share. Never retryable: the run makes the same calls again.
245
+ *
246
+ * Treat an unknown code as a failure its `message` explains.
247
+ */
248
+ declare const capabilityErrorCodes: readonly ["not-linked", "provider-unavailable", "author-error"];
249
+ /** @compat open */
250
+ type KnownCapabilityErrorCode = (typeof capabilityErrorCodes)[number];
251
+ /** A known code, or one a newer Relay added. */
252
+ type CapabilityErrorCode = KnownCapabilityErrorCode | (string & {});
253
+ /**
254
+ * A capability failure as it crosses the sandbox boundary and as Relay captures it. Open, so a
255
+ * newer Relay can add codes and fields without breaking an older evaluator or Worker.
256
+ */
257
+ declare const capabilityFailureSchema: z.ZodObject<{
258
+ code: z.ZodString;
259
+ message: z.ZodString;
260
+ retryable: z.ZodBoolean;
261
+ }, z.core.$loose>;
262
+ type CapabilityFailure = z.infer<typeof capabilityFailureSchema>;
263
+ /**
264
+ * Thrown by an evaluator capability (`ctx.x`, `ctx.discord`, `ctx.wallet`, `ctx.trackers`,
265
+ * `ctx.images`, `ctx.review`) that could not answer. A capability whose subject is missing (an
266
+ * account the member has not linked, a deleted post or message) returns `null` instead of
267
+ * throwing.
268
+ *
269
+ * Catch it to decide yourself; rethrow anything else. An uncaught retryable error makes Relay
270
+ * retry the attempt later; an uncaught one that is not retryable fails it.
271
+ *
272
+ * ```ts
273
+ * try {
274
+ * return (await ctx.x.follows({ userId })) ? decision.accept() : decision.reject({ reason })
275
+ * } catch (error) {
276
+ * if (error instanceof CapabilityError && error.code === "provider-unavailable")
277
+ * return decision.review({ reason: "X is unavailable" })
278
+ * throw error
279
+ * }
280
+ * ```
281
+ */
282
+ declare class CapabilityError extends Error {
283
+ readonly code: CapabilityErrorCode;
284
+ readonly retryable: boolean;
285
+ constructor(code: CapabilityErrorCode, message: string, options?: {
286
+ retryable?: boolean;
287
+ });
288
+ static [Symbol.hasInstance](value: unknown): boolean;
289
+ /**
290
+ * The error for a captured or transported failure. A code this SDK does not know is never
291
+ * retryable: nothing tells it a retry would help.
292
+ */
293
+ static from(failure: CapabilityFailure): CapabilityError;
294
+ }
295
+
296
+ export { type AuthorBudget as A, type Budget as B, CapabilityError as C, type KnownCapabilityErrorCode as K, type MemberCompletion as M, type ResourceSource as R, type TikTokVideoBody as T, type YouTubeShortBody as Y, type Announcement as a, type CapabilityErrorCode as b, type TikTokVideoMetric as c, type YouTubeShortMetric as d, capabilityErrorCodes as e, type CapabilityFailure as f, type ResourceOption as g, announcementSchema as h, announcementTextSchema as i, authorBudgetSchema as j, budgetSchema as k, capabilityFailureSchema as l, completionKeySchema as m, completionPolicySchema as n, discordAnnouncementSchema as o, maxMemberCompletions as p, memberCompletionSchema as q, resourceOptionsSchema as r, resourceRequestSchema as s, resourceSourceSchema as t, telegramAnnouncementSchema as u, tiktokVideoBodySchema as v, tiktokVideoMetrics as w, youtubeShortMetrics as x, youtubeShortBodySchema as y };