@open-e2ee/signal-protocol-sdk 12.0.0 → 13.0.0

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 (171) hide show
  1. package/ADAPTERS.md +3 -0
  2. package/ARCHITECTURE.md +4 -4
  3. package/CHANGELOG.md +165 -0
  4. package/README.md +1 -1
  5. package/SECURITY.md +2 -2
  6. package/TROUBLESHOOTING.md +7 -7
  7. package/client/README.md +40 -0
  8. package/device/README.md +29 -3
  9. package/dist/client/client.d.ts +8 -0
  10. package/dist/client/client.d.ts.map +1 -1
  11. package/dist/client/client.js +26 -3
  12. package/dist/client/client.js.map +1 -1
  13. package/dist/client/config.d.ts +19 -12
  14. package/dist/client/config.d.ts.map +1 -1
  15. package/dist/client/config.js.map +1 -1
  16. package/dist/client/event-hooks.d.ts +28 -0
  17. package/dist/client/event-hooks.d.ts.map +1 -1
  18. package/dist/client/event-hooks.js +1 -0
  19. package/dist/client/event-hooks.js.map +1 -1
  20. package/dist/client/group-init-status.d.ts +21 -0
  21. package/dist/client/group-init-status.d.ts.map +1 -0
  22. package/dist/client/group-init-status.js +156 -0
  23. package/dist/client/group-init-status.js.map +1 -0
  24. package/dist/client/hosted-device-link.d.ts +97 -0
  25. package/dist/client/hosted-device-link.d.ts.map +1 -0
  26. package/dist/client/hosted-device-link.js +149 -0
  27. package/dist/client/hosted-device-link.js.map +1 -0
  28. package/dist/client/hosted-http-error.d.ts +30 -0
  29. package/dist/client/hosted-http-error.d.ts.map +1 -0
  30. package/dist/client/hosted-http-error.js +34 -0
  31. package/dist/client/hosted-http-error.js.map +1 -0
  32. package/dist/client/hosted-presence.js +1 -1
  33. package/dist/client/hosted-presence.js.map +1 -1
  34. package/dist/client/hosted-profile-keys.js +1 -1
  35. package/dist/client/hosted-profile-keys.js.map +1 -1
  36. package/dist/client/hosted-sandbox-identity.d.ts +3 -3
  37. package/dist/client/hosted-sandbox-identity.js +3 -3
  38. package/dist/client/hosted-transport.d.ts +0 -11
  39. package/dist/client/hosted-transport.d.ts.map +1 -1
  40. package/dist/client/hosted-transport.js +1 -15
  41. package/dist/client/hosted-transport.js.map +1 -1
  42. package/dist/client/hosted.d.ts +53 -7
  43. package/dist/client/hosted.d.ts.map +1 -1
  44. package/dist/client/hosted.js +158 -17
  45. package/dist/client/hosted.js.map +1 -1
  46. package/dist/client/index.d.ts +2 -1
  47. package/dist/client/index.d.ts.map +1 -1
  48. package/dist/client/index.js +1 -1
  49. package/dist/client/index.js.map +1 -1
  50. package/dist/client/receive-queue.d.ts +4 -2
  51. package/dist/client/receive-queue.d.ts.map +1 -1
  52. package/dist/client/receive-queue.js +26 -22
  53. package/dist/client/receive-queue.js.map +1 -1
  54. package/dist/index.d.ts +2 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/internal/manager/manager.d.ts +6 -1
  59. package/dist/internal/manager/manager.d.ts.map +1 -1
  60. package/dist/internal/manager/manager.js +8 -2
  61. package/dist/internal/manager/manager.js.map +1 -1
  62. package/dist/internal/session/cipher.d.ts +2 -2
  63. package/dist/internal/session/cipher.js +1 -1
  64. package/dist/internal/session/types.d.ts +1 -1
  65. package/dist/local/store/conformance/cases/ciphertext.d.ts +7 -0
  66. package/dist/local/store/conformance/cases/ciphertext.d.ts.map +1 -0
  67. package/dist/local/store/conformance/cases/ciphertext.js +55 -0
  68. package/dist/local/store/conformance/cases/ciphertext.js.map +1 -0
  69. package/dist/local/store/conformance/cases/durability.d.ts +6 -0
  70. package/dist/local/store/conformance/cases/durability.d.ts.map +1 -0
  71. package/dist/local/store/conformance/cases/durability.js +34 -0
  72. package/dist/local/store/conformance/cases/durability.js.map +1 -0
  73. package/dist/local/store/conformance/cases/identity.d.ts +7 -0
  74. package/dist/local/store/conformance/cases/identity.d.ts.map +1 -0
  75. package/dist/local/store/conformance/cases/identity.js +84 -0
  76. package/dist/local/store/conformance/cases/identity.js.map +1 -0
  77. package/dist/local/store/conformance/cases/metadata.d.ts +7 -0
  78. package/dist/local/store/conformance/cases/metadata.d.ts.map +1 -0
  79. package/dist/local/store/conformance/cases/metadata.js +48 -0
  80. package/dist/local/store/conformance/cases/metadata.js.map +1 -0
  81. package/dist/local/store/conformance/cases/protection.d.ts +7 -0
  82. package/dist/local/store/conformance/cases/protection.d.ts.map +1 -0
  83. package/dist/local/store/conformance/cases/protection.js +14 -0
  84. package/dist/local/store/conformance/cases/protection.js.map +1 -0
  85. package/dist/local/store/conformance/cases/receive-work.d.ts +8 -0
  86. package/dist/local/store/conformance/cases/receive-work.d.ts.map +1 -0
  87. package/dist/local/store/conformance/cases/receive-work.js +152 -0
  88. package/dist/local/store/conformance/cases/receive-work.js.map +1 -0
  89. package/dist/local/store/conformance/cases/sender-key.d.ts +7 -0
  90. package/dist/local/store/conformance/cases/sender-key.d.ts.map +1 -0
  91. package/dist/local/store/conformance/cases/sender-key.js +59 -0
  92. package/dist/local/store/conformance/cases/sender-key.js.map +1 -0
  93. package/dist/local/store/conformance/cases/session-trust.d.ts +7 -0
  94. package/dist/local/store/conformance/cases/session-trust.d.ts.map +1 -0
  95. package/dist/local/store/conformance/cases/session-trust.js +64 -0
  96. package/dist/local/store/conformance/cases/session-trust.js.map +1 -0
  97. package/dist/local/store/conformance/checks.d.ts +15 -0
  98. package/dist/local/store/conformance/checks.d.ts.map +1 -0
  99. package/dist/local/store/conformance/checks.js +67 -0
  100. package/dist/local/store/conformance/checks.js.map +1 -0
  101. package/dist/local/store/conformance/index.d.ts +30 -0
  102. package/dist/local/store/conformance/index.d.ts.map +1 -0
  103. package/dist/local/store/conformance/index.js +29 -0
  104. package/dist/local/store/conformance/index.js.map +1 -0
  105. package/dist/local/store/conformance/records.d.ts +36 -0
  106. package/dist/local/store/conformance/records.d.ts.map +1 -0
  107. package/dist/local/store/conformance/records.js +109 -0
  108. package/dist/local/store/conformance/records.js.map +1 -0
  109. package/dist/local/store/conformance/run.d.ts +24 -0
  110. package/dist/local/store/conformance/run.d.ts.map +1 -0
  111. package/dist/local/store/conformance/run.js +156 -0
  112. package/dist/local/store/conformance/run.js.map +1 -0
  113. package/dist/local/store/conformance/types.d.ts +55 -0
  114. package/dist/local/store/conformance/types.d.ts.map +1 -0
  115. package/dist/local/store/conformance/types.js +6 -0
  116. package/dist/local/store/conformance/types.js.map +1 -0
  117. package/dist/local/store/expo/adapter.d.ts +2 -1
  118. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  119. package/dist/local/store/expo/adapter.js.map +1 -1
  120. package/dist/local/store/node/adapter.d.ts +2 -2
  121. package/dist/local/store/react-native/adapter.d.ts +2 -1
  122. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  123. package/dist/local/store/react-native/adapter.js.map +1 -1
  124. package/dist/local/store/sqlite/convert-plaintext.d.ts +62 -0
  125. package/dist/local/store/sqlite/convert-plaintext.d.ts.map +1 -0
  126. package/dist/local/store/sqlite/convert-plaintext.js +236 -0
  127. package/dist/local/store/sqlite/convert-plaintext.js.map +1 -0
  128. package/dist/local/store/sqlite/driver.d.ts +9 -0
  129. package/dist/local/store/sqlite/driver.d.ts.map +1 -1
  130. package/dist/local/store/sqlite/encryption.d.ts +21 -0
  131. package/dist/local/store/sqlite/encryption.d.ts.map +1 -1
  132. package/dist/local/store/sqlite/encryption.js.map +1 -1
  133. package/dist/local/store/sqlite/errors.d.ts.map +1 -1
  134. package/dist/local/store/sqlite/errors.js +2 -1
  135. package/dist/local/store/sqlite/errors.js.map +1 -1
  136. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts +3 -1
  137. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts.map +1 -1
  138. package/dist/local/store/sqlite/key-storage/identity-keys.js +3 -1
  139. package/dist/local/store/sqlite/key-storage/identity-keys.js.map +1 -1
  140. package/dist/local/store/sqlite/open-store.d.ts +36 -4
  141. package/dist/local/store/sqlite/open-store.d.ts.map +1 -1
  142. package/dist/local/store/sqlite/open-store.js +326 -21
  143. package/dist/local/store/sqlite/open-store.js.map +1 -1
  144. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +2 -1
  145. package/dist/local/store/sqlite/web/worker.d.ts +13 -0
  146. package/dist/local/store/sqlite/web/worker.d.ts.map +1 -1
  147. package/dist/local/store/sqlite/web/worker.js +163 -22
  148. package/dist/local/store/sqlite/web/worker.js.map +1 -1
  149. package/dist/local/store/web-sqlite/adapter.d.ts +3 -2
  150. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
  151. package/dist/local/store/web-sqlite/adapter.js +12 -2
  152. package/dist/local/store/web-sqlite/adapter.js.map +1 -1
  153. package/dist/remote/relay/types.d.ts +4 -2
  154. package/dist/remote/relay/types.d.ts.map +1 -1
  155. package/dist/types/api.d.ts +20 -4
  156. package/dist/types/api.d.ts.map +1 -1
  157. package/docs/ASSURANCE.md +25 -7
  158. package/docs/DEVIATIONS.md +35 -3
  159. package/docs/ERROR_HANDLING.md +8 -6
  160. package/docs/GETTING_STARTED.md +15 -8
  161. package/docs/INTERFACES.md +3 -1
  162. package/docs/PACKAGE_SURFACE.md +1 -0
  163. package/docs/SECURITY.md +23 -5
  164. package/keys/README.md +3 -1
  165. package/local/store/README.md +92 -12
  166. package/local/store/expo/README.md +63 -6
  167. package/local/store/key-value/README.md +3 -2
  168. package/local/store/node/README.md +68 -6
  169. package/local/store/react-native/README.md +62 -4
  170. package/local/store/web-sqlite/README.md +73 -4
  171. package/package.json +5 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../../../local/store/conformance/checks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAE3C;AAuBD,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAErE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAUrF;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAIlE;AAED,oDAAoD;AACpD,wBAAsB,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAYlG;AAED,qCAAqC;AACrC,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAInD"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * The checks of the local store conformance kit. A failed check throws an
