@astrale-domains/services 0.2.3 → 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 (72) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +8 -7
  3. package/dist/schema/index.d.ts +3 -3
  4. package/dist/schema/index.js +2 -2
  5. package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +6366 -0
  6. package/dist/schema/{service/cloudflare-worker-class.js → modules/service/classes/cloudflare-worker.js} +2 -2
  7. package/dist/schema/modules/service/classes/index.d.ts +3 -0
  8. package/dist/schema/modules/service/classes/index.js +3 -0
  9. package/dist/schema/{service/service-owned-by-edge-class.d.ts → modules/service/classes/service-owned-by.d.ts} +4 -4
  10. package/dist/schema/{service/service-owned-by-edge-class.js → modules/service/classes/service-owned-by.js} +4 -4
  11. package/dist/schema/{service/service-class.d.ts → modules/service/classes/service.d.ts} +84 -71
  12. package/dist/schema/modules/service/classes/service.js +37 -0
  13. package/dist/schema/{service/methods/delete-secret.d.ts → modules/service/functions/delete-service-secret.d.ts} +3 -3
  14. package/dist/schema/{service/methods/delete-secret.js → modules/service/functions/delete-service-secret.js} +4 -3
  15. package/dist/schema/{service/methods → modules/service/functions}/delete-service.d.ts +1 -1
  16. package/dist/schema/{service/methods → modules/service/functions}/delete-service.js +4 -2
  17. package/dist/schema/{deployment/request.d.ts → modules/service/functions/deploy-cloudflare-worker.d.ts} +100 -2
  18. package/dist/schema/{deployment/request.js → modules/service/functions/deploy-cloudflare-worker.js} +24 -10
  19. package/dist/schema/{service/methods → modules/service/functions}/index.d.ts +3 -2
  20. package/dist/schema/{service/methods → modules/service/functions}/index.js +2 -2
  21. package/dist/schema/{service/methods → modules/service/functions}/list-service-logs.d.ts +1 -1
  22. package/dist/schema/{service/methods → modules/service/functions}/list-service-logs.js +3 -1
  23. package/dist/schema/{service/methods → modules/service/functions}/list-service-schedules.d.ts +1 -1
  24. package/dist/schema/{service/methods → modules/service/functions}/list-service-schedules.js +3 -1
  25. package/dist/schema/{service/methods → modules/service/functions}/list-service-secret-names.d.ts +1 -1
  26. package/dist/schema/{service/methods → modules/service/functions}/list-service-secret-names.js +4 -2
  27. package/dist/schema/{service/methods → modules/service/functions}/replace-service-schedules.d.ts +1 -1
  28. package/dist/schema/{service/methods → modules/service/functions}/replace-service-schedules.js +3 -1
  29. package/dist/schema/{service/methods → modules/service/functions}/set-service-secret.d.ts +3 -3
  30. package/dist/schema/{service/methods → modules/service/functions}/set-service-secret.js +4 -3
  31. package/dist/schema/modules/service/index.d.ts +8 -0
  32. package/dist/schema/modules/service/index.js +5 -0
  33. package/dist/schema/modules/service/policies/index.d.ts +2 -0
  34. package/dist/schema/modules/service/policies/index.js +2 -0
  35. package/dist/schema/modules/service/policies/own-service.d.ts +2 -0
  36. package/dist/schema/modules/service/policies/own-service.js +7 -0
  37. package/dist/schema/{service/policies.d.ts → modules/service/policies/traverse-owned-service.d.ts} +0 -2
  38. package/dist/schema/modules/service/policies/traverse-owned-service.js +7 -0
  39. package/dist/schema/modules/service/states/index.d.ts +2 -0
  40. package/dist/schema/modules/service/states/index.js +1 -0
  41. package/dist/schema/modules/service/states/service-lifecycle.d.ts +25 -0
  42. package/dist/schema/modules/service/states/service-lifecycle.js +26 -0
  43. package/dist/schema/modules/service/types/index.d.ts +9 -0
  44. package/dist/schema/modules/service/types/index.js +6 -0
  45. package/dist/schema/{deployment/module.js → modules/service/types/service-deployment-artifact-module.js} +1 -1
  46. package/dist/schema/{deployment/asset.js → modules/service/types/service-deployment-assets.js} +1 -1
  47. package/dist/schema/modules/service/types/service-secret-name.d.ts +2 -0
  48. package/dist/schema/modules/service/types/service-secret-operation-rejection.d.ts +9 -0
  49. package/dist/schema/schema.d.ts +2602 -4250
  50. package/dist/schema/schema.js +2 -2
  51. package/package.json +6 -3
  52. package/dist/schema/deployment/deployment-rejection.d.ts +0 -11
  53. package/dist/schema/deployment/deployment-rejection.js +0 -6
  54. package/dist/schema/deployment/index.d.ts +0 -13
  55. package/dist/schema/deployment/index.js +0 -7
  56. package/dist/schema/deployment/result.d.ts +0 -74
  57. package/dist/schema/deployment/result.js +0 -24
  58. package/dist/schema/service/cloudflare-worker-class.d.ts +0 -8029
  59. package/dist/schema/service/index.d.ts +0 -5
  60. package/dist/schema/service/index.js +0 -5
  61. package/dist/schema/service/methods/deploy-cloudflare-worker.d.ts +0 -81
  62. package/dist/schema/service/methods/deploy-cloudflare-worker.js +0 -9
  63. package/dist/schema/service/policies.js +0 -12
  64. package/dist/schema/service/service-class.js +0 -46
  65. /package/dist/schema/{deployment/module.d.ts → modules/service/types/service-deployment-artifact-module.d.ts} +0 -0
  66. /package/dist/schema/{deployment/asset.d.ts → modules/service/types/service-deployment-assets.d.ts} +0 -0
  67. /package/dist/schema/{deployment/content.d.ts → modules/service/types/service-deployment-content.d.ts} +0 -0
  68. /package/dist/schema/{deployment/content.js → modules/service/types/service-deployment-content.js} +0 -0
  69. /package/dist/schema/{deployment/limits.d.ts → modules/service/types/service-deployment-resource-limits.d.ts} +0 -0
  70. /package/dist/schema/{deployment/limits.js → modules/service/types/service-deployment-resource-limits.js} +0 -0
  71. /package/dist/schema/{service/methods/secret-name.js → modules/service/types/service-secret-name.js} +0 -0
  72. /package/dist/schema/{service/methods/secret-operation-rejection.js → modules/service/types/service-secret-operation-rejection.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { nodeClass, property } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
- import { deployCloudflareWorker } from './methods/index.js';
4
- import { Service } from './service-class.js';
3
+ import { deployCloudflareWorker } from '../functions/deploy-cloudflare-worker.js';
4
+ import { Service } from './service.js';
5
5
  export const CloudflareWorker = nodeClass({
6
6
  description: 'One Service placed in a Cloudflare Workers dispatch namespace.',
7
7
  extends: [Service],
@@ -0,0 +1,3 @@
1
+ export { CloudflareWorker } from './cloudflare-worker.js';
2
+ export { Service } from './service.js';
3
+ export { service_owned_by } from './service-owned-by.js';
@@ -0,0 +1,3 @@
1
+ export { CloudflareWorker } from './cloudflare-worker.js';
2
+ export { Service } from './service.js';
3
+ export { service_owned_by } from './service-owned-by.js';
@@ -4,12 +4,12 @@ export declare const service_owned_by: import("@astrale-os/sdk/schema").Directed
4
4
  readonly extends: readonly [];
5
5
  readonly properties: never;
6
6
  readonly source: {
7
- readonly as: "owner";
8
- readonly outgoing: "0..*";
7
+ readonly as: "service";
8
+ readonly outgoing: "1";
9
9
  };
10
10
  readonly target: {
11
- readonly as: "service";
12
- readonly incoming: "1";
11
+ readonly as: "owner";
12
+ readonly incoming: "0..*";
13
13
  };
14
14
  readonly constraints: Record<never, never>;
15
15
  readonly effectiveProperties: never;
@@ -1,9 +1,9 @@
1
1
  import { K, edgeClass } from '@astrale-os/sdk/schema';
2
- import { TraverseOwnedService } from './policies.js';
3
- import { Service } from './service-class.js';
2
+ import { TraverseOwnedService } from '../policies/index.js';
3
+ import { Service } from './service.js';
4
4
  export const service_owned_by = edgeClass.directed({
5
5
  description: 'The Identity that owns and may manage one Service.',
6
- source: { as: 'owner', accepts: [K.classes.Identity], outgoing: '0..*' },
7
- target: { as: 'service', accepts: [() => Service], incoming: '1' },
6
+ source: { as: 'service', accepts: [() => Service], outgoing: '1' },
7
+ target: { as: 'owner', accepts: [K.classes.Identity], incoming: '0..*' },
8
8
  policies: { traverse: () => TraverseOwnedService },
9
9
  });
@@ -1,11 +1,3 @@
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
- }>;
9
1
  /** Provider-neutral deployed resource. Provider implementation versions are deliberately external. */
10
2
  export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
11
3
  readonly depth: 1;
@@ -26,7 +18,7 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
26
18
  readonly abstract: true;
27
19
  }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
28
20
  readonly origin: "kernel.astrale.ai";
29
- }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name">, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
21
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name", undefined>, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "name", "kernel.astrale.ai:class.Named.property.name", undefined>, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
30
22
  readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Descriptable"> & {
