@astrale-domains/services 0.2.4 → 0.2.5

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 (54) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +8 -7
  3. package/dist/schema/index.d.ts +2 -2
  4. package/dist/schema/index.js +2 -2
  5. package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +2412 -4251
  6. package/dist/schema/modules/service/classes/cloudflare-worker.js +1 -1
  7. package/dist/schema/modules/service/classes/service-owned-by.d.ts +4 -4
  8. package/dist/schema/modules/service/classes/service-owned-by.js +2 -2
  9. package/dist/schema/modules/service/classes/service.d.ts +56 -35
  10. package/dist/schema/modules/service/classes/service.js +12 -21
  11. package/dist/schema/modules/service/functions/delete-service-secret.d.ts +3 -3
  12. package/dist/schema/modules/service/functions/delete-service-secret.js +3 -1
  13. package/dist/schema/modules/service/functions/delete-service.d.ts +1 -1
  14. package/dist/schema/modules/service/functions/delete-service.js +3 -1
  15. package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +161 -14
  16. package/dist/schema/modules/service/functions/deploy-cloudflare-worker.js +47 -2
  17. package/dist/schema/modules/service/functions/index.d.ts +2 -1
  18. package/dist/schema/modules/service/functions/index.js +1 -1
  19. package/dist/schema/modules/service/functions/list-service-logs.d.ts +1 -1
  20. package/dist/schema/modules/service/functions/list-service-logs.js +3 -1
  21. package/dist/schema/modules/service/functions/list-service-schedules.d.ts +1 -1
  22. package/dist/schema/modules/service/functions/list-service-schedules.js +3 -1
  23. package/dist/schema/modules/service/functions/list-service-secret-names.d.ts +1 -1
  24. package/dist/schema/modules/service/functions/list-service-secret-names.js +3 -1
  25. package/dist/schema/modules/service/functions/replace-service-schedules.d.ts +1 -1
  26. package/dist/schema/modules/service/functions/replace-service-schedules.js +3 -1
  27. package/dist/schema/modules/service/functions/set-service-secret.d.ts +1 -1
  28. package/dist/schema/modules/service/functions/set-service-secret.js +3 -1
  29. package/dist/schema/modules/service/index.d.ts +7 -4
  30. package/dist/schema/modules/service/index.js +4 -3
  31. package/dist/schema/modules/service/policies/index.d.ts +1 -1
  32. package/dist/schema/modules/service/policies/index.js +1 -1
  33. package/dist/schema/modules/service/policies/own-service.d.ts +2 -0
  34. package/dist/schema/modules/service/policies/own-service.js +7 -0
  35. package/dist/schema/modules/service/policies/traverse-owned-service.js +2 -2
  36. package/dist/schema/modules/service/states/index.d.ts +2 -0
  37. package/dist/schema/modules/service/states/index.js +1 -0
  38. package/dist/schema/modules/service/states/service-lifecycle.d.ts +25 -0
  39. package/dist/schema/modules/service/states/service-lifecycle.js +26 -0
  40. package/dist/schema/modules/service/types/index.d.ts +0 -7
  41. package/dist/schema/modules/service/types/index.js +0 -4
  42. package/dist/schema/schema.d.ts +1950 -3768
  43. package/dist/schema/schema.js +2 -2
  44. package/package.json +3 -3
  45. package/dist/schema/modules/service/policies/observe-service.d.ts +0 -2
  46. package/dist/schema/modules/service/policies/observe-service.js +0 -7
  47. package/dist/schema/modules/service/types/deploy-service-input.d.ts +0 -130
  48. package/dist/schema/modules/service/types/deploy-service-input.js +0 -40
  49. package/dist/schema/modules/service/types/deploy-service-output.d.ts +0 -74
  50. package/dist/schema/modules/service/types/deploy-service-output.js +0 -24
  51. package/dist/schema/modules/service/types/service-deployment-rejection.d.ts +0 -11
  52. package/dist/schema/modules/service/types/service-deployment-rejection.js +0 -6
  53. package/dist/schema/modules/service/types/service-lifecycle.d.ts +0 -8
  54. package/dist/schema/modules/service/types/service-lifecycle.js +0 -2
@@ -1,5 +1,5 @@
1
1
  import { KernelSchema, defineSchema, view } from '@astrale-os/sdk/schema';
