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,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:
@@ -964,7 +1132,7 @@ export interface MindooDB {
964
1132
  * This method efficiently queries the content-addressed store to find
965
1133
  * documents that existed at the given point in time. A document is considered
966
1134
  * to exist at a timestamp if:
967
- * - It has a doc_create entry with createdAt < timestamp
1135
+ * - It has a doc_create entry with createdAt <= timestamp
968
1136
  * - Either it has no doc_delete entry, or its doc_delete entry has createdAt > timestamp
969
1137
  *
970
1138
  * @param timestamp The timestamp to query (milliseconds since Unix epoch)
@@ -1 +1 @@
1
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EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACpD,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAAG,cAAc,CAAC,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAE9G;;;;;;;;;;;OAWG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;;;OAKG;IACH,eAAe,CAAC,WAAW,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnE;;;;;OAKG;IACH,aAAa,CAAC,WAAW,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE"}
@@ -5,6 +5,8 @@ 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"}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ /**
3
+ * MindooDB URI scheme for out-of-band exchange of join requests and responses.
4
+ *
5
+ * Format: mdb://<type>/<base64url-encoded-JSON>
6
+ *
7
+ * Examples:
8
+ * mdb://join-request/eyJ2IjoxLCJ1c2VybmFtZSI6...
9
+ * mdb://join-response/eyJ2IjoxLCJ0ZW5hbnRJZCI6...
10
+ *
11
+ * All payloads include a "v" field (version number) for forward compatibility.
12
+ * Uses base64url encoding (URL-safe, no padding) so URIs remain valid
13
+ * in all contexts (URLs, QR codes, email, chat).
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.encodeMindooURI = encodeMindooURI;
17
+ exports.decodeMindooURI = decodeMindooURI;
18
+ exports.isMindooURI = isMindooURI;
19
+ const VALID_TYPES = new Set([
20
+ "join-request",
21
+ "join-response",
22
+ ]);
23
+ const MDB_SCHEME = "mdb://";
24
+ /**
25
+ * Encode a payload object into a mdb:// URI string.
26
+ *
27
+ * The payload MUST contain a "v" field with a numeric version.
28
+ *
29
+ * @param type The URI type (e.g. "join-request")
30
+ * @param payload The payload object to encode (must include "v" field)
31
+ * @returns A mdb:// URI string
32
+ * @throws Error if the type is invalid or payload is missing "v" field
33
+ */
34
+ function encodeMindooURI(type, payload) {
35
+ if (!VALID_TYPES.has(type)) {
36
+ throw new Error(`Invalid MindooDB URI type: "${type}". Valid types: ${[...VALID_TYPES].join(", ")}`);
37
+ }
38
+ if (typeof payload.v !== "number" || !Number.isInteger(payload.v) || payload.v < 1) {
39
+ throw new Error(`MindooDB URI payload must contain a "v" field with a positive integer version number`);
40
+ }
41
+ const jsonStr = JSON.stringify(payload);
42
+ const base64url = toBase64Url(jsonStr);
43
+ return `${MDB_SCHEME}${type}/${base64url}`;
44
+ }
45
+ /**
46
+ * Decode a mdb:// URI string back into its type and payload.
47
+ *
48
+ * @param uri The mdb:// URI string to decode
49
+ * @returns The decoded URI with type, version, and payload
50
+ * @throws Error if the URI is malformed or has an invalid type
51
+ */
52
+ function decodeMindooURI(uri) {
53
+ if (!uri.startsWith(MDB_SCHEME)) {
54
+ throw new Error(`Invalid MindooDB URI: must start with "${MDB_SCHEME}"`);
55
+ }
56
+ const remainder = uri.substring(MDB_SCHEME.length);
57
+ const slashIdx = remainder.indexOf("/");
58
+ if (slashIdx === -1) {
59
+ throw new Error(`Invalid MindooDB URI: missing type/payload separator "/"`);
60
+ }
61
+ const type = remainder.substring(0, slashIdx);
62
+ const base64urlPayload = remainder.substring(slashIdx + 1);
63
+ if (!VALID_TYPES.has(type)) {
64
+ throw new Error(`Invalid MindooDB URI type: "${type}". Valid types: ${[...VALID_TYPES].join(", ")}`);
65
+ }
66
+ if (!base64urlPayload) {
67
+ throw new Error(`Invalid MindooDB URI: empty payload`);
68
+ }
69
+ let jsonStr;
70
+ try {
71
+ jsonStr = fromBase64Url(base64urlPayload);
72
+ }
73
+ catch {
74
+ throw new Error(`Invalid MindooDB URI: payload is not valid base64url`);
75
+ }
76
+ let payload;
77
+ try {
78
+ payload = JSON.parse(jsonStr);
79
+ }
80
+ catch {
81
+ throw new Error(`Invalid MindooDB URI: payload is not valid JSON`);
82
+ }
83
+ if (typeof payload !== "object" || payload === null || Array.isArray(payload)) {
84
+ throw new Error(`Invalid MindooDB URI: payload must be a JSON object`);
85
+ }
86
+ if (typeof payload.v !== "number" || !Number.isInteger(payload.v) || payload.v < 1) {
87
+ throw new Error(`Invalid MindooDB URI: payload must contain a "v" field with a positive integer version number`);
88
+ }
89
+ return {
90
+ type: type,
91
+ version: payload.v,
92
+ payload: payload,
93
+ };
94
+ }
95
+ /**
96
+ * Check if a string is a valid mdb:// URI.
97
+ *
98
+ * Performs structural validation only (scheme, type, base64url payload).
99
+ * Does not validate the payload contents.
100
+ *
101
+ * @param value The string to check
102
+ * @returns True if the string is a valid mdb:// URI
103
+ */
104
+ function isMindooURI(value) {
105
+ if (!value.startsWith(MDB_SCHEME)) {
106
+ return false;
107
+ }
108
+ const remainder = value.substring(MDB_SCHEME.length);
109
+ const slashIdx = remainder.indexOf("/");
110
+ if (slashIdx === -1) {
111
+ return false;
112
+ }
113
+ const type = remainder.substring(0, slashIdx);
114
+ const base64urlPayload = remainder.substring(slashIdx + 1);
115
+ if (!VALID_TYPES.has(type) || !base64urlPayload) {
116
+ return false;
117
+ }
118
+ try {
119
+ const jsonStr = fromBase64Url(base64urlPayload);
120
+ const parsed = JSON.parse(jsonStr);
121
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed);
122
+ }
123
+ catch {
124
+ return false;
125
+ }
126
+ }
127
+ // ==================== Base64url Helpers ====================
128
+ /**
129
+ * Encode a UTF-8 string to base64url (URL-safe, no padding).
130
+ */
131
+ function toBase64Url(str) {
132
+ // Use Buffer if available (Node.js), otherwise TextEncoder + btoa (browser)
133
+ if (typeof Buffer !== "undefined") {
134
+ return Buffer.from(str, "utf-8")
135
+ .toString("base64")
136
+ .replace(/\+/g, "-")
137
+ .replace(/\//g, "_")
138
+ .replace(/=+$/, "");
139
+ }
140
+ const bytes = new TextEncoder().encode(str);
141
+ let binary = "";
142
+ for (let i = 0; i < bytes.length; i++) {
143
+ binary += String.fromCharCode(bytes[i]);
144
+ }
145
+ return btoa(binary)
146
+ .replace(/\+/g, "-")
147
+ .replace(/\//g, "_")
148
+ .replace(/=+$/, "");
149
+ }
150
+ /**
151
+ * Decode a base64url string to UTF-8 string.
152
+ */
153
+ function fromBase64Url(base64url) {
154
+ // Restore standard base64 characters and padding
155
+ let base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
156
+ const paddingNeeded = (4 - (base64.length % 4)) % 4;
157
+ base64 += "=".repeat(paddingNeeded);
158
+ // Use Buffer if available (Node.js), otherwise atob + TextDecoder (browser)
159
+ if (typeof Buffer !== "undefined") {
160
+ return Buffer.from(base64, "base64").toString("utf-8");
161
+ }
162
+ const binary = atob(base64);
163
+ const bytes = new Uint8Array(binary.length);
164
+ for (let i = 0; i < binary.length; i++) {
165
+ bytes[i] = binary.charCodeAt(i);
166
+ }
167
+ return new TextDecoder().decode(bytes);
168
+ }
169
+ //# sourceMappingURL=MindooURI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MindooURI.js","sourceRoot":"","sources":["../../../src/core/uri/MindooURI.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;AAoCH,0CAYC;AASD,0CAkDC;AAWD,kCA0BC;AAzID,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAgB;IAC9D,cAAc;IACd,eAAe;CAChB,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,QAAQ,CAAC;AAc5B;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,IAAmB,EAAE,OAAgC;IACnF,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,mBAAmB,CAAC,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