@domino-sdk/relay 1.75.0 → 1.76.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.
@@ -734,60 +734,131 @@ var starterIdSchema = /* @__PURE__ */ (() => z4.enum(
734
734
  starterTemplates.map((template) => template.id)
735
735
  ))();
736
736
 
737
- // src/server/hosting.ts
737
+ // src/server/permissions.ts
738
738
  import * as z5 from "zod";
739
- var outputPathSchema = /* @__PURE__ */ (() => z5.string().min(1).max(512).refine(
739
+ var environmentSchema = /* @__PURE__ */ (() => z5.enum(["test", "live"]))();
740
+ var roleSchema = /* @__PURE__ */ (() => z5.enum(["editor", "reviewer", "staff"]))();
741
+ var permissionSchema = /* @__PURE__ */ (() => z5.enum([
742
+ "read",
743
+ "publish",
744
+ "review",
745
+ "confirm",
746
+ "handover",
747
+ "inventory",
748
+ "access",
749
+ "points",
750
+ /**
751
+ * Custom tracker ingestion only (`trackers.ingest`), such as for an indexer's key. Editors and
752
+ * hosted-app keys hold it.
753
+ */
754
+ "ingest",
755
+ /**
756
+ * Enrolling members from a server (`quests.enroll`), which vouches for their consent. Editors
757
+ * hold it; hosted-app keys do not.
758
+ */
759
+ "enroll"
760
+ ]))();
761
+ var permissionListSchema = /* @__PURE__ */ (() => z5.array(z5.string()).transform(
762
+ (values) => values.filter(
763
+ (value) => permissionSchema.safeParse(value).success
764
+ )
765
+ ))();
766
+ var rolePermissions = {
767
+ editor: ["read", "publish", "inventory", "points", "ingest", "enroll"],
768
+ reviewer: ["read", "review"],
769
+ staff: ["read", "confirm", "handover"]
770
+ };
771
+ var projectRoleSchema = /* @__PURE__ */ (() => z5.enum([...roleSchema.options, "viewer"]))();
772
+ var projectPermissionSchema = /* @__PURE__ */ (() => z5.enum([
773
+ ...permissionSchema.options,
774
+ "dashboards"
775
+ ]))();
776
+ var projectRolePermissions = {
777
+ editor: [...rolePermissions.editor, "dashboards"],
778
+ reviewer: [...rolePermissions.reviewer, "dashboards"],
779
+ staff: [...rolePermissions.staff, "dashboards"],
780
+ viewer: ["dashboards"]
781
+ };
782
+
783
+ // src/server/hosting.ts
784
+ import * as z6 from "zod";
785
+ var outputPathSchema = /* @__PURE__ */ (() => z6.string().min(1).max(512).refine(
740
786
  (path) => path.split("/").every(
741
787
  (part) => /^[\w-][\w.-]*$/.test(part) && part !== "node_modules"
742
788
  ),
743
789
  "Expected a relative build output path without hidden segments"
744
790
  ))();
745
- var appRoutingSchema = /* @__PURE__ */ (() => z5.enum(["legacy", "transparent"]).default("legacy"))();
791
+ var appRoutingSchema = /* @__PURE__ */ (() => z6.enum(["legacy", "transparent"]).default("legacy"))();
746
792
  var APP_SECRET_LIMIT = 50;
747
793
  var APP_KV_LIMIT = 5;
748
794
  var APP_SQL_LIMIT = 5;
749
795
  var APP_MIGRATION_LIMIT = 100;
750
796
  var APP_MIGRATION_FILE_BYTES = 9e4;
751
797
  var APP_MIGRATION_TOTAL_BYTES = 1e6;
752
- var appSecretNameSchema = /* @__PURE__ */ (() => z5.string().regex(
798
+ var appSecretNameSchema = /* @__PURE__ */ (() => z6.string().regex(
753
799
  /^[A-Z_][A-Z0-9_]{0,63}$/,
754
800
  "Use 1-64 uppercase letters, digits, and underscores, not starting with a digit"
755
801
  ).refine(
756
802
  (name) => !name.startsWith("DOMINO_") && name !== "ASSETS",
757
803
  "DOMINO_ names and ASSETS are reserved for Domino's own bindings"
758
804
  ))();
759
- var appSecretValueSchema = /* @__PURE__ */ (() => z5.string().min(1).refine(
805
+ var appSecretValueSchema = /* @__PURE__ */ (() => z6.string().min(1).refine(
760
806
  (value) => new TextEncoder().encode(value).length <= 5120,
761
807
  "Secret values can be at most 5 KiB"
762
808
  ))();
763
- var appSecretInputSchema = /* @__PURE__ */ (() => z5.object({ value: appSecretValueSchema }).strict())();
764
- var appSecretSchema = /* @__PURE__ */ (() => z5.object({
809
+ var appSecretInputSchema = /* @__PURE__ */ (() => z6.object({ value: appSecretValueSchema }).strict())();
810
+ var AppSecretCredentialKind = {
811
+ /** A service key (`dsk_…`). */
812
+ Service: "service"
813
+ };
814
+ var AppSecretCredentialStatus = {
815
+ /** It authenticates in this project and environment. */
816
+ Active: "active",
817
+ /** Its secret has expired; `expiresAt` says when. */
818
+ Expired: "expired",
819
+ /** Domino does not know it in this organization: revoked, mistyped, or another deployment's. */
820
+ Unknown: "unknown",
821
+ /** It belongs to another project or environment of this organization, named in the entry. */
822
+ OtherScope: "other-scope"
823
+ };
824
+ var appSecretCredentialSchema = /* @__PURE__ */ (() => z6.object({
825
+ kind: z6.string(),
826
+ status: z6.string(),
827
+ id: z6.string().optional(),
828
+ name: z6.string().optional(),
829
+ permissions: permissionListSchema.optional(),
830
+ expiresAt: z6.number().nullable().optional(),
831
+ project: z6.string().optional(),
832
+ environment: z6.string().optional()
833
+ }))();
834
+ var appSecretSchema = /* @__PURE__ */ (() => z6.object({
765
835
  name: appSecretNameSchema,
766
- updatedAt: z5.number(),
767
- updatedBy: z5.string()
836
+ updatedAt: z6.number(),
837
+ updatedBy: z6.string(),
838
+ credential: appSecretCredentialSchema.optional()
768
839
  }))();
769
- var appSecretDeclarationSchema = /* @__PURE__ */ (() => z5.object({
770
- description: z5.string().trim().min(1).max(500),
771
- required: z5.boolean().default(true)
840
+ var appSecretDeclarationSchema = /* @__PURE__ */ (() => z6.object({
841
+ description: z6.string().trim().min(1).max(500),
842
+ required: z6.boolean().default(true)
772
843
  }).strict())();
773
- var appSecretDeclarationsSchema = /* @__PURE__ */ (() => z5.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
844
+ var appSecretDeclarationsSchema = /* @__PURE__ */ (() => z6.record(appSecretNameSchema, appSecretDeclarationSchema).refine(
774
845
  (secrets) => Object.keys(secrets).length <= limits.apps.secrets,
775
846
  `Declare at most ${limits.apps.secrets} app secrets`
776
847
  ))();
777
- var appSecretListSchema = /* @__PURE__ */ (() => z5.object({
778
- secrets: z5.array(appSecretSchema),
779
- declared: z5.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
848
+ var appSecretListSchema = /* @__PURE__ */ (() => z6.object({
849
+ secrets: z6.array(appSecretSchema),
850
+ declared: z6.array(appSecretDeclarationSchema.extend({ name: appSecretNameSchema })).default([])
780
851
  }))();
781
- var hostedAppSecretsSchema = /* @__PURE__ */ (() => z5.object({ secrets: z5.record(appSecretNameSchema, appSecretValueSchema) }).strict())();
782
- var storageDescription = /* @__PURE__ */ (() => z5.object({
783
- description: z5.string().trim().min(1).max(500)
852
+ var hostedAppSecretsSchema = /* @__PURE__ */ (() => z6.object({ secrets: z6.record(appSecretNameSchema, appSecretValueSchema) }).strict())();
853
+ var storageDescription = /* @__PURE__ */ (() => z6.object({
854
+ description: z6.string().trim().min(1).max(500)
784
855
  }).strict())();
785
- var appStorageSchema = /* @__PURE__ */ (() => z5.object({
786
- kv: z5.record(appSecretNameSchema, storageDescription).refine(
856
+ var appStorageSchema = /* @__PURE__ */ (() => z6.object({
857
+ kv: z6.record(appSecretNameSchema, storageDescription).refine(
787
858
  (stores) => Object.keys(stores).length <= limits.apps.kvStores,
788
859
  `Declare at most ${limits.apps.kvStores} KV stores`
789
860
  ).default({}),
790
- sql: z5.record(
861
+ sql: z6.record(
791
862
  appSecretNameSchema,
792
863
  storageDescription.extend({
793
864
  migrations: outputPathSchema.optional()
@@ -797,150 +868,150 @@ var appStorageSchema = /* @__PURE__ */ (() => z5.object({
797
868
  `Declare at most ${limits.apps.sqlStores} SQL stores`
798
869
  ).default({})
799
870
  }).strict())();
800
- var appStorageKindSchema = /* @__PURE__ */ (() => z5.enum(["kv", "sql"]))();
801
- var appStorageListSchema = /* @__PURE__ */ (() => z5.object({
802
- stores: z5.array(
803
- z5.object({
804
- kind: z5.string(),
871
+ var appStorageKindSchema = /* @__PURE__ */ (() => z6.enum(["kv", "sql"]))();
872
+ var appStorageListSchema = /* @__PURE__ */ (() => z6.object({
873
+ stores: z6.array(
874
+ z6.object({
875
+ kind: z6.string(),
805
876
  name: appSecretNameSchema,
806
- createdAt: z5.number().nullable(),
807
- declared: z5.boolean(),
808
- description: z5.string().optional()
877
+ createdAt: z6.number().nullable(),
878
+ declared: z6.boolean(),
879
+ description: z6.string().optional()
809
880
  })
810
881
  )
811
882
  }))();
812
883
  var APP_STORAGE_ROW_LIMIT = 50;
813
884
  var APP_STORAGE_PREVIEW_CHARACTERS = 2e3;
814
- var appStorageCellSchema = /* @__PURE__ */ (() => z5.union([
815
- z5.string(),
816
- z5.number(),
817
- z5.null(),
818
- z5.object({ text: z5.string(), truncated: z5.literal(true) }),
819
- z5.object({ blob: z5.number().int().min(0) })
885
+ var appStorageCellSchema = /* @__PURE__ */ (() => z6.union([
886
+ z6.string(),
887
+ z6.number(),
888
+ z6.null(),
889
+ z6.object({ text: z6.string(), truncated: z6.literal(true) }),
890
+ z6.object({ blob: z6.number().int().min(0) })
820
891
  ]))();
821
- var appStorageTablesSchema = /* @__PURE__ */ (() => z5.object({
822
- tables: z5.array(
892
+ var appStorageTablesSchema = /* @__PURE__ */ (() => z6.object({
893
+ tables: z6.array(
823
894
  /** `kind` is SQLite's: `table` or `view`. */
824
- z5.object({ name: z5.string(), kind: z5.string() })
895
+ z6.object({ name: z6.string(), kind: z6.string() })
825
896
  )
826
897
  }))();
827
- var appStorageRowsSchema = /* @__PURE__ */ (() => z5.object({
828
- table: z5.string(),
829
- columns: z5.array(z5.string()),
830
- rows: z5.array(z5.array(appStorageCellSchema)),
898
+ var appStorageRowsSchema = /* @__PURE__ */ (() => z6.object({
899
+ table: z6.string(),
900
+ columns: z6.array(z6.string()),
901
+ rows: z6.array(z6.array(appStorageCellSchema)),
831
902
  /** How many rows come before this page in storage order. */
832
- offset: z5.number().int().min(0),
833
- total: z5.number().int().min(0),
903
+ offset: z6.number().int().min(0),
904
+ total: z6.number().int().min(0),
834
905
  /** Pass back as `cursor` for the next page; null on the last one. */
835
906
  nextCursor: pageCursorSchema.nullable().default(null),
836
907
  /**
837
908
  * The columns a row's key holds: the primary key's, or `rowid` when the table has none. Null
838
909
  * for a view or a table without either. Absent from a Relay older than this field.
839
910
  */
840
- keyColumns: z5.array(z5.string()).nullish(),
911
+ keyColumns: z6.array(z6.string()).nullish(),
841
912
  /**
842
913
  * Each row's key, in `rows` order, to pass to `storage.cell` as `key`, which finds the row
843
914
  * wherever it moves. Null for a row keyed by a BLOB, NULL or a very long value.
844
915
  */
845
- rowKeys: z5.array(z5.string().nullable()).nullish()
916
+ rowKeys: z6.array(z6.string().nullable()).nullish()
846
917
  }))();
847
- var appStorageKeysSchema = /* @__PURE__ */ (() => z5.object({
848
- keys: z5.array(
849
- z5.object({ name: z5.string(), expiration: z5.number().nullable() })
918
+ var appStorageKeysSchema = /* @__PURE__ */ (() => z6.object({
919
+ keys: z6.array(
920
+ z6.object({ name: z6.string(), expiration: z6.number().nullable() })
850
921
  ),
851
922
  /** Pass back as `cursor` for the next page; null on the last one. */
852
923
  nextCursor: pageCursorSchema.nullable().default(null),
853
924
  /** @deprecated Use `nextCursor`. Removed in 2.0.0. */
854
- cursor: z5.string().nullable()
925
+ cursor: z6.string().nullable()
855
926
  }))();
856
- var appStorageValueSchema = /* @__PURE__ */ (() => z5.object({
857
- key: z5.string(),
858
- size: z5.number().int().min(0),
927
+ var appStorageValueSchema = /* @__PURE__ */ (() => z6.object({
928
+ key: z6.string(),
929
+ size: z6.number().int().min(0),
859
930
  /** Null when the value is not UTF-8 text. */
860
- text: z5.string().nullable(),
861
- truncated: z5.boolean()
931
+ text: z6.string().nullable(),
932
+ truncated: z6.boolean()
862
933
  }))();
863
934
  var APP_STORAGE_CELL_CHARACTERS = 1e5;
864
- var appStorageCellPageSchema = /* @__PURE__ */ (() => z5.object({
865
- table: z5.string(),
866
- column: z5.string(),
935
+ var appStorageCellPageSchema = /* @__PURE__ */ (() => z6.object({
936
+ table: z6.string(),
937
+ column: z6.string(),
867
938
  /** The row's position in storage order: a rows page's `offset` plus its index on that page. */
868
- row: z5.number().int().min(0),
939
+ row: z6.number().int().min(0),
869
940
  /** SQLite's storage class. */
870
- type: z5.enum(["text", "integer", "real", "blob", "null"]),
941
+ type: z6.enum(["text", "integer", "real", "blob", "null"]),
871
942
  /** Characters of text, or of a number's text form; bytes of a BLOB; null for NULL. */
872
- length: z5.number().int().min(0).nullable(),
943
+ length: z6.number().int().min(0).nullable(),
873
944
  /** How many characters come before this page. */
874
- offset: z5.number().int().min(0),
945
+ offset: z6.number().int().min(0),
875
946
  /** Up to 100,000 characters from `offset`. Null for a BLOB, whose bytes are never read, and NULL. */
876
- text: z5.string().nullable(),
947
+ text: z6.string().nullable(),
877
948
  /** Pass back as `cursor` for the next page; null on the last one. */
878
949
  nextCursor: pageCursorSchema.nullable().default(null),
879
950
  /**
880
951
  * Changes when the value does: pages whose revisions differ are from different values, so
881
952
  * never join them. Null for a BLOB and NULL; absent from a Relay older than this field.
882
953
  */
883
- revision: z5.string().nullish()
954
+ revision: z6.string().nullish()
884
955
  }))();
885
- var appStorageValueBytesSchema = /* @__PURE__ */ (() => z5.object({
886
- key: z5.string(),
956
+ var appStorageValueBytesSchema = /* @__PURE__ */ (() => z6.object({
957
+ key: z6.string(),
887
958
  /** The whole value's size in bytes. */
888
- size: z5.number().int().min(0),
959
+ size: z6.number().int().min(0),
889
960
  /** How many bytes come before this page. */
890
- offset: z5.number().int().min(0),
961
+ offset: z6.number().int().min(0),
891
962
  /** Up to `limits.apps.storageValueBytes` bytes from `offset`, base64-encoded. */
892
- base64: z5.string(),
963
+ base64: z6.string(),
893
964
  /** Changes when the value does: pages whose revisions differ are from different values. */
894
- revision: z5.string(),
965
+ revision: z6.string(),
895
966
  /** Pass back as `cursor` for the next page; null on the last one. */
896
967
  nextCursor: pageCursorSchema.nullable().default(null)
897
968
  }))();
898
- var storageTableNameSchema = /* @__PURE__ */ (() => z5.string().min(1).max(512))();
899
- var appStorageSqlClearSchema = /* @__PURE__ */ (() => z5.union([
900
- z5.object({
901
- dryRun: z5.boolean().optional(),
902
- tables: z5.array(storageTableNameSchema).min(1).max(50)
969
+ var storageTableNameSchema = /* @__PURE__ */ (() => z6.string().min(1).max(512))();
970
+ var appStorageSqlClearSchema = /* @__PURE__ */ (() => z6.union([
971
+ z6.object({
972
+ dryRun: z6.boolean().optional(),
973
+ tables: z6.array(storageTableNameSchema).min(1).max(50)
903
974
  }).strict(),
904
- z5.object({
905
- dryRun: z5.boolean().optional(),
906
- allTables: z5.literal(true),
907
- keepTables: z5.array(storageTableNameSchema).max(50).optional()
975
+ z6.object({
976
+ dryRun: z6.boolean().optional(),
977
+ allTables: z6.literal(true),
978
+ keepTables: z6.array(storageTableNameSchema).max(50).optional()
908
979
  }).strict()
909
980
  ]))();
910
- var appStorageKvClearSchema = /* @__PURE__ */ (() => z5.union([
911
- z5.object({
912
- dryRun: z5.boolean().optional(),
913
- prefix: z5.string().min(1).max(512)
981
+ var appStorageKvClearSchema = /* @__PURE__ */ (() => z6.union([
982
+ z6.object({
983
+ dryRun: z6.boolean().optional(),
984
+ prefix: z6.string().min(1).max(512)
914
985
  }).strict(),
915
- z5.object({ dryRun: z5.boolean().optional(), all: z5.literal(true) }).strict()
986
+ z6.object({ dryRun: z6.boolean().optional(), all: z6.literal(true) }).strict()
916
987
  ]))();
917
- var appStorageSqlClearResultSchema = /* @__PURE__ */ (() => z5.object({
918
- environment: z5.string(),
919
- kind: z5.literal("sql"),
920
- store: z5.string(),
921
- dryRun: z5.boolean(),
988
+ var appStorageSqlClearResultSchema = /* @__PURE__ */ (() => z6.object({
989
+ environment: z6.string(),
990
+ kind: z6.literal("sql"),
991
+ store: z6.string(),
992
+ dryRun: z6.boolean(),
922
993
  /** Each table cleared, or counted by a dry run, with its row count before the clear. */
923
- tables: z5.array(
924
- z5.object({ name: z5.string(), rows: z5.number().int().min(0) })
994
+ tables: z6.array(
995
+ z6.object({ name: z6.string(), rows: z6.number().int().min(0) })
925
996
  )
926
997
  }))();
927
- var appStorageKvClearResultSchema = /* @__PURE__ */ (() => z5.object({
928
- environment: z5.string(),
929
- kind: z5.literal("kv"),
930
- store: z5.string(),
931
- dryRun: z5.boolean(),
998
+ var appStorageKvClearResultSchema = /* @__PURE__ */ (() => z6.object({
999
+ environment: z6.string(),
1000
+ kind: z6.literal("kv"),
1001
+ store: z6.string(),
1002
+ dryRun: z6.boolean(),
932
1003
  /** Empty when every key was selected. */
933
- prefix: z5.string(),
1004
+ prefix: z6.string(),
934
1005
  /** Keys deleted by this call, or counted by a dry run. */
935
- keys: z5.number().int().min(0),
1006
+ keys: z6.number().int().min(0),
936
1007
  /**
937
1008
  * False when keys remain: a clear deletes at most `limits.apps.storageClearKeys` (10,000) keys a
938
1009
  * call, so call again until it is true. On a dry run, false means `keys` stopped counting at
939
1010
  * `limits.apps.storageClearCountKeys` (100,000).
940
1011
  */
941
- complete: z5.boolean()
1012
+ complete: z6.boolean()
942
1013
  }))();
943
- var appMigrationNameSchema = /* @__PURE__ */ (() => z5.string().max(255).regex(/^[\w-][\w.-]*\.sql$/))();
1014
+ var appMigrationNameSchema = /* @__PURE__ */ (() => z6.string().max(255).regex(/^[\w-][\w.-]*\.sql$/))();
944
1015
  function compareAppMigrations(a, b) {
945
1016
  const left = Number.parseInt(a.split("_")[0], 10);
946
1017
  const right = Number.parseInt(b.split("_")[0], 10);
@@ -957,12 +1028,12 @@ function compareAppMigrations(a, b) {
957
1028
  }
958
1029
  return a < b ? -1 : a > b ? 1 : 0;
959
1030
  }
960
- var appMigrationsSchema = /* @__PURE__ */ (() => z5.record(
1031
+ var appMigrationsSchema = /* @__PURE__ */ (() => z6.record(
961
1032
  appSecretNameSchema,
962
- z5.array(
963
- z5.object({
1033
+ z6.array(
1034
+ z6.object({
964
1035
  name: appMigrationNameSchema,
965
- sql: z5.string().min(1).refine(
1036
+ sql: z6.string().min(1).refine(
966
1037
  (sql) => new TextEncoder().encode(sql).length <= limits.apps.migrationFileBytes,
967
1038
  `A migration file must not exceed ${limits.apps.migrationFileBytes} bytes`
968
1039
  )
@@ -980,21 +1051,21 @@ var appMigrationsSchema = /* @__PURE__ */ (() => z5.record(
980
1051
  ))();
981
1052
  var appScripts = /* @__PURE__ */ (() => ({
982
1053
  routing: appRoutingSchema,
983
- devScript: z5.string().regex(/^[\w:-]+$/),
984
- checkScript: z5.string().regex(/^[\w:-]+$/),
985
- buildScript: z5.string().regex(/^[\w:-]+$/)
1054
+ devScript: z6.string().regex(/^[\w:-]+$/),
1055
+ checkScript: z6.string().regex(/^[\w:-]+$/),
1056
+ buildScript: z6.string().regex(/^[\w:-]+$/)
986
1057
  }))();
987
1058
  var workerSettings = /* @__PURE__ */ (() => ({
988
- runWorkerFirst: z5.boolean().default(false),
1059
+ runWorkerFirst: z6.boolean().default(false),
989
1060
  main: outputPathSchema.refine(
990
1061
  (path) => /\.m?js$/.test(path),
991
1062
  "Expected a compiled JavaScript entry"
992
1063
  ),
993
- compatibilityDate: z5.string().regex(/^\d{4}-\d{2}-\d{2}$/),
994
- compatibilityFlags: z5.array(z5.string().min(1)).max(50).default([]),
995
- vars: z5.record(
996
- z5.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
997
- z5.string()
1064
+ compatibilityDate: z6.string().regex(/^\d{4}-\d{2}-\d{2}$/),
1065
+ compatibilityFlags: z6.array(z6.string().min(1)).max(50).default([]),
1066
+ vars: z6.record(
1067
+ z6.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).refine((name) => name !== "ASSETS"),
1068
+ z6.string()
998
1069
  ).default({}),
999
1070
  secrets: appSecretDeclarationsSchema.default({}),
1000
1071
  storage: appStorageSchema.optional(),
@@ -1023,66 +1094,66 @@ var distinctBindings = (worker, ctx) => {
1023
1094
  }
1024
1095
  }
1025
1096
  };
1026
- var hostedAppSchema = /* @__PURE__ */ (() => z5.discriminatedUnion("kind", [
1027
- z5.object({
1028
- kind: z5.literal("static"),
1097
+ var hostedAppSchema = /* @__PURE__ */ (() => z6.discriminatedUnion("kind", [
1098
+ z6.object({
1099
+ kind: z6.literal("static"),
1029
1100
  directory: outputPathSchema,
1030
1101
  ...appScripts
1031
1102
  }).strict(),
1032
- z5.object({
1033
- kind: z5.literal("worker"),
1103
+ z6.object({
1104
+ kind: z6.literal("worker"),
1034
1105
  directory: outputPathSchema,
1035
1106
  assetsDirectory: outputPathSchema.optional(),
1036
1107
  ...appScripts,
1037
1108
  ...workerSettings
1038
1109
  }).strict().superRefine(distinctBindings)
1039
1110
  ]))();
1040
- var repositorySchema = /* @__PURE__ */ (() => z5.object({
1041
- id: z5.string().uuid(),
1111
+ var repositorySchema = /* @__PURE__ */ (() => z6.object({
1112
+ id: z6.string().uuid(),
1042
1113
  organization: identifier,
1043
1114
  project: identifier,
1044
- remote: z5.string().url(),
1045
- defaultBranch: z5.string(),
1046
- status: z5.enum(["provisioning", "ready"])
1115
+ remote: z6.string().url(),
1116
+ defaultBranch: z6.string(),
1117
+ status: z6.enum(["provisioning", "ready"])
1047
1118
  }))();
1048
- var repositoryCreateSchema = /* @__PURE__ */ (() => z5.object({
1119
+ var repositoryCreateSchema = /* @__PURE__ */ (() => z6.object({
1049
1120
  /** Omitted: the starter chosen at project setup, else `campaign`. */
1050
1121
  starter: offeredStarterSchema.optional()
1051
1122
  }).strict())();
1052
- var createRepositorySchema = /* @__PURE__ */ (() => z5.object({
1123
+ var createRepositorySchema = /* @__PURE__ */ (() => z6.object({
1053
1124
  /** Omitted: the starter chosen at project setup, else `campaign`. */
1054
1125
  starter: starterIdSchema.optional()
1055
1126
  }).strict())();
1056
- var deviceStartSchema = /* @__PURE__ */ (() => z5.object({
1057
- challenge: z5.string().regex(/^[a-f0-9]{64}$/)
1127
+ var deviceStartSchema = /* @__PURE__ */ (() => z6.object({
1128
+ challenge: z6.string().regex(/^[a-f0-9]{64}$/)
1058
1129
  }).strict())();
1059
- var deviceRedeemSchema = /* @__PURE__ */ (() => z5.object({
1060
- id: z5.string().uuid(),
1061
- verifier: z5.string().min(43).max(128)
1130
+ var deviceRedeemSchema = /* @__PURE__ */ (() => z6.object({
1131
+ id: z6.string().uuid(),
1132
+ verifier: z6.string().min(43).max(128)
1062
1133
  }).strict())();
1063
- var deviceApproveSchema = /* @__PURE__ */ (() => z5.object({
1064
- id: z5.string().uuid(),
1065
- code: z5.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
1134
+ var deviceApproveSchema = /* @__PURE__ */ (() => z6.object({
1135
+ id: z6.string().uuid(),
1136
+ code: z6.string().regex(/^[A-F0-9]{4}-[A-F0-9]{4}$/)
1066
1137
  }).strict())();
1067
- var commitSchema = /* @__PURE__ */ (() => z5.string().regex(/^[a-f0-9]{40}$/))();
1068
- var stageRequestSchema = /* @__PURE__ */ (() => z5.object({
1138
+ var commitSchema = /* @__PURE__ */ (() => z6.string().regex(/^[a-f0-9]{40}$/))();
1139
+ var stageRequestSchema = /* @__PURE__ */ (() => z6.object({
1069
1140
  commit: commitSchema,
1070
- requestId: z5.string().uuid()
1141
+ requestId: z6.string().uuid()
1071
1142
  }).strict())();
1072
- var buildIdentitySchema = /* @__PURE__ */ (() => z5.object({
1143
+ var buildIdentitySchema = /* @__PURE__ */ (() => z6.object({
1073
1144
  routing: appRoutingSchema,
1074
- slug: z5.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
1075
- runtime: z5.enum(["simulation", "hosted-test"]).default("simulation"),
1076
- id: z5.string().uuid(),
1077
- repository: z5.string().uuid(),
1145
+ slug: z6.string().min(1).max(35).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/).optional(),
1146
+ runtime: z6.enum(["simulation", "hosted-test"]).default("simulation"),
1147
+ id: z6.string().uuid(),
1148
+ repository: z6.string().uuid(),
1078
1149
  organization: identifier,
1079
1150
  project: identifier,
1080
1151
  commit: commitSchema,
1081
- createdAt: z5.number(),
1082
- actor: z5.string(),
1083
- commitMessage: z5.string().max(500).optional()
1152
+ createdAt: z6.number(),
1153
+ actor: z6.string(),
1154
+ commitMessage: z6.string().max(500).optional()
1084
1155
  }))();
1085
- var buildPhaseSchema = /* @__PURE__ */ (() => z5.enum([
1156
+ var buildPhaseSchema = /* @__PURE__ */ (() => z6.enum([
1086
1157
  "queued",
1087
1158
  "source",
1088
1159
  "install",
@@ -1092,81 +1163,81 @@ var buildPhaseSchema = /* @__PURE__ */ (() => z5.enum([
1092
1163
  "ready",
1093
1164
  "failed"
1094
1165
  ]))();
1095
- var buildStatusSchema = /* @__PURE__ */ (() => z5.object({
1166
+ var buildStatusSchema = /* @__PURE__ */ (() => z6.object({
1096
1167
  phase: buildPhaseSchema,
1097
1168
  failedPhase: buildPhaseSchema.optional(),
1098
- updatedAt: z5.number(),
1099
- message: z5.string()
1169
+ updatedAt: z6.number(),
1170
+ message: z6.string()
1100
1171
  }))();
1101
1172
  var hostedBuildSchema = /* @__PURE__ */ (() => buildIdentitySchema.extend({
1102
1173
  ...buildStatusSchema.shape,
1103
- finished: z5.boolean(),
1104
- current: z5.boolean(),
1105
- stagingUrl: z5.string().url(),
1174
+ finished: z6.boolean(),
1175
+ current: z6.boolean(),
1176
+ stagingUrl: z6.string().url(),
1106
1177
  /**
1107
1178
  * The test deployment the build published from its quest artifacts when it activated, readable
1108
1179
  * with `GET /deployments/{id}`; null until it activates. A build whose bundle declares no
1109
1180
  * resources publishes none, so its ID is not found. Only `GET /builds/{id}` includes it.
1110
1181
  */
1111
- deployment: z5.string().nullable().optional()
1182
+ deployment: z6.string().nullable().optional()
1112
1183
  }))();
1113
- var liveAppSchema = /* @__PURE__ */ (() => z5.object({
1114
- url: z5.string().url().nullable(),
1115
- state: z5.enum(["none", "deploying", "live", "failed"]),
1184
+ var liveAppSchema = /* @__PURE__ */ (() => z6.object({
1185
+ url: z6.string().url().nullable(),
1186
+ state: z6.enum(["none", "deploying", "live", "failed"]),
1116
1187
  /** The build the address serves, or null before the first one goes live. */
1117
- build: z5.string().uuid().nullable(),
1188
+ build: z6.string().uuid().nullable(),
1118
1189
  /** The build the last approved promotion asked for, while it differs from `build`. */
1119
- requested: z5.string().uuid().nullable(),
1120
- failure: z5.string().nullable()
1190
+ requested: z6.string().uuid().nullable(),
1191
+ failure: z6.string().nullable()
1121
1192
  }))();
1122
- var customDomainStateSchema = /* @__PURE__ */ (() => z5.enum([
1193
+ var customDomainStateSchema = /* @__PURE__ */ (() => z6.enum([
1123
1194
  "awaiting-dns",
1124
1195
  "provisioning",
1125
1196
  "active",
1126
1197
  "attention",
1127
1198
  "suspended"
1128
1199
  ]))();
1129
- var customDomainRecordSchema = /* @__PURE__ */ (() => z5.object({
1130
- type: z5.enum(["CNAME", "TXT"]),
1131
- name: z5.string(),
1132
- value: z5.string(),
1200
+ var customDomainRecordSchema = /* @__PURE__ */ (() => z6.object({
1201
+ type: z6.enum(["CNAME", "TXT"]),
1202
+ name: z6.string(),
1203
+ value: z6.string(),
1133
1204
  /** The values public DNS returned: empty when it had none, null before Domino looked. */
1134
- found: z5.array(z5.string()).nullable(),
1135
- matches: z5.boolean()
1205
+ found: z6.array(z6.string()).nullable(),
1206
+ matches: z6.boolean()
1136
1207
  }))();
1137
- var domainTimeMs = /* @__PURE__ */ (() => z5.number().int().nonnegative().nullish())();
1138
- var customDomainSchema = /* @__PURE__ */ (() => z5.object({
1139
- id: z5.string().uuid(),
1140
- hostname: z5.string(),
1141
- url: z5.string().url(),
1208
+ var domainTimeMs = /* @__PURE__ */ (() => z6.number().int().nonnegative().nullish())();
1209
+ var customDomainSchema = /* @__PURE__ */ (() => z6.object({
1210
+ id: z6.string().uuid(),
1211
+ hostname: z6.string(),
1212
+ url: z6.string().url(),
1142
1213
  state: customDomainStateSchema,
1143
1214
  /** What to fix, in plain words, while the domain needs attention or is suspended. */
1144
- issue: z5.object({ code: z5.string(), message: z5.string() }).nullable(),
1145
- records: z5.array(customDomainRecordSchema),
1215
+ issue: z6.object({ code: z6.string(), message: z6.string() }).nullable(),
1216
+ records: z6.array(customDomainRecordSchema),
1146
1217
  /** Cloudflare's statuses and errors in its own words, once the domain is proven. */
1147
- cloudflare: z5.object({
1148
- hostnameStatus: z5.string(),
1149
- certificateStatus: z5.string().nullable(),
1150
- validationErrors: z5.array(z5.string()),
1151
- verificationErrors: z5.array(z5.string()),
1152
- certificateExpiresAt: z5.string().nullable(),
1218
+ cloudflare: z6.object({
1219
+ hostnameStatus: z6.string(),
1220
+ certificateStatus: z6.string().nullable(),
1221
+ validationErrors: z6.array(z6.string()),
1222
+ verificationErrors: z6.array(z6.string()),
1223
+ certificateExpiresAt: z6.string().nullable(),
1153
1224
  certificateExpiresAtMs: domainTimeMs
1154
1225
  }).nullable(),
1155
- checkedAt: z5.string().nullable(),
1226
+ checkedAt: z6.string().nullable(),
1156
1227
  checkedAtMs: domainTimeMs,
1157
- nextCheckAt: z5.string().nullable(),
1228
+ nextCheckAt: z6.string().nullable(),
1158
1229
  nextCheckAtMs: domainTimeMs,
1159
- createdAt: z5.string(),
1160
- createdAtMs: z5.number().int().nonnegative().optional()
1230
+ createdAt: z6.string(),
1231
+ createdAtMs: z6.number().int().nonnegative().optional()
1161
1232
  }))();
1162
- var customDomainListSchema = /* @__PURE__ */ (() => z5.object({
1163
- domains: z5.array(customDomainSchema)
1233
+ var customDomainListSchema = /* @__PURE__ */ (() => z6.object({
1234
+ domains: z6.array(customDomainSchema)
1164
1235
  }))();
1165
- var customDomainInputSchema = /* @__PURE__ */ (() => z5.object({ hostname: z5.string().min(1).max(300) }).strict())();
1166
- var stagingAccessModeSchema = /* @__PURE__ */ (() => z5.enum(["console", "password"]))();
1236
+ var customDomainInputSchema = /* @__PURE__ */ (() => z6.object({ hostname: z6.string().min(1).max(300) }).strict())();
1237
+ var stagingAccessModeSchema = /* @__PURE__ */ (() => z6.enum(["console", "password"]))();
1167
1238
  var stagingOrigin = "https://staging.invalid";
1168
1239
  var reservedStagingPaths = ["/__domino", "/relay", "/.well-known"];
1169
- var stagingServerPathSchema = /* @__PURE__ */ (() => z5.string().max(200).refine((path) => {
1240
+ var stagingServerPathSchema = /* @__PURE__ */ (() => z6.string().max(200).refine((path) => {
1170
1241
  if (!path.startsWith("/") || path.startsWith("//") || /[\\?#]/.test(path) || // oxlint-disable-next-line no-control-regex
1171
1242
  /[\u0000-\u0020\u007f]/.test(path)) {
1172
1243
  return false;
@@ -1182,10 +1253,10 @@ var stagingServerPathSchema = /* @__PURE__ */ (() => z5.string().max(200).refine
1182
1253
  ),
1183
1254
  "Server paths cannot be / or cover /__domino, /relay or /.well-known"
1184
1255
  ))();
1185
- var stagingServerAccessSchema = /* @__PURE__ */ (() => z5.object({
1186
- paths: z5.array(z5.string())
1256
+ var stagingServerAccessSchema = /* @__PURE__ */ (() => z6.object({
1257
+ paths: z6.array(z6.string())
1187
1258
  }))();
1188
- var stagingAccessSchema = /* @__PURE__ */ (() => z5.object({
1259
+ var stagingAccessSchema = /* @__PURE__ */ (() => z6.object({
1189
1260
  mode: stagingAccessModeSchema,
1190
1261
  /**
1191
1262
  * Paths servers may call with a staging server key. Absent from older servers, which means off.
@@ -1194,48 +1265,48 @@ var stagingAccessSchema = /* @__PURE__ */ (() => z5.object({
1194
1265
  */
1195
1266
  server: stagingServerAccessSchema.optional()
1196
1267
  }))();
1197
- var stagingServerAccessInputSchema = /* @__PURE__ */ (() => z5.object({
1268
+ var stagingServerAccessInputSchema = /* @__PURE__ */ (() => z6.object({
1198
1269
  // Each request on a server path is checked against every prefix; an app needs a few.
1199
- paths: z5.array(stagingServerPathSchema).max(20).refine(
1270
+ paths: z6.array(stagingServerPathSchema).max(20).refine(
1200
1271
  (paths) => new Set(paths).size === paths.length,
1201
1272
  "Each server path can be listed once"
1202
1273
  )
1203
1274
  }).strict())();
1204
- var stagingAccessInputSchema = /* @__PURE__ */ (() => z5.discriminatedUnion("mode", [
1205
- z5.object({ mode: z5.literal("console") }).strict(),
1206
- z5.object({
1207
- mode: z5.literal("password"),
1208
- password: z5.string().min(8).max(128)
1275
+ var stagingAccessInputSchema = /* @__PURE__ */ (() => z6.discriminatedUnion("mode", [
1276
+ z6.object({ mode: z6.literal("console") }).strict(),
1277
+ z6.object({
1278
+ mode: z6.literal("password"),
1279
+ password: z6.string().min(8).max(128)
1209
1280
  }).strict()
1210
1281
  ]))();
1211
- var stagingAccessChangeSchema = /* @__PURE__ */ (() => z5.union([
1212
- z5.object({
1213
- mode: z5.literal("console"),
1282
+ var stagingAccessChangeSchema = /* @__PURE__ */ (() => z6.union([
1283
+ z6.object({
1284
+ mode: z6.literal("console"),
1214
1285
  server: stagingServerAccessInputSchema.optional()
1215
1286
  }).strict(),
1216
- z5.object({
1217
- mode: z5.literal("password"),
1218
- password: z5.string().min(8).max(128),
1287
+ z6.object({
1288
+ mode: z6.literal("password"),
1289
+ password: z6.string().min(8).max(128),
1219
1290
  server: stagingServerAccessInputSchema.optional()
1220
1291
  }).strict(),
1221
- z5.object({ server: stagingServerAccessInputSchema }).strict()
1292
+ z6.object({ server: stagingServerAccessInputSchema }).strict()
1222
1293
  ]))();
1223
- var stagingServerKeySchema = /* @__PURE__ */ (() => z5.object({
1224
- id: z5.string(),
1225
- name: z5.string(),
1226
- lastFour: z5.string(),
1227
- createdAt: z5.number(),
1228
- lastUsedAt: z5.number().nullable()
1294
+ var stagingServerKeySchema = /* @__PURE__ */ (() => z6.object({
1295
+ id: z6.string(),
1296
+ name: z6.string(),
1297
+ lastFour: z6.string(),
1298
+ createdAt: z6.number(),
1299
+ lastUsedAt: z6.number().nullable()
1229
1300
  }))();
1230
- var stagingServerKeyListSchema = /* @__PURE__ */ (() => z5.object({
1231
- items: z5.array(stagingServerKeySchema),
1232
- nextCursor: z5.null()
1301
+ var stagingServerKeyListSchema = /* @__PURE__ */ (() => z6.object({
1302
+ items: z6.array(stagingServerKeySchema),
1303
+ nextCursor: z6.null()
1233
1304
  }))();
1234
- var stagingServerKeyInputSchema = /* @__PURE__ */ (() => z5.object({ name: z5.string().trim().min(1).max(80) }).strict())();
1305
+ var stagingServerKeyInputSchema = /* @__PURE__ */ (() => z6.object({ name: z6.string().trim().min(1).max(80) }).strict())();
1235
1306
  var stagingServerKeyCreatedSchema = /* @__PURE__ */ (() => stagingServerKeySchema.extend({
1236
- key: z5.string()
1307
+ key: z6.string()
1237
1308
  }))();
1238
- var stagingPathSchema = /* @__PURE__ */ (() => z5.string().max(2048).refine((path) => {
1309
+ var stagingPathSchema = /* @__PURE__ */ (() => z6.string().max(2048).refine((path) => {
1239
1310
  if (!path.startsWith("/") || path.startsWith("//") || path.includes("\\") || // oxlint-disable-next-line no-control-regex
1240
1311
  /[\u0000-\u001f\u007f]/.test(path)) {
1241
1312
  return false;
@@ -1246,47 +1317,47 @@ var stagingPathSchema = /* @__PURE__ */ (() => z5.string().max(2048).refine((pat
1246
1317
  return false;
1247
1318
  }
1248
1319
  }, "Expected a path on the staging host"))();
1249
- var stagingLinkSchema = /* @__PURE__ */ (() => z5.object({
1250
- url: z5.string().url(),
1251
- expiresAt: z5.number()
1320
+ var stagingLinkSchema = /* @__PURE__ */ (() => z6.object({
1321
+ url: z6.string().url(),
1322
+ expiresAt: z6.number()
1252
1323
  }))();
1253
- var buildSnapshotSchema = /* @__PURE__ */ (() => z5.object({
1254
- builds: z5.array(hostedBuildSchema),
1324
+ var buildSnapshotSchema = /* @__PURE__ */ (() => z6.object({
1325
+ builds: z6.array(hostedBuildSchema),
1255
1326
  current: hostedBuildSchema.nullable(),
1256
1327
  selected: hostedBuildSchema.nullable(),
1257
- logs: z5.string()
1328
+ logs: z6.string()
1258
1329
  }))();
1259
- var assetPathSchema = /* @__PURE__ */ (() => z5.string().max(512).refine(
1330
+ var assetPathSchema = /* @__PURE__ */ (() => z6.string().max(512).refine(
1260
1331
  (path) => path.startsWith("/") && // oxlint-disable-next-line no-control-regex -- Asset paths must reject control characters.
1261
1332
  !/[\\\u0000-\u001f?#%]/.test(path) && path.slice(1).split("/").every((part) => part.length > 0 && !part.startsWith(".")),
1262
1333
  "Expected a public asset path without hidden segments"
1263
1334
  ))();
1264
- var base64Schema = /* @__PURE__ */ (() => z5.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/))();
1335
+ var base64Schema = /* @__PURE__ */ (() => z6.string().regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/))();
1265
1336
  var stagedDeploymentLimits = {
1266
1337
  /** Bytes of JSON, uncompressed. */
1267
1338
  size: 64e6,
1268
1339
  /** Bytes of the Brotli-compressed object. */
1269
1340
  compressedSize: 1e7
1270
1341
  };
1271
- var stagedDeploymentSchema = /* @__PURE__ */ (() => z5.object({
1272
- encoding: z5.literal("br"),
1273
- sha256: z5.string().regex(/^[0-9a-f]{64}$/),
1274
- compressedSize: z5.number().int().positive().max(limits.stagedDeployment.compressedSize),
1275
- size: z5.number().int().positive().max(limits.stagedDeployment.size)
1342
+ var stagedDeploymentSchema = /* @__PURE__ */ (() => z6.object({
1343
+ encoding: z6.literal("br"),
1344
+ sha256: z6.string().regex(/^[0-9a-f]{64}$/),
1345
+ compressedSize: z6.number().int().positive().max(limits.stagedDeployment.compressedSize),
1346
+ size: z6.number().int().positive().max(limits.stagedDeployment.size)
1276
1347
  }).strict())();
1277
1348
  var stagedDeploymentContentSchema = /* @__PURE__ */ (() => stagedDeploymentSchema.extend({
1278
- content: z5.string().max(Math.ceil(limits.stagedDeployment.compressedSize / 3) * 4)
1349
+ content: z6.string().max(Math.ceil(limits.stagedDeployment.compressedSize / 3) * 4)
1279
1350
  }).strict())();
1280
1351
  var stagedDeploymentKey = (build, sha256) => `builds/${build}/deployment/${sha256}.br`;
1281
1352
  var artifactFields = /* @__PURE__ */ (() => ({
1282
1353
  routing: appRoutingSchema,
1283
- worker: z5.object({
1354
+ worker: z6.object({
1284
1355
  ...workerSettings,
1285
1356
  migrations: appMigrationsSchema.optional(),
1286
- modules: z5.array(
1287
- z5.object({
1357
+ modules: z6.array(
1358
+ z6.object({
1288
1359
  path: outputPathSchema.refine((path) => path !== "metadata"),
1289
- type: z5.enum([
1360
+ type: z6.enum([
1290
1361
  "application/javascript+module",
1291
1362
  "application/wasm",
1292
1363
  "text/plain",
@@ -1296,27 +1367,27 @@ var artifactFields = /* @__PURE__ */ (() => ({
1296
1367
  }).strict()
1297
1368
  ).min(1).max(500)
1298
1369
  }).strict().superRefine(distinctBindings).optional(),
1299
- assets: z5.array(
1300
- z5.object({
1370
+ assets: z6.array(
1371
+ z6.object({
1301
1372
  path: assetPathSchema,
1302
1373
  content: base64Schema.max(14e6),
1303
- size: z5.number().int().min(0).max(1e7)
1374
+ size: z6.number().int().min(0).max(1e7)
1304
1375
  }).strict()
1305
1376
  ).max(500)
1306
1377
  }))();
1307
- var inlineCode = () => z5.unknown().optional().transform((value) => value);
1308
- var buildArtifactsSchema = /* @__PURE__ */ (() => z5.discriminatedUnion("format", [
1309
- z5.object({
1310
- format: z5.literal(1),
1378
+ var inlineCode = () => z6.unknown().optional().transform((value) => value);
1379
+ var buildArtifactsSchema = /* @__PURE__ */ (() => z6.discriminatedUnion("format", [
1380
+ z6.object({
1381
+ format: z6.literal(1),
1311
1382
  ...artifactFields,
1312
1383
  quests: inlineCode(),
1313
1384
  catalog: inlineCode()
1314
1385
  }).strict(),
1315
- z5.object({
1316
- format: z5.literal(2),
1386
+ z6.object({
1387
+ format: z6.literal(2),
1317
1388
  ...artifactFields,
1318
1389
  deployment: stagedDeploymentSchema,
1319
- images: z5.array(imageAssetArtifactSchema).max(10)
1390
+ images: z6.array(imageAssetArtifactSchema).max(10)
1320
1391
  }).strict()
1321
1392
  ]).superRefine((value, ctx) => {
1322
1393
  if (value.worker) {
@@ -1381,8 +1452,8 @@ function bareOrigin(url) {
1381
1452
  }
1382
1453
 
1383
1454
  // src/identity-integration.ts
1384
- import * as z6 from "zod";
1385
- var exactOrigin = (allowed, message) => z6.string().url().superRefine((value, context) => {
1455
+ import * as z7 from "zod";
1456
+ var exactOrigin = (allowed, message) => z7.string().url().superRefine((value, context) => {
1386
1457
  const url = new URL(value);
1387
1458
  if (!allowed(url)) {
1388
1459
  context.addIssue({ code: "custom", message });
@@ -1401,8 +1472,8 @@ var appLoginOriginSchema = /* @__PURE__ */ (() => exactOrigin(
1401
1472
  (url) => secureOrLoopbackOrigin(url),
1402
1473
  "Use an HTTPS origin, or a loopback origin such as http://localhost:3000 for a Test key."
1403
1474
  ))();
1404
- var identityIntegrationInputSchema = /* @__PURE__ */ (() => z6.object({
1405
- name: z6.string().trim().min(1).max(80),
1475
+ var identityIntegrationInputSchema = /* @__PURE__ */ (() => z7.object({
1476
+ name: z7.string().trim().min(1).max(80),
1406
1477
  origin: appLoginOriginSchema,
1407
1478
  /**
1408
1479
  * The identity kind this integration owns in the project and environment, such as
@@ -1421,11 +1492,11 @@ var identityIntegrationInputSchema = /* @__PURE__ */ (() => z6.object({
1421
1492
  * users as that integration's, because each one then signs in as the member that ID is linked
1422
1493
  * to. Needs `reason`, which the audit log keeps.
1423
1494
  */
1424
- adoptIdentitiesFrom: z6.string().uuid().optional(),
1495
+ adoptIdentitiesFrom: z7.string().uuid().optional(),
1425
1496
  /** Why the identities are adopted; required with `adoptIdentitiesFrom`. */
1426
- reason: z6.string().trim().min(1).max(500).optional(),
1497
+ reason: z7.string().trim().min(1).max(500).optional(),
1427
1498
  /** Days until the first secret expires. Omit it for a key that never expires. */
1428
- expiresInDays: z6.number().int().min(1).max(3650).optional()
1499
+ expiresInDays: z7.number().int().min(1).max(3650).optional()
1429
1500
  }).strict().refine(
1430
1501
  (input) => !input.adoptIdentitiesFrom || input.identityKind,
1431
1502
  "Adopting identities needs the identityKind they have"
@@ -1433,65 +1504,65 @@ var identityIntegrationInputSchema = /* @__PURE__ */ (() => z6.object({
1433
1504
  (input) => !input.adoptIdentitiesFrom === !input.reason,
1434
1505
  "Give a reason when adopting identities, and only then"
1435
1506
  ))();
1436
- var identityIntegrationSchema = /* @__PURE__ */ (() => z6.object({
1507
+ var identityIntegrationSchema = /* @__PURE__ */ (() => z7.object({
1437
1508
  ...authScopeSchema.shape,
1438
- id: z6.string().uuid(),
1439
- name: z6.string(),
1440
- origin: z6.string(),
1509
+ id: z7.string().uuid(),
1510
+ name: z7.string(),
1511
+ origin: z7.string(),
1441
1512
  /**
1442
1513
  * When the integration's last working secret expires: 8640000000000000 (the latest date
1443
1514
  * JavaScript represents) when one never does.
1444
1515
  *
1445
1516
  * @deprecated Read `secrets`, which gives each secret's own expiry.
1446
1517
  */
1447
- expiresAt: z6.number(),
1518
+ expiresAt: z7.number(),
1448
1519
  /** The integration's working secrets, oldest first. Any of them authenticates it. */
1449
- secrets: z6.array(credentialSecretSchema).default([]),
1520
+ secrets: z7.array(credentialSecretSchema).default([]),
1450
1521
  /** The latest use of any of its secrets, revoked ones included; null when none was used. */
1451
- lastUsedAt: z6.number().nullable().default(null),
1522
+ lastUsedAt: z7.number().nullable().default(null),
1452
1523
  /** The identity kind the integration owns; null when it only signs members in. */
1453
1524
  identityKind: openIdentityKindSchema.nullable().default(null),
1454
1525
  /**
1455
1526
  * Whether the app's server may vouch for its members' accounts when it signs them in
1456
1527
  * (`accounts` on the exchange). False in Relay versions without it.
1457
1528
  */
1458
- vouchesAccounts: z6.boolean().default(false)
1529
+ vouchesAccounts: z7.boolean().default(false)
1459
1530
  }))();
1460
1531
  var identityIntegrationSecretSchema = /* @__PURE__ */ (() => identityIntegrationSchema.extend(
1461
1532
  {
1462
- token: z6.string()
1533
+ token: z7.string()
1463
1534
  }
1464
1535
  ))();
1465
1536
  var identityIntegrationAppSecretSchema = /* @__PURE__ */ (() => identityIntegrationSchema.extend({ appSecret: appSecretSchema }))();
1466
- var identityKindClaimSchema = /* @__PURE__ */ (() => z6.object({
1537
+ var identityKindClaimSchema = /* @__PURE__ */ (() => z7.object({
1467
1538
  kind: openIdentityKindSchema,
1468
1539
  /** The owning integration's ID; it stays after the integration is disconnected. */
1469
- integration: z6.string(),
1540
+ integration: z7.string(),
1470
1541
  /** The owning integration's name when it claimed or adopted the kind. */
1471
- integrationName: z6.string(),
1542
+ integrationName: z7.string(),
1472
1543
  /** Whether the owning integration is still connected. */
1473
- connected: z6.boolean(),
1544
+ connected: z7.boolean(),
1474
1545
  /** Linked identities of the kind; adopting them is required to reuse the kind. */
1475
- linked: z6.number().int().nonnegative(),
1546
+ linked: z7.number().int().nonnegative(),
1476
1547
  /** Identities an operator unlinked. */
1477
- unlinked: z6.number().int().nonnegative(),
1478
- claimedAt: z6.number().int().nonnegative()
1548
+ unlinked: z7.number().int().nonnegative(),
1549
+ claimedAt: z7.number().int().nonnegative()
1479
1550
  }))();
1480
- var identityIntegrationAccountVouchingInputSchema = /* @__PURE__ */ (() => z6.object({
1481
- enabled: z6.boolean(),
1482
- reason: z6.string().trim().min(1).max(500),
1551
+ var identityIntegrationAccountVouchingInputSchema = /* @__PURE__ */ (() => z7.object({
1552
+ enabled: z7.boolean(),
1553
+ reason: z7.string().trim().min(1).max(500),
1483
1554
  actionId: identifier.optional()
1484
1555
  }).strict())();
1485
1556
  var vouchedProviders = ["x", "telegram", "discord"];
1486
- var participantExchangeAccountsSchema = /* @__PURE__ */ (() => z6.array(memberImportVouchedAccountSchema).max(20).refine(
1557
+ var participantExchangeAccountsSchema = /* @__PURE__ */ (() => z7.array(memberImportVouchedAccountSchema).max(20).refine(
1487
1558
  (accounts) => vouchedProviders.every(
1488
1559
  (kind) => accounts.filter((entry) => entry.kind === kind).length <= 1
1489
1560
  ),
1490
1561
  "Vouch for at most one X, Telegram and Discord account each"
1491
1562
  ))();
1492
- var participantExchangeSchema = /* @__PURE__ */ (() => z6.object({
1493
- subject: z6.string().min(1).max(200),
1494
- previousToken: z6.string().max(200).optional(),
1563
+ var participantExchangeSchema = /* @__PURE__ */ (() => z7.object({
1564
+ subject: z7.string().min(1).max(200),
1565
+ previousToken: z7.string().max(200).optional(),
1495
1566
  /**
1496
1567
  * Accounts the app vouches belong to this member, attached on the organization's word like an
1497
1568
  * import's. Needs an integration with `vouchesAccounts`; otherwise the exchange is refused with
@@ -1499,32 +1570,32 @@ var participantExchangeSchema = /* @__PURE__ */ (() => z6.object({
1499
1570
  */
1500
1571
  accounts: participantExchangeAccountsSchema.optional()
1501
1572
  }).strict())();
1502
- var participantExchangeAccountResultSchema = /* @__PURE__ */ (() => z6.object({
1573
+ var participantExchangeAccountResultSchema = /* @__PURE__ */ (() => z7.object({
1503
1574
  account: memberImportVouchedAccountSchema,
1504
- status: z6.string(),
1505
- code: z6.string().optional(),
1506
- message: z6.string().optional()
1575
+ status: z7.string(),
1576
+ code: z7.string().optional(),
1577
+ message: z7.string().optional()
1507
1578
  }))();
1508
1579
  var participantExchangeResultSchema = /* @__PURE__ */ (() => exchangeResultSchema.extend({
1509
- accounts: z6.array(participantExchangeAccountResultSchema).optional()
1580
+ accounts: z7.array(participantExchangeAccountResultSchema).optional()
1510
1581
  }))();
1511
- var identityIntegrationKeySchema = /* @__PURE__ */ (() => z6.object({
1512
- id: z6.string(),
1513
- name: z6.string(),
1514
- organization: z6.string(),
1515
- project: z6.string(),
1516
- environment: z6.string(),
1517
- origin: z6.string(),
1582
+ var identityIntegrationKeySchema = /* @__PURE__ */ (() => z7.object({
1583
+ id: z7.string(),
1584
+ name: z7.string(),
1585
+ organization: z7.string(),
1586
+ project: z7.string(),
1587
+ environment: z7.string(),
1588
+ origin: z7.string(),
1518
1589
  identityKind: openIdentityKindSchema.nullable().default(null),
1519
- vouchesAccounts: z6.boolean().default(false),
1520
- secretExpiresAt: z6.number().nullable().default(null),
1521
- appOrigins: z6.array(z6.string()).default([])
1590
+ vouchesAccounts: z7.boolean().default(false),
1591
+ secretExpiresAt: z7.number().nullable().default(null),
1592
+ appOrigins: z7.array(z7.string()).default([])
1522
1593
  }))();
1523
- var accountVouchedBySchema = /* @__PURE__ */ (() => z6.object({
1594
+ var accountVouchedBySchema = /* @__PURE__ */ (() => z7.object({
1524
1595
  /** The integration's ID; it stays after the integration is disconnected. */
1525
- integration: z6.string(),
1596
+ integration: z7.string(),
1526
1597
  /** The integration's name when it vouched for the account. */
1527
- integrationName: z6.string()
1598
+ integrationName: z7.string()
1528
1599
  }))();
1529
1600
 
1530
1601
  export {
@@ -1581,6 +1652,14 @@ export {
1581
1652
  offeredStarterSchema,
1582
1653
  starterTemplates,
1583
1654
  starterIdSchema,
1655
+ environmentSchema,
1656
+ roleSchema,
1657
+ permissionSchema,
1658
+ permissionListSchema,
1659
+ rolePermissions,
1660
+ projectRoleSchema,
1661
+ projectPermissionSchema,
1662
+ projectRolePermissions,
1584
1663
  appRoutingSchema,
1585
1664
  APP_SECRET_LIMIT,
1586
1665
  APP_KV_LIMIT,
@@ -1591,6 +1670,9 @@ export {
1591
1670
  appSecretNameSchema,
1592
1671
  appSecretValueSchema,
1593
1672
  appSecretInputSchema,
1673
+ AppSecretCredentialKind,
1674
+ AppSecretCredentialStatus,
1675
+ appSecretCredentialSchema,
1594
1676
  appSecretSchema,
1595
1677
  appSecretDeclarationSchema,
1596
1678
  appSecretDeclarationsSchema,