gdc-sdk-front-ts 2.2.1 → 2.3.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 (387) hide show
  1. package/dist/ProfileManager.js +6 -3
  2. package/dist/front-clinical-runtime-client.d.ts +69 -0
  3. package/dist/front-clinical-runtime-client.js +214 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1 -0
  6. package/dist/orchestration/client-port.d.ts +21 -3
  7. package/dist/orchestration/individual-member-sdk.d.ts +11 -1
  8. package/dist/orchestration/individual-member-sdk.js +12 -0
  9. package/dist/orchestration/professional-sdk.d.ts +7 -1
  10. package/dist/orchestration/professional-sdk.js +6 -0
  11. package/package.json +3 -3
  12. package/dist/discovery/HttpDataspaceDiscoveryClient.d.ts +0 -34
  13. package/dist/discovery/HttpDataspaceDiscoveryClient.js +0 -47
  14. package/dist/gdc-common-utils-ts/src/AesManager.d.ts +0 -27
  15. package/dist/gdc-common-utils-ts/src/AesManager.js +0 -64
  16. package/dist/gdc-common-utils-ts/src/CryptographyService.d.ts +0 -76
  17. package/dist/gdc-common-utils-ts/src/CryptographyService.js +0 -401
  18. package/dist/gdc-common-utils-ts/src/constants/actor-session.d.ts +0 -40
  19. package/dist/gdc-common-utils-ts/src/constants/actor-session.js +0 -40
  20. package/dist/gdc-common-utils-ts/src/constants/communication.d.ts +0 -28
  21. package/dist/gdc-common-utils-ts/src/constants/communication.js +0 -14
  22. package/dist/gdc-common-utils-ts/src/constants/cryptography.d.ts +0 -58
  23. package/dist/gdc-common-utils-ts/src/constants/cryptography.js +0 -49
  24. package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.d.ts +0 -11
  25. package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.js +0 -11
  26. package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.d.ts +0 -27
  27. package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.js +0 -27
  28. package/dist/gdc-common-utils-ts/src/constants/device.d.ts +0 -16
  29. package/dist/gdc-common-utils-ts/src/constants/device.js +0 -15
  30. package/dist/gdc-common-utils-ts/src/constants/did-services.d.ts +0 -42
  31. package/dist/gdc-common-utils-ts/src/constants/did-services.js +0 -40
  32. package/dist/gdc-common-utils-ts/src/constants/eu-countries.d.ts +0 -36
  33. package/dist/gdc-common-utils-ts/src/constants/eu-countries.js +0 -69
  34. package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.d.ts +0 -12
  35. package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.js +0 -12
  36. package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.d.ts +0 -52
  37. package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.js +0 -33
  38. package/dist/gdc-common-utils-ts/src/constants/fhir-versions.d.ts +0 -10
  39. package/dist/gdc-common-utils-ts/src/constants/fhir-versions.js +0 -10
  40. package/dist/gdc-common-utils-ts/src/constants/healthcare.d.ts +0 -496
  41. package/dist/gdc-common-utils-ts/src/constants/healthcare.js +0 -274
  42. package/dist/gdc-common-utils-ts/src/constants/hl7-roles.d.ts +0 -44
  43. package/dist/gdc-common-utils-ts/src/constants/hl7-roles.js +0 -208
  44. package/dist/gdc-common-utils-ts/src/constants/index.d.ts +0 -21
  45. package/dist/gdc-common-utils-ts/src/constants/index.js +0 -21
  46. package/dist/gdc-common-utils-ts/src/constants/network.d.ts +0 -25
  47. package/dist/gdc-common-utils-ts/src/constants/network.js +0 -17
  48. package/dist/gdc-common-utils-ts/src/constants/schemaorg.d.ts +0 -175
  49. package/dist/gdc-common-utils-ts/src/constants/schemaorg.js +0 -261
  50. package/dist/gdc-common-utils-ts/src/constants/sectors.d.ts +0 -24
  51. package/dist/gdc-common-utils-ts/src/constants/sectors.js +0 -24
  52. package/dist/gdc-common-utils-ts/src/constants/service-capabilities.d.ts +0 -82
  53. package/dist/gdc-common-utils-ts/src/constants/service-capabilities.js +0 -105
  54. package/dist/gdc-common-utils-ts/src/constants/smart.d.ts +0 -12
  55. package/dist/gdc-common-utils-ts/src/constants/smart.js +0 -12
  56. package/dist/gdc-common-utils-ts/src/constants/urn.d.ts +0 -11
  57. package/dist/gdc-common-utils-ts/src/constants/urn.js +0 -11
  58. package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.d.ts +0 -34
  59. package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.js +0 -42
  60. package/dist/gdc-common-utils-ts/src/constants/vital-signs.d.ts +0 -75
  61. package/dist/gdc-common-utils-ts/src/constants/vital-signs.js +0 -33
  62. package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.d.ts +0 -15
  63. package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.js +0 -16
  64. package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.d.ts +0 -22
  65. package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.js +0 -81
  66. package/dist/gdc-common-utils-ts/src/examples/consent-access.d.ts +0 -30
  67. package/dist/gdc-common-utils-ts/src/examples/consent-access.js +0 -121
  68. package/dist/gdc-common-utils-ts/src/examples/contract-examples.d.ts +0 -15
  69. package/dist/gdc-common-utils-ts/src/examples/contract-examples.js +0 -16
  70. package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.d.ts +0 -98
  71. package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.js +0 -141
  72. package/dist/gdc-common-utils-ts/src/examples/frontend-session.d.ts +0 -13
  73. package/dist/gdc-common-utils-ts/src/examples/frontend-session.js +0 -24
  74. package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.d.ts +0 -64
  75. package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.js +0 -77
  76. package/dist/gdc-common-utils-ts/src/examples/index.d.ts +0 -14
  77. package/dist/gdc-common-utils-ts/src/examples/index.js +0 -14
  78. package/dist/gdc-common-utils-ts/src/examples/individual-controller.d.ts +0 -100
  79. package/dist/gdc-common-utils-ts/src/examples/individual-controller.js +0 -71
  80. package/dist/gdc-common-utils-ts/src/examples/lifecycle.d.ts +0 -505
  81. package/dist/gdc-common-utils-ts/src/examples/lifecycle.js +0 -291
  82. package/dist/gdc-common-utils-ts/src/examples/organization-controller.d.ts +0 -163
  83. package/dist/gdc-common-utils-ts/src/examples/organization-controller.js +0 -93
  84. package/dist/gdc-common-utils-ts/src/examples/professional.d.ts +0 -228
  85. package/dist/gdc-common-utils-ts/src/examples/professional.js +0 -324
  86. package/dist/gdc-common-utils-ts/src/examples/related-person.d.ts +0 -10
  87. package/dist/gdc-common-utils-ts/src/examples/related-person.js +0 -13
  88. package/dist/gdc-common-utils-ts/src/examples/relationship-access.d.ts +0 -11
  89. package/dist/gdc-common-utils-ts/src/examples/relationship-access.js +0 -96
  90. package/dist/gdc-common-utils-ts/src/examples/shared.d.ts +0 -220
  91. package/dist/gdc-common-utils-ts/src/examples/shared.js +0 -191
  92. package/dist/gdc-common-utils-ts/src/hmac.d.ts +0 -14
  93. package/dist/gdc-common-utils-ts/src/hmac.js +0 -24
  94. package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.d.ts +0 -6
  95. package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.js +0 -15
  96. package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.d.ts +0 -4
  97. package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.js +0 -13
  98. package/dist/gdc-common-utils-ts/src/index.d.ts +0 -10
  99. package/dist/gdc-common-utils-ts/src/index.js +0 -10
  100. package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.d.ts +0 -139
  101. package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.js +0 -8
  102. package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.d.ts +0 -28
  103. package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.js +0 -3
  104. package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.d.ts +0 -154
  105. package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.js +0 -3
  106. package/dist/gdc-common-utils-ts/src/models/actor-session.d.ts +0 -9
  107. package/dist/gdc-common-utils-ts/src/models/actor-session.js +0 -3
  108. package/dist/gdc-common-utils-ts/src/models/aes.d.ts +0 -85
  109. package/dist/gdc-common-utils-ts/src/models/aes.js +0 -10
  110. package/dist/gdc-common-utils-ts/src/models/auth.d.ts +0 -35
  111. package/dist/gdc-common-utils-ts/src/models/auth.js +0 -3
  112. package/dist/gdc-common-utils-ts/src/models/bundle.d.ts +0 -153
  113. package/dist/gdc-common-utils-ts/src/models/bundle.js +0 -25
  114. package/dist/gdc-common-utils-ts/src/models/clinical-sections.d.ts +0 -36
  115. package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.d.ts +0 -150
  116. package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.js +0 -104
  117. package/dist/gdc-common-utils-ts/src/models/clinical-sections.js +0 -32
  118. package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.d.ts +0 -126
  119. package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.js +0 -67
  120. package/dist/gdc-common-utils-ts/src/models/comm.d.ts +0 -56
  121. package/dist/gdc-common-utils-ts/src/models/comm.js +0 -4
  122. package/dist/gdc-common-utils-ts/src/models/confidential-job.d.ts +0 -78
  123. package/dist/gdc-common-utils-ts/src/models/confidential-job.js +0 -20
  124. package/dist/gdc-common-utils-ts/src/models/confidential-message.d.ts +0 -97
  125. package/dist/gdc-common-utils-ts/src/models/confidential-message.js +0 -4
  126. package/dist/gdc-common-utils-ts/src/models/confidential-storage.d.ts +0 -134
  127. package/dist/gdc-common-utils-ts/src/models/confidential-storage.js +0 -3
  128. package/dist/gdc-common-utils-ts/src/models/consent-access.d.ts +0 -79
  129. package/dist/gdc-common-utils-ts/src/models/consent-access.js +0 -2
  130. package/dist/gdc-common-utils-ts/src/models/consent-rule.d.ts +0 -122
  131. package/dist/gdc-common-utils-ts/src/models/consent-rule.js +0 -22
  132. package/dist/gdc-common-utils-ts/src/models/crypto.d.ts +0 -35
  133. package/dist/gdc-common-utils-ts/src/models/crypto.js +0 -3
  134. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.d.ts +0 -79
  135. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.js +0 -2
  136. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.d.ts +0 -68
  137. package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.js +0 -9
  138. package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.d.ts +0 -14
  139. package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.js +0 -2
  140. package/dist/gdc-common-utils-ts/src/models/device-license.d.ts +0 -134
  141. package/dist/gdc-common-utils-ts/src/models/device-license.js +0 -3
  142. package/dist/gdc-common-utils-ts/src/models/did.d.ts +0 -108
  143. package/dist/gdc-common-utils-ts/src/models/did.js +0 -3
  144. package/dist/gdc-common-utils-ts/src/models/fhir-documents.d.ts +0 -101
  145. package/dist/gdc-common-utils-ts/src/models/fhir-documents.js +0 -3
  146. package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.d.ts +0 -104
  147. package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.js +0 -2
  148. package/dist/gdc-common-utils-ts/src/models/index.d.ts +0 -42
  149. package/dist/gdc-common-utils-ts/src/models/index.js +0 -42
  150. package/dist/gdc-common-utils-ts/src/models/indexing.d.ts +0 -11
  151. package/dist/gdc-common-utils-ts/src/models/indexing.js +0 -18
  152. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.d.ts +0 -24
  153. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.js +0 -36
  154. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.d.ts +0 -53
  155. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.js +0 -55
  156. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.d.ts +0 -14
  157. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.js +0 -25
  158. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.d.ts +0 -13
  159. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.js +0 -23
  160. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.d.ts +0 -36
  161. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.js +0 -89
  162. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.d.ts +0 -341
  163. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.js +0 -204
  164. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.d.ts +0 -9
  165. package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.js +0 -3
  166. package/dist/gdc-common-utils-ts/src/models/interoperable-claims.d.ts +0 -5
  167. package/dist/gdc-common-utils-ts/src/models/interoperable-claims.js +0 -7
  168. package/dist/gdc-common-utils-ts/src/models/issue.d.ts +0 -57
  169. package/dist/gdc-common-utils-ts/src/models/issue.js +0 -75
  170. package/dist/gdc-common-utils-ts/src/models/jsonapi.d.ts +0 -13
  171. package/dist/gdc-common-utils-ts/src/models/jsonapi.js +0 -3
  172. package/dist/gdc-common-utils-ts/src/models/jwe.d.ts +0 -120
  173. package/dist/gdc-common-utils-ts/src/models/jwe.js +0 -3
  174. package/dist/gdc-common-utils-ts/src/models/jwk.d.ts +0 -39
  175. package/dist/gdc-common-utils-ts/src/models/jwk.js +0 -3
  176. package/dist/gdc-common-utils-ts/src/models/jws.d.ts +0 -35
  177. package/dist/gdc-common-utils-ts/src/models/jws.js +0 -3
  178. package/dist/gdc-common-utils-ts/src/models/jwt.d.ts +0 -9
  179. package/dist/gdc-common-utils-ts/src/models/jwt.js +0 -3
  180. package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.d.ts +0 -55
  181. package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.js +0 -58
  182. package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.d.ts +0 -33
  183. package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.js +0 -3
  184. package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.d.ts +0 -50
  185. package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.js +0 -3
  186. package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.d.ts +0 -67
  187. package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.js +0 -3
  188. package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.d.ts +0 -51
  189. package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.js +0 -5
  190. package/dist/gdc-common-utils-ts/src/models/openid-device.d.ts +0 -119
  191. package/dist/gdc-common-utils-ts/src/models/openid-device.js +0 -3
  192. package/dist/gdc-common-utils-ts/src/models/operation-outcome.d.ts +0 -26
  193. package/dist/gdc-common-utils-ts/src/models/operation-outcome.js +0 -3
  194. package/dist/gdc-common-utils-ts/src/models/params.d.ts +0 -133
  195. package/dist/gdc-common-utils-ts/src/models/params.js +0 -3
  196. package/dist/gdc-common-utils-ts/src/models/relationship-access.d.ts +0 -160
  197. package/dist/gdc-common-utils-ts/src/models/relationship-access.js +0 -21
  198. package/dist/gdc-common-utils-ts/src/models/resource-document.d.ts +0 -14
  199. package/dist/gdc-common-utils-ts/src/models/resource-document.js +0 -3
  200. package/dist/gdc-common-utils-ts/src/models/response.d.ts +0 -1
  201. package/dist/gdc-common-utils-ts/src/models/response.js +0 -3
  202. package/dist/gdc-common-utils-ts/src/models/urlPath.d.ts +0 -58
  203. package/dist/gdc-common-utils-ts/src/models/urlPath.js +0 -76
  204. package/dist/gdc-common-utils-ts/src/models/verifiable-credential.d.ts +0 -45
  205. package/dist/gdc-common-utils-ts/src/models/verifiable-credential.js +0 -8
  206. package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.d.ts +0 -53
  207. package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.js +0 -25
  208. package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.d.ts +0 -30
  209. package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.js +0 -81
  210. package/dist/gdc-common-utils-ts/src/storage/index.d.ts +0 -3
  211. package/dist/gdc-common-utils-ts/src/storage/index.js +0 -4
  212. package/dist/gdc-common-utils-ts/src/utils/activation-policy.d.ts +0 -86
  213. package/dist/gdc-common-utils-ts/src/utils/activation-policy.js +0 -218
  214. package/dist/gdc-common-utils-ts/src/utils/activation-request.d.ts +0 -81
  215. package/dist/gdc-common-utils-ts/src/utils/activation-request.js +0 -99
  216. package/dist/gdc-common-utils-ts/src/utils/actor.d.ts +0 -18
  217. package/dist/gdc-common-utils-ts/src/utils/actor.js +0 -36
  218. package/dist/gdc-common-utils-ts/src/utils/base-convert.d.ts +0 -60
  219. package/dist/gdc-common-utils-ts/src/utils/base-convert.js +0 -104
  220. package/dist/gdc-common-utils-ts/src/utils/baseN.d.ts +0 -35
  221. package/dist/gdc-common-utils-ts/src/utils/baseN.js +0 -174
  222. package/dist/gdc-common-utils-ts/src/utils/bundle-query.d.ts +0 -35
  223. package/dist/gdc-common-utils-ts/src/utils/bundle-query.js +0 -177
  224. package/dist/gdc-common-utils-ts/src/utils/bundle.d.ts +0 -13
  225. package/dist/gdc-common-utils-ts/src/utils/bundle.js +0 -39
  226. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.d.ts +0 -64
  227. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.js +0 -279
  228. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.d.ts +0 -55
  229. package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.js +0 -291
  230. package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.d.ts +0 -110
  231. package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.js +0 -326
  232. package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.d.ts +0 -41
  233. package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.js +0 -170
  234. package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.d.ts +0 -41
  235. package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.js +0 -215
  236. package/dist/gdc-common-utils-ts/src/utils/communication-identity.d.ts +0 -152
  237. package/dist/gdc-common-utils-ts/src/utils/communication-identity.js +0 -121
  238. package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.d.ts +0 -79
  239. package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.js +0 -213
  240. package/dist/gdc-common-utils-ts/src/utils/consent.d.ts +0 -218
  241. package/dist/gdc-common-utils-ts/src/utils/consent.js +0 -679
  242. package/dist/gdc-common-utils-ts/src/utils/content.d.ts +0 -55
  243. package/dist/gdc-common-utils-ts/src/utils/content.js +0 -60
  244. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.d.ts +0 -130
  245. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.js +0 -307
  246. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.d.ts +0 -235
  247. package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.js +0 -482
  248. package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.d.ts +0 -66
  249. package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.js +0 -109
  250. package/dist/gdc-common-utils-ts/src/utils/did-resolution.d.ts +0 -60
  251. package/dist/gdc-common-utils-ts/src/utils/did-resolution.js +0 -173
  252. package/dist/gdc-common-utils-ts/src/utils/did.d.ts +0 -124
  253. package/dist/gdc-common-utils-ts/src/utils/did.js +0 -204
  254. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.d.ts +0 -10
  255. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.js +0 -15
  256. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.d.ts +0 -48
  257. package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.js +0 -81
  258. package/dist/gdc-common-utils-ts/src/utils/didcomm.d.ts +0 -60
  259. package/dist/gdc-common-utils-ts/src/utils/didcomm.js +0 -78
  260. package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.d.ts +0 -28
  261. package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.js +0 -64
  262. package/dist/gdc-common-utils-ts/src/utils/fhir-cid.d.ts +0 -60
  263. package/dist/gdc-common-utils-ts/src/utils/fhir-cid.js +0 -152
  264. package/dist/gdc-common-utils-ts/src/utils/fhir-validator.d.ts +0 -61
  265. package/dist/gdc-common-utils-ts/src/utils/fhir-validator.js +0 -91
  266. package/dist/gdc-common-utils-ts/src/utils/format-converter.d.ts +0 -21
  267. package/dist/gdc-common-utils-ts/src/utils/format-converter.js +0 -109
  268. package/dist/gdc-common-utils-ts/src/utils/index.d.ts +0 -39
  269. package/dist/gdc-common-utils-ts/src/utils/index.js +0 -39
  270. package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.d.ts +0 -55
  271. package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.js +0 -191
  272. package/dist/gdc-common-utils-ts/src/utils/jwt.d.ts +0 -53
  273. package/dist/gdc-common-utils-ts/src/utils/jwt.js +0 -154
  274. package/dist/gdc-common-utils-ts/src/utils/manager-error.d.ts +0 -15
  275. package/dist/gdc-common-utils-ts/src/utils/manager-error.js +0 -21
  276. package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.d.ts +0 -56
  277. package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.js +0 -127
  278. package/dist/gdc-common-utils-ts/src/utils/multibase58.d.ts +0 -13
  279. package/dist/gdc-common-utils-ts/src/utils/multibase58.js +0 -40
  280. package/dist/gdc-common-utils-ts/src/utils/multibasehash.d.ts +0 -8
  281. package/dist/gdc-common-utils-ts/src/utils/multibasehash.js +0 -23
  282. package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.d.ts +0 -1
  283. package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.js +0 -35
  284. package/dist/gdc-common-utils-ts/src/utils/normalize.d.ts +0 -16
  285. package/dist/gdc-common-utils-ts/src/utils/normalize.js +0 -40
  286. package/dist/gdc-common-utils-ts/src/utils/object-convert.d.ts +0 -20
  287. package/dist/gdc-common-utils-ts/src/utils/object-convert.js +0 -51
  288. package/dist/gdc-common-utils-ts/src/utils/smart-scope.d.ts +0 -28
  289. package/dist/gdc-common-utils-ts/src/utils/smart-scope.js +0 -29
  290. package/dist/gdc-common-utils-ts/src/utils/string-convert.d.ts +0 -24
  291. package/dist/gdc-common-utils-ts/src/utils/string-convert.js +0 -62
  292. package/dist/gdc-common-utils-ts/src/utils/string-utils.d.ts +0 -25
  293. package/dist/gdc-common-utils-ts/src/utils/string-utils.js +0 -66
  294. package/dist/gdc-common-utils-ts/src/utils/url.d.ts +0 -26
  295. package/dist/gdc-common-utils-ts/src/utils/url.js +0 -44
  296. package/dist/gdc-common-utils-ts/src/utils/vp-token.d.ts +0 -139
  297. package/dist/gdc-common-utils-ts/src/utils/vp-token.js +0 -256
  298. package/dist/gdc-sdk-core-ts/src/actor-model.d.ts +0 -56
  299. package/dist/gdc-sdk-core-ts/src/actor-model.js +0 -112
  300. package/dist/gdc-sdk-core-ts/src/app-identity.d.ts +0 -80
  301. package/dist/gdc-sdk-core-ts/src/app-identity.js +0 -147
  302. package/dist/gdc-sdk-core-ts/src/bootstrap-facade.d.ts +0 -165
  303. package/dist/gdc-sdk-core-ts/src/bootstrap-facade.js +0 -191
  304. package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.d.ts +0 -112
  305. package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.js +0 -185
  306. package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.d.ts +0 -32
  307. package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.js +0 -215
  308. package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.d.ts +0 -55
  309. package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.js +0 -190
  310. package/dist/gdc-sdk-core-ts/src/communication-document-facade.d.ts +0 -55
  311. package/dist/gdc-sdk-core-ts/src/communication-document-facade.js +0 -194
  312. package/dist/gdc-sdk-core-ts/src/communication-draft.d.ts +0 -104
  313. package/dist/gdc-sdk-core-ts/src/communication-draft.js +0 -143
  314. package/dist/gdc-sdk-core-ts/src/communication-outbox.d.ts +0 -49
  315. package/dist/gdc-sdk-core-ts/src/communication-outbox.js +0 -62
  316. package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.d.ts +0 -180
  317. package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.js +0 -455
  318. package/dist/gdc-sdk-core-ts/src/consent-access.d.ts +0 -73
  319. package/dist/gdc-sdk-core-ts/src/consent-access.js +0 -109
  320. package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.d.ts +0 -5
  321. package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.js +0 -6
  322. package/dist/gdc-sdk-core-ts/src/consent-communication-operations.d.ts +0 -82
  323. package/dist/gdc-sdk-core-ts/src/consent-communication-operations.js +0 -135
  324. package/dist/gdc-sdk-core-ts/src/did-resolution-session.d.ts +0 -33
  325. package/dist/gdc-sdk-core-ts/src/did-resolution-session.js +0 -56
  326. package/dist/gdc-sdk-core-ts/src/discovery-facade.d.ts +0 -84
  327. package/dist/gdc-sdk-core-ts/src/discovery-facade.js +0 -24
  328. package/dist/gdc-sdk-core-ts/src/identity-model.d.ts +0 -46
  329. package/dist/gdc-sdk-core-ts/src/identity-model.js +0 -2
  330. package/dist/gdc-sdk-core-ts/src/identity-store.d.ts +0 -83
  331. package/dist/gdc-sdk-core-ts/src/identity-store.js +0 -51
  332. package/dist/gdc-sdk-core-ts/src/index.d.ts +0 -23
  333. package/dist/gdc-sdk-core-ts/src/index.js +0 -24
  334. package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.d.ts +0 -5
  335. package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.js +0 -6
  336. package/dist/gdc-sdk-core-ts/src/polling-model.d.ts +0 -35
  337. package/dist/gdc-sdk-core-ts/src/polling-model.js +0 -24
  338. package/dist/gdc-sdk-core-ts/src/relationship-access.d.ts +0 -40
  339. package/dist/gdc-sdk-core-ts/src/relationship-access.js +0 -150
  340. package/dist/gdc-sdk-core-ts/src/session-model.d.ts +0 -134
  341. package/dist/gdc-sdk-core-ts/src/session-model.js +0 -2
  342. package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.d.ts +0 -19
  343. package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.js +0 -19
  344. package/dist/gdc-sdk-core-ts/src/vital-signs.d.ts +0 -38
  345. package/dist/gdc-sdk-core-ts/src/vital-signs.js +0 -155
  346. package/dist/gdc-sdk-front-ts/src/ClientSDK.d.ts +0 -99
  347. package/dist/gdc-sdk-front-ts/src/ClientSDK.js +0 -177
  348. package/dist/gdc-sdk-front-ts/src/ProfileManager.d.ts +0 -140
  349. package/dist/gdc-sdk-front-ts/src/ProfileManager.js +0 -76
  350. package/dist/gdc-sdk-front-ts/src/ProfileRegistry.d.ts +0 -11
  351. package/dist/gdc-sdk-front-ts/src/ProfileRegistry.js +0 -26
  352. package/dist/gdc-sdk-front-ts/src/VerifierService.d.ts +0 -6
  353. package/dist/gdc-sdk-front-ts/src/VerifierService.js +0 -10
  354. package/dist/gdc-sdk-front-ts/src/actor-session.d.ts +0 -2
  355. package/dist/gdc-sdk-front-ts/src/actor-session.js +0 -2
  356. package/dist/gdc-sdk-front-ts/src/capabilityMapper.d.ts +0 -8
  357. package/dist/gdc-sdk-front-ts/src/capabilityMapper.js +0 -28
  358. package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.d.ts +0 -4
  359. package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.js +0 -5
  360. package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.d.ts +0 -54
  361. package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.js +0 -85
  362. package/dist/gdc-sdk-front-ts/src/discovery/index.d.ts +0 -3
  363. package/dist/gdc-sdk-front-ts/src/discovery/index.js +0 -4
  364. package/dist/gdc-sdk-front-ts/src/discovery/mappers.d.ts +0 -29
  365. package/dist/gdc-sdk-front-ts/src/discovery/mappers.js +0 -60
  366. package/dist/gdc-sdk-front-ts/src/discovery/types.d.ts +0 -83
  367. package/dist/gdc-sdk-front-ts/src/discovery/types.js +0 -2
  368. package/dist/gdc-sdk-front-ts/src/index.d.ts +0 -15
  369. package/dist/gdc-sdk-front-ts/src/index.js +0 -16
  370. package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.d.ts +0 -4
  371. package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.js +0 -5
  372. package/dist/gdc-sdk-front-ts/src/roleRegistry.d.ts +0 -19
  373. package/dist/gdc-sdk-front-ts/src/roleRegistry.js +0 -2
  374. package/dist/gdc-sdk-front-ts/src/runtime-contracts.d.ts +0 -22
  375. package/dist/gdc-sdk-front-ts/src/runtime-contracts.js +0 -7
  376. package/dist/gdc-sdk-front-ts/src/services.d.ts +0 -167
  377. package/dist/gdc-sdk-front-ts/src/services.js +0 -78
  378. package/dist/gdc-sdk-front-ts/src/session-descriptor.d.ts +0 -11
  379. package/dist/gdc-sdk-front-ts/src/session-descriptor.js +0 -8
  380. package/dist/gdc-sdk-front-ts/src/types.d.ts +0 -11
  381. package/dist/gdc-sdk-front-ts/src/types.js +0 -1
  382. package/dist/lifecycle-examples.d.ts +0 -6
  383. package/dist/lifecycle-examples.js +0 -7
  384. package/dist/medication-claim-helpers.d.ts +0 -4
  385. package/dist/medication-claim-helpers.js +0 -5
  386. package/dist/orchestration/facades.d.ts +0 -65
  387. package/dist/orchestration/facades.js +0 -142
