@astrale-domains/services 0.2.1 → 0.2.3
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 +101 -0
- package/README.md +12 -7
- package/dist/schema/deployment/deployment-rejection.d.ts +11 -0
- package/dist/schema/deployment/deployment-rejection.js +6 -0
- package/dist/schema/deployment/index.d.ts +3 -1
- package/dist/schema/deployment/index.js +2 -1
- package/dist/schema/deployment/request.d.ts +3 -45
- package/dist/schema/deployment/request.js +11 -4
- package/dist/schema/deployment/result.d.ts +57 -7
- package/dist/schema/deployment/result.js +14 -5
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +3 -3
- package/dist/schema/schema.d.ts +8288 -0
- package/dist/schema/schema.js +15 -0
- package/dist/schema/service/cloudflare-worker-class.d.ts +8029 -0
- package/dist/schema/service/cloudflare-worker-class.js +18 -0
- package/dist/schema/service/index.d.ts +4 -3
- package/dist/schema/service/index.js +4 -3
- package/dist/schema/service/methods/delete-secret.d.ts +11 -0
- package/dist/schema/service/methods/delete-secret.js +10 -0
- package/dist/schema/service/methods/delete-service.d.ts +9 -0
- package/dist/schema/service/methods/delete-service.js +14 -0
- package/dist/schema/service/methods/deploy-cloudflare-worker.d.ts +81 -0
- package/dist/schema/service/methods/deploy-cloudflare-worker.js +9 -0
- package/dist/schema/service/methods/index.d.ts +8 -0
- package/dist/schema/service/methods/index.js +8 -0
- package/dist/schema/service/methods/list-service-logs.d.ts +12 -0
- package/dist/schema/service/methods/list-service-logs.js +11 -0
- package/dist/schema/service/methods/list-service-schedules.d.ts +4 -0
- package/dist/schema/service/methods/list-service-schedules.js +8 -0
- package/dist/schema/service/methods/list-service-secret-names.d.ts +4 -0
- package/dist/schema/service/methods/list-service-secret-names.js +9 -0
- package/dist/schema/service/methods/replace-service-schedules.d.ts +11 -0
- package/dist/schema/service/methods/replace-service-schedules.js +14 -0
- package/dist/schema/service/methods/secret-name.js +2 -0
- package/dist/schema/service/methods/secret-operation-rejection.js +5 -0
- package/dist/schema/service/methods/set-service-secret.d.ts +12 -0
- package/dist/schema/service/methods/set-service-secret.js +16 -0
- package/dist/schema/service/policies.js +1 -1
- package/dist/schema/service/{class.d.ts → service-class.d.ts} +71 -184
- package/dist/schema/service/service-class.js +46 -0
- package/dist/schema/service/{relationships.js → service-owned-by-edge-class.js} +2 -2
- package/package.json +29 -23
- package/dist/schema/application/functions.js +0 -20
- package/dist/schema/application/index.d.ts +0 -391
- package/dist/schema/application/index.js +0 -10
- package/dist/schema/service/class.js +0 -22
- package/dist/schema/service/methods.d.ts +0 -135
- package/dist/schema/service/methods.js +0 -64
- /package/dist/schema/service/{relationships.d.ts → service-owned-by-edge-class.d.ts} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { nodeClass, property } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { deployCloudflareWorker } from './methods/index.js';
|
|
4
|
+
import { Service } from './service-class.js';
|
|
5
|
+
export const CloudflareWorker = nodeClass({
|
|
6
|
+
description: 'One Service placed in a Cloudflare Workers dispatch namespace.',
|
|
7
|
+
extends: [Service],
|
|
8
|
+
properties: {
|
|
9
|
+
deploymentMode: z.enum(['plain', 'revisioned']),
|
|
10
|
+
tenantDomainState: property(z.enum(['unresolved', 'absent', 'attached']), {
|
|
11
|
+
required: false,
|
|
12
|
+
}),
|
|
13
|
+
tenantDomainId: property(z.string().min(1).max(128), { required: false }),
|
|
14
|
+
tenantCertificatePackId: property(z.string().min(1).max(128), { required: false }),
|
|
15
|
+
tenantZoneId: property(z.string().min(1).max(128), { required: false }),
|
|
16
|
+
},
|
|
17
|
+
methods: { deploy: deployCloudflareWorker },
|
|
18
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { CloudflareWorker } from './class.js';
|
|
2
|
-
export {
|
|
1
|
+
export { CloudflareWorker } from './cloudflare-worker-class.js';
|
|
2
|
+
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './methods/index.js';
|
|
3
3
|
export { ObserveService, TraverseOwnedService } from './policies.js';
|
|
4
|
-
export {
|
|
4
|
+
export { Service, serviceLifecycle } from './service-class.js';
|
|
5
|
+
export { service_owned_by } from './service-owned-by-edge-class.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { CloudflareWorker } from './class.js';
|
|
2
|
-
export {
|
|
1
|
+
export { CloudflareWorker } from './cloudflare-worker-class.js';
|
|
2
|
+
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './methods/index.js';
|
|
3
3
|
export { ObserveService, TraverseOwnedService } from './policies.js';
|
|
4
|
-
export {
|
|
4
|
+
export { Service, serviceLifecycle } from './service-class.js';
|
|
5
|
+
export { service_owned_by } from './service-owned-by-edge-class.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const deleteServiceSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name: string;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
ok: true;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "rejected";
|
|
9
|
+
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
10
|
+
};
|
|
11
|
+
}, "authenticated", false, "default">>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { secretName } from './secret-name.js';
|
|
4
|
+
import { secretOperationRejection } from './secret-operation-rejection.js';
|
|
5
|
+
export const deleteServiceSecret = method({
|
|
6
|
+
description: 'Delete one write-only Service secret.',
|
|
7
|
+
auth: 'authenticated',
|
|
8
|
+
input: z.strictObject({ name: secretName }),
|
|
9
|
+
output: z.union([z.strictObject({ ok: z.literal(true) }), secretOperationRejection]),
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const deleteService: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
2
|
+
readonly mode: 'value';
|
|
3
|
+
readonly value: {
|
|
4
|
+
kind: "deleted";
|
|
5
|
+
} | {
|
|
6
|
+
kind: "deleting";
|
|
7
|
+
retryAfterMs: number;
|
|
8
|
+
};
|
|
9
|
+
}, "authenticated", false, "default">>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const deleteService = method({
|
|
4
|
+
description: 'Convergently delete provider resources and the Service record without uninstalling consumers.',
|
|
5
|
+
auth: 'authenticated',
|
|
6
|
+
input: z.strictObject({}),
|
|
7
|
+
output: z.discriminatedUnion('kind', [
|
|
8
|
+
z.strictObject({ kind: z.literal('deleted') }),
|
|
9
|
+
z.strictObject({
|
|
10
|
+
kind: z.literal('deleting'),
|
|
11
|
+
retryAfterMs: z.number().int().min(250).max(30_000),
|
|
12
|
+
}),
|
|
13
|
+
]),
|
|
14
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name?: string | undefined;
|
|
3
|
+
entry?: string | undefined;
|
|
4
|
+
modules?: ({
|
|
5
|
+
contentBase64: string;
|
|
6
|
+
name: string;
|
|
7
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
8
|
+
} | {
|
|
9
|
+
contentBase64Chunks: string[];
|
|
10
|
+
name: string;
|
|
11
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
12
|
+
})[] | undefined;
|
|
13
|
+
revisioned?: {
|
|
14
|
+
revision: string;
|
|
15
|
+
requiredSecrets: string[];
|
|
16
|
+
release: {
|
|
17
|
+
entry: string;
|
|
18
|
+
modules: ({
|
|
19
|
+
contentBase64: string;
|
|
20
|
+
name: string;
|
|
21
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
22
|
+
} | {
|
|
23
|
+
contentBase64Chunks: string[];
|
|
24
|
+
name: string;
|
|
25
|
+
kind?: "data" | "esm" | "text" | "wasm" | undefined;
|
|
26
|
+
})[];
|
|
27
|
+
};
|
|
28
|
+
} | undefined;
|
|
29
|
+
compatibilityDate?: string | undefined;
|
|
30
|
+
compatibilityFlags?: string[] | undefined;
|
|
31
|
+
serviceBindings?: {
|
|
32
|
+
name: string;
|
|
33
|
+
service: string;
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
vars?: Record<string, string> | undefined;
|
|
36
|
+
secrets?: Record<string, string> | undefined;
|
|
37
|
+
assets?: {
|
|
38
|
+
files: ({
|
|
39
|
+
contentBase64: string;
|
|
40
|
+
path: string;
|
|
41
|
+
contentType?: string | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
contentBase64Chunks: string[];
|
|
44
|
+
path: string;
|
|
45
|
+
contentType?: string | undefined;
|
|
46
|
+
})[];
|
|
47
|
+
notFound?: "404-page" | "none" | "single-page-application" | undefined;
|
|
48
|
+
runWorkerFirst?: boolean | undefined;
|
|
49
|
+
htmlHandling?: "none" | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
limits?: {
|
|
52
|
+
cpuMs?: number | undefined;
|
|
53
|
+
subrequests?: number | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
serviceKey: string;
|
|
56
|
+
}, {
|
|
57
|
+
readonly mode: 'value';
|
|
58
|
+
readonly value: {
|
|
59
|
+
id: string;
|
|
60
|
+
serviceKey: string;
|
|
61
|
+
url: string;
|
|
62
|
+
digest: string;
|
|
63
|
+
revision?: string | undefined;
|
|
64
|
+
state: "deleting" | "deploying" | "failed" | "ready" | "reconciling";
|
|
65
|
+
error?: string | null | undefined;
|
|
66
|
+
application?: {
|
|
67
|
+
issuer: string;
|
|
68
|
+
origin: string;
|
|
69
|
+
revision: string;
|
|
70
|
+
publicationEtag: string;
|
|
71
|
+
functions: {
|
|
72
|
+
path: string;
|
|
73
|
+
ref: string;
|
|
74
|
+
}[];
|
|
75
|
+
} | undefined;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "rejected";
|
|
78
|
+
reason: "artifact-mode-conflict" | "invalid-deployment" | "service-unavailable";
|
|
79
|
+
message: string;
|
|
80
|
+
};
|
|
81
|
+
}, "authenticated", true, "default">>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { deployServiceInput, deployServiceOutput } from '../../deployment/index.js';
|
|
3
|
+
export const deployCloudflareWorker = method({
|
|
4
|
+
description: 'Create or converge one Cloudflare Worker Service and admit its optional Publication.',
|
|
5
|
+
auth: 'authenticated',
|
|
6
|
+
static: true,
|
|
7
|
+
input: deployServiceInput,
|
|
8
|
+
output: deployServiceOutput,
|
|
9
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { deleteServiceSecret } from './delete-secret.js';
|
|
2
|
+
export { deleteService } from './delete-service.js';
|
|
3
|
+
export { deployCloudflareWorker } from './deploy-cloudflare-worker.js';
|
|
4
|
+
export { listServiceLogs } from './list-service-logs.js';
|
|
5
|
+
export { listServiceSchedules } from './list-service-schedules.js';
|
|
6
|
+
export { listServiceSecretNames } from './list-service-secret-names.js';
|
|
7
|
+
export { replaceServiceSchedules } from './replace-service-schedules.js';
|
|
8
|
+
export { setServiceSecret } from './set-service-secret.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { deleteServiceSecret } from './delete-secret.js';
|
|
2
|
+
export { deleteService } from './delete-service.js';
|
|
3
|
+
export { deployCloudflareWorker } from './deploy-cloudflare-worker.js';
|
|
4
|
+
export { listServiceLogs } from './list-service-logs.js';
|
|
5
|
+
export { listServiceSchedules } from './list-service-schedules.js';
|
|
6
|
+
export { listServiceSecretNames } from './list-service-secret-names.js';
|
|
7
|
+
export { replaceServiceSchedules } from './replace-service-schedules.js';
|
|
8
|
+
export { setServiceSecret } from './set-service-secret.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const listServiceLogs: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
tail?: number | undefined;
|
|
3
|
+
since?: number | undefined;
|
|
4
|
+
}, {
|
|
5
|
+
readonly mode: 'value';
|
|
6
|
+
readonly value: {
|
|
7
|
+
id: string;
|
|
8
|
+
ts: number;
|
|
9
|
+
level: string;
|
|
10
|
+
line: string;
|
|
11
|
+
}[];
|
|
12
|
+
}, "authenticated", false, "default">>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const listServiceLogs = method({
|
|
4
|
+
description: 'Read recent Service runtime logs.',
|
|
5
|
+
auth: 'authenticated',
|
|
6
|
+
input: z.strictObject({
|
|
7
|
+
tail: z.number().int().min(1).max(1_000).optional(),
|
|
8
|
+
since: z.number().int().min(0).optional(),
|
|
9
|
+
}),
|
|
10
|
+
output: z.array(z.strictObject({ id: z.string(), ts: z.number(), level: z.string(), line: z.string() })),
|
|
11
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const listServiceSchedules = method({
|
|
4
|
+
description: 'List active Service cron expressions.',
|
|
5
|
+
auth: 'authenticated',
|
|
6
|
+
input: z.strictObject({}),
|
|
7
|
+
output: z.array(z.string()),
|
|
8
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { secretName } from './secret-name.js';
|
|
4
|
+
export const listServiceSecretNames = method({
|
|
5
|
+
description: 'List write-only Service secret names without exposing values.',
|
|
6
|
+
auth: 'authenticated',
|
|
7
|
+
input: z.strictObject({}),
|
|
8
|
+
output: z.array(secretName),
|
|
9
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const replaceServiceSchedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
crons: string[];
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
crons: string[];
|
|
7
|
+
} | {
|
|
8
|
+
kind: "rejected";
|
|
9
|
+
reason: "invalid-schedule" | "service-unavailable";
|
|
10
|
+
};
|
|
11
|
+
}, "authenticated", false, "default">>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const replaceServiceSchedules = method({
|
|
4
|
+
description: 'Replace the complete Service cron set.',
|
|
5
|
+
auth: 'authenticated',
|
|
6
|
+
input: z.strictObject({ crons: z.array(z.string()).max(24) }),
|
|
7
|
+
output: z.union([
|
|
8
|
+
z.strictObject({ crons: z.array(z.string()) }),
|
|
9
|
+
z.strictObject({
|
|
10
|
+
kind: z.literal('rejected'),
|
|
11
|
+
reason: z.enum(['invalid-schedule', 'service-unavailable']),
|
|
12
|
+
}),
|
|
13
|
+
]),
|
|
14
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const setServiceSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}, {
|
|
5
|
+
readonly mode: 'value';
|
|
6
|
+
readonly value: {
|
|
7
|
+
kind: "rejected";
|
|
8
|
+
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
}, "authenticated", false, "default">>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { secretName } from './secret-name.js';
|
|
4
|
+
import { secretOperationRejection } from './secret-operation-rejection.js';
|
|
5
|
+
export const setServiceSecret = method({
|
|
6
|
+
description: 'Set one write-only Service secret.',
|
|
7
|
+
auth: 'authenticated',
|
|
8
|
+
input: z.strictObject({
|
|
9
|
+
name: secretName,
|
|
10
|
+
value: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.max(64 * 1024),
|
|
14
|
+
}),
|
|
15
|
+
output: z.union([z.strictObject({ name: secretName }), secretOperationRejection]),
|
|
16
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import { service_owned_by } from './
|
|
2
|
+
import { service_owned_by } from './service-owned-by-edge-class.js';
|
|
3
3
|
/** A Service is visible only to the Identity that owns its provider effects. */
|
|
4
4
|
export const ObserveService = policy({
|
|
5
5
|
description: 'The subject owns this Service.',
|