cidaas-javascript-sdk 4.2.4 → 4.3.0

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +18 -3
  2. package/README.md +3 -0
  3. package/dist/authentication/{index.d.ts → Authentication.d.ts} +2 -2
  4. package/dist/authentication/{index.js → Authentication.js} +2 -9
  5. package/dist/common/Common.model.d.ts +37 -0
  6. package/dist/common/Common.model.js +26 -0
  7. package/dist/{web-auth → common}/Helper.d.ts +6 -6
  8. package/dist/{web-auth → common}/Helper.js +10 -10
  9. package/dist/common/JwtHelper.d.ts +8 -0
  10. package/dist/{web-auth → common}/JwtHelper.js +8 -8
  11. package/dist/common/User.model.d.ts +134 -0
  12. package/dist/common/User.model.js +2 -0
  13. package/dist/consent-service/ConsentService.d.ts +96 -0
  14. package/dist/consent-service/ConsentService.js +127 -0
  15. package/dist/consent-service/ConsentService.model.d.ts +102 -0
  16. package/dist/consent-service/ConsentService.model.js +2 -0
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/login-service/LoginService.d.ts +143 -0
  20. package/dist/login-service/LoginService.js +247 -0
  21. package/dist/login-service/LoginService.model.d.ts +138 -0
  22. package/dist/login-service/LoginService.model.js +13 -0
  23. package/dist/token-service/TokenService.d.ts +139 -0
  24. package/dist/token-service/TokenService.js +242 -0
  25. package/dist/token-service/TokenService.model.d.ts +149 -0
  26. package/dist/token-service/TokenService.model.js +43 -0
  27. package/dist/user-service/UserService.d.ts +317 -0
  28. package/dist/user-service/UserService.js +451 -0
  29. package/dist/user-service/UserService.model.d.ts +142 -0
  30. package/dist/user-service/UserService.model.js +10 -0
  31. package/dist/verification-service/VerificationService.d.ts +218 -0
  32. package/dist/verification-service/VerificationService.js +288 -0
  33. package/dist/verification-service/VerificationService.model.d.ts +158 -0
  34. package/dist/verification-service/VerificationService.model.js +2 -0
  35. package/dist/web-auth/WebAuth.d.ts +110 -177
  36. package/dist/web-auth/WebAuth.js +120 -150
  37. package/dist/web-auth/webauth.model.d.ts +50 -0
  38. package/dist/web-auth/webauth.model.js +2 -0
  39. package/package.json +1 -1
  40. package/dist/web-auth/ConsentService.d.ts +0 -123
  41. package/dist/web-auth/ConsentService.js +0 -136
  42. package/dist/web-auth/Entities.d.ts +0 -516
  43. package/dist/web-auth/Entities.js +0 -69
  44. package/dist/web-auth/JwtHelper.d.ts +0 -7
  45. package/dist/web-auth/LoginService.d.ts +0 -165
  46. package/dist/web-auth/LoginService.js +0 -246
  47. package/dist/web-auth/TokenService.d.ts +0 -143
  48. package/dist/web-auth/TokenService.js +0 -249
  49. package/dist/web-auth/UserService.d.ts +0 -345
  50. package/dist/web-auth/UserService.js +0 -471
  51. package/dist/web-auth/VerificationService.d.ts +0 -224
  52. package/dist/web-auth/VerificationService.js +0 -278
  53. /package/dist/authentication/{authentication.model.d.ts → Authentication.model.d.ts} +0 -0
  54. /package/dist/authentication/{authentication.model.js → Authentication.model.js} +0 -0
