mindoodb 0.0.2 → 0.0.3

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 (172) hide show
  1. package/README.md +92 -19
  2. package/dist/__mocks__/expo-standard-web-crypto.d.ts +10 -0
  3. package/dist/__mocks__/expo-standard-web-crypto.d.ts.map +1 -0
  4. package/dist/__mocks__/expo-standard-web-crypto.js +22 -0
  5. package/dist/__mocks__/expo-standard-web-crypto.js.map +1 -0
  6. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.d.ts +8 -0
  7. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.d.ts.map +1 -0
  8. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.js +16 -0
  9. package/dist/appendonlystores/BasicOnDiskContentAddressedStoreFactory.js.map +1 -0
  10. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts +1 -1
  11. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.d.ts.map +1 -1
  12. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js +2 -2
  13. package/dist/appendonlystores/InMemoryContentAddressedStoreFactory.js.map +1 -1
  14. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +11 -1
  15. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
  16. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +94 -0
  17. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
  18. package/dist/appendonlystores/network/HttpTransport.d.ts +13 -2
  19. package/dist/appendonlystores/network/HttpTransport.d.ts.map +1 -1
  20. package/dist/appendonlystores/network/HttpTransport.js +86 -0
  21. package/dist/appendonlystores/network/HttpTransport.js.map +1 -1
  22. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +19 -2
  23. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
  24. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +96 -0
  25. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -1
  26. package/dist/appendonlystores/network/index.d.ts +1 -1
  27. package/dist/appendonlystores/network/index.d.ts.map +1 -1
  28. package/dist/appendonlystores/network/index.js.map +1 -1
  29. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.d.ts +61 -0
  30. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.d.ts.map +1 -0
  31. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.js +685 -0
  32. package/dist/browser/appendonlystores/IndexedDBContentAddressedStore.js.map +1 -0
  33. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.d.ts +25 -0
  34. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.d.ts.map +1 -0
  35. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.js +41 -0
  36. package/dist/browser/appendonlystores/IndexedDBContentAddressedStoreFactory.js.map +1 -0
  37. package/dist/browser/index.d.ts +5 -0
  38. package/dist/browser/index.d.ts.map +1 -1
  39. package/dist/browser/index.js +13 -1
  40. package/dist/browser/index.js.map +1 -1
  41. package/dist/core/BaseMindooDB.d.ts +12 -0
  42. package/dist/core/BaseMindooDB.d.ts.map +1 -1
  43. package/dist/core/BaseMindooDB.js +210 -108
  44. package/dist/core/BaseMindooDB.js.map +1 -1
  45. package/dist/core/BaseMindooTenant.d.ts +40 -6
  46. package/dist/core/BaseMindooTenant.d.ts.map +1 -1
  47. package/dist/core/BaseMindooTenant.js +179 -21
  48. package/dist/core/BaseMindooTenant.js.map +1 -1
  49. package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
  50. package/dist/core/BaseMindooTenantDirectory.js +10 -0
  51. package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
  52. package/dist/core/BaseMindooTenantFactory.d.ts +22 -28
  53. package/dist/core/BaseMindooTenantFactory.d.ts.map +1 -1
  54. package/dist/core/BaseMindooTenantFactory.js +161 -65
  55. package/dist/core/BaseMindooTenantFactory.js.map +1 -1
  56. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +68 -0
  57. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  58. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js +659 -0
  59. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  60. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts +43 -3
  61. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts.map +1 -1
  62. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js +162 -23
  63. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js.map +1 -1
  64. package/dist/core/appendonlystores/bloom.d.ts +85 -0
  65. package/dist/core/appendonlystores/bloom.d.ts.map +1 -0
  66. package/dist/core/appendonlystores/bloom.js +228 -0
  67. package/dist/core/appendonlystores/bloom.js.map +1 -0
  68. package/dist/core/appendonlystores/network/NetworkTransport.d.ts +22 -2
  69. package/dist/core/appendonlystores/network/NetworkTransport.d.ts.map +1 -1
  70. package/dist/core/appendonlystores/network/types.d.ts +10 -0
  71. package/dist/core/appendonlystores/network/types.d.ts.map +1 -1
  72. package/dist/core/appendonlystores/network/types.js.map +1 -1
  73. package/dist/core/appendonlystores/types.d.ts +123 -0
  74. package/dist/core/appendonlystores/types.d.ts.map +1 -1
  75. package/dist/core/automerge-adapter.d.ts +15 -0
  76. package/dist/core/automerge-adapter.d.ts.map +1 -0
  77. package/dist/core/automerge-adapter.js +73 -0
  78. package/dist/core/automerge-adapter.js.map +1 -0
  79. package/dist/core/crypto/pbkdf2Iterations.d.ts +12 -0
  80. package/dist/core/crypto/pbkdf2Iterations.d.ts.map +1 -0
  81. package/dist/core/crypto/pbkdf2Iterations.js +55 -0
  82. package/dist/core/crypto/pbkdf2Iterations.js.map +1 -0
  83. package/dist/core/index.d.ts +7 -2
  84. package/dist/core/index.d.ts.map +1 -1
  85. package/dist/core/index.js +30 -1
  86. package/dist/core/index.js.map +1 -1
  87. package/dist/core/keys/KeyBag.d.ts +32 -12
  88. package/dist/core/keys/KeyBag.d.ts.map +1 -1
  89. package/dist/core/keys/KeyBag.js +86 -26
  90. package/dist/core/keys/KeyBag.js.map +1 -1
  91. package/dist/core/keys/KeyContext.d.ts +4 -0
  92. package/dist/core/keys/KeyContext.d.ts.map +1 -0
  93. package/dist/core/keys/KeyContext.js +11 -0
  94. package/dist/core/keys/KeyContext.js.map +1 -0
  95. package/dist/core/types.d.ts +218 -50
  96. package/dist/core/types.d.ts.map +1 -1
  97. package/dist/core/types.js +2 -0
  98. package/dist/core/types.js.map +1 -1
  99. package/dist/core/uri/MindooURI.d.ts +58 -0
  100. package/dist/core/uri/MindooURI.d.ts.map +1 -0
  101. package/dist/core/uri/MindooURI.js +169 -0
  102. package/dist/core/uri/MindooURI.js.map +1 -0
  103. package/dist/core/userid/index.d.ts +0 -10
  104. package/dist/core/userid/index.d.ts.map +1 -1
  105. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +541 -0
  106. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  107. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js +1334 -0
  108. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  109. package/dist/node/index.d.ts +1 -0
  110. package/dist/node/index.d.ts.map +1 -1
  111. package/dist/node/index.js +5 -1
  112. package/dist/node/index.js.map +1 -1
  113. package/dist/reactnative/crypto/AESAdapter.d.ts +18 -0
  114. package/dist/reactnative/crypto/AESAdapter.d.ts.map +1 -0
  115. package/dist/reactnative/crypto/AESAdapter.js +112 -0
  116. package/dist/reactnative/crypto/AESAdapter.js.map +1 -0
  117. package/dist/reactnative/crypto/Ed25519Adapter.d.ts +34 -0
  118. package/dist/reactnative/crypto/Ed25519Adapter.d.ts.map +1 -0
  119. package/dist/reactnative/crypto/Ed25519Adapter.js +386 -0
  120. package/dist/reactnative/crypto/Ed25519Adapter.js.map +1 -0
  121. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts +23 -0
  122. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts.map +1 -0
  123. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js +51 -0
  124. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js.map +1 -0
  125. package/dist/reactnative/crypto/HMACAdapter.d.ts +13 -0
  126. package/dist/reactnative/crypto/HMACAdapter.d.ts.map +1 -0
  127. package/dist/reactnative/crypto/HMACAdapter.js +50 -0
  128. package/dist/reactnative/crypto/HMACAdapter.js.map +1 -0
  129. package/dist/reactnative/crypto/KeyFormatConverter.d.ts +21 -0
  130. package/dist/reactnative/crypto/KeyFormatConverter.d.ts.map +1 -0
  131. package/dist/reactnative/crypto/KeyFormatConverter.js +72 -0
  132. package/dist/reactnative/crypto/KeyFormatConverter.js.map +1 -0
  133. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts +19 -0
  134. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts.map +1 -0
  135. package/dist/reactnative/crypto/PBKDF2Adapter.js +67 -0
  136. package/dist/reactnative/crypto/PBKDF2Adapter.js.map +1 -0
  137. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts +37 -0
  138. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts.map +1 -0
  139. package/dist/reactnative/crypto/QuickCryptoAdapter.js +72 -0
  140. package/dist/reactnative/crypto/QuickCryptoAdapter.js.map +1 -0
  141. package/dist/reactnative/crypto/RSAAdapter.d.ts +38 -0
  142. package/dist/reactnative/crypto/RSAAdapter.d.ts.map +1 -0
  143. package/dist/reactnative/crypto/RSAAdapter.js +184 -0
  144. package/dist/reactnative/crypto/RSAAdapter.js.map +1 -0
  145. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts +33 -0
  146. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts.map +1 -0
  147. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js +61 -0
  148. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js.map +1 -0
  149. package/dist/reactnative/crypto/SHA256Adapter.d.ts +9 -0
  150. package/dist/reactnative/crypto/SHA256Adapter.d.ts.map +1 -0
  151. package/dist/reactnative/crypto/SHA256Adapter.js +29 -0
  152. package/dist/reactnative/crypto/SHA256Adapter.js.map +1 -0
  153. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts +63 -0
  154. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts.map +1 -0
  155. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js +350 -0
  156. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js.map +1 -0
  157. package/dist/reactnative/index.d.ts +8 -0
  158. package/dist/reactnative/index.d.ts.map +1 -0
  159. package/dist/reactnative/index.js +38 -0
  160. package/dist/reactnative/index.js.map +1 -0
  161. package/package.json +51 -6
  162. package/patches/PATCHES.md +111 -0
  163. package/patches/react-native+0.76.9.patch +34 -0
  164. package/patches/react-native-quick-crypto+1.0.7.patch +42 -0
  165. package/scripts/cli.js +21 -0
  166. package/scripts/setup-react-native.js +228 -0
  167. package/templates/reactnative/App.js +252 -0
  168. package/templates/reactnative/app.json +29 -0
  169. package/templates/reactnative/babel.config.js +6 -0
  170. package/templates/reactnative/index.js +26 -0
  171. package/templates/reactnative/metro.config.snippet.js +39 -0
  172. package/templates/reactnative/mindoodb-polyfills.js +116 -0
