cidaas-javascript-sdk 4.2.3 → 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 (55) hide show
  1. package/CHANGELOG.md +23 -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} +21 -10
  5. package/dist/authentication/Authentication.model.js +23 -0
  6. package/dist/common/Common.model.d.ts +37 -0
  7. package/dist/common/Common.model.js +26 -0
  8. package/dist/{web-auth → common}/Helper.d.ts +6 -6
  9. package/dist/{web-auth → common}/Helper.js +17 -12
  10. package/dist/common/JwtHelper.d.ts +8 -0
  11. package/dist/{web-auth → common}/JwtHelper.js +13 -9
  12. package/dist/common/User.model.d.ts +134 -0
  13. package/dist/common/User.model.js +2 -0
  14. package/dist/consent-service/ConsentService.d.ts +96 -0
  15. package/dist/consent-service/ConsentService.js +127 -0
  16. package/dist/consent-service/ConsentService.model.d.ts +102 -0
  17. package/dist/consent-service/ConsentService.model.js +2 -0
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +20 -3
  20. package/dist/login-service/LoginService.d.ts +143 -0
  21. package/dist/login-service/LoginService.js +247 -0
  22. package/dist/login-service/LoginService.model.d.ts +138 -0
  23. package/dist/login-service/LoginService.model.js +13 -0
  24. package/dist/token-service/TokenService.d.ts +139 -0
  25. package/dist/token-service/TokenService.js +242 -0
  26. package/dist/token-service/TokenService.model.d.ts +149 -0
  27. package/dist/token-service/TokenService.model.js +43 -0
  28. package/dist/user-service/UserService.d.ts +317 -0
  29. package/dist/user-service/UserService.js +451 -0
  30. package/dist/user-service/UserService.model.d.ts +142 -0
  31. package/dist/user-service/UserService.model.js +10 -0
  32. package/dist/verification-service/VerificationService.d.ts +218 -0
  33. package/dist/verification-service/VerificationService.js +288 -0
  34. package/dist/verification-service/VerificationService.model.d.ts +158 -0
  35. package/dist/verification-service/VerificationService.model.js +2 -0
  36. package/dist/web-auth/WebAuth.d.ts +110 -177
  37. package/dist/web-auth/WebAuth.js +98 -123
  38. package/dist/web-auth/webauth.model.d.ts +50 -0
  39. package/dist/web-auth/webauth.model.js +2 -0
  40. package/package.json +1 -1
  41. package/dist/authentication/authentication.model.js +0 -18
  42. package/dist/web-auth/ConsentService.d.ts +0 -123
  43. package/dist/web-auth/ConsentService.js +0 -133
  44. package/dist/web-auth/Entities.d.ts +0 -516
  45. package/dist/web-auth/Entities.js +0 -59
  46. package/dist/web-auth/JwtHelper.d.ts +0 -7
  47. package/dist/web-auth/LoginService.d.ts +0 -165
  48. package/dist/web-auth/LoginService.js +0 -243
  49. package/dist/web-auth/TokenService.d.ts +0 -143
  50. package/dist/web-auth/TokenService.js +0 -246
  51. package/dist/web-auth/UserService.d.ts +0 -345
  52. package/dist/web-auth/UserService.js +0 -468
  53. package/dist/web-auth/VerificationService.d.ts +0 -224
  54. package/dist/web-auth/VerificationService.js +0 -275
  55. /package/dist/authentication/{authentication.model.d.ts → Authentication.model.d.ts} +0 -0
