selfstore 1.6.2 → 1.6.4

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.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { n as Snapshot, E as EncodeOptions, H as Header, e as PasswordPolicy, B as BackupTarget, q as StatusDescriptor, t as StoreError, c as LocalStoreState, L as LocalStore } from './store-C20_6JBo.js';
2
- export { d as Mode, P as PasswordCheck, f as PasswordRequirement, S as SelfstoreError, l as SelfstoreErrorCode, m as Severity, o as SnapshotFile, p as StatusAction, s as StorageState, T as TargetKind, x as checkPasswordPolicy, C as errorLabelKey, G as isSelfstoreError } from './store-C20_6JBo.js';
1
+ import { n as Snapshot, E as EncodeOptions, H as Header, e as PasswordPolicy, B as BackupTarget, q as StatusDescriptor, t as StoreError, c as LocalStoreState, L as LocalStore } from './store-BQhcwSbe.js';
2
+ export { d as Mode, P as PasswordCheck, f as PasswordRequirement, S as SelfstoreError, l as SelfstoreErrorCode, m as Severity, o as SnapshotFile, p as StatusAction, s as StorageState, T as TargetKind, x as checkPasswordPolicy, C as errorLabelKey, G as isSelfstoreError } from './store-BQhcwSbe.js';
3
3
  import { L as LocalCache, K as KV } from './cache-ilsK3Tki.js';
4
4
  import { SyncConfig } from './sync.js';
5
- import { D as DriveAuth, W as WebdavConfig, S as S3Config } from './drive-BhiTdk-Q.js';
6
- export { c as changePassword, g as gisDriveAuth, p as pickFromDisk, s as saveToDisk } from './local-CwJPULbf.js';
5
+ import { D as DriveAuth, W as WebdavConfig, S as S3Config } from './drive-CO_mNEgi.js';
6
+ export { c as changePassword, g as gisDriveAuth, p as pickFromDisk, s as saveToDisk } from './local-hr_BimjH.js';
7
7
 
8
8
  declare const BACKUP_EXTENSION = ".zip";
9
9
  declare const BACKUP_MIME = "application/zip";
@@ -44,6 +44,21 @@ declare class EncryptedBackupBuilder extends BackupBuilder {
44
44
  constructor(snapshot: Snapshot, opts: EncodeOptions);
45
45
  /** Brand the README shipped inside the encrypted ZIP. */
46
46
  withReadme(text: string): EncryptedBackupBuilder;
47
+ /**
48
+ * A second secret that also opens this backup - a recovery code the user
49
+ * printed and put away.
50
+ *
51
+ * A password that only lives in one person's memory is the likeliest way a
52
+ * local-first backup dies: no server can reset it, so the day it is
53
+ * forgotten the data is gone for good. The envelope has always held several
54
+ * key slots (see `keys[]` in the header); this exposes them where a backup
55
+ * is actually written. Each secret wraps the SAME data key, so either one
56
+ * opens the file and neither can read the other.
57
+ *
58
+ * Call it more than once for more than one recovery secret. Reading needs no
59
+ * change: `restore(...).withPassword(code)` already tries every slot.
60
+ */
61
+ alsoOpenedWith(secret: string): EncryptedBackupBuilder;
47
62
  }
48
63
  declare class RestoreBuilder {
49
64
  private readonly input;
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { indexedDbCache, memoryCache, isLockableCache, createLocalStore } from './chunk-5QGCGAAI.js';
2
- export { gisDriveAuth } from './chunk-5QGCGAAI.js';
3
- import { saveToDisk } from './chunk-GZBCJXAX.js';
4
- export { pickFromDisk, saveToDisk } from './chunk-GZBCJXAX.js';
1
+ import { indexedDbCache, memoryCache, isLockableCache, createLocalStore } from './chunk-5L7JC2SH.js';
2
+ export { gisDriveAuth } from './chunk-5L7JC2SH.js';
3
+ import { saveToDisk } from './chunk-5W2G6DWU.js';
4
+ export { pickFromDisk, saveToDisk } from './chunk-5W2G6DWU.js';
5
5
  import './chunk-SKWHKM25.js';
6
6
  import { fromSession, fromSession2, fromSession3, connect4, connect3, isSupported, connect2, connect } from './chunk-WF732QXN.js';
7
- import { restore } from './chunk-2JJYLXAC.js';
8
- export { BACKUP_EXTENSION, BACKUP_MIME, backup, changePassword, checkPasswordPolicy, restore } from './chunk-2JJYLXAC.js';
7
+ import { restore } from './chunk-FEJC2WGL.js';
8
+ export { BACKUP_EXTENSION, BACKUP_MIME, backup, changePassword, checkPasswordPolicy, restore } from './chunk-FEJC2WGL.js';
9
9
  import './chunk-KHER6MWR.js';
10
10
  import './chunk-QBCU7OOP.js';
11
11
  import './chunk-6746AL4I.js';
@@ -0,0 +1,7 @@
1
+ export { downloadBlob, pickFromDisk, pickSaveHandle, saveToDisk, writeToHandle } from './chunk-5W2G6DWU.js';
2
+ import './chunk-FEJC2WGL.js';
3
+ import './chunk-KHER6MWR.js';
4
+ import './chunk-6746AL4I.js';
5
+ import './chunk-VBFMMR7Q.js';
6
+ //# sourceMappingURL=local-YUWUSQ5O.js.map
7
+ //# sourceMappingURL=local-YUWUSQ5O.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"local-F2NNXNBS.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"local-YUWUSQ5O.js"}
@@ -1,5 +1,5 @@
1
- import { n as Snapshot, E as EncodeOptions, H as Header } from './store-C20_6JBo.js';
2
- import { D as DriveAuth } from './drive-BhiTdk-Q.js';
1
+ import { n as Snapshot, E as EncodeOptions, H as Header } from './store-BQhcwSbe.js';
2
+ import { D as DriveAuth } from './drive-CO_mNEgi.js';
3
3
 
4
4
  /** Serialize a snapshot to a portable backup blob (compressed; encrypted if a password is given). */
5
5
  declare function exportSnapshot(snapshot: Snapshot, opts: EncodeOptions): Promise<Blob>;
@@ -138,6 +138,10 @@ interface EncodeOptions {
138
138
  dataKey: Uint8Array;
139
139
  slots: KeySlot[];
140
140
  };
141
+ /** Extra secrets that ALSO open this backup, each getting its own key slot
142
+ * around the same data key - typically a recovery code the user printed.
143
+ * Only meaningful alongside `password`. */
144
+ extraSecrets?: string[];
141
145
  }
