@astrale-domains/services 0.4.5 → 0.4.7

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 (126) hide show
  1. package/README.md +278 -12
  2. package/dist/schema/index.d.ts +2 -0
  3. package/dist/schema/index.js +1 -0
  4. package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +463 -0
  5. package/dist/schema/modules/deployment/classes/cloudflare-deployment.js +30 -0
  6. package/dist/schema/modules/deployment/classes/deployment-line.d.ts +23 -0
  7. package/dist/schema/modules/deployment/classes/deployment-line.js +24 -0
  8. package/dist/schema/modules/deployment/classes/deployment-on-line.d.ts +17 -0
  9. package/dist/schema/modules/deployment/classes/deployment-on-line.js +11 -0
  10. package/dist/schema/modules/deployment/classes/deployment.d.ts +189 -0
  11. package/dist/schema/modules/deployment/classes/deployment.js +56 -0
  12. package/dist/schema/modules/deployment/classes/index.d.ts +5 -0
  13. package/dist/schema/modules/deployment/classes/index.js +5 -0
  14. package/dist/schema/modules/deployment/classes/line-owned-by.d.ts +26 -0
  15. package/dist/schema/modules/deployment/classes/line-owned-by.js +19 -0
  16. package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.d.ts +7 -0
  17. package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.js +8 -0
  18. package/dist/schema/modules/deployment/errors/deployment-label-not-found.d.ts +12 -0
  19. package/dist/schema/modules/deployment/errors/deployment-label-not-found.js +11 -0
  20. package/dist/schema/modules/deployment/errors/deployment-not-found.d.ts +10 -0
  21. package/dist/schema/modules/deployment/errors/deployment-not-found.js +11 -0
  22. package/dist/schema/modules/deployment/errors/deployment-registry-only.d.ts +11 -0
  23. package/dist/schema/modules/deployment/errors/deployment-registry-only.js +12 -0
  24. package/dist/schema/modules/deployment/errors/index.d.ts +4 -0
  25. package/dist/schema/modules/deployment/errors/index.js +4 -0
  26. package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.d.ts +170 -0
  27. package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.js +14 -0
  28. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.d.ts +8 -0
  29. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.js +11 -0
  30. package/dist/schema/modules/deployment/functions/expire-deployment-previews.d.ts +16 -0
  31. package/dist/schema/modules/deployment/functions/expire-deployment-previews.js +14 -0
  32. package/dist/schema/modules/deployment/functions/index.d.ts +11 -0
  33. package/dist/schema/modules/deployment/functions/index.js +11 -0
  34. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.d.ts +5 -0
  35. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.js +4 -0
  36. package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.d.ts +58 -0
  37. package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.js +10 -0
  38. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.d.ts +4 -0
  39. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.js +6 -0
  40. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.d.ts +10 -0
  41. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.js +13 -0
  42. package/dist/schema/modules/deployment/functions/retain-deployment.d.ts +12 -0
  43. package/dist/schema/modules/deployment/functions/retain-deployment.js +13 -0
  44. package/dist/schema/modules/deployment/functions/retire-deployment.d.ts +23 -0
  45. package/dist/schema/modules/deployment/functions/retire-deployment.js +17 -0
  46. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.d.ts +18 -0
  47. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.js +7 -0
  48. package/dist/schema/modules/deployment/functions/set-deployment-secret.d.ts +14 -0
  49. package/dist/schema/modules/deployment/functions/set-deployment-secret.js +3 -0
  50. package/dist/schema/modules/deployment/index.d.ts +8 -0
  51. package/dist/schema/modules/deployment/index.js +6 -0
  52. package/dist/schema/modules/deployment/policies/act-for-organization.d.ts +6 -0
  53. package/dist/schema/modules/deployment/policies/act-for-organization.js +10 -0
  54. package/dist/schema/modules/deployment/policies/index.d.ts +5 -0
  55. package/dist/schema/modules/deployment/policies/index.js +5 -0
  56. package/dist/schema/modules/deployment/policies/own-deployment.d.ts +2 -0
  57. package/dist/schema/modules/deployment/policies/own-deployment.js +12 -0
  58. package/dist/schema/modules/deployment/policies/own-line.d.ts +5 -0
  59. package/dist/schema/modules/deployment/policies/own-line.js +10 -0
  60. package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.d.ts +2 -0
  61. package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.js +7 -0
  62. package/dist/schema/modules/deployment/policies/traverse-owned-line.d.ts +2 -0
  63. package/dist/schema/modules/deployment/policies/traverse-owned-line.js +7 -0
  64. package/dist/schema/modules/deployment/states/deployment-lifecycle.d.ts +30 -0
  65. package/dist/schema/modules/deployment/states/deployment-lifecycle.js +19 -0
  66. package/dist/schema/modules/deployment/states/index.d.ts +2 -0
  67. package/dist/schema/modules/deployment/states/index.js +1 -0
  68. package/dist/schema/modules/deployment/types/deployment-hosting.d.ts +94 -0
  69. package/dist/schema/modules/deployment/types/deployment-hosting.js +19 -0
  70. package/dist/schema/modules/deployment/types/deployment-record.d.ts +35 -0
  71. package/dist/schema/modules/deployment/types/deployment-record.js +31 -0
  72. package/dist/schema/modules/deployment/types/deployment-request.d.ts +161 -0
  73. package/dist/schema/modules/deployment/types/deployment-request.js +40 -0
  74. package/dist/schema/modules/deployment/types/deployment-response.d.ts +109 -0
  75. package/dist/schema/modules/deployment/types/deployment-response.js +36 -0
  76. package/dist/schema/modules/deployment/types/deployment-retention.d.ts +49 -0
  77. package/dist/schema/modules/deployment/types/deployment-retention.js +45 -0
  78. package/dist/schema/modules/deployment/types/deployment-retire.d.ts +30 -0
  79. package/dist/schema/modules/deployment/types/deployment-retire.js +18 -0
  80. package/dist/schema/modules/deployment/types/deployment-secret-digest.d.ts +17 -0
  81. package/dist/schema/modules/deployment/types/deployment-secret-digest.js +14 -0
  82. package/dist/schema/modules/deployment/types/deployment-secret.d.ts +59 -0
  83. package/dist/schema/modules/deployment/types/deployment-secret.js +52 -0
  84. package/dist/schema/modules/deployment/types/deployment-summary.d.ts +165 -0
  85. package/dist/schema/modules/deployment/types/deployment-summary.js +38 -0
  86. package/dist/schema/modules/deployment/types/frozen-configuration.d.ts +52 -0
  87. package/dist/schema/modules/deployment/types/frozen-configuration.js +55 -0
  88. package/dist/schema/modules/deployment/types/index.d.ts +20 -0
  89. package/dist/schema/modules/deployment/types/index.js +10 -0
  90. package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +60 -24
  91. package/dist/schema/modules/service/classes/service.d.ts +7 -7
  92. package/dist/schema/modules/service/functions/delete-service-secret.d.ts +1 -1
  93. package/dist/schema/modules/service/functions/delete-service.d.ts +1 -1
  94. package/dist/schema/modules/service/functions/delete-worker-secret.d.ts +1 -1
  95. package/dist/schema/modules/service/functions/delete-worker.d.ts +1 -1
  96. package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +37 -1
  97. package/dist/schema/modules/service/functions/list-service-logs.d.ts +1 -1
  98. package/dist/schema/modules/service/functions/list-service-schedules.d.ts +1 -1
  99. package/dist/schema/modules/service/functions/list-service-secret-names.d.ts +1 -1
  100. package/dist/schema/modules/service/functions/list-worker-logs.d.ts +1 -1
  101. package/dist/schema/modules/service/functions/list-worker-schedules.d.ts +1 -1
  102. package/dist/schema/modules/service/functions/list-worker-secret-names.d.ts +1 -1
  103. package/dist/schema/modules/service/functions/migrate-worker-ingress.d.ts +1 -1
  104. package/dist/schema/modules/service/functions/replace-service-schedules.d.ts +1 -1
  105. package/dist/schema/modules/service/functions/replace-worker-schedules.d.ts +1 -1
  106. package/dist/schema/modules/service/functions/set-service-secret.d.ts +1 -1
  107. package/dist/schema/modules/service/functions/set-worker-secret.d.ts +3 -3
  108. package/dist/schema/modules/service/index.d.ts +2 -2
  109. package/dist/schema/modules/service/index.js +1 -1
  110. package/dist/schema/modules/service/types/content/index.d.ts +1 -0
  111. package/dist/schema/modules/service/types/content/index.js +1 -0
  112. package/dist/schema/modules/service/types/content/limits.d.ts +7 -0
  113. package/dist/schema/modules/service/types/content/limits.js +7 -0
  114. package/dist/schema/modules/service/types/deploy-cloudflare-worker.d.ts +110 -0
  115. package/dist/schema/modules/service/types/index.d.ts +2 -1
  116. package/dist/schema/modules/service/types/index.js +1 -1
  117. package/dist/schema/modules/service/types/legacy/service-deployment-content.js +22 -0
  118. package/dist/schema/modules/service/types/service-deployment-artifact-module.d.ts +23 -0
  119. package/dist/schema/modules/service/types/service-deployment-artifact-module.js +5 -3
  120. package/dist/schema/modules/service/types/service-deployment-assets.d.ts +36 -0
  121. package/dist/schema/modules/service/types/service-deployment-assets.js +5 -3
  122. package/dist/schema/modules/service/types/service-deployment-content.d.ts +18 -11
  123. package/dist/schema/modules/service/types/service-deployment-content.js +17 -8
  124. package/dist/schema/schema.d.ts +740 -23
  125. package/dist/schema/schema.js +11 -0
  126. package/package.json +15 -11
