@domino-sdk/relay 1.75.0 → 1.76.3
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.
- package/CHANGELOG.md +35 -0
- package/dist/authoring.js +4 -4
- package/dist/browser.js +8 -8
- package/dist/{chunk-4WODSE6Y.js → chunk-42AI4ZN7.js} +8 -4
- package/dist/{chunk-CEG67D4T.js → chunk-6NELFCPJ.js} +1 -1
- package/dist/{chunk-3KHVIUKK.js → chunk-6WZJ3W7K.js} +1 -1
- package/dist/{chunk-TAZ5AEYF.js → chunk-7YAL5UZP.js} +1 -1
- package/dist/{chunk-K3PEQXDV.js → chunk-FZJLZSRQ.js} +1 -1
- package/dist/{chunk-SIKP4VMU.js → chunk-HZXO73SG.js} +386 -299
- package/dist/{chunk-UHYKKC5U.js → chunk-IFHG2JT4.js} +6 -6
- package/dist/{chunk-7QHROIML.js → chunk-MQNHFZMT.js} +2 -1
- package/dist/{chunk-ZEYI662X.js → chunk-N6IKQBBQ.js} +3 -3
- package/dist/{chunk-XJCKQSFS.js → chunk-TMKKN4IM.js} +1 -1
- package/dist/{chunk-SPLXHFVX.js → chunk-TT5CAVRM.js} +2 -2
- package/dist/{chunk-FBS65R66.js → chunk-TYBXDUKR.js} +2 -2
- package/dist/{chunk-IMX45NSW.js → chunk-VVDXTFVP.js} +6 -6
- package/dist/{chunk-7B7MDHJ6.js → chunk-W66QVFJP.js} +1 -1
- package/dist/{chunk-XEXB3WZE.js → chunk-XG5QOC5A.js} +1 -1
- package/dist/{chunk-HEQ7HLXG.js → chunk-XSO6BGYT.js} +1 -1
- package/dist/{chunk-E2DB4MKM.js → chunk-Y2FYV5S7.js} +897 -934
- package/dist/{identity-integration-DnSgQjbY.d.ts → identity-integration-B1f5oOdc.d.ts} +1167 -3
- package/dist/{transport-BMwM6JlS.d.ts → index-BM0DdDYy.d.ts} +249 -1260
- package/dist/index.js +7 -7
- package/dist/internal.d.ts +15 -7
- package/dist/internal.js +18 -15
- package/dist/portal-proxy.d.ts +1 -1
- package/dist/portal-proxy.js +9 -9
- package/dist/react/index.js +8 -8
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/7W2Z42TY.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.js +7 -7
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +58 -25
- package/dist/solana.d.ts +2 -2
- package/dist/solana.js +8 -8
- package/dist/testing.js +5 -5
- package/package.json +1 -1
- package/dist/runtime/chunks/H6GH644T.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
imageAssetArtifactSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FZJLZSRQ.js";
|
|
4
4
|
import {
|
|
5
5
|
authScopeSchema,
|
|
6
6
|
exchangeResultSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6WZJ3W7K.js";
|
|
8
8
|
import {
|
|
9
9
|
appIdentityKindSchema,
|
|
10
10
|
cosmosAddressSchema,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
pageCursorSchema,
|
|
19
19
|
pageLimit,
|
|
20
20
|
solanaAddressSchema
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MQNHFZMT.js";
|
|
22
22
|
|
|
23
23
|
// src/credential-secrets.ts
|
|
24
24
|
import * as z from "zod";
|
|
@@ -734,60 +734,131 @@ var starterIdSchema = /* @__PURE__ */ (() => z4.enum(
|
|
|
734
734
|
starterTemplates.map((template) => template.id)
|
|
735
735
|
))();
|
|
736
736
|
|
|
737
|
-
// src/server/
|
|
737
|
+
// src/server/permissions.ts
|
|
738
738
|
import * as z5 from "zod";
|
|
739
|
-
var
|
|
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__ */ (() =>
|
|
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__ */ (() =>
|
|
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__ */ (() =>
|
|
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__ */ (() =>
|
|
764
|
-
var
|
|
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:
|
|
767
|
-
updatedBy:
|
|
836
|
+
updatedAt: z6.number(),
|
|
837
|
+
updatedBy: z6.string(),
|
|
838
|
+
credential: appSecretCredentialSchema.optional()
|
|
768
839
|
}))();
|
|
769
|
-
var appSecretDeclarationSchema = /* @__PURE__ */ (() =>
|
|
770
|
-
description:
|
|
771
|
-
required:
|
|
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__ */ (() =>
|
|
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__ */ (() =>
|
|
778
|
-
secrets:
|
|
779
|
-
declared:
|
|
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__ */ (() =>
|
|
782
|
-
var storageDescription = /* @__PURE__ */ (() =>
|
|
783
|
-
description:
|
|
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__ */ (() =>
|
|
786
|
-
kv:
|
|
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:
|
|
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__ */ (() =>
|
|
801
|
-
var appStorageListSchema = /* @__PURE__ */ (() =>
|
|
802
|
-
stores:
|
|
803
|
-
|
|
804
|
-
kind:
|
|
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:
|
|
807
|
-
declared:
|
|
808
|
-
description:
|
|
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__ */ (() =>
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
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__ */ (() =>
|
|
822
|
-
tables:
|
|
892
|
+
var appStorageTablesSchema = /* @__PURE__ */ (() => z6.object({
|
|
893
|
+
tables: z6.array(
|
|
823
894
|
/** `kind` is SQLite's: `table` or `view`. */
|
|
824
|
-
|
|
895
|
+
z6.object({ name: z6.string(), kind: z6.string() })
|
|
825
896
|
)
|
|
826
897
|
}))();
|
|
827
|
-
var appStorageRowsSchema = /* @__PURE__ */ (() =>
|
|
828
|
-
table:
|
|
829
|
-
columns:
|
|
830
|
-
rows:
|
|
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:
|
|
833
|
-
total:
|
|
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:
|
|
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:
|
|
916
|
+
rowKeys: z6.array(z6.string().nullable()).nullish()
|
|
846
917
|
}))();
|
|
847
|
-
var appStorageKeysSchema = /* @__PURE__ */ (() =>
|
|
848
|
-
keys:
|
|
849
|
-
|
|
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:
|
|
925
|
+
cursor: z6.string().nullable()
|
|
855
926
|
}))();
|
|
856
|
-
var appStorageValueSchema = /* @__PURE__ */ (() =>
|
|
857
|
-
key:
|
|
858
|
-
size:
|
|
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:
|
|
861
|
-
truncated:
|
|
931
|
+
text: z6.string().nullable(),
|
|
932
|
+
truncated: z6.boolean()
|
|
862
933
|
}))();
|
|
863
934
|
var APP_STORAGE_CELL_CHARACTERS = 1e5;
|
|
864
|
-
var appStorageCellPageSchema = /* @__PURE__ */ (() =>
|
|
865
|
-
table:
|
|
866
|
-
column:
|
|
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:
|
|
939
|
+
row: z6.number().int().min(0),
|
|
869
940
|
/** SQLite's storage class. */
|
|
870
|
-
type:
|
|
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:
|
|
943
|
+
length: z6.number().int().min(0).nullable(),
|
|
873
944
|
/** How many characters come before this page. */
|
|
874
|
-
offset:
|
|
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:
|
|
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:
|
|
954
|
+
revision: z6.string().nullish()
|
|
884
955
|
}))();
|
|
885
|
-
var appStorageValueBytesSchema = /* @__PURE__ */ (() =>
|
|
886
|
-
key:
|
|
956
|
+
var appStorageValueBytesSchema = /* @__PURE__ */ (() => z6.object({
|
|
957
|
+
key: z6.string(),
|
|
887
958
|
/** The whole value's size in bytes. */
|
|
888
|
-
size:
|
|
959
|
+
size: z6.number().int().min(0),
|
|
889
960
|
/** How many bytes come before this page. */
|
|
890
|
-
offset:
|
|
961
|
+
offset: z6.number().int().min(0),
|
|
891
962
|
/** Up to `limits.apps.storageValueBytes` bytes from `offset`, base64-encoded. */
|
|
892
|
-
base64:
|
|
963
|
+
base64: z6.string(),
|
|
893
964
|
/** Changes when the value does: pages whose revisions differ are from different values. */
|
|
894
|
-
revision:
|
|
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__ */ (() =>
|
|
899
|
-
var appStorageSqlClearSchema = /* @__PURE__ */ (() =>
|
|
900
|
-
|
|
901
|
-
dryRun:
|
|
902
|
-
tables:
|
|
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
|
-
|
|
905
|
-
dryRun:
|
|
906
|
-
allTables:
|
|
907
|
-
keepTables:
|
|
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__ */ (() =>
|
|
911
|
-
|
|
912
|
-
dryRun:
|
|
913
|
-
prefix:
|
|
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
|
-
|
|
986
|
+
z6.object({ dryRun: z6.boolean().optional(), all: z6.literal(true) }).strict()
|
|
916
987
|
]))();
|
|
917
|
-
var appStorageSqlClearResultSchema = /* @__PURE__ */ (() =>
|
|
918
|
-
environment:
|
|
919
|
-
kind:
|
|
920
|
-
store:
|
|
921
|
-
dryRun:
|
|
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:
|
|
924
|
-
|
|
994
|
+
tables: z6.array(
|
|
995
|
+
z6.object({ name: z6.string(), rows: z6.number().int().min(0) })
|
|
925
996
|
)
|
|
926
997
|
}))();
|
|
927
|
-
var appStorageKvClearResultSchema = /* @__PURE__ */ (() =>
|
|
928
|
-
environment:
|
|
929
|
-
kind:
|
|
930
|
-
store:
|
|
931
|
-
dryRun:
|
|
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:
|
|
1004
|
+
prefix: z6.string(),
|
|
934
1005
|
/** Keys deleted by this call, or counted by a dry run. */
|
|
935
|
-
keys:
|
|
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:
|
|
1012
|
+
complete: z6.boolean()
|
|
942
1013
|
}))();
|
|
943
|
-
var appMigrationNameSchema = /* @__PURE__ */ (() =>
|
|
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__ */ (() =>
|
|
1031
|
+
var appMigrationsSchema = /* @__PURE__ */ (() => z6.record(
|
|
961
1032
|
appSecretNameSchema,
|
|
962
|
-
|
|
963
|
-
|
|
1033
|
+
z6.array(
|
|
1034
|
+
z6.object({
|
|
964
1035
|
name: appMigrationNameSchema,
|
|
965
|
-
sql:
|
|
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:
|
|
984
|
-
checkScript:
|
|
985
|
-
buildScript:
|
|
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:
|
|
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:
|
|
994
|
-
compatibilityFlags:
|
|
995
|
-
vars:
|
|
996
|
-
|
|
997
|
-
|
|
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__ */ (() =>
|
|
1027
|
-
|
|
1028
|
-
kind:
|
|
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
|
-
|
|
1033
|
-
kind:
|
|
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__ */ (() =>
|
|
1041
|
-
id:
|
|
1111
|
+
var repositorySchema = /* @__PURE__ */ (() => z6.object({
|
|
1112
|
+
id: z6.string().uuid(),
|
|
1042
1113
|
organization: identifier,
|
|
1043
1114
|
project: identifier,
|
|
1044
|
-
remote:
|
|
1045
|
-
defaultBranch:
|
|
1046
|
-
status:
|
|
1115
|
+
remote: z6.string().url(),
|
|
1116
|
+
defaultBranch: z6.string(),
|
|
1117
|
+
status: z6.enum(["provisioning", "ready"])
|
|
1047
1118
|
}))();
|
|
1048
|
-
var repositoryCreateSchema = /* @__PURE__ */ (() =>
|
|
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__ */ (() =>
|
|
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__ */ (() =>
|
|
1057
|
-
challenge:
|
|
1127
|
+
var deviceStartSchema = /* @__PURE__ */ (() => z6.object({
|
|
1128
|
+
challenge: z6.string().regex(/^[a-f0-9]{64}$/)
|
|
1058
1129
|
}).strict())();
|
|
1059
|
-
var deviceRedeemSchema = /* @__PURE__ */ (() =>
|
|
1060
|
-
id:
|
|
1061
|
-
verifier:
|
|
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__ */ (() =>
|
|
1064
|
-
id:
|
|
1065
|
-
code:
|
|
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__ */ (() =>
|
|
1068
|
-
var stageRequestSchema = /* @__PURE__ */ (() =>
|
|
1138
|
+
var commitSchema = /* @__PURE__ */ (() => z6.string().regex(/^[a-f0-9]{40}$/))();
|
|
1139
|
+
var stageRequestSchema = /* @__PURE__ */ (() => z6.object({
|
|
1069
1140
|
commit: commitSchema,
|
|
1070
|
-
requestId:
|
|
1141
|
+
requestId: z6.string().uuid()
|
|
1071
1142
|
}).strict())();
|
|
1072
|
-
var buildIdentitySchema = /* @__PURE__ */ (() =>
|
|
1143
|
+
var buildIdentitySchema = /* @__PURE__ */ (() => z6.object({
|
|
1073
1144
|
routing: appRoutingSchema,
|
|
1074
|
-
slug:
|
|
1075
|
-
runtime:
|
|
1076
|
-
id:
|
|
1077
|
-
repository:
|
|
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:
|
|
1082
|
-
actor:
|
|
1083
|
-
commitMessage:
|
|
1152
|
+
createdAt: z6.number(),
|
|
1153
|
+
actor: z6.string(),
|
|
1154
|
+
commitMessage: z6.string().max(500).optional()
|
|
1084
1155
|
}))();
|
|
1085
|
-
var buildPhaseSchema = /* @__PURE__ */ (() =>
|
|
1156
|
+
var buildPhaseSchema = /* @__PURE__ */ (() => z6.enum([
|
|
1086
1157
|
"queued",
|
|
1087
1158
|
"source",
|
|
1088
1159
|
"install",
|
|
@@ -1092,82 +1163,82 @@ var buildPhaseSchema = /* @__PURE__ */ (() => z5.enum([
|
|
|
1092
1163
|
"ready",
|
|
1093
1164
|
"failed"
|
|
1094
1165
|
]))();
|
|
1095
|
-
var buildStatusSchema = /* @__PURE__ */ (() =>
|
|
1166
|
+
var buildStatusSchema = /* @__PURE__ */ (() => z6.object({
|
|
1096
1167
|
phase: buildPhaseSchema,
|
|
1097
1168
|
failedPhase: buildPhaseSchema.optional(),
|
|
1098
|
-
updatedAt:
|
|
1099
|
-
message:
|
|
1169
|
+
updatedAt: z6.number(),
|
|
1170
|
+
message: z6.string()
|
|
1100
1171
|
}))();
|
|
1101
1172
|
var hostedBuildSchema = /* @__PURE__ */ (() => buildIdentitySchema.extend({
|
|
1102
1173
|
...buildStatusSchema.shape,
|
|
1103
|
-
finished:
|
|
1104
|
-
current:
|
|
1105
|
-
stagingUrl:
|
|
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:
|
|
1182
|
+
deployment: z6.string().nullable().optional()
|
|
1112
1183
|
}))();
|
|
1113
|
-
var liveAppSchema = /* @__PURE__ */ (() =>
|
|
1114
|
-
url:
|
|
1115
|
-
state:
|
|
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:
|
|
1188
|
+
build: z6.string().uuid().nullable(),
|
|
1118
1189
|
/** The build the last approved promotion asked for, while it differs from `build`. */
|
|
1119
|
-
requested:
|
|
1120
|
-
failure:
|
|
1190
|
+
requested: z6.string().uuid().nullable(),
|
|
1191
|
+
failure: z6.string().nullable()
|
|
1121
1192
|
}))();
|
|
1122
|
-
var customDomainStateSchema = /* @__PURE__ */ (() =>
|
|
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__ */ (() =>
|
|
1130
|
-
type:
|
|
1131
|
-
name:
|
|
1132
|
-
value:
|
|
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:
|
|
1135
|
-
matches:
|
|
1205
|
+
found: z6.array(z6.string()).nullable(),
|
|
1206
|
+
matches: z6.boolean()
|
|
1136
1207
|
}))();
|
|
1137
|
-
var domainTimeMs = /* @__PURE__ */ (() =>
|
|
1138
|
-
var customDomainSchema = /* @__PURE__ */ (() =>
|
|
1139
|
-
id:
|
|
1140
|
-
hostname:
|
|
1141
|
-
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:
|
|
1145
|
-
records:
|
|
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:
|
|
1148
|
-
hostnameStatus:
|
|
1149
|
-
certificateStatus:
|
|
1150
|
-
validationErrors:
|
|
1151
|
-
verificationErrors:
|
|
1152
|
-
certificateExpiresAt:
|
|
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:
|
|
1226
|
+
checkedAt: z6.string().nullable(),
|
|
1156
1227
|
checkedAtMs: domainTimeMs,
|
|
1157
|
-
nextCheckAt:
|
|
1228
|
+
nextCheckAt: z6.string().nullable(),
|
|
1158
1229
|
nextCheckAtMs: domainTimeMs,
|
|
1159
|
-
createdAt:
|
|
1160
|
-
createdAtMs:
|
|
1230
|
+
createdAt: z6.string(),
|
|
1231
|
+
createdAtMs: z6.number().int().nonnegative().optional()
|
|
1161
1232
|
}))();
|
|
1162
|
-
var customDomainListSchema = /* @__PURE__ */ (() =>
|
|
1163
|
-
domains:
|
|
1233
|
+
var customDomainListSchema = /* @__PURE__ */ (() => z6.object({
|
|
1234
|
+
domains: z6.array(customDomainSchema)
|
|
1164
1235
|
}))();
|
|
1165
|
-
var customDomainInputSchema = /* @__PURE__ */ (() =>
|
|
1166
|
-
var stagingAccessModeSchema = /* @__PURE__ */ (() =>
|
|
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__ */ (() =>
|
|
1170
|
-
if (!path.startsWith("/") || path.startsWith("//") || /[\\?#]/.test(path) || // oxlint-disable-next-line no-control-regex
|
|
1240
|
+
var stagingServerPathSchema = /* @__PURE__ */ (() => z6.string().max(200).refine((path) => {
|
|
1241
|
+
if (!path.startsWith("/") || path.startsWith("//") || /[\\?#]/.test(path) || // oxlint-disable-next-line no-control-regex -- control characters and spaces are what it refuses.
|
|
1171
1242
|
/[\u0000-\u0020\u007f]/.test(path)) {
|
|
1172
1243
|
return false;
|
|
1173
1244
|
}
|
|
@@ -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__ */ (() =>
|
|
1186
|
-
paths:
|
|
1256
|
+
var stagingServerAccessSchema = /* @__PURE__ */ (() => z6.object({
|
|
1257
|
+
paths: z6.array(z6.string())
|
|
1187
1258
|
}))();
|
|
1188
|
-
var stagingAccessSchema = /* @__PURE__ */ (() =>
|
|
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,49 +1265,49 @@ var stagingAccessSchema = /* @__PURE__ */ (() => z5.object({
|
|
|
1194
1265
|
*/
|
|
1195
1266
|
server: stagingServerAccessSchema.optional()
|
|
1196
1267
|
}))();
|
|
1197
|
-
var stagingServerAccessInputSchema = /* @__PURE__ */ (() =>
|
|
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:
|
|
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__ */ (() =>
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
mode:
|
|
1208
|
-
password:
|
|
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__ */ (() =>
|
|
1212
|
-
|
|
1213
|
-
mode:
|
|
1282
|
+
var stagingAccessChangeSchema = /* @__PURE__ */ (() => z6.union([
|
|
1283
|
+
z6.object({
|
|
1284
|
+
mode: z6.literal("console"),
|
|
1214
1285
|
server: stagingServerAccessInputSchema.optional()
|
|
1215
1286
|
}).strict(),
|
|
1216
|
-
|
|
1217
|
-
mode:
|
|
1218
|
-
password:
|
|
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
|
-
|
|
1292
|
+
z6.object({ server: stagingServerAccessInputSchema }).strict()
|
|
1222
1293
|
]))();
|
|
1223
|
-
var stagingServerKeySchema = /* @__PURE__ */ (() =>
|
|
1224
|
-
id:
|
|
1225
|
-
name:
|
|
1226
|
-
lastFour:
|
|
1227
|
-
createdAt:
|
|
1228
|
-
lastUsedAt:
|
|
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__ */ (() =>
|
|
1231
|
-
items:
|
|
1232
|
-
nextCursor:
|
|
1301
|
+
var stagingServerKeyListSchema = /* @__PURE__ */ (() => z6.object({
|
|
1302
|
+
items: z6.array(stagingServerKeySchema),
|
|
1303
|
+
nextCursor: z6.null()
|
|
1233
1304
|
}))();
|
|
1234
|
-
var stagingServerKeyInputSchema = /* @__PURE__ */ (() =>
|
|
1305
|
+
var stagingServerKeyInputSchema = /* @__PURE__ */ (() => z6.object({ name: z6.string().trim().min(1).max(80) }).strict())();
|
|
1235
1306
|
var stagingServerKeyCreatedSchema = /* @__PURE__ */ (() => stagingServerKeySchema.extend({
|
|
1236
|
-
key:
|
|
1307
|
+
key: z6.string()
|
|
1237
1308
|
}))();
|
|
1238
|
-
var stagingPathSchema = /* @__PURE__ */ (() =>
|
|
1239
|
-
if (!path.startsWith("/") || path.startsWith("//") || path.includes("\\") || // oxlint-disable-next-line no-control-regex
|
|
1309
|
+
var stagingPathSchema = /* @__PURE__ */ (() => z6.string().max(2048).refine((path) => {
|
|
1310
|
+
if (!path.startsWith("/") || path.startsWith("//") || path.includes("\\") || // oxlint-disable-next-line no-control-regex -- control characters are what it refuses.
|
|
1240
1311
|
/[\u0000-\u001f\u007f]/.test(path)) {
|
|
1241
1312
|
return false;
|
|
1242
1313
|
}
|
|
@@ -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__ */ (() =>
|
|
1250
|
-
url:
|
|
1251
|
-
expiresAt:
|
|
1320
|
+
var stagingLinkSchema = /* @__PURE__ */ (() => z6.object({
|
|
1321
|
+
url: z6.string().url(),
|
|
1322
|
+
expiresAt: z6.number()
|
|
1252
1323
|
}))();
|
|
1253
|
-
var buildSnapshotSchema = /* @__PURE__ */ (() =>
|
|
1254
|
-
builds:
|
|
1324
|
+
var buildSnapshotSchema = /* @__PURE__ */ (() => z6.object({
|
|
1325
|
+
builds: z6.array(hostedBuildSchema),
|
|
1255
1326
|
current: hostedBuildSchema.nullable(),
|
|
1256
1327
|
selected: hostedBuildSchema.nullable(),
|
|
1257
|
-
logs:
|
|
1328
|
+
logs: z6.string()
|
|
1258
1329
|
}))();
|
|
1259
|
-
var assetPathSchema = /* @__PURE__ */ (() =>
|
|
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__ */ (() =>
|
|
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__ */ (() =>
|
|
1272
|
-
encoding:
|
|
1273
|
-
sha256:
|
|
1274
|
-
compressedSize:
|
|
1275
|
-
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:
|
|
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:
|
|
1354
|
+
worker: z6.object({
|
|
1284
1355
|
...workerSettings,
|
|
1285
1356
|
migrations: appMigrationsSchema.optional(),
|
|
1286
|
-
modules:
|
|
1287
|
-
|
|
1357
|
+
modules: z6.array(
|
|
1358
|
+
z6.object({
|
|
1288
1359
|
path: outputPathSchema.refine((path) => path !== "metadata"),
|
|
1289
|
-
type:
|
|
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:
|
|
1300
|
-
|
|
1370
|
+
assets: z6.array(
|
|
1371
|
+
z6.object({
|
|
1301
1372
|
path: assetPathSchema,
|
|
1302
1373
|
content: base64Schema.max(14e6),
|
|
1303
|
-
size:
|
|
1374
|
+
size: z6.number().int().min(0).max(1e7)
|
|
1304
1375
|
}).strict()
|
|
1305
1376
|
).max(500)
|
|
1306
1377
|
}))();
|
|
1307
|
-
var inlineCode = () =>
|
|
1308
|
-
var buildArtifactsSchema = /* @__PURE__ */ (() =>
|
|
1309
|
-
|
|
1310
|
-
format:
|
|
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
|
-
|
|
1316
|
-
format:
|
|
1386
|
+
z6.object({
|
|
1387
|
+
format: z6.literal(2),
|
|
1317
1388
|
...artifactFields,
|
|
1318
1389
|
deployment: stagedDeploymentSchema,
|
|
1319
|
-
images:
|
|
1390
|
+
images: z6.array(imageAssetArtifactSchema).max(10)
|
|
1320
1391
|
}).strict()
|
|
1321
1392
|
]).superRefine((value, ctx) => {
|
|
1322
1393
|
if (value.worker) {
|
|
@@ -1381,9 +1452,14 @@ function bareOrigin(url) {
|
|
|
1381
1452
|
}
|
|
1382
1453
|
|
|
1383
1454
|
// src/identity-integration.ts
|
|
1384
|
-
import * as
|
|
1385
|
-
var exactOrigin = (allowed, message) =>
|
|
1386
|
-
|
|
1455
|
+
import * as z7 from "zod";
|
|
1456
|
+
var exactOrigin = (allowed, message) => z7.string().url().superRefine((value, context) => {
|
|
1457
|
+
let url;
|
|
1458
|
+
try {
|
|
1459
|
+
url = new URL(value);
|
|
1460
|
+
} catch {
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1387
1463
|
if (!allowed(url)) {
|
|
1388
1464
|
context.addIssue({ code: "custom", message });
|
|
1389
1465
|
} else if (url.origin !== value) {
|
|
@@ -1401,8 +1477,8 @@ var appLoginOriginSchema = /* @__PURE__ */ (() => exactOrigin(
|
|
|
1401
1477
|
(url) => secureOrLoopbackOrigin(url),
|
|
1402
1478
|
"Use an HTTPS origin, or a loopback origin such as http://localhost:3000 for a Test key."
|
|
1403
1479
|
))();
|
|
1404
|
-
var identityIntegrationInputSchema = /* @__PURE__ */ (() =>
|
|
1405
|
-
name:
|
|
1480
|
+
var identityIntegrationInputSchema = /* @__PURE__ */ (() => z7.object({
|
|
1481
|
+
name: z7.string().trim().min(1).max(80),
|
|
1406
1482
|
origin: appLoginOriginSchema,
|
|
1407
1483
|
/**
|
|
1408
1484
|
* The identity kind this integration owns in the project and environment, such as
|
|
@@ -1421,11 +1497,11 @@ var identityIntegrationInputSchema = /* @__PURE__ */ (() => z6.object({
|
|
|
1421
1497
|
* users as that integration's, because each one then signs in as the member that ID is linked
|
|
1422
1498
|
* to. Needs `reason`, which the audit log keeps.
|
|
1423
1499
|
*/
|
|
1424
|
-
adoptIdentitiesFrom:
|
|
1500
|
+
adoptIdentitiesFrom: z7.string().uuid().optional(),
|
|
1425
1501
|
/** Why the identities are adopted; required with `adoptIdentitiesFrom`. */
|
|
1426
|
-
reason:
|
|
1502
|
+
reason: z7.string().trim().min(1).max(500).optional(),
|
|
1427
1503
|
/** Days until the first secret expires. Omit it for a key that never expires. */
|
|
1428
|
-
expiresInDays:
|
|
1504
|
+
expiresInDays: z7.number().int().min(1).max(3650).optional()
|
|
1429
1505
|
}).strict().refine(
|
|
1430
1506
|
(input) => !input.adoptIdentitiesFrom || input.identityKind,
|
|
1431
1507
|
"Adopting identities needs the identityKind they have"
|
|
@@ -1433,65 +1509,65 @@ var identityIntegrationInputSchema = /* @__PURE__ */ (() => z6.object({
|
|
|
1433
1509
|
(input) => !input.adoptIdentitiesFrom === !input.reason,
|
|
1434
1510
|
"Give a reason when adopting identities, and only then"
|
|
1435
1511
|
))();
|
|
1436
|
-
var identityIntegrationSchema = /* @__PURE__ */ (() =>
|
|
1512
|
+
var identityIntegrationSchema = /* @__PURE__ */ (() => z7.object({
|
|
1437
1513
|
...authScopeSchema.shape,
|
|
1438
|
-
id:
|
|
1439
|
-
name:
|
|
1440
|
-
origin:
|
|
1514
|
+
id: z7.string().uuid(),
|
|
1515
|
+
name: z7.string(),
|
|
1516
|
+
origin: z7.string(),
|
|
1441
1517
|
/**
|
|
1442
1518
|
* When the integration's last working secret expires: 8640000000000000 (the latest date
|
|
1443
1519
|
* JavaScript represents) when one never does.
|
|
1444
1520
|
*
|
|
1445
1521
|
* @deprecated Read `secrets`, which gives each secret's own expiry.
|
|
1446
1522
|
*/
|
|
1447
|
-
expiresAt:
|
|
1523
|
+
expiresAt: z7.number(),
|
|
1448
1524
|
/** The integration's working secrets, oldest first. Any of them authenticates it. */
|
|
1449
|
-
secrets:
|
|
1525
|
+
secrets: z7.array(credentialSecretSchema).default([]),
|
|
1450
1526
|
/** The latest use of any of its secrets, revoked ones included; null when none was used. */
|
|
1451
|
-
lastUsedAt:
|
|
1527
|
+
lastUsedAt: z7.number().nullable().default(null),
|
|
1452
1528
|
/** The identity kind the integration owns; null when it only signs members in. */
|
|
1453
1529
|
identityKind: openIdentityKindSchema.nullable().default(null),
|
|
1454
1530
|
/**
|
|
1455
1531
|
* Whether the app's server may vouch for its members' accounts when it signs them in
|
|
1456
1532
|
* (`accounts` on the exchange). False in Relay versions without it.
|
|
1457
1533
|
*/
|
|
1458
|
-
vouchesAccounts:
|
|
1534
|
+
vouchesAccounts: z7.boolean().default(false)
|
|
1459
1535
|
}))();
|
|
1460
1536
|
var identityIntegrationSecretSchema = /* @__PURE__ */ (() => identityIntegrationSchema.extend(
|
|
1461
1537
|
{
|
|
1462
|
-
token:
|
|
1538
|
+
token: z7.string()
|
|
1463
1539
|
}
|
|
1464
1540
|
))();
|
|
1465
1541
|
var identityIntegrationAppSecretSchema = /* @__PURE__ */ (() => identityIntegrationSchema.extend({ appSecret: appSecretSchema }))();
|
|
1466
|
-
var identityKindClaimSchema = /* @__PURE__ */ (() =>
|
|
1542
|
+
var identityKindClaimSchema = /* @__PURE__ */ (() => z7.object({
|
|
1467
1543
|
kind: openIdentityKindSchema,
|
|
1468
1544
|
/** The owning integration's ID; it stays after the integration is disconnected. */
|
|
1469
|
-
integration:
|
|
1545
|
+
integration: z7.string(),
|
|
1470
1546
|
/** The owning integration's name when it claimed or adopted the kind. */
|
|
1471
|
-
integrationName:
|
|
1547
|
+
integrationName: z7.string(),
|
|
1472
1548
|
/** Whether the owning integration is still connected. */
|
|
1473
|
-
connected:
|
|
1549
|
+
connected: z7.boolean(),
|
|
1474
1550
|
/** Linked identities of the kind; adopting them is required to reuse the kind. */
|
|
1475
|
-
linked:
|
|
1551
|
+
linked: z7.number().int().nonnegative(),
|
|
1476
1552
|
/** Identities an operator unlinked. */
|
|
1477
|
-
unlinked:
|
|
1478
|
-
claimedAt:
|
|
1553
|
+
unlinked: z7.number().int().nonnegative(),
|
|
1554
|
+
claimedAt: z7.number().int().nonnegative()
|
|
1479
1555
|
}))();
|
|
1480
|
-
var identityIntegrationAccountVouchingInputSchema = /* @__PURE__ */ (() =>
|
|
1481
|
-
enabled:
|
|
1482
|
-
reason:
|
|
1556
|
+
var identityIntegrationAccountVouchingInputSchema = /* @__PURE__ */ (() => z7.object({
|
|
1557
|
+
enabled: z7.boolean(),
|
|
1558
|
+
reason: z7.string().trim().min(1).max(500),
|
|
1483
1559
|
actionId: identifier.optional()
|
|
1484
1560
|
}).strict())();
|
|
1485
1561
|
var vouchedProviders = ["x", "telegram", "discord"];
|
|
1486
|
-
var participantExchangeAccountsSchema = /* @__PURE__ */ (() =>
|
|
1562
|
+
var participantExchangeAccountsSchema = /* @__PURE__ */ (() => z7.array(memberImportVouchedAccountSchema).max(20).refine(
|
|
1487
1563
|
(accounts) => vouchedProviders.every(
|
|
1488
1564
|
(kind) => accounts.filter((entry) => entry.kind === kind).length <= 1
|
|
1489
1565
|
),
|
|
1490
1566
|
"Vouch for at most one X, Telegram and Discord account each"
|
|
1491
1567
|
))();
|
|
1492
|
-
var participantExchangeSchema = /* @__PURE__ */ (() =>
|
|
1493
|
-
subject:
|
|
1494
|
-
previousToken:
|
|
1568
|
+
var participantExchangeSchema = /* @__PURE__ */ (() => z7.object({
|
|
1569
|
+
subject: z7.string().min(1).max(200),
|
|
1570
|
+
previousToken: z7.string().max(200).optional(),
|
|
1495
1571
|
/**
|
|
1496
1572
|
* Accounts the app vouches belong to this member, attached on the organization's word like an
|
|
1497
1573
|
* import's. Needs an integration with `vouchesAccounts`; otherwise the exchange is refused with
|
|
@@ -1499,32 +1575,32 @@ var participantExchangeSchema = /* @__PURE__ */ (() => z6.object({
|
|
|
1499
1575
|
*/
|
|
1500
1576
|
accounts: participantExchangeAccountsSchema.optional()
|
|
1501
1577
|
}).strict())();
|
|
1502
|
-
var participantExchangeAccountResultSchema = /* @__PURE__ */ (() =>
|
|
1578
|
+
var participantExchangeAccountResultSchema = /* @__PURE__ */ (() => z7.object({
|
|
1503
1579
|
account: memberImportVouchedAccountSchema,
|
|
1504
|
-
status:
|
|
1505
|
-
code:
|
|
1506
|
-
message:
|
|
1580
|
+
status: z7.string(),
|
|
1581
|
+
code: z7.string().optional(),
|
|
1582
|
+
message: z7.string().optional()
|
|
1507
1583
|
}))();
|
|
1508
1584
|
var participantExchangeResultSchema = /* @__PURE__ */ (() => exchangeResultSchema.extend({
|
|
1509
|
-
accounts:
|
|
1585
|
+
accounts: z7.array(participantExchangeAccountResultSchema).optional()
|
|
1510
1586
|
}))();
|
|
1511
|
-
var identityIntegrationKeySchema = /* @__PURE__ */ (() =>
|
|
1512
|
-
id:
|
|
1513
|
-
name:
|
|
1514
|
-
organization:
|
|
1515
|
-
project:
|
|
1516
|
-
environment:
|
|
1517
|
-
origin:
|
|
1587
|
+
var identityIntegrationKeySchema = /* @__PURE__ */ (() => z7.object({
|
|
1588
|
+
id: z7.string(),
|
|
1589
|
+
name: z7.string(),
|
|
1590
|
+
organization: z7.string(),
|
|
1591
|
+
project: z7.string(),
|
|
1592
|
+
environment: z7.string(),
|
|
1593
|
+
origin: z7.string(),
|
|
1518
1594
|
identityKind: openIdentityKindSchema.nullable().default(null),
|
|
1519
|
-
vouchesAccounts:
|
|
1520
|
-
secretExpiresAt:
|
|
1521
|
-
appOrigins:
|
|
1595
|
+
vouchesAccounts: z7.boolean().default(false),
|
|
1596
|
+
secretExpiresAt: z7.number().nullable().default(null),
|
|
1597
|
+
appOrigins: z7.array(z7.string()).default([])
|
|
1522
1598
|
}))();
|
|
1523
|
-
var accountVouchedBySchema = /* @__PURE__ */ (() =>
|
|
1599
|
+
var accountVouchedBySchema = /* @__PURE__ */ (() => z7.object({
|
|
1524
1600
|
/** The integration's ID; it stays after the integration is disconnected. */
|
|
1525
|
-
integration:
|
|
1601
|
+
integration: z7.string(),
|
|
1526
1602
|
/** The integration's name when it vouched for the account. */
|
|
1527
|
-
integrationName:
|
|
1603
|
+
integrationName: z7.string()
|
|
1528
1604
|
}))();
|
|
1529
1605
|
|
|
1530
1606
|
export {
|
|
@@ -1581,6 +1657,14 @@ export {
|
|
|
1581
1657
|
offeredStarterSchema,
|
|
1582
1658
|
starterTemplates,
|
|
1583
1659
|
starterIdSchema,
|
|
1660
|
+
environmentSchema,
|
|
1661
|
+
roleSchema,
|
|
1662
|
+
permissionSchema,
|
|
1663
|
+
permissionListSchema,
|
|
1664
|
+
rolePermissions,
|
|
1665
|
+
projectRoleSchema,
|
|
1666
|
+
projectPermissionSchema,
|
|
1667
|
+
projectRolePermissions,
|
|
1584
1668
|
appRoutingSchema,
|
|
1585
1669
|
APP_SECRET_LIMIT,
|
|
1586
1670
|
APP_KV_LIMIT,
|
|
@@ -1591,6 +1675,9 @@ export {
|
|
|
1591
1675
|
appSecretNameSchema,
|
|
1592
1676
|
appSecretValueSchema,
|
|
1593
1677
|
appSecretInputSchema,
|
|
1678
|
+
AppSecretCredentialKind,
|
|
1679
|
+
AppSecretCredentialStatus,
|
|
1680
|
+
appSecretCredentialSchema,
|
|
1594
1681
|
appSecretSchema,
|
|
1595
1682
|
appSecretDeclarationSchema,
|
|
1596
1683
|
appSecretDeclarationsSchema,
|