@@ -1,14 +1,19 @@
1
1
  export * from "./types";
2
2
  export { PublicUserId, PrivateUserId } from "./userid";
3
+ export { BaseMindooDB } from "./BaseMindooDB";
4
+ export { BaseMindooTenant } from "./BaseMindooTenant";
5
+ export { BaseMindooTenantFactory } from "./BaseMindooTenantFactory";
3
6
  export { CryptoAdapter } from "./crypto/CryptoAdapter";
4
7
  export { RSAEncryption } from "./crypto/RSAEncryption";
5
8
  export { MindooDocSigner } from "./crypto/MindooDocSigner";
6
9
  export { KeyBag } from "./keys/KeyBag";
10
+ export { encodeMindooURI, decodeMindooURI, isMindooURI, type MindooURIType, type DecodedMindooURI, } from "./uri/MindooURI";
7
11
  export { SymmetricKeyNotFoundError } from "./errors";
8
12
  export { generateDocEntryId, generateDepsFingerprint, generateAttachmentChunkId, generateFileUuid7, generateChunkUuid7, parseDocEntryId, parseAttachmentChunkId, isDocEntryId, isAttachmentChunkId, extractDocIdFromEntryId, computeContentHash, } from "./utils";
9
- export { ContentAddressedStore, ContentAddressedStoreFactory, CreateStoreResult, OpenStoreOptions } from "./appendonlystores/types";
13
+ export { ContentAddressedStore, ContentAddressedStoreFactory, CreateStoreResult, OpenStoreOptions, StoreCompactionStatus, StoreScanCursor, StoreScanFilters, StoreScanResult, StoreIdBloomSummary, } from "./appendonlystores/types";
10
14
  export { InMemoryContentAddressedStore, InMemoryContentAddressedStoreFactory } from "./appendonlystores/InMemoryContentAddressedStore";
