@domino-sdk/relay 1.69.0 → 1.71.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 (66) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/build.mjs +3 -0
  3. package/dist/{accounts-DD4gAOCe.d.ts → accounts-COLmXRbW.d.ts} +144 -13
  4. package/dist/{attempt-captures-CbuCmthd.d.ts → attempt-captures-CVl161qB.d.ts} +3 -2
  5. package/dist/authoring.d.ts +68 -25
  6. package/dist/authoring.js +15 -9
  7. package/dist/{automatic-outcomes-DE3vfi8g.d.ts → automatic-outcomes-5l68PGr1.d.ts} +2 -2
  8. package/dist/browser.d.ts +9 -9
  9. package/dist/browser.js +11 -9
  10. package/dist/{catalog-Cf3fHDNn.d.ts → catalog-BR3g-1H9.d.ts} +41 -2
  11. package/dist/{chunk-ME2KUAVJ.js → chunk-3KKRXN5E.js} +1 -1
  12. package/dist/{chunk-CQVKOD3B.js → chunk-74SMLZZ5.js} +723 -685
  13. package/dist/{chunk-CZ23KRVK.js → chunk-CVJTIVAP.js} +1 -1
  14. package/dist/{chunk-TCREFRPK.js → chunk-DDID5QX5.js} +153 -4
  15. package/dist/{chunk-WVK3G2J2.js → chunk-EMKYDGZ3.js} +1 -1
  16. package/dist/{chunk-2A3BJ262.js → chunk-FGZGL5PG.js} +1 -1
  17. package/dist/{chunk-GEVARKEV.js → chunk-GHBYWDEZ.js} +8 -1
  18. package/dist/{chunk-RKTMSTT7.js → chunk-HN7DE2UN.js} +2 -2
  19. package/dist/{chunk-LGGD7S5T.js → chunk-IDG2VPYG.js} +32 -6
  20. package/dist/{chunk-SWLW4VN3.js → chunk-KC4UB4ZX.js} +1 -1
  21. package/dist/{chunk-ODJGTFPY.js → chunk-KIRXE37T.js} +6 -6
  22. package/dist/{chunk-VAGGGB6B.js → chunk-MDSSIOBC.js} +58 -1
  23. package/dist/{chunk-BRROI4CH.js → chunk-OFSJYXGI.js} +12 -4
  24. package/dist/{chunk-LZXDYSUH.js → chunk-PYZSCFMJ.js} +4 -0
  25. package/dist/{chunk-UGM6DUB2.js → chunk-QMKTYPK6.js} +4 -3
  26. package/dist/{chunk-PO2ZDY27.js → chunk-TW4RABVS.js} +1 -1
  27. package/dist/{chunk-AZDZEQFK.js → chunk-UEVZ3TST.js} +29 -2
  28. package/dist/{chunk-DIXYVGXO.js → chunk-VFHLMNYV.js} +1 -1
  29. package/dist/{chunk-WNEQEDMU.js → chunk-W6DBNBMT.js} +2 -2
  30. package/dist/{client-6eSYOl8h.d.ts → client-B__hMWtK.d.ts} +104 -7
  31. package/dist/{dashboards-DCOAXL54.d.ts → dashboards-DXpjHnq-.d.ts} +3 -3
  32. package/dist/{deployments-BIfdCMd5.d.ts → deployments-CT2kQloT.d.ts} +199 -3
  33. package/dist/{identity-integration-BlfOn8rc.d.ts → identity-integration-ClX4oUAu.d.ts} +4 -4
  34. package/dist/index.d.ts +10 -10
  35. package/dist/index.js +7 -7
  36. package/dist/internal.d.ts +44 -26
  37. package/dist/internal.js +26 -50
  38. package/dist/{limits-Ctaeq23J.d.ts → limits-B7wbnWhd.d.ts} +1 -1
  39. package/dist/{offers-COqHGbHm.d.ts → offers-D4pyeY9b.d.ts} +2 -2
  40. package/dist/portal-proxy.d.ts +2 -2
  41. package/dist/portal-proxy.js +11 -10
  42. package/dist/react/index.d.ts +31 -12
  43. package/dist/react/index.js +116 -41
  44. package/dist/{reward-deliveries-DFhYGJdx.d.ts → reward-deliveries-HGpj1VFz.d.ts} +1 -1
  45. package/dist/runtime/authoring.js +1 -1
  46. package/dist/runtime/chunks/A7G5P76B.js +1 -0
  47. package/dist/runtime/manifest.json +3 -3
  48. package/dist/runtime/schema.js +1 -1
  49. package/dist/schema.d.ts +40 -16
  50. package/dist/schema.js +9 -7
  51. package/dist/server/index.d.ts +12 -12
  52. package/dist/server/index.js +944 -579
  53. package/dist/{sign-in-providers-C97mRNbG.d.ts → sign-in-providers-lbOXCF8N.d.ts} +2 -2
  54. package/dist/solana.d.ts +12 -12
  55. package/dist/solana.js +8 -8
  56. package/dist/{telegram-browser-gRMgGs7B.d.ts → station-check-in-qBiaftfE.d.ts} +89 -7
  57. package/dist/{submission-input-BD7nORuh.d.ts → submission-input-U4aIkJuT.d.ts} +2 -2
  58. package/dist/telegram.d.ts +7 -7
  59. package/dist/testing.d.ts +15 -11
  60. package/dist/testing.js +23 -12
  61. package/dist/{tracker-data-DQgX3FIc.d.ts → tracker-data-2BYXZjsN.d.ts} +3 -3
  62. package/dist/{transport-BLU8jrhg.d.ts → transport-fszraZPi.d.ts} +1736 -19
  63. package/dist/{wallet-CPAjrW4k.d.ts → wallet-BqswMAqZ.d.ts} +3 -1
  64. package/dist/{wallet-browser-BzPt_Qb5.d.ts → wallet-browser-B5r7u3xB.d.ts} +1 -1
  65. package/package.json +1 -1
  66. package/dist/runtime/chunks/HKAI5OQA.js +0 -1
