@astrale-domains/services 0.3.4 → 0.4.1

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 (45) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +14 -0
  3. package/dist/schema/modules/service/classes/cloudflare-worker.d.ts +592 -6294
  4. package/dist/schema/modules/service/classes/cloudflare-worker.js +17 -1
  5. package/dist/schema/modules/service/classes/service.d.ts +405 -137
  6. package/dist/schema/modules/service/functions/delete-service-secret.d.ts +1 -1
  7. package/dist/schema/modules/service/functions/delete-service-secret.js +2 -10
  8. package/dist/schema/modules/service/functions/delete-service.d.ts +1 -1
  9. package/dist/schema/modules/service/functions/delete-service.js +2 -15
  10. package/dist/schema/modules/service/functions/delete-worker-secret.d.ts +11 -0
  11. package/dist/schema/modules/service/functions/delete-worker-secret.js +7 -0
  12. package/dist/schema/modules/service/functions/delete-worker.d.ts +9 -0
  13. package/dist/schema/modules/service/functions/delete-worker.js +7 -0
  14. package/dist/schema/modules/service/functions/deploy-cloudflare-worker.d.ts +1 -1
  15. package/dist/schema/modules/service/functions/index.d.ts +7 -0
  16. package/dist/schema/modules/service/functions/index.js +7 -0
  17. package/dist/schema/modules/service/functions/list-service-logs.d.ts +1 -1
  18. package/dist/schema/modules/service/functions/list-service-logs.js +2 -12
  19. package/dist/schema/modules/service/functions/list-service-schedules.d.ts +1 -1
  20. package/dist/schema/modules/service/functions/list-service-schedules.js +2 -9
  21. package/dist/schema/modules/service/functions/list-service-secret-names.d.ts +1 -1
  22. package/dist/schema/modules/service/functions/list-service-secret-names.js +2 -10
  23. package/dist/schema/modules/service/functions/list-worker-logs.d.ts +12 -0
  24. package/dist/schema/modules/service/functions/list-worker-logs.js +7 -0
  25. package/dist/schema/modules/service/functions/list-worker-schedules.d.ts +4 -0
  26. package/dist/schema/modules/service/functions/list-worker-schedules.js +7 -0
  27. package/dist/schema/modules/service/functions/list-worker-secret-names.d.ts +4 -0
  28. package/dist/schema/modules/service/functions/list-worker-secret-names.js +7 -0
  29. package/dist/schema/modules/service/functions/replace-service-schedules.d.ts +1 -1
  30. package/dist/schema/modules/service/functions/replace-service-schedules.js +3 -13
  31. package/dist/schema/modules/service/functions/replace-worker-schedules.d.ts +11 -0
  32. package/dist/schema/modules/service/functions/replace-worker-schedules.js +7 -0
  33. package/dist/schema/modules/service/functions/set-service-secret.d.ts +3 -3
  34. package/dist/schema/modules/service/functions/set-service-secret.js +2 -16
  35. package/dist/schema/modules/service/functions/set-worker-secret.d.ts +12 -0
  36. package/dist/schema/modules/service/functions/set-worker-secret.js +7 -0
  37. package/dist/schema/modules/service/states/service-lifecycle.d.ts +1 -0
  38. package/dist/schema/modules/service/states/service-lifecycle.js +1 -0
  39. package/dist/schema/modules/service/types/deploy-cloudflare-worker.js +3 -1
  40. package/dist/schema/modules/service/types/index.d.ts +1 -0
  41. package/dist/schema/modules/service/types/index.js +1 -0
  42. package/dist/schema/modules/service/types/service-management.d.ts +89 -0
  43. package/dist/schema/modules/service/types/service-management.js +66 -0
  44. package/dist/schema/schema.d.ts +1073 -6515
  45. package/package.json +6 -7
@@ -8,4 +8,4 @@ export declare const deleteServiceSecret: import("@astrale-os/sdk/schema").Metho
8
8
  kind: "rejected";
9
9
  reason: "binding-unavailable" | "invalid-secret-name" | "service-unavailable";
10
10
  };
11
- }, "authorized", false, "default">>;
11
+ }, "authorized", false, true>>;
@@ -1,11 +1,3 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { OwnService } from '../policies/own-service.js';
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 });
@@ -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
- }, "authorized", false, "default">>;
9
+ }, "authorized", false, true>>;
@@ -1,16 +1,3 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { OwnService } from '../policies/own-service.js';
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, "default">>;
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';
@@ -9,4 +9,4 @@ export declare const listServiceLogs: import("@astrale-os/sdk/schema").Method<im
9
9
  level: string;
10
10
  line: string;
11
11
  }[];
