@swal/edge-mesh 0.0.0-stage → 0.1.1

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 (464) hide show
  1. package/LICENSE +128 -0
  2. package/NOTICE +37 -0
  3. package/README.md +470 -2
  4. package/dist/adapters/gpu-agent/index.d.ts +61 -0
  5. package/dist/adapters/gpu-agent/index.d.ts.map +1 -0
  6. package/dist/adapters/gpu-agent/index.js +364 -0
  7. package/dist/adapters/gpu-agent/index.js.map +1 -0
  8. package/dist/adapters/maloca-salud/citas-distribuidas.d.ts +19 -0
  9. package/dist/adapters/maloca-salud/citas-distribuidas.d.ts.map +1 -0
  10. package/dist/adapters/maloca-salud/citas-distribuidas.js +51 -0
  11. package/dist/adapters/maloca-salud/citas-distribuidas.js.map +1 -0
  12. package/dist/adapters/maloca-salud/eps-bridge.d.ts +15 -0
  13. package/dist/adapters/maloca-salud/eps-bridge.d.ts.map +1 -0
  14. package/dist/adapters/maloca-salud/eps-bridge.js +27 -0
  15. package/dist/adapters/maloca-salud/eps-bridge.js.map +1 -0
  16. package/dist/adapters/maloca-salud/patient-profile.d.ts +20 -0
  17. package/dist/adapters/maloca-salud/patient-profile.d.ts.map +1 -0
  18. package/dist/adapters/maloca-salud/patient-profile.js +36 -0
  19. package/dist/adapters/maloca-salud/patient-profile.js.map +1 -0
  20. package/dist/adapters/maloca-salud/types.d.ts +40 -0
  21. package/dist/adapters/maloca-salud/types.d.ts.map +1 -0
  22. package/dist/adapters/maloca-salud/types.js +2 -0
  23. package/dist/adapters/maloca-salud/types.js.map +1 -0
  24. package/dist/adapters/maloca-veeduria/contract-bridge.d.ts +31 -0
  25. package/dist/adapters/maloca-veeduria/contract-bridge.d.ts.map +1 -0
  26. package/dist/adapters/maloca-veeduria/contract-bridge.js +103 -0
  27. package/dist/adapters/maloca-veeduria/contract-bridge.js.map +1 -0
  28. package/dist/adapters/maloca-veeduria/evidentia-veeduria.d.ts +14 -0
  29. package/dist/adapters/maloca-veeduria/evidentia-veeduria.d.ts.map +1 -0
  30. package/dist/adapters/maloca-veeduria/evidentia-veeduria.js +40 -0
  31. package/dist/adapters/maloca-veeduria/evidentia-veeduria.js.map +1 -0
  32. package/dist/adapters/maloca-veeduria/licitante-profile.d.ts +21 -0
  33. package/dist/adapters/maloca-veeduria/licitante-profile.d.ts.map +1 -0
  34. package/dist/adapters/maloca-veeduria/licitante-profile.js +58 -0
  35. package/dist/adapters/maloca-veeduria/licitante-profile.js.map +1 -0
  36. package/dist/adapters/maloca-veeduria/types.d.ts +30 -0
  37. package/dist/adapters/maloca-veeduria/types.d.ts.map +1 -0
  38. package/dist/adapters/maloca-veeduria/types.js +2 -0
  39. package/dist/adapters/maloca-veeduria/types.js.map +1 -0
  40. package/dist/adapters/maloca-xavier/agent-profile.d.ts +32 -0
  41. package/dist/adapters/maloca-xavier/agent-profile.d.ts.map +1 -0
  42. package/dist/adapters/maloca-xavier/agent-profile.js +56 -0
  43. package/dist/adapters/maloca-xavier/agent-profile.js.map +1 -0
  44. package/dist/adapters/maloca-xavier/codegraph-bridge.d.ts +27 -0
  45. package/dist/adapters/maloca-xavier/codegraph-bridge.d.ts.map +1 -0
  46. package/dist/adapters/maloca-xavier/codegraph-bridge.js +58 -0
  47. package/dist/adapters/maloca-xavier/codegraph-bridge.js.map +1 -0
  48. package/dist/adapters/maloca-xavier/llm-router.d.ts +25 -0
  49. package/dist/adapters/maloca-xavier/llm-router.d.ts.map +1 -0
  50. package/dist/adapters/maloca-xavier/llm-router.js +58 -0
  51. package/dist/adapters/maloca-xavier/llm-router.js.map +1 -0
  52. package/dist/authz/index.d.ts +81 -0
  53. package/dist/authz/index.d.ts.map +1 -0
  54. package/dist/authz/index.js +271 -0
  55. package/dist/authz/index.js.map +1 -0
  56. package/dist/chat/index.d.ts +138 -0
  57. package/dist/chat/index.d.ts.map +1 -0
  58. package/dist/chat/index.js +394 -0
  59. package/dist/chat/index.js.map +1 -0
  60. package/dist/chat/offline-queue.d.ts +32 -0
  61. package/dist/chat/offline-queue.d.ts.map +1 -0
  62. package/dist/chat/offline-queue.js +93 -0
  63. package/dist/chat/offline-queue.js.map +1 -0
  64. package/dist/core/DefaultEdgeMeshNode.d.ts +17 -0
  65. package/dist/core/DefaultEdgeMeshNode.d.ts.map +1 -0
  66. package/dist/core/DefaultEdgeMeshNode.js +57 -0
  67. package/dist/core/DefaultEdgeMeshNode.js.map +1 -0
  68. package/dist/core/node.d.ts +26 -0
  69. package/dist/core/node.d.ts.map +1 -0
  70. package/dist/core/node.js +16 -0
  71. package/dist/core/node.js.map +1 -0
  72. package/dist/edge-mesh.d.ts +139 -0
  73. package/dist/edge-mesh.d.ts.map +1 -0
  74. package/dist/edge-mesh.js +1146 -0
  75. package/dist/edge-mesh.js.map +1 -0
  76. package/dist/gos/GosBridge.d.ts +49 -0
  77. package/dist/gos/GosBridge.d.ts.map +1 -0
  78. package/dist/gos/GosBridge.js +133 -0
  79. package/dist/gos/GosBridge.js.map +1 -0
  80. package/dist/governance/authority.d.ts +44 -0
  81. package/dist/governance/authority.d.ts.map +1 -0
  82. package/dist/governance/authority.js +123 -0
  83. package/dist/governance/authority.js.map +1 -0
  84. package/dist/governance/index.d.ts +66 -0
  85. package/dist/governance/index.d.ts.map +1 -0
  86. package/dist/governance/index.js +210 -0
  87. package/dist/governance/index.js.map +1 -0
  88. package/dist/governance/merge.d.ts +31 -0
  89. package/dist/governance/merge.d.ts.map +1 -0
  90. package/dist/governance/merge.js +167 -0
  91. package/dist/governance/merge.js.map +1 -0
  92. package/dist/identity/index.d.ts +199 -0
  93. package/dist/identity/index.d.ts.map +1 -0
  94. package/dist/identity/index.js +415 -0
  95. package/dist/identity/index.js.map +1 -0
  96. package/dist/index.d.ts +71 -0
  97. package/dist/index.d.ts.map +1 -0
  98. package/dist/index.js +56 -0
  99. package/dist/index.js.map +1 -0
  100. package/dist/maloca/backoffice.d.ts +31 -0
  101. package/dist/maloca/backoffice.d.ts.map +1 -0
  102. package/dist/maloca/backoffice.js +40 -0
  103. package/dist/maloca/backoffice.js.map +1 -0
  104. package/dist/maloca/event-bus.d.ts +60 -0
  105. package/dist/maloca/event-bus.d.ts.map +1 -0
  106. package/dist/maloca/event-bus.js +175 -0
  107. package/dist/maloca/event-bus.js.map +1 -0
  108. package/dist/maloca/evidentia.d.ts +136 -0
  109. package/dist/maloca/evidentia.d.ts.map +1 -0
  110. package/dist/maloca/evidentia.js +447 -0
  111. package/dist/maloca/evidentia.js.map +1 -0
  112. package/dist/maloca/gateway/api.d.ts +146 -0
  113. package/dist/maloca/gateway/api.d.ts.map +1 -0
  114. package/dist/maloca/gateway/api.js +228 -0
  115. package/dist/maloca/gateway/api.js.map +1 -0
  116. package/dist/maloca/gateway/auth.d.ts +20 -0
  117. package/dist/maloca/gateway/auth.d.ts.map +1 -0
  118. package/dist/maloca/gateway/auth.js +115 -0
  119. package/dist/maloca/gateway/auth.js.map +1 -0
  120. package/dist/maloca/gateway/dashboard.d.ts +42 -0
  121. package/dist/maloca/gateway/dashboard.d.ts.map +1 -0
  122. package/dist/maloca/gateway/dashboard.js +67 -0
  123. package/dist/maloca/gateway/dashboard.js.map +1 -0
  124. package/dist/maloca/gateway/websocket.d.ts +34 -0
  125. package/dist/maloca/gateway/websocket.d.ts.map +1 -0
  126. package/dist/maloca/gateway/websocket.js +71 -0
  127. package/dist/maloca/gateway/websocket.js.map +1 -0
  128. package/dist/maloca/karma.d.ts +165 -0
  129. package/dist/maloca/karma.d.ts.map +1 -0
  130. package/dist/maloca/karma.js +307 -0
  131. package/dist/maloca/karma.js.map +1 -0
  132. package/dist/maloca/kernel.d.ts +20 -0
  133. package/dist/maloca/kernel.d.ts.map +1 -0
  134. package/dist/maloca/kernel.js +76 -0
  135. package/dist/maloca/kernel.js.map +1 -0
  136. package/dist/maloca/metadata.d.ts +30 -0
  137. package/dist/maloca/metadata.d.ts.map +1 -0
  138. package/dist/maloca/metadata.js +80 -0
  139. package/dist/maloca/metadata.js.map +1 -0
  140. package/dist/maloca/perfil.d.ts +57 -0
  141. package/dist/maloca/perfil.d.ts.map +1 -0
  142. package/dist/maloca/perfil.js +113 -0
  143. package/dist/maloca/perfil.js.map +1 -0
  144. package/dist/maloca/plugin-registry.d.ts +27 -0
  145. package/dist/maloca/plugin-registry.d.ts.map +1 -0
  146. package/dist/maloca/plugin-registry.js +76 -0
  147. package/dist/maloca/plugin-registry.js.map +1 -0
  148. package/dist/maloca/polygon-bridge.d.ts +63 -0
  149. package/dist/maloca/polygon-bridge.d.ts.map +1 -0
  150. package/dist/maloca/polygon-bridge.js +198 -0
  151. package/dist/maloca/polygon-bridge.js.map +1 -0
  152. package/dist/maloca/types.d.ts +44 -0
  153. package/dist/maloca/types.d.ts.map +1 -0
  154. package/dist/maloca/types.js +2 -0
  155. package/dist/maloca/types.js.map +1 -0
  156. package/dist/medico/aval.d.ts +149 -0
  157. package/dist/medico/aval.d.ts.map +1 -0
  158. package/dist/medico/aval.js +281 -0
  159. package/dist/medico/aval.js.map +1 -0
  160. package/dist/medico/canonica.d.ts +96 -0
  161. package/dist/medico/canonica.d.ts.map +1 -0
  162. package/dist/medico/canonica.js +148 -0
  163. package/dist/medico/canonica.js.map +1 -0
  164. package/dist/medico/credencial.d.ts +160 -0
  165. package/dist/medico/credencial.d.ts.map +1 -0
  166. package/dist/medico/credencial.js +240 -0
  167. package/dist/medico/credencial.js.map +1 -0
  168. package/dist/medico/index.d.ts +36 -0
  169. package/dist/medico/index.d.ts.map +1 -0
  170. package/dist/medico/index.js +39 -0
  171. package/dist/medico/index.js.map +1 -0
  172. package/dist/medico/malla.d.ts +218 -0
  173. package/dist/medico/malla.d.ts.map +1 -0
  174. package/dist/medico/malla.js +347 -0
  175. package/dist/medico/malla.js.map +1 -0
  176. package/dist/medico/registro-profesional.d.ts +84 -0
  177. package/dist/medico/registro-profesional.d.ts.map +1 -0
  178. package/dist/medico/registro-profesional.js +135 -0
  179. package/dist/medico/registro-profesional.js.map +1 -0
  180. package/dist/medico/registro.d.ts +149 -0
  181. package/dist/medico/registro.d.ts.map +1 -0
  182. package/dist/medico/registro.js +173 -0
  183. package/dist/medico/registro.js.map +1 -0
  184. package/dist/medico/types.d.ts +287 -0
  185. package/dist/medico/types.d.ts.map +1 -0
  186. package/dist/medico/types.js +135 -0
  187. package/dist/medico/types.js.map +1 -0
  188. package/dist/medico/verificacion-registro.d.ts +300 -0
  189. package/dist/medico/verificacion-registro.d.ts.map +1 -0
  190. package/dist/medico/verificacion-registro.js +319 -0
  191. package/dist/medico/verificacion-registro.js.map +1 -0
  192. package/dist/mesh/index.d.ts +457 -0
  193. package/dist/mesh/index.d.ts.map +1 -0
  194. package/dist/mesh/index.js +929 -0
  195. package/dist/mesh/index.js.map +1 -0
  196. package/dist/namespaces/encrypted-plugin.d.ts +56 -0
  197. package/dist/namespaces/encrypted-plugin.d.ts.map +1 -0
  198. package/dist/namespaces/encrypted-plugin.js +173 -0
  199. package/dist/namespaces/encrypted-plugin.js.map +1 -0
  200. package/dist/namespaces/index.d.ts +52 -0
  201. package/dist/namespaces/index.d.ts.map +1 -0
  202. package/dist/namespaces/index.js +134 -0
  203. package/dist/namespaces/index.js.map +1 -0
  204. package/dist/namespaces/ivn-proofs.d.ts +54 -0
  205. package/dist/namespaces/ivn-proofs.d.ts.map +1 -0
  206. package/dist/namespaces/ivn-proofs.js +162 -0
  207. package/dist/namespaces/ivn-proofs.js.map +1 -0
  208. package/dist/namespaces/offers-gossip.d.ts +95 -0
  209. package/dist/namespaces/offers-gossip.d.ts.map +1 -0
  210. package/dist/namespaces/offers-gossip.js +213 -0
  211. package/dist/namespaces/offers-gossip.js.map +1 -0
  212. package/dist/node-memory/idb-store.d.ts +22 -0
  213. package/dist/node-memory/idb-store.d.ts.map +1 -0
  214. package/dist/node-memory/idb-store.js +157 -0
  215. package/dist/node-memory/idb-store.js.map +1 -0
  216. package/dist/node-memory/index.d.ts +14 -0
  217. package/dist/node-memory/index.d.ts.map +1 -0
  218. package/dist/node-memory/index.js +159 -0
  219. package/dist/node-memory/index.js.map +1 -0
  220. package/dist/node-memory/sync-flush.d.ts +11 -0
  221. package/dist/node-memory/sync-flush.d.ts.map +1 -0
  222. package/dist/node-memory/sync-flush.js +37 -0
  223. package/dist/node-memory/sync-flush.js.map +1 -0
  224. package/dist/node-memory/types.d.ts +34 -0
  225. package/dist/node-memory/types.d.ts.map +1 -0
  226. package/dist/node-memory/types.js +2 -0
  227. package/dist/node-memory/types.js.map +1 -0
  228. package/dist/node-memory/xavier-store.d.ts +12 -0
  229. package/dist/node-memory/xavier-store.d.ts.map +1 -0
  230. package/dist/node-memory/xavier-store.js +75 -0
  231. package/dist/node-memory/xavier-store.js.map +1 -0
  232. package/dist/op-log/index.d.ts +49 -0
  233. package/dist/op-log/index.d.ts.map +1 -0
  234. package/dist/op-log/index.js +190 -0
  235. package/dist/op-log/index.js.map +1 -0
  236. package/dist/presence/health.d.ts +54 -0
  237. package/dist/presence/health.d.ts.map +1 -0
  238. package/dist/presence/health.js +139 -0
  239. package/dist/presence/health.js.map +1 -0
  240. package/dist/presence/index.d.ts +85 -0
  241. package/dist/presence/index.d.ts.map +1 -0
  242. package/dist/presence/index.js +255 -0
  243. package/dist/presence/index.js.map +1 -0
  244. package/dist/presence/peer-health.d.ts +40 -0
  245. package/dist/presence/peer-health.d.ts.map +1 -0
  246. package/dist/presence/peer-health.js +118 -0
  247. package/dist/presence/peer-health.js.map +1 -0
  248. package/dist/protocol/canonical.d.ts +10 -0
  249. package/dist/protocol/canonical.d.ts.map +1 -0
  250. package/dist/protocol/canonical.js +32 -0
  251. package/dist/protocol/canonical.js.map +1 -0
  252. package/dist/protocol/crypto.d.ts +299 -0
  253. package/dist/protocol/crypto.d.ts.map +1 -0
  254. package/dist/protocol/crypto.js +739 -0
  255. package/dist/protocol/crypto.js.map +1 -0
  256. package/dist/protocol/index.d.ts +30 -0
  257. package/dist/protocol/index.d.ts.map +1 -0
  258. package/dist/protocol/index.js +116 -0
  259. package/dist/protocol/index.js.map +1 -0
  260. package/dist/protocol/utils.d.ts +5 -0
  261. package/dist/protocol/utils.d.ts.map +1 -0
  262. package/dist/protocol/utils.js +27 -0
  263. package/dist/protocol/utils.js.map +1 -0
  264. package/dist/salones/manager.d.ts +100 -0
  265. package/dist/salones/manager.d.ts.map +1 -0
  266. package/dist/salones/manager.js +240 -0
  267. package/dist/salones/manager.js.map +1 -0
  268. package/dist/security/rate-limiter.d.ts +13 -0
  269. package/dist/security/rate-limiter.d.ts.map +1 -0
  270. package/dist/security/rate-limiter.js +32 -0
  271. package/dist/security/rate-limiter.js.map +1 -0
  272. package/dist/snapshot/index.d.ts +90 -0
  273. package/dist/snapshot/index.d.ts.map +1 -0
  274. package/dist/snapshot/index.js +189 -0
  275. package/dist/snapshot/index.js.map +1 -0
  276. package/dist/storage/index.d.ts +49 -0
  277. package/dist/storage/index.d.ts.map +1 -0
  278. package/dist/storage/index.js +192 -0
  279. package/dist/storage/index.js.map +1 -0
  280. package/dist/storage/optimizer.d.ts +28 -0
  281. package/dist/storage/optimizer.d.ts.map +1 -0
  282. package/dist/storage/optimizer.js +71 -0
  283. package/dist/storage/optimizer.js.map +1 -0
  284. package/dist/storage/ydoc-persistence.d.ts +27 -0
  285. package/dist/storage/ydoc-persistence.d.ts.map +1 -0
  286. package/dist/storage/ydoc-persistence.js +128 -0
  287. package/dist/storage/ydoc-persistence.js.map +1 -0
  288. package/dist/sync/ChunkSyncManager.d.ts +41 -0
  289. package/dist/sync/ChunkSyncManager.d.ts.map +1 -0
  290. package/dist/sync/ChunkSyncManager.js +115 -0
  291. package/dist/sync/ChunkSyncManager.js.map +1 -0
  292. package/dist/sync/conflict-resolver.d.ts +33 -0
  293. package/dist/sync/conflict-resolver.d.ts.map +1 -0
  294. package/dist/sync/conflict-resolver.js +54 -0
  295. package/dist/sync/conflict-resolver.js.map +1 -0
  296. package/dist/sync/engine.d.ts +168 -0
  297. package/dist/sync/engine.d.ts.map +1 -0
  298. package/dist/sync/engine.js +315 -0
  299. package/dist/sync/engine.js.map +1 -0
  300. package/dist/sync/index.d.ts +3 -0
  301. package/dist/sync/index.d.ts.map +1 -0
  302. package/dist/sync/index.js +3 -0
  303. package/dist/sync/index.js.map +1 -0
  304. package/dist/transport/TorTransportAdapter.d.ts +70 -0
  305. package/dist/transport/TorTransportAdapter.d.ts.map +1 -0
  306. package/dist/transport/TorTransportAdapter.js +192 -0
  307. package/dist/transport/TorTransportAdapter.js.map +1 -0
  308. package/dist/transport/memory.d.ts +31 -0
  309. package/dist/transport/memory.d.ts.map +1 -0
  310. package/dist/transport/memory.js +114 -0
  311. package/dist/transport/memory.js.map +1 -0
  312. package/dist/transport/peerjs.d.ts +52 -0
  313. package/dist/transport/peerjs.d.ts.map +1 -0
  314. package/dist/transport/peerjs.js +336 -0
  315. package/dist/transport/peerjs.js.map +1 -0
  316. package/dist/transport/pqc-handshake.d.ts +72 -0
  317. package/dist/transport/pqc-handshake.d.ts.map +1 -0
  318. package/dist/transport/pqc-handshake.js +129 -0
  319. package/dist/transport/pqc-handshake.js.map +1 -0
  320. package/dist/transport/relay-config.d.ts +11 -0
  321. package/dist/transport/relay-config.d.ts.map +1 -0
  322. package/dist/transport/relay-config.js +48 -0
  323. package/dist/transport/relay-config.js.map +1 -0
  324. package/dist/transport/relay-server.d.ts +37 -0
  325. package/dist/transport/relay-server.d.ts.map +1 -0
  326. package/dist/transport/relay-server.js +246 -0
  327. package/dist/transport/relay-server.js.map +1 -0
  328. package/dist/transport/tor.d.ts +47 -0
  329. package/dist/transport/tor.d.ts.map +1 -0
  330. package/dist/transport/tor.js +158 -0
  331. package/dist/transport/tor.js.map +1 -0
  332. package/dist/transport/types.d.ts +34 -0
  333. package/dist/transport/types.d.ts.map +1 -0
  334. package/dist/transport/types.js +2 -0
  335. package/dist/transport/types.js.map +1 -0
  336. package/dist/types/index.d.ts +293 -0
  337. package/dist/types/index.d.ts.map +1 -0
  338. package/dist/types/index.js +73 -0
  339. package/dist/types/index.js.map +1 -0
  340. package/dist/web/admission.d.ts +24 -0
  341. package/dist/web/admission.d.ts.map +1 -0
  342. package/dist/web/admission.js +41 -0
  343. package/dist/web/admission.js.map +1 -0
  344. package/dist/web/crypto.d.ts +18 -0
  345. package/dist/web/crypto.d.ts.map +1 -0
  346. package/dist/web/crypto.js +78 -0
  347. package/dist/web/crypto.js.map +1 -0
  348. package/dist/web/exchange.d.ts +23 -0
  349. package/dist/web/exchange.d.ts.map +1 -0
  350. package/dist/web/exchange.js +54 -0
  351. package/dist/web/exchange.js.map +1 -0
  352. package/dist/web/fragment.d.ts +58 -0
  353. package/dist/web/fragment.d.ts.map +1 -0
  354. package/dist/web/fragment.js +198 -0
  355. package/dist/web/fragment.js.map +1 -0
  356. package/dist/web/index.d.ts +25 -0
  357. package/dist/web/index.d.ts.map +1 -0
  358. package/dist/web/index.js +14 -0
  359. package/dist/web/index.js.map +1 -0
  360. package/dist/web/merge/index.d.ts +104 -0
  361. package/dist/web/merge/index.d.ts.map +1 -0
  362. package/dist/web/merge/index.js +236 -0
  363. package/dist/web/merge/index.js.map +1 -0
  364. package/dist/web/oplog/hlc.d.ts +19 -0
  365. package/dist/web/oplog/hlc.d.ts.map +1 -0
  366. package/dist/web/oplog/hlc.js +39 -0
  367. package/dist/web/oplog/hlc.js.map +1 -0
  368. package/dist/web/oplog/index.d.ts +10 -0
  369. package/dist/web/oplog/index.d.ts.map +1 -0
  370. package/dist/web/oplog/index.js +6 -0
  371. package/dist/web/oplog/index.js.map +1 -0
  372. package/dist/web/oplog/log.d.ts +182 -0
  373. package/dist/web/oplog/log.d.ts.map +1 -0
  374. package/dist/web/oplog/log.js +693 -0
  375. package/dist/web/oplog/log.js.map +1 -0
  376. package/dist/web/oplog/store.d.ts +40 -0
  377. package/dist/web/oplog/store.d.ts.map +1 -0
  378. package/dist/web/oplog/store.js +85 -0
  379. package/dist/web/oplog/store.js.map +1 -0
  380. package/dist/web/oplog/sync.d.ts +54 -0
  381. package/dist/web/oplog/sync.d.ts.map +1 -0
  382. package/dist/web/oplog/sync.js +162 -0
  383. package/dist/web/oplog/sync.js.map +1 -0
  384. package/dist/web/oplog/types.d.ts +119 -0
  385. package/dist/web/oplog/types.d.ts.map +1 -0
  386. package/dist/web/oplog/types.js +2 -0
  387. package/dist/web/oplog/types.js.map +1 -0
  388. package/dist/web/pairing.d.ts +186 -0
  389. package/dist/web/pairing.d.ts.map +1 -0
  390. package/dist/web/pairing.js +395 -0
  391. package/dist/web/pairing.js.map +1 -0
  392. package/dist/web/pq.d.ts +36 -0
  393. package/dist/web/pq.d.ts.map +1 -0
  394. package/dist/web/pq.js +59 -0
  395. package/dist/web/pq.js.map +1 -0
  396. package/dist/web/provider.d.ts +188 -0
  397. package/dist/web/provider.d.ts.map +1 -0
  398. package/dist/web/provider.js +2042 -0
  399. package/dist/web/provider.js.map +1 -0
  400. package/dist/web/rooms.d.ts +20 -0
  401. package/dist/web/rooms.d.ts.map +1 -0
  402. package/dist/web/rooms.js +51 -0
  403. package/dist/web/rooms.js.map +1 -0
  404. package/dist/web/rotation.d.ts +73 -0
  405. package/dist/web/rotation.d.ts.map +1 -0
  406. package/dist/web/rotation.js +130 -0
  407. package/dist/web/rotation.js.map +1 -0
  408. package/dist/web/secstate.d.ts +213 -0
  409. package/dist/web/secstate.d.ts.map +1 -0
  410. package/dist/web/secstate.js +789 -0
  411. package/dist/web/secstate.js.map +1 -0
  412. package/dist/web/store.d.ts +9 -0
  413. package/dist/web/store.d.ts.map +1 -0
  414. package/dist/web/store.js +32 -0
  415. package/dist/web/store.js.map +1 -0
  416. package/dist/web/transports/loopback.d.ts +11 -0
  417. package/dist/web/transports/loopback.d.ts.map +1 -0
  418. package/dist/web/transports/loopback.js +97 -0
  419. package/dist/web/transports/loopback.js.map +1 -0
  420. package/dist/web/transports/qr-sdp.d.ts +27 -0
  421. package/dist/web/transports/qr-sdp.d.ts.map +1 -0
  422. package/dist/web/transports/qr-sdp.js +131 -0
  423. package/dist/web/transports/qr-sdp.js.map +1 -0
  424. package/dist/web/transports/ws.d.ts +12 -0
  425. package/dist/web/transports/ws.d.ts.map +1 -0
  426. package/dist/web/transports/ws.js +139 -0
  427. package/dist/web/transports/ws.js.map +1 -0
  428. package/dist/web/trust/canonical.d.ts +8 -0
  429. package/dist/web/trust/canonical.d.ts.map +1 -0
  430. package/dist/web/trust/canonical.js +27 -0
  431. package/dist/web/trust/canonical.js.map +1 -0
  432. package/dist/web/trust/docs.d.ts +51 -0
  433. package/dist/web/trust/docs.d.ts.map +1 -0
  434. package/dist/web/trust/docs.js +170 -0
  435. package/dist/web/trust/docs.js.map +1 -0
  436. package/dist/web/trust/index.d.ts +10 -0
  437. package/dist/web/trust/index.d.ts.map +1 -0
  438. package/dist/web/trust/index.js +7 -0
  439. package/dist/web/trust/index.js.map +1 -0
  440. package/dist/web/trust/keys.d.ts +37 -0
  441. package/dist/web/trust/keys.d.ts.map +1 -0
  442. package/dist/web/trust/keys.js +75 -0
  443. package/dist/web/trust/keys.js.map +1 -0
  444. package/dist/web/trust/store.d.ts +150 -0
  445. package/dist/web/trust/store.d.ts.map +1 -0
  446. package/dist/web/trust/store.js +587 -0
  447. package/dist/web/trust/store.js.map +1 -0
  448. package/dist/web/trust/types.d.ts +134 -0
  449. package/dist/web/trust/types.d.ts.map +1 -0
  450. package/dist/web/trust/types.js +4 -0
  451. package/dist/web/trust/types.js.map +1 -0
  452. package/dist/web/types.d.ts +115 -0
  453. package/dist/web/types.d.ts.map +1 -0
  454. package/dist/web/types.js +2 -0
  455. package/dist/web/types.js.map +1 -0
  456. package/dist/web/util.d.ts +12 -0
  457. package/dist/web/util.d.ts.map +1 -0
  458. package/dist/web/util.js +54 -0
  459. package/dist/web/util.js.map +1 -0
  460. package/dist/web/webrtc.d.ts +35 -0
  461. package/dist/web/webrtc.d.ts.map +1 -0
  462. package/dist/web/webrtc.js +304 -0
  463. package/dist/web/webrtc.js.map +1 -0
  464. package/package.json +139 -4
