sandbox 3.0.0-beta.21 → 3.0.0-beta.22
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.
|
@@ -7236,7 +7236,7 @@ const scope = {
|
|
|
7236
7236
|
|
|
7237
7237
|
//#endregion
|
|
7238
7238
|
//#region package.json
|
|
7239
|
-
var version = "3.0.0-beta.
|
|
7239
|
+
var version = "3.0.0-beta.22";
|
|
7240
7240
|
|
|
7241
7241
|
//#endregion
|
|
7242
7242
|
//#region src/error.ts
|
|
@@ -7274,7 +7274,11 @@ const snapshotClient = {
|
|
|
7274
7274
|
fetch: fetchWithUserAgent,
|
|
7275
7275
|
...params
|
|
7276
7276
|
})),
|
|
7277
|
-
get: (params) => withErrorHandling(Snapshot.get({ ...params }))
|
|
7277
|
+
get: (params) => withErrorHandling(Snapshot.get({ ...params })),
|
|
7278
|
+
fromSandbox: (name, opts) => withErrorHandling(Snapshot.fromSandbox(name, {
|
|
7279
|
+
fetch: fetchWithUserAgent,
|
|
7280
|
+
...opts
|
|
7281
|
+
}))
|
|
7278
7282
|
};
|
|
7279
7283
|
const fetchWithUserAgent = (input, init$1) => {
|
|
7280
7284
|
const headers = new Headers(init$1?.headers ?? (input && typeof input === "object" && "headers" in input ? input?.headers : {}));
|
|
@@ -11591,6 +11595,11 @@ const args$2 = {
|
|
|
11591
11595
|
description: "Start the sandbox from a snapshot ID",
|
|
11592
11596
|
type: import_cjs$14.optional(snapshotId)
|
|
11593
11597
|
}),
|
|
11598
|
+
sandboxSnapshot: import_cjs$14.option({
|
|
11599
|
+
long: "sandbox-snapshot",
|
|
11600
|
+
description: "Start the sandbox from another sandbox's current snapshot",
|
|
11601
|
+
type: import_cjs$14.optional(sandboxName)
|
|
11602
|
+
}),
|
|
11594
11603
|
connect: import_cjs$14.flag({
|
|
11595
11604
|
long: "connect",
|
|
11596
11605
|
description: "Start an interactive shell session after creating the sandbox"
|
|
@@ -11623,7 +11632,8 @@ const create = import_cjs$14.command({
|
|
|
11623
11632
|
description: "Create and connect to a sandbox without a network access",
|
|
11624
11633
|
command: `sandbox run --network-policy=none --connect`
|
|
11625
11634
|
}],
|
|
11626
|
-
async handler({ name, nonPersistent, ports, scope: scope$1, runtime: runtime$1, timeout: timeout$1, vcpus: vcpus$1, silent, snapshot: snapshot$1, connect: connect$2, envVars, tags, snapshotExpiration, networkPolicy: networkPolicyMode$1, allowedDomains: allowedDomains$1, allowedCIDRs: allowedCIDRs$1, deniedCIDRs: deniedCIDRs$1 }) {
|
|
11635
|
+
async handler({ name, nonPersistent, ports, scope: scope$1, runtime: runtime$1, timeout: timeout$1, vcpus: vcpus$1, silent, snapshot: snapshot$1, sandboxSnapshot, connect: connect$2, envVars, tags, snapshotExpiration, networkPolicy: networkPolicyMode$1, allowedDomains: allowedDomains$1, allowedCIDRs: allowedCIDRs$1, deniedCIDRs: deniedCIDRs$1 }) {
|
|
11636
|
+
if (snapshot$1 && sandboxSnapshot) throw new Error([`Cannot use --snapshot and --sandbox-snapshot together.`, `${source_default.bold("hint:")} Pick one source for the new sandbox.`].join("\n"));
|
|
11627
11637
|
const networkPolicy$1 = buildNetworkPolicy({
|
|
11628
11638
|
networkPolicy: networkPolicyMode$1,
|
|
11629
11639
|
allowedDomains: allowedDomains$1,
|
|
@@ -11633,12 +11643,17 @@ const create = import_cjs$14.command({
|
|
|
11633
11643
|
const persistent = !nonPersistent;
|
|
11634
11644
|
const resources = vcpus$1 ? { vcpus: vcpus$1 } : void 0;
|
|
11635
11645
|
const tagsObj = Object.keys(tags).length > 0 ? tags : void 0;
|
|
11646
|
+
const resolvedSnapshot = snapshot$1 ?? (sandboxSnapshot ? await snapshotClient.fromSandbox(sandboxSnapshot, {
|
|
11647
|
+
teamId: scope$1.team,
|
|
11648
|
+
projectId: scope$1.project,
|
|
11649
|
+
token: scope$1.token
|
|
11650
|
+
}) : void 0);
|
|
11636
11651
|
const spinner = silent ? void 0 : ora("Creating sandbox...").start();
|
|
11637
|
-
const sandbox =
|
|
11652
|
+
const sandbox = resolvedSnapshot ? await sandboxClient.create({
|
|
11638
11653
|
name,
|
|
11639
11654
|
source: {
|
|
11640
11655
|
type: "snapshot",
|
|
11641
|
-
snapshotId:
|
|
11656
|
+
snapshotId: resolvedSnapshot
|
|
11642
11657
|
},
|
|
11643
11658
|
teamId: scope$1.team,
|
|
11644
11659
|
projectId: scope$1.project,
|
|
@@ -15141,4 +15156,4 @@ const app = (opts) => (0, import_cjs.subcommands)({
|
|
|
15141
15156
|
|
|
15142
15157
|
//#endregion
|
|
15143
15158
|
export { source_exports as a, init_source as i, StyledError as n, require_cjs as r, app as t };
|
|
15144
|
-
//# sourceMappingURL=app-
|
|
15159
|
+
//# sourceMappingURL=app-BvadkI4m.mjs.map
|