@domino-sdk/relay 1.31.0 → 1.33.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 (30) hide show
  1. package/dist/authoring.d.ts +8 -8
  2. package/dist/authoring.js +1 -1
  3. package/dist/browser.d.ts +4 -4
  4. package/dist/browser.js +5 -5
  5. package/dist/{chunk-BEGFBWEG.js → chunk-2SL7K42N.js} +2 -2
  6. package/dist/{chunk-MHPTCD5O.js → chunk-BDWZ2BZP.js} +1 -1
  7. package/dist/{chunk-F3JLZ7MR.js → chunk-E5OYFYO3.js} +3 -3
  8. package/dist/{chunk-WULPIU3Z.js → chunk-KWNSYWVH.js} +1 -1
  9. package/dist/{chunk-5QZGXYH7.js → chunk-ON7RDKQ3.js} +13 -2
  10. package/dist/{chunk-LSJPJQW4.js → chunk-PM3265GG.js} +61 -31
  11. package/dist/{chunk-A7SJDWBR.js → chunk-YPI5SGXB.js} +1 -1
  12. package/dist/{client-CFFgPnIX.d.ts → client-Bkc7gOmF.d.ts} +3 -2
  13. package/dist/{groups-sgKusEzF.d.ts → groups-C06mpYOs.d.ts} +5 -0
  14. package/dist/index.d.ts +4 -4
  15. package/dist/index.js +4 -4
  16. package/dist/internal.d.ts +4 -4
  17. package/dist/internal.js +2 -2
  18. package/dist/{offers-D14uyLQQ.d.ts → offers-BbQ9O-5J.d.ts} +1 -1
  19. package/dist/portal-proxy.js +1 -1
  20. package/dist/react/index.d.ts +6 -6
  21. package/dist/react/index.js +5 -5
  22. package/dist/schema.d.ts +66 -63
  23. package/dist/schema.js +3 -3
  24. package/dist/server/index.d.ts +4 -4
  25. package/dist/server/index.js +1018 -620
  26. package/dist/{submission-input-Dr0v6J9N.d.ts → submission-input-DUmt6Wyx.d.ts} +1 -1
  27. package/dist/{telegram-browser-zPO8yYDJ.d.ts → telegram-browser-DWFPGBgU.d.ts} +1 -1
  28. package/dist/{transport-leWfCbHS.d.ts → transport-DVdbwmrB.d.ts} +1814 -352
  29. package/package.json +1 -1
  30. package/dist/{deployments-DMVpPnGX.d.ts → deployments-BZuI2lWF.d.ts} +28 -28
@@ -27,7 +27,7 @@ import {
27
27
  publishDeploymentSchema,
28
28
  rejectDeploymentSchema,
29
29
  submitDeploymentSchema
30
- } from "../chunk-BEGFBWEG.js";
30
+ } from "../chunk-2SL7K42N.js";
31
31
  import "../chunk-4OC7REYX.js";
