@open-e2ee/signal-protocol-sdk 14.1.0 → 14.2.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 (408) hide show
  1. package/ADAPTERS.md +5 -5
  2. package/ARCHITECTURE.md +1 -1
  3. package/CHANGELOG.md +415 -0
  4. package/README.md +19 -14
  5. package/SECURITY.md +2 -2
  6. package/TROUBLESHOOTING.md +1 -1
  7. package/client/README.md +32 -21
  8. package/device/README.md +5 -5
  9. package/dist/client/client.d.ts +44 -34
  10. package/dist/client/client.d.ts.map +1 -1
  11. package/dist/client/client.js +221 -146
  12. package/dist/client/client.js.map +1 -1
  13. package/dist/client/compose.d.ts +7 -5
  14. package/dist/client/compose.d.ts.map +1 -1
  15. package/dist/client/compose.js +7 -2
  16. package/dist/client/compose.js.map +1 -1
  17. package/dist/client/config.d.ts +23 -14
  18. package/dist/client/config.d.ts.map +1 -1
  19. package/dist/client/config.js.map +1 -1
  20. package/dist/client/content-adapter.d.ts +9 -0
  21. package/dist/client/content-adapter.d.ts.map +1 -1
  22. package/dist/client/content-adapter.js +6 -0
  23. package/dist/client/content-adapter.js.map +1 -1
  24. package/dist/client/delivery-status.d.ts +2 -2
  25. package/dist/client/delivery-status.d.ts.map +1 -1
  26. package/dist/client/delivery-status.js +10 -4
  27. package/dist/client/delivery-status.js.map +1 -1
  28. package/dist/client/device-set-reconciliation.d.ts +24 -16
  29. package/dist/client/device-set-reconciliation.d.ts.map +1 -1
  30. package/dist/client/device-set-reconciliation.js +17 -14
  31. package/dist/client/device-set-reconciliation.js.map +1 -1
  32. package/dist/client/event-hooks.d.ts +22 -7
  33. package/dist/client/event-hooks.d.ts.map +1 -1
  34. package/dist/client/event-hooks.js +35 -5
  35. package/dist/client/event-hooks.js.map +1 -1
  36. package/dist/client/group-device-set.d.ts +1 -1
  37. package/dist/client/group-device-set.d.ts.map +1 -1
  38. package/dist/client/group-key-sync.js +1 -1
  39. package/dist/client/group-key-sync.js.map +1 -1
  40. package/dist/client/group-outbox.d.ts +7 -7
  41. package/dist/client/group-outbox.d.ts.map +1 -1
  42. package/dist/client/group-outbox.js +24 -24
  43. package/dist/client/group-outbox.js.map +1 -1
  44. package/dist/client/group-sealed-sender.d.ts +1 -1
  45. package/dist/client/group-sealed-sender.d.ts.map +1 -1
  46. package/dist/client/group-sender-key-operations.js +1 -1
  47. package/dist/client/group-sender-key-operations.js.map +1 -1
  48. package/dist/client/headless.d.ts +6 -6
  49. package/dist/client/headless.d.ts.map +1 -1
  50. package/dist/client/headless.js +7 -7
  51. package/dist/client/headless.js.map +1 -1
  52. package/dist/client/hosted-anonymous-delivery.d.ts +6 -6
  53. package/dist/client/hosted-anonymous-delivery.d.ts.map +1 -1
  54. package/dist/client/hosted-anonymous-delivery.js +17 -17
  55. package/dist/client/hosted-anonymous-delivery.js.map +1 -1
  56. package/dist/client/hosted-assertion-id.d.ts +1 -1
  57. package/dist/client/hosted-assertion-id.d.ts.map +1 -1
  58. package/dist/client/hosted-assertion-id.js +1 -1
  59. package/dist/client/hosted-assertion-id.js.map +1 -1
  60. package/dist/client/hosted-connection.d.ts +5 -5
  61. package/dist/client/hosted-connection.d.ts.map +1 -1
  62. package/dist/client/hosted-connection.js +32 -32
  63. package/dist/client/hosted-connection.js.map +1 -1
  64. package/dist/client/hosted-device-link-transport.d.ts +2 -2
  65. package/dist/client/hosted-device-link-transport.d.ts.map +1 -1
  66. package/dist/client/hosted-device-link-transport.js +1 -1
  67. package/dist/client/hosted-device-link-transport.js.map +1 -1
  68. package/dist/client/hosted-device-link.d.ts +5 -1
  69. package/dist/client/hosted-device-link.d.ts.map +1 -1
  70. package/dist/client/hosted-device-link.js +7 -4
  71. package/dist/client/hosted-device-link.js.map +1 -1
  72. package/dist/client/hosted-device-standing.d.ts +13 -5
  73. package/dist/client/hosted-device-standing.d.ts.map +1 -1
  74. package/dist/client/hosted-device-standing.js +11 -6
  75. package/dist/client/hosted-device-standing.js.map +1 -1
  76. package/dist/client/hosted-group-authority.d.ts +2 -2
  77. package/dist/client/hosted-group-authority.d.ts.map +1 -1
  78. package/dist/client/hosted-group-authority.js +8 -8
  79. package/dist/client/hosted-group-authority.js.map +1 -1
  80. package/dist/client/hosted-groups.d.ts +4 -4
  81. package/dist/client/hosted-groups.d.ts.map +1 -1
  82. package/dist/client/hosted-groups.js +8 -8
  83. package/dist/client/hosted-groups.js.map +1 -1
  84. package/dist/client/hosted-http-error.d.ts +8 -4
  85. package/dist/client/hosted-http-error.d.ts.map +1 -1
  86. package/dist/client/hosted-http-error.js +7 -4
  87. package/dist/client/hosted-http-error.js.map +1 -1
  88. package/dist/client/hosted-mailbox-subscription.d.ts +10 -10
  89. package/dist/client/hosted-mailbox-subscription.d.ts.map +1 -1
  90. package/dist/client/hosted-mailbox-subscription.js +17 -17
  91. package/dist/client/hosted-mailbox-subscription.js.map +1 -1
  92. package/dist/client/hosted-prekey-publication.d.ts +9 -9
  93. package/dist/client/hosted-prekey-publication.d.ts.map +1 -1
  94. package/dist/client/hosted-prekey-publication.js.map +1 -1
  95. package/dist/client/hosted-presence-frames.d.ts +62 -38
  96. package/dist/client/hosted-presence-frames.d.ts.map +1 -1
  97. package/dist/client/hosted-presence-frames.js +4 -2
  98. package/dist/client/hosted-presence-frames.js.map +1 -1
  99. package/dist/client/hosted-presence.d.ts +22 -14
  100. package/dist/client/hosted-presence.d.ts.map +1 -1
  101. package/dist/client/hosted-presence.js +26 -17
  102. package/dist/client/hosted-presence.js.map +1 -1
  103. package/dist/client/hosted-profile-keys.d.ts +3 -1
  104. package/dist/client/hosted-profile-keys.d.ts.map +1 -1
  105. package/dist/client/hosted-profile-keys.js +19 -15
  106. package/dist/client/hosted-profile-keys.js.map +1 -1
  107. package/dist/client/hosted-push.d.ts +38 -16
  108. package/dist/client/hosted-push.d.ts.map +1 -1
  109. package/dist/client/hosted-push.js +11 -5
  110. package/dist/client/hosted-push.js.map +1 -1
  111. package/dist/client/hosted-resume-error.d.ts +21 -9
  112. package/dist/client/hosted-resume-error.d.ts.map +1 -1
  113. package/dist/client/hosted-resume-error.js +4 -1
  114. package/dist/client/hosted-resume-error.js.map +1 -1
  115. package/dist/client/hosted-resume.d.ts +3 -3
  116. package/dist/client/hosted-resume.d.ts.map +1 -1
  117. package/dist/client/hosted-resume.js +12 -12
  118. package/dist/client/hosted-resume.js.map +1 -1
  119. package/dist/client/hosted-sandbox-identity.d.ts +32 -18
  120. package/dist/client/hosted-sandbox-identity.d.ts.map +1 -1
  121. package/dist/client/hosted-sandbox-identity.js +46 -27
  122. package/dist/client/hosted-sandbox-identity.js.map +1 -1
  123. package/dist/client/hosted-store-records.d.ts +46 -0
  124. package/dist/client/hosted-store-records.d.ts.map +1 -0
  125. package/dist/client/hosted-store-records.js +32 -0
  126. package/dist/client/hosted-store-records.js.map +1 -0
  127. package/dist/client/hosted-transport.d.ts +41 -33
  128. package/dist/client/hosted-transport.d.ts.map +1 -1
  129. package/dist/client/hosted-transport.js +146 -101
  130. package/dist/client/hosted-transport.js.map +1 -1
  131. package/dist/client/hosted-trust.d.ts +1 -1
  132. package/dist/client/hosted-trust.d.ts.map +1 -1
  133. package/dist/client/hosted-trust.js +1 -1
  134. package/dist/client/hosted-trust.js.map +1 -1
  135. package/dist/client/hosted.d.ts +140 -74
  136. package/dist/client/hosted.d.ts.map +1 -1
  137. package/dist/client/hosted.js +102 -60
  138. package/dist/client/hosted.js.map +1 -1
  139. package/dist/client/index.d.ts +4 -4
  140. package/dist/client/index.d.ts.map +1 -1
  141. package/dist/client/index.js +4 -4
  142. package/dist/client/index.js.map +1 -1
  143. package/dist/client/key-rotation-core.d.ts +4 -4
  144. package/dist/client/key-rotation-core.d.ts.map +1 -1
  145. package/dist/client/key-rotation-core.js +8 -8
  146. package/dist/client/key-rotation-core.js.map +1 -1
  147. package/dist/client/key-rotation.js +2 -2
  148. package/dist/client/key-rotation.js.map +1 -1
  149. package/dist/client/messages.d.ts +3 -3
  150. package/dist/client/messages.d.ts.map +1 -1
  151. package/dist/client/messages.js +18 -18
  152. package/dist/client/messages.js.map +1 -1
  153. package/dist/client/one-time-prekey-refill.d.ts +1 -1
  154. package/dist/client/one-time-prekey-refill.d.ts.map +1 -1
  155. package/dist/client/prekeys.js +17 -17
  156. package/dist/client/prekeys.js.map +1 -1
  157. package/dist/client/receive-queue.d.ts +4 -4
  158. package/dist/client/receive-queue.d.ts.map +1 -1
  159. package/dist/client/receive-queue.js +29 -29
  160. package/dist/client/receive-queue.js.map +1 -1
  161. package/dist/client/receive-work-seed.d.ts +6 -2
  162. package/dist/client/receive-work-seed.d.ts.map +1 -1
  163. package/dist/client/receive-work-seed.js.map +1 -1
  164. package/dist/client/recovery-driver.js +7 -7
  165. package/dist/client/recovery-driver.js.map +1 -1
  166. package/dist/client/retry-request-envelope.d.ts +3 -3
  167. package/dist/client/retry-request-envelope.d.ts.map +1 -1
  168. package/dist/client/retry-request-envelope.js +10 -10
  169. package/dist/client/retry-request-envelope.js.map +1 -1
  170. package/dist/client/retry-request-lifecycle.d.ts +1 -1
  171. package/dist/client/retry-request-lifecycle.d.ts.map +1 -1
  172. package/dist/client/retry-request-lifecycle.js +8 -8
  173. package/dist/client/retry-request-lifecycle.js.map +1 -1
  174. package/dist/client/retry-terminal-recovery.js +2 -2
  175. package/dist/client/retry-terminal-recovery.js.map +1 -1
  176. package/dist/client/retry.js +13 -13
  177. package/dist/client/retry.js.map +1 -1
  178. package/dist/client/sealed-sender.d.ts +13 -4
  179. package/dist/client/sealed-sender.d.ts.map +1 -1
  180. package/dist/client/sealed-sender.js +27 -15
  181. package/dist/client/sealed-sender.js.map +1 -1
  182. package/dist/client/send-deadline.d.ts +7 -7
  183. package/dist/client/send-deadline.d.ts.map +1 -1
  184. package/dist/client/send-deadline.js +37 -24
  185. package/dist/client/send-deadline.js.map +1 -1
  186. package/dist/client/send-intent-driver.js +9 -9
  187. package/dist/client/send-intent-driver.js.map +1 -1
  188. package/dist/client/sessions.js +11 -11
  189. package/dist/client/sessions.js.map +1 -1
  190. package/dist/client/{relay-acceptance.d.ts → signal-relay-acceptance.d.ts} +9 -9
  191. package/dist/client/signal-relay-acceptance.d.ts.map +1 -0
  192. package/dist/client/{relay-acceptance.js → signal-relay-acceptance.js} +7 -7
  193. package/dist/client/signal-relay-acceptance.js.map +1 -0
  194. package/dist/client/{relay-device-refusal.d.ts → signal-relay-device-refusal.d.ts} +7 -7
  195. package/dist/client/signal-relay-device-refusal.d.ts.map +1 -0
  196. package/dist/client/{relay-device-refusal.js → signal-relay-device-refusal.js} +9 -9
  197. package/dist/client/signal-relay-device-refusal.js.map +1 -0
  198. package/dist/client/{relay-lifecycle.d.ts → signal-relay-lifecycle.d.ts} +21 -11
  199. package/dist/client/signal-relay-lifecycle.d.ts.map +1 -0
  200. package/dist/client/{relay-lifecycle.js → signal-relay-lifecycle.js} +19 -9
  201. package/dist/client/signal-relay-lifecycle.js.map +1 -0
  202. package/dist/client/{relay-period-close.d.ts → signal-relay-period-close.d.ts} +1 -1
  203. package/dist/client/signal-relay-period-close.d.ts.map +1 -0
  204. package/dist/client/{relay-period-close.js → signal-relay-period-close.js} +1 -1
  205. package/dist/client/signal-relay-period-close.js.map +1 -0
  206. package/dist/client/{relay-protocol.d.ts → signal-relay-protocol.d.ts} +12 -8
  207. package/dist/client/signal-relay-protocol.d.ts.map +1 -0
  208. package/dist/client/{relay-protocol.js → signal-relay-protocol.js} +13 -10
  209. package/dist/client/signal-relay-protocol.js.map +1 -0
  210. package/dist/client/{relay-receipt-intake.d.ts → signal-relay-receipt-intake.d.ts} +12 -12
  211. package/dist/client/signal-relay-receipt-intake.d.ts.map +1 -0
  212. package/dist/client/{relay-receipt-intake.js → signal-relay-receipt-intake.js} +9 -9
  213. package/dist/client/signal-relay-receipt-intake.js.map +1 -0
  214. package/dist/client/{relay-receipt-join.d.ts → signal-relay-receipt-join.d.ts} +8 -8
  215. package/dist/client/signal-relay-receipt-join.d.ts.map +1 -0
  216. package/dist/client/{relay-receipt-join.js → signal-relay-receipt-join.js} +11 -11
  217. package/dist/client/signal-relay-receipt-join.js.map +1 -0
  218. package/dist/client/{relay-request-deadline.d.ts → signal-relay-request-deadline.d.ts} +3 -3
  219. package/dist/client/signal-relay-request-deadline.d.ts.map +1 -0
  220. package/dist/client/{relay-request-deadline.js → signal-relay-request-deadline.js} +4 -4
  221. package/dist/client/signal-relay-request-deadline.js.map +1 -0
  222. package/dist/client/{relay-sealed-route.d.ts → signal-relay-sealed-route.d.ts} +1 -1
  223. package/dist/client/signal-relay-sealed-route.d.ts.map +1 -0
  224. package/dist/client/{relay-sealed-route.js → signal-relay-sealed-route.js} +1 -1
  225. package/dist/client/signal-relay-sealed-route.js.map +1 -0
  226. package/dist/client/{relay-subscription.d.ts → signal-relay-subscription.d.ts} +12 -12
  227. package/dist/client/signal-relay-subscription.d.ts.map +1 -0
  228. package/dist/client/{relay-subscription.js → signal-relay-subscription.js} +23 -23
  229. package/dist/client/signal-relay-subscription.js.map +1 -0
  230. package/dist/client/{relay-work.d.ts → signal-relay-work.d.ts} +7 -7
  231. package/dist/client/signal-relay-work.d.ts.map +1 -0
  232. package/dist/client/{relay-work.js → signal-relay-work.js} +13 -13
  233. package/dist/client/signal-relay-work.js.map +1 -0
  234. package/dist/client/signal-service-cipher.d.ts +11 -9
  235. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  236. package/dist/client/signal-service-cipher.js +103 -98
  237. package/dist/client/signal-service-cipher.js.map +1 -1
  238. package/dist/client/state.d.ts +4 -4
  239. package/dist/client/state.d.ts.map +1 -1
  240. package/dist/client/state.js +3 -3
  241. package/dist/client/state.js.map +1 -1
  242. package/dist/client/types.d.ts +13 -4
  243. package/dist/client/types.d.ts.map +1 -1
  244. package/dist/client/types.js.map +1 -1
  245. package/dist/device/connection.d.ts +10 -4
  246. package/dist/device/connection.d.ts.map +1 -1
  247. package/dist/device/connection.js +8 -3
  248. package/dist/device/connection.js.map +1 -1
  249. package/dist/device/index.d.ts +2 -2
  250. package/dist/device/index.d.ts.map +1 -1
  251. package/dist/device/index.js +1 -1
  252. package/dist/device/index.js.map +1 -1
  253. package/dist/device/types.d.ts +3 -1
  254. package/dist/device/types.d.ts.map +1 -1
  255. package/dist/hooks/index.d.ts +2 -2
  256. package/dist/hooks/index.d.ts.map +1 -1
  257. package/dist/hooks/index.js +2 -2
  258. package/dist/hooks/index.js.map +1 -1
  259. package/dist/hooks/use-signal-relay-connection-state.d.ts +40 -0
  260. package/dist/hooks/use-signal-relay-connection-state.d.ts.map +1 -0
  261. package/dist/hooks/use-signal-relay-connection-state.js +45 -0
  262. package/dist/hooks/use-signal-relay-connection-state.js.map +1 -0
  263. package/dist/hooks/use-signal-relay-lifecycle.d.ts +43 -0
  264. package/dist/hooks/use-signal-relay-lifecycle.d.ts.map +1 -0
  265. package/dist/hooks/use-signal-relay-lifecycle.js +38 -0
  266. package/dist/hooks/use-signal-relay-lifecycle.js.map +1 -0
  267. package/dist/index.d.ts +18 -12
  268. package/dist/index.d.ts.map +1 -1
  269. package/dist/index.js +5 -5
  270. package/dist/index.js.map +1 -1
  271. package/dist/internal/groups/authority-certificate.d.ts +7 -1
  272. package/dist/internal/groups/authority-certificate.d.ts.map +1 -1
  273. package/dist/internal/groups/authority-certificate.js +29 -6
  274. package/dist/internal/groups/authority-certificate.js.map +1 -1
  275. package/dist/internal/protocol/sealed-sender/certificate.js +2 -2
  276. package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -1
  277. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +1 -1
  278. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  279. package/dist/internal/protocol/sealed-sender/proto/index.js +5 -5
  280. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  281. package/dist/internal/sesame/device-registry.d.ts +13 -13
  282. package/dist/internal/sesame/device-registry.d.ts.map +1 -1
  283. package/dist/internal/sesame/device-registry.js +20 -20
  284. package/dist/internal/sesame/device-registry.js.map +1 -1
  285. package/dist/local/store/receive-work.d.ts +29 -0
  286. package/dist/local/store/receive-work.d.ts.map +1 -1
  287. package/dist/local/store/receive-work.js +58 -1
  288. package/dist/local/store/receive-work.js.map +1 -1
  289. package/dist/local/store/received-content.d.ts +1 -1
  290. package/dist/local/store/received-content.d.ts.map +1 -1
  291. package/dist/local/store/reliability.d.ts +11 -3
  292. package/dist/local/store/reliability.d.ts.map +1 -1
  293. package/dist/local/store/reliability.js +4 -0
  294. package/dist/local/store/reliability.js.map +1 -1
  295. package/dist/local/store/sqlite/key-storage/index.d.ts +3 -9
  296. package/dist/local/store/sqlite/key-storage/index.d.ts.map +1 -1
  297. package/dist/local/store/sqlite/key-storage/index.js.map +1 -1
  298. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts +1 -7
  299. package/dist/local/store/sqlite/key-storage/signed-prekeys.d.ts.map +1 -1
  300. package/dist/local/store/sqlite/key-storage/signed-prekeys.js.map +1 -1
  301. package/dist/local/store/sqlite/models/kyber-prekey.d.ts +4 -9
  302. package/dist/local/store/sqlite/models/kyber-prekey.d.ts.map +1 -1
  303. package/dist/local/store/sqlite/models/kyber-prekey.js +4 -1
  304. package/dist/local/store/sqlite/models/kyber-prekey.js.map +1 -1
  305. package/dist/local/store/sqlite/store.d.ts.map +1 -1
  306. package/dist/local/store/sqlite/store.js +1 -2
  307. package/dist/local/store/sqlite/store.js.map +1 -1
  308. package/dist/remote/signal-relay/connection-state.d.ts +16 -0
  309. package/dist/remote/signal-relay/connection-state.d.ts.map +1 -0
  310. package/dist/remote/{relay → signal-relay}/connection-state.js +1 -1
  311. package/dist/remote/signal-relay/connection-state.js.map +1 -0
  312. package/dist/remote/{relay → signal-relay}/device-set.d.ts +3 -3
  313. package/dist/remote/signal-relay/device-set.d.ts.map +1 -0
  314. package/dist/remote/{relay → signal-relay}/device-set.js +7 -7
  315. package/dist/remote/signal-relay/device-set.js.map +1 -0
  316. package/dist/remote/{relay → signal-relay}/index.d.ts +3 -3
  317. package/dist/remote/signal-relay/index.d.ts.map +1 -0
  318. package/dist/remote/{relay → signal-relay}/index.js +2 -2
  319. package/dist/remote/signal-relay/index.js.map +1 -0
  320. package/dist/remote/{relay → signal-relay}/request-admission.d.ts +2 -2
  321. package/dist/remote/signal-relay/request-admission.d.ts.map +1 -0
  322. package/dist/remote/{relay → signal-relay}/request-admission.js +5 -5
  323. package/dist/remote/signal-relay/request-admission.js.map +1 -0
  324. package/dist/remote/{relay → signal-relay}/types.d.ts +29 -11
  325. package/dist/remote/signal-relay/types.d.ts.map +1 -0
  326. package/dist/remote/{relay → signal-relay}/types.js +1 -1
  327. package/dist/remote/signal-relay/types.js.map +1 -0
  328. package/dist/safety/core.d.ts +1 -1
  329. package/dist/safety/core.js +1 -1
  330. package/dist/types/api.d.ts +43 -20
  331. package/dist/types/api.d.ts.map +1 -1
  332. package/dist/types/errors.d.ts +55 -7
  333. package/dist/types/errors.d.ts.map +1 -1
  334. package/dist/types/errors.js +61 -8
  335. package/dist/types/errors.js.map +1 -1
  336. package/dist/types/renamed-member.d.ts +41 -0
  337. package/dist/types/renamed-member.d.ts.map +1 -0
  338. package/dist/types/renamed-member.js +73 -0
  339. package/dist/types/renamed-member.js.map +1 -0
  340. package/dist/utils/bounded-fan-out.d.ts +2 -2
  341. package/dist/utils/bounded-fan-out.d.ts.map +1 -1
  342. package/dist/utils/bounded-fan-out.js +2 -2
  343. package/dist/utils/bounded-fan-out.js.map +1 -1
  344. package/dist/utils/retry.d.ts +3 -3
  345. package/dist/utils/retry.d.ts.map +1 -1
  346. package/dist/utils/retry.js +4 -3
  347. package/dist/utils/retry.js.map +1 -1
  348. package/docs/ASSURANCE.md +5 -5
  349. package/docs/CLIENT_COMPOSITION.md +10 -8
  350. package/docs/DEVIATIONS.md +10 -7
  351. package/docs/ERROR_HANDLING.md +24 -24
  352. package/docs/GETTING_STARTED.md +22 -16
  353. package/docs/INTERFACES.md +5 -5
  354. package/docs/PACKAGE_SURFACE.md +14 -4
  355. package/docs/PROTOCOL_POLICY.md +4 -4
  356. package/docs/RECIPES.md +274 -15
  357. package/hooks/README.md +11 -11
  358. package/local/store/expo/README.md +1 -1
  359. package/local/store/key-value/README.md +2 -2
  360. package/local/store/node/README.md +1 -1
  361. package/local/store/react-native/README.md +1 -1
  362. package/local/store/web/README.md +1 -1
  363. package/local/store/web-sqlite/README.md +2 -2
  364. package/package.json +16 -6
  365. package/remote/README.md +4 -4
  366. package/remote/object-store/convex-r2/README.md +1 -1
  367. package/remote/{relay → signal-relay}/README.md +14 -6
  368. package/dist/client/relay-acceptance.d.ts.map +0 -1
  369. package/dist/client/relay-acceptance.js.map +0 -1
  370. package/dist/client/relay-device-refusal.d.ts.map +0 -1
  371. package/dist/client/relay-device-refusal.js.map +0 -1
  372. package/dist/client/relay-lifecycle.d.ts.map +0 -1
  373. package/dist/client/relay-lifecycle.js.map +0 -1
  374. package/dist/client/relay-period-close.d.ts.map +0 -1
  375. package/dist/client/relay-period-close.js.map +0 -1
  376. package/dist/client/relay-protocol.d.ts.map +0 -1
  377. package/dist/client/relay-protocol.js.map +0 -1
  378. package/dist/client/relay-receipt-intake.d.ts.map +0 -1
  379. package/dist/client/relay-receipt-intake.js.map +0 -1
  380. package/dist/client/relay-receipt-join.d.ts.map +0 -1
  381. package/dist/client/relay-receipt-join.js.map +0 -1
  382. package/dist/client/relay-request-deadline.d.ts.map +0 -1
  383. package/dist/client/relay-request-deadline.js.map +0 -1
  384. package/dist/client/relay-sealed-route.d.ts.map +0 -1
  385. package/dist/client/relay-sealed-route.js.map +0 -1
  386. package/dist/client/relay-subscription.d.ts.map +0 -1
  387. package/dist/client/relay-subscription.js.map +0 -1
  388. package/dist/client/relay-work.d.ts.map +0 -1
  389. package/dist/client/relay-work.js.map +0 -1
  390. package/dist/hooks/use-relay-connection-state.d.ts +0 -32
  391. package/dist/hooks/use-relay-connection-state.d.ts.map +0 -1
  392. package/dist/hooks/use-relay-connection-state.js +0 -31
  393. package/dist/hooks/use-relay-connection-state.js.map +0 -1
  394. package/dist/hooks/use-relay-lifecycle.d.ts +0 -36
  395. package/dist/hooks/use-relay-lifecycle.d.ts.map +0 -1
  396. package/dist/hooks/use-relay-lifecycle.js +0 -35
  397. package/dist/hooks/use-relay-lifecycle.js.map +0 -1
  398. package/dist/remote/relay/connection-state.d.ts +0 -16
  399. package/dist/remote/relay/connection-state.d.ts.map +0 -1
  400. package/dist/remote/relay/connection-state.js.map +0 -1
  401. package/dist/remote/relay/device-set.d.ts.map +0 -1
  402. package/dist/remote/relay/device-set.js.map +0 -1
  403. package/dist/remote/relay/index.d.ts.map +0 -1
  404. package/dist/remote/relay/index.js.map +0 -1
  405. package/dist/remote/relay/request-admission.d.ts.map +0 -1
  406. package/dist/remote/relay/request-admission.js.map +0 -1
  407. package/dist/remote/relay/types.d.ts.map +0 -1
  408. package/dist/remote/relay/types.js.map +0 -1
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Reads of a member that has a Signal Protocol Relay name and a deprecated
3
+ * earlier name.
4
+ *
5
+ * SDK 14 accepts the earlier name of each such option and member. An option
6
+ * read takes the new name first and the earlier name second. A member read
7
+ * takes the name that the nearest level of the object defines, so a subclass
8
+ * override of either name wins. SDK 15.0.0 removes the earlier names and this
9
+ * module.
10
+ *
11
+ * The module is not in a package entry point.
12
+ */
13
+ /** The two names of one member, and the operation that reads it. */
14
+ export interface RenamedMember {
15
+ readonly newName: string;
16
+ readonly earlierName: string;
17
+ readonly operation: string;
18
+ }
19
+ /**
20
+ * Returns the value of an option that the caller sets by either name.
21
+ *
22
+ * The new name wins. Two values with the same identity, or two byte arrays
23
+ * with the same bytes, are the same value. Undefined means not set.
24
+ *
25
+ * @throws SignalProtocolRelayNameConflictError when both names hold values
26
+ * that are not the same.
27
+ */
28
+ export declare function readRenamedOption<T>(newValue: T | undefined, earlierValue: T | undefined, member: RenamedMember): T | undefined;
29
+ /**
30
+ * Returns the member of an object that the caller implements under either
31
+ * name, such as a `SignalProtocolRelayServer`.
32
+ *
33
+ * The name that the nearest level of the object defines wins, and the new
34
+ * name wins when one level defines both. An SDK class defines both names, so
35
+ * a subclass that overrides only one name gives its override. When the
36
+ * chosen name holds no value, the read takes the other name. A method comes
37
+ * back bound to its object. The read does not compare the two members,
38
+ * because an SDK class keeps one name as a forward to the other.
39
+ */
40
+ export declare function readRenamedImplementation<T extends object, K extends keyof T, E extends keyof T>(source: T, newName: K, earlierName: E): NonNullable<T[K]> | NonNullable<T[E]> | undefined;
41
+ //# sourceMappingURL=renamed-member.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renamed-member.d.ts","sourceRoot":"","sources":["../../types/renamed-member.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,oEAAoE;AACpE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAUD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,QAAQ,EAAE,CAAC,GAAG,SAAS,EACvB,YAAY,EAAE,CAAC,GAAG,SAAS,EAC3B,MAAM,EAAE,aAAa,GACpB,CAAC,GAAG,SAAS,CASf;AAuBD;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAC9F,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,CAAC,EACV,WAAW,EAAE,CAAC,GACb,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CASnD"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Reads of a member that has a Signal Protocol Relay name and a deprecated
3
+ * earlier name.
4
+ *
5
+ * SDK 14 accepts the earlier name of each such option and member. An option
6
+ * read takes the new name first and the earlier name second. A member read
7
+ * takes the name that the nearest level of the object defines, so a subclass
8
+ * override of either name wins. SDK 15.0.0 removes the earlier names and this
9
+ * module.
10
+ *
11
+ * The module is not in a package entry point.
12
+ */
13
+ import { SignalProtocolRelayNameConflictError } from './errors.js';
14
+ function sameValue(a, b) {
15
+ if (Object.is(a, b))
16
+ return true;
17
+ if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array) || a.length !== b.length) {
18
+ return false;
19
+ }
20
+ return a.every((byte, index) => byte === b[index]);
21
+ }
22
+ /**
23
+ * Returns the value of an option that the caller sets by either name.
24
+ *
25
+ * The new name wins. Two values with the same identity, or two byte arrays
26
+ * with the same bytes, are the same value. Undefined means not set.
27
+ *
28
+ * @throws SignalProtocolRelayNameConflictError when both names hold values
29
+ * that are not the same.
30
+ */
31
+ export function readRenamedOption(newValue, earlierValue, member) {
32
+ if (newValue !== undefined && earlierValue !== undefined && !sameValue(newValue, earlierValue)) {
33
+ throw new SignalProtocolRelayNameConflictError(member.newName, member.earlierName, member.operation);
34
+ }
35
+ return newValue !== undefined ? newValue : earlierValue;
36
+ }
37
+ /**
38
+ * Returns the name that the nearest level of an object defines, where a
39
+ * level is the object itself or one of its prototypes. The new name wins
40
+ * when one level defines both names.
41
+ */
42
+ function nearestRenamedName(source, newName, earlierName) {
43
+ for (let level = source; level !== null && level !== Object.prototype; level = Object.getPrototypeOf(level)) {
44
+ if (Object.prototype.hasOwnProperty.call(level, newName))
45
+ return newName;
46
+ if (Object.prototype.hasOwnProperty.call(level, earlierName))
47
+ return earlierName;
48
+ }
49
+ return newName;
50
+ }
51
+ /**
52
+ * Returns the member of an object that the caller implements under either
53
+ * name, such as a `SignalProtocolRelayServer`.
54
+ *
55
+ * The name that the nearest level of the object defines wins, and the new
56
+ * name wins when one level defines both. An SDK class defines both names, so
57
+ * a subclass that overrides only one name gives its override. When the
58
+ * chosen name holds no value, the read takes the other name. A method comes
59
+ * back bound to its object. The read does not compare the two members,
60
+ * because an SDK class keeps one name as a forward to the other.
61
+ */
62
+ export function readRenamedImplementation(source, newName, earlierName) {
63
+ const first = nearestRenamedName(source, newName, earlierName);
64
+ const second = first === newName ? earlierName : newName;
65
+ const member = source[first] ?? source[second];
66
+ if (member === undefined || member === null)
67
+ return undefined;
68
+ if (typeof member === 'function') {
69
+ return member.bind(source);
70
+ }
71
+ return member;
72
+ }
73
+ //# sourceMappingURL=renamed-member.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renamed-member.js","sourceRoot":"","sources":["../../types/renamed-member.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oCAAoC,EAAE,MAAM,UAAU,CAAC;AAShE,SAAS,SAAS,CAAC,CAAU,EAAE,CAAU;IACvC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,CAAC,CAAC,CAAC,YAAY,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QACtF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,QAAuB,EACvB,YAA2B,EAC3B,MAAqB;IAErB,IAAI,QAAQ,KAAK,SAAS,IAAI,YAAY,KAAK,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC;QAC/F,MAAM,IAAI,oCAAoC,CAC5C,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,SAAS,CACjB,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CACzB,MAAS,EACT,OAAgB,EAChB,WAAoB;IAEpB,KACE,IAAI,KAAK,GAAkB,MAAM,EACjC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS,EAC5C,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAkB,EACrD,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC;YAAE,OAAO,OAAO,CAAC;QACzE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,CAAC;YAAE,OAAO,WAAW,CAAC;IACnF,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAS,EACT,OAAU,EACV,WAAc;IAEd,MAAM,KAAK,GAAG,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;IACzD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/C,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAC9D,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;QACjC,OAAQ,MAA0C,CAAC,IAAI,CAAC,MAAM,CAA0C,CAAC;IAC3G,CAAC;IACD,OAAO,MAA+C,CAAC;AACzD,CAAC"}
@@ -21,10 +21,10 @@
21
21
  * `stopped` option.
