@astrale-domains/services 0.4.6 → 0.4.8
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 +595 -43
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.js +1 -1
- package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +366 -0
- package/dist/schema/modules/deployment/classes/cloudflare-deployment.js +20 -0
- package/dist/schema/modules/deployment/classes/deployment.d.ts +93 -2
- package/dist/schema/modules/deployment/classes/deployment.js +27 -3
- package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.d.ts +7 -0
- package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.js +8 -0
- package/dist/schema/modules/deployment/errors/deployment-label-not-found.d.ts +12 -0
- package/dist/schema/modules/deployment/errors/deployment-label-not-found.js +11 -0
- package/dist/schema/modules/deployment/errors/deployment-not-found.d.ts +10 -0
- package/dist/schema/modules/deployment/errors/deployment-not-found.js +11 -0
- package/dist/schema/modules/deployment/errors/deployment-registry-only.d.ts +11 -0
- package/dist/schema/modules/deployment/errors/deployment-registry-only.js +12 -0
- package/dist/schema/modules/deployment/errors/index.d.ts +4 -0
- package/dist/schema/modules/deployment/errors/index.js +4 -0
- package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.d.ts +170 -0
- package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.js +14 -0
- package/dist/schema/modules/deployment/functions/describe-deployment-hosting.d.ts +8 -0
- package/dist/schema/modules/deployment/functions/describe-deployment-hosting.js +11 -0
- package/dist/schema/modules/deployment/functions/expire-deployment-previews.d.ts +16 -0
- package/dist/schema/modules/deployment/functions/expire-deployment-previews.js +14 -0
- package/dist/schema/modules/deployment/functions/index.d.ts +11 -0
- package/dist/schema/modules/deployment/functions/index.js +11 -0
- package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.d.ts +5 -0
- package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.js +4 -0
- package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.d.ts +58 -0
- package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.js +10 -0
- package/dist/schema/modules/deployment/functions/list-deployment-secret-names.d.ts +4 -0
- package/dist/schema/modules/deployment/functions/list-deployment-secret-names.js +6 -0
- package/dist/schema/modules/deployment/functions/read-deployment-last-calls.d.ts +10 -0
- package/dist/schema/modules/deployment/functions/read-deployment-last-calls.js +13 -0
- package/dist/schema/modules/deployment/functions/retain-deployment.d.ts +12 -0
- package/dist/schema/modules/deployment/functions/retain-deployment.js +13 -0
- package/dist/schema/modules/deployment/functions/retire-deployment.d.ts +23 -0
- package/dist/schema/modules/deployment/functions/retire-deployment.js +17 -0
- package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.d.ts +18 -0
- package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.js +7 -0
- package/dist/schema/modules/deployment/functions/set-deployment-secret.d.ts +14 -0
- package/dist/schema/modules/deployment/functions/set-deployment-secret.js +3 -0
- package/dist/schema/modules/deployment/index.d.ts +5 -3
- package/dist/schema/modules/deployment/index.js +4 -2
- package/dist/schema/modules/deployment/policies/act-for-organization.d.ts +6 -0
- package/dist/schema/modules/deployment/policies/act-for-organization.js +10 -0
- package/dist/schema/modules/deployment/policies/index.d.ts +1 -0
- package/dist/schema/modules/deployment/policies/index.js +1 -0
- package/dist/schema/modules/deployment/states/deployment-lifecycle.d.ts +6 -3
- package/dist/schema/modules/deployment/states/deployment-lifecycle.js +6 -4
- package/dist/schema/modules/deployment/types/deployment-hosting.d.ts +94 -0
- package/dist/schema/modules/deployment/types/deployment-hosting.js +19 -0
- package/dist/schema/modules/deployment/types/deployment-request.d.ts +161 -0
- package/dist/schema/modules/deployment/types/deployment-request.js +40 -0
- package/dist/schema/modules/deployment/types/deployment-response.d.ts +109 -0
- package/dist/schema/modules/deployment/types/deployment-response.js +36 -0
- package/dist/schema/modules/deployment/types/deployment-retention.d.ts +37 -1
- package/dist/schema/modules/deployment/types/deployment-retention.js +41 -1
- package/dist/schema/modules/deployment/types/deployment-retire.d.ts +30 -0
- package/dist/schema/modules/deployment/types/deployment-retire.js +18 -0
- package/dist/schema/modules/deployment/types/deployment-secret-digest.d.ts +17 -0
- package/dist/schema/modules/deployment/types/deployment-secret-digest.js +14 -0
- package/dist/schema/modules/deployment/types/deployment-secret.d.ts +59 -0
- package/dist/schema/modules/deployment/types/deployment-secret.js +52 -0
- package/dist/schema/modules/deployment/types/deployment-summary.d.ts +165 -0
- package/dist/schema/modules/deployment/types/deployment-summary.js +38 -0
- package/dist/schema/modules/deployment/types/frozen-configuration.d.ts +52 -0
- package/dist/schema/modules/deployment/types/frozen-configuration.js +55 -0
- package/dist/schema/modules/deployment/types/index.d.ts +18 -2
- package/dist/schema/modules/deployment/types/index.js +9 -1
- package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +4 -4
- package/dist/schema/modules/service/classes/service.d.ts +2 -2
- package/dist/schema/modules/service/functions/set-worker-secret.d.ts +2 -2
- package/dist/schema/modules/service/types/legacy/service-deployment-content.js +8 -1
- package/dist/schema/schema.d.ts +456 -12
- package/dist/schema/schema.js +2 -1
- package/package.json +10 -6
package/dist/schema/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export type { ServicesDomain, ServicesSchema } from './schema.js';
|
|
|
3
3
|
export { artifact, artifactModule, assetBundle, assetFile, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, } from './modules/service/index.js';
|
|
4
4
|
export type { ArtifactModule, AssetBundle, DeployServiceInput, DeployServiceOutput, ResourceLimits, } from './modules/service/index.js';
|
|
5
5
|
export { CloudflareWorker, OwnService, Service, TraverseOwnedService, service_owned_by, } from './modules/service/index.js';
|
|
6
|
-
export { CloudflareDeployment, Deployment, DeploymentLine, OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, deploymentCommit, deploymentLifecycle, deploymentRecord, deploymentRetention, deploymentRetirement, deployment_on_line, line_owned_by, } from './modules/deployment/index.js';
|
|
7
|
-
export type { DeploymentLifecycle, DeploymentLifecycleEvent, DeploymentRecord, DeploymentRetention, DeploymentRetirement, } from './modules/deployment/index.js';
|
|
6
|
+
export { ActForOrganization, CloudflareDeployment, Deployment, DeploymentLine, OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, deploymentCommit, deploymentHosting, deploymentLabel, deploymentLifecycle, deploymentRecord, deploymentRejection, deploymentRequest, deploymentResponse, deploymentRetention, deploymentRetirement, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, deployment_on_line, expirePreviewsOutput, frozenConfiguration, lastCallsOutput, listedDeploymentSummary, line_owned_by, MAXIMUM_LAST_CALL_LABELS, MAXIMUM_PREVIEW_EXPIRY_WRITES, retireDeploymentOutput, unadmittedDeploymentSummary, } from './modules/deployment/index.js';
|
|
7
|
+
export type { DeploymentHosting, DeploymentLifecycle, DeploymentLifecycleEvent, DeploymentRecord, DeploymentRejection, DeploymentRejectionReason, DeploymentRequest, DeploymentResponse, DeploymentRetention, DeploymentRetirement, DeploymentSecretDigest, DeploymentSecretRejection, DeploymentSummary, ExpirePreviewsResult, FrozenConfiguration, ListedDeploymentSummary, RetireDeploymentResult, UnadmittedDeploymentSummary, } from './modules/deployment/index.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { schema } from './schema.js';
|
|
2
2
|
export { artifact, artifactModule, assetBundle, assetFile, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, } from './modules/service/index.js';
|
|
3
3
|
export { CloudflareWorker, OwnService, Service, TraverseOwnedService, service_owned_by, } from './modules/service/index.js';
|
|
4
|
-
export { CloudflareDeployment, Deployment, DeploymentLine, OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, deploymentCommit, deploymentLifecycle, deploymentRecord, deploymentRetention, deploymentRetirement, deployment_on_line, line_owned_by, } from './modules/deployment/index.js';
|
|
4
|
+
export { ActForOrganization, CloudflareDeployment, Deployment, DeploymentLine, OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, deploymentCommit, deploymentHosting, deploymentLabel, deploymentLifecycle, deploymentRecord, deploymentRejection, deploymentRequest, deploymentResponse, deploymentRetention, deploymentRetirement, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, deployment_on_line, expirePreviewsOutput, frozenConfiguration, lastCallsOutput, listedDeploymentSummary, line_owned_by, MAXIMUM_LAST_CALL_LABELS, MAXIMUM_PREVIEW_EXPIRY_WRITES, retireDeploymentOutput, unadmittedDeploymentSummary, } from './modules/deployment/index.js';
|
|
@@ -25,6 +25,7 @@ export declare const CloudflareDeployment: import("@astrale-os/sdk/schema").Auth
|
|
|
25
25
|
};
|
|
26
26
|
readonly failed: {
|
|
27
27
|
readonly retry: "deploying";
|
|
28
|
+
readonly retire: "retiring";
|
|
28
29
|
};
|
|
29
30
|
}, "deploying">, {
|
|
30
31
|
required?: boolean;
|
|
@@ -53,9 +54,65 @@ export declare const CloudflareDeployment: import("@astrale-os/sdk/schema").Auth
|
|
|
53
54
|
}, import("zod/v4/core").$strict>>;
|
|
54
55
|
}, import("zod/v4/core").$strict>>;
|
|
55
56
|
}, import("zod/v4/core").$strict>;
|
|
57
|
+
configuration: import("zod").ZodObject<{
|
|
58
|
+
format: import("zod").ZodLiteral<"astrale.deployment.configuration">;
|
|
59
|
+
version: import("zod").ZodLiteral<1>;
|
|
60
|
+
vars: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
61
|
+
settings: import("zod").ZodObject<{
|
|
62
|
+
maximumRequestBytes: import("zod").ZodNumber;
|
|
63
|
+
invocationTimeoutMs: import("zod").ZodNumber;
|
|
64
|
+
tokenExchange: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
|
|
65
|
+
maximumLifetimeSeconds: import("zod").ZodNumber;
|
|
66
|
+
}, import("zod/v4/core").$strict>]>;
|
|
67
|
+
durableOptions: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
68
|
+
retentionMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
69
|
+
retry: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
70
|
+
initialIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
71
|
+
maxAttempts: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
72
|
+
maxIntervalMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
73
|
+
}, import("zod/v4/core").$strict>>;
|
|
74
|
+
stepTimeoutMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
75
|
+
}, import("zod/v4/core").$strict>>;
|
|
76
|
+
}, import("zod/v4/core").$strict>;
|
|
77
|
+
runtime: import("zod").ZodObject<{
|
|
78
|
+
compatibilityDate: import("zod").ZodString;
|
|
79
|
+
compatibilityFlags: import("zod").ZodArray<import("zod").ZodString>;
|
|
80
|
+
}, import("zod/v4/core").$strict>;
|
|
81
|
+
bindings: import("zod").ZodObject<{
|
|
82
|
+
services: import("zod").ZodArray<import("zod").ZodObject<{
|
|
83
|
+
name: import("zod").ZodString;
|
|
84
|
+
service: import("zod").ZodString;
|
|
85
|
+
}, import("zod/v4/core").$strict>>;
|
|
86
|
+
dispatchNamespaces: import("zod").ZodArray<import("zod").ZodObject<{
|
|
87
|
+
name: import("zod").ZodString;
|
|
88
|
+
namespace: import("zod").ZodString;
|
|
89
|
+
}, import("zod/v4/core").$strict>>;
|
|
90
|
+
secrets: import("zod").ZodArray<import("zod").ZodString>;
|
|
91
|
+
}, import("zod/v4/core").$strict>;
|
|
92
|
+
router: import("zod").ZodUnion<readonly [import("zod").ZodLiteral<false>, import("zod").ZodObject<{
|
|
93
|
+
service: import("zod").ZodString;
|
|
94
|
+
hostSuffix: import("zod").ZodString;
|
|
95
|
+
minLabels: import("zod").ZodNumber;
|
|
96
|
+
}, import("zod/v4/core").$strict>]>;
|
|
97
|
+
}, import("zod/v4/core").$strict>;
|
|
98
|
+
secretDigests: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodArray<import("zod").ZodObject<{
|
|
99
|
+
name: import("zod").ZodString;
|
|
100
|
+
digest: import("zod").ZodString;
|
|
101
|
+
}, import("zod/v4/core").$strict>>, {
|
|
102
|
+
readonly required: false;
|
|
103
|
+
}>;
|
|
104
|
+
scriptEtag: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
|
|
105
|
+
readonly required: false;
|
|
106
|
+
}>;
|
|
56
107
|
signingKeyId: import("@astrale-os/sdk/schema").AuthoredProperty<import("zod").ZodString, {
|
|
57
108
|
readonly required: false;
|
|
58
109
|
}>;
|
|
110
|
+
activatedAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
|
|
111
|
+
readonly type: 'string';
|
|
112
|
+
readonly 'x-astrale-value-kind': 'instant';
|
|
113
|
+
}>, {
|
|
114
|
+
readonly required: false;
|
|
115
|
+
}>;
|
|
59
116
|
lastCallAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
|
|
60
117
|
readonly type: 'string';
|
|
61
118
|
readonly 'x-astrale-value-kind': 'instant';
|
|
@@ -90,7 +147,316 @@ export declare const CloudflareDeployment: import("@astrale-os/sdk/schema").Auth
|
|
|
90
147
|
readonly required: false;
|
|
91
148
|
}>;
|
|
92
149
|
};
|
|
150
|
+
readonly methods: {
|
|
151
|
+
setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
152
|
+
name: string;
|
|
153
|
+
value: string;
|
|
154
|
+
}, {
|
|
155
|
+
readonly mode: 'value';
|
|
156
|
+
readonly value: {
|
|
157
|
+
name: string;
|
|
158
|
+
} | {
|
|
159
|
+
kind: "rejected";
|
|
160
|
+
reason: "secret-undeclared" | "service-unavailable";
|
|
161
|
+
message: string;
|
|
162
|
+
retryAfter?: string | undefined;
|
|
163
|
+
};
|
|
164
|
+
}, "authenticated", false, true, undefined>>;
|
|
165
|
+
secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
166
|
+
readonly mode: 'value';
|
|
167
|
+
readonly value: string[];
|
|
168
|
+
}, "authenticated", false, true, undefined>>;
|
|
169
|
+
};
|
|
93
170
|
}>];
|
|
171
|
+
readonly methods: {
|
|
172
|
+
deploy: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
173
|
+
format: "astrale.services.deployment-request";
|
|
174
|
+
version: 1;
|
|
175
|
+
organization?: string | undefined;
|
|
176
|
+
origin: string;
|
|
177
|
+
environment: string;
|
|
178
|
+
addressing: "opaque" | "readable";
|
|
179
|
+
label: string;
|
|
180
|
+
buildDigest: string;
|
|
181
|
+
configuration: {
|
|
182
|
+
format: "astrale.deployment.configuration";
|
|
183
|
+
version: 1;
|
|
184
|
+
vars: Record<string, string>;
|
|
185
|
+
settings: {
|
|
186
|
+
maximumRequestBytes: number;
|
|
187
|
+
invocationTimeoutMs: number;
|
|
188
|
+
tokenExchange: false | {
|
|
189
|
+
maximumLifetimeSeconds: number;
|
|
190
|
+
};
|
|
191
|
+
durableOptions?: {
|
|
192
|
+
retentionMs?: number | undefined;
|
|
193
|
+
retry?: {
|
|
194
|
+
initialIntervalMs?: number | undefined;
|
|
195
|
+
maxAttempts?: number | undefined;
|
|
196
|
+
maxIntervalMs?: number | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
stepTimeoutMs?: number | undefined;
|
|
199
|
+
} | undefined;
|
|
200
|
+
};
|
|
201
|
+
runtime: {
|
|
202
|
+
compatibilityDate: string;
|
|
203
|
+
compatibilityFlags: string[];
|
|
204
|
+
};
|
|
205
|
+
bindings: {
|
|
206
|
+
services: {
|
|
207
|
+
name: string;
|
|
208
|
+
service: string;
|
|
209
|
+
}[];
|
|
210
|
+
dispatchNamespaces: {
|
|
211
|
+
name: string;
|
|
212
|
+
namespace: string;
|
|
213
|
+
}[];
|
|
214
|
+
secrets: string[];
|
|
215
|
+
};
|
|
216
|
+
router: false | {
|
|
217
|
+
service: string;
|
|
218
|
+
hostSuffix: string;
|
|
219
|
+
minLabels: number;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
record: {
|
|
223
|
+
releaseDigest: string;
|
|
224
|
+
schemaRevision: string;
|
|
225
|
+
schemaBundle: string;
|
|
226
|
+
commit: {
|
|
227
|
+
sha: string;
|
|
228
|
+
dirty: boolean;
|
|
229
|
+
base?: {
|
|
230
|
+
version: string;
|
|
231
|
+
distance: number;
|
|
232
|
+
} | undefined;
|
|
233
|
+
} | null;
|
|
234
|
+
};
|
|
235
|
+
bundle: {
|
|
236
|
+
entrypoint: string;
|
|
237
|
+
modules: ({
|
|
238
|
+
name: string;
|
|
239
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
240
|
+
content: {
|
|
241
|
+
encoding: "gzip" | "identity";
|
|
242
|
+
decodedSize: number;
|
|
243
|
+
contentBase64: string;
|
|
244
|
+
} | {
|
|
245
|
+
encoding: "gzip" | "identity";
|
|
246
|
+
decodedSize: number;
|
|
247
|
+
contentBase64Chunks: string[];
|
|
248
|
+
};
|
|
249
|
+
} | {
|
|
250
|
+
contentBase64: string;
|
|
251
|
+
name: string;
|
|
252
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
253
|
+
} | {
|
|
254
|
+
contentBase64Chunks: string[];
|
|
255
|
+
name: string;
|
|
256
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
257
|
+
})[];
|
|
258
|
+
assets?: {
|
|
259
|
+
files: ({
|
|
260
|
+
path: string;
|
|
261
|
+
contentType?: string | undefined;
|
|
262
|
+
content: {
|
|
263
|
+
encoding: "gzip" | "identity";
|
|
264
|
+
decodedSize: number;
|
|
265
|
+
contentBase64: string;
|
|
266
|
+
} | {
|
|
267
|
+
encoding: "gzip" | "identity";
|
|
268
|
+
decodedSize: number;
|
|
269
|
+
contentBase64Chunks: string[];
|
|
270
|
+
};
|
|
271
|
+
} | {
|
|
272
|
+
contentBase64: string;
|
|
273
|
+
path: string;
|
|
274
|
+
contentType?: string | undefined;
|
|
275
|
+
} | {
|
|
276
|
+
contentBase64Chunks: string[];
|
|
277
|
+
path: string;
|
|
278
|
+
contentType?: string | undefined;
|
|
279
|
+
})[];
|
|
280
|
+
notFound?: "404-page" | "none" | "single-page-application" | undefined;
|
|
281
|
+
runWorkerFirst?: boolean | undefined;
|
|
282
|
+
htmlHandling?: "none" | undefined;
|
|
283
|
+
} | undefined;
|
|
284
|
+
};
|
|
285
|
+
secrets: Record<string, string>;
|
|
286
|
+
readiness?: {
|
|
287
|
+
paths: string[];
|
|
288
|
+
} | undefined;
|
|
289
|
+
}, {
|
|
290
|
+
readonly mode: 'value';
|
|
291
|
+
readonly value: {
|
|
292
|
+
kind: "rejected";
|
|
293
|
+
reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "line-owned-elsewhere" | "service-unavailable";
|
|
294
|
+
message: string;
|
|
295
|
+
retryAfter?: string | undefined;
|
|
296
|
+
} | {
|
|
297
|
+
kind: "deployed";
|
|
298
|
+
state: "created" | "reused";
|
|
299
|
+
secrets: {
|
|
300
|
+
state: "bound" | "unchanged" | "updated";
|
|
301
|
+
};
|
|
302
|
+
deployment: {
|
|
303
|
+
id: string;
|
|
304
|
+
url: string;
|
|
305
|
+
label: string;
|
|
306
|
+
line: string;
|
|
307
|
+
owner: string;
|
|
308
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
309
|
+
retention: "preview" | "published";
|
|
310
|
+
createdAt: string;
|
|
311
|
+
lastCallAt?: string | undefined;
|
|
312
|
+
expiresAt?: string | undefined;
|
|
313
|
+
retiredAt?: string | undefined;
|
|
314
|
+
retirement?: "expired" | "withdrawn" | undefined;
|
|
315
|
+
signingKeyId: string;
|
|
316
|
+
record: {
|
|
317
|
+
format: "astrale.deployment-record";
|
|
318
|
+
version: 1;
|
|
319
|
+
origin: string;
|
|
320
|
+
environment: string;
|
|
321
|
+
releaseDigest: string;
|
|
322
|
+
buildDigest: string;
|
|
323
|
+
schemaRevision: string;
|
|
324
|
+
configuration: string;
|
|
325
|
+
providerScript: string;
|
|
326
|
+
commit: {
|
|
327
|
+
sha: string;
|
|
328
|
+
dirty: boolean;
|
|
329
|
+
base?: {
|
|
330
|
+
version: string;
|
|
331
|
+
distance: number;
|
|
332
|
+
} | undefined;
|
|
333
|
+
} | null;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
};
|
|
337
|
+
}, "authenticated", true, false, undefined>>;
|
|
338
|
+
hosting: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
339
|
+
readonly mode: 'value';
|
|
340
|
+
readonly value: {
|
|
341
|
+
routingDomain: string;
|
|
342
|
+
addressing: "opaque" | "readable";
|
|
343
|
+
};
|
|
344
|
+
}, "authenticated", true, false, undefined>>;
|
|
345
|
+
list: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
346
|
+
origin?: string | undefined;
|
|
347
|
+
environment?: string | undefined;
|
|
348
|
+
}, {
|
|
349
|
+
readonly mode: 'value';
|
|
350
|
+
readonly value: {
|
|
351
|
+
deployments: ({
|
|
352
|
+
id: string;
|
|
353
|
+
url: string;
|
|
354
|
+
label: string;
|
|
355
|
+
line: string;
|
|
356
|
+
owner: string;
|
|
357
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
358
|
+
retention: "preview" | "published";
|
|
359
|
+
createdAt: string;
|
|
360
|
+
lastCallAt?: string | undefined;
|
|
361
|
+
expiresAt?: string | undefined;
|
|
362
|
+
retiredAt?: string | undefined;
|
|
363
|
+
retirement?: "expired" | "withdrawn" | undefined;
|
|
364
|
+
signingKeyId: string;
|
|
365
|
+
record: {
|
|
366
|
+
format: "astrale.deployment-record";
|
|
367
|
+
version: 1;
|
|
368
|
+
origin: string;
|
|
369
|
+
environment: string;
|
|
370
|
+
releaseDigest: string;
|
|
371
|
+
buildDigest: string;
|
|
372
|
+
schemaRevision: string;
|
|
373
|
+
configuration: string;
|
|
374
|
+
providerScript: string;
|
|
375
|
+
commit: {
|
|
376
|
+
sha: string;
|
|
377
|
+
dirty: boolean;
|
|
378
|
+
base?: {
|
|
379
|
+
version: string;
|
|
380
|
+
distance: number;
|
|
381
|
+
} | undefined;
|
|
382
|
+
} | null;
|
|
383
|
+
};
|
|
384
|
+
} | {
|
|
385
|
+
id: string;
|
|
386
|
+
url: string;
|
|
387
|
+
label: string;
|
|
388
|
+
line: string;
|
|
389
|
+
owner: string;
|
|
390
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
391
|
+
retention: "preview" | "published";
|
|
392
|
+
createdAt: string;
|
|
393
|
+
lastCallAt?: string | undefined;
|
|
394
|
+
expiresAt?: string | undefined;
|
|
395
|
+
retiredAt?: string | undefined;
|
|
396
|
+
retirement?: "expired" | "withdrawn" | undefined;
|
|
397
|
+
signingKeyId: string;
|
|
398
|
+
record: unknown;
|
|
399
|
+
})[];
|
|
400
|
+
};
|
|
401
|
+
}, "authenticated", true, false, undefined>>;
|
|
402
|
+
setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
403
|
+
name: string;
|
|
404
|
+
value: string;
|
|
405
|
+
}, {
|
|
406
|
+
readonly mode: 'value';
|
|
407
|
+
readonly value: {
|
|
408
|
+
name: string;
|
|
409
|
+
} | {
|
|
410
|
+
kind: "rejected";
|
|
411
|
+
reason: "secret-undeclared" | "service-unavailable";
|
|
412
|
+
message: string;
|
|
413
|
+
retryAfter?: string | undefined;
|
|
414
|
+
};
|
|
415
|
+
}, "authenticated", false, false, undefined>>;
|
|
416
|
+
secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
417
|
+
readonly mode: 'value';
|
|
418
|
+
readonly value: string[];
|
|
419
|
+
}, "authenticated", false, false, undefined>>;
|
|
420
|
+
lastCalls: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
421
|
+
labels: string[];
|
|
422
|
+
}, {
|
|
423
|
+
readonly mode: 'value';
|
|
424
|
+
readonly value: Record<string, string | null>;
|
|
425
|
+
}, "authenticated", true, false, undefined>>;
|
|
426
|
+
expirePreviews: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
427
|
+
limit?: number | undefined;
|
|
428
|
+
apply?: boolean | undefined;
|
|
429
|
+
}, {
|
|
430
|
+
readonly mode: 'value';
|
|
431
|
+
readonly value: {
|
|
432
|
+
planned: string[];
|
|
433
|
+
retired: string[];
|
|
434
|
+
pending: string[];
|
|
435
|
+
};
|
|
436
|
+
}, "authenticated", true, false, undefined>>;
|
|
437
|
+
retain: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
438
|
+
label: string;
|
|
439
|
+
}, {
|
|
440
|
+
readonly mode: 'value';
|
|
441
|
+
readonly value: {
|
|
442
|
+
retention: "published";
|
|
443
|
+
};
|
|
444
|
+
}, "authenticated", true, false, undefined>>;
|
|
445
|
+
retire: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
446
|
+
readonly mode: 'value';
|
|
447
|
+
readonly value: {
|
|
448
|
+
kind: "retired";
|
|
449
|
+
} | {
|
|
450
|
+
kind: "retiring";
|
|
451
|
+
retryAfterMs: number;
|
|
452
|
+
} | {
|
|
453
|
+
kind: "rejected";
|
|
454
|
+
reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "line-owned-elsewhere" | "service-unavailable";
|
|
455
|
+
message: string;
|
|
456
|
+
retryAfter?: string | undefined;
|
|
457
|
+
};
|
|
458
|
+
}, "authenticated", false, false, undefined>>;
|
|
459
|
+
};
|
|
94
460
|
readonly policies: {
|
|
95
461
|
read: () => import("@astrale-os/sdk/schema").Policy;
|
|
96
462
|
};
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import { classIcon, nodeClass } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { CloudUpload } from '@astrale-os/sdk/schema/icons';
|
|
3
|
+
import { deployCloudflareDeployment } from '../functions/deploy-cloudflare-deployment.js';
|
|
4
|
+
import { describeDeploymentHosting } from '../functions/describe-deployment-hosting.js';
|
|
5
|
+
import { expireDeploymentPreviews } from '../functions/expire-deployment-previews.js';
|
|
6
|
+
import { listCloudflareDeploymentSecretNames } from '../functions/list-cloudflare-deployment-secret-names.js';
|
|
7
|
+
import { listCloudflareDeployments } from '../functions/list-cloudflare-deployments.js';
|
|
8
|
+
import { readDeploymentLastCalls } from '../functions/read-deployment-last-calls.js';
|
|
9
|
+
import { retainDeployment } from '../functions/retain-deployment.js';
|
|
10
|
+
import { retireDeployment } from '../functions/retire-deployment.js';
|
|
11
|
+
import { setCloudflareDeploymentSecret } from '../functions/set-cloudflare-deployment-secret.js';
|
|
3
12
|
import { OwnDeployment } from '../policies/own-deployment.js';
|
|
4
13
|
import { Deployment } from './deployment.js';
|
|
5
14
|
export const CloudflareDeployment = nodeClass({
|
|
6
15
|
description: 'One Deployment uploaded as the Workers for Platforms script its label names.',
|
|
7
16
|
icon: classIcon.lucide(CloudUpload),
|
|
8
17
|
extends: [Deployment],
|
|
18
|
+
methods: {
|
|
19
|
+
deploy: deployCloudflareDeployment,
|
|
20
|
+
hosting: describeDeploymentHosting,
|
|
21
|
+
list: listCloudflareDeployments,
|
|
22
|
+
setSecret: setCloudflareDeploymentSecret,
|
|
23
|
+
secrets: listCloudflareDeploymentSecretNames,
|
|
24
|
+
lastCalls: readDeploymentLastCalls,
|
|
25
|
+
expirePreviews: expireDeploymentPreviews,
|
|
26
|
+
retain: retainDeployment,
|
|
27
|
+
retire: retireDeployment,
|
|
28
|
+
},
|
|
9
29
|
policies: { read: () => OwnDeployment },
|
|
10
30
|
});
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
/**
|
|
3
3
|
* One immutable deployment of a release: one build in one environment with its frozen
|
|
4
4
|
* configuration, served by one script at its own URL. It never changes code; a new release is a
|
|
5
|
-
* new deployment on the same line.
|
|
5
|
+
* new deployment on the same line. Its secrets alone rotate in place, on this deployment only,
|
|
6
|
+
* and only under the names its configuration declares: a name added or removed is a new release.
|
|
6
7
|
*/
|
|
7
8
|
export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
8
9
|
readonly abstract: true;
|
|
@@ -29,6 +30,7 @@ export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeCl
|
|
|
29
30
|
};
|
|
30
31
|
readonly failed: {
|
|
31
32
|
readonly retry: "deploying";
|
|
33
|
+
readonly retire: "retiring";
|
|
32
34
|
};
|
|
33
35
|
}, "deploying">, {
|
|
34
36
|
required?: boolean;
|
|
@@ -57,9 +59,75 @@ export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeCl
|
|
|
57
59
|
}, z.core.$strict>>;
|
|
58
60
|
}, z.core.$strict>>;
|
|
59
61
|
}, z.core.$strict>;
|
|
62
|
+
/** The configuration frozen into this deployment; its digest is `record.configuration`. */
|
|
63
|
+
configuration: z.ZodObject<{
|
|
64
|
+
format: z.ZodLiteral<"astrale.deployment.configuration">;
|
|
65
|
+
version: z.ZodLiteral<1>;
|
|
66
|
+
vars: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
67
|
+
settings: z.ZodObject<{
|
|
68
|
+
maximumRequestBytes: z.ZodNumber;
|
|
69
|
+
invocationTimeoutMs: z.ZodNumber;
|
|
70
|
+
tokenExchange: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
71
|
+
maximumLifetimeSeconds: z.ZodNumber;
|
|
72
|
+
}, z.core.$strict>]>;
|
|
73
|
+
durableOptions: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
retentionMs: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
retry: z.ZodOptional<z.ZodObject<{
|
|
76
|
+
initialIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
maxAttempts: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
maxIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
stepTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
}, z.core.$strict>>;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
runtime: z.ZodObject<{
|
|
84
|
+
compatibilityDate: z.ZodString;
|
|
85
|
+
compatibilityFlags: z.ZodArray<z.ZodString>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
bindings: z.ZodObject<{
|
|
88
|
+
services: z.ZodArray<z.ZodObject<{
|
|
89
|
+
name: z.ZodString;
|
|
90
|
+
service: z.ZodString;
|
|
91
|
+
}, z.core.$strict>>;
|
|
92
|
+
dispatchNamespaces: z.ZodArray<z.ZodObject<{
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
namespace: z.ZodString;
|
|
95
|
+
}, z.core.$strict>>;
|
|
96
|
+
secrets: z.ZodArray<z.ZodString>;
|
|
97
|
+
}, z.core.$strict>;
|
|
98
|
+
router: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
|
|
99
|
+
service: z.ZodString;
|
|
100
|
+
hostSuffix: z.ZodString;
|
|
101
|
+
minLabels: z.ZodNumber;
|
|
102
|
+
}, z.core.$strict>]>;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
/** The keyed digest of each secret bound to this deployment, never a value. */
|
|
105
|
+
secretDigests: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodArray<z.ZodObject<{
|
|
106
|
+
name: z.ZodString;
|
|
107
|
+
digest: z.ZodString;
|
|
108
|
+
}, z.core.$strict>>, {
|
|
109
|
+
readonly required: false;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* The provider's code hash of the script. With the artifact tag and the configuration digest it
|
|
113
|
+
* identifies the deployment; a secret rewritten in place keeps it, unlike a provider version.
|
|
114
|
+
*/
|
|
115
|
+
scriptEtag: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
|
|
116
|
+
readonly required: false;
|
|
117
|
+
}>;
|
|
60
118
|
signingKeyId: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
|
|
61
119
|
readonly required: false;
|
|
62
120
|
}>;
|
|
121
|
+
/**
|
|
122
|
+
* The last time this deployment became active: its creation, or its revival after it expired.
|
|
123
|
+
* A preview's 30 days run from it or from its last call, whichever is later.
|
|
124
|
+
*/
|
|
125
|
+
activatedAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
|
|
126
|
+
readonly type: 'string';
|
|
127
|
+
readonly 'x-astrale-value-kind': 'instant';
|
|
128
|
+
}>, {
|
|
129
|
+
readonly required: false;
|
|
130
|
+
}>;
|
|
63
131
|
lastCallAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
|
|
64
132
|
readonly type: 'string';
|
|
65
133
|
readonly 'x-astrale-value-kind': 'instant';
|
|
@@ -84,7 +152,10 @@ export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeCl
|
|
|
84
152
|
}>, {
|
|
85
153
|
readonly required: false;
|
|
86
154
|
}>;
|
|
87
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* The graph lease of the provider operation in flight on this deployment: its creation, or an
|
|
157
|
+
* in-place rewrite of its secrets once it serves.
|
|
158
|
+
*/
|
|
88
159
|
operationReceipt: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
|
|
89
160
|
readonly required: false;
|
|
90
161
|
}>;
|
|
@@ -95,4 +166,24 @@ export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeCl
|
|
|
95
166
|
readonly required: false;
|
|
96
167
|
}>;
|
|
97
168
|
};
|
|
169
|
+
readonly methods: {
|
|
170
|
+
setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
171
|
+
name: string;
|
|
172
|
+
value: string;
|
|
173
|
+
}, {
|
|
174
|
+
readonly mode: 'value';
|
|
175
|
+
readonly value: {
|
|
176
|
+
name: string;
|
|
177
|
+
} | {
|
|
178
|
+
kind: "rejected";
|
|
179
|
+
reason: "secret-undeclared" | "service-unavailable";
|
|
180
|
+
message: string;
|
|
181
|
+
retryAfter?: string | undefined;
|
|
182
|
+
};
|
|
183
|
+
}, "authenticated", false, true, undefined>>;
|
|
184
|
+
secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
185
|
+
readonly mode: 'value';
|
|
186
|
+
readonly value: string[];
|
|
187
|
+
}, "authenticated", false, true, undefined>>;
|
|
188
|
+
};
|
|
98
189
|
}>;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { classIcon, K, nodeClass, property, schema as valueSchema, stateProperty, } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { Rocket } from '@astrale-os/sdk/schema/icons';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { listDeploymentSecretNames } from '../functions/list-deployment-secret-names.js';
|
|
5
|
+
import { setDeploymentSecret } from '../functions/set-deployment-secret.js';
|
|
4
6
|
import { deploymentLifecycle } from '../states/index.js';
|
|
5
|
-
import { deploymentRecord, deploymentRetention, deploymentRetirement } from '../types/index.js';
|
|
7
|
+
import { deploymentRecord, deploymentRetention, deploymentRetirement, deploymentSecretDigests, frozenConfiguration, } from '../types/index.js';
|
|
6
8
|
/**
|
|
7
9
|
* One immutable deployment of a release: one build in one environment with its frozen
|
|
8
10
|
* configuration, served by one script at its own URL. It never changes code; a new release is a
|
|
9
|
-
* new deployment on the same line.
|
|
11
|
+
* new deployment on the same line. Its secrets alone rotate in place, on this deployment only,
|
|
12
|
+
* and only under the names its configuration declares: a name added or removed is a new release.
|
|
10
13
|
*/
|
|
11
14
|
export const Deployment = nodeClass({
|
|
12
15
|
abstract: true,
|
|
@@ -20,13 +23,34 @@ export const Deployment = nodeClass({
|
|
|
20
23
|
state: stateProperty(deploymentLifecycle),
|
|
21
24
|
retention: deploymentRetention,
|
|
22
25
|
record: deploymentRecord,
|
|
26
|
+
/** The configuration frozen into this deployment; its digest is `record.configuration`. */
|
|
27
|
+
configuration: frozenConfiguration,
|
|
28
|
+
/** The keyed digest of each secret bound to this deployment, never a value. */
|
|
29
|
+
secretDigests: property(deploymentSecretDigests, { required: false }),
|
|
30
|
+
/**
|
|
31
|
+
* The provider's code hash of the script. With the artifact tag and the configuration digest it
|
|
32
|
+
* identifies the deployment; a secret rewritten in place keeps it, unlike a provider version.
|
|
33
|
+
*/
|
|
34
|
+
scriptEtag: property(z.string().min(1).max(128), { required: false }),
|
|
23
35
|
signingKeyId: property(z.string().min(1).max(128), { required: false }),
|
|
36
|
+
/**
|
|
37
|
+
* The last time this deployment became active: its creation, or its revival after it expired.
|
|
38
|
+
* A preview's 30 days run from it or from its last call, whichever is later.
|
|
39
|
+
*/
|
|
40
|
+
activatedAt: property(valueSchema.values.instant, { required: false }),
|
|
24
41
|
lastCallAt: property(valueSchema.values.instant, { required: false }),
|
|
25
42
|
expiresAt: property(valueSchema.values.instant, { required: false }),
|
|
26
43
|
retiredAt: property(valueSchema.values.instant, { required: false }),
|
|
27
44
|
retirement: property(deploymentRetirement, { required: false }),
|
|
28
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* The graph lease of the provider operation in flight on this deployment: its creation, or an
|
|
47
|
+
* in-place rewrite of its secrets once it serves.
|
|
48
|
+
*/
|
|
29
49
|
operationReceipt: property(z.string().min(1).max(128), { required: false }),
|
|
30
50
|
operationExpiresAt: property(valueSchema.values.instant, { required: false }),
|
|
31
51
|
},
|
|
52
|
+
methods: {
|
|
53
|
+
setSecret: setDeploymentSecret,
|
|
54
|
+
secrets: listDeploymentSecretNames,
|
|
55
|
+
},
|
|
32
56
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Asked of a Services runtime that hosts no deployments: only Admin's Services host them. */
|
|
3
|
+
export declare const deploymentHostingUnavailable: Readonly<{
|
|
4
|
+
readonly family: "UNSUPPORTED";
|
|
5
|
+
readonly message: "This Services runtime does not host deployments.";
|
|
6
|
+
readonly details: z.ZodObject<{}, z.core.$strict>;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { error } from '@astrale-os/sdk/schema/errors';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** Asked of a Services runtime that hosts no deployments: only Admin's Services host them. */
|
|
4
|
+
export const deploymentHostingUnavailable = error({
|
|
5
|
+
family: 'UNSUPPORTED',
|
|
6
|
+
message: 'This Services runtime does not host deployments.',
|
|
7
|
+
details: z.strictObject({}),
|
|
8
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A label that names no deployment the caller may read: an unknown label and another
|
|
4
|
+
* organisation's deployment answer alike, so the answer never tells one from the other.
|
|
5
|
+
*/
|
|
6
|
+
export declare const deploymentLabelNotFound: Readonly<{
|
|
7
|
+
readonly family: "NOT_FOUND";
|
|
8
|
+
readonly message: "No deployment of yours has this label.";
|
|
9
|
+
readonly details: z.ZodObject<{
|
|
10
|
+
label: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
}>;
|