mindoodb 0.0.1 → 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 (206) hide show
  1. package/README.md +97 -24
  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 +19 -2
  15. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
  16. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +133 -22
  17. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
  18. package/dist/appendonlystores/network/HttpTransport.d.ts +20 -3
  19. package/dist/appendonlystores/network/HttpTransport.d.ts.map +1 -1
  20. package/dist/appendonlystores/network/HttpTransport.js +136 -21
  21. package/dist/appendonlystores/network/HttpTransport.js.map +1 -1
  22. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +33 -3
  23. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
  24. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +148 -27
  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 +38 -4
  42. package/dist/core/BaseMindooDB.d.ts.map +1 -1
  43. package/dist/core/BaseMindooDB.js +810 -329
  44. package/dist/core/BaseMindooDB.js.map +1 -1
  45. package/dist/core/BaseMindooTenant.d.ts +42 -6
  46. package/dist/core/BaseMindooTenant.d.ts.map +1 -1
  47. package/dist/core/BaseMindooTenant.js +259 -93
  48. package/dist/core/BaseMindooTenant.js.map +1 -1
  49. package/dist/core/BaseMindooTenantDirectory.d.ts +3 -1
  50. package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
  51. package/dist/core/BaseMindooTenantDirectory.js +50 -40
  52. package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
  53. package/dist/core/BaseMindooTenantFactory.d.ts +25 -29
  54. package/dist/core/BaseMindooTenantFactory.d.ts.map +1 -1
  55. package/dist/core/BaseMindooTenantFactory.js +175 -73
  56. package/dist/core/BaseMindooTenantFactory.js.map +1 -1
  57. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +68 -0
  58. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  59. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js +659 -0
  60. package/dist/core/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  61. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts +50 -4
  62. package/dist/core/appendonlystores/InMemoryContentAddressedStore.d.ts.map +1 -1
  63. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js +204 -39
  64. package/dist/core/appendonlystores/InMemoryContentAddressedStore.js.map +1 -1
  65. package/dist/core/appendonlystores/bloom.d.ts +85 -0
  66. package/dist/core/appendonlystores/bloom.d.ts.map +1 -0
  67. package/dist/core/appendonlystores/bloom.js +228 -0
  68. package/dist/core/appendonlystores/bloom.js.map +1 -0
  69. package/dist/core/appendonlystores/network/AuthenticationService.d.ts +3 -0
  70. package/dist/core/appendonlystores/network/AuthenticationService.d.ts.map +1 -1
  71. package/dist/core/appendonlystores/network/AuthenticationService.js +21 -17
  72. package/dist/core/appendonlystores/network/AuthenticationService.js.map +1 -1
  73. package/dist/core/appendonlystores/network/NetworkTransport.d.ts +36 -2
  74. package/dist/core/appendonlystores/network/NetworkTransport.d.ts.map +1 -1
  75. package/dist/core/appendonlystores/network/types.d.ts +10 -0
  76. package/dist/core/appendonlystores/network/types.d.ts.map +1 -1
  77. package/dist/core/appendonlystores/network/types.js.map +1 -1
  78. package/dist/core/appendonlystores/types.d.ts +137 -1
  79. package/dist/core/appendonlystores/types.d.ts.map +1 -1
  80. package/dist/core/automerge-adapter.d.ts +15 -0
  81. package/dist/core/automerge-adapter.d.ts.map +1 -0
  82. package/dist/core/automerge-adapter.js +73 -0
  83. package/dist/core/automerge-adapter.js.map +1 -0
  84. package/dist/core/crypto/MindooDocSigner.d.ts +3 -1
  85. package/dist/core/crypto/MindooDocSigner.d.ts.map +1 -1
  86. package/dist/core/crypto/MindooDocSigner.js +9 -5
  87. package/dist/core/crypto/MindooDocSigner.js.map +1 -1
  88. package/dist/core/crypto/RSAEncryption.d.ts +3 -1
  89. package/dist/core/crypto/RSAEncryption.d.ts.map +1 -1
  90. package/dist/core/crypto/RSAEncryption.js +13 -9
  91. package/dist/core/crypto/RSAEncryption.js.map +1 -1
  92. package/dist/core/crypto/pbkdf2Iterations.d.ts +12 -0
  93. package/dist/core/crypto/pbkdf2Iterations.d.ts.map +1 -0
  94. package/dist/core/crypto/pbkdf2Iterations.js +55 -0
  95. package/dist/core/crypto/pbkdf2Iterations.js.map +1 -0
  96. package/dist/core/index.d.ts +7 -2
  97. package/dist/core/index.d.ts.map +1 -1
  98. package/dist/core/index.js +30 -1
  99. package/dist/core/index.js.map +1 -1
  100. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.d.ts +1 -1
  101. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js +2 -2
  102. package/dist/core/indexing/virtualviews/MindooDBVirtualViewDataProvider.js.map +1 -1
  103. package/dist/core/indexing/virtualviews/index.d.ts +1 -1
  104. package/dist/core/indexing/virtualviews/index.js +1 -1
  105. package/dist/core/keys/KeyBag.d.ts +36 -13
  106. package/dist/core/keys/KeyBag.d.ts.map +1 -1
  107. package/dist/core/keys/KeyBag.js +96 -31
  108. package/dist/core/keys/KeyBag.js.map +1 -1
  109. package/dist/core/keys/KeyContext.d.ts +4 -0
  110. package/dist/core/keys/KeyContext.d.ts.map +1 -0
  111. package/dist/core/keys/KeyContext.js +11 -0
  112. package/dist/core/keys/KeyContext.js.map +1 -0
  113. package/dist/core/logging/LogLevel.d.ts +21 -0
  114. package/dist/core/logging/LogLevel.d.ts.map +1 -0
  115. package/dist/core/logging/LogLevel.js +56 -0
  116. package/dist/core/logging/LogLevel.js.map +1 -0
  117. package/dist/core/logging/Logger.d.ts +37 -0
  118. package/dist/core/logging/Logger.d.ts.map +1 -0
  119. package/dist/core/logging/Logger.js +3 -0
  120. package/dist/core/logging/Logger.js.map +1 -0
  121. package/dist/core/logging/MindooLogger.d.ts +28 -0
  122. package/dist/core/logging/MindooLogger.d.ts.map +1 -0
  123. package/dist/core/logging/MindooLogger.js +217 -0
  124. package/dist/core/logging/MindooLogger.js.map +1 -0
  125. package/dist/core/logging/index.d.ts +4 -0
  126. package/dist/core/logging/index.d.ts.map +1 -0
  127. package/dist/core/logging/index.js +10 -0
  128. package/dist/core/logging/index.js.map +1 -0
  129. package/dist/core/types.d.ts +313 -77
  130. package/dist/core/types.d.ts.map +1 -1
  131. package/dist/core/types.js +2 -0
  132. package/dist/core/types.js.map +1 -1
  133. package/dist/core/uri/MindooURI.d.ts +58 -0
  134. package/dist/core/uri/MindooURI.d.ts.map +1 -0
  135. package/dist/core/uri/MindooURI.js +169 -0
  136. package/dist/core/uri/MindooURI.js.map +1 -0
  137. package/dist/core/userid/index.d.ts +0 -10
  138. package/dist/core/userid/index.d.ts.map +1 -1
  139. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts +541 -0
  140. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.d.ts.map +1 -0
  141. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js +1334 -0
  142. package/dist/node/appendonlystores/BasicOnDiskContentAddressedStore.js.map +1 -0
  143. package/dist/node/index.d.ts +1 -0
  144. package/dist/node/index.d.ts.map +1 -1
  145. package/dist/node/index.js +5 -1
  146. package/dist/node/index.js.map +1 -1
  147. package/dist/reactnative/crypto/AESAdapter.d.ts +18 -0
  148. package/dist/reactnative/crypto/AESAdapter.d.ts.map +1 -0
  149. package/dist/reactnative/crypto/AESAdapter.js +112 -0
  150. package/dist/reactnative/crypto/AESAdapter.js.map +1 -0
  151. package/dist/reactnative/crypto/Ed25519Adapter.d.ts +34 -0
  152. package/dist/reactnative/crypto/Ed25519Adapter.d.ts.map +1 -0
  153. package/dist/reactnative/crypto/Ed25519Adapter.js +386 -0
  154. package/dist/reactnative/crypto/Ed25519Adapter.js.map +1 -0
  155. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts +23 -0
  156. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.d.ts.map +1 -0
  157. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js +51 -0
  158. package/dist/reactnative/crypto/ExpoGoCryptoAdapter.js.map +1 -0
  159. package/dist/reactnative/crypto/HMACAdapter.d.ts +13 -0
  160. package/dist/reactnative/crypto/HMACAdapter.d.ts.map +1 -0
  161. package/dist/reactnative/crypto/HMACAdapter.js +50 -0
  162. package/dist/reactnative/crypto/HMACAdapter.js.map +1 -0
  163. package/dist/reactnative/crypto/KeyFormatConverter.d.ts +21 -0
  164. package/dist/reactnative/crypto/KeyFormatConverter.d.ts.map +1 -0
  165. package/dist/reactnative/crypto/KeyFormatConverter.js +72 -0
  166. package/dist/reactnative/crypto/KeyFormatConverter.js.map +1 -0
  167. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts +19 -0
  168. package/dist/reactnative/crypto/PBKDF2Adapter.d.ts.map +1 -0
  169. package/dist/reactnative/crypto/PBKDF2Adapter.js +67 -0
  170. package/dist/reactnative/crypto/PBKDF2Adapter.js.map +1 -0
  171. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts +37 -0
  172. package/dist/reactnative/crypto/QuickCryptoAdapter.d.ts.map +1 -0
  173. package/dist/reactnative/crypto/QuickCryptoAdapter.js +72 -0
  174. package/dist/reactnative/crypto/QuickCryptoAdapter.js.map +1 -0
  175. package/dist/reactnative/crypto/RSAAdapter.d.ts +38 -0
  176. package/dist/reactnative/crypto/RSAAdapter.d.ts.map +1 -0
  177. package/dist/reactnative/crypto/RSAAdapter.js +184 -0
  178. package/dist/reactnative/crypto/RSAAdapter.js.map +1 -0
  179. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts +33 -0
  180. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.d.ts.map +1 -0
  181. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js +61 -0
  182. package/dist/reactnative/crypto/ReactNativeCryptoAdapter.js.map +1 -0
  183. package/dist/reactnative/crypto/SHA256Adapter.d.ts +9 -0
  184. package/dist/reactnative/crypto/SHA256Adapter.d.ts.map +1 -0
  185. package/dist/reactnative/crypto/SHA256Adapter.js +29 -0
  186. package/dist/reactnative/crypto/SHA256Adapter.js.map +1 -0
  187. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts +63 -0
  188. package/dist/reactnative/crypto/SubtleCryptoPolyfill.d.ts.map +1 -0
  189. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js +350 -0
  190. package/dist/reactnative/crypto/SubtleCryptoPolyfill.js.map +1 -0
  191. package/dist/reactnative/index.d.ts +8 -0
  192. package/dist/reactnative/index.d.ts.map +1 -0
  193. package/dist/reactnative/index.js +38 -0
  194. package/dist/reactnative/index.js.map +1 -0
  195. package/package.json +51 -6
  196. package/patches/PATCHES.md +111 -0
  197. package/patches/react-native+0.76.9.patch +34 -0
  198. package/patches/react-native-quick-crypto+1.0.7.patch +42 -0
  199. package/scripts/cli.js +21 -0
  200. package/scripts/setup-react-native.js +228 -0
  201. package/templates/reactnative/App.js +252 -0
  202. package/templates/reactnative/app.json +29 -0
  203. package/templates/reactnative/babel.config.js +6 -0
  204. package/templates/reactnative/index.js +26 -0
  205. package/templates/reactnative/metro.config.snippet.js +39 -0
  206. package/templates/reactnative/mindoodb-polyfills.js +116 -0
