@astrale-domains/services 0.4.9 → 0.5.0

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 (181) hide show
  1. package/README.md +153 -816
  2. package/dist/schema/index.d.ts +4 -5
  3. package/dist/schema/index.js +2 -3
  4. package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +4 -321
  5. package/dist/schema/modules/deployment/classes/cloudflare-deployment.js +1 -19
  6. package/dist/schema/modules/deployment/classes/current-deployment.d.ts +20 -0
  7. package/dist/schema/modules/deployment/classes/current-deployment.js +13 -0
  8. package/dist/schema/modules/deployment/classes/{deployment-on-line.d.ts → deployment-of.d.ts} +3 -3
  9. package/dist/schema/modules/deployment/classes/deployment-of.js +11 -0
  10. package/dist/schema/modules/deployment/classes/deployment.d.ts +9 -57
  11. package/dist/schema/modules/deployment/classes/deployment.js +9 -23
  12. package/dist/schema/modules/deployment/classes/index.d.ts +2 -3
  13. package/dist/schema/modules/deployment/classes/index.js +2 -3
  14. package/dist/schema/modules/deployment/errors/deployment-not-found.d.ts +2 -5
  15. package/dist/schema/modules/deployment/errors/deployment-not-found.js +2 -5
  16. package/dist/schema/modules/deployment/errors/index.d.ts +0 -2
  17. package/dist/schema/modules/deployment/errors/index.js +0 -2
  18. package/dist/schema/modules/deployment/functions/index.d.ts +0 -10
  19. package/dist/schema/modules/deployment/functions/index.js +0 -10
  20. package/dist/schema/modules/deployment/functions/retire-deployment.d.ts +8 -7
  21. package/dist/schema/modules/deployment/functions/retire-deployment.js +8 -7
  22. package/dist/schema/modules/deployment/index.d.ts +6 -6
  23. package/dist/schema/modules/deployment/index.js +7 -5
  24. package/dist/schema/modules/deployment/policies/index.d.ts +1 -4
  25. package/dist/schema/modules/deployment/policies/index.js +1 -4
  26. package/dist/schema/modules/deployment/policies/own-deployment.d.ts +1 -1
  27. package/dist/schema/modules/deployment/policies/own-deployment.js +6 -7
  28. package/dist/schema/modules/deployment/policies/traverse-owned-service-deployment.d.ts +2 -0
  29. package/dist/schema/modules/deployment/policies/traverse-owned-service-deployment.js +7 -0
  30. package/dist/schema/modules/deployment/states/deployment-lifecycle.d.ts +6 -9
  31. package/dist/schema/modules/deployment/states/deployment-lifecycle.js +6 -7
  32. package/dist/schema/modules/deployment/types/deployment-hosting.d.ts +9 -28
  33. package/dist/schema/modules/deployment/types/deployment-hosting.js +3 -3
  34. package/dist/schema/modules/deployment/types/deployment-request.d.ts +12 -40
  35. package/dist/schema/modules/deployment/types/deployment-request.js +17 -9
  36. package/dist/schema/modules/deployment/types/deployment-response.d.ts +7 -15
  37. package/dist/schema/modules/deployment/types/deployment-response.js +2 -2
  38. package/dist/schema/modules/deployment/types/deployment-retire.d.ts +1 -1
  39. package/dist/schema/modules/deployment/types/deployment-secret.d.ts +0 -39
  40. package/dist/schema/modules/deployment/types/deployment-secret.js +0 -34
  41. package/dist/schema/modules/deployment/types/deployment-summary.d.ts +14 -45
  42. package/dist/schema/modules/deployment/types/deployment-summary.js +9 -8
  43. package/dist/schema/modules/deployment/types/index.d.ts +7 -3
  44. package/dist/schema/modules/deployment/types/index.js +4 -2
  45. package/dist/schema/modules/{service → deployment}/types/service-deployment-artifact-module.d.ts +2 -20
  46. package/dist/schema/modules/deployment/types/service-deployment-artifact-module.js +10 -0
  47. package/dist/schema/modules/{service → deployment}/types/service-deployment-assets.d.ts +4 -20
  48. package/dist/schema/modules/{service → deployment}/types/service-deployment-assets.js +4 -7
  49. package/dist/schema/modules/service/classes/cloudflare-service.d.ts +321 -0
  50. package/dist/schema/modules/service/classes/cloudflare-service.js +35 -0
  51. package/dist/schema/modules/service/classes/index.d.ts +1 -1
  52. package/dist/schema/modules/service/classes/index.js +1 -1
  53. package/dist/schema/modules/service/classes/service.d.ts +18 -107
  54. package/dist/schema/modules/service/classes/service.js +16 -27
  55. package/dist/schema/modules/service/errors/index.d.ts +1 -0
  56. package/dist/schema/modules/service/errors/index.js +1 -0
  57. package/dist/schema/modules/service/errors/service-not-found.d.ts +7 -0
  58. package/dist/schema/modules/service/errors/service-not-found.js +8 -0
  59. package/dist/schema/modules/service/functions/delete-service.d.ts +1 -1
  60. package/dist/schema/modules/service/functions/delete-service.js +1 -1
  61. package/dist/schema/modules/{deployment/functions/deploy-cloudflare-deployment.d.ts → service/functions/deploy-service.d.ts} +20 -35
  62. package/dist/schema/modules/service/functions/deploy-service.js +15 -0
  63. package/dist/schema/modules/service/functions/describe-hosting.d.ts +8 -0
  64. package/dist/schema/modules/service/functions/describe-hosting.js +11 -0
  65. package/dist/schema/modules/service/functions/index.d.ts +5 -10
  66. package/dist/schema/modules/service/functions/index.js +5 -10
  67. package/dist/schema/modules/{deployment/functions/list-cloudflare-deployments.d.ts → service/functions/list-service-deployments.d.ts} +8 -12
  68. package/dist/schema/modules/service/functions/list-service-deployments.js +10 -0
  69. package/dist/schema/modules/service/functions/list-service-logs.d.ts +2 -1
  70. package/dist/schema/modules/service/functions/list-service-logs.js +1 -1
  71. package/dist/schema/modules/service/functions/list-service-schedules.d.ts +1 -1
  72. package/dist/schema/modules/service/functions/list-service-schedules.js +1 -1
  73. package/dist/schema/modules/service/functions/list-service-secret-names.d.ts +1 -1
  74. package/dist/schema/modules/service/functions/list-service-secret-names.js +1 -1
  75. package/dist/schema/modules/service/functions/promote-service.d.ts +14 -0
  76. package/dist/schema/modules/service/functions/promote-service.js +4 -0
  77. package/dist/schema/modules/service/functions/replace-service-schedules.d.ts +1 -1
  78. package/dist/schema/modules/service/functions/replace-service-schedules.js +1 -4
  79. package/dist/schema/modules/service/functions/set-service-secret.d.ts +4 -2
  80. package/dist/schema/modules/service/functions/set-service-secret.js +1 -1
  81. package/dist/schema/modules/service/functions/transfer-service.d.ts +14 -0
  82. package/dist/schema/modules/service/functions/transfer-service.js +4 -0
  83. package/dist/schema/modules/service/index.d.ts +5 -5
  84. package/dist/schema/modules/service/index.js +5 -4
  85. package/dist/schema/modules/service/policies/act-as.d.ts +6 -0
  86. package/dist/schema/modules/service/policies/act-as.js +10 -0
  87. package/dist/schema/modules/service/policies/index.d.ts +1 -0
  88. package/dist/schema/modules/service/policies/index.js +1 -0
  89. package/dist/schema/modules/service/states/service-lifecycle.d.ts +7 -20
  90. package/dist/schema/modules/service/states/service-lifecycle.js +6 -21
  91. package/dist/schema/modules/service/types/index.d.ts +1 -13
  92. package/dist/schema/modules/service/types/index.js +1 -8
  93. package/dist/schema/modules/service/types/service-management.d.ts +65 -24
  94. package/dist/schema/modules/service/types/service-management.js +46 -21
  95. package/dist/schema/schema.d.ts +252 -758
  96. package/dist/schema/schema.js +7 -11
  97. package/package.json +2 -9
  98. package/dist/scaffold/create-service.mjs +0 -77
  99. package/dist/scaffold/template/.env.example +0 -2
  100. package/dist/scaffold/template/README.md +0 -37
  101. package/dist/scaffold/template/gitignore +0 -6
  102. package/dist/scaffold/template/scripts/build.mjs +0 -10
  103. package/dist/scaffold/template/scripts/deploy.mjs +0 -50
  104. package/dist/scaffold/template/src/account.js +0 -26
  105. package/dist/scaffold/template/src/index.js +0 -32
  106. package/dist/scaffold/template/src/job.js +0 -19
  107. package/dist/schema/modules/deployment/classes/deployment-line.d.ts +0 -23
  108. package/dist/schema/modules/deployment/classes/deployment-line.js +0 -24
  109. package/dist/schema/modules/deployment/classes/deployment-on-line.js +0 -11
  110. package/dist/schema/modules/deployment/classes/line-owned-by.d.ts +0 -26
  111. package/dist/schema/modules/deployment/classes/line-owned-by.js +0 -19
  112. package/dist/schema/modules/deployment/errors/deployment-label-not-found.d.ts +0 -12
  113. package/dist/schema/modules/deployment/errors/deployment-label-not-found.js +0 -11
  114. package/dist/schema/modules/deployment/errors/deployment-registry-only.d.ts +0 -11
  115. package/dist/schema/modules/deployment/errors/deployment-registry-only.js +0 -12
  116. package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.js +0 -14
  117. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.d.ts +0 -8
  118. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.js +0 -11
  119. package/dist/schema/modules/deployment/functions/expire-deployment-previews.d.ts +0 -16
  120. package/dist/schema/modules/deployment/functions/expire-deployment-previews.js +0 -14
  121. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.d.ts +0 -5
  122. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.js +0 -4
  123. package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.js +0 -10
  124. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.d.ts +0 -4
  125. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.js +0 -6
  126. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.d.ts +0 -10
  127. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.js +0 -13
  128. package/dist/schema/modules/deployment/functions/retain-deployment.d.ts +0 -12
  129. package/dist/schema/modules/deployment/functions/retain-deployment.js +0 -13
  130. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.d.ts +0 -18
  131. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.js +0 -7
  132. package/dist/schema/modules/deployment/functions/set-deployment-secret.d.ts +0 -14
  133. package/dist/schema/modules/deployment/functions/set-deployment-secret.js +0 -3
  134. package/dist/schema/modules/deployment/policies/act-for-organization.d.ts +0 -6
  135. package/dist/schema/modules/deployment/policies/act-for-organization.js +0 -10
  136. package/dist/schema/modules/deployment/policies/own-line.d.ts +0 -5
  137. package/dist/schema/modules/deployment/policies/own-line.js +0 -10
  138. package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.d.ts +0 -2
  139. package/dist/schema/modules/deployment/policies/traverse-owned-line-deployment.js +0 -7
  140. package/dist/schema/modules/deployment/policies/traverse-owned-line.d.ts +0 -2
  141. package/dist/schema/modules/deployment/policies/traverse-owned-line.js +0 -7
  142. package/dist/schema/modules/deployment/types/deployment-retention.d.ts +0 -49
  143. package/dist/schema/modules/deployment/types/deployment-retention.js +0 -45
  144. package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +0 -352
  145. package/dist/schema/modules/service/classes/cloudflare-worker.js +0 -41
  146. package/dist/schema/modules/service/functions/delete-service-secret.d.ts +0 -11
  147. package/dist/schema/modules/service/functions/delete-service-secret.js +0 -3
  148. package/dist/schema/modules/service/functions/delete-worker-secret.d.ts +0 -11
  149. package/dist/schema/modules/service/functions/delete-worker-secret.js +0 -7
  150. package/dist/schema/modules/service/functions/delete-worker.d.ts +0 -9
  151. package/dist/schema/modules/service/functions/delete-worker.js +0 -7
  152. package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +0 -109
  153. package/dist/schema/modules/service/functions/deploy-cloudflare-worker.js +0 -9
  154. package/dist/schema/modules/service/functions/list-worker-logs.d.ts +0 -12
  155. package/dist/schema/modules/service/functions/list-worker-logs.js +0 -7
  156. package/dist/schema/modules/service/functions/list-worker-schedules.d.ts +0 -4
  157. package/dist/schema/modules/service/functions/list-worker-schedules.js +0 -7
  158. package/dist/schema/modules/service/functions/list-worker-secret-names.d.ts +0 -4
  159. package/dist/schema/modules/service/functions/list-worker-secret-names.js +0 -7
  160. package/dist/schema/modules/service/functions/migrate-worker-ingress.d.ts +0 -24
  161. package/dist/schema/modules/service/functions/migrate-worker-ingress.js +0 -26
  162. package/dist/schema/modules/service/functions/replace-worker-schedules.d.ts +0 -11
  163. package/dist/schema/modules/service/functions/replace-worker-schedules.js +0 -7
  164. package/dist/schema/modules/service/functions/set-worker-secret.d.ts +0 -12
  165. package/dist/schema/modules/service/functions/set-worker-secret.js +0 -7
  166. package/dist/schema/modules/service/types/deploy-cloudflare-worker.d.ts +0 -286
  167. package/dist/schema/modules/service/types/deploy-cloudflare-worker.js +0 -51
  168. package/dist/schema/modules/service/types/legacy/service-deployment-content.js +0 -22
  169. package/dist/schema/modules/service/types/service-deployment-artifact-module.js +0 -13
  170. package/dist/schema/modules/service/types/service-deployment-resource-limits.d.ts +0 -6
  171. package/dist/schema/modules/service/types/service-deployment-resource-limits.js +0 -7
  172. package/dist/schema/modules/service/types/service-readiness.d.ts +0 -6
  173. package/dist/schema/modules/service/types/service-readiness.js +0 -6
  174. package/dist/schema/modules/service/types/service-secret-operation-rejection.d.ts +0 -9
  175. package/dist/schema/modules/service/types/service-secret-operation-rejection.js +0 -5
  176. /package/dist/schema/modules/{service → deployment}/types/content/index.d.ts +0 -0
  177. /package/dist/schema/modules/{service → deployment}/types/content/index.js +0 -0
  178. /package/dist/schema/modules/{service → deployment}/types/content/limits.d.ts +0 -0
  179. /package/dist/schema/modules/{service → deployment}/types/content/limits.js +0 -0
  180. /package/dist/schema/modules/{service → deployment}/types/service-deployment-content.d.ts +0 -0
  181. /package/dist/schema/modules/{service → deployment}/types/service-deployment-content.js +0 -0
