@bunbase-ae/js 2.9.1-next.225.44112ee → 2.9.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/admin.ts +21 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunbase-ae/js",
3
- "version": "2.9.1-next.225.44112ee",
3
+ "version": "2.9.1",
4
4
  "type": "module",
5
5
  "description": "TypeScript/JavaScript SDK for BunBase",
6
6
  "license": "UNLICENSED",
package/src/admin.ts CHANGED
@@ -296,6 +296,19 @@ export interface ServerSettings {
296
296
  // a destinations list from the legacy fields at runtime — the Studio UI uses
297
297
  // this to drive a per-destination editor with explicit retention.
298
298
  backup_destinations?: BackupDestinationConfig[];
299
+ // Phase 1 (#350): when true, every backup also captures `_files` blobs as a
300
+ // content-addressed sibling tree. Default true — disable for very large
301
+ // storage tiers handled out-of-band (e.g. S3 versioning).
302
+ backup_include_storage?: boolean;
303
+ // Phase 2 (#350): when true, every backup also captures an AES-256-GCM
304
+ // encrypted bundle of secret env vars under `backup_env_passphrase`.
305
+ // Default false — opt-in. Passphrase loss is unrecoverable for the env
306
+ // restore path; DB+storage still restore without it.
307
+ backup_include_env?: boolean;
308
+ // Operator-provided passphrase for `backup_include_env`. Must be at least
309
+ // 32 chars. Returned as the redacted sentinel ("********") on read once
310
+ // #379 lands.
311
+ backup_env_passphrase?: string;
299
312
  server_timezone?: string;
300
313
  server_locale?: string;
301
314
  access_log_level?: "info" | "warn" | "error";
@@ -340,6 +353,12 @@ export interface BackupFile {
340
353
  sha256?: string;
341
354
  /** Per-destination push results. Only populated for newly-created backups. */
342
355
  destinations?: Array<{ id: string; type: string; ok: boolean; error?: string }>;
356
+ /**
357
+ * Whether an encrypted env bundle sidecar (`<filename>.env.json.enc`) is
358
+ * present alongside the dump. When true, the Studio Restore flow prompts
359
+ * for the env passphrase before calling restore. (#350 Phase 2)
360
+ */
361
+ has_env_bundle?: boolean;
343
362
  }
344
363
 
345
364
  export interface HealthResponse {
@@ -941,11 +960,11 @@ class AdminBackupsClient {
941
960
  await this.http.request("DELETE", `/api/v1/admin/backups/${encodeURIComponent(filename)}`);
942
961
  }
943
962
 
944
- async restore(filename: string): Promise<void> {
963
+ async restore(filename: string, opts?: { env_passphrase?: string }): Promise<void> {
945
964
  await this.http.request(
946
965
  "POST",
947
966
  `/api/v1/admin/backups/${encodeURIComponent(filename)}/restore`,
948
- { body: {} },
967
+ { body: opts ?? {} },
949
968
  );
950
969
  }
951
970