cidaas-javascript-sdk 4.2.1 → 4.2.3
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 +12 -2
- package/README.md +2 -0
- package/dist/authentication/authentication.model.d.ts +1 -0
- package/dist/authentication/authentication.model.js +9 -36
- package/dist/authentication/index.d.ts +1 -1
- package/dist/authentication/index.js +27 -58
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -5
- package/dist/web-auth/ConsentService.js +10 -13
- package/dist/web-auth/Entities.js +20 -39
- package/dist/web-auth/Helper.js +12 -22
- package/dist/web-auth/JwtHelper.js +21 -28
- package/dist/web-auth/LoginService.d.ts +21 -0
- package/dist/web-auth/LoginService.js +46 -22
- package/dist/web-auth/TokenService.js +46 -85
- package/dist/web-auth/UserService.js +38 -41
- package/dist/web-auth/VerificationService.js +18 -21
- package/dist/web-auth/WebAuth.d.ts +10 -0
- package/dist/web-auth/WebAuth.js +274 -315
- package/package.json +1 -2
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.VerificationService = void 0;
|
|
4
|
-
var Helper_1 = require("./Helper");
|
|
5
|
-
var VerificationService;
|
|
1
|
+
import { Helper, CustomException } from "./Helper";
|
|
2
|
+
export var VerificationService;
|
|
6
3
|
(function (VerificationService) {
|
|
7
4
|
/**
|
|
8
5
|
* To initiate the account verification, call **initiateAccountVerification()**. This will send verification code email or sms or ivr based on the verificationMedium you mentioned.
|
|
@@ -23,13 +20,13 @@ var VerificationService;
|
|
|
23
20
|
*/
|
|
24
21
|
function initiateAccountVerification(options) {
|
|
25
22
|
try {
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const url = window.webAuthSettings.authority + "/verification-srv/account/initiate";
|
|
24
|
+
let form = Helper.createForm(url, options);
|
|
28
25
|
document.body.appendChild(form);
|
|
29
26
|
form.submit();
|
|
30
27
|
}
|
|
31
28
|
catch (ex) {
|
|
32
|
-
throw new
|
|
29
|
+
throw new CustomException(ex, 417);
|
|
33
30
|
}
|
|
34
31
|
}
|
|
35
32
|
VerificationService.initiateAccountVerification = initiateAccountVerification;
|
|
@@ -51,7 +48,7 @@ var VerificationService;
|
|
|
51
48
|
*/
|
|
52
49
|
function verifyAccount(options) {
|
|
53
50
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/account/verify";
|
|
54
|
-
return
|
|
51
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
55
52
|
}
|
|
56
53
|
VerificationService.verifyAccount = verifyAccount;
|
|
57
54
|
;
|
|
@@ -72,7 +69,7 @@ var VerificationService;
|
|
|
72
69
|
*/
|
|
73
70
|
function getMFAList(options) {
|
|
74
71
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/list";
|
|
75
|
-
return
|
|
72
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
76
73
|
}
|
|
77
74
|
VerificationService.getMFAList = getMFAList;
|
|
78
75
|
;
|
|
@@ -93,7 +90,7 @@ var VerificationService;
|
|
|
93
90
|
*/
|
|
94
91
|
function cancelMFA(options) {
|
|
95
92
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/cancel/" + options.type;
|
|
96
|
-
return
|
|
93
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
97
94
|
}
|
|
98
95
|
VerificationService.cancelMFA = cancelMFA;
|
|
99
96
|
;
|
|
@@ -113,8 +110,8 @@ var VerificationService;
|
|
|
113
110
|
* ```
|
|
114
111
|
*/
|
|
115
112
|
function getAllVerificationList(access_token) {
|
|
116
|
-
|
|
117
|
-
return
|
|
113
|
+
const _serviceURL = `${window.webAuthSettings.authority}/verification-srv/config/list`;
|
|
114
|
+
return Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", access_token);
|
|
118
115
|
}
|
|
119
116
|
VerificationService.getAllVerificationList = getAllVerificationList;
|
|
120
117
|
;
|
|
@@ -143,7 +140,7 @@ var VerificationService;
|
|
|
143
140
|
*/
|
|
144
141
|
function initiateEnrollment(options, accessToken) {
|
|
145
142
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/initiate/" + options.verification_type;
|
|
146
|
-
return
|
|
143
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST", accessToken);
|
|
147
144
|
}
|
|
148
145
|
VerificationService.initiateEnrollment = initiateEnrollment;
|
|
149
146
|
;
|
|
@@ -163,7 +160,7 @@ var VerificationService;
|
|
|
163
160
|
*/
|
|
164
161
|
function getEnrollmentStatus(status_id, accessToken) {
|
|
165
162
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
|
|
166
|
-
return
|
|
163
|
+
return Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", accessToken);
|
|
167
164
|
}
|
|
168
165
|
VerificationService.getEnrollmentStatus = getEnrollmentStatus;
|
|
169
166
|
;
|
|
@@ -192,7 +189,7 @@ var VerificationService;
|
|
|
192
189
|
*/
|
|
193
190
|
function enrollVerification(options) {
|
|
194
191
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/enroll/" + options.verification_type;
|
|
195
|
-
return
|
|
192
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
196
193
|
}
|
|
197
194
|
VerificationService.enrollVerification = enrollVerification;
|
|
198
195
|
;
|
|
@@ -214,7 +211,7 @@ var VerificationService;
|
|
|
214
211
|
*/
|
|
215
212
|
function checkVerificationTypeConfigured(options) {
|
|
216
213
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/check/" + options.verification_type;
|
|
217
|
-
return
|
|
214
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
218
215
|
}
|
|
219
216
|
VerificationService.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
|
|
220
217
|
;
|
|
@@ -245,9 +242,9 @@ var VerificationService;
|
|
|
245
242
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
|
|
246
243
|
// TODO: remove accessToken parameter in the next major release
|
|
247
244
|
if (accessToken) {
|
|
248
|
-
return
|
|
245
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
|
|
249
246
|
}
|
|
250
|
-
return
|
|
247
|
+
return Helper.createHttpPromise(options, _serviceURL, false, "POST");
|
|
251
248
|
}
|
|
252
249
|
VerificationService.initiateMFA = initiateMFA;
|
|
253
250
|
;
|
|
@@ -271,8 +268,8 @@ var VerificationService;
|
|
|
271
268
|
*/
|
|
272
269
|
function authenticateMFA(options) {
|
|
273
270
|
var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
|
|
274
|
-
return
|
|
271
|
+
return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
|
|
275
272
|
}
|
|
276
273
|
VerificationService.authenticateMFA = authenticateMFA;
|
|
277
274
|
;
|
|
278
|
-
})(VerificationService
|
|
275
|
+
})(VerificationService || (VerificationService = {}));
|
|
@@ -645,6 +645,16 @@ export declare class WebAuth {
|
|
|
645
645
|
trackId: string;
|
|
646
646
|
acceptlanguage: string;
|
|
647
647
|
}): Promise<unknown>;
|
|
648
|
+
/**
|
|
649
|
+
* loginAfterRegister
|
|
650
|
+
* @param options
|
|
651
|
+
*/
|
|
652
|
+
loginAfterRegister(options: {
|
|
653
|
+
device_id: string;
|
|
654
|
+
dc?: string;
|
|
655
|
+
rememberMe: boolean;
|
|
656
|
+
trackId: string;
|
|
657
|
+
}): void;
|
|
648
658
|
/**
|
|
649
659
|
* device code flow - initiate
|
|
650
660
|
*/
|