@astrale-domains/services 0.4.6 → 0.4.8

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.
Files changed (76) hide show
  1. package/README.md +595 -43
  2. package/dist/schema/index.d.ts +2 -2
  3. package/dist/schema/index.js +1 -1
  4. package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +366 -0
  5. package/dist/schema/modules/deployment/classes/cloudflare-deployment.js +20 -0
  6. package/dist/schema/modules/deployment/classes/deployment.d.ts +93 -2
  7. package/dist/schema/modules/deployment/classes/deployment.js +27 -3
  8. package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.d.ts +7 -0
  9. package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.js +8 -0
  10. package/dist/schema/modules/deployment/errors/deployment-label-not-found.d.ts +12 -0
  11. package/dist/schema/modules/deployment/errors/deployment-label-not-found.js +11 -0
  12. package/dist/schema/modules/deployment/errors/deployment-not-found.d.ts +10 -0
  13. package/dist/schema/modules/deployment/errors/deployment-not-found.js +11 -0
  14. package/dist/schema/modules/deployment/errors/deployment-registry-only.d.ts +11 -0
  15. package/dist/schema/modules/deployment/errors/deployment-registry-only.js +12 -0
  16. package/dist/schema/modules/deployment/errors/index.d.ts +4 -0
  17. package/dist/schema/modules/deployment/errors/index.js +4 -0
  18. package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.d.ts +170 -0
  19. package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.js +14 -0
  20. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.d.ts +8 -0
  21. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.js +11 -0
  22. package/dist/schema/modules/deployment/functions/expire-deployment-previews.d.ts +16 -0
  23. package/dist/schema/modules/deployment/functions/expire-deployment-previews.js +14 -0
  24. package/dist/schema/modules/deployment/functions/index.d.ts +11 -0
  25. package/dist/schema/modules/deployment/functions/index.js +11 -0
  26. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.d.ts +5 -0
  27. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.js +4 -0
  28. package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.d.ts +58 -0
  29. package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.js +10 -0
  30. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.d.ts +4 -0
  31. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.js +6 -0
  32. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.d.ts +10 -0
  33. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.js +13 -0
  34. package/dist/schema/modules/deployment/functions/retain-deployment.d.ts +12 -0
  35. package/dist/schema/modules/deployment/functions/retain-deployment.js +13 -0
  36. package/dist/schema/modules/deployment/functions/retire-deployment.d.ts +23 -0
  37. package/dist/schema/modules/deployment/functions/retire-deployment.js +17 -0
  38. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.d.ts +18 -0
  39. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.js +7 -0
  40. package/dist/schema/modules/deployment/functions/set-deployment-secret.d.ts +14 -0
  41. package/dist/schema/modules/deployment/functions/set-deployment-secret.js +3 -0
  42. package/dist/schema/modules/deployment/index.d.ts +5 -3
  43. package/dist/schema/modules/deployment/index.js +4 -2
  44. package/dist/schema/modules/deployment/policies/act-for-organization.d.ts +6 -0
  45. package/dist/schema/modules/deployment/policies/act-for-organization.js +10 -0
  46. package/dist/schema/modules/deployment/policies/index.d.ts +1 -0
  47. package/dist/schema/modules/deployment/policies/index.js +1 -0
  48. package/dist/schema/modules/deployment/states/deployment-lifecycle.d.ts +6 -3
  49. package/dist/schema/modules/deployment/states/deployment-lifecycle.js +6 -4
  50. package/dist/schema/modules/deployment/types/deployment-hosting.d.ts +94 -0
  51. package/dist/schema/modules/deployment/types/deployment-hosting.js +19 -0
  52. package/dist/schema/modules/deployment/types/deployment-request.d.ts +161 -0
  53. package/dist/schema/modules/deployment/types/deployment-request.js +40 -0
  54. package/dist/schema/modules/deployment/types/deployment-response.d.ts +109 -0
  55. package/dist/schema/modules/deployment/types/deployment-response.js +36 -0
  56. package/dist/schema/modules/deployment/types/deployment-retention.d.ts +37 -1
  57. package/dist/schema/modules/deployment/types/deployment-retention.js +41 -1
  58. package/dist/schema/modules/deployment/types/deployment-retire.d.ts +30 -0
  59. package/dist/schema/modules/deployment/types/deployment-retire.js +18 -0
  60. package/dist/schema/modules/deployment/types/deployment-secret-digest.d.ts +17 -0
  61. package/dist/schema/modules/deployment/types/deployment-secret-digest.js +14 -0
  62. package/dist/schema/modules/deployment/types/deployment-secret.d.ts +59 -0
  63. package/dist/schema/modules/deployment/types/deployment-secret.js +52 -0
  64. package/dist/schema/modules/deployment/types/deployment-summary.d.ts +165 -0
  65. package/dist/schema/modules/deployment/types/deployment-summary.js +38 -0
  66. package/dist/schema/modules/deployment/types/frozen-configuration.d.ts +52 -0
  67. package/dist/schema/modules/deployment/types/frozen-configuration.js +55 -0
  68. package/dist/schema/modules/deployment/types/index.d.ts +18 -2
  69. package/dist/schema/modules/deployment/types/index.js +9 -1
  70. package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +4 -4
  71. package/dist/schema/modules/service/classes/service.d.ts +2 -2
  72. package/dist/schema/modules/service/functions/set-worker-secret.d.ts +2 -2
  73. package/dist/schema/modules/service/types/legacy/service-deployment-content.js +8 -1
  74. package/dist/schema/schema.d.ts +456 -12
  75. package/dist/schema/schema.js +2 -1
  76. package/package.json +10 -6