31
23
  readonly origin: "kernel.astrale.ai";
32
24
  };
@@ -42,7 +34,7 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
42
34
  readonly abstract: true;
43
35
  }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
44
36
  readonly origin: "kernel.astrale.ai";
45
- }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description">, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
37
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description", undefined>, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, false, "description", "kernel.astrale.ai:class.Descriptable.property.description", undefined>, never, never>, import("@astrale-os/sdk/schema").ClassProjection<"node", import("@astrale-os/sdk/schema").NodeClassDefinition & {
46
38
  readonly ref: import("@astrale-os/sdk/schema").ClassRef<"Timestamped"> & {
47
39
  readonly origin: "kernel.astrale.ai";
48
40
  };
@@ -58,29 +50,36 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
58
50
  readonly abstract: true;
59
51
  }, import("@astrale-os/sdk/schema").ClassRef & import("@astrale-os/sdk/schema").ClassRef<"Node"> & {
60
52
  readonly origin: "kernel.astrale.ai";
61
- }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt"> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt">, never, never>];
53
+ }, "kernel.astrale.ai:class.Node", readonly import("@astrale-os/sdk/schema").AnyResolvedClass[], never, never, never, never, never, never>, ...never[]], import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt", undefined> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt", undefined>, never, never, import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "createdAt", "kernel.astrale.ai:class.Timestamped.property.createdAt", undefined> | import("@astrale-os/sdk/schema").PropertyProjection<string | number | boolean | import("@astrale-os/sdk/schema").Array | import("@astrale-os/sdk/schema").Object | null, true, "updatedAt", "kernel.astrale.ai:class.Timestamped.property.updatedAt", undefined>, never, never>];
62
54
  readonly properties: {
63
- readonly providerKey: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerKey", "self">;
64
- readonly providerName: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerName", "self">;
65
- readonly serviceKey: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "serviceKey", "self">;
66
- readonly url: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "url", "self">;
67
- readonly state: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<"deleting" | "deploying" | "failed" | "ready" | "reconciling", "deleting" | "deploying" | "failed" | "ready" | "reconciling", true, "state", "self">;
68
- readonly digest: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "digest", "self">;
69
- readonly revision: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "revision", "self">;
70
- readonly deploymentReceipt: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "deploymentReceipt", "self">;
71
- readonly operationExpiresAt: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<import("@astrale-os/sdk/schema").Value, import("@astrale-os/sdk/schema").Value, false, "operationExpiresAt", "self">;
72
- readonly hostedIssuer: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedIssuer", "self">;
73
- readonly hostedOrigin: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedOrigin", "self">;
74
- readonly hostedRevision: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedRevision", "self">;
75
- readonly hostedPublicationEtag: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedPublicationEtag", "self">;
76
- readonly hostedFunctions: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<{
77
- ref: string;
78
- path: string;
79
- }[], {
80
- ref: string;
81
- path: string;
82
- }[], false, "hostedFunctions", "self">;
83
- readonly error: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "error", "self">;
55
+ readonly providerName: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerName", "self", undefined>;
56
+ readonly serviceKey: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "serviceKey", "self", undefined>;
57
+ readonly url: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "url", "self", never>;
58
+ readonly state: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<unknown, "deleting" | "deploying" | "failed" | "ready" | "reconciling", true, "state", "self", import("@astrale-os/sdk/state").StateTopology<{
59
+ readonly deploying: {
60
+ readonly recordProviderDeployment: "reconciling";
61
+ readonly failDeployment: "failed";
62
+ readonly deleteService: "deleting";
63
+ };
64
+ readonly reconciling: {
65
+ readonly retryDeployment: "deploying";
66
+ readonly completeDeployment: "ready";
67
+ readonly deleteService: "deleting";
68
+ };
69
+ readonly ready: {
70
+ readonly redeploy: "deploying";
71
+ readonly deleteService: "deleting";
72
+ };
73
+ readonly failed: {
74
+ readonly retryDeployment: "deploying";
75
+ readonly deleteService: "deleting";
76
+ };
77
+ readonly deleting: {};
78
+ }, "deploying">>;
79
+ readonly digest: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "digest", "self", never>;
80
+ readonly deploymentReceipt: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "deploymentReceipt", "self", never>;
81
+ readonly operationExpiresAt: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<import("@astrale-os/sdk/schema").Value, import("@astrale-os/sdk/schema").Value, false, "operationExpiresAt", "self", never>;
82
+ readonly error: import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "error", "self", never>;
84
83
  };
