cidaas-javascript-sdk 3.1.2 → 3.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.
@@ -0,0 +1,533 @@
1
+ import { UserManagerSettings } from "oidc-client-ts";
2
+ export interface AcceptResetPasswordEntity {
3
+ resetRequestId: string;
4
+ exchangeId: string;
5
+ password: string;
6
+ confirmPassword: string;
7
+ provider?: string;
8
+ requestId?: string;
9
+ }
10
+ export declare class AccessTokenRequest {
11
+ grant_type?: string;
12
+ code?: string;
13
+ redirect_uri?: string;
14
+ client_id?: string;
15
+ client_secret?: string;
16
+ state?: string;
17
+ scope?: string;
18
+ refresh_token?: string;
19
+ code_verifier?: string;
20
+ username?: string;
21
+ password?: string;
22
+ requestId?: string;
23
+ provider?: string;
24
+ host?: string;
25
+ client_assertion?: string;
26
+ client_assertion_type?: string;
27
+ client_ip?: string;
28
+ captcha?: string;
29
+ locale?: string;
30
+ username_type?: string;
31
+ signature?: string;
32
+ remember_me?: boolean;
33
+ user_agent: string;
34
+ ip_address: string;
35
+ accept_language: string;
36
+ lat: string;
37
+ lng: string;
38
+ finger_print: string;
39
+ referrer: string;
40
+ pre_login_id: string;
41
+ login_type: string;
42
+ device_code: string;
43
+ sub?: string;
44
+ identityId?: string;
45
+ providerUserId?: string;
46
+ mfa_exchange_id?: string;
47
+ dc?: string;
48
+ field_key?: string;
49
+ }
50
+ export declare class PhysicalVerificationLoginRequest {
51
+ q?: string;
52
+ sub?: string;
53
+ requestId?: string;
54
+ status_id?: string;
55
+ verificationType?: string;
56
+ deviceInfo?: IDeviceRequest;
57
+ device_fp?: string;
58
+ }
59
+ export interface IDeviceRequest {
60
+ userAgent: string;
61
+ ipAddress: string;
62
+ lat: string;
63
+ lon: string;
64
+ deviceId: string;
65
+ usedTime: Date;
66
+ purpose: string;
67
+ requestId: string;
68
+ sub: string;
69
+ pushNotificationId: string;
70
+ deviceMake: string;
71
+ deviceModel: string;
72
+ deviceType: string;
73
+ }
74
+ export type AccountVerificationRequestEntity = {
75
+ email?: string;
76
+ mobile?: string;
77
+ phone?: string;
78
+ username?: string;
79
+ verificationMedium?: string;
80
+ processingType?: string;
81
+ requestId?: string;
82
+ client_id?: string;
83
+ redirect_uri?: string;
84
+ response_type?: string;
85
+ sub: string;
86
+ templateKey?: string;
87
+ name?: string;
88
+ accept_language?: string;
89
+ };
90
+ export interface ChangePasswordEntity {
91
+ sub: string;
92
+ identityId: string;
93
+ old_password: string;
94
+ new_password: string;
95
+ confirm_password: string;
96
+ accessToken: string;
97
+ }
98
+ export interface FidoSetupEntity {
99
+ track_id: string;
100
+ fido_request_type: string;
101
+ mobile_number: string;
102
+ phone: string;
103
+ security_questions: string[];
104
+ verification_type: string;
105
+ }
106
+ export declare class FindUserEntity {
107
+ sub: string;
108
+ email: string;
109
+ mobile: string;
110
+ username: string;
111
+ customFields: any;
112
+ provider: string;
113
+ providerUserId: string;
114
+ rememberMe: string;
115
+ webfinger: string;
116
+ sub_not: string;
117
+ requestId: string;
118
+ }
119
+ export interface IAddressEntity {
120
+ formatted: string;
121
+ street_address: string;
122
+ locality: string;
123
+ region: string;
124
+ postal_code: string;
125
+ country: string;
126
+ }
127
+ export interface IAuthVerificationAuthenticationRequestEntity extends FaceVerificationAuthenticationRequestEntity {
128
+ type: string;
129
+ verification_type?: string;
130
+ }
131
+ export interface FIDO2EnrollEntity {
132
+ client_response?: any;
133
+ fidoRequestId?: string;
134
+ }
135
+ export interface FaceVerificationAuthenticationRequestEntity {
136
+ exchange_id: string;
137
+ pass_code?: string;
138
+ client_id: string;
139
+ device_id?: string;
140
+ push_id?: string;
141
+ password?: string;
142
+ upload_attempt?: number;
143
+ fido2_client_response?: FIDO2EnrollEntity;
144
+ single_factor_auth?: boolean;
145
+ captcha?: string;
146
+ captcha_ref?: string;
147
+ bot_captcha_response?: string;
148
+ csrf_token?: string;
149
+ }
150
+ export interface IConfiguredListRequestEntity {
151
+ sub: string;
152
+ email: string;
153
+ mobile_number: string;
154
+ username: string;
155
+ request_id: string;
156
+ verification_types: string[];
157
+ single_factor_sub_ref: string;
158
+ device_fp: string;
159
+ provider: string;
160
+ device_id: string;
161
+ verification_type: string;
162
+ }
163
+ export interface IConsentAcceptEntity {
164
+ client_id: string;
165
+ consent_id: string;
166
+ consent_version_id: string;
167
+ sub: string;
168
+ scopes: string[];
169
+ url: string;
170
+ matcher: any;
171
+ field_key: string;
172
+ accepted_fields: string[];
173
+ accepted_by: string;
174
+ skipped: boolean;
175
+ action_type: string;
176
+ action_id: string;
177
+ q: string;
178
+ revoked: boolean;
179
+ }
180
+ export interface IEnrollVerificationSetupRequestEntity {
181
+ exchange_id: string;
182
+ device_id: string;
183
+ finger_print: string;
184
+ client_id: string;
185
+ push_id: string;
186
+ pass_code: string;
187
+ pkce_key: string;
188
+ face_attempt: number;
189
+ attempt: number;
190
+ fido2_client_response: FIDO2EnrollEntity;
191
+ verification_type: string;
192
+ }
193
+ export interface IInitVerificationAuthenticationRequestEntity {
194
+ q: string;
195
+ sub: string;
196
+ email: string;
197
+ mobile_number: string;
198
+ username: string;
199
+ client_id: string;
200
+ request_id: string;
201
+ usage_type: string;
202
+ medium_id: string;
203
+ single_factor_auth: boolean;
204
+ push_id: string;
205
+ device_id: string;
206
+ single_factor_sub_ref: string;
207
+ verification_types: string[];
208
+ device_fp: string;
209
+ provider: string;
210
+ processingType: string;
211
+ trackId: string;
212
+ type?: string;
213
+ verification_type?: string;
214
+ }
215
+ export interface IMobileEntity {
216
+ given_phone: string;
217
+ phone: string;
218
+ country: string;
219
+ dail_code: string;
220
+ carrier_type: string;
221
+ carrier_name: string;
222
+ national_format: string;
223
+ international_format: string;
224
+ E164_format: string;
225
+ }
226
+ export interface ISuggestedMFAActionConfig {
227
+ sub?: string;
228
+ do_not_ask_again?: boolean;
229
+ later?: boolean;
230
+ }
231
+ export interface IUserEntity {
232
+ userStatus: string;
233
+ user_status: string;
234
+ user_status_reason: string;
235
+ username: string;
236
+ sub: string;
237
+ given_name: string;
238
+ family_name: string;
239
+ middle_name: string;
240
+ nickname: string;
241
+ originalProviderUserId?: string[];
242
+ email: string;
243
+ email_verified: boolean;
244
+ mobile_number: string;
245
+ mobile_number_obj: IMobileEntity | null;
246
+ mobile_number_verified: boolean;
247
+ phone_number: string;
248
+ phone_number_obj: IMobileEntity | null;
249
+ phone_number_verified: boolean;
250
+ profile: string;
251
+ picture: string;
252
+ website: string;
253
+ gender: string;
254
+ zoneinfo: string;
255
+ locale: string;
256
+ birthdate: Date | null;
257
+ address?: IAddressEntity;
258
+ customFields?: any;
259
+ identityCustomFields?: any;
260
+ password: string;
261
+ provider: string;
262
+ providerUserId: string;
263
+ identityId: string;
264
+ mfa_enabled?: boolean;
265
+ roles: string[];
266
+ userGroups: IUserGroupMap[];
267
+ groups?: IUserGroupMap[];
268
+ rawJSON: string;
269
+ trackId: string;
270
+ need_reset_password: boolean;
271
+ }
272
+ export interface IUserGroupMap {
273
+ sub: string;
274
+ groupId: string;
275
+ roles: string[];
276
+ appendRole: boolean;
277
+ }
278
+ export interface IUserLinkEntity {
279
+ master_sub: string;
280
+ user_name_type: string;
281
+ user_name_to_link: string;
282
+ link_accepted_by: string;
283
+ link_response_time: Date;
284
+ link_accepted: boolean;
285
+ communication_type: string;
286
+ verification_status_id: string;
287
+ type: string;
288
+ status: string;
289
+ }
290
+ export type LoginFormRequestAsyncEntity = {
291
+ username: string;
292
+ password: string;
293
+ requestId: string;
294
+ provider: string;
295
+ captcha: string;
296
+ username_type: string;
297
+ field_key: string;
298
+ bot_captcha_response: string;
299
+ csrf_token: string;
300
+ dc?: string;
301
+ device_fp?: string;
302
+ captcha_ref?: string;
303
+ locale?: string;
304
+ rememberMe: string;
305
+ remember_me: string;
306
+ };
307
+ export interface LoginFormRequestEntity {
308
+ username: string;
309
+ password: string;
310
+ requestId: string;
311
+ provider?: string;
312
+ captcha?: string;
313
+ username_type?: string;
314
+ field_key?: string;
315
+ bot_captcha_response?: string;
316
+ csrf_token?: string;
317
+ dc?: string;
318
+ device_fp?: string;
319
+ captcha_ref?: string;
320
+ locale?: string;
321
+ rememberMe?: boolean;
322
+ remember_me?: boolean;
323
+ }
324
+ export interface ResetPasswordEntity {
325
+ email: string;
326
+ mobile?: string;
327
+ phone?: string;
328
+ username?: string;
329
+ resetMedium: "SMS" | "EMAIL" | "IVR";
330
+ processingType: "CODE" | "LINK";
331
+ requestId: string;
332
+ provider?: string;
333
+ resetPasswordId?: string;
334
+ sub?: string;
335
+ }
336
+ export declare class TokenIntrospectionEntity {
337
+ token: string;
338
+ token_type_hint?: string;
339
+ roles?: string[];
340
+ scopes?: string[];
341
+ groups?: GroupValidationEntity[];
342
+ strictGroupValidation: boolean;
343
+ strictScopeValidation: boolean;
344
+ strictRoleValidation: boolean;
345
+ strictValidation: boolean;
346
+ client_id?: string;
347
+ client_secret?: string;
348
+ request_url?: string;
349
+ request_time?: number;
350
+ request_headers?: any;
351
+ }
352
+ export declare class GroupValidationEntity {
353
+ groupId?: string;
354
+ groupType?: string;
355
+ roles?: string[];
356
+ strictRoleValidation: boolean;
357
+ strictValidation: boolean;
358
+ }
359
+ export declare class UpdateReviewDeviceEntity {
360
+ userId: string;
361
+ device: string;
362
+ browser: string;
363
+ location: string;
364
+ }
365
+ export interface UserActivityEntity {
366
+ skip?: Number;
367
+ take?: Number;
368
+ sub?: string;
369
+ startDate?: string;
370
+ endDate?: string;
371
+ events?: [string];
372
+ }
373
+ export declare class UserEntity {
374
+ userStatus?: string;
375
+ user_status?: string;
376
+ user_status_reason?: string;
377
+ username?: string;
378
+ sub?: string;
379
+ originalProviderUserId?: string[];
380
+ given_name: string;
381
+ family_name: string;
382
+ middle_name?: string;
383
+ nickname?: string;
384
+ email: string;
385
+ email_verified?: boolean;
386
+ mobile_number?: string;
387
+ mobile_number_obj?: IMobileEntity | null;
388
+ mobile_number_verified?: boolean;
389
+ phone_number?: string;
390
+ phone_number_obj?: IMobileEntity | null;
391
+ phone_number_verified?: boolean;
392
+ profile?: string;
393
+ picture?: string;
394
+ website?: string;
395
+ gender?: string;
396
+ zoneinfo?: string;
397
+ locale?: string;
398
+ birthdate?: Date | string;
399
+ address?: AddressEntity;
400
+ customFields?: any;
401
+ identityCustomFields?: any;
402
+ password: string;
403
+ password_echo: string;
404
+ password_hash_info?: any | null;
405
+ generate_password?: boolean;
406
+ provider?: string;
407
+ identityId?: string;
408
+ providerUserId?: string;
409
+ providerBusinessIds?: string[];
410
+ street_address?: string;
411
+ mfa_enabled?: boolean;
412
+ roles?: string[];
413
+ groups?: IUserGroupMap[];
414
+ userGroups?: IUserGroupMap[];
415
+ trackId?: string;
416
+ rawJSON?: string;
417
+ need_reset_password?: boolean;
418
+ no_event?: boolean;
419
+ consents?: IConsentField[] | IConsentTrackingEntity[];
420
+ consent_track_ids?: string[];
421
+ ignore_default_roles?: string[];
422
+ createdTime?: Date;
423
+ identities?: IIdentity[];
424
+ _id?: string;
425
+ id?: string;
426
+ invite_id?: string;
427
+ }
428
+ export interface IConsentTrackingEntity {
429
+ state?: string;
430
+ fieldKey: string;
431
+ consentId: string;
432
+ versionId?: string;
433
+ time?: Date;
434
+ scopes: string[];
435
+ acceptedBy: string;
436
+ }
437
+ export interface IConsentField {
438
+ field_key?: string;
439
+ value?: boolean;
440
+ }
441
+ export interface IUserGroupMap {
442
+ sub: string;
443
+ groupId: string;
444
+ roles: string[];
445
+ appendRole: boolean;
446
+ eventType: string;
447
+ status: number;
448
+ }
449
+ export declare class AddressEntity {
450
+ formatted: string;
451
+ street_address: string;
452
+ locality: string;
453
+ region: string;
454
+ postal_code: string;
455
+ country: string;
456
+ }
457
+ export interface IIdentity {
458
+ identityId: string;
459
+ sub: string;
460
+ given_name: string;
461
+ family_name: string;
462
+ middle_name: string;
463
+ nickname: string;
464
+ email: string;
465
+ email_verified: boolean;
466
+ mobile_number: string;
467
+ mobile_number_obj: IMobileEntity;
468
+ mobile_number_verified: boolean;
469
+ phone_number: string;
470
+ phone_number_obj: IMobileEntity;
471
+ phone_number_verified: boolean;
472
+ profile: string;
473
+ picture: string;
474
+ website: string;
475
+ gender: string;
476
+ zoneinfo: string;
477
+ locale: string;
478
+ birthdate: Date | string;
479
+ address: IUserAddress;
480
+ street_address: string;
481
+ provider: string;
482
+ providerUserId: string;
483
+ username: string;
484
+ identityCustomFields: any;
485
+ providerBusinessIds: string[];
486
+ originalProviderUserId?: string[];
487
+ raw_json: string;
488
+ password_hash_info: any | null;
489
+ password: string;
490
+ createdTime: Date;
491
+ updatedTime: Date;
492
+ }
493
+ export interface IMobileEntity {
494
+ _id: string;
495
+ id: string;
496
+ given_phone: string;
497
+ phone: string;
498
+ country: string;
499
+ dail_code: string;
500
+ carrier_type: string;
501
+ carrier_name: string;
502
+ national_format: string;
503
+ international_format: string;
504
+ E164_format: string;
505
+ }
506
+ export interface IUserAddress {
507
+ _id: string;
508
+ id: string;
509
+ formatted: string;
510
+ street_address: string;
511
+ locality: string;
512
+ region: string;
513
+ postal_code: string;
514
+ country: string;
515
+ }
516
+ export declare class ValidateResetPasswordEntity {
517
+ resetRequestId: string;
518
+ code: string;
519
+ }
520
+ export interface IChangePasswordEntity {
521
+ sub?: string;
522
+ identityId?: string;
523
+ old_password: string;
524
+ new_password: string;
525
+ confirm_password: string;
526
+ accessToken?: string;
527
+ loginSettingsId: string;
528
+ client_id?: string;
529
+ }
530
+ export interface ICidaasSDKSettings extends UserManagerSettings {
531
+ mode?: string;
532
+ cidaas_version?: number;
533
+ }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.ValidateResetPasswordEntity = exports.UpdateReviewDeviceEntity = exports.GroupValidationEntity = exports.TokenIntrospectionEntity = exports.FindUserEntity = exports.PhysicalVerificationLoginRequest = exports.AccessTokenRequest = void 0;
4
+ var AccessTokenRequest = /** @class */ (function () {
5
+ function AccessTokenRequest() {
6
+ this.user_agent = "";
7
+ this.ip_address = "";
8
+ this.accept_language = "";
9
+ this.lat = "";
10
+ this.lng = "";
11
+ this.finger_print = "";
12
+ this.referrer = "";
13
+ this.pre_login_id = "";
14
+ this.login_type = "";
15
+ // device code flow
16
+ this.device_code = "";
17
+ }
18
+ return AccessTokenRequest;
19
+ }());
20
+ exports.AccessTokenRequest = AccessTokenRequest;
21
+ var PhysicalVerificationLoginRequest = /** @class */ (function () {
22
+ function PhysicalVerificationLoginRequest() {
23
+ }
24
+ return PhysicalVerificationLoginRequest;
25
+ }());
26
+ exports.PhysicalVerificationLoginRequest = PhysicalVerificationLoginRequest;
27
+ var FindUserEntity = /** @class */ (function () {
28
+ function FindUserEntity() {
29
+ this.sub = "";
30
+ this.email = "";
31
+ this.mobile = "";
32
+ this.username = "";
33
+ this.provider = "";
34
+ this.providerUserId = "";
35
+ this.rememberMe = "";
36
+ this.webfinger = "";
37
+ this.sub_not = "";
38
+ }
39
+ return FindUserEntity;
40
+ }());
41
+ exports.FindUserEntity = FindUserEntity;
42
+ var TokenIntrospectionEntity = /** @class */ (function () {
43
+ function TokenIntrospectionEntity() {
44
+ this.token = "";
45
+ this.strictGroupValidation = false;
46
+ this.strictScopeValidation = false;
47
+ this.strictRoleValidation = false;
48
+ this.strictValidation = false;
49
+ }
50
+ return TokenIntrospectionEntity;
51
+ }());
52
+ exports.TokenIntrospectionEntity = TokenIntrospectionEntity;
53
+ var GroupValidationEntity = /** @class */ (function () {
54
+ function GroupValidationEntity() {
55
+ this.strictRoleValidation = false;
56
+ this.strictValidation = false;
57
+ }
58
+ return GroupValidationEntity;
59
+ }());
60
+ exports.GroupValidationEntity = GroupValidationEntity;
61
+ var UpdateReviewDeviceEntity = /** @class */ (function () {
62
+ function UpdateReviewDeviceEntity() {
63
+ this.userId = "";
64
+ this.device = "";
65
+ this.browser = "";
66
+ this.location = "";
67
+ }
68
+ return UpdateReviewDeviceEntity;
69
+ }());
70
+ exports.UpdateReviewDeviceEntity = UpdateReviewDeviceEntity;
71
+ var ValidateResetPasswordEntity = /** @class */ (function () {
72
+ function ValidateResetPasswordEntity() {
73
+ this.resetRequestId = "";
74
+ this.code = "";
75
+ }
76
+ return ValidateResetPasswordEntity;
77
+ }());
78
+ exports.ValidateResetPasswordEntity = ValidateResetPasswordEntity;
@@ -0,0 +1,24 @@
1
+ export declare class Helper {
2
+ /**
3
+ * create form
4
+ * @param form
5
+ * @param options
6
+ * @returns
7
+ */
8
+ static createForm(url: string, options: any, method?: string): HTMLFormElement;
9
+ /**
10
+ * utility function to create and make post request
11
+ * @param options
12
+ * @param serviceurl
13
+ * @param errorResolver
14
+ * @param access_token??
15
+ * @param headers??
16
+ * @returns
17
+ */
18
+ static createPostPromise(options: any, serviceurl: string, errorResolver: boolean, method: string, access_token?: string, headers?: any): Promise<unknown>;
19
+ }
20
+ export declare class CustomException {
21
+ errorMessage: string;
22
+ statusCode: number;
23
+ constructor(errorMessage: string, statusCode: number);
24
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.CustomException = exports.Helper = void 0;
4
+ var Helper = /** @class */ (function () {
5
+ function Helper() {
6
+ }
7
+ /**
8
+ * create form
9
+ * @param form
10
+ * @param options
11
+ * @returns
12
+ */
13
+ Helper.createForm = function (url, options, method) {
14
+ if (method === void 0) { method = 'POST'; }
15
+ var form = document.createElement('form');
16
+ form.action = url;
17
+ form.method = method;
18
+ for (var key in options) {
19
+ if (options.hasOwnProperty(key)) {
20
+ var hiddenField = document.createElement("input");
21
+ hiddenField.setAttribute("type", "hidden");
22
+ hiddenField.setAttribute("name", key);
23
+ hiddenField.setAttribute("value", options[key]);
24
+ form.appendChild(hiddenField);
25
+ }
26
+ }
27
+ return form;
28
+ };
29
+ /**
30
+ * utility function to create and make post request
31
+ * @param options
32
+ * @param serviceurl
33
+ * @param errorResolver
34
+ * @param access_token??
35
+ * @param headers??
36
+ * @returns
37
+ */
38
+ Helper.createPostPromise = function (options, serviceurl, errorResolver, method, access_token, headers) {
39
+ return new Promise(function (resolve, reject) {
40
+ try {
41
+ var http = new XMLHttpRequest();
42
+ http.onreadystatechange = function () {
43
+ if (http.readyState == 4) {
44
+ if (http.responseText) {
45
+ resolve(JSON.parse(http.responseText));
46
+ }
47
+ else {
48
+ resolve(errorResolver);
49
+ }
50
+ }
51
+ };
52
+ http.open(method, serviceurl, true);
53
+ http.setRequestHeader("Content-type", "application/json");
54
+ if (headers) {
55
+ for (var key in headers) {
56
+ if (headers.hasOwnProperty(key)) {
57
+ http.setRequestHeader(key, headers[key]);
58
+ }
59
+ }
60
+ }
61
+ if (access_token) {
62
+ http.setRequestHeader("Authorization", "Bearer ".concat(access_token));
63
+ }
64
+ if (window.localeSettings) {
65
+ http.setRequestHeader("accept-language", window.localeSettings);
66
+ }
67
+ if (options) {
68
+ http.send(JSON.stringify(options));
69
+ }
70
+ else {
71
+ http.send();
72
+ }
73
+ }
74
+ catch (ex) {
75
+ reject(ex);
76
+ }
77
+ });
78
+ };
79
+ return Helper;
80
+ }());
81
+ exports.Helper = Helper;
82
+ var CustomException = /** @class */ (function () {
83
+ function CustomException(errorMessage, statusCode) {
84
+ this.errorMessage = errorMessage;
85
+ this.statusCode = statusCode;
86
+ }
87
+ return CustomException;
88
+ }());
89
+ exports.CustomException = CustomException;