langsmith 0.7.12 → 0.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/_openapi_client/client.cjs +9 -1
  2. package/dist/_openapi_client/client.d.ts +5 -2
  3. package/dist/_openapi_client/client.js +9 -1
  4. package/dist/_openapi_client/resources/datasets/datasets.cjs +5 -14
  5. package/dist/_openapi_client/resources/datasets/datasets.d.ts +6 -10
  6. package/dist/_openapi_client/resources/datasets/datasets.js +5 -14
  7. package/dist/_openapi_client/resources/datasets/experiment-runs.cjs +18 -0
  8. package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +109 -0
  9. package/dist/_openapi_client/resources/datasets/experiment-runs.js +14 -0
  10. package/dist/_openapi_client/resources/datasets/runs.cjs +0 -7
  11. package/dist/_openapi_client/resources/datasets/runs.d.ts +1 -45
  12. package/dist/_openapi_client/resources/datasets/runs.js +0 -7
  13. package/dist/_openapi_client/resources/index.cjs +4 -2
  14. package/dist/_openapi_client/resources/index.d.ts +2 -1
  15. package/dist/_openapi_client/resources/index.js +2 -1
  16. package/dist/_openapi_client/resources/runs/runs.d.ts +1 -1
  17. package/dist/_openapi_client/resources/sandboxes/boxes.cjs +86 -0
  18. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +465 -0
  19. package/dist/_openapi_client/resources/sandboxes/boxes.js +82 -0
  20. package/dist/_openapi_client/resources/sandboxes/registries.cjs +44 -0
  21. package/dist/_openapi_client/resources/sandboxes/registries.d.ts +67 -0
  22. package/dist/_openapi_client/resources/sandboxes/registries.js +40 -0
  23. package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +72 -0
  24. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +309 -0
  25. package/dist/_openapi_client/resources/sandboxes/sandboxes.js +35 -0
  26. package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +39 -0
  27. package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +62 -0
  28. package/dist/_openapi_client/resources/sandboxes/snapshots.js +35 -0
  29. package/dist/_openapi_client/resources/sessions.cjs +53 -0
  30. package/dist/_openapi_client/resources/{sessions/sessions.d.ts → sessions.d.ts} +13 -51
  31. package/dist/_openapi_client/resources/sessions.js +49 -0
  32. package/dist/client.cjs +44 -0
  33. package/dist/client.d.ts +31 -0
  34. package/dist/client.js +44 -0
  35. package/dist/experimental/anthropic/context.cjs +5 -1
  36. package/dist/experimental/anthropic/context.js +5 -1
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.js +1 -1
  40. package/dist/sandbox/client.cjs +58 -15
  41. package/dist/sandbox/client.d.ts +27 -1
  42. package/dist/sandbox/client.js +54 -11
  43. package/dist/sandbox/sandbox.cjs +7 -6
  44. package/dist/sandbox/sandbox.d.ts +7 -2
  45. package/dist/sandbox/sandbox.js +8 -7
  46. package/dist/sandbox/types.d.ts +1 -7
  47. package/package.json +1 -1
  48. package/dist/_openapi_client/resources/datasets/experiments.cjs +0 -16
  49. package/dist/_openapi_client/resources/datasets/experiments.d.ts +0 -23
  50. package/dist/_openapi_client/resources/datasets/experiments.js +0 -12
  51. package/dist/_openapi_client/resources/datasets/group.cjs +0 -17
  52. package/dist/_openapi_client/resources/datasets/group.d.ts +0 -160
  53. package/dist/_openapi_client/resources/datasets/group.js +0 -13
  54. package/dist/_openapi_client/resources/sessions/insights.cjs +0 -54
  55. package/dist/_openapi_client/resources/sessions/insights.d.ts +0 -246
  56. package/dist/_openapi_client/resources/sessions/insights.js +0 -50
  57. package/dist/_openapi_client/resources/sessions/sessions.cjs +0 -109
  58. package/dist/_openapi_client/resources/sessions/sessions.js +0 -72