85
84
  readonly methods: {
86
85
  readonly setSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
@@ -89,12 +88,12 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
89
88
  }, {
90
89
  readonly mode: 'value';
91
90
  readonly value: {
91
+ name: string;
92
+ } | {
92
93
  kind: "rejected";
93
94
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
94
- } | {
95
- name: string;
96
95
  };
97
- }, "authenticated", false, "default">>;
96
+ }, "authorized", false, "default">>;
98
97
  readonly deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
99
98
  name: string;
100
99
  }, {
@@ -105,11 +104,11 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
105
104
  } | {
106
105
  ok: true;
107
106
  };
108
- }, "authenticated", false, "default">>;
107
+ }, "authorized", false, "default">>;
109
108
  readonly secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
110
109
  readonly mode: 'value';
111
110
  readonly value: string[];
112
- }, "authenticated", false, "default">>;
111
+ }, "authorized", false, "default">>;
113
112
  readonly setSchedule: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
114
113
  crons: string[];
115
114
  }, {
@@ -120,11 +119,11 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
120
119
  kind: "rejected";
121
120
  reason: "invalid-schedule" | "service-unavailable";
122
121
  };
123
- }, "authenticated", false, "default">>;
122
+ }, "authorized", false, "default">>;
124
123
  readonly schedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
