cidaas-javascript-sdk 3.1.0 → 3.1.2

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,251 +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, "POST");
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, "POST");
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, "POST");
79
- }
80
- VerificationService.cancelMFAV2 = cancelMFAV2;
81
- ;
82
- /**
83
- * @param access_token
84
- * @returns
85
- */
86
- function getAllVerificationList(access_token) {
87
- var _serviceURL = "".concat(window.webAuthSettings.authority, "/verification-srv/config/list");
88
- return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "GET", access_token);
89
- }
90
- VerificationService.getAllVerificationList = getAllVerificationList;
91
- ;
92
- /**
93
- * enrollVerification
94
- * @param options
95
- * @returns
96
- */
97
- function enrollVerification(options) {
98
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/enroll/" + options.verification_type;
99
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
100
- }
101
- VerificationService.enrollVerification = enrollVerification;
102
- ;
103
- /**
104
- * @deprecated This function is no longer supported, instead use {this.updateStatus()}
105
- * @param status_id
106
- * @returns
107
- */
108
- function updateSocket(status_id) {
109
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
110
- return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "POST");
111
- }
112
- VerificationService.updateSocket = updateSocket;
113
- ;
114
- /**
115
- * update the status of notification
116
- * @param status_id
117
- * @returns
118
- */
119
- function updateStatus(status_id) {
120
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
121
- return Helper_1.Helper.createPostPromise(undefined, _serviceURL, undefined, "POST");
122
- }
123
- VerificationService.updateStatus = updateStatus;
124
- ;
125
- /**
126
- * setupFidoVerification
127
- * @param options
128
- * @returns
129
- */
130
- function setupFidoVerification(options) {
131
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/initiate/suggestmfa/" + options.verification_type;
132
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
133
- }
134
- VerificationService.setupFidoVerification = setupFidoVerification;
135
- ;
136
- /**
137
- * checkVerificationTypeConfigured
138
- * @param options
139
- * @returns
140
- */
141
- function checkVerificationTypeConfigured(options) {
142
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/check/" + options.verification_type;
143
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
144
- }
145
- VerificationService.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
146
- ;
147
- /**
148
- * initiate mfa v2
149
- * @param options
150
- * @returns
151
- */
152
- function initiateMFAV2(options) {
153
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
154
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
155
- }
156
- VerificationService.initiateMFAV2 = initiateMFAV2;
157
- ;
158
- /**
159
- * @deprecated
160
- * @param options
161
- * @param verificationType
162
- * @returns
163
- */
164
- function initiateMfaV1(options, verificationType) {
165
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/initiate";
166
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
167
- }
168
- VerificationService.initiateMfaV1 = initiateMfaV1;
169
- /**
170
- * authenticate mfa v2
171
- * @param options
172
- * @returns
173
- */
174
- function authenticateMFAV2(options) {
175
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
176
- return Helper_1.Helper.createPostPromise(options, _serviceURL, undefined, "POST");
177
- }
178
- VerificationService.authenticateMFAV2 = authenticateMFAV2;
179
- ;
180
- /**
181
- * authenticateVerification form type (for face)
182
- * @param options
183
- * @returns
184
- */
185
- function authenticateFaceVerification(options) {
186
- return new Promise(function (resolve, reject) {
187
- try {
188
- var http = new XMLHttpRequest();
189
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/face";
190
- http.onreadystatechange = function () {
191
- if (http.readyState == 4) {
192
- if (http.responseText) {
193
- resolve(JSON.parse(http.responseText));
194
- }
195
- else {
196
- resolve(undefined);
197
- }
198
- }
199
- };
200
- http.open("POST", _serviceURL, true);
201
- http.setRequestHeader("Content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
202
- if (window.localeSettings) {
203
- http.setRequestHeader("accept-language", window.localeSettings);
204
- }
205
- http.send(JSON.stringify(options));
206
- }
207
- catch (ex) {
208
- reject(ex);
209
- }
210
- });
211
- }
212
- VerificationService.authenticateFaceVerification = authenticateFaceVerification;
213
- ;
214
- /**
215
- * @deprecated
216
- * setup verification - v1
217
- * @param options
218
- * @param access_token
219
- * @param verificationType
220
- * @returns
221
- */
222
- function setupVerificationV1(options, access_token, verificationType) {
223
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/setup";
224
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
225
- }
226
- VerificationService.setupVerificationV1 = setupVerificationV1;
227
- /**
228
- * @deprecated
229
- * enroll verification - v1
230
- * @param options
231
- * @param access_token
232
- * @param verificationType
233
- * @returns
234
- */
235
- function enrollVerificationV1(options, access_token, verificationType) {
236
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/enroll";
237
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST", access_token);
238
- }
239
- VerificationService.enrollVerificationV1 = enrollVerificationV1;
240
- /**
241
- * @deprecated
242
- * authenticate mfa - v1
243
- * @param verificationType
244
- * @returns
245
- */
246
- function authenticateMfaV1(options, verificationType) {
247
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/" + verificationType.toLowerCase() + "/authenticate";
248
- return Helper_1.Helper.createPostPromise(options, _serviceURL, false, "POST");
249
- }
250
- VerificationService.authenticateMfaV1 = authenticateMfaV1;
251
- })(VerificationService = exports.VerificationService || (exports.VerificationService = {}));