22
22
  */
23
23
  /** Relay requests that one client has in flight at most. */
24
- export declare const RELAY_REQUESTS_IN_FLIGHT = 4;
24
+ export declare const SIGNAL_RELAY_REQUESTS_IN_FLIGHT = 4;
25
25
  /** The options of a BoundedFanOut. */
26
26
  export interface BoundedFanOutOptions {
27
- /** Relay requests in flight at most. Default: RELAY_REQUESTS_IN_FLIGHT */
27
+ /** Relay requests in flight at most. Default: SIGNAL_RELAY_REQUESTS_IN_FLIGHT */
28
28
  limit?: number;
29
29
  /** The error for work that a stop signal ended. */
30
30
  stopped: () => Error;
@@ -1 +1 @@
1
- {"version":3,"file":"bounded-fan-out.d.ts","sourceRoot":"","sources":["../../utils/bounded-fan-out.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,sCAAsC;AACtC,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,KAAK,CAAC;CACtB;AAED,4CAA4C;AAC5C,MAAM,MAAM,aAAa,CAAC,CAAC,IACvB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACxC;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpD;;GAEG;AACH,qBAAa,WAAW,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,KAAK;IACjD,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;IAEpC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAE/C,YAAY,QAAQ,EAAE,SAAS,aAAa,CAAC,CAAC,CAAC,EAAE,EAQhD;CACF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,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E;IAC9D,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAiBhD;CACF"}
@@ -21,7 +21,7 @@
21
21
  * `stopped` option.
22
22
  */
23
23
  /** Relay requests that one client has in flight at most. */
24
- export const RELAY_REQUESTS_IN_FLIGHT = 4;
24
+ export const SIGNAL_RELAY_REQUESTS_IN_FLIGHT = 4;
25
25
  /**
26
26
  * One or more items of a fan-out failed. Every item settled before this error.
27
27
  */
@@ -57,7 +57,7 @@ export class BoundedFanOut {
57
57
  inFlight = 0;
58
58
  waiting = [];
59
59
  constructor(options) {
60
- const limit = options.limit ?? RELAY_REQUESTS_IN_FLIGHT;
60
+ const limit = options.limit ?? SIGNAL_RELAY_REQUESTS_IN_FLIGHT;
61
61
  if (!Number.isInteger(limit) || limit < 1) {
62
62
  throw new RangeError(`The fan-out limit must be a positive integer, not ${limit}`);
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bounded-fan-out.js","sourceRoot":"","sources":["../../utils/bounded-fan-out.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAe1C;;GAEG;AACH,MAAM,OAAO,WAAyB,SAAQ,KAAK;IACjD,qDAAqD;IAC5C,MAAM,CAAqB;IAEpC,gDAAgD;IACvC,QAAQ,CAA8B;IAE/C,YAAY,QAAqC;QAC/C,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClF,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,C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ACd,CAAC;IACH,CAAC;CACF"}
@@ -33,9 +33,9 @@ export interface SignalProtocolRetryConfig {
33
33
  * Non-retryable:
34
34
  * - The eight codes in NON_RETRYABLE_ERROR_CODES (invalid prekey bundle,
35
35
  * untrusted identity, and the rest)
36
- * - The Relay code UPGRADE_REQUIRED (HostedRelayUpgradeRequiredError)
37
- * - The Relay code DEVICE_REVOKED (HostedRelayDeviceRevokedError)
38
- * - An unknown device (HostedRelayDeviceUnknownError)
36
+ * - The Relay code UPGRADE_REQUIRED (HostedSignalProtocolRelayUpgradeRequiredError)
37
+ * - The Relay code DEVICE_REVOKED (HostedSignalProtocolRelayDeviceRevokedError)
38
+ * - An unknown device (HostedSignalProtocolRelayDeviceUnknownError)
39
39
  *
40
40
  * Retryable:
41
41
  * - Network/timeout errors
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../utils/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;GAIG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,yBAAyB;IACxC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uFAAuF;IACvF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CACzC;AAsFD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAqCtD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,MAAM,GAAE,yBAA8B,GACrC,OAAO,CAAC,CAAC,CAAC,CAyCZ"}
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../utils/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;GAIG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,yBAAyB;IACxC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uFAAuF;IACvF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CACzC;AAsFD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAsCtD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,MAAM,GAAE,yBAA8B,GACrC,OAAO,CAAC,CAAC,CAAC,CAyCZ"}
@@ -85,9 +85,9 @@ function isRaceConditionError(error) {
85
85
  * Non-retryable:
86
86
  * - The eight codes in NON_RETRYABLE_ERROR_CODES (invalid prekey bundle,
87
87
  * untrusted identity, and the rest)
88
- * - The Relay code UPGRADE_REQUIRED (HostedRelayUpgradeRequiredError)
89
- * - The Relay code DEVICE_REVOKED (HostedRelayDeviceRevokedError)
90
- * - An unknown device (HostedRelayDeviceUnknownError)
88
+ * - The Relay code UPGRADE_REQUIRED (HostedSignalProtocolRelayUpgradeRequiredError)
89
+ * - The Relay code DEVICE_REVOKED (HostedSignalProtocolRelayDeviceRevokedError)
90
+ * - An unknown device (HostedSignalProtocolRelayDeviceUnknownError)
91
91
  *
92
92
  * Retryable:
93
93
  * - Network/timeout errors
@@ -108,6 +108,7 @@ export function isRetryableError(error) {
108
108
  }
109
109
  // The Relay refuses this device for good. The error name identifies an
110
110
  // unknown device, because its code NOT_FOUND also names other failures.
111
+ // The error keeps its earlier name until SDK 15.0.0.
111
112
  if (code === 'DEVICE_REVOKED' || error.name === 'HostedRelayDeviceUnknownError') {
112
113
  return false;
113
114
  }
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../utils/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAuB/C,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,KAAK;IACf,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,IAAI;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACxC,mBAAmB,CAAC,qBAAqB;IACzC,mBAAmB,CAAC,iBAAiB;IACrC,mBAAmB,CAAC,yBAAyB;IAC7C,mBAAmB,CAAC,iBAAiB;IAErC,mBAAmB,CAAC,kBAAkB;IACtC,mBAAmB,CAAC,6BAA6B;IACjD,mBAAmB,CAAC,wBAAwB;IAC5C,mBAAmB,CAAC,yBAAyB;CAC9C,CAAC,CAAC;AAEH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,qBAAqB,CAC5B,OAAe,EACf,SAAiB,EACjB,QAAgB,EAChB,iBAAyB,EACzB,YAAqB;IAErB,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,iBA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,CAAC,EAAE,OAAO,GAAG,aAAa,EAAE,OAAO,EAAE,EAAE,CAAC;QACzD,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,eAAe,GACnB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,aAAa,YAAY,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC1F,SAAS,GAAG,eAAe,CAAC;YAE5B,IACE,OAAO,KAAK,aAAa,GAAG,CAAC;gBAC7B,CAAC,gBAAgB,CAAC,eAAe,CAAC;gBAClC,CAAC,WAAW,CAAC,eAAe,CAAC,EAC7B,CAAC;gBACD,MAAM;YACR,CAAC;YAED,MAAM,KAAK,GAAG,qBAAqB,CACjC,OAAO,EACP,SAAS,EACT,QAAQ,EACR,mBAAmB,CAAC,iBAAiB,EACrC,YAAY,CACb,CAAC;YACF,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,GAAG,aAAa,gCAAgC,CAAC,CAAC;AACjF,CAAC"}
package/docs/ASSURANCE.md CHANGED
@@ -16,16 +16,16 @@ Private testing also exists in other open-source projects. [SQLite publishes som
16
16
 
17
17
  Engineering CI runs the default automated checks on pull requests that are ready for review and on changes to the main branch. Release preparation requires a passing run.
18
18
 
19
- Most recent full run on 2026-11-05:
19
+ Most recent full run on 2026-11-08:
20
20
 
21
21
  | | |
22
22
  |---|---|
23
- | Test modules | 607 |
24
- | Test cases | 12,725 |
25
- | Passed | 12,721 |
23
+ | Test modules | 613 |
24
+ | Test cases | 12,905 |
25
+ | Passed | 12,901 |
26
26
  | Skipped | 4 |
27
27
  | Failed | 0 |
28
- | Wall time | 1513 s |
28
+ | Wall time | 479 s |
29
29
 
30
30
  The total counts test cases. One test case can contain several assertions. Separate commands run the longer performance and endurance checks.
31
31
 
@@ -34,10 +34,12 @@ const signal = await createSignalProtocolClient({
34
34
  the environment connection URL to your application configuration.
35
35
  `getIdentityAssertion` returns a short-lived signed assertion. The hosted
36
36
  factory uses it for device registration and authentication. In a Sandbox
37
- environment, `hostedRelaySandboxIdentity(storage)` supplies it. In a production
38
- project in device-owned mode, `hostedRelayDeviceOwnedIdentity(storage)`
37
+ environment, `hostedSignalProtocolRelaySandboxIdentity(storage)` supplies it. In a production
38
+ project in device-owned mode, `hostedSignalProtocolRelayDeviceOwnedIdentity(storage)`
39
39
  supplies it. In a production project in application-bound mode, it returns an
40
- assertion for the signed-in user from your backend.
40
+ assertion for the signed-in user from your backend. With a
41
+ [native Clerk or Firebase profile](./RECIPES.md#native-provider-profiles), it
42
+ returns the provider token instead.
41
43
 
42
44
  <!-- doc-snippet:skip requires-external-context -->
43
45
  ```ts
@@ -51,7 +53,7 @@ const signal = await createHostedSignalProtocolClient({
51
53
  },
52
54
  hosted: {
53
55
  // The environment-scoped connection URL from the OpenE2EE console.
54
- relayUrl: process.env.EXPO_PUBLIC_OPEN_E2EE_RELAY_URL!,
56
+ signalProtocolRelayUrl: process.env.EXPO_PUBLIC_OPEN_E2EE_SIGNAL_RELAY_URL ?? process.env.EXPO_PUBLIC_OPEN_E2EE_RELAY_URL!,
55
57
  // Returns a short-lived signed assertion for the signed-in user.
56
58
  getIdentityAssertion,
57
59
  },
@@ -70,7 +72,7 @@ const signal = await createSignalProtocolClient({
70
72
  identity: { userId },
71
73
  adapters: {
72
74
  storage,
73
- relay,
75
+ signalProtocolRelay,
74
76
  // Brokered remote storage of encrypted byte objects.
75
77
  remoteObjectStore: convexR2ObjectStore({
76
78
  convex,
@@ -112,9 +114,9 @@ developer-facing protocol config:
112
114
  import { DefaultSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
113
115
 
114
116
  const signal = await DefaultSignalProtocolClient.create(userId, {
115
- // Low-level creation uses the same storage/relay/protocol concepts.
117
+ // Low-level creation uses the same storage, Relay, and protocol concepts.
116
118
  storage,
117
- relay,
119
+ signalProtocolRelay,
118
120
  protocol: { postQuantum: "required", braid: "required" },
119
121
  });
120
122
  ```
@@ -147,7 +149,7 @@ store-by-store wiring exercise:
147
149
  `createExpoDeviceStorage({ database, files })`
148
150
  - a message-first receive path shaped like
149
151
  `signal.messages.subscribe({ conversationId }, handler)` in place of hook
150
- registration plus manual `startRelaySubscription()`
152
+ registration plus manual `startSignalProtocolRelaySubscription()`
151
153
 
152
154
  Low-level hooks would remain for advanced integrations. When this lands it will
153
155
  be a breaking change and this guide will lead with it. Until then, wire the
@@ -98,7 +98,7 @@ model and what is out of scope.
98
98
  | **Delivery receipt lifespan** | Signal's Android client | **Faithful.** A stored receipt is sent only within 1 day after it becomes owed, as Android's receipt job lives for 1 day. The receipt is durable across a restart, as on Android | — | A receipt that cannot go out within 1 day is not sent, and no hook reports it (§8.3) |
99
99
  | **Receive admission bounds** | Signal's Desktop client | **Extension.** Before a decrypt, the receive queue checks `maxItems`, `maxBytes`, and the group share `blockedGroupShare`. The defaults are provisional. Desktop decrypts each envelope as it arrives and bounds stored content only by age and attempts | The SDK shares a storage budget with the application in a browser and on mobile | A refused envelope is not acknowledged. It stays at the Relay and expires there with no local hook. The messages behind it still arrive (§8.5) |
100
100
  | **Legacy received content** | Signal's job migration of a retired format | **Faithful** for unreadable rows: the open deletes them and logs a count. **Deviation** for readable rows: the open deletes each readable SDK 11 row too, and counts it in a separate field. Signal converts each readable pending item to the new format | A founder ruling deletes the readable rows. The constraint is Relay retention: the Relay keeps an undelivered envelope for at most 30 days in production, and a readable row is in a store that SDK 12.0.0 or later never opened | Where the constraint holds, the content of such a row never reaches the application. A device that received the content on SDK 11 inside the last 30 days is not covered: 13.x would complete that row on redelivery, and the sweep does not restore it. The count line holds no key and no value (§8.6) |
101
- | **Relay socket authentication** | Signal's Android client `OkHttpWebSocketConnection`; `libsignal` `chat.rs`; Signal's server `WebSocketDisconnectionRequestListener` | **Faithful.** The mailbox socket sends its credential once, at the handshake, and stays open until the server closes it or it fails. The Relay closes it with 4401 when the authority must be checked again, as Signal's server does. **Deviation** in detail. The handshake credential is a device token that expires after 15 minutes, and the open socket outlives it. The Relay also closes the socket with 4401 at the start of each UTC month | The Relay keeps its device credential short-lived for HTTP requests, and it counts monthly activity at the handshake | A renewal touches only HTTP requests and the next reconnect. An authority change reaches an open socket only through the 4401 close (§9.1) |
101
+ | **Relay socket authentication** | Signal's Android client `OkHttpWebSocketConnection`; `libsignal` `chat.rs`; Signal's server `WebSocketDisconnectionRequestListener` | **Faithful.** The mailbox socket sends its credential once, at the handshake, and stays open until the server closes it or it fails. The Relay closes it with 4401 when the authority must be checked again, as Signal's server does. **Deviation** in detail. The handshake credential is a device token that expires after 15 minutes, and the open socket outlives it. The Relay also closes the socket with 4401 at the end of each usage period | The Relay keeps its device credential short-lived for HTTP requests, and it counts monthly activity at the handshake | A renewal touches only HTTP requests and the next reconnect. An authority change reaches an open socket only through the 4401 close (§9.1) |
102
102
  | **zkgroup / zkcredential** | `libsignal` `zkgroup`, `zkcredential`, `poksho` | **Faithful** port of the Ristretto255 KVAC and Sigma-protocol system, verified against `libsignal`'s known-answer vectors. **Deviation:** server parameter derivation is structured as four labeled derivations rather than one seeded derivation | Server keys are the deploying operator's own trust root (each deployment generates its own seed), not Signal Messenger's | The zero-knowledge properties are real. Credentials are not interchangeable with Signal Messenger's |
103
103
  | **Registration IDs** | `libsignal` `sealed_sender.rs` | **Faithful.** Generated in `[1, 16383]`, strictly inside the 14 bits the wire format reserves | — | — |
104
104
  | **Linked-device registration IDs** | Signal's device linking | **Faithful** for a new link: the linked device gets its own fresh registration ID. **Deviation:** a device that a 12.0.x release linked keeps the ID of its active device, and a link that a 12.0.x release began keeps its stored ID (§5.7) | A changed ID on a live device fails its next prekey sync. A fresh ID on a link already begun can reserve a second device | Two devices of one account can share a registration ID. The sender-key handoff ledger keys each row by the device, so they stay apart |
@@ -779,7 +779,7 @@ removal clause is strict: the cleanup deletes the record only when
779
779
  removal is therefore gone from the Relay before `maxLatency` passes after the
780
780
  removal, and the record outlives it. The §3.1 guarantee for messages in flight
781
781
  thus holds without a fetch of the whole mailbox. The Convex relay keeps a
782
- message for 7 days (`remote/relay/convex/component/messages.ts:18`), so the
782
+ message for 7 days (`remote/signal-relay/convex/component/messages.ts:18`), so the
783
783
  bound holds there too.
784
784
 
785
785
  Two caveats limit the bound:
@@ -927,8 +927,8 @@ Signal's Android client. The following details differ.
927
927
  | D6 | A direct send also stops at 10 restarts | One bound for every send | Signal's Desktop client has no bound on missing or extra devices for a one-to-one send | The restart bound test of the direct send |
928
928
  | D7 | No empty sync post. A `needsSync` mark on the recipient receipt and one read of the own list replace it | A Relay post needs at least one destination | Signal's server accepts an empty sync list, and Signal's Android client addresses its own device | A new own device repairs the sync phase and the recipient post is not sent again. The own list is read only on `needsSync` with no own record, and a failed read leaves the sync phase pending |
929
929
  | D8 | A group post settles a not-found account as a refusal of each of its destinations, and the Relay accepts the rest | `NOT_FOUND` is a fan-out result code. A refusal of the whole post would use a restart | This is equivalent to the group-send-token path of Signal's server, which sends to the accounts it resolves and returns the others. Only the form differs: a refusal code for each destination | A removed account settles as refused and the send adds nothing. A lost response resumes as a duplicate with no not-found account |
930
- | D9 | The receipt of a declared post carries a `deviceSetChecked` mark | The identified Relay route passes unknown keys, and a deployment lane can lag the SDK | Signal ships its client and server together | A receipt without the mark raises `DEVICE_SET_UNCHECKED` through `onRelayProtocolError` |
931
- | D10 | The SDK seals a group body again only before the Relay accepts it, and only after a definite refusal | The Relay keys each delivery operation by message ID, class, destination device, generation and epoch, and keeps a fingerprint of it. It answers `RETRY_CONFLICT` to a changed body under the same operation. It also refuses a new operation whose message ID a row or journal entry of that mailbox holds. The message ID alone is not the operation key | Signal stores nothing on the server for a send attempt | A refused body is replaced in one write. A crash before the post of the replaced body posts it on resume. A `RETRY_CONFLICT` answer to a group shared post counts as acceptance and raises no `onRelayProtocolError` report |
930
+ | D9 | The receipt of a declared post carries a `deviceSetChecked` mark | The identified Relay route passes unknown keys, and a deployment lane can lag the SDK | Signal ships its client and server together | A receipt without the mark raises `DEVICE_SET_UNCHECKED` through `onSignalProtocolRelayProtocolError` |
931
+ | D10 | The SDK seals a group body again only before the Relay accepts it, and only after a definite refusal | The Relay keys each delivery operation by message ID, class, destination device, generation and epoch, and keeps a fingerprint of it. It answers `RETRY_CONFLICT` to a changed body under the same operation. It also refuses a new operation whose message ID a row or journal entry of that mailbox holds. The message ID alone is not the operation key | Signal stores nothing on the server for a send attempt | A refused body is replaced in one write. A crash before the post of the replaced body posts it on resume. A `RETRY_CONFLICT` answer to a group shared post counts as acceptance and raises no `onSignalProtocolRelayProtocolError` report |
932
932
  | D11 | A group restart keeps the group ciphertext, seals the shared body again, and replaces it in one write. It does not encrypt the content again | One group pass posts the same ciphertext in the shared body and in the device posts. A new ciphertext would change a device post that the Relay already accepted. The Relay keys that post by its operation, so its replay would get `RETRY_CONFLICT`. The message-ID check of each mailbox also refuses a new operation under the same message ID | Signal's Desktop client encrypts again for each attempt | The group ciphertext is byte-equal before and after the replacement, the accepted device post replays to its stored receipt, and the new body names the repaired destinations. A repaired pre-message that gets `RETRY_CONFLICT` records no sender-key handoff |
933
933
  | D12 | A declared post with no `recipientRegistrationId` skips the registration check | The field is optional on every Relay route | Signal's server compares the registration of each device of a post | A Relay test posts an unnamed registration |
934
934
  | D13 | A declaration that names the sender device gets 400 | The Relay refuses a malformed declaration before it compares | Signal's server answers 409 and names the sender device as an extra device | Relay tests on the direct and the group routes. The SDK does not declare the sender device |
@@ -996,7 +996,7 @@ A retry request has its own posting deadline, in row P9. The following details d
996
996
 
997
997
  | ID | Deviation | Constraint | Why Signal's form does not fit | Guarantee test |
998
998
  |---|---|---|---|---|
999
- | P1 | The deadline is the earlier of 24 hours after the SDK first stores the send and 24 hours after its `clientTimestamp` | The epoch of each post is the send timestamp, and the Relay admits an epoch at most 24 hours behind its clock. A founder ruling sets this term | Signal has no caller timestamp and no admission window | A send backdated by 23 hours posts inside the remaining hour and posts nothing after it. A send backdated by 24 hours posts nothing and throws `SendNeverAcceptedByRelayError` |
999
+ | P1 | The deadline is the earlier of 24 hours after the SDK first stores the send and 24 hours after its `clientTimestamp` | The epoch of each post is the send timestamp, and the Relay admits an epoch at most 24 hours behind its clock. A founder ruling sets this term | Signal has no caller timestamp and no admission window | A send backdated by 23 hours posts inside the remaining hour and posts nothing after it. A send backdated by 24 hours posts nothing and throws `SendNeverAcceptedBySignalProtocolRelayError` |
1000
1000
  | P2 | The deadline has no message-expiry term | The SDK has no message expiry. `SendOptions.expiresIn` is a future feature. The founder ruling "DA1 F1 posting window terms: the 24-hour terms only, no expiry term until a message expiry feature exists (2026-10-28, founder)" sets this term. When that feature ships, its timer starts after acceptance and controls local deletion only, and it never ends a pending post | Signal starts its expiry timer after the send | The stored deadline is 24 hours after the clock read that first stores the send, with no other term. At `deadlineAt` plus 1 ms, a replay of a declared or an undeclared send posts nothing and throws `SendAcceptanceUnknownError` |
1001
1001
  | P3 | A replay, a restart or a repair never moves the deadline | The deadline bounds the age of the kept epoch, and the Relay refuses an older epoch. A founder ruling says that retries and restarts never reset it | Signal's Android client starts a new job for a pending send | The deadline after a replay, a restart and a repair equals the first stored value. The deadline read after a restart equals the stored value |
1002
1002
  | P4 | A device whose Relay answer is lost, or whose answer follows an uncertain request, ends acceptance-unknown, not failed | The Relay can accept a post whose answer the SDK does not get, and a later post under the same ID can add one charged unit | Signal's Desktop client shows such a send as failed | An unanswered post and then an `OPERATION_EXPIRED` refusal end with `SendAcceptanceUnknownError`. A replay with no stored evidence for a device does not count that device as refused |
@@ -1713,8 +1713,11 @@ purpose (`WebSocketDisconnectionRequestListener.java:31`).
1713
1713
  password. The Relay credential is a device token that expires 15 minutes
1714
1714
  after it is issued. The open socket outlives the token. The hosted transport
1715
1715
  renews the token only when an HTTP request or a reconnect needs it. The Relay
1716
- also closes the socket with 4401 at the start of each UTC month, so that a
1717
- long-lived socket counts once in the monthly activity of the new month.
1716
+ also closes the socket with 4401 at the end of the usage period that the
1717
+ handshake counted in, which is the end of the billing period for a paid
1718
+ Production project and the start of the next UTC month for other projects, so
1719
+ that a long-lived socket counts once in the monthly activity of the next
1720
+ period.
1718
1721
 
1719
1722
  The constraint is that the Relay issues a short-lived device token and checks
1720
1723
  it on each HTTP request. A device that only receives sends no pull, so the
@@ -85,7 +85,7 @@ holds each member to a production construction site.
85
85
  | `ENCRYPTION_FAILED` | The SDK could not encrypt the message. | Inspect the session state and `originalError`. |
86
86
  | `INVALID_SEND_TIMESTAMP` | A new send carries a `timestamp`, or a sync to linked devices carries an application time, that is not a safe positive integer, or that is more than 5 minutes ahead of or more than 24 hours behind the SDK clock. A new send also gets it for a `timestamp` that a different send of the device used. The SDK's own sends, the profile key offer and the sender key distribution, reserve from the same index of the device, so an application that passes `timestamp: Date.now()` can get `already_used` when it did not use the value again itself. The SDK throws `InvalidSendTimestampError` from `@open-e2ee/signal-protocol-sdk/types` and stores or posts nothing for the send. The `reason` is `not_safe_positive_integer`, `too_far_ahead`, `too_old` or `already_used`. `earliest` and `latest` give the window, and are absent for `already_used`. | Omit `timestamp`, so that the SDK picks a free value. On `already_used`, send again with no timestamp. Otherwise send again with a timestamp in the window that no other send used. |
87
87
  | `SEND_ACCEPTANCE_UNKNOWN` | The posting deadline of a direct or group send ended, and the Relay acceptance of a device is not known. The SDK throws `SendAcceptanceUnknownError` from `@open-e2ee/signal-protocol-sdk/types`. The message might have arrived. | Tell the user that the message might already have arrived. Do not replay the send. |
88
- | `SEND_NEVER_ACCEPTED` | The posting deadline of a direct or group send ended, the call raised no refusal (a thrown refusal or a refusal in the receipt of a shared body), and no refused device has a stored refusal code. The SDK throws `SendNeverAcceptedByRelayError` from `@open-e2ee/signal-protocol-sdk/types`. | Tell the user which devices did not get the message. |
88
+ | `SEND_NEVER_ACCEPTED` | The posting deadline of a direct or group send ended, the call raised no refusal (a thrown refusal or a refusal in the receipt of a shared body), and no refused device has a stored refusal code. The SDK throws `SendNeverAcceptedBySignalProtocolRelayError` from `@open-e2ee/signal-protocol-sdk/types`. | Tell the user which devices did not get the message. |
89
89
  | `MESSAGE_DUPLICATE` | The session processed this message before. | Discard the duplicate. |
90
90
  | `TOO_MANY_SKIPPED_MESSAGES` | The message exceeded the skipped-key bound. | Reset the affected session. |
91
91
  | `REPLAY_DETECTED` | Envelope and encrypted-content timestamps differ. | Reject the message as a replay. |
@@ -162,7 +162,7 @@ that set. Neither is an `EncryptionError`.
162
162
 
163
163
  | Error | Cause | Application response |
164
164
  |---|---|---|
165
- | `HostedRelayUpgradeRequiredError` | The Relay no longer serves the version that the client sent. The message names that version. `code` is `UPGRADE_REQUIRED`, `status` is the HTTP status (426), and `retryable` is false. | Ship a newer SDK. The same request fails again, so do not retry it. |
165
+ | `HostedSignalProtocolRelayUpgradeRequiredError` | The Relay no longer serves the version that the client sent. The message names that version. `code` is `UPGRADE_REQUIRED`, `status` is the HTTP status (426), and `retryable` is false. | Ship a newer SDK. The same request fails again, so do not retry it. |
166
166
  | `PROTOCOL_UNSUPPORTED` | The Relay does not serve version 2. The request fails with status 400, the `code` `PROTOCOL_UNSUPPORTED`, and `retryable` true. A send keeps the device open until its posting deadline. | Retry later. The Relay never rolls back below a version that a published SDK sends, so this is a transient fault, not a planned state. |
167
167
 
168
168
  Version 2 adds one Relay code, `DELIVERY_ALREADY_ACCEPTED`. The Relay gives it
@@ -185,7 +185,7 @@ cannot count the answer as an acceptance. Handle it as `RETRY_CONFLICT`.
185
185
 
186
186
  The SDK does not retry an HTTP request that `UPGRADE_REQUIRED` refuses. Each
187
187
  Relay route that answers with a JSON body throws
188
- `HostedRelayUpgradeRequiredError`. An attachment download does not read the
188
+ `HostedSignalProtocolRelayUpgradeRequiredError`. An attachment download does not read the
189
189
  response body, so it reports the 426 as a
190
190
  [`MediaAttachmentError`](./api/namespaces/media/classes/MediaAttachmentError.md)
191
191
  with the code `download-failed` and the `status` 426.
@@ -193,7 +193,7 @@ with the code `download-failed` and the `status` 426.
193
193
  The mailbox subscription stops for the same refusal on its socket, with the
194
194
  state `stopped` and the reason `upgrade-required`. It does not reconnect and
195
195
  does not pull. For `PROTOCOL_UNSUPPORTED` on its socket, the subscription
196
- reconnects with its usual backoff. See [`RelayConnectionReason`](./api/type-aliases/RelayConnectionReason.md).
196
+ reconnects with its usual backoff. See [`SignalProtocolRelayConnectionReason`](./api/type-aliases/SignalProtocolRelayConnectionReason.md).
197
197
 
198
198
  The subscription also stops when the Relay refuses its socket token request or
199
199
  a pull conclusively. The refusal has `retryable` false and the code
@@ -201,8 +201,8 @@ a pull conclusively. The refusal has `retryable` false and the code
201
201
  and the reason is `authority-refused`. A refusal with `retryable` true, for
202
202
  example a missing Relay binding, goes to the retry schedule. A `NOT_FOUND` on
203
203
  the socket token request is a refusal of this device instead, as
204
- [Relay Device Errors](#relay-device-errors) describes. See
205
- [`RelayConnectionState`](./api/interfaces/RelayConnectionState.md).
204
+ [Signal Protocol Relay Device Errors](#signal-protocol-relay-device-errors) describes. See
205
+ [`SignalProtocolRelayConnectionState`](./api/interfaces/SignalProtocolRelayConnectionState.md).
206
206
 
207
207
  A client call can wrap the error in an `EncryptionError`. It is then the
208
208
  `originalError`.
@@ -211,14 +211,14 @@ A client call can wrap the error in an `EncryptionError`. It is then the
211
211
  ```typescript
212
212
  import {
213
213
  EncryptionError,
214
- HostedRelayUpgradeRequiredError,
214
+ HostedSignalProtocolRelayUpgradeRequiredError,
215
215
  } from '@open-e2ee/signal-protocol-sdk';
216
216
 
217
217
  function upgradeRequired(error: unknown): boolean {
218
218
  return (
219
- error instanceof HostedRelayUpgradeRequiredError ||
219
+ error instanceof HostedSignalProtocolRelayUpgradeRequiredError ||
220
220
  (error instanceof EncryptionError &&
221
- error.originalError instanceof HostedRelayUpgradeRequiredError)
221
+ error.originalError instanceof HostedSignalProtocolRelayUpgradeRequiredError)
222
222
  );
223
223
  }
224
224
 
@@ -335,7 +335,7 @@ hours after the SDK first stores the send and 24 hours after its timestamp. A
335
335
  replay or a restart never moves it. At or after `deadlineAt`, the SDK starts
336
336
  no Relay request for the send. A request that started before it still counts
337
337
  when its answer arrives later. Before `deadlineAt`, a send error that leaves a
338
- device open has `retryable: true`, and `relayRetryable` keeps the hint of the
338
+ device open has `retryable: true`, and `signalProtocolRelayRetryable` keeps the hint of the
339
339
  Relay. With a store that implements `listMetadataKeys`, as every built-in
340
340
  store does, the SDK replays the send at start and on reconnect until
341
341
  `deadlineAt`. It reports the end once through `onSendOutcome`. An internal
@@ -366,7 +366,7 @@ the rule below. The two deadline classes come from
366
366
  | Error | Cause | Application response |
367
367
  |---|---|---|
368
368
  | `SendAcceptanceUnknownError` | The Relay acceptance of a device is not known. An answer was lost, or it followed an uncertain request | Tell the user that the message might already have arrived. Do not replay the send |
369
- | `SendNeverAcceptedByRelayError` | The Relay accepted no request for an open device, the call raised no refusal, and no refused device has a stored refusal code. No request started before the deadline, or each answer was a refusal for now, such as `QUOTA_EXCEEDED` | Tell the user which devices did not get the message |
369
+ | `SendNeverAcceptedBySignalProtocolRelayError` | The Relay accepted no request for an open device, the call raised no refusal, and no refused device has a stored refusal code. No request started before the deadline, or each answer was a refusal for now, such as `QUOTA_EXCEEDED` | Tell the user which devices did not get the message |
370
370
 
371
371
  When no device has an unknown acceptance, the send ends failed, and one rule
372
372
  gives its error:
@@ -377,7 +377,7 @@ gives its error:
377
377
  receipt is an `Error` with the `code` of that refusal.
378
378
  2. Otherwise, the error is an `Error` with the stored `code` of the first
379
379
  refused device that has one, in the order of the destinations.
380
- 3. Otherwise, the error is `SendNeverAcceptedByRelayError` with code
380
+ 3. Otherwise, the error is `SendNeverAcceptedBySignalProtocolRelayError` with code
381
381
  `SEND_NEVER_ACCEPTED`.
382
382
 
383
383
  A replay of the ended send raises no refusal, so its error comes from case 2
@@ -433,8 +433,8 @@ device, the replay completes the send and returns the result without
433
433
  The Relay marks each accepted declared post with `deviceSetChecked`. When an
434
434
  accepted post has no mark, the Relay did not compare its device set. The send
435
435
  is delivered and its result does not change. The client reports a
436
- [`RelayProtocolError`](./api/classes/RelayProtocolError.md) with the code
437
- `DEVICE_SET_UNCHECKED` once for the send through the `onRelayProtocolError`
436
+ [`SignalProtocolRelayProtocolError`](./api/classes/SignalProtocolRelayProtocolError.md) with the code
437
+ `DEVICE_SET_UNCHECKED` once for the send through the `onSignalProtocolRelayProtocolError`
438
438
  hook. Its `route` names the post route. A sync copy to another own device is
439
439
  an `identified-direct` post. A sync payload of a method such as
440
440
  `syncReadToLinkedDevices` reports the error once, with no `clientMessageId`.
@@ -446,7 +446,7 @@ A relay that does not compare device sets gets no declaration. The Convex
446
446
  relay is one. With it, the SDK reads the device lists as before, and none of
447
447
  these errors occur.
448
448
 
449
- ## Relay Device Errors
449
+ ## Signal Protocol Relay Device Errors
450
450
 
451
451
  The Relay can refuse this device, and a managed device link can refuse its
452
452
  linked store. Three errors name these refusals. None is an `EncryptionError`,
@@ -454,16 +454,16 @@ and the SDK retries none of them.
454
454
 
455
455
  | Error | Cause | Application response |
456
456
  |---|---|---|
457
- | [`HostedRelayDeviceRevokedError`](./api/classes/HostedRelayDeviceRevokedError.md) | An account recovery revoked this device. `code` is `DEVICE_REVOKED`, `status` is 403, and `retryable` is false. | Sign the user out of this device. The Relay refuses a registration with the revoked key, so a re-registration fails too. |
458
- | [`HostedRelayDeviceUnknownError`](./api/classes/HostedRelayDeviceUnknownError.md) | The Relay has no device for the stored session. `code` is `NOT_FOUND`, `status` is 404, and `retryable` is false. The message is the Relay's own message. | Ask the user to confirm a re-registration of this device. Do not re-register without that confirmation. |
459
- | [`HostedRelayDeviceLinkError`](./api/classes/HostedRelayDeviceLinkError.md) | `linkHostedRelayDevice` found state in the linked store that the link did not write: a group in the linked group store, or a device-authentication key for this Relay connection with no registration of this link. `code` is `DEVICE_LINK_STORE_NOT_EMPTY`, and `retryable` is false. The link wrote nothing. | Link the device again with a new, empty store. The same store is refused again. |
457
+ | [`HostedSignalProtocolRelayDeviceRevokedError`](./api/classes/HostedSignalProtocolRelayDeviceRevokedError.md) | An account recovery revoked this device. `code` is `DEVICE_REVOKED`, `status` is 403, and `retryable` is false. | Sign the user out of this device. The Relay refuses a registration with the revoked key, so a re-registration fails too. |
458
+ | [`HostedSignalProtocolRelayDeviceUnknownError`](./api/classes/HostedSignalProtocolRelayDeviceUnknownError.md) | The Relay has no device for the stored session. `code` is `NOT_FOUND`, `status` is 404, and `retryable` is false. The message is the Relay's own message. | Ask the user to confirm a re-registration of this device. Do not re-register without that confirmation. |
459
+ | [`HostedSignalProtocolRelayDeviceLinkError`](./api/classes/HostedSignalProtocolRelayDeviceLinkError.md) | `linkHostedSignalProtocolRelayDevice` found state in the linked store that the link did not write: a group in the linked group store, or a device-authentication key for this Relay connection with no registration of this link. `code` is `DEVICE_LINK_STORE_NOT_EMPTY`, and `retryable` is false. The link wrote nothing. | Link the device again with a new, empty store. The same store is refused again. |
460
460
 
461
461
  `createHostedSignalProtocolClient` throws the first two errors when the stored
462
462
  session cannot get a device token. It does not register a new device in their
463
463
  place. A running client throws them from its Relay calls. A client call can
464
464
  wrap them in an `EncryptionError`, as the `originalError`. The mailbox subscription
465
465
  stops with the reason `device-revoked` or `device-unknown`. See
466
- [`RelayConnectionReason`](./api/type-aliases/RelayConnectionReason.md).
466
+ [`SignalProtocolRelayConnectionReason`](./api/type-aliases/SignalProtocolRelayConnectionReason.md).
467
467
 
468
468
  To re-register, create the client again with `assertionPurpose: 'reregister'`.
469
469
  It keeps the stored identity and device key, and it asks for a `register`
@@ -485,18 +485,18 @@ A re-registration has these effects:
485
485
  <!-- doc-snippet:skip requires-existing-client -->
486
486
  ```typescript
487
487
  import {
488
- HostedRelayDeviceRevokedError,
489
- HostedRelayDeviceUnknownError,
488
+ HostedSignalProtocolRelayDeviceRevokedError,
489
+ HostedSignalProtocolRelayDeviceUnknownError,
490
490
  createHostedSignalProtocolClient,
491
491
  } from '@open-e2ee/signal-protocol-sdk';
492
492
 
493
493
  try {
494
494
  signal = await createHostedSignalProtocolClient(options);
495
495
  } catch (error) {
496
- if (error instanceof HostedRelayDeviceRevokedError) {
496
+ if (error instanceof HostedSignalProtocolRelayDeviceRevokedError) {
497
497
  signOutThisDevice();
498
498
  } else if (
499
- error instanceof HostedRelayDeviceUnknownError &&
499
+ error instanceof HostedSignalProtocolRelayDeviceUnknownError &&
500
500
  (await confirmReregistration())
501
501
  ) {
502
502
  signal = await createHostedSignalProtocolClient({
@@ -718,7 +718,7 @@ import { DefaultSignalProtocolClient } from '@open-e2ee/signal-protocol-sdk';
718
718
 
719
719
  const signal = await DefaultSignalProtocolClient.create(userId, {
720
720
  storage,
721
- relay,
721
+ signalProtocolRelay,
722
722
  logger: {
723
723
  debug: console.debug,
724
724
  info: console.info,