@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
@@ -2,6 +2,18 @@ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Me
2
2
  name?: string | undefined;
3
3
  entry?: string | undefined;
4
4
  modules?: ({
5
+ name: string;
6
+ kind?: "data" | "esm" | "text" | "wasm" | undefined;
7
+ content: {
8
+ encoding: "gzip" | "identity";
9
+ decodedSize: number;
10
+ contentBase64: string;
11
+ } | {
12
+ encoding: "gzip" | "identity";
13
+ decodedSize: number;
14
+ contentBase64Chunks: string[];
15
+ };
16
+ } | {
5
17
  contentBase64: string;
6
18
  name: string;
7
19
  kind?: "data" | "esm" | "text" | "wasm" | undefined;
@@ -15,6 +27,18 @@ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Me
15
27
  release: {
16
28
  entry: string;
17
29
  modules: ({
30
+ name: string;
31
+ kind?: "data" | "esm" | "text" | "wasm" | undefined;
32
+ content: {
33
+ encoding: "gzip" | "identity";
34
+ decodedSize: number;
35
+ contentBase64: string;
36
+ } | {
37
+ encoding: "gzip" | "identity";
38
+ decodedSize: number;
39
+ contentBase64Chunks: string[];
40
+ };
41
+ } | {
18
42
  contentBase64: string;
19
43
  name: string;
20
44
  kind?: "data" | "esm" | "text" | "wasm" | undefined;
@@ -39,6 +63,18 @@ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Me
39
63
  secrets?: Record<string, string> | undefined;
40
64
  assets?: {
41
65
  files: ({
66
+ path: string;
67
+ contentType?: string | undefined;
68
+ content: {
69
+ encoding: "gzip" | "identity";
70
+ decodedSize: number;
71
+ contentBase64: string;
72
+ } | {
73
+ encoding: "gzip" | "identity";
74
+ decodedSize: number;
75
+ contentBase64Chunks: string[];
76
+ };
77
+ } | {
42
78
  contentBase64: string;
43
79
  path: string;
44
80
  contentType?: string | undefined;
@@ -70,4 +106,4 @@ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Me
70
106
  reason: "artifact-mode-conflict" | "invalid-deployment" | "service-unavailable";
71
107
  message: string;
72
108
  };
73
- }, "authenticated", true, false>>;
109
+ }, "authenticated", true, false, undefined>>;
@@ -9,4 +9,4 @@ export declare const listServiceLogs: import("@astrale-os/sdk/schema").Method<im
9
9
  level: string;
10
10
  line: string;
11
11
  }[];
12
- }, "authorized", false, true>>;
12
+ }, "authorized", false, true, undefined>>;
@@ -1,4 +1,4 @@
1
1
  export declare const listServiceSchedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
2
  readonly mode: 'value';
3
3
  readonly value: string[];
4
- }, "authorized", false, true>>;
4
+ }, "authorized", false, true, undefined>>;
@@ -1,4 +1,4 @@
1
1
  export declare const listServiceSecretNames: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
2
  readonly mode: 'value';
3
3
  readonly value: string[];
4
- }, "authorized", false, true>>;
4
+ }, "authorized", false, true, undefined>>;
@@ -9,4 +9,4 @@ export declare const listWorkerLogs: import("@astrale-os/sdk/schema").Method<imp
9
9
  level: string;
10
10
  line: string;
11
11
  }[];
12
- }, "authorized", false, false>>;
12
+ }, "authorized", false, false, undefined>>;
@@ -1,4 +1,4 @@
1
1
  export declare const listWorkerSchedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
2
  readonly mode: 'value';
3
3
  readonly value: string[];
4
- }, "authorized", false, false>>;
4
+ }, "authorized", false, false, undefined>>;
@@ -1,4 +1,4 @@
1
1
  export declare const listWorkerSecretNames: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
2
  readonly mode: 'value';
3
3
  readonly value: string[];
4
- }, "authorized", false, false>>;
4
+ }, "authorized", false, false, undefined>>;
@@ -21,4 +21,4 @@ export declare const migrateWorkerIngress: import("@astrale-os/sdk/schema").Meth
21
21
  kind: "rejected";
22
22
  reason: "missing-location" | "not-detached" | "service-unavailable";
23
23
  };
24
- }, "authorized", false, false>>;
24
+ }, "authorized", false, false, undefined>>;
@@ -8,4 +8,4 @@ export declare const replaceServiceSchedules: import("@astrale-os/sdk/schema").M
8
8
  kind: "rejected";