@@ -0,0 +1,84 @@
1
+ /**
2
+ * `RegistroProfesional` — the professional half of a node's public record, and
3
+ * the rules that keep a node from being mistaken for a person.
4
+ *
5
+ * ─── WHAT THIS TYPE DELIBERATELY CANNOT HOLD ────────────────────────────────
6
+ *
7
+ * There is no field here capable of holding a patient record. Not "we won't
8
+ * populate it" — the shape does not admit it. Health data is a special category
9
+ * under GDPR Art. 9 and sensitive under Ley 1581/2012 Art. 5, whose
10
+ * household/personal exemption of Art. 2(a) is lost the moment a peer node
11
+ * holds a copy. A mesh is a replication substrate (`src/op-log/index.ts`,
12
+ * `src/snapshot/index.ts`): anything written is designed to be copied and kept,
13
+ * so a patient's record inside an OpLog is a breach waiting for a payload bug,
14
+ * and no amount of per-envelope encryption helps once five nodes hold the
15
+ * cleartext. Any future feature needing patient-adjacent data needs a different
16
+ * transport, not a field added here.
17
+ *
18
+ * ─── ONE HUMAN, SEVERAL NODES ───────────────────────────────────────────────
19
+ *
20
+ * We never assert `nodoId → person`. A physician may legitimately run a private
21
+ * clinical node and a public teaching node — different trust surfaces. The
22
+ * per-human fact we store is `idLicencia`, and the anti-Sybil rules in
23
+ * `docs/medico/reglas-red.md` are built on that, not on `nodoId`. Note the
24
+ * consequence: because `nodoId` is derived from the KEM key, key rotation
25
+ * changes it, so a `nodoId` change on a known physician is a *new node*
26
+ * requiring re-validation of layer 1 — never a continuity.
27
+ */
28
+ import { resumirAvales } from "./aval.js";
29
+ import { MOTIVO_RECHAZO_CREDENCIAL } from "./credencial.js";
30
+ import { type RegistroProfesional } from "./types.js";
31
+ /** Why a `RegistroProfesional` was refused. */
32
+ export declare const MOTIVO_RECHAZO_REGISTRO: {
33
+ /** Not an object, or `version` unsupported. */
34
+ readonly ESTRUCTURA_INVALIDA: "estructura_invalida";
35
+ /** A credential inside failed `validarCredencial`. */
36
+ readonly CREDENCIAL_INVALIDA: "credencial_invalida";
37
+ /** Two credentials in the same record share an `id`. */
38
+ readonly CREDENCIAL_DUPLICADA: "credencial_duplicada";
39
+ /** `declaracion.jurisdiccion` missing or not ISO alpha-2. */
40
+ readonly JURISDICCION_INVALIDA: "jurisdiccion_invalida";
41
+ /** `especialidades` claims a specialty with no matching credential. */
42
+ readonly ESPECIALIDAD_SIN_CREDENCIAL: "especialidad_sin_credencial";
43
+ /** A specialty credential with `tipo: 'especialidad'` and no `especialidad`. */
44
+ readonly ESPECIALIDAD_SIN_NOMBRE: "especialidad_sin_nombre";
45
+ };
46
+ export type MotivoRechazoRegistro = (typeof MOTIVO_RECHAZO_REGISTRO)[keyof typeof MOTIVO_RECHAZO_REGISTRO];
47
+ export type ResultadoValidacionRegistro = {
48
+ readonly ok: true;
49
+ readonly registro: RegistroProfesional;
50
+ readonly esCertificado: boolean;
51
+ } | {
52
+ readonly ok: false;
53
+ readonly motivo: MotivoRechazoRegistro;
54
+ readonly detalle: string;
55
+ readonly accesoPermitido: false;
56
+ };
57
+ /**
58
+ * Structural validation of a whole `RegistroProfesional`.
59
+ *
60
+ * Runs every contained credential through {@link validarCredencial} — a record
61
+ * carrying one lapsed credential is a record with a lapsed credential, and the
62
+ * aggregate being valid must not launder its parts.
63
+ *
64
+ * @param ahora - injected clock (ms epoch). The function never reads it itself.
65
+ * @returns `ok: true` plus whether the node qualifies as a *certified doctor*
66
+ * (`licencia ∧ especialidad`, both strongly emitted and unexpired). A record
67
+ * that validates but is not certified is a legitimate node with a smaller
68
+ * capability set, not a failure (DECISIÓN A.4).
69
+ */
70
+ export declare function validarRegistroProfesional(registro: RegistroProfesional, ahora: number): ResultadoValidacionRegistro;
71
+ /**
72
+ * Recompute a record's `avalRecibido` from its live `Aval`s.
73
+ *
74
+ * The stored summary is a cache, never the truth. Revocation works only because
75
+ * this fold can be re-run: an `Aval` withdrawn by its author simply stops
76
+ * appearing in the input and the count falls. A design that stored "verified" as
77
+ * a flag would have no path back.
78
+ *
79
+ * @param ahora - injected clock; lapsed `Aval`s are dropped from the fold.
80
+ */
81
+ export declare function recalcularAvalRecibido(registro: RegistroProfesional, avalesVivos: Parameters<typeof resumirAvales>[0], ahora: number): RegistroProfesional;
82
+ /** Reasons a credential can be refused, re-exported for callers of this module. */
83
+ export { MOTIVO_RECHAZO_CREDENCIAL };
84
+ //# sourceMappingURL=registro-profesional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registro-profesional.d.ts","sourceRoot":"","sources":["../../src/medico/registro-profesional.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAEN,yBAAyB,EAEzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEN,KAAK,mBAAmB,EAExB,MAAM,YAAY,CAAC;AAEpB,+CAA+C;AAC/C,eAAO,MAAM,uBAAuB;IACnC,+CAA+C;aAC/C,mBAAmB,EAAE,qBAAqB;IAC1C,sDAAsD;aACtD,mBAAmB,EAAE,qBAAqB;IAC1C,wDAAwD;aACxD,oBAAoB,EAAE,sBAAsB;IAC5C,6DAA6D;aAC7D,qBAAqB,EAAE,uBAAuB;IAC9C,uEAAuE;aACvE,2BAA2B,EAAE,6BAA6B;IAC1D,gFAAgF;aAChF,uBAAuB,EAAE,yBAAyB;CACzC,CAAC;AAEX,MAAM,MAAM,qBAAqB,GAChC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,MAAM,2BAA2B,GACpC;IACA,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CAC/B,GACD;IACA,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IACnB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC;CAC/B,CAAC;AAWL;;;;;;;;;;;;GAYG;AACH,wBAAgB,0BAA0B,CACzC,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,MAAM,GACX,2BAA2B,CA0F7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE,MAAM,GACX,mBAAmB,CAErB;AAED,mFAAmF;AACnF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * `RegistroProfesional` — the professional half of a node's public record, and
3
+ * the rules that keep a node from being mistaken for a person.
4
+ *
5
+ * ─── WHAT THIS TYPE DELIBERATELY CANNOT HOLD ────────────────────────────────
6
+ *
7
+ * There is no field here capable of holding a patient record. Not "we won't
8
+ * populate it" — the shape does not admit it. Health data is a special category
9
+ * under GDPR Art. 9 and sensitive under Ley 1581/2012 Art. 5, whose
10
+ * household/personal exemption of Art. 2(a) is lost the moment a peer node
11
+ * holds a copy. A mesh is a replication substrate (`src/op-log/index.ts`,
12
+ * `src/snapshot/index.ts`): anything written is designed to be copied and kept,
13
+ * so a patient's record inside an OpLog is a breach waiting for a payload bug,
14
+ * and no amount of per-envelope encryption helps once five nodes hold the
15
+ * cleartext. Any future feature needing patient-adjacent data needs a different
16
+ * transport, not a field added here.
17
+ *
18
+ * ─── ONE HUMAN, SEVERAL NODES ───────────────────────────────────────────────
19
+ *
20
+ * We never assert `nodoId → person`. A physician may legitimately run a private
21
+ * clinical node and a public teaching node — different trust surfaces. The
22
+ * per-human fact we store is `idLicencia`, and the anti-Sybil rules in
23
+ * `docs/medico/reglas-red.md` are built on that, not on `nodoId`. Note the
24
+ * consequence: because `nodoId` is derived from the KEM key, key rotation
25
+ * changes it, so a `nodoId` change on a known physician is a *new node*
26
+ * requiring re-validation of layer 1 — never a continuity.
27
+ */
28
+ import { resumirAvales } from "./aval.js";
29
+ import { esMedicoCertificado, MOTIVO_RECHAZO_CREDENCIAL, validarCredencial, } from "./credencial.js";
30
+ import { TIPO_CREDENCIAL, } from "./types.js";
31
+ /** Why a `RegistroProfesional` was refused. */
32
+ export const MOTIVO_RECHAZO_REGISTRO = {
33
+ /** Not an object, or `version` unsupported. */
34
+ ESTRUCTURA_INVALIDA: "estructura_invalida",
35
+ /** A credential inside failed `validarCredencial`. */
36
+ CREDENCIAL_INVALIDA: "credencial_invalida",
37
+ /** Two credentials in the same record share an `id`. */
38
+ CREDENCIAL_DUPLICADA: "credencial_duplicada",
39
+ /** `declaracion.jurisdiccion` missing or not ISO alpha-2. */
40
+ JURISDICCION_INVALIDA: "jurisdiccion_invalida",
41
+ /** `especialidades` claims a specialty with no matching credential. */
42
+ ESPECIALIDAD_SIN_CREDENCIAL: "especialidad_sin_credencial",
43
+ /** A specialty credential with `tipo: 'especialidad'` and no `especialidad`. */
44
+ ESPECIALIDAD_SIN_NOMBRE: "especialidad_sin_nombre",
45
+ };
46
+ const RE_PAIS_ALFA2 = /^[A-Z]{2}$/;
47
+ function fallo(motivo, detalle) {
48
+ return { ok: false, motivo, detalle, accesoPermitido: false };
49
+ }
50
+ /**
51
+ * Structural validation of a whole `RegistroProfesional`.
52
+ *
53
+ * Runs every contained credential through {@link validarCredencial} — a record
54
+ * carrying one lapsed credential is a record with a lapsed credential, and the
55
+ * aggregate being valid must not launder its parts.
56
+ *
57
+ * @param ahora - injected clock (ms epoch). The function never reads it itself.
58
+ * @returns `ok: true` plus whether the node qualifies as a *certified doctor*
59
+ * (`licencia ∧ especialidad`, both strongly emitted and unexpired). A record
60
+ * that validates but is not certified is a legitimate node with a smaller
61
+ * capability set, not a failure (DECISIÓN A.4).
62
+ */
63
+ export function validarRegistroProfesional(registro, ahora) {
64
+ if (!registro || typeof registro !== "object") {
65
+ return fallo(MOTIVO_RECHAZO_REGISTRO.ESTRUCTURA_INVALIDA, "el registro no es un objeto");
66
+ }
67
+ if (registro.version !== 1) {
68
+ return fallo(MOTIVO_RECHAZO_REGISTRO.ESTRUCTURA_INVALIDA, `version no soportada: ${String(registro.version)}`);
69
+ }
70
+ if (!registro.nodoId) {
71
+ return fallo(MOTIVO_RECHAZO_REGISTRO.ESTRUCTURA_INVALIDA, "falta nodoId");
72
+ }
73
+ if (!Array.isArray(registro.credenciales)) {
74
+ return fallo(MOTIVO_RECHAZO_REGISTRO.ESTRUCTURA_INVALIDA, "credenciales debe ser un array");
75
+ }
76
+ // ── Jurisdiction ──
77
+ const juris = registro.declaracion?.jurisdiccion;
78
+ if (!juris || !RE_PAIS_ALFA2.test(juris)) {
79
+ return fallo(MOTIVO_RECHAZO_REGISTRO.JURISDICCION_INVALIDA, `jurisdiccion debe ser ISO 3166-1 alpha-2 en mayúsculas: ${String(juris)}`);
80
+ }
81
+ // ── Every credential, individually ──
82
+ const vistos = new Set();
83
+ for (const credencial of registro.credenciales) {
84
+ const resultado = validarCredencial(credencial, ahora);
85
+ if (!resultado.ok) {
86
+ // The credential's own reason is preserved in `detalle`: a caller
87
+ // debugging an expired record needs to know *which* field expired, not
88
+ // just that "a credential is invalid".
89
+ return fallo(MOTIVO_RECHAZO_REGISTRO.CREDENCIAL_INVALIDA, `credencial ${credencial?.id ?? "(sin id)"}: ${resultado.motivo} — ${resultado.detalle}`);
90
+ }
91
+ if (vistos.has(credencial.id)) {
92
+ return fallo(MOTIVO_RECHAZO_REGISTRO.CREDENCIAL_DUPLICADA, `id de credencial repetido: ${credencial.id}`);
93
+ }
94
+ vistos.add(credencial.id);
95
+ if (credencial.tipo === TIPO_CREDENCIAL.ESPECIALIDAD &&
96
+ !credencial.especialidad) {
97
+ return fallo(MOTIVO_RECHAZO_REGISTRO.ESPECIALIDAD_SIN_NOMBRE, `credencial de especialidad ${credencial.id} sin campo 'especialidad'`);
98
+ }
99
+ }
100
+ // ── `especialidades` must not over-claim ──
101
+ // The summary array is what a directory renders. If it can list a specialty
102
+ // the credential set does not prove, it is an unauthenticated claim about a
103
+ // person's qualifications, which is the one thing this network must never
104
+ // publish.
105
+ const specialtiesConCredencial = new Set(registro.credenciales
106
+ .filter((c) => c.tipo === TIPO_CREDENCIAL.ESPECIALIDAD)
107
+ .map((c) => c.especialidad));
108
+ for (const esp of registro.especialidades) {
109
+ if (!specialtiesConCredencial.has(esp)) {
110
+ return fallo(MOTIVO_RECHAZO_REGISTRO.ESPECIALIDAD_SIN_CREDENCIAL, `especialidad '${esp}' listada sin credencial de tipo 'especialidad' que la respalde`);
111
+ }
112
+ }
113
+ const credencialesValidas = registro.credenciales;
114
+ return {
115
+ ok: true,
116
+ registro,
117
+ esCertificado: esMedicoCertificado(credencialesValidas, ahora),
118
+ };
119
+ }
120
+ /**
121
+ * Recompute a record's `avalRecibido` from its live `Aval`s.
122
+ *
123
+ * The stored summary is a cache, never the truth. Revocation works only because
124
+ * this fold can be re-run: an `Aval` withdrawn by its author simply stops
125
+ * appearing in the input and the count falls. A design that stored "verified" as
126
+ * a flag would have no path back.
127
+ *
128
+ * @param ahora - injected clock; lapsed `Aval`s are dropped from the fold.
129
+ */
130
+ export function recalcularAvalRecibido(registro, avalesVivos, ahora) {
131
+ return { ...registro, avalRecibido: resumirAvales(avalesVivos, ahora) };
132
+ }
133
+ /** Reasons a credential can be refused, re-exported for callers of this module. */
134
+ export { MOTIVO_RECHAZO_CREDENCIAL };
135
+ //# sourceMappingURL=registro-profesional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registro-profesional.js","sourceRoot":"","sources":["../../src/medico/registro-profesional.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACN,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGN,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,+CAA+C;AAC/C,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,+CAA+C;IAC/C,mBAAmB,EAAE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;SACnB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC,YAAY,CAAC;SACtD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAC5B,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,cAAc,EAAE,CAAC;QAC3C,IAAI,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,OAAO,KAAK,CACX,uBAAuB,CAAC,2BAA2B,EACnD,iBAAiB,GAAG,iEAAiE,CACrF,CAAC;QACH,CAAC;IACF,CAAC;IAED,MAAM,mBAAmB,GACxB,QAAQ,CAAC,YAA2C,CAAC;IACtD,OAAO;QACN,EAAE,EAAE,IAAI;QACR,QAAQ;QACR,aAAa,EAAE,mBAAmB,CAAC,mBAAmB,EAAE,KAAK,CAAC;KAC9D,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CACrC,QAA6B,EAC7B,WAAgD,EAChD,KAAa;IAEb,OAAO,EAAE,GAAG,QAAQ,EAAE,YAAY,EAAE,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;AACzE,CAAC;AAED,mFAAmF;AACnF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -0,0 +1,149 @@
1
+ /**
2
+ * The extension point for Phase 3, and the reason this layer fails closed.
3
+ *
4
+ * ─── THE ORIONHEALTH PATTERN AND ITS TWO DEFECTS ────────────────────────────
5
+ *
6
+ * `apps/OrionHealth/lib/features/doctor_verification/domain/services/license_verifier.dart`
7
+ * gets "is this licence number real" right with the right primitive:
8
+ *
9
+ * ```dart
10
+ * final normalized = licenseNumber.replaceAll(RegExp(r'\s+'), '').toUpperCase();
11
+ * final hash = sha256.convert(utf8.encode(normalized)).toString();
12
+ * final countryHashes = await _registry.getHashesForCountry(countryCode);
13
+ * if (countryHashes.isEmpty) return LicenseVerificationResult.unknown;
14
+ * if (countryHashes.contains(hash)) return LicenseVerificationResult.valid;
15
+ * return LicenseVerificationResult.invalid;
16
+ * ```
17
+ *
18
+ * Three properties worth keeping: only the hash travels (the number is PII under
19
+ * Ley 1581/2012), registries are country-scoped (ReTHUS and the Spanish
20
+ * colleges are different datasets with different cadences), and the result is
21
+ * three-valued.
22
+ *
23
+ * Two properties that are defects *for our use case*:
24
+ *
25
+ * 1. **`unknown` is not `valid`.** An empty country registry yields `unknown`.
26
+ * Fine for a UI that says "we don't know yet". Fatal here: a node that treats
27
+ * `unknown` as "not refused" turns *an unsupported country* into a bypass. A
28
+ * physician presents a licence from a country nobody has downloaded a
29
+ * snapshot for, and every node that has not yet fetched that registry waves
30
+ * them through. So {@link EstadoVerificacionRegistro} has exactly two members.
31
+ * There is no third state, so the bug is not representable.
32
+ *
33
+ * 2. **`expired` is declared but never returned.** A hash-set membership carries
34
+ * no validity window, so a licence cancelled in 2027 verifies forever. The
35
+ * fix is not in this file: it is the issuer-signed `vigenteHasta` on
36
+ * {@link CredencialMedica}, checked by `validarCredencial`.
37
+ *
38
+ * ─── WHAT THIS FILE DELIBERATELY DOES NOT DO ────────────────────────────────
39
+ *
40
+ * It does no I/O. No fetch, no registry file, no snapshot download. The
41
+ * interface below is the seam; Phase 3 implements it against a replicated,
42
+ * append-only, hash-compared country snapshot. Because the seam is pure data in
43
+ * and pure data out, this module is fully testable with a fixture and no network.
44
+ */
45
+ import type { CredencialMedica } from "./types.js";
46
+ /**
47
+ * The result of consulting a country registry.
48
+ *
49
+ * Two states, not three. `no_verificado` covers both "the licence is not in the
50
+ * registry" and "we have no registry for this country" — the caller does not get
51
+ * to tell them apart, because acting differently on them is exactly the bug.
52
+ * Access stays closed in both cases.
53
+ */
54
+ export declare const ESTADO_VERIFICACION_REGISTRO: {
55
+ readonly VERIFICADO: "verificado";
56
+ readonly NO_VERIFICADO: "no_verificado";
57
+ };
58
+ export type EstadoVerificacionRegistro = (typeof ESTADO_VERIFICACION_REGISTRO)[keyof typeof ESTADO_VERIFICACION_REGISTRO];
59
+ /** A per-country snapshot of licence hashes, plus the version that dated it. */
60
+ export interface InstantaneaRegistroPais {
61
+ /** ISO 3166-1 alpha-2. */
62
+ readonly pais: string;
63
+ /**
64
+ * Version of the snapshot. Mandatory on the wire too, not just here: an `Aval`
65
+ * with `metodoVerificacion.clase: 'registro_por_pais'` is refused without it,
66
+ * because a stale snapshot that cannot be named cannot be reasoned about.
67
+ */
68
+ readonly version: string;
69
+ /** Hex SHA-256 of normalised licence numbers. Membership only, never a number. */
70
+ readonly hashes: ReadonlySet<string>;
71
+ }
72
+ /**
73
+ * The Phase 3 seam. One method, no I/O in this module.
74
+ *
75
+ * An implementation is *injected* rather than imported so this file stays free
76
+ * of any dependency on where snapshots come from — a local file today, a gossiped
77
+ * replica later — and so a test can supply a fixture.
78
+ */
79
+ export interface VerificadorRegistroPais {
80
+ /**
81
+ * @returns the snapshot for `pais`, or `undefined` when none is available.
82
+ * `undefined` means *unsupported country* and is handled fail-closed.
83
+ */
84
+ instantanea(pais: string): InstantaneaRegistroPais | undefined;
85
+ /** Version of the snapshot this verifier would consult, for audit logs. */
86
+ versionInstantanea(pais: string): string | undefined;
87
+ }
88
+ /** An in-memory verifier. Pure: a fixture map, no I/O. Useful in tests. */
89
+ export declare class VerificadorRegistroEnMemoria implements VerificadorRegistroPais {
90
+ private readonly porPais;
91
+ constructor(instantaneas?: readonly InstantaneaRegistroPais[]);
92
+ instantanea(pais: string): InstantaneaRegistroPais | undefined;
93
+ versionInstantanea(pais: string): string | undefined;
94
+ /** Add or replace a snapshot. The append-only, hash-compared path is Phase 3. */
95
+ publicar(instantanea: InstantaneaRegistroPais): void;
96
+ }
97
+ export type ResultadoVerificacionRegistro = {
98
+ readonly estado: "verificado";
99
+ readonly idLicencia: string;
100
+ readonly versionRegistro: string;
101
+ } | {
102
+ /**
103
+ * Fail-closed. Covers both "not in the registry" and "no registry for this
104
+ * country". `causa` is for operators and logs only — it must never widen
105
+ * what a caller may do.
106
+ */
107
+ readonly estado: "no_verificado";
108
+ readonly causa: "pais_sin_registro" | "licencia_no_encontrada" | "licencia_caducada";
109
+ readonly accesoPermitido: false;
110
+ };
111
+ /**
112
+ * The OrionHealth primitive, fail-closed.
113
+ *
114
+ * The whole behavioural difference from OrionHealth is the empty-registry branch:
115
+ * it returns `no_verificado` / `pais_sin_registro`, not `unknown`. Same
116
+ * normalisation, same hash, same membership test.
117
+ *
118
+ * @param numeroLicencia - the raw number, hashed here and nowhere else.
119
+ * @param pais - ISO 3166-1 alpha-2.
120
+ */
121
+ export declare function verificarLicenciaContraRegistro(numeroLicencia: string, pais: string, verificador: VerificadorRegistroPais): Promise<ResultadoVerificacionRegistro>;
122
+ /**
123
+ * Membership test over an **already-hashed** `idLicencia`.
124
+ *
125
+ * Separate from {@link verificarLicenciaContraRegistro} because hashing is not
126
+ * idempotent: feeding a stored `idLicencia` (which is already
127
+ * `sha256(normalize(numero))`) back through `hashLicencia` hashes the digest a
128
+ * second time and can never match the set. A credential on the wire carries the
129
+ * hash, never the number, so the credential path must consult the set directly.
130
+ *
131
+ * @param idLicencia - a `sha256` hex digest. NOT a licence number.
132
+ */
133
+ export declare function verificarHashContraRegistro(idLicencia: string, pais: string, verificador: VerificadorRegistroPais): Promise<ResultadoVerificacionRegistro>;
134
+ /**
135
+ * Registry membership is necessary but not sufficient.
136
+ *
137
+ * OrionHealth's `expired` defect lives here: set membership carries no validity
138
+ * window, so a licence cancelled in 2027 stays in the snapshot and keeps
139
+ * matching. The window must come from the credential's issuer-signed
140
+ * `vigenteHasta`, which is why this check cannot be folded into the membership
141
+ * test.
142
+ *
143
+ * @param ahora - injected clock. Pure: no `Date.now()` here.
144
+ * @returns `true` only when the credential is in the registry *and* unexpired.
145
+ */
146
+ export declare function verificarCredencialContraRegistro(credencial: CredencialMedica, verificador: VerificadorRegistroPais, ahora: number): Promise<ResultadoVerificacionRegistro>;
147
+ /** Countries with a real snapshot behind them. Colombia only at launch (DECISIÓN C.1). */
148
+ export declare const PAISES_SOPORTADOS: readonly ["CO"];
149
+ //# sourceMappingURL=registro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registro.d.ts","sourceRoot":"","sources":["../../src/medico/registro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;aACxC,UAAU,EAAE,YAAY;aACxB,aAAa,EAAE,eAAe;CACrB,CAAC;AAEX,MAAM,MAAM,0BAA0B,GACrC,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,OAAO,4BAA4B,CAAC,CAAC;AAElF,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACvC,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CACrC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS,CAAC;IAE/D,2EAA2E;IAC3E,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACrD;AAED,2EAA2E;AAC3E,qBAAa,4BAA6B,YAAW,uBAAuB;IAC3E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8C;IAEtE,YAAY,YAAY,GAAE,SAAS,uBAAuB,EAAO,EAOhE;IAED,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS,CAE7D;IAED,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEnD;IAED,iFAAiF;IACjF,QAAQ,CAAC,WAAW,EAAE,uBAAuB,GAAG,IAAI,CAKnD;CACD;AAED,MAAM,MAAM,6BAA6B,GACtC;IACA,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAChC,GACD;IACA;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,KAAK,EACX,mBAAmB,GACnB,wBAAwB,GACxB,mBAAmB,CAAC;IACvB,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC;CAC/B,CAAC;AAEL;;;;;;;;;GASG;AACH,wBAAsB,+BAA+B,CACpD,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,uBAAuB,GAClC,OAAO,CAAC,6BAA6B,CAAC,CAMxC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,2BAA2B,CAChD,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,uBAAuB,GAClC,OAAO,CAAC,6BAA6B,CAAC,CAExC;AAwCD;;;;;;;;;;;GAWG;AACH,wBAAsB,iCAAiC,CACtD,UAAU,EAAE,gBAAgB,EAC5B,WAAW,EAAE,uBAAuB,EACpC,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,6BAA6B,CAAC,CAwBxC;AAED,0FAA0F;AAC1F,eAAO,MAAM,iBAAiB,YAAI,IAAI,CAAU,CAAC"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * The extension point for Phase 3, and the reason this layer fails closed.
3
+ *
4
+ * ─── THE ORIONHEALTH PATTERN AND ITS TWO DEFECTS ────────────────────────────
5
+ *
6
+ * `apps/OrionHealth/lib/features/doctor_verification/domain/services/license_verifier.dart`
7
+ * gets "is this licence number real" right with the right primitive:
8
+ *
9
+ * ```dart
10
+ * final normalized = licenseNumber.replaceAll(RegExp(r'\s+'), '').toUpperCase();
11
+ * final hash = sha256.convert(utf8.encode(normalized)).toString();
12
+ * final countryHashes = await _registry.getHashesForCountry(countryCode);
13
+ * if (countryHashes.isEmpty) return LicenseVerificationResult.unknown;
14
+ * if (countryHashes.contains(hash)) return LicenseVerificationResult.valid;
15
+ * return LicenseVerificationResult.invalid;
16
+ * ```
17
+ *
18
+ * Three properties worth keeping: only the hash travels (the number is PII under
19
+ * Ley 1581/2012), registries are country-scoped (ReTHUS and the Spanish
20
+ * colleges are different datasets with different cadences), and the result is
21
+ * three-valued.
22
+ *
23
+ * Two properties that are defects *for our use case*:
24
+ *
25
+ * 1. **`unknown` is not `valid`.** An empty country registry yields `unknown`.
26
+ * Fine for a UI that says "we don't know yet". Fatal here: a node that treats
27
+ * `unknown` as "not refused" turns *an unsupported country* into a bypass. A
28
+ * physician presents a licence from a country nobody has downloaded a
29
+ * snapshot for, and every node that has not yet fetched that registry waves
30
+ * them through. So {@link EstadoVerificacionRegistro} has exactly two members.
31
+ * There is no third state, so the bug is not representable.
32
+ *
33
+ * 2. **`expired` is declared but never returned.** A hash-set membership carries
34
+ * no validity window, so a licence cancelled in 2027 verifies forever. The
35
+ * fix is not in this file: it is the issuer-signed `vigenteHasta` on
36
+ * {@link CredencialMedica}, checked by `validarCredencial`.
37
+ *
38
+ * ─── WHAT THIS FILE DELIBERATELY DOES NOT DO ────────────────────────────────
39
+ *
40
+ * It does no I/O. No fetch, no registry file, no snapshot download. The
41
+ * interface below is the seam; Phase 3 implements it against a replicated,
42
+ * append-only, hash-compared country snapshot. Because the seam is pure data in
43
+ * and pure data out, this module is fully testable with a fixture and no network.
44
+ */
45
+ import { hashLicencia } from "./canonica.js";
46
+ /**
47
+ * The result of consulting a country registry.
48
+ *
49
+ * Two states, not three. `no_verificado` covers both "the licence is not in the
50
+ * registry" and "we have no registry for this country" — the caller does not get
51
+ * to tell them apart, because acting differently on them is exactly the bug.
52
+ * Access stays closed in both cases.
53
+ */
54
+ export const ESTADO_VERIFICACION_REGISTRO = {
55
+ VERIFICADO: "verificado",
56
+ NO_VERIFICADO: "no_verificado",
57
+ };
58
+ /** An in-memory verifier. Pure: a fixture map, no I/O. Useful in tests. */
59
+ export class VerificadorRegistroEnMemoria {
60
+ porPais = new Map();
61
+ constructor(instantaneas = []) {
62
+ for (const inst of instantaneas) {
63
+ this.porPais.set(inst.pais.toUpperCase(), {
64
+ ...inst,
65
+ pais: inst.pais.toUpperCase(),
66
+ });
67
+ }
68
+ }
69
+ instantanea(pais) {
70
+ return this.porPais.get(pais.toUpperCase());
71
+ }
72
+ versionInstantanea(pais) {
73
+ return this.porPais.get(pais.toUpperCase())?.version;
74
+ }
75
+ /** Add or replace a snapshot. The append-only, hash-compared path is Phase 3. */
76
+ publicar(instantanea) {
77
+ this.porPais.set(instantanea.pais.toUpperCase(), {
78
+ ...instantanea,
79
+ pais: instantanea.pais.toUpperCase(),
80
+ });
81
+ }
82
+ }
83
+ /**
84
+ * The OrionHealth primitive, fail-closed.
85
+ *
86
+ * The whole behavioural difference from OrionHealth is the empty-registry branch:
87
+ * it returns `no_verificado` / `pais_sin_registro`, not `unknown`. Same
88
+ * normalisation, same hash, same membership test.
89
+ *
90
+ * @param numeroLicencia - the raw number, hashed here and nowhere else.
91
+ * @param pais - ISO 3166-1 alpha-2.
92
+ */
93
+ export async function verificarLicenciaContraRegistro(numeroLicencia, pais, verificador) {
94
+ return consultarInstantanea(await hashLicencia(numeroLicencia), pais, verificador);
95
+ }
96
+ /**
97
+ * Membership test over an **already-hashed** `idLicencia`.
98
+ *
99
+ * Separate from {@link verificarLicenciaContraRegistro} because hashing is not
100
+ * idempotent: feeding a stored `idLicencia` (which is already
101
+ * `sha256(normalize(numero))`) back through `hashLicencia` hashes the digest a
102
+ * second time and can never match the set. A credential on the wire carries the
103
+ * hash, never the number, so the credential path must consult the set directly.
104
+ *
105
+ * @param idLicencia - a `sha256` hex digest. NOT a licence number.
106
+ */
107
+ export async function verificarHashContraRegistro(idLicencia, pais, verificador) {
108
+ return consultarInstantanea(idLicencia, pais, verificador);
109
+ }
110
+ /** Shared fail-closed membership test. */
111
+ async function consultarInstantanea(idLicencia, pais, verificador) {
112
+ const instantanea = verificador.instantanea(pais);
113
+ // ── FAIL CLOSED ──
114
+ // This is the branch OrionHealth returns `unknown` from. An empty registry and
115
+ // a missing country are the same thing operationally: we cannot verify, so we
116
+ // do not verify. Treating this as "not refused" makes an unsupported country
117
+ // a universal bypass, and the owner has decided the launch market is Colombia
118
+ // only — `CO` is supported, everything else fails closed until a real
119
+ // snapshot exists for it.
120
+ if (!instantanea || instantanea.hashes.size === 0) {
121
+ return {
122
+ estado: "no_verificado",
123
+ causa: "pais_sin_registro",
124
+ accesoPermitido: false,
125
+ };
126
+ }
127
+ if (!instantanea.hashes.has(idLicencia)) {
128
+ return {
129
+ estado: "no_verificado",
130
+ causa: "licencia_no_encontrada",
131
+ accesoPermitido: false,
132
+ };
133
+ }
134
+ return {
135
+ estado: "verificado",
136
+ idLicencia,
137
+ versionRegistro: instantanea.version,
138
+ };
139
+ }
140
+ /**
141
+ * Registry membership is necessary but not sufficient.
142
+ *
143
+ * OrionHealth's `expired` defect lives here: set membership carries no validity
144
+ * window, so a licence cancelled in 2027 stays in the snapshot and keeps
145
+ * matching. The window must come from the credential's issuer-signed
146
+ * `vigenteHasta`, which is why this check cannot be folded into the membership
147
+ * test.
148
+ *
149
+ * @param ahora - injected clock. Pure: no `Date.now()` here.
150
+ * @returns `true` only when the credential is in the registry *and* unexpired.
151
+ */
152
+ export async function verificarCredencialContraRegistro(credencial, verificador, ahora) {
153
+ const porPais = await verificarHashContraRegistro(credencial.idLicencia, credencial.pais, verificador);
154
+ if (porPais.estado === "no_verificado")
155
+ return porPais;
156
+ if (credencial.vigenteHasta <= ahora) {
157
+ // Membership holds and the credential is still within its own window only
158
+ // when both are true. Without this, "in the set" means "forever".
159
+ return {
160
+ estado: "no_verificado",
161
+ causa: "licencia_caducada",
162
+ accesoPermitido: false,
163
+ };
164
+ }
165
+ return {
166
+ estado: "verificado",
167
+ idLicencia: credencial.idLicencia,
168
+ versionRegistro: verificador.versionInstantanea(credencial.pais) ?? "desconocida",
169
+ };
170
+ }
171
+ /** Countries with a real snapshot behind them. Colombia only at launch (DECISIÓN C.1). */
172
+ export const PAISES_SOPORTADOS = ["CO"];
173
+ //# sourceMappingURL=registro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registro.js","sourceRoot":"","sources":["../../src/medico/registro.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC3C,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,eAAe;CACrB,CAAC;AAqCX,2EAA2E;AAC3E,MAAM,OAAO,4BAA4B;IACvB,OAAO,GAAG,IAAI,GAAG,EAAmC,CAAC;IAEtE,YAAY,YAAY,GAAuC,EAAE;QAChE,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE;gBACzC,GAAG,IAAI;gBACP,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;aAC7B,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;IAED,WAAW,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,kBAAkB,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,OAAO,CAAC;IACtD,CAAC;IAED,iFAAiF;IACjF,QAAQ,CAAC,WA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