@@ -1,4 +1,5 @@
1
1
  import type { KeyBag } from "./keys/KeyBag";
2
+ import type { KeyType } from "./keys/KeyContext";
2
3
  import type { PublicUserId, PrivateUserId } from "./userid";
3
4
  import type { ContentAddressedStore, OpenStoreOptions } from "./appendonlystores/types";
4
5
  import type { CryptoAdapter } from "./crypto/CryptoAdapter";
@@ -7,6 +8,8 @@ import { MindooDocSigner } from "./crypto/MindooDocSigner";
7
8
  * Well-known key ID for access control documents (grantaccess, revokeaccess, groups).
8
9
  * All servers and clients MUST have this key in their KeyBag to verify user access.
9
10
  * This enables servers to validate users without having full tenant data access.
11
+ *
12
+ * KeyBag location: type "doc", id PUBLIC_INFOS_KEY_ID.
10
13
  */
11
14
  export declare const PUBLIC_INFOS_KEY_ID = "$publicinfos";
12
15
  /**
@@ -59,48 +62,156 @@ export interface EncryptionKeyPair {
59
62
  privateKey: EncryptedPrivateKey;
60
63
  }
61
64
  export type { PublicUserId, PrivateUserId };
65
+ export type { KeyType };
62
66
  /**
63
- * A TenantFactory is a factory for creating and managing tenants.
67
+ * Options for opening a tenant.
64
68
  */
