@icanbwell/bwell-sdk-ts 1.54.0 → 1.55.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/README.md +19 -3
- package/dist/__version__.d.ts +1 -1
- package/dist/__version__.js +1 -1
- package/dist/api/api-provider-factory.d.ts +1 -1
- package/dist/api/api-provider-factory.js +2 -1
- package/dist/api/base/activity/activity-manager.d.ts +18 -25
- package/dist/api/base/activity/get-tasks-request.d.ts +29 -49
- package/dist/api/base/activity/get-tasks-request.js +42 -15
- package/dist/api/base/activity/index.d.ts +2 -4
- package/dist/api/base/activity/index.js +0 -1
- package/dist/api/base/api-provider.d.ts +12 -14
- package/dist/api/base/connection/connection-manager.d.ts +68 -51
- package/dist/api/base/connection/connection-manager.js +3 -0
- package/dist/api/base/connection/connection-request.d.ts +15 -1
- package/dist/api/base/connection/connection-request.js +8 -0
- package/dist/api/base/connection/index.d.ts +1 -1
- package/dist/api/base/device/constants.d.ts +3 -0
- package/dist/api/base/device/constants.js +3 -0
- package/dist/api/base/device/device-manager.d.ts +34 -12
- package/dist/api/base/device/device-manager.js +1 -5
- package/dist/api/base/device/device-request.d.ts +35 -42
- package/dist/api/base/device/device-request.js +30 -42
- package/dist/api/base/device/index.d.ts +2 -2
- package/dist/api/base/device/index.js +2 -2
- package/dist/api/base/financial/coverage-request.d.ts +5 -6
- package/dist/api/base/financial/coverage-request.js +7 -7
- package/dist/api/base/financial/{explanation-of-benefit.d.ts → explanation-of-benefit-request.d.ts} +15 -9
- package/dist/api/base/financial/{explanation-of-benefit.js → explanation-of-benefit-request.js} +8 -18
- package/dist/api/base/financial/financial-manager.d.ts +46 -14
- package/dist/api/base/financial/index.d.ts +3 -2
- package/dist/api/base/financial/index.js +2 -2
- package/dist/api/base/health-data/health-data-request.d.ts +116 -8
- package/dist/api/base/health-data/health-data-request.js +83 -2
- package/dist/api/base/health-data/health-data-response-factory.d.ts +27 -0
- package/dist/api/base/health-data/health-manager.d.ts +293 -243
- package/dist/api/base/health-data/index.d.ts +2 -3
- package/dist/api/base/health-data/index.js +0 -2
- package/dist/api/base/health-data/lab-knowledge-request.d.ts +9 -0
- package/dist/api/base/health-data/lab-knowledge-request.js +3 -0
- package/dist/api/base/health-data/medication-knowledge-request.d.ts +9 -0
- package/dist/api/base/health-data/medication-knowledge-request.js +3 -0
- package/dist/api/base/health-space/appointments-request.d.ts +9 -0
- package/dist/api/base/health-space/appointments-request.js +3 -0
- package/dist/api/base/health-space/cancel-appointment-request.d.ts +8 -1
- package/dist/api/base/health-space/cancel-appointment-request.js +4 -0
- package/dist/api/base/health-space/cancellation-reasons-request.d.ts +28 -0
- package/dist/api/base/health-space/{cancelationReasons-request.js → cancellation-reasons-request.js} +10 -4
- package/dist/api/base/health-space/health-space-manager.d.ts +29 -116
- package/dist/api/base/health-space/index.d.ts +2 -7
- package/dist/api/base/health-space/index.js +1 -6
- package/dist/api/base/identity/identity-manager.d.ts +98 -11
- package/dist/api/base/index.d.ts +1 -3
- package/dist/api/base/index.js +2 -3
- package/dist/api/base/questionnaire/index.d.ts +1 -4
- package/dist/api/base/questionnaire/index.js +0 -3
- package/dist/api/base/questionnaire/next-question-request.d.ts +8 -2
- package/dist/api/base/questionnaire/next-question-request.js +4 -1
- package/dist/api/base/questionnaire/questionnaire-manager.d.ts +24 -42
- package/dist/api/base/requests/field-sort-order.d.ts +11 -0
- package/dist/api/base/requests/index.d.ts +2 -0
- package/dist/api/base/requests/search-date.d.ts +12 -0
- package/dist/api/base/requests/search-reference.d.ts +9 -1
- package/dist/api/base/requests/search-string.d.ts +6 -0
- package/dist/api/base/requests/search-token.d.ts +18 -0
- package/dist/api/base/requests/search-token.js +17 -17
- package/dist/api/base/search/index.d.ts +3 -5
- package/dist/api/base/search/index.js +1 -3
- package/dist/api/base/search/search-health-resources-request.d.ts +33 -36
- package/dist/api/base/search/search-health-resources-request.js +3 -0
- package/dist/api/base/search/search-manager.d.ts +39 -42
- package/dist/api/base/search/submit-provider-for-review-request.d.ts +33 -0
- package/dist/api/base/search/submit-provider-for-review-request.js +9 -0
- package/dist/api/base/user/create-consent-request.d.ts +13 -1
- package/dist/api/base/user/create-consent-request.js +10 -5
- package/dist/api/base/user/create-data-export-direct-download-url-request.d.ts +9 -0
- package/dist/api/base/user/create-data-export-direct-download-url-request.js +3 -0
- package/dist/api/base/user/create-verification-url-request.d.ts +12 -0
- package/dist/api/base/user/create-verification-url-request.js +6 -0
- package/dist/api/base/user/get-consents-request.d.ts +19 -1
- package/dist/api/base/user/get-consents-request.js +13 -1
- package/dist/api/base/user/index.d.ts +1 -2
- package/dist/api/base/user/update-profile-request.d.ts +11 -3
- package/dist/api/base/user/update-profile-request.js +5 -3
- package/dist/api/base/user/user-manager.d.ts +100 -49
- package/dist/api/base/user/validators.d.ts +5 -0
- package/dist/api/base/user/validators.js +13 -0
- package/dist/api/graphql-api/activity/{activity-request-factories.d.ts → get-tasks-request-factory.d.ts} +0 -7
- package/dist/api/graphql-api/activity/get-tasks-request-factory.js +56 -0
- package/dist/api/graphql-api/activity/graphql-activity-manager.d.ts +6 -8
- package/dist/api/graphql-api/activity/graphql-activity-manager.js +19 -30
- package/dist/api/graphql-api/activity/index.d.ts +1 -1
- package/dist/api/graphql-api/activity/index.js +1 -1
- package/dist/api/graphql-api/connection/connection-response-factory.d.ts +7 -0
- package/dist/api/graphql-api/connection/connection-response-factory.js +101 -0
- package/dist/api/graphql-api/connection/graphql-connection-manager.d.ts +9 -9
- package/dist/api/graphql-api/connection/graphql-connection-manager.js +7 -5
- package/dist/api/graphql-api/connection/index.d.ts +0 -1
- package/dist/api/graphql-api/connection/index.js +1 -1
- package/dist/api/graphql-api/device/graphql-device-manager.d.ts +2 -1
- package/dist/api/graphql-api/device/graphql-device-manager.js +4 -2
- package/dist/api/graphql-api/errors/errors.js +1 -1
- package/dist/api/graphql-api/financial/coverage-request-factory.d.ts +9 -0
- package/dist/api/graphql-api/financial/coverage-request-factory.js +19 -0
- package/dist/api/graphql-api/financial/{graphql-explanation-of-benefits-factory.d.ts → explanation-of-benefit-request-factory.d.ts} +3 -3
- package/dist/api/graphql-api/financial/explanation-of-benefit-request-factory.js +19 -0
- package/dist/api/graphql-api/financial/graphql-financial-manager.d.ts +4 -12
- package/dist/api/graphql-api/financial/graphql-financial-manager.js +32 -19
- package/dist/api/graphql-api/financial/index.d.ts +3 -1
- package/dist/api/graphql-api/financial/index.js +3 -1
- package/dist/api/graphql-api/graphql-api-provider.d.ts +6 -14
- package/dist/api/graphql-api/graphql-api-provider.js +6 -7
- package/dist/api/graphql-api/graphql-manager/graphql-manager.d.ts +1 -0
- package/dist/api/graphql-api/health-space/cancel-appointment-request-factory.js +1 -2
- package/dist/api/graphql-api/health-space/graphql-health-space-manager.d.ts +5 -62
- package/dist/api/graphql-api/health-space/graphql-health-space-manager.js +9 -163
- package/dist/api/graphql-api/health-space/index.d.ts +0 -4
- package/dist/api/graphql-api/health-space/index.js +0 -4
- package/dist/api/graphql-api/healthdata/get-encounters-request-factory.d.ts +7 -0
- package/dist/api/graphql-api/healthdata/get-encounters-request-factory.js +76 -0
- package/dist/api/graphql-api/healthdata/get-medication-dispenses-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/healthdata/get-medication-dispenses-request-factory.js +25 -0
- package/dist/api/graphql-api/healthdata/graphql-health-manager.d.ts +30 -41
- package/dist/api/graphql-api/healthdata/graphql-health-manager.js +311 -256
- package/dist/api/graphql-api/healthdata/health-data-request-factory.d.ts +18 -0
- package/dist/api/graphql-api/healthdata/health-data-request-factory.js +25 -0
- package/dist/api/graphql-api/healthdata/health-data-response-factory.d.ts +8 -0
- package/dist/api/graphql-api/healthdata/health-data-response-factory.js +58 -0
- package/dist/api/graphql-api/identity/graphql-identity-manager.d.ts +2 -1
- package/dist/api/graphql-api/identity/graphql-identity-manager.js +5 -3
- package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.d.ts +4 -22
- package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.js +4 -69
- package/dist/api/graphql-api/questionnaire/index.d.ts +0 -2
- package/dist/api/graphql-api/questionnaire/index.js +0 -2
- package/dist/api/graphql-api/search/graphql-search-manager.d.ts +4 -6
- package/dist/api/graphql-api/search/graphql-search-manager.js +9 -71
- package/dist/api/graphql-api/search/search-health-resources-request-factory.js +12 -10
- package/dist/api/graphql-api/search/submit-provider-for-review-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/search/{request-connection-request-factory.js → submit-provider-for-review-request-factory.js} +1 -1
- package/dist/api/graphql-api/user/get-consent-request-factory.d.ts +1 -2
- package/dist/api/graphql-api/user/get-consent-request-factory.js +5 -1
- package/dist/api/graphql-api/user/graphql-user-manager.d.ts +10 -11
- package/dist/api/graphql-api/user/graphql-user-manager.js +11 -10
- package/dist/api/graphql-api/user/update-profile-request-factory.js +1 -2
- package/dist/api/identity-manager-factory.js +1 -1
- package/dist/auth/auth-code-strategy.d.ts +2 -1
- package/dist/auth/auth-strategy.d.ts +1 -1
- package/dist/auth/credentials.d.ts +1 -1
- package/dist/auth/credentials.js +2 -2
- package/dist/auth/oauth-strategy.d.ts +2 -1
- package/dist/auth/username-password-strategy.d.ts +2 -1
- package/dist/auth/username-password-strategy.js +2 -2
- package/dist/bwell-sdk/bwell-sdk.d.ts +319 -48
- package/dist/bwell-sdk/bwell-sdk.js +368 -53
- package/dist/config/bwell-config.d.ts +12 -12
- package/dist/config/bwell-config.js +2 -5
- package/dist/config/sdk-config.d.ts +2 -3
- package/dist/config/sdk-config.js +4 -6
- package/dist/errors/authentication-error.d.ts +7 -0
- package/dist/errors/authentication-error.js +7 -0
- package/dist/errors/bwell-error.d.ts +12 -2
- package/dist/errors/bwell-error.js +5 -2
- package/dist/errors/illegal-argument-error.d.ts +7 -0
- package/dist/errors/illegal-argument-error.js +7 -0
- package/dist/errors/illegal-state-error.d.ts +7 -0
- package/dist/errors/illegal-state-error.js +7 -0
- package/dist/errors/invalid-client-key-error.d.ts +7 -0
- package/dist/errors/invalid-client-key-error.js +7 -0
- package/dist/errors/invalid-credentials-type-error.d.ts +7 -0
- package/dist/errors/invalid-credentials-type-error.js +7 -0
- package/dist/errors/invalid-token-error.d.ts +4 -1
- package/dist/errors/invalid-token-error.js +4 -1
- package/dist/errors/network-error.d.ts +7 -0
- package/dist/errors/network-error.js +7 -0
- package/dist/errors/operation-outcome-error.d.ts +8 -1
- package/dist/errors/operation-outcome-error.js +7 -0
- package/dist/errors/unknown-error.d.ts +7 -0
- package/dist/errors/unknown-error.js +7 -0
- package/dist/errors/validation-error.d.ts +7 -0
- package/dist/errors/validation-error.js +7 -0
- package/dist/graphql/operations/index.d.ts +116 -283
- package/dist/graphql/operations/index.js +1767 -2095
- package/dist/graphql/operations/types.d.ts +16471 -18430
- package/dist/graphql/schema.d.ts +68323 -5995
- package/dist/graphql/schema.js +1 -484
- package/dist/index.d.ts +7 -5
- package/dist/index.js +5 -4
- package/dist/language/language-manager.d.ts +25 -10
- package/dist/language/language-manager.js +5 -0
- package/dist/models/activity/index.d.ts +1 -0
- package/dist/models/activity/task.d.ts +77 -0
- package/dist/models/common/address.d.ts +41 -0
- package/dist/models/common/annotation.d.ts +18 -0
- package/dist/models/common/annotation.js +1 -0
- package/dist/models/common/attachment.d.ts +18 -0
- package/dist/models/common/attachment.js +1 -0
- package/dist/models/common/bundle.d.ts +83 -0
- package/dist/models/common/bundle.js +1 -0
- package/dist/models/common/codeable-concept.d.ts +17 -0
- package/dist/models/common/codeable-concept.js +1 -0
- package/dist/models/common/coding.d.ts +18 -0
- package/dist/models/common/coding.js +1 -0
- package/dist/models/common/component.d.ts +23 -0
- package/dist/models/common/component.js +1 -0
- package/dist/models/common/contact-point.d.ts +32 -0
- package/dist/models/common/contact-point.js +1 -0
- package/dist/models/common/dispense-request.d.ts +67 -0
- package/dist/models/common/dispense-request.js +1 -0
- package/dist/models/common/dosage.d.ts +68 -0
- package/dist/models/common/dosage.js +1 -0
- package/dist/models/common/endpoint.d.ts +23 -0
- package/dist/models/common/endpoint.js +1 -0
- package/dist/models/common/expression.d.ts +20 -0
- package/dist/models/common/expression.js +1 -0
- package/dist/models/common/extension.d.ts +49 -0
- package/dist/models/common/extension.js +1 -0
- package/dist/models/common/fhir-error.d.ts +23 -0
- package/dist/models/common/fhir-error.js +1 -0
- package/dist/models/common/human-name.d.ts +20 -0
- package/dist/models/common/human-name.js +1 -0
- package/dist/models/common/identifier.d.ts +19 -0
- package/dist/models/common/identifier.js +1 -0
- package/dist/models/common/index.d.ts +38 -0
- package/dist/models/common/index.js +2 -0
- package/dist/models/common/location.d.ts +51 -0
- package/dist/models/common/location.js +1 -0
- package/dist/models/common/medication.d.ts +42 -0
- package/dist/models/common/medication.js +1 -0
- package/dist/models/common/meta.d.ts +21 -0
- package/dist/models/common/meta.js +1 -0
- package/dist/models/common/money.d.ts +15 -0
- package/dist/models/common/money.js +1 -0
- package/dist/models/common/narrative.d.ts +14 -0
- package/dist/models/common/narrative.js +1 -0
- package/dist/models/common/operation-outcome.d.ts +48 -0
- package/dist/models/common/operation-outcome.js +1 -0
- package/dist/models/common/organization.d.ts +46 -0
- package/dist/models/common/organization.js +1 -0
- package/dist/models/common/paging-info.d.ts +18 -0
- package/dist/models/common/paging-info.js +1 -0
- package/dist/models/common/patient.d.ts +13 -0
- package/dist/models/common/patient.js +1 -0
- package/dist/models/common/period.d.ts +14 -0
- package/dist/models/common/period.js +1 -0
- package/dist/models/common/practitioner-role.d.ts +42 -0
- package/dist/models/common/practitioner-role.js +1 -0
- package/dist/models/common/practitioner.d.ts +17 -0
- package/dist/models/common/practitioner.js +1 -0
- package/dist/models/common/quantity.d.ts +20 -0
- package/dist/models/common/quantity.js +1 -0
- package/dist/models/common/range.d.ts +15 -0
- package/dist/models/common/range.js +1 -0
- package/dist/models/common/ratio.d.ts +15 -0
- package/dist/models/common/ratio.js +1 -0
- package/dist/models/common/reference-range.d.ts +13 -0
- package/dist/models/common/reference-range.js +1 -0
- package/dist/models/common/reference.d.ts +27 -0
- package/dist/models/common/reference.js +1 -0
- package/dist/models/common/related-person.d.ts +34 -0
- package/dist/models/common/related-person.js +1 -0
- package/dist/models/common/score.d.ts +16 -0
- package/dist/models/common/score.js +1 -0
- package/dist/models/common/service-request.d.ts +21 -0
- package/dist/models/common/service-request.js +1 -0
- package/dist/models/common/specimen.d.ts +30 -0
- package/dist/models/common/specimen.js +7 -0
- package/dist/models/common/timing.d.ts +107 -0
- package/dist/models/common/timing.js +1 -0
- package/dist/models/common/value.d.ts +22 -0
- package/dist/models/common/value.js +1 -0
- package/dist/models/connection/base-connection.d.ts +27 -0
- package/dist/models/connection/base-connection.js +1 -0
- package/dist/models/connection/connection-status.d.ts +15 -0
- package/dist/models/connection/connection-status.js +1 -0
- package/dist/models/connection/connection.d.ts +32 -0
- package/dist/models/connection/connection.js +1 -0
- package/dist/models/connection/data-source.d.ts +27 -0
- package/dist/models/connection/data-source.js +1 -0
- package/dist/models/connection/index.d.ts +6 -0
- package/dist/models/connection/index.js +1 -0
- package/dist/models/connection/member-connection.d.ts +37 -0
- package/dist/models/connection/member-connection.js +1 -0
- package/dist/models/connection/oauth-url.d.ts +12 -0
- package/dist/models/connection/oauth-url.js +1 -0
- package/dist/models/device/device-registration-results.d.ts +12 -0
- package/dist/models/device/device-registration-results.js +1 -0
- package/dist/models/device/index.d.ts +1 -0
- package/dist/models/device/index.js +1 -0
- package/dist/models/enums/category-code.d.ts +11 -0
- package/dist/models/enums/category-code.js +13 -0
- package/dist/models/enums/connection-category.d.ts +9 -0
- package/dist/models/enums/connection-category.js +1 -0
- package/dist/models/enums/consent-provision-type.d.ts +11 -0
- package/dist/models/enums/consent-provision-type.js +2 -0
- package/dist/models/enums/consent-status.d.ts +11 -0
- package/dist/models/enums/consent-status.js +9 -0
- package/dist/models/enums/data-connection-status.d.ts +9 -0
- package/dist/models/enums/data-connection-status.js +1 -0
- package/dist/models/enums/data-connection-type.d.ts +9 -0
- package/dist/models/enums/data-connection-type.js +1 -0
- package/dist/models/enums/data-set.d.ts +10 -0
- package/dist/models/enums/data-set.js +1 -0
- package/dist/models/enums/device-platform.d.ts +11 -0
- package/dist/models/enums/device-platform.js +2 -0
- package/dist/models/enums/endpoint-status.d.ts +9 -0
- package/dist/models/enums/endpoint-status.js +1 -0
- package/dist/models/enums/filter-field.d.ts +9 -0
- package/dist/models/enums/filter-field.js +1 -0
- package/dist/models/enums/gender.d.ts +9 -0
- package/dist/models/enums/gender.js +1 -0
- package/dist/models/enums/index.d.ts +18 -0
- package/dist/models/enums/index.js +5 -0
- package/dist/models/enums/log-level.d.ts +8 -0
- package/dist/models/enums/log-level.js +1 -0
- package/dist/models/enums/person-gender.d.ts +11 -0
- package/dist/models/enums/person-gender.js +7 -0
- package/dist/models/enums/search-context.d.ts +10 -0
- package/dist/models/enums/search-context.js +1 -0
- package/dist/models/enums/search-result-type.d.ts +9 -0
- package/dist/models/enums/search-result-type.js +1 -0
- package/dist/models/enums/sort-field.d.ts +10 -0
- package/dist/models/enums/sort-field.js +1 -0
- package/dist/models/enums/sort-order.d.ts +9 -0
- package/dist/models/enums/sort-order.js +1 -0
- package/dist/models/enums/sync-status.d.ts +9 -0
- package/dist/models/enums/sync-status.js +1 -0
- package/dist/models/financial/coverage-bundle.d.ts +18 -0
- package/dist/models/financial/coverage-bundle.js +1 -0
- package/dist/models/financial/coverage.d.ts +65 -0
- package/dist/models/financial/coverage.js +1 -0
- package/dist/models/financial/explanation-of-benefit-bundle.d.ts +26 -0
- package/dist/models/financial/explanation-of-benefit-bundle.js +1 -0
- package/dist/models/financial/explanation-of-benefit.d.ts +274 -0
- package/dist/models/financial/explanation-of-benefit.js +1 -0
- package/dist/models/financial/index.d.ts +4 -0
- package/dist/models/financial/index.js +4 -0
- package/dist/models/health-data/allergy-intolerance-bundle.d.ts +11 -0
- package/dist/models/health-data/allergy-intolerance-bundle.js +1 -0
- package/dist/models/health-data/allergy-intolerance-group.d.ts +44 -0
- package/dist/models/health-data/allergy-intolerance-group.js +1 -0
- package/dist/models/health-data/allergy-intolerance-reaction.d.ts +23 -0
- package/dist/models/health-data/allergy-intolerance-reaction.js +1 -0
- package/dist/models/health-data/allergy-intolerance.d.ts +54 -0
- package/dist/models/health-data/allergy-intolerance.js +1 -0
- package/dist/models/health-data/care-plan-group.d.ts +42 -0
- package/dist/models/health-data/care-plan-group.js +1 -0
- package/dist/models/health-data/care-plan.d.ts +134 -0
- package/dist/models/health-data/care-plan.js +1 -0
- package/dist/models/health-data/care-team.d.ts +77 -0
- package/dist/models/health-data/care-team.js +1 -0
- package/dist/models/health-data/condition-group.d.ts +42 -0
- package/dist/models/health-data/condition-group.js +1 -0
- package/dist/models/health-data/condition.d.ts +104 -0
- package/dist/models/health-data/condition.js +1 -0
- package/dist/models/health-data/diagnostic-report-lab-group.d.ts +45 -0
- package/dist/models/health-data/diagnostic-report-lab-group.js +1 -0
- package/dist/models/health-data/diagnostic-report.d.ts +90 -0
- package/dist/models/health-data/diagnostic-report.js +1 -0
- package/dist/models/health-data/encounter-group.d.ts +48 -0
- package/dist/models/health-data/encounter-group.js +1 -0
- package/dist/models/health-data/encounter.d.ts +79 -0
- package/dist/models/health-data/encounter.js +1 -0
- package/dist/models/health-data/health-summary.d.ts +18 -0
- package/dist/models/health-data/health-summary.js +1 -0
- package/dist/models/health-data/immunization-group.d.ts +41 -0
- package/dist/models/health-data/immunization-group.js +1 -0
- package/dist/models/health-data/immunization.d.ts +150 -0
- package/dist/models/health-data/immunization.js +1 -0
- package/dist/models/health-data/index.d.ts +30 -0
- package/dist/models/health-data/index.js +1 -0
- package/dist/models/health-data/lab-bundle.d.ts +26 -0
- package/dist/models/health-data/lab-bundle.js +1 -0
- package/dist/models/health-data/lab-group.d.ts +51 -0
- package/dist/models/health-data/lab-group.js +1 -0
- package/dist/models/health-data/lab-knowledge.d.ts +28 -0
- package/dist/models/health-data/lab-knowledge.js +1 -0
- package/dist/models/health-data/medication-dispense.d.ts +108 -0
- package/dist/models/health-data/medication-dispense.js +1 -0
- package/dist/models/health-data/medication-group.d.ts +43 -0
- package/dist/models/health-data/medication-group.js +1 -0
- package/dist/models/health-data/medication-knowledge.d.ts +30 -0
- package/dist/models/health-data/medication-knowledge.js +1 -0
- package/dist/models/health-data/medication-pricing.d.ts +28 -0
- package/dist/models/health-data/medication-pricing.js +1 -0
- package/dist/models/health-data/medication-request.d.ts +107 -0
- package/dist/models/health-data/medication-request.js +1 -0
- package/dist/models/health-data/medication-statement.d.ts +68 -0
- package/dist/models/health-data/medication-statement.js +1 -0
- package/dist/models/health-data/observation.d.ts +102 -0
- package/dist/models/health-data/observation.js +1 -0
- package/dist/models/health-data/procedure-group.d.ts +43 -0
- package/dist/models/health-data/procedure-group.js +1 -0
- package/dist/models/health-data/procedure.d.ts +84 -0
- package/dist/models/health-data/procedure.js +1 -0
- package/dist/models/health-data/vital-sign-bundle.d.ts +18 -0
- package/dist/models/health-data/vital-sign-bundle.js +1 -0
- package/dist/models/health-data/vital-sign-group.d.ts +51 -0
- package/dist/models/health-data/vital-sign-group.js +1 -0
- package/dist/models/health-space/appointment-bundle.d.ts +11 -0
- package/dist/models/health-space/appointment-bundle.js +1 -0
- package/dist/models/health-space/appointment-participant.d.ts +17 -0
- package/dist/models/health-space/appointment-participant.js +1 -0
- package/dist/models/health-space/appointment-update.d.ts +14 -0
- package/dist/models/health-space/appointment-update.js +1 -0
- package/dist/models/health-space/appointment.d.ts +30 -0
- package/dist/models/health-space/appointment.js +1 -0
- package/dist/models/health-space/cancellation-reasons.d.ts +32 -0
- package/dist/models/health-space/cancellation-reasons.js +1 -0
- package/dist/models/health-space/index.d.ts +5 -0
- package/dist/models/health-space/index.js +1 -0
- package/dist/models/identity/auth-tokens.d.ts +25 -0
- package/dist/models/identity/auth-tokens.js +1 -0
- package/dist/models/identity/create-guest-access-token-results.d.ts +12 -0
- package/dist/models/identity/create-guest-access-token-results.js +1 -0
- package/dist/models/identity/index.d.ts +4 -0
- package/dist/models/identity/index.js +1 -0
- package/dist/models/identity/refresh-token-results.d.ts +8 -0
- package/dist/models/identity/refresh-token-results.js +1 -0
- package/dist/models/identity/sdk-configuration-result.d.ts +26 -0
- package/dist/models/identity/sdk-configuration-result.js +1 -0
- package/dist/models/index.d.ts +12 -4
- package/dist/models/index.js +12 -4
- package/dist/models/questionnaire/index.d.ts +5 -0
- package/dist/models/questionnaire/index.js +1 -0
- package/dist/models/questionnaire/questionnaire-item.d.ts +38 -0
- package/dist/models/questionnaire/questionnaire-item.js +1 -0
- package/dist/models/questionnaire/questionnaire-response-answer.d.ts +33 -0
- package/dist/models/questionnaire/questionnaire-response-answer.js +1 -0
- package/dist/models/questionnaire/questionnaire-response-item.d.ts +19 -0
- package/dist/models/questionnaire/questionnaire-response-item.js +1 -0
- package/dist/models/questionnaire/questionnaire-response.d.ts +29 -0
- package/dist/models/questionnaire/questionnaire-response.js +1 -0
- package/dist/models/questionnaire/questionnaire.d.ts +30 -0
- package/dist/models/questionnaire/questionnaire.js +1 -0
- package/dist/models/search/health-resources.d.ts +133 -0
- package/dist/models/search/health-resources.js +1 -0
- package/dist/models/search/index.d.ts +2 -0
- package/dist/models/search/index.js +1 -0
- package/dist/models/search/provider-review-result.d.ts +15 -0
- package/dist/models/search/provider-review-result.js +1 -0
- package/dist/models/user/consent.d.ts +100 -0
- package/dist/models/user/consent.js +1 -0
- package/dist/models/user/index.d.ts +4 -0
- package/dist/models/user/index.js +1 -0
- package/dist/models/user/person.d.ts +43 -0
- package/dist/models/user/person.js +1 -0
- package/dist/models/user/user.d.ts +12 -0
- package/dist/models/user/user.js +1 -0
- package/dist/models/user/verification-result.d.ts +30 -0
- package/dist/models/user/verification-result.js +1 -0
- package/dist/requests/paged-request.d.ts +35 -0
- package/dist/requests/paged-request.js +22 -0
- package/dist/requests/request.d.ts +16 -0
- package/dist/requests/request.js +8 -0
- package/dist/requests/validator.d.ts +15 -0
- package/dist/requests/validator.js +7 -0
- package/dist/results/bwell-query-result.d.ts +5 -0
- package/dist/results/bwell-query-result.js +5 -0
- package/dist/results/bwell-transaction-result.d.ts +17 -3
- package/dist/results/bwell-transaction-result.js +15 -1
- package/dist/results/index.d.ts +1 -0
- package/dist/results/index.js +1 -0
- package/dist/telemetry/open-telemetry-instrumentation.js +1 -4
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/index.js +2 -0
- package/dist/tokens/jwt-token-manager.d.ts +3 -7
- package/dist/tokens/jwt-token-manager.js +9 -8
- package/dist/tokens/load-auth-tokens.d.ts +6 -0
- package/dist/tokens/load-auth-tokens.js +43 -0
- package/dist/tokens/token-manager.d.ts +12 -0
- package/dist/tokens/token-manager.js +5 -0
- package/dist/tokens/token-storage.d.ts +20 -0
- package/dist/tokens/token-storage.js +19 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/parsing-utils.d.ts +11 -1
- package/dist/utils/parsing-utils.js +33 -1
- package/dist/utils/search-token-utils.d.ts +8 -0
- package/dist/utils/search-token-utils.js +23 -0
- package/package.json +24 -20
- package/dist/api/base/activity/types.d.ts +0 -3
- package/dist/api/base/activity/types.js +0 -5
- package/dist/api/base/activity/update-task-status-request.d.ts +0 -18
- package/dist/api/base/activity/update-task-status-request.js +0 -15
- package/dist/api/base/event/event-manager.d.ts +0 -16
- package/dist/api/base/event/event-request.d.ts +0 -35
- package/dist/api/base/event/event-request.js +0 -64
- package/dist/api/base/event/index.d.ts +0 -2
- package/dist/api/base/event/index.js +0 -1
- package/dist/api/base/health-data/medication-pricing-request.d.ts +0 -21
- package/dist/api/base/health-data/medication-pricing-request.js +0 -26
- package/dist/api/base/health-data/medication-statement-request.d.ts +0 -29
- package/dist/api/base/health-data/medication-statement-request.js +0 -35
- package/dist/api/base/health-space/add-care-team-member-request.d.ts +0 -33
- package/dist/api/base/health-space/add-care-team-member-request.js +0 -36
- package/dist/api/base/health-space/add-care-team-members-request.d.ts +0 -35
- package/dist/api/base/health-space/add-care-team-members-request.js +0 -61
- package/dist/api/base/health-space/cancelationReasons-request.d.ts +0 -16
- package/dist/api/base/health-space/care-team-members-request.d.ts +0 -31
- package/dist/api/base/health-space/care-team-members-request.js +0 -33
- package/dist/api/base/health-space/remove-care-team-member-request.d.ts +0 -34
- package/dist/api/base/health-space/remove-care-team-member-request.js +0 -36
- package/dist/api/base/health-space/update-care-team-member-request.d.ts +0 -55
- package/dist/api/base/health-space/update-care-team-member-request.js +0 -71
- package/dist/api/base/questionnaire/questionnaire-responses-request.d.ts +0 -30
- package/dist/api/base/questionnaire/questionnaire-responses-request.js +0 -49
- package/dist/api/base/questionnaire/questionnaires-request.d.ts +0 -18
- package/dist/api/base/questionnaire/questionnaires-request.js +0 -42
- package/dist/api/base/questionnaire/save-questionnaire-response-request.d.ts +0 -22
- package/dist/api/base/questionnaire/save-questionnaire-response-request.js +0 -33
- package/dist/api/base/search/request-connection-request.d.ts +0 -24
- package/dist/api/base/search/request-connection-request.js +0 -3
- package/dist/api/base/search/search-request.d.ts +0 -84
- package/dist/api/base/search/search-request.js +0 -78
- package/dist/api/base/support/create-support-request-request.d.ts +0 -22
- package/dist/api/base/support/create-support-request-request.js +0 -20
- package/dist/api/base/support/delete-support-attachment-request.d.ts +0 -11
- package/dist/api/base/support/delete-support-attachment-request.js +0 -14
- package/dist/api/base/support/get-support-requests-request.d.ts +0 -16
- package/dist/api/base/support/get-support-requests-request.js +0 -14
- package/dist/api/base/support/index.d.ts +0 -5
- package/dist/api/base/support/index.js +0 -5
- package/dist/api/base/support/support-manager.d.ts +0 -46
- package/dist/api/base/support/upload-support-attachment-request.d.ts +0 -25
- package/dist/api/base/support/upload-support-attachment-request.js +0 -27
- package/dist/api/base/user/types.d.ts +0 -9
- package/dist/api/base/user/types.js +0 -17
- package/dist/api/graphql-api/activity/activity-request-factories.js +0 -70
- package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.d.ts +0 -18
- package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.js +0 -40
- package/dist/api/graphql-api/event/event-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/event/event-request-factory.js +0 -11
- package/dist/api/graphql-api/event/graphql-event-manager.d.ts +0 -15
- package/dist/api/graphql-api/event/graphql-event-manager.js +0 -65
- package/dist/api/graphql-api/event/index.d.ts +0 -1
- package/dist/api/graphql-api/event/index.js +0 -1
- package/dist/api/graphql-api/financial/graphql-coverages-bwell-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/financial/graphql-coverages-bwell-request-factory.js +0 -17
- package/dist/api/graphql-api/financial/graphql-explanation-of-benefits-factory.js +0 -23
- package/dist/api/graphql-api/health-space/add-care-team-member-request-factory.d.ts +0 -20
- package/dist/api/graphql-api/health-space/add-care-team-member-request-factory.js +0 -29
- package/dist/api/graphql-api/health-space/add-care-team-members-request-factory.d.ts +0 -16
- package/dist/api/graphql-api/health-space/add-care-team-members-request-factory.js +0 -23
- package/dist/api/graphql-api/health-space/care-team-factory-utils.d.ts +0 -23
- package/dist/api/graphql-api/health-space/care-team-factory-utils.js +0 -30
- package/dist/api/graphql-api/health-space/care-team-members-request-factory.d.ts +0 -12
- package/dist/api/graphql-api/health-space/care-team-members-request-factory.js +0 -17
- package/dist/api/graphql-api/health-space/remove-care-team-member-request-factory.d.ts +0 -16
- package/dist/api/graphql-api/health-space/remove-care-team-member-request-factory.js +0 -24
- package/dist/api/graphql-api/health-space/update-care-team-member-request-factory.d.ts +0 -16
- package/dist/api/graphql-api/health-space/update-care-team-member-request-factory.js +0 -20
- package/dist/api/graphql-api/healthdata/graphql-diagnostic-reports-bwell-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/healthdata/graphql-diagnostic-reports-bwell-request-factory.js +0 -12
- package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.d.ts +0 -10
- package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.js +0 -35
- package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.d.ts +0 -10
- package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.js +0 -35
- package/dist/api/graphql-api/healthdata/graphql-update-medication-statement-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/healthdata/graphql-update-medication-statement-request-factory.js +0 -11
- package/dist/api/graphql-api/questionnaire/get-questionnaire-responses-request-factory.d.ts +0 -9
- package/dist/api/graphql-api/questionnaire/get-questionnaire-responses-request-factory.js +0 -22
- package/dist/api/graphql-api/questionnaire/get-questionnaires-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/questionnaire/get-questionnaires-request-factory.js +0 -16
- package/dist/api/graphql-api/search/connection-search-request-factory.d.ts +0 -7
- package/dist/api/graphql-api/search/connection-search-request-factory.js +0 -21
- package/dist/api/graphql-api/search/index.d.ts +0 -1
- package/dist/api/graphql-api/search/index.js +0 -1
- package/dist/api/graphql-api/search/provider-search-request-factory.d.ts +0 -7
- package/dist/api/graphql-api/search/provider-search-request-factory.js +0 -21
- package/dist/api/graphql-api/search/request-connection-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/search/search-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/search/search-request-factory.js +0 -44
- package/dist/api/graphql-api/support/create-support-request-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/support/create-support-request-request-factory.js +0 -19
- package/dist/api/graphql-api/support/delete-support-attachment-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/support/delete-support-attachment-request-factory.js +0 -10
- package/dist/api/graphql-api/support/get-support-requests-bwell-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/support/get-support-requests-bwell-request-factory.js +0 -16
- package/dist/api/graphql-api/support/graphql-support-manager.d.ts +0 -22
- package/dist/api/graphql-api/support/graphql-support-manager.js +0 -129
- package/dist/api/graphql-api/support/index.d.ts +0 -1
- package/dist/api/graphql-api/support/index.js +0 -1
- package/dist/api/graphql-api/support/upload-support-attachment-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/support/upload-support-attachment-request-factory.js +0 -11
- package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.js +0 -9
- package/dist/models/coding.d.ts +0 -5
- package/dist/models/fhir-error.d.ts +0 -9
- package/dist/models/user.d.ts +0 -4
- package/dist/utils/date-utils.d.ts +0 -6
- package/dist/utils/date-utils.js +0 -8
- /package/dist/api/base/{event/event-manager.js → health-data/health-data-response-factory.js} +0 -0
- /package/dist/api/base/{support/support-manager.js → requests/field-sort-order.js} +0 -0
- /package/dist/models/{coding.js → activity/index.js} +0 -0
- /package/dist/models/{fhir-error.js → activity/task.js} +0 -0
- /package/dist/models/{user.js → common/address.js} +0 -0
- /package/dist/{models → results}/operation-outcome.d.ts +0 -0
- /package/dist/{models → results}/operation-outcome.js +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { InvalidTokenError } from "../errors/index.js";
|
|
1
|
+
import { IllegalArgumentError, InvalidTokenError } from "../errors/index.js";
|
|
2
|
+
import { BWellTransactionResult } from "../index.js";
|
|
2
3
|
import { base64Decode } from "./base64.js";
|
|
3
4
|
import { isNotNullOrUndefined } from "./type-utils.js";
|
|
4
5
|
export function retrieveEnvironmentFromClientKey(clientKey) {
|
|
@@ -67,3 +68,34 @@ export function parseUserFromIdToken(token) {
|
|
|
67
68
|
// A guest JWT payload will be a valid token but without the FHIR IDs.
|
|
68
69
|
return null;
|
|
69
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Parse string to JSON array of coding objects.
|
|
73
|
+
* @param {string} json - JSON array string
|
|
74
|
+
* @returns {Coding[]} parsed coding objects
|
|
75
|
+
* @throws {BWellError} If parsing fails
|
|
76
|
+
* @throw {BWellError} If coding is missing code or system
|
|
77
|
+
*/
|
|
78
|
+
export function parseJSONCodings(json) {
|
|
79
|
+
// Parse into a JSON:
|
|
80
|
+
let parsed;
|
|
81
|
+
try {
|
|
82
|
+
parsed = JSON.parse(json);
|
|
83
|
+
}
|
|
84
|
+
catch (_a) {
|
|
85
|
+
return BWellTransactionResult.failure(new IllegalArgumentError("Failed to parse JSON"));
|
|
86
|
+
}
|
|
87
|
+
// Validate it is an array:
|
|
88
|
+
if (!Array.isArray(parsed)) {
|
|
89
|
+
return BWellTransactionResult.failure(new IllegalArgumentError("Expected array of codings"));
|
|
90
|
+
}
|
|
91
|
+
// Validate array elements are codings:
|
|
92
|
+
for (const coding of parsed) {
|
|
93
|
+
if (typeof coding.code !== "string") {
|
|
94
|
+
return BWellTransactionResult.failure(new IllegalArgumentError("Invalid coding.code"));
|
|
95
|
+
}
|
|
96
|
+
if (typeof coding.system !== "string") {
|
|
97
|
+
return BWellTransactionResult.failure(new IllegalArgumentError("Invalid coding.system"));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return BWellTransactionResult.success(parsed);
|
|
101
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SearchToken } from "../api/base/requests/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts SearchToken values to a string[].
|
|
4
|
+
* If token.value and token.values are present, [token.value.value] is returned.
|
|
5
|
+
* @param {SearchToken} token
|
|
6
|
+
* @returns {string[]} Values from search token
|
|
7
|
+
*/
|
|
8
|
+
export declare function getSearchTokenValues(token: SearchToken): string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isNotNullOrUndefined, isNullOrUndefined } from "./type-utils.js";
|
|
2
|
+
/**
|
|
3
|
+
* Extracts SearchToken values to a string[].
|
|
4
|
+
* If token.value and token.values are present, [token.value.value] is returned.
|
|
5
|
+
* @param {SearchToken} token
|
|
6
|
+
* @returns {string[]} Values from search token
|
|
7
|
+
*/
|
|
8
|
+
export function getSearchTokenValues(token) {
|
|
9
|
+
var _a;
|
|
10
|
+
if (isNotNullOrUndefined((_a = token.value) === null || _a === void 0 ? void 0 : _a.value)) {
|
|
11
|
+
return [token.value.value];
|
|
12
|
+
}
|
|
13
|
+
if (isNullOrUndefined(token.values) || token.values.length === 0) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const values = [];
|
|
17
|
+
for (const val of token.values) {
|
|
18
|
+
if (val && val.value) {
|
|
19
|
+
values.push(val.value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return values;
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/bwell-sdk-ts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"description": "b.well TypeScript SDK",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"directory": "bwell-sdk-typescript"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "npm run generate && tsc --project tsconfig.build.json",
|
|
21
|
+
"build": "npm run generate:v2 && tsc --project tsconfig.build.json",
|
|
22
22
|
"build:dev": "tsc --project tsconfig.build.json",
|
|
23
23
|
"clean": "rimraf ./dist",
|
|
24
24
|
"coverage": "open ./coverage/lcov-report/index.html",
|
|
@@ -26,10 +26,13 @@
|
|
|
26
26
|
"format:check": "prettier . --check",
|
|
27
27
|
"gen:clean": "rimraf ./src/graphql",
|
|
28
28
|
"generate": "npm run generate:sdl && npm run generate:types && npm run generate:version",
|
|
29
|
-
"generate:
|
|
29
|
+
"generate:v2": "npm run generate:sdl:v2 && npm run generate:types && npm run generate:version",
|
|
30
|
+
"generate:docs:html": "typedoc --options typedoc/typedoc.html.mjs",
|
|
31
|
+
"generate:docs:readme": "typedoc --options typedoc/typedoc.readme.mjs",
|
|
30
32
|
"generate:types": "graphql-codegen --config ./codegen/codegen.ts",
|
|
31
33
|
"generate:version": "node ./scripts/generate-version-file.js",
|
|
32
34
|
"generate:sdl": "npm run --prefix ../graphql generate:sdl",
|
|
35
|
+
"generate:sdl:v2": "npm run --prefix ../graphql generate:sdl:v2",
|
|
33
36
|
"lint": "eslint .",
|
|
34
37
|
"prebuild": "npm run clean",
|
|
35
38
|
"prettier": "prettier",
|
|
@@ -52,32 +55,33 @@
|
|
|
52
55
|
"@opentelemetry/sdk-logs": "^0.52.1",
|
|
53
56
|
"@opentelemetry/sdk-trace-web": "^1.25.1",
|
|
54
57
|
"@opentelemetry/semantic-conventions": "^1.25.1",
|
|
55
|
-
"graphql-request": "^
|
|
58
|
+
"graphql-request": "^7.0.0"
|
|
56
59
|
},
|
|
57
60
|
"devDependencies": {
|
|
58
|
-
"@eslint/js": "^9.
|
|
59
|
-
"@graphql-codegen/cli": "^5.0.
|
|
60
|
-
"@graphql-codegen/import-types-preset": "^3.0.
|
|
61
|
-
"@graphql-codegen/typescript": "^4.
|
|
62
|
-
"@graphql-codegen/typescript-generic-sdk": "^4.0.
|
|
63
|
-
"@graphql-codegen/typescript-graphql-request": "^6.
|
|
64
|
-
"@graphql-codegen/typescript-operations": "^4.
|
|
65
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.
|
|
66
|
-
"@types/jest": "^
|
|
67
|
-
"eslint": "^9.
|
|
68
|
-
"eslint-config-prettier": "^
|
|
61
|
+
"@eslint/js": "^9.30.1",
|
|
62
|
+
"@graphql-codegen/cli": "^5.0.7",
|
|
63
|
+
"@graphql-codegen/import-types-preset": "^3.0.1",
|
|
64
|
+
"@graphql-codegen/typescript": "^4.1.6",
|
|
65
|
+
"@graphql-codegen/typescript-generic-sdk": "^4.0.2",
|
|
66
|
+
"@graphql-codegen/typescript-graphql-request": "^6.3.0",
|
|
67
|
+
"@graphql-codegen/typescript-operations": "^4.6.1",
|
|
68
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.5.1",
|
|
69
|
+
"@types/jest": "^30.0.0",
|
|
70
|
+
"eslint": "^9.30.1",
|
|
71
|
+
"eslint-config-prettier": "^10.1.5",
|
|
69
72
|
"eslint-plugin-sonarjs": "^1.0.4",
|
|
70
73
|
"globals": "^15.9.0",
|
|
71
74
|
"graphql-codegen-typescript-mock-data": "^3.8.0",
|
|
72
75
|
"jest": "^29.7.0",
|
|
73
76
|
"jest-environment-jsdom": "^29.7.0",
|
|
74
|
-
"prettier": "^3.
|
|
77
|
+
"prettier": "^3.6.2",
|
|
75
78
|
"rimraf": "^5.0.10",
|
|
76
79
|
"ts-jest": "^29.2.4",
|
|
77
|
-
"
|
|
78
|
-
"typedoc": "^
|
|
79
|
-
"
|
|
80
|
-
"typescript
|
|
80
|
+
"typedoc": "^0.28.7",
|
|
81
|
+
"typedoc-plugin-frontmatter": "^1.3.0",
|
|
82
|
+
"typedoc-plugin-markdown": "^4.7.0",
|
|
83
|
+
"typescript": "^5.8.3",
|
|
84
|
+
"typescript-eslint": "^8.36.0"
|
|
81
85
|
},
|
|
82
86
|
"lint-staged": {
|
|
83
87
|
"*.{js,ts}": "eslint --cache",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TaskStatus as GraphQLTaskStatus } from "../../../graphql/schema.js";
|
|
2
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
3
|
-
import { TaskStatus } from "./types.js";
|
|
4
|
-
export type UpdateTaskStatusRequestInput = {
|
|
5
|
-
taskId: string;
|
|
6
|
-
newStatus: TaskStatus;
|
|
7
|
-
};
|
|
8
|
-
type UpdateTaskStatusRequestData = {
|
|
9
|
-
taskId: string;
|
|
10
|
-
newStatus: GraphQLTaskStatus;
|
|
11
|
-
};
|
|
12
|
-
export declare class UpdateTaskStatusRequestValidator implements Validator<UpdateTaskStatusRequestInput> {
|
|
13
|
-
validate(data: UpdateTaskStatusRequestInput, errors: ErrorsCollector): void;
|
|
14
|
-
}
|
|
15
|
-
export declare class UpdateTaskStatusRequest extends ValidationRequest<UpdateTaskStatusRequestInput, UpdateTaskStatusRequestData> {
|
|
16
|
-
protected validator: Validator<UpdateTaskStatusRequestInput>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isValidTaskStatus } from "./types.js";
|
|
3
|
-
export class UpdateTaskStatusRequestValidator {
|
|
4
|
-
validate(data, errors) {
|
|
5
|
-
if (!isValidTaskStatus(data.newStatus)) {
|
|
6
|
-
errors.add(`Invalid task status: "${data.newStatus}"`);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export class UpdateTaskStatusRequest extends ValidationRequest {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.validator = new UpdateTaskStatusRequestValidator();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PublishEventMutationResults } from "../../../graphql/operations/types.js";
|
|
2
|
-
import type { BWellTransactionResult } from "../../../results/index.js";
|
|
3
|
-
import { BaseManagerError } from "../errors.js";
|
|
4
|
-
import { HandleNotificationRequest } from "./event-request.js";
|
|
5
|
-
export type HandleNotificationResults = PublishEventMutationResults["publishEvent"];
|
|
6
|
-
/**
|
|
7
|
-
* The EventManager interface provides a method for marking a notification as read.
|
|
8
|
-
*/
|
|
9
|
-
export interface EventManager {
|
|
10
|
-
/**
|
|
11
|
-
* Handles a notification event. This is used to track when a user opens a push notification.
|
|
12
|
-
* @param request The request to handle the notification. This takes a string parameter representing the serialized notification.
|
|
13
|
-
* @returns A promise that resolves to a transaction result with the results of the operation.
|
|
14
|
-
*/
|
|
15
|
-
handleNotification(request: HandleNotificationRequest): Promise<BWellTransactionResult<HandleNotificationResults, BaseManagerError>>;
|
|
16
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
2
|
-
export type EventRequestInput = {
|
|
3
|
-
serializedNotification: string;
|
|
4
|
-
};
|
|
5
|
-
export type IterableNotification = {
|
|
6
|
-
notification_id: string;
|
|
7
|
-
itbl: {
|
|
8
|
-
messageId: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare const SERIALIZED_NOTIFICATION_ERROR = "string parameter serializedNotification must be provided";
|
|
12
|
-
export declare const NOTIFICATION_ID_ERROR = "serialized notification must have a non-empty notification_id field of type string";
|
|
13
|
-
export declare const ITBL_ERROR = "serialized notification must have an itbl object containing a non-empty messageId field of type string";
|
|
14
|
-
export declare const NOT_AN_OBJECT_ERROR = "parsed notification must be a non-null object.";
|
|
15
|
-
export declare const INVALID_JSON_ERROR = "serialized notification is not valid JSON.";
|
|
16
|
-
/**
|
|
17
|
-
* Validator for event requests.
|
|
18
|
-
*/
|
|
19
|
-
export declare class EventRequestValidator implements Validator<EventRequestInput> {
|
|
20
|
-
/**
|
|
21
|
-
* Validates the serializedNotification property.
|
|
22
|
-
* @param data The data to validate.
|
|
23
|
-
* @param errors The collector for errors.
|
|
24
|
-
*/
|
|
25
|
-
validate(data: EventRequestInput, errors: ErrorsCollector): void;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Base request object for handling notifications.
|
|
29
|
-
* This request is used to track when a user opens a push notification.
|
|
30
|
-
* The request takes a string parameter representing the serialized notification.
|
|
31
|
-
* @extends ValidationRequest
|
|
32
|
-
*/
|
|
33
|
-
export declare class HandleNotificationRequest extends ValidationRequest<EventRequestInput, EventRequestInput> {
|
|
34
|
-
protected validator: EventRequestValidator;
|
|
35
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isBlank, isNullOrUndefined, isUndefined, } from "../../../utils/index.js";
|
|
3
|
-
export const SERIALIZED_NOTIFICATION_ERROR = "string parameter serializedNotification must be provided";
|
|
4
|
-
export const NOTIFICATION_ID_ERROR = "serialized notification must have a non-empty notification_id field of type string";
|
|
5
|
-
export const ITBL_ERROR = "serialized notification must have an itbl object containing a non-empty messageId field of type string";
|
|
6
|
-
export const NOT_AN_OBJECT_ERROR = "parsed notification must be a non-null object.";
|
|
7
|
-
export const INVALID_JSON_ERROR = "serialized notification is not valid JSON.";
|
|
8
|
-
/**
|
|
9
|
-
* Validator for event requests.
|
|
10
|
-
*/
|
|
11
|
-
export class EventRequestValidator {
|
|
12
|
-
/**
|
|
13
|
-
* Validates the serializedNotification property.
|
|
14
|
-
* @param data The data to validate.
|
|
15
|
-
* @param errors The collector for errors.
|
|
16
|
-
*/
|
|
17
|
-
validate(data, errors) {
|
|
18
|
-
if (isUndefined(data.serializedNotification) ||
|
|
19
|
-
typeof data.serializedNotification !== "string" ||
|
|
20
|
-
isBlank(data.serializedNotification)) {
|
|
21
|
-
errors.add(SERIALIZED_NOTIFICATION_ERROR);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
let notification = null;
|
|
25
|
-
try {
|
|
26
|
-
notification = JSON.parse(data.serializedNotification);
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
errors.add(INVALID_JSON_ERROR);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (typeof notification !== "object" || notification === null) {
|
|
33
|
-
errors.add(NOT_AN_OBJECT_ERROR);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const { itbl, notification_id } = notification;
|
|
37
|
-
if (isUndefined(notification_id) ||
|
|
38
|
-
typeof notification_id !== "string" ||
|
|
39
|
-
isBlank(notification_id)) {
|
|
40
|
-
errors.add(NOTIFICATION_ID_ERROR);
|
|
41
|
-
}
|
|
42
|
-
if (typeof itbl !== "object" || isNullOrUndefined(itbl)) {
|
|
43
|
-
errors.add(ITBL_ERROR);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (isUndefined(itbl.messageId) ||
|
|
47
|
-
typeof itbl.messageId !== "string" ||
|
|
48
|
-
isBlank(itbl.messageId)) {
|
|
49
|
-
errors.add(ITBL_ERROR);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Base request object for handling notifications.
|
|
55
|
-
* This request is used to track when a user opens a push notification.
|
|
56
|
-
* The request takes a string parameter representing the serialized notification.
|
|
57
|
-
* @extends ValidationRequest
|
|
58
|
-
*/
|
|
59
|
-
export class HandleNotificationRequest extends ValidationRequest {
|
|
60
|
-
constructor() {
|
|
61
|
-
super(...arguments);
|
|
62
|
-
this.validator = new EventRequestValidator();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HandleNotificationRequest, } from "./event-request.js";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
2
|
-
export type MedicationPricingRequestInput = {
|
|
3
|
-
medicationStatementId: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Validator for medication pricing requests.
|
|
7
|
-
*/
|
|
8
|
-
export declare class MedicationPricingRequestValidator implements Validator<MedicationPricingRequestInput> {
|
|
9
|
-
/**
|
|
10
|
-
* Validates the paged request properties, as well as the medication statement id.
|
|
11
|
-
* @param data
|
|
12
|
-
* @param errors
|
|
13
|
-
*/
|
|
14
|
-
validate(data: MedicationPricingRequestInput, errors: ErrorsCollector): void;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Request object for fetching medication pricing data.
|
|
18
|
-
*/
|
|
19
|
-
export declare class MedicationPricingRequest extends ValidationRequest<MedicationPricingRequestInput> {
|
|
20
|
-
protected validator: MedicationPricingRequestValidator;
|
|
21
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isBlank } from "../../../utils/string-utils.js";
|
|
3
|
-
/**
|
|
4
|
-
* Validator for medication pricing requests.
|
|
5
|
-
*/
|
|
6
|
-
export class MedicationPricingRequestValidator {
|
|
7
|
-
/**
|
|
8
|
-
* Validates the paged request properties, as well as the medication statement id.
|
|
9
|
-
* @param data
|
|
10
|
-
* @param errors
|
|
11
|
-
*/
|
|
12
|
-
validate(data, errors) {
|
|
13
|
-
if (isBlank(data.medicationStatementId)) {
|
|
14
|
-
errors.add("The medication pricing request must possess a medication statement id.");
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Request object for fetching medication pricing data.
|
|
20
|
-
*/
|
|
21
|
-
export class MedicationPricingRequest extends ValidationRequest {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(...arguments);
|
|
24
|
-
this.validator = new MedicationPricingRequestValidator();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Enum representing possible statuses for updating a medication statement.
|
|
4
|
-
*/
|
|
5
|
-
export declare enum UpdateMedicationStatementStatus {
|
|
6
|
-
Active = "ACTIVE",
|
|
7
|
-
Completed = "COMPLETED"
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Input type for updating a medication statement.
|
|
11
|
-
* - `id`: The unique identifier of the medication statement.
|
|
12
|
-
* - `status`: The new status to set for the medication statement.
|
|
13
|
-
*/
|
|
14
|
-
export type UpdateMedicationStatementInput = {
|
|
15
|
-
id: string;
|
|
16
|
-
status?: UpdateMedicationStatementStatus;
|
|
17
|
-
};
|
|
18
|
-
/**
|
|
19
|
-
* Validator for update medication statement requests.
|
|
20
|
-
*/
|
|
21
|
-
export declare class UpdateMedicationStatementRequestValidator implements Validator<UpdateMedicationStatementInput> {
|
|
22
|
-
validate(data: UpdateMedicationStatementInput, errors: ErrorsCollector): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Request object for updating medication statement.
|
|
26
|
-
*/
|
|
27
|
-
export declare class UpdateMedicationStatementRequest extends ValidationRequest<UpdateMedicationStatementInput> {
|
|
28
|
-
protected validator: UpdateMedicationStatementRequestValidator;
|
|
29
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isNullOrUndefined, isNullOrUndefinedOrEmptyString, } from "../../../utils/index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Enum representing possible statuses for updating a medication statement.
|
|
5
|
-
*/
|
|
6
|
-
export var UpdateMedicationStatementStatus;
|
|
7
|
-
(function (UpdateMedicationStatementStatus) {
|
|
8
|
-
UpdateMedicationStatementStatus["Active"] = "ACTIVE";
|
|
9
|
-
UpdateMedicationStatementStatus["Completed"] = "COMPLETED";
|
|
10
|
-
})(UpdateMedicationStatementStatus || (UpdateMedicationStatementStatus = {}));
|
|
11
|
-
/**
|
|
12
|
-
* Validator for update medication statement requests.
|
|
13
|
-
*/
|
|
14
|
-
export class UpdateMedicationStatementRequestValidator {
|
|
15
|
-
validate(data, errors) {
|
|
16
|
-
if (isNullOrUndefined(data)) {
|
|
17
|
-
errors.add("input must be provided.");
|
|
18
|
-
}
|
|
19
|
-
if (isNullOrUndefinedOrEmptyString(data.id)) {
|
|
20
|
-
errors.add("id must be a non-empty string.");
|
|
21
|
-
}
|
|
22
|
-
if (isNullOrUndefined(data.status)) {
|
|
23
|
-
errors.add("status is required.");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Request object for updating medication statement.
|
|
29
|
-
*/
|
|
30
|
-
export class UpdateMedicationStatementRequest extends ValidationRequest {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments);
|
|
33
|
-
this.validator = new UpdateMedicationStatementRequestValidator();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, ValidationRequest } from "../../../requests/index.js";
|
|
2
|
-
import { UpdateCareTeamMemberInput } from "./update-care-team-member-request.js";
|
|
3
|
-
/**
|
|
4
|
-
* Input type for adding a single care team member.
|
|
5
|
-
*/
|
|
6
|
-
export type AddCareTeamMemberInput = UpdateCareTeamMemberInput;
|
|
7
|
-
/**
|
|
8
|
-
* Validator class for adding a single care team member.
|
|
9
|
-
* This class reuses the UpdateCareTeamMemberRequestValidator validation logic with required roles.
|
|
10
|
-
*/
|
|
11
|
-
declare class AddCareTeamMemberRequestValidator {
|
|
12
|
-
private updateValidator;
|
|
13
|
-
/**
|
|
14
|
-
* Validates the provided `AddCareTeamMemberInput` data with roles required.
|
|
15
|
-
*
|
|
16
|
-
* @param data - The input data to validate, containing member details to add.
|
|
17
|
-
* @param errors - An instance of `ErrorsCollector` to collect validation errors.
|
|
18
|
-
*/
|
|
19
|
-
validate(data: AddCareTeamMemberInput, errors: ErrorsCollector): void;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Represents a request for adding a single care team member.
|
|
23
|
-
* This class reuses the validation logic from UpdateCareTeamMemberRequest.
|
|
24
|
-
*
|
|
25
|
-
* @extends ValidationRequest<AddCareTeamMemberInput>
|
|
26
|
-
* @category Requests
|
|
27
|
-
* @title AddCareTeamMemberRequest
|
|
28
|
-
* @excerpt Request class for adding a single care team member
|
|
29
|
-
*/
|
|
30
|
-
export declare class AddCareTeamMemberRequest extends ValidationRequest<AddCareTeamMemberInput> {
|
|
31
|
-
protected validator: AddCareTeamMemberRequestValidator;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest } from "../../../requests/index.js";
|
|
2
|
-
import { UpdateCareTeamMemberRequestValidator, } from "./update-care-team-member-request.js";
|
|
3
|
-
/**
|
|
4
|
-
* Validator class for adding a single care team member.
|
|
5
|
-
* This class reuses the UpdateCareTeamMemberRequestValidator validation logic with required roles.
|
|
6
|
-
*/
|
|
7
|
-
class AddCareTeamMemberRequestValidator {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.updateValidator = new UpdateCareTeamMemberRequestValidator();
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Validates the provided `AddCareTeamMemberInput` data with roles required.
|
|
13
|
-
*
|
|
14
|
-
* @param data - The input data to validate, containing member details to add.
|
|
15
|
-
* @param errors - An instance of `ErrorsCollector` to collect validation errors.
|
|
16
|
-
*/
|
|
17
|
-
validate(data, errors) {
|
|
18
|
-
// For add operations, role is required
|
|
19
|
-
this.updateValidator.validate(data, errors, { requireRole: true });
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Represents a request for adding a single care team member.
|
|
24
|
-
* This class reuses the validation logic from UpdateCareTeamMemberRequest.
|
|
25
|
-
*
|
|
26
|
-
* @extends ValidationRequest<AddCareTeamMemberInput>
|
|
27
|
-
* @category Requests
|
|
28
|
-
* @title AddCareTeamMemberRequest
|
|
29
|
-
* @excerpt Request class for adding a single care team member
|
|
30
|
-
*/
|
|
31
|
-
export class AddCareTeamMemberRequest extends ValidationRequest {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
this.validator = new AddCareTeamMemberRequestValidator();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, ValidationRequest } from "../../../requests/index.js";
|
|
2
|
-
import { AddCareTeamMemberInput } from "./add-care-team-member-request.js";
|
|
3
|
-
/**
|
|
4
|
-
* Input type for adding multiple care team members.
|
|
5
|
-
*/
|
|
6
|
-
export type AddCareTeamMembersInput = {
|
|
7
|
-
/** Array of care team members to add */
|
|
8
|
-
members: AddCareTeamMemberInput[];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Validator class for adding multiple care team members.
|
|
12
|
-
* This class reuses the UpdateCareTeamMemberRequestValidator for each member.
|
|
13
|
-
*/
|
|
14
|
-
declare class AddCareTeamMembersRequestValidator {
|
|
15
|
-
private updateValidator;
|
|
16
|
-
/**
|
|
17
|
-
* Validates the provided `AddCareTeamMembersInput` data by validating each member individually.
|
|
18
|
-
*
|
|
19
|
-
* @param data - The input data to validate, containing an array of members to add.
|
|
20
|
-
* @param errors - An instance of `ErrorsCollector` to collect validation errors.
|
|
21
|
-
*/
|
|
22
|
-
validate(data: AddCareTeamMembersInput, errors: ErrorsCollector): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Represents a request for adding multiple care team members.
|
|
26
|
-
*
|
|
27
|
-
* @extends ValidationRequest<AddCareTeamMembersInput>
|
|
28
|
-
* @category Requests
|
|
29
|
-
* @title AddCareTeamMembersRequest
|
|
30
|
-
* @excerpt Request class for adding multiple care team members
|
|
31
|
-
*/
|
|
32
|
-
export declare class AddCareTeamMembersRequest extends ValidationRequest<AddCareTeamMembersInput> {
|
|
33
|
-
protected validator: AddCareTeamMembersRequestValidator;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { ValidationErrorsCollector, ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isNotNullOrUndefined } from "../../../utils/type-utils.js";
|
|
3
|
-
import { UpdateCareTeamMemberRequestValidator } from "./update-care-team-member-request.js";
|
|
4
|
-
/**
|
|
5
|
-
* Validator class for adding multiple care team members.
|
|
6
|
-
* This class reuses the UpdateCareTeamMemberRequestValidator for each member.
|
|
7
|
-
*/
|
|
8
|
-
class AddCareTeamMembersRequestValidator {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.updateValidator = new UpdateCareTeamMemberRequestValidator();
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Validates the provided `AddCareTeamMembersInput` data by validating each member individually.
|
|
14
|
-
*
|
|
15
|
-
* @param data - The input data to validate, containing an array of members to add.
|
|
16
|
-
* @param errors - An instance of `ErrorsCollector` to collect validation errors.
|
|
17
|
-
*/
|
|
18
|
-
validate(data, errors) {
|
|
19
|
-
// Validate members array is provided
|
|
20
|
-
if (!isNotNullOrUndefined(data.members)) {
|
|
21
|
-
errors.add("Members array is required");
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (data.members.length === 0) {
|
|
25
|
-
errors.add("Members array cannot be empty");
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// Validate each member using the update validator
|
|
29
|
-
for (let memberIndex = 0; memberIndex < data.members.length; memberIndex++) {
|
|
30
|
-
const member = data.members[memberIndex];
|
|
31
|
-
if (!isNotNullOrUndefined(member)) {
|
|
32
|
-
errors.add(`Member ${memberIndex}: Cannot be null or undefined`);
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
// Create a sub-errors collector to prefix errors with member index
|
|
36
|
-
const memberErrors = new ValidationErrorsCollector();
|
|
37
|
-
// For add operations, each member must include a role
|
|
38
|
-
this.updateValidator.validate(member, memberErrors, {
|
|
39
|
-
requireRole: true,
|
|
40
|
-
});
|
|
41
|
-
// Add member-specific errors with prefix
|
|
42
|
-
for (const errorMessage of memberErrors.errors()) {
|
|
43
|
-
errors.add(`Member ${memberIndex}: ${errorMessage}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Represents a request for adding multiple care team members.
|
|
50
|
-
*
|
|
51
|
-
* @extends ValidationRequest<AddCareTeamMembersInput>
|
|
52
|
-
* @category Requests
|
|
53
|
-
* @title AddCareTeamMembersRequest
|
|
54
|
-
* @excerpt Request class for adding multiple care team members
|
|
55
|
-
*/
|
|
56
|
-
export class AddCareTeamMembersRequest extends ValidationRequest {
|
|
57
|
-
constructor() {
|
|
58
|
-
super(...arguments);
|
|
59
|
-
this.validator = new AddCareTeamMembersRequestValidator();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SearchReference } from "../../../graphql/schema.js";
|
|
2
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
3
|
-
export type CancelationReasonsRequestInput = {
|
|
4
|
-
organization: SearchReference;
|
|
5
|
-
};
|
|
6
|
-
/**
|
|
7
|
-
* Validator for CancelationReasonsRequestInput.
|
|
8
|
-
* Ensures that organization is present and has a non-empty value.
|
|
9
|
-
*/
|
|
10
|
-
declare class CancelationReasonsRequestValidator implements Validator<CancelationReasonsRequestInput> {
|
|
11
|
-
validate(data: CancelationReasonsRequestInput, errors: ErrorsCollector): void;
|
|
12
|
-
}
|
|
13
|
-
export declare class CancelationReasonsRequest extends ValidationRequest<CancelationReasonsRequestInput> {
|
|
14
|
-
protected validator: CancelationReasonsRequestValidator;
|
|
15
|
-
}
|
|
16
|
-
export {};
|