@domino-sdk/relay 1.54.0 → 1.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +1848 -0
  2. package/dist/analytics-URV-mxjH.d.ts +482 -0
  3. package/dist/{attempt-captures-QC4kTA44.d.ts → attempt-captures-CxxO7DeD.d.ts} +1 -1
  4. package/dist/authoring.d.ts +233 -78
  5. package/dist/authoring.js +112 -14
  6. package/dist/{automatic-outcomes-CVyZHxir.d.ts → automatic-outcomes-DxW_v5Wc.d.ts} +5 -2
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +7 -7
  9. package/dist/browser.js +10 -10
  10. package/dist/{capability-error-FQGGb5xS.d.ts → capability-error-DSd8EMQC.d.ts} +76 -2
  11. package/dist/{chunk-53JMTUWG.js → chunk-56DBFNR2.js} +1 -1
  12. package/dist/chunk-C7QZ4UBB.js +937 -0
  13. package/dist/chunk-F6HECAXA.js +661 -0
  14. package/dist/{chunk-JL7J3EQQ.js → chunk-GL43VQ5D.js} +16 -16
  15. package/dist/{chunk-GTQJSDBS.js → chunk-IUF7DW76.js} +27 -16
  16. package/dist/{chunk-QIDQWXSF.js → chunk-IZRITLVV.js} +2 -2
  17. package/dist/{chunk-S2PMKZSX.js → chunk-SABMNPF2.js} +21 -2
  18. package/dist/{chunk-XFAYQFRO.js → chunk-TLK2MD4S.js} +1 -1
  19. package/dist/{chunk-ZJ3FVZRP.js → chunk-UY6KMLQG.js} +10 -3
  20. package/dist/{chunk-RP4LLEON.js → chunk-VFBQVY4X.js} +1 -1
  21. package/dist/{chunk-YVC3B72P.js → chunk-WHG5WE43.js} +1 -1
  22. package/dist/chunk-WHMXXHPX.js +344 -0
  23. package/dist/{chunk-TL5TL5RD.js → chunk-WUEQOKJH.js} +4 -4
  24. package/dist/{chunk-7BNCLWAO.js → chunk-XALIFNMD.js} +1 -1
  25. package/dist/{chunk-IELNFM3V.js → chunk-YCOKTQ4E.js} +96 -7
  26. package/dist/{chunk-LPHXTZDA.js → chunk-YE3XYB2F.js} +2 -2
  27. package/dist/{chunk-K6TVMNU4.js → chunk-YEVD4A5X.js} +1 -1
  28. package/dist/{client-CzNtl8UO.d.ts → client-C4zUZKpj.d.ts} +35 -7
  29. package/dist/{deployments-ovtqtAcx.d.ts → deployments-B32QS1CI.d.ts} +1060 -233
  30. package/dist/{groups-B5R1RCsl.d.ts → groups-O6onGPmC.d.ts} +131 -137
  31. package/dist/index.d.ts +8 -8
  32. package/dist/index.js +9 -9
  33. package/dist/integrations-C6_uUh-s.d.ts +584 -0
  34. package/dist/internal.d.ts +11 -10
  35. package/dist/internal.js +8 -8
  36. package/dist/{offers-CH1RZekg.d.ts → offers-BMDNcvwB.d.ts} +2 -2
  37. package/dist/{pages-BTlOg8sl.d.ts → pages-BFloMpyQ.d.ts} +25 -1
  38. package/dist/portal-proxy.d.ts +11 -1
  39. package/dist/portal-proxy.js +26 -5
  40. package/dist/{profiles-Cdv4BSd_.d.ts → profiles-BoOK03cR.d.ts} +2 -0
  41. package/dist/react/index.d.ts +488 -13
  42. package/dist/react/index.js +50 -15
  43. package/dist/runtime/authoring.js +1 -1
  44. package/dist/runtime/chunks/WKATKZXE.js +1 -0
  45. package/dist/runtime/manifest.json +3 -3
  46. package/dist/runtime/schema.js +1 -1
  47. package/dist/{schema-BJ9bOgpN.d.ts → schema-C4m9RhCR.d.ts} +166 -6
  48. package/dist/schema.d.ts +392 -334
  49. package/dist/schema.js +84 -40
  50. package/dist/server/index.d.ts +11 -10
  51. package/dist/server/index.js +1109 -854
  52. package/dist/{submission-input-BNah53go.d.ts → submission-input-BbdawqVy.d.ts} +2 -2
  53. package/dist/{telegram-browser-C36j_6v-.d.ts → telegram-browser-CwaxROAZ.d.ts} +1 -1
  54. package/dist/testing.d.ts +85 -12
  55. package/dist/testing.js +322 -37
  56. package/dist/{transport-C8BlCzmF.d.ts → transport-CZJOW5Sr.d.ts} +7648 -3529
  57. package/dist/vite.d.ts +54 -1
  58. package/dist/vite.js +35 -0
  59. package/dist/{x-BfQcsDp0.d.ts → x-1czZFVUW.d.ts} +1 -1
  60. package/package.json +3 -2
  61. package/dist/chunk-2NUD237O.js +0 -102
  62. package/dist/chunk-CCE2JWES.js +0 -1083
  63. package/dist/integrations-CllF-kWg.d.ts +0 -314
  64. package/dist/runtime/chunks/AVRVSLHX.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  attemptCaptureSchema,
3
3
  capturedFactSchema
4
- } from "../chunk-7BNCLWAO.js";
4
+ } from "../chunk-XALIFNMD.js";
5
5
  import {
6
6
  activityTypeSchema,
7
7
  activityTypes,
@@ -27,7 +27,22 @@ import {
27
27
  publishDeploymentSchema,
28
28
  rejectDeploymentSchema,
29
29
  submitDeploymentSchema
30
- } from "../chunk-GTQJSDBS.js";
30
+ } from "../chunk-IUF7DW76.js";
31
+ import {
32
+ analyticsBreakdowns,
33
+ analyticsCatalog,
34
+ analyticsCatalogSchema,
35
+ analyticsCharts,
36
+ analyticsFilters,
37
+ analyticsMetricIds,
38
+ analyticsMetricQuerySchema,
39
+ analyticsMetricResultSchema,
40
+ analyticsQueryLimit,
41
+ analyticsQuerySchema,
42
+ analyticsRanges,
43
+ analyticsReadSchema,
44
+ dashboardDefinitionSchema
45
+ } from "../chunk-F6HECAXA.js";
31
46
  import "../chunk-4OC7REYX.js";
32
47
  import {
33
48
  DEFAULT_MANAGEMENT_TIMEOUT,
@@ -48,22 +63,22 @@ import {
48
63
  participantExchangeSchema,
49
64
  questConfiguration,
50
65
  sequenceCursorSchema
51
- } from "../chunk-TL5TL5RD.js";
66
+ } from "../chunk-WUEQOKJH.js";
52
67
  import {
53
68
  parseImageExtraction,
54
69
  parseImageResult
55
- } from "../chunk-LPHXTZDA.js";
70
+ } from "../chunk-YE3XYB2F.js";
56
71
  import {
57
72
  imageAssetArtifactSchema,
58
73
  xUserLookupInputSchema,
59
74
  xUserSchema,
60
75
  xUsernameSchema
61
- } from "../chunk-K6TVMNU4.js";
76
+ } from "../chunk-YEVD4A5X.js";
62
77
  import {
63
78
  sourceDataSchema,
64
79
  sourceRoles,
65
80
  validateQuestShape
66
- } from "../chunk-S2PMKZSX.js";
81
+ } from "../chunk-SABMNPF2.js";
67
82
  import {
68
83
  isIntegrationParticipantPath,
69
84
  isParticipantRoute,
@@ -72,7 +87,7 @@ import {
72
87
  } from "../chunk-MLIXJPKL.js";
73
88
  import {
74
89
  withActionId
75
- } from "../chunk-YVC3B72P.js";
90
+ } from "../chunk-WHG5WE43.js";
76
91
  import {
77
92
  allocateQuestSchema,
78
93
  allocatedQuestSchema,
@@ -91,13 +106,13 @@ import {
91
106
  rewardDeliveryQuerySchema,
92
107
  rewardDeliverySchema,
93
108
  saveQuestDraftSchema
94
- } from "../chunk-ZJ3FVZRP.js";
109
+ } from "../chunk-UY6KMLQG.js";
95
110
  import {
96
111
  badgeMutationResultSchema,
97
112
  badgeMutationSchema,
98
113
  badgePropertiesSchema,
114
+ baseUnitsSchema,
99
115
  createBadgeSchema,
100
- createPointLedgerSchema,
101
116
  engagementBoundaryPageSchema,
102
117
  engagementChangePreviewInputSchema,
103
118
  engagementChangePreviewSchema,
@@ -116,23 +131,17 @@ import {
116
131
  leaderboardPageSchema,
117
132
  leaderboardQuerySchema,
118
133
  leaderboardSettlementApprovalSchema,
134
+ leaderboardSettlementPoolSchema,
119
135
  leaderboardSettlementSchema,
120
136
  leaderboardSettlementSummarySchema,
121
137
  managedBadgeSchema,
122
138
  managedPointHistoryPageSchema,
123
- managedPointLedgerSchema,
124
- managedProfileSchema,
125
139
  memberBadgesSchema,
126
140
  offerControlSchema,
127
141
  offerSchema,
128
- pointLedgerPropertiesSchema,
129
- pointLedgerSchema,
130
142
  pointsAccountSchema,
131
143
  pointsMutationSchema,
132
144
  pointsResultSchema,
133
- profileModerationSchema,
134
- profileSettingsInputSchema,
135
- profileSettingsSchema,
136
145
  publishedLeaderboardSchema,
137
146
  publishedReferralSchema,
138
147
  redemptionCancellationSchema,
@@ -145,15 +154,23 @@ import {
145
154
  referralQualificationSchema,
146
155
  referralRewardResolutionSchema,
147
156
  referralSuspensionSchema
148
- } from "../chunk-CCE2JWES.js";
157
+ } from "../chunk-C7QZ4UBB.js";
149
158
  import {
159
+ createPointLedgerSchema,
160
+ managedPointLedgerSchema,
161
+ managedProfileSchema,
162
+ pointLedgerPropertiesSchema,
163
+ pointLedgerSchema,
164
+ profileModerationSchema,
165
+ profileSettingsInputSchema,
166
+ profileSettingsSchema,
150
167
  telegramChatConnectionSchema,
151
168
  telegramChatIdSchema,
152
169
  telegramChatsSchema
153
- } from "../chunk-2NUD237O.js";
154
- import "../chunk-XFAYQFRO.js";
155
- import "../chunk-RP4LLEON.js";
156
- import "../chunk-53JMTUWG.js";
170
+ } from "../chunk-WHMXXHPX.js";
171
+ import "../chunk-TLK2MD4S.js";
172
+ import "../chunk-VFBQVY4X.js";
173
+ import "../chunk-56DBFNR2.js";
157
174
  import {
158
175
  CompletionSourceKind,
159
176
  addGroupMemberSchema,
@@ -243,7 +260,7 @@ import {
243
260
  walletSignInNetworksSchema,
244
261
  walletUnlinkInputSchema,
245
262
  whereSchemaIssue
246
- } from "../chunk-IELNFM3V.js";
263
+ } from "../chunk-YCOKTQ4E.js";
247
264
 
248
265
  // src/server/identity-links.ts
249
266
  import * as z from "zod";
