@astrale-domains/services 0.2.1 → 0.2.2
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 +83 -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 +51 -2
- package/dist/schema/deployment/result.js +13 -3
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +3 -3
- package/dist/schema/schema.d.ts +7035 -0
- package/dist/schema/schema.js +19 -0
- package/dist/schema/service/cloudflare-worker-class.d.ts +6759 -0
- package/dist/schema/service/cloudflare-worker-class.js +18 -0
- package/dist/schema/service/hosted-by-service-edge-class.d.ts +19 -0
- package/dist/schema/service/hosted-by-service-edge-class.js +14 -0
- package/dist/schema/service/index.d.ts +7 -4
- package/dist/schema/service/index.js +7 -4
- 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 +82 -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.d.ts +3 -0
- package/dist/schema/service/policies.js +12 -1
- package/dist/schema/service/{class.d.ts → service-class.d.ts} +48 -175
- package/dist/schema/service/service-class.js +40 -0
- package/dist/schema/service/service-hosts-domain-edge-class.d.ts +16 -0
- package/dist/schema/service/service-hosts-domain-edge-class.js +9 -0
- package/dist/schema/service/{relationships.js → service-owned-by-edge-class.js} +2 -2
- package/package.json +13 -8
- 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
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const hosted_by_service: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
|
|
2
|
+
readonly depth: 0;
|
|
3
|
+
readonly abstract: false;
|
|
4
|
+
readonly extends: readonly [];
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly callableRef: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "callableRef", "self">;
|
|
7
|
+
readonly callablePath: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "callablePath", "self">;
|
|
8
|
+
};
|
|
9
|
+
readonly source: {
|
|
10
|
+
readonly as: "function";
|
|
11
|
+
readonly outgoing: "0..1";
|
|
12
|
+
};
|
|
13
|
+
readonly target: {
|
|
14
|
+
readonly as: "service";
|
|
15
|
+
readonly incoming: "0..*";
|
|
16
|
+
};
|
|
17
|
+
readonly constraints: Record<never, never>;
|
|
18
|
+
readonly effectiveProperties: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "callablePath", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "callableRef", "self">;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { K, edgeClass } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { TraverseHostedFunction } from './policies.js';
|
|
4
|
+
import { Service } from './service-class.js';
|
|
5
|
+
export const hosted_by_service = edgeClass.directed({
|
|
6
|
+
description: 'One installed Function declaration delivered by one Service.',
|
|
7
|
+
source: { as: 'function', accepts: [K.classes.Function], outgoing: '0..1' },
|
|
8
|
+
target: { as: 'service', accepts: [() => Service], incoming: '0..*' },
|
|
9
|
+
properties: {
|
|
10
|
+
callableRef: z.string().min(1).max(512),
|
|
11
|
+
callablePath: z.string().min(1).max(2_048),
|
|
12
|
+
},
|
|
13
|
+
policies: { traverse: () => TraverseHostedFunction },
|
|
14
|
+
});
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export { CloudflareWorker } from './class.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { CloudflareWorker } from './cloudflare-worker-class.js';
|
|
2
|
+
export { hosted_by_service } from './hosted-by-service-edge-class.js';
|
|
3
|
+
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './methods/index.js';
|
|
4
|
+
export { ObserveService, TraverseHostedDomain, TraverseHostedFunction, TraverseOwnedService, } from './policies.js';
|
|
5
|
+
export { Service, serviceLifecycle } from './service-class.js';
|
|
6
|
+
export { service_hosts_domain } from './service-hosts-domain-edge-class.js';
|
|
7
|
+
export { service_owned_by } from './service-owned-by-edge-class.js';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export { CloudflareWorker } from './class.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { CloudflareWorker } from './cloudflare-worker-class.js';
|
|
2
|
+
export { hosted_by_service } from './hosted-by-service-edge-class.js';
|
|
3
|
+
export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './methods/index.js';
|
|
4
|
+
export { ObserveService, TraverseHostedDomain, TraverseHostedFunction, TraverseOwnedService, } from './policies.js';
|
|
5
|
+
export { Service, serviceLifecycle } from './service-class.js';
|
|
6
|
+
export { service_hosts_domain } from './service-hosts-domain-edge-class.js';
|
|
7
|
+
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 the hosted Domain, provider placement, and Service record.',
|
|
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,82 @@
|
|
|
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
|
+
domain?: {
|
|
67
|
+
issuer: string;
|
|
68
|
+
origin: string;
|
|
69
|
+
revision: string;
|
|
70
|
+
publicationEtag: string;
|
|
71
|
+
} | undefined;
|
|
72
|
+
functions: {
|
|
73
|
+
id: string;
|
|
74
|
+
path: string;
|
|
75
|
+
ref: string;
|
|
76
|
+
}[];
|
|
77
|
+
} | {
|
|
78
|
+
kind: "rejected";
|
|
79
|
+
reason: "artifact-mode-conflict" | "invalid-deployment" | "service-unavailable";
|
|
80
|
+
message: string;
|
|
81
|
+
};
|
|
82
|
+
}, "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 its hosted Domain.',
|
|
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
|
+
});
|
|
@@ -2,3 +2,6 @@
|
|
|
2
2
|
export declare const ObserveService: import("@astrale-os/sdk/schema").Policy;
|
|
3
3
|
/** Ownership edges disclose only the subject's own Service relationship. */
|
|
4
4
|
export declare const TraverseOwnedService: import("@astrale-os/sdk/schema").Policy;
|
|
5
|
+
/** Hosted relationships disclose only resources attached to a caller-owned Service endpoint. */
|
|
6
|
+
export declare const TraverseHostedDomain: import("@astrale-os/sdk/schema").Policy;
|
|
7
|
+
export declare const TraverseHostedFunction: import("@astrale-os/sdk/schema").Policy;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { policy } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
2
|
+
import { hosted_by_service } from './hosted-by-service-edge-class.js';
|
|
3
|
+
import { service_hosts_domain } from './service-hosts-domain-edge-class.js';
|
|
4
|
+
import { service_owned_by } from './service-owned-by-edge-class.js';
|
|
3
5
|
/** A Service is visible only to the Identity that owns its provider effects. */
|
|
4
6
|
export const ObserveService = policy({
|
|
5
7
|
description: 'The subject owns this Service.',
|
|
@@ -10,3 +12,12 @@ export const TraverseOwnedService = policy({
|
|
|
10
12
|
description: 'The subject owns the Service at the target of this relationship.',
|
|
11
13
|
match: ({ allOf, edge, source, subject, target }) => allOf(edge({ source: subject, class: () => service_owned_by, target }), edge({ source, class: () => service_owned_by, target })),
|
|
12
14
|
});
|
|
15
|
+
/** Hosted relationships disclose only resources attached to a caller-owned Service endpoint. */
|
|
16
|
+
export const TraverseHostedDomain = policy({
|
|
17
|
+
description: 'The subject owns the Service that hosts this Domain.',
|
|
18
|
+
match: ({ allOf, edge, source, subject, target }) => allOf(edge({ source, class: () => service_hosts_domain, target }), edge({ source: subject, class: () => service_owned_by, target: source })),
|
|
19
|
+
});
|
|
20
|
+
export const TraverseHostedFunction = policy({
|
|
21
|
+
description: 'The subject owns the Service that hosts this Function.',
|
|
22
|
+
match: ({ allOf, edge, source, subject, target }) => allOf(edge({ source, class: () => hosted_by_service, target }), edge({ source: subject, class: () => service_owned_by, target })),
|
|
23
|
+
});
|