@blaxel/core 0.2.66 → 0.2.67-preview.85

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.66";
7
- const BUILD_COMMIT = "716e957b944689373d4279122541451cad0ff3ae";
6
+ const BUILD_VERSION = "0.2.67-preview.85";
7
+ const BUILD_COMMIT = "da3d8e8ab535c2b332cf34cb6c05e4bd226f1d40";
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;
@@ -398,6 +398,42 @@ export const getNetworkProcessByPidPorts = (options) => {
398
398
  ...options
399
399
  });
400
400
  };
401
+ /**
402
+ * Disconnect tunnel
403
+ * Stop the network tunnel and restore the original network configuration. WARNING: After disconnecting, the sandbox will lose all outbound internet connectivity (no egress). Inbound connections to the sandbox will still work. Use PUT /network/tunnel/config to re-establish the tunnel.
404
+ */
405
+ export const deleteNetworkTunnel = (options) => {
406
+ return (options?.client ?? _heyApiClient).delete({
407
+ security: [
408
+ {
409
+ scheme: 'bearer',
410
+ type: 'http'
411
+ }
412
+ ],
413
+ url: '/network/tunnel',
414
+ ...options
415
+ });
416
+ };
417
+ /**
418
+ * Update tunnel configuration
419
+ * Apply a new tunnel configuration on the fly. The existing tunnel is torn down and a new one is established. This endpoint is write-only; there is no corresponding GET to read the config back.
420
+ */
421
+ export const putNetworkTunnelConfig = (options) => {
422
+ return (options.client ?? _heyApiClient).put({
423
+ security: [
424
+ {
425
+ scheme: 'bearer',
426
+ type: 'http'
427
+ }
428
+ ],
429
+ url: '/network/tunnel/config',
430
+ ...options,
431
+ headers: {
432
+ 'Content-Type': 'application/json',
433
+ ...options?.headers
434
+ }
435
+ });
436
+ };
401
437
  /**
402
438
  * List all processes
403
439
  * Get a list of all running and completed processes
@@ -65,6 +65,7 @@ export class SandboxInstance {
65
65
  'envs' in sandbox ||
66
66
  'volumes' in sandbox ||
67
67
  'lifecycle' in sandbox ||
68
+ 'network' in sandbox ||
68
69
  'snapshotEnabled' in sandbox ||
69
70
  'labels' in sandbox) {
70
71
  if (!sandbox)
@@ -86,6 +87,7 @@ export class SandboxInstance {
86
87
  "Please specify a region (e.g. 'us-pdx-1', 'eu-lon-1', 'us-was-1') in the sandbox configuration or set the BL_REGION environment variable.");
87
88
  }
88
89
  const lifecycle = sandbox.lifecycle;
90
+ const network = sandbox.network;
89
91
  const snapshotEnabled = sandbox.snapshotEnabled;
90
92
  sandbox = {
91
93
  metadata: { name: sandbox.name, labels: sandbox.labels },
@@ -101,6 +103,7 @@ export class SandboxInstance {
101
103
  },
102
104
  volumes: volumes,
103
105
  lifecycle: lifecycle,
106
+ network: network,
104
107
  }
105
108
  };
106
109
  if (ttl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/core",
3
- "version": "0.2.66",
3
+ "version": "0.2.67-preview.85",
4
4
  "description": "Blaxel Core SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",