@@ -1,278 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VerificationService = void 0;
4
- const Helper_1 = require("./Helper");
5
- var VerificationService;
6
- (function (VerificationService) {
7
- /**
8
- * To initiate the account verification, call **initiateAccountVerification()**. This will send verification code email or sms or ivr based on the verificationMedium you mentioned.
9
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/cgans5erj5alg-init-account-verification for more details.
10
- * @example
11
- * ```js
12
- * cidaas.initiateAccountVerification({
13
- * verificationMedium: 'email',
14
- * requestId: 'your requestId',
15
- * processingType: 'CODE',
16
- * email: 'your email'
17
- * }).then(function (response) {
18
- * // the response will give you account verification details.
19
- * }).catch(function(ex) {
20
- * // your failure code here
21
- * });
22
- * ```
23
- */
24
- function initiateAccountVerification(options) {
25
- try {
26
- const url = window.webAuthSettings.authority + "/verification-srv/account/initiate";
27
- let form = Helper_1.Helper.createForm(url, options);
28
- document.body.appendChild(form);
29
- form.submit();
30
- }
31
- catch (ex) {
32
- throw new Helper_1.CustomException(ex, 417);
33
- }
34
- }
35
- VerificationService.initiateAccountVerification = initiateAccountVerification;
36
- ;
37
- /**
38
- * To complete the verification, call **verifyAccount()**.
39
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/r8h9mvavvw2e6-verify-account for more details.
40
- * @example
41
- * ```js
42
- * cidaas.verifyAccount({
43
- * accvid: 'your accvid', // which you will get on initiate account verification response
44
- * code: 'your code in email or sms or ivr'
45
- * }).then(function (response) {
46
- * // the response will give you account verification ID and unique code.
47
- * }).catch(function(ex) {
48
- * // your failure code here
49
- * });
50
- * ```
51
- */
52
- function verifyAccount(options) {
53
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/account/verify";
54
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
55
- }
56
- VerificationService.verifyAccount = verifyAccount;
57
- ;
58
- /**
59
- * To get all configured multi factor authentication, call **getMFAList()**.
60
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/ee688a9c52b63-list-of-configured-verification-methods for more details.
61
- * @example
62
- * ```js
63
- * cidaas.getMFAList({
64
- * request_id: 'your request id',
65
- * email: 'your email'
66
- * }).then(function (response) {
67
- * // the response will give you list of configured multi factor authentication
68
- * }).catch(function(ex) {
69
- * // your failure code here
70
- * });
71
- * ```
72
- */
73
- function getMFAList(options) {
74
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/list";
75
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
76
- }
77
- VerificationService.getMFAList = getMFAList;
78
- ;
79
- /**
80
- * to cancel mfa process, call **cancelMFA()**.
81
- * @example
82
- * ```js
83
- * cidaas.cancelMFA({
84
- * exchange_id: 'exchange id from initiateMFA() response',
85
- * reason: 'reason of mfa cancelation',
86
- * type: 'authentication type e.g. email'
87
- * }).then(function (response) {
88
- * // your success code here
89
- * }).catch(function(ex) {
90
- * // your failure code here
91
- * });
92
- * ```
93
- */
94
- function cancelMFA(options) {
95
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/cancel/" + options.type;
96
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
97
- }
98
- VerificationService.cancelMFA = cancelMFA;
99
- ;
100
- /**
101
- * To get list of all verification type configured, call **getAllVerificationList()**. access_token must be passed as function parameter.
102
- * @example
103
- * ```js
104
- * const access_token = "your access token";
105
- *
106
- * cidaas.getAllVerificationList(access_token)
107
- * .then(function (response) {
108
- * // type your code here
109
- * })
110
- * .catch(function (ex) {
111
- * // your failure code here
112
- * });
113
- * ```
114
- */
115
- function getAllVerificationList(access_token) {
116
- const _serviceURL = `${window.webAuthSettings.authority}/verification-srv/config/list`;
117
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "GET", access_token);
118
- }
119
- VerificationService.getAllVerificationList = getAllVerificationList;
120
- ;
121
- /**
122
- * To initiate enrollment of new multi factor authentication, call **initiateEnrollment()**.
123
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/f85aef6754714-initiate-physical-verification-setup for more details.
124
- * @example
125
- * ```js
126
- * const access_token = "your access token";
127
- * const options = {
128
- * verification_type: 'one of verification_type such as fido2, face, ivr',
129
- * deviceInfo: {
130
- * deviceId: '',
131
- * location: {lat: '', lon: ''}
132
- * }
133
- * }
134
- *
135
- * cidaas.initiateEnrollment(options, access_token)
136
- * .then(function (response) {
137
- * // type your code here
138
- * })
139
- * .catch(function (ex) {
140
- * // your failure code here
141
- * });
142
- * ```
143
- */
144
- function initiateEnrollment(options, accessToken) {
145
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/initiate/" + options.verification_type;
146
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST", accessToken);
147
- }
148
- VerificationService.initiateEnrollment = initiateEnrollment;
149
- ;
150
- /**
151
- * to get the status of MFA enrollment, call **getEnrollmentStatus()**.
152
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/b06447d02d8e0-get-status-of-physical-verification-setup-configuration for more details.
153
- * @example
154
- * ```js
155
- * cidaas.getEnrollmentStatus('statusId from initiateEnrollment()', 'your access token')
156
- * .then(function (response) {
157
- * // type your code here
158
- * })
159
- * .catch(function (ex) {
160
- * // your failure code here
161
- * });
162
- * ```
163
- */
164
- function getEnrollmentStatus(status_id, accessToken) {
165
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/notification/status/" + status_id;
166
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, undefined, "POST", accessToken);
167
- }
168
- VerificationService.getEnrollmentStatus = getEnrollmentStatus;
169
- ;
170
- /**
171
- * to finish enrollment process of new multi factor authentication, call **enrollVerification()**.
172
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/20ec76e937b27-enroll-physical-verification-setup for more details.
173
- * @example
174
- * ```js
175
- * const fidoPayload = {
176
- * sub: 'your sub',
177
- * exchange_id: 'exchange_id from initiateEnrollment()',
178
- * verification_type: 'fido2',
179
- * fido2_client_response: {
180
- * client_response: 'client_response from doing fido process',
181
- * fidoRequestId: 'fidoRequestId from initiateEnrollment',
182
- * }
183
- * }
184
- * cidaas.enrollVerification(fidoPayload)
185
- * .then(function (response) {
186
- * // type your code here
187
- * })
188
- * .catch(function (ex) {
189
- * // your failure code here
190
- * });
191
- * ```
192
- */
193
- function enrollVerification(options) {
194
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/enroll/" + options.verification_type;
195
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
196
- }
197
- VerificationService.enrollVerification = enrollVerification;
198
- ;
199
- /**
200
- * to see details of configured verification type, call **checkVerificationTypeConfigured()**.
201
- * @example
202
- * ```js
203
- * cidaas.checkVerificationTypeConfigured({
204
- * request_id: 'your request id',
205
- * email: 'your email',
206
- * verification_type: 'email'
207
- * }).then(function (response) {
208
- * // type your code here
209
- * })
210
- * .catch(function (ex) {
211
- * // your failure code here
212
- * });
213
- * ```
214
- */
215
- function checkVerificationTypeConfigured(options) {
216
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/setup/public/configured/check/" + options.verification_type;
217
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
218
- }
219
- VerificationService.checkVerificationTypeConfigured = checkVerificationTypeConfigured;
220
- ;
221
- /**
222
- * to initiate multi factor auhentication, call **initiateMFA()**.
223
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2a3ea581bb249-initiate-verification for more details.
224
- * @example
225
- * ```js
226
- * const access_token = "your access token";
227
- * const options = {
228
- * request_id: 'your request id',
229
- * usage_type: 'PASSWORDLESS_AUTHENTICATION',
230
- * type: 'email'
231
- * email: 'your email'
232
- * }
233
- * }
234
- *
235
- * cidaas.initiateMFA(options, access_token)
236
- * .then(function (response) {
237
- * // type your code here
238
- * })
239
- * .catch(function (ex) {
240
- * // your failure code here
241
- * });
242
- * ```
243
- */
244
- function initiateMFA(options, accessToken) {
245
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/initiate/" + options.type;
246
- // TODO: remove accessToken parameter in the next major release
247
- if (accessToken) {
248
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", accessToken);
249
- }
250
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST");
251
- }
252
- VerificationService.initiateMFA = initiateMFA;
253
- ;
254
- /**
255
- * to authenticate with multi factor auhentication, call **authenticateMFA()**.
256
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/1aa38936252d6-perform-the-authentication-method for more details.
257
- * @example
258
- * ```js
259
- * cidaas.authenticateMFA({
260
- * type: 'email',
261
- * client_id: 'your client id',
262
- * exchange_id: exchange id from initiateMFA(),
263
- * pass_code: 'code to authenticate'
264
- * }).then(function (response) {
265
- * // type your code here
266
- * })
267
- * .catch(function (ex) {
268
- * // your failure code here
269
- * });
270
- * ```
271
- */
272
- function authenticateMFA(options) {
273
- var _serviceURL = window.webAuthSettings.authority + "/verification-srv/v2/authenticate/authenticate/" + options.type;
274
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
275
- }
276
- VerificationService.authenticateMFA = authenticateMFA;
277
- ;
278
- })(VerificationService = exports.VerificationService || (exports.VerificationService = {}));