@agentuity/sandbox 3.0.12 → 3.1.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/AGENTS.md +3 -3
- package/dist/api-reference.d.ts +1221 -0
- package/dist/api-reference.d.ts.map +1 -0
- package/dist/api-reference.js +1046 -0
- package/dist/api-reference.js.map +1 -0
- package/dist/base64.d.ts +2 -0
- package/dist/base64.d.ts.map +1 -0
- package/dist/base64.js +14 -0
- package/dist/base64.js.map +1 -0
- package/dist/client.d.ts +431 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +632 -0
- package/dist/client.js.map +1 -0
- package/dist/create.d.ts +203 -0
- package/dist/create.d.ts.map +1 -0
- package/dist/create.js +235 -0
- package/dist/create.js.map +1 -0
- package/dist/destroy.d.ts +23 -0
- package/dist/destroy.d.ts.map +1 -0
- package/dist/destroy.js +30 -0
- package/dist/destroy.js.map +1 -0
- package/dist/disk-checkpoint.d.ts +108 -0
- package/dist/disk-checkpoint.d.ts.map +1 -0
- package/dist/disk-checkpoint.js +124 -0
- package/dist/disk-checkpoint.js.map +1 -0
- package/dist/events.d.ts +56 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +54 -0
- package/dist/events.js.map +1 -0
- package/dist/execute.d.ts +99 -0
- package/dist/execute.d.ts.map +1 -0
- package/dist/execute.js +138 -0
- package/dist/execute.js.map +1 -0
- package/dist/execution.d.ts +150 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/execution.js +120 -0
- package/dist/execution.js.map +1 -0
- package/dist/files.d.ts +283 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +471 -0
- package/dist/files.js.map +1 -0
- package/dist/get.d.ts +288 -0
- package/dist/get.d.ts.map +1 -0
- package/dist/get.js +256 -0
- package/dist/get.js.map +1 -0
- package/dist/getStatus.d.ts +23 -0
- package/dist/getStatus.d.ts.map +1 -0
- package/dist/getStatus.js +53 -0
- package/dist/getStatus.js.map +1 -0
- package/dist/index.d.ts +42 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/job.d.ts +227 -0
- package/dist/job.d.ts.map +1 -0
- package/dist/job.js +109 -0
- package/dist/job.js.map +1 -0
- package/dist/list.d.ts +330 -0
- package/dist/list.d.ts.map +1 -0
- package/dist/list.js +209 -0
- package/dist/list.js.map +1 -0
- package/dist/pause.d.ts +39 -0
- package/dist/pause.d.ts.map +1 -0
- package/dist/pause.js +48 -0
- package/dist/pause.js.map +1 -0
- package/dist/resolve.d.ts +75 -0
- package/dist/resolve.d.ts.map +1 -0
- package/dist/resolve.js +76 -0
- package/dist/resolve.js.map +1 -0
- package/dist/resume.d.ts +23 -0
- package/dist/resume.d.ts.map +1 -0
- package/dist/resume.js +30 -0
- package/dist/resume.js.map +1 -0
- package/dist/run.d.ts +73 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +568 -0
- package/dist/run.js.map +1 -0
- package/dist/runtime.d.ts +94 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +82 -0
- package/dist/runtime.js.map +1 -0
- package/dist/snapshot-build.d.ts +48 -0
- package/dist/snapshot-build.d.ts.map +1 -0
- package/dist/snapshot-build.js +72 -0
- package/dist/snapshot-build.js.map +1 -0
- package/dist/snapshot.d.ts +596 -0
- package/dist/snapshot.d.ts.map +1 -0
- package/dist/snapshot.js +612 -0
- package/dist/snapshot.js.map +1 -0
- package/dist/types.d.ts +1010 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +853 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +296 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +234 -0
- package/dist/util.js.map +1 -0
- package/package.json +7 -2
- package/src/api-reference.ts +1094 -0
- package/src/base64.ts +14 -0
- package/src/client.ts +998 -0
- package/src/create.ts +273 -0
- package/src/destroy.ts +43 -0
- package/src/disk-checkpoint.ts +184 -0
- package/src/events.ts +72 -0
- package/src/execute.ts +167 -0
- package/src/execution.ts +152 -0
- package/src/files.ts +637 -0
- package/src/get.ts +291 -0
- package/src/getStatus.ts +72 -0
- package/src/index.ts +252 -18
- package/src/job.ts +161 -0
- package/src/list.ts +239 -0
- package/src/pause.ts +75 -0
- package/src/resolve.ts +96 -0
- package/src/resume.ts +41 -0
- package/src/run.ts +783 -0
- package/src/runtime.ts +106 -0
- package/src/snapshot-build.ts +94 -0
- package/src/snapshot.ts +791 -0
- package/src/types.ts +1033 -0
- package/src/util.ts +280 -0
package/dist/list.d.ts
ADDED
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import type { ListSandboxesResponse } from './types.ts';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type APIClient } from '@agentuity/api';
|
|
4
|
+
export declare const SandboxOrgInfoSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const SandboxRuntimeInfoSchema: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
12
|
+
brandColor: z.ZodOptional<z.ZodString>;
|
|
13
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const SandboxSnapshotUserInfoSchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
18
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const SandboxSnapshotOrgInfoSchema: z.ZodObject<{
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export declare const SandboxSnapshotInfoSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
name: z.ZodOptional<z.ZodString>;
|
|
28
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
29
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
30
|
+
public: z.ZodLiteral<true>;
|
|
31
|
+
org: z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
name: z.ZodOptional<z.ZodString>;
|
|
39
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
40
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
41
|
+
public: z.ZodLiteral<false>;
|
|
42
|
+
user: z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
45
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strip>]>;
|
|
48
|
+
export declare const SandboxInfoSchema: z.ZodObject<{
|
|
49
|
+
sandboxId: z.ZodString;
|
|
50
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
51
|
+
name: z.ZodOptional<z.ZodString>;
|
|
52
|
+
description: z.ZodOptional<z.ZodString>;
|
|
53
|
+
status: z.ZodEnum<{
|
|
54
|
+
creating: "creating";
|
|
55
|
+
deleted: "deleted";
|
|
56
|
+
failed: "failed";
|
|
57
|
+
idle: "idle";
|
|
58
|
+
paused: "paused";
|
|
59
|
+
running: "running";
|
|
60
|
+
stopping: "stopping";
|
|
61
|
+
suspended: "suspended";
|
|
62
|
+
terminated: "terminated";
|
|
63
|
+
}>;
|
|
64
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
65
|
+
createdAt: z.ZodString;
|
|
66
|
+
region: z.ZodOptional<z.ZodString>;
|
|
67
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
name: z.ZodString;
|
|
70
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
71
|
+
brandColor: z.ZodOptional<z.ZodString>;
|
|
72
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
name: z.ZodOptional<z.ZodString>;
|
|
77
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
78
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
79
|
+
public: z.ZodLiteral<true>;
|
|
80
|
+
org: z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
name: z.ZodOptional<z.ZodString>;
|
|
88
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
89
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
90
|
+
public: z.ZodLiteral<false>;
|
|
91
|
+
user: z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
94
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, z.core.$strip>;
|
|
96
|
+
}, z.core.$strip>]>>;
|
|
97
|
+
executions: z.ZodNumber;
|
|
98
|
+
stdoutStreamUrl: z.ZodOptional<z.ZodString>;
|
|
99
|
+
stderrStreamUrl: z.ZodOptional<z.ZodString>;
|
|
100
|
+
auditStreamId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
auditStreamUrl: z.ZodOptional<z.ZodString>;
|
|
102
|
+
networkEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
networkPort: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
url: z.ZodOptional<z.ZodString>;
|
|
105
|
+
org: z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
name: z.ZodString;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
timeout: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
idle: z.ZodOptional<z.ZodString>;
|
|
111
|
+
execution: z.ZodOptional<z.ZodString>;
|
|
112
|
+
paused: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
command: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
exec: z.ZodArray<z.ZodString>;
|
|
116
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
117
|
+
interactive: "interactive";
|
|
118
|
+
oneshot: "oneshot";
|
|
119
|
+
}>>;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export declare const ListSandboxesDataSchema: z.ZodObject<{
|
|
123
|
+
sandboxes: z.ZodArray<z.ZodObject<{
|
|
124
|
+
sandboxId: z.ZodString;
|
|
125
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
126
|
+
name: z.ZodOptional<z.ZodString>;
|
|
127
|
+
description: z.ZodOptional<z.ZodString>;
|
|
128
|
+
status: z.ZodEnum<{
|
|
129
|
+
creating: "creating";
|
|
130
|
+
deleted: "deleted";
|
|
131
|
+
failed: "failed";
|
|
132
|
+
idle: "idle";
|
|
133
|
+
paused: "paused";
|
|
134
|
+
running: "running";
|
|
135
|
+
stopping: "stopping";
|
|
136
|
+
suspended: "suspended";
|
|
137
|
+
terminated: "terminated";
|
|
138
|
+
}>;
|
|
139
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
140
|
+
createdAt: z.ZodString;
|
|
141
|
+
region: z.ZodOptional<z.ZodString>;
|
|
142
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
146
|
+
brandColor: z.ZodOptional<z.ZodString>;
|
|
147
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
150
|
+
id: z.ZodString;
|
|
151
|
+
name: z.ZodOptional<z.ZodString>;
|
|
152
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
153
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
154
|
+
public: z.ZodLiteral<true>;
|
|
155
|
+
org: z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
name: z.ZodString;
|
|
158
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>;
|
|
160
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
name: z.ZodOptional<z.ZodString>;
|
|
163
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
164
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
165
|
+
public: z.ZodLiteral<false>;
|
|
166
|
+
user: z.ZodObject<{
|
|
167
|
+
id: z.ZodString;
|
|
168
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
169
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
}, z.core.$strip>]>>;
|
|
172
|
+
executions: z.ZodNumber;
|
|
173
|
+
stdoutStreamUrl: z.ZodOptional<z.ZodString>;
|
|
174
|
+
stderrStreamUrl: z.ZodOptional<z.ZodString>;
|
|
175
|
+
auditStreamId: z.ZodOptional<z.ZodString>;
|
|
176
|
+
auditStreamUrl: z.ZodOptional<z.ZodString>;
|
|
177
|
+
networkEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
networkPort: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
url: z.ZodOptional<z.ZodString>;
|
|
180
|
+
org: z.ZodObject<{
|
|
181
|
+
id: z.ZodString;
|
|
182
|
+
name: z.ZodString;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
timeout: z.ZodOptional<z.ZodObject<{
|
|
185
|
+
idle: z.ZodOptional<z.ZodString>;
|
|
186
|
+
execution: z.ZodOptional<z.ZodString>;
|
|
187
|
+
paused: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
command: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
exec: z.ZodArray<z.ZodString>;
|
|
191
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
192
|
+
interactive: "interactive";
|
|
193
|
+
oneshot: "oneshot";
|
|
194
|
+
}>>;
|
|
195
|
+
}, z.core.$strip>>;
|
|
196
|
+
}, z.core.$strip>>;
|
|
197
|
+
total: z.ZodNumber;
|
|
198
|
+
}, z.core.$strip>;
|
|
199
|
+
export declare const ListSandboxesResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
200
|
+
success: z.ZodLiteral<false>;
|
|
201
|
+
message: z.ZodString;
|
|
202
|
+
code: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
+
success: z.ZodLiteral<true>;
|
|
205
|
+
data: z.ZodObject<{
|
|
206
|
+
sandboxes: z.ZodArray<z.ZodObject<{
|
|
207
|
+
sandboxId: z.ZodString;
|
|
208
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
209
|
+
name: z.ZodOptional<z.ZodString>;
|
|
210
|
+
description: z.ZodOptional<z.ZodString>;
|
|
211
|
+
status: z.ZodEnum<{
|
|
212
|
+
creating: "creating";
|
|
213
|
+
deleted: "deleted";
|
|
214
|
+
failed: "failed";
|
|
215
|
+
idle: "idle";
|
|
216
|
+
paused: "paused";
|
|
217
|
+
running: "running";
|
|
218
|
+
stopping: "stopping";
|
|
219
|
+
suspended: "suspended";
|
|
220
|
+
terminated: "terminated";
|
|
221
|
+
}>;
|
|
222
|
+
mode: z.ZodOptional<z.ZodString>;
|
|
223
|
+
createdAt: z.ZodString;
|
|
224
|
+
region: z.ZodOptional<z.ZodString>;
|
|
225
|
+
runtime: z.ZodOptional<z.ZodObject<{
|
|
226
|
+
id: z.ZodString;
|
|
227
|
+
name: z.ZodString;
|
|
228
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
229
|
+
brandColor: z.ZodOptional<z.ZodString>;
|
|
230
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
snapshot: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
233
|
+
id: z.ZodString;
|
|
234
|
+
name: z.ZodOptional<z.ZodString>;
|
|
235
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
236
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
237
|
+
public: z.ZodLiteral<true>;
|
|
238
|
+
org: z.ZodObject<{
|
|
239
|
+
id: z.ZodString;
|
|
240
|
+
name: z.ZodString;
|
|
241
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
name: z.ZodOptional<z.ZodString>;
|
|
246
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
247
|
+
fullName: z.ZodOptional<z.ZodString>;
|
|
248
|
+
public: z.ZodLiteral<false>;
|
|
249
|
+
user: z.ZodObject<{
|
|
250
|
+
id: z.ZodString;
|
|
251
|
+
firstName: z.ZodOptional<z.ZodString>;
|
|
252
|
+
lastName: z.ZodOptional<z.ZodString>;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
}, z.core.$strip>]>>;
|
|
255
|
+
executions: z.ZodNumber;
|
|
256
|
+
stdoutStreamUrl: z.ZodOptional<z.ZodString>;
|
|
257
|
+
stderrStreamUrl: z.ZodOptional<z.ZodString>;
|
|
258
|
+
auditStreamId: z.ZodOptional<z.ZodString>;
|
|
259
|
+
auditStreamUrl: z.ZodOptional<z.ZodString>;
|
|
260
|
+
networkEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
networkPort: z.ZodOptional<z.ZodNumber>;
|
|
262
|
+
url: z.ZodOptional<z.ZodString>;
|
|
263
|
+
org: z.ZodObject<{
|
|
264
|
+
id: z.ZodString;
|
|
265
|
+
name: z.ZodString;
|
|
266
|
+
}, z.core.$strip>;
|
|
267
|
+
timeout: z.ZodOptional<z.ZodObject<{
|
|
268
|
+
idle: z.ZodOptional<z.ZodString>;
|
|
269
|
+
execution: z.ZodOptional<z.ZodString>;
|
|
270
|
+
paused: z.ZodOptional<z.ZodString>;
|
|
271
|
+
}, z.core.$strip>>;
|
|
272
|
+
command: z.ZodOptional<z.ZodObject<{
|
|
273
|
+
exec: z.ZodArray<z.ZodString>;
|
|
274
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
275
|
+
interactive: "interactive";
|
|
276
|
+
oneshot: "oneshot";
|
|
277
|
+
}>>;
|
|
278
|
+
}, z.core.$strip>>;
|
|
279
|
+
}, z.core.$strip>>;
|
|
280
|
+
total: z.ZodNumber;
|
|
281
|
+
}, z.core.$strip>;
|
|
282
|
+
}, z.core.$strip>], "success">;
|
|
283
|
+
export declare const SandboxListParamsSchema: z.ZodObject<{
|
|
284
|
+
name: z.ZodOptional<z.ZodString>;
|
|
285
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
286
|
+
interactive: "interactive";
|
|
287
|
+
oneshot: "oneshot";
|
|
288
|
+
}>>;
|
|
289
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
290
|
+
snapshotId: z.ZodOptional<z.ZodString>;
|
|
291
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
292
|
+
creating: "creating";
|
|
293
|
+
deleted: "deleted";
|
|
294
|
+
failed: "failed";
|
|
295
|
+
idle: "idle";
|
|
296
|
+
paused: "paused";
|
|
297
|
+
running: "running";
|
|
298
|
+
stopping: "stopping";
|
|
299
|
+
suspended: "suspended";
|
|
300
|
+
terminated: "terminated";
|
|
301
|
+
}>>;
|
|
302
|
+
live: z.ZodOptional<z.ZodBoolean>;
|
|
303
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
306
|
+
created: "created";
|
|
307
|
+
execution_count: "execution_count";
|
|
308
|
+
mode: "mode";
|
|
309
|
+
name: "name";
|
|
310
|
+
status: "status";
|
|
311
|
+
updated: "updated";
|
|
312
|
+
}>>;
|
|
313
|
+
direction: z.ZodOptional<z.ZodEnum<{
|
|
314
|
+
asc: "asc";
|
|
315
|
+
desc: "desc";
|
|
316
|
+
}>>;
|
|
317
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
318
|
+
deletedOnly: z.ZodOptional<z.ZodBoolean>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
export type SandboxListParams = z.infer<typeof SandboxListParamsSchema>;
|
|
321
|
+
/**
|
|
322
|
+
* Lists sandboxes with optional filtering and pagination.
|
|
323
|
+
*
|
|
324
|
+
* @param client - The API client to use for the request
|
|
325
|
+
* @param params - Optional parameters for filtering by project, status, and pagination
|
|
326
|
+
* @returns Paginated list of sandboxes with total count
|
|
327
|
+
* @throws {SandboxResponseError} If the request fails
|
|
328
|
+
*/
|
|
329
|
+
export declare function sandboxList(client: APIClient, params?: SandboxListParams): Promise<ListSandboxesResponse>;
|
|
330
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,qBAAqB,EAIrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAGnE,eAAO,MAAM,oBAAoB;;;iBAKqB,CAAC;AAEvD,eAAO,MAAM,wBAAwB;;;;;;iBAQJ,CAAC;AAElC,eAAO,MAAM,6BAA6B;;;;iBAMH,CAAC;AAExC,eAAO,MAAM,4BAA4B;;;;iBAMM,CAAC;AAEhD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;mBAyBkB,CAAC;AAEzD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6DmB,CAAC;AAElD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKK,CAAC;AAE1C,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAA6C,CAAC;AAEtF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAChC,MAAM,EAAE,SAAS,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,qBAAqB,CAAC,CA6EhC"}
|
package/dist/list.js
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { ListSandboxesParamsSchema } from './types.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { APIResponseSchema } from '@agentuity/api';
|
|
4
|
+
import { throwSandboxError } from './util.js';
|
|
5
|
+
export const SandboxOrgInfoSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
id: z.string().describe('Organization ID'),
|
|
8
|
+
name: z.string().describe('Organization name'),
|
|
9
|
+
})
|
|
10
|
+
.describe('Organization associated with the sandbox');
|
|
11
|
+
export const SandboxRuntimeInfoSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
id: z.string().describe('Runtime ID'),
|
|
14
|
+
name: z.string().describe('Runtime name (e.g., "bun:1")'),
|
|
15
|
+
iconUrl: z.string().optional().describe('URL for runtime icon'),
|
|
16
|
+
brandColor: z.string().optional().describe('Brand color for the runtime (hex color code)'),
|
|
17
|
+
tags: z.array(z.string()).optional().describe('Optional tags for categorization'),
|
|
18
|
+
})
|
|
19
|
+
.describe('Runtime information');
|
|
20
|
+
export const SandboxSnapshotUserInfoSchema = z
|
|
21
|
+
.object({
|
|
22
|
+
id: z.string().describe('User ID'),
|
|
23
|
+
firstName: z.string().optional().describe("User's first name"),
|
|
24
|
+
lastName: z.string().optional().describe("User's last name"),
|
|
25
|
+
})
|
|
26
|
+
.describe('Snapshot user information');
|
|
27
|
+
export const SandboxSnapshotOrgInfoSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
id: z.string().describe('Organization ID'),
|
|
30
|
+
name: z.string().describe('Organization name'),
|
|
31
|
+
slug: z.string().optional().describe('Organization slug'),
|
|
32
|
+
})
|
|
33
|
+
.describe('Snapshot organization information');
|
|
34
|
+
export const SandboxSnapshotInfoSchema = z
|
|
35
|
+
.union([
|
|
36
|
+
z
|
|
37
|
+
.object({
|
|
38
|
+
id: z.string().describe('Snapshot ID'),
|
|
39
|
+
name: z.string().optional().describe('Snapshot name'),
|
|
40
|
+
tag: z.string().optional().describe('Snapshot tag'),
|
|
41
|
+
fullName: z.string().optional().describe('Full name with org slug (@slug/name:tag)'),
|
|
42
|
+
public: z.literal(true).describe('Public snapshot'),
|
|
43
|
+
org: SandboxSnapshotOrgInfoSchema.describe('Organization that owns the public snapshot'),
|
|
44
|
+
})
|
|
45
|
+
.describe('Public snapshot'),
|
|
46
|
+
z
|
|
47
|
+
.object({
|
|
48
|
+
id: z.string().describe('Snapshot ID'),
|
|
49
|
+
name: z.string().optional().describe('Snapshot name'),
|
|
50
|
+
tag: z.string().optional().describe('Snapshot tag'),
|
|
51
|
+
fullName: z.string().optional().describe('Full name with org slug (@slug/name:tag)'),
|
|
52
|
+
public: z.literal(false).describe('Private snapshot'),
|
|
53
|
+
user: SandboxSnapshotUserInfoSchema.describe('User who created the private snapshot'),
|
|
54
|
+
})
|
|
55
|
+
.describe('Private snapshot'),
|
|
56
|
+
])
|
|
57
|
+
.describe('Snapshot information (discriminated union)');
|
|
58
|
+
export const SandboxInfoSchema = z
|
|
59
|
+
.object({
|
|
60
|
+
sandboxId: z.string().describe('Unique identifier for the sandbox'),
|
|
61
|
+
identifier: z.string().optional().describe('Short identifier for DNS hostname'),
|
|
62
|
+
name: z.string().optional().describe('Sandbox name'),
|
|
63
|
+
description: z.string().optional().describe('Sandbox description'),
|
|
64
|
+
status: z
|
|
65
|
+
.enum([
|
|
66
|
+
'creating',
|
|
67
|
+
'idle',
|
|
68
|
+
'running',
|
|
69
|
+
'paused',
|
|
70
|
+
'stopping',
|
|
71
|
+
'suspended',
|
|
72
|
+
'terminated',
|
|
73
|
+
'failed',
|
|
74
|
+
'deleted',
|
|
75
|
+
])
|
|
76
|
+
.describe('Current status of the sandbox'),
|
|
77
|
+
mode: z.string().optional().describe('Sandbox mode (interactive or oneshot)'),
|
|
78
|
+
createdAt: z.string().describe('ISO timestamp when the sandbox was created'),
|
|
79
|
+
region: z.string().optional().describe('Region where the sandbox is running'),
|
|
80
|
+
runtime: SandboxRuntimeInfoSchema.optional().describe('Runtime information'),
|
|
81
|
+
snapshot: SandboxSnapshotInfoSchema.optional().describe('Snapshot information'),
|
|
82
|
+
executions: z.number().describe('Total number of executions in this sandbox'),
|
|
83
|
+
stdoutStreamUrl: z.string().optional().describe('URL for streaming stdout output'),
|
|
84
|
+
stderrStreamUrl: z.string().optional().describe('URL for streaming stderr output'),
|
|
85
|
+
auditStreamId: z.string().optional().describe('ID of the audit event stream'),
|
|
86
|
+
auditStreamUrl: z.string().optional().describe('URL for streaming audit events'),
|
|
87
|
+
networkEnabled: z.boolean().optional().describe('Whether network access is enabled'),
|
|
88
|
+
networkPort: z.number().optional().describe('Network port exposed from the sandbox'),
|
|
89
|
+
url: z
|
|
90
|
+
.string()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('Public URL for the sandbox (only set if networkPort is configured)'),
|
|
93
|
+
org: SandboxOrgInfoSchema.describe('Organization associated with the sandbox'),
|
|
94
|
+
timeout: z
|
|
95
|
+
.object({
|
|
96
|
+
idle: z.string().optional().describe('Idle timeout duration (e.g., "5m", "1h").'),
|
|
97
|
+
execution: z
|
|
98
|
+
.string()
|
|
99
|
+
.optional()
|
|
100
|
+
.describe('Execution timeout duration (e.g., "30m", "2h").'),
|
|
101
|
+
paused: z
|
|
102
|
+
.string()
|
|
103
|
+
.optional()
|
|
104
|
+
.describe('Paused timeout duration (e.g., "24h", "0s" for infinite).'),
|
|
105
|
+
})
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Timeout configuration for the sandbox.'),
|
|
108
|
+
command: z
|
|
109
|
+
.object({
|
|
110
|
+
exec: z.array(z.string()).describe('Command and arguments to execute.'),
|
|
111
|
+
mode: z
|
|
112
|
+
.enum(['oneshot', 'interactive'])
|
|
113
|
+
.optional()
|
|
114
|
+
.describe('Execution mode for the command.'),
|
|
115
|
+
})
|
|
116
|
+
.optional()
|
|
117
|
+
.describe('Command configuration for the sandbox.'),
|
|
118
|
+
})
|
|
119
|
+
.describe('Summary information about a sandbox');
|
|
120
|
+
export const ListSandboxesDataSchema = z
|
|
121
|
+
.object({
|
|
122
|
+
sandboxes: z.array(SandboxInfoSchema).describe('List of sandbox entries'),
|
|
123
|
+
total: z.number().describe('Total number of sandboxes matching the query'),
|
|
124
|
+
})
|
|
125
|
+
.describe('Paginated list of sandboxes');
|
|
126
|
+
export const ListSandboxesResponseSchema = APIResponseSchema(ListSandboxesDataSchema);
|
|
127
|
+
export const SandboxListParamsSchema = ListSandboxesParamsSchema.extend({
|
|
128
|
+
orgId: z.string().optional().describe('Optional org id for CLI auth context'),
|
|
129
|
+
deletedOnly: z.boolean().optional().describe('Whether to return only deleted sandboxes'),
|
|
130
|
+
});
|
|
131
|
+
/**
|
|
132
|
+
* Lists sandboxes with optional filtering and pagination.
|
|
133
|
+
*
|
|
134
|
+
* @param client - The API client to use for the request
|
|
135
|
+
* @param params - Optional parameters for filtering by project, status, and pagination
|
|
136
|
+
* @returns Paginated list of sandboxes with total count
|
|
137
|
+
* @throws {SandboxResponseError} If the request fails
|
|
138
|
+
*/
|
|
139
|
+
export async function sandboxList(client, params) {
|
|
140
|
+
const queryParams = new URLSearchParams();
|
|
141
|
+
if (params?.orgId) {
|
|
142
|
+
queryParams.set('orgId', params.orgId);
|
|
143
|
+
}
|
|
144
|
+
if (params?.name) {
|
|
145
|
+
queryParams.set('name', params.name);
|
|
146
|
+
}
|
|
147
|
+
if (params?.mode) {
|
|
148
|
+
queryParams.set('mode', params.mode);
|
|
149
|
+
}
|
|
150
|
+
if (params?.projectId) {
|
|
151
|
+
queryParams.set('projectId', params.projectId);
|
|
152
|
+
}
|
|
153
|
+
if (params?.snapshotId) {
|
|
154
|
+
queryParams.set('snapshotId', params.snapshotId);
|
|
155
|
+
}
|
|
156
|
+
if (params?.status) {
|
|
157
|
+
queryParams.set('status', params.status);
|
|
158
|
+
}
|
|
159
|
+
if (params?.live !== undefined) {
|
|
160
|
+
queryParams.set('live', params.live.toString());
|
|
161
|
+
}
|
|
162
|
+
if (params?.limit !== undefined) {
|
|
163
|
+
queryParams.set('limit', params.limit.toString());
|
|
164
|
+
}
|
|
165
|
+
if (params?.offset !== undefined) {
|
|
166
|
+
queryParams.set('offset', params.offset.toString());
|
|
167
|
+
}
|
|
168
|
+
if (params?.sort) {
|
|
169
|
+
queryParams.set('sort', params.sort);
|
|
170
|
+
}
|
|
171
|
+
if (params?.direction) {
|
|
172
|
+
queryParams.set('direction', params.direction);
|
|
173
|
+
}
|
|
174
|
+
if (params?.deletedOnly) {
|
|
175
|
+
queryParams.set('deletedOnly', 'true');
|
|
176
|
+
}
|
|
177
|
+
const queryString = queryParams.toString();
|
|
178
|
+
const url = `/sandbox${queryString ? `?${queryString}` : ''}`;
|
|
179
|
+
const resp = await client.get(url, ListSandboxesResponseSchema);
|
|
180
|
+
if (resp.success) {
|
|
181
|
+
return {
|
|
182
|
+
sandboxes: resp.data.sandboxes.map((s) => ({
|
|
183
|
+
sandboxId: s.sandboxId,
|
|
184
|
+
identifier: s.identifier,
|
|
185
|
+
name: s.name,
|
|
186
|
+
description: s.description,
|
|
187
|
+
status: s.status,
|
|
188
|
+
mode: s.mode,
|
|
189
|
+
createdAt: s.createdAt,
|
|
190
|
+
region: s.region,
|
|
191
|
+
runtime: s.runtime,
|
|
192
|
+
snapshot: s.snapshot,
|
|
193
|
+
executions: s.executions,
|
|
194
|
+
stdoutStreamUrl: s.stdoutStreamUrl,
|
|
195
|
+
stderrStreamUrl: s.stderrStreamUrl,
|
|
196
|
+
auditStreamId: s.auditStreamId,
|
|
197
|
+
auditStreamUrl: s.auditStreamUrl,
|
|
198
|
+
networkEnabled: s.networkEnabled,
|
|
199
|
+
networkPort: s.networkPort,
|
|
200
|
+
url: s.url,
|
|
201
|
+
org: s.org,
|
|
202
|
+
timeout: s.timeout,
|
|
203
|
+
})),
|
|
204
|
+
total: resp.data.total,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
throwSandboxError(resp, {});
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=list.js.map
|
package/dist/list.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../src/list.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,CAAC,E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MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,OAAO,EAAE,CAAC,CAAC,OAAyC;gBACpD,QAAQ,EAAE,CAAC,CAAC,QAA2C;gBACvD,UAAU,EAAE,CAAC,CAAC,UAAU;gBACxB,eAAe,EAAE,CAAC,CAAC,eAAe;gBAClC,eAAe,EAAE,CAAC,CAAC,eAAe;gBAClC,aAAa,EAAE,CAAC,CAAC,aAAa;gBAC9B,cAAc,EAAE,CAAC,CAAC,cAAc;gBAChC,cAAc,EAAE,CAAC,CAAC,cAAc;gBAChC,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,GAAG,EAAE,CAAC,CAAC,GAAG;gBACV,GAAG,EAAE,CAAC,CAAC,GAAG;gBACV,OAAO,EAAE,CAAC,CAAC,OAAO;aAClB,CAAC,CAAC;YACH,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK;SACtB,CAAC;IACH,CAAC;IAED,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/pause.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type APIClient } from '@agentuity/api';
|
|
3
|
+
export declare const PauseResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
success: z.ZodLiteral<false>;
|
|
5
|
+
message: z.ZodString;
|
|
6
|
+
code: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
success: z.ZodLiteral<true>;
|
|
9
|
+
sandboxId: z.ZodString;
|
|
10
|
+
status: z.ZodString;
|
|
11
|
+
checkpointId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
terminatesAt: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>], "success">;
|
|
14
|
+
export declare const SandboxPauseParamsSchema: z.ZodObject<{
|
|
15
|
+
sandboxId: z.ZodString;
|
|
16
|
+
orgId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type SandboxPauseParams = z.infer<typeof SandboxPauseParamsSchema>;
|
|
19
|
+
/** Result returned from pausing a sandbox */
|
|
20
|
+
export interface SandboxPauseResult {
|
|
21
|
+
/** The sandbox ID that was paused */
|
|
22
|
+
sandboxId: string;
|
|
23
|
+
/** New status (typically "suspended") */
|
|
24
|
+
status: string;
|
|
25
|
+
/** Checkpoint ID created during pause */
|
|
26
|
+
checkpointId?: string;
|
|
27
|
+
/** ISO 8601 timestamp when sandbox will auto-terminate if not resumed (omitted if no paused timeout) */
|
|
28
|
+
terminatesAt?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Pauses a running sandbox, creating a checkpoint of its current state.
|
|
32
|
+
*
|
|
33
|
+
* @param client - The API client to use for the request
|
|
34
|
+
* @param params - Parameters including the sandbox ID to pause
|
|
35
|
+
* @returns Pause result including terminatesAt if a paused timeout is configured
|
|
36
|
+
* @throws {SandboxResponseError} If the sandbox is not found or pause fails
|
|
37
|
+
*/
|
|
38
|
+
export declare function sandboxPause(client: APIClient, params: SandboxPauseParams): Promise<SandboxPauseResult>;
|
|
39
|
+
//# sourceMappingURL=pause.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../src/pause.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,eAAO,MAAM,mBAAmB;;;;;;;;;;8BAa9B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IAClC,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wGAAwG;IACxG,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,kBAAkB,GACxB,OAAO,CAAC,kBAAkB,CAAC,CAyB7B"}
|
package/dist/pause.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { throwSandboxError } from './util.js';
|
|
3
|
+
export const PauseResponseSchema = z.discriminatedUnion('success', [
|
|
4
|
+
z.object({
|
|
5
|
+
success: z.literal(false),
|
|
6
|
+
message: z.string(),
|
|
7
|
+
code: z.string().optional(),
|
|
8
|
+
}),
|
|
9
|
+
z.object({
|
|
10
|
+
success: z.literal(true),
|
|
11
|
+
sandboxId: z.string(),
|
|
12
|
+
status: z.string(),
|
|
13
|
+
checkpointId: z.string().optional(),
|
|
14
|
+
terminatesAt: z.string().optional(),
|
|
15
|
+
}),
|
|
16
|
+
]);
|
|
17
|
+
export const SandboxPauseParamsSchema = z.object({
|
|
18
|
+
sandboxId: z.string().describe('Sandbox ID to pause'),
|
|
19
|
+
orgId: z.string().optional().describe('Optional org id for CLI auth context'),
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Pauses a running sandbox, creating a checkpoint of its current state.
|
|
23
|
+
*
|
|
24
|
+
* @param client - The API client to use for the request
|
|
25
|
+
* @param params - Parameters including the sandbox ID to pause
|
|
26
|
+
* @returns Pause result including terminatesAt if a paused timeout is configured
|
|
27
|
+
* @throws {SandboxResponseError} If the sandbox is not found or pause fails
|
|
28
|
+
*/
|
|
29
|
+
export async function sandboxPause(client, params) {
|
|
30
|
+
const { sandboxId, orgId } = params;
|
|
31
|
+
const queryParams = new URLSearchParams();
|
|
32
|
+
if (orgId) {
|
|
33
|
+
queryParams.set('orgId', orgId);
|
|
34
|
+
}
|
|
35
|
+
const queryString = queryParams.toString();
|
|
36
|
+
const url = `/sandbox/${encodeURIComponent(sandboxId)}/pause${queryString ? `?${queryString}` : ''}`;
|
|
37
|
+
const resp = await client.post(url, undefined, PauseResponseSchema);
|
|
38
|
+
if (resp.success) {
|
|
39
|
+
return {
|
|
40
|
+
sandboxId: resp.sandboxId,
|
|
41
|
+
status: resp.status,
|
|
42
|
+
checkpointId: resp.checkpointId,
|
|
43
|
+
terminatesAt: resp.terminatesAt,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
throwSandboxError(resp, { sandboxId });
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=pause.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pause.js","sourceRoot":"","sources":["../src/pause.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,kBAAkB,CAAC,SAAS,EAAE;IAClE,CAAC,CAAC,MAAM,CAAC;QACR,OAAO,EAAE,CAAC,CAAC,OAAO,CAAQ,KAAK,CAAC;QAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;QACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC3B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACR,OAAO,EAAE,CAAC,CAAC,OAAO,CAAO,IAAI,CAAC;QAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACnC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACnC,CAAC;CACF,CA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