@astrale-domains/services 0.4.6 → 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 (76) hide show
  1. package/README.md +163 -6
  2. package/dist/schema/index.d.ts +2 -2
  3. package/dist/schema/index.js +1 -1
  4. package/dist/schema/modules/deployment/classes/cloudflare-deployment.d.ts +366 -0
  5. package/dist/schema/modules/deployment/classes/cloudflare-deployment.js +20 -0
  6. package/dist/schema/modules/deployment/classes/deployment.d.ts +93 -2
  7. package/dist/schema/modules/deployment/classes/deployment.js +27 -3
  8. package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.d.ts +7 -0
  9. package/dist/schema/modules/deployment/errors/deployment-hosting-unavailable.js +8 -0
  10. package/dist/schema/modules/deployment/errors/deployment-label-not-found.d.ts +12 -0
  11. package/dist/schema/modules/deployment/errors/deployment-label-not-found.js +11 -0
  12. package/dist/schema/modules/deployment/errors/deployment-not-found.d.ts +10 -0
  13. package/dist/schema/modules/deployment/errors/deployment-not-found.js +11 -0
  14. package/dist/schema/modules/deployment/errors/deployment-registry-only.d.ts +11 -0
  15. package/dist/schema/modules/deployment/errors/deployment-registry-only.js +12 -0
  16. package/dist/schema/modules/deployment/errors/index.d.ts +4 -0
  17. package/dist/schema/modules/deployment/errors/index.js +4 -0
  18. package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.d.ts +170 -0
  19. package/dist/schema/modules/deployment/functions/deploy-cloudflare-deployment.js +14 -0
  20. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.d.ts +8 -0
  21. package/dist/schema/modules/deployment/functions/describe-deployment-hosting.js +11 -0
  22. package/dist/schema/modules/deployment/functions/expire-deployment-previews.d.ts +16 -0
  23. package/dist/schema/modules/deployment/functions/expire-deployment-previews.js +14 -0
  24. package/dist/schema/modules/deployment/functions/index.d.ts +11 -0
  25. package/dist/schema/modules/deployment/functions/index.js +11 -0
  26. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.d.ts +5 -0
  27. package/dist/schema/modules/deployment/functions/list-cloudflare-deployment-secret-names.js +4 -0
  28. package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.d.ts +58 -0
  29. package/dist/schema/modules/deployment/functions/list-cloudflare-deployments.js +10 -0
  30. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.d.ts +4 -0
  31. package/dist/schema/modules/deployment/functions/list-deployment-secret-names.js +6 -0
  32. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.d.ts +10 -0
  33. package/dist/schema/modules/deployment/functions/read-deployment-last-calls.js +13 -0
  34. package/dist/schema/modules/deployment/functions/retain-deployment.d.ts +12 -0
  35. package/dist/schema/modules/deployment/functions/retain-deployment.js +13 -0
  36. package/dist/schema/modules/deployment/functions/retire-deployment.d.ts +23 -0
  37. package/dist/schema/modules/deployment/functions/retire-deployment.js +17 -0
  38. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.d.ts +18 -0
  39. package/dist/schema/modules/deployment/functions/set-cloudflare-deployment-secret.js +7 -0
  40. package/dist/schema/modules/deployment/functions/set-deployment-secret.d.ts +14 -0
  41. package/dist/schema/modules/deployment/functions/set-deployment-secret.js +3 -0
  42. package/dist/schema/modules/deployment/index.d.ts +5 -3
  43. package/dist/schema/modules/deployment/index.js +4 -2
  44. package/dist/schema/modules/deployment/policies/act-for-organization.d.ts +6 -0
  45. package/dist/schema/modules/deployment/policies/act-for-organization.js +10 -0
  46. package/dist/schema/modules/deployment/policies/index.d.ts +1 -0
  47. package/dist/schema/modules/deployment/policies/index.js +1 -0
  48. package/dist/schema/modules/deployment/states/deployment-lifecycle.d.ts +6 -3
  49. package/dist/schema/modules/deployment/states/deployment-lifecycle.js +6 -4
  50. package/dist/schema/modules/deployment/types/deployment-hosting.d.ts +94 -0
  51. package/dist/schema/modules/deployment/types/deployment-hosting.js +19 -0
  52. package/dist/schema/modules/deployment/types/deployment-request.d.ts +161 -0
  53. package/dist/schema/modules/deployment/types/deployment-request.js +40 -0
  54. package/dist/schema/modules/deployment/types/deployment-response.d.ts +109 -0
  55. package/dist/schema/modules/deployment/types/deployment-response.js +36 -0
  56. package/dist/schema/modules/deployment/types/deployment-retention.d.ts +37 -1
  57. package/dist/schema/modules/deployment/types/deployment-retention.js +41 -1
  58. package/dist/schema/modules/deployment/types/deployment-retire.d.ts +30 -0
  59. package/dist/schema/modules/deployment/types/deployment-retire.js +18 -0
  60. package/dist/schema/modules/deployment/types/deployment-secret-digest.d.ts +17 -0
  61. package/dist/schema/modules/deployment/types/deployment-secret-digest.js +14 -0
  62. package/dist/schema/modules/deployment/types/deployment-secret.d.ts +59 -0
  63. package/dist/schema/modules/deployment/types/deployment-secret.js +52 -0
  64. package/dist/schema/modules/deployment/types/deployment-summary.d.ts +165 -0
  65. package/dist/schema/modules/deployment/types/deployment-summary.js +38 -0
  66. package/dist/schema/modules/deployment/types/frozen-configuration.d.ts +52 -0
  67. package/dist/schema/modules/deployment/types/frozen-configuration.js +55 -0
  68. package/dist/schema/modules/deployment/types/index.d.ts +18 -2
  69. package/dist/schema/modules/deployment/types/index.js +9 -1
  70. package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +4 -4
  71. package/dist/schema/modules/service/classes/service.d.ts +2 -2
  72. package/dist/schema/modules/service/functions/set-worker-secret.d.ts +2 -2
  73. package/dist/schema/modules/service/types/legacy/service-deployment-content.js +8 -1
  74. package/dist/schema/schema.d.ts +456 -12
  75. package/dist/schema/schema.js +2 -1
  76. package/package.json +10 -5
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The `FrozenConfigurationV1` (`@astrale-os/sdk/deployment/address`) one deployment freezes beside
4
+ * its build: the author's plain variables, the execution settings and the durable Workflow options
5
+ * it declares, the runtime, the services and dispatch namespaces it binds and the names of the
6
+ * secrets it binds, never their values. Its digest and the build digest make the deployment's
7
+ * address. This shape only bounds what a request and the graph carry; the SDK's
8
+ * `configurationDigest` admits its canonical form, and a hosted deployment's admission decides
9
+ * which bindings Services hosts (`acceptDeploymentRequest`).
10
+ */
11
+ export declare const frozenConfiguration: z.ZodObject<{
12
+ format: z.ZodLiteral<"astrale.deployment.configuration">;
13
+ version: z.ZodLiteral<1>;
14
+ vars: z.ZodRecord<z.ZodString, z.ZodString>;
15
+ settings: z.ZodObject<{
16
+ maximumRequestBytes: z.ZodNumber;
17
+ invocationTimeoutMs: z.ZodNumber;
18
+ tokenExchange: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
19
+ maximumLifetimeSeconds: z.ZodNumber;
20
+ }, z.core.$strict>]>;
21
+ durableOptions: z.ZodOptional<z.ZodObject<{
22
+ retentionMs: z.ZodOptional<z.ZodNumber>;
23
+ retry: z.ZodOptional<z.ZodObject<{
24
+ initialIntervalMs: z.ZodOptional<z.ZodNumber>;
25
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
26
+ maxIntervalMs: z.ZodOptional<z.ZodNumber>;
27
+ }, z.core.$strict>>;
28
+ stepTimeoutMs: z.ZodOptional<z.ZodNumber>;
29
+ }, z.core.$strict>>;
30
+ }, z.core.$strict>;
31
+ runtime: z.ZodObject<{
32
+ compatibilityDate: z.ZodString;
33
+ compatibilityFlags: z.ZodArray<z.ZodString>;
34
+ }, z.core.$strict>;
35
+ bindings: z.ZodObject<{
36
+ services: z.ZodArray<z.ZodObject<{
37
+ name: z.ZodString;
38
+ service: z.ZodString;
39
+ }, z.core.$strict>>;
40
+ dispatchNamespaces: z.ZodArray<z.ZodObject<{
41
+ name: z.ZodString;
42
+ namespace: z.ZodString;
43
+ }, z.core.$strict>>;
44
+ secrets: z.ZodArray<z.ZodString>;
45
+ }, z.core.$strict>;
46
+ router: z.ZodUnion<readonly [z.ZodLiteral<false>, z.ZodObject<{
47
+ service: z.ZodString;
48
+ hostSuffix: z.ZodString;
49
+ minLabels: z.ZodNumber;
50
+ }, z.core.$strict>]>;
51
+ }, z.core.$strict>;
52
+ export type FrozenConfiguration = z.output<typeof frozenConfiguration>;
@@ -0,0 +1,55 @@
1
+ import { z } from 'zod';
2
+ const name = z.string().min(1).max(128);
3
+ const positive = z.number().int().min(1);
4
+ /**
5
+ * The `FrozenConfigurationV1` (`@astrale-os/sdk/deployment/address`) one deployment freezes beside
6
+ * its build: the author's plain variables, the execution settings and the durable Workflow options
7
+ * it declares, the runtime, the services and dispatch namespaces it binds and the names of the
8
+ * secrets it binds, never their values. Its digest and the build digest make the deployment's
9
+ * address. This shape only bounds what a request and the graph carry; the SDK's
10
+ * `configurationDigest` admits its canonical form, and a hosted deployment's admission decides
11
+ * which bindings Services hosts (`acceptDeploymentRequest`).
12
+ */
13
+ export const frozenConfiguration = z.strictObject({
14
+ format: z.literal('astrale.deployment.configuration'),
15
+ version: z.literal(1),
16
+ vars: z.record(name, z.string().max(64 * 1024)),
17
+ settings: z.strictObject({
18
+ maximumRequestBytes: z.number().int().min(1),
19
+ invocationTimeoutMs: z.number().int().min(1),
20
+ tokenExchange: z.union([
21
+ z.literal(false),
22
+ z.strictObject({ maximumLifetimeSeconds: z.number().int().min(1) }),
23
+ ]),
24
+ durableOptions: z
25
+ .strictObject({
26
+ retentionMs: positive.optional(),
27
+ retry: z
28
+ .strictObject({
29
+ initialIntervalMs: positive.optional(),
30
+ maxAttempts: positive.optional(),
31
+ maxIntervalMs: positive.optional(),
32
+ })
33
+ .optional(),
34
+ stepTimeoutMs: positive.optional(),
35
+ })
36
+ .optional(),
37
+ }),
38
+ runtime: z.strictObject({
39
+ compatibilityDate: z.string().min(1).max(32),
40
+ compatibilityFlags: z.array(name).max(64),
41
+ }),
42
+ bindings: z.strictObject({
43
+ services: z.array(z.strictObject({ name, service: name })).max(32),
44
+ dispatchNamespaces: z.array(z.strictObject({ name, namespace: name })).max(32),
45
+ secrets: z.array(name).max(64),
46
+ }),
47
+ router: z.union([
48
+ z.literal(false),
49
+ z.strictObject({
50
+ service: name,
51
+ hostSuffix: z.string().max(253),
52
+ minLabels: z.number().int().min(0).max(127),
53
+ }),
54
+ ]),
55
+ });
@@ -1,4 +1,20 @@
1
+ export { deploymentHosting, listDeploymentsInput, listDeploymentsOutput, } from './deployment-hosting.js';
2
+ export type { DeploymentHosting } from './deployment-hosting.js';
1
3
  export { deploymentCommit, deploymentRecord } from './deployment-record.js';