65
- export interface MindooTenantFactory {
69
+ export interface OpenTenantOptions {
66
70
  /**
67
- * Create a new tenant with a new tenant encryption key.
68
- *
69
- * The tenant encryption key is used as the default document encryption key
70
- * (so that all data within the tenant is secure by default).
71
+ * Optional map of additional trusted signing public keys.
72
+ * Keys in this map are checked BEFORE the MindooTenantDirectory when
73
+ * validating public signing keys during signature verification.
71
74
  *
72
- * The administration public key must be created beforehand using createSigningKeyPair()
73
- * and passed to this method. The administration key is used for administrative operations
74
- * within the tenant, such as adding new users to the tenant.
75
+ * Use case: server-to-server sync where trusted server identities are
76
+ * configured out-of-band (e.g. server-env.json) rather than registered
77
+ * in the directory database.
75
78
  *
76
- * The administration encryption public key must be created using createEncryptionKeyPair()
77
- * and is used to encrypt sensitive data in the directory that only admins can decrypt
78
- * (e.g., usernames in access control documents).
79
- *
80
- * @param tenantId The ID of the tenant
81
- * @param administrationPublicKey The administration public key (Ed25519, PEM format) created using createSigningKeyPair()
82
- * @param administrationEncryptionPublicKey The administration encryption public key (RSA-OAEP, PEM format) created using createEncryptionKeyPair()
83
- * @param tenantEncryptionKeyPassword The password to be set to decrypt the tenant encryption private key
84
- * @param currentUser The current user's private user ID (required for tenant operations)
85
- * @param currentUserPassword The password to decrypt the current user's private keys
86
- * @param keyBag The KeyBag instance for storing and loading named encrypted keys
87
- * @return The new tenant
79
+ * Map key: signing public key (Ed25519, PEM format)
80
+ * Map value: true if trusted, false if explicitly revoked
88
81
  */
89
- createTenant(tenantId: string, administrationPublicKey: string, administrationEncryptionPublicKey: string, tenantEncryptionKeyPassword: string, currentUser: PrivateUserId, currentUserPassword: string, keyBag: KeyBag): Promise<MindooTenant>;
82
+ additionalTrustedKeys?: ReadonlyMap<string, boolean>;
83
+ }
84
+ /**
85
+ * Options for creating a new tenant with a single convenience call.
86
+ */
87
+ export interface CreateTenantOptions {
88
+ /** Tenant identifier (e.g. "acme") */
89
+ tenantId: string;
90
+ /** Distinguished name for the admin user (e.g. "cn=admin/o=acme") */
91
+ adminName: string;
92
+ /** Password for the admin user's private keys */
93
+ adminPassword: string;
94
+ /** Distinguished name for the regular app user (e.g. "cn=alice/o=acme") */
95
+ userName: string;
96
+ /** Password for the regular user's private keys */
97
+ userPassword: string;
98
+ }
99
+ /**
100
+ * Result of creating a new tenant via createTenant().
101
+ */
102
+ export interface CreateTenantResult {
103
+ /** The opened tenant, ready to use */
104
+ tenant: MindooTenant;
105
+ /** The admin user's private identity (contains signing + encryption key pairs) */
106
+ adminUser: PrivateUserId;
107
+ /** The regular app user's private identity */
108
+ appUser: PrivateUserId;
109
+ /** The KeyBag containing tenant and $publicinfos keys */
110
+ keyBag: KeyBag;
111
+ }
112
+ /**
113
+ * A join request is created by a new user who wants to join a tenant.
114
+ * It contains only public information and is safe to share via any channel.
115
+ *
116
+ * Can be serialized to a mdb://join-request/... URI for out-of-band exchange.
117
+ */
118
+ export interface JoinRequest {
119
+ /** Protocol version (always 1 for now) */
120
+ v: 1;
121
+ /** The username the user wants to be registered as (e.g. "cn=user2/o=acme") */
122
+ username: string;
123
+ /** Ed25519 public signing key (PEM format) */
124
+ signingPublicKey: string;
125
+ /** RSA-OAEP public encryption key (PEM format) */
126
+ encryptionPublicKey: string;
127
+ }
128
+ /**
129
+ * Options for approving a join request.
130
+ */
131
+ export interface ApproveJoinRequestOptions {
132
+ /** The admin's encrypted private signing key */
133
+ adminSigningKey: EncryptedPrivateKey;
134
+ /** The password to decrypt the admin signing key */
135
+ adminPassword: string;
136
+ /** A shared password for encrypting the exported keys. Must be communicated out-of-band (e.g. phone). */
137
+ sharePassword: string;
138
+ /** Optional server URL to include in the response so the joining user knows where to sync */
139
+ serverUrl?: string;
140
+ /** If "uri", approveJoinRequest returns a mdb://join-response/... URI string instead of an object */
141
+ format?: "object" | "uri";
142
+ }
143
+ /**
144
+ * A join response is created by the admin after approving a join request.
145
+ * It contains encrypted symmetric keys and tenant metadata needed to join.
146
+ *
147
+ * Can be serialized to a mdb://join-response/... URI for out-of-band exchange.
148
+ * The encrypted keys can only be unlocked with the sharePassword communicated separately.
149
+ */
150
+ export interface JoinResponse {
151
+ /** Protocol version (always 1 for now) */
152
+ v: 1;
153
+ /** Tenant identifier */
154
+ tenantId: string;
155
+ /** Admin's public signing key (Ed25519, PEM) — needed to open the tenant */
156
+ adminSigningPublicKey: string;
157
+ /** Admin's public encryption key (RSA-OAEP, PEM) — needed to open the tenant */
158
+ adminEncryptionPublicKey: string;
159
+ /** Optional server URL for sync */
160
+ serverUrl?: string;
161
+ /** Tenant symmetric key, encrypted with the sharePassword */
162
+ encryptedTenantKey: EncryptedPrivateKey;
163
+ /** $publicinfos symmetric key, encrypted with the sharePassword */
164
+ encryptedPublicInfosKey: EncryptedPrivateKey;
165
+ }
166
+ /**
167
+ * Options for joining a tenant with a join response.
168
+ */
169
+ export interface JoinTenantOptions {
170
+ /** The user's locally-generated private identity (keys never leave this device) */
171
+ user: PrivateUserId;
172
+ /** The password for the user's private keys */
173
+ password: string;
174
+ /** The shared password used to decrypt the keys in the join response */
175
+ sharePassword: string;
176
+ }
177
+ /**
178
+ * Result of joining a tenant via joinTenant().
179
+ */
180
+ export interface JoinTenantResult {
181
+ /** The opened tenant, ready to use */
182
+ tenant: MindooTenant;
183
+ /** The KeyBag containing the imported tenant and $publicinfos keys */
184
+ keyBag: KeyBag;
185
+ }
186
+ /**
187
+ * Options for publishing a tenant to a server.
188
+ */
189
+ export interface PublishToServerOptions {
190
+ /** Optional API key for the server's admin endpoints */
191
+ adminApiKey?: string;
192
+ /** Optional users to register on the server at the same time */
193
+ registerUsers?: PublicUserId[];
194
+ }
195
+ /**
196
+ * A TenantFactory is a factory for creating and managing tenants.
197
+ */
198
+ export interface MindooTenantFactory {
90
199
  /**
91
- * Opens an existing tenant with previously created keys.
200
+ * Opens an existing tenant.
92
201
  *
93
202
  * @param tenantId The ID of the tenant
94
- * @param tenantEncryptionPrivateKey The tenant encryption key (AES-256, encrypted)
95
- * @param tenantEncryptionKeyPassword The password to decrypt the tenant encryption key
96
203
  * @param administrationPublicKey The administration public key (Ed25519, PEM format)
97
204
  * @param administrationEncryptionPublicKey The administration encryption public key (RSA-OAEP, PEM format)
98
205
  * @param currentUser The current user's private user ID (required for tenant operations)
99
206
  * @param currentUserPassword The password to decrypt the current user's private keys
100
- * @param keyBag The KeyBag instance for storing and loading named encrypted keys
207
+ * @param keyBag The KeyBag instance for storing and loading tenant/doc keys.
208
+ * Must contain:
209
+ * - $publicinfos key under type "doc" and id PUBLIC_INFOS_KEY_ID
210
+ * Optionally (required for decrypting regular database payloads):
211
+ * - tenant key under type "tenant" and id tenantId
101
212
  * @return The tenant
102
213
  */
103
- openTenantWithKeys(tenantId: string, tenantEncryptionPrivateKey: EncryptedPrivateKey, tenantEncryptionKeyPassword: string, administrationPublicKey: string, administrationEncryptionPublicKey: string, currentUser: PrivateUserId, currentUserPassword: string, keyBag: KeyBag): Promise<MindooTenant>;
214
+ openTenant(tenantId: string, administrationPublicKey: string, administrationEncryptionPublicKey: string, currentUser: PrivateUserId, currentUserPassword: string, keyBag: KeyBag, options?: OpenTenantOptions): Promise<MindooTenant>;
104
215
  /**
105
216
  * Creates a new user with separate signing and encryption key pairs.
106
217
  *
@@ -125,18 +236,6 @@ export interface MindooTenantFactory {
125
236
  * @return The signing key pair containing both public key (PEM format) and encrypted private key (Ed25519)
126
237
  */
127
238
  createSigningKeyPair(password: string): Promise<SigningKeyPair>;
128
- /**
129
- * Creates a new encrypted symmetric key (AES-256) for document encryption.
130
- * The key is encrypted with the provided password and can be distributed to authorized users.
131
- * Use KeyBag.decryptAndImportKey() to store the returned key in the user's KeyBag.
132
- *
133
- * Symmetric keys are shared secrets - anyone with the key can both encrypt and decrypt.
134
- * For user-to-user encryption where only the recipient can decrypt, use createEncryptionKeyPair() instead.
135
- *
136
- * @param password The password to encrypt the symmetric key with (mandatory)
137
- * @return The encrypted symmetric key that can be distributed to authorized users
138
- */
139
- createSymmetricEncryptedPrivateKey(password: string): Promise<EncryptedPrivateKey>;
140
239
  /**
141
240
  * Creates a new asymmetric encryption key pair (RSA-OAEP) for user-to-user encryption.
142
241
  * Returns both the public and encrypted private key.
@@ -149,6 +248,47 @@ export interface MindooTenantFactory {
149
248
  * @return The encryption key pair containing both public key (PEM format) and encrypted private key (RSA-OAEP)
150
249
  */
151
250
  createEncryptionKeyPair(password: string): Promise<EncryptionKeyPair>;
251
+ /**
252
+ * Create a new tenant with a single call. This orchestrates:
253
+ * 1. Creating the admin user identity
254
+ * 2. Creating the regular app user identity
255
+ * 3. Creating a KeyBag with tenant key and $publicinfos key
256
+ * 4. Opening the tenant
257
+ * 5. Registering the app user in the directory
258
+ *
259
+ * @param options Tenant creation options
260
+ * @return The created tenant, admin user, app user, and KeyBag
261
+ */
262
+ createTenant(options: CreateTenantOptions): Promise<CreateTenantResult>;
263
+ /**
264
+ * Create a join request from a user's private identity.
265
+ * The join request contains only public keys and is safe to share via any channel.
266
+ *
267
+ * @param user The user's private identity (only public keys are extracted)
268
+ * @param options Optional. Set format to "uri" to get a mdb://join-request/... URI string.
269
+ * @return A JoinRequest object or a mdb://join-request/... URI string
270
+ */
271
+ createJoinRequest(user: PrivateUserId, options?: {
272
+ format?: "object";
273
+ }): JoinRequest;
274
+ createJoinRequest(user: PrivateUserId, options: {
275
+ format: "uri";
276
+ }): string;
277
+ createJoinRequest(user: PrivateUserId, options?: {
278
+ format?: "object" | "uri";
279
+ }): JoinRequest | string;
280
+ /**
281
+ * Join a tenant using a join response from an admin.
282
+ * This orchestrates:
283
+ * 1. Parsing the join response (object or mdb:// URI string)
284
+ * 2. Creating a new KeyBag and importing the encrypted keys
285
+ * 3. Opening the tenant with the admin public keys from the response
286
+ *
287
+ * @param joinResponse A JoinResponse object or a mdb://join-response/... URI string
288
+ * @param options Options including the user's identity, password, and the shared password
289
+ * @return The opened tenant and KeyBag
290
+ */
291
+ joinTenant(joinResponse: JoinResponse | string, options: JoinTenantOptions): Promise<JoinTenantResult>;
152
292
  }
153
293
  /**
154
294
  * A MindooTenant contains multiple MindooDB in an organization. One MindooDB is a mandatory part
@@ -188,15 +328,6 @@ export interface MindooTenant {
188
328
  * @return The administration encryption public key (RSA-OAEP, PEM format)
189
329
  */
190
330
  getAdministrationEncryptionPublicKey(): string;
191
- /**
192
- * Returns the encryption key used to encrypt all communication in this tenant
193
- * (e.g. the document changesets).
194
- *
195
- * Note: This is a symmetric key (AES-256) used ONLY for encryption/decryption, not for signing.
196
- *
197
- * @return The tenant encryption key (AES-256, encrypted)
198
- */
199
- getTenantEncryptionKey(): EncryptedPrivateKey;
200
331
  /**
201
332
  * Encrypt a payload using the symmetric key identified by decryptionKeyId.
202
333
  * For "default", uses the tenant encryption key.
@@ -294,8 +425,45 @@ export interface MindooTenant {
294
425
  * @return The crypto adapter
295
426
  */
296
427
  getCryptoAdapter(): CryptoAdapter;
428
+ /**
429
+ * Approve a join request and produce a join response.
430
+ * This orchestrates:
431
+ * 1. Parsing the join request (object or mdb:// URI string)
432
+ * 2. Registering the user in the tenant directory
433
+ * 3. Exporting the tenant key and $publicinfos key, encrypted with the sharePassword
434
+ * 4. Packaging everything into a JoinResponse
435
+ *
436
+ * @param joinRequest A JoinRequest object or a mdb://join-request/... URI string
437
+ * @param options Options including admin key, share password, and optional server URL
438
+ * @return A JoinResponse object, or a mdb://join-response/... URI string if format is "uri"
439
+ */
440
+ approveJoinRequest(joinRequest: JoinRequest | string, options: ApproveJoinRequestOptions & {
441
+ format: "uri";
442
+ }): Promise<string>;
443
+ approveJoinRequest(joinRequest: JoinRequest | string, options: ApproveJoinRequestOptions): Promise<JoinResponse>;
444
+ /**
445
+ * Publish (register) this tenant on a MindooDB server.
446
+ * Sends an HTTP POST to the server's /admin/register-tenant endpoint
447
+ * with the admin public keys and optional initial users.
448
+ *
449
+ * @param serverUrl The base URL of the MindooDB server (e.g. "http://localhost:3000")
450
+ * @param options Optional API key and users to register
451
+ */
452
+ publishToServer(serverUrl: string, options?: PublishToServerOptions): Promise<void>;
453
+ /**
454
+ * Create a remote store connected to a MindooDB server, ready for sync.
455
+ * This orchestrates:
456
+ * 1. Creating an HttpTransport pointed at the server
457
+ * 2. Creating a ClientNetworkContentAddressedStore with the current user's keys
458
+ * 3. Returning the store for use with pullChangesFrom/pushChangesTo
459
+ *
460
+ * @param serverUrl The base URL of the MindooDB server (e.g. "http://localhost:3000")
461
+ * @param dbId The database ID to connect to (e.g. "todos")
462
+ * @return A ContentAddressedStore connected to the remote server
463
+ */
464
+ connectToServer(serverUrl: string, dbId: string): Promise<ContentAddressedStore>;
297
465
  }
