sandbox 3.0.0-beta.15 → 3.0.0-beta.16

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.
@@ -7427,7 +7427,7 @@ const scope = {
7427
7427
 
7428
7428
  //#endregion
7429
7429
  //#region package.json
7430
- var version = "3.0.0-beta.15";
7430
+ var version = "3.0.0-beta.16";
7431
7431
 
7432
7432
  //#endregion
7433
7433
  //#region src/error.ts
@@ -14988,6 +14988,40 @@ const snapshotExpirationCommand = import_cjs$1.command({
14988
14988
  }
14989
14989
  }
14990
14990
  });
14991
+ const currentSnapshotCommand = import_cjs$1.command({
14992
+ name: "current-snapshot",
14993
+ description: "Update the current snapshot of a sandbox",
14994
+ args: {
14995
+ sandbox: import_cjs$1.positional({
14996
+ type: sandboxName,
14997
+ description: "Sandbox name to update"
14998
+ }),
14999
+ snapshotId: import_cjs$1.positional({
15000
+ type: snapshotId,
15001
+ description: "Snapshot ID to set as the current snapshot"
15002
+ }),
15003
+ scope
15004
+ },
15005
+ async handler({ scope: { token: token$1, team: team$1, project: project$1 }, sandbox: name, snapshotId: snapshotId$1 }) {
15006
+ const sandbox = await sandboxClient.get({
15007
+ name,
15008
+ projectId: project$1,
15009
+ teamId: team$1,
15010
+ token: token$1
15011
+ });
15012
+ const spinner = ora("Updating sandbox configuration...").start();
15013
+ try {
15014
+ await sandbox.update({ currentSnapshotId: snapshotId$1 });
15015
+ spinner.stop();
15016
+ process.stderr.write("✅ Configuration updated for sandbox " + source_default.cyan(name) + "\n");
15017
+ process.stderr.write(source_default.dim(" ╰ ") + "current-snapshot: " + source_default.cyan(snapshotId$1) + "\n");
15018
+ } catch (error) {
15019
+ spinner.stop();
15020
+ if (error instanceof APIError && error.response.status === 404) throw new StyledError(`Snapshot '${snapshotId$1}' was not found or does not belong to this project.`, error);
15021
+ throw error;
15022
+ }
15023
+ }
15024
+ });
14991
15025
  const listCommand = import_cjs$1.command({
14992
15026
  name: "list",
14993
15027
  description: "Display the current configuration of a sandbox",
@@ -15038,6 +15072,10 @@ const listCommand = import_cjs$1.command({
15038
15072
  field: "Snapshot expiration",
15039
15073
  value: sandbox.snapshotExpiration != null && sandbox.snapshotExpiration > 0 ? (0, import_ms.default)(sandbox.snapshotExpiration, { long: true }) : sandbox.snapshotExpiration === 0 ? "none" : "-"
15040
15074
  },
15075
+ {
15076
+ field: "Current snapshot",
15077
+ value: sandbox.currentSnapshotId ?? "-"
15078
+ },
15041
15079
  {
15042
15080
  field: "Tags",
15043
15081
  value: tagsDisplay
@@ -15148,6 +15186,7 @@ const config = import_cjs$1.subcommands({
15148
15186
  persistent: persistentCommand,
15149
15187
  "network-policy": networkPolicyCommand,
15150
15188
  "snapshot-expiration": snapshotExpirationCommand,
15189
+ "current-snapshot": currentSnapshotCommand,
15151
15190
  tags: tagsCommand
15152
15191
  }
15153
15192
  });
@@ -15195,4 +15234,4 @@ const app = (opts) => (0, import_cjs.subcommands)({
15195
15234
 
15196
15235
  //#endregion
15197
15236
  export { source_exports as a, init_source as i, StyledError as n, require_cjs as r, app as t };
15198
- //# sourceMappingURL=app-dd5m91-R.mjs.map
15237
+ //# sourceMappingURL=app-CvPilMmO.mjs.map