2
4
  export type { DeploymentRecord } from './deployment-record.js';
3
- export { deploymentRetention, deploymentRetirement } from './deployment-retention.js';
4
- export type { DeploymentRetention, DeploymentRetirement } from './deployment-retention.js';
5
+ export { deploymentRequest } from './deployment-request.js';
6
+ export type { DeploymentRequest } from './deployment-request.js';
7
+ export { deploymentRejection, deploymentRejectionReason, deploymentResponse, } from './deployment-response.js';
8
+ export type { DeploymentRejection, DeploymentRejectionReason, DeploymentResponse, } from './deployment-response.js';
9
+ export { deploymentLabel, deploymentRetention, deploymentRetirement, expirePreviewsInput, expirePreviewsOutput, lastCallsInput, lastCallsOutput, MAXIMUM_LAST_CALL_LABELS, MAXIMUM_PREVIEW_EXPIRY_WRITES, retainInput, retainOutput, } from './deployment-retention.js';
10
+ export type { DeploymentRetention, DeploymentRetirement, ExpirePreviewsResult, } from './deployment-retention.js';
11
+ export { retireDeploymentInput, retireDeploymentOutput } from './deployment-retire.js';
12
+ export type { RetireDeploymentResult } from './deployment-retire.js';
13
+ export { deploymentSecretRejection, listDeploymentSecretNamesContract, setDeploymentSecretContract, } from './deployment-secret.js';
14
+ export type { DeploymentSecretRejection } from './deployment-secret.js';
15
+ export { deploymentSecretDigest, deploymentSecretDigests } from './deployment-secret-digest.js';
16
+ export type { DeploymentSecretDigest } from './deployment-secret-digest.js';
17
+ export { deploymentSummary, listedDeploymentSummary, unadmittedDeploymentSummary, } from './deployment-summary.js';
18
+ export type { DeploymentSummary, ListedDeploymentSummary, UnadmittedDeploymentSummary, } from './deployment-summary.js';
19
+ export { frozenConfiguration } from './frozen-configuration.js';
20
+ export type { FrozenConfiguration } from './frozen-configuration.js';
@@ -1,2 +1,10 @@
1
+ export { deploymentHosting, listDeploymentsInput, listDeploymentsOutput, } from './deployment-hosting.js';
1
2
  export { deploymentCommit, deploymentRecord } from './deployment-record.js';
