@icanbwell/bwell-sdk-ts 1.95.0 → 1.96.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/dist/__version__.d.ts +1 -1
- package/dist/__version__.js +1 -1
- package/dist/api/base/user/update-profile-request.d.ts +7 -0
- package/dist/api/base/user/update-profile-request.js +5 -0
- package/dist/api/base/user/user-manager.d.ts +2 -2
- package/dist/api/graphql-api/user/graphql-user-manager.d.ts +1 -1
- package/dist/api/graphql-api/user/graphql-user-manager.js +4 -0
- package/dist/api/graphql-api/user/update-profile-request-factory.js +5 -2
- package/dist/graphql/schema.d.ts +13 -0
- package/package.json +1 -1
package/dist/__version__.d.ts
CHANGED
package/dist/__version__.js
CHANGED
|
@@ -3,6 +3,13 @@ import { type PersonGender } from "./types.js";
|
|
|
3
3
|
export type UpdateProfileRequestInput = {
|
|
4
4
|
id?: string;
|
|
5
5
|
firstName?: string;
|
|
6
|
+
/**
|
|
7
|
+
* All middle names for the person. This replaces the entire `given[1..n]`
|
|
8
|
+
* array on the FHIR Person resource — partial updates are not supported.
|
|
9
|
+
* Callers must pass the complete list of middle names on every save.
|
|
10
|
+
* Requires {@link firstName} to be provided when this array is non-empty.
|
|
11
|
+
*/
|
|
12
|
+
middleNames?: string[];
|
|
6
13
|
lastName?: string;
|
|
7
14
|
addressStreet?: string;
|
|
8
15
|
addressUnit?: string;
|
|
@@ -6,6 +6,11 @@ export class UpdateProfileRequestValidator {
|
|
|
6
6
|
if (!isUndefined(data.gender) && !isValidPersonGender(data.gender)) {
|
|
7
7
|
errors.add(`Invalid gender value: "${data.gender}"`);
|
|
8
8
|
}
|
|
9
|
+
if (!isUndefined(data.middleNames) &&
|
|
10
|
+
data.middleNames.length > 0 &&
|
|
11
|
+
isUndefined(data.firstName)) {
|
|
12
|
+
errors.add("middleNames requires firstName to be provided");
|
|
13
|
+
}
|
|
9
14
|
}
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
@@ -36,9 +36,9 @@ export interface UserManager {
|
|
|
36
36
|
/**
|
|
37
37
|
* Updates demographic information on the user profile.
|
|
38
38
|
*
|
|
39
|
-
* @return {Promise<BWellTransactionResult<UpdateProfileResults, BaseManagerError>>} A promise resolving to an object representing the updated user profile
|
|
39
|
+
* @return {Promise<BWellTransactionResult<UpdateProfileResults, BaseManagerError | ValidationError>>} A promise resolving to an object representing the updated user profile
|
|
40
40
|
*/
|
|
41
|
-
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<UpdateProfileResults, BaseManagerError>>;
|
|
41
|
+
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<UpdateProfileResults, BaseManagerError | ValidationError>>;
|
|
42
42
|
/**
|
|
43
43
|
* Retreives a list of Consents.
|
|
44
44
|
*
|
|
@@ -13,7 +13,7 @@ export declare class GraphQLUserManager extends GraphQLManager implements UserMa
|
|
|
13
13
|
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
|
|
14
14
|
getProfile(): Promise<BWellQueryResult<ProfileResults, BaseManagerError>>;
|
|
15
15
|
delete(): Promise<BWellTransactionResult<null, BaseManagerError>>;
|
|
16
|
-
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<UpdateProfileResults, BaseManagerError>>;
|
|
16
|
+
updateProfile(request: UpdateProfileRequest): Promise<BWellTransactionResult<UpdateProfileResults, BaseManagerError | ValidationError>>;
|
|
17
17
|
getConsents(request?: GetConsentsRequest): Promise<BWellQueryResult<GetConsentsResults, BaseManagerError | ValidationError>>;
|
|
18
18
|
createConsent(request: CreateConsentRequest): Promise<BWellTransactionResult<CreateConsentResults, BaseManagerError | ValidationError>>;
|
|
19
19
|
createDataExportDirectDownloadUrl(request: CreateDataExportDirectDownloadUrlRequest): Promise<BWellTransactionResult<CreateDataExportDirectDownloadUrlResults, BaseManagerError>>;
|
|
@@ -70,6 +70,10 @@ export class GraphQLUserManager extends GraphQLManager {
|
|
|
70
70
|
}
|
|
71
71
|
updateProfile(request) {
|
|
72
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const validationResult = request.validate();
|
|
74
|
+
if (validationResult.failure()) {
|
|
75
|
+
return validationResult;
|
|
76
|
+
}
|
|
73
77
|
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").verbose("calling updateUserProfile");
|
|
74
78
|
const result = yield this.handleTransaction(__classPrivateFieldGet(this, _GraphQLUserManager_sdk, "f").updateUserProfile(__classPrivateFieldGet(this, _GraphQLUserManager_updateProfileRequestFactory, "f").create(request)));
|
|
75
79
|
__classPrivateFieldGet(this, _GraphQLUserManager_logger, "f").verbose("updateUserProfile complete");
|
|
@@ -33,11 +33,14 @@ _UpdateProfileRequestFactory_instances = new WeakSet(), _UpdateProfileRequestFac
|
|
|
33
33
|
data[key] = inputVal;
|
|
34
34
|
}, _UpdateProfileRequestFactory_transformNameInput = function _UpdateProfileRequestFactory_transformNameInput(input, data) {
|
|
35
35
|
let includeName = false;
|
|
36
|
-
const { firstName, lastName } = input;
|
|
36
|
+
const { firstName, middleNames, lastName } = input;
|
|
37
37
|
const name = {};
|
|
38
38
|
if (isNotNullOrUndefined(firstName)) {
|
|
39
39
|
includeName = true;
|
|
40
|
-
name.given =
|
|
40
|
+
name.given =
|
|
41
|
+
isNotNullOrUndefined(middleNames) && middleNames.length > 0
|
|
42
|
+
? [firstName, ...middleNames]
|
|
43
|
+
: [firstName];
|
|
41
44
|
}
|
|
42
45
|
if (isNotNullOrUndefined(lastName)) {
|
|
43
46
|
includeName = true;
|
package/dist/graphql/schema.d.ts
CHANGED
|
@@ -1244,10 +1244,16 @@ export type Connection = {
|
|
|
1244
1244
|
__typename?: 'Connection';
|
|
1245
1245
|
/** Category of data source */
|
|
1246
1246
|
category: ConnectionCategory;
|
|
1247
|
+
/** URL of the consent policy */
|
|
1248
|
+
consentPolicyUrl?: Maybe<Scalars['String']['output']>;
|
|
1249
|
+
/** ISO 8601 duration (e.g. P1Y, P30D) for which member consent remains valid */
|
|
1250
|
+
consentValidityDuration?: Maybe<Scalars['String']['output']>;
|
|
1247
1251
|
/** Token creation datetime */
|
|
1248
1252
|
created: Scalars['DateTime']['output'];
|
|
1249
1253
|
/** URL to disconnect this device connection */
|
|
1250
1254
|
disconnectUrl?: Maybe<Scalars['String']['output']>;
|
|
1255
|
+
/** Operational status of the endpoint */
|
|
1256
|
+
endpointStatus?: Maybe<Scalars['String']['output']>;
|
|
1251
1257
|
/** Uniquely identifies a data source */
|
|
1252
1258
|
id: Scalars['String']['output'];
|
|
1253
1259
|
/** Specifies whether the connection is direct or indirect or proa */
|
|
@@ -1873,6 +1879,12 @@ export type DataSource = {
|
|
|
1873
1879
|
__typename?: 'DataSource';
|
|
1874
1880
|
/** Category of data source */
|
|
1875
1881
|
category: ConnectionCategory;
|
|
1882
|
+
/** URL of the consent policy */
|
|
1883
|
+
consentPolicyUrl?: Maybe<Scalars['String']['output']>;
|
|
1884
|
+
/** ISO 8601 duration (e.g. P1Y, P30D) for which member consent remains valid */
|
|
1885
|
+
consentValidityDuration?: Maybe<Scalars['String']['output']>;
|
|
1886
|
+
/** Operational status of the endpoint */
|
|
1887
|
+
endpointStatus?: Maybe<Scalars['String']['output']>;
|
|
1876
1888
|
/** Uniquely identifies a data source */
|
|
1877
1889
|
id: Scalars['String']['output'];
|
|
1878
1890
|
/** Specifies whether the connection is direct or indirect or proa */
|
|
@@ -2302,6 +2314,7 @@ export type EmbeddableConfiguration = {
|
|
|
2302
2314
|
authStrategy: Scalars['String']['output'];
|
|
2303
2315
|
idleThreshold: Scalars['Int']['output'];
|
|
2304
2316
|
routeDefinition: Array<RouteDefinition>;
|
|
2317
|
+
themeId?: Maybe<Scalars['String']['output']>;
|
|
2305
2318
|
webSdkVersion: Scalars['String']['output'];
|
|
2306
2319
|
};
|
|
2307
2320
|
export declare enum EmpiType {
|