gdc-sdk-front-ts 2.2.1 → 2.3.0
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.
- package/dist/ProfileManager.js +6 -3
- package/dist/front-clinical-runtime-client.d.ts +69 -0
- package/dist/front-clinical-runtime-client.js +214 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/orchestration/client-port.d.ts +21 -3
- package/dist/orchestration/individual-member-sdk.d.ts +11 -1
- package/dist/orchestration/individual-member-sdk.js +12 -0
- package/dist/orchestration/professional-sdk.d.ts +7 -1
- package/dist/orchestration/professional-sdk.js +6 -0
- package/package.json +3 -3
- package/dist/discovery/HttpDataspaceDiscoveryClient.d.ts +0 -34
- package/dist/discovery/HttpDataspaceDiscoveryClient.js +0 -47
- package/dist/gdc-common-utils-ts/src/AesManager.d.ts +0 -27
- package/dist/gdc-common-utils-ts/src/AesManager.js +0 -64
- package/dist/gdc-common-utils-ts/src/CryptographyService.d.ts +0 -76
- package/dist/gdc-common-utils-ts/src/CryptographyService.js +0 -401
- package/dist/gdc-common-utils-ts/src/constants/actor-session.d.ts +0 -40
- package/dist/gdc-common-utils-ts/src/constants/actor-session.js +0 -40
- package/dist/gdc-common-utils-ts/src/constants/communication.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/constants/communication.js +0 -14
- package/dist/gdc-common-utils-ts/src/constants/cryptography.d.ts +0 -58
- package/dist/gdc-common-utils-ts/src/constants/cryptography.js +0 -49
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.js +0 -11
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.d.ts +0 -27
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.js +0 -27
- package/dist/gdc-common-utils-ts/src/constants/device.d.ts +0 -16
- package/dist/gdc-common-utils-ts/src/constants/device.js +0 -15
- package/dist/gdc-common-utils-ts/src/constants/did-services.d.ts +0 -42
- package/dist/gdc-common-utils-ts/src/constants/did-services.js +0 -40
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.d.ts +0 -36
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.js +0 -69
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.d.ts +0 -12
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.js +0 -12
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.d.ts +0 -52
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.js +0 -33
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.js +0 -10
- package/dist/gdc-common-utils-ts/src/constants/healthcare.d.ts +0 -496
- package/dist/gdc-common-utils-ts/src/constants/healthcare.js +0 -274
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.d.ts +0 -44
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.js +0 -208
- package/dist/gdc-common-utils-ts/src/constants/index.d.ts +0 -21
- package/dist/gdc-common-utils-ts/src/constants/index.js +0 -21
- package/dist/gdc-common-utils-ts/src/constants/network.d.ts +0 -25
- package/dist/gdc-common-utils-ts/src/constants/network.js +0 -17
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.d.ts +0 -175
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.js +0 -261
- package/dist/gdc-common-utils-ts/src/constants/sectors.d.ts +0 -24
- package/dist/gdc-common-utils-ts/src/constants/sectors.js +0 -24
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.d.ts +0 -82
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.js +0 -105
- package/dist/gdc-common-utils-ts/src/constants/smart.d.ts +0 -12
- package/dist/gdc-common-utils-ts/src/constants/smart.js +0 -12
- package/dist/gdc-common-utils-ts/src/constants/urn.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/constants/urn.js +0 -11
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.d.ts +0 -34
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.js +0 -42
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.d.ts +0 -75
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.js +0 -33
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.d.ts +0 -15
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.js +0 -16
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.d.ts +0 -22
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.js +0 -81
- package/dist/gdc-common-utils-ts/src/examples/consent-access.d.ts +0 -30
- package/dist/gdc-common-utils-ts/src/examples/consent-access.js +0 -121
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.d.ts +0 -15
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.js +0 -16
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.d.ts +0 -98
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.js +0 -141
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.js +0 -24
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.d.ts +0 -64
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.js +0 -77
- package/dist/gdc-common-utils-ts/src/examples/index.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/examples/index.js +0 -14
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.d.ts +0 -100
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.js +0 -71
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.d.ts +0 -505
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.js +0 -291
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.d.ts +0 -163
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.js +0 -93
- package/dist/gdc-common-utils-ts/src/examples/professional.d.ts +0 -228
- package/dist/gdc-common-utils-ts/src/examples/professional.js +0 -324
- package/dist/gdc-common-utils-ts/src/examples/related-person.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/examples/related-person.js +0 -13
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.js +0 -96
- package/dist/gdc-common-utils-ts/src/examples/shared.d.ts +0 -220
- package/dist/gdc-common-utils-ts/src/examples/shared.js +0 -191
- package/dist/gdc-common-utils-ts/src/hmac.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/hmac.js +0 -24
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.d.ts +0 -6
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.js +0 -15
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.d.ts +0 -4
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.js +0 -13
- package/dist/gdc-common-utils-ts/src/index.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/index.js +0 -10
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.d.ts +0 -139
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.js +0 -8
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.js +0 -3
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.d.ts +0 -154
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/actor-session.d.ts +0 -9
- package/dist/gdc-common-utils-ts/src/models/actor-session.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/aes.d.ts +0 -85
- package/dist/gdc-common-utils-ts/src/models/aes.js +0 -10
- package/dist/gdc-common-utils-ts/src/models/auth.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/models/auth.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/bundle.d.ts +0 -153
- package/dist/gdc-common-utils-ts/src/models/bundle.js +0 -25
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.d.ts +0 -36
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.d.ts +0 -150
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.js +0 -104
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.js +0 -32
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.d.ts +0 -126
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.js +0 -67
- package/dist/gdc-common-utils-ts/src/models/comm.d.ts +0 -56
- package/dist/gdc-common-utils-ts/src/models/comm.js +0 -4
- package/dist/gdc-common-utils-ts/src/models/confidential-job.d.ts +0 -78
- package/dist/gdc-common-utils-ts/src/models/confidential-job.js +0 -20
- package/dist/gdc-common-utils-ts/src/models/confidential-message.d.ts +0 -97
- package/dist/gdc-common-utils-ts/src/models/confidential-message.js +0 -4
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.d.ts +0 -134
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/consent-access.d.ts +0 -79
- package/dist/gdc-common-utils-ts/src/models/consent-access.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/consent-rule.d.ts +0 -122
- package/dist/gdc-common-utils-ts/src/models/consent-rule.js +0 -22
- package/dist/gdc-common-utils-ts/src/models/crypto.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/models/crypto.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.d.ts +0 -79
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.d.ts +0 -68
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.js +0 -9
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/device-license.d.ts +0 -134
- package/dist/gdc-common-utils-ts/src/models/device-license.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/did.d.ts +0 -108
- package/dist/gdc-common-utils-ts/src/models/did.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.d.ts +0 -101
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.d.ts +0 -104
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.js +0 -2
- package/dist/gdc-common-utils-ts/src/models/index.d.ts +0 -42
- package/dist/gdc-common-utils-ts/src/models/index.js +0 -42
- package/dist/gdc-common-utils-ts/src/models/indexing.d.ts +0 -11
- package/dist/gdc-common-utils-ts/src/models/indexing.js +0 -18
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.d.ts +0 -24
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.js +0 -36
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.d.ts +0 -53
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.js +0 -55
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.js +0 -25
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.js +0 -23
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.d.ts +0 -36
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.js +0 -89
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.d.ts +0 -341
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.js +0 -204
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.d.ts +0 -9
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.d.ts +0 -5
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.js +0 -7
- package/dist/gdc-common-utils-ts/src/models/issue.d.ts +0 -57
- package/dist/gdc-common-utils-ts/src/models/issue.js +0 -75
- package/dist/gdc-common-utils-ts/src/models/jsonapi.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/models/jsonapi.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jwe.d.ts +0 -120
- package/dist/gdc-common-utils-ts/src/models/jwe.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jwk.d.ts +0 -39
- package/dist/gdc-common-utils-ts/src/models/jwk.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jws.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/models/jws.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/jwt.d.ts +0 -9
- package/dist/gdc-common-utils-ts/src/models/jwt.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.js +0 -58
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.d.ts +0 -33
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.d.ts +0 -50
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.d.ts +0 -67
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.d.ts +0 -51
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.js +0 -5
- package/dist/gdc-common-utils-ts/src/models/openid-device.d.ts +0 -119
- package/dist/gdc-common-utils-ts/src/models/openid-device.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.d.ts +0 -26
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/params.d.ts +0 -133
- package/dist/gdc-common-utils-ts/src/models/params.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/relationship-access.d.ts +0 -160
- package/dist/gdc-common-utils-ts/src/models/relationship-access.js +0 -21
- package/dist/gdc-common-utils-ts/src/models/resource-document.d.ts +0 -14
- package/dist/gdc-common-utils-ts/src/models/resource-document.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/response.d.ts +0 -1
- package/dist/gdc-common-utils-ts/src/models/response.js +0 -3
- package/dist/gdc-common-utils-ts/src/models/urlPath.d.ts +0 -58
- package/dist/gdc-common-utils-ts/src/models/urlPath.js +0 -76
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.d.ts +0 -45
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.js +0 -8
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.d.ts +0 -53
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.js +0 -25
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.d.ts +0 -30
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.js +0 -81
- package/dist/gdc-common-utils-ts/src/storage/index.d.ts +0 -3
- package/dist/gdc-common-utils-ts/src/storage/index.js +0 -4
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.d.ts +0 -86
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.js +0 -218
- package/dist/gdc-common-utils-ts/src/utils/activation-request.d.ts +0 -81
- package/dist/gdc-common-utils-ts/src/utils/activation-request.js +0 -99
- package/dist/gdc-common-utils-ts/src/utils/actor.d.ts +0 -18
- package/dist/gdc-common-utils-ts/src/utils/actor.js +0 -36
- package/dist/gdc-common-utils-ts/src/utils/base-convert.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/base-convert.js +0 -104
- package/dist/gdc-common-utils-ts/src/utils/baseN.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/utils/baseN.js +0 -174
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.d.ts +0 -35
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.js +0 -177
- package/dist/gdc-common-utils-ts/src/utils/bundle.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/utils/bundle.js +0 -39
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.d.ts +0 -64
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.js +0 -279
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.js +0 -291
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.d.ts +0 -110
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.js +0 -326
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.d.ts +0 -41
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.js +0 -170
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.d.ts +0 -41
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.js +0 -215
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.d.ts +0 -152
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.js +0 -121
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.d.ts +0 -79
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.js +0 -213
- package/dist/gdc-common-utils-ts/src/utils/consent.d.ts +0 -218
- package/dist/gdc-common-utils-ts/src/utils/consent.js +0 -679
- package/dist/gdc-common-utils-ts/src/utils/content.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/utils/content.js +0 -60
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.d.ts +0 -130
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.js +0 -307
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.d.ts +0 -235
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.js +0 -482
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.d.ts +0 -66
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.js +0 -109
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.js +0 -173
- package/dist/gdc-common-utils-ts/src/utils/did.d.ts +0 -124
- package/dist/gdc-common-utils-ts/src/utils/did.js +0 -204
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.d.ts +0 -10
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.js +0 -15
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.d.ts +0 -48
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.js +0 -81
- package/dist/gdc-common-utils-ts/src/utils/didcomm.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/didcomm.js +0 -78
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.js +0 -64
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.d.ts +0 -60
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.js +0 -152
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.d.ts +0 -61
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.js +0 -91
- package/dist/gdc-common-utils-ts/src/utils/format-converter.d.ts +0 -21
- package/dist/gdc-common-utils-ts/src/utils/format-converter.js +0 -109
- package/dist/gdc-common-utils-ts/src/utils/index.d.ts +0 -39
- package/dist/gdc-common-utils-ts/src/utils/index.js +0 -39
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.d.ts +0 -55
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.js +0 -191
- package/dist/gdc-common-utils-ts/src/utils/jwt.d.ts +0 -53
- package/dist/gdc-common-utils-ts/src/utils/jwt.js +0 -154
- package/dist/gdc-common-utils-ts/src/utils/manager-error.d.ts +0 -15
- package/dist/gdc-common-utils-ts/src/utils/manager-error.js +0 -21
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.d.ts +0 -56
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.js +0 -127
- package/dist/gdc-common-utils-ts/src/utils/multibase58.d.ts +0 -13
- package/dist/gdc-common-utils-ts/src/utils/multibase58.js +0 -40
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.d.ts +0 -8
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.js +0 -23
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.d.ts +0 -1
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.js +0 -35
- package/dist/gdc-common-utils-ts/src/utils/normalize.d.ts +0 -16
- package/dist/gdc-common-utils-ts/src/utils/normalize.js +0 -40
- package/dist/gdc-common-utils-ts/src/utils/object-convert.d.ts +0 -20
- package/dist/gdc-common-utils-ts/src/utils/object-convert.js +0 -51
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.d.ts +0 -28
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.js +0 -29
- package/dist/gdc-common-utils-ts/src/utils/string-convert.d.ts +0 -24
- package/dist/gdc-common-utils-ts/src/utils/string-convert.js +0 -62
- package/dist/gdc-common-utils-ts/src/utils/string-utils.d.ts +0 -25
- package/dist/gdc-common-utils-ts/src/utils/string-utils.js +0 -66
- package/dist/gdc-common-utils-ts/src/utils/url.d.ts +0 -26
- package/dist/gdc-common-utils-ts/src/utils/url.js +0 -44
- package/dist/gdc-common-utils-ts/src/utils/vp-token.d.ts +0 -139
- package/dist/gdc-common-utils-ts/src/utils/vp-token.js +0 -256
- package/dist/gdc-sdk-core-ts/src/actor-model.d.ts +0 -56
- package/dist/gdc-sdk-core-ts/src/actor-model.js +0 -112
- package/dist/gdc-sdk-core-ts/src/app-identity.d.ts +0 -80
- package/dist/gdc-sdk-core-ts/src/app-identity.js +0 -147
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.d.ts +0 -165
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.js +0 -191
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.d.ts +0 -112
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.js +0 -185
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.d.ts +0 -32
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.js +0 -215
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.d.ts +0 -55
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.js +0 -190
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.d.ts +0 -55
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.js +0 -194
- package/dist/gdc-sdk-core-ts/src/communication-draft.d.ts +0 -104
- package/dist/gdc-sdk-core-ts/src/communication-draft.js +0 -143
- package/dist/gdc-sdk-core-ts/src/communication-outbox.d.ts +0 -49
- package/dist/gdc-sdk-core-ts/src/communication-outbox.js +0 -62
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.d.ts +0 -180
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.js +0 -455
- package/dist/gdc-sdk-core-ts/src/consent-access.d.ts +0 -73
- package/dist/gdc-sdk-core-ts/src/consent-access.js +0 -109
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.d.ts +0 -5
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.js +0 -6
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.d.ts +0 -82
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.js +0 -135
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.d.ts +0 -33
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.js +0 -56
- package/dist/gdc-sdk-core-ts/src/discovery-facade.d.ts +0 -84
- package/dist/gdc-sdk-core-ts/src/discovery-facade.js +0 -24
- package/dist/gdc-sdk-core-ts/src/identity-model.d.ts +0 -46
- package/dist/gdc-sdk-core-ts/src/identity-model.js +0 -2
- package/dist/gdc-sdk-core-ts/src/identity-store.d.ts +0 -83
- package/dist/gdc-sdk-core-ts/src/identity-store.js +0 -51
- package/dist/gdc-sdk-core-ts/src/index.d.ts +0 -23
- package/dist/gdc-sdk-core-ts/src/index.js +0 -24
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.d.ts +0 -5
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.js +0 -6
- package/dist/gdc-sdk-core-ts/src/polling-model.d.ts +0 -35
- package/dist/gdc-sdk-core-ts/src/polling-model.js +0 -24
- package/dist/gdc-sdk-core-ts/src/relationship-access.d.ts +0 -40
- package/dist/gdc-sdk-core-ts/src/relationship-access.js +0 -150
- package/dist/gdc-sdk-core-ts/src/session-model.d.ts +0 -134
- package/dist/gdc-sdk-core-ts/src/session-model.js +0 -2
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.d.ts +0 -19
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.js +0 -19
- package/dist/gdc-sdk-core-ts/src/vital-signs.d.ts +0 -38
- package/dist/gdc-sdk-core-ts/src/vital-signs.js +0 -155
- package/dist/gdc-sdk-front-ts/src/ClientSDK.d.ts +0 -99
- package/dist/gdc-sdk-front-ts/src/ClientSDK.js +0 -177
- package/dist/gdc-sdk-front-ts/src/ProfileManager.d.ts +0 -140
- package/dist/gdc-sdk-front-ts/src/ProfileManager.js +0 -76
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.d.ts +0 -11
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.js +0 -26
- package/dist/gdc-sdk-front-ts/src/VerifierService.d.ts +0 -6
- package/dist/gdc-sdk-front-ts/src/VerifierService.js +0 -10
- package/dist/gdc-sdk-front-ts/src/actor-session.d.ts +0 -2
- package/dist/gdc-sdk-front-ts/src/actor-session.js +0 -2
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.d.ts +0 -8
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.js +0 -28
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.d.ts +0 -4
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.js +0 -5
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.d.ts +0 -54
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.js +0 -85
- package/dist/gdc-sdk-front-ts/src/discovery/index.d.ts +0 -3
- package/dist/gdc-sdk-front-ts/src/discovery/index.js +0 -4
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.d.ts +0 -29
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.js +0 -60
- package/dist/gdc-sdk-front-ts/src/discovery/types.d.ts +0 -83
- package/dist/gdc-sdk-front-ts/src/discovery/types.js +0 -2
- package/dist/gdc-sdk-front-ts/src/index.d.ts +0 -15
- package/dist/gdc-sdk-front-ts/src/index.js +0 -16
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.d.ts +0 -4
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.js +0 -5
- package/dist/gdc-sdk-front-ts/src/roleRegistry.d.ts +0 -19
- package/dist/gdc-sdk-front-ts/src/roleRegistry.js +0 -2
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.d.ts +0 -22
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.js +0 -7
- package/dist/gdc-sdk-front-ts/src/services.d.ts +0 -167
- package/dist/gdc-sdk-front-ts/src/services.js +0 -78
- package/dist/gdc-sdk-front-ts/src/session-descriptor.d.ts +0 -11
- package/dist/gdc-sdk-front-ts/src/session-descriptor.js +0 -8
- package/dist/gdc-sdk-front-ts/src/types.d.ts +0 -11
- package/dist/gdc-sdk-front-ts/src/types.js +0 -1
- package/dist/lifecycle-examples.d.ts +0 -6
- package/dist/lifecycle-examples.js +0 -7
- package/dist/medication-claim-helpers.d.ts +0 -4
- package/dist/medication-claim-helpers.js +0 -5
- package/dist/orchestration/facades.d.ts +0 -65
- package/dist/orchestration/facades.js +0 -142
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalizes a FHIR resource or Bundle into an array of entries.
|
|
3
|
-
*/
|
|
4
|
-
export declare const convertResourceDataToArrayOfDataEntries: (inputData: any, requestPath: string, webDomain: string) => any[];
|
|
5
|
-
/**
|
|
6
|
-
* Converts a resource or a FHIR Bundle to a JSON:API Primary Document.
|
|
7
|
-
*/
|
|
8
|
-
export declare const convertResourceOrBundleToPrimaryDoc: (resourceData: any, specification: string, webDomain: string, requestPath: string) => any;
|
|
9
|
-
/**
|
|
10
|
-
* Converts a JSON:API Primary Document back to a FHIR Bundle.
|
|
11
|
-
*/
|
|
12
|
-
export declare const convertPrimaryDocToBundleFHIR: (primaryDocument: any, bundleType: string) => any;
|
|
13
|
-
/**
|
|
14
|
-
* Converts a FHIR Bundle containing one or more OperationOutcome entries into a
|
|
15
|
-
* compliant JSON:API Error Document. Each error entry in the bundle is mapped
|
|
16
|
-
* to a corresponding error object in the JSON:API `errors` array.
|
|
17
|
-
*
|
|
18
|
-
* @param errorBundle The FHIR Bundle representing the error(s).
|
|
19
|
-
* @returns A JSON:API document with a top-level `errors` array.
|
|
20
|
-
*/
|
|
21
|
-
export declare const convertFhirErrorBundleToJsonApiError: (errorBundle: any) => any;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
// crypto-ts/utils/format-converter.ts
|
|
2
|
-
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
3
|
-
import { safelyJoinUrl } from "./url";
|
|
4
|
-
/**
|
|
5
|
-
* Normalizes a FHIR resource or Bundle into an array of entries.
|
|
6
|
-
*/
|
|
7
|
-
export const convertResourceDataToArrayOfDataEntries = (inputData, requestPath, webDomain) => {
|
|
8
|
-
if (inputData.resourceType) { // It is FHIR data
|
|
9
|
-
if (inputData.resourceType === 'Bundle') {
|
|
10
|
-
return inputData.entry || [];
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
const resourceIdentifier = inputData.id || (inputData.identifier && inputData.identifier[0]?.value) || "";
|
|
14
|
-
const fullUrl = safelyJoinUrl(webDomain, safelyJoinUrl(requestPath, resourceIdentifier));
|
|
15
|
-
return [{ fullUrl, resource: inputData }];
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
else { // Assume it's already a JSON:API-like object
|
|
19
|
-
const resourceIdentifier = inputData.id || "";
|
|
20
|
-
// const fullUrl = safelyJoinUrl(webDomain, safelyJoinUrl(requestPath, resourceIdentifier));
|
|
21
|
-
return [inputData];
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Converts a resource or a FHIR Bundle to a JSON:API Primary Document.
|
|
26
|
-
*/
|
|
27
|
-
export const convertResourceOrBundleToPrimaryDoc = (resourceData, specification, webDomain, requestPath) => {
|
|
28
|
-
const entries = convertResourceDataToArrayOfDataEntries(resourceData, requestPath, webDomain);
|
|
29
|
-
// Handle FHIR entry structure vs. JSON:API data structure
|
|
30
|
-
const data = entries.map(entry => {
|
|
31
|
-
if (entry.resource) { // It's a FHIR entry
|
|
32
|
-
return {
|
|
33
|
-
type: `${specification}.${entry.resource.resourceType}`,
|
|
34
|
-
id: entry.resource.id,
|
|
35
|
-
attributes: { ...entry.resource }
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
return entry; // Assumes it's already a JSON:API resource object
|
|
39
|
-
});
|
|
40
|
-
return { data };
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* Converts a JSON:API Primary Document back to a FHIR Bundle.
|
|
44
|
-
*/
|
|
45
|
-
export const convertPrimaryDocToBundleFHIR = (primaryDocument, bundleType) => {
|
|
46
|
-
const entries = [];
|
|
47
|
-
if (primaryDocument.data) {
|
|
48
|
-
entries.push(...primaryDocument.data.map((jsonApiResourceObject) => ({
|
|
49
|
-
// fullUrl might need to be reconstructed based on context
|
|
50
|
-
resource: jsonApiResourceObject.attributes || jsonApiResourceObject
|
|
51
|
-
})));
|
|
52
|
-
}
|
|
53
|
-
if (primaryDocument.errors) {
|
|
54
|
-
entries.push(...primaryDocument.errors.map((errorObject) => ({
|
|
55
|
-
resource: {
|
|
56
|
-
resourceType: 'OperationOutcome',
|
|
57
|
-
id: errorObject.id,
|
|
58
|
-
issue: [{
|
|
59
|
-
code: errorObject.status,
|
|
60
|
-
severity: 'error',
|
|
61
|
-
details: { text: errorObject.detail },
|
|
62
|
-
}]
|
|
63
|
-
}
|
|
64
|
-
})));
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
entry: entries,
|
|
68
|
-
resourceType: 'Bundle',
|
|
69
|
-
total: primaryDocument.data ? primaryDocument.data.length : 0,
|
|
70
|
-
type: bundleType
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* Converts a FHIR Bundle containing one or more OperationOutcome entries into a
|
|
75
|
-
* compliant JSON:API Error Document. Each error entry in the bundle is mapped
|
|
76
|
-
* to a corresponding error object in the JSON:API `errors` array.
|
|
77
|
-
*
|
|
78
|
-
* @param errorBundle The FHIR Bundle representing the error(s).
|
|
79
|
-
* @returns A JSON:API document with a top-level `errors` array.
|
|
80
|
-
*/
|
|
81
|
-
export const convertFhirErrorBundleToJsonApiError = (errorBundle) => {
|
|
82
|
-
if (!errorBundle.entry || errorBundle.entry.length === 0) {
|
|
83
|
-
return {
|
|
84
|
-
errors: [{
|
|
85
|
-
status: '500',
|
|
86
|
-
title: 'Unknown Error',
|
|
87
|
-
detail: 'An unspecified error occurred and the error bundle was malformed or empty.'
|
|
88
|
-
}]
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
const errorObjects = errorBundle.entry.map((entry) => {
|
|
92
|
-
const resource = entry.resource || {};
|
|
93
|
-
const issue = resource.issue ? resource.issue[0] : {};
|
|
94
|
-
const title = issue.details?.text || 'Processing Error';
|
|
95
|
-
return {
|
|
96
|
-
id: resource.id,
|
|
97
|
-
status: entry.response?.status?.toString() || '500',
|
|
98
|
-
code: issue.code || 'processing-error',
|
|
99
|
-
title: title,
|
|
100
|
-
detail: issue.diagnostics || 'An error occurred while processing the request.',
|
|
101
|
-
meta: {
|
|
102
|
-
severity: issue.severity || 'error'
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
});
|
|
106
|
-
return {
|
|
107
|
-
errors: errorObjects
|
|
108
|
-
};
|
|
109
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export * from './actor';
|
|
2
|
-
export * from './activation-policy';
|
|
3
|
-
export * from './base-convert';
|
|
4
|
-
export * from './baseN';
|
|
5
|
-
export * from './bundle';
|
|
6
|
-
export * from './bundle-query';
|
|
7
|
-
export * from './content';
|
|
8
|
-
export * from './consent';
|
|
9
|
-
export * from './consent-claim-helpers';
|
|
10
|
-
export * from './medication-claim-helpers';
|
|
11
|
-
export * from './did';
|
|
12
|
-
export * from './did-resolution';
|
|
13
|
-
export * from './dataspace-discovery';
|
|
14
|
-
export * from './dataspace-discovery-defaults';
|
|
15
|
-
export * from './dataspace-protocol';
|
|
16
|
-
export * from './didcomm';
|
|
17
|
-
export * from './didcomm-submit';
|
|
18
|
-
export * from './didcomm-submit-policy';
|
|
19
|
-
export * from './discovery-normalization';
|
|
20
|
-
export * from './format-converter';
|
|
21
|
-
export * from './fhir-cid';
|
|
22
|
-
export * from './communication-fhir-r4';
|
|
23
|
-
export * from './communication-document-reference';
|
|
24
|
-
export * from './communication-identity';
|
|
25
|
-
export * from './communication-bundle-session';
|
|
26
|
-
export * from './clinical-resource-converters';
|
|
27
|
-
export * from './clinical-resource-view';
|
|
28
|
-
export * from './fhir-validator';
|
|
29
|
-
export * from './individual-form-pdf';
|
|
30
|
-
export * from './jwt';
|
|
31
|
-
export * from './manager-error';
|
|
32
|
-
export * from './multibase58';
|
|
33
|
-
export * from './multibasehash';
|
|
34
|
-
export * from './normalize';
|
|
35
|
-
export * from './object-convert';
|
|
36
|
-
export * from './normalize-uuid';
|
|
37
|
-
export * from './smart-scope';
|
|
38
|
-
export * from './activation-request';
|
|
39
|
-
export * from './vp-token';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export * from './actor';
|
|
2
|
-
export * from './activation-policy';
|
|
3
|
-
export * from './base-convert';
|
|
4
|
-
export * from './baseN';
|
|
5
|
-
export * from './bundle';
|
|
6
|
-
export * from './bundle-query';
|
|
7
|
-
export * from './content';
|
|
8
|
-
export * from './consent';
|
|
9
|
-
export * from './consent-claim-helpers';
|
|
10
|
-
export * from './medication-claim-helpers';
|
|
11
|
-
export * from './did';
|
|
12
|
-
export * from './did-resolution';
|
|
13
|
-
export * from './dataspace-discovery';
|
|
14
|
-
export * from './dataspace-discovery-defaults';
|
|
15
|
-
export * from './dataspace-protocol';
|
|
16
|
-
export * from './didcomm';
|
|
17
|
-
export * from './didcomm-submit';
|
|
18
|
-
export * from './didcomm-submit-policy';
|
|
19
|
-
export * from './discovery-normalization';
|
|
20
|
-
export * from './format-converter';
|
|
21
|
-
export * from './fhir-cid';
|
|
22
|
-
export * from './communication-fhir-r4';
|
|
23
|
-
export * from './communication-document-reference';
|
|
24
|
-
export * from './communication-identity';
|
|
25
|
-
export * from './communication-bundle-session';
|
|
26
|
-
export * from './clinical-resource-converters';
|
|
27
|
-
export * from './clinical-resource-view';
|
|
28
|
-
export * from './fhir-validator';
|
|
29
|
-
export * from './individual-form-pdf';
|
|
30
|
-
export * from './jwt';
|
|
31
|
-
export * from './manager-error';
|
|
32
|
-
export * from './multibase58';
|
|
33
|
-
export * from './multibasehash';
|
|
34
|
-
export * from './normalize';
|
|
35
|
-
export * from './object-convert';
|
|
36
|
-
export * from './normalize-uuid';
|
|
37
|
-
export * from './smart-scope';
|
|
38
|
-
export * from './activation-request';
|
|
39
|
-
export * from './vp-token';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Flat map of PDF form field names to their raw values as extracted from the form.
|
|
3
|
-
*
|
|
4
|
-
* The caller can pass strings, booleans, `undefined`, or `null` because PDF tooling
|
|
5
|
-
* often returns untyped values depending on the widget type.
|
|
6
|
-
*/
|
|
7
|
-
export type IndividualFormPdfFieldMap = Record<string, string | boolean | undefined | null>;
|
|
8
|
-
/**
|
|
9
|
-
* Input required to derive normalized `org.schema` claims from an individual onboarding PDF.
|
|
10
|
-
*
|
|
11
|
-
* `fields` contains the raw PDF form values.
|
|
12
|
-
* `signerSubjectDn` is the RFC2253-style certificate subject of the natural person who signed the PDF.
|
|
13
|
-
*/
|
|
14
|
-
export type IndividualFormPdfClaimsOptions = {
|
|
15
|
-
fields: IndividualFormPdfFieldMap;
|
|
16
|
-
signerSubjectDn: string;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Result of the PDF-to-claims normalization.
|
|
20
|
-
*
|
|
21
|
-
* `claims` is the flattened `org.schema` payload to feed downstream onboarding flows.
|
|
22
|
-
* `resolved` exposes the effective values chosen after applying the `self` and `subject*` rules.
|
|
23
|
-
*/
|
|
24
|
-
export type IndividualFormPdfClaimsResult = {
|
|
25
|
-
claims: Record<string, string>;
|
|
26
|
-
resolved: {
|
|
27
|
-
selfDeclared: boolean;
|
|
28
|
-
organizationAlternateName: string;
|
|
29
|
-
organizationEmail?: string;
|
|
30
|
-
organizationTelephone?: string;
|
|
31
|
-
personName?: string;
|
|
32
|
-
personGivenName?: string;
|
|
33
|
-
personFamilyName?: string;
|
|
34
|
-
personIdentifier?: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Parses an RFC2253-like distinguished name into a key/value map.
|
|
39
|
-
*
|
|
40
|
-
* The function is tolerant of escaped commas and repeated continuation tokens,
|
|
41
|
-
* which is enough for the certificate subjects used in the onboarding flows.
|
|
42
|
-
*/
|
|
43
|
-
export declare function parseDistinguishedName(dn: string): Record<string, string>;
|
|
44
|
-
/**
|
|
45
|
-
* Builds normalized `org.schema` claims from an individual onboarding PDF plus the signer certificate subject.
|
|
46
|
-
*
|
|
47
|
-
* Business rules:
|
|
48
|
-
* - `self=true`: representative and subject are the same person, so top-level fields are used.
|
|
49
|
-
* - `self=false` and any `subject*` field is present: the individual Organization uses `subject*` values.
|
|
50
|
-
* - The controller Person identity is always derived from the signer certificate when available.
|
|
51
|
-
* - `Organization.owner.identifier.value` is the signer certificate `SERIALNUMBER`, never email or phone.
|
|
52
|
-
*
|
|
53
|
-
* @throws When the PDF does not provide the required alternate name or any contact channel.
|
|
54
|
-
*/
|
|
55
|
-
export declare function buildClaimsFromIndividualFormPdf(options: IndividualFormPdfClaimsOptions): IndividualFormPdfClaimsResult;
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { ClaimsOrganizationSchemaorg, ClaimsPersonSchemaorg } from '../constants/schemaorg';
|
|
2
|
-
/** Normalizes unknown input into a trimmed string, or an empty string when not present. */
|
|
3
|
-
function normalizeText(value) {
|
|
4
|
-
return typeof value === 'string' ? value.trim() : '';
|
|
5
|
-
}
|
|
6
|
-
/** Interprets common PDF checkbox/string variants as booleans. */
|
|
7
|
-
function normalizeBoolean(value) {
|
|
8
|
-
if (typeof value === 'boolean')
|
|
9
|
-
return value;
|
|
10
|
-
const normalized = normalizeText(value).toLowerCase();
|
|
11
|
-
return normalized === 'true' || normalized === '1' || normalized === 'yes' || normalized === 'on' || normalized === 'checked';
|
|
12
|
-
}
|
|
13
|
-
/** Lowercases and trims an email-like field, returning `undefined` when empty. */
|
|
14
|
-
function normalizeEmail(value) {
|
|
15
|
-
const email = normalizeText(value).toLowerCase();
|
|
16
|
-
return email || undefined;
|
|
17
|
-
}
|
|
18
|
-
/** Trims a phone-like field, returning `undefined` when empty. */
|
|
19
|
-
function normalizePhone(value) {
|
|
20
|
-
const phone = normalizeText(value);
|
|
21
|
-
return phone || undefined;
|
|
22
|
-
}
|
|
23
|
-
/** Filters placeholder values from the gender selector while preserving the original value. */
|
|
24
|
-
function normalizeGender(value) {
|
|
25
|
-
const raw = normalizeText(value);
|
|
26
|
-
if (!raw)
|
|
27
|
-
return undefined;
|
|
28
|
-
const normalized = raw.toLowerCase();
|
|
29
|
-
if (normalized === '(seleccionar)' || normalized === 'seleccionar' || normalized === 'select')
|
|
30
|
-
return undefined;
|
|
31
|
-
return raw;
|
|
32
|
-
}
|
|
33
|
-
/** Returns the first non-empty string from the candidate list. */
|
|
34
|
-
function firstDefined(...values) {
|
|
35
|
-
for (const value of values) {
|
|
36
|
-
const normalized = normalizeText(value);
|
|
37
|
-
if (normalized)
|
|
38
|
-
return normalized;
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
/** Chooses the preferred contact channel, prioritizing email over phone. */
|
|
43
|
-
function firstContact(emailValues, phoneValues) {
|
|
44
|
-
const email = emailValues.find(Boolean);
|
|
45
|
-
if (email)
|
|
46
|
-
return { email };
|
|
47
|
-
const telephone = phoneValues.find(Boolean);
|
|
48
|
-
if (telephone)
|
|
49
|
-
return { telephone };
|
|
50
|
-
return {};
|
|
51
|
-
}
|
|
52
|
-
/** Normalizes DN keys so `serialNumber`, `SERIALNUMBER`, and spaced variants collapse to one key. */
|
|
53
|
-
function normalizeDnKey(raw) {
|
|
54
|
-
return raw.trim().toUpperCase().replace(/\s+/g, '');
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Parses an RFC2253-like distinguished name into a key/value map.
|
|
58
|
-
*
|
|
59
|
-
* The function is tolerant of escaped commas and repeated continuation tokens,
|
|
60
|
-
* which is enough for the certificate subjects used in the onboarding flows.
|
|
61
|
-
*/
|
|
62
|
-
export function parseDistinguishedName(dn) {
|
|
63
|
-
const output = {};
|
|
64
|
-
const trimmed = normalizeText(dn);
|
|
65
|
-
if (!trimmed)
|
|
66
|
-
return output;
|
|
67
|
-
const tokens = trimmed
|
|
68
|
-
.split(/(?<!\\),/)
|
|
69
|
-
.map((token) => token.trim())
|
|
70
|
-
.filter(Boolean);
|
|
71
|
-
let lastKey;
|
|
72
|
-
for (const token of tokens) {
|
|
73
|
-
const separator = token.indexOf('=');
|
|
74
|
-
if (separator <= 0) {
|
|
75
|
-
if (lastKey && output[lastKey]) {
|
|
76
|
-
output[lastKey] = `${output[lastKey]}, ${token.trim()}`;
|
|
77
|
-
}
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
const key = normalizeDnKey(token.slice(0, separator));
|
|
81
|
-
const value = token.slice(separator + 1).trim().replace(/\\,/g, ',').replace(/\\\\/g, '\\');
|
|
82
|
-
if (!key || !value)
|
|
83
|
-
continue;
|
|
84
|
-
if (!(key in output))
|
|
85
|
-
output[key] = value;
|
|
86
|
-
lastKey = key;
|
|
87
|
-
}
|
|
88
|
-
return output;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Extracts the person identity data that CORE can safely derive from the signer certificate.
|
|
92
|
-
*
|
|
93
|
-
* This is intentionally limited to values that belong to the natural-person certificate subject:
|
|
94
|
-
* full name, given name, family name, legal identifier, and country.
|
|
95
|
-
*/
|
|
96
|
-
function derivePersonName(subjectDn) {
|
|
97
|
-
const givenName = firstDefined(subjectDn.GN, subjectDn.GIVENNAME);
|
|
98
|
-
const familyName = firstDefined(subjectDn.SN, subjectDn.SURNAME);
|
|
99
|
-
const cn = firstDefined(subjectDn.CN);
|
|
100
|
-
const nameFromParts = [givenName, familyName].filter(Boolean).join(' ').trim();
|
|
101
|
-
const name = nameFromParts || cn?.split(' - ')[0]?.trim() || undefined;
|
|
102
|
-
return {
|
|
103
|
-
...(name ? { name } : {}),
|
|
104
|
-
...(givenName ? { givenName } : {}),
|
|
105
|
-
...(familyName ? { familyName } : {}),
|
|
106
|
-
...(firstDefined(subjectDn.SERIALNUMBER, subjectDn['OID.2.5.4.5']) ? { identifier: firstDefined(subjectDn.SERIALNUMBER, subjectDn['OID.2.5.4.5']) } : {}),
|
|
107
|
-
...(firstDefined(subjectDn.C, subjectDn.COUNTRYNAME) ? { country: firstDefined(subjectDn.C, subjectDn.COUNTRYNAME) } : {}),
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Builds normalized `org.schema` claims from an individual onboarding PDF plus the signer certificate subject.
|
|
112
|
-
*
|
|
113
|
-
* Business rules:
|
|
114
|
-
* - `self=true`: representative and subject are the same person, so top-level fields are used.
|
|
115
|
-
* - `self=false` and any `subject*` field is present: the individual Organization uses `subject*` values.
|
|
116
|
-
* - The controller Person identity is always derived from the signer certificate when available.
|
|
117
|
-
* - `Organization.owner.identifier.value` is the signer certificate `SERIALNUMBER`, never email or phone.
|
|
118
|
-
*
|
|
119
|
-
* @throws When the PDF does not provide the required alternate name or any contact channel.
|
|
120
|
-
*/
|
|
121
|
-
export function buildClaimsFromIndividualFormPdf(options) {
|
|
122
|
-
const subjectDn = parseDistinguishedName(options.signerSubjectDn);
|
|
123
|
-
const personIdentity = derivePersonName(subjectDn);
|
|
124
|
-
const fields = options.fields || {};
|
|
125
|
-
const selfDeclared = normalizeBoolean(fields.self);
|
|
126
|
-
const mainAlternateName = firstDefined(normalizeText(fields.alternateName));
|
|
127
|
-
const subjectAlternateName = firstDefined(normalizeText(fields.subjectAlternateName));
|
|
128
|
-
const mainEmail = normalizeEmail(fields.email);
|
|
129
|
-
const subjectEmail = normalizeEmail(fields.subjectEmail);
|
|
130
|
-
const mainPhone = normalizePhone(fields.phone);
|
|
131
|
-
const subjectPhone = normalizePhone(fields.subjectPhone);
|
|
132
|
-
const hasExplicitSubjectFields = Boolean(subjectAlternateName || subjectEmail || subjectPhone);
|
|
133
|
-
const useSubjectValues = !selfDeclared && hasExplicitSubjectFields;
|
|
134
|
-
const organizationAlternateName = firstDefined(useSubjectValues ? subjectAlternateName : undefined, mainAlternateName, subjectAlternateName);
|
|
135
|
-
if (!organizationAlternateName) {
|
|
136
|
-
throw new Error('Individual PDF form requires alternateName or subjectAlternateName.');
|
|
137
|
-
}
|
|
138
|
-
const resolvedContact = useSubjectValues
|
|
139
|
-
? (() => {
|
|
140
|
-
const subjectContact = firstContact([subjectEmail], [subjectPhone]);
|
|
141
|
-
if (subjectContact.email || subjectContact.telephone)
|
|
142
|
-
return subjectContact;
|
|
143
|
-
return firstContact([mainEmail], [mainPhone]);
|
|
144
|
-
})()
|
|
145
|
-
: firstContact([mainEmail, subjectEmail], [mainPhone, subjectPhone]);
|
|
146
|
-
if (!resolvedContact.email && !resolvedContact.telephone) {
|
|
147
|
-
throw new Error('Individual PDF form requires email/subjectEmail or phone/subjectPhone.');
|
|
148
|
-
}
|
|
149
|
-
const personAlternateName = firstDefined(mainAlternateName, organizationAlternateName);
|
|
150
|
-
const gender = firstDefined(normalizeGender(fields.sexPicker), normalizeGender(fields.gender));
|
|
151
|
-
const birthDate = firstDefined(normalizeText(fields.dateOfBirth));
|
|
152
|
-
const claims = {
|
|
153
|
-
'@context': 'org.schema',
|
|
154
|
-
[ClaimsOrganizationSchemaorg.alternateName]: organizationAlternateName,
|
|
155
|
-
...(personIdentity.identifier ? {
|
|
156
|
-
[ClaimsOrganizationSchemaorg.ownerIdentifierValue]: personIdentity.identifier,
|
|
157
|
-
} : {}),
|
|
158
|
-
...(resolvedContact.email ? {
|
|
159
|
-
[ClaimsOrganizationSchemaorg.ownerEmail]: resolvedContact.email,
|
|
160
|
-
[ClaimsPersonSchemaorg.email]: resolvedContact.email,
|
|
161
|
-
} : {}),
|
|
162
|
-
...(resolvedContact.telephone ? {
|
|
163
|
-
[ClaimsOrganizationSchemaorg.ownerTelephone]: resolvedContact.telephone,
|
|
164
|
-
[ClaimsPersonSchemaorg.telephone]: resolvedContact.telephone,
|
|
165
|
-
} : {}),
|
|
166
|
-
...(personAlternateName ? { [ClaimsPersonSchemaorg.alternateName]: personAlternateName } : {}),
|
|
167
|
-
...(personIdentity.name ? { [ClaimsPersonSchemaorg.name]: personIdentity.name } : {}),
|
|
168
|
-
...(personIdentity.givenName ? { [ClaimsPersonSchemaorg.givenName]: personIdentity.givenName } : {}),
|
|
169
|
-
...(personIdentity.familyName ? { [ClaimsPersonSchemaorg.familyName]: personIdentity.familyName } : {}),
|
|
170
|
-
...(personIdentity.identifier ? {
|
|
171
|
-
[ClaimsPersonSchemaorg.identifierValue]: personIdentity.identifier,
|
|
172
|
-
[ClaimsPersonSchemaorg.identifier]: `urn:person:identifier:${personIdentity.identifier}`,
|
|
173
|
-
} : {}),
|
|
174
|
-
...(personIdentity.country ? { [ClaimsOrganizationSchemaorg.addressCountry]: personIdentity.country } : {}),
|
|
175
|
-
...(gender ? { [ClaimsPersonSchemaorg.gender]: gender } : {}),
|
|
176
|
-
...(birthDate ? { [ClaimsPersonSchemaorg.birthDate]: birthDate } : {}),
|
|
177
|
-
};
|
|
178
|
-
return {
|
|
179
|
-
claims,
|
|
180
|
-
resolved: {
|
|
181
|
-
selfDeclared,
|
|
182
|
-
organizationAlternateName,
|
|
183
|
-
...(resolvedContact.email ? { organizationEmail: resolvedContact.email } : {}),
|
|
184
|
-
...(resolvedContact.telephone ? { organizationTelephone: resolvedContact.telephone } : {}),
|
|
185
|
-
...(personIdentity.name ? { personName: personIdentity.name } : {}),
|
|
186
|
-
...(personIdentity.givenName ? { personGivenName: personIdentity.givenName } : {}),
|
|
187
|
-
...(personIdentity.familyName ? { personFamilyName: personIdentity.familyName } : {}),
|
|
188
|
-
...(personIdentity.identifier ? { personIdentifier: personIdentity.identifier } : {}),
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { DataCompactJWT, JwtCompactParts } from '../models/jwt';
|
|
2
|
-
/**
|
|
3
|
-
* Splits a compact JWT string into its three parts.
|
|
4
|
-
* @param compactToken The compact JWT string.
|
|
5
|
-
* @returns A PartsJWT object or undefined if the format is invalid.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getPartsJWT(compactToken: string | undefined): JwtCompactParts | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* Decodes the Base64Url header of a JWT into a JSON object.
|
|
10
|
-
* @param headerB64Url The Base64Url-encoded header string.
|
|
11
|
-
* @returns A JSON object representing the header claims.
|
|
12
|
-
*/
|
|
13
|
-
export declare function decodeHeader(headerB64Url: string): any;
|
|
14
|
-
/**
|
|
15
|
-
* Decodes the payload of a JWT, decompressing it if necessary.
|
|
16
|
-
* @param payloadB64Url The Base64Url-encoded payload string.
|
|
17
|
-
* @param isDeflated True if the payload is compressed with DEFLATE.
|
|
18
|
-
* @returns The decoded payload as a JSON object.
|
|
19
|
-
*/
|
|
20
|
-
export declare function decodePayload(payloadB64Url: string, isDeflated?: boolean): Promise<object>;
|
|
21
|
-
/**
|
|
22
|
-
* Fully decodes a compact JWT into a `DataCompactJWT` object with JSON headers and payload.
|
|
23
|
-
* @param compactJWT Compact JWT string.
|
|
24
|
-
* @returns A (compact) JWT object or undefined if parsing fails.
|
|
25
|
-
*/
|
|
26
|
-
export declare function getDataJWT(compactJWT: string | undefined): Promise<DataCompactJWT | undefined>;
|
|
27
|
-
/**
|
|
28
|
-
* Encodes a JSON object into a Base64Url string.
|
|
29
|
-
* @param header The header object.
|
|
30
|
-
* @returns The encoded string.
|
|
31
|
-
*/
|
|
32
|
-
export declare function encodeHeader(header: object): string;
|
|
33
|
-
/**
|
|
34
|
-
* Encodes a JSON object into a Base64Url payload, compressing it if required.
|
|
35
|
-
* @param payload The payload object.
|
|
36
|
-
* @param deflate True to compress the payload with DEFLATE.
|
|
37
|
-
* @returns The encoded string.
|
|
38
|
-
*/
|
|
39
|
-
export declare function encodePayload(payload: object, deflate?: boolean): Promise<string>;
|
|
40
|
-
/**
|
|
41
|
-
* Encodes a signature byte array into a Base64Url string.
|
|
42
|
-
* @param signatureBytes The signature bytes.
|
|
43
|
-
* @returns The encoded string, or an empty string if no signature is provided.
|
|
44
|
-
*/
|
|
45
|
-
export declare function encodeSignature(signatureBytes?: Uint8Array): string;
|
|
46
|
-
/**
|
|
47
|
-
* Assembles a header, payload, and signature into a compact JWT string.
|
|
48
|
-
* @param header The header object.
|
|
49
|
-
* @param payload The payload object.
|
|
50
|
-
* @param signatureBytes The optional signature.
|
|
51
|
-
* @returns A compact JWT string.
|
|
52
|
-
*/
|
|
53
|
-
export declare function compactJWT(header: object, payload: object, signatureBytes?: Uint8Array): Promise<string>;
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
// crypto-ts/utils/jwt.ts
|
|
2
|
-
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
3
|
-
// Use `import * as pako` to ensure compatibility with CommonJS/ESM module resolution.
|
|
4
|
-
// This resolves a stubborn TypeScript error (`esModuleInterop`) during testing.
|
|
5
|
-
import * as pako from 'pako';
|
|
6
|
-
import { Content } from './content';
|
|
7
|
-
// --- JWT Parsing and Decoding ---
|
|
8
|
-
/**
|
|
9
|
-
* Splits a compact JWT string into its three parts.
|
|
10
|
-
* @param compactToken The compact JWT string.
|
|
11
|
-
* @returns A PartsJWT object or undefined if the format is invalid.
|
|
12
|
-
*/
|
|
13
|
-
export function getPartsJWT(compactToken) {
|
|
14
|
-
if (!compactToken) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
const parts = compactToken.split('.');
|
|
18
|
-
if (parts.length !== 3) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
protected: parts[0],
|
|
23
|
-
payload: parts[1],
|
|
24
|
-
signature: parts[2],
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Decodes the Base64Url header of a JWT into a JSON object.
|
|
29
|
-
* @param headerB64Url The Base64Url-encoded header string.
|
|
30
|
-
* @returns A JSON object representing the header claims.
|
|
31
|
-
*/
|
|
32
|
-
export function decodeHeader(headerB64Url) {
|
|
33
|
-
try {
|
|
34
|
-
const headerBytes = Content.base64ToBytes(headerB64Url);
|
|
35
|
-
const headerString = Content.bytesToStringASCII(headerBytes);
|
|
36
|
-
return JSON.parse(headerString);
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
console.error(`Cannot decode JWT header: ${e}`);
|
|
40
|
-
return {};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Decodes the payload of a JWT, decompressing it if necessary.
|
|
45
|
-
* @param payloadB64Url The Base64Url-encoded payload string.
|
|
46
|
-
* @param isDeflated True if the payload is compressed with DEFLATE.
|
|
47
|
-
* @returns The decoded payload as a JSON object.
|
|
48
|
-
*/
|
|
49
|
-
export async function decodePayload(payloadB64Url, isDeflated) {
|
|
50
|
-
try {
|
|
51
|
-
let payloadBytes = Content.base64ToBytes(payloadB64Url);
|
|
52
|
-
if (isDeflated) {
|
|
53
|
-
payloadBytes = pako.inflate(payloadBytes);
|
|
54
|
-
}
|
|
55
|
-
// CRITICAL: The output of a decompression library like pako is a raw binary
|
|
56
|
-
// stream. It is NOT guaranteed to be valid UTF-8. Using the strict
|
|
57
|
-
// `bytesToStringUTF8` can fail. `bytesToStringASCII` is a more permissive
|
|
58
|
-
// decoder that is robust enough to handle this binary data and convert it
|
|
59
|
-
// to a string that can be safely parsed by `JSON.parse()`.
|
|
60
|
-
const payloadString = Content.bytesToStringASCII(payloadBytes);
|
|
61
|
-
return JSON.parse(payloadString);
|
|
62
|
-
}
|
|
63
|
-
catch (e) {
|
|
64
|
-
console.error(`Cannot decode JWT payload: ${e}`);
|
|
65
|
-
return {};
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Fully decodes a compact JWT into a `DataCompactJWT` object with JSON headers and payload.
|
|
70
|
-
* @param compactJWT Compact JWT string.
|
|
71
|
-
* @returns A (compact) JWT object or undefined if parsing fails.
|
|
72
|
-
*/
|
|
73
|
-
export async function getDataJWT(compactJWT) {
|
|
74
|
-
const parts = getPartsJWT(compactJWT);
|
|
75
|
-
if (!parts) {
|
|
76
|
-
return undefined;
|
|
77
|
-
}
|
|
78
|
-
const header = decodeHeader(parts.protected);
|
|
79
|
-
const isDeflated = header.zip === 'DEF';
|
|
80
|
-
const payload = await decodePayload(parts.payload, isDeflated);
|
|
81
|
-
return {
|
|
82
|
-
protected: header,
|
|
83
|
-
payload,
|
|
84
|
-
signature: parts.signature ? Content.base64ToBytes(parts.signature) : undefined,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
// --- JWT Creation and Encoding ---
|
|
88
|
-
/**
|
|
89
|
-
* Encodes a JSON object into a Base64Url string.
|
|
90
|
-
* @param header The header object.
|
|
91
|
-
* @returns The encoded string.
|
|
92
|
-
*/
|
|
93
|
-
export function encodeHeader(header) {
|
|
94
|
-
try {
|
|
95
|
-
return Content.objectToRawBase64UrlSafe(header);
|
|
96
|
-
}
|
|
97
|
-
catch (e) {
|
|
98
|
-
console.warn('Cannot encode JWT header', e);
|
|
99
|
-
return '';
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Encodes a JSON object into a Base64Url payload, compressing it if required.
|
|
104
|
-
* @param payload The payload object.
|
|
105
|
-
* @param deflate True to compress the payload with DEFLATE.
|
|
106
|
-
* @returns The encoded string.
|
|
107
|
-
*/
|
|
108
|
-
export async function encodePayload(payload, deflate) {
|
|
109
|
-
try {
|
|
110
|
-
// CRITICAL: When creating a payload, we start with a JSON string, which IS
|
|
111
|
-
// valid UTF-8. We must use the strict `stringToBytesUTF8` encoder to ensure
|
|
112
|
-
// standards compliance.
|
|
113
|
-
let payloadBytes = Content.stringToBytesUTF8(JSON.stringify(payload));
|
|
114
|
-
if (deflate) {
|
|
115
|
-
payloadBytes = pako.deflate(payloadBytes);
|
|
116
|
-
}
|
|
117
|
-
return Content.bytesToRawBase64UrlSafe(payloadBytes);
|
|
118
|
-
}
|
|
119
|
-
catch (e) {
|
|
120
|
-
console.warn('Cannot encode JWT payload', e);
|
|
121
|
-
return '';
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Encodes a signature byte array into a Base64Url string.
|
|
126
|
-
* @param signatureBytes The signature bytes.
|
|
127
|
-
* @returns The encoded string, or an empty string if no signature is provided.
|
|
128
|
-
*/
|
|
129
|
-
export function encodeSignature(signatureBytes) {
|
|
130
|
-
if (!signatureBytes || signatureBytes.length < 1) {
|
|
131
|
-
return '';
|
|
132
|
-
}
|
|
133
|
-
try {
|
|
134
|
-
return Content.bytesToRawBase64UrlSafe(signatureBytes);
|
|
135
|
-
}
|
|
136
|
-
catch (e) {
|
|
137
|
-
console.warn('Cannot encode JWT signature', e);
|
|
138
|
-
return '';
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Assembles a header, payload, and signature into a compact JWT string.
|
|
143
|
-
* @param header The header object.
|
|
144
|
-
* @param payload The payload object.
|
|
145
|
-
* @param signatureBytes The optional signature.
|
|
146
|
-
* @returns A compact JWT string.
|
|
147
|
-
*/
|
|
148
|
-
export async function compactJWT(header, payload, signatureBytes) {
|
|
149
|
-
const encodedHeader = encodeHeader(header);
|
|
150
|
-
const isDeflated = header.zip === 'DEF';
|
|
151
|
-
const encodedPayload = await encodePayload(payload, isDeflated);
|
|
152
|
-
const encodedSignature = encodeSignature(signatureBytes);
|
|
153
|
-
return `${encodedHeader}.${encodedPayload}.${encodedSignature}`;
|
|
154
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { IssueTypeCode } from "../models/issue";
|
|
2
|
-
/**
|
|
3
|
-
* A custom error class used to propagate specific operational failures from deep
|
|
4
|
-
* within the manager's logic to the central error handler.
|
|
5
|
-
* It carries the necessary information to build a well-formed ErrorEntry.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ManagerError extends Error {
|
|
8
|
-
readonly code: IssueTypeCode;
|
|
9
|
-
readonly status: string;
|
|
10
|
-
/**
|
|
11
|
-
* @param message The diagnostic message for the error.
|
|
12
|
-
* @param code The classification of the error, from which the HTTP status will be derived.
|
|
13
|
-
*/
|
|
14
|
-
constructor(message: string, code: IssueTypeCode);
|
|
15
|
-
}
|