@astrale-domains/services 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +6 -0
- package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +1092 -971
- package/dist/schema/modules/service/classes/cloudflare-worker.js +17 -1
- package/dist/schema/modules/service/classes/service.d.ts +77 -19
- package/dist/schema/modules/service/functions/delete-service-secret.d.ts +1 -1
- package/dist/schema/modules/service/functions/delete-service-secret.js +2 -10
- package/dist/schema/modules/service/functions/delete-service.d.ts +1 -1
- package/dist/schema/modules/service/functions/delete-service.js +2 -15
- package/dist/schema/modules/service/functions/delete-worker-secret.d.ts +11 -0
- package/dist/schema/modules/service/functions/delete-worker-secret.js +7 -0
- package/dist/schema/modules/service/functions/delete-worker.d.ts +9 -0
- package/dist/schema/modules/service/functions/delete-worker.js +7 -0
- package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +1 -1
- package/dist/schema/modules/service/functions/index.d.ts +7 -0
- package/dist/schema/modules/service/functions/index.js +7 -0
- package/dist/schema/modules/service/functions/list-service-logs.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-service-logs.js +2 -12
- package/dist/schema/modules/service/functions/list-service-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-service-schedules.js +2 -9
- package/dist/schema/modules/service/functions/list-service-secret-names.d.ts +1 -1
- package/dist/schema/modules/service/functions/list-service-secret-names.js +2 -10
- package/dist/schema/modules/service/functions/list-worker-logs.d.ts +12 -0
- package/dist/schema/modules/service/functions/list-worker-logs.js +7 -0
- package/dist/schema/modules/service/functions/list-worker-schedules.d.ts +4 -0
- package/dist/schema/modules/service/functions/list-worker-schedules.js +7 -0
- package/dist/schema/modules/service/functions/list-worker-secret-names.d.ts +4 -0
- package/dist/schema/modules/service/functions/list-worker-secret-names.js +7 -0
- package/dist/schema/modules/service/functions/replace-service-schedules.d.ts +1 -1
- package/dist/schema/modules/service/functions/replace-service-schedules.js +3 -13
- package/dist/schema/modules/service/functions/replace-worker-schedules.d.ts +11 -0
- package/dist/schema/modules/service/functions/replace-worker-schedules.js +7 -0
- package/dist/schema/modules/service/functions/set-service-secret.d.ts +3 -3
- package/dist/schema/modules/service/functions/set-service-secret.js +2 -16
- package/dist/schema/modules/service/functions/set-worker-secret.d.ts +12 -0
- package/dist/schema/modules/service/functions/set-worker-secret.js +7 -0
- package/dist/schema/modules/service/types/deploy-cloudflare-worker.js +3 -1
- package/dist/schema/modules/service/types/index.d.ts +1 -0
- package/dist/schema/modules/service/types/index.js +1 -0
- package/dist/schema/modules/service/types/service-management.d.ts +89 -0
- package/dist/schema/modules/service/types/service-management.js +66 -0
- package/dist/schema/schema.d.ts +1087 -908
- package/package.json +6 -7
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { classIcon, nodeClass, property } from '@astrale-os/sdk/schema';
|
|
2
2
|
import { CloudCog } from '@astrale-os/sdk/schema/icons';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { deleteWorkerSecret } from '../functions/delete-worker-secret.js';
|
|
5
|
+
import { deleteWorker } from '../functions/delete-worker.js';
|
|
4
6
|
import { deployCloudflareWorker } from '../functions/deploy-cloudflare-worker.js';
|
|
7
|
+
import { listWorkerLogs } from '../functions/list-worker-logs.js';
|
|
8
|
+
import { listWorkerSchedules } from '../functions/list-worker-schedules.js';
|
|
9
|
+
import { listWorkerSecretNames } from '../functions/list-worker-secret-names.js';
|
|
10
|
+
import { replaceWorkerSchedules } from '../functions/replace-worker-schedules.js';
|
|
11
|
+
import { setWorkerSecret } from '../functions/set-worker-secret.js';
|
|
5
12
|
import { OwnService } from '../policies/own-service.js';
|
|
6
13
|
import { Service } from './service.js';
|
|
7
14
|
export const CloudflareWorker = nodeClass({
|
|
@@ -17,6 +24,15 @@ export const CloudflareWorker = nodeClass({
|
|
|
17
24
|
tenantCertificatePackId: property(z.string().min(1).max(128), { required: false }),
|
|
18
25
|
tenantZoneId: property(z.string().min(1).max(128), { required: false }),
|
|
19
26
|
},
|
|
20
|
-
methods: {
|
|
27
|
+
methods: {
|
|
28
|
+
deploy: deployCloudflareWorker,
|
|
29
|
+
setSecret: setWorkerSecret,
|
|
30
|
+
deleteSecret: deleteWorkerSecret,
|
|
31
|
+
secrets: listWorkerSecretNames,
|
|
32
|
+
setSchedule: replaceWorkerSchedules,
|
|
33
|
+
schedules: listWorkerSchedules,
|
|
34
|
+
logs: listWorkerLogs,
|
|
35
|
+
delete: deleteWorker,
|
|
36
|
+
},
|
|
21
37
|
policies: { read: OwnService },
|
|
22
38
|
});
|
|
@@ -88,12 +88,12 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
88
88
|
}, {
|
|
89
89
|
readonly mode: 'value';
|
|
90
90
|
readonly value: {
|
|
91
|
-
name: string;
|
|
92
|
-
} | {
|
|
93
91
|
kind: "rejected";
|
|
94
92
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
93
|
+
} | {
|
|
94
|
+
name: string;
|
|
95
95
|
};
|
|
96
|
-
}, "authorized", false,
|
|
96
|
+
}, "authorized", false, true>>;
|
|
97
97
|
readonly deleteSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
98
98
|
name: string;
|
|
99
99
|
}, {
|
|
@@ -104,11 +104,11 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
104
104
|
} | {
|
|
105
105
|
ok: true;
|
|
106
106
|
};
|
|
107
|
-
}, "authorized", false,
|
|
107
|
+
}, "authorized", false, true>>;
|
|
108
108
|
readonly secrets: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
109
109
|
readonly mode: 'value';
|
|
110
110
|
readonly value: string[];
|
|
111
|
-
}, "authorized", false,
|
|
111
|
+
}, "authorized", false, true>>;
|
|
112
112
|
readonly setSchedule: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
113
113
|
crons: string[];
|
|
114
114
|
}, {
|
|
@@ -119,11 +119,11 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
119
119
|
kind: "rejected";
|
|
120
120
|
reason: "invalid-schedule" | "service-unavailable";
|
|
121
121
|
};
|
|
122
|
-
}, "authorized", false,
|
|
122
|
+
}, "authorized", false, true>>;
|
|
123
123
|
readonly schedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
124
124
|
readonly mode: 'value';
|
|
125
125
|
readonly value: string[];
|
|
126
|
-
}, "authorized", false,
|
|
126
|
+
}, "authorized", false, true>>;
|
|
127
127
|
readonly logs: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
128
128
|
tail?: number | undefined;
|
|
129
129
|
since?: number | undefined;
|
|
@@ -135,7 +135,7 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
135
135
|
level: string;
|
|
136
136
|
line: string;
|
|
137
137
|
}[];
|
|
138
|
-
}, "authorized", false,
|
|
138
|
+
}, "authorized", false, true>>;
|
|
139
139
|
readonly delete: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
140
140
|
readonly mode: 'value';
|
|
141
141
|
readonly value: {
|
|
@@ -144,7 +144,7 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
144
144
|
kind: "deleting";
|
|
145
145
|
retryAfterMs: number;
|
|
146
146
|
};
|
|
147
|
-
}, "authorized", false,
|
|
147
|
+
}, "authorized", false, true>>;
|
|
148
148
|
};
|
|
149
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<"deleting" | "deploying" | "failed" | "ready" | "reconciling", "deleting" | "deploying" | "failed" | "ready" | "reconciling", true, "state", "self", import("@astrale-os/sdk/state").StateTopology<{
|
|
150
150
|
readonly deploying: {
|
|
@@ -179,13 +179,13 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
179
179
|
readonly name: "updatedAt";
|
|
180
180
|
readonly key: "kernel.astrale.ai:class.Timestamped.property.updatedAt";
|
|
181
181
|
});
|
|
182
|
-
readonly
|
|
182
|
+
readonly abstractInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
183
183
|
readonly mode: 'value';
|
|
184
184
|
readonly value: string[];
|
|
185
|
-
}, "authorized", false,
|
|
185
|
+
}, "authorized", false, true>>, "schedules", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
186
186
|
readonly mode: 'value';
|
|
187
187
|
readonly value: string[];
|
|
188
|
-
}, "authorized", false,
|
|
188
|
+
}, "authorized", false, true>>, "secrets", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
189
189
|
readonly mode: 'value';
|
|
190
190
|
readonly value: {
|
|
191
191
|
kind: "deleted";
|
|
@@ -193,18 +193,29 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
193
193
|
kind: "deleting";
|
|
194
194
|
retryAfterMs: number;
|
|
195
195
|
};
|
|
196
|
-
}, "authorized", false,
|
|
196
|
+
}, "authorized", false, true>>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
197
|
+
tail?: number | undefined;
|
|
198
|
+
since?: number | undefined;
|
|
199
|
+
}, {
|
|
200
|
+
readonly mode: 'value';
|
|
201
|
+
readonly value: {
|
|
202
|
+
id: string;
|
|
203
|
+
ts: number;
|
|
204
|
+
level: string;
|
|
205
|
+
line: string;
|
|
206
|
+
}[];
|
|
207
|
+
}, "authorized", false, true>>, "logs", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
197
208
|
name: string;
|
|
198
209
|
value: string;
|
|
199
210
|
}, {
|
|
200
211
|
readonly mode: 'value';
|
|
201
212
|
readonly value: {
|
|
202
|
-
name: string;
|
|
203
|
-
} | {
|
|
204
213
|
kind: "rejected";
|
|
205
214
|
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
215
|
+
} | {
|
|
216
|
+
name: string;
|
|
206
217
|
};
|
|
207
|
-
}, "authorized", false,
|
|
218
|
+
}, "authorized", false, true>>, "setSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
208
219
|
name: string;
|
|
209
220
|
}, {
|
|
210
221
|
readonly mode: 'value';
|
|
@@ -214,7 +225,7 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
214
225
|
} | {
|
|
215
226
|
ok: true;
|
|
216
227
|
};
|
|
217
|
-
}, "authorized", false,
|
|
228
|
+
}, "authorized", false, true>>, "deleteSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
218
229
|
crons: string[];
|
|
219
230
|
}, {
|
|
220
231
|
readonly mode: 'value';
|
|
@@ -224,7 +235,23 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
224
235
|
kind: "rejected";
|
|
225
236
|
reason: "invalid-schedule" | "service-unavailable";
|
|
226
237
|
};
|
|
227
|
-
}, "authorized", false,
|
|
238
|
+
}, "authorized", false, true>>, "setSchedule", "self">;
|
|
239
|
+
readonly abstractStaticMethods: never;
|
|
240
|
+
readonly effectiveInstanceMethods: import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
241
|
+
readonly mode: 'value';
|
|
242
|
+
readonly value: string[];
|
|
243
|
+
}, "authorized", false, true>>, "schedules", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
244
|
+
readonly mode: 'value';
|
|
245
|
+
readonly value: string[];
|
|
246
|
+
}, "authorized", false, true>>, "secrets", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
247
|
+
readonly mode: 'value';
|
|
248
|
+
readonly value: {
|
|
249
|
+
kind: "deleted";
|
|
250
|
+
} | {
|
|
251
|
+
kind: "deleting";
|
|
252
|
+
retryAfterMs: number;
|
|
253
|
+
};
|
|
254
|
+
}, "authorized", false, true>>, "delete", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
228
255
|
tail?: number | undefined;
|
|
229
256
|
since?: number | undefined;
|
|
230
257
|
}, {
|
|
@@ -235,6 +262,37 @@ export declare const Service: import("@astrale-os/sdk/schema").NodeClass<{
|
|
|
235
262
|
level: string;
|
|
236
263
|
line: string;
|
|
237
264
|
}[];
|
|
238
|
-
}, "authorized", false,
|
|
265
|
+
}, "authorized", false, true>>, "logs", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
266
|
+
name: string;
|
|
267
|
+
value: string;
|
|
268
|
+
}, {
|
|
269
|
+
readonly mode: 'value';
|
|
270
|
+
readonly value: {
|
|
271
|
+
kind: "rejected";
|
|
272
|
+
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
273
|
+
} | {
|
|
274
|
+
name: string;
|
|
275
|
+
};
|
|
276
|
+
}, "authorized", false, true>>, "setSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
277
|
+
name: string;
|
|
278
|
+
}, {
|
|
279
|
+
readonly mode: 'value';
|
|
280
|
+
readonly value: {
|
|
281
|
+
kind: "rejected";
|
|
282
|
+
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
283
|
+
} | {
|
|
284
|
+
ok: true;
|
|
285
|
+
};
|
|
286
|
+
}, "authorized", false, true>>, "deleteSecret", "self"> | import("@astrale-os/sdk/schema").AuthoredMethodProjection<import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
287
|
+
crons: string[];
|
|
288
|
+
}, {
|
|
289
|
+
readonly mode: 'value';
|
|
290
|
+
readonly value: {
|
|
291
|
+
crons: string[];
|
|
292
|
+
} | {
|
|
293
|
+
kind: "rejected";
|
|
294
|
+
reason: "invalid-schedule" | "service-unavailable";
|
|
295
|
+
};
|
|
296
|
+
}, "authorized", false, true>>, "setSchedule", "self">;
|
|
239
297
|
readonly effectiveStaticMethods: never;
|
|
240
298
|
}>;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { secretName, secretOperationRejection } from '../types/index.js';
|
|
5
|
-
export const deleteServiceSecret = method({
|
|
6
|
-
description: 'Delete one write-only Service secret.',
|
|
7
|
-
auth: 'authorized',
|
|
8
|
-
policy: ({ check, self }) => check(OwnService, self),
|
|
9
|
-
input: z.strictObject({ name: secretName }),
|
|
10
|
-
output: z.union([z.strictObject({ ok: z.literal(true) }), secretOperationRejection]),
|
|
11
|
-
});
|
|
2
|
+
import { deleteServiceSecretContract } from '../types/service-management.js';
|
|
3
|
+
export const deleteServiceSecret = method({ ...deleteServiceSecretContract, abstract: true });
|
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export const deleteService = method({
|
|
5
|
-
description: 'Convergently delete provider resources and the owned Service without uninstalling consumers.',
|
|
6
|
-
auth: 'authorized',
|
|
7
|
-
policy: ({ check, self }) => check(OwnService, self),
|
|
8
|
-
input: z.strictObject({}),
|
|
9
|
-
output: z.discriminatedUnion('kind', [
|
|
10
|
-
z.strictObject({ kind: z.literal('deleted') }),
|
|
11
|
-
z.strictObject({
|
|
12
|
-
kind: z.literal('deleting'),
|
|
13
|
-
retryAfterMs: z.number().int().min(250).max(30_000),
|
|
14
|
-
}),
|
|
15
|
-
]),
|
|
16
|
-
});
|
|
2
|
+
import { deleteServiceContract } from '../types/service-management.js';
|
|
3
|
+
export const deleteService = method({ ...deleteServiceContract, abstract: true });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const deleteWorkerSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name: string;
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
ok: true;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "rejected";
|
|
9
|
+
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
10
|
+
};
|
|
11
|
+
}, "authorized", false, false>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { OwnService } from '../policies/own-service.js';
|
|
3
|
+
import { deleteServiceSecretContract } from '../types/service-management.js';
|
|
4
|
+
export const deleteWorkerSecret = method({
|
|
5
|
+
...deleteServiceSecretContract,
|
|
6
|
+
policy: ({ check, self }) => check(OwnService, self),
|
|
7
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const deleteWorker: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
|
|
2
|
+
readonly mode: 'value';
|
|
3
|
+
readonly value: {
|
|
4
|
+
kind: "deleted";
|
|
5
|
+
} | {
|
|
6
|
+
kind: "deleting";
|
|
7
|
+
retryAfterMs: number;
|
|
8
|
+
};
|
|
9
|
+
}, "authorized", false, false>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { OwnService } from '../policies/own-service.js';
|
|
3
|
+
import { deleteServiceContract } from '../types/service-management.js';
|
|
4
|
+
export const deleteWorker = method({
|
|
5
|
+
...deleteServiceContract,
|
|
6
|
+
policy: ({ check, self }) => check(OwnService, self),
|
|
7
|
+
});
|
|
@@ -70,4 +70,4 @@ export declare const deployCloudflareWorker: import("@astrale-os/sdk/schema").Me
|
|
|
70
70
|
reason: "artifact-mode-conflict" | "invalid-deployment" | "service-unavailable";
|
|
71
71
|
message: string;
|
|
72
72
|
};
|
|
73
|
-
}, "authenticated", true,
|
|
73
|
+
}, "authenticated", true, false>>;
|
|
@@ -6,3 +6,10 @@ export { listServiceSchedules } from './list-service-schedules.js';
|
|
|
6
6
|
export { listServiceSecretNames } from './list-service-secret-names.js';
|
|
7
7
|
export { replaceServiceSchedules } from './replace-service-schedules.js';
|
|
8
8
|
export { setServiceSecret } from './set-service-secret.js';
|
|
9
|
+
export { deleteWorkerSecret } from './delete-worker-secret.js';
|
|
10
|
+
export { deleteWorker } from './delete-worker.js';
|
|
11
|
+
export { listWorkerLogs } from './list-worker-logs.js';
|
|
12
|
+
export { listWorkerSchedules } from './list-worker-schedules.js';
|
|
13
|
+
export { listWorkerSecretNames } from './list-worker-secret-names.js';
|
|
14
|
+
export { replaceWorkerSchedules } from './replace-worker-schedules.js';
|
|
15
|
+
export { setWorkerSecret } from './set-worker-secret.js';
|
|
@@ -6,3 +6,10 @@ export { listServiceSchedules } from './list-service-schedules.js';
|
|
|
6
6
|
export { listServiceSecretNames } from './list-service-secret-names.js';
|
|
7
7
|
export { replaceServiceSchedules } from './replace-service-schedules.js';
|
|
8
8
|
export { setServiceSecret } from './set-service-secret.js';
|
|
9
|
+
export { deleteWorkerSecret } from './delete-worker-secret.js';
|
|
10
|
+
export { deleteWorker } from './delete-worker.js';
|
|
11
|
+
export { listWorkerLogs } from './list-worker-logs.js';
|
|
12
|
+
export { listWorkerSchedules } from './list-worker-schedules.js';
|
|
13
|
+
export { listWorkerSecretNames } from './list-worker-secret-names.js';
|
|
14
|
+
export { replaceWorkerSchedules } from './replace-worker-schedules.js';
|
|
15
|
+
export { setWorkerSecret } from './set-worker-secret.js';
|
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export const listServiceLogs = method({
|
|
5
|
-
description: 'Read recent Service runtime logs.',
|
|
6
|
-
auth: 'authorized',
|
|
7
|
-
policy: ({ check, self }) => check(OwnService, self),
|
|
8
|
-
input: z.strictObject({
|
|
9
|
-
tail: z.number().int().min(1).max(1_000).optional(),
|
|
10
|
-
since: z.number().int().min(0).optional(),
|
|
11
|
-
}),
|
|
12
|
-
output: z.array(z.strictObject({ id: z.string(), ts: z.number(), level: z.string(), line: z.string() })),
|
|
13
|
-
});
|
|
2
|
+
import { listServiceLogsContract } from '../types/service-management.js';
|
|
3
|
+
export const listServiceLogs = method({ ...listServiceLogsContract, abstract: true });
|
|
@@ -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,
|
|
4
|
+
}, "authorized", false, true>>;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export const listServiceSchedules = method({
|
|
5
|
-
description: 'List active Service cron expressions.',
|
|
6
|
-
auth: 'authorized',
|
|
7
|
-
policy: ({ check, self }) => check(OwnService, self),
|
|
8
|
-
input: z.strictObject({}),
|
|
9
|
-
output: z.array(z.string()),
|
|
10
|
-
});
|
|
2
|
+
import { listServiceSchedulesContract } from '../types/service-management.js';
|
|
3
|
+
export const listServiceSchedules = method({ ...listServiceSchedulesContract, abstract: true });
|
|
@@ -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,
|
|
4
|
+
}, "authorized", false, true>>;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { secretName } from '../types/index.js';
|
|
5
|
-
export const listServiceSecretNames = method({
|
|
6
|
-
description: 'List write-only Service secret names without exposing values.',
|
|
7
|
-
auth: 'authorized',
|
|
8
|
-
policy: ({ check, self }) => check(OwnService, self),
|
|
9
|
-
input: z.strictObject({}),
|
|
10
|
-
output: z.array(secretName),
|
|
11
|
-
});
|
|
2
|
+
import { listServiceSecretNamesContract } from '../types/service-management.js';
|
|
3
|
+
export const listServiceSecretNames = method({ ...listServiceSecretNamesContract, abstract: true });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const listWorkerLogs: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
tail?: number | undefined;
|
|
3
|
+
since?: number | undefined;
|
|
4
|
+
}, {
|
|
5
|
+
readonly mode: 'value';
|
|
6
|
+
readonly value: {
|
|
7
|
+
id: string;
|
|
8
|
+
ts: number;
|
|
9
|
+
level: string;
|
|
10
|
+
line: string;
|
|
11
|
+
}[];
|
|
12
|
+
}, "authorized", false, false>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { OwnService } from '../policies/own-service.js';
|
|
3
|
+
import { listServiceLogsContract } from '../types/service-management.js';
|
|
4
|
+
export const listWorkerLogs = method({
|
|
5
|
+
...listServiceLogsContract,
|
|
6
|
+
policy: ({ check, self }) => check(OwnService, self),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { OwnService } from '../policies/own-service.js';
|
|
3
|
+
import { listServiceSchedulesContract } from '../types/service-management.js';
|
|
4
|
+
export const listWorkerSchedules = method({
|
|
5
|
+
...listServiceSchedulesContract,
|
|
6
|
+
policy: ({ check, self }) => check(OwnService, self),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { OwnService } from '../policies/own-service.js';
|
|
3
|
+
import { listServiceSecretNamesContract } from '../types/service-management.js';
|
|
4
|
+
export const listWorkerSecretNames = method({
|
|
5
|
+
...listServiceSecretNamesContract,
|
|
6
|
+
policy: ({ check, self }) => check(OwnService, self),
|
|
7
|
+
});
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
import { OwnService } from '../policies/own-service.js';
|
|
2
|
+
import { replaceServiceSchedulesContract } from '../types/service-management.js';
|
|
4
3
|
export const replaceServiceSchedules = method({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
policy: ({ check, self }) => check(OwnService, self),
|
|
8
|
-
input: z.strictObject({ crons: z.array(z.string()).max(24) }),
|
|
9
|
-
output: z.union([
|
|
10
|
-
z.strictObject({ crons: z.array(z.string()) }),
|
|
11
|
-
z.strictObject({
|
|
12
|
-
kind: z.literal('rejected'),
|
|
13
|
-
reason: z.enum(['invalid-schedule', 'service-unavailable']),
|
|
14
|
-
}),
|
|
15
|
-
]),
|
|
4
|
+
...replaceServiceSchedulesContract,
|
|
5
|
+
abstract: true,
|
|
16
6
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const replaceWorkerSchedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
crons: string[];
|
|
3
|
+
}, {
|
|
4
|
+
readonly mode: 'value';
|
|
5
|
+
readonly value: {
|
|
6
|
+
crons: string[];
|
|
7
|
+
} | {
|
|
8
|
+
kind: "rejected";
|
|
9
|
+
reason: "invalid-schedule" | "service-unavailable";
|
|
10
|
+
};
|
|
11
|
+
}, "authorized", false, false>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { OwnService } from '../policies/own-service.js';
|
|
3
|
+
import { replaceServiceSchedulesContract } from '../types/service-management.js';
|
|
4
|
+
export const replaceWorkerSchedules = method({
|
|
5
|
+
...replaceServiceSchedulesContract,
|
|
6
|
+
policy: ({ check, self }) => check(OwnService, self),
|
|
7
|
+
});
|
|
@@ -4,9 +4,9 @@ export declare const setServiceSecret: import("@astrale-os/sdk/schema").Method<i
|
|
|
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,
|
|
12
|
+
}, "authorized", false, true>>;
|
|
@@ -1,17 +1,3 @@
|
|
|
1
1
|
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { secretName, secretOperationRejection } from '../types/index.js';
|
|
5
|
-
export const setServiceSecret = method({
|
|
6
|
-
description: 'Set one write-only Service secret.',
|
|
7
|
-
auth: 'authorized',
|
|
8
|
-
policy: ({ check, self }) => check(OwnService, self),
|
|
9
|
-
input: z.strictObject({
|
|
10
|
-
name: secretName,
|
|
11
|
-
value: z
|
|
12
|
-
.string()
|
|
13
|
-
.min(1)
|
|
14
|
-
.max(64 * 1024),
|
|
15
|
-
}),
|
|
16
|
-
output: z.union([z.strictObject({ name: secretName }), secretOperationRejection]),
|
|
17
|
-
});
|
|
2
|
+
import { setServiceSecretContract } from '../types/service-management.js';
|
|
3
|
+
export const setServiceSecret = method({ ...setServiceSecretContract, abstract: true });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const setWorkerSecret: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<{
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}, {
|
|
5
|
+
readonly mode: 'value';
|
|
6
|
+
readonly value: {
|
|
7
|
+
kind: "rejected";
|
|
8
|
+
reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
|
|
9
|
+
} | {
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
}, "authorized", false, false>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { method } from '@astrale-os/sdk/schema';
|
|
2
|
+
import { OwnService } from '../policies/own-service.js';
|
|
3
|
+
import { setServiceSecretContract } from '../types/service-management.js';
|
|
4
|
+
export const setWorkerSecret = method({
|
|
5
|
+
...setServiceSecretContract,
|
|
6
|
+
policy: ({ check, self }) => check(OwnService, self),
|
|
7
|
+
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { artifactModule
|
|
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';
|
|
3
5
|
import { serviceReadiness } from './service-readiness.js';
|
|
4
6
|
export const artifact = z.strictObject({
|
|
5
7
|
entry: z.string().min(1).max(256),
|
|
@@ -10,3 +10,4 @@ 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
|
+
export { setServiceSecretContract, deleteServiceSecretContract, listServiceSecretNamesContract, replaceServiceSchedulesContract, listServiceSchedulesContract, listServiceLogsContract, deleteServiceContract, } from './service-management.js';
|
|
@@ -6,3 +6,4 @@ 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';
|
|
8
8
|
export { serviceReadiness } from './service-readiness.js';
|
|
9
|
+
export { setServiceSecretContract, deleteServiceSecretContract, listServiceSecretNamesContract, replaceServiceSchedulesContract, listServiceSchedulesContract, listServiceLogsContract, deleteServiceContract, } from './service-management.js';
|