3
+ * error that names what the store did wrong. The checks avoid class syntax,
4
+ * so they run under any JavaScript engine.
5
+ */
6
+ export function fail(message) {
7
+ throw new Error(message);
8
+ }
9
+ /**
10
+ * A stable text of a value: object keys in sorted order, bytes as a list of
11
+ * numbers, and undefined properties left out. Two stores that return equal
12
+ * data in a different key order give the same text.
13
+ */
14
+ function canonical(value) {
15
+ if (ArrayBuffer.isView(value)) {
16
+ return { bytes: Array.from(new Uint8Array(value.buffer, value.byteOffset, value.byteLength)) };
17
+ }
18
+ if (Array.isArray(value))
19
+ return value.map(canonical);
20
+ if (value !== null && typeof value === 'object') {
21
+ const sorted = {};
22
+ for (const key of Object.keys(value).sort()) {
23
+ const item = value[key];
24
+ if (item !== undefined)
25
+ sorted[key] = canonical(item);
26
+ }
27
+ return sorted;
28
+ }
29
+ return value;
30
+ }
31
+ export function sameValue(actual, expected) {
32
+ return JSON.stringify(canonical(actual)) === JSON.stringify(canonical(expected));
33
+ }
34
+ export function assertEqual(actual, expected, context) {
35
+ if (!sameValue(actual, expected)) {
36
+ fail(context +
37
+ ': expected ' +
38
+ JSON.stringify(canonical(expected)) +
39
+ ', got ' +
40
+ JSON.stringify(canonical(actual)));
41
+ }
42
+ }
43
+ /** Fail unless `value` is null or undefined, the two forms of an absent value. */
44
+ export function assertAbsent(value, context) {
45
+ if (value !== null && value !== undefined) {
46
+ fail(context + ': expected no value, got ' + JSON.stringify(canonical(value)));
47
+ }
48
+ }
49
+ /** Wait for `promise` and fail when it resolves. */
50
+ export async function expectRejection(promise, context) {
51
+ let error = null;
52
+ let rejected = false;
53
+ await promise.then(function resolved() { }, function caught(reason) {
54
+ rejected = true;
55
+ error = reason;
56
+ });
57
+ if (!rejected)
58
+ fail(context + ': expected the call to reject, but it resolved');
59
+ return error;
60
+ }
61
+ /** The message of a thrown value. */
62
+ export function errorMessage(error) {
63
+ return error !== null && typeof error === 'object' && 'message' in error
64
+ ? String(error.message)
65
+ : String(error);
66
+ }
67
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sourceRoot":"","sources":["../../../../local/store/conformance/checks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,UAAU,IAAI,CAAC,OAAe;IAClC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;IACjG,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACtD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,MAAM,MAAM,GAA4B,EAAE,CAAC;QAC3C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YAC5C,MAAM,IAA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AM,CAAC,MAAe;QAC7B,QAAQ,GAAG,IAAI,CAAC;QAChB,KAAK,GAAG,MAAM,CAAC;IACjB,CAAC,CACF,CAAC;IACF,IAAI,CAAC,QAAQ;QAAE,IAAI,CAAC,OAAO,GAAG,gDAAgD,CAAC,CAAC;IAChF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,qCAAqC;AACrC,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK;QACtE,CAAC,CAAC,MAAM,CAAE,KAA8B,CAAC,OAAO,CAAC;QACjD,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Conformance kit for a custom local store.
3
+ *
4
+ * An application that implements `SignalProtocolLocalStore` itself runs this
5
+ * kit against its store. The kit checks the identity overwrite, the atomic
6
+ * session trust and sender key commits and their rollback, metadata
7
+ * compare-and-set, the receive records, durability after a reopen, the
8
+ * stored bytes of a store that declares a cipher, and the protection
9
+ * declaration. It does not check the sender key handoffs, the message
10
+ * records, or the group send log.
11
+ *
12
+ * The kit has no framework or platform dependencies. It runs unchanged under
13
+ * jest, Node, a browser, or Hermes.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { assertLocalStoreConformance } from '@open-e2ee/signal-protocol-sdk/local/store/conformance';
18
+ *
19
+ * await assertLocalStoreConformance({
20
+ * createStore: () => openMyStore({ name: freshName() }),
21
+ * reopen: (store) => reopenMyStore(store),
22
+ * armWriteFailure: (store) => failNextReceiveRecordWrite(store),
23
+ * readRawBytes: (store) => readMyStoreFiles(store),
24
+ * closeStore: (store) => store.close(),
25
+ * });
26
+ * ```
27
+ */
28
+ export { assertLocalStoreConformance, runLocalStoreConformance } from './run.js';
29
+ export type { LocalStoreConformanceFailure, LocalStoreConformanceOptions, LocalStoreConformanceResult, } from './types.js';
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../local/store/conformance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAC9E,YAAY,EACV,4BAA4B,EAC5B,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,SAAS,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Conformance kit for a custom local store.
3
+ *
4
+ * An application that implements `SignalProtocolLocalStore` itself runs this
5
+ * kit against its store. The kit checks the identity overwrite, the atomic
6
+ * session trust and sender key commits and their rollback, metadata
7
+ * compare-and-set, the receive records, durability after a reopen, the
8
+ * stored bytes of a store that declares a cipher, and the protection
9
+ * declaration. It does not check the sender key handoffs, the message
10
+ * records, or the group send log.
11
+ *
12
+ * The kit has no framework or platform dependencies. It runs unchanged under
13
+ * jest, Node, a browser, or Hermes.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { assertLocalStoreConformance } from '@open-e2ee/signal-protocol-sdk/local/store/conformance';
18
+ *
19
+ * await assertLocalStoreConformance({
20
+ * createStore: () => openMyStore({ name: freshName() }),
21
+ * reopen: (store) => reopenMyStore(store),
22
+ * armWriteFailure: (store) => failNextReceiveRecordWrite(store),
23
+ * readRawBytes: (store) => readMyStoreFiles(store),
24
+ * closeStore: (store) => store.close(),
25
+ * });
26
+ * ```
27
+ */
28
+ export { assertLocalStoreConformance, runLocalStoreConformance } from './run.js';
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../local/store/conformance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The records that the local store conformance cases write. Each one is a
3
+ * valid value that every store accepts, and none comes from a live protocol
4
+ * run.
5
+ */
6
+ import type { SenderKeyState } from '../../../internal/protocol/sender-keys/manager.js';
7
+ import type { CompositeIdentityV1 } from '../../../keys/index.js';
8
+ import { ProtocolAddress } from '../../../types/address.js';
9
+ import type { ReceiveWorkRecord } from '../../../types/api.js';
10
+ import { type SessionRecord } from '../../../types/session.js';
11
+ /**
12
+ * A text that no store writes on its own. The ciphertext scan writes it in
13
+ * values that a cipher must protect, then looks for it in the stored bytes.
14
+ */
15
+ export declare const PLAINTEXT_MARKER = "local-store-conformance-plaintext-marker";
16
+ /** A 32-byte key in base64. Each seed gives a different key. */
17
+ export declare function testKey(seed: number): string;
18
+ /** A contact identity. Each seed gives a different identity. */
19
+ export declare function contactIdentity(seed: number): CompositeIdentityV1;
20
+ /**
21
+ * A current session record for `address`. The received message count
22
+ * tells two records apart.
23
+ */
24
+ export declare function sessionRecord(address: ProtocolAddress, receivedMessages: number): SessionRecord;
25
+ /** The sender key ID of every sender key state of the kit. */
26
+ export declare const SENDER_KEY_ID = "00000000-0000-4000-8000-0000000000c1";
27
+ /** A sender key state at `chainIndex`. */
28
+ export declare function senderKeyState(chainIndex: number, chainKey?: string): SenderKeyState;
29
+ /** A skipped message key. Each index gives a different key. */
30
+ export declare function skippedMessageKey(index: number): {
31
+ cipherKey: string;
32
+ iv: string;
33
+ };
34
+ /** A valid receive record with its size set. Each override replaces one field. */
35
+ export declare function receiveWork(workId: string, overrides?: Partial<ReceiveWorkRecord>): ReceiveWorkRecord;
36
+ //# sourceMappingURL=records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../../local/store/conformance/records.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,KAAK,EAAE,mBAAmB,EAAyB,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5F;;;GAGG;AACH,eAAO,MAAM,gBAAgB,6CAA6C,CAAC;AAE3E,gEAAgE;AAChE,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAMjE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,GAAG,aAAa,CA0C/F;AAED,8DAA8D;AAC9D,eAAO,MAAM,aAAa,yCAAyC,CAAC;AAEpE,0CAA0C;AAC1C,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,SAA4B,GAAG,cAAc,CAYvG;AAED,+DAA+D;AAC/D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAElF;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CACzB,MAAM,EAAE,MAAM,EACd,SAAS,GAAE,OAAO,CAAC,iBAAiB,CAAM,GACzC,iBAAiB,CAanB"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * The records that the local store conformance cases write. Each one is a
3
+ * valid value that every store accepts, and none comes from a live protocol
4
+ * run.
5
+ */
6
+ import { bytesToBase64 } from '../../../internal/crypto/utils.js';
7
+ import { ProtocolAddress } from '../../../types/address.js';
8
+ import { CURRENT_SESSION_RECORD_VERSION } from '../../../types/session.js';
9
+ import { sizedReceiveWork } from '../receive-work.js';
10
+ /**
11
+ * A text that no store writes on its own. The ciphertext scan writes it in
12
+ * values that a cipher must protect, then looks for it in the stored bytes.
13
+ */
14
+ export const PLAINTEXT_MARKER = 'local-store-conformance-plaintext-marker';
15
+ /** A 32-byte key in base64. Each seed gives a different key. */
16
+ export function testKey(seed) {
17
+ return bytesToBase64(Uint8Array.from({ length: 32 }, (_, index) => (seed + index * 13) & 0xff));
18
+ }
19
+ /** A contact identity. Each seed gives a different identity. */
20
+ export function contactIdentity(seed) {
21
+ return {
22
+ version: 1,
23
+ x25519PublicKey: testKey(seed),
24
+ ed25519PublicKey: testKey(seed + 1),
25
+ };
26
+ }
27
+ /**
28
+ * A current session record for `address`. The received message count
29
+ * tells two records apart.
30
+ */
31
+ export function sessionRecord(address, receivedMessages) {
32
+ return {
33
+ currentSession: {
34
+ baseKey: testKey(20),
35
+ localAddress: ProtocolAddress.create('conformance-local-user', 1),
36
+ remoteAddress: address,
37
+ localDeviceId: 1,
38
+ remoteDeviceId: address.deviceId,
39
+ localRegistrationId: 1,
40
+ remoteRegistrationId: 1,
41
+ RK: testKey(21),
42
+ DHs: { publicKey: testKey(22), privateKey: testKey(23) },
43
+ DHr: testKey(24),
44
+ CKs: testKey(25),
45
+ CKr: testKey(26),
46
+ Ns: 0,
47
+ Nr: receivedMessages,
48
+ PN: 0,
49
+ receiverChains: [],
50
+ identityKeyPair: {
51
+ dhKey: { publicKey: testKey(27), privateKey: testKey(28) },
52
+ signingKey: { publicKey: testKey(29), privateKey: testKey(30) },
53
+ registrationId: 1,
54
+ },
55
+ localIdentity: {
56
+ version: 1,
57
+ x25519PublicKey: testKey(27),
58
+ ed25519PublicKey: testKey(29),
59
+ },
60
+ remoteIdentity: {
61
+ version: 1,
62
+ x25519PublicKey: testKey(31),
63
+ ed25519PublicKey: testKey(32),
64
+ },
65
+ localIdentityType: 'aci',
66
+ remoteIdentityType: 'aci',
67
+ createdAt: 1_000,
68
+ lastUsedAt: 1_000,
69
+ },
70
+ archivedSessions: {},
71
+ version: CURRENT_SESSION_RECORD_VERSION,
72
+ };
73
+ }
74
+ /** The sender key ID of every sender key state of the kit. */
75
+ export const SENDER_KEY_ID = '00000000-0000-4000-8000-0000000000c1';
76
+ /** A sender key state at `chainIndex`. */
77
+ export function senderKeyState(chainIndex, chainKey = 'chain-key-' + chainIndex) {
78
+ return {
79
+ senderKeyId: SENDER_KEY_ID,
80
+ senderKeyVersion: 'v2',
81
+ chainId: 1,
82
+ generation: 0,
83
+ chainKey: chainKey,
84
+ signatureKey: 'signature-key',
85
+ publicSignatureKey: 'public-signature-key',
86
+ chainIndex: chainIndex,
87
+ createdAt: 1_000,
88
+ };
89
+ }
90
+ /** A skipped message key. Each index gives a different key. */
91
+ export function skippedMessageKey(index) {
92
+ return { cipherKey: testKey(40 + index), iv: testKey(80 + index) };
93
+ }
94
+ /** A valid receive record with its size set. Each override replaces one field. */
95
+ export function receiveWork(workId, overrides = {}) {
96
+ return sizedReceiveWork({
97
+ workId: workId,
98
+ revision: 0,
99
+ stage: 'decrypted',
100
+ origin: 'relay',
101
+ arrivalSeq: 1,
102
+ receivedAt: 1_000,
103
+ dueAt: 1_000,
104
+ sizeBytes: 0,
105
+ plaintext: 'content of ' + workId,
106
+ ...overrides,
107
+ });
108
+ }
109
+ //# sourceMappingURL=records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.js","sourceRoot":"","sources":["../../../../local/store/conformance/records.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAG/D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,8BAA8B,EAAsB,MAAM,wBAAwB,CAAC;AAE5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,0CAA0C,CAAC;AAE3E,gEAAgE;AAChE,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAA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ACd,SAAS,GAA+B,EAAE;IAE1C,OAAO,gBAAgB,CAAC;QACtB,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,KAAK;QACZ,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,aAAa,GAAG,MAAM;QACjC,GAAG,SAAS;KACb,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The runner of the local store conformance kit. It runs each case on a
3
+ * fresh store from the application, and it reports each case as passed,
4
+ * skipped, or failed.
5
+ *
6
+ * The runner has no framework or platform dependencies, and avoids class
7
+ * syntax. It runs unchanged under jest, Node, a browser, or Hermes.
8
+ */
9
+ import type { LocalStoreConformanceOptions, LocalStoreConformanceResult } from './types.js';
10
+ /**
11
+ * Run every case of the kit on stores from `options.createStore`, and report
12
+ * the outcome without throwing. A case that needs an option that is not
13
+ * given is skipped, and so is the ciphertext case on a store that declares
14
+ * no cipher.
15
+ */
16
+ export declare function runLocalStoreConformance(options: LocalStoreConformanceOptions): Promise<LocalStoreConformanceResult>;
17
+ /**
18
+ * Run the kit, and throw with every problem listed when the store does not
19
+ * conform. A failed case is a problem. A skipped rollback case is also a
20
+ * problem, because a store must prove that its atomic commits roll back.
21
+ * This is the form for the automated checks of an application.
22
+ */
23
+ export declare function assertLocalStoreConformance(options: LocalStoreConformanceOptions): Promise<LocalStoreConformanceResult>;
24
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../local/store/conformance/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EAGV,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AA6EjB;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,2BAA2B,CAAC,CA2BtC;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,2BAA2B,CAAC,CA6BtC"}
@@ -0,0 +1,156 @@
1
+ /**
2
+ * The runner of the local store conformance kit. It runs each case on a
3
+ * fresh store from the application, and it reports each case as passed,
4
+ * skipped, or failed.
5
+ *
6
+ * The runner has no framework or platform dependencies, and avoids class
7
+ * syntax. It runs unchanged under jest, Node, a browser, or Hermes.
8
+ */
9
+ import { errorMessage } from './checks.js';
10
+ import { ciphertextCases } from './cases/ciphertext.js';
11
+ import { durabilityCases } from './cases/durability.js';
12
+ import { identityCases } from './cases/identity.js';
13
+ import { metadataCases } from './cases/metadata.js';
14
+ import { protectionCases } from './cases/protection.js';
15
+ import { receiveWorkCases } from './cases/receive-work.js';
16
+ import { senderKeyCases } from './cases/sender-key.js';
17
+ import { sessionTrustCases } from './cases/session-trust.js';
18
+ const CASES = [
19
+ ...identityCases,
20
+ ...sessionTrustCases,
21
+ ...senderKeyCases,
22
+ ...metadataCases,
23
+ ...receiveWorkCases,
24
+ ...durabilityCases,
25
+ ...ciphertextCases,
26
+ ...protectionCases,
27
+ ];
28
+ /** The name of the case that reads the protection declaration. */
29
+ const PROTECTION_CASE = protectionCases[0].name;
30
+ function missingOption(option) {
31
+ throw new Error('The case needs the ' + option + ' option.');
32
+ }
33
+ /** Run one case on a fresh store, and close that store after the case. */
34
+ async function runCase(conformanceCase, options, report) {
35
+ let current;
36
+ try {
37
+ current = await options.createStore();
38
+ }
39
+ catch (error) {
40
+ return { outcome: 'failed', message: 'createStore failed: ' + errorMessage(error) };
41
+ }
42
+ const context = {
43
+ get store() {
44
+ return current;
45
+ },
46
+ reopen: async function reopen() {
47
+ if (!options.reopen)
48
+ missingOption('reopen');
49
+ current = await options.reopen(current);
50
+ return current;
51
+ },
52
+ armWriteFailure: function armWriteFailure() {
53
+ if (!options.armWriteFailure)
54
+ missingOption('armWriteFailure');
55
+ options.armWriteFailure(current);
56
+ },
57
+ readRawBytes: function readRawBytes() {
58
+ if (!options.readRawBytes)
59
+ missingOption('readRawBytes');
60
+ return options.readRawBytes(current);
61
+ },
62
+ reportProtection: report,
63
+ };
64
+ let outcome;
65
+ try {
66
+ if (conformanceCase.applies && !conformanceCase.applies(current)) {
67
+ outcome = { outcome: 'skipped' };
68
+ }
69
+ else {
70
+ await conformanceCase.run(context);
71
+ outcome = { outcome: 'passed' };
72
+ }
73
+ }
74
+ catch (error) {
75
+ outcome = { outcome: 'failed', message: errorMessage(error) };
76
+ }
77
+ if (options.closeStore) {
78
+ try {
79
+ await options.closeStore(current);
80
+ }
81
+ catch (error) {
82
+ if (outcome.outcome !== 'failed') {
83
+ outcome = { outcome: 'failed', message: 'closeStore failed: ' + errorMessage(error) };
84
+ }
85
+ }
86
+ }
87
+ return outcome;
88
+ }
89
+ /**
90
+ * Run every case of the kit on stores from `options.createStore`, and report
91
+ * the outcome without throwing. A case that needs an option that is not
92
+ * given is skipped, and so is the ciphertext case on a store that declares
93
+ * no cipher.
94
+ */
95
+ export async function runLocalStoreConformance(options) {
96
+ const result = {
97
+ total: CASES.length,
98
+ passed: [],
99
+ skipped: [],
100
+ failures: [],
101
+ protection: null,
102
+ };
103
+ for (const conformanceCase of CASES) {
104
+ if (conformanceCase.needs && !options[conformanceCase.needs]) {
105
+ result.skipped.push(conformanceCase.name);
106
+ continue;
107
+ }
108
+ let reported = null;
109
+ const outcome = await runCase(conformanceCase, options, function report(protection) {
110
+ reported = protection;
111
+ });
112
+ if (outcome.outcome === 'failed') {
113
+ result.failures.push({ name: conformanceCase.name, message: outcome.message });
114
+ }
115
+ else if (outcome.outcome === 'skipped') {
116
+ result.skipped.push(conformanceCase.name);
117
+ }
118
+ else {
119
+ result.passed.push(conformanceCase.name);
120
+ if (conformanceCase.name === PROTECTION_CASE)
121
+ result.protection = reported;
122
+ }
123
+ }
124
+ return result;
125
+ }
126
+ /**
127
+ * Run the kit, and throw with every problem listed when the store does not
128
+ * conform. A failed case is a problem. A skipped rollback case is also a
129
+ * problem, because a store must prove that its atomic commits roll back.
130
+ * This is the form for the automated checks of an application.
131
+ */
132
+ export async function assertLocalStoreConformance(options) {
133
+ const result = await runLocalStoreConformance(options);
134
+ const lines = [];
135
+ for (const failure of result.failures) {
136
+ lines.push('- ' + failure.name + ': ' + failure.message);
137
+ }
138
+ for (const conformanceCase of CASES) {
139
+ if (conformanceCase.needs === 'armWriteFailure' &&
140
+ result.skipped.indexOf(conformanceCase.name) !== -1) {
141
+ lines.push('- ' +
142
+ conformanceCase.name +
143
+ ': skipped. Give armWriteFailure, so that the rollback of an atomic commit can run.');
144
+ }
145
+ }
146
+ if (lines.length > 0) {
147
+ throw new Error('Local store conformance failed (' +
148
+ lines.length +
149
+ ' of ' +
150
+ result.total +
151
+ ' cases):\n' +
152
+ lines.join('\n'));
153
+ }
154
+ return result;
155
+ }
156
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../local/store/conformance/run.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAQ1D,MAAM,KAAK,GAAyC;IAClD,GAAG,aAAa;I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,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,CAAC;IACD,KAAK,MAAM,eAAe,IAAI,KAAK,EAAE,CAAC;QACpC,IACE,eAAe,CAAC,KAAK,KAAK,iBAAiB;YAC3C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EACnD,CAAC;YACD,KAAK,CAAC,IAAI,CACR,IAAI;gBACF,eAAe,CAAC,IAAI;gBACpB,oFAAoF,CACvF,CAAC;QACJ,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,kCAAkC;YAChC,KAAK,CAAC,MAAM;YACZ,MAAM;YACN,MAAM,CAAC,KAAK;YACZ,YAAY;YACZ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CACnB,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The options, the result, and the case shape of the local store
3
+ * conformance kit.
4
+ */
5
+ import type { LocalStoreProtection, SignalProtocolLocalStore } from '../../../types/api.js';
6
+ export interface LocalStoreConformanceOptions {
7
+ /** A fresh, empty store for each case. */
8
+ createStore(): Promise<SignalProtocolLocalStore>;
9
+ /** Close and open the same store. Durability cases skip without it. */
10
+ reopen?(store: SignalProtocolLocalStore): Promise<SignalProtocolLocalStore>;
11
+ /** Make the next atomic commit fail after its first write. Atomic cases skip without it. */
12
+ armWriteFailure?(store: SignalProtocolLocalStore): void;
13
+ /** The stored bytes. The ciphertext scan skips without it. */
14
+ readRawBytes?(store: SignalProtocolLocalStore): Promise<Uint8Array[]>;
15
+ /** Release a store after its case. */
16
+ closeStore?(store: SignalProtocolLocalStore): Promise<void>;
17
+ }
18
+ export interface LocalStoreConformanceFailure {
19
+ name: string;
20
+ message: string;
21
+ }
22
+ export interface LocalStoreConformanceResult {
23
+ /** Number of cases in the kit, including skipped ones. */
24
+ total: number;
25
+ passed: string[];
26
+ skipped: string[];
27
+ failures: LocalStoreConformanceFailure[];
28
+ /** The declaration of the store, as the protection declaration case reads it. Null when that case fails. */
29
+ protection: LocalStoreProtection | null;
30
+ }
31
+ /**
32
+ * The store of one case and the optional hooks of the application. A
33
+ * reopen replaces `store`.
34
+ */
35
+ export interface LocalStoreConformanceContext {
36
+ readonly store: SignalProtocolLocalStore;
37
+ /** Close the store and open it again. The new store replaces `store`. */
38
+ reopen(): Promise<SignalProtocolLocalStore>;
39
+ /** Make the next atomic commit of `store` fail after its first write. */
40
+ armWriteFailure(): void;
41
+ /** The bytes that `store` keeps. */
42
+ readRawBytes(): Promise<Uint8Array[]>;
43
+ /** Put the protection declaration of the store in the result. */
44
+ reportProtection(protection: LocalStoreProtection): void;
45
+ }
46
+ /** One named case of the kit. */
47
+ export interface LocalStoreConformanceCase {
48
+ name: string;
49
+ /** The option that the case needs. The case is skipped without it. */
50
+ needs?: 'reopen' | 'armWriteFailure' | 'readRawBytes';
51
+ /** Tell whether the case applies to the store. The case is skipped when it does not. */
52
+ applies?(store: SignalProtocolLocalStore): boolean;
53
+ run(context: LocalStoreConformanceContext): Promise<void>;
54
+ }
55
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../local/store/conformance/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEzF,MAAM,WAAW,4BAA4B;IAC3C,0CAA0C;IAC1C,WAAW,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACjD,uEAAuE;IACvE,MAAM,CAAC,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC5E,4FAA4F;IAC5F,eAAe,CAAC,CAAC,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D"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The options, the result, and the case shape of the local store
3
+ * conformance kit.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../local/store/conformance/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -13,7 +13,8 @@ export interface ExpoSignalProtocolStoreOptions extends SqliteOpenOptions {
13
13
  /**
14
14
  * The database file name in the expo-sqlite default directory. It also
15
15
  * names the vault slot of the database key. Letters, digits, `.`, `_`, and
16
- * `-` only. Default: `open-e2ee-signal-protocol.db`.
16
+ * `-` only, and no `.oe2e-convert` ending. Default:
17
+ * `open-e2ee-signal-protocol.db`.
17
18
  */
18
19
  readonly name?: string;
19
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../local/store/expo/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAwB,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAQ7D,OAAO,EACL,yBAAyB,EAE1B,MAAM,iBAAiB,CAAC;AAMzB,MAAM,WAAW,8BAA+B,SAAQ,iBAAiB;IACvE;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,8BAA8B,CAAC;CACjD;AAyBD,kEAAkE;AAClE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,uBAAuB,GAAG,kBAAkB,CAIpF;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,uBAAwB,SAAQ,yBAAyB;IACpE,OAAO,eAON;IAuBD;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC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AAM,yBAAyB,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACzE,OAAO,IAAI,uBAAuB,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3E,CAAC;IAED;;;OAGG;IACH,KAAK;QACH,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,SAAS,CACvB,OAAO,GAAmC,EAAE;IAE5C,OAAO,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAO,GAAmC,EAAE;IAE5C,OAAO,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AAChD,CAAC"}
@@ -18,8 +18,8 @@ export interface NodeSignalProtocolStoreOptions extends SqliteOpenOptions {
18
18
  readonly directory: string;
19
19
  /**
20
20
  * The database file name in `directory`. Letters, digits, `.`, `_`, and
21
- * `-` only, and no `.lock`, `-wal`, `-shm`, or `-journal` ending. Default:
22
- * `open-e2ee-signal-protocol.db`.
21
+ * `-` only, and no `.lock`, `-wal`, `-shm`, `-journal`, or `.oe2e-convert`
22
+ * ending. Default: `open-e2ee-signal-protocol.db`.
23
23
  */
24
24
  readonly name?: string;
25
25
  /**
@@ -13,7 +13,8 @@ export interface ReactNativeSignalProtocolStoreOptions extends SqliteOpenOptions
13
13
  /**
14
14
  * The database file name in the op-sqlite default location. It also names
15
15
  * the vault slot of the database key. Letters, digits, `.`, `_`, and `-`
16
- * only. Default: `open-e2ee-signal-protocol.db`.
16
+ * only, and no `.oe2e-convert` ending. Default:
17
+ * `open-e2ee-signal-protocol.db`.
17
18
  */
18
19
  readonly name?: string;
19
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../local/store/react-native/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAwB,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAQ7D,OAAO,EACL,yBAAyB,EAE1B,MAAM,iBAAiB,CAAC;AAKzB,MAAM,WAAW,qCAAsC,SAAQ,iBAAiB;IAC9E;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,8BAA8B,CAAC;CACjD;AAgBD,kEAAkE;AAClE,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,8BAA8B,GACpC,kBAAkB,CAIpB;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,8BAA+B,SAAQ,yBAAyB;IAC3E,OAAO,eAON;IAyBD;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAErB;CACF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,8BAA8B,CAAC,CAEzC;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,qCAA0C,GAClD,OAAO,CAAC,8BAA8B,CAAC,CAEzC"}
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../local/store/react-native/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAwB,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAQ7D,OAAO,EACL,yBAAyB,EAE1B,M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