@blaxel/core 0.2.60 → 0.2.61-preview.52

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.
@@ -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.60";
13
- const BUILD_COMMIT = "2c502afdeb7e7a53923997003a02788b8b7591d1";
12
+ const BUILD_VERSION = "0.2.61-preview.52";
13
+ const BUILD_COMMIT = "1b7ead8676a6fb9ef62cc059e829f394b2e3ecda";
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,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
  }