@@ -0,0 +1,465 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import * as SandboxesAPI from './sandboxes.js';
3
+ import { APIPromise } from '../../core/api-promise.js';
4
+ import { RequestOptions } from '../../internal/request-options.js';
5
+ export declare class Boxes extends APIResource {
6
+ /**
7
+ * Create a new sandbox from a snapshot. Provide at most one of `snapshot_id` or
8
+ * `snapshot_name`; if neither is provided, the server uses the default static
9
+ * blueprint.
10
+ */
11
+ create(body: BoxCreateParams, options?: RequestOptions): APIPromise<SandboxesAPI.SandboxResponse>;
12
+ /**
13
+ * Retrieve a sandbox by name. Stale provisioning sandboxes are auto-failed.
14
+ */
15
+ retrieve(name: string, options?: RequestOptions): APIPromise<SandboxesAPI.SandboxResponse>;
16
+ /**
17
+ * Update a sandbox's display name. The name must be unique within the tenant.
18
+ */
19
+ update(name: string, body: BoxUpdateParams, options?: RequestOptions): APIPromise<SandboxesAPI.SandboxResponse>;
20
+ /**
21
+ * List sandboxes for the authenticated tenant, with optional filtering, sorting,
22
+ * and pagination.
23
+ */
24
+ list(query?: BoxListParams | null | undefined, options?: RequestOptions): APIPromise<SandboxesAPI.SandboxListResponse>;
25
+ /**
26
+ * Delete a sandbox by name or UUID. Tears down the sandbox runtime and removes the
27
+ * DB record.
28
+ */
29
+ delete(name: string, options?: RequestOptions): APIPromise<void>;
30
+ /**
31
+ * Create a snapshot by capturing the current state of a sandbox or promoting an
32
+ * existing checkpoint.
33
+ */
34
+ createSnapshot(name: string, body: BoxCreateSnapshotParams, options?: RequestOptions): APIPromise<SandboxesAPI.SnapshotResponse>;
35
+ /**
36
+ * Create a short-lived JWT for accessing an HTTP service running on a specific
37
+ * port inside a sandbox. Returns a browser_url (sets auth cookie via redirect), a
38
+ * service_url (for use with the X-Langsmith-Sandbox-Service-Token header), the raw
39
+ * token, and its expiry.
40
+ */
41
+ generateServiceURL(name: string, body: BoxGenerateServiceURLParams, options?: RequestOptions): APIPromise<SandboxesAPI.ServiceURLResponse>;
42
+ /**
43
+ * Retrieve the lightweight status of a sandbox for polling.
44
+ */
45
+ getStatus(name: string, options?: RequestOptions): APIPromise<SandboxesAPI.SandboxStatusResponse>;
46
+ /**
47
+ * Start a stopped or failed sandbox. This endpoint is not idempotent.
48
+ */
49
+ start(name: string, options?: RequestOptions): APIPromise<SandboxesAPI.SandboxResponse>;
50
+ /**
51
+ * Stop a ready sandbox. This endpoint is not idempotent; the filesystem is
52
+ * preserved for later restart.
53
+ */
54
+ stop(name: string, options?: RequestOptions): APIPromise<void>;
55
+ }
56
+ export interface BoxCreateParams {
57
+ /**
58
+ * CPUMillicores optionally requests CPU at millicore granularity (e.g. 500 = 0.5
59
+ * vCPU); takes precedence over VCPUs. Fractional (sub-vCPU) values are not
60
+ * available for every sandbox.
61
+ */
62
+ cpu_millicores?: number;
63
+ delete_after_stop_seconds?: number;
64
+ env_vars?: {
65
+ [key: string]: string;
66
+ };
67
+ fs_capacity_bytes?: number;
68
+ idle_ttl_seconds?: number;
69
+ mem_bytes?: number;
70
+ mount_config?: BoxCreateParams.MountConfig;
71
+ name?: string;
72
+ proxy_config?: BoxCreateParams.ProxyConfig;
73
+ /**
74
+ * RestoreMemory selects how the sandbox handles a snapshot's captured memory:
75
+ *
76
+ * nil → if-present: resume from memory when the snapshot has it, else cold-boot
77
+ * (default). true → always: resume from memory; rejected if the snapshot has none.
78
+ * false → never: always cold-boot.
79
+ *
80
+ * Applies to this request only.
81
+ */
82
+ restore_memory?: boolean;
83
+ snapshot_id?: string;
84
+ snapshot_name?: string;
85
+ tag_value_ids?: Array<string>;
86
+ vcpus?: number;
87
+ }
88
+ export declare namespace BoxCreateParams {
89
+ interface MountConfig {
90
+ auth?: MountConfig.Auth;
91
+ mounts?: Array<MountConfig.SandboxapiS3BucketMountSpec | MountConfig.SandboxapiGcsBucketMountSpec | MountConfig.SandboxapiGitRepoMountSpec>;
92
+ }
93
+ namespace MountConfig {
94
+ interface Auth {
95
+ aws?: Auth.Aws;
96
+ gcp?: Auth.Gcp;
97
+ }
98
+ namespace Auth {
99
+ interface Aws {
100
+ access_key_id: Aws.AccessKeyID;
101
+ secret_access_key: Aws.SecretAccessKey;
102
+ }
103
+ namespace Aws {
104
+ interface AccessKeyID {
105
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
106
+ is_set?: boolean;
107
+ value?: string;
108
+ }
109
+ interface SecretAccessKey {
110
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
111
+ is_set?: boolean;
112
+ value?: string;
113
+ }
114
+ }
115
+ interface Gcp {
116
+ service_account_json: Gcp.ServiceAccountJson;
117
+ }
118
+ namespace Gcp {
119
+ interface ServiceAccountJson {
120
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
121
+ is_set?: boolean;
122
+ value?: string;
123
+ }
124
+ }
125
+ }
126
+ interface SandboxapiS3BucketMountSpec {
127
+ id: string;
128
+ mount_path: string;
129
+ s3: SandboxapiS3BucketMountSpec.S3;
130
+ type: 's3' | 'gcs' | 'git';
131
+ cache?: SandboxapiS3BucketMountSpec.Cache;
132
+ gcs?: SandboxapiS3BucketMountSpec.Gcs;
133
+ git?: SandboxapiS3BucketMountSpec.Git;
134
+ read_only?: boolean;
135
+ }
136
+ namespace SandboxapiS3BucketMountSpec {
137
+ interface S3 {
138
+ bucket: string;
139
+ region: string;
140
+ endpoint_url?: string;
141
+ path_style?: boolean;
142
+ prefix?: string;
143
+ }
144
+ interface Cache {
145
+ max_size_bytes?: number;
146
+ writeback_seconds?: number;
147
+ }
148
+ interface Gcs {
149
+ bucket: string;
150
+ prefix?: string;
151
+ }
152
+ interface Git {
153
+ remote_url: string;
154
+ ref?: Git.Ref;
155
+ refresh_interval_seconds?: number;
156
+ }
157
+ namespace Git {
158
+ interface Ref {
159
+ name: string;
160
+ type: 'branch' | 'tag';
161
+ }
162
+ }
163
+ }
164
+ interface SandboxapiGcsBucketMountSpec {
165
+ id: string;
166
+ gcs: SandboxapiGcsBucketMountSpec.Gcs;
167
+ mount_path: string;
168
+ type: 's3' | 'gcs' | 'git';
169
+ cache?: SandboxapiGcsBucketMountSpec.Cache;
170
+ git?: SandboxapiGcsBucketMountSpec.Git;
171
+ read_only?: boolean;
172
+ s3?: SandboxapiGcsBucketMountSpec.S3;
173
+ }
174
+ namespace SandboxapiGcsBucketMountSpec {
175
+ interface Gcs {
176
+ bucket: string;
177
+ prefix?: string;
178
+ }
179
+ interface Cache {
180
+ max_size_bytes?: number;
181
+ writeback_seconds?: number;
182
+ }
183
+ interface Git {
184
+ remote_url: string;
185
+ ref?: Git.Ref;
186
+ refresh_interval_seconds?: number;
187
+ }
188
+ namespace Git {
189
+ interface Ref {
190
+ name: string;
191
+ type: 'branch' | 'tag';
192
+ }
193
+ }
194
+ interface S3 {
195
+ bucket: string;
196
+ region: string;
197
+ endpoint_url?: string;
198
+ path_style?: boolean;
199
+ prefix?: string;
200
+ }
201
+ }
202
+ interface SandboxapiGitRepoMountSpec {
203
+ id: string;
204
+ git: SandboxapiGitRepoMountSpec.Git;
205
+ mount_path: string;
206
+ type: 's3' | 'gcs' | 'git';
207
+ cache?: SandboxapiGitRepoMountSpec.Cache;
208
+ gcs?: SandboxapiGitRepoMountSpec.Gcs;
209
+ read_only?: boolean;
210
+ s3?: SandboxapiGitRepoMountSpec.S3;
211
+ }
212
+ namespace SandboxapiGitRepoMountSpec {
213
+ interface Git {
214
+ remote_url: string;
215
+ ref?: Git.Ref;
216
+ refresh_interval_seconds?: number;
217
+ }
218
+ namespace Git {
219
+ interface Ref {
220
+ name: string;
221
+ type: 'branch' | 'tag';
222
+ }
223
+ }
224
+ interface Cache {
225
+ max_size_bytes?: number;
226
+ writeback_seconds?: number;
227
+ }
228
+ interface Gcs {
229
+ bucket: string;
230
+ prefix?: string;
231
+ }
232
+ interface S3 {
233
+ bucket: string;
234
+ region: string;
235
+ endpoint_url?: string;
236
+ path_style?: boolean;
237
+ prefix?: string;
238
+ }
239
+ }
240
+ }
241
+ interface ProxyConfig {
242
+ access_control?: ProxyConfig.AccessControl;
243
+ callbacks?: Array<ProxyConfig.Callback>;
244
+ no_proxy?: Array<string>;
245
+ rules?: Array<ProxyConfig.Rule>;
246
+ }
247
+ namespace ProxyConfig {
248
+ interface AccessControl {
249
+ allow_list?: Array<string>;
250
+ deny_list?: Array<string>;
251
+ }
252
+ interface Callback {
253
+ match_hosts: Array<string>;
254
+ ttl_seconds: number;
255
+ url: string;
256
+ full_request?: boolean;
257
+ request_headers?: Array<Callback.RequestHeader>;
258
+ }
259
+ namespace Callback {
260
+ interface RequestHeader {
261
+ name: string;
262
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
263
+ is_set?: boolean;
264
+ value?: string;
265
+ }
266
+ }
267
+ interface Rule {
268
+ name: string;
269
+ aws?: Rule.Aws;
270
+ enabled?: boolean;
271
+ gcp?: Rule.Gcp;
272
+ headers?: Array<Rule.Header>;
273
+ /**
274
+ * MatchHosts is only accepted for header injection rules. Provider auth rules use
275
+ * built-in host matching.
276
+ */
277
+ match_hosts?: Array<string>;
278
+ match_paths?: Array<string>;
279
+ type?: string;
280
+ }
281
+ namespace Rule {
282
+ interface Aws {
283
+ access_key_id: Aws.AccessKeyID;
284
+ secret_access_key: Aws.SecretAccessKey;
285
+ }
286
+ namespace Aws {
287
+ interface AccessKeyID {
288
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
289
+ is_set?: boolean;
290
+ value?: string;
291
+ }
292
+ interface SecretAccessKey {
293
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
294
+ is_set?: boolean;
295
+ value?: string;
296
+ }
297
+ }
298
+ interface Gcp {
299
+ scopes: Array<string>;
300
+ service_account_json: Gcp.ServiceAccountJson;
301
+ }
302
+ namespace Gcp {
303
+ interface ServiceAccountJson {
304
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
305
+ is_set?: boolean;
306
+ value?: string;
307
+ }
308
+ }
309
+ interface Header {
310
+ name: string;
311
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
312
+ is_set?: boolean;
313
+ value?: string;
314
+ }
315
+ }
316
+ }
317
+ }
318
+ export interface BoxUpdateParams {
319
+ cpu_millicores?: number;
320
+ delete_after_stop_seconds?: number;
321
+ fs_capacity_bytes?: number;
322
+ idle_ttl_seconds?: number;
323
+ mem_bytes?: number;
324
+ name?: string;
325
+ proxy_config?: BoxUpdateParams.ProxyConfig;
326
+ tag_value_ids?: Array<string>;
327
+ vcpus?: number;
328
+ }
329
+ export declare namespace BoxUpdateParams {
330
+ interface ProxyConfig {
331
+ access_control?: ProxyConfig.AccessControl;
332
+ callbacks?: Array<ProxyConfig.Callback>;
333
+ no_proxy?: Array<string>;
334
+ rules?: Array<ProxyConfig.Rule>;
335
+ }
336
+ namespace ProxyConfig {
337
+ interface AccessControl {
338
+ allow_list?: Array<string>;
339
+ deny_list?: Array<string>;
340
+ }
341
+ interface Callback {
342
+ match_hosts: Array<string>;
343
+ ttl_seconds: number;
344
+ url: string;
345
+ full_request?: boolean;
346
+ request_headers?: Array<Callback.RequestHeader>;
347
+ }
348
+ namespace Callback {
349
+ interface RequestHeader {
350
+ name: string;
351
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
352
+ is_set?: boolean;
353
+ value?: string;
354
+ }
355
+ }
356
+ interface Rule {
357
+ name: string;
358
+ aws?: Rule.Aws;
359
+ enabled?: boolean;
360
+ gcp?: Rule.Gcp;
361
+ headers?: Array<Rule.Header>;
362
+ /**
363
+ * MatchHosts is only accepted for header injection rules. Provider auth rules use
364
+ * built-in host matching.
365
+ */
366
+ match_hosts?: Array<string>;
367
+ match_paths?: Array<string>;
368
+ type?: string;
369
+ }
370
+ namespace Rule {
371
+ interface Aws {
372
+ access_key_id: Aws.AccessKeyID;
373
+ secret_access_key: Aws.SecretAccessKey;
374
+ }
375
+ namespace Aws {
376
+ interface AccessKeyID {
377
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
378
+ is_set?: boolean;
379
+ value?: string;
380
+ }
381
+ interface SecretAccessKey {
382
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
383
+ is_set?: boolean;
384
+ value?: string;
385
+ }
386
+ }
387
+ interface Gcp {
388
+ scopes: Array<string>;
389
+ service_account_json: Gcp.ServiceAccountJson;
390
+ }
391
+ namespace Gcp {
392
+ interface ServiceAccountJson {
393
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
394
+ is_set?: boolean;
395
+ value?: string;
396
+ }
397
+ }
398
+ interface Header {
399
+ name: string;
400
+ type: 'plaintext' | 'opaque' | 'workspace_secret';
401
+ is_set?: boolean;
402
+ value?: string;
403
+ }
404
+ }
405
+ }
406
+ }
407
+ export interface BoxListParams {
408
+ /**
409
+ * Filter by creator identity. Only 'me' is supported.
410
+ */
411
+ created_by?: string;
412
+ /**
413
+ * Maximum number of results
414
+ */
415
+ limit?: number;
416
+ /**
417
+ * Filter by name substring
418
+ */
419
+ name_contains?: string;
420
+ /**
421
+ * Pagination offset
422
+ */
423
+ offset?: number;
424
+ /**
425
+ * Sort column (name, status, created_at)
426
+ */
427
+ sort_by?: string;
428
+ /**
429
+ * Sort direction (asc, desc)
430
+ */
431
+ sort_direction?: string;
432
+ /**
433
+ * Filter by status (provisioning, ready, failed, stopped, deleting)
434
+ */
435
+ status?: string;
436
+ }
437
+ export interface BoxCreateSnapshotParams {
438
+ name: string;
439
+ /**
440
+ * if omitted, creates a fresh checkpoint from the running VM
441
+ */
442
+ checkpoint?: string;
443
+ /**
444
+ * sandbox-local Docker image to export
445
+ */
446
+ docker_image?: string;
447
+ /**
448
+ * required for Docker image export unless the sandbox has a capacity
449
+ */
450
+ fs_capacity_bytes?: number;
451
+ /**
452
+ * IncludeMemory, when true, captures a full VM memory snapshot alongside the
453
+ * filesystem clone. Only honored when the sandbox is running AND Checkpoint is
454
+ * omitted (i.e. a fresh in-VM checkpoint is requested). Defaults to false to keep
455
+ * snapshots small unless memory restore is explicitly desired.
456
+ */
457
+ include_memory?: boolean;
458
+ }
459
+ export interface BoxGenerateServiceURLParams {
460
+ expires_in_seconds?: number;
461
+ port?: number;
462
+ }
463
+ export declare namespace Boxes {
464
+ export { type BoxCreateParams as BoxCreateParams, type BoxUpdateParams as BoxUpdateParams, type BoxListParams as BoxListParams, type BoxCreateSnapshotParams as BoxCreateSnapshotParams, type BoxGenerateServiceURLParams as BoxGenerateServiceURLParams, };
465
+ }
@@ -0,0 +1,82 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ import { APIResource } from '../../core/resource.js';
4
+ import { buildHeaders } from '../../internal/headers.js';
5
+ import { path } from '../../internal/utils/path.js';
6
+ export class Boxes extends APIResource {
7
+ /**
8
+ * Create a new sandbox from a snapshot. Provide at most one of `snapshot_id` or
9
+ * `snapshot_name`; if neither is provided, the server uses the default static
10
+ * blueprint.
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/v2/sandboxes/boxes', { body, ...options });
14
+ }
15
+ /**
16
+ * Retrieve a sandbox by name. Stale provisioning sandboxes are auto-failed.
17
+ */
18
+ retrieve(name, options) {
19
+ return this._client.get(path `/v2/sandboxes/boxes/${name}`, options);
20
+ }
21
+ /**
22
+ * Update a sandbox's display name. The name must be unique within the tenant.
23
+ */
24
+ update(name, body, options) {
25
+ return this._client.patch(path `/v2/sandboxes/boxes/${name}`, { body, ...options });
26
+ }
27
+ /**
28
+ * List sandboxes for the authenticated tenant, with optional filtering, sorting,
29
+ * and pagination.
30
+ */
31
+ list(query = {}, options) {
32
+ return this._client.get('/v2/sandboxes/boxes', { query, ...options });
33
+ }
34
+ /**
35
+ * Delete a sandbox by name or UUID. Tears down the sandbox runtime and removes the
36
+ * DB record.
37
+ */
38
+ delete(name, options) {
39
+ return this._client.delete(path `/v2/sandboxes/boxes/${name}`, {
40
+ ...options,
41
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
42
+ });
43
+ }
44
+ /**
45
+ * Create a snapshot by capturing the current state of a sandbox or promoting an
46
+ * existing checkpoint.
47
+ */
48
+ createSnapshot(name, body, options) {
49
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
50
+ }
51
+ /**
52
+ * Create a short-lived JWT for accessing an HTTP service running on a specific
53
+ * port inside a sandbox. Returns a browser_url (sets auth cookie via redirect), a
54
+ * service_url (for use with the X-Langsmith-Sandbox-Service-Token header), the raw
55
+ * token, and its expiry.
56
+ */
57
+ generateServiceURL(name, body, options) {
58
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
59
+ }
60
+ /**
61
+ * Retrieve the lightweight status of a sandbox for polling.
62
+ */
63
+ getStatus(name, options) {
64
+ return this._client.get(path `/v2/sandboxes/boxes/${name}/status`, options);
65
+ }
66
+ /**
67
+ * Start a stopped or failed sandbox. This endpoint is not idempotent.
68
+ */
69
+ start(name, options) {
70
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/start`, options);
71
+ }
72
+ /**
73
+ * Stop a ready sandbox. This endpoint is not idempotent; the filesystem is
74
+ * preserved for later restart.
75
+ */
76
+ stop(name, options) {
77
+ return this._client.post(path `/v2/sandboxes/boxes/${name}/stop`, {
78
+ ...options,
79
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
80
+ });
81
+ }
82
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.Registries = void 0;
6
+ const resource_js_1 = require("../../core/resource.cjs");
7
+ const headers_js_1 = require("../../internal/headers.cjs");
8
+ const path_js_1 = require("../../internal/utils/path.cjs");
9
+ class Registries extends resource_js_1.APIResource {
10
+ /**
11
+ * Create a sandbox registry for pulling private images.
12
+ */
13
+ create(body, options) {
14
+ return this._client.post('/v2/sandboxes/registries', { body, ...options });
15
+ }
16
+ /**
17
+ * Get a sandbox registry by name.
18
+ */
19
+ retrieve(name, options) {
20
+ return this._client.get((0, path_js_1.path) `/v2/sandboxes/registries/${name}`, options);
21
+ }
22
+ /**
23
+ * Update a sandbox registry's name and/or credentials.
24
+ */
25
+ update(name, body, options) {
26
+ return this._client.patch((0, path_js_1.path) `/v2/sandboxes/registries/${name}`, { body, ...options });
27
+ }
28
+ /**
29
+ * List sandbox registries for pulling private images.
30
+ */
31
+ list(query = {}, options) {
32
+ return this._client.get('/v2/sandboxes/registries', { query, ...options });
33
+ }
34
+ /**
35
+ * Delete a sandbox registry by name.
36
+ */
37
+ delete(name, options) {
38
+ return this._client.delete((0, path_js_1.path) `/v2/sandboxes/registries/${name}`, {
39
+ ...options,
40
+ headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
41
+ });
42
+ }
43
+ }
44
+ exports.Registries = Registries;
@@ -0,0 +1,67 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import { APIPromise } from '../../core/api-promise.js';
3
+ import { RequestOptions } from '../../internal/request-options.js';
4
+ export declare class Registries extends APIResource {
5
+ /**
6
+ * Create a sandbox registry for pulling private images.
7
+ */
8
+ create(body: RegistryCreateParams, options?: RequestOptions): APIPromise<RegistryResponse>;
9
+ /**
10
+ * Get a sandbox registry by name.
11
+ */
12
+ retrieve(name: string, options?: RequestOptions): APIPromise<RegistryResponse>;
13
+ /**
14
+ * Update a sandbox registry's name and/or credentials.
15
+ */
16
+ update(name: string, body: RegistryUpdateParams, options?: RequestOptions): APIPromise<RegistryResponse>;
17
+ /**
18
+ * List sandbox registries for pulling private images.
19
+ */
20
+ list(query?: RegistryListParams | null | undefined, options?: RequestOptions): APIPromise<RegistryListResponse>;
21
+ /**
22
+ * Delete a sandbox registry by name.
23
+ */
24
+ delete(name: string, options?: RequestOptions): APIPromise<void>;
25
+ }
26
+ export interface RegistryListResponse {
27
+ offset?: number;
28
+ registries?: Array<RegistryResponse>;
29
+ }
30
+ export interface RegistryResponse {
31
+ id?: string;
32
+ created_at?: string;
33
+ created_by?: string;
34
+ name?: string;
35
+ updated_at?: string;
36
+ updated_by?: string;
37
+ url?: string;
38
+ }
39
+ export interface RegistryCreateParams {
40
+ name: string;
41
+ password: string;
42
+ url: string;
43
+ username: string;
44
+ }
45
+ export interface RegistryUpdateParams {
46
+ name?: string;
47
+ password?: string;
48
+ url?: string;
49
+ username?: string;
50
+ }
51
+ export interface RegistryListParams {
52
+ /**
53
+ * Maximum number of registries to return
54
+ */
55
+ limit?: number;
56
+ /**
57
+ * Filter to registries whose name contains this substring
58
+ */
59
+ name_contains?: string;
60
+ /**
61
+ * Number of registries to skip
62
+ */
63
+ offset?: number;
64
+ }
65
+ export declare namespace Registries {
66
+ export { type RegistryListResponse as RegistryListResponse, type RegistryResponse as RegistryResponse, type RegistryCreateParams as RegistryCreateParams, type RegistryUpdateParams as RegistryUpdateParams, type RegistryListParams as RegistryListParams, };
67
+ }
@@ -0,0 +1,40 @@
1
+ // @ts-nocheck
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ import { APIResource } from '../../core/resource.js';
4
+ import { buildHeaders } from '../../internal/headers.js';
5
+ import { path } from '../../internal/utils/path.js';
6
+ export class Registries extends APIResource {
7
+ /**
8
+ * Create a sandbox registry for pulling private images.
9
+ */
10
+ create(body, options) {
11
+ return this._client.post('/v2/sandboxes/registries', { body, ...options });
12
+ }
13
+ /**
14
+ * Get a sandbox registry by name.
15
+ */
16
+ retrieve(name, options) {
17
+ return this._client.get(path `/v2/sandboxes/registries/${name}`, options);
18
+ }
19
+ /**
20
+ * Update a sandbox registry's name and/or credentials.
21
+ */
22
+ update(name, body, options) {
23
+ return this._client.patch(path `/v2/sandboxes/registries/${name}`, { body, ...options });
24
+ }
25
+ /**
26
+ * List sandbox registries for pulling private images.
27
+ */
28
+ list(query = {}, options) {
29
+ return this._client.get('/v2/sandboxes/registries', { query, ...options });
30
+ }
31
+ /**
32
+ * Delete a sandbox registry by name.
33
+ */
34
+ delete(name, options) {
35
+ return this._client.delete(path `/v2/sandboxes/registries/${name}`, {
36
+ ...options,
37
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
38
+ });
39
+ }
40
+ }