cidaas-javascript-sdk 5.1.2 → 5.1.4
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/CHANGELOG.md +13 -3
- package/dist/common/Helper.js +10 -2
- package/dist/device-service/DeviceService.js +1 -0
- package/dist/user-service/UserService.d.ts +3 -3
- package/dist/user-service/UserService.js +6 -6
- package/dist/verification-service/VerificationService.model.d.ts +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
## [5.1.
|
|
1
|
+
## [5.1.4](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v5.1.3...v5.1.4) (2026-03-13)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* [#1537](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/issues/1537) update reset password apis ([fddafcb](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/fddafcb7d4b33a354f36d25bbf6535d90f81f2bc))
|
|
7
7
|
|
|
8
8
|
# Changelog
|
|
9
9
|
|
|
10
|
-
## V5.1.
|
|
10
|
+
## V5.1.4
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- api update for initiateResetPassword(),handleResetPassword(),resetPassword()
|
|
14
|
+
|
|
15
|
+
## V5.1.3
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
- backward-compatible SDK fixes for parsing, promises, and types
|
|
19
|
+
|
|
20
|
+
## V5.1.2
|
|
11
21
|
|
|
12
22
|
### Fixed
|
|
13
23
|
- api adjustments for initiateAccountVerification(), verifyAccount(), getAllVerificationList(), initiateMFA(), authenticateMFA()
|
package/dist/common/Helper.js
CHANGED
|
@@ -36,10 +36,18 @@ class Helper {
|
|
|
36
36
|
return new Promise((resolve, reject) => {
|
|
37
37
|
try {
|
|
38
38
|
const http = new XMLHttpRequest();
|
|
39
|
+
http.onerror = function () {
|
|
40
|
+
reject(new Error("Network request failed"));
|
|
41
|
+
};
|
|
39
42
|
http.onreadystatechange = function () {
|
|
40
43
|
if (http.readyState == 4) {
|
|
41
44
|
if (http.responseText) {
|
|
42
|
-
|
|
45
|
+
try {
|
|
46
|
+
resolve(JSON.parse(http.responseText));
|
|
47
|
+
}
|
|
48
|
+
catch (parseError) {
|
|
49
|
+
reject(parseError instanceof Error ? parseError : new Error(String(parseError)));
|
|
50
|
+
}
|
|
43
51
|
}
|
|
44
52
|
else {
|
|
45
53
|
resolve(errorResolver);
|
|
@@ -93,7 +101,7 @@ class Helper {
|
|
|
93
101
|
try {
|
|
94
102
|
userManager.getUser().then((user) => {
|
|
95
103
|
resolve(user === null || user === void 0 ? void 0 : user.access_token);
|
|
96
|
-
});
|
|
104
|
+
}).catch(reject);
|
|
97
105
|
}
|
|
98
106
|
catch (ex) {
|
|
99
107
|
reject(ex);
|
|
@@ -100,7 +100,7 @@ export declare class UserService {
|
|
|
100
100
|
getCommunicationStatus(options: GetCommunicationStatusRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
101
101
|
/**
|
|
102
102
|
* To initiate the password resetting, call **initiateResetPassword()**. This will send verification code to your email or mobile based on the resetMedium you mentioned.
|
|
103
|
-
* Please refer to the api document https://docs.cidaas.com/
|
|
103
|
+
* Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-initiate for more details.
|
|
104
104
|
* @example
|
|
105
105
|
* ```js
|
|
106
106
|
* cidaasUserService.initiateResetPassword({
|
|
@@ -118,7 +118,7 @@ export declare class UserService {
|
|
|
118
118
|
initiateResetPassword(options: InitiateResetPasswordRequest, headers?: HTTPRequestHeader): Promise<any>;
|
|
119
119
|
/**
|
|
120
120
|
* To handle the reset password by entering the verification code you received, call **handleResetPassword()**. This will check if your verification code was valid or not, and allows you to proceed to the next step.
|
|
121
|
-
* Please refer to the api document https://docs.cidaas.com/
|
|
121
|
+
* Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-validatecode for more details.
|
|
122
122
|
* @example
|
|
123
123
|
* ```js
|
|
124
124
|
* const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, the response information will be given as query parameter in redirect url.';
|
|
@@ -135,7 +135,7 @@ export declare class UserService {
|
|
|
135
135
|
handleResetPassword(options: HandleResetPasswordRequest, handleResponseAsJson?: boolean, headers?: HTTPRequestHeader): Promise<any>;
|
|
136
136
|
/**
|
|
137
137
|
* To finish reseting the password, call **resetPassword()**. This will allow you to change your password.
|
|
138
|
-
* Please refer to the api document https://docs.cidaas.com/
|
|
138
|
+
* Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-accept for more details.
|
|
139
139
|
* @example
|
|
140
140
|
* ```js
|
|
141
141
|
* const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, user will be redirected to success page after successful reset password.';
|
|
@@ -130,7 +130,7 @@ class UserService {
|
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* To initiate the password resetting, call **initiateResetPassword()**. This will send verification code to your email or mobile based on the resetMedium you mentioned.
|
|
133
|
-
* Please refer to the api document https://docs.cidaas.com/
|
|
133
|
+
* Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-initiate for more details.
|
|
134
134
|
* @example
|
|
135
135
|
* ```js
|
|
136
136
|
* cidaasUserService.initiateResetPassword({
|
|
@@ -146,12 +146,12 @@ class UserService {
|
|
|
146
146
|
* ```
|
|
147
147
|
*/
|
|
148
148
|
initiateResetPassword(options, headers) {
|
|
149
|
-
const _serviceURL = this.config.authority + "/
|
|
149
|
+
const _serviceURL = this.config.authority + "/password-srv/resetpassword?action=initiatereset";
|
|
150
150
|
return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", undefined, headers);
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* To handle the reset password by entering the verification code you received, call **handleResetPassword()**. This will check if your verification code was valid or not, and allows you to proceed to the next step.
|
|
154
|
-
* Please refer to the api document https://docs.cidaas.com/
|
|
154
|
+
* Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-validatecode for more details.
|
|
155
155
|
* @example
|
|
156
156
|
* ```js
|
|
157
157
|
* const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, the response information will be given as query parameter in redirect url.';
|
|
@@ -167,7 +167,7 @@ class UserService {
|
|
|
167
167
|
*/
|
|
168
168
|
handleResetPassword(options, handleResponseAsJson, headers) {
|
|
169
169
|
try {
|
|
170
|
-
const url = this.config.authority + "/
|
|
170
|
+
const url = this.config.authority + "/password-srv/resetpassword?action=validatecode";
|
|
171
171
|
if (!handleResponseAsJson) {
|
|
172
172
|
// current handling will redirect and give query parameters
|
|
173
173
|
const form = Helper_1.Helper.createForm(url, options);
|
|
@@ -185,7 +185,7 @@ class UserService {
|
|
|
185
185
|
}
|
|
186
186
|
/**
|
|
187
187
|
* To finish reseting the password, call **resetPassword()**. This will allow you to change your password.
|
|
188
|
-
* Please refer to the api document https://docs.cidaas.com/
|
|
188
|
+
* Please refer to the api document https://docs.cidaas.com/openapi/password-management/post-reset-password-accept for more details.
|
|
189
189
|
* @example
|
|
190
190
|
* ```js
|
|
191
191
|
* const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, user will be redirected to success page after successful reset password.';
|
|
@@ -202,7 +202,7 @@ class UserService {
|
|
|
202
202
|
* ```
|
|
203
203
|
*/
|
|
204
204
|
resetPassword(options, handleResponseAsJson, headers) {
|
|
205
|
-
const url = this.config.authority + "/
|
|
205
|
+
const url = this.config.authority + "/password-srv/resetpassword?action=acceptreset";
|
|
206
206
|
try {
|
|
207
207
|
if (!handleResponseAsJson) {
|
|
208
208
|
// current handling will redirect and give query parameters
|
|
@@ -84,7 +84,7 @@ export interface EnrollVerificationRequest {
|
|
|
84
84
|
device_id?: string;
|
|
85
85
|
/** unique identifier of client app, can be found in app setting under admin ui */
|
|
86
86
|
client_id?: string;
|
|
87
|
-
/** code to
|
|
87
|
+
/** code to authenticate */
|
|
88
88
|
pass_code?: string;
|
|
89
89
|
}
|
|
90
90
|
export interface CheckVerificationTypeConfiguredRequest extends GetMFAListRequest {
|
|
@@ -121,7 +121,7 @@ export interface AuthenticateMFARequest {
|
|
|
121
121
|
/** Subject (User) identifier */
|
|
122
122
|
sub?: string;
|
|
123
123
|
/** id generated on Authz request */
|
|
124
|
-
requestId?:
|
|
124
|
+
requestId?: string;
|
|
125
125
|
}
|
|
126
126
|
export interface DeviceInfo {
|
|
127
127
|
/** id of the device */
|
|
@@ -162,7 +162,7 @@ export interface ConfigureFriendlyNameRequest {
|
|
|
162
162
|
id?: string;
|
|
163
163
|
/** physical verification id received from status verification api */
|
|
164
164
|
ph_id?: string;
|
|
165
|
-
/** id
|
|
165
|
+
/** id received from enrollment API */
|
|
166
166
|
device_id?: string;
|
|
167
167
|
/** friendly name for the device */
|
|
168
168
|
friendly_name?: string;
|