-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5df5cb0
commit aefdf24
Showing
33 changed files
with
927 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
examples/simple-examples/src/verification/start/start-data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Verification } from '@sinch/sdk-core'; | ||
import { | ||
getPrintFormat, | ||
getVerificationIdentityFromConfig, | ||
initVerificationService, | ||
printFullResponse, | ||
} from '../../config'; | ||
|
||
(async () => { | ||
console.log('****************************'); | ||
console.log('* StartVerification - data *'); | ||
console.log('****************************'); | ||
|
||
const verificationIdentity = getVerificationIdentityFromConfig(); | ||
|
||
const requestData = Verification.startVerificationHelper.buildDataRequest( | ||
verificationIdentity, | ||
`test-reference-for-seamless-verification_${verificationIdentity}`, | ||
); | ||
|
||
const verificationService = initVerificationService(); | ||
const response = await verificationService.startVerifications.startData(requestData); | ||
|
||
const printFormat = getPrintFormat(process.argv); | ||
|
||
if (printFormat === 'pretty') { | ||
console.log(`Verification ID = ${response.id}`); | ||
console.log(`Data verification specific field: targetUri = ${response.seamless?.targetUri}`); | ||
} else { | ||
printFullResponse(response); | ||
} | ||
})(); |
33 changes: 33 additions & 0 deletions
33
examples/simple-examples/src/verification/start/start-flashcall.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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.startVerifications.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); | ||
} | ||
})(); |
31 changes: 31 additions & 0 deletions
31
examples/simple-examples/src/verification/start/start-phonecall.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Verification } from '@sinch/sdk-core'; | ||
import { | ||
getPrintFormat, | ||
getVerificationIdentityFromConfig, | ||
initVerificationService, | ||
printFullResponse, | ||
} from '../../config'; | ||
|
||
(async () => { | ||
console.log('**********************************'); | ||
console.log('* StartVerification - phoneCall *'); | ||
console.log('**********************************'); | ||
|
||
const verificationIdentity = getVerificationIdentityFromConfig(); | ||
|
||
const requestData = Verification.startVerificationHelper.buildPhoneCallRequest( | ||
verificationIdentity, | ||
`test-reference-for-callout-verification_${verificationIdentity}`, | ||
); | ||
|
||
const verificationService = initVerificationService(); | ||
const response = await verificationService.startVerifications.startPhoneCall(requestData); | ||
|
||
const printFormat = getPrintFormat(process.argv); | ||
|
||
if (printFormat === 'pretty') { | ||
console.log(`Verification ID = ${response.id}`); | ||
} else { | ||
printFullResponse(response); | ||
} | ||
})(); |
36 changes: 36 additions & 0 deletions
36
examples/simple-examples/src/verification/start/start-sms.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Verification } from '@sinch/sdk-core'; | ||
import { | ||
getPrintFormat, | ||
getVerificationIdentityFromConfig, | ||
initVerificationService, | ||
printFullResponse, | ||
} from '../../config'; | ||
|
||
(async () => { | ||
console.log('***************************'); | ||
console.log('* StartVerification - SMS *'); | ||
console.log('***************************'); | ||
|
||
const verificationIdentity = getVerificationIdentityFromConfig(); | ||
|
||
const requestData = Verification.startVerificationHelper.buildSmsRequest( | ||
verificationIdentity, | ||
`test-reference-for-sms-verification_${verificationIdentity}`, | ||
{ | ||
locale: 'sv-SE', | ||
}, | ||
); | ||
|
||
const verificationService = initVerificationService(); | ||
const response = await verificationService.startVerifications.startSms(requestData); | ||
|
||
const printFormat = getPrintFormat(process.argv); | ||
|
||
if (printFormat === 'pretty') { | ||
console.log(`Verification ID = ${response.id}`); | ||
console.log(`SMS verification specific field: template = ${response.sms?.template}`); | ||
} else { | ||
printFullResponse(response); | ||
} | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
default: [ | ||
'tests/e2e/features/**/*.feature', | ||
'--require-module ts-node/register', | ||
'--require tests/rest/v1/**/*.steps.ts', | ||
`--format-options '{"snippetInterface": "synchronous"}'`, | ||
].join(' '), | ||
}; |
Oops, something went wrong.