@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
|
@@ -18,73 +18,50 @@ 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,
|
|
21
|
+
var _BWellSDK_instances, _BWellSDK_config, _BWellSDK_sdkConfig, _BWellSDK_telemetry, _BWellSDK_loggerFactory, _BWellSDK_apiProviderFactory, _BWellSDK_identityManagerFactory, _BWellSDK_authStrategyFactory, _BWellSDK_loggerProvider, _BWellSDK_apiProvider, _BWellSDK_logger, _BWellSDK_identityManager, _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";
|
|
23
24
|
import { AuthStrategyFactory } from "../auth/index.js";
|
|
24
25
|
import { ConfigManager, SdkConfig } from "../config/index.js";
|
|
25
26
|
import { BWellError, } from "../errors/index.js";
|
|
26
27
|
import { LoggerFactory, } from "../logger/index.js";
|
|
27
28
|
import { BWellTransactionResult } from "../results/index.js";
|
|
28
29
|
import { OpenTelemetry } from "../telemetry/index.js";
|
|
29
|
-
import { JWTTokenManager,
|
|
30
|
+
import { JWTTokenManager, } from "../tokens/index.js";
|
|
30
31
|
import { isNotNullOrUndefined, parseUserFromIdToken } from "../utils/index.js";
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
+
* The BWell SDK is the main entry point for the SDK.
|
|
33
34
|
*
|
|
34
|
-
*
|
|
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
|
|
35
|
+
* It is responsible for initializing the SDK, authenticating the user, and providing
|
|
36
|
+
* access to all of the SDK's functionality via the manager classes (see [Interfaces](../README.md#interfaces)).
|
|
46
37
|
*
|
|
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.
|
|
47
42
|
* ```typescript
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
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();
|
|
43
|
+
* const sdk = new BWellSDK({
|
|
44
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
45
|
+
* clientSecret: "YOUR_CLIENT_SECRET",
|
|
46
|
+
* });
|
|
57
47
|
* ```
|
|
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
|
|
72
48
|
*/
|
|
73
49
|
export class BWellSDK {
|
|
74
50
|
constructor(config) {
|
|
75
51
|
_BWellSDK_instances.add(this);
|
|
76
52
|
_BWellSDK_config.set(this, void 0);
|
|
77
53
|
_BWellSDK_sdkConfig.set(this, void 0);
|
|
78
|
-
_BWellSDK_initialized.set(this, false);
|
|
79
54
|
_BWellSDK_telemetry.set(this, void 0);
|
|
80
55
|
// FACTORIES
|
|
81
56
|
_BWellSDK_loggerFactory.set(this, new LoggerFactory());
|
|
82
57
|
_BWellSDK_apiProviderFactory.set(this, new ApiProviderFactory());
|
|
58
|
+
_BWellSDK_identityManagerFactory.set(this, new IdentityManagerFactory());
|
|
83
59
|
_BWellSDK_authStrategyFactory.set(this, new AuthStrategyFactory());
|
|
84
60
|
// PROVIDERS
|
|
85
61
|
_BWellSDK_loggerProvider.set(this, void 0);
|
|
86
62
|
_BWellSDK_apiProvider.set(this, void 0);
|
|
87
63
|
_BWellSDK_logger.set(this, void 0);
|
|
64
|
+
_BWellSDK_identityManager.set(this, void 0);
|
|
88
65
|
_BWellSDK_configManager.set(this, void 0);
|
|
89
66
|
_BWellSDK_tokenManager.set(this, void 0);
|
|
90
67
|
__classPrivateFieldSet(this, _BWellSDK_config, config, "f");
|
|
@@ -93,45 +70,20 @@ export class BWellSDK {
|
|
|
93
70
|
__classPrivateFieldSet(this, _BWellSDK_telemetry, __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_initTelemetry).call(this), "f");
|
|
94
71
|
__classPrivateFieldSet(this, _BWellSDK_loggerProvider, __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_initLoggerProvider).call(this), "f");
|
|
95
72
|
__classPrivateFieldSet(this, _BWellSDK_logger, __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f").getLogger("BWellSDK"), "f");
|
|
96
|
-
__classPrivateFieldSet(this,
|
|
97
|
-
__classPrivateFieldSet(this, _BWellSDK_configManager, new ConfigManager(__classPrivateFieldGet(this,
|
|
73
|
+
__classPrivateFieldSet(this, _BWellSDK_identityManager, __classPrivateFieldGet(this, _BWellSDK_identityManagerFactory, "f").createIdentityManager(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f")), "f");
|
|
74
|
+
__classPrivateFieldSet(this, _BWellSDK_configManager, new ConfigManager(__classPrivateFieldGet(this, _BWellSDK_identityManager, "f")), "f");
|
|
98
75
|
}
|
|
99
|
-
// =============================================================================
|
|
100
|
-
// CORE SDK METHODS
|
|
101
|
-
// =============================================================================
|
|
102
76
|
/**
|
|
103
|
-
*
|
|
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
|
-
*
|
|
77
|
+
* Initializes the SDK with the provided configuration.
|
|
78
|
+
* @returns A promise that resolves to a BWellTransactionResult with a null data value if the SDK was initialized successfully, or an error if it was not.
|
|
123
79
|
* @example
|
|
124
80
|
* ```typescript
|
|
125
81
|
* const sdk = new BWellSDK({
|
|
126
|
-
*
|
|
82
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
83
|
+
* clientSecret: "YOUR_CLIENT_SECRET",
|
|
127
84
|
* });
|
|
128
85
|
*
|
|
129
|
-
*
|
|
130
|
-
* if (initResult.success()) {
|
|
131
|
-
* console.log("SDK initialized successfully");
|
|
132
|
-
* } else {
|
|
133
|
-
* console.error("Failed to initialize SDK:", initResult.error().message);
|
|
134
|
-
* }
|
|
86
|
+
* await sdk.initialize();
|
|
135
87
|
* ```
|
|
136
88
|
*/
|
|
137
89
|
initialize() {
|
|
@@ -148,56 +100,26 @@ export class BWellSDK {
|
|
|
148
100
|
});
|
|
149
101
|
}
|
|
150
102
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
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
|
-
*
|
|
103
|
+
* Authenticates the user with the provided credentials.
|
|
104
|
+
* @param credentials The credentials to be used for authentication.
|
|
105
|
+
* @returns A promise that resolves to a BWellTransactionResult with a null data value if the user was authenticated successfully, or an error if they were not.
|
|
177
106
|
* @example
|
|
178
107
|
* ```typescript
|
|
179
108
|
* const sdk = new BWellSDK({
|
|
180
|
-
*
|
|
109
|
+
* clientKey: "YOUR_CLIENT_KEY",
|
|
110
|
+
* clientSecret: "YOUR_CLIENT_SECRET",
|
|
181
111
|
* });
|
|
182
112
|
*
|
|
183
113
|
* await sdk.initialize();
|
|
184
114
|
*
|
|
185
|
-
*
|
|
186
|
-
* token: "
|
|
115
|
+
* await sdk.authenticate({
|
|
116
|
+
* token: "YOUR_TOKEN",
|
|
187
117
|
* });
|
|
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
|
-
* }
|
|
196
118
|
* ```
|
|
197
119
|
*/
|
|
198
120
|
authenticate(credentials) {
|
|
199
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
-
const authStrategy = __classPrivateFieldGet(this, _BWellSDK_authStrategyFactory, "f").createAuthStrategy(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), __classPrivateFieldGet(this,
|
|
122
|
+
const authStrategy = __classPrivateFieldGet(this, _BWellSDK_authStrategyFactory, "f").createAuthStrategy(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), __classPrivateFieldGet(this, _BWellSDK_identityManager, "f"), credentials, __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f"));
|
|
201
123
|
const authenticateResults = yield authStrategy.authenticate(credentials);
|
|
202
124
|
if (authenticateResults.failure()) {
|
|
203
125
|
return authenticateResults.intoFailure();
|
|
@@ -207,53 +129,14 @@ export class BWellSDK {
|
|
|
207
129
|
});
|
|
208
130
|
}
|
|
209
131
|
/**
|
|
210
|
-
*
|
|
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.
|
|
132
|
+
* Sets auth tokens for a pre-authenticated user. Performs a token refresh to
|
|
133
|
+
* validate the provided tokens.
|
|
215
134
|
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
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
|
|
135
|
+
* This can be used in place of `authenticate` for times when a user has been
|
|
136
|
+
* authenticated through means other than the SDK.
|
|
230
137
|
*
|
|
138
|
+
* @param {AuthTokens} authTokens - Auth tokens for pre-authenticated user
|
|
231
139
|
* @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
|
-
* ```
|
|
257
140
|
*/
|
|
258
141
|
setAuthTokens(authTokens) {
|
|
259
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -275,251 +158,54 @@ export class BWellSDK {
|
|
|
275
158
|
});
|
|
276
159
|
}
|
|
277
160
|
/**
|
|
278
|
-
*
|
|
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
|
-
* ```
|
|
161
|
+
* Creates a set of guest access tokens (access, id, and refresh)
|
|
162
|
+
* @returns A promise that resolves to a BWellTransactionResult containing the guest access tokens or an error.
|
|
411
163
|
*/
|
|
412
164
|
createGuestAccessToken() {
|
|
413
165
|
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
-
return __classPrivateFieldGet(this,
|
|
166
|
+
return __classPrivateFieldGet(this, _BWellSDK_identityManager, "f").createGuestAccessToken({
|
|
415
167
|
clientKey: __classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f").context.clientKey,
|
|
416
168
|
});
|
|
417
169
|
});
|
|
418
170
|
}
|
|
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
|
-
*/
|
|
441
171
|
get health() {
|
|
442
172
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).health;
|
|
443
173
|
}
|
|
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
|
-
*/
|
|
451
174
|
get healthSpace() {
|
|
452
175
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).healthSpace;
|
|
453
176
|
}
|
|
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
|
-
*/
|
|
461
177
|
get user() {
|
|
462
178
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).user;
|
|
463
179
|
}
|
|
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
|
-
*/
|
|
471
180
|
get connection() {
|
|
472
181
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).connection;
|
|
473
182
|
}
|
|
474
183
|
get activity() {
|
|
475
184
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).activity;
|
|
476
185
|
}
|
|
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
|
-
*/
|
|
484
186
|
get device() {
|
|
485
187
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).device;
|
|
486
188
|
}
|
|
487
|
-
|
|
488
|
-
|
|
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
|
-
*/
|
|
189
|
+
get event() {
|
|
190
|
+
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).event;
|
|
191
|
+
}
|
|
497
192
|
get search() {
|
|
498
193
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).search;
|
|
499
194
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
* @see {@link LanguageManager} - Complete language and localization operations
|
|
504
|
-
* @returns {LanguageManager} The language manager instance
|
|
505
|
-
* @category Managers
|
|
506
|
-
*/
|
|
195
|
+
get financial() {
|
|
196
|
+
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).financial;
|
|
197
|
+
}
|
|
507
198
|
get language() {
|
|
508
199
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).language;
|
|
509
200
|
}
|
|
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
|
-
*/
|
|
518
201
|
get questionnaire() {
|
|
519
202
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).questionnaire;
|
|
520
203
|
}
|
|
204
|
+
get support() {
|
|
205
|
+
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).support;
|
|
206
|
+
}
|
|
521
207
|
}
|
|
522
|
-
_BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(),
|
|
208
|
+
_BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(), _BWellSDK_telemetry = new WeakMap(), _BWellSDK_loggerFactory = new WeakMap(), _BWellSDK_apiProviderFactory = new WeakMap(), _BWellSDK_identityManagerFactory = new WeakMap(), _BWellSDK_authStrategyFactory = new WeakMap(), _BWellSDK_loggerProvider = new WeakMap(), _BWellSDK_apiProvider = new WeakMap(), _BWellSDK_logger = new WeakMap(), _BWellSDK_identityManager = new WeakMap(), _BWellSDK_configManager = new WeakMap(), _BWellSDK_tokenManager = new WeakMap(), _BWellSDK_instances = new WeakSet(), _BWellSDK_bootstrapAuth = function _BWellSDK_bootstrapAuth(identityTokens) {
|
|
523
209
|
return __awaiter(this, void 0, void 0, function* () {
|
|
524
210
|
try {
|
|
525
211
|
const user = parseUserFromIdToken(identityTokens.idToken);
|
|
@@ -536,19 +222,18 @@ _BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(), _BWellSDK
|
|
|
536
222
|
throw e;
|
|
537
223
|
}
|
|
538
224
|
const tokenManagerConfig = Object.assign(Object.assign({}, identityTokens), { clientKey: __classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f").context.clientKey });
|
|
539
|
-
const tokenManagerInit = yield JWTTokenManager.initialize(tokenManagerConfig, __classPrivateFieldGet(this,
|
|
225
|
+
const tokenManagerInit = yield JWTTokenManager.initialize(tokenManagerConfig, __classPrivateFieldGet(this, _BWellSDK_identityManager, "f"), __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f"), __classPrivateFieldGet(this, _BWellSDK_config, "f").tokenStorage);
|
|
540
226
|
if (tokenManagerInit.failure()) {
|
|
541
227
|
return tokenManagerInit.intoFailure();
|
|
542
228
|
}
|
|
543
229
|
__classPrivateFieldSet(this, _BWellSDK_tokenManager, tokenManagerInit.data(), "f");
|
|
544
230
|
__classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_reinitializeBaseDependencies).call(this);
|
|
545
231
|
__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");
|
|
547
232
|
return BWellTransactionResult.success(null);
|
|
548
233
|
});
|
|
549
234
|
}, _BWellSDK_getApiProvider = function _BWellSDK_getApiProvider() {
|
|
550
|
-
if (
|
|
551
|
-
throw new Error("
|
|
235
|
+
if (__classPrivateFieldGet(this, _BWellSDK_apiProvider, "f") === undefined) {
|
|
236
|
+
throw new Error("Unintialized");
|
|
552
237
|
}
|
|
553
238
|
return __classPrivateFieldGet(this, _BWellSDK_apiProvider, "f");
|
|
554
239
|
}, _BWellSDK_reinitializeBaseDependencies = function _BWellSDK_reinitializeBaseDependencies() {
|
|
@@ -564,5 +249,5 @@ _BWellSDK_config = new WeakMap(), _BWellSDK_sdkConfig = new WeakMap(), _BWellSDK
|
|
|
564
249
|
}
|
|
565
250
|
return new OpenTelemetry(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"));
|
|
566
251
|
}, _BWellSDK_initApiProvider = function _BWellSDK_initApiProvider(tokenManager) {
|
|
567
|
-
return __classPrivateFieldGet(this, _BWellSDK_apiProviderFactory, "f").createApiProvider(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f")
|
|
252
|
+
return __classPrivateFieldGet(this, _BWellSDK_apiProviderFactory, "f").createApiProvider(__classPrivateFieldGet(this, _BWellSDK_sdkConfig, "f"), tokenManager, __classPrivateFieldGet(this, _BWellSDK_loggerProvider, "f"));
|
|
568
253
|
};
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import { Retry } from "../graphql/schema.js";
|
|
1
|
+
import { LogLevel, Retry } from "../graphql/schema.js";
|
|
2
2
|
import type { Language } from "../language/language-manager.js";
|
|
3
|
-
import { LogLevel } from "../models/enums/index.js";
|
|
4
3
|
import { TokenStorage } from "../tokens/token-storage.js";
|
|
5
4
|
import type { Nullable } from "../utils/type-utils.js";
|
|
6
|
-
|
|
7
|
-
* Configuration options for BWellSDK
|
|
8
|
-
* @title BWellConfig
|
|
9
|
-
* @excerpt Configuration options for BWellSDK
|
|
10
|
-
|
|
11
|
-
*/
|
|
5
|
+
export { LogLevel } from "../graphql/schema.js";
|
|
12
6
|
export type BWellConfig = {
|
|
13
7
|
clientKey: string;
|
|
14
8
|
logLevel?: LogLevel;
|
|
@@ -34,11 +28,17 @@ export type BWellConfig = {
|
|
|
34
28
|
language?: Nullable<Language>;
|
|
35
29
|
overrides?: {
|
|
36
30
|
/**
|
|
37
|
-
* Base URL for the BWell API.
|
|
38
|
-
* If not provided, the SDK will use the URL returned by
|
|
39
|
-
* NOTE: Changing this setting will override remote
|
|
31
|
+
* Base unauthed URL for the BWell API.
|
|
32
|
+
* If not provided, the SDK will use the URL returned by the Client Config Service.
|
|
33
|
+
* NOTE: Changing this setting will override the remote config.
|
|
40
34
|
*/
|
|
41
|
-
|
|
35
|
+
unauthedApiUrl?: Nullable<string>;
|
|
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>;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
export declare const DEFAULT_BWELL_CONFIG: Required<Omit<BWellConfig, "clientKey">>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { LogLevel } from "../graphql/schema.js";
|
|
1
2
|
import { InMemoryTokenStorage } from "../tokens/token-storage.js";
|
|
3
|
+
export { LogLevel } from "../graphql/schema.js";
|
|
2
4
|
export const DEFAULT_BWELL_CONFIG = {
|
|
3
|
-
logLevel:
|
|
5
|
+
logLevel: LogLevel.Error,
|
|
4
6
|
timeout: 30000,
|
|
5
7
|
retryPolicy: {
|
|
6
8
|
attempts: 3,
|
|
@@ -10,6 +12,7 @@ export const DEFAULT_BWELL_CONFIG = {
|
|
|
10
12
|
tokenStorage: new InMemoryTokenStorage(),
|
|
11
13
|
language: null,
|
|
12
14
|
overrides: {
|
|
13
|
-
|
|
15
|
+
unauthedApiUrl: null,
|
|
16
|
+
authedApiUrl: null,
|
|
14
17
|
},
|
|
15
18
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { SdkConfigurationResult } from "../api/base/identity/index.js";
|
|
1
2
|
import { InvalidClientKeyError } from "../errors/index.js";
|
|
2
3
|
import { Retry } from "../graphql/schema.js";
|
|
3
4
|
import { Severity } from "../logger/index.js";
|
|
4
|
-
import {
|
|
5
|
-
import { User } from "../models/user/user.js";
|
|
5
|
+
import { User } from "../models/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;
|
|
11
12
|
};
|
|
12
13
|
export type TelemetryConfig = {
|
|
13
14
|
collectorUrl: string;
|