125
124
  readonly mode: 'value';
126
125
  readonly value: string[];
127
- }, "authenticated", false, "default">>;
126
+ }, "authorized", false, "default">>;
128
127
  readonly logs: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
129
128
  tail?: number | undefined;
130
129
  since?: number | undefined;
@@ -136,7 +135,7 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
136
135
  level: string;
137
136
  line: string;
138
137
  }[];
139
- }, "authenticated", false, "default">>;
138
+ }, "authorized", false, "default">>;
140
139
  readonly delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
141
140
  readonly mode: 'value';
142
141
  readonly value: {
@@ -145,34 +144,48 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
145
144
  kind: "deleting";
146
145
  retryAfterMs: number;
147
146
  };
148
- }, "authenticated", false, "default">>;
147
+ }, "authorized", false, "default">>;
149
148
  };
150
- readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "deploymentReceipt", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "digest", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "error", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<{
151
- ref: string;
152
- path: string;
153
- }[], {
154
- ref: string;
155
- path: string;
156
- }[], false, "hostedFunctions", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedIssuer", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedOrigin", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedPublicationEtag", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "hostedRevision", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<import("@astrale-os/sdk/schema").Value, import("@astrale-os/sdk/schema").Value, false, "operationExpiresAt", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerKey", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerName", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "revision", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "serviceKey", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<"deleting" | "deploying" | "failed" | "ready" | "reconciling", "deleting" | "deploying" | "failed" | "ready" | "reconciling", true, "state", "self"> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "url", "self">) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false> & {
149
+ readonly effectiveProperties: (import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "deploymentReceipt", "self", never> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "digest", "self", never> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "error", "self", never> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<import("@astrale-os/sdk/schema").Value, import("@astrale-os/sdk/schema").Value, false, "operationExpiresAt", "self", never> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "providerName", "self", undefined> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, true, "serviceKey", "self", undefined> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<unknown, "deleting" | "deploying" | "failed" | "ready" | "reconciling", true, "state", "self", import("@astrale-os/sdk/state").StateTopology<{
150
+ readonly deploying: {
151
+ readonly recordProviderDeployment: "reconciling";
152
+ readonly failDeployment: "failed";
153
+ readonly deleteService: "deleting";
154
+ };
155
+ readonly reconciling: {
156
+ readonly retryDeployment: "deploying";
157
+ readonly completeDeployment: "ready";
158
+ readonly deleteService: "deleting";
159
+ };
160
+ readonly ready: {
161
+ readonly redeploy: "deploying";
162
+ readonly deleteService: "deleting";
163
+ };
164
+ readonly failed: {
165
+ readonly retryDeployment: "deploying";
166
+ readonly deleteService: "deleting";
167
+ };
168
+ readonly deleting: {};
169
+ }, "deploying">> | import("@astrale-os/sdk/schema").AuthoredPropertyProjection<string, string, false, "url", "self", never>) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, false, never> & {
157
170
  readonly name: "description";
158
171
  readonly key: "kernel.astrale.ai:class.Descriptable.property.description";
159
- }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
172
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true, undefined> & {
160
173
  readonly name: "createdAt";
161
174
  readonly key: "kernel.astrale.ai:class.Timestamped.property.createdAt";
162
- }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
175
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true, undefined> & {
163
176
  readonly name: "name";
164
177
  readonly key: "kernel.astrale.ai:class.Named.property.name";
165
- }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true> & {
178
+ }) | (import("@astrale-os/sdk/schema").ResolvedProperty<import("@astrale-os/sdk/schema").Value, true, undefined> & {
166
179
  readonly name: "updatedAt";
167
180
  readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
168
181
  });
