mindoodb 0.0.97 → 0.0.99

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 (166) hide show
  1. package/README-server.md +15 -0
  2. package/README.md +1 -0
  3. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +7 -0
  4. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
  5. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +17 -9
  6. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
  7. package/dist/appendonlystores/network/HttpTransport.d.ts.map +1 -1
  8. package/dist/appendonlystores/network/HttpTransport.js +1 -0
  9. package/dist/appendonlystores/network/HttpTransport.js.map +1 -1
  10. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +18 -0
  11. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
  12. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +41 -1
  13. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -1
  14. package/dist/browser/index.mjs +76 -0
  15. package/dist/core/BaseMindooDB.d.ts +2 -0
  16. package/dist/core/BaseMindooDB.d.ts.map +1 -1
  17. package/dist/core/BaseMindooDB.js +73 -53
  18. package/dist/core/BaseMindooDB.js.map +1 -1
  19. package/dist/core/BaseMindooTenant.d.ts +44 -1
  20. package/dist/core/BaseMindooTenant.d.ts.map +1 -1
  21. package/dist/core/BaseMindooTenant.js +176 -42
  22. package/dist/core/BaseMindooTenant.js.map +1 -1
  23. package/dist/core/BaseMindooTenantDirectory.d.ts +11 -0
  24. package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
  25. package/dist/core/BaseMindooTenantDirectory.js +137 -92
  26. package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
  27. package/dist/core/MindooDBServerAdmin.d.ts +1 -1
  28. package/dist/core/MindooDBServerAdmin.d.ts.map +1 -1
  29. package/dist/core/appendonlystores/migration/StoreMigration.d.ts +41 -1
  30. package/dist/core/appendonlystores/migration/StoreMigration.d.ts.map +1 -1
  31. package/dist/core/appendonlystores/migration/StoreMigration.js +126 -0
  32. package/dist/core/appendonlystores/migration/StoreMigration.js.map +1 -1
  33. package/dist/core/appendonlystores/sqlite/SqliteContentAddressedStore.d.ts.map +1 -1
  34. package/dist/core/appendonlystores/sqlite/SqliteContentAddressedStore.js +29 -0
  35. package/dist/core/appendonlystores/sqlite/SqliteContentAddressedStore.js.map +1 -1
  36. package/dist/core/appendonlystores/syncStores.d.ts +6 -0
  37. package/dist/core/appendonlystores/syncStores.d.ts.map +1 -1
  38. package/dist/core/appendonlystores/syncStores.js +21 -0
  39. package/dist/core/appendonlystores/syncStores.js.map +1 -1
  40. package/dist/core/appendonlystores/types.d.ts +8 -0
  41. package/dist/core/appendonlystores/types.d.ts.map +1 -1
  42. package/dist/core/appendonlystores/types.js.map +1 -1
  43. package/dist/core/builtinDbInvariants.d.ts +26 -1
  44. package/dist/core/builtinDbInvariants.d.ts.map +1 -1
  45. package/dist/core/builtinDbInvariants.js +52 -2
  46. package/dist/core/builtinDbInvariants.js.map +1 -1
  47. package/dist/core/index.d.ts +2 -0
  48. package/dist/core/index.d.ts.map +1 -1
  49. package/dist/core/index.js +3 -0
  50. package/dist/core/index.js.map +1 -1
  51. package/dist/core/joinrequests/crypto.d.ts +110 -0
  52. package/dist/core/joinrequests/crypto.d.ts.map +1 -0
  53. package/dist/core/joinrequests/crypto.js +340 -0
  54. package/dist/core/joinrequests/crypto.js.map +1 -0
  55. package/dist/core/joinrequests/index.d.ts +4 -0
  56. package/dist/core/joinrequests/index.d.ts.map +1 -0
  57. package/dist/core/joinrequests/index.js +29 -0
  58. package/dist/core/joinrequests/index.js.map +1 -0
  59. package/dist/core/joinrequests/invitations.d.ts +257 -0
  60. package/dist/core/joinrequests/invitations.d.ts.map +1 -0
  61. package/dist/core/joinrequests/invitations.js +703 -0
  62. package/dist/core/joinrequests/invitations.js.map +1 -0
  63. package/dist/core/joinrequests/types.d.ts +208 -0
  64. package/dist/core/joinrequests/types.d.ts.map +1 -0
  65. package/dist/core/joinrequests/types.js +43 -0
  66. package/dist/core/joinrequests/types.js.map +1 -0
  67. package/dist/core/recovery/PaperRescueDevice.d.ts +101 -0
  68. package/dist/core/recovery/PaperRescueDevice.d.ts.map +1 -0
  69. package/dist/core/recovery/PaperRescueDevice.js +205 -0
  70. package/dist/core/recovery/PaperRescueDevice.js.map +1 -0
  71. package/dist/core/recovery/RecoveryContactsDocument.d.ts +86 -0
  72. package/dist/core/recovery/RecoveryContactsDocument.d.ts.map +1 -0
  73. package/dist/core/recovery/RecoveryContactsDocument.js +91 -0
  74. package/dist/core/recovery/RecoveryContactsDocument.js.map +1 -0
  75. package/dist/core/recovery/RecoveryContactsManager.d.ts +176 -0
  76. package/dist/core/recovery/RecoveryContactsManager.d.ts.map +1 -0
  77. package/dist/core/recovery/RecoveryContactsManager.js +455 -0
  78. package/dist/core/recovery/RecoveryContactsManager.js.map +1 -0
  79. package/dist/core/recovery/index.d.ts +9 -0
  80. package/dist/core/recovery/index.d.ts.map +1 -0
  81. package/dist/core/recovery/index.js +48 -0
  82. package/dist/core/recovery/index.js.map +1 -0
  83. package/dist/core/recovery/recoverWithContacts.d.ts +56 -0
  84. package/dist/core/recovery/recoverWithContacts.d.ts.map +1 -0
  85. package/dist/core/recovery/recoverWithContacts.js +142 -0
  86. package/dist/core/recovery/recoverWithContacts.js.map +1 -0
  87. package/dist/core/recovery/recoveryPackage.d.ts +80 -0
  88. package/dist/core/recovery/recoveryPackage.d.ts.map +1 -0
  89. package/dist/core/recovery/recoveryPackage.js +182 -0
  90. package/dist/core/recovery/recoveryPackage.js.map +1 -0
  91. package/dist/core/recovery/rescueApproval.d.ts +39 -0
  92. package/dist/core/recovery/rescueApproval.d.ts.map +1 -0
  93. package/dist/core/recovery/rescueApproval.js +52 -0
  94. package/dist/core/recovery/rescueApproval.js.map +1 -0
  95. package/dist/core/recovery/rescueDevice.d.ts +51 -0
  96. package/dist/core/recovery/rescueDevice.d.ts.map +1 -0
  97. package/dist/core/recovery/rescueDevice.js +201 -0
  98. package/dist/core/recovery/rescueDevice.js.map +1 -0
  99. package/dist/core/recovery/shamir.d.ts +30 -0
  100. package/dist/core/recovery/shamir.d.ts.map +1 -0
  101. package/dist/core/recovery/shamir.js +133 -0
  102. package/dist/core/recovery/shamir.js.map +1 -0
  103. package/dist/core/types.d.ts +73 -1
  104. package/dist/core/types.d.ts.map +1 -1
  105. package/dist/core/types.js.map +1 -1
  106. package/dist/core/userkeys/UserKeyManager.d.ts +45 -0
  107. package/dist/core/userkeys/UserKeyManager.d.ts.map +1 -1
  108. package/dist/core/userkeys/UserKeyManager.js +121 -8
  109. package/dist/core/userkeys/UserKeyManager.js.map +1 -1
  110. package/dist/core/userkeys/generationSignature.d.ts +6 -0
  111. package/dist/core/userkeys/generationSignature.d.ts.map +1 -1
  112. package/dist/core/userkeys/generationSignature.js +1 -0
  113. package/dist/core/userkeys/generationSignature.js.map +1 -1
  114. package/dist/core/userkeys/resolveUserKeyDocument.d.ts.map +1 -1
  115. package/dist/core/userkeys/resolveUserKeyDocument.js +6 -6
  116. package/dist/core/userkeys/resolveUserKeyDocument.js.map +1 -1
  117. package/dist/core/userkeys/validateUserKeyDocument.d.ts +11 -1
  118. package/dist/core/userkeys/validateUserKeyDocument.d.ts.map +1 -1
  119. package/dist/core/userkeys/validateUserKeyDocument.js +18 -5
  120. package/dist/core/userkeys/validateUserKeyDocument.js.map +1 -1
  121. package/dist/node/appendonlystores/sqlite/FsBlobContentStore.d.ts +23 -0
  122. package/dist/node/appendonlystores/sqlite/FsBlobContentStore.d.ts.map +1 -0
  123. package/dist/node/appendonlystores/sqlite/FsBlobContentStore.js +119 -0
  124. package/dist/node/appendonlystores/sqlite/FsBlobContentStore.js.map +1 -0
  125. package/dist/node/appendonlystores/sqlite/NodeSqliteStore.d.ts +43 -0
  126. package/dist/node/appendonlystores/sqlite/NodeSqliteStore.d.ts.map +1 -0
  127. package/dist/node/appendonlystores/sqlite/NodeSqliteStore.js +121 -0
  128. package/dist/node/appendonlystores/sqlite/NodeSqliteStore.js.map +1 -0
  129. package/dist/node/appendonlystores/sqlite/ServerSqliteStore.d.ts +43 -0
  130. package/dist/node/appendonlystores/sqlite/ServerSqliteStore.d.ts.map +1 -0
  131. package/dist/node/appendonlystores/sqlite/ServerSqliteStore.js +279 -0
  132. package/dist/node/appendonlystores/sqlite/ServerSqliteStore.js.map +1 -0
  133. package/dist/node/server/MindooDBServer.d.ts +2 -0
  134. package/dist/node/server/MindooDBServer.d.ts.map +1 -1
  135. package/dist/node/server/MindooDBServer.js +46 -0
  136. package/dist/node/server/MindooDBServer.js.map +1 -1
  137. package/dist/node/server/StoreFactory.d.ts +5 -2
  138. package/dist/node/server/StoreFactory.d.ts.map +1 -1
  139. package/dist/node/server/StoreFactory.js +21 -4
  140. package/dist/node/server/StoreFactory.js.map +1 -1
  141. package/dist/node/server/TenantManager.d.ts +6 -0
  142. package/dist/node/server/TenantManager.d.ts.map +1 -1
  143. package/dist/node/server/TenantManager.js +17 -0
  144. package/dist/node/server/TenantManager.js.map +1 -1
  145. package/dist/node/server/server.js +2 -0
  146. package/dist/node/server/server.js.map +1 -1
  147. package/dist/server/JoinRequestService.d.ts +108 -0
  148. package/dist/server/JoinRequestService.d.ts.map +1 -0
  149. package/dist/server/JoinRequestService.js +454 -0
  150. package/dist/server/JoinRequestService.js.map +1 -0
  151. package/dist/server/TenantManager.d.ts +57 -1
  152. package/dist/server/TenantManager.d.ts.map +1 -1
  153. package/dist/server/TenantManager.js +273 -34
  154. package/dist/server/TenantManager.js.map +1 -1
  155. package/dist/server/http/MindooDBServerCore.d.ts +18 -0
  156. package/dist/server/http/MindooDBServerCore.d.ts.map +1 -1
  157. package/dist/server/http/MindooDBServerCore.js +230 -137
  158. package/dist/server/http/MindooDBServerCore.js.map +1 -1
  159. package/dist/server/serverConfig.d.ts.map +1 -1
  160. package/dist/server/serverConfig.js +17 -0
  161. package/dist/server/serverConfig.js.map +1 -1
  162. package/dist/server/types.d.ts +16 -1
  163. package/dist/server/types.d.ts.map +1 -1
  164. package/dist/server/types.js +6 -0
  165. package/dist/server/types.js.map +1 -1
  166. package/package.json +1 -1
