@blaxel/core 0.2.60 → 0.2.61-dev.59
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 +22 -18
- package/dist/cjs/common/settings.js +2 -2
- package/dist/cjs/sandbox/sandbox.js +22 -0
- package/dist/cjs/types/client/sdk.gen.d.ts +6 -6
- package/dist/cjs/types/client/types.gen.d.ts +41 -39
- package/dist/cjs/types/sandbox/sandbox.d.ts +3 -1
- package/dist/cjs/types/volume/index.d.ts +2 -0
- package/dist/cjs/volume/index.js +63 -0
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/client/sdk.gen.js +22 -18
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/cjs-browser/sandbox/sandbox.js +22 -0
- package/dist/cjs-browser/types/client/sdk.gen.d.ts +6 -6
- package/dist/cjs-browser/types/client/types.gen.d.ts +41 -39
- package/dist/cjs-browser/types/sandbox/sandbox.d.ts +3 -1
- package/dist/cjs-browser/types/volume/index.d.ts +2 -0
- package/dist/cjs-browser/volume/index.js +63 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/client/sdk.gen.js +20 -16
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm/sandbox/sandbox.js +22 -0
- package/dist/esm/volume/index.js +64 -1
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/client/sdk.gen.js +20 -16
- package/dist/esm-browser/common/settings.js +2 -2
- package/dist/esm-browser/sandbox/sandbox.js +22 -0
- package/dist/esm-browser/volume/index.js +64 -1
- package/package.json +89 -89
- package/LICENSE +0 -21
|
@@ -2,7 +2,7 @@
|
|
|
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.updateWorkspace = exports.getWorkspace = 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.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.
|
|
5
|
+
exports.updateWorkspace = exports.getWorkspace = exports.deleteWorkspace = exports.createWorkspace = exports.listWorkspaces = exports.updateVolume = 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.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.updatePolicy = exports.getPolicy = exports.deletePolicy = exports.createPolicy = exports.listPolicies = exports.listModelRevisions = void 0;
|
|
6
6
|
exports.checkWorkspaceAvailability = exports.leaveWorkspace = exports.acceptWorkspaceInvitation = exports.declineWorkspaceInvitation = void 0;
|
|
7
7
|
const client_gen_1 = require("./client.gen");
|
|
8
8
|
/**
|
|
@@ -1012,23 +1012,6 @@ const updatePolicy = (options) => {
|
|
|
1012
1012
|
});
|
|
1013
1013
|
};
|
|
1014
1014
|
exports.updatePolicy = updatePolicy;
|
|
1015
|
-
/**
|
|
1016
|
-
* List pending invitations
|
|
1017
|
-
* Returns a list of all pending invitations in the workspace.
|
|
1018
|
-
*/
|
|
1019
|
-
const listAllPendingInvitations = (options) => {
|
|
1020
|
-
return (options?.client ?? client_gen_1.client).get({
|
|
1021
|
-
security: [
|
|
1022
|
-
{
|
|
1023
|
-
scheme: 'bearer',
|
|
1024
|
-
type: 'http'
|
|
1025
|
-
}
|
|
1026
|
-
],
|
|
1027
|
-
url: '/profile/invitations',
|
|
1028
|
-
...options
|
|
1029
|
-
});
|
|
1030
|
-
};
|
|
1031
|
-
exports.listAllPendingInvitations = listAllPendingInvitations;
|
|
1032
1015
|
/**
|
|
1033
1016
|
* List public ips
|
|
1034
1017
|
* Returns a list of all public ips used in Blaxel..
|
|
@@ -1727,6 +1710,27 @@ const getVolume = (options) => {
|
|
|
1727
1710
|
});
|
|
1728
1711
|
};
|
|
1729
1712
|
exports.getVolume = getVolume;
|
|
1713
|
+
/**
|
|
1714
|
+
* Update volume
|
|
1715
|
+
* Updates a volume.
|
|
1716
|
+
*/
|
|
1717
|
+
const updateVolume = (options) => {
|
|
1718
|
+
return (options.client ?? client_gen_1.client).put({
|
|
1719
|
+
security: [
|
|
1720
|
+
{
|
|
1721
|
+
scheme: 'bearer',
|
|
1722
|
+
type: 'http'
|
|
1723
|
+
}
|
|
1724
|
+
],
|
|
1725
|
+
url: '/volumes/{volumeName}',
|
|
1726
|
+
...options,
|
|
1727
|
+
headers: {
|
|
1728
|
+
'Content-Type': 'application/json',
|
|
1729
|
+
...options?.headers
|
|
1730
|
+
}
|
|
1731
|
+
});
|
|
1732
|
+
};
|
|
1733
|
+
exports.updateVolume = updateVolume;
|
|
1730
1734
|
/**
|
|
1731
1735
|
* List accessible workspaces
|
|
1732
1736
|
* Returns all workspaces the authenticated user has access to. Each workspace is a separate tenant with its own resources, team members, and billing.
|
|
@@ -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.
|
|
13
|
-
const BUILD_COMMIT = "
|
|
12
|
+
const BUILD_VERSION = "0.2.61-dev.59";
|
|
13
|
+
const BUILD_COMMIT = "b31b3a72e9e909957f7eddddd81cff16cccddb26";
|
|
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;
|
|
@@ -161,6 +161,28 @@ class SandboxInstance {
|
|
|
161
161
|
const instance = new SandboxInstance(data);
|
|
162
162
|
return instance;
|
|
163
163
|
}
|
|
164
|
+
static async updateTtl(sandboxName, ttl) {
|
|
165
|
+
const sandbox = await SandboxInstance.get(sandboxName);
|
|
166
|
+
const body = { ...sandbox.sandbox, spec: { ...sandbox.spec, runtime: { ...sandbox.spec.runtime, ttl } } };
|
|
167
|
+
const { data } = await (0, index_js_1.updateSandbox)({
|
|
168
|
+
path: { sandboxName },
|
|
169
|
+
body,
|
|
170
|
+
throwOnError: true,
|
|
171
|
+
});
|
|
172
|
+
const instance = new SandboxInstance(data);
|
|
173
|
+
return instance;
|
|
174
|
+
}
|
|
175
|
+
static async updateLifecycle(sandboxName, lifecycle) {
|
|
176
|
+
const sandbox = await SandboxInstance.get(sandboxName);
|
|
177
|
+
const body = { ...sandbox.sandbox, spec: { ...sandbox.spec, lifecycle } };
|
|
178
|
+
const { data } = await (0, index_js_1.updateSandbox)({
|
|
179
|
+
path: { sandboxName },
|
|
180
|
+
body,
|
|
181
|
+
throwOnError: true,
|
|
182
|
+
});
|
|
183
|
+
const instance = new SandboxInstance(data);
|
|
184
|
+
return instance;
|
|
185
|
+
}
|
|
164
186
|
static async createIfNotExists(sandbox) {
|
|
165
187
|
try {
|
|
166
188
|
return await SandboxInstance.create(sandbox);
|
|
@@ -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,
|
|
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, 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, UpdateVolumeData, 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
|
|
@@ -291,11 +291,6 @@ export declare const getPolicy: <ThrowOnError extends boolean = false>(options:
|
|
|
291
291
|
* Updates a governance policy's restrictions. Changes take effect on the next deployment of resources using this policy.
|
|
292
292
|
*/
|
|
293
293
|
export declare const updatePolicy: <ThrowOnError extends boolean = false>(options: Options<UpdatePolicyData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Policy, unknown, ThrowOnError>;
|
|
294
|
-
/**
|
|
295
|
-
* List pending invitations
|
|
296
|
-
* Returns a list of all pending invitations in the workspace.
|
|
297
|
-
*/
|
|
298
|
-
export declare const listAllPendingInvitations: <ThrowOnError extends boolean = false>(options?: Options<ListAllPendingInvitationsData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").PendingInvitationRender[], unknown, ThrowOnError>;
|
|
299
294
|
/**
|
|
300
295
|
* List public ips
|
|
301
296
|
* Returns a list of all public ips used in Blaxel..
|
|
@@ -516,6 +511,11 @@ export declare const deleteVolume: <ThrowOnError extends boolean = false>(option
|
|
|
516
511
|
* Returns detailed information about a volume including its size, region, attachment status, and any events history.
|
|
517
512
|
*/
|
|
518
513
|
export declare const getVolume: <ThrowOnError extends boolean = false>(options: Options<GetVolumeData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Volume, import("./types.gen.js")._Error, ThrowOnError>;
|
|
514
|
+
/**
|
|
515
|
+
* Update volume
|
|
516
|
+
* Updates a volume.
|
|
517
|
+
*/
|
|
518
|
+
export declare const updateVolume: <ThrowOnError extends boolean = false>(options: Options<UpdateVolumeData, ThrowOnError>) => import("@hey-api/client-fetch").RequestResult<import("./types.gen.js").Volume, unknown, ThrowOnError>;
|
|
519
519
|
/**
|
|
520
520
|
* List accessible workspaces
|
|
521
521
|
* Returns all workspaces the authenticated user has access to. Each workspace is a separate tenant with its own resources, team members, and billing.
|
|
@@ -236,6 +236,12 @@ export type Country = {
|
|
|
236
236
|
* Request to create a job execution
|
|
237
237
|
*/
|
|
238
238
|
export type CreateJobExecutionRequest = {
|
|
239
|
+
/**
|
|
240
|
+
* Environment variable overrides (optional, will merge with job's environment variables)
|
|
241
|
+
*/
|
|
242
|
+
env?: {
|
|
243
|
+
[key: string]: unknown;
|
|
244
|
+
};
|
|
239
245
|
/**
|
|
240
246
|
* Execution ID (optional, will be generated if not provided)
|
|
241
247
|
*/
|
|
@@ -248,6 +254,10 @@ export type CreateJobExecutionRequest = {
|
|
|
248
254
|
* Job ID
|
|
249
255
|
*/
|
|
250
256
|
jobId?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Memory override in megabytes (optional, must be lower than or equal to job's configured memory)
|
|
259
|
+
*/
|
|
260
|
+
memory?: number;
|
|
251
261
|
/**
|
|
252
262
|
* Array of task parameters for parallel execution
|
|
253
263
|
*/
|
|
@@ -555,6 +565,10 @@ export type FunctionRuntime = {
|
|
|
555
565
|
* Minimum instances to keep warm. Set to 1+ to eliminate cold starts, 0 for scale-to-zero.
|
|
556
566
|
*/
|
|
557
567
|
minScale?: number;
|
|
568
|
+
/**
|
|
569
|
+
* Transport compatibility for the MCP, can be "websocket" or "http-stream"
|
|
570
|
+
*/
|
|
571
|
+
transport?: 'websocket' | 'http-stream';
|
|
558
572
|
};
|
|
559
573
|
/**
|
|
560
574
|
* Configuration for an MCP server function including runtime settings, transport protocol, and connected integrations
|
|
@@ -568,10 +582,6 @@ export type FunctionSpec = {
|
|
|
568
582
|
policies?: PoliciesList;
|
|
569
583
|
revision?: RevisionConfiguration;
|
|
570
584
|
runtime?: FunctionRuntime;
|
|
571
|
-
/**
|
|
572
|
-
* Transport compatibility for the MCP, can be "websocket" or "http-stream"
|
|
573
|
-
*/
|
|
574
|
-
transport?: 'websocket' | 'http-stream';
|
|
575
585
|
triggers?: Triggers;
|
|
576
586
|
};
|
|
577
587
|
/**
|
|
@@ -586,10 +596,6 @@ export type FunctionSpecWritable = {
|
|
|
586
596
|
policies?: PoliciesList;
|
|
587
597
|
revision?: RevisionConfiguration;
|
|
588
598
|
runtime?: FunctionRuntime;
|
|
589
|
-
/**
|
|
590
|
-
* Transport compatibility for the MCP, can be "websocket" or "http-stream"
|
|
591
|
-
*/
|
|
592
|
-
transport?: 'websocket' | 'http-stream';
|
|
593
599
|
triggers?: TriggersWritable;
|
|
594
600
|
};
|
|
595
601
|
export type Image = {
|
|
@@ -1785,7 +1791,7 @@ export type Port = {
|
|
|
1785
1791
|
/**
|
|
1786
1792
|
* The protocol of the port
|
|
1787
1793
|
*/
|
|
1788
|
-
protocol?: 'HTTP' | 'TCP' | 'UDP';
|
|
1794
|
+
protocol?: 'HTTP' | 'TCP' | 'UDP' | 'TLS';
|
|
1789
1795
|
/**
|
|
1790
1796
|
* The target port of the port
|
|
1791
1797
|
*/
|
|
@@ -2563,11 +2569,11 @@ export type Volume = {
|
|
|
2563
2569
|
/**
|
|
2564
2570
|
* Volume status computed from events
|
|
2565
2571
|
*/
|
|
2566
|
-
status?: string;
|
|
2572
|
+
readonly status?: string;
|
|
2567
2573
|
/**
|
|
2568
2574
|
* Timestamp when the volume was marked for termination
|
|
2569
2575
|
*/
|
|
2570
|
-
terminatedAt?: string;
|
|
2576
|
+
readonly terminatedAt?: string;
|
|
2571
2577
|
};
|
|
2572
2578
|
/**
|
|
2573
2579
|
* Persistent storage volume that can be attached to sandboxes for durable file storage across sessions. Volumes survive sandbox deletion and can be reattached to new sandboxes.
|
|
@@ -2577,14 +2583,6 @@ export type VolumeWritable = {
|
|
|
2577
2583
|
metadata: MetadataWritable;
|
|
2578
2584
|
spec: VolumeSpecWritable;
|
|
2579
2585
|
state?: VolumeStateWritable;
|
|
2580
|
-
/**
|
|
2581
|
-
* Volume status computed from events
|
|
2582
|
-
*/
|
|
2583
|
-
status?: string;
|
|
2584
|
-
/**
|
|
2585
|
-
* Timestamp when the volume was marked for termination
|
|
2586
|
-
*/
|
|
2587
|
-
terminatedAt?: string;
|
|
2588
2586
|
};
|
|
2589
2587
|
/**
|
|
2590
2588
|
* Configuration for attaching a volume to a sandbox at a specific filesystem path
|
|
@@ -4324,25 +4322,6 @@ export type UpdatePolicyResponses = {
|
|
|
4324
4322
|
200: Policy;
|
|
4325
4323
|
};
|
|
4326
4324
|
export type UpdatePolicyResponse = UpdatePolicyResponses[keyof UpdatePolicyResponses];
|
|
4327
|
-
export type ListAllPendingInvitationsData = {
|
|
4328
|
-
body?: never;
|
|
4329
|
-
path?: never;
|
|
4330
|
-
query?: never;
|
|
4331
|
-
url: '/profile/invitations';
|
|
4332
|
-
};
|
|
4333
|
-
export type ListAllPendingInvitationsErrors = {
|
|
4334
|
-
/**
|
|
4335
|
-
* no pending invitations
|
|
4336
|
-
*/
|
|
4337
|
-
404: unknown;
|
|
4338
|
-
};
|
|
4339
|
-
export type ListAllPendingInvitationsResponses = {
|
|
4340
|
-
/**
|
|
4341
|
-
* successful operation
|
|
4342
|
-
*/
|
|
4343
|
-
200: Array<PendingInvitationRender>;
|
|
4344
|
-
};
|
|
4345
|
-
export type ListAllPendingInvitationsResponse = ListAllPendingInvitationsResponses[keyof ListAllPendingInvitationsResponses];
|
|
4346
4325
|
export type ListPublicIpsData = {
|
|
4347
4326
|
body?: never;
|
|
4348
4327
|
path?: never;
|
|
@@ -4405,7 +4384,12 @@ export type ListSandboxesResponse = ListSandboxesResponses[keyof ListSandboxesRe
|
|
|
4405
4384
|
export type CreateSandboxData = {
|
|
4406
4385
|
body: SandboxWritable;
|
|
4407
4386
|
path?: never;
|
|
4408
|
-
query?:
|
|
4387
|
+
query?: {
|
|
4388
|
+
/**
|
|
4389
|
+
* If true, return existing sandbox instead of 409 error when sandbox exists and is not in FAILED/TERMINATED/TERMINATING state
|
|
4390
|
+
*/
|
|
4391
|
+
createIfNotExist?: boolean;
|
|
4392
|
+
};
|
|
4409
4393
|
url: '/sandboxes';
|
|
4410
4394
|
};
|
|
4411
4395
|
export type CreateSandboxErrors = {
|
|
@@ -5372,6 +5356,24 @@ export type GetVolumeResponses = {
|
|
|
5372
5356
|
200: Volume;
|
|
5373
5357
|
};
|
|
5374
5358
|
export type GetVolumeResponse = GetVolumeResponses[keyof GetVolumeResponses];
|
|
5359
|
+
export type UpdateVolumeData = {
|
|
5360
|
+
body: VolumeWritable;
|
|
5361
|
+
path: {
|
|
5362
|
+
/**
|
|
5363
|
+
* Name of the volume
|
|
5364
|
+
*/
|
|
5365
|
+
volumeName: string;
|
|
5366
|
+
};
|
|
5367
|
+
query?: never;
|
|
5368
|
+
url: '/volumes/{volumeName}';
|
|
5369
|
+
};
|
|
5370
|
+
export type UpdateVolumeResponses = {
|
|
5371
|
+
/**
|
|
5372
|
+
* successful operation
|
|
5373
|
+
*/
|
|
5374
|
+
200: Volume;
|
|
5375
|
+
};
|
|
5376
|
+
export type UpdateVolumeResponse = UpdateVolumeResponses[keyof UpdateVolumeResponses];
|
|
5375
5377
|
export type ListWorkspacesData = {
|
|
5376
5378
|
body?: never;
|
|
5377
5379
|
path?: never;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Sandbox as SandboxModel } from "../client/index.js";
|
|
1
|
+
import { SandboxLifecycle, Sandbox as SandboxModel } from "../client/index.js";
|
|
2
2
|
import { SandboxCodegen } from "./codegen/index.js";
|
|
3
3
|
import { SandboxFileSystem } from "./filesystem/index.js";
|
|
4
4
|
import { SandboxNetwork } from "./network/index.js";
|
|
@@ -31,6 +31,8 @@ export declare class SandboxInstance {
|
|
|
31
31
|
static delete(sandboxName: string): Promise<SandboxModel>;
|
|
32
32
|
delete(): Promise<SandboxModel>;
|
|
33
33
|
static updateMetadata(sandboxName: string, metadata: SandboxUpdateMetadata): Promise<SandboxInstance>;
|
|
34
|
+
static updateTtl(sandboxName: string, ttl: string): Promise<SandboxInstance>;
|
|
35
|
+
static updateLifecycle(sandboxName: string, lifecycle: SandboxLifecycle): Promise<SandboxInstance>;
|
|
34
36
|
static createIfNotExists(sandbox: SandboxModel | SandboxCreateConfiguration): Promise<SandboxInstance>;
|
|
35
37
|
static fromSession(session: SessionWithToken): Promise<SandboxInstance>;
|
|
36
38
|
}
|
|
@@ -22,5 +22,7 @@ export declare class VolumeInstance {
|
|
|
22
22
|
static list(): Promise<VolumeInstance[]>;
|
|
23
23
|
static delete(volumeName: string): Promise<Volume>;
|
|
24
24
|
delete(): Promise<Volume>;
|
|
25
|
+
static update(volumeName: string, updates: VolumeCreateConfiguration | Volume): Promise<VolumeInstance>;
|
|
26
|
+
update(updates: VolumeCreateConfiguration | Volume): Promise<VolumeInstance>;
|
|
25
27
|
static createIfNotExists(config: VolumeCreateConfiguration | Volume): Promise<VolumeInstance>;
|
|
26
28
|
}
|
package/dist/cjs/volume/index.js
CHANGED
|
@@ -96,6 +96,69 @@ class VolumeInstance {
|
|
|
96
96
|
async delete() {
|
|
97
97
|
return await VolumeInstance.delete(this.metadata.name);
|
|
98
98
|
}
|
|
99
|
+
static async update(volumeName, updates) {
|
|
100
|
+
const volume = await VolumeInstance.get(volumeName);
|
|
101
|
+
let metadataUpdates = {};
|
|
102
|
+
let specUpdates = {};
|
|
103
|
+
if ('spec' in updates && 'metadata' in updates) {
|
|
104
|
+
// It's a Volume object - only include defined fields
|
|
105
|
+
if (updates.metadata) {
|
|
106
|
+
if (updates.metadata.displayName !== undefined)
|
|
107
|
+
metadataUpdates.displayName = updates.metadata.displayName;
|
|
108
|
+
if (updates.metadata.labels !== undefined)
|
|
109
|
+
metadataUpdates.labels = updates.metadata.labels;
|
|
110
|
+
}
|
|
111
|
+
if (updates.spec) {
|
|
112
|
+
if (updates.spec.size !== undefined)
|
|
113
|
+
specUpdates.size = updates.spec.size;
|
|
114
|
+
if (updates.spec.region !== undefined)
|
|
115
|
+
specUpdates.region = updates.spec.region;
|
|
116
|
+
if (updates.spec.template !== undefined)
|
|
117
|
+
specUpdates.template = updates.spec.template;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
// It's a VolumeCreateConfiguration - only include defined fields
|
|
122
|
+
if (updates.displayName !== undefined)
|
|
123
|
+
metadataUpdates.displayName = updates.displayName;
|
|
124
|
+
if (updates.labels !== undefined)
|
|
125
|
+
metadataUpdates.labels = updates.labels;
|
|
126
|
+
if (updates.size !== undefined)
|
|
127
|
+
specUpdates.size = updates.size;
|
|
128
|
+
if (updates.region !== undefined)
|
|
129
|
+
specUpdates.region = updates.region;
|
|
130
|
+
if (updates.template !== undefined)
|
|
131
|
+
specUpdates.template = updates.template;
|
|
132
|
+
}
|
|
133
|
+
const body = {
|
|
134
|
+
metadata: {
|
|
135
|
+
...volume.metadata,
|
|
136
|
+
...metadataUpdates,
|
|
137
|
+
},
|
|
138
|
+
spec: {
|
|
139
|
+
...volume.spec,
|
|
140
|
+
...specUpdates,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
const { data } = await (0, index_js_1.updateVolume)({
|
|
144
|
+
path: { volumeName },
|
|
145
|
+
body,
|
|
146
|
+
throwOnError: true,
|
|
147
|
+
});
|
|
148
|
+
const newVolume = {
|
|
149
|
+
metadata: data.metadata,
|
|
150
|
+
spec: data.spec,
|
|
151
|
+
events: data.events,
|
|
152
|
+
state: data.state,
|
|
153
|
+
status: data.status,
|
|
154
|
+
terminatedAt: data.terminatedAt,
|
|
155
|
+
};
|
|
156
|
+
return new VolumeInstance(newVolume);
|
|
157
|
+
}
|
|
158
|
+
async update(updates) {
|
|
159
|
+
const updated = await VolumeInstance.update(this.metadata.name, updates);
|
|
160
|
+
return updated;
|
|
161
|
+
}
|
|
99
162
|
static async createIfNotExists(config) {
|
|
100
163
|
try {
|
|
101
164
|
return await VolumeInstance.create(config);
|