12
- }, "authorized", false, "default">>;
12
+ }, "authorized", false, true>>;
@@ -1,13 +1,3 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { OwnService } from '../policies/own-service.js';
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, "default">>;
4
+ }, "authorized", false, true>>;
@@ -1,10 +1,3 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { OwnService } from '../policies/own-service.js';
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, "default">>;
4
+ }, "authorized", false, true>>;
@@ -1,11 +1,3 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { OwnService } from '../policies/own-service.js';
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,4 @@
1
+ export declare const listWorkerSchedules: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
+ readonly mode: 'value';
3
+ readonly value: string[];
4
+ }, "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 { listServiceSchedulesContract } from '../types/service-management.js';
4
+ export const listWorkerSchedules = method({
5
+ ...listServiceSchedulesContract,
6
+ policy: ({ check, self }) => check(OwnService, self),
7
+ });
@@ -0,0 +1,4 @@
1
+ export declare const listWorkerSecretNames: import("@astrale-os/sdk/schema").Method<import("@astrale-os/sdk/schema").CallableProjection<Record<string, never>, {
2
+ readonly mode: 'value';
3
+ readonly value: string[];
4
+ }, "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 { listServiceSecretNamesContract } from '../types/service-management.js';
4
+ export const listWorkerSecretNames = method({
5
+ ...listServiceSecretNamesContract,
6
+ policy: ({ check, self }) => check(OwnService, self),
7
+ });
@@ -8,4 +8,4 @@ export declare const replaceServiceSchedules: import("@astrale-os/sdk/schema").M
8
8
  kind: "rejected";
9
9
  reason: "invalid-schedule" | "service-unavailable";
10
10
  };
11
- }, "authorized", false, "default">>;
11
+ }, "authorized", false, true>>;
@@ -1,16 +1,6 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { OwnService } from '../policies/own-service.js';
2
+ import { replaceServiceSchedulesContract } from '../types/service-management.js';
4
3
  export const replaceServiceSchedules = method({
5
- description: 'Replace the complete Service cron set.',
6
- auth: 'authorized',
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, "default">>;
12
+ }, "authorized", false, true>>;
@@ -1,17 +1,3 @@
1
1
  import { method } from '@astrale-os/sdk/schema';
2
- import { z } from 'zod';
3
- import { OwnService } from '../policies/own-service.js';
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
+ });
@@ -4,6 +4,7 @@ export declare const serviceLifecycle: import("@astrale-os/sdk/schema").StateMac
4
4
  readonly deploying: {
5
5
  readonly recordProviderDeployment: "reconciling";
6
6
  readonly failDeployment: "failed";
7
+ readonly rejectDeployment: "ready";
7
8
  readonly deleteService: "deleting";
8
9
  };