@@ -87,6 +87,8 @@ export declare class BaseMindooTenant implements MindooTenant {
87
87
  /** Fire-and-forget work of this tenant; see {@link whenBackgroundIdle}. */
88
88
  private readonly backgroundTasks;
89
89
  private readonly userKeys;
90
+ private readonly recoveryContacts;
91
+ private readonly paperRescue;
90
92
  private readonly sealedGenerations;
91
93
  /** Per sealed key id: the bundle of the recipient block last opened. */
92
94
  private readonly sealedBlocks;
@@ -196,9 +198,39 @@ export declare class BaseMindooTenant implements MindooTenant {
196
198
  fingerprint: string;
197
199
  certificate: import("./userkeys/deviceCertificate").DeviceCertificatePayload;
198
200
  }>>;
201
+ setupRecoveryContacts(contacts: string[], options?: import("./recovery/RecoveryContactsManager").SetupRecoveryContactsOptions): Promise<import("./recovery/RecoveryContactsManager").SetupRecoveryContactsResult>;
202
+ getRecoveryContactsSetup(): Promise<import("./recovery/RecoveryContactsDocument").RecoveryContactsSetup | null>;
203
+ removeRecoveryContacts(options?: {
204
+ withdrawRescueDevices?: string[];
205
+ }): Promise<number>;
206
+ listRecoveryContactRequests(): Promise<import("./recovery/RecoveryContactsManager").RecoveryContactRequest[]>;
207
+ createRecoveryHelperPackage(person: string, options?: {
208
+ serverUrl?: string;
209
+ }): Promise<import("./recovery/recoveryPackage").RecoveryHelperPackage>;
210
+ canIssueDeviceCertificates(): Promise<boolean>;
211
+ listRescueDeviceSigningKeys(): Promise<Array<{
212
+ username: string;
213
+ signingPublicKey: string;
214
+ }>>;
215
+ createPaperRescueDevice(options?: {
216
+ label?: string;
217
+ allowAdminApproval?: boolean;
218
+ }): Promise<import("./recovery/PaperRescueDevice").CreatePaperRescueResult>;
219
+ listPaperRescueDevices(): Promise<import("./recovery/PaperRescueDevice").PaperRescueRecord[]>;
220
+ removePaperRescueDevices(): Promise<number>;
199
221
  reconcileUserKeys(options?: {
200
222
  allowSelfCreate?: boolean;
201
223
  }): Promise<UserKeyEnrollmentStatus>;
224
+ /**
225
+ * Wrap the User-Key to this person's own admin-approved rescue devices that
226
+ * reached the grant (docs/userkeys.md §12.9). Runs after every reconcile;
227
+ * the attestation in their `rcv_`/`rpp_` document is what allows skipping
228
+ * the approval dialog.
229
+ */
230
+ approveOwnRescueDevices(): Promise<number>;
231
+ private approveOwnRescueDevicesSafe;
232
+ getRecoveryContactsStatus(): Promise<import("./recovery/RecoveryContactsManager").RescueDeviceStatus | null>;
233
+ getPaperRescueStatus(): Promise<import("./recovery/RecoveryContactsManager").RescueDeviceStatus | null>;
202
234
  reconcileUserKeysSafe(): Promise<void>;
203
235
  getUserKeyEnrollmentStatus(): Promise<UserKeyEnrollmentStatus>;
204
236
  ensureLocalUserKeyPair(): Promise<void>;
@@ -372,7 +404,18 @@ export declare class BaseMindooTenant implements MindooTenant {
372
404
  * string. See {@link importedVerifyKeyCache}.
373
405
  */
374
406
  private importVerifyKeyCached;
375
- verifyEntrySignature(entry: StoreEntryMetadata, encryptedData: Uint8Array): Promise<boolean>;
407
+ /** Server keys allowed to sign `jr_` documents, cached briefly (docs/invitations.md). */
408
+ private joinRequestServerKeys;
409
+ /**
410
+ * Whether `publicKey` may sign join-request documents in `joinrequests`
411
+ * (docs/invitations.md): a trusted witness of the tenant, or the server an
412
+ * admin named in an invitation (`serverSigningPublicKey` of an `invite_`
413
+ * document in `directory`). Never consulted for any other database.
414
+ */
415
+ isJoinRequestServerKey(publicKey: string): Promise<boolean>;
416
+ verifyEntrySignature(entry: StoreEntryMetadata, encryptedData: Uint8Array, options?: {
417
+ dbId?: string;
418
+ }): Promise<boolean>;
376
419
  /**
377
420
  * Whether the storage-format floor (`requireMetadataSignatureSince`) requires
378
421
  * `entry` to carry the v2 metadata-binding signature, based on the entry's
@@ -1 +1 @@
1
- {"version":3,"file":"BaseM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,wCAAwC,CAC5C,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,MAAM,CAAC;IAiClB,oEAAoE;IACpE,OAAO,CAAC,4BAA4B;IAKpC;;;;;;OAMG;cACa,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA8B7E;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,qCAAqC,IAAI,OAAO;IAI1D;;;;;;;;;;OAUG;IACG,wBAAwB,CAC5B,OAAO,EAAE,UAAU,EACnB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,UAAU,CAAC;IAgEtB;;;;;;;OAOG;IACG,wBAAwB,CAC5B,gBAAgB,EAAE,UAAU,EAC5B,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,UAAU,CAAC;CA2DvB"}
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseMindooTenant = void 0;
4
- const types_1 = require("./types");
4
+ const types_1 = require("./joinrequests/types");
5
+ const types_2 = require("./types");
5
6
  const userid_1 = require("./userid");
6
7
  const AuthChallenge_1 = require("./crypto/AuthChallenge");
7
8
  const BaseMindooDB_1 = require("./BaseMindooDB");
8
9
  const BaseMindooTenantDirectory_1 = require("./BaseMindooTenantDirectory");
9
10
  const grantKeys_1 = require("./accesscontrol/grantKeys");
11
+ const PaperRescueDevice_1 = require("./recovery/PaperRescueDevice");
12
+ const RecoveryContactsManager_1 = require("./recovery/RecoveryContactsManager");
10
13
  const UserKeyManager_1 = require("./userkeys/UserKeyManager");
11
- const types_2 = require("./userkeys/types");
14
+ const types_3 = require("./userkeys/types");
12
15
  const validateUserKeyDocument_1 = require("./userkeys/validateUserKeyDocument");
13
16
  const sealedTypes_1 = require("./userkeys/sealedTypes");
14
17
  const recipients_1 = require("./userkeys/recipients");
@@ -123,6 +126,8 @@ class BaseMindooTenant {
123
126
  /** Fire-and-forget work of this tenant; see {@link whenBackgroundIdle}. */
124
127
  this.backgroundTasks = new BackgroundTaskTracker_1.BackgroundTaskTracker();
125
128
  this.userKeys = new UserKeyManager_1.UserKeyManager(this);
129
+ this.recoveryContacts = new RecoveryContactsManager_1.RecoveryContactsManager(this, this.userKeys);
130
+ this.paperRescue = new PaperRescueDevice_1.PaperRescueManager(this, this.userKeys);
126
131
  this.sealedGenerations = new Map();
127
132
  /** Per sealed key id: the bundle of the recipient block last opened. */
128
133
  this.sealedBlocks = new Map();
@@ -146,6 +151,8 @@ class BaseMindooTenant {
146
151
  this.directoryAdminResolver = null;
147
152
  /** Public keys derived from admin private keys handed to directory methods. */
148
153
  this.adminPublicKeyByPrivateKey = new WeakMap();
154
+ /** Server keys allowed to sign `jr_` documents, cached briefly (docs/invitations.md). */
155
+ this.joinRequestServerKeys = null;
149
156
  this.factory = factory;
150
157
  this.tenantId = tenantId;
151
158
  this.administrationPublicKey = administrationPublicKey;
@@ -399,8 +406,77 @@ class BaseMindooTenant {
399
406
  async listOwnDeviceCertificates() {
400
407
  return this.userKeys.listOwnDeviceCertificates();
401
408
  }
409
+ // ==================== Recovery contacts (docs/userkeys.md §12) ====================
410
+ async setupRecoveryContacts(contacts, options) {
411
+ return this.recoveryContacts.setup(contacts, options);
412
+ }
413
+ async getRecoveryContactsSetup() {
414
+ return this.recoveryContacts.getSetup();
415
+ }
416
+ async removeRecoveryContacts(options) {
417
+ return this.recoveryContacts.remove(options);
418
+ }
419
+ async listRecoveryContactRequests() {
420
+ return this.recoveryContacts.listRequests();
421
+ }
422
+ async createRecoveryHelperPackage(person, options) {
423
+ return this.recoveryContacts.createHelperPackage(person, options);
424
+ }
425
+ async canIssueDeviceCertificates() {
426
+ return this.userKeys.canIssueDeviceCertificates();
427
+ }
428
+ async listRescueDeviceSigningKeys() {
429
+ const paper = (await this.paperRescue.listAll()).map((r) => ({
430
+ username: r.payload.username,
431
+ signingPublicKey: r.payload.rescueDevice.signingPublicKey,
432
+ }));
433
+ return [...(await this.recoveryContacts.rescueDeviceSigningKeys()), ...paper];
434
+ }
435
+ async createPaperRescueDevice(options) {
436
+ return this.paperRescue.create(options);
437
+ }
438
+ async listPaperRescueDevices() {
439
+ return this.paperRescue.list();
440
+ }
441
+ async removePaperRescueDevices() {
442
+ return this.paperRescue.remove();
443
+ }
402
444
  async reconcileUserKeys(options) {
403
- return this.userKeys.reconcile(options);
445
+ const status = await this.userKeys.reconcile(options);
446
+ if (status.state === "approved")
447
+ await this.approveOwnRescueDevicesSafe();
448
+ return status;
449
+ }
450
+ /**
451
+ * Wrap the User-Key to this person's own admin-approved rescue devices that
452
+ * reached the grant (docs/userkeys.md §12.9). Runs after every reconcile;
453
+ * the attestation in their `rcv_`/`rpp_` document is what allows skipping
454
+ * the approval dialog.
455
+ */
456
+ async approveOwnRescueDevices() {
457
+ if (!(await this.hasDecryptionKey(types_2.DEFAULT_TENANT_KEY_ID)))
458
+ return 0;
459
+ const contacts = await this.recoveryContacts.ownRescueDevices();
460
+ if (!contacts.usernameHash)
461
+ return 0;
462
+ const paper = (await this.paperRescue.list()).map((r) => r.payload.rescueDevice);
463
+ return (0, RecoveryContactsManager_1.approveOwnRescueDevices)(this.userKeys, contacts.usernameHash, [...contacts.refs, ...paper]);
464
+ }
465
+ async approveOwnRescueDevicesSafe() {
466
+ try {
467
+ const approved = await this.approveOwnRescueDevices();
468
+ if (approved > 0)
469
+ this.logger.info(`Wrapped the User-Key to ${approved} own rescue device(s)`);
470
+ }
471
+ catch (error) {
472
+ this.logger.warn(`approveOwnRescueDevices: ${error}`);
473
+ }
474
+ }
475
+ async getRecoveryContactsStatus() {
476
+ return this.recoveryContacts.status();
477
+ }
478
+ async getPaperRescueStatus() {
479
+ return this.paperRescue.status();
404
480
  }
405
481
  async reconcileUserKeysSafe() {
406
482
  try {
@@ -660,7 +736,7 @@ class BaseMindooTenant {
660
736
  if (!this.directoryAdminResolver) {
661
737
  // Opening the directory registers the resolver. Never awaited from the
662
738
  // directory's own load path: that path uses its resolver directly.
663
- await this.openDB(types_1.DIRECTORY_DB_ID, { adminOnlyDb: true });
739
+ await this.openDB(types_2.DIRECTORY_DB_ID, { adminOnlyDb: true });
664
740
  }
665
741
  if (!this.directoryAdminResolver)
666
742
  return false;
@@ -786,9 +862,9 @@ class BaseMindooTenant {
786
862
  else {
787
863
  if (debugEnabled)
788
864
  this.logger.debug(`Resolving tenant encryption key from KeyBag`);
789
- const tenantKey = await this.keyBag.get("doc", this.tenantId, types_1.DEFAULT_TENANT_KEY_ID);
865
+ const tenantKey = await this.keyBag.get("doc", this.tenantId, types_2.DEFAULT_TENANT_KEY_ID);
790
866
  if (!tenantKey) {
791
- throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}`);
867
+ throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}`);
792
868
  }
793
869
  symmetricKey = tenantKey;
794
870
  this.decryptedTenantKeyCache = symmetricKey;
@@ -886,7 +962,7 @@ class BaseMindooTenant {
886
962
  // version is overwhelmingly the common case, so it is tried first.
887
963
  const candidates = await this.getDecryptionKeyCandidates(decryptionKeyId);
888
964
  if (candidates.length === 0) {
889
- throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
965
+ throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
890
966
  }
891
967
  const subtle = this.cryptoAdapter.getSubtle();
892
968
  let lastError = undefined;
@@ -927,7 +1003,7 @@ class BaseMindooTenant {
927
1003
  if ((0, sealedTypes_1.isSealedKeyId)(decryptionKeyId)) {
928
1004
  return this.sealedGenerations.get(decryptionKeyId) ?? [];
929
1005
  }
930
- const id = decryptionKeyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
1006
+ const id = decryptionKeyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
931
1007
  const versions = await this.keyBag.getAllKeys("doc", this.tenantId, id);
932
1008
  if (decryptionKeyId === "default" && versions.length > 0) {
933
1009
  this.decryptedTenantKeyCache = versions[0];
@@ -1053,7 +1129,57 @@ class BaseMindooTenant {
1053
1129
  this.importedVerifyKeyCache.set(publicKeyPem, cryptoKey);
1054
1130
  return cryptoKey;
1055
1131
  }
1056
- async verifyEntrySignature(entry, encryptedData) {
1132
+ /**
1133
+ * Whether `publicKey` may sign join-request documents in `joinrequests`
1134
+ * (docs/invitations.md): a trusted witness of the tenant, or the server an
1135
+ * admin named in an invitation (`serverSigningPublicKey` of an `invite_`
1136
+ * document in `directory`). Never consulted for any other database.
1137
+ */
1138
+ async isJoinRequestServerKey(publicKey) {
1139
+ const normalized = publicKey.replace(/\s+/g, "");
1140
+ const now = Date.now();
1141
+ const lookup = async () => {
1142
+ const keys = new Set();
1143
+ const directory = await this.openDirectory();
1144
+ try {
1145
+ if (typeof directory.getTrustedWitnessKeysAt === "function") {
1146
+ for (const key of await directory.getTrustedWitnessKeysAt(Number.MAX_SAFE_INTEGER)) {
1147
+ keys.add(key.replace(/\s+/g, ""));
1148
+ }
1149
+ }
1150
+ }
1151
+ catch (error) {
1152
+ this.logger.debug(`isJoinRequestServerKey: witness lookup failed: ${error}`);
1153
+ }
1154
+ try {
1155
+ const directoryDb = await this.openDB(types_2.DIRECTORY_DB_ID, { adminOnlyDb: true });
1156
+ for (const docId of await directoryDb.getAllDocumentIds()) {
1157
+ if (!docId.startsWith(types_1.INVITATION_DOC_ID_PREFIX))
1158
+ continue;
1159
+ const doc = await directoryDb.getDocument(docId).catch(() => null);
1160
+ const key = doc?.getData()?.serverSigningPublicKey;
1161
+ if (typeof key === "string" && key)
1162
+ keys.add(key.replace(/\s+/g, ""));
1163
+ }
1164
+ }
1165
+ catch (error) {
1166
+ this.logger.debug(`isJoinRequestServerKey: invitation lookup failed: ${error}`);
1167
+ }
1168
+ return keys;
1169
+ };
1170
+ if (!this.joinRequestServerKeys || now - this.joinRequestServerKeys.loadedAt > 30000) {
1171
+ this.joinRequestServerKeys = { loadedAt: now, keys: await lookup() };
1172
+ }
1173
+ if (this.joinRequestServerKeys.keys.has(normalized))
1174
+ return true;
1175
+ // A just-synced invitation: refresh once, at most every few seconds.
1176
+ if (now - this.joinRequestServerKeys.loadedAt > 3000) {
1177
+ this.joinRequestServerKeys = { loadedAt: now, keys: await lookup() };
1178
+ return this.joinRequestServerKeys.keys.has(normalized);
1179
+ }
1180
+ return false;
1181
+ }
1182
+ async verifyEntrySignature(entry, encryptedData, options) {
1057
1183
  // The author key must be trusted by the tenant directory.
1058
1184
  const directory = await this.openDirectory();
1059
1185
  // A delegated admin key (docs/accesscontrol.md §6.13) holds no grant. It is
@@ -1070,6 +1196,9 @@ class BaseMindooTenant {
1070
1196
  if (!isTrusted) {
1071
1197
  isTrusted = await directory.validatePublicSigningKey(entry.createdByPublicKey);
1072
1198
  }
1199
+ if (!isTrusted && options?.dbId === types_1.JOIN_REQUESTS_DB_ID) {
1200
+ isTrusted = await this.isJoinRequestServerKey(entry.createdByPublicKey);
1201
+ }
1073
1202
  if (!isTrusted) {
1074
1203
  this.logger.warn(`Public key not trusted: ${entry.createdByPublicKey}`);
1075
1204
  return false;
@@ -1224,8 +1353,8 @@ class BaseMindooTenant {
1224
1353
  // Every local database belonging to this tenant: the directory plus any
1225
1354
  // opened/known data databases. Wipe is a whole-tenant operation.
1226
1355
  const dbIds = new Set([
1227
- types_1.DIRECTORY_DB_ID,
1228
- types_1.USER_DIRECTORY_DB_ID,
1356
+ types_2.DIRECTORY_DB_ID,
1357
+ types_2.USER_DIRECTORY_DB_ID,
1229
1358
  ...this.databaseCache.keys(),
1230
1359
  ...(additionalDbIds ?? []),
1231
1360
  ]);
@@ -1281,13 +1410,17 @@ class BaseMindooTenant {
1281
1410
  }
1282
1411
  }
1283
1412
  async assertCurrentUserCanOpenDB(id) {
1284
- if (id === types_1.DIRECTORY_DB_ID || id === types_1.USER_DIRECTORY_DB_ID) {
1413
+ if (id === types_2.DIRECTORY_DB_ID || id === types_2.USER_DIRECTORY_DB_ID) {
1285
1414
  return;
1286
1415
  }
1287
1416
  const currentUser = await this.getCurrentUserId();
1288
1417
  if (await this.isAdminSigningKeyAt(currentUser.userSigningPublicKey, (0, timeSource_1.semanticNow)())) {
1289
1418
  return;
1290
1419
  }
1420
+ // The server's own tenant instance stores join requests (docs/invitations.md).
1421
+ if (id === types_1.JOIN_REQUESTS_DB_ID && (await this.isJoinRequestServerKey(currentUser.userSigningPublicKey))) {
1422
+ return;
1423
+ }
1291
1424
  const directory = await this.openDirectory();
1292
1425
  // Multi-device grants (§6.5) list several signing/encryption pairs. Matching
1293
1426
  // only the primary pair from getUserPublicKeys() rejects every later device.
@@ -1354,7 +1487,7 @@ class BaseMindooTenant {
1354
1487
  const validDbId = (0, databaseIdValidation_1.validateDatabaseId)(id, "dbId");
1355
1488
  // Enforce admin-only mode for directory database - this is a security invariant
1356
1489
  // The directory database must only accept entries signed by the admin key
1357
- const effectiveOptions = validDbId === types_1.DIRECTORY_DB_ID
1490
+ const effectiveOptions = validDbId === types_2.DIRECTORY_DB_ID
1358
1491
  ? { ...options, adminOnlyDb: true }
1359
1492
  : options ?? {};
1360
1493
  const normalizedTimeTravelDate = this.normalizeTimeTravelDate(effectiveOptions.timeTravelDate);
@@ -1364,7 +1497,7 @@ class BaseMindooTenant {
1364
1497
  await this.assertCurrentUserCanOpenDB(validDbId);
1365
1498
  const cached = this.databaseCache.get(databaseCacheKey);
1366
1499
  if (cached) {
1367
- if (validDbId === types_1.DIRECTORY_DB_ID && !cached.isAdminOnlyDb()) {
1500
+ if (validDbId === types_2.DIRECTORY_DB_ID && !cached.isAdminOnlyDb()) {
1368
1501
  throw new Error("Directory database was cached without adminOnlyDb - this should never happen");
1369
1502
  }
1370
1503
  if (normalizedTimeTravelDate == null) {
@@ -1623,7 +1756,7 @@ class BaseMindooTenant {
1623
1756
  continue;
1624
1757
  }
1625
1758
  sawTenantDocKeyChange = true;
1626
- if (event.keyId === types_1.DEFAULT_TENANT_KEY_ID) {
1759
+ if (event.keyId === types_2.DEFAULT_TENANT_KEY_ID) {
1627
1760
  // The cached plaintext default key may now refer to a rotated
1628
1761
  // or removed version; drop it so the next access re-resolves.
1629
1762
  this.decryptedTenantKeyCache = undefined;
@@ -1724,7 +1857,7 @@ class BaseMindooTenant {
1724
1857
  return { keyId, versions };
1725
1858
  }
1726
1859
  resolveJoinResponseDocKeyIds(_options) {
1727
- return [types_1.PUBLIC_INFOS_KEY_ID];
1860
+ return [types_2.PUBLIC_INFOS_KEY_ID];
1728
1861
  }
1729
1862
  async approveJoinRequest(joinRequest, options) {
1730
1863
  // Parse the join request if it's a URI string
@@ -1793,7 +1926,7 @@ class BaseMindooTenant {
1793
1926
  signingKeyPassword: options.adminPassword,
1794
1927
  });
1795
1928
  const payload = (0, validateUserKeyDocument_1.asUserKeyPayload)(userKeyDoc.getData());
1796
- const epoch = payload ? (0, types_2.currentUserKeyEpoch)(payload) : null;
1929
+ const epoch = payload ? (0, types_3.currentUserKeyEpoch)(payload) : null;
1797
1930
  const publishedPublicKey = epoch ? payload?.userKeys[epoch]?.publicKey : undefined;
1798
1931
  // First device: wrap the granted keys to the join-request User-Key
1799
1932
  // (pending is OK). Additional device: wrap to the already-published
@@ -1802,7 +1935,7 @@ class BaseMindooTenant {
1802
1935
  // (historical) or explicitly included it. A directory-only grant
1803
1936
  // (`[$publicinfos]`) must not quietly hand out the tenant key.
1804
1937
  const wrapDefault = options.sharedDocKeyIds === undefined ||
1805
- options.sharedDocKeyIds.includes(types_1.DEFAULT_TENANT_KEY_ID);
1938
+ options.sharedDocKeyIds.includes(types_2.DEFAULT_TENANT_KEY_ID);
1806
1939
  // The person's first device brings their device self-grant key. Only
1807
1940
  // then is it the person's own key; an additional device's request
1808
1941
  // carries a key nobody else holds (docs/userkeys.md §9).
@@ -1813,10 +1946,10 @@ class BaseMindooTenant {
1813
1946
  await directory.setDeviceSelfGrant(username, selfGrantKey, options.adminSigningKey, options.adminPassword);
1814
1947
  }
1815
1948
  if (wrapDefault && publishedPublicKey === userPublicKey) {
1816
- await directory.autoDistributeKeysToUser(username, [types_1.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword, userPublicKey);
1949
+ await directory.autoDistributeKeysToUser(username, [types_2.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword, userPublicKey);
1817
1950
  }
1818
1951
  else if (wrapDefault && publishedPublicKey) {
1819
- await directory.autoDistributeKeysToUser(username, [types_1.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1952
+ await directory.autoDistributeKeysToUser(username, [types_2.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1820
1953
  }
1821
1954
  }
1822
1955
  else {
@@ -1825,9 +1958,9 @@ class BaseMindooTenant {
1825
1958
  throw new Error("Cannot approve join request: it carries no userPublicKey and the person has no published User-Key. Generate a User-Key on the joining device first.");
1826
1959
  }
1827
1960
  const wrapDefault = options.sharedDocKeyIds === undefined ||
1828
- options.sharedDocKeyIds.includes(types_1.DEFAULT_TENANT_KEY_ID);
1961
+ options.sharedDocKeyIds.includes(types_2.DEFAULT_TENANT_KEY_ID);
1829
1962
  if (wrapDefault) {
1830
- await directory.autoDistributeKeysToUser(username, [types_1.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1963
+ await directory.autoDistributeKeysToUser(username, [types_2.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1831
1964
  }
1832
1965
  }
1833
1966
  // Same person: wrap the published User-Key to this device's encryption
@@ -1956,7 +2089,7 @@ class BaseMindooTenant {
1956
2089
  ...(label ? { label } : {}),
1957
2090
  ...(typeof options.validFrom === "number" ? { validFrom: options.validFrom } : {}),
1958
2091
  }, options.adminSigningKey, options.adminPassword);
1959
- const encryptedDocKeys = await Promise.all([types_1.DEFAULT_TENANT_KEY_ID, types_1.PUBLIC_INFOS_KEY_ID].map((keyId) => this.exportJoinResponseDocKeyVersions(keyId, request.encryptionPublicKey)));
2092
+ const encryptedDocKeys = await Promise.all([types_2.DEFAULT_TENANT_KEY_ID, types_2.PUBLIC_INFOS_KEY_ID].map((keyId) => this.exportJoinResponseDocKeyVersions(keyId, request.encryptionPublicKey)));
1960
2093
  const response = {
1961
2094
  v: 1,
1962
2095
  tenantId: this.tenantId,
@@ -1976,7 +2109,7 @@ class BaseMindooTenant {
1976
2109
  }
1977
2110
  else {
1978
2111
  try {
1979
- const directoryDb = await this.openDB(types_1.DIRECTORY_DB_ID, { adminOnlyDb: true });
2112
+ const directoryDb = await this.openDB(types_2.DIRECTORY_DB_ID, { adminOnlyDb: true });
1980
2113
  const setupLabel = await (0, tenantSetup_1.readTenantSetupLabel)(directoryDb, this);
1981
2114
  if (setupLabel)
1982
2115
  response.tenantLabel = setupLabel;
@@ -2009,7 +2142,7 @@ class BaseMindooTenant {
2009
2142
  }
2010
2143
  const baseUrl = serverUrl.replace(/\/$/, "");
2011
2144
  // Export the $publicinfos key so the server can read the directory DB
2012
- const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_1.PUBLIC_INFOS_KEY_ID);
2145
+ const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_2.PUBLIC_INFOS_KEY_ID);
2013
2146
  if (!publicInfosKeyBytes) {
2014
2147
  throw new Error(`Cannot publish to server: $publicinfos key not found in KeyBag`);
2015
2148
  }
@@ -2144,7 +2277,7 @@ class BaseMindooTenant {
2144
2277
  const transport = new IrohNetworkTransport(target.io, target.ticket, {
2145
2278
  tenantId: this.tenantId,
2146
2279
  });
2147
- const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_1.PUBLIC_INFOS_KEY_ID);
2280
+ const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_2.PUBLIC_INFOS_KEY_ID);
2148
2281
  if (!publicInfosKeyBytes) {
2149
2282
  throw new Error(`Cannot publish to server: $publicinfos key not found in KeyBag`);
2150
2283
  }
@@ -2251,13 +2384,13 @@ class BaseMindooTenant {
2251
2384
  /**
2252
2385
  * Create a remote store connected to a MindooDB server, ready for sync.
2253
2386
  */
2254
- async connectToServer(serverUrl, dbId, storeKind = types_1.StoreKind.docs, options) {
2387
+ async connectToServer(serverUrl, dbId, storeKind = types_2.StoreKind.docs, options) {
2255
2388
  const validDbId = (0, databaseIdValidation_1.validateDatabaseId)(dbId, "dbId");
2256
2389
  console.log(`[connectToServer] Connecting to server: ${serverUrl}, db: ${validDbId}, storeKind: ${storeKind}`);
2257
2390
  this.logger.info(`Connecting to server: ${serverUrl}, db: ${validDbId}, storeKind: ${storeKind}`);
2258
2391
  const normalizedServerUrl = serverUrl.replace(/\/$/, "");
2259
2392
  const irohTarget = this.resolveIrohDial(serverUrl, options);
2260
- const cacheKey = `${normalizedServerUrl}::${validDbId}::${storeKind}${irohTarget ? `::iroh:${irohTarget.ticket}` : ""}`;
2393
+ const cacheKey = `${normalizedServerUrl}::${validDbId}::${storeKind}${irohTarget ? `::iroh:${irohTarget.ticket}` : ""}${options?.authAs ? `::as:${options.authAs.signingPublicKey.replace(/\s+/g, "")}` : ""}`;
2261
2394
  const cachedStore = this.remoteStoreCache.get(cacheKey);
2262
2395
  if (cachedStore) {
2263
2396
  this.logger.debug(`Reusing cached remote store for ${normalizedServerUrl}, db: ${validDbId}`);
@@ -2278,13 +2411,14 @@ class BaseMindooTenant {
2278
2411
  dbId: validDbId,
2279
2412
  storeKind,
2280
2413
  }, this.logger.createChild("HttpTransport"));
2281
- // Get the current user's decrypted signing key
2282
- const signingKey = await this.getDecryptedSigningKey();
2414
+ // Get the current user's decrypted signing key (or the override's)
2415
+ const authAs = options?.authAs;
2416
+ const signingKey = authAs ? authAs.signingKey : await this.getDecryptedSigningKey();
2283
2417
  // Get the current user's decrypted RSA encryption private key (for decrypting entries)
2284
- const decryptedEncryptionKey = await this.getDecryptedEncryptionKey();
2418
+ const decryptedEncryptionKey = authAs ? authAs.encryptionKey : await this.getDecryptedEncryptionKey();
2285
2419
  // Create the client network store. Pass the device signing public key so
2286
2420
  // auth challenges can identify this specific device on multi-device grants.
2287
- const store = new ClientNetworkContentAddressedStore(validDbId, storeKind, transport, this.cryptoAdapter, this.currentUser.username, signingKey, decryptedEncryptionKey, this.logger.createChild(`ClientNetworkStore:${validDbId}:${storeKind}`), this.currentUser.userSigningKeyPair.publicKey);
2421
+ const store = new ClientNetworkContentAddressedStore(validDbId, storeKind, transport, this.cryptoAdapter, authAs ? (authAs.username ?? `$adminkey:${authAs.signingPublicKey.replace(/\s+/g, "")}`) : this.currentUser.username, signingKey, decryptedEncryptionKey, this.logger.createChild(`ClientNetworkStore:${validDbId}:${storeKind}`), authAs ? authAs.signingPublicKey : this.currentUser.userSigningKeyPair.publicKey);
2288
2422
  console.log(`[connectToServer] ✓ Connected to server for db "${validDbId}"`);
2289
2423
  this.logger.info(`Connected to server for db "${validDbId}"`);
2290
2424
  return store;
@@ -2522,7 +2656,7 @@ class BaseMindooTenant {
2522
2656
  * Returns true if a key was removed.
2523
2657
  */
2524
2658
  async removeNamedDecryptionKey(decryptionKeyId) {
2525
- if (decryptionKeyId === types_1.PUBLIC_INFOS_KEY_ID) {
2659
+ if (decryptionKeyId === types_2.PUBLIC_INFOS_KEY_ID) {
2526
2660
  this.logger.debug(`removeNamedDecryptionKey: refusing to delete the public-infos key`);
2527
2661
  return false;
2528
2662
  }
@@ -2598,7 +2732,7 @@ class BaseMindooTenant {
2598
2732
  }
2599
2733
  }
2600
2734
  let adoptedUsername;
2601
- if (imported.includes(types_1.DEFAULT_TENANT_KEY_ID) ||
2735
+ if (imported.includes(types_2.DEFAULT_TENANT_KEY_ID) ||
2602
2736
  imported.includes("default")) {
2603
2737
  adoptedUsername = await this.adoptRegisteredUsernameFromGrant(directory);
2604
2738
  }
@@ -2654,7 +2788,7 @@ class BaseMindooTenant {
2654
2788
  * run this — never the admin who later publishes the wrapped bytes.
2655
2789
  */
2656
2790
  async exportDecryptionKeyForDelivery(decryptionKeyId) {
2657
- const id = decryptionKeyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
2791
+ const id = decryptionKeyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
2658
2792
  const versions = await this.keyBag.getAllKeyVersions("doc", this.tenantId, id);
2659
2793
  if (versions.length === 0) {
2660
2794
  return null;
@@ -2680,7 +2814,7 @@ class BaseMindooTenant {
2680
2814
  * versions actually imported.
2681
2815
  */
2682
2816
  async importDeliveredDecryptionKeyVersions(keyId, versions) {
2683
- const id = keyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : keyId;
2817
+ const id = keyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : keyId;
2684
2818
  const scopedKeyId = `doc:${this.tenantId}:${id}`;
2685
2819
  const existing = await this.keyBag.listKeyDetails();
2686
2820
  const haveStamps = new Set(existing.filter((d) => d.scopedKeyId === scopedKeyId).map((d) => d.createdAt ?? 0));
@@ -2715,7 +2849,7 @@ class BaseMindooTenant {
2715
2849
  * caller's KeyBag lacks the key.
2716
2850
  */
2717
2851
  async fingerprintKeyVersions(keyId) {
2718
- const id = keyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : keyId;
2852
+ const id = keyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : keyId;
2719
2853
  const versions = await this.keyBag.getAllKeyVersions("doc", this.tenantId, id);
2720
2854
  const result = [];
2721
2855
  for (const v of versions) {
@@ -2737,14 +2871,14 @@ class BaseMindooTenant {
2737
2871
  * Returns the number of versions removed.
2738
2872
  */
2739
2873
  async removeDecryptionKeyVersionsByFingerprint(keyId, fingerprints) {
2740
- if (keyId === types_1.PUBLIC_INFOS_KEY_ID) {
2874
+ if (keyId === types_2.PUBLIC_INFOS_KEY_ID) {
2741
2875
  this.logger.debug(`removeDecryptionKeyVersionsByFingerprint: refusing protected key ${keyId}`);
2742
2876
  return 0;
2743
2877
  }
2744
2878
  const target = new Set(fingerprints);
2745
2879
  if (target.size === 0)
2746
2880
  return 0;
2747
- const id = keyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : keyId;
2881
+ const id = keyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : keyId;
2748
2882
  let removed = 0;
2749
2883
  // Re-read versions each pass: deleteKeyVersion is index-based against the
2750
2884
  // current sorted list, which shifts as entries are removed.
@@ -2795,9 +2929,9 @@ class BaseMindooTenant {
2795
2929
  if (this.decryptedTenantKeyCache) {
2796
2930
  return this.decryptedTenantKeyCache;
2797
2931
  }
2798
- const tenantKey = await this.keyBag.get("doc", this.tenantId, types_1.DEFAULT_TENANT_KEY_ID);
2932
+ const tenantKey = await this.keyBag.get("doc", this.tenantId, types_2.DEFAULT_TENANT_KEY_ID);
2799
2933
  if (!tenantKey) {
2800
- throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}`);
2934
+ throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}`);
2801
2935
  }
2802
2936
  const symmetricKey = tenantKey;
2803
2937
  this.decryptedTenantKeyCache = symmetricKey;
@@ -2913,7 +3047,7 @@ class BaseMindooTenant {
2913
3047
  // encrypted under an earlier rotation of the key still decrypt.
2914
3048
  const candidates = await this.getDecryptionKeyCandidates(decryptionKeyId);
2915
3049
  if (candidates.length === 0) {
2916
- throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
3050
+ throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
2917
3051
  }
2918
3052
  const subtle = this.cryptoAdapter.getSubtle();
2919
3053
  let lastError = undefined;