@longvansoftware/storefront-js-client 3.0.4 → 3.0.5
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.
|
@@ -133,4 +133,14 @@ export declare class AuthService extends Service {
|
|
|
133
133
|
* @throws Will throw an error if the GraphQL mutation fails.
|
|
134
134
|
*/
|
|
135
135
|
updateInfo(updateUserRequest: UpdateInfoRequest, type?: string, password?: string): Promise<UpdateInfoResponse>;
|
|
136
|
+
/**
|
|
137
|
+
* Creates/updates user password.
|
|
138
|
+
* Uses the SDK's configured orgId and access token automatically.
|
|
139
|
+
* This is a simplified version of updateInfo specifically for password creation.
|
|
140
|
+
*
|
|
141
|
+
* @param password - The new password to set.
|
|
142
|
+
* @returns A promise that resolves to the updated user information.
|
|
143
|
+
* @throws Will throw an error if the GraphQL mutation fails.
|
|
144
|
+
*/
|
|
145
|
+
createPassword(password: string): Promise<UpdateInfoResponse>;
|
|
136
146
|
}
|
|
@@ -510,5 +510,31 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
510
510
|
}
|
|
511
511
|
});
|
|
512
512
|
}
|
|
513
|
+
/**
|
|
514
|
+
* Creates/updates user password.
|
|
515
|
+
* Uses the SDK's configured orgId and access token automatically.
|
|
516
|
+
* This is a simplified version of updateInfo specifically for password creation.
|
|
517
|
+
*
|
|
518
|
+
* @param password - The new password to set.
|
|
519
|
+
* @returns A promise that resolves to the updated user information.
|
|
520
|
+
* @throws Will throw an error if the GraphQL mutation fails.
|
|
521
|
+
*/
|
|
522
|
+
createPassword(password) {
|
|
523
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
524
|
+
const variables = {
|
|
525
|
+
orgId: this.orgId,
|
|
526
|
+
accessToken: this.token,
|
|
527
|
+
password,
|
|
528
|
+
};
|
|
529
|
+
try {
|
|
530
|
+
const response = yield this.graphqlMutation(mutations_1.UPDATE_INFO_MUTATION, variables);
|
|
531
|
+
return response.updateInfo;
|
|
532
|
+
}
|
|
533
|
+
catch (error) {
|
|
534
|
+
console.log(`Error in createPassword: ${error}`);
|
|
535
|
+
throw error;
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
}
|
|
513
539
|
}
|
|
514
540
|
exports.AuthService = AuthService;
|