selfstore 1.8.19 → 1.8.20

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.
@@ -1,12 +1,12 @@
1
- import { B as BackupTarget } from './store-Cs6QIzzG.js';
2
- export { A as AuthExpiredError, a as BuiltinTargetKind, E as EncodeOptions, H as Header, K as KdfParams, L as LocalStore, b as LocalStoreOptions, c as LocalStoreState, M as MirrorState, d as Mode, e as PasswordCheck, f as PasswordPolicy, g as PasswordRequirement, P as PeerSource, h as PeerState, R as RESERVED_COLLECTION_PREFIX, i as RESERVED_STORE_MODES, j as RecipientStanza, k as ReplicaState, l as SelfstoreError, m as SelfstoreErrorCode, n as Severity, o as Snapshot, p as SnapshotFile, q as StatusAction, r as StatusDescriptor, s as StatusInput, t as StorageState, S as StoreError, u as StoreGroupConfig, v as SyncJournalEntry, w as SyncSource, T as TargetKind, x as checkPasswordPolicy, y as createLocalStore, z as deriveStatus, C as errorLabelKey, D as isAuthExpired, F as isReservedStoreMode, G as isSelfstoreError } from './store-Cs6QIzzG.js';
1
+ import { B as BackupTarget } from './store-DhrWMYg_.js';
2
+ export { A as AuthExpiredError, a as BuiltinTargetKind, E as EncodeOptions, H as Header, K as KdfParams, L as LocalStore, b as LocalStoreOptions, c as LocalStoreState, M as MirrorState, d as Mode, e as PasswordCheck, f as PasswordPolicy, g as PasswordRequirement, P as PeerSource, h as PeerState, R as RESERVED_COLLECTION_PREFIX, i as RESERVED_STORE_MODES, j as RecipientStanza, k as ReplicaState, l as SelfstoreError, m as SelfstoreErrorCode, n as Severity, o as Snapshot, p as SnapshotFile, q as StatusAction, r as StatusDescriptor, s as StatusInput, t as StorageState, S as StoreError, u as StoreGroupConfig, v as SyncJournalEntry, w as SyncSource, T as TargetKind, x as checkPasswordPolicy, y as createLocalStore, z as deriveStatus, C as errorLabelKey, D as isAuthExpired, F as isReservedStoreMode, G as isSelfstoreError } from './store-DhrWMYg_.js';
3
3
  import { K as KV } from './cache-ilsK3Tki.js';
4
4
  export { C as CachedFile, L as LocalCache, e as LockableCache, i as indexedDbCache, f as isLockableCache, m as memoryCache } from './cache-ilsK3Tki.js';
5
- export { G as GisDriveAuthOptions, a as GisTokenPersistence, d as datedName, e as exportSnapshot, g as gisDriveAuth, i as importSnapshot, b as inspect, c as isEncrypted, p as pickFromDisk, s as saveToDisk } from './local-Dh6eGiK9.js';
6
- import { c as connect$2, f as fromSession$2, a as connect$3, b as fromSession$3, p as peer } from './s3-0qqIyphl.js';
7
- export { S as S3Config, d as S3ConnectOptions, W as WebdavConfig, e as WebdavConnectOptions, g as WebdavPeerOptions } from './s3-0qqIyphl.js';
8
- import { c as connect$1, f as fromSession$1, p as preview, b as adopt, d as findOrCreateOwnFile, l as listBackups, e as createBackup, g as deleteBackup, r as renameBackup, h as account } from './drive-CY_Vsj7V.js';
9
- export { i as DriveAccount, a as DriveAuth, j as DriveBackupInfo, D as DriveOptions } from './drive-CY_Vsj7V.js';
5
+ export { G as GisDriveAuthOptions, a as GisTokenPersistence, d as datedName, e as exportSnapshot, g as gisDriveAuth, i as importSnapshot, b as inspect, c as isEncrypted, p as pickFromDisk, s as saveToDisk } from './local-DrziuI_t.js';
6
+ import { c as connect$2, f as fromSession$2, a as connect$3, b as fromSession$3, p as peer } from './s3-BLgf6hqR.js';
7
+ export { S as S3Config, d as S3ConnectOptions, W as WebdavConfig, e as WebdavConnectOptions, g as WebdavPeerOptions } from './s3-BLgf6hqR.js';
8
+ import { c as connect$1, f as fromSession$1, p as preview, b as adopt, d as findOrCreateOwnFile, l as listBackups, e as createBackup, g as deleteBackup, r as renameBackup, h as account } from './drive-BLRsK32w.js';
9
+ export { i as DriveAccount, a as DriveAuth, j as DriveBackupInfo, D as DriveOptions } from './drive-BLRsK32w.js';
10
10
  import './sync.js';
11
11
 
