gdc-sdk-front-ts 0.6.2 → 0.6.6

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 (396) hide show
  1. package/README.md +36 -8
  2. package/dist/ProfileManager.d.ts +22 -0
  3. package/dist/ProfileManager.js +155 -0
  4. package/dist/gdc-common-utils-ts/src/AesManager.d.ts +27 -0
  5. package/dist/gdc-common-utils-ts/src/AesManager.js +64 -0
  6. package/dist/gdc-common-utils-ts/src/CryptographyService.d.ts +76 -0
  7. package/dist/gdc-common-utils-ts/src/CryptographyService.js +401 -0
  8. package/dist/gdc-common-utils-ts/src/constants/actor-session.d.ts +40 -0
  9. package/dist/gdc-common-utils-ts/src/constants/actor-session.js +40 -0
  10. package/dist/gdc-common-utils-ts/src/constants/communication.d.ts +28 -0
  11. package/dist/gdc-common-utils-ts/src/constants/communication.js +14 -0
  12. package/dist/gdc-common-utils-ts/src/constants/cryptography.d.ts +58 -0
  13. package/dist/gdc-common-utils-ts/src/constants/cryptography.js +49 -0
  14. package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.d.ts +11 -0
  15. package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.js +11 -0
  16. package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.d.ts +27 -0
  17. package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.js +27 -0
  18. package/dist/gdc-common-utils-ts/src/constants/device.d.ts +16 -0
  19. package/dist/gdc-common-utils-ts/src/constants/device.js +15 -0
  20. package/dist/gdc-common-utils-ts/src/constants/did-services.d.ts +42 -0
  21. package/dist/gdc-common-utils-ts/src/constants/did-services.js +40 -0
  22. package/dist/gdc-common-utils-ts/src/constants/eu-countries.d.ts +36 -0
  23. package/dist/gdc-common-utils-ts/src/constants/eu-countries.js +69 -0
  24. package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.d.ts +12 -0
  25. package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.js +12 -0
  26. package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.d.ts +52 -0
  27. package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.js +33 -0
  28. package/dist/gdc-common-utils-ts/src/constants/fhir-versions.d.ts +10 -0
  29. package/dist/gdc-common-utils-ts/src/constants/fhir-versions.js +10 -0
  30. package/dist/gdc-common-utils-ts/src/constants/healthcare.d.ts +496 -0
  31. package/dist/gdc-common-utils-ts/src/constants/healthcare.js +274 -0
  32. package/dist/gdc-common-utils-ts/src/constants/hl7-roles.d.ts +44 -0
  33. package/dist/gdc-common-utils-ts/src/constants/hl7-roles.js +208 -0
  34. package/dist/gdc-common-utils-ts/src/constants/index.d.ts +21 -0
  35. package/dist/gdc-common-utils-ts/src/constants/index.js +21 -0
  36. package/dist/gdc-common-utils-ts/src/constants/network.d.ts +25 -0
  37. package/dist/gdc-common-utils-ts/src/constants/network.js +17 -0
  38. package/dist/gdc-common-utils-ts/src/constants/schemaorg.d.ts +175 -0
  39. package/dist/gdc-common-utils-ts/src/constants/schemaorg.js +261 -0
  40. package/dist/gdc-common-utils-ts/src/constants/sectors.d.ts +24 -0
  41. package/dist/gdc-common-utils-ts/src/constants/sectors.js +24 -0
  42. package/dist/gdc-common-utils-ts/src/constants/service-capabilities.d.ts +82 -0
  43. package/dist/gdc-common-utils-ts/src/constants/service-capabilities.js +105 -0
  44. package/dist/gdc-common-utils-ts/src/constants/smart.d.ts +12 -0
  45. package/dist/gdc-common-utils-ts/src/constants/smart.js +12 -0
  46. package/dist/gdc-common-utils-ts/src/constants/urn.d.ts +11 -0
  47. package/dist/gdc-common-utils-ts/src/constants/urn.js +11 -0
  48. package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.d.ts +34 -0
  49. package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.js +42 -0
  50. package/dist/gdc-common-utils-ts/src/constants/vital-signs.d.ts +75 -0
  51. package/dist/gdc-common-utils-ts/src/constants/vital-signs.js +33 -0
  52. package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.d.ts +15 -0
  53. package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.js +16 -0
  54. package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.d.ts +22 -0
  55. package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.js +81 -0
  56. package/dist/gdc-common-utils-ts/src/examples/consent-access.d.ts +30 -0
  57. package/dist/gdc-common-utils-ts/src/examples/consent-access.js +121 -0
  58. package/dist/gdc-common-utils-ts/src/examples/contract-examples.d.ts +15 -0
  59. package/dist/gdc-common-utils-ts/src/examples/contract-examples.js +16 -0
  60. package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.d.ts +98 -0
  61. package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.js +141 -0
  62. package/dist/gdc-common-utils-ts/src/examples/frontend-session.d.ts +13 -0
  63. package/dist/gdc-common-utils-ts/src/examples/frontend-session.js +24 -0
  64. package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.d.ts +64 -0
  65. package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.js +77 -0
  66. package/dist/gdc-common-utils-ts/src/examples/index.d.ts +14 -0
  67. package/dist/gdc-common-utils-ts/src/examples/index.js +14 -0
  68. package/dist/gdc-common-utils-ts/src/examples/individual-controller.d.ts +100 -0
  69. package/dist/gdc-common-utils-ts/src/examples/individual-controller.js +71 -0
  70. package/dist/gdc-common-utils-ts/src/examples/lifecycle.d.ts +505 -0
  71. package/dist/gdc-common-utils-ts/src/examples/lifecycle.js +291 -0
  72. package/dist/gdc-common-utils-ts/src/examples/organization-controller.d.ts +163 -0
  73. package/dist/gdc-common-utils-ts/src/examples/organization-controller.js +93 -0
  74. package/dist/gdc-common-utils-ts/src/examples/professional.d.ts +228 -0
  75. package/dist/gdc-common-utils-ts/src/examples/professional.js +324 -0
  76. package/dist/gdc-common-utils-ts/src/examples/related-person.d.ts +10 -0
  77. package/dist/gdc-common-utils-ts/src/examples/related-person.js +13 -0
  78. package/dist/gdc-common-utils-ts/src/examples/relationship-access.d.ts +11 -0
  79. package/dist/gdc-common-utils-ts/src/examples/relationship-access.js +96 -0
  80. package/dist/gdc-common-utils-ts/src/examples/shared.d.ts +220 -0
  81. package/dist/gdc-common-utils-ts/src/examples/shared.js +191 -0
  82. package/dist/gdc-common-utils-ts/src/hmac.d.ts +14 -0
  83. package/dist/gdc-common-utils-ts/src/hmac.js +24 -0
  84. package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.d.ts +6 -0
  85. package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.js +15 -0
  86. package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.d.ts +4 -0
  87. package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.js +13 -0
  88. package/dist/gdc-common-utils-ts/src/index.d.ts +10 -0
  89. package/dist/gdc-common-utils-ts/src/index.js +10 -0
  90. package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.d.ts +139 -0
  91. package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.js +8 -0
  92. package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.d.ts +28 -0
  93. package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.js +3 -0
  94. package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.d.ts +154 -0
  95. package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.js +3 -0
  96. package/dist/gdc-common-utils-ts/src/models/actor-session.d.ts +9 -0
  97. package/dist/gdc-common-utils-ts/src/models/actor-session.js +3 -0
  98. package/dist/gdc-common-utils-ts/src/models/aes.d.ts +85 -0
  99. package/dist/gdc-common-utils-ts/src/models/aes.js +10 -0
  100. package/dist/gdc-common-utils-ts/src/models/auth.d.ts +35 -0
  101. package/dist/gdc-common-utils-ts/src/models/auth.js +3 -0
  102. package/dist/gdc-common-utils-ts/src/models/bundle.d.ts +153 -0
  103. package/dist/gdc-common-utils-ts/src/models/bundle.js +25 -0
  104. package/dist/gdc-common-utils-ts/src/models/clinical-sections.d.ts +36 -0
  105. package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.d.ts +150 -0
  106. package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.js +104 -0
  107. package/dist/gdc-common-utils-ts/src/models/clinical-sections.js +32 -0
  108. package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.d.ts +126 -0
  109. package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.js +67 -0
  110. package/dist/gdc-common-utils-ts/src/models/comm.d.ts +56 -0
  111. package/dist/gdc-common-utils-ts/src/models/comm.js +4 -0
  112. package/dist/gdc-common-utils-ts/src/models/confidential-job.d.ts +78 -0
  113. package/dist/gdc-common-utils-ts/src/models/confidential-job.js +20 -0
  114. package/dist/gdc-common-utils-ts/src/models/confidential-message.d.ts +97 -0
  115. package/dist/gdc-common-utils-ts/src/models/confidential-message.js +4 -0
  116. package/dist/gdc-common-utils-ts/src/models/confidential-storage.d.ts +134 -0
  117. package/dist/gdc-common-utils-ts/src/models/confidential-storage.js +3 -0
  118. package/dist/gdc-common-utils-ts/src/models/consent-access.d.ts +79 -0
  119. package/dist/gdc-common-utils-ts/src/models/consent-access.js +2 -0
  120. package/dist/gdc-common-utils-ts/src/models/consent-rule.d.ts +122 -0
  121. package/dist/gdc-common-utils-ts/src/models/consent-rule.js +22 -0
  122. package/dist/gdc-common-utils-ts/src/models/crypto.d.ts +35 -0
  123. package/dist/gdc-common-utils-ts/src/models/crypto.js +3 -0
  124. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.d.ts +79 -0
  125. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.js +2 -0
  126. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.d.ts +68 -0
  127. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.js +9 -0
  128. package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.d.ts +14 -0
  129. package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.js +2 -0
  130. package/dist/gdc-common-utils-ts/src/models/device-license.d.ts +134 -0
  131. package/dist/gdc-common-utils-ts/src/models/device-license.js +3 -0
  132. package/dist/gdc-common-utils-ts/src/models/did.d.ts +108 -0
  133. package/dist/gdc-common-utils-ts/src/models/did.js +3 -0
  134. package/dist/gdc-common-utils-ts/src/models/fhir-documents.d.ts +101 -0
  135. package/dist/gdc-common-utils-ts/src/models/fhir-documents.js +3 -0
  136. package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.d.ts +104 -0
  137. package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.js +2 -0
  138. package/dist/gdc-common-utils-ts/src/models/index.d.ts +42 -0
  139. package/dist/gdc-common-utils-ts/src/models/index.js +42 -0
  140. package/dist/gdc-common-utils-ts/src/models/indexing.d.ts +11 -0
  141. package/dist/gdc-common-utils-ts/src/models/indexing.js +18 -0
  142. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.d.ts +24 -0
  143. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.js +36 -0
  144. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.d.ts +53 -0
  145. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.js +55 -0
  146. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.d.ts +14 -0
  147. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.js +25 -0
  148. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.d.ts +13 -0
  149. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.js +23 -0
  150. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.d.ts +36 -0
  151. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.js +89 -0
  152. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.d.ts +341 -0
  153. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.js +204 -0
  154. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.d.ts +9 -0
  155. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.js +3 -0
  156. package/dist/gdc-common-utils-ts/src/models/interoperable-claims.d.ts +5 -0
  157. package/dist/gdc-common-utils-ts/src/models/interoperable-claims.js +7 -0
  158. package/dist/gdc-common-utils-ts/src/models/issue.d.ts +57 -0
  159. package/dist/gdc-common-utils-ts/src/models/issue.js +75 -0
  160. package/dist/gdc-common-utils-ts/src/models/jsonapi.d.ts +13 -0
  161. package/dist/gdc-common-utils-ts/src/models/jsonapi.js +3 -0
  162. package/dist/gdc-common-utils-ts/src/models/jwe.d.ts +120 -0
  163. package/dist/gdc-common-utils-ts/src/models/jwe.js +3 -0
  164. package/dist/gdc-common-utils-ts/src/models/jwk.d.ts +39 -0
  165. package/dist/gdc-common-utils-ts/src/models/jwk.js +3 -0
  166. package/dist/gdc-common-utils-ts/src/models/jws.d.ts +35 -0
  167. package/dist/gdc-common-utils-ts/src/models/jws.js +3 -0
  168. package/dist/gdc-common-utils-ts/src/models/jwt.d.ts +9 -0
  169. package/dist/gdc-common-utils-ts/src/models/jwt.js +3 -0
  170. package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.d.ts +55 -0
  171. package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.js +58 -0
  172. package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.d.ts +33 -0
  173. package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.js +3 -0
  174. package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.d.ts +50 -0
  175. package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.js +3 -0
  176. package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.d.ts +67 -0
  177. package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.js +3 -0
  178. package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.d.ts +51 -0
  179. package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.js +5 -0
  180. package/dist/gdc-common-utils-ts/src/models/openid-device.d.ts +119 -0
  181. package/dist/gdc-common-utils-ts/src/models/openid-device.js +3 -0
  182. package/dist/gdc-common-utils-ts/src/models/operation-outcome.d.ts +26 -0
  183. package/dist/gdc-common-utils-ts/src/models/operation-outcome.js +3 -0
  184. package/dist/gdc-common-utils-ts/src/models/params.d.ts +133 -0
  185. package/dist/gdc-common-utils-ts/src/models/params.js +3 -0
  186. package/dist/gdc-common-utils-ts/src/models/relationship-access.d.ts +160 -0
  187. package/dist/gdc-common-utils-ts/src/models/relationship-access.js +21 -0
  188. package/dist/gdc-common-utils-ts/src/models/resource-document.d.ts +14 -0
  189. package/dist/gdc-common-utils-ts/src/models/resource-document.js +3 -0
  190. package/dist/gdc-common-utils-ts/src/models/response.d.ts +1 -0
  191. package/dist/gdc-common-utils-ts/src/models/response.js +3 -0
  192. package/dist/gdc-common-utils-ts/src/models/urlPath.d.ts +58 -0
  193. package/dist/gdc-common-utils-ts/src/models/urlPath.js +76 -0
  194. package/dist/gdc-common-utils-ts/src/models/verifiable-credential.d.ts +45 -0
  195. package/dist/gdc-common-utils-ts/src/models/verifiable-credential.js +8 -0
  196. package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.d.ts +53 -0
  197. package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.js +25 -0
  198. package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.d.ts +30 -0
  199. package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.js +81 -0
  200. package/dist/gdc-common-utils-ts/src/storage/index.d.ts +3 -0
  201. package/dist/gdc-common-utils-ts/src/storage/index.js +4 -0
  202. package/dist/gdc-common-utils-ts/src/utils/activation-policy.d.ts +86 -0
  203. package/dist/gdc-common-utils-ts/src/utils/activation-policy.js +218 -0
  204. package/dist/gdc-common-utils-ts/src/utils/activation-request.d.ts +81 -0
  205. package/dist/gdc-common-utils-ts/src/utils/activation-request.js +99 -0
  206. package/dist/gdc-common-utils-ts/src/utils/actor.d.ts +18 -0
  207. package/dist/gdc-common-utils-ts/src/utils/actor.js +36 -0
  208. package/dist/gdc-common-utils-ts/src/utils/base-convert.d.ts +60 -0
  209. package/dist/gdc-common-utils-ts/src/utils/base-convert.js +104 -0
  210. package/dist/gdc-common-utils-ts/src/utils/baseN.d.ts +35 -0
  211. package/dist/gdc-common-utils-ts/src/utils/baseN.js +174 -0
  212. package/dist/gdc-common-utils-ts/src/utils/bundle-query.d.ts +35 -0
  213. package/dist/gdc-common-utils-ts/src/utils/bundle-query.js +177 -0
  214. package/dist/gdc-common-utils-ts/src/utils/bundle.d.ts +13 -0
  215. package/dist/gdc-common-utils-ts/src/utils/bundle.js +39 -0
  216. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.d.ts +64 -0
  217. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.js +279 -0
  218. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.d.ts +55 -0
  219. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.js +291 -0
  220. package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.d.ts +110 -0
  221. package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.js +326 -0
  222. package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.d.ts +41 -0
  223. package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.js +170 -0
  224. package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.d.ts +41 -0
  225. package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.js +215 -0
  226. package/dist/gdc-common-utils-ts/src/utils/communication-identity.d.ts +152 -0
  227. package/dist/gdc-common-utils-ts/src/utils/communication-identity.js +121 -0
  228. package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.d.ts +79 -0
  229. package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.js +213 -0
  230. package/dist/gdc-common-utils-ts/src/utils/consent.d.ts +218 -0
  231. package/dist/gdc-common-utils-ts/src/utils/consent.js +679 -0
  232. package/dist/gdc-common-utils-ts/src/utils/content.d.ts +55 -0
  233. package/dist/gdc-common-utils-ts/src/utils/content.js +60 -0
  234. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.d.ts +130 -0
  235. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.js +307 -0
  236. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.d.ts +235 -0
  237. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.js +482 -0
  238. package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.d.ts +66 -0
  239. package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.js +109 -0
  240. package/dist/gdc-common-utils-ts/src/utils/did-resolution.d.ts +60 -0
  241. package/dist/gdc-common-utils-ts/src/utils/did-resolution.js +173 -0
  242. package/dist/gdc-common-utils-ts/src/utils/did.d.ts +124 -0
  243. package/dist/gdc-common-utils-ts/src/utils/did.js +204 -0
  244. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.d.ts +10 -0
  245. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.js +15 -0
  246. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.d.ts +48 -0
  247. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.js +81 -0
  248. package/dist/gdc-common-utils-ts/src/utils/didcomm.d.ts +60 -0
  249. package/dist/gdc-common-utils-ts/src/utils/didcomm.js +78 -0
  250. package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.d.ts +28 -0
  251. package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.js +64 -0
  252. package/dist/gdc-common-utils-ts/src/utils/fhir-cid.d.ts +60 -0
  253. package/dist/gdc-common-utils-ts/src/utils/fhir-cid.js +152 -0
  254. package/dist/gdc-common-utils-ts/src/utils/fhir-validator.d.ts +61 -0
  255. package/dist/gdc-common-utils-ts/src/utils/fhir-validator.js +91 -0
  256. package/dist/gdc-common-utils-ts/src/utils/format-converter.d.ts +21 -0
  257. package/dist/gdc-common-utils-ts/src/utils/format-converter.js +109 -0
  258. package/dist/gdc-common-utils-ts/src/utils/index.d.ts +39 -0
  259. package/dist/gdc-common-utils-ts/src/utils/index.js +39 -0
  260. package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.d.ts +55 -0
  261. package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.js +191 -0
  262. package/dist/gdc-common-utils-ts/src/utils/jwt.d.ts +53 -0
  263. package/dist/gdc-common-utils-ts/src/utils/jwt.js +154 -0
  264. package/dist/gdc-common-utils-ts/src/utils/manager-error.d.ts +15 -0
  265. package/dist/gdc-common-utils-ts/src/utils/manager-error.js +21 -0
  266. package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.d.ts +56 -0
  267. package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.js +127 -0
  268. package/dist/gdc-common-utils-ts/src/utils/multibase58.d.ts +13 -0
  269. package/dist/gdc-common-utils-ts/src/utils/multibase58.js +40 -0
  270. package/dist/gdc-common-utils-ts/src/utils/multibasehash.d.ts +8 -0
  271. package/dist/gdc-common-utils-ts/src/utils/multibasehash.js +23 -0
  272. package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.d.ts +1 -0
  273. package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.js +35 -0
  274. package/dist/gdc-common-utils-ts/src/utils/normalize.d.ts +16 -0
  275. package/dist/gdc-common-utils-ts/src/utils/normalize.js +40 -0
  276. package/dist/gdc-common-utils-ts/src/utils/object-convert.d.ts +20 -0
  277. package/dist/gdc-common-utils-ts/src/utils/object-convert.js +51 -0
  278. package/dist/gdc-common-utils-ts/src/utils/smart-scope.d.ts +28 -0
  279. package/dist/gdc-common-utils-ts/src/utils/smart-scope.js +29 -0
  280. package/dist/gdc-common-utils-ts/src/utils/string-convert.d.ts +24 -0
  281. package/dist/gdc-common-utils-ts/src/utils/string-convert.js +62 -0
  282. package/dist/gdc-common-utils-ts/src/utils/string-utils.d.ts +25 -0
  283. package/dist/gdc-common-utils-ts/src/utils/string-utils.js +66 -0
  284. package/dist/gdc-common-utils-ts/src/utils/url.d.ts +26 -0
  285. package/dist/gdc-common-utils-ts/src/utils/url.js +44 -0
  286. package/dist/gdc-common-utils-ts/src/utils/vp-token.d.ts +139 -0
  287. package/dist/gdc-common-utils-ts/src/utils/vp-token.js +256 -0
  288. package/dist/gdc-sdk-core-ts/src/actor-model.d.ts +56 -0
  289. package/dist/gdc-sdk-core-ts/src/actor-model.js +112 -0
  290. package/dist/gdc-sdk-core-ts/src/app-identity.d.ts +80 -0
  291. package/dist/gdc-sdk-core-ts/src/app-identity.js +147 -0
  292. package/dist/gdc-sdk-core-ts/src/bootstrap-facade.d.ts +165 -0
  293. package/dist/gdc-sdk-core-ts/src/bootstrap-facade.js +191 -0
  294. package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.d.ts +112 -0
  295. package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.js +185 -0
  296. package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.d.ts +32 -0
  297. package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.js +215 -0
  298. package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.d.ts +55 -0
  299. package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.js +190 -0
  300. package/dist/gdc-sdk-core-ts/src/communication-document-facade.d.ts +55 -0
  301. package/dist/gdc-sdk-core-ts/src/communication-document-facade.js +194 -0
  302. package/dist/gdc-sdk-core-ts/src/communication-draft.d.ts +104 -0
  303. package/dist/gdc-sdk-core-ts/src/communication-draft.js +143 -0
  304. package/dist/gdc-sdk-core-ts/src/communication-outbox.d.ts +49 -0
  305. package/dist/gdc-sdk-core-ts/src/communication-outbox.js +62 -0
  306. package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.d.ts +180 -0
  307. package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.js +455 -0
  308. package/dist/gdc-sdk-core-ts/src/consent-access.d.ts +73 -0
  309. package/dist/gdc-sdk-core-ts/src/consent-access.js +109 -0
  310. package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.d.ts +5 -0
  311. package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.js +6 -0
  312. package/dist/gdc-sdk-core-ts/src/consent-communication-operations.d.ts +82 -0
  313. package/dist/gdc-sdk-core-ts/src/consent-communication-operations.js +135 -0
  314. package/dist/gdc-sdk-core-ts/src/did-resolution-session.d.ts +33 -0
  315. package/dist/gdc-sdk-core-ts/src/did-resolution-session.js +56 -0
  316. package/dist/gdc-sdk-core-ts/src/discovery-facade.d.ts +84 -0
  317. package/dist/gdc-sdk-core-ts/src/discovery-facade.js +24 -0
  318. package/dist/gdc-sdk-core-ts/src/identity-model.d.ts +46 -0
  319. package/dist/gdc-sdk-core-ts/src/identity-model.js +2 -0
  320. package/dist/gdc-sdk-core-ts/src/identity-store.d.ts +83 -0
  321. package/dist/gdc-sdk-core-ts/src/identity-store.js +51 -0
  322. package/dist/gdc-sdk-core-ts/src/index.d.ts +23 -0
  323. package/dist/gdc-sdk-core-ts/src/index.js +24 -0
  324. package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.d.ts +5 -0
  325. package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.js +6 -0
  326. package/dist/gdc-sdk-core-ts/src/polling-model.d.ts +35 -0
  327. package/dist/gdc-sdk-core-ts/src/polling-model.js +24 -0
  328. package/dist/gdc-sdk-core-ts/src/relationship-access.d.ts +40 -0
  329. package/dist/gdc-sdk-core-ts/src/relationship-access.js +150 -0
  330. package/dist/gdc-sdk-core-ts/src/session-model.d.ts +134 -0
  331. package/dist/gdc-sdk-core-ts/src/session-model.js +2 -0
  332. package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.d.ts +19 -0
  333. package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.js +19 -0
  334. package/dist/gdc-sdk-core-ts/src/vital-signs.d.ts +38 -0
  335. package/dist/gdc-sdk-core-ts/src/vital-signs.js +155 -0
  336. package/dist/gdc-sdk-front-ts/src/ClientSDK.d.ts +99 -0
  337. package/dist/gdc-sdk-front-ts/src/ClientSDK.js +177 -0
  338. package/dist/gdc-sdk-front-ts/src/ProfileManager.d.ts +140 -0
  339. package/dist/gdc-sdk-front-ts/src/ProfileManager.js +76 -0
  340. package/dist/gdc-sdk-front-ts/src/ProfileRegistry.d.ts +11 -0
  341. package/dist/gdc-sdk-front-ts/src/ProfileRegistry.js +26 -0
  342. package/dist/gdc-sdk-front-ts/src/VerifierService.d.ts +6 -0
  343. package/dist/gdc-sdk-front-ts/src/VerifierService.js +10 -0
  344. package/dist/gdc-sdk-front-ts/src/actor-session.d.ts +2 -0
  345. package/dist/gdc-sdk-front-ts/src/actor-session.js +2 -0
  346. package/dist/gdc-sdk-front-ts/src/capabilityMapper.d.ts +8 -0
  347. package/dist/gdc-sdk-front-ts/src/capabilityMapper.js +28 -0
  348. package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.d.ts +4 -0
  349. package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.js +5 -0
  350. package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.d.ts +54 -0
  351. package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.js +85 -0
  352. package/dist/gdc-sdk-front-ts/src/discovery/index.d.ts +3 -0
  353. package/dist/gdc-sdk-front-ts/src/discovery/index.js +4 -0
  354. package/dist/gdc-sdk-front-ts/src/discovery/mappers.d.ts +29 -0
  355. package/dist/gdc-sdk-front-ts/src/discovery/mappers.js +60 -0
  356. package/dist/gdc-sdk-front-ts/src/discovery/types.d.ts +83 -0
  357. package/dist/gdc-sdk-front-ts/src/discovery/types.js +2 -0
  358. package/dist/gdc-sdk-front-ts/src/index.d.ts +15 -0
  359. package/dist/gdc-sdk-front-ts/src/index.js +16 -0
  360. package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.d.ts +4 -0
  361. package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.js +5 -0
  362. package/dist/gdc-sdk-front-ts/src/roleRegistry.d.ts +19 -0
  363. package/dist/gdc-sdk-front-ts/src/roleRegistry.js +2 -0
  364. package/dist/gdc-sdk-front-ts/src/runtime-contracts.d.ts +22 -0
  365. package/dist/gdc-sdk-front-ts/src/runtime-contracts.js +7 -0
  366. package/dist/gdc-sdk-front-ts/src/services.d.ts +167 -0
  367. package/dist/gdc-sdk-front-ts/src/services.js +78 -0
  368. package/dist/gdc-sdk-front-ts/src/session-descriptor.d.ts +11 -0
  369. package/dist/gdc-sdk-front-ts/src/session-descriptor.js +8 -0
  370. package/dist/gdc-sdk-front-ts/src/types.d.ts +11 -0
  371. package/dist/gdc-sdk-front-ts/src/types.js +1 -0
  372. package/dist/index.d.ts +8 -0
  373. package/dist/index.js +8 -0
  374. package/dist/medication-claim-helpers.d.ts +4 -0
  375. package/dist/medication-claim-helpers.js +5 -0
  376. package/dist/orchestration/client-port.d.ts +161 -0
  377. package/dist/orchestration/client-port.js +26 -0
  378. package/dist/orchestration/facades.d.ts +65 -0
  379. package/dist/orchestration/facades.js +142 -0
  380. package/dist/orchestration/host-onboarding-sdk.d.ts +9 -0
  381. package/dist/orchestration/host-onboarding-sdk.js +16 -0
  382. package/dist/orchestration/individual-controller-sdk.d.ts +18 -0
  383. package/dist/orchestration/individual-controller-sdk.js +43 -0
  384. package/dist/orchestration/individual-member-sdk.d.ts +8 -0
  385. package/dist/orchestration/individual-member-sdk.js +13 -0
  386. package/dist/orchestration/organization-controller-sdk.d.ts +11 -0
  387. package/dist/orchestration/organization-controller-sdk.js +22 -0
  388. package/dist/orchestration/organization-employee-sdk.d.ts +8 -0
  389. package/dist/orchestration/organization-employee-sdk.js +13 -0
  390. package/dist/orchestration/personal-sdk.d.ts +13 -0
  391. package/dist/orchestration/personal-sdk.js +28 -0
  392. package/dist/orchestration/professional-sdk.d.ts +10 -0
  393. package/dist/orchestration/professional-sdk.js +19 -0
  394. package/dist/services.d.ts +58 -10
  395. package/dist/services.js +88 -5
  396. package/package.json +3 -3