2
- import { CloudflareWorker, ObserveService, Service, TraverseOwnedService, service_owned_by, } from './modules/service/index.js';
2
+ import { CloudflareWorker, OwnService, Service, TraverseOwnedService, service_owned_by, } from './modules/service/index.js';
3
3
  export const schema = defineSchema('services.astrale.ai', {
4
4
  dependencies: { kernel: KernelSchema },
5
5
  classes: {
@@ -8,7 +8,7 @@ export const schema = defineSchema('services.astrale.ai', {
8
8
  service_owned_by,
9
9
  },
10
10
  policies: {
11
- ObserveService,
11
+ OwnService,
12
12
  TraverseOwnedService,
13
13
  },
14
14
  views: { application: view({}), service: view({ target: CloudflareWorker }) },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-domains/services",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/astrale-os/domains.git",
@@ -28,11 +28,11 @@
28
28
  "registry": "https://registry.npmjs.org/"
29
29
  },
30
30
  "dependencies": {
31
- "@astrale-os/sdk": "0.5.0-beta.79",
31
+ "@astrale-os/sdk": "0.5.0-beta.82",
32
32
  "zod": "^4.4.3"
33
33
  },
34
34
  "devDependencies": {
35
- "@astrale-os/adapter-cloudflare": "0.5.0-beta.82",
35
+ "@astrale-os/adapter-cloudflare": "0.5.0-beta.85",
36
36
  "@astrale-os/ox": ">=0.1.4 <1.0.0",
37
37
  "@astrale-os/shell": "0.4.2-beta.8",
38
38
  "@astrale-os/shell-react": "0.3.2-beta.5",
@@ -1,2 +0,0 @@
1
- /** A Service is visible only to the Identity that owns its provider effects. */
2
- export declare const ObserveService: import("@astrale-os/sdk/schema").Policy;
@@ -1,7 +0,0 @@
1
- import { policy } from '@astrale-os/sdk/schema';
2
- import { service_owned_by } from '../classes/service-owned-by.js';
3
- /** A Service is visible only to the Identity that owns its provider effects. */
4
- export const ObserveService = policy({
5
- description: 'The subject owns this Service.',
6
- match: ({ edge, object, subject }) => edge({ source: subject, class: () => service_owned_by, target: object }),
7
- });
@@ -1,130 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const artifact: z.ZodObject<{
3
- entry: z.ZodString;
4
- modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
5
- contentBase64: z.ZodString;
6
- name: z.ZodString;
7
- kind: z.ZodOptional<z.ZodEnum<{
8
- data: "data";
9
- esm: "esm";
10
- text: "text";
11
- wasm: "wasm";
12
- }>>;
13
- }, z.core.$strict>, z.ZodObject<{
14
- contentBase64Chunks: z.ZodArray<z.ZodString>;
15
- name: z.ZodString;
16
- kind: z.ZodOptional<z.ZodEnum<{
17
- data: "data";
18
- esm: "esm";
19
- text: "text";
20
- wasm: "wasm";
21
- }>>;
22
- }, z.core.$strict>]>>;
23
- }, z.core.$strict>;
24
- export declare const revisionedDeployment: z.ZodObject<{
25
- revision: z.ZodString;
26
- requiredSecrets: z.ZodArray<z.ZodString>;
27
- release: z.ZodObject<{
28
- entry: z.ZodString;
29
- modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
30
- contentBase64: z.ZodString;
31
- name: z.ZodString;
32
- kind: z.ZodOptional<z.ZodEnum<{
33
- data: "data";
34
- esm: "esm";
35
- text: "text";
36
- wasm: "wasm";
37
- }>>;
38
- }, z.core.$strict>, z.ZodObject<{
39
- contentBase64Chunks: z.ZodArray<z.ZodString>;
40
- name: z.ZodString;
41
- kind: z.ZodOptional<z.ZodEnum<{
42
- data: "data";
43
- esm: "esm";
44
- text: "text";
45
- wasm: "wasm";
46
- }>>;
47
- }, z.core.$strict>]>>;
48
- }, z.core.$strict>;
49
- }, z.core.$strict>;
50
- export declare const deployServiceInput: z.ZodObject<{
51
- name: z.ZodOptional<z.ZodString>;
52
- entry: z.ZodOptional<z.ZodString>;
53
- modules: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
54
- contentBase64: z.ZodString;
55
- name: z.ZodString;
56
- kind: z.ZodOptional<z.ZodEnum<{
57
- data: "data";
58
- esm: "esm";
59
- text: "text";
60
- wasm: "wasm";
61
- }>>;
62
- }, z.core.$strict>, z.ZodObject<{
63
- contentBase64Chunks: z.ZodArray<z.ZodString>;
64
- name: z.ZodString;
65
- kind: z.ZodOptional<z.ZodEnum<{
66
- data: "data";
67
- esm: "esm";
68
- text: "text";
69
- wasm: "wasm";
70
- }>>;
71
- }, z.core.$strict>]>>>;
72
- revisioned: z.ZodOptional<z.ZodObject<{
73
- revision: z.ZodString;
74
- requiredSecrets: z.ZodArray<z.ZodString>;
75
- release: z.ZodObject<{
76
- entry: z.ZodString;
77
- modules: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
78
- contentBase64: z.ZodString;
79
- name: z.ZodString;
80
- kind: z.ZodOptional<z.ZodEnum<{
81
- data: "data";
82
- esm: "esm";
83
- text: "text";
84
- wasm: "wasm";
85
- }>>;
86
- }, z.core.$strict>, z.ZodObject<{
87
- contentBase64Chunks: z.ZodArray<z.ZodString>;
88
- name: z.ZodString;
89
- kind: z.ZodOptional<z.ZodEnum<{
90
- data: "data";
91
- esm: "esm";
92
- text: "text";
93
- wasm: "wasm";
94
- }>>;
95
- }, z.core.$strict>]>>;
96
- }, z.core.$strict>;
97
- }, z.core.$strict>>;
98
- compatibilityDate: z.ZodOptional<z.ZodString>;
99
- compatibilityFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
100
- serviceBindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
101
- name: z.ZodString;
102
- service: z.ZodString;
103
- }, z.core.$strict>>>;
104
- vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
105
- secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
106
- assets: z.ZodOptional<z.ZodObject<{
107
- files: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
108
- contentBase64: z.ZodString;
109
- path: z.ZodString;
110
- contentType: z.ZodOptional<z.ZodString>;
111
- }, z.core.$strict>, z.ZodObject<{
112
- contentBase64Chunks: z.ZodArray<z.ZodString>;
113
- path: z.ZodString;
114
- contentType: z.ZodOptional<z.ZodString>;
115
- }, z.core.$strict>]>>;
116
- notFound: z.ZodOptional<z.ZodEnum<{
117
- "404-page": "404-page";
118
- none: "none";
119
- "single-page-application": "single-page-application";
120
- }>>;
121
- runWorkerFirst: z.ZodOptional<z.ZodBoolean>;
122
- htmlHandling: z.ZodOptional<z.ZodLiteral<"none">>;
123
- }, z.core.$strict>>;
124
- limits: z.ZodOptional<z.ZodObject<{
125
- cpuMs: z.ZodOptional<z.ZodNumber>;
126
- subrequests: z.ZodOptional<z.ZodNumber>;
127
- }, z.core.$strict>>;
128
- serviceKey: z.ZodString;
129
- }, z.core.$strict>;
130
- export type DeployServiceInput = z.infer<typeof deployServiceInput>;
@@ -1,40 +0,0 @@
1
- import { z } from 'zod';
2
- import { artifactModule } from './service-deployment-artifact-module.js';
3
- import { assetBundle } from './service-deployment-assets.js';
4
- import { resourceLimits } from './service-deployment-resource-limits.js';
5
- export const artifact = z.strictObject({
6
- entry: z.string().min(1).max(256),
7
- modules: z.array(artifactModule).min(1).max(40),
8
- });
9
- const digest = z
10
- .string()
11
- .length(71)
12
- .regex(/sha256:[0-9a-f]{64}/);
13
- export const revisionedDeployment = z.strictObject({
14
- revision: digest,
15
- requiredSecrets: z.array(z.string().min(1).max(128)).max(64),
16
- release: artifact,
17
- });
18
- const deploymentFields = {
19
- name: z.string().min(1).max(256).optional(),
20
- entry: z.string().min(1).max(256).optional(),
21
- modules: z.array(artifactModule).min(1).max(40).optional(),
22
- revisioned: revisionedDeployment.optional(),
23
- compatibilityDate: z.string().min(1).max(32).optional(),
24
- compatibilityFlags: z.array(z.string().min(1).max(128)).max(64).optional(),
25
- serviceBindings: z
26
- .array(z.strictObject({
27
- name: z.string().min(1).max(64),
28
- service: z.string().min(1).max(128),
29
- }))
30
- .max(32)
31
- .optional(),
32
- vars: z.record(z.string().max(256), z.string().max(64 * 1024)).optional(),
33
- secrets: z.record(z.string().max(256), z.string().max(64 * 1024)).optional(),
34
- assets: assetBundle.optional(),
35
- limits: resourceLimits,
36
- };
37
- export const deployServiceInput = z.strictObject({
38
- serviceKey: z.string().min(1).max(63),
39
- ...deploymentFields,
40
- });
@@ -1,74 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const deployedFunction: z.ZodObject<{
3
- path: z.ZodString;
4
- ref: z.ZodString;
5
- }, z.core.$strict>;
6
- export declare const publishedApplication: z.ZodObject<{
7
- issuer: z.ZodString;
8
- origin: z.ZodString;
9
- revision: z.ZodString;
10
- publicationEtag: z.ZodString;
11
- functions: z.ZodArray<z.ZodObject<{
12
- path: z.ZodString;
13
- ref: z.ZodString;
14
- }, z.core.$strict>>;
15
- }, z.core.$strict>;
16
- export declare const deployedService: z.ZodObject<{
17
- id: z.ZodString;
18
- serviceKey: z.ZodString;
19
- url: z.ZodString;
20
- digest: z.ZodString;
21
- revision: z.ZodOptional<z.ZodString>;
22
- state: z.ZodEnum<{
23
- deleting: "deleting";
24
- deploying: "deploying";
25
- failed: "failed";
26
- ready: "ready";
27
- reconciling: "reconciling";
28
- }>;
29
- error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
- application: z.ZodOptional<z.ZodObject<{
31
- issuer: z.ZodString;
32
- origin: z.ZodString;
33
- revision: z.ZodString;
34
- publicationEtag: z.ZodString;
35
- functions: z.ZodArray<z.ZodObject<{
36
- path: z.ZodString;
37
- ref: z.ZodString;
38
- }, z.core.$strict>>;
39
- }, z.core.$strict>>;
40
- }, z.core.$strict>;
41
- export declare const deployServiceOutput: z.ZodUnion<readonly [z.ZodObject<{
42
- id: z.ZodString;
43
- serviceKey: z.ZodString;
44
- url: z.ZodString;
45
- digest: z.ZodString;
46
- revision: z.ZodOptional<z.ZodString>;
47
- state: z.ZodEnum<{
48
- deleting: "deleting";
49
- deploying: "deploying";
50
- failed: "failed";
51
- ready: "ready";
52
- reconciling: "reconciling";
53
- }>;
54
- error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
- application: z.ZodOptional<z.ZodObject<{
56
- issuer: z.ZodString;
57
- origin: z.ZodString;
58
- revision: z.ZodString;
59
- publicationEtag: z.ZodString;
60
- functions: z.ZodArray<z.ZodObject<{
61
- path: z.ZodString;
62
- ref: z.ZodString;
63
- }, z.core.$strict>>;
64
- }, z.core.$strict>>;
65
- }, z.core.$strict>, z.ZodObject<{
66
- kind: z.ZodLiteral<"rejected">;
67
- reason: z.ZodEnum<{
68
- "artifact-mode-conflict": "artifact-mode-conflict";
69
- "invalid-deployment": "invalid-deployment";
70
- "service-unavailable": "service-unavailable";
71
- }>;
72
- message: z.ZodString;
73
- }, z.core.$strict>]>;
74
- export type DeployServiceOutput = z.infer<typeof deployServiceOutput>;
@@ -1,24 +0,0 @@
1
- import { z } from 'zod';
2
- import { deploymentRejection } from './service-deployment-rejection.js';
3
- export const deployedFunction = z.strictObject({
4
- path: z.string(),
5
- ref: z.string(),
6
- });
7
- export const publishedApplication = z.strictObject({
8
- issuer: z.string().min(1),
9
- origin: z.string().min(1),
10
- revision: z.string().min(1),
11
- publicationEtag: z.string().min(1),
12
- functions: z.array(deployedFunction),
13
- });
14
- export const deployedService = z.strictObject({
15
- id: z.string().min(1),
16
- serviceKey: z.string().min(1),
17
- url: z.string(),
18
- digest: z.string(),
19
- revision: z.string().min(1).max(80).optional(),
20
- state: z.enum(['deploying', 'reconciling', 'ready', 'failed', 'deleting']),
21
- error: z.string().nullable().optional(),
22
- application: publishedApplication.optional(),
23
- });
24
- export const deployServiceOutput = z.union([deployedService, deploymentRejection]);
@@ -1,11 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const deploymentRejection: z.ZodObject<{
3
- kind: z.ZodLiteral<"rejected">;
4
- reason: z.ZodEnum<{
5
- "artifact-mode-conflict": "artifact-mode-conflict";
6
- "invalid-deployment": "invalid-deployment";
7
- "service-unavailable": "service-unavailable";
8
- }>;
9
- message: z.ZodString;
10
- }, z.core.$strict>;
11
- export type DeploymentRejection = z.infer<typeof deploymentRejection>;
@@ -1,6 +0,0 @@
1
- import { z } from 'zod';
2
- export const deploymentRejection = z.strictObject({
3
- kind: z.literal('rejected'),
4
- reason: z.enum(['invalid-deployment', 'service-unavailable', 'artifact-mode-conflict']),
5
- message: z.string().min(1).max(500),
6
- });
@@ -1,8 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const serviceLifecycle: z.ZodEnum<{
3
- deleting: "deleting";
4
- deploying: "deploying";
5
- failed: "failed";
6
- ready: "ready";
7
- reconciling: "reconciling";
8
- }>;
@@ -1,2 +0,0 @@
1
- import { z } from 'zod';
2
- export const serviceLifecycle = z.enum(['deploying', 'reconciling', 'ready', 'failed', 'deleting']);