@@ -279,6 +279,10 @@ function responseListSchema(schema) {
279
279
  import * as z4 from "zod";
280
280
  var pageCursorSchema = /* @__PURE__ */ (() => z4.string().min(1).max(4096))();
281
281
  var pageLimit = /* @__PURE__ */ (() => z4.coerce.number().int().min(1).max(100).optional())();
282
+ var booleanQuery = /* @__PURE__ */ (() => z4.union([
283
+ z4.boolean(),
284
+ z4.enum(["true", "false"]).transform((v) => v === "true")
285
+ ]))();
282
286
  var pageQuerySchema = /* @__PURE__ */ (() => z4.strictObject({
283
287
  cursor: pageCursorSchema.optional()
284
288
  }))();
@@ -568,6 +572,7 @@ function base58Bytes(value, length) {
568
572
  // src/wallet.ts
569
573
  import * as z7 from "zod";
570
574
  var solanaAddressSchema = /* @__PURE__ */ (() => z7.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/))();
575
+ var solanaAddressPattern = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
571
576
  var walletChainSchema = /* @__PURE__ */ (() => z7.enum(["solana", "eip155", "cosmos"]))();
572
577
  var cosmosNetworkPattern = /^cosmos:[-_a-zA-Z0-9]{1,32}$/;
573
578
  var cosmosNetworkSchema = /* @__PURE__ */ (() => z7.custom(
@@ -604,7 +609,11 @@ var solanaDevnet = "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
604
609
  function isSolanaNetwork(value) {
605
610
  return value === solanaMainnet || value === solanaDevnet;
606
611
  }
607
- var evmAddressSchema = /* @__PURE__ */ (() => z7.string().regex(/^0x[0-9a-fA-F]{40}$/))();
612
+ var evmAddressPattern = /^0x[0-9a-fA-F]{40}$/;
613
+ function isEvmAddress(value) {
614
+ return evmAddressPattern.test(value);
615
+ }
616
+ var evmAddressSchema = /* @__PURE__ */ (() => z7.string().regex(evmAddressPattern))();
608
617
  var cosmosAddressSchema = /* @__PURE__ */ (() => z7.string().min(8).max(90).regex(
609
618
  /^(?:[a-z][a-z0-9]{0,82}1[02-9ac-hj-np-z]{38,}|[A-Z][A-Z0-9]{0,82}1[02-9AC-HJ-NP-Z]{38,})$/
610
619
  ))();
@@ -649,6 +658,7 @@ var walletSignatureSchema = /* @__PURE__ */ (() => z7.object({
649
658
  function isEvmChainId(value) {
650
659
  return /^eip155:[1-9][0-9]{0,15}$/.test(value);
651
660
  }
661
+ var balanceChainPattern = /^(?:solana:(?:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp|EtWTRABZaYq6iMfeYKouRu166VU2xqa1)|eip155:[1-9][0-9]{0,15}|cosmos:[-_a-zA-Z0-9]{1,32})$/;
652
662
  var evmChainIdSchema = /* @__PURE__ */ (() => z7.custom(
653
663
  (value) => typeof value === "string" && isEvmChainId(value),
654
664
  'Use an EVM chain ID such as "eip155:8453"'
@@ -1765,26 +1775,26 @@ function matches(schema, value, at, budget) {
1765
1775
  }
1766
1776
  }
1767
1777
  if (typeof value === "object" && value !== null && !Array.isArray(value)) {
1768
- const object26 = value;
1778
+ const object27 = value;
1769
1779
  const properties = schema.properties ?? {};
1770
1780
  const required = schema.required ?? [];
1771
1781
  charge(budget, required.length);
1772
1782
  for (const key of required) {
1773
- if (!Object.hasOwn(object26, key)) {
1783
+ if (!Object.hasOwn(object27, key)) {
1774
1784
  return issue(() => `missing required key "${clip(key, maxKeyText)}"`);
1775
1785
  }
1776
1786
  }
1777
1787
  const literals = literalsOf(schema);
1778
1788
  charge(budget, literals.length);
1779
1789
  for (const [key, property] of literals) {
1780
- if (Object.hasOwn(object26, key) && object26[key] !== property.const) {
1790
+ if (Object.hasOwn(object27, key) && object27[key] !== property.const) {
1781
1791
  return {
1782
1792
  at: { parent: at, key },
1783
1793
  reason: () => `expected ${JSON.stringify(property.const)}`
1784
1794
  };
1785
1795
  }
1786
1796
  }
1787
- const keys = Object.keys(object26);
1797
+ const keys = Object.keys(object27);
1788
1798
  charge(budget, keys.length);
1789
1799
  const names = schema.propertyNames?.enum;
1790
1800
  const allowed = names && setOf(schema.propertyNames, names);
@@ -1805,7 +1815,7 @@ function matches(schema, value, at, budget) {
1805
1815
  if (property && property !== true) {
1806
1816
  const found = matches(
1807
1817
  property,
1808
- object26[key],
1818
+ object27[key],
1809
1819
  { parent: at, key },
1810
1820
  budget
1811
1821
  );
@@ -2111,7 +2121,7 @@ var customContentSchema = /* @__PURE__ */ (() => z12.strictObject({
2111
2121
  }))();
2112
2122
  var walletBalanceSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2113
2123
  chain: z12.string().regex(
2114
- /^(?:solana:(?:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp|EtWTRABZaYq6iMfeYKouRu166VU2xqa1)|eip155:[1-9][0-9]{0,15}|cosmos:[-_a-zA-Z0-9]{1,32})$/,
2124
+ balanceChainPattern,
2115
2125
  'Use "solana", Solana devnet ("solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"), an EVM chain such as "eip155:8453" or a Cosmos network such as "cosmos:cosmoshub-4"'
2116
2126
  ),
2117
2127
  token: z12.string().min(1).max(128).nullable()
@@ -2122,12 +2132,12 @@ var solanaClusterSchema = /* @__PURE__ */ (() => z12.string().regex(
2122
2132
  ))();
2123
2133
  var walletProgramActivitySourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2124
2134
  chain: solanaClusterSchema,
2125
- program: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 program address"),
2135
+ program: z12.string().regex(solanaAddressPattern, "Use a base58 program address"),
2126
2136
  instruction: z12.string().regex(
2127
2137
  /^[A-Za-z_][A-Za-z0-9_]{0,63}$/,
2128
2138
  "Use the instruction's name as the program's IDL spells it"
2129
2139
  ).nullable(),
2130
- mint: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 SPL mint address").nullable(),
2140
+ mint: z12.string().regex(solanaAddressPattern, "Use a base58 SPL mint address").nullable(),
2131
2141
  minAmount: z12.string().regex(/^[1-9][0-9]{0,77}$/, "Use a positive whole number of base units").nullable(),
2132
2142
  anySigner: z12.boolean()
2133
2143
  }).refine(
@@ -2149,7 +2159,7 @@ var walletStakeSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2149
2159
  }))();
2150
2160
  var walletProgramAccountSourceSchema = /* @__PURE__ */ (() => z12.strictObject({
2151
2161
  chain: solanaClusterSchema,
2152
- program: z12.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/, "Use a base58 program address"),
2162
+ program: z12.string().regex(solanaAddressPattern, "Use a base58 program address"),
2153
2163
  account: z12.string().min(1).max(128),
2154
2164
  seeds: z12.array(solanaSeedSchema).min(1).max(maxSolanaSeeds).refine(
2155
2165
  (seeds) => seeds.some((seed) => typeof seed === "object" && "wallet" in seed),
@@ -2686,10 +2696,6 @@ var trackerOutcomeRetrySchema = /* @__PURE__ */ (() => z12.strictObject({
2686
2696
  record: externalId,
2687
2697
  observedAt: timestamp
2688
2698
  }))();
2689
- var booleanQuery = /* @__PURE__ */ (() => z12.union([
2690
- z12.boolean(),
2691
- z12.enum(["true", "false"]).transform((v) => v === "true")
2692
- ]))();
2693
2699
  var trackerQuerySchema = /* @__PURE__ */ (() => z12.object({
2694
2700
  author: externalId.optional(),
2695
2701
  member: identifier.optional(),
@@ -3584,7 +3590,8 @@ var questStationSchema = /* @__PURE__ */ (() => z26.object({
3584
3590
  key: referenceSchema,
3585
3591
  label: z26.string().trim().min(1).max(120),
3586
3592
  opensAt: timestamp4.optional(),
3587
- closesAt: timestamp4.optional()
3593
+ closesAt: timestamp4.optional(),
3594
+ proof: z26.enum(["transaction", "code"]).optional()
3588
3595
  }).strict().refine(
3589
3596
  (station) => endsAfterStart({ from: station.opensAt, until: station.closesAt }),
3590
3597
  { message: "A station must close after it opens", path: ["closesAt"] }
@@ -3593,26 +3600,34 @@ var questStationsSchema = /* @__PURE__ */ (() => z26.array(questStationSchema).m
3593
3600
  (stations) => new Set(stations.map((station) => station.key)).size === stations.length,
3594
3601
  "Give each station its own key"
3595
3602
  ))();
3596
- function stationRefusal(stations, reference, blockTime) {
3603
+ function stationRefusal(stations, reference, time, proof = "transaction") {
3597
3604
  const station = stations.find((station2) => station2.key === reference);
3598
3605
  if (!station) {
3599
3606
  return {
3600
3607
  code: "station-unknown",
3601
- message: reference === null ? "This quest completes only from a transaction whose memo names one of its stations" : `The memo names station "${reference}", which this quest does not have`
3608
+ message: reference === null ? "This quest completes only from a check-in at one of its stations" : proof === "code" ? `This quest has no station "${reference}"` : `The memo names station "${reference}", which this quest does not have`
3609
+ };
3610
+ }
3611
+ if ((station.proof ?? "transaction") !== proof) {
3612
+ return {
3613
+ code: "station-proof-mismatch",
3614
+ message: proof === "code" ? `Station "${station.key}" takes check-ins with signed transactions, not a code` : `Station "${station.key}" takes check-ins with its code, not transactions`
3602
3615
  };
3603
3616
  }
3604
- if (!inWindow({ from: station.opensAt, until: station.closesAt }, blockTime)) {
3617
+ if (!inWindow({ from: station.opensAt, until: station.closesAt }, time)) {
3605
3618
  return {
3606
3619
  code: "station-closed",
3607
- message: `Station "${station.key}" was closed when the transaction landed`
3620
+ message: proof === "code" ? `Station "${station.key}" is closed` : `Station "${station.key}" was closed when the transaction landed`
3608
3621
  };
3609
3622
  }
3610
3623
  return null;
3611
3624
  }
3612
- var solanaSignatureSchema2 = /* @__PURE__ */ (() => z26.string().min(64).max(88).regex(/^[1-9A-HJ-NP-Za-km-z]+$/, "use a base58 transaction signature"))();
3625
+ var submittedStationCode = /* @__PURE__ */ (() => z26.string().min(1).max(256))();
3626
+ var stationCheckInSchema = /* @__PURE__ */ (() => z26.object({ code: submittedStationCode, actionId: identifier }).strict())();
3627
+ var stationCodeSubmissionSchema = /* @__PURE__ */ (() => stationCheckInSchema.extend({ quest: identifier, station: identifier, member: identifier }).strict())();
3613
3628
  var solanaTransactionSubmissionSchema = /* @__PURE__ */ (() => z26.object({
3614
3629
  quest: identifier,
3615
- signature: solanaSignatureSchema2,
3630
+ signature: solanaSignatureSchema,
3616
3631
  chain: z26.enum(["solana", solanaMainnet, solanaDevnet]).default(solanaMainnet).transform(
3617
3632
  (chain) => chain === "solana" ? solanaMainnet : chain
3618
3633
  )
@@ -3625,74 +3640,79 @@ var attemptActionSchema = /* @__PURE__ */ (() => z26.object({
3625
3640
  reference: z26.string().nullable()
3626
3641
  }))();
3627
3642
 
3628
- // src/resources.ts
3643
+ // src/galleries.ts
3629
3644
  import * as z27 from "zod";
3630
- var resourceSourceSchema = /* @__PURE__ */ (() => z27.union([
3631
- z27.strictObject({
3632
- provider: z27.literal("domino"),
3633
- resource: z27.literal("point-ledger")
3645
+ var galleryKinds = ["wall", "contest"];
3646
+ var questGallerySchema = /* @__PURE__ */ (() => z27.object({ kind: z27.string().min(1).max(40) }).strict())();
3647
+
3648
+ // src/resources.ts
3649
+ import * as z28 from "zod";
3650
+ var resourceSourceSchema = /* @__PURE__ */ (() => z28.union([
3651
+ z28.strictObject({
3652
+ provider: z28.literal("domino"),
3653
+ resource: z28.literal("point-ledger")
3634
3654
  }),
3635
3655
  discordResourceSourceSchema
3636
3656
  ]))();
3637
- var resourceRequestSchema = /* @__PURE__ */ (() => z27.object({
3657
+ var resourceRequestSchema = /* @__PURE__ */ (() => z28.object({
3638
3658
  source: resourceSourceSchema,
3639
- query: z27.string().max(100).optional(),
3640
- cursor: z27.string().regex(/^\d{1,6}$/).optional(),
3641
- ids: z27.array(z27.string().min(1).max(100)).max(50).optional()
3659
+ query: z28.string().max(100).optional(),
3660
+ cursor: z28.string().regex(/^\d{1,6}$/).optional(),
3661
+ ids: z28.array(z28.string().min(1).max(100)).max(50).optional()
3642
3662
  }).strict())();
3643
- var resourceOptionsSchema = /* @__PURE__ */ (() => z27.object({
3644
- revision: z27.number().int(),
3645
- options: z27.array(
3646
- z27.object({
3647
- id: z27.string(),
3648
- label: z27.string(),
3649
- description: z27.string().optional(),
3650
- group: z27.string().optional(),
3651
- disabledReason: z27.string().optional()
3663
+ var resourceOptionsSchema = /* @__PURE__ */ (() => z28.object({
3664
+ revision: z28.number().int(),
3665
+ options: z28.array(
3666
+ z28.object({
3667
+ id: z28.string(),
3668
+ label: z28.string(),
3669
+ description: z28.string().optional(),
3670
+ group: z28.string().optional(),
3671
+ disabledReason: z28.string().optional()
3652
3672
  })
3653
3673
  ),
3654
3674
  /** Pass back as `cursor` for the next page; null on the last one. */
3655
- nextCursor: z27.string().nullable().default(null),
3675
+ nextCursor: z28.string().nullable().default(null),
3656
3676
  /** @deprecated Use `nextCursor`. Removed in 2.0.0. */
3657
- cursor: z27.string().nullable()
3677
+ cursor: z28.string().nullable()
3658
3678
  }))();
3659
3679
 
3660
3680
  // src/settings.ts
3661
- import * as z29 from "zod";
3681
+ import * as z30 from "zod";
3662
3682
 
3663
3683
  // src/setting-values.ts
3664
- import * as z28 from "zod";
3684
+ import * as z29 from "zod";
3665
3685
  var settingInstant = /* @__PURE__ */ (() => offsetDateTimeSchema().transform(
3666
3686
  (value) => new Date(value).toISOString()
3667
3687
  ))();
3668
- var settingResourceId = /* @__PURE__ */ (() => z28.union([
3669
- z28.literal(""),
3670
- z28.string().regex(/^\S{1,200}$/)
3688
+ var settingResourceId = /* @__PURE__ */ (() => z29.union([
3689
+ z29.literal(""),
3690
+ z29.string().regex(/^\S{1,200}$/)
3671
3691
  ]))();
3672
3692
 
3673
3693
  // src/settings.ts
3674
- var base = /* @__PURE__ */ (() => ({ label: z29.string().min(1), description: z29.string().optional() }))();
3675
- var settingFieldSchema = /* @__PURE__ */ (() => z29.discriminatedUnion("kind", [
3676
- z29.object({
3694
+ var base = /* @__PURE__ */ (() => ({ label: z30.string().min(1), description: z30.string().optional() }))();
3695
+ var settingFieldSchema = /* @__PURE__ */ (() => z30.discriminatedUnion("kind", [
3696
+ z30.object({
3677
3697
  ...base,
3678
- kind: z29.literal("point-ledger"),
3679
- default: identifier.or(z29.literal(""))
3698
+ kind: z30.literal("point-ledger"),
3699
+ default: identifier.or(z30.literal(""))
3680
3700
  }).strict(),
3681
- z29.object({ ...base, kind: z29.literal("datetime"), default: settingInstant }).strict(),
3682
- z29.object({
3701
+ z30.object({ ...base, kind: z30.literal("datetime"), default: settingInstant }).strict(),
3702
+ z30.object({
3683
3703
  ...base,
3684
- kind: z29.literal("resource"),
3704
+ kind: z30.literal("resource"),
3685
3705
  default: settingResourceId,
3686
3706
  source: resourceSourceSchema
3687
3707
  }).strict(),
3688
- z29.object({ ...base, kind: z29.literal("quiz"), default: quizContentSchema }).strict(),
3689
- z29.object({
3708
+ z30.object({ ...base, kind: z30.literal("quiz"), default: quizContentSchema }).strict(),
3709
+ z30.object({
3690
3710
  ...base,
3691
- kind: z29.literal("text"),
3692
- default: z29.string(),
3693
- minLength: z29.number().int().nonnegative(),
3694
- maxLength: z29.number().int().positive(),
3695
- multiline: z29.boolean(),
3711
+ kind: z30.literal("text"),
3712
+ default: z30.string(),
3713
+ minLength: z30.number().int().nonnegative(),
3714
+ maxLength: z30.number().int().positive(),
3715
+ multiline: z30.boolean(),
3696
3716
  /**
3697
3717
  * A list Console offers the value from, beside free text: `telegram-chat` lists the
3698
3718
  * project's connected Telegram chats. Unknown pickers read as free text. Six pickers also
@@ -3708,40 +3728,40 @@ var settingFieldSchema = /* @__PURE__ */ (() => z29.discriminatedUnion("kind", [
3708
3728
  * (`settings.solanaProgram()`), which Relay also checks is
3709
3729
  * an executable program.
3710
3730
  */
3711
- picker: z29.string().optional(),
3731
+ picker: z30.string().optional(),
3712
3732
  /**
3713
3733
  * On an `amount` setting, the token's decimals: Console shows and edits the value in whole
3714
3734
  * tokens.
3715
3735
  */
3716
- decimals: z29.number().int().min(0).max(255).optional(),
3736
+ decimals: z30.number().int().min(0).max(255).optional(),
3717
3737
  /**
3718
3738
  * A value operators set in Console that never leaves Relay: management responses, the CLI
3719
3739
  * and Console withhold it, and the quest's code reads it as usual. Its `default` is `""`.
3720
3740
  */
3721
- secret: z29.literal(true).optional()
3741
+ secret: z30.literal(true).optional()
3722
3742
  }).strict(),
3723
- z29.object({
3743
+ z30.object({
3724
3744
  ...base,
3725
- kind: z29.literal("integer"),
3726
- default: z29.number().int(),
3727
- min: z29.number().int(),
3728
- max: z29.number().int()
3745
+ kind: z30.literal("integer"),
3746
+ default: z30.number().int(),
3747
+ min: z30.number().int(),
3748
+ max: z30.number().int()
3729
3749
  }).strict(),
3730
- z29.object({ ...base, kind: z29.literal("boolean"), default: z29.boolean() }).strict(),
3731
- z29.object({
3750
+ z30.object({ ...base, kind: z30.literal("boolean"), default: z30.boolean() }).strict(),
3751
+ z30.object({
3732
3752
  ...base,
3733
- kind: z29.literal("choice"),
3734
- default: z29.string(),
3735
- options: z29.array(z29.string().min(1)).min(1)
3753
+ kind: z30.literal("choice"),
3754
+ default: z30.string(),
3755
+ options: z30.array(z30.string().min(1)).min(1)
3736
3756
  }).strict()
3737
3757
  ]))();
3738
- var settingsFieldsSchema = /* @__PURE__ */ (() => z29.record(
3739
- z29.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
3758
+ var settingsFieldsSchema = /* @__PURE__ */ (() => z30.record(
3759
+ z30.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
3740
3760
  settingFieldSchema
3741
3761
  ))();
3742
- var settingsValuesSchema = /* @__PURE__ */ (() => z29.record(
3743
- z29.string(),
3744
- z29.union([z29.string(), z29.number().finite(), z29.boolean(), quizContentSchema])
3762
+ var settingsValuesSchema = /* @__PURE__ */ (() => z30.record(
3763
+ z30.string(),
3764
+ z30.union([z30.string(), z30.number().finite(), z30.boolean(), quizContentSchema])
3745
3765
  ))();
3746
3766
  function isAmount(value) {
3747
3767
  return value.length <= 100 && /^(0|[1-9][0-9]*)$/.test(value);
@@ -3753,10 +3773,10 @@ function isBoundSetting(field) {
3753
3773
  return field?.kind === "integer" || field?.kind === "text" && field.picker === "amount";
3754
3774
  }
3755
3775
  function textSettingSchema(field) {
3756
- const text = field.secret ? z29.string().max(field.maxLength).refine(
3776
+ const text = field.secret ? z30.string().max(field.maxLength).refine(
3757
3777
  (value) => value === "" || value.length >= field.minLength,
3758
3778
  `Use at least ${field.minLength} characters`
3759
- ) : z29.string().min(field.minLength).max(field.maxLength);
3779
+ ) : z30.string().min(field.minLength).max(field.maxLength);
3760
3780
  switch (field.picker) {
3761
3781
  case "amount":
3762
3782
  return text.refine(
@@ -3812,17 +3832,17 @@ function parseSettings(fields2, input) {
3812
3832
  shape[key] = textSettingSchema(field).default(field.default);
3813
3833
  break;
3814
3834
  case "integer":
3815
- shape[key] = z29.number().int().min(field.min).max(field.max).default(field.default);
3835
+ shape[key] = z30.number().int().min(field.min).max(field.max).default(field.default);
3816
3836
  break;
3817
3837
  case "boolean":
3818
- shape[key] = z29.boolean().default(field.default);
3838
+ shape[key] = z30.boolean().default(field.default);
3819
3839
  break;
3820
3840
  case "choice":
3821
- shape[key] = z29.enum(field.options).default(field.default);
3841
+ shape[key] = z30.enum(field.options).default(field.default);
3822
3842
  break;
3823
3843
  }
3824
3844
  }
3825
- return settingsValuesSchema.parse(z29.object(shape).strict().parse(input));
3845
+ return settingsValuesSchema.parse(z30.object(shape).strict().parse(input));
3826
3846
  }
3827
3847
  function missingResourceSettings(fields2, values2) {
3828
3848
  return Object.entries(fields2).filter(
@@ -3843,20 +3863,20 @@ function authoringKey(input) {
3843
3863
  }
3844
3864
 
3845
3865
  // src/campaigns.ts
3846
- import * as z30 from "zod";
3847
- var availabilityWindowSchema = /* @__PURE__ */ (() => z30.object({ from: timestamp4, until: timestamp4 }).strict().refine(endsAfterStart, {
3866
+ import * as z31 from "zod";
3867
+ var availabilityWindowSchema = /* @__PURE__ */ (() => z31.object({ from: timestamp4, until: timestamp4 }).strict().refine(endsAfterStart, {
3848
3868
  message: "Window end must follow its start",
3849
3869
  path: ["until"]
3850
3870
  }))();
3851
- var campaignDefinitionSchema = /* @__PURE__ */ (() => z30.object({
3871
+ var campaignDefinitionSchema = /* @__PURE__ */ (() => z31.object({
3852
3872
  key: identifier,
3853
- title: z30.string().trim().min(1).max(120),
3873
+ title: z31.string().trim().min(1).max(120),
3854
3874
  window: availabilityWindowSchema.optional(),
3855
- enrollment: z30.enum(["none", "required"]).default("none")
3875
+ enrollment: z31.enum(["none", "required"]).default("none")
3856
3876
  }).strict())();
3857
3877
  var campaignAuthoringSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.omit({ key: true, title: true }).extend({
3858
3878
  ...authoringIdentityShape,
3859
- title: z30.string().trim().min(1).max(120).optional()
3879
+ title: z31.string().trim().min(1).max(120).optional()
3860
3880
  }).strict().transform((value) => {
3861
3881
  const normalized = value;
3862
3882
  return campaignDefinitionSchema.parse({
@@ -3870,42 +3890,42 @@ function defineCampaign(input) {
3870
3890
  var campaignViewSchema = /* @__PURE__ */ (() => campaignDefinitionSchema.extend({
3871
3891
  enrolledAt: timestamp4.nullable(),
3872
3892
  withdrawnAt: timestamp4.nullable().default(null),
3873
- withdrawalReason: z30.string().nullable().default(null)
3893
+ withdrawalReason: z31.string().nullable().default(null)
3874
3894
  }))();
3875
- var campaignEnrollmentInputSchema = /* @__PURE__ */ (() => z30.object({ actionId: identifier, campaign: identifier }).strict())();
3895
+ var campaignEnrollmentInputSchema = /* @__PURE__ */ (() => z31.object({ actionId: identifier, campaign: identifier }).strict())();
3876
3896
  var memberCampaignEnrollmentInputSchema = /* @__PURE__ */ (() => campaignEnrollmentInputSchema.extend({ member: identifier }))();
3877
3897
  var campaignWithdrawalInputSchema = campaignEnrollmentInputSchema;
3878
3898
  var memberCampaignWithdrawalInputSchema = /* @__PURE__ */ (() => campaignWithdrawalInputSchema.extend({
3879
3899
  member: identifier,
3880
- reason: z30.string().trim().min(1).max(500)
3900
+ reason: z31.string().trim().min(1).max(500)
3881
3901
  }))();
3882
- var campaignEnrollmentSchema = /* @__PURE__ */ (() => z30.object({
3902
+ var campaignEnrollmentSchema = /* @__PURE__ */ (() => z31.object({
3883
3903
  campaign: identifier,
3884
3904
  member: identifier,
3885
3905
  enrolledAt: timestamp4,
3886
3906
  withdrawnAt: timestamp4.nullable().default(null),
3887
- withdrawalReason: z30.string().nullable().default(null)
3907
+ withdrawalReason: z31.string().nullable().default(null)
3888
3908
  }))();
3889
3909
 
3890
3910
  // src/resource-handle.ts
3891
- import * as z31 from "zod";
3911
+ import * as z32 from "zod";
3892
3912
  function resourceHandle(_kind, definition) {
3893
3913
  return definition;
3894
3914
  }
3895
- var ledgerSettingSchema = /* @__PURE__ */ (() => identifier.or(z31.literal("")).brand())();
3915
+ var ledgerSettingSchema = /* @__PURE__ */ (() => identifier.or(z32.literal("")).brand())();
3896
3916
  function ledgerKey(ledger) {
3897
3917
  return typeof ledger === "string" ? ledger : ledger.key;
3898
3918
  }
3899
3919
 
3900
3920
  // src/groups.ts
3901
- import * as z32 from "zod";
3902
- var projectGroupSchema = /* @__PURE__ */ (() => z32.object({
3921
+ import * as z33 from "zod";
3922
+ var projectGroupSchema = /* @__PURE__ */ (() => z33.object({
3903
3923
  key: identifier,
3904
- title: z32.string().trim().min(1).max(120)
3924
+ title: z33.string().trim().min(1).max(120)
3905
3925
  }).strict())();
3906
3926
  var projectGroupAuthoringSchema = /* @__PURE__ */ (() => projectGroupSchema.omit({ key: true, title: true }).extend({
3907
3927
  ...authoringIdentityShape,
3908
- title: z32.string().trim().min(1).max(120).optional()
3928
+ title: z33.string().trim().min(1).max(120).optional()
3909
3929
  }).strict().transform((value) => {
3910
3930
  return projectGroupSchema.parse({
3911
3931
  ...value,
@@ -3918,93 +3938,93 @@ function defineGroup(input) {
3918
3938
  function projectGroupKey(group) {
3919
3939
  return identifier.parse(group.key);
3920
3940
  }
3921
- var groupTitle = /* @__PURE__ */ (() => z32.string().trim().min(1).max(120))();
3922
- var reason = /* @__PURE__ */ (() => z32.string().trim().min(1).max(1e3))();
3923
- var timestamp5 = /* @__PURE__ */ (() => z32.number().int().nonnegative().max(864e13))();
3924
- var createGroupSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, key: identifier, title: groupTitle }).strict())();
3925
- var updateGroupSchema = /* @__PURE__ */ (() => z32.object({ title: groupTitle }).strict())();
3926
- var addGroupMemberSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, member: identifier, reason }).strict())();
3927
- var removeGroupMemberSchema = /* @__PURE__ */ (() => z32.object({ actionId: identifier, reason }).strict())();
3928
- var groupArchiveInputSchema = /* @__PURE__ */ (() => z32.object({ reason: lifecycleReasonSchema.optional() }).strict())();
3929
- var groupPageQuerySchema = /* @__PURE__ */ (() => z32.strictObject({
3941
+ var groupTitle = /* @__PURE__ */ (() => z33.string().trim().min(1).max(120))();
3942
+ var reason = /* @__PURE__ */ (() => z33.string().trim().min(1).max(1e3))();
3943
+ var timestamp5 = /* @__PURE__ */ (() => z33.number().int().nonnegative().max(864e13))();
3944
+ var createGroupSchema = /* @__PURE__ */ (() => z33.object({ actionId: identifier, key: identifier, title: groupTitle }).strict())();
3945
+ var updateGroupSchema = /* @__PURE__ */ (() => z33.object({ title: groupTitle }).strict())();
3946
+ var addGroupMemberSchema = /* @__PURE__ */ (() => z33.object({ actionId: identifier, member: identifier, reason }).strict())();
3947
+ var removeGroupMemberSchema = /* @__PURE__ */ (() => z33.object({ actionId: identifier, reason }).strict())();
3948
+ var groupArchiveInputSchema = /* @__PURE__ */ (() => z33.object({ reason: lifecycleReasonSchema.optional() }).strict())();
3949
+ var groupPageQuerySchema = /* @__PURE__ */ (() => z33.strictObject({
3930
3950
  cursor: pageCursorSchema.optional(),
3931
3951
  /** Items per page, 1–100; the default is 50. */
3932
- limit: z32.number().int().min(1).max(100).optional()
3952
+ limit: z33.number().int().min(1).max(100).optional()
3933
3953
  }))();
3934
- var managedGroupSchema = /* @__PURE__ */ (() => z32.object({
3954
+ var managedGroupSchema = /* @__PURE__ */ (() => z33.object({
3935
3955
  key: identifier,
3936
- title: z32.string(),
3937
- members: z32.number().int().nonnegative(),
3956
+ title: z33.string(),
3957
+ members: z33.number().int().nonnegative(),
3938
3958
  createdAt: timestamp5,
3939
3959
  archivedAt: timestamp5.nullable()
3940
3960
  }))();
3941
- var groupPageSchema = /* @__PURE__ */ (() => z32.object({
3942
- items: z32.array(managedGroupSchema),
3961
+ var groupPageSchema = /* @__PURE__ */ (() => z33.object({
3962
+ items: z33.array(managedGroupSchema),
3943
3963
  nextCursor: pageCursorSchema.nullable()
3944
3964
  }))();
3945
- var groupMemberSchema = /* @__PURE__ */ (() => z32.object({
3965
+ var groupMemberSchema = /* @__PURE__ */ (() => z33.object({
3946
3966
  member: identifier,
3947
3967
  addedAt: timestamp5.nullable()
3948
3968
  }))();
3949
- var groupMemberPageSchema = /* @__PURE__ */ (() => z32.object({
3950
- items: z32.array(groupMemberSchema),
3969
+ var groupMemberPageSchema = /* @__PURE__ */ (() => z33.object({
3970
+ items: z33.array(groupMemberSchema),
3951
3971
  nextCursor: pageCursorSchema.nullable()
3952
3972
  }))();
3953
3973
 
3954
3974
  // src/prerequisites.ts
3955
- import * as z33 from "zod";
3956
- var amount = /* @__PURE__ */ (() => z33.number().int().safe().nonnegative())();
3975
+ import * as z34 from "zod";
3976
+ var amount = /* @__PURE__ */ (() => z34.number().int().safe().nonnegative())();
3957
3977
  var threshold = /* @__PURE__ */ (() => amount.positive())();
3958
- var completionPrerequisiteSchema = /* @__PURE__ */ (() => z33.discriminatedUnion("scope", [
3959
- z33.object({
3960
- kind: z33.literal("completion"),
3978
+ var completionPrerequisiteSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("scope", [
3979
+ z34.object({
3980
+ kind: z34.literal("completion"),
3961
3981
  quest: identifier,
3962
- scope: z33.literal("ever")
3982
+ scope: z34.literal("ever")
3963
3983
  }).strict(),
3964
- z33.object({
3965
- kind: z33.literal("completion"),
3984
+ z34.object({
3985
+ kind: z34.literal("completion"),
3966
3986
  quest: identifier,
3967
- scope: z33.literal("period"),
3987
+ scope: z34.literal("period"),
3968
3988
  period: calendarPeriodSchema.exclude(["lifetime"])
3969
3989
  }).strict()
3970
3990
  ]))();
3971
- var balancePrerequisiteSchema = /* @__PURE__ */ (() => z33.object({
3972
- kind: z33.literal("balance"),
3991
+ var balancePrerequisiteSchema = /* @__PURE__ */ (() => z34.object({
3992
+ kind: z34.literal("balance"),
3973
3993
  balance: identifier,
3974
3994
  minimum: threshold
3975
3995
  }).strict())();
3976
- var groupPrerequisiteSchema = /* @__PURE__ */ (() => z33.object({ kind: z33.literal("group"), group: identifier, title: z33.string() }).strict())();
3977
- var prerequisiteSchema = /* @__PURE__ */ (() => z33.discriminatedUnion("kind", [
3996
+ var groupPrerequisiteSchema = /* @__PURE__ */ (() => z34.object({ kind: z34.literal("group"), group: identifier, title: z34.string() }).strict())();
3997
+ var prerequisiteSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
3978
3998
  completionPrerequisiteSchema,
3979
3999
  balancePrerequisiteSchema,
3980
4000
  groupPrerequisiteSchema
3981
4001
  ]))();
3982
- var missingPrerequisiteSchema = /* @__PURE__ */ (() => z33.union([
3983
- z33.object({
3984
- kind: z33.literal("completion"),
4002
+ var missingPrerequisiteSchema = /* @__PURE__ */ (() => z34.union([
4003
+ z34.object({
4004
+ kind: z34.literal("completion"),
3985
4005
  quest: identifier,
3986
- title: z33.string(),
3987
- scope: z33.literal("ever")
4006
+ title: z34.string(),
4007
+ scope: z34.literal("ever")
3988
4008
  }),
3989
- z33.object({
3990
- kind: z33.literal("completion"),
4009
+ z34.object({
4010
+ kind: z34.literal("completion"),
3991
4011
  quest: identifier,
3992
- title: z33.string(),
3993
- scope: z33.literal("period"),
4012
+ title: z34.string(),
4013
+ scope: z34.literal("period"),
3994
4014
  period: calendarPeriodSchema.exclude(["lifetime"]),
3995
- resetsAt: z33.number().int().safe()
4015
+ resetsAt: z34.number().int().safe()
3996
4016
  }),
3997
- z33.object({
3998
- kind: z33.literal("balance"),
4017
+ z34.object({
4018
+ kind: z34.literal("balance"),
3999
4019
  balance: identifier,
4000
- title: z33.string(),
4020
+ title: z34.string(),
4001
4021
  minimum: threshold,
4002
4022
  current: amount
4003
4023
  }),
4004
- z33.object({
4005
- kind: z33.literal("group"),
4024
+ z34.object({
4025
+ kind: z34.literal("group"),
4006
4026
  group: identifier,
4007
- title: z33.string()
4027
+ title: z34.string()
4008
4028
  })
4009
4029
  ]))();
4010
4030
  function completed(quest, options = {}) {
@@ -4035,29 +4055,29 @@ function inGroup(group) {
4035
4055
  var maxPointsAmount = 2147483647;
4036
4056
 
4037
4057
  // src/schema.ts
4038
- import * as z34 from "zod";
4039
- var pointsRewardSchema = /* @__PURE__ */ (() => z34.object({
4040
- kind: z34.literal("points").default("points"),
4058
+ import * as z35 from "zod";
4059
+ var pointsRewardSchema = /* @__PURE__ */ (() => z35.object({
4060
+ kind: z35.literal("points").default("points"),
4041
4061
  balance: identifier,
4042
- amount: z34.number().int().min(0).max(maxPointsAmount)
4062
+ amount: z35.number().int().min(0).max(maxPointsAmount)
4043
4063
  }).strict())();
4044
- var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z34.object({
4064
+ var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z35.object({
4045
4065
  /** An automatic achievement backed by the project badge catalog. */
4046
4066
  badge: identifier.optional(),
4047
4067
  /** Membership in the project group with this key, added when the reward is delivered. */
4048
4068
  group: identifier.optional(),
4049
4069
  id: identifier,
4050
- title: z34.string().min(1).max(120),
4051
- tiers: z34.array(
4052
- z34.object({ id: identifier, title: z34.string().min(1).max(120) }).strict()
4070
+ title: z35.string().min(1).max(120),
4071
+ tiers: z35.array(
4072
+ z35.object({ id: identifier, title: z35.string().min(1).max(120) }).strict()
4053
4073
  ).min(1).max(20).refine(
4054
4074
  (tiers) => new Set(tiers.map((t) => t.id)).size === tiers.length,
4055
4075
  "Tier IDs must be unique"
4056
4076
  ),
4057
- inventory: z34.object({ kind: z34.literal("untracked") }).strict(),
4058
- fulfillment: z34.discriminatedUnion("kind", [
4059
- z34.object({ kind: z34.literal("staff-handover") }).strict(),
4060
- z34.object({ kind: z34.literal("automatic") }).strict()
4077
+ inventory: z35.object({ kind: z35.literal("untracked") }).strict(),
4078
+ fulfillment: z35.discriminatedUnion("kind", [
4079
+ z35.object({ kind: z35.literal("staff-handover") }).strict(),
4080
+ z35.object({ kind: z35.literal("automatic") }).strict()
4061
4081
  ])
4062
4082
  }).strict().refine(
4063
4083
  (value) => value.badge === void 0 && value.group === void 0 || value.fulfillment.kind === "automatic" && value.tiers.length === 1 && value.tiers[0].id === "awarded",
@@ -4066,12 +4086,12 @@ var tieredRewardDefinitionSchema = /* @__PURE__ */ (() => z34.object({
4066
4086
  (value) => value.badge === void 0 || value.group === void 0,
4067
4087
  "A reward is either a badge or a group membership"
4068
4088
  ))();
4069
- var tieredRewardReferenceSchema = /* @__PURE__ */ (() => z34.object({
4089
+ var tieredRewardReferenceSchema = /* @__PURE__ */ (() => z35.object({
4070
4090
  id: identifier,
4071
4091
  key: identifier.nullable()
4072
4092
  }))();
4073
- var tierRewardSchema = /* @__PURE__ */ (() => z34.object({
4074
- kind: z34.literal("tier"),
4093
+ var tierRewardSchema = /* @__PURE__ */ (() => z35.object({
4094
+ kind: z35.literal("tier"),
4075
4095
  reward: tieredRewardDefinitionSchema,
4076
4096
  tier: identifier
4077
4097
  }).strict().refine(
@@ -4083,7 +4103,7 @@ var badgeRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
4083
4103
  const badge = value.reward.badge;
4084
4104
  if (!badge || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
4085
4105
  context.addIssue({ code: "custom", message: "Invalid badge reward" });
4086
- return z34.NEVER;
4106
+ return z35.NEVER;
4087
4107
  }
4088
4108
  return { ...value, reward: { ...value.reward, badge } };
4089
4109
  }
@@ -4107,7 +4127,7 @@ var groupRewardSchema = /* @__PURE__ */ (() => tierRewardSchema.transform(
4107
4127
  const group = value.reward.group;
4108
4128
  if (!group || value.reward.fulfillment.kind !== "automatic" || value.reward.tiers.length !== 1 || value.tier !== "awarded") {
4109
4129
  context.addIssue({ code: "custom", message: "Invalid group reward" });
4110
- return z34.NEVER;
4130
+ return z35.NEVER;
4111
4131
  }
4112
4132
  return { ...value, reward: { ...value.reward, group } };
4113
4133
  }
@@ -4127,15 +4147,15 @@ function groupReward(key, title) {
4127
4147
  });
4128
4148
  }
4129
4149
  var integrationRewardSchema = discordRewardSchema;
4130
- var rewardSchema = /* @__PURE__ */ (() => z34.union([
4150
+ var rewardSchema = /* @__PURE__ */ (() => z35.union([
4131
4151
  pointsRewardSchema,
4132
4152
  tierRewardSchema,
4133
4153
  integrationRewardSchema
4134
4154
  ]))();
4135
- var rewardTypeSchema = /* @__PURE__ */ (() => z34.string())();
4136
- var rewardEntrySchema = /* @__PURE__ */ (() => z34.object({
4155
+ var rewardTypeSchema = /* @__PURE__ */ (() => z35.string())();
4156
+ var rewardEntrySchema = /* @__PURE__ */ (() => z35.object({
4137
4157
  type: rewardTypeSchema,
4138
- data: z34.record(z34.string(), z34.json())
4158
+ data: z35.record(z35.string(), z35.json())
4139
4159
  }))();
4140
4160
  function rewardKey(reward) {
4141
4161
  if (reward.kind === "tier" && reward.reward.badge) {
@@ -4149,39 +4169,39 @@ function rewardKey(reward) {
4149
4169
  }
4150
4170
  return reward.kind === "points" ? "points:" + reward.balance : "tier:" + reward.reward.id;
4151
4171
  }
4152
- var triggerSchema = /* @__PURE__ */ (() => z34.union([
4153
- z34.object({
4154
- kind: z34.literal("manual"),
4155
- input: z34.literal("text"),
4172
+ var triggerSchema = /* @__PURE__ */ (() => z35.union([
4173
+ z35.object({
4174
+ kind: z35.literal("manual"),
4175
+ input: z35.literal("text"),
4156
4176
  constraints: textOptionsSchema,
4157
- actor: z34.enum(["member", "staff"]).optional()
4177
+ actor: z35.enum(["member", "staff"]).optional()
4158
4178
  }).strict(),
4159
- z34.object({
4160
- kind: z34.literal("manual"),
4161
- input: z34.literal("url"),
4179
+ z35.object({
4180
+ kind: z35.literal("manual"),
4181
+ input: z35.literal("url"),
4162
4182
  constraints: urlOptionsSchema,
4163
- actor: z34.enum(["member", "staff"]).optional()
4183
+ actor: z35.enum(["member", "staff"]).optional()
4164
4184
  }).strict(),
4165
- z34.object({
4166
- kind: z34.literal("manual"),
4167
- input: z34.enum(["photo", "quiz", "none"]),
4168
- actor: z34.enum(["member", "staff"]).optional()
4185
+ z35.object({
4186
+ kind: z35.literal("manual"),
4187
+ input: z35.enum(["photo", "quiz", "none"]),
4188
+ actor: z35.enum(["member", "staff"]).optional()
4169
4189
  }).strict(),
4170
- z34.object({
4171
- kind: z34.literal("automatic"),
4190
+ z35.object({
4191
+ kind: z35.literal("automatic"),
4172
4192
  tracker: trackerTriggerPolicySchema.optional()
4173
4193
  }).strict()
4174
4194
  ]))();
4175
- var triggerResponseSchema = /* @__PURE__ */ (() => z34.union(
4195
+ var triggerResponseSchema = /* @__PURE__ */ (() => z35.union(
4176
4196
  triggerSchema.options.map((option) => option.strip())
4177
4197
  ))();
4178
- var photoResultSchema = /* @__PURE__ */ (() => z34.object({
4179
- kind: z34.enum(["pass", "fail", "unclear"]),
4180
- reason: z34.string().min(1).max(2e3)
4198
+ var photoResultSchema = /* @__PURE__ */ (() => z35.object({
4199
+ kind: z35.enum(["pass", "fail", "unclear"]),
4200
+ reason: z35.string().min(1).max(2e3)
4181
4201
  }).strict())();
4182
- var textReviewInputSchema = /* @__PURE__ */ (() => z34.object({
4183
- text: z34.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
4184
- criteria: z34.string().trim().min(1).max(2e3)
4202
+ var textReviewInputSchema = /* @__PURE__ */ (() => z35.object({
4203
+ text: z35.string().min(1).max(16e3).refine((value) => value.trim().length > 0, "Text must not be blank"),
4204
+ criteria: z35.string().trim().min(1).max(2e3)
4185
4205
  }).strict())();
4186
4206
  var textResultSchema = photoResultSchema;
4187
4207
  var deferPolicy = {
@@ -4195,31 +4215,31 @@ var retryCooldownPolicy = {
4195
4215
  minMs: 1e3,
4196
4216
  maxMs: 6048e5
4197
4217
  };
4198
- var retryCooldownMsSchema = /* @__PURE__ */ (() => z34.number().int().min(limits.retryCooldown.minMs).max(limits.retryCooldown.maxMs))();
4199
- var evaluatorProgressSchema = /* @__PURE__ */ (() => z34.object({
4200
- current: z34.number().finite().nonnegative(),
4201
- target: z34.number().finite().positive(),
4202
- reason: z34.string().min(1).max(2e3)
4218
+ var retryCooldownMsSchema = /* @__PURE__ */ (() => z35.number().int().min(limits.retryCooldown.minMs).max(limits.retryCooldown.maxMs))();
4219
+ var evaluatorProgressSchema = /* @__PURE__ */ (() => z35.object({
4220
+ current: z35.number().finite().nonnegative(),
4221
+ target: z35.number().finite().positive(),
4222
+ reason: z35.string().min(1).max(2e3)
4203
4223
  }).refine((value) => value.current <= value.target, {
4204
4224
  message: "Progress current must not exceed target"
4205
4225
  }))();
4206
- var decisionSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4207
- z34.strictObject({
4208
- kind: z34.literal("defer"),
4209
- reason: z34.string().min(1).max(2e3),
4210
- retryAfterMs: z34.number().int().min(limits.defer.minRetryAfterMs).max(limits.defer.maxRetryAfterMs).optional(),
4226
+ var decisionSchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4227
+ z35.strictObject({
4228
+ kind: z35.literal("defer"),
4229
+ reason: z35.string().min(1).max(2e3),
4230
+ retryAfterMs: z35.number().int().min(limits.defer.minRetryAfterMs).max(limits.defer.maxRetryAfterMs).optional(),
4211
4231
  /** Absolute Unix milliseconds; the platform can only shorten its existing deadline. */
4212
- until: z34.number().int().safe().nonnegative().optional()
4232
+ until: z35.number().int().safe().nonnegative().optional()
4213
4233
  }),
4214
- evaluatorProgressSchema.safeExtend({ kind: z34.literal("progress") }).strict(),
4215
- z34.object({
4216
- kind: z34.literal("accept"),
4217
- rewards: z34.array(rewardSchema).max(10),
4234
+ evaluatorProgressSchema.safeExtend({ kind: z35.literal("progress") }).strict(),
4235
+ z35.object({
4236
+ kind: z35.literal("accept"),
4237
+ rewards: z35.array(rewardSchema).max(10),
4218
4238
  completionKey: completionKeySchema.optional()
4219
4239
  }).strict(),
4220
- z34.object({
4221
- kind: z34.literal("reject"),
4222
- reason: z34.string().min(1).max(2e3),
4240
+ z35.object({
4241
+ kind: z35.literal("reject"),
4242
+ reason: z35.string().min(1).max(2e3),
4223
4243
  /**
4224
4244
  * A stable key for the rejection's cause, such as `wrong-answers`, stored as the attempt's
4225
4245
  * `code`: lowercase letters, digits and hyphens, at most 64 characters, and none of the
@@ -4227,28 +4247,28 @@ var decisionSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4227
4247
  */
4228
4248
  code: rejectCodeSchema.optional(),
4229
4249
  /** The evaluator asked for human review, but review is off for the quest, so this is a reject. */
4230
- requestedReview: z34.literal(true).optional()
4250
+ requestedReview: z35.literal(true).optional()
4231
4251
  }).strict(),
4232
- z34.object({
4233
- kind: z34.literal("review"),
4234
- reason: z34.string().min(1).max(2e3),
4235
- rewards: z34.array(rewardSchema).max(10).optional(),
4252
+ z35.object({
4253
+ kind: z35.literal("review"),
4254
+ reason: z35.string().min(1).max(2e3),
4255
+ rewards: z35.array(rewardSchema).max(10).optional(),
4236
4256
  completionKey: completionKeySchema.optional()
4237
4257
  }).strict()
4238
4258
  ]))();
4239
- var reviewModeSchema = /* @__PURE__ */ (() => z34.enum(["workers-ai"]))();
4240
- var storedReviewModeSchema = /* @__PURE__ */ (() => z34.enum([
4259
+ var reviewModeSchema = /* @__PURE__ */ (() => z35.enum(["workers-ai"]))();
4260
+ var storedReviewModeSchema = /* @__PURE__ */ (() => z35.enum([
4241
4261
  "fixture-pass",
4242
4262
  "fixture-fail",
4243
4263
  "fixture-unclear",
4244
4264
  "fixture-error",
4245
4265
  "workers-ai"
4246
4266
  ]))();
4247
- var rewardBundleSchema = /* @__PURE__ */ (() => z34.array(rewardSchema).max(10).refine(
4267
+ var rewardBundleSchema = /* @__PURE__ */ (() => z35.array(rewardSchema).max(10).refine(
4248
4268
  (rewards) => new Set(rewards.map(rewardKey)).size === rewards.length,
4249
4269
  "Use one entry per balance or shared reward"
4250
4270
  ))();
4251
- var mediaUrlSchema = /* @__PURE__ */ (() => z34.string().max(2e3).refine((value) => {
4271
+ var mediaUrlSchema = /* @__PURE__ */ (() => z35.string().max(2e3).refine((value) => {
4252
4272
  if (/^\/(?!\/)[^\\\s]*$/.test(value)) {
4253
4273
  return true;
4254
4274
  }
@@ -4258,78 +4278,78 @@ var mediaUrlSchema = /* @__PURE__ */ (() => z34.string().max(2e3).refine((value)
4258
4278
  return false;
4259
4279
  }
4260
4280
  }, "Use an HTTPS URL or a same-site path beginning with /"))();
4261
- var questStepActionSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4262
- z34.object({
4263
- kind: z34.literal("link"),
4281
+ var questStepActionSchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4282
+ z35.object({
4283
+ kind: z35.literal("link"),
4264
4284
  url: mediaUrlSchema.refine(
4265
4285
  (value) => value.startsWith("https://"),
4266
4286
  "Use an HTTPS URL"
4267
4287
  ),
4268
- label: z34.string().trim().min(1).max(120)
4288
+ label: z35.string().trim().min(1).max(120)
4269
4289
  }).strict()
4270
4290
  ]))();
4271
- var questStepSchema = /* @__PURE__ */ (() => z34.object({
4272
- title: z34.string().trim().min(1).max(120),
4273
- description: z34.string().max(4e3).optional(),
4291
+ var questStepSchema = /* @__PURE__ */ (() => z35.object({
4292
+ title: z35.string().trim().min(1).max(120),
4293
+ description: z35.string().max(4e3).optional(),
4274
4294
  action: questStepActionSchema.optional()
4275
4295
  }).strict())();
4276
- var questPresentationRequirementSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4277
- z34.object({ kind: z34.literal("account"), provider: authProviderSchema }).strict(),
4278
- z34.object({ kind: z34.literal("wallet"), chain: walletChainSchema.optional() }).strict()
4296
+ var questPresentationRequirementSchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4297
+ z35.object({ kind: z35.literal("account"), provider: authProviderSchema }).strict(),
4298
+ z35.object({ kind: z35.literal("wallet"), chain: walletChainSchema.optional() }).strict()
4279
4299
  ]))();
4280
- var questPresentationContentSchema = /* @__PURE__ */ (() => z34.object({
4281
- steps: z34.array(questStepSchema).max(30).optional(),
4300
+ var questPresentationContentSchema = /* @__PURE__ */ (() => z35.object({
4301
+ steps: z35.array(questStepSchema).max(30).optional(),
4282
4302
  image: mediaUrlSchema.optional(),
4283
- imageAlt: z34.string().max(500).optional(),
4284
- requirements: z34.array(questPresentationRequirementSchema).max(10).optional()
4303
+ imageAlt: z35.string().max(500).optional(),
4304
+ requirements: z35.array(questPresentationRequirementSchema).max(10).optional()
4285
4305
  }).strict())();
4286
4306
  var questPresentationSchema = /* @__PURE__ */ (() => questPresentationContentSchema.extend({
4287
4307
  quiz: quizQuestionsSchema.optional(),
4288
- instructions: z34.string().max(4e3).optional(),
4289
- video: z34.object({
4308
+ instructions: z35.string().max(4e3).optional(),
4309
+ video: z35.object({
4290
4310
  url: mediaUrlSchema,
4291
4311
  poster: mediaUrlSchema.optional(),
4292
- captions: z34.object({
4312
+ captions: z35.object({
4293
4313
  url: mediaUrlSchema,
4294
- language: z34.string().min(2).max(20),
4295
- label: z34.string().min(1).max(80)
4314
+ language: z35.string().min(2).max(20),
4315
+ label: z35.string().min(1).max(80)
4296
4316
  }).strict().optional()
4297
4317
  }).strict().optional()
4298
4318
  }).strict())();
4299
- var questProfileSchema = /* @__PURE__ */ (() => z34.object({ visible: z34.boolean() }).strict())();
4319
+ var questProfileSchema = /* @__PURE__ */ (() => z35.object({ visible: z35.boolean() }).strict())();
4300
4320
  var evaluatorProtocol = 2;
4301
- var evaluatorProtocolSchema = /* @__PURE__ */ (() => z34.literal(evaluatorProtocol))();
4302
- var questDescriptionSchema = /* @__PURE__ */ (() => z34.object({
4321
+ var evaluatorProtocolSchema = /* @__PURE__ */ (() => z35.literal(evaluatorProtocol))();
4322
+ var questDescriptionSchema = /* @__PURE__ */ (() => z35.object({
4303
4323
  quest: identifier,
4304
4324
  evaluatorProtocol: evaluatorProtocolSchema,
4305
- title: z34.string().min(1).max(120),
4325
+ title: z35.string().min(1).max(120),
4306
4326
  presentation: questPresentationSchema.default({}),
4307
4327
  /** The declared modules this SDK knows. `integrationModules` lists every declared module. */
4308
- integrations: z34.array(evaluatorIntegrationProviderSchema).max(10).default([]),
4328
+ integrations: z35.array(evaluatorIntegrationProviderSchema).max(10).default([]),
4309
4329
  /**
4310
4330
  * Every integration module the quest declares, including providers this SDK does not know: the
4311
4331
  * open sibling of `integrations`. A description omits it when every module is in
4312
4332
  * `integrations`, as descriptions from older SDKs do; Relay's reads always include it.
4313
4333
  */
4314
- integrationModules: z34.array(integrationModuleProviderSchema).max(10).optional(),
4334
+ integrationModules: z35.array(integrationModuleProviderSchema).max(10).optional(),
4315
4335
  fields: settingsFieldsSchema,
4316
4336
  values: settingsValuesSchema,
4317
4337
  rewards: rewardBundleSchema,
4318
4338
  /** Messages Relay posts in connected chats and channels when a completion pays. */
4319
- announcements: z34.array(announcementSchema).max(3).optional(),
4320
- humanReview: z34.boolean(),
4339
+ announcements: z35.array(announcementSchema).max(3).optional(),
4340
+ humanReview: z35.boolean(),
4321
4341
  trigger: triggerSchema,
4322
4342
  performance: contentPerformancePolicySchema.optional(),
4323
- requires: z34.array(prerequisiteSchema).max(30).default([]),
4343
+ requires: z35.array(prerequisiteSchema).max(30).default([]),
4324
4344
  campaign: campaignDefinitionSchema.optional(),
4325
4345
  availability: availabilityWindowSchema.optional(),
4326
- completion: z34.preprocess(refuseStreakTimeZone, completionPolicySchema),
4327
- visibility: z34.enum(["visible", "hidden"]).default("visible"),
4346
+ completion: z35.preprocess(refuseStreakTimeZone, completionPolicySchema),
4347
+ visibility: z35.enum(["visible", "hidden"]).default("visible"),
4328
4348
  /** Whether completions show on participant profiles (`/v1/profiles/:id/completions`). */
4329
4349
  profile: questProfileSchema.default({ visible: false }),
4330
- budgets: z34.array(budgetSchema).max(20).default([]),
4350
+ budgets: z35.array(budgetSchema).max(20).default([]),
4331
4351
  /** Budgets counted per tracker record author; only on quests with a tracker trigger. */
4332
- authorBudgets: z34.array(authorBudgetSchema).max(20).optional(),
4352
+ authorBudgets: z35.array(authorBudgetSchema).max(20).optional(),
4333
4353
  /**
4334
4354
  * Milliseconds a member waits after an attempt is rejected (by the evaluator or a reviewer)
4335
4355
  * before submitting this quest again. Only for quests members submit. Omitted: no cooldown.
@@ -4346,25 +4366,30 @@ var questDescriptionSchema = /* @__PURE__ */ (() => z34.object({
4346
4366
  * one, inside the station's window. Only on quests a signed Solana transaction completes.
4347
4367
  * Experimental.
4348
4368
  */
4349
- stations: questStationsSchema.optional()
4369
+ stations: questStationsSchema.optional(),
4370
+ /**
4371
+ * The photo gallery its accepted photos make up, `{ kind: "wall" | "contest" }`. Only on a quest
4372
+ * whose input is a photo. Experimental.
4373
+ */
4374
+ gallery: questGallerySchema.optional()
4350
4375
  }).strict())();
4351
- var artifactSchema = /* @__PURE__ */ (() => z34.object({ code: z34.string().min(1).max(1e6) }).strict())();
4376
+ var artifactSchema = /* @__PURE__ */ (() => z35.object({ code: z35.string().min(1).max(1e6) }).strict())();
4352
4377
  var releaseSchema = /* @__PURE__ */ (() => artifactSchema.extend({
4353
4378
  /** The SDK runtime the code imports. Absent, the code bundles its own SDK. */
4354
4379
  runtime: sdkRuntimeReferenceSchema.optional(),
4355
4380
  settings: settingsValuesSchema,
4356
4381
  provider: reviewModeSchema,
4357
4382
  expectedRelease: identifier.nullable().optional(),
4358
- settingRenames: z34.record(z34.string(), z34.string()).optional()
4383
+ settingRenames: z35.record(z35.string(), z35.string()).optional()
4359
4384
  }).strict())();
4360
- var batchReleaseSchema = /* @__PURE__ */ (() => z34.object({
4361
- releases: z34.array(releaseSchema).min(1).max(limits.quests)
4385
+ var batchReleaseSchema = /* @__PURE__ */ (() => z35.object({
4386
+ releases: z35.array(releaseSchema).min(1).max(limits.quests)
4362
4387
  }).strict())();
4363
- var questSettingsInputSchema = /* @__PURE__ */ (() => z34.object({
4388
+ var questSettingsInputSchema = /* @__PURE__ */ (() => z35.object({
4364
4389
  quest: identifier,
4365
4390
  expectedRelease: identifier,
4366
4391
  set: settingsValuesSchema,
4367
- reset: z34.array(z34.string()),
4392
+ reset: z35.array(z35.string()),
4368
4393
  /** Replace the editable presentation fields; null restores the code defaults. */
4369
4394
  presentation: questPresentationContentSchema.nullable().optional(),
4370
4395
  /**
@@ -4372,7 +4397,7 @@ var questSettingsInputSchema = /* @__PURE__ */ (() => z34.object({
4372
4397
  * none on chain or to use another; null removes a pasted one. A pasted IDL takes precedence
4373
4398
  * over one the program publishes on chain.
4374
4399
  */
4375
- solanaIdls: z34.record(z34.string(), anchorIdlSchema.nullable()).optional()
4400
+ solanaIdls: z35.record(z35.string(), anchorIdlSchema.nullable()).optional()
4376
4401
  }).strict())();
4377
4402
  var storedQuestDescriptionSchema = /* @__PURE__ */ (() => questDescriptionSchema.extend({
4378
4403
  completion: completionPolicySchema
@@ -4383,20 +4408,20 @@ var publishedReleaseSchema = /* @__PURE__ */ (() => responseShape(
4383
4408
  * Every reward of the quest, kinds this SDK does not know included: the open sibling of
4384
4409
  * `rewards`, which keeps SDK 1.x's closed `Reward`. Absent from older Relay versions.
4385
4410
  */
4386
- rewardEntries: z34.array(rewardEntrySchema).optional(),
4411
+ rewardEntries: z35.array(rewardEntrySchema).optional(),
4387
4412
  key: identifier.optional(),
4388
- code: z34.string(),
4413
+ code: z35.string(),
4389
4414
  /** The SDK runtime `code` imports. Absent, the code bundles its own SDK. */
4390
4415
  runtime: sdkRuntimeReferenceSchema.optional(),
4391
4416
  provider: storedReviewModeSchema,
4392
4417
  id: identifier,
4393
- createdAt: z34.number(),
4394
- origin: z34.object({ typeVersion: identifier }).strict().optional(),
4395
- lifecycle: z34.enum(["active", "paused", "archived"]).default("active"),
4396
- configuration: z34.object({
4418
+ createdAt: z35.number(),
4419
+ origin: z35.object({ typeVersion: identifier }).strict().optional(),
4420
+ lifecycle: z35.enum(["active", "paused", "archived"]).default("active"),
4421
+ configuration: z35.object({
4397
4422
  defaults: settingsValuesSchema,
4398
4423
  overrides: settingsValuesSchema,
4399
- preserved: z34.array(z34.string()),
4424
+ preserved: z35.array(z35.string()),
4400
4425
  presentation: questPresentationContentSchema.optional(),
4401
4426
  presentationDefaults: questPresentationContentSchema.optional()
4402
4427
  }).strict().optional(),
@@ -4405,20 +4430,20 @@ var publishedReleaseSchema = /* @__PURE__ */ (() => responseShape(
4405
4430
  * `settings.solanaProgram()` setting key. Stored when the setting is saved; a setting without
4406
4431
  * an IDL has no entry.
4407
4432
  */
4408
- solanaIdls: z34.record(z34.string(), solanaProgramIdlSchema).optional(),
4433
+ solanaIdls: z35.record(z35.string(), solanaProgramIdlSchema).optional(),
4409
4434
  /**
4410
4435
  * The secret settings (`settings.text({ secret: true })`) that hold a value. Responses leave
4411
4436
  * every secret setting out of `values` and `configuration`; one not listed here is empty.
4412
4437
  * Absent when the release has no secret setting.
4413
4438
  */
4414
- withheldSettings: z34.array(z34.string()).optional()
4439
+ withheldSettings: z35.array(z35.string()).optional()
4415
4440
  })
4416
4441
  ))();
4417
- var templateSchema = /* @__PURE__ */ (() => z34.object({
4418
- code: z34.string(),
4442
+ var templateSchema = /* @__PURE__ */ (() => z35.object({
4443
+ code: z35.string(),
4419
4444
  definition: questDescriptionSchema
4420
4445
  }))();
4421
- var quizAnswersSchema = /* @__PURE__ */ (() => z34.record(identifier, identifier).refine(
4446
+ var quizAnswersSchema = /* @__PURE__ */ (() => z35.record(identifier, identifier).refine(
4422
4447
  (answers) => Object.keys(answers).length > 0 && Object.keys(answers).length <= 50,
4423
4448
  "Provide between 1 and 50 answers"
4424
4449
  ).transform(
@@ -4426,17 +4451,17 @@ var quizAnswersSchema = /* @__PURE__ */ (() => z34.record(identifier, identifier
4426
4451
  Object.entries(answers).sort(([a], [b]) => a.localeCompare(b))
4427
4452
  )
4428
4453
  ))();
4429
- var quizEvidenceSchema = /* @__PURE__ */ (() => z34.object({
4430
- kind: z34.literal("quiz"),
4454
+ var quizEvidenceSchema = /* @__PURE__ */ (() => z35.object({
4455
+ kind: z35.literal("quiz"),
4431
4456
  release: identifier.optional(),
4432
4457
  answers: quizAnswersSchema
4433
4458
  }).strict())();
4434
- var submissionEvidenceSchema = /* @__PURE__ */ (() => z34.union([
4459
+ var submissionEvidenceSchema = /* @__PURE__ */ (() => z35.union([
4435
4460
  quizEvidenceSchema,
4436
4461
  textEvidenceSchema,
4437
4462
  urlEvidenceSchema
4438
4463
  ]))();
4439
- var submitSchema = /* @__PURE__ */ (() => z34.object({
4464
+ var submitSchema = /* @__PURE__ */ (() => z35.object({
4440
4465
  actionId: identifier,
4441
4466
  quest: identifier,
4442
4467
  member: identifier,
@@ -4444,7 +4469,7 @@ var submitSchema = /* @__PURE__ */ (() => z34.object({
4444
4469
  input: submissionEvidenceSchema.optional(),
4445
4470
  release: identifier.optional(),
4446
4471
  /** @deprecated Relay refuses a submission that sets it to `true` and ignores `false`. Removed in 2.0.0. */
4447
- faultAfterReview: z34.boolean().optional()
4472
+ faultAfterReview: z35.boolean().optional()
4448
4473
  }).strict())();
4449
4474
  var AttemptStatus = {
4450
4475
  Queued: "queued",
@@ -4456,13 +4481,13 @@ var AttemptStatus = {
4456
4481
  NeedsReview: "needs-review",
4457
4482
  Failed: "failed"
4458
4483
  };
4459
- var attemptStatusSchema = /* @__PURE__ */ (() => z34.string())();
4484
+ var attemptStatusSchema = /* @__PURE__ */ (() => z35.string())();
4460
4485
  var AttemptCodeSource = {
4461
4486
  Relay: "relay",
4462
4487
  Evaluator: "evaluator"
4463
4488
  };
4464
- var attemptCodeSourceSchema = /* @__PURE__ */ (() => z34.string())();
4465
- var attemptSchema = /* @__PURE__ */ (() => z34.object({
4489
+ var attemptCodeSourceSchema = /* @__PURE__ */ (() => z35.string())();
4490
+ var attemptSchema = /* @__PURE__ */ (() => z35.object({
4466
4491
  id: identifier,
4467
4492
  release: identifier,
4468
4493
  quest: identifier,
@@ -4470,22 +4495,22 @@ var attemptSchema = /* @__PURE__ */ (() => z34.object({
4470
4495
  evidence: identifier.nullable(),
4471
4496
  input: submissionEvidenceSchema.optional(),
4472
4497
  status: attemptStatusSchema,
4473
- reason: z34.string().nullable(),
4474
- retries: z34.number(),
4475
- generation: z34.number(),
4476
- completion: z34.string().nullable(),
4498
+ reason: z35.string().nullable(),
4499
+ retries: z35.number(),
4500
+ generation: z35.number(),
4501
+ completion: z35.string().nullable(),
4477
4502
  reviewRewards: rewardBundleSchema.nullable().default(null),
4478
4503
  /** Scheduled reruns advance this number; failure retries preserve it. */
4479
- evaluationRun: z34.number().int().nonnegative().default(0),
4480
- deferCount: z34.number().int().nonnegative().default(0),
4481
- deferUntil: z34.number().int().safe().nullable().default(null),
4482
- nextEvaluationAt: z34.number().int().safe().nullable().default(null),
4504
+ evaluationRun: z35.number().int().nonnegative().default(0),
4505
+ deferCount: z35.number().int().nonnegative().default(0),
4506
+ deferUntil: z35.number().int().safe().nullable().default(null),
4507
+ nextEvaluationAt: z35.number().int().safe().nullable().default(null),
4483
4508
  /**
4484
4509
  * Open code: consumers must tolerate new values. Relay writes its own codes, such as
4485
4510
  * `budget-exhausted`; an attempt the evaluator rejected with `decision.reject({ reason, code })`
4486
4511
  * carries the evaluator's code in management reads, and null in responses to members.
4487
4512
  */
4488
- code: z34.string().nullable().default(null),
4513
+ code: z35.string().nullable().default(null),
4489
4514
  /**
4490
4515
  * Who wrote `code`: `relay` or `evaluator` (an `AttemptCodeSource`), null when `code` is null.
4491
4516
  * Open: consumers must tolerate new values. An evaluator can reject with a code Relay also writes,
@@ -4498,15 +4523,24 @@ var attemptSchema = /* @__PURE__ */ (() => z34.object({
4498
4523
  * The evaluator asked for human review of a quest with review off, so Domino rejected the attempt
4499
4524
  * with the evaluator's reason. Only set on a rejected attempt.
4500
4525
  */
4501
- requestedReview: z34.boolean().default(false),
4502
- createdAt: z34.number(),
4526
+ requestedReview: z35.boolean().default(false),
4527
+ createdAt: z35.number(),
4503
4528
  /**
4504
4529
  * The action that started the attempt: the signed Solana transaction an app's server submitted
4505
4530
  * with `management.attempts.submitSolanaTransaction()`. Absent for any other attempt.
4506
4531
  *
4507
4532
  * @experimental A minor release can change quest actions.
4508
4533
  */
4509
- action: attemptActionSchema.nullable().optional()
4534
+ action: attemptActionSchema.nullable().optional(),
4535
+ /**
4536
+ * The key of the code station the member checked in at, for an attempt a station's code started
4537
+ * (`management.attempts.submitStationCode()` or the participant client's `quests.checkIn()`).
4538
+ * Such an attempt carries no `action`; its evaluator reads `{ kind: "station-code", reference }`
4539
+ * in `ctx.action`. Absent for any other attempt.
4540
+ *
4541
+ * @experimental A minor release can change check-in stations.
4542
+ */
4543
+ station: z35.string().optional()
4510
4544
  }))();
4511
4545
  var QuestSubmissionStatus = {
4512
4546
  Open: "open",
@@ -4514,9 +4548,9 @@ var QuestSubmissionStatus = {
4514
4548
  Discarded: "discarded",
4515
4549
  Expired: "expired"
4516
4550
  };
4517
- var questSubmissionStatusSchema = /* @__PURE__ */ (() => z34.string())();
4551
+ var questSubmissionStatusSchema = /* @__PURE__ */ (() => z35.string())();
4518
4552
  var questSubmissionSchema = /* @__PURE__ */ (() => responseShape(
4519
- z34.object({
4553
+ z35.object({
4520
4554
  id: identifier,
4521
4555
  quest: identifier,
4522
4556
  member: identifier,
@@ -4526,85 +4560,85 @@ var questSubmissionSchema = /* @__PURE__ */ (() => responseShape(
4526
4560
  /** An uploaded photo's evidence ID. */
4527
4561
  evidence: identifier.nullable(),
4528
4562
  /** Submitting was refused because the quest changed: review the draft before submitting again. */
4529
- reviewRequired: z34.boolean(),
4563
+ reviewRequired: z35.boolean(),
4530
4564
  status: questSubmissionStatusSchema,
4531
4565
  /** The attempt a `submitted` submission admitted. */
4532
4566
  attempt: identifier.nullable(),
4533
- createdAt: z34.number(),
4534
- updatedAt: z34.number(),
4567
+ createdAt: z35.number(),
4568
+ updatedAt: z35.number(),
4535
4569
  /** When an open submission expires unless it changes again. */
4536
- expiresAt: z34.number()
4570
+ expiresAt: z35.number()
4537
4571
  })
4538
4572
  ))();
4539
- var questSubmissionUpdateSchema = /* @__PURE__ */ (() => z34.object({
4573
+ var questSubmissionUpdateSchema = /* @__PURE__ */ (() => z35.object({
4540
4574
  release: identifier.nullable().optional(),
4541
4575
  input: submissionEvidenceSchema.nullable().optional(),
4542
4576
  evidence: identifier.nullable().optional()
4543
4577
  }).strict())();
4544
4578
  var questSubmissionResultSchema = /* @__PURE__ */ (() => responseShape(
4545
- z34.object({
4579
+ z35.object({
4546
4580
  submission: questSubmissionSchema,
4547
4581
  attempt: attemptSchema,
4548
- replayed: z34.boolean()
4582
+ replayed: z35.boolean()
4549
4583
  })
4550
4584
  ))();
4551
- var eventSchema = /* @__PURE__ */ (() => z34.object({
4552
- id: z34.number(),
4553
- attempt: z34.string().nullable(),
4554
- kind: z34.string(),
4555
- detail: z34.string(),
4556
- actor: z34.string().nullable().default(null),
4557
- at: z34.number()
4558
- }))();
4559
- var pickupSelectionSchema = /* @__PURE__ */ (() => z34.object({
4585
+ var eventSchema = /* @__PURE__ */ (() => z35.object({
4586
+ id: z35.number(),
4587
+ attempt: z35.string().nullable(),
4588
+ kind: z35.string(),
4589
+ detail: z35.string(),
4590
+ actor: z35.string().nullable().default(null),
4591
+ at: z35.number()
4592
+ }))();
4593
+ var pickupSelectionSchema = /* @__PURE__ */ (() => z35.object({
4560
4594
  item: identifier,
4561
- revision: z34.number().int().nonnegative()
4595
+ revision: z35.number().int().nonnegative()
4562
4596
  }).strict())();
4563
- var pickupAllocationSchema = /* @__PURE__ */ (() => z34.object({
4597
+ var pickupAllocationSchema = /* @__PURE__ */ (() => z35.object({
4564
4598
  item: identifier,
4565
- label: z34.string().min(1).max(80)
4599
+ label: z35.string().min(1).max(80)
4566
4600
  }).strict())();
4567
- var pickupPolicySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4568
- z34.object({ kind: z34.literal("untracked") }).strict(),
4569
- z34.object({
4570
- kind: z34.literal("at-pickup"),
4571
- tiers: z34.array(
4572
- z34.object({
4601
+ var pickupPolicySchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4602
+ z35.object({ kind: z35.literal("untracked") }).strict(),
4603
+ z35.object({
4604
+ kind: z35.literal("at-pickup"),
4605
+ tiers: z35.array(
4606
+ z35.object({
4573
4607
  tier: identifier,
4574
- variants: z34.array(pickupAllocationSchema).min(1).max(100)
4608
+ variants: z35.array(pickupAllocationSchema).min(1).max(100)
4575
4609
  }).strict()
4576
4610
  ).min(1).max(100)
4577
4611
  }).strict()
4578
4612
  ]))();
4579
- var pickupCatalogSchema = /* @__PURE__ */ (() => z34.object({
4613
+ var pickupCatalogSchema = /* @__PURE__ */ (() => z35.object({
4580
4614
  reward: tieredRewardDefinitionSchema,
4581
- revision: z34.number().int().nonnegative(),
4615
+ revision: z35.number().int().nonnegative(),
4582
4616
  policy: pickupPolicySchema
4583
4617
  }))();
4584
- var pickupAvailabilitySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4585
- z34.object({ kind: z34.literal("untracked") }).strict(),
4586
- z34.object({
4587
- kind: z34.literal("at-pickup"),
4588
- revision: z34.number().int().nonnegative(),
4589
- variants: z34.array(
4618
+ var pickupAvailabilitySchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4619
+ z35.object({ kind: z35.literal("untracked") }).strict(),
4620
+ z35.object({
4621
+ kind: z35.literal("at-pickup"),
4622
+ revision: z35.number().int().nonnegative(),
4623
+ variants: z35.array(
4590
4624
  pickupAllocationSchema.extend({
4591
- available: z34.number().int().nonnegative()
4625
+ available: z35.number().int().nonnegative()
4592
4626
  })
4593
4627
  )
4594
4628
  }).strict()
4595
4629
  ]))();
4596
- var configurePickupSchema = /* @__PURE__ */ (() => z34.object({
4630
+ var configurePickupSchema = /* @__PURE__ */ (() => z35.object({
4597
4631
  reward: identifier,
4598
- revision: z34.number().int().nonnegative(),
4632
+ revision: z35.number().int().nonnegative(),
4599
4633
  actionId: identifier,
4600
- policy: z34.discriminatedUnion("kind", [
4601
- z34.object({ kind: z34.literal("untracked") }).strict(),
4602
- z34.object({
4603
- kind: z34.literal("at-pickup"),
4604
- tiers: z34.array(
4605
- z34.object({
4634
+ policy: z35.discriminatedUnion("kind", [
4635
+ z35.object({ kind: z35.literal("untracked") }).strict(),
4636
+ z35.object({
4637
+ kind: z35.literal("at-pickup"),
4638
+ tiers: z35.array(
4639
+ z35.object({
4606
4640
  tier: identifier,
4607
- variants: z34.array(
4641
+ variants: z35.array(
4608
4642
  pickupAllocationSchema.extend({
4609
4643
  item: identifier.optional()
4610
4644
  })
@@ -4614,10 +4648,10 @@ var configurePickupSchema = /* @__PURE__ */ (() => z34.object({
4614
4648
  }).strict()
4615
4649
  ])
4616
4650
  }).strict())();
4617
- var entitlementRecoverySchema = /* @__PURE__ */ (() => z34.object({
4651
+ var entitlementRecoverySchema = /* @__PURE__ */ (() => z35.object({
4618
4652
  completion: identifier,
4619
- reason: z34.string(),
4620
- flaggedAt: z34.number(),
4653
+ reason: z35.string(),
4654
+ flaggedAt: z35.number(),
4621
4655
  /** Null means no accepted completion currently earns this reward. */
4622
4656
  remainingTier: identifier.nullable()
4623
4657
  }))();
@@ -4627,40 +4661,40 @@ var entitlementBase = /* @__PURE__ */ (() => ({
4627
4661
  reward: tieredRewardDefinitionSchema,
4628
4662
  earnedTier: identifier,
4629
4663
  tier: identifier,
4630
- revision: z34.number().int().positive()
4664
+ revision: z35.number().int().positive()
4631
4665
  }))();
4632
- var entitlementStateSchema = /* @__PURE__ */ (() => z34.discriminatedUnion("status", [
4633
- z34.object({ ...entitlementBase, status: z34.literal("available") }).strict(),
4634
- z34.object({
4666
+ var entitlementStateSchema = /* @__PURE__ */ (() => z35.discriminatedUnion("status", [
4667
+ z35.object({ ...entitlementBase, status: z35.literal("available") }).strict(),
4668
+ z35.object({
4635
4669
  ...entitlementBase,
4636
- status: z34.literal("handing-over"),
4670
+ status: z35.literal("handing-over"),
4637
4671
  handover: identifier,
4638
- startedAt: z34.number(),
4672
+ startedAt: z35.number(),
4639
4673
  allocation: pickupAllocationSchema.optional()
4640
4674
  }).strict(),
4641
- z34.object({
4675
+ z35.object({
4642
4676
  ...entitlementBase,
4643
- status: z34.literal("collected"),
4677
+ status: z35.literal("collected"),
4644
4678
  handover: identifier,
4645
- startedAt: z34.number(),
4679
+ startedAt: z35.number(),
4646
4680
  allocation: pickupAllocationSchema.optional(),
4647
- collectedAt: z34.number(),
4681
+ collectedAt: z35.number(),
4648
4682
  recovery: entitlementRecoverySchema.optional()
4649
4683
  }).strict(),
4650
4684
  // An operator voided it: it can no longer be handed over. A quest grant of the same reward to
4651
4685
  // the member (the same grant key) makes it available again; a voided referral reward stays void.
4652
- z34.object({
4686
+ z35.object({
4653
4687
  ...entitlementBase,
4654
- status: z34.literal("void"),
4655
- voidedAt: z34.number()
4688
+ status: z35.literal("void"),
4689
+ voidedAt: z35.number()
4656
4690
  }).strict()
4657
4691
  ]))();
4658
- var tieredRewardReadSchema = /* @__PURE__ */ (() => z34.object({
4692
+ var tieredRewardReadSchema = /* @__PURE__ */ (() => z35.object({
4659
4693
  id: identifier,
4660
- title: z34.string(),
4661
- tiers: z34.array(z34.object({ id: identifier, title: z34.string() }).loose()),
4662
- inventory: z34.object({ kind: z34.string() }).loose(),
4663
- fulfillment: z34.object({ kind: z34.string() }).loose(),
4694
+ title: z35.string(),
4695
+ tiers: z35.array(z35.object({ id: identifier, title: z35.string() }).loose()),
4696
+ inventory: z35.object({ kind: z35.string() }).loose(),
4697
+ fulfillment: z35.object({ kind: z35.string() }).loose(),
4664
4698
  /**
4665
4699
  * The key given to defineTieredReward, or null for a reward created without one. Management
4666
4700
  * reads carry it; participant reads and Relay versions before it leave it out.
@@ -4673,63 +4707,63 @@ var entitlementReadBase = /* @__PURE__ */ (() => ({
4673
4707
  reward: tieredRewardReadSchema,
4674
4708
  earnedTier: identifier,
4675
4709
  tier: identifier,
4676
- revision: z34.number().int()
4710
+ revision: z35.number().int()
4677
4711
  }))();
4678
- var allocationReadSchema = /* @__PURE__ */ (() => z34.object({ item: identifier, label: z34.string() }).loose())();
4679
- var entitlementSchema = /* @__PURE__ */ (() => z34.union([
4680
- z34.discriminatedUnion("status", [
4681
- z34.object({ ...entitlementReadBase, status: z34.literal("available") }).loose(),
4682
- z34.object({
4712
+ var allocationReadSchema = /* @__PURE__ */ (() => z35.object({ item: identifier, label: z35.string() }).loose())();
4713
+ var entitlementSchema = /* @__PURE__ */ (() => z35.union([
4714
+ z35.discriminatedUnion("status", [
4715
+ z35.object({ ...entitlementReadBase, status: z35.literal("available") }).loose(),
4716
+ z35.object({
4683
4717
  ...entitlementReadBase,
4684
- status: z34.literal("handing-over"),
4718
+ status: z35.literal("handing-over"),
4685
4719
  handover: identifier,
4686
- startedAt: z34.number(),
4720
+ startedAt: z35.number(),
4687
4721
  allocation: allocationReadSchema.optional()
4688
4722
  }).loose(),
4689
- z34.object({
4723
+ z35.object({
4690
4724
  ...entitlementReadBase,
4691
- status: z34.literal("collected"),
4725
+ status: z35.literal("collected"),
4692
4726
  handover: identifier,
4693
- startedAt: z34.number(),
4727
+ startedAt: z35.number(),
4694
4728
  allocation: allocationReadSchema.optional(),
4695
- collectedAt: z34.number(),
4729
+ collectedAt: z35.number(),
4696
4730
  recovery: entitlementRecoverySchema.optional()
4697
4731
  }).loose(),
4698
- z34.object({
4732
+ z35.object({
4699
4733
  ...entitlementReadBase,
4700
- status: z34.literal("void"),
4701
- voidedAt: z34.number()
4734
+ status: z35.literal("void"),
4735
+ voidedAt: z35.number()
4702
4736
  }).loose()
4703
4737
  ]),
4704
- z34.object({ ...entitlementReadBase, status: z34.string() }).loose().transform(({ status, ...entitlement }) => ({
4738
+ z35.object({ ...entitlementReadBase, status: z35.string() }).loose().transform(({ status, ...entitlement }) => ({
4705
4739
  ...entitlement,
4706
4740
  status: "unsupported",
4707
4741
  reportedStatus: status
4708
4742
  }))
4709
4743
  ]))();
4710
- var beginHandoverSchema = /* @__PURE__ */ (() => z34.object({
4744
+ var beginHandoverSchema = /* @__PURE__ */ (() => z35.object({
4711
4745
  actionId: identifier,
4712
- revision: z34.number().int().positive(),
4746
+ revision: z35.number().int().positive(),
4713
4747
  selection: pickupSelectionSchema.optional()
4714
4748
  }).strict())();
4715
- var confirmHandoverSchema = /* @__PURE__ */ (() => z34.object({ actionId: identifier, handover: identifier }).strict())();
4716
- var entitlementCorrectionSchema = /* @__PURE__ */ (() => z34.object({
4749
+ var confirmHandoverSchema = /* @__PURE__ */ (() => z35.object({ actionId: identifier, handover: identifier }).strict())();
4750
+ var entitlementCorrectionSchema = /* @__PURE__ */ (() => z35.object({
4717
4751
  actionId: identifier,
4718
- revision: z34.number().int().positive(),
4719
- reason: z34.string().trim().min(1).max(500)
4752
+ revision: z35.number().int().positive(),
4753
+ reason: z35.string().trim().min(1).max(500)
4720
4754
  }).strict())();
4721
4755
  var CompletionSourceKind = {
4722
4756
  Quest: "quest",
4723
4757
  Leaderboard: "leaderboard"
4724
4758
  };
4725
- var completionSourceKindSchema = /* @__PURE__ */ (() => z34.string().min(1).max(64))();
4726
- var completionSourceSchema = /* @__PURE__ */ (() => z34.object({
4759
+ var completionSourceKindSchema = /* @__PURE__ */ (() => z35.string().min(1).max(64))();
4760
+ var completionSourceSchema = /* @__PURE__ */ (() => z35.object({
4727
4761
  kind: completionSourceKindSchema,
4728
4762
  id: identifier
4729
4763
  }))();
4730
- var completionRecordSchema = /* @__PURE__ */ (() => z34.object({
4764
+ var completionRecordSchema = /* @__PURE__ */ (() => z35.object({
4731
4765
  /** The occurrence the completion consumed. For a leaderboard prize, the settlement ID. */
4732
- key: z34.string().default("once"),
4766
+ key: z35.string().default("once"),
4733
4767
  id: identifier,
4734
4768
  /** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
4735
4769
  quest: identifier,
@@ -4737,19 +4771,19 @@ var completionRecordSchema = /* @__PURE__ */ (() => z34.object({
4737
4771
  /** What paid the completion. `source.id` repeats `quest`. */
4738
4772
  source: completionSourceSchema.optional()
4739
4773
  }))();
4740
- var questAvailabilitySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kind", [
4741
- z34.object({
4742
- kind: z34.literal("available"),
4743
- input: z34.enum(["photo", "quiz", "none", "text", "url"])
4774
+ var questAvailabilitySchema = /* @__PURE__ */ (() => z35.discriminatedUnion("kind", [
4775
+ z35.object({
4776
+ kind: z35.literal("available"),
4777
+ input: z35.enum(["photo", "quiz", "none", "text", "url"])
4744
4778
  }).strict(),
4745
- z34.object({ kind: z34.literal("completed") }).strict(),
4746
- z34.object({
4747
- kind: z34.literal("locked"),
4748
- missing: z34.array(missingPrerequisiteSchema).min(1)
4779
+ z35.object({ kind: z35.literal("completed") }).strict(),
4780
+ z35.object({
4781
+ kind: z35.literal("locked"),
4782
+ missing: z35.array(missingPrerequisiteSchema).min(1)
4749
4783
  }).strict(),
4750
- z34.object({
4751
- kind: z34.literal("blocked"),
4752
- reason: z34.enum([
4784
+ z35.object({
4785
+ kind: z35.literal("blocked"),
4786
+ reason: z35.enum([
4753
4787
  "budget-exhausted",
4754
4788
  "connection-required",
4755
4789
  "wallet-required",
@@ -4758,56 +4792,56 @@ var questAvailabilitySchema = /* @__PURE__ */ (() => z34.discriminatedUnion("kin
4758
4792
  "enrollment-required"
4759
4793
  ]),
4760
4794
  /** Which window refused admission when `reason` is `outside-window`. */
4761
- window: z34.enum(["tracker", "quest"]).optional(),
4762
- resetsAt: z34.number().int().safe().optional()
4795
+ window: z35.enum(["tracker", "quest"]).optional(),
4796
+ resetsAt: z35.number().int().safe().optional()
4763
4797
  }).strict(),
4764
- z34.object({ kind: z34.literal("staff-required") }).strict(),
4765
- z34.object({ kind: z34.literal("automatic") }).strict(),
4766
- z34.object({ kind: z34.literal("checking"), attempt: identifier }).strict(),
4767
- z34.object({ kind: z34.literal("needs-review"), attempt: identifier }).strict(),
4768
- z34.object({ kind: z34.literal("retryable"), attempt: identifier }).strict()
4798
+ z35.object({ kind: z35.literal("staff-required") }).strict(),
4799
+ z35.object({ kind: z35.literal("automatic") }).strict(),
4800
+ z35.object({ kind: z35.literal("checking"), attempt: identifier }).strict(),
4801
+ z35.object({ kind: z35.literal("needs-review"), attempt: identifier }).strict(),
4802
+ z35.object({ kind: z35.literal("retryable"), attempt: identifier }).strict()
4769
4803
  ]))();
4770
- var questAvailabilityResponseSchema = /* @__PURE__ */ (() => z34.union(
4804
+ var questAvailabilityResponseSchema = /* @__PURE__ */ (() => z35.union(
4771
4805
  questAvailabilitySchema.options.map((option) => option.strip())
4772
4806
  ))();
4773
- var questBudgetViewSchema = /* @__PURE__ */ (() => z34.object({
4807
+ var questBudgetViewSchema = /* @__PURE__ */ (() => z35.object({
4774
4808
  id: identifier,
4775
- scope: z34.enum(["member", "project"]),
4776
- period: z34.enum(["day", "week", "month", "lifetime"]),
4777
- remaining: z34.number().int().safe().nonnegative(),
4778
- resetsAt: z34.number().int().safe().nullable()
4809
+ scope: z35.enum(["member", "project"]),
4810
+ period: z35.enum(["day", "week", "month", "lifetime"]),
4811
+ remaining: z35.number().int().safe().nonnegative(),
4812
+ resetsAt: z35.number().int().safe().nullable()
4779
4813
  }))();
4780
4814
  var memberProgressSchema = /* @__PURE__ */ (() => responseShape(
4781
- z34.object({
4815
+ z35.object({
4782
4816
  member: identifier,
4783
- quests: z34.array(
4784
- z34.object({
4817
+ quests: z35.array(
4818
+ z35.object({
4785
4819
  quest: identifier,
4786
4820
  key: identifier.optional(),
4787
4821
  release: identifier.optional(),
4788
- title: z34.string(),
4822
+ title: z35.string(),
4789
4823
  presentation: questPresentationSchema.default({}),
4790
- connections: z34.array(authProviderSchema).default([]),
4824
+ connections: z35.array(authProviderSchema).default([]),
4791
4825
  trigger: triggerResponseSchema,
4792
4826
  availability: questAvailabilityResponseSchema,
4793
- completed: z34.boolean(),
4827
+ completed: z35.boolean(),
4794
4828
  completion: completionPolicySchema.default({ kind: "once" }),
4795
4829
  streak: streakProgressSchema.nullable().optional(),
4796
4830
  counter: counterProgressSchema.nullable().optional(),
4797
4831
  /** Latest attempt's committed evaluator progress, while it remains deferred/evaluating. */
4798
4832
  progress: evaluatorProgressSchema.nullable().default(null),
4799
- completionCount: z34.number().int().nonnegative().default(0),
4800
- visibility: z34.enum(["visible", "hidden"]).default("visible"),
4801
- missing: z34.array(missingPrerequisiteSchema),
4833
+ completionCount: z35.number().int().nonnegative().default(0),
4834
+ visibility: z35.enum(["visible", "hidden"]).default("visible"),
4835
+ missing: z35.array(missingPrerequisiteSchema),
4802
4836
  campaign: campaignViewSchema.nullable().default(null),
4803
4837
  window: availabilityWindowSchema.nullable().default(null),
4804
- budgets: z34.array(questBudgetViewSchema).default([]),
4838
+ budgets: z35.array(questBudgetViewSchema).default([]),
4805
4839
  /**
4806
4840
  * Unix milliseconds when the member may submit again, while the quest's retry cooldown
4807
4841
  * after their rejected attempt runs. Until then a new attempt is refused with
4808
4842
  * `retry-cooldown`. Absent when no cooldown is running.
4809
4843
  */
4810
- retryAt: z34.number().int().safe().optional(),
4844
+ retryAt: z35.number().int().safe().optional(),
4811
4845
  /**
4812
4846
  * Unix milliseconds when the member may next submit the quest, while it waits on something
4813
4847
  * that ends by itself: the retry cooldown after a rejection, the completion cooldown after
@@ -4816,128 +4850,126 @@ var memberProgressSchema = /* @__PURE__ */ (() => responseShape(
4816
4850
  * several apply; use it for countdowns. Absent when the member can submit now, or when
4817
4851
  * nothing will reopen the quest (a used-up lifetime budget, a closed window).
4818
4852
  */
4819
- nextAvailableAt: z34.number().int().safe().optional(),
4853
+ nextAvailableAt: z35.number().int().safe().optional(),
4820
4854
  attempt: attemptSchema.nullable()
4821
4855
  })
4822
4856
  ),
4823
- entitlements: z34.array(entitlementSchema)
4857
+ entitlements: z35.array(entitlementSchema)
4824
4858
  })
4825
4859
  ))();
4826
4860
  var snapshotSchema = /* @__PURE__ */ (() => responseShape(
4827
- z34.object({
4828
- releases: z34.array(publishedReleaseSchema),
4829
- completions: z34.array(completionRecordSchema),
4830
- entitlements: z34.array(entitlementSchema),
4831
- attempts: z34.array(attemptSchema),
4832
- balances: z34.array(
4833
- z34.object({
4834
- member: z34.string(),
4835
- balance: z34.string(),
4836
- earned: z34.number(),
4837
- held: z34.number(),
4838
- available: z34.number()
4861
+ z35.object({
4862
+ releases: z35.array(publishedReleaseSchema),
4863
+ completions: z35.array(completionRecordSchema),
4864
+ entitlements: z35.array(entitlementSchema),
4865
+ attempts: z35.array(attemptSchema),
4866
+ balances: z35.array(
4867
+ z35.object({
4868
+ member: z35.string(),
4869
+ balance: z35.string(),
4870
+ earned: z35.number(),
4871
+ held: z35.number(),
4872
+ available: z35.number()
4839
4873
  })
4840
4874
  ),
4841
- events: z34.array(eventSchema)
4875
+ events: z35.array(eventSchema)
4842
4876
  })
4843
4877
  ))();
4844
- var evidenceSchema = /* @__PURE__ */ (() => z34.object({
4878
+ var evidenceSchema = /* @__PURE__ */ (() => z35.object({
4845
4879
  id: identifier,
4846
4880
  member: identifier,
4847
- type: z34.enum(["image/jpeg", "image/png"]),
4848
- size: z34.number()
4881
+ type: z35.enum(["image/jpeg", "image/png"]),
4882
+ size: z35.number()
4849
4883
  }))();
4850
- var errorSchema = /* @__PURE__ */ (() => z34.object({
4851
- error: z34.string(),
4852
- code: z34.string().optional(),
4884
+ var errorSchema = /* @__PURE__ */ (() => z35.object({
4885
+ error: z35.string(),
4886
+ code: z35.string().optional(),
4853
4887
  /** Which window refused admission when `code` is `outside-window`. */
4854
- window: z34.enum(["tracker", "quest"]).optional(),
4855
- missing: z34.array(missingPrerequisiteSchema).optional(),
4888
+ window: z35.enum(["tracker", "quest"]).optional(),
4889
+ missing: z35.array(missingPrerequisiteSchema).optional(),
4856
4890
  /**
4857
4891
  * Unix milliseconds when the member may submit again, when `code` is `retry-cooldown` or
4858
4892
  * `completion-cooldown`.
4859
4893
  */
4860
- retryAt: z34.number().int().safe().optional()
4894
+ retryAt: z35.number().int().safe().optional()
4861
4895
  }))();
4862
- var staffDecisionSchema = /* @__PURE__ */ (() => z34.object({
4896
+ var staffDecisionSchema = /* @__PURE__ */ (() => z35.object({
4863
4897
  actionId: identifier,
4864
- generation: z34.number().int().nonnegative(),
4865
- decision: z34.enum(["accept", "reject"]),
4866
- reason: z34.string().trim().min(1).max(2e3)
4898
+ generation: z35.number().int().nonnegative(),
4899
+ decision: z35.enum(["accept", "reject"]),
4900
+ reason: z35.string().trim().min(1).max(2e3)
4867
4901
  }).strict())();
4868
- var acceptAnywaySchema = /* @__PURE__ */ (() => z34.object({
4902
+ var staffReasonInputSchema = /* @__PURE__ */ (() => z35.object({
4869
4903
  actionId: identifier,
4870
- reason: z34.string().trim().min(1).max(2e3)
4904
+ reason: z35.string().trim().min(1).max(2e3)
4871
4905
  }).strict())();
4872
- var evidenceRedactionInputSchema = /* @__PURE__ */ (() => z34.object({
4873
- actionId: identifier,
4874
- reason: z34.string().trim().min(1).max(2e3)
4875
- }).strict())();
4876
- var evidenceRetentionInputSchema = /* @__PURE__ */ (() => z34.object({
4906
+ var acceptAnywaySchema = staffReasonInputSchema;
4907
+ var evidenceRedactionInputSchema = staffReasonInputSchema;
4908
+ var evidenceRetentionInputSchema = /* @__PURE__ */ (() => z35.object({
4877
4909
  actionId: identifier,
4878
4910
  quest: identifier,
4879
- decidedBefore: z34.number().int().nonnegative(),
4880
- reason: z34.string().trim().min(1).max(2e3)
4911
+ decidedBefore: z35.number().int().nonnegative(),
4912
+ reason: z35.string().trim().min(1).max(2e3)
4881
4913
  }).strict())();
4882
- var evidenceRetentionPeriodSchema = /* @__PURE__ */ (() => z34.union([
4883
- z34.object({ days: z34.number().int().min(1).max(3650) }).strict(),
4884
- z34.literal("keep")
4914
+ var evidenceRetentionPeriodSchema = /* @__PURE__ */ (() => z35.union([
4915
+ z35.object({ days: z35.number().int().min(1).max(3650) }).strict(),
4916
+ z35.literal("keep")
4885
4917
  ]))();
4886
- var evidenceRetentionSettingInputSchema = /* @__PURE__ */ (() => z34.object({
4918
+ var evidenceRetentionSettingInputSchema = /* @__PURE__ */ (() => z35.object({
4887
4919
  actionId: identifier,
4888
4920
  evidenceRetention: evidenceRetentionPeriodSchema
4889
4921
  }).strict())();
4890
- var stockSchema = /* @__PURE__ */ (() => z34.object({ item: identifier, quantity: z34.number().int().min(0).max(1e4) }).strict())();
4891
- var reservationSchema = /* @__PURE__ */ (() => z34.object({
4922
+ var stockSchema = /* @__PURE__ */ (() => z35.object({ item: identifier, quantity: z35.number().int().min(0).max(1e4) }).strict())();
4923
+ var reservationSchema = /* @__PURE__ */ (() => z35.object({
4892
4924
  actionId: identifier,
4893
4925
  member: identifier,
4894
4926
  item: identifier,
4895
4927
  balance: identifier,
4896
- price: z34.number().int().positive().max(1e4)
4928
+ price: z35.number().int().positive().max(1e4)
4897
4929
  }).strict())();
4898
4930
  var pageOptions = /* @__PURE__ */ (() => ({
4899
- limit: z34.number().int().min(1).max(100).default(25),
4900
- cursor: z34.string().min(1).max(4096).optional()
4931
+ limit: z35.number().int().min(1).max(100).default(25),
4932
+ cursor: z35.string().min(1).max(4096).optional()
4901
4933
  }))();
4902
- var reviewListSchema = /* @__PURE__ */ (() => z34.object({
4934
+ var reviewListSchema = /* @__PURE__ */ (() => z35.object({
4903
4935
  ...pageOptions,
4904
4936
  member: identifier.optional(),
4905
4937
  quest: identifier.optional()
4906
4938
  }).strict())();
4907
- var memberListSchema = /* @__PURE__ */ (() => z34.object({
4939
+ var memberListSchema = /* @__PURE__ */ (() => z35.object({
4908
4940
  ...pageOptions,
4909
4941
  prefix: identifier.optional()
4910
4942
  }).strict())();
4911
- var reviewItemSchema = /* @__PURE__ */ (() => z34.object({
4943
+ var reviewItemSchema = /* @__PURE__ */ (() => z35.object({
4912
4944
  attempt: attemptSchema,
4913
- title: z34.string(),
4914
- checks: z34.array(
4915
- z34.object({ criteria: z34.string(), result: photoResultSchema })
4945
+ title: z35.string(),
4946
+ checks: z35.array(
4947
+ z35.object({ criteria: z35.string(), result: photoResultSchema })
4916
4948
  )
4917
4949
  }))();
4918
- var reviewPageSchema = /* @__PURE__ */ (() => z34.object({
4919
- items: z34.array(reviewItemSchema).max(100),
4920
- nextCursor: z34.string().nullable()
4950
+ var reviewPageSchema = /* @__PURE__ */ (() => z35.object({
4951
+ items: z35.array(reviewItemSchema).max(100),
4952
+ nextCursor: z35.string().nullable()
4921
4953
  }))();
4922
- var memberPageSchema = /* @__PURE__ */ (() => z34.object({
4923
- items: z34.array(z34.object({ member: identifier })).max(100),
4924
- nextCursor: z34.string().nullable()
4954
+ var memberPageSchema = /* @__PURE__ */ (() => z35.object({
4955
+ items: z35.array(z35.object({ member: identifier })).max(100),
4956
+ nextCursor: z35.string().nullable()
4925
4957
  }))();
4926
- var createStockItemSchema = /* @__PURE__ */ (() => z34.object({ actionId: identifier, name: z34.string().trim().min(1).max(80) }).strict())();
4927
- var stockItemSchema = /* @__PURE__ */ (() => z34.object({ id: identifier, name: z34.string() }))();
4928
- var contentPerformanceSnapshotSchema = /* @__PURE__ */ (() => z34.strictObject({
4958
+ var createStockItemSchema = /* @__PURE__ */ (() => z35.object({ actionId: identifier, name: z35.string().trim().min(1).max(80) }).strict())();
4959
+ var stockItemSchema = /* @__PURE__ */ (() => z35.object({ id: identifier, name: z35.string() }))();
4960
+ var contentPerformanceSnapshotSchema = /* @__PURE__ */ (() => z35.strictObject({
4929
4961
  contentAttempt: identifier,
4930
4962
  observation: identifier,
4931
- observedAt: z34.number().int().safe().nonnegative(),
4963
+ observedAt: z35.number().int().safe().nonnegative(),
4932
4964
  metrics: contentMetricsSchema,
4933
4965
  rewards: rewardBundleSchema
4934
4966
  }))();
4935
4967
  var contentPerformanceQuerySchema = /* @__PURE__ */ (() => contentQualificationQuerySchema.extend({
4936
- content: z34.string().min(1).max(256)
4968
+ content: z35.string().min(1).max(256)
4937
4969
  }))();
4938
- var contentPerformancePageSchema = /* @__PURE__ */ (() => z34.strictObject({
4939
- current: z34.strictObject({
4940
- state: z34.enum([
4970
+ var contentPerformancePageSchema = /* @__PURE__ */ (() => z35.strictObject({
4971
+ current: z35.strictObject({
4972
+ state: z35.enum([
4941
4973
  "content-pending",
4942
4974
  "content-unqualified",
4943
4975
  "waiting",
@@ -4948,19 +4980,19 @@ var contentPerformancePageSchema = /* @__PURE__ */ (() => z34.strictObject({
4948
4980
  "failed",
4949
4981
  "superseded"
4950
4982
  ]),
4951
- reason: z34.string().nullable(),
4983
+ reason: z35.string().nullable(),
4952
4984
  contentAttempt: identifier,
4953
4985
  attempt: identifier.nullable(),
4954
4986
  reward: contentQualificationSchema.shape.reward
4955
4987
  }),
4956
- items: z34.array(
4957
- z34.strictObject({
4988
+ items: z35.array(
4989
+ z35.strictObject({
4958
4990
  attempt: identifier,
4959
4991
  contentAttempt: identifier,
4960
4992
  observation: identifier,
4961
- observedAt: z34.number(),
4993
+ observedAt: z35.number(),
4962
4994
  metrics: contentMetricsSchema,
4963
- state: z34.enum([
4995
+ state: z35.enum([
4964
4996
  "pending",
4965
4997
  "qualified",
4966
4998
  "unqualified",
@@ -4968,43 +5000,43 @@ var contentPerformancePageSchema = /* @__PURE__ */ (() => z34.strictObject({
4968
5000
  "failed",
4969
5001
  "superseded"
4970
5002
  ]),
4971
- reason: z34.string().nullable()
5003
+ reason: z35.string().nullable()
4972
5004
  })
4973
5005
  ),
4974
5006
  nextCursor: pageCursorSchema.nullable()
4975
5007
  }))();
4976
5008
 
4977
5009
  // src/point-ledgers.ts
4978
- import * as z35 from "zod";
4979
- var pointLedgerPropertiesSchema = /* @__PURE__ */ (() => z35.object({
4980
- name: z35.string().trim().min(1).max(120),
4981
- description: z35.string().trim().max(1e3).default("")
5010
+ import * as z36 from "zod";
5011
+ var pointLedgerPropertiesSchema = /* @__PURE__ */ (() => z36.object({
5012
+ name: z36.string().trim().min(1).max(120),
5013
+ description: z36.string().trim().max(1e3).default("")
4982
5014
  }).strict())();
4983
5015
  var createPointLedgerSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({ actionId: identifier, key: identifier.optional() }).strict())();
4984
5016
  var pointLedgerSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({
4985
5017
  id: identifier
4986
5018
  }))();
4987
5019
  var managedPointLedgerSchema = /* @__PURE__ */ (() => pointLedgerSchema.extend({
4988
- archivedAt: z35.number().int().nonnegative().nullable()
5020
+ archivedAt: z36.number().int().nonnegative().nullable()
4989
5021
  }))();
4990
5022
  var pointLedgerDeclarationSchema = /* @__PURE__ */ (() => pointLedgerPropertiesSchema.extend({ key: identifier }).strict())();
4991
- var pointLedgerArtifactSchema = /* @__PURE__ */ (() => z35.union([
5023
+ var pointLedgerArtifactSchema = /* @__PURE__ */ (() => z36.union([
4992
5024
  pointLedgerDeclarationSchema,
4993
- z35.object({ code: z35.string().min(1).max(2e6) }).strict()
5025
+ z36.object({ code: z36.string().min(1).max(2e6) }).strict()
4994
5026
  ]))();
4995
- var pointLedgerReferenceSchema = /* @__PURE__ */ (() => z35.object({
5027
+ var pointLedgerReferenceSchema = /* @__PURE__ */ (() => z36.object({
4996
5028
  id: identifier,
4997
5029
  key: identifier.nullable(),
4998
- name: z35.string()
5030
+ name: z36.string()
4999
5031
  }))();
5000
- var points = /* @__PURE__ */ (() => z35.number().int().safe())();
5001
- var pointBalanceSchema = /* @__PURE__ */ (() => z35.object({
5032
+ var points = /* @__PURE__ */ (() => z36.number().int().safe())();
5033
+ var pointBalanceSchema = /* @__PURE__ */ (() => z36.object({
5002
5034
  ledger: pointLedgerReferenceSchema,
5003
5035
  balance: points,
5004
5036
  available: points
5005
5037
  }))();
5006
- var pointBalancesSchema = /* @__PURE__ */ (() => z35.object({
5007
- items: z35.array(pointBalanceSchema)
5038
+ var pointBalancesSchema = /* @__PURE__ */ (() => z36.object({
5039
+ items: z36.array(pointBalanceSchema)
5008
5040
  }))();
5009
5041
  var PointEntryKind = {
5010
5042
  /** Points a quest completion, an engagement settlement or an operator awarded. */
@@ -5016,8 +5048,8 @@ var PointEntryKind = {
5016
5048
  /** Undoes part or all of an award or a positive adjustment (`reverses`). */
5017
5049
  Reverse: "reverse"
5018
5050
  };
5019
- var pointEntryKindSchema = /* @__PURE__ */ (() => z35.string().min(1).max(64))();
5020
- var pointEntrySchema = /* @__PURE__ */ (() => z35.object({
5051
+ var pointEntryKindSchema = /* @__PURE__ */ (() => z36.string().min(1).max(64))();
5052
+ var pointEntrySchema = /* @__PURE__ */ (() => z36.object({
5021
5053
  id: identifier,
5022
5054
  amount: points,
5023
5055
  kind: pointEntryKindSchema,
@@ -5029,29 +5061,29 @@ var pointEntrySchema = /* @__PURE__ */ (() => z35.object({
5029
5061
  * True for an opening balance a member import recorded (an `adjust`). Absent from Relay
5030
5062
  * versions without imports.
5031
5063
  */
5032
- imported: z35.boolean().optional()
5064
+ imported: z36.boolean().optional()
5033
5065
  }))();
5034
- var pointHistoryQuerySchema = /* @__PURE__ */ (() => z35.strictObject({
5066
+ var pointHistoryQuerySchema = /* @__PURE__ */ (() => z36.strictObject({
5035
5067
  ledger: identifier,
5036
5068
  cursor: pageCursorSchema.optional()
5037
5069
  }))();
5038
- var pointHistoryPageSchema = /* @__PURE__ */ (() => z35.object({
5039
- items: z35.array(pointEntrySchema),
5070
+ var pointHistoryPageSchema = /* @__PURE__ */ (() => z36.object({
5071
+ items: z36.array(pointEntrySchema),
5040
5072
  nextCursor: pageCursorSchema.nullable()
5041
5073
  }))();
5042
5074
 
5043
5075
  // src/profiles.ts
5044
- import * as z36 from "zod";
5045
- var count3 = /* @__PURE__ */ (() => z36.number().int().nonnegative().safe())();
5046
- var profileVisibilitySchema = /* @__PURE__ */ (() => z36.enum([
5076
+ import * as z37 from "zod";
5077
+ var count3 = /* @__PURE__ */ (() => z37.number().int().nonnegative().safe())();
5078
+ var profileVisibilitySchema = /* @__PURE__ */ (() => z37.enum([
5047
5079
  "private",
5048
5080
  "participants",
5049
5081
  "public"
5050
5082
  ]))();
5051
- var avatarProviderSchema = /* @__PURE__ */ (() => z36.enum(["x", "discord", "google"]))();
5052
- var profileDefaultProviderSchema = /* @__PURE__ */ (() => z36.enum(["x", "discord"]))();
5083
+ var avatarProviderSchema = /* @__PURE__ */ (() => z37.enum(["x", "discord", "google"]))();
5084
+ var profileDefaultProviderSchema = /* @__PURE__ */ (() => z37.enum(["x", "discord"]))();
5053
5085
  function orderedSources(sources) {
5054
- return z36.array(sources).max(sources.options.length).refine(
5086
+ return z37.array(sources).max(sources.options.length).refine(
5055
5087
  (values2) => new Set(values2).size === values2.length,
5056
5088
  "List each provider once"
5057
5089
  );
@@ -5061,46 +5093,46 @@ var profileDefaultsSchema = /* @__PURE__ */ (() => orderedSources(
5061
5093
  ))();
5062
5094
  var knownProfileDefaultSources = ["x", "discord", "sol"];
5063
5095
  var profileDefaultSourcesSchema = /* @__PURE__ */ (() => orderedSources(
5064
- z36.enum(knownProfileDefaultSources)
5096
+ z37.enum(knownProfileDefaultSources)
5065
5097
  ))();
5066
- var profileNameSourceSchema = /* @__PURE__ */ (() => z36.enum(["sol"]))();
5067
- var openValue = /* @__PURE__ */ (() => z36.string().min(1).max(64))();
5068
- var avatarSeedSchema = /* @__PURE__ */ (() => z36.string().min(1).max(100))();
5069
- var profileAvatarSchema = /* @__PURE__ */ (() => z36.discriminatedUnion("source", [
5070
- z36.object({
5071
- source: z36.literal("upload"),
5072
- url: z36.string().url(),
5098
+ var profileNameSourceSchema = /* @__PURE__ */ (() => z37.enum(["sol"]))();
5099
+ var openValue = /* @__PURE__ */ (() => z37.string().min(1).max(64))();
5100
+ var avatarSeedSchema = /* @__PURE__ */ (() => z37.string().min(1).max(100))();
5101
+ var profileAvatarSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("source", [
5102
+ z37.object({
5103
+ source: z37.literal("upload"),
5104
+ url: z37.string().url(),
5073
5105
  seed: avatarSeedSchema
5074
5106
  }),
5075
- z36.object({
5076
- source: z36.literal("account"),
5107
+ z37.object({
5108
+ source: z37.literal("account"),
5077
5109
  provider: avatarProviderSchema,
5078
- url: z36.string().url(),
5110
+ url: z37.string().url(),
5079
5111
  seed: avatarSeedSchema
5080
5112
  }),
5081
- z36.object({ source: z36.literal("generated"), seed: avatarSeedSchema })
5113
+ z37.object({ source: z37.literal("generated"), seed: avatarSeedSchema })
5082
5114
  ]))();
5083
- var profileSummarySchema = /* @__PURE__ */ (() => z36.object({
5115
+ var profileSummarySchema = /* @__PURE__ */ (() => z37.object({
5084
5116
  id: identifier,
5085
- name: z36.string(),
5117
+ name: z37.string(),
5086
5118
  avatar: profileAvatarSchema
5087
5119
  }))();
5088
5120
  var invisible = /[\p{Cc}؜᠎​-‏‪-‮⁠-⁤⁦-⁩]/u;
5089
- var displayNameSchema = /* @__PURE__ */ (() => z36.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
5090
- z36.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
5121
+ var displayNameSchema = /* @__PURE__ */ (() => z37.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
5122
+ z37.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
5091
5123
  ))();
5092
- var profileUpdateSchema = /* @__PURE__ */ (() => z36.object({
5124
+ var profileUpdateSchema = /* @__PURE__ */ (() => z37.object({
5093
5125
  displayName: displayNameSchema.nullable().optional(),
5094
5126
  /** @experimental A minor release can change `.sol` names. */
5095
5127
  nameSource: profileNameSourceSchema.nullable().optional(),
5096
- avatar: z36.discriminatedUnion("source", [
5097
- z36.object({
5098
- source: z36.literal("account"),
5128
+ avatar: z37.discriminatedUnion("source", [
5129
+ z37.object({
5130
+ source: z37.literal("account"),
5099
5131
  provider: avatarProviderSchema
5100
5132
  }).strict(),
5101
- z36.object({ source: z36.literal("generated") }).strict()
5133
+ z37.object({ source: z37.literal("generated") }).strict()
5102
5134
  ]).nullable().optional(),
5103
- hidden: z36.boolean().optional()
5135
+ hidden: z37.boolean().optional()
5104
5136
  }).strict().refine(
5105
5137
  (value) => Object.values(value).some((field) => field !== void 0),
5106
5138
  "Change at least one field"
@@ -5110,27 +5142,27 @@ var profileUpdateSchema = /* @__PURE__ */ (() => z36.object({
5110
5142
  }))();
5111
5143
  var ownProfileSchema = /* @__PURE__ */ (() => profileSummarySchema.extend({
5112
5144
  /** The name the member chose, or null for the default. */
5113
- displayName: z36.string().nullable(),
5145
+ displayName: z37.string().nullable(),
5114
5146
  /** The avatar the member chose: `default` follows the project's defaults. */
5115
- avatarChoice: z36.enum(["default", "upload", "account", "generated"]),
5147
+ avatarChoice: z37.enum(["default", "upload", "account", "generated"]),
5116
5148
  /** The account of an `account` choice. */
5117
5149
  avatarProvider: avatarProviderSchema.nullable(),
5118
- hidden: z36.boolean(),
5150
+ hidden: z37.boolean(),
5119
5151
  /** An operator locked the name and avatar; the member can still hide the profile. */
5120
- locked: z36.boolean(),
5152
+ locked: z37.boolean(),
5121
5153
  /** Who can see profiles in this project, so the app can explain it. */
5122
5154
  visibility: profileVisibilitySchema,
5123
5155
  /** The member's connected accounts a picture or name can come from. */
5124
- options: z36.array(
5125
- z36.object({
5156
+ options: z37.array(
5157
+ z37.object({
5126
5158
  provider: avatarProviderSchema,
5127
- name: z36.string().nullable(),
5159
+ name: z37.string().nullable(),
5128
5160
  /**
5129
5161
  * The account's first name, where the provider sends one (Google does; X and Discord don't).
5130
5162
  * Only the member's own profile carries it.
5131
5163
  */
5132
- givenName: z36.string().nullable().default(null),
5133
- imageUrl: z36.string().url().nullable()
5164
+ givenName: z37.string().nullable().default(null),
5165
+ imageUrl: z37.string().url().nullable()
5134
5166
  })
5135
5167
  ),
5136
5168
  /**
@@ -5146,38 +5178,38 @@ var ownProfileSchema = /* @__PURE__ */ (() => profileSummarySchema.extend({
5146
5178
  *
5147
5179
  * @experimental A minor release can change `.sol` names.
5148
5180
  */
5149
- nameOptions: z36.array(z36.object({ source: openValue, name: z36.string() })).optional()
5181
+ nameOptions: z37.array(z37.object({ source: openValue, name: z37.string() })).optional()
5150
5182
  }))();
5151
- var cursor = /* @__PURE__ */ (() => z36.string().min(1).max(512))();
5152
- var profileCompletionQuerySchema = /* @__PURE__ */ (() => z36.object({
5153
- limit: z36.coerce.number().int().min(1).max(100).default(20),
5183
+ var cursor = /* @__PURE__ */ (() => z37.string().min(1).max(512))();
5184
+ var profileCompletionQuerySchema = /* @__PURE__ */ (() => z37.object({
5185
+ limit: z37.coerce.number().int().min(1).max(100).default(20),
5154
5186
  cursor: cursor.optional()
5155
5187
  }).strict())();
5156
- var profileCompletionSchema = /* @__PURE__ */ (() => z36.object({
5188
+ var profileCompletionSchema = /* @__PURE__ */ (() => z37.object({
5157
5189
  quest: identifier,
5158
5190
  key: identifier.optional(),
5159
- title: z36.string(),
5191
+ title: z37.string(),
5160
5192
  completions: count3.positive(),
5161
5193
  /** Null for completions recorded before completion times were. */
5162
5194
  lastCompletedAt: count3.nullable()
5163
5195
  }))();
5164
- var profileCompletionPageSchema = /* @__PURE__ */ (() => z36.object({
5165
- items: z36.array(profileCompletionSchema),
5196
+ var profileCompletionPageSchema = /* @__PURE__ */ (() => z37.object({
5197
+ items: z37.array(profileCompletionSchema),
5166
5198
  nextCursor: cursor.nullable()
5167
5199
  }))();
5168
- var profileReferralSchema = /* @__PURE__ */ (() => z36.object({
5200
+ var profileReferralSchema = /* @__PURE__ */ (() => z37.object({
5169
5201
  program: identifier,
5170
5202
  key: identifier.optional(),
5171
- title: z36.string(),
5203
+ title: z37.string(),
5172
5204
  /** Members this member invited. Invitations are shared by every program. */
5173
5205
  invited: count3,
5174
5206
  /** Invited members who qualified in this program. */
5175
5207
  qualified: count3,
5176
- milestones: z36.array(
5177
- z36.object({ id: identifier, count: count3, reached: z36.boolean() })
5208
+ milestones: z37.array(
5209
+ z37.object({ id: identifier, count: count3, reached: z37.boolean() })
5178
5210
  )
5179
5211
  }))();
5180
- var profileSettingsSchema = /* @__PURE__ */ (() => z36.object({
5212
+ var profileSettingsSchema = /* @__PURE__ */ (() => z37.object({
5181
5213
  visibility: profileVisibilitySchema,
5182
5214
  /** The `defaultSources` that are accounts, in order: `.sol` names are left out. */
5183
5215
  defaults: profileDefaultsSchema,
@@ -5187,9 +5219,9 @@ var profileSettingsSchema = /* @__PURE__ */ (() => z36.object({
5187
5219
  *
5188
5220
  * @experimental A minor release can change `.sol` names.
5189
5221
  */
5190
- defaultSources: z36.array(openValue).optional(),
5222
+ defaultSources: z37.array(openValue).optional(),
5191
5223
  revision: count3,
5192
- actor: z36.string().nullable(),
5224
+ actor: z37.string().nullable(),
5193
5225
  updatedAt: count3.nullable()
5194
5226
  }))();
5195
5227
  var profileSettingsInputSchema = /* @__PURE__ */ (() => profileSettingsSchema.omit({
@@ -5209,7 +5241,7 @@ var profileSettingsInputSchema = /* @__PURE__ */ (() => profileSettingsSchema.om
5209
5241
  actionId: identifier,
5210
5242
  /** The revision the change was made against; a newer one is a 409. */
5211
5243
  expectedRevision: count3,
5212
- reason: z36.string().trim().min(1).max(500)
5244
+ reason: z37.string().trim().min(1).max(500)
5213
5245
  }).strict().refine(
5214
5246
  (value) => !value.defaultSources || value.defaultSources.filter((source) => source !== "sol").join() === value.defaults.join(),
5215
5247
  {
@@ -5217,13 +5249,13 @@ var profileSettingsInputSchema = /* @__PURE__ */ (() => profileSettingsSchema.om
5217
5249
  path: ["defaults"]
5218
5250
  }
5219
5251
  ))();
5220
- var profileModerationSchema = /* @__PURE__ */ (() => z36.object({
5252
+ var profileModerationSchema = /* @__PURE__ */ (() => z37.object({
5221
5253
  actionId: identifier,
5222
- resetName: z36.boolean().default(false),
5223
- removeAvatar: z36.boolean().default(false),
5254
+ resetName: z37.boolean().default(false),
5255
+ removeAvatar: z37.boolean().default(false),
5224
5256
  /** True locks the name and avatar, false unlocks them. */
5225
- lock: z36.boolean().optional(),
5226
- reason: z36.string().trim().min(1).max(1e3)
5257
+ lock: z37.boolean().optional(),
5258
+ reason: z37.string().trim().min(1).max(1e3)
5227
5259
  }).strict().refine(
5228
5260
  (value) => value.resetName || value.removeAvatar || value.lock !== void 0,
5229
5261
  "Choose an action"
@@ -5231,59 +5263,59 @@ var profileModerationSchema = /* @__PURE__ */ (() => z36.object({
5231
5263
  var managedProfileSchema = /* @__PURE__ */ (() => ownProfileSchema.omit({ options: true, nameOptions: true }).extend({
5232
5264
  member: identifier,
5233
5265
  lockedAt: count3.nullable(),
5234
- lockedBy: z36.string().nullable(),
5235
- lockedReason: z36.string().nullable(),
5266
+ lockedBy: z37.string().nullable(),
5267
+ lockedReason: z37.string().nullable(),
5236
5268
  updatedAt: count3
5237
5269
  }))();
5238
5270
  var AVATAR_UPLOAD_LIMIT = 5 * 1024 * 1024;
5239
5271
  var avatarUploadTypes = ["image/jpeg", "image/png", "image/webp"];
5240
5272
 
5241
5273
  // src/leaderboards.ts
5242
- import * as z37 from "zod";
5243
- var integer = /* @__PURE__ */ (() => z37.number().int().safe())();
5274
+ import * as z38 from "zod";
5275
+ var integer = /* @__PURE__ */ (() => z38.number().int().safe())();
5244
5276
  var timestamp6 = /* @__PURE__ */ (() => integer.nonnegative().max(864e13))();
5245
- var leaderboardWindowSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
5246
- z37.object({ kind: z37.literal("all-time") }).strict(),
5247
- z37.object({ kind: z37.literal("fixed"), start: timestamp6, end: timestamp6 }).strict().refine((w) => w.end > w.start, "Window end must follow its start"),
5248
- z37.object({ kind: z37.literal("rolling"), days: integer.min(1).max(3660) }).strict(),
5277
+ var leaderboardWindowSchema = /* @__PURE__ */ (() => z38.discriminatedUnion("kind", [
5278
+ z38.object({ kind: z38.literal("all-time") }).strict(),
5279
+ z38.object({ kind: z38.literal("fixed"), start: timestamp6, end: timestamp6 }).strict().refine((w) => w.end > w.start, "Window end must follow its start"),
5280
+ z38.object({ kind: z38.literal("rolling"), days: integer.min(1).max(3660) }).strict(),
5249
5281
  // Not strict: boards published while a calendar window named its own `timeZone` keep reading,
5250
5282
  // and the field drops on parse. The authoring schema refuses it.
5251
- z37.object({
5252
- kind: z37.literal("calendar"),
5283
+ z38.object({
5284
+ kind: z38.literal("calendar"),
5253
5285
  /** The current day, week (ISO, starting on Monday) or month of the project calendar. */
5254
5286
  period: calendarPeriodSchema.exclude(["lifetime"])
5255
5287
  })
5256
5288
  ]))();
5257
5289
  var periodScore = /* @__PURE__ */ (() => ({
5258
5290
  window: leaderboardWindowSchema.default({ kind: "all-time" }),
5259
- quests: z37.array(identifier).min(1).max(100).optional()
5291
+ quests: z38.array(identifier).min(1).max(100).optional()
5260
5292
  }))();
5261
- var scoreSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
5262
- z37.object({ kind: z37.literal("balance") }).strict(),
5263
- z37.object({ kind: z37.literal("earned"), ...periodScore }).strict(),
5264
- z37.object({
5265
- kind: z37.literal("net"),
5293
+ var scoreSchema = /* @__PURE__ */ (() => z38.discriminatedUnion("kind", [
5294
+ z38.object({ kind: z38.literal("balance") }).strict(),
5295
+ z38.object({ kind: z38.literal("earned"), ...periodScore }).strict(),
5296
+ z38.object({
5297
+ kind: z38.literal("net"),
5266
5298
  window: leaderboardWindowSchema.default({ kind: "all-time" })
5267
5299
  }).strict()
5268
5300
  ]).default({ kind: "balance" }))();
5269
- var leaderboardPrizeRewardSchema = /* @__PURE__ */ (() => z37.union([
5301
+ var leaderboardPrizeRewardSchema = /* @__PURE__ */ (() => z38.union([
5270
5302
  pointsRewardSchema,
5271
5303
  tierRewardSchema
5272
5304
  ]))();
5273
- var leaderboardPrizeSchema = /* @__PURE__ */ (() => z37.object({
5274
- ranks: z37.tuple([integer.positive(), integer.positive()]).refine(([first, last]) => last >= first, {
5305
+ var leaderboardPrizeSchema = /* @__PURE__ */ (() => z38.object({
5306
+ ranks: z38.tuple([integer.positive(), integer.positive()]).refine(([first, last]) => last >= first, {
5275
5307
  message: "Prize rank range must end at or after it starts"
5276
5308
  }),
5277
- rewards: z37.array(leaderboardPrizeRewardSchema).min(1).max(20)
5309
+ rewards: z38.array(leaderboardPrizeRewardSchema).min(1).max(20)
5278
5310
  }).strict())();
5279
- var baseUnitsSchema = /* @__PURE__ */ (() => z37.string().regex(
5311
+ var baseUnitsSchema = /* @__PURE__ */ (() => z38.string().regex(
5280
5312
  /^(0|[1-9]\d{0,77})$/,
5281
5313
  'Use a whole number of base units, such as "1000000"'
5282
5314
  ))();
5283
- var leaderboardPoolUnitSchema = /* @__PURE__ */ (() => z37.union([
5284
- z37.literal("points"),
5285
- z37.object({
5286
- code: z37.string().trim().min(1).max(32),
5315
+ var leaderboardPoolUnitSchema = /* @__PURE__ */ (() => z38.union([
5316
+ z38.literal("points"),
5317
+ z38.object({
5318
+ code: z38.string().trim().min(1).max(32),
5287
5319
  decimals: integer.min(0).max(36)
5288
5320
  }).strict()
5289
5321
  ]))();
@@ -5325,12 +5357,12 @@ var refinePool = (pool, context) => {
5325
5357
  });
5326
5358
  }
5327
5359
  };
5328
- var leaderboardPoolSchema = /* @__PURE__ */ (() => z37.object(poolShape).strict().superRefine(refinePool))();
5329
- var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z37.object({
5330
- at: z37.literal("window-end"),
5331
- ties: z37.enum(["shared", "earliest"]),
5360
+ var leaderboardPoolSchema = /* @__PURE__ */ (() => z38.object(poolShape).strict().superRefine(refinePool))();
5361
+ var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z38.object({
5362
+ at: z38.literal("window-end"),
5363
+ ties: z38.enum(["shared", "earliest"]),
5332
5364
  /** Rank prizes. A board with a pool may list none. */
5333
- prizes: z37.array(leaderboardPrizeSchema).max(50),
5365
+ prizes: z38.array(leaderboardPrizeSchema).max(50),
5334
5366
  pool: leaderboardPoolSchema.optional()
5335
5367
  }).strict().superRefine((policy, context) => {
5336
5368
  if (!policy.prizes.length && !policy.pool) {
@@ -5362,10 +5394,10 @@ var leaderboardSettlementPolicySchema = /* @__PURE__ */ (() => z37.object({
5362
5394
  }
5363
5395
  }
5364
5396
  }))();
5365
- var leaderboardDefinitionObject = /* @__PURE__ */ (() => z37.object({
5397
+ var leaderboardDefinitionObject = /* @__PURE__ */ (() => z38.object({
5366
5398
  id: identifier,
5367
5399
  key: identifier.optional(),
5368
- title: z37.string().trim().min(1).max(120),
5400
+ title: z38.string().trim().min(1).max(120),
5369
5401
  /**
5370
5402
  * The point ledger the leaderboard ranks members by. Named `balance` from before ledger fields
5371
5403
  * were named `ledger` (docs/management-api.md#field-names); a points pool's `ledger` is the
@@ -5373,20 +5405,20 @@ var leaderboardDefinitionObject = /* @__PURE__ */ (() => z37.object({
5373
5405
  */
5374
5406
  balance: identifier,
5375
5407
  score: scoreSchema,
5376
- access: z37.enum(["participants", "public"]).default("participants"),
5408
+ access: z38.enum(["participants", "public"]).default("participants"),
5377
5409
  group: identifier.optional(),
5378
5410
  /**
5379
5411
  * List the project's eligible members who have no qualifying points, with a score of 0, ranked
5380
5412
  * after every member who scored and ordered by member ID. Omitted or false lists only members
5381
5413
  * with a qualifying entry. Settlements never include them.
5382
5414
  */
5383
- includeUnscored: z37.boolean().optional(),
5415
+ includeUnscored: z38.boolean().optional(),
5384
5416
  /**
5385
5417
  * How the live standings order equal scores. Omitted or `"shared"`: they share a rank. With
5386
5418
  * `"earliest"`, the member whose last counted entry is earlier ranks first (then member ID), and
5387
5419
  * every scored member gets its own rank: the order `settle.ties: "earliest"` uses.
5388
5420
  */
5389
- ties: z37.enum(["shared", "earliest"]).optional(),
5421
+ ties: z38.enum(["shared", "earliest"]).optional(),
5390
5422
  settle: leaderboardSettlementPolicySchema.optional()
5391
5423
  }).strict())();
5392
5424
  var validateSettlementWindow = (definition, context) => {
@@ -5404,70 +5436,70 @@ var leaderboardDefinitionResponseSchema = /* @__PURE__ */ (() => responseShape(
5404
5436
  ))();
5405
5437
  var leaderboardAuthoringSchema = /* @__PURE__ */ (() => leaderboardDefinitionObject.omit({ id: true }).extend({
5406
5438
  ...authoringIdentityShape,
5407
- score: z37.preprocess(refuseWindowTimeZone, scoreSchema),
5439
+ score: z38.preprocess(refuseWindowTimeZone, scoreSchema),
5408
5440
  group: identifier.optional()
5409
5441
  }).strict().superRefine(validateSettlementWindow))();
5410
- var leaderboardArtifactSchema = /* @__PURE__ */ (() => z37.union([
5442
+ var leaderboardArtifactSchema = /* @__PURE__ */ (() => z38.union([
5411
5443
  leaderboardAuthoringSchema,
5412
- z37.object({ code: z37.string().min(1).max(2e6) }).strict()
5444
+ z38.object({ code: z38.string().min(1).max(2e6) }).strict()
5413
5445
  ]))();
5414
- var publishedLeaderboardSchema = /* @__PURE__ */ (() => z37.object({
5415
- archivedAt: z37.number().int().nonnegative().nullable().optional(),
5446
+ var publishedLeaderboardSchema = /* @__PURE__ */ (() => z38.object({
5447
+ archivedAt: z38.number().int().nonnegative().nullable().optional(),
5416
5448
  version: identifier,
5417
5449
  definition: leaderboardDefinitionResponseSchema,
5418
5450
  publishedAt: timestamp6,
5419
- actor: z37.string().nullable()
5451
+ actor: z38.string().nullable()
5420
5452
  }))();
5421
- var leaderboardQuerySchema = /* @__PURE__ */ (() => z37.object({
5422
- limit: z37.coerce.number().int().min(1).max(100).default(25),
5423
- cursor: z37.string().max(4096).optional()
5453
+ var leaderboardQuerySchema = /* @__PURE__ */ (() => z38.object({
5454
+ limit: z38.coerce.number().int().min(1).max(100).default(25),
5455
+ cursor: z38.string().max(4096).optional()
5424
5456
  }).strict())();
5425
- var leaderboardRowSchema = /* @__PURE__ */ (() => z37.object({
5457
+ var leaderboardRowSchema = /* @__PURE__ */ (() => z38.object({
5426
5458
  /** The row's stable key: a pseudonym per board and member. */
5427
5459
  participant: identifier,
5428
5460
  member: identifier.optional(),
5429
5461
  /** The profile's name where the viewer can see it, otherwise the pseudonym's. */
5430
- name: z37.string(),
5462
+ name: z38.string(),
5431
5463
  score: integer,
5432
5464
  rank: integer.positive(),
5433
5465
  /** The member's profile, where visible to this viewer and not hidden by the member. */
5434
5466
  profile: profileSummarySchema.nullable()
5435
5467
  }))();
5436
- var leaderboardPageSchema = /* @__PURE__ */ (() => z37.object({
5468
+ var leaderboardPageSchema = /* @__PURE__ */ (() => z38.object({
5437
5469
  leaderboard: identifier,
5438
- title: z37.string(),
5470
+ title: z38.string(),
5439
5471
  version: identifier,
5440
- calculation: z37.enum(["balance", "earned", "net"]),
5441
- period: z37.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
5472
+ calculation: z38.enum(["balance", "earned", "net"]),
5473
+ period: z38.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
5442
5474
  calculatedAt: timestamp6,
5443
5475
  lastEntryAt: timestamp6.nullable(),
5444
5476
  total: integer.nonnegative(),
5445
- items: z37.array(leaderboardRowSchema),
5477
+ items: z38.array(leaderboardRowSchema),
5446
5478
  me: leaderboardRowSchema.nullable(),
5447
- nearby: z37.array(leaderboardRowSchema),
5448
- nextCursor: z37.string().nullable()
5479
+ nearby: z38.array(leaderboardRowSchema),
5480
+ nextCursor: z38.string().nullable()
5449
5481
  }))();
5450
- var leaderboardPlacementSchema = /* @__PURE__ */ (() => z37.object({
5482
+ var leaderboardPlacementSchema = /* @__PURE__ */ (() => z38.object({
5451
5483
  leaderboard: identifier,
5452
5484
  key: identifier.optional(),
5453
- title: z37.string(),
5485
+ title: z38.string(),
5454
5486
  profile: identifier,
5455
5487
  rank: integer.positive().nullable(),
5456
5488
  score: integer.nullable(),
5457
5489
  /** Ranked participants on the board. */
5458
5490
  total: integer.nonnegative()
5459
5491
  }))();
5460
- var leaderboardHistoryQuerySchema = /* @__PURE__ */ (() => z37.strictObject({
5492
+ var leaderboardHistoryQuerySchema = /* @__PURE__ */ (() => z38.strictObject({
5461
5493
  board: identifier,
5462
5494
  cursor: pageCursorSchema.optional()
5463
5495
  }))();
5464
- var leaderboardHistoryPageSchema = /* @__PURE__ */ (() => z37.object({
5496
+ var leaderboardHistoryPageSchema = /* @__PURE__ */ (() => z38.object({
5465
5497
  leaderboard: identifier,
5466
- period: z37.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
5467
- items: z37.array(pointEntrySchema),
5498
+ period: z38.object({ start: timestamp6.nullable(), end: timestamp6.nullable() }),
5499
+ items: z38.array(pointEntrySchema),
5468
5500
  nextCursor: pageCursorSchema.nullable()
5469
5501
  }))();
5470
- var leaderboardPreviewSchema = /* @__PURE__ */ (() => z37.object({
5502
+ var leaderboardPreviewSchema = /* @__PURE__ */ (() => z38.object({
5471
5503
  published: publishedLeaderboardSchema,
5472
5504
  before: leaderboardPageSchema.nullable(),
5473
5505
  after: leaderboardPageSchema
@@ -5476,53 +5508,53 @@ var mutationBase = /* @__PURE__ */ (() => ({
5476
5508
  actionId: identifier,
5477
5509
  member: identifier,
5478
5510
  balance: identifier,
5479
- reason: z37.string().trim().min(1).max(1e3)
5511
+ reason: z38.string().trim().min(1).max(1e3)
5480
5512
  }))();
5481
5513
  var datedMutation = /* @__PURE__ */ (() => ({ ...mutationBase, effectiveAt: timestamp6.optional() }))();
5482
- var pointsMutationSchema = /* @__PURE__ */ (() => z37.discriminatedUnion("kind", [
5483
- z37.object({
5514
+ var pointsMutationSchema = /* @__PURE__ */ (() => z38.discriminatedUnion("kind", [
5515
+ z38.object({
5484
5516
  ...datedMutation,
5485
- kind: z37.literal("award"),
5486
- referralEligible: z37.boolean().optional(),
5517
+ kind: z38.literal("award"),
5518
+ referralEligible: z38.boolean().optional(),
5487
5519
  amount: integer.positive()
5488
5520
  }).strict(),
5489
- z37.object({
5521
+ z38.object({
5490
5522
  ...datedMutation,
5491
- kind: z37.literal("spend"),
5523
+ kind: z38.literal("spend"),
5492
5524
  amount: integer.positive()
5493
5525
  }).strict(),
5494
- z37.object({
5526
+ z38.object({
5495
5527
  ...datedMutation,
5496
- kind: z37.literal("adjust"),
5528
+ kind: z38.literal("adjust"),
5497
5529
  amount: integer.refine((n) => n !== 0)
5498
5530
  }).strict(),
5499
- z37.object({
5531
+ z38.object({
5500
5532
  ...datedMutation,
5501
- kind: z37.literal("set"),
5533
+ kind: z38.literal("set"),
5502
5534
  total: integer.nonnegative(),
5503
5535
  expectedTotal: integer.nonnegative(),
5504
- classification: z37.enum(["earned", "spend"])
5536
+ classification: z38.enum(["earned", "spend"])
5505
5537
  }).strict(),
5506
- z37.object({
5538
+ z38.object({
5507
5539
  ...mutationBase,
5508
- kind: z37.literal("reverse"),
5540
+ kind: z38.literal("reverse"),
5509
5541
  entry: identifier,
5510
5542
  amount: integer.positive()
5511
5543
  }).strict()
5512
5544
  ]))();
5513
- var pointsEntrySchema = /* @__PURE__ */ (() => z37.object({
5545
+ var pointsEntrySchema = /* @__PURE__ */ (() => z38.object({
5514
5546
  id: identifier,
5515
- completion: z37.string().nullable(),
5547
+ completion: z38.string().nullable(),
5516
5548
  member: identifier,
5517
5549
  balance: identifier,
5518
5550
  amount: integer,
5519
- kind: z37.enum(["award", "spend", "adjust", "reverse"]),
5551
+ kind: z38.enum(["award", "spend", "adjust", "reverse"]),
5520
5552
  effectiveAt: timestamp6,
5521
5553
  receivedAt: timestamp6,
5522
5554
  quest: identifier.nullable(),
5523
5555
  original: identifier.nullable(),
5524
- reason: z37.string(),
5525
- actor: z37.string().nullable(),
5556
+ reason: z38.string(),
5557
+ actor: z38.string().nullable(),
5526
5558
  /**
5527
5559
  * The member import whose opening balance this `adjust` is, or null. Imported entries emit no
5528
5560
  * `points.awarded` and count on balance leaderboards only. Absent from Relay versions without
@@ -5530,76 +5562,76 @@ var pointsEntrySchema = /* @__PURE__ */ (() => z37.object({
5530
5562
  */
5531
5563
  import: identifier.nullable().optional()
5532
5564
  }))();
5533
- var managedPointHistoryPageSchema = /* @__PURE__ */ (() => z37.object({
5534
- items: z37.array(pointsEntrySchema),
5565
+ var managedPointHistoryPageSchema = /* @__PURE__ */ (() => z38.object({
5566
+ items: z38.array(pointsEntrySchema),
5535
5567
  nextCursor: pageCursorSchema.nullable(),
5536
5568
  /** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
5537
- next: z37.number().nullable()
5569
+ next: z38.number().nullable()
5538
5570
  }))();
5539
- var pointsResultSchema = /* @__PURE__ */ (() => z37.object({
5571
+ var pointsResultSchema = /* @__PURE__ */ (() => z38.object({
5540
5572
  entry: pointsEntrySchema,
5541
5573
  total: integer.nonnegative()
5542
5574
  }))();
5543
- var pointsAccountSchema = /* @__PURE__ */ (() => z37.object({
5575
+ var pointsAccountSchema = /* @__PURE__ */ (() => z38.object({
5544
5576
  member: identifier,
5545
5577
  balance: identifier,
5546
5578
  total: integer.nonnegative(),
5547
5579
  held: integer.nonnegative()
5548
5580
  }))();
5549
- var leaderboardExclusionSchema = /* @__PURE__ */ (() => z37.object({
5581
+ var leaderboardExclusionSchema = /* @__PURE__ */ (() => z38.object({
5550
5582
  actionId: identifier,
5551
5583
  member: identifier,
5552
- excluded: z37.boolean(),
5553
- reason: z37.string().trim().min(1).max(1e3)
5584
+ excluded: z38.boolean(),
5585
+ reason: z38.string().trim().min(1).max(1e3)
5554
5586
  }).strict())();
5555
- var leaderboardExclusionGroupSchema = /* @__PURE__ */ (() => z37.object({
5587
+ var leaderboardExclusionGroupSchema = /* @__PURE__ */ (() => z38.object({
5556
5588
  leaderboard: identifier,
5557
5589
  group: identifier,
5558
- generated: z37.boolean(),
5590
+ generated: z38.boolean(),
5559
5591
  boundAt: timestamp6.nullable()
5560
5592
  }))();
5561
- var leaderboardExclusionGroupBindingSchema = /* @__PURE__ */ (() => z37.object({
5593
+ var leaderboardExclusionGroupBindingSchema = /* @__PURE__ */ (() => z38.object({
5562
5594
  actionId: identifier,
5563
5595
  group: identifier,
5564
- reason: z37.string().trim().min(1).max(1e3)
5596
+ reason: z38.string().trim().min(1).max(1e3)
5565
5597
  }).strict())();
5566
- var leaderboardGroupSchema = /* @__PURE__ */ (() => z37.object({
5598
+ var leaderboardGroupSchema = /* @__PURE__ */ (() => z38.object({
5567
5599
  actionId: identifier,
5568
5600
  member: identifier,
5569
- included: z37.boolean(),
5570
- reason: z37.string().trim().min(1).max(1e3)
5601
+ included: z38.boolean(),
5602
+ reason: z38.string().trim().min(1).max(1e3)
5571
5603
  }).strict())();
5572
- var leaderboardSettlementStatusSchema = /* @__PURE__ */ (() => z37.enum(["pending", "approved"]))();
5573
- var leaderboardSettlementSummarySchema = /* @__PURE__ */ (() => z37.object({
5604
+ var leaderboardSettlementStatusSchema = /* @__PURE__ */ (() => z38.enum(["pending", "approved"]))();
5605
+ var leaderboardSettlementSummarySchema = /* @__PURE__ */ (() => z38.object({
5574
5606
  id: identifier,
5575
5607
  leaderboard: identifier,
5576
5608
  version: identifier,
5577
- title: z37.string(),
5578
- period: z37.object({ start: timestamp6, end: timestamp6 }),
5579
- ties: z37.enum(["shared", "earliest"]),
5609
+ title: z38.string(),
5610
+ period: z38.object({ start: timestamp6, end: timestamp6 }),
5611
+ ties: z38.enum(["shared", "earliest"]),
5580
5612
  status: leaderboardSettlementStatusSchema,
5581
5613
  total: integer.nonnegative(),
5582
5614
  winners: integer.nonnegative(),
5583
5615
  createdAt: timestamp6,
5584
5616
  approvedAt: timestamp6.nullable(),
5585
- approvedBy: z37.string().nullable(),
5586
- approvalReason: z37.string().nullable()
5617
+ approvedBy: z38.string().nullable(),
5618
+ approvalReason: z38.string().nullable()
5587
5619
  }))();
5588
- var settlementPaymentSchema = /* @__PURE__ */ (() => z37.object({
5589
- status: z37.string(),
5620
+ var settlementPaymentSchema = /* @__PURE__ */ (() => z38.object({
5621
+ status: z38.string(),
5590
5622
  /** The CAIP-2 cluster of the batch that pays or paid the share; null when unpaid. */
5591
- network: z37.string().nullable(),
5623
+ network: z38.string().nullable(),
5592
5624
  /** The transaction that paid the share; null until paid. */
5593
- signature: z37.string().nullable(),
5625
+ signature: z38.string().nullable(),
5594
5626
  paidAt: timestamp6.nullable()
5595
5627
  }))();
5596
- var leaderboardSettlementRowSchema = /* @__PURE__ */ (() => z37.object({
5628
+ var leaderboardSettlementRowSchema = /* @__PURE__ */ (() => z38.object({
5597
5629
  member: identifier,
5598
5630
  score: integer,
5599
5631
  rank: integer.positive(),
5600
5632
  position: integer.positive(),
5601
5633
  scoredAt: timestamp6,
5602
- prizes: z37.array(integer.nonnegative()),
5634
+ prizes: z38.array(integer.nonnegative()),
5603
5635
  completion: identifier.nullable(),
5604
5636
  revokedAt: timestamp6.nullable(),
5605
5637
  /**
@@ -5613,33 +5645,33 @@ var leaderboardSettlementRowSchema = /* @__PURE__ */ (() => z37.object({
5613
5645
  */
5614
5646
  payment: settlementPaymentSchema.optional()
5615
5647
  }))();
5616
- var leaderboardSettlementPoolSchema = /* @__PURE__ */ (() => z37.object({
5648
+ var leaderboardSettlementPoolSchema = /* @__PURE__ */ (() => z38.object({
5617
5649
  ...poolShape,
5618
5650
  allocated: baseUnitsSchema,
5619
5651
  unallocated: baseUnitsSchema
5620
5652
  }))();
5621
- var leaderboardSettlementUnmeasuredSchema = /* @__PURE__ */ (() => z37.object({
5622
- content: z37.string(),
5653
+ var leaderboardSettlementUnmeasuredSchema = /* @__PURE__ */ (() => z38.object({
5654
+ content: z38.string(),
5623
5655
  member: identifier,
5624
5656
  /** When the last good measurement was observed, if Relay has one. */
5625
5657
  observedAt: timestamp6.nullable()
5626
5658
  }))();
5627
5659
  var leaderboardSettlementSchema = /* @__PURE__ */ (() => leaderboardSettlementSummarySchema.extend({
5628
- prizes: z37.array(leaderboardPrizeSchema),
5629
- excluded: z37.array(identifier),
5660
+ prizes: z38.array(leaderboardPrizeSchema),
5661
+ excluded: z38.array(identifier),
5630
5662
  /**
5631
5663
  * Content frozen at its last good measurement because its closing measurement never came; a
5632
5664
  * reviewer can retry measurement. Relay sends it for every settlement, empty when nothing is
5633
5665
  * missing.
5634
5666
  */
5635
- unmeasured: z37.array(leaderboardSettlementUnmeasuredSchema).optional(),
5667
+ unmeasured: z38.array(leaderboardSettlementUnmeasuredSchema).optional(),
5636
5668
  /** The settlement's pool prize, or null without one. Absent from Relay versions without pools. */
5637
5669
  pool: leaderboardSettlementPoolSchema.nullable().optional(),
5638
- rows: z37.array(leaderboardSettlementRowSchema)
5670
+ rows: z38.array(leaderboardSettlementRowSchema)
5639
5671
  }))();
5640
- var leaderboardSettlementApprovalSchema = /* @__PURE__ */ (() => z37.object({
5672
+ var leaderboardSettlementApprovalSchema = /* @__PURE__ */ (() => z38.object({
5641
5673
  actionId: identifier,
5642
- reason: z37.string().trim().min(1).max(500)
5674
+ reason: z38.string().trim().min(1).max(500)
5643
5675
  }).strict())();
5644
5676
 
5645
5677
  export {
@@ -5663,6 +5695,7 @@ export {
5663
5695
  responseListSchema,
5664
5696
  pageCursorSchema,
5665
5697
  pageLimit,
5698
+ booleanQuery,
5666
5699
  pageQuerySchema,
5667
5700
  paginate,
5668
5701
  managementStateQuerySchema,
@@ -5711,6 +5744,7 @@ export {
5711
5744
  solanaMainnet,
5712
5745
  solanaDevnet,
5713
5746
  isSolanaNetwork,
5747
+ isEvmAddress,
5714
5748
  evmAddressSchema,
5715
5749
  cosmosAddressSchema,
5716
5750
  walletAddressInputSchema,
@@ -5946,9 +5980,12 @@ export {
5946
5980
  takesSolanaTransaction,
5947
5981
  questStationsSchema,
5948
5982
  stationRefusal,
5949
- solanaSignatureSchema2,
5983
+ stationCheckInSchema,
5984
+ stationCodeSubmissionSchema,
5950
5985
  solanaTransactionSubmissionSchema,
5951
5986
  attemptActionSchema,
5987
+ galleryKinds,
5988
+ questGallerySchema,
5952
5989
  resourceSourceSchema,
5953
5990
  resourceRequestSchema,
5954
5991
  resourceOptionsSchema,
@@ -6074,6 +6111,7 @@ export {
6074
6111
  evidenceSchema,
6075
6112
  errorSchema,
6076
6113
  staffDecisionSchema,
6114
+ staffReasonInputSchema,
6077
6115
  acceptAnywaySchema,
6078
6116
  evidenceRedactionInputSchema,
6079
6117
  evidenceRetentionInputSchema,