@distilled.cloud/daytona 0.0.0-placeholder → 1.0.0-rc.13
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/LICENSE +201 -0
- package/README.md +34 -0
- package/lib/credentials.d.ts +46 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +67 -0
- package/lib/credentials.js.map +1 -0
- package/lib/endpoints.d.ts +15 -0
- package/lib/endpoints.d.ts.map +1 -0
- package/lib/endpoints.js +28 -0
- package/lib/endpoints.js.map +1 -0
- package/lib/errors.d.ts +53 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +30 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/pagination.d.ts +10 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +10 -0
- package/lib/pagination.js.map +1 -0
- package/lib/protocol.d.ts +18 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +75 -0
- package/lib/protocol.js.map +1 -0
- package/lib/response-validation.test.d.ts +4 -0
- package/lib/response-validation.test.d.ts.map +1 -0
- package/lib/response-validation.test.js +31 -0
- package/lib/response-validation.test.js.map +1 -0
- package/lib/retry.d.ts +50 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +43 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/api_keys.d.ts +120 -0
- package/lib/services/api_keys.d.ts.map +1 -0
- package/lib/services/api_keys.js +126 -0
- package/lib/services/api_keys.js.map +1 -0
- package/lib/services/audit.d.ts +159 -0
- package/lib/services/audit.d.ts.map +1 -0
- package/lib/services/audit.js +126 -0
- package/lib/services/audit.js.map +1 -0
- package/lib/services/computer_use.d.ts +484 -0
- package/lib/services/computer_use.d.ts.map +1 -0
- package/lib/services/computer_use.js +672 -0
- package/lib/services/computer_use.js.map +1 -0
- package/lib/services/config.d.ts +138 -0
- package/lib/services/config.d.ts.map +1 -0
- package/lib/services/config.js +88 -0
- package/lib/services/config.js.map +1 -0
- package/lib/services/docker_registry.d.ts +126 -0
- package/lib/services/docker_registry.d.ts.map +1 -0
- package/lib/services/docker_registry.js +135 -0
- package/lib/services/docker_registry.js.map +1 -0
- package/lib/services/file_system.d.ts +203 -0
- package/lib/services/file_system.d.ts.map +1 -0
- package/lib/services/file_system.js +255 -0
- package/lib/services/file_system.js.map +1 -0
- package/lib/services/git.d.ts +338 -0
- package/lib/services/git.d.ts.map +1 -0
- package/lib/services/git.js +417 -0
- package/lib/services/git.js.map +1 -0
- package/lib/services/health.d.ts +41 -0
- package/lib/services/health.d.ts.map +1 -0
- package/lib/services/health.js +49 -0
- package/lib/services/health.js.map +1 -0
- package/lib/services/index.d.ts +31 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +32 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/info.d.ts +37 -0
- package/lib/services/info.d.ts.map +1 -0
- package/lib/services/info.js +55 -0
- package/lib/services/info.js.map +1 -0
- package/lib/services/interpreter.d.ts +56 -0
- package/lib/services/interpreter.d.ts.map +1 -0
- package/lib/services/interpreter.js +83 -0
- package/lib/services/interpreter.js.map +1 -0
- package/lib/services/jobs.d.ts +104 -0
- package/lib/services/jobs.d.ts.map +1 -0
- package/lib/services/jobs.js +94 -0
- package/lib/services/jobs.js.map +1 -0
- package/lib/services/lsp.d.ts +137 -0
- package/lib/services/lsp.d.ts.map +1 -0
- package/lib/services/lsp.js +160 -0
- package/lib/services/lsp.js.map +1 -0
- package/lib/services/object_storage.d.ts +31 -0
- package/lib/services/object_storage.d.ts.map +1 -0
- package/lib/services/object_storage.js +33 -0
- package/lib/services/object_storage.js.map +1 -0
- package/lib/services/organizations.d.ts +963 -0
- package/lib/services/organizations.d.ts.map +1 -0
- package/lib/services/organizations.js +1143 -0
- package/lib/services/organizations.js.map +1 -0
- package/lib/services/port.d.ts +29 -0
- package/lib/services/port.d.ts.map +1 -0
- package/lib/services/port.js +41 -0
- package/lib/services/port.js.map +1 -0
- package/lib/services/preview.d.ts +73 -0
- package/lib/services/preview.d.ts.map +1 -0
- package/lib/services/preview.js +125 -0
- package/lib/services/preview.js.map +1 -0
- package/lib/services/process.d.ts +329 -0
- package/lib/services/process.d.ts.map +1 -0
- package/lib/services/process.js +421 -0
- package/lib/services/process.js.map +1 -0
- package/lib/services/regions.d.ts +41 -0
- package/lib/services/regions.d.ts.map +1 -0
- package/lib/services/regions.js +36 -0
- package/lib/services/regions.js.map +1 -0
- package/lib/services/runners.d.ts +358 -0
- package/lib/services/runners.d.ts.map +1 -0
- package/lib/services/runners.js +316 -0
- package/lib/services/runners.js.map +1 -0
- package/lib/services/sandbox.d.ts +1276 -0
- package/lib/services/sandbox.d.ts.map +1 -0
- package/lib/services/sandbox.js +1218 -0
- package/lib/services/sandbox.js.map +1 -0
- package/lib/services/secret.d.ts +120 -0
- package/lib/services/secret.d.ts.map +1 -0
- package/lib/services/secret.js +113 -0
- package/lib/services/secret.js.map +1 -0
- package/lib/services/server.d.ts +44 -0
- package/lib/services/server.d.ts.map +1 -0
- package/lib/services/server.js +46 -0
- package/lib/services/server.js.map +1 -0
- package/lib/services/snapshots.d.ts +208 -0
- package/lib/services/snapshots.d.ts.map +1 -0
- package/lib/services/snapshots.js +189 -0
- package/lib/services/snapshots.js.map +1 -0
- package/lib/services/system.d.ts +24 -0
- package/lib/services/system.d.ts.map +1 -0
- package/lib/services/system.js +31 -0
- package/lib/services/system.js.map +1 -0
- package/lib/services/telemetry.d.ts +141 -0
- package/lib/services/telemetry.d.ts.map +1 -0
- package/lib/services/telemetry.js +165 -0
- package/lib/services/telemetry.js.map +1 -0
- package/lib/services/usage.d.ts +111 -0
- package/lib/services/usage.d.ts.map +1 -0
- package/lib/services/usage.js +146 -0
- package/lib/services/usage.js.map +1 -0
- package/lib/services/users.d.ts +125 -0
- package/lib/services/users.d.ts.map +1 -0
- package/lib/services/users.js +172 -0
- package/lib/services/users.js.map +1 -0
- package/lib/services/volumes.d.ts +83 -0
- package/lib/services/volumes.d.ts.map +1 -0
- package/lib/services/volumes.js +96 -0
- package/lib/services/volumes.js.map +1 -0
- package/lib/services/warm_pools.d.ts +79 -0
- package/lib/services/warm_pools.d.ts.map +1 -0
- package/lib/services/warm_pools.js +90 -0
- package/lib/services/warm_pools.js.map +1 -0
- package/lib/services/webhooks.d.ts +67 -0
- package/lib/services/webhooks.d.ts.map +1 -0
- package/lib/services/webhooks.js +103 -0
- package/lib/services/webhooks.js.map +1 -0
- package/lib/traits.d.ts +10 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +11 -0
- package/lib/traits.js.map +1 -0
- package/package.json +78 -7
- package/src/credentials.ts +135 -0
- package/src/endpoints.ts +28 -0
- package/src/errors.ts +85 -0
- package/src/index.ts +33 -0
- package/src/pagination.ts +9 -0
- package/src/protocol.ts +108 -0
- package/src/response-validation.test.ts +45 -0
- package/src/retry.ts +74 -0
- package/src/services/api_keys.ts +378 -0
- package/src/services/audit.ts +416 -0
- package/src/services/computer_use.ts +1496 -0
- package/src/services/config.ts +256 -0
- package/src/services/docker_registry.ts +325 -0
- package/src/services/file_system.ts +575 -0
- package/src/services/git.ts +928 -0
- package/src/services/health.ts +116 -0
- package/src/services/index.ts +31 -0
- package/src/services/info.ts +116 -0
- package/src/services/interpreter.ts +182 -0
- package/src/services/jobs.ts +249 -0
- package/src/services/lsp.ts +367 -0
- package/src/services/object_storage.ts +75 -0
- package/src/services/organizations.ts +2712 -0
- package/src/services/port.ts +87 -0
- package/src/services/preview.ts +256 -0
- package/src/services/process.ts +948 -0
- package/src/services/regions.ts +90 -0
- package/src/services/runners.ts +811 -0
- package/src/services/sandbox.ts +3158 -0
- package/src/services/secret.ts +289 -0
- package/src/services/server.ts +111 -0
- package/src/services/snapshots.ts +508 -0
- package/src/services/system.ts +64 -0
- package/src/services/telemetry.ts +385 -0
- package/src/services/usage.ts +316 -0
- package/src/services/users.ts +380 -0
- package/src/services/volumes.ts +233 -0
- package/src/services/warm_pools.ts +209 -0
- package/src/services/webhooks.ts +214 -0
- package/src/traits.ts +44 -0
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-daytona/specs/{openapi,toolbox-openapi,analytics-openapi}.json). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
DaytonaProtocol,
|
|
7
|
+
type DaytonaOpError,
|
|
8
|
+
type DaytonaOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { UnknownDaytonaError } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { DaytonaOpError, DaytonaOpContext };
|
|
14
|
+
|
|
15
|
+
export interface ActivateSnapshotRequest {
|
|
16
|
+
/** Snapshot ID */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Use with JWT to specify the organization ID */
|
|
19
|
+
xDaytonaOrganizationID?: string;
|
|
20
|
+
}
|
|
21
|
+
export const ActivateSnapshotRequest = /*@__PURE__*/ S.suspend(() =>
|
|
22
|
+
S.Struct({
|
|
23
|
+
id: S.String.pipe(T.Label()),
|
|
24
|
+
xDaytonaOrganizationID: S.optional(
|
|
25
|
+
S.String.pipe(T.Header("X-Daytona-Organization-ID")),
|
|
26
|
+
),
|
|
27
|
+
}).pipe(
|
|
28
|
+
T.Http({ method: "POST", uri: "/snapshots/{id}/activate", code: 200 }),
|
|
29
|
+
),
|
|
30
|
+
).annotate({
|
|
31
|
+
identifier: "ActivateSnapshotRequest",
|
|
32
|
+
}) as any as S.Schema<ActivateSnapshotRequest>;
|
|
33
|
+
|
|
34
|
+
export type SnapshotState =
|
|
35
|
+
| "building"
|
|
36
|
+
| "pending"
|
|
37
|
+
| "pulling"
|
|
38
|
+
| "snapshotting"
|
|
39
|
+
| "active"
|
|
40
|
+
| "inactive"
|
|
41
|
+
| "error"
|
|
42
|
+
| "build_failed"
|
|
43
|
+
| "removing";
|
|
44
|
+
export const SnapshotState = S.String;
|
|
45
|
+
|
|
46
|
+
export type SnapshotDtoEntrypointList = Array<string>;
|
|
47
|
+
export const SnapshotDtoEntrypointList = /*@__PURE__*/ S.Array(
|
|
48
|
+
S.String,
|
|
49
|
+
) as any as S.Schema<SnapshotDtoEntrypointList>;
|
|
50
|
+
|
|
51
|
+
export type GpuType =
|
|
52
|
+
| "H100"
|
|
53
|
+
| "H200"
|
|
54
|
+
| "RTX-PRO-6000"
|
|
55
|
+
| "RTX-4090"
|
|
56
|
+
| "RTX-5090"
|
|
57
|
+
| "MI355X";
|
|
58
|
+
export const GpuType = S.String;
|
|
59
|
+
|
|
60
|
+
/** The context hashes used for the build */
|
|
61
|
+
export type BuildInfoContextHashesList = Array<string>;
|
|
62
|
+
export const BuildInfoContextHashesList = /*@__PURE__*/ S.Array(
|
|
63
|
+
S.String,
|
|
64
|
+
) as any as S.Schema<BuildInfoContextHashesList>;
|
|
65
|
+
|
|
66
|
+
export interface BuildInfo {
|
|
67
|
+
/** The Dockerfile content used for the build */
|
|
68
|
+
dockerfileContent?: string;
|
|
69
|
+
/** The context hashes used for the build */
|
|
70
|
+
contextHashes?: BuildInfoContextHashesList;
|
|
71
|
+
/** The creation timestamp */
|
|
72
|
+
createdAt: string;
|
|
73
|
+
/** The last update timestamp */
|
|
74
|
+
updatedAt: string;
|
|
75
|
+
/** The snapshot reference */
|
|
76
|
+
snapshotRef: string;
|
|
77
|
+
}
|
|
78
|
+
export const BuildInfo = /*@__PURE__*/ S.suspend(() =>
|
|
79
|
+
S.Struct({
|
|
80
|
+
dockerfileContent: S.optional(S.String),
|
|
81
|
+
contextHashes: S.optional(BuildInfoContextHashesList),
|
|
82
|
+
createdAt: S.String,
|
|
83
|
+
updatedAt: S.String,
|
|
84
|
+
snapshotRef: S.String,
|
|
85
|
+
}),
|
|
86
|
+
).annotate({ identifier: "BuildInfo" }) as any as S.Schema<BuildInfo>;
|
|
87
|
+
|
|
88
|
+
/** IDs of regions where the snapshot is available */
|
|
89
|
+
export type SnapshotDtoRegionIdsList = Array<string>;
|
|
90
|
+
export const SnapshotDtoRegionIdsList = /*@__PURE__*/ S.Array(
|
|
91
|
+
S.String,
|
|
92
|
+
) as any as S.Schema<SnapshotDtoRegionIdsList>;
|
|
93
|
+
|
|
94
|
+
/** The sandbox class of the snapshot */
|
|
95
|
+
export type SnapshotDtoSandboxClass =
|
|
96
|
+
| "linux-vm"
|
|
97
|
+
| "container"
|
|
98
|
+
| "android"
|
|
99
|
+
| "windows";
|
|
100
|
+
export const SnapshotDtoSandboxClass = S.String;
|
|
101
|
+
|
|
102
|
+
export interface SnapshotDto {
|
|
103
|
+
id: string;
|
|
104
|
+
organizationId?: string;
|
|
105
|
+
general: boolean;
|
|
106
|
+
name: string;
|
|
107
|
+
imageName?: string;
|
|
108
|
+
state: SnapshotState;
|
|
109
|
+
size: number | null;
|
|
110
|
+
entrypoint: SnapshotDtoEntrypointList | null;
|
|
111
|
+
cpu: number;
|
|
112
|
+
gpu: number;
|
|
113
|
+
/** The GPU type assigned to the snapshot */
|
|
114
|
+
gpuType?: GpuType;
|
|
115
|
+
mem: number;
|
|
116
|
+
disk: number;
|
|
117
|
+
errorReason: string | null;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
updatedAt: string;
|
|
120
|
+
lastUsedAt: string | null;
|
|
121
|
+
/** Build information for the snapshot */
|
|
122
|
+
buildInfo?: BuildInfo;
|
|
123
|
+
/** IDs of regions where the snapshot is available */
|
|
124
|
+
regionIds?: SnapshotDtoRegionIdsList;
|
|
125
|
+
/** The initial runner ID of the snapshot */
|
|
126
|
+
initialRunnerId?: string;
|
|
127
|
+
/** The snapshot reference */
|
|
128
|
+
ref?: string;
|
|
129
|
+
/** The ID of the sandbox the snapshot was created from */
|
|
130
|
+
sourceSandboxId: string | null;
|
|
131
|
+
/** The sandbox class of the snapshot */
|
|
132
|
+
sandboxClass?: SnapshotDtoSandboxClass;
|
|
133
|
+
}
|
|
134
|
+
export const SnapshotDto = /*@__PURE__*/ S.suspend(() =>
|
|
135
|
+
S.Struct({
|
|
136
|
+
id: S.String,
|
|
137
|
+
organizationId: S.optional(S.String),
|
|
138
|
+
general: S.Boolean,
|
|
139
|
+
name: S.String,
|
|
140
|
+
imageName: S.optional(S.String),
|
|
141
|
+
state: SnapshotState,
|
|
142
|
+
size: S.NullOr(S.Number),
|
|
143
|
+
entrypoint: S.NullOr(SnapshotDtoEntrypointList),
|
|
144
|
+
cpu: S.Number,
|
|
145
|
+
gpu: S.Number,
|
|
146
|
+
gpuType: S.optional(GpuType),
|
|
147
|
+
mem: S.Number,
|
|
148
|
+
disk: S.Number,
|
|
149
|
+
errorReason: S.NullOr(S.String),
|
|
150
|
+
createdAt: S.String,
|
|
151
|
+
updatedAt: S.String,
|
|
152
|
+
lastUsedAt: S.NullOr(S.String),
|
|
153
|
+
buildInfo: S.optional(BuildInfo),
|
|
154
|
+
regionIds: S.optional(SnapshotDtoRegionIdsList),
|
|
155
|
+
initialRunnerId: S.optional(S.String),
|
|
156
|
+
ref: S.optional(S.String),
|
|
157
|
+
sourceSandboxId: S.NullOr(S.String),
|
|
158
|
+
sandboxClass: S.optional(SnapshotDtoSandboxClass),
|
|
159
|
+
}),
|
|
160
|
+
).annotate({ identifier: "SnapshotDto" }) as any as S.Schema<SnapshotDto>;
|
|
161
|
+
|
|
162
|
+
/** The entrypoint command for the snapshot */
|
|
163
|
+
export type CreateSnapshotRequestEntrypointList = Array<string>;
|
|
164
|
+
export const CreateSnapshotRequestEntrypointList = /*@__PURE__*/ S.Array(
|
|
165
|
+
S.String,
|
|
166
|
+
) as any as S.Schema<CreateSnapshotRequestEntrypointList>;
|
|
167
|
+
|
|
168
|
+
/** Preferred GPU type for the resulting sandbox. */
|
|
169
|
+
export type CreateSnapshotRequestGpuTypeList = Array<GpuType | (string & {})>;
|
|
170
|
+
export const CreateSnapshotRequestGpuTypeList = /*@__PURE__*/ S.Array(
|
|
171
|
+
GpuType,
|
|
172
|
+
) as any as S.Schema<CreateSnapshotRequestGpuTypeList>;
|
|
173
|
+
|
|
174
|
+
/** The context hashes used for the build */
|
|
175
|
+
export type CreateBuildInfoContextHashesList = Array<string>;
|
|
176
|
+
export const CreateBuildInfoContextHashesList = /*@__PURE__*/ S.Array(
|
|
177
|
+
S.String,
|
|
178
|
+
) as any as S.Schema<CreateBuildInfoContextHashesList>;
|
|
179
|
+
|
|
180
|
+
export interface CreateBuildInfo {
|
|
181
|
+
/** The Dockerfile content used for the build */
|
|
182
|
+
dockerfileContent: string;
|
|
183
|
+
/** The context hashes used for the build */
|
|
184
|
+
contextHashes?: CreateBuildInfoContextHashesList;
|
|
185
|
+
}
|
|
186
|
+
export const CreateBuildInfo = /*@__PURE__*/ S.suspend(() =>
|
|
187
|
+
S.Struct({
|
|
188
|
+
dockerfileContent: S.String,
|
|
189
|
+
contextHashes: S.optional(CreateBuildInfoContextHashesList),
|
|
190
|
+
}),
|
|
191
|
+
).annotate({
|
|
192
|
+
identifier: "CreateBuildInfo",
|
|
193
|
+
}) as any as S.Schema<CreateBuildInfo>;
|
|
194
|
+
|
|
195
|
+
export type SandboxClass = "linux-vm" | "container" | "android" | "windows";
|
|
196
|
+
export const SandboxClass = S.String;
|
|
197
|
+
|
|
198
|
+
export interface CreateSnapshotRequest {
|
|
199
|
+
/** Use with JWT to specify the organization ID */
|
|
200
|
+
xDaytonaOrganizationID?: string;
|
|
201
|
+
/** The name of the snapshot */
|
|
202
|
+
name: string;
|
|
203
|
+
/** The image name of the snapshot */
|
|
204
|
+
imageName?: string;
|
|
205
|
+
/** The entrypoint command for the snapshot */
|
|
206
|
+
entrypoint?: CreateSnapshotRequestEntrypointList;
|
|
207
|
+
/** CPU cores allocated to the resulting sandbox */
|
|
208
|
+
cpu?: number;
|
|
209
|
+
/** GPU units allocated to the resulting sandbox */
|
|
210
|
+
gpu?: number;
|
|
211
|
+
/** Preferred GPU type for the resulting sandbox. */
|
|
212
|
+
gpuType?: CreateSnapshotRequestGpuTypeList;
|
|
213
|
+
/** Memory allocated to the resulting sandbox in GB */
|
|
214
|
+
memory?: number;
|
|
215
|
+
/** Disk space allocated to the sandbox in GB */
|
|
216
|
+
disk?: number;
|
|
217
|
+
/** Build information for the snapshot */
|
|
218
|
+
buildInfo?: CreateBuildInfo;
|
|
219
|
+
/** ID of the region where the snapshot will be available. Defaults to organization default region if not specified. */
|
|
220
|
+
regionId?: string;
|
|
221
|
+
/** Target sandbox class. Determines which runners can host sandboxes created from this snapshot. */
|
|
222
|
+
sandboxClass?: SandboxClass | (string & {});
|
|
223
|
+
}
|
|
224
|
+
export const CreateSnapshotRequest = /*@__PURE__*/ S.suspend(() =>
|
|
225
|
+
S.Struct({
|
|
226
|
+
xDaytonaOrganizationID: S.optional(
|
|
227
|
+
S.String.pipe(T.Header("X-Daytona-Organization-ID")),
|
|
228
|
+
),
|
|
229
|
+
name: S.String,
|
|
230
|
+
imageName: S.optional(S.String),
|
|
231
|
+
entrypoint: S.optional(CreateSnapshotRequestEntrypointList),
|
|
232
|
+
cpu: S.optional(S.Number),
|
|
233
|
+
gpu: S.optional(S.Number),
|
|
234
|
+
gpuType: S.optional(CreateSnapshotRequestGpuTypeList),
|
|
235
|
+
memory: S.optional(S.Number),
|
|
236
|
+
disk: S.optional(S.Number),
|
|
237
|
+
buildInfo: S.optional(CreateBuildInfo),
|
|
238
|
+
regionId: S.optional(S.String),
|
|
239
|
+
sandboxClass: S.optional(SandboxClass),
|
|
240
|
+
}).pipe(T.Http({ method: "POST", uri: "/snapshots", code: 200 })),
|
|
241
|
+
).annotate({
|
|
242
|
+
identifier: "CreateSnapshotRequest",
|
|
243
|
+
}) as any as S.Schema<CreateSnapshotRequest>;
|
|
244
|
+
|
|
245
|
+
export interface DeactivateSnapshotRequest {
|
|
246
|
+
/** Snapshot ID */
|
|
247
|
+
id: string;
|
|
248
|
+
/** Use with JWT to specify the organization ID */
|
|
249
|
+
xDaytonaOrganizationID?: string;
|
|
250
|
+
}
|
|
251
|
+
export const DeactivateSnapshotRequest = /*@__PURE__*/ S.suspend(() =>
|
|
252
|
+
S.Struct({
|
|
253
|
+
id: S.String.pipe(T.Label()),
|
|
254
|
+
xDaytonaOrganizationID: S.optional(
|
|
255
|
+
S.String.pipe(T.Header("X-Daytona-Organization-ID")),
|
|
256
|
+
),
|
|
257
|
+
}).pipe(
|
|
258
|
+
T.Http({ method: "POST", uri: "/snapshots/{id}/deactivate", code: 200 }),
|
|
259
|
+
),
|
|
260
|
+
).annotate({
|
|
261
|
+
identifier: "DeactivateSnapshotRequest",
|
|
262
|
+
}) as any as S.Schema<DeactivateSnapshotRequest>;
|
|
263
|
+
|
|
264
|
+
export interface DeactivateSnapshotResponse {}
|
|
265
|
+
export const DeactivateSnapshotResponse = /*@__PURE__*/ S.suspend(() =>
|
|
266
|
+
S.Struct({}),
|
|
267
|
+
).annotate({
|
|
268
|
+
identifier: "DeactivateSnapshotResponse",
|
|
269
|
+
}) as any as S.Schema<DeactivateSnapshotResponse>;
|
|
270
|
+
|
|
271
|
+
export type GetAllSnapshotsRequestSort =
|
|
272
|
+
| "name"
|
|
273
|
+
| "state"
|
|
274
|
+
| "lastUsedAt"
|
|
275
|
+
| "createdAt";
|
|
276
|
+
export const GetAllSnapshotsRequestSort = S.String;
|
|
277
|
+
|
|
278
|
+
export type GetAllSnapshotsRequestOrder = "asc" | "desc";
|
|
279
|
+
export const GetAllSnapshotsRequestOrder = S.String;
|
|
280
|
+
|
|
281
|
+
export interface GetAllSnapshotsRequest {
|
|
282
|
+
/** Page number of the results */
|
|
283
|
+
page?: number;
|
|
284
|
+
/** Number of results per page */
|
|
285
|
+
limit?: number;
|
|
286
|
+
/** Filter by partial name match */
|
|
287
|
+
name?: string;
|
|
288
|
+
/** Filter by the ID of the sandbox the snapshot was created from */
|
|
289
|
+
sourceSandboxId?: string;
|
|
290
|
+
/** Field to sort by */
|
|
291
|
+
sort?: GetAllSnapshotsRequestSort | (string & {});
|
|
292
|
+
/** Direction to sort by */
|
|
293
|
+
order?: GetAllSnapshotsRequestOrder | (string & {});
|
|
294
|
+
/** Use with JWT to specify the organization ID */
|
|
295
|
+
xDaytonaOrganizationID?: string;
|
|
296
|
+
}
|
|
297
|
+
export const GetAllSnapshotsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
298
|
+
S.Struct({
|
|
299
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
300
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
301
|
+
name: S.optional(S.String.pipe(T.Query())),
|
|
302
|
+
sourceSandboxId: S.optional(S.String.pipe(T.Query())),
|
|
303
|
+
sort: S.optional(GetAllSnapshotsRequestSort.pipe(T.Query())),
|
|
304
|
+
order: S.optional(GetAllSnapshotsRequestOrder.pipe(T.Query())),
|
|
305
|
+
xDaytonaOrganizationID: S.optional(
|
|
306
|
+
S.String.pipe(T.Header("X-Daytona-Organization-ID")),
|
|
307
|
+
),
|
|
308
|
+
}).pipe(T.Http({ method: "GET", uri: "/snapshots", code: 200 })),
|
|
309
|
+
).annotate({
|
|
310
|
+
identifier: "GetAllSnapshotsRequest",
|
|
311
|
+
}) as any as S.Schema<GetAllSnapshotsRequest>;
|
|
312
|
+
|
|
313
|
+
export type PaginatedSnapshotsItemsList = Array<SnapshotDto>;
|
|
314
|
+
export const PaginatedSnapshotsItemsList = /*@__PURE__*/ S.Array(
|
|
315
|
+
SnapshotDto,
|
|
316
|
+
) as any as S.Schema<PaginatedSnapshotsItemsList>;
|
|
317
|
+
|
|
318
|
+
export interface PaginatedSnapshots {
|
|
319
|
+
items: PaginatedSnapshotsItemsList;
|
|
320
|
+
total: number;
|
|
321
|
+
page: number;
|
|
322
|
+
totalPages: number;
|
|
323
|
+
}
|
|
324
|
+
export const PaginatedSnapshots = /*@__PURE__*/ S.suspend(() =>
|
|
325
|
+
S.Struct({
|
|
326
|
+
items: PaginatedSnapshotsItemsList,
|
|
327
|
+
total: S.Number,
|
|
328
|
+
page: S.Number,
|
|
329
|
+
totalPages: S.Number,
|
|
330
|
+
}),
|
|
331
|
+
).annotate({
|
|
332
|
+
identifier: "PaginatedSnapshots",
|
|
333
|
+
}) as any as S.Schema<PaginatedSnapshots>;
|
|
334
|
+
|
|
335
|
+
export interface GetSnapshotRequest {
|
|
336
|
+
/** Snapshot ID or name */
|
|
337
|
+
id: string;
|
|
338
|
+
/** Use with JWT to specify the organization ID */
|
|
339
|
+
xDaytonaOrganizationID?: string;
|
|
340
|
+
}
|
|
341
|
+
export const GetSnapshotRequest = /*@__PURE__*/ S.suspend(() =>
|
|
342
|
+
S.Struct({
|
|
343
|
+
id: S.String.pipe(T.Label()),
|
|
344
|
+
xDaytonaOrganizationID: S.optional(
|
|
345
|
+
S.String.pipe(T.Header("X-Daytona-Organization-ID")),
|
|
346
|
+
),
|
|
347
|
+
}).pipe(T.Http({ method: "GET", uri: "/snapshots/{id}", code: 200 })),
|
|
348
|
+
).annotate({
|
|
349
|
+
identifier: "GetSnapshotRequest",
|
|
350
|
+
}) as any as S.Schema<GetSnapshotRequest>;
|
|
351
|
+
|
|
352
|
+
export interface GetSnapshotBuildLogsUrlRequest {
|
|
353
|
+
/** Snapshot ID */
|
|
354
|
+
id: string;
|
|
355
|
+
/** Use with JWT to specify the organization ID */
|
|
356
|
+
xDaytonaOrganizationID?: string;
|
|
357
|
+
}
|
|
358
|
+
export const GetSnapshotBuildLogsUrlRequest = /*@__PURE__*/ S.suspend(() =>
|
|
359
|
+
S.Struct({
|
|
360
|
+
id: S.String.pipe(T.Label()),
|
|
361
|
+
xDaytonaOrganizationID: S.optional(
|
|
362
|
+
S.String.pipe(T.Header("X-Daytona-Organization-ID")),
|
|
363
|
+
),
|
|
364
|
+
}).pipe(
|
|
365
|
+
T.Http({ method: "GET", uri: "/snapshots/{id}/build-logs-url", code: 200 }),
|
|
366
|
+
),
|
|
367
|
+
).annotate({
|
|
368
|
+
identifier: "GetSnapshotBuildLogsUrlRequest",
|
|
369
|
+
}) as any as S.Schema<GetSnapshotBuildLogsUrlRequest>;
|
|
370
|
+
|
|
371
|
+
export interface Url {
|
|
372
|
+
/** URL response */
|
|
373
|
+
url: string;
|
|
374
|
+
}
|
|
375
|
+
export const Url = /*@__PURE__*/ S.suspend(() =>
|
|
376
|
+
S.Struct({
|
|
377
|
+
url: S.String,
|
|
378
|
+
}),
|
|
379
|
+
).annotate({ identifier: "Url" }) as any as S.Schema<Url>;
|
|
380
|
+
|
|
381
|
+
export interface RemoveSnapshotRequest {
|
|
382
|
+
/** Snapshot ID */
|
|
383
|
+
id: string;
|
|
384
|
+
/** Use with JWT to specify the organization ID */
|
|
385
|
+
xDaytonaOrganizationID?: string;
|
|
386
|
+
}
|
|
387
|
+
export const RemoveSnapshotRequest = /*@__PURE__*/ S.suspend(() =>
|
|
388
|
+
S.Struct({
|
|
389
|
+
id: S.String.pipe(T.Label()),
|
|
390
|
+
xDaytonaOrganizationID: S.optional(
|
|
391
|
+
S.String.pipe(T.Header("X-Daytona-Organization-ID")),
|
|
392
|
+
),
|
|
393
|
+
}).pipe(T.Http({ method: "DELETE", uri: "/snapshots/{id}", code: 200 })),
|
|
394
|
+
).annotate({
|
|
395
|
+
identifier: "RemoveSnapshotRequest",
|
|
396
|
+
}) as any as S.Schema<RemoveSnapshotRequest>;
|
|
397
|
+
|
|
398
|
+
export interface RemoveSnapshotResponse {}
|
|
399
|
+
export const RemoveSnapshotResponse = /*@__PURE__*/ S.suspend(() =>
|
|
400
|
+
S.Struct({}),
|
|
401
|
+
).annotate({
|
|
402
|
+
identifier: "RemoveSnapshotResponse",
|
|
403
|
+
}) as any as S.Schema<RemoveSnapshotResponse>;
|
|
404
|
+
|
|
405
|
+
export type ActivateSnapshotError = DaytonaOpError;
|
|
406
|
+
/** Activate a snapshot */
|
|
407
|
+
export const activateSnapshot: API.OperationMethod<
|
|
408
|
+
ActivateSnapshotRequest,
|
|
409
|
+
SnapshotDto,
|
|
410
|
+
ActivateSnapshotError,
|
|
411
|
+
DaytonaOpContext
|
|
412
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
413
|
+
input: ActivateSnapshotRequest,
|
|
414
|
+
output: SnapshotDto,
|
|
415
|
+
errors: [UnknownDaytonaError],
|
|
416
|
+
protocol: DaytonaProtocol,
|
|
417
|
+
retry: Retry.Retry,
|
|
418
|
+
}));
|
|
419
|
+
|
|
420
|
+
export type CreateSnapshotError = DaytonaOpError;
|
|
421
|
+
/** Create a new snapshot */
|
|
422
|
+
export const createSnapshot: API.OperationMethod<
|
|
423
|
+
CreateSnapshotRequest,
|
|
424
|
+
SnapshotDto,
|
|
425
|
+
CreateSnapshotError,
|
|
426
|
+
DaytonaOpContext
|
|
427
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
428
|
+
input: CreateSnapshotRequest,
|
|
429
|
+
output: SnapshotDto,
|
|
430
|
+
errors: [UnknownDaytonaError],
|
|
431
|
+
protocol: DaytonaProtocol,
|
|
432
|
+
retry: Retry.Retry,
|
|
433
|
+
}));
|
|
434
|
+
|
|
435
|
+
export type DeactivateSnapshotError = DaytonaOpError;
|
|
436
|
+
/** Deactivate a snapshot */
|
|
437
|
+
export const deactivateSnapshot: API.OperationMethod<
|
|
438
|
+
DeactivateSnapshotRequest,
|
|
439
|
+
DeactivateSnapshotResponse,
|
|
440
|
+
DeactivateSnapshotError,
|
|
441
|
+
DaytonaOpContext
|
|
442
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
443
|
+
input: DeactivateSnapshotRequest,
|
|
444
|
+
output: DeactivateSnapshotResponse,
|
|
445
|
+
errors: [UnknownDaytonaError],
|
|
446
|
+
protocol: DaytonaProtocol,
|
|
447
|
+
retry: Retry.Retry,
|
|
448
|
+
}));
|
|
449
|
+
|
|
450
|
+
export type GetAllSnapshotsError = DaytonaOpError;
|
|
451
|
+
/** List all snapshots */
|
|
452
|
+
export const getAllSnapshots: API.OperationMethod<
|
|
453
|
+
GetAllSnapshotsRequest,
|
|
454
|
+
PaginatedSnapshots,
|
|
455
|
+
GetAllSnapshotsError,
|
|
456
|
+
DaytonaOpContext
|
|
457
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
458
|
+
input: GetAllSnapshotsRequest,
|
|
459
|
+
output: PaginatedSnapshots,
|
|
460
|
+
errors: [UnknownDaytonaError],
|
|
461
|
+
protocol: DaytonaProtocol,
|
|
462
|
+
retry: Retry.Retry,
|
|
463
|
+
}));
|
|
464
|
+
|
|
465
|
+
export type GetSnapshotError = DaytonaOpError;
|
|
466
|
+
/** Get snapshot by ID or name */
|
|
467
|
+
export const getSnapshot: API.OperationMethod<
|
|
468
|
+
GetSnapshotRequest,
|
|
469
|
+
SnapshotDto,
|
|
470
|
+
GetSnapshotError,
|
|
471
|
+
DaytonaOpContext
|
|
472
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
473
|
+
input: GetSnapshotRequest,
|
|
474
|
+
output: SnapshotDto,
|
|
475
|
+
errors: [UnknownDaytonaError],
|
|
476
|
+
protocol: DaytonaProtocol,
|
|
477
|
+
retry: Retry.Retry,
|
|
478
|
+
}));
|
|
479
|
+
|
|
480
|
+
export type GetSnapshotBuildLogsUrlError = DaytonaOpError;
|
|
481
|
+
/** Get snapshot build logs URL */
|
|
482
|
+
export const getSnapshotBuildLogsUrl: API.OperationMethod<
|
|
483
|
+
GetSnapshotBuildLogsUrlRequest,
|
|
484
|
+
Url,
|
|
485
|
+
GetSnapshotBuildLogsUrlError,
|
|
486
|
+
DaytonaOpContext
|
|
487
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
488
|
+
input: GetSnapshotBuildLogsUrlRequest,
|
|
489
|
+
output: Url,
|
|
490
|
+
errors: [UnknownDaytonaError],
|
|
491
|
+
protocol: DaytonaProtocol,
|
|
492
|
+
retry: Retry.Retry,
|
|
493
|
+
}));
|
|
494
|
+
|
|
495
|
+
export type RemoveSnapshotError = DaytonaOpError;
|
|
496
|
+
/** Delete snapshot */
|
|
497
|
+
export const removeSnapshot: API.OperationMethod<
|
|
498
|
+
RemoveSnapshotRequest,
|
|
499
|
+
RemoveSnapshotResponse,
|
|
500
|
+
RemoveSnapshotError,
|
|
501
|
+
DaytonaOpContext
|
|
502
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
503
|
+
input: RemoveSnapshotRequest,
|
|
504
|
+
output: RemoveSnapshotResponse,
|
|
505
|
+
errors: [UnknownDaytonaError],
|
|
506
|
+
protocol: DaytonaProtocol,
|
|
507
|
+
retry: Retry.Retry,
|
|
508
|
+
}));
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-daytona/specs/{openapi,toolbox-openapi,analytics-openapi}.json). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
DaytonaProtocol,
|
|
7
|
+
type DaytonaOpError,
|
|
8
|
+
type DaytonaOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { UnknownDaytonaError } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { DaytonaOpError, DaytonaOpContext };
|
|
14
|
+
|
|
15
|
+
export interface GetSystemMetricsRequest {}
|
|
16
|
+
export const GetSystemMetricsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
17
|
+
S.Struct({}).pipe(
|
|
18
|
+
T.Http({ method: "GET", uri: "/system/metrics", code: 200 }),
|
|
19
|
+
),
|
|
20
|
+
).annotate({
|
|
21
|
+
identifier: "GetSystemMetricsRequest",
|
|
22
|
+
}) as any as S.Schema<GetSystemMetricsRequest>;
|
|
23
|
+
|
|
24
|
+
export interface SystemMetrics {
|
|
25
|
+
cpuCount?: number;
|
|
26
|
+
cpuUsedPct?: number;
|
|
27
|
+
diskFree?: number;
|
|
28
|
+
diskTotal?: number;
|
|
29
|
+
diskUsed?: number;
|
|
30
|
+
memCache?: number;
|
|
31
|
+
memTotal?: number;
|
|
32
|
+
memUsed?: number;
|
|
33
|
+
timestamp?: string;
|
|
34
|
+
timestampUnix?: number;
|
|
35
|
+
}
|
|
36
|
+
export const SystemMetrics = /*@__PURE__*/ S.suspend(() =>
|
|
37
|
+
S.Struct({
|
|
38
|
+
cpuCount: S.optional(S.Number),
|
|
39
|
+
cpuUsedPct: S.optional(S.Number),
|
|
40
|
+
diskFree: S.optional(S.Number),
|
|
41
|
+
diskTotal: S.optional(S.Number),
|
|
42
|
+
diskUsed: S.optional(S.Number),
|
|
43
|
+
memCache: S.optional(S.Number),
|
|
44
|
+
memTotal: S.optional(S.Number),
|
|
45
|
+
memUsed: S.optional(S.Number),
|
|
46
|
+
timestamp: S.optional(S.String),
|
|
47
|
+
timestampUnix: S.optional(S.Number),
|
|
48
|
+
}),
|
|
49
|
+
).annotate({ identifier: "SystemMetrics" }) as any as S.Schema<SystemMetrics>;
|
|
50
|
+
|
|
51
|
+
export type GetSystemMetricsError = DaytonaOpError;
|
|
52
|
+
/** Get sandbox resource metrics Latest CPU/memory/disk usage snapshot for the sandbox. cpuUsedPct is the average CPU usage as a percentage of the CPU limit over the last sample window (0 until the first sample completes). Byte fields are in bytes. */
|
|
53
|
+
export const getSystemMetrics: API.OperationMethod<
|
|
54
|
+
GetSystemMetricsRequest,
|
|
55
|
+
SystemMetrics,
|
|
56
|
+
GetSystemMetricsError,
|
|
57
|
+
DaytonaOpContext
|
|
58
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
59
|
+
input: GetSystemMetricsRequest,
|
|
60
|
+
output: SystemMetrics,
|
|
61
|
+
errors: [UnknownDaytonaError],
|
|
62
|
+
protocol: DaytonaProtocol,
|
|
63
|
+
retry: Retry.Retry,
|
|
64
|
+
}));
|