11
15
  export { AuthenticationService } from "./appendonlystores/network/AuthenticationService";
12
16
  export { NetworkTransport, NetworkTransportConfig } from "./appendonlystores/network/NetworkTransport";
13
- export { NetworkEncryptedEntry, UserPublicKeys, NetworkAuthTokenPayload, AuthChallenge, AuthResult, NetworkErrorType, NetworkError, } from "./appendonlystores/network/types";
17
+ export { NetworkEncryptedEntry, UserPublicKeys, NetworkAuthTokenPayload, AuthChallenge, AuthResult, NetworkSyncCapabilities, NetworkErrorType, NetworkError, } from "./appendonlystores/network/types";
18
+ export { VirtualView, VirtualViewFactory, VirtualViewBuilder, VirtualViewNavigatorBuilder, VirtualViewColumn, VirtualViewNavigator, VirtualViewEntryData, VirtualViewDataChange, MindooDBVirtualViewDataProvider, ColumnSorting, TotalMode, CategorizationStyle, WithCategories, WithDocuments, SelectedOnly, type VirtualViewColumnOptions, type IVirtualViewDataProvider, type MindooDBVirtualViewDataProviderOptions, type ScopedDocId, type ColumnValueFunction, type DocumentFilterFunction, } from "./indexing/virtualviews";
14
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvC,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACpI,OAAO,EAAE,6BAA6B,EAAE,oCAAoC,EAAE,MAAM,kDAAkD,CAAC;AAGvI,OAAO,EAAE,qBAAqB,EAAE,MAAM,kDAAkD,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AACvG,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,YAAY,GACb,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAGA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,M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BAAqB,EACrB,+BAA+B,EAC/B,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,sCAAsC,EAC3C,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,GAC5B,MAAM,yBAAyB,CAAC"}
@@ -15,9 +15,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.NetworkError = exports.NetworkErrorType = exports.AuthenticationService = exports.InMemoryContentAddressedStoreFactory = exports.InMemoryContentAddressedStore = exports.computeContentHash = exports.extractDocIdFromEntryId = exports.isAttachmentChunkId = exports.isDocEntryId = exports.parseAttachmentChunkId = exports.parseDocEntryId = exports.generateChunkUuid7 = exports.generateFileUuid7 = exports.generateAttachmentChunkId = exports.generateDepsFingerprint = exports.generateDocEntryId = exports.SymmetricKeyNotFoundError = exports.KeyBag = exports.MindooDocSigner = exports.RSAEncryption = void 0;
18
+ exports.SelectedOnly = exports.WithDocuments = exports.WithCategories = exports.CategorizationStyle = exports.TotalMode = exports.ColumnSorting = exports.MindooDBVirtualViewDataProvider = exports.VirtualViewDataChange = exports.VirtualViewEntryData = exports.VirtualViewNavigator = exports.VirtualViewColumn = exports.VirtualViewNavigatorBuilder = exports.VirtualViewBuilder = exports.VirtualViewFactory = exports.VirtualView = exports.NetworkError = exports.NetworkErrorType = exports.AuthenticationService = exports.InMemoryContentAddressedStoreFactory = exports.InMemoryContentAddressedStore = exports.computeContentHash = exports.extractDocIdFromEntryId = exports.isAttachmentChunkId = exports.isDocEntryId = exports.parseAttachmentChunkId = exports.parseDocEntryId = exports.generateChunkUuid7 = exports.generateFileUuid7 = exports.generateAttachmentChunkId = exports.generateDepsFingerprint = exports.generateDocEntryId = exports.SymmetricKeyNotFoundError = exports.isMindooURI = exports.decodeMindooURI = exports.encodeMindooURI = exports.KeyBag = exports.MindooDocSigner = exports.RSAEncryption = exports.BaseMindooTenantFactory = exports.BaseMindooTenant = exports.BaseMindooDB = void 0;
19
19
  // Types
20
20
  __exportStar(require("./types"), exports);
21
+ // Base classes
22
+ var BaseMindooDB_1 = require("./BaseMindooDB");
23
+ Object.defineProperty(exports, "BaseMindooDB", { enumerable: true, get: function () { return BaseMindooDB_1.BaseMindooDB; } });
24
+ var BaseMindooTenant_1 = require("./BaseMindooTenant");
25
+ Object.defineProperty(exports, "BaseMindooTenant", { enumerable: true, get: function () { return BaseMindooTenant_1.BaseMindooTenant; } });
26
+ var BaseMindooTenantFactory_1 = require("./BaseMindooTenantFactory");
27
+ Object.defineProperty(exports, "BaseMindooTenantFactory", { enumerable: true, get: function () { return BaseMindooTenantFactory_1.BaseMindooTenantFactory; } });
21
28
  var RSAEncryption_1 = require("./crypto/RSAEncryption");