9
9
  reason: "invalid-schedule" | "service-unavailable";
10
10
  };
11
- }, "authorized", false, true>>;
11
+ }, "authorized", false, true, undefined>>;
@@ -8,4 +8,4 @@ export declare const replaceWorkerSchedules: import("@astrale-os/sdk/schema").Me
8
8
  kind: "rejected";
9
9
  reason: "invalid-schedule" | "service-unavailable";
10
10
  };
11
- }, "authorized", false, false>>;
11
+ }, "authorized", false, false, undefined>>;
@@ -9,4 +9,4 @@ export declare const setServiceSecret: import("@astrale-os/sdk/schema").Method<i
9
9
  } | {
10
10
  name: string;
11
11
  };
12
- }, "authorized", false, true>>;
12
+ }, "authorized", false, true, undefined>>;
@@ -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
- }, "authorized", false, false>>;
12
+ }, "authorized", false, false, undefined>>;
@@ -3,5 +3,5 @@ export { deleteService, deleteServiceSecret, deployCloudflareWorker, listService
3
3
  export { OwnService, TraverseOwnedService } from './policies/index.js';
4
4
  export { serviceLifecycle } from './states/index.js';
5
5
  export type { ServiceLifecycle, ServiceLifecycleEvent } from './states/index.js';
6
- export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
7
- export type { ArtifactModule, AssetBundle, DeployServiceInput, DeployServiceOutput, ResourceLimits, } from './types/index.js';
6
+ export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, } from './types/index.js';
7
+ export type { ArtifactModule, AssetBundle, DeployServiceInput, DeployServiceOutput, ResourceLimits, ServiceDeploymentContent, } from './types/index.js';
@@ -2,4 +2,4 @@ export { CloudflareWorker, Service, service_owned_by } from './classes/index.js'
2
2
  export { deleteService, deleteServiceSecret, deployCloudflareWorker, listServiceLogs, listServiceSchedules, listServiceSecretNames, replaceServiceSchedules, setServiceSecret, } from './functions/index.js';
3
3
  export { OwnService, TraverseOwnedService } from './policies/index.js';
4
4
  export { serviceLifecycle } from './states/index.js';
