-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart-flashcall.ts
33 lines (27 loc) · 1.04 KB
/
start-flashcall.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Verification } from '@sinch/sdk-core';
import {
getPrintFormat,
getVerificationIdentityFromConfig,
initVerificationService,
printFullResponse,
} from '../../../config';
(async () => {
console.log('*********************************');
console.log('* StartVerification - flashCall *');
console.log('*********************************');
const verificationIdentity = getVerificationIdentityFromConfig();
const requestData = Verification.startVerificationHelper.buildFlashCallRequest(
verificationIdentity,
`test-reference-for-flashCall-verification_${verificationIdentity}`,
20,
);
const verificationService = initVerificationService();
const response = await verificationService.verifications.startFlashCall(requestData);
const printFormat = getPrintFormat(process.argv);
if (printFormat === 'pretty') {
console.log(`Verification ID = ${response.id}`);
console.log(`FlashCall verification specific field: cliFilter = ${response.flashCall?.cliFilter}`);
} else {
printFullResponse(response);
}
})();