@open-e2ee/signal-protocol-sdk 0.1.0-alpha.7 → 0.1.0-alpha.9

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 (655) hide show
  1. package/ADAPTERS.md +1 -1
  2. package/CHANGELOG.md +767 -2
  3. package/COMMERCIAL.md +56 -0
  4. package/README.md +13 -8
  5. package/SECURITY.md +15 -1
  6. package/client/README.md +1 -1
  7. package/dist/client/client.d.ts.map +1 -1
  8. package/dist/client/client.js +16 -8
  9. package/dist/client/client.js.map +1 -1
  10. package/dist/client/config.d.ts +12 -2
  11. package/dist/client/config.d.ts.map +1 -1
  12. package/dist/client/config.js.map +1 -1
  13. package/dist/client/endorsement-manager.d.ts +19 -2
  14. package/dist/client/endorsement-manager.d.ts.map +1 -1
  15. package/dist/client/endorsement-manager.js +26 -10
  16. package/dist/client/endorsement-manager.js.map +1 -1
  17. package/dist/client/headless.d.ts +1 -1
  18. package/dist/client/headless.js +1 -1
  19. package/dist/client/sealed-sender-ops.d.ts +27 -1
  20. package/dist/client/sealed-sender-ops.d.ts.map +1 -1
  21. package/dist/client/sealed-sender-ops.js +36 -6
  22. package/dist/client/sealed-sender-ops.js.map +1 -1
  23. package/dist/client/signal-service-cipher.d.ts +16 -1
  24. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  25. package/dist/client/signal-service-cipher.js +112 -52
  26. package/dist/client/signal-service-cipher.js.map +1 -1
  27. package/dist/client/types.d.ts +20 -7
  28. package/dist/client/types.d.ts.map +1 -1
  29. package/dist/client/types.js.map +1 -1
  30. package/dist/index.d.ts +7 -0
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +7 -0
  33. package/dist/index.js.map +1 -1
  34. package/dist/internal/crypto/index.d.ts +1 -1
  35. package/dist/internal/crypto/index.d.ts.map +1 -1
  36. package/dist/internal/crypto/index.js +1 -1
  37. package/dist/internal/crypto/index.js.map +1 -1
  38. package/dist/internal/crypto/random.d.ts +9 -0
  39. package/dist/internal/crypto/random.d.ts.map +1 -1
  40. package/dist/internal/crypto/random.js +16 -0
  41. package/dist/internal/crypto/random.js.map +1 -1
  42. package/dist/internal/groups/manager.d.ts +37 -5
  43. package/dist/internal/groups/manager.d.ts.map +1 -1
  44. package/dist/internal/groups/manager.js +98 -15
  45. package/dist/internal/groups/manager.js.map +1 -1
  46. package/dist/internal/groups/server-engine.d.ts +48 -2
  47. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  48. package/dist/internal/groups/server-engine.js +122 -13
  49. package/dist/internal/groups/server-engine.js.map +1 -1
  50. package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +1 -1
  51. package/dist/internal/protocol/sealed-sender/decryption-v2.js +32 -18
  52. package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +1 -1
  53. package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
  54. package/dist/internal/protocol/sealed-sender/decryption.js +33 -19
  55. package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
  56. package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +1 -1
  57. package/dist/internal/protocol/sealed-sender/encryption-v2.js +8 -14
  58. package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +1 -1
  59. package/dist/internal/protocol/sealed-sender/encryption.d.ts +9 -4
  60. package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -1
  61. package/dist/internal/protocol/sealed-sender/encryption.js +7 -15
  62. package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -1
  63. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +6 -7
  64. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  65. package/dist/internal/protocol/sealed-sender/proto/index.js +5 -7
  66. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  67. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +45 -0
  68. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -0
  69. package/dist/internal/protocol/sealed-sender/trust-root.js +77 -0
  70. package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -0
  71. package/dist/internal/protocol/sealed-sender/types.d.ts +64 -9
  72. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  73. package/dist/internal/protocol/sealed-sender/types.js +43 -0
  74. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  75. package/dist/internal/protocol/sender-keys/manager.d.ts +37 -0
  76. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  77. package/dist/internal/protocol/sender-keys/manager.js +108 -7
  78. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  79. package/dist/local/store/expo/adapter.d.ts +14 -15
  80. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  81. package/dist/local/store/expo/adapter.js +109 -102
  82. package/dist/local/store/expo/adapter.js.map +1 -1
  83. package/dist/local/store/expo/db.d.ts +4 -1
  84. package/dist/local/store/expo/db.d.ts.map +1 -1
  85. package/dist/local/store/expo/db.js +5 -0
  86. package/dist/local/store/expo/db.js.map +1 -1
  87. package/dist/local/store/expo/index.d.ts +0 -2
  88. package/dist/local/store/expo/index.d.ts.map +1 -1
  89. package/dist/local/store/expo/index.js +1 -1
  90. package/dist/local/store/expo/index.js.map +1 -1
  91. package/dist/local/store/expo/models/index.d.ts +1 -1
  92. package/dist/local/store/expo/models/index.d.ts.map +1 -1
  93. package/dist/local/store/expo/models/index.js +2 -2
  94. package/dist/local/store/expo/models/index.js.map +1 -1
  95. package/dist/local/store/expo/models/sender-key.d.ts +101 -77
  96. package/dist/local/store/expo/models/sender-key.d.ts.map +1 -1
  97. package/dist/local/store/expo/models/sender-key.js +154 -124
  98. package/dist/local/store/expo/models/sender-key.js.map +1 -1
  99. package/dist/local/store/expo/schema.d.ts +134 -32
  100. package/dist/local/store/expo/schema.d.ts.map +1 -1
  101. package/dist/local/store/expo/schema.js +36 -7
  102. package/dist/local/store/expo/schema.js.map +1 -1
  103. package/dist/local/store/mock/adapter.d.ts +1 -0
  104. package/dist/local/store/mock/adapter.d.ts.map +1 -1
  105. package/dist/local/store/mock/adapter.js +18 -0
  106. package/dist/local/store/mock/adapter.js.map +1 -1
  107. package/dist/local/store/node/adapter.d.ts +53 -4
  108. package/dist/local/store/node/adapter.d.ts.map +1 -1
  109. package/dist/local/store/node/adapter.js +456 -9
  110. package/dist/local/store/node/adapter.js.map +1 -1
  111. package/dist/local/store/node/database.d.ts +68 -0
  112. package/dist/local/store/node/database.d.ts.map +1 -1
  113. package/dist/local/store/node/database.js +201 -18
  114. package/dist/local/store/node/database.js.map +1 -1
  115. package/dist/local/store/react-native/adapter.d.ts +39 -0
  116. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  117. package/dist/local/store/react-native/adapter.js +163 -8
  118. package/dist/local/store/react-native/adapter.js.map +1 -1
  119. package/dist/local/store/web/adapter.d.ts +1 -0
  120. package/dist/local/store/web/adapter.d.ts.map +1 -1
  121. package/dist/local/store/web/adapter.js +33 -1
  122. package/dist/local/store/web/adapter.js.map +1 -1
  123. package/dist/remote/relay/convex/backend.d.ts +405 -0
  124. package/dist/remote/relay/convex/backend.d.ts.map +1 -0
  125. package/dist/remote/relay/convex/backend.js +687 -0
  126. package/dist/remote/relay/convex/backend.js.map +1 -0
  127. package/dist/remote/relay/convex/component/_generated/api.d.ts +58 -0
  128. package/dist/remote/relay/convex/component/_generated/api.d.ts.map +1 -0
  129. package/dist/remote/relay/convex/component/_generated/api.js +31 -0
  130. package/dist/remote/relay/convex/component/_generated/api.js.map +1 -0
  131. package/dist/remote/relay/convex/component/_generated/component.d.ts +483 -0
  132. package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -0
  133. package/dist/remote/relay/convex/component/_generated/component.js +11 -0
  134. package/dist/remote/relay/convex/component/_generated/component.js.map +1 -0
  135. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts +46 -0
  136. package/dist/remote/relay/convex/component/_generated/dataModel.d.ts.map +1 -0
  137. package/dist/remote/relay/convex/component/_generated/dataModel.js +11 -0
  138. package/dist/remote/relay/convex/component/_generated/dataModel.js.map +1 -0
  139. package/dist/remote/relay/convex/component/_generated/server.d.ts +129 -0
  140. package/dist/remote/relay/convex/component/_generated/server.d.ts.map +1 -0
  141. package/dist/remote/relay/convex/component/_generated/server.js +79 -0
  142. package/dist/remote/relay/convex/component/_generated/server.js.map +1 -0
  143. package/dist/remote/relay/convex/component/accounts.d.ts +43 -0
  144. package/dist/remote/relay/convex/component/accounts.d.ts.map +1 -0
  145. package/dist/remote/relay/convex/component/accounts.js +181 -0
  146. package/dist/remote/relay/convex/component/accounts.js.map +1 -0
  147. package/dist/remote/relay/convex/component/certificates.d.ts +10 -0
  148. package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -0
  149. package/dist/remote/relay/convex/component/certificates.js +122 -0
  150. package/dist/remote/relay/convex/component/certificates.js.map +1 -0
  151. package/dist/remote/relay/convex/component/cleanup.d.ts +32 -0
  152. package/dist/remote/relay/convex/component/cleanup.d.ts.map +1 -0
  153. package/dist/remote/relay/convex/component/cleanup.js +146 -0
  154. package/dist/remote/relay/convex/component/cleanup.js.map +1 -0
  155. package/dist/remote/relay/convex/component/convex.config.d.ts +5 -0
  156. package/dist/remote/relay/convex/component/convex.config.d.ts.map +1 -0
  157. package/dist/remote/relay/convex/component/convex.config.js +33 -0
  158. package/dist/remote/relay/convex/component/convex.config.js.map +1 -0
  159. package/dist/remote/relay/convex/component/crons.d.ts +3 -0
  160. package/dist/remote/relay/convex/component/crons.d.ts.map +1 -0
  161. package/dist/remote/relay/convex/component/crons.js +10 -0
  162. package/dist/remote/relay/convex/component/crons.js.map +1 -0
  163. package/dist/remote/relay/convex/component/devices.d.ts +101 -0
  164. package/dist/remote/relay/convex/component/devices.d.ts.map +1 -0
  165. package/dist/remote/relay/convex/component/devices.js +299 -0
  166. package/dist/remote/relay/convex/component/devices.js.map +1 -0
  167. package/dist/remote/relay/convex/component/errors.d.ts +22 -0
  168. package/dist/remote/relay/convex/component/errors.d.ts.map +1 -0
  169. package/dist/remote/relay/convex/component/errors.js +17 -0
  170. package/dist/remote/relay/convex/component/errors.js.map +1 -0
  171. package/dist/remote/relay/convex/component/groups.d.ts +63 -0
  172. package/dist/remote/relay/convex/component/groups.d.ts.map +1 -0
  173. package/dist/remote/relay/convex/component/groups.js +341 -0
  174. package/dist/remote/relay/convex/component/groups.js.map +1 -0
  175. package/dist/remote/relay/convex/component/keys.d.ts +130 -0
  176. package/dist/remote/relay/convex/component/keys.d.ts.map +1 -0
  177. package/dist/remote/relay/convex/component/keys.js +578 -0
  178. package/dist/remote/relay/convex/component/keys.js.map +1 -0
  179. package/dist/remote/relay/convex/component/messages.d.ts +119 -0
  180. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -0
  181. package/dist/remote/relay/convex/component/messages.js +723 -0
  182. package/dist/remote/relay/convex/component/messages.js.map +1 -0
  183. package/dist/remote/relay/convex/component/provisioning.d.ts +92 -0
  184. package/dist/remote/relay/convex/component/provisioning.d.ts.map +1 -0
  185. package/dist/remote/relay/convex/component/provisioning.js +359 -0
  186. package/dist/remote/relay/convex/component/provisioning.js.map +1 -0
  187. package/dist/remote/relay/convex/component/runtime.d.ts +18 -0
  188. package/dist/remote/relay/convex/component/runtime.d.ts.map +1 -0
  189. package/dist/remote/relay/convex/component/runtime.js +142 -0
  190. package/dist/remote/relay/convex/component/runtime.js.map +1 -0
  191. package/dist/remote/relay/convex/component/schema.d.ts +358 -0
  192. package/dist/remote/relay/convex/component/schema.d.ts.map +1 -0
  193. package/dist/remote/relay/convex/component/schema.js +287 -0
  194. package/dist/remote/relay/convex/component/schema.js.map +1 -0
  195. package/dist/remote/relay/convex/component/zkAuth.d.ts +12 -0
  196. package/dist/remote/relay/convex/component/zkAuth.d.ts.map +1 -0
  197. package/dist/remote/relay/convex/component/zkAuth.js +71 -0
  198. package/dist/remote/relay/convex/component/zkAuth.js.map +1 -0
  199. package/dist/remote/relay/convex/constants.d.ts +3 -0
  200. package/dist/remote/relay/convex/constants.d.ts.map +1 -0
  201. package/dist/remote/relay/convex/constants.js +3 -0
  202. package/dist/remote/relay/convex/constants.js.map +1 -0
  203. package/dist/remote/relay/convex/group-server.d.ts +9 -6
  204. package/dist/remote/relay/convex/group-server.d.ts.map +1 -1
  205. package/dist/remote/relay/convex/group-server.js +17 -11
  206. package/dist/remote/relay/convex/group-server.js.map +1 -1
  207. package/dist/remote/relay/convex/index.d.ts +4 -1
  208. package/dist/remote/relay/convex/index.d.ts.map +1 -1
  209. package/dist/remote/relay/convex/index.js +3 -1
  210. package/dist/remote/relay/convex/index.js.map +1 -1
  211. package/dist/remote/relay/convex/relay.d.ts +44 -65
  212. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  213. package/dist/remote/relay/convex/relay.js +61 -36
  214. package/dist/remote/relay/convex/relay.js.map +1 -1
  215. package/dist/remote/relay/convex/types.d.ts +16 -103
  216. package/dist/remote/relay/convex/types.d.ts.map +1 -1
  217. package/dist/remote/relay/convex/types.js +8 -13
  218. package/dist/remote/relay/convex/types.js.map +1 -1
  219. package/dist/remote/relay/index.d.ts +1 -1
  220. package/dist/remote/relay/index.d.ts.map +1 -1
  221. package/dist/remote/relay/index.js.map +1 -1
  222. package/dist/remote/relay/mock/adapter.d.ts +4 -9
  223. package/dist/remote/relay/mock/adapter.d.ts.map +1 -1
  224. package/dist/remote/relay/mock/adapter.js +39 -22
  225. package/dist/remote/relay/mock/adapter.js.map +1 -1
  226. package/dist/remote/relay/types.d.ts +57 -75
  227. package/dist/remote/relay/types.d.ts.map +1 -1
  228. package/dist/remote/relay/types.js +0 -1
  229. package/dist/remote/relay/types.js.map +1 -1
  230. package/dist/types/api.d.ts +21 -0
  231. package/dist/types/api.d.ts.map +1 -1
  232. package/dist/types/protocol-config.d.ts +51 -0
  233. package/dist/types/protocol-config.d.ts.map +1 -1
  234. package/dist/types/protocol-config.js +46 -0
  235. package/dist/types/protocol-config.js.map +1 -1
  236. package/docs/ASSURANCE.md +10 -6
  237. package/docs/CLIENT_COMPOSITION.md +23 -69
  238. package/docs/DEVIATIONS.md +44 -11
  239. package/docs/E2EE.md +71 -6
  240. package/docs/GETTING_STARTED.md +1 -1
  241. package/docs/PACKAGE_SURFACE.md +6 -5
  242. package/docs/RECIPES.md +1 -1
  243. package/docs/SECURITY.md +8 -0
  244. package/local/store/README.md +3 -1
  245. package/local/store/expo/README.md +10 -1
  246. package/local/store/node/README.md +8 -1
  247. package/package.json +12 -7
  248. package/remote/relay/convex/README.md +1 -1
  249. package/remote/relay/convex/component/README.md +428 -0
  250. package/scripts/oe-groups.mjs +21 -1
  251. package/dist/remote/relay/convex/server/index.d.ts +0 -2
  252. package/dist/remote/relay/convex/server/index.d.ts.map +0 -1
  253. package/dist/remote/relay/convex/server/index.js +0 -2
  254. package/dist/remote/relay/convex/server/index.js.map +0 -1
  255. package/dist/remote/relay/convex/server.d.ts +0 -150
  256. package/dist/remote/relay/convex/server.d.ts.map +0 -1
  257. package/dist/remote/relay/convex/server.js +0 -506
  258. package/dist/remote/relay/convex/server.js.map +0 -1
  259. package/docs/api/README.md +0 -471
  260. package/docs/api/classes/EncryptionError.md +0 -112
  261. package/docs/api/classes/EndorsementManager.md +0 -325
  262. package/docs/api/classes/SealedSenderAuthError.md +0 -127
  263. package/docs/api/classes/ServerDerivedKeyPair.md +0 -68
  264. package/docs/api/classes/ServerDerivedPublicKey.md +0 -33
  265. package/docs/api/classes/ServerRootKeyPair.md +0 -94
  266. package/docs/api/classes/ServerRootPublicKey.md +0 -72
  267. package/docs/api/classes/SignalProtocolBlockingManager.md +0 -106
  268. package/docs/api/classes/SignalProtocolClient.md +0 -2654
  269. package/docs/api/classes/VerificationFailure.md +0 -25
  270. package/docs/api/enumerations/ContentHint.md +0 -63
  271. package/docs/api/enumerations/EncryptionErrorCode.md +0 -488
  272. package/docs/api/enumerations/IdentityKeyChange.md +0 -65
  273. package/docs/api/enumerations/MessageType.md +0 -29
  274. package/docs/api/enumerations/TrustDirection.md +0 -33
  275. package/docs/api/enumerations/TypingAction.md +0 -31
  276. package/docs/api/functions/createDefaultSignalProtocolContentAdapter.md +0 -13
  277. package/docs/api/functions/createDefaultSignalProtocolLogger.md +0 -36
  278. package/docs/api/functions/createGroupId.md +0 -32
  279. package/docs/api/functions/createSignalProtocolClient.md +0 -36
  280. package/docs/api/functions/createSignalProtocolClientConfig.md +0 -24
  281. package/docs/api/functions/decodeGroupTrustRoot.md +0 -21
  282. package/docs/api/functions/encodeGroupTrustRoot.md +0 -28
  283. package/docs/api/functions/extractGroupId.md +0 -32
  284. package/docs/api/functions/formatVersion.md +0 -25
  285. package/docs/api/functions/isCompatible.md +0 -31
  286. package/docs/api/functions/isGroupId.md +0 -37
  287. package/docs/api/functions/isSealedSenderAuthError.md +0 -25
  288. package/docs/api/functions/parseVersion.md +0 -29
  289. package/docs/api/functions/resolveSPQRLimits.md +0 -21
  290. package/docs/api/functions/resolveSignalProtocolLogger.md +0 -42
  291. package/docs/api/interfaces/AccountIdentityProvisioning.md +0 -43
  292. package/docs/api/interfaces/AccountIdentityRotation.md +0 -69
  293. package/docs/api/interfaces/AttachmentTransferOptions.md +0 -49
  294. package/docs/api/interfaces/BlockedRecipientEntry.md +0 -25
  295. package/docs/api/interfaces/BlockedRecipientsSyncInput.md +0 -27
  296. package/docs/api/interfaces/ConfigurationSyncInput.md +0 -19
  297. package/docs/api/interfaces/CredentialPublicKey.md +0 -25
  298. package/docs/api/interfaces/DataMessageInput.md +0 -21
  299. package/docs/api/interfaces/DecryptedEnvelope.md +0 -95
  300. package/docs/api/interfaces/DecryptedGroup.md +0 -86
  301. package/docs/api/interfaces/DeviceInfo.md +0 -79
  302. package/docs/api/interfaces/DeviceRecord.md +0 -87
  303. package/docs/api/interfaces/DeviceRegistration.md +0 -27
  304. package/docs/api/interfaces/DoubleRatchetConfig.md +0 -36
  305. package/docs/api/interfaces/EcOneTimePreKey.md +0 -27
  306. package/docs/api/interfaces/EcSignedPreKey.md +0 -39
  307. package/docs/api/interfaces/EcSignedPreKeyUpload.md +0 -50
  308. package/docs/api/interfaces/EncryptionErrorContext.md +0 -51
  309. package/docs/api/interfaces/Envelope.md +0 -154
  310. package/docs/api/interfaces/ForceKeyResetResult.md +0 -37
  311. package/docs/api/interfaces/GroupAuthorization.md +0 -23
  312. package/docs/api/interfaces/GroupChangeEntry.md +0 -42
  313. package/docs/api/interfaces/GroupMemberDevice.md +0 -26
  314. package/docs/api/interfaces/GroupTrustRoot.md +0 -33
  315. package/docs/api/interfaces/IEcOneTimePreKeyStore.md +0 -86
  316. package/docs/api/interfaces/IEcSignedPreKeyStore.md +0 -133
  317. package/docs/api/interfaces/IGroupServer.md +0 -120
  318. package/docs/api/interfaces/IGroupStateStore.md +0 -128
  319. package/docs/api/interfaces/IIdentityKeyStore.md +0 -312
  320. package/docs/api/interfaces/IKemPreKeyStore.md +0 -144
  321. package/docs/api/interfaces/IKyberLastResortPreKeyStore.md +0 -112
  322. package/docs/api/interfaces/ILogger.md +0 -117
  323. package/docs/api/interfaces/IProtocolStore.md +0 -1033
  324. package/docs/api/interfaces/IRelayGroupServer.md +0 -60
  325. package/docs/api/interfaces/ISenderKeyStore.md +0 -417
  326. package/docs/api/interfaces/ISesameStore.md +0 -249
  327. package/docs/api/interfaces/ISessionStore.md +0 -178
  328. package/docs/api/interfaces/ISignalProtocolClient.md +0 -1185
  329. package/docs/api/interfaces/ISignalProtocolLocalSecretVault.md +0 -71
  330. package/docs/api/interfaces/ISignalProtocolLocalStore.md +0 -2053
  331. package/docs/api/interfaces/ISignalProtocolManager.md +0 -272
  332. package/docs/api/interfaces/ISignalProtocolRelayServer.md +0 -1337
  333. package/docs/api/interfaces/IdentityKeyPair.md +0 -49
  334. package/docs/api/interfaces/IncomingEnvelope.md +0 -91
  335. package/docs/api/interfaces/InspectedSignalProtocolContent.md +0 -43
  336. package/docs/api/interfaces/KDFChain.md +0 -31
  337. package/docs/api/interfaces/KemLastResortPreKeyUpload.md +0 -50
  338. package/docs/api/interfaces/KeyPair.md +0 -23
  339. package/docs/api/interfaces/KyberPreKey.md +0 -42
  340. package/docs/api/interfaces/MLKEMBraidAgentState.md +0 -191
  341. package/docs/api/interfaces/MLKEMBraidMessage.md +0 -49
  342. package/docs/api/interfaces/MediaAttachmentDeleteSyncInput.md +0 -31
  343. package/docs/api/interfaces/MessageHeader.md +0 -49
  344. package/docs/api/interfaces/MessageRecord.md +0 -86
  345. package/docs/api/interfaces/ParsedReceiptContent.md +0 -19
  346. package/docs/api/interfaces/ParsedTypingContent.md +0 -19
  347. package/docs/api/interfaces/PreKeyMaintenanceStore.md +0 -88
  348. package/docs/api/interfaces/PreKeyMessage.md +0 -159
  349. package/docs/api/interfaces/PreKeyStatusResult.md +0 -21
  350. package/docs/api/interfaces/PreKeyUpload.md +0 -42
  351. package/docs/api/interfaces/ProcessEnvelopeOptions.md +0 -72
  352. package/docs/api/interfaces/ProtocolAddress.md +0 -38
  353. package/docs/api/interfaces/ProtocolStrategyConfig.md +0 -91
  354. package/docs/api/interfaces/RatchetMessage.md +0 -96
  355. package/docs/api/interfaces/ReadSyncEntryInput.md +0 -19
  356. package/docs/api/interfaces/ReceiverChain.md +0 -43
  357. package/docs/api/interfaces/RecipientUsernameSyncInput.md +0 -31
  358. package/docs/api/interfaces/RelayPreKeyBundle.md +0 -254
  359. package/docs/api/interfaces/RemoteObjectDownload.md +0 -33
  360. package/docs/api/interfaces/RemoteObjectUpload.md +0 -49
  361. package/docs/api/interfaces/ResolvedSPQRInfoStrings.md +0 -27
  362. package/docs/api/interfaces/ResolvedSPQRLimits.md +0 -37
  363. package/docs/api/interfaces/RetryRequest.md +0 -80
  364. package/docs/api/interfaces/SCKAState.md +0 -65
  365. package/docs/api/interfaces/SPQRLimits.md +0 -40
  366. package/docs/api/interfaces/SPQRState.md +0 -191
  367. package/docs/api/interfaces/SafetyNumber.md +0 -60
  368. package/docs/api/interfaces/SafetyNumberConfirmation.md +0 -46
  369. package/docs/api/interfaces/SealedSenderConfig.md +0 -70
  370. package/docs/api/interfaces/SendOptions.md +0 -191
  371. package/docs/api/interfaces/SendResult.md +0 -93
  372. package/docs/api/interfaces/SenderKeyDistributionMessage.md +0 -43
  373. package/docs/api/interfaces/SenderKeyState.md +0 -76
  374. package/docs/api/interfaces/SenderKeysConfig.md +0 -65
  375. package/docs/api/interfaces/SentSyncTranscriptInput.md +0 -31
  376. package/docs/api/interfaces/ServiceId.md +0 -19
  377. package/docs/api/interfaces/SesameMessage.md +0 -84
  378. package/docs/api/interfaces/SesameStats.md +0 -57
  379. package/docs/api/interfaces/SessionHealthResult.md +0 -120
  380. package/docs/api/interfaces/SessionRecord.md +0 -80
  381. package/docs/api/interfaces/SessionRecordMetadata.md +0 -109
  382. package/docs/api/interfaces/SessionState.md +0 -368
  383. package/docs/api/interfaces/SessionTrustCommit.md +0 -58
  384. package/docs/api/interfaces/SignalProtocolBlockingHooks.md +0 -44
  385. package/docs/api/interfaces/SignalProtocolBlockingManagerOptions.md +0 -31
  386. package/docs/api/interfaces/SignalProtocolBlockingMirror.md +0 -30
  387. package/docs/api/interfaces/SignalProtocolBlockingStore.md +0 -83
  388. package/docs/api/interfaces/SignalProtocolClientAdapterConfig.md +0 -44
  389. package/docs/api/interfaces/SignalProtocolClientCompositionOptions.md +0 -731
  390. package/docs/api/interfaces/SignalProtocolClientConfig.md +0 -895
  391. package/docs/api/interfaces/SignalProtocolClientDeleteLocalAttachmentInput.md +0 -25
  392. package/docs/api/interfaces/SignalProtocolClientHooks.md +0 -506
  393. package/docs/api/interfaces/SignalProtocolClientIdentityConfig.md +0 -51
  394. package/docs/api/interfaces/SignalProtocolClientLoadLocalAttachmentInput.md +0 -187
  395. package/docs/api/interfaces/SignalProtocolClientLoadedLocalAttachment.md +0 -19
  396. package/docs/api/interfaces/SignalProtocolClientMedia.md +0 -83
  397. package/docs/api/interfaces/SignalProtocolClientMediaCompletedResult.md +0 -25
  398. package/docs/api/interfaces/SignalProtocolClientMediaConfig.md +0 -157
  399. package/docs/api/interfaces/SignalProtocolClientMediaDownloadCompletedResult.md +0 -37
  400. package/docs/api/interfaces/SignalProtocolClientMediaDownloadNotNeededResult.md +0 -25
  401. package/docs/api/interfaces/SignalProtocolClientMediaFailedResult.md +0 -19
  402. package/docs/api/interfaces/SignalProtocolClientMediaOperationOptions.md +0 -53
  403. package/docs/api/interfaces/SignalProtocolClientMediaPendingResult.md +0 -19
  404. package/docs/api/interfaces/SignalProtocolClientMediaProcessResult.md +0 -43
  405. package/docs/api/interfaces/SignalProtocolClientMediaSkippedResult.md +0 -25
  406. package/docs/api/interfaces/SignalProtocolClientMediaUploadCompletedResult.md +0 -31
  407. package/docs/api/interfaces/SignalProtocolClientProcessPendingMediaOptions.md +0 -87
  408. package/docs/api/interfaces/SignalProtocolClientSaveDownloadedAttachmentInput.md +0 -25
  409. package/docs/api/interfaces/SignalProtocolClientSaveUploadedAttachmentInput.md +0 -25
  410. package/docs/api/interfaces/SignalProtocolClientSyncDeleteInput.md +0 -19
  411. package/docs/api/interfaces/SignalProtocolConfig.md +0 -50
  412. package/docs/api/interfaces/SignalProtocolContentAdapter.md +0 -325
  413. package/docs/api/interfaces/SignalProtocolRemoteObjectStore.md +0 -88
  414. package/docs/api/interfaces/SkippedSenderMessageKey.md +0 -26
  415. package/docs/api/interfaces/TaskNotificationAckSyncInput.md +0 -31
  416. package/docs/api/interfaces/TripleRatchetState.md +0 -64
  417. package/docs/api/interfaces/UserRecord.md +0 -71
  418. package/docs/api/interfaces/UsernameStateSyncInput.md +0 -19
  419. package/docs/api/interfaces/VerificationStateSyncInput.md +0 -31
  420. package/docs/api/interfaces/VersionNegotiationState.md +0 -84
  421. package/docs/api/interfaces/ViewOnceOpenSyncInput.md +0 -19
  422. package/docs/api/namespaces/ProtocolAddress/README.md +0 -33
  423. package/docs/api/namespaces/ProtocolAddress/functions/create.md +0 -41
  424. package/docs/api/namespaces/ProtocolAddress/functions/equals.md +0 -39
  425. package/docs/api/namespaces/ProtocolAddress/functions/fromStorageKey.md +0 -36
  426. package/docs/api/namespaces/ProtocolAddress/functions/isUser.md +0 -39
  427. package/docs/api/namespaces/ProtocolAddress/functions/isValid.md +0 -34
  428. package/docs/api/namespaces/ProtocolAddress/functions/parse.md +0 -41
  429. package/docs/api/namespaces/ProtocolAddress/functions/toStorageKey.md +0 -38
  430. package/docs/api/namespaces/ProtocolAddress/functions/toString.md +0 -34
  431. package/docs/api/namespaces/SessionRecord/README.md +0 -30
  432. package/docs/api/namespaces/SessionRecord/functions/archiveCurrent.md +0 -40
  433. package/docs/api/namespaces/SessionRecord/functions/archiveCurrentState.md +0 -34
  434. package/docs/api/namespaces/SessionRecord/functions/create.md +0 -25
  435. package/docs/api/namespaces/SessionRecord/functions/deserialize.md +0 -29
  436. package/docs/api/namespaces/SessionRecord/functions/findSession.md +0 -34
  437. package/docs/api/namespaces/SessionRecord/functions/getAllSessions.md +0 -25
  438. package/docs/api/namespaces/SessionRecord/functions/getArchivedCount.md +0 -25
  439. package/docs/api/namespaces/SessionRecord/functions/hasCurrentSession.md +0 -25
  440. package/docs/api/namespaces/SessionRecord/functions/hasUsableSenderChain.md +0 -36
  441. package/docs/api/namespaces/SessionRecord/functions/promoteSession.md +0 -34
  442. package/docs/api/namespaces/SessionRecord/functions/serialize.md +0 -28
  443. package/docs/api/namespaces/SessionRecord/variables/MAX_ARCHIVED_SESSIONS.md +0 -14
  444. package/docs/api/namespaces/SessionState/README.md +0 -15
  445. package/docs/api/namespaces/SessionState/functions/getSessionId.md +0 -32
  446. package/docs/api/namespaces/blocking/README.md +0 -43
  447. package/docs/api/namespaces/encoding/README.md +0 -33
  448. package/docs/api/namespaces/encoding/functions/base64ToUrlSafe.md +0 -28
  449. package/docs/api/namespaces/encoding/functions/bytesToBase64.md +0 -21
  450. package/docs/api/namespaces/encoding/functions/bytesToString.md +0 -21
  451. package/docs/api/namespaces/encoding/functions/bytesToUrlSafeBase64.md +0 -33
  452. package/docs/api/namespaces/encoding/functions/concatBytes.md +0 -21
  453. package/docs/api/namespaces/encoding/functions/stringToBytes.md +0 -21
  454. package/docs/api/namespaces/encoding/functions/urlSafeToBase64.md +0 -27
  455. package/docs/api/namespaces/keys/README.md +0 -130
  456. package/docs/api/namespaces/keys/functions/acceptContactIdentityRotation.md +0 -33
  457. package/docs/api/namespaces/keys/functions/assertIdentityCommitment.md +0 -25
  458. package/docs/api/namespaces/keys/functions/canonicalizeDeviceIdentityKey.md +0 -30
  459. package/docs/api/namespaces/keys/functions/compareDeviceIdentityKeys.md +0 -28
  460. package/docs/api/namespaces/keys/functions/compositeIdentitiesEqual.md +0 -23
  461. package/docs/api/namespaces/keys/functions/createCompositeIdentityV1.md +0 -19
  462. package/docs/api/namespaces/keys/functions/createPreKeySignatureContext.md +0 -31
  463. package/docs/api/namespaces/keys/functions/createUnverifiedContactIdentityRecord.md +0 -23
  464. package/docs/api/namespaces/keys/functions/decodeCompositeIdentityV1.md +0 -19
  465. package/docs/api/namespaces/keys/functions/deriveIdentityCommitment.md +0 -19
  466. package/docs/api/namespaces/keys/functions/encodeCompositeIdentityV1.md +0 -19
  467. package/docs/api/namespaces/keys/functions/evaluateContactIdentityCandidate.md +0 -27
  468. package/docs/api/namespaces/keys/functions/generateEcOneTimePreKeys.md +0 -37
  469. package/docs/api/namespaces/keys/functions/generateEcSignedPreKey.md +0 -39
  470. package/docs/api/namespaces/keys/functions/generateEcSignedPreKeyId.md +0 -21
  471. package/docs/api/namespaces/keys/functions/generateIdentityKeyPair.md +0 -24
  472. package/docs/api/namespaces/keys/functions/generateKemOneTimePreKeys.md +0 -47
  473. package/docs/api/namespaces/keys/functions/generateKyberLastResortPreKey.md +0 -37
  474. package/docs/api/namespaces/keys/functions/generateRegistrationId.md +0 -13
  475. package/docs/api/namespaces/keys/functions/isValidDeviceIdentityKey.md +0 -22
  476. package/docs/api/namespaces/keys/functions/signMlKem1024PreKey.md +0 -29
  477. package/docs/api/namespaces/keys/functions/signPreKey.md +0 -31
  478. package/docs/api/namespaces/keys/functions/validateContactIdentityRecord.md +0 -19
  479. package/docs/api/namespaces/keys/functions/verifyContactIdentityRecord.md +0 -31
  480. package/docs/api/namespaces/keys/functions/verifyMlKem1024PreKey.md +0 -33
  481. package/docs/api/namespaces/keys/functions/verifyPreKeySignature.md +0 -35
  482. package/docs/api/namespaces/keys/interfaces/CompositeIdentityV1.md +0 -33
  483. package/docs/api/namespaces/keys/interfaces/ContactIdentityRecord.md +0 -53
  484. package/docs/api/namespaces/keys/interfaces/KemOneTimePreKey.md +0 -43
  485. package/docs/api/namespaces/keys/type-aliases/IdentityCandidateStatus.md +0 -9
  486. package/docs/api/namespaces/keys/type-aliases/IdentityTrustState.md +0 -9
  487. package/docs/api/namespaces/keys/type-aliases/IdentityType.md +0 -9
  488. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_ED25519_TAG.md +0 -9
  489. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_LENGTH.md +0 -9
  490. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_VERSION.md +0 -9
  491. package/docs/api/namespaces/keys/variables/COMPOSITE_IDENTITY_V1_X25519_TAG.md +0 -9
  492. package/docs/api/namespaces/keys/variables/IDENTITY_COMMITMENT_V1_DOMAIN.md +0 -9
  493. package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_ML_KEM_1024.md +0 -9
  494. package/docs/api/namespaces/keys/variables/PREKEY_ALGORITHM_X25519.md +0 -9
  495. package/docs/api/namespaces/keys/variables/PREKEY_SIGNATURE_V1_DOMAIN.md +0 -9
  496. package/docs/api/namespaces/keys/variables/UNPINNED_DEVICE_IDENTITY_KEY.md +0 -18
  497. package/docs/api/namespaces/media/README.md +0 -105
  498. package/docs/api/namespaces/media/classes/MediaAttachmentError.md +0 -57
  499. package/docs/api/namespaces/media/functions/createByteRangeMediaAttachmentTransfer.md +0 -19
  500. package/docs/api/namespaces/media/functions/createMediaAttachmentDeliveryId.md +0 -29
  501. package/docs/api/namespaces/media/functions/createMediaAttachmentId.md +0 -19
  502. package/docs/api/namespaces/media/functions/createMediaAttachmentMessage.md +0 -25
  503. package/docs/api/namespaces/media/functions/createMediaAttachmentPointer.md +0 -19
  504. package/docs/api/namespaces/media/functions/createTusMediaAttachmentTransfer.md +0 -19
  505. package/docs/api/namespaces/media/functions/deleteMediaAttachment.md +0 -23
  506. package/docs/api/namespaces/media/functions/executeMediaAttachmentJob.md +0 -23
  507. package/docs/api/namespaces/media/functions/isMediaAttachmentFlagSet.md +0 -19
  508. package/docs/api/namespaces/media/functions/parseMediaAttachmentMessage.md +0 -19
  509. package/docs/api/namespaces/media/functions/planMediaAttachmentCleanup.md +0 -23
  510. package/docs/api/namespaces/media/functions/planMediaAttachmentCleanupJobs.md +0 -19
  511. package/docs/api/namespaces/media/functions/planMediaAttachmentDeleteSync.md +0 -19
  512. package/docs/api/namespaces/media/functions/planMediaAttachmentDownloadJob.md +0 -19
  513. package/docs/api/namespaces/media/functions/planMediaAttachmentOpen.md +0 -19
  514. package/docs/api/namespaces/media/functions/planMediaAttachmentProcessing.md +0 -19
  515. package/docs/api/namespaces/media/functions/planMediaAttachmentUploadJob.md +0 -19
  516. package/docs/api/namespaces/media/functions/prepareMediaAttachmentUpload.md +0 -30
  517. package/docs/api/namespaces/media/functions/resolveMediaAttachment.md +0 -30
  518. package/docs/api/namespaces/media/functions/serializeMediaAttachmentMessage.md +0 -25
  519. package/docs/api/namespaces/media/functions/validateMediaAttachmentPolicy.md +0 -23
  520. package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentPartialStore.md +0 -68
  521. package/docs/api/namespaces/media/interfaces/ByteRangeMediaAttachmentTransferOptions.md +0 -91
  522. package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentOptions.md +0 -25
  523. package/docs/api/namespaces/media/interfaces/DeleteMediaAttachmentResult.md +0 -19
  524. package/docs/api/namespaces/media/interfaces/ExecuteMediaAttachmentJobOptions.md +0 -157
  525. package/docs/api/namespaces/media/interfaces/MediaAttachmentBackgroundJob.md +0 -85
  526. package/docs/api/namespaces/media/interfaces/MediaAttachmentCleanupPlan.md +0 -37
  527. package/docs/api/namespaces/media/interfaces/MediaAttachmentJobExecutionResult.md +0 -55
  528. package/docs/api/namespaces/media/interfaces/MediaAttachmentMessage.md +0 -31
  529. package/docs/api/namespaces/media/interfaces/MediaAttachmentOpenDecision.md +0 -31
  530. package/docs/api/namespaces/media/interfaces/MediaAttachmentPointer.md +0 -133
  531. package/docs/api/namespaces/media/interfaces/MediaAttachmentPolicy.md +0 -67
  532. package/docs/api/namespaces/media/interfaces/MediaAttachmentProcessingPlan.md +0 -73
  533. package/docs/api/namespaces/media/interfaces/MediaAttachmentProgress.md +0 -69
  534. package/docs/api/namespaces/media/interfaces/MediaAttachmentResumeState.md +0 -37
  535. package/docs/api/namespaces/media/interfaces/MediaAttachmentRetryOptions.md +0 -31
  536. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransfer.md +0 -51
  537. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferCheckpoint.md +0 -69
  538. package/docs/api/namespaces/media/interfaces/MediaAttachmentTransferOptions.md +0 -67
  539. package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadJobData.md +0 -19
  540. package/docs/api/namespaces/media/interfaces/MediaAttachmentUploadResponse.md +0 -25
  541. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentCleanupJobsInput.md +0 -61
  542. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDeleteSyncInput.md +0 -25
  543. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentDownloadJobInput.md +0 -161
  544. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentOpenInput.md +0 -25
  545. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentProcessingInput.md +0 -83
  546. package/docs/api/namespaces/media/interfaces/PlanMediaAttachmentUploadJobInput.md +0 -147
  547. package/docs/api/namespaces/media/interfaces/PrepareMediaAttachmentUploadOptions.md +0 -144
  548. package/docs/api/namespaces/media/interfaces/ResolveMediaAttachmentOptions.md +0 -55
  549. package/docs/api/namespaces/media/interfaces/ResolvedMediaAttachment.md +0 -109
  550. package/docs/api/namespaces/media/interfaces/TusMediaAttachmentTransferOptions.md +0 -85
  551. package/docs/api/namespaces/media/type-aliases/CreateMediaAttachmentPointerInput.md +0 -15
  552. package/docs/api/namespaces/media/type-aliases/MediaAttachmentCheckpointCallback.md +0 -19
  553. package/docs/api/namespaces/media/type-aliases/MediaAttachmentCleanupReason.md +0 -9
  554. package/docs/api/namespaces/media/type-aliases/MediaAttachmentErrorCode.md +0 -9
  555. package/docs/api/namespaces/media/type-aliases/MediaAttachmentFlag.md +0 -9
  556. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobExecutionStatus.md +0 -9
  557. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobOperation.md +0 -9
  558. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobPriority.md +0 -9
  559. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSkipReason.md +0 -9
  560. package/docs/api/namespaces/media/type-aliases/MediaAttachmentJobSource.md +0 -9
  561. package/docs/api/namespaces/media/type-aliases/MediaAttachmentKnownIds.md +0 -9
  562. package/docs/api/namespaces/media/type-aliases/MediaAttachmentMessageType.md +0 -9
  563. package/docs/api/namespaces/media/type-aliases/MediaAttachmentProgressCallback.md +0 -19
  564. package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_DEFAULTS.md +0 -47
  565. package/docs/api/namespaces/media/variables/MEDIA_ATTACHMENT_POLICY_PRESETS.md +0 -95
  566. package/docs/api/namespaces/media/variables/MediaAttachmentCleanupReason.md +0 -27
  567. package/docs/api/namespaces/media/variables/MediaAttachmentErrorCode.md +0 -75
  568. package/docs/api/namespaces/media/variables/MediaAttachmentFlag.md +0 -23
  569. package/docs/api/namespaces/media/variables/MediaAttachmentJobExecutionStatus.md +0 -19
  570. package/docs/api/namespaces/media/variables/MediaAttachmentJobOperation.md +0 -31
  571. package/docs/api/namespaces/media/variables/MediaAttachmentJobPriority.md +0 -23
  572. package/docs/api/namespaces/media/variables/MediaAttachmentJobSource.md +0 -51
  573. package/docs/api/namespaces/media/variables/MediaAttachmentMessageType.md +0 -15
  574. package/docs/api/namespaces/media/variables/downloadMediaAttachment.md +0 -30
  575. package/docs/api/namespaces/safety/README.md +0 -61
  576. package/docs/api/namespaces/safety/classes/DisplayableFingerprint.md +0 -108
  577. package/docs/api/namespaces/safety/classes/Fingerprint.md +0 -104
  578. package/docs/api/namespaces/safety/classes/ScannableFingerprint.md +0 -209
  579. package/docs/api/namespaces/safety/functions/base64ToBytes.md +0 -21
  580. package/docs/api/namespaces/safety/functions/clearFingerprintCache.md +0 -15
  581. package/docs/api/namespaces/safety/functions/compareSafetyNumbers.md +0 -25
  582. package/docs/api/namespaces/safety/functions/createFingerprintData.md +0 -60
  583. package/docs/api/namespaces/safety/functions/extractQrData.md +0 -34
  584. package/docs/api/namespaces/safety/functions/generateCompositeSafetyNumber.md +0 -39
  585. package/docs/api/namespaces/safety/functions/generateEmojiFingerprint.md +0 -24
  586. package/docs/api/namespaces/safety/functions/generateSingleKeyReferenceSafetyNumber.md +0 -51
  587. package/docs/api/namespaces/safety/functions/generateVerifySchemeUrl.md +0 -32
  588. package/docs/api/namespaces/safety/functions/generateVerifyUrl.md +0 -49
  589. package/docs/api/namespaces/safety/functions/isValidSafetyNumber.md +0 -21
  590. package/docs/api/namespaces/safety/functions/isVerifyUrl.md +0 -45
  591. package/docs/api/namespaces/safety/functions/parseVerifyUrl.md +0 -31
  592. package/docs/api/namespaces/safety/interfaces/FingerprintData.md +0 -52
  593. package/docs/api/namespaces/safety/interfaces/SafetyNumber.md +0 -49
  594. package/docs/api/namespaces/safety/interfaces/VerifyLinkConfig.md +0 -28
  595. package/docs/api/namespaces/safety/interfaces/VerifyUrlParams.md +0 -49
  596. package/docs/api/namespaces/safety/type-aliases/CompareResult.md +0 -21
  597. package/docs/api/namespaces/safety/variables/DEFAULT_VERIFY_LINK_CONFIG.md +0 -12
  598. package/docs/api/namespaces/safety/variables/FINGERPRINT_ITERATIONS.md +0 -12
  599. package/docs/api/namespaces/safety/variables/FINGERPRINT_VERSION.md +0 -12
  600. package/docs/api/namespaces/safety/variables/VERIFY_BASE_URL.md +0 -11
  601. package/docs/api/namespaces/safety/variables/VERIFY_SCHEME_URL.md +0 -11
  602. package/docs/api/type-aliases/Base64.md +0 -20
  603. package/docs/api/type-aliases/BraidPolicy.md +0 -11
  604. package/docs/api/type-aliases/Bytes.md +0 -20
  605. package/docs/api/type-aliases/Ciphertext.md +0 -21
  606. package/docs/api/type-aliases/DeviceType.md +0 -11
  607. package/docs/api/type-aliases/DownloadedAttachment.md +0 -11
  608. package/docs/api/type-aliases/GroupId.md +0 -27
  609. package/docs/api/type-aliases/Hex.md +0 -20
  610. package/docs/api/type-aliases/HookName.md +0 -11
  611. package/docs/api/type-aliases/PostQuantumPolicy.md +0 -11
  612. package/docs/api/type-aliases/PreparedAttachmentUpload.md +0 -14
  613. package/docs/api/type-aliases/PrivateKey.md +0 -22
  614. package/docs/api/type-aliases/ProgressCallback.md +0 -45
  615. package/docs/api/type-aliases/PublicKey.md +0 -22
  616. package/docs/api/type-aliases/RemoteObjectCompleteUploadRequest.md +0 -19
  617. package/docs/api/type-aliases/RemoteObjectDeleteRequest.md +0 -19
  618. package/docs/api/type-aliases/RemoteObjectDownloadRequest.md +0 -19
  619. package/docs/api/type-aliases/RemoteObjectUploadRequest.md +0 -42
  620. package/docs/api/type-aliases/SCKAMode.md +0 -11
  621. package/docs/api/type-aliases/SealedSenderAuth.md +0 -15
  622. package/docs/api/type-aliases/SignalProtocolClientMediaCleanupInput.md +0 -9
  623. package/docs/api/type-aliases/SignalProtocolClientMediaCleanupResult.md +0 -9
  624. package/docs/api/type-aliases/SignalProtocolClientMediaDownloadInput.md +0 -9
  625. package/docs/api/type-aliases/SignalProtocolClientMediaDownloadResult.md +0 -9
  626. package/docs/api/type-aliases/SignalProtocolClientMediaOperationResult.md +0 -9
  627. package/docs/api/type-aliases/SignalProtocolClientMediaUploadInput.md +0 -9
  628. package/docs/api/type-aliases/SignalProtocolClientMediaUploadResult.md +0 -9
  629. package/docs/api/type-aliases/Signature.md +0 -21
  630. package/docs/api/type-aliases/Unsubscribe.md +0 -15
  631. package/docs/api/variables/BraidPolicy.md +0 -21
  632. package/docs/api/variables/DEFAULT_DEVICE_ID.md +0 -12
  633. package/docs/api/variables/DOUBLE_RATCHET_SPEC.md +0 -11
  634. package/docs/api/variables/GROUP_ID_PREFIX.md +0 -11
  635. package/docs/api/variables/GROUP_TRUST_ROOT_VERSION.md +0 -11
  636. package/docs/api/variables/KEY_REFRESH_INTERVAL_MS_DEFAULT.md +0 -11
  637. package/docs/api/variables/MAX_MESSAGE_KEYS.md +0 -14
  638. package/docs/api/variables/MAX_PREKEY_AGE_MS_DEFAULT.md +0 -11
  639. package/docs/api/variables/MAX_RECEIVER_CHAINS.md +0 -14
  640. package/docs/api/variables/MAX_REGISTRATION_ID.md +0 -16
  641. package/docs/api/variables/MAX_SKIP.md +0 -11
  642. package/docs/api/variables/MESSAGE_FORMAT.md +0 -11
  643. package/docs/api/variables/MIN_REGISTRATION_ID.md +0 -16
  644. package/docs/api/variables/ML_KEM_BRAID_SPEC.md +0 -11
  645. package/docs/api/variables/ONE_TIME_PREKEY_BATCH_SIZE.md +0 -21
  646. package/docs/api/variables/PQXDH_SPEC.md +0 -11
  647. package/docs/api/variables/PostQuantumPolicy.md +0 -21
  648. package/docs/api/variables/SENDER_KEY_FORMAT.md +0 -11
  649. package/docs/api/variables/SENDER_KEY_SPEC.md +0 -11
  650. package/docs/api/variables/SESAME_SPEC.md +0 -11
  651. package/docs/api/variables/SESSION_FORMAT.md +0 -11
  652. package/docs/api/variables/SPQR_LIMITS_DEFAULTS.md +0 -11
  653. package/docs/api/variables/X3DH_SPEC.md +0 -9
  654. package/docs/api/variables/defaultSignalProtocolLogger.md +0 -32
  655. package/remote/relay/convex/server/README.md +0 -146
