@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,287 @@
1
+ /**
2
+ * Data model for the medical layer — types only.
3
+ *
4
+ * This file is the code transcription of
5
+ * `packages/edge-mesh/docs/medico/modelo-datos.md`. Field names here are the
6
+ * document's names, deliberately: `autoridad`, `emitidoEn`, `vigenteHasta`,
7
+ * `idLicencia`, `tipo`, `objetoAval`. Do not rename them to something more
8
+ * descriptive; the design doc is the specification and the wire format must
9
+ * match it byte for byte once signatures exist.
10
+ *
11
+ * ─── WHY THIS IS NOT A "user" OBJECT ────────────────────────────────────────
12
+ *
13
+ * The most common design error in this kind of system is collapsing four layers
14
+ * into one. They are kept apart here because they prove different things:
15
+ *
16
+ * layer 0 `NodoId` I control a key mathematics
17
+ * layer 1 `CredencialMedica` this human holds a license the state
18
+ * layer 2 `Aval` I checked layer 1 and stand behind it a peer
19
+ * layer 3 `Karma` peers repeatedly endorsed me the sum
20
+ *
21
+ * Access is granted by layer 1 + layer 2, never by layer 0 (worthless as merit)
22
+ * and never by layer 3 (mintable by anyone willing to spend a few signatures).
23
+ * See `docs/medico/reglas-red.md` §1.
24
+ *
25
+ * ─── THE TWO DEFECTS THIS SHAPE EXISTS TO CLOSE ─────────────────────────────
26
+ *
27
+ * 1. `unknown` IS NOT `valid`. The OrionHealth pattern
28
+ * (`apps/OrionHealth/lib/features/doctor_verification/domain/services/license_verifier.dart`)
29
+ * returns `LicenseVerificationResult.unknown` when a country's registry is
30
+ * empty. In a mesh that lets a node self-attest, "unverified but proceed"
31
+ * makes an *unsupported country* a bypass. So `EstadoVerificacionRegistro`
32
+ * in `./verificador.ts` has no third state at all: `verificado` and
33
+ * `no_verificado` only. The ambiguity is not representable.
34
+ *
35
+ * 2. A HASH SET CANNOT EXPRESS EXPIRY. OrionHealth declares `expired` in its
36
+ * enum and never returns it, because list membership carries no validity
37
+ * window. In a mesh that runs for years, immutable hash-set membership means
38
+ * a licence cancelled in 2027 still verifies forever. So `vigenteHasta` is a
39
+ * required field, signed by the issuer, not inferred from list membership.
40
+ *
41
+ * Nothing in this file performs I/O. Verification against a real registry
42
+ * snapshot is Phase 3; the extension point is `VerificadorRegistroPais`.
43
+ */
44
+ import type { NodoId } from "../types/index.js";
45
+ /** Wire version of the credential / record shape. Bumped only on a breaking change. */
46
+ export declare const VERSION_MODELO: 1;
47
+ /**
48
+ * The five fields every credential must carry, named as the design doc names
49
+ * them. Mapped to the plain-language description they satisfy:
50
+ *
51
+ * - source → `autoridad` ("who issued this")
52
+ * - published → `emitidoEn` ("when it was issued")
53
+ * - reviewed → `vigenteHasta` ("when it stops being current")
54
+ * - licence → `idLicencia` ("which licence, as a hash")
55
+ * - claim backed → `tipo` ("what kind of claim this is")
56
+ *
57
+ * Exported as data so a validation error can name the field that was missing
58
+ * instead of returning a bare boolean.
59
+ */
60
+ export declare const CAMPOS_OBLIGATORIOS_CREDENCIAL: readonly ["autoridad", "emitidoEn", "vigenteHasta", "idLicencia", "tipo"];
61
+ /** What kind of claim a credential makes. Specialties are separate credentials. */
62
+ export declare const TIPO_CREDENCIAL: {
63
+ readonly LICENCIA: "licencia";
64
+ readonly ESPECIALIDAD: "especialidad";
65
+ readonly COLEGIACION: "colegiacion";
66
+ readonly REGISTRO_RETHUS: "registro_rethus";
67
+ };
68
+ export type TipoCredencial = (typeof TIPO_CREDENCIAL)[keyof typeof TIPO_CREDENCIAL];
69
+ /**
70
+ * How honestly the credential was obtained. This is the label peers read; it is
71
+ * not decoration:
72
+ *
73
+ * - `autofirmada` the node signed its own claim. A format-valid
74
+ * assertion by an anonymous party, **zero** evidential
75
+ * weight. Useful only so a peer knows what to go check.
76
+ * - `atestiguada_pares` N peers each verified it independently and signed an
77
+ * `Aval`. This is the state that opens access.
78
+ * - `anclada_autoridad` the state's or the college's own key signed it.
79
+ * Strongest, and the only state that survives peers
80
+ * going offline.
81
+ */
82
+ export declare const ESTADO_EMISION: {
83
+ readonly AUTOFIRMADA: "autofirmada";
84
+ readonly ANCLADA_AUTORIDAD: "anclada_autoridad";
85
+ readonly ATESTIGUADA_PARES: "atestiguada_pares";
86
+ };
87
+ export type EstadoEmision = (typeof ESTADO_EMISION)[keyof typeof ESTADO_EMISION];
88
+ /**
89
+ * A verified professional credential: "this human holds licence L in country C,
90
+ * valid until D".
91
+ *
92
+ * This layer is **forgeable by anyone**: a signature proves authorship, never
93
+ * truth. `estadoEmision` is the honest label of how much that forgery is worth,
94
+ * and `Aval` is what actually promotes it.
95
+ */
96
+ export interface CredencialMedica {
97
+ /** Stable id: `hash(idLicencia + tipo + pais)`. See `./credencial.ts`. */
98
+ readonly id: string;
99
+ readonly tipo: TipoCredencial;
100
+ /** ISO 3166-1 alpha-2. `CO` for Colombia — the only market at launch. */
101
+ readonly pais: string;
102
+ /** Issuing authority: `'minsalud-rethus'`, `'colomedico-cm'`. */
103
+ readonly autoridad: string;
104
+ /**
105
+ * `sha256(normalize(licenceNumber))` — public-safe, never the number itself.
106
+ *
107
+ * Only the hash travels. The number is PII under Ley 1581/2012 and peers do
108
+ * not need it. Publishing it unsalted is also the anti-Sybil primitive: ten
109
+ * nodes presenting the same `idLicencia` are provably one human.
110
+ */
111
+ readonly idLicencia: string;
112
+ /**
113
+ * Real-world PII, sealed to the specific verifier with ML-KEM-768. Optional
114
+ * (DECISIÓN A.3). Travels sealed, never cleartext.
115
+ */
116
+ readonly numeroLicenciaCifrado?: Uint8Array;
117
+ /** `'medicina_general'`, `'cardiologia'`. Separate credential, own expiry. */
118
+ readonly especialidad?: string;
119
+ /** Issue date, ms epoch. */
120
+ readonly emitidoEn: number;
121
+ /**
122
+ * Expiry, ms epoch. REQUIRED and signed by the issuer — a hash set cannot
123
+ * express "this lapsed", so without this field a revoked licence verifies
124
+ * forever. Omitting it is a validation failure, not a default.
125
+ */
126
+ readonly vigenteHasta: number;
127
+ readonly estadoEmision: EstadoEmision;
128
+ /** ML-DSA-65 over the canonical bytes of every field above, except `firma`. */
129
+ readonly firma: Uint8Array;
130
+ /** Signer. `estadoEmision: 'autofirmada'` ⇒ `emisor` is the subject itself. */
131
+ readonly emisor: NodoId;
132
+ }
133
+ /** Specialty slug. `'medicina_general'`, `'cardiologia'`, … */
134
+ export type Especialidad = string;
135
+ /**
136
+ * What an `Aval` is about. The load-bearing distinction is that only the first
137
+ * two can promote a credential to `atestiguada_pares`.
138
+ *
139
+ * `interaccion_clinica` asserts *"a real encounter occurred"* — nothing more.
140
+ * No date, no diagnosis, no content. It is a boolean with a signer, and
141
+ * letting it count toward credential verification is exactly the hole that
142
+ * admits a well-liked non-doctor into a network of doctors.
143
+ */
144
+ export declare const OBJETO_AVAL: {
145
+ readonly LICENCIA_VERIFICADA: "licencia_verificada";
146
+ readonly ESPECIALIDAD_VERIFICADA: "especialidad_verificada";
147
+ readonly INTERACCION_CLINICA: "interaccion_clinica";
148
+ readonly DOCENCIA: "docencia";
149
+ };
150
+ export type ObjetoAval = (typeof OBJETO_AVAL)[keyof typeof OBJETO_AVAL];
151
+ /**
152
+ * How the avalador actually checked it. Not decoration: two `Aval`s about the
153
+ * same subject with different methods deserve different weight, and a peer must
154
+ * be able to see *why* it is trusting someone.
155
+ *
156
+ * - `registro_por_pais` cheap, reproducible offline, but only as fresh as the
157
+ * snapshot. `versionRegistro` is mandatory so a stale
158
+ * snapshot is visible on the face of the record.
159
+ * - `colegio_directo` expensive, rare, out-of-band with the college, and
160
+ * the only method that survives the registry being
161
+ * wrong. What a founding cohort should hold.
162
+ * - `testimonio_directo` cheap and unfalsifiable. Good signal of collegiality,
163
+ * **weak** signal of licensure.
164
+ * - `supervision` time-bounded, non-symmetric (A supervises B ⇒ B's
165
+ * aval of A is not symmetric evidence), and the
166
+ * strongest peer signal because it implies sustained
167
+ * observation.
168
+ */
169
+ export declare const CLASE_VERIFICACION: {
170
+ readonly REGISTRO_POR_PAIS: "registro_por_pais";
171
+ readonly COLEGIO_DIRECTO: "colegio_directo";
172
+ readonly TESTIMONIO_DIRECTO: "testimonio_directo";
173
+ readonly SUPERVISION: "supervision";
174
+ };
175
+ export type ClaseVerificacion = (typeof CLASE_VERIFICACION)[keyof typeof CLASE_VERIFICACION];
176
+ export type MetodoVerificacion = {
177
+ readonly clase: "registro_por_pais";
178
+ readonly pais: string;
179
+ readonly versionRegistro: string;
180
+ } | {
181
+ readonly clase: "colegio_directo";
182
+ readonly ref: string;
183
+ } | {
184
+ readonly clase: "testimonio_directo";
185
+ } | {
186
+ readonly clase: "supervision";
187
+ readonly desde: number;
188
+ readonly hasta: number;
189
+ };
190
+ /** `'anual'` must be renewed and feeds decay. */
191
+ export declare const ALCANCE_AVAL: {
192
+ readonly PERMANENTE: "permanente";
193
+ readonly ANUAL: "anual";
194
+ };
195
+ export type AlcanceAval = (typeof ALCANCE_AVAL)[keyof typeof ALCANCE_AVAL];
196
+ /**
197
+ * A peer endorsement: *"I checked this claim and stand behind it."*
198
+ *
199
+ * Structurally incapable of being confused with anything else. It is about a
200
+ * **claim** (peer → node, subject = a credential hash), never about an
201
+ * **encounter** (patient → node, subject = a fact of a real world event).
202
+ *
203
+ * The signature shape — `id`, `emisor`, `timestamp`, `firma` — is
204
+ * {@link TransaccionKarma}'s, reused verbatim rather than reinvented. See
205
+ * `./aval.ts#aTransaccionKarma` for the adapter that feeds an `Aval` into the
206
+ * existing karma path.
207
+ */
208
+ export interface Aval {
209
+ /** `${avalador}:${avalado}:${timestamp}:${nonce}`. Idempotency key. */
210
+ readonly id: string;
211
+ readonly version: typeof VERSION_MODELO;
212
+ readonly avalador: NodoId;
213
+ readonly avalado: NodoId;
214
+ readonly objetoAval: ObjetoAval;
215
+ /** `id` of the `CredencialMedica` being endorsed. */
216
+ readonly credencialRef: string;
217
+ /** Binds the `Aval` to the exact credential bytes the avalador checked. */
218
+ readonly hashCredencial: string;
219
+ readonly metodoVerificacion: MetodoVerificacion;
220
+ /** Hash of the artefact relied upon, if any. */
221
+ readonly evidenciaHash: string;
222
+ readonly alcance: AlcanceAval;
223
+ readonly emitidoEn: number;
224
+ /** Revocable endorsements only count while current. */
225
+ readonly vigenteHasta: number;
226
+ /** Always `true`. See `docs/medico/protocolo.md` §5. */
227
+ readonly revocable: true;
228
+ /** ML-DSA-65 by `avalador` over the canonical bytes of everything above. */
229
+ readonly firma: Uint8Array;
230
+ }
231
+ /**
232
+ * Fold over live endorsements. This, not a stored fact, is what makes
233
+ * `atestiguada_pares` revocable.
234
+ */
235
+ export interface ResumenAvales {
236
+ readonly total: number;
237
+ readonly porObjeto: Readonly<Record<ObjetoAval, number>>;
238
+ /** Distinct `avalador`s — the only counter that matters for the threshold. */
239
+ readonly avaladoresUnicos: number;
240
+ /**
241
+ * Endorsements that legally count toward credential promotion: distinct
242
+ * avaladores over `licencia_verificada` + `especialidad_verificada`.
243
+ */
244
+ readonly verificacionesLicencia: number;
245
+ readonly ultimoAval?: number;
246
+ }
247
+ /** Who operates the node and under which jurisdiction. */
248
+ export interface DeclaracionNodo {
249
+ /** ISO 3166-1 alpha-2 of the operator's jurisdiction. */
250
+ readonly jurisdiccion: string;
251
+ /**
252
+ * Public display name, opt-in (DECISIÓN A.5 — touches the Lex Artis
253
+ * professional-secret rule, not just privacy). Absent ⇒ the node is unnamed
254
+ * in the directory.
255
+ */
256
+ readonly nombreMostrado?: string;
257
+ /** Directory-level PII (contact, clinic address), sealed, opt-in. */
258
+ readonly contactoCifrado?: Uint8Array;
259
+ }
260
+ /**
261
+ * The professional half of a node's public record.
262
+ *
263
+ * ─── DELIBERATELY SHAPED SO IT CANNOT HOLD PATIENT DATA ────────────────────
264
+ *
265
+ * There is no field here capable of holding a patient record, not "we won't
266
+ * populate it" — the shape does not admit it. Health data is a special category
267
+ * under GDPR Art. 9 and sensitive under Ley 1581/2012 Art. 5, whose
268
+ * household/personal exemption of Art. 2(a) is lost the moment a peer node holds
269
+ * it. A mesh is a replication substrate: anything written is designed to be
270
+ * copied and kept by several nodes, so a patient's record inside an OpLog is a
271
+ * breach waiting for a payload bug. Any future feature needing
272
+ * patient-adjacent data needs a different transport, not a field added here.
273
+ *
274
+ * Note what this type does NOT claim: `nodoId → person`. One human may
275
+ * legitimately run several nodes, so the per-human fact we store is
276
+ * `idLicencia`, and the anti-Sybil rules are built on that, not on `nodoId`.
277
+ */
278
+ export interface RegistroProfesional {
279
+ readonly version: typeof VERSION_MODELO;
280
+ /** Binding: which key this claim rides on. */
281
+ readonly nodoId: NodoId;
282
+ readonly credenciales: readonly CredencialMedica[];
283
+ readonly especialidades: readonly Especialidad[];
284
+ readonly avalRecibido: ResumenAvales;
285
+ readonly declaracion: DeclaracionNodo;
286
+ }
287
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/medico/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD,uFAAuF;AACvF,eAAO,MAAM,cAAc,EAAG,CAAU,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,8BAA8B,YAC1C,WAAW,EACX,WAAW,EACX,cAAc,EACd,YAAY,EACZ,MAAM,CACG,CAAC;AAEX,mFAAmF;AACnF,eAAO,MAAM,eAAe;aAC3B,QAAQ,EAAE,UAAU;aACpB,YAAY,EAAE,cAAc;aAC5B,WAAW,EAAE,aAAa;aAC1B,eAAe,EAAE,iBAAiB;CACzB,CAAC;AACX,MAAM,MAAM,cAAc,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc;aAC1B,WAAW,EAAE,aAAa;aAC1B,iBAAiB,EAAE,mBAAmB;aACtC,iBAAiB,EAAE,mBAAmB;CAC7B,CAAC;AACX,MAAM,MAAM,aAAa,GACxB,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAA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* This file is the code transcription of
5
+ * `packages/edge-mesh/docs/medico/modelo-datos.md`. Field names here are the
6
+ * document's names, deliberately: `autoridad`, `emitidoEn`, `vigenteHasta`,
7
+ * `idLicencia`, `tipo`, `objetoAval`. Do not rename them to something more
8
+ * descriptive; the design doc is the specification and the wire format must
9
+ * match it byte for byte once signatures exist.
10
+ *
11
+ * ─── WHY THIS IS NOT A "user" OBJECT ────────────────────────────────────────
12
+ *
13
+ * The most common design error in this kind of system is collapsing four layers
14
+ * into one. They are kept apart here because they prove different things:
15
+ *
16
+ * layer 0 `NodoId` I control a key mathematics
17
+ * layer 1 `CredencialMedica` this human holds a license the state
18
+ * layer 2 `Aval` I checked layer 1 and stand behind it a peer
19
+ * layer 3 `Karma` peers repeatedly endorsed me the sum
20
+ *
21
+ * Access is granted by layer 1 + layer 2, never by layer 0 (worthless as merit)
22
+ * and never by layer 3 (mintable by anyone willing to spend a few signatures).
23
+ * See `docs/medico/reglas-red.md` §1.
24
+ *
25
+ * ─── THE TWO DEFECTS THIS SHAPE EXISTS TO CLOSE ─────────────────────────────
26
+ *
27
+ * 1. `unknown` IS NOT `valid`. The OrionHealth pattern
28
+ * (`apps/OrionHealth/lib/features/doctor_verification/domain/services/license_verifier.dart`)
29
+ * returns `LicenseVerificationResult.unknown` when a country's registry is
30
+ * empty. In a mesh that lets a node self-attest, "unverified but proceed"
31
+ * makes an *unsupported country* a bypass. So `EstadoVerificacionRegistro`
32
+ * in `./verificador.ts` has no third state at all: `verificado` and
33
+ * `no_verificado` only. The ambiguity is not representable.
34
+ *
35
+ * 2. A HASH SET CANNOT EXPRESS EXPIRY. OrionHealth declares `expired` in its
36
+ * enum and never returns it, because list membership carries no validity
37
+ * window. In a mesh that runs for years, immutable hash-set membership means
38
+ * a licence cancelled in 2027 still verifies forever. So `vigenteHasta` is a
39
+ * required field, signed by the issuer, not inferred from list membership.
40
+ *
41
+ * Nothing in this file performs I/O. Verification against a real registry
42
+ * snapshot is Phase 3; the extension point is `VerificadorRegistroPais`.
43
+ */
44
+ /** Wire version of the credential / record shape. Bumped only on a breaking change. */
45
+ export const VERSION_MODELO = 1;
46
+ /**
47
+ * The five fields every credential must carry, named as the design doc names
48
+ * them. Mapped to the plain-language description they satisfy:
49
+ *
50
+ * - source → `autoridad` ("who issued this")
51
+ * - published → `emitidoEn` ("when it was issued")
52
+ * - reviewed → `vigenteHasta` ("when it stops being current")
53
+ * - licence → `idLicencia` ("which licence, as a hash")
54
+ * - claim backed → `tipo` ("what kind of claim this is")
55
+ *
56
+ * Exported as data so a validation error can name the field that was missing
57
+ * instead of returning a bare boolean.
58
+ */
59
+ export const CAMPOS_OBLIGATORIOS_CREDENCIAL = [
60
+ "autoridad",
61
+ "emitidoEn",
62
+ "vigenteHasta",
63
+ "idLicencia",
64
+ "tipo",
65
+ ];
66
+ /** What kind of claim a credential makes. Specialties are separate credentials. */
67
+ export const TIPO_CREDENCIAL = {
68
+ LICENCIA: "licencia",
69
+ ESPECIALIDAD: "especialidad",
70
+ COLEGIACION: "colegiacion",
71
+ REGISTRO_RETHUS: "registro_rethus",
72
+ };
73
+ /**
74
+ * How honestly the credential was obtained. This is the label peers read; it is
75
+ * not decoration:
76
+ *
77
+ * - `autofirmada` the node signed its own claim. A format-valid
78
+ * assertion by an anonymous party, **zero** evidential
79
+ * weight. Useful only so a peer knows what to go check.
80
+ * - `atestiguada_pares` N peers each verified it independently and signed an
81
+ * `Aval`. This is the state that opens access.
82
+ * - `anclada_autoridad` the state's or the college's own key signed it.
83
+ * Strongest, and the only state that survives peers
84
+ * going offline.
85
+ */
86
+ export const ESTADO_EMISION = {
87
+ AUTOFIRMADA: "autofirmada",
88
+ ANCLADA_AUTORIDAD: "anclada_autoridad",
89
+ ATESTIGUADA_PARES: "atestiguada_pares",
90
+ };
91
+ /**
92
+ * What an `Aval` is about. The load-bearing distinction is that only the first
93
+ * two can promote a credential to `atestiguada_pares`.
94
+ *
95
+ * `interaccion_clinica` asserts *"a real encounter occurred"* — nothing more.
96
+ * No date, no diagnosis, no content. It is a boolean with a signer, and
97
+ * letting it count toward credential verification is exactly the hole that
98
+ * admits a well-liked non-doctor into a network of doctors.
99
+ */
100
+ export const OBJETO_AVAL = {
101
+ LICENCIA_VERIFICADA: "licencia_verificada",
102
+ ESPECIALIDAD_VERIFICADA: "especialidad_verificada",
103
+ INTERACCION_CLINICA: "interaccion_clinica",
104
+ DOCENCIA: "docencia",
105
+ };
106
+ /**
107
+ * How the avalador actually checked it. Not decoration: two `Aval`s about the
108
+ * same subject with different methods deserve different weight, and a peer must
109
+ * be able to see *why* it is trusting someone.
110
+ *
111
+ * - `registro_por_pais` cheap, reproducible offline, but only as fresh as the
112
+ * snapshot. `versionRegistro` is mandatory so a stale
113
+ * snapshot is visible on the face of the record.
114
+ * - `colegio_directo` expensive, rare, out-of-band with the college, and
115
+ * the only method that survives the registry being
116
+ * wrong. What a founding cohort should hold.
117
+ * - `testimonio_directo` cheap and unfalsifiable. Good signal of collegiality,
118
+ * **weak** signal of licensure.
119
+ * - `supervision` time-bounded, non-symmetric (A supervises B ⇒ B's
120
+ * aval of A is not symmetric evidence), and the
121
+ * strongest peer signal because it implies sustained
122
+ * observation.
123
+ */
124
+ export const CLASE_VERIFICACION = {
125
+ REGISTRO_POR_PAIS: "registro_por_pais",
126
+ COLEGIO_DIRECTO: "colegio_directo",
127
+ TESTIMONIO_DIRECTO: "testimonio_directo",
128
+ SUPERVISION: "supervision",
129
+ };
130
+ /** `'anual'` must be renewed and feeds decay. */
131
+ export const ALCANCE_AVAL = {
132
+ PERMANENTE: "permanente",
133
+ ANUAL: "anual",
134
+ };
135
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/medico/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAIH,uFAAuF;AACvF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAU,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC7C,WAAW;IACX,WAAW;IACX,cAAc;IACd,YAAY;IACZ,MAAM;CACG,CAAC;AAEX,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,WAAW,EAAE,aAAa;IAC1B,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAIX;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,WAAW,EAAE,aAAa;IAC1B,iBAAiB,EAAE,mBAAmB;IACtC,iBAAiB,EAAE,mBAAmB;CAC7B,CAAC;AAqDX;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,mBAAmB,EAAE,qBAAqB;IAC1C,uBAAuB,EAAE,yBAAyB;IAClD,mBAAmB,EAAE,qBAAqB;IAC1C,QAAQ,EAAE,UAAU;CACX,CAAC;AAGX;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,iBAAiB,EAAE,mBAAmB;IACtC,eAAe,EAAE,iBAAiB;IAClC,kBAAkB,EAAE,oBAAoB;IACxC,WAAW,EAAE,aAAa;CACjB,CAAC;AAkBX,iDAAiD;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;CACL,CAAC"}