@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.
@@ -3,8 +3,8 @@ import { authentication } from "../authentication/index.js";
3
3
  import { env } from "../common/env.js";
4
4
  import { fs, os, path } from "../common/node.js";
5
5
  // Build info - these placeholders are replaced at build time by build:replace-imports
6
- const BUILD_VERSION = "0.2.60";
7
- const BUILD_COMMIT = "2c502afdeb7e7a53923997003a02788b8b7591d1";
6
+ const BUILD_VERSION = "0.2.61-preview.52";
7
+ const BUILD_COMMIT = "1b7ead8676a6fb9ef62cc059e829f394b2e3ecda";
8
8
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
9
9
  // Cache for config.yaml tracking value
10
10
  let configTrackingValue = null;
@@ -158,6 +158,28 @@ export class SandboxInstance {
158
158
  const instance = new SandboxInstance(data);
159
159
  return instance;
160
160
  }
161
+ static async updateTTL(sandboxName, ttl) {
162
+ const sandbox = await SandboxInstance.get(sandboxName);
163
+ const body = { ...sandbox.sandbox, spec: { ...sandbox.spec, runtime: { ...sandbox.spec.runtime, ttl } } };
164
+ const { data } = await updateSandbox({
165
+ path: { sandboxName },
166
+ body,
167
+ throwOnError: true,
168
+ });
169
+ const instance = new SandboxInstance(data);
170
+ return instance;
171
+ }
172
+ static async updateLifecycle(sandboxName, lifecycle) {
173
+ const sandbox = await SandboxInstance.get(sandboxName);
174
+ const body = { ...sandbox.sandbox, spec: { ...sandbox.spec, lifecycle } };
175
+ const { data } = await updateSandbox({
176
+ path: { sandboxName },
177
+ body,
178
+ throwOnError: true,
179
+ });
180
+ const instance = new SandboxInstance(data);
181
+ return instance;
182
+ }
161
183
  static async createIfNotExists(sandbox) {
162
184
  try {
163
185
  return await SandboxInstance.create(sandbox);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.60",
3
+ "version": "0.2.61-preview.52",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",