openpond-sdk 0.12.15 → 0.12.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.
package/dist/index.js CHANGED
@@ -486,7 +486,7 @@ async function runSandboxSmoke(client, options = {}) {
486
486
  }
487
487
  }
488
488
  });
489
- const snapshot = snapshotResponse.snapshot ?? (await waitForSnapshotReady(client, sandbox.id, snapshotResponse.snapshotJob?.snapshotId)).snapshot;
489
+ const { snapshot } = await waitForSnapshotReady(client, sandbox.id, snapshotResponse.snapshotJob.snapshotId);
490
490
  snapshotId = snapshot.id;
491
491
  if (snapshot.state !== "ready") {
492
492
  throw new Error(`expected ready snapshot, got ${snapshot.state}`);
@@ -997,12 +997,14 @@ var OpenPondSandboxInstanceClient = class {
997
997
  start(sandboxId, options = {}) {
998
998
  return this.request(`/${encodeURIComponent(sandboxId)}/start`, {
999
999
  method: "POST",
1000
- headers: asyncRequestHeaders(options)
1000
+ headers: asyncRequestHeaders(options),
1001
+ ...options.restore ? { body: JSON.stringify({ restore: options.restore }) } : {}
1001
1002
  });
1002
1003
  }
1003
- restore(sandboxId) {
1004
+ restore(sandboxId, input) {
1004
1005
  return this.request(`/${encodeURIComponent(sandboxId)}/restore`, {
1005
- method: "POST"
1006
+ method: "POST",
1007
+ ...input ? { body: JSON.stringify(input) } : {}
1006
1008
  });
1007
1009
  }
1008
1010
  delete(sandboxId, options = {}) {
@@ -1060,8 +1062,13 @@ var OpenPondSandboxInstanceClient = class {
1060
1062
  body: JSON.stringify(input)
1061
1063
  });
1062
1064
  }
1063
- billing(sandboxId) {
1064
- return this.request(`/${encodeURIComponent(sandboxId)}/billing`);
1065
+ billing(sandboxId, input) {
1066
+ const query = new URLSearchParams();
1067
+ if (input) {
1068
+ query.set("snapshotRetentionTtlSeconds", String(input.snapshotRetentionTtlSeconds));
1069
+ query.set("snapshotRetentionClass", input.snapshotRetentionClass);
1070
+ }
1071
+ return this.request(`/${encodeURIComponent(sandboxId)}/billing${query.size ? `?${query}` : ""}`);
1065
1072
  }
1066
1073
  pricing() {
1067
1074
  return this.request("/pricing");