package/README.md CHANGED
@@ -14,22 +14,35 @@ Use this package when your frontend needs to:
14
14
  This package is frontend-facing. It should explain app flows, not gateway route
15
15
  details.
16
16
 
17
+ Architectural rule:
18
+
19
+ - `gdc-sdk-front-ts` should converge on the same actor-scoped facade boundaries
20
+ as `gdc-sdk-node-ts`
21
+ - transport and adapter details may differ
22
+ - business ownership must not differ by runtime
23
+
17
24
  ## Start Here
18
25
 
19
26
  If you are integrating this package for the first time, open these in order:
20
27
 
21
- 1. [docs/SDK_INTEGRATION_101.md](./docs/SDK_INTEGRATION_101.md)
22
- Real frontend/native setup, imports, `new ClientSDK(...)`,
23
- `initializeCommunicationIdentity(...)`, provider discovery, and
28
+ 1. [gdc-sdk-core-ts/docs/101-SDK_PACKAGE_BOUNDARIES.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/101-SDK_PACKAGE_BOUNDARIES.md)
29
+ Why `core`, `node`, and `front` are separate packages, what each one owns,
30
+ and why frontend facades should mirror backend actor boundaries.
31
+ 1. [docs/101-SDK_INTEGRATION.md](./docs/101-SDK_INTEGRATION.md)
32
+ Real frontend/native setup, imports, `new ClientSDK(...)`,
33
+ `initializeCommunicationIdentity(...)`, provider discovery, and
24
34
  `initializeSession(...)`.
