@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,189 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * One immutable deployment of a release: one build in one environment with its frozen
4
+ * configuration, served by one script at its own URL. It never changes code; a new release is a
5
+ * new deployment on the same line. Its secrets alone rotate in place, on this deployment only,
6
+ * and only under the names its configuration declares: a name added or removed is a new release.
7
+ */
8
+ export declare const Deployment: import("@astrale-os/sdk/schema").AuthoredNodeClass<{
9
+ readonly abstract: true;
10
+ readonly description: "One immutable deployment of a release on a publisher line.";
11
+ readonly icon: import("@astrale-os/sdk/schema").ClassIcon;
12
+ readonly extends: readonly [import("@astrale-os/sdk/schema").KernelClass<"Timestamped">];
13
+ readonly properties: {
14
+ /** `<line>-<content16>`, the DNS label and provider script name of this deployment. */
15
+ label: z.ZodString;
16
+ url: z.ZodString;
17
+ state: import("@astrale-os/sdk/schema").StateProperty<import("@astrale-os/sdk/schema").StateMachine<{
18
+ readonly deploying: {
19
+ readonly activate: "active";
20
+ readonly fail: "failed";
21
+ };
22
+ readonly active: {
23
+ readonly retire: "retiring";
24
+ };
25
+ readonly retiring: {
26
+ readonly completeRetirement: "retired";
27
+ };
28
+ readonly retired: {
29
+ readonly revive: "deploying";
30
+ };
31
+ readonly failed: {
32
+ readonly retry: "deploying";
33
+ readonly retire: "retiring";
34
+ };
35
+ }, "deploying">, {
36
+ required?: boolean;
37
+ description?: string;
38
+ }>;
39
+ retention: z.ZodEnum<{
40
+ preview: "preview";
41
+ published: "published";
42
+ }>;
43
+ record: z.ZodObject<{
44
+ format: z.ZodLiteral<"astrale.deployment-record">;
45
+ version: z.ZodLiteral<1>;
46
+ origin: z.ZodString;
47
+ environment: z.ZodString;
48
+ releaseDigest: z.ZodString;
49
+ buildDigest: z.ZodString;
50
+ schemaRevision: z.ZodString;
51
+ configuration: z.ZodString;
52
+ providerScript: z.ZodString;
53
+ commit: z.ZodNullable<z.ZodObject<{
54
+ sha: z.ZodString;
55
+ dirty: z.ZodBoolean;
56
+ base: z.ZodOptional<z.ZodObject<{
57
+ version: z.ZodString;
58
+ distance: z.ZodNumber;
59
+ }, z.core.$strict>>;
60
+ }, z.core.$strict>>;
61
+ }, z.core.$strict>;
62
+ /** The configuration frozen into this deployment; its digest is `record.configuration`. */
63
+ configuration: z.ZodObject<{
64
+ format: z.ZodLiteral<"astrale.deployment.configuration">;
65
+ version: z.ZodLiteral<1>;
66
+ vars: z.ZodRecord<z.ZodString, z.ZodString>;
67
+ settings: z.ZodObject<{
68
+ maximumRequestBytes: z.ZodNumber;
69
+ invocationTimeoutMs: z.ZodNumber;
70
+ tokenExchange: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
71
+ maximumLifetimeSeconds: z.ZodNumber;
72
+ }, z.core.$strict>]>;
73
+ durableOptions: z.ZodOptional<z.ZodObject<{
74
+ retentionMs: z.ZodOptional<z.ZodNumber>;
75
+ retry: z.ZodOptional<z.ZodObject<{
76
+ initialIntervalMs: z.ZodOptional<z.ZodNumber>;
77
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
78
+ maxIntervalMs: z.ZodOptional<z.ZodNumber>;
79
+ }, z.core.$strict>>;
80
+ stepTimeoutMs: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$strict>>;
82
+ }, z.core.$strict>;
83
+ runtime: z.ZodObject<{
84
+ compatibilityDate: z.ZodString;
85
+ compatibilityFlags: z.ZodArray<z.ZodString>;
86
+ }, z.core.$strict>;
87
+ bindings: z.ZodObject<{
88
+ services: z.ZodArray<z.ZodObject<{
89
+ name: z.ZodString;
90
+ service: z.ZodString;
91
+ }, z.core.$strict>>;
92
+ dispatchNamespaces: z.ZodArray<z.ZodObject<{
93
+ name: z.ZodString;
94
+ namespace: z.ZodString;
95
+ }, z.core.$strict>>;
96
+ secrets: z.ZodArray<z.ZodString>;
97
+ }, z.core.$strict>;
98
+ router: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
99
+ service: z.ZodString;
100
+ hostSuffix: z.ZodString;
101
+ minLabels: z.ZodNumber;
102
+ }, z.core.$strict>]>;
103
+ }, z.core.$strict>;
104
+ /** The keyed digest of each secret bound to this deployment, never a value. */
105
+ secretDigests: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodArray<z.ZodObject<{
106
+ name: z.ZodString;
107
+ digest: z.ZodString;
108
+ }, z.core.$strict>>, {
109
+ readonly required: false;
110
+ }>;
111
+ /**
112
+ * The provider's code hash of the script. With the artifact tag and the configuration digest it
113
+ * identifies the deployment; a secret rewritten in place keeps it, unlike a provider version.
114
+ */
115
+ scriptEtag: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
116
+ readonly required: false;
117
+ }>;
118
+ signingKeyId: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
119
+ readonly required: false;
120
+ }>;
121
+ /**
122
+ * The last time this deployment became active: its creation, or its revival after it expired.
123
+ * A preview's 30 days run from it or from its last call, whichever is later.
124
+ */
125
+ activatedAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
126
+ readonly type: 'string';
127
+ readonly 'x-astrale-value-kind': 'instant';
128
+ }>, {
129
+ readonly required: false;
130
+ }>;
131
+ lastCallAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
132
+ readonly type: 'string';
133
+ readonly 'x-astrale-value-kind': 'instant';
134
+ }>, {
135
+ readonly required: false;
136
+ }>;
137
+ expiresAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
138
+ readonly type: 'string';
139
+ readonly 'x-astrale-value-kind': 'instant';
140
+ }>, {
141
+ readonly required: false;
142
+ }>;
143
+ retiredAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
144
+ readonly type: 'string';
145
+ readonly 'x-astrale-value-kind': 'instant';
146
+ }>, {
147
+ readonly required: false;
148
+ }>;
149
+ retirement: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodEnum<{
150
+ expired: "expired";
151
+ withdrawn: "withdrawn";
152
+ }>, {
153
+ readonly required: false;
154
+ }>;
155
+ /**
156
+ * The graph lease of the provider operation in flight on this deployment: its creation, or an
157
+ * in-place rewrite of its secrets once it serves.
158
+ */
159
+ operationReceipt: import("@astrale-os/sdk/schema").AuthoredProperty<z.ZodString, {
160
+ readonly required: false;
161
+ }>;
162
+ operationExpiresAt: import("@astrale-os/sdk/schema").AuthoredProperty<Readonly<{
163
+ readonly type: 'string';
164
+ readonly 'x-astrale-value-kind': 'instant';
165
+ }>, {
166
+ readonly required: false;
167
+ }>;
168
+ };
169
+ readonly methods: {
170
+ setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
171
+ name: string;
172
+ value: string;
173
+ }, {
174
+ readonly mode: 'value';
175
+ readonly value: {
176
+ name: string;
177
+ } | {
178
+ kind: "rejected";
179
+ reason: "secret-undeclared" | "service-unavailable";
180
+ message: string;
181
+ retryAfter?: string | undefined;
182
+ };
183
+ }, "authenticated", false, true, undefined>>;
184
+ secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
185
+ readonly mode: 'value';
186
+ readonly value: string[];
187
+ }, "authenticated", false, true, undefined>>;
188
+ };
189
+ }>;
@@ -0,0 +1,56 @@
1
+ import { classIcon, K, nodeClass, property, schema as valueSchema, stateProperty, } from '@astrale-os/sdk/schema';
2
+ import { Rocket } from '@astrale-os/sdk/schema/icons';
3
+ import { z } from 'zod';
4
+ import { listDeploymentSecretNames } from '../functions/list-deployment-secret-names.js';
5
+ import { setDeploymentSecret } from '../functions/set-deployment-secret.js';
6
+ import { deploymentLifecycle } from '../states/index.js';
7
+ import { deploymentRecord, deploymentRetention, deploymentRetirement, deploymentSecretDigests, frozenConfiguration, } from '../types/index.js';
8
+ /**
9
+ * One immutable deployment of a release: one build in one environment with its frozen
10
+ * configuration, served by one script at its own URL. It never changes code; a new release is a
11
+ * new deployment on the same line. Its secrets alone rotate in place, on this deployment only,
12
+ * and only under the names its configuration declares: a name added or removed is a new release.
13
+ */
14
+ export const Deployment = nodeClass({
15
+ abstract: true,
16
+ description: 'One immutable deployment of a release on a publisher line.',
17
+ icon: classIcon.lucide(Rocket),
18
+ extends: [K.classes.Timestamped],
19
+ properties: {
20
+ /** `<line>-<content16>`, the DNS label and provider script name of this deployment. */
21
+ label: z.string().min(33).max(57),
22
+ url: z.string().min(1).max(2_048),
23
+ state: stateProperty(deploymentLifecycle),
24
+ retention: deploymentRetention,
25
+ record: deploymentRecord,
26
+ /** The configuration frozen into this deployment; its digest is `record.configuration`. */
27
+ configuration: frozenConfiguration,
28
+ /** The keyed digest of each secret bound to this deployment, never a value. */
29
+ secretDigests: property(deploymentSecretDigests, { required: false }),
30
+ /**
31
+ * The provider's code hash of the script. With the artifact tag and the configuration digest it
32
+ * identifies the deployment; a secret rewritten in place keeps it, unlike a provider version.
33
+ */
34
+ scriptEtag: property(z.string().min(1).max(128), { required: false }),
35
+ signingKeyId: property(z.string().min(1).max(128), { required: false }),
36
+ /**
37
+ * The last time this deployment became active: its creation, or its revival after it expired.
38
+ * A preview's 30 days run from it or from its last call, whichever is later.
39
+ */
40
+ activatedAt: property(valueSchema.values.instant, { required: false }),
41
+ lastCallAt: property(valueSchema.values.instant, { required: false }),
42
+ expiresAt: property(valueSchema.values.instant, { required: false }),
43
+ retiredAt: property(valueSchema.values.instant, { required: false }),
44
+ retirement: property(deploymentRetirement, { required: false }),
45
+ /**
46
+ * The graph lease of the provider operation in flight on this deployment: its creation, or an
47
+ * in-place rewrite of its secrets once it serves.
48
+ */
49
+ operationReceipt: property(z.string().min(1).max(128), { required: false }),
50
+ operationExpiresAt: property(valueSchema.values.instant, { required: false }),
51
+ },
52
+ methods: {
53
+ setSecret: setDeploymentSecret,
54
+ secrets: listDeploymentSecretNames,
55
+ },
56
+ });
@@ -0,0 +1,5 @@
1
+ export { CloudflareDeployment } from './cloudflare-deployment.js';
2
+ export { Deployment } from './deployment.js';
3
+ export { DeploymentLine } from './deployment-line.js';
4
+ export { deployment_on_line } from './deployment-on-line.js';
5
+ export { line_owned_by } from './line-owned-by.js';
@@ -0,0 +1,5 @@
1
+ export { CloudflareDeployment } from './cloudflare-deployment.js';
2
+ export { Deployment } from './deployment.js';
3
+ export { DeploymentLine } from './deployment-line.js';
4
+ export { deployment_on_line } from './deployment-on-line.js';
5
+ export { line_owned_by } from './line-owned-by.js';
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The organisation holding one deployment line: an Identity of the Admin instance, a Shell User
3
+ * or Group, whose members and CI identities act for it through `extends_with`. A line outlives
4
+ * this Edge: deleting its organisation removes the Edge and leaves the line held by nobody until
5
+ * an operator transfer.
6
+ *
7
+ * Hence at most one holder, not exactly one: the Kernel deletes a Node only together with every
8
+ * incident Edge, so a required holder would make the organisation undeletable unless its lines
9
+ * went with it, and a deleted line would free its fingerprint for another organisation.
10
+ */
11
+ export declare const line_owned_by: import("@astrale-os/sdk/schema").DirectedEdgeClass<{
12
+ readonly depth: 0;
13
+ readonly abstract: false;
14
+ readonly extends: readonly [];
15
+ readonly properties: never;
16
+ readonly source: {
17
+ readonly as: "line";
18
+ readonly outgoing: "0..1";
19
+ };
20
+ readonly target: {
21
+ readonly as: "owner";
22
+ readonly incoming: "0..*";
23
+ };
24
+ readonly constraints: Record<never, never>;
25
+ readonly effectiveProperties: never;
26
+ }>;
@@ -0,0 +1,19 @@
1
+ import { edgeClass, K } from '@astrale-os/sdk/schema';
2
+ import { TraverseOwnedLine } from '../policies/traverse-owned-line.js';
3
+ import { DeploymentLine } from './deployment-line.js';
4
+ /**
5
+ * The organisation holding one deployment line: an Identity of the Admin instance, a Shell User
6
+ * or Group, whose members and CI identities act for it through `extends_with`. A line outlives
7
+ * this Edge: deleting its organisation removes the Edge and leaves the line held by nobody until
8
+ * an operator transfer.
9
+ *
10
+ * Hence at most one holder, not exactly one: the Kernel deletes a Node only together with every
11
+ * incident Edge, so a required holder would make the organisation undeletable unless its lines
12
+ * went with it, and a deleted line would free its fingerprint for another organisation.
13
+ */
14
+ export const line_owned_by = edgeClass.directed({
15
+ description: 'The organisation that holds one deployment line.',
16
+ source: { as: 'line', accepts: [() => DeploymentLine], outgoing: '0..1' },
17
+ target: { as: 'owner', accepts: [K.classes.Identity], incoming: '0..*' },
18
+ policies: { traverse: () => TraverseOwnedLine },
19
+ });
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ /** Asked of a Services runtime that hosts no deployments: only Admin's Services host them. */
3
+ export declare const deploymentHostingUnavailable: Readonly<{
4
+ readonly family: "UNSUPPORTED";
5
+ readonly message: "This Services runtime does not host deployments.";
6
+ readonly details: z.ZodObject<{}, z.core.$strict>;
7
+ }>;
@@ -0,0 +1,8 @@
1
+ import { error } from '@astrale-os/sdk/schema/errors';
2
+ import { z } from 'zod';
3
+ /** Asked of a Services runtime that hosts no deployments: only Admin's Services host them. */
4
+ export const deploymentHostingUnavailable = error({
5
+ family: 'UNSUPPORTED',
6
+ message: 'This Services runtime does not host deployments.',
7
+ details: z.strictObject({}),
8
+ });
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A label that names no deployment the caller may read: an unknown label and another
4
+ * organisation's deployment answer alike, so the answer never tells one from the other.
5
+ */
6
+ export declare const deploymentLabelNotFound: Readonly<{
7
+ readonly family: "NOT_FOUND";
8
+ readonly message: "No deployment of yours has this label.";
9
+ readonly details: z.ZodObject<{
10
+ label: z.ZodString;
11
+ }, z.core.$strict>;
12
+ }>;
@@ -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
+ });