@sinch/verification 1.2.1 → 1.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.
- package/dist/models/v1/mod-callbacks/index.d.ts +1 -0
- package/dist/models/v1/mod-callbacks/index.js +2 -0
- package/dist/models/v1/mod-callbacks/index.js.map +1 -1
- package/dist/models/v1/mod-callbacks/sms-request-event-response/sms-request-event-response.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/verification-callback-event.d.ts +2 -1
- package/dist/models/v1/mod-callbacks/verification-request-event/index.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/verification-request-event/verification-request-event.d.ts +3 -1
- package/dist/models/v1/mod-callbacks/verification-result-event/index.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/verification-result-event/verification-result-event.d.ts +2 -2
- package/dist/models/v1/mod-callbacks/verification-sms-delivered-event/index.d.ts +1 -0
- package/dist/models/v1/mod-callbacks/verification-sms-delivered-event/index.js +3 -0
- package/dist/models/v1/mod-callbacks/verification-sms-delivered-event/index.js.map +1 -0
- package/dist/models/v1/mod-callbacks/verification-sms-delivered-event/verification-sms-delivered-event.d.ts +17 -0
- package/dist/models/v1/mod-callbacks/verification-sms-delivered-event/verification-sms-delivered-event.js +3 -0
- package/dist/models/v1/mod-callbacks/verification-sms-delivered-event/verification-sms-delivered-event.js.map +1 -0
- package/dist/models/v1/start-verification-request/start-verification-request.d.ts +1 -1
- package/dist/models/v1/verification-report-request/verification-report-request.d.ts +1 -1
- package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +1 -1
- package/dist/rest/v1/callbacks/callbacks-webhook.js +5 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
- package/package.json +2 -2
|
@@ -25,4 +25,6 @@ __exportStar(require("./verification-request-event-response"), exports);
|
|
|
25
25
|
// 'Verification Result Event' received from Sinch server (no response data needed)
|
|
26
26
|
__exportStar(require("./verification-result-event"), exports);
|
|
27
27
|
__exportStar(require("./verification-result-event-response"), exports);
|
|
28
|
+
// 'Verification Sms Delivered Event' received from Sinch server
|
|
29
|
+
__exportStar(require("./verification-sms-delivered-event"), exports);
|
|
28
30
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/mod-callbacks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,0DAA0D;AAC1D,+DAA6C;AAC7C,sEAAsE;AACtE,qEAAmD;AACnD,qEAAmD;AACnD,+DAA6C;AAC7C,wEAAsD;AACtD,mFAAmF;AACnF,8DAA4C;AAC5C,uEAAqD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/mod-callbacks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gEAA8C;AAC9C,0DAA0D;AAC1D,+DAA6C;AAC7C,sEAAsE;AACtE,qEAAmD;AACnD,qEAAmD;AACnD,+DAA6C;AAC7C,wEAAsD;AACtD,mFAAmF;AACnF,8DAA4C;AAC5C,uEAAqD;AACrD,gEAAgE;AAChE,qEAAmD"}
|
package/dist/models/v1/mod-callbacks/sms-request-event-response/sms-request-event-response.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface SmsRequestEventResponse {
|
|
|
6
6
|
sms?: SmsProperties;
|
|
7
7
|
}
|
|
8
8
|
export interface SmsProperties {
|
|
9
|
-
/** The SMS
|
|
9
|
+
/** The SMS OTP that should be used. By default, the Sinch dashboard will automatically generate OTP codes for SMS verification. If you want to set your own OTP, you can specify it in the response to the Verification Request Event. */
|
|
10
10
|
code?: string;
|
|
11
11
|
/** List of strings */
|
|
12
12
|
acceptLanguage?: string[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { VerificationRequestEvent } from './verification-request-event';
|
|
2
2
|
import { VerificationResultEvent } from './verification-result-event';
|
|
3
|
-
|
|
3
|
+
import { VerificationSmsDeliveredEvent } from './verification-sms-delivered-event';
|
|
4
|
+
export type VerificationCallbackEvent = VerificationRequestEvent | VerificationResultEvent | VerificationSmsDeliveredEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { VerificationRequestEvent, MethodEnum } from './verification-request-event';
|
|
1
|
+
export type { VerificationRequestEvent, VerificationRequestMethod, MethodEnum } from './verification-request-event';
|
package/dist/models/v1/mod-callbacks/verification-request-event/verification-request-event.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface VerificationRequestEvent {
|
|
|
6
6
|
/** The type of the event. */
|
|
7
7
|
event: 'VerificationRequestEvent';
|
|
8
8
|
/** The verification method. */
|
|
9
|
-
method:
|
|
9
|
+
method: VerificationRequestMethod;
|
|
10
10
|
/** @see Identity */
|
|
11
11
|
identity: Identity;
|
|
12
12
|
/** The amount of money and currency of the verification request. */
|
|
@@ -20,4 +20,6 @@ export interface VerificationRequestEvent {
|
|
|
20
20
|
/** List of strings */
|
|
21
21
|
acceptLanguage?: string[];
|
|
22
22
|
}
|
|
23
|
+
/** @deprecated Use VerificationRequestMethod instead */
|
|
23
24
|
export type MethodEnum = 'sms' | 'flashcall' | 'callout';
|
|
25
|
+
export type VerificationRequestMethod = 'sms' | 'flashcall' | 'callout';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { VerificationResultEvent } from './verification-result-event';
|
|
1
|
+
export type { VerificationResultEvent, VerificationResultMethod } from './verification-result-event';
|
package/dist/models/v1/mod-callbacks/verification-result-event/verification-result-event.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface VerificationResultEvent {
|
|
|
6
6
|
/** The type of the event. */
|
|
7
7
|
event: 'VerificationResultEvent';
|
|
8
8
|
/** The verification method. */
|
|
9
|
-
method:
|
|
9
|
+
method: VerificationResultMethod;
|
|
10
10
|
/** @see Identity */
|
|
11
11
|
identity: Identity;
|
|
12
12
|
/** The status of the verification request. */
|
|
@@ -20,4 +20,4 @@ export interface VerificationResultEvent {
|
|
|
20
20
|
/** A custom string that can be provided during a verification request. */
|
|
21
21
|
custom?: string;
|
|
22
22
|
}
|
|
23
|
-
export type
|
|
23
|
+
export type VerificationResultMethod = 'sms' | 'flashcall' | 'callout' | 'seamless';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { VerificationSmsDeliveredEvent } from './verification-sms-delivered-event';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/models/v1/mod-callbacks/verification-sms-delivered-event/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Identity } from '../../identity';
|
|
2
|
+
export interface VerificationSmsDeliveredEvent {
|
|
3
|
+
/** The ID of the verification request. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** The type of the event. */
|
|
6
|
+
event: 'VerificationSmsDeliveredEvent';
|
|
7
|
+
/** The verification method. */
|
|
8
|
+
method: 'sms' | string;
|
|
9
|
+
/** @see Identity */
|
|
10
|
+
identity: Identity;
|
|
11
|
+
/** The result of the SMS delivery. Possible values can be extended in the future. */
|
|
12
|
+
smsResult: 'Successful' | 'Failed' | string;
|
|
13
|
+
/** Used to pass your own reference in the request for tracking purposes. */
|
|
14
|
+
reference?: string;
|
|
15
|
+
/** Can be used to pass custom data in the request. */
|
|
16
|
+
custom?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification-sms-delivered-event.js","sourceRoot":"","sources":["../../../../../src/models/v1/mod-callbacks/verification-sms-delivered-event/verification-sms-delivered-event.ts"],"names":[],"mappings":""}
|
|
@@ -47,7 +47,7 @@ export interface SmsOptions {
|
|
|
47
47
|
}
|
|
48
48
|
export type CodeType = 'Numeric' | 'Alpha' | 'Alphanumeric';
|
|
49
49
|
/**
|
|
50
|
-
* An optional object for
|
|
50
|
+
* An optional object for Flash Call Verification, considered only when the verification request originates from your backend (not an SDK client) via an [Application signed request](https://developers.sinch.com/docs/voice/api-reference/authentication/signed-request).
|
|
51
51
|
*/
|
|
52
52
|
export interface FlashCallOptions {
|
|
53
53
|
/** The dial timeout in seconds. */
|
|
@@ -13,7 +13,7 @@ export interface FlashCallVerificationReportRequest {
|
|
|
13
13
|
flashCall: FlashCallContent;
|
|
14
14
|
}
|
|
15
15
|
interface FlashCallContent {
|
|
16
|
-
/** The caller ID of the
|
|
16
|
+
/** The caller ID of the flash call. Caller ID in flash call verification refers to the phone number from which the call was made to the user's device. The verification system uses this incoming number as One Time Password (OTP) */
|
|
17
17
|
cli: string;
|
|
18
18
|
}
|
|
19
19
|
export interface PhoneCallVerificationReportRequest {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VerificationCallbackEvent, VerificationRequestEvent, VerificationResultEvent } from '../../../models';
|
|
2
2
|
import { CallbackProcessor, SinchClientParameters } from '@sinch/sdk-client';
|
|
3
3
|
import { IncomingHttpHeaders } from 'http';
|
|
4
|
-
/** @deprecated Use Verification.
|
|
4
|
+
/** @deprecated Use Verification.VerificationCallbackEvent instead */
|
|
5
5
|
export type VerificationCallback = VerificationRequestEvent | VerificationResultEvent;
|
|
6
6
|
export declare class VerificationCallbackWebhooks implements CallbackProcessor<VerificationCallbackEvent> {
|
|
7
7
|
private readonly sinchClientParameters;
|
|
@@ -27,12 +27,17 @@ class VerificationCallbackWebhooks {
|
|
|
27
27
|
* @return {VerificationCallbackEvent} - The parsed verification event object.
|
|
28
28
|
*/
|
|
29
29
|
parseEvent(eventBody) {
|
|
30
|
+
if (typeof eventBody === 'string') {
|
|
31
|
+
eventBody = JSON.parse(eventBody);
|
|
32
|
+
}
|
|
30
33
|
if (eventBody.event) {
|
|
31
34
|
switch (eventBody.event) {
|
|
32
35
|
case 'VerificationRequestEvent':
|
|
33
36
|
return eventBody;
|
|
34
37
|
case 'VerificationResultEvent':
|
|
35
38
|
return eventBody;
|
|
39
|
+
case 'VerificationSmsDeliveredEvent':
|
|
40
|
+
return eventBody;
|
|
36
41
|
default:
|
|
37
42
|
throw new Error(`Unknown Verification event type: ${eventBody.event}`);
|
|
38
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;AAMA,kDAA2G;AAM3G,MAAa,4BAA4B;IAIvC,YAAY,qBAA4C;QACtD,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;IACrD,CAAC;IAED;;;;;;;OAOG;IACI,4BAA4B,CACjC,OAA4B,EAC5B,IAAS,EACT,IAAY,EACZ,MAAc;QAEd,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,CAAC;YAChG,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QACD,OAAO,IAAA,yCAA4B,EACjC,IAAI,CAAC,qBAAqB,CAAC,cAAc,EACzC,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,EAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,SAAc;QAC9B,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YACpB,QAAQ,SAAS,CAAC,KAAK,EAAE,CAAC;gBAC1B,KAAK,0BAA0B;oBAC7B,OAAO,SAAqC,CAAC;gBAC/C,KAAK,yBAAyB;oBAC5B,OAAO,SAAoC,CAAC;gBAC9C,KAAK,+BAA+B;oBAClC,OAAO,SAA0C,CAAC;gBACpD;oBACE,MAAM,IAAI,KAAK,CAAC,oCAAoC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,0CAA0C,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;CAEF;AAzDD,oEAyDC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinch/verification",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Sinch Verification API",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test:e2e": "cucumber-js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sinch/sdk-client": "^1.
|
|
32
|
+
"@sinch/sdk-client": "^1.3.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {},
|
|
35
35
|
"publishConfig": {
|