25
35
  2. [docs/DATASPACE_DISCOVERY_FRONTEND_TODO.md](./docs/DATASPACE_DISCOVERY_FRONTEND_TODO.md)
26
36
  Frontend discovery guide for BFF-first provider/operator discovery, UI card
27
37
  mapping, and copy/paste backend DTO consumption.
28
- 3. [gdc-sdk-core-ts/docs/SDK_FLOWS_101.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/SDK_FLOWS_101.md)
38
+ 3. [gdc-sdk-core-ts/docs/101-SDK_FLOWS.md](https://github.com/Global-DataCare/gdc-sdk-core-ts/blob/main/docs/101-SDK_FLOWS.md)
29
39
  Shared business-flow map by actor family.
30
- 4. [gdc-common-utils-ts/src/examples/frontend-session.ts](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/src/examples/frontend-session.ts)
40
+ 4. [gdc-sdk-node-ts/docs/101-LIVE_GW_LOCAL.md](https://github.com/Global-DataCare/gdc-sdk-node-ts/blob/main/docs/101-LIVE_GW_LOCAL.md)
41
+ Canonical local/TTY/Docker GW reference when the frontend team also needs a
42
+ real local GW running for end-to-end checks.
43
+ 5. [gdc-common-utils-ts/src/examples/frontend-session.ts](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/src/examples/frontend-session.ts)
31
44
  Shared profile/session payload source of truth.
32
- 5. [gdc-common-utils-ts/docs/LIFECYCLE_101.md](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/docs/LIFECYCLE_101.md)
45
+ 6. [gdc-common-utils-ts/docs/LIFECYCLE_101.md](https://github.com/Global-DataCare/gdc-common-utils-ts/blob/main/docs/LIFECYCLE_101.md)
33
46
  Canonical lifecycle semantics and reusable placeholders for UI and portal flows.
34
47
 
35
48
  If you need the shortest path:
@@ -37,12 +50,12 @@ If you need the shortest path:
37
50
  - app identity required by GW CORE:
38
51
  `appId` mandatory, `appVersion` optional with default `v1.0`
39
52
  - frontend technical identity:
40
- [`initializeCommunicationIdentity(...)`](./docs/SDK_INTEGRATION_101.md)
53
+ [`initializeCommunicationIdentity(...)`](./docs/101-SDK_INTEGRATION.md)
41
54
  for the technical device/channel profile identity, not the legal organization id
42
55
  - main runtime class:
43
56
  [`ClientSDK`](src/ClientSDK.ts)
44
57
  - profile/session bootstrap:
45
- [`initializeSession(...)`](./docs/SDK_INTEGRATION_101.md)
58
+ [`initializeSession(...)`](./docs/101-SDK_INTEGRATION.md)
46
59
 
47
60
  ## Executable Usage Examples
48
61
 
@@ -83,18 +96,33 @@ Copy/paste starting point:
83
96
  import { HttpDataspaceDiscoveryClient } from 'gdc-sdk-front-ts';
84
97
  import { ServiceCapabilityToken } from 'gdc-common-utils-ts/constants';
85
98
 
99
+ // Frontend talks to its own backend/BFF.
100
+ // The frontend should not need to know `networkType` or host bootstrap rules.
86
101
  const discoveryClient = new HttpDataspaceDiscoveryClient({
87
102
  endpointUrl: '/api/dataspace-discovery/providers',
88
103
  });
89
104
 
105
+ // Ask for providers for one business sector in one jurisdiction.
90
106
  const result = await discoveryClient.listPublishedProviders({
91
107
  sector: 'animal-care',
92
108
  jurisdiction: 'ES',
93
109
  coverageScope: 'EU',
94
110
  providerCapability: ServiceCapabilityToken.IndexProvider,
95
111
  });
112
+
113
+ // Use the returned cards directly in the UI.
114
+ for (const provider of result.providers) {
115
+ console.log(provider.did, provider.title, provider.endpointUrl);
116
+ }
96
117
  ```
97
118
 
119
+ What happens behind that frontend call:
120
+
121
+ - frontend sends `sector + jurisdiction + capability` to its backend
122
+ - backend uses `gdc-sdk-node-ts` with `default-first`
123
+ - backend resolves hosts and providers
124
+ - frontend receives normalized cards and renders them
125
+
98
126
  ## Actor Split And UI Scope
99
127
 
100
128
  The frontend package must also start from actor families, because screens and
@@ -1,11 +1,25 @@
1
1
  import type { DeviceAppType, DeviceUserClass } from 'gdc-common-utils-ts/constants';
2
2
  import type { Profile } from './types.js';
3
3
  import type { CommonServices, FamilyAdminServices, IndividualServices, OrgAdminServices, ProfessionalServices } from './roleRegistry.js';
4
+ import { HostOnboardingSdk } from './orchestration/host-onboarding-sdk.js';
5
+ import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
6
+ import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
7
+ import { OrganizationControllerSdk } from './orchestration/organization-controller-sdk.js';
8
+ import { OrganizationEmployeeSdk } from './orchestration/organization-employee-sdk.js';
9
+ import { PersonalSdk } from './orchestration/personal-sdk.js';
10
+ import { ProfessionalSdk } from './orchestration/professional-sdk.js';
4
11
  /**
5
12
  * Role-scoped session object returned by `ClientSDK.initializeSession(...)`.
6
13
  *
7
14
  * It exposes the common/auth surface plus the services allowed by the current
8
15
  * profile capabilities.
16
+ *
17
+ * Architectural note:
18
+ * `ProfileManager` remains the frontend session/composition entry point, but it
19
+ * also materializes actor-scoped facades that mirror `gdc-sdk-node-ts`.
20
+ *
21
+ * The goal is to preserve the legacy/frontend-friendly session API while
22
+ * keeping the same actor boundaries as the backend runtime.
9
23
  */
10
24
  export declare class ProfileManager {
11
25
  readonly profile: Profile;
@@ -17,6 +31,7 @@ export declare class ProfileManager {
17
31
  readonly familyAdmin?: FamilyAdminServices;
18
32
  readonly individual?: IndividualServices;
19
33
  readonly professional?: ProfessionalServices;
34
+ private readonly runtimeClient;
20
35
  /**
21
36
  * @param profile Current logical profile.
22
37
  * @param orgDid DID of the provider/organization used as the session anchor.
@@ -131,6 +146,13 @@ export declare class ProfileManager {
131
146
  }): Promise<{
132
147
  thid: string;
133
148
  }>;
149
+ asHostOnboarding(): HostOnboardingSdk;
150
+ asOrganizationController(): OrganizationControllerSdk;
151
+ asOrganizationEmployee(): OrganizationEmployeeSdk;
152
+ asIndividualController(): IndividualControllerSdk;
153
+ asIndividualMember(): IndividualMemberSdk;
154
+ asPersonal(): PersonalSdk;
155
+ asProfessional(): ProfessionalSdk;
134
156
  }
135
157
  /**
136
158
  * Preferred neutral frontend actor-session surface.
@@ -1,11 +1,26 @@
1
1
  // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
2
  import { CommonAuthService } from './services.js';
3
3
  import { mapCapabilitiesToServices } from './capabilityMapper.js';
4
+ import { HostOnboardingSdk, } from './orchestration/host-onboarding-sdk.js';
5
+ import { IndividualControllerSdk } from './orchestration/individual-controller-sdk.js';
6
+ import { IndividualMemberSdk } from './orchestration/individual-member-sdk.js';
7
+ import { OrganizationControllerSdk } from './orchestration/organization-controller-sdk.js';
8
+ import { OrganizationEmployeeSdk } from './orchestration/organization-employee-sdk.js';
9
+ import { PersonalSdk } from './orchestration/personal-sdk.js';
10
+ import { ProfessionalSdk } from './orchestration/professional-sdk.js';
11
+ import { createSyntheticSubmitAndPollResult } from './orchestration/client-port.js';
4
12
  /**
5
13
  * Role-scoped session object returned by `ClientSDK.initializeSession(...)`.
6
14
  *
7
15
  * It exposes the common/auth surface plus the services allowed by the current
8
16
  * profile capabilities.
17
+ *
18
+ * Architectural note:
19
+ * `ProfileManager` remains the frontend session/composition entry point, but it
20
+ * also materializes actor-scoped facades that mirror `gdc-sdk-node-ts`.
21
+ *
22
+ * The goal is to preserve the legacy/frontend-friendly session API while
23
+ * keeping the same actor boundaries as the backend runtime.
9
24
  */
10
25
  export class ProfileManager {
11
26
  /**
@@ -21,6 +36,111 @@ export class ProfileManager {
21
36
  this.familyAdmin = mapped.familyAdmin;
22
37
  this.individual = mapped.individual;
23
38
  this.professional = mapped.professional;
39
+ this.runtimeClient = {
40
+ activateOrganizationInGatewayFromIcaProof: (input) => {
41
+ if (!this.orgAdmin?.admin)
42
+ throw new Error('orgAdmin.admin service is not available for this profile.');
43
+ return this.orgAdmin.admin.activateOrganizationInGatewayFromIcaProof(input);
44
+ },
45
+ confirmLegalOrganizationOrder: (input) => {
46
+ if (!this.orgAdmin?.admin)
47
+ throw new Error('orgAdmin.admin service is not available for this profile.');
48
+ return this.orgAdmin.admin.confirmLegalOrganizationOrder(input);
49
+ },
50
+ createOrganizationEmployee: (ctx, input) => {
51
+ if (!this.orgAdmin?.admin)
52
+ throw new Error('orgAdmin.admin service is not available for this profile.');
53
+ return this.orgAdmin.admin.createOrganizationEmployee(ctx.providerDid, ctx.idToken, input)
54
+ .then((result) => createSyntheticSubmitAndPollResult(result.thid));
55
+ },
56
+ disableEmployee: (ctx, input) => {
57
+ if (!this.orgAdmin?.admin)
58
+ throw new Error('orgAdmin.admin service is not available for this profile.');
59
+ return this.orgAdmin.admin.disableEmployee(ctx.providerDid, ctx.idToken, input);
60
+ },
61
+ purgeEmployee: (ctx, input) => {
62
+ if (!this.orgAdmin?.admin)
63
+ throw new Error('orgAdmin.admin service is not available for this profile.');
64
+ return this.orgAdmin.admin.purgeEmployee(ctx.providerDid, ctx.idToken, input);
65
+ },
66
+ activateEmployeeDeviceWithActivationRequest: (ctx, input) => this.common.auth.activateEmployeeDeviceWithActivationRequest(input.activationCode, ctx.providerDid, ctx.idToken, input.dcrPayload),
67
+ requestSmartToken: (input) => this.common.auth.requestSmartToken(input),
68
+ startIndividualOrganization: (ctx, input) => {
69
+ if (!this.familyAdmin?.admin)
70
+ throw new Error('familyAdmin.admin service is not available for this profile.');
71
+ return this.familyAdmin.admin.startIndividualOrganization(ctx.providerDid, ctx.idToken, input);
72
+ },
73
+ confirmIndividualOrganizationOrder: (ctx, input) => {
74
+ if (!this.familyAdmin?.admin)
75
+ throw new Error('familyAdmin.admin service is not available for this profile.');
76
+ return this.familyAdmin.admin.confirmIndividualOrganizationOrder(ctx.providerDid, ctx.idToken, input);
77
+ },
78
+ disableIndividual: (ctx, input) => {
79
+ if (!this.familyAdmin?.admin)
80
+ throw new Error('familyAdmin.admin service is not available for this profile.');
81
+ return this.familyAdmin.admin.disableIndividual(ctx.providerDid, ctx.idToken, input);
82
+ },
83
+ purgeIndividual: (ctx, input) => {
84
+ if (!this.familyAdmin?.admin)
85
+ throw new Error('familyAdmin.admin service is not available for this profile.');
86
+ return this.familyAdmin.admin.purgeIndividual(ctx.providerDid, ctx.idToken, input);
87
+ },
88
+ disableIndividualMember: (ctx, input) => {
89
+ if (!this.familyAdmin?.admin)
90
+ throw new Error('familyAdmin.admin service is not available for this profile.');
91
+ return this.familyAdmin.admin.disableIndividualMember(ctx.providerDid, ctx.idToken, input);
92
+ },
93
+ purgeIndividualMember: (ctx, input) => {
94
+ if (!this.familyAdmin?.admin)
95
+ throw new Error('familyAdmin.admin service is not available for this profile.');
96
+ return this.familyAdmin.admin.purgeIndividualMember(ctx.providerDid, ctx.idToken, input);
97
+ },
98
+ grantProfessionalAccess: (ctx, input) => {
99
+ if (this.professional?.physician) {
100
+ return this.professional.physician.grantProfessionalAccess({ ...input, providerDid: ctx.providerDid, requiredScope: ctx.requiredScope, idToken: ctx.idToken });
101
+ }
102
+ if (!this.individual?.service)
103
+ throw new Error('individual.service is not available for this profile.');
104
+ return this.individual.service.grantProfessionalAccess({ ...input, providerDid: ctx.providerDid, requiredScope: ctx.requiredScope || '', idToken: ctx.idToken });
105
+ },
106
+ importIpsOrFhirAndUpdateIndex: (ctx, input) => {
107
+ if (!this.individual?.service)
108
+ throw new Error('individual.service is not available for this profile.');
109
+ return this.individual.service.importIpsOrFhirAndUpdateIndex(input.compositionPayload, ctx.providerDid, ctx.requiredScope || '', ctx.idToken, input.format).then((result) => createSyntheticSubmitAndPollResult(result.thid));
110
+ },
111
+ upsertRelatedPersonAndPoll: (ctx, input) => {
112
+ if (!this.individual?.service)
113
+ throw new Error('individual.service is not available for this profile.');
114
+ return this.individual.service.upsertRelatedPersonAndPoll(input.relatedPersonPayload, ctx.providerDid, ctx.requiredScope || '', ctx.idToken);
115
+ },
116
+ ingestCommunicationAndUpdateIndex: (ctx, input) => {
117
+ if (this.professional?.physician) {
118
+ return this.professional.physician.ingestCommunicationAndUpdateIndex(input.communicationPayload, ctx.providerDid, ctx.requiredScope || '', ctx.idToken, input.pathFormatSegment);
119
+ }
120
+ if (this.professional?.paramedic) {
121
+ return this.professional.paramedic.ingestCommunicationAndUpdateIndex(input.communicationPayload, ctx.providerDid, ctx.requiredScope || '', ctx.idToken, input.pathFormatSegment);
122
+ }
123
+ if (!this.individual?.service)
124
+ throw new Error('individual.service is not available for this profile.');
125
+ return this.individual.service.ingestCommunicationAndUpdateIndex(input.communicationPayload, ctx.providerDid, ctx.requiredScope || '', ctx.idToken, input.pathFormatSegment);
126
+ },
127
+ generateDigitalTwinFromSubjectData: (ctx, input) => {
128
+ if (!this.individual?.service)
129
+ throw new Error('individual.service is not available for this profile.');
130
+ return this.individual.service.generateDigitalTwinFromSubjectData(input.compositionPayload, ctx.providerDid, ctx.requiredScope || '', ctx.idToken, input.format).then((result) => createSyntheticSubmitAndPollResult(result.thid));
131
+ },
132
+ searchClinicalBundle: (ctx, input) => {
133
+ if (!this.individual?.service)
134
+ throw new Error('individual.service is not available for this profile.');
135
+ return this.individual.service.searchClinicalBundle(input, ctx.providerDid, ctx.requiredScope || '', ctx.idToken);
136
+ },
137
+ getLatestIps: (ctx, subject) => {
138
+ if (!this.individual?.service)
139
+ throw new Error('individual.service is not available for this profile.');
140
+ return this.individual.service.getLatestIps(subject, ctx.providerDid, ctx.requiredScope || '', ctx.idToken);
141
+ },
142
+ submitAndPoll: async (_submitPath, _pollPath, payload) => createSyntheticSubmitAndPollResult(String(payload.thid || `front-${Date.now()}`)),
143
+ };
24
144
  }
25
145
  /**
26
146
  * Organization-admin helper for employee/professional creation.
@@ -67,6 +187,41 @@ export class ProfileManager {
67
187
  }
68
188
  return this.individual.service.generateDigitalTwinFromSubjectData(params.compositionPayload, params.providerDid, params.requiredScope, params.idToken, params.format);
69
189
  }
190
+ asHostOnboarding() {
191
+ if (!this.orgAdmin?.admin)
192
+ throw new Error('HostOnboardingSdk is not available for this profile.');
193
+ return new HostOnboardingSdk(this.runtimeClient);
194
+ }
195
+ asOrganizationController() {
196
+ if (!this.orgAdmin?.admin)
197
+ throw new Error('OrganizationControllerSdk is not available for this profile.');
198
+ return new OrganizationControllerSdk(this.runtimeClient);
199
+ }
200
+ asOrganizationEmployee() {
201
+ return new OrganizationEmployeeSdk(this.runtimeClient);
202
+ }
203
+ asIndividualController() {
204
+ if (!this.familyAdmin?.admin)
205
+ throw new Error('IndividualControllerSdk is not available for this profile.');
206
+ return new IndividualControllerSdk(this.runtimeClient);
207
+ }
208
+ asIndividualMember() {
209
+ if (!this.individual?.service)
210
+ throw new Error('IndividualMemberSdk is not available for this profile.');
211
+ return new IndividualMemberSdk(this.runtimeClient);
212
+ }
213
+ asPersonal() {
214
+ if (!this.familyAdmin?.admin && !this.individual?.service) {
215
+ throw new Error('PersonalSdk is not available for this profile.');
216
+ }
217
+ return new PersonalSdk(this.runtimeClient);
218
+ }
219
+ asProfessional() {
220
+ if (!this.professional?.physician && !this.professional?.paramedic && !this.individual?.service) {
221
+ throw new Error('ProfessionalSdk is not available for this profile.');
222
+ }
223
+ return new ProfessionalSdk(this.runtimeClient);
224
+ }
70
225
  }
71
226
  /**
72
227
  * Preferred neutral frontend actor-session surface.
@@ -0,0 +1,27 @@
1
+ import { ProtectedDataAES } from './models/aes';
2
+ /**
3
+ * Manages AES-GCM encryption and decryption using Node's native crypto module.
4
+ * This class handles the core cryptography and the base64url serialization required for JWE.
5
+ */
6
+ export declare class AesManager {
7
+ private readonly ALGORITHM;
8
+ private readonly KEY_SIZE;
9
+ private readonly IV_GENERATION_SIZE;
10
+ private readonly TAG_SIZE_BYTES;
11
+ /**
12
+ * Encrypts a plaintext string and returns the components as base64url strings.
13
+ * @param plaintext The stringified data to encrypt (e.g. a stringified object or ASCII string from raw bytes)
14
+ * @param cekBytes The 32-byte Content Encryption Key.
15
+ * @param aad The Additional Authenticated Data string for integrity protection.
16
+ * @returns A promise resolving to the JWE-compatible encrypted components.
17
+ */
18
+ encrypt(plaintext: string, cekBytes: Uint8Array, aad: string): Promise<ProtectedDataAES>;
19
+ /**
20
+ * Decrypts JWE-compatible encrypted components back to a plaintext string.
21
+ * @param encryptedData The object containing the base64url-encoded ciphertext, iv, and tag.
22
+ * @param cekBytes The 32-byte Content Encryption Key.
23
+ * @param aad The Additional Authenticated Data for integrity verification.
24
+ * @returns A promise resolving to the decrypted plaintext string.
25
+ */
26
+ decrypt(encryptedData: ProtectedDataAES, cekBytes: Uint8Array, aad: string): Promise<string>;
27
+ }
@@ -0,0 +1,64 @@
1
+ // Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
2
+ // File: crypto-ts/AesManager.ts
3
+ import { createCipheriv, createDecipheriv, randomBytes } from 'crypto';
4
+ import { Content } from './utils/content';
5
+ /**
6
+ * Manages AES-GCM encryption and decryption using Node's native crypto module.
7
+ * This class handles the core cryptography and the base64url serialization required for JWE.
8
+ */
9
+ export class AesManager {
10
+ constructor() {
11
+ this.ALGORITHM = 'aes-256-gcm';
12
+ this.KEY_SIZE = 32; // 256-bit key
13
+ this.IV_GENERATION_SIZE = 12; // 96-bit IV, recommended by NIST for GCM
14
+ this.TAG_SIZE_BYTES = 16; // 128-bit authentication tag
15
+ }
16
+ /**
17
+ * Encrypts a plaintext string and returns the components as base64url strings.
18
+ * @param plaintext The stringified data to encrypt (e.g. a stringified object or ASCII string from raw bytes)
19
+ * @param cekBytes The 32-byte Content Encryption Key.
20
+ * @param aad The Additional Authenticated Data string for integrity protection.
21
+ * @returns A promise resolving to the JWE-compatible encrypted components.
22
+ */
23
+ async encrypt(plaintext, cekBytes, aad) {
24
+ if (cekBytes.length !== this.KEY_SIZE) {
25
+ throw new Error(`Invalid key length: a ${this.KEY_SIZE}-byte key is required.`);
26
+ }
27
+ const iv = randomBytes(this.IV_GENERATION_SIZE);
28
+ const aadBytes = Content.stringToBytesUTF8(aad);
29
+ const cipher = createCipheriv(this.ALGORITHM, cekBytes, iv, {
30
+ authTagLength: this.TAG_SIZE_BYTES
31
+ });
32
+ cipher.setAAD(aadBytes);
33
+ const ciphertext = Buffer.concat([cipher.update(plaintext, 'utf8'), cipher.final()]);
34
+ const tag = cipher.getAuthTag();
35
+ return {
36
+ ciphertext: Content.bytesToRawBase64UrlSafe(ciphertext),
37
+ iv: Content.bytesToRawBase64UrlSafe(iv),
38
+ tag: Content.bytesToRawBase64UrlSafe(tag),
39
+ };
40
+ }
41
+ /**
42
+ * Decrypts JWE-compatible encrypted components back to a plaintext string.
43
+ * @param encryptedData The object containing the base64url-encoded ciphertext, iv, and tag.
44
+ * @param cekBytes The 32-byte Content Encryption Key.
45
+ * @param aad The Additional Authenticated Data for integrity verification.
46
+ * @returns A promise resolving to the decrypted plaintext string.
47
+ */
48
+ async decrypt(encryptedData, cekBytes, aad) {
49
+ if (cekBytes.length !== this.KEY_SIZE) {
50
+ throw new Error(`Invalid key length: a ${this.KEY_SIZE}-byte key is required.`);
51
+ }
52
+ const ciphertextBytes = Content.base64ToBytes(encryptedData.ciphertext);
53
+ const tagBytes = Content.base64ToBytes(encryptedData.tag);
54
+ const ivBytes = Content.base64ToBytes(encryptedData.iv);
55
+ const aadBytes = Content.stringToBytesUTF8(aad);
56
+ const decipher = createDecipheriv(this.ALGORITHM, cekBytes, ivBytes, {
57
+ authTagLength: this.TAG_SIZE_BYTES
58
+ });
59
+ decipher.setAuthTag(tagBytes);
60
+ decipher.setAAD(aadBytes);
61
+ const decryptedBytes = Buffer.concat([decipher.update(ciphertextBytes), decipher.final()]);
62
+ return Content.bytesToStringUTF8(decryptedBytes);
63
+ }
64
+ }
@@ -0,0 +1,76 @@
1
+ import { ICryptoHelper } from './interfaces/ICryptoHelper';
2
+ import { ICryptography } from './interfaces/ICryptography';
3
+ import { DataCompactJWT, JwtCompactParts } from './models/jwt';
4
+ import { JweObject } from './models/jwe';
5
+ import { MlkemPublicJwk, MldsaPublicJwk, PublicJwk, MlkemPrivateJwk, MldsaAlg, MlkemCurve } from './interfaces/Cryptography.types';
6
+ import { ProtectedDataAES } from './models/aes';
7
+ /**
8
+ * Implements the ICryptography interface, providing a complete suite of low-level,
9
+ * stateless cryptographic functions. This service is the "engine" of the security layer,
10
+ * orchestrating Post-Quantum and AES primitives.
11
+ */
12
+ export declare class CryptographyService implements ICryptography {
13
+ private aesManager;
14
+ private cryptoHelper;
15
+ private mlDsaModule;
16
+ private mlKemModule;
17
+ private readonly ML_KEM_SEED_SIZE;
18
+ private readonly ML_DSA_SEED_SIZE;
19
+ constructor(cryptoHelper: ICryptoHelper);
20
+ private loadMlDsa;
21
+ private loadMlKem;
22
+ digestString(data: string, algorithm: string): Promise<string>;
23
+ generateKeyPairMlKem(seedBytes?: Uint8Array, crv?: MlkemCurve): Promise<{
24
+ publicJWKey: MlkemPublicJwk & {
25
+ kid: string;
26
+ };
27
+ secretKeyBytes: Uint8Array;
28
+ }>;
29
+ generateKeyPairMlDsa(seedBytes?: Uint8Array, alg?: MldsaAlg): Promise<{
30
+ publicJWKey: MldsaPublicJwk & {
31
+ kid: string;
32
+ };
33
+ secretKeyBytes: Uint8Array;
34
+ }>;
35
+ encryptJwe(payload: object, protectedHeader: object, secretJWKey: MlkemPrivateJwk, recipientsJWKeys: MlkemPublicJwk[]): Promise<JweObject>;
36
+ encryptJweToCompact(payload: object | string, protectedHeader: object, secretJWKey: MlkemPrivateJwk, recipientJWKey: MlkemPublicJwk): Promise<string>;
37
+ decryptJwe(jwe: JweObject | string, secretKeyJwk: MlkemPrivateJwk): Promise<{
38
+ decryptedBytes: Uint8Array;
39
+ protectedHeader: object;
40
+ }>;
41
+ getRecipientKidsFromJwe(jwe: JweObject | string): string[];
42
+ signDataJws(payload: object, protectedHeader: object, secretKeyBytes: Uint8Array): Promise<JwtCompactParts>;
43
+ verifyJws(jws: JwtCompactParts | string, publicJwk: PublicJwk): Promise<boolean>;
44
+ verifyDetachedJws(payloadBytes: Uint8Array, detachedJws: string, publicJWKey: PublicJwk): Promise<boolean>;
45
+ encrypt(plaintext: string, cekBytes: Uint8Array, aad: string): Promise<ProtectedDataAES>;
46
+ decrypt(encryptedData: ProtectedDataAES, cekBytes: Uint8Array, aad: string): Promise<string>;
47
+ encapsulate(cekSeedBytes: Uint8Array, secretKeyBytes: Uint8Array, recipientPublicKeyBytes: Uint8Array): Promise<{
48
+ encapsulatedCekBytes: Uint8Array;
49
+ derivedCekBytes: Uint8Array;
50
+ }>;
51
+ decapsulate(encapsulatedBytes: Uint8Array, secretKeyBytes: Uint8Array): Promise<Uint8Array>;
52
+ signBytes(payloadBytes: Uint8Array, secretKeyBytes: Uint8Array, alg: MldsaAlg): Promise<Uint8Array>;
53
+ verifyBytes(signatureBytes: Uint8Array, dataBytes: Uint8Array, publicKey: PublicJwk): Promise<boolean>;
54
+ jwsToCompact(jws: DataCompactJWT): string;
55
+ parseCompactJws(jwsString: string): DataCompactJWT;
56
+ parseCompactJwe(jweString: string): JweObject;
57
+ /**
58
+ * Computes a JWK thumbprint using a specified hash algorithm.
59
+ * This implementation is platform-agnostic by using the injected ICryptoHelper.
60
+ */
61
+ private _computeJwkThumbprint;
62
+ /**
63
+ * Creates a canonical string from a simple, flat JSON object as required by
64
+ * RFC 7638 for JWK thumbprints.
65
+ */
66
+ private _canonicalizeForJwkThumbprint;
67
+ /**
68
+ * Extracts the Base JWK for thumbprint calculation per RFC 7638.
69
+ * This handles both Post-Quantum (OKP, AKP) and legacy (EC) key types.
70
+ */
71
+ private _toBaseJwk;
72
+ /**
73
+ * Utility to convert a hex string to a Uint8Array.
74
+ */
75
+ private _hexToBytes;
76
+ }