gdc-sdk-front-ts 0.6.2 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -8
- package/dist/ProfileManager.d.ts +22 -0
- package/dist/ProfileManager.js +155 -0
- package/dist/gdc-common-utils-ts/src/AesManager.d.ts +27 -0
- package/dist/gdc-common-utils-ts/src/AesManager.js +64 -0
- package/dist/gdc-common-utils-ts/src/CryptographyService.d.ts +76 -0
- package/dist/gdc-common-utils-ts/src/CryptographyService.js +401 -0
- package/dist/gdc-common-utils-ts/src/constants/actor-session.d.ts +40 -0
- package/dist/gdc-common-utils-ts/src/constants/actor-session.js +40 -0
- package/dist/gdc-common-utils-ts/src/constants/communication.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/constants/communication.js +14 -0
- package/dist/gdc-common-utils-ts/src/constants/cryptography.d.ts +58 -0
- package/dist/gdc-common-utils-ts/src/constants/cryptography.js +49 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-discovery.js +11 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.d.ts +27 -0
- package/dist/gdc-common-utils-ts/src/constants/dataspace-protocol.js +27 -0
- package/dist/gdc-common-utils-ts/src/constants/device.d.ts +16 -0
- package/dist/gdc-common-utils-ts/src/constants/device.js +15 -0
- package/dist/gdc-common-utils-ts/src/constants/did-services.d.ts +42 -0
- package/dist/gdc-common-utils-ts/src/constants/did-services.js +40 -0
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.d.ts +36 -0
- package/dist/gdc-common-utils-ts/src/constants/eu-countries.js +69 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.d.ts +12 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-code-systems.js +12 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.d.ts +52 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-resource-types.js +33 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/constants/fhir-versions.js +10 -0
- package/dist/gdc-common-utils-ts/src/constants/healthcare.d.ts +496 -0
- package/dist/gdc-common-utils-ts/src/constants/healthcare.js +274 -0
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.d.ts +44 -0
- package/dist/gdc-common-utils-ts/src/constants/hl7-roles.js +208 -0
- package/dist/gdc-common-utils-ts/src/constants/index.d.ts +21 -0
- package/dist/gdc-common-utils-ts/src/constants/index.js +21 -0
- package/dist/gdc-common-utils-ts/src/constants/network.d.ts +25 -0
- package/dist/gdc-common-utils-ts/src/constants/network.js +17 -0
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.d.ts +175 -0
- package/dist/gdc-common-utils-ts/src/constants/schemaorg.js +261 -0
- package/dist/gdc-common-utils-ts/src/constants/sectors.d.ts +24 -0
- package/dist/gdc-common-utils-ts/src/constants/sectors.js +24 -0
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.d.ts +82 -0
- package/dist/gdc-common-utils-ts/src/constants/service-capabilities.js +105 -0
- package/dist/gdc-common-utils-ts/src/constants/smart.d.ts +12 -0
- package/dist/gdc-common-utils-ts/src/constants/smart.js +12 -0
- package/dist/gdc-common-utils-ts/src/constants/urn.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/constants/urn.js +11 -0
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.d.ts +34 -0
- package/dist/gdc-common-utils-ts/src/constants/verifiable-credentials.js +42 -0
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.d.ts +75 -0
- package/dist/gdc-common-utils-ts/src/constants/vital-signs.js +33 -0
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.d.ts +15 -0
- package/dist/gdc-common-utils-ts/src/examples/api-flow-examples.js +16 -0
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.d.ts +22 -0
- package/dist/gdc-common-utils-ts/src/examples/communication-bundle-session.js +81 -0
- package/dist/gdc-common-utils-ts/src/examples/consent-access.d.ts +30 -0
- package/dist/gdc-common-utils-ts/src/examples/consent-access.js +121 -0
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.d.ts +15 -0
- package/dist/gdc-common-utils-ts/src/examples/contract-examples.js +16 -0
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.d.ts +98 -0
- package/dist/gdc-common-utils-ts/src/examples/dataspace-discovery.js +141 -0
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/examples/frontend-session.js +24 -0
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.d.ts +64 -0
- package/dist/gdc-common-utils-ts/src/examples/ica-activation-proof.js +77 -0
- package/dist/gdc-common-utils-ts/src/examples/index.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/examples/index.js +14 -0
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.d.ts +100 -0
- package/dist/gdc-common-utils-ts/src/examples/individual-controller.js +71 -0
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.d.ts +505 -0
- package/dist/gdc-common-utils-ts/src/examples/lifecycle.js +291 -0
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.d.ts +163 -0
- package/dist/gdc-common-utils-ts/src/examples/organization-controller.js +93 -0
- package/dist/gdc-common-utils-ts/src/examples/professional.d.ts +228 -0
- package/dist/gdc-common-utils-ts/src/examples/professional.js +324 -0
- package/dist/gdc-common-utils-ts/src/examples/related-person.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/examples/related-person.js +13 -0
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/examples/relationship-access.js +96 -0
- package/dist/gdc-common-utils-ts/src/examples/shared.d.ts +220 -0
- package/dist/gdc-common-utils-ts/src/examples/shared.js +191 -0
- package/dist/gdc-common-utils-ts/src/hmac.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/hmac.js +24 -0
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.d.ts +6 -0
- package/dist/gdc-common-utils-ts/src/i18n/clinical-sections.i18n.js +15 -0
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.d.ts +4 -0
- package/dist/gdc-common-utils-ts/src/i18n/role-codes.i18n.js +13 -0
- package/dist/gdc-common-utils-ts/src/index.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/index.js +10 -0
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.d.ts +139 -0
- package/dist/gdc-common-utils-ts/src/interfaces/Cryptography.types.js +8 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptoHelper.js +3 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.d.ts +154 -0
- package/dist/gdc-common-utils-ts/src/interfaces/ICryptography.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/actor-session.d.ts +9 -0
- package/dist/gdc-common-utils-ts/src/models/actor-session.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/aes.d.ts +85 -0
- package/dist/gdc-common-utils-ts/src/models/aes.js +10 -0
- package/dist/gdc-common-utils-ts/src/models/auth.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/models/auth.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/bundle.d.ts +153 -0
- package/dist/gdc-common-utils-ts/src/models/bundle.js +25 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.d.ts +36 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.d.ts +150 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.en.js +104 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-sections.js +32 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.d.ts +126 -0
- package/dist/gdc-common-utils-ts/src/models/clinical-workbook-summary.js +67 -0
- package/dist/gdc-common-utils-ts/src/models/comm.d.ts +56 -0
- package/dist/gdc-common-utils-ts/src/models/comm.js +4 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-job.d.ts +78 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-job.js +20 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-message.d.ts +97 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-message.js +4 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.d.ts +134 -0
- package/dist/gdc-common-utils-ts/src/models/confidential-storage.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/consent-access.d.ts +79 -0
- package/dist/gdc-common-utils-ts/src/models/consent-access.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/consent-rule.d.ts +122 -0
- package/dist/gdc-common-utils-ts/src/models/consent-rule.js +22 -0
- package/dist/gdc-common-utils-ts/src/models/crypto.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/models/crypto.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.d.ts +79 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery-defaults.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.d.ts +68 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-discovery.js +9 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/models/dataspace-protocol.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/device-license.d.ts +134 -0
- package/dist/gdc-common-utils-ts/src/models/device-license.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/did.d.ts +108 -0
- package/dist/gdc-common-utils-ts/src/models/did.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.d.ts +101 -0
- package/dist/gdc-common-utils-ts/src/models/fhir-documents.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.d.ts +104 -0
- package/dist/gdc-common-utils-ts/src/models/identity-bootstrap.js +2 -0
- package/dist/gdc-common-utils-ts/src/models/index.d.ts +42 -0
- package/dist/gdc-common-utils-ts/src/models/index.js +42 -0
- package/dist/gdc-common-utils-ts/src/models/indexing.d.ts +11 -0
- package/dist/gdc-common-utils-ts/src/models/indexing.js +18 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.d.ts +24 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/allergy-intolerance-claims.js +36 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.d.ts +53 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/communication-claims.js +55 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/condition-claims.js +25 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/device-use-statement-claims.js +23 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.d.ts +36 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/document-reference-claims.js +89 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.d.ts +341 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/medication-statement-claims.js +204 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.d.ts +9 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims/types.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.d.ts +5 -0
- package/dist/gdc-common-utils-ts/src/models/interoperable-claims.js +7 -0
- package/dist/gdc-common-utils-ts/src/models/issue.d.ts +57 -0
- package/dist/gdc-common-utils-ts/src/models/issue.js +75 -0
- package/dist/gdc-common-utils-ts/src/models/jsonapi.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/models/jsonapi.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jwe.d.ts +120 -0
- package/dist/gdc-common-utils-ts/src/models/jwe.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jwk.d.ts +39 -0
- package/dist/gdc-common-utils-ts/src/models/jwk.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jws.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/models/jws.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/jwt.d.ts +9 -0
- package/dist/gdc-common-utils-ts/src/models/jwt.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/models/loinc-document-ontology.js +58 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.d.ts +33 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.common.model.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.d.ts +50 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.document.model.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.d.ts +67 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.electronicRecord.model.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.d.ts +51 -0
- package/dist/gdc-common-utils-ts/src/models/oidc4ida.evidence.model.js +5 -0
- package/dist/gdc-common-utils-ts/src/models/openid-device.d.ts +119 -0
- package/dist/gdc-common-utils-ts/src/models/openid-device.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.d.ts +26 -0
- package/dist/gdc-common-utils-ts/src/models/operation-outcome.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/params.d.ts +133 -0
- package/dist/gdc-common-utils-ts/src/models/params.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/relationship-access.d.ts +160 -0
- package/dist/gdc-common-utils-ts/src/models/relationship-access.js +21 -0
- package/dist/gdc-common-utils-ts/src/models/resource-document.d.ts +14 -0
- package/dist/gdc-common-utils-ts/src/models/resource-document.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/response.d.ts +1 -0
- package/dist/gdc-common-utils-ts/src/models/response.js +3 -0
- package/dist/gdc-common-utils-ts/src/models/urlPath.d.ts +58 -0
- package/dist/gdc-common-utils-ts/src/models/urlPath.js +76 -0
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.d.ts +45 -0
- package/dist/gdc-common-utils-ts/src/models/verifiable-credential.js +8 -0
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.d.ts +53 -0
- package/dist/gdc-common-utils-ts/src/storage/IVaultRepository.js +25 -0
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.d.ts +30 -0
- package/dist/gdc-common-utils-ts/src/storage/VaultMemRepository.js +81 -0
- package/dist/gdc-common-utils-ts/src/storage/index.d.ts +3 -0
- package/dist/gdc-common-utils-ts/src/storage/index.js +4 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.d.ts +86 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-policy.js +218 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-request.d.ts +81 -0
- package/dist/gdc-common-utils-ts/src/utils/activation-request.js +99 -0
- package/dist/gdc-common-utils-ts/src/utils/actor.d.ts +18 -0
- package/dist/gdc-common-utils-ts/src/utils/actor.js +36 -0
- package/dist/gdc-common-utils-ts/src/utils/base-convert.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/base-convert.js +104 -0
- package/dist/gdc-common-utils-ts/src/utils/baseN.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/utils/baseN.js +174 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.d.ts +35 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle-query.js +177 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/utils/bundle.js +39 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.d.ts +64 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-converters.js +279 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/utils/clinical-resource-view.js +291 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.d.ts +110 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-bundle-session.js +326 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.d.ts +41 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-document-reference.js +170 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.d.ts +41 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-fhir-r4.js +215 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.d.ts +152 -0
- package/dist/gdc-common-utils-ts/src/utils/communication-identity.js +121 -0
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.d.ts +79 -0
- package/dist/gdc-common-utils-ts/src/utils/consent-claim-helpers.js +213 -0
- package/dist/gdc-common-utils-ts/src/utils/consent.d.ts +218 -0
- package/dist/gdc-common-utils-ts/src/utils/consent.js +679 -0
- package/dist/gdc-common-utils-ts/src/utils/content.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/utils/content.js +60 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.d.ts +130 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery-defaults.js +307 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.d.ts +235 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-discovery.js +482 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.d.ts +66 -0
- package/dist/gdc-common-utils-ts/src/utils/dataspace-protocol.js +109 -0
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/did-resolution.js +173 -0
- package/dist/gdc-common-utils-ts/src/utils/did.d.ts +124 -0
- package/dist/gdc-common-utils-ts/src/utils/did.js +204 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.d.ts +10 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit-policy.js +15 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.d.ts +48 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm-submit.js +81 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/didcomm.js +78 -0
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/utils/discovery-normalization.js +64 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.d.ts +60 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-cid.js +152 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.d.ts +61 -0
- package/dist/gdc-common-utils-ts/src/utils/fhir-validator.js +91 -0
- package/dist/gdc-common-utils-ts/src/utils/format-converter.d.ts +21 -0
- package/dist/gdc-common-utils-ts/src/utils/format-converter.js +109 -0
- package/dist/gdc-common-utils-ts/src/utils/index.d.ts +39 -0
- package/dist/gdc-common-utils-ts/src/utils/index.js +39 -0
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.d.ts +55 -0
- package/dist/gdc-common-utils-ts/src/utils/individual-form-pdf.js +191 -0
- package/dist/gdc-common-utils-ts/src/utils/jwt.d.ts +53 -0
- package/dist/gdc-common-utils-ts/src/utils/jwt.js +154 -0
- package/dist/gdc-common-utils-ts/src/utils/manager-error.d.ts +15 -0
- package/dist/gdc-common-utils-ts/src/utils/manager-error.js +21 -0
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.d.ts +56 -0
- package/dist/gdc-common-utils-ts/src/utils/medication-claim-helpers.js +127 -0
- package/dist/gdc-common-utils-ts/src/utils/multibase58.d.ts +13 -0
- package/dist/gdc-common-utils-ts/src/utils/multibase58.js +40 -0
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.d.ts +8 -0
- package/dist/gdc-common-utils-ts/src/utils/multibasehash.js +23 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.d.ts +1 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize-uuid.js +35 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize.d.ts +16 -0
- package/dist/gdc-common-utils-ts/src/utils/normalize.js +40 -0
- package/dist/gdc-common-utils-ts/src/utils/object-convert.d.ts +20 -0
- package/dist/gdc-common-utils-ts/src/utils/object-convert.js +51 -0
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.d.ts +28 -0
- package/dist/gdc-common-utils-ts/src/utils/smart-scope.js +29 -0
- package/dist/gdc-common-utils-ts/src/utils/string-convert.d.ts +24 -0
- package/dist/gdc-common-utils-ts/src/utils/string-convert.js +62 -0
- package/dist/gdc-common-utils-ts/src/utils/string-utils.d.ts +25 -0
- package/dist/gdc-common-utils-ts/src/utils/string-utils.js +66 -0
- package/dist/gdc-common-utils-ts/src/utils/url.d.ts +26 -0
- package/dist/gdc-common-utils-ts/src/utils/url.js +44 -0
- package/dist/gdc-common-utils-ts/src/utils/vp-token.d.ts +139 -0
- package/dist/gdc-common-utils-ts/src/utils/vp-token.js +256 -0
- package/dist/gdc-sdk-core-ts/src/actor-model.d.ts +56 -0
- package/dist/gdc-sdk-core-ts/src/actor-model.js +112 -0
- package/dist/gdc-sdk-core-ts/src/app-identity.d.ts +80 -0
- package/dist/gdc-sdk-core-ts/src/app-identity.js +147 -0
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.d.ts +165 -0
- package/dist/gdc-sdk-core-ts/src/bootstrap-facade.js +191 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.d.ts +112 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-contracts.js +185 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.d.ts +32 -0
- package/dist/gdc-sdk-core-ts/src/communication-bundle-resources.js +215 -0
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.d.ts +55 -0
- package/dist/gdc-sdk-core-ts/src/communication-consent-mutation-contract.js +190 -0
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.d.ts +55 -0
- package/dist/gdc-sdk-core-ts/src/communication-document-facade.js +194 -0
- package/dist/gdc-sdk-core-ts/src/communication-draft.d.ts +104 -0
- package/dist/gdc-sdk-core-ts/src/communication-draft.js +143 -0
- package/dist/gdc-sdk-core-ts/src/communication-outbox.d.ts +49 -0
- package/dist/gdc-sdk-core-ts/src/communication-outbox.js +62 -0
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.d.ts +180 -0
- package/dist/gdc-sdk-core-ts/src/communication-resource-helpers.js +455 -0
- package/dist/gdc-sdk-core-ts/src/consent-access.d.ts +73 -0
- package/dist/gdc-sdk-core-ts/src/consent-access.js +109 -0
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.d.ts +5 -0
- package/dist/gdc-sdk-core-ts/src/consent-claim-helpers.js +6 -0
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.d.ts +82 -0
- package/dist/gdc-sdk-core-ts/src/consent-communication-operations.js +135 -0
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.d.ts +33 -0
- package/dist/gdc-sdk-core-ts/src/did-resolution-session.js +56 -0
- package/dist/gdc-sdk-core-ts/src/discovery-facade.d.ts +84 -0
- package/dist/gdc-sdk-core-ts/src/discovery-facade.js +24 -0
- package/dist/gdc-sdk-core-ts/src/identity-model.d.ts +46 -0
- package/dist/gdc-sdk-core-ts/src/identity-model.js +2 -0
- package/dist/gdc-sdk-core-ts/src/identity-store.d.ts +83 -0
- package/dist/gdc-sdk-core-ts/src/identity-store.js +51 -0
- package/dist/gdc-sdk-core-ts/src/index.d.ts +23 -0
- package/dist/gdc-sdk-core-ts/src/index.js +24 -0
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.d.ts +5 -0
- package/dist/gdc-sdk-core-ts/src/medication-claim-helpers.js +6 -0
- package/dist/gdc-sdk-core-ts/src/polling-model.d.ts +35 -0
- package/dist/gdc-sdk-core-ts/src/polling-model.js +24 -0
- package/dist/gdc-sdk-core-ts/src/relationship-access.d.ts +40 -0
- package/dist/gdc-sdk-core-ts/src/relationship-access.js +150 -0
- package/dist/gdc-sdk-core-ts/src/session-model.d.ts +134 -0
- package/dist/gdc-sdk-core-ts/src/session-model.js +2 -0
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.d.ts +19 -0
- package/dist/gdc-sdk-core-ts/src/smart-endpoint-resolver.js +19 -0
- package/dist/gdc-sdk-core-ts/src/vital-signs.d.ts +38 -0
- package/dist/gdc-sdk-core-ts/src/vital-signs.js +155 -0
- package/dist/gdc-sdk-front-ts/src/ClientSDK.d.ts +99 -0
- package/dist/gdc-sdk-front-ts/src/ClientSDK.js +177 -0
- package/dist/gdc-sdk-front-ts/src/ProfileManager.d.ts +140 -0
- package/dist/gdc-sdk-front-ts/src/ProfileManager.js +76 -0
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.d.ts +11 -0
- package/dist/gdc-sdk-front-ts/src/ProfileRegistry.js +26 -0
- package/dist/gdc-sdk-front-ts/src/VerifierService.d.ts +6 -0
- package/dist/gdc-sdk-front-ts/src/VerifierService.js +10 -0
- package/dist/gdc-sdk-front-ts/src/actor-session.d.ts +2 -0
- package/dist/gdc-sdk-front-ts/src/actor-session.js +2 -0
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.d.ts +8 -0
- package/dist/gdc-sdk-front-ts/src/capabilityMapper.js +28 -0
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.d.ts +4 -0
- package/dist/gdc-sdk-front-ts/src/consent-claim-helpers.js +5 -0
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.d.ts +54 -0
- package/dist/gdc-sdk-front-ts/src/discovery/DataspaceDiscoveryClient.js +85 -0
- package/dist/gdc-sdk-front-ts/src/discovery/index.d.ts +3 -0
- package/dist/gdc-sdk-front-ts/src/discovery/index.js +4 -0
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.d.ts +29 -0
- package/dist/gdc-sdk-front-ts/src/discovery/mappers.js +60 -0
- package/dist/gdc-sdk-front-ts/src/discovery/types.d.ts +83 -0
- package/dist/gdc-sdk-front-ts/src/discovery/types.js +2 -0
- package/dist/gdc-sdk-front-ts/src/index.d.ts +15 -0
- package/dist/gdc-sdk-front-ts/src/index.js +16 -0
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.d.ts +4 -0
- package/dist/gdc-sdk-front-ts/src/medication-claim-helpers.js +5 -0
- package/dist/gdc-sdk-front-ts/src/roleRegistry.d.ts +19 -0
- package/dist/gdc-sdk-front-ts/src/roleRegistry.js +2 -0
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.d.ts +22 -0
- package/dist/gdc-sdk-front-ts/src/runtime-contracts.js +7 -0
- package/dist/gdc-sdk-front-ts/src/services.d.ts +167 -0
- package/dist/gdc-sdk-front-ts/src/services.js +78 -0
- package/dist/gdc-sdk-front-ts/src/session-descriptor.d.ts +11 -0
- package/dist/gdc-sdk-front-ts/src/session-descriptor.js +8 -0
- package/dist/gdc-sdk-front-ts/src/types.d.ts +11 -0
- package/dist/gdc-sdk-front-ts/src/types.js +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/medication-claim-helpers.d.ts +4 -0
- package/dist/medication-claim-helpers.js +5 -0
- package/dist/orchestration/client-port.d.ts +161 -0
- package/dist/orchestration/client-port.js +26 -0
- package/dist/orchestration/facades.d.ts +65 -0
- package/dist/orchestration/facades.js +142 -0
- package/dist/orchestration/host-onboarding-sdk.d.ts +9 -0
- package/dist/orchestration/host-onboarding-sdk.js +16 -0
- package/dist/orchestration/individual-controller-sdk.d.ts +18 -0
- package/dist/orchestration/individual-controller-sdk.js +43 -0
- package/dist/orchestration/individual-member-sdk.d.ts +8 -0
- package/dist/orchestration/individual-member-sdk.js +13 -0
- package/dist/orchestration/organization-controller-sdk.d.ts +11 -0
- package/dist/orchestration/organization-controller-sdk.js +22 -0
- package/dist/orchestration/organization-employee-sdk.d.ts +8 -0
- package/dist/orchestration/organization-employee-sdk.js +13 -0
- package/dist/orchestration/personal-sdk.d.ts +13 -0
- package/dist/orchestration/personal-sdk.js +28 -0
- package/dist/orchestration/professional-sdk.d.ts +10 -0
- package/dist/orchestration/professional-sdk.js +19 -0
- package/dist/services.d.ts +58 -10
- package/dist/services.js +88 -5
- package/package.json +3 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/utils/manager-error.ts
|
|
2
|
+
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
3
|
+
import { IssueTypeToHttpStatus } from "../models/issue";
|
|
4
|
+
/**
|
|
5
|
+
* A custom error class used to propagate specific operational failures from deep
|
|
6
|
+
* within the manager's logic to the central error handler.
|
|
7
|
+
* It carries the necessary information to build a well-formed ErrorEntry.
|
|
8
|
+
*/
|
|
9
|
+
export class ManagerError extends Error {
|
|
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, code) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.name = 'ManagerError';
|
|
17
|
+
this.code = code;
|
|
18
|
+
// Automatically derive the HTTP status string from the issue code.
|
|
19
|
+
this.status = IssueTypeToHttpStatus[code] || '500';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export type MedicationInteroperableClaims = Record<string, unknown>;
|
|
2
|
+
/**
|
|
3
|
+
* Returns tokenized values from a medication claim key stored as CSV.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getMedicationClaimList(claims: MedicationInteroperableClaims, claimKey: string): string[];
|
|
6
|
+
/**
|
|
7
|
+
* Replaces a medication claim list from array/string input and stores canonical CSV.
|
|
8
|
+
*/
|
|
9
|
+
export declare function setMedicationClaimList(claims: MedicationInteroperableClaims, claimKey: string, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
10
|
+
/**
|
|
11
|
+
* Adds values to a medication claim list preserving uniqueness.
|
|
12
|
+
*/
|
|
13
|
+
export declare function addMedicationClaimList(claims: MedicationInteroperableClaims, claimKey: string, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
14
|
+
/**
|
|
15
|
+
* Removes values from a medication claim list while preserving uniqueness.
|
|
16
|
+
*/
|
|
17
|
+
export declare function removeMedicationClaimList(claims: MedicationInteroperableClaims, claimKey: string, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
18
|
+
/**
|
|
19
|
+
* Medication category list getter/setter/add.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getMedicationCategoryList(claims: MedicationInteroperableClaims): string[];
|
|
22
|
+
export declare function setMedicationCategoryList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
23
|
+
export declare function addMedicationCategoryList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
24
|
+
export declare function removeMedicationCategoryList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
25
|
+
/**
|
|
26
|
+
* Medication part-of list getter/setter/add.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getMedicationPartOfList(claims: MedicationInteroperableClaims): string[];
|
|
29
|
+
export declare function setMedicationPartOfList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
30
|
+
export declare function addMedicationPartOfList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
31
|
+
export declare function removeMedicationPartOfList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
32
|
+
/**
|
|
33
|
+
* Medication code list getter/setter/add.
|
|
34
|
+
*
|
|
35
|
+
* Note:
|
|
36
|
+
* - many flows use a single code, but CSV list is supported for UI preview/edit
|
|
37
|
+
* where multiple coded values can be staged before normalization.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getMedicationCodeList(claims: MedicationInteroperableClaims): string[];
|
|
40
|
+
export declare function setMedicationCodeList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
41
|
+
export declare function addMedicationCodeList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
42
|
+
export declare function removeMedicationCodeList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
43
|
+
/**
|
|
44
|
+
* Medication source list getter/setter/add.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getMedicationSourceList(claims: MedicationInteroperableClaims): string[];
|
|
47
|
+
export declare function setMedicationSourceList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
48
|
+
export declare function addMedicationSourceList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
49
|
+
export declare function removeMedicationSourceList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
50
|
+
/**
|
|
51
|
+
* Medication subject list getter/setter/add.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getMedicationSubjectList(claims: MedicationInteroperableClaims): string[];
|
|
54
|
+
export declare function setMedicationSubjectList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
55
|
+
export declare function addMedicationSubjectList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
56
|
+
export declare function removeMedicationSubjectList(claims: MedicationInteroperableClaims, values: string | readonly string[]): MedicationInteroperableClaims;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
import { MedicationStatementClaim } from '../models/interoperable-claims/medication-statement-claims.js';
|
|
3
|
+
function splitCsv(value) {
|
|
4
|
+
return String(value || '')
|
|
5
|
+
.split(',')
|
|
6
|
+
.map((item) => item.trim())
|
|
7
|
+
.filter(Boolean);
|
|
8
|
+
}
|
|
9
|
+
function normalizeTokens(values) {
|
|
10
|
+
return [...new Set(values.map((value) => String(value || '').trim()).filter(Boolean))];
|
|
11
|
+
}
|
|
12
|
+
function normalizeInput(values) {
|
|
13
|
+
return Array.isArray(values)
|
|
14
|
+
? normalizeTokens(values)
|
|
15
|
+
: normalizeTokens(splitCsv(values));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Returns tokenized values from a medication claim key stored as CSV.
|
|
19
|
+
*/
|
|
20
|
+
export function getMedicationClaimList(claims, claimKey) {
|
|
21
|
+
return normalizeTokens(splitCsv(claims[claimKey]));
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Replaces a medication claim list from array/string input and stores canonical CSV.
|
|
25
|
+
*/
|
|
26
|
+
export function setMedicationClaimList(claims, claimKey, values) {
|
|
27
|
+
const nextValues = normalizeInput(values);
|
|
28
|
+
return {
|
|
29
|
+
...claims,
|
|
30
|
+
[claimKey]: nextValues.join(','),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Adds values to a medication claim list preserving uniqueness.
|
|
35
|
+
*/
|
|
36
|
+
export function addMedicationClaimList(claims, claimKey, values) {
|
|
37
|
+
const current = getMedicationClaimList(claims, claimKey);
|
|
38
|
+
const additions = normalizeInput(values);
|
|
39
|
+
return setMedicationClaimList(claims, claimKey, [...current, ...additions]);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Removes values from a medication claim list while preserving uniqueness.
|
|
43
|
+
*/
|
|
44
|
+
export function removeMedicationClaimList(claims, claimKey, values) {
|
|
45
|
+
const removals = new Set(normalizeInput(values));
|
|
46
|
+
const nextValues = getMedicationClaimList(claims, claimKey).filter((value) => !removals.has(value));
|
|
47
|
+
return setMedicationClaimList(claims, claimKey, nextValues);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Medication category list getter/setter/add.
|
|
51
|
+
*/
|
|
52
|
+
export function getMedicationCategoryList(claims) {
|
|
53
|
+
return getMedicationClaimList(claims, MedicationStatementClaim.Category);
|
|
54
|
+
}
|
|
55
|
+
export function setMedicationCategoryList(claims, values) {
|
|
56
|
+
return setMedicationClaimList(claims, MedicationStatementClaim.Category, values);
|
|
57
|
+
}
|
|
58
|
+
export function addMedicationCategoryList(claims, values) {
|
|
59
|
+
return addMedicationClaimList(claims, MedicationStatementClaim.Category, values);
|
|
60
|
+
}
|
|
61
|
+
export function removeMedicationCategoryList(claims, values) {
|
|
62
|
+
return removeMedicationClaimList(claims, MedicationStatementClaim.Category, values);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Medication part-of list getter/setter/add.
|
|
66
|
+
*/
|
|
67
|
+
export function getMedicationPartOfList(claims) {
|
|
68
|
+
return getMedicationClaimList(claims, MedicationStatementClaim.PartOf);
|
|
69
|
+
}
|
|
70
|
+
export function setMedicationPartOfList(claims, values) {
|
|
71
|
+
return setMedicationClaimList(claims, MedicationStatementClaim.PartOf, values);
|
|
72
|
+
}
|
|
73
|
+
export function addMedicationPartOfList(claims, values) {
|
|
74
|
+
return addMedicationClaimList(claims, MedicationStatementClaim.PartOf, values);
|
|
75
|
+
}
|
|
76
|
+
export function removeMedicationPartOfList(claims, values) {
|
|
77
|
+
return removeMedicationClaimList(claims, MedicationStatementClaim.PartOf, values);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Medication code list getter/setter/add.
|
|
81
|
+
*
|
|
82
|
+
* Note:
|
|
83
|
+
* - many flows use a single code, but CSV list is supported for UI preview/edit
|
|
84
|
+
* where multiple coded values can be staged before normalization.
|
|
85
|
+
*/
|
|
86
|
+
export function getMedicationCodeList(claims) {
|
|
87
|
+
return getMedicationClaimList(claims, MedicationStatementClaim.Code);
|
|
88
|
+
}
|
|
89
|
+
export function setMedicationCodeList(claims, values) {
|
|
90
|
+
return setMedicationClaimList(claims, MedicationStatementClaim.Code, values);
|
|
91
|
+
}
|
|
92
|
+
export function addMedicationCodeList(claims, values) {
|
|
93
|
+
return addMedicationClaimList(claims, MedicationStatementClaim.Code, values);
|
|
94
|
+
}
|
|
95
|
+
export function removeMedicationCodeList(claims, values) {
|
|
96
|
+
return removeMedicationClaimList(claims, MedicationStatementClaim.Code, values);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Medication source list getter/setter/add.
|
|
100
|
+
*/
|
|
101
|
+
export function getMedicationSourceList(claims) {
|
|
102
|
+
return getMedicationClaimList(claims, MedicationStatementClaim.Source);
|
|
103
|
+
}
|
|
104
|
+
export function setMedicationSourceList(claims, values) {
|
|
105
|
+
return setMedicationClaimList(claims, MedicationStatementClaim.Source, values);
|
|
106
|
+
}
|
|
107
|
+
export function addMedicationSourceList(claims, values) {
|
|
108
|
+
return addMedicationClaimList(claims, MedicationStatementClaim.Source, values);
|
|
109
|
+
}
|
|
110
|
+
export function removeMedicationSourceList(claims, values) {
|
|
111
|
+
return removeMedicationClaimList(claims, MedicationStatementClaim.Source, values);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Medication subject list getter/setter/add.
|
|
115
|
+
*/
|
|
116
|
+
export function getMedicationSubjectList(claims) {
|
|
117
|
+
return getMedicationClaimList(claims, MedicationStatementClaim.Subject);
|
|
118
|
+
}
|
|
119
|
+
export function setMedicationSubjectList(claims, values) {
|
|
120
|
+
return setMedicationClaimList(claims, MedicationStatementClaim.Subject, values);
|
|
121
|
+
}
|
|
122
|
+
export function addMedicationSubjectList(claims, values) {
|
|
123
|
+
return addMedicationClaimList(claims, MedicationStatementClaim.Subject, values);
|
|
124
|
+
}
|
|
125
|
+
export function removeMedicationSubjectList(claims, values) {
|
|
126
|
+
return removeMedicationClaimList(claims, MedicationStatementClaim.Subject, values);
|
|
127
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encode bytes into multibase base58btc string (prefixed with 'z').
|
|
3
|
+
* Equivalent to multiformats base58btc.encode.
|
|
4
|
+
*/
|
|
5
|
+
export declare function encodeMultibase58btc(data: Uint8Array): string;
|
|
6
|
+
/**
|
|
7
|
+
* Decode a multibase base58btc string (must start with 'z').
|
|
8
|
+
* Equivalent to multiformats base58btc.decode.
|
|
9
|
+
*/
|
|
10
|
+
export declare function decodeMultibase58btc(multibaseStr: string): Uint8Array;
|
|
11
|
+
export declare function encodeHexToMultibase58btc(hexStr: string): string;
|
|
12
|
+
export declare function decodeMultibase58btcToHex(b58str: string): string;
|
|
13
|
+
export declare function decodeMultibase58btcToUUID(b58str: string): string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// crypto-ts/crypto-ts/utils/multibase58.ts
|
|
2
|
+
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
3
|
+
import baseX from "base-x";
|
|
4
|
+
const BASE58_BTC_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
5
|
+
const base58btc = baseX(BASE58_BTC_ALPHABET);
|
|
6
|
+
/**
|
|
7
|
+
* Encode bytes into multibase base58btc string (prefixed with 'z').
|
|
8
|
+
* Equivalent to multiformats base58btc.encode.
|
|
9
|
+
*/
|
|
10
|
+
export function encodeMultibase58btc(data) {
|
|
11
|
+
return "z" + base58btc.encode(Buffer.from(data));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Decode a multibase base58btc string (must start with 'z').
|
|
15
|
+
* Equivalent to multiformats base58btc.decode.
|
|
16
|
+
*/
|
|
17
|
+
export function decodeMultibase58btc(multibaseStr) {
|
|
18
|
+
if (!multibaseStr.startsWith("z")) {
|
|
19
|
+
throw new Error("Invalid multibase58btc string: missing 'z' prefix");
|
|
20
|
+
}
|
|
21
|
+
return new Uint8Array(base58btc.decode(multibaseStr.slice(1)));
|
|
22
|
+
}
|
|
23
|
+
// HEX ➜ multibase base58btc (quita guiones si los hay)
|
|
24
|
+
export function encodeHexToMultibase58btc(hexStr) {
|
|
25
|
+
const hexClean = hexStr.replace(/-/g, "").toLowerCase();
|
|
26
|
+
if (!/^[0-9a-f]{32}$/i.test(hexClean))
|
|
27
|
+
throw new Error("Invalid 16-byte hex string");
|
|
28
|
+
const bytes = new Uint8Array(hexClean.match(/.{1,2}/g).map(b => parseInt(b, 16)));
|
|
29
|
+
return encodeMultibase58btc(bytes);
|
|
30
|
+
}
|
|
31
|
+
// multibase base58btc ➜ hex (no hyppens)
|
|
32
|
+
export function decodeMultibase58btcToHex(b58str) {
|
|
33
|
+
const bytes = decodeMultibase58btc(b58str);
|
|
34
|
+
return Array.from(bytes).map(b => b.toString(16).padStart(2, "0")).join("");
|
|
35
|
+
}
|
|
36
|
+
// multibase base58btc ➜ UUID (with hyppens)
|
|
37
|
+
export function decodeMultibase58btcToUUID(b58str) {
|
|
38
|
+
const hex = decodeMultibase58btcToHex(b58str);
|
|
39
|
+
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encodes input into multibase(base58btc(multihash(sha384))).
|
|
3
|
+
* - Multihash prefix: 0x15 0x30
|
|
4
|
+
* - 0x15: code for SHA-384
|
|
5
|
+
* - 0x30: length of SHA-384 = 48 bytes
|
|
6
|
+
* - Multibase prefix: 'z'
|
|
7
|
+
*/
|
|
8
|
+
export declare function encodeMultibaseSha384(input: string | Uint8Array): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
// Use explicit .js subpaths to satisfy package exports in Metro/Node ESM.
|
|
3
|
+
import { sha384 } from '@noble/hashes/sha2.js';
|
|
4
|
+
import { utf8ToBytes } from '@noble/hashes/utils.js';
|
|
5
|
+
import baseX from 'base-x';
|
|
6
|
+
const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
7
|
+
const base58btc = baseX(BASE58_ALPHABET);
|
|
8
|
+
/**
|
|
9
|
+
* Encodes input into multibase(base58btc(multihash(sha384))).
|
|
10
|
+
* - Multihash prefix: 0x15 0x30
|
|
11
|
+
* - 0x15: code for SHA-384
|
|
12
|
+
* - 0x30: length of SHA-384 = 48 bytes
|
|
13
|
+
* - Multibase prefix: 'z'
|
|
14
|
+
*/
|
|
15
|
+
export function encodeMultibaseSha384(input) {
|
|
16
|
+
const bytes = typeof input === 'string' ? utf8ToBytes(input) : input;
|
|
17
|
+
const hashBytes = sha384(bytes);
|
|
18
|
+
const multihashBytes = new Uint8Array(2 + hashBytes.length);
|
|
19
|
+
multihashBytes[0] = 0x15; // SHA-384 code
|
|
20
|
+
multihashBytes[1] = 0x30; // length = 48
|
|
21
|
+
multihashBytes.set(hashBytes, 2);
|
|
22
|
+
return 'z' + base58btc.encode(multihashBytes);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function normalizeUuid(input: string | undefined): string | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Normalizes a subject identifier to a canonical UUID (hexadecimal, lowercase, no dashes)
|
|
2
|
+
// Accepts: urn:uuid:<uuid>, <ResourceType>/<uuid>, <uuid> (with or without dashes), base58 (optional)
|
|
3
|
+
// Returns: canonical hex string (no dashes, lowercase) or undefined if not valid
|
|
4
|
+
import { decodeMultibase58btcToHex } from './multibase58';
|
|
5
|
+
export function normalizeUuid(input) {
|
|
6
|
+
if (!input)
|
|
7
|
+
return undefined;
|
|
8
|
+
let s = String(input).trim();
|
|
9
|
+
// urn:uuid:<...>
|
|
10
|
+
if (s.startsWith('urn:uuid:'))
|
|
11
|
+
s = s.slice(9);
|
|
12
|
+
// <ResourceType>/<...>
|
|
13
|
+
const slashIdx = s.indexOf('/');
|
|
14
|
+
if (slashIdx >= 0)
|
|
15
|
+
s = s.slice(slashIdx + 1);
|
|
16
|
+
// Si es multibase58btc (z...)
|
|
17
|
+
if (s.startsWith('z')) {
|
|
18
|
+
try {
|
|
19
|
+
const hex = decodeMultibase58btcToHex(s);
|
|
20
|
+
if (/^[0-9a-f]{32}$/.test(hex))
|
|
21
|
+
return hex;
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
// no válido, ignorar
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Remove dashes
|
|
28
|
+
s = s.replace(/-/g, '');
|
|
29
|
+
// Lowercase
|
|
30
|
+
s = s.toLowerCase();
|
|
31
|
+
// Validate: must be 32 hex chars
|
|
32
|
+
if (/^[0-9a-f]{32}$/.test(s))
|
|
33
|
+
return s;
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes an object for hashing by excluding a standard set of volatile properties.
|
|
3
|
+
* This function is based on the original `normalizeAndSerializeObject` from the backend utils.
|
|
4
|
+
*
|
|
5
|
+
* @param obj The object to normalize.
|
|
6
|
+
* @returns A stable, canonical JSON string of the object's core properties.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeObject(obj: object): string;
|
|
9
|
+
/**
|
|
10
|
+
* Normalizes a DIDComm payload specifically for generating the `payload.id` (version hash).
|
|
11
|
+
* According to the defined architecture, this specifically excludes `id` and `meta`.
|
|
12
|
+
*
|
|
13
|
+
* @param payload The DIDComm payload object.
|
|
14
|
+
* @returns A stable JSON string representation of the payload's core content.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeDidcommPayloadForId(payload: object): string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright 2025 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
// File: crypto-ts/utils/normalize.ts
|
|
3
|
+
/**
|
|
4
|
+
* Creates a stable, serialized JSON string from an object by sorting its keys alphabetically.
|
|
5
|
+
* This is the core function for achieving canonical serialization.
|
|
6
|
+
* @param obj The object to serialize.
|
|
7
|
+
* @returns A stable JSON string.
|
|
8
|
+
*/
|
|
9
|
+
function stableStringify(obj) {
|
|
10
|
+
const sortedKeys = Object.keys(obj).sort();
|
|
11
|
+
const sortedObject = {};
|
|
12
|
+
for (const key of sortedKeys) {
|
|
13
|
+
sortedObject[key] = obj[key];
|
|
14
|
+
}
|
|
15
|
+
return JSON.stringify(sortedObject);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Normalizes an object for hashing by excluding a standard set of volatile properties.
|
|
19
|
+
* This function is based on the original `normalizeAndSerializeObject` from the backend utils.
|
|
20
|
+
*
|
|
21
|
+
* @param obj The object to normalize.
|
|
22
|
+
* @returns A stable, canonical JSON string of the object's core properties.
|
|
23
|
+
*/
|
|
24
|
+
export function normalizeObject(obj) {
|
|
25
|
+
// Exclude properties that are often volatile or client-specific
|
|
26
|
+
// and should not be part of the core content hash.
|
|
27
|
+
const { id, meta, text, contained, ...coreContent } = obj;
|
|
28
|
+
return stableStringify(coreContent);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Normalizes a DIDComm payload specifically for generating the `payload.id` (version hash).
|
|
32
|
+
* According to the defined architecture, this specifically excludes `id` and `meta`.
|
|
33
|
+
*
|
|
34
|
+
* @param payload The DIDComm payload object.
|
|
35
|
+
* @returns A stable JSON string representation of the payload's core content.
|
|
36
|
+
*/
|
|
37
|
+
export function normalizeDidcommPayloadForId(payload) {
|
|
38
|
+
const { id, meta, ...coreContent } = payload;
|
|
39
|
+
return stableStringify(coreContent);
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Compares two arrays and returns true if they are the same, false otherwise. */
|
|
2
|
+
export declare function arrayCompare(a: any[], b: any[]): boolean;
|
|
3
|
+
/** Merges two Uint8Arrays into a single Uint8Array. */
|
|
4
|
+
export declare function arrayMerge(a: Uint8Array, b: Uint8Array): Uint8Array;
|
|
5
|
+
/**
|
|
6
|
+
* Serializes a JavaScript object to a Uint8Array of UTF-8 bytes.
|
|
7
|
+
* NOTE: This does not perform canonicalization (sorting keys).
|
|
8
|
+
*/
|
|
9
|
+
export declare function objectToBytes(data: object): Uint8Array;
|
|
10
|
+
/**
|
|
11
|
+
* Serializes a JavaScript object to a raw Base64URL string.
|
|
12
|
+
* NOTE: This does not perform canonicalization (sorting keys).
|
|
13
|
+
*/
|
|
14
|
+
export declare function objectToRawBase64UrlSafe(data: object): string;
|
|
15
|
+
/**
|
|
16
|
+
* Deserializes a Base64URL string back into a JavaScript object.
|
|
17
|
+
* @param base64UrlSafe The Base64URL encoded JSON string.
|
|
18
|
+
* @returns A JavaScript object.
|
|
19
|
+
*/
|
|
20
|
+
export declare function base64UrlSafeToJSON(base64UrlSafe: string | undefined): object;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// crypto-ts/utils/object-convert.ts
|
|
2
|
+
import { decodeURLSafe } from "@stablelib/base64";
|
|
3
|
+
import { bytesToStringUTF8, stringToBytesUTF8 } from './string-convert';
|
|
4
|
+
import { bytesToRawBase64UrlSafe } from './base-convert';
|
|
5
|
+
/** Compares two arrays and returns true if they are the same, false otherwise. */
|
|
6
|
+
export function arrayCompare(a, b) {
|
|
7
|
+
if (a.length !== b.length) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
for (let i = 0; i < a.length; i++) {
|
|
11
|
+
if (a[i] !== b[i]) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
/** Merges two Uint8Arrays into a single Uint8Array. */
|
|
18
|
+
export function arrayMerge(a, b) {
|
|
19
|
+
const mergedArray = new Uint8Array(a.length + b.length);
|
|
20
|
+
mergedArray.set(a);
|
|
21
|
+
mergedArray.set(b, a.length);
|
|
22
|
+
return mergedArray;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Serializes a JavaScript object to a Uint8Array of UTF-8 bytes.
|
|
26
|
+
* NOTE: This does not perform canonicalization (sorting keys).
|
|
27
|
+
*/
|
|
28
|
+
export function objectToBytes(data) {
|
|
29
|
+
return stringToBytesUTF8(JSON.stringify(data));
|
|
30
|
+
}
|
|
31
|
+
;
|
|
32
|
+
/**
|
|
33
|
+
* Serializes a JavaScript object to a raw Base64URL string.
|
|
34
|
+
* NOTE: This does not perform canonicalization (sorting keys).
|
|
35
|
+
*/
|
|
36
|
+
export function objectToRawBase64UrlSafe(data) {
|
|
37
|
+
const dataBytes = objectToBytes(data);
|
|
38
|
+
return bytesToRawBase64UrlSafe(dataBytes);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Deserializes a Base64URL string back into a JavaScript object.
|
|
42
|
+
* @param base64UrlSafe The Base64URL encoded JSON string.
|
|
43
|
+
* @returns A JavaScript object.
|
|
44
|
+
*/
|
|
45
|
+
export function base64UrlSafeToJSON(base64UrlSafe) {
|
|
46
|
+
if (!base64UrlSafe) {
|
|
47
|
+
throw new Error("Input string is undefined.");
|
|
48
|
+
}
|
|
49
|
+
const dataBytes = decodeURLSafe(base64UrlSafe);
|
|
50
|
+
return JSON.parse(bytesToStringUTF8(dataBytes));
|
|
51
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type SmartCompositionReadScopeOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Subject DID pinned by the current CORE GW root scope contract.
|
|
4
|
+
*/
|
|
5
|
+
subjectDid: string;
|
|
6
|
+
/**
|
|
7
|
+
* One or more section claims such as `LOINC|60591-5`.
|
|
8
|
+
*
|
|
9
|
+
* When omitted, the helper defaults to the IPS patient summary document.
|
|
10
|
+
*/
|
|
11
|
+
sections?: string | string[];
|
|
12
|
+
/**
|
|
13
|
+
* Read verb suffix used in the current GW SMART root scope contract.
|
|
14
|
+
*
|
|
15
|
+
* Defaults to `rs`.
|
|
16
|
+
*/
|
|
17
|
+
accessVerb?: 'r' | 'rs' | 'cruds';
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Builds the gateway-pinned SMART root scope required by the current CORE GW
|
|
21
|
+
* token contract:
|
|
22
|
+
*
|
|
23
|
+
* `organization/Composition.<verb>?subject=<did:web:...>§ion=<code>[,<code>...]`
|
|
24
|
+
*
|
|
25
|
+
* This is intentionally a gateway-contract helper, not a generic SMART/FHIR
|
|
26
|
+
* scope builder.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildSmartCompositionReadScope(options: SmartCompositionReadScopeOptions): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HealthcareBasicSections } from '../constants/healthcare';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the gateway-pinned SMART root scope required by the current CORE GW
|
|
4
|
+
* token contract:
|
|
5
|
+
*
|
|
6
|
+
* `organization/Composition.<verb>?subject=<did:web:...>§ion=<code>[,<code>...]`
|
|
7
|
+
*
|
|
8
|
+
* This is intentionally a gateway-contract helper, not a generic SMART/FHIR
|
|
9
|
+
* scope builder.
|
|
10
|
+
*/
|
|
11
|
+
export function buildSmartCompositionReadScope(options) {
|
|
12
|
+
const subjectDid = String(options.subjectDid || '').trim();
|
|
13
|
+
if (!subjectDid) {
|
|
14
|
+
throw new Error('buildSmartCompositionReadScope requires subjectDid.');
|
|
15
|
+
}
|
|
16
|
+
const sections = Array.isArray(options.sections)
|
|
17
|
+
? options.sections
|
|
18
|
+
: options.sections
|
|
19
|
+
? [options.sections]
|
|
20
|
+
: [HealthcareBasicSections.PatientSummaryDocument.claim];
|
|
21
|
+
const normalizedSections = sections
|
|
22
|
+
.map((section) => String(section || '').trim())
|
|
23
|
+
.filter(Boolean);
|
|
24
|
+
const query = new URLSearchParams({ subject: subjectDid });
|
|
25
|
+
if (normalizedSections.length > 0) {
|
|
26
|
+
query.set('section', normalizedSections.join(','));
|
|
27
|
+
}
|
|
28
|
+
return `organization/Composition.${options.accessVerb || 'rs'}?${query.toString()}`;
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encodes a standard JavaScript string into a Uint8Array of strictly-validated UTF-8 bytes.
|
|
3
|
+
* This is the standard and safest method for serializing text data.
|
|
4
|
+
* @param str The string to convert.
|
|
5
|
+
* @returns A Uint8Array.
|
|
6
|
+
*/
|
|
7
|
+
export declare function stringToBytesUTF8(str: string): Uint8Array;
|
|
8
|
+
/**
|
|
9
|
+
* Decodes a Uint8Array of strictly-validated UTF-8 bytes back into a string.
|
|
10
|
+
* This will fail if the byte array does not represent valid UTF-8.
|
|
11
|
+
* Use this for standard text and JSON.
|
|
12
|
+
* @param array The UTF-8 byte array to convert.
|
|
13
|
+
* @returns A string.
|
|
14
|
+
*/
|
|
15
|
+
export declare function bytesToStringUTF8(array: Uint8Array): string;
|
|
16
|
+
/**
|
|
17
|
+
* Decodes a Uint8Array containing binary data into a string by processing
|
|
18
|
+
* each byte individually. This is more permissive than `bytesToStringUTF8` and is
|
|
19
|
+
* specifically required for handling payloads from libraries (e.g., pako) that
|
|
20
|
+
* may not be strictly UTF-8. Use this for decoding JWT payloads.
|
|
21
|
+
* @param array The binary/ASCII byte array to convert.
|
|
22
|
+
* @returns A string.
|
|
23
|
+
*/
|
|
24
|
+
export declare function bytesToStringASCII(array: Uint8Array): string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// crypto-ts/utils/string-convert.ts
|
|
2
|
+
import { encode as encodeUTF8, decode as decodeUTF8 } from "@stablelib/utf8";
|
|
3
|
+
/**
|
|
4
|
+
* Encodes a standard JavaScript string into a Uint8Array of strictly-validated UTF-8 bytes.
|
|
5
|
+
* This is the standard and safest method for serializing text data.
|
|
6
|
+
* @param str The string to convert.
|
|
7
|
+
* @returns A Uint8Array.
|
|
8
|
+
*/
|
|
9
|
+
export function stringToBytesUTF8(str) {
|
|
10
|
+
return encodeUTF8(str);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Decodes a Uint8Array of strictly-validated UTF-8 bytes back into a string.
|
|
14
|
+
* This will fail if the byte array does not represent valid UTF-8.
|
|
15
|
+
* Use this for standard text and JSON.
|
|
16
|
+
* @param array The UTF-8 byte array to convert.
|
|
17
|
+
* @returns A string.
|
|
18
|
+
*/
|
|
19
|
+
export function bytesToStringUTF8(array) {
|
|
20
|
+
return decodeUTF8(array);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Decodes a Uint8Array containing binary data into a string by processing
|
|
24
|
+
* each byte individually. This is more permissive than `bytesToStringUTF8` and is
|
|
25
|
+
* specifically required for handling payloads from libraries (e.g., pako) that
|
|
26
|
+
* may not be strictly UTF-8. Use this for decoding JWT payloads.
|
|
27
|
+
* @param array The binary/ASCII byte array to convert.
|
|
28
|
+
* @returns A string.
|
|
29
|
+
*/
|
|
30
|
+
export function bytesToStringASCII(array) {
|
|
31
|
+
var out, i, len, c;
|
|
32
|
+
var char2, char3;
|
|
33
|
+
out = "";
|
|
34
|
+
len = array.length;
|
|
35
|
+
i = 0;
|
|
36
|
+
while (i < len) {
|
|
37
|
+
c = array[i++];
|
|
38
|
+
switch (c >> 4) {
|
|
39
|
+
case 0:
|
|
40
|
+
case 1:
|
|
41
|
+
case 2:
|
|
42
|
+
case 3:
|
|
43
|
+
case 4:
|
|
44
|
+
case 5:
|
|
45
|
+
case 6:
|
|
46
|
+
case 7:
|
|
47
|
+
out += String.fromCharCode(c);
|
|
48
|
+
break;
|
|
49
|
+
case 12:
|
|
50
|
+
case 13:
|
|
51
|
+
char2 = array[i++];
|
|
52
|
+
out += String.fromCharCode(((c & 0x1f) << 6) | (char2 & 0x3f));
|
|
53
|
+
break;
|
|
54
|
+
case 14:
|
|
55
|
+
char2 = array[i++];
|
|
56
|
+
char3 = array[i++];
|
|
57
|
+
out += String.fromCharCode(((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0));
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capitalizes the first letter of a string.
|
|
3
|
+
* @param s The input string.
|
|
4
|
+
* @returns The capitalized string.
|
|
5
|
+
*/
|
|
6
|
+
export declare function capitalize(s: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* A simple string sanitizer that removes characters that are not alphanumeric or common punctuation.
|
|
9
|
+
* @param str The string to sanitize.
|
|
10
|
+
* @returns The sanitized string.
|
|
11
|
+
*/
|
|
12
|
+
export declare function sanitizeString(str: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Converts a string to a string of its ASCII character codes.
|
|
15
|
+
* @param text The input string.
|
|
16
|
+
* @returns A string of character codes.
|
|
17
|
+
*/
|
|
18
|
+
export declare function stringToASCII(text: any): string;
|
|
19
|
+
/**
|
|
20
|
+
* Converts a string to an array of numbers representing its byte values.
|
|
21
|
+
* From google closure library: https://github.com/google/closure-library/blob/8598d87242af59aac233270742c8984e2b2bdbe0/closure/goog/crypt/crypt.js#L117-L143
|
|
22
|
+
* @param str The input string.
|
|
23
|
+
* @returns An array of numbers.
|
|
24
|
+
*/
|
|
25
|
+
export declare function stringToBytesArrayOfNumbers(str: string): number[];
|