32
32
  import {
33
33
  DEFAULT_MANAGEMENT_TIMEOUT,
@@ -36,6 +36,8 @@ import {
36
36
  REFERRAL_INTEGRATION_REWARD_ERROR,
37
37
  actionIdOf,
38
38
  containsReferralIntegrationReward,
39
+ credentialSecretInputSchema,
40
+ credentialSecretSchema,
39
41
  identityIntegrationInputSchema,
40
42
  identityIntegrationSchema,
41
43
  identityIntegrationSecretSchema,
@@ -46,7 +48,7 @@ import {
46
48
  participantExchangeSchema,
47
49
  questConfiguration,
48
50
  sequenceCursorSchema
49
- } from "../chunk-LSJPJQW4.js";
51
+ } from "../chunk-PM3265GG.js";
50
52
  import {
51
53
  parseImageExtraction,
52
54
  parseImageResult
@@ -88,7 +90,7 @@ import {
88
90
  rewardDeliveryQuerySchema,
89
91
  rewardDeliverySchema,
90
92
  saveQuestDraftSchema
91
- } from "../chunk-MHPTCD5O.js";
93
+ } from "../chunk-BDWZ2BZP.js";
92
94
  import {
93
95
  badgeMutationResultSchema,
94
96
  badgeMutationSchema,
@@ -142,14 +144,14 @@ import {
142
144
  referralQualificationSchema,
143
145
  referralRewardResolutionSchema,
144
146
  referralSuspensionSchema
145
- } from "../chunk-5QZGXYH7.js";
147
+ } from "../chunk-ON7RDKQ3.js";
146
148
  import {
147
149
  telegramChatConnectionSchema,
148
150
  telegramChatIdSchema,
149
151
  telegramChatsSchema
150
152
  } from "../chunk-BUHGXKPY.js";
151
153
  import "../chunk-V7K7XXFB.js";
152
- import "../chunk-A7SJDWBR.js";
154
+ import "../chunk-YPI5SGXB.js";
153
155
  import "../chunk-466IRAJP.js";
154
156
  import {
155
157
  CompletionSourceKind,
@@ -515,90 +517,267 @@ var testMemberHistorySchema = z6.object({
515
517
  complete: z6.boolean()
516
518
  });
517
519
 
518
- // src/server/webhooks.ts
520
+ // src/server/member-imports.ts
519
521
  import * as z7 from "zod";
522
+ var importTimeSchema = z7.union([
523
+ z7.number().int().nonnegative().safe(),
524
+ z7.iso.datetime({ offset: true }).transform((value) => Date.parse(value))
525
+ ]);
526
+ var importWalletSchema = z7.discriminatedUnion("chain", [
527
+ z7.object({
528
+ kind: z7.literal("wallet"),
529
+ chain: z7.literal("solana"),
530
+ address: solanaAddressSchema
531
+ }).strict(),
532
+ z7.object({
533
+ kind: z7.literal("wallet"),
534
+ chain: z7.literal("eip155"),
535
+ address: evmAddressSchema
536
+ }).strict(),
537
+ z7.object({
538
+ kind: z7.literal("wallet"),
539
+ chain: z7.literal("cosmos"),
540
+ network: cosmosNetworkSchema,
541
+ address: cosmosAddressSchema
542
+ }).strict()
543
+ ]);
544
+ var importXSchema = z7.object({
545
+ kind: z7.literal("x"),
546
+ subject: z7.string().regex(/^[1-9][0-9]{0,19}$/, "Use the numeric X user ID")
547
+ }).strict();
548
+ var importAppIdentitySchema = z7.object({ kind: appIdentityKindSchema, subject: z7.string().min(1).max(256) }).strict();
549
+ var memberImportIdentitySchema = z7.union([
550
+ importAppIdentitySchema,
551
+ importWalletSchema,
552
+ importXSchema
553
+ ]);
554
+ var memberImportAccountSchema = z7.union([
555
+ importWalletSchema,
556
+ importXSchema
557
+ ]);
558
+ var memberImportActionSchema = z7.object({
559
+ at: importTimeSchema,
560
+ key: z7.string().min(1).max(200).optional()
561
+ }).strict();
562
+ var memberImportRowSchema = z7.object({
563
+ /** The member's ID on the platform they come from. Unique within an import. */
564
+ ref: z7.string().trim().min(1).max(200),
565
+ identity: memberImportIdentitySchema,
566
+ accounts: z7.array(memberImportAccountSchema).max(20).default([]),
567
+ /** Opening balances, credited once per ledger as an imported entry. */
568
+ points: z7.array(
569
+ z7.object({
570
+ ledger: z7.string().min(1).max(200),
571
+ balance: z7.number().int().positive().safe()
572
+ }).strict()
573
+ ).max(50).default([]),
574
+ /** Quest progress, by quest authoring key or ID. */
575
+ quests: z7.array(
576
+ z7.object({
577
+ quest: z7.string().min(1).max(200),
578
+ actions: z7.array(memberImportActionSchema).min(1).max(3660)
579
+ }).strict()
580
+ ).max(200).default([])
581
+ }).strict();
582
+ var memberImportCreateSchema = z7.object({
583
+ actionId: identifier,
584
+ /** Where the members come from, such as "legacy-domino". */
585
+ source: z7.string().trim().min(1).max(100)
586
+ }).strict();
587
+ var memberImportRowsInputSchema = z7.object({ rows: z7.array(memberImportRowSchema).min(1).max(500) }).strict();
588
+ var MemberImportRefusalCode = {
589
+ /** An account or identity belongs to another member in the project. */
590
+ AccountLinkedElsewhere: "account-linked-elsewhere",
591
+ /** An operator unlinked the row's app identity. */
592
+ IdentityUnlinked: "identity-unlinked",
593
+ /** An earlier row of the import names the same account. */
594
+ DuplicateAccount: "duplicate-account",
595
+ /** The member already has another X account selected. */
596
+ XAccountSelected: "x-account-selected",
597
+ /** The member would hold more wallets of a chain family than a member can link. */
598
+ LimitReached: "limit-reached",
599
+ UnknownLedger: "unknown-ledger",
600
+ UnknownQuest: "unknown-quest",
601
+ /** The quest has no active release in this environment. */
602
+ QuestNotPublished: "quest-not-published",
603
+ /** The quest's completions are decided per content item, which an import cannot record. */
604
+ QuestNotImportable: "quest-not-importable",
605
+ /** A keyed quest's action has no `key`. */
606
+ KeyRequired: "key-required",
607
+ /** An action is dated in the future. */
608
+ FutureAction: "future-action",
609
+ /** The row's sign-in wallet or X account is linked to its member without sign-in. */
610
+ SignInDisabled: "sign-in-disabled",
611
+ /** The row names one point ledger or quest twice, by any of its names. */
612
+ DuplicateEntry: "duplicate-entry"
613
+ };
614
+ var refusalCodeSchema = z7.string();
615
+ var memberImportRefusalSchema = z7.object({
616
+ code: refusalCodeSchema,
617
+ message: z7.string()
618
+ });
619
+ var memberImportRowResultSchema = z7.object({
620
+ line: z7.number().int().positive(),
621
+ ref: z7.string(),
622
+ status: z7.enum(["pending", "ready", "applied", "refused"]),
623
+ /** The member the row resolves to: an existing member, or the one applying created. */
624
+ member: identifier.nullable(),
625
+ /** Whether the row's identity names a member who already exists. Null until checked. */
626
+ existing: z7.boolean().nullable(),
627
+ refusals: z7.array(memberImportRefusalSchema)
628
+ });
629
+ var memberImportRowPageSchema = z7.object({
630
+ items: z7.array(memberImportRowResultSchema),
631
+ nextCursor: z7.string().nullable()
632
+ });
633
+ var memberImportRowQuerySchema = z7.object({
634
+ status: z7.enum(["pending", "ready", "applied", "refused"]).optional(),
635
+ cursor: z7.string().max(200).optional(),
636
+ limit: z7.coerce.number().int().min(1).max(500).optional()
637
+ }).strict();
638
+ var memberImportSummarySchema = z7.object({
639
+ rows: z7.number().int().nonnegative(),
640
+ ready: z7.number().int().nonnegative(),
641
+ refused: z7.number().int().nonnegative(),
642
+ members: z7.object({
643
+ created: z7.number().int().nonnegative(),
644
+ existing: z7.number().int().nonnegative()
645
+ }),
646
+ /** Identities and accounts the ready rows attach, sign-in identities included. */
647
+ accounts: z7.number().int().nonnegative(),
648
+ /** Opening balance totals, by ledger as the rows name it. */
649
+ points: z7.array(
650
+ z7.object({ ledger: z7.string(), total: z7.number().int().nonnegative() })
651
+ ),
652
+ /** Imported actions, by quest as the rows name it. */
653
+ actions: z7.array(
654
+ z7.object({ quest: z7.string(), total: z7.number().int().nonnegative() })
655
+ ),
656
+ /** Refused rows, by refusal code. A row can have several. */
657
+ refusals: z7.array(
658
+ z7.object({ code: refusalCodeSchema, rows: z7.number().int().nonnegative() })
659
+ )
660
+ });
661
+ var memberImportSchema = z7.object({
662
+ id: identifier,
663
+ source: z7.string(),
664
+ status: z7.enum([
665
+ "open",
666
+ "checking",
667
+ "checked",
668
+ "applying",
669
+ "applied",
670
+ "canceled"
671
+ ]),
672
+ rows: z7.number().int().nonnegative(),
673
+ /** The latest check's summary, or null before the first check and after rows change. */
674
+ summary: memberImportSummarySchema.nullable(),
675
+ /** While applying and after: rows applied and refused so far. */
676
+ progress: z7.object({
677
+ applied: z7.number().int().nonnegative(),
678
+ refused: z7.number().int().nonnegative()
679
+ }),
680
+ createdAt: z7.number().int(),
681
+ createdBy: z7.string().nullable(),
682
+ checkedAt: z7.number().int().nullable(),
683
+ appliedAt: z7.number().int().nullable(),
684
+ appliedBy: z7.string().nullable(),
685
+ canceledAt: z7.number().int().nullable(),
686
+ canceledBy: z7.string().nullable()
687
+ });
688
+ var memberImportPageSchema = z7.object({
689
+ items: z7.array(memberImportSchema),
690
+ nextCursor: z7.string().nullable()
691
+ });
692
+ var memberImportListQuerySchema = z7.object({
693
+ cursor: z7.string().max(200).optional(),
694
+ limit: z7.coerce.number().int().min(1).max(100).optional()
695
+ }).strict();
696
+
697
+ // src/server/webhooks.ts
698
+ import * as z8 from "zod";
520
699
  var PayoutSourceKind = {
521
700
  Quest: "quest",
522
701
  Leaderboard: "leaderboard",
523
702
  Engagement: "engagement",
524
703
  Manual: "manual"
525
704
  };
526
- var webhookEventSchema = z7.object({
527
- id: z7.string().uuid(),
528
- version: z7.literal(1),
705
+ var webhookEventSchema = z8.object({
706
+ id: z8.string().uuid(),
707
+ version: z8.literal(1),
529
708
  type: activityTypeSchema,
530
- createdAt: z7.number().int().nonnegative(),
531
- organization: z7.string(),
532
- project: z7.string(),
533
- environment: z7.enum(["test", "live"]),
534
- data: z7.record(z7.string(), z7.json())
709
+ createdAt: z8.number().int().nonnegative(),
710
+ organization: z8.string(),
711
+ project: z8.string(),
712
+ environment: z8.enum(["test", "live"]),
713
+ data: z8.record(z8.string(), z8.json())
535
714
  });
536
- var webhookControlInputSchema = z7.object({ actionId: z7.string().uuid().optional() }).strict();
537
- var webhookInputSchema = z7.object({
538
- url: z7.url().max(2048).refine((value) => {
715
+ var webhookControlInputSchema = z8.object({ actionId: z8.string().uuid().optional() }).strict();
716
+ var webhookInputSchema = z8.object({
717
+ url: z8.url().max(2048).refine((value) => {
539
718
  const url2 = new URL(value);
540
719
  return url2.protocol === "https:" && !url2.username && !url2.password && !url2.hash;
541
720
  }, "Use an HTTPS URL without credentials or a fragment"),
542
- types: z7.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
721
+ types: z8.array(activityTypeSchema).min(1).max(100).refine((v) => new Set(v).size === v.length)
543
722
  }).strict();
544
- var webhookCreateInputSchema = webhookInputSchema.extend({ actionId: z7.string().uuid().optional() }).strict();
545
- var webhookRotateInputSchema = z7.object({ actionId: z7.string().uuid().optional() }).strict();
546
- var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled: z7.boolean().optional() }).strict();
547
- var webhookEndpointSchema = z7.object({
723
+ var webhookCreateInputSchema = webhookInputSchema.extend({ actionId: z8.string().uuid().optional() }).strict();
724
+ var webhookRotateInputSchema = z8.object({ actionId: z8.string().uuid().optional() }).strict();
725
+ var webhookUpdateSchema = webhookInputSchema.partial().extend({ enabled: z8.boolean().optional() }).strict();
726
+ var webhookEndpointSchema = z8.object({
548
727
  ...webhookInputSchema.shape,
549
- id: z7.string().uuid(),
550
- enabled: z7.boolean(),
551
- disabledReason: z7.string().nullable(),
552
- consecutiveFailures: z7.number().int().nonnegative(),
553
- createdAt: z7.number(),
554
- updatedAt: z7.number()
728
+ id: z8.string().uuid(),
729
+ enabled: z8.boolean(),
730
+ disabledReason: z8.string().nullable(),
731
+ consecutiveFailures: z8.number().int().nonnegative(),
732
+ createdAt: z8.number(),
733
+ updatedAt: z8.number()
555
734
  });
556
735
  var webhookEndpointStateSchema = webhookEndpointSchema.extend({
557
- revision: z7.number().int().nonnegative(),
558
- deletedAt: z7.number().int().safe().nonnegative().nullable()
736
+ revision: z8.number().int().nonnegative(),
737
+ deletedAt: z8.number().int().safe().nonnegative().nullable()
559
738
  });
560
- var webhookDeleteInputSchema = z7.strictObject({
561
- actionId: z7.string().uuid().default(() => crypto.randomUUID()),
562
- expectedRevision: z7.number().int().nonnegative(),
563
- reason: z7.string().trim().min(1).max(500)
739
+ var webhookDeleteInputSchema = z8.strictObject({
740
+ actionId: z8.string().uuid().default(() => crypto.randomUUID()),
741
+ expectedRevision: z8.number().int().nonnegative(),
742
+ reason: z8.string().trim().min(1).max(500)
564
743
  });
565
- var webhookStateQuerySchema = z7.strictObject({
744
+ var webhookStateQuerySchema = z8.strictObject({
566
745
  cursor: pageCursorSchema.optional(),
567
- limit: z7.coerce.number().int().min(1).max(100).default(50)
746
+ limit: z8.coerce.number().int().min(1).max(100).default(50)
568
747
  });
569
- var webhookStatePageSchema = z7.object({
570
- items: z7.array(webhookEndpointStateSchema),
748
+ var webhookStatePageSchema = z8.object({
749
+ items: z8.array(webhookEndpointStateSchema),
571
750
  nextCursor: pageCursorSchema.nullable()
572
751
  });
573
- var webhookSecretSchema = z7.object({
752
+ var webhookSecretSchema = z8.object({
574
753
  endpoint: webhookEndpointSchema,
575
- secret: z7.string(),
576
- previousValidUntil: z7.number().nullable()
754
+ secret: z8.string(),
755
+ previousValidUntil: z8.number().nullable()
577
756
  });
578
- var webhookDeliverySchema = z7.object({
579
- id: z7.string().uuid(),
580
- endpoint: z7.string().uuid(),
757
+ var webhookDeliverySchema = z8.object({
758
+ id: z8.string().uuid(),
759
+ endpoint: z8.string().uuid(),
581
760
  event: webhookEventSchema,
582
- status: z7.enum(["pending", "delivered", "failed", "skipped"]),
583
- attempts: z7.number().int().nonnegative(),
584
- responseStatus: z7.number().nullable(),
585
- lastError: z7.string().nullable(),
586
- createdAt: z7.number(),
587
- deliveredAt: z7.number().nullable(),
588
- replayOf: z7.string().uuid().nullable()
761
+ status: z8.enum(["pending", "delivered", "failed", "skipped"]),
762
+ attempts: z8.number().int().nonnegative(),
763
+ responseStatus: z8.number().nullable(),
764
+ lastError: z8.string().nullable(),
765
+ createdAt: z8.number(),
766
+ deliveredAt: z8.number().nullable(),
767
+ replayOf: z8.string().uuid().nullable()
589
768
  });
590
- var webhookQuerySchema = z7.object({
769
+ var webhookQuerySchema = z8.object({
591
770
  /** A page's `nextCursor`: the deliveries after it, newest first. */
592
771
  cursor: pageCursorSchema.optional(),
593
772
  /** @deprecated Use `cursor`. Removed in 2.0.0. */
594
- before: z7.string().uuid().optional(),
595
- limit: z7.coerce.number().int().min(1).max(100).default(50)
773
+ before: z8.string().uuid().optional(),
774
+ limit: z8.coerce.number().int().min(1).max(100).default(50)
596
775
  }).strict();
597
- var webhookDeliveryPageSchema = z7.object({
598
- items: z7.array(webhookDeliverySchema),
776
+ var webhookDeliveryPageSchema = z8.object({
777
+ items: z8.array(webhookDeliverySchema),
599
778
  nextCursor: pageCursorSchema.nullable().default(null),
600
779
  /** @deprecated Use `nextCursor`, passed back as `cursor`. Removed in 2.0.0. */
601
- next: z7.string().uuid().nullable()
780
+ next: z8.string().uuid().nullable()
602
781
  });
603
782
  var WEBHOOK_MAX_BYTES = 64 * 1024;
604
783
  async function verifyWebhook(input) {
@@ -642,8 +821,8 @@ async function verifyWebhook(input) {
642
821
  }
643
822
 
644
823
  // src/server/resource-lifecycle.ts
645
- import * as z8 from "zod";
646
- var resourceLifecycleKindSchema = z8.enum([
824
+ import * as z9 from "zod";
825
+ var resourceLifecycleKindSchema = z9.enum([
647
826
  "tracker",
648
827
  "referral",
649
828
  "leaderboard",
@@ -653,24 +832,24 @@ var resourceLifecycleKindSchema = z8.enum([
653
832
  "image",
654
833
  "point-ledger"
655
834
  ]);
656
- var managedResourceSchema = z8.object({
835
+ var managedResourceSchema = z9.object({
657
836
  kind: resourceLifecycleKindSchema,
658
837
  id: identifier,
659
838
  key: identifier.nullable(),
660
- title: z8.string(),
661
- archivedAt: z8.number().int().nonnegative().nullable()
839
+ title: z9.string(),
840
+ archivedAt: z9.number().int().nonnegative().nullable()
662
841
  });
663
- var resourceLifecycleInputSchema = z8.object({
664
- actionId: z8.string().uuid(),
842
+ var resourceLifecycleInputSchema = z9.object({
843
+ actionId: z9.string().uuid(),
665
844
  kind: resourceLifecycleKindSchema,
666
845
  resource: identifier,
667
- archived: z8.boolean(),
668
- reason: z8.string().trim().min(1).max(500),
669
- expectedArchivedAt: z8.number().int().nonnegative().nullable().optional()
846
+ archived: z9.boolean(),
847
+ reason: z9.string().trim().min(1).max(500),
848
+ expectedArchivedAt: z9.number().int().nonnegative().nullable().optional()
670
849
  }).strict();
671
- var resourceLifecycleResultSchema = z8.object({
850
+ var resourceLifecycleResultSchema = z9.object({
672
851
  resource: managedResourceSchema,
673
- changed: z8.boolean()
852
+ changed: z9.boolean()
674
853
  });
675
854
  var resourceLifecyclePaths = {
676
855
  tracker: "/trackers",
@@ -689,19 +868,19 @@ var resourceArchiveInputSchema = resourceLifecycleInputSchema.omit({
689
868
  });
690
869
 
691
870
  // src/server/index.ts
692
- import * as z14 from "zod";
871
+ import * as z15 from "zod";
693
872
 
694
873
  // src/server/hosting.ts
695
- import * as z11 from "zod";
874
+ import * as z12 from "zod";
696
875
 
697
876
  // src/server/schedules.ts
698
- import * as z9 from "zod";
877
+ import * as z10 from "zod";
699
878
  import { Cron } from "croner";
700
879
  var APP_SCHEDULE_LIMIT = 10;
701
880
  var APP_SCHEDULE_MIN_INTERVAL = 3e5;
702
881
  var APP_SCHEDULE_TIMEOUT = 3e4;
703
- var appScheduleNameSchema = z9.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
704
- var appSchedulePathSchema = z9.string().min(2).max(512).refine((path) => {
882
+ var appScheduleNameSchema = z10.string().regex(/^[a-z][a-z0-9-]{0,63}$/);
883
+ var appSchedulePathSchema = z10.string().min(2).max(512).refine((path) => {
705
884
  if (!/^\/[a-zA-Z0-9_/-]+$/.test(path) || path.startsWith("//")) {
706
885
  return false;
707
886
  }
@@ -712,11 +891,11 @@ function interval(value) {
712
891
  const unit = value.slice(-1);
713
892
  return amount * (unit === "m" ? 6e4 : unit === "h" ? 36e5 : 864e5);
714
893
  }
715
- var everySchema = z9.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
894
+ var everySchema = z10.string().regex(/^[1-9]\d{0,3}[mhd]$/).refine(
716
895
  (value) => interval(value) >= APP_SCHEDULE_MIN_INTERVAL && interval(value) <= 365 * 864e5,
717
896
  "Use an interval from 5 minutes to 365 days, such as 5m, 1h or 1d"
718
897
  );
719
- var cronSchema = z9.string().max(120).refine((value) => {
898
+ var cronSchema = z10.string().max(120).refine((value) => {
720
899
  const fields = value.trim().split(/\s+/);
721
900
  if (fields.length !== 5 || fields.some((field) => !/^[\d*,/-]+$/.test(field))) {
722
901
  return false;
@@ -741,15 +920,15 @@ var cronSchema = z9.string().max(120).refine((value) => {
741
920
  var declaration = {
742
921
  name: appScheduleNameSchema,
743
922
  path: appSchedulePathSchema,
744
- description: z9.string().min(1).max(500)
923
+ description: z10.string().min(1).max(500)
745
924
  };
746
- var everySchedule = z9.object({ ...declaration, every: everySchema });
747
- var cronSchedule = z9.object({ ...declaration, cron: cronSchema });
748
- var appScheduleSchema = z9.union([
925
+ var everySchedule = z10.object({ ...declaration, every: everySchema });
926
+ var cronSchedule = z10.object({ ...declaration, cron: cronSchema });
927
+ var appScheduleSchema = z10.union([
749
928
  everySchedule.strict(),
750
929
  cronSchedule.strict()
751
930
  ]);
752
- var appSchedulesSchema = z9.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
931
+ var appSchedulesSchema = z10.array(appScheduleSchema).max(APP_SCHEDULE_LIMIT).refine(
753
932
  (items) => new Set(items.map((item) => item.name)).size === items.length,
754
933
  "Schedule names must be unique"
755
934
  );
@@ -766,35 +945,35 @@ function nextScheduleRun(schedule, after) {
766
945
  }
767
946
  return next.getTime();
768
947
  }
769
- var appScheduleStateSchema = z9.enum(["active", "paused", "archived"]);
770
- var appScheduleRunSchema = z9.object({
771
- id: z9.string().uuid(),
772
- build: z9.string().uuid(),
773
- startedAt: z9.number(),
774
- scheduledAt: z9.number(),
775
- manual: z9.boolean(),
776
- status: z9.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
777
- duration: z9.number().nullable(),
778
- error: z9.string().nullable()
948
+ var appScheduleStateSchema = z10.enum(["active", "paused", "archived"]);
949
+ var appScheduleRunSchema = z10.object({
950
+ id: z10.string().uuid(),
951
+ build: z10.string().uuid(),
952
+ startedAt: z10.number(),
953
+ scheduledAt: z10.number(),
954
+ manual: z10.boolean(),
955
+ status: z10.enum(["queued", "running", "succeeded", "failed", "uncertain"]),
956
+ duration: z10.number().nullable(),
957
+ error: z10.string().nullable()
779
958
  });
780
- var appScheduleListSchema = z9.object({
959
+ var appScheduleListSchema = z10.object({
781
960
  state: appScheduleStateSchema,
782
- schedules: z9.array(
783
- z9.object({
784
- declaration: z9.union([everySchedule, cronSchedule]),
785
- nextRun: z9.number().nullable(),
786
- blocked: z9.boolean(),
961
+ schedules: z10.array(
962
+ z10.object({
963
+ declaration: z10.union([everySchedule, cronSchedule]),
964
+ nextRun: z10.number().nullable(),
965
+ blocked: z10.boolean(),
787
966
  lastRun: appScheduleRunSchema.nullable()
788
967
  })
789
968
  )
790
969
  });
791
- var scheduledInvocationSchema = z9.object({
792
- id: z9.string().uuid(),
793
- build: z9.string().uuid(),
970
+ var scheduledInvocationSchema = z10.object({
971
+ id: z10.string().uuid(),
972
+ build: z10.string().uuid(),
794
973
  name: appScheduleNameSchema,
795
- scheduledAt: z9.number().int(),
796
- startedAt: z9.number().int(),
797
- manual: z9.boolean()
974
+ scheduledAt: z10.number().int(),
975
+ startedAt: z10.number().int(),
976
+ manual: z10.boolean()
798
977
  }).strict();
799
978
  async function verifyScheduledRequest(request, key) {
800
979
  const signature = request.headers.get("X-Domino-Schedule-Signature");
@@ -859,7 +1038,7 @@ ${body}`)
859
1038
  }
860
1039
 
861
1040
  // src/server/starters.ts
862
- import * as z10 from "zod";
1041
+ import * as z11 from "zod";
863
1042
  var starterTemplates = [
864
1043
  {
865
1044
  id: "campaign",
@@ -892,63 +1071,63 @@ var starterTemplates = [
892
1071
  summary: "A headless Worker with typed routes and interactive API docs, for plugging Domino into your own product."
893
1072
  }
894
1073
  ];
895
- var starterIdSchema = z10.enum(
1074
+ var starterIdSchema = z11.enum(
896
1075
  starterTemplates.map((template) => template.id)
897
1076
  );
898
1077
 
899
1078
  // src/server/hosting.ts
900
- var outputPathSchema = z11.string().min(1).max(512).refine(
1079
+ var outputPathSchema = z12.string().min(1).max(512).refine(
901
1080
  (path) => path.split("/").every(
902
1081
  (part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
903
1082
  ),
904
1083
  "Expected a relative build output path without hidden segments"
905
1084
  );
906
- var appRoutingSchema = z11.enum(["legacy", "transparent"]).default("legacy");
1085
+ var appRoutingSchema = z12.enum(["legacy", "transparent"]).default("legacy");
907
1086
  var APP_SECRET_LIMIT = 50;
908
1087
  var APP_KV_LIMIT = 5;
909
1088
  var APP_SQL_LIMIT = 5;
910
1089
  var APP_MIGRATION_LIMIT = 100;
911
1090
  var APP_MIGRATION_FILE_BYTES = 9e4;
912
1091
  var APP_MIGRATION_TOTAL_BYTES = 1e6;
913
- var appSecretNameSchema = z11.string().regex(
1092
+ var appSecretNameSchema = z12.string().regex(
914
1093
  /^[A-Z_][A-Z0-9_]{0,63}$/,
915
1094
  "Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
916
1095
  ).refine(
917
1096
  (name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
918
1097
  "DOMINO_ names and ASSETS are reserved for Domino's own bindings"
919
1098
  );
920
- var appSecretValueSchema = z11.string().min(1).refine(
1099
+ var appSecretValueSchema = z12.string().min(1).refine(
921
1100
  (value) => new TextEncoder().encode(value).length <= 5120,
922
1101
  "Secret values can be at most 5 KiB"
923
1102
  );
924
- var appSecretInputSchema = z11.object({ value: appSecretValueSchema }).strict();
925
- var appSecretSchema = z11.object({
1103
+ var appSecretInputSchema = z12.object({ value: appSecretValueSchema }).strict();
1104
+ var appSecretSchema = z12.object({
926
1105
  name: appSecretNameSchema,
927
- updatedAt: z11.number(),
928
- updatedBy: z11.string()
1106
+ updatedAt: z12.number(),
1107
+ updatedBy: z12.string()
929
1108
  });
930
- var appSecretDeclarationSchema = z11.object({
931
- description: z11.string().trim().min(1).max(500),
932
- required: z11.boolean().default(true)
1109
+ var appSecretDeclarationSchema = z12.object({
1110
+ description: z12.string().trim().min(1).max(500),
1111
+ required: z12.boolean().default(true)
933
1112
  }).strict();
934
- var appSecretDeclarationsSchema = z11.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
1113
+ var appSecretDeclarationsSchema = z12.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
935
1114
  (secrets) => Object.keys(secrets).length <= APP_SECRET_LIMIT,
936
1115
  `Declare at most ${APP_SECRET_LIMIT} app secrets`
937
1116
  );
938
- var appSecretListSchema = z11.object({
939
- secrets: z11.array(appSecretSchema),
940
- declared: z11.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
1117
+ var appSecretListSchema = z12.object({
1118
+ secrets: z12.array(appSecretSchema),
1119
+ declared: z12.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
941
1120
  });
942
- var hostedAppSecretsSchema = z11.object({ secrets: z11.record(appSecretNameSchema, appSecretValueSchema) }).strict();
943
- var storageDescription = z11.object({
944
- description: z11.string().trim().min(1).max(500)
1121
+ var hostedAppSecretsSchema = z12.object({ secrets: z12.record(appSecretNameSchema, appSecretValueSchema) }).strict();
1122
+ var storageDescription = z12.object({
1123
+ description: z12.string().trim().min(1).max(500)
945
1124
  }).strict();
946
- var appStorageSchema = z11.object({
947
- kv: z11.record(appSecretNameSchema, storageDescription).refine(
1125
+ var appStorageSchema = z12.object({
1126
+ kv: z12.record(appSecretNameSchema, storageDescription).refine(
948
1127
  (stores) => Object.keys(stores).length <= APP_KV_LIMIT,
949
1128
  `Declare at most ${APP_KV_LIMIT} KV stores`
950
1129
  ).default({}),
951
- sql: z11.record(
1130
+ sql: z12.record(
952
1131
  appSecretNameSchema,
953
1132
  storageDescription.extend({
954
1133
  migrations: outputPathSchema.optional()
@@ -958,60 +1137,60 @@ var appStorageSchema = z11.object({
958
1137
  `Declare at most ${APP_SQL_LIMIT} SQL stores`
959
1138
  ).default({})
960
1139
  }).strict();
961
- var appStorageKindSchema = z11.enum(["kv", "sql"]);
962
- var appStorageListSchema = z11.object({
963
- stores: z11.array(
964
- z11.object({
965
- kind: z11.string(),
1140
+ var appStorageKindSchema = z12.enum(["kv", "sql"]);
1141
+ var appStorageListSchema = z12.object({
1142
+ stores: z12.array(
1143
+ z12.object({
1144
+ kind: z12.string(),
966
1145
  name: appSecretNameSchema,
967
- createdAt: z11.number().nullable(),
968
- declared: z11.boolean(),
969
- description: z11.string().optional()
1146
+ createdAt: z12.number().nullable(),
1147
+ declared: z12.boolean(),
1148
+ description: z12.string().optional()
970
1149
  })
971
1150
  )
972
1151
  });
973
1152
  var APP_STORAGE_ROW_LIMIT = 50;
974
1153
  var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
975
- var appStorageCellSchema = z11.union([
976
- z11.string(),
977
- z11.number(),
978
- z11.null(),
979
- z11.object({ text: z11.string(), truncated: z11.literal(true) }),
980
- z11.object({ blob: z11.number().int().min(0) })
1154
+ var appStorageCellSchema = z12.union([
1155
+ z12.string(),
1156
+ z12.number(),
1157
+ z12.null(),
1158
+ z12.object({ text: z12.string(), truncated: z12.literal(true) }),
1159
+ z12.object({ blob: z12.number().int().min(0) })
981
1160
  ]);
982
- var appStorageTablesSchema = z11.object({
983
- tables: z11.array(
1161
+ var appStorageTablesSchema = z12.object({
1162
+ tables: z12.array(
984
1163
  /** `kind` is SQLite's: `table` or `view`. */
985
- z11.object({ name: z11.string(), kind: z11.string() })
1164
+ z12.object({ name: z12.string(), kind: z12.string() })
986
1165
  )
987
1166
  });
988
- var appStorageRowsSchema = z11.object({
989
- table: z11.string(),
990
- columns: z11.array(z11.string()),
991
- rows: z11.array(z11.array(appStorageCellSchema)),
1167
+ var appStorageRowsSchema = z12.object({
1168
+ table: z12.string(),
1169
+ columns: z12.array(z12.string()),
1170
+ rows: z12.array(z12.array(appStorageCellSchema)),
992
1171
  /** How many rows come before this page in storage order. */
993
- offset: z11.number().int().min(0),
994
- total: z11.number().int().min(0),
1172
+ offset: z12.number().int().min(0),
1173
+ total: z12.number().int().min(0),
995
1174
  /** Pass back as `cursor` for the next page; null on the last one. */
996
1175
  nextCursor: pageCursorSchema.nullable().default(null)
997
1176
  });
998
- var appStorageKeysSchema = z11.object({
999
- keys: z11.array(
1000
- z11.object({ name: z11.string(), expiration: z11.number().nullable() })
1177
+ var appStorageKeysSchema = z12.object({
1178
+ keys: z12.array(
1179
+ z12.object({ name: z12.string(), expiration: z12.number().nullable() })
1001
1180
  ),
1002
1181
  /** Pass back as `cursor` for the next page; null on the last one. */
1003
1182
  nextCursor: pageCursorSchema.nullable().default(null),
1004
1183
  /** @deprecated Use `nextCursor`. Removed in 2.0.0. */
1005
- cursor: z11.string().nullable()
1184
+ cursor: z12.string().nullable()
1006
1185
  });
1007
- var appStorageValueSchema = z11.object({
1008
- key: z11.string(),
1009
- size: z11.number().int().min(0),
1186
+ var appStorageValueSchema = z12.object({
1187
+ key: z12.string(),
1188
+ size: z12.number().int().min(0),
1010
1189
  /** Null when the value is not UTF-8 text. */
1011
- text: z11.string().nullable(),
1012
- truncated: z11.boolean()
1190
+ text: z12.string().nullable(),
1191
+ truncated: z12.boolean()
1013
1192
  });
1014
- var appMigrationNameSchema = z11.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
1193
+ var appMigrationNameSchema = z12.string().max(255).regex(/^[\w-][\w.-]*\.sql$/);
1015
1194
  function compareAppMigrations(a, b) {
1016
1195
  const left = Number.parseInt(a.split("_")[0], 10);
1017
1196
  const right = Number.parseInt(b.split("_")[0], 10);
@@ -1028,12 +1207,12 @@ function compareAppMigrations(a, b) {
1028
1207
  }
1029
1208
  return a < b ? -1 : a > b ? 1 : 0;
1030
1209
  }
1031
- var appMigrationsSchema = z11.record(
1210
+ var appMigrationsSchema = z12.record(
1032
1211
  appSecretNameSchema,
1033
- z11.array(
1034
- z11.object({
1212
+ z12.array(
1213
+ z12.object({
1035
1214
  name: appMigrationNameSchema,
1036
- sql: z11.string().min(1).refine(
1215
+ sql: z12.string().min(1).refine(
1037
1216
  (sql) => new TextEncoder().encode(sql).length <= APP_MIGRATION_FILE_BYTES,
1038
1217
  `A migration file must not exceed ${APP_MIGRATION_FILE_BYTES} bytes`
1039
1218
  )
@@ -1051,21 +1230,21 @@ var appMigrationsSchema = z11.record(
1051
1230
  );
1052
1231
  var appScripts = {
1053
1232
  routing: appRoutingSchema,
1054
- devScript: z11.string().regex(/^[\w:-]+$/),
1055
- checkScript: z11.string().regex(/^[\w:-]+$/),
1056
- buildScript: z11.string().regex(/^[\w:-]+$/)
1233
+ devScript: z12.string().regex(/^[\w:-]+$/),
1234
+ checkScript: z12.string().regex(/^[\w:-]+$/),
1235
+ buildScript: z12.string().regex(/^[\w:-]+$/)
1057
1236
  };
1058
1237
  var workerSettings = {
1059
- runWorkerFirst: z11.boolean().default(false),
1238
+ runWorkerFirst: z12.boolean().default(false),
1060
1239
  main: outputPathSchema.refine(
1061
1240
  (path) => /\.m?js$/.test(path),
1062
1241
  "Expected a compiled JavaScript entry"
1063
1242
  ),
1064
- compatibilityDate: z11.string().regex(/^\d{4}-\d{2}-\d{2}$/),
1065
- compatibilityFlags: z11.array(z11.string().min(1)).max(50).default([]),
1066
- vars: z11.record(
1067
- z11.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
1068
- z11.string()
1243
+ compatibilityDate: z12.string().regex(/^\d{4}-\d{2}-\d{2}$/),
1244
+ compatibilityFlags: z12.array(z12.string().min(1)).max(50).default([]),
1245
+ vars: z12.record(
1246
+ z12.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
1247
+ z12.string()
1069
1248
  ).default({}),
1070
1249
  secrets: appSecretDeclarationsSchema.default({}),
1071
1250
  storage: appStorageSchema.optional(),
@@ -1094,62 +1273,62 @@ var distinctBindings = (worker, ctx) => {
1094
1273
  }
1095
1274
  }
1096
1275
  };
1097
- var hostedAppSchema = z11.discriminatedUnion("kind", [
1098
- z11.object({
1099
- kind: z11.literal("static"),
1276
+ var hostedAppSchema = z12.discriminatedUnion("kind", [
1277
+ z12.object({
1278
+ kind: z12.literal("static"),
1100
1279
  directory: outputPathSchema,
1101
1280
  ...appScripts
1102
1281
  }).strict(),
1103
- z11.object({
1104
- kind: z11.literal("worker"),
1282
+ z12.object({
1283
+ kind: z12.literal("worker"),
1105
1284
  directory: outputPathSchema,
1106
1285
  assetsDirectory: outputPathSchema.optional(),
1107
1286
  ...appScripts,
1108
1287
  ...workerSettings
1109
1288
  }).strict().superRefine(distinctBindings)
1110
1289
  ]);
1111
- var repositorySchema = z11.object({
1112
- id: z11.string().uuid(),
1290
+ var repositorySchema = z12.object({
1291
+ id: z12.string().uuid(),
1113
1292
  organization: identifier,
1114
1293
  project: identifier,
1115
- remote: z11.string().url(),
1116
- defaultBranch: z11.string(),
1117
- status: z11.enum(["provisioning", "ready"])
1294
+ remote: z12.string().url(),
1295
+ defaultBranch: z12.string(),
1296
+ status: z12.enum(["provisioning", "ready"])
1118
1297
  });
1119
- var createRepositorySchema = z11.object({
1298
+ var createRepositorySchema = z12.object({
1120
1299
  /** Omitted: the starter chosen at project setup, else `campaign`. */
1121
1300
  starter: starterIdSchema.optional()
1122
1301
  }).strict();
1123
- var deviceStartSchema = z11.object({
1124
- challenge: z11.string().regex(/^[a-f0-9]{64}$/)
1302
+ var deviceStartSchema = z12.object({
1303
+ challenge: z12.string().regex(/^[a-f0-9]{64}$/)
1125
1304
  }).strict();
1126
- var deviceRedeemSchema = z11.object({
1127
- id: z11.string().uuid(),
1128
- verifier: z11.string().min(43).max(128)
1305
+ var deviceRedeemSchema = z12.object({
1306
+ id: z12.string().uuid(),
1307
+ verifier: z12.string().min(43).max(128)
1129
1308
  }).strict();
1130
- var deviceApproveSchema = z11.object({
1131
- id: z11.string().uuid(),
1132
- code: z11.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
1309
+ var deviceApproveSchema = z12.object({
1310
+ id: z12.string().uuid(),
1311
+ code: z12.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
1133
1312
  }).strict();
1134
- var commitSchema = z11.string().regex(/^[a-f0-9]{40}$/);
1135
- var stageRequestSchema = z11.object({
1313
+ var commitSchema = z12.string().regex(/^[a-f0-9]{40}$/);
1314
+ var stageRequestSchema = z12.object({
1136
1315
  commit: commitSchema,
1137
- requestId: z11.string().uuid()
1316
+ requestId: z12.string().uuid()
1138
1317
  }).strict();
1139
- var buildIdentitySchema = z11.object({
1318
+ var buildIdentitySchema = z12.object({
1140
1319
  routing: appRoutingSchema,
1141
- slug: z11.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
1142
- runtime: z11.enum(["simulation", "hosted-test"]).default("simulation"),
1143
- id: z11.string().uuid(),
1144
- repository: z11.string().uuid(),
1320
+ slug: z12.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
1321
+ runtime: z12.enum(["simulation", "hosted-test"]).default("simulation"),
1322
+ id: z12.string().uuid(),
1323
+ repository: z12.string().uuid(),
1145
1324
  organization: identifier,
1146
1325
  project: identifier,
1147
1326
  commit: commitSchema,
1148
- createdAt: z11.number(),
1149
- actor: z11.string(),
1150
- commitMessage: z11.string().max(500).optional()
1327
+ createdAt: z12.number(),
1328
+ actor: z12.string(),
1329
+ commitMessage: z12.string().max(500).optional()
1151
1330
  });
1152
- var buildPhaseSchema = z11.enum([
1331
+ var buildPhaseSchema = z12.enum([
1153
1332
  "queued",
1154
1333
  "source",
1155
1334
  "install",
@@ -1159,72 +1338,72 @@ var buildPhaseSchema = z11.enum([
1159
1338
  "ready",
1160
1339
  "failed"
1161
1340
  ]);
1162
- var buildStatusSchema = z11.object({
1341
+ var buildStatusSchema = z12.object({
1163
1342
  phase: buildPhaseSchema,
1164
1343
  failedPhase: buildPhaseSchema.optional(),
1165
- updatedAt: z11.number(),
1166
- message: z11.string()
1344
+ updatedAt: z12.number(),
1345
+ message: z12.string()
1167
1346
  });
1168
1347
  var hostedBuildSchema = buildIdentitySchema.extend({
1169
1348
  ...buildStatusSchema.shape,
1170
- finished: z11.boolean(),
1171
- current: z11.boolean(),
1172
- stagingUrl: z11.string().url()
1349
+ finished: z12.boolean(),
1350
+ current: z12.boolean(),
1351
+ stagingUrl: z12.string().url()
1173
1352
  });
1174
- var stagingAccessModeSchema = z11.enum(["console", "password"]);
1175
- var stagingAccessSchema = z11.object({ mode: stagingAccessModeSchema });
1176
- var stagingAccessInputSchema = z11.discriminatedUnion("mode", [
1177
- z11.object({ mode: z11.literal("console") }).strict(),
1178
- z11.object({
1179
- mode: z11.literal("password"),
1180
- password: z11.string().min(8).max(128)
1353
+ var stagingAccessModeSchema = z12.enum(["console", "password"]);
1354
+ var stagingAccessSchema = z12.object({ mode: stagingAccessModeSchema });
1355
+ var stagingAccessInputSchema = z12.discriminatedUnion("mode", [
1356
+ z12.object({ mode: z12.literal("console") }).strict(),
1357
+ z12.object({
1358
+ mode: z12.literal("password"),
1359
+ password: z12.string().min(8).max(128)
1181
1360
  }).strict()
1182
1361
  ]);
1183
- var stagingPathSchema = z11.string().max(2048).refine(
1362
+ var stagingPathSchema = z12.string().max(2048).refine(
1184
1363
  (path) => path.startsWith("/") && !path.startsWith("//") && !path.includes("\\"),
1185
1364
  "Expected a path on the staging host"
1186
1365
  );
1187
- var stagingLinkSchema = z11.object({
1188
- url: z11.string().url(),
1189
- expiresAt: z11.number()
1366
+ var stagingLinkSchema = z12.object({
1367
+ url: z12.string().url(),
1368
+ expiresAt: z12.number()
1190
1369
  });
1191
- var buildSnapshotSchema = z11.object({
1192
- builds: z11.array(hostedBuildSchema),
1370
+ var buildSnapshotSchema = z12.object({
1371
+ builds: z12.array(hostedBuildSchema),
1193
1372
  current: hostedBuildSchema.nullable(),
1194
1373
  selected: hostedBuildSchema.nullable(),
1195
- logs: z11.string()
1374
+ logs: z12.string()
1196
1375
  });
1197
- var assetPathSchema = z11.string().max(512).refine(
1376
+ var assetPathSchema = z12.string().max(512).refine(
1198
1377
  (path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
1199
1378
  !/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
1200
1379
  "Expected a public asset path without hidden segments"
1201
1380
  );
1202
- var base64Schema = z11.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
1381
+ var base64Schema = z12.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/);
1203
1382
  var stagedDeploymentLimits = {
1204
1383
  /** Bytes of JSON, uncompressed. */
1205
1384
  size: 64e6,
1206
1385
  /** Bytes of the Brotli-compressed object. */
1207
1386
  compressedSize: 1e7
1208
1387
  };
1209
- var stagedDeploymentSchema = z11.object({
1210
- encoding: z11.literal("br"),
1211
- sha256: z11.string().regex(/^[0-9a-f]{64}$/),
1212
- compressedSize: z11.number().int().positive().max(stagedDeploymentLimits.compressedSize),
1213
- size: z11.number().int().positive().max(stagedDeploymentLimits.size)
1388
+ var stagedDeploymentSchema = z12.object({
1389
+ encoding: z12.literal("br"),
1390
+ sha256: z12.string().regex(/^[0-9a-f]{64}$/),
1391
+ compressedSize: z12.number().int().positive().max(stagedDeploymentLimits.compressedSize),
1392
+ size: z12.number().int().positive().max(stagedDeploymentLimits.size)
1214
1393
  }).strict();
1215
1394
  var stagedDeploymentContentSchema = stagedDeploymentSchema.extend({
1216
- content: z11.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
1395
+ content: z12.string().max(Math.ceil(stagedDeploymentLimits.compressedSize / 3) * 4)
1217
1396
  }).strict();
1218
1397
  var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
1219
1398
  var artifactFields = {
1220
1399
  routing: appRoutingSchema,
1221
- worker: z11.object({
1400
+ worker: z12.object({
1222
1401
  ...workerSettings,
1223
1402
  migrations: appMigrationsSchema.optional(),
1224
- modules: z11.array(
1225
- z11.object({
1403
+ modules: z12.array(
1404
+ z12.object({
1226
1405
  path: outputPathSchema.refine((path) => path !== "metadata"),
1227
- type: z11.enum([
1406
+ type: z12.enum([
1228
1407
  "application/javascript+module",
1229
1408
  "application/wasm",
1230
1409
  "text/plain",
@@ -1234,26 +1413,26 @@ var artifactFields = {
1234
1413
  }).strict()
1235
1414
  ).min(1).max(500)
1236
1415
  }).strict().superRefine(distinctBindings).optional(),
1237
- assets: z11.array(
1238
- z11.object({
1416
+ assets: z12.array(
1417
+ z12.object({
1239
1418
  path: assetPathSchema,
1240
1419
  content: base64Schema.max(14e6),
1241
- size: z11.number().int().min(0).max(1e7)
1420
+ size: z12.number().int().min(0).max(1e7)
1242
1421
  }).strict()
1243
1422
  ).max(500)
1244
1423
  };
1245
- var buildArtifactsSchema = z11.discriminatedUnion("format", [
1246
- z11.object({
1247
- format: z11.literal(1),
1424
+ var buildArtifactsSchema = z12.discriminatedUnion("format", [
1425
+ z12.object({
1426
+ format: z12.literal(1),
1248
1427
  ...artifactFields,
1249
- quests: z11.unknown(),
1250
- catalog: z11.unknown()
1428
+ quests: z12.unknown(),
1429
+ catalog: z12.unknown()
1251
1430
  }).strict(),
1252
- z11.object({
1253
- format: z11.literal(2),
1431
+ z12.object({
1432
+ format: z12.literal(2),
1254
1433
  ...artifactFields,
1255
1434
  deployment: stagedDeploymentSchema,
1256
- images: z11.array(imageAssetArtifactSchema).max(10)
1435
+ images: z12.array(imageAssetArtifactSchema).max(10)
1257
1436
  }).strict()
1258
1437
  ]).superRefine((value, ctx) => {
1259
1438
  if (value.worker) {
@@ -1305,39 +1484,39 @@ var buildArtifactsSchema = z11.discriminatedUnion("format", [
1305
1484
  });
1306
1485
 
1307
1486
  // src/server/development.ts
1308
- import * as z12 from "zod";
1309
- var developmentPreflightSchema = z12.object({
1310
- organization: z12.string(),
1311
- project: z12.string(),
1312
- environment: z12.enum(["test", "live"]),
1313
- identity: z12.object({
1314
- exchange: z12.literal("supported"),
1315
- activeIntegrations: z12.number().int().nonnegative()
1487
+ import * as z13 from "zod";
1488
+ var developmentPreflightSchema = z13.object({
1489
+ organization: z13.string(),
1490
+ project: z13.string(),
1491
+ environment: z13.enum(["test", "live"]),
1492
+ identity: z13.object({
1493
+ exchange: z13.literal("supported"),
1494
+ activeIntegrations: z13.number().int().nonnegative()
1316
1495
  }).optional(),
1317
- staging: z12.enum(["configured", "blocked"]),
1318
- development: z12.object({
1319
- status: z12.enum(["configured", "blocked"]),
1496
+ staging: z13.enum(["configured", "blocked"]),
1497
+ development: z13.object({
1498
+ status: z13.enum(["configured", "blocked"]),
1320
1499
  // How `domino dev` reaches the preview origin: a Cloudflare tunnel, or a direct route on a
1321
1500
  // local development stack. APIs that predate the field use tunnels.
1322
- transport: z12.enum(["tunnel", "direct"]).default("tunnel"),
1323
- missing: z12.array(z12.string()),
1324
- authentication: z12.array(z12.string())
1501
+ transport: z13.enum(["tunnel", "direct"]).default("tunnel"),
1502
+ missing: z13.array(z13.string()),
1503
+ authentication: z13.array(z13.string())
1325
1504
  }),
1326
- checks: z12.array(
1327
- z12.object({
1328
- id: z12.string(),
1329
- status: z12.enum(["ok", "error"]),
1330
- message: z12.string(),
1331
- missing: z12.array(z12.string()).optional(),
1332
- issues: z12.array(z12.string()).optional()
1505
+ checks: z13.array(
1506
+ z13.object({
1507
+ id: z13.string(),
1508
+ status: z13.enum(["ok", "error"]),
1509
+ message: z13.string(),
1510
+ missing: z13.array(z13.string()).optional(),
1511
+ issues: z13.array(z13.string()).optional()
1333
1512
  })
1334
1513
  )
1335
1514
  });
1336
1515
 
1337
1516
  // src/server/hosted.ts
1338
- import * as z13 from "zod";
1517
+ import * as z14 from "zod";
1339
1518
  var hostedKeyPermissions = ["read", "points", "ingest"];
1340
- var hostedKeyPermissionList = z13.array(z13.string()).transform(
1519
+ var hostedKeyPermissionList = z14.array(z14.string()).transform(
1341
1520
  (values) => values.filter(
1342
1521
  (value) => hostedKeyPermissions.includes(value)
1343
1522
  )
@@ -1349,17 +1528,17 @@ var hostedManagementBindings = [
1349
1528
  "DOMINO_PROJECT",
1350
1529
  "DOMINO_ENVIRONMENT"
1351
1530
  ];
1352
- var hostedKeySecretSchema = z13.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
1353
- var hostedKeySchema = z13.object({
1354
- id: z13.string().uuid(),
1531
+ var hostedKeySecretSchema = z14.string().regex(/^dhk_[A-Za-z0-9_-]{43}$/, "Expected a hosted app key");
1532
+ var hostedKeySchema = z14.object({
1533
+ id: z14.string().uuid(),
1355
1534
  token: hostedKeySecretSchema,
1356
1535
  organization: identifier,
1357
1536
  project: identifier,
1358
- environment: z13.enum(["test", "live"]),
1537
+ environment: z14.enum(["test", "live"]),
1359
1538
  permissions: hostedKeyPermissionList,
1360
- expiresAt: z13.number().nullable()
1539
+ expiresAt: z14.number().nullable()
1361
1540
  }).strict();
1362
- var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z13.string().url() }).strict();
1541
+ var hostedDeploymentKeySchema = hostedKeySchema.extend({ apiUrl: z14.string().url() }).strict();
1363
1542
  function hostedManagementClient(env) {
1364
1543
  const missing = hostedManagementBindings.filter((name) => !env[name]);
1365
1544
  if (missing.length) {
@@ -1367,7 +1546,7 @@ function hostedManagementClient(env) {
1367
1546
  `Missing ${missing.join(", ")}. Domino sets these for hosted apps and domino dev; update the project's vite.config.ts to forward them in development.`
1368
1547
  );
1369
1548
  }
1370
- const environment = z13.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
1549
+ const environment = z14.enum(["test", "live"]).parse(env.DOMINO_ENVIRONMENT);
1371
1550
  const token = env.DOMINO_MANAGEMENT_KEY;
1372
1551
  return createManagementClient({
1373
1552
  baseUrl: env.DOMINO_API_URL.replace(/\/+$/, ""),
@@ -1379,9 +1558,9 @@ function hostedManagementClient(env) {
1379
1558
  }
1380
1559
 
1381
1560
  // src/server/index.ts
1382
- var environmentSchema = z14.enum(["test", "live"]);
1383
- var roleSchema = z14.enum(["editor", "reviewer", "staff"]);
1384
- var permissionSchema = z14.enum([
1561
+ var environmentSchema = z15.enum(["test", "live"]);
1562
+ var roleSchema = z15.enum(["editor", "reviewer", "staff"]);
1563
+ var permissionSchema = z15.enum([
1385
1564
  "read",
1386
1565
  "publish",
1387
1566
  "review",
@@ -1401,7 +1580,7 @@ var permissionSchema = z14.enum([
1401
1580
  */
1402
1581
  "enroll"
1403
1582
  ]);
1404
- var permissionListSchema = z14.array(z14.string()).transform(
1583
+ var permissionListSchema = z15.array(z15.string()).transform(
1405
1584
  (values) => values.filter(
1406
1585
  (value) => permissionSchema.safeParse(value).success
1407
1586
  )
@@ -1411,38 +1590,38 @@ var rolePermissions = {
1411
1590
  reviewer: ["read", "review"],
1412
1591
  staff: ["read", "confirm", "handover"]
1413
1592
  };
1414
- var projectSetupSchema = z14.object({
1415
- mode: z14.enum(["new", "existing"]),
1416
- brief: z14.string().trim().min(1).max(4e3)
1593
+ var projectSetupSchema = z15.object({
1594
+ mode: z15.enum(["new", "existing"]),
1595
+ brief: z15.string().trim().min(1).max(4e3)
1417
1596
  }).strict();
1418
- var operatorUserSchema = z14.object({
1419
- id: z14.string(),
1420
- name: z14.string().nullable(),
1421
- email: z14.string().nullable(),
1422
- avatar: z14.string().nullable()
1597
+ var operatorUserSchema = z15.object({
1598
+ id: z15.string(),
1599
+ name: z15.string().nullable(),
1600
+ email: z15.string().nullable(),
1601
+ avatar: z15.string().nullable()
1423
1602
  });
1424
- var projectSchema = z14.object({
1603
+ var projectSchema = z15.object({
1425
1604
  /**
1426
1605
  * Names the project's hosted addresses. The server gives a new project, and accepts in a
1427
1606
  * slug change, only slugs of at least 3 characters that Domino does not reserve. This schema
1428
1607
  * checks only the format, so it parses every slug that exists.
1429
1608
  */
1430
- slug: z14.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
1431
- createdBy: z14.string().nullable().optional(),
1609
+ slug: z15.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
1610
+ createdBy: z15.string().nullable().optional(),
1432
1611
  creator: operatorUserSchema.nullable().optional(),
1433
1612
  /** A response, so fields a newer server adds to the setup are dropped, not rejected. */
1434
- setup: z14.object(projectSetupSchema.shape).optional(),
1613
+ setup: z15.object(projectSetupSchema.shape).optional(),
1435
1614
  /** The starter chosen at setup. A plain string, so later starters still parse. */
1436
- starter: z14.string().optional(),
1437
- id: z14.string().min(1),
1615
+ starter: z15.string().optional(),
1616
+ id: z15.string().min(1),
1438
1617
  organization: identifier,
1439
1618
  project: identifier,
1440
- name: z14.string(),
1441
- subtitle: z14.string(),
1442
- initials: z14.string(),
1443
- color: z14.string(),
1619
+ name: z15.string(),
1620
+ subtitle: z15.string(),
1621
+ initials: z15.string(),
1622
+ color: z15.string(),
1444
1623
  permissions: permissionListSchema,
1445
- environments: z14.array(environmentSchema)
1624
+ environments: z15.array(environmentSchema)
1446
1625
  }).refine(
1447
1626
  (project) => !project.creator || project.creator.id === project.createdBy,
1448
1627
  {
@@ -1450,45 +1629,45 @@ var projectSchema = z14.object({
1450
1629
  path: ["creator"]
1451
1630
  }
1452
1631
  );
1453
- var projectInputSchema = z14.object({
1632
+ var projectInputSchema = z15.object({
1454
1633
  actionId: identifier,
1455
- name: z14.string().trim().min(1).max(80),
1634
+ name: z15.string().trim().min(1).max(80),
1456
1635
  setup: projectSetupSchema.optional(),
1457
1636
  /** The starter a new hosted app begins from, with `setup.mode` "new". */
1458
1637
  starter: starterIdSchema.optional()
1459
1638
  }).strict();
1460
- var projectUpdateInputSchema = z14.union([
1461
- z14.object({ name: projectInputSchema.shape.name }).strict(),
1462
- z14.object({
1639
+ var projectUpdateInputSchema = z15.union([
1640
+ z15.object({ name: projectInputSchema.shape.name }).strict(),
1641
+ z15.object({
1463
1642
  slug: projectSchema.shape.slug,
1464
- confirm: z14.string().min(1).max(80)
1643
+ confirm: z15.string().min(1).max(80)
1465
1644
  }).strict()
1466
1645
  ]);
1467
- var projectDeletionInputSchema = z14.object({ confirm: z14.string().min(1).max(80) }).strict();
1468
- var projectDeletionSchema = z14.object({
1646
+ var projectDeletionInputSchema = z15.object({ confirm: z15.string().min(1).max(80) }).strict();
1647
+ var projectDeletionSchema = z15.object({
1469
1648
  project: identifier,
1470
- purgeAfter: z14.number().int()
1649
+ purgeAfter: z15.number().int()
1471
1650
  });
1472
- var projectTransferInputSchema = z14.object({ organization: identifier, confirm: z14.string().min(1).max(80) }).strict();
1473
- var projectTransferSchema = z14.object({
1651
+ var projectTransferInputSchema = z15.object({ organization: identifier, confirm: z15.string().min(1).max(80) }).strict();
1652
+ var projectTransferSchema = z15.object({
1474
1653
  organization: identifier,
1475
1654
  project: identifier
1476
1655
  });
1477
- var grantSchema = z14.object({
1478
- subject: z14.string().min(1).max(200),
1479
- roles: z14.array(roleSchema),
1480
- environments: z14.array(environmentSchema)
1656
+ var grantSchema = z15.object({
1657
+ subject: z15.string().min(1).max(200),
1658
+ roles: z15.array(roleSchema),
1659
+ environments: z15.array(environmentSchema)
1481
1660
  }).strict();
1482
- var grantRecordSchema = z14.object(grantSchema.shape);
1483
- var stockAdditionSchema = z14.object({
1661
+ var grantRecordSchema = z15.object(grantSchema.shape);
1662
+ var stockAdditionSchema = z15.object({
1484
1663
  item: identifier,
1485
- quantity: z14.number().int(),
1664
+ quantity: z15.number().int(),
1486
1665
  actionId: identifier
1487
1666
  });
1488
- var completionRevokeSchema = z14.object({
1667
+ var completionRevokeSchema = z15.object({
1489
1668
  actionId: identifier,
1490
- reason: z14.string().trim().min(1).max(500),
1491
- freeOccurrence: z14.boolean().default(false)
1669
+ reason: z15.string().trim().min(1).max(500),
1670
+ freeOccurrence: z15.boolean().default(false)
1492
1671
  }).strict();
1493
1672
  var RevokedEntitlementOutcome = {
1494
1673
  /** No other completion grants the reward: it is void, after cancelling a handover in progress. */
@@ -1516,234 +1695,249 @@ var RevokedReferralOutcome = {
1516
1695
  /** Qualified on another accepted completion of the program's quest instead. */
1517
1696
  Requalified: "requalified"
1518
1697
  };
1519
- var entitlementOutcomeSchema = z14.string().min(1).max(64);
1520
- var deliveryOutcomeSchema = z14.string().min(1).max(64);
1521
- var referralOutcomeSchema = z14.string().min(1).max(64);
1522
- var completionRevocationSchema = z14.object({
1698
+ var entitlementOutcomeSchema = z15.string().min(1).max(64);
1699
+ var deliveryOutcomeSchema = z15.string().min(1).max(64);
1700
+ var referralOutcomeSchema = z15.string().min(1).max(64);
1701
+ var completionRevocationSchema = z15.object({
1523
1702
  completion: identifier,
1524
1703
  /** The quest ID, or the board ID when `source.kind` is `leaderboard`. */
1525
1704
  quest: identifier,
1526
1705
  member: identifier,
1527
1706
  /** What paid the revoked completion. `source.id` repeats `quest`. */
1528
1707
  source: completionSourceSchema.optional(),
1529
- revokedAt: z14.number(),
1530
- occurrenceFreed: z14.boolean(),
1531
- badges: z14.array(z14.object({ badge: identifier, stillAwarded: z14.boolean() })).optional(),
1532
- points: z14.array(
1533
- z14.object({
1708
+ revokedAt: z15.number(),
1709
+ occurrenceFreed: z15.boolean(),
1710
+ badges: z15.array(z15.object({ badge: identifier, stillAwarded: z15.boolean() })).optional(),
1711
+ points: z15.array(
1712
+ z15.object({
1534
1713
  entry: identifier,
1535
1714
  balance: identifier,
1536
1715
  reversal: identifier.nullable(),
1537
- reversed: z14.number().int(),
1538
- unreversed: z14.number().int()
1716
+ reversed: z15.number().int(),
1717
+ unreversed: z15.number().int()
1539
1718
  })
1540
1719
  ),
1541
- entitlements: z14.array(
1542
- z14.object({
1720
+ entitlements: z15.array(
1721
+ z15.object({
1543
1722
  entitlement: identifier,
1544
1723
  reward: identifier,
1545
1724
  outcome: entitlementOutcomeSchema,
1546
- status: z14.string()
1725
+ status: z15.string()
1547
1726
  })
1548
1727
  ),
1549
- deliveries: z14.array(
1550
- z14.object({
1551
- delivery: z14.string(),
1552
- roleId: z14.string(),
1728
+ deliveries: z15.array(
1729
+ z15.object({
1730
+ delivery: z15.string(),
1731
+ roleId: z15.string(),
1553
1732
  outcome: deliveryOutcomeSchema,
1554
1733
  /**
1555
1734
  * By Relay's records, another accepted, unrevoked completion of the member also granted this
1556
1735
  * role to the same Discord account and server. Relay does not read Discord's membership.
1557
1736
  */
1558
- stillGranted: z14.boolean()
1737
+ stillGranted: z15.boolean()
1559
1738
  })
1560
1739
  ),
1561
- referrals: z14.array(
1562
- z14.object({
1740
+ referrals: z15.array(
1741
+ z15.object({
1563
1742
  program: identifier,
1564
1743
  outcome: referralOutcomeSchema
1565
1744
  })
1566
1745
  ),
1567
- streakMilestone: z14.boolean()
1746
+ streakMilestone: z15.boolean()
1568
1747
  });
1569
- var accessSchema = z14.object({
1570
- actor: z14.string(),
1571
- organization: z14.string(),
1572
- admin: z14.boolean(),
1573
- local: z14.boolean(),
1574
- projects: z14.array(projectSchema)
1748
+ var accessSchema = z15.object({
1749
+ actor: z15.string(),
1750
+ organization: z15.string(),
1751
+ admin: z15.boolean(),
1752
+ local: z15.boolean(),
1753
+ projects: z15.array(projectSchema)
1575
1754
  });
1576
- var querySchema = z14.object({
1577
- q: z14.string().max(200).default(""),
1578
- filter: z14.string().max(50).default("all"),
1579
- offset: z14.coerce.number().int().min(0).max(1e6).default(0),
1580
- limit: z14.coerce.number().int().min(1).max(100).default(25)
1755
+ var querySchema = z15.object({
1756
+ q: z15.string().max(200).default(""),
1757
+ filter: z15.string().max(50).default("all"),
1758
+ offset: z15.coerce.number().int().min(0).max(1e6).default(0),
1759
+ limit: z15.coerce.number().int().min(1).max(100).default(25)
1581
1760
  });
1582
- var accountProfileSchema = z14.object({
1583
- name: z14.string().optional(),
1761
+ var accountProfileSchema = z15.object({
1762
+ name: z15.string().optional(),
1584
1763
  /** The account's handle, where the provider has one (X and Discord). */
1585
- username: z14.string().optional(),
1586
- email: z14.string().optional(),
1587
- emailVerified: z14.boolean().default(false),
1588
- imageUrl: z14.string().url().optional()
1764
+ username: z15.string().optional(),
1765
+ email: z15.string().optional(),
1766
+ emailVerified: z15.boolean().default(false),
1767
+ imageUrl: z15.string().url().optional()
1589
1768
  });
1590
- var memberAccountSchema = z14.object({
1769
+ var memberAccountSchema = z15.object({
1591
1770
  /** `wallet` for wallet sign-in, `account` for every other connected account. */
1592
- kind: z14.enum(["account", "wallet"]),
1593
- provider: z14.string(),
1594
- subject: z14.string(),
1595
- signInEnabled: z14.boolean(),
1771
+ kind: z15.enum(["account", "wallet"]),
1772
+ provider: z15.string(),
1773
+ subject: z15.string(),
1774
+ signInEnabled: z15.boolean(),
1596
1775
  profile: accountProfileSchema.optional()
1597
1776
  });
1598
- var operationSchema = z14.object({
1599
- target: z14.string(),
1600
- paused: z14.boolean(),
1601
- revision: z14.number().int(),
1602
- reason: z14.string(),
1603
- actor: z14.string().nullable(),
1604
- changedAt: z14.number()
1777
+ var operationSchema = z15.object({
1778
+ target: z15.string(),
1779
+ paused: z15.boolean(),
1780
+ revision: z15.number().int(),
1781
+ reason: z15.string(),
1782
+ actor: z15.string().nullable(),
1783
+ changedAt: z15.number()
1605
1784
  });
1606
- var operationInputSchema = z14.object({
1607
- target: z14.union([
1608
- z14.literal("redemptions"),
1609
- z14.string().regex(/^quest:[\w-]+$/)
1785
+ var operationInputSchema = z15.object({
1786
+ target: z15.union([
1787
+ z15.literal("redemptions"),
1788
+ z15.string().regex(/^quest:[\w-]+$/)
1610
1789
  ]),
1611
- paused: z14.boolean(),
1612
- revision: z14.number().int().nonnegative(),
1613
- reason: z14.string().trim().min(1).max(500),
1790
+ paused: z15.boolean(),
1791
+ revision: z15.number().int().nonnegative(),
1792
+ reason: z15.string().trim().min(1).max(500),
1614
1793
  actionId: identifier
1615
1794
  }).strict();
1616
- var questLifecycleInputSchema = z14.object({
1795
+ var questLifecycleInputSchema = z15.object({
1617
1796
  quest: identifier,
1618
1797
  expectedRelease: identifier.optional(),
1619
- archived: z14.boolean(),
1620
- reason: z14.string().trim().min(1).max(500),
1798
+ archived: z15.boolean(),
1799
+ reason: z15.string().trim().min(1).max(500),
1621
1800
  actionId: identifier
1622
1801
  }).strict();
1623
- var questLifecycleSchema = z14.object({
1802
+ var questLifecycleSchema = z15.object({
1624
1803
  quest: identifier,
1625
1804
  key: identifier.nullable(),
1626
- title: z14.string(),
1805
+ title: z15.string(),
1627
1806
  release: identifier,
1628
- lifecycle: z14.enum(["active", "paused", "archived"]),
1629
- changed: z14.boolean()
1807
+ lifecycle: z15.enum(["active", "paused", "archived"]),
1808
+ changed: z15.boolean()
1630
1809
  });
1631
- var memberSchema = z14.object({
1632
- id: z14.string(),
1633
- test: z14.boolean().optional(),
1634
- name: z14.string().nullable().optional(),
1635
- accounts: z14.array(memberAccountSchema).default([]),
1636
- attempts: z14.number(),
1637
- completions: z14.number(),
1638
- rewards: z14.number(),
1639
- lastActivity: z14.number().nullable()
1810
+ var memberSchema = z15.object({
1811
+ id: z15.string(),
1812
+ test: z15.boolean().optional(),
1813
+ name: z15.string().nullable().optional(),
1814
+ accounts: z15.array(memberAccountSchema).default([]),
1815
+ attempts: z15.number(),
1816
+ completions: z15.number(),
1817
+ rewards: z15.number(),
1818
+ lastActivity: z15.number().nullable()
1640
1819
  });
1641
- var personSchema = z14.object({
1642
- id: z14.string(),
1643
- test: z14.boolean().optional(),
1644
- name: z14.string().nullable().optional(),
1645
- accounts: z14.array(memberAccountSchema).default([])
1820
+ var personSchema = z15.object({
1821
+ id: z15.string(),
1822
+ test: z15.boolean().optional(),
1823
+ name: z15.string().nullable().optional(),
1824
+ accounts: z15.array(memberAccountSchema).default([])
1646
1825
  });
1647
- var metricsSchema = z14.object({
1648
- quests: z14.number(),
1649
- members: z14.number(),
1650
- attempts: z14.number(),
1651
- completions: z14.number(),
1652
- review: z14.number(),
1653
- failed: z14.number(),
1654
- entitlements: z14.number()
1826
+ var metricsSchema = z15.object({
1827
+ quests: z15.number(),
1828
+ members: z15.number(),
1829
+ attempts: z15.number(),
1830
+ completions: z15.number(),
1831
+ review: z15.number(),
1832
+ failed: z15.number(),
1833
+ entitlements: z15.number()
1655
1834
  });
1656
- var readinessSchema = z14.object({
1657
- checks: z14.array(
1658
- z14.object({
1659
- id: z14.string(),
1660
- status: z14.enum(["ready", "blocked"]),
1661
- title: z14.string(),
1662
- detail: z14.string()
1835
+ var readinessSchema = z15.object({
1836
+ checks: z15.array(
1837
+ z15.object({
1838
+ id: z15.string(),
1839
+ status: z15.enum(["ready", "blocked"]),
1840
+ title: z15.string(),
1841
+ detail: z15.string()
1663
1842
  })
1664
1843
  )
1665
1844
  });
1666
- var inventorySchema = z14.object({
1667
- item: z14.string(),
1668
- name: z14.string().nullable().default(null),
1669
- available: z14.number(),
1670
- reserved: z14.number(),
1671
- allocated: z14.number().default(0)
1845
+ var inventorySchema = z15.object({
1846
+ item: z15.string(),
1847
+ name: z15.string().nullable().default(null),
1848
+ available: z15.number(),
1849
+ reserved: z15.number(),
1850
+ allocated: z15.number().default(0)
1672
1851
  });
1673
- var auditRecordSchema = z14.object({
1674
- id: z14.string(),
1675
- action: z14.string(),
1676
- actor: z14.string().nullable(),
1852
+ var auditRecordSchema = z15.object({
1853
+ id: z15.string(),
1854
+ action: z15.string(),
1855
+ actor: z15.string().nullable(),
1677
1856
  user: operatorUserSchema.nullable().optional(),
1678
- detail: z14.string(),
1679
- at: z14.number(),
1680
- attempt: z14.string().nullable()
1857
+ detail: z15.string(),
1858
+ at: z15.number(),
1859
+ attempt: z15.string().nullable()
1681
1860
  }).refine((record4) => !record4.user || record4.user.id === record4.actor, {
1682
1861
  message: "User profile must match the recorded actor",
1683
1862
  path: ["user"]
1684
1863
  });
1685
- var pageSchema = z14.object({
1864
+ var pageSchema = z15.object({
1686
1865
  snapshot: snapshotSchema,
1687
- members: z14.array(memberSchema),
1688
- people: z14.array(personSchema).default([]),
1866
+ members: z15.array(memberSchema),
1867
+ people: z15.array(personSchema).default([]),
1689
1868
  metrics: metricsSchema,
1690
- total: z14.number(),
1691
- offset: z14.number(),
1692
- limit: z14.number(),
1693
- inventory: z14.array(inventorySchema),
1694
- operations: z14.array(operationSchema).default([]),
1695
- audit: z14.array(auditRecordSchema).default([]),
1696
- questCounts: z14.record(z14.string(), z14.number())
1869
+ total: z15.number(),
1870
+ offset: z15.number(),
1871
+ limit: z15.number(),
1872
+ inventory: z15.array(inventorySchema),
1873
+ operations: z15.array(operationSchema).default([]),
1874
+ audit: z15.array(auditRecordSchema).default([]),
1875
+ questCounts: z15.record(z15.string(), z15.number())
1697
1876
  });
1698
- var managedOAuthAccountBaseSchema = z14.object({
1699
- provider: z14.enum(["x", "discord"]),
1700
- revision: z14.number().int().nonnegative()
1877
+ var managedOAuthAccountBaseSchema = z15.object({
1878
+ provider: z15.enum(["x", "discord"]),
1879
+ revision: z15.number().int().nonnegative()
1701
1880
  });
1702
- var managedOAuthAccountSchema = z14.discriminatedUnion("status", [
1881
+ var managedOAuthAccountSchema = z15.discriminatedUnion("status", [
1703
1882
  managedOAuthAccountBaseSchema.extend({
1704
- status: z14.literal("connected"),
1705
- subject: z14.string().min(1),
1706
- linkedAt: z14.number()
1883
+ status: z15.literal("connected"),
1884
+ subject: z15.string().min(1),
1885
+ linkedAt: z15.number(),
1886
+ /**
1887
+ * True when a member import attached the account with the organization's word for it, not the
1888
+ * member's proof. Absent from Relay versions without imports.
1889
+ */
1890
+ imported: z15.boolean().optional()
1707
1891
  }),
1708
- managedOAuthAccountBaseSchema.extend({ status: z14.literal("disconnected") })
1892
+ managedOAuthAccountBaseSchema.extend({ status: z15.literal("disconnected") })
1709
1893
  ]);
1710
1894
  var managedTelegramAccountBaseSchema = managedOAuthAccountBaseSchema.extend({
1711
- provider: z14.literal("telegram")
1895
+ provider: z15.literal("telegram")
1712
1896
  });
1713
- var managedTelegramAccountSchema = z14.discriminatedUnion("status", [
1897
+ var managedTelegramAccountSchema = z15.discriminatedUnion("status", [
1714
1898
  managedTelegramAccountBaseSchema.extend({
1715
- status: z14.literal("connected"),
1899
+ status: z15.literal("connected"),
1716
1900
  /** The numeric Telegram user ID. */
1717
- subject: z14.string().min(1),
1718
- linkedAt: z14.number()
1901
+ subject: z15.string().min(1),
1902
+ linkedAt: z15.number()
1719
1903
  }),
1720
1904
  managedTelegramAccountBaseSchema.extend({
1721
- status: z14.literal("disconnected")
1905
+ status: z15.literal("disconnected")
1722
1906
  })
1723
1907
  ]);
1724
- var memberOAuthUnlinkInputSchema = z14.object({
1725
- provider: z14.enum(["x", "discord"]),
1726
- subject: z14.string().min(1).max(4096),
1727
- revision: z14.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
1728
- reason: z14.string().trim().min(1).max(500)
1908
+ var memberOAuthUnlinkInputSchema = z15.object({
1909
+ provider: z15.enum(["x", "discord"]),
1910
+ subject: z15.string().min(1).max(4096),
1911
+ revision: z15.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER - 1),
1912
+ reason: z15.string().trim().min(1).max(500)
1729
1913
  }).strict();
1730
1914
  var memberTelegramUnlinkInputSchema = memberOAuthUnlinkInputSchema.omit({ provider: true }).strict();
1731
1915
  var managedWalletSchema = linkedWalletSchema.extend({
1732
- status: z14.enum(["linked", "unlinked"]),
1733
- unlinkedAt: z14.number().int().nullable(),
1916
+ /**
1917
+ * True when a member import attached the wallet with the organization's word for it, and the
1918
+ * member has not proved it since. Absent from Relay versions without imports.
1919
+ */
1920
+ imported: z15.boolean().optional(),
1921
+ status: z15.enum(["linked", "unlinked"]),
1922
+ unlinkedAt: z15.number().int().nullable(),
1734
1923
  /** "member", or the operator or key that unlinked it. */
1735
- unlinkedBy: z14.string().nullable()
1924
+ unlinkedBy: z15.string().nullable()
1736
1925
  });
1737
1926
  var managedMemberIdentitySchema = memberIdentitySchema.extend({
1738
- status: z14.enum(["linked", "unlinked"]),
1739
- unlinkedAt: z14.number().int().nullable(),
1927
+ /**
1928
+ * True for an X account a member import attached, until the member links or signs in with it
1929
+ * through X. Absent from Relay versions without imports.
1930
+ */
1931
+ imported: z15.boolean().optional(),
1932
+ status: z15.enum(["linked", "unlinked"]),
1933
+ unlinkedAt: z15.number().int().nullable(),
1740
1934
  /** The operator or key that unlinked it. */
1741
- unlinkedBy: z14.string().nullable()
1935
+ unlinkedBy: z15.string().nullable()
1742
1936
  });
1743
- var memberIdentityChangeInputSchema = z14.object({
1937
+ var memberIdentityChangeInputSchema = z15.object({
1744
1938
  kind: appIdentityKindSchema,
1745
- subject: z14.string().min(1).max(256),
1746
- reason: z14.string().trim().min(1).max(500)
1939
+ subject: z15.string().min(1).max(256),
1940
+ reason: z15.string().trim().min(1).max(500)
1747
1941
  }).strict();
1748
1942
  var balanceCheckSchema = walletBalanceSchema.pick({
1749
1943
  chain: true,
@@ -1753,76 +1947,76 @@ var balanceCheckSchema = walletBalanceSchema.pick({
1753
1947
  wallets: true,
1754
1948
  observedAt: true
1755
1949
  }).extend({ attempt: identifier });
1756
- var walletBalanceChainsSchema = z14.object({
1757
- chains: z14.array(
1758
- z14.object({
1759
- chain: z14.union([
1760
- z14.literal(solanaMainnet),
1950
+ var walletBalanceChainsSchema = z15.object({
1951
+ chains: z15.array(
1952
+ z15.object({
1953
+ chain: z15.union([
1954
+ z15.literal(solanaMainnet),
1761
1955
  cosmosNetworkSchema,
1762
1956
  evmChainIdSchema
1763
1957
  ]),
1764
- name: z14.string(),
1765
- testnet: z14.boolean()
1958
+ name: z15.string(),
1959
+ testnet: z15.boolean()
1766
1960
  })
1767
1961
  )
1768
1962
  });
1769
- var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z14.string().trim().min(1).max(500) }).strict();
1963
+ var memberWalletUnlinkInputSchema = walletUnlinkInputSchema.extend({ reason: z15.string().trim().min(1).max(500) }).strict();
1770
1964
  var memberWalletSignInInputSchema = walletUnlinkInputSchema.extend({
1771
- enabled: z14.boolean(),
1772
- reason: z14.string().trim().min(1).max(500)
1965
+ enabled: z15.boolean(),
1966
+ reason: z15.string().trim().min(1).max(500)
1773
1967
  }).strict();
1774
- var telegramBotIdSchema = z14.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
1775
- var participantSignInSchema = z14.object({
1776
- providers: z14.array(
1777
- z14.object({ provider: authProviderSchema, configured: z14.boolean() })
1968
+ var telegramBotIdSchema = z15.string().regex(/^[1-9][0-9]{0,19}$/, "Enter the bot's numeric ID, such as 123456789");
1969
+ var participantSignInSchema = z15.object({
1970
+ providers: z15.array(
1971
+ z15.object({ provider: authProviderSchema, configured: z15.boolean() })
1778
1972
  ),
1779
- email: z14.boolean(),
1973
+ email: z15.boolean(),
1780
1974
  /** Wallet families: `"solana"`, `"eip155"`, `"cosmos"`. */
1781
1975
  wallets: walletSignInNetworksSchema,
1782
1976
  /** Why participants cannot sign in to this project, or null. */
1783
- issue: z14.string().nullable(),
1977
+ issue: z15.string().nullable(),
1784
1978
  /**
1785
1979
  * Telegram, outside `providers` in SDK 1.x: whether Domino configured Telegram Login, and the
1786
1980
  * bot whose Mini App participants sign in from, or null when Mini App sign-in is off. Absent
1787
1981
  * from Relay versions without Telegram.
1788
1982
  */
1789
- telegram: z14.object({
1790
- login: z14.boolean(),
1983
+ telegram: z15.object({
1984
+ login: z15.boolean(),
1791
1985
  miniAppBotId: telegramBotIdSchema.nullable()
1792
1986
  }).optional(),
1793
- updatedAt: z14.number().nullable(),
1794
- updatedBy: z14.string().nullable()
1987
+ updatedAt: z15.number().nullable(),
1988
+ updatedBy: z15.string().nullable()
1795
1989
  });
1796
- var participantSignInInputSchema = z14.object({
1990
+ var participantSignInInputSchema = z15.object({
1797
1991
  wallets: walletSignInNetworksSchema,
1798
- telegram: z14.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
1992
+ telegram: z15.object({ miniAppBotId: telegramBotIdSchema.nullable() }).strict().optional()
1799
1993
  }).strict();
1800
- var completionRevocationShortfallSchema = z14.object({
1994
+ var completionRevocationShortfallSchema = z15.object({
1801
1995
  completion: identifier,
1802
1996
  quest: identifier,
1803
- revokedAt: z14.number().int().nonnegative().safe(),
1804
- unreversedPoints: z14.record(identifier, z14.number().int().positive().safe())
1997
+ revokedAt: z15.number().int().nonnegative().safe(),
1998
+ unreversedPoints: z15.record(identifier, z15.number().int().positive().safe())
1805
1999
  });
1806
- var memberDetailSchema = z14.object({
2000
+ var memberDetailSchema = z15.object({
1807
2001
  snapshot: snapshotSchema,
1808
2002
  member: memberSchema,
1809
2003
  progress: memberProgressSchema,
1810
2004
  /** Up to 25 revoked completions with an unreversed point remainder, newest first. */
1811
- revocationShortfalls: z14.array(completionRevocationShortfallSchema).default([]),
2005
+ revocationShortfalls: z15.array(completionRevocationShortfallSchema).default([]),
1812
2006
  /** Current and historical campaign enrollment state, including inactive enrollments. */
1813
- campaignEnrollments: z14.array(campaignEnrollmentSchema).default([]),
1814
- passes: z14.array(
1815
- z14.object({
1816
- provider: z14.string(),
1817
- event: z14.string(),
1818
- subject: z14.string(),
2007
+ campaignEnrollments: z15.array(campaignEnrollmentSchema).default([]),
2008
+ passes: z15.array(
2009
+ z15.object({
2010
+ provider: z15.string(),
2011
+ event: z15.string(),
2012
+ subject: z15.string(),
1819
2013
  attempt: identifier.nullable()
1820
2014
  })
1821
2015
  ).default([]),
1822
2016
  /** Linked and unlinked wallets. */
1823
- wallets: z14.array(managedWalletSchema),
2017
+ wallets: z15.array(managedWalletSchema),
1824
2018
  /** The member's 10 most recent recorded balance reads, newest first. */
1825
- balanceChecks: z14.array(balanceCheckSchema),
2019
+ balanceChecks: z15.array(balanceCheckSchema),
1826
2020
  /** The member's participant profile in this project. */
1827
2021
  profile: managedProfileSchema.nullable(),
1828
2022
  /**
@@ -1830,11 +2024,11 @@ var memberDetailSchema = z14.object({
1830
2024
  * member ID: their selected X and Discord accounts and their `app:<name>` identities in this
1831
2025
  * project, including app identities an operator unlinked, by kind.
1832
2026
  */
1833
- identities: z14.array(managedMemberIdentitySchema)
2027
+ identities: z15.array(managedMemberIdentitySchema)
1834
2028
  });
1835
- var managedMemberProgressSchema = z14.object({
2029
+ var managedMemberProgressSchema = z15.object({
1836
2030
  member: identifier,
1837
- quests: z14.array(
2031
+ quests: z15.array(
1838
2032
  memberProgressSchema.shape.quests.element.extend({
1839
2033
  /** The streak as `members.get` reports it, without the list of qualifying days. */
1840
2034
  streak: streakProgressSchema.omit({ days: true }).nullable().optional()
@@ -1845,124 +2039,152 @@ var managedMemberProgressSchema = z14.object({
1845
2039
  /** Each point balance the member has, by balance ID. */
1846
2040
  balances: snapshotSchema.shape.balances
1847
2041
  });
1848
- var stockInputSchema = z14.object({
2042
+ var stockInputSchema = z15.object({
1849
2043
  item: identifier,
1850
- quantity: z14.number().int().positive().max(1e6),
2044
+ quantity: z15.number().int().positive().max(1e6),
1851
2045
  actionId: identifier
1852
2046
  }).strict();
1853
- var ingestTrackerScopeSchema = z14.array(identifier).min(1).max(100).nullable();
1854
- var tokenScopeInputSchema = z14.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
1855
- var tokenInputSchema = z14.object({
1856
- name: z14.string().trim().min(1).max(80),
2047
+ var ingestTrackerScopeSchema = z15.array(identifier).min(1).max(100).nullable();
2048
+ var tokenScopeInputSchema = z15.object({ ingestTrackers: ingestTrackerScopeSchema }).strict();
2049
+ var tokenInputSchema = z15.object({
2050
+ name: z15.string().trim().min(1).max(80),
1857
2051
  project: identifier,
1858
2052
  environment: environmentSchema,
1859
- permissions: z14.array(permissionSchema).min(1),
2053
+ permissions: z15.array(permissionSchema).min(1),
1860
2054
  ingestTrackers: ingestTrackerScopeSchema.optional(),
1861
- days: z14.number().int().min(1).max(90).default(30)
2055
+ days: z15.number().int().min(1).max(90).default(30)
1862
2056
  }).strict();
1863
- var tokenSchema = z14.object({
1864
- id: z14.string(),
1865
- name: z14.string(),
1866
- project: z14.string(),
2057
+ var tokenSchema = z15.object({
2058
+ id: z15.string(),
2059
+ name: z15.string(),
2060
+ project: z15.string(),
1867
2061
  environment: environmentSchema,
1868
2062
  permissions: permissionListSchema,
1869
2063
  ingestTrackers: ingestTrackerScopeSchema.optional(),
1870
- expiresAt: z14.number()
2064
+ expiresAt: z15.number()
2065
+ });
2066
+ var issuedTokenSchema = tokenSchema.extend({ token: z15.string() });
2067
+ var serviceKeyInputSchema = z15.object({
2068
+ name: z15.string().trim().min(1).max(80),
2069
+ permissions: z15.array(permissionSchema).min(1).refine(
2070
+ (permissions) => !permissions.includes("access"),
2071
+ "Service keys cannot hold the access permission"
2072
+ ),
2073
+ /** Days until the first secret expires. Omit it for a key that never expires. */
2074
+ expiresInDays: z15.number().int().min(1).max(3650).optional()
2075
+ }).strict();
2076
+ var serviceKeySchema = z15.object({
2077
+ id: z15.string().uuid(),
2078
+ organization: z15.string(),
2079
+ project: z15.string(),
2080
+ environment: environmentSchema,
2081
+ name: z15.string(),
2082
+ permissions: permissionListSchema,
2083
+ /** The Clerk user ID of the administrator who created it. */
2084
+ createdBy: z15.string(),
2085
+ createdAt: z15.number(),
2086
+ /** The latest use of any of its secrets, revoked ones included; null when none was used. */
2087
+ lastUsedAt: z15.number().nullable(),
2088
+ /** Its working secrets, oldest first. Any of them authenticates the key. */
2089
+ secrets: z15.array(credentialSecretSchema)
2090
+ });
2091
+ var issuedServiceKeySchema = serviceKeySchema.extend({
2092
+ secret: z15.string().uuid(),
2093
+ token: z15.string()
1871
2094
  });
1872
- var issuedTokenSchema = tokenSchema.extend({ token: z14.string() });
1873
- var teamSchema = z14.array(
1874
- z14.object({ id: z14.string(), label: z14.string() })
2095
+ var teamSchema = z15.array(
2096
+ z15.object({ id: z15.string(), label: z15.string() })
1875
2097
  );
1876
- var memberLookupSchema = z14.object({
1877
- provider: z14.string().min(1).max(200),
1878
- subject: z14.string().min(1).max(2048)
2098
+ var memberLookupSchema = z15.object({
2099
+ provider: z15.string().min(1).max(200),
2100
+ subject: z15.string().min(1).max(2048)
1879
2101
  }).strict();
1880
- var booleanQuery = z14.union([
1881
- z14.boolean(),
1882
- z14.enum(["true", "false"]).transform((v) => v === "true")
2102
+ var booleanQuery = z15.union([
2103
+ z15.boolean(),
2104
+ z15.enum(["true", "false"]).transform((v) => v === "true")
1883
2105
  ]);
1884
- var managedMemberQuerySchema = z14.strictObject({
1885
- q: z14.string().max(200).optional(),
2106
+ var managedMemberQuerySchema = z15.strictObject({
2107
+ q: z15.string().max(200).optional(),
1886
2108
  needsReview: booleanQuery.optional(),
1887
- limit: z14.coerce.number().int().min(1).max(100).optional(),
2109
+ limit: z15.coerce.number().int().min(1).max(100).optional(),
1888
2110
  cursor: pageCursorSchema.optional()
1889
2111
  });
1890
- var managedMemberPageSchema = z14.object({
1891
- items: z14.array(memberSchema),
1892
- total: z14.number().int().nonnegative(),
1893
- nextCursor: z14.string().nullable()
2112
+ var managedMemberPageSchema = z15.object({
2113
+ items: z15.array(memberSchema),
2114
+ total: z15.number().int().nonnegative(),
2115
+ nextCursor: z15.string().nullable()
1894
2116
  });
1895
2117
  var projectMetricsSchema = metricsSchema.extend({
1896
- completionsByQuest: z14.array(
1897
- z14.object({ quest: identifier, completions: z14.number() })
2118
+ completionsByQuest: z15.array(
2119
+ z15.object({ quest: identifier, completions: z15.number() })
1898
2120
  )
1899
2121
  });
1900
- var pageLimit = z14.coerce.number().int().min(1).max(100).optional();
1901
- var managedAttemptQuerySchema = z14.strictObject({
1902
- q: z14.string().max(200).optional(),
1903
- status: z14.string().min(1).max(50).optional(),
2122
+ var pageLimit = z15.coerce.number().int().min(1).max(100).optional();
2123
+ var managedAttemptQuerySchema = z15.strictObject({
2124
+ q: z15.string().max(200).optional(),
2125
+ status: z15.string().min(1).max(50).optional(),
1904
2126
  limit: pageLimit,
1905
2127
  cursor: pageCursorSchema.optional()
1906
2128
  });
1907
- var managedAttemptPageSchema = z14.object({
1908
- items: z14.array(attemptSchema),
1909
- releases: z14.array(publishedReleaseSchema),
1910
- people: z14.array(personSchema),
1911
- total: z14.number().int().nonnegative(),
1912
- nextCursor: z14.string().nullable()
2129
+ var managedAttemptPageSchema = z15.object({
2130
+ items: z15.array(attemptSchema),
2131
+ releases: z15.array(publishedReleaseSchema),
2132
+ people: z15.array(personSchema),
2133
+ total: z15.number().int().nonnegative(),
2134
+ nextCursor: z15.string().nullable()
1913
2135
  });
1914
- var managedReleaseQuerySchema = z14.strictObject({
2136
+ var managedReleaseQuerySchema = z15.strictObject({
1915
2137
  quest: identifier.optional(),
1916
2138
  limit: pageLimit,
1917
2139
  cursor: pageCursorSchema.optional()
1918
2140
  });
1919
- var managedReleasePageSchema = z14.object({
1920
- items: z14.array(publishedReleaseSchema),
1921
- nextCursor: z14.string().nullable()
2141
+ var managedReleasePageSchema = z15.object({
2142
+ items: z15.array(publishedReleaseSchema),
2143
+ nextCursor: z15.string().nullable()
1922
2144
  });
1923
- var managedAttemptSchema = z14.object({
2145
+ var managedAttemptSchema = z15.object({
1924
2146
  attempt: attemptSchema,
1925
2147
  release: publishedReleaseSchema.nullable(),
1926
- events: z14.array(eventSchema),
2148
+ events: z15.array(eventSchema),
1927
2149
  person: personSchema
1928
2150
  });
1929
- var managedEntitlementQuerySchema = z14.strictObject({
1930
- q: z14.string().max(200).optional(),
1931
- status: z14.string().min(1).max(50).optional(),
2151
+ var managedEntitlementQuerySchema = z15.strictObject({
2152
+ q: z15.string().max(200).optional(),
2153
+ status: z15.string().min(1).max(50).optional(),
1932
2154
  limit: pageLimit,
1933
2155
  cursor: pageCursorSchema.optional()
1934
2156
  });
1935
- var managedEntitlementPageSchema = z14.object({
1936
- items: z14.array(entitlementSchema),
1937
- people: z14.array(personSchema),
1938
- total: z14.number().int().nonnegative(),
1939
- nextCursor: z14.string().nullable()
2157
+ var managedEntitlementPageSchema = z15.object({
2158
+ items: z15.array(entitlementSchema),
2159
+ people: z15.array(personSchema),
2160
+ total: z15.number().int().nonnegative(),
2161
+ nextCursor: z15.string().nullable()
1940
2162
  });
1941
- var managedEntitlementSchema = z14.object({
2163
+ var managedEntitlementSchema = z15.object({
1942
2164
  entitlement: entitlementSchema,
1943
2165
  person: personSchema
1944
2166
  });
1945
2167
  var managedStockItemSchema = inventorySchema.extend({
1946
- offers: z14.array(identifier)
2168
+ offers: z15.array(identifier)
1947
2169
  });
1948
- var auditQuerySchema = z14.strictObject({
1949
- category: z14.enum(["reviews", "rewards", "configuration"]).optional(),
1950
- q: z14.string().max(200).optional(),
2170
+ var auditQuerySchema = z15.strictObject({
2171
+ category: z15.enum(["reviews", "rewards", "configuration"]).optional(),
2172
+ q: z15.string().max(200).optional(),
1951
2173
  limit: pageLimit,
1952
2174
  cursor: pageCursorSchema.optional()
1953
2175
  });
1954
2176
  var accessHistoryQuerySchema = auditQuerySchema.omit({
1955
2177
  category: true
1956
2178
  });
1957
- var auditPageSchema = z14.object({
1958
- items: z14.array(auditRecordSchema),
1959
- total: z14.number().int().nonnegative(),
1960
- nextCursor: z14.string().nullable()
2179
+ var auditPageSchema = z15.object({
2180
+ items: z15.array(auditRecordSchema),
2181
+ total: z15.number().int().nonnegative(),
2182
+ nextCursor: z15.string().nullable()
1961
2183
  });
1962
- var verifiedPassSchema = z14.object({
2184
+ var verifiedPassSchema = z15.object({
1963
2185
  provider: identifier,
1964
2186
  event: identifier,
1965
- subject: z14.string().min(1).max(2048),
2187
+ subject: z15.string().min(1).max(2048),
1966
2188
  member: identifier,
1967
2189
  quest: identifier
1968
2190
  }).strict();
@@ -1986,7 +2208,7 @@ function clientFailure(error) {
1986
2208
  return new ManagementError({
1987
2209
  kind: "client",
1988
2210
  code: ManagementErrorCode.InvalidInput,
1989
- message: error instanceof z14.ZodError ? `Invalid management request: ${z14.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
2211
+ message: error instanceof z15.ZodError ? `Invalid management request: ${z15.prettifyError(error)}` : error instanceof Error ? error.message : "Invalid management request",
1990
2212
  cause: error
1991
2213
  });
1992
2214
  }
@@ -2024,7 +2246,7 @@ function managementClient(options) {
2024
2246
  call
2025
2247
  );
2026
2248
  }
2027
- const ok = z14.object({ ok: z14.literal(true) });
2249
+ const ok = z15.object({ ok: z15.literal(true) });
2028
2250
  function pointHistory(member, ledger, query = {}, call) {
2029
2251
  return get(
2030
2252
  `/points/${identifier.parse(member)}/${identifier.parse(ledger)}/history${queryString(typeof query === "number" ? { before: query } : pageQuerySchema.parse(query))}`,
@@ -2109,7 +2331,7 @@ function managementClient(options) {
2109
2331
  const input = isInput ? inputOrCall ?? {} : {};
2110
2332
  const options2 = isInput ? call : inputOrCall;
2111
2333
  return post(
2112
- `/webhooks/${z14.string().uuid().parse(id)}/rotate-secret`,
2334
+ `/webhooks/${z15.string().uuid().parse(id)}/rotate-secret`,
2113
2335
  webhookSecretSchema,
2114
2336
  webhookRotateInputSchema.parse(withActionId(input)),
2115
2337
  options2
@@ -2157,8 +2379,8 @@ function managementClient(options) {
2157
2379
  }
2158
2380
  return exchange(
2159
2381
  path,
2160
- z14.object({
2161
- status: z14.number(),
2382
+ z15.object({
2383
+ status: z15.number(),
2162
2384
  operationId: identifier.optional(),
2163
2385
  result: schema
2164
2386
  }),
@@ -2189,7 +2411,7 @@ function managementClient(options) {
2189
2411
  call
2190
2412
  ),
2191
2413
  ...resourceArchiveMethods("tracker"),
2192
- list: (call) => get("/trackers", z14.array(trackerStatusSchema), call),
2414
+ list: (call) => get("/trackers", z15.array(trackerStatusSchema), call),
2193
2415
  get: (reference, call) => get(
2194
2416
  `/trackers/${identifier.parse(reference)}`,
2195
2417
  trackerStatusSchema,
@@ -2305,7 +2527,7 @@ function managementClient(options) {
2305
2527
  engagementPublishSchema.parse(withActionId(input)),
2306
2528
  call
2307
2529
  ),
2308
- list: (call) => get("/engagement", z14.array(engagementRuleSchema), call),
2530
+ list: (call) => get("/engagement", z15.array(engagementRuleSchema), call),
2309
2531
  page: (input, call) => get(
2310
2532
  "/engagement/history" + queryString(engagementPageQuerySchema.parse(input)),
2311
2533
  engagementPageSchema,
@@ -2325,7 +2547,7 @@ function managementClient(options) {
2325
2547
  )
2326
2548
  },
2327
2549
  badges: {
2328
- list: (call) => get("/badges", z14.array(managedBadgeSchema), call),
2550
+ list: (call) => get("/badges", z15.array(managedBadgeSchema), call),
2329
2551
  create: (input, call) => create("/badges", managedBadgeSchema, createBadgeSchema, input, call),
2330
2552
  update: (badge, input, call) => {
2331
2553
  const body = badgePropertiesSchema.extend(badgeMutationSchema.shape).parse(withActionId(input));
@@ -2368,7 +2590,7 @@ function managementClient(options) {
2368
2590
  },
2369
2591
  pointLedgers: {
2370
2592
  unarchive: (ledger, input, call) => archiveResource("point-ledger", ledger, false, input, call),
2371
- list: (call) => get("/point-ledgers", z14.array(managedPointLedgerSchema), call),
2593
+ list: (call) => get("/point-ledgers", z15.array(managedPointLedgerSchema), call),
2372
2594
  /**
2373
2595
  * Creates a point ledger, with a stable `key` when code refers to it; requires `publish`. In
2374
2596
  * live, only a person in Console can create one.
@@ -2398,7 +2620,7 @@ function managementClient(options) {
2398
2620
  },
2399
2621
  points: {
2400
2622
  /** @deprecated Use `pointLedgers.list()`, which reads the same ledgers. Removed in 2.0.0. */
2401
- ledgers: (call) => get("/point-ledgers", z14.array(managedPointLedgerSchema), call),
2623
+ ledgers: (call) => get("/point-ledgers", z15.array(managedPointLedgerSchema), call),
2402
2624
  /** @deprecated Use `pointLedgers.create(input)`. Removed in 2.0.0. */
2403
2625
  createLedger: createPointLedger,
2404
2626
  /**
@@ -2436,7 +2658,7 @@ function managementClient(options) {
2436
2658
  referralHistorySchema,
2437
2659
  call
2438
2660
  ),
2439
- list: (call) => get("/referrals", z14.array(publishedReferralSchema), call),
2661
+ list: (call) => get("/referrals", z15.array(publishedReferralSchema), call),
2440
2662
  participants: referralParticipants,
2441
2663
  /**
2442
2664
  * Suspends or restores a member's referral relationship, with a reason; requires `publish`.
@@ -2499,7 +2721,7 @@ function managementClient(options) {
2499
2721
  },
2500
2722
  leaderboards: {
2501
2723
  ...resourceArchiveMethods("leaderboard"),
2502
- list: (call) => get("/leaderboards", z14.array(publishedLeaderboardSchema), call),
2724
+ list: (call) => get("/leaderboards", z15.array(publishedLeaderboardSchema), call),
2503
2725
  standings: (board, input = {}, call) => {
2504
2726
  const query = leaderboardQuerySchema.parse(input);
2505
2727
  return get(
@@ -2513,13 +2735,13 @@ function managementClient(options) {
2513
2735
  },
2514
2736
  history: (board, call) => get(
2515
2737
  `/leaderboards/${identifier.parse(board)}/history`,
2516
- z14.array(publishedLeaderboardSchema),
2738
+ z15.array(publishedLeaderboardSchema),
2517
2739
  call
2518
2740
  ),
2519
2741
  /** Current members of the board's exclusion group (`exclusionGroup`), by member ID. */
2520
2742
  exclusions: (board, call) => get(
2521
2743
  `/leaderboards/${identifier.parse(board)}/exclusions`,
2522
- z14.array(z14.object({ member: identifier })),
2744
+ z15.array(z15.object({ member: identifier })),
2523
2745
  call
2524
2746
  ),
2525
2747
  /**
@@ -2584,7 +2806,7 @@ function managementClient(options) {
2584
2806
  ),
2585
2807
  settlements: (board, call) => get(
2586
2808
  `/leaderboards/${identifier.parse(board)}/settlements`,
2587
- z14.array(leaderboardSettlementSummarySchema),
2809
+ z15.array(leaderboardSettlementSummarySchema),
2588
2810
  call
2589
2811
  ),
2590
2812
  settlement: (settlement, call) => get(
@@ -2669,7 +2891,7 @@ function managementClient(options) {
2669
2891
  *
2670
2892
  * @deprecated Use `history`, which pages by `cursor` and `nextCursor`. Removed in 2.0.0.
2671
2893
  */
2672
- list: (call) => get("/deployments", z14.array(deploymentRecordSchema), call),
2894
+ list: (call) => get("/deployments", z15.array(deploymentRecordSchema), call),
2673
2895
  /**
2674
2896
  * The project environment's deployments, newest first, one page at a time, with the two
2675
2897
  * newest published deployments beside every page. Pass a page's `nextCursor` back as
@@ -2948,7 +3170,7 @@ function managementClient(options) {
2948
3170
  },
2949
3171
  operations: {
2950
3172
  /** Every paused or resumed operation: redemptions and each quest's participation; requires `read`. */
2951
- list: (call) => get("/operations", z14.array(operationSchema), call),
3173
+ list: (call) => get("/operations", z15.array(operationSchema), call),
2952
3174
  /**
2953
3175
  * Pauses or resumes redemptions or one quest's participation, against the `revision` the
2954
3176
  * operator saw, with a reason; requires `publish` permission.
@@ -3006,7 +3228,7 @@ function managementClient(options) {
3006
3228
  call
3007
3229
  ),
3008
3230
  /** Every stock item with its counts and the offers that sell it; requires `read` permission. */
3009
- list: (call) => get("/stock-items", z14.array(managedStockItemSchema), call),
3231
+ list: (call) => get("/stock-items", z15.array(managedStockItemSchema), call),
3010
3232
  createItem: (input, call) => create(
3011
3233
  "/stock-items",
3012
3234
  stockItemSchema,
@@ -3021,7 +3243,7 @@ function managementClient(options) {
3021
3243
  stockInputSchema.parse(withActionId(input)),
3022
3244
  call
3023
3245
  ),
3024
- catalog: (call) => get("/pickup-inventory", z14.array(pickupCatalogSchema), call),
3246
+ catalog: (call) => get("/pickup-inventory", z15.array(pickupCatalogSchema), call),
3025
3247
  configure: (input, call) => post(
3026
3248
  "/pickup-inventory",
3027
3249
  pickupCatalogSchema,
@@ -3047,7 +3269,7 @@ function managementClient(options) {
3047
3269
  offerControlSchema.omit({ enabled: true }).parse(withActionId(input)),
3048
3270
  call
3049
3271
  ),
3050
- list: (call) => get("/offers", z14.array(offerSchema), call),
3272
+ list: (call) => get("/offers", z15.array(offerSchema), call),
3051
3273
  /**
3052
3274
  * Every redemption, or one member's, newest first, in one unbounded response.
3053
3275
  *
@@ -3055,7 +3277,7 @@ function managementClient(options) {
3055
3277
  */
3056
3278
  redemptions: (input = {}, call) => get(
3057
3279
  `/redemptions${queryString({ member: input.member })}`,
3058
- z14.array(redemptionSchema),
3280
+ z15.array(redemptionSchema),
3059
3281
  call
3060
3282
  ),
3061
3283
  /** Pauses or resumes an offer at the revision the operator saw. */
@@ -3104,7 +3326,7 @@ function managementClient(options) {
3104
3326
  * them; API keys and project-scoped playground sessions cannot.
3105
3327
  */
3106
3328
  tokens: {
3107
- list: (call) => get("/tokens", z14.array(tokenSchema), call),
3329
+ list: (call) => get("/tokens", z15.array(tokenSchema), call),
3108
3330
  /**
3109
3331
  * Issues a key for one project and environment, limited to permissions the caller holds
3110
3332
  * there. The secret `token` is in this response only.
@@ -3112,23 +3334,63 @@ function managementClient(options) {
3112
3334
  create: (input, call) => post("/tokens", issuedTokenSchema, tokenInputSchema.parse(input), call),
3113
3335
  /** Replace a personal key's ingestion restriction without changing its secret. */
3114
3336
  scope: (id, input, call) => request(
3115
- `/tokens/${encodeURIComponent(z14.string().min(1).parse(id))}/scope`,
3337
+ `/tokens/${encodeURIComponent(z15.string().min(1).parse(id))}/scope`,
3116
3338
  tokenSchema,
3117
3339
  tokenScopeInputSchema.parse(input),
3118
3340
  "PUT",
3119
3341
  call
3120
3342
  ),
3121
3343
  revoke: (id, call) => request(
3122
- `/tokens/${encodeURIComponent(z14.string().min(1).parse(id))}`,
3344
+ `/tokens/${encodeURIComponent(z15.string().min(1).parse(id))}`,
3123
3345
  ok,
3124
3346
  void 0,
3125
3347
  "DELETE",
3126
3348
  call
3127
3349
  )
3128
3350
  },
3351
+ /**
3352
+ * Service keys (`dsk_`): credentials for an app's own backend in the selected project and
3353
+ * environment, owned by no person. Only an organization administrator in Console manages them.
3354
+ */
3355
+ serviceKeys: {
3356
+ list: (call) => get("/service-keys", z15.array(serviceKeySchema), call),
3357
+ /** The secret `token` is in this response only. */
3358
+ create: (input, call) => post(
3359
+ "/service-keys",
3360
+ issuedServiceKeySchema,
3361
+ serviceKeyInputSchema.parse(input),
3362
+ call
3363
+ ),
3364
+ /**
3365
+ * Rotation: issues another secret. The key's other secrets keep working until you revoke
3366
+ * them with `revokeSecret`. The new `token` is in this response only.
3367
+ */
3368
+ addSecret: (id, input = {}, call) => post(
3369
+ `/service-keys/${z15.string().uuid().parse(id)}/secrets`,
3370
+ issuedServiceKeySchema,
3371
+ credentialSecretInputSchema.parse(input),
3372
+ call
3373
+ ),
3374
+ /** Stops one secret working. A key's last secret cannot be revoked; revoke the key instead. */
3375
+ revokeSecret: (id, secret, call) => request(
3376
+ `/service-keys/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}`,
3377
+ serviceKeySchema,
3378
+ void 0,
3379
+ "DELETE",
3380
+ call
3381
+ ),
3382
+ /** Deletes the key; every secret stops working. */
3383
+ revoke: (id, call) => request(
3384
+ `/service-keys/${z15.string().uuid().parse(id)}`,
3385
+ z15.null(),
3386
+ void 0,
3387
+ "DELETE",
3388
+ call
3389
+ )
3390
+ },
3129
3391
  /** Who holds which roles on the client's project; organization administrators only. */
3130
3392
  grants: {
3131
- list: (call) => get("/grants", z14.array(grantRecordSchema), call),
3393
+ list: (call) => get("/grants", z15.array(grantRecordSchema), call),
3132
3394
  /** Replaces one person's roles and environments on the project. The audit log records it. */
3133
3395
  set: (input, call) => request(
3134
3396
  "/grants",
@@ -3145,7 +3407,7 @@ function managementClient(options) {
3145
3407
  /** Signed activity notifications for one project/environment; writes require publish permission. */
3146
3408
  webhooks: {
3147
3409
  state: (id, call) => get(
3148
- `/webhooks/${z14.string().uuid().parse(id)}/state`,
3410
+ `/webhooks/${z15.string().uuid().parse(id)}/state`,
3149
3411
  webhookEndpointStateSchema,
3150
3412
  call
3151
3413
  ),
@@ -3156,24 +3418,24 @@ function managementClient(options) {
3156
3418
  call
3157
3419
  ),
3158
3420
  delete: (id, input, call) => post(
3159
- `/webhooks/${z14.string().uuid().parse(id)}/delete`,
3421
+ `/webhooks/${z15.string().uuid().parse(id)}/delete`,
3160
3422
  webhookEndpointStateSchema,
3161
3423
  webhookDeleteInputSchema.parse(withActionId(input)),
3162
3424
  call
3163
3425
  ),
3164
3426
  pause: (id, input = {}, call) => post(
3165
- `/webhooks/${z14.string().uuid().parse(id)}/pause`,
3427
+ `/webhooks/${z15.string().uuid().parse(id)}/pause`,
3166
3428
  webhookEndpointSchema,
3167
3429
  webhookControlInputSchema.parse(withActionId(input)),
3168
3430
  call
3169
3431
  ),
3170
3432
  resume: (id, input = {}, call) => post(
3171
- `/webhooks/${z14.string().uuid().parse(id)}/resume`,
3433
+ `/webhooks/${z15.string().uuid().parse(id)}/resume`,
3172
3434
  webhookEndpointSchema,
3173
3435
  webhookControlInputSchema.parse(withActionId(input)),
3174
3436
  call
3175
3437
  ),
3176
- list: (call) => get("/webhooks", z14.array(webhookEndpointSchema), call),
3438
+ list: (call) => get("/webhooks", z15.array(webhookEndpointSchema), call),
3177
3439
  /** Pass an `actionId` to recover the endpoint and its secret after a lost answer. */
3178
3440
  create: (input, call) => post(
3179
3441
  "/webhooks",
@@ -3182,7 +3444,7 @@ function managementClient(options) {
3182
3444
  call
3183
3445
  ),
3184
3446
  update: (id, input, call) => request(
3185
- `/webhooks/${z14.string().uuid().parse(id)}`,
3447
+ `/webhooks/${z15.string().uuid().parse(id)}`,
3186
3448
  webhookEndpointSchema,
3187
3449
  webhookUpdateSchema.parse(input),
3188
3450
  "PUT",
@@ -3190,19 +3452,19 @@ function managementClient(options) {
3190
3452
  ),
3191
3453
  /** @deprecated Use pause. Removed in 2.0.0. */
3192
3454
  disable: (id, call) => post(
3193
- `/webhooks/${z14.string().uuid().parse(id)}/disable`,
3455
+ `/webhooks/${z15.string().uuid().parse(id)}/disable`,
3194
3456
  webhookEndpointSchema,
3195
3457
  {},
3196
3458
  call
3197
3459
  ),
3198
3460
  rotateSecret: rotateWebhookSecret,
3199
3461
  deliveries: (id, query = {}, call) => get(
3200
- `/webhooks/${z14.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
3462
+ `/webhooks/${z15.string().uuid().parse(id)}/deliveries${queryString(webhookQuerySchema.parse(query))}`,
3201
3463
  webhookDeliveryPageSchema,
3202
3464
  call
3203
3465
  ),
3204
3466
  replay: (id, delivery, call) => post(
3205
- `/webhooks/${z14.string().uuid().parse(id)}/deliveries/${z14.string().uuid().parse(delivery)}/replay`,
3467
+ `/webhooks/${z15.string().uuid().parse(id)}/deliveries/${z15.string().uuid().parse(delivery)}/replay`,
3206
3468
  webhookDeliverySchema,
3207
3469
  {},
3208
3470
  call
@@ -3213,7 +3475,7 @@ function managementClient(options) {
3213
3475
  * environment. Organization administrators, from a Console session only.
3214
3476
  */
3215
3477
  identityIntegrations: {
3216
- list: (call) => get("/identity-integrations", z14.array(identityIntegrationSchema), call),
3478
+ list: (call) => get("/identity-integrations", z15.array(identityIntegrationSchema), call),
3217
3479
  /** The secret `token` is in this response only. */
3218
3480
  create: (input, call) => post(
3219
3481
  "/identity-integrations",
@@ -3221,13 +3483,47 @@ function managementClient(options) {
3221
3483
  identityIntegrationInputSchema.parse(input),
3222
3484
  call
3223
3485
  ),
3224
- /** Replaces the key's secret and extends it by 90 days; the old secret stops working. */
3486
+ /**
3487
+ * Replaces every secret with one new secret that never expires; the old secrets stop working
3488
+ * at once.
3489
+ *
3490
+ * @deprecated Use `addSecret`, then `revokeSecret` the old secret once your app uses the new one.
3491
+ */
3225
3492
  rotate: (id, call) => post(
3226
- `/identity-integrations/${z14.string().uuid().parse(id)}/rotate`,
3493
+ `/identity-integrations/${z15.string().uuid().parse(id)}/rotate`,
3227
3494
  identityIntegrationSecretSchema,
3228
3495
  {},
3229
3496
  call
3230
3497
  ),
3498
+ /**
3499
+ * Rotation: issues another secret. The integration's other secrets keep working until you
3500
+ * revoke them with `revokeSecret`. The new `token` is in this response only.
3501
+ */
3502
+ addSecret: (id, input = {}, call) => post(
3503
+ `/identity-integrations/${z15.string().uuid().parse(id)}/secrets`,
3504
+ identityIntegrationSecretSchema,
3505
+ credentialSecretInputSchema.parse(input),
3506
+ call
3507
+ ),
3508
+ /**
3509
+ * Stops one secret working; member sessions stay signed in. The last secret cannot be
3510
+ * revoked; disconnect the integration with `revoke` instead.
3511
+ */
3512
+ revokeSecret: (id, secret, call) => request(
3513
+ `/identity-integrations/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}`,
3514
+ identityIntegrationSchema,
3515
+ void 0,
3516
+ "DELETE",
3517
+ call
3518
+ ),
3519
+ /** Makes one secret never expire. */
3520
+ removeSecretExpiry: (id, secret, call) => request(
3521
+ `/identity-integrations/${z15.string().uuid().parse(id)}/secrets/${z15.string().uuid().parse(secret)}/expiry`,
3522
+ identityIntegrationSchema,
3523
+ void 0,
3524
+ "DELETE",
3525
+ call
3526
+ ),
3231
3527
  /**
3232
3528
  * The `app:<name>` kinds claimed in the project and environment, each with the integration
3233
3529
  * that owns its identities, connected or not, and how many it has. A new integration reusing
@@ -3235,7 +3531,7 @@ function managementClient(options) {
3235
3531
  */
3236
3532
  kinds: (call) => get(
3237
3533
  "/identity-integrations/kinds",
3238
- z14.array(identityKindClaimSchema),
3534
+ z15.array(identityKindClaimSchema),
3239
3535
  call
3240
3536
  ),
3241
3537
  /**
@@ -3243,8 +3539,8 @@ function managementClient(options) {
3243
3539
  * and keep attributing tracker records; unlink them on the member to stop that.
3244
3540
  */
3245
3541
  revoke: (id, call) => request(
3246
- `/identity-integrations/${z14.string().uuid().parse(id)}`,
3247
- z14.null(),
3542
+ `/identity-integrations/${z15.string().uuid().parse(id)}`,
3543
+ z15.null(),
3248
3544
  void 0,
3249
3545
  "DELETE",
3250
3546
  call
@@ -3295,7 +3591,7 @@ function managementClient(options) {
3295
3591
  resources: {
3296
3592
  list: (call) => get(
3297
3593
  "/resources",
3298
- z14.object({ resources: z14.array(managedResourceSchema) }),
3594
+ z15.object({ resources: z15.array(managedResourceSchema) }),
3299
3595
  call
3300
3596
  ),
3301
3597
  /** @deprecated Use the resource archive/unarchive methods. Removed in 2.0.0. */
@@ -3365,7 +3661,7 @@ function managementClient(options) {
3365
3661
  testMemberCreateSchema.parse(withActionId(input)),
3366
3662
  call
3367
3663
  ),
3368
- list: (call) => get("/test-members", z14.array(testMemberSchema), call),
3664
+ list: (call) => get("/test-members", z15.array(testMemberSchema), call),
3369
3665
  history: (member, query = {}, call) => get(
3370
3666
  `/test-members/${identifier.parse(member)}/history${queryString(testMemberHistoryQuerySchema.parse(query))}`,
3371
3667
  testMemberHistorySchema,
@@ -3408,6 +3704,68 @@ function managementClient(options) {
3408
3704
  call
3409
3705
  )
3410
3706
  },
3707
+ /**
3708
+ * Imports of members, opening point balances and quest progress from another platform into
3709
+ * this project and environment. Add rows, `check` them (the dry run), read the summary and the
3710
+ * refused rows, then `apply`. Checking and applying run in the background: read the import
3711
+ * until its status is `checked` or `applied`. Needs `publish` permission. In live, only a
3712
+ * person signed in to Console applies an import; keys and CLI sessions prepare and check it.
3713
+ */
3714
+ memberImports: {
3715
+ create: (input, call) => post(
3716
+ "/member-imports",
3717
+ memberImportSchema,
3718
+ memberImportCreateSchema.parse(withActionId(input)),
3719
+ call
3720
+ ),
3721
+ list: (query = {}, call) => get(
3722
+ `/member-imports${queryString(memberImportListQuerySchema.parse(query))}`,
3723
+ memberImportPageSchema,
3724
+ call
3725
+ ),
3726
+ get: (id, call) => get(
3727
+ `/member-imports/${identifier.parse(id)}`,
3728
+ memberImportSchema,
3729
+ call
3730
+ ),
3731
+ /** The import's rows in file order, each with its latest check or apply outcome. */
3732
+ rows: (id, query = {}, call) => get(
3733
+ `/member-imports/${identifier.parse(id)}/rows${queryString(memberImportRowQuerySchema.parse(query))}`,
3734
+ memberImportRowPageSchema,
3735
+ call
3736
+ ),
3737
+ /**
3738
+ * Adds up to 500 rows. A row replaces the import's row with the same `ref`, so sending a
3739
+ * batch again changes nothing; a changed row sends a checked import back to `open`.
3740
+ */
3741
+ addRows: (id, rows, call) => post(
3742
+ `/member-imports/${identifier.parse(id)}/rows`,
3743
+ memberImportSchema,
3744
+ memberImportRowsInputSchema.parse({ rows }),
3745
+ call
3746
+ ),
3747
+ /** Starts the dry run: every row is checked against the project, and nothing changes. */
3748
+ check: (id, call) => post(
3749
+ `/member-imports/${identifier.parse(id)}/check`,
3750
+ memberImportSchema,
3751
+ {},
3752
+ call
3753
+ ),
3754
+ /** Applies a checked import's ready rows. Live imports are applied from Console. */
3755
+ apply: (id, call) => post(
3756
+ `/member-imports/${identifier.parse(id)}/apply`,
3757
+ memberImportSchema,
3758
+ {},
3759
+ call
3760
+ ),
3761
+ /** Cancels an open or checked import; nothing it checked is applied. */
3762
+ cancel: (id, call) => post(
3763
+ `/member-imports/${identifier.parse(id)}/cancel`,
3764
+ memberImportSchema,
3765
+ {},
3766
+ call
3767
+ )
3768
+ },
3411
3769
  /** The project's members, as operators see them. */
3412
3770
  members: {
3413
3771
  /**
@@ -3521,7 +3879,7 @@ function managementClient(options) {
3521
3879
  /** Who each member is: up to 100 distinct IDs; unknown IDs come back without accounts. */
3522
3880
  people: (members, call) => get(
3523
3881
  `/people${queryString({ ids: members.join(",") })}`,
3524
- z14.array(personSchema),
3882
+ z15.array(personSchema),
3525
3883
  call
3526
3884
  ),
3527
3885
  /**
@@ -3531,7 +3889,7 @@ function managementClient(options) {
3531
3889
  */
3532
3890
  oauthAccounts: (member, call) => get(
3533
3891
  `/members/${encodeURIComponent(member)}/oauth-accounts`,
3534
- z14.array(managedOAuthAccountSchema),
3892
+ z15.array(managedOAuthAccountSchema),
3535
3893
  call
3536
3894
  ),
3537
3895
  /**
@@ -3541,7 +3899,7 @@ function managementClient(options) {
3541
3899
  */
3542
3900
  unlinkOAuthAccount: (member, input, call) => post(
3543
3901
  `/members/${encodeURIComponent(member)}/oauth-accounts/unlink`,
3544
- z14.array(managedOAuthAccountSchema),
3902
+ z15.array(managedOAuthAccountSchema),
3545
3903
  memberOAuthUnlinkInputSchema.parse(input),
3546
3904
  call
3547
3905
  ),
@@ -3574,7 +3932,7 @@ function managementClient(options) {
3574
3932
  */
3575
3933
  unlinkWallet: (member, input, call) => post(
3576
3934
  `/members/${encodeURIComponent(member)}/wallets/unlink`,
3577
- z14.array(managedWalletSchema),
3935
+ z15.array(managedWalletSchema),
3578
3936
  memberWalletUnlinkInputSchema.parse(input),
3579
3937
  call
3580
3938
  ),
@@ -3587,7 +3945,7 @@ function managementClient(options) {
3587
3945
  */
3588
3946
  unlinkIdentity: (member, input, call) => post(
3589
3947
  `/members/${encodeURIComponent(member)}/identities/unlink`,
3590
- z14.array(managedMemberIdentitySchema),
3948
+ z15.array(managedMemberIdentitySchema),
3591
3949
  memberIdentityChangeInputSchema.parse(input),
3592
3950
  call
3593
3951
  ),
@@ -3598,7 +3956,7 @@ function managementClient(options) {
3598
3956
  */
3599
3957
  relinkIdentity: (member, input, call) => post(
3600
3958
  `/members/${encodeURIComponent(member)}/identities/relink`,
3601
- z14.array(managedMemberIdentitySchema),
3959
+ z15.array(managedMemberIdentitySchema),
3602
3960
  memberIdentityChangeInputSchema.parse(input),
3603
3961
  call
3604
3962
  ),
@@ -3610,7 +3968,7 @@ function managementClient(options) {
3610
3968
  */
3611
3969
  setWalletSignIn: (member, input, call) => post(
3612
3970
  `/members/${encodeURIComponent(member)}/wallets/sign-in`,
3613
- z14.array(managedWalletSchema),
3971
+ z15.array(managedWalletSchema),
3614
3972
  memberWalletSignInInputSchema.parse(input),
3615
3973
  call
3616
3974
  )
@@ -3782,7 +4140,7 @@ function managementClient(options) {
3782
4140
  * Each quest's current release, the most recently published first, archived quests
3783
4141
  * included; requires `read` permission.
3784
4142
  */
3785
- list: (call) => get("/quests/list", z14.array(publishedReleaseSchema), call),
4143
+ list: (call) => get("/quests/list", z15.array(publishedReleaseSchema), call),
3786
4144
  /** Pending and exhausted asynchronous balance checks. Requires read. */
3787
4145
  automaticScheduling: (query = {}, call) => get(
3788
4146
  `/quests/automatic-scheduling${queryString(automaticSchedulingQuerySchema.parse(query))}`,
@@ -3827,7 +4185,7 @@ function managementClient(options) {
3827
4185
  */
3828
4186
  submissions: (member, call) => get(
3829
4187
  `/members/${encodeURIComponent(member)}/quest-submissions`,
3830
- z14.object({ items: z14.array(questSubmissionSchema) }),
4188
+ z15.object({ items: z15.array(questSubmissionSchema) }),
3831
4189
  call
3832
4190
  ),
3833
4191
  /**
@@ -4131,6 +4489,12 @@ var managementResponseSchemas = lazyResponseReaders({
4131
4489
  get issuedTokenSchema() {
4132
4490
  return knownResponse(issuedTokenSchema);
4133
4491
  },
4492
+ get serviceKeySchema() {
4493
+ return knownResponse(serviceKeySchema);
4494
+ },
4495
+ get issuedServiceKeySchema() {
4496
+ return knownResponse(issuedServiceKeySchema);
4497
+ },
4134
4498
  get leaderboardPageSchema() {
4135
4499
  return knownResponse(leaderboardPageSchema);
4136
4500
  },
@@ -4167,6 +4531,15 @@ var managementResponseSchemas = lazyResponseReaders({
4167
4531
  get managedMemberProgressSchema() {
4168
4532
  return knownResponse(managedMemberProgressSchema);
4169
4533
  },
4534
+ get memberImportPageSchema() {
4535
+ return knownResponse(memberImportPageSchema);
4536
+ },
4537
+ get memberImportRowPageSchema() {
4538
+ return knownResponse(memberImportRowPageSchema);
4539
+ },
4540
+ get memberImportSchema() {
4541
+ return knownResponse(memberImportSchema);
4542
+ },
4170
4543
  get managedOAuthAccountSchema() {
4171
4544
  return knownResponse(managedOAuthAccountSchema);
4172
4545
  },
@@ -4440,6 +4813,8 @@ var managementResponses = {
4440
4813
  ),
4441
4814
  identityKindClaimSchema: responseSchema(identityKindClaimSchema),
4442
4815
  issuedTokenSchema: responseSchema(issuedTokenSchema),
4816
+ serviceKeySchema: responseSchema(serviceKeySchema),
4817
+ issuedServiceKeySchema: responseSchema(issuedServiceKeySchema),
4443
4818
  leaderboardPageSchema: responseSchema(leaderboardPageSchema),
4444
4819
  leaderboardSettlementSchema: responseSchema(leaderboardSettlementSchema),
4445
4820
  leaderboardSettlementSummarySchema: responseSchema(
@@ -4454,6 +4829,9 @@ var managementResponses = {
4454
4829
  managedMemberIdentitySchema: responseSchema(managedMemberIdentitySchema),
4455
4830
  managedMemberPageSchema: responseSchema(managedMemberPageSchema),
4456
4831
  managedMemberProgressSchema: responseSchema(managedMemberProgressSchema),
4832
+ memberImportPageSchema: responseSchema(memberImportPageSchema),
4833
+ memberImportRowPageSchema: responseSchema(memberImportRowPageSchema),
4834
+ memberImportSchema: responseSchema(memberImportSchema),
4457
4835
  managedOAuthAccountSchema: responseSchema(managedOAuthAccountSchema),
4458
4836
  managedTelegramAccountSchema: responseSchema(managedTelegramAccountSchema),
4459
4837
  telegramChatsSchema: responseSchema(telegramChatsSchema),
@@ -4538,6 +4916,7 @@ export {
4538
4916
  DEFAULT_MANAGEMENT_TIMEOUT,
4539
4917
  ManagementError,
4540
4918
  ManagementErrorCode,
4919
+ MemberImportRefusalCode,
4541
4920
  PayoutSourceKind,
4542
4921
  REFERRAL_INTEGRATION_REWARD_ERROR,
4543
4922
  RevokedDeliveryOutcome,
@@ -4596,6 +4975,8 @@ export {
4596
4975
  createGroupSchema,
4597
4976
  createManagementClient,
4598
4977
  createRepositorySchema,
4978
+ credentialSecretInputSchema,
4979
+ credentialSecretSchema,
4599
4980
  deploymentActionSchema,
4600
4981
  deploymentRejectionSchema,
4601
4982
  developmentPreflightSchema,
@@ -4636,6 +5017,7 @@ export {
4636
5017
  isIntegrationParticipantPath,
4637
5018
  isManagementError,
4638
5019
  isParticipantRoute,
5020
+ issuedServiceKeySchema,
4639
5021
  issuedTokenSchema,
4640
5022
  leaderboardSettlementRejectionSchema,
4641
5023
  leaderboardSettlementReviewPageSchema,
@@ -4678,6 +5060,20 @@ export {
4678
5060
  memberIdentitySignInInputSchema,
4679
5061
  memberIdentityStatePageSchema,
4680
5062
  memberIdentityStateSchema,
5063
+ memberImportAccountSchema,
5064
+ memberImportActionSchema,
5065
+ memberImportCreateSchema,
5066
+ memberImportIdentitySchema,
5067
+ memberImportListQuerySchema,
5068
+ memberImportPageSchema,
5069
+ memberImportRefusalSchema,
5070
+ memberImportRowPageSchema,
5071
+ memberImportRowQuerySchema,
5072
+ memberImportRowResultSchema,
5073
+ memberImportRowSchema,
5074
+ memberImportRowsInputSchema,
5075
+ memberImportSchema,
5076
+ memberImportSummarySchema,
4681
5077
  memberLookupSchema,
4682
5078
  memberOAuthUnlinkInputSchema,
4683
5079
  memberSchema,
@@ -4732,6 +5128,8 @@ export {
4732
5128
  roleSchema,
4733
5129
  scheduledInvocationSchema,
4734
5130
  sequenceCursorSchema,
5131
+ serviceKeyInputSchema,
5132
+ serviceKeySchema,
4735
5133
  sourceDataSchema,
4736
5134
  sourceRoles,
4737
5135
  stageRequestSchema,