@@ -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
+ });
@@ -0,0 +1,4 @@
1
+ export declare const listDeploymentSecretNames: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
+ readonly mode: 'value';
3
+ readonly value: string[];
4
+ }, "authenticated", false, true, undefined>>;
@@ -0,0 +1,6 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { listDeploymentSecretNamesContract } from '../types/deployment-secret.js';
3
+ export const listDeploymentSecretNames = method({
4
+ ...listDeploymentSecretNamesContract,
5
+ abstract: true,
6
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The last call of each deployment named, as the dispatcher counted it. The caller must hold
3
+ * every label's line; the registry Domain may read any label.
4
+ */
5
+ export declare const readDeploymentLastCalls: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
6
+ labels: string[];
7
+ }, {
8
+ readonly mode: 'value';
9
+ readonly value: Record<string, string | null>;
10
+ }, "authenticated", true, false, undefined>>;
@@ -0,0 +1,13 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { lastCallsInput, lastCallsOutput } from '../types/deployment-retention.js';
3
+ /**
4
+ * The last call of each deployment named, as the dispatcher counted it. The caller must hold
5
+ * every label's line; the registry Domain may read any label.
6
+ */
7
+ export const readDeploymentLastCalls = method({
8
+ description: 'Read the instant of the last call of each named deployment.',
9
+ auth: 'authenticated',
10
+ static: true,
11
+ input: lastCallsInput,
12
+ output: lastCallsOutput,
13
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Mark one deployment published, so it is served as long as it exists. Only the registry Domain
3
+ * marks, after the Publication that names the release; a line holder cannot keep its own preview.
4
+ */
5
+ export declare const retainDeployment: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
6
+ label: string;
7
+ }, {
8
+ readonly mode: 'value';
9
+ readonly value: {
10
+ retention: "published";
11
+ };
12
+ }, "authenticated", true, false, undefined>>;
@@ -0,0 +1,13 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { retainInput, retainOutput } from '../types/deployment-retention.js';
3
+ /**
4
+ * Mark one deployment published, so it is served as long as it exists. Only the registry Domain
5
+ * marks, after the Publication that names the release; a line holder cannot keep its own preview.
6
+ */
7
+ export const retainDeployment = method({
8
+ description: 'Mark one deployment published so that it never expires.',
9
+ auth: 'authenticated',
10
+ static: true,
11
+ input: retainInput,
12
+ output: retainOutput,
13
+ });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Withdraw one deployment for good: the emergency stop of its line holder. Its URL then answers
3
+ * `DEPLOYMENT_RETIRED`, its script and key are deleted, and no redeploy serves it again.
4
+ *
5
+ * Only the holder of the deployment's line, or an Identity acting for it, withdraws it: the
6
+ * handler asks the Kernel `OwnDeployment` for the caller before it reads the deployment, as
7
+ * `setSecret` does. An `authorized` Method would also require the caller's principal to hold
8
+ * `can_use` on this Function, which no publisher identity holds on the Admin instance.
9
+ */
10
+ export declare const retireDeployment: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
11
+ readonly mode: 'value';
12
+ readonly value: {
13
+ kind: "retired";
14
+ } | {
15
+ kind: "retiring";
16
+ retryAfterMs: number;
17
+ } | {
18
+ kind: "rejected";
19
+ reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "line-owned-elsewhere" | "service-unavailable";
20
+ message: string;
21
+ retryAfter?: string | undefined;
22
+ };
23
+ }, "authenticated", false, false, undefined>>;
@@ -0,0 +1,17 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { retireDeploymentInput, retireDeploymentOutput } from '../types/deployment-retire.js';
3
+ /**
4
+ * Withdraw one deployment for good: the emergency stop of its line holder. Its URL then answers
5
+ * `DEPLOYMENT_RETIRED`, its script and key are deleted, and no redeploy serves it again.
6
+ *
7
+ * Only the holder of the deployment's line, or an Identity acting for it, withdraws it: the
8
+ * handler asks the Kernel `OwnDeployment` for the caller before it reads the deployment, as
9
+ * `setSecret` does. An `authorized` Method would also require the caller's principal to hold
10
+ * `can_use` on this Function, which no publisher identity holds on the Admin instance.
11
+ */
12
+ export const retireDeployment = method({
13
+ description: 'Withdraw this deployment for good: an emergency stop.',
14
+ auth: 'authenticated',
15
+ input: retireDeploymentInput,
16
+ output: retireDeploymentOutput,
17
+ });
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Only the holder of the deployment's line, or an Identity acting for it, rewrites its secrets:
3
+ * the handler asks the Kernel `OwnDeployment` for the caller before it reads the deployment.
4
+ */
5
+ export declare const setCloudflareDeploymentSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
6
+ name: string;
7
+ value: string;
8
+ }, {
9
+ readonly mode: 'value';
10
+ readonly value: {
11
+ name: string;
12
+ } | {
13
+ kind: "rejected";
14
+ reason: "secret-undeclared" | "service-unavailable";
15
+ message: string;
16
+ retryAfter?: string | undefined;
17
+ };
18
+ }, "authenticated", false, false, undefined>>;
@@ -0,0 +1,7 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { setDeploymentSecretContract } from '../types/deployment-secret.js';
3
+ /**
4
+ * Only the holder of the deployment's line, or an Identity acting for it, rewrites its secrets:
5
+ * the handler asks the Kernel `OwnDeployment` for the caller before it reads the deployment.
6
+ */
7
+ export const setCloudflareDeploymentSecret = method(setDeploymentSecretContract);
@@ -0,0 +1,14 @@
1
+ export declare const setDeploymentSecret: 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
+ name: string;
8
+ } | {
9
+ kind: "rejected";
10
+ reason: "secret-undeclared" | "service-unavailable";
11
+ message: string;
12
+ retryAfter?: string | undefined;
13
+ };
14
+ }, "authenticated", false, true, undefined>>;
@@ -0,0 +1,3 @@
1
+ import { method } from '@astrale-os/sdk/schema';
2
+ import { setDeploymentSecretContract } from '../types/deployment-secret.js';
3
+ export const setDeploymentSecret = method({ ...setDeploymentSecretContract, abstract: true });
@@ -1,6 +1,8 @@
1
1
  export { CloudflareDeployment, Deployment, DeploymentLine, deployment_on_line, line_owned_by, } from './classes/index.js';