@@ -1,246 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Helper, CustomException } from "./Helper";
11
- import { JwtHelper } from "./JwtHelper";
12
- export var TokenService;
13
- (function (TokenService) {
14
- /**
15
- * To get a new token with the grant type refresh_token, call **renewToken()**.
16
- * The refresh token to create a new token. The refresh token is received while creating an access token using the token endpoint and later can be used to fetch a new token without using credentials
17
- * @example
18
- * ```js
19
- * const options = {
20
- * refresh_token: "your refresh token",
21
- * }
22
- *
23
- * cidaas.renewToken(options)
24
- * .then(function (response) {
25
- * // type your code here
26
- * })
27
- * .catch(function (ex) {
28
- * // your failure code here
29
- * });
30
- * ```
31
- */
32
- function renewToken(options) {
33
- if (!options.refresh_token) {
34
- throw new CustomException("refresh_token cannot be empty", 417);
35
- }
36
- options.client_id = window.webAuthSettings.client_id;
37
- options.grant_type = 'refresh_token';
38
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/token";
39
- return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
40
- }
41
- TokenService.renewToken = renewToken;
42
- ;
43
- /**
44
- * To get a new token with the grant type authorization_code, call **getAccessToken()** with code to create a new token.
45
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4ff850f48629a-generate-token for more details.
46
- * @example
47
- * ```js
48
- * const options = {
49
- * code: "your code to be exchanged with access token",
50
- * }
51
- *
52
- * cidaas.getAccessToken(options)
53
- * .then(function (response) {
54
- * // type your code here
55
- * })
56
- * .catch(function (ex) {
57
- * // your failure code here
58
- * });
59
- * ```
60
- */
61
- function getAccessToken(options) {
62
- var _a;
63
- return __awaiter(this, void 0, void 0, function* () {
64
- if (!options.code) {
65
- throw new CustomException("code cannot be empty", 417);
66
- }
67
- options.client_id = window.webAuthSettings.client_id;
68
- options.redirect_uri = window.webAuthSettings.redirect_uri;
69
- options.grant_type = "authorization_code";
70
- if (!window.webAuthSettings.disablePKCE) {
71
- var signInRequest = yield window.usermanager.getClient().createSigninRequest(window.webAuthSettings);
72
- options.code_verifier = (_a = signInRequest.state) === null || _a === void 0 ? void 0 : _a.code_verifier;
73
- }
74
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/token";
75
- return Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
76
- });
77
- }
78
- TokenService.getAccessToken = getAccessToken;
79
- ;
80
- /**
81
- * To validate an access token, call **validateAccessToken()**.
82
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/26ff31e2937f1-introspect-with-bearer-token for more details.
83
- * @example
84
- * ```js
85
- * const options = {
86
- * token: "your access token",
87
- * token_type_hint: "accepted token type hints are access_token, id_token, refresh_token, sso",
88
- * }
89
- *
90
- * cidaas.validateAccessToken(options)
91
- * .then(function (response) {
92
- * // type your code here
93
- * })
94
- * .catch(function (ex) {
95
- * // your failure code here
96
- * });
97
- * ```
98
- */
99
- function validateAccessToken(options) {
100
- if (!options.token || !options.token_type_hint) {
101
- throw new CustomException("token or token_type_hint cannot be empty", 417);
102
- }
103
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/introspect";
104
- return Helper.createHttpPromise(options, _serviceURL, false, "POST", options.token);
105
- }
106
- TokenService.validateAccessToken = validateAccessToken;
107
- ;
108
- /**
109
- * To get precheck result after login, call **loginPrecheck()**. If there is missing information, user will be redirected to either accepting consent, changing password, continuing MFA process, or do progressive registration
110
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.
111
- * @example
112
- * ```js
113
- * const options = {
114
- * trackId: "your track id from login",
115
- * locale: "your preferred locale",
116
- * }
117
- *
118
- * cidaas.loginPrecheck(options)
119
- * .then(function (response) {
120
- * // type your code here
121
- * })
122
- * .catch(function (ex) {
123
- * // your failure code here
124
- * });
125
- * ```
126
- */
127
- function loginPrecheck(options) {
128
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + options.track_id + "?acceptLanguage=" + options.locale;
129
- return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
130
- }
131
- TokenService.loginPrecheck = loginPrecheck;
132
- ;
133
- /**
134
- * To get the missing fields after login, call **getMissingFields()**.
135
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.
136
- * @example
137
- * ```js
138
- * const trackId = "your track id from login";
139
- * cidaas.getMissingFields(trackId)
140
- * .then(function (response) {
141
- * // type your code here
142
- * })
143
- * .catch(function (ex) {
144
- * // your failure code here
145
- * });
146
- * ```
147
- */
148
- function getMissingFields(trackId) {
149
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + trackId;
150
- return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
151
- }
152
- TokenService.getMissingFields = getMissingFields;
153
- ;
154
- /**
155
- * To initiate device code, call **initiateDeviceCode()**.
156
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/b6d284f55be5e-authorization-request for more details.
157
- * @example
158
- * ```js
159
- * const clientId = "your client id";
160
- * cidaas.initiateDeviceCode(clientId)
161
- * .then(function (response) {
162
- * // type your code here
163
- * })
164
- * .catch(function (ex) {
165
- * // your failure code here
166
- * });
167
- * ```
168
- */
169
- function initiateDeviceCode(clientId) {
170
- const clientid = clientId !== null && clientId !== void 0 ? clientId : window.webAuthSettings.client_id;
171
- const _serviceURL = `${window.webAuthSettings.authority}/authz-srv/device/authz?client_id=${clientid}`;
172
- return Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
173
- }
174
- TokenService.initiateDeviceCode = initiateDeviceCode;
175
- /**
176
- * To verify device code, call **deviceCodeVerify()**.
177
- * @example
178
- * ```js
179
- * const code = "your code which has been send after initiateDeviceCode()";
180
- * cidaas.deviceCodeVerify(code)
181
- * .then(function (response) {
182
- * // type your code here
183
- * })
184
- * .catch(function (ex) {
185
- * // your failure code here
186
- * });
187
- * ```
188
- */
189
- function deviceCodeVerify(code) {
190
- var params = `user_code=${encodeURI(code)}`;
191
- var url = `${window.webAuthSettings.authority}/token-srv/device/verify?${params}`;
192
- try {
193
- const options = {
194
- user_code: encodeURI(code)
195
- };
196
- let form = Helper.createForm(url, options, 'GET');
197
- document.body.appendChild(form);
198
- form.submit();
199
- }
200
- catch (ex) {
201
- throw new Error(ex);
202
- }
203
- }
204
- TokenService.deviceCodeVerify = deviceCodeVerify;
205
- /**
206
- * To check access token without having to call cidaas api, call **offlineTokenCheck()**. THe function will return true if the token is valid & false if the token is invalid.
207
- * @example
208
- * ```js
209
- * cidaas.offlineTokenCheck('your access token');
210
- * ```
211
- */
212
- function offlineTokenCheck(accessToken) {
213
- var _a, _b;
214
- let result = {
215
- isExpiryDateValid: false,
216
- isScopesValid: false,
217
- isIssuerValid: false,
218
- };
219
- const accessTokenHeaderAsJson = JwtHelper.decodeTokenHeader(accessToken);
220
- const accessTokenAsJson = JwtHelper.decodeToken(accessToken);
221
- if (!accessTokenAsJson || !accessTokenHeaderAsJson) {
222
- return result;
223
- }
224
- else {
225
- if (accessTokenAsJson.exp) {
226
- const expirationDate = new Date(0);
227
- expirationDate.setUTCSeconds(accessTokenAsJson.exp);
228
- result.isExpiryDateValid = expirationDate.valueOf() > new Date().valueOf();
229
- }
230
- const accessTokenScopes = accessTokenAsJson.scopes;
231
- const webAuthSettingScopes = (_b = (_a = window.webAuthSettings) === null || _a === void 0 ? void 0 : _a.scope) === null || _b === void 0 ? void 0 : _b.split(' ');
232
- if ((accessTokenScopes === null || accessTokenScopes === void 0 ? void 0 : accessTokenScopes.length) === (webAuthSettingScopes === null || webAuthSettingScopes === void 0 ? void 0 : webAuthSettingScopes.length)) {
233
- webAuthSettingScopes.forEach(webAuthSettingScope => {
234
- const i = accessTokenScopes.indexOf(webAuthSettingScope);
235
- if (i > -1) {
236
- accessTokenScopes.splice(i, 1);
237
- }
238
- });
239
- result.isScopesValid = accessTokenScopes.length === 0;
240
- }
241
- result.isIssuerValid = accessTokenAsJson.iss === window.webAuthSettings.authority;
242
- }
243
- return result;
244
- }
245
- TokenService.offlineTokenCheck = offlineTokenCheck;
246
- })(TokenService || (TokenService = {}));
@@ -1,345 +0,0 @@
1
- import { UserEntity, ResetPasswordEntity, FindUserEntity, IUserLinkEntity, ChangePasswordEntity, ValidateResetPasswordEntity, AcceptResetPasswordEntity } from "./Entities";
2
- export declare namespace UserService {
3
- /**
4
- * To get the user profile information by using cidaas internal api, call **getUserProfile()**.
5
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2zfvjx3vtq6g6-get-user-info for more details.
6
- * @example
7
- * ```js
8
- * const options = {
9
- * access_token: 'your access token'
10
- * }
11
- * cidaas.getUserProfile(options)
12
- * .then(function () {
13
- * // the response will give you user profile information.
14
- * }).catch(function (ex) {
15
- * // your failure code here
16
- * });
17
- * ```
18
- */
19
- function getUserProfile(options: {
20
- access_token: string;
21
- }): Promise<unknown>;
22
- /**
23
- * To register user, call **register()**. This method will create a new user.
24
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/427632e587203-register-a-new-user for more details.
25
- * Note: Only requestId in the headers is required.
26
- * @example
27
- * ```js
28
- * const headers = {
29
- * requestId: 'your_received_requestId',
30
- * captcha: 'captcha',
31
- * acceptlanguage: 'acceptlanguage',
32
- * bot_captcha_response: 'bot_captcha_response'
33
- * };
34
- *
35
- * cidaas.register({
36
- * email: 'xxx123@xxx.com',
37
- * given_name: 'xxxxx',
38
- * family_name: 'yyyyy',
39
- * password: '123456',
40
- * password_echo: '123456',
41
- * provider: 'your provider', // FACEBOOK, GOOGLE, SELF
42
- * acceptlanguage: 'your locale' // optional example: de-de, en-US
43
- * }, headers).then(function (response) {
44
- * // the response will give you client registration details.
45
- * }).catch(function(ex) {
46
- * // your failure code here
47
- * });
48
- *```
49
- */
50
- function register(options: UserEntity, headers: {
51
- requestId: string;
52
- captcha?: string;
53
- acceptlanguage?: string;
54
- bot_captcha_response?: string;
55
- trackId?: string;
56
- }): Promise<unknown>;
57
- /**
58
- * to get information about invitation details, call **getInviteUserDetails()**. This API allows to retrieve invitation details and prefill the registration form.
59
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/0b5efa5a2db5d-prefill-the-user-invitation for more details.
60
- * Minimum cidaas version to use latest api is v3.100
61
- * @example
62
- * ```js
63
- * const options = {
64
- * invite_id: 'id of user invitation'
65
- * callLatestAPI: 'true' // call latest api if parameter is given. By default, the older api will be called
66
- * }
67
- * cidaas.getInviteUserDetails(options)
68
- * .then(function () {
69
- * // the response will give you information about the invitation.
70
- * }).catch(function (ex) {
71
- * // your failure code here
72
- * });
73
- * ```
74
- */
75
- function getInviteUserDetails(options: {
76
- invite_id: string;
77
- callLatestAPI?: boolean;
78
- }): Promise<unknown>;
79
- /**
80
- * Once registration successful, verify the account based on the flow. To get the details, call **getCommunicationStatus()**.
81
- * @example
82
- * ```js
83
- * cidaas.getCommunicationStatus({
84
- * sub: 'your sub', // which you will get on the registration response
85
- * }).then(function (response) {
86
- * // the response will give you account details once its verified.
87
- * }).catch(function(ex) {
88
- * // your failure code here
89
- * });
90
- * ```
91
- */
92
- function getCommunicationStatus(options: {
93
- sub: string;
94
- }, headers?: {
95
- requestId: string;
96
- }): Promise<unknown>;
97
- /**
98
- * To initiate the password resetting, call **initiateResetPassword()**. This will send verification code to your email or mobile based on the resetMedium you mentioned.
99
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/6b29bac6002f4-initiate-password-reset for more details.
100
- * @example
101
- * ```js
102
- * cidaas.initiateResetPassword({
103
- * email: 'xxxxxx@xxx.com',
104
- * processingType: 'CODE',
105
- * requestId: 'your requestId',
106
- * resetMedium: 'email'
107
- * }).then(function (response) {
108
- * // the response will give you password reset details.
109
- * }).catch(function(ex) {
110
- * // your failure code here
111
- * });
112
- * ```
113
- */
114
- function initiateResetPassword(options: ResetPasswordEntity): Promise<unknown>;
115
- /**
116
- * To handle the reset password by entering the verification code you received, call **handleResetPassword()**. This will check if your verification code was valid or not, and allows you to proceed to the next step.
117
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/3t8ztokeb7cfz-handle-reset-password for more details.
118
- * @example
119
- * ```js
120
- * const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, the response information will be given as query parameter in redirect url.';
121
- * cidaas.handleResetPassword({
122
- * code: 'your code in email or sms or ivr',
123
- * resetRequestId: 'your resetRequestId' // which you will get on initiate reset password response
124
- * }, handleResponseAsJson).then(function (response) {
125
- * // the response will give you valid verification code.
126
- * }).catch(function(ex) {
127
- * // your failure code here
128
- * });
129
- * ```
130
- */
131
- function handleResetPassword(options: ValidateResetPasswordEntity, handleResponseAsJson?: boolean): Promise<unknown>;
132
- /**
133
- * To finish reseting the password, call **resetPassword()**. This will allow you to change your password.
134
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/qa9ny0gkzlf6y-accept-reset-password for more details.
135
- * @example
136
- * ```js
137
- * const handleResponseAsJson = 'true if the response need to be handled the old way (as json). In the current handling, user will be redirected to success page after successful reset password.';
138
- * cidaas.resetPassword({
139
- * password: '123456',
140
- * confirmPassword: '123456',
141
- * exchangeId: 'your exchangeId', // which you will get on handle reset password response
142
- * resetRequestId: 'your resetRequestId' // which you will get on handle reset password response
143
- * }).then(function (response) {
144
- * // the response will give you reset password details.
145
- * }).catch(function(ex) {
146
- * // your failure code here
147
- * });
148
- * ```
149
- */
150
- function resetPassword(options: AcceptResetPasswordEntity, handleResponseAsJson?: boolean): Promise<unknown>;
151
- /**
152
- * To get the list of existing users in deduplication, call **getDeduplicationDetails()**.
153
- * @example
154
- * ```js
155
- * this.cidaas.getDeduplicationDetails({
156
- * track_id: 'your track id'
157
- * }).then((response) => {
158
- * // the response will give you deduplication details of users.
159
- * }).catch((err) => {
160
- * // your failure code here
161
- * });
162
- * ```
163
- */
164
- function getDeduplicationDetails(options: {
165
- trackId: string;
166
- }): Promise<unknown>;
167
- /**
168
- * To use the existing users in deduplication, you need to call **deduplicationLogin()**.
169
- * @example
170
- * ```js
171
- * this.cidaas.deduplicationLogin({
172
- * sub: 'your sub',
173
- * requestId: 'request id from deduplication initialisation after register',
174
- * trackId: 'track id from deduplication initialisation after register'
175
- * })
176
- * ```
177
- */
178
- function deduplicationLogin(options: {
179
- trackId: string;
180
- requestId: string;
181
- sub: string;
182
- }): void;
183
- /**
184
- * To register new user in deduplication, call **registerDeduplication()**.
185
- * @example
186
- * ```js
187
- * this.cidaas.registerDeduplication({
188
- * track_id: 'track id from deduplication initialisation after register',
189
- * }).then((response) => {
190
- * // the response will give you new registered deduplication user.
191
- * }).catch((err) => {
192
- * // your failure code here
193
- * });
194
- * ```
195
- */
196
- function registerDeduplication(options: {
197
- trackId: string;
198
- }): Promise<unknown>;
199
- /**
200
- * To change the password, call **changePassword()**. This will allow you to change your password.
201
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/8221883241464-change-password for more details.
202
- * @example
203
- * ```js
204
- * cidaas.changePassword({
205
- * old_password: 'your old password',
206
- * new_password: 'your new password',
207
- * confirm_password: 'your new password',
208
- * sub: 'your sub',
209
- * }, 'your access token')
210
- * .then(function () {
211
- * // your success code
212
- * }).catch(function (ex) {
213
- * // your failure code
214
- * });
215
- * ```
216
- */
217
- function changePassword(options: ChangePasswordEntity, access_token: string): Promise<unknown>;
218
- /**
219
- * To update the user profile information, call **updateProfile()**.
220
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/i3uqnxcpxr19r-update-user-profile for more details.
221
- * @example
222
- * ```js
223
- * cidaas.updateProfile({
224
- * family_name: 'Doe',
225
- * given_name: 'John',
226
- * provider: 'self',
227
- * acceptlanguage: 'your locale' // optional example: de-de, en-US
228
- * }, 'your access token', 'your sub').then(function () {
229
- * // the response will give you updated user profile info.
230
- * }).catch(function (ex) {
231
- * // your failure code here
232
- * });
233
- * ```
234
- */
235
- function updateProfile(options: UserEntity, access_token: string, sub: string): Promise<unknown>;
236
- /**
237
- * To initiate account linking, call **initiateLinkAccount()**.
238
- * @example
239
- * ```js
240
- * const options = {
241
- * master_sub: 'sub of the user who initiates the user link',
242
- * user_name_to_link: 'username of the user which should get linked',
243
- * user_name_type: 'type of user name to link. E.g. email'
244
- * }
245
- * const access_token = 'your access token'
246
- * this.cidaas.initiateLinkAccount(options, access_token).then((response) => {
247
- * // your success code
248
- * }).catch((err) => {
249
- * // your failure code here
250
- * });
251
- * ```
252
- */
253
- function initiateLinkAccount(options: IUserLinkEntity, access_token: string): Promise<unknown>;
254
- /**
255
- * To complete account linking, call **completeLinkAccount()**.
256
- * @example
257
- * ```js
258
- * const options = {
259
- * code: 'code which is sent to account to be linked',
260
- * link_request_id: 'comes from initiateLinkAccount'
261
- * }
262
- * const access_token = 'your access token'
263
- * this.cidaas.completeLinkAccount(options, access_token).then((response) => {
264
- * // your success code
265
- * }).catch((err) => {
266
- * // your failure code here
267
- * });
268
- * ```
269
- */
270
- function completeLinkAccount(options: {
271
- code?: string;
272
- link_request_id?: string;
273
- }, access_token: string): Promise<unknown>;
274
- /**
275
- * To get all the linked accounts, call **getLinkedUsers()**.
276
- * @example
277
- * ```js
278
- * const acccess_token= 'your access token';
279
- * const sub = 'your sub';
280
- *
281
- * cidaas.getLinkedUsers(access_token, sub)
282
- * .then(function (response) {
283
- * // type your code here
284
- * })
285
- * .catch(function (ex) {
286
- * // your failure code here
287
- * });
288
- * ```
289
- */
290
- function getLinkedUsers(access_token: string, sub: string): Promise<unknown>;
291
- /**
292
- * To unlink an account for a user, call **unlinkAccount()**.
293
- * @example
294
- * ```js
295
- * const acccess_token= "your access token";
296
- * const identityId = "comes from getLinkedUsers";
297
- *
298
- * cidaas.unlinkAccount(access_token, identityId)
299
- * .then(function (response) {
300
- * // type your code here
301
- * })
302
- * .catch(function (ex) {
303
- * // your failure code here
304
- * });
305
- * ```
306
- */
307
- function unlinkAccount(access_token: string, identityId: string): Promise<unknown>;
308
- /**
309
- * To delete the user account directly in the application, call **deleteUserAccount()**.
310
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/x133xdifl1sx9-schedule-user-deletion for more details.
311
- * @example
312
- * ```js
313
- * options = {
314
- * access_token: "your access token",
315
- * sub: "your sub"
316
- * }
317
- *
318
- * cidaas.deleteUserAccount(options).then(function (response) {
319
- * // your success code
320
- * }).catch(function(ex) {
321
- * // your failure code here
322
- * });
323
- * ```
324
- */
325
- function deleteUserAccount(options: {
326
- access_token: string;
327
- sub: string;
328
- }): Promise<unknown>;
329
- /**
330
- * To check if user exists, call **userCheckExists()**.
331
- * @example
332
- * options = {
333
- * requestId: "your request id",
334
- * email: "your email"
335
- * }
336
- *
337
- * cidaas.userCheckExists(options).then(function (response) {
338
- * // your success code
339
- * }).catch(function(ex) {
340
- * // your failure code here
341
- * });
342
- * ```
343
- */
344
- function userCheckExists(options: FindUserEntity): Promise<unknown>;
345
- }