@open-e2ee/signal-protocol-sdk 7.1.0 → 8.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 (698) hide show
  1. package/ADAPTERS.md +55 -6
  2. package/ARCHITECTURE.md +1 -0
  3. package/CHANGELOG.md +565 -0
  4. package/README.md +19 -5
  5. package/SECURITY.md +2 -2
  6. package/THIRD_PARTY_NOTICES.md +429 -0
  7. package/TROUBLESHOOTING.md +10 -0
  8. package/client/README.md +1 -2
  9. package/device/README.md +50 -19
  10. package/dist/client/client.d.ts +31 -5
  11. package/dist/client/client.d.ts.map +1 -1
  12. package/dist/client/client.js +149 -90
  13. package/dist/client/client.js.map +1 -1
  14. package/dist/client/event-hooks.d.ts.map +1 -1
  15. package/dist/client/event-hooks.js +2 -0
  16. package/dist/client/event-hooks.js.map +1 -1
  17. package/dist/client/files.d.ts.map +1 -1
  18. package/dist/client/files.js +19 -2
  19. package/dist/client/files.js.map +1 -1
  20. package/dist/client/headless.d.ts +1 -1
  21. package/dist/client/headless.js +1 -1
  22. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  23. package/dist/client/hosted-anonymous-delivery.js +2 -1
  24. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  25. package/dist/client/hosted-connection.d.ts +1 -1
  26. package/dist/client/hosted-connection.d.ts.map +1 -1
  27. package/dist/client/hosted-connection.js +8 -12
  28. package/dist/client/hosted-connection.js.map +1 -1
  29. package/dist/client/hosted-group-authority.d.ts.map +1 -1
  30. package/dist/client/hosted-group-authority.js +2 -1
  31. package/dist/client/hosted-group-authority.js.map +1 -1
  32. package/dist/client/hosted-groups.d.ts.map +1 -1
  33. package/dist/client/hosted-groups.js +2 -1
  34. package/dist/client/hosted-groups.js.map +1 -1
  35. package/dist/client/hosted-push.d.ts.map +1 -1
  36. package/dist/client/hosted-push.js +2 -1
  37. package/dist/client/hosted-push.js.map +1 -1
  38. package/dist/client/hosted-transport.d.ts.map +1 -1
  39. package/dist/client/hosted-transport.js +10 -11
  40. package/dist/client/hosted-transport.js.map +1 -1
  41. package/dist/client/hosted-trust.d.ts +11 -11
  42. package/dist/client/hosted-trust.d.ts.map +1 -1
  43. package/dist/client/hosted-trust.js +12 -12
  44. package/dist/client/hosted-trust.js.map +1 -1
  45. package/dist/client/messages.d.ts.map +1 -1
  46. package/dist/client/messages.js +6 -1
  47. package/dist/client/messages.js.map +1 -1
  48. package/dist/client/multi-device.d.ts.map +1 -1
  49. package/dist/client/multi-device.js +2 -1
  50. package/dist/client/multi-device.js.map +1 -1
  51. package/dist/client/relay-lifecycle.d.ts +6 -2
  52. package/dist/client/relay-lifecycle.d.ts.map +1 -1
  53. package/dist/client/relay-lifecycle.js.map +1 -1
  54. package/dist/client/relay-work.d.ts +30 -0
  55. package/dist/client/relay-work.d.ts.map +1 -0
  56. package/dist/client/relay-work.js +189 -0
  57. package/dist/client/relay-work.js.map +1 -0
  58. package/dist/client/retry.d.ts.map +1 -1
  59. package/dist/client/retry.js +2 -0
  60. package/dist/client/retry.js.map +1 -1
  61. package/dist/client/sessions.d.ts.map +1 -1
  62. package/dist/client/sessions.js +3 -0
  63. package/dist/client/sessions.js.map +1 -1
  64. package/dist/client/signal-service-cipher.d.ts +39 -16
  65. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  66. package/dist/client/signal-service-cipher.js +100 -60
  67. package/dist/client/signal-service-cipher.js.map +1 -1
  68. package/dist/client/state.d.ts +8 -0
  69. package/dist/client/state.d.ts.map +1 -1
  70. package/dist/client/state.js +11 -0
  71. package/dist/client/state.js.map +1 -1
  72. package/dist/client/types.d.ts +5 -1
  73. package/dist/client/types.d.ts.map +1 -1
  74. package/dist/client/types.js.map +1 -1
  75. package/dist/device/connection.d.ts +1 -1
  76. package/dist/device/connection.d.ts.map +1 -1
  77. package/dist/device/connection.js +4 -11
  78. package/dist/device/connection.js.map +1 -1
  79. package/dist/device/device-id.d.ts +10 -4
  80. package/dist/device/device-id.d.ts.map +1 -1
  81. package/dist/device/device-id.js +15 -9
  82. package/dist/device/device-id.js.map +1 -1
  83. package/dist/device/device-name-crypto.d.ts.map +1 -1
  84. package/dist/device/device-name-crypto.js +2 -2
  85. package/dist/device/device-name-crypto.js.map +1 -1
  86. package/dist/device/expo/index.d.ts +25 -8
  87. package/dist/device/expo/index.d.ts.map +1 -1
  88. package/dist/device/expo/index.js +58 -8
  89. package/dist/device/expo/index.js.map +1 -1
  90. package/dist/device/index.d.ts +2 -2
  91. package/dist/device/index.d.ts.map +1 -1
  92. package/dist/device/index.js +3 -2
  93. package/dist/device/index.js.map +1 -1
  94. package/dist/device/lifecycle/index.d.ts +4 -2
  95. package/dist/device/lifecycle/index.d.ts.map +1 -1
  96. package/dist/device/lifecycle/index.js.map +1 -1
  97. package/dist/device/lifecycle/manager.d.ts +12 -14
  98. package/dist/device/lifecycle/manager.d.ts.map +1 -1
  99. package/dist/device/lifecycle/manager.js +52 -97
  100. package/dist/device/lifecycle/manager.js.map +1 -1
  101. package/dist/device/lifecycle/types.d.ts +26 -16
  102. package/dist/device/lifecycle/types.d.ts.map +1 -1
  103. package/dist/device/lifecycle/utils.d.ts +8 -4
  104. package/dist/device/lifecycle/utils.d.ts.map +1 -1
  105. package/dist/device/lifecycle/utils.js +12 -16
  106. package/dist/device/lifecycle/utils.js.map +1 -1
  107. package/dist/device/provisioning.d.ts.map +1 -1
  108. package/dist/device/provisioning.js +6 -8
  109. package/dist/device/provisioning.js.map +1 -1
  110. package/dist/device/react-native/index.d.ts +40 -0
  111. package/dist/device/react-native/index.d.ts.map +1 -0
  112. package/dist/device/react-native/index.js +74 -0
  113. package/dist/device/react-native/index.js.map +1 -0
  114. package/dist/device/transfer.d.ts +15 -7
  115. package/dist/device/transfer.d.ts.map +1 -1
  116. package/dist/device/transfer.js +30 -22
  117. package/dist/device/transfer.js.map +1 -1
  118. package/dist/device/types.d.ts +15 -7
  119. package/dist/device/types.d.ts.map +1 -1
  120. package/dist/device/types.js.map +1 -1
  121. package/dist/device/vault-text.d.ts +13 -0
  122. package/dist/device/vault-text.d.ts.map +1 -0
  123. package/dist/device/vault-text.js +17 -0
  124. package/dist/device/vault-text.js.map +1 -0
  125. package/dist/hooks/use-key-rotation.d.ts.map +1 -1
  126. package/dist/hooks/use-key-rotation.js +2 -1
  127. package/dist/hooks/use-key-rotation.js.map +1 -1
  128. package/dist/index.d.ts +9 -5
  129. package/dist/index.d.ts.map +1 -1
  130. package/dist/index.js +9 -5
  131. package/dist/index.js.map +1 -1
  132. package/dist/internal/crypto/index.d.ts +3 -3
  133. package/dist/internal/crypto/index.d.ts.map +1 -1
  134. package/dist/internal/crypto/index.js +3 -3
  135. package/dist/internal/crypto/index.js.map +1 -1
  136. package/dist/internal/crypto/random-host.d.ts +1 -1
  137. package/dist/internal/crypto/random-host.d.ts.map +1 -1
  138. package/dist/internal/crypto/random-host.js +3 -2
  139. package/dist/internal/crypto/random-host.js.map +1 -1
  140. package/dist/internal/crypto/random-host.native.d.ts +6 -1
  141. package/dist/internal/crypto/random-host.native.d.ts.map +1 -1
  142. package/dist/internal/crypto/random-host.native.js +14 -10
  143. package/dist/internal/crypto/random-host.native.js.map +1 -1
  144. package/dist/internal/crypto/random-host.node.d.ts +1 -1
  145. package/dist/internal/crypto/random-host.node.d.ts.map +1 -1
  146. package/dist/internal/crypto/random-host.node.js +1 -1
  147. package/dist/internal/crypto/random-host.node.js.map +1 -1
  148. package/dist/internal/crypto/random.d.ts +12 -3
  149. package/dist/internal/crypto/random.d.ts.map +1 -1
  150. package/dist/internal/crypto/random.js +14 -3
  151. package/dist/internal/crypto/random.js.map +1 -1
  152. package/dist/internal/crypto/utils.d.ts.map +1 -1
  153. package/dist/internal/crypto/utils.js +10 -6
  154. package/dist/internal/crypto/utils.js.map +1 -1
  155. package/dist/internal/encoding/proto/primitives.d.ts +2 -0
  156. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  157. package/dist/internal/encoding/proto/primitives.js +2 -1
  158. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  159. package/dist/internal/encoding/proto/signal-message.d.ts +1 -0
  160. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  161. package/dist/internal/encoding/proto/signal-message.js +2 -1
  162. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  163. package/dist/internal/groups/authority-certificate.d.ts.map +1 -1
  164. package/dist/internal/groups/authority-certificate.js +2 -1
  165. package/dist/internal/groups/authority-certificate.js.map +1 -1
  166. package/dist/internal/groups/encrypted-state.d.ts.map +1 -1
  167. package/dist/internal/groups/encrypted-state.js +9 -7
  168. package/dist/internal/groups/encrypted-state.js.map +1 -1
  169. package/dist/internal/groups/invite-link.d.ts.map +1 -1
  170. package/dist/internal/groups/invite-link.js +2 -1
  171. package/dist/internal/groups/invite-link.js.map +1 -1
  172. package/dist/internal/groups/manager.d.ts.map +1 -1
  173. package/dist/internal/groups/manager.js +5 -5
  174. package/dist/internal/groups/manager.js.map +1 -1
  175. package/dist/internal/groups/sdk-store.d.ts.map +1 -1
  176. package/dist/internal/groups/sdk-store.js +4 -3
  177. package/dist/internal/groups/sdk-store.js.map +1 -1
  178. package/dist/internal/groups/server-engine.d.ts +6 -1
  179. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  180. package/dist/internal/groups/server-engine.js +11 -15
  181. package/dist/internal/groups/server-engine.js.map +1 -1
  182. package/dist/internal/groups/wire.d.ts.map +1 -1
  183. package/dist/internal/groups/wire.js +2 -1
  184. package/dist/internal/groups/wire.js.map +1 -1
  185. package/dist/internal/platform/blob.d.ts +10 -0
  186. package/dist/internal/platform/blob.d.ts.map +1 -0
  187. package/dist/internal/platform/blob.js +30 -0
  188. package/dist/internal/platform/blob.js.map +1 -0
  189. package/dist/internal/platform/env.d.ts +13 -0
  190. package/dist/internal/platform/env.d.ts.map +1 -0
  191. package/dist/internal/platform/env.js +17 -0
  192. package/dist/internal/platform/env.js.map +1 -0
  193. package/dist/internal/platform/index.d.ts +5 -0
  194. package/dist/internal/platform/index.d.ts.map +1 -0
  195. package/dist/internal/platform/index.js +5 -0
  196. package/dist/internal/platform/index.js.map +1 -0
  197. package/dist/internal/platform/url.d.ts +72 -0
  198. package/dist/internal/platform/url.d.ts.map +1 -0
  199. package/dist/internal/platform/url.js +275 -0
  200. package/dist/internal/platform/url.js.map +1 -0
  201. package/dist/internal/platform/utf8.d.ts +28 -0
  202. package/dist/internal/platform/utf8.d.ts.map +1 -0
  203. package/dist/internal/platform/utf8.js +167 -0
  204. package/dist/internal/platform/utf8.js.map +1 -0
  205. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts +1 -1
  206. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts.map +1 -1
  207. package/dist/internal/protocol/sealed-sender/delivery-token.js +5 -10
  208. package/dist/internal/protocol/sealed-sender/delivery-token.js.map +1 -1
  209. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  210. package/dist/internal/protocol/sealed-sender/proto/index.js +2 -4
  211. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  212. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  213. package/dist/internal/protocol/sender-keys/manager.js +4 -3
  214. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  215. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts +4 -4
  216. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.d.ts.map +1 -1
  217. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js +8 -10
  218. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js.map +1 -1
  219. package/dist/internal/protocol/username/hash.d.ts.map +1 -1
  220. package/dist/internal/protocol/username/hash.js +18 -3
  221. package/dist/internal/protocol/username/hash.js.map +1 -1
  222. package/dist/internal/protocol/username/link.d.ts.map +1 -1
  223. package/dist/internal/protocol/username/link.js +2 -1
  224. package/dist/internal/protocol/username/link.js.map +1 -1
  225. package/dist/internal/protocol/username/proof.d.ts.map +1 -1
  226. package/dist/internal/protocol/username/proof.js +2 -1
  227. package/dist/internal/protocol/username/proof.js.map +1 -1
  228. package/dist/internal/sesame/device-registry.d.ts +22 -6
  229. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  230. package/dist/internal/sesame/device-registry.js +18 -12
  231. package/dist/internal/sesame/device-registry.js.map +1 -1
  232. package/dist/internal/sesame/index.d.ts +1 -1
  233. package/dist/internal/sesame/index.d.ts.map +1 -1
  234. package/dist/internal/sesame/manager.d.ts.map +1 -1
  235. package/dist/internal/sesame/manager.js +3 -2
  236. package/dist/internal/sesame/manager.js.map +1 -1
  237. package/dist/internal/session/index.d.ts +1 -2
  238. package/dist/internal/session/index.d.ts.map +1 -1
  239. package/dist/internal/session/index.js +1 -1
  240. package/dist/internal/session/index.js.map +1 -1
  241. package/dist/internal/session/validation.d.ts +0 -80
  242. package/dist/internal/session/validation.d.ts.map +1 -1
  243. package/dist/internal/session/validation.js +0 -134
  244. package/dist/internal/session/validation.js.map +1 -1
  245. package/dist/local/store/device-record.d.ts +18 -0
  246. package/dist/local/store/device-record.d.ts.map +1 -0
  247. package/dist/local/store/device-record.js +34 -0
  248. package/dist/local/store/device-record.js.map +1 -0
  249. package/dist/local/store/expo/adapter.d.ts +59 -238
  250. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  251. package/dist/local/store/expo/adapter.js +83 -640
  252. package/dist/local/store/expo/adapter.js.map +1 -1
  253. package/dist/local/store/expo/driver.d.ts +16 -0
  254. package/dist/local/store/expo/driver.d.ts.map +1 -0
  255. package/dist/local/store/expo/driver.js +141 -0
  256. package/dist/local/store/expo/driver.js.map +1 -0
  257. package/dist/local/store/expo/index.d.ts +3 -12
  258. package/dist/local/store/expo/index.d.ts.map +1 -1
  259. package/dist/local/store/expo/index.js +1 -8
  260. package/dist/local/store/expo/index.js.map +1 -1
  261. package/dist/local/store/expo/maintenance.d.ts +3 -2
  262. package/dist/local/store/expo/maintenance.d.ts.map +1 -1
  263. package/dist/local/store/expo/maintenance.js +5 -34
  264. package/dist/local/store/expo/maintenance.js.map +1 -1
  265. package/dist/local/store/index.d.ts +10 -5
  266. package/dist/local/store/index.d.ts.map +1 -1
  267. package/dist/local/store/index.js +10 -5
  268. package/dist/local/store/index.js.map +1 -1
  269. package/dist/local/store/key-value/adapter.d.ts +326 -0
  270. package/dist/local/store/key-value/adapter.d.ts.map +1 -0
  271. package/dist/local/store/key-value/adapter.js +1472 -0
  272. package/dist/local/store/key-value/adapter.js.map +1 -0
  273. package/dist/local/store/{react-native → key-value}/backend-conformance.d.ts +7 -8
  274. package/dist/local/store/key-value/backend-conformance.d.ts.map +1 -0
  275. package/dist/local/store/{react-native → key-value}/backend-conformance.js +4 -5
  276. package/dist/local/store/key-value/backend-conformance.js.map +1 -0
  277. package/dist/local/store/key-value/batch.d.ts +41 -0
  278. package/dist/local/store/key-value/batch.d.ts.map +1 -0
  279. package/dist/local/store/key-value/batch.js +77 -0
  280. package/dist/local/store/key-value/batch.js.map +1 -0
  281. package/dist/local/store/key-value/device-record.d.ts +23 -0
  282. package/dist/local/store/key-value/device-record.d.ts.map +1 -0
  283. package/dist/local/store/key-value/device-record.js +33 -0
  284. package/dist/local/store/key-value/device-record.js.map +1 -0
  285. package/dist/local/store/key-value/index.d.ts +24 -0
  286. package/dist/local/store/key-value/index.d.ts.map +1 -0
  287. package/dist/local/store/key-value/index.js +8 -0
  288. package/dist/local/store/key-value/index.js.map +1 -0
  289. package/dist/local/store/key-value/realm/index.d.ts +83 -0
  290. package/dist/local/store/key-value/realm/index.d.ts.map +1 -0
  291. package/dist/local/store/key-value/realm/index.js +102 -0
  292. package/dist/local/store/key-value/realm/index.js.map +1 -0
  293. package/dist/local/store/{react-native → key-value}/storage.d.ts +6 -6
  294. package/dist/local/store/key-value/storage.d.ts.map +1 -0
  295. package/dist/local/store/key-value/storage.js.map +1 -0
  296. package/dist/local/store/key-value/transactional-backend.d.ts +50 -0
  297. package/dist/local/store/key-value/transactional-backend.d.ts.map +1 -0
  298. package/dist/local/store/key-value/transactional-backend.js +90 -0
  299. package/dist/local/store/key-value/transactional-backend.js.map +1 -0
  300. package/dist/local/store/key-value/value-key.d.ts +34 -0
  301. package/dist/local/store/key-value/value-key.d.ts.map +1 -0
  302. package/dist/local/store/key-value/value-key.js +83 -0
  303. package/dist/local/store/key-value/value-key.js.map +1 -0
  304. package/dist/local/store/memory/adapter.d.ts +8 -0
  305. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  306. package/dist/local/store/memory/adapter.js +60 -75
  307. package/dist/local/store/memory/adapter.js.map +1 -1
  308. package/dist/local/store/node/adapter.d.ts +74 -130
  309. package/dist/local/store/node/adapter.d.ts.map +1 -1
  310. package/dist/local/store/node/adapter.js +83 -727
  311. package/dist/local/store/node/adapter.js.map +1 -1
  312. package/dist/local/store/node/index.d.ts +8 -6
  313. package/dist/local/store/node/index.d.ts.map +1 -1
  314. package/dist/local/store/node/index.js +3 -7
  315. package/dist/local/store/node/index.js.map +1 -1
  316. package/dist/local/store/node/maintenance.d.ts +5 -0
  317. package/dist/local/store/node/maintenance.d.ts.map +1 -0
  318. package/dist/local/store/node/maintenance.js +7 -0
  319. package/dist/local/store/node/maintenance.js.map +1 -0
  320. package/dist/local/store/node/owner-lock.d.ts +26 -0
  321. package/dist/local/store/node/owner-lock.d.ts.map +1 -0
  322. package/dist/local/store/node/owner-lock.js +88 -0
  323. package/dist/local/store/node/owner-lock.js.map +1 -0
  324. package/dist/local/store/react-native/adapter.d.ts +63 -273
  325. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  326. package/dist/local/store/react-native/adapter.js +80 -1405
  327. package/dist/local/store/react-native/adapter.js.map +1 -1
  328. package/dist/local/store/react-native/index.d.ts +7 -19
  329. package/dist/local/store/react-native/index.d.ts.map +1 -1
  330. package/dist/local/store/react-native/index.js +2 -7
  331. package/dist/local/store/react-native/index.js.map +1 -1
  332. package/dist/local/store/react-native/maintenance.d.ts +5 -0
  333. package/dist/local/store/react-native/maintenance.d.ts.map +1 -0
  334. package/dist/local/store/react-native/maintenance.js +7 -0
  335. package/dist/local/store/react-native/maintenance.js.map +1 -0
  336. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts +38 -0
  337. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.d.ts.map +1 -0
  338. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js +196 -0
  339. package/dist/local/store/sqlite/better-sqlite3-multiple-ciphers-driver.js.map +1 -0
  340. package/dist/local/store/sqlite/database.d.ts +20 -0
  341. package/dist/local/store/sqlite/database.d.ts.map +1 -0
  342. package/dist/local/store/sqlite/database.js +41 -0
  343. package/dist/local/store/sqlite/database.js.map +1 -0
  344. package/dist/local/store/sqlite/driver.d.ts +138 -0
  345. package/dist/local/store/sqlite/driver.d.ts.map +1 -0
  346. package/dist/local/store/sqlite/driver.js +10 -0
  347. package/dist/local/store/sqlite/driver.js.map +1 -0
  348. package/dist/local/store/sqlite/encryption.d.ts +61 -0
  349. package/dist/local/store/sqlite/encryption.d.ts.map +1 -0
  350. package/dist/local/store/sqlite/encryption.js +98 -0
  351. package/dist/local/store/sqlite/encryption.js.map +1 -0
  352. package/dist/local/store/sqlite/errors.d.ts +70 -0
  353. package/dist/local/store/sqlite/errors.d.ts.map +1 -0
  354. package/dist/local/store/sqlite/errors.js +101 -0
  355. package/dist/local/store/sqlite/errors.js.map +1 -0
  356. package/dist/local/store/sqlite/executor.d.ts +22 -0
  357. package/dist/local/store/sqlite/executor.d.ts.map +1 -0
  358. package/dist/local/store/sqlite/executor.js +129 -0
  359. package/dist/local/store/sqlite/executor.js.map +1 -0
  360. package/dist/local/store/sqlite/index.d.ts +20 -0
  361. package/dist/local/store/sqlite/index.d.ts.map +1 -0
  362. package/dist/local/store/sqlite/index.js +18 -0
  363. package/dist/local/store/sqlite/index.js.map +1 -0
  364. package/dist/local/store/sqlite/key-storage/account.d.ts +45 -0
  365. package/dist/local/store/sqlite/key-storage/account.d.ts.map +1 -0
  366. package/dist/local/store/sqlite/key-storage/account.js +125 -0
  367. package/dist/local/store/sqlite/key-storage/account.js.map +1 -0
  368. package/dist/local/store/sqlite/key-storage/contact-identities.d.ts +19 -0
  369. package/dist/local/store/sqlite/key-storage/contact-identities.d.ts.map +1 -0
  370. package/dist/local/store/sqlite/key-storage/contact-identities.js +85 -0
  371. package/dist/local/store/sqlite/key-storage/contact-identities.js.map +1 -0
  372. package/dist/local/store/sqlite/key-storage/context.d.ts +19 -0
  373. package/dist/local/store/sqlite/key-storage/context.d.ts.map +1 -0
  374. package/dist/local/store/sqlite/key-storage/context.js +18 -0
  375. package/dist/local/store/sqlite/key-storage/context.js.map +1 -0
  376. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts +18 -0
  377. package/dist/local/store/sqlite/key-storage/identity-keys.d.ts.map +1 -0
  378. package/dist/local/store/sqlite/key-storage/identity-keys.js +88 -0
  379. package/dist/local/store/sqlite/key-storage/identity-keys.js.map +1 -0
  380. package/dist/local/store/sqlite/key-storage/index.d.ts +108 -0
  381. package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -0
  382. package/dist/local/store/sqlite/key-storage/index.js +241 -0
  383. package/dist/local/store/sqlite/key-storage/index.js.map +1 -0
  384. package/dist/local/store/sqlite/key-storage/message-records.d.ts +41 -0
  385. package/dist/local/store/sqlite/key-storage/message-records.d.ts.map +1 -0
  386. package/dist/local/store/sqlite/key-storage/message-records.js +133 -0
  387. package/dist/local/store/sqlite/key-storage/message-records.js.map +1 -0
  388. package/dist/local/store/sqlite/key-storage/metadata.d.ts +16 -0
  389. package/dist/local/store/sqlite/key-storage/metadata.d.ts.map +1 -0
  390. package/dist/local/store/sqlite/key-storage/metadata.js +53 -0
  391. package/dist/local/store/sqlite/key-storage/metadata.js.map +1 -0
  392. package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts +36 -0
  393. package/dist/local/store/sqlite/key-storage/one-time-prekeys.d.ts.map +1 -0
  394. package/dist/local/store/sqlite/key-storage/one-time-prekeys.js +129 -0
  395. package/dist/local/store/sqlite/key-storage/one-time-prekeys.js.map +1 -0
  396. package/dist/local/store/sqlite/key-storage/session-trust.d.ts +10 -0
  397. package/dist/local/store/sqlite/key-storage/session-trust.d.ts.map +1 -0
  398. package/dist/local/store/sqlite/key-storage/session-trust.js +88 -0
  399. package/dist/local/store/sqlite/key-storage/session-trust.js.map +1 -0
  400. package/dist/local/store/sqlite/key-storage/sessions.d.ts +50 -0
  401. package/dist/local/store/sqlite/key-storage/sessions.d.ts.map +1 -0
  402. package/dist/local/store/sqlite/key-storage/sessions.js +209 -0
  403. package/dist/local/store/sqlite/key-storage/sessions.js.map +1 -0
  404. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts +69 -0
  405. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts.map +1 -0
  406. package/dist/local/store/sqlite/key-storage/signed-prekeys.js +219 -0
  407. package/dist/local/store/sqlite/key-storage/signed-prekeys.js.map +1 -0
  408. package/dist/local/store/sqlite/maintenance.d.ts +7 -0
  409. package/dist/local/store/sqlite/maintenance.d.ts.map +1 -0
  410. package/dist/local/store/sqlite/maintenance.js +32 -0
  411. package/dist/local/store/sqlite/maintenance.js.map +1 -0
  412. package/dist/local/store/sqlite/migrations.d.ts +31 -0
  413. package/dist/local/store/sqlite/migrations.d.ts.map +1 -0
  414. package/dist/local/store/sqlite/migrations.js +232 -0
  415. package/dist/local/store/sqlite/migrations.js.map +1 -0
  416. package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.d.ts +17 -22
  417. package/dist/local/store/sqlite/models/ec-one-time-prekey.d.ts.map +1 -0
  418. package/dist/local/store/{expo → sqlite}/models/ec-one-time-prekey.js +61 -99
  419. package/dist/local/store/sqlite/models/ec-one-time-prekey.js.map +1 -0
  420. package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.d.ts +22 -25
  421. package/dist/local/store/sqlite/models/ec-signed-prekey.d.ts.map +1 -0
  422. package/dist/local/store/{expo → sqlite}/models/ec-signed-prekey.js +82 -128
  423. package/dist/local/store/sqlite/models/ec-signed-prekey.js.map +1 -0
  424. package/dist/local/store/sqlite/models/identity-key-id.d.ts.map +1 -0
  425. package/dist/local/store/sqlite/models/identity-key-id.js.map +1 -0
  426. package/dist/local/store/{expo → sqlite}/models/index.d.ts +5 -5
  427. package/dist/local/store/sqlite/models/index.d.ts.map +1 -0
  428. package/dist/local/store/{expo → sqlite}/models/index.js +12 -5
  429. package/dist/local/store/sqlite/models/index.js.map +1 -0
  430. package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.d.ts +17 -20
  431. package/dist/local/store/sqlite/models/kyber-one-time-prekey.d.ts.map +1 -0
  432. package/dist/local/store/{expo → sqlite}/models/kyber-one-time-prekey.js +65 -105
  433. package/dist/local/store/sqlite/models/kyber-one-time-prekey.js.map +1 -0
  434. package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.d.ts +3 -3
  435. package/dist/local/store/sqlite/models/kyber-prekey-used.d.ts.map +1 -0
  436. package/dist/local/store/{expo → sqlite}/models/kyber-prekey-used.js +13 -25
  437. package/dist/local/store/sqlite/models/kyber-prekey-used.js.map +1 -0
  438. package/dist/local/store/{expo → sqlite}/models/kyber-prekey.d.ts +16 -19
  439. package/dist/local/store/sqlite/models/kyber-prekey.d.ts.map +1 -0
  440. package/dist/local/store/{expo → sqlite}/models/kyber-prekey.js +67 -111
  441. package/dist/local/store/sqlite/models/kyber-prekey.js.map +1 -0
  442. package/dist/local/store/sqlite/models/local-identity.d.ts +51 -0
  443. package/dist/local/store/sqlite/models/local-identity.d.ts.map +1 -0
  444. package/dist/local/store/sqlite/models/local-identity.js +150 -0
  445. package/dist/local/store/sqlite/models/local-identity.js.map +1 -0
  446. package/dist/local/store/{expo → sqlite}/models/message-record.d.ts +15 -44
  447. package/dist/local/store/sqlite/models/message-record.d.ts.map +1 -0
  448. package/dist/local/store/{expo → sqlite}/models/message-record.js +43 -109
  449. package/dist/local/store/sqlite/models/message-record.js.map +1 -0
  450. package/dist/local/store/sqlite/models/recipient-identity.d.ts +21 -0
  451. package/dist/local/store/sqlite/models/recipient-identity.d.ts.map +1 -0
  452. package/dist/local/store/sqlite/models/recipient-identity.js +59 -0
  453. package/dist/local/store/sqlite/models/recipient-identity.js.map +1 -0
  454. package/dist/local/store/sqlite/models/replaced-prekeys.d.ts +23 -0
  455. package/dist/local/store/sqlite/models/replaced-prekeys.d.ts.map +1 -0
  456. package/dist/local/store/sqlite/models/replaced-prekeys.js +42 -0
  457. package/dist/local/store/sqlite/models/replaced-prekeys.js.map +1 -0
  458. package/dist/local/store/{expo → sqlite}/models/sender-key.d.ts +22 -23
  459. package/dist/local/store/sqlite/models/sender-key.d.ts.map +1 -0
  460. package/dist/local/store/{expo → sqlite}/models/sender-key.js +66 -94
  461. package/dist/local/store/sqlite/models/sender-key.js.map +1 -0
  462. package/dist/local/store/sqlite/models/sesame-user-record.d.ts +32 -0
  463. package/dist/local/store/sqlite/models/sesame-user-record.d.ts.map +1 -0
  464. package/dist/local/store/sqlite/models/sesame-user-record.js +78 -0
  465. package/dist/local/store/sqlite/models/sesame-user-record.js.map +1 -0
  466. package/dist/local/store/{expo → sqlite}/models/session.d.ts +24 -20
  467. package/dist/local/store/sqlite/models/session.d.ts.map +1 -0
  468. package/dist/local/store/{expo → sqlite}/models/session.js +54 -72
  469. package/dist/local/store/sqlite/models/session.js.map +1 -0
  470. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts +24 -0
  471. package/dist/local/store/sqlite/models/skipped-sender-key.d.ts.map +1 -0
  472. package/dist/local/store/sqlite/models/skipped-sender-key.js +62 -0
  473. package/dist/local/store/sqlite/models/skipped-sender-key.js.map +1 -0
  474. package/dist/local/store/sqlite/op-sqlite-driver.d.ts +14 -0
  475. package/dist/local/store/sqlite/op-sqlite-driver.d.ts.map +1 -0
  476. package/dist/local/store/sqlite/op-sqlite-driver.js +180 -0
  477. package/dist/local/store/sqlite/op-sqlite-driver.js.map +1 -0
  478. package/dist/local/store/sqlite/open-store.d.ts +83 -0
  479. package/dist/local/store/sqlite/open-store.d.ts.map +1 -0
  480. package/dist/local/store/sqlite/open-store.js +177 -0
  481. package/dist/local/store/sqlite/open-store.js.map +1 -0
  482. package/dist/local/store/sqlite/schema.d.ts +102 -0
  483. package/dist/local/store/sqlite/schema.d.ts.map +1 -0
  484. package/dist/local/store/sqlite/schema.js +61 -0
  485. package/dist/local/store/sqlite/schema.js.map +1 -0
  486. package/dist/local/store/sqlite/store.d.ts +199 -0
  487. package/dist/local/store/sqlite/store.d.ts.map +1 -0
  488. package/dist/local/store/sqlite/store.js +494 -0
  489. package/dist/local/store/sqlite/store.js.map +1 -0
  490. package/dist/local/store/sqlite/web/driver.d.ts +50 -0
  491. package/dist/local/store/sqlite/web/driver.d.ts.map +1 -0
  492. package/dist/local/store/sqlite/web/driver.js +169 -0
  493. package/dist/local/store/sqlite/web/driver.js.map +1 -0
  494. package/dist/local/store/sqlite/web/protocol.d.ts +80 -0
  495. package/dist/local/store/sqlite/web/protocol.d.ts.map +1 -0
  496. package/dist/local/store/sqlite/web/protocol.js +13 -0
  497. package/dist/local/store/sqlite/web/protocol.js.map +1 -0
  498. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.mjs +14526 -0
  499. package/dist/local/store/sqlite/web/sqlite3mc/sqlite3.wasm +0 -0
  500. package/dist/local/store/sqlite/web/worker.d.ts +36 -0
  501. package/dist/local/store/sqlite/web/worker.d.ts.map +1 -0
  502. package/dist/local/store/sqlite/web/worker.js +616 -0
  503. package/dist/local/store/sqlite/web/worker.js.map +1 -0
  504. package/dist/local/store/web/adapter.d.ts +5 -14
  505. package/dist/local/store/web/adapter.d.ts.map +1 -1
  506. package/dist/local/store/web/adapter.js +119 -106
  507. package/dist/local/store/web/adapter.js.map +1 -1
  508. package/dist/local/store/web/device-record.d.ts +23 -0
  509. package/dist/local/store/web/device-record.d.ts.map +1 -0
  510. package/dist/local/store/web/device-record.js +31 -0
  511. package/dist/local/store/web/device-record.js.map +1 -0
  512. package/dist/local/store/web-sqlite/adapter.d.ts +98 -0
  513. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -0
  514. package/dist/local/store/web-sqlite/adapter.js +151 -0
  515. package/dist/local/store/web-sqlite/adapter.js.map +1 -0
  516. package/dist/local/store/web-sqlite/index.d.ts +14 -0
  517. package/dist/local/store/web-sqlite/index.d.ts.map +1 -0
  518. package/dist/local/store/web-sqlite/index.js +3 -0
  519. package/dist/local/store/web-sqlite/index.js.map +1 -0
  520. package/dist/local/store/web-sqlite/maintenance.d.ts +5 -0
  521. package/dist/local/store/web-sqlite/maintenance.d.ts.map +1 -0
  522. package/dist/local/store/web-sqlite/maintenance.js +7 -0
  523. package/dist/local/store/web-sqlite/maintenance.js.map +1 -0
  524. package/dist/local/store/web-sqlite/store-locks.d.ts +33 -0
  525. package/dist/local/store/web-sqlite/store-locks.d.ts.map +1 -0
  526. package/dist/local/store/web-sqlite/store-locks.js +60 -0
  527. package/dist/local/store/web-sqlite/store-locks.js.map +1 -0
  528. package/dist/local/vault/electron-safe-storage.d.ts +45 -0
  529. package/dist/local/vault/electron-safe-storage.d.ts.map +1 -0
  530. package/dist/local/vault/electron-safe-storage.js +212 -0
  531. package/dist/local/vault/electron-safe-storage.js.map +1 -0
  532. package/dist/local/vault/index.d.ts +4 -2
  533. package/dist/local/vault/index.d.ts.map +1 -1
  534. package/dist/local/vault/indexed-db.d.ts +37 -0
  535. package/dist/local/vault/indexed-db.d.ts.map +1 -0
  536. package/dist/local/vault/indexed-db.js +102 -0
  537. package/dist/local/vault/indexed-db.js.map +1 -0
  538. package/dist/local/vault/react-native-keychain.d.ts +12 -0
  539. package/dist/local/vault/react-native-keychain.d.ts.map +1 -0
  540. package/dist/local/vault/react-native-keychain.js +71 -0
  541. package/dist/local/vault/react-native-keychain.js.map +1 -0
  542. package/dist/local/vault/require.d.ts +10 -0
  543. package/dist/local/vault/require.d.ts.map +1 -0
  544. package/dist/local/vault/require.js +16 -0
  545. package/dist/local/vault/require.js.map +1 -0
  546. package/dist/logger.d.ts.map +1 -1
  547. package/dist/logger.js +2 -1
  548. package/dist/logger.js.map +1 -1
  549. package/dist/media/index.d.ts.map +1 -1
  550. package/dist/media/index.js +2 -1
  551. package/dist/media/index.js.map +1 -1
  552. package/dist/profile/contact-state.d.ts.map +1 -1
  553. package/dist/profile/contact-state.js +2 -4
  554. package/dist/profile/contact-state.js.map +1 -1
  555. package/dist/profile/index.d.ts +0 -1
  556. package/dist/profile/index.d.ts.map +1 -1
  557. package/dist/profile/index.js +0 -2
  558. package/dist/profile/index.js.map +1 -1
  559. package/dist/profile/profile-key.d.ts +16 -11
  560. package/dist/profile/profile-key.d.ts.map +1 -1
  561. package/dist/profile/profile-key.js +29 -29
  562. package/dist/profile/profile-key.js.map +1 -1
  563. package/dist/profile/update-service.d.ts +6 -0
  564. package/dist/profile/update-service.d.ts.map +1 -1
  565. package/dist/profile/update-service.js +3 -1
  566. package/dist/profile/update-service.js.map +1 -1
  567. package/dist/remote/object-store/validation.d.ts.map +1 -1
  568. package/dist/remote/object-store/validation.js +2 -1
  569. package/dist/remote/object-store/validation.js.map +1 -1
  570. package/dist/remote/relay/memory/adapter.d.ts +2 -3
  571. package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
  572. package/dist/remote/relay/memory/adapter.js +22 -30
  573. package/dist/remote/relay/memory/adapter.js.map +1 -1
  574. package/dist/remote/relay/memory/failures.d.ts.map +1 -1
  575. package/dist/remote/relay/memory/failures.js +2 -1
  576. package/dist/remote/relay/memory/failures.js.map +1 -1
  577. package/dist/remote/relay/memory/group-server.d.ts +5 -1
  578. package/dist/remote/relay/memory/group-server.d.ts.map +1 -1
  579. package/dist/remote/relay/memory/group-server.js +11 -1
  580. package/dist/remote/relay/memory/group-server.js.map +1 -1
  581. package/dist/safety/url.d.ts.map +1 -1
  582. package/dist/safety/url.js +21 -26
  583. package/dist/safety/url.js.map +1 -1
  584. package/dist/types/api.d.ts +15 -2
  585. package/dist/types/api.d.ts.map +1 -1
  586. package/dist/types/errors.d.ts +97 -1
  587. package/dist/types/errors.d.ts.map +1 -1
  588. package/dist/types/errors.js +105 -1
  589. package/dist/types/errors.js.map +1 -1
  590. package/dist/types/session.d.ts.map +1 -1
  591. package/dist/types/session.js +2 -1
  592. package/dist/types/session.js.map +1 -1
  593. package/dist/utils/retry.d.ts +2 -0
  594. package/dist/utils/retry.d.ts.map +1 -1
  595. package/dist/utils/retry.js +4 -2
  596. package/dist/utils/retry.js.map +1 -1
  597. package/docs/ASSURANCE.md +81 -8
  598. package/docs/CLIENT_COMPOSITION.md +1 -2
  599. package/docs/DEVIATIONS.md +27 -3
  600. package/docs/ERROR_HANDLING.md +6 -0
  601. package/docs/GETTING_STARTED.md +1 -2
  602. package/docs/PACKAGE_SURFACE.md +29 -11
  603. package/docs/RECIPES.md +1 -2
  604. package/examples/browser/index.html +1 -1
  605. package/local/store/README.md +117 -34
  606. package/local/store/expo/README.md +67 -47
  607. package/local/store/key-value/README.md +278 -0
  608. package/local/store/node/README.md +206 -45
  609. package/local/store/react-native/README.md +121 -52
  610. package/local/store/web/README.md +9 -0
  611. package/local/store/web-sqlite/README.md +202 -0
  612. package/local/vault/README.md +115 -2
  613. package/package.json +61 -42
  614. package/profile/README.md +9 -11
  615. package/remote/README.md +1 -2
  616. package/dist/local/store/expo/database-key.d.ts +0 -142
  617. package/dist/local/store/expo/database-key.d.ts.map +0 -1
  618. package/dist/local/store/expo/database-key.js +0 -312
  619. package/dist/local/store/expo/database-key.js.map +0 -1
  620. package/dist/local/store/expo/db.d.ts +0 -95
  621. package/dist/local/store/expo/db.d.ts.map +0 -1
  622. package/dist/local/store/expo/db.js +0 -147
  623. package/dist/local/store/expo/db.js.map +0 -1
  624. package/dist/local/store/expo/key-storage.d.ts +0 -429
  625. package/dist/local/store/expo/key-storage.d.ts.map +0 -1
  626. package/dist/local/store/expo/key-storage.js +0 -1361
  627. package/dist/local/store/expo/key-storage.js.map +0 -1
  628. package/dist/local/store/expo/models/ec-one-time-prekey.d.ts.map +0 -1
  629. package/dist/local/store/expo/models/ec-one-time-prekey.js.map +0 -1
  630. package/dist/local/store/expo/models/ec-signed-prekey.d.ts.map +0 -1
  631. package/dist/local/store/expo/models/ec-signed-prekey.js.map +0 -1
  632. package/dist/local/store/expo/models/identity-key-id.d.ts.map +0 -1
  633. package/dist/local/store/expo/models/identity-key-id.js.map +0 -1
  634. package/dist/local/store/expo/models/index.d.ts.map +0 -1
  635. package/dist/local/store/expo/models/index.js.map +0 -1
  636. package/dist/local/store/expo/models/kyber-one-time-prekey.d.ts.map +0 -1
  637. package/dist/local/store/expo/models/kyber-one-time-prekey.js.map +0 -1
  638. package/dist/local/store/expo/models/kyber-prekey-used.d.ts.map +0 -1
  639. package/dist/local/store/expo/models/kyber-prekey-used.js.map +0 -1
  640. package/dist/local/store/expo/models/kyber-prekey.d.ts.map +0 -1
  641. package/dist/local/store/expo/models/kyber-prekey.js.map +0 -1
  642. package/dist/local/store/expo/models/local-identity.d.ts +0 -52
  643. package/dist/local/store/expo/models/local-identity.d.ts.map +0 -1
  644. package/dist/local/store/expo/models/local-identity.js +0 -166
  645. package/dist/local/store/expo/models/local-identity.js.map +0 -1
  646. package/dist/local/store/expo/models/message-record.d.ts.map +0 -1
  647. package/dist/local/store/expo/models/message-record.js.map +0 -1
  648. package/dist/local/store/expo/models/recipient-identity.d.ts +0 -21
  649. package/dist/local/store/expo/models/recipient-identity.d.ts.map +0 -1
  650. package/dist/local/store/expo/models/recipient-identity.js +0 -66
  651. package/dist/local/store/expo/models/recipient-identity.js.map +0 -1
  652. package/dist/local/store/expo/models/replaced-prekey-utils.d.ts +0 -33
  653. package/dist/local/store/expo/models/replaced-prekey-utils.d.ts.map +0 -1
  654. package/dist/local/store/expo/models/replaced-prekey-utils.js +0 -54
  655. package/dist/local/store/expo/models/replaced-prekey-utils.js.map +0 -1
  656. package/dist/local/store/expo/models/sender-key.d.ts.map +0 -1
  657. package/dist/local/store/expo/models/sender-key.js.map +0 -1
  658. package/dist/local/store/expo/models/session.d.ts.map +0 -1
  659. package/dist/local/store/expo/models/session.js.map +0 -1
  660. package/dist/local/store/expo/schema.d.ts +0 -1917
  661. package/dist/local/store/expo/schema.d.ts.map +0 -1
  662. package/dist/local/store/expo/schema.js +0 -197
  663. package/dist/local/store/expo/schema.js.map +0 -1
  664. package/dist/local/store/node/database-encryption.d.ts +0 -109
  665. package/dist/local/store/node/database-encryption.d.ts.map +0 -1
  666. package/dist/local/store/node/database-encryption.js +0 -202
  667. package/dist/local/store/node/database-encryption.js.map +0 -1
  668. package/dist/local/store/node/database-file-commit.d.ts +0 -8
  669. package/dist/local/store/node/database-file-commit.d.ts.map +0 -1
  670. package/dist/local/store/node/database-file-commit.js +0 -62
  671. package/dist/local/store/node/database-file-commit.js.map +0 -1
  672. package/dist/local/store/node/database-key.d.ts +0 -129
  673. package/dist/local/store/node/database-key.d.ts.map +0 -1
  674. package/dist/local/store/node/database-key.js +0 -293
  675. package/dist/local/store/node/database-key.js.map +0 -1
  676. package/dist/local/store/node/database-lock.d.ts +0 -8
  677. package/dist/local/store/node/database-lock.d.ts.map +0 -1
  678. package/dist/local/store/node/database-lock.js +0 -44
  679. package/dist/local/store/node/database-lock.js.map +0 -1
  680. package/dist/local/store/node/database.d.ts +0 -226
  681. package/dist/local/store/node/database.d.ts.map +0 -1
  682. package/dist/local/store/node/database.js +0 -813
  683. package/dist/local/store/node/database.js.map +0 -1
  684. package/dist/local/store/react-native/backend-conformance.d.ts.map +0 -1
  685. package/dist/local/store/react-native/backend-conformance.js.map +0 -1
  686. package/dist/local/store/react-native/reference-backend.d.ts +0 -43
  687. package/dist/local/store/react-native/reference-backend.d.ts.map +0 -1
  688. package/dist/local/store/react-native/reference-backend.js +0 -178
  689. package/dist/local/store/react-native/reference-backend.js.map +0 -1
  690. package/dist/local/store/react-native/storage.d.ts.map +0 -1
  691. package/dist/local/store/react-native/storage.js.map +0 -1
  692. package/dist/profile/storage.d.ts +0 -61
  693. package/dist/profile/storage.d.ts.map +0 -1
  694. package/dist/profile/storage.js +0 -145
  695. package/dist/profile/storage.js.map +0 -1
  696. /package/dist/local/store/{react-native → key-value}/storage.js +0 -0
  697. /package/dist/local/store/{expo → sqlite}/models/identity-key-id.d.ts +0 -0
  698. /package/dist/local/store/{expo → sqlite}/models/identity-key-id.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,570 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.0.0