9
10
  readonly reconciling: {
@@ -6,6 +6,7 @@ export const serviceLifecycle = stateMachine({
6
6
  deploying: {
7
7
  recordProviderDeployment: 'reconciling',
8
8
  failDeployment: 'failed',
9
+ rejectDeployment: 'ready',
9
10
  deleteService: 'deleting',
10
11
  },
11
12
  reconciling: {
@@ -1,5 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { artifactModule, assetBundle, resourceLimits } from '../types/index.js';
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';
@@ -0,0 +1,89 @@
1
+ import { z } from 'zod';
2
+ export declare const setServiceSecretContract: {
3
+ readonly description: 'Set one write-only Service secret.';
4
+ readonly auth: 'authorized';
5
+ readonly input: z.ZodObject<{
6
+ name: z.ZodString;
7
+ value: z.ZodString;
8
+ }, z.core.$strict>;
9
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
10
+ name: z.ZodString;
11
+ }, z.core.$strict>, z.ZodObject<{
12
+ kind: z.ZodLiteral<"rejected">;
13
+ reason: z.ZodEnum<{
14
+ "binding-unavailable": "binding-unavailable";
15
+ "invalid-secret-name": "invalid-secret-name";
16
+ "service-unavailable": "service-unavailable";
17
+ }>;
18
+ }, z.core.$strict>]>;
19
+ };
20
+ export declare const deleteServiceSecretContract: {
21
+ readonly description: 'Delete one write-only Service secret.';
22
+ readonly auth: 'authorized';
23
+ readonly input: z.ZodObject<{
24
+ name: z.ZodString;
25
+ }, z.core.$strict>;
26
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
27
+ ok: z.ZodLiteral<true>;
28
+ }, z.core.$strict>, z.ZodObject<{
29
+ kind: z.ZodLiteral<"rejected">;
30
+ reason: z.ZodEnum<{
31
+ "binding-unavailable": "binding-unavailable";
32
+ "invalid-secret-name": "invalid-secret-name";
33
+ "service-unavailable": "service-unavailable";
34
+ }>;
35
+ }, z.core.$strict>]>;
36
+ };
37
+ export declare const listServiceSecretNamesContract: {
38
+ readonly description: 'List write-only Service secret names without exposing values.';
39
+ readonly auth: 'authorized';
40
+ readonly input: z.ZodObject<{}, z.core.$strict>;
41
+ readonly output: z.ZodArray<z.ZodString>;
42
+ };
43
+ export declare const replaceServiceSchedulesContract: {
44
+ readonly description: 'Replace the complete Service cron set.';
45
+ readonly auth: 'authorized';
46
+ readonly input: z.ZodObject<{
47
+ crons: z.ZodArray<z.ZodString>;
48
+ }, z.core.$strict>;
49
+ readonly output: z.ZodUnion<readonly [z.ZodObject<{
50
+ crons: z.ZodArray<z.ZodString>;
51
+ }, z.core.$strict>, z.ZodObject<{
52
+ kind: z.ZodLiteral<"rejected">;
53
+ reason: z.ZodEnum<{
54
+ "invalid-schedule": "invalid-schedule";
55
+ "service-unavailable": "service-unavailable";
56
+ }>;
57
+ }, z.core.$strict>]>;
58
+ };
59
+ export declare const listServiceSchedulesContract: {
60
+ readonly description: 'List active Service cron expressions.';
61
+ readonly auth: 'authorized';
62
+ readonly input: z.ZodObject<{}, z.core.$strict>;
63
+ readonly output: z.ZodArray<z.ZodString>;
64
+ };
65
+ export declare const listServiceLogsContract: {
66
+ readonly description: 'Read recent Service runtime logs.';
67
+ readonly auth: 'authorized';
68
+ readonly input: z.ZodObject<{
69
+ tail: z.ZodOptional<z.ZodNumber>;
70
+ since: z.ZodOptional<z.ZodNumber>;
71
+ }, z.core.$strict>;
72
+ readonly output: z.ZodArray<z.ZodObject<{
73
+ id: z.ZodString;
74
+ ts: z.ZodNumber;
75
+ level: z.ZodString;
76
+ line: z.ZodString;
77
+ }, z.core.$strict>>;
78
+ };
79
+ export declare const deleteServiceContract: {
80
+ readonly description: 'Convergently delete provider resources and the owned Service without uninstalling consumers.';
81
+ readonly auth: 'authorized';
82
+ readonly input: z.ZodObject<{}, z.core.$strict>;
83
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
84
+ kind: z.ZodLiteral<"deleted">;
85
+ }, z.core.$strict>, z.ZodObject<{
86
+ kind: z.ZodLiteral<"deleting">;
87
+ retryAfterMs: z.ZodNumber;
88
+ }, z.core.$strict>], "kind">;
89
+ };
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ import { secretName } from './service-secret-name.js';
3
+ import { secretOperationRejection } from './service-secret-operation-rejection.js';
4
+ export const setServiceSecretContract = {
5
+ description: 'Set one write-only Service secret.',
6
+ auth: 'authorized',
7
+ input: z.strictObject({
8
+ name: secretName,
9
+ value: z
10
+ .string()
11
+ .min(1)
12
+ .max(64 * 1024),
13
+ }),
14
+ output: z.union([z.strictObject({ name: secretName }), secretOperationRejection]),
15
+ };
16
+ export const deleteServiceSecretContract = {
17
+ description: 'Delete one write-only Service secret.',
18
+ auth: 'authorized',
19
+ input: z.strictObject({ name: secretName }),
20
+ output: z.union([z.strictObject({ ok: z.literal(true) }), secretOperationRejection]),
21
+ };
22
+ export const listServiceSecretNamesContract = {
23
+ description: 'List write-only Service secret names without exposing values.',
24
+ auth: 'authorized',
25
+ input: z.strictObject({}),
26
+ output: z.array(secretName),
27
+ };
28
+ export const replaceServiceSchedulesContract = {
29
+ description: 'Replace the complete Service cron set.',
30
+ auth: 'authorized',
31
+ input: z.strictObject({ crons: z.array(z.string()).max(24) }),
32
+ output: z.union([
33
+ z.strictObject({ crons: z.array(z.string()) }),
34
+ z.strictObject({
35
+ kind: z.literal('rejected'),
36
+ reason: z.enum(['invalid-schedule', 'service-unavailable']),
37
+ }),
38
+ ]),
39
+ };
40
+ export const listServiceSchedulesContract = {
41
+ description: 'List active Service cron expressions.',
42
+ auth: 'authorized',
43
+ input: z.strictObject({}),
44
+ output: z.array(z.string()),
45
+ };
46
+ export const listServiceLogsContract = {
47
+ description: 'Read recent Service runtime logs.',
48
+ auth: 'authorized',
49
+ input: z.strictObject({
50
+ tail: z.number().int().min(1).max(1_000).optional(),
51
+ since: z.number().int().min(0).optional(),
52
+ }),
53
+ output: z.array(z.strictObject({ id: z.string(), ts: z.number(), level: z.string(), line: z.string() })),
54
+ };
55
+ export const deleteServiceContract = {
56
+ description: 'Convergently delete provider resources and the owned Service without uninstalling consumers.',
57
+ auth: 'authorized',
58
+ input: z.strictObject({}),
59
+ output: z.discriminatedUnion('kind', [
60
+ z.strictObject({ kind: z.literal('deleted') }),
61
+ z.strictObject({
62
+ kind: z.literal('deleting'),
63
+ retryAfterMs: z.number().int().min(250).max(30_000),
64
+ }),
65
+ ]),
66
+ };