@astrale-domains/services 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +53 -7
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +456 -446
- package/dist/schema/modules/service/classes/cloudflare-worker.js +2 -0
- package/dist/schema/modules/service/classes/service-owned-by.js +3 -4
- package/dist/schema/modules/service/classes/service.d.ts +4 -4
- package/dist/schema/modules/service/classes/service.js +0 -2
- package/dist/schema/modules/service/functions/delete-service-secret.d.ts +2 -2
- package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +5 -0
- package/dist/schema/modules/service/functions/set-service-secret.d.ts +2 -2
- package/dist/schema/modules/service/index.d.ts +0 -1
- package/dist/schema/modules/service/index.js +0 -1
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.d.ts +16 -0
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.js +3 -0
- package/dist/schema/modules/service/types/index.d.ts +1 -0
- package/dist/schema/modules/service/types/index.js +1 -0
- package/dist/schema/modules/service/types/service-readiness.d.ts +6 -0
- package/dist/schema/modules/service/types/service-readiness.js +6 -0
- package/dist/schema/schema.d.ts +470 -462
- package/dist/schema/schema.js +1 -2
- package/package.json +6 -5
- package/dist/schema/modules/service/dependencies/index.d.ts +0 -1
- package/dist/schema/modules/service/dependencies/index.js +0 -1
- package/dist/schema/modules/service/dependencies/shell.d.ts +0 -4
- package/dist/schema/modules/service/dependencies/shell.js +0 -4
|
@@ -2,6 +2,7 @@ import { classIcon, nodeClass, property } from '@astrale-os/sdk/schema';
|
|
|
2
2
|
import { CloudCog } from '@astrale-os/sdk/schema/icons';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { deployCloudflareWorker } from '../functions/deploy-cloudflare-worker.js';
|
|
5
|
+
import { OwnService } from '../policies/own-service.js';
|
|
5
6
|
import { Service } from './service.js';
|
|
6
7
|
export const CloudflareWorker = nodeClass({
|
|
7
8
|
description: 'One Service placed in a Cloudflare Workers dispatch namespace.',
|
|
@@ -17,4 +18,5 @@ export const CloudflareWorker = nodeClass({
|
|
|
17
18
|
tenantZoneId: property(z.string().min(1).max(128), { required: false }),
|
|
18
19
|
},
|
|
19
20
|
methods: { deploy: deployCloudflareWorker },
|
|
21
|
+
policies: { read: OwnService },
|
|
20
22
|
});
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { ServicesShell } from '../dependencies/index.js';
|
|
1
|
+
import { edgeClass, K } from '@astrale-os/sdk/schema';
|
|
3
2
|
import { TraverseOwnedService } from '../policies/index.js';
|
|
4
3
|
import { Service } from './service.js';
|
|
5
4
|
export const service_owned_by = edgeClass.directed({
|
|
6
|
-
description: 'The
|
|
5
|
+
description: 'The authenticated Identity that owns and may manage one Service.',
|
|
7
6
|
source: { as: 'service', accepts: [() => Service], outgoing: '1' },
|
|
8
|
-
target: { as: 'owner', accepts: [
|
|
7
|
+
target: { as: 'owner', accepts: [K.classes.Identity], incoming: '0..*' },
|
|
9
8
|
policies: { traverse: () => TraverseOwnedService },
|
|
10
9
|
});
|
|
@@ -88,10 +88,10 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
88
88
|
}, {
|
|
89
89
|
readonly mode: 'value';
|
|
90
90
|
readonly value: {
|
|
91
|
+
name: string;
|
|
92
|
+
} | {
|
|
91
93
|
kind: "rejected";
|
|
92
94
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
93
|
-
} | {
|
|
94
|
-
name: string;
|
|
95
95
|
};
|
|
96
96
|
}, "authorized", false, "default">>;
|
|
97
97
|
readonly deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
@@ -199,10 +199,10 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
199
199
|
}, {
|
|
200
200
|
readonly mode: 'value';
|
|
201
201
|
readonly value: {
|
|
202
|
+
name: string;
|
|
203
|
+
} | {
|
|
202
204
|
kind: "rejected";
|
|
203
205
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
204
|
-
} | {
|
|
205
|
-
name: string;
|
|
206
206
|
};
|
|
207
207
|
}, "authorized", false, "default">>, "setSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
208
208
|
name: string;
|
|
@@ -8,7 +8,6 @@ import { listServiceSchedules } from '../functions/list-service-schedules.js';
|
|
|
8
8
|
import { listServiceSecretNames } from '../functions/list-service-secret-names.js';
|
|
9
9
|
import { replaceServiceSchedules } from '../functions/replace-service-schedules.js';
|
|
10
10
|
import { setServiceSecret } from '../functions/set-service-secret.js';
|
|
11
|
-
import { OwnService } from '../policies/own-service.js';
|
|
12
11
|
import { serviceLifecycle } from '../states/index.js';
|
|
13
12
|
/** Provider-neutral deployed resource. Provider implementation versions are deliberately external. */
|
|
14
13
|
export const Service = nodeClass({
|
|
@@ -35,5 +34,4 @@ export const Service = nodeClass({
|
|
|
35
34
|
logs: listServiceLogs,
|
|
36
35
|
delete: deleteService,
|
|
37
36
|
},
|
|
38
|
-
policies: { read: () => OwnService },
|
|
39
37
|
});
|
|
@@ -3,9 +3,9 @@ export declare const deleteServiceSecret: import("@astrale-os/sdk/schema").Metho
|
|
|
3
3
|
}, {
|
|
4
4
|
readonly mode: 'value';
|
|
5
5
|
readonly value: {
|
|
6
|
+
ok: true;
|
|
7
|
+
} | {
|
|
6
8
|
kind: "rejected";
|
|
7
9
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
8
|
-
} | {
|
|
9
|
-
ok: true;
|
|
10
10
|
};
|
|
11
11
|
}, "authorized", false, "default">>;
|
|
@@ -24,6 +24,10 @@ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Me
|
|
|
24
24
|
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
25
25
|
})[];
|
|
26
26
|
};
|
|
27
|
+
readiness?: {
|
|
28
|
+
paths: string[];
|
|
29
|
+
required?: boolean | undefined;
|
|
30
|
+
} | undefined;
|
|
27
31
|
} | undefined;
|
|
28
32
|
compatibilityDate?: string | undefined;
|
|
29
33
|
compatibilityFlags?: string[] | undefined;
|
|
@@ -60,6 +64,7 @@ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Me
|
|
|
60
64
|
url: string;
|
|
61
65
|
digest: string;
|
|
62
66
|
state: "ready";
|
|
67
|
+
candidateReadiness?: "passed" | "unavailable-retained-secrets" | undefined;
|
|
63
68
|
} | {
|
|
64
69
|
kind: "rejected";
|
|
65
70
|
reason: "artifact-mode-conflict" | "invalid-deployment" | "service-unavailable";
|
|
@@ -4,9 +4,9 @@ export declare const setServiceSecret: import("@astrale-os/sdk/schema").Method<i
|
|
|
4
4
|
}, {
|
|
5
5
|
readonly mode: 'value';
|
|
6
6
|
readonly value: {
|
|
7
|
+
name: string;
|
|
8
|
+
} | {
|
|
7
9
|
kind: "rejected";
|
|
8
10
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
9
|
-
} | {
|
|
10
|
-
name: string;
|
|
11
11
|
};
|
|
12
12
|
}, "authorized", false, "default">>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { CloudflareWorker, Service, service_owned_by } from './classes/index.js';
|
|
2
|
-
export { ServicesShell } from './dependencies/index.js';
|
|
3
2
|
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './functions/index.js';
|
|
4
3
|
export { OwnService, TraverseOwnedService } from './policies/index.js';
|
|
5
4
|
export { serviceLifecycle } from './states/index.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { CloudflareWorker, Service, service_owned_by } from './classes/index.js';
|
|
2
|
-
export { ServicesShell } from './dependencies/index.js';
|
|
3
2
|
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './functions/index.js';
|
|
4
3
|
export { OwnService, TraverseOwnedService } from './policies/index.js';
|
|
5
4
|
export { serviceLifecycle } from './states/index.js';
|
|
@@ -45,6 +45,10 @@ export declare const revisionedDeployment: z.ZodObject<{
|
|
|
45
45
|
}>>;
|
|
46
46
|
}, z.core.$strict>]>>;
|
|
47
47
|
}, z.core.$strict>;
|
|
48
|
+
readiness: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
paths: z.ZodArray<z.ZodString>;
|
|
50
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
}, z.core.$strict>>;
|
|
48
52
|
}, z.core.$strict>;
|
|
49
53
|
export declare const deployServiceInput: z.ZodObject<{
|
|
50
54
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -92,6 +96,10 @@ export declare const deployServiceInput: z.ZodObject<{
|
|
|
92
96
|
}>>;
|
|
93
97
|
}, z.core.$strict>]>>;
|
|
94
98
|
}, z.core.$strict>;
|
|
99
|
+
readiness: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
paths: z.ZodArray<z.ZodString>;
|
|
101
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
}, z.core.$strict>>;
|
|
95
103
|
}, z.core.$strict>>;
|
|
96
104
|
compatibilityDate: z.ZodOptional<z.ZodString>;
|
|
97
105
|
compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -132,6 +140,10 @@ export declare const deployedService: z.ZodObject<{
|
|
|
132
140
|
url: z.ZodString;
|
|
133
141
|
digest: z.ZodString;
|
|
134
142
|
state: z.ZodLiteral<"ready">;
|
|
143
|
+
candidateReadiness: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
passed: "passed";
|
|
145
|
+
"unavailable-retained-secrets": "unavailable-retained-secrets";
|
|
146
|
+
}>>;
|
|
135
147
|
}, z.core.$strict>;
|
|
136
148
|
export declare const deploymentRejection: z.ZodObject<{
|
|
137
149
|
kind: z.ZodLiteral<"rejected">;
|
|
@@ -148,6 +160,10 @@ export declare const deployServiceOutput: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
148
160
|
url: z.ZodString;
|
|
149
161
|
digest: z.ZodString;
|
|
150
162
|
state: z.ZodLiteral<"ready">;
|
|
163
|
+
candidateReadiness: z.ZodOptional<z.ZodEnum<{
|
|
164
|
+
passed: "passed";
|
|
165
|
+
"unavailable-retained-secrets": "unavailable-retained-secrets";
|
|
166
|
+
}>>;
|
|
151
167
|
}, z.core.$strict>, z.ZodObject<{
|
|
152
168
|
kind: z.ZodLiteral<"rejected">;
|
|
153
169
|
reason: z.ZodEnum<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { artifactModule, assetBundle, resourceLimits } from '../types/index.js';
|
|
3
|
+
import { serviceReadiness } from './service-readiness.js';
|
|
3
4
|
export const artifact = z.strictObject({
|
|
4
5
|
entry: z.string().min(1).max(256),
|
|
5
6
|
modules: z.array(artifactModule).min(1).max(40),
|
|
@@ -7,6 +8,7 @@ export const artifact = z.strictObject({
|
|
|
7
8
|
export const revisionedDeployment = z.strictObject({
|
|
8
9
|
requiredSecrets: z.array(z.string().min(1).max(128)).max(64),
|
|
9
10
|
release: artifact,
|
|
11
|
+
readiness: serviceReadiness.optional(),
|
|
10
12
|
});
|
|
11
13
|
const deployServiceFields = {
|
|
12
14
|
name: z.string().min(1).max(256).optional(),
|
|
@@ -37,6 +39,7 @@ export const deployedService = z.strictObject({
|
|
|
37
39
|
url: z.string(),
|
|
38
40
|
digest: z.string(),
|
|
39
41
|
state: z.literal('ready'),
|
|
42
|
+
candidateReadiness: z.enum(['passed', 'unavailable-retained-secrets']).optional(),
|
|
40
43
|
});
|
|
41
44
|
export const deploymentRejection = z.strictObject({
|
|
42
45
|
kind: z.literal('rejected'),
|
|
@@ -9,3 +9,4 @@ export { resourceLimits } from './service-deployment-resource-limits.js';
|
|
|
9
9
|
export type { ResourceLimits } from './service-deployment-resource-limits.js';
|
|
10
10
|
export { secretName } from './service-secret-name.js';
|
|
11
11
|
export { secretOperationRejection } from './service-secret-operation-rejection.js';
|
|
12
|
+
export { serviceReadiness } from './service-readiness.js';
|
|
@@ -5,3 +5,4 @@ export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SI
|
|
|
5
5
|
export { resourceLimits } from './service-deployment-resource-limits.js';
|
|
6
6
|
export { secretName } from './service-secret-name.js';
|
|
7
7
|
export { secretOperationRejection } from './service-secret-operation-rejection.js';
|
|
8
|
+
export { serviceReadiness } from './service-readiness.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Opaque HTTP checks; Services does not interpret the application's response bodies. */
|
|
3
|
+
export const serviceReadiness = z.strictObject({
|
|
4
|
+
paths: z.array(z.string().min(1).max(1024)).min(1).max(8),
|
|
5
|
+
required: z.boolean().optional(),
|
|
6
|
+
});
|