298
- export type { ContentAddressedStore, ContentAddressedStoreFactory, CreateStoreResult, OpenStoreOptions } from "./appendonlystores/types";
466
+ export type { ContentAddressedStore, ContentAddressedStoreFactory, CreateStoreResult, OpenStoreOptions, StoreCompactionStatus, StoreScanCursor, StoreScanFilters, StoreScanResult, StoreIdBloomSummary, } from "./appendonlystores/types";
299
467
  /**
300
468
  * The type of entry stored in the ContentAddressedStore.
301
469
  * Entry types are prefixed to indicate their domain:
@@ -790,6 +958,24 @@ export interface ProcessChangesResult {
790
958
  */
791
959
  cursor: ProcessChangesCursor;
792
960
  }
961
+ /**
962
+ * Result yielded by the iterateDocumentHistory generator.
963
+ */
964
+ export interface DocumentHistoryResult {
965
+ /**
966
+ * The document state after applying this change.
967
+ * Each document is an independent clone, safe to store in arrays.
968
+ */
969
+ doc: MindooDoc;
970
+ /**
971
+ * The timestamp when this change was created (milliseconds since Unix epoch).
972
+ */
973
+ changeCreatedAt: number;
974
+ /**
975
+ * The public signing key of the user who created this change (Ed25519, PEM format).
976
+ */
977
+ changeCreatedByPublicKey: string;
978
+ }
793
979
  /**
794
980
  * Options for opening a database
795
981
  */