@@ -1,27 +1,24 @@
1
1
  import { classIcon, K, nodeClass, property, schema as valueSchema, stateProperty, } from '@astrale-os/sdk/schema';
2
2
  import { Rocket } from '@astrale-os/sdk/schema/icons';
3
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
4
  import { deploymentLifecycle } from '../states/index.js';
7
- import { deploymentRecord, deploymentRetention, deploymentRetirement, deploymentSecretDigests, frozenConfiguration, } from '../types/index.js';
5
+ import { deploymentRecord, deploymentSecretDigests, frozenConfiguration } from '../types/index.js';
8
6
  /**
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.
7
+ * One immutable deployment of one Service: one build in one environment with its frozen
8
+ * configuration, served by one script at its own URL. It never changes code; a new release is a new
9
+ * deployment of the same Service. Only its secrets rotate in place, under the names its
10
+ * configuration declares.
13
11
  */
14
12
  export const Deployment = nodeClass({
15
13
  abstract: true,
16
- description: 'One immutable deployment of a release on a publisher line.',
14
+ description: 'One immutable deployment of a Service.',
17
15
  icon: classIcon.lucide(Rocket),
18
16
  extends: [K.classes.Timestamped],
19
17
  properties: {
20
- /** `<line>-<content16>`, the DNS label and provider script name of this deployment. */
18
+ /** `<service name>-<content16>`, the DNS label and provider script name of this deployment. */
21
19
  label: z.string().min(33).max(57),
22
20
  url: z.string().min(1).max(2_048),
23
21
  state: stateProperty(deploymentLifecycle),
24
- retention: deploymentRetention,
25
22
  record: deploymentRecord,
26
23
  /** The configuration frozen into this deployment; its digest is `record.configuration`. */
27
24
  configuration: frozenConfiguration,
@@ -33,24 +30,13 @@ export const Deployment = nodeClass({
33
30
  */
34
31
  scriptEtag: property(z.string().min(1).max(128), { required: false }),
35
32
  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
33
  activatedAt: property(valueSchema.values.instant, { required: false }),
41
- lastCallAt: property(valueSchema.values.instant, { required: false }),
42
- expiresAt: property(valueSchema.values.instant, { required: false }),
43
34
  retiredAt: property(valueSchema.values.instant, { required: false }),
44
- retirement: property(deploymentRetirement, { required: false }),
45
35
  /**
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.
36
+ * The graph lease of the provider operation in flight on this deployment: its creation, an
37
+ * in-place rewrite of its secrets, or its retirement.
48
38
  */
49
39
  operationReceipt: property(z.string().min(1).max(128), { required: false }),
50
40
  operationExpiresAt: property(valueSchema.values.instant, { required: false }),
51
41
  },
52
- methods: {
53
- setSecret: setDeploymentSecret,
54
- secrets: listDeploymentSecretNames,
55
- },
56
42
  });
@@ -1,5 +1,4 @@
1
1
  export { CloudflareDeployment } from './cloudflare-deployment.js';
2
+ export { current_deployment } from './current-deployment.js';
2
3
  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';
4
+ export { deployment_of } from './deployment-of.js';
@@ -1,5 +1,4 @@
1
1
  export { CloudflareDeployment } from './cloudflare-deployment.js';
2
+ export { current_deployment } from './current-deployment.js';
2
3
  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';
4
+ export { deployment_of } from './deployment-of.js';
@@ -1,10 +1,7 @@
1
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
- */
2
+ /** Asked about a deployment of a Service the caller does not own: it is invisible to the caller. */
6
3
  export declare const deploymentNotFound: Readonly<{
7
4
  readonly family: "NOT_FOUND";
8
- readonly message: "No deployment of a line the caller holds has this id.";
5
+ readonly message: "No deployment of a Service the caller owns has this id.";
9
6
  readonly details: z.ZodObject<{}, z.core.$strict>;
10
7
  }>;
@@ -1,11 +1,8 @@
1
1
  import { error } from '@astrale-os/sdk/schema/errors';
2
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
- */
3
+ /** Asked about a deployment of a Service the caller does not own: it is invisible to the caller. */
7
4
  export const deploymentNotFound = error({
8
5
  family: 'NOT_FOUND',
9
- message: 'No deployment of a line the caller holds has this id.',
6
+ message: 'No deployment of a Service the caller owns has this id.',
10
7
  details: z.strictObject({}),
11
8
  });
@@ -1,4 +1,2 @@
1
1
  export { deploymentHostingUnavailable } from './deployment-hosting-unavailable.js';
2
- export { deploymentLabelNotFound } from './deployment-label-not-found.js';
3
2
  export { deploymentNotFound } from './deployment-not-found.js';
4
- export { deploymentRegistryOnly } from './deployment-registry-only.js';
@@ -1,4 +1,2 @@
1
1
  export { deploymentHostingUnavailable } from './deployment-hosting-unavailable.js';
2
- export { deploymentLabelNotFound } from './deployment-label-not-found.js';
3
2
  export { deploymentNotFound } from './deployment-not-found.js';
4
- export { deploymentRegistryOnly } from './deployment-registry-only.js';
@@ -1,11 +1 @@
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
1
  export { retireDeployment } from './retire-deployment.js';
10
- export { setCloudflareDeploymentSecret } from './set-cloudflare-deployment-secret.js';
11
- export { setDeploymentSecret } from './set-deployment-secret.js';
@@ -1,11 +1 @@
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
1
  export { retireDeployment } from './retire-deployment.js';
10
- export { setCloudflareDeploymentSecret } from './set-cloudflare-deployment-secret.js';
11
- export { setDeploymentSecret } from './set-deployment-secret.js';
@@ -1,11 +1,12 @@
1
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.
2
+ * Withdraw one deployment for good: its URL then answers `DEPLOYMENT_RETIRED`, its script and key
3
+ * are deleted, and no redeploy serves it again. The current deployment of a Service is never
4
+ * retired alone: promote another one first, or delete the Service.
4
5
  *
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.
6
+ * Only the owner of the deployment's Service, or an Identity acting as it, withdraws it: the
7
+ * handler asks the Kernel `OwnDeployment` for the caller before it reads the deployment. An
8
+ * `authorized` Method would also require the caller's principal to hold `can_use` on this
9
+ * Function, which no deployer identity holds on the Admin instance.
9
10
  */
10
11
  export declare const retireDeployment: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
11
12
  readonly mode: 'value';
@@ -16,7 +17,7 @@ export declare const retireDeployment: import("@astrale-os/sdk/schema").Method<i
16
17
  retryAfterMs: number;
17
18
  } | {
18
19
  kind: "rejected";
19
- reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "line-owned-elsewhere" | "service-unavailable";
20
+ reason: "address-mismatch" | "build-mismatch" | "deployment-conflict" | "deployment-retired" | "hosting-unavailable" | "invalid-deployment" | "service-owned-elsewhere" | "service-unavailable";
20
21
  message: string;
21
22
  retryAfter?: string | undefined;
22
23
  };
@@ -1,16 +1,17 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
2
  import { retireDeploymentInput, retireDeploymentOutput } from '../types/deployment-retire.js';
3
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.
4
+ * Withdraw one deployment for good: its URL then answers `DEPLOYMENT_RETIRED`, its script and key
5
+ * are deleted, and no redeploy serves it again. The current deployment of a Service is never
6
+ * retired alone: promote another one first, or delete the Service.
6
7
  *
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.
8
+ * Only the owner of the deployment's Service, or an Identity acting as it, withdraws it: the
9
+ * handler asks the Kernel `OwnDeployment` for the caller before it reads the deployment. An
10
+ * `authorized` Method would also require the caller's principal to hold `can_use` on this
11
+ * Function, which no deployer identity holds on the Admin instance.
11
12
  */
12
13
  export const retireDeployment = method({
13
- description: 'Withdraw this deployment for good: an emergency stop.',
14
+ description: 'Withdraw this deployment for good.',
14
15
  auth: 'authenticated',
15
16
  input: retireDeploymentInput,
16
17
  output: retireDeploymentOutput,
@@ -1,8 +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';
1
+ export { artifactModule, assetBundle, assetFile, deploymentCommit, deploymentHosting, deploymentRecord, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, frozenConfiguration, listDeploymentsInput, listDeploymentsOutput, listedDeploymentSummary, retireDeploymentInput, retireDeploymentOutput, unadmittedDeploymentSummary, } from './types/index.js';
2
+ export type { ArtifactModule, AssetBundle, ServiceDeploymentContent, DeploymentHosting, DeploymentRecord, DeploymentRejection, DeploymentRejectionReason, DeploymentRequest, DeploymentResponse, DeploymentSecretDigest, DeploymentSecretRejection, DeploymentSummary, FrozenConfiguration, ListedDeploymentSummary, RetireDeploymentResult, UnadmittedDeploymentSummary, } from './types/index.js';
3
+ export { CloudflareDeployment, Deployment, current_deployment, deployment_of, } from './classes/index.js';
4
+ export { deploymentHostingUnavailable, deploymentNotFound } from './errors/index.js';
5
+ export { retireDeployment } from './functions/index.js';
6
+ export { OwnDeployment, TraverseOwnedServiceDeployment } from './policies/index.js';
5
7
  export { deploymentLifecycle } from './states/index.js';
6
8
  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';
@@ -1,6 +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';
1
+ // Types first: the service module's Methods read them while this module's classes, which refer
2
+ // to the Service class, are still evaluating.
3
+ export { artifactModule, assetBundle, assetFile, deploymentCommit, deploymentHosting, deploymentRecord, deploymentRejection, deploymentRejectionReason, deploymentRequest, deploymentResponse, deploymentSecretDigest, deploymentSecretDigests, deploymentSecretRejection, deploymentSummary, frozenConfiguration, listDeploymentsInput, listDeploymentsOutput, listedDeploymentSummary, retireDeploymentInput, retireDeploymentOutput, unadmittedDeploymentSummary, } from './types/index.js';
4
+ export { CloudflareDeployment, Deployment, current_deployment, deployment_of, } from './classes/index.js';
5
+ export { deploymentHostingUnavailable, deploymentNotFound } from './errors/index.js';
6
+ export { retireDeployment } from './functions/index.js';
7
+ export { OwnDeployment, TraverseOwnedServiceDeployment } from './policies/index.js';
5
8
  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';
@@ -1,5 +1,2 @@
1
- export { ActForOrganization } from './act-for-organization.js';
2
1
  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';
2
+ export { TraverseOwnedServiceDeployment } from './traverse-owned-service-deployment.js';
@@ -1,5 +1,2 @@
1
- export { ActForOrganization } from './act-for-organization.js';
2
1
  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';
2
+ export { TraverseOwnedServiceDeployment } from './traverse-owned-service-deployment.js';
@@ -1,2 +1,2 @@
1
- /** A deployment belongs to whoever holds its line; it carries no owner of its own. */
1
+ /** A deployment belongs to whoever owns its Service; it carries no owner of its own. */
2
2
  export declare const OwnDeployment: import("@astrale-os/sdk/schema").Policy;
@@ -1,12 +1,11 @@
1
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. */
2
+ import { Service, service_owned_by } from '../../service/index.js';
3
+ import { deployment_of } from '../classes/deployment-of.js';
4
+ /** A deployment belongs to whoever owns its Service; it carries no owner of its own. */
6
5
  export const OwnDeployment = policy({
7
- description: 'The subject holds the deployment line this Deployment was made on.',
6
+ description: 'The subject owns the Service this Deployment is a version of.',
8
7
  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 }));
8
+ const service = node(() => Service);
9
+ return allOf(edge({ source: object, class: () => deployment_of, target: service }), edge({ source: service, class: () => service_owned_by, target: subject }));
11
10
  }),