@@ -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 });
@@ -0,0 +1,8 @@
1
+ export { CloudflareDeployment, Deployment, DeploymentLine, deployment_on_line, line_owned_by, } from './classes/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';
5
+ export { deploymentLifecycle } from './states/index.js';
6
+ export type { DeploymentLifecycle, DeploymentLifecycleEvent } from './states/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';
@@ -0,0 +1,6 @@
1
+ export { CloudflareDeployment, Deployment, DeploymentLine, deployment_on_line, line_owned_by, } from './classes/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';
5
+ export { deploymentLifecycle } from './states/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
+ });
@@ -0,0 +1,5 @@
1
+ export { ActForOrganization } from './act-for-organization.js';
2
+ export { OwnDeployment } from './own-deployment.js';
3
+ export { OwnLine } from './own-line.js';
4
+ export { TraverseOwnedLine } from './traverse-owned-line.js';
5
+ export { TraverseOwnedLineDeployment } from './traverse-owned-line-deployment.js';
@@ -0,0 +1,5 @@
1
+ export { ActForOrganization } from './act-for-organization.js';
2
+ export { OwnDeployment } from './own-deployment.js';
3
+ export { OwnLine } from './own-line.js';
4
+ export { TraverseOwnedLine } from './traverse-owned-line.js';
5
+ export { TraverseOwnedLineDeployment } from './traverse-owned-line-deployment.js';
@@ -0,0 +1,2 @@
1
+ /** A deployment belongs to whoever holds its line; it carries no owner of its own. */
2
+ export declare const OwnDeployment: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,12 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { DeploymentLine } from '../classes/deployment-line.js';
3
+ import { deployment_on_line } from '../classes/deployment-on-line.js';
4
+ import { line_owned_by } from '../classes/line-owned-by.js';
5
+ /** A deployment belongs to whoever holds its line; it carries no owner of its own. */
6
+ export const OwnDeployment = policy({
7
+ description: 'The subject holds the deployment line this Deployment was made on.',
8
+ match: ({ allOf, edge, exists, object, subject }) => exists(({ node }) => {
9
+ const line = node(() => DeploymentLine);
10
+ return allOf(edge({ source: object, class: () => deployment_on_line, target: line }), edge({ source: line, class: () => line_owned_by, target: subject }));
11
+ }),
12
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The organisation holding a line, and every Identity that acts for it: a member or a CI identity
3
+ * reaches it through its `extends_with` composition, never through a second rule here.
4
+ */
5
+ export declare const OwnLine: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,10 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { line_owned_by } from '../classes/line-owned-by.js';
3
+ /**
4
+ * The organisation holding a line, and every Identity that acts for it: a member or a CI identity
5
+ * reaches it through its `extends_with` composition, never through a second rule here.
6
+ */
7
+ export const OwnLine = policy({
8
+ description: 'The subject holds this deployment line.',
9
+ match: ({ edge, object, subject }) => edge({ source: object, class: () => line_owned_by, target: subject }),
10
+ });
@@ -0,0 +1,2 @@
1
+ /** A deployment's line relationship is visible only to the holder of that line. */
2
+ export declare const TraverseOwnedLineDeployment: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,7 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { line_owned_by } from '../classes/line-owned-by.js';
3
+ /** A deployment's line relationship is visible only to the holder of that line. */
4
+ export const TraverseOwnedLineDeployment = policy({
5
+ description: 'The subject holds the deployment line at the target of this relationship.',
6
+ match: ({ edge, subject, target }) => edge({ source: target, class: () => line_owned_by, target: subject }),
7
+ });
@@ -0,0 +1,2 @@
1
+ /** A line's holder relationship is visible only to the holder of that line. */
2
+ export declare const TraverseOwnedLine: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,7 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { line_owned_by } from '../classes/line-owned-by.js';
3
+ /** A line's holder relationship is visible only to the holder of that line. */
4
+ export const TraverseOwnedLine = policy({
5
+ description: 'The subject holds the deployment line at the source of this relationship.',
6
+ match: ({ edge, source, subject }) => edge({ source, class: () => line_owned_by, target: subject }),
7
+ });
@@ -0,0 +1,30 @@
1
+ import { type EventOf, type StateOf } from '@astrale-os/sdk/state';
2
+ /**
3
+ * Lifecycle of one immutable deployment. A deployment never changes code: it is created
4
+ * `deploying`, becomes `active` once its script serves, and leaves only by retirement, in two
5
+ * phases: `retiring` once its tombstone is written, `retired` once its script and key are deleted.
6
+ * A failed creation can be retried on the same label, or retired, since it may have left a
7
+ * script. An expired retirement can be revived for the same line holder and artifact; a withdrawn
8
+ * one never.
9
+ */
10
+ export declare const deploymentLifecycle: import("@astrale-os/sdk/schema").StateMachine<{
11
+ readonly deploying: {
12
+ readonly activate: "active";
13
+ readonly fail: "failed";
14
+ };
15
+ readonly active: {
16
+ readonly retire: "retiring";
17
+ };
18
+ readonly retiring: {
19
+ readonly completeRetirement: "retired";
20
+ };
21
+ readonly retired: {
22
+ readonly revive: "deploying";
23
+ };
24
+ readonly failed: {
25
+ readonly retry: "deploying";
26
+ readonly retire: "retiring";
27
+ };
28
+ }, "deploying">;
29
+ export type DeploymentLifecycle = StateOf<typeof deploymentLifecycle>;
30
+ export type DeploymentLifecycleEvent = EventOf<typeof deploymentLifecycle>;
@@ -0,0 +1,19 @@
1
+ import { stateMachine } from '@astrale-os/sdk/state';
2
+ /**
3
+ * Lifecycle of one immutable deployment. A deployment never changes code: it is created
4
+ * `deploying`, becomes `active` once its script serves, and leaves only by retirement, in two
5
+ * phases: `retiring` once its tombstone is written, `retired` once its script and key are deleted.
6
+ * A failed creation can be retried on the same label, or retired, since it may have left a
7
+ * script. An expired retirement can be revived for the same line holder and artifact; a withdrawn
8
+ * one never.
9
+ */
10
+ export const deploymentLifecycle = stateMachine({
11
+ initial: 'deploying',
12
+ transitions: {
13
+ deploying: { activate: 'active', fail: 'failed' },
14
+ active: { retire: 'retiring' },
15
+ retiring: { completeRetirement: 'retired' },
16
+ retired: { revive: 'deploying' },
17
+ failed: { retry: 'deploying', retire: 'retiring' },
18
+ },
19
+ });
@@ -0,0 +1,2 @@
1
+ export { deploymentLifecycle } from './deployment-lifecycle.js';
2
+ export type { DeploymentLifecycle, DeploymentLifecycleEvent } from './deployment-lifecycle.js';
@@ -0,0 +1 @@
1
+ export { deploymentLifecycle } from './deployment-lifecycle.js';
@@ -0,0 +1,94 @@
1
+ import { z } from 'zod';
2
+ /** Where this Services runtime addresses deployments, and how the caller's own lines read. */
3
+ export declare const deploymentHosting: z.ZodObject<{
4
+ routingDomain: z.ZodString;
5
+ addressing: z.ZodEnum<{
6
+ opaque: "opaque";
7
+ readable: "readable";
8
+ }>;
9
+ }, z.core.$strict>;
10
+ export declare const listDeploymentsInput: z.ZodObject<{
11
+ origin: z.ZodOptional<z.ZodString>;
12
+ environment: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strict>;
14
+ /**
15
+ * The deployments of the caller's lines. A deployment whose stored record or configuration this
16
+ * Services SDK no longer admits is listed from its facts with its record as stored, never dropped,
17
+ * and never fails the listing.
18
+ */
19
+ export declare const listDeploymentsOutput: z.ZodObject<{
20
+ deployments: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
21
+ id: z.ZodString;
22
+ url: z.ZodString;
23
+ label: z.ZodString;
24
+ line: z.ZodString;
25
+ owner: z.ZodString;
26
+ state: z.ZodEnum<{
27
+ active: "active";
28
+ deploying: "deploying";
29
+ failed: "failed";
30
+ retired: "retired";
31
+ retiring: "retiring";
32
+ }>;
33
+ retention: z.ZodEnum<{
34
+ preview: "preview";
35
+ published: "published";
36
+ }>;
37
+ createdAt: z.ZodString;
38
+ lastCallAt: z.ZodOptional<z.ZodString>;
39
+ expiresAt: z.ZodOptional<z.ZodString>;
40
+ retiredAt: z.ZodOptional<z.ZodString>;
41
+ retirement: z.ZodOptional<z.ZodEnum<{
42
+ expired: "expired";
43
+ withdrawn: "withdrawn";
44
+ }>>;
45
+ signingKeyId: z.ZodString;
46
+ record: z.ZodObject<{
47
+ format: z.ZodLiteral<"astrale.deployment-record">;
48
+ version: z.ZodLiteral<1>;
49
+ origin: z.ZodString;
50
+ environment: z.ZodString;
51
+ releaseDigest: z.ZodString;
52
+ buildDigest: z.ZodString;
53
+ schemaRevision: z.ZodString;
54
+ configuration: z.ZodString;
55
+ providerScript: z.ZodString;
56
+ commit: z.ZodNullable<z.ZodObject<{
57
+ sha: z.ZodString;
58
+ dirty: z.ZodBoolean;
59
+ base: z.ZodOptional<z.ZodObject<{
60
+ version: z.ZodString;
61
+ distance: z.ZodNumber;
62
+ }, z.core.$strict>>;
63
+ }, z.core.$strict>>;
64
+ }, z.core.$strict>;
65
+ }, z.core.$strict>, z.ZodObject<{
66
+ id: z.ZodString;
67
+ url: z.ZodString;
68
+ label: z.ZodString;
69
+ line: z.ZodString;
70
+ owner: z.ZodString;
71
+ state: z.ZodEnum<{
72
+ active: "active";
73
+ deploying: "deploying";
74
+ failed: "failed";
75
+ retired: "retired";
76
+ retiring: "retiring";
77
+ }>;
78
+ retention: z.ZodEnum<{
79
+ preview: "preview";
80
+ published: "published";
81
+ }>;
82
+ createdAt: z.ZodString;
83
+ lastCallAt: z.ZodOptional<z.ZodString>;
84
+ expiresAt: z.ZodOptional<z.ZodString>;
85
+ retiredAt: z.ZodOptional<z.ZodString>;
86
+ retirement: z.ZodOptional<z.ZodEnum<{
87
+ expired: "expired";
88
+ withdrawn: "withdrawn";
89
+ }>>;
90
+ signingKeyId: z.ZodString;
91
+ record: z.ZodUnknown;
92
+ }, z.core.$strict>]>>;
93
+ }, z.core.$strict>;
94
+ export type DeploymentHosting = z.output<typeof deploymentHosting>;
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { listedDeploymentSummary } from './deployment-summary.js';
3
+ /** Where this Services runtime addresses deployments, and how the caller's own lines read. */
4
+ export const deploymentHosting = z.strictObject({
5
+ routingDomain: z.string().min(1).max(253),
6
+ addressing: z.enum(['readable', 'opaque']),
7
+ });
8
+ export const listDeploymentsInput = z.strictObject({
9
+ origin: z.string().min(1).max(253).optional(),
10
+ environment: z.string().min(1).max(63).optional(),
11
+ });
12
+ /**
13
+ * The deployments of the caller's lines. A deployment whose stored record or configuration this
14
+ * Services SDK no longer admits is listed from its facts with its record as stored, never dropped,
15
+ * and never fails the listing.
16
+ */
17
+ export const listDeploymentsOutput = z.strictObject({
18
+ deployments: z.array(listedDeploymentSummary),
19
+ });
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ /** The commit a deployment was built from, as its deployer declared it. */
3
+ export declare const deploymentCommit: z.ZodObject<{
4
+ sha: z.ZodString;
5
+ dirty: z.ZodBoolean;
6
+ base: z.ZodOptional<z.ZodObject<{
7
+ version: z.ZodString;
8
+ distance: z.ZodNumber;
9
+ }, z.core.$strict>>;
10
+ }, z.core.$strict>;
11
+ /**
12
+ * The `DeploymentRecordV1` one deploy declares, stored as declared beside the facts Services
13
+ * knows itself. Services admits it with the SDK's `acceptDeploymentRecord` before storing it, so
14
+ * this shape only bounds what the graph holds; any extension is a new record version.
15
+ */
16
+ export declare const deploymentRecord: z.ZodObject<{
17
+ format: z.ZodLiteral<"astrale.deployment-record">;
18
+ version: z.ZodLiteral<1>;
19
+ origin: z.ZodString;
20
+ environment: z.ZodString;
21
+ releaseDigest: z.ZodString;
22
+ buildDigest: z.ZodString;
23
+ schemaRevision: z.ZodString;
24
+ configuration: z.ZodString;
25
+ providerScript: z.ZodString;
26
+ commit: z.ZodNullable<z.ZodObject<{
27
+ sha: z.ZodString;
28
+ dirty: z.ZodBoolean;
29
+ base: z.ZodOptional<z.ZodObject<{
30
+ version: z.ZodString;
31
+ distance: z.ZodNumber;
32
+ }, z.core.$strict>>;
33
+ }, z.core.$strict>>;
34
+ }, z.core.$strict>;
35
+ export type DeploymentRecord = z.output<typeof deploymentRecord>;
@@ -0,0 +1,31 @@
1
+ import { fullMatch } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ const digest = z.string().check(fullMatch('sha256:[0-9a-f]{64}'));
4
+ /** The commit a deployment was built from, as its deployer declared it. */
5
+ export const deploymentCommit = z.strictObject({
6
+ sha: z.string().check(fullMatch('[0-9a-fA-F]{40}')),
7
+ dirty: z.boolean(),
8
+ base: z
9
+ .strictObject({
10
+ version: z.string().min(1).max(256),
11
+ distance: z.number().int().min(0),
12
+ })
13
+ .optional(),
14
+ });
15
+ /**
16
+ * The `DeploymentRecordV1` one deploy declares, stored as declared beside the facts Services
17
+ * knows itself. Services admits it with the SDK's `acceptDeploymentRecord` before storing it, so
18
+ * this shape only bounds what the graph holds; any extension is a new record version.
19
+ */
20
+ export const deploymentRecord = z.strictObject({
21
+ format: z.literal('astrale.deployment-record'),
22
+ version: z.literal(1),
23
+ origin: z.string().min(1).max(253),
24
+ environment: z.string().min(1).max(63),
25
+ releaseDigest: digest,
26
+ buildDigest: digest,
27
+ schemaRevision: digest,
28
+ configuration: digest,
29
+ providerScript: z.string().min(1).max(57),
30
+ commit: deploymentCommit.nullable(),
31
+ });