@icanbwell/bwell-sdk-ts 2.0.0-alpha.0-rc.1755847440 → 2.0.0-alpha.0-rc.1756407930
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/dist/__version__.d.ts +1 -1
- package/dist/__version__.js +1 -1
- package/dist/api/base/device/device-request.d.ts +3 -2
- package/dist/api/base/device/device-request.js +2 -2
- package/dist/api/base/device/index.d.ts +0 -1
- package/dist/api/base/device/index.js +0 -1
- package/dist/api/base/search/index.d.ts +1 -1
- package/dist/api/base/search/search-health-resources-request.d.ts +12 -0
- package/dist/api/base/search/search-health-resources-request.js +3 -0
- package/dist/api/base/search/submit-provider-for-review-request.d.ts +9 -0
- package/dist/api/base/search/submit-provider-for-review-request.js +6 -0
- package/dist/api/base/user/create-data-export-direct-download-url-request.d.ts +4 -0
- package/dist/api/base/user/user-manager.d.ts +31 -2
- package/dist/api/graphql-api/user/get-consent-request-factory.d.ts +5 -0
- package/dist/api/graphql-api/user/get-consent-request-factory.js +12 -0
- package/dist/api/graphql-api/user/graphql-user-manager.d.ts +3 -2
- package/dist/api/graphql-api/user/graphql-user-manager.js +27 -34
- package/dist/bwell-sdk/bwell-sdk.d.ts +2 -0
- package/dist/bwell-sdk/bwell-sdk.js +2 -0
- package/dist/graphql/operations/index.d.ts +8 -0
- package/dist/graphql/operations/index.js +33 -0
- package/dist/graphql/operations/types.d.ts +58 -0
- package/dist/models/device/device-registration-results.d.ts +12 -0
- package/dist/models/device/device-registration-results.js +1 -0
- package/dist/models/device/index.d.ts +1 -3
- package/dist/models/search/health-resources.d.ts +8 -0
- package/dist/models/search/provider-review-result.d.ts +10 -0
- package/dist/models/user/consent.d.ts +21 -1
- package/dist/models/user/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/__version__.d.ts
CHANGED
package/dist/__version__.js
CHANGED
|
@@ -15,7 +15,7 @@ export type RegisterDeviceRequestInput = {
|
|
|
15
15
|
* Validator for RegisterDeviceRequestInput.
|
|
16
16
|
* Validates device token, platform name, and application name fields.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
declare class RegisterDeviceRequestValidator implements Validator<RegisterDeviceRequestInput> {
|
|
19
19
|
validate(data: RegisterDeviceRequestInput, errors: ErrorsCollector): void;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -40,7 +40,7 @@ export type DeregisterDeviceRequestInput = {
|
|
|
40
40
|
* Validator for DeregisterDeviceRequestInput.
|
|
41
41
|
* Validates the device token field.
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
declare class DeregisterDeviceRequestValidator implements Validator<DeregisterDeviceRequestInput> {
|
|
44
44
|
validate(data: DeregisterDeviceRequestInput, errors: ErrorsCollector): void;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
@@ -52,3 +52,4 @@ export declare class DeregisterDeviceRequestValidator implements Validator<Dereg
|
|
|
52
52
|
export declare class DeregisterDeviceRequest extends ValidationRequest<DeregisterDeviceRequestInput> {
|
|
53
53
|
protected validator: DeregisterDeviceRequestValidator;
|
|
54
54
|
}
|
|
55
|
+
export {};
|
|
@@ -9,7 +9,7 @@ const isValidDevicePlatform = (value) => {
|
|
|
9
9
|
* Validator for RegisterDeviceRequestInput.
|
|
10
10
|
* Validates device token, platform name, and application name fields.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
class RegisterDeviceRequestValidator {
|
|
13
13
|
validate(data, errors) {
|
|
14
14
|
if (isBlank(data.deviceToken)) {
|
|
15
15
|
errors.add(INVALID_DEVICE_TOKEN_ERROR);
|
|
@@ -38,7 +38,7 @@ export class RegisterDeviceRequest extends ValidationRequest {
|
|
|
38
38
|
* Validator for DeregisterDeviceRequestInput.
|
|
39
39
|
* Validates the device token field.
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
class DeregisterDeviceRequestValidator {
|
|
42
42
|
validate(data, errors) {
|
|
43
43
|
if (isBlank(data.deviceToken)) {
|
|
44
44
|
errors.add(INVALID_DEVICE_TOKEN_ERROR);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { SearchManager } from "./search-manager.js";
|
|
2
2
|
export { SubmitProviderForReviewRequestInput, SubmitProviderForReviewRequest, } from "./submit-provider-for-review-request.js";
|
|
3
|
-
export { SearchHealthResourcesRequest, SearchHealthResourcesRequestInput, } from "./search-health-resources-request.js";
|
|
3
|
+
export { SearchHealthResourcesRequest, SearchHealthResourcesRequestInput, SearchPosition, OrderBy, } from "./search-health-resources-request.js";
|
|
@@ -3,6 +3,9 @@ import { SortField, SortOrder } from "../../../models/enums/index.js";
|
|
|
3
3
|
import { PagedRequest, PagedRequestInput, PagedRequestValidator } from "../../../requests/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* The provider location to search by
|
|
6
|
+
* @category Inputs
|
|
7
|
+
* @title SearchPosition
|
|
8
|
+
* @excerpt Position coordinates for location-based searches
|
|
6
9
|
*/
|
|
7
10
|
export type SearchPosition = {
|
|
8
11
|
/**
|
|
@@ -20,6 +23,9 @@ export type SearchPosition = {
|
|
|
20
23
|
};
|
|
21
24
|
/**
|
|
22
25
|
* Type representing a provider search result sorting
|
|
26
|
+
* @category Inputs
|
|
27
|
+
* @title OrderBy
|
|
28
|
+
* @excerpt Sorting configuration for search results
|
|
23
29
|
*/
|
|
24
30
|
export type OrderBy = {
|
|
25
31
|
/**
|
|
@@ -34,6 +40,9 @@ export type OrderBy = {
|
|
|
34
40
|
/**
|
|
35
41
|
* Represents the parameters for a search request.
|
|
36
42
|
* @experimental
|
|
43
|
+
* @category Inputs
|
|
44
|
+
* @title SearchHealthResourcesRequestInput
|
|
45
|
+
* @excerpt Input parameters for searching health resources
|
|
37
46
|
*/
|
|
38
47
|
export type SearchHealthResourcesRequestInput = PagedRequestInput & {
|
|
39
48
|
/**
|
|
@@ -65,6 +74,9 @@ export type SearchHealthResourcesRequestInput = PagedRequestInput & {
|
|
|
65
74
|
/**
|
|
66
75
|
* Request for searching health resources.
|
|
67
76
|
* @experimental
|
|
77
|
+
* @category Requests
|
|
78
|
+
* @title SearchHealthResourcesRequest
|
|
79
|
+
* @excerpt Request class for searching health resources
|
|
68
80
|
*/
|
|
69
81
|
export declare class SearchHealthResourcesRequest extends PagedRequest<SearchHealthResourcesRequestInput> {
|
|
70
82
|
protected validator: PagedRequestValidator<SearchHealthResourcesRequestInput>;
|
|
@@ -2,6 +2,9 @@ import { PagedRequest, PagedRequestValidator, } from "../../../requests/index.js
|
|
|
2
2
|
/**
|
|
3
3
|
* Request for searching health resources.
|
|
4
4
|
* @experimental
|
|
5
|
+
* @category Requests
|
|
6
|
+
* @title SearchHealthResourcesRequest
|
|
7
|
+
* @excerpt Request class for searching health resources
|
|
5
8
|
*/
|
|
6
9
|
export class SearchHealthResourcesRequest extends PagedRequest {
|
|
7
10
|
constructor() {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { BaseRequest } from "../../../requests/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Parameters for submitting a provider or facility request
|
|
4
|
+
* @category Inputs
|
|
5
|
+
* @title SubmitProviderForReviewRequestInput
|
|
6
|
+
* @excerpt Input parameters for submitting a provider or facility for review
|
|
4
7
|
*/
|
|
5
8
|
export type SubmitProviderForReviewRequestInput = {
|
|
6
9
|
/**
|
|
@@ -20,5 +23,11 @@ export type SubmitProviderForReviewRequestInput = {
|
|
|
20
23
|
*/
|
|
21
24
|
city?: string;
|
|
22
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Request class for submitting a provider or facility for review.
|
|
28
|
+
* @category Requests
|
|
29
|
+
* @title SubmitProviderForReviewRequest
|
|
30
|
+
* @excerpt Request for submitting a provider or facility for review
|
|
31
|
+
*/
|
|
23
32
|
export declare class SubmitProviderForReviewRequest extends BaseRequest<SubmitProviderForReviewRequestInput> {
|
|
24
33
|
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import { BaseRequest } from "../../../requests/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Request class for submitting a provider or facility for review.
|
|
4
|
+
* @category Requests
|
|
5
|
+
* @title SubmitProviderForReviewRequest
|
|
6
|
+
* @excerpt Request for submitting a provider or facility for review
|
|
7
|
+
*/
|
|
2
8
|
export class SubmitProviderForReviewRequest extends BaseRequest {
|
|
3
9
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
2
2
|
/**
|
|
3
|
+
* Input type for creating a direct download URL for a data export. Requires export ID and password for secure access.
|
|
4
|
+
* @category Inputs
|
|
5
|
+
* @title CreateDataExportDirectDownloadUrlRequestInput
|
|
6
|
+
* @excerpt Input for creating data export direct download URLs
|
|
3
7
|
*/
|
|
4
8
|
export type CreateDataExportDirectDownloadUrlRequestInput = {
|
|
5
9
|
exportId: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ValidationError } from "../../../errors/validation-error.js";
|
|
2
|
-
import { Consent, Person, VerificationResult } from "../../../models/user/index.js";
|
|
2
|
+
import { Consent, ConsentBundle, 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
|
-
import { CreateDataExportDirectDownloadUrlRequest } from "./index.js";
|
|
7
|
+
import { CreateDataExportDirectDownloadUrlRequest, GetConsentsRequest } from "./index.js";
|
|
8
8
|
import { UpdateProfileRequest } from "./update-profile-request.js";
|
|
9
9
|
/**
|
|
10
10
|
* User Manager for profile management, consent handling, and identity verification.
|
|
@@ -18,6 +18,8 @@ export interface UserManager {
|
|
|
18
18
|
/**
|
|
19
19
|
* Retrieves the current user's profile information.
|
|
20
20
|
* Gets demographic data for the authenticated user.
|
|
21
|
+
*
|
|
22
|
+
* @returns {Promise<BWellQueryResult<Person, BaseManagerError>>} - The user's profile information
|
|
21
23
|
* @example
|
|
22
24
|
* ```typescript
|
|
23
25
|
* const profile = await sdk.user.getProfile();
|
|
@@ -27,6 +29,8 @@ export interface UserManager {
|
|
|
27
29
|
/**
|
|
28
30
|
* Deletes the current user's account and all associated data.
|
|
29
31
|
* Permanently removes the user from the system.
|
|
32
|
+
*
|
|
33
|
+
* @returns {Promise<BWellTransactionResult<null, BaseManagerError>>} - The result of the deletion operation
|
|
30
34
|
* @example
|
|
31
35
|
* ```typescript
|
|
32
36
|
* await sdk.user.delete();
|
|
@@ -36,15 +40,32 @@ export interface UserManager {
|
|
|
36
40
|
/**
|
|
37
41
|
* Updates the user's profile information.
|
|
38
42
|
* Modifies demographic data for the authenticated user.
|
|
43
|
+
*
|
|
44
|
+
* @param {UpdateProfileRequest} request - Object containing the profile fields to update
|
|
45
|
+
* @returns {Promise<BWellTransactionResult<Person, BaseManagerError>>} - The updated user profile
|
|
39
46
|
* @example
|
|
40
47
|
* ```typescript
|
|
41
48
|
* await sdk.user.updateProfile({ firstName: 'John', lastName: 'Doe' });
|
|
42
49
|
* ```
|
|
43
50
|
*/
|
|
44
51
|
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<Person, BaseManagerError>>;
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves a list of consents for the current user, optionally filtered by category.
|
|
54
|
+
*
|
|
55
|
+
* @param {GetConsentsRequest} [request] - Optional request object to filter consents by category
|
|
56
|
+
* @returns {Promise<BWellQueryResult<ConsentBundle, BaseManagerError>>} - A promise that resolves to a query result containing a bundle of consents
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const consents = await sdk.user.getConsents({ category: 'research' });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
getConsents(request?: GetConsentsRequest): Promise<BWellQueryResult<ConsentBundle, BaseManagerError>>;
|
|
45
63
|
/**
|
|
46
64
|
* Creates a new user consent.
|
|
47
65
|
* Stores consent preferences for the authenticated user.
|
|
66
|
+
*
|
|
67
|
+
* @param {CreateConsentRequest} request - Object containing the consent details to create
|
|
68
|
+
* @returns {Promise<BWellTransactionResult<Consent, BaseManagerError | ValidationError>>} - The created consent object
|
|
48
69
|
* @example
|
|
49
70
|
* ```typescript
|
|
50
71
|
* await sdk.user.createConsent({ category: 'research', permitted: true });
|
|
@@ -54,6 +75,9 @@ export interface UserManager {
|
|
|
54
75
|
/**
|
|
55
76
|
* Creates a verification URL for identity verification.
|
|
56
77
|
* Generates a URL for IAL2 verification flow.
|
|
78
|
+
*
|
|
79
|
+
* @param {CreateVerificationUrlRequest} request - Object containing verification URL configuration including callback URL
|
|
80
|
+
* @returns {Promise<BWellTransactionResult<string, BaseManagerError>>} - The generated verification URL
|
|
57
81
|
* @example
|
|
58
82
|
* ```typescript
|
|
59
83
|
* const verificationUrl = await sdk.user.createVerificationUrl({
|
|
@@ -65,6 +89,8 @@ export interface UserManager {
|
|
|
65
89
|
/**
|
|
66
90
|
* Retrieves the user's identity verification status.
|
|
67
91
|
* Gets the current state of IAL2 verification.
|
|
92
|
+
*
|
|
93
|
+
* @returns {Promise<BWellTransactionResult<VerificationResult, BaseManagerError>>} - The user's current verification status
|
|
68
94
|
* @example
|
|
69
95
|
* ```typescript
|
|
70
96
|
* const status = await sdk.user.getVerificationStatus();
|
|
@@ -75,6 +101,9 @@ export interface UserManager {
|
|
|
75
101
|
* Generates a URL to download exported user data.
|
|
76
102
|
* Requires a data export and associated web-hook to be set up first (see [docs](https://developer.bwell.com/reference/post_users-id-data-exports)).
|
|
77
103
|
* Please reach out to bwell customer support for further details.
|
|
104
|
+
*
|
|
105
|
+
* @param {CreateDataExportDirectDownloadUrlRequest} request - Object containing export ID and password for data export access
|
|
106
|
+
* @returns {Promise<BWellTransactionResult<string | null, BaseManagerError>>} - The generated download URL or null if not available
|
|
78
107
|
* @example
|
|
79
108
|
* ```typescript
|
|
80
109
|
* const downloadUrl = await sdk.user.createDataExportDirectDownloadUrl({
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SearchConsentQueryVariables } from "../../../graphql/operations/types.js";
|
|
2
|
+
import { GetConsentsRequest, RequestFactory } from "../../../index.js";
|
|
3
|
+
export declare class GetConsentRequestFactory implements RequestFactory<GetConsentsRequest, SearchConsentQueryVariables> {
|
|
4
|
+
create(request: GetConsentsRequest): SearchConsentQueryVariables;
|
|
5
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
+
import { Consent, ConsentBundle, Person, VerificationResult } from "../../../models/user/index.js";
|
|
4
4
|
import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
5
5
|
import { BaseManagerError } from "../../base/errors.js";
|
|
6
|
-
import { CreateConsentRequest, CreateDataExportDirectDownloadUrlRequest, CreateVerificationUrlRequest, UpdateProfileRequest } from "../../base/user/index.js";
|
|
6
|
+
import { CreateConsentRequest, CreateDataExportDirectDownloadUrlRequest, CreateVerificationUrlRequest, GetConsentsRequest, UpdateProfileRequest } from "../../base/user/index.js";
|
|
7
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";
|
|
@@ -13,6 +13,7 @@ export declare class GraphQLUserManager extends GraphQLManager implements UserMa
|
|
|
13
13
|
getProfile(): Promise<BWellQueryResult<Person, BaseManagerError>>;
|
|
14
14
|
delete(): Promise<BWellTransactionResult<null, BaseManagerError>>;
|
|
15
15
|
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<Person, BaseManagerError>>;
|
|
16
|
+
getConsents(request?: GetConsentsRequest): Promise<BWellQueryResult<ConsentBundle, BaseManagerError | ValidationError>>;
|
|
16
17
|
createConsent(request: CreateConsentRequest): Promise<BWellTransactionResult<Consent, BaseManagerError | ValidationError>>;
|
|
17
18
|
createDataExportDirectDownloadUrl(request: CreateDataExportDirectDownloadUrlRequest): Promise<BWellTransactionResult<string | null, BaseManagerError>>;
|
|
18
19
|
createVerificationUrl(request: CreateVerificationUrlRequest): Promise<BWellTransactionResult<string, BaseManagerError>>;
|
|
@@ -18,12 +18,13 @@ 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 _GraphQLUserManager_sdk, _GraphQLUserManager_logger, _GraphQLUserManager_createConsentRequestFactory, _GraphQLUserManager_updateProfileRequestFactory, _GraphQLUserManager_createVerificationUrlRequestFactory;
|
|
21
|
+
var _GraphQLUserManager_sdk, _GraphQLUserManager_logger, _GraphQLUserManager_createConsentRequestFactory, _GraphQLUserManager_updateProfileRequestFactory, _GraphQLUserManager_getConsentRequestFactory, _GraphQLUserManager_createVerificationUrlRequestFactory;
|
|
22
22
|
import { ConsoleLoggerProvider, } from "../../../logger/index.js";
|
|
23
23
|
import { BWellQueryResult, BWellTransactionResult, } from "../../../results/index.js";
|
|
24
24
|
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
25
25
|
import { CreateConsentRequestFactory } from "./create-consent-request-factory.js";
|
|
26
26
|
import { CreateVerificationUrlRequestFactory } from "./create-verification-url-request-factory.js";
|
|
27
|
+
import { GetConsentRequestFactory } from "./get-consent-request-factory.js";
|
|
27
28
|
import { UpdateProfileRequestFactory } from "./update-profile-request-factory.js";
|
|
28
29
|
export class GraphQLUserManager extends GraphQLManager {
|
|
29
30
|
constructor(sdk, loggerProvider = new ConsoleLoggerProvider()) {
|
|
@@ -32,14 +33,7 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
32
33
|
_GraphQLUserManager_logger.set(this, void 0);
|
|
33
34
|
_GraphQLUserManager_createConsentRequestFactory.set(this, new CreateConsentRequestFactory());
|
|
34
35
|
_GraphQLUserManager_updateProfileRequestFactory.set(this, new UpdateProfileRequestFactory());
|
|
35
|
-
|
|
36
|
-
// GetConsentsRequest,
|
|
37
|
-
// SearchConsentQueryVariables
|
|
38
|
-
// > = new GetConsentRequestFactory();
|
|
39
|
-
// #createDataExportDirectDownloadUrlRequestFactory: RequestFactory<
|
|
40
|
-
// CreateDataExportDirectDownloadUrlRequest,
|
|
41
|
-
// CreateDataExportDirectDownloadUrlMutationVariables
|
|
42
|
-
// > = new CreateDataExportDirectDownloadUrlRequestFactory();
|
|
36
|
+
_GraphQLUserManager_getConsentRequestFactory.set(this, new GetConsentRequestFactory());
|
|
43
37
|
_GraphQLUserManager_createVerificationUrlRequestFactory.set(this, new CreateVerificationUrlRequestFactory());
|
|
44
38
|
__classPrivateFieldSet(this, _GraphQLUserManager_sdk, sdk, "f");
|
|
45
39
|
__classPrivateFieldSet(this, _GraphQLUserManager_logger, loggerProvider.getLogger("GraphQLUserManager"), "f");
|
|
@@ -86,30 +80,29 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
86
80
|
.updateUserProfile);
|
|
87
81
|
});
|
|
88
82
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
// }
|
|
83
|
+
getConsents(request) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
var _a;
|
|
86
|
+
const validationResults = this.validateRequest(request);
|
|
87
|
+
if (validationResults.failure()) {
|
|
88
|
+
return validationResults.toQueryResult();
|
|
89
|
+
}
|
|
90
|
+
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").verbose("calling consent search query...");
|
|
91
|
+
let sdkRequest;
|
|
92
|
+
if (request !== undefined) {
|
|
93
|
+
sdkRequest = __classPrivateFieldGet(this, _GraphQLUserManager_getConsentRequestFactory, "f").create(request);
|
|
94
|
+
}
|
|
95
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLUserManager_sdk, "f").searchConsent(sdkRequest));
|
|
96
|
+
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").verbose("consent search query complete");
|
|
97
|
+
if (result.hasError()) {
|
|
98
|
+
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").error("consent search failed", result.error);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").info("successfully called consent search query");
|
|
102
|
+
}
|
|
103
|
+
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.consents, result.error);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
113
106
|
createConsent(request) {
|
|
114
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
108
|
const validationResult = request.validate();
|
|
@@ -173,4 +166,4 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
173
166
|
});
|
|
174
167
|
}
|
|
175
168
|
}
|
|
176
|
-
_GraphQLUserManager_sdk = new WeakMap(), _GraphQLUserManager_logger = new WeakMap(), _GraphQLUserManager_createConsentRequestFactory = new WeakMap(), _GraphQLUserManager_updateProfileRequestFactory = new WeakMap(), _GraphQLUserManager_createVerificationUrlRequestFactory = new WeakMap();
|
|
169
|
+
_GraphQLUserManager_sdk = new WeakMap(), _GraphQLUserManager_logger = new WeakMap(), _GraphQLUserManager_createConsentRequestFactory = new WeakMap(), _GraphQLUserManager_updateProfileRequestFactory = new WeakMap(), _GraphQLUserManager_getConsentRequestFactory = new WeakMap(), _GraphQLUserManager_createVerificationUrlRequestFactory = new WeakMap();
|
|
@@ -17,6 +17,7 @@ import { BWellTransactionResult } from "../results/index.js";
|
|
|
17
17
|
* - User management (profiles, consent, identity verification)
|
|
18
18
|
* - Appointment management (scheduling, viewing, canceling)
|
|
19
19
|
* - Connection management (external healthcare providers)
|
|
20
|
+
* - Device management (push notifications, device registration)
|
|
20
21
|
* - Search operations (healthcare provider and resource discovery)
|
|
21
22
|
* - Questionnaire processing (dynamic forms and responses)
|
|
22
23
|
*
|
|
@@ -38,6 +39,7 @@ import { BWellTransactionResult } from "../results/index.js";
|
|
|
38
39
|
* @see {@link UserManager} for user management operations
|
|
39
40
|
* @see {@link HealthSpaceManager} for appointment management
|
|
40
41
|
* @see {@link ConnectionManager} for provider connections
|
|
42
|
+
* @see {@link DeviceManager} for device management operations
|
|
41
43
|
* @see {@link SearchManager} for search operations
|
|
42
44
|
* @see {@link QuestionnaireManager} for questionnaire processing
|
|
43
45
|
*
|
|
@@ -38,6 +38,7 @@ import { isNotNullOrUndefined, parseUserFromIdToken } from "../utils/index.js";
|
|
|
38
38
|
* - User management (profiles, consent, identity verification)
|
|
39
39
|
* - Appointment management (scheduling, viewing, canceling)
|
|
40
40
|
* - Connection management (external healthcare providers)
|
|
41
|
+
* - Device management (push notifications, device registration)
|
|
41
42
|
* - Search operations (healthcare provider and resource discovery)
|
|
42
43
|
* - Questionnaire processing (dynamic forms and responses)
|
|
43
44
|
*
|
|
@@ -59,6 +60,7 @@ import { isNotNullOrUndefined, parseUserFromIdToken } from "../utils/index.js";
|
|
|
59
60
|
* @see {@link UserManager} for user management operations
|
|
60
61
|
* @see {@link HealthSpaceManager} for appointment management
|
|
61
62
|
* @see {@link ConnectionManager} for provider connections
|
|
63
|
+
* @see {@link DeviceManager} for device management operations
|
|
62
64
|
* @see {@link SearchManager} for search operations
|
|
63
65
|
* @see {@link QuestionnaireManager} for questionnaire processing
|
|
64
66
|
*
|
|
@@ -74,6 +74,7 @@ export declare const CreateDataExportDirectDownloadUrlDocument = "\n mutation
|
|
|
74
74
|
export declare const CreateVerificationUrlDocument = "\n mutation CreateVerificationUrl($callbackURL: String, $includeAttributeMatchingCheck: Boolean) {\n createVerificationUrl(\n callbackURL: $callbackURL\n includeAttributeMatchingCheck: $includeAttributeMatchingCheck\n )\n}\n ";
|
|
75
75
|
export declare const DeleteDocument = "\n mutation delete {\n updateUserAccountStatus(operation: IMMEDIATE_EXECUTION) {\n resourceType\n issue {\n code\n severity\n details {\n text\n }\n }\n }\n}\n ";
|
|
76
76
|
export declare const GetProfileDocument = "\n query getProfile {\n userProfile {\n id\n address {\n line\n city\n state\n postalCode\n }\n telecom {\n system\n value\n use\n }\n gender\n birthDate\n name {\n family\n given\n }\n language\n }\n}\n ";
|
|
77
|
+
export declare const SearchConsentDocument = "\n query searchConsent($category: SearchToken) {\n consents(category: $category) {\n id\n entry {\n id\n resource {\n id\n meta {\n ...MetaFields\n }\n status\n scope {\n ...CodeableConceptFields\n }\n category {\n ...CodeableConceptFields\n }\n patient {\n reference\n }\n provision {\n type\n }\n }\n }\n }\n}\n \n fragment MetaFields on Meta {\n versionId\n lastUpdated\n source\n security {\n ...CodingFields\n }\n tag {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n \n\n fragment CodeableConceptFields on CodeableConcept {\n id\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n ";
|
|
77
78
|
export declare const UpdateUserProfileDocument = "\n mutation updateUserProfile($person: FHIRPersonInput) {\n updateUserProfile(input: $person) {\n id\n address {\n line\n city\n state\n postalCode\n }\n telecom {\n system\n value\n use\n }\n gender\n birthDate\n name {\n family\n given\n }\n language\n }\n}\n ";
|
|
78
79
|
export declare const VerificationStatusDocument = "\n query VerificationStatus {\n verificationStatus {\n resourceType\n id\n status\n statusDate\n lastPerformed\n }\n}\n ";
|
|
79
80
|
export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string, variables?: any) => Promise<T>;
|
|
@@ -330,6 +331,13 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
|
|
|
330
331
|
headers: Headers;
|
|
331
332
|
status: number;
|
|
332
333
|
}>;
|
|
334
|
+
searchConsent(variables?: Types.SearchConsentQueryVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise<{
|
|
335
|
+
data: Types.SearchConsentQueryResults;
|
|
336
|
+
errors?: GraphQLError[];
|
|
337
|
+
extensions?: any;
|
|
338
|
+
headers: Headers;
|
|
339
|
+
status: number;
|
|
340
|
+
}>;
|
|
333
341
|
updateUserProfile(variables?: Types.UpdateUserProfileMutationVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise<{
|
|
334
342
|
data: Types.UpdateUserProfileMutationResults;
|
|
335
343
|
errors?: GraphQLError[];
|
|
@@ -1363,6 +1363,36 @@ export const GetProfileDocument = `
|
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
1365
|
`;
|
|
1366
|
+
export const SearchConsentDocument = `
|
|
1367
|
+
query searchConsent($category: SearchToken) {
|
|
1368
|
+
consents(category: $category) {
|
|
1369
|
+
id
|
|
1370
|
+
entry {
|
|
1371
|
+
id
|
|
1372
|
+
resource {
|
|
1373
|
+
id
|
|
1374
|
+
meta {
|
|
1375
|
+
...MetaFields
|
|
1376
|
+
}
|
|
1377
|
+
status
|
|
1378
|
+
scope {
|
|
1379
|
+
...CodeableConceptFields
|
|
1380
|
+
}
|
|
1381
|
+
category {
|
|
1382
|
+
...CodeableConceptFields
|
|
1383
|
+
}
|
|
1384
|
+
patient {
|
|
1385
|
+
reference
|
|
1386
|
+
}
|
|
1387
|
+
provision {
|
|
1388
|
+
type
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
${MetaFieldsFragmentDoc}
|
|
1395
|
+
${CodeableConceptFieldsFragmentDoc}`;
|
|
1366
1396
|
export const UpdateUserProfileDocument = `
|
|
1367
1397
|
mutation updateUserProfile($person: FHIRPersonInput) {
|
|
1368
1398
|
updateUserProfile(input: $person) {
|
|
@@ -1510,6 +1540,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
1510
1540
|
getProfile(variables, requestHeaders) {
|
|
1511
1541
|
return withWrapper((wrappedRequestHeaders) => client.rawRequest(GetProfileDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getProfile', 'query', variables);
|
|
1512
1542
|
},
|
|
1543
|
+
searchConsent(variables, requestHeaders) {
|
|
1544
|
+
return withWrapper((wrappedRequestHeaders) => client.rawRequest(SearchConsentDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'searchConsent', 'query', variables);
|
|
1545
|
+
},
|
|
1513
1546
|
updateUserProfile(variables, requestHeaders) {
|
|
1514
1547
|
return withWrapper((wrappedRequestHeaders) => client.rawRequest(UpdateUserProfileDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'updateUserProfile', 'mutation', variables);
|
|
1515
1548
|
},
|
|
@@ -4630,6 +4630,64 @@ export type GetProfileQueryResults = {
|
|
|
4630
4630
|
} | null> | null;
|
|
4631
4631
|
} | null;
|
|
4632
4632
|
};
|
|
4633
|
+
export type SearchConsentQueryVariables = Types.Exact<{
|
|
4634
|
+
category: Types.InputMaybe<Types.SearchToken>;
|
|
4635
|
+
}>;
|
|
4636
|
+
export type SearchConsentQueryResults = {
|
|
4637
|
+
consents: {
|
|
4638
|
+
id: string | null;
|
|
4639
|
+
entry: Array<{
|
|
4640
|
+
id: string | null;
|
|
4641
|
+
resource: {
|
|
4642
|
+
id: string;
|
|
4643
|
+
status: any | null;
|
|
4644
|
+
meta: {
|
|
4645
|
+
versionId: string | null;
|
|
4646
|
+
lastUpdated: any | null;
|
|
4647
|
+
source: any | null;
|
|
4648
|
+
security: Array<{
|
|
4649
|
+
id: string | null;
|
|
4650
|
+
system: any | null;
|
|
4651
|
+
code: any | null;
|
|
4652
|
+
display: string | null;
|
|
4653
|
+
} | null> | null;
|
|
4654
|
+
tag: Array<{
|
|
4655
|
+
id: string | null;
|
|
4656
|
+
system: any | null;
|
|
4657
|
+
code: any | null;
|
|
4658
|
+
display: string | null;
|
|
4659
|
+
} | null> | null;
|
|
4660
|
+
} | null;
|
|
4661
|
+
scope: {
|
|
4662
|
+
id: string | null;
|
|
4663
|
+
text: string | null;
|
|
4664
|
+
coding: Array<{
|
|
4665
|
+
id: string | null;
|
|
4666
|
+
system: any | null;
|
|
4667
|
+
code: any | null;
|
|
4668
|
+
display: string | null;
|
|
4669
|
+
} | null> | null;
|
|
4670
|
+
} | null;
|
|
4671
|
+
category: Array<{
|
|
4672
|
+
id: string | null;
|
|
4673
|
+
text: string | null;
|
|
4674
|
+
coding: Array<{
|
|
4675
|
+
id: string | null;
|
|
4676
|
+
system: any | null;
|
|
4677
|
+
code: any | null;
|
|
4678
|
+
display: string | null;
|
|
4679
|
+
} | null> | null;
|
|
4680
|
+
} | null> | null;
|
|
4681
|
+
patient: {
|
|
4682
|
+
reference: string | null;
|
|
4683
|
+
} | null;
|
|
4684
|
+
provision: {
|
|
4685
|
+
type: any | null;
|
|
4686
|
+
} | null;
|
|
4687
|
+
} | null;
|
|
4688
|
+
} | null> | null;
|
|
4689
|
+
} | null;
|
|
4690
|
+
};
|
|
4633
4691
|
export type UpdateUserProfileMutationVariables = Types.Exact<{
|
|
4634
4692
|
person: Types.InputMaybe<Types.FhirPersonInput>;
|
|
4635
4693
|
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device registration result.
|
|
3
|
+
* Returned when a device is successfully registered in the system.
|
|
4
|
+
*
|
|
5
|
+
* @category Models
|
|
6
|
+
* @title DeviceRegistrationResults
|
|
7
|
+
* @excerpt Device registration result with unique identifier
|
|
8
|
+
*/
|
|
9
|
+
export type DeviceRegistrationResults = {
|
|
10
|
+
/** Unique device identifier assigned during registration */
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,14 @@ import { Score } from "../common/score.js";
|
|
|
6
6
|
import { FilterField } from "../enums/filter-field.js";
|
|
7
7
|
import { Gender } from "../enums/gender.js";
|
|
8
8
|
import { SearchResultType } from "../enums/search-result-type.js";
|
|
9
|
+
/**
|
|
10
|
+
* Health resource location with distance information.
|
|
11
|
+
* Extends the base Location type with additional distance data for search results.
|
|
12
|
+
*
|
|
13
|
+
* @category Models
|
|
14
|
+
* @title HealthResourceLocation
|
|
15
|
+
* @excerpt Location with distance information for health resource searches
|
|
16
|
+
*/
|
|
9
17
|
export type HealthResourceLocation = Location & {
|
|
10
18
|
/** Distance in miles from the search location */
|
|
11
19
|
distanceInMiles: number | null;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { OperationOutcomeIssue } from "../common/operation-outcome.js";
|
|
2
|
+
/**
|
|
3
|
+
* Provider review operation result.
|
|
4
|
+
* Contains the outcome of a provider review operation with any issues encountered.
|
|
5
|
+
*
|
|
6
|
+
* @category Models
|
|
7
|
+
* @title ProviderReviewResult
|
|
8
|
+
* @excerpt Provider review operation result with resource type and issues
|
|
9
|
+
*/
|
|
2
10
|
export type ProviderReviewResult = {
|
|
11
|
+
/** The type of resource being returned */
|
|
3
12
|
resourceType: string | null;
|
|
13
|
+
/** Any issues encountered during the provider review operation */
|
|
4
14
|
issue: OperationOutcomeIssue[] | null;
|
|
5
15
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeableConcept, Meta, Period, Reference } from "../common/index.js";
|
|
1
|
+
import type { CodeableConcept, EntryBundle, IdentifiedResourceEntry, Meta, Period, Reference } from "../common/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* A record of a healthcare consumer's choices or choices made on their behalf by a third party.
|
|
4
4
|
* Captures permissions, prohibitions and obligations with respect to access to or use of a resource.
|
|
@@ -89,3 +89,23 @@ export type ConsentProvision = {
|
|
|
89
89
|
*/
|
|
90
90
|
period: Period | null;
|
|
91
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* Represents an entry in an allergy intolerance bundle.
|
|
94
|
+
* Represents an entry in a consent bundle.
|
|
95
|
+
* Contains a consent resource and metadata.
|
|
96
|
+
*
|
|
97
|
+
* @category Models
|
|
98
|
+
* @title ConsentEntry
|
|
99
|
+
* @excerpt Represents an entry in a consent bundle
|
|
100
|
+
*/
|
|
101
|
+
type ConsentEntry = IdentifiedResourceEntry<Consent>;
|
|
102
|
+
/**
|
|
103
|
+
* Bundle of consent search results.
|
|
104
|
+
* Contains multiple consent entries from search operations.
|
|
105
|
+
*
|
|
106
|
+
* @category Models
|
|
107
|
+
* @title ConsentBundle
|
|
108
|
+
* @excerpt Bundle of consent search results
|
|
109
|
+
*/
|
|
110
|
+
export type ConsentBundle = EntryBundle<ConsentEntry>;
|
|
111
|
+
export {};
|