5
- export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, } from './types/index.js';
5
+ export { artifact, artifactModule, assetBundle, assetFile, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, resourceLimits, revisionedDeployment, PORTABLE_BASE64_CHUNK_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, } from './types/index.js';
@@ -0,0 +1 @@
1
+ export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './limits.js';
@@ -0,0 +1 @@
1
+ export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './limits.js';
@@ -0,0 +1,7 @@
1
+ export declare const PORTABLE_BASE64_CHUNK_SIZE: number;
2
+ export declare const MAX_MODULE_BASE64_SIZE: number;
3
+ export declare const MAX_ASSET_BASE64_SIZE: number;
4
+ export declare const MAX_MODULE_DECODED_SIZE: number;
5
+ export declare const MAX_ASSET_DECODED_SIZE: number;
6
+ /** Bound retained deployment material independently of its compressed request size. */
7
+ export declare const MAX_DEPLOYMENT_DECODED_SIZE: number;
@@ -0,0 +1,7 @@
1
+ export const PORTABLE_BASE64_CHUNK_SIZE = 512 * 1024;
2
+ export const MAX_MODULE_BASE64_SIZE = 10 * 1024 * 1024;
3
+ export const MAX_ASSET_BASE64_SIZE = 16 * 1024 * 1024;
4
+ export const MAX_MODULE_DECODED_SIZE = (MAX_MODULE_BASE64_SIZE / 4) * 3;
5
+ export const MAX_ASSET_DECODED_SIZE = (MAX_ASSET_BASE64_SIZE / 4) * 3;
6
+ /** Bound retained deployment material independently of its compressed request size. */
7
+ export const MAX_DEPLOYMENT_DECODED_SIZE = 32 * 1024 * 1024;
@@ -2,6 +2,29 @@ import { z } from 'zod';
2
2
  export declare const artifact: z.ZodObject<{
3
3
  entry: z.ZodString;
4
4
  modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
5
+ name: z.ZodString;
6
+ kind: z.ZodOptional<z.ZodEnum<{
7
+ data: "data";
8
+ esm: "esm";
9
+ text: "text";
10
+ wasm: "wasm";
11
+ }>>;
12
+ content: z.ZodUnion<readonly [z.ZodObject<{
13
+ encoding: z.ZodEnum<{
14
+ gzip: "gzip";
15
+ identity: "identity";
16
+ }>;
17
+ decodedSize: z.ZodNumber;
18
+ contentBase64: z.ZodString;
19
+ }, z.core.$strict>, z.ZodObject<{
20
+ encoding: z.ZodEnum<{
21
+ gzip: "gzip";
22
+ identity: "identity";
23
+ }>;
24
+ decodedSize: z.ZodNumber;
25
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
26
+ }, z.core.$strict>]>;
27
+ }, z.core.$strict>, z.ZodObject<{
5
28
  contentBase64: z.ZodString;
6
29
  name: z.ZodString;
7
30
  kind: z.ZodOptional<z.ZodEnum<{
@@ -26,6 +49,29 @@ export declare const revisionedDeployment: z.ZodObject<{
26
49
  release: z.ZodObject<{
27
50
  entry: z.ZodString;
28
51
  modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
52
+ name: z.ZodString;
53
+ kind: z.ZodOptional<z.ZodEnum<{
54
+ data: "data";
55
+ esm: "esm";
56
+ text: "text";
57
+ wasm: "wasm";
58
+ }>>;
59
+ content: z.ZodUnion<readonly [z.ZodObject<{
60
+ encoding: z.ZodEnum<{
61
+ gzip: "gzip";
62
+ identity: "identity";
63
+ }>;
64
+ decodedSize: z.ZodNumber;
65
+ contentBase64: z.ZodString;
66
+ }, z.core.$strict>, z.ZodObject<{
67
+ encoding: z.ZodEnum<{
68
+ gzip: "gzip";
69
+ identity: "identity";
70
+ }>;
71
+ decodedSize: z.ZodNumber;
72
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
73
+ }, z.core.$strict>]>;
74
+ }, z.core.$strict>, z.ZodObject<{
29
75
  contentBase64: z.ZodString;
30
76
  name: z.ZodString;
31
77
  kind: z.ZodOptional<z.ZodEnum<{
@@ -54,6 +100,29 @@ export declare const deployServiceInput: z.ZodObject<{
54
100
  name: z.ZodOptional<z.ZodString>;
55
101
  entry: z.ZodOptional<z.ZodString>;
56
102
  modules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
103
+ name: z.ZodString;
104
+ kind: z.ZodOptional<z.ZodEnum<{
105
+ data: "data";
106
+ esm: "esm";
107
+ text: "text";
108
+ wasm: "wasm";
109
+ }>>;
110
+ content: z.ZodUnion<readonly [z.ZodObject<{
111
+ encoding: z.ZodEnum<{
112
+ gzip: "gzip";
113
+ identity: "identity";
114
+ }>;
115
+ decodedSize: z.ZodNumber;
116
+ contentBase64: z.ZodString;
117
+ }, z.core.$strict>, z.ZodObject<{
118
+ encoding: z.ZodEnum<{
119
+ gzip: "gzip";
120
+ identity: "identity";
121
+ }>;
122
+ decodedSize: z.ZodNumber;
123
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
124
+ }, z.core.$strict>]>;
125
+ }, z.core.$strict>, z.ZodObject<{
57
126
  contentBase64: z.ZodString;
58
127
  name: z.ZodString;
59
128
  kind: z.ZodOptional<z.ZodEnum<{
@@ -77,6 +146,29 @@ export declare const deployServiceInput: z.ZodObject<{
77
146
  release: z.ZodObject<{
78
147
  entry: z.ZodString;
79
148
  modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
149
+ name: z.ZodString;
150
+ kind: z.ZodOptional<z.ZodEnum<{
151
+ data: "data";
152
+ esm: "esm";
153
+ text: "text";
154
+ wasm: "wasm";
155
+ }>>;
156
+ content: z.ZodUnion<readonly [z.ZodObject<{
157
+ encoding: z.ZodEnum<{
158
+ gzip: "gzip";
159
+ identity: "identity";
160
+ }>;
161
+ decodedSize: z.ZodNumber;
162
+ contentBase64: z.ZodString;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ encoding: z.ZodEnum<{
165
+ gzip: "gzip";
166
+ identity: "identity";
167
+ }>;
168
+ decodedSize: z.ZodNumber;
169
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
170
+ }, z.core.$strict>]>;
171
+ }, z.core.$strict>, z.ZodObject<{
80
172
  contentBase64: z.ZodString;
81
173
  name: z.ZodString;
82
174
  kind: z.ZodOptional<z.ZodEnum<{
@@ -111,6 +203,24 @@ export declare const deployServiceInput: z.ZodObject<{
111
203
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
112
204
  assets: z.ZodOptional<z.ZodObject<{
113
205
  files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
206
+ path: z.ZodString;
207
+ contentType: z.ZodOptional<z.ZodString>;
208
+ content: z.ZodUnion<readonly [z.ZodObject<{
209
+ encoding: z.ZodEnum<{
210
+ gzip: "gzip";
211
+ identity: "identity";
212
+ }>;
213
+ decodedSize: z.ZodNumber;
214
+ contentBase64: z.ZodString;
215
+ }, z.core.$strict>, z.ZodObject<{
216
+ encoding: z.ZodEnum<{
217
+ gzip: "gzip";
218
+ identity: "identity";
219
+ }>;
220
+ decodedSize: z.ZodNumber;
221
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
222
+ }, z.core.$strict>]>;
223
+ }, z.core.$strict>, z.ZodObject<{
114
224
  contentBase64: z.ZodString;
115
225
  path: z.ZodString;
116
226
  contentType: z.ZodOptional<z.ZodString>;
@@ -4,10 +4,11 @@ export { artifactModule } from './service-deployment-artifact-module.js';
4
4
  export type { ArtifactModule } from './service-deployment-artifact-module.js';
5
5
  export { assetBundle, assetFile } from './service-deployment-assets.js';
6
6
  export type { AssetBundle } from './service-deployment-assets.js';
7
- export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
7
+ export { MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
8
8
  export { resourceLimits } from './service-deployment-resource-limits.js';
9
9
  export type { ResourceLimits } from './service-deployment-resource-limits.js';
10
10
  export { secretName } from './service-secret-name.js';
11
11
  export { secretOperationRejection } from './service-secret-operation-rejection.js';
12
12
  export { serviceReadiness } from './service-readiness.js';
13
13
  export { setServiceSecretContract, deleteServiceSecretContract, listServiceSecretNamesContract, replaceServiceSchedulesContract, listServiceSchedulesContract, listServiceLogsContract, deleteServiceContract, } from './service-management.js';
14
+ export type { ServiceDeploymentContent } from './service-deployment-content.js';
@@ -1,7 +1,7 @@
1
1
  export { artifact, deployedService, deploymentRejection, deployServiceInput, deployServiceOutput, revisionedDeployment, } from './deploy-cloudflare-worker.js';
2
2
  export { artifactModule } from './service-deployment-artifact-module.js';
3
3
  export { assetBundle, assetFile } from './service-deployment-assets.js';
4
- export { MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
4
+ export { MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_BASE64_SIZE, PORTABLE_BASE64_CHUNK_SIZE, } from './service-deployment-content.js';
5
5
  export { resourceLimits } from './service-deployment-resource-limits.js';
6
6
  export { secretName } from './service-secret-name.js';
7
7
  export { secretOperationRejection } from './service-secret-operation-rejection.js';
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { PORTABLE_BASE64_CHUNK_SIZE } from '../content/index.js';
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
+ */
11
+ export function legacyEncodedContent(maximumSize) {
12
+ return Object.freeze({
13
+ inline: { contentBase64: z.string().max(maximumSize).meta({ deprecated: true }) },
14
+ chunked: {
15
+ contentBase64Chunks: z
16
+ .array(z.string().min(1).max(PORTABLE_BASE64_CHUNK_SIZE))
17
+ .min(1)
18
+ .max(Math.ceil(maximumSize / PORTABLE_BASE64_CHUNK_SIZE))
19
+ .meta({ deprecated: true }),
20
+ },
21
+ });
22
+ }
@@ -1,5 +1,28 @@
1
1
  import { z } from 'zod';
2
2
  export declare const artifactModule: z.ZodUnion<readonly [z.ZodObject<{
3
+ name: z.ZodString;
4
+ kind: z.ZodOptional<z.ZodEnum<{
5
+ data: "data";
6
+ esm: "esm";
7
+ text: "text";
8
+ wasm: "wasm";
9
+ }>>;
10
+ content: z.ZodUnion<readonly [z.ZodObject<{
11
+ encoding: z.ZodEnum<{
12
+ gzip: "gzip";
13
+ identity: "identity";
14
+ }>;
15
+ decodedSize: z.ZodNumber;
16
+ contentBase64: z.ZodString;
17
+ }, z.core.$strict>, z.ZodObject<{
18
+ encoding: z.ZodEnum<{
19
+ gzip: "gzip";
20
+ identity: "identity";
21
+ }>;
22
+ decodedSize: z.ZodNumber;
23
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
24
+ }, z.core.$strict>]>;
25
+ }, z.core.$strict>, z.ZodObject<{
3
26
  contentBase64: z.ZodString;
4
27
  name: z.ZodString;
5
28
  kind: z.ZodOptional<z.ZodEnum<{
@@ -1,11 +1,13 @@
1
1
  import { z } from 'zod';
2
+ import { legacyEncodedContent } from './legacy/service-deployment-content.js';
2
3
  import { encodedContent, MAX_MODULE_BASE64_SIZE } from './service-deployment-content.js';
3
4
  const fields = {
4
5
  name: z.string().min(1).max(256),
5
6
  kind: z.enum(['esm', 'wasm', 'text', 'data']).optional(),
6
7
  };
7
- const content = encodedContent(MAX_MODULE_BASE64_SIZE);
8
+ const legacy = legacyEncodedContent(MAX_MODULE_BASE64_SIZE);
8
9
  export const artifactModule = z.union([
9
- z.strictObject({ ...fields, ...content.inline }),
10
- z.strictObject({ ...fields, ...content.chunked }),
10
+ z.strictObject({ ...fields, content: encodedContent(MAX_MODULE_BASE64_SIZE) }),
11
+ z.strictObject({ ...fields, ...legacy.inline }),
12
+ z.strictObject({ ...fields, ...legacy.chunked }),
11
13
  ]);
@@ -1,5 +1,23 @@
1
1
  import { z } from 'zod';
2
2
  export declare const assetFile: z.ZodUnion<readonly [z.ZodObject<{
3
+ path: z.ZodString;
4
+ contentType: z.ZodOptional<z.ZodString>;
5
+ content: z.ZodUnion<readonly [z.ZodObject<{
6
+ encoding: z.ZodEnum<{
7
+ gzip: "gzip";
8
+ identity: "identity";
9
+ }>;
10
+ decodedSize: z.ZodNumber;
11
+ contentBase64: z.ZodString;
12
+ }, z.core.$strict>, z.ZodObject<{
13
+ encoding: z.ZodEnum<{
14
+ gzip: "gzip";
15
+ identity: "identity";
16
+ }>;
17
+ decodedSize: z.ZodNumber;
18
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
19
+ }, z.core.$strict>]>;
20
+ }, z.core.$strict>, z.ZodObject<{
3
21
  contentBase64: z.ZodString;
4
22
  path: z.ZodString;
5
23
  contentType: z.ZodOptional<z.ZodString>;
@@ -10,6 +28,24 @@ export declare const assetFile: z.ZodUnion<readonly [z.ZodObject<{
10
28
  }, z.core.$strict>]>;
11
29
  export declare const assetBundle: z.ZodObject<{
12
30
  files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
31
+ path: z.ZodString;
32
+ contentType: z.ZodOptional<z.ZodString>;
33
+ content: z.ZodUnion<readonly [z.ZodObject<{
34
+ encoding: z.ZodEnum<{
35
+ gzip: "gzip";
36
+ identity: "identity";
37
+ }>;
38
+ decodedSize: z.ZodNumber;
39
+ contentBase64: z.ZodString;
40
+ }, z.core.$strict>, z.ZodObject<{
41
+ encoding: z.ZodEnum<{
42
+ gzip: "gzip";
43
+ identity: "identity";
44
+ }>;
45
+ decodedSize: z.ZodNumber;
46
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
47
+ }, z.core.$strict>]>;
48
+ }, z.core.$strict>, z.ZodObject<{
13
49
  contentBase64: z.ZodString;
14
50
  path: z.ZodString;
15
51
  contentType: z.ZodOptional<z.ZodString>;
@@ -1,13 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { legacyEncodedContent } from './legacy/service-deployment-content.js';
2
3
  import { encodedContent, MAX_ASSET_BASE64_SIZE } from './service-deployment-content.js';
3
4
  const fields = {
4
5
  path: z.string().min(1).max(2_048),
5
6
  contentType: z.string().min(1).max(256).optional(),
6
7
  };
7
- const content = encodedContent(MAX_ASSET_BASE64_SIZE);
8
+ const legacy = legacyEncodedContent(MAX_ASSET_BASE64_SIZE);
8
9
  export const assetFile = z.union([
9
- z.strictObject({ ...fields, ...content.inline }),
10
- z.strictObject({ ...fields, ...content.chunked }),
10
+ z.strictObject({ ...fields, content: encodedContent(MAX_ASSET_BASE64_SIZE) }),
11
+ z.strictObject({ ...fields, ...legacy.inline }),
12
+ z.strictObject({ ...fields, ...legacy.chunked }),
11
13
  ]);
12
14
  export const assetBundle = z.strictObject({
13
15
  files: z.array(assetFile).min(1).max(2_000),
@@ -1,12 +1,19 @@
1
1
  import { z } from 'zod';
2
- export declare const PORTABLE_BASE64_CHUNK_SIZE: number;
3
- export declare const MAX_MODULE_BASE64_SIZE: number;
4
- export declare const MAX_ASSET_BASE64_SIZE: number;
5
- export declare function encodedContent(maximumSize: number): Readonly<{
6
- inline: {
7
- contentBase64: z.ZodString;
8
- };
9
- chunked: {
10
- contentBase64Chunks: z.ZodArray<z.ZodString>;
11
- };
12
- }>;
2
+ export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './content/index.js';
3
+ /** Encoding is transport evidence; release identity always describes decoded bytes. */
4
+ export declare function encodedContent(maximumSize: number): z.ZodUnion<readonly [z.ZodObject<{
5
+ encoding: z.ZodEnum<{
6
+ gzip: "gzip";
7
+ identity: "identity";
8
+ }>;
9
+ decodedSize: z.ZodNumber;
10
+ contentBase64: z.ZodString;
11
+ }, z.core.$strict>, z.ZodObject<{
12
+ encoding: z.ZodEnum<{
13
+ gzip: "gzip";
14
+ identity: "identity";
15
+ }>;
16
+ decodedSize: z.ZodNumber;
17
+ contentBase64Chunks: z.ZodArray<z.ZodString>;
18
+ }, z.core.$strict>]>;
19
+ export type ServiceDeploymentContent = z.infer<ReturnType<typeof encodedContent>>;
@@ -1,15 +1,24 @@
1
1
  import { z } from 'zod';
2
- export const PORTABLE_BASE64_CHUNK_SIZE = 512 * 1024;
3
- export const MAX_MODULE_BASE64_SIZE = 10 * 1024 * 1024;
4
- export const MAX_ASSET_BASE64_SIZE = 16 * 1024 * 1024;
2
+ import { PORTABLE_BASE64_CHUNK_SIZE } from './content/index.js';
3
+ export { PORTABLE_BASE64_CHUNK_SIZE, MAX_MODULE_BASE64_SIZE, MAX_ASSET_BASE64_SIZE, MAX_MODULE_DECODED_SIZE, MAX_ASSET_DECODED_SIZE, MAX_DEPLOYMENT_DECODED_SIZE, } from './content/index.js';
4
+ /** Encoding is transport evidence; release identity always describes decoded bytes. */
5
5
  export function encodedContent(maximumSize) {
6
- return Object.freeze({
7
- inline: { contentBase64: z.string().max(maximumSize) },
8
- chunked: {
6
+ const fields = {
7
+ encoding: z.enum(['identity', 'gzip']),
8
+ decodedSize: z
9
+ .number()
10
+ .int()
11
+ .min(0)
12
+ .max((maximumSize / 4) * 3),
13
+ };
14
+ return z.union([
15
+ z.strictObject({ ...fields, contentBase64: z.string().max(maximumSize) }),
16
+ z.strictObject({
17
+ ...fields,
9
18
  contentBase64Chunks: z
10
19
  .array(z.string().min(1).max(PORTABLE_BASE64_CHUNK_SIZE))
11
20
  .min(1)
12
21
  .max(Math.ceil(maximumSize / PORTABLE_BASE64_CHUNK_SIZE)),
13
- },
14
- });
22
+ }),
23
+ ]);
15
24
  }