@@ -1,150 +0,0 @@
1
- import { type GenericDataModel, type GenericMutationCtx } from 'convex/server';
2
- import { type GroupServerEngineRuntime } from '../../../internal/groups/server-engine.js';
3
- import { type ServerSecretParams } from '../../../internal/protocol/zk/groups/server-params.js';
4
- /** Convex environment variable containing the deployment's base64 32-byte seed. */
5
- export declare const CONVEX_GROUP_SERVER_SECRET_ENV_VAR = "OE_GROUPS_SERVER_SECRET";
6
- /**
7
- * Tables owned by `defineConvexGroupServer`.
8
- *
9
- * Spread this object into the application's `defineSchema` call. The names are
10
- * package-scoped so the enforcing server can be mounted without app callbacks.
11
- */
12
- export declare const convexGroupServerTables: {
13
- oeGroupServerGroups: import("convex/server").TableDefinition<import("convex/values").VObject<{
14
- encryptedState: ArrayBuffer;
15
- groupId: string;
16
- version: number;
17
- }, {
18
- groupId: import("convex/values").VString<string, "required">;
19
- encryptedState: import("convex/values").VBytes<ArrayBuffer, "required">;
20
- version: import("convex/values").VFloat64<number, "required">;
21
- }, "required", "encryptedState" | "groupId" | "version">, {
22
- by_group_id: ["groupId", "_creationTime"];
23
- }, {}, {}>;
24
- oeGroupServerChanges: import("convex/server").TableDefinition<import("convex/values").VObject<{
25
- actions: ArrayBuffer;
26
- changeEpoch: number;
27
- groupId: string;
28
- serverSignature: ArrayBuffer;
29
- timestamp: number;
30
- version: number;
31
- }, {
32
- groupId: import("convex/values").VString<string, "required">;
33
- version: import("convex/values").VFloat64<number, "required">;
34
- actions: import("convex/values").VBytes<ArrayBuffer, "required">;
35
- serverSignature: import("convex/values").VBytes<ArrayBuffer, "required">;
36
- changeEpoch: import("convex/values").VFloat64<number, "required">;
37
- timestamp: import("convex/values").VFloat64<number, "required">;
38
- }, "required", "actions" | "changeEpoch" | "groupId" | "serverSignature" | "timestamp" | "version">, {
39
- by_group_id_version: ["groupId", "version", "_creationTime"];
40
- }, {}, {}>;
41
- oeGroupServerSnapshots: import("convex/server").TableDefinition<import("convex/values").VObject<{
42
- baselineSignature: ArrayBuffer;
43
- encryptedState: ArrayBuffer;
44
- groupId: string;
45
- version: number;
46
- }, {
47
- groupId: import("convex/values").VString<string, "required">;
48
- version: import("convex/values").VFloat64<number, "required">;
49
- encryptedState: import("convex/values").VBytes<ArrayBuffer, "required">;
50
- baselineSignature: import("convex/values").VBytes<ArrayBuffer, "required">;
51
- }, "required", "baselineSignature" | "encryptedState" | "groupId" | "version">, {
52
- by_group_id_version: ["groupId", "version", "_creationTime"];
53
- }, {}, {}>;
54
- };
55
- export interface ConvexGroupServerIdentity {
56
- /** Raw 16-byte ACI UUID. */
57
- aciBytes: Uint8Array;
58
- /** Raw 16-byte PNI UUID, absent when the deployment has no PNI concept. */
59
- pniBytes?: Uint8Array;
60
- }
61
- export interface DefineConvexGroupServerConfig<Context = GenericMutationCtx<GenericDataModel>> {
62
- /**
63
- * Resolve the authenticated app session to protocol identifiers.
64
- *
65
- * This hook is used only by credential issuance. Anonymous group operations
66
- * authenticate exclusively through their zero-knowledge presentation.
67
- */
68
- identify(ctx: Context): Promise<ConvexGroupServerIdentity>;
69
- }
70
- interface InternalDefineConvexGroupServerConfig<Context> extends DefineConvexGroupServerConfig<Context> {
71
- secretParams?: ServerSecretParams;
72
- runtime?: GroupServerEngineRuntime;
73
- }
74
- declare function buildConvexGroupServer<Context>(config: InternalDefineConvexGroupServerConfig<Context>): {
75
- createGroup: import("convex/server").RegisteredMutation<"public", {
76
- encryptedState: ArrayBuffer;
77
- groupId: ArrayBuffer;
78
- groupPublicParams: ArrayBuffer;
79
- presentation: ArrayBuffer;
80
- }, Promise<null>>;
81
- getGroup: import("convex/server").RegisteredQuery<"public", {
82
- groupId: ArrayBuffer;
83
- groupPublicParams: ArrayBuffer;
84
- presentation: ArrayBuffer;
85
- version?: number | undefined;
86
- }, Promise<{
87
- encryptedState: ArrayBuffer;
88
- version: number;
89
- baselineSignature: ArrayBuffer;
90
- } | null>>;
91
- getGroupJoinInfo: import("convex/server").RegisteredQuery<"public", {
92
- groupId: ArrayBuffer;
93
- groupPublicParams: ArrayBuffer;
94
- inviteLinkPassword: ArrayBuffer;
95
- presentation: ArrayBuffer;
96
- }, Promise<{
97
- encryptedJoinInfo: ArrayBuffer;
98
- version: number;
99
- } | null>>;
100
- getGroupChanges: import("convex/server").RegisteredQuery<"public", {
101
- fromVersion: number;
102
- groupId: ArrayBuffer;
103
- groupPublicParams: ArrayBuffer;
104
- presentation: ArrayBuffer;
105
- }, Promise<{
106
- version: number;
107
- actions: ArrayBuffer;
108
- serverSignature: ArrayBuffer;
109
- changeEpoch: number;
110
- timestamp: number;
111
- }[]>>;
112
- submitGroupChange: import("convex/server").RegisteredMutation<"public", {
113
- actions: ArrayBuffer;
114
- expectedVersion: number;
115
- groupId: ArrayBuffer;
116
- groupPublicParams: ArrayBuffer;
117
- inviteLinkPassword: ArrayBuffer;
118
- presentation: ArrayBuffer;
119
- }, Promise<{
120
- version: number;
121
- actions: ArrayBuffer;
122
- serverSignature: ArrayBuffer;
123
- changeEpoch: number;
124
- timestamp: number;
125
- }>>;
126
- refreshGroupSendEndorsements: import("convex/server").RegisteredMutation<"public", {
127
- groupId: ArrayBuffer;
128
- groupPublicParams: ArrayBuffer;
129
- presentation: ArrayBuffer;
130
- }, Promise<{
131
- endorsements: ArrayBuffer;
132
- expiration: number;
133
- }>>;
134
- issueAuthCredentialMutation: import("convex/server").RegisteredMutation<"public", {}, Promise<ArrayBuffer>>;
135
- issueProfileKeyCredentialMutation: import("convex/server").RegisteredMutation<"public", {
136
- profileKey: ArrayBuffer;
137
- }, Promise<ArrayBuffer>>;
138
- };
139
- /**
140
- * Define the production Convex group-server functions.
141
- *
142
- * The returned registered functions own S1–S14 enforcement and persistence.
143
- * The application supplies only the app-auth-to-protocol-identity hook used
144
- * by the two credential issuance mutations.
145
- */
146
- type ConvexGroupServerHandlers = ReturnType<typeof buildConvexGroupServer>;
147
- export declare function defineConvexGroupServer(config: DefineConvexGroupServerConfig): ConvexGroupServerHandlers;
148
- export declare function defineConvexGroupServer<Context>(config: DefineConvexGroupServerConfig<Context>): ConvexGroupServerHandlers;
149
- export {};
150
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../remote/relay/convex/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,eAAe,CAAC;AAMvB,OAAO,EAEL,KAAK,wBAAwB,EAG9B,MAAM,wCAAwC,CAAC;AAOhD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,oDAAoD,CAAC;AAyB5D,mFAAmF;AACnF,eAAO,MAAM,kCAAkC,4BACpB,CAAC;AAQ5B;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoBnC,CAAC;AAWF,MAAM,WAAW,yBAAyB;IACxC,4BAA4B;IAC5B,QAAQ,EAAE,UAAU,CAAC;IACrB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B,CAC5C,OAAO,GAAG,kBAAkB,CAAC,gBAAgB,CAAC;IAE9C;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CAC5D;AAED,UAAU,qCAAqC,CAAC,OAAO,CACrD,SAAQ,6BAA6B,CAAC,OAAO,CAAC;IAC9C,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC;AAmUD,iBAAS,sBAAsB,CAAC,OAAO,EACrC,MAAM,EAAE,qCAAqC,CAAC,OAAO,CAAC;IAOpD,WAAW;;;;;;IA+CX,QAAQ;;;;;;;;;;IAoCR,gBAAgB;;;;;;;;;IAuChB,eAAe;;;;;;;;;;;;IAsCf,iBAAiB;;;;;;;;;;;;;;IA0DjB,4BAA4B;;;;;;;;IAkD5B,2BAA2B;IAsB3B,iCAAiC;;;EAyBpC;AAED;;;;;;GAMG;AACH,KAAK,yBAAyB,GAAG,UAAU,CACzC,OAAO,sBAAsB,CAC9B,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,6BAA6B,GACpC,yBAAyB,CAAC;AAC7B,wBAAgB,uBAAuB,CAAC,OAAO,EAC7C,MAAM,EAAE,6BAA6B,CAAC,OAAO,CAAC,GAC7C,yBAAyB,CAAC"}
@@ -1,506 +0,0 @@
1
- import { defineTable, mutationGeneric, queryGeneric, } from 'convex/server';
2
- import { ConvexError, v } from 'convex/values';
3
- import { GroupAuthorizationServerEngine, } from '../../../internal/groups/server-engine.js';
4
- import { deserializeEncryptedGroup } from '../../../internal/groups/wire.js';
5
- import { base64ToBytes, bytesToBase64, } from '../../../internal/crypto/utils.js';
6
- import { asBase64 } from '../../../types/utils.js';
7
- import { generateServerSecretParams, } from '../../../internal/protocol/zk/groups/server-params.js';
8
- import { issueAuthCredential, serializeAuthCredentialResponse, } from '../../../internal/protocol/zk/groups/auth-credential.js';
9
- import { issueProfileKeyCredential, serializeProfileKeyCredentialResponse, } from '../../../internal/protocol/zk/groups/profile-key-credential.js';
10
- import { SERVICE_ID_ACI, SERVICE_ID_PNI, } from '../../../internal/protocol/zk/groups/uid-struct.js';
11
- import { SECONDS_PER_DAY } from '../../../internal/protocol/zk/groups/group-params.js';
12
- import { defaultExpiration, deriveForExpiration, issueEndorsements, serializeEndorsementsResponse, } from '../../../internal/protocol/zk/groups/group-send-endorsement.js';
13
- import { UidEncryptionDomain } from '../../../internal/protocol/zk/groups/uid-encryption.js';
14
- import { Ciphertext } from '../../../internal/protocol/zk/credentials/attributes.js';
15
- import { RistrettoPoint } from '../../../internal/protocol/zk/proofs/sho.js';
16
- /** Convex environment variable containing the deployment's base64 32-byte seed. */
17
- export const CONVEX_GROUP_SERVER_SECRET_ENV_VAR = 'OE_GROUPS_SERVER_SECRET';
18
- const GROUPS_TABLE = 'oeGroupServerGroups';
19
- const CHANGES_TABLE = 'oeGroupServerChanges';
20
- const SNAPSHOTS_TABLE = 'oeGroupServerSnapshots';
21
- const UUID_LENGTH = 16;
22
- const PROFILE_KEY_LENGTH = 32;
23
- /**
24
- * Tables owned by `defineConvexGroupServer`.
25
- *
26
- * Spread this object into the application's `defineSchema` call. The names are
27
- * package-scoped so the enforcing server can be mounted without app callbacks.
28
- */
29
- export const convexGroupServerTables = {
30
- [GROUPS_TABLE]: defineTable({
31
- groupId: v.string(),
32
- encryptedState: v.bytes(),
33
- version: v.number(),
34
- }).index('by_group_id', ['groupId']),
35
- [CHANGES_TABLE]: defineTable({
36
- groupId: v.string(),
37
- version: v.number(),
38
- actions: v.bytes(),
39
- serverSignature: v.bytes(),
40
- changeEpoch: v.number(),
41
- timestamp: v.number(),
42
- }).index('by_group_id_version', ['groupId', 'version']),
43
- [SNAPSHOTS_TABLE]: defineTable({
44
- groupId: v.string(),
45
- version: v.number(),
46
- encryptedState: v.bytes(),
47
- baselineSignature: v.bytes(),
48
- }).index('by_group_id_version', ['groupId', 'version']),
49
- };
50
- const changeResultValidator = v.object({
51
- version: v.number(),
52
- actions: v.bytes(),
53
- serverSignature: v.bytes(),
54
- changeEpoch: v.number(),
55
- timestamp: v.number(),
56
- });
57
- const snapshotResultValidator = v.object({
58
- encryptedState: v.bytes(),
59
- version: v.number(),
60
- baselineSignature: v.bytes(),
61
- });
62
- function toUint8Array(value) {
63
- return new Uint8Array(value);
64
- }
65
- function toArrayBuffer(value) {
66
- return value.buffer.slice(value.byteOffset, value.byteOffset + value.byteLength);
67
- }
68
- function groupIdKey(groupId) {
69
- return Array.from(groupId, (byte) => byte.toString(16).padStart(2, '0')).join('');
70
- }
71
- function authorization(input) {
72
- return {
73
- presentation: toUint8Array(input.presentation),
74
- groupPublicParams: toUint8Array(input.groupPublicParams),
75
- };
76
- }
77
- function defaultConvexRuntime() {
78
- return {
79
- now: () => Date.now(),
80
- randomBytes: (length) => crypto.getRandomValues(new Uint8Array(length)),
81
- };
82
- }
83
- /**
84
- * Derived server parameters, cached per isolate and keyed by the exact
85
- * environment value so a rotated secret is picked up on the next request.
86
- * Derivation costs tens of milliseconds; without the cache every query and
87
- * mutation would pay it before doing any work.
88
- */
89
- let cachedSecretParams = null;
90
- function secretParamsFromEnvironment() {
91
- const encoded = process.env[CONVEX_GROUP_SERVER_SECRET_ENV_VAR];
92
- if (!encoded) {
93
- throw new Error(`${CONVEX_GROUP_SERVER_SECRET_ENV_VAR} is not configured; run npx oe-groups trust-root before deploying the group server`);
94
- }
95
- if (cachedSecretParams && cachedSecretParams.encoded === encoded) {
96
- return cachedSecretParams.params;
97
- }
98
- let seed;
99
- try {
100
- seed = base64ToBytes(asBase64(encoded));
101
- }
102
- catch {
103
- throw new Error(`${CONVEX_GROUP_SERVER_SECRET_ENV_VAR} must be canonical base64`);
104
- }
105
- try {
106
- if (seed.length !== 32) {
107
- throw new Error(`${CONVEX_GROUP_SERVER_SECRET_ENV_VAR} must decode to exactly 32 bytes`);
108
- }
109
- if (bytesToBase64(seed) !== encoded) {
110
- throw new Error(`${CONVEX_GROUP_SERVER_SECRET_ENV_VAR} must be canonical base64`);
111
- }
112
- const params = generateServerSecretParams(seed);
113
- cachedSecretParams = { encoded, params };
114
- return params;
115
- }
116
- finally {
117
- seed.fill(0);
118
- }
119
- }
120
- function requireUuid(value, label) {
121
- if (!(value instanceof Uint8Array) || value.length !== UUID_LENGTH) {
122
- throw new Error(`${label} must be a ${UUID_LENGTH}-byte UUID`);
123
- }
124
- if (value.every((byte) => byte === 0)) {
125
- throw new Error(`${label} must not be the nil UUID`);
126
- }
127
- return value;
128
- }
129
- function requireProfileKey(value) {
130
- const profileKey = toUint8Array(value);
131
- if (profileKey.length !== PROFILE_KEY_LENGTH) {
132
- throw new Error(`profileKey must be ${PROFILE_KEY_LENGTH} bytes`);
133
- }
134
- return profileKey;
135
- }
136
- /**
137
- * Translate an engine rejection into a `ConvexError` so its structured
138
- * `{ code, status }` data survives serialization to real deployments.
139
- * Production Convex strips custom properties (including `data`) from plain
140
- * `Error`s and replaces their messages with a generic server error; only
141
- * `ConvexError` payloads reach the client, and the client's VERSION_CONFLICT
142
- * rebase-and-retry loop depends on reading `error.data.code`.
143
- */
144
- async function translateEngineErrors(operation) {
145
- try {
146
- return await operation();
147
- }
148
- catch (error) {
149
- if (!(error instanceof ConvexError) && error instanceof Error) {
150
- const data = error
151
- .data;
152
- if (data !== null &&
153
- typeof data === 'object' &&
154
- typeof data.code === 'string' &&
155
- typeof data.status === 'number') {
156
- throw new ConvexError({
157
- code: data.code,
158
- status: data.status,
159
- message: error.message,
160
- });
161
- }
162
- }
163
- throw error;
164
- }
165
- }
166
- function serviceIds(identity) {
167
- if (identity === null || typeof identity !== 'object') {
168
- throw new ConvexError({
169
- code: 'UNAUTHORIZED',
170
- status: 401,
171
- message: 'identify() returned no identity',
172
- });
173
- }
174
- const aci = {
175
- kind: SERVICE_ID_ACI,
176
- uuid: requireUuid(identity.aciBytes, 'identify().aciBytes'),
177
- };
178
- const pni = identity.pniBytes === undefined
179
- ? undefined
180
- : {
181
- kind: SERVICE_ID_PNI,
182
- uuid: requireUuid(identity.pniBytes, 'identify().pniBytes'),
183
- };
184
- return { aci, pni };
185
- }
186
- async function getGroupDocument(ctx, key) {
187
- return await ctx.db
188
- .query(GROUPS_TABLE)
189
- .withIndex('by_group_id', (query) => query.eq('groupId', key))
190
- .unique();
191
- }
192
- async function getSnapshotDocument(ctx, key, version) {
193
- return await ctx.db
194
- .query(SNAPSHOTS_TABLE)
195
- // The generic data model loses the chained index-range builder type;
196
- // the runtime builder supports the full compound range.
197
- .withIndex('by_group_id_version', (query) => query.eq('groupId', key).eq('version', version))
198
- .unique();
199
- }
200
- function persistedSnapshot(document) {
201
- return {
202
- version: document.version,
203
- encryptedState: toUint8Array(document.encryptedState),
204
- baselineSignature: toUint8Array(document.baselineSignature),
205
- };
206
- }
207
- async function loadEngine(ctx, groupId, secretParams, runtime, options = {}) {
208
- const engine = new GroupAuthorizationServerEngine(secretParams, runtime);
209
- const key = groupIdKey(groupId);
210
- const groupDocument = await getGroupDocument(ctx, key);
211
- if (!groupDocument)
212
- return { engine, groupDocument: null };
213
- const snapshots = [];
214
- for (const version of new Set(options.snapshotVersions ?? [])) {
215
- const snapshot = await getSnapshotDocument(ctx, key, version);
216
- if (snapshot)
217
- snapshots.push(persistedSnapshot(snapshot));
218
- }
219
- const changes = [];
220
- if (options.changesAfterVersion !== undefined) {
221
- const documents = await ctx.db
222
- .query(CHANGES_TABLE)
223
- // The generic data model loses the chained index-range builder type;
224
- // the runtime builder supports the full compound range.
225
- .withIndex('by_group_id_version', (query) => query
226
- .eq('groupId', key)
227
- .gt('version', options.changesAfterVersion))
228
- .order('asc')
229
- .collect();
230
- for (const document of documents) {
231
- changes.push({
232
- version: document.version,
233
- actions: toUint8Array(document.actions),
234
- serverSignature: toUint8Array(document.serverSignature),
235
- changeEpoch: document.changeEpoch,
236
- timestamp: document.timestamp,
237
- });
238
- const snapshot = await getSnapshotDocument(ctx, key, document.version);
239
- if (!snapshot) {
240
- throw new Error(`Missing group snapshot ${document.version}`);
241
- }
242
- snapshots.push(persistedSnapshot(snapshot));
243
- }
244
- }
245
- const persisted = {
246
- encryptedState: toUint8Array(groupDocument.encryptedState),
247
- changes,
248
- snapshots,
249
- };
250
- engine.restoreGroup(groupId, persisted);
251
- return { engine, groupDocument };
252
- }
253
- async function insertSnapshot(ctx, key, snapshot) {
254
- await ctx.db.insert(SNAPSHOTS_TABLE, {
255
- groupId: key,
256
- version: snapshot.version,
257
- encryptedState: toArrayBuffer(snapshot.encryptedState),
258
- baselineSignature: toArrayBuffer(snapshot.baselineSignature),
259
- });
260
- }
261
- async function insertChange(ctx, key, change) {
262
- await ctx.db.insert(CHANGES_TABLE, {
263
- groupId: key,
264
- version: change.version,
265
- actions: toArrayBuffer(change.actions),
266
- serverSignature: toArrayBuffer(change.serverSignature),
267
- changeEpoch: change.changeEpoch,
268
- timestamp: change.timestamp,
269
- });
270
- }
271
- function memberCiphertexts(encryptedState) {
272
- const state = deserializeEncryptedGroup(encryptedState);
273
- return state.members.map((member) => {
274
- if (member.userId.length !== 65) {
275
- throw new Error('Stored member identifier must be 65 bytes');
276
- }
277
- return new Ciphertext(RistrettoPoint.fromBytes(member.userId.slice(1, 33)), RistrettoPoint.fromBytes(member.userId.slice(33, 65)), UidEncryptionDomain);
278
- });
279
- }
280
- function buildConvexGroupServer(config) {
281
- const runtime = config.runtime ?? defaultConvexRuntime();
282
- const getSecretParams = () => config.secretParams ?? secretParamsFromEnvironment();
283
- return {
284
- createGroup: mutationGeneric({
285
- args: {
286
- groupId: v.bytes(),
287
- encryptedState: v.bytes(),
288
- presentation: v.bytes(),
289
- groupPublicParams: v.bytes(),
290
- },
291
- returns: v.null(),
292
- handler: async (ctx, input) => {
293
- const groupId = toUint8Array(input.groupId);
294
- const secretParams = getSecretParams();
295
- const { engine, groupDocument } = await loadEngine(ctx, groupId, secretParams, runtime);
296
- if (groupDocument) {
297
- throw new ConvexError({
298
- code: 'VERSION_CONFLICT',
299
- status: 409,
300
- message: 'Group already exists',
301
- });
302
- }
303
- await translateEngineErrors(() => engine.createGroup(groupId, toUint8Array(input.encryptedState), authorization(input)));
304
- const persisted = engine.exportGroup(groupId);
305
- if (!persisted || persisted.snapshots.length !== 1) {
306
- throw new Error('Group creation did not produce one snapshot');
307
- }
308
- const key = groupIdKey(groupId);
309
- const state = deserializeEncryptedGroup(persisted.encryptedState);
310
- await ctx.db.insert(GROUPS_TABLE, {
311
- groupId: key,
312
- encryptedState: toArrayBuffer(persisted.encryptedState),
313
- version: state.version,
314
- });
315
- await insertSnapshot(ctx, key, persisted.snapshots[0]);
316
- return null;
317
- },
318
- }),
319
- getGroup: queryGeneric({
320
- args: {
321
- groupId: v.bytes(),
322
- presentation: v.bytes(),
323
- groupPublicParams: v.bytes(),
324
- version: v.optional(v.number()),
325
- },
326
- returns: v.union(snapshotResultValidator, v.null()),
327
- handler: async (ctx, input) => {
328
- const groupId = toUint8Array(input.groupId);
329
- const key = groupIdKey(groupId);
330
- const groupDocument = await getGroupDocument(ctx, key);
331
- if (!groupDocument)
332
- return null;
333
- const version = input.version ?? groupDocument.version;
334
- const secretParams = getSecretParams();
335
- const { engine } = await loadEngine(ctx, groupId, secretParams, runtime, { snapshotVersions: [version] });
336
- const result = await translateEngineErrors(() => engine.getGroup(groupId, authorization(input), input.version));
337
- return result
338
- ? {
339
- encryptedState: toArrayBuffer(result.encryptedState),
340
- version: result.version,
341
- baselineSignature: toArrayBuffer(result.baselineSignature),
342
- }
343
- : null;
344
- },
345
- }),
346
- getGroupJoinInfo: queryGeneric({
347
- args: {
348
- groupId: v.bytes(),
349
- inviteLinkPassword: v.bytes(),
350
- presentation: v.bytes(),
351
- groupPublicParams: v.bytes(),
352
- },
353
- returns: v.union(v.object({
354
- encryptedJoinInfo: v.bytes(),
355
- version: v.number(),
356
- }), v.null()),
357
- handler: async (ctx, input) => {
358
- const groupId = toUint8Array(input.groupId);
359
- const { engine, groupDocument } = await loadEngine(ctx, groupId, getSecretParams(), runtime);
360
- if (!groupDocument)
361
- return null;
362
- const result = await translateEngineErrors(() => engine.getGroupJoinInfo(groupId, toUint8Array(input.inviteLinkPassword), authorization(input)));
363
- return result
364
- ? {
365
- encryptedJoinInfo: toArrayBuffer(result.encryptedJoinInfo),
366
- version: result.version,
367
- }
368
- : null;
369
- },
370
- }),
371
- getGroupChanges: queryGeneric({
372
- args: {
373
- groupId: v.bytes(),
374
- fromVersion: v.number(),
375
- presentation: v.bytes(),
376
- groupPublicParams: v.bytes(),
377
- },
378
- returns: v.array(changeResultValidator),
379
- handler: async (ctx, input) => {
380
- const groupId = toUint8Array(input.groupId);
381
- const { engine, groupDocument } = await loadEngine(ctx, groupId, getSecretParams(), runtime, {
382
- snapshotVersions: [input.fromVersion],
383
- changesAfterVersion: input.fromVersion,
384
- });
385
- if (!groupDocument)
386
- return [];
387
- const result = await translateEngineErrors(() => engine.getGroupChanges(groupId, input.fromVersion, authorization(input)));
388
- return result.map((entry) => ({
389
- version: entry.version,
390
- actions: toArrayBuffer(entry.actions),
391
- serverSignature: toArrayBuffer(entry.serverSignature),
392
- changeEpoch: entry.changeEpoch,
393
- timestamp: entry.timestamp,
394
- }));
395
- },
396
- }),
397
- submitGroupChange: mutationGeneric({
398
- args: {
399
- groupId: v.bytes(),
400
- expectedVersion: v.number(),
401
- actions: v.bytes(),
402
- inviteLinkPassword: v.bytes(),
403
- presentation: v.bytes(),
404
- groupPublicParams: v.bytes(),
405
- },
406
- returns: changeResultValidator,
407
- handler: async (ctx, input) => {
408
- const groupId = toUint8Array(input.groupId);
409
- const { engine, groupDocument } = await loadEngine(ctx, groupId, getSecretParams(), runtime);
410
- if (!groupDocument) {
411
- throw new ConvexError({
412
- code: 'INVALID_REQUEST',
413
- status: 400,
414
- message: 'Group does not exist',
415
- });
416
- }
417
- const result = await translateEngineErrors(() => engine.submitGroupChange(groupId, input.expectedVersion, toUint8Array(input.actions), toUint8Array(input.inviteLinkPassword), authorization(input)));
418
- const persisted = engine.exportGroup(groupId);
419
- const nextSnapshot = persisted?.snapshots.find((snapshot) => snapshot.version === result.version);
420
- if (!persisted || !nextSnapshot) {
421
- throw new Error('Accepted change did not produce a snapshot');
422
- }
423
- const key = groupIdKey(groupId);
424
- await ctx.db.patch(groupDocument._id, {
425
- encryptedState: toArrayBuffer(persisted.encryptedState),
426
- version: result.version,
427
- });
428
- await insertChange(ctx, key, result);
429
- await insertSnapshot(ctx, key, nextSnapshot);
430
- return {
431
- version: result.version,
432
- actions: toArrayBuffer(result.actions),
433
- serverSignature: toArrayBuffer(result.serverSignature),
434
- changeEpoch: result.changeEpoch,
435
- timestamp: result.timestamp,
436
- };
437
- },
438
- }),
439
- refreshGroupSendEndorsements: mutationGeneric({
440
- args: {
441
- groupId: v.bytes(),
442
- presentation: v.bytes(),
443
- groupPublicParams: v.bytes(),
444
- },
445
- returns: v.object({
446
- endorsements: v.bytes(),
447
- expiration: v.number(),
448
- }),
449
- handler: async (ctx, input) => {
450
- const groupId = toUint8Array(input.groupId);
451
- const key = groupIdKey(groupId);
452
- const groupDocument = await getGroupDocument(ctx, key);
453
- if (!groupDocument)
454
- throw new Error('Group not found');
455
- const version = groupDocument.version;
456
- const secretParams = getSecretParams();
457
- const { engine } = await loadEngine(ctx, groupId, secretParams, runtime, { snapshotVersions: [version] });
458
- const group = await translateEngineErrors(() => engine.getGroup(groupId, authorization(input)));
459
- if (!group)
460
- throw new Error('Group not found');
461
- const members = memberCiphertexts(group.encryptedState);
462
- if (members.length === 0)
463
- throw new Error('Empty group');
464
- const expiration = defaultExpiration(Math.floor(runtime.now() / 1000));
465
- const response = issueEndorsements(members, deriveForExpiration(secretParams.endorsementKeyPair, expiration), runtime.randomBytes(32));
466
- return {
467
- endorsements: toArrayBuffer(serializeEndorsementsResponse(response)),
468
- expiration,
469
- };
470
- },
471
- }),
472
- issueAuthCredentialMutation: mutationGeneric({
473
- args: {},
474
- returns: v.bytes(),
475
- handler: async (ctx) => {
476
- const { aci, pni } = serviceIds(await config.identify(ctx));
477
- const nowSeconds = Math.floor(runtime.now() / 1000);
478
- const redemptionTime = Math.floor(nowSeconds / SECONDS_PER_DAY) *
479
- SECONDS_PER_DAY;
480
- const response = issueAuthCredential(getSecretParams().credentialKeyPair, aci, pni, redemptionTime, runtime.randomBytes(32));
481
- return toArrayBuffer(serializeAuthCredentialResponse(response));
482
- },
483
- }),
484
- issueProfileKeyCredentialMutation: mutationGeneric({
485
- args: { profileKey: v.bytes() },
486
- returns: v.bytes(),
487
- handler: async (ctx, input) => {
488
- const { aci } = serviceIds(await config.identify(ctx));
489
- const nowSeconds = Math.floor(runtime.now() / 1000);
490
- const redemptionTime = Math.floor(nowSeconds / SECONDS_PER_DAY) *
491
- SECONDS_PER_DAY +
492
- 2 * SECONDS_PER_DAY;
493
- const response = issueProfileKeyCredential(getSecretParams().profileKeyCredentialKeyPair, aci, requireProfileKey(input.profileKey), redemptionTime, runtime.randomBytes(32));
494
- return toArrayBuffer(serializeProfileKeyCredentialResponse(response));
495
- },
496
- }),
497
- };
498
- }
499
- export function defineConvexGroupServer(config) {
500
- return buildConvexGroupServer(config);
501
- }
502
- /** @internal Test-only deterministic secret/runtime injection seam. */
503
- export function defineConvexGroupServerForTest(config) {
504
- return buildConvexGroupServer(config);
505
- }
506
- //# sourceMappingURL=server.js.map