@astrale-domains/services 0.4.4 → 0.4.6
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/README.md +199 -7
- package/dist/scaffold/create-service.mjs +77 -0
- package/dist/scaffold/template/.env.example +2 -0
- package/dist/scaffold/template/README.md +37 -0
- package/dist/scaffold/template/gitignore +6 -0
- package/dist/scaffold/template/scripts/build.mjs +10 -0
- package/dist/scaffold/template/scripts/deploy.mjs +50 -0
- package/dist/scaffold/template/src/account.js +26 -0
- package/dist/scaffold/template/src/index.js +32 -0
- package/dist/scaffold/template/src/job.js +19 -0
- package/dist/schema/index.d.ts +2 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +97 -0
- package/dist/schema/modules/deployment/classes/cloudflare-deployment.js +10 -0
- package/dist/schema/modules/deployment/classes/deployment-line.d.ts +23 -0
- package/dist/schema/modules/deployment/classes/deployment-line.js +24 -0
- package/dist/schema/modules/deployment/classes/deployment-on-line.d.ts +17 -0
- package/dist/schema/modules/deployment/classes/deployment-on-line.js +11 -0
- package/dist/schema/modules/deployment/classes/deployment.d.ts +98 -0
- package/dist/schema/modules/deployment/classes/deployment.js +32 -0
- package/dist/schema/modules/deployment/classes/index.d.ts +5 -0
- package/dist/schema/modules/deployment/classes/index.js +5 -0
- package/dist/schema/modules/deployment/classes/line-owned-by.d.ts +26 -0
- package/dist/schema/modules/deployment/classes/line-owned-by.js +19 -0
- package/dist/schema/modules/deployment/index.d.ts +6 -0
- package/dist/schema/modules/deployment/index.js +4 -0
- package/dist/schema/modules/deployment/policies/index.d.ts +4 -0
- package/dist/schema/modules/deployment/policies/index.js +4 -0
- package/dist/schema/modules/deployment/policies/own-deployment.d.ts +2 -0
- package/dist/schema/modules/deployment/policies/own-deployment.js +12 -0
- package/dist/schema/modules/deployment/policies/own-line.d.ts +5 -0
- package/dist/schema/modules/deployment/policies/own-line.js +10 -0
- package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.d.ts +2 -0
- package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.js +7 -0
- package/dist/schema/modules/deployment/policies/traverse-owned-line.d.ts +2 -0
- package/dist/schema/modules/deployment/policies/traverse-owned-line.js +7 -0
- package/dist/schema/modules/deployment/states/deployment-lifecycle.d.ts +27 -0
- package/dist/schema/modules/deployment/states/deployment-lifecycle.js +17 -0
- package/dist/schema/modules/deployment/states/index.d.ts +2 -0
- package/dist/schema/modules/deployment/states/index.js +1 -0
- package/dist/schema/modules/deployment/types/deployment-record.d.ts +35 -0
- package/dist/schema/modules/deployment/types/deployment-record.js +31 -0
- package/dist/schema/modules/deployment/types/deployment-retention.d.ts +13 -0
- package/dist/schema/modules/deployment/types/deployment-retention.js +5 -0
- package/dist/schema/modules/deployment/types/index.d.ts +4 -0
- package/dist/schema/modules/deployment/types/index.js +2 -0
- package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +103 -37
- package/dist/schema/modules/service/classes/cloudflare-worker.js +4 -1
- package/dist/schema/modules/service/classes/service.d.ts +19 -19
- package/dist/schema/modules/service/functions/delete-service-secret.d.ts +1 -1
- package/dist/schema/modules/service/functions/delete-service.d.ts +1 -1
- package/dist/schema/modules/service/functions/delete-worker-secret.d.ts +1 -1
- package/dist/schema/modules/service/functions/delete-worker.d.ts +1 -1
- package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +37 -1
- package/dist/schema/modules/service/functions/index.d.ts +1 -0
- package/dist/schema/modules/service/functions/index.js +1 -0
- package/dist/schema/modules/service/functions/list-service-logs.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-service-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-service-secret-names.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-worker-logs.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-worker-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-worker-secret-names.d.ts +1 -1
- package/dist/schema/modules/service/functions/migrate-worker-ingress.d.ts +24 -0
- package/dist/schema/modules/service/functions/migrate-worker-ingress.js +26 -0
- package/dist/schema/modules/service/functions/replace-service-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/replace-worker-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/set-service-secret.d.ts +1 -1
- package/dist/schema/modules/service/functions/set-worker-secret.d.ts +3 -3
- package/dist/schema/modules/service/index.d.ts +2 -2
- package/dist/schema/modules/service/index.js +1 -1
- package/dist/schema/modules/service/types/content/index.d.ts +1 -0
- package/dist/schema/modules/service/types/content/index.js +1 -0
- package/dist/schema/modules/service/types/content/limits.d.ts +7 -0
- package/dist/schema/modules/service/types/content/limits.js +7 -0
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.d.ts +110 -0
- package/dist/schema/modules/service/types/index.d.ts +2 -1
- package/dist/schema/modules/service/types/index.js +1 -1
- package/dist/schema/modules/service/types/legacy/service-deployment-content.js +15 -0
- package/dist/schema/modules/service/types/service-deployment-artifact-module.d.ts +23 -0
- package/dist/schema/modules/service/types/service-deployment-artifact-module.js +5 -3
- package/dist/schema/modules/service/types/service-deployment-assets.d.ts +36 -0
- package/dist/schema/modules/service/types/service-deployment-assets.js +5 -3
- package/dist/schema/modules/service/types/service-deployment-content.d.ts +18 -11
- package/dist/schema/modules/service/types/service-deployment-content.js +17 -8
- package/dist/schema/schema.d.ts +365 -62
- package/dist/schema/schema.js +10 -0
- package/package.json +14 -12
|
@@ -4,9 +4,9 @@ export declare const setWorkerSecret: import("@astrale-os/sdk/schema").Method<im
|
|
|
4
4
|
}, {
|
|
5
5
|
readonly mode: 'value';
|
|
6
6
|
readonly value: {
|
|
7
|
+
name: string;
|
|
8
|
+
} | {
|
|
7
9
|
kind: "rejected";
|
|
8
10
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
9
|
-
} | {
|
|
10
|
-
name: string;
|
|
11
11
|
};
|
|
12
|
-
}, "authorized", false, false>>;
|
|
12
|
+
}, "authorized", false, false, undefined>>;
|
|
@@ -3,5 +3,5 @@ export { deleteService, deleteServiceSecret, deployCloudflareWorker, listService
|
|
|
3
3
|
export { OwnService, TraverseOwnedService } from './policies/index.js';
|
|
4
4
|
export { serviceLifecycle } from './states/index.js';
|
|
5
5
|
export type { ServiceLifecycle, ServiceLifecycleEvent } from './states/index.js';
|
|
6
|
-
export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
|
|
7
|
-
export type { ArtifactModule, AssetBundle, DeployServiceInput, DeployServiceOutput, ResourceLimits, } from './types/index.js';
|
|
6
|
+
export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, } from './types/index.js';
|
|
7
|
+
export type { ArtifactModule, AssetBundle, DeployServiceInput, DeployServiceOutput, ResourceLimits, ServiceDeploymentContent, } from './types/index.js';
|
|
@@ -2,4 +2,4 @@ export { CloudflareWorker, Service, service_owned_by } from './classes/index.js'
|
|
|
2
2
|
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './functions/index.js';
|
|
3
3
|
export { OwnService, TraverseOwnedService } from './policies/index.js';
|
|
4
4
|
export { serviceLifecycle } from './states/index.js';
|
|
5
|
-
export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
|
|
5
|
+
export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, } from './types/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './limits.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './limits.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const PORTABLE_BASE64_CHUNK_SIZE: number;
|
|
2
|
+
export declare const MAX_MODULE_BASE64_SIZE: number;
|
|
3
|
+
export declare const MAX_ASSET_BASE64_SIZE: number;
|
|
4
|
+
export declare const MAX_MODULE_DECODED_SIZE: number;
|
|
5
|
+
export declare const MAX_ASSET_DECODED_SIZE: number;
|
|
6
|
+
/** Bound retained deployment material independently of its compressed request size. */
|
|
7
|
+
export declare const MAX_DEPLOYMENT_DECODED_SIZE: number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const PORTABLE_BASE64_CHUNK_SIZE = 512 * 1024;
|
|
2
|
+
export const MAX_MODULE_BASE64_SIZE = 10 * 1024 * 1024;
|
|
3
|
+
export const MAX_ASSET_BASE64_SIZE = 16 * 1024 * 1024;
|
|
4
|
+
export const MAX_MODULE_DECODED_SIZE = (MAX_MODULE_BASE64_SIZE / 4) * 3;
|
|
5
|
+
export const MAX_ASSET_DECODED_SIZE = (MAX_ASSET_BASE64_SIZE / 4) * 3;
|
|
6
|
+
/** Bound retained deployment material independently of its compressed request size. */
|
|
7
|
+
export const MAX_DEPLOYMENT_DECODED_SIZE = 32 * 1024 * 1024;
|
|
@@ -2,6 +2,29 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const artifact: z.ZodObject<{
|
|
3
3
|
entry: z.ZodString;
|
|
4
4
|
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
data: "data";
|
|
8
|
+
esm: "esm";
|
|
9
|
+
text: "text";
|
|
10
|
+
wasm: "wasm";
|
|
11
|
+
}>>;
|
|
12
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
13
|
+
encoding: z.ZodEnum<{
|
|
14
|
+
gzip: "gzip";
|
|
15
|
+
identity: "identity";
|
|
16
|
+
}>;
|
|
17
|
+
decodedSize: z.ZodNumber;
|
|
18
|
+
contentBase64: z.ZodString;
|
|
19
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
20
|
+
encoding: z.ZodEnum<{
|
|
21
|
+
gzip: "gzip";
|
|
22
|
+
identity: "identity";
|
|
23
|
+
}>;
|
|
24
|
+
decodedSize: z.ZodNumber;
|
|
25
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>]>;
|
|
27
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5
28
|
contentBase64: z.ZodString;
|
|
6
29
|
name: z.ZodString;
|
|
7
30
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -26,6 +49,29 @@ export declare const revisionedDeployment: z.ZodObject<{
|
|
|
26
49
|
release: z.ZodObject<{
|
|
27
50
|
entry: z.ZodString;
|
|
28
51
|
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
52
|
+
name: z.ZodString;
|
|
53
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
data: "data";
|
|
55
|
+
esm: "esm";
|
|
56
|
+
text: "text";
|
|
57
|
+
wasm: "wasm";
|
|
58
|
+
}>>;
|
|
59
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
60
|
+
encoding: z.ZodEnum<{
|
|
61
|
+
gzip: "gzip";
|
|
62
|
+
identity: "identity";
|
|
63
|
+
}>;
|
|
64
|
+
decodedSize: z.ZodNumber;
|
|
65
|
+
contentBase64: z.ZodString;
|
|
66
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
67
|
+
encoding: z.ZodEnum<{
|
|
68
|
+
gzip: "gzip";
|
|
69
|
+
identity: "identity";
|
|
70
|
+
}>;
|
|
71
|
+
decodedSize: z.ZodNumber;
|
|
72
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>]>;
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
29
75
|
contentBase64: z.ZodString;
|
|
30
76
|
name: z.ZodString;
|
|
31
77
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -54,6 +100,29 @@ export declare const deployServiceInput: z.ZodObject<{
|
|
|
54
100
|
name: z.ZodOptional<z.ZodString>;
|
|
55
101
|
entry: z.ZodOptional<z.ZodString>;
|
|
56
102
|
modules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
103
|
+
name: z.ZodString;
|
|
104
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
105
|
+
data: "data";
|
|
106
|
+
esm: "esm";
|
|
107
|
+
text: "text";
|
|
108
|
+
wasm: "wasm";
|
|
109
|
+
}>>;
|
|
110
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
111
|
+
encoding: z.ZodEnum<{
|
|
112
|
+
gzip: "gzip";
|
|
113
|
+
identity: "identity";
|
|
114
|
+
}>;
|
|
115
|
+
decodedSize: z.ZodNumber;
|
|
116
|
+
contentBase64: z.ZodString;
|
|
117
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
118
|
+
encoding: z.ZodEnum<{
|
|
119
|
+
gzip: "gzip";
|
|
120
|
+
identity: "identity";
|
|
121
|
+
}>;
|
|
122
|
+
decodedSize: z.ZodNumber;
|
|
123
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
124
|
+
}, z.core.$strict>]>;
|
|
125
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
57
126
|
contentBase64: z.ZodString;
|
|
58
127
|
name: z.ZodString;
|
|
59
128
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -77,6 +146,29 @@ export declare const deployServiceInput: z.ZodObject<{
|
|
|
77
146
|
release: z.ZodObject<{
|
|
78
147
|
entry: z.ZodString;
|
|
79
148
|
modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
149
|
+
name: z.ZodString;
|
|
150
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
151
|
+
data: "data";
|
|
152
|
+
esm: "esm";
|
|
153
|
+
text: "text";
|
|
154
|
+
wasm: "wasm";
|
|
155
|
+
}>>;
|
|
156
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
157
|
+
encoding: z.ZodEnum<{
|
|
158
|
+
gzip: "gzip";
|
|
159
|
+
identity: "identity";
|
|
160
|
+
}>;
|
|
161
|
+
decodedSize: z.ZodNumber;
|
|
162
|
+
contentBase64: z.ZodString;
|
|
163
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
164
|
+
encoding: z.ZodEnum<{
|
|
165
|
+
gzip: "gzip";
|
|
166
|
+
identity: "identity";
|
|
167
|
+
}>;
|
|
168
|
+
decodedSize: z.ZodNumber;
|
|
169
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
170
|
+
}, z.core.$strict>]>;
|
|
171
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
80
172
|
contentBase64: z.ZodString;
|
|
81
173
|
name: z.ZodString;
|
|
82
174
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -111,6 +203,24 @@ export declare const deployServiceInput: z.ZodObject<{
|
|
|
111
203
|
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
112
204
|
assets: z.ZodOptional<z.ZodObject<{
|
|
113
205
|
files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
206
|
+
path: z.ZodString;
|
|
207
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
208
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
209
|
+
encoding: z.ZodEnum<{
|
|
210
|
+
gzip: "gzip";
|
|
211
|
+
identity: "identity";
|
|
212
|
+
}>;
|
|
213
|
+
decodedSize: z.ZodNumber;
|
|
214
|
+
contentBase64: z.ZodString;
|
|
215
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
216
|
+
encoding: z.ZodEnum<{
|
|
217
|
+
gzip: "gzip";
|
|
218
|
+
identity: "identity";
|
|
219
|
+
}>;
|
|
220
|
+
decodedSize: z.ZodNumber;
|
|
221
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
222
|
+
}, z.core.$strict>]>;
|
|
223
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
114
224
|
contentBase64: z.ZodString;
|
|
115
225
|
path: z.ZodString;
|
|
116
226
|
contentType: z.ZodOptional<z.ZodString>;
|
|
@@ -4,10 +4,11 @@ export { artifactModule } from './service-deployment-artifact-module.js';
|
|
|
4
4
|
export type { ArtifactModule } from './service-deployment-artifact-module.js';
|
|
5
5
|
export { assetBundle, assetFile } from './service-deployment-assets.js';
|
|
6
6
|
export type { AssetBundle } from './service-deployment-assets.js';
|
|
7
|
-
export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
|
|
7
|
+
export { MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
|
|
8
8
|
export { resourceLimits } from './service-deployment-resource-limits.js';
|
|
9
9
|
export type { ResourceLimits } from './service-deployment-resource-limits.js';
|
|
10
10
|
export { secretName } from './service-secret-name.js';
|
|
11
11
|
export { secretOperationRejection } from './service-secret-operation-rejection.js';
|
|
12
12
|
export { serviceReadiness } from './service-readiness.js';
|
|
13
13
|
export { setServiceSecretContract, deleteServiceSecretContract, listServiceSecretNamesContract, replaceServiceSchedulesContract, listServiceSchedulesContract, listServiceLogsContract, deleteServiceContract, } from './service-management.js';
|
|
14
|
+
export type { ServiceDeploymentContent } from './service-deployment-content.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { artifact, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, revisionedDeployment, } from './deploy-cloudflare-worker.js';
|
|
2
2
|
export { artifactModule } from './service-deployment-artifact-module.js';
|
|
3
3
|
export { assetBundle, assetFile } from './service-deployment-assets.js';
|
|
4
|
-
export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
|
|
4
|
+
export { MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
|
|
5
5
|
export { resourceLimits } from './service-deployment-resource-limits.js';
|
|
6
6
|
export { secretName } from './service-secret-name.js';
|
|
7
7
|
export { secretOperationRejection } from './service-secret-operation-rejection.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PORTABLE_BASE64_CHUNK_SIZE } from '../content/index.js';
|
|
3
|
+
/** @deprecated Send the content envelope instead. Retained for deployed SDK clients. */
|
|
4
|
+
export function legacyEncodedContent(maximumSize) {
|
|
5
|
+
return Object.freeze({
|
|
6
|
+
inline: { contentBase64: z.string().max(maximumSize).meta({ deprecated: true }) },
|
|
7
|
+
chunked: {
|
|
8
|
+
contentBase64Chunks: z
|
|
9
|
+
.array(z.string().min(1).max(PORTABLE_BASE64_CHUNK_SIZE))
|
|
10
|
+
.min(1)
|
|
11
|
+
.max(Math.ceil(maximumSize / PORTABLE_BASE64_CHUNK_SIZE))
|
|
12
|
+
.meta({ deprecated: true }),
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const artifactModule: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
5
|
+
data: "data";
|
|
6
|
+
esm: "esm";
|
|
7
|
+
text: "text";
|
|
8
|
+
wasm: "wasm";
|
|
9
|
+
}>>;
|
|
10
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
11
|
+
encoding: z.ZodEnum<{
|
|
12
|
+
gzip: "gzip";
|
|
13
|
+
identity: "identity";
|
|
14
|
+
}>;
|
|
15
|
+
decodedSize: z.ZodNumber;
|
|
16
|
+
contentBase64: z.ZodString;
|
|
17
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
18
|
+
encoding: z.ZodEnum<{
|
|
19
|
+
gzip: "gzip";
|
|
20
|
+
identity: "identity";
|
|
21
|
+
}>;
|
|
22
|
+
decodedSize: z.ZodNumber;
|
|
23
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
24
|
+
}, z.core.$strict>]>;
|
|
25
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3
26
|
contentBase64: z.ZodString;
|
|
4
27
|
name: z.ZodString;
|
|
5
28
|
kind: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { legacyEncodedContent } from './legacy/service-deployment-content.js';
|
|
2
3
|
import { encodedContent, MAX_MODULE_BASE64_SIZE } from './service-deployment-content.js';
|
|
3
4
|
const fields = {
|
|
4
5
|
name: z.string().min(1).max(256),
|
|
5
6
|
kind: z.enum(['esm', 'wasm', 'text', 'data']).optional(),
|
|
6
7
|
};
|
|
7
|
-
const
|
|
8
|
+
const legacy = legacyEncodedContent(MAX_MODULE_BASE64_SIZE);
|
|
8
9
|
export const artifactModule = z.union([
|
|
9
|
-
z.strictObject({ ...fields,
|
|
10
|
-
z.strictObject({ ...fields, ...
|
|
10
|
+
z.strictObject({ ...fields, content: encodedContent(MAX_MODULE_BASE64_SIZE) }),
|
|
11
|
+
z.strictObject({ ...fields, ...legacy.inline }),
|
|
12
|
+
z.strictObject({ ...fields, ...legacy.chunked }),
|
|
11
13
|
]);
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const assetFile: z.ZodUnion<readonly [z.ZodObject<{
|
|
3
|
+
path: z.ZodString;
|
|
4
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
5
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
6
|
+
encoding: z.ZodEnum<{
|
|
7
|
+
gzip: "gzip";
|
|
8
|
+
identity: "identity";
|
|
9
|
+
}>;
|
|
10
|
+
decodedSize: z.ZodNumber;
|
|
11
|
+
contentBase64: z.ZodString;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
encoding: z.ZodEnum<{
|
|
14
|
+
gzip: "gzip";
|
|
15
|
+
identity: "identity";
|
|
16
|
+
}>;
|
|
17
|
+
decodedSize: z.ZodNumber;
|
|
18
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
19
|
+
}, z.core.$strict>]>;
|
|
20
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
3
21
|
contentBase64: z.ZodString;
|
|
4
22
|
path: z.ZodString;
|
|
5
23
|
contentType: z.ZodOptional<z.ZodString>;
|
|
@@ -10,6 +28,24 @@ export declare const assetFile: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
10
28
|
}, z.core.$strict>]>;
|
|
11
29
|
export declare const assetBundle: z.ZodObject<{
|
|
12
30
|
files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
31
|
+
path: z.ZodString;
|
|
32
|
+
contentType: z.ZodOptional<z.ZodString>;
|
|
33
|
+
content: z.ZodUnion<readonly [z.ZodObject<{
|
|
34
|
+
encoding: z.ZodEnum<{
|
|
35
|
+
gzip: "gzip";
|
|
36
|
+
identity: "identity";
|
|
37
|
+
}>;
|
|
38
|
+
decodedSize: z.ZodNumber;
|
|
39
|
+
contentBase64: z.ZodString;
|
|
40
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
41
|
+
encoding: z.ZodEnum<{
|
|
42
|
+
gzip: "gzip";
|
|
43
|
+
identity: "identity";
|
|
44
|
+
}>;
|
|
45
|
+
decodedSize: z.ZodNumber;
|
|
46
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>]>;
|
|
48
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
49
|
contentBase64: z.ZodString;
|
|
14
50
|
path: z.ZodString;
|
|
15
51
|
contentType: z.ZodOptional<z.ZodString>;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { legacyEncodedContent } from './legacy/service-deployment-content.js';
|
|
2
3
|
import { encodedContent, MAX_ASSET_BASE64_SIZE } from './service-deployment-content.js';
|
|
3
4
|
const fields = {
|
|
4
5
|
path: z.string().min(1).max(2_048),
|
|
5
6
|
contentType: z.string().min(1).max(256).optional(),
|
|
6
7
|
};
|
|
7
|
-
const
|
|
8
|
+
const legacy = legacyEncodedContent(MAX_ASSET_BASE64_SIZE);
|
|
8
9
|
export const assetFile = z.union([
|
|
9
|
-
z.strictObject({ ...fields,
|
|
10
|
-
z.strictObject({ ...fields, ...
|
|
10
|
+
z.strictObject({ ...fields, content: encodedContent(MAX_ASSET_BASE64_SIZE) }),
|
|
11
|
+
z.strictObject({ ...fields, ...legacy.inline }),
|
|
12
|
+
z.strictObject({ ...fields, ...legacy.chunked }),
|
|
11
13
|
]);
|
|
12
14
|
export const assetBundle = z.strictObject({
|
|
13
15
|
files: z.array(assetFile).min(1).max(2_000),
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './content/index.js';
|
|
3
|
+
/** Encoding is transport evidence; release identity always describes decoded bytes. */
|
|
4
|
+
export declare function encodedContent(maximumSize: number): z.ZodUnion<readonly [z.ZodObject<{
|
|
5
|
+
encoding: z.ZodEnum<{
|
|
6
|
+
gzip: "gzip";
|
|
7
|
+
identity: "identity";
|
|
8
|
+
}>;
|
|
9
|
+
decodedSize: z.ZodNumber;
|
|
10
|
+
contentBase64: z.ZodString;
|
|
11
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
12
|
+
encoding: z.ZodEnum<{
|
|
13
|
+
gzip: "gzip";
|
|
14
|
+
identity: "identity";
|
|
15
|
+
}>;
|
|
16
|
+
decodedSize: z.ZodNumber;
|
|
17
|
+
contentBase64Chunks: z.ZodArray<z.ZodString>;
|
|
18
|
+
}, z.core.$strict>]>;
|
|
19
|
+
export type ServiceDeploymentContent = z.infer<ReturnType<typeof encodedContent>>;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
2
|
+
import { PORTABLE_BASE64_CHUNK_SIZE } from './content/index.js';
|
|
3
|
+
export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './content/index.js';
|
|
4
|
+
/** Encoding is transport evidence; release identity always describes decoded bytes. */
|
|
5
5
|
export function encodedContent(maximumSize) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const fields = {
|
|
7
|
+
encoding: z.enum(['identity', 'gzip']),
|
|
8
|
+
decodedSize: z
|
|
9
|
+
.number()
|
|
10
|
+
.int()
|
|
11
|
+
.min(0)
|
|
12
|
+
.max((maximumSize / 4) * 3),
|
|
13
|
+
};
|
|
14
|
+
return z.union([
|
|
15
|
+
z.strictObject({ ...fields, contentBase64: z.string().max(maximumSize) }),
|
|
16
|
+
z.strictObject({
|
|
17
|
+
...fields,
|
|
9
18
|
contentBase64Chunks: z
|
|
10
19
|
.array(z.string().min(1).max(PORTABLE_BASE64_CHUNK_SIZE))
|
|
11
20
|
.min(1)
|
|
12
21
|
.max(Math.ceil(maximumSize / PORTABLE_BASE64_CHUNK_SIZE)),
|
|
13
|
-
},
|
|
14
|
-
|
|
22
|
+
}),
|
|
23
|
+
]);
|
|
15
24
|
}
|