169
182
  readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
170
183
  readonly mode: 'value';
171
184
  readonly value: string[];
172
- }, "authenticated", false, "default">>, "schedules", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
185
+ }, "authorized", false, "default">>, "schedules", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
173
186
  readonly mode: 'value';
174
187
  readonly value: string[];
175
- }, "authenticated", false, "default">>, "secrets", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
188
+ }, "authorized", false, "default">>, "secrets", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
176
189
  readonly mode: 'value';
177
190
  readonly value: {
178
191
  kind: "deleted";
@@ -180,29 +193,18 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
180
193
  kind: "deleting";
181
194
  retryAfterMs: number;
182
195
  };
183
- }, "authenticated", false, "default">>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
184
- tail?: number | undefined;
185
- since?: number | undefined;
186
- }, {
187
- readonly mode: 'value';
188
- readonly value: {
189
- id: string;
190
- ts: number;
191
- level: string;
192
- line: string;
193
- }[];
194
- }, "authenticated", false, "default">>, "logs", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
196
+ }, "authorized", false, "default">>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
195
197
  name: string;
196
198
  value: string;
197
199
  }, {
198
200
  readonly mode: 'value';
199
201
  readonly value: {
202
+ name: string;
203
+ } | {
200
204
  kind: "rejected";
201
205
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
202
- } | {
203
- name: string;
204
206
  };
205
- }, "authenticated", false, "default">>, "setSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
207
+ }, "authorized", false, "default">>, "setSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
206
208
  name: string;
207
209
  }, {
208
210
  readonly mode: 'value';
@@ -212,7 +214,7 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
212
214
  } | {
213
215
  ok: true;
214
216
  };
215
- }, "authenticated", false, "default">>, "deleteSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
217
+ }, "authorized", false, "default">>, "deleteSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
216
218
  crons: string[];
217
219
  }, {
218
220
  readonly mode: 'value';
@@ -222,6 +224,17 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
222
224
  kind: "rejected";
223
225
  reason: "invalid-schedule" | "service-unavailable";
224
226
  };
225
- }, "authenticated", false, "default">>, "setSchedule", "self">;
227
+ }, "authorized", false, "default">>, "setSchedule", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
228
+ tail?: number | undefined;
229
+ since?: number | undefined;
230
+ }, {
231
+ readonly mode: 'value';
232
+ readonly value: {
233
+ id: string;
234
+ ts: number;
235
+ level: string;
236
+ line: string;
237
+ }[];
238
+ }, "authorized", false, "default">>, "logs", "self">;
226
239
  readonly effectiveStaticMethods: never;