22
29
  Object.defineProperty(exports, "RSAEncryption", { enumerable: true, get: function () { return RSAEncryption_1.RSAEncryption; } });
23
30
  var MindooDocSigner_1 = require("./crypto/MindooDocSigner");
@@ -25,6 +32,11 @@ Object.defineProperty(exports, "MindooDocSigner", { enumerable: true, get: funct
25
32
  // Keys
26
33
  var KeyBag_1 = require("./keys/KeyBag");
27
34
  Object.defineProperty(exports, "KeyBag", { enumerable: true, get: function () { return KeyBag_1.KeyBag; } });
35
+ // URI
36
+ var MindooURI_1 = require("./uri/MindooURI");
37
+ Object.defineProperty(exports, "encodeMindooURI", { enumerable: true, get: function () { return MindooURI_1.encodeMindooURI; } });
38
+ Object.defineProperty(exports, "decodeMindooURI", { enumerable: true, get: function () { return MindooURI_1.decodeMindooURI; } });
39
+ Object.defineProperty(exports, "isMindooURI", { enumerable: true, get: function () { return MindooURI_1.isMindooURI; } });
28
40
  // Errors
29
41
  var errors_1 = require("./errors");
30
42
  Object.defineProperty(exports, "SymmetricKeyNotFoundError", { enumerable: true, get: function () { return errors_1.SymmetricKeyNotFoundError; } });
@@ -50,4 +62,21 @@ Object.defineProperty(exports, "AuthenticationService", { enumerable: true, get:
50
62
  var types_1 = require("./appendonlystores/network/types");
51
63
  Object.defineProperty(exports, "NetworkErrorType", { enumerable: true, get: function () { return types_1.NetworkErrorType; } });
52
64
  Object.defineProperty(exports, "NetworkError", { enumerable: true, get: function () { return types_1.NetworkError; } });
65
+ // Indexing - Virtual Views
66
+ var virtualviews_1 = require("./indexing/virtualviews");
67
+ Object.defineProperty(exports, "VirtualView", { enumerable: true, get: function () { return virtualviews_1.VirtualView; } });
68
+ Object.defineProperty(exports, "VirtualViewFactory", { enumerable: true, get: function () { return virtualviews_1.VirtualViewFactory; } });
69
+ Object.defineProperty(exports, "VirtualViewBuilder", { enumerable: true, get: function () { return virtualviews_1.VirtualViewBuilder; } });
70
+ Object.defineProperty(exports, "VirtualViewNavigatorBuilder", { enumerable: true, get: function () { return virtualviews_1.VirtualViewNavigatorBuilder; } });
71
+ Object.defineProperty(exports, "VirtualViewColumn", { enumerable: true, get: function () { return virtualviews_1.VirtualViewColumn; } });
72
+ Object.defineProperty(exports, "VirtualViewNavigator", { enumerable: true, get: function () { return virtualviews_1.VirtualViewNavigator; } });
73
+ Object.defineProperty(exports, "VirtualViewEntryData", { enumerable: true, get: function () { return virtualviews_1.VirtualViewEntryData; } });
74
+ Object.defineProperty(exports, "VirtualViewDataChange", { enumerable: true, get: function () { return virtualviews_1.VirtualViewDataChange; } });
75
+ Object.defineProperty(exports, "MindooDBVirtualViewDataProvider", { enumerable: true, get: function () { return virtualviews_1.MindooDBVirtualViewDataProvider; } });
76
+ Object.defineProperty(exports, "ColumnSorting", { enumerable: true, get: function () { return virtualviews_1.ColumnSorting; } });
77
+ Object.defineProperty(exports, "TotalMode", { enumerable: true, get: function () { return virtualviews_1.TotalMode; } });
78
+ Object.defineProperty(exports, "CategorizationStyle", { enumerable: true, get: function () { return virtualviews_1.CategorizationStyle; } });
79
+ Object.defineProperty(exports, "WithCategories", { enumerable: true, get: function () { return virtualviews_1.WithCategories; } });
80
+ Object.defineProperty(exports, "WithDocuments", { enumerable: true, get: function () { return virtualviews_1.WithDocuments; } });
81
+ Object.defineProperty(exports, "SelectedOnly", { enumerable: true, get: function () { return virtualviews_1.SelectedOnly; } });
53
82
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;;;;;;;;;;;;;;;AAEjC,QAAQ;AACR,0CAAwB;AAOxB,wDAAuD;AAA9C,8GAAA,aAAa,OAAA;AACtB,4DAA2D;AAAlD,kHAAA,eAAe,OAAA;AAExB,OAAO;AACP,wCAAuC;AAA9B,gGAAA,MAAM,OAAA;AAEf,SAAS;AACT,mCAAqD;AAA5C,mHAAA,yBAAyB,OAAA;AAElC,YAAY;AACZ,iCAYiB;AAXf,2GAAA,kBAAkB,OAAA;AAClB,gHAAA,uBAAuB,OAAA;AACvB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA;AACjB,2GAAA,kBAAkB,OAAA;AAClB,wGAAA,eAAe,OAAA;AACf,+GAAA,sBAAsB,OAAA;AACtB,qGAAA,YAAY,OAAA;AACZ,4GAAA,mBAAmB,OAAA;AACnB,gHAAA,uBAAuB,OAAA;AACvB,2GAAA,kBAAkB,OAAA;AAKpB,kGAAuI;AAA9H,8IAAA,6BAA6B,OAAA;AAAE,qJAAA,oCAAoC,OAAA;AAE5E,UAAU;AACV,0FAAyF;AAAhF,8HAAA,qBAAqB,OAAA;AAE9B,0DAQ0C;AAFxC,yGAAA,gBAAgB,OAAA;AAChB,qGAAA,YAAY,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AAAA,iCAAiC;;;;;;;;;;;;;;;;;AAEjC,QAAQ;AACR,0CAAwB;AAKxB,eAAe;AACf,+CAA8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,yGAAA,SAAS,OAAA;AACT,mHAAA,mBAAmB,OAAA;AACnB,8GAAA,cAAc,OAAA;AACd,6GAAA,aAAa,OAAA;AACb,4GAAA,YAAY,OAAA"}
@@ -1,4 +1,5 @@
1
1
  import { EncryptedPrivateKey } from "../types";
2
+ import { KeyType } from "./KeyContext";
2
3
  import { CryptoAdapter } from "../crypto/CryptoAdapter";
3
4
  import { Logger } from "../logging";
4
5
  /**
@@ -28,7 +29,7 @@ export declare class KeyBag {
28
29
  * @param keyId The ID of the key to read
29
30
  * @return The exported key, or null if not found
30
31
  */
31
- get(keyId: string): Promise<Uint8Array | null>;
32
+ get(type: KeyType, id: string): Promise<Uint8Array | null>;
32
33
  /**
33
34
  * Gets all keys for a given keyId, sorted by createdAt (newest first).
34
35
  * Useful for trying multiple keys during decryption (key rotation support).
@@ -36,7 +37,7 @@ export declare class KeyBag {
36
37
  * @param keyId The ID of the keys to read
37
38
  * @return Array of keys sorted by createdAt (newest first), or empty array if not found
38
39
  */
39
- getAllKeys(keyId: string): Promise<Uint8Array[]>;
40
+ getAllKeys(type: KeyType, id: string): Promise<Uint8Array[]>;
40
41
  /**
41
42
  * Sets a key in the key bag.
42
43
  * Adds the key to the array of keys for this keyId (supports key rotation).
@@ -45,42 +46,57 @@ export declare class KeyBag {
45
46
  * @param key The key bytes
46
47
  * @param createdAt Optional creation timestamp (milliseconds since Unix epoch)
47
48
  */
48
- set(keyId: string, key: Uint8Array, createdAt?: number): Promise<void>;
49
+ set(type: KeyType, id: string, key: Uint8Array, createdAt?: number): Promise<void>;
50
+ /**
51
+ * Creates a new tenant symmetric key (AES-256) and stores it directly in this KeyBag.
52
+ * This avoids temporary password-wrapped key blobs when the key is only needed locally.
53
+ */
54
+ createTenantKey(tenantId: string, createdAt?: number): Promise<void>;
55
+ /**
56
+ * Creates a new document symmetric key (AES-256) and stores it directly in this KeyBag.
57
+ * This avoids temporary password-wrapped key blobs when the key is only needed locally.
58
+ */
59
+ createDocKey(keyId: string, createdAt?: number): Promise<void>;
49
60
  /**
50
61
  * Decrypts an encrypted private key with the given password and imports it into the key bag.
51
62
  * Adds the key to the array of keys for this keyId (supports key rotation).
52
63
  *
53
- * @param keyId The ID to store the decrypted key under
64
+ * @param type The key type ("tenant" | "doc")
65
+ * @param id The key identifier (tenantId or doc keyId)
54
66
  * @param key The encrypted private key to decrypt
55
67
  * @param password The password to decrypt the key
56
- * @param saltString Optional salt string for key derivation. Defaults to "default".
57
- * Use "default" for keys created by createSymmetricEncryptedPrivateKey.
58
- * Keys exported via encryptAndExportKey use keyId as salt, so pass keyId explicitly.
59
68
  * @return A promise that resolves when the key is decrypted and stored
60
69
  */
61
- decryptAndImportKey(keyId: string, key: EncryptedPrivateKey, password: string, saltString?: string): Promise<void>;
70
+ decryptAndImportKey(type: KeyType, id: string, key: EncryptedPrivateKey, password: string): Promise<void>;
62
71
  /**
63
72
  * Encrypts a key from the key bag with the given password and exports it as an EncryptedPrivateKey.
64
73
  * Returns the newest key (based on createdAt) or the first key if no timestamps are available.
65
74
  *
66
- * @param keyId The ID of the key to encrypt and export
75
+ * @param type The key type ("tenant" | "doc")
76
+ * @param id The key identifier (tenantId or doc keyId)
67
77
  * @param password The password to encrypt the key with
68
78
  * @return A promise that resolves to the encrypted private key, or null if the key is not found
69
79
  */
70
- encryptAndExportKey(keyId: string, password: string): Promise<EncryptedPrivateKey | null>;
80
+ encryptAndExportKey(type: KeyType, id: string, password: string): Promise<EncryptedPrivateKey | null>;
71
81
  /**
72
82
  * Deletes all keys for a given keyId from the key bag.
73
83
  *
74
- * @param keyId The ID of the keys to delete
84
+ * @param type The key type ("tenant" | "doc")
85
+ * @param id The key identifier (tenantId or doc keyId)
75
86
  * @return A promise that resolves when the keys are deleted
76
87
  */
77
- deleteKey(keyId: string): Promise<void>;
88
+ deleteKey(type: KeyType, id: string): Promise<void>;
78
89
  /**
79
90
  * Lists all key IDs in the key bag.
80
91
  *
81
92
  * @return A promise that resolves to an array of key IDs
82
93
  */
83
94
  listKeys(): Promise<string[]>;
95
+ /**
96
+ * Creates an in-memory clone of this KeyBag.
97
+ * The clone contains deep-copied key material and independent key maps.
98
+ */
99
+ clone(): KeyBag;
84
100
  /**
85
101
  * Save the key bag to a binary data blob, encrypted with the user encryption key.
86
102
  *
@@ -103,6 +119,10 @@ export declare class KeyBag {
103
119
  * @returns The decrypted private key as ArrayBuffer
104
120
  */
105
121
  private decryptPrivateKey;
122
+ /**
123
+ * Generates a new AES-256 key and stores raw key bytes in KeyBag.
124
+ */
125
+ private createAndStoreSymmetricKey;
106
126
  /**
107
127
  * Internal method to encrypt a private key using password-based key derivation.
108
128
  * This is the reverse of decryptPrivateKey().
@@ -1 +1 @@
1
- {"version":3,"file":"KeyBag.d.ts","sourceRoot":"","sources":["../../../src/core/keys/KeyBag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAoC,MAAM,YAAY,CAAC;AAUtE;;;;GAIG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,yBAAyB,CAAS;IAC1C,OAAO,CAAC,IAAI,CAAsC;IAClD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,MAAM,CAAS;IAEvB;;;;;;;OAOG;gBACS,iBAAiB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM;IASpI;;;;;;OAMG;IACG,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAgBpD;;;;;;OAMG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAgBtD;;;;;;;OAOG;IACG,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE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AG,OAAO,CAAC,IAAI,CAAC;IAIzD;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAInC;;;OAGG;IACH,KAAK,IAAI,MAAM;IAsBf;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAgGjC;;;;;OAKG;IACG,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA4FpD;;;;;;;OAOG;YACW,iBAAiB;IA+D/B;;OAEG;YACW,0BAA0B;IAkBxC;;;;;;;;OAQG;YACW,iBAAiB;IAmF/B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAO3B"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeyBag = void 0;
4
+ const KeyContext_1 = require("./KeyContext");
5
+ const pbkdf2Iterations_1 = require("../crypto/pbkdf2Iterations");
4
6
  const logging_1 = require("../logging");
5
7
  /**
6
8
  * The KeyBag is used to store encryption keys that the current user has access to
@@ -32,8 +34,9 @@ class KeyBag {
32
34
  * @param keyId The ID of the key to read
33
35
  * @return The exported key, or null if not found
34
36
  */
35
- async get(keyId) {
36
- const keyEntries = this.keys.get(keyId);
37
+ async get(type, id) {
38
+ const scopedKeyId = (0, KeyContext_1.buildScopedKeyId)(type, id);
39
+ const keyEntries = this.keys.get(scopedKeyId);
37
40
  if (!keyEntries || keyEntries.length === 0) {
38
41
  return null;
39
42
  }
@@ -52,8 +55,9 @@ class KeyBag {
52
55
  * @param keyId The ID of the keys to read
53
56
  * @return Array of keys sorted by createdAt (newest first), or empty array if not found
54
57
  */
55
- async getAllKeys(keyId) {
56
- const keyEntries = this.keys.get(keyId);
58
+ async getAllKeys(type, id) {
59
+ const scopedKeyId = (0, KeyContext_1.buildScopedKeyId)(type, id);
60
+ const keyEntries = this.keys.get(scopedKeyId);
57
61
  if (!keyEntries || keyEntries.length === 0) {
58
62
  return [];
59
63
  }
@@ -73,48 +77,64 @@ class KeyBag {
73
77
  * @param key The key bytes
74
78
  * @param createdAt Optional creation timestamp (milliseconds since Unix epoch)
75
79
  */
76
- async set(keyId, key, createdAt) {
77
- const keyEntries = this.keys.get(keyId) || [];
80
+ async set(type, id, key, createdAt) {
81
+ const scopedKeyId = (0, KeyContext_1.buildScopedKeyId)(type, id);
82
+ const keyEntries = this.keys.get(scopedKeyId) || [];
78
83
  keyEntries.push({ key, createdAt });
79
- this.keys.set(keyId, keyEntries);
84
+ this.keys.set(scopedKeyId, keyEntries);
85
+ }
86
+ /**
87
+ * Creates a new tenant symmetric key (AES-256) and stores it directly in this KeyBag.
88
+ * This avoids temporary password-wrapped key blobs when the key is only needed locally.
89
+ */
90
+ async createTenantKey(tenantId, createdAt) {
91
+ await this.createAndStoreSymmetricKey("tenant", tenantId, createdAt);
92
+ }
93
+ /**
94
+ * Creates a new document symmetric key (AES-256) and stores it directly in this KeyBag.
95
+ * This avoids temporary password-wrapped key blobs when the key is only needed locally.
96
+ */
97
+ async createDocKey(keyId, createdAt) {
98
+ await this.createAndStoreSymmetricKey("doc", keyId, createdAt);
80
99
  }
81
100
  /**
82
101
  * Decrypts an encrypted private key with the given password and imports it into the key bag.
83
102
  * Adds the key to the array of keys for this keyId (supports key rotation).
84
103
  *
85
- * @param keyId The ID to store the decrypted key under
104
+ * @param type The key type ("tenant" | "doc")
105
+ * @param id The key identifier (tenantId or doc keyId)
86
106
  * @param key The encrypted private key to decrypt
87
107
  * @param password The password to decrypt the key
88
- * @param saltString Optional salt string for key derivation. Defaults to "default".
89
- * Use "default" for keys created by createSymmetricEncryptedPrivateKey.
90
- * Keys exported via encryptAndExportKey use keyId as salt, so pass keyId explicitly.
91
108
  * @return A promise that resolves when the key is decrypted and stored
92
109
  */
93
- async decryptAndImportKey(keyId, key, password, saltString) {
94
- const salt = saltString ?? "default";
110
+ async decryptAndImportKey(type, id, key, password) {
111
+ const salt = (0, KeyContext_1.buildKeyDerivationSalt)(type, id);
112
+ const scopedKeyId = (0, KeyContext_1.buildScopedKeyId)(type, id);
95
113
  const decryptedKeyBytes = await this.decryptPrivateKey(key, password, salt);
96
- const keyEntries = this.keys.get(keyId) || [];
114
+ const keyEntries = this.keys.get(scopedKeyId) || [];
97
115
  keyEntries.push({
98
116
  key: new Uint8Array(decryptedKeyBytes),
99
117
  createdAt: key.createdAt
100
118
  });
101
- this.keys.set(keyId, keyEntries);
119
+ this.keys.set(scopedKeyId, keyEntries);
102
120
  }
103
121
  /**
104
122
  * Encrypts a key from the key bag with the given password and exports it as an EncryptedPrivateKey.
105
123
  * Returns the newest key (based on createdAt) or the first key if no timestamps are available.
106
124
  *
107
- * @param keyId The ID of the key to encrypt and export
125
+ * @param type The key type ("tenant" | "doc")
126
+ * @param id The key identifier (tenantId or doc keyId)
108
127
  * @param password The password to encrypt the key with
109
128
  * @return A promise that resolves to the encrypted private key, or null if the key is not found
110
129
  */
111
- async encryptAndExportKey(keyId, password) {
112
- const key = await this.get(keyId);
130
+ async encryptAndExportKey(type, id, password) {
131
+ const scopedKeyId = (0, KeyContext_1.buildScopedKeyId)(type, id);
132
+ const key = await this.get(type, id);
113
133
  if (!key) {
114
134
  return null;
115
135
  }
116
136
  // Get the createdAt timestamp from the newest key entry
117
- const keyEntries = this.keys.get(keyId);
137
+ const keyEntries = this.keys.get(scopedKeyId);
118
138
  if (!keyEntries || keyEntries.length === 0) {
119
139
  return null;
120
140
  }
@@ -126,7 +146,7 @@ class KeyBag {
126
146
  });
127
147
  const createdAt = sorted[0].createdAt;
128
148
  // Encrypt the key using the same pattern as decryptPrivateKey
129
- const encryptedKey = await this.encryptPrivateKey(key, password, keyId);
149
+ const encryptedKey = await this.encryptPrivateKey(key, password, (0, KeyContext_1.buildKeyDerivationSalt)(type, id));
130
150
  // Include the createdAt timestamp if available
131
151
  if (createdAt !== undefined) {
132
152
  encryptedKey.createdAt = createdAt;
@@ -136,11 +156,12 @@ class KeyBag {
136
156
  /**
137
157
  * Deletes all keys for a given keyId from the key bag.
138
158
  *
139
- * @param keyId The ID of the keys to delete
159
+ * @param type The key type ("tenant" | "doc")
160
+ * @param id The key identifier (tenantId or doc keyId)
140
161
  * @return A promise that resolves when the keys are deleted
141
162
  */
142
- async deleteKey(keyId) {
143
- this.keys.delete(keyId);
163
+ async deleteKey(type, id) {
164
+ this.keys.delete((0, KeyContext_1.buildScopedKeyId)(type, id));
144
165
  }
145
166
  /**
146
167
  * Lists all key IDs in the key bag.
@@ -150,6 +171,22 @@ class KeyBag {
150
171
  async listKeys() {
151
172
  return Array.from(this.keys.keys());
152
173
  }
174
+ /**
175
+ * Creates an in-memory clone of this KeyBag.
176
+ * The clone contains deep-copied key material and independent key maps.
177
+ */
178
+ clone() {
179
+ const clonedUserEncryptionKey = { ...this.userEncryptionKey };
180
+ const cloned = new KeyBag(clonedUserEncryptionKey, this.userEncryptionKeyPassword, this.cryptoAdapter, this.logger);
181
+ cloned.keys = new Map(Array.from(this.keys.entries()).map(([scopedKeyId, entries]) => [
182
+ scopedKeyId,
183
+ entries.map((entry) => ({
184
+ key: new Uint8Array(entry.key),
185
+ createdAt: entry.createdAt,
186
+ })),
187
+ ]));
188
+ return cloned;
189
+ }
153
190
  /**
154
191
  * Save the key bag to a binary data blob, encrypted with the user encryption key.
155
192
  *
@@ -183,11 +220,15 @@ class KeyBag {
183
220
  // Use the user's password as input for PBKDF2
184
221
  const passwordInput = new TextEncoder().encode(`${this.userEncryptionKeyPassword}:key-bag-encryption`);
185
222
  const passwordKey = await subtle.importKey("raw", passwordInput, "PBKDF2", false, ["deriveKey"]);
223
+ const keyBagIterations = (0, pbkdf2Iterations_1.resolvePbkdf2Iterations)(pbkdf2Iterations_1.DEFAULT_PBKDF2_ITERATIONS);
224
+ if (keyBagIterations !== pbkdf2Iterations_1.DEFAULT_PBKDF2_ITERATIONS) {
225
+ this.logger.warn(`Using overridden PBKDF2 iterations for KeyBag.save(): ${keyBagIterations}`);
226
+ }
186
227
  // Derive AES-GCM key using PBKDF2
187
228
  const derivedKey = await subtle.deriveKey({
188
229
  name: "PBKDF2",
189
230
  salt: combinedSalt,
190
- iterations: 310000, // OWASP-recommended PBKDF2 iterations for PBKDF2-SHA256
231
+ iterations: keyBagIterations,
191
232
  hash: "SHA-256",
192
233
  }, passwordKey, {
193
234
  name: "AES-GCM",
@@ -243,11 +284,15 @@ class KeyBag {
243
284
  // Use the user's password as input for PBKDF2 (same as encryption)
244
285
  const passwordInput = new TextEncoder().encode(`${this.userEncryptionKeyPassword}:key-bag-encryption`);
245
286
  const passwordKey = await subtle.importKey("raw", passwordInput, "PBKDF2", false, ["deriveKey"]);
287
+ const keyBagIterations = (0, pbkdf2Iterations_1.resolvePbkdf2Iterations)(pbkdf2Iterations_1.DEFAULT_PBKDF2_ITERATIONS);
288
+ if (keyBagIterations !== pbkdf2Iterations_1.DEFAULT_PBKDF2_ITERATIONS) {
289
+ this.logger.warn(`Using overridden PBKDF2 iterations for KeyBag.load(): ${keyBagIterations}`);
290
+ }
246
291
  // Derive AES-GCM key using PBKDF2 (same parameters as encryption)
247
292
  const derivedKey = await subtle.deriveKey({
248
293
  name: "PBKDF2",
249
294
  salt: combinedSalt,
250
- iterations: 310000, // OWASP-recommended PBKDF2 iterations for PBKDF2-SHA256
295
+ iterations: keyBagIterations,
251
296
  hash: "SHA-256",
252
297
  }, passwordKey, {
253
298
  name: "AES-GCM",
@@ -321,6 +366,18 @@ class KeyBag {
321
366
  }, derivedKey, encryptedData.buffer);
322
367
  return decrypted;
323
368
  }
369
+ /**
370
+ * Generates a new AES-256 key and stores raw key bytes in KeyBag.
371
+ */
372
+ async createAndStoreSymmetricKey(type, id, createdAt) {
373
+ const subtle = this.cryptoAdapter.getSubtle();
374
+ const key = await subtle.generateKey({
375
+ name: "AES-GCM",
376
+ length: 256,
377
+ }, true, ["encrypt", "decrypt"]);
378
+ const keyMaterial = await subtle.exportKey("raw", key);
379
+ await this.set(type, id, new Uint8Array(keyMaterial), createdAt);
380
+ }
324
381
  /**
325
382
  * Internal method to encrypt a private key using password-based key derivation.
326
383
  * This is the reverse of decryptPrivateKey().
@@ -348,7 +405,10 @@ class KeyBag {
348
405
  combinedSalt.set(saltStringBytes, salt.length);
349
406
  // Derive encryption key from password using PBKDF2
350
407
  const passwordKey = await subtle.importKey("raw", new TextEncoder().encode(password), "PBKDF2", false, ["deriveBits", "deriveKey"]);
351
- const iterations = 310000; // OWASP-recommended PBKDF2 iterations for PBKDF2-SHA256
408
+ const iterations = (0, pbkdf2Iterations_1.resolvePbkdf2Iterations)(pbkdf2Iterations_1.DEFAULT_PBKDF2_ITERATIONS);
409
+ if (iterations !== pbkdf2Iterations_1.DEFAULT_PBKDF2_ITERATIONS) {
410
+ this.logger.warn(`Using overridden PBKDF2 iterations for KeyBag.encryptPrivateKey(): ${iterations}`);
411
+ }
352
412
  const derivedKey = await subtle.deriveKey({
353
413
  name: "PBKDF2",
354
414
  salt: combinedSalt,
@@ -1 +1 @@
1
- {"version":3,"file":"KeyBag.js","sourceRoot":"","sources":["../../../src/core/keys/KeyBag.ts"],"names":[],"mappings":";;;AAEA,wCAAsE;AAUtE;;;;GAIG;AACH,MAAa,MAAM;IAOjB;;;;;;;OAOG;IACH,YAAY,iBAAsC,EAAE,yBAAiC,EAAE,aAA4B,EAAE,MAAe;QAZ5H,SAAI,GAA4B,IAAI,GAAG,EAAE,CAAC;QAahD,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;QAC3D,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,MAAM;YACT,MAAM;gBACN,IAAI,sBAAY,CAAC,IAAA,4BAAkB,GAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,CAAC,KAAa;QACrB,MAAM,UAAU,GAAG,IAAI,CAAC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C;IAED;;OAEG;IACK,kBAAkB,CAAC,KAAiB;QAC1C,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;CACF;AA9mBD,wBA8mBC"}
@@ -0,0 +1,4 @@
1
+ export type KeyType = "tenant" | "doc";
2
+ export declare function buildKeyDerivationSalt(type: KeyType, id: string): string;
3
+ export declare function buildScopedKeyId(type: KeyType, id: string): string;
4
+ //# sourceMappingURL=KeyContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyContext.d.ts","sourceRoot":"","sources":["../../../src/core/keys/KeyContext.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEvC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAElE"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildKeyDerivationSalt = buildKeyDerivationSalt;
4
+ exports.buildScopedKeyId = buildScopedKeyId;
5
+ function buildKeyDerivationSalt(type, id) {
6
+ return `${type}:v1:${id}`;
7
+ }
8
+ function buildScopedKeyId(type, id) {
9
+ return `${type}:${id}`;
10
+ }
11
+ //# sourceMappingURL=KeyContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KeyContext.js","sourceRoot":"","sources":["../../../src/core/keys/KeyContext.ts"],"names":[],"mappings":";;AAEA,wDAEC;AAED,4CAEC;AAND,SAAgB,sBAAsB,CAAC,IAAa,EAAE,EAAU;IAC9D,OAAO,GAAG,IAAI,OAAO,EAAE,EAAE,CAAC;AAC5B,CAAC;AAED,SAAgB,gBAAgB,CAAC,IAAa,EAAE,EAAU;IACxD,OAAO,GAAG,IAAI,IAAI,EAAE,EAAE,CAAC;AACzB,CAAC"}