12
12
  /**
package/dist/advanced.js CHANGED
@@ -1,4 +1,4 @@
1
- export { RESERVED_STORE_MODES, createLocalStore, deriveStatus, gisDriveAuth, indexedDbCache, isLockableCache, isReservedStoreMode, memoryCache } from './chunk-TQH7ZYID.js';
1
+ export { RESERVED_STORE_MODES, createLocalStore, deriveStatus, gisDriveAuth, indexedDbCache, isLockableCache, isReservedStoreMode, memoryCache } from './chunk-ULPGGZ6L.js';
2
2
  export { datedName, pickFromDisk, saveToDisk } from './chunk-DCEXWSM6.js';
3
3
  import { openExisting, isOpenSupported, isSupported, fromSession as fromSession$1, connect as connect$1, fromSession3, connect3, peer, fromSession2, connect2 } from './chunk-TKWU52LK.js';
4
4
  import { FILE_ID_KEY, account, renameBackup, deleteBackup, createBackup, listBackups, findOrCreateOwnFile, adopt, preview, fromSession, connect } from './chunk-J5MFXJU6.js';
package/dist/backups.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { B as BackupsHost } from './manager-DhoIbJyg.js';
2
- export { a as BackupFileInfo, b as BackupOwner, c as BackupRow, d as BackupsErrorCode, e as BackupsKeys, f as BackupsManager, g as BackupsNaming, h as BackupsSnapshot, K as KnownBackups, i as createBackupsManager } from './manager-DhoIbJyg.js';
3
- import { D as DriveOptions } from './drive-CY_Vsj7V.js';
1
+ import { B as BackupsHost } from './manager-BlSs6Q5S.js';
2
+ export { a as BackupFileInfo, b as BackupOwner, c as BackupRow, d as BackupsErrorCode, e as BackupsKeys, f as BackupsManager, g as BackupsNaming, h as BackupsSnapshot, K as KnownBackups, i as createBackupsManager } from './manager-BlSs6Q5S.js';
3
+ import { D as DriveOptions } from './drive-BLRsK32w.js';
4
4
  import './cache-ilsK3Tki.js';
5
- import './store-Cs6QIzzG.js';
5
+ import './store-DhrWMYg_.js';
6
6
  import './sync.js';
7
7
  import './machine-ALMkT3mk.js';
8
8
 
@@ -286,13 +286,29 @@ function createLocalStore(opts) {
286
286
  )
287
287
  };
288
288
  }
289
- async function buildBlob(pre) {
290
- if (requireEncryption && !encrypted && !group) {
289
+ async function buildBlob(pre, opts2) {
290
+ if (requireEncryption && (opts2?.plaintext || !encrypted && !group)) {
291
291
  throw new SelfstoreError(
292
292
  "ENCRYPTION_REQUIRED",
293
293
  "requireEncryption is set: refusing to build a plaintext backup."
294
294
  );
295
295
  }
296
+ if (opts2?.plaintext) {
297
+ if (locked()) {
298
+ throw new SelfstoreError(
299
+ "PASSWORD_REQUIRED",
300
+ "Cannot export a readable copy while locked - unlock first."
301
+ );
302
+ }
303
+ const snapshot = pre ?? await gather();
304
+ const stamp2 = Math.max(version, schemaCeiling);
305
+ const bytes2 = await writeBox(
306
+ { collections: snapshot.collections, files: snapshot.files },
307
+ { app, appVersion, schemaVersion: stamp2, readme },
308
+ { schemaVersion: stamp2, meta }
309
+ );
310
+ return new Blob([bytes2], { type: BACKUP_MIME });
311
+ }
296
312
  const snap = pre ?? await gather();
297
313
  let env;
298
314
  if (encrypted && !group) {
@@ -1393,8 +1409,8 @@ function createLocalStore(opts) {
1393
1409
  notify();
1394
1410
  }
1395
1411
  },
1396
- exportBlob() {
1397
- return buildBlob();
1412
+ exportBlob(opts2) {
1413
+ return buildBlob(void 0, opts2);
1398
1414
  },
1399
1415
  markDownloaded() {
1400
1416
  pendingDownload = false;
@@ -2140,5 +2156,5 @@ function gisDriveAuth(opts) {
2140
2156
  }
2141
2157
 
2142
2158
  export { RESERVED_STORE_MODES, createLocalStore, deriveStatus, gisDriveAuth, indexedDbCache, isLockableCache, isReservedStoreMode, memoryCache };
2143
- //# sourceMappingURL=chunk-TQH7ZYID.js.map
2144
- //# sourceMappingURL=chunk-TQH7ZYID.js.map
2159
+ //# sourceMappingURL=chunk-ULPGGZ6L.js.map
2160
+ //# sourceMappingURL=chunk-ULPGGZ6L.js.map