@@ -806,6 +992,42 @@ export interface OpenDBOptions extends OpenStoreOptions {
806
992
  */
807
993
  attachmentConfig?: AttachmentConfig;
808
994
  }
995
+ /**
996
+ * Optional performance callback interface for tracking operation timing.
997
+ * Used for profiling and performance analysis.
998
+ */
999
+ export interface PerformanceCallback {
1000
+ /**
1001
+ * Called when a document is loaded, with timing breakdown.
1002
+ */
1003
+ onDocumentLoad?: (metrics: {
1004
+ docId: string;
1005
+ cacheHit: boolean;
1006
+ cacheCheckTime: number;
1007
+ storeQueryTime: number;
1008
+ entryLoadTime: number;
1009
+ signatureVerificationTime: number;
1010
+ decryptionTime: number;
1011
+ automergeTime: number;
1012
+ totalTime: number;
1013
+ }) => void;
1014
+ /**
1015
+ * Called when the index is updated.
1016
+ */
1017
+ onIndexUpdate?: (metrics: {
1018
+ docId: string;
1019
+ operation: 'insert' | 'update' | 'remove';
1020
+ time: number;
1021
+ }) => void;
1022
+ /**
1023
+ * Called during sync operations.
1024
+ */
1025
+ onSyncOperation?: (metrics: {
1026
+ operation: 'findNewEntries' | 'processDocument' | 'updateIndex';
1027
+ time: number;
1028
+ details?: Record<string, any>;
1029
+ }) => void;
1030
+ }
809
1031
  export interface MindooDB {
810
1032
  /**
811
1033
  * Get the tenant that this database belongs to
@@ -872,15 +1094,51 @@ export interface MindooDB {
872
1094
  *
873
1095
  * @param docId The ID of the document
874
1096
  * @param timestamp The timestamp to reconstruct the document at (milliseconds since Unix epoch)
875
- * @return The document at the specified timestamp, or null if the document didn't exist at that time
1097
+ * @return The document at the specified timestamp, or null if the document didn't exist at that time.
1098
+ * If the document was deleted at or before the timestamp, returns a document with isDeleted() === true.
876
1099
  */
877
1100
  getDocumentAtTimestamp(docId: string, timestamp: number): Promise<MindooDoc | null>;
1101
+ /**
1102
+ * Iterate through the history of a document from its origin to the latest version.
1103
+ * Traverses changes in chronological order (oldest to newest), applying each change and yielding the document state.
1104
+ *
1105
+ * Each yielded document is an independent clone, safe to store in arrays or modify.
1106
+ *
1107
+ * Documents are yielded in chronological order from oldest to newest (origin to latest version).
1108
+ *
1109
+ * Example usage:
1110
+ * ```typescript
1111
+ * for await (const { doc, changeCreatedAt, changeCreatedByPublicKey } of db.iterateDocumentHistory(docId)) {
1112
+ * const data = doc.getData();
1113
+ * console.log(`Document at ${new Date(changeCreatedAt)}:`, data);
1114
+ * // Store doc in array - each is independent
1115
+ * history.push(doc);
1116
+ * }
1117
+ * ```
1118
+ *
1119
+ * @param docId The ID of the document to traverse
1120
+ * @return An async generator that yields DocumentHistoryResult objects containing the document state and change metadata, in chronological order from oldest to newest
1121
+ */
1122
+ iterateDocumentHistory(docId: string): AsyncGenerator<DocumentHistoryResult, void, unknown>;
878
1123
  /**
879
1124
  * Get all document IDs in this database.
880
1125
  *
881
1126
  * @return A list of document IDs
882
1127
  */
883
1128
  getAllDocumentIds(): Promise<string[]>;
1129
+ /**
1130
+ * Get all document IDs that existed at a specific timestamp.
1131
+ *
1132
+ * This method efficiently queries the content-addressed store to find
1133
+ * documents that existed at the given point in time. A document is considered
1134
+ * to exist at a timestamp if:
1135
+ * - It has a doc_create entry with createdAt <= timestamp
1136
+ * - Either it has no doc_delete entry, or its doc_delete entry has createdAt > timestamp
1137
+ *
1138
+ * @param timestamp The timestamp to query (milliseconds since Unix epoch)
1139
+ * @return A promise that resolves to a list of document IDs that existed at the specified timestamp
1140
+ */
1141
+ getAllDocumentIdsAtTimestamp(timestamp: number): Promise<string[]>;
884
1142
  /**
885
1143
  * Delete a document by its ID
886
1144
  *
@@ -930,49 +1188,27 @@ export interface MindooDB {
930
1188
  * @return A promise that resolves when the document is changed
931
1189
  */
932
1190
  changeDocWithSigningKey(doc: MindooDoc, changeFunc: (doc: MindooDoc) => void | Promise<void>, signingKeyPair: SigningKeyPair, signingKeyPassword: string): Promise<void>;
933
- /**
934
- * Each MindooDB maintains an internal index that tracks documents and their latest state,
935
- * sorted by their last modified timestamp (then by document ID for uniqueness).
936
- * The index is updated when documents actually change (after applying changes),
937
- * enabling incremental operations on the database.
938
- *
939
- * This method uses the internal index to efficiently find and process documents that changed
940
- * since a given cursor, useful for incremental processing of changes.
941
- * Documents are returned in modification order (oldest first).
942
- * The callback will receive new documents, changes and deletions.
943
- *
944
- * The callback can return `false` to stop processing early. If the callback throws an error
945
- * or if there's an error processing a document, the loop will stop and the error will be propagated.
946
- *
947
- * @param cursor The cursor to start processing changes from. Use `null` or `{ lastModified: 0, docId: "" }` to start from the beginning.
948
- * @param limit The maximum number of changes to process (for pagination)
949
- * @param callback The function to call for each change. Receives the document and its cursor position. Return `false` to stop processing, or `true`/`undefined` to continue.
950
- * @return The cursor of the last change processed, can be used to continue processing from this position
951
- */
952
- processChangesSince(cursor: ProcessChangesCursor | null, limit: number, callback: (change: MindooDoc, currentCursor: ProcessChangesCursor) => boolean | void): Promise<ProcessChangesCursor>;
953
1191
  /**
954
1192
  * Iterate over documents that changed since a given cursor using an async generator.
955
- * This provides a cleaner iteration pattern compared to the callback-based processChangesSince.
956
1193
  *
957
1194
  * Documents are returned in modification order (oldest first).
958
- * The generator automatically handles pagination internally.
1195
+ * Documents are yielded one at a time, allowing early termination via `break` after each document.
959
1196
  *
960
1197
  * Example usage:
961
1198
  * ```typescript
962
- * for await (const { doc, cursor } of db.iterateChangesSince(null, 100)) {
1199
+ * for await (const { doc, cursor } of db.iterateChangesSince(null)) {
963
1200
  * const data = doc.getData();
964
1201
  * if (data.type === "target") {
965
1202
  * // Process document
966
- * break; // Stop iteration early if needed
1203
+ * break; // Stop iteration early if needed - works after each document
967
1204
  * }
968
1205
  * }
969
1206
  * ```
970
1207
  *
971
1208
  * @param cursor The cursor to start processing changes from. Use `null` to start from the beginning.
972
- * @param pageSize The number of documents to process per page (for internal pagination). Defaults to 100.
973
- * @return An async generator that yields ProcessChangesResult objects containing the document and its cursor
1209
+ * @return An async generator that yields ProcessChangesResult objects containing the document and its cursor. Each document is yielded immediately after loading, enabling early termination.
974
1210
  */
975
- iterateChangesSince(cursor: ProcessChangesCursor | null, pageSize?: number): AsyncGenerator<ProcessChangesResult, void, unknown>;
1211
+ iterateChangesSince(cursor: ProcessChangesCursor | null): AsyncGenerator<ProcessChangesResult, void, unknown>;
976
1212
  /**
977
1213
  * Sync changes from the append-only store by finding new changes and processing them.
978
1214
  * This method can be called multiple times to incrementally sync new changes.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,UAAU,EAAE,mBAAmB,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IAC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@@ exports.PUBLIC_INFOS_KEY_ID = void 0;
5
5
  * Well-known key ID for access control documents (grantaccess, revokeaccess, groups).
6
6
  * All servers and clients MUST have this key in their KeyBag to verify user access.
7
7
  * This enables servers to validate users without having full tenant data access.
8
+ *
9
+ * KeyBag location: type "doc", id PUBLIC_INFOS_KEY_ID.
8
10
  */
9
11
  exports.PUBLIC_INFOS_KEY_ID = "$publicinfos";
10
12
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":";;;AAMA;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":";;;AAOA;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,cAAc,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * MindooDB URI scheme for out-of-band exchange of join requests and responses.
3
+ *
4
+ * Format: mdb://<type>/<base64url-encoded-JSON>
5
+ *
6
+ * Examples:
7
+ * mdb://join-request/eyJ2IjoxLCJ1c2VybmFtZSI6...
8
+ * mdb://join-response/eyJ2IjoxLCJ0ZW5hbnRJZCI6...
9
+ *
10
+ * All payloads include a "v" field (version number) for forward compatibility.
11
+ * Uses base64url encoding (URL-safe, no padding) so URIs remain valid
12
+ * in all contexts (URLs, QR codes, email, chat).
13
+ */
14
+ /**
15
+ * Supported MindooDB URI types.
16
+ */
17
+ export type MindooURIType = "join-request" | "join-response";
18
+ /**
19
+ * Result of decoding a mdb:// URI.
20
+ */
21
+ export interface DecodedMindooURI<T = unknown> {
22
+ /** The URI type (e.g. "join-request", "join-response") */
23
+ type: MindooURIType;
24
+ /** The version number from the payload */
25
+ version: number;
26
+ /** The decoded payload object */
27
+ payload: T;
28
+ }
29
+ /**
30
+ * Encode a payload object into a mdb:// URI string.
31
+ *
32
+ * The payload MUST contain a "v" field with a numeric version.
33
+ *
34
+ * @param type The URI type (e.g. "join-request")
35
+ * @param payload The payload object to encode (must include "v" field)
36
+ * @returns A mdb:// URI string
37
+ * @throws Error if the type is invalid or payload is missing "v" field
38
+ */
39
+ export declare function encodeMindooURI(type: MindooURIType, payload: Record<string, unknown>): string;
40
+ /**
41
+ * Decode a mdb:// URI string back into its type and payload.
42
+ *
43
+ * @param uri The mdb:// URI string to decode
44
+ * @returns The decoded URI with type, version, and payload
45
+ * @throws Error if the URI is malformed or has an invalid type
46
+ */
47
+ export declare function decodeMindooURI<T = unknown>(uri: string): DecodedMindooURI<T>;
48
+ /**
49
+ * Check if a string is a valid mdb:// URI.
50
+ *
51
+ * Performs structural validation only (scheme, type, base64url payload).
52
+ * Does not validate the payload contents.
53
+ *
54
+ * @param value The string to check
55
+ * @returns True if the string is a valid mdb:// URI
56
+ */
57
+ export declare function isMindooURI(value: string): boolean;
58
+ //# sourceMappingURL=MindooURI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MindooURI.d.ts","sourceRoot":"","sources":["../../../src/core/uri/MindooURI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,eAAe,CAAC;AAS7D;;GAEG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO;IAC3C,0DAA0D;IAC1D,IAAI,EAAE,aAAa,CAAC;IACpB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,OAAO,EAAE,CAAC,CAAC;CACZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAY7F;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAkD7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CA0BlD"}