4
+
5
+ 8.0.0 is a major release. The entries below give the details. To upgrade from
6
+ 7.2.0:
7
+
8
+ 1. **React Native and Expo: install a global random source.** Install
9
+ `react-native-get-random-values` 2.x or `react-native-quick-crypto`, and
10
+ load it before the first SDK call.
11
+ 2. **Pass a secret vault.** The profile key, the device ID, the
12
+ device-lifecycle state, and the key-value store's value key live in a
13
+ `SignalProtocolLocalSecretVault` that the app passes. A call without one
14
+ throws `SECRET_VAULT_REQUIRED`. Bare React Native apps can use
15
+ `./local/vault/react-native-keychain`, Expo apps
16
+ `./local/vault/expo-secure-store`, and Electron apps
17
+ `./local/vault/electron-safe-storage`.
18
+ 3. **Key-value store: change the import and the names.** The store moves from
19
+ `./local/store/react-native` to `./local/store/key-value`, and its names
20
+ drop the `ReactNative` prefix. To keep existing data, move its value key
21
+ into the vault before the first open.
22
+ 4. **Bare React Native: `./local/store/react-native` is now the SQLite
23
+ store.** `reactNativeStore()` opens an SDK-owned SQLCipher database on the
24
+ optional peer `@op-engineering/op-sqlite` 18.2.5 or later, with the
25
+ op-sqlite SQLCipher build turned on.
26
+ 5. **Expo: await the store.** Replace `expoStore()` with `await expoStore()`.
27
+ The SDK owns the database, its schema, and its key.
28
+ 6. **Node and Electron: open the new SQLCipher store.** `nodeStore({
29
+ directory, vault })` opens an SDK-owned SQLCipher database on the optional
30
+ peer `better-sqlite3-multiple-ciphers` 13.0.3 or later. It does not read
31
+ the files of the 7.2.0 Node store.
32
+ 7. **Remove the deleted names.** The `./local/store/expo/db` and
33
+ `./local/store/expo/schema` entries, the Expo database and key functions,
34
+ the profile-key storage functions, `createReferenceReactNativeBackend`, and
35
+ the `drizzle-orm`, `expo-crypto`, and `fs-native-extensions` peers are
36
+ removed.
37
+ 8. **Hosted Relay: copy the connection URL from the console again.** The
38
+ API path and the developer environment kind changed, and the sandbox and
39
+ staging hosts moved to new names.
40
+
41
+ Browser apps can also use the new `./local/store/web-sqlite` store, an
42
+ encrypted SQLite database in the origin private file system. It is optional,
43
+ and the IndexedDB store stays at `./local/store/web`.
44
+
45
+ - **Removed: the optional `expo-crypto` peer.** The SDK does not load
46
+ `expo-crypto`, so `package.json` no longer lists it. An app that installed
47
+ `expo-crypto` only for the SDK can uninstall it.
48
+ - **Added: web SQLite store gates in WebKit.** A macOS job runs the web
49
+ SQLite store's contract, interruption, and multi-tab gates in WebKit on
50
+ each change to the web SQLite store, the SQLite core, the storage contract,
51
+ the key vault, the gate, or a dependency. Linux WebKit (WebKitGTK) has no
52
+ origin private file system, so the web SQLite store does not run there. In
53
+ each job that must run these gates, a gate that skips for want of the
54
+ origin private file system fails. The store stays experimental: its
55
+ storage-pressure and soak gates do not exist yet.
56
+ - **Fixed: the SQLite stores report full storage as
57
+ `StorageQuotaExceededError`.** When the database file cannot grow because
58
+ the disk or the storage quota is full, a write on the Expo, bare React
59
+ Native, Node, or web SQLite store rejects with `StorageQuotaExceededError`
60
+ (`STORAGE_QUOTA_EXCEEDED`), with the SQLite error as `originalError`. It
61
+ rejected with the SQLite error or a `KEY_STORAGE_ERROR`, and the web SQLite
62
+ store reported a full origin quota as a disk I/O error. The rejected write
63
+ does not persist, the store stays open, and the write succeeds after space
64
+ frees.
65
+ - **Changed: each store and vault guide names the optional peers of its
66
+ entry.** Each guide has an install command for the peers that its entry
67
+ loads. For example, `./local/store/web` and `./local/store/web-sqlite` need
68
+ `idb`, and a bundler fails the app build without it.
69
+ - **Fixed: a group delete deletes the skipped sender keys.** The in-memory,
70
+ key-value, and IndexedDB stores kept them after
71
+ `deleteAllSenderKeysForGroup`. These keys decrypt skipped group messages.
72
+ The stores now delete them together with the sender keys of the group. A
73
+ group whose identifier starts with the identifier of the deleted group
74
+ keeps its keys.
75
+ - **Fixed: sender keys no longer collide.** Group `a` with sender `b:c` and
76
+ group `a:b` with sender `c` shared keys. In the in-memory and IndexedDB
77
+ stores, they shared one sender key record. In IndexedDB, they also shared
78
+ one skipped key. In database version 7, a sender key record has an array
79
+ key of group, sender, and device. The key of a skipped key adds the index,
80
+ and a group index finds the skipped keys of a group. The in-memory store
81
+ keys both with JSON arrays.
82
+ - **Changed: IndexedDB version 7 deletes stored sender keys.** The upgrade
83
+ deletes the version 6 sender key records and skipped keys. After the
84
+ upgrade, each group needs a new sender key distribution before its messages
85
+ decrypt. A late message for a deleted skipped key does not decrypt.
86
+ - **Fixed: `deleteAllSenderKeysForGroup` on the Expo store deletes the
87
+ group's skipped message keys.** On a store from `expoStore()`, it deleted
88
+ the group's sender keys and kept each skipped message key, which still
89
+ decrypts its message after the group is gone.
90
+ - **Fixed: the Expo store keeps SESAME user records and device identity
91
+ pins.** On a store from `expoStore()`, `setUserRecord` stored nothing, and
92
+ `setDeviceRecord` stored only the session. A user or device with no session
93
+ had no record, and `getDeviceRecord` returned the identity from the contact
94
+ trust store, not the pin that was set. The store now returns each user and
95
+ device that was set, with the pin that was set and the device's current
96
+ session, if any. `setDeviceRecord` and `deleteDeviceRecord` change the
97
+ record and its session together or not at all. `getAllUserIds` and
98
+ `getSesameDeviceIds` list the users and devices that were set, as on the
99
+ other stores.
100
+ - **Fixed: the Expo store keeps a registration ID that is set before the
101
+ identity key.** On a store from `expoStore()`, `setLocalRegistrationId` did
102
+ nothing until an identity key was stored.
103
+ - **Fixed: a client on the key-value store can send after it establishes a
104
+ session.** `./local/store/key-value` (`./local/store/react-native` before
105
+ the move) lost the session from each SESAME device record, so every send
106
+ failed with `No active session`. It also returned the device identity pin as
107
+ a plain object, not its bytes, after a reopen. The store now joins each
108
+ device with the session under its session key, and it keeps the pin bytes.
109
+ - **Fixed: a client on the IndexedDB store can send after it establishes a
110
+ session.** `./local/store/web` returned each SESAME device record with no
111
+ session, so every send failed with `No active session`. `getUserRecord` and
112
+ `getDeviceRecord` on the IndexedDB store, and `getUserRecord` on the
113
+ in-memory store, now join each device with the session under its address,
114
+ and the stored identity pin wins over one derived from the session. On the
115
+ IndexedDB store, `setDeviceRecord` writes the device and its session in one
116
+ transaction, and `deleteDeviceRecord` removes the session with the device.
117
+ - **Fixed: the in-memory store returns no session for a device whose session
118
+ is deleted.** After `deleteSessionRecord`, `getDeviceRecord` and
119
+ `getUserRecord` on `./local/store/memory` returned the session that
120
+ `setDeviceRecord` stored earlier. The store now keeps each device without
121
+ its session and joins the device with the session under its address, as
122
+ the other stores do. `setDeviceRecord` rejects a session record that is not
123
+ current, and `setUserRecord` stores no session.
124
+ - **Added: `./local/store/web-sqlite`, a web store on encrypted SQLite.**
125
+ `webSqliteStore(options?)` opens an SDK-owned SQLite database in the origin
126
+ private file system. The SQLite3 Multiple Ciphers Wasm engine runs in a
127
+ dedicated module worker and encrypts the whole file. On first use the store
128
+ creates the database key in the secret vault, by default IndexedDB in the
129
+ same origin, then the file. Each open applies the SDK migrations.
130
+ `resetWebSqliteStore(options?)` deletes the file, creates a new key, and
131
+ opens an empty store. `createPreKeyMaintenanceStore` takes an open store.
132
+ The tabs of an origin share the database, and the opens and resets of a
133
+ name run one at a time across the tabs. A reset fails with `INVALID_STATE`
134
+ while any tab has the store open. The page's Content Security Policy must
135
+ allow `'wasm-unsafe-eval'` for the worker; without it, the open fails with
136
+ `SQLITE_ENGINE_UNAVAILABLE`. A context without OPFS gets
137
+ `OPFS_UNAVAILABLE`. The key in IndexedDB protects a copy of the database
138
+ file; it is not an XSS defense.
139
+ - **Breaking: the SDK owns the Expo database.** `expoStore(options?)`
140
+ opens an SDK-owned SQLCipher database in the `expo-sqlite` default
141
+ directory. On first use it creates the database key in the secret vault
142
+ (Expo SecureStore by default), then the file. Each open applies the SDK
143
+ migrations. `ExpoSignalProtocolStore` has no public constructor, and
144
+ `close()` closes the store. An open fails with `LOCAL_STORE_KEY_LOST` when
145
+ the file exists and the vault holds no key for it. It fails with
146
+ `INVALID_STATE` when a store of the process holds the same name, or when a
147
+ newer SDK wrote the file. `createPreKeyMaintenanceStore` takes the open
148
+ store. The options accept `encryptionAtRest: false`, which opens a
149
+ plaintext database and does not use the vault. An open with the other
150
+ setting than the one that created the file fails with
151
+ `SqliteKeyMismatchError` (`KEY_STORAGE_ERROR`), not `LOCAL_STORE_KEY_LOST`.
152
+ Keep application tables in a separate database file.
153
+ - **Breaking: `expoStore()` is now async.** It returns a promise of the open
154
+ store. Replace `expoStore()` with `await expoStore()`.
155
+ `ExpoSignalProtocolStoreFactoryOptions` is now `ExpoSignalProtocolStoreOptions`.
156
+ - **Breaking: the Expo module functions that exposed the database or its key
157
+ are removed.** The `./local/store/expo` entry no longer exports
158
+ `getKeyStorage`, `resetKeyStorage`, `getDatabaseKeyManager`,
159
+ `resetDatabaseKeyManager`, `clearDatabaseKeyCache`, `getPrimaryIdentityKey`,
160
+ or `getContactIdentity`. The `./local/store/expo/db` entry, with
161
+ `configureSignalProtocolExpoDbBindings`,
162
+ `resetSignalProtocolExpoDbBindings`, `getDrizzle`, `getRawDatabase`, and its
163
+ tables, is removed. The `./local/store/expo/schema` entry is removed. The
164
+ `drizzle-orm` peer dependency is removed.
165
+ - **Breaking: `ExpoSignalProtocolStore.getDatabaseKey()` is removed.** The
166
+ database key stays in the secret vault, and the store does not return it.
167
+ - **Changed: `clearAllKeys` on the Expo store empties every table and keeps
168
+ the database key.** The file stays open with the same key.
169
+ `resetExpoStore(options?)` is the full teardown: it deletes the database
170
+ file, creates a new key, and opens an empty store. It is the only way to
171
+ open a store whose key is lost.
172
+ - **Added: `@open-e2ee/signal-protocol-sdk/local/vault/electron-safe-storage`.**
173
+ `ElectronSafeStorageSignalProtocolSecretVault` is a
174
+ `SignalProtocolLocalSecretVault` for the Electron main process. The app
175
+ passes its own `safeStorage`, so the SDK does not import `electron`. The
176
+ vault encrypts each secret with `safeStorage` and keeps only the ciphertexts
177
+ in a file that the app names. It fails closed when async encryption is not
178
+ available, on the Linux `basic_text` and `unknown` backends, and on Linux
179
+ when a ciphertext does not start with `v11`. A `v10` ciphertext means that
180
+ no secret service answered, so `safeStorage` used its fixed fallback key.
181
+ - **Added: the optional peer `better-sqlite3-multiple-ciphers` 13.0.3 or
182
+ later.** The SQLite store for Node and Electron uses it. An app that does
183
+ not use that store does not install it.
184
+ - **Breaking: the Node store is an SDK-owned SQLCipher database.**
185
+ `nodeStore(options)` takes `{ directory, vault }` in place of the optional
186
+ `{ dataDir }`, and opens an encrypted SQLite database on
187
+ `better-sqlite3-multiple-ciphers` in `directory`. On first use it creates
188
+ the database key in `vault`, then the file. The options also accept `name`,
189
+ `encryptionAtRest: false`, and `logger`, as the Expo store does. It runs in
190
+ Node and in the Electron main process; in Electron, pass the safeStorage
191
+ vault. `NodeSignalProtocolStore` has no public constructor, and
192
+ `NodeSignalProtocolStoreConfig` is now `NodeSignalProtocolStoreOptions`.
193
+ `close()` closes the store. An open fails with `LOCAL_STORE_KEY_LOST` when
194
+ the file exists and the vault holds no key for it, and with
195
+ `INVALID_STATE` when a store of the process holds the same file or a newer
196
+ SDK wrote it. The store does not read the files of the earlier Node store.
197
+ Keep application tables in a separate database file.
198
+ - **Breaking: the `fs-native-extensions` peer dependency is removed.**
199
+ - **The Node store has one owner process.** An open store holds the owner
200
+ lock `<name>.lock` beside the database until `close()`, and the operating
201
+ system releases it when the process exits. An open or a reset in another
202
+ process fails at once with `SqliteStoreInUseError` (`KEY_STORAGE_ERROR`),
203
+ before it reads the vault or touches the file.
204
+ - **Added: `resetNodeStore(options)`, `createPreKeyMaintenanceStore(store)`,
205
+ and `sqliteDatabaseKeySlot(path)` on `./local/store/node`.**
206
+ `resetNodeStore` deletes the database file, creates a new key, and opens an
207
+ empty store. `sqliteDatabaseKeySlot` names the vault slot of the key for a
208
+ database path, so an app can move the key when it moves the directory.
209
+ - **Changed: the Node store has the semantics of the Expo store.** A user
210
+ record is the aggregate of the user's sessions, so `setUserRecord` stores
211
+ nothing. `setDeviceRecord` does not pin the identity key of a device,
212
+ `setDeviceSession` does not require a registered device, and
213
+ `setLocalRegistrationId` stores nothing before the identity key.
214
+ `deleteAllSenderKeysForGroup` keeps the group's skipped sender keys.
215
+ - **The Expo store runs on a shared SQLite core.** The store's schema,
216
+ queries, and transactions move from the Expo entry to an internal core that
217
+ runs on any SQLite binding. Every statement and transaction on the
218
+ database goes through one queue, so concurrent store calls no longer
219
+ collide in `BEGIN` or `ROLLBACK`. A save that replaces a signed prekey with
220
+ the same key ID now zeroes the private key that it replaces.
221
+ - **The Expo account wipe empties every SDK table.** `clearAllKeys` and
222
+ `wipeAllSignalProtocolData` on the Expo store now empty every SDK table, as
223
+ the web and Node stores do. This adds the metadata, sender keys, skipped
224
+ sender keys, message records, profile keys, group master keys, group state
225
+ cache, and auth credential cache, and for `clearAllKeys` the KEM one-time
226
+ prekeys.
227
+ - **A bare React Native app can bundle the SDK.** The root entry no longer
228
+ uses `export * as` to export the `safety`, `keys`, `encoding`, `blocking`,
229
+ and `media` namespaces. `@react-native/babel-preset` has no transform for
230
+ that syntax, so Metro in a bare React Native app rejected the whole bundle.
231
+ The namespaces and their members do not change.
232
+ - **Added: `EncryptionErrorCode.SQLITE_ENGINE_UNAVAILABLE`,
233
+ `EncryptionErrorCode.OPFS_UNAVAILABLE`, and
234
+ `EncryptionErrorCode.OPFS_FILE_BUSY`.** The web SQLite store fails with
235
+ these codes when its Wasm engine cannot load in its worker, when the browser context has no OPFS storage for it, or when it
236
+ cannot open its database file this time, usually because another tab still
237
+ holds the file. Retry after `OPFS_FILE_BUSY`; the file is unchanged. An
238
+ exhaustive `switch` over `EncryptionErrorCode` needs the three new cases.
239
+ - **Changed: the package ships the SQLite3 Multiple Ciphers 2.5.1 Wasm
240
+ engine.** `dist/local/store/sqlite/web/sqlite3mc/` holds `sqlite3.mjs` and
241
+ `sqlite3.wasm` from the signed release, about 1.5 MB. `sqlite3.wasm` is
242
+ unmodified. `sqlite3.mjs` carries two recorded patches, so a failed pool
243
+ install never deletes the database files and a failed attach holds no file
244
+ handle. Both files are pinned by sha256. Only the worker of
245
+ `./local/store/web-sqlite` loads them. `THIRD_PARTY_NOTICES.md` lists their
246
+ licenses.
247
+ - **Added: the bare React Native SQLite store at `./local/store/react-native`.**
248
+ `reactNativeStore(options?)` opens an SDK-owned SQLCipher database on
249
+ op-sqlite, with its key in the react-native-keychain vault by default, on
250
+ the same SQLite core and with the same options, errors, and reset as
251
+ `expoStore`. `resetReactNativeStore(options?)` deletes the database
252
+ and opens an empty store, and `createPreKeyMaintenanceStore` takes the open
253
+ store. `close()` checkpoints the write-ahead log into the database file
254
+ before it closes the connection. The app turns on the op-sqlite SQLCipher build with
255
+ `"op-sqlite": { "sqlcipher": true }` in its `package.json`. Without it, an
256
+ encrypted open fails with `KEY_STORAGE_ERROR` before it creates a file.
257
+ `@op-engineering/op-sqlite` 18.2.5 or later is an optional peer, and only
258
+ this entry imports it.
259
+ - **Breaking: the own profile key lives in the application's secret vault.**
260
+ The SDK no longer writes the profile key to `localStorage`, and it no longer
261
+ picks a storage by platform. `getOwnProfileKey`, `setOwnProfileKey`,
262
+ `getOrCreateOwnProfileKey`, `getOwnProfileKeyBase64`, and
263
+ `rotateOwnProfileKey` take a `SignalProtocolLocalSecretVault` as their first
264
+ argument. `updateEncryptedProfile` takes a `vault` parameter when it gets no
265
+ `profileKey`. The vault holds the key as its raw 32 bytes under
266
+ `signal_profile_key_v1`. To upgrade, pass the vault to each call. On Expo,
267
+ use `ExpoSecureStoreSignalProtocolSecretVault` from
268
+ `@open-e2ee/signal-protocol-sdk/local/vault/expo-secure-store`. Remove each
269
+ use of `setProfileKeyStorage`, `getProfileKeyStorage`,
270
+ `resetProfileKeyStorage`, `createMemoryStorage`, and `ProfileKeyStorage`.
271
+ These exports are deleted.
272
+ - **Breaking: the device ID and the device-lifecycle state live in the
273
+ application's secret vault.** `getDeviceId` and `preloadDeviceId` take the
274
+ vault as their first argument. `DeviceLifecycleDeps` has a `vault` field in
275
+ place of `secureStore`, and the `DeviceLifecycleSecureStore` type is
276
+ deleted. The vault holds each value as UTF-8 text. To upgrade, pass the same
277
+ vault to `DeviceLifecycleManager`, `getDeviceId`, and `preloadDeviceId`. The
278
+ SDK does not read the plain SecureStore values that an earlier version
279
+ wrote, so reset the device when you upgrade.
280
+ - **Breaking: a call without a vault throws `SECRET_VAULT_REQUIRED`.** Each
281
+ function above, and the `DeviceLifecycleManager` constructor, throws an
282
+ `EncryptionError` with the new code `EncryptionErrorCode.SECRET_VAULT_REQUIRED`
283
+ when the vault is absent. The error context names the operation.
284
+ - **Breaking: the shared `./device` entries import no platform package.**
285
+ `./device`, `./device/device-id`, and `./device/lifecycle` now load without
286
+ Expo, React Native, or `react-native-device-info`. They take platform
287
+ metadata as input, and they omit each field that the application does not
288
+ supply. To upgrade:
289
+ - Spread `getDeviceLifecyclePlatform()` into the `DeviceLifecycleManager`
290
+ dependencies. `DeviceLifecycleDeps` extends the new
291
+ `DeviceLifecyclePlatform` type: `generateDeviceName`,
292
+ `getDeviceFingerprint`, `deviceType`, `platform`, `osVersion`, and
293
+ `appVersion`, each optional. Without `generateDeviceName`, the device name
294
+ is `Unknown Device`. Without `getDeviceFingerprint`, registration sends no
295
+ `idfv` and does not reclaim a device.
296
+ - Pass the same facts to `getLocalDeviceMetadata`, which now takes them as
297
+ its argument.
298
+ - Pass a `TransferDeviceInfo` to `generateTransferQRCode`,
299
+ `prepareNewDeviceTransfer`, `createEmptyBackup`, `createDeviceBackup`, and
300
+ `prepareOldDeviceTransferWithBackup`. Get it from
301
+ `getTransferDeviceInfo()`, or pass `{}` to send no metadata. The QR code
302
+ omits `deviceType` when the metadata has no platform, and
303
+ `TransferQRCode.deviceType` is optional.
304
+ - **Added: `./device/react-native`.** It reads device metadata on bare React
305
+ Native through `react-native` and `react-native-device-info`, and it reaches
306
+ no Expo package. It exports `getDeviceMetadata`, `getTransferDeviceInfo`,
307
+ and `getDeviceLifecyclePlatform`. Its lifecycle facts include a fingerprint
308
+ from `getUniqueId()`.
309
+ - **Changed: `./device/expo` reads the lifecycle and transfer metadata.** It
310
+ now imports `expo-device` too, and it adds `getTransferDeviceInfo` and
311
+ `getDeviceLifecyclePlatform`. Expo has no device fingerprint without another
312
+ package, so its lifecycle facts have no `getDeviceFingerprint`. Supply one
313
+ to keep reclaim detection.
314
+ - **Added: a secret vault for bare React Native apps.**
315
+ `ReactNativeKeychainSignalProtocolSecretVault` from
316
+ `@open-e2ee/signal-protocol-sdk/local/vault/react-native-keychain` stores
317
+ vault secrets with `react-native-keychain`, a new optional peer at 10.0.0 or
318
+ later. The adapter sets fixed options that the app cannot change: iOS
319
+ `AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY`, Android `AES_GCM_NO_AUTH` storage at
320
+ the `SECURE_SOFTWARE` level, and no `cloudSync` key. The secret stays on the
321
+ device. react-native-keychain 10.0.0 turns iCloud sync on for any
322
+ `cloudSync` value, `false` included, so the adapter never sends that key.
323
+ - **Breaking: React Native and Expo apps must install a global random
324
+ source.** The SDK reads random bytes on React Native only from the global
325
+ `crypto.getRandomValues`. It no longer uses `expo-crypto` for random bytes,
326
+ and the key-value store no longer imports `expo-crypto`. To
327
+ upgrade, install `react-native-get-random-values` 2.x or
328
+ `react-native-quick-crypto`, and load it before the first SDK call.
329
+ Without a global source, the SDK throws `SecureRandomUnavailableError`.
330
+ - Added: `SecureRandomUnavailableError`, with the code
331
+ `SECURE_RANDOM_UNAVAILABLE` and the guard `isSecureRandomUnavailableError`,
332
+ exported from `/types`. The SDK throws it when the runtime has no
333
+ cryptographically secure random source.
334
+ - **Breaking: `getGroupServiceIds` on the in-memory relay is now
335
+ asynchronous.** It returns a `Promise`. To upgrade, `await` each call.
336
+ - **Breaking: `GroupAuthorizationServerEngine` takes its runtime as a
337
+ required argument.** The engine no longer picks a host random source, so a
338
+ server bundle of the engine reaches no client platform seam. To upgrade,
339
+ pass a `GroupServerEngineRuntime` with `now` and `randomBytes` as the second
340
+ constructor argument. The in-memory relay's
341
+ `InMemoryGroupAuthorizationServer` still supplies its own runtime.
342
+ - Fixed: the username discriminator had a small bias toward low values. The
343
+ SDK now draws it with rejection sampling, so each value in the range has
344
+ the same probability.
345
+ - **Fixed: on React Native, the hosted Relay socket did not open.** The SDK
346
+ built the socket URL with the `protocol` setter of `URL`, and the React
347
+ Native `URL` has no setters. Now the SDK builds the URL itself.
348
+ - **Fixed: on React Native, `isVerifyUrl`, `parseVerifyUrl`, and
349
+ `parseProvisioningQR` accepted a lookalike custom-scheme link,** such as
350
+ `signalprotocol://verify-evil`. The React Native `URL` reads no host or path
351
+ for a custom scheme. The SDK now parses these links, the relay connection
352
+ URL, Web Push endpoints, object store URLs, and TUS upload locations with
353
+ its own parser, which gives the same result on every runtime.
354
+ - **Changed: the SDK rejects a URL that is not in a canonical form.** Upgrade
355
+ step: give each URL as ASCII, without credentials, a fragment, an empty
356
+ query (`?` with nothing after it), or a `.` or `..` path segment. Write the
357
+ host in the form that a WHATWG `URL` gives, and do not use an `xn--` label,
358
+ an IPv4 address in a short or hexadecimal form, or an IPv6 address in a
359
+ non-compressed form. Do not write a port with a leading zero. Percent-encode
360
+ a space, a non-ASCII character, and a `'` in a query. This applies to the
361
+ verification and provisioning links and their `VerifyLinkConfig` and link
362
+ prefix, the relay connection URL, Web Push endpoints, and object store
363
+ upload and download URLs. A TUS server must return a `Location` that is an
364
+ absolute URL, a path that starts with `/`, or a relative path, not a
365
+ network-path reference that starts with `//`. A query value that is not
366
+ valid UTF-8 now makes a verification or provisioning link invalid.
367
+ - **Changed: `encryptFile` and `decryptFile` throw an `EncryptionError` with
368
+ the new code `BINARY_BLOB_UNAVAILABLE` when the runtime's `Blob` cannot hold
369
+ bytes.** The React Native `Blob` rejects binary parts and has no
370
+ `arrayBuffer()` or `text()`, so these methods cannot work there. They now
371
+ throw before they touch the session, so the key message stays unconsumed.
372
+ Upgrade step: on React Native, use `streamingEncrypt` and `streamingDecrypt`
373
+ from `@open-e2ee/signal-protocol-sdk/files`.
374
+ - **Fixed: on a React Native runtime without `Buffer`, `TextDecoder`, or
375
+ `structuredClone`, the stores, the relay clients, and message decoding
376
+ failed.** These parts now use the SDK's base64, UTF-8, and clone functions.
377
+ UTF-8 decoding uses the runtime's `TextDecoder` only when it passes a
378
+ conformance check, and a built-in WHATWG decoder otherwise, so invalid
379
+ UTF-8 gives the same result on every runtime.
380
+ - Changed: the Expo store models decode base64 strictly. A stored key that is
381
+ not padded standard base64 with zero trailing bits now fails to load.
382
+ Before, the models skipped invalid characters. The SDK writes only this
383
+ form, so the change affects only a row that was changed by hand.
384
+ - Fixed: the Convex relay's `subscribe` threw in a browser that loads the SDK
385
+ without a bundler `define`, where there is no `process` global. It now
386
+ falls back to polling there, as it does when `EXPO_PUBLIC_CONVEX_URL` is not
387
+ set.
388
+ - **Fixed: the Expo store's `getDetailedStats()` and full data wipe now
389
+ complete.** Before, both read or deleted a table that does not exist, so
390
+ `getDetailedStats()` failed and the wipe (`wipeAllSignalProtocolData()` on
391
+ the store from `getKeyStorage()`) rolled back. The `users` count is now the
392
+ number of distinct users that have a session.
393
+ - Fixed: on the Expo store, a signed prekey that reuses the ID of a replaced
394
+ signed prekey is now the current signed prekey. Before, the store kept the
395
+ replaced mark, so `getEcSignedPreKey()` returned `null`.
396
+ - Fixed: `createPreKeyMaintenanceStore().cullReplacedPreKeys()` on the Expo
397
+ store now culls the four prekey tables one at a time. Before, it opened
398
+ four transactions at the same time on one connection, and the cull failed
399
+ with "cannot start a transaction within a transaction".
400
+ - **Breaking: the key-value store moves to `./local/store/key-value`.** In
401
+ 7.2.0, `./local/store/react-native` exported it. Change each import of the
402
+ key-value store from `@open-e2ee/signal-protocol-sdk/local/store/react-native`
403
+ to `@open-e2ee/signal-protocol-sdk/local/store/key-value`.
404
+ `./local/store/react-native` now exports the bare React Native SQLite
405
+ store.
406
+ - **Breaking: the key-value store names drop the React Native prefix.** The
407
+ store works over any key-value backend, so its names do not name a
408
+ platform. Change each name:
409
+ - `ReactNativeSignalProtocolStore` → `KeyValueSignalProtocolStore`
410
+ - `reactNativeStore` → `keyValueStore`
411
+ - `ReactNativeStoreFactoryOptions` → `KeyValueSignalProtocolStoreOptions`,
412
+ which `create`, `reset`, and `keyValueStore` all take
413
+ - `ReactNativeKeyValueStorage` → `KeyValueStorage`
414
+ - `ReactNativeKeyValueOperation` → `KeyValueOperation`
415
+ - **Breaking: the key-value store keeps its value key in a secret vault.**
416
+ Before, the store wrote its 32-byte value key into the same key-value
417
+ backend as the data it encrypted, under `@signal:databaseKey`, and logged a
418
+ warning. Pass a `SignalProtocolLocalSecretVault` backed by the platform
419
+ keychain or keystore, such as `ReactNativeKeychainSignalProtocolSecretVault`,
420
+ as `vault` to `create`, `reset`, or `keyValueStore`. Without a vault,
421
+ each of them throws `SECRET_VAULT_REQUIRED`. To keep
422
+ existing data, before the first open on this version, read the base64 value
423
+ of `@signal:databaseKey` from your backend, write its decoded bytes to the
424
+ vault under `signal_key_value_encryption_key`, and remove
425
+ `@signal:databaseKey` from the backend. The key-value store guide describes
426
+ key custody.
427
+ - **Breaking: a lost value key is an error, not a new key.** When the backend
428
+ holds store data and the vault holds no key, `create` rejects with an
429
+ `EncryptionError` whose code is the new `LOCAL_STORE_KEY_LOST`, and it
430
+ changes nothing. Before, a missing key gave a new key that could not read
431
+ the old data. Catch the code, and then restore the vault entry or call
432
+ `KeyValueSignalProtocolStore.reset({ storage, vault })`. `reset` deletes
433
+ every store record, and then makes a new key. If the process stops between
434
+ the two steps, the next `create` opens an empty store.
435
+ - **Breaking: `createReferenceReactNativeBackend` is no longer exported.** It
436
+ is now test code of the SDK. To verify your backend, use
437
+ `assertBackendConformance` or `runBackendConformance`, which stay exported.
438
+ To get an in-memory backend for your own tests, write one that passes the
439
+ kit.
440
+ - Added: `./local/store/key-value/realm` with `createRealmKeyValueBackend`, a
441
+ key-value backend over an open Realm. The SDK does not import `realm` and
442
+ does not declare it as a dependency or peer. Your application installs
443
+ `realm` and adds `realmKeyValueSchema` to its schema list. Each store write
444
+ runs in one `realm.write` transaction. The adapter is tested with the
445
+ conformance kit on realm 20.2.0 in Node. Realm has no maintainer since
446
+ 2025-09-30. The key-value store guide lists its known build issues.
447
+ - Added: `createTransactionalKeyValueBackend` in `./local/store/key-value`,
448
+ with the types `TransactionalKeyValueEngine`, `KeyValueTransaction`, and
449
+ `KeyValueReader`. It makes a key-value backend from an engine's own
450
+ transaction and a synchronous handle with `get`, `set`, `delete`, and
451
+ `keysWithPrefix`. The SDK applies each `atomicWrite` batch inside that
452
+ transaction, so a backend does not copy the batch rules. The Realm backend
453
+ uses it. To upgrade a backend that you wrote for an engine with
454
+ transactions, replace its `atomicWrite` code with this function and run the
455
+ conformance kit again. The key-value store guide has an op-sqlite sketch.
456
+ - **Fixed: `stop()` resolved while a relay delivery or a retry request was in
457
+ progress.** The decrypt then went on after logout and wrote to the store
458
+ after the app could have closed it. `stop()` now resolves only after the SDK
459
+ work of the deliveries, retry requests, and receipt sends in progress
460
+ finishes. It does not wait for app hooks, so a hook can await `stop()`. This
461
+ includes the session hooks of a resend for a retry request, when the resend
462
+ sets up a session with a new or stale device. Another resend to the same
463
+ user that waits while such a hook runs stops waiting and sends nothing, and
464
+ its message record stays for the next retry request. When a hook returns
465
+ after `stop()`, the SDK drops the work after the hook and writes nothing
466
+ more. The relay delivers the envelope again after the next start, and the
467
+ hook gets the plaintext again. A delivery that fails is logged and no longer
468
+ rejects as an unhandled promise.
469
+ - **Breaking: the managed Signal Protocol Relay hosts use the lane tokens.**
470
+ The SDK pins `https://sandbox.relay.open-e2ee.dev`,
471
+ `https://stage.relay.open-e2ee.dev`, and
472
+ `https://stage-sandbox.relay.open-e2ee.dev`.
473
+ `https://relay.open-e2ee.dev` does not change. A connection URL on
474
+ `development.relay.open-e2ee.dev`, `staging.relay.open-e2ee.dev`, or
475
+ `staging-customer-development.relay.open-e2ee.dev` is now invalid. Copy the
476
+ connection URL from the console again.
477
+ - **Breaking: the Signal Protocol Relay API path is `/signal/v1/*`.** A
478
+ connection URL is now `https://<host>/signal/v1/connection/<key>`, and the
479
+ SDK sends each request under `/signal/v1/`. The SDK rejects a connection URL
480
+ with the old `/v1/connection/` path, and a connection document whose
481
+ `protocolEndpoint` is not `<origin>/signal/v1`.
482
+ - **Breaking: the developer environment kind is `sandbox`.** The
483
+ `environment` of a hosted Relay connection is now `'sandbox' |
484
+ 'production'`. The SDK rejects a connection document that names the old
485
+ kind. The Relay gives a sandbox publishable key the prefix `pk_sandbox_`.
486
+
487
+ - **A bare React Native example.** `examples/react-native` runs the encrypted
488
+ exchange in a React Native 0.87.1 app with no Expo module. Alice uses
489
+ `reactNativeStore()` on the op-sqlite SQLCipher build, with the database key
490
+ in `react-native-keychain`. On each launch, the app logs the SQLCipher
491
+ version and the first 16 bytes of the SDK database file, and requires that a
492
+ wrong key fails the open of an SDK database. The run fails when the build has
493
+ no SQLCipher or when the file starts with the plaintext SQLite header. CI
494
+ builds the release APK and runs it twice on an Android emulator, and requires
495
+ these lines on each run. On every change, CI also builds the example's Metro
496
+ release bundle with the packed SDK and the stock Babel preset, and compiles
497
+ it with Hermes.
498
+
499
+ - **The Expo example checks that SQLCipher encrypts its database.** On each launch,
500
+ `examples/expo` logs the SQLCipher version and the first 16 bytes of the SDK
501
+ database file. The run fails when the build has no SQLCipher or when the
502
+ file starts with the plaintext SQLite header. The Android emulator job
503
+ requires both lines on each run. The example now depends on
504
+ `expo-file-system` to read the file.
505
+
506
+ ## 7.2.0
507
+
508
+ - **Fixed: a send now reaches every device that the relay lists for the
509
+ recipient.** Before, after one device of the recipient had a session, a
510
+ send used only the devices that the sender already knew. A device that the
511
+ recipient linked later received nothing. When the first message came from
512
+ one device of the recipient, the reply went only to that device. A device
513
+ that the relay removed still got a copy. Now a 1:1 send, and a sender key
514
+ distribution to a group member, reads the recipient's device list from the
515
+ relay (`getActiveDevices`) when the last read is older than 60 s. The send
516
+ then makes a session for each listed device that has none, and removes each
517
+ local device that the relay does not list. Inside the 60 s window, a send
518
+ makes no relay read. If the read fails and a session exists, the send goes
519
+ to the known devices and the next send reads the list again.
520
+ `SendResult.recipientDeviceCount` now counts the devices that the relay
521
+ accepted a copy for.
522
+ - Changed: the relay's `getActiveDevices` now decides which devices a 1:1
523
+ send goes to, also after a manual `establishSession`. On the in-memory
524
+ relay, call `registerDevice` for each recipient device, as the examples
525
+ do. A device that is not registered gets no copy, and a send to a
526
+ recipient with no registered device fails with `RECIPIENT_NOT_REGISTERED`.
527
+ - **Changed: the React Native and Expo peer ranges have no upper bound.**
528
+ Each peer now has only a lower bound. The bounds are `react-native` 0.83.6
529
+ and `expo` 55.0.27, or later versions. The Expo module bounds are
530
+ `expo-constants` 55.0.7, `expo-crypto` 55.0.16, and `expo-device` 55.0.15,
531
+ or later versions. The `expo-secure-store` bound is 55.0.15 and the
532
+ `expo-sqlite` bound is 55.0.17, or later versions. Before, a project on
533
+ React Native 0.84, Expo SDK 56, or a later line got `ERESOLVE` from
534
+ `npm install`. The README lists the versions that CI installs, bundles, and
535
+ runs on an Android emulator.
536
+ - **Changed: every other peer range has a lower bound only.** A new major
537
+ release of a peer now installs. The `react` peer changes from `^19.0.0` to
538
+ `>=19.0.0`, `convex` from `^1.42.1` to `>=1.42.1`, `idb` from `^8.0.3` to
539
+ `>=8.0.3`, and `react-native-device-info` from `^15.0.1` to `>=15.0.1`. The
540
+ `fs-native-extensions` peer changes from the exact `1.2.7` to `>=1.2.7`.
541
+ Version 1.5.1 passes the Node store checks on Node.js 22 and 26. The
542
+ `drizzle-orm` peer changes from `^0.45.1` to `>=0.45.1`, and the
543
+ `@convex-dev/r2` peer from `^0.10.2` to `>=0.10.2`. A weekly check installs
544
+ the latest and next release of each peer against the SDK. CONTRIBUTING.md
545
+ states the range rules.
546
+ - Changed: the Expo example uses Expo SDK 57, React Native 0.86.3, and
547
+ React 19.2.3.
548
+ - Fixed: the Drizzle migrations of the Expo example did not build the store
549
+ schema of the SDK. On a device, the first sync failed with
550
+ `no such column: instance_id`. The new migration
551
+ `0003_kyber_prekey_instance` adds `kyber_prekeys.instance_id` and
552
+ `kyber_prekey_used.kyber_prekey_row_id`, and it keeps the existing rows.
553
+ It also marks each earlier current Kyber prekey as replaced, so that each
554
+ identity has one current Kyber prekey. The Expo bundle check in CI now
555
+ fails when the example migrations do not build the packed SDK schema.
556
+ - Fixed: `useKeyRotation` threw a `TypeError` on the first app state change
557
+ when `AppState.currentState` was `null`. React Native keeps it `null` when
558
+ its native AppState module is not available. Now the hook rotates only
559
+ after the app returns from `background` or `inactive`. The `currentState`
560
+ property of `RelayLifecycleAppState` now accepts `null` and `undefined`,
561
+ as the React Native 0.87 types declare. The SDK source now typechecks
562
+ against those types.
563
+ - Fixed: the bare React Native store documentation said that the store needs
564
+ a Web Crypto polyfill. It does not. AES-256-GCM uses the bundled Noble
565
+ implementation when `crypto.subtle` is absent. The store does need
566
+ `expo-crypto`, so a bare application must install Expo modules.
567
+
3
568
  ## 7.1.0
