@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
|
@@ -18,50 +18,73 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
18
18
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
19
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
20
|
};
|
|
21
|
-
var _BWellSDK_instances, _BWellSDK_config, _BWellSDK_sdkConfig, _BWellSDK_telemetry, _BWellSDK_loggerFactory, _BWellSDK_apiProviderFactory,
|
|
21
|
+
var _BWellSDK_instances, _BWellSDK_config, _BWellSDK_sdkConfig, _BWellSDK_initialized, _BWellSDK_telemetry, _BWellSDK_loggerFactory, _BWellSDK_apiProviderFactory, _BWellSDK_authStrategyFactory, _BWellSDK_loggerProvider, _BWellSDK_apiProvider, _BWellSDK_logger, _BWellSDK_configManager, _BWellSDK_tokenManager, _BWellSDK_bootstrapAuth, _BWellSDK_getApiProvider, _BWellSDK_reinitializeBaseDependencies, _BWellSDK_initLoggerProvider, _BWellSDK_initTelemetry, _BWellSDK_initApiProvider;
|
|
22
22
|
import { ApiProviderFactory } from "../api/api-provider-factory.js";
|
|
23
|
-
import { IdentityManagerFactory } from "../api/identity-manager-factory.js";
|
|
24
23
|
import { AuthStrategyFactory } from "../auth/index.js";
|
|
25
24
|
import { ConfigManager, SdkConfig } from "../config/index.js";
|
|
26
25
|
import { BWellError, } from "../errors/index.js";
|
|
27
26
|
import { LoggerFactory, } from "../logger/index.js";
|
|
28
27
|
import { BWellTransactionResult } from "../results/index.js";
|
|
29
28
|
import { OpenTelemetry } from "../telemetry/index.js";
|
|
30
|
-
import { JWTTokenManager, } from "../tokens/index.js";
|
|
29
|
+
import { JWTTokenManager, loadAuthTokens, } from "../tokens/index.js";
|
|
31
30
|
import { isNotNullOrUndefined, parseUserFromIdToken } from "../utils/index.js";
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
32
|
+
* # b.well SDK
|
|
34
33
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* The b.well SDK is the main entry point for interacting with the b.well Connected Health platform.
|
|
35
|
+
*
|
|
36
|
+
* Provides a comprehensive TypeScript/JavaScript interface with organized manager categories for:
|
|
37
|
+
* - Health data access (conditions, medications, labs, procedures)
|
|
38
|
+
* - User management (profiles, consent, identity verification)
|
|
39
|
+
* - Appointment management (scheduling, viewing, canceling)
|
|
40
|
+
* - Connection management (external healthcare providers)
|
|
41
|
+
* - Device management (push notifications, device registration)
|
|
42
|
+
* - Search operations (healthcare provider and resource discovery)
|
|
43
|
+
* - Questionnaire processing (dynamic forms and responses)
|
|
44
|
+
*
|
|
45
|
+
* ## Basic Usage
|
|
37
46
|
*
|
|
38
|
-
* @example
|
|
39
|
-
* Simple initialization with oauth authentication and only required config properties.
|
|
40
|
-
* Note that the SDK must be initialized and authenticated for most data accessx
|
|
41
|
-
* methods to work properly.
|
|
42
47
|
* ```typescript
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
48
|
+
* import { BWellSDK } from '@bwell/sdk';
|
|
49
|
+
*
|
|
50
|
+
* const sdk = new BWellSDK({ clientKey: "YOUR_CLIENT_KEY" });
|
|
51
|
+
* await sdk.initialize();
|
|
52
|
+
* await sdk.authenticate({ token: "YOUR_TOKEN" });
|
|
53
|
+
*
|
|
54
|
+
* // Access health data
|
|
55
|
+
* const conditions = await sdk.health.getConditions();
|
|
56
|
+
* const profile = await sdk.user.getProfile();
|
|
47
57
|
* ```
|
|
58
|
+
*
|
|
59
|
+
* @see {@link HealthManager} for health data operations
|
|
60
|
+
* @see {@link UserManager} for user management operations
|
|
61
|
+
* @see {@link HealthSpaceManager} for appointment management
|
|
62
|
+
* @see {@link ConnectionManager} for provider connections
|
|
63
|
+
* @see {@link DeviceManager} for device management operations
|
|
64
|
+
* @see {@link SearchManager} for search operations
|
|
65
|
+
* @see {@link QuestionnaireManager} for questionnaire processing
|
|
66
|
+
*
|
|
67
|
+
|
|
68
|
+
* @class BWellSDK
|
|
69
|
+
* @category Core
|
|
70
|
+
* @title BWellSDK
|
|
71
|
+
* @excerpt Main entry point for interacting with the b.well Connected Health platform
|
|
48
72
|
*/
|
|
49
73
|
export class BWellSDK {
|
|
50
74
|
constructor(config) {
|
|
51
75
|
_BWellSDK_instances.add(this);
|
|
52
76
|
_BWellSDK_config.set(this, void 0);
|
|
53
77
|
_BWellSDK_sdkConfig.set(this, void 0);
|
|
78
|
+
_BWellSDK_initialized.set(this, false);
|
|
54
79
|
_BWellSDK_telemetry.set(this, void 0);
|
|
55
80
|
// FACTORIES
|
|
56
81
|
_BWellSDK_loggerFactory.set(this, new LoggerFactory());
|
|
57
82
|
_BWellSDK_apiProviderFactory.set(this, new ApiProviderFactory());
|
|
58
|
-
_BWellSDK_identityManagerFactory.set(this, new IdentityManagerFactory());
|
|
59
83
|
_BWellSDK_authStrategyFactory.set(this, new AuthStrategyFactory());
|
|
60
84
|
// PROVIDERS
|
|
61
85
|
_BWellSDK_loggerProvider.set(this, void 0);
|
|
62
86
|
_BWellSDK_apiProvider.set(this, void 0);
|
|
63
87
|
_BWellSDK_logger.set(this, void 0);
|
|
64
|
-
_BWellSDK_identityManager.set(this, void 0);
|
|
65
88
|
_BWellSDK_configManager.set(this, void 0);
|
|
66
89
|
_BWellSDK_tokenManager.set(this, void 0);
|
|
67
90
|
__classPrivateFieldSet(this, _BWellSDK_config, config, "f");
|
|
@@ -70,20 +93,45 @@ export class BWellSDK {
|
|
|
70
93
|
__classPrivateFieldSet(this, _BWellSDK_telemetry, __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_initTelemetry).call(this), "f");
|
|
71
94
|
__classPrivateFieldSet(this, _BWellSDK_loggerProvider, __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_initLoggerProvider).call(this), "f");
|
|
72
95
|
__classPrivateFieldSet(this, _BWellSDK_logger, __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f").getLogger("BWellSDK"), "f");
|
|
73
|
-
__classPrivateFieldSet(this,
|
|
74
|
-
__classPrivateFieldSet(this, _BWellSDK_configManager, new ConfigManager(__classPrivateFieldGet(this,
|
|
96
|
+
__classPrivateFieldSet(this, _BWellSDK_apiProvider, __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_initApiProvider).call(this), "f");
|
|
97
|
+
__classPrivateFieldSet(this, _BWellSDK_configManager, new ConfigManager(__classPrivateFieldGet(this, _BWellSDK_apiProvider, "f").identity), "f");
|
|
75
98
|
}
|
|
99
|
+
// =============================================================================
|
|
100
|
+
// CORE SDK METHODS
|
|
101
|
+
// =============================================================================
|
|
76
102
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
103
|
+
* ## Initialize SDK
|
|
104
|
+
*
|
|
105
|
+
* Initializes the SDK with the provided configuration. This method must be called
|
|
106
|
+
* before using any other SDK functionality.
|
|
107
|
+
*
|
|
108
|
+
* **Prerequisites:**
|
|
109
|
+
* - Valid `clientKey` must be provided in the constructor
|
|
110
|
+
* - Network connectivity to b.well services
|
|
111
|
+
*
|
|
112
|
+
* **Post-initialization:**
|
|
113
|
+
* - SDK configuration is validated and loaded
|
|
114
|
+
* - Base dependencies are initialized
|
|
115
|
+
* - Ready for authentication
|
|
116
|
+
*
|
|
117
|
+
* @returns {Promise<BWellTransactionResult<null, InvalidClientKeyError | OperationOutcomeError>>}
|
|
118
|
+
* A promise that resolves to a BWellTransactionResult with:
|
|
119
|
+
* - `null` data on success
|
|
120
|
+
* - `InvalidClientKeyError` if client credentials are invalid
|
|
121
|
+
* - `OperationOutcomeError` if server-side initialization fails
|
|
122
|
+
*
|
|
79
123
|
* @example
|
|
80
124
|
* ```typescript
|
|
81
125
|
* const sdk = new BWellSDK({
|
|
82
|
-
*
|
|
83
|
-
* clientSecret: "YOUR_CLIENT_SECRET",
|
|
126
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
84
127
|
* });
|
|
85
128
|
*
|
|
86
|
-
* await sdk.initialize();
|
|
129
|
+
* const initResult = await sdk.initialize();
|
|
130
|
+
* if (initResult.success()) {
|
|
131
|
+
* console.log("SDK initialized successfully");
|
|
132
|
+
* } else {
|
|
133
|
+
* console.error("Failed to initialize SDK:", initResult.error().message);
|
|
134
|
+
* }
|
|
87
135
|
* ```
|
|
88
136
|
*/
|
|
89
137
|
initialize() {
|
|
@@ -100,26 +148,56 @@ export class BWellSDK {
|
|
|
100
148
|
});
|
|
101
149
|
}
|
|
102
150
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
151
|
+
* ## Authenticate User
|
|
152
|
+
*
|
|
153
|
+
* Authenticates the user with the provided credentials and prepares the SDK for
|
|
154
|
+
* data access operations.
|
|
155
|
+
*
|
|
156
|
+
* **Prerequisites:**
|
|
157
|
+
* - SDK must be initialized via `initialize()`
|
|
158
|
+
* - Valid authentication credentials
|
|
159
|
+
*
|
|
160
|
+
* **Authentication Flow:**
|
|
161
|
+
* 1. Validates credentials with authentication strategy
|
|
162
|
+
* 2. Bootstraps authentication tokens
|
|
163
|
+
* 3. Initializes token management
|
|
164
|
+
* 4. Prepares API providers for authenticated requests
|
|
165
|
+
*
|
|
166
|
+
* **Supported Credential Types:**
|
|
167
|
+
* - Token-based authentication
|
|
168
|
+
* - OAuth credentials (depending on configuration)
|
|
169
|
+
*
|
|
170
|
+
* @param {Credentials} credentials - The credentials to be used for authentication
|
|
171
|
+
* @returns {Promise<BWellTransactionResult<null, AuthenticationError | InvalidTokenError>>}
|
|
172
|
+
* A promise that resolves to a BWellTransactionResult with:
|
|
173
|
+
* - `null` data on success
|
|
174
|
+
* - `AuthenticationError` if authentication fails
|
|
175
|
+
* - `InvalidTokenError` if provided tokens are invalid
|
|
176
|
+
*
|
|
106
177
|
* @example
|
|
107
178
|
* ```typescript
|
|
108
179
|
* const sdk = new BWellSDK({
|
|
109
|
-
*
|
|
110
|
-
* clientSecret: "YOUR_CLIENT_SECRET",
|
|
180
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
111
181
|
* });
|
|
112
182
|
*
|
|
113
183
|
* await sdk.initialize();
|
|
114
184
|
*
|
|
115
|
-
* await sdk.authenticate({
|
|
116
|
-
* token: "
|
|
185
|
+
* const authResult = await sdk.authenticate({
|
|
186
|
+
* token: "YOUR_ACCESS_TOKEN",
|
|
117
187
|
* });
|
|
188
|
+
*
|
|
189
|
+
* if (authResult.success()) {
|
|
190
|
+
* console.log("Authentication successful");
|
|
191
|
+
* // Now you can use all SDK functionality
|
|
192
|
+
* const profile = await sdk.user.getProfile();
|
|
193
|
+
* } else {
|
|
194
|
+
* console.error("Authentication failed:", authResult.error().message);
|
|
195
|
+
* }
|
|
118
196
|
* ```
|
|
119
197
|
*/
|
|
120
198
|
authenticate(credentials) {
|
|
121
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
const authStrategy = __classPrivateFieldGet(this, _BWellSDK_authStrategyFactory, "f").createAuthStrategy(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), __classPrivateFieldGet(this,
|
|
200
|
+
const authStrategy = __classPrivateFieldGet(this, _BWellSDK_authStrategyFactory, "f").createAuthStrategy(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), __classPrivateFieldGet(this, _BWellSDK_apiProvider, "f").identity, credentials, __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f"));
|
|
123
201
|
const authenticateResults = yield authStrategy.authenticate(credentials);
|
|
124
202
|
if (authenticateResults.failure()) {
|
|
125
203
|
return authenticateResults.intoFailure();
|
|
@@ -129,14 +207,53 @@ export class BWellSDK {
|
|
|
129
207
|
});
|
|
130
208
|
}
|
|
131
209
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
210
|
+
* ## Set Authentication Tokens
|
|
211
|
+
*
|
|
212
|
+
* Sets auth tokens for a pre-authenticated user. This method performs token validation
|
|
213
|
+
* and can be used in place of `authenticate()` when tokens are obtained through
|
|
214
|
+
* external means.
|
|
134
215
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
216
|
+
* **Use Cases:**
|
|
217
|
+
* - Integration with existing authentication systems
|
|
218
|
+
* - Server-side token management
|
|
219
|
+
* - Custom authentication flows
|
|
220
|
+
*
|
|
221
|
+
* **Token Validation:**
|
|
222
|
+
* - Validates token format and structure
|
|
223
|
+
* - Parses user information from ID token
|
|
224
|
+
* - Initializes token refresh mechanisms
|
|
225
|
+
*
|
|
226
|
+
* @param {AuthTokens} authTokens - Auth tokens for pre-authenticated user containing:
|
|
227
|
+
* - `accessToken` - Access token for API requests
|
|
228
|
+
* - `idToken` - ID token containing user information
|
|
229
|
+
* - `refreshToken` - Refresh token for token renewal
|
|
137
230
|
*
|
|
138
|
-
* @param {AuthTokens} authTokens - Auth tokens for pre-authenticated user
|
|
139
231
|
* @returns {Promise<BWellTransactionResult<null, OperationOutcomeError | InvalidTokenError>>}
|
|
232
|
+
* A promise that resolves to a BWellTransactionResult with:
|
|
233
|
+
* - `null` data on success
|
|
234
|
+
* - `OperationOutcomeError` if server-side validation fails
|
|
235
|
+
* - `InvalidTokenError` if provided tokens are invalid or expired
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* const sdk = new BWellSDK({
|
|
240
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
241
|
+
* });
|
|
242
|
+
*
|
|
243
|
+
* await sdk.initialize();
|
|
244
|
+
*
|
|
245
|
+
* // Use tokens obtained from external authentication
|
|
246
|
+
* const tokenResult = await sdk.setAuthTokens({
|
|
247
|
+
* accessToken: "your-access-token",
|
|
248
|
+
* idToken: "your-id-token",
|
|
249
|
+
* refreshToken: "your-refresh-token"
|
|
250
|
+
* });
|
|
251
|
+
*
|
|
252
|
+
* if (tokenResult.success()) {
|
|
253
|
+
* console.log("Tokens set successfully");
|
|
254
|
+
* // SDK is now ready for use
|
|
255
|
+
* }
|
|
256
|
+
* ```
|
|
140
257
|
*/
|
|
141
258
|
setAuthTokens(authTokens) {
|
|
142
259
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -158,54 +275,251 @@ export class BWellSDK {
|
|
|
158
275
|
});
|
|
159
276
|
}
|
|
160
277
|
/**
|
|
161
|
-
*
|
|
162
|
-
*
|
|
278
|
+
* ## Authenticate From Storage
|
|
279
|
+
*
|
|
280
|
+
* Authenticates the user using tokens previously stored in the configured token storage.
|
|
281
|
+
* This method provides a convenient way to restore user sessions without requiring
|
|
282
|
+
* manual credential input.
|
|
283
|
+
*
|
|
284
|
+
* **Prerequisites:**
|
|
285
|
+
* - SDK must be initialized via `initialize()`
|
|
286
|
+
* - `tokenStorage` must be configured in the BWell config
|
|
287
|
+
* - Valid tokens must exist in the configured storage
|
|
288
|
+
*
|
|
289
|
+
* **Authentication Flow:**
|
|
290
|
+
* 1. Loads tokens from the configured token storage
|
|
291
|
+
* 2. Validates and bootstraps the loaded tokens
|
|
292
|
+
* 3. Refreshes access token to ensure validity
|
|
293
|
+
* 4. Prepares API providers for authenticated requests
|
|
294
|
+
*
|
|
295
|
+
* **Storage Integration:**
|
|
296
|
+
* - Supports various storage backends (localStorage, secure storage, etc.)
|
|
297
|
+
* - Handles storage errors gracefully
|
|
298
|
+
* - Automatically validates token integrity
|
|
299
|
+
*
|
|
300
|
+
* @returns {Promise<BWellTransactionResult<null, AuthenticationError | InvalidTokenError | BWellError>>}
|
|
301
|
+
* A promise that resolves to a BWellTransactionResult with:
|
|
302
|
+
* - `null` data on success
|
|
303
|
+
* - `AuthenticationError` if authentication process fails
|
|
304
|
+
* - `InvalidTokenError` if stored tokens are invalid or expired
|
|
305
|
+
* - `BWellError` if token storage is not configured
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```typescript
|
|
309
|
+
* const sdk = new BWellSDK({
|
|
310
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
311
|
+
* tokenStorage: new LocalStorageTokenStorage() // or your storage implementation
|
|
312
|
+
* });
|
|
313
|
+
*
|
|
314
|
+
* await sdk.initialize();
|
|
315
|
+
*
|
|
316
|
+
* // Attempt to authenticate from stored tokens
|
|
317
|
+
* const authResult = await sdk.authenticateFromStorage();
|
|
318
|
+
*
|
|
319
|
+
* if (authResult.success()) {
|
|
320
|
+
* console.log("Authentication from storage successful");
|
|
321
|
+
* // SDK is ready for use with restored session
|
|
322
|
+
* const profile = await sdk.user.getProfile();
|
|
323
|
+
* } else {
|
|
324
|
+
* console.error("Authentication from storage failed:", authResult.error().message);
|
|
325
|
+
* // Fall back to manual authentication
|
|
326
|
+
* await sdk.authenticate({ token: "USER_PROVIDED_TOKEN" });
|
|
327
|
+
* }
|
|
328
|
+
* ```
|
|
329
|
+
*/
|
|
330
|
+
authenticateFromStorage() {
|
|
331
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
332
|
+
if (__classPrivateFieldGet(this, _BWellSDK_config, "f").tokenStorage === undefined) {
|
|
333
|
+
return BWellTransactionResult.failure(new BWellError("tokenStorage not provided in config"));
|
|
334
|
+
}
|
|
335
|
+
__classPrivateFieldGet(this, _BWellSDK_logger, "f").debug("Loading credentials from token storage");
|
|
336
|
+
const storageTokensResult = yield loadAuthTokens(__classPrivateFieldGet(this, _BWellSDK_config, "f").tokenStorage);
|
|
337
|
+
if (storageTokensResult.failure()) {
|
|
338
|
+
__classPrivateFieldGet(this, _BWellSDK_logger, "f").warn("Error loading credentials from token storage");
|
|
339
|
+
return storageTokensResult.intoFailure();
|
|
340
|
+
}
|
|
341
|
+
__classPrivateFieldGet(this, _BWellSDK_logger, "f").info("Successfully loaded credentials from token storage");
|
|
342
|
+
const authTokens = storageTokensResult.data();
|
|
343
|
+
const bootsrapResult = yield __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_bootstrapAuth).call(this, authTokens);
|
|
344
|
+
if (bootsrapResult.failure()) {
|
|
345
|
+
return bootsrapResult.intoFailure();
|
|
346
|
+
}
|
|
347
|
+
if (__classPrivateFieldGet(this, _BWellSDK_tokenManager, "f") === undefined) {
|
|
348
|
+
// Token manager is set by #bootstrapAuth so it shouldn't ever be undefined
|
|
349
|
+
// here. We can't imply that through TS though so we need to presence check
|
|
350
|
+
/* istanbul ignore next */
|
|
351
|
+
throw new Error("TokenManager not set");
|
|
352
|
+
}
|
|
353
|
+
const refreshResult = yield __classPrivateFieldGet(this, _BWellSDK_tokenManager, "f").refreshAccessToken();
|
|
354
|
+
if (refreshResult.failure()) {
|
|
355
|
+
return refreshResult.intoFailure();
|
|
356
|
+
}
|
|
357
|
+
return BWellTransactionResult.success(null);
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* ## Create Guest Access Token
|
|
362
|
+
*
|
|
363
|
+
* Creates a guest access token that allows limited, anonymous access to certain
|
|
364
|
+
* b.well platform features without requiring user authentication. Guest tokens
|
|
365
|
+
* provide restricted access to public resources and non-sensitive operations.
|
|
366
|
+
*
|
|
367
|
+
* **Prerequisites:**
|
|
368
|
+
* - SDK must be initialized via `initialize()`
|
|
369
|
+
* - Valid client key must be configured
|
|
370
|
+
* - Client must have guest access permissions enabled
|
|
371
|
+
*
|
|
372
|
+
* **Guest Access Capabilities:**
|
|
373
|
+
* - Access to public health resources
|
|
374
|
+
* - Limited questionnaire functionality
|
|
375
|
+
* - Anonymous data queries (where permitted)
|
|
376
|
+
* - Public provider directory access
|
|
377
|
+
*
|
|
378
|
+
* **Limitations:**
|
|
379
|
+
* - No access to personal health records
|
|
380
|
+
* - Cannot perform user-specific operations
|
|
381
|
+
* - Limited to read-only operations on public data
|
|
382
|
+
* - Tokens have shorter expiration times
|
|
383
|
+
*
|
|
384
|
+
* @returns {Promise<BWellTransactionResult<CreateGuestAccessTokenResults, BaseManagerError>>}
|
|
385
|
+
* A promise that resolves to a BWellTransactionResult with:
|
|
386
|
+
* - `CreateGuestAccessTokenResults` containing the guest access token and metadata
|
|
387
|
+
* - `BaseManagerError` if token creation fails due to client configuration or server issues
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* ```typescript
|
|
391
|
+
* const sdk = new BWellSDK({
|
|
392
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
393
|
+
* });
|
|
394
|
+
*
|
|
395
|
+
* await sdk.initialize();
|
|
396
|
+
*
|
|
397
|
+
* // Create a guest access token for anonymous access
|
|
398
|
+
* const guestTokenResult = await sdk.createGuestAccessToken();
|
|
399
|
+
*
|
|
400
|
+
* if (guestTokenResult.success()) {
|
|
401
|
+
* const guestToken = guestTokenResult.data();
|
|
402
|
+
* console.log("Guest token created:", guestToken.accessToken);
|
|
403
|
+
*
|
|
404
|
+
* // Use the guest token for limited operations
|
|
405
|
+
* // Note: This doesn't automatically authenticate the SDK
|
|
406
|
+
* // You may need to use setAuthTokens() with appropriate tokens
|
|
407
|
+
* } else {
|
|
408
|
+
* console.error("Failed to create guest token:", guestTokenResult.error().message);
|
|
409
|
+
* }
|
|
410
|
+
* ```
|
|
163
411
|
*/
|
|
164
412
|
createGuestAccessToken() {
|
|
165
413
|
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
-
return __classPrivateFieldGet(this,
|
|
414
|
+
return __classPrivateFieldGet(this, _BWellSDK_apiProvider, "f").identity.createGuestAccessToken({
|
|
167
415
|
clientKey: __classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f").context.clientKey,
|
|
168
416
|
});
|
|
169
417
|
});
|
|
170
418
|
}
|
|
419
|
+
// =============================================================================
|
|
420
|
+
// MANAGER ACCESSORS
|
|
421
|
+
// =============================================================================
|
|
422
|
+
// The following getters provide access to the various manager instances that
|
|
423
|
+
// implement the SDK's functionality through a fluid API interface.
|
|
424
|
+
/**
|
|
425
|
+
* Financial manager for insurance coverage and financial data access.
|
|
426
|
+
*
|
|
427
|
+
* @see {@link FinancialManager} - Complete financial data operations and examples
|
|
428
|
+
* @returns {FinancialManager} The financial manager instance
|
|
429
|
+
* @category Managers
|
|
430
|
+
*/
|
|
431
|
+
get financial() {
|
|
432
|
+
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).financial;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Health data manager for patient health records and clinical data access.
|
|
436
|
+
*
|
|
437
|
+
* @see {@link HealthManager} - Complete health data operations and examples
|
|
438
|
+
* @returns {HealthManager} The health data manager instance
|
|
439
|
+
* @category Managers
|
|
440
|
+
*/
|
|
171
441
|
get health() {
|
|
172
442
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).health;
|
|
173
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Health space manager for appointments, scheduling, and healthcare facility management.
|
|
446
|
+
*
|
|
447
|
+
* @see {@link HealthSpaceManager} - Complete appointment management operations and examples
|
|
448
|
+
* @returns {HealthSpaceManager} The health space manager instance
|
|
449
|
+
* @category Managers
|
|
450
|
+
*/
|
|
174
451
|
get healthSpace() {
|
|
175
452
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).healthSpace;
|
|
176
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* User manager for profile management, consent handling, and identity verification.
|
|
456
|
+
*
|
|
457
|
+
* @see {@link UserManager} - Complete user management operations and examples
|
|
458
|
+
* @returns {UserManager} The user manager instance
|
|
459
|
+
* @category Managers
|
|
460
|
+
*/
|
|
177
461
|
get user() {
|
|
178
462
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).user;
|
|
179
463
|
}
|
|
464
|
+
/**
|
|
465
|
+
* Connection manager for data source connections and OAuth management.
|
|
466
|
+
*
|
|
467
|
+
* @see {@link ConnectionManager} - Complete connection management operations and examples
|
|
468
|
+
* @returns {ConnectionManager} The connection manager instance
|
|
469
|
+
* @category Managers
|
|
470
|
+
*/
|
|
180
471
|
get connection() {
|
|
181
472
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).connection;
|
|
182
473
|
}
|
|
183
474
|
get activity() {
|
|
184
475
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).activity;
|
|
185
476
|
}
|
|
477
|
+
/**
|
|
478
|
+
* Device manager for push notification registration and device management.
|
|
479
|
+
*
|
|
480
|
+
* @see {@link DeviceManager} - Complete device management operations and examples
|
|
481
|
+
* @returns {DeviceManager} The device manager instance
|
|
482
|
+
* @category Managers
|
|
483
|
+
*/
|
|
186
484
|
get device() {
|
|
187
485
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).device;
|
|
188
486
|
}
|
|
189
|
-
get event() {
|
|
190
|
-
|
|
191
|
-
}
|
|
487
|
+
// public get event(): EventManager {
|
|
488
|
+
// return this.#getApiProvider().event;
|
|
489
|
+
// }
|
|
490
|
+
/**
|
|
491
|
+
* Search manager for healthcare provider and resource discovery.
|
|
492
|
+
*
|
|
493
|
+
* @see {@link SearchManager} - Complete search operations and examples
|
|
494
|
+
* @returns {SearchManager} The search manager instance
|
|
495
|
+
* @category Managers
|
|
496
|
+
*/
|
|
192
497
|
get search() {
|
|
193
498
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).search;
|
|
194
499
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
500
|
+
/**
|
|
501
|
+
* Language manager for language and localization utilities.
|
|
502
|
+
*
|
|
503
|
+
* @see {@link LanguageManager} - Complete language and localization operations
|
|
504
|
+
* @returns {LanguageManager} The language manager instance
|
|
505
|
+
* @category Managers
|
|
506
|
+
*/
|
|
198
507
|
get language() {
|
|
199
508
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).language;
|
|
200
509
|
}
|
|
510
|
+
/**
|
|
511
|
+
* Questionnaire manager for dynamic questionnaire processing and response handling.
|
|
512
|
+
*
|
|
513
|
+
* @experimental This manager and its methods are experimental and may change in future releases.
|
|
514
|
+
* @see {@link QuestionnaireManager} - Complete questionnaire processing operations and examples
|
|
515
|
+
* @returns {QuestionnaireManager} The questionnaire manager instance
|
|
516
|
+
* @category Managers
|
|
517
|
+
*/
|
|
201
518
|
get questionnaire() {
|
|
202
519
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).questionnaire;
|
|
203
520
|
}
|
|
204
|
-
get support() {
|
|
205
|
-
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).support;
|
|
206
|
-
}
|
|
207
521
|
}
|
|
208
|
-
_BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(),
|
|
522
|
+
_BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(), _BWellSDK_initialized = new WeakMap(), _BWellSDK_telemetry = new WeakMap(), _BWellSDK_loggerFactory = new WeakMap(), _BWellSDK_apiProviderFactory = new WeakMap(), _BWellSDK_authStrategyFactory = new WeakMap(), _BWellSDK_loggerProvider = new WeakMap(), _BWellSDK_apiProvider = new WeakMap(), _BWellSDK_logger = new WeakMap(), _BWellSDK_configManager = new WeakMap(), _BWellSDK_tokenManager = new WeakMap(), _BWellSDK_instances = new WeakSet(), _BWellSDK_bootstrapAuth = function _BWellSDK_bootstrapAuth(identityTokens) {
|
|
209
523
|
return __awaiter(this, void 0, void 0, function* () {
|
|
210
524
|
try {
|
|
211
525
|
const user = parseUserFromIdToken(identityTokens.idToken);
|
|
@@ -222,18 +536,19 @@ _BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(), _BWellSDK
|
|
|
222
536
|
throw e;
|
|
223
537
|
}
|
|
224
538
|
const tokenManagerConfig = Object.assign(Object.assign({}, identityTokens), { clientKey: __classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f").context.clientKey });
|
|
225
|
-
const tokenManagerInit = yield JWTTokenManager.initialize(tokenManagerConfig, __classPrivateFieldGet(this,
|
|
539
|
+
const tokenManagerInit = yield JWTTokenManager.initialize(tokenManagerConfig, __classPrivateFieldGet(this, _BWellSDK_apiProvider, "f").identity, __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f"), __classPrivateFieldGet(this, _BWellSDK_config, "f").tokenStorage);
|
|
226
540
|
if (tokenManagerInit.failure()) {
|
|
227
541
|
return tokenManagerInit.intoFailure();
|
|
228
542
|
}
|
|
229
543
|
__classPrivateFieldSet(this, _BWellSDK_tokenManager, tokenManagerInit.data(), "f");
|
|
230
544
|
__classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_reinitializeBaseDependencies).call(this);
|
|
231
545
|
__classPrivateFieldSet(this, _BWellSDK_apiProvider, __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_initApiProvider).call(this, __classPrivateFieldGet(this, _BWellSDK_tokenManager, "f")), "f");
|
|
546
|
+
__classPrivateFieldSet(this, _BWellSDK_initialized, true, "f");
|
|
232
547
|
return BWellTransactionResult.success(null);
|
|
233
548
|
});
|
|
234
549
|
}, _BWellSDK_getApiProvider = function _BWellSDK_getApiProvider() {
|
|
235
|
-
if (__classPrivateFieldGet(this,
|
|
236
|
-
throw new Error("
|
|
550
|
+
if (!__classPrivateFieldGet(this, _BWellSDK_initialized, "f")) {
|
|
551
|
+
throw new Error("Uninitialized");
|
|
237
552
|
}
|
|
238
553
|
return __classPrivateFieldGet(this, _BWellSDK_apiProvider, "f");
|
|
239
554
|
}, _BWellSDK_reinitializeBaseDependencies = function _BWellSDK_reinitializeBaseDependencies() {
|
|
@@ -249,5 +564,5 @@ _BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(), _BWellSDK
|
|
|
249
564
|
}
|
|
250
565
|
return new OpenTelemetry(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"));
|
|
251
566
|
}, _BWellSDK_initApiProvider = function _BWellSDK_initApiProvider(tokenManager) {
|
|
252
|
-
return __classPrivateFieldGet(this, _BWellSDK_apiProviderFactory, "f").createApiProvider(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"),
|
|
567
|
+
return __classPrivateFieldGet(this, _BWellSDK_apiProviderFactory, "f").createApiProvider(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f"), tokenManager);
|
|
253
568
|
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Retry } from "../graphql/schema.js";
|
|
2
2
|
import type { Language } from "../language/language-manager.js";
|
|
3
|
+
import { LogLevel } from "../models/enums/index.js";
|
|
3
4
|
import { TokenStorage } from "../tokens/token-storage.js";
|
|
4
5
|
import type { Nullable } from "../utils/type-utils.js";
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Configuration options for BWellSDK
|
|
8
|
+
* @title BWellConfig
|
|
9
|
+
* @excerpt Configuration options for BWellSDK
|
|
10
|
+
|
|
11
|
+
*/
|
|
6
12
|
export type BWellConfig = {
|
|
7
13
|
clientKey: string;
|
|
8
14
|
logLevel?: LogLevel;
|
|
@@ -28,17 +34,11 @@ export type BWellConfig = {
|
|
|
28
34
|
language?: Nullable<Language>;
|
|
29
35
|
overrides?: {
|
|
30
36
|
/**
|
|
31
|
-
* Base
|
|
32
|
-
* If not provided, the SDK will use the URL returned by
|
|
33
|
-
* NOTE: Changing this setting will override
|
|
37
|
+
* Base URL for the BWell API.
|
|
38
|
+
* If not provided, the SDK will use the URL returned by remote configuration.
|
|
39
|
+
* NOTE: Changing this setting will override remote configuration.
|
|
34
40
|
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Base authed URL for the BWell API.
|
|
38
|
-
* If not provided, the SDK will use the URL returned by the Client Config Service.
|
|
39
|
-
* NOTE: Changing this setting will override the remote config.
|
|
40
|
-
*/
|
|
41
|
-
authedApiUrl?: Nullable<string>;
|
|
41
|
+
apiUrl?: Nullable<string>;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
export declare const DEFAULT_BWELL_CONFIG: Required<Omit<BWellConfig, "clientKey">>;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { LogLevel } from "../graphql/schema.js";
|
|
2
1
|
import { InMemoryTokenStorage } from "../tokens/token-storage.js";
|
|
3
|
-
export { LogLevel } from "../graphql/schema.js";
|
|
4
2
|
export const DEFAULT_BWELL_CONFIG = {
|
|
5
|
-
logLevel:
|
|
3
|
+
logLevel: "ERROR",
|
|
6
4
|
timeout: 30000,
|
|
7
5
|
retryPolicy: {
|
|
8
6
|
attempts: 3,
|
|
@@ -12,7 +10,6 @@ export const DEFAULT_BWELL_CONFIG = {
|
|
|
12
10
|
tokenStorage: new InMemoryTokenStorage(),
|
|
13
11
|
language: null,
|
|
14
12
|
overrides: {
|
|
15
|
-
|
|
16
|
-
authedApiUrl: null,
|
|
13
|
+
apiUrl: null,
|
|
17
14
|
},
|
|
18
15
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { SdkConfigurationResult } from "../api/base/identity/index.js";
|
|
2
1
|
import { InvalidClientKeyError } from "../errors/index.js";
|
|
3
2
|
import { Retry } from "../graphql/schema.js";
|
|
4
3
|
import { Severity } from "../logger/index.js";
|
|
5
|
-
import {
|
|
4
|
+
import { SdkConfigurationResult } from "../models/identity/index.js";
|
|
5
|
+
import { User } from "../models/user/user.js";
|
|
6
6
|
import { BWellTransactionResult } from "../results/index.js";
|
|
7
7
|
import { BWellConfig } from "./bwell-config.js";
|
|
8
8
|
import { Context } from "./context.js";
|
|
9
9
|
export type GraphQLConfig = {
|
|
10
10
|
apiUrl: string;
|
|
11
|
-
unauthApiUrl: string;
|
|
12
11
|
};
|
|
13
12
|
export type TelemetryConfig = {
|
|
14
13
|
collectorUrl: string;
|