@astrale-domains/services 0.4.6 → 0.4.7
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 +163 -6
- 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 -5
|
@@ -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
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { error } from '@astrale-os/sdk/schema/errors';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* A label that names no deployment the caller may read: an unknown label and another
|
|
5
|
+
* organisation's deployment answer alike, so the answer never tells one from the other.
|
|
6
|
+
*/
|
|
7
|
+
export const deploymentLabelNotFound = error({
|
|
8
|
+
family: 'NOT_FOUND',
|
|
9
|
+
message: 'No deployment of yours has this label.',
|
|
10
|
+
details: z.strictObject({ label: z.string().min(1).max(63) }),
|
|
11
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Asked about a deployment the caller does not hold: a deployment of a line held by another
|
|
4
|
+
* organisation is invisible to the caller, as its read Policy keeps it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const deploymentNotFound: Readonly<{
|
|
7
|
+
readonly family: "NOT_FOUND";
|
|
8
|
+
readonly message: "No deployment of a line the caller holds has this id.";
|
|
9
|
+
readonly details: z.ZodObject<{}, z.core.$strict>;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { error } from '@astrale-os/sdk/schema/errors';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Asked about a deployment the caller does not hold: a deployment of a line held by another
|
|
5
|
+
* organisation is invisible to the caller, as its read Policy keeps it.
|
|
6
|
+
*/
|
|
7
|
+
export const deploymentNotFound = error({
|
|
8
|
+
family: 'NOT_FOUND',
|
|
9
|
+
message: 'No deployment of a line the caller holds has this id.',
|
|
10
|
+
details: z.strictObject({}),
|
|
11
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Asked of retention by anyone but the registry Domain (`SERVICES_REGISTRY_ORIGIN`). Only the
|
|
4
|
+
* registry knows which releases are published, so a line holder cannot keep its own preview by
|
|
5
|
+
* marking it, and only the registry runs the expiry of every organisation's previews.
|
|
6
|
+
*/
|
|
7
|
+
export declare const deploymentRegistryOnly: Readonly<{
|
|
8
|
+
readonly family: "UNSUPPORTED";
|
|
9
|
+
readonly message: "Only the registry Domain marks deployments published and expires previews.";
|
|
10
|
+
readonly details: z.ZodObject<{}, z.core.$strict>;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { error } from '@astrale-os/sdk/schema/errors';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Asked of retention by anyone but the registry Domain (`SERVICES_REGISTRY_ORIGIN`). Only the
|
|
5
|
+
* registry knows which releases are published, so a line holder cannot keep its own preview by
|
|
6
|
+
* marking it, and only the registry runs the expiry of every organisation's previews.
|
|
7
|
+
*/
|
|
8
|
+
export const deploymentRegistryOnly = error({
|
|
9
|
+
family: 'UNSUPPORTED',
|
|
10
|
+
message: 'Only the registry Domain marks deployments published and expires previews.',
|
|
11
|
+
details: z.strictObject({}),
|
|
12
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { deploymentHostingUnavailable } from './deployment-hosting-unavailable.js';
|
|
2
|
+
export { deploymentLabelNotFound } from './deployment-label-not-found.js';
|
|
3
|
+
export { deploymentNotFound } from './deployment-not-found.js';
|
|
4
|
+
export { deploymentRegistryOnly } from './deployment-registry-only.js';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { deploymentHostingUnavailable } from './deployment-hosting-unavailable.js';
|
|
2
|
+
export { deploymentLabelNotFound } from './deployment-label-not-found.js';
|
|
3
|
+
export { deploymentNotFound } from './deployment-not-found.js';
|
|
4
|
+
export { deploymentRegistryOnly } from './deployment-registry-only.js';
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host one release as an immutable deployment on its publisher's line. Any authenticated identity
|
|
3
|
+
* may ask; the handler proves that it acts for the organisation it names before any write.
|
|
4
|
+
*/
|
|
5
|
+
export declare const deployCloudflareDeployment: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
6
|
+
format: "astrale.services.deployment-request";
|
|
7
|
+
version: 1;
|
|
8
|
+
organization?: string | undefined;
|
|
9
|
+
origin: string;
|
|
10
|
+
environment: string;
|
|
11
|
+
addressing: "opaque" | "readable";
|
|
12
|
+
label: string;
|
|
13
|
+
buildDigest: string;
|
|
14
|
+
configuration: {
|
|
15
|
+
format: "astrale.deployment.configuration";
|
|
16
|
+
version: 1;
|
|
17
|
+
vars: Record<string, string>;
|
|
18
|
+
settings: {
|
|
19
|
+
maximumRequestBytes: number;
|
|
20
|
+
invocationTimeoutMs: number;
|
|
21
|
+
tokenExchange: false | {
|
|
22
|
+
maximumLifetimeSeconds: number;
|
|
23
|
+
};
|
|
24
|
+
durableOptions?: {
|
|
25
|
+
retentionMs?: number | undefined;
|
|
26
|
+
retry?: {
|
|
27
|
+
initialIntervalMs?: number | undefined;
|
|
28
|
+
maxAttempts?: number | undefined;
|
|
29
|
+
maxIntervalMs?: number | undefined;
|
|
30
|
+
} | undefined;
|
|
31
|
+
stepTimeoutMs?: number | undefined;
|
|
32
|
+
} | undefined;
|
|
33
|
+
};
|
|
34
|
+
runtime: {
|
|
35
|
+
compatibilityDate: string;
|
|
36
|
+
compatibilityFlags: string[];
|
|
37
|
+
};
|
|
38
|
+
bindings: {
|
|
39
|
+
services: {
|
|
40
|
+
name: string;
|
|
41
|
+
service: string;
|
|
42
|
+
}[];
|
|
43
|
+
dispatchNamespaces: {
|
|
44
|
+
name: string;
|
|
45
|
+
namespace: string;
|
|
46
|
+
}[];
|
|
47
|
+
secrets: string[];
|
|
48
|
+
};
|
|
49
|
+
router: false | {
|
|
50
|
+
service: string;
|
|
51
|
+
hostSuffix: string;
|
|
52
|
+
minLabels: number;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
record: {
|
|
56
|
+
releaseDigest: string;
|
|
57
|
+
schemaRevision: string;
|
|
58
|
+
schemaBundle: string;
|
|
59
|
+
commit: {
|
|
60
|
+
sha: string;
|
|
61
|
+
dirty: boolean;
|
|
62
|
+
base?: {
|
|
63
|
+
version: string;
|
|
64
|
+
distance: number;
|
|
65
|
+
} | undefined;
|
|
66
|
+
} | null;
|
|
67
|
+
};
|
|
68
|
+
bundle: {
|
|
69
|
+
entrypoint: string;
|
|
70
|
+
modules: ({
|
|
71
|
+
name: string;
|
|
72
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
73
|
+
content: {
|
|
74
|
+
encoding: "gzip" | "identity";
|
|
75
|
+
decodedSize: number;
|
|
76
|
+
contentBase64: string;
|
|
77
|
+
} | {
|
|
78
|
+
encoding: "gzip" | "identity";
|
|
79
|
+
decodedSize: number;
|
|
80
|
+
contentBase64Chunks: string[];
|
|
81
|
+
};
|
|
82
|
+
} | {
|
|
83
|
+
contentBase64: string;
|
|
84
|
+
name: string;
|
|
85
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
86
|
+
} | {
|
|
87
|
+
contentBase64Chunks: string[];
|
|
88
|
+
name: string;
|
|
89
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
90
|
+
})[];
|
|
91
|
+
assets?: {
|
|
92
|
+
files: ({
|
|
93
|
+
path: string;
|
|
94
|
+
contentType?: string | undefined;
|
|
95
|
+
content: {
|
|
96
|
+
encoding: "gzip" | "identity";
|
|
97
|
+
decodedSize: number;
|
|
98
|
+
contentBase64: string;
|
|
99
|
+
} | {
|
|
100
|
+
encoding: "gzip" | "identity";
|
|
101
|
+
decodedSize: number;
|
|
102
|
+
contentBase64Chunks: string[];
|
|
103
|
+
};
|
|
104
|
+
} | {
|
|
105
|
+
contentBase64: string;
|
|
106
|
+
path: string;
|
|
107
|
+
contentType?: string | undefined;
|
|
108
|
+
} | {
|
|
109
|
+
contentBase64Chunks: string[];
|
|
110
|
+
path: string;
|
|
111
|
+
contentType?: string | undefined;
|
|
112
|
+
})[];
|
|
113
|
+
notFound?: "404-page" | "none" | "single-page-application" | undefined;
|
|
114
|
+
runWorkerFirst?: boolean | undefined;
|
|
115
|
+
htmlHandling?: "none" | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
};
|
|
118
|
+
secrets: Record<string, string>;
|
|
119
|
+
readiness?: {
|
|
120
|
+
paths: string[];
|
|
121
|
+
} | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
readonly mode: 'value';
|
|
124
|
+
readonly value: {
|
|
125
|
+
kind: "deployed";
|
|
126
|
+
state: "created" | "reused";
|
|
127
|
+
secrets: {
|
|
128
|
+
state: "bound" | "unchanged" | "updated";
|
|
129
|
+
};
|
|
130
|
+
deployment: {
|
|
131
|
+
id: string;
|
|
132
|
+
url: string;
|
|
133
|
+
label: string;
|
|
134
|
+
line: string;
|
|
135
|
+
owner: string;
|
|
136
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
137
|
+
retention: "preview" | "published";
|
|
138
|
+
createdAt: string;
|
|
139
|
+
lastCallAt?: string | undefined;
|
|
140
|
+
expiresAt?: string | undefined;
|
|
141
|
+
retiredAt?: string | undefined;
|
|
142
|
+
retirement?: "expired" | "withdrawn" | undefined;
|
|
143
|
+
signingKeyId: string;
|
|
144
|
+
record: {
|
|
145
|
+
format: "astrale.deployment-record";
|
|
146
|
+
version: 1;
|
|
147
|
+
origin: string;
|
|
148
|
+
environment: string;
|
|
149
|
+
releaseDigest: string;
|
|
150
|
+
buildDigest: string;
|
|
151
|
+
schemaRevision: string;
|
|
152
|
+
configuration: string;
|
|
153
|
+
providerScript: string;
|
|
154
|
+
commit: {
|
|
155
|
+
sha: string;
|
|
156
|
+
dirty: boolean;
|
|
157
|
+
base?: {
|
|
158
|
+
version: string;
|
|
159
|
+
distance: number;
|
|
160
|
+
} | undefined;
|
|
161
|
+
} | null;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
} | {
|
|
165
|
+
kind: "rejected";
|
|
166
|
+
reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "line-owned-elsewhere" | "service-unavailable";
|
|
167
|
+
message: string;
|
|
168
|
+
retryAfter?: string | undefined;
|
|
169
|
+
};
|
|
170
|
+
}, "authenticated", true, false, undefined>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { deploymentRequest } from '../types/deployment-request.js';
|
|
3
|
+
import { deploymentResponse } from '../types/deployment-response.js';
|
|
4
|
+
/**
|
|
5
|
+
* Host one release as an immutable deployment on its publisher's line. Any authenticated identity
|
|
6
|
+
* may ask; the handler proves that it acts for the organisation it names before any write.
|
|
7
|
+
*/
|
|
8
|
+
export const deployCloudflareDeployment = method({
|
|
9
|
+
description: 'Host one release as an immutable deployment on its publisher line.',
|
|
10
|
+
auth: 'authenticated',
|
|
11
|
+
static: true,
|
|
12
|
+
input: deploymentRequest,
|
|
13
|
+
output: deploymentResponse,
|
|
14
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Where this Services runtime addresses the deployments it hosts. */
|
|
2
|
+
export declare const describeDeploymentHosting: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
3
|
+
readonly mode: 'value';
|
|
4
|
+
readonly value: {
|
|
5
|
+
routingDomain: string;
|
|
6
|
+
addressing: "opaque" | "readable";
|
|
7
|
+
};
|
|
8
|
+
}, "authenticated", true, false, undefined>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { deploymentHosting } from '../types/deployment-hosting.js';
|
|
4
|
+
/** Where this Services runtime addresses the deployments it hosts. */
|
|
5
|
+
export const describeDeploymentHosting = method({
|
|
6
|
+
description: 'Describe the routing domain and line addressing of hosted deployments.',
|
|
7
|
+
auth: 'authenticated',
|
|
8
|
+
static: true,
|
|
9
|
+
input: z.strictObject({}),
|
|
10
|
+
output: deploymentHosting,
|
|
11
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One pass of preview expiry over every line: a preview expires 30 days after its last call or
|
|
3
|
+
* its activation, whichever is later, and a published deployment never does. The pass is a plan
|
|
4
|
+
* unless the runtime enforces expiry. Only the registry Domain runs it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const expireDeploymentPreviews: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
7
|
+
limit?: number | undefined;
|
|
8
|
+
apply?: boolean | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
readonly mode: 'value';
|
|
11
|
+
readonly value: {
|
|
12
|
+
planned: string[];
|
|
13
|
+
retired: string[];
|
|
14
|
+
pending: string[];
|
|
15
|
+
};
|
|
16
|
+
}, "authenticated", true, false, undefined>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { expirePreviewsInput, expirePreviewsOutput } from '../types/deployment-retention.js';
|
|
3
|
+
/**
|
|
4
|
+
* One pass of preview expiry over every line: a preview expires 30 days after its last call or
|
|
5
|
+
* its activation, whichever is later, and a published deployment never does. The pass is a plan
|
|
6
|
+
* unless the runtime enforces expiry. Only the registry Domain runs it.
|
|
7
|
+
*/
|
|
8
|
+
export const expireDeploymentPreviews = method({
|
|
9
|
+
description: 'Plan, or where enforced apply, the expiry of previews uncalled for 30 days.',
|
|
10
|
+
auth: 'authenticated',
|
|
11
|
+
static: true,
|
|
12
|
+
input: expirePreviewsInput,
|
|
13
|
+
output: expirePreviewsOutput,
|
|
14
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { deployCloudflareDeployment } from './deploy-cloudflare-deployment.js';
|
|
2
|
+
export { describeDeploymentHosting } from './describe-deployment-hosting.js';
|
|
3
|
+
export { expireDeploymentPreviews } from './expire-deployment-previews.js';
|
|
4
|
+
export { listCloudflareDeployments } from './list-cloudflare-deployments.js';
|
|
5
|
+
export { listCloudflareDeploymentSecretNames } from './list-cloudflare-deployment-secret-names.js';
|
|
6
|
+
export { listDeploymentSecretNames } from './list-deployment-secret-names.js';
|
|
7
|
+
export { readDeploymentLastCalls } from './read-deployment-last-calls.js';
|
|
8
|
+
export { retainDeployment } from './retain-deployment.js';
|
|
9
|
+
export { retireDeployment } from './retire-deployment.js';
|
|
10
|
+
export { setCloudflareDeploymentSecret } from './set-cloudflare-deployment-secret.js';
|
|
11
|
+
export { setDeploymentSecret } from './set-deployment-secret.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { deployCloudflareDeployment } from './deploy-cloudflare-deployment.js';
|
|
2
|
+
export { describeDeploymentHosting } from './describe-deployment-hosting.js';
|
|
3
|
+
export { expireDeploymentPreviews } from './expire-deployment-previews.js';
|
|
4
|
+
export { listCloudflareDeployments } from './list-cloudflare-deployments.js';
|
|
5
|
+
export { listCloudflareDeploymentSecretNames } from './list-cloudflare-deployment-secret-names.js';
|
|
6
|
+
export { listDeploymentSecretNames } from './list-deployment-secret-names.js';
|
|
7
|
+
export { readDeploymentLastCalls } from './read-deployment-last-calls.js';
|
|
8
|
+
export { retainDeployment } from './retain-deployment.js';
|
|
9
|
+
export { retireDeployment } from './retire-deployment.js';
|
|
10
|
+
export { setCloudflareDeploymentSecret } from './set-cloudflare-deployment-secret.js';
|
|
11
|
+
export { setDeploymentSecret } from './set-deployment-secret.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Decided as `setSecret`: `OwnDeployment` for the caller, before the deployment is read. */
|
|
2
|
+
export declare const listCloudflareDeploymentSecretNames: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
3
|
+
readonly mode: 'value';
|
|
4
|
+
readonly value: string[];
|
|
5
|
+
}, "authenticated", false, false, undefined>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { listDeploymentSecretNamesContract } from '../types/deployment-secret.js';
|
|
3
|
+
/** Decided as `setSecret`: `OwnDeployment` for the caller, before the deployment is read. */
|
|
4
|
+
export const listCloudflareDeploymentSecretNames = method(listDeploymentSecretNamesContract);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** The deployments of the lines the caller holds, or acts for through `extends_with`. */
|
|
2
|
+
export declare const listCloudflareDeployments: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
3
|
+
origin?: string | undefined;
|
|
4
|
+
environment?: string | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
readonly mode: 'value';
|
|
7
|
+
readonly value: {
|
|
8
|
+
deployments: ({
|
|
9
|
+
id: string;
|
|
10
|
+
url: string;
|
|
11
|
+
label: string;
|
|
12
|
+
line: string;
|
|
13
|
+
owner: string;
|
|
14
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
15
|
+
retention: "preview" | "published";
|
|
16
|
+
createdAt: string;
|
|
17
|
+
lastCallAt?: string | undefined;
|
|
18
|
+
expiresAt?: string | undefined;
|
|
19
|
+
retiredAt?: string | undefined;
|
|
20
|
+
retirement?: "expired" | "withdrawn" | undefined;
|
|
21
|
+
signingKeyId: string;
|
|
22
|
+
record: {
|
|
23
|
+
format: "astrale.deployment-record";
|
|
24
|
+
version: 1;
|
|
25
|
+
origin: string;
|
|
26
|
+
environment: string;
|
|
27
|
+
releaseDigest: string;
|
|
28
|
+
buildDigest: string;
|
|
29
|
+
schemaRevision: string;
|
|
30
|
+
configuration: string;
|
|
31
|
+
providerScript: string;
|
|
32
|
+
commit: {
|
|
33
|
+
sha: string;
|
|
34
|
+
dirty: boolean;
|
|
35
|
+
base?: {
|
|
36
|
+
version: string;
|
|
37
|
+
distance: number;
|
|
38
|
+
} | undefined;
|
|
39
|
+
} | null;
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
id: string;
|
|
43
|
+
url: string;
|
|
44
|
+
label: string;
|
|
45
|
+
line: string;
|
|
46
|
+
owner: string;
|
|
47
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
48
|
+
retention: "preview" | "published";
|
|
49
|
+
createdAt: string;
|
|
50
|
+
lastCallAt?: string | undefined;
|
|
51
|
+
expiresAt?: string | undefined;
|
|
52
|
+
retiredAt?: string | undefined;
|
|
53
|
+
retirement?: "expired" | "withdrawn" | undefined;
|
|
54
|
+
signingKeyId: string;
|
|
55
|
+
record: unknown;
|
|
56
|
+
})[];
|
|
57
|
+
};
|
|
58
|
+
}, "authenticated", true, false, undefined>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { listDeploymentsInput, listDeploymentsOutput } from '../types/deployment-hosting.js';
|
|
3
|
+
/** The deployments of the lines the caller holds, or acts for through `extends_with`. */
|
|
4
|
+
export const listCloudflareDeployments = method({
|
|
5
|
+
description: 'List the deployments of the lines the caller holds.',
|
|
6
|
+
auth: 'authenticated',
|
|
7
|
+
static: true,
|
|
8
|
+
input: listDeploymentsInput,
|
|
9
|
+
output: listDeploymentsOutput,
|
|
10
|
+
});
|