@blaxel/core 0.2.57-dev.31 → 0.2.57-preview.30
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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/client/sdk.gen.js +36 -2
- package/dist/cjs/common/settings.js +2 -2
- package/dist/cjs/sandbox/client/sdk.gen.js +1 -1
- package/dist/cjs/sandbox/process/process.js +28 -135
- package/dist/cjs/types/client/sdk.gen.d.ts +11 -1
- package/dist/cjs/types/client/types.gen.d.ts +48 -0
- package/dist/cjs/types/sandbox/client/sdk.gen.d.ts +1 -1
- package/dist/cjs/types/sandbox/client/types.gen.d.ts +0 -2
- package/dist/cjs/types/sandbox/process/process.d.ts +0 -1
- package/dist/cjs/types/sandbox/types.d.ts +0 -2
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/client/sdk.gen.js +36 -2
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/cjs-browser/sandbox/client/sdk.gen.js +1 -1
- package/dist/cjs-browser/sandbox/process/process.js +28 -135
- package/dist/cjs-browser/types/client/sdk.gen.d.ts +11 -1
- package/dist/cjs-browser/types/client/types.gen.d.ts +48 -0
- package/dist/cjs-browser/types/sandbox/client/sdk.gen.d.ts +1 -1
- package/dist/cjs-browser/types/sandbox/client/types.gen.d.ts +0 -2
- package/dist/cjs-browser/types/sandbox/process/process.d.ts +0 -1
- package/dist/cjs-browser/types/sandbox/types.d.ts +0 -2
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/client/sdk.gen.js +32 -0
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm/sandbox/client/sdk.gen.js +1 -1
- package/dist/esm/sandbox/process/process.js +28 -135
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/client/sdk.gen.js +32 -0
- package/dist/esm-browser/common/settings.js +2 -2
- package/dist/esm-browser/sandbox/client/sdk.gen.js +1 -1
- package/dist/esm-browser/sandbox/process/process.js +28 -135
- package/package.json +1 -2
- package/dist/cjs/common/version.js +0 -6
- package/dist/cjs/types/common/version.d.ts +0 -2
- package/dist/cjs-browser/common/version.js +0 -6
- package/dist/cjs-browser/types/common/version.d.ts +0 -2
- package/dist/esm/common/version.js +0 -3
- package/dist/esm-browser/common/version.js +0 -3
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.updateModel = exports.getModel = exports.deleteModel = exports.createModel = exports.listModels = exports.listMcpHubDefinitions = exports.listLocations = exports.listJobRevisions = exports.getJobExecution = exports.deleteJobExecution = exports.createJobExecution = exports.listJobExecutions = exports.updateJob = exports.getJob = exports.deleteJob = exports.createJob = exports.listJobs = exports.getIntegrationConnectionModel = exports.listIntegrationConnectionModels = exports.getIntegrationConnectionModelEndpointConfigurations = exports.updateIntegrationConnection = exports.getIntegrationConnection = exports.deleteIntegrationConnection = exports.createIntegrationConnection = exports.listIntegrationConnections = exports.getIntegration = exports.deleteImageTag = exports.getImage = exports.deleteImage = exports.listImages = exports.cleanupImages = exports.listFunctionRevisions = exports.updateFunction = exports.getFunction = exports.deleteFunction = exports.createFunction = exports.listFunctions = exports.verifyCustomDomain = exports.updateCustomDomain = exports.getCustomDomain = exports.deleteCustomDomain = exports.createCustomDomain = exports.listCustomDomains = exports.getConfiguration = exports.listAgentRevisions = exports.updateAgent = exports.getAgent = exports.deleteAgent = exports.createAgent = exports.listAgents = void 0;
|
|
5
|
-
exports.
|
|
6
|
-
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = void 0;
|
|
5
|
+
exports.deleteWorkspace = exports.createWorkspace = exports.listWorkspaces = exports.getVolume = exports.deleteVolume = exports.createVolume = exports.listVolumes = exports.deleteVolumeTemplateVersion = exports.updateVolumeTemplate = exports.getVolumeTemplate = exports.deleteVolumeTemplate = exports.createVolumeTemplate = exports.listVolumeTemplates = exports.updateWorkspaceUserRole = exports.removeWorkspaceUser = exports.inviteWorkspaceUser = exports.listWorkspaceUsers = exports.getTemplate = exports.listTemplates = exports.deleteApiKeyForServiceAccount = exports.createApiKeyForServiceAccount = exports.listApiKeysForServiceAccount = exports.updateWorkspaceServiceAccount = exports.deleteWorkspaceServiceAccount = exports.createWorkspaceServiceAccount = exports.getWorkspaceServiceAccounts = exports.stopSandbox = exports.startSandbox = exports.deleteSandboxPreviewToken = exports.createSandboxPreviewToken = exports.listSandboxPreviewTokens = exports.updateSandboxPreview = exports.getSandboxPreview = exports.deleteSandboxPreview = exports.createSandboxPreview = exports.listSandboxPreviews = exports.updateSandbox = exports.getSandbox = exports.deleteSandbox = exports.createSandbox = exports.listSandboxes = exports.listSandboxHubDefinitions = exports.listPublicIps = exports.listAllPendingInvitations = exports.updatePolicy = exports.getPolicy = exports.deletePolicy = exports.createPolicy = exports.listPolicies = exports.listModelRevisions = void 0;
|
|
6
|
+
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = exports.updateWorkspace = exports.getWorkspace = void 0;
|
|
7
7
|
const client_gen_1 = require("./client.gen");
|
|
8
8
|
/**
|
|
9
9
|
* List all agents
|
|
@@ -1283,6 +1283,40 @@ const deleteSandboxPreviewToken = (options) => {
|
|
|
1283
1283
|
});
|
|
1284
1284
|
};
|
|
1285
1285
|
exports.deleteSandboxPreviewToken = deleteSandboxPreviewToken;
|
|
1286
|
+
/**
|
|
1287
|
+
* Start Sandbox
|
|
1288
|
+
* Starts a Sandbox by name.
|
|
1289
|
+
*/
|
|
1290
|
+
const startSandbox = (options) => {
|
|
1291
|
+
return (options.client ?? client_gen_1.client).put({
|
|
1292
|
+
security: [
|
|
1293
|
+
{
|
|
1294
|
+
scheme: 'bearer',
|
|
1295
|
+
type: 'http'
|
|
1296
|
+
}
|
|
1297
|
+
],
|
|
1298
|
+
url: '/sandboxes/{sandboxName}/start',
|
|
1299
|
+
...options
|
|
1300
|
+
});
|
|
1301
|
+
};
|
|
1302
|
+
exports.startSandbox = startSandbox;
|
|
1303
|
+
/**
|
|
1304
|
+
* Stop Sandbox
|
|
1305
|
+
* Stops a Sandbox by name.
|
|
1306
|
+
*/
|
|
1307
|
+
const stopSandbox = (options) => {
|
|
1308
|
+
return (options.client ?? client_gen_1.client).put({
|
|
1309
|
+
security: [
|
|
1310
|
+
{
|
|
1311
|
+
scheme: 'bearer',
|
|
1312
|
+
type: 'http'
|
|
1313
|
+
}
|
|
1314
|
+
],
|
|
1315
|
+
url: '/sandboxes/{sandboxName}/stop',
|
|
1316
|
+
...options
|
|
1317
|
+
});
|
|
1318
|
+
};
|
|
1319
|
+
exports.stopSandbox = stopSandbox;
|
|
1286
1320
|
/**
|
|
1287
1321
|
* Get workspace service accounts
|
|
1288
1322
|
* Returns a list of all service accounts in the workspace.
|
|
@@ -9,8 +9,8 @@ const index_js_1 = require("../authentication/index.js");
|
|
|
9
9
|
const env_js_1 = require("../common/env.js");
|
|
10
10
|
const node_js_1 = require("../common/node.js");
|
|
11
11
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
12
|
-
const BUILD_VERSION = "0.2.57-
|
|
13
|
-
const BUILD_COMMIT = "
|
|
12
|
+
const BUILD_VERSION = "0.2.57-preview.30";
|
|
13
|
+
const BUILD_COMMIT = "56d2203f7145b774778210b79f0641b8e3a5e175";
|
|
14
14
|
const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
|
|
15
15
|
// Cache for config.yaml tracking value
|
|
16
16
|
let configTrackingValue = null;
|
|
@@ -525,7 +525,7 @@ const getProcess = (options) => {
|
|
|
525
525
|
exports.getProcess = getProcess;
|
|
526
526
|
/**
|
|
527
527
|
* Execute a command
|
|
528
|
-
* Execute a command and return process information
|
|
528
|
+
* Execute a command and return process information
|
|
529
529
|
*/
|
|
530
530
|
const postProcess = (options) => {
|
|
531
531
|
return (options.client ?? client_gen_1.client).post({
|
|
@@ -77,36 +77,41 @@ class SandboxProcess extends action_js_1.SandboxAction {
|
|
|
77
77
|
}
|
|
78
78
|
async exec(process) {
|
|
79
79
|
let onLog;
|
|
80
|
-
let onStdout;
|
|
81
|
-
let onStderr;
|
|
82
80
|
if ('onLog' in process && process.onLog) {
|
|
83
81
|
onLog = process.onLog;
|
|
84
82
|
delete process.onLog;
|
|
85
83
|
}
|
|
86
|
-
if ('onStdout' in process && process.onStdout) {
|
|
87
|
-
onStdout = process.onStdout;
|
|
88
|
-
delete process.onStdout;
|
|
89
|
-
}
|
|
90
|
-
if ('onStderr' in process && process.onStderr) {
|
|
91
|
-
onStderr = process.onStderr;
|
|
92
|
-
delete process.onStderr;
|
|
93
|
-
}
|
|
94
84
|
// Store original wait_for_completion setting
|
|
95
85
|
const shouldWaitForCompletion = process.waitForCompletion;
|
|
96
|
-
//
|
|
97
|
-
if (shouldWaitForCompletion &&
|
|
98
|
-
|
|
86
|
+
// Always start process without wait_for_completion to avoid server-side blocking
|
|
87
|
+
if (shouldWaitForCompletion && onLog) {
|
|
88
|
+
process.waitForCompletion = false;
|
|
89
|
+
}
|
|
90
|
+
const { response, data, error } = await (0, index_js_1.postProcess)({
|
|
91
|
+
body: process,
|
|
92
|
+
baseUrl: this.url,
|
|
93
|
+
client: this.client,
|
|
94
|
+
});
|
|
95
|
+
this.handleResponseError(response, data, error);
|
|
96
|
+
let result = data;
|
|
97
|
+
// Handle wait_for_completion with parallel log streaming
|
|
98
|
+
if (shouldWaitForCompletion && onLog) {
|
|
99
|
+
const streamControl = this.streamLogs(result.pid, { onLog });
|
|
100
|
+
try {
|
|
101
|
+
// Wait for process completion
|
|
102
|
+
result = await this.wait(result.pid, { interval: 500, maxWait: 1000 * 60 * 60 });
|
|
103
|
+
}
|
|
104
|
+
finally {
|
|
105
|
+
// Clean up log streaming
|
|
106
|
+
if (streamControl) {
|
|
107
|
+
streamControl.close();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
99
110
|
}
|
|
100
111
|
else {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
client: this.client,
|
|
105
|
-
});
|
|
106
|
-
this.handleResponseError(response, data, error);
|
|
107
|
-
const result = data;
|
|
108
|
-
if (onLog || onStdout || onStderr) {
|
|
109
|
-
const streamControl = this.streamLogs(result.pid, { onLog, onStdout, onStderr });
|
|
112
|
+
// For non-blocking execution, set up log streaming immediately if requested
|
|
113
|
+
if (onLog) {
|
|
114
|
+
const streamControl = this.streamLogs(result.pid, { onLog });
|
|
110
115
|
return {
|
|
111
116
|
...result,
|
|
112
117
|
close() {
|
|
@@ -116,120 +121,8 @@ class SandboxProcess extends action_js_1.SandboxAction {
|
|
|
116
121
|
},
|
|
117
122
|
};
|
|
118
123
|
}
|
|
119
|
-
return result;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
async execWithStreaming(processRequest, options) {
|
|
123
|
-
const headers = this.sandbox.forceUrl ? this.sandbox.headers : settings_js_1.settings.headers;
|
|
124
|
-
const controller = new AbortController();
|
|
125
|
-
const response = await fetch(`${this.url}/process`, {
|
|
126
|
-
method: 'POST',
|
|
127
|
-
signal: controller.signal,
|
|
128
|
-
headers: {
|
|
129
|
-
...headers,
|
|
130
|
-
'Content-Type': 'application/json',
|
|
131
|
-
'Accept': 'text/event-stream',
|
|
132
|
-
},
|
|
133
|
-
body: JSON.stringify(processRequest),
|
|
134
|
-
});
|
|
135
|
-
if (!response.ok) {
|
|
136
|
-
const errorText = await response.text();
|
|
137
|
-
throw new Error(`Failed to execute process: ${errorText}`);
|
|
138
|
-
}
|
|
139
|
-
const contentType = response.headers.get('Content-Type') || '';
|
|
140
|
-
const isStreaming = contentType.includes('text/plain') || contentType.includes('text/event-stream');
|
|
141
|
-
// Fallback: server doesn't support streaming, use legacy approach
|
|
142
|
-
if (!isStreaming) {
|
|
143
|
-
const data = await response.json();
|
|
144
|
-
// If process already completed (server waited), just return with logs
|
|
145
|
-
if (data.status === 'completed' || data.status === 'failed') {
|
|
146
|
-
// Emit any captured logs through callbacks
|
|
147
|
-
if (data.stdout) {
|
|
148
|
-
for (const line of data.stdout.split('\n').filter(l => l)) {
|
|
149
|
-
options.onStdout?.(line);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (data.stderr) {
|
|
153
|
-
for (const line of data.stderr.split('\n').filter(l => l)) {
|
|
154
|
-
options.onStderr?.(line);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if (data.logs) {
|
|
158
|
-
for (const line of data.logs.split('\n').filter(l => l)) {
|
|
159
|
-
options.onLog?.(line);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
...data,
|
|
164
|
-
close: () => { },
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
return {
|
|
168
|
-
...data,
|
|
169
|
-
close: () => { },
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
// Streaming response handling
|
|
173
|
-
if (!response.body) {
|
|
174
|
-
throw new Error('No response body for streaming');
|
|
175
|
-
}
|
|
176
|
-
const reader = response.body.getReader();
|
|
177
|
-
const decoder = new TextDecoder();
|
|
178
|
-
let buffer = '';
|
|
179
|
-
let result = null;
|
|
180
|
-
while (true) {
|
|
181
|
-
const readResult = await reader.read();
|
|
182
|
-
if (readResult.done)
|
|
183
|
-
break;
|
|
184
|
-
if (readResult.value && readResult.value instanceof Uint8Array) {
|
|
185
|
-
buffer += decoder.decode(readResult.value, { stream: true });
|
|
186
|
-
}
|
|
187
|
-
const lines = buffer.split(/\r?\n/);
|
|
188
|
-
buffer = lines.pop();
|
|
189
|
-
for (const line of lines) {
|
|
190
|
-
if (!line || line.startsWith('[keepalive]')) {
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
if (line.startsWith('stdout:')) {
|
|
194
|
-
const content = line.slice(7);
|
|
195
|
-
options.onStdout?.(content);
|
|
196
|
-
options.onLog?.(content);
|
|
197
|
-
}
|
|
198
|
-
else if (line.startsWith('stderr:')) {
|
|
199
|
-
const content = line.slice(7);
|
|
200
|
-
options.onStderr?.(content);
|
|
201
|
-
options.onLog?.(content);
|
|
202
|
-
}
|
|
203
|
-
else if (line.startsWith('result:')) {
|
|
204
|
-
const jsonStr = line.slice(7);
|
|
205
|
-
try {
|
|
206
|
-
result = JSON.parse(jsonStr);
|
|
207
|
-
}
|
|
208
|
-
catch {
|
|
209
|
-
throw new Error(`Failed to parse result JSON: ${jsonStr}`);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
124
|
}
|
|
214
|
-
|
|
215
|
-
if (buffer.trim()) {
|
|
216
|
-
if (buffer.startsWith('result:')) {
|
|
217
|
-
const jsonStr = buffer.slice(7);
|
|
218
|
-
try {
|
|
219
|
-
result = JSON.parse(jsonStr);
|
|
220
|
-
}
|
|
221
|
-
catch {
|
|
222
|
-
throw new Error(`Failed to parse result JSON: ${jsonStr}`);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
if (!result) {
|
|
227
|
-
throw new Error('No result received from streaming response');
|
|
228
|
-
}
|
|
229
|
-
return {
|
|
230
|
-
...result,
|
|
231
|
-
close: () => controller.abort(),
|
|
232
|
-
};
|
|
125
|
+
return { ...result, close: () => { } };
|
|
233
126
|
}
|
|
234
127
|
async wait(identifier, { maxWait = 60000, interval = 1000 } = {}) {
|
|
235
128
|
const startTime = Date.now();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
|
|
2
|
-
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, CleanupImagesData, ListImagesData, DeleteImageData, GetImageData, DeleteImageTagData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobExecutionsData, CreateJobExecutionData, DeleteJobExecutionData, GetJobExecutionData, ListJobRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListAllPendingInvitationsData, ListPublicIpsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData, GetWorkspaceServiceAccountsData, CreateWorkspaceServiceAccountData, DeleteWorkspaceServiceAccountData, UpdateWorkspaceServiceAccountData, ListApiKeysForServiceAccountData, CreateApiKeyForServiceAccountData, DeleteApiKeyForServiceAccountData, ListTemplatesData, GetTemplateData, ListWorkspaceUsersData, InviteWorkspaceUserData, RemoveWorkspaceUserData, UpdateWorkspaceUserRoleData, ListVolumeTemplatesData, CreateVolumeTemplateData, DeleteVolumeTemplateData, GetVolumeTemplateData, UpdateVolumeTemplateData, DeleteVolumeTemplateVersionData, ListVolumesData, CreateVolumeData, DeleteVolumeData, GetVolumeData, ListWorkspacesData, CreateWorkspaceData, DeleteWorkspaceData, GetWorkspaceData, UpdateWorkspaceData, DeclineWorkspaceInvitationData, AcceptWorkspaceInvitationData, LeaveWorkspaceData, CheckWorkspaceAvailabilityData } from './types.gen.js';
|
|
2
|
+
import type { ListAgentsData, CreateAgentData, DeleteAgentData, GetAgentData, UpdateAgentData, ListAgentRevisionsData, GetConfigurationData, ListCustomDomainsData, CreateCustomDomainData, DeleteCustomDomainData, GetCustomDomainData, UpdateCustomDomainData, VerifyCustomDomainData, ListFunctionsData, CreateFunctionData, DeleteFunctionData, GetFunctionData, UpdateFunctionData, ListFunctionRevisionsData, CleanupImagesData, ListImagesData, DeleteImageData, GetImageData, DeleteImageTagData, GetIntegrationData, ListIntegrationConnectionsData, CreateIntegrationConnectionData, DeleteIntegrationConnectionData, GetIntegrationConnectionData, UpdateIntegrationConnectionData, GetIntegrationConnectionModelEndpointConfigurationsData, ListIntegrationConnectionModelsData, GetIntegrationConnectionModelData, ListJobsData, CreateJobData, DeleteJobData, GetJobData, UpdateJobData, ListJobExecutionsData, CreateJobExecutionData, DeleteJobExecutionData, GetJobExecutionData, ListJobRevisionsData, ListLocationsData, ListMcpHubDefinitionsData, ListModelsData, CreateModelData, DeleteModelData, GetModelData, UpdateModelData, ListModelRevisionsData, ListPoliciesData, CreatePolicyData, DeletePolicyData, GetPolicyData, UpdatePolicyData, ListAllPendingInvitationsData, ListPublicIpsData, ListSandboxHubDefinitionsData, ListSandboxesData, CreateSandboxData, DeleteSandboxData, GetSandboxData, UpdateSandboxData, ListSandboxPreviewsData, CreateSandboxPreviewData, DeleteSandboxPreviewData, GetSandboxPreviewData, UpdateSandboxPreviewData, ListSandboxPreviewTokensData, CreateSandboxPreviewTokenData, DeleteSandboxPreviewTokenData, StartSandboxData, StopSandboxData, GetWorkspaceServiceAccountsData, CreateWorkspaceServiceAccountData, DeleteWorkspaceServiceAccountData, UpdateWorkspaceServiceAccountData, ListApiKeysForServiceAccountData, CreateApiKeyForServiceAccountData, DeleteApiKeyForServiceAccountData, ListTemplatesData, GetTemplateData, ListWorkspaceUsersData, InviteWorkspaceUserData, RemoveWorkspaceUserData, UpdateWorkspaceUserRoleData, ListVolumeTemplatesData, CreateVolumeTemplateData, DeleteVolumeTemplateData, GetVolumeTemplateData, UpdateVolumeTemplateData, DeleteVolumeTemplateVersionData, ListVolumesData, CreateVolumeData, DeleteVolumeData, GetVolumeData, ListWorkspacesData, CreateWorkspaceData, DeleteWorkspaceData, GetWorkspaceData, UpdateWorkspaceData, DeclineWorkspaceInvitationData, AcceptWorkspaceInvitationData, LeaveWorkspaceData, CheckWorkspaceAvailabilityData } from './types.gen.js';
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -352,6 +352,16 @@ export declare const createSandboxPreviewToken: <ThrowOnError extends boolean =
|
|
|
352
352
|
export declare const deleteSandboxPreviewToken: <ThrowOnError extends boolean = false>(options: Options<DeleteSandboxPreviewTokenData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<{
|
|
353
353
|
message?: string;
|
|
354
354
|
}, unknown, ThrowOnError>;
|
|
355
|
+
/**
|
|
356
|
+
* Start Sandbox
|
|
357
|
+
* Starts a Sandbox by name.
|
|
358
|
+
*/
|
|
359
|
+
export declare const startSandbox: <ThrowOnError extends boolean = false>(options: Options<StartSandboxData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").StartSandbox, unknown, ThrowOnError>;
|
|
360
|
+
/**
|
|
361
|
+
* Stop Sandbox
|
|
362
|
+
* Stops a Sandbox by name.
|
|
363
|
+
*/
|
|
364
|
+
export declare const stopSandbox: <ThrowOnError extends boolean = false>(options: Options<StopSandboxData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").StopSandbox, unknown, ThrowOnError>;
|
|
355
365
|
/**
|
|
356
366
|
* Get workspace service accounts
|
|
357
367
|
* Returns a list of all service accounts in the workspace.
|
|
@@ -4432,6 +4432,54 @@ export type DeleteSandboxPreviewTokenResponses = {
|
|
|
4432
4432
|
};
|
|
4433
4433
|
};
|
|
4434
4434
|
export type DeleteSandboxPreviewTokenResponse = DeleteSandboxPreviewTokenResponses[keyof DeleteSandboxPreviewTokenResponses];
|
|
4435
|
+
export type StartSandboxData = {
|
|
4436
|
+
body?: never;
|
|
4437
|
+
path: {
|
|
4438
|
+
/**
|
|
4439
|
+
* Name of the Sandbox
|
|
4440
|
+
*/
|
|
4441
|
+
sandboxName: string;
|
|
4442
|
+
};
|
|
4443
|
+
query?: never;
|
|
4444
|
+
url: '/sandboxes/{sandboxName}/start';
|
|
4445
|
+
};
|
|
4446
|
+
export type StartSandboxErrors = {
|
|
4447
|
+
/**
|
|
4448
|
+
* Sandbox is already running
|
|
4449
|
+
*/
|
|
4450
|
+
409: unknown;
|
|
4451
|
+
};
|
|
4452
|
+
export type StartSandboxResponses = {
|
|
4453
|
+
/**
|
|
4454
|
+
* successful operation
|
|
4455
|
+
*/
|
|
4456
|
+
200: StartSandbox;
|
|
4457
|
+
};
|
|
4458
|
+
export type StartSandboxResponse = StartSandboxResponses[keyof StartSandboxResponses];
|
|
4459
|
+
export type StopSandboxData = {
|
|
4460
|
+
body?: never;
|
|
4461
|
+
path: {
|
|
4462
|
+
/**
|
|
4463
|
+
* Name of the Sandbox
|
|
4464
|
+
*/
|
|
4465
|
+
sandboxName: string;
|
|
4466
|
+
};
|
|
4467
|
+
query?: never;
|
|
4468
|
+
url: '/sandboxes/{sandboxName}/stop';
|
|
4469
|
+
};
|
|
4470
|
+
export type StopSandboxErrors = {
|
|
4471
|
+
/**
|
|
4472
|
+
* Sandbox is not running
|
|
4473
|
+
*/
|
|
4474
|
+
409: unknown;
|
|
4475
|
+
};
|
|
4476
|
+
export type StopSandboxResponses = {
|
|
4477
|
+
/**
|
|
4478
|
+
* successful operation
|
|
4479
|
+
*/
|
|
4480
|
+
200: StopSandbox;
|
|
4481
|
+
};
|
|
4482
|
+
export type StopSandboxResponse = StopSandboxResponses[keyof StopSandboxResponses];
|
|
4435
4483
|
export type GetWorkspaceServiceAccountsData = {
|
|
4436
4484
|
body?: never;
|
|
4437
4485
|
path?: never;
|
|
@@ -187,7 +187,7 @@ export declare const getNetworkProcessByPidPorts: <ThrowOnError extends boolean
|
|
|
187
187
|
export declare const getProcess: <ThrowOnError extends boolean = false>(options?: Options<GetProcessData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ProcessResponse[], unknown, ThrowOnError>;
|
|
188
188
|
/**
|
|
189
189
|
* Execute a command
|
|
190
|
-
* Execute a command and return process information
|
|
190
|
+
* Execute a command and return process information
|
|
191
191
|
*/
|
|
192
192
|
export declare const postProcess: <ThrowOnError extends boolean = false>(options: Options<PostProcessData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen").ProcessResponse, import("./types.gen").ErrorResponse, ThrowOnError>;
|
|
193
193
|
/**
|
|
@@ -143,8 +143,6 @@ export type ProcessResponse = {
|
|
|
143
143
|
restartOnFailure?: boolean;
|
|
144
144
|
startedAt: string;
|
|
145
145
|
status: 'failed' | 'killed' | 'stopped' | 'running' | 'completed';
|
|
146
|
-
stderr: string;
|
|
147
|
-
stdout: string;
|
|
148
146
|
workingDir: string;
|
|
149
147
|
};
|
|
150
148
|
export type RankedFile = {
|
|
@@ -13,7 +13,6 @@ export declare class SandboxProcess extends SandboxAction {
|
|
|
13
13
|
close: () => void;
|
|
14
14
|
};
|
|
15
15
|
exec(process: ProcessRequest | ProcessRequestWithLog): Promise<PostProcessResponse | ProcessResponseWithLog>;
|
|
16
|
-
private execWithStreaming;
|
|
17
16
|
wait(identifier: string, { maxWait, interval }?: {
|
|
18
17
|
maxWait?: number;
|
|
19
18
|
interval?: number;
|
|
@@ -47,8 +47,6 @@ export declare function normalizeEnvs(envs?: EnvVar[]): EnvVar[] | undefined;
|
|
|
47
47
|
export declare function normalizeVolumes(volumes?: (VolumeBinding | VolumeAttachment)[]): VolumeAttachment[] | undefined;
|
|
48
48
|
export type ProcessRequestWithLog = ProcessRequest & {
|
|
49
49
|
onLog?: (log: string) => void;
|
|
50
|
-
onStdout?: (stdout: string) => void;
|
|
51
|
-
onStderr?: (stderr: string) => void;
|
|
52
50
|
};
|
|
53
51
|
export type ProcessResponseWithLog = PostProcessResponse & {
|
|
54
52
|
close: () => void;
|