@icanbwell/bwell-sdk-ts 1.55.0 → 1.56.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 +3 -19
- 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 +1 -2
- package/dist/api/base/activity/activity-manager.d.ts +25 -18
- package/dist/api/base/activity/get-tasks-request.d.ts +49 -29
- package/dist/api/base/activity/get-tasks-request.js +15 -42
- package/dist/api/base/activity/index.d.ts +4 -2
- package/dist/api/base/activity/index.js +1 -0
- package/dist/api/base/activity/types.d.ts +3 -0
- package/dist/api/base/activity/types.js +5 -0
- package/dist/api/base/activity/update-task-status-request.d.ts +18 -0
- package/dist/api/base/activity/update-task-status-request.js +15 -0
- package/dist/api/base/api-provider.d.ts +14 -12
- package/dist/api/base/connection/connection-manager.d.ts +51 -68
- package/dist/api/base/connection/connection-manager.js +0 -3
- package/dist/api/base/connection/connection-request.d.ts +1 -15
- package/dist/api/base/connection/connection-request.js +0 -8
- package/dist/api/base/connection/index.d.ts +1 -1
- package/dist/api/base/device/device-manager.d.ts +12 -34
- package/dist/api/base/device/device-manager.js +5 -1
- package/dist/api/base/device/device-request.d.ts +42 -35
- package/dist/api/base/device/device-request.js +42 -30
- package/dist/api/base/device/index.d.ts +2 -2
- package/dist/api/base/device/index.js +2 -2
- package/dist/api/base/event/event-manager.d.ts +16 -0
- package/dist/api/base/event/event-request.d.ts +35 -0
- package/dist/api/base/event/event-request.js +64 -0
- package/dist/api/base/event/index.d.ts +2 -0
- package/dist/api/base/event/index.js +1 -0
- package/dist/api/base/financial/coverage-request.d.ts +6 -5
- package/dist/api/base/financial/coverage-request.js +7 -7
- package/dist/api/base/financial/{explanation-of-benefit-request.d.ts → explanation-of-benefit.d.ts} +9 -15
- package/dist/api/base/financial/{explanation-of-benefit-request.js → explanation-of-benefit.js} +18 -8
- package/dist/api/base/financial/financial-manager.d.ts +14 -46
- package/dist/api/base/financial/index.d.ts +2 -3
- package/dist/api/base/financial/index.js +2 -2
- package/dist/api/base/health-data/health-data-request.d.ts +8 -116
- package/dist/api/base/health-data/health-data-request.js +2 -83
- package/dist/api/base/health-data/health-manager.d.ts +243 -293
- package/dist/api/base/health-data/index.d.ts +3 -2
- package/dist/api/base/health-data/index.js +2 -0
- package/dist/api/base/health-data/lab-knowledge-request.d.ts +0 -9
- package/dist/api/base/health-data/lab-knowledge-request.js +0 -3
- package/dist/api/base/health-data/medication-knowledge-request.d.ts +0 -9
- package/dist/api/base/health-data/medication-knowledge-request.js +0 -3
- package/dist/api/base/health-data/medication-pricing-request.d.ts +21 -0
- package/dist/api/base/health-data/medication-pricing-request.js +26 -0
- package/dist/api/base/health-data/medication-statement-request.d.ts +29 -0
- package/dist/api/base/health-data/medication-statement-request.js +35 -0
- package/dist/api/base/health-space/add-care-team-member-request.d.ts +33 -0
- package/dist/api/base/health-space/add-care-team-member-request.js +36 -0
- package/dist/api/base/health-space/add-care-team-members-request.d.ts +35 -0
- package/dist/api/base/health-space/add-care-team-members-request.js +61 -0
- package/dist/api/base/health-space/appointments-request.d.ts +0 -9
- package/dist/api/base/health-space/appointments-request.js +0 -3
- package/dist/api/base/health-space/cancel-appointment-request.d.ts +1 -8
- package/dist/api/base/health-space/cancel-appointment-request.js +0 -4
- package/dist/api/base/health-space/cancelationReasons-request.d.ts +16 -0
- package/dist/api/base/health-space/{cancellation-reasons-request.js → cancelationReasons-request.js} +4 -10
- package/dist/api/base/health-space/care-team-members-request.d.ts +31 -0
- package/dist/api/base/health-space/care-team-members-request.js +33 -0
- package/dist/api/base/health-space/health-space-manager.d.ts +116 -29
- package/dist/api/base/health-space/index.d.ts +7 -2
- package/dist/api/base/health-space/index.js +6 -1
- package/dist/api/base/health-space/remove-care-team-member-request.d.ts +34 -0
- package/dist/api/base/health-space/remove-care-team-member-request.js +36 -0
- package/dist/api/base/health-space/update-care-team-member-request.d.ts +55 -0
- package/dist/api/base/health-space/update-care-team-member-request.js +71 -0
- package/dist/api/base/identity/identity-manager.d.ts +11 -98
- package/dist/api/base/index.d.ts +3 -1
- package/dist/api/base/index.js +3 -2
- package/dist/api/base/questionnaire/index.d.ts +4 -1
- package/dist/api/base/questionnaire/index.js +3 -0
- package/dist/api/base/questionnaire/next-question-request.d.ts +2 -8
- package/dist/api/base/questionnaire/next-question-request.js +1 -4
- package/dist/api/base/questionnaire/questionnaire-manager.d.ts +42 -24
- package/dist/api/base/questionnaire/questionnaire-responses-request.d.ts +30 -0
- package/dist/api/base/questionnaire/questionnaire-responses-request.js +49 -0
- package/dist/api/base/questionnaire/questionnaires-request.d.ts +18 -0
- package/dist/api/base/questionnaire/questionnaires-request.js +42 -0
- package/dist/api/base/questionnaire/save-questionnaire-response-request.d.ts +22 -0
- package/dist/api/base/questionnaire/save-questionnaire-response-request.js +33 -0
- package/dist/api/base/requests/index.d.ts +0 -2
- package/dist/api/base/requests/search-date.d.ts +0 -12
- package/dist/api/base/requests/search-reference.d.ts +1 -9
- package/dist/api/base/requests/search-string.d.ts +0 -6
- package/dist/api/base/requests/search-token.d.ts +0 -18
- package/dist/api/base/requests/search-token.js +17 -17
- package/dist/api/base/search/index.d.ts +5 -3
- package/dist/api/base/search/index.js +3 -1
- package/dist/api/base/search/request-connection-request.d.ts +24 -0
- package/dist/api/base/search/request-connection-request.js +3 -0
- package/dist/api/base/search/search-health-resources-request.d.ts +44 -33
- package/dist/api/base/search/search-health-resources-request.js +0 -3
- package/dist/api/base/search/search-manager.d.ts +42 -39
- package/dist/api/base/search/search-request.d.ts +84 -0
- package/dist/api/base/search/search-request.js +78 -0
- package/dist/api/base/support/create-support-comment-request.d.ts +13 -0
- package/dist/api/base/support/create-support-comment-request.js +18 -0
- package/dist/api/base/support/create-support-request-request.d.ts +22 -0
- package/dist/api/base/support/create-support-request-request.js +20 -0
- package/dist/api/base/support/delete-support-attachment-request.d.ts +11 -0
- package/dist/api/base/support/delete-support-attachment-request.js +14 -0
- package/dist/api/base/support/get-support-articles-request.d.ts +14 -0
- package/dist/api/base/support/get-support-articles-request.js +12 -0
- package/dist/api/base/support/get-support-attachment-request.d.ts +14 -0
- package/dist/api/base/support/get-support-attachment-request.js +18 -0
- package/dist/api/base/support/get-support-comments-request.d.ts +14 -0
- package/dist/api/base/support/get-support-comments-request.js +15 -0
- package/dist/api/base/support/get-support-requests-request.d.ts +16 -0
- package/dist/api/base/support/get-support-requests-request.js +14 -0
- package/dist/api/base/support/index.d.ts +9 -0
- package/dist/api/base/support/index.js +9 -0
- package/dist/api/base/support/support-manager.d.ts +78 -0
- package/dist/api/base/support/upload-support-attachment-request.d.ts +25 -0
- package/dist/api/base/support/upload-support-attachment-request.js +27 -0
- package/dist/api/base/user/create-consent-request.d.ts +1 -13
- package/dist/api/base/user/create-consent-request.js +5 -10
- package/dist/api/base/user/create-data-export-direct-download-url-request.d.ts +0 -9
- package/dist/api/base/user/create-data-export-direct-download-url-request.js +0 -3
- package/dist/api/base/user/create-verification-url-request.d.ts +0 -12
- package/dist/api/base/user/create-verification-url-request.js +0 -6
- package/dist/api/base/user/get-consents-request.d.ts +1 -19
- package/dist/api/base/user/get-consents-request.js +1 -13
- package/dist/api/base/user/index.d.ts +2 -1
- package/dist/api/base/user/types.d.ts +9 -0
- package/dist/api/base/user/types.js +17 -0
- package/dist/api/base/user/update-profile-request.d.ts +3 -11
- package/dist/api/base/user/update-profile-request.js +3 -5
- package/dist/api/base/user/user-manager.d.ts +49 -100
- package/dist/api/graphql-api/activity/{get-tasks-request-factory.d.ts → activity-request-factories.d.ts} +7 -0
- package/dist/api/graphql-api/activity/activity-request-factories.js +70 -0
- package/dist/api/graphql-api/activity/graphql-activity-manager.d.ts +8 -6
- package/dist/api/graphql-api/activity/graphql-activity-manager.js +30 -19
- 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/graphql-connection-manager.d.ts +9 -9
- package/dist/api/graphql-api/connection/graphql-connection-manager.js +5 -7
- package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.d.ts +18 -0
- package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.js +40 -0
- package/dist/api/graphql-api/connection/index.d.ts +1 -0
- package/dist/api/graphql-api/connection/index.js +1 -1
- package/dist/api/graphql-api/device/graphql-device-manager.d.ts +1 -2
- package/dist/api/graphql-api/device/graphql-device-manager.js +2 -4
- package/dist/api/graphql-api/errors/errors.js +1 -1
- package/dist/api/graphql-api/event/event-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/event/event-request-factory.js +11 -0
- package/dist/api/graphql-api/event/graphql-event-manager.d.ts +15 -0
- package/dist/api/graphql-api/event/graphql-event-manager.js +65 -0
- package/dist/api/graphql-api/event/index.d.ts +1 -0
- package/dist/api/graphql-api/event/index.js +1 -0
- package/dist/api/graphql-api/financial/graphql-coverages-bwell-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/financial/graphql-coverages-bwell-request-factory.js +17 -0
- package/dist/api/graphql-api/financial/{explanation-of-benefit-request-factory.d.ts → graphql-explanation-of-benefits-factory.d.ts} +3 -3
- package/dist/api/graphql-api/financial/graphql-explanation-of-benefits-factory.js +23 -0
- package/dist/api/graphql-api/financial/graphql-financial-manager.d.ts +12 -4
- package/dist/api/graphql-api/financial/graphql-financial-manager.js +19 -32
- package/dist/api/graphql-api/financial/index.d.ts +1 -3
- package/dist/api/graphql-api/financial/index.js +1 -3
- package/dist/api/graphql-api/graphql-api-provider.d.ts +14 -6
- package/dist/api/graphql-api/graphql-api-provider.js +7 -6
- package/dist/api/graphql-api/health-space/add-care-team-member-request-factory.d.ts +20 -0
- package/dist/api/graphql-api/health-space/add-care-team-member-request-factory.js +29 -0
- package/dist/api/graphql-api/health-space/add-care-team-members-request-factory.d.ts +16 -0
- package/dist/api/graphql-api/health-space/add-care-team-members-request-factory.js +23 -0
- package/dist/api/graphql-api/health-space/cancel-appointment-request-factory.js +2 -1
- package/dist/api/graphql-api/health-space/care-team-factory-utils.d.ts +23 -0
- package/dist/api/graphql-api/health-space/care-team-factory-utils.js +30 -0
- package/dist/api/graphql-api/health-space/care-team-members-request-factory.d.ts +12 -0
- package/dist/api/graphql-api/health-space/care-team-members-request-factory.js +17 -0
- package/dist/api/graphql-api/health-space/graphql-health-space-manager.d.ts +62 -5
- package/dist/api/graphql-api/health-space/graphql-health-space-manager.js +163 -9
- package/dist/api/graphql-api/health-space/index.d.ts +4 -0
- package/dist/api/graphql-api/health-space/index.js +4 -0
- package/dist/api/graphql-api/health-space/remove-care-team-member-request-factory.d.ts +16 -0
- package/dist/api/graphql-api/health-space/remove-care-team-member-request-factory.js +24 -0
- package/dist/api/graphql-api/health-space/update-care-team-member-request-factory.d.ts +16 -0
- package/dist/api/graphql-api/health-space/update-care-team-member-request-factory.js +20 -0
- package/dist/api/graphql-api/healthdata/graphql-diagnostic-reports-bwell-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/healthdata/graphql-diagnostic-reports-bwell-request-factory.js +12 -0
- package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.d.ts +10 -0
- package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.js +35 -0
- package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.d.ts +10 -0
- package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.js +35 -0
- package/dist/api/graphql-api/healthdata/graphql-health-manager.d.ts +41 -30
- package/dist/api/graphql-api/healthdata/graphql-health-manager.js +256 -311
- package/dist/api/graphql-api/healthdata/graphql-update-medication-statement-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/healthdata/graphql-update-medication-statement-request-factory.js +11 -0
- package/dist/api/graphql-api/identity/graphql-identity-manager.d.ts +1 -2
- package/dist/api/graphql-api/identity/graphql-identity-manager.js +3 -5
- package/dist/api/graphql-api/questionnaire/get-questionnaire-responses-request-factory.d.ts +9 -0
- package/dist/api/graphql-api/questionnaire/get-questionnaire-responses-request-factory.js +22 -0
- package/dist/api/graphql-api/questionnaire/get-questionnaires-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/questionnaire/get-questionnaires-request-factory.js +16 -0
- package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.d.ts +22 -4
- package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.js +69 -4
- package/dist/api/graphql-api/questionnaire/index.d.ts +2 -0
- package/dist/api/graphql-api/questionnaire/index.js +2 -0
- package/dist/api/graphql-api/search/connection-search-request-factory.d.ts +7 -0
- package/dist/api/graphql-api/search/connection-search-request-factory.js +21 -0
- package/dist/api/graphql-api/search/graphql-search-manager.d.ts +6 -4
- package/dist/api/graphql-api/search/graphql-search-manager.js +71 -9
- package/dist/api/graphql-api/search/index.d.ts +1 -0
- package/dist/api/graphql-api/search/index.js +1 -0
- package/dist/api/graphql-api/search/provider-search-request-factory.d.ts +7 -0
- package/dist/api/graphql-api/search/provider-search-request-factory.js +21 -0
- package/dist/api/graphql-api/search/request-connection-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/search/{submit-provider-for-review-request-factory.js → request-connection-request-factory.js} +1 -1
- package/dist/api/graphql-api/search/search-health-resources-request-factory.js +11 -12
- package/dist/api/graphql-api/search/search-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/search/search-request-factory.js +44 -0
- package/dist/api/graphql-api/support/create-support-comment-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/create-support-comment-request-factory.js +12 -0
- package/dist/api/graphql-api/support/create-support-request-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/create-support-request-request-factory.js +19 -0
- package/dist/api/graphql-api/support/delete-support-attachment-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/delete-support-attachment-request-factory.js +10 -0
- package/dist/api/graphql-api/support/get-support-articles-bwell-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/get-support-articles-bwell-request-factory.js +15 -0
- package/dist/api/graphql-api/support/get-support-attachment-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/get-support-attachment-request-factory.js +11 -0
- package/dist/api/graphql-api/support/get-support-comments-bwell-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/get-support-comments-bwell-request-factory.js +14 -0
- package/dist/api/graphql-api/support/get-support-requests-bwell-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/get-support-requests-bwell-request-factory.js +16 -0
- package/dist/api/graphql-api/support/graphql-support-manager.d.ts +28 -0
- package/dist/api/graphql-api/support/graphql-support-manager.js +210 -0
- package/dist/api/graphql-api/support/index.d.ts +1 -0
- package/dist/api/graphql-api/support/index.js +1 -0
- package/dist/api/graphql-api/support/upload-support-attachment-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/support/upload-support-attachment-request-factory.js +11 -0
- package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.d.ts +6 -0
- package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.js +9 -0
- package/dist/api/graphql-api/user/get-consent-request-factory.d.ts +2 -1
- package/dist/api/graphql-api/user/get-consent-request-factory.js +1 -5
- package/dist/api/graphql-api/user/graphql-user-manager.d.ts +11 -10
- package/dist/api/graphql-api/user/graphql-user-manager.js +10 -11
- package/dist/api/graphql-api/user/update-profile-request-factory.js +2 -1
- package/dist/api/identity-manager-factory.js +1 -1
- package/dist/auth/auth-code-strategy.d.ts +1 -2
- 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 +1 -2
- package/dist/auth/username-password-strategy.d.ts +1 -2
- package/dist/auth/username-password-strategy.js +2 -2
- package/dist/bwell-sdk/bwell-sdk.d.ts +48 -319
- package/dist/bwell-sdk/bwell-sdk.js +53 -368
- package/dist/config/bwell-config.d.ts +12 -12
- package/dist/config/bwell-config.js +5 -2
- package/dist/config/sdk-config.d.ts +3 -2
- package/dist/config/sdk-config.js +6 -4
- package/dist/errors/authentication-error.d.ts +0 -7
- package/dist/errors/authentication-error.js +0 -7
- package/dist/errors/bwell-error.d.ts +2 -12
- package/dist/errors/bwell-error.js +2 -5
- package/dist/errors/illegal-argument-error.d.ts +0 -7
- package/dist/errors/illegal-argument-error.js +0 -7
- package/dist/errors/illegal-state-error.d.ts +0 -7
- package/dist/errors/illegal-state-error.js +0 -7
- package/dist/errors/invalid-client-key-error.d.ts +0 -7
- package/dist/errors/invalid-client-key-error.js +0 -7
- package/dist/errors/invalid-credentials-type-error.d.ts +0 -7
- package/dist/errors/invalid-credentials-type-error.js +0 -7
- package/dist/errors/invalid-token-error.d.ts +1 -4
- package/dist/errors/invalid-token-error.js +1 -4
- package/dist/errors/network-error.d.ts +0 -7
- package/dist/errors/network-error.js +0 -7
- package/dist/errors/operation-outcome-error.d.ts +1 -8
- package/dist/errors/operation-outcome-error.js +0 -7
- package/dist/errors/unknown-error.d.ts +0 -7
- package/dist/errors/unknown-error.js +0 -7
- package/dist/errors/validation-error.d.ts +0 -7
- package/dist/errors/validation-error.js +0 -7
- package/dist/graphql/operations/index.d.ts +315 -116
- package/dist/graphql/operations/index.js +2235 -1815
- package/dist/graphql/operations/types.d.ts +17800 -15757
- package/dist/graphql/schema.d.ts +5904 -68232
- package/dist/graphql/schema.js +484 -1
- package/dist/index.d.ts +5 -7
- package/dist/index.js +4 -5
- package/dist/language/language-manager.d.ts +10 -25
- package/dist/language/language-manager.js +0 -5
- package/dist/models/coding.d.ts +5 -0
- package/dist/models/fhir-error.d.ts +9 -0
- package/dist/models/index.d.ts +4 -12
- package/dist/models/index.js +4 -12
- package/dist/models/user.d.ts +4 -0
- package/dist/requests/paged-request.d.ts +0 -35
- package/dist/requests/paged-request.js +0 -22
- package/dist/requests/request.d.ts +0 -16
- package/dist/requests/request.js +0 -8
- package/dist/requests/validator.d.ts +0 -15
- package/dist/requests/validator.js +0 -7
- package/dist/results/bwell-query-result.d.ts +0 -5
- package/dist/results/bwell-query-result.js +0 -5
- package/dist/results/bwell-transaction-result.d.ts +3 -17
- package/dist/results/bwell-transaction-result.js +1 -15
- package/dist/results/index.d.ts +0 -1
- package/dist/results/index.js +0 -1
- package/dist/telemetry/open-telemetry-instrumentation.js +4 -1
- package/dist/tokens/index.d.ts +0 -2
- package/dist/tokens/index.js +0 -2
- package/dist/tokens/jwt-token-manager.d.ts +7 -3
- package/dist/tokens/jwt-token-manager.js +8 -9
- package/dist/tokens/token-storage.d.ts +0 -20
- package/dist/tokens/token-storage.js +0 -19
- package/dist/utils/date-utils.d.ts +6 -0
- package/dist/utils/date-utils.js +8 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/parsing-utils.d.ts +1 -11
- package/dist/utils/parsing-utils.js +1 -33
- package/package.json +19 -23
- package/dist/api/base/device/constants.d.ts +0 -3
- package/dist/api/base/device/constants.js +0 -3
- package/dist/api/base/health-data/health-data-response-factory.d.ts +0 -27
- package/dist/api/base/health-space/cancellation-reasons-request.d.ts +0 -28
- package/dist/api/base/requests/field-sort-order.d.ts +0 -11
- package/dist/api/base/search/submit-provider-for-review-request.d.ts +0 -33
- package/dist/api/base/search/submit-provider-for-review-request.js +0 -9
- package/dist/api/base/user/validators.d.ts +0 -5
- package/dist/api/base/user/validators.js +0 -13
- package/dist/api/graphql-api/activity/get-tasks-request-factory.js +0 -56
- package/dist/api/graphql-api/connection/connection-response-factory.d.ts +0 -7
- package/dist/api/graphql-api/connection/connection-response-factory.js +0 -101
- package/dist/api/graphql-api/financial/coverage-request-factory.d.ts +0 -9
- package/dist/api/graphql-api/financial/coverage-request-factory.js +0 -19
- package/dist/api/graphql-api/financial/explanation-of-benefit-request-factory.js +0 -19
- package/dist/api/graphql-api/healthdata/get-encounters-request-factory.d.ts +0 -7
- package/dist/api/graphql-api/healthdata/get-encounters-request-factory.js +0 -76
- package/dist/api/graphql-api/healthdata/get-medication-dispenses-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/healthdata/get-medication-dispenses-request-factory.js +0 -25
- package/dist/api/graphql-api/healthdata/health-data-request-factory.d.ts +0 -18
- package/dist/api/graphql-api/healthdata/health-data-request-factory.js +0 -25
- package/dist/api/graphql-api/healthdata/health-data-response-factory.d.ts +0 -8
- package/dist/api/graphql-api/healthdata/health-data-response-factory.js +0 -58
- package/dist/api/graphql-api/search/submit-provider-for-review-request-factory.d.ts +0 -6
- package/dist/models/activity/index.d.ts +0 -1
- package/dist/models/activity/task.d.ts +0 -77
- package/dist/models/activity/task.js +0 -1
- package/dist/models/common/address.d.ts +0 -41
- package/dist/models/common/address.js +0 -1
- package/dist/models/common/annotation.d.ts +0 -18
- package/dist/models/common/annotation.js +0 -1
- package/dist/models/common/attachment.d.ts +0 -18
- package/dist/models/common/attachment.js +0 -1
- package/dist/models/common/bundle.d.ts +0 -83
- package/dist/models/common/bundle.js +0 -1
- package/dist/models/common/codeable-concept.d.ts +0 -17
- package/dist/models/common/codeable-concept.js +0 -1
- package/dist/models/common/coding.d.ts +0 -18
- package/dist/models/common/component.d.ts +0 -23
- package/dist/models/common/component.js +0 -1
- package/dist/models/common/contact-point.d.ts +0 -32
- package/dist/models/common/contact-point.js +0 -1
- package/dist/models/common/dispense-request.d.ts +0 -67
- package/dist/models/common/dispense-request.js +0 -1
- package/dist/models/common/dosage.d.ts +0 -68
- package/dist/models/common/dosage.js +0 -1
- package/dist/models/common/endpoint.d.ts +0 -23
- package/dist/models/common/endpoint.js +0 -1
- package/dist/models/common/expression.d.ts +0 -20
- package/dist/models/common/expression.js +0 -1
- package/dist/models/common/extension.d.ts +0 -49
- package/dist/models/common/extension.js +0 -1
- package/dist/models/common/fhir-error.d.ts +0 -23
- package/dist/models/common/human-name.d.ts +0 -20
- package/dist/models/common/human-name.js +0 -1
- package/dist/models/common/identifier.d.ts +0 -19
- package/dist/models/common/identifier.js +0 -1
- package/dist/models/common/index.d.ts +0 -38
- package/dist/models/common/index.js +0 -2
- package/dist/models/common/location.d.ts +0 -51
- package/dist/models/common/location.js +0 -1
- package/dist/models/common/medication.d.ts +0 -42
- package/dist/models/common/medication.js +0 -1
- package/dist/models/common/meta.d.ts +0 -21
- package/dist/models/common/meta.js +0 -1
- package/dist/models/common/money.d.ts +0 -15
- package/dist/models/common/money.js +0 -1
- package/dist/models/common/narrative.d.ts +0 -14
- package/dist/models/common/narrative.js +0 -1
- package/dist/models/common/operation-outcome.d.ts +0 -48
- package/dist/models/common/operation-outcome.js +0 -1
- package/dist/models/common/organization.d.ts +0 -46
- package/dist/models/common/organization.js +0 -1
- package/dist/models/common/paging-info.d.ts +0 -18
- package/dist/models/common/paging-info.js +0 -1
- package/dist/models/common/patient.d.ts +0 -13
- package/dist/models/common/patient.js +0 -1
- package/dist/models/common/period.d.ts +0 -14
- package/dist/models/common/period.js +0 -1
- package/dist/models/common/practitioner-role.d.ts +0 -42
- package/dist/models/common/practitioner-role.js +0 -1
- package/dist/models/common/practitioner.d.ts +0 -17
- package/dist/models/common/practitioner.js +0 -1
- package/dist/models/common/quantity.d.ts +0 -20
- package/dist/models/common/quantity.js +0 -1
- package/dist/models/common/range.d.ts +0 -15
- package/dist/models/common/range.js +0 -1
- package/dist/models/common/ratio.d.ts +0 -15
- package/dist/models/common/ratio.js +0 -1
- package/dist/models/common/reference-range.d.ts +0 -13
- package/dist/models/common/reference-range.js +0 -1
- package/dist/models/common/reference.d.ts +0 -27
- package/dist/models/common/reference.js +0 -1
- package/dist/models/common/related-person.d.ts +0 -34
- package/dist/models/common/related-person.js +0 -1
- package/dist/models/common/score.d.ts +0 -16
- package/dist/models/common/score.js +0 -1
- package/dist/models/common/service-request.d.ts +0 -21
- package/dist/models/common/service-request.js +0 -1
- package/dist/models/common/specimen.d.ts +0 -30
- package/dist/models/common/specimen.js +0 -7
- package/dist/models/common/timing.d.ts +0 -107
- package/dist/models/common/timing.js +0 -1
- package/dist/models/common/value.d.ts +0 -22
- package/dist/models/common/value.js +0 -1
- package/dist/models/connection/base-connection.d.ts +0 -27
- package/dist/models/connection/base-connection.js +0 -1
- package/dist/models/connection/connection-status.d.ts +0 -15
- package/dist/models/connection/connection-status.js +0 -1
- package/dist/models/connection/connection.d.ts +0 -32
- package/dist/models/connection/connection.js +0 -1
- package/dist/models/connection/data-source.d.ts +0 -27
- package/dist/models/connection/data-source.js +0 -1
- package/dist/models/connection/index.d.ts +0 -6
- package/dist/models/connection/index.js +0 -1
- package/dist/models/connection/member-connection.d.ts +0 -37
- package/dist/models/connection/member-connection.js +0 -1
- package/dist/models/connection/oauth-url.d.ts +0 -12
- package/dist/models/connection/oauth-url.js +0 -1
- package/dist/models/device/device-registration-results.d.ts +0 -12
- package/dist/models/device/device-registration-results.js +0 -1
- package/dist/models/device/index.d.ts +0 -1
- package/dist/models/device/index.js +0 -1
- package/dist/models/enums/category-code.d.ts +0 -11
- package/dist/models/enums/category-code.js +0 -13
- package/dist/models/enums/connection-category.d.ts +0 -9
- package/dist/models/enums/connection-category.js +0 -1
- package/dist/models/enums/consent-provision-type.d.ts +0 -11
- package/dist/models/enums/consent-provision-type.js +0 -2
- package/dist/models/enums/consent-status.d.ts +0 -11
- package/dist/models/enums/consent-status.js +0 -9
- package/dist/models/enums/data-connection-status.d.ts +0 -9
- package/dist/models/enums/data-connection-status.js +0 -1
- package/dist/models/enums/data-connection-type.d.ts +0 -9
- package/dist/models/enums/data-connection-type.js +0 -1
- package/dist/models/enums/data-set.d.ts +0 -10
- package/dist/models/enums/data-set.js +0 -1
- package/dist/models/enums/device-platform.d.ts +0 -11
- package/dist/models/enums/device-platform.js +0 -2
- package/dist/models/enums/endpoint-status.d.ts +0 -9
- package/dist/models/enums/endpoint-status.js +0 -1
- package/dist/models/enums/filter-field.d.ts +0 -9
- package/dist/models/enums/filter-field.js +0 -1
- package/dist/models/enums/gender.d.ts +0 -9
- package/dist/models/enums/gender.js +0 -1
- package/dist/models/enums/index.d.ts +0 -18
- package/dist/models/enums/index.js +0 -5
- package/dist/models/enums/log-level.d.ts +0 -8
- package/dist/models/enums/log-level.js +0 -1
- package/dist/models/enums/person-gender.d.ts +0 -11
- package/dist/models/enums/person-gender.js +0 -7
- package/dist/models/enums/search-context.d.ts +0 -10
- package/dist/models/enums/search-context.js +0 -1
- package/dist/models/enums/search-result-type.d.ts +0 -9
- package/dist/models/enums/search-result-type.js +0 -1
- package/dist/models/enums/sort-field.d.ts +0 -10
- package/dist/models/enums/sort-field.js +0 -1
- package/dist/models/enums/sort-order.d.ts +0 -9
- package/dist/models/enums/sort-order.js +0 -1
- package/dist/models/enums/sync-status.d.ts +0 -9
- package/dist/models/enums/sync-status.js +0 -1
- package/dist/models/financial/coverage-bundle.d.ts +0 -18
- package/dist/models/financial/coverage-bundle.js +0 -1
- package/dist/models/financial/coverage.d.ts +0 -65
- package/dist/models/financial/coverage.js +0 -1
- package/dist/models/financial/explanation-of-benefit-bundle.d.ts +0 -26
- package/dist/models/financial/explanation-of-benefit-bundle.js +0 -1
- package/dist/models/financial/explanation-of-benefit.d.ts +0 -274
- package/dist/models/financial/explanation-of-benefit.js +0 -1
- package/dist/models/financial/index.d.ts +0 -4
- package/dist/models/financial/index.js +0 -4
- package/dist/models/health-data/allergy-intolerance-bundle.d.ts +0 -11
- package/dist/models/health-data/allergy-intolerance-bundle.js +0 -1
- package/dist/models/health-data/allergy-intolerance-group.d.ts +0 -44
- package/dist/models/health-data/allergy-intolerance-group.js +0 -1
- package/dist/models/health-data/allergy-intolerance-reaction.d.ts +0 -23
- package/dist/models/health-data/allergy-intolerance-reaction.js +0 -1
- package/dist/models/health-data/allergy-intolerance.d.ts +0 -54
- package/dist/models/health-data/allergy-intolerance.js +0 -1
- package/dist/models/health-data/care-plan-group.d.ts +0 -42
- package/dist/models/health-data/care-plan-group.js +0 -1
- package/dist/models/health-data/care-plan.d.ts +0 -134
- package/dist/models/health-data/care-plan.js +0 -1
- package/dist/models/health-data/care-team.d.ts +0 -77
- package/dist/models/health-data/care-team.js +0 -1
- package/dist/models/health-data/condition-group.d.ts +0 -42
- package/dist/models/health-data/condition-group.js +0 -1
- package/dist/models/health-data/condition.d.ts +0 -104
- package/dist/models/health-data/condition.js +0 -1
- package/dist/models/health-data/diagnostic-report-lab-group.d.ts +0 -45
- package/dist/models/health-data/diagnostic-report-lab-group.js +0 -1
- package/dist/models/health-data/diagnostic-report.d.ts +0 -90
- package/dist/models/health-data/diagnostic-report.js +0 -1
- package/dist/models/health-data/encounter-group.d.ts +0 -48
- package/dist/models/health-data/encounter-group.js +0 -1
- package/dist/models/health-data/encounter.d.ts +0 -79
- package/dist/models/health-data/encounter.js +0 -1
- package/dist/models/health-data/health-summary.d.ts +0 -18
- package/dist/models/health-data/health-summary.js +0 -1
- package/dist/models/health-data/immunization-group.d.ts +0 -41
- package/dist/models/health-data/immunization-group.js +0 -1
- package/dist/models/health-data/immunization.d.ts +0 -150
- package/dist/models/health-data/immunization.js +0 -1
- package/dist/models/health-data/index.d.ts +0 -30
- package/dist/models/health-data/index.js +0 -1
- package/dist/models/health-data/lab-bundle.d.ts +0 -26
- package/dist/models/health-data/lab-bundle.js +0 -1
- package/dist/models/health-data/lab-group.d.ts +0 -51
- package/dist/models/health-data/lab-group.js +0 -1
- package/dist/models/health-data/lab-knowledge.d.ts +0 -28
- package/dist/models/health-data/lab-knowledge.js +0 -1
- package/dist/models/health-data/medication-dispense.d.ts +0 -108
- package/dist/models/health-data/medication-dispense.js +0 -1
- package/dist/models/health-data/medication-group.d.ts +0 -43
- package/dist/models/health-data/medication-group.js +0 -1
- package/dist/models/health-data/medication-knowledge.d.ts +0 -30
- package/dist/models/health-data/medication-knowledge.js +0 -1
- package/dist/models/health-data/medication-pricing.d.ts +0 -28
- package/dist/models/health-data/medication-pricing.js +0 -1
- package/dist/models/health-data/medication-request.d.ts +0 -107
- package/dist/models/health-data/medication-request.js +0 -1
- package/dist/models/health-data/medication-statement.d.ts +0 -68
- package/dist/models/health-data/medication-statement.js +0 -1
- package/dist/models/health-data/observation.d.ts +0 -102
- package/dist/models/health-data/observation.js +0 -1
- package/dist/models/health-data/procedure-group.d.ts +0 -43
- package/dist/models/health-data/procedure-group.js +0 -1
- package/dist/models/health-data/procedure.d.ts +0 -84
- package/dist/models/health-data/procedure.js +0 -1
- package/dist/models/health-data/vital-sign-bundle.d.ts +0 -18
- package/dist/models/health-data/vital-sign-bundle.js +0 -1
- package/dist/models/health-data/vital-sign-group.d.ts +0 -51
- package/dist/models/health-data/vital-sign-group.js +0 -1
- package/dist/models/health-space/appointment-bundle.d.ts +0 -11
- package/dist/models/health-space/appointment-bundle.js +0 -1
- package/dist/models/health-space/appointment-participant.d.ts +0 -17
- package/dist/models/health-space/appointment-participant.js +0 -1
- package/dist/models/health-space/appointment-update.d.ts +0 -14
- package/dist/models/health-space/appointment-update.js +0 -1
- package/dist/models/health-space/appointment.d.ts +0 -30
- package/dist/models/health-space/appointment.js +0 -1
- package/dist/models/health-space/cancellation-reasons.d.ts +0 -32
- package/dist/models/health-space/cancellation-reasons.js +0 -1
- package/dist/models/health-space/index.d.ts +0 -5
- package/dist/models/health-space/index.js +0 -1
- package/dist/models/identity/auth-tokens.d.ts +0 -25
- package/dist/models/identity/auth-tokens.js +0 -1
- package/dist/models/identity/create-guest-access-token-results.d.ts +0 -12
- package/dist/models/identity/create-guest-access-token-results.js +0 -1
- package/dist/models/identity/index.d.ts +0 -4
- package/dist/models/identity/index.js +0 -1
- package/dist/models/identity/refresh-token-results.d.ts +0 -8
- package/dist/models/identity/refresh-token-results.js +0 -1
- package/dist/models/identity/sdk-configuration-result.d.ts +0 -26
- package/dist/models/identity/sdk-configuration-result.js +0 -1
- package/dist/models/questionnaire/index.d.ts +0 -5
- package/dist/models/questionnaire/index.js +0 -1
- package/dist/models/questionnaire/questionnaire-item.d.ts +0 -38
- package/dist/models/questionnaire/questionnaire-item.js +0 -1
- package/dist/models/questionnaire/questionnaire-response-answer.d.ts +0 -33
- package/dist/models/questionnaire/questionnaire-response-answer.js +0 -1
- package/dist/models/questionnaire/questionnaire-response-item.d.ts +0 -19
- package/dist/models/questionnaire/questionnaire-response-item.js +0 -1
- package/dist/models/questionnaire/questionnaire-response.d.ts +0 -29
- package/dist/models/questionnaire/questionnaire-response.js +0 -1
- package/dist/models/questionnaire/questionnaire.d.ts +0 -30
- package/dist/models/questionnaire/questionnaire.js +0 -1
- package/dist/models/search/health-resources.d.ts +0 -133
- package/dist/models/search/health-resources.js +0 -1
- package/dist/models/search/index.d.ts +0 -2
- package/dist/models/search/index.js +0 -1
- package/dist/models/search/provider-review-result.d.ts +0 -15
- package/dist/models/search/provider-review-result.js +0 -1
- package/dist/models/user/consent.d.ts +0 -100
- package/dist/models/user/consent.js +0 -1
- package/dist/models/user/index.d.ts +0 -4
- package/dist/models/user/index.js +0 -1
- package/dist/models/user/person.d.ts +0 -43
- package/dist/models/user/person.js +0 -1
- package/dist/models/user/user.d.ts +0 -12
- package/dist/models/user/user.js +0 -1
- package/dist/models/user/verification-result.d.ts +0 -30
- package/dist/models/user/verification-result.js +0 -1
- package/dist/tokens/load-auth-tokens.d.ts +0 -6
- package/dist/tokens/load-auth-tokens.js +0 -43
- package/dist/tokens/token-manager.d.ts +0 -12
- package/dist/tokens/token-manager.js +0 -5
- package/dist/utils/search-token-utils.d.ts +0 -8
- package/dist/utils/search-token-utils.js +0 -23
- /package/dist/api/base/{health-data/health-data-response-factory.js → event/event-manager.js} +0 -0
- /package/dist/api/base/{requests/field-sort-order.js → support/support-manager.js} +0 -0
- /package/dist/models/{common/coding.js → coding.js} +0 -0
- /package/dist/models/{common/fhir-error.js → fhir-error.js} +0 -0
- /package/dist/{results → models}/operation-outcome.d.ts +0 -0
- /package/dist/{results → models}/operation-outcome.js +0 -0
- /package/dist/models/{activity/index.js → user.js} +0 -0
|
@@ -1,45 +1,14 @@
|
|
|
1
1
|
import { ValidationRequest } from "./request.js";
|
|
2
2
|
import { ErrorsCollector, Validator } from "./validator.js";
|
|
3
|
-
/**
|
|
4
|
-
* Input type for paged requests. Specifies pagination parameters.
|
|
5
|
-
* @category Inputs
|
|
6
|
-
* @title PagedRequestInput
|
|
7
|
-
* @excerpt Input type for paged requests
|
|
8
|
-
*/
|
|
9
3
|
export type PagedRequestInput = {
|
|
10
4
|
page: number;
|
|
11
5
|
pageSize?: number;
|
|
12
6
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Request data type for paged requests
|
|
15
|
-
* @private
|
|
16
|
-
* @title PagedRequestRequestData
|
|
17
|
-
* @excerpt Request data type for paged requests
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
7
|
export type PagedRequestRequestData = Required<PagedRequestInput>;
|
|
21
|
-
/**
|
|
22
|
-
* Maximum page size for paged requests
|
|
23
|
-
* @private
|
|
24
|
-
* @title MAX_PAGE_SIZE
|
|
25
|
-
* @excerpt Maximum page size for paged requests
|
|
26
|
-
|
|
27
|
-
*/
|
|
28
8
|
export declare const MAX_PAGE_SIZE = 100;
|
|
29
|
-
/**
|
|
30
|
-
* Default page size for paged requests
|
|
31
|
-
* @private
|
|
32
|
-
* @title DEFAULT_PAGE_SIZE
|
|
33
|
-
* @excerpt Default page size for paged requests
|
|
34
|
-
|
|
35
|
-
*/
|
|
36
9
|
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
37
10
|
/**
|
|
38
11
|
* Validator for paged requests. Ensures that the page is a positive number and the page size is a positive number less than or equal to MAX_PAGE_SIZE.
|
|
39
|
-
* @private
|
|
40
|
-
* @title PagedRequestValidator
|
|
41
|
-
* @excerpt Validator for paged requests. Ensures that the page is a positive number and the page size is a positive number less than or equal to MAX_PAGE_SIZE
|
|
42
|
-
|
|
43
12
|
*/
|
|
44
13
|
export declare class PagedRequestValidator<T extends PagedRequestInput> implements Validator<T> {
|
|
45
14
|
#private;
|
|
@@ -52,10 +21,6 @@ export declare class PagedRequestValidator<T extends PagedRequestInput> implemen
|
|
|
52
21
|
}
|
|
53
22
|
/**
|
|
54
23
|
* Base request object for fetching paged data.
|
|
55
|
-
* @category Requests
|
|
56
|
-
* @title PagedRequest
|
|
57
|
-
* @excerpt Base request object for fetching paged data
|
|
58
|
-
|
|
59
24
|
*/
|
|
60
25
|
export declare class PagedRequest<I extends PagedRequestInput = PagedRequestInput, T extends Required<PagedRequestInput> = I & Required<PagedRequestInput>> extends ValidationRequest<I, T & Required<PagedRequestInput>> {
|
|
61
26
|
protected validator: PagedRequestValidator<I>;
|
|
@@ -5,28 +5,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _PagedRequestValidator_instances, _PagedRequestValidator_validatePage, _PagedRequestValidator_validatePageSize;
|
|
7
7
|
import { ValidationRequest } from "./request.js";
|
|
8
|
-
/**
|
|
9
|
-
* Maximum page size for paged requests
|
|
10
|
-
* @private
|
|
11
|
-
* @title MAX_PAGE_SIZE
|
|
12
|
-
* @excerpt Maximum page size for paged requests
|
|
13
|
-
|
|
14
|
-
*/
|
|
15
8
|
export const MAX_PAGE_SIZE = 100;
|
|
16
|
-
/**
|
|
17
|
-
* Default page size for paged requests
|
|
18
|
-
* @private
|
|
19
|
-
* @title DEFAULT_PAGE_SIZE
|
|
20
|
-
* @excerpt Default page size for paged requests
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
9
|
export const DEFAULT_PAGE_SIZE = 20;
|
|
24
10
|
/**
|
|
25
11
|
* Validator for paged requests. Ensures that the page is a positive number and the page size is a positive number less than or equal to MAX_PAGE_SIZE.
|
|
26
|
-
* @private
|
|
27
|
-
* @title PagedRequestValidator
|
|
28
|
-
* @excerpt Validator for paged requests. Ensures that the page is a positive number and the page size is a positive number less than or equal to MAX_PAGE_SIZE
|
|
29
|
-
|
|
30
12
|
*/
|
|
31
13
|
export class PagedRequestValidator {
|
|
32
14
|
constructor() {
|
|
@@ -59,10 +41,6 @@ _PagedRequestValidator_instances = new WeakSet(), _PagedRequestValidator_validat
|
|
|
59
41
|
};
|
|
60
42
|
/**
|
|
61
43
|
* Base request object for fetching paged data.
|
|
62
|
-
* @category Requests
|
|
63
|
-
* @title PagedRequest
|
|
64
|
-
* @excerpt Base request object for fetching paged data
|
|
65
|
-
|
|
66
44
|
*/
|
|
67
45
|
export class PagedRequest extends ValidationRequest {
|
|
68
46
|
constructor() {
|
|
@@ -4,10 +4,6 @@ import { Validator } from "./validator.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* The Request interface provides a set of methods to be used for serializing,
|
|
6
6
|
* validating, and accessing data Request data
|
|
7
|
-
* @private
|
|
8
|
-
* @title Request
|
|
9
|
-
* @excerpt The Request interface provides a set of methods to be used for serializing, validating, and accessing data Request data
|
|
10
|
-
|
|
11
7
|
*/
|
|
12
8
|
export interface Request<T> {
|
|
13
9
|
/**
|
|
@@ -35,10 +31,6 @@ export interface Request<T> {
|
|
|
35
31
|
* I is the input type of the Request class.
|
|
36
32
|
* T is the output type of the request class and is defaulted to I. T should
|
|
37
33
|
* be the result of the trasnformInput method.
|
|
38
|
-
* @private
|
|
39
|
-
* @title BaseRequest
|
|
40
|
-
* @excerpt BaseRequest is the class to be extended when building a request input class which does not require any validation logic
|
|
41
|
-
|
|
42
34
|
*/
|
|
43
35
|
export declare abstract class BaseRequest<I, T = I> implements Request<T> {
|
|
44
36
|
#private;
|
|
@@ -64,10 +56,6 @@ export declare abstract class BaseRequest<I, T = I> implements Request<T> {
|
|
|
64
56
|
}
|
|
65
57
|
/**
|
|
66
58
|
* Class to extend for building request objects that require data validation
|
|
67
|
-
* @private
|
|
68
|
-
* @title ValidationRequest
|
|
69
|
-
* @excerpt Class to extend for building request objects that require data validation
|
|
70
|
-
|
|
71
59
|
*/
|
|
72
60
|
export declare abstract class ValidationRequest<I, T = I> extends BaseRequest<I, T> {
|
|
73
61
|
/**
|
|
@@ -83,10 +71,6 @@ export declare abstract class ValidationRequest<I, T = I> extends BaseRequest<I,
|
|
|
83
71
|
/**
|
|
84
72
|
* Interface to implement when bulding classes that transform an abstract request
|
|
85
73
|
* to a provider specific request object like GraphQL
|
|
86
|
-
* @private
|
|
87
|
-
* @title RequestFactory
|
|
88
|
-
* @excerpt Interface to implement when bulding classes that transform an abstract request to a provider specific request object like GraphQL
|
|
89
|
-
|
|
90
74
|
*/
|
|
91
75
|
export interface RequestFactory<R extends Request<unknown>, Output> {
|
|
92
76
|
/**
|
package/dist/requests/request.js
CHANGED
|
@@ -21,10 +21,6 @@ import { ValidationErrorsCollector } from "./validator.js";
|
|
|
21
21
|
* I is the input type of the Request class.
|
|
22
22
|
* T is the output type of the request class and is defaulted to I. T should
|
|
23
23
|
* be the result of the trasnformInput method.
|
|
24
|
-
* @private
|
|
25
|
-
* @title BaseRequest
|
|
26
|
-
* @excerpt BaseRequest is the class to be extended when building a request input class which does not require any validation logic
|
|
27
|
-
|
|
28
24
|
*/
|
|
29
25
|
export class BaseRequest {
|
|
30
26
|
constructor(data) {
|
|
@@ -66,10 +62,6 @@ export class BaseRequest {
|
|
|
66
62
|
_BaseRequest_data = new WeakMap(), _BaseRequest_input = new WeakMap();
|
|
67
63
|
/**
|
|
68
64
|
* Class to extend for building request objects that require data validation
|
|
69
|
-
* @private
|
|
70
|
-
* @title ValidationRequest
|
|
71
|
-
* @excerpt Class to extend for building request objects that require data validation
|
|
72
|
-
|
|
73
65
|
*/
|
|
74
66
|
export class ValidationRequest extends BaseRequest {
|
|
75
67
|
/**
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Validator is an interface which only implements a `validate` method which
|
|
3
3
|
* validates some data and collects the validation errors into an error collector
|
|
4
|
-
* @private
|
|
5
|
-
* @title Validator
|
|
6
|
-
* @excerpt Validator is an interface which only implements a `validate` method which validates some data and collects the validation errors into an error collector
|
|
7
|
-
|
|
8
4
|
*/
|
|
9
5
|
export interface Validator<T> {
|
|
10
6
|
/**
|
|
@@ -31,10 +27,6 @@ export interface Validator<T> {
|
|
|
31
27
|
}
|
|
32
28
|
/**
|
|
33
29
|
* Interface for collecting errors during data validation
|
|
34
|
-
* @private
|
|
35
|
-
* @title ErrorsCollector
|
|
36
|
-
* @excerpt Interface for collecting errors during data validation
|
|
37
|
-
|
|
38
30
|
*/
|
|
39
31
|
export interface ErrorsCollector {
|
|
40
32
|
/**
|
|
@@ -54,13 +46,6 @@ export interface ErrorsCollector {
|
|
|
54
46
|
*/
|
|
55
47
|
hasErrors(): boolean;
|
|
56
48
|
}
|
|
57
|
-
/**
|
|
58
|
-
* Implementation of ErrorsCollector for collecting validation errors
|
|
59
|
-
* @private
|
|
60
|
-
* @title ValidationErrorsCollector
|
|
61
|
-
* @excerpt Implementation of ErrorsCollector for collecting validation errors
|
|
62
|
-
|
|
63
|
-
*/
|
|
64
49
|
export declare class ValidationErrorsCollector implements ErrorsCollector {
|
|
65
50
|
#private;
|
|
66
51
|
add(error: string): void;
|
|
@@ -4,13 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _ValidationErrorsCollector_errors;
|
|
7
|
-
/**
|
|
8
|
-
* Implementation of ErrorsCollector for collecting validation errors
|
|
9
|
-
* @private
|
|
10
|
-
* @title ValidationErrorsCollector
|
|
11
|
-
* @excerpt Implementation of ErrorsCollector for collecting validation errors
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
7
|
export class ValidationErrorsCollector {
|
|
15
8
|
constructor() {
|
|
16
9
|
_ValidationErrorsCollector_errors.set(this, []);
|
|
@@ -2,11 +2,6 @@ import { type BWellError } from "../errors/index.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Used when just querying for data.
|
|
4
4
|
* Can have data AND errors
|
|
5
|
-
*
|
|
6
|
-
* @typeParam T - The type of the data being queried
|
|
7
|
-
* @typeParam E - The type of the error, must extend BWellError (defaults to BWellError)
|
|
8
|
-
* @title BWellQueryResult
|
|
9
|
-
* @excerpt Used when just querying for data
|
|
10
5
|
*/
|
|
11
6
|
export declare class BWellQueryResult<T, E extends BWellError = BWellError> {
|
|
12
7
|
readonly data: T | undefined;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Used when just querying for data.
|
|
3
3
|
* Can have data AND errors
|
|
4
|
-
*
|
|
5
|
-
* @typeParam T - The type of the data being queried
|
|
6
|
-
* @typeParam E - The type of the error, must extend BWellError (defaults to BWellError)
|
|
7
|
-
* @title BWellQueryResult
|
|
8
|
-
* @excerpt Used when just querying for data
|
|
9
4
|
*/
|
|
10
5
|
export class BWellQueryResult {
|
|
11
6
|
constructor(data, error) {
|
|
@@ -3,11 +3,6 @@ import { BWellQueryResult } from "./bwell-query-result.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Class representing a successful operation whose result can only be a success
|
|
5
5
|
* or a failure.
|
|
6
|
-
*
|
|
7
|
-
* @typeParam T - The type of the successful result value
|
|
8
|
-
* @typeParam E - The type of the error, must extend BWellError (defaults to BWellError)
|
|
9
|
-
* @title BWellTransactionResult
|
|
10
|
-
* @excerpt Class representing a successful operation whose result can only be a success or a failure
|
|
11
6
|
*/
|
|
12
7
|
export declare abstract class BWellTransactionResult<T, E extends BWellError = BWellError> {
|
|
13
8
|
/**
|
|
@@ -30,10 +25,10 @@ export declare abstract class BWellTransactionResult<T, E extends BWellError = B
|
|
|
30
25
|
abstract data(): T;
|
|
31
26
|
/**
|
|
32
27
|
* If Result is a `BWellTransactionFailure` returns `E`;
|
|
33
|
-
* Throws `
|
|
28
|
+
* Throws `E` if result is `BWellTransactionSuccess`
|
|
34
29
|
*
|
|
35
30
|
* @returns {E}
|
|
36
|
-
* @
|
|
31
|
+
* @throw {T}
|
|
37
32
|
*/
|
|
38
33
|
abstract error(): E;
|
|
39
34
|
/**
|
|
@@ -54,10 +49,6 @@ export declare abstract class BWellTransactionResult<T, E extends BWellError = B
|
|
|
54
49
|
/**
|
|
55
50
|
* Class representing a successful operation whose result can only be a success
|
|
56
51
|
* and never a failure
|
|
57
|
-
*
|
|
58
|
-
* @typeParam T - The type of the successful result value
|
|
59
|
-
* @title BWellTransactionSuccess
|
|
60
|
-
* @excerpt Class representing a successful operation whose result can only be a success and never a failure
|
|
61
52
|
*/
|
|
62
53
|
export declare class BWellTransactionSuccess<T> extends BWellTransactionResult<T, never> {
|
|
63
54
|
#private;
|
|
@@ -70,12 +61,7 @@ export declare class BWellTransactionSuccess<T> extends BWellTransactionResult<T
|
|
|
70
61
|
}
|
|
71
62
|
/**
|
|
72
63
|
* Class representing a failed operation whose result can only be a failure
|
|
73
|
-
* and never a
|
|
74
|
-
*
|
|
75
|
-
* @typeParam T - The type of the successful result value (unused in failure)
|
|
76
|
-
* @typeParam E - The type of the error, must extend BWellError (defaults to BWellError)
|
|
77
|
-
* @title BWellTransactionFailure
|
|
78
|
-
* @excerpt Class representing a failed operation whose result can only be a failure and never a success
|
|
64
|
+
* and never a failure
|
|
79
65
|
*/
|
|
80
66
|
export declare class BWellTransactionFailure<T, E extends BWellError = BWellError> extends BWellTransactionResult<T, E> {
|
|
81
67
|
#private;
|
|
@@ -14,11 +14,6 @@ import { BWellQueryResult } from "./bwell-query-result.js";
|
|
|
14
14
|
/**
|
|
15
15
|
* Class representing a successful operation whose result can only be a success
|
|
16
16
|
* or a failure.
|
|
17
|
-
*
|
|
18
|
-
* @typeParam T - The type of the successful result value
|
|
19
|
-
* @typeParam E - The type of the error, must extend BWellError (defaults to BWellError)
|
|
20
|
-
* @title BWellTransactionResult
|
|
21
|
-
* @excerpt Class representing a successful operation whose result can only be a success or a failure
|
|
22
17
|
*/
|
|
23
18
|
export class BWellTransactionResult {
|
|
24
19
|
/**
|
|
@@ -37,10 +32,6 @@ export class BWellTransactionResult {
|
|
|
37
32
|
/**
|
|
38
33
|
* Class representing a successful operation whose result can only be a success
|
|
39
34
|
* and never a failure
|
|
40
|
-
*
|
|
41
|
-
* @typeParam T - The type of the successful result value
|
|
42
|
-
* @title BWellTransactionSuccess
|
|
43
|
-
* @excerpt Class representing a successful operation whose result can only be a success and never a failure
|
|
44
35
|
*/
|
|
45
36
|
export class BWellTransactionSuccess extends BWellTransactionResult {
|
|
46
37
|
constructor(data) {
|
|
@@ -67,12 +58,7 @@ export class BWellTransactionSuccess extends BWellTransactionResult {
|
|
|
67
58
|
_BWellTransactionSuccess_data = new WeakMap();
|
|
68
59
|
/**
|
|
69
60
|
* Class representing a failed operation whose result can only be a failure
|
|
70
|
-
* and never a
|
|
71
|
-
*
|
|
72
|
-
* @typeParam T - The type of the successful result value (unused in failure)
|
|
73
|
-
* @typeParam E - The type of the error, must extend BWellError (defaults to BWellError)
|
|
74
|
-
* @title BWellTransactionFailure
|
|
75
|
-
* @excerpt Class representing a failed operation whose result can only be a failure and never a success
|
|
61
|
+
* and never a failure
|
|
76
62
|
*/
|
|
77
63
|
export class BWellTransactionFailure extends BWellTransactionResult {
|
|
78
64
|
constructor(error) {
|
package/dist/results/index.d.ts
CHANGED
package/dist/results/index.js
CHANGED
|
@@ -31,7 +31,10 @@ export function getRuntimeInstrumentation(config) {
|
|
|
31
31
|
browser: () => {
|
|
32
32
|
return new XMLHttpRequestInstrumentation({
|
|
33
33
|
ignoreUrls: [IGNORE_URL_REGEX],
|
|
34
|
-
propagateTraceHeaderCorsUrls: [
|
|
34
|
+
propagateTraceHeaderCorsUrls: [
|
|
35
|
+
config.graphQL.apiUrl,
|
|
36
|
+
config.graphQL.unauthApiUrl,
|
|
37
|
+
],
|
|
35
38
|
});
|
|
36
39
|
},
|
|
37
40
|
});
|
package/dist/tokens/index.d.ts
CHANGED
package/dist/tokens/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { IdentityManager } from "../api/base/identity/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { InvalidTokenError, OperationOutcomeError } from "../errors/index.js";
|
|
3
3
|
import { LoggerProvider } from "../logger/index.js";
|
|
4
4
|
import { BWellTransactionResult } from "../results/index.js";
|
|
5
|
-
import { TokenManager } from "./token-manager.js";
|
|
6
5
|
import { TokenStorage } from "./token-storage.js";
|
|
7
6
|
export type TokenManagerConfig = {
|
|
8
7
|
accessToken: string;
|
|
@@ -10,6 +9,11 @@ export type TokenManagerConfig = {
|
|
|
10
9
|
clientKey: string;
|
|
11
10
|
refreshToken: string;
|
|
12
11
|
};
|
|
12
|
+
export interface TokenManager {
|
|
13
|
+
getAccessToken(): Promise<BWellTransactionResult<string, OperationOutcomeError | InvalidTokenError>>;
|
|
14
|
+
refreshAccessToken(): Promise<BWellTransactionResult<null, OperationOutcomeError | InvalidTokenError>>;
|
|
15
|
+
getIdToken(): Promise<string | undefined>;
|
|
16
|
+
}
|
|
13
17
|
export declare class JWTTokenManager implements TokenManager {
|
|
14
18
|
#private;
|
|
15
19
|
private constructor();
|
|
@@ -23,7 +27,7 @@ export declare class JWTTokenManager implements TokenManager {
|
|
|
23
27
|
*
|
|
24
28
|
* @returns {BWellTransactionResult<JWTTokenManager, InvalidTokenError>}
|
|
25
29
|
*/
|
|
26
|
-
static initialize(config: TokenManagerConfig, identManager: IdentityManager, loggerProvider?: LoggerProvider, tokenStorage?: TokenStorage): Promise<BWellTransactionResult<JWTTokenManager, InvalidTokenError
|
|
30
|
+
static initialize(config: TokenManagerConfig, identManager: IdentityManager, loggerProvider?: LoggerProvider, tokenStorage?: TokenStorage): Promise<BWellTransactionResult<JWTTokenManager, InvalidTokenError>>;
|
|
27
31
|
getAccessToken(): Promise<BWellTransactionResult<string, OperationOutcomeError | InvalidTokenError>>;
|
|
28
32
|
getIdToken(): Promise<string | undefined>;
|
|
29
33
|
refreshAccessToken(): Promise<BWellTransactionResult<null, OperationOutcomeError | InvalidTokenError>>;
|
|
@@ -23,7 +23,6 @@ import { BWellError, InvalidTokenError, } from "../errors/index.js";
|
|
|
23
23
|
import { ConsoleLoggerProvider, } from "../logger/index.js";
|
|
24
24
|
import { BWellTransactionResult } from "../results/index.js";
|
|
25
25
|
import { isUndefined, parseTokenExpiration } from "../utils/index.js";
|
|
26
|
-
import { ACCESS_TOKEN_STORAGE_KEY, CLIENT_KEY_STORAGE_KEY, EXPRIATION_TOKEN_STORAGE_KEY, ID_TOKEN_STORAGE_KEY, REFRESH_TOKEN_STORAGE_KEY, } from "./token-manager.js";
|
|
27
26
|
import { InMemoryTokenStorage } from "./token-storage.js";
|
|
28
27
|
export class JWTTokenManager {
|
|
29
28
|
constructor(config, identManager, loggerProvider, tokenStorage) {
|
|
@@ -53,16 +52,16 @@ export class JWTTokenManager {
|
|
|
53
52
|
}
|
|
54
53
|
const tokenManager = new _a(Object.assign(Object.assign({}, config), { expiration: expirationResult.data() }), identManager, loggerProvider, tokenStorage);
|
|
55
54
|
try {
|
|
56
|
-
yield
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
55
|
+
yield Promise.all([
|
|
56
|
+
tokenStorage.set("idToken", config.idToken),
|
|
57
|
+
tokenStorage.set("clientKey", config.clientKey),
|
|
58
|
+
tokenStorage.set("accessToken", config.accessToken),
|
|
59
|
+
tokenStorage.set("refreshToken", config.refreshToken),
|
|
60
|
+
tokenStorage.set("expiration", expirationResult.data().toISOString()),
|
|
62
61
|
]);
|
|
63
62
|
}
|
|
64
|
-
catch (
|
|
65
|
-
return BWellTransactionResult.failure(new
|
|
63
|
+
catch (_b) {
|
|
64
|
+
return BWellTransactionResult.failure(new InvalidTokenError("Failed to set tokens in token storage"));
|
|
66
65
|
}
|
|
67
66
|
return BWellTransactionResult.success(tokenManager);
|
|
68
67
|
});
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export type GetManyResult = [string, string | undefined];
|
|
2
1
|
/**
|
|
3
2
|
* Interface for storing tokens.
|
|
4
3
|
* We might want to store more than one kind of token, so the interface is for a key-value store.
|
|
5
4
|
* All methods are asynchronous, in cases of storage in the cloud, over the network, in a multi-step process, etc.
|
|
6
|
-
* @title TokenStorage
|
|
7
|
-
* @excerpt Interface for storing tokens
|
|
8
5
|
*/
|
|
9
6
|
export interface TokenStorage {
|
|
10
7
|
/**
|
|
@@ -12,25 +9,12 @@ export interface TokenStorage {
|
|
|
12
9
|
* @param key The key to look up the value.
|
|
13
10
|
*/
|
|
14
11
|
get(key: string): Promise<string | undefined>;
|
|
15
|
-
/**
|
|
16
|
-
* Gets all keys at once. Returns list of key value pairs where the value is
|
|
17
|
-
* `undefined` if not found.
|
|
18
|
-
*
|
|
19
|
-
* @param keys - List of keys to fetch.
|
|
20
|
-
*/
|
|
21
|
-
getMany(keys: string[]): Promise<GetManyResult[]>;
|
|
22
12
|
/**
|
|
23
13
|
* Set the value for a key.
|
|
24
14
|
* @param key The key to set the value.
|
|
25
15
|
* @param value The value to set.
|
|
26
16
|
*/
|
|
27
17
|
set(key: string, value: string): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Sets many values at once.
|
|
30
|
-
*
|
|
31
|
-
* @param keyValues - List of key value pairs to set
|
|
32
|
-
*/
|
|
33
|
-
setMany(keyValues: [string, string][]): Promise<void>;
|
|
34
18
|
/**
|
|
35
19
|
* Delete the value for a key.
|
|
36
20
|
* @param key The key to delete the value.
|
|
@@ -39,15 +23,11 @@ export interface TokenStorage {
|
|
|
39
23
|
}
|
|
40
24
|
/**
|
|
41
25
|
* Default token storage implementation that stores tokens in memory.
|
|
42
|
-
* @title InMemoryTokenStorage
|
|
43
|
-
* @excerpt Default token storage implementation that stores tokens in memory
|
|
44
26
|
*/
|
|
45
27
|
export declare class InMemoryTokenStorage {
|
|
46
28
|
private storage;
|
|
47
29
|
constructor(storage?: Map<string, string>);
|
|
48
30
|
get(key: string): Promise<string | undefined>;
|
|
49
|
-
getMany(keys: string[]): Promise<GetManyResult[]>;
|
|
50
31
|
set(key: string, value: string): Promise<void>;
|
|
51
|
-
setMany(keyValues: [string, string][]): Promise<void>;
|
|
52
32
|
delete(key: string): Promise<boolean>;
|
|
53
33
|
}
|
|
@@ -9,8 +9,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Default token storage implementation that stores tokens in memory.
|
|
12
|
-
* @title InMemoryTokenStorage
|
|
13
|
-
* @excerpt Default token storage implementation that stores tokens in memory
|
|
14
12
|
*/
|
|
15
13
|
export class InMemoryTokenStorage {
|
|
16
14
|
constructor(storage = new Map()) {
|
|
@@ -21,28 +19,11 @@ export class InMemoryTokenStorage {
|
|
|
21
19
|
return this.storage.get(key);
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
|
-
getMany(keys) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const results = [];
|
|
27
|
-
for (let i = 0; i < keys.length; i++) {
|
|
28
|
-
const key = keys[i];
|
|
29
|
-
results[i] = [key, this.storage.get(key)];
|
|
30
|
-
}
|
|
31
|
-
return results;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
22
|
set(key, value) {
|
|
35
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
24
|
this.storage.set(key, value);
|
|
37
25
|
});
|
|
38
26
|
}
|
|
39
|
-
setMany(keyValues) {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
for (const [k, v] of keyValues) {
|
|
42
|
-
this.storage.set(k, v);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
27
|
delete(key) {
|
|
47
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
29
|
return this.storage.delete(key);
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./base64.js";
|
|
2
|
+
export * from "./date-utils.js";
|
|
2
3
|
export * from "./parsing-utils.js";
|
|
3
4
|
export * from "./runtime.js";
|
|
4
5
|
export * from "./string-utils.js";
|
|
5
6
|
export * from "./type-utils.js";
|
|
6
7
|
export * from "./version.js";
|
|
7
|
-
export * from "./search-token-utils.js";
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./base64.js";
|
|
2
|
+
export * from "./date-utils.js";
|
|
2
3
|
export * from "./parsing-utils.js";
|
|
3
4
|
export * from "./runtime.js";
|
|
4
5
|
export * from "./string-utils.js";
|
|
5
6
|
export * from "./type-utils.js";
|
|
6
7
|
export * from "./version.js";
|
|
7
|
-
export * from "./search-token-utils.js";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BWellTransactionResult } from "../index.js";
|
|
3
|
-
import type { Coding, User } from "../models/index.js";
|
|
1
|
+
import type { User } from "../models/index.js";
|
|
4
2
|
export declare function retrieveEnvironmentFromClientKey(clientKey: string): string;
|
|
5
3
|
/**
|
|
6
4
|
* Returns the JSON parsed payload section of a JWT
|
|
@@ -26,11 +24,3 @@ export declare function parseTokenExpiration(token: string): number;
|
|
|
26
24
|
* @throws {InvalidTokenError} if token is invalid base64, JWT or JSON payload
|
|
27
25
|
*/
|
|
28
26
|
export declare function parseUserFromIdToken(token: string): User | null;
|
|
29
|
-
/**
|
|
30
|
-
* Parse string to JSON array of coding objects.
|
|
31
|
-
* @param {string} json - JSON array string
|
|
32
|
-
* @returns {Coding[]} parsed coding objects
|
|
33
|
-
* @throws {BWellError} If parsing fails
|
|
34
|
-
* @throw {BWellError} If coding is missing code or system
|
|
35
|
-
*/
|
|
36
|
-
export declare function parseJSONCodings(json: string): BWellTransactionResult<Coding[], IllegalArgumentError>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BWellTransactionResult } from "../index.js";
|
|
1
|
+
import { InvalidTokenError } from "../errors/index.js";
|
|
3
2
|
import { base64Decode } from "./base64.js";
|
|
4
3
|
import { isNotNullOrUndefined } from "./type-utils.js";
|
|
5
4
|
export function retrieveEnvironmentFromClientKey(clientKey) {
|
|
@@ -68,34 +67,3 @@ export function parseUserFromIdToken(token) {
|
|
|
68
67
|
// A guest JWT payload will be a valid token but without the FHIR IDs.
|
|
69
68
|
return null;
|
|
70
69
|
}
|
|
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
|
-
}
|