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
package/CHANGELOG.md CHANGED
@@ -1,12 +1,27 @@
1
- ## [4.2.4](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.2.3...v4.2.4) (2024-04-16)
1
+ # [4.3.0](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/compare/v4.2.4...v4.3.0) (2024-10-21)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * Fix unable to import into bundler module ([adf4984](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/adf4984abbef2d28a2073abf0352fe9e3db66095))
6
+ * update docs ([ab57459](https://gitlab.widas.de/cidaas-public-devkits/cidaas-public-sdks/cidaas-javascript-sdk/commit/ab5745918f80f5c76f7b529b66dc8a8bae10369e))
7
7
 
8
8
  # Changelog
9
9
 
10
+ ## V4.3.0
11
+
12
+ ### Added
13
+ - add initiateVerification(), configureVerification() & configureFriendlyName() functions to verification service
14
+ - add actionGuestLogin() functions to login service
15
+ - add userActionOnEnrollment() functions to general sdk functions
16
+
17
+ ### Changed
18
+ - Update project structure
19
+ - Update data model to mirror current cidaas api call
20
+ - Improve documentation
21
+
22
+ ### Fix
23
+ - Fix vulnerabilities from `npm audit`
24
+
10
25
  ## V4.2.4
11
26
 
12
27
  ### Fix
package/README.md CHANGED
@@ -132,6 +132,7 @@ The login functions could be found [here](https://github.com/Cidaas/cidaas-javas
132
132
  | loginPrecheck, consentContinue, firstTimeChangePassword, mfaContinue | Depending on the missing information from loginPrecheck, user will be redirected to another page after login to either accepting consent, changing password, continuing MFA process, or do progressive registration |
133
133
  | getMissingFields, progressiveRegistration | In case a new required field is added in registration settings, it is possible to use the sdk to inform user of the changes and asked them to fill in the missing required fields by the next login |
134
134
  | loginAfterRegister | By calling this sdk function, user could directly login to the app after successful registration |
135
+ | actionGuestLogin | If user has guestLoginForm prepared, it could be called using this function |
135
136
 
136
137
  #### User Management
137
138
 
@@ -171,6 +172,7 @@ The verification functions could be found [here](https://github.com/Cidaas/cidaa
171
172
  | cancelMFA | MFA process could be aborted in case something go the wrong way |
172
173
  | getAllVerificationList, getMFAList, checkVerificationTypeConfigured | Information about every supported MFA Verification types, List of configured MFA, and details about particular configured verification type are provided by the SDK |
173
174
  | initiateEnrollment, enrollVerification, getEnrollmentStatus | Additional MFA verification type could be enrolled using the sdk |
175
+ | initiateVerification, configureVerification, configureFriendlyName | The SDK support configuring verification request as well as friendly name |
174
176
 
175
177
  #### Consent Management
176
178
 
@@ -193,6 +195,7 @@ general SDK functions could be found [here](https://github.com/Cidaas/cidaas-jav
193
195
  | setAcceptLanguageHeader | The SDK could be used to change response language |
194
196
  | createDeviceInfo, getDevicesInfo, deleteDevice | Creating, getting, and removing device information is supported by the SDK |
195
197
  | logoutUser | The SDK could be used to end user session by using cidaas internal api |
198
+ | userActionOnEnrollment | The SDK could be used to run predefined action after enrollment |
196
199
 
197
200
  ## Possible Error
198
201
 
@@ -1,5 +1,5 @@
1
- import { OidcManager, OidcSettings, LoginRedirectOptions, LogoutRedirectOptions, PopupSignInOptions, PopupSignOutOptions, SilentSignInOptions, LogoutResponse } from './authentication.model';
2
- export * from './authentication.model';
1
+ import { OidcManager, OidcSettings, LoginRedirectOptions, LogoutRedirectOptions, PopupSignInOptions, PopupSignOutOptions, SilentSignInOptions, LogoutResponse } from './Authentication.model';
2
+ export * from './Authentication.model';
3
3
  export declare class Authentication {
4
4
  webAuthSettings: OidcSettings;
5
5
  userManager: OidcManager;
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Authentication = void 0;
18
- __exportStar(require("./authentication.model"), exports);
18
+ __exportStar(require("./Authentication.model"), exports);
19
19
  class Authentication {
20
20
  constructor(webAuthSettings, userManager) {
21
21
  this.webAuthSettings = webAuthSettings;
@@ -49,7 +49,6 @@ class Authentication {
49
49
  }
50
50
  return this.userManager.signinRedirect(Object.assign({ extraQueryParams: this.webAuthSettings.extraQueryParams, redirect_uri: this.webAuthSettings.redirect_uri }, (options && Object.assign({}, options) || {})));
51
51
  }
52
- ;
53
52
  /**
54
53
  * Once login successful, it will automatically redirects you to the redirect url whatever you mentioned in the options.
55
54
  * To complete the login process, call **loginCallback()**. This will parses the access_token, id_token and whatever in hash in the redirect url.
@@ -92,7 +91,6 @@ class Authentication {
92
91
  logoutCallback(url) {
93
92
  return this.userManager.signoutRedirectCallback(url);
94
93
  }
95
- ;
96
94
  /**
97
95
  * **popupSignIn()** will open the hosted login page in pop up window.
98
96
  * @example
@@ -108,7 +106,6 @@ class Authentication {
108
106
  popupSignIn(options) {
109
107
  return this.userManager.signinPopup(options);
110
108
  }
111
- ;
112
109
  /**
113
110
  * To complete the popup login process, call **popupSignInCallback()** from the popup login window.
114
111
  * Popup window will be closed after doing callback
@@ -122,7 +119,6 @@ class Authentication {
122
119
  popupSignInCallback(url, keepOpen) {
123
120
  return this.userManager.signinPopupCallback(url, keepOpen);
124
121
  }
125
- ;
126
122
  /**
127
123
  * **popupSignOut()** will open the hosted logout page in pop up window.
128
124
  * @example
@@ -139,7 +135,6 @@ class Authentication {
139
135
  popupSignOut(options) {
140
136
  return this.userManager.signoutPopup(options);
141
137
  }
142
- ;
143
138
  /**
144
139
  * calling **popupSignOutCallback()** from the popup window complete popup logout process.
145
140
  * Popup window won't be closed after doing callback
@@ -156,9 +151,9 @@ class Authentication {
156
151
  * @param {boolean} keepOpen true to keep the popup open even after sign out, else false
157
152
  */
158
153
  popupSignOutCallback(url, keepOpen = true) {
154
+ url = url !== null && url !== void 0 ? url : this.webAuthSettings.post_logout_redirect_uri;
159
155
  return this.userManager.signoutPopupCallback(url, keepOpen);
160
156
  }
161
- ;
162
157
  /**
163
158
  * **silentSignIn()** will open the hosted login page in an iframe.
164
159
  * this function could only be called from the same domain. Cross Domain is not supported for security purpose.
@@ -175,7 +170,6 @@ class Authentication {
175
170
  silentSignIn(options) {
176
171
  return this.userManager.signinSilent(Object.assign({ silentRequestTimeoutInSeconds: 60 }, (options && Object.assign({}, options) || {})));
177
172
  }
178
- ;
179
173
  /**
180
174
  * To complete the silent login process, call **silentSignInCallback()** from the iframe. This will complete the login process in iframe.
181
175
  * @example
@@ -188,6 +182,5 @@ class Authentication {
188
182
  silentSignInCallback(url) {
189
183
  return this.userManager.signinSilentCallback(url);
190
184
  }
191
- ;
192
185
  }
193
186
  exports.Authentication = Authentication;
@@ -0,0 +1,37 @@
1
+ export interface LoginPrecheckRequest {
2
+ /** Track id returned from login call */
3
+ track_id: string;
4
+ }
5
+ /** Type of verification to be used to authenticate user */
6
+ export declare enum VerificationType {
7
+ 'PASSWORD' = 0,
8
+ 'TOUCHID' = 1,
9
+ 'FIDO2' = 2,
10
+ 'SECURITY_QUESTION' = 3,
11
+ 'SMS' = 4,
12
+ 'IVR' = 5,
13
+ 'FACE' = 6,
14
+ 'TOTP' = 7,
15
+ 'EMAIL' = 8,
16
+ 'BACKUPCODE' = 9,
17
+ 'PATTERN' = 10,
18
+ 'PUSH' = 11,
19
+ 'VOICE' = 12
20
+ }
21
+ export interface HTTPRequestHeader {
22
+ /** Request id returned from the authorization call */
23
+ requestId: string;
24
+ /** DEPRECATED: Captcha string for captcha check */
25
+ captcha?: string;
26
+ /** Response language, which is configured in cidaas admin ui */
27
+ acceptlanguage?: string;
28
+ /** DEPRECATED: Needed in case bot captcha check is activated */
29
+ bot_captcha_response?: string;
30
+ /** Identifier generated after successful authentication but unfulfilled prechecks */
31
+ trackId?: string;
32
+ }
33
+ /** defines whether the the process will be done via email link or whether the user needs to enter a code to complete the process. */
34
+ export declare enum ProcessingType {
35
+ 'CODE' = 0,
36
+ 'LINK' = 1
37
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessingType = exports.VerificationType = void 0;
4
+ /** Type of verification to be used to authenticate user */
5
+ var VerificationType;
6
+ (function (VerificationType) {
7
+ VerificationType[VerificationType["PASSWORD"] = 0] = "PASSWORD";
8
+ VerificationType[VerificationType["TOUCHID"] = 1] = "TOUCHID";
9
+ VerificationType[VerificationType["FIDO2"] = 2] = "FIDO2";
10
+ VerificationType[VerificationType["SECURITY_QUESTION"] = 3] = "SECURITY_QUESTION";
11
+ VerificationType[VerificationType["SMS"] = 4] = "SMS";
12
+ VerificationType[VerificationType["IVR"] = 5] = "IVR";
13
+ VerificationType[VerificationType["FACE"] = 6] = "FACE";
14
+ VerificationType[VerificationType["TOTP"] = 7] = "TOTP";
15
+ VerificationType[VerificationType["EMAIL"] = 8] = "EMAIL";
16
+ VerificationType[VerificationType["BACKUPCODE"] = 9] = "BACKUPCODE";
17
+ VerificationType[VerificationType["PATTERN"] = 10] = "PATTERN";
18
+ VerificationType[VerificationType["PUSH"] = 11] = "PUSH";
19
+ VerificationType[VerificationType["VOICE"] = 12] = "VOICE";
20
+ })(VerificationType = exports.VerificationType || (exports.VerificationType = {}));
21
+ /** defines whether the the process will be done via email link or whether the user needs to enter a code to complete the process. */
22
+ var ProcessingType;
23
+ (function (ProcessingType) {
24
+ ProcessingType[ProcessingType["CODE"] = 0] = "CODE";
25
+ ProcessingType[ProcessingType["LINK"] = 1] = "LINK";
26
+ })(ProcessingType = exports.ProcessingType || (exports.ProcessingType = {}));
@@ -1,10 +1,10 @@
1
1
  export declare class Helper {
2
2
  /**
3
- * create form
4
- * @param form
5
- * @param options
6
- * @returns
7
- */
3
+ * create form
4
+ * @param form
5
+ * @param options
6
+ * @returns
7
+ */
8
8
  static createForm(url: string, options: any, method?: string): HTMLFormElement;
9
9
  /**
10
10
  * utility function to create and make post request
@@ -15,7 +15,7 @@ export declare class Helper {
15
15
  * @param headers??
16
16
  * @returns
17
17
  */
18
- static createHttpPromise(options: any, serviceurl: string, errorResolver: boolean, method: string, access_token?: string, headers?: any, formPayload?: FormData): Promise<unknown>;
18
+ static createHttpPromise(options: any, serviceurl: string, errorResolver: boolean, method: string, access_token?: string, headers?: any, formPayload?: FormData): Promise<any>;
19
19
  }
20
20
  export declare class CustomException {
21
21
  errorMessage: string;
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CustomException = exports.Helper = void 0;
4
4
  class Helper {
5
5
  /**
6
- * create form
7
- * @param form
8
- * @param options
9
- * @returns
10
- */
6
+ * create form
7
+ * @param form
8
+ * @param options
9
+ * @returns
10
+ */
11
11
  static createForm(url, options, method = 'POST') {
12
- var form = document.createElement('form');
12
+ const form = document.createElement('form');
13
13
  form.action = url;
14
14
  form.method = method;
15
- for (var key in options) {
15
+ for (const key in options) {
16
16
  if (options.hasOwnProperty(key)) {
17
- var hiddenField = document.createElement("input");
17
+ const hiddenField = document.createElement("input");
18
18
  hiddenField.setAttribute("type", "hidden");
19
19
  hiddenField.setAttribute("name", key);
20
20
  hiddenField.setAttribute("value", options[key]);
@@ -35,7 +35,7 @@ class Helper {
35
35
  static createHttpPromise(options, serviceurl, errorResolver, method, access_token, headers, formPayload) {
36
36
  return new Promise((resolve, reject) => {
37
37
  try {
38
- var http = new XMLHttpRequest();
38
+ const http = new XMLHttpRequest();
39
39
  http.onreadystatechange = function () {
40
40
  if (http.readyState == 4) {
41
41
  if (http.responseText) {
@@ -51,7 +51,7 @@ class Helper {
51
51
  http.setRequestHeader("Content-type", "application/json");
52
52
  }
53
53
  if (headers) {
54
- for (var key in headers) {
54
+ for (const key in headers) {
55
55
  if (headers.hasOwnProperty(key)) {
56
56
  http.setRequestHeader(key, headers[key]);
57
57
  }
@@ -0,0 +1,8 @@
1
+ import { TokenClaim, TokenHeader } from "../token-service/TokenService.model";
2
+ export declare class JwtHelper {
3
+ static decodeTokenHeader(token: string): TokenHeader;
4
+ static decodeToken(token: string): TokenClaim;
5
+ static urlBase64Decode(str: string): string;
6
+ static b64DecodeUnicode(str: string): string;
7
+ static b64decode(str: string): string;
8
+ }
@@ -20,11 +20,11 @@ class JwtHelper {
20
20
  if (token === null) {
21
21
  return null;
22
22
  }
23
- let parts = token.split('.');
23
+ const parts = token.split('.');
24
24
  if (parts.length !== 3) {
25
25
  throw new Error('The inspected token doesn\'t appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.');
26
26
  }
27
- let decoded = this.urlBase64Decode(parts[1]);
27
+ const decoded = this.urlBase64Decode(parts[1]);
28
28
  if (!decoded) {
29
29
  throw new Error('Cannot decode the token.');
30
30
  }
@@ -59,7 +59,7 @@ class JwtHelper {
59
59
  }
60
60
  // credits for decoder goes to https://github.com/atk
61
61
  static b64decode(str) {
62
- let chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
62
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
63
63
  let output = '';
64
64
  str = String(str).replace(/=+$/, '');
65
65
  if (str.length % 4 === 1) {
@@ -67,19 +67,19 @@ class JwtHelper {
67
67
  }
68
68
  for (
69
69
  // initialize result and counters
70
- let bc = 0, bs, buffer, idx = 0;
70
+ let bc = 0, bs, bufferAsNumber, bufferAsString, idx = 0;
71
71
  // get next character
72
- (buffer = str.charAt(idx++));
72
+ (bufferAsString = str.charAt(idx++));
73
73
  // character found in table? initialize bit storage and add its ascii value;
74
- ~buffer &&
75
- ((bs = bc % 4 ? bs * 64 + buffer : buffer),
74
+ ~bufferAsNumber &&
75
+ ((bs = bc % 4 ? bs * 64 + bufferAsNumber : bufferAsNumber),
76
76
  // and if not first of each 4 characters,
77
77
  // convert the first 8 bits to one ascii character
78
78
  bc++ % 4)
79
79
  ? (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6))))
80
80
  : 0) {
81
81
  // try to find character in table (0-63, not found => -1)
82
- buffer = chars.indexOf(buffer);
82
+ bufferAsNumber = chars.indexOf(bufferAsString);
83
83
  }
84
84
  return output;
85
85
  }
@@ -0,0 +1,134 @@
1
+ export interface CidaasUser {
2
+ /** Status of User */
3
+ userStatus?: string;
4
+ /** DEPRECATED: use userStatus variable instead */
5
+ user_status?: string;
6
+ /** Reason for user status */
7
+ user_status_reason?: string;
8
+ /** Username of the user */
9
+ username?: string;
10
+ /** Subject (User) identifier */
11
+ sub?: string;
12
+ /** UserId from original provider. The value comes from custom/social provider to be referenced */
13
+ originalProviderUserId?: string[];
14
+ /** Given/first name of the user */
15
+ given_name?: string;
16
+ /** Surname or last name of the user */
17
+ family_name?: string;
18
+ /** Middle name of the user */
19
+ middle_name?: string;
20
+ /** Casual name of the user */
21
+ nickname?: string;
22
+ /** Email of the user in string */
23
+ email?: string;
24
+ /** Described whether user email has been verified */
25
+ email_verified?: boolean;
26
+ /** Mobile number of the user in string format */
27
+ mobile_number?: string;
28
+ /** Mobile number of the user as object */
29
+ mobile_number_obj?: UserMobile;
30
+ /** Described whether user mobile number has been verified */
31
+ mobile_number_verified?: boolean;
32
+ /** Phone number of the user in string format */
33
+ phone_number?: string;
34
+ /** Phone number of the user as object */
35
+ phone_number_obj?: UserMobile;
36
+ /** Described whether user phone number has been verified */
37
+ phone_number_verified?: boolean;
38
+ /** URL of the user's profile page */
39
+ profile?: string;
40
+ /** URL of the user's profile picture */
41
+ picture?: string;
42
+ /** URL of the user's web page or blog */
43
+ website?: string;
44
+ /** User's gender */
45
+ gender?: string;
46
+ /** Represents the user's time zone */
47
+ zoneinfo?: string;
48
+ /** Preferred locale of the user */
49
+ locale?: string;
50
+ /** User's birthdate in the format 'YYYY-MM-DD' */
51
+ birthdate?: Date | string;
52
+ /** Address of the user */
53
+ address?: UserAddress;
54
+ /** Represents custom-specific fields that need to be configured in the system */
55
+ customFields?: any;
56
+ /** Custom fileds for identity */
57
+ identityCustomFields?: any;
58
+ /** Password of a user */
59
+ password?: string;
60
+ /** Password confirm of a user */
61
+ password_echo?: string;
62
+ /** Hash info of the password */
63
+ password_hash_info?: any | null;
64
+ /** Described wheter new password needs to be generated by the next login */
65
+ generate_password?: boolean;
66
+ /** Provider name indicating the origin of the social identity */
67
+ provider?: string;
68
+ /** the identityId identifying the useraccount and identity uniquely */
69
+ identityId?: string;
70
+ /** User Id of provider. The value comes from custom/social provider to be referenced */
71
+ providerUserId?: string;
72
+ /** List of BusinessId of provider. The value comes from custom/social provider to be referenced */
73
+ providerBusinessIds?: string[];
74
+ /** Street Address of a user */
75
+ street_address?: string;
76
+ /** Described whether multi factor authentication is enabled for the user */
77
+ mfa_enabled?: boolean;
78
+ /** List of roles of a user */
79
+ roles?: string[];
80
+ /** List of groups of a user */
81
+ groups?: UserGroupMap[];
82
+ /** DEPRECATED: use groups instead */
83
+ userGroups?: UserGroupMap[];
84
+ /** Identifier generated after successful authentication but unfulfilled prechecks */
85
+ trackId?: string;
86
+ /** User information Json Object in String format */
87
+ rawJSON?: string;
88
+ /** Described whether password reset is needed */
89
+ need_reset_password?: boolean;
90
+ /** required if it's present in data for update. */
91
+ _id?: string;
92
+ }
93
+ export interface UserAddress {
94
+ /** Address in custom format */
95
+ formatted?: string;
96
+ /** Street name and house number part of user address */
97
+ street_address?: string;
98
+ /** City part of user address */
99
+ locality?: string;
100
+ /** State part of user address */
101
+ region?: string;
102
+ /** Postcode part of user address */
103
+ postal_code?: string;
104
+ /** Country part of user address */
105
+ country?: string;
106
+ }
107
+ export interface UserMobile {
108
+ /** Phone number as provided by caller or user */
109
+ given_phone?: string;
110
+ /** Phone number */
111
+ phone?: string;
112
+ /** country where phone number is registered */
113
+ country?: string;
114
+ /** International pre dial code */
115
+ dail_code?: string;
116
+ /** Type of carrier */
117
+ carrier_type?: string;
118
+ /** Name of carrier */
119
+ carrier_name?: string;
120
+ /** National phone number format */
121
+ national_format?: string;
122
+ /** International phone number format e.g. + dial number + phone number without leading 0 but with spaces */
123
+ international_format?: string;
124
+ /** E164 is a compact international format without any spaces */
125
+ E164_format?: string;
126
+ }
127
+ export interface UserGroupMap {
128
+ /** Subject identifier */
129
+ sub: string;
130
+ /** Id of user group */
131
+ groupId: string;
132
+ /** List of user roles inside the user group */
133
+ roles: string[];
134
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,96 @@
1
+ import { AcceptClaimConsentRequest, AcceptConsentRequest, AcceptScopeConsentRequest, GetConsentDetailsRequest, GetConsentVersionDetailsRequest, RevokeClaimConsentRequest } from "./ConsentService.model";
2
+ /**
3
+ * To get consent details , call **getConsentDetails()**.
4
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/858fbeb51c62b-find-consent-info for more details.
5
+ * @example
6
+ * ```js
7
+ * this.cidaas.getConsentDetails({
8
+ * consent_id: 'consent id',
9
+ * consent_version_id: 'consent version id',
10
+ * sub: 'masked sub'
11
+ * })
12
+ * .then(function (response) {
13
+ * // type your code here
14
+ * })
15
+ * .catch(function (ex) {
16
+ * // your failure code here
17
+ * });
18
+ * ```
19
+ */
20
+ export declare function getConsentDetails(options: GetConsentDetailsRequest): Promise<any>;
21
+ /**
22
+ * To accept consent, call **acceptConsent()**.
23
+ * @example
24
+ * ```js
25
+ * this.cidaas.acceptConsent({
26
+ * client_id: 'your client id',
27
+ * consent_id: 'consent id',
28
+ * consent_version: 'consent version id',
29
+ * sub: 'masked sub'
30
+ * }).then((response) => {
31
+ * // the response will give you details of accepted consent.
32
+ * }).catch((err) => {
33
+ * // your failure code here
34
+ * });
35
+ * ```
36
+ */
37
+ export declare function acceptConsent(options: AcceptConsentRequest): Promise<any>;
38
+ /**
39
+ * To get version details of consent, call **getConsentVersionDetails()**.
40
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/7e24ac2113315-get-consent-version-details for more details.
41
+ * @example
42
+ * ```js
43
+ * this.cidaas.getConsentVersionDetails({
44
+ * consentid: 'your consent id',
45
+ * locale: 'browser accept language or custom language',
46
+ * access_token: 'your access token',
47
+ * }).then((response) => {
48
+ * // type your code here
49
+ * }).catch((err) => {
50
+ * // your failure code here
51
+ * });
52
+ * ```
53
+ */
54
+ export declare function getConsentVersionDetails(options: GetConsentVersionDetailsRequest): Promise<any>;
55
+ /**
56
+ * To accept scope consent, call **acceptScopeConsent()**.
57
+ * @example
58
+ * ```js
59
+ * this.cidaas.acceptScopeConsent({
60
+ * client_id: 'your client id',
61
+ * sub: 'masked sub',
62
+ * scopes: [your scope consents]
63
+ * });
64
+ * ```
65
+ */
66
+ export declare function acceptScopeConsent(options: AcceptScopeConsentRequest): Promise<any>;
67
+ /**
68
+ * To accept claim consent, call **acceptClaimConsent()**.
69
+ * @example
70
+ * ```js
71
+ * this.cidaas.acceptClaimConsent({
72
+ * client_id: 'your client id',
73
+ * sub: 'masked sub',
74
+ * accepted_claims: [your claim consents]
75
+ * });
76
+ * ```
77
+ */
78
+ export declare function acceptClaimConsent(options: AcceptClaimConsentRequest): Promise<any>;
79
+ /**
80
+ * To revoke claim consent, call **revokeClaimConsent()**.
81
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/9ae62e98842fe-revoke-user-consent-claim for more details.
82
+ * @example
83
+ * ```js
84
+ * this.cidaas.revokeClaimConsent({
85
+ * access_token: 'your access token',
86
+ * client_id: 'your client id',
87
+ * sub: 'masked sub'
88
+ * revoked_claims: [your claim consents]
89
+ * }).then((response) => {
90
+ * // the response will give you revoked claim consent.
91
+ * }).catch((err) => {
92
+ * // your failure code here
93
+ * });
94
+ * ```
95
+ */
96
+ export declare function revokeClaimConsent(options: RevokeClaimConsentRequest): Promise<any>;