227
- }> & import("@astrale-os/sdk/schema").StateClass<Readonly<Omit<Readonly<Record<never, never>>, never> & {}>>;
240
+ }>;
@@ -0,0 +1,37 @@
1
+ import { K, nodeClass, property, schema as valueSchema, stateProperty, } from '@astrale-os/sdk/schema';
2
+ import { z } from 'zod';
3
+ import { deleteServiceSecret } from '../functions/delete-service-secret.js';
4
+ import { deleteService } from '../functions/delete-service.js';
5
+ import { listServiceLogs } from '../functions/list-service-logs.js';
6
+ import { listServiceSchedules } from '../functions/list-service-schedules.js';
7
+ import { listServiceSecretNames } from '../functions/list-service-secret-names.js';
8
+ import { replaceServiceSchedules } from '../functions/replace-service-schedules.js';
9
+ import { setServiceSecret } from '../functions/set-service-secret.js';
10
+ import { OwnService } from '../policies/own-service.js';
11
+ import { serviceLifecycle } from '../states/index.js';
12
+ /** Provider-neutral deployed resource. Provider implementation versions are deliberately external. */
13
+ export const Service = nodeClass({
14
+ abstract: true,
15
+ description: 'One caller-owned provider-neutral deployed Service.',
16
+ extends: [K.classes.Named, K.classes.Descriptable, K.classes.Timestamped],
17
+ properties: {
18
+ providerName: z.string().min(1).max(120),
19
+ serviceKey: z.string().min(1).max(63),
20
+ url: property(z.string().min(1).max(2_048), { required: false }),
21
+ state: stateProperty(serviceLifecycle),
22
+ digest: property(z.string().min(1).max(256), { required: false }),
23
+ deploymentReceipt: property(z.string().min(1).max(128), { required: false }),
24
+ operationExpiresAt: property(valueSchema.values.instant, { required: false }),
25
+ error: property(z.string().max(5_000), { required: false }),
26
+ },
27
+ methods: {
28
+ setSecret: setServiceSecret,
29
+ deleteSecret: deleteServiceSecret,
30
+ secrets: listServiceSecretNames,
31
+ setSchedule: replaceServiceSchedules,
32
+ schedules: listServiceSchedules,
33
+ logs: listServiceLogs,
34
+ delete: deleteService,
35
+ },
36
+ policies: { read: () => OwnService },
37
+ });
@@ -3,9 +3,9 @@ export declare const deleteServiceSecret: import("@astrale-os/sdk/schema").Metho
3
3
  }, {
4
4
  readonly mode: 'value';
5
5
  readonly value: {
6
- ok: true;
7
- } | {
8
6
  kind: "rejected";
9
7
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
8
+ } | {
9
+ ok: true;
10
10
  };
11
- }, "authenticated", false, "default">>;
11
+ }, "authorized", false, "default">>;
@@ -1,10 +1,11 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
- import { secretName } from './secret-name.js';
4
- import { secretOperationRejection } from './secret-operation-rejection.js';
3
+ import { OwnService } from '../policies/own-service.js';
4
+ import { secretName, secretOperationRejection } from '../types/index.js';
5
5
  export const deleteServiceSecret = method({
6
6
  description: 'Delete one write-only Service secret.',
7
- auth: 'authenticated',
7
+ auth: 'authorized',
8
+ policy: ({ check, self }) => check(OwnService, self),
8
9
  input: z.strictObject({ name: secretName }),
9
10
  output: z.union([z.strictObject({ ok: z.literal(true) }), secretOperationRejection]),
10
11
  });
@@ -6,4 +6,4 @@ export declare const deleteService: import("@astrale-os/sdk/schema").Method<impo
6
6
  kind: "deleting";
7
7
  retryAfterMs: number;
8
8
  };
9
- }, "authenticated", false, "default">>;
9
+ }, "authorized", false, "default">>;
@@ -1,8 +1,10 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
2
  import { z } from 'zod';
