cidaas-javascript-sdk 3.1.5 → 4.0.1

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,125 +1,224 @@
1
- import { IConfiguredListRequestEntity, IInitVerificationAuthenticationRequestEntity, FidoSetupEntity, IEnrollVerificationSetupRequestEntity, IAuthVerificationAuthenticationRequestEntity, FaceVerificationAuthenticationRequestEntity, AccountVerificationRequestEntity } from "./Entities";
1
+ import { IConfiguredListRequestEntity, IInitVerificationAuthenticationRequestEntity, IEnrollVerificationSetupRequestEntity, IAuthVerificationAuthenticationRequestEntity, AccountVerificationRequestEntity } from "./Entities";
2
2
  export declare namespace VerificationService {
3
3
  /**
4
- * initiate verification
5
- * @param options
6
- * @returns
4
+ * To initiate the account verification, call **initiateAccountVerification()**. This will send verification code email or sms or ivr based on the verificationMedium you mentioned.
5
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/cgans5erj5alg-init-account-verification for more details.
6
+ * @example
7
+ * ```js
8
+ * cidaas.initiateAccountVerification({
9
+ * verificationMedium: 'email',
10
+ * requestId: 'your requestId',
11
+ * processingType: 'CODE',
12
+ * email: 'your email'
13
+ * }).then(function (response) {
14
+ * // the response will give you account verification details.
15
+ * }).catch(function(ex) {
16
+ * // your failure code here
17
+ * });
18
+ * ```
7
19
  */
8
20
  function initiateAccountVerification(options: AccountVerificationRequestEntity): void;
9
21
  /**
10
- * initiate verification and return response
11
- * @param options
12
- * @returns
13
- */
14
- function initiateAccountVerificationAsynFn(options: AccountVerificationRequestEntity): Promise<Response>;
15
- /**
16
- * verify account
17
- * @param options
18
- * @returns
22
+ * To complete the verification, call **verifyAccount()**.
23
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/r8h9mvavvw2e6-verify-account for more details.
24
+ * @example
25
+ * ```js
26
+ * cidaas.verifyAccount({
27
+ * accvid: 'your accvid', // which you will get on initiate account verification response
28
+ * code: 'your code in email or sms or ivr'
29
+ * }).then(function (response) {
30
+ * // the response will give you account verification ID and unique code.
31
+ * }).catch(function(ex) {
32
+ * // your failure code here
33
+ * });
34
+ * ```
19
35
  */
20
36
  function verifyAccount(options: {
21
37
  accvid: string;
22
38
  code: string;
23
39
  }): Promise<unknown>;
24
40
  /**
25
- * get mfa list v2
26
- * @param options
27
- * @returns
28
- */
29
- function getMFAListV2(options: IConfiguredListRequestEntity): Promise<unknown>;
30
- /**
31
- * cancel mfa v2
32
- * @param options
33
- * @returns
34
- */
35
- function cancelMFAV2(options: {
41
+ * To get all configured multi factor authentication, call **getMFAList()**.
42
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/ee688a9c52b63-list-of-configured-verification-methods for more details.
43
+ * @example
44
+ * ```js
45
+ * cidaas.getMFAList({
46
+ * request_id: 'your request id',
47
+ * email: 'your email'
48
+ * }).then(function (response) {
49
+ * // the response will give you list of configured multi factor authentication
50
+ * }).catch(function(ex) {
51
+ * // your failure code here
52
+ * });
53
+ * ```
54
+ */
55
+ function getMFAList(options: IConfiguredListRequestEntity): Promise<unknown>;
56
+ /**
57
+ * to cancel mfa process, call **cancelMFA()**.
58
+ * @example
59
+ * ```js
60
+ * cidaas.cancelMFA({
61
+ * exchange_id: 'exchange id from initiateMFA() response',
62
+ * reason: 'reason of mfa cancelation',
63
+ * type: 'authentication type e.g. email'
64
+ * }).then(function (response) {
65
+ * // your success code here
66
+ * }).catch(function(ex) {
67
+ * // your failure code here
68
+ * });
69
+ * ```
70
+ */
71
+ function cancelMFA(options: {
36
72
  exchange_id: string;
37
73
  reason: string;
38
74
  type: string;
39
75
  }): Promise<unknown>;
40
76
  /**
41
- * @param access_token
42
- * @returns
77
+ * To get list of all verification type configured, call **getAllVerificationList()**. access_token must be passed as function parameter.
78
+ * @example
79
+ * ```js
80
+ * const access_token = "your access token";
81
+ *
82
+ * cidaas.getAllVerificationList(access_token)
83
+ * .then(function (response) {
84
+ * // type your code here
85
+ * })
86
+ * .catch(function (ex) {
87
+ * // your failure code here
88
+ * });
89
+ * ```
43
90
  */
44
91
  function getAllVerificationList(access_token: string): Promise<unknown>;
45
92
  /**
46
- * enrollVerification
47
- * @param options
48
- * @returns
93
+ * To initiate enrollment of new multi factor authentication, call **initiateEnrollment()**.
94
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/f85aef6754714-initiate-physical-verification-setup for more details.
95
+ * @example
96
+ * ```js
97
+ * const access_token = "your access token";
98
+ * const options = {
99
+ * verification_type: 'one of verification_type such as fido2, face, ivr',
100
+ * deviceInfo: {
101
+ * deviceId: '',
102
+ * location: {lat: '', lon: ''}
103
+ * }
104
+ * }
105
+ *
106
+ * cidaas.initiateEnrollment(options, 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 initiateEnrollment(options: {
116
+ verification_type: string;
117
+ deviceInfo?: {
118
+ deviceId: string;
119
+ location: {
120
+ lat: string;
121
+ lon: string;
122
+ };
123
+ };
124
+ }, accessToken: string): Promise<unknown>;
125
+ /**
126
+ * to get the status of MFA enrollment, call **getEnrollmentStatus()**.
127
+ * 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.
128
+ * @example
129
+ * ```js
130
+ * cidaas.getEnrollmentStatus('statusId from initiateEnrollment()', 'your access token')
131
+ * .then(function (response) {
132
+ * // type your code here
133
+ * })
134
+ * .catch(function (ex) {
135
+ * // your failure code here
136
+ * });
137
+ * ```
138
+ */
139
+ function getEnrollmentStatus(status_id: string, accessToken: string): Promise<unknown>;
140
+ /**
141
+ * to finish enrollment process of new multi factor authentication, call **enrollVerification()**.
142
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/branches/master/20ec76e937b27-enroll-physical-verification-setup for more details.
143
+ * @example
144
+ * ```js
145
+ * const fidoPayload = {
146
+ * sub: 'your sub',
147
+ * exchange_id: 'exchange_id from initiateEnrollment()',
148
+ * verification_type: 'fido2',
149
+ * fido2_client_response: {
150
+ * client_response: 'client_response from doing fido process',
151
+ * fidoRequestId: 'fidoRequestId from initiateEnrollment',
152
+ * }
153
+ * }
154
+ * cidaas.enrollVerification(fidoPayload)
155
+ * .then(function (response) {
156
+ * // type your code here
157
+ * })
158
+ * .catch(function (ex) {
159
+ * // your failure code here
160
+ * });
161
+ * ```
49
162
  */
50
163
  function enrollVerification(options: IEnrollVerificationSetupRequestEntity): Promise<unknown>;
51
164
  /**
52
- * @deprecated This function is no longer supported, instead use {this.updateStatus()}
53
- * @param status_id
54
- * @returns
55
- */
56
- function updateSocket(status_id: string): Promise<unknown>;
57
- /**
58
- * update the status of notification
59
- * @param status_id
60
- * @returns
61
- */
62
- function updateStatus(status_id: string): Promise<unknown>;
63
- /**
64
- * setupFidoVerification
65
- * @param options
66
- * @returns
67
- */
68
- function setupFidoVerification(options: FidoSetupEntity): Promise<unknown>;
69
- /**
70
- * checkVerificationTypeConfigured
71
- * @param options
72
- * @returns
165
+ * to see details of configured verification type, call **checkVerificationTypeConfigured()**.
166
+ * @example
167
+ * ```js
168
+ * cidaas.checkVerificationTypeConfigured({
169
+ * request_id: 'your request id',
170
+ * email: 'your email',
171
+ * verification_type: 'email'
172
+ * }).then(function (response) {
173
+ * // type your code here
174
+ * })
175
+ * .catch(function (ex) {
176
+ * // your failure code here
177
+ * });
178
+ * ```
73
179
  */
74
180
  function checkVerificationTypeConfigured(options: IConfiguredListRequestEntity): Promise<unknown>;
75
181
  /**
76
- * initiate mfa v2
77
- * @param options
78
- * @returns
79
- */
80
- function initiateMFAV2(options: IInitVerificationAuthenticationRequestEntity): Promise<unknown>;
81
- /**
82
- * @deprecated
83
- * @param options
84
- * @param verificationType
85
- * @returns
86
- */
87
- function initiateMfaV1(options: any, verificationType: string): Promise<unknown>;
88
- /**
89
- * authenticate mfa v2
90
- * @param options
91
- * @returns
92
- */
93
- function authenticateMFAV2(options: IAuthVerificationAuthenticationRequestEntity): Promise<unknown>;
94
- /**
95
- * authenticateVerification form type (for face)
96
- * @param options
97
- * @returns
98
- */
99
- function authenticateFaceVerification(options: FaceVerificationAuthenticationRequestEntity): Promise<unknown>;
100
- /**
101
- * @deprecated
102
- * setup verification - v1
103
- * @param options
104
- * @param access_token
105
- * @param verificationType
106
- * @returns
107
- */
108
- function setupVerificationV1(options: any, access_token: string, verificationType: string): Promise<unknown>;
109
- /**
110
- * @deprecated
111
- * enroll verification - v1
112
- * @param options
113
- * @param access_token
114
- * @param verificationType
115
- * @returns
116
- */
117
- function enrollVerificationV1(options: any, access_token: string, verificationType: string): Promise<unknown>;
118
- /**
119
- * @deprecated
120
- * authenticate mfa - v1
121
- * @param verificationType
122
- * @returns
123
- */
124
- function authenticateMfaV1(options: any, verificationType: string): Promise<unknown>;
182
+ * to initiate multi factor auhentication, call **initiateMFA()**.
183
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/2a3ea581bb249-initiate-verification for more details.
184
+ * @example
185
+ * ```js
186
+ * const access_token = "your access token";
187
+ * const options = {
188
+ * request_id: 'your request id',
189
+ * usage_type: 'PASSWORDLESS_AUTHENTICATION',
190
+ * type: 'email'
191
+ * email: 'your email'
192
+ * }
193
+ * }
194
+ *
195
+ * cidaas.initiateMFA(options, access_token)
196
+ * .then(function (response) {
197
+ * // type your code here
198
+ * })
199
+ * .catch(function (ex) {
200
+ * // your failure code here
201
+ * });
202
+ * ```
203
+ */
204
+ function initiateMFA(options: IInitVerificationAuthenticationRequestEntity, accessToken?: string): Promise<unknown>;
205
+ /**
206
+ * to authenticate with multi factor auhentication, call **authenticateMFA()**.
207
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/1aa38936252d6-perform-the-authentication-method for more details.
208
+ * @example
209
+ * ```js
210
+ * cidaas.authenticateMFA({
211
+ * type: 'email',
212
+ * client_id: 'your client id',
213
+ * exchange_id: exchange id from initiateMFA(),
214
+ * pass_code: 'code to authenticate'
215
+ * }).then(function (response) {
216
+ * // type your code here
217
+ * })
218
+ * .catch(function (ex) {
219
+ * // your failure code here
220
+ * });
221
+ * ```
222
+ */
223
+ function authenticateMFA(options: IAuthVerificationAuthenticationRequestEntity): Promise<unknown>;
125
224
  }