2
- export { OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, } from './policies/index.js';
2
+ export { deploymentHostingUnavailable, deploymentLabelNotFound, deploymentNotFound, deploymentRegistryOnly, } from './errors/index.js';
3
+ export { deployCloudflareDeployment, describeDeploymentHosting, expireDeploymentPreviews, listCloudflareDeploymentSecretNames, listCloudflareDeployments, listDeploymentSecretNames, readDeploymentLastCalls, retainDeployment, retireDeployment, setCloudflareDeploymentSecret, setDeploymentSecret, } from './functions/index.js';
4
+ export { ActForOrganization, OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, } from './policies/index.js';
3
5
  export { deploymentLifecycle } from './states/index.js';
4
6
  export type { DeploymentLifecycle, DeploymentLifecycleEvent } from './states/index.js';
5
- export { deploymentCommit, deploymentRecord, deploymentRetention, deploymentRetirement, } from './types/index.js';
6
- export type { DeploymentRecord, DeploymentRetention, DeploymentRetirement } from './types/index.js';
7
+ export { deploymentCommit, deploymentHosting, deploymentLabel, deploymentRecord, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentRetention, deploymentRetirement, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, expirePreviewsInput, expirePreviewsOutput, frozenConfiguration, lastCallsInput, lastCallsOutput, listDeploymentSecretNamesContract, listedDeploymentSummary, listDeploymentsInput, listDeploymentsOutput, MAXIMUM_LAST_CALL_LABELS, MAXIMUM_PREVIEW_EXPIRY_WRITES, retainInput, retainOutput, retireDeploymentInput, retireDeploymentOutput, setDeploymentSecretContract, unadmittedDeploymentSummary, } from './types/index.js';
8
+ export type { DeploymentHosting, DeploymentRecord, DeploymentRejection, DeploymentRejectionReason, DeploymentRequest, DeploymentResponse, DeploymentRetention, DeploymentRetirement, DeploymentSecretDigest, DeploymentSecretRejection, DeploymentSummary, ExpirePreviewsResult, FrozenConfiguration, ListedDeploymentSummary, RetireDeploymentResult, UnadmittedDeploymentSummary, } from './types/index.js';
@@ -1,4 +1,6 @@
1
1
  export { CloudflareDeployment, Deployment, DeploymentLine, deployment_on_line, line_owned_by, } from './classes/index.js';
