@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
package/src/session.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
SessionStatusSchema,
|
|
4
|
-
ParsedOutputSchema,
|
|
5
|
-
VolumeMountSchema,
|
|
6
|
-
NamedVolumeMountSchema,
|
|
7
|
-
PortMappingSchema,
|
|
8
|
-
} from './shared.js';
|
|
9
|
-
|
|
10
|
-
export const SessionConfigSchema = z.object({
|
|
11
|
-
working_dir: z.string().optional(),
|
|
12
|
-
environment: z.record(z.string()).optional(),
|
|
13
|
-
parser_script: z.string().optional(),
|
|
14
|
-
volumes: z.array(VolumeMountSchema).optional(),
|
|
15
|
-
named_volumes: z.array(NamedVolumeMountSchema).optional(),
|
|
16
|
-
init_cmd: z.array(z.string()).optional(),
|
|
17
|
-
destroy_cmd: z.array(z.string()).optional(),
|
|
18
|
-
ports: z.array(PortMappingSchema).optional(),
|
|
19
|
-
start_cmd: z.array(z.string()).optional(),
|
|
20
|
-
auto_cleanup: z.boolean().optional(),
|
|
21
|
-
});
|
|
22
|
-
export type SessionConfig = z.infer<typeof SessionConfigSchema>;
|
|
23
|
-
|
|
24
|
-
export const CreateSessionRequestSchema = z.object({
|
|
25
|
-
image_tag: z.string().min(1),
|
|
26
|
-
ttl: z.number().int().positive().optional(),
|
|
27
|
-
config: SessionConfigSchema.optional(),
|
|
28
|
-
block_until_complete: z.boolean().optional(),
|
|
29
|
-
});
|
|
30
|
-
export type CreateSessionRequest = z.infer<typeof CreateSessionRequestSchema>;
|
|
31
|
-
|
|
32
|
-
export const CreateSessionResponseSchema = z.object({
|
|
33
|
-
session_id: z.string(),
|
|
34
|
-
container_id: z.string(),
|
|
35
|
-
status: SessionStatusSchema,
|
|
36
|
-
created_at: z.string().datetime(),
|
|
37
|
-
ports: z.array(PortMappingSchema).optional(),
|
|
38
|
-
exit_code: z.number().int().optional(),
|
|
39
|
-
stdout: z.string().optional(),
|
|
40
|
-
stderr: z.string().optional(),
|
|
41
|
-
});
|
|
42
|
-
export type CreateSessionResponse = z.infer<typeof CreateSessionResponseSchema>;
|
|
43
|
-
|
|
44
|
-
export const GetSessionResponseSchema = z.object({
|
|
45
|
-
session_id: z.string(),
|
|
46
|
-
container_id: z.string(),
|
|
47
|
-
image_tag: z.string(),
|
|
48
|
-
status: SessionStatusSchema,
|
|
49
|
-
created_at: z.string().datetime(),
|
|
50
|
-
last_used_at: z.string().datetime(),
|
|
51
|
-
ttl: z.number().int(),
|
|
52
|
-
ports: z.array(PortMappingSchema).optional(),
|
|
53
|
-
});
|
|
54
|
-
export type GetSessionResponse = z.infer<typeof GetSessionResponseSchema>;
|
|
55
|
-
|
|
56
|
-
export const RunInSessionRequestSchema = z.object({
|
|
57
|
-
command: z.array(z.string()).min(1),
|
|
58
|
-
timeout: z.number().int().positive().max(86400).optional(),
|
|
59
|
-
parser_script: z.string().optional(),
|
|
60
|
-
working_dir: z.string().optional(),
|
|
61
|
-
});
|
|
62
|
-
export type RunInSessionRequest = z.infer<typeof RunInSessionRequestSchema>;
|
|
63
|
-
|
|
64
|
-
export const RunInSessionResponseSchema = z.object({
|
|
65
|
-
run_id: z.string(),
|
|
66
|
-
exit_code: z.number().int(),
|
|
67
|
-
stdout: z.string(),
|
|
68
|
-
stderr: z.string(),
|
|
69
|
-
parsed_output: z.record(z.unknown()).optional(),
|
|
70
|
-
duration: z.number(),
|
|
71
|
-
});
|
|
72
|
-
export type RunInSessionResponse = z.infer<typeof RunInSessionResponseSchema>;
|
|
73
|
-
|
|
74
|
-
export const GetRunResponseSchema = z.object({
|
|
75
|
-
run_id: z.string(),
|
|
76
|
-
session_id: z.string(),
|
|
77
|
-
command: z.array(z.string()),
|
|
78
|
-
exit_code: z.number().int(),
|
|
79
|
-
stdout: z.string(),
|
|
80
|
-
stderr: z.string(),
|
|
81
|
-
parsed_output: z.record(z.unknown()).optional(),
|
|
82
|
-
started_at: z.string().datetime(),
|
|
83
|
-
completed_at: z.string().datetime(),
|
|
84
|
-
duration: z.number(),
|
|
85
|
-
});
|
|
86
|
-
export type GetRunResponse = z.infer<typeof GetRunResponseSchema>;
|
|
87
|
-
|
|
88
|
-
export const SyncFileRequestSchema = z.object({
|
|
89
|
-
targetPath: z.string().min(1),
|
|
90
|
-
content: z.string().min(1),
|
|
91
|
-
encoding: z.enum(['base64', 'utf8']).default('base64'),
|
|
92
|
-
});
|
|
93
|
-
export type SyncFileRequest = z.infer<typeof SyncFileRequestSchema>;
|
|
94
|
-
|
|
95
|
-
export const SyncFileResponseSchema = z.object({
|
|
96
|
-
success: z.boolean(),
|
|
97
|
-
path: z.string(),
|
|
98
|
-
bytes_written: z.number().int(),
|
|
99
|
-
message: z.string().optional(),
|
|
100
|
-
});
|
|
101
|
-
export type SyncFileResponse = z.infer<typeof SyncFileResponseSchema>;
|
package/src/shared.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const JobStatusSchema = z.enum([
|
|
4
|
-
'pending',
|
|
5
|
-
'running',
|
|
6
|
-
'completed',
|
|
7
|
-
'failed',
|
|
8
|
-
'timeout',
|
|
9
|
-
'awaiting_cleanup',
|
|
10
|
-
]);
|
|
11
|
-
export type JobStatus = z.infer<typeof JobStatusSchema>;
|
|
12
|
-
|
|
13
|
-
export const SessionStatusSchema = z.enum(['active', 'idle', 'expired']);
|
|
14
|
-
export type SessionStatus = z.infer<typeof SessionStatusSchema>;
|
|
15
|
-
|
|
16
|
-
export const ParsedOutputSchema = z.object({
|
|
17
|
-
success: z.boolean(),
|
|
18
|
-
data: z.record(z.unknown()).optional(),
|
|
19
|
-
});
|
|
20
|
-
export type ParsedOutput = z.infer<typeof ParsedOutputSchema>;
|
|
21
|
-
|
|
22
|
-
export const ResourceLimitsSchema = z.object({
|
|
23
|
-
memory_limit: z.string().optional(),
|
|
24
|
-
memory_reservation: z.string().optional(),
|
|
25
|
-
cpu_limit: z.string().optional(),
|
|
26
|
-
cpu_reservation: z.string().optional(),
|
|
27
|
-
});
|
|
28
|
-
export type ResourceLimits = z.infer<typeof ResourceLimitsSchema>;
|
|
29
|
-
|
|
30
|
-
export const VolumeMountSchema = z.object({
|
|
31
|
-
type: z.string().optional(),
|
|
32
|
-
host_path: z.string(),
|
|
33
|
-
container_path: z.string().optional(),
|
|
34
|
-
read_only: z.boolean(),
|
|
35
|
-
});
|
|
36
|
-
export type VolumeMount = z.infer<typeof VolumeMountSchema>;
|
|
37
|
-
|
|
38
|
-
export const NamedVolumeMountSchema = z.object({
|
|
39
|
-
volume_name: z.string().min(1),
|
|
40
|
-
container_path: z.string().min(1),
|
|
41
|
-
read_only: z.boolean(),
|
|
42
|
-
});
|
|
43
|
-
export type NamedVolumeMount = z.infer<typeof NamedVolumeMountSchema>;
|
|
44
|
-
|
|
45
|
-
export const PortMappingSchema = z.object({
|
|
46
|
-
container: z.number().int().min(1).max(65535),
|
|
47
|
-
host: z.number().int().min(0).max(65535).optional(),
|
|
48
|
-
});
|
|
49
|
-
export type PortMapping = z.infer<typeof PortMappingSchema>;
|
|
50
|
-
|
|
51
|
-
export const ErrorResponseSchema = z.object({
|
|
52
|
-
error: z.string(),
|
|
53
|
-
message: z.string(),
|
|
54
|
-
code: z.number().int(),
|
|
55
|
-
});
|
|
56
|
-
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
package/src/volume.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const EnsureVolumeRequestSchema = z.object({
|
|
4
|
-
volume_name: z.string().min(1),
|
|
5
|
-
driver: z.string().optional(),
|
|
6
|
-
labels: z.record(z.string()).optional(),
|
|
7
|
-
});
|
|
8
|
-
export type EnsureVolumeRequest = z.infer<typeof EnsureVolumeRequestSchema>;
|
|
9
|
-
|
|
10
|
-
export const EnsureVolumeResponseSchema = z.object({
|
|
11
|
-
volume_name: z.string(),
|
|
12
|
-
created: z.boolean(),
|
|
13
|
-
message: z.string().optional(),
|
|
14
|
-
});
|
|
15
|
-
export type EnsureVolumeResponse = z.infer<typeof EnsureVolumeResponseSchema>;
|
|
16
|
-
|
|
17
|
-
export const VolumeInfoSchema = z.object({
|
|
18
|
-
name: z.string(),
|
|
19
|
-
driver: z.string(),
|
|
20
|
-
mountpoint: z.string(),
|
|
21
|
-
created_at: z.string(),
|
|
22
|
-
labels: z.record(z.string()).optional(),
|
|
23
|
-
scope: z.string(),
|
|
24
|
-
size_bytes: z.number().int().optional(),
|
|
25
|
-
});
|
|
26
|
-
export type VolumeInfo = z.infer<typeof VolumeInfoSchema>;
|
|
27
|
-
|
|
28
|
-
export const ListVolumesResponseSchema = z.object({
|
|
29
|
-
volumes: z.array(VolumeInfoSchema),
|
|
30
|
-
count: z.number().int(),
|
|
31
|
-
});
|
|
32
|
-
export type ListVolumesResponse = z.infer<typeof ListVolumesResponseSchema>;
|
|
33
|
-
|
|
34
|
-
export const DeleteVolumeResponseSchema = z.object({
|
|
35
|
-
volume_name: z.string(),
|
|
36
|
-
message: z.string(),
|
|
37
|
-
});
|
|
38
|
-
export type DeleteVolumeResponse = z.infer<typeof DeleteVolumeResponseSchema>;
|
|
39
|
-
|
|
40
|
-
export const PruneVolumesRequestSchema = z.object({
|
|
41
|
-
filters: z.record(z.array(z.string())).optional(),
|
|
42
|
-
});
|
|
43
|
-
export type PruneVolumesRequest = z.infer<typeof PruneVolumesRequestSchema>;
|
|
44
|
-
|
|
45
|
-
export const PruneVolumesResponseSchema = z.object({
|
|
46
|
-
volumes_deleted: z.array(z.string()),
|
|
47
|
-
space_reclaimed: z.number().int(),
|
|
48
|
-
message: z.string(),
|
|
49
|
-
});
|
|
50
|
-
export type PruneVolumesResponse = z.infer<typeof PruneVolumesResponseSchema>;
|