3
+ import { OwnService } from '../policies/own-service.js';
3
4
  export const deleteService = method({
4
- description: 'Convergently delete provider resources and the Service record without uninstalling consumers.',
5
- auth: 'authenticated',
5
+ description: 'Convergently delete provider resources and the owned Service without uninstalling consumers.',
6
+ auth: 'authorized',
7
+ policy: ({ check, self }) => check(OwnService, self),
6
8
  input: z.strictObject({}),
7
9
  output: z.discriminatedUnion('kind', [
8
10
  z.strictObject({ kind: z.literal('deleted') }),
@@ -22,7 +22,6 @@ export declare const artifact: z.ZodObject<{
22
22
  }, z.core.$strict>]>>;
23
23
  }, z.core.$strict>;
24
24
  export declare const revisionedDeployment: z.ZodObject<{
25
- revision: z.ZodString;
26
25
  requiredSecrets: z.ZodArray<z.ZodString>;
27
26
  release: z.ZodObject<{
28
27
  entry: z.ZodString;
@@ -70,7 +69,6 @@ export declare const deployServiceInput: z.ZodObject<{
70
69
  }>>;
71
70
  }, z.core.$strict>]>>>;
72
71
  revisioned: z.ZodOptional<z.ZodObject<{
73
- revision: z.ZodString;
74
72
  requiredSecrets: z.ZodArray<z.ZodString>;
75
73
  release: z.ZodObject<{
76
74
  entry: z.ZodString;
@@ -128,3 +126,103 @@ export declare const deployServiceInput: z.ZodObject<{
128
126
  serviceKey: z.ZodString;
129
127
  }, z.core.$strict>;
130
128
  export type DeployServiceInput = z.infer<typeof deployServiceInput>;
129
+ export declare const deployedService: z.ZodObject<{
130
+ id: z.ZodString;
131
+ serviceKey: z.ZodString;
132
+ url: z.ZodString;
133
+ digest: z.ZodString;
134
+ state: z.ZodLiteral<"ready">;
135
+ }, z.core.$strict>;
136
+ export declare const deploymentRejection: z.ZodObject<{
137
+ kind: z.ZodLiteral<"rejected">;
138
+ reason: z.ZodEnum<{
139
+ "artifact-mode-conflict": "artifact-mode-conflict";
140
+ "invalid-deployment": "invalid-deployment";
141
+ "service-unavailable": "service-unavailable";
142
+ }>;
143
+ message: z.ZodString;
144
+ }, z.core.$strict>;
145
+ export declare const deployServiceOutput: z.ZodUnion<readonly [z.ZodObject<{
146
+ id: z.ZodString;
147
+ serviceKey: z.ZodString;
148
+ url: z.ZodString;
149
+ digest: z.ZodString;
150
+ state: z.ZodLiteral<"ready">;
151
+ }, z.core.$strict>, z.ZodObject<{
152
+ kind: z.ZodLiteral<"rejected">;
153
+ reason: z.ZodEnum<{
154
+ "artifact-mode-conflict": "artifact-mode-conflict";
155
+ "invalid-deployment": "invalid-deployment";
156
+ "service-unavailable": "service-unavailable";
157
+ }>;
158
+ message: z.ZodString;
159
+ }, z.core.$strict>]>;
160
+ export type DeployServiceOutput = z.infer<typeof deployServiceOutput>;
161
+ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
162
+ name?: string | undefined;
163
+ entry?: string | undefined;
164
+ modules?: ({
165
+ contentBase64: string;
166
+ name: string;
167
+ kind?: "data" | "esm" | "text" | "wasm" | undefined;
168
+ } | {
169
+ contentBase64Chunks: string[];
170
+ name: string;
171
+ kind?: "data" | "esm" | "text" | "wasm" | undefined;
172
+ })[] | undefined;
173
+ revisioned?: {
174
+ requiredSecrets: string[];
175
+ release: {
176
+ entry: string;
177
+ modules: ({
178
+ contentBase64: string;
179
+ name: string;
180
+ kind?: "data" | "esm" | "text" | "wasm" | undefined;
181
+ } | {
182
+ contentBase64Chunks: string[];
183
+ name: string;
184
+ kind?: "data" | "esm" | "text" | "wasm" | undefined;
185
+ })[];
186
+ };
187
+ } | undefined;
188
+ compatibilityDate?: string | undefined;
189
+ compatibilityFlags?: string[] | undefined;
190
+ serviceBindings?: {
191
+ name: string;
192
+ service: string;
193
+ }[] | undefined;
194
+ vars?: Record<string, string> | undefined;
195
+ secrets?: Record<string, string> | undefined;
196
+ assets?: {
197
+ files: ({
198
+ contentBase64: string;
199
+ path: string;
200
+ contentType?: string | undefined;
201
+ } | {
202
+ contentBase64Chunks: string[];
203
+ path: string;
204
+ contentType?: string | undefined;
205
+ })[];
206
+ notFound?: "404-page" | "none" | "single-page-application" | undefined;
207
+ runWorkerFirst?: boolean | undefined;
208
+ htmlHandling?: "none" | undefined;
209
+ } | undefined;
210
+ limits?: {
211
+ cpuMs?: number | undefined;
212
+ subrequests?: number | undefined;
213
+ } | undefined;
214
+ serviceKey: string;
215
+ }, {
216
+ readonly mode: 'value';
217
+ readonly value: {
218
+ id: string;
219
+ serviceKey: string;
220
+ url: string;
221
+ digest: string;
222
+ state: "ready";
223
+ } | {
224
+ kind: "rejected";
225
+ reason: "artifact-mode-conflict" | "invalid-deployment" | "service-unavailable";
226
+ message: string;
227
+ };
228
+ }, "authenticated", true, "default">>;
@@ -1,21 +1,15 @@
1
+ import { method } from '@astrale-os/sdk/schema';
1
2
  import { z } from 'zod';
2
- import { assetBundle } from './asset.js';
3
- import { resourceLimits } from './limits.js';
4
- import { artifactModule } from './module.js';
3
+ import { artifactModule, assetBundle, resourceLimits } from '../types/index.js';
5
4
  export const artifact = z.strictObject({
6
5
  entry: z.string().min(1).max(256),
7
6
  modules: z.array(artifactModule).min(1).max(40),
8
7
  });
9
- const digest = z
10
- .string()
11
- .length(71)
12
- .regex(/sha256:[0-9a-f]{64}/);
13
8
  export const revisionedDeployment = z.strictObject({
14
- revision: digest,
15
9
  requiredSecrets: z.array(z.string().min(1).max(128)).max(64),
16
10
  release: artifact,
17
11
  });
18
- const deploymentFields = {
12
+ const deployServiceFields = {
19
13
  name: z.string().min(1).max(256).optional(),
20
14
  entry: z.string().min(1).max(256).optional(),
21
15
  modules: z.array(artifactModule).min(1).max(40).optional(),
@@ -36,5 +30,25 @@ const deploymentFields = {
36
30
  };
37
31
  export const deployServiceInput = z.strictObject({
38
32
  serviceKey: z.string().min(1).max(63),
39
- ...deploymentFields,
33
+ ...deployServiceFields,
34
+ });
35
+ export const deployedService = z.strictObject({
36
+ id: z.string().min(1),
37
+ serviceKey: z.string().min(1),
38
+ url: z.string(),
39
+ digest: z.string(),
40
+ state: z.literal('ready'),
41
+ });
42
+ export const deploymentRejection = z.strictObject({
43
+ kind: z.literal('rejected'),
44
+ reason: z.enum(['invalid-deployment', 'service-unavailable', 'artifact-mode-conflict']),
45
+ message: z.string().min(1).max(500),
46
+ });
47
+ export const deployServiceOutput = z.union([deployedService, deploymentRejection]);
48
+ export const deployCloudflareWorker = method({
49
+ description: 'Create or converge one Cloudflare Worker Service.',
50
+ auth: 'authenticated',
51
+ static: true,
52
+ input: deployServiceInput,
53
+ output: deployServiceOutput,
40
54
  });
@@ -1,6 +1,7 @@
1
- export { deleteServiceSecret } from './delete-secret.js';
1
+ export { deleteServiceSecret } from './delete-service-secret.js';
2
2
  export { deleteService } from './delete-service.js';
3
- export { deployCloudflareWorker } from './deploy-cloudflare-worker.js';
3
+ export { artifact, deployedService, deploymentRejection, deployCloudflareWorker, deployServiceInput, deployServiceOutput, revisionedDeployment, } from './deploy-cloudflare-worker.js';
4
+ export type { DeployServiceInput, DeployServiceOutput } from './deploy-cloudflare-worker.js';
4
5
  export { listServiceLogs } from './list-service-logs.js';
5
6
  export { listServiceSchedules } from './list-service-schedules.js';
6
7
  export { listServiceSecretNames } from './list-service-secret-names.js';
@@ -1,6 +1,6 @@
1
- export { deleteServiceSecret } from './delete-secret.js';
1
+ export { deleteServiceSecret } from './delete-service-secret.js';
2
2
  export { deleteService } from './delete-service.js';
3
- export { deployCloudflareWorker } from './deploy-cloudflare-worker.js';
3
+ export { artifact, deployedService, deploymentRejection, deployCloudflareWorker, deployServiceInput, deployServiceOutput, revisionedDeployment, } from './deploy-cloudflare-worker.js';
4
4
  export { listServiceLogs } from './list-service-logs.js';
5
5
  export { listServiceSchedules } from './list-service-schedules.js';
6
6
  export { listServiceSecretNames } from './list-service-secret-names.js';