142
146
 
143
147
  type SelfstoreErrorCode = 'BAD_FORMAT' | 'UNSUPPORTED_VERSION' | 'PASSWORD_REQUIRED' | 'DECRYPT_FAILED' | 'TOO_LARGE' | 'AUTH_EXPIRED' | 'TARGET_UNAVAILABLE' | 'TARGET_WRITE_FAILED' | 'TARGET_GONE' | 'NOT_CONNECTED' | 'WEAK_PASSWORD' | 'ENCRYPTION_REQUIRED' | 'UNEXPECTEDLY_UNENCRYPTED' | 'SCHEMA_TOO_NEW' | 'IDENTITY_REQUIRED' | 'SIGNATURE_INVALID' | 'NOT_A_RECIPIENT' | 'MANIFEST_ROLLBACK';
package/dist/widgets.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { S as StoreLike, C as ConnectTargets, a as ConnectFlowOptions, b as ConnectKind, c as ConnectFlow, d as ShareEngine, e as ShareLevel, f as ShareFlow, J as JoinEngine, g as JoinFlow, R as ReplicaFlow } from './flows-BBMVdP1S.js';
1
+ import { S as StoreLike, C as ConnectTargets, a as ConnectFlowOptions, b as ConnectKind, c as ConnectFlow, d as ShareEngine, e as ShareLevel, f as ShareFlow, J as JoinEngine, g as JoinFlow, R as ReplicaFlow } from './flows-DMy_Hbf-.js';
2
2
  import { BackupsManager } from './backups.js';
3
- import './store-C20_6JBo.js';
3
+ import './store-BQhcwSbe.js';
4
4
  import './cache-ilsK3Tki.js';
5
5
  import './sync.js';
6
- import './drive-BhiTdk-Q.js';
6
+ import './drive-CO_mNEgi.js';
7
7
  import './machine-ALMkT3mk.js';
8
8
 
9
9
  /** Flat key -> string map; widgets merge a partial override over EN defaults. */
package/dist/widgets.js CHANGED
@@ -1,6 +1,6 @@
1
- import { connectFlow, shareFlow, joinFlow } from './chunk-MNODL7RK.js';
1
+ import { connectFlow, shareFlow, joinFlow } from './chunk-D4FL5IPE.js';
2
2
  import { isOpenSupported } from './chunk-WF732QXN.js';
3
- import './chunk-2JJYLXAC.js';
3
+ import './chunk-FEJC2WGL.js';
4
4
  import './chunk-43BJDRPT.js';
5
5
  import './chunk-KHER6MWR.js';
6
6
  import './chunk-QBCU7OOP.js';
@@ -149,7 +149,7 @@ input[part~='input']:focus { outline: 2px solid var(--_accent); outline-offset:
149
149
  /* A field that keeps its name visible above the box, placeholders being hints
150
150
  and not labels. */
151
151
  label[part~='labelled'] { display: flex; flex-direction: column; gap: 0.2rem; width: 100%; }
152
- label[part~='labelled'] [part~='label'] { font-size: 0.85em; color: var(--_muted); }
152
+ label[part~='labelled'] [part~='label'] { font-size: 0.85em; color: var(--_ink-dim); }
153
153
  /* A text input with a trailing button (the password eye) tucked inside it. */
154
154
  [part~='field'] { position: relative; display: flex; align-items: center; width: 100%; }
155
155
  [part~='field'] input[part~='input'] { padding-right: 2.4rem; }