@@ -366,8 +383,15 @@ var memberIdentitySignInInputSchema = z2.strictObject({
366
383
 
367
384
  // src/server/settlement-reviews.ts
368
385
  import * as z3 from "zod";
386
+ var timestamp = z3.number().int().safe().nonnegative();
369
387
  var decision = {
370
388
  status: z3.enum(["pending", "approved", "rejected"]),
389
+ /**
390
+ * Present while the window has ended but Relay is still taking closing measurements of the
391
+ * content its engagement points pay for. The settlement reads as `pending` with no rows, cannot
392
+ * be approved yet, and freezes when the measurements arrive or their wait ends after `deadline`.
393
+ */
394
+ closing: z3.object({ startedAt: timestamp, deadline: timestamp }).optional(),
371
395
  rejectedAt: z3.number().int().safe().nonnegative().nullable(),
372
396
  rejectedBy: z3.string().nullable(),
373
397
  rejectionReason: z3.string().nullable()
@@ -387,6 +411,37 @@ var leaderboardSettlementRejectionSchema = z3.strictObject({
387
411
  expectedCreatedAt: z3.number().int().safe().nonnegative(),
388
412
  reason: z3.string().trim().min(1).max(500)
389
413
  });
414
+ var leaderboardSettlementMeasurementRetrySchema = z3.strictObject({
415
+ actionId: z3.string().uuid().default(() => crypto.randomUUID())
416
+ });
417
+ var leaderboardSettlementExportSchema = z3.object({
418
+ settlement: identifier,
419
+ leaderboard: identifier,
420
+ title: z3.string(),
421
+ period: z3.object({ start: timestamp, end: timestamp }),
422
+ status: z3.enum(["pending", "approved", "rejected"]),
423
+ pool: leaderboardSettlementPoolSchema.nullable(),
424
+ rows: z3.array(
425
+ z3.object({
426
+ member: identifier,
427
+ score: z3.number().int().safe(),
428
+ rank: z3.number().int().safe().positive(),
429
+ /** The pool share in base units; null without a pool. */
430
+ share: baseUnitsSchema.nullable(),
431
+ /** The pool share in whole units: `"600.5"` for 600500000 USDC base units. */
432
+ amount: z3.string().nullable(),
433
+ /** Linked wallets the member proved, on every chain, newest first per chain. */
434
+ wallets: z3.array(
435
+ z3.object({
436
+ chain: walletChainSchema,
437
+ /** The CAIP-2 network, for Cosmos wallets only. */
438
+ network: z3.string().nullable(),
439
+ address: z3.string()
440
+ })
441
+ )
442
+ })
443
+ )
444
+ });
390
445
 
391
446
  // src/server/inventory-items.ts
392
447
  import * as z4 from "zod";
@@ -922,13 +977,13 @@ async function verifyWebhook(input) {
922
977
  }
923
978
  const parts = input.signature.split(",");
924
979
  const timestamps = parts.filter((part) => part.startsWith("t="));
925
- const timestamp = timestamps[0]?.slice(2) ?? "";
980
+ const timestamp2 = timestamps[0]?.slice(2) ?? "";
926
981
  const signatures = parts.filter((part) => /^v1=[a-f0-9]{64}$/.test(part)).map((part) => part.slice(3));
927
- if (timestamps.length !== 1 || !/^\d{1,12}$/.test(timestamp) || Math.abs(now / 1e3 - Number(timestamp)) > tolerance || signatures.length < 1 || signatures.length > 2) {
982
+ if (timestamps.length !== 1 || !/^\d{1,12}$/.test(timestamp2) || Math.abs(now / 1e3 - Number(timestamp2)) > tolerance || signatures.length < 1 || signatures.length > 2) {
928
983
  throw new Error("Invalid or expired webhook signature");
929
984
  }
930
985
  const secrets = typeof input.secret === "string" ? [input.secret] : input.secret;
931
- const message = new TextEncoder().encode(`${timestamp}.${input.body}`);
986
+ const message = new TextEncoder().encode(`${timestamp2}.${input.body}`);
932
987
  for (const secret of secrets) {
933
988
  if (!secret) {
934
989
  continue;
@@ -1085,204 +1140,127 @@ var promotionHistoryPageSchema = z10.object({
1085
1140
  nextCursor: pageCursorSchema.nullable()
1086
1141
  });
1087
1142
 
1088
- // src/server/analytics.ts
1143
+ // src/server/dashboards.ts
1089
1144
  import * as z11 from "zod";
1090
- function once(build) {
1091
- let built;
1092
- return () => built ??= build();
1093
- }
1094
- function lazyShape(builders) {
1095
- const shape = {};
1096
- for (const [key, build] of Object.entries(builders)) {
1097
- Object.defineProperty(shape, key, {
1098
- get: once(build),
1099
- enumerable: true,
1100
- configurable: true
1101
- });
1102
- }
1103
- return shape;
1104
- }
1105
- var analyticsRanges = ["7d", "30d", "90d", "all"];
1106
- var amount = once(() => z11.number().int().safe());
1107
- var amounts = once(() => z11.array(amount()));
1108
- var instant = once(() => z11.iso.datetime({ offset: true }));
1109
- var analyticsQuerySchema = z11.strictObject(
1110
- lazyShape({
1111
- range: () => z11.enum(analyticsRanges),
1112
- /** A point ledger's key or ID. Defaults to the first ledger that is not archived. */
1113
- ledger: () => identifier.optional()
1114
- })
1115
- );
1116
- var metric2 = once(
1117
- () => z11.object({
1118
- total: amount(),
1119
- previousTotal: amount().optional(),
1120
- series: amounts()
1121
- })
1122
- );
1123
- var optionalMetric = once(() => metric2().optional());
1124
- var bucket = once(
1125
- () => z11.object({
1126
- /** The period's label in its time zone, such as `2026-10-08@Europe/Budapest` or `2026-W41@UTC`. */
1127
- key: z11.string(),
1128
- start: instant(),
1129
- end: instant()
1130
- })
1131
- );
1132
- var quest = once(
1133
- () => z11.object({
1134
- quest: identifier,
1135
- title: z11.string(),
1136
- /** Attempts created in the range. */
1137
- attempts: amount(),
1138
- /** Completions in the range that were never revoked. */
1139
- completions: amount(),
1140
- /** Attempts decided in the range: accepted, progressed or rejected. */
1141
- decided: amount(),
1142
- /** Attempts rejected in the range. */
1143
- rejected: amount(),
1144
- /** Attempts created in the range that went to staff review. */
1145
- needsReview: amount(),
1146
- /** `rejected ÷ decided`, or null below 10 decided attempts. */
1147
- rejectionRate: z11.number().min(0).max(1).nullable(),
1148
- /**
1149
- * The 5 most common rejections, most frequent first. Rejections with a code (an evaluator's
1150
- * reject code or one Relay writes, such as `budget-exhausted`) group by it, and `reason` is the
1151
- * latest rejection's reason; rejections without one group by their exact reason.
1152
- */
1153
- topReasons: z11.array(
1154
- z11.object({
1155
- reason: z11.string(),
1156
- code: z11.string().nullable(),
1157
- count: amount()
1158
- })
1159
- ),
1160
- /** Rejections by who made them: the evaluator, staff, an exhausted budget, an expired deferral. */
1161
- rejectionsBySource: z11.object({
1162
- evaluator: amount(),
1163
- staff: amount(),
1164
- budget: amount(),
1165
- expired: amount()
1166
- }),
1167
- /** Attempts and completions per bucket. */
1168
- series: z11.object({ attempts: amounts(), completions: amounts() })
1169
- })
1170
- );
1171
- var analyticsReadSchema = z11.object(
1172
- lazyShape({
1173
- range: () => z11.object({
1174
- key: z11.enum(analyticsRanges),
1175
- from: instant(),
1176
- /** Now, by the database's clock, when the read ran. */
1177
- to: instant(),
1178
- bucket: z11.enum(["day", "week"]),
1179
- /** The project calendar's time zone now. Buckets before a time zone change follow the old one. */
1180
- timeZone: z11.string(),
1181
- buckets: z11.array(bucket())
1182
- }),
1183
- /** The range of equal length before this one, which `previousTotal` covers. Absent for `all`. */
1184
- previous: () => z11.object({ from: instant(), to: instant() }).optional(),
1185
- members: () => z11.object({
1186
- /** Members who joined the project. */
1187
- signUps: metric2(),
1188
- /** Distinct members with an attempt; the total counts each member once over the range. */
1189
- active: metric2()
1190
- }),
1191
- quests: () => z11.object({
1192
- attempts: metric2(),
1193
- completions: metric2(),
1194
- rejections: metric2(),
1195
- needsReview: metric2(),
1196
- /** Quests with activity in the range, most attempted first. */
1197
- byQuest: z11.array(quest())
1198
- }),
1199
- points: () => z11.object({
1200
- /** The project's point ledgers, oldest first. */
1201
- ledgers: z11.array(
1202
- z11.object({ key: identifier, name: z11.string(), archived: z11.boolean() })
1203
- ),
1204
- /** The ledger this section reads, or null when the project has none to read. */
1205
- ledger: identifier.nullable(),
1206
- /** Whether the ledger has a spend entry. `spent` and `net` are present only when it does. */
1207
- hasSpending: z11.boolean(),
1208
- /** Points in award entries. */
1209
- awarded: metric2(),
1210
- /** Points in spend entries, as a positive number. */
1211
- spent: optionalMetric(),
1212
- /** Every entry's signed amount: awards, spends, adjustments and reversals. */
1213
- net: optionalMetric(),
1214
- /** Distinct members awarded points; the total counts each member once over the range. */
1215
- membersEarning: metric2()
1216
- }),
1217
- /** Fulfilled offer redemptions. Present only when the project has an offer. */
1218
- offers: () => z11.object({
1219
- redemptions: metric2(),
1220
- /** Every offer, most redeemed first. */
1221
- byOffer: z11.array(
1222
- z11.object({
1223
- offer: identifier,
1224
- title: z11.string(),
1225
- redemptions: amount(),
1226
- series: amounts()
1227
- })
1228
- )
1229
- }).optional(),
1230
- /** Present only when the project has a referral program. */
1231
- referrals: () => z11.object({
1232
- /** Referrals accepted. */
1233
- accepted: metric2(),
1234
- /** Active qualifications, by when they first qualified; suspended referrals still count. */
1235
- qualified: metric2(),
1236
- /**
1237
- * Of the referrals accepted in the range (and in the range before), how many have an
1238
- * active qualification now, each counted once; suspended referrals still count.
1239
- * `acceptedQualified.total ÷ accepted.total` is the share of the range's friends who have
1240
- * qualified since, never above 1.
1241
- */
1242
- acceptedQualified: z11.object({
1243
- total: amount(),
1244
- previousTotal: amount().optional()
1245
- })
1246
- }).optional(),
1247
- /** Present only in the test environment. */
1248
- testEnvironment: () => z11.object({
1249
- /** When a test member was last reset, deleting their history, or null. */
1250
- lastResetAt: instant().nullable(),
1251
- /** Test members whose clock is advanced, so their activity can be dated in the future. */
1252
- shiftedClockMembers: amount()
1253
- }).optional()
1254
- })
1255
- );
1145
+ var dashboardListQuerySchema = z11.strictObject({
1146
+ includeArchived: z11.union([z11.boolean(), z11.enum(["true", "false"])]).transform((value) => value === true || value === "true").optional()
1147
+ });
1148
+ var summaryFields = {
1149
+ key: identifier,
1150
+ title: z11.string(),
1151
+ description: z11.string().nullable(),
1152
+ /** Lists order by it, dashboards without one last, then by title. */
1153
+ position: z11.number().int().nullable(),
1154
+ archivedAt: z11.number().int().nonnegative().nullable(),
1155
+ /** When the current version was published. */
1156
+ updatedAt: z11.number().int().nonnegative()
1157
+ };
1158
+ var dashboardSummarySchema = z11.object(summaryFields);
1159
+ var dashboardListSchema = z11.array(dashboardSummarySchema);
1160
+ var dashboardLifecycleInputSchema = z11.strictObject({
1161
+ actionId: z11.string().uuid(),
1162
+ dashboard: identifier,
1163
+ archived: z11.boolean(),
1164
+ reason: z11.string().trim().min(1).max(500),
1165
+ expectedArchivedAt: z11.number().int().nonnegative().nullable().optional()
1166
+ });
1167
+ var dashboardLifecycleResultSchema = z11.object({
1168
+ dashboard: dashboardSummarySchema,
1169
+ changed: z11.boolean()
1170
+ });
1171
+ var dashboardReadQuerySchema = z11.strictObject({
1172
+ key: identifier,
1173
+ range: z11.enum(analyticsRanges).optional()
1174
+ });
1175
+ var dashboardReadSchema = z11.object({
1176
+ ...summaryFields,
1177
+ definition: dashboardDefinitionSchema,
1178
+ range: z11.enum(analyticsRanges),
1179
+ panels: z11.array(
1180
+ z11.object({
1181
+ key: identifier,
1182
+ result: analyticsMetricResultSchema.optional(),
1183
+ error: z11.object({ code: z11.string(), message: z11.string() }).optional()
1184
+ })
1185
+ )
1186
+ });
1256
1187
 
1257
1188
  // src/server/index.ts
1258
- import * as z17 from "zod";
1189
+ import * as z18 from "zod";
1190
+
1191
+ // src/server/billing.ts
1192
+ import { z as z12 } from "zod";
1193
+ var billingSubscriptionPlans = ["launch", "growth", "scale"];
1194
+ var billingIntervals = ["month", "year"];
1195
+ var billingCheckoutInputSchema = z12.strictObject({
1196
+ plan: z12.enum(billingSubscriptionPlans),
1197
+ interval: z12.enum(billingIntervals)
1198
+ });
1199
+ var billingPlanChangeInputSchema = z12.strictObject({
1200
+ plan: z12.enum(billingSubscriptionPlans),
1201
+ interval: z12.enum(billingIntervals)
1202
+ });
1203
+ var billingPlanChangeSchema = z12.object({
1204
+ timing: z12.enum(["now", "renewal", "none"]),
1205
+ invoiceUrl: z12.string().url().nullable()
1206
+ });
1207
+ var billingTopupMaxQuantity = 10;
1208
+ var billingTopupInputSchema = z12.strictObject({
1209
+ quantity: z12.number().int().min(1).max(billingTopupMaxQuantity)
1210
+ });
1211
+ var billingSessionSchema = z12.object({ url: z12.string().url() });
1212
+ var billingSubscriptionSchema = z12.object({
1213
+ plan: z12.enum(billingSubscriptionPlans),
1214
+ interval: z12.enum(billingIntervals),
1215
+ status: z12.string(),
1216
+ currentPeriodEnd: z12.number().int().nullable(),
1217
+ cancelAtPeriodEnd: z12.boolean(),
1218
+ lastInvoice: z12.enum(["paid", "failed"]).nullable(),
1219
+ livemode: z12.boolean(),
1220
+ scheduledChange: z12.object({
1221
+ plan: z12.enum(billingSubscriptionPlans),
1222
+ interval: z12.enum(billingIntervals),
1223
+ at: z12.number().int()
1224
+ }).nullable().default(null),
1225
+ endedFor: z12.enum(["project-deleted", "project-transferred"]).nullable().default(null),
1226
+ unpaid: z12.object({
1227
+ since: z12.number().int(),
1228
+ promotionsRefusedAt: z12.number().int(),
1229
+ offlineAt: z12.number().int()
1230
+ }).nullable().default(null)
1231
+ });
1232
+ var projectBillingSchema = z12.object({
1233
+ available: z12.boolean(),
1234
+ reason: z12.enum(["admin-required", "staff-only", "not-configured"]).nullable(),
1235
+ subscription: billingSubscriptionSchema.nullable()
1236
+ });
1259
1237
 
1260
1238
  // src/server/hosting.ts
1261
- import * as z14 from "zod";
1239
+ import * as z15 from "zod";
1262
1240
 
1263
1241
  // src/server/schedules.ts
1264
- import * as z12 from "zod";
1242
+ import * as z13 from "zod";
1265
1243
  import { Cron } from "croner";
1266
1244
  var APP_SCHEDULE_LIMIT = 10;
1267
1245
  var APP_SCHEDULE_MIN_INTERVAL = 3e5;
1268
1246
  var APP_SCHEDULE_TIMEOUT = 3e4;
1269
- var appScheduleNameSchema = z12.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
1270
- var appSchedulePathSchema = z12.string().min(2).max(512).refine((path) => {
1247
+ var appScheduleNameSchema = z13.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
1248
+ var appSchedulePathSchema = z13.string().min(2).max(512).refine((path) => {
1271
1249
  if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
1272
1250
  return false;
1273
1251
  }
1274
1252
  return path.split("/").slice(1).every((part) => part.length > 0) && new URL(path, "https://app.invalid").pathname === path;
1275
1253
  }, "Expected an absolute route path without a query or hidden segments");
1276
1254
  function interval(value) {
1277
- const amount2 = Number(value.slice(0, -1));
1255
+ const amount = Number(value.slice(0, -1));
1278
1256
  const unit = value.slice(-1);
1279
- return amount2 * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
1257
+ return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
1280
1258
  }
1281
- var everySchema = z12.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
1259
+ var everySchema = z13.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
1282
1260
  (value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
1283
1261
  "Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
1284
1262
  );
1285
- var cronSchema = z12.string().max(120).refine((value) => {
1263
+ var cronSchema = z13.string().max(120).refine((value) => {
1286
1264
  const fields = value.trim().split(/\s+/);
1287
1265
  if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
1288
1266
  return false;
@@ -1307,15 +1285,15 @@ var cronSchema = z12.string().max(120).refine((value) => {
1307
1285
  var declaration = {
1308
1286
  name: appScheduleNameSchema,
1309
1287
  path: appSchedulePathSchema,
1310
- description: z12.string().min(1).max(500)
1288
+ description: z13.string().min(1).max(500)
1311
1289
  };
1312
- var everySchedule = z12.object({ ...declaration, every: everySchema });
1313
- var cronSchedule = z12.object({ ...declaration, cron: cronSchema });
1314
- var appScheduleSchema = z12.union([
1290
+ var everySchedule = z13.object({ ...declaration, every: everySchema });
1291
+ var cronSchedule = z13.object({ ...declaration, cron: cronSchema });
1292
+ var appScheduleSchema = z13.union([
1315
1293
  everySchedule.strict(),
1316
1294
  cronSchedule.strict()
1317
1295
  ]);
1318
- var appSchedulesSchema = z12.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
1296
+ var appSchedulesSchema = z13.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
1319
1297
  (items) => new Set(items.map((item) => item.name)).size === items.length,
1320
1298
  "Schedule names must be unique"
1321
1299
  );
@@ -1332,25 +1310,25 @@ function nextScheduleRun(schedule, after) {
1332
1310
  }
1333
1311
  return next.getTime();
1334
1312
  }
1335
- var appScheduleStateSchema = z12.enum(["active", "paused", "archived"]);
1313
+ var appScheduleStateSchema = z13.enum(["active", "paused", "archived"]);
1336
1314
  var APP_SCHEDULE_RESULT_BYTES = 16384;
1337
- var appScheduleDiagnosticSchema = z12.object({
1338
- level: z12.enum(["error", "warning", "info"]),
1339
- message: z12.string().min(1).max(500),
1315
+ var appScheduleDiagnosticSchema = z13.object({
1316
+ level: z13.enum(["error", "warning", "info"]),
1317
+ message: z13.string().min(1).max(500),
1340
1318
  /** What the line is about, such as a member, record or tracker ID. */
1341
- subject: z12.string().min(1).max(200).optional(),
1319
+ subject: z13.string().min(1).max(200).optional(),
1342
1320
  /** A stable code the app chooses, such as `ingest-timeout`. */
1343
- code: z12.string().min(1).max(100).optional()
1321
+ code: z13.string().min(1).max(100).optional()
1344
1322
  });
1345
- var appScheduleResultSchema = z12.object({
1346
- outcome: z12.enum(["succeeded", "partial", "failed"]),
1347
- summary: z12.string().min(1).max(500).optional(),
1323
+ var appScheduleResultSchema = z13.object({
1324
+ outcome: z13.enum(["succeeded", "partial", "failed"]),
1325
+ summary: z13.string().min(1).max(500).optional(),
1348
1326
  /** Counts and gauges, such as processed and failed members. */
1349
- metrics: z12.record(z12.string().regex(/^[A-Za-z][\w.-]{0,63}$/), z12.number()).refine(
1327
+ metrics: z13.record(z13.string().regex(/^[A-Za-z][\w.-]{0,63}$/), z13.number()).refine(
1350
1328
  (metrics) => Object.keys(metrics).length <= 50,
1351
1329
  "Report at most 50 metrics"
1352
1330
  ).optional(),
1353
- diagnostics: z12.array(appScheduleDiagnosticSchema).max(50).optional()
1331
+ diagnostics: z13.array(appScheduleDiagnosticSchema).max(50).optional()
1354
1332
  });
1355
1333
  function scheduleResult(result) {
1356
1334
  const body = JSON.stringify(appScheduleResultSchema.parse(result));
@@ -1363,41 +1341,41 @@ function scheduleResult(result) {
1363
1341
  headers: { "Content-Type": "application/json" }
1364
1342
  });
1365
1343
  }
1366
- var appScheduleRunSchema = z12.object({
1367
- id: z12.string().uuid(),
1368
- build: z12.string().uuid(),
1369
- startedAt: z12.number(),
1370
- scheduledAt: z12.number(),
1371
- manual: z12.boolean(),
1372
- status: z12.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
1373
- duration: z12.number().nullable(),
1344
+ var appScheduleRunSchema = z13.object({
1345
+ id: z13.string().uuid(),
1346
+ build: z13.string().uuid(),
1347
+ startedAt: z13.number(),
1348
+ scheduledAt: z13.number(),
1349
+ manual: z13.boolean(),
1350
+ status: z13.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
1351
+ duration: z13.number().nullable(),
1374
1352
  /** Why the run failed or is uncertain, or why Relay ignored the app's result. */
1375
- error: z12.string().nullable(),
1353
+ error: z13.string().nullable(),
1376
1354
  /** The app's JSON answer when it sent a valid result. Absent on runs from before results. */
1377
1355
  result: appScheduleResultSchema.nullable().optional()
1378
1356
  });
1379
- var appScheduleRunsSchema = z12.object({
1357
+ var appScheduleRunsSchema = z13.object({
1380
1358
  /** Newest first: the latest twenty runs of one schedule, including a queued or running one. */
1381
- runs: z12.array(appScheduleRunSchema)
1359
+ runs: z13.array(appScheduleRunSchema)
1382
1360
  });
1383
- var appScheduleListSchema = z12.object({
1361
+ var appScheduleListSchema = z13.object({
1384
1362
  state: appScheduleStateSchema,
1385
- schedules: z12.array(
1386
- z12.object({
1387
- declaration: z12.union([everySchedule, cronSchedule]),
1388
- nextRun: z12.number().nullable(),
1389
- blocked: z12.boolean(),
1363
+ schedules: z13.array(
1364
+ z13.object({
1365
+ declaration: z13.union([everySchedule, cronSchedule]),
1366
+ nextRun: z13.number().nullable(),
1367
+ blocked: z13.boolean(),
1390
1368
  lastRun: appScheduleRunSchema.nullable()
1391
1369
  })
1392
1370
  )
1393
1371
  });
1394
- var scheduledInvocationSchema = z12.object({
1395
- id: z12.string().uuid(),
1396
- build: z12.string().uuid(),
1372
+ var scheduledInvocationSchema = z13.object({
1373
+ id: z13.string().uuid(),
1374
+ build: z13.string().uuid(),
1397
1375
  name: appScheduleNameSchema,
1398
- scheduledAt: z12.number().int(),
1399
- startedAt: z12.number().int(),
1400
- manual: z12.boolean()
1376
+ scheduledAt: z13.number().int(),
1377
+ startedAt: z13.number().int(),
1378
+ manual: z13.boolean()
1401
1379
  }).strict();
1402
1380
  async function verifyScheduledRequest(request, key) {
1403
1381
  const signature = request.headers.get("X-Domino-Schedule-Signature");
@@ -1462,7 +1440,7 @@ ${body}`)
1462
1440
  }
1463
1441
 
1464
1442
  // src/server/starters.ts
1465
- import * as z13 from "zod";
1443
+ import * as z14 from "zod";
1466
1444
  var starterTemplates = [
1467
1445
  {
1468
1446
  id: "campaign",
@@ -1495,63 +1473,63 @@ var starterTemplates = [
1495
1473
  summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
1496
1474
  }
1497
1475
  ];
1498
- var starterIdSchema = z13.enum(
1476
+ var starterIdSchema = z14.enum(
1499
1477
  starterTemplates.map((template) => template.id)
1500
1478
  );
1501
1479
 
1502
1480
  // src/server/hosting.ts
1503
- var outputPathSchema = z14.string().min(1).max(512).refine(
1481
+ var outputPathSchema = z15.string().min(1).max(512).refine(
1504
1482
  (path) => path.split("/").every(
1505
1483
  (part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
1506
1484
  ),
1507
1485
  "Expected a relative build output path without hidden segments"
1508
1486
  );
1509
- var appRoutingSchema = z14.enum(["legacy", "transparent"]).default("legacy");
1487
+ var appRoutingSchema = z15.enum(["legacy", "transparent"]).default("legacy");
1510
1488
  var APP_SECRET_LIMIT = 50;
1511
1489
  var APP_KV_LIMIT = 5;
1512
1490
  var APP_SQL_LIMIT = 5;
1513
1491
  var APP_MIGRATION_LIMIT = 100;
1514
1492
  var APP_MIGRATION_FILE_BYTES = 9e4;
1515
1493
  var APP_MIGRATION_TOTAL_BYTES = 1e6;
1516
- var appSecretNameSchema = z14.string().regex(
1494
+ var appSecretNameSchema = z15.string().regex(
1517
1495
  /^[A-Z_][A-Z0-9_]{0,63}$/,
1518
1496
  "Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
1519
1497
  ).refine(
1520
1498
  (name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
1521
1499
  "DOMINO_ names and ASSETS are reserved for Domino's own bindings"
1522
1500
  );
1523
- var appSecretValueSchema = z14.string().min(1).refine(
1501
+ var appSecretValueSchema = z15.string().min(1).refine(
1524
1502
  (value) => new TextEncoder().encode(value).length <= 5120,
1525
1503
  "Secret values can be at most 5 KiB"
1526
1504
  );
1527
- var appSecretInputSchema = z14.object({ value: appSecretValueSchema }).strict();
1528
- var appSecretSchema = z14.object({
1505
+ var appSecretInputSchema = z15.object({ value: appSecretValueSchema }).strict();
1506
+ var appSecretSchema = z15.object({
1529
1507
  name: appSecretNameSchema,
1530
- updatedAt: z14.number(),
1531
- updatedBy: z14.string()
1508
+ updatedAt: z15.number(),
1509
+ updatedBy: z15.string()
1532
1510
  });
1533
- var appSecretDeclarationSchema = z14.object({
1534
- description: z14.string().trim().min(1).max(500),
1535
- required: z14.boolean().default(true)
1511
+ var appSecretDeclarationSchema = z15.object({
1512
+ description: z15.string().trim().min(1).max(500),
1513
+ required: z15.boolean().default(true)
1536
1514
  }).strict();
1537
- var appSecretDeclarationsSchema = z14.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
1515
+ var appSecretDeclarationsSchema = z15.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
1538
1516
  (secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
1539
1517
  `Declare at most ${APP_SECRET_LIMIT} app secrets`
1540
1518
  );
1541
- var appSecretListSchema = z14.object({
1542
- secrets: z14.array(appSecretSchema),
1543
- declared: z14.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
1519
+ var appSecretListSchema = z15.object({
1520
+ secrets: z15.array(appSecretSchema),
1521
+ declared: z15.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
1544
1522
  });
1545
- var hostedAppSecretsSchema = z14.object({ secrets: z14.record(appSecretNameSchema, appSecretValueSchema) }).strict();
1546
- var storageDescription = z14.object({
1547
- description: z14.string().trim().min(1).max(500)
1523
+ var hostedAppSecretsSchema = z15.object({ secrets: z15.record(appSecretNameSchema, appSecretValueSchema) }).strict();
1524
+ var storageDescription = z15.object({
1525
+ description: z15.string().trim().min(1).max(500)
1548
1526
  }).strict();
1549
- var appStorageSchema = z14.object({
1550
- kv: z14.record(appSecretNameSchema, storageDescription).refine(
1527
+ var appStorageSchema = z15.object({
1528
+ kv: z15.record(appSecretNameSchema, storageDescription).refine(
1551
1529
  (stores) => Object.keys(stores).length <= APP_KV_LIMIT,
1552
1530
  `Declare at most ${APP_KV_LIMIT} KV stores`
1553
1531
  ).default({}),
1554
- sql: z14.record(
1532
+ sql: z15.record(
1555
1533
  appSecretNameSchema,
1556
1534
  storageDescription.extend({
1557
1535
  migrations: outputPathSchema.optional()
@@ -1561,77 +1539,77 @@ var appStorageSchema = z14.object({
1561
1539
  `Declare at most ${APP_SQL_LIMIT} SQL stores`
1562
1540
  ).default({})
1563
1541
  }).strict();
1564
- var appStorageKindSchema = z14.enum(["kv", "sql"]);
1565
- var appStorageListSchema = z14.object({
1566
- stores: z14.array(
1567
- z14.object({
1568
- kind: z14.string(),
1542
+ var appStorageKindSchema = z15.enum(["kv", "sql"]);
1543
+ var appStorageListSchema = z15.object({
1544
+ stores: z15.array(
1545
+ z15.object({
1546
+ kind: z15.string(),
1569
1547
  name: appSecretNameSchema,
1570
- createdAt: z14.number().nullable(),
1571
- declared: z14.boolean(),
1572
- description: z14.string().optional()
1548
+ createdAt: z15.number().nullable(),
1549
+ declared: z15.boolean(),
1550
+ description: z15.string().optional()
1573
1551
  })
1574
1552
  )
1575
1553
  });
1576
1554
  var APP_STORAGE_ROW_LIMIT = 50;
1577
1555
  var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
1578
- var appStorageCellSchema = z14.union([
1579
- z14.string(),
1580
- z14.number(),
1581
- z14.null(),
1582
- z14.object({ text: z14.string(), truncated: z14.literal(true) }),
1583
- z14.object({ blob: z14.number().int().min(0) })
1556
+ var appStorageCellSchema = z15.union([
1557
+ z15.string(),
1558
+ z15.number(),
1559
+ z15.null(),
1560
+ z15.object({ text: z15.string(), truncated: z15.literal(true) }),
1561
+ z15.object({ blob: z15.number().int().min(0) })
1584
1562
  ]);
1585
- var appStorageTablesSchema = z14.object({
1586
- tables: z14.array(
1563
+ var appStorageTablesSchema = z15.object({
1564
+ tables: z15.array(
1587
1565
  /** `kind` is SQLite's: `table` or `view`. */
1588
- z14.object({ name: z14.string(), kind: z14.string() })
1566
+ z15.object({ name: z15.string(), kind: z15.string() })
1589
1567
  )
1590
1568
  });
1591
- var appStorageRowsSchema = z14.object({
1592
- table: z14.string(),
1593
- columns: z14.array(z14.string()),
1594
- rows: z14.array(z14.array(appStorageCellSchema)),
1569
+ var appStorageRowsSchema = z15.object({
1570
+ table: z15.string(),
1571
+ columns: z15.array(z15.string()),
1572
+ rows: z15.array(z15.array(appStorageCellSchema)),
1595
1573
  /** How many rows come before this page in storage order. */
1596
- offset: z14.number().int().min(0),
1597
- total: z14.number().int().min(0),
1574
+ offset: z15.number().int().min(0),
1575
+ total: z15.number().int().min(0),
1598
1576
  /** Pass back as `cursor` for the next page; null on the last one. */
1599
1577
  nextCursor: pageCursorSchema.nullable().default(null)
1600
1578
  });
1601
- var appStorageKeysSchema = z14.object({
1602
- keys: z14.array(
1603
- z14.object({ name: z14.string(), expiration: z14.number().nullable() })
1579
+ var appStorageKeysSchema = z15.object({
1580
+ keys: z15.array(
1581
+ z15.object({ name: z15.string(), expiration: z15.number().nullable() })
1604
1582
  ),
1605
1583
  /** Pass back as `cursor` for the next page; null on the last one. */
1606
1584
  nextCursor: pageCursorSchema.nullable().default(null),
1607
1585
  /** @deprecated Use `nextCursor`. Removed in 2.0.0. */
1608
- cursor: z14.string().nullable()
1586
+ cursor: z15.string().nullable()
1609
1587
  });
1610
- var appStorageValueSchema = z14.object({
1611
- key: z14.string(),
1612
- size: z14.number().int().min(0),
1588
+ var appStorageValueSchema = z15.object({
1589
+ key: z15.string(),
1590
+ size: z15.number().int().min(0),
1613
1591
  /** Null when the value is not UTF-8 text. */
1614
- text: z14.string().nullable(),
1615
- truncated: z14.boolean()
1592
+ text: z15.string().nullable(),
1593
+ truncated: z15.boolean()
1616
1594
  });
1617
1595
  var APP_STORAGE_CELL_CHARACTERS = 1e5;
1618
- var appStorageCellPageSchema = z14.object({
1619
- table: z14.string(),
1620
- column: z14.string(),
1596
+ var appStorageCellPageSchema = z15.object({
1597
+ table: z15.string(),
1598
+ column: z15.string(),
1621
1599
  /** The row's position in storage order: a rows page's `offset` plus its index on that page. */
1622
- row: z14.number().int().min(0),
1600
+ row: z15.number().int().min(0),
1623
1601
  /** SQLite's storage class. */
1624
- type: z14.enum(["text", "integer", "real", "blob", "null"]),
1602
+ type: z15.enum(["text", "integer", "real", "blob", "null"]),
1625
1603
  /** Characters of text, or of a number's text form; bytes of a BLOB; null for NULL. */
1626
- length: z14.number().int().min(0).nullable(),
1604
+ length: z15.number().int().min(0).nullable(),
1627
1605
  /** How many characters come before this page. */
1628
- offset: z14.number().int().min(0),
1606
+ offset: z15.number().int().min(0),
1629
1607
  /** Up to 100,000 characters from `offset`. Null for a BLOB, whose bytes are never read, and NULL. */
1630
- text: z14.string().nullable(),
1608
+ text: z15.string().nullable(),
1631
1609
  /** Pass back as `cursor` for the next page; null on the last one. */
1632
1610
  nextCursor: pageCursorSchema.nullable().default(null)
1633
1611
  });
1634
- var appMigrationNameSchema = z14.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
1612
+ var appMigrationNameSchema = z15.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
1635
1613
  function compareAppMigrations(a, b) {
1636
1614
  const left = Number.parseInt(a.split("_")[0], 10);
1637
1615
  const right = Number.parseInt(b.split("_")[0], 10);
@@ -1648,12 +1626,12 @@ function compareAppMigrations(a, b) {
1648
1626
  }
1649
1627
  return a < b ? -1 : a > b ? 1 : 0;
1650
1628
  }
1651
- var appMigrationsSchema = z14.record(
1629
+ var appMigrationsSchema = z15.record(
1652
1630
  appSecretNameSchema,
1653
- z14.array(
1654
- z14.object({
1631
+ z15.array(
1632
+ z15.object({
1655
1633
  name: appMigrationNameSchema,
1656
- sql: z14.string().min(1).refine(
1634
+ sql: z15.string().min(1).refine(
1657
1635
  (sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
1658
1636
  `A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
1659
1637
  )
@@ -1671,21 +1649,21 @@ var appMigrationsSchema = z14.record(
1671
1649
  );
1672
1650
  var appScripts = {
1673
1651
  routing: appRoutingSchema,
1674
- devScript: z14.string().regex(/^[\w:-]+$/),
1675
- checkScript: z14.string().regex(/^[\w:-]+$/),
1676
- buildScript: z14.string().regex(/^[\w:-]+$/)
1652
+ devScript: z15.string().regex(/^[\w:-]+$/),
1653
+ checkScript: z15.string().regex(/^[\w:-]+$/),
1654
+ buildScript: z15.string().regex(/^[\w:-]+$/)
1677
1655
  };
1678
1656
  var workerSettings = {
1679
- runWorkerFirst: z14.boolean().default(false),
1657
+ runWorkerFirst: z15.boolean().default(false),
1680
1658
  main: outputPathSchema.refine(
1681
1659
  (path) => /\.m?js$/.test(path),
1682
1660
  "Expected a compiled JavaScript entry"
1683
1661
  ),
1684
- compatibilityDate: z14.string().regex(/^\d{4}-\d{2}-\d{2}$/),
1685
- compatibilityFlags: z14.array(z14.string().min(1)).max(50).default([]),
1686
- vars: z14.record(
1687
- z14.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
1688
- z14.string()
1662
+ compatibilityDate: z15.string().regex(/^\d{4}-\d{2}-\d{2}$/),
1663
+ compatibilityFlags: z15.array(z15.string().min(1)).max(50).default([]),
1664
+ vars: z15.record(
1665
+ z15.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
1666
+ z15.string()
1689
1667
  ).default({}),
1690
1668
  secrets: appSecretDeclarationsSchema.default({}),
1691
1669
  storage: appStorageSchema.optional(),
@@ -1714,62 +1692,62 @@ var distinctBindings = (worker, ctx) => {
1714
1692
  }
1715
1693
  }
1716
1694
  };
1717
- var hostedAppSchema = z14.discriminatedUnion("kind", [
1718
- z14.object({
1719
- kind: z14.literal("static"),
1695
+ var hostedAppSchema = z15.discriminatedUnion("kind", [
1696
+ z15.object({
1697
+ kind: z15.literal("static"),
1720
1698
  directory: outputPathSchema,
1721
1699
  ...appScripts
1722
1700
  }).strict(),
1723
- z14.object({
1724
- kind: z14.literal("worker"),
1701
+ z15.object({
1702
+ kind: z15.literal("worker"),
1725
1703
  directory: outputPathSchema,
1726
1704
  assetsDirectory: outputPathSchema.optional(),
1727
1705
  ...appScripts,
1728
1706
  ...workerSettings
1729
1707
  }).strict().superRefine(distinctBindings)
1730
1708
  ]);
1731
- var repositorySchema = z14.object({
1732
- id: z14.string().uuid(),
1709
+ var repositorySchema = z15.object({
1710
+ id: z15.string().uuid(),
1733
1711
  organization: identifier,
1734
1712
  project: identifier,
1735
- remote: z14.string().url(),
1736
- defaultBranch: z14.string(),
1737
- status: z14.enum(["provisioning", "ready"])
1713
+ remote: z15.string().url(),
1714
+ defaultBranch: z15.string(),
1715
+ status: z15.enum(["provisioning", "ready"])
1738
1716
  });
1739
- var createRepositorySchema = z14.object({
1717
+ var createRepositorySchema = z15.object({
1740
1718
  /** Omitted: the starter chosen at project setup, else `campaign`. */
1741
1719
  starter: starterIdSchema.optional()
1742
1720
  }).strict();
1743
- var deviceStartSchema = z14.object({
1744
- challenge: z14.string().regex(/^[a-f0-9]{64}$/)
1721
+ var deviceStartSchema = z15.object({
1722
+ challenge: z15.string().regex(/^[a-f0-9]{64}$/)
1745
1723
  }).strict();
1746
- var deviceRedeemSchema = z14.object({
1747
- id: z14.string().uuid(),
1748
- verifier: z14.string().min(43).max(128)
1724
+ var deviceRedeemSchema = z15.object({
1725
+ id: z15.string().uuid(),
1726
+ verifier: z15.string().min(43).max(128)
1749
1727
  }).strict();
1750
- var deviceApproveSchema = z14.object({
1751
- id: z14.string().uuid(),
1752
- code: z14.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
1728
+ var deviceApproveSchema = z15.object({
1729
+ id: z15.string().uuid(),
1730
+ code: z15.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
1753
1731
  }).strict();
1754
- var commitSchema = z14.string().regex(/^[a-f0-9]{40}$/);
1755
- var stageRequestSchema = z14.object({
1732
+ var commitSchema = z15.string().regex(/^[a-f0-9]{40}$/);
1733
+ var stageRequestSchema = z15.object({
1756
1734
  commit: commitSchema,
1757
- requestId: z14.string().uuid()
1735
+ requestId: z15.string().uuid()
1758
1736
  }).strict();
1759
- var buildIdentitySchema = z14.object({
1737
+ var buildIdentitySchema = z15.object({
1760
1738
  routing: appRoutingSchema,
1761
- slug: z14.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
1762
- runtime: z14.enum(["simulation", "hosted-test"]).default("simulation"),
1763
- id: z14.string().uuid(),
1764
- repository: z14.string().uuid(),
1739
+ slug: z15.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
1740
+ runtime: z15.enum(["simulation", "hosted-test"]).default("simulation"),
1741
+ id: z15.string().uuid(),
1742
+ repository: z15.string().uuid(),
1765
1743
  organization: identifier,
1766
1744
  project: identifier,
1767
1745
  commit: commitSchema,
1768
- createdAt: z14.number(),
1769
- actor: z14.string(),
1770
- commitMessage: z14.string().max(500).optional()
1746
+ createdAt: z15.number(),
1747
+ actor: z15.string(),
1748
+ commitMessage: z15.string().max(500).optional()
1771
1749
  });
1772
- var buildPhaseSchema = z14.enum([
1750
+ var buildPhaseSchema = z15.enum([
1773
1751
  "queued",
1774
1752
  "source",
1775
1753
  "install",
@@ -1779,120 +1757,120 @@ var buildPhaseSchema = z14.enum([
1779
1757
  "ready",
1780
1758
  "failed"
1781
1759
  ]);
1782
- var buildStatusSchema = z14.object({
1760
+ var buildStatusSchema = z15.object({
1783
1761
  phase: buildPhaseSchema,
1784
1762
  failedPhase: buildPhaseSchema.optional(),
1785
- updatedAt: z14.number(),
1786
- message: z14.string()
1763
+ updatedAt: z15.number(),
1764
+ message: z15.string()
1787
1765
  });
1788
1766
  var hostedBuildSchema = buildIdentitySchema.extend({
1789
1767
  ...buildStatusSchema.shape,
1790
- finished: z14.boolean(),
1791
- current: z14.boolean(),
1792
- stagingUrl: z14.string().url()
1768
+ finished: z15.boolean(),
1769
+ current: z15.boolean(),
1770
+ stagingUrl: z15.string().url()
1793
1771
  });
1794
- var liveAppSchema = z14.object({
1795
- url: z14.string().url().nullable(),
1796
- state: z14.enum(["none", "deploying", "live", "failed"]),
1772
+ var liveAppSchema = z15.object({
1773
+ url: z15.string().url().nullable(),
1774
+ state: z15.enum(["none", "deploying", "live", "failed"]),
1797
1775
  /** The build the address serves, or null before the first one goes live. */
1798
- build: z14.string().uuid().nullable(),
1776
+ build: z15.string().uuid().nullable(),
1799
1777
  /** The build the last approved promotion asked for, while it differs from `build`. */
1800
- requested: z14.string().uuid().nullable(),
1801
- failure: z14.string().nullable()
1778
+ requested: z15.string().uuid().nullable(),
1779
+ failure: z15.string().nullable()
1802
1780
  });
1803
- var customDomainStateSchema = z14.enum([
1781
+ var customDomainStateSchema = z15.enum([
1804
1782
  "awaiting-dns",
1805
1783
  "provisioning",
1806
1784
  "active",
1807
1785
  "attention",
1808
1786
  "suspended"
1809
1787
  ]);
1810
- var customDomainRecordSchema = z14.object({
1811
- type: z14.enum(["CNAME", "TXT"]),
1812
- name: z14.string(),
1813
- value: z14.string(),
1788
+ var customDomainRecordSchema = z15.object({
1789
+ type: z15.enum(["CNAME", "TXT"]),
1790
+ name: z15.string(),
1791
+ value: z15.string(),
1814
1792
  /** The values public DNS returned: empty when it had none, null before Domino looked. */
1815
- found: z14.array(z14.string()).nullable(),
1816
- matches: z14.boolean()
1793
+ found: z15.array(z15.string()).nullable(),
1794
+ matches: z15.boolean()
1817
1795
  });
1818
- var customDomainSchema = z14.object({
1819
- id: z14.string().uuid(),
1820
- hostname: z14.string(),
1821
- url: z14.string().url(),
1796
+ var customDomainSchema = z15.object({
1797
+ id: z15.string().uuid(),
1798
+ hostname: z15.string(),
1799
+ url: z15.string().url(),
1822
1800
  state: customDomainStateSchema,
1823
1801
  /** What to fix, in plain words, while the domain needs attention or is suspended. */
1824
- issue: z14.object({ code: z14.string(), message: z14.string() }).nullable(),
1825
- records: z14.array(customDomainRecordSchema),
1802
+ issue: z15.object({ code: z15.string(), message: z15.string() }).nullable(),
1803
+ records: z15.array(customDomainRecordSchema),
1826
1804
  /** Cloudflare's statuses and errors in its own words, once the domain is proven. */
1827
- cloudflare: z14.object({
1828
- hostnameStatus: z14.string(),
1829
- certificateStatus: z14.string().nullable(),
1830
- validationErrors: z14.array(z14.string()),
1831
- verificationErrors: z14.array(z14.string()),
1832
- certificateExpiresAt: z14.string().nullable()
1805
+ cloudflare: z15.object({
1806
+ hostnameStatus: z15.string(),
1807
+ certificateStatus: z15.string().nullable(),
1808
+ validationErrors: z15.array(z15.string()),
1809
+ verificationErrors: z15.array(z15.string()),
1810
+ certificateExpiresAt: z15.string().nullable()
1833
1811
  }).nullable(),
1834
- checkedAt: z14.string().nullable(),
1835
- nextCheckAt: z14.string().nullable(),
1836
- createdAt: z14.string()
1837
- });
1838
- var customDomainListSchema = z14.object({
1839
- domains: z14.array(customDomainSchema)
1840
- });
1841
- var customDomainInputSchema = z14.object({ hostname: z14.string().min(1).max(300) }).strict();
1842
- var stagingAccessModeSchema = z14.enum(["console", "password"]);
1843
- var stagingAccessSchema = z14.object({ mode: stagingAccessModeSchema });
1844
- var stagingAccessInputSchema = z14.discriminatedUnion("mode", [
1845
- z14.object({ mode: z14.literal("console") }).strict(),
1846
- z14.object({
1847
- mode: z14.literal("password"),
1848
- password: z14.string().min(8).max(128)
1812
+ checkedAt: z15.string().nullable(),
1813
+ nextCheckAt: z15.string().nullable(),
1814
+ createdAt: z15.string()
1815
+ });
1816
+ var customDomainListSchema = z15.object({
1817
+ domains: z15.array(customDomainSchema)
1818
+ });
1819
+ var customDomainInputSchema = z15.object({ hostname: z15.string().min(1).max(300) }).strict();
1820
+ var stagingAccessModeSchema = z15.enum(["console", "password"]);
1821
+ var stagingAccessSchema = z15.object({ mode: stagingAccessModeSchema });
1822
+ var stagingAccessInputSchema = z15.discriminatedUnion("mode", [
1823
+ z15.object({ mode: z15.literal("console") }).strict(),
1824
+ z15.object({
1825
+ mode: z15.literal("password"),
1826
+ password: z15.string().min(8).max(128)
1849
1827
  }).strict()
1850
1828
  ]);
1851
- var stagingPathSchema = z14.string().max(2048).refine(
1829
+ var stagingPathSchema = z15.string().max(2048).refine(
1852
1830
  (path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
1853
1831
  "Expected a path on the staging host"
1854
1832
  );
1855
- var stagingLinkSchema = z14.object({
1856
- url: z14.string().url(),
1857
- expiresAt: z14.number()
1833
+ var stagingLinkSchema = z15.object({
1834
+ url: z15.string().url(),
1835
+ expiresAt: z15.number()
1858
1836
  });
1859
- var buildSnapshotSchema = z14.object({
1860
- builds: z14.array(hostedBuildSchema),
1837
+ var buildSnapshotSchema = z15.object({
1838
+ builds: z15.array(hostedBuildSchema),
1861
1839
  current: hostedBuildSchema.nullable(),
1862
1840
  selected: hostedBuildSchema.nullable(),
1863
- logs: z14.string()
1841
+ logs: z15.string()
1864
1842
  });
1865
- var assetPathSchema = z14.string().max(512).refine(
1843
+ var assetPathSchema = z15.string().max(512).refine(
1866
1844
  (path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
1867
1845
  !/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
1868
1846
  "Expected a public asset path without hidden segments"
1869
1847
  );
1870
- var base64Schema = z14.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
1848
+ var base64Schema = z15.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
1871
1849
  var stagedDeploymentLimits = {
1872
1850
  /** Bytes of JSON, uncompressed. */
1873
1851
  size: 64e6,
1874
1852
  /** Bytes of the Brotli-compressed object. */
1875
1853
  compressedSize: 1e7
1876
1854
  };
1877
- var stagedDeploymentSchema = z14.object({
1878
- encoding: z14.literal("br"),
1879
- sha256: z14.string().regex(/^[0-9a-f]{64}$/),
1880
- compressedSize: z14.number().int().positive().max(stagedDeploymentLimits.compressedSize),
1881
- size: z14.number().int().positive().max(stagedDeploymentLimits.size)
1855
+ var stagedDeploymentSchema = z15.object({
1856
+ encoding: z15.literal("br"),
1857
+ sha256: z15.string().regex(/^[0-9a-f]{64}$/),
1858
+ compressedSize: z15.number().int().positive().max(stagedDeploymentLimits.compressedSize),
1859
+ size: z15.number().int().positive().max(stagedDeploymentLimits.size)
1882
1860
  }).strict();
1883
1861
  var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
1884
- content: z14.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
1862
+ content: z15.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
1885
1863
  }).strict();
1886
1864
  var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
1887
1865
  var artifactFields = {
1888
1866
  routing: appRoutingSchema,
1889
- worker: z14.object({
1867
+ worker: z15.object({
1890
1868
  ...workerSettings,
1891
1869
  migrations: appMigrationsSchema.optional(),
1892
- modules: z14.array(
1893
- z14.object({
1870
+ modules: z15.array(
1871
+ z15.object({
1894
1872
  path: outputPathSchema.refine((path) => path !== "metadata"),
1895
- type: z14.enum([
1873
+ type: z15.enum([
1896
1874
  "application/javascript+module",
1897
1875
  "application/wasm",
1898
1876
  "text/plain",
@@ -1902,26 +1880,26 @@ var artifactFields = {
1902
1880
  }).strict()
1903
1881
  ).min(1).max(500)
1904
1882
  }).strict().superRefine(distinctBindings).optional(),
1905
- assets: z14.array(
1906
- z14.object({
1883
+ assets: z15.array(
1884
+ z15.object({
1907
1885
  path: assetPathSchema,
1908
1886
  content: base64Schema.max(14e6),
1909
- size: z14.number().int().min(0).max(1e7)
1887
+ size: z15.number().int().min(0).max(1e7)
1910
1888
  }).strict()
1911
1889
  ).max(500)
1912
1890
  };
1913
- var buildArtifactsSchema = z14.discriminatedUnion("format", [
1914
- z14.object({
1915
- format: z14.literal(1),
1891
+ var buildArtifactsSchema = z15.discriminatedUnion("format", [
1892
+ z15.object({
1893
+ format: z15.literal(1),
1916
1894
  ...artifactFields,
1917
- quests: z14.unknown(),
1918
- catalog: z14.unknown()
1895
+ quests: z15.unknown(),
1896
+ catalog: z15.unknown()
1919
1897
  }).strict(),
1920
- z14.object({
1921
- format: z14.literal(2),
1898
+ z15.object({
1899
+ format: z15.literal(2),
1922
1900
  ...artifactFields,
1923
1901
  deployment: stagedDeploymentSchema,
1924
- images: z14.array(imageAssetArtifactSchema).max(10)
1902
+ images: z15.array(imageAssetArtifactSchema).max(10)
1925
1903
  }).strict()
1926
1904
  ]).superRefine((value, ctx) => {
1927
1905
  if (value.worker) {
@@ -1973,39 +1951,39 @@ var buildArtifactsSchema = z14.discriminatedUnion("format", [
1973
1951
  });
1974
1952
 
1975
1953
  // src/server/development.ts
1976
- import * as z15 from "zod";
1977
- var developmentPreflightSchema = z15.object({
1978
- organization: z15.string(),
1979
- project: z15.string(),
1980
- environment: z15.enum(["test", "live"]),
1981
- identity: z15.object({
1982
- exchange: z15.literal("supported"),
1983
- activeIntegrations: z15.number().int().nonnegative()
1954
+ import * as z16 from "zod";
1955
+ var developmentPreflightSchema = z16.object({
1956
+ organization: z16.string(),
1957
+ project: z16.string(),
1958
+ environment: z16.enum(["test", "live"]),
1959
+ identity: z16.object({
1960
+ exchange: z16.literal("supported"),
1961
+ activeIntegrations: z16.number().int().nonnegative()
1984
1962
  }).optional(),
1985
- staging: z15.enum(["configured", "blocked"]),
1986
- development: z15.object({
1987
- status: z15.enum(["configured", "blocked"]),
1963
+ staging: z16.enum(["configured", "blocked"]),
1964
+ development: z16.object({
1965
+ status: z16.enum(["configured", "blocked"]),
1988
1966
  // How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
1989
1967
  // local development stack. APIs that predate the field use tunnels.
1990
- transport: z15.enum(["tunnel", "direct"]).default("tunnel"),
1991
- missing: z15.array(z15.string()),
1992
- authentication: z15.array(z15.string())
1968
+ transport: z16.enum(["tunnel", "direct"]).default("tunnel"),
1969
+ missing: z16.array(z16.string()),
1970
+ authentication: z16.array(z16.string())
1993
1971
  }),
1994
- checks: z15.array(
1995
- z15.object({
1996
- id: z15.string(),
1997
- status: z15.enum(["ok", "error"]),
1998
- message: z15.string(),
1999
- missing: z15.array(z15.string()).optional(),
2000
- issues: z15.array(z15.string()).optional()
1972
+ checks: z16.array(
1973
+ z16.object({
1974
+ id: z16.string(),
1975
+ status: z16.enum(["ok", "error"]),
1976
+ message: z16.string(),
1977
+ missing: z16.array(z16.string()).optional(),
1978
+ issues: z16.array(z16.string()).optional()
2001
1979
  })
2002
1980
  )
2003
1981
  });
2004
1982
 
2005
1983
  // src/server/hosted.ts
2006
- import * as z16 from "zod";
1984
+ import * as z17 from "zod";
2007
1985
  var hostedKeyPermissions = ["read", "points", "ingest"];
2008
- var hostedKeyPermissionList = z16.array(z16.string()).transform(
1986
+ var hostedKeyPermissionList = z17.array(z17.string()).transform(
2009
1987
  (values) => values.filter(
2010
1988
  (value) => hostedKeyPermissions.includes(value)
2011
1989
  )
@@ -2017,17 +1995,17 @@ var hostedManagementBindings = [
2017
1995
  "DOMINO_PROJECT",
2018
1996
  "DOMINO_ENVIRONMENT"
2019
1997
  ];
2020
- var hostedKeySecretSchema = z16.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
2021
- var hostedKeySchema = z16.object({
2022
- id: z16.string().uuid(),
1998
+ var hostedKeySecretSchema = z17.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
1999
+ var hostedKeySchema = z17.object({
2000
+ id: z17.string().uuid(),
2023
2001
  token: hostedKeySecretSchema,
2024
2002
  organization: identifier,
2025
2003
  project: identifier,
2026
- environment: z16.enum(["test", "live"]),
2004
+ environment: z17.enum(["test", "live"]),
2027
2005
  permissions: hostedKeyPermissionList,
2028
- expiresAt: z16.number().nullable()
2006
+ expiresAt: z17.number().nullable()
2029
2007
  }).strict();
2030
- var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z16.string().url() }).strict();
2008
+ var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z17.string().url() }).strict();
2031
2009
  function hostedManagementClient(env) {
2032
2010
  const missing = hostedManagementBindings.filter((name) => !env[name]);
2033
2011
  if (missing.length) {
@@ -2035,7 +2013,7 @@ function hostedManagementClient(env) {
2035
2013
  `Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
2036
2014
  );
2037
2015
  }
2038
- const environment = z16.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
2016
+ const environment = z17.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
2039
2017
  const token = env.DOMINO_MANAGEMENT_KEY;
2040
2018
  return createManagementClient({
2041
2019
  baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
@@ -2047,9 +2025,9 @@ function hostedManagementClient(env) {
2047
2025
  }
2048
2026
 
2049
2027
  // src/server/index.ts
2050
- var environmentSchema = z17.enum(["test", "live"]);
2051
- var roleSchema = z17.enum(["editor", "reviewer", "staff"]);
2052
- var permissionSchema = z17.enum([
2028
+ var environmentSchema = z18.enum(["test", "live"]);
2029
+ var roleSchema = z18.enum(["editor", "reviewer", "staff"]);
2030
+ var permissionSchema = z18.enum([
2053
2031
  "read",
2054
2032
  "publish",
2055
2033
  "review",
@@ -2069,7 +2047,7 @@ var permissionSchema = z17.enum([
2069
2047
  */
2070
2048
  "enroll"
2071
2049
  ]);
2072
- var permissionListSchema = z17.array(z17.string()).transform(
2050
+ var permissionListSchema = z18.array(z18.string()).transform(
2073
2051
  (values) => values.filter(
2074
2052
  (value) => permissionSchema.safeParse(value).success
2075
2053
  )
@@ -2079,38 +2057,38 @@ var rolePermissions = {
2079
2057
  reviewer: ["read", "review"],
2080
2058
  staff: ["read", "confirm", "handover"]
2081
2059
  };
2082
- var projectSetupSchema = z17.object({
2083
- mode: z17.enum(["new", "existing"]),
2084
- brief: z17.string().trim().min(1).max(4e3)
2060
+ var projectSetupSchema = z18.object({
2061
+ mode: z18.enum(["new", "existing"]),
2062
+ brief: z18.string().trim().min(1).max(4e3)
2085
2063
  }).strict();
2086
- var operatorUserSchema = z17.object({
2087
- id: z17.string(),
2088
- name: z17.string().nullable(),
2089
- email: z17.string().nullable(),
2090
- avatar: z17.string().nullable()
2064
+ var operatorUserSchema = z18.object({
2065
+ id: z18.string(),
2066
+ name: z18.string().nullable(),
2067
+ email: z18.string().nullable(),
2068
+ avatar: z18.string().nullable()
2091
2069
  });
2092
- var projectSchema = z17.object({
2070
+ var projectSchema = z18.object({
2093
2071
  /**
2094
2072
  * Names the project's hosted addresses. The server gives a new project, and accepts in a
2095
2073
  * slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
2096
2074
  * checks only the format, so it parses every slug that exists.
2097
2075
  */
2098
- slug: z17.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
2099
- createdBy: z17.string().nullable().optional(),
2076
+ slug: z18.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
2077
+ createdBy: z18.string().nullable().optional(),
2100
2078
  creator: operatorUserSchema.nullable().optional(),
2101
2079
  /** A response, so fields a newer server adds to the setup are dropped, not rejected. */
2102
- setup: z17.object(projectSetupSchema.shape).optional(),
2080
+ setup: z18.object(projectSetupSchema.shape).optional(),
2103
2081
  /** The starter chosen at setup. A plain string, so later starters still parse. */
2104
- starter: z17.string().optional(),
2105
- id: z17.string().min(1),
2082
+ starter: z18.string().optional(),
2083
+ id: z18.string().min(1),
2106
2084
  organization: identifier,
2107
2085
  project: identifier,
2108
- name: z17.string(),
2109
- subtitle: z17.string(),
2110
- initials: z17.string(),
2111
- color: z17.string(),
2086
+ name: z18.string(),
2087
+ subtitle: z18.string(),
2088
+ initials: z18.string(),
2089
+ color: z18.string(),
2112
2090
  permissions: permissionListSchema,
2113
- environments: z17.array(environmentSchema)
2091
+ environments: z18.array(environmentSchema)
2114
2092
  }).refine(
2115
2093
  (project) => !project.creator || project.creator.id === project.createdBy,
2116
2094
  {
@@ -2118,45 +2096,45 @@ var projectSchema = z17.object({
2118
2096
  path: ["creator"]
2119
2097
  }
2120
2098
  );
2121
- var projectInputSchema = z17.object({
2099
+ var projectInputSchema = z18.object({
2122
2100
  actionId: identifier,
2123
- name: z17.string().trim().min(1).max(80),
2101
+ name: z18.string().trim().min(1).max(80),
2124
2102
  setup: projectSetupSchema.optional(),
2125
2103
  /** The starter a new hosted app begins from, with `setup.mode` "new". */
2126
2104
  starter: starterIdSchema.optional()
2127
2105
  }).strict();
2128
- var projectUpdateInputSchema = z17.union([
2129
- z17.object({ name: projectInputSchema.shape.name }).strict(),
2130
- z17.object({
2106
+ var projectUpdateInputSchema = z18.union([
2107
+ z18.object({ name: projectInputSchema.shape.name }).strict(),
2108
+ z18.object({
2131
2109
  slug: projectSchema.shape.slug,
2132
- confirm: z17.string().min(1).max(80)
2110
+ confirm: z18.string().min(1).max(80)
2133
2111
  }).strict()
2134
2112
  ]);
2135
- var projectDeletionInputSchema = z17.object({ confirm: z17.string().min(1).max(80) }).strict();
2136
- var projectDeletionSchema = z17.object({
2113
+ var projectDeletionInputSchema = z18.object({ confirm: z18.string().min(1).max(80) }).strict();
2114
+ var projectDeletionSchema = z18.object({
2137
2115
  project: identifier,
2138
- purgeAfter: z17.number().int()
2116
+ purgeAfter: z18.number().int()
2139
2117
  });
2140
- var projectTransferInputSchema = z17.object({ organization: identifier, confirm: z17.string().min(1).max(80) }).strict();
2141
- var projectTransferSchema = z17.object({
2118
+ var projectTransferInputSchema = z18.object({ organization: identifier, confirm: z18.string().min(1).max(80) }).strict();
2119
+ var projectTransferSchema = z18.object({
2142
2120
  organization: identifier,
2143
2121
  project: identifier
2144
2122
  });
2145
- var grantSchema = z17.object({
2146
- subject: z17.string().min(1).max(200),
2147
- roles: z17.array(roleSchema),
2148
- environments: z17.array(environmentSchema)
2123
+ var grantSchema = z18.object({
2124
+ subject: z18.string().min(1).max(200),
2125
+ roles: z18.array(roleSchema),
2126
+ environments: z18.array(environmentSchema)
2149
2127
  }).strict();
2150
- var grantRecordSchema = z17.object(grantSchema.shape);
2151
- var stockAdditionSchema = z17.object({
2128
+ var grantRecordSchema = z18.object(grantSchema.shape);
2129
+ var stockAdditionSchema = z18.object({
2152
2130
  item: identifier,
2153
- quantity: z17.number().int(),
2131
+ quantity: z18.number().int(),
2154
2132
  actionId: identifier
2155
2133
  });
2156
- var completionRevokeSchema = z17.object({
2134
+ var completionRevokeSchema = z18.object({
2157
2135
  actionId: identifier,
2158
- reason: z17.string().trim().min(1).max(500),
2159
- freeOccurrence: z17.boolean().default(false)
2136
+ reason: z18.string().trim().min(1).max(500),
2137
+ freeOccurrence: z18.boolean().default(false)
2160
2138
  }).strict();
2161
2139
  var RevokedEntitlementOutcome = {
2162
2140
  /** No other completion grants the reward: it is void, after cancelling a handover in progress. */
@@ -2184,227 +2162,238 @@ var RevokedReferralOutcome = {
2184
2162
  /** Qualified on another accepted completion of the program's quest instead. */
2185
2163
  Requalified: "requalified"
2186
2164
  };
2187
- var entitlementOutcomeSchema = z17.string().min(1).max(64);
2188
- var deliveryOutcomeSchema = z17.string().min(1).max(64);
2189
- var referralOutcomeSchema = z17.string().min(1).max(64);
2190
- var completionRevocationSchema = z17.object({
2165
+ var entitlementOutcomeSchema = z18.string().min(1).max(64);
2166
+ var deliveryOutcomeSchema = z18.string().min(1).max(64);
2167
+ var referralOutcomeSchema = z18.string().min(1).max(64);
2168
+ var completionRevocationSchema = z18.object({
2191
2169
  completion: identifier,
2192
2170
  /** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
2193
2171
  quest: identifier,
2194
2172
  member: identifier,
2195
2173
  /** What paid the revoked completion. `source.id` repeats `quest`. */
2196
2174
  source: completionSourceSchema.optional(),
2197
- revokedAt: z17.number(),
2198
- occurrenceFreed: z17.boolean(),
2199
- badges: z17.array(z17.object({ badge: identifier, stillAwarded: z17.boolean() })).optional(),
2200
- groups: z17.array(z17.object({ group: identifier, stillMember: z17.boolean() })).optional(),
2201
- points: z17.array(
2202
- z17.object({
2175
+ revokedAt: z18.number(),
2176
+ occurrenceFreed: z18.boolean(),
2177
+ badges: z18.array(z18.object({ badge: identifier, stillAwarded: z18.boolean() })).optional(),
2178
+ groups: z18.array(z18.object({ group: identifier, stillMember: z18.boolean() })).optional(),
2179
+ points: z18.array(
2180
+ z18.object({
2203
2181
  entry: identifier,
2204
2182
  balance: identifier,
2205
2183
  reversal: identifier.nullable(),
2206
- reversed: z17.number().int(),
2207
- unreversed: z17.number().int()
2184
+ reversed: z18.number().int(),
2185
+ unreversed: z18.number().int()
2208
2186
  })
2209
2187
  ),
2210
- entitlements: z17.array(
2211
- z17.object({
2188
+ entitlements: z18.array(
2189
+ z18.object({
2212
2190
  entitlement: identifier,
2213
2191
  reward: identifier,
2214
2192
  outcome: entitlementOutcomeSchema,
2215
- status: z17.string()
2193
+ status: z18.string()
2216
2194
  })
2217
2195
  ),
2218
- deliveries: z17.array(
2219
- z17.object({
2220
- delivery: z17.string(),
2221
- roleId: z17.string(),
2196
+ deliveries: z18.array(
2197
+ z18.object({
2198
+ delivery: z18.string(),
2199
+ roleId: z18.string(),
2222
2200
  outcome: deliveryOutcomeSchema,
2223
2201
  /**
2224
2202
  * By Relay's records, another accepted, unrevoked completion of the member also granted this
2225
2203
  * role to the same Discord account and server. Relay does not read Discord's membership.
2226
2204
  */
2227
- stillGranted: z17.boolean()
2205
+ stillGranted: z18.boolean()
2228
2206
  })
2229
2207
  ),
2230
- referrals: z17.array(
2231
- z17.object({
2208
+ referrals: z18.array(
2209
+ z18.object({
2232
2210
  program: identifier,
2233
2211
  outcome: referralOutcomeSchema
2234
2212
  })
2235
2213
  ),
2236
- streakMilestone: z17.boolean()
2237
- });
2238
- var accessSchema = z17.object({
2239
- actor: z17.string(),
2240
- organization: z17.string(),
2241
- admin: z17.boolean(),
2242
- local: z17.boolean(),
2243
- projects: z17.array(projectSchema)
2244
- });
2245
- var querySchema = z17.object({
2246
- q: z17.string().max(200).default(""),
2247
- filter: z17.string().max(50).default("all"),
2248
- offset: z17.coerce.number().int().min(0).max(1e6).default(0),
2249
- limit: z17.coerce.number().int().min(1).max(100).default(25)
2250
- });
2251
- var accountProfileSchema = z17.object({
2252
- name: z17.string().optional(),
2214
+ streakMilestone: z18.boolean()
2215
+ });
2216
+ var accessSchema = z18.object({
2217
+ actor: z18.string(),
2218
+ organization: z18.string(),
2219
+ admin: z18.boolean(),
2220
+ local: z18.boolean(),
2221
+ projects: z18.array(projectSchema)
2222
+ });
2223
+ var querySchema = z18.object({
2224
+ q: z18.string().max(200).default(""),
2225
+ filter: z18.string().max(50).default("all"),
2226
+ offset: z18.coerce.number().int().min(0).max(1e6).default(0),
2227
+ limit: z18.coerce.number().int().min(1).max(100).default(25)
2228
+ });
2229
+ var accountProfileSchema = z18.object({
2230
+ name: z18.string().optional(),
2253
2231
  /** The account's handle, where the provider has one (X and Discord). */
2254
- username: z17.string().optional(),
2255
- email: z17.string().optional(),
2256
- emailVerified: z17.boolean().default(false),
2257
- imageUrl: z17.string().url().optional()
2232
+ username: z18.string().optional(),
2233
+ email: z18.string().optional(),
2234
+ emailVerified: z18.boolean().default(false),
2235
+ imageUrl: z18.string().url().optional()
2258
2236
  });
2259
- var memberAccountSchema = z17.object({
2237
+ var memberAccountSchema = z18.object({
2260
2238
  /** `wallet` for wallet sign-in, `account` for every other connected account. */
2261
- kind: z17.enum(["account", "wallet"]),
2262
- provider: z17.string(),
2263
- subject: z17.string(),
2264
- signInEnabled: z17.boolean(),
2265
- profile: accountProfileSchema.optional()
2266
- });
2267
- var operationSchema = z17.object({
2268
- target: z17.string(),
2269
- paused: z17.boolean(),
2270
- revision: z17.number().int(),
2271
- reason: z17.string(),
2272
- actor: z17.string().nullable(),
2273
- changedAt: z17.number()
2274
- });
2275
- var operationInputSchema = z17.object({
2276
- target: z17.union([
2277
- z17.literal("redemptions"),
2278
- z17.string().regex(/^quest:[\w-]+$/)
2239
+ kind: z18.enum(["account", "wallet"]),
2240
+ provider: z18.string(),
2241
+ subject: z18.string(),
2242
+ signInEnabled: z18.boolean(),
2243
+ profile: accountProfileSchema.optional(),
2244
+ /**
2245
+ * Present only for accounts Relay reads in the background with the member's own tokens:
2246
+ * `needs-reconnect` once those tokens stopped working, until the member links the account again.
2247
+ */
2248
+ status: z18.enum(["connected", "needs-reconnect"]).optional(),
2249
+ /**
2250
+ * Why the account needs reconnecting: the member or the provider revoked access (`revoked`),
2251
+ * the tokens expired and cannot be refreshed (`expired`), or a source needs a permission the
2252
+ * member did not grant (`missing-scope`).
2253
+ */
2254
+ reason: z18.enum(["revoked", "expired", "missing-scope"]).optional()
2255
+ });
2256
+ var operationSchema = z18.object({
2257
+ target: z18.string(),
2258
+ paused: z18.boolean(),
2259
+ revision: z18.number().int(),
2260
+ reason: z18.string(),
2261
+ actor: z18.string().nullable(),
2262
+ changedAt: z18.number()
2263
+ });
2264
+ var operationInputSchema = z18.object({
2265
+ target: z18.union([
2266
+ z18.literal("redemptions"),
2267
+ z18.string().regex(/^quest:[\w-]+$/)
2279
2268
  ]),
2280
- paused: z17.boolean(),
2281
- revision: z17.number().int().nonnegative(),
2282
- reason: z17.string().trim().min(1).max(500),
2269
+ paused: z18.boolean(),
2270
+ revision: z18.number().int().nonnegative(),
2271
+ reason: z18.string().trim().min(1).max(500),
2283
2272
  actionId: identifier
2284
2273
  }).strict();
2285
- var questLifecycleInputSchema = z17.object({
2274
+ var questLifecycleInputSchema = z18.object({
2286
2275
  quest: identifier,
2287
2276
  expectedRelease: identifier.optional(),
2288
- archived: z17.boolean(),
2289
- reason: z17.string().trim().min(1).max(500),
2277
+ archived: z18.boolean(),
2278
+ reason: z18.string().trim().min(1).max(500),
2290
2279
  actionId: identifier
2291
2280
  }).strict();
2292
- var questLifecycleSchema = z17.object({
2281
+ var questLifecycleSchema = z18.object({
2293
2282
  quest: identifier,
2294
2283
  key: identifier.nullable(),
2295
- title: z17.string(),
2284
+ title: z18.string(),
2296
2285
  release: identifier,
2297
- lifecycle: z17.enum(["active", "paused", "archived"]),
2298
- changed: z17.boolean()
2299
- });
2300
- var memberSchema = z17.object({
2301
- id: z17.string(),
2302
- test: z17.boolean().optional(),
2303
- name: z17.string().nullable().optional(),
2304
- accounts: z17.array(memberAccountSchema).default([]),
2305
- attempts: z17.number(),
2306
- completions: z17.number(),
2307
- rewards: z17.number(),
2308
- lastActivity: z17.number().nullable()
2309
- });
2310
- var personSchema = z17.object({
2311
- id: z17.string(),
2312
- test: z17.boolean().optional(),
2313
- name: z17.string().nullable().optional(),
2314
- accounts: z17.array(memberAccountSchema).default([])
2315
- });
2316
- var metricsSchema = z17.object({
2317
- quests: z17.number(),
2318
- members: z17.number(),
2319
- attempts: z17.number(),
2320
- completions: z17.number(),
2321
- review: z17.number(),
2322
- failed: z17.number(),
2323
- entitlements: z17.number()
2324
- });
2325
- var readinessSchema = z17.object({
2326
- checks: z17.array(
2327
- z17.object({
2328
- id: z17.string(),
2329
- status: z17.enum(["ready", "blocked"]),
2330
- title: z17.string(),
2331
- detail: z17.string()
2286
+ lifecycle: z18.enum(["active", "paused", "archived"]),
2287
+ changed: z18.boolean()
2288
+ });
2289
+ var memberSchema = z18.object({
2290
+ id: z18.string(),
2291
+ test: z18.boolean().optional(),
2292
+ name: z18.string().nullable().optional(),
2293
+ accounts: z18.array(memberAccountSchema).default([]),
2294
+ attempts: z18.number(),
2295
+ completions: z18.number(),
2296
+ rewards: z18.number(),
2297
+ lastActivity: z18.number().nullable()
2298
+ });
2299
+ var personSchema = z18.object({
2300
+ id: z18.string(),
2301
+ test: z18.boolean().optional(),
2302
+ name: z18.string().nullable().optional(),
2303
+ accounts: z18.array(memberAccountSchema).default([])
2304
+ });
2305
+ var metricsSchema = z18.object({
2306
+ quests: z18.number(),
2307
+ members: z18.number(),
2308
+ attempts: z18.number(),
2309
+ completions: z18.number(),
2310
+ review: z18.number(),
2311
+ failed: z18.number(),
2312
+ entitlements: z18.number()
2313
+ });
2314
+ var readinessSchema = z18.object({
2315
+ checks: z18.array(
2316
+ z18.object({
2317
+ id: z18.string(),
2318
+ status: z18.enum(["ready", "blocked"]),
2319
+ title: z18.string(),
2320
+ detail: z18.string()
2332
2321
  })
2333
2322
  )
2334
2323
  });
2335
- var inventorySchema = z17.object({
2336
- item: z17.string(),
2337
- name: z17.string().nullable().default(null),
2338
- available: z17.number(),
2339
- reserved: z17.number(),
2340
- allocated: z17.number().default(0)
2341
- });
2342
- var auditRecordSchema = z17.object({
2343
- id: z17.string(),
2344
- action: z17.string(),
2345
- actor: z17.string().nullable(),
2324
+ var inventorySchema = z18.object({
2325
+ item: z18.string(),
2326
+ name: z18.string().nullable().default(null),
2327
+ available: z18.number(),
2328
+ reserved: z18.number(),
2329
+ allocated: z18.number().default(0)
2330
+ });
2331
+ var auditRecordSchema = z18.object({
2332
+ id: z18.string(),
2333
+ action: z18.string(),
2334
+ actor: z18.string().nullable(),
2346
2335
  user: operatorUserSchema.nullable().optional(),
2347
- detail: z17.string(),
2348
- at: z17.number(),
2349
- attempt: z17.string().nullable()
2336
+ detail: z18.string(),
2337
+ at: z18.number(),
2338
+ attempt: z18.string().nullable()
2350
2339
  }).refine((record6) => !record6.user || record6.user.id === record6.actor, {
2351
2340
  message: "User profile must match the recorded actor",
2352
2341
  path: ["user"]
2353
2342
  });
2354
- var pageSchema = z17.object({
2343
+ var pageSchema = z18.object({
2355
2344
  snapshot: snapshotSchema,
2356
- members: z17.array(memberSchema),
2357
- people: z17.array(personSchema).default([]),
2345
+ members: z18.array(memberSchema),
2346
+ people: z18.array(personSchema).default([]),
2358
2347
  metrics: metricsSchema,
2359
- total: z17.number(),
2360
- offset: z17.number(),
2361
- limit: z17.number(),
2362
- inventory: z17.array(inventorySchema),
2363
- operations: z17.array(operationSchema).default([]),
2364
- audit: z17.array(auditRecordSchema).default([]),
2365
- questCounts: z17.record(z17.string(), z17.number())
2366
- });
2367
- var managedOAuthAccountBaseSchema = z17.object({
2368
- provider: z17.enum(["x", "discord"]),
2369
- revision: z17.number().int().nonnegative()
2370
- });
2371
- var managedOAuthAccountSchema = z17.discriminatedUnion("status", [
2348
+ total: z18.number(),
2349
+ offset: z18.number(),
2350
+ limit: z18.number(),
2351
+ inventory: z18.array(inventorySchema),
2352
+ operations: z18.array(operationSchema).default([]),
2353
+ audit: z18.array(auditRecordSchema).default([]),
2354
+ questCounts: z18.record(z18.string(), z18.number())
2355
+ });
2356
+ var managedOAuthAccountBaseSchema = z18.object({
2357
+ provider: z18.enum(["x", "discord"]),
2358
+ revision: z18.number().int().nonnegative()
2359
+ });
2360
+ var managedOAuthAccountSchema = z18.discriminatedUnion("status", [
2372
2361
  managedOAuthAccountBaseSchema.extend({
2373
- status: z17.literal("connected"),
2374
- subject: z17.string().min(1),
2375
- linkedAt: z17.number(),
2362
+ status: z18.literal("connected"),
2363
+ subject: z18.string().min(1),
2364
+ linkedAt: z18.number(),
2376
2365
  /**
2377
2366
  * True when a member import attached the account with the organization's word for it, not the
2378
2367
  * member's proof. Absent from Relay versions without imports.
2379
2368
  */
2380
- imported: z17.boolean().optional(),
2369
+ imported: z18.boolean().optional(),
2381
2370
  /**
2382
2371
  * True for a real account an operator linked to a test member without OAuth
2383
2372
  * (`testMembers.linkAccount`). Absent from Relay versions without it.
2384
2373
  */
2385
- testLinked: z17.boolean().optional()
2374
+ testLinked: z18.boolean().optional()
2386
2375
  }),
2387
- managedOAuthAccountBaseSchema.extend({ status: z17.literal("disconnected") })
2376
+ managedOAuthAccountBaseSchema.extend({ status: z18.literal("disconnected") })
2388
2377
  ]);
2389
2378
  var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
2390
- provider: z17.literal("telegram")
2379
+ provider: z18.literal("telegram")
2391
2380
  });
2392
- var managedTelegramAccountSchema = z17.discriminatedUnion("status", [
2381
+ var managedTelegramAccountSchema = z18.discriminatedUnion("status", [
2393
2382
  managedTelegramAccountBaseSchema.extend({
2394
- status: z17.literal("connected"),
2383
+ status: z18.literal("connected"),
2395
2384
  /** The numeric Telegram user ID. */
2396
- subject: z17.string().min(1),
2397
- linkedAt: z17.number()
2385
+ subject: z18.string().min(1),
2386
+ linkedAt: z18.number()
2398
2387
  }),
2399
2388
  managedTelegramAccountBaseSchema.extend({
2400
- status: z17.literal("disconnected")
2389
+ status: z18.literal("disconnected")
2401
2390
  })
2402
2391
  ]);
2403
- var memberOAuthUnlinkInputSchema = z17.object({
2404
- provider: z17.enum(["x", "discord"]),
2405
- subject: z17.string().min(1).max(4096),
2406
- revision: z17.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
2407
- reason: z17.string().trim().min(1).max(500)
2392
+ var memberOAuthUnlinkInputSchema = z18.object({
2393
+ provider: z18.enum(["x", "discord"]),
2394
+ subject: z18.string().min(1).max(4096),
2395
+ revision: z18.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
2396
+ reason: z18.string().trim().min(1).max(500)
2408
2397
  }).strict();
2409
2398
  var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
2410
2399
  var managedWalletSchema = linkedWalletSchema.extend({
@@ -2412,32 +2401,32 @@ var managedWalletSchema = linkedWalletSchema.extend({
2412
2401
  * True when a member import attached the wallet with the organization's word for it, and the
2413
2402
  * member has not proved it since. Absent from Relay versions without imports.
2414
2403
  */
2415
- imported: z17.boolean().optional(),
2416
- status: z17.enum(["linked", "unlinked"]),
2417
- unlinkedAt: z17.number().int().nullable(),
2404
+ imported: z18.boolean().optional(),
2405
+ status: z18.enum(["linked", "unlinked"]),
2406
+ unlinkedAt: z18.number().int().nullable(),
2418
2407
  /** "member", or the operator or key that unlinked it. */
2419
- unlinkedBy: z17.string().nullable()
2408
+ unlinkedBy: z18.string().nullable()
2420
2409
  });
2421
2410
  var managedMemberIdentitySchema = memberIdentitySchema.extend({
2422
2411
  /**
2423
2412
  * True for an X account a member import attached, until the member links or signs in with it
2424
2413
  * through X. Absent from Relay versions without imports.
2425
2414
  */
2426
- imported: z17.boolean().optional(),
2415
+ imported: z18.boolean().optional(),
2427
2416
  /**
2428
2417
  * True for a real X or Discord account an operator linked to a test member without OAuth
2429
2418
  * (`testMembers.linkAccount`). Absent from Relay versions without it.
2430
2419
  */
2431
- testLinked: z17.boolean().optional(),
2432
- status: z17.enum(["linked", "unlinked"]),
2433
- unlinkedAt: z17.number().int().nullable(),
2420
+ testLinked: z18.boolean().optional(),
2421
+ status: z18.enum(["linked", "unlinked"]),
2422
+ unlinkedAt: z18.number().int().nullable(),
2434
2423
  /** The operator or key that unlinked it. */
2435
- unlinkedBy: z17.string().nullable()
2424
+ unlinkedBy: z18.string().nullable()
2436
2425
  });
2437
- var memberIdentityChangeInputSchema = z17.object({
2426
+ var memberIdentityChangeInputSchema = z18.object({
2438
2427
  kind: appIdentityKindSchema,
2439
- subject: z17.string().min(1).max(256),
2440
- reason: z17.string().trim().min(1).max(500)
2428
+ subject: z18.string().min(1).max(256),
2429
+ reason: z18.string().trim().min(1).max(500)
2441
2430
  }).strict();
2442
2431
  var balanceCheckSchema = walletBalanceSchema.pick({
2443
2432
  chain: true,
@@ -2447,76 +2436,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
2447
2436
  wallets: true,
2448
2437
  observedAt: true
2449
2438
  }).extend({ attempt: identifier });
2450
- var walletBalanceChainsSchema = z17.object({
2451
- chains: z17.array(
2452
- z17.object({
2453
- chain: z17.union([
2454
- z17.literal(solanaMainnet),
2439
+ var walletBalanceChainsSchema = z18.object({
2440
+ chains: z18.array(
2441
+ z18.object({
2442
+ chain: z18.union([
2443
+ z18.literal(solanaMainnet),
2455
2444
  cosmosNetworkSchema,
2456
2445
  evmChainIdSchema
2457
2446
  ]),
2458
- name: z17.string(),
2459
- testnet: z17.boolean()
2447
+ name: z18.string(),
2448
+ testnet: z18.boolean()
2460
2449
  })
2461
2450
  )
2462
2451
  });
2463
- var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z17.string().trim().min(1).max(500) }).strict();
2452
+ var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z18.string().trim().min(1).max(500) }).strict();
2464
2453
  var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
2465
- enabled: z17.boolean(),
2466
- reason: z17.string().trim().min(1).max(500)
2454
+ enabled: z18.boolean(),
2455
+ reason: z18.string().trim().min(1).max(500)
2467
2456
  }).strict();
2468
- var telegramBotIdSchema = z17.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
2469
- var participantSignInSchema = z17.object({
2470
- providers: z17.array(
2471
- z17.object({ provider: authProviderSchema, configured: z17.boolean() })
2457
+ var telegramBotIdSchema = z18.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
2458
+ var participantSignInSchema = z18.object({
2459
+ providers: z18.array(
2460
+ z18.object({ provider: authProviderSchema, configured: z18.boolean() })
2472
2461
  ),
2473
- email: z17.boolean(),
2462
+ email: z18.boolean(),
2474
2463
  /** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
2475
2464
  wallets: walletSignInNetworksSchema,
2476
2465
  /** Why participants cannot sign in to this project, or null. */
2477
- issue: z17.string().nullable(),
2466
+ issue: z18.string().nullable(),
2478
2467
  /**
2479
2468
  * Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
2480
2469
  * bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
2481
2470
  * from Relay versions without Telegram.
2482
2471
  */
2483
- telegram: z17.object({
2484
- login: z17.boolean(),
2472
+ telegram: z18.object({
2473
+ login: z18.boolean(),
2485
2474
  miniAppBotId: telegramBotIdSchema.nullable()
2486
2475
  }).optional(),
2487
- updatedAt: z17.number().nullable(),
2488
- updatedBy: z17.string().nullable()
2476
+ updatedAt: z18.number().nullable(),
2477
+ updatedBy: z18.string().nullable()
2489
2478
  });
2490
- var participantSignInInputSchema = z17.object({
2479
+ var participantSignInInputSchema = z18.object({
2491
2480
  wallets: walletSignInNetworksSchema,
2492
- telegram: z17.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
2481
+ telegram: z18.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
2493
2482
  }).strict();
2494
- var completionRevocationShortfallSchema = z17.object({
2483
+ var completionRevocationShortfallSchema = z18.object({
2495
2484
  completion: identifier,
2496
2485
  quest: identifier,
2497
- revokedAt: z17.number().int().nonnegative().safe(),
2498
- unreversedPoints: z17.record(identifier, z17.number().int().positive().safe())
2486
+ revokedAt: z18.number().int().nonnegative().safe(),
2487
+ unreversedPoints: z18.record(identifier, z18.number().int().positive().safe())
2499
2488
  });
2500
- var memberDetailSchema = z17.object({
2489
+ var memberDetailSchema = z18.object({
2501
2490
  snapshot: snapshotSchema,
2502
2491
  member: memberSchema,
2503
2492
  progress: memberProgressSchema,
2504
2493
  /** Up to 25 revoked completions with an unreversed point remainder, newest first. */
2505
- revocationShortfalls: z17.array(completionRevocationShortfallSchema).default([]),
2494
+ revocationShortfalls: z18.array(completionRevocationShortfallSchema).default([]),
2506
2495
  /** Current and historical campaign enrollment state, including inactive enrollments. */
2507
- campaignEnrollments: z17.array(campaignEnrollmentSchema).default([]),
2508
- passes: z17.array(
2509
- z17.object({
2510
- provider: z17.string(),
2511
- event: z17.string(),
2512
- subject: z17.string(),
2496
+ campaignEnrollments: z18.array(campaignEnrollmentSchema).default([]),
2497
+ passes: z18.array(
2498
+ z18.object({
2499
+ provider: z18.string(),
2500
+ event: z18.string(),
2501
+ subject: z18.string(),
2513
2502
  attempt: identifier.nullable()
2514
2503
  })
2515
2504
  ).default([]),
2516
2505
  /** Linked and unlinked wallets. */
2517
- wallets: z17.array(managedWalletSchema),
2506
+ wallets: z18.array(managedWalletSchema),
2518
2507
  /** The member's 10 most recent recorded balance reads, newest first. */
2519
- balanceChecks: z17.array(balanceCheckSchema),
2508
+ balanceChecks: z18.array(balanceCheckSchema),
2520
2509
  /** The member's participant profile in this project. */
2521
2510
  profile: managedProfileSchema.nullable(),
2522
2511
  /**
@@ -2524,11 +2513,11 @@ var memberDetailSchema = z17.object({
2524
2513
  * member ID: their selected X and Discord accounts and their `app:<name>` identities in this
2525
2514
  * project, including app identities an operator unlinked, by kind.
2526
2515
  */
2527
- identities: z17.array(managedMemberIdentitySchema)
2516
+ identities: z18.array(managedMemberIdentitySchema)
2528
2517
  });
2529
- var managedMemberProgressSchema = z17.object({
2518
+ var managedMemberProgressSchema = z18.object({
2530
2519
  member: identifier,
2531
- quests: z17.array(
2520
+ quests: z18.array(
2532
2521
  memberProgressSchema.shape.quests.element.extend({
2533
2522
  /** The streak as `members.get` reports it, without the list of qualifying days. */
2534
2523
  streak: streakProgressSchema.omit({ days: true }).nullable().optional()
@@ -2539,156 +2528,172 @@ var managedMemberProgressSchema = z17.object({
2539
2528
  /** Each point balance the member has, by balance ID. */
2540
2529
  balances: snapshotSchema.shape.balances
2541
2530
  });
2542
- var stockInputSchema = z17.object({
2531
+ var stockInputSchema = z18.object({
2543
2532
  item: identifier,
2544
- quantity: z17.number().int().positive().max(1e6),
2533
+ quantity: z18.number().int().positive().max(1e6),
2545
2534
  actionId: identifier
2546
2535
  }).strict();
2547
- var ingestTrackerScopeSchema = z17.array(identifier).min(1).max(100).nullable();
2548
- var tokenScopeInputSchema = z17.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
2549
- var tokenInputSchema = z17.object({
2550
- name: z17.string().trim().min(1).max(80),
2536
+ var ingestTrackerScopeSchema = z18.array(identifier).min(1).max(100).nullable();
2537
+ var tokenScopeInputSchema = z18.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
2538
+ var tokenInputSchema = z18.object({
2539
+ name: z18.string().trim().min(1).max(80),
2551
2540
  project: identifier,
2552
2541
  environment: environmentSchema,
2553
- permissions: z17.array(permissionSchema).min(1),
2542
+ permissions: z18.array(permissionSchema).min(1),
2554
2543
  ingestTrackers: ingestTrackerScopeSchema.optional(),
2555
- days: z17.number().int().min(1).max(90).default(30)
2544
+ days: z18.number().int().min(1).max(90).default(30)
2556
2545
  }).strict();
2557
- var tokenSchema = z17.object({
2558
- id: z17.string(),
2559
- name: z17.string(),
2560
- project: z17.string(),
2546
+ var tokenSchema = z18.object({
2547
+ id: z18.string(),
2548
+ name: z18.string(),
2549
+ project: z18.string(),
2561
2550
  environment: environmentSchema,
2562
2551
  permissions: permissionListSchema,
2563
2552
  ingestTrackers: ingestTrackerScopeSchema.optional(),
2564
- expiresAt: z17.number()
2553
+ expiresAt: z18.number()
2565
2554
  });
2566
- var issuedTokenSchema = tokenSchema.extend({ token: z17.string() });
2567
- var serviceKeyInputSchema = z17.object({
2568
- name: z17.string().trim().min(1).max(80),
2569
- permissions: z17.array(permissionSchema).min(1).refine(
2555
+ var issuedTokenSchema = tokenSchema.extend({ token: z18.string() });
2556
+ var serviceKeyInputSchema = z18.object({
2557
+ name: z18.string().trim().min(1).max(80),
2558
+ permissions: z18.array(permissionSchema).min(1).refine(
2570
2559
  (permissions) => !permissions.includes("access"),
2571
2560
  "Service keys cannot hold the access permission"
2572
2561
  ),
2573
2562
  /** Days until the first secret expires. Omit it for a key that never expires. */
2574
- expiresInDays: z17.number().int().min(1).max(3650).optional()
2563
+ expiresInDays: z18.number().int().min(1).max(3650).optional()
2575
2564
  }).strict();
2576
- var serviceKeySchema = z17.object({
2577
- id: z17.string().uuid(),
2578
- organization: z17.string(),
2579
- project: z17.string(),
2565
+ var serviceKeySchema = z18.object({
2566
+ id: z18.string().uuid(),
2567
+ organization: z18.string(),
2568
+ project: z18.string(),
2580
2569
  environment: environmentSchema,
2581
- name: z17.string(),
2570
+ name: z18.string(),
2582
2571
  permissions: permissionListSchema,
2583
2572
  /** The Clerk user ID of the administrator who created it. */
2584
- createdBy: z17.string(),
2585
- createdAt: z17.number(),
2573
+ createdBy: z18.string(),
2574
+ createdAt: z18.number(),
2586
2575
  /** The latest use of any of its secrets, revoked ones included; null when none was used. */
2587
- lastUsedAt: z17.number().nullable(),
2576
+ lastUsedAt: z18.number().nullable(),
2588
2577
  /** Its working secrets, oldest first. Any of them authenticates the key. */
2589
- secrets: z17.array(credentialSecretSchema)
2578
+ secrets: z18.array(credentialSecretSchema)
2590
2579
  });
2591
2580
  var issuedServiceKeySchema = serviceKeySchema.extend({
2592
- secret: z17.string().uuid(),
2593
- token: z17.string()
2581
+ secret: z18.string().uuid(),
2582
+ token: z18.string()
2594
2583
  });
2595
- var teamSchema = z17.array(
2596
- z17.object({ id: z17.string(), label: z17.string() })
2584
+ var teamSchema = z18.array(
2585
+ z18.object({ id: z18.string(), label: z18.string() })
2597
2586
  );
2598
- var memberLookupSchema = z17.object({
2599
- provider: z17.string().min(1).max(200),
2600
- subject: z17.string().min(1).max(2048)
2587
+ var memberLookupSchema = z18.object({
2588
+ provider: z18.string().min(1).max(200),
2589
+ subject: z18.string().min(1).max(2048)
2601
2590
  }).strict();
2602
- var booleanQuery = z17.union([
2603
- z17.boolean(),
2604
- z17.enum(["true", "false"]).transform((v) => v === "true")
2591
+ var booleanQuery = z18.union([
2592
+ z18.boolean(),
2593
+ z18.enum(["true", "false"]).transform((v) => v === "true")
2605
2594
  ]);
2606
- var managedMemberQuerySchema = z17.strictObject({
2607
- q: z17.string().max(200).optional(),
2595
+ var managedMemberQuerySchema = z18.strictObject({
2596
+ q: z18.string().max(200).optional(),
2608
2597
  needsReview: booleanQuery.optional(),
2609
- limit: z17.coerce.number().int().min(1).max(100).optional(),
2598
+ limit: z18.coerce.number().int().min(1).max(100).optional(),
2610
2599
  cursor: pageCursorSchema.optional()
2611
2600
  });
2612
- var managedMemberPageSchema = z17.object({
2613
- items: z17.array(memberSchema),
2614
- total: z17.number().int().nonnegative(),
2615
- nextCursor: z17.string().nullable()
2601
+ var managedMemberPageSchema = z18.object({
2602
+ items: z18.array(memberSchema),
2603
+ total: z18.number().int().nonnegative(),
2604
+ nextCursor: z18.string().nullable()
2605
+ });
2606
+ var activeMemberMonthSchema = z18.object({
2607
+ /** `YYYY-MM`, in UTC. */
2608
+ month: z18.string(),
2609
+ activeMembers: z18.number().int().nonnegative()
2610
+ });
2611
+ var activeMemberUsageSchema = activeMemberMonthSchema.extend({
2612
+ plan: z18.string(),
2613
+ limit: z18.number().int().nonnegative().nullable(),
2614
+ history: z18.array(activeMemberMonthSchema)
2615
+ });
2616
+ var realPeopleInTestUsageSchema = z18.object({
2617
+ realPeople: z18.number().int().nonnegative(),
2618
+ plan: z18.string(),
2619
+ limit: z18.number().int().nonnegative(),
2620
+ enforced: z18.boolean()
2616
2621
  });
2617
2622
  var projectMetricsSchema = metricsSchema.extend({
2618
- completionsByQuest: z17.array(
2619
- z17.object({ quest: identifier, completions: z17.number() })
2623
+ completionsByQuest: z18.array(
2624
+ z18.object({ quest: identifier, completions: z18.number() })
2620
2625
  )
2621
2626
  });
2622
- var pageLimit = z17.coerce.number().int().min(1).max(100).optional();
2623
- var managedAttemptQuerySchema = z17.strictObject({
2624
- q: z17.string().max(200).optional(),
2627
+ var pageLimit = z18.coerce.number().int().min(1).max(100).optional();
2628
+ var managedAttemptQuerySchema = z18.strictObject({
2629
+ q: z18.string().max(200).optional(),
2625
2630
  quest: identifier.optional(),
2626
- status: z17.string().min(1).max(50).optional(),
2631
+ status: z18.string().min(1).max(50).optional(),
2627
2632
  limit: pageLimit,
2628
2633
  cursor: pageCursorSchema.optional()
2629
2634
  });
2630
- var managedAttemptPageSchema = z17.object({
2631
- items: z17.array(attemptSchema),
2632
- releases: z17.array(publishedReleaseSchema),
2633
- people: z17.array(personSchema),
2634
- total: z17.number().int().nonnegative(),
2635
- nextCursor: z17.string().nullable()
2635
+ var managedAttemptPageSchema = z18.object({
2636
+ items: z18.array(attemptSchema),
2637
+ releases: z18.array(publishedReleaseSchema),
2638
+ people: z18.array(personSchema),
2639
+ total: z18.number().int().nonnegative(),
2640
+ nextCursor: z18.string().nullable()
2636
2641
  });
2637
- var managedReleaseQuerySchema = z17.strictObject({
2642
+ var managedReleaseQuerySchema = z18.strictObject({
2638
2643
  quest: identifier.optional(),
2639
2644
  limit: pageLimit,
2640
2645
  cursor: pageCursorSchema.optional()
2641
2646
  });
2642
- var managedReleasePageSchema = z17.object({
2643
- items: z17.array(publishedReleaseSchema),
2644
- nextCursor: z17.string().nullable()
2647
+ var managedReleasePageSchema = z18.object({
2648
+ items: z18.array(publishedReleaseSchema),
2649
+ nextCursor: z18.string().nullable()
2645
2650
  });
2646
- var managedAttemptSchema = z17.object({
2651
+ var managedAttemptSchema = z18.object({
2647
2652
  attempt: attemptSchema,
2648
2653
  release: publishedReleaseSchema.nullable(),
2649
- events: z17.array(eventSchema),
2654
+ events: z18.array(eventSchema),
2650
2655
  person: personSchema
2651
2656
  });
2652
- var managedEntitlementQuerySchema = z17.strictObject({
2653
- q: z17.string().max(200).optional(),
2654
- status: z17.string().min(1).max(50).optional(),
2657
+ var managedEntitlementQuerySchema = z18.strictObject({
2658
+ q: z18.string().max(200).optional(),
2659
+ status: z18.string().min(1).max(50).optional(),
2655
2660
  limit: pageLimit,
2656
2661
  cursor: pageCursorSchema.optional()
2657
2662
  });
2658
- var managedEntitlementPageSchema = z17.object({
2659
- items: z17.array(entitlementSchema),
2660
- people: z17.array(personSchema),
2661
- total: z17.number().int().nonnegative(),
2662
- nextCursor: z17.string().nullable()
2663
+ var managedEntitlementPageSchema = z18.object({
2664
+ items: z18.array(entitlementSchema),
2665
+ people: z18.array(personSchema),
2666
+ total: z18.number().int().nonnegative(),
2667
+ nextCursor: z18.string().nullable()
2663
2668
  });
2664
- var managedEntitlementSchema = z17.object({
2669
+ var managedEntitlementSchema = z18.object({
2665
2670
  entitlement: entitlementSchema,
2666
2671
  person: personSchema
2667
2672
  });
2668
2673
  var managedStockItemSchema = inventorySchema.extend({
2669
- offers: z17.array(identifier)
2674
+ offers: z18.array(identifier)
2670
2675
  });
2671
- var auditQuerySchema = z17.strictObject({
2672
- category: z17.enum(["reviews", "rewards", "configuration"]).optional(),
2673
- q: z17.string().max(200).optional(),
2676
+ var auditQuerySchema = z18.strictObject({
2677
+ category: z18.enum(["reviews", "rewards", "configuration"]).optional(),
2678
+ q: z18.string().max(200).optional(),
2674
2679
  limit: pageLimit,
2675
2680
  cursor: pageCursorSchema.optional()
2676
2681
  });
2677
2682
  var auditListQuerySchema = auditQuerySchema.extend({
2678
- category: z17.enum(["reviews", "rewards", "configuration", "test-members"]).optional()
2683
+ category: z18.enum(["reviews", "rewards", "configuration", "test-members"]).optional()
2679
2684
  });
2680
2685
  var accessHistoryQuerySchema = auditQuerySchema.omit({
2681
2686
  category: true
2682
2687
  });
2683
- var auditPageSchema = z17.object({
2684
- items: z17.array(auditRecordSchema),
2685
- total: z17.number().int().nonnegative(),
2686
- nextCursor: z17.string().nullable()
2688
+ var auditPageSchema = z18.object({
2689
+ items: z18.array(auditRecordSchema),
2690
+ total: z18.number().int().nonnegative(),
2691
+ nextCursor: z18.string().nullable()
2687
2692
  });
2688
- var verifiedPassSchema = z17.object({
2693
+ var verifiedPassSchema = z18.object({
2689
2694
  provider: identifier,
2690
2695
  event: identifier,
2691
- subject: z17.string().min(1).max(2048),
2696
+ subject: z18.string().min(1).max(2048),
2692
2697
  member: identifier,
2693
2698
  quest: identifier
2694
2699
  }).strict();
@@ -2705,6 +2710,18 @@ function queryString(values) {
2705
2710
  ).toString();
2706
2711
  return query ? "?" + query : "";
2707
2712
  }
2713
+ function analyticsMetricQueryString(input) {
2714
+ const { filter, ...query } = analyticsMetricQuerySchema.parse(input);
2715
+ return queryString({
2716
+ ...query,
2717
+ ...Object.fromEntries(
2718
+ Object.entries(filter ?? {}).map(([name, keys]) => [
2719
+ `filter.${name}`,
2720
+ [].concat(keys).join(",")
2721
+ ])
2722
+ )
2723
+ });
2724
+ }
2708
2725
  function clientFailure(error) {
2709
2726
  if (error instanceof ManagementError) {
2710
2727
  return error;
@@ -2712,7 +2729,7 @@ function clientFailure(error) {
2712
2729
  return new ManagementError({
2713
2730
  kind: "client",
2714
2731
  code: ManagementErrorCode.InvalidInput,
2715
- message: error instanceof z17.ZodError ? `Invalid management request: ${z17.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
2732
+ message: error instanceof z18.ZodError ? `Invalid management request: ${z18.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
2716
2733
  cause: error
2717
2734
  });
2718
2735
  }
@@ -2750,7 +2767,7 @@ function managementClient(options) {
2750
2767
  call
2751
2768
  );
2752
2769
  }
2753
- const ok = z17.object({ ok: z17.literal(true) });
2770
+ const ok = z18.object({ ok: z18.literal(true) });
2754
2771
  function pointHistory(member, ledger, query = {}, call) {
2755
2772
  return get(
2756
2773
  `/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
@@ -2835,7 +2852,7 @@ function managementClient(options) {
2835
2852
  const input = isInput ? inputOrCall ?? {} : {};
2836
2853
  const options2 = isInput ? call : inputOrCall;
2837
2854
  return post(
2838
- `/webhooks/${z17.string().uuid().parse(id)}/rotate-secret`,
2855
+ `/webhooks/${z18.string().uuid().parse(id)}/rotate-secret`,
2839
2856
  webhookSecretSchema,
2840
2857
  webhookRotateInputSchema.parse(withActionId(input)),
2841
2858
  options2
@@ -2883,8 +2900,8 @@ function managementClient(options) {
2883
2900
  }
2884
2901
  return exchange(
2885
2902
  path,
2886
- z17.object({
2887
- status: z17.number(),
2903
+ z18.object({
2904
+ status: z18.number(),
2888
2905
  operationId: identifier.optional(),
2889
2906
  result: schema
2890
2907
  }),
@@ -2939,7 +2956,7 @@ function managementClient(options) {
2939
2956
  call
2940
2957
  ),
2941
2958
  ...resourceArchiveMethods("tracker"),
2942
- list: (call) => get("/trackers", z17.array(trackerStatusSchema), call),
2959
+ list: (call) => get("/trackers", z18.array(trackerStatusSchema), call),
2943
2960
  get: (reference, call) => get(
2944
2961
  `/trackers/${identifier.parse(reference)}`,
2945
2962
  trackerStatusSchema,
@@ -3055,7 +3072,7 @@ function managementClient(options) {
3055
3072
  engagementPublishSchema.parse(withActionId(input)),
3056
3073
  call
3057
3074
  ),
3058
- list: (call) => get("/engagement", z17.array(engagementRuleSchema), call),
3075
+ list: (call) => get("/engagement", z18.array(engagementRuleSchema), call),
3059
3076
  page: (input, call) => get(
3060
3077
  "/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
3061
3078
  engagementPageSchema,
@@ -3075,7 +3092,7 @@ function managementClient(options) {
3075
3092
  )
3076
3093
  },
3077
3094
  badges: {
3078
- list: (call) => get("/badges", z17.array(managedBadgeSchema), call),
3095
+ list: (call) => get("/badges", z18.array(managedBadgeSchema), call),
3079
3096
  create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
3080
3097
  update: (badge, input, call) => {
3081
3098
  const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
@@ -3118,7 +3135,7 @@ function managementClient(options) {
3118
3135
  },
3119
3136
  pointLedgers: {
3120
3137
  unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
3121
- list: (call) => get("/point-ledgers", z17.array(managedPointLedgerSchema), call),
3138
+ list: (call) => get("/point-ledgers", z18.array(managedPointLedgerSchema), call),
3122
3139
  /**
3123
3140
  * Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
3124
3141
  * live, only a person in Console can create one.
@@ -3148,7 +3165,7 @@ function managementClient(options) {
3148
3165
  },
3149
3166
  points: {
3150
3167
  /** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
3151
- ledgers: (call) => get("/point-ledgers", z17.array(managedPointLedgerSchema), call),
3168
+ ledgers: (call) => get("/point-ledgers", z18.array(managedPointLedgerSchema), call),
3152
3169
  /** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
3153
3170
  createLedger: createPointLedger,
3154
3171
  /**
@@ -3186,7 +3203,7 @@ function managementClient(options) {
3186
3203
  referralHistorySchema,
3187
3204
  call
3188
3205
  ),
3189
- list: (call) => get("/referrals", z17.array(publishedReferralSchema), call),
3206
+ list: (call) => get("/referrals", z18.array(publishedReferralSchema), call),
3190
3207
  participants: referralParticipants,
3191
3208
  /**
3192
3209
  * Suspends or restores a member's referral relationship, with a reason; requires `publish`.
@@ -3249,7 +3266,7 @@ function managementClient(options) {
3249
3266
  },
3250
3267
  leaderboards: {
3251
3268
  ...resourceArchiveMethods("leaderboard"),
3252
- list: (call) => get("/leaderboards", z17.array(publishedLeaderboardSchema), call),
3269
+ list: (call) => get("/leaderboards", z18.array(publishedLeaderboardSchema), call),
3253
3270
  standings: (board, input = {}, call) => {
3254
3271
  const query = leaderboardQuerySchema.parse(input);
3255
3272
  return get(
@@ -3263,13 +3280,13 @@ function managementClient(options) {
3263
3280
  },
3264
3281
  history: (board, call) => get(
3265
3282
  `/leaderboards/${identifier.parse(board)}/history`,
3266
- z17.array(publishedLeaderboardSchema),
3283
+ z18.array(publishedLeaderboardSchema),
3267
3284
  call
3268
3285
  ),
3269
3286
  /** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
3270
3287
  exclusions: (board, call) => get(
3271
3288
  `/leaderboards/${identifier.parse(board)}/exclusions`,
3272
- z17.array(z17.object({ member: identifier })),
3289
+ z18.array(z18.object({ member: identifier })),
3273
3290
  call
3274
3291
  ),
3275
3292
  /**
@@ -3315,7 +3332,7 @@ function managementClient(options) {
3315
3332
  leaderboardGroupSchema.parse(withActionId(input)),
3316
3333
  call
3317
3334
  ),
3318
- /** Pending, approved and rejected snapshots; requires read permission. */
3335
+ /** Closing, pending, approved and rejected snapshots; requires read permission. */
3319
3336
  settlementReviews: (reference, query = {}, call) => get(
3320
3337
  `/leaderboards/${identifier.parse(reference)}/settlement-reviews${queryString(leaderboardSettlementReviewQuerySchema.parse(query))}`,
3321
3338
  leaderboardSettlementReviewPageSchema,
@@ -3326,15 +3343,37 @@ function managementClient(options) {
3326
3343
  leaderboardSettlementReviewSchema,
3327
3344
  call
3328
3345
  ),
3346
+ /**
3347
+ * A settlement as a payout list: each frozen row's pool share, in base units and formatted,
3348
+ * with the member's verified linked wallets. Requires read permission.
3349
+ */
3350
+ settlementExport: (settlement, call) => get(
3351
+ `/leaderboard-settlements/${identifier.parse(settlement)}/export`,
3352
+ leaderboardSettlementExportSchema,
3353
+ call
3354
+ ),
3329
3355
  rejectSettlement: (settlement, input, call) => post(
3330
3356
  `/leaderboard-settlements/${identifier.parse(settlement)}/reject`,
3331
3357
  leaderboardSettlementReviewSchema,
3332
3358
  leaderboardSettlementRejectionSchema.parse(withActionId(input)),
3333
3359
  call
3334
3360
  ),
3361
+ /**
3362
+ * Takes the closing measurement again for the content a settlement froze without it (its
3363
+ * `unmeasured` list), or extends a closing settlement's wait. The settlement returns to
3364
+ * closing and freezes again when the measurement ends. Requires review permission.
3365
+ */
3366
+ retrySettlementMeasurement: (settlement, input = {}, call) => post(
3367
+ `/leaderboard-settlements/${identifier.parse(settlement)}/retry-measurement`,
3368
+ leaderboardSettlementReviewSchema,
3369
+ leaderboardSettlementMeasurementRetrySchema.parse(
3370
+ withActionId(input)
3371
+ ),
3372
+ call
3373
+ ),
3335
3374
  settlements: (board, call) => get(
3336
3375
  `/leaderboards/${identifier.parse(board)}/settlements`,
3337
- z17.array(leaderboardSettlementSummarySchema),
3376
+ z18.array(leaderboardSettlementSummarySchema),
3338
3377
  call
3339
3378
  ),
3340
3379
  settlement: (settlement, call) => get(
@@ -3419,7 +3458,7 @@ function managementClient(options) {
3419
3458
  *
3420
3459
  * @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
3421
3460
  */
3422
- list: (call) => get("/deployments", z17.array(deploymentRecordSchema), call),
3461
+ list: (call) => get("/deployments", z18.array(deploymentRecordSchema), call),
3423
3462
  /**
3424
3463
  * The project environment's deployments, newest first, one page at a time, with the two
3425
3464
  * newest published deployments beside every page. Pass a page's `nextCursor` back as
@@ -3554,6 +3593,63 @@ function managementClient(options) {
3554
3593
  call
3555
3594
  )
3556
3595
  },
3596
+ /**
3597
+ * The project's Stripe subscription, Checkout, plan changes and the organization's customer
3598
+ * portal. Everything but `read` needs an organization administrator, and while billing is
3599
+ * staff-only, Domino staff.
3600
+ */
3601
+ billing: {
3602
+ /** Whether billing is open to the caller, and the project's subscription when it is. */
3603
+ read: (call) => get("/billing", projectBillingSchema, call),
3604
+ /**
3605
+ * A Stripe Checkout page subscribing the project to `plan`, billed every `interval`. A project
3606
+ * with a subscription that still holds its plan is refused with `subscription-exists`.
3607
+ */
3608
+ checkout: (input, call) => post(
3609
+ "/billing/checkout",
3610
+ billingSessionSchema,
3611
+ billingCheckoutInputSchema.parse(input),
3612
+ call
3613
+ ),
3614
+ /**
3615
+ * Moves the project's subscription to `plan`, billed every `interval`: a higher plan or annual
3616
+ * billing now, prorated; a lower plan or monthly billing at the renewal. Refused without a
3617
+ * subscription that holds its plan (`no-subscription`) and while it is set to cancel
3618
+ * (`subscription-canceling`).
3619
+ */
3620
+ changePlan: (input, call) => post(
3621
+ "/billing/plan",
3622
+ billingPlanChangeSchema,
3623
+ billingPlanChangeInputSchema.parse(input),
3624
+ call
3625
+ ),
3626
+ /**
3627
+ * Sets the subscription to end when the period paid for ends; the project keeps its plan
3628
+ * until then. Drops a plan change held for the renewal.
3629
+ */
3630
+ cancel: (call) => post("/billing/cancel", projectBillingSchema, {}, call),
3631
+ /** Takes back a cancellation before the period ends. */
3632
+ resume: (call) => post("/billing/resume", projectBillingSchema, {}, call),
3633
+ /**
3634
+ * A Stripe Checkout page buying `quantity` packs of AI builder credit for the project, on any
3635
+ * plan; the credit is added once the payment is in.
3636
+ */
3637
+ topup: (input, call) => post(
3638
+ "/billing/topup",
3639
+ billingSessionSchema,
3640
+ billingTopupInputSchema.parse(input),
3641
+ call
3642
+ ),
3643
+ /** The Stripe customer portal for the organization's cards, invoices and billing details. */
3644
+ portal: (call) => post("/billing/portal", billingSessionSchema, {}, call)
3645
+ },
3646
+ /** What the project uses against its plan; requires `read` permission. */
3647
+ usage: {
3648
+ /** Live active members this UTC month, the plan's limit, and the previous six months. */
3649
+ activeMembers: (call) => get("/usage/active-members", activeMemberUsageSchema, call),
3650
+ /** Real people in the test environment, against the plan's limit. */
3651
+ realPeopleInTest: (call) => get("/usage/real-people-in-test", realPeopleInTestUsageSchema, call)
3652
+ },
3557
3653
  /** The project's headline counts; requires `read` permission. */
3558
3654
  metrics: {
3559
3655
  read: (call) => get("/metrics", projectMetricsSchema, call)
@@ -3570,6 +3666,74 @@ function managementClient(options) {
3570
3666
  `/analytics${queryString(analyticsQuerySchema.parse(query))}`,
3571
3667
  analyticsReadSchema,
3572
3668
  call
3669
+ ),
3670
+ /**
3671
+ * The closed metric catalog: every metric's ID, definition, breakdowns, filters, allowed
3672
+ * charts and whether it needs a point ledger. Requires `read` permission.
3673
+ */
3674
+ catalog: (call) => get("/analytics/catalog", analyticsCatalogSchema, call),
3675
+ /**
3676
+ * One catalog metric over a range, bucketed like `read`: its value and, with `breakdown`, a
3677
+ * row per quest, offer, program, source or reason, largest first, capped by `limit` (1 to
3678
+ * 100, default 100) with the rest summed into `other`. `filter` narrows to keys
3679
+ * (`{ quest: ["a", "b"], group: "vip" }`), and `ledger` names the point ledger a points
3680
+ * metric reads. A metric, breakdown or filter the catalog doesn't accept is a 422. Requires
3681
+ * `read` permission.
3682
+ */
3683
+ query: (query, call) => get(
3684
+ `/analytics/query${analyticsMetricQueryString(query)}`,
3685
+ analyticsMetricResultSchema,
3686
+ call
3687
+ )
3688
+ },
3689
+ /**
3690
+ * Dashboards defined in project code (`defineDashboard`), each a set of catalog metric
3691
+ * panels. They are deployed in test and promoted to live, and archived rather than deleted.
3692
+ */
3693
+ dashboards: {
3694
+ /**
3695
+ * The project's dashboards by position (those without one last), then title. Archived
3696
+ * dashboards are left out unless `includeArchived`. Requires `read` permission.
3697
+ */
3698
+ list: (query = {}, call) => {
3699
+ dashboardListQuerySchema.parse(query);
3700
+ return get(
3701
+ `/dashboards${queryString(query)}`,
3702
+ dashboardListSchema,
3703
+ call
3704
+ );
3705
+ },
3706
+ /**
3707
+ * One dashboard, archived ones included, with every panel's result over `range` (the
3708
+ * dashboard's `defaultRange` by default) in one response. A panel whose query fails, such as
3709
+ * on a group this environment lacks or a timeout, carries its own coded `error` and the
3710
+ * other panels still have results. Requires `read` permission.
3711
+ */
3712
+ read: (query, call) => {
3713
+ const { key, ...rest } = dashboardReadQuerySchema.parse(query);
3714
+ return get(
3715
+ `/dashboards/${key}${queryString(rest)}`,
3716
+ dashboardReadSchema,
3717
+ call
3718
+ );
3719
+ },
3720
+ /**
3721
+ * Archive a dashboard in test, with a reason the audit log records: it leaves `list` unless
3722
+ * `includeArchived`, stays readable, and stays archived when its code deploys again. Live
3723
+ * gets the change through a promotion. Requires `publish` permission.
3724
+ */
3725
+ archive: (key, input, call) => post(
3726
+ `/dashboards/${identifier.parse(key)}/archive`,
3727
+ dashboardLifecycleResultSchema,
3728
+ resourceArchiveInputSchema.parse(withActionId(input)),
3729
+ call
3730
+ ),
3731
+ /** Restore an archived dashboard in test. Requires `publish` permission. */
3732
+ unarchive: (key, input, call) => post(
3733
+ `/dashboards/${identifier.parse(key)}/unarchive`,
3734
+ dashboardLifecycleResultSchema,
3735
+ resourceArchiveInputSchema.parse(withActionId(input)),
3736
+ call
3573
3737
  )
3574
3738
  },
3575
3739
  /** Release history: every version a quest has been published as. */
@@ -3774,7 +3938,7 @@ function managementClient(options) {
3774
3938
  },
3775
3939
  operations: {
3776
3940
  /** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
3777
- list: (call) => get("/operations", z17.array(operationSchema), call),
3941
+ list: (call) => get("/operations", z18.array(operationSchema), call),
3778
3942
  /**
3779
3943
  * Pauses or resumes redemptions or one quest's participation, against the `revision` the
3780
3944
  * operator saw, with a reason; requires `publish` permission.
@@ -3832,7 +3996,7 @@ function managementClient(options) {
3832
3996
  call
3833
3997
  ),
3834
3998
  /** Every stock item with its counts and the offers that sell it; requires `read` permission. */
3835
- list: (call) => get("/stock-items", z17.array(managedStockItemSchema), call),
3999
+ list: (call) => get("/stock-items", z18.array(managedStockItemSchema), call),
3836
4000
  createItem: (input, call) => create(
3837
4001
  "/stock-items",
3838
4002
  stockItemSchema,
@@ -3847,7 +4011,7 @@ function managementClient(options) {
3847
4011
  stockInputSchema.parse(withActionId(input)),
3848
4012
  call
3849
4013
  ),
3850
- catalog: (call) => get("/pickup-inventory", z17.array(pickupCatalogSchema), call),
4014
+ catalog: (call) => get("/pickup-inventory", z18.array(pickupCatalogSchema), call),
3851
4015
  configure: (input, call) => post(
3852
4016
  "/pickup-inventory",
3853
4017
  pickupCatalogSchema,
@@ -3873,7 +4037,7 @@ function managementClient(options) {
3873
4037
  offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
3874
4038
  call
3875
4039
  ),
3876
- list: (call) => get("/offers", z17.array(offerSchema), call),
4040
+ list: (call) => get("/offers", z18.array(offerSchema), call),
3877
4041
  /**
3878
4042
  * Every redemption, or one member's, newest first, in one unbounded response.
3879
4043
  *
@@ -3881,7 +4045,7 @@ function managementClient(options) {
3881
4045
  */
3882
4046
  redemptions: (input = {}, call) => get(
3883
4047
  `/redemptions${queryString({ member: input.member })}`,
3884
- z17.array(redemptionSchema),
4048
+ z18.array(redemptionSchema),
3885
4049
  call
3886
4050
  ),
3887
4051
  /** Pauses or resumes an offer at the revision the operator saw. */
@@ -3930,7 +4094,7 @@ function managementClient(options) {
3930
4094
  * them; API keys and project-scoped playground sessions cannot.
3931
4095
  */
3932
4096
  tokens: {
3933
- list: (call) => get("/tokens", z17.array(tokenSchema), call),
4097
+ list: (call) => get("/tokens", z18.array(tokenSchema), call),
3934
4098
  /**
3935
4099
  * Issues a key for one project and environment, limited to permissions the caller holds
3936
4100
  * there. The secret `token` is in this response only.
@@ -3938,14 +4102,14 @@ function managementClient(options) {
3938
4102
  create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
3939
4103
  /** Replace a personal key's ingestion restriction without changing its secret. */
3940
4104
  scope: (id, input, call) => request(
3941
- `/tokens/${encodeURIComponent(z17.string().min(1).parse(id))}/scope`,
4105
+ `/tokens/${encodeURIComponent(z18.string().min(1).parse(id))}/scope`,
3942
4106
  tokenSchema,
3943
4107
  tokenScopeInputSchema.parse(input),
3944
4108
  "PUT",
3945
4109
  call
3946
4110
  ),
3947
4111
  revoke: (id, call) => request(
3948
- `/tokens/${encodeURIComponent(z17.string().min(1).parse(id))}`,
4112
+ `/tokens/${encodeURIComponent(z18.string().min(1).parse(id))}`,
3949
4113
  ok,
3950
4114
  void 0,
3951
4115
  "DELETE",
@@ -3957,7 +4121,7 @@ function managementClient(options) {
3957
4121
  * environment, owned by no person. Only an organization administrator in Console manages them.
3958
4122
  */
3959
4123
  serviceKeys: {
3960
- list: (call) => get("/service-keys", z17.array(serviceKeySchema), call),
4124
+ list: (call) => get("/service-keys", z18.array(serviceKeySchema), call),
3961
4125
  /** The secret `token` is in this response only. */
3962
4126
  create: (input, call) => post(
3963
4127
  "/service-keys",
@@ -3970,14 +4134,14 @@ function managementClient(options) {
3970
4134
  * them with `revokeSecret`. The new `token` is in this response only.
3971
4135
  */
3972
4136
  addSecret: (id, input = {}, call) => post(
3973
- `/service-keys/${z17.string().uuid().parse(id)}/secrets`,
4137
+ `/service-keys/${z18.string().uuid().parse(id)}/secrets`,
3974
4138
  issuedServiceKeySchema,
3975
4139
  credentialSecretInputSchema.parse(input),
3976
4140
  call
3977
4141
  ),
3978
4142
  /** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
3979
4143
  revokeSecret: (id, secret, call) => request(
3980
- `/service-keys/${z17.string().uuid().parse(id)}/secrets/${z17.string().uuid().parse(secret)}`,
4144
+ `/service-keys/${z18.string().uuid().parse(id)}/secrets/${z18.string().uuid().parse(secret)}`,
3981
4145
  serviceKeySchema,
3982
4146
  void 0,
3983
4147
  "DELETE",
@@ -3985,8 +4149,8 @@ function managementClient(options) {
3985
4149
  ),
3986
4150
  /** Deletes the key; every secret stops working. */
3987
4151
  revoke: (id, call) => request(
3988
- `/service-keys/${z17.string().uuid().parse(id)}`,
3989
- z17.null(),
4152
+ `/service-keys/${z18.string().uuid().parse(id)}`,
4153
+ z18.null(),
3990
4154
  void 0,
3991
4155
  "DELETE",
3992
4156
  call
@@ -3994,7 +4158,7 @@ function managementClient(options) {
3994
4158
  },
3995
4159
  /** Who holds which roles on the client's project; organization administrators only. */
3996
4160
  grants: {
3997
- list: (call) => get("/grants", z17.array(grantRecordSchema), call),
4161
+ list: (call) => get("/grants", z18.array(grantRecordSchema), call),
3998
4162
  /** Replaces one person's roles and environments on the project. The audit log records it. */
3999
4163
  set: (input, call) => request(
4000
4164
  "/grants",
@@ -4011,7 +4175,7 @@ function managementClient(options) {
4011
4175
  /** Signed activity notifications for one project/environment; writes require publish permission. */
4012
4176
  webhooks: {
4013
4177
  state: (id, call) => get(
4014
- `/webhooks/${z17.string().uuid().parse(id)}/state`,
4178
+ `/webhooks/${z18.string().uuid().parse(id)}/state`,
4015
4179
  webhookEndpointStateSchema,
4016
4180
  call
4017
4181
  ),
@@ -4022,24 +4186,24 @@ function managementClient(options) {
4022
4186
  call
4023
4187
  ),
4024
4188
  delete: (id, input, call) => post(
4025
- `/webhooks/${z17.string().uuid().parse(id)}/delete`,
4189
+ `/webhooks/${z18.string().uuid().parse(id)}/delete`,
4026
4190
  webhookEndpointStateSchema,
4027
4191
  webhookDeleteInputSchema.parse(withActionId(input)),
4028
4192
  call
4029
4193
  ),
4030
4194
  pause: (id, input = {}, call) => post(
4031
- `/webhooks/${z17.string().uuid().parse(id)}/pause`,
4195
+ `/webhooks/${z18.string().uuid().parse(id)}/pause`,
4032
4196
  webhookEndpointSchema,
4033
4197
  webhookControlInputSchema.parse(withActionId(input)),
4034
4198
  call
4035
4199
  ),
4036
4200
  resume: (id, input = {}, call) => post(
4037
- `/webhooks/${z17.string().uuid().parse(id)}/resume`,
4201
+ `/webhooks/${z18.string().uuid().parse(id)}/resume`,
4038
4202
  webhookEndpointSchema,
4039
4203
  webhookControlInputSchema.parse(withActionId(input)),
4040
4204
  call
4041
4205
  ),
4042
- list: (call) => get("/webhooks", z17.array(webhookEndpointSchema), call),
4206
+ list: (call) => get("/webhooks", z18.array(webhookEndpointSchema), call),
4043
4207
  /** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
4044
4208
  create: (input, call) => post(
4045
4209
  "/webhooks",
@@ -4048,7 +4212,7 @@ function managementClient(options) {
4048
4212
  call
4049
4213
  ),
4050
4214
  update: (id, input, call) => request(
4051
- `/webhooks/${z17.string().uuid().parse(id)}`,
4215
+ `/webhooks/${z18.string().uuid().parse(id)}`,
4052
4216
  webhookEndpointSchema,
4053
4217
  webhookUpdateSchema.parse(input),
4054
4218
  "PUT",
@@ -4056,19 +4220,19 @@ function managementClient(options) {
4056
4220
  ),
4057
4221
  /** @deprecated Use pause. Removed in 2.0.0. */
4058
4222
  disable: (id, call) => post(
4059
- `/webhooks/${z17.string().uuid().parse(id)}/disable`,
4223
+ `/webhooks/${z18.string().uuid().parse(id)}/disable`,
4060
4224
  webhookEndpointSchema,
4061
4225
  {},
4062
4226
  call
4063
4227
  ),
4064
4228
  rotateSecret: rotateWebhookSecret,
4065
4229
  deliveries: (id, query = {}, call) => get(
4066
- `/webhooks/${z17.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
4230
+ `/webhooks/${z18.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
4067
4231
  webhookDeliveryPageSchema,
4068
4232
  call
4069
4233
  ),
4070
4234
  replay: (id, delivery, call) => post(
4071
- `/webhooks/${z17.string().uuid().parse(id)}/deliveries/${z17.string().uuid().parse(delivery)}/replay`,
4235
+ `/webhooks/${z18.string().uuid().parse(id)}/deliveries/${z18.string().uuid().parse(delivery)}/replay`,
4072
4236
  webhookDeliverySchema,
4073
4237
  {},
4074
4238
  call
@@ -4079,7 +4243,7 @@ function managementClient(options) {
4079
4243
  * environment. Organization administrators, from a Console session only.
4080
4244
  */
4081
4245
  identityIntegrations: {
4082
- list: (call) => get("/identity-integrations", z17.array(identityIntegrationSchema), call),
4246
+ list: (call) => get("/identity-integrations", z18.array(identityIntegrationSchema), call),
4083
4247
  /** The secret `token` is in this response only. */
4084
4248
  create: (input, call) => post(
4085
4249
  "/identity-integrations",
@@ -4094,7 +4258,7 @@ function managementClient(options) {
4094
4258
  * @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
4095
4259
  */
4096
4260
  rotate: (id, call) => post(
4097
- `/identity-integrations/${z17.string().uuid().parse(id)}/rotate`,
4261
+ `/identity-integrations/${z18.string().uuid().parse(id)}/rotate`,
4098
4262
  identityIntegrationSecretSchema,
4099
4263
  {},
4100
4264
  call
@@ -4104,7 +4268,7 @@ function managementClient(options) {
4104
4268
  * revoke them with `revokeSecret`. The new `token` is in this response only.
4105
4269
  */
4106
4270
  addSecret: (id, input = {}, call) => post(
4107
- `/identity-integrations/${z17.string().uuid().parse(id)}/secrets`,
4271
+ `/identity-integrations/${z18.string().uuid().parse(id)}/secrets`,
4108
4272
  identityIntegrationSecretSchema,
4109
4273
  credentialSecretInputSchema.parse(input),
4110
4274
  call
@@ -4114,7 +4278,7 @@ function managementClient(options) {
4114
4278
  * revoked; disconnect the integration with `revoke` instead.
4115
4279
  */
4116
4280
  revokeSecret: (id, secret, call) => request(
4117
- `/identity-integrations/${z17.string().uuid().parse(id)}/secrets/${z17.string().uuid().parse(secret)}`,
4281
+ `/identity-integrations/${z18.string().uuid().parse(id)}/secrets/${z18.string().uuid().parse(secret)}`,
4118
4282
  identityIntegrationSchema,
4119
4283
  void 0,
4120
4284
  "DELETE",
@@ -4122,7 +4286,7 @@ function managementClient(options) {
4122
4286
  ),
4123
4287
  /** Makes one secret never expire. */
4124
4288
  removeSecretExpiry: (id, secret, call) => request(
4125
- `/identity-integrations/${z17.string().uuid().parse(id)}/secrets/${z17.string().uuid().parse(secret)}/expiry`,
4289
+ `/identity-integrations/${z18.string().uuid().parse(id)}/secrets/${z18.string().uuid().parse(secret)}/expiry`,
4126
4290
  identityIntegrationSchema,
4127
4291
  void 0,
4128
4292
  "DELETE",
@@ -4135,7 +4299,7 @@ function managementClient(options) {
4135
4299
  */
4136
4300
  kinds: (call) => get(
4137
4301
  "/identity-integrations/kinds",
4138
- z17.array(identityKindClaimSchema),
4302
+ z18.array(identityKindClaimSchema),
4139
4303
  call
4140
4304
  ),
4141
4305
  /**
@@ -4143,8 +4307,8 @@ function managementClient(options) {
4143
4307
  * and keep attributing tracker records; unlink them on the member to stop that.
4144
4308
  */
4145
4309
  revoke: (id, call) => request(
4146
- `/identity-integrations/${z17.string().uuid().parse(id)}`,
4147
- z17.null(),
4310
+ `/identity-integrations/${z18.string().uuid().parse(id)}`,
4311
+ z18.null(),
4148
4312
  void 0,
4149
4313
  "DELETE",
4150
4314
  call
@@ -4195,7 +4359,7 @@ function managementClient(options) {
4195
4359
  resources: {
4196
4360
  list: (call) => get(
4197
4361
  "/resources",
4198
- z17.object({ resources: z17.array(managedResourceSchema) }),
4362
+ z18.object({ resources: z18.array(managedResourceSchema) }),
4199
4363
  call
4200
4364
  ),
4201
4365
  /** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
@@ -4266,7 +4430,7 @@ function managementClient(options) {
4266
4430
  testMemberCreateSchema.parse(withActionId(input)),
4267
4431
  call
4268
4432
  ),
4269
- list: (call) => get("/test-members", z17.array(testMemberSchema), call),
4433
+ list: (call) => get("/test-members", z18.array(testMemberSchema), call),
4270
4434
  history: (member, query = {}, call) => get(
4271
4435
  `/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
4272
4436
  testMemberHistorySchema,
@@ -4502,13 +4666,13 @@ function managementClient(options) {
4502
4666
  )
4503
4667
  },
4504
4668
  counters: {
4505
- history: (member, quest2, query = {}, call) => get(
4506
- `/members/${identifier.parse(member)}/counters/${identifier.parse(quest2)}${queryString(counterHistoryQuerySchema.parse(query))}`,
4669
+ history: (member, quest, query = {}, call) => get(
4670
+ `/members/${identifier.parse(member)}/counters/${identifier.parse(quest)}${queryString(counterHistoryQuerySchema.parse(query))}`,
4507
4671
  counterHistorySchema,
4508
4672
  call
4509
4673
  ),
4510
- moderate: (member, quest2, contribution, input, call) => post(
4511
- `/members/${identifier.parse(member)}/counters/${identifier.parse(quest2)}/${identifier.parse(contribution)}/moderate`,
4674
+ moderate: (member, quest, contribution, input, call) => post(
4675
+ `/members/${identifier.parse(member)}/counters/${identifier.parse(quest)}/${identifier.parse(contribution)}/moderate`,
4512
4676
  counterModerationResultSchema,
4513
4677
  counterModerationSchema.parse(withActionId(input)),
4514
4678
  call
@@ -4550,7 +4714,7 @@ function managementClient(options) {
4550
4714
  /** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
4551
4715
  people: (members, call) => get(
4552
4716
  `/people${queryString({ ids: members.join(",") })}`,
4553
- z17.array(personSchema),
4717
+ z18.array(personSchema),
4554
4718
  call
4555
4719
  ),
4556
4720
  /**
@@ -4560,7 +4724,7 @@ function managementClient(options) {
4560
4724
  */
4561
4725
  oauthAccounts: (member, call) => get(
4562
4726
  `/members/${encodeURIComponent(member)}/oauth-accounts`,
4563
- z17.array(managedOAuthAccountSchema),
4727
+ z18.array(managedOAuthAccountSchema),
4564
4728
  call
4565
4729
  ),
4566
4730
  /**
@@ -4570,7 +4734,7 @@ function managementClient(options) {
4570
4734
  */
4571
4735
  unlinkOAuthAccount: (member, input, call) => post(
4572
4736
  `/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
4573
- z17.array(managedOAuthAccountSchema),
4737
+ z18.array(managedOAuthAccountSchema),
4574
4738
  memberOAuthUnlinkInputSchema.parse(input),
4575
4739
  call
4576
4740
  ),
@@ -4603,7 +4767,7 @@ function managementClient(options) {
4603
4767
  */
4604
4768
  unlinkWallet: (member, input, call) => post(
4605
4769
  `/members/${encodeURIComponent(member)}/wallets/unlink`,
4606
- z17.array(managedWalletSchema),
4770
+ z18.array(managedWalletSchema),
4607
4771
  memberWalletUnlinkInputSchema.parse(input),
4608
4772
  call
4609
4773
  ),
@@ -4616,7 +4780,7 @@ function managementClient(options) {
4616
4780
  */
4617
4781
  unlinkIdentity: (member, input, call) => post(
4618
4782
  `/members/${encodeURIComponent(member)}/identities/unlink`,
4619
- z17.array(managedMemberIdentitySchema),
4783
+ z18.array(managedMemberIdentitySchema),
4620
4784
  memberIdentityChangeInputSchema.parse(input),
4621
4785
  call
4622
4786
  ),
@@ -4627,7 +4791,7 @@ function managementClient(options) {
4627
4791
  */
4628
4792
  relinkIdentity: (member, input, call) => post(
4629
4793
  `/members/${encodeURIComponent(member)}/identities/relink`,
4630
- z17.array(managedMemberIdentitySchema),
4794
+ z18.array(managedMemberIdentitySchema),
4631
4795
  memberIdentityChangeInputSchema.parse(input),
4632
4796
  call
4633
4797
  ),
@@ -4639,7 +4803,7 @@ function managementClient(options) {
4639
4803
  */
4640
4804
  setWalletSignIn: (member, input, call) => post(
4641
4805
  `/members/${encodeURIComponent(member)}/wallets/sign-in`,
4642
- z17.array(managedWalletSchema),
4806
+ z18.array(managedWalletSchema),
4643
4807
  memberWalletSignInInputSchema.parse(input),
4644
4808
  call
4645
4809
  )
@@ -4763,7 +4927,7 @@ function managementClient(options) {
4763
4927
  `/storage/sql/${appSecretNameSchema.parse(name)}/cell?${new URLSearchParams(
4764
4928
  {
4765
4929
  table,
4766
- row: String(z17.number().int().min(0).parse(options2.row)),
4930
+ row: String(z18.number().int().min(0).parse(options2.row)),
4767
4931
  column: options2.column,
4768
4932
  ...options2.cursor === void 0 ? {} : { cursor: pageCursorSchema.parse(options2.cursor) }
4769
4933
  }
@@ -4869,13 +5033,13 @@ function managementClient(options) {
4869
5033
  )
4870
5034
  },
4871
5035
  quests: {
4872
- pause: (quest2, input, call) => operationVerb(`quest:${identifier.parse(quest2)}`, true, input, call),
4873
- resume: (quest2, input, call) => operationVerb(`quest:${identifier.parse(quest2)}`, false, input, call),
5036
+ pause: (quest, input, call) => operationVerb(`quest:${identifier.parse(quest)}`, true, input, call),
5037
+ resume: (quest, input, call) => operationVerb(`quest:${identifier.parse(quest)}`, false, input, call),
4874
5038
  /**
4875
5039
  * Each quest's current release, the most recently published first, archived quests
4876
5040
  * included; requires `read` permission.
4877
5041
  */
4878
- list: (call) => get("/quests/list", z17.array(publishedReleaseSchema), call),
5042
+ list: (call) => get("/quests/list", z18.array(publishedReleaseSchema), call),
4879
5043
  /** Pending and exhausted asynchronous balance checks. Requires read. */
4880
5044
  automaticScheduling: (query = {}, call) => get(
4881
5045
  `/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
@@ -4920,7 +5084,7 @@ function managementClient(options) {
4920
5084
  */
4921
5085
  submissions: (member, call) => get(
4922
5086
  `/members/${encodeURIComponent(member)}/quest-submissions`,
4923
- z17.object({ items: z17.array(questSubmissionSchema) }),
5087
+ z18.object({ items: z18.array(questSubmissionSchema) }),
4924
5088
  call
4925
5089
  ),
4926
5090
  /**
@@ -4933,8 +5097,8 @@ function managementClient(options) {
4933
5097
  {},
4934
5098
  call
4935
5099
  ),
4936
- withdraw: (quest2, member, input, call) => post(
4937
- `/quests/${encodeURIComponent(quest2)}/enrollments/${encodeURIComponent(member)}/withdraw`,
5100
+ withdraw: (quest, member, input, call) => post(
5101
+ `/quests/${encodeURIComponent(quest)}/enrollments/${encodeURIComponent(member)}/withdraw`,
4938
5102
  questEnrollmentStateSchema,
4939
5103
  questEnrollmentWithdrawalInputSchema.parse(withActionId(input)),
4940
5104
  call
@@ -4955,8 +5119,8 @@ function managementClient(options) {
4955
5119
  * Stops new participation and hides the quest from collections, with a reason. Completions,
4956
5120
  * attempts and rewards stay. Deploying the quest's code again keeps it archived.
4957
5121
  */
4958
- archive: (quest2, input, call) => post(
4959
- `/quests/${identifier.parse(quest2)}/archive`,
5122
+ archive: (quest, input, call) => post(
5123
+ `/quests/${identifier.parse(quest)}/archive`,
4960
5124
  questLifecycleSchema,
4961
5125
  questLifecycleInputSchema.omit({ quest: true, archived: true }).parse(withActionId(input)),
4962
5126
  call
@@ -4965,8 +5129,8 @@ function managementClient(options) {
4965
5129
  * Opens an archived quest again, with a reason. It must pass the prerequisite graph and the
4966
5130
  * app's supported interactions; it stays paused while a resource setting is empty.
4967
5131
  */
4968
- unarchive: (quest2, input, call) => post(
4969
- `/quests/${identifier.parse(quest2)}/unarchive`,
5132
+ unarchive: (quest, input, call) => post(
5133
+ `/quests/${identifier.parse(quest)}/unarchive`,
4970
5134
  questLifecycleSchema,
4971
5135
  questLifecycleInputSchema.omit({ quest: true, archived: true }).parse(withActionId(input)),
4972
5136
  call
@@ -5044,6 +5208,21 @@ function managementClient(options) {
5044
5208
  });
5045
5209
  }
5046
5210
  var managementResponseSchemas = lazyResponseReaders({
5211
+ get activeMemberUsageSchema() {
5212
+ return knownResponse(activeMemberUsageSchema);
5213
+ },
5214
+ get billingPlanChangeSchema() {
5215
+ return knownResponse(billingPlanChangeSchema);
5216
+ },
5217
+ get billingSessionSchema() {
5218
+ return knownResponse(billingSessionSchema);
5219
+ },
5220
+ get projectBillingSchema() {
5221
+ return knownResponse(projectBillingSchema);
5222
+ },
5223
+ get realPeopleInTestUsageSchema() {
5224
+ return knownResponse(realPeopleInTestUsageSchema);
5225
+ },
5047
5226
  get managedBadgeSchema() {
5048
5227
  return knownResponse(managedBadgeSchema);
5049
5228
  },
@@ -5356,6 +5535,21 @@ var managementResponseSchemas = lazyResponseReaders({
5356
5535
  get analyticsReadSchema() {
5357
5536
  return knownResponse(analyticsReadSchema);
5358
5537
  },
5538
+ get analyticsCatalogSchema() {
5539
+ return knownResponse(analyticsCatalogSchema);
5540
+ },
5541
+ get analyticsMetricResultSchema() {
5542
+ return knownResponse(analyticsMetricResultSchema);
5543
+ },
5544
+ get dashboardListSchema() {
5545
+ return knownResponse(dashboardListSchema);
5546
+ },
5547
+ get dashboardReadSchema() {
5548
+ return knownResponse(dashboardReadSchema);
5549
+ },
5550
+ get dashboardLifecycleResultSchema() {
5551
+ return knownResponse(dashboardLifecycleResultSchema);
5552
+ },
5359
5553
  get projectSchema() {
5360
5554
  return knownResponse(projectSchema);
5361
5555
  },
@@ -5481,6 +5675,21 @@ var managementResponseSchemas = lazyResponseReaders({
5481
5675
  }
5482
5676
  });
5483
5677
  var managementResponses = lazyResponseReaders({
5678
+ get activeMemberUsageSchema() {
5679
+ return responseSchema(activeMemberUsageSchema);
5680
+ },
5681
+ get billingPlanChangeSchema() {
5682
+ return responseSchema(billingPlanChangeSchema);
5683
+ },
5684
+ get billingSessionSchema() {
5685
+ return responseSchema(billingSessionSchema);
5686
+ },
5687
+ get projectBillingSchema() {
5688
+ return responseSchema(projectBillingSchema);
5689
+ },
5690
+ get realPeopleInTestUsageSchema() {
5691
+ return responseSchema(realPeopleInTestUsageSchema);
5692
+ },
5484
5693
  get managedBadgeSchema() {
5485
5694
  return responseSchema(managedBadgeSchema);
5486
5695
  },
@@ -5793,6 +6002,21 @@ var managementResponses = lazyResponseReaders({
5793
6002
  get analyticsReadSchema() {
5794
6003
  return responseSchema(analyticsReadSchema);
5795
6004
  },
6005
+ get analyticsCatalogSchema() {
6006
+ return responseSchema(analyticsCatalogSchema);
6007
+ },
6008
+ get analyticsMetricResultSchema() {
6009
+ return responseSchema(analyticsMetricResultSchema);
6010
+ },
6011
+ get dashboardListSchema() {
6012
+ return responseSchema(dashboardListSchema);
6013
+ },
6014
+ get dashboardReadSchema() {
6015
+ return responseSchema(dashboardReadSchema);
6016
+ },
6017
+ get dashboardLifecycleResultSchema() {
6018
+ return responseSchema(dashboardLifecycleResultSchema);
6019
+ },
5796
6020
  get projectSchema() {
5797
6021
  return responseSchema(projectSchema);
5798
6022
  },
@@ -5946,9 +6170,20 @@ export {
5946
6170
  accessHistoryQuerySchema,
5947
6171
  accessSchema,
5948
6172
  accountProfileSchema,
6173
+ activeMemberMonthSchema,
6174
+ activeMemberUsageSchema,
5949
6175
  activityTypeSchema,
5950
6176
  activityTypes,
5951
6177
  addGroupMemberSchema,
6178
+ analyticsBreakdowns,
6179
+ analyticsCatalog,
6180
+ analyticsCatalogSchema,
6181
+ analyticsCharts,
6182
+ analyticsFilters,
6183
+ analyticsMetricIds,
6184
+ analyticsMetricQuerySchema,
6185
+ analyticsMetricResultSchema,
6186
+ analyticsQueryLimit,
5952
6187
  analyticsQuerySchema,
5953
6188
  analyticsRanges,
5954
6189
  analyticsReadSchema,
@@ -5988,6 +6223,15 @@ export {
5988
6223
  auditQuerySchema,
5989
6224
  auditRecordSchema,
5990
6225
  balanceCheckSchema,
6226
+ billingCheckoutInputSchema,
6227
+ billingIntervals,
6228
+ billingPlanChangeInputSchema,
6229
+ billingPlanChangeSchema,
6230
+ billingSessionSchema,
6231
+ billingSubscriptionPlans,
6232
+ billingSubscriptionSchema,
6233
+ billingTopupInputSchema,
6234
+ billingTopupMaxQuantity,
5991
6235
  buildArtifactsSchema,
5992
6236
  buildIdentitySchema,
5993
6237
  buildPhaseSchema,
@@ -6010,6 +6254,13 @@ export {
6010
6254
  customDomainRecordSchema,
6011
6255
  customDomainSchema,
6012
6256
  customDomainStateSchema,
6257
+ dashboardLifecycleInputSchema,
6258
+ dashboardLifecycleResultSchema,
6259
+ dashboardListQuerySchema,
6260
+ dashboardListSchema,
6261
+ dashboardReadQuerySchema,
6262
+ dashboardReadSchema,
6263
+ dashboardSummarySchema,
6013
6264
  deploymentActionSchema,
6014
6265
  deploymentRejectionSchema,
6015
6266
  developmentPreflightSchema,
@@ -6052,6 +6303,8 @@ export {
6052
6303
  isParticipantRoute,
6053
6304
  issuedServiceKeySchema,
6054
6305
  issuedTokenSchema,
6306
+ leaderboardSettlementExportSchema,
6307
+ leaderboardSettlementMeasurementRetrySchema,
6055
6308
  leaderboardSettlementRejectionSchema,
6056
6309
  leaderboardSettlementReviewPageSchema,
6057
6310
  leaderboardSettlementReviewQuerySchema,
@@ -6131,6 +6384,7 @@ export {
6131
6384
  permissionSchema,
6132
6385
  personSchema,
6133
6386
  pointLedgerPropertiesSchema,
6387
+ projectBillingSchema,
6134
6388
  projectDeletionInputSchema,
6135
6389
  projectDeletionSchema,
6136
6390
  projectInputSchema,
@@ -6157,6 +6411,7 @@ export {
6157
6411
  questLifecycleInputSchema,
6158
6412
  questLifecycleSchema,
6159
6413
  readinessSchema,
6414
+ realPeopleInTestUsageSchema,
6160
6415
  referralManagementSchema,
6161
6416
  referralQualificationSchema,
6162
6417
  referralRewardResolutionSchema,