@astrale-domains/services 0.4.8 → 0.5.0
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 +153 -816
- package/dist/schema/index.d.ts +4 -5
- package/dist/schema/index.js +2 -3
- package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +4 -321
- package/dist/schema/modules/deployment/classes/cloudflare-deployment.js +1 -19
- package/dist/schema/modules/deployment/classes/current-deployment.d.ts +20 -0
- package/dist/schema/modules/deployment/classes/current-deployment.js +13 -0
- package/dist/schema/modules/deployment/classes/{deployment-on-line.d.ts → deployment-of.d.ts} +3 -3
- package/dist/schema/modules/deployment/classes/deployment-of.js +11 -0
- package/dist/schema/modules/deployment/classes/deployment.d.ts +9 -57
- package/dist/schema/modules/deployment/classes/deployment.js +9 -23
- package/dist/schema/modules/deployment/classes/index.d.ts +2 -3
- package/dist/schema/modules/deployment/classes/index.js +2 -3
- package/dist/schema/modules/deployment/errors/deployment-not-found.d.ts +2 -5
- package/dist/schema/modules/deployment/errors/deployment-not-found.js +2 -5
- package/dist/schema/modules/deployment/errors/index.d.ts +0 -2
- package/dist/schema/modules/deployment/errors/index.js +0 -2
- package/dist/schema/modules/deployment/functions/index.d.ts +0 -10
- package/dist/schema/modules/deployment/functions/index.js +0 -10
- package/dist/schema/modules/deployment/functions/retire-deployment.d.ts +8 -7
- package/dist/schema/modules/deployment/functions/retire-deployment.js +8 -7
- package/dist/schema/modules/deployment/index.d.ts +6 -6
- package/dist/schema/modules/deployment/index.js +7 -5
- package/dist/schema/modules/deployment/policies/index.d.ts +1 -4
- package/dist/schema/modules/deployment/policies/index.js +1 -4
- package/dist/schema/modules/deployment/policies/own-deployment.d.ts +1 -1
- package/dist/schema/modules/deployment/policies/own-deployment.js +6 -7
- package/dist/schema/modules/deployment/policies/traverse-owned-service-deployment.d.ts +2 -0
- package/dist/schema/modules/deployment/policies/traverse-owned-service-deployment.js +7 -0
- package/dist/schema/modules/deployment/states/deployment-lifecycle.d.ts +6 -9
- package/dist/schema/modules/deployment/states/deployment-lifecycle.js +6 -7
- package/dist/schema/modules/deployment/types/deployment-hosting.d.ts +9 -28
- package/dist/schema/modules/deployment/types/deployment-hosting.js +3 -3
- package/dist/schema/modules/deployment/types/deployment-request.d.ts +12 -40
- package/dist/schema/modules/deployment/types/deployment-request.js +17 -9
- package/dist/schema/modules/deployment/types/deployment-response.d.ts +7 -15
- package/dist/schema/modules/deployment/types/deployment-response.js +2 -2
- package/dist/schema/modules/deployment/types/deployment-retire.d.ts +1 -1
- package/dist/schema/modules/deployment/types/deployment-secret.d.ts +0 -39
- package/dist/schema/modules/deployment/types/deployment-secret.js +0 -34
- package/dist/schema/modules/deployment/types/deployment-summary.d.ts +14 -45
- package/dist/schema/modules/deployment/types/deployment-summary.js +9 -8
- package/dist/schema/modules/deployment/types/index.d.ts +7 -3
- package/dist/schema/modules/deployment/types/index.js +4 -2
- package/dist/schema/modules/{service → deployment}/types/service-deployment-artifact-module.d.ts +2 -20
- package/dist/schema/modules/deployment/types/service-deployment-artifact-module.js +10 -0
- package/dist/schema/modules/{service → deployment}/types/service-deployment-assets.d.ts +4 -20
- package/dist/schema/modules/{service → deployment}/types/service-deployment-assets.js +4 -7
- package/dist/schema/modules/service/classes/cloudflare-service.d.ts +321 -0
- package/dist/schema/modules/service/classes/cloudflare-service.js +35 -0
- package/dist/schema/modules/service/classes/index.d.ts +1 -1
- package/dist/schema/modules/service/classes/index.js +1 -1
- package/dist/schema/modules/service/classes/service.d.ts +18 -107
- package/dist/schema/modules/service/classes/service.js +16 -27
- package/dist/schema/modules/service/errors/index.d.ts +1 -0
- package/dist/schema/modules/service/errors/index.js +1 -0
- package/dist/schema/modules/service/errors/service-not-found.d.ts +7 -0
- package/dist/schema/modules/service/errors/service-not-found.js +8 -0
- package/dist/schema/modules/service/functions/delete-service.d.ts +1 -1
- package/dist/schema/modules/service/functions/delete-service.js +1 -1
- package/dist/schema/modules/{deployment/functions/deploy-cloudflare-deployment.d.ts → service/functions/deploy-service.d.ts} +20 -35
- package/dist/schema/modules/service/functions/deploy-service.js +15 -0
- package/dist/schema/modules/service/functions/describe-hosting.d.ts +8 -0
- package/dist/schema/modules/service/functions/describe-hosting.js +11 -0
- package/dist/schema/modules/service/functions/index.d.ts +5 -10
- package/dist/schema/modules/service/functions/index.js +5 -10
- package/dist/schema/modules/{deployment/functions/list-cloudflare-deployments.d.ts → service/functions/list-service-deployments.d.ts} +8 -12
- package/dist/schema/modules/service/functions/list-service-deployments.js +10 -0
- package/dist/schema/modules/service/functions/list-service-logs.d.ts +2 -1
- package/dist/schema/modules/service/functions/list-service-logs.js +1 -1
- package/dist/schema/modules/service/functions/list-service-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-service-schedules.js +1 -1
- package/dist/schema/modules/service/functions/list-service-secret-names.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-service-secret-names.js +1 -1
- package/dist/schema/modules/service/functions/promote-service.d.ts +14 -0
- package/dist/schema/modules/service/functions/promote-service.js +4 -0
- package/dist/schema/modules/service/functions/replace-service-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/replace-service-schedules.js +1 -4
- package/dist/schema/modules/service/functions/set-service-secret.d.ts +4 -2
- package/dist/schema/modules/service/functions/set-service-secret.js +1 -1
- package/dist/schema/modules/service/functions/transfer-service.d.ts +14 -0
- package/dist/schema/modules/service/functions/transfer-service.js +4 -0
- package/dist/schema/modules/service/index.d.ts +5 -5
- package/dist/schema/modules/service/index.js +5 -4
- package/dist/schema/modules/service/policies/act-as.d.ts +6 -0
- package/dist/schema/modules/service/policies/act-as.js +10 -0
- package/dist/schema/modules/service/policies/index.d.ts +1 -0
- package/dist/schema/modules/service/policies/index.js +1 -0
- package/dist/schema/modules/service/states/service-lifecycle.d.ts +7 -20
- package/dist/schema/modules/service/states/service-lifecycle.js +6 -21
- package/dist/schema/modules/service/types/index.d.ts +1 -13
- package/dist/schema/modules/service/types/index.js +1 -8
- package/dist/schema/modules/service/types/service-management.d.ts +65 -24
- package/dist/schema/modules/service/types/service-management.js +46 -21
- package/dist/schema/schema.d.ts +252 -758
- package/dist/schema/schema.js +7 -11
- package/package.json +4 -11
- package/dist/scaffold/create-service.mjs +0 -77
- package/dist/scaffold/template/.env.example +0 -2
- package/dist/scaffold/template/README.md +0 -37
- package/dist/scaffold/template/gitignore +0 -6
- package/dist/scaffold/template/scripts/build.mjs +0 -10
- package/dist/scaffold/template/scripts/deploy.mjs +0 -50
- package/dist/scaffold/template/src/account.js +0 -26
- package/dist/scaffold/template/src/index.js +0 -32
- package/dist/scaffold/template/src/job.js +0 -19
- package/dist/schema/modules/deployment/classes/deployment-line.d.ts +0 -23
- package/dist/schema/modules/deployment/classes/deployment-line.js +0 -24
- package/dist/schema/modules/deployment/classes/deployment-on-line.js +0 -11
- package/dist/schema/modules/deployment/classes/line-owned-by.d.ts +0 -26
- package/dist/schema/modules/deployment/classes/line-owned-by.js +0 -19
- package/dist/schema/modules/deployment/errors/deployment-label-not-found.d.ts +0 -12
- package/dist/schema/modules/deployment/errors/deployment-label-not-found.js +0 -11
- package/dist/schema/modules/deployment/errors/deployment-registry-only.d.ts +0 -11
- package/dist/schema/modules/deployment/errors/deployment-registry-only.js +0 -12
- package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.js +0 -14
- package/dist/schema/modules/deployment/functions/describe-deployment-hosting.d.ts +0 -8
- package/dist/schema/modules/deployment/functions/describe-deployment-hosting.js +0 -11
- package/dist/schema/modules/deployment/functions/expire-deployment-previews.d.ts +0 -16
- package/dist/schema/modules/deployment/functions/expire-deployment-previews.js +0 -14
- package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.d.ts +0 -5
- package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.js +0 -4
- package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.js +0 -10
- package/dist/schema/modules/deployment/functions/list-deployment-secret-names.d.ts +0 -4
- package/dist/schema/modules/deployment/functions/list-deployment-secret-names.js +0 -6
- package/dist/schema/modules/deployment/functions/read-deployment-last-calls.d.ts +0 -10
- package/dist/schema/modules/deployment/functions/read-deployment-last-calls.js +0 -13
- package/dist/schema/modules/deployment/functions/retain-deployment.d.ts +0 -12
- package/dist/schema/modules/deployment/functions/retain-deployment.js +0 -13
- package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.d.ts +0 -18
- package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.js +0 -7
- package/dist/schema/modules/deployment/functions/set-deployment-secret.d.ts +0 -14
- package/dist/schema/modules/deployment/functions/set-deployment-secret.js +0 -3
- package/dist/schema/modules/deployment/policies/act-for-organization.d.ts +0 -6
- package/dist/schema/modules/deployment/policies/act-for-organization.js +0 -10
- package/dist/schema/modules/deployment/policies/own-line.d.ts +0 -5
- package/dist/schema/modules/deployment/policies/own-line.js +0 -10
- package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.d.ts +0 -2
- package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.js +0 -7
- package/dist/schema/modules/deployment/policies/traverse-owned-line.d.ts +0 -2
- package/dist/schema/modules/deployment/policies/traverse-owned-line.js +0 -7
- package/dist/schema/modules/deployment/types/deployment-retention.d.ts +0 -49
- package/dist/schema/modules/deployment/types/deployment-retention.js +0 -45
- package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +0 -352
- package/dist/schema/modules/service/classes/cloudflare-worker.js +0 -41
- package/dist/schema/modules/service/functions/delete-service-secret.d.ts +0 -11
- package/dist/schema/modules/service/functions/delete-service-secret.js +0 -3
- package/dist/schema/modules/service/functions/delete-worker-secret.d.ts +0 -11
- package/dist/schema/modules/service/functions/delete-worker-secret.js +0 -7
- package/dist/schema/modules/service/functions/delete-worker.d.ts +0 -9
- package/dist/schema/modules/service/functions/delete-worker.js +0 -7
- package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +0 -109
- package/dist/schema/modules/service/functions/deploy-cloudflare-worker.js +0 -9
- package/dist/schema/modules/service/functions/list-worker-logs.d.ts +0 -12
- package/dist/schema/modules/service/functions/list-worker-logs.js +0 -7
- package/dist/schema/modules/service/functions/list-worker-schedules.d.ts +0 -4
- package/dist/schema/modules/service/functions/list-worker-schedules.js +0 -7
- package/dist/schema/modules/service/functions/list-worker-secret-names.d.ts +0 -4
- package/dist/schema/modules/service/functions/list-worker-secret-names.js +0 -7
- package/dist/schema/modules/service/functions/migrate-worker-ingress.d.ts +0 -24
- package/dist/schema/modules/service/functions/migrate-worker-ingress.js +0 -26
- package/dist/schema/modules/service/functions/replace-worker-schedules.d.ts +0 -11
- package/dist/schema/modules/service/functions/replace-worker-schedules.js +0 -7
- package/dist/schema/modules/service/functions/set-worker-secret.d.ts +0 -12
- package/dist/schema/modules/service/functions/set-worker-secret.js +0 -7
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.d.ts +0 -286
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.js +0 -51
- package/dist/schema/modules/service/types/legacy/service-deployment-content.js +0 -22
- package/dist/schema/modules/service/types/service-deployment-artifact-module.js +0 -13
- package/dist/schema/modules/service/types/service-deployment-resource-limits.d.ts +0 -6
- package/dist/schema/modules/service/types/service-deployment-resource-limits.js +0 -7
- package/dist/schema/modules/service/types/service-readiness.d.ts +0 -6
- package/dist/schema/modules/service/types/service-readiness.js +0 -6
- package/dist/schema/modules/service/types/service-secret-operation-rejection.d.ts +0 -9
- package/dist/schema/modules/service/types/service-secret-operation-rejection.js +0 -5
- /package/dist/schema/modules/{service → deployment}/types/content/index.d.ts +0 -0
- /package/dist/schema/modules/{service → deployment}/types/content/index.js +0 -0
- /package/dist/schema/modules/{service → deployment}/types/content/limits.d.ts +0 -0
- /package/dist/schema/modules/{service → deployment}/types/content/limits.js +0 -0
- /package/dist/schema/modules/{service → deployment}/types/service-deployment-content.d.ts +0 -0
- /package/dist/schema/modules/{service → deployment}/types/service-deployment-content.js +0 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/** One Service whose deployments are Workers for Platforms scripts. */
|
|
2
|
+
export declare const CloudflareService: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
3
|
+
readonly description: "One Service whose deployments are Cloudflare Workers for Platforms scripts.";
|
|
4
|
+
readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
|
|
5
|
+
readonly extends: readonly [import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
6
|
+
readonly abstract: true;
|
|
7
|
+
readonly description: "One deployed Service: a stable name and URL serving its current deployment.";
|
|
8
|
+
readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
|
|
9
|
+
readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
|
|
10
|
+
readonly properties: {
|
|
11
|
+
origin: import("zod").ZodString;
|
|
12
|
+
environment: import("zod").ZodString;
|
|
13
|
+
fingerprint: import("zod").ZodString;
|
|
14
|
+
url: import("zod").ZodString;
|
|
15
|
+
state: import("@astrale-os/sdk/schema").StateProperty<import("@astrale-os/sdk/schema").StateMachine<{
|
|
16
|
+
readonly active: {
|
|
17
|
+
readonly delete: "deleting";
|
|
18
|
+
};
|
|
19
|
+
readonly deleting: {};
|
|
20
|
+
}, "active">, {
|
|
21
|
+
required?: boolean;
|
|
22
|
+
description?: string;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
}>];
|
|
26
|
+
readonly methods: {
|
|
27
|
+
deploy: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
28
|
+
format: "astrale.services.deployment-request";
|
|
29
|
+
version: 1;
|
|
30
|
+
owner?: string | undefined;
|
|
31
|
+
origin: string;
|
|
32
|
+
environment: string;
|
|
33
|
+
addressing: "opaque";
|
|
34
|
+
label: string;
|
|
35
|
+
buildDigest: string;
|
|
36
|
+
configuration: {
|
|
37
|
+
format: "astrale.deployment.configuration";
|
|
38
|
+
version: 1;
|
|
39
|
+
vars: Record<string, string>;
|
|
40
|
+
settings: {
|
|
41
|
+
maximumRequestBytes: number;
|
|
42
|
+
invocationTimeoutMs: number;
|
|
43
|
+
tokenExchange: false | {
|
|
44
|
+
maximumLifetimeSeconds: number;
|
|
45
|
+
};
|
|
46
|
+
durableOptions?: {
|
|
47
|
+
retentionMs?: number | undefined;
|
|
48
|
+
retry?: {
|
|
49
|
+
initialIntervalMs?: number | undefined;
|
|
50
|
+
maxAttempts?: number | undefined;
|
|
51
|
+
maxIntervalMs?: number | undefined;
|
|
52
|
+
} | undefined;
|
|
53
|
+
stepTimeoutMs?: number | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
};
|
|
56
|
+
runtime: {
|
|
57
|
+
compatibilityDate: string;
|
|
58
|
+
compatibilityFlags: string[];
|
|
59
|
+
};
|
|
60
|
+
bindings: {
|
|
61
|
+
services: {
|
|
62
|
+
name: string;
|
|
63
|
+
service: string;
|
|
64
|
+
}[];
|
|
65
|
+
dispatchNamespaces: {
|
|
66
|
+
name: string;
|
|
67
|
+
namespace: string;
|
|
68
|
+
}[];
|
|
69
|
+
secrets: string[];
|
|
70
|
+
};
|
|
71
|
+
router: false | {
|
|
72
|
+
service: string;
|
|
73
|
+
hostSuffix: string;
|
|
74
|
+
minLabels: number;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
record: {
|
|
78
|
+
releaseDigest: string;
|
|
79
|
+
schemaRevision: string;
|
|
80
|
+
schemaBundle: string;
|
|
81
|
+
commit: {
|
|
82
|
+
sha: string;
|
|
83
|
+
dirty: boolean;
|
|
84
|
+
base?: {
|
|
85
|
+
version: string;
|
|
86
|
+
distance: number;
|
|
87
|
+
} | undefined;
|
|
88
|
+
} | null;
|
|
89
|
+
};
|
|
90
|
+
bundle: {
|
|
91
|
+
entrypoint: string;
|
|
92
|
+
modules: {
|
|
93
|
+
name: string;
|
|
94
|
+
kind?: "data" | "esm" | "text" | "wasm" | 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
|
+
assets?: {
|
|
106
|
+
files: {
|
|
107
|
+
path: string;
|
|
108
|
+
contentType?: string | undefined;
|
|
109
|
+
content: {
|
|
110
|
+
encoding: "gzip" | "identity";
|
|
111
|
+
decodedSize: number;
|
|
112
|
+
contentBase64: string;
|
|
113
|
+
} | {
|
|
114
|
+
encoding: "gzip" | "identity";
|
|
115
|
+
decodedSize: number;
|
|
116
|
+
contentBase64Chunks: string[];
|
|
117
|
+
};
|
|
118
|
+
}[];
|
|
119
|
+
notFound?: "404-page" | "none" | "single-page-application" | undefined;
|
|
120
|
+
runWorkerFirst?: boolean | undefined;
|
|
121
|
+
htmlHandling?: "none" | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
};
|
|
124
|
+
secrets: Record<string, string>;
|
|
125
|
+
promote?: boolean | undefined;
|
|
126
|
+
readiness?: {
|
|
127
|
+
paths: string[];
|
|
128
|
+
} | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
readonly mode: 'value';
|
|
131
|
+
readonly value: {
|
|
132
|
+
kind: "rejected";
|
|
133
|
+
reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
|
|
134
|
+
message: string;
|
|
135
|
+
retryAfter?: string | undefined;
|
|
136
|
+
} | {
|
|
137
|
+
kind: "deployed";
|
|
138
|
+
state: "created" | "reused";
|
|
139
|
+
secrets: {
|
|
140
|
+
state: "bound" | "unchanged" | "updated";
|
|
141
|
+
};
|
|
142
|
+
deployment: {
|
|
143
|
+
id: string;
|
|
144
|
+
url: string;
|
|
145
|
+
label: string;
|
|
146
|
+
serviceId: string;
|
|
147
|
+
service: string;
|
|
148
|
+
owner: string;
|
|
149
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
150
|
+
current: boolean;
|
|
151
|
+
createdAt: string;
|
|
152
|
+
retiredAt?: string | undefined;
|
|
153
|
+
signingKeyId: string;
|
|
154
|
+
record: {
|
|
155
|
+
format: "astrale.deployment-record";
|
|
156
|
+
version: 1;
|
|
157
|
+
origin: string;
|
|
158
|
+
environment: string;
|
|
159
|
+
releaseDigest: string;
|
|
160
|
+
buildDigest: string;
|
|
161
|
+
schemaRevision: string;
|
|
162
|
+
configuration: string;
|
|
163
|
+
providerScript: string;
|
|
164
|
+
commit: {
|
|
165
|
+
sha: string;
|
|
166
|
+
dirty: boolean;
|
|
167
|
+
base?: {
|
|
168
|
+
version: string;
|
|
169
|
+
distance: number;
|
|
170
|
+
} | undefined;
|
|
171
|
+
} | null;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
}, "authenticated", true, false, undefined>>;
|
|
176
|
+
hosting: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
177
|
+
readonly mode: 'value';
|
|
178
|
+
readonly value: {
|
|
179
|
+
routingDomain: string;
|
|
180
|
+
addressing: "opaque";
|
|
181
|
+
};
|
|
182
|
+
}, "authenticated", true, false, undefined>>;
|
|
183
|
+
list: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
184
|
+
origin?: string | undefined;
|
|
185
|
+
environment?: string | undefined;
|
|
186
|
+
}, {
|
|
187
|
+
readonly mode: 'value';
|
|
188
|
+
readonly value: {
|
|
189
|
+
deployments: ({
|
|
190
|
+
id: string;
|
|
191
|
+
url: string;
|
|
192
|
+
label: string;
|
|
193
|
+
serviceId: string;
|
|
194
|
+
service: string;
|
|
195
|
+
owner: string;
|
|
196
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
197
|
+
current: boolean;
|
|
198
|
+
createdAt: string;
|
|
199
|
+
retiredAt?: string | undefined;
|
|
200
|
+
signingKeyId: string;
|
|
201
|
+
record: {
|
|
202
|
+
format: "astrale.deployment-record";
|
|
203
|
+
version: 1;
|
|
204
|
+
origin: string;
|
|
205
|
+
environment: string;
|
|
206
|
+
releaseDigest: string;
|
|
207
|
+
buildDigest: string;
|
|
208
|
+
schemaRevision: string;
|
|
209
|
+
configuration: string;
|
|
210
|
+
providerScript: string;
|
|
211
|
+
commit: {
|
|
212
|
+
sha: string;
|
|
213
|
+
dirty: boolean;
|
|
214
|
+
base?: {
|
|
215
|
+
version: string;
|
|
216
|
+
distance: number;
|
|
217
|
+
} | undefined;
|
|
218
|
+
} | null;
|
|
219
|
+
};
|
|
220
|
+
} | {
|
|
221
|
+
id: string;
|
|
222
|
+
url: string;
|
|
223
|
+
label: string;
|
|
224
|
+
serviceId: string;
|
|
225
|
+
service: string;
|
|
226
|
+
owner: string;
|
|
227
|
+
state: "active" | "deploying" | "failed" | "retired" | "retiring";
|
|
228
|
+
current: boolean;
|
|
229
|
+
createdAt: string;
|
|
230
|
+
retiredAt?: string | undefined;
|
|
231
|
+
signingKeyId: string;
|
|
232
|
+
record: unknown;
|
|
233
|
+
})[];
|
|
234
|
+
};
|
|
235
|
+
}, "authenticated", true, false, undefined>>;
|
|
236
|
+
promote: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
237
|
+
label: string;
|
|
238
|
+
}, {
|
|
239
|
+
readonly mode: 'value';
|
|
240
|
+
readonly value: {
|
|
241
|
+
kind: "rejected";
|
|
242
|
+
reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
|
|
243
|
+
message: string;
|
|
244
|
+
retryAfter?: string | undefined;
|
|
245
|
+
} | {
|
|
246
|
+
current: string;
|
|
247
|
+
};
|
|
248
|
+
}, "authenticated", false, false, undefined>>;
|
|
249
|
+
transfer: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
250
|
+
owner: string;
|
|
251
|
+
}, {
|
|
252
|
+
readonly mode: 'value';
|
|
253
|
+
readonly value: {
|
|
254
|
+
kind: "rejected";
|
|
255
|
+
reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
|
|
256
|
+
message: string;
|
|
257
|
+
retryAfter?: string | undefined;
|
|
258
|
+
} | {
|
|
259
|
+
owner: string;
|
|
260
|
+
};
|
|
261
|
+
}, "authenticated", false, false, undefined>>;
|
|
262
|
+
setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
263
|
+
name: string;
|
|
264
|
+
value: string;
|
|
265
|
+
}, {
|
|
266
|
+
readonly mode: 'value';
|
|
267
|
+
readonly value: {
|
|
268
|
+
name: string;
|
|
269
|
+
} | {
|
|
270
|
+
kind: "rejected";
|
|
271
|
+
reason: "secret-undeclared" | "service-unavailable";
|
|
272
|
+
message: string;
|
|
273
|
+
retryAfter?: string | undefined;
|
|
274
|
+
};
|
|
275
|
+
}, "authenticated", false, false, undefined>>;
|
|
276
|
+
secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
277
|
+
readonly mode: 'value';
|
|
278
|
+
readonly value: string[];
|
|
279
|
+
}, "authenticated", false, false, undefined>>;
|
|
280
|
+
setSchedule: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
281
|
+
crons: string[];
|
|
282
|
+
}, {
|
|
283
|
+
readonly mode: 'value';
|
|
284
|
+
readonly value: {
|
|
285
|
+
crons: string[];
|
|
286
|
+
} | {
|
|
287
|
+
kind: "rejected";
|
|
288
|
+
reason: "invalid-schedule" | "service-unavailable";
|
|
289
|
+
};
|
|
290
|
+
}, "authenticated", false, false, undefined>>;
|
|
291
|
+
schedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
292
|
+
readonly mode: 'value';
|
|
293
|
+
readonly value: string[];
|
|
294
|
+
}, "authenticated", false, false, undefined>>;
|
|
295
|
+
logs: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
296
|
+
label?: string | undefined;
|
|
297
|
+
tail?: number | undefined;
|
|
298
|
+
since?: number | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
readonly mode: 'value';
|
|
301
|
+
readonly value: {
|
|
302
|
+
id: string;
|
|
303
|
+
ts: number;
|
|
304
|
+
level: string;
|
|
305
|
+
line: string;
|
|
306
|
+
}[];
|
|
307
|
+
}, "authenticated", false, false, undefined>>;
|
|
308
|
+
delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
309
|
+
readonly mode: 'value';
|
|
310
|
+
readonly value: {
|
|
311
|
+
kind: "deleted";
|
|
312
|
+
} | {
|
|
313
|
+
kind: "deleting";
|
|
314
|
+
retryAfterMs: number;
|
|
315
|
+
};
|
|
316
|
+
}, "authenticated", false, false, undefined>>;
|
|
317
|
+
};
|
|
318
|
+
readonly policies: {
|
|
319
|
+
read: () => import("@astrale-os/sdk/schema").Policy;
|
|
320
|
+
};
|
|
321
|
+
}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { classIcon, nodeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { CloudCog } from '@astrale-os/sdk/schema/icons';
|
|
3
|
+
import { deleteService } from '../functions/delete-service.js';
|
|
4
|
+
import { deployService } from '../functions/deploy-service.js';
|
|
5
|
+
import { describeHosting } from '../functions/describe-hosting.js';
|
|
6
|
+
import { listServiceDeployments } from '../functions/list-service-deployments.js';
|
|
7
|
+
import { listServiceLogs } from '../functions/list-service-logs.js';
|
|
8
|
+
import { listServiceSchedules } from '../functions/list-service-schedules.js';
|
|
9
|
+
import { listServiceSecretNames } from '../functions/list-service-secret-names.js';
|
|
10
|
+
import { promoteService } from '../functions/promote-service.js';
|
|
11
|
+
import { replaceServiceSchedules } from '../functions/replace-service-schedules.js';
|
|
12
|
+
import { setServiceSecret } from '../functions/set-service-secret.js';
|
|
13
|
+
import { transferService } from '../functions/transfer-service.js';
|
|
14
|
+
import { OwnService } from '../policies/own-service.js';
|
|
15
|
+
import { Service } from './service.js';
|
|
16
|
+
/** One Service whose deployments are Workers for Platforms scripts. */
|
|
17
|
+
export const CloudflareService = nodeClass({
|
|
18
|
+
description: 'One Service whose deployments are Cloudflare Workers for Platforms scripts.',
|
|
19
|
+
icon: classIcon.lucide(CloudCog),
|
|
20
|
+
extends: [Service],
|
|
21
|
+
methods: {
|
|
22
|
+
deploy: deployService,
|
|
23
|
+
hosting: describeHosting,
|
|
24
|
+
list: listServiceDeployments,
|
|
25
|
+
promote: promoteService,
|
|
26
|
+
transfer: transferService,
|
|
27
|
+
setSecret: setServiceSecret,
|
|
28
|
+
secrets: listServiceSecretNames,
|
|
29
|
+
setSchedule: replaceServiceSchedules,
|
|
30
|
+
schedules: listServiceSchedules,
|
|
31
|
+
logs: listServiceLogs,
|
|
32
|
+
delete: deleteService,
|
|
33
|
+
},
|
|
34
|
+
policies: { read: () => OwnService },
|
|
35
|
+
});
|
|
@@ -1,120 +1,31 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* One deployed Service: the stable identity of one origin in one environment, owned by one
|
|
4
|
+
* Identity. Every deploy adds an immutable Deployment of it, and its URL serves the one it
|
|
5
|
+
* currently points at. Its `name` derives from the origin and the environment: it is the DNS label
|
|
6
|
+
* of the Service and the prefix of each deployment's label, unique among Services, and free again
|
|
7
|
+
* once the Service is deleted.
|
|
8
|
+
*/
|
|
3
9
|
export declare const Service: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
|
|
4
10
|
readonly abstract: true;
|
|
5
|
-
readonly description: "One
|
|
11
|
+
readonly description: "One deployed Service: a stable name and URL serving its current deployment.";
|
|
6
12
|
readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
|
|
7
|
-
readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"
|
|
13
|
+
readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Named">, import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
|
|
8
14
|
readonly properties: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
origin: z.ZodString;
|
|
16
|
+
environment: z.ZodString;
|
|
17
|
+
/** The 16-character fingerprint of `(origin, environment)`; it alone identifies the Service. */
|
|
18
|
+
fingerprint: z.ZodString;
|
|
19
|
+
/** `https://<name>.<routing domain>`: always serves the current deployment. */
|
|
20
|
+
url: z.ZodString;
|
|
14
21
|
state: import("@astrale-os/sdk/schema").StateProperty<import("@astrale-os/sdk/schema").StateMachine<{
|
|
15
|
-
readonly
|
|
16
|
-
readonly
|
|
17
|
-
readonly failDeployment: "failed";
|
|
18
|
-
readonly rejectDeployment: "ready";
|
|
19
|
-
readonly deleteService: "deleting";
|
|
20
|
-
};
|
|
21
|
-
readonly reconciling: {
|
|
22
|
-
readonly retryDeployment: "deploying";
|
|
23
|
-
readonly completeDeployment: "ready";
|
|
24
|
-
readonly deleteService: "deleting";
|
|
25
|
-
};
|
|
26
|
-
readonly ready: {
|
|
27
|
-
readonly redeploy: "deploying";
|
|
28
|
-
readonly deleteService: "deleting";
|
|
29
|
-
};
|
|
30
|
-
readonly failed: {
|
|
31
|
-
readonly retryDeployment: "deploying";
|
|
32
|
-
readonly deleteService: "deleting";
|
|
22
|
+
readonly active: {
|
|
23
|
+
readonly delete: "deleting";
|
|
33
24
|
};
|
|
34
25
|
readonly deleting: {};
|
|
35
|
-
}, "
|
|
26
|
+
}, "active">, {
|
|
36
27
|
required?: boolean;
|
|
37
28
|
description?: string;
|
|
38
29
|
}>;
|
|
39
|
-
digest: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
|
|
40
|
-
readonly required: false;
|
|
41
|
-
}>;
|
|
42
|
-
deploymentReceipt: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
|
|
43
|
-
readonly required: false;
|
|
44
|
-
}>;
|
|
45
|
-
operationExpiresAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
|
|
46
|
-
readonly type: 'string';
|
|
47
|
-
readonly 'x-astrale-value-kind': 'instant';
|
|
48
|
-
}>, {
|
|
49
|
-
readonly required: false;
|
|
50
|
-
}>;
|
|
51
|
-
error: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
|
|
52
|
-
readonly required: false;
|
|
53
|
-
}>;
|
|
54
|
-
};
|
|
55
|
-
readonly methods: {
|
|
56
|
-
setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
57
|
-
name: string;
|
|
58
|
-
value: string;
|
|
59
|
-
}, {
|
|
60
|
-
readonly mode: 'value';
|
|
61
|
-
readonly value: {
|
|
62
|
-
kind: "rejected";
|
|
63
|
-
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
64
|
-
} | {
|
|
65
|
-
name: string;
|
|
66
|
-
};
|
|
67
|
-
}, "authorized", false, true, undefined>>;
|
|
68
|
-
deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
69
|
-
name: string;
|
|
70
|
-
}, {
|
|
71
|
-
readonly mode: 'value';
|
|
72
|
-
readonly value: {
|
|
73
|
-
kind: "rejected";
|
|
74
|
-
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
75
|
-
} | {
|
|
76
|
-
ok: true;
|
|
77
|
-
};
|
|
78
|
-
}, "authorized", false, true, undefined>>;
|
|
79
|
-
secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
80
|
-
readonly mode: 'value';
|
|
81
|
-
readonly value: string[];
|
|
82
|
-
}, "authorized", false, true, undefined>>;
|
|
83
|
-
setSchedule: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
84
|
-
crons: string[];
|
|
85
|
-
}, {
|
|
86
|
-
readonly mode: 'value';
|
|
87
|
-
readonly value: {
|
|
88
|
-
crons: string[];
|
|
89
|
-
} | {
|
|
90
|
-
kind: "rejected";
|
|
91
|
-
reason: "invalid-schedule" | "service-unavailable";
|
|
92
|
-
};
|
|
93
|
-
}, "authorized", false, true, undefined>>;
|
|
94
|
-
schedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
95
|
-
readonly mode: 'value';
|
|
96
|
-
readonly value: string[];
|
|
97
|
-
}, "authorized", false, true, undefined>>;
|
|
98
|
-
logs: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
99
|
-
tail?: number | undefined;
|
|
100
|
-
since?: number | undefined;
|
|
101
|
-
}, {
|
|
102
|
-
readonly mode: 'value';
|
|
103
|
-
readonly value: {
|
|
104
|
-
id: string;
|
|
105
|
-
ts: number;
|
|
106
|
-
level: string;
|
|
107
|
-
line: string;
|
|
108
|
-
}[];
|
|
109
|
-
}, "authorized", false, true, undefined>>;
|
|
110
|
-
delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
111
|
-
readonly mode: 'value';
|
|
112
|
-
readonly value: {
|
|
113
|
-
kind: "deleted";
|
|
114
|
-
} | {
|
|
115
|
-
kind: "deleting";
|
|
116
|
-
retryAfterMs: number;
|
|
117
|
-
};
|
|
118
|
-
}, "authorized", false, true, undefined>>;
|
|
119
30
|
};
|
|
120
31
|
}>;
|
|
@@ -1,37 +1,26 @@
|
|
|
1
|
-
import { classIcon, K, nodeClass,
|
|
1
|
+
import { classIcon, fullMatch, K, nodeClass, stateProperty } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { Server } from '@astrale-os/sdk/schema/icons';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { deleteServiceSecret } from '../functions/delete-service-secret.js';
|
|
5
|
-
import { deleteService } from '../functions/delete-service.js';
|
|
6
|
-
import { listServiceLogs } from '../functions/list-service-logs.js';
|
|
7
|
-
import { listServiceSchedules } from '../functions/list-service-schedules.js';
|
|
8
|
-
import { listServiceSecretNames } from '../functions/list-service-secret-names.js';
|
|
9
|
-
import { replaceServiceSchedules } from '../functions/replace-service-schedules.js';
|
|
10
|
-
import { setServiceSecret } from '../functions/set-service-secret.js';
|
|
11
4
|
import { serviceLifecycle } from '../states/index.js';
|
|
12
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* One deployed Service: the stable identity of one origin in one environment, owned by one
|
|
7
|
+
* Identity. Every deploy adds an immutable Deployment of it, and its URL serves the one it
|
|
8
|
+
* currently points at. Its `name` derives from the origin and the environment: it is the DNS label
|
|
9
|
+
* of the Service and the prefix of each deployment's label, unique among Services, and free again
|
|
10
|
+
* once the Service is deleted.
|
|
11
|
+
*/
|
|
13
12
|
export const Service = nodeClass({
|
|
14
13
|
abstract: true,
|
|
15
|
-
description: 'One
|
|
14
|
+
description: 'One deployed Service: a stable name and URL serving its current deployment.',
|
|
16
15
|
icon: classIcon.lucide(Server),
|
|
17
|
-
extends: [K.classes.Named, K.classes.
|
|
16
|
+
extends: [K.classes.Named, K.classes.Timestamped],
|
|
18
17
|
properties: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
origin: z.string().min(1).max(253),
|
|
19
|
+
environment: z.string().min(1).max(63),
|
|
20
|
+
/** The 16-character fingerprint of `(origin, environment)`; it alone identifies the Service. */
|
|
21
|
+
fingerprint: z.string().check(fullMatch('[a-z2-7]{16}')),
|
|
22
|
+
/** `https://<name>.<routing domain>`: always serves the current deployment. */
|
|
23
|
+
url: z.string().min(1).max(2_048),
|
|
22
24
|
state: stateProperty(serviceLifecycle),
|
|
23
|
-
digest: property(z.string().min(1).max(256), { required: false }),
|
|
24
|
-
deploymentReceipt: property(z.string().min(1).max(128), { required: false }),
|
|
25
|
-
operationExpiresAt: property(valueSchema.values.instant, { required: false }),
|
|
26
|
-
error: property(z.string().max(5_000), { required: false }),
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
setSecret: setServiceSecret,
|
|
30
|
-
deleteSecret: deleteServiceSecret,
|
|
31
|
-
secrets: listServiceSecretNames,
|
|
32
|
-
setSchedule: replaceServiceSchedules,
|
|
33
|
-
schedules: listServiceSchedules,
|
|
34
|
-
logs: listServiceLogs,
|
|
35
|
-
delete: deleteService,
|
|
36
25
|
},
|
|
37
26
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { serviceNotFound } from './service-not-found.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { serviceNotFound } from './service-not-found.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Asked about a Service the caller does not own: another owner's Service is invisible to it. */
|
|
3
|
+
export declare const serviceNotFound: Readonly<{
|
|
4
|
+
readonly family: "NOT_FOUND";
|
|
5
|
+
readonly message: "No Service the caller owns has this id.";
|
|
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 about a Service the caller does not own: another owner's Service is invisible to it. */
|
|
4
|
+
export const serviceNotFound = error({
|
|
5
|
+
family: 'NOT_FOUND',
|
|
6
|
+
message: 'No Service the caller owns has this id.',
|
|
7
|
+
details: z.strictObject({}),
|
|
8
|
+
});
|