@astrale-domains/services 0.3.1 → 0.3.2
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 +7 -0
- package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +126 -126
- package/dist/schema/modules/service/classes/service.d.ts +4 -4
- package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +0 -160
- package/dist/schema/modules/service/functions/deploy-cloudflare-worker.js +1 -46
- package/dist/schema/modules/service/functions/index.d.ts +1 -2
- package/dist/schema/modules/service/functions/index.js +1 -1
- package/dist/schema/modules/service/functions/set-service-secret.d.ts +2 -2
- package/dist/schema/modules/service/index.d.ts +3 -4
- package/dist/schema/modules/service/index.js +2 -2
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.d.ts +160 -0
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.js +46 -0
- package/dist/schema/modules/service/types/index.d.ts +2 -0
- package/dist/schema/modules/service/types/index.js +1 -0
- package/dist/schema/schema.d.ts +130 -130
- package/package.json +3 -3
|
@@ -88,10 +88,10 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
88
88
|
}, {
|
|
89
89
|
readonly mode: 'value';
|
|
90
90
|
readonly value: {
|
|
91
|
-
name: string;
|
|
92
|
-
} | {
|
|
93
91
|
kind: "rejected";
|
|
94
92
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
93
|
+
} | {
|
|
94
|
+
name: string;
|
|
95
95
|
};
|
|
96
96
|
}, "authorized", false, "default">>;
|
|
97
97
|
readonly deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
@@ -199,10 +199,10 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
199
199
|
}, {
|
|
200
200
|
readonly mode: 'value';
|
|
201
201
|
readonly value: {
|
|
202
|
-
name: string;
|
|
203
|
-
} | {
|
|
204
202
|
kind: "rejected";
|
|
205
203
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
204
|
+
} | {
|
|
205
|
+
name: string;
|
|
206
206
|
};
|
|
207
207
|
}, "authorized", false, "default">>, "setSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
208
208
|
name: string;
|
|
@@ -1,163 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const artifact: z.ZodObject<{
|
|
3
|
-
entry: z.ZodString;
|
|
4
|
-
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
5
|
-
contentBase64: z.ZodString;
|
|
6
|
-
name: z.ZodString;
|
|
7
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
8
|
-
data: "data";
|
|
9
|
-
esm: "esm";
|
|
10
|
-
text: "text";
|
|
11
|
-
wasm: "wasm";
|
|
12
|
-
}>>;
|
|
13
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
14
|
-
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
15
|
-
name: z.ZodString;
|
|
16
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
17
|
-
data: "data";
|
|
18
|
-
esm: "esm";
|
|
19
|
-
text: "text";
|
|
20
|
-
wasm: "wasm";
|
|
21
|
-
}>>;
|
|
22
|
-
}, z.core.$strict>]>>;
|
|
23
|
-
}, z.core.$strict>;
|
|
24
|
-
export declare const revisionedDeployment: z.ZodObject<{
|
|
25
|
-
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
26
|
-
release: z.ZodObject<{
|
|
27
|
-
entry: z.ZodString;
|
|
28
|
-
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
29
|
-
contentBase64: z.ZodString;
|
|
30
|
-
name: z.ZodString;
|
|
31
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
32
|
-
data: "data";
|
|
33
|
-
esm: "esm";
|
|
34
|
-
text: "text";
|
|
35
|
-
wasm: "wasm";
|
|
36
|
-
}>>;
|
|
37
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
38
|
-
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
39
|
-
name: z.ZodString;
|
|
40
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
41
|
-
data: "data";
|
|
42
|
-
esm: "esm";
|
|
43
|
-
text: "text";
|
|
44
|
-
wasm: "wasm";
|
|
45
|
-
}>>;
|
|
46
|
-
}, z.core.$strict>]>>;
|
|
47
|
-
}, z.core.$strict>;
|
|
48
|
-
}, z.core.$strict>;
|
|
49
|
-
export declare const deployServiceInput: z.ZodObject<{
|
|
50
|
-
name: z.ZodOptional<z.ZodString>;
|
|
51
|
-
entry: z.ZodOptional<z.ZodString>;
|
|
52
|
-
modules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
53
|
-
contentBase64: z.ZodString;
|
|
54
|
-
name: z.ZodString;
|
|
55
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
56
|
-
data: "data";
|
|
57
|
-
esm: "esm";
|
|
58
|
-
text: "text";
|
|
59
|
-
wasm: "wasm";
|
|
60
|
-
}>>;
|
|
61
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
-
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
63
|
-
name: z.ZodString;
|
|
64
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
65
|
-
data: "data";
|
|
66
|
-
esm: "esm";
|
|
67
|
-
text: "text";
|
|
68
|
-
wasm: "wasm";
|
|
69
|
-
}>>;
|
|
70
|
-
}, z.core.$strict>]>>>;
|
|
71
|
-
revisioned: z.ZodOptional<z.ZodObject<{
|
|
72
|
-
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
73
|
-
release: z.ZodObject<{
|
|
74
|
-
entry: z.ZodString;
|
|
75
|
-
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
76
|
-
contentBase64: z.ZodString;
|
|
77
|
-
name: z.ZodString;
|
|
78
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
79
|
-
data: "data";
|
|
80
|
-
esm: "esm";
|
|
81
|
-
text: "text";
|
|
82
|
-
wasm: "wasm";
|
|
83
|
-
}>>;
|
|
84
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
-
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
86
|
-
name: z.ZodString;
|
|
87
|
-
kind: z.ZodOptional<z.ZodEnum<{
|
|
88
|
-
data: "data";
|
|
89
|
-
esm: "esm";
|
|
90
|
-
text: "text";
|
|
91
|
-
wasm: "wasm";
|
|
92
|
-
}>>;
|
|
93
|
-
}, z.core.$strict>]>>;
|
|
94
|
-
}, z.core.$strict>;
|
|
95
|
-
}, z.core.$strict>>;
|
|
96
|
-
compatibilityDate: z.ZodOptional<z.ZodString>;
|
|
97
|
-
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
-
serviceBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
99
|
-
name: z.ZodString;
|
|
100
|
-
service: z.ZodString;
|
|
101
|
-
}, z.core.$strict>>>;
|
|
102
|
-
vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
103
|
-
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
104
|
-
assets: z.ZodOptional<z.ZodObject<{
|
|
105
|
-
files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
106
|
-
contentBase64: z.ZodString;
|
|
107
|
-
path: z.ZodString;
|
|
108
|
-
contentType: z.ZodOptional<z.ZodString>;
|
|
109
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
-
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
111
|
-
path: z.ZodString;
|
|
112
|
-
contentType: z.ZodOptional<z.ZodString>;
|
|
113
|
-
}, z.core.$strict>]>>;
|
|
114
|
-
notFound: z.ZodOptional<z.ZodEnum<{
|
|
115
|
-
"404-page": "404-page";
|
|
116
|
-
none: "none";
|
|
117
|
-
"single-page-application": "single-page-application";
|
|
118
|
-
}>>;
|
|
119
|
-
runWorkerFirst: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
-
htmlHandling: z.ZodOptional<z.ZodLiteral<"none">>;
|
|
121
|
-
}, z.core.$strict>>;
|
|
122
|
-
limits: z.ZodOptional<z.ZodObject<{
|
|
123
|
-
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
124
|
-
subrequests: z.ZodOptional<z.ZodNumber>;
|
|
125
|
-
}, z.core.$strict>>;
|
|
126
|
-
serviceKey: z.ZodString;
|
|
127
|
-
}, z.core.$strict>;
|
|
128
|
-
export type DeployServiceInput = z.infer<typeof deployServiceInput>;
|
|
129
|
-
export declare const deployedService: z.ZodObject<{
|
|
130
|
-
id: z.ZodString;
|
|
131
|
-
serviceKey: z.ZodString;
|
|
132
|
-
url: z.ZodString;
|
|
133
|
-
digest: z.ZodString;
|
|
134
|
-
state: z.ZodLiteral<"ready">;
|
|
135
|
-
}, z.core.$strict>;
|
|
136
|
-
export declare const deploymentRejection: z.ZodObject<{
|
|
137
|
-
kind: z.ZodLiteral<"rejected">;
|
|
138
|
-
reason: z.ZodEnum<{
|
|
139
|
-
"artifact-mode-conflict": "artifact-mode-conflict";
|
|
140
|
-
"invalid-deployment": "invalid-deployment";
|
|
141
|
-
"service-unavailable": "service-unavailable";
|
|
142
|
-
}>;
|
|
143
|
-
message: z.ZodString;
|
|
144
|
-
}, z.core.$strict>;
|
|
145
|
-
export declare const deployServiceOutput: z.ZodUnion<readonly [z.ZodObject<{
|
|
146
|
-
id: z.ZodString;
|
|
147
|
-
serviceKey: z.ZodString;
|
|
148
|
-
url: z.ZodString;
|
|
149
|
-
digest: z.ZodString;
|
|
150
|
-
state: z.ZodLiteral<"ready">;
|
|
151
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
152
|
-
kind: z.ZodLiteral<"rejected">;
|
|
153
|
-
reason: z.ZodEnum<{
|
|
154
|
-
"artifact-mode-conflict": "artifact-mode-conflict";
|
|
155
|
-
"invalid-deployment": "invalid-deployment";
|
|
156
|
-
"service-unavailable": "service-unavailable";
|
|
157
|
-
}>;
|
|
158
|
-
message: z.ZodString;
|
|
159
|
-
}, z.core.$strict>]>;
|
|
160
|
-
export type DeployServiceOutput = z.infer<typeof deployServiceOutput>;
|
|
161
1
|
export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
162
2
|
name?: string | undefined;
|
|
163
3
|
entry?: string | undefined;
|
|
@@ -1,50 +1,5 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
import { artifactModule, assetBundle, resourceLimits } from '../types/index.js';
|
|
4
|
-
export const artifact = z.strictObject({
|
|
5
|
-
entry: z.string().min(1).max(256),
|
|
6
|
-
modules: z.array(artifactModule).min(1).max(40),
|
|
7
|
-
});
|
|
8
|
-
export const revisionedDeployment = z.strictObject({
|
|
9
|
-
requiredSecrets: z.array(z.string().min(1).max(128)).max(64),
|
|
10
|
-
release: artifact,
|
|
11
|
-
});
|
|
12
|
-
const deployServiceFields = {
|
|
13
|
-
name: z.string().min(1).max(256).optional(),
|
|
14
|
-
entry: z.string().min(1).max(256).optional(),
|
|
15
|
-
modules: z.array(artifactModule).min(1).max(40).optional(),
|
|
16
|
-
revisioned: revisionedDeployment.optional(),
|
|
17
|
-
compatibilityDate: z.string().min(1).max(32).optional(),
|
|
18
|
-
compatibilityFlags: z.array(z.string().min(1).max(128)).max(64).optional(),
|
|
19
|
-
serviceBindings: z
|
|
20
|
-
.array(z.strictObject({
|
|
21
|
-
name: z.string().min(1).max(64),
|
|
22
|
-
service: z.string().min(1).max(128),
|
|
23
|
-
}))
|
|
24
|
-
.max(32)
|
|
25
|
-
.optional(),
|
|
26
|
-
vars: z.record(z.string().max(256), z.string().max(64 * 1024)).optional(),
|
|
27
|
-
secrets: z.record(z.string().max(256), z.string().max(64 * 1024)).optional(),
|
|
28
|
-
assets: assetBundle.optional(),
|
|
29
|
-
limits: resourceLimits,
|
|
30
|
-
};
|
|
31
|
-
export const deployServiceInput = z.strictObject({
|
|
32
|
-
serviceKey: z.string().min(1).max(63),
|
|
33
|
-
...deployServiceFields,
|
|
34
|
-
});
|
|
35
|
-
export const deployedService = z.strictObject({
|
|
36
|
-
id: z.string().min(1),
|
|
37
|
-
serviceKey: z.string().min(1),
|
|
38
|
-
url: z.string(),
|
|
39
|
-
digest: z.string(),
|
|
40
|
-
state: z.literal('ready'),
|
|
41
|
-
});
|
|
42
|
-
export const deploymentRejection = z.strictObject({
|
|
43
|
-
kind: z.literal('rejected'),
|
|
44
|
-
reason: z.enum(['invalid-deployment', 'service-unavailable', 'artifact-mode-conflict']),
|
|
45
|
-
message: z.string().min(1).max(500),
|
|
46
|
-
});
|
|
47
|
-
export const deployServiceOutput = z.union([deployedService, deploymentRejection]);
|
|
2
|
+
import { deployServiceInput, deployServiceOutput } from '../types/deploy-cloudflare-worker.js';
|
|
48
3
|
export const deployCloudflareWorker = method({
|
|
49
4
|
description: 'Create or converge one Cloudflare Worker Service.',
|
|
50
5
|
auth: 'authenticated',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { deleteServiceSecret } from './delete-service-secret.js';
|
|
2
2
|
export { deleteService } from './delete-service.js';
|
|
3
|
-
export {
|
|
4
|
-
export type { DeployServiceInput, DeployServiceOutput } from './deploy-cloudflare-worker.js';
|
|
3
|
+
export { deployCloudflareWorker } from './deploy-cloudflare-worker.js';
|
|
5
4
|
export { listServiceLogs } from './list-service-logs.js';
|
|
6
5
|
export { listServiceSchedules } from './list-service-schedules.js';
|
|
7
6
|
export { listServiceSecretNames } from './list-service-secret-names.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { deleteServiceSecret } from './delete-service-secret.js';
|
|
2
2
|
export { deleteService } from './delete-service.js';
|
|
3
|
-
export {
|
|
3
|
+
export { deployCloudflareWorker } from './deploy-cloudflare-worker.js';
|
|
4
4
|
export { listServiceLogs } from './list-service-logs.js';
|
|
5
5
|
export { listServiceSchedules } from './list-service-schedules.js';
|
|
6
6
|
export { listServiceSecretNames } from './list-service-secret-names.js';
|
|
@@ -4,9 +4,9 @@ export declare const setServiceSecret: import("@astrale-os/sdk/schema").Method<i
|
|
|
4
4
|
}, {
|
|
5
5
|
readonly mode: 'value';
|
|
6
6
|
readonly value: {
|
|
7
|
-
name: string;
|
|
8
|
-
} | {
|
|
9
7
|
kind: "rejected";
|
|
10
8
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
11
|
};
|
|
12
12
|
}, "authorized", false, "default">>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export { CloudflareWorker, Service, service_owned_by } from './classes/index.js';
|
|
2
2
|
export { ServicesShell } from './dependencies/index.js';
|
|
3
|
-
export {
|
|
4
|
-
export type { DeployServiceInput, DeployServiceOutput } from './functions/index.js';
|
|
3
|
+
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './functions/index.js';
|
|
5
4
|
export { OwnService, TraverseOwnedService } from './policies/index.js';
|
|
6
5
|
export { serviceLifecycle } from './states/index.js';
|
|
7
6
|
export type { ServiceLifecycle, ServiceLifecycleEvent } from './states/index.js';
|
|
8
|
-
export { artifactModule, assetBundle, assetFile, resourceLimits, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
|
|
9
|
-
export type { ArtifactModule, AssetBundle, ResourceLimits } from './types/index.js';
|
|
7
|
+
export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
|
|
8
|
+
export type { ArtifactModule, AssetBundle, DeployServiceInput, DeployServiceOutput, ResourceLimits, } from './types/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { CloudflareWorker, Service, service_owned_by } from './classes/index.js';
|
|
2
2
|
export { ServicesShell } from './dependencies/index.js';
|
|
3
|
-
export {
|
|
3
|
+
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './functions/index.js';
|
|
4
4
|
export { OwnService, TraverseOwnedService } from './policies/index.js';
|
|
5
5
|
export { serviceLifecycle } from './states/index.js';
|
|
6
|
-
export { artifactModule, assetBundle, assetFile, resourceLimits, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
|
|
6
|
+
export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const artifact: z.ZodObject<{
|
|
3
|
+
entry: z.ZodString;
|
|
4
|
+
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
5
|
+
contentBase64: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
data: "data";
|
|
9
|
+
esm: "esm";
|
|
10
|
+
text: "text";
|
|
11
|
+
wasm: "wasm";
|
|
12
|
+
}>>;
|
|
13
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
14
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
data: "data";
|
|
18
|
+
esm: "esm";
|
|
19
|
+
text: "text";
|
|
20
|
+
wasm: "wasm";
|
|
21
|
+
}>>;
|
|
22
|
+
}, z.core.$strict>]>>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
export declare const revisionedDeployment: z.ZodObject<{
|
|
25
|
+
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
26
|
+
release: z.ZodObject<{
|
|
27
|
+
entry: z.ZodString;
|
|
28
|
+
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
29
|
+
contentBase64: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
32
|
+
data: "data";
|
|
33
|
+
esm: "esm";
|
|
34
|
+
text: "text";
|
|
35
|
+
wasm: "wasm";
|
|
36
|
+
}>>;
|
|
37
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
38
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
41
|
+
data: "data";
|
|
42
|
+
esm: "esm";
|
|
43
|
+
text: "text";
|
|
44
|
+
wasm: "wasm";
|
|
45
|
+
}>>;
|
|
46
|
+
}, z.core.$strict>]>>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
export declare const deployServiceInput: z.ZodObject<{
|
|
50
|
+
name: z.ZodOptional<z.ZodString>;
|
|
51
|
+
entry: z.ZodOptional<z.ZodString>;
|
|
52
|
+
modules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
53
|
+
contentBase64: z.ZodString;
|
|
54
|
+
name: z.ZodString;
|
|
55
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
data: "data";
|
|
57
|
+
esm: "esm";
|
|
58
|
+
text: "text";
|
|
59
|
+
wasm: "wasm";
|
|
60
|
+
}>>;
|
|
61
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
62
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
65
|
+
data: "data";
|
|
66
|
+
esm: "esm";
|
|
67
|
+
text: "text";
|
|
68
|
+
wasm: "wasm";
|
|
69
|
+
}>>;
|
|
70
|
+
}, z.core.$strict>]>>>;
|
|
71
|
+
revisioned: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
73
|
+
release: z.ZodObject<{
|
|
74
|
+
entry: z.ZodString;
|
|
75
|
+
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
76
|
+
contentBase64: z.ZodString;
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
data: "data";
|
|
80
|
+
esm: "esm";
|
|
81
|
+
text: "text";
|
|
82
|
+
wasm: "wasm";
|
|
83
|
+
}>>;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
88
|
+
data: "data";
|
|
89
|
+
esm: "esm";
|
|
90
|
+
text: "text";
|
|
91
|
+
wasm: "wasm";
|
|
92
|
+
}>>;
|
|
93
|
+
}, z.core.$strict>]>>;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
}, z.core.$strict>>;
|
|
96
|
+
compatibilityDate: z.ZodOptional<z.ZodString>;
|
|
97
|
+
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
+
serviceBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
service: z.ZodString;
|
|
101
|
+
}, z.core.$strict>>>;
|
|
102
|
+
vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
103
|
+
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
104
|
+
assets: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
106
|
+
contentBase64: z.ZodString;
|
|
107
|
+
path: z.ZodString;
|
|
108
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
110
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
111
|
+
path: z.ZodString;
|
|
112
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strict>]>>;
|
|
114
|
+
notFound: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
"404-page": "404-page";
|
|
116
|
+
none: "none";
|
|
117
|
+
"single-page-application": "single-page-application";
|
|
118
|
+
}>>;
|
|
119
|
+
runWorkerFirst: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
htmlHandling: z.ZodOptional<z.ZodLiteral<"none">>;
|
|
121
|
+
}, z.core.$strict>>;
|
|
122
|
+
limits: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
cpuMs: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
subrequests: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
}, z.core.$strict>>;
|
|
126
|
+
serviceKey: z.ZodString;
|
|
127
|
+
}, z.core.$strict>;
|
|
128
|
+
export type DeployServiceInput = z.infer<typeof deployServiceInput>;
|
|
129
|
+
export declare const deployedService: z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
serviceKey: z.ZodString;
|
|
132
|
+
url: z.ZodString;
|
|
133
|
+
digest: z.ZodString;
|
|
134
|
+
state: z.ZodLiteral<"ready">;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
export declare const deploymentRejection: z.ZodObject<{
|
|
137
|
+
kind: z.ZodLiteral<"rejected">;
|
|
138
|
+
reason: z.ZodEnum<{
|
|
139
|
+
"artifact-mode-conflict": "artifact-mode-conflict";
|
|
140
|
+
"invalid-deployment": "invalid-deployment";
|
|
141
|
+
"service-unavailable": "service-unavailable";
|
|
142
|
+
}>;
|
|
143
|
+
message: z.ZodString;
|
|
144
|
+
}, z.core.$strict>;
|
|
145
|
+
export declare const deployServiceOutput: z.ZodUnion<readonly [z.ZodObject<{
|
|
146
|
+
id: z.ZodString;
|
|
147
|
+
serviceKey: z.ZodString;
|
|
148
|
+
url: z.ZodString;
|
|
149
|
+
digest: z.ZodString;
|
|
150
|
+
state: z.ZodLiteral<"ready">;
|
|
151
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
152
|
+
kind: z.ZodLiteral<"rejected">;
|
|
153
|
+
reason: z.ZodEnum<{
|
|
154
|
+
"artifact-mode-conflict": "artifact-mode-conflict";
|
|
155
|
+
"invalid-deployment": "invalid-deployment";
|
|
156
|
+
"service-unavailable": "service-unavailable";
|
|
157
|
+
}>;
|
|
158
|
+
message: z.ZodString;
|
|
159
|
+
}, z.core.$strict>]>;
|
|
160
|
+
export type DeployServiceOutput = z.infer<typeof deployServiceOutput>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { artifactModule, assetBundle, resourceLimits } from '../types/index.js';
|
|
3
|
+
export const artifact = z.strictObject({
|
|
4
|
+
entry: z.string().min(1).max(256),
|
|
5
|
+
modules: z.array(artifactModule).min(1).max(40),
|
|
6
|
+
});
|
|
7
|
+
export const revisionedDeployment = z.strictObject({
|
|
8
|
+
requiredSecrets: z.array(z.string().min(1).max(128)).max(64),
|
|
9
|
+
release: artifact,
|
|
10
|
+
});
|
|
11
|
+
const deployServiceFields = {
|
|
12
|
+
name: z.string().min(1).max(256).optional(),
|
|
13
|
+
entry: z.string().min(1).max(256).optional(),
|
|
14
|
+
modules: z.array(artifactModule).min(1).max(40).optional(),
|
|
15
|
+
revisioned: revisionedDeployment.optional(),
|
|
16
|
+
compatibilityDate: z.string().min(1).max(32).optional(),
|
|
17
|
+
compatibilityFlags: z.array(z.string().min(1).max(128)).max(64).optional(),
|
|
18
|
+
serviceBindings: z
|
|
19
|
+
.array(z.strictObject({
|
|
20
|
+
name: z.string().min(1).max(64),
|
|
21
|
+
service: z.string().min(1).max(128),
|
|
22
|
+
}))
|
|
23
|
+
.max(32)
|
|
24
|
+
.optional(),
|
|
25
|
+
vars: z.record(z.string().max(256), z.string().max(64 * 1024)).optional(),
|
|
26
|
+
secrets: z.record(z.string().max(256), z.string().max(64 * 1024)).optional(),
|
|
27
|
+
assets: assetBundle.optional(),
|
|
28
|
+
limits: resourceLimits,
|
|
29
|
+
};
|
|
30
|
+
export const deployServiceInput = z.strictObject({
|
|
31
|
+
serviceKey: z.string().min(1).max(63),
|
|
32
|
+
...deployServiceFields,
|
|
33
|
+
});
|
|
34
|
+
export const deployedService = z.strictObject({
|
|
35
|
+
id: z.string().min(1),
|
|
36
|
+
serviceKey: z.string().min(1),
|
|
37
|
+
url: z.string(),
|
|
38
|
+
digest: z.string(),
|
|
39
|
+
state: z.literal('ready'),
|
|
40
|
+
});
|
|
41
|
+
export const deploymentRejection = z.strictObject({
|
|
42
|
+
kind: z.literal('rejected'),
|
|
43
|
+
reason: z.enum(['invalid-deployment', 'service-unavailable', 'artifact-mode-conflict']),
|
|
44
|
+
message: z.string().min(1).max(500),
|
|
45
|
+
});
|
|
46
|
+
export const deployServiceOutput = z.union([deployedService, deploymentRejection]);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { artifact, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, revisionedDeployment, } from './deploy-cloudflare-worker.js';
|
|
2
|
+
export type { DeployServiceInput, DeployServiceOutput } from './deploy-cloudflare-worker.js';
|
|
1
3
|
export { artifactModule } from './service-deployment-artifact-module.js';
|
|
2
4
|
export type { ArtifactModule } from './service-deployment-artifact-module.js';
|
|
3
5
|
export { assetBundle, assetFile } from './service-deployment-assets.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { artifact, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, revisionedDeployment, } from './deploy-cloudflare-worker.js';
|
|
1
2
|
export { artifactModule } from './service-deployment-artifact-module.js';
|
|
2
3
|
export { assetBundle, assetFile } from './service-deployment-assets.js';
|
|
3
4
|
export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
|