@blaxel/core 0.2.86-preview.161 → 0.2.86-preview.163
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/common/settings.js +2 -2
- package/dist/cjs/sandbox/sandbox.js +11 -0
- package/dist/cjs/types/sandbox/sandbox.d.ts +2 -1
- package/dist/cjs/types/sandbox/types.d.ts +3 -0
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/settings.js +2 -2
- package/dist/cjs-browser/sandbox/sandbox.js +11 -0
- package/dist/cjs-browser/types/sandbox/sandbox.d.ts +2 -1
- package/dist/cjs-browser/types/sandbox/types.d.ts +3 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/settings.js +2 -2
- package/dist/esm/sandbox/sandbox.js +11 -0
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/settings.js +2 -2
- package/dist/esm-browser/sandbox/sandbox.js +11 -0
- package/package.json +1 -1
|
@@ -11,8 +11,8 @@ const index_js_1 = require("../authentication/index.js");
|
|
|
11
11
|
const env_js_1 = require("../common/env.js");
|
|
12
12
|
const node_js_1 = require("../common/node.js");
|
|
13
13
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
14
|
-
const BUILD_VERSION = "0.2.86-preview.
|
|
15
|
-
const BUILD_COMMIT = "
|
|
14
|
+
const BUILD_VERSION = "0.2.86-preview.163";
|
|
15
|
+
const BUILD_COMMIT = "e78918cc0a9d6da05b5a83895f6d4d2c08e51b5b";
|
|
16
16
|
const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
|
|
17
17
|
const BLAXEL_API_VERSION = "2026-04-16";
|
|
18
18
|
// Cache for config.yaml tracking value
|
|
@@ -309,6 +309,17 @@ class SandboxInstance {
|
|
|
309
309
|
const instance = new SandboxInstance(data);
|
|
310
310
|
return SandboxInstance.attachH2Session(instance);
|
|
311
311
|
}
|
|
312
|
+
static async updateNetwork(sandboxName, network) {
|
|
313
|
+
const sandbox = await SandboxInstance.get(sandboxName);
|
|
314
|
+
const body = { ...sandbox.sandbox, spec: { ...sandbox.spec, network: network.network } };
|
|
315
|
+
const { data } = await (0, index_js_1.updateSandbox)({
|
|
316
|
+
path: { sandboxName },
|
|
317
|
+
body,
|
|
318
|
+
throwOnError: true,
|
|
319
|
+
});
|
|
320
|
+
const instance = new SandboxInstance(data);
|
|
321
|
+
return SandboxInstance.attachH2Session(instance);
|
|
322
|
+
}
|
|
312
323
|
static async createIfNotExists(sandbox) {
|
|
313
324
|
const ATTEMPTS = 3;
|
|
314
325
|
for (let i = 0; i < ATTEMPTS; ++i) {
|
|
@@ -8,7 +8,7 @@ import { SandboxPreviews } from "./preview.js";
|
|
|
8
8
|
import { SandboxProcess } from "./process/index.js";
|
|
9
9
|
import { SandboxSessions } from "./session.js";
|
|
10
10
|
import { SandboxSystem } from "./system.js";
|
|
11
|
-
import { SandboxConfiguration, SandboxCreateConfiguration, SandboxUpdateMetadata, SessionWithToken } from "./types.js";
|
|
11
|
+
import { SandboxConfiguration, SandboxCreateConfiguration, SandboxUpdateMetadata, SandboxUpdateNetwork, SessionWithToken } from "./types.js";
|
|
12
12
|
export declare class SandboxInstance {
|
|
13
13
|
private sandbox;
|
|
14
14
|
fs: SandboxFileSystem;
|
|
@@ -57,6 +57,7 @@ export declare class SandboxInstance {
|
|
|
57
57
|
static updateMetadata(sandboxName: string, metadata: SandboxUpdateMetadata): Promise<SandboxInstance>;
|
|
58
58
|
static updateTtl(sandboxName: string, ttl: string): Promise<SandboxInstance>;
|
|
59
59
|
static updateLifecycle(sandboxName: string, lifecycle: SandboxLifecycle): Promise<SandboxInstance>;
|
|
60
|
+
static updateNetwork(sandboxName: string, network: SandboxUpdateNetwork): Promise<SandboxInstance>;
|
|
60
61
|
static createIfNotExists(sandbox: SandboxModel | SandboxCreateConfiguration): Promise<SandboxInstance>;
|
|
61
62
|
static fromSession(session: SessionWithToken): Promise<SandboxInstance>;
|
|
62
63
|
}
|
|
@@ -32,6 +32,9 @@ export type SandboxUpdateMetadata = {
|
|
|
32
32
|
labels?: Record<string, string>;
|
|
33
33
|
displayName?: string;
|
|
34
34
|
};
|
|
35
|
+
export type SandboxUpdateNetwork = {
|
|
36
|
+
network?: SandboxNetwork;
|
|
37
|
+
};
|
|
35
38
|
export type SandboxCreateConfiguration = {
|
|
36
39
|
name?: string;
|
|
37
40
|
image?: string;
|