@vercel/sandbox 0.0.8 → 0.0.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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/api-client/api-client.d.ts +70 -6
- package/dist/api-client/api-client.js +16 -7
- package/dist/api-client/index.d.ts +1 -0
- package/dist/api-client/index.js +15 -0
- package/dist/api-client/validators.d.ts +343 -50
- package/dist/api-client/validators.js +37 -16
- package/dist/command.d.ts +18 -5
- package/dist/command.js +27 -6
- package/dist/sandbox.d.ts +13 -14
- package/dist/sandbox.js +27 -14
- package/dist/utils/resolveSignal.d.ts +13 -0
- package/dist/utils/resolveSignal.js +21 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/api-client/api-client.ts +39 -16
- package/src/api-client/index.ts +1 -0
- package/src/api-client/validators.ts +45 -15
- package/src/command.test.ts +39 -16
- package/src/command.ts +33 -10
- package/src/sandbox.ts +38 -21
- package/src/utils/resolveSignal.ts +24 -0
- package/src/version.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @vercel/sandbox
|
|
2
2
|
|
|
3
|
+
## 0.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add `cmd.kill()` to stop/signal commands ([#48](https://github.com/vercel/sandbox-sdk/pull/48))
|
|
8
|
+
- Update SDK to use the new API ([#51](https://github.com/vercel/sandbox-sdk/pull/51))
|
|
9
|
+
|
|
3
10
|
## 0.0.8
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient, type Parsed, type RequestParams } from "./base-client";
|
|
2
|
-
import {
|
|
2
|
+
import { SandboxResponse, CommandResponse, CommandFinishedResponse, LogLine } from "./validators";
|
|
3
3
|
import { FileWriter } from "./file-writer";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
export declare class APIClient extends BaseClient {
|
|
@@ -10,6 +10,31 @@ export declare class APIClient extends BaseClient {
|
|
|
10
10
|
token: string;
|
|
11
11
|
});
|
|
12
12
|
protected request(path: string, params?: RequestParams): Promise<import("node-fetch").Response>;
|
|
13
|
+
getSandbox(params: {
|
|
14
|
+
sandboxId: string;
|
|
15
|
+
}): Promise<Parsed<{
|
|
16
|
+
sandbox: {
|
|
17
|
+
region: string;
|
|
18
|
+
timeout: number;
|
|
19
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
20
|
+
id: string;
|
|
21
|
+
memory: number;
|
|
22
|
+
vcpus: number;
|
|
23
|
+
runtime: string;
|
|
24
|
+
requestedAt: number;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
updatedAt: number;
|
|
27
|
+
duration?: number | undefined;
|
|
28
|
+
startedAt?: number | undefined;
|
|
29
|
+
requestedStopAt?: number | undefined;
|
|
30
|
+
stoppedAt?: number | undefined;
|
|
31
|
+
};
|
|
32
|
+
routes: {
|
|
33
|
+
port: number;
|
|
34
|
+
url: string;
|
|
35
|
+
subdomain: string;
|
|
36
|
+
}[];
|
|
37
|
+
}>>;
|
|
13
38
|
createSandbox(params: {
|
|
14
39
|
ports?: number[];
|
|
15
40
|
projectId: string;
|
|
@@ -28,9 +53,25 @@ export declare class APIClient extends BaseClient {
|
|
|
28
53
|
};
|
|
29
54
|
runtime?: "node22" | "python3.13";
|
|
30
55
|
}): Promise<Parsed<{
|
|
31
|
-
|
|
56
|
+
sandbox: {
|
|
57
|
+
region: string;
|
|
58
|
+
timeout: number;
|
|
59
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
60
|
+
id: string;
|
|
61
|
+
memory: number;
|
|
62
|
+
vcpus: number;
|
|
63
|
+
runtime: string;
|
|
64
|
+
requestedAt: number;
|
|
65
|
+
createdAt: number;
|
|
66
|
+
updatedAt: number;
|
|
67
|
+
duration?: number | undefined;
|
|
68
|
+
startedAt?: number | undefined;
|
|
69
|
+
requestedStopAt?: number | undefined;
|
|
70
|
+
stoppedAt?: number | undefined;
|
|
71
|
+
};
|
|
32
72
|
routes: {
|
|
33
73
|
port: number;
|
|
74
|
+
url: string;
|
|
34
75
|
subdomain: string;
|
|
35
76
|
}[];
|
|
36
77
|
}>>;
|
|
@@ -41,18 +82,26 @@ export declare class APIClient extends BaseClient {
|
|
|
41
82
|
args: string[];
|
|
42
83
|
env: Record<string, string>;
|
|
43
84
|
}): Promise<Parsed<{
|
|
44
|
-
|
|
85
|
+
command: {
|
|
86
|
+
name: string;
|
|
87
|
+
cwd: string;
|
|
88
|
+
args: string[];
|
|
89
|
+
id: string;
|
|
90
|
+
startedAt: number;
|
|
91
|
+
sandboxId: string;
|
|
92
|
+
exitCode: number | null;
|
|
93
|
+
};
|
|
45
94
|
}>>;
|
|
46
95
|
getCommand(params: {
|
|
47
96
|
sandboxId: string;
|
|
48
97
|
cmdId: string;
|
|
49
98
|
wait: true;
|
|
50
|
-
}): Promise<Parsed<z.infer<typeof
|
|
99
|
+
}): Promise<Parsed<z.infer<typeof CommandFinishedResponse>>>;
|
|
51
100
|
getCommand(params: {
|
|
52
101
|
sandboxId: string;
|
|
53
102
|
cmdId: string;
|
|
54
103
|
wait?: boolean;
|
|
55
|
-
}): Promise<Parsed<z.infer<typeof
|
|
104
|
+
}): Promise<Parsed<z.infer<typeof CommandResponse>>>;
|
|
56
105
|
mkDir(params: {
|
|
57
106
|
sandboxId: string;
|
|
58
107
|
path: string;
|
|
@@ -76,11 +125,26 @@ export declare class APIClient extends BaseClient {
|
|
|
76
125
|
path: string;
|
|
77
126
|
cwd?: string;
|
|
78
127
|
}): Promise<NodeJS.ReadableStream | null>;
|
|
128
|
+
killCommand(params: {
|
|
129
|
+
sandboxId: string;
|
|
130
|
+
commandId: string;
|
|
131
|
+
signal: number;
|
|
132
|
+
}): Promise<Parsed<{
|
|
133
|
+
command: {
|
|
134
|
+
name: string;
|
|
135
|
+
cwd: string;
|
|
136
|
+
args: string[];
|
|
137
|
+
id: string;
|
|
138
|
+
startedAt: number;
|
|
139
|
+
sandboxId: string;
|
|
140
|
+
exitCode: number | null;
|
|
141
|
+
};
|
|
142
|
+
}>>;
|
|
79
143
|
getLogs(params: {
|
|
80
144
|
sandboxId: string;
|
|
81
145
|
cmdId: string;
|
|
82
146
|
}): AsyncIterable<z.infer<typeof LogLine>>;
|
|
83
147
|
stopSandbox(params: {
|
|
84
148
|
sandboxId: string;
|
|
85
|
-
}): Promise<Parsed<z.infer<typeof
|
|
149
|
+
}): Promise<Parsed<z.infer<typeof SandboxResponse>>>;
|
|
86
150
|
}
|
|
@@ -41,8 +41,11 @@ class APIClient extends base_client_1.BaseClient {
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
+
async getSandbox(params) {
|
|
45
|
+
return (0, base_client_1.parseOrThrow)(validators_1.SandboxAndRoutesResponse, await this.request(`/v1/sandboxes/${params.sandboxId}`));
|
|
46
|
+
}
|
|
44
47
|
async createSandbox(params) {
|
|
45
|
-
return (0, base_client_1.parseOrThrow)(validators_1.
|
|
48
|
+
return (0, base_client_1.parseOrThrow)(validators_1.SandboxAndRoutesResponse, await this.request("/v1/sandboxes", {
|
|
46
49
|
method: "POST",
|
|
47
50
|
body: JSON.stringify({
|
|
48
51
|
projectId: params.projectId,
|
|
@@ -55,7 +58,7 @@ class APIClient extends base_client_1.BaseClient {
|
|
|
55
58
|
}));
|
|
56
59
|
}
|
|
57
60
|
async runCommand(params) {
|
|
58
|
-
return (0, base_client_1.parseOrThrow)(validators_1.
|
|
61
|
+
return (0, base_client_1.parseOrThrow)(validators_1.CommandResponse, await this.request(`/v1/sandboxes/${params.sandboxId}/cmd`, {
|
|
59
62
|
method: "POST",
|
|
60
63
|
body: JSON.stringify({
|
|
61
64
|
command: params.command,
|
|
@@ -67,11 +70,11 @@ class APIClient extends base_client_1.BaseClient {
|
|
|
67
70
|
}
|
|
68
71
|
async getCommand(params) {
|
|
69
72
|
return params.wait
|
|
70
|
-
? (0, base_client_1.parseOrThrow)(validators_1.
|
|
71
|
-
: (0, base_client_1.parseOrThrow)(validators_1.
|
|
73
|
+
? (0, base_client_1.parseOrThrow)(validators_1.CommandFinishedResponse, await this.request(`/v1/sandboxes/${params.sandboxId}/cmd/${params.cmdId}`, { query: { wait: "true" } }))
|
|
74
|
+
: (0, base_client_1.parseOrThrow)(validators_1.CommandResponse, await this.request(`/v1/sandboxes/${params.sandboxId}/cmd/${params.cmdId}`));
|
|
72
75
|
}
|
|
73
76
|
async mkDir(params) {
|
|
74
|
-
return (0, base_client_1.parseOrThrow)(validators_1.
|
|
77
|
+
return (0, base_client_1.parseOrThrow)(validators_1.EmptyResponse, await this.request(`/v1/sandboxes/${params.sandboxId}/fs/mkdir`, {
|
|
75
78
|
method: "POST",
|
|
76
79
|
body: JSON.stringify({ path: params.path, cwd: params.cwd }),
|
|
77
80
|
}));
|
|
@@ -95,7 +98,7 @@ class APIClient extends base_client_1.BaseClient {
|
|
|
95
98
|
await writer.addFile({ name: file.path, content: file.stream });
|
|
96
99
|
}
|
|
97
100
|
await writer.end();
|
|
98
|
-
await (0, base_client_1.parseOrThrow)(validators_1.
|
|
101
|
+
await (0, base_client_1.parseOrThrow)(validators_1.EmptyResponse, await response);
|
|
99
102
|
}
|
|
100
103
|
async readFile(params) {
|
|
101
104
|
const response = await this.request(`/v1/sandboxes/${params.sandboxId}/fs/read`, {
|
|
@@ -107,6 +110,12 @@ class APIClient extends base_client_1.BaseClient {
|
|
|
107
110
|
}
|
|
108
111
|
return response.body;
|
|
109
112
|
}
|
|
113
|
+
async killCommand(params) {
|
|
114
|
+
return (0, base_client_1.parseOrThrow)(validators_1.CommandResponse, await this.request(`/v1/sandboxes/${params.sandboxId}/${params.commandId}/kill`, {
|
|
115
|
+
method: "POST",
|
|
116
|
+
body: JSON.stringify({ signal: params.signal }),
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
110
119
|
async *getLogs(params) {
|
|
111
120
|
const url = `/v1/sandboxes/${params.sandboxId}/cmd/${params.cmdId}/logs`;
|
|
112
121
|
const response = await this.request(url, { method: "GET" });
|
|
@@ -133,7 +142,7 @@ class APIClient extends base_client_1.BaseClient {
|
|
|
133
142
|
}
|
|
134
143
|
async stopSandbox(params) {
|
|
135
144
|
const url = `/v1/sandboxes/${params.sandboxId}/stop`;
|
|
136
|
-
return (0, base_client_1.parseOrThrow)(validators_1.
|
|
145
|
+
return (0, base_client_1.parseOrThrow)(validators_1.SandboxResponse, await this.request(url, { method: "POST" }));
|
|
137
146
|
}
|
|
138
147
|
}
|
|
139
148
|
exports.APIClient = APIClient;
|
package/dist/api-client/index.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.APIClient = void 0;
|
|
4
18
|
var api_client_1 = require("./api-client");
|
|
5
19
|
Object.defineProperty(exports, "APIClient", { enumerable: true, get: function () { return api_client_1.APIClient; } });
|
|
20
|
+
__exportStar(require("./validators"), exports);
|
|
@@ -1,82 +1,375 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export
|
|
2
|
+
export type SandboxData = z.infer<typeof Sandbox>;
|
|
3
|
+
export declare const Sandbox: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
memory: z.ZodNumber;
|
|
6
|
+
vcpus: z.ZodNumber;
|
|
7
|
+
region: z.ZodString;
|
|
8
|
+
runtime: z.ZodString;
|
|
9
|
+
timeout: z.ZodNumber;
|
|
10
|
+
status: z.ZodEnum<["pending", "running", "stopping", "stopped", "failed"]>;
|
|
11
|
+
requestedAt: z.ZodNumber;
|
|
12
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
requestedStopAt: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
stoppedAt: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
createdAt: z.ZodNumber;
|
|
17
|
+
updatedAt: z.ZodNumber;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
region: string;
|
|
20
|
+
timeout: number;
|
|
21
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
22
|
+
id: string;
|
|
23
|
+
memory: number;
|
|
24
|
+
vcpus: number;
|
|
25
|
+
runtime: string;
|
|
26
|
+
requestedAt: number;
|
|
27
|
+
createdAt: number;
|
|
28
|
+
updatedAt: number;
|
|
29
|
+
duration?: number | undefined;
|
|
30
|
+
startedAt?: number | undefined;
|
|
31
|
+
requestedStopAt?: number | undefined;
|
|
32
|
+
stoppedAt?: number | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
region: string;
|
|
35
|
+
timeout: number;
|
|
36
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
37
|
+
id: string;
|
|
38
|
+
memory: number;
|
|
39
|
+
vcpus: number;
|
|
40
|
+
runtime: string;
|
|
41
|
+
requestedAt: number;
|
|
42
|
+
createdAt: number;
|
|
43
|
+
updatedAt: number;
|
|
44
|
+
duration?: number | undefined;
|
|
45
|
+
startedAt?: number | undefined;
|
|
46
|
+
requestedStopAt?: number | undefined;
|
|
47
|
+
stoppedAt?: number | undefined;
|
|
48
|
+
}>;
|
|
49
|
+
export type SandboxRouteData = z.infer<typeof SandboxRoute>;
|
|
50
|
+
export declare const SandboxRoute: z.ZodObject<{
|
|
51
|
+
url: z.ZodString;
|
|
52
|
+
subdomain: z.ZodString;
|
|
53
|
+
port: z.ZodNumber;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
port: number;
|
|
56
|
+
url: string;
|
|
57
|
+
subdomain: string;
|
|
58
|
+
}, {
|
|
59
|
+
port: number;
|
|
60
|
+
url: string;
|
|
61
|
+
subdomain: string;
|
|
62
|
+
}>;
|
|
63
|
+
export type CommandData = z.infer<typeof Command>;
|
|
64
|
+
export declare const Command: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
args: z.ZodArray<z.ZodString, "many">;
|
|
68
|
+
cwd: z.ZodString;
|
|
3
69
|
sandboxId: z.ZodString;
|
|
70
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
71
|
+
startedAt: z.ZodNumber;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
name: string;
|
|
74
|
+
cwd: string;
|
|
75
|
+
args: string[];
|
|
76
|
+
id: string;
|
|
77
|
+
startedAt: number;
|
|
78
|
+
sandboxId: string;
|
|
79
|
+
exitCode: number | null;
|
|
80
|
+
}, {
|
|
81
|
+
name: string;
|
|
82
|
+
cwd: string;
|
|
83
|
+
args: string[];
|
|
84
|
+
id: string;
|
|
85
|
+
startedAt: number;
|
|
86
|
+
sandboxId: string;
|
|
87
|
+
exitCode: number | null;
|
|
88
|
+
}>;
|
|
89
|
+
export declare const SandboxResponse: z.ZodObject<{
|
|
90
|
+
sandbox: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
memory: z.ZodNumber;
|
|
93
|
+
vcpus: z.ZodNumber;
|
|
94
|
+
region: z.ZodString;
|
|
95
|
+
runtime: z.ZodString;
|
|
96
|
+
timeout: z.ZodNumber;
|
|
97
|
+
status: z.ZodEnum<["pending", "running", "stopping", "stopped", "failed"]>;
|
|
98
|
+
requestedAt: z.ZodNumber;
|
|
99
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
requestedStopAt: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
stoppedAt: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
createdAt: z.ZodNumber;
|
|
104
|
+
updatedAt: z.ZodNumber;
|
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
|
106
|
+
region: string;
|
|
107
|
+
timeout: number;
|
|
108
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
109
|
+
id: string;
|
|
110
|
+
memory: number;
|
|
111
|
+
vcpus: number;
|
|
112
|
+
runtime: string;
|
|
113
|
+
requestedAt: number;
|
|
114
|
+
createdAt: number;
|
|
115
|
+
updatedAt: number;
|
|
116
|
+
duration?: number | undefined;
|
|
117
|
+
startedAt?: number | undefined;
|
|
118
|
+
requestedStopAt?: number | undefined;
|
|
119
|
+
stoppedAt?: number | undefined;
|
|
120
|
+
}, {
|
|
121
|
+
region: string;
|
|
122
|
+
timeout: number;
|
|
123
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
124
|
+
id: string;
|
|
125
|
+
memory: number;
|
|
126
|
+
vcpus: number;
|
|
127
|
+
runtime: string;
|
|
128
|
+
requestedAt: number;
|
|
129
|
+
createdAt: number;
|
|
130
|
+
updatedAt: number;
|
|
131
|
+
duration?: number | undefined;
|
|
132
|
+
startedAt?: number | undefined;
|
|
133
|
+
requestedStopAt?: number | undefined;
|
|
134
|
+
stoppedAt?: number | undefined;
|
|
135
|
+
}>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
sandbox: {
|
|
138
|
+
region: string;
|
|
139
|
+
timeout: number;
|
|
140
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
141
|
+
id: string;
|
|
142
|
+
memory: number;
|
|
143
|
+
vcpus: number;
|
|
144
|
+
runtime: string;
|
|
145
|
+
requestedAt: number;
|
|
146
|
+
createdAt: number;
|
|
147
|
+
updatedAt: number;
|
|
148
|
+
duration?: number | undefined;
|
|
149
|
+
startedAt?: number | undefined;
|
|
150
|
+
requestedStopAt?: number | undefined;
|
|
151
|
+
stoppedAt?: number | undefined;
|
|
152
|
+
};
|
|
153
|
+
}, {
|
|
154
|
+
sandbox: {
|
|
155
|
+
region: string;
|
|
156
|
+
timeout: number;
|
|
157
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
158
|
+
id: string;
|
|
159
|
+
memory: number;
|
|
160
|
+
vcpus: number;
|
|
161
|
+
runtime: string;
|
|
162
|
+
requestedAt: number;
|
|
163
|
+
createdAt: number;
|
|
164
|
+
updatedAt: number;
|
|
165
|
+
duration?: number | undefined;
|
|
166
|
+
startedAt?: number | undefined;
|
|
167
|
+
requestedStopAt?: number | undefined;
|
|
168
|
+
stoppedAt?: number | undefined;
|
|
169
|
+
};
|
|
170
|
+
}>;
|
|
171
|
+
export declare const SandboxAndRoutesResponse: z.ZodObject<{
|
|
172
|
+
sandbox: z.ZodObject<{
|
|
173
|
+
id: z.ZodString;
|
|
174
|
+
memory: z.ZodNumber;
|
|
175
|
+
vcpus: z.ZodNumber;
|
|
176
|
+
region: z.ZodString;
|
|
177
|
+
runtime: z.ZodString;
|
|
178
|
+
timeout: z.ZodNumber;
|
|
179
|
+
status: z.ZodEnum<["pending", "running", "stopping", "stopped", "failed"]>;
|
|
180
|
+
requestedAt: z.ZodNumber;
|
|
181
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
requestedStopAt: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
stoppedAt: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
createdAt: z.ZodNumber;
|
|
186
|
+
updatedAt: z.ZodNumber;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
region: string;
|
|
189
|
+
timeout: number;
|
|
190
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
191
|
+
id: string;
|
|
192
|
+
memory: number;
|
|
193
|
+
vcpus: number;
|
|
194
|
+
runtime: string;
|
|
195
|
+
requestedAt: number;
|
|
196
|
+
createdAt: number;
|
|
197
|
+
updatedAt: number;
|
|
198
|
+
duration?: number | undefined;
|
|
199
|
+
startedAt?: number | undefined;
|
|
200
|
+
requestedStopAt?: number | undefined;
|
|
201
|
+
stoppedAt?: number | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
region: string;
|
|
204
|
+
timeout: number;
|
|
205
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
206
|
+
id: string;
|
|
207
|
+
memory: number;
|
|
208
|
+
vcpus: number;
|
|
209
|
+
runtime: string;
|
|
210
|
+
requestedAt: number;
|
|
211
|
+
createdAt: number;
|
|
212
|
+
updatedAt: number;
|
|
213
|
+
duration?: number | undefined;
|
|
214
|
+
startedAt?: number | undefined;
|
|
215
|
+
requestedStopAt?: number | undefined;
|
|
216
|
+
stoppedAt?: number | undefined;
|
|
217
|
+
}>;
|
|
218
|
+
} & {
|
|
4
219
|
routes: z.ZodArray<z.ZodObject<{
|
|
220
|
+
url: z.ZodString;
|
|
5
221
|
subdomain: z.ZodString;
|
|
6
222
|
port: z.ZodNumber;
|
|
7
223
|
}, "strip", z.ZodTypeAny, {
|
|
8
224
|
port: number;
|
|
225
|
+
url: string;
|
|
9
226
|
subdomain: string;
|
|
10
227
|
}, {
|
|
11
228
|
port: number;
|
|
229
|
+
url: string;
|
|
12
230
|
subdomain: string;
|
|
13
231
|
}>, "many">;
|
|
14
232
|
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
|
|
233
|
+
sandbox: {
|
|
234
|
+
region: string;
|
|
235
|
+
timeout: number;
|
|
236
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
237
|
+
id: string;
|
|
238
|
+
memory: number;
|
|
239
|
+
vcpus: number;
|
|
240
|
+
runtime: string;
|
|
241
|
+
requestedAt: number;
|
|
242
|
+
createdAt: number;
|
|
243
|
+
updatedAt: number;
|
|
244
|
+
duration?: number | undefined;
|
|
245
|
+
startedAt?: number | undefined;
|
|
246
|
+
requestedStopAt?: number | undefined;
|
|
247
|
+
stoppedAt?: number | undefined;
|
|
248
|
+
};
|
|
16
249
|
routes: {
|
|
17
250
|
port: number;
|
|
251
|
+
url: string;
|
|
18
252
|
subdomain: string;
|
|
19
253
|
}[];
|
|
20
254
|
}, {
|
|
21
|
-
|
|
255
|
+
sandbox: {
|
|
256
|
+
region: string;
|
|
257
|
+
timeout: number;
|
|
258
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed";
|
|
259
|
+
id: string;
|
|
260
|
+
memory: number;
|
|
261
|
+
vcpus: number;
|
|
262
|
+
runtime: string;
|
|
263
|
+
requestedAt: number;
|
|
264
|
+
createdAt: number;
|
|
265
|
+
updatedAt: number;
|
|
266
|
+
duration?: number | undefined;
|
|
267
|
+
startedAt?: number | undefined;
|
|
268
|
+
requestedStopAt?: number | undefined;
|
|
269
|
+
stoppedAt?: number | undefined;
|
|
270
|
+
};
|
|
22
271
|
routes: {
|
|
23
272
|
port: number;
|
|
273
|
+
url: string;
|
|
24
274
|
subdomain: string;
|
|
25
275
|
}[];
|
|
26
276
|
}>;
|
|
27
|
-
export declare const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}>;
|
|
53
|
-
export declare const CommandFinished: z.ZodObject<{
|
|
54
|
-
args: z.ZodArray<z.ZodString, "many">;
|
|
55
|
-
cmdId: z.ZodString;
|
|
56
|
-
cwd: z.ZodString;
|
|
57
|
-
exitCode: z.ZodNumber;
|
|
58
|
-
name: z.ZodString;
|
|
277
|
+
export declare const CommandResponse: z.ZodObject<{
|
|
278
|
+
command: z.ZodObject<{
|
|
279
|
+
id: z.ZodString;
|
|
280
|
+
name: z.ZodString;
|
|
281
|
+
args: z.ZodArray<z.ZodString, "many">;
|
|
282
|
+
cwd: z.ZodString;
|
|
283
|
+
sandboxId: z.ZodString;
|
|
284
|
+
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
285
|
+
startedAt: z.ZodNumber;
|
|
286
|
+
}, "strip", z.ZodTypeAny, {
|
|
287
|
+
name: string;
|
|
288
|
+
cwd: string;
|
|
289
|
+
args: string[];
|
|
290
|
+
id: string;
|
|
291
|
+
startedAt: number;
|
|
292
|
+
sandboxId: string;
|
|
293
|
+
exitCode: number | null;
|
|
294
|
+
}, {
|
|
295
|
+
name: string;
|
|
296
|
+
cwd: string;
|
|
297
|
+
args: string[];
|
|
298
|
+
id: string;
|
|
299
|
+
startedAt: number;
|
|
300
|
+
sandboxId: string;
|
|
301
|
+
exitCode: number | null;
|
|
302
|
+
}>;
|
|
59
303
|
}, "strip", z.ZodTypeAny, {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
304
|
+
command: {
|
|
305
|
+
name: string;
|
|
306
|
+
cwd: string;
|
|
307
|
+
args: string[];
|
|
308
|
+
id: string;
|
|
309
|
+
startedAt: number;
|
|
310
|
+
sandboxId: string;
|
|
311
|
+
exitCode: number | null;
|
|
312
|
+
};
|
|
65
313
|
}, {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
314
|
+
command: {
|
|
315
|
+
name: string;
|
|
316
|
+
cwd: string;
|
|
317
|
+
args: string[];
|
|
318
|
+
id: string;
|
|
319
|
+
startedAt: number;
|
|
320
|
+
sandboxId: string;
|
|
321
|
+
exitCode: number | null;
|
|
322
|
+
};
|
|
71
323
|
}>;
|
|
72
|
-
export declare const
|
|
73
|
-
|
|
74
|
-
|
|
324
|
+
export declare const CommandFinishedResponse: z.ZodObject<{
|
|
325
|
+
command: z.ZodObject<{
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
name: z.ZodString;
|
|
328
|
+
args: z.ZodArray<z.ZodString, "many">;
|
|
329
|
+
cwd: z.ZodString;
|
|
330
|
+
sandboxId: z.ZodString;
|
|
331
|
+
startedAt: z.ZodNumber;
|
|
332
|
+
} & {
|
|
333
|
+
exitCode: z.ZodNumber;
|
|
334
|
+
}, "strip", z.ZodTypeAny, {
|
|
335
|
+
name: string;
|
|
336
|
+
cwd: string;
|
|
337
|
+
args: string[];
|
|
338
|
+
id: string;
|
|
339
|
+
startedAt: number;
|
|
340
|
+
sandboxId: string;
|
|
341
|
+
exitCode: number;
|
|
342
|
+
}, {
|
|
343
|
+
name: string;
|
|
344
|
+
cwd: string;
|
|
345
|
+
args: string[];
|
|
346
|
+
id: string;
|
|
347
|
+
startedAt: number;
|
|
348
|
+
sandboxId: string;
|
|
349
|
+
exitCode: number;
|
|
350
|
+
}>;
|
|
75
351
|
}, "strip", z.ZodTypeAny, {
|
|
76
|
-
|
|
352
|
+
command: {
|
|
353
|
+
name: string;
|
|
354
|
+
cwd: string;
|
|
355
|
+
args: string[];
|
|
356
|
+
id: string;
|
|
357
|
+
startedAt: number;
|
|
358
|
+
sandboxId: string;
|
|
359
|
+
exitCode: number;
|
|
360
|
+
};
|
|
77
361
|
}, {
|
|
78
|
-
|
|
362
|
+
command: {
|
|
363
|
+
name: string;
|
|
364
|
+
cwd: string;
|
|
365
|
+
args: string[];
|
|
366
|
+
id: string;
|
|
367
|
+
startedAt: number;
|
|
368
|
+
sandboxId: string;
|
|
369
|
+
exitCode: number;
|
|
370
|
+
};
|
|
79
371
|
}>;
|
|
372
|
+
export declare const EmptyResponse: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
80
373
|
export declare const LogLine: z.ZodObject<{
|
|
81
374
|
stream: z.ZodEnum<["stdout", "stderr"]>;
|
|
82
375
|
data: z.ZodString;
|