cidaas-javascript-sdk 3.0.5 → 3.1.1

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.
@@ -1,125 +0,0 @@
1
- import { IConfiguredListRequestEntity, IInitVerificationAuthenticationRequestEntity, FidoSetupEntity, IEnrollVerificationSetupRequestEntity, IAuthVerificationAuthenticationRequestEntity, FaceVerificationAuthenticationRequestEntity, AccountVerificationRequestEntity } from "./Entities";
2
- export declare namespace VerificationService {
3
- /**
4
- * initiate verification
5
- * @param options
6
- * @returns
7
- */
8
- function initiateAccountVerification(options: AccountVerificationRequestEntity): void;
9
- /**
10
- * initiate verification and return response
11
- * @param options
12
- * @returns
13
- */
14
- function initiateAccountVerificationAsynFn(options: AccountVerificationRequestEntity): Promise<Response>;
15
- /**
16
- * verify account
17
- * @param options
18
- * @returns
19
- */
20
- function verifyAccount(options: {
21
- accvid: string;
22
- code: string;
23
- }): Promise<unknown>;
24
- /**
25
- * get mfa list v2
26
- * @param options
27
- * @returns
28
- */
29
- function getMFAListV2(options: IConfiguredListRequestEntity): Promise<unknown>;
30
- /**
31
- * cancel mfa v2
32
- * @param options
33
- * @returns
34
- */
35
- function cancelMFAV2(options: {
36
- exchange_id: string;
37
- reason: string;
38
- type: string;
39
- }): Promise<unknown>;
40
- /**
41
- * @param access_token
42
- * @returns
43
- */
44
- function getAllVerificationList(access_token: string): Promise<unknown>;
45
- /**
46
- * enrollVerification
47
- * @param options
48
- * @returns
49
- */
50
- function enrollVerification(options: IEnrollVerificationSetupRequestEntity): Promise<unknown>;
51
- /**
52
- * @deprecated This function is no longer supported, instead use {this.updateStatus()}
53
- * @param status_id
54
- * @returns
55
- */
56
- function updateSocket(status_id: string): Promise<unknown>;
57
- /**
58
- * update the status of notification
59
- * @param status_id
60
- * @returns
61
- */
62
- function updateStatus(status_id: string): Promise<unknown>;
63
- /**
64
- * setupFidoVerification
65
- * @param options
66
- * @returns
67
- */
68
- function setupFidoVerification(options: FidoSetupEntity): Promise<unknown>;
69
- /**
70
- * checkVerificationTypeConfigured
71
- * @param options
72
- * @returns
73
- */
74
- function checkVerificationTypeConfigured(options: IConfiguredListRequestEntity): Promise<unknown>;
75
- /**
76
- * initiate mfa v2
77
- * @param options
78
- * @returns
79
- */
80
- function initiateMFAV2(options: IInitVerificationAuthenticationRequestEntity): Promise<unknown>;
81
- /**
82
- * @deprecated
83
- * @param options
84
- * @param verificationType
85
- * @returns
86
- */
87
- function initiateMfaV1(options: any, verificationType: string): Promise<unknown>;
88
- /**
89
- * authenticate mfa v2
90
- * @param options
91
- * @returns
92
- */
93
- function authenticateMFAV2(options: IAuthVerificationAuthenticationRequestEntity): Promise<unknown>;
94
- /**
95
- * authenticateVerification form type (for face)
96
- * @param options
97
- * @returns
98
- */
99
- function authenticateFaceVerification(options: FaceVerificationAuthenticationRequestEntity): Promise<unknown>;
100
- /**
101
- * @deprecated
102
- * setup verification - v1
103
- * @param options
104
- * @param access_token
105
- * @param verificationType
106
- * @returns
107
- */
108
- function setupVerificationV1(options: any, access_token: string, verificationType: string): Promise<unknown>;
109
- /**
110
- * @deprecated
111
- * enroll verification - v1
112
- * @param options
113
- * @param access_token
114
- * @param verificationType
115
- * @returns
116
- */
117
- function enrollVerificationV1(options: any, access_token: string, verificationType: string): Promise<unknown>;
118
- /**
119
- * @deprecated
120
- * authenticate mfa - v1
121
- * @param verificationType
122
- * @returns
123
- */
124
- function authenticateMfaV1(options: any, verificationType: string): Promise<unknown>;
125
- }
@@ -1,273 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.VerificationService = void 0;
4
- var Helper_1 = require("./Helper");
5
- var VerificationService;
6
- (function (VerificationService) {
7
- /**
8
- * initiate verification
9
- * @param options
10
- * @returns
11
- */
12
- function initiateAccountVerification(options) {
13
- try {
14
- var url = window.webAuthSettings.authority + "/verification-srv/account/initiate";
15
- var form = Helper_1.Helper.createForm(url, options);
16
- document.body.appendChild(form);
17
- form.submit();
18
- }
19
- catch (ex) {
20
- throw new Helper_1.CustomException(ex, 417);
21
- }
22
- }
23
- VerificationService.initiateAccountVerification = initiateAccountVerification;
24
- ;
25
- /**
26
- * initiate verification and return response
27
- * @param options
28
- * @returns
29
- */
30
- function initiateAccountVerificationAsynFn(options) {
31
- try {
32
- var searchParams = new URLSearchParams(options);
33
- var response = fetch(window.webAuthSettings.authority + "/verification-srv/account/initiate", {
34
- method: "POST",
35
- redirect: "follow",
36
- body: searchParams.toString(),
37
- headers: {
38
- "Content-Type": "application/x-www-form-urlencoded"
39
- }
40
- });
41
- return response;
42
- }
43
- catch (ex) {
44
- throw new Helper_1.CustomException(ex, 417);
45
- }
46
- }
47
- VerificationService.initiateAccountVerificationAsynFn = initiateAccountVerificationAsynFn;
48
- ;
49
- /**
50
- * verify account
51
- * @param options
52
- * @returns
53
- */
54
- function verifyAccount(options) {
55
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/account/verify";
56
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
57
- }
58
- VerificationService.verifyAccount = verifyAccount;
59
- ;
60
- /**
61
- * get mfa list v2
62
- * @param options
63
- * @returns
64
- */
65
- function getMFAListV2(options) {
66
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/list";
67
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
68
- }
69
- VerificationService.getMFAListV2 = getMFAListV2;
70
- ;
71
- /**
72
- * cancel mfa v2
73
- * @param options
74
- * @returns
75
- */
76
- function cancelMFAV2(options) {
77
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/cancel/" + options.type;
78
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
79
- }
80
- VerificationService.cancelMFAV2 = cancelMFAV2;
81
- ;
82
- /**
83
- * @param access_token
84
- * @returns
85
- */
86
- function getAllVerificationList(access_token) {
87
- return new Promise(function (resolve, reject) {
88
- try {
89
- var http = new XMLHttpRequest();
90
- http.onreadystatechange = function () {
91
- if (http.readyState == 4) {
92
- if (http.responseText) {
93
- resolve(JSON.parse(http.responseText));
94
- }
95
- else {
96
- resolve(undefined);
97
- }
98
- }
99
- };
100
- http.open("GET", "".concat(window.webAuthSettings.authority, "/verification-srv/config/list"), true);
101
- http.setRequestHeader("Authorization", "Bearer ".concat(access_token));
102
- if (window.localeSettings) {
103
- http.setRequestHeader("accept-language", window.localeSettings);
104
- }
105
- http.send();
106
- }
107
- catch (ex) {
108
- reject(ex);
109
- }
110
- });
111
- }
112
- VerificationService.getAllVerificationList = getAllVerificationList;
113
- ;
114
- /**
115
- * enrollVerification
116
- * @param options
117
- * @returns
118
- */
119
- function enrollVerification(options) {
120
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/enroll/" + options.verification_type;
121
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
122
- }
123
- VerificationService.enrollVerification = enrollVerification;
124
- ;
125
- /**
126
- * @deprecated This function is no longer supported, instead use {this.updateStatus()}
127
- * @param status_id
128
- * @returns
129
- */
130
- function updateSocket(status_id) {
131
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
132
- return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined);
133
- }
134
- VerificationService.updateSocket = updateSocket;
135
- ;
136
- /**
137
- * update the status of notification
138
- * @param status_id
139
- * @returns
140
- */
141
- function updateStatus(status_id) {
142
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
143
- return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined);
144
- }
145
- VerificationService.updateStatus = updateStatus;
146
- ;
147
- /**
148
- * setupFidoVerification
149
- * @param options
150
- * @returns
151
- */
152
- function setupFidoVerification(options) {
153
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/initiate/suggestmfa/" + options.verification_type;
154
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
155
- }
156
- VerificationService.setupFidoVerification = setupFidoVerification;
157
- ;
158
- /**
159
- * checkVerificationTypeConfigured
160
- * @param options
161
- * @returns
162
- */
163
- function checkVerificationTypeConfigured(options) {
164
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/check/" + options.verification_type;
165
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
166
- }
167
- VerificationService.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
168
- ;
169
- /**
170
- * initiate mfa v2
171
- * @param options
172
- * @returns
173
- */
174
- function initiateMFAV2(options) {
175
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
176
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
177
- }
178
- VerificationService.initiateMFAV2 = initiateMFAV2;
179
- ;
180
- /**
181
- * @deprecated
182
- * @param options
183
- * @param verificationType
184
- * @returns
185
- */
186
- function initiateMfaV1(options, verificationType) {
187
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/initiate";
188
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
189
- }
190
- VerificationService.initiateMfaV1 = initiateMfaV1;
191
- /**
192
- * authenticate mfa v2
193
- * @param options
194
- * @returns
195
- */
196
- function authenticateMFAV2(options) {
197
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
198
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined);
199
- }
200
- VerificationService.authenticateMFAV2 = authenticateMFAV2;
201
- ;
202
- /**
203
- * authenticateVerification form type (for face)
204
- * @param options
205
- * @returns
206
- */
207
- function authenticateFaceVerification(options) {
208
- return new Promise(function (resolve, reject) {
209
- try {
210
- var http = new XMLHttpRequest();
211
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/face";
212
- http.onreadystatechange = function () {
213
- if (http.readyState == 4) {
214
- if (http.responseText) {
215
- resolve(JSON.parse(http.responseText));
216
- }
217
- else {
218
- resolve(undefined);
219
- }
220
- }
221
- };
222
- http.open("POST", _serviceURL, true);
223
- http.setRequestHeader("Content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
224
- if (window.localeSettings) {
225
- http.setRequestHeader("accept-language", window.localeSettings);
226
- }
227
- http.send(JSON.stringify(options));
228
- }
229
- catch (ex) {
230
- reject(ex);
231
- }
232
- });
233
- }
234
- VerificationService.authenticateFaceVerification = authenticateFaceVerification;
235
- ;
236
- /**
237
- * @deprecated
238
- * setup verification - v1
239
- * @param options
240
- * @param access_token
241
- * @param verificationType
242
- * @returns
243
- */
244
- function setupVerificationV1(options, access_token, verificationType) {
245
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/setup";
246
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
247
- }
248
- VerificationService.setupVerificationV1 = setupVerificationV1;
249
- /**
250
- * @deprecated
251
- * enroll verification - v1
252
- * @param options
253
- * @param access_token
254
- * @param verificationType
255
- * @returns
256
- */
257
- function enrollVerificationV1(options, access_token, verificationType) {
258
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/enroll";
259
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false, access_token);
260
- }
261
- VerificationService.enrollVerificationV1 = enrollVerificationV1;
262
- /**
263
- * @deprecated
264
- * authenticate mfa - v1
265
- * @param verificationType
266
- * @returns
267
- */
268
- function authenticateMfaV1(options, verificationType) {
269
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/authenticate";
270
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false);
271
- }
272
- VerificationService.authenticateMfaV1 = authenticateMfaV1;
273
- })(VerificationService = exports.VerificationService || (exports.VerificationService = {}));