@icanbwell/bwell-sdk-ts 2.0.0-alpha.0-rc.1754330797 → 2.0.0-alpha.0-rc.1754488327
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 +17 -1
- package/dist/__version__.d.ts +1 -1
- package/dist/__version__.js +1 -1
- package/dist/api/base/connection/connection-manager.d.ts +55 -49
- 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 -2
- package/dist/api/base/health-data/health-data-request.d.ts +105 -0
- package/dist/api/base/health-data/health-data-request.js +81 -0
- package/dist/api/base/health-data/health-manager.d.ts +104 -64
- package/dist/api/base/health-data/index.d.ts +1 -1
- 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-data/medication-pricing-request.d.ts +9 -0
- package/dist/api/base/health-data/medication-pricing-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 +33 -24
- package/dist/api/base/health-space/index.d.ts +2 -2
- package/dist/api/base/health-space/index.js +1 -1
- package/dist/api/base/identity/identity-manager.d.ts +97 -10
- package/dist/api/base/questionnaire/index.d.ts +1 -1
- 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 +16 -9
- package/dist/api/base/requests/search-date.d.ts +12 -0
- 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/user/create-consent-request.d.ts +13 -1
- package/dist/api/base/user/create-consent-request.js +8 -3
- 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 +50 -55
- package/dist/api/base/user/validators.d.ts +5 -0
- package/dist/api/base/user/validators.js +13 -0
- package/dist/api/graphql-api/connection/connection-response-factory.d.ts +1 -1
- package/dist/api/graphql-api/connection/connection-response-factory.js +1 -4
- package/dist/api/graphql-api/connection/graphql-connection-manager.d.ts +7 -6
- package/dist/api/graphql-api/connection/graphql-connection-manager.js +6 -3
- package/dist/api/graphql-api/errors/errors.js +1 -1
- 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 -4
- package/dist/api/graphql-api/health-space/graphql-health-space-manager.js +7 -6
- package/dist/api/graphql-api/healthdata/graphql-health-manager.d.ts +13 -12
- package/dist/api/graphql-api/identity/graphql-identity-manager.d.ts +2 -1
- package/dist/api/graphql-api/identity/graphql-identity-manager.js +4 -2
- package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.d.ts +3 -2
- package/dist/api/graphql-api/questionnaire/graphql-questionnaire-manager.js +2 -1
- package/dist/api/graphql-api/user/graphql-user-manager.d.ts +7 -7
- package/dist/api/graphql-api/user/graphql-user-manager.js +7 -4
- package/dist/api/graphql-api/user/update-profile-request-factory.js +1 -2
- package/dist/auth/auth-code-strategy.d.ts +2 -1
- package/dist/auth/auth-strategy.d.ts +1 -1
- package/dist/auth/oauth-strategy.d.ts +2 -1
- package/dist/auth/username-password-strategy.d.ts +2 -1
- package/dist/bwell-sdk/bwell-sdk.d.ts +289 -33
- package/dist/bwell-sdk/bwell-sdk.js +294 -30
- package/dist/config/bwell-config.d.ts +8 -2
- package/dist/config/bwell-config.js +1 -3
- package/dist/config/sdk-config.d.ts +1 -1
- 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 +30 -30
- package/dist/graphql/operations/index.js +6 -4
- package/dist/graphql/operations/types.d.ts +242 -6
- package/dist/graphql/schema.d.ts +90 -277
- package/dist/graphql/schema.js +1 -369
- 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/common/address.d.ts +41 -0
- package/dist/models/common/annotation.d.ts +18 -0
- package/dist/models/common/attachment.d.ts +18 -0
- package/dist/models/common/bundle.d.ts +59 -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 +28 -0
- package/dist/models/common/contact-point.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 +47 -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 +23 -0
- package/dist/models/common/index.js +2 -0
- package/dist/models/common/location.d.ts +44 -0
- package/dist/models/common/location.js +1 -0
- package/dist/models/common/meta.d.ts +21 -0
- package/dist/models/common/meta.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/paging-info.d.ts +18 -0
- package/dist/models/common/paging-info.js +1 -0
- package/dist/models/common/period.d.ts +14 -0
- package/dist/models/common/period.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 +26 -0
- package/dist/models/common/reference.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 +25 -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/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/index.d.ts +9 -0
- package/dist/models/enums/index.js +4 -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/sync-status.d.ts +9 -0
- package/dist/models/enums/sync-status.js +1 -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-entry.d.ts +11 -0
- package/dist/models/health-data/allergy-intolerance-entry.js +1 -0
- package/dist/models/health-data/allergy-intolerance-group.d.ts +36 -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 +46 -0
- package/dist/models/health-data/allergy-intolerance.js +1 -0
- package/dist/models/health-data/care-plan-group.d.ts +34 -0
- package/dist/models/health-data/care-plan-group.js +1 -0
- package/dist/models/health-data/condition-group.d.ts +34 -0
- package/dist/models/health-data/condition-group.js +1 -0
- package/dist/models/health-data/diagnostic-report-lab-group.d.ts +37 -0
- package/dist/models/health-data/diagnostic-report-lab-group.js +1 -0
- package/dist/models/health-data/encounter-group.d.ts +40 -0
- package/dist/models/health-data/encounter-group.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 +33 -0
- package/dist/models/health-data/immunization-group.js +1 -0
- package/dist/models/health-data/index.d.ts +15 -0
- package/dist/models/health-data/index.js +1 -0
- package/dist/models/health-data/lab-group.d.ts +43 -0
- package/dist/models/health-data/lab-group.js +1 -0
- package/dist/models/health-data/medication-group.d.ts +35 -0
- package/dist/models/health-data/medication-group.js +1 -0
- package/dist/models/health-data/procedure-group.d.ts +35 -0
- package/dist/models/health-data/procedure-group.js +1 -0
- package/dist/models/health-data/vital-sign-group.d.ts +43 -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-entry.d.ts +11 -0
- package/dist/models/health-space/appointment-entry.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 +6 -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 +27 -0
- package/dist/models/identity/sdk-configuration-result.js +1 -0
- package/dist/models/index.d.ts +7 -4
- package/dist/models/index.js +7 -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/user/consent.d.ts +91 -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/tokens/load-auth-tokens.d.ts +1 -1
- package/dist/tokens/token-storage.d.ts +4 -0
- package/dist/tokens/token-storage.js +2 -0
- package/package.json +5 -2
- package/dist/api/base/connection/connection.d.ts +0 -19
- package/dist/api/base/health-space/cancelationReasons-request.d.ts +0 -16
- package/dist/api/base/user/types.d.ts +0 -9
- package/dist/api/base/user/types.js +0 -17
- 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/{api/base/connection/connection.js → models/common/address.js} +0 -0
- /package/dist/models/{coding.js → common/annotation.js} +0 -0
- /package/dist/models/{fhir-error.js → common/attachment.js} +0 -0
- /package/dist/models/{user.js → common/bundle.js} +0 -0
- /package/dist/{models → results}/operation-outcome.d.ts +0 -0
- /package/dist/{models → results}/operation-outcome.js +0 -0
|
@@ -1,78 +1,73 @@
|
|
|
1
1
|
import { ValidationError } from "../../../errors/validation-error.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Consent, Person, VerificationResult } from "../../../models/user/index.js";
|
|
3
3
|
import type { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
4
4
|
import { BaseManagerError } from "../errors.js";
|
|
5
5
|
import { CreateConsentRequest } from "./create-consent-request.js";
|
|
6
6
|
import { CreateVerificationUrlRequest } from "./create-verification-url-request.js";
|
|
7
7
|
import { UpdateProfileRequest } from "./update-profile-request.js";
|
|
8
|
-
export type ProfileResults = GetProfileQueryResults["userProfile"];
|
|
9
|
-
export type DeleteUserResultsType = DeleteMutationResults["updateUserAccountStatus"];
|
|
10
|
-
export interface DeleteUserResults extends DeleteUserResultsType {
|
|
11
|
-
}
|
|
12
|
-
export type UpdateProfileResults = UpdateUserProfileMutationResults["updateUserProfile"];
|
|
13
|
-
export type CreateConsentResults = CreateConsentMutationResults["createConsent"];
|
|
14
|
-
export type CreateVerificationUrlResults = CreateVerificationUrlMutationResults["createVerificationUrl"];
|
|
15
|
-
export type GetVerificationStatusResults = VerificationStatusQueryResults["verificationStatus"];
|
|
16
8
|
/**
|
|
17
|
-
*
|
|
9
|
+
* User Manager for profile management, consent handling, and identity verification.
|
|
10
|
+
* Provides methods for managing user data, including FHIR Consent.
|
|
11
|
+
*
|
|
12
|
+
* @title UserManager
|
|
13
|
+
* @excerpt User Manager for profile management, consent handling, and identity verification
|
|
14
|
+
* @category Managers
|
|
18
15
|
*/
|
|
19
16
|
export interface UserManager {
|
|
20
17
|
/**
|
|
21
|
-
* Retrieves
|
|
22
|
-
*
|
|
23
|
-
* @
|
|
18
|
+
* Retrieves the current user's profile information.
|
|
19
|
+
* Gets demographic data for the authenticated user.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const profile = await sdk.user.getProfile();
|
|
23
|
+
* ```
|
|
24
24
|
*/
|
|
25
|
-
getProfile(): Promise<BWellQueryResult<
|
|
25
|
+
getProfile(): Promise<BWellQueryResult<Person, BaseManagerError>>;
|
|
26
26
|
/**
|
|
27
|
-
* Deletes
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
27
|
+
* Deletes the current user's account and all associated data.
|
|
28
|
+
* Permanently removes the user from the system.
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* await sdk.user.delete();
|
|
32
|
+
* ```
|
|
30
33
|
*/
|
|
31
34
|
delete(): Promise<BWellTransactionResult<null, BaseManagerError>>;
|
|
32
35
|
/**
|
|
33
|
-
* Updates
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* Retreives a list of Consents.
|
|
40
|
-
*
|
|
41
|
-
* @param {GetConsentsRequest} request - Request object containing the consent category to search by
|
|
42
|
-
* @return {Promise<BWellQueryResult<GetConsentsResults, BaseManagerError>>} An object representing the consent data from the user
|
|
43
|
-
*/
|
|
44
|
-
/**
|
|
45
|
-
* Creates a user's Consent
|
|
46
|
-
*
|
|
47
|
-
* @param {CreateConsentRequest} request - Request object containing new consent data
|
|
48
|
-
* @returns {Promise<BWellTransactionResult<CreateConsentResults, BaseManagerError>>} Newly created user consent
|
|
36
|
+
* Updates the user's profile information.
|
|
37
|
+
* Modifies demographic data for the authenticated user.
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* await sdk.user.updateProfile({ firstName: 'John', lastName: 'Doe' });
|
|
41
|
+
* ```
|
|
49
42
|
*/
|
|
50
|
-
|
|
43
|
+
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<Person, BaseManagerError>>;
|
|
51
44
|
/**
|
|
52
|
-
* Creates a
|
|
53
|
-
*
|
|
54
|
-
* @
|
|
55
|
-
*
|
|
45
|
+
* Creates a new user consent.
|
|
46
|
+
* Stores consent preferences for the authenticated user.
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* await sdk.user.createConsent({ category: 'research', permitted: true });
|
|
50
|
+
* ```
|
|
56
51
|
*/
|
|
52
|
+
createConsent(request: CreateConsentRequest): Promise<BWellTransactionResult<Consent, BaseManagerError | ValidationError>>;
|
|
57
53
|
/**
|
|
58
|
-
* Creates a verification URL
|
|
59
|
-
*
|
|
60
|
-
* @
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* - A boolean indicating whether to include an attribute matching check.
|
|
67
|
-
* - Compares the user's current FHIR Person with the verified person data returned by CLEAR and fails the verification if identifying information is not a close enough match (can help prevent bad actors).
|
|
68
|
-
* - Defaults to `false`.
|
|
69
|
-
* @returns {Promise<BWellTransactionResult<CreateVerificationUrlResults, BaseManagerError>>} A promise resolving to a URL string that can be used to initiate the IAL2 verification flow.
|
|
54
|
+
* Creates a verification URL for identity verification.
|
|
55
|
+
* Generates a URL for IAL2 verification flow.
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const verificationUrl = await sdk.user.createVerificationUrl({
|
|
59
|
+
* callbackUrl: 'https://myapp.com/callback'
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
70
62
|
*/
|
|
71
|
-
createVerificationUrl(request: CreateVerificationUrlRequest): Promise<BWellTransactionResult<
|
|
63
|
+
createVerificationUrl(request: CreateVerificationUrlRequest): Promise<BWellTransactionResult<string, BaseManagerError>>;
|
|
72
64
|
/**
|
|
73
|
-
* Retrieves the
|
|
74
|
-
*
|
|
75
|
-
* @
|
|
65
|
+
* Retrieves the user's identity verification status.
|
|
66
|
+
* Gets the current state of IAL2 verification.
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const status = await sdk.user.getVerificationStatus();
|
|
70
|
+
* ```
|
|
76
71
|
*/
|
|
77
|
-
getVerificationStatus(): Promise<BWellTransactionResult<
|
|
72
|
+
getVerificationStatus(): Promise<BWellTransactionResult<VerificationResult, BaseManagerError>>;
|
|
78
73
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CategoryCode, ConsentProvisionType, ConsentStatus, PersonGender } from "../../../models/enums/index.js";
|
|
2
|
+
export declare function isValidPersonGender(gender: string): gender is PersonGender;
|
|
3
|
+
export declare function isValidConsentStatus(status: string): status is ConsentStatus;
|
|
4
|
+
export declare function isValidCategoryCode(categoryCode: string): categoryCode is CategoryCode;
|
|
5
|
+
export declare function isValidConsentProvisionType(type: string): type is ConsentProvisionType;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { categoryCodeValues, consentProvisionTypeValues, consentStatusValues, personGenderValues, } from "../../../models/enums/index.js";
|
|
2
|
+
export function isValidPersonGender(gender) {
|
|
3
|
+
return personGenderValues.includes(gender);
|
|
4
|
+
}
|
|
5
|
+
export function isValidConsentStatus(status) {
|
|
6
|
+
return consentStatusValues.includes(status);
|
|
7
|
+
}
|
|
8
|
+
export function isValidCategoryCode(categoryCode) {
|
|
9
|
+
return categoryCodeValues.includes(categoryCode);
|
|
10
|
+
}
|
|
11
|
+
export function isValidConsentProvisionType(type) {
|
|
12
|
+
return consentProvisionTypeValues.includes(type);
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetMemberConnectionsQueryResults } from "../../../graphql/operations/types.js";
|
|
2
|
+
import { MemberConnection } from "../../../models/index.js";
|
|
2
3
|
import { BWellQueryResult, BWellQueryResultFactory } from "../../../results/index.js";
|
|
3
|
-
import { MemberConnection } from "../../base/index.js";
|
|
4
4
|
export declare class GraphQLGetMemberConnectionsBWellResponseFactory implements BWellQueryResultFactory<BWellQueryResult<GetMemberConnectionsQueryResults>, BWellQueryResult<MemberConnection[]>> {
|
|
5
5
|
#private;
|
|
6
6
|
create(result: BWellQueryResult<GetMemberConnectionsQueryResults>): BWellQueryResult<MemberConnection[]>;
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _GraphQLGetMemberConnectionsBWellResponseFactory_instances, _GraphQLGetMemberConnectionsBWellResponseFactory_buildFromSubscription;
|
|
7
|
-
import { ConnectionCategory, } from "../../../graphql/schema.js";
|
|
8
7
|
import { BWellQueryResult, } from "../../../results/index.js";
|
|
9
8
|
import { isNotNullOrUndefined, isNullOrUndefined, } from "../../../utils/type-utils.js";
|
|
10
9
|
export class GraphQLGetMemberConnectionsBWellResponseFactory {
|
|
@@ -62,9 +61,7 @@ _GraphQLGetMemberConnectionsBWellResponseFactory_instances = new WeakSet(), _Gra
|
|
|
62
61
|
break;
|
|
63
62
|
case "connection_type": // mapped to category
|
|
64
63
|
connection.category =
|
|
65
|
-
extensionValue.toLowerCase() === "hapi"
|
|
66
|
-
? ConnectionCategory.Basic
|
|
67
|
-
: ConnectionCategory.Oauth;
|
|
64
|
+
extensionValue.toLowerCase() === "hapi" ? "BASIC" : "OAUTH";
|
|
68
65
|
break;
|
|
69
66
|
case "category": // mapped to type
|
|
70
67
|
connection.type = extensionValue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LoggerProvider } from "../../../logger/index.js";
|
|
2
|
+
import type { Connection, ConnectionStatus, DataSource, MemberConnection, OAuthUrl } from "../../../models/index.js";
|
|
2
3
|
import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
3
|
-
import { ConnectionManager, ConnectionRequest,
|
|
4
|
+
import { ConnectionManager, ConnectionRequest, DataSourceRequest } from "../../base/connection/index.js";
|
|
4
5
|
import { BaseManagerError } from "../../base/errors.js";
|
|
5
6
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
6
7
|
import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
@@ -9,9 +10,9 @@ export declare class GraphQLConnectionManager extends GraphQLManager implements
|
|
|
9
10
|
#private;
|
|
10
11
|
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider, memberConnectionsResponseFactory?: GraphQLGetMemberConnectionsBWellResponseFactory);
|
|
11
12
|
getMemberConnections(): Promise<BWellQueryResult<MemberConnection[], BaseManagerError>>;
|
|
12
|
-
getDataSource(request: DataSourceRequest): Promise<BWellQueryResult<
|
|
13
|
-
createConnection(request: ConnectionRequest): Promise<BWellTransactionResult<
|
|
14
|
-
disconnectConnection(request: DataSourceRequest): Promise<BWellTransactionResult<
|
|
15
|
-
deleteConnection(request: DataSourceRequest): Promise<BWellTransactionResult<
|
|
16
|
-
getOauthUrl(request: DataSourceRequest): Promise<BWellQueryResult<
|
|
13
|
+
getDataSource(request: DataSourceRequest): Promise<BWellQueryResult<DataSource, BaseManagerError>>;
|
|
14
|
+
createConnection(request: ConnectionRequest): Promise<BWellTransactionResult<Connection, BaseManagerError>>;
|
|
15
|
+
disconnectConnection(request: DataSourceRequest): Promise<BWellTransactionResult<ConnectionStatus, BaseManagerError>>;
|
|
16
|
+
deleteConnection(request: DataSourceRequest): Promise<BWellTransactionResult<ConnectionStatus, BaseManagerError>>;
|
|
17
|
+
getOauthUrl(request: DataSourceRequest): Promise<BWellQueryResult<OAuthUrl, BaseManagerError>>;
|
|
17
18
|
}
|
|
@@ -80,7 +80,8 @@ export class GraphQLConnectionManager extends GraphQLManager {
|
|
|
80
80
|
return result.intoFailure();
|
|
81
81
|
}
|
|
82
82
|
__classPrivateFieldGet(this, _GraphQLConnectionManager_logger, "f").info("successfully called createConnection");
|
|
83
|
-
return BWellTransactionResult.success(result.data()
|
|
83
|
+
return BWellTransactionResult.success(result.data()
|
|
84
|
+
.createConnection);
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
87
|
disconnectConnection(request) {
|
|
@@ -97,7 +98,8 @@ export class GraphQLConnectionManager extends GraphQLManager {
|
|
|
97
98
|
return result.intoFailure();
|
|
98
99
|
}
|
|
99
100
|
__classPrivateFieldGet(this, _GraphQLConnectionManager_logger, "f").info("successfully called disconnectConnection");
|
|
100
|
-
return BWellTransactionResult.success(result.data()
|
|
101
|
+
return BWellTransactionResult.success(result.data()
|
|
102
|
+
.disconnectConnection);
|
|
101
103
|
});
|
|
102
104
|
}
|
|
103
105
|
deleteConnection(request) {
|
|
@@ -114,7 +116,8 @@ export class GraphQLConnectionManager extends GraphQLManager {
|
|
|
114
116
|
return result.intoFailure();
|
|
115
117
|
}
|
|
116
118
|
__classPrivateFieldGet(this, _GraphQLConnectionManager_logger, "f").info("successfully called deleteConnection");
|
|
117
|
-
return BWellTransactionResult.success(result.data()
|
|
119
|
+
return BWellTransactionResult.success(result.data()
|
|
120
|
+
.deleteConnection);
|
|
118
121
|
});
|
|
119
122
|
}
|
|
120
123
|
getOauthUrl(request) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OperationOutcomeError } from "../../../errors/index.js";
|
|
2
|
-
import { OperationOutcome
|
|
2
|
+
import { OperationOutcome } from "../../../results/index.js";
|
|
3
3
|
import { isNullOrUndefinedOrEmptyString } from "../../../utils/type-utils.js";
|
|
4
4
|
/**
|
|
5
5
|
* Checks errors object for an error that should represent an 500 Internal Server Error.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AppointmentStatus } from "../../../graphql/schema.js";
|
|
2
1
|
/**
|
|
3
2
|
* Factory for creating GraphQL mutation variables to cancel an appointment.
|
|
4
3
|
*
|
|
@@ -22,7 +21,7 @@ export class CancelAppointmentRequestFactory {
|
|
|
22
21
|
return {
|
|
23
22
|
appointment: {
|
|
24
23
|
id: input.id,
|
|
25
|
-
status:
|
|
24
|
+
status: "CANCELLED",
|
|
26
25
|
cancelationReason: input.cancelationReason,
|
|
27
26
|
},
|
|
28
27
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ValidationError } from "../../../errors/index.js";
|
|
2
2
|
import { type LoggerProvider } from "../../../logger/index.js";
|
|
3
|
+
import { AppointmentBundle, AppointmentUpdate, CancellationReasons } from "../../../models/health-space/index.js";
|
|
3
4
|
import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
4
5
|
import type { BaseManagerError } from "../../base/errors.js";
|
|
5
|
-
import { AppointmentsRequest,
|
|
6
|
+
import { AppointmentsRequest, CancelAppointmentRequest, CancellationReasonsRequest, HealthSpaceManager } from "../../base/index.js";
|
|
6
7
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
7
8
|
import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
8
9
|
export declare class GraphQLHealthSpaceManager extends GraphQLManager implements HealthSpaceManager {
|
|
9
10
|
#private;
|
|
10
11
|
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
|
|
11
|
-
getAppointments(request: AppointmentsRequest): Promise<BWellQueryResult<
|
|
12
|
+
getAppointments(request: AppointmentsRequest): Promise<BWellQueryResult<AppointmentBundle, ValidationError | BaseManagerError>>;
|
|
12
13
|
/**
|
|
13
14
|
* Cancels an appointment by validating the request and calling the GraphQL mutation.
|
|
14
15
|
*
|
|
@@ -22,6 +23,6 @@ export declare class GraphQLHealthSpaceManager extends GraphQLManager implements
|
|
|
22
23
|
* - If the mutation fails, logs the error and returns a failure result.
|
|
23
24
|
* - If successful, returns a success result with the updated appointment data.
|
|
24
25
|
*/
|
|
25
|
-
cancelAppointment(request: CancelAppointmentRequest): Promise<BWellTransactionResult<
|
|
26
|
-
|
|
26
|
+
cancelAppointment(request: CancelAppointmentRequest): Promise<BWellTransactionResult<AppointmentUpdate, BaseManagerError>>;
|
|
27
|
+
getCancellationReasons(request: CancellationReasonsRequest): Promise<BWellQueryResult<CancellationReasons, ValidationError | BaseManagerError>>;
|
|
27
28
|
}
|
|
@@ -80,10 +80,11 @@ export class GraphQLHealthSpaceManager extends GraphQLManager {
|
|
|
80
80
|
return result.intoFailure();
|
|
81
81
|
}
|
|
82
82
|
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").info("successfully called cancel appointment mutation");
|
|
83
|
-
return BWellTransactionResult.success(result.data()
|
|
83
|
+
return BWellTransactionResult.success(result.data()
|
|
84
|
+
.updateAppointment);
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
+
getCancellationReasons(request) {
|
|
87
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
88
89
|
var _a;
|
|
89
90
|
const validationResult = this.validateRequest(request);
|
|
@@ -91,13 +92,13 @@ export class GraphQLHealthSpaceManager extends GraphQLManager {
|
|
|
91
92
|
return validationResult.toQueryResult();
|
|
92
93
|
}
|
|
93
94
|
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").verbose("calling cancelationReasons query...");
|
|
94
|
-
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_sdk, "f").
|
|
95
|
-
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").verbose("
|
|
95
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_sdk, "f").cancellationReasons(request.data()));
|
|
96
|
+
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").verbose("cancellationReasons query complete");
|
|
96
97
|
if (result.hasError()) {
|
|
97
|
-
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").error("
|
|
98
|
+
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").error("cancellationReasons query error", result.error);
|
|
98
99
|
}
|
|
99
100
|
else {
|
|
100
|
-
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").info("successfully called
|
|
101
|
+
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").info("successfully called cancellationReasons query");
|
|
101
102
|
}
|
|
102
103
|
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.cancelationReasons, result.error);
|
|
103
104
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ValidationError } from "../../../errors/index.js";
|
|
2
2
|
import { LoggerProvider } from "../../../logger/index.js";
|
|
3
|
+
import type { AllergyIntoleranceBundle, AllergyIntoleranceGroupBundle, CarePlanGroupBundle, ConditionGroupBundle, DiagnosticReportLabGroupBundle, EncounterGroupBundle, HealthSummary, ImmunizationGroupBundle, LabGroupBundle, MedicationGroupBundle, ProcedureGroupBundle, VitalSignGroupBundle } from "../../../models/health-data/index.js";
|
|
3
4
|
import { BWellQueryResult } from "../../../results/index.js";
|
|
4
5
|
import { BaseManagerError } from "../../base/errors.js";
|
|
5
6
|
import * as health from "../../base/health-data/index.js";
|
|
@@ -9,16 +10,16 @@ import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
|
9
10
|
export declare class GraphQLHealthManager extends GraphQLManager implements HealthManager {
|
|
10
11
|
#private;
|
|
11
12
|
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
|
|
12
|
-
getHealthSummary(): Promise<BWellQueryResult<
|
|
13
|
-
getAllergyIntolerances(request?: health.HealthDataRequest): Promise<BWellQueryResult<
|
|
14
|
-
getAllergyIntoleranceGroups(request?: health.AllergyIntoleranceGroupsRequest): Promise<BWellQueryResult<
|
|
15
|
-
getConditionGroups(request?: health.ConditionGroupsRequest): Promise<BWellQueryResult<
|
|
16
|
-
getLabGroups(request?: health.LabGroupsRequest): Promise<BWellQueryResult<
|
|
17
|
-
getCarePlanGroups(request?: health.CarePlanGroupsRequest): Promise<BWellQueryResult<
|
|
18
|
-
getEncounterGroups(request?: health.EncounterGroupsRequest): Promise<BWellQueryResult<
|
|
19
|
-
getImmunizationGroups(request?: health.ImmunizationGroupsRequest): Promise<BWellQueryResult<
|
|
20
|
-
getProcedureGroups(request?: health.ProcedureGroupsRequest): Promise<BWellQueryResult<
|
|
21
|
-
getVitalSignGroups(request?: health.VitalSignGroupsRequest): Promise<BWellQueryResult<
|
|
22
|
-
getMedicationGroups(request?: health.MedicationGroupsRequest): Promise<BWellQueryResult<
|
|
23
|
-
getDiagnosticReportLabGroups(request?: health.DiagnosticReportLabGroupsRequest): Promise<BWellQueryResult<
|
|
13
|
+
getHealthSummary(): Promise<BWellQueryResult<HealthSummary, BaseManagerError>>;
|
|
14
|
+
getAllergyIntolerances(request?: health.HealthDataRequest): Promise<BWellQueryResult<AllergyIntoleranceBundle, BaseManagerError>>;
|
|
15
|
+
getAllergyIntoleranceGroups(request?: health.AllergyIntoleranceGroupsRequest): Promise<BWellQueryResult<AllergyIntoleranceGroupBundle, ValidationError | BaseManagerError>>;
|
|
16
|
+
getConditionGroups(request?: health.ConditionGroupsRequest): Promise<BWellQueryResult<ConditionGroupBundle, ValidationError | BaseManagerError>>;
|
|
17
|
+
getLabGroups(request?: health.LabGroupsRequest): Promise<BWellQueryResult<LabGroupBundle, ValidationError | BaseManagerError>>;
|
|
18
|
+
getCarePlanGroups(request?: health.CarePlanGroupsRequest): Promise<BWellQueryResult<CarePlanGroupBundle, ValidationError | BaseManagerError>>;
|
|
19
|
+
getEncounterGroups(request?: health.EncounterGroupsRequest): Promise<BWellQueryResult<EncounterGroupBundle, ValidationError | BaseManagerError>>;
|
|
20
|
+
getImmunizationGroups(request?: health.ImmunizationGroupsRequest): Promise<BWellQueryResult<ImmunizationGroupBundle, ValidationError | BaseManagerError>>;
|
|
21
|
+
getProcedureGroups(request?: health.ProcedureGroupsRequest): Promise<BWellQueryResult<ProcedureGroupBundle, ValidationError | BaseManagerError>>;
|
|
22
|
+
getVitalSignGroups(request?: health.VitalSignGroupsRequest): Promise<BWellQueryResult<VitalSignGroupBundle, ValidationError | BaseManagerError>>;
|
|
23
|
+
getMedicationGroups(request?: health.MedicationGroupsRequest): Promise<BWellQueryResult<MedicationGroupBundle, ValidationError | BaseManagerError>>;
|
|
24
|
+
getDiagnosticReportLabGroups(request?: health.DiagnosticReportLabGroupsRequest): Promise<BWellQueryResult<DiagnosticReportLabGroupBundle, ValidationError | BaseManagerError>>;
|
|
24
25
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type LoggerProvider } from "../../../logger/index.js";
|
|
2
|
+
import { AuthTokens, CreateGuestAccessTokenResults, RefreshTokenResults, SdkConfigurationResult } from "../../../models/identity/index.js";
|
|
2
3
|
import { BWellTransactionResult } from "../../../results/index.js";
|
|
3
4
|
import { BaseManagerError } from "../../base/errors.js";
|
|
4
|
-
import { AuthCodeAuthenticateRequest, CreateGuestAccessTokenRequest,
|
|
5
|
+
import { AuthCodeAuthenticateRequest, CreateGuestAccessTokenRequest, IdentityManager, UsernamePasswordAuthenticateRequest, type OauthAuthenticateRequest, type RefreshTokensRequest } from "../../base/identity/index.js";
|
|
5
6
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
6
7
|
import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
7
8
|
export declare class GraphQLIdentityManager extends GraphQLManager implements IdentityManager {
|
|
@@ -42,7 +42,8 @@ export class GraphQLIdentityManager extends GraphQLManager {
|
|
|
42
42
|
return initializeResult.intoFailure();
|
|
43
43
|
}
|
|
44
44
|
__classPrivateFieldGet(this, _GraphQLIdentityManager_logger, "f").info("successfully called initialize");
|
|
45
|
-
return BWellTransactionResult.success(initializeResult.data()
|
|
45
|
+
return BWellTransactionResult.success(initializeResult.data()
|
|
46
|
+
.initSdk);
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
authenticateWithOauth(authenticateRequest) {
|
|
@@ -125,7 +126,8 @@ export class GraphQLIdentityManager extends GraphQLManager {
|
|
|
125
126
|
return refreshResult.intoFailure();
|
|
126
127
|
}
|
|
127
128
|
__classPrivateFieldGet(this, _GraphQLIdentityManager_logger, "f").info("refreshAccessToken successful");
|
|
128
|
-
return BWellTransactionResult.success(refreshResult.data()
|
|
129
|
+
return BWellTransactionResult.success(refreshResult.data()
|
|
130
|
+
.refresh);
|
|
129
131
|
});
|
|
130
132
|
}
|
|
131
133
|
createGuestAccessToken(createGuestAccessTokenRequest) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { LoggerProvider } from "../../../logger/index.js";
|
|
2
|
+
import { QuestionnaireResponse } from "../../../models/index.js";
|
|
2
3
|
import { BWellTransactionResult } from "../../../results/index.js";
|
|
3
4
|
import { BaseManagerError } from "../../base/errors.js";
|
|
4
5
|
import { NextQuestionRequest } from "../../base/questionnaire/next-question-request.js";
|
|
5
|
-
import {
|
|
6
|
+
import { QuestionnaireManager } from "../../base/questionnaire/questionnaire-manager.js";
|
|
6
7
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
7
8
|
import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
8
9
|
export declare class GraphQLQuestionnaireManager extends GraphQLManager implements QuestionnaireManager {
|
|
@@ -15,5 +16,5 @@ export declare class GraphQLQuestionnaireManager extends GraphQLManager implemen
|
|
|
15
16
|
* @param request - The request containing the questionnaire response data
|
|
16
17
|
* @returns Promise resolving to the next question results or an error
|
|
17
18
|
*/
|
|
18
|
-
nextQuestion(request: NextQuestionRequest): Promise<BWellTransactionResult<
|
|
19
|
+
nextQuestion(request: NextQuestionRequest): Promise<BWellTransactionResult<QuestionnaireResponse, BaseManagerError>>;
|
|
19
20
|
}
|
|
@@ -51,7 +51,8 @@ export class GraphQLQuestionnaireManager extends GraphQLManager {
|
|
|
51
51
|
return result.intoFailure();
|
|
52
52
|
}
|
|
53
53
|
__classPrivateFieldGet(this, _GraphQLQuestionnaireManager_logger, "f").info("successfully called nextQuestion mutation");
|
|
54
|
-
return BWellTransactionResult.success(result.data()
|
|
54
|
+
return BWellTransactionResult.success(result.data()
|
|
55
|
+
.nextQuestion);
|
|
55
56
|
});
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ValidationError } from "../../../errors/validation-error.js";
|
|
2
2
|
import { LoggerProvider } from "../../../logger/index.js";
|
|
3
|
+
import { Consent, Person, VerificationResult } from "../../../models/user/index.js";
|
|
3
4
|
import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
4
5
|
import { BaseManagerError } from "../../base/errors.js";
|
|
5
|
-
import { CreateConsentResults, ProfileResults, UpdateProfileResults } from "../../base/index.js";
|
|
6
6
|
import { CreateConsentRequest, CreateVerificationUrlRequest, UpdateProfileRequest } from "../../base/user/index.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { UserManager } from "../../base/user/user-manager.js";
|
|
8
8
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
9
9
|
import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
10
10
|
export declare class GraphQLUserManager extends GraphQLManager implements UserManager {
|
|
11
11
|
#private;
|
|
12
12
|
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
|
|
13
|
-
getProfile(): Promise<BWellQueryResult<
|
|
13
|
+
getProfile(): Promise<BWellQueryResult<Person, BaseManagerError>>;
|
|
14
14
|
delete(): Promise<BWellTransactionResult<null, BaseManagerError>>;
|
|
15
|
-
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<
|
|
16
|
-
createConsent(request: CreateConsentRequest): Promise<BWellTransactionResult<
|
|
17
|
-
createVerificationUrl(request: CreateVerificationUrlRequest): Promise<BWellTransactionResult<
|
|
18
|
-
getVerificationStatus(): Promise<BWellTransactionResult<
|
|
15
|
+
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<Person, BaseManagerError>>;
|
|
16
|
+
createConsent(request: CreateConsentRequest): Promise<BWellTransactionResult<Consent, BaseManagerError | ValidationError>>;
|
|
17
|
+
createVerificationUrl(request: CreateVerificationUrlRequest): Promise<BWellTransactionResult<string, BaseManagerError>>;
|
|
18
|
+
getVerificationStatus(): Promise<BWellTransactionResult<VerificationResult, BaseManagerError>>;
|
|
19
19
|
}
|
|
@@ -82,7 +82,8 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
82
82
|
return result.intoFailure();
|
|
83
83
|
}
|
|
84
84
|
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").info("updateUserProfile success");
|
|
85
|
-
return BWellTransactionResult.success(result.data()
|
|
85
|
+
return BWellTransactionResult.success(result.data()
|
|
86
|
+
.updateUserProfile);
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
// TODO: Migrate
|
|
@@ -113,7 +114,7 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
113
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
115
|
const validationResult = request.validate();
|
|
115
116
|
if (validationResult.failure()) {
|
|
116
|
-
return validationResult;
|
|
117
|
+
return validationResult.intoFailure();
|
|
117
118
|
}
|
|
118
119
|
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").verbose("calling createConsent mutation...");
|
|
119
120
|
const result = yield this.handleTransaction(__classPrivateFieldGet(this, _GraphQLUserManager_sdk, "f").createConsent(__classPrivateFieldGet(this, _GraphQLUserManager_createConsentRequestFactory, "f").create(request)));
|
|
@@ -123,7 +124,8 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
123
124
|
return result.intoFailure();
|
|
124
125
|
}
|
|
125
126
|
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").info("createConsent mutation success");
|
|
126
|
-
return BWellTransactionResult.success(result.data()
|
|
127
|
+
return BWellTransactionResult.success(result.data()
|
|
128
|
+
.createConsent);
|
|
127
129
|
});
|
|
128
130
|
}
|
|
129
131
|
// TODO: Migrate
|
|
@@ -170,7 +172,8 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
170
172
|
return result.intoFailure();
|
|
171
173
|
}
|
|
172
174
|
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").info("createVerificationUrl success");
|
|
173
|
-
return BWellTransactionResult.success(result.data()
|
|
175
|
+
return BWellTransactionResult.success(result.data()
|
|
176
|
+
.createVerificationUrl);
|
|
174
177
|
});
|
|
175
178
|
}
|
|
176
179
|
getVerificationStatus() {
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _UpdateProfileRequestFactory_instances, _UpdateProfileRequestFactory_transformScalarInput, _UpdateProfileRequestFactory_transformNameInput, _UpdateProfileRequestFactory_transformAddressInput, _UpdateProfileRequestFactory_transformGenderInput, _UpdateProfileRequestFactory_transformTelecomInput;
|
|
7
|
-
import { FhirPersonResourceType, } from "../../../graphql/schema.js";
|
|
8
7
|
import { isNotNullOrUndefined, isUndefined } from "../../../utils/index.js";
|
|
9
8
|
export class UpdateProfileRequestFactory {
|
|
10
9
|
constructor() {
|
|
@@ -13,7 +12,7 @@ export class UpdateProfileRequestFactory {
|
|
|
13
12
|
create(request) {
|
|
14
13
|
const input = request.data();
|
|
15
14
|
const data = {
|
|
16
|
-
resourceType:
|
|
15
|
+
resourceType: "Person",
|
|
17
16
|
};
|
|
18
17
|
__classPrivateFieldGet(this, _UpdateProfileRequestFactory_instances, "m", _UpdateProfileRequestFactory_transformScalarInput).call(this, "id", input.id, data);
|
|
19
18
|
__classPrivateFieldGet(this, _UpdateProfileRequestFactory_instances, "m", _UpdateProfileRequestFactory_transformScalarInput).call(this, "birthDate", input.birthDate, data);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IdentityManager } from "../api/base/identity/index.js";
|
|
2
2
|
import { SdkConfig } from "../config/index.js";
|
|
3
3
|
import { LoggerProvider } from "../logger/index.js";
|
|
4
|
+
import { AuthTokens } from "../models/identity/index.js";
|
|
4
5
|
import { BWellTransactionResult } from "../results/index.js";
|
|
5
6
|
import { AuthenticateErrors, AuthStrategy } from "./auth-strategy.js";
|
|
6
7
|
import { Credentials } from "./credentials.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseManagerError } from "../api/base/errors.js";
|
|
2
|
-
import type { AuthTokens } from "../api/base/identity/index.js";
|
|
3
2
|
import type { InvalidCredentialsTypeError } from "../errors/index.js";
|
|
3
|
+
import type { AuthTokens } from "../models/identity/auth-tokens.js";
|
|
4
4
|
import type { BWellTransactionResult } from "../results/index.js";
|
|
5
5
|
import type { Credentials } from "./credentials.js";
|
|
6
6
|
export type AuthenticateErrors = InvalidCredentialsTypeError | BaseManagerError;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IdentityManager } from "../api/base/identity/index.js";
|
|
2
2
|
import { SdkConfig } from "../config/index.js";
|
|
3
3
|
import { LoggerProvider } from "../logger/index.js";
|
|
4
|
+
import { AuthTokens } from "../models/identity/index.js";
|
|
4
5
|
import { BWellTransactionResult } from "../results/index.js";
|
|
5
6
|
import { AuthenticateErrors, AuthStrategy } from "./auth-strategy.js";
|
|
6
7
|
import { Credentials } from "./credentials.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IdentityManager } from "../api/base/identity/identity-manager.js";
|
|
2
2
|
import { SdkConfig } from "../config/index.js";
|
|
3
3
|
import { LoggerProvider } from "../logger/index.js";
|
|
4
|
+
import { AuthTokens } from "../models/identity/index.js";
|
|
4
5
|
import { BWellTransactionResult } from "../results/index.js";
|
|
5
6
|
import { AuthStrategy } from "./auth-strategy.js";
|
|
6
7
|
import type { AuthenticateErrors } from "./auth-strategy.js";
|