2
- export { OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, } from './policies/index.js';
2
+ export { deploymentHostingUnavailable, deploymentLabelNotFound, deploymentNotFound, deploymentRegistryOnly, } from './errors/index.js';
3
+ export { deployCloudflareDeployment, describeDeploymentHosting, expireDeploymentPreviews, listCloudflareDeploymentSecretNames, listCloudflareDeployments, listDeploymentSecretNames, readDeploymentLastCalls, retainDeployment, retireDeployment, setCloudflareDeploymentSecret, setDeploymentSecret, } from './functions/index.js';
4
+ export { ActForOrganization, OwnDeployment, OwnLine, TraverseOwnedLine, TraverseOwnedLineDeployment, } from './policies/index.js';
3
5
  export { deploymentLifecycle } from './states/index.js';
4
- export { deploymentCommit, deploymentRecord, deploymentRetention, deploymentRetirement, } from './types/index.js';
6
+ export { deploymentCommit, deploymentHosting, deploymentLabel, deploymentRecord, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentRetention, deploymentRetirement, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, expirePreviewsInput, expirePreviewsOutput, frozenConfiguration, lastCallsInput, lastCallsOutput, listDeploymentSecretNamesContract, listedDeploymentSummary, listDeploymentsInput, listDeploymentsOutput, MAXIMUM_LAST_CALL_LABELS, MAXIMUM_PREVIEW_EXPIRY_WRITES, retainInput, retainOutput, retireDeploymentInput, retireDeploymentOutput, setDeploymentSecretContract, unadmittedDeploymentSummary, } from './types/index.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The subject is this organisation, or an Identity acting for it: a member or a CI identity
3
+ * reaches its organisation through `extends_with`, which the Kernel expands for the subject. Deploy
4
+ * asks it of the caller, on the organisation it names, before registering a line for it.
5
+ */
6
+ export declare const ActForOrganization: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,10 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ /**
3
+ * The subject is this organisation, or an Identity acting for it: a member or a CI identity
4
+ * reaches its organisation through `extends_with`, which the Kernel expands for the subject. Deploy
5
+ * asks it of the caller, on the organisation it names, before registering a line for it.
6
+ */
7
+ export const ActForOrganization = policy({
8
+ description: 'The subject is this organisation or acts for it through extends_with.',
9
+ match: ({ sameNode, subject, object }) => sameNode(subject, object),
10
+ });