@@ -1,482 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- import { ClaimsOrganizationSchemaorg, ClaimsServiceSchemaorg } from '../constants/schemaorg';
3
- import { isEuCountryCode, normalizeCountryCode } from '../constants/eu-countries';
4
- import { isProviderServiceCapability } from '../constants/service-capabilities';
5
- import { DataspaceCoverageScope, } from '../models/dataspace-discovery';
6
- function asObject(value) {
7
- return value && typeof value === 'object' && !Array.isArray(value)
8
- ? value
9
- : undefined;
10
- }
11
- function asNonEmptyString(value) {
12
- return typeof value === 'string' ? value.trim() : '';
13
- }
14
- export const DiscoveryCatalogSource = Object.freeze({
15
- Internet: 'internet',
16
- Cache: 'cache',
17
- Default: 'default',
18
- });
19
- function createDiscoveryCatalogFetchResponse(payload, init = {}) {
20
- return {
21
- ok: init.ok ?? true,
22
- status: init.status ?? 200,
23
- json: async () => payload,
24
- text: async () => JSON.stringify(payload),
25
- };
26
- }
27
- function toStringList(value) {
28
- if (Array.isArray(value)) {
29
- return Array.from(new Set(value
30
- .flatMap((entry) => toStringList(entry))
31
- .map((entry) => entry.trim())
32
- .filter(Boolean)));
33
- }
34
- const raw = asNonEmptyString(value);
35
- if (!raw)
36
- return [];
37
- return Array.from(new Set(raw
38
- .split(',')
39
- .map((entry) => entry.trim())
40
- .filter(Boolean)));
41
- }
42
- function normalizeList(values) {
43
- return Array.from(new Set(values
44
- .map((value) => value.trim())
45
- .filter(Boolean)));
46
- }
47
- function sameNormalizedList(left, right) {
48
- if (left.length !== right.length)
49
- return false;
50
- const normalizedLeft = [...normalizeList(left)].sort();
51
- const normalizedRight = [...normalizeList(right)].sort();
52
- return normalizedLeft.every((value, index) => value === normalizedRight[index]);
53
- }
54
- function parseAreaServedValue(value) {
55
- if (Array.isArray(value)) {
56
- return normalizeList(value.flatMap((entry) => parseAreaServedValue(entry)));
57
- }
58
- if (typeof value === 'string') {
59
- return toStringList(value);
60
- }
61
- const objectValue = asObject(value);
62
- if (!objectValue)
63
- return [];
64
- return normalizeList([
65
- asNonEmptyString(objectValue.name),
66
- asNonEmptyString(objectValue['@id']),
67
- asNonEmptyString(objectValue.id),
68
- ].filter(Boolean));
69
- }
70
- function getSemanticCredentialSubject(input) {
71
- const objectInput = asObject(input);
72
- if (!objectInput)
73
- return undefined;
74
- const credentialSubject = asObject(objectInput.credentialSubject);
75
- if (credentialSubject)
76
- return credentialSubject;
77
- return objectInput;
78
- }
79
- function getFlattenedClaims(input) {
80
- const objectInput = asObject(input);
81
- if (!objectInput)
82
- return undefined;
83
- const meta = asObject(objectInput.meta);
84
- const claims = asObject(meta?.claims);
85
- return claims;
86
- }
87
- function getSemanticServiceTypes(subject) {
88
- return toStringList(subject?.serviceType);
89
- }
90
- function getSemanticCategories(subject) {
91
- return toStringList(subject?.category);
92
- }
93
- function getSemanticAreaServed(subject) {
94
- return parseAreaServedValue(subject?.areaServed);
95
- }
96
- function getSemanticAddressCountry(subject) {
97
- const address = asObject(subject?.address);
98
- return normalizeCountryCode(asNonEmptyString(address?.addressCountry));
99
- }
100
- function getFlattenedServiceTypes(claims) {
101
- return toStringList(claims?.[ClaimsServiceSchemaorg.serviceType]);
102
- }
103
- function getFlattenedCategories(claims) {
104
- return toStringList(claims?.[ClaimsServiceSchemaorg.category]);
105
- }
106
- function getFlattenedAreaServed(claims) {
107
- return parseAreaServedValue(claims?.[ClaimsServiceSchemaorg.areaServed]);
108
- }
109
- function getFlattenedAddressCountry(claims) {
110
- return normalizeCountryCode(asNonEmptyString(claims?.[ClaimsOrganizationSchemaorg.addressCountry]));
111
- }
112
- function assertNoMismatch(kind, semantic, flattened) {
113
- if (!semantic.length || !flattened.length)
114
- return;
115
- if (!sameNormalizedList(semantic, flattened)) {
116
- throw new Error(`Dataspace discovery mismatch for ${kind}: credentialSubject and meta.claims disagree.`);
117
- }
118
- }
119
- function assertNoScalarMismatch(kind, semantic, flattened) {
120
- if (!semantic || !flattened)
121
- return;
122
- if (semantic !== flattened) {
123
- throw new Error(`Dataspace discovery mismatch for ${kind}: credentialSubject and meta.claims disagree.`);
124
- }
125
- }
126
- /**
127
- * Parses the CSV or array representation of `serviceType`.
128
- *
129
- * @param value Semantic `credentialSubject.serviceType` or flattened
130
- * `meta.claims['org.schema.Service.serviceType']`.
131
- * @returns Normalized unique service capability tokens.
132
- *
133
- * @example
134
- * ```ts
135
- * parseServiceTypeCsv('indexing.cruds,digitaltwin.rs');
136
- * // ['indexing.cruds', 'digitaltwin.rs']
137
- * ```
138
- */
139
- export function parseServiceTypeCsv(value) {
140
- return toStringList(value);
141
- }
142
- /**
143
- * Parses the Schema.org `category` service dimension used as the dataspace
144
- * sector vocabulary in the current profile.
145
- *
146
- * @param value Semantic `credentialSubject.category` or flattened
147
- * `meta.claims['org.schema.Service.category']`.
148
- * @returns Normalized unique sector/category values.
149
- *
150
- * @example
151
- * ```ts
152
- * parseServiceCategories('animal-care,health-care');
153
- * // ['animal-care', 'health-care']
154
- * ```
155
- */
156
- export function parseServiceCategories(value) {
157
- return toStringList(value);
158
- }
159
- /**
160
- * Parses Schema.org `areaServed` values.
161
- *
162
- * Accepts scalar strings, CSV strings, arrays, and simple
163
- * `AdministrativeArea`-like objects with `name` or `@id`.
164
- *
165
- * @param value Semantic `credentialSubject.areaServed` or flattened
166
- * `meta.claims['org.schema.Service.areaServed']`.
167
- * @returns Normalized unique coverage values.
168
- *
169
- * @example
170
- * ```ts
171
- * parseAreaServed([{ '@type': 'AdministrativeArea', name: 'EU' }, 'ES']);
172
- * // ['EU', 'ES']
173
- * ```
174
- */
175
- export function parseAreaServed(value) {
176
- return parseAreaServedValue(value);
177
- }
178
- /**
179
- * Infers a broader coverage scope from an ISO-2 country code.
180
- *
181
- * `EU` is returned only as a coverage scope. It must not be treated as a
182
- * sector.
183
- *
184
- * @param countryCode ISO-2 country code, typically from
185
- * `credentialSubject.address.addressCountry`.
186
- * @returns `EU` for EU member countries, otherwise the normalized country code.
187
- *
188
- * @example
189
- * ```ts
190
- * inferCoverageScopeFromCountryCode('ES');
191
- * // 'EU'
192
- * ```
193
- */
194
- export function inferCoverageScopeFromCountryCode(countryCode) {
195
- const normalized = normalizeCountryCode(countryCode);
196
- if (!normalized)
197
- return undefined;
198
- return isEuCountryCode(normalized)
199
- ? DataspaceCoverageScope.EuropeanUnion
200
- : normalized;
201
- }
202
- /**
203
- * Infers a coverage scope from the semantic `credentialSubject`.
204
- *
205
- * @param subject Semantic service object containing `address.addressCountry`.
206
- * @returns Broader coverage scope such as `EU`, or the normalized country code
207
- * when the country is outside the EU set.
208
- */
209
- export function inferCoverageScopeFromCredentialSubject(subject) {
210
- const subjectObject = asObject(subject);
211
- const address = asObject(subjectObject?.address);
212
- return inferCoverageScopeFromCountryCode(asNonEmptyString(address?.addressCountry));
213
- }
214
- /**
215
- * Extracts the shared dataspace service semantics from a VC-like payload.
216
- *
217
- * Source-of-truth rule:
218
- * - semantic values come from `credentialSubject` first
219
- * - flattened `meta.claims` is accepted as a compatibility projection/fallback
220
- * - when both exist they must agree
221
- *
222
- * @param input VC-like payload, direct semantic object, or equivalent DTO.
223
- * @returns Runtime-neutral normalized dataspace discovery semantics.
224
- *
225
- * @example
226
- * ```ts
227
- * extractDataspaceServiceSemanticRecord({
228
- * credentialSubject: {
229
- * id: 'did:web:provider.example.org',
230
- * serviceType: 'indexing.cruds',
231
- * category: 'animal-care',
232
- * areaServed: { '@type': 'AdministrativeArea', name: 'EU' },
233
- * address: { addressCountry: 'ES' },
234
- * },
235
- * meta: {
236
- * claims: {
237
- * 'org.schema.Service.serviceType': 'indexing.cruds',
238
- * 'org.schema.Service.category': 'animal-care',
239
- * 'org.schema.Service.areaServed': 'EU',
240
- * 'org.schema.Organization.address.addressCountry': 'ES',
241
- * },
242
- * },
243
- * });
244
- * ```
245
- */
246
- export function extractDataspaceServiceSemanticRecord(input) {
247
- const subject = getSemanticCredentialSubject(input);
248
- const claims = getFlattenedClaims(input);
249
- const semanticServiceTypes = getSemanticServiceTypes(subject);
250
- const semanticCategories = getSemanticCategories(subject);
251
- const semanticAreaServed = getSemanticAreaServed(subject);
252
- const semanticAddressCountry = getSemanticAddressCountry(subject);
253
- const flattenedServiceTypes = getFlattenedServiceTypes(claims);
254
- const flattenedCategories = getFlattenedCategories(claims);
255
- const flattenedAreaServed = getFlattenedAreaServed(claims);
256
- const flattenedAddressCountry = getFlattenedAddressCountry(claims);
257
- assertNoMismatch('serviceType', semanticServiceTypes, flattenedServiceTypes);
258
- assertNoMismatch('category', semanticCategories, flattenedCategories);
259
- assertNoMismatch('areaServed', semanticAreaServed, flattenedAreaServed);
260
- assertNoScalarMismatch('address.addressCountry', semanticAddressCountry, flattenedAddressCountry);
261
- const serviceTypes = semanticServiceTypes.length ? semanticServiceTypes : flattenedServiceTypes;
262
- const categories = semanticCategories.length ? semanticCategories : flattenedCategories;
263
- const areaServed = semanticAreaServed.length ? semanticAreaServed : flattenedAreaServed;
264
- const addressCountry = semanticAddressCountry || flattenedAddressCountry || undefined;
265
- return {
266
- subjectId: asNonEmptyString(subject?.id) || undefined,
267
- serviceTypes,
268
- categories,
269
- areaServed,
270
- addressCountry,
271
- coverageScope: inferCoverageScopeFromCountryCode(addressCountry),
272
- };
273
- }
274
- /**
275
- * Extracts a hosting-operator semantic record from a VC-like payload.
276
- *
277
- * @param input VC-like payload or direct semantic object.
278
- * @returns Hosting-operator semantic record normalized with the common
279
- * dataspace extraction rules.
280
- */
281
- export function extractHostingOperatorSemanticRecord(input) {
282
- return extractDataspaceServiceSemanticRecord(input);
283
- }
284
- /**
285
- * Extracts a tenant-service semantic record from a VC-like payload.
286
- *
287
- * @param input VC-like payload or direct semantic object.
288
- * @returns Tenant-service semantic record normalized with the common dataspace
289
- * extraction rules.
290
- */
291
- export function extractTenantServiceSemanticRecord(input) {
292
- return extractDataspaceServiceSemanticRecord(input);
293
- }
294
- function matchesCoverageFilter(areaServed, jurisdiction, coverageScope) {
295
- const normalizedAreaServed = normalizeList([...(areaServed || [])]);
296
- if (jurisdiction && !normalizedAreaServed.includes(jurisdiction))
297
- return false;
298
- if (coverageScope && !normalizedAreaServed.includes(coverageScope))
299
- return false;
300
- return true;
301
- }
302
- /**
303
- * Returns whether a normalized hosting-operator record satisfies a service
304
- * autodiscovery filter.
305
- */
306
- export function matchesHostingOperatorDiscoveryFilter(record, filter) {
307
- if (!record.categories.includes(filter.sector))
308
- return false;
309
- if (!matchesCoverageFilter(record.areaServed, filter.jurisdiction, filter.coverageScope))
310
- return false;
311
- if (filter.capability && !record.serviceTypes.includes(filter.capability))
312
- return false;
313
- if (filter.requiredCapabilities?.length) {
314
- return filter.requiredCapabilities.every((capability) => record.serviceTypes.includes(capability));
315
- }
316
- return true;
317
- }
318
- /**
319
- * Returns whether a published provider catalog entry satisfies a service
320
- * autodiscovery filter.
321
- */
322
- export function matchesPublishedProviderDiscoveryFilter(record, filter) {
323
- if (!isProviderServiceCapability(record.serviceType))
324
- return false;
325
- if (record.category !== filter.sector)
326
- return false;
327
- if (filter.capability && record.serviceType !== filter.capability)
328
- return false;
329
- return matchesCoverageFilter(record.areaServed ? [record.areaServed] : [], filter.jurisdiction, filter.coverageScope);
330
- }
331
- /**
332
- * Filters hosting-operator records using the shared service-autodiscovery
333
- * semantics.
334
- */
335
- export function filterHostingOperatorsByDiscoveryFilter(records, filter) {
336
- return records.filter((record) => matchesHostingOperatorDiscoveryFilter(record, filter));
337
- }
338
- /**
339
- * Filters published provider entries using the shared service-autodiscovery
340
- * semantics.
341
- */
342
- export function filterPublishedProvidersByDiscoveryFilter(records, filter) {
343
- return records.filter((record) => matchesPublishedProviderDiscoveryFilter(record, filter));
344
- }
345
- /**
346
- * Filters a host/operator discovery catalog down to the providers that satisfy
347
- * the requested service-autodiscovery filter.
348
- */
349
- export function filterHostingOperatorDiscoveryCatalog(catalog, filter) {
350
- return {
351
- ...catalog,
352
- providers: filterPublishedProvidersByDiscoveryFilter(catalog.providers, filter),
353
- };
354
- }
355
- /**
356
- * Builds a normalized published-provider catalog DTO suitable for:
357
- *
358
- * - backend-owned fallback catalogs
359
- * - default discovery data loaded from configuration
360
- * - tests that should use the same DTO constructors as production code
361
- *
362
- * This helper is intentionally neutral:
363
- * - no example DIDs
364
- * - no example URLs
365
- * - no hidden business defaults
366
- *
367
- * @param input Required provider catalog fields plus optional URLs.
368
- * @returns Normalized published-provider catalog record.
369
- */
370
- export function buildDefaultPublishedProviderCatalogRecord(input) {
371
- const normalizedAreaServed = Array.isArray(input.areaServed)
372
- ? normalizeList(input.areaServed.map((value) => asNonEmptyString(value)).filter(Boolean))
373
- : toStringList(input.areaServed);
374
- return {
375
- providerDid: asNonEmptyString(input.providerDid),
376
- serviceType: asNonEmptyString(input.serviceType),
377
- category: asNonEmptyString(input.category),
378
- areaServed: normalizedAreaServed.length ? normalizedAreaServed.join(',') : undefined,
379
- endpointUrl: asNonEmptyString(input.endpointUrl) || undefined,
380
- discoveryUrl: asNonEmptyString(input.discoveryUrl) || undefined,
381
- catalogUrl: asNonEmptyString(input.catalogUrl) || undefined,
382
- };
383
- }
384
- /**
385
- * Builds a normalized hosting-operator discovery catalog DTO suitable for:
386
- *
387
- * - backend-owned fallback catalogs
388
- * - default host catalogs assembled from configuration
389
- * - tests that should reuse the same constructor as production code
390
- *
391
- * @param input Optional host identity fields plus the provider list.
392
- * @returns Normalized host discovery catalog.
393
- */
394
- export function buildDefaultHostingOperatorDiscoveryCatalog(input = {}) {
395
- return {
396
- hostingOperatorDid: asNonEmptyString(input.hostingOperatorDid) || undefined,
397
- discoveryUrl: asNonEmptyString(input.discoveryUrl) || undefined,
398
- catalogUrl: asNonEmptyString(input.catalogUrl) || undefined,
399
- providers: [...(input.providers || [])],
400
- };
401
- }
402
- function isHostingOperatorCatalogPayload(value) {
403
- const objectValue = asObject(value);
404
- return Boolean(objectValue && Array.isArray(objectValue.providers));
405
- }
406
- /**
407
- * Creates a generic host-catalog fetcher with cache and default fallback.
408
- *
409
- * Intended use:
410
- * - docs
411
- * - SDK integration examples
412
- * - tests that need to demonstrate the transport boundary around discovery
413
- *
414
- * Behavior:
415
- * - successful network catalog refreshes cache
416
- * - later network failures reuse cached catalog when available
417
- * - when both network and cache are unavailable, configured defaults are used
418
- *
419
- * Production integrations may follow the same policy while replacing this
420
- * in-memory harness with real logging, metrics, and storage.
421
- *
422
- * @param options Optional initial network and default catalogs keyed by URL.
423
- * @returns Fetcher plus observable state and mutation helpers.
424
- */
425
- export function createDiscoveryCatalogFetcher(options = {}) {
426
- const internetResponses = new Map([
427
- ...Object.entries(options.internetCatalogs || {}).map(([url, catalog]) => [url, createDiscoveryCatalogFetchResponse(catalog, { ok: true, status: 200 })]),
428
- ...Object.entries(options.internetJsonByUrl || {}).map(([url, payload]) => [url, createDiscoveryCatalogFetchResponse(payload, { ok: true, status: 200 })]),
429
- ]);
430
- const internetPayloads = new Map([
431
- ...Object.entries(options.internetCatalogs || {}).map(([url, catalog]) => [String(url), catalog]),
432
- ...Object.entries(options.internetJsonByUrl || {}).map(([url, payload]) => [String(url), payload]),
433
- ]);
434
- const defaultCatalogs = new Map(Object.entries(options.defaultCatalogs || {}));
435
- const cache = new Map();
436
- const sources = new Map();
437
- const calls = [];
438
- return {
439
- calls,
440
- sources,
441
- cache,
442
- setInternetCatalog(url, catalog) {
443
- internetResponses.set(String(url), createDiscoveryCatalogFetchResponse(catalog, { ok: true, status: 200 }));
444
- internetPayloads.set(String(url), catalog);
445
- },
446
- setInternetJson(url, payload) {
447
- internetResponses.set(String(url), createDiscoveryCatalogFetchResponse(payload, { ok: true, status: 200 }));
448
- internetPayloads.set(String(url), payload);
449
- },
450
- setInternetFailure(url, status = 503, body = { error: 'temporary failure' }) {
451
- internetResponses.set(String(url), createDiscoveryCatalogFetchResponse(body, { ok: false, status }));
452
- internetPayloads.delete(String(url));
453
- },
454
- clearInternetRoute(url) {
455
- internetResponses.delete(String(url));
456
- internetPayloads.delete(String(url));
457
- },
458
- async fetcher(input) {
459
- const key = String(input);
460
- calls.push(key);
461
- const internetResponse = internetResponses.get(key);
462
- if (internetResponse && internetResponse.ok) {
463
- const payload = internetPayloads.get(key);
464
- if (isHostingOperatorCatalogPayload(payload)) {
465
- cache.set(key, payload);
466
- }
467
- sources.set(key, DiscoveryCatalogSource.Internet);
468
- return internetResponse;
469
- }
470
- if (cache.has(key)) {
471
- sources.set(key, DiscoveryCatalogSource.Cache);
472
- return createDiscoveryCatalogFetchResponse(cache.get(key), { ok: true, status: 200 });
473
- }
474
- if (defaultCatalogs.has(key)) {
475
- sources.set(key, DiscoveryCatalogSource.Default);
476
- return createDiscoveryCatalogFetchResponse(defaultCatalogs.get(key), { ok: true, status: 200 });
477
- }
478
- sources.set(key, DiscoveryCatalogSource.Default);
479
- return createDiscoveryCatalogFetchResponse({ error: 'not found' }, { ok: false, status: 404 });
480
- },
481
- };
482
- }
@@ -1,66 +0,0 @@
1
- import { type DataspaceProtocolVersionValue } from '../constants/dataspace-protocol';
2
- import type { DspaceProtocolVersionEntry, DspaceVersionMetadata } from '../models/dataspace-protocol';
3
- /**
4
- * Route context used to build tenant-scoped or host-scoped GW CORE DSP paths.
5
- *
6
- * Semantic rule:
7
- * - `tenantId` participants use `businessSector`
8
- * - `host`/ICA/runtime participants use `hostNetwork`
9
- */
10
- export type GwDataspaceRouteContext = Readonly<{
11
- participantId?: string;
12
- tenantId?: string;
13
- jurisdiction?: string;
14
- version?: string;
15
- hostNetwork?: string;
16
- /** @deprecated Use `hostNetwork`. */
17
- hostNetworkOrBusinessSector?: string;
18
- businessSector?: string;
19
- sector?: string;
20
- }>;
21
- /**
22
- * Builds the GW CORE base DSP path.
23
- *
24
- * Participant scope:
25
- * - `/{participantId}/cds-{jurisdiction}/{version}/{hostNetwork|businessSector}/dsp`
26
- */
27
- export declare function buildGwDataspaceBasePath(input?: GwDataspaceRouteContext): string;
28
- /**
29
- * Builds the canonical DSP version-discovery well-known path for GW CORE.
30
- *
31
- * Participant scope:
32
- * - `/{participantId}/cds-{jurisdiction}/{version}/{hostNetwork|businessSector}/.well-known/dspace-version`
33
- */
34
- export declare function buildGwDspaceVersionWellKnownPath(input?: GwDataspaceRouteContext): string;
35
- /**
36
- * Builds the project-local GW CORE DSP catalog request endpoint.
37
- */
38
- export declare function buildGwCatalogRequestPath(input?: GwDataspaceRouteContext): string;
39
- /**
40
- * Builds the GW CORE catalog collection base path.
41
- */
42
- export declare function buildGwCatalogCollectionPath(input?: GwDataspaceRouteContext): string;
43
- /**
44
- * Builds the project-local GW CORE catalog artifact URL path used for public
45
- * read-only autodiscovery.
46
- */
47
- export declare function buildGwCatalogArtifactPath(input?: GwDataspaceRouteContext): string;
48
- /**
49
- * Builds the project-local GW CORE dataset lookup path.
50
- */
51
- export declare function buildGwCatalogDatasetPath(input?: GwDataspaceRouteContext, datasetId?: string): string;
52
- /**
53
- * Builds a minimal DSP version metadata payload for a given GW CORE DSP base
54
- * path.
55
- */
56
- export declare function buildDspaceVersionMetadata(path: string, version?: DataspaceProtocolVersionValue): DspaceVersionMetadata;
57
- /**
58
- * Selects the preferred advertised DSP version entry from a `dspace-version`
59
- * payload.
60
- */
61
- export declare function selectDspaceProtocolVersionEntry(metadata: DspaceVersionMetadata | null | undefined, version?: string): DspaceProtocolVersionEntry | undefined;
62
- /**
63
- * Derives the GW CORE catalog artifact URL from a `dspace-version` endpoint URL
64
- * and its parsed payload.
65
- */
66
- export declare function deriveGwCatalogArtifactUrlFromDspaceVersion(dspaceVersionUrl: string, metadata: DspaceVersionMetadata | null | undefined, version?: string): string | undefined;
@@ -1,109 +0,0 @@
1
- // Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
2
- import { DataspaceProtocolVersions, DataspaceWellKnownPaths, GwDataspaceBindingPaths, } from '../constants/dataspace-protocol';
3
- function resolveParticipantId(input) {
4
- return String(input.participantId || input.tenantId || '').trim();
5
- }
6
- function resolveSectorLikeSegment(input) {
7
- return String(input.hostNetwork
8
- || input.hostNetworkOrBusinessSector
9
- || input.businessSector
10
- || input.sector
11
- || '').trim();
12
- }
13
- function hasParticipantRouteContext(input) {
14
- return Boolean(resolveParticipantId(input)
15
- && String(input.jurisdiction || '').trim()
16
- && String(input.version || '').trim()
17
- && resolveSectorLikeSegment(input));
18
- }
19
- /**
20
- * Builds the GW CORE base DSP path.
21
- *
22
- * Participant scope:
23
- * - `/{participantId}/cds-{jurisdiction}/{version}/{hostNetwork|businessSector}/dsp`
24
- */
25
- export function buildGwDataspaceBasePath(input = {}) {
26
- if (!hasParticipantRouteContext(input)) {
27
- return GwDataspaceBindingPaths.Base;
28
- }
29
- return `/${resolveParticipantId(input)}`
30
- + `/cds-${String(input.jurisdiction).trim()}`
31
- + `/${String(input.version).trim()}`
32
- + `/${resolveSectorLikeSegment(input)}`
33
- + GwDataspaceBindingPaths.Base;
34
- }
35
- /**
36
- * Builds the canonical DSP version-discovery well-known path for GW CORE.
37
- *
38
- * Participant scope:
39
- * - `/{participantId}/cds-{jurisdiction}/{version}/{hostNetwork|businessSector}/.well-known/dspace-version`
40
- */
41
- export function buildGwDspaceVersionWellKnownPath(input = {}) {
42
- if (!hasParticipantRouteContext(input)) {
43
- return DataspaceWellKnownPaths.VersionMetadata;
44
- }
45
- return `/${resolveParticipantId(input)}`
46
- + `/cds-${String(input.jurisdiction).trim()}`
47
- + `/${String(input.version).trim()}`
48
- + `/${resolveSectorLikeSegment(input)}`
49
- + DataspaceWellKnownPaths.VersionMetadata;
50
- }
51
- /**
52
- * Builds the project-local GW CORE DSP catalog request endpoint.
53
- */
54
- export function buildGwCatalogRequestPath(input = {}) {
55
- return `${buildGwDataspaceBasePath(input)}${GwDataspaceBindingPaths.CatalogRequestSuffix}`;
56
- }
57
- /**
58
- * Builds the GW CORE catalog collection base path.
59
- */
60
- export function buildGwCatalogCollectionPath(input = {}) {
61
- return `${buildGwDataspaceBasePath(input)}${GwDataspaceBindingPaths.CatalogCollectionSuffix}`;
62
- }
63
- /**
64
- * Builds the project-local GW CORE catalog artifact URL path used for public
65
- * read-only autodiscovery.
66
- */
67
- export function buildGwCatalogArtifactPath(input = {}) {
68
- return `${buildGwDataspaceBasePath(input)}${GwDataspaceBindingPaths.CatalogArtifactSuffix}`;
69
- }
70
- /**
71
- * Builds the project-local GW CORE dataset lookup path.
72
- */
73
- export function buildGwCatalogDatasetPath(input = {}, datasetId = ':id') {
74
- return `${buildGwDataspaceBasePath(input)}${GwDataspaceBindingPaths.CatalogDatasetsPrefix}/${datasetId}`;
75
- }
76
- /**
77
- * Builds a minimal DSP version metadata payload for a given GW CORE DSP base
78
- * path.
79
- */
80
- export function buildDspaceVersionMetadata(path, version = DataspaceProtocolVersions.Current) {
81
- return {
82
- protocolVersions: [
83
- {
84
- version,
85
- path,
86
- },
87
- ],
88
- };
89
- }
90
- /**
91
- * Selects the preferred advertised DSP version entry from a `dspace-version`
92
- * payload.
93
- */
94
- export function selectDspaceProtocolVersionEntry(metadata, version = DataspaceProtocolVersions.Current) {
95
- const entries = metadata?.protocolVersions || [];
96
- return entries.find((entry) => String(entry.version || '').trim() === String(version).trim())
97
- || entries[0];
98
- }
99
- /**
100
- * Derives the GW CORE catalog artifact URL from a `dspace-version` endpoint URL
101
- * and its parsed payload.
102
- */
103
- export function deriveGwCatalogArtifactUrlFromDspaceVersion(dspaceVersionUrl, metadata, version = DataspaceProtocolVersions.Current) {
104
- const entry = selectDspaceProtocolVersionEntry(metadata, version);
105
- if (!entry?.path)
106
- return undefined;
107
- const base = new URL(dspaceVersionUrl);
108
- return new URL(`${String(entry.path).trim()}${GwDataspaceBindingPaths.CatalogArtifactSuffix}`, `${base.protocol}//${base.host}`).toString();
109
- }