12
11
  });
@@ -0,0 +1,2 @@
1
+ /** A deployment's Service relationship is visible only to the owner of that Service. */
2
+ export declare const TraverseOwnedServiceDeployment: import("@astrale-os/sdk/schema").Policy;
@@ -0,0 +1,7 @@
1
+ import { policy } from '@astrale-os/sdk/schema';
2
+ import { service_owned_by } from '../../service/index.js';
3
+ /** A deployment's Service relationship is visible only to the owner of that Service. */
4
+ export const TraverseOwnedServiceDeployment = policy({
5
+ description: 'The subject owns the Service at the target of this relationship.',
6
+ match: ({ edge, subject, target }) => edge({ source: target, class: () => service_owned_by, target: subject }),
7
+ });
@@ -1,11 +1,10 @@
1
1
  import { type EventOf, type StateOf } from '@astrale-os/sdk/state';
2
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.
3
+ * Lifecycle of one immutable deployment. It is created `deploying`, becomes `active` once its
4
+ * script serves, and leaves only by retirement, in two phases: `retiring` once its tombstone is
5
+ * written, `retired` once its script and key are deleted. A failed creation can be retried on the
6
+ * same label, or retired, since it may have left a script. A retired deployment is never served
7
+ * again.
9
8
  */
10
9
  export declare const deploymentLifecycle: import("@astrale-os/sdk/schema").StateMachine<{
11
10
  readonly deploying: {
@@ -18,9 +17,7 @@ export declare const deploymentLifecycle: import("@astrale-os/sdk/schema").State
18
17
  readonly retiring: {
19
18
  readonly completeRetirement: "retired";
20
19
  };
21
- readonly retired: {
22
- readonly revive: "deploying";
23
- };
20
+ readonly retired: {};
24
21
  readonly failed: {
25
22
  readonly retry: "deploying";
26
23
  readonly retire: "retiring";
@@ -1,11 +1,10 @@
1
1
  import { stateMachine } from '@astrale-os/sdk/state';
2
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.
3
+ * Lifecycle of one immutable deployment. It is created `deploying`, becomes `active` once its
4
+ * script serves, and leaves only by retirement, in two phases: `retiring` once its tombstone is
5
+ * written, `retired` once its script and key are deleted. A failed creation can be retried on the
6
+ * same label, or retired, since it may have left a script. A retired deployment is never served
7
+ * again.
9
8
  */
10
9
  export const deploymentLifecycle = stateMachine({
11
10
  initial: 'deploying',
@@ -13,7 +12,7 @@ export const deploymentLifecycle = stateMachine({
13
12
  deploying: { activate: 'active', fail: 'failed' },
14
13
  active: { retire: 'retiring' },
15
14
  retiring: { completeRetirement: 'retired' },
16
- retired: { revive: 'deploying' },
15
+ retired: {},
17
16
  failed: { retry: 'deploying', retire: 'retiring' },
18
17
  },
19
18
  });
@@ -1,18 +1,15 @@
1
1
  import { z } from 'zod';
2
- /** Where this Services runtime addresses deployments, and how the caller's own lines read. */
2
+ /** Where this Services runtime addresses Services and deployments; their names are opaque. */
3
3
  export declare const deploymentHosting: z.ZodObject<{
4
4
  routingDomain: z.ZodString;
5
- addressing: z.ZodEnum<{
6
- opaque: "opaque";
7
- readable: "readable";
8
- }>;
5
+ addressing: z.ZodLiteral<"opaque">;
9
6
  }, z.core.$strict>;
10
7
  export declare const listDeploymentsInput: z.ZodObject<{
11
8
  origin: z.ZodOptional<z.ZodString>;
12
9
  environment: z.ZodOptional<z.ZodString>;
13
10
  }, z.core.$strict>;
14
11
  /**
15
- * The deployments of the caller's lines. A deployment whose stored record or configuration this
12
+ * The deployments of the caller's Services. A deployment whose stored record or configuration this
16
13
  * Services SDK no longer admits is listed from its facts with its record as stored, never dropped,
17
14
  * and never fails the listing.
18
15
  */
@@ -21,7 +18,8 @@ export declare const listDeploymentsOutput: z.ZodObject<{
21
18
  id: z.ZodString;
22
19
  url: z.ZodString;
23
20
  label: z.ZodString;
24
- line: z.ZodString;
21
+ serviceId: z.ZodString;
22
+ service: z.ZodString;
25
23
  owner: z.ZodString;
26
24
  state: z.ZodEnum<{
27
25
  active: "active";
@@ -30,18 +28,9 @@ export declare const listDeploymentsOutput: z.ZodObject<{
30
28
  retired: "retired";
31
29
  retiring: "retiring";
32
30
  }>;
33
- retention: z.ZodEnum<{
34
- preview: "preview";
35
- published: "published";
36
- }>;
31
+ current: z.ZodBoolean;
37
32
  createdAt: z.ZodString;
38
- lastCallAt: z.ZodOptional<z.ZodString>;
39
- expiresAt: z.ZodOptional<z.ZodString>;
40
33
  retiredAt: z.ZodOptional<z.ZodString>;
41
- retirement: z.ZodOptional<z.ZodEnum<{
42
- expired: "expired";
43
- withdrawn: "withdrawn";
44
- }>>;
45
34
  signingKeyId: z.ZodString;
46
35
  record: z.ZodObject<{
47
36
  format: z.ZodLiteral<"astrale.deployment-record">;
@@ -66,7 +55,8 @@ export declare const listDeploymentsOutput: z.ZodObject<{
66
55
  id: z.ZodString;
67
56
  url: z.ZodString;
68
57
  label: z.ZodString;
69
- line: z.ZodString;
58
+ serviceId: z.ZodString;
59
+ service: z.ZodString;
70
60
  owner: z.ZodString;
71
61
  state: z.ZodEnum<{
72
62
  active: "active";
@@ -75,18 +65,9 @@ export declare const listDeploymentsOutput: z.ZodObject<{
75
65
  retired: "retired";
76
66
  retiring: "retiring";
77
67
  }>;
78
- retention: z.ZodEnum<{
79
- preview: "preview";
80
- published: "published";
81
- }>;
68
+ current: z.ZodBoolean;
82
69
  createdAt: z.ZodString;
83
- lastCallAt: z.ZodOptional<z.ZodString>;
84
- expiresAt: z.ZodOptional<z.ZodString>;
85
70
  retiredAt: z.ZodOptional<z.ZodString>;
86
- retirement: z.ZodOptional<z.ZodEnum<{
87
- expired: "expired";
88
- withdrawn: "withdrawn";
89
- }>>;
90
71
  signingKeyId: z.ZodString;
91
72
  record: z.ZodUnknown;
92
73
  }, z.core.$strict>]>>;
@@ -1,16 +1,16 @@
1
1
  import { z } from 'zod';
2
2
  import { listedDeploymentSummary } from './deployment-summary.js';
3
- /** Where this Services runtime addresses deployments, and how the caller's own lines read. */
3
+ /** Where this Services runtime addresses Services and deployments; their names are opaque. */
4
4
  export const deploymentHosting = z.strictObject({
5
5
  routingDomain: z.string().min(1).max(253),
6
- addressing: z.enum(['readable', 'opaque']),
6
+ addressing: z.literal('opaque'),
7
7
  });
8
8
  export const listDeploymentsInput = z.strictObject({
9
9
  origin: z.string().min(1).max(253).optional(),
10
10
  environment: z.string().min(1).max(63).optional(),
11
11
  });
12
12
  /**
13
- * The deployments of the caller's lines. A deployment whose stored record or configuration this
13
+ * The deployments of the caller's Services. A deployment whose stored record or configuration this
14
14
  * Services SDK no longer admits is listed from its facts with its record as stored, never dropped,
15
15
  * and never fails the listing.
16
16
  */
@@ -1,21 +1,18 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * `DeploymentRequestV1`: one release to host on the line of its origin and environment. Services
4
- * recomputes the build digest from the uploaded bytes and the label from the line, the build and
5
- * the configuration; the request states both so a deployer that computed another address is
6
- * refused rather than served elsewhere. The secrets are the environment's current values, bound to
7
- * the new deployment only.
3
+ * `DeploymentRequestV1`: one release to host as a deployment of the Service of its origin and
4
+ * environment. Services recomputes the build digest from the uploaded bytes and the label from the
5
+ * Service name, the build and the configuration; the request states both so a deployer that
6
+ * computed another address is refused rather than served elsewhere. The secrets are the
7
+ * environment's current values, bound to the new deployment only.
8
8
  */
9
9
  export declare const deploymentRequest: z.ZodObject<{
10
10
  format: z.ZodLiteral<"astrale.services.deployment-request">;
11
11
  version: z.ZodLiteral<1>;
12
- organization: z.ZodOptional<z.ZodString>;
12
+ owner: z.ZodOptional<z.ZodString>;
13
13
  origin: z.ZodString;
14
14
  environment: z.ZodString;
15
- addressing: z.ZodEnum<{
16
- opaque: "opaque";
17
- readable: "readable";
18
- }>;
15
+ addressing: z.ZodLiteral<"opaque">;
19
16
  label: z.ZodString;
20
17
  buildDigest: z.ZodString;
21
18
  configuration: z.ZodObject<{
@@ -74,7 +71,7 @@ export declare const deploymentRequest: z.ZodObject<{
74
71
  }, z.core.$strict>;
75
72
  bundle: z.ZodObject<{
76
73
  entrypoint: z.ZodString;
77
- modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
74
+ modules: z.ZodArray<z.ZodObject<{
78
75
  name: z.ZodString;
79
76
  kind: z.ZodOptional<z.ZodEnum<{
80
77
  data: "data";
@@ -97,27 +94,9 @@ export declare const deploymentRequest: z.ZodObject<{
97
94
  decodedSize: z.ZodNumber;
98
95
  contentBase64Chunks: z.ZodArray<z.ZodString>;
99
96
  }, z.core.$strict>]>;
100
- }, z.core.$strict>, z.ZodObject<{
101
- contentBase64: z.ZodString;
102
- name: z.ZodString;
103
- kind: z.ZodOptional<z.ZodEnum<{
104
- data: "data";
105
- esm: "esm";
106
- text: "text";
107
- wasm: "wasm";
108
- }>>;
109
- }, z.core.$strict>, z.ZodObject<{
110
- contentBase64Chunks: z.ZodArray<z.ZodString>;
111
- name: z.ZodString;
112
- kind: z.ZodOptional<z.ZodEnum<{
113
- data: "data";
114
- esm: "esm";
115
- text: "text";
116
- wasm: "wasm";
117
- }>>;
118
- }, z.core.$strict>]>>;
97
+ }, z.core.$strict>>;
119
98
  assets: z.ZodOptional<z.ZodObject<{
120
- files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
99
+ files: z.ZodArray<z.ZodObject<{
121
100
  path: z.ZodString;
122
101
  contentType: z.ZodOptional<z.ZodString>;
123
102
  content: z.ZodUnion<readonly [z.ZodObject<{
@@ -135,15 +114,7 @@ export declare const deploymentRequest: z.ZodObject<{
135
114
  decodedSize: z.ZodNumber;
136
115
  contentBase64Chunks: z.ZodArray<z.ZodString>;
137
116
  }, z.core.$strict>]>;
138
- }, z.core.$strict>, z.ZodObject<{
139
- contentBase64: z.ZodString;
140
- path: z.ZodString;
141
- contentType: z.ZodOptional<z.ZodString>;
142
- }, z.core.$strict>, z.ZodObject<{
143
- contentBase64Chunks: z.ZodArray<z.ZodString>;
144
- path: z.ZodString;
145
- contentType: z.ZodOptional<z.ZodString>;
146
- }, z.core.$strict>]>>;
117
+ }, z.core.$strict>>;
147
118
  notFound: z.ZodOptional<z.ZodEnum<{
148
119
  "404-page": "404-page";
149
120
  none: "none";
@@ -154,6 +125,7 @@ export declare const deploymentRequest: z.ZodObject<{
154
125
  }, z.core.$strict>>;
155
126
  }, z.core.$strict>;
156
127
  secrets: z.ZodRecord<z.ZodString, z.ZodString>;
128
+ promote: z.ZodOptional<z.ZodBoolean>;
157
129
  readiness: z.ZodOptional<z.ZodObject<{
158
130
  paths: z.ZodArray<z.ZodString>;
159
131
  }, z.core.$strict>>;
@@ -1,24 +1,30 @@
1
1
  import { fullMatch } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
- import { artifactModule, assetBundle } from '../../service/index.js';
4
3
  import { deploymentCommit } from './deployment-record.js';
5
4
  import { frozenConfiguration } from './frozen-configuration.js';
5
+ import { artifactModule } from './service-deployment-artifact-module.js';
6
+ import { assetBundle } from './service-deployment-assets.js';
6
7
  const digest = z.string().check(fullMatch('sha256:[0-9a-f]{64}'));
7
8
  /**
8
- * `DeploymentRequestV1`: one release to host on the line of its origin and environment. Services
9
- * recomputes the build digest from the uploaded bytes and the label from the line, the build and
10
- * the configuration; the request states both so a deployer that computed another address is
11
- * refused rather than served elsewhere. The secrets are the environment's current values, bound to
12
- * the new deployment only.
9
+ * `DeploymentRequestV1`: one release to host as a deployment of the Service of its origin and
10
+ * environment. Services recomputes the build digest from the uploaded bytes and the label from the
11
+ * Service name, the build and the configuration; the request states both so a deployer that
12
+ * computed another address is refused rather than served elsewhere. The secrets are the
13
+ * environment's current values, bound to the new deployment only.
13
14
  */
14
15
  export const deploymentRequest = z.strictObject({
15
16
  format: z.literal('astrale.services.deployment-request'),
16
17
  version: z.literal(1),
17
- /** The Identity of the Admin instance the deploy acts for; the exact caller when absent. */
18
- organization: z.string().min(1).max(256).optional(),
18
+ /**
19
+ * The Identity that owns the Service when this deploy creates it: the caller, or an Identity the
20
+ * caller acts as through `extends_with`. The exact caller when absent; ignored for an existing
21
+ * Service, which keeps its owner.
22
+ */
23
+ owner: z.string().min(1).max(256).optional(),
19
24
  origin: z.string().min(1).max(253),
20
25
  environment: z.string().min(1).max(63),
21
- addressing: z.enum(['readable', 'opaque']),
26
+ /** Services are named by their fingerprint alone. */
27
+ addressing: z.literal('opaque'),
22
28
  label: z.string().min(1).max(63),
23
29
  buildDigest: digest,
24
30
  configuration: frozenConfiguration,
@@ -34,6 +40,8 @@ export const deploymentRequest = z.strictObject({
34
40
  assets: assetBundle.optional(),
35
41
  }),
36
42
  secrets: z.record(z.string().min(1).max(128), z.string().max(64 * 1024)),
43
+ /** Make the deployment the one the Service serves once it is active; `true` when absent. */
44
+ promote: z.boolean().optional(),
37
45
  readiness: z
38
46
  .strictObject({ paths: z.array(z.string().min(1).max(1_024)).min(1).max(8) })
39
47
  .optional(),