@voidrun/sdk 0.0.15 → 0.0.18
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 +115 -62
- package/dist/CodeInterpreter.d.ts +57 -0
- package/dist/CodeInterpreter.d.ts.map +1 -0
- package/dist/CodeInterpreter.js +231 -0
- package/dist/CodeInterpreter.js.map +1 -0
- package/dist/Commands.d.ts +62 -0
- package/dist/Commands.d.ts.map +1 -0
- package/dist/Commands.js +179 -0
- package/dist/Commands.js.map +1 -0
- package/dist/PtySession.d.ts +1 -1
- package/dist/PtySession.d.ts.map +1 -1
- package/dist/PtySession.js +7 -7
- package/dist/PtySession.js.map +1 -1
- package/dist/Sandbox.d.ts +12 -2
- package/dist/Sandbox.d.ts.map +1 -1
- package/dist/Sandbox.js +98 -2
- package/dist/Sandbox.js.map +1 -1
- package/dist/api-client/apis/AuthenticationApi.d.ts +2 -2
- package/dist/api-client/apis/AuthenticationApi.d.ts.map +1 -1
- package/dist/api-client/apis/AuthenticationApi.js +2 -2
- package/dist/api-client/apis/AuthenticationApi.js.map +1 -1
- package/dist/api-client/apis/ExecutionApi.d.ts +85 -2
- package/dist/api-client/apis/ExecutionApi.d.ts.map +1 -1
- package/dist/api-client/apis/ExecutionApi.js +223 -2
- package/dist/api-client/apis/ExecutionApi.js.map +1 -1
- package/dist/api-client/apis/FileSystemApi.d.ts +2 -2
- package/dist/api-client/apis/FileSystemApi.d.ts.map +1 -1
- package/dist/api-client/apis/FileSystemApi.js +2 -2
- package/dist/api-client/apis/FileSystemApi.js.map +1 -1
- package/dist/api-client/apis/ImagesApi.d.ts +2 -2
- package/dist/api-client/apis/ImagesApi.d.ts.map +1 -1
- package/dist/api-client/apis/ImagesApi.js +2 -2
- package/dist/api-client/apis/ImagesApi.js.map +1 -1
- package/dist/api-client/apis/OrganizationsApi.d.ts +2 -2
- package/dist/api-client/apis/OrganizationsApi.d.ts.map +1 -1
- package/dist/api-client/apis/OrganizationsApi.js +2 -2
- package/dist/api-client/apis/OrganizationsApi.js.map +1 -1
- package/dist/api-client/apis/SandboxesApi.d.ts +2 -2
- package/dist/api-client/apis/SandboxesApi.d.ts.map +1 -1
- package/dist/api-client/apis/SandboxesApi.js +2 -2
- package/dist/api-client/apis/SandboxesApi.js.map +1 -1
- package/dist/api-client/apis/index.d.ts +6 -6
- package/dist/api-client/apis/index.d.ts.map +1 -1
- package/dist/api-client/apis/index.js +6 -6
- package/dist/api-client/apis/index.js.map +1 -1
- package/dist/api-client/index.d.ts +3 -3
- package/dist/api-client/index.d.ts.map +1 -1
- package/dist/api-client/index.js +3 -3
- package/dist/api-client/index.js.map +1 -1
- package/dist/api-client/models/ApiResponseSandbox.d.ts +1 -1
- package/dist/api-client/models/ApiResponseSandbox.d.ts.map +1 -1
- package/dist/api-client/models/ApiResponseSandbox.js +1 -1
- package/dist/api-client/models/ApiResponseSandbox.js.map +1 -1
- package/dist/api-client/models/ApiResponseSandboxesList.d.ts +2 -2
- package/dist/api-client/models/ApiResponseSandboxesList.d.ts.map +1 -1
- package/dist/api-client/models/ApiResponseSandboxesList.js +2 -2
- package/dist/api-client/models/ApiResponseSandboxesList.js.map +1 -1
- package/dist/api-client/models/CommandKillResponse.d.ts +39 -0
- package/dist/api-client/models/CommandKillResponse.d.ts.map +1 -0
- package/dist/api-client/models/CommandKillResponse.js +44 -0
- package/dist/api-client/models/CommandKillResponse.js.map +1 -0
- package/dist/api-client/models/CommandListResponse.d.ts +40 -0
- package/dist/api-client/models/CommandListResponse.d.ts.map +1 -0
- package/dist/api-client/models/CommandListResponse.js +45 -0
- package/dist/api-client/models/CommandListResponse.js.map +1 -0
- package/dist/api-client/models/CommandRunResponse.d.ts +45 -0
- package/dist/api-client/models/CommandRunResponse.d.ts.map +1 -0
- package/dist/api-client/models/CommandRunResponse.js +46 -0
- package/dist/api-client/models/CommandRunResponse.js.map +1 -0
- package/dist/api-client/models/CommandWaitResponse.d.ts +45 -0
- package/dist/api-client/models/CommandWaitResponse.d.ts.map +1 -0
- package/dist/api-client/models/CommandWaitResponse.js +46 -0
- package/dist/api-client/models/CommandWaitResponse.js.map +1 -0
- package/dist/api-client/models/CreatePTYSession200Response.d.ts +1 -1
- package/dist/api-client/models/CreatePTYSession200Response.d.ts.map +1 -1
- package/dist/api-client/models/CreatePTYSession200Response.js +1 -1
- package/dist/api-client/models/CreatePTYSession200Response.js.map +1 -1
- package/dist/api-client/models/CreateSandbox201Response.d.ts +1 -1
- package/dist/api-client/models/CreateSandbox201Response.d.ts.map +1 -1
- package/dist/api-client/models/CreateSandbox201Response.js +1 -1
- package/dist/api-client/models/CreateSandbox201Response.js.map +1 -1
- package/dist/api-client/models/CreateSandboxRequest.d.ts +8 -0
- package/dist/api-client/models/CreateSandboxRequest.d.ts.map +1 -1
- package/dist/api-client/models/CreateSandboxRequest.js +2 -0
- package/dist/api-client/models/CreateSandboxRequest.js.map +1 -1
- package/dist/api-client/models/ExecRequest.d.ts +7 -1
- package/dist/api-client/models/ExecRequest.d.ts.map +1 -1
- package/dist/api-client/models/ExecRequest.js +2 -0
- package/dist/api-client/models/ExecRequest.js.map +1 -1
- package/dist/api-client/models/ExecResponse.d.ts +1 -1
- package/dist/api-client/models/ExecResponse.d.ts.map +1 -1
- package/dist/api-client/models/ExecResponse.js +1 -1
- package/dist/api-client/models/ExecResponse.js.map +1 -1
- package/dist/api-client/models/GetPTYBuffer200Response.d.ts +1 -1
- package/dist/api-client/models/GetPTYBuffer200Response.d.ts.map +1 -1
- package/dist/api-client/models/GetPTYBuffer200Response.js +1 -1
- package/dist/api-client/models/GetPTYBuffer200Response.js.map +1 -1
- package/dist/api-client/models/KillBackgroundProcessRequest.d.ts +33 -0
- package/dist/api-client/models/KillBackgroundProcessRequest.d.ts.map +1 -0
- package/dist/api-client/models/KillBackgroundProcessRequest.js +44 -0
- package/dist/api-client/models/KillBackgroundProcessRequest.js.map +1 -0
- package/dist/api-client/models/ListFiles200Response.d.ts +1 -1
- package/dist/api-client/models/ListFiles200Response.d.ts.map +1 -1
- package/dist/api-client/models/ListFiles200Response.js +1 -1
- package/dist/api-client/models/ListFiles200Response.js.map +1 -1
- package/dist/api-client/models/ListFiles200ResponseData.d.ts +1 -1
- package/dist/api-client/models/ListFiles200ResponseData.d.ts.map +1 -1
- package/dist/api-client/models/ListFiles200ResponseData.js +1 -1
- package/dist/api-client/models/ListFiles200ResponseData.js.map +1 -1
- package/dist/api-client/models/ListPTYSessions200Response.d.ts +1 -1
- package/dist/api-client/models/ListPTYSessions200Response.d.ts.map +1 -1
- package/dist/api-client/models/ListPTYSessions200Response.js +1 -1
- package/dist/api-client/models/ListPTYSessions200Response.js.map +1 -1
- package/dist/api-client/models/ListPTYSessions200ResponseAllOfData.d.ts +1 -1
- package/dist/api-client/models/ListPTYSessions200ResponseAllOfData.d.ts.map +1 -1
- package/dist/api-client/models/ListPTYSessions200ResponseAllOfData.js +1 -1
- package/dist/api-client/models/ListPTYSessions200ResponseAllOfData.js.map +1 -1
- package/dist/api-client/models/ProcessInfo.d.ts +57 -0
- package/dist/api-client/models/ProcessInfo.d.ts.map +1 -0
- package/dist/api-client/models/ProcessInfo.js +50 -0
- package/dist/api-client/models/ProcessInfo.js.map +1 -0
- package/dist/api-client/models/RegisterResponse.d.ts +1 -1
- package/dist/api-client/models/RegisterResponse.d.ts.map +1 -1
- package/dist/api-client/models/RegisterResponse.js +1 -1
- package/dist/api-client/models/RegisterResponse.js.map +1 -1
- package/dist/api-client/models/RunBackgroundCommandRequest.d.ts +53 -0
- package/dist/api-client/models/RunBackgroundCommandRequest.d.ts.map +1 -0
- package/dist/api-client/models/RunBackgroundCommandRequest.js +50 -0
- package/dist/api-client/models/RunBackgroundCommandRequest.js.map +1 -0
- package/dist/api-client/models/Sandbox.d.ts +8 -0
- package/dist/api-client/models/Sandbox.d.ts.map +1 -1
- package/dist/api-client/models/Sandbox.js +2 -0
- package/dist/api-client/models/Sandbox.js.map +1 -1
- package/dist/api-client/models/StartWatch200Response.d.ts +1 -1
- package/dist/api-client/models/StartWatch200Response.d.ts.map +1 -1
- package/dist/api-client/models/StartWatch200Response.js +1 -1
- package/dist/api-client/models/StartWatch200Response.js.map +1 -1
- package/dist/api-client/models/index.d.ts +51 -44
- package/dist/api-client/models/index.d.ts.map +1 -1
- package/dist/api-client/models/index.js +51 -44
- package/dist/api-client/models/index.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
package/dist/Sandbox.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ExecutionApi, SandboxesApi } from "./api-client/index.js";
|
|
2
2
|
import { FS } from "./FS.js";
|
|
3
3
|
import { PTY } from "./PTY.js";
|
|
4
|
+
import { CodeInterpreter } from "./CodeInterpreter.js";
|
|
5
|
+
import { Commands } from "./Commands.js";
|
|
4
6
|
import { wrapRequest } from "./utils/runtime.js";
|
|
5
7
|
export default class VRSandbox {
|
|
6
8
|
id;
|
|
@@ -11,8 +13,11 @@ export default class VRSandbox {
|
|
|
11
13
|
createdAt;
|
|
12
14
|
createdBy;
|
|
13
15
|
status;
|
|
16
|
+
envVars;
|
|
14
17
|
fs;
|
|
15
18
|
pty;
|
|
19
|
+
interpreter;
|
|
20
|
+
commands;
|
|
16
21
|
language;
|
|
17
22
|
config;
|
|
18
23
|
execApi;
|
|
@@ -50,9 +55,12 @@ export default class VRSandbox {
|
|
|
50
55
|
this.createdAt = sandbox.createdAt;
|
|
51
56
|
this.createdBy = sandbox.createdBy;
|
|
52
57
|
this.status = sandbox.status;
|
|
58
|
+
this.envVars = sandbox.envVars;
|
|
53
59
|
this.config = config;
|
|
54
60
|
this.fs = new FS(sandbox.id, config);
|
|
55
61
|
this.pty = new PTY(sandbox.id, config);
|
|
62
|
+
this.interpreter = new CodeInterpreter(sandbox.id, config);
|
|
63
|
+
this.commands = new Commands(sandbox.id, config);
|
|
56
64
|
this.execApi = new ExecutionApi(this.config);
|
|
57
65
|
this.sandboxesApi = new SandboxesApi(this.config);
|
|
58
66
|
}
|
|
@@ -64,12 +72,100 @@ export default class VRSandbox {
|
|
|
64
72
|
async info() {
|
|
65
73
|
return this;
|
|
66
74
|
}
|
|
67
|
-
async exec(execRequest) {
|
|
68
|
-
//
|
|
75
|
+
async exec(execRequest, handlers) {
|
|
76
|
+
// If streaming handlers are provided, use streaming mode
|
|
77
|
+
if (handlers?.onStdout || handlers?.onStderr || handlers?.onExit) {
|
|
78
|
+
return await this._execStream(execRequest, handlers);
|
|
79
|
+
}
|
|
80
|
+
// Otherwise, use regular synchronous execution
|
|
69
81
|
return await wrapRequest(this.execApi.execCommand({
|
|
70
82
|
id: this.id,
|
|
71
83
|
execRequest: execRequest
|
|
72
84
|
}));
|
|
73
85
|
}
|
|
86
|
+
async _execStream(execRequest, handlers = {}) {
|
|
87
|
+
const fetchApi = this.config.fetchApi ?? fetch;
|
|
88
|
+
const headers = {
|
|
89
|
+
'Content-Type': 'application/json',
|
|
90
|
+
'Accept': 'text/event-stream'
|
|
91
|
+
};
|
|
92
|
+
if (this.config.apiKey) {
|
|
93
|
+
headers['X-API-Key'] = await this.config.apiKey('X-API-Key');
|
|
94
|
+
}
|
|
95
|
+
const url = `${this.config.basePath}/sandboxes/${this.id}/exec-stream`;
|
|
96
|
+
const response = await fetchApi(url, {
|
|
97
|
+
method: 'POST',
|
|
98
|
+
headers,
|
|
99
|
+
body: JSON.stringify(execRequest),
|
|
100
|
+
signal: handlers.signal
|
|
101
|
+
});
|
|
102
|
+
if (!response.ok) {
|
|
103
|
+
const text = await response.text();
|
|
104
|
+
throw new Error(text || `Exec stream failed with status ${response.status}`);
|
|
105
|
+
}
|
|
106
|
+
if (!response.body) {
|
|
107
|
+
throw new Error('Exec stream response has no body');
|
|
108
|
+
}
|
|
109
|
+
const reader = response.body.getReader();
|
|
110
|
+
const decoder = new TextDecoder('utf-8');
|
|
111
|
+
let buffer = '';
|
|
112
|
+
const handleEvent = (event, data) => {
|
|
113
|
+
if (event === 'stdout') {
|
|
114
|
+
handlers.onStdout?.(data);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (event === 'stderr') {
|
|
118
|
+
handlers.onStderr?.(data);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (event === 'exit') {
|
|
122
|
+
try {
|
|
123
|
+
const parsed = JSON.parse(data);
|
|
124
|
+
handlers.onExit?.(parsed);
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
handlers.onError?.(err);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
try {
|
|
132
|
+
while (true) {
|
|
133
|
+
const { value, done } = await reader.read();
|
|
134
|
+
if (done) {
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
buffer += decoder.decode(value, { stream: true });
|
|
138
|
+
const parts = buffer.split('\n\n');
|
|
139
|
+
buffer = parts.pop() || '';
|
|
140
|
+
for (const part of parts) {
|
|
141
|
+
const lines = part.split('\n');
|
|
142
|
+
let event = 'message';
|
|
143
|
+
const dataLines = [];
|
|
144
|
+
for (const line of lines) {
|
|
145
|
+
if (line.startsWith('event:')) {
|
|
146
|
+
event = line.slice(6).trim();
|
|
147
|
+
}
|
|
148
|
+
else if (line.startsWith('data:')) {
|
|
149
|
+
dataLines.push(line.slice(5).trimEnd());
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const data = dataLines.join('\n');
|
|
153
|
+
if (data) {
|
|
154
|
+
handleEvent(event, data);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
handlers.onError?.(err);
|
|
161
|
+
throw err;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
async execStream(execRequest, handlers = {}) {
|
|
165
|
+
return this._execStream(execRequest, handlers);
|
|
166
|
+
}
|
|
167
|
+
async runCode(code, options) {
|
|
168
|
+
return this.interpreter.runCode(code, options);
|
|
169
|
+
}
|
|
74
170
|
}
|
|
75
171
|
//# sourceMappingURL=Sandbox.js.map
|
package/dist/Sandbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sandbox.js","sourceRoot":"","sources":["../src/Sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,YAAY,EAAW,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGxG,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,OAAO,OAAO,SAAS;IACV,EAAE,CAAS;IACX,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,GAAG,CAAS;IACZ,KAAK,CAAS;IACd,SAAS,CAAO;IAChB,SAAS,CAAS;IAClB,MAAM,CAAS;IACf,EAAE,CAAK;IACP,GAAG,CAAM;IACT,QAAQ,CAA6B;IAEpC,MAAM,CAAgB;IACtB,OAAO,CAAe;IACtB,YAAY,CAAe;IAG5C,YAAY,OAAgB,EAAE,MAAqB;QAC/C,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAChD,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAClD,CAAC;QACD,IAA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AK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;wBACjC,CAAC;6BAAM,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;4BAClC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;wBAC5C,CAAC;oBACL,CAAC;oBAED,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAClC,IAAI,IAAI,EAAE,CAAC;wBACP,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;oBAC7B,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAY,CAAC,CAAC;YACjC,MAAM,GAAG,CAAC;QACd,CAAC;IACL,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,WAAwB,EAAE,WAA+B,EAAE;QACxE,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,OAA8B;QACtD,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACJ"}
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import * as runtime from '../runtime
|
|
13
|
-
import type { RegisterRequest, RegisterResponse } from '../models/index
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { RegisterRequest, RegisterResponse } from '../models/index';
|
|
14
14
|
export interface RegisterOperationRequest {
|
|
15
15
|
registerRequest: RegisterRequest;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationApi.d.ts","sourceRoot":"","sources":["../../../src/api-client/apis/AuthenticationApi.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"AuthenticationApi.d.ts","sourceRoot":"","sources":["../../../src/api-client/apis/AuthenticationApi.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAEV,eAAe,EACf,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAUzB,MAAM,WAAW,wBAAwB;IACrC,eAAe,EAAE,eAAe,CAAC;CACpC;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,OAAO,CAAC,OAAO;IAElD;;;OAGG;IACG,WAAW,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IA4B1K;;;OAGG;IACG,QAAQ,CAAC,iBAAiB,EAAE,wBAAwB,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAKrJ"}
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* https://openapi-generator.tech
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
|
-
import * as runtime from '../runtime
|
|
15
|
-
import { RegisterRequestToJSON, RegisterResponseFromJSON, } from '../models/index
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { RegisterRequestToJSON, RegisterResponseFromJSON, } from '../models/index';
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationApi.js","sourceRoot":"","sources":["../../../src/api-client/apis/AuthenticationApi.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"AuthenticationApi.js","sourceRoot":"","sources":["../../../src/api-client/apis/AuthenticationApi.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AAMtC,OAAO,EAIH,qBAAqB,EACrB,wBAAwB,GAE3B,MAAM,iBAAiB,CAAC;AAMzB;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,OAAO,CAAC,OAAO;IAElD;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,iBAA2C,EAAE,aAA0D;QACrH,IAAI,iBAAiB,CAAC,iBAAiB,CAAC,IAAI,IAAI,EAAE,CAAC;YAC/C,MAAM,IAAI,OAAO,CAAC,aAAa,CAC3B,iBAAiB,EACjB,qFAAqF,CACxF,CAAC;QACN,CAAC;QAED,MAAM,eAAe,GAAQ,EAAE,CAAC;QAEhC,MAAM,gBAAgB,GAAwB,EAAE,CAAC;QAEjD,gBAAgB,CAAC,cAAc,CAAC,GAAG,kBAAkB,CAAC;QAGtD,IAAI,OAAO,GAAG,WAAW,CAAC;QAE1B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;YAChC,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,gBAAgB;YACzB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,qBAAqB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;SACpE,EAAE,aAAa,CAAC,CAAC;QAElB,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,CAAC;IACrG,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,iBAA2C,EAAE,aAA0D;QAClH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;QAC1E,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CAEJ"}
|
|
@@ -9,8 +9,12 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import * as runtime from '../runtime
|
|
13
|
-
import type { CreatePTYSession200Response, CreatePTYSessionRequest, ExecRequest, ExecResponse, ExecuteInSessionRequest, GetPTYBuffer200Response, ListPTYSessions200Response, ResizeTerminalRequest, SuccessResponse } from '../models/index
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { CommandKillResponse, CommandListResponse, CommandRunResponse, CommandWaitResponse, CreatePTYSession200Response, CreatePTYSessionRequest, ExecRequest, ExecResponse, ExecuteInSessionRequest, GetPTYBuffer200Response, KillBackgroundProcessRequest, ListPTYSessions200Response, ResizeTerminalRequest, RunBackgroundCommandRequest, SuccessResponse } from '../models/index';
|
|
14
|
+
export interface AttachToBackgroundProcessRequest {
|
|
15
|
+
id: string;
|
|
16
|
+
killBackgroundProcessRequest: KillBackgroundProcessRequest;
|
|
17
|
+
}
|
|
14
18
|
export interface ConnectPTYRequest {
|
|
15
19
|
id: string;
|
|
16
20
|
}
|
|
@@ -30,6 +34,10 @@ export interface ExecCommandRequest {
|
|
|
30
34
|
id: string;
|
|
31
35
|
execRequest: ExecRequest;
|
|
32
36
|
}
|
|
37
|
+
export interface ExecCommandStreamRequest {
|
|
38
|
+
id: string;
|
|
39
|
+
execRequest: ExecRequest;
|
|
40
|
+
}
|
|
33
41
|
export interface ExecuteInPTYSessionRequest {
|
|
34
42
|
id: string;
|
|
35
43
|
sessionId: string;
|
|
@@ -39,6 +47,13 @@ export interface GetPTYBufferRequest {
|
|
|
39
47
|
id: string;
|
|
40
48
|
sessionId: string;
|
|
41
49
|
}
|
|
50
|
+
export interface KillBackgroundProcessOperationRequest {
|
|
51
|
+
id: string;
|
|
52
|
+
killBackgroundProcessRequest: KillBackgroundProcessRequest;
|
|
53
|
+
}
|
|
54
|
+
export interface ListBackgroundProcessesRequest {
|
|
55
|
+
id: string;
|
|
56
|
+
}
|
|
42
57
|
export interface ListPTYSessionsRequest {
|
|
43
58
|
id: string;
|
|
44
59
|
}
|
|
@@ -47,10 +62,28 @@ export interface ResizeTerminalOperationRequest {
|
|
|
47
62
|
sessionId: string;
|
|
48
63
|
resizeTerminalRequest: ResizeTerminalRequest;
|
|
49
64
|
}
|
|
65
|
+
export interface RunBackgroundCommandOperationRequest {
|
|
66
|
+
id: string;
|
|
67
|
+
runBackgroundCommandRequest: RunBackgroundCommandRequest;
|
|
68
|
+
}
|
|
69
|
+
export interface WaitForBackgroundProcessRequest {
|
|
70
|
+
id: string;
|
|
71
|
+
killBackgroundProcessRequest: KillBackgroundProcessRequest;
|
|
72
|
+
}
|
|
50
73
|
/**
|
|
51
74
|
*
|
|
52
75
|
*/
|
|
53
76
|
export declare class ExecutionApi extends runtime.BaseAPI {
|
|
77
|
+
/**
|
|
78
|
+
* Connect to a background process and stream its output as Server-Sent Events. Events: `stdout`, `stderr`, `exit`, `error`.
|
|
79
|
+
* Attach to process output (SSE stream)
|
|
80
|
+
*/
|
|
81
|
+
attachToBackgroundProcessRaw(requestParameters: AttachToBackgroundProcessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
82
|
+
/**
|
|
83
|
+
* Connect to a background process and stream its output as Server-Sent Events. Events: `stdout`, `stderr`, `exit`, `error`.
|
|
84
|
+
* Attach to process output (SSE stream)
|
|
85
|
+
*/
|
|
86
|
+
attachToBackgroundProcess(requestParameters: AttachToBackgroundProcessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
54
87
|
/**
|
|
55
88
|
* Establish a WebSocket connection for temporary terminal access. The WebSocket URL format is: `ws://host/api/sandboxes/{id}/pty`
|
|
56
89
|
* Connect to ephemeral PTY (WebSocket)
|
|
@@ -101,6 +134,16 @@ export declare class ExecutionApi extends runtime.BaseAPI {
|
|
|
101
134
|
* Execute command (synchronous)
|
|
102
135
|
*/
|
|
103
136
|
execCommand(requestParameters: ExecCommandRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ExecResponse>;
|
|
137
|
+
/**
|
|
138
|
+
* Execute a command and stream output as Server-Sent Events. Events: `stdout`, `stderr`, and final `exit`.
|
|
139
|
+
* Execute command (SSE stream)
|
|
140
|
+
*/
|
|
141
|
+
execCommandStreamRaw(requestParameters: ExecCommandStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
|
|
142
|
+
/**
|
|
143
|
+
* Execute a command and stream output as Server-Sent Events. Events: `stdout`, `stderr`, and final `exit`.
|
|
144
|
+
* Execute command (SSE stream)
|
|
145
|
+
*/
|
|
146
|
+
execCommandStream(requestParameters: ExecCommandStreamRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
|
|
104
147
|
/**
|
|
105
148
|
* Execute a command asynchronously in an existing PTY session
|
|
106
149
|
* Execute command in PTY session
|
|
@@ -121,6 +164,26 @@ export declare class ExecutionApi extends runtime.BaseAPI {
|
|
|
121
164
|
* Get output buffer
|
|
122
165
|
*/
|
|
123
166
|
getPTYBuffer(requestParameters: GetPTYBufferRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetPTYBuffer200Response>;
|
|
167
|
+
/**
|
|
168
|
+
* Terminate a running background process by PID
|
|
169
|
+
* Kill background process
|
|
170
|
+
*/
|
|
171
|
+
killBackgroundProcessRaw(requestParameters: KillBackgroundProcessOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommandKillResponse>>;
|
|
172
|
+
/**
|
|
173
|
+
* Terminate a running background process by PID
|
|
174
|
+
* Kill background process
|
|
175
|
+
*/
|
|
176
|
+
killBackgroundProcess(requestParameters: KillBackgroundProcessOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommandKillResponse>;
|
|
177
|
+
/**
|
|
178
|
+
* Get list of all running background processes in the sandbox
|
|
179
|
+
* List running processes
|
|
180
|
+
*/
|
|
181
|
+
listBackgroundProcessesRaw(requestParameters: ListBackgroundProcessesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommandListResponse>>;
|
|
182
|
+
/**
|
|
183
|
+
* Get list of all running background processes in the sandbox
|
|
184
|
+
* List running processes
|
|
185
|
+
*/
|
|
186
|
+
listBackgroundProcesses(requestParameters: ListBackgroundProcessesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommandListResponse>;
|
|
124
187
|
/**
|
|
125
188
|
* Get all active PTY sessions for a sandbox
|
|
126
189
|
* List PTY sessions
|
|
@@ -141,5 +204,25 @@ export declare class ExecutionApi extends runtime.BaseAPI {
|
|
|
141
204
|
* Resize terminal
|
|
142
205
|
*/
|
|
143
206
|
resizeTerminal(requestParameters: ResizeTerminalOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResponse>;
|
|
207
|
+
/**
|
|
208
|
+
* Start a command as a background process and return its PID
|
|
209
|
+
* Start background process
|
|
210
|
+
*/
|
|
211
|
+
runBackgroundCommandRaw(requestParameters: RunBackgroundCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommandRunResponse>>;
|
|
212
|
+
/**
|
|
213
|
+
* Start a command as a background process and return its PID
|
|
214
|
+
* Start background process
|
|
215
|
+
*/
|
|
216
|
+
runBackgroundCommand(requestParameters: RunBackgroundCommandOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommandRunResponse>;
|
|
217
|
+
/**
|
|
218
|
+
* Block until a background process completes and return its exit code
|
|
219
|
+
* Wait for process completion
|
|
220
|
+
*/
|
|
221
|
+
waitForBackgroundProcessRaw(requestParameters: WaitForBackgroundProcessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommandWaitResponse>>;
|
|
222
|
+
/**
|
|
223
|
+
* Block until a background process completes and return its exit code
|
|
224
|
+
* Wait for process completion
|
|
225
|
+
*/
|
|
226
|
+
waitForBackgroundProcess(requestParameters: WaitForBackgroundProcessRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommandWaitResponse>;
|
|
144
227
|
}
|
|
145
228
|
//# sourceMappingURL=ExecutionApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionApi.d.ts","sourceRoot":"","sources":["../../../src/api-client/apis/ExecutionApi.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"ExecutionApi.d.ts","sourceRoot":"","sources":["../../../src/api-client/apis/ExecutionApi.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EAEvB,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAoCzB,MAAM,WAAW,gCAAgC;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B,EAAE,4BAA4B,CAAC;CAC9D;AAED,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAwB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAA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sB,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAKjK;;;OAGG;IACG,iBAAiB,CAAC,iBAAiB,EAAE,8BAA8B,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAgDrL;;;OAGG;IACG,cAAc,CAAC,iBAAiB,EAAE,8BAA8B,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAK7J;;;OAGG;IACG,uBAAuB,CAAC,iBAAiB,EAAE,oCAAoC,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAwCpM;;;OAGG;IACG,oBAAoB,CAAC,iBAAiB,EAAE,oCAAoC,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAK5K;;;OAGG;IACG,2BAA2B,CAAC,iBAAiB,EAAE,+BAA+B,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAwCpM;;;OAGG;IACG,wBAAwB,CAAC,iBAAiB,EAAE,+BAA+B,EAAE,aAAa,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAK/K"}
|
|
@@ -11,12 +11,53 @@
|
|
|
11
11
|
* https://openapi-generator.tech
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
|
-
import * as runtime from '../runtime
|
|
15
|
-
import { CreatePTYSession200ResponseFromJSON, CreatePTYSessionRequestToJSON, ExecRequestToJSON, ExecResponseFromJSON, ExecuteInSessionRequestToJSON, GetPTYBuffer200ResponseFromJSON, ListPTYSessions200ResponseFromJSON, ResizeTerminalRequestToJSON, SuccessResponseFromJSON, } from '../models/index
|
|
14
|
+
import * as runtime from '../runtime';
|
|
15
|
+
import { CommandKillResponseFromJSON, CommandListResponseFromJSON, CommandRunResponseFromJSON, CommandWaitResponseFromJSON, CreatePTYSession200ResponseFromJSON, CreatePTYSessionRequestToJSON, ExecRequestToJSON, ExecResponseFromJSON, ExecuteInSessionRequestToJSON, GetPTYBuffer200ResponseFromJSON, KillBackgroundProcessRequestToJSON, ListPTYSessions200ResponseFromJSON, ResizeTerminalRequestToJSON, RunBackgroundCommandRequestToJSON, SuccessResponseFromJSON, } from '../models/index';
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
export class ExecutionApi extends runtime.BaseAPI {
|
|
20
|
+
/**
|
|
21
|
+
* Connect to a background process and stream its output as Server-Sent Events. Events: `stdout`, `stderr`, `exit`, `error`.
|
|
22
|
+
* Attach to process output (SSE stream)
|
|
23
|
+
*/
|
|
24
|
+
async attachToBackgroundProcessRaw(requestParameters, initOverrides) {
|
|
25
|
+
if (requestParameters['id'] == null) {
|
|
26
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling attachToBackgroundProcess().');
|
|
27
|
+
}
|
|
28
|
+
if (requestParameters['killBackgroundProcessRequest'] == null) {
|
|
29
|
+
throw new runtime.RequiredError('killBackgroundProcessRequest', 'Required parameter "killBackgroundProcessRequest" was null or undefined when calling attachToBackgroundProcess().');
|
|
30
|
+
}
|
|
31
|
+
const queryParameters = {};
|
|
32
|
+
const headerParameters = {};
|
|
33
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
34
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
35
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
36
|
+
}
|
|
37
|
+
let urlPath = `/sandboxes/{id}/commands/attach`;
|
|
38
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
39
|
+
const response = await this.request({
|
|
40
|
+
path: urlPath,
|
|
41
|
+
method: 'POST',
|
|
42
|
+
headers: headerParameters,
|
|
43
|
+
query: queryParameters,
|
|
44
|
+
body: KillBackgroundProcessRequestToJSON(requestParameters['killBackgroundProcessRequest']),
|
|
45
|
+
}, initOverrides);
|
|
46
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
47
|
+
return new runtime.JSONApiResponse(response);
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return new runtime.TextApiResponse(response);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Connect to a background process and stream its output as Server-Sent Events. Events: `stdout`, `stderr`, `exit`, `error`.
|
|
55
|
+
* Attach to process output (SSE stream)
|
|
56
|
+
*/
|
|
57
|
+
async attachToBackgroundProcess(requestParameters, initOverrides) {
|
|
58
|
+
const response = await this.attachToBackgroundProcessRaw(requestParameters, initOverrides);
|
|
59
|
+
return await response.value();
|
|
60
|
+
}
|
|
20
61
|
/**
|
|
21
62
|
* Establish a WebSocket connection for temporary terminal access. The WebSocket URL format is: `ws://host/api/sandboxes/{id}/pty`
|
|
22
63
|
* Connect to ephemeral PTY (WebSocket)
|
|
@@ -185,6 +226,47 @@ export class ExecutionApi extends runtime.BaseAPI {
|
|
|
185
226
|
const response = await this.execCommandRaw(requestParameters, initOverrides);
|
|
186
227
|
return await response.value();
|
|
187
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Execute a command and stream output as Server-Sent Events. Events: `stdout`, `stderr`, and final `exit`.
|
|
231
|
+
* Execute command (SSE stream)
|
|
232
|
+
*/
|
|
233
|
+
async execCommandStreamRaw(requestParameters, initOverrides) {
|
|
234
|
+
if (requestParameters['id'] == null) {
|
|
235
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling execCommandStream().');
|
|
236
|
+
}
|
|
237
|
+
if (requestParameters['execRequest'] == null) {
|
|
238
|
+
throw new runtime.RequiredError('execRequest', 'Required parameter "execRequest" was null or undefined when calling execCommandStream().');
|
|
239
|
+
}
|
|
240
|
+
const queryParameters = {};
|
|
241
|
+
const headerParameters = {};
|
|
242
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
243
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
244
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
245
|
+
}
|
|
246
|
+
let urlPath = `/sandboxes/{id}/exec-stream`;
|
|
247
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
248
|
+
const response = await this.request({
|
|
249
|
+
path: urlPath,
|
|
250
|
+
method: 'POST',
|
|
251
|
+
headers: headerParameters,
|
|
252
|
+
query: queryParameters,
|
|
253
|
+
body: ExecRequestToJSON(requestParameters['execRequest']),
|
|
254
|
+
}, initOverrides);
|
|
255
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
256
|
+
return new runtime.JSONApiResponse(response);
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
return new runtime.TextApiResponse(response);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Execute a command and stream output as Server-Sent Events. Events: `stdout`, `stderr`, and final `exit`.
|
|
264
|
+
* Execute command (SSE stream)
|
|
265
|
+
*/
|
|
266
|
+
async execCommandStream(requestParameters, initOverrides) {
|
|
267
|
+
const response = await this.execCommandStreamRaw(requestParameters, initOverrides);
|
|
268
|
+
return await response.value();
|
|
269
|
+
}
|
|
188
270
|
/**
|
|
189
271
|
* Execute a command asynchronously in an existing PTY session
|
|
190
272
|
* Execute command in PTY session
|
|
@@ -260,6 +342,73 @@ export class ExecutionApi extends runtime.BaseAPI {
|
|
|
260
342
|
const response = await this.getPTYBufferRaw(requestParameters, initOverrides);
|
|
261
343
|
return await response.value();
|
|
262
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Terminate a running background process by PID
|
|
347
|
+
* Kill background process
|
|
348
|
+
*/
|
|
349
|
+
async killBackgroundProcessRaw(requestParameters, initOverrides) {
|
|
350
|
+
if (requestParameters['id'] == null) {
|
|
351
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling killBackgroundProcess().');
|
|
352
|
+
}
|
|
353
|
+
if (requestParameters['killBackgroundProcessRequest'] == null) {
|
|
354
|
+
throw new runtime.RequiredError('killBackgroundProcessRequest', 'Required parameter "killBackgroundProcessRequest" was null or undefined when calling killBackgroundProcess().');
|
|
355
|
+
}
|
|
356
|
+
const queryParameters = {};
|
|
357
|
+
const headerParameters = {};
|
|
358
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
359
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
360
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
361
|
+
}
|
|
362
|
+
let urlPath = `/sandboxes/{id}/commands/kill`;
|
|
363
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
364
|
+
const response = await this.request({
|
|
365
|
+
path: urlPath,
|
|
366
|
+
method: 'POST',
|
|
367
|
+
headers: headerParameters,
|
|
368
|
+
query: queryParameters,
|
|
369
|
+
body: KillBackgroundProcessRequestToJSON(requestParameters['killBackgroundProcessRequest']),
|
|
370
|
+
}, initOverrides);
|
|
371
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CommandKillResponseFromJSON(jsonValue));
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Terminate a running background process by PID
|
|
375
|
+
* Kill background process
|
|
376
|
+
*/
|
|
377
|
+
async killBackgroundProcess(requestParameters, initOverrides) {
|
|
378
|
+
const response = await this.killBackgroundProcessRaw(requestParameters, initOverrides);
|
|
379
|
+
return await response.value();
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Get list of all running background processes in the sandbox
|
|
383
|
+
* List running processes
|
|
384
|
+
*/
|
|
385
|
+
async listBackgroundProcessesRaw(requestParameters, initOverrides) {
|
|
386
|
+
if (requestParameters['id'] == null) {
|
|
387
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling listBackgroundProcesses().');
|
|
388
|
+
}
|
|
389
|
+
const queryParameters = {};
|
|
390
|
+
const headerParameters = {};
|
|
391
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
392
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
393
|
+
}
|
|
394
|
+
let urlPath = `/sandboxes/{id}/commands/list`;
|
|
395
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
396
|
+
const response = await this.request({
|
|
397
|
+
path: urlPath,
|
|
398
|
+
method: 'GET',
|
|
399
|
+
headers: headerParameters,
|
|
400
|
+
query: queryParameters,
|
|
401
|
+
}, initOverrides);
|
|
402
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CommandListResponseFromJSON(jsonValue));
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Get list of all running background processes in the sandbox
|
|
406
|
+
* List running processes
|
|
407
|
+
*/
|
|
408
|
+
async listBackgroundProcesses(requestParameters, initOverrides) {
|
|
409
|
+
const response = await this.listBackgroundProcessesRaw(requestParameters, initOverrides);
|
|
410
|
+
return await response.value();
|
|
411
|
+
}
|
|
263
412
|
/**
|
|
264
413
|
* Get all active PTY sessions for a sandbox
|
|
265
414
|
* List PTY sessions
|
|
@@ -331,5 +480,77 @@ export class ExecutionApi extends runtime.BaseAPI {
|
|
|
331
480
|
const response = await this.resizeTerminalRaw(requestParameters, initOverrides);
|
|
332
481
|
return await response.value();
|
|
333
482
|
}
|
|
483
|
+
/**
|
|
484
|
+
* Start a command as a background process and return its PID
|
|
485
|
+
* Start background process
|
|
486
|
+
*/
|
|
487
|
+
async runBackgroundCommandRaw(requestParameters, initOverrides) {
|
|
488
|
+
if (requestParameters['id'] == null) {
|
|
489
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling runBackgroundCommand().');
|
|
490
|
+
}
|
|
491
|
+
if (requestParameters['runBackgroundCommandRequest'] == null) {
|
|
492
|
+
throw new runtime.RequiredError('runBackgroundCommandRequest', 'Required parameter "runBackgroundCommandRequest" was null or undefined when calling runBackgroundCommand().');
|
|
493
|
+
}
|
|
494
|
+
const queryParameters = {};
|
|
495
|
+
const headerParameters = {};
|
|
496
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
497
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
498
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
499
|
+
}
|
|
500
|
+
let urlPath = `/sandboxes/{id}/commands/run`;
|
|
501
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
502
|
+
const response = await this.request({
|
|
503
|
+
path: urlPath,
|
|
504
|
+
method: 'POST',
|
|
505
|
+
headers: headerParameters,
|
|
506
|
+
query: queryParameters,
|
|
507
|
+
body: RunBackgroundCommandRequestToJSON(requestParameters['runBackgroundCommandRequest']),
|
|
508
|
+
}, initOverrides);
|
|
509
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CommandRunResponseFromJSON(jsonValue));
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Start a command as a background process and return its PID
|
|
513
|
+
* Start background process
|
|
514
|
+
*/
|
|
515
|
+
async runBackgroundCommand(requestParameters, initOverrides) {
|
|
516
|
+
const response = await this.runBackgroundCommandRaw(requestParameters, initOverrides);
|
|
517
|
+
return await response.value();
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Block until a background process completes and return its exit code
|
|
521
|
+
* Wait for process completion
|
|
522
|
+
*/
|
|
523
|
+
async waitForBackgroundProcessRaw(requestParameters, initOverrides) {
|
|
524
|
+
if (requestParameters['id'] == null) {
|
|
525
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling waitForBackgroundProcess().');
|
|
526
|
+
}
|
|
527
|
+
if (requestParameters['killBackgroundProcessRequest'] == null) {
|
|
528
|
+
throw new runtime.RequiredError('killBackgroundProcessRequest', 'Required parameter "killBackgroundProcessRequest" was null or undefined when calling waitForBackgroundProcess().');
|
|
529
|
+
}
|
|
530
|
+
const queryParameters = {};
|
|
531
|
+
const headerParameters = {};
|
|
532
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
533
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
534
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
535
|
+
}
|
|
536
|
+
let urlPath = `/sandboxes/{id}/commands/wait`;
|
|
537
|
+
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
538
|
+
const response = await this.request({
|
|
539
|
+
path: urlPath,
|
|
540
|
+
method: 'POST',
|
|
541
|
+
headers: headerParameters,
|
|
542
|
+
query: queryParameters,
|
|
543
|
+
body: KillBackgroundProcessRequestToJSON(requestParameters['killBackgroundProcessRequest']),
|
|
544
|
+
}, initOverrides);
|
|
545
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CommandWaitResponseFromJSON(jsonValue));
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Block until a background process completes and return its exit code
|
|
549
|
+
* Wait for process completion
|
|
550
|
+
*/
|
|
551
|
+
async waitForBackgroundProcess(requestParameters, initOverrides) {
|
|
552
|
+
const response = await this.waitForBackgroundProcessRaw(requestParameters, initOverrides);
|
|
553
|
+
return await response.value();
|
|
554
|
+
}
|
|
334
555
|
}
|
|
335
556
|
//# sourceMappingURL=ExecutionApi.js.map
|