2
- export { deploymentRetention, deploymentRetirement } from './deployment-retention.js';
3
+ export { deploymentRequest } from './deployment-request.js';
4
+ export { deploymentRejection, deploymentRejectionReason, deploymentResponse, } from './deployment-response.js';
5
+ export { deploymentLabel, deploymentRetention, deploymentRetirement, expirePreviewsInput, expirePreviewsOutput, lastCallsInput, lastCallsOutput, MAXIMUM_LAST_CALL_LABELS, MAXIMUM_PREVIEW_EXPIRY_WRITES, retainInput, retainOutput, } from './deployment-retention.js';
6
+ export { retireDeploymentInput, retireDeploymentOutput } from './deployment-retire.js';
7
+ export { deploymentSecretRejection, listDeploymentSecretNamesContract, setDeploymentSecretContract, } from './deployment-secret.js';
8
+ export { deploymentSecretDigest, deploymentSecretDigests } from './deployment-secret-digest.js';
9
+ export { deploymentSummary, listedDeploymentSummary, unadmittedDeploymentSummary, } from './deployment-summary.js';
10
+ export { frozenConfiguration } from './frozen-configuration.js';
@@ -61,10 +61,10 @@ export declare const CloudflareWorker: import("@astrale-os/sdk/schema").Authored
61
61
  }, {
62
62
  readonly mode: 'value';
63
63
  readonly value: {
64
+ name: string;
65
+ } | {
64
66
  kind: "rejected";
65
67
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
66
- } | {
67
- name: string;
68
68
  };
69
69
  }, "authorized", false, true, undefined>>;
