@figulus/schema 0.4.0-alpha-dev → 0.5.0-alpha-dev-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.
- package/.openapi-meta/index.ts +12 -0
- package/dist/core/entities/figspec.d.ts +659 -0
- package/dist/core/entities/figspec.d.ts.map +1 -0
- package/dist/core/entities/figspec.js +73 -0
- package/dist/core/entities/figspec.js.map +1 -0
- package/dist/core/entities/figstack.d.ts +139 -0
- package/dist/core/entities/figstack.d.ts.map +1 -0
- package/dist/core/entities/figstack.js +79 -0
- package/dist/core/entities/figstack.js.map +1 -0
- package/dist/core/entities/index.d.ts +3 -0
- package/dist/core/entities/index.d.ts.map +1 -0
- package/dist/core/entities/index.js +3 -0
- package/dist/core/entities/index.js.map +1 -0
- package/dist/core/execute.d.ts +64 -0
- package/dist/core/execute.d.ts.map +1 -0
- package/dist/core/execute.js +45 -0
- package/dist/core/execute.js.map +1 -0
- package/dist/core/generic.d.ts +35 -0
- package/dist/core/generic.d.ts.map +1 -0
- package/dist/core/generic.js +28 -0
- package/dist/core/generic.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/primitives.d.ts +3 -0
- package/dist/core/primitives.d.ts.map +1 -0
- package/dist/core/primitives.js +11 -0
- package/dist/core/primitives.js.map +1 -0
- package/dist/core/volumes.d.ts +160 -0
- package/dist/core/volumes.d.ts.map +1 -0
- package/dist/core/volumes.js +100 -0
- package/dist/core/volumes.js.map +1 -0
- package/dist/engine/deprecated/index.d.ts +2 -0
- package/dist/engine/deprecated/index.d.ts.map +1 -0
- package/dist/engine/deprecated/index.js +2 -0
- package/dist/engine/deprecated/index.js.map +1 -0
- package/dist/engine/deprecated/run-request.d.ts +73 -0
- package/dist/engine/deprecated/run-request.d.ts.map +1 -0
- package/dist/engine/deprecated/run-request.js +47 -0
- package/dist/engine/deprecated/run-request.js.map +1 -0
- package/dist/engine/dry-run.d.ts +15 -0
- package/dist/engine/dry-run.d.ts.map +1 -0
- package/dist/engine/dry-run.js +12 -0
- package/dist/engine/dry-run.js.map +1 -0
- package/dist/engine/health.d.ts +11 -0
- package/dist/engine/health.d.ts.map +1 -0
- package/dist/engine/health.js +9 -0
- package/dist/engine/health.js.map +1 -0
- package/dist/engine/images.d.ts +49 -0
- package/dist/engine/images.d.ts.map +1 -0
- package/dist/engine/images.js +44 -0
- package/dist/engine/images.js.map +1 -0
- package/dist/engine/index.d.ts +9 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +9 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/paths/containers.d.ts +8 -0
- package/dist/engine/paths/containers.d.ts.map +1 -0
- package/dist/engine/paths/containers.js +297 -0
- package/dist/engine/paths/containers.js.map +1 -0
- package/dist/engine/paths/dry-run.d.ts +3 -0
- package/dist/engine/paths/dry-run.d.ts.map +1 -0
- package/dist/engine/paths/dry-run.js +43 -0
- package/dist/engine/paths/dry-run.js.map +1 -0
- package/dist/engine/paths/health.d.ts +3 -0
- package/dist/engine/paths/health.d.ts.map +1 -0
- package/dist/engine/paths/health.js +36 -0
- package/dist/engine/paths/health.js.map +1 -0
- package/dist/engine/paths/images.d.ts +5 -0
- package/dist/engine/paths/images.d.ts.map +1 -0
- package/dist/engine/paths/images.js +144 -0
- package/dist/engine/paths/images.js.map +1 -0
- package/dist/engine/paths/index.d.ts +8 -0
- package/dist/engine/paths/index.d.ts.map +1 -0
- package/dist/engine/paths/index.js +8 -0
- package/dist/engine/paths/index.js.map +1 -0
- package/dist/engine/paths/sessions.d.ts +10 -0
- package/dist/engine/paths/sessions.d.ts.map +1 -0
- package/dist/engine/paths/sessions.js +484 -0
- package/dist/engine/paths/sessions.js.map +1 -0
- package/dist/engine/paths/stacks.d.ts +6 -0
- package/dist/engine/paths/stacks.d.ts.map +1 -0
- package/dist/engine/paths/stacks.js +175 -0
- package/dist/engine/paths/stacks.js.map +1 -0
- package/dist/engine/paths/volumes.d.ts +6 -0
- package/dist/engine/paths/volumes.d.ts.map +1 -0
- package/dist/engine/paths/volumes.js +164 -0
- package/dist/engine/paths/volumes.js.map +1 -0
- package/dist/engine/response.d.ts +8 -0
- package/dist/engine/response.d.ts.map +1 -0
- package/dist/engine/response.js +9 -0
- package/dist/engine/response.js.map +1 -0
- package/dist/engine/sessions.d.ts +343 -0
- package/dist/engine/sessions.d.ts.map +1 -0
- package/dist/engine/sessions.js +118 -0
- package/dist/engine/sessions.js.map +1 -0
- package/dist/engine/volumes.d.ts +52 -0
- package/dist/engine/volumes.d.ts.map +1 -0
- package/dist/engine/volumes.js +39 -0
- package/dist/engine/volumes.js.map +1 -0
- package/dist/index.d.ts +2 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +3 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/json-schema.d.ts +82 -0
- package/dist/registry/json-schema.d.ts.map +1 -0
- package/dist/registry/json-schema.js +149 -0
- package/dist/registry/json-schema.js.map +1 -0
- package/dist/registry/metadata.d.ts +216 -0
- package/dist/registry/metadata.d.ts.map +1 -0
- package/dist/registry/metadata.js +143 -0
- package/dist/registry/metadata.js.map +1 -0
- package/package.json +10 -3
- package/scripts/fix-openapi-3.1.ts +183 -0
- package/scripts/generate-openapi-data.ts +51 -0
- package/scripts/generate-openapi-meta.ts +540 -0
- package/src/core/entities/figspec.ts +94 -0
- package/src/core/entities/figstack.ts +101 -0
- package/src/core/entities/index.ts +2 -0
- package/src/core/execute.ts +66 -0
- package/src/core/generic.ts +38 -0
- package/src/core/index.ts +5 -0
- package/src/core/primitives.ts +12 -0
- package/src/core/volumes.ts +124 -0
- package/src/engine/deprecated/index.ts +1 -0
- package/src/engine/deprecated/run-request.ts +53 -0
- package/src/engine/dry-run.ts +14 -0
- package/src/engine/health.ts +11 -0
- package/src/engine/images.ts +58 -0
- package/src/engine/index.ts +8 -0
- package/src/engine/paths/containers.ts +304 -0
- package/src/engine/paths/dry-run.ts +44 -0
- package/src/engine/paths/health.ts +37 -0
- package/src/engine/paths/images.ts +148 -0
- package/src/engine/paths/index.ts +7 -0
- package/src/engine/paths/sessions.ts +493 -0
- package/src/engine/paths/stacks.ts +179 -0
- package/src/engine/paths/volumes.ts +168 -0
- package/src/engine/response.ts +11 -0
- package/src/engine/sessions.ts +146 -0
- package/src/engine/volumes.ts +53 -0
- package/src/index.ts +2 -8
- package/src/registry/index.ts +2 -0
- package/src/registry/json-schema.ts +178 -0
- package/src/registry/metadata.ts +181 -0
- package/tests/figspec.test.ts +1 -1
- package/tests/schemas.test.ts +31 -31
- package/dist/figspec.d.ts +0 -4394
- package/dist/figspec.d.ts.map +0 -1
- package/dist/figspec.js +0 -214
- package/dist/figspec.js.map +0 -1
- package/dist/figstack.d.ts +0 -419
- package/dist/figstack.d.ts.map +0 -1
- package/dist/figstack.js +0 -72
- package/dist/figstack.js.map +0 -1
- package/dist/health.d.ts +0 -16
- package/dist/health.d.ts.map +0 -1
- package/dist/health.js +0 -7
- package/dist/health.js.map +0 -1
- package/dist/image.d.ts +0 -115
- package/dist/image.d.ts.map +0 -1
- package/dist/image.js +0 -42
- package/dist/image.js.map +0 -1
- package/dist/run-request.d.ts +0 -244
- package/dist/run-request.d.ts.map +0 -1
- package/dist/run-request.js +0 -43
- package/dist/run-request.js.map +0 -1
- package/dist/session.d.ts +0 -447
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -78
- package/dist/session.js.map +0 -1
- package/dist/shared.d.ts +0 -90
- package/dist/shared.d.ts.map +0 -1
- package/dist/shared.js +0 -41
- package/dist/shared.js.map +0 -1
- package/dist/volume.d.ts +0 -140
- package/dist/volume.d.ts.map +0 -1
- package/dist/volume.js +0 -37
- package/dist/volume.js.map +0 -1
- package/src/figspec.ts +0 -279
- package/src/figstack.ts +0 -92
- package/src/health.ts +0 -8
- package/src/image.ts +0 -55
- package/src/run-request.ts +0 -55
- package/src/session.ts +0 -101
- package/src/shared.ts +0 -56
- package/src/volume.ts +0 -50
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volumes.d.ts","sourceRoot":"","sources":["../../../src/engine/paths/volumes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D,eAAO,MAAM,uBAAuB,EAAE,WA8CrC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,WA2BpC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,WA8CrC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,WAsCrC,CAAC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { deleteVolumeResponseSchema, ensureVolumeRequestSchema, ensureVolumeResponseSchema, listVolumesResponseSchema, pruneVolumesRequestSchema, pruneVolumesResponseSchema } from "../volumes.js";
|
|
2
|
+
import { errorResponseSchema } from "../response.js";
|
|
3
|
+
export const ensureVolumeRouteSchema = {
|
|
4
|
+
method: "post",
|
|
5
|
+
path: "/api/v1/volumes/ensure",
|
|
6
|
+
operationId: "ensureVolume",
|
|
7
|
+
summary: "Ensure a Docker volume exists",
|
|
8
|
+
description: "Creates the volume if it does not exist; no-ops if it does.",
|
|
9
|
+
tags: [
|
|
10
|
+
"volumes"
|
|
11
|
+
],
|
|
12
|
+
request: {
|
|
13
|
+
body: {
|
|
14
|
+
description: undefined,
|
|
15
|
+
content: {
|
|
16
|
+
"application/json": {
|
|
17
|
+
schema: ensureVolumeRequestSchema
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
responses: {
|
|
24
|
+
200: {
|
|
25
|
+
description: "Volume exists (created or pre-existing)",
|
|
26
|
+
content: {
|
|
27
|
+
"application/json": {
|
|
28
|
+
schema: ensureVolumeResponseSchema
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
400: {
|
|
33
|
+
description: "Missing volume_name",
|
|
34
|
+
content: {
|
|
35
|
+
"application/json": {
|
|
36
|
+
schema: errorResponseSchema
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
500: {
|
|
41
|
+
description: "Failed to ensure volume",
|
|
42
|
+
content: {
|
|
43
|
+
"application/json": {
|
|
44
|
+
schema: errorResponseSchema
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export const listVolumesRouteSchema = {
|
|
51
|
+
method: "get",
|
|
52
|
+
path: "/api/v1/volumes",
|
|
53
|
+
operationId: "listVolumes",
|
|
54
|
+
summary: "List Figulus-managed volumes",
|
|
55
|
+
description: "Returns all Docker volumes managed by this Figulus engine instance.",
|
|
56
|
+
tags: [
|
|
57
|
+
"volumes"
|
|
58
|
+
],
|
|
59
|
+
responses: {
|
|
60
|
+
200: {
|
|
61
|
+
description: "Volume list",
|
|
62
|
+
content: {
|
|
63
|
+
"application/json": {
|
|
64
|
+
schema: listVolumesResponseSchema
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
500: {
|
|
69
|
+
description: "Failed to list volumes",
|
|
70
|
+
content: {
|
|
71
|
+
"application/json": {
|
|
72
|
+
schema: errorResponseSchema
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
export const deleteVolumeRouteSchema = {
|
|
79
|
+
method: "delete",
|
|
80
|
+
path: "/api/v1/volumes/{name}",
|
|
81
|
+
operationId: "deleteVolume",
|
|
82
|
+
summary: "Delete a volume",
|
|
83
|
+
description: "Deletes the named Docker volume. Returns 500 if the volume is in use.",
|
|
84
|
+
tags: [
|
|
85
|
+
"volumes"
|
|
86
|
+
],
|
|
87
|
+
parameters: [
|
|
88
|
+
{
|
|
89
|
+
name: "name",
|
|
90
|
+
in: "path",
|
|
91
|
+
required: true,
|
|
92
|
+
schema: {
|
|
93
|
+
type: "string"
|
|
94
|
+
},
|
|
95
|
+
example: "figulus-cache-nodejs"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
responses: {
|
|
99
|
+
200: {
|
|
100
|
+
description: "Volume deleted",
|
|
101
|
+
content: {
|
|
102
|
+
"application/json": {
|
|
103
|
+
schema: deleteVolumeResponseSchema
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
400: {
|
|
108
|
+
description: "Missing volume name",
|
|
109
|
+
content: {
|
|
110
|
+
"application/json": {
|
|
111
|
+
schema: errorResponseSchema
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
500: {
|
|
116
|
+
description: "Delete failed",
|
|
117
|
+
content: {
|
|
118
|
+
"application/json": {
|
|
119
|
+
schema: errorResponseSchema
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
export const pruneVolumesRouteSchema = {
|
|
126
|
+
method: "post",
|
|
127
|
+
path: "/api/v1/volumes/prune",
|
|
128
|
+
operationId: "pruneVolumes",
|
|
129
|
+
summary: "Prune unused volumes",
|
|
130
|
+
description: "Removes unused Docker volumes matching the given filters. Body is optional.",
|
|
131
|
+
tags: [
|
|
132
|
+
"volumes"
|
|
133
|
+
],
|
|
134
|
+
request: {
|
|
135
|
+
body: {
|
|
136
|
+
description: undefined,
|
|
137
|
+
content: {
|
|
138
|
+
"application/json": {
|
|
139
|
+
schema: pruneVolumesRequestSchema
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
required: false
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
responses: {
|
|
146
|
+
200: {
|
|
147
|
+
description: "Volumes pruned",
|
|
148
|
+
content: {
|
|
149
|
+
"application/json": {
|
|
150
|
+
schema: pruneVolumesResponseSchema
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
500: {
|
|
155
|
+
description: "Prune failed",
|
|
156
|
+
content: {
|
|
157
|
+
"application/json": {
|
|
158
|
+
schema: errorResponseSchema
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
//# sourceMappingURL=volumes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"volumes.js","sourceRoot":"","sources":["../../../src/engine/paths/volumes.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const errorResponseSchema: z.ZodObject<{
|
|
3
|
+
error: z.ZodString;
|
|
4
|
+
message: z.ZodString;
|
|
5
|
+
code: z.ZodInt;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type ErrorResponse = z.infer<typeof errorResponseSchema>;
|
|
8
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/engine/response.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,mBAAmB;;;;iBAIL,CAAC;AAC5B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
|
|
3
|
+
extendZodWithOpenApi(z);
|
|
4
|
+
export const errorResponseSchema = z.object({
|
|
5
|
+
error: z.string().describe("Machine-readable error code").openapi({ example: "job_not_found" }),
|
|
6
|
+
message: z.string().describe("Human-readable error detail").openapi({ example: "Job abc123 not found" }),
|
|
7
|
+
code: z.int().describe("HTTP status code mirrored in body").openapi({ example: 404 }),
|
|
8
|
+
}).openapi("ErrorResponse");
|
|
9
|
+
//# sourceMappingURL=response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/engine/response.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAExB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAC/F,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,CAAC;IACxG,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;CACtF,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const sessionStatusSchema: z.ZodEnum<{
|
|
3
|
+
active: "active";
|
|
4
|
+
idle: "idle";
|
|
5
|
+
expired: "expired";
|
|
6
|
+
}>;
|
|
7
|
+
export type SessionStatus = z.infer<typeof sessionStatusSchema>;
|
|
8
|
+
export declare const sessionConfigSchema: z.ZodObject<{
|
|
9
|
+
working_dir: z.ZodOptional<z.ZodString>;
|
|
10
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
11
|
+
parser_script: z.ZodOptional<z.ZodString>;
|
|
12
|
+
volumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
13
|
+
type: z.ZodOptional<z.ZodString>;
|
|
14
|
+
host_path: z.ZodString;
|
|
15
|
+
container_path: z.ZodOptional<z.ZodString>;
|
|
16
|
+
read_only: z.ZodBoolean;
|
|
17
|
+
}, z.core.$strip>>>;
|
|
18
|
+
named_volumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
19
|
+
volume_name: z.ZodString;
|
|
20
|
+
container_path: z.ZodString;
|
|
21
|
+
read_only: z.ZodBoolean;
|
|
22
|
+
}, z.core.$strip>>>;
|
|
23
|
+
init_cmd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
destroy_cmd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
execute: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
startup: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
27
|
+
cmd: z.ZodString;
|
|
28
|
+
async: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
main: z.ZodObject<{
|
|
31
|
+
cmd: z.ZodString;
|
|
32
|
+
onExit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
33
|
+
cmd: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
34
|
+
exitCode: z.ZodInt;
|
|
35
|
+
}, z.core.$strip>>]>>;
|
|
36
|
+
parser: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
shutdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
+
cmd: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>>;
|
|
41
|
+
scheduled: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42
|
+
cmd: z.ZodString;
|
|
43
|
+
runAt: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
44
|
+
interval: z.ZodOptional<z.ZodInt>;
|
|
45
|
+
time: z.ZodOptional<z.ZodString>;
|
|
46
|
+
cron: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>]>;
|
|
48
|
+
onExit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
49
|
+
cmd: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
50
|
+
exitCode: z.ZodInt;
|
|
51
|
+
}, z.core.$strip>>]>>;
|
|
52
|
+
parser: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$strip>>>;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
|
+
container: z.ZodInt;
|
|
57
|
+
host: z.ZodOptional<z.ZodInt>;
|
|
58
|
+
}, z.core.$strip>>>;
|
|
59
|
+
start_cmd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
auto_cleanup: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
block_until_complete: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type SessionConfig = z.infer<typeof sessionConfigSchema>;
|
|
64
|
+
export declare const createSessionRequestSchema: z.ZodObject<{
|
|
65
|
+
image_tag: z.ZodString;
|
|
66
|
+
ttl: z.ZodOptional<z.ZodInt>;
|
|
67
|
+
config: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
working_dir: z.ZodOptional<z.ZodString>;
|
|
69
|
+
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
70
|
+
parser_script: z.ZodOptional<z.ZodString>;
|
|
71
|
+
volumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
72
|
+
type: z.ZodOptional<z.ZodString>;
|
|
73
|
+
host_path: z.ZodString;
|
|
74
|
+
container_path: z.ZodOptional<z.ZodString>;
|
|
75
|
+
read_only: z.ZodBoolean;
|
|
76
|
+
}, z.core.$strip>>>;
|
|
77
|
+
named_volumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
+
volume_name: z.ZodString;
|
|
79
|
+
container_path: z.ZodString;
|
|
80
|
+
read_only: z.ZodBoolean;
|
|
81
|
+
}, z.core.$strip>>>;
|
|
82
|
+
init_cmd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
destroy_cmd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
84
|
+
execute: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
startup: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
86
|
+
cmd: z.ZodString;
|
|
87
|
+
async: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
}, z.core.$strip>>>;
|
|
89
|
+
main: z.ZodObject<{
|
|
90
|
+
cmd: z.ZodString;
|
|
91
|
+
onExit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
92
|
+
cmd: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
93
|
+
exitCode: z.ZodInt;
|
|
94
|
+
}, z.core.$strip>>]>>;
|
|
95
|
+
parser: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
shutdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
98
|
+
cmd: z.ZodString;
|
|
99
|
+
}, z.core.$strip>>>;
|
|
100
|
+
scheduled: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
101
|
+
cmd: z.ZodString;
|
|
102
|
+
runAt: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
103
|
+
interval: z.ZodOptional<z.ZodInt>;
|
|
104
|
+
time: z.ZodOptional<z.ZodString>;
|
|
105
|
+
cron: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strip>]>;
|
|
107
|
+
onExit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
108
|
+
cmd: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
109
|
+
exitCode: z.ZodInt;
|
|
110
|
+
}, z.core.$strip>>]>>;
|
|
111
|
+
parser: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$strip>>>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
115
|
+
container: z.ZodInt;
|
|
116
|
+
host: z.ZodOptional<z.ZodInt>;
|
|
117
|
+
}, z.core.$strip>>>;
|
|
118
|
+
start_cmd: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
119
|
+
auto_cleanup: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
block_until_complete: z.ZodOptional<z.ZodBoolean>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
execute: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
startup: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
124
|
+
cmd: z.ZodString;
|
|
125
|
+
async: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
}, z.core.$strip>>>;
|
|
127
|
+
main: z.ZodObject<{
|
|
128
|
+
cmd: z.ZodString;
|
|
129
|
+
onExit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
130
|
+
cmd: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
131
|
+
exitCode: z.ZodInt;
|
|
132
|
+
}, z.core.$strip>>]>>;
|
|
133
|
+
parser: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
shutdown: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
136
|
+
cmd: z.ZodString;
|
|
137
|
+
}, z.core.$strip>>>;
|
|
138
|
+
scheduled: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
139
|
+
cmd: z.ZodString;
|
|
140
|
+
runAt: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
141
|
+
interval: z.ZodOptional<z.ZodInt>;
|
|
142
|
+
time: z.ZodOptional<z.ZodString>;
|
|
143
|
+
cron: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>]>;
|
|
145
|
+
onExit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
146
|
+
cmd: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
147
|
+
exitCode: z.ZodInt;
|
|
148
|
+
}, z.core.$strip>>]>>;
|
|
149
|
+
parser: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$strip>>>;
|
|
151
|
+
}, z.core.$strip>>;
|
|
152
|
+
block_until_complete: z.ZodOptional<z.ZodBoolean>;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
export type CreateSessionRequest = z.infer<typeof createSessionRequestSchema>;
|
|
155
|
+
export declare const createSessionResponseSchema: z.ZodObject<{
|
|
156
|
+
session_id: z.ZodString;
|
|
157
|
+
container_id: z.ZodString;
|
|
158
|
+
status: z.ZodEnum<{
|
|
159
|
+
active: "active";
|
|
160
|
+
idle: "idle";
|
|
161
|
+
expired: "expired";
|
|
162
|
+
}>;
|
|
163
|
+
created_at: z.ZodISODateTime;
|
|
164
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
165
|
+
container: z.ZodInt;
|
|
166
|
+
host: z.ZodOptional<z.ZodInt>;
|
|
167
|
+
}, z.core.$strip>>>;
|
|
168
|
+
exit_code: z.ZodOptional<z.ZodInt>;
|
|
169
|
+
stdout: z.ZodOptional<z.ZodString>;
|
|
170
|
+
stderr: z.ZodOptional<z.ZodString>;
|
|
171
|
+
}, z.core.$strip>;
|
|
172
|
+
export type CreateSessionResponse = z.infer<typeof createSessionResponseSchema>;
|
|
173
|
+
export declare const getSessionResponseSchema: z.ZodObject<{
|
|
174
|
+
session_id: z.ZodString;
|
|
175
|
+
container_id: z.ZodString;
|
|
176
|
+
image_tag: z.ZodString;
|
|
177
|
+
status: z.ZodEnum<{
|
|
178
|
+
active: "active";
|
|
179
|
+
idle: "idle";
|
|
180
|
+
expired: "expired";
|
|
181
|
+
}>;
|
|
182
|
+
created_at: z.ZodISODateTime;
|
|
183
|
+
last_used_at: z.ZodISODateTime;
|
|
184
|
+
ttl: z.ZodInt;
|
|
185
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
186
|
+
container: z.ZodInt;
|
|
187
|
+
host: z.ZodOptional<z.ZodInt>;
|
|
188
|
+
}, z.core.$strip>>>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
export type GetSessionResponse = z.infer<typeof getSessionResponseSchema>;
|
|
191
|
+
export declare const runInSessionRequestSchema: z.ZodObject<{
|
|
192
|
+
command: z.ZodArray<z.ZodString>;
|
|
193
|
+
timeout: z.ZodOptional<z.ZodInt>;
|
|
194
|
+
parser_script: z.ZodOptional<z.ZodString>;
|
|
195
|
+
working_dir: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$strip>;
|
|
197
|
+
export type RunInSessionRequest = z.infer<typeof runInSessionRequestSchema>;
|
|
198
|
+
export declare const runInSessionResponseSchema: z.ZodObject<{
|
|
199
|
+
run_id: z.ZodString;
|
|
200
|
+
exit_code: z.ZodInt;
|
|
201
|
+
stdout: z.ZodString;
|
|
202
|
+
stderr: z.ZodString;
|
|
203
|
+
parsed_output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
204
|
+
duration: z.ZodNumber;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type RunInSessionResponse = z.infer<typeof runInSessionResponseSchema>;
|
|
207
|
+
export declare const getRunResponseSchema: z.ZodObject<{
|
|
208
|
+
run_id: z.ZodString;
|
|
209
|
+
session_id: z.ZodString;
|
|
210
|
+
command: z.ZodArray<z.ZodString>;
|
|
211
|
+
exit_code: z.ZodInt;
|
|
212
|
+
stdout: z.ZodString;
|
|
213
|
+
stderr: z.ZodString;
|
|
214
|
+
parsed_output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
215
|
+
started_at: z.ZodISODateTime;
|
|
216
|
+
completed_at: z.ZodISODateTime;
|
|
217
|
+
duration: z.ZodNumber;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
export type GetRunResponse = z.infer<typeof getRunResponseSchema>;
|
|
220
|
+
export declare const listRunsResponseSchema: z.ZodObject<{
|
|
221
|
+
runs: z.ZodArray<z.ZodObject<{
|
|
222
|
+
run_id: z.ZodString;
|
|
223
|
+
session_id: z.ZodString;
|
|
224
|
+
command: z.ZodArray<z.ZodString>;
|
|
225
|
+
exit_code: z.ZodInt;
|
|
226
|
+
stdout: z.ZodString;
|
|
227
|
+
stderr: z.ZodString;
|
|
228
|
+
parsed_output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
229
|
+
started_at: z.ZodISODateTime;
|
|
230
|
+
completed_at: z.ZodISODateTime;
|
|
231
|
+
duration: z.ZodNumber;
|
|
232
|
+
}, z.core.$strip>>;
|
|
233
|
+
count: z.ZodInt;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
export declare const syncFileRequestSchema: z.ZodObject<{
|
|
236
|
+
targetPath: z.ZodString;
|
|
237
|
+
content: z.ZodString;
|
|
238
|
+
encoding: z.ZodDefault<z.ZodEnum<{
|
|
239
|
+
base64: "base64";
|
|
240
|
+
utf8: "utf8";
|
|
241
|
+
}>>;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
export type SyncFileRequest = z.infer<typeof syncFileRequestSchema>;
|
|
244
|
+
export declare const syncFileResponseSchema: z.ZodObject<{
|
|
245
|
+
success: z.ZodBoolean;
|
|
246
|
+
path: z.ZodString;
|
|
247
|
+
bytes_written: z.ZodInt;
|
|
248
|
+
message: z.ZodOptional<z.ZodString>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
export type SyncFileResponse = z.infer<typeof syncFileResponseSchema>;
|
|
251
|
+
export declare const startStackRequestSchema: z.ZodObject<{
|
|
252
|
+
spec: z.ZodObject<{
|
|
253
|
+
schemaVersion: z.ZodString;
|
|
254
|
+
stackName: z.ZodString;
|
|
255
|
+
containers: z.ZodArray<z.ZodObject<{
|
|
256
|
+
name: z.ZodString;
|
|
257
|
+
spec: z.ZodUnion<readonly [z.ZodObject<{}, z.core.$loose>, z.ZodString]>;
|
|
258
|
+
ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
259
|
+
container: z.ZodInt;
|
|
260
|
+
host: z.ZodOptional<z.ZodInt>;
|
|
261
|
+
}, z.core.$strip>>>;
|
|
262
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
263
|
+
name: z.ZodString;
|
|
264
|
+
condition: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
265
|
+
started: "started";
|
|
266
|
+
healthy: "healthy";
|
|
267
|
+
completed: "completed";
|
|
268
|
+
}>>>;
|
|
269
|
+
}, z.core.$strip>>>;
|
|
270
|
+
healthCheck: z.ZodOptional<z.ZodObject<{
|
|
271
|
+
type: z.ZodEnum<{
|
|
272
|
+
exec: "exec";
|
|
273
|
+
http: "http";
|
|
274
|
+
tcp: "tcp";
|
|
275
|
+
}>;
|
|
276
|
+
cmd: z.ZodOptional<z.ZodString>;
|
|
277
|
+
path: z.ZodOptional<z.ZodString>;
|
|
278
|
+
port: z.ZodOptional<z.ZodInt>;
|
|
279
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
280
|
+
GET: "GET";
|
|
281
|
+
HEAD: "HEAD";
|
|
282
|
+
}>>;
|
|
283
|
+
expectedStatus: z.ZodOptional<z.ZodInt>;
|
|
284
|
+
intervalSeconds: z.ZodOptional<z.ZodInt>;
|
|
285
|
+
timeoutSeconds: z.ZodOptional<z.ZodInt>;
|
|
286
|
+
retries: z.ZodOptional<z.ZodInt>;
|
|
287
|
+
startPeriodSeconds: z.ZodOptional<z.ZodInt>;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
290
|
+
}, z.core.$strip>>;
|
|
291
|
+
env: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
292
|
+
vars: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
293
|
+
inject: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
294
|
+
}, z.core.$strip>>>;
|
|
295
|
+
network: z.ZodOptional<z.ZodObject<{
|
|
296
|
+
name: z.ZodOptional<z.ZodString>;
|
|
297
|
+
subnet: z.ZodOptional<z.ZodString>;
|
|
298
|
+
external: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}, z.core.$strip>>;
|
|
300
|
+
volumes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
301
|
+
name: z.ZodString;
|
|
302
|
+
external: z.ZodOptional<z.ZodBoolean>;
|
|
303
|
+
}, z.core.$strip>>>;
|
|
304
|
+
}, z.core.$strip>;
|
|
305
|
+
build: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
306
|
+
images: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
307
|
+
}, z.core.$strip>;
|
|
308
|
+
export declare const startStackResponseSchema: z.ZodObject<{
|
|
309
|
+
stack_name: z.ZodString;
|
|
310
|
+
sessions: z.ZodObject<{}, z.core.$strip>;
|
|
311
|
+
network_id: z.ZodString;
|
|
312
|
+
}, z.core.$strip>;
|
|
313
|
+
export declare const stackContainerStatusSchema: z.ZodObject<{
|
|
314
|
+
container_name: z.ZodString;
|
|
315
|
+
session_id: z.ZodString;
|
|
316
|
+
status: z.ZodString;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
export declare const getStackResponseSchema: z.ZodObject<{
|
|
319
|
+
stack_name: z.ZodString;
|
|
320
|
+
network_id: z.ZodString;
|
|
321
|
+
containers: z.ZodArray<z.ZodObject<{
|
|
322
|
+
container_name: z.ZodString;
|
|
323
|
+
session_id: z.ZodString;
|
|
324
|
+
status: z.ZodString;
|
|
325
|
+
}, z.core.$strip>>;
|
|
326
|
+
created_at: z.ZodISODateTime;
|
|
327
|
+
}, z.core.$strip>;
|
|
328
|
+
export declare const listStacksResponseSchema: z.ZodObject<{
|
|
329
|
+
stacks: z.ZodArray<z.ZodObject<{
|
|
330
|
+
run_id: z.ZodString;
|
|
331
|
+
session_id: z.ZodString;
|
|
332
|
+
command: z.ZodArray<z.ZodString>;
|
|
333
|
+
exit_code: z.ZodInt;
|
|
334
|
+
stdout: z.ZodString;
|
|
335
|
+
stderr: z.ZodString;
|
|
336
|
+
parsed_output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
337
|
+
started_at: z.ZodISODateTime;
|
|
338
|
+
completed_at: z.ZodISODateTime;
|
|
339
|
+
duration: z.ZodNumber;
|
|
340
|
+
}, z.core.$strip>>;
|
|
341
|
+
count: z.ZodInt;
|
|
342
|
+
}, z.core.$strip>;
|
|
343
|
+
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../src/engine/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,mBAAmB;;;;EAEL,CAAC;AAC5B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAaL,CAAC;AAC5B,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAML,CAAC;AACnC,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;iBASL,CAAC;AACpC,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;iBASL,CAAC;AACjC,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;;;iBAKL,CAAC;AAClC,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;iBAOL,CAAC;AACnC,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,oBAAoB;;;;;;;;;;;iBAWL,CAAC;AAC7B,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;iBAGL,CAAC;AAE/B,eAAO,MAAM,qBAAqB;;;;;;;iBAIL,CAAC;AAC9B,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,sBAAsB;;;;;iBAKL,CAAC;AAC/B,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAIL,CAAC;AAEhC,eAAO,MAAM,wBAAwB;;;;iBAIL,CAAC;AAEjC,eAAO,MAAM,0BAA0B;;;;iBAIL,CAAC;AAEnC,eAAO,MAAM,sBAAsB;;;;;;;;;iBAKL,CAAC;AAE/B,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;iBAGL,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { namedVolumeMountSchema, volumeMountSchema } from '../core/volumes.js';
|
|
3
|
+
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
|
|
4
|
+
import { figStackSchema } from '../core/entities/figstack.js';
|
|
5
|
+
import { figSpecExecuteSchema } from '../core/entities/figspec.js';
|
|
6
|
+
import { portMappingSchema } from '../core/generic.js';
|
|
7
|
+
extendZodWithOpenApi(z);
|
|
8
|
+
export const sessionStatusSchema = z.enum([
|
|
9
|
+
'active', 'idle', 'expired'
|
|
10
|
+
]).openapi("SessionStatus");
|
|
11
|
+
export const sessionConfigSchema = z.object({
|
|
12
|
+
working_dir: z.string().optional().describe("Default working directory for commands in this session").openapi({ example: "/app" }),
|
|
13
|
+
environment: z.record(z.string(), z.string()).optional().describe("Environment variables for the session container"),
|
|
14
|
+
parser_script: z.string().optional().describe("Default JavaScript parser script for command output"),
|
|
15
|
+
volumes: z.array(volumeMountSchema).optional(),
|
|
16
|
+
named_volumes: z.array(namedVolumeMountSchema).optional(),
|
|
17
|
+
init_cmd: z.array(z.string()).optional().describe("Command to run once after container creation"),
|
|
18
|
+
destroy_cmd: z.array(z.string()).optional().describe("Command to run before container destruction"),
|
|
19
|
+
execute: figSpecExecuteSchema.optional().describe("Figspec execute configuration (alternative to start_cmd for Figspec-driven sessions)"),
|
|
20
|
+
ports: z.array(portMappingSchema).optional(),
|
|
21
|
+
start_cmd: z.array(z.string()).optional().describe("Main container process command (default [\"sleep\", \"infinity\"])"),
|
|
22
|
+
auto_cleanup: z.boolean().optional().describe("If true, the session is destroyed automatically after the main command (start_cmd or execute.main) completes, regardless of exit code. This is the flag that distinguishes a one-shot execution from a persistent session.").openapi({ example: false }),
|
|
23
|
+
block_until_complete: z.boolean().optional().describe("If true (on CreateSessionRequest), the HTTP handler blocks until the session reaches a terminal state and returns the full result (exit_code, stdout, stderr) in the response. Intended for use with auto_cleanup: true to implement synchronous one-shot execution.").openapi({ example: false })
|
|
24
|
+
}).openapi("SessionConfig");
|
|
25
|
+
export const createSessionRequestSchema = z.object({
|
|
26
|
+
image_tag: z.string().min(1).describe("Docker image to use for the session container").openapi({ example: "localhost:5000/figulus:sha256-abc123" }),
|
|
27
|
+
ttl: z.int().positive().optional().describe("Session TTL in seconds (default 600)").openapi({ example: 600 }),
|
|
28
|
+
config: sessionConfigSchema.optional(),
|
|
29
|
+
execute: figSpecExecuteSchema.optional().describe("Figspec execute configuration (preferred over config.start_cmd for Figspec-driven sessions)"),
|
|
30
|
+
block_until_complete: z.boolean().optional().describe("If true, the HTTP handler blocks until the session reaches a terminal state and returns the full result (exit_code, stdout, stderr) synchronously. Use with config.auto_cleanup: true to implement one-shot execution semantics (replaces the removed /containers/run endpoint).").openapi({ example: false }),
|
|
31
|
+
}).openapi("CreateSessionRequest");
|
|
32
|
+
export const createSessionResponseSchema = z.object({
|
|
33
|
+
session_id: z.string().openapi({ example: "sess-abc123" }),
|
|
34
|
+
container_id: z.string().openapi({ example: "a1b2c3d4e5f6" }),
|
|
35
|
+
status: sessionStatusSchema,
|
|
36
|
+
created_at: z.iso.datetime().openapi({ format: "date-time" }),
|
|
37
|
+
ports: z.array(portMappingSchema).optional(),
|
|
38
|
+
exit_code: z.int().optional().describe("Container exit code. Populated when block_until_complete: true and the session ran to completion (i.e., auto_cleanup: true and the main command finished).").openapi({ example: 0 }),
|
|
39
|
+
stdout: z.string().optional().describe("Main command stdout. Populated when block_until_complete is true and session ran to completion.").openapi({ example: "Hello, world!\n" }),
|
|
40
|
+
stderr: z.string().optional().describe("Main command stderr. Populated when block_until_complete is true and session ran to completion.").openapi({ example: "" }),
|
|
41
|
+
}).openapi("CreateSessionResponse");
|
|
42
|
+
export const getSessionResponseSchema = z.object({
|
|
43
|
+
session_id: z.string(),
|
|
44
|
+
container_id: z.string(),
|
|
45
|
+
image_tag: z.string(),
|
|
46
|
+
status: sessionStatusSchema,
|
|
47
|
+
created_at: z.iso.datetime().openapi({ format: "date-time" }),
|
|
48
|
+
last_used_at: z.iso.datetime().openapi({ format: "date-time" }),
|
|
49
|
+
ttl: z.int().describe("TTL in seconds"),
|
|
50
|
+
ports: z.array(portMappingSchema).optional(),
|
|
51
|
+
}).openapi("GetSessionResponse");
|
|
52
|
+
export const runInSessionRequestSchema = z.object({
|
|
53
|
+
command: z.array(z.string()).min(1).describe("Command to execute inside the session container").openapi({ example: ["npm", "test"] }),
|
|
54
|
+
timeout: z.int().positive().max(86400).optional().describe("Timeout in seconds (default 300)").openapi({ example: 300 }),
|
|
55
|
+
parser_script: z.string().optional().describe("Optional JavaScript parser for structured output"),
|
|
56
|
+
working_dir: z.string().optional().describe("Override the session working directory for this run").openapi({ example: "/app/packages/core" }),
|
|
57
|
+
}).openapi("RunInSessionRequest");
|
|
58
|
+
export const runInSessionResponseSchema = z.object({
|
|
59
|
+
run_id: z.string().openapi({ example: "run-abc123" }),
|
|
60
|
+
exit_code: z.int(),
|
|
61
|
+
stdout: z.string(),
|
|
62
|
+
stderr: z.string(),
|
|
63
|
+
parsed_output: z.record(z.string(), z.unknown()).optional().describe("Structured output from the parser script, if provided"),
|
|
64
|
+
duration: z.number().describe("Duration in seconds").openapi({ format: "double" }),
|
|
65
|
+
}).openapi("RunInSessionResponse");
|
|
66
|
+
export const getRunResponseSchema = z.object({
|
|
67
|
+
run_id: z.string(),
|
|
68
|
+
session_id: z.string(),
|
|
69
|
+
command: z.array(z.string()),
|
|
70
|
+
exit_code: z.int(),
|
|
71
|
+
stdout: z.string(),
|
|
72
|
+
stderr: z.string(),
|
|
73
|
+
parsed_output: z.record(z.string(), z.unknown()).optional(),
|
|
74
|
+
started_at: z.iso.datetime().openapi({ format: "date-time" }),
|
|
75
|
+
completed_at: z.iso.datetime().openapi({ format: "date-time" }),
|
|
76
|
+
duration: z.number().openapi({ format: "double" }),
|
|
77
|
+
}).openapi("GetRunResponse");
|
|
78
|
+
export const listRunsResponseSchema = z.object({
|
|
79
|
+
runs: z.array(getRunResponseSchema),
|
|
80
|
+
count: z.int()
|
|
81
|
+
}).openapi("ListRunsResponse");
|
|
82
|
+
export const syncFileRequestSchema = z.object({
|
|
83
|
+
targetPath: z.string().min(1).describe("Absolute path inside the container where the file will be written").openapi({ example: "/app/src/index.ts" }),
|
|
84
|
+
content: z.string().min(1).describe("File content, encoded as specified by the encoding field"),
|
|
85
|
+
encoding: z.enum(['base64', 'utf8']).default('base64').describe("Encoding of the content field (default base64)"),
|
|
86
|
+
}).openapi("SyncFileRequest");
|
|
87
|
+
export const syncFileResponseSchema = z.object({
|
|
88
|
+
success: z.boolean(),
|
|
89
|
+
path: z.string().describe("Path written to (echoes targetPath)"),
|
|
90
|
+
bytes_written: z.int().openapi({ format: "int64" }),
|
|
91
|
+
message: z.string().optional(),
|
|
92
|
+
}).openapi("SyncFileResponse");
|
|
93
|
+
export const startStackRequestSchema = z.object({
|
|
94
|
+
spec: figStackSchema,
|
|
95
|
+
build: z.boolean().optional().default(false).describe("If true, build all required images before starting."),
|
|
96
|
+
images: z.object({}).optional().describe("Pre-resolved image tags keyed by container entry name."),
|
|
97
|
+
}).openapi("StartStackRequest");
|
|
98
|
+
export const startStackResponseSchema = z.object({
|
|
99
|
+
stack_name: z.string(),
|
|
100
|
+
sessions: z.object({}).describe("Map of container name → session ID."),
|
|
101
|
+
network_id: z.string()
|
|
102
|
+
}).openapi("StartStackResponse");
|
|
103
|
+
export const stackContainerStatusSchema = z.object({
|
|
104
|
+
container_name: z.string(),
|
|
105
|
+
session_id: z.string(),
|
|
106
|
+
status: z.string()
|
|
107
|
+
}).openapi("StackContainerStatus");
|
|
108
|
+
export const getStackResponseSchema = z.object({
|
|
109
|
+
stack_name: z.string(),
|
|
110
|
+
network_id: z.string(),
|
|
111
|
+
containers: z.array(stackContainerStatusSchema),
|
|
112
|
+
created_at: z.iso.datetime().openapi({ format: "date-time" }),
|
|
113
|
+
}).openapi("GetStackResponse");
|
|
114
|
+
export const listStacksResponseSchema = z.object({
|
|
115
|
+
stacks: z.array(getRunResponseSchema),
|
|
116
|
+
count: z.int()
|
|
117
|
+
}).openapi("ListStacksResponse");
|
|
118
|
+
//# sourceMappingURL=sessions.js.map
|