langsmith 0.7.7 → 0.7.9
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/README.md +161 -15
- package/dist/_openapi_client/client.cjs +814 -0
- package/dist/_openapi_client/client.d.ts +247 -0
- package/dist/_openapi_client/client.js +777 -0
- package/dist/_openapi_client/core/api-promise.cjs +100 -0
- package/dist/_openapi_client/core/api-promise.d.ts +45 -0
- package/dist/_openapi_client/core/api-promise.js +96 -0
- package/dist/_openapi_client/core/error.cjs +134 -0
- package/dist/_openapi_client/core/error.d.ts +45 -0
- package/dist/_openapi_client/core/error.js +118 -0
- package/dist/_openapi_client/core/pagination.cjs +374 -0
- package/dist/_openapi_client/core/pagination.d.ts +157 -0
- package/dist/_openapi_client/core/pagination.js +361 -0
- package/dist/_openapi_client/core/resource.cjs +17 -0
- package/dist/_openapi_client/core/resource.d.ts +5 -0
- package/dist/_openapi_client/core/resource.js +13 -0
- package/dist/_openapi_client/core/uploads.cjs +5 -0
- package/dist/_openapi_client/core/uploads.d.ts +2 -0
- package/dist/_openapi_client/core/uploads.js +1 -0
- package/dist/_openapi_client/index.cjs +29 -0
- package/dist/_openapi_client/index.d.ts +6 -0
- package/dist/_openapi_client/index.js +8 -0
- package/dist/_openapi_client/internal/builtin-types.cjs +4 -0
- package/dist/_openapi_client/internal/builtin-types.d.ts +72 -0
- package/dist/_openapi_client/internal/builtin-types.js +3 -0
- package/dist/_openapi_client/internal/detect-platform.cjs +162 -0
- package/dist/_openapi_client/internal/detect-platform.d.ts +14 -0
- package/dist/_openapi_client/internal/detect-platform.js +157 -0
- package/dist/_openapi_client/internal/errors.cjs +41 -0
- package/dist/_openapi_client/internal/errors.d.ts +2 -0
- package/dist/_openapi_client/internal/errors.js +36 -0
- package/dist/_openapi_client/internal/headers.cjs +79 -0
- package/dist/_openapi_client/internal/headers.d.ts +5 -0
- package/dist/_openapi_client/internal/headers.js +74 -0
- package/dist/_openapi_client/internal/parse.cjs +40 -0
- package/dist/_openapi_client/internal/parse.d.ts +11 -0
- package/dist/_openapi_client/internal/parse.js +37 -0
- package/dist/_openapi_client/internal/qs/formats.cjs +12 -0
- package/dist/_openapi_client/internal/qs/formats.d.ts +6 -0
- package/dist/_openapi_client/internal/qs/formats.js +8 -0
- package/dist/_openapi_client/internal/qs/stringify.cjs +277 -0
- package/dist/_openapi_client/internal/qs/stringify.d.ts +2 -0
- package/dist/_openapi_client/internal/qs/stringify.js +274 -0
- package/dist/_openapi_client/internal/qs/types.cjs +2 -0
- package/dist/_openapi_client/internal/qs/types.d.ts +56 -0
- package/dist/_openapi_client/internal/qs/types.js +1 -0
- package/dist/_openapi_client/internal/qs/utils.cjs +230 -0
- package/dist/_openapi_client/internal/qs/utils.d.ts +14 -0
- package/dist/_openapi_client/internal/qs/utils.js +217 -0
- package/dist/_openapi_client/internal/request-options.cjs +14 -0
- package/dist/_openapi_client/internal/request-options.d.ts +74 -0
- package/dist/_openapi_client/internal/request-options.js +10 -0
- package/dist/_openapi_client/internal/shim-types.cjs +4 -0
- package/dist/_openapi_client/internal/shim-types.d.ts +16 -0
- package/dist/_openapi_client/internal/shim-types.js +3 -0
- package/dist/_openapi_client/internal/shims.cjs +92 -0
- package/dist/_openapi_client/internal/shims.d.ts +25 -0
- package/dist/_openapi_client/internal/shims.js +85 -0
- package/dist/_openapi_client/internal/to-file.cjs +91 -0
- package/dist/_openapi_client/internal/to-file.d.ts +44 -0
- package/dist/_openapi_client/internal/to-file.js +88 -0
- package/dist/_openapi_client/internal/types.cjs +4 -0
- package/dist/_openapi_client/internal/types.d.ts +62 -0
- package/dist/_openapi_client/internal/types.js +3 -0
- package/dist/_openapi_client/internal/uploads.cjs +140 -0
- package/dist/_openapi_client/internal/uploads.d.ts +41 -0
- package/dist/_openapi_client/internal/uploads.js +130 -0
- package/dist/_openapi_client/internal/utils/env.cjs +22 -0
- package/dist/_openapi_client/internal/utils/env.d.ts +8 -0
- package/dist/_openapi_client/internal/utils/env.js +18 -0
- package/dist/_openapi_client/internal/utils/log.cjs +88 -0
- package/dist/_openapi_client/internal/utils/log.d.ts +36 -0
- package/dist/_openapi_client/internal/utils/log.js +82 -0
- package/dist/_openapi_client/internal/utils/path.cjs +79 -0
- package/dist/_openapi_client/internal/utils/path.d.ts +14 -0
- package/dist/_openapi_client/internal/utils/path.js +74 -0
- package/dist/_openapi_client/internal/utils/query.cjs +42 -0
- package/dist/_openapi_client/internal/utils/query.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/query.js +6 -0
- package/dist/_openapi_client/internal/utils/sleep.cjs +7 -0
- package/dist/_openapi_client/internal/utils/sleep.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/sleep.js +3 -0
- package/dist/_openapi_client/internal/utils/uuid.cjs +19 -0
- package/dist/_openapi_client/internal/utils/uuid.d.ts +4 -0
- package/dist/_openapi_client/internal/utils/uuid.js +15 -0
- package/dist/_openapi_client/internal/utils/values.cjs +112 -0
- package/dist/_openapi_client/internal/utils/values.d.ts +17 -0
- package/dist/_openapi_client/internal/utils/values.js +94 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.cjs +138 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.d.ts +367 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.js +101 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.cjs +46 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.d.ts +128 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.js +42 -0
- package/dist/_openapi_client/resources/commits.cjs +44 -0
- package/dist/_openapi_client/resources/commits.d.ts +204 -0
- package/dist/_openapi_client/resources/commits.js +40 -0
- package/dist/_openapi_client/resources/datasets/comparative.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/comparative.d.ts +55 -0
- package/dist/_openapi_client/resources/datasets/comparative.js +18 -0
- package/dist/_openapi_client/resources/datasets/datasets.cjs +193 -0
- package/dist/_openapi_client/resources/datasets/datasets.d.ts +374 -0
- package/dist/_openapi_client/resources/datasets/datasets.js +156 -0
- package/dist/_openapi_client/resources/datasets/experiments.cjs +16 -0
- package/dist/_openapi_client/resources/datasets/experiments.d.ts +23 -0
- package/dist/_openapi_client/resources/datasets/experiments.js +12 -0
- package/dist/_openapi_client/resources/datasets/group.cjs +17 -0
- package/dist/_openapi_client/resources/datasets/group.d.ts +160 -0
- package/dist/_openapi_client/resources/datasets/group.js +13 -0
- package/dist/_openapi_client/resources/datasets/runs.cjs +29 -0
- package/dist/_openapi_client/resources/datasets/runs.d.ts +216 -0
- package/dist/_openapi_client/resources/datasets/runs.js +25 -0
- package/dist/_openapi_client/resources/datasets/share.cjs +32 -0
- package/dist/_openapi_client/resources/datasets/share.d.ts +28 -0
- package/dist/_openapi_client/resources/datasets/share.js +28 -0
- package/dist/_openapi_client/resources/datasets/splits.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/splits.d.ts +30 -0
- package/dist/_openapi_client/resources/datasets/splits.js +18 -0
- package/dist/_openapi_client/resources/datasets/versions.cjs +23 -0
- package/dist/_openapi_client/resources/datasets/versions.d.ts +36 -0
- package/dist/_openapi_client/resources/datasets/versions.js +19 -0
- package/dist/_openapi_client/resources/evaluators.cjs +15 -0
- package/dist/_openapi_client/resources/evaluators.d.ts +125 -0
- package/dist/_openapi_client/resources/evaluators.js +11 -0
- package/dist/_openapi_client/resources/examples/bulk.cjs +24 -0
- package/dist/_openapi_client/resources/examples/bulk.d.ts +78 -0
- package/dist/_openapi_client/resources/examples/bulk.js +20 -0
- package/dist/_openapi_client/resources/examples/examples.cjs +124 -0
- package/dist/_openapi_client/resources/examples/examples.d.ts +182 -0
- package/dist/_openapi_client/resources/examples/examples.js +87 -0
- package/dist/_openapi_client/resources/examples/validate.cjs +21 -0
- package/dist/_openapi_client/resources/examples/validate.d.ts +38 -0
- package/dist/_openapi_client/resources/examples/validate.js +17 -0
- package/dist/_openapi_client/resources/feedback/configs.cjs +24 -0
- package/dist/_openapi_client/resources/feedback/configs.d.ts +18 -0
- package/dist/_openapi_client/resources/feedback/configs.js +20 -0
- package/dist/_openapi_client/resources/feedback/feedback.cjs +98 -0
- package/dist/_openapi_client/resources/feedback/feedback.d.ts +275 -0
- package/dist/_openapi_client/resources/feedback/feedback.js +61 -0
- package/dist/_openapi_client/resources/feedback/tokens.cjs +35 -0
- package/dist/_openapi_client/resources/feedback/tokens.d.ts +130 -0
- package/dist/_openapi_client/resources/feedback/tokens.js +31 -0
- package/dist/_openapi_client/resources/index.cjs +35 -0
- package/dist/_openapi_client/resources/index.d.ts +15 -0
- package/dist/_openapi_client/resources/index.js +17 -0
- package/dist/_openapi_client/resources/info.cjs +15 -0
- package/dist/_openapi_client/resources/info.d.ts +51 -0
- package/dist/_openapi_client/resources/info.js +11 -0
- package/dist/_openapi_client/resources/online-evaluators.cjs +70 -0
- package/dist/_openapi_client/resources/online-evaluators.d.ts +284 -0
- package/dist/_openapi_client/resources/online-evaluators.js +66 -0
- package/dist/_openapi_client/resources/public/datasets.cjs +47 -0
- package/dist/_openapi_client/resources/public/datasets.d.ts +152 -0
- package/dist/_openapi_client/resources/public/datasets.js +43 -0
- package/dist/_openapi_client/resources/public/public.cjs +62 -0
- package/dist/_openapi_client/resources/public/public.d.ts +32 -0
- package/dist/_openapi_client/resources/public/public.js +25 -0
- package/dist/_openapi_client/resources/repos/directories.cjs +40 -0
- package/dist/_openapi_client/resources/repos/directories.d.ts +72 -0
- package/dist/_openapi_client/resources/repos/directories.js +36 -0
- package/dist/_openapi_client/resources/repos/repos.cjs +93 -0
- package/dist/_openapi_client/resources/repos/repos.d.ts +188 -0
- package/dist/_openapi_client/resources/repos/repos.js +56 -0
- package/dist/_openapi_client/resources/runs/rules.cjs +9 -0
- package/dist/_openapi_client/resources/runs/rules.d.ts +3 -0
- package/dist/_openapi_client/resources/runs/rules.js +5 -0
- package/dist/_openapi_client/resources/runs/runs.cjs +102 -0
- package/dist/_openapi_client/resources/runs/runs.d.ts +542 -0
- package/dist/_openapi_client/resources/runs/runs.js +65 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.cjs +86 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +1121 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.js +82 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +63 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +13 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.js +26 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +39 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +130 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.js +35 -0
- package/dist/_openapi_client/resources/sessions/insights.cjs +54 -0
- package/dist/_openapi_client/resources/sessions/insights.d.ts +246 -0
- package/dist/_openapi_client/resources/sessions/insights.js +50 -0
- package/dist/_openapi_client/resources/sessions/sessions.cjs +109 -0
- package/dist/_openapi_client/resources/sessions/sessions.d.ts +674 -0
- package/dist/_openapi_client/resources/sessions/sessions.js +72 -0
- package/dist/_openapi_client/resources/settings.cjs +15 -0
- package/dist/_openapi_client/resources/settings.d.ts +18 -0
- package/dist/_openapi_client/resources/settings.js +11 -0
- package/dist/_openapi_client/resources/workspaces.cjs +35 -0
- package/dist/_openapi_client/resources/workspaces.d.ts +84 -0
- package/dist/_openapi_client/resources/workspaces.js +31 -0
- package/dist/_openapi_client/version.cjs +5 -0
- package/dist/_openapi_client/version.d.ts +1 -0
- package/dist/_openapi_client/version.js +2 -0
- package/dist/client.cjs +48 -19
- package/dist/client.d.ts +5 -0
- package/dist/client.js +29 -0
- package/dist/env.cjs +3 -3
- package/dist/env.d.ts +1 -1
- package/dist/env.js +1 -1
- package/dist/evaluation/_runner.cjs +31 -3
- package/dist/evaluation/_runner.d.ts +2 -0
- package/dist/evaluation/_runner.js +30 -4
- package/dist/experimental/otel/exporter.cjs +1 -1
- package/dist/experimental/otel/exporter.js +2 -2
- package/dist/experimental/vercel/telemetry.cjs +1 -1
- package/dist/experimental/vercel/telemetry.js +2 -2
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/run_trees.cjs +1 -1
- package/dist/run_trees.js +2 -2
- package/dist/sandbox/client.cjs +11 -3
- package/dist/sandbox/client.js +11 -3
- package/dist/sandbox/errors.cjs +2 -1
- package/dist/sandbox/errors.d.ts +2 -1
- package/dist/sandbox/errors.js +2 -1
- package/dist/sandbox/index.cjs +8 -2
- package/dist/sandbox/index.d.ts +3 -2
- package/dist/sandbox/index.js +2 -1
- package/dist/sandbox/mounts.cjs +114 -0
- package/dist/sandbox/mounts.d.ts +24 -0
- package/dist/sandbox/mounts.js +109 -0
- package/dist/sandbox/proxy_config.cjs +90 -5
- package/dist/sandbox/proxy_config.d.ts +19 -4
- package/dist/sandbox/proxy_config.js +86 -4
- package/dist/sandbox/types.d.ts +92 -3
- package/dist/traceable.cjs +1 -1
- package/dist/traceable.js +2 -2
- package/dist/utils/guard.cjs +13 -0
- package/dist/utils/guard.d.ts +6 -0
- package/dist/utils/guard.js +10 -0
- package/dist/utils/jestlike/globals.cjs +1 -1
- package/dist/utils/jestlike/globals.js +2 -2
- package/package.json +1 -1
|
@@ -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,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.Sandboxes = void 0;
|
|
39
|
+
const resource_js_1 = require("../../core/resource.cjs");
|
|
40
|
+
const BoxesAPI = __importStar(require("./boxes.cjs"));
|
|
41
|
+
const boxes_js_1 = require("./boxes.cjs");
|
|
42
|
+
const SnapshotsAPI = __importStar(require("./snapshots.cjs"));
|
|
43
|
+
const snapshots_js_1 = require("./snapshots.cjs");
|
|
44
|
+
class Sandboxes extends resource_js_1.APIResource {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
Object.defineProperty(this, "boxes", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true,
|
|
51
|
+
value: new BoxesAPI.Boxes(this._client)
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(this, "snapshots", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
configurable: true,
|
|
56
|
+
writable: true,
|
|
57
|
+
value: new SnapshotsAPI.Snapshots(this._client)
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.Sandboxes = Sandboxes;
|
|
62
|
+
Sandboxes.Boxes = boxes_js_1.Boxes;
|
|
63
|
+
Sandboxes.Snapshots = snapshots_js_1.Snapshots;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource.js';
|
|
2
|
+
import * as BoxesAPI from './boxes.js';
|
|
3
|
+
import { BoxCreateParams, BoxCreateResponse, BoxCreateSnapshotParams, BoxCreateSnapshotResponse, BoxGenerateServiceURLParams, BoxGenerateServiceURLResponse, BoxGetStatusResponse, BoxListParams, BoxListResponse, BoxRetrieveResponse, BoxStartResponse, BoxUpdateParams, BoxUpdateResponse, Boxes } from './boxes.js';
|
|
4
|
+
import * as SnapshotsAPI from './snapshots.js';
|
|
5
|
+
import { SnapshotCreateParams, SnapshotCreateResponse, SnapshotListParams, SnapshotListResponse, SnapshotRetrieveResponse, Snapshots } from './snapshots.js';
|
|
6
|
+
export declare class Sandboxes extends APIResource {
|
|
7
|
+
boxes: BoxesAPI.Boxes;
|
|
8
|
+
snapshots: SnapshotsAPI.Snapshots;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace Sandboxes {
|
|
11
|
+
export { Boxes as Boxes, type BoxCreateResponse as BoxCreateResponse, type BoxRetrieveResponse as BoxRetrieveResponse, type BoxUpdateResponse as BoxUpdateResponse, type BoxListResponse as BoxListResponse, type BoxCreateSnapshotResponse as BoxCreateSnapshotResponse, type BoxGenerateServiceURLResponse as BoxGenerateServiceURLResponse, type BoxGetStatusResponse as BoxGetStatusResponse, type BoxStartResponse as BoxStartResponse, type BoxCreateParams as BoxCreateParams, type BoxUpdateParams as BoxUpdateParams, type BoxListParams as BoxListParams, type BoxCreateSnapshotParams as BoxCreateSnapshotParams, type BoxGenerateServiceURLParams as BoxGenerateServiceURLParams, };
|
|
12
|
+
export { Snapshots as Snapshots, type SnapshotCreateResponse as SnapshotCreateResponse, type SnapshotRetrieveResponse as SnapshotRetrieveResponse, type SnapshotListResponse as SnapshotListResponse, type SnapshotCreateParams as SnapshotCreateParams, type SnapshotListParams as SnapshotListParams, };
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 * as BoxesAPI from './boxes.js';
|
|
5
|
+
import { Boxes, } from './boxes.js';
|
|
6
|
+
import * as SnapshotsAPI from './snapshots.js';
|
|
7
|
+
import { Snapshots, } from './snapshots.js';
|
|
8
|
+
export class Sandboxes extends APIResource {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
Object.defineProperty(this, "boxes", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: new BoxesAPI.Boxes(this._client)
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "snapshots", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: new SnapshotsAPI.Snapshots(this._client)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
Sandboxes.Boxes = Boxes;
|
|
26
|
+
Sandboxes.Snapshots = Snapshots;
|
|
@@ -0,0 +1,39 @@
|
|
|
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.Snapshots = 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 Snapshots extends resource_js_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a snapshot from a Docker image (async build).
|
|
12
|
+
*/
|
|
13
|
+
create(body, options) {
|
|
14
|
+
return this._client.post('/v2/sandboxes/snapshots', { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get a sandbox snapshot by ID.
|
|
18
|
+
*/
|
|
19
|
+
retrieve(snapshotID, options) {
|
|
20
|
+
return this._client.get((0, path_js_1.path) `/v2/sandboxes/snapshots/${snapshotID}`, options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* List sandbox snapshots for the authenticated tenant, with optional filtering,
|
|
24
|
+
* sorting, and pagination.
|
|
25
|
+
*/
|
|
26
|
+
list(query = {}, options) {
|
|
27
|
+
return this._client.get('/v2/sandboxes/snapshots', { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Delete a snapshot by ID. The underlying storage is reclaimed asynchronously.
|
|
31
|
+
*/
|
|
32
|
+
delete(snapshotID, options) {
|
|
33
|
+
return this._client.delete((0, path_js_1.path) `/v2/sandboxes/snapshots/${snapshotID}`, {
|
|
34
|
+
...options,
|
|
35
|
+
headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.Snapshots = Snapshots;
|
|
@@ -0,0 +1,130 @@
|
|
|
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 Snapshots extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a snapshot from a Docker image (async build).
|
|
7
|
+
*/
|
|
8
|
+
create(body: SnapshotCreateParams, options?: RequestOptions): APIPromise<SnapshotCreateResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Get a sandbox snapshot by ID.
|
|
11
|
+
*/
|
|
12
|
+
retrieve(snapshotID: string, options?: RequestOptions): APIPromise<SnapshotRetrieveResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* List sandbox snapshots for the authenticated tenant, with optional filtering,
|
|
15
|
+
* sorting, and pagination.
|
|
16
|
+
*/
|
|
17
|
+
list(query?: SnapshotListParams | null | undefined, options?: RequestOptions): APIPromise<SnapshotListResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Delete a snapshot by ID. The underlying storage is reclaimed asynchronously.
|
|
20
|
+
*/
|
|
21
|
+
delete(snapshotID: string, options?: RequestOptions): APIPromise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface SnapshotCreateResponse {
|
|
24
|
+
id?: string;
|
|
25
|
+
created_at?: string;
|
|
26
|
+
created_by?: string;
|
|
27
|
+
docker_image?: string;
|
|
28
|
+
fs_capacity_bytes?: number;
|
|
29
|
+
fs_used_bytes?: number;
|
|
30
|
+
image_digest?: string;
|
|
31
|
+
/**
|
|
32
|
+
* MemorySnapshotSizeBytes is non-nil iff the snapshot was captured with VM memory
|
|
33
|
+
* state. A non-nil value is the canonical signal that this snapshot can
|
|
34
|
+
* warm-restore from memory; nil means rootfs only.
|
|
35
|
+
*/
|
|
36
|
+
memory_snapshot_size_bytes?: number;
|
|
37
|
+
name?: string;
|
|
38
|
+
registry_id?: string;
|
|
39
|
+
source_sandbox_id?: string;
|
|
40
|
+
status?: string;
|
|
41
|
+
status_message?: string;
|
|
42
|
+
updated_at?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface SnapshotRetrieveResponse {
|
|
45
|
+
id?: string;
|
|
46
|
+
created_at?: string;
|
|
47
|
+
created_by?: string;
|
|
48
|
+
docker_image?: string;
|
|
49
|
+
fs_capacity_bytes?: number;
|
|
50
|
+
fs_used_bytes?: number;
|
|
51
|
+
image_digest?: string;
|
|
52
|
+
/**
|
|
53
|
+
* MemorySnapshotSizeBytes is non-nil iff the snapshot was captured with VM memory
|
|
54
|
+
* state. A non-nil value is the canonical signal that this snapshot can
|
|
55
|
+
* warm-restore from memory; nil means rootfs only.
|
|
56
|
+
*/
|
|
57
|
+
memory_snapshot_size_bytes?: number;
|
|
58
|
+
name?: string;
|
|
59
|
+
registry_id?: string;
|
|
60
|
+
source_sandbox_id?: string;
|
|
61
|
+
status?: string;
|
|
62
|
+
status_message?: string;
|
|
63
|
+
updated_at?: string;
|
|
64
|
+
}
|
|
65
|
+
export interface SnapshotListResponse {
|
|
66
|
+
offset?: number;
|
|
67
|
+
snapshots?: Array<SnapshotListResponse.Snapshot>;
|
|
68
|
+
}
|
|
69
|
+
export declare namespace SnapshotListResponse {
|
|
70
|
+
interface Snapshot {
|
|
71
|
+
id?: string;
|
|
72
|
+
created_at?: string;
|
|
73
|
+
created_by?: string;
|
|
74
|
+
docker_image?: string;
|
|
75
|
+
fs_capacity_bytes?: number;
|
|
76
|
+
fs_used_bytes?: number;
|
|
77
|
+
image_digest?: string;
|
|
78
|
+
/**
|
|
79
|
+
* MemorySnapshotSizeBytes is non-nil iff the snapshot was captured with VM memory
|
|
80
|
+
* state. A non-nil value is the canonical signal that this snapshot can
|
|
81
|
+
* warm-restore from memory; nil means rootfs only.
|
|
82
|
+
*/
|
|
83
|
+
memory_snapshot_size_bytes?: number;
|
|
84
|
+
name?: string;
|
|
85
|
+
registry_id?: string;
|
|
86
|
+
source_sandbox_id?: string;
|
|
87
|
+
status?: string;
|
|
88
|
+
status_message?: string;
|
|
89
|
+
updated_at?: string;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export interface SnapshotCreateParams {
|
|
93
|
+
docker_image: string;
|
|
94
|
+
fs_capacity_bytes: number;
|
|
95
|
+
name: string;
|
|
96
|
+
registry_id?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface SnapshotListParams {
|
|
99
|
+
/**
|
|
100
|
+
* Filter by creator identity. Only 'me' is supported.
|
|
101
|
+
*/
|
|
102
|
+
created_by?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Maximum number of results
|
|
105
|
+
*/
|
|
106
|
+
limit?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Filter by name substring
|
|
109
|
+
*/
|
|
110
|
+
name_contains?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Pagination offset
|
|
113
|
+
*/
|
|
114
|
+
offset?: number;
|
|
115
|
+
/**
|
|
116
|
+
* Sort column (name, status, created_at)
|
|
117
|
+
*/
|
|
118
|
+
sort_by?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Sort direction (asc, desc)
|
|
121
|
+
*/
|
|
122
|
+
sort_direction?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Filter by status (building, ready, failed, deleting)
|
|
125
|
+
*/
|
|
126
|
+
status?: string;
|
|
127
|
+
}
|
|
128
|
+
export declare namespace Snapshots {
|
|
129
|
+
export { type SnapshotCreateResponse as SnapshotCreateResponse, type SnapshotRetrieveResponse as SnapshotRetrieveResponse, type SnapshotListResponse as SnapshotListResponse, type SnapshotCreateParams as SnapshotCreateParams, type SnapshotListParams as SnapshotListParams, };
|
|
130
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 Snapshots extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* Create a snapshot from a Docker image (async build).
|
|
9
|
+
*/
|
|
10
|
+
create(body, options) {
|
|
11
|
+
return this._client.post('/v2/sandboxes/snapshots', { body, ...options });
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get a sandbox snapshot by ID.
|
|
15
|
+
*/
|
|
16
|
+
retrieve(snapshotID, options) {
|
|
17
|
+
return this._client.get(path `/v2/sandboxes/snapshots/${snapshotID}`, options);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* List sandbox snapshots for the authenticated tenant, with optional filtering,
|
|
21
|
+
* sorting, and pagination.
|
|
22
|
+
*/
|
|
23
|
+
list(query = {}, options) {
|
|
24
|
+
return this._client.get('/v2/sandboxes/snapshots', { query, ...options });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Delete a snapshot by ID. The underlying storage is reclaimed asynchronously.
|
|
28
|
+
*/
|
|
29
|
+
delete(snapshotID, options) {
|
|
30
|
+
return this._client.delete(path `/v2/sandboxes/snapshots/${snapshotID}`, {
|
|
31
|
+
...options,
|
|
32
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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.Insights = void 0;
|
|
6
|
+
const resource_js_1 = require("../../core/resource.cjs");
|
|
7
|
+
const pagination_js_1 = require("../../core/pagination.cjs");
|
|
8
|
+
const path_js_1 = require("../../internal/utils/path.cjs");
|
|
9
|
+
class Insights extends resource_js_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create an insights job.
|
|
12
|
+
*/
|
|
13
|
+
create(sessionID, body, options) {
|
|
14
|
+
return this._client.post((0, path_js_1.path) `/api/v1/sessions/${sessionID}/insights`, { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Update a session cluster job.
|
|
18
|
+
*/
|
|
19
|
+
update(jobID, params, options) {
|
|
20
|
+
const { session_id, ...body } = params;
|
|
21
|
+
return this._client.patch((0, path_js_1.path) `/api/v1/sessions/${session_id}/insights/${jobID}`, { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get all clusters for a session.
|
|
25
|
+
*/
|
|
26
|
+
list(sessionID, query = {}, options) {
|
|
27
|
+
return this._client.getAPIList((0, path_js_1.path) `/api/v1/sessions/${sessionID}/insights`, (pagination_js_1.OffsetPaginationInsightsClusteringJobs), { query, ...options });
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Delete a session cluster job.
|
|
31
|
+
*/
|
|
32
|
+
delete(jobID, params, options) {
|
|
33
|
+
const { session_id } = params;
|
|
34
|
+
return this._client.delete((0, path_js_1.path) `/api/v1/sessions/${session_id}/insights/${jobID}`, options);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get a specific cluster job for a session.
|
|
38
|
+
*/
|
|
39
|
+
retrieveJob(jobID, params, options) {
|
|
40
|
+
const { session_id } = params;
|
|
41
|
+
return this._client.get((0, path_js_1.path) `/api/v1/sessions/${session_id}/insights/${jobID}`, options);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get all runs for a cluster job, optionally filtered by cluster.
|
|
45
|
+
*/
|
|
46
|
+
retrieveRuns(jobID, params, options) {
|
|
47
|
+
const { session_id, ...query } = params;
|
|
48
|
+
return this._client.get((0, path_js_1.path) `/api/v1/sessions/${session_id}/insights/${jobID}/runs`, {
|
|
49
|
+
query,
|
|
50
|
+
...options,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.Insights = Insights;
|