4
569
 
5
570
  - **New: `watch()` registers a presence watch and receives pushed updates.**
package/README.md CHANGED
@@ -11,7 +11,7 @@ Add encrypted messaging to Expo, React Native, browser, and Node applications. T
11
11
 
12
12
  The default policy requires post-quantum session establishment and ratcheting. The protocol implementation is open source under the MIT License or the Apache License 2.0, at your option.
13
13
 
14
- [**Run an encrypted exchange in your browser**](https://open-e2ee.dev/playground) · [Edit on StackBlitz](https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v7.1.0/examples/browser) · [Run on Expo / Hermes](./examples/expo/README.md)
14
+ [**Run an encrypted exchange in your browser**](https://open-e2ee.dev/playground) · [Edit on StackBlitz](https://stackblitz.com/fork/github/open-e2ee/signal-protocol-js/tree/v8.0.0/examples/browser) · [Run on Expo / Hermes](./examples/expo/README.md)
15
15
 
16
16
  [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-2f6f5e)](./LICENSE)
17
17
  [![npm version](https://img.shields.io/npm/v/@open-e2ee/signal-protocol-sdk)](https://www.npmjs.com/package/@open-e2ee/signal-protocol-sdk)
@@ -43,7 +43,7 @@ The relay never needs message plaintext or device private keys.
43
43
 
44
44
  OpenE2EE implements a versioned profile of the published Signal Protocol specifications. It is not affiliated with Signal Messenger and is **not wire-compatible with Signal Messenger or libsignal**. Messages, identities, and safety numbers do not interoperate. See the [notice](./NOTICE) and [documented deviations](./docs/DEVIATIONS.md).
45
45
 
46
- Version `7.1.x`. Public APIs and persisted formats follow semantic versioning.
46
+ Version `8.0.x`. Public APIs and persisted formats follow semantic versioning.
47
47
 
48
48
  ## Install
49
49
 
@@ -106,10 +106,24 @@ Choose the device-local store for your runtime. Then supply a relay that authent
106
106
 
107
107
  | Runtime | Storage path | Deployment boundary |
108
108
  |---|---|---|
109
- | Expo | [`expoStore`](./local/store/expo/README.md) | Configure SQLCipher before schema access. Requires a native development or release build. [Run the Hermes example](./examples/expo/README.md); Expo Go does not include SQLCipher. |
109
+ | Expo | [`expoStore`](./local/store/expo/README.md) | Enable SQLCipher in the expo-sqlite config plugin. The SDK owns the database file, its key, and its migrations. Requires a native development or release build. [Run the Hermes example](./examples/expo/README.md); Expo Go does not include SQLCipher. |
110
110
  | Browser | [`indexedDbStore`](./local/store/web/README.md) | Use a secure context and a restrictive CSP. Same-origin JavaScript can access stored records and their key. [Browser setup](https://docs.open-e2ee.dev/start/browser). |
111
- | Bare React Native | [`reactNativeStore`](./local/store/react-native/README.md) | Provide an atomic, durable key-value backend and run the exported backend conformance kit. |
112
- | Node | [`nodeStore`](./local/store/node/README.md) | Install `fs-native-extensions@1.2.7` and set an explicit private directory on a trusted local filesystem. |
111
+ | Browser, SQLite | [`webSqliteStore`](./local/store/web-sqlite/README.md) | Needs the origin private file system and a CSP that allows `'wasm-unsafe-eval'`. The SDK owns the database file, its key, and its migrations. The key sits in IndexedDB in the same origin, so same-origin JavaScript can read it. |
112
+ | Bare React Native | [`reactNativeStore`](./local/store/react-native/README.md) | Enable SQLCipher with `"op-sqlite": { "sqlcipher": true }` in the app's `package.json`, and install `react-native-keychain`. The SDK owns the database file, its key, and its migrations. Requires a native build; with SQLCipher on, op-sqlite conflicts on iOS with `expo-sqlite`, `expo-updates`, and `use_frameworks!`. |
113
+ | Own key-value engine | [`keyValueStore`](./local/store/key-value/README.md) | Provide an atomic, durable key-value backend and a keychain-backed secret vault, and run the exported backend conformance kit. A Realm backend is included. |
114
+ | Node and Electron | [`nodeStore`](./local/store/node/README.md) | Install `better-sqlite3-multiple-ciphers` and pass a private directory on a local file system and a secret vault. In Electron, open it in the main process with the safeStorage vault. The SDK owns the database file, its key, and its migrations. |
115
+
116
+ React Native support starts at React Native 0.83.6 and Expo SDK 55. The peer ranges have no upper bound. CI checks these versions:
117
+
118
+ | CI check | Versions |
119
+ |---|---|
120
+ | Add the packed package to a project | React Native 0.83, 0.85, 0.86, and 0.87; Expo SDK 55, 56, and 57 |
121
+ | Build the Expo example's Hermes bundle | Expo SDK 55 and 57 |
122
+ | Run the Expo example's release build on an Android emulator | Expo SDK 57 with React Native 0.86 |
123
+
124
+ React Native 0.84 and later use Hermes V1 by default. React Native 0.82 and later run only on the New Architecture.
125
+
126
+ On React Native and Expo, the SDK reads random bytes only from the global `crypto.getRandomValues`. Install `react-native-get-random-values` 2.x or `react-native-quick-crypto`, and load it before the first SDK call. Without a global source, the SDK throws `SecureRandomUnavailableError`.
113
127
 
114
128
  The [adapter guide](./ADAPTERS.md) defines every storage, relay, vault, and object-store boundary. The [client composition guide](./docs/CLIENT_COMPOSITION.md) shows an Expo client on the OpenE2EE Signal Protocol Relay.
115
129
 
package/SECURITY.md CHANGED
@@ -7,8 +7,8 @@ backports.
7
7
 
8
8
  | Version | Supported |
9
9
  | ------- | ------------------ |
10
- | 7.1.x | :white_check_mark: |
11
- | < 7.1.0 | :x: |
10
+ | 8.0.x | :white_check_mark: |
11
+ | < 8.0.0 | :x: |
12
12
 
13
13
  ## Reporting a Vulnerability
14
14