70
70
  deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -288,10 +288,10 @@ export declare const CloudflareWorker: import("@astrale-os/sdk/schema").Authored
288
288
  }, {
289
289
  readonly mode: 'value';
290
290
  readonly value: {
291
+ name: string;
292
+ } | {
291
293
  kind: "rejected";
292
294
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
293
- } | {
294
- name: string;
295
295
  };
296
296
  }, "authorized", false, false, undefined>>;
297
297
  deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -59,10 +59,10 @@ export declare const Service: import("@astrale-os/sdk/schema").AuthoredNodeClass
59
59
  }, {
60
60
  readonly mode: 'value';
61
61
  readonly value: {
62
- name: string;
63
- } | {
64
62
  kind: "rejected";
65
63
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
64
+ } | {
65
+ name: string;
66
66
  };
67
67
  }, "authorized", false, true, undefined>>;
68
68
  deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -4,9 +4,9 @@ export declare const setWorkerSecret: import("@astrale-os/sdk/schema").Method<im
4
4
  }, {
5
5
  readonly mode: 'value';
6
6
  readonly value: {
7
- name: string;
8
- } | {
9
7
  kind: "rejected";
10
8
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
9
+ } | {
10
+ name: string;
11
11
  };
12
12
  }, "authorized", false, false, undefined>>;
@@ -1,6 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  import { PORTABLE_BASE64_CHUNK_SIZE } from '../content/index.js';
3
- /** @deprecated Send the content envelope instead. Retained for deployed SDK clients. */
3
+ /**
4
+ * Flat portable Base64 module and asset content, the form adapter-astrale ≤ 0.5.0-beta.157 sends.
5
+ * The `DeploymentContent` envelope (`identity` or `gzip`) is the canonical form; every deploy
6
+ * request, the Admin-hosted `CloudflareDeployment.deploy` included, decodes both to the same bytes
7
+ * (AM-176). Remove when no supported adapter-astrale is older than 0.5.0-beta.158.
8
+ *
9
+ * @deprecated Send the content envelope instead.
10
+ */
4
11
  export function legacyEncodedContent(maximumSize) {
5
12
  return Object.freeze({
6
13
  inline: { contentBase64: z.string().max(maximumSize).meta({ deprecated: true }) },