@sinch/verification 1.3.0 → 1.4.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/enums.d.ts +11 -2
- package/dist/models/v1/flashcall-verification-report-response/flashcall-verification-report-response.d.ts +3 -3
- package/dist/models/v1/helper.d.ts +33 -4
- package/dist/models/v1/helper.js +77 -12
- package/dist/models/v1/helper.js.map +1 -1
- package/dist/models/v1/index.d.ts +3 -0
- package/dist/models/v1/index.js +4 -0
- package/dist/models/v1/index.js.map +1 -1
- package/dist/models/v1/mod-callbacks/flashcall-request-event-response/flashcall-request-event-response.d.ts +6 -3
- package/dist/models/v1/mod-callbacks/index.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/index.js +1 -1
- package/dist/models/v1/mod-callbacks/index.js.map +1 -1
- package/dist/models/v1/mod-callbacks/phonecall-request-event-response/phonecall-request-event-response.d.ts +2 -1
- package/dist/models/v1/mod-callbacks/sms-request-event-response/sms-request-event-response.d.ts +7 -2
- package/dist/models/v1/mod-callbacks/verification-request-event/verification-request-event.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/verification-request-event-response/verification-request-event-response.d.ts +3 -2
- package/dist/models/v1/mod-callbacks/verification-result-event/verification-result-event.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/whatsapp-request-event-response/index.d.ts +1 -0
- package/dist/models/v1/mod-callbacks/whatsapp-request-event-response/index.js.map +1 -0
- package/dist/models/v1/mod-callbacks/whatsapp-request-event-response/whatsapp-request-event-response.d.ts +14 -0
- package/dist/models/v1/mod-callbacks/{verification-result-event-response/verification-result-event-response.js → whatsapp-request-event-response/whatsapp-request-event-response.js} +1 -1
- package/dist/models/v1/mod-callbacks/whatsapp-request-event-response/whatsapp-request-event-response.js.map +1 -0
- package/dist/models/v1/phonecall-verification-report-response/phonecall-verification-report-response.d.ts +3 -3
- package/dist/models/v1/requests/verification-status/verification-status-request-data.d.ts +1 -1
- package/dist/models/v1/requests/verifications/verifications-request-data.d.ts +14 -2
- package/dist/models/v1/sms-verification-report-response/sms-verification-report-response.d.ts +3 -3
- package/dist/models/v1/start-flashcall-verification-response/start-flashcall-verification-response.d.ts +5 -4
- package/dist/models/v1/start-sms-verification-response/start-sms-verification-response.d.ts +5 -1
- package/dist/models/v1/start-verification-request/index.d.ts +1 -1
- package/dist/models/v1/start-verification-request/start-verification-request.d.ts +20 -8
- package/dist/models/v1/start-whatsapp-verification-response/index.d.ts +1 -0
- package/dist/models/v1/start-whatsapp-verification-response/index.js +3 -0
- package/dist/models/v1/start-whatsapp-verification-response/index.js.map +1 -0
- package/dist/models/v1/start-whatsapp-verification-response/start-whatsapp-verification-response.d.ts +18 -0
- package/dist/models/v1/start-whatsapp-verification-response/start-whatsapp-verification-response.js +3 -0
- package/dist/models/v1/start-whatsapp-verification-response/start-whatsapp-verification-response.js.map +1 -0
- package/dist/models/v1/verification-report-request/index.d.ts +1 -1
- package/dist/models/v1/verification-report-request/verification-report-request.d.ts +9 -1
- package/dist/models/v1/verification-status-response/verification-status-response.d.ts +2 -1
- package/dist/models/v1/whatsapp-verification-report-response/index.d.ts +1 -0
- package/dist/models/v1/whatsapp-verification-report-response/index.js +3 -0
- package/dist/models/v1/whatsapp-verification-report-response/index.js.map +1 -0
- package/dist/models/v1/whatsapp-verification-report-response/whatsapp-verification-report-response.d.ts +11 -0
- package/dist/models/v1/whatsapp-verification-report-response/whatsapp-verification-report-response.js +3 -0
- package/dist/models/v1/whatsapp-verification-report-response/whatsapp-verification-report-response.js.map +1 -0
- package/dist/models/v1/whatsapp-verification-status-response/index.d.ts +1 -0
- package/dist/models/v1/whatsapp-verification-status-response/index.js +3 -0
- package/dist/models/v1/whatsapp-verification-status-response/index.js.map +1 -0
- package/dist/models/v1/whatsapp-verification-status-response/whatsapp-verification-status-response.d.ts +25 -0
- package/dist/models/v1/whatsapp-verification-status-response/whatsapp-verification-status-response.js +3 -0
- package/dist/models/v1/whatsapp-verification-status-response/whatsapp-verification-status-response.js.map +1 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +7 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.js +10 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
- package/dist/rest/v1/index.d.ts +1 -0
- package/dist/rest/v1/index.js +1 -0
- package/dist/rest/v1/index.js.map +1 -1
- package/dist/rest/v1/verification-domain-api.d.ts +14 -11
- package/dist/rest/v1/verification-domain-api.js +25 -32
- package/dist/rest/v1/verification-domain-api.js.map +1 -1
- package/dist/rest/v1/verification-service.d.ts +11 -1
- package/dist/rest/v1/verification-service.js +44 -5
- package/dist/rest/v1/verification-service.js.map +1 -1
- package/dist/rest/v1/verification-status/verification-status-api.d.ts +2 -7
- package/dist/rest/v1/verification-status/verification-status-api.js +2 -10
- package/dist/rest/v1/verification-status/verification-status-api.js.map +1 -1
- package/dist/rest/v1/verifications/verifications-api.d.ts +21 -8
- package/dist/rest/v1/verifications/verifications-api.jest.fixture.d.ts +19 -1
- package/dist/rest/v1/verifications/verifications-api.jest.fixture.js +12 -0
- package/dist/rest/v1/verifications/verifications-api.jest.fixture.js.map +1 -1
- package/dist/rest/v1/verifications/verifications-api.js +80 -21
- package/dist/rest/v1/verifications/verifications-api.js.map +1 -1
- package/package.json +2 -2
- package/dist/models/v1/mod-callbacks/verification-result-event-response/index.d.ts +0 -1
- package/dist/models/v1/mod-callbacks/verification-result-event-response/index.js.map +0 -1
- package/dist/models/v1/mod-callbacks/verification-result-event-response/verification-result-event-response.d.ts +0 -4
- package/dist/models/v1/mod-callbacks/verification-result-event-response/verification-result-event-response.js.map +0 -1
- /package/dist/models/v1/mod-callbacks/{verification-result-event-response → whatsapp-request-event-response}/index.js +0 -0
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/** Determines whether the verification can be executed. */
|
|
1
2
|
export type ActionEnum = 'allow' | 'deny';
|
|
2
|
-
|
|
3
|
-
export type
|
|
3
|
+
/** Selects type of code which will be sent to customer */
|
|
4
|
+
export type CodeType = 'Numeric' | 'Alpha' | 'Alphanumeric' | string;
|
|
5
|
+
/** Selects type of code which will be sent to customer */
|
|
6
|
+
export type WhatsAppCodeType = 'Numeric' | 'Alpha' | 'Alphanumeric' | string;
|
|
7
|
+
/** The status of the verification */
|
|
8
|
+
export type VerificationStatusEnum = 'PENDING' | 'SUCCESSFUL' | 'FAIL' | 'DENIED' | 'ABORTED' | 'ERROR' | string;
|
|
9
|
+
/** Displays the reason why a verification has `FAILED`, was `DENIED`, or was `ABORTED`. */
|
|
10
|
+
export type ReasonEnum = 'Fraud' | 'Not enough credit' | 'Blocked' | 'Denied by callback' | 'Invalid callback' | 'Internal error' | 'Destination denied' | 'Network error or number unreachable' | 'Failed pending' | 'SMS delivery failure' | 'Invalid CLI' | 'Invalid code' | 'Expired' | 'Hung up without entering valid code' | string;
|
|
11
|
+
/** With the SMS verification method, a user's phone number is verified by sending an SMS containing an OTP code that must be manually returned. If you are are using an Android handset, you could instead intercept the SMS message delivery and capture the OTP code automatically. */
|
|
4
12
|
export type SourceEnum = 'intercepted' | 'manual';
|
|
13
|
+
/** The type of the call result. */
|
|
5
14
|
export type CallResult = 'ANSWERED' | 'COMPLETED' | 'NO_ANSWER' | 'CANCEL' | 'BUSY' | 'FAILED' | string;
|
|
@@ -9,11 +9,11 @@ export interface FlashCallVerificationReportResponse {
|
|
|
9
9
|
status?: VerificationStatusEnum;
|
|
10
10
|
/** Displays the reason why a verification has `FAILED`, was `DENIED`, or was `ABORTED`. */
|
|
11
11
|
reason?: ReasonEnum;
|
|
12
|
-
/** The reference ID that was optionally passed together with the verification request. */
|
|
12
|
+
/** @deprecated The reference ID that was optionally passed together with the verification request. */
|
|
13
13
|
reference?: string;
|
|
14
|
-
/** Free text that the client is sending, used to show if the call/SMS was intercepted or not. */
|
|
14
|
+
/** @deprecated Free text that the client is sending, used to show if the call/SMS was intercepted or not. */
|
|
15
15
|
source?: SourceEnum;
|
|
16
|
-
/** @see Identity */
|
|
16
|
+
/** @deprecated @see Identity */
|
|
17
17
|
identity?: Identity;
|
|
18
18
|
/** Shows whether the call is complete or not. */
|
|
19
19
|
callComplete?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReportCalloutVerificationByIdentityRequestData, ReportCalloutVerificationByIdRequestData, ReportFlashCallVerificationByIdentityRequestData, ReportFlashCallVerificationByIdRequestData, ReportPhoneCallVerificationByIdentityRequestData, ReportPhoneCallVerificationByIdRequestData, ReportSmsVerificationByIdentityRequestData, ReportSmsVerificationByIdRequestData, StartCalloutVerificationRequestData, StartDataVerificationRequestData, StartFlashCallVerificationRequestData, StartPhoneCallVerificationRequestData, StartSeamlessVerificationRequestData, StartSmsVerificationRequestData } from './requests';
|
|
2
|
-
import { SmsOptions } from './start-verification-request';
|
|
1
|
+
import { ReportCalloutVerificationByIdentityRequestData, ReportCalloutVerificationByIdRequestData, ReportFlashCallVerificationByIdentityRequestData, ReportFlashCallVerificationByIdRequestData, ReportPhoneCallVerificationByIdentityRequestData, ReportPhoneCallVerificationByIdRequestData, ReportSmsVerificationByIdentityRequestData, ReportSmsVerificationByIdRequestData, ReportWhatsAppVerificationByIdentityRequestData, ReportWhatsAppVerificationByIdRequestData, StartCalloutVerificationRequestData, StartDataVerificationRequestData, StartFlashCallVerificationRequestData, StartPhoneCallVerificationRequestData, StartSeamlessVerificationRequestData, StartSmsVerificationRequestData, StartWhatsAppVerificationRequestData } from './requests';
|
|
2
|
+
import { SmsOptions, WhatsAppOptions } from './start-verification-request';
|
|
3
3
|
export declare const startVerificationHelper: {
|
|
4
4
|
/**
|
|
5
5
|
* Builds a request object for starting an SMS verification process.
|
|
@@ -16,9 +16,10 @@ export declare const startVerificationHelper: {
|
|
|
16
16
|
* @param {string} phoneNumber - The phone number to which the verification call should be made.
|
|
17
17
|
* @param {string} [reference] - An optional reference identifier used to pass your own reference in the request for tracking purposes.
|
|
18
18
|
* @param {string} [locale] - An optional language-region identifier to use for the verification call.
|
|
19
|
+
* @param {Record<string, unknown>} [additionalOptions] - An optional object for any additional phone call options.
|
|
19
20
|
* @return {StartPhoneCallVerificationRequestData} The request data object for initiating the phone call verification.
|
|
20
21
|
*/
|
|
21
|
-
buildPhoneCallRequest: (phoneNumber: string, reference?: string, locale?: string) => StartPhoneCallVerificationRequestData;
|
|
22
|
+
buildPhoneCallRequest: (phoneNumber: string, reference?: string, locale?: string, additionalOptions?: Record<string, unknown>) => StartPhoneCallVerificationRequestData;
|
|
22
23
|
/**
|
|
23
24
|
* Builds a callout request body with the provided phone number, reference, and locale.
|
|
24
25
|
*
|
|
@@ -35,9 +36,12 @@ export declare const startVerificationHelper: {
|
|
|
35
36
|
* @param {string} phoneNumber - The phone number to which the flash call verification should be made.
|
|
36
37
|
* @param {string} [reference] - An optional reference identifier used to pass your own reference in the request for tracking purposes.
|
|
37
38
|
* @param {number} [dialTimeout] - An optional timeout value in seconds for how long to wait for the flash call to be answered.
|
|
39
|
+
* @param {number} [interceptionTimeout] - An optional timeout value in seconds for the maximum time that a phone call verification will be active and can be completed. If the phone number hasn't been verified successfully during this time, then the verification request will fail. By default, the Sinch dashboard will automatically optimize dial time out during a phone call.
|
|
40
|
+
* @param {Record<string, unknown>} [additionalOptions] - An optional object for any additional flash call options.
|
|
38
41
|
* @return {StartFlashCallVerificationRequestData} The request data object for initiating the flash call verification.
|
|
42
|
+
* TODO V2: limit the number of parameters by introducing a FlashCallOptions object
|
|
39
43
|
*/
|
|
40
|
-
buildFlashCallRequest: (phoneNumber: string, reference?: string, dialTimeout?: number) => StartFlashCallVerificationRequestData;
|
|
44
|
+
buildFlashCallRequest: (phoneNumber: string, reference?: string, dialTimeout?: number, interceptionTimeout?: number, additionalOptions?: Record<string, unknown>) => StartFlashCallVerificationRequestData;
|
|
41
45
|
/**
|
|
42
46
|
* Builds a request object for initiating a data verification process.
|
|
43
47
|
*
|
|
@@ -55,6 +59,15 @@ export declare const startVerificationHelper: {
|
|
|
55
59
|
* @deprecated Use the method buildDataRequest() instead
|
|
56
60
|
*/
|
|
57
61
|
buildSeamlessRequest: (phoneNumber: string, reference?: string) => StartSeamlessVerificationRequestData;
|
|
62
|
+
/**
|
|
63
|
+
* Builds a request object for starting a WhatsApp verification process.
|
|
64
|
+
*
|
|
65
|
+
* @param {string} phoneNumber - The phone number to which the WhatsApp verification should be sent.
|
|
66
|
+
* @param {string} [reference] - An optional reference identifier used to pass your own reference in the request for tracking purposes.
|
|
67
|
+
* @param {WhatsAppOptions} [whatsAppOptions] - Optional parameters for configuring the WhatsApp verification request, with default values assumed for all contained values if not provided.
|
|
68
|
+
* @return {StartWhatsAppVerificationRequestData} The constructed WhatsApp verification request data.
|
|
69
|
+
*/
|
|
70
|
+
buildWhatsAppRequest: (phoneNumber: string, reference?: string, whatsAppOptions?: WhatsAppOptions) => StartWhatsAppVerificationRequestData;
|
|
58
71
|
};
|
|
59
72
|
export declare const reportVerificationByIdHelper: {
|
|
60
73
|
/**
|
|
@@ -91,6 +104,14 @@ export declare const reportVerificationByIdHelper: {
|
|
|
91
104
|
* @return {ReportFlashCallVerificationByIdRequestData} The request data object used to report the flash call verification.
|
|
92
105
|
*/
|
|
93
106
|
buildFlashCallRequest: (id: string, cli: string) => ReportFlashCallVerificationByIdRequestData;
|
|
107
|
+
/**
|
|
108
|
+
* Builds a request object for reporting a WhatsApp verification by its ID.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} id - The unique identifier for the WhatsApp verification request.
|
|
111
|
+
* @param {string} code - The verification code received via WhatsApp.
|
|
112
|
+
* @return {ReportWhatsAppVerificationByIdRequestData} The request data object used to report the WhatsApp verification.
|
|
113
|
+
*/
|
|
114
|
+
buildWhatsAppRequest: (id: string, code: string) => ReportWhatsAppVerificationByIdRequestData;
|
|
94
115
|
};
|
|
95
116
|
export declare const reportVerificationByIdentityHelper: {
|
|
96
117
|
/**
|
|
@@ -127,4 +148,12 @@ export declare const reportVerificationByIdentityHelper: {
|
|
|
127
148
|
* @return {ReportFlashCallVerificationByIdentityRequestData} The request data object used to report the flash call verification.
|
|
128
149
|
*/
|
|
129
150
|
buildFlashCallRequest: (identity: string, cli: string) => ReportFlashCallVerificationByIdentityRequestData;
|
|
151
|
+
/**
|
|
152
|
+
* Builds a request object for reporting a WhatsApp verification by the phone number identity.
|
|
153
|
+
*
|
|
154
|
+
* @param {string} identity - The phone number for which the verification process has been initiated.
|
|
155
|
+
* @param {string} code - The verification code received via WhatsApp.
|
|
156
|
+
* @return {ReportWhatsAppVerificationByIdentityRequestData} The request data object used to report the WhatsApp verification.
|
|
157
|
+
*/
|
|
158
|
+
buildWhatsAppRequest: (identity: string, code: string) => ReportWhatsAppVerificationByIdentityRequestData;
|
|
130
159
|
};
|
package/dist/models/v1/helper.js
CHANGED
|
@@ -32,9 +32,10 @@ exports.startVerificationHelper = {
|
|
|
32
32
|
* @param {string} phoneNumber - The phone number to which the verification call should be made.
|
|
33
33
|
* @param {string} [reference] - An optional reference identifier used to pass your own reference in the request for tracking purposes.
|
|
34
34
|
* @param {string} [locale] - An optional language-region identifier to use for the verification call.
|
|
35
|
+
* @param {Record<string, unknown>} [additionalOptions] - An optional object for any additional phone call options.
|
|
35
36
|
* @return {StartPhoneCallVerificationRequestData} The request data object for initiating the phone call verification.
|
|
36
37
|
*/
|
|
37
|
-
buildPhoneCallRequest: (phoneNumber, reference, locale) => {
|
|
38
|
+
buildPhoneCallRequest: (phoneNumber, reference, locale, additionalOptions) => {
|
|
38
39
|
return {
|
|
39
40
|
startVerificationWithPhoneCallRequestBody: {
|
|
40
41
|
identity: {
|
|
@@ -42,13 +43,14 @@ exports.startVerificationHelper = {
|
|
|
42
43
|
endpoint: phoneNumber,
|
|
43
44
|
},
|
|
44
45
|
reference,
|
|
45
|
-
...(locale !== undefined
|
|
46
|
+
...(locale !== undefined || additionalOptions !== undefined ? {
|
|
46
47
|
phoneCallOptions: {
|
|
47
|
-
|
|
48
|
-
locale,
|
|
49
|
-
},
|
|
48
|
+
...(locale !== undefined ? {
|
|
49
|
+
speech: { locale },
|
|
50
|
+
} : {}),
|
|
51
|
+
...(additionalOptions ?? {}),
|
|
50
52
|
},
|
|
51
|
-
} : {},
|
|
53
|
+
} : {}),
|
|
52
54
|
},
|
|
53
55
|
};
|
|
54
56
|
},
|
|
@@ -69,13 +71,13 @@ exports.startVerificationHelper = {
|
|
|
69
71
|
endpoint: phoneNumber,
|
|
70
72
|
},
|
|
71
73
|
reference,
|
|
72
|
-
...(locale !== undefined
|
|
74
|
+
...(locale !== undefined ? {
|
|
73
75
|
calloutOptions: {
|
|
74
76
|
speech: {
|
|
75
77
|
locale,
|
|
76
78
|
},
|
|
77
79
|
},
|
|
78
|
-
} : {},
|
|
80
|
+
} : {}),
|
|
79
81
|
},
|
|
80
82
|
};
|
|
81
83
|
},
|
|
@@ -85,9 +87,12 @@ exports.startVerificationHelper = {
|
|
|
85
87
|
* @param {string} phoneNumber - The phone number to which the flash call verification should be made.
|
|
86
88
|
* @param {string} [reference] - An optional reference identifier used to pass your own reference in the request for tracking purposes.
|
|
87
89
|
* @param {number} [dialTimeout] - An optional timeout value in seconds for how long to wait for the flash call to be answered.
|
|
90
|
+
* @param {number} [interceptionTimeout] - An optional timeout value in seconds for the maximum time that a phone call verification will be active and can be completed. If the phone number hasn't been verified successfully during this time, then the verification request will fail. By default, the Sinch dashboard will automatically optimize dial time out during a phone call.
|
|
91
|
+
* @param {Record<string, unknown>} [additionalOptions] - An optional object for any additional flash call options.
|
|
88
92
|
* @return {StartFlashCallVerificationRequestData} The request data object for initiating the flash call verification.
|
|
93
|
+
* TODO V2: limit the number of parameters by introducing a FlashCallOptions object
|
|
89
94
|
*/
|
|
90
|
-
buildFlashCallRequest: (phoneNumber, reference, dialTimeout) => {
|
|
95
|
+
buildFlashCallRequest: (phoneNumber, reference, dialTimeout, interceptionTimeout, additionalOptions) => {
|
|
91
96
|
return {
|
|
92
97
|
startVerificationWithFlashCallRequestBody: {
|
|
93
98
|
identity: {
|
|
@@ -95,11 +100,13 @@ exports.startVerificationHelper = {
|
|
|
95
100
|
endpoint: phoneNumber,
|
|
96
101
|
},
|
|
97
102
|
reference,
|
|
98
|
-
...(dialTimeout !== undefined
|
|
103
|
+
...(dialTimeout !== undefined || interceptionTimeout !== undefined || additionalOptions !== undefined ? {
|
|
99
104
|
flashCallOptions: {
|
|
100
|
-
dialTimeout,
|
|
105
|
+
...(dialTimeout !== undefined ? { dialTimeout } : {}),
|
|
106
|
+
...(interceptionTimeout !== undefined ? { interceptionTimeout } : {}),
|
|
107
|
+
...(additionalOptions ?? {}),
|
|
101
108
|
},
|
|
102
|
-
} : {},
|
|
109
|
+
} : {}),
|
|
103
110
|
},
|
|
104
111
|
};
|
|
105
112
|
},
|
|
@@ -140,6 +147,30 @@ exports.startVerificationHelper = {
|
|
|
140
147
|
},
|
|
141
148
|
};
|
|
142
149
|
},
|
|
150
|
+
/**
|
|
151
|
+
* Builds a request object for starting a WhatsApp verification process.
|
|
152
|
+
*
|
|
153
|
+
* @param {string} phoneNumber - The phone number to which the WhatsApp verification should be sent.
|
|
154
|
+
* @param {string} [reference] - An optional reference identifier used to pass your own reference in the request for tracking purposes.
|
|
155
|
+
* @param {WhatsAppOptions} [whatsAppOptions] - Optional parameters for configuring the WhatsApp verification request, with default values assumed for all contained values if not provided.
|
|
156
|
+
* @return {StartWhatsAppVerificationRequestData} The constructed WhatsApp verification request data.
|
|
157
|
+
*/
|
|
158
|
+
buildWhatsAppRequest: (phoneNumber, reference, whatsAppOptions) => {
|
|
159
|
+
return {
|
|
160
|
+
startVerificationWithWhatsAppRequestBody: {
|
|
161
|
+
identity: {
|
|
162
|
+
type: 'number',
|
|
163
|
+
endpoint: phoneNumber,
|
|
164
|
+
},
|
|
165
|
+
reference,
|
|
166
|
+
...(whatsAppOptions !== undefined) ? {
|
|
167
|
+
whatsappOptions: {
|
|
168
|
+
...whatsAppOptions,
|
|
169
|
+
},
|
|
170
|
+
} : {},
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
},
|
|
143
174
|
};
|
|
144
175
|
exports.reportVerificationByIdHelper = {
|
|
145
176
|
/**
|
|
@@ -213,6 +244,23 @@ exports.reportVerificationByIdHelper = {
|
|
|
213
244
|
},
|
|
214
245
|
};
|
|
215
246
|
},
|
|
247
|
+
/**
|
|
248
|
+
* Builds a request object for reporting a WhatsApp verification by its ID.
|
|
249
|
+
*
|
|
250
|
+
* @param {string} id - The unique identifier for the WhatsApp verification request.
|
|
251
|
+
* @param {string} code - The verification code received via WhatsApp.
|
|
252
|
+
* @return {ReportWhatsAppVerificationByIdRequestData} The request data object used to report the WhatsApp verification.
|
|
253
|
+
*/
|
|
254
|
+
buildWhatsAppRequest: (id, code) => {
|
|
255
|
+
return {
|
|
256
|
+
id,
|
|
257
|
+
reportWhatsAppVerificationByIdRequestBody: {
|
|
258
|
+
whatsapp: {
|
|
259
|
+
code,
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
},
|
|
216
264
|
};
|
|
217
265
|
exports.reportVerificationByIdentityHelper = {
|
|
218
266
|
/**
|
|
@@ -286,5 +334,22 @@ exports.reportVerificationByIdentityHelper = {
|
|
|
286
334
|
},
|
|
287
335
|
};
|
|
288
336
|
},
|
|
337
|
+
/**
|
|
338
|
+
* Builds a request object for reporting a WhatsApp verification by the phone number identity.
|
|
339
|
+
*
|
|
340
|
+
* @param {string} identity - The phone number for which the verification process has been initiated.
|
|
341
|
+
* @param {string} code - The verification code received via WhatsApp.
|
|
342
|
+
* @return {ReportWhatsAppVerificationByIdentityRequestData} The request data object used to report the WhatsApp verification.
|
|
343
|
+
*/
|
|
344
|
+
buildWhatsAppRequest: (identity, code) => {
|
|
345
|
+
return {
|
|
346
|
+
endpoint: identity,
|
|
347
|
+
reportWhatsAppVerificationByIdentityRequestBody: {
|
|
348
|
+
whatsapp: {
|
|
349
|
+
code,
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
},
|
|
289
354
|
};
|
|
290
355
|
//# sourceMappingURL=helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/models/v1/helper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../../src/models/v1/helper.ts"],"names":[],"mappings":";;;AAqBa,QAAA,uBAAuB,GAAG;IACrC;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,WAAmB,EACnB,SAAkB,EAClB,UAAuB,EACU,EAAE;QACnC,OAAO;YACL,mCAAmC,EAAE;gBACnC,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,WAAW;iBACtB;gBACD,SAAS;gBACT,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;oBAC9B,UAAU,EAAE;wBACV,GAAG,UAAU;qBACd;iBACF,CAAC,CAAC,CAAC,EAAE;aACP;SACF,CAAC;IACJ,CAAC;IACD;;;;;;;;OAQG;IACH,qBAAqB,EAAE,CACrB,WAAmB,EACnB,SAAkB,EAClB,MAAe,EACf,iBAA2C,EACJ,EAAE;QACzC,OAAO;YACL,yCAAyC,EAAE;gBACzC,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,WAAW;iBACtB;gBACD,SAAS;gBACT,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC;oBAC5D,gBAAgB,EAAE;wBAChB,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;4BACzB,MAAM,EAAE,EAAE,MAAM,EAAE;yBACnB,CAAC,CAAC,CAAC,EAAE,CAAC;wBACP,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC;qBAC7B;iBACF,CAAC,CAAC,CAAC,EAAE,CAAC;aACR;SACF,CAAC;IACJ,CAAC;IACD;;;;;;;;OAQG;IACH,mBAAmB,EAAE,CACnB,WAAmB,EACnB,SAAkB,EAClB,MAAe,EACsB,EA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EAChB,IAAY,EACqC,EAAE;QACnD,OAAO;YACL,QAAQ,EAAE,QAAQ;YAClB,+CAA+C,EAAE;gBAC/C,QAAQ,EAAE;oBACR,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -10,6 +10,9 @@ export * from './phonecall-verification-status-response';
|
|
|
10
10
|
export * from './start-flashcall-verification-response';
|
|
11
11
|
export * from './flashcall-verification-report-response';
|
|
12
12
|
export * from './flashcall-verification-status-response';
|
|
13
|
+
export * from './start-whatsapp-verification-response';
|
|
14
|
+
export * from './whatsapp-verification-report-response';
|
|
15
|
+
export * from './whatsapp-verification-status-response';
|
|
13
16
|
export * from './start-data-verification-response';
|
|
14
17
|
export * from './verification-status-response';
|
|
15
18
|
export * from './mod-callbacks';
|
package/dist/models/v1/index.js
CHANGED
|
@@ -30,6 +30,10 @@ __exportStar(require("./phonecall-verification-status-response"), exports);
|
|
|
30
30
|
__exportStar(require("./start-flashcall-verification-response"), exports);
|
|
31
31
|
__exportStar(require("./flashcall-verification-report-response"), exports);
|
|
32
32
|
__exportStar(require("./flashcall-verification-status-response"), exports);
|
|
33
|
+
// Models associated to WhatsApp verification workflow
|
|
34
|
+
__exportStar(require("./start-whatsapp-verification-response"), exports);
|
|
35
|
+
__exportStar(require("./whatsapp-verification-report-response"), exports);
|
|
36
|
+
__exportStar(require("./whatsapp-verification-status-response"), exports);
|
|
33
37
|
// Models associated to Data verification workflow
|
|
34
38
|
__exportStar(require("./start-data-verification-response"), exports);
|
|
35
39
|
// Wrapper for the various types of Verification Status Response
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,6CAA2B;AAC3B,+DAA6C;AAC7C,gEAA8C;AAC9C,iDAAiD;AACjD,oEAAkD;AAClD,qEAAmD;AACnD,qEAAmD;AACnD,uDAAuD;AACvD,0EAAwD;AACxD,2EAAyD;AACzD,2EAAyD;AACzD,uDAAuD;AACvD,0EAAwD;AACxD,2EAAyD;AACzD,2EAAyD;AACzD,kDAAkD;AAClD,qEAAmD;AACnD,gEAAgE;AAChE,iEAA+C;AAC/C,uCAAuC;AACvC,kDAAgC;AAChC,gBAAgB;AAChB,6CAA2B;AAC3B,iDAA+B;AAC/B,0CAAwB;AACxB,4DAA0C;AAC1C,2DAAyC;AACzC,cAAc;AACd,uDAAqC;AACrC,QAAQ;AACR,0CAAwB;AACxB,iBAAiB;AACjB,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,6CAA2B;AAC3B,+DAA6C;AAC7C,gEAA8C;AAC9C,iDAAiD;AACjD,oEAAkD;AAClD,qEAAmD;AACnD,qEAAmD;AACnD,uDAAuD;AACvD,0EAAwD;AACxD,2EAAyD;AACzD,2EAAyD;AACzD,uDAAuD;AACvD,0EAAwD;AACxD,2EAAyD;AACzD,2EAAyD;AACzD,sDAAsD;AACtD,yEAAuD;AACvD,0EAAwD;AACxD,0EAAwD;AACxD,kDAAkD;AAClD,qEAAmD;AACnD,gEAAgE;AAChE,iEAA+C;AAC/C,uCAAuC;AACvC,kDAAgC;AAChC,gBAAgB;AAChB,6CAA2B;AAC3B,iDAA+B;AAC/B,0CAAwB;AACxB,4DAA0C;AAC1C,2DAAyC;AACzC,cAAc;AACd,uDAAqC;AACrC,QAAQ;AACR,0CAAwB;AACxB,iBAAiB;AACjB,2CAAyB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActionEnum } from '../../enums';
|
|
2
|
+
import { WithAdditionalProperties } from '@sinch/sdk-client';
|
|
2
3
|
export interface FlashCallRequestEventResponse {
|
|
3
4
|
/** Determines whether the verification can be executed. */
|
|
4
5
|
action?: ActionEnum;
|
|
@@ -7,9 +8,11 @@ export interface FlashCallRequestEventResponse {
|
|
|
7
8
|
}
|
|
8
9
|
/** @deprecated Use FlashCallProperties instead */
|
|
9
10
|
export type FlashCallContent = FlashCallProperties;
|
|
10
|
-
export interface FlashCallProperties {
|
|
11
|
-
/** The phone number that will be displayed to the user when the
|
|
11
|
+
export interface FlashCallProperties extends WithAdditionalProperties {
|
|
12
|
+
/** The phone number that will be displayed to the user when the flash call is received on the user's phone. By default, the Sinch dashboard will randomly select the CLI that will be displayed during a phone call from a pool of numbers. If you want to set your own CLI, you can specify it in the response to the Verification Request Event. */
|
|
12
13
|
cli?: string;
|
|
13
|
-
/** The
|
|
14
|
+
/** The amount of time that a phone will ring. */
|
|
14
15
|
dialTimeout?: number;
|
|
16
|
+
/** The maximum time that a phone call verification will be active and can be completed. If the phone number hasn't been verified successfully during this time, then the verification request will fail. By default, the Sinch dashboard will automatically optimize dial time out during a phone call. */
|
|
17
|
+
interceptionTimeout?: number;
|
|
15
18
|
}
|
|
@@ -3,7 +3,7 @@ export * from './verification-request-event';
|
|
|
3
3
|
export * from './phonecall-request-event-response';
|
|
4
4
|
export * from './flashcall-request-event-response';
|
|
5
5
|
export * from './sms-request-event-response';
|
|
6
|
+
export * from './whatsapp-request-event-response';
|
|
6
7
|
export * from './verification-request-event-response';
|
|
7
8
|
export * from './verification-result-event';
|
|
8
|
-
export * from './verification-result-event-response';
|
|
9
9
|
export * from './verification-sms-delivered-event';
|
|
@@ -21,10 +21,10 @@ __exportStar(require("./verification-request-event"), exports);
|
|
|
21
21
|
__exportStar(require("./phonecall-request-event-response"), exports);
|
|
22
22
|
__exportStar(require("./flashcall-request-event-response"), exports);
|
|
23
23
|
__exportStar(require("./sms-request-event-response"), exports);
|
|
24
|
+
__exportStar(require("./whatsapp-request-event-response"), exports);
|
|
24
25
|
__exportStar(require("./verification-request-event-response"), exports);
|
|
25
26
|
// 'Verification Result Event' received from Sinch server (no response data needed)
|
|
26
27
|
__exportStar(require("./verification-result-event"), exports);
|
|
27
|
-
__exportStar(require("./verification-result-event-response"), exports);
|
|
28
28
|
// 'Verification Sms Delivered Event' received from Sinch server
|
|
29
29
|
__exportStar(require("./verification-sms-delivered-event"), exports);
|
|
30
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,
|
|
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,oEAAkD;AAClD,wEAAsD;AACtD,mFAAmF;AACnF,8DAA4C;AAC5C,gEAAgE;AAChE,qEAAmD"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActionEnum } from '../../enums';
|
|
2
|
+
import { WithAdditionalProperties } from '@sinch/sdk-client';
|
|
2
3
|
/** @deprecated Use PhoneCallRequestEventResponse instead */
|
|
3
4
|
export type CalloutRequestEventResponse = PhoneCallRequestEventResponse;
|
|
4
5
|
export interface PhoneCallRequestEventResponse {
|
|
@@ -9,7 +10,7 @@ export interface PhoneCallRequestEventResponse {
|
|
|
9
10
|
}
|
|
10
11
|
/** @deprecated Use PhoneCallProperties instead */
|
|
11
12
|
export type CalloutProperties = PhoneCallProperties;
|
|
12
|
-
export interface PhoneCallProperties {
|
|
13
|
+
export interface PhoneCallProperties extends WithAdditionalProperties {
|
|
13
14
|
/** The Phone Call PIN that should be entered by the user. Sinch servers automatically generate PIN codes for Phone Call verification. If you want to set your own code, you can specify it in the response to the Verification Request Event. */
|
|
14
15
|
code?: string;
|
|
15
16
|
/** @see SpeechProperties */
|
package/dist/models/v1/mod-callbacks/sms-request-event-response/sms-request-event-response.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { ActionEnum } from '../../enums';
|
|
1
|
+
import { ActionEnum, CodeType } from '../../enums';
|
|
2
|
+
import { WithAdditionalProperties } from '@sinch/sdk-client';
|
|
2
3
|
export interface SmsRequestEventResponse {
|
|
3
4
|
/** Determines whether the verification can be executed. */
|
|
4
5
|
action?: ActionEnum;
|
|
5
6
|
/** @see SmsProperties */
|
|
6
7
|
sms?: SmsProperties;
|
|
7
8
|
}
|
|
8
|
-
export interface SmsProperties {
|
|
9
|
+
export interface SmsProperties extends WithAdditionalProperties {
|
|
9
10
|
/** 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
11
|
code?: string;
|
|
11
12
|
/** List of strings */
|
|
12
13
|
acceptLanguage?: string[];
|
|
14
|
+
/** Accepted values for the type of code to be generated are `Numeric`, `Alpha`, and `Alphanumeric`. Default is `Numeric`. */
|
|
15
|
+
codeType?: CodeType;
|
|
16
|
+
/** The expiration time for a verification process is represented in the format `HH:MM:SS`. */
|
|
17
|
+
expiry?: string;
|
|
13
18
|
}
|
|
14
19
|
/** @deprecated Use SmsRequestEventResponse instead */
|
|
15
20
|
export type SMSRequestEventResponse = SmsRequestEventResponse;
|
package/dist/models/v1/mod-callbacks/verification-request-event/verification-request-event.d.ts
CHANGED
|
@@ -22,4 +22,4 @@ export interface VerificationRequestEvent {
|
|
|
22
22
|
}
|
|
23
23
|
/** @deprecated Use VerificationRequestMethod instead */
|
|
24
24
|
export type MethodEnum = 'sms' | 'flashcall' | 'callout';
|
|
25
|
-
export type VerificationRequestMethod = 'sms' | 'flashcall' | 'callout';
|
|
25
|
+
export type VerificationRequestMethod = 'sms' | 'flashcall' | 'callout' | 'whatsapp';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SmsRequestEventResponse } from '../sms-request-event-response';
|
|
2
2
|
import { FlashCallRequestEventResponse } from '../flashcall-request-event-response';
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { PhoneCallRequestEventResponse } from '../phonecall-request-event-response';
|
|
4
|
+
import { WhatsAppRequestEventResponse } from '../whatsapp-request-event-response';
|
|
5
|
+
export type VerificationRequestEventResponse = SmsRequestEventResponse | FlashCallRequestEventResponse | PhoneCallRequestEventResponse | WhatsAppRequestEventResponse;
|
package/dist/models/v1/mod-callbacks/verification-result-event/verification-result-event.d.ts
CHANGED
|
@@ -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 VerificationResultMethod = 'sms' | 'flashcall' | 'callout' | 'seamless';
|
|
23
|
+
export type VerificationResultMethod = 'sms' | 'flashcall' | 'callout' | 'seamless' | 'whatsapp';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { WhatsAppRequestEventResponse, WhatsAppProperties } from './whatsapp-request-event-response';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/models/v1/mod-callbacks/whatsapp-request-event-response/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ActionEnum, WhatsAppCodeType } from '../../enums';
|
|
2
|
+
import { WithAdditionalProperties } from '@sinch/sdk-client';
|
|
3
|
+
export interface WhatsAppRequestEventResponse {
|
|
4
|
+
/** Determines whether the verification can be executed. */
|
|
5
|
+
action?: ActionEnum;
|
|
6
|
+
/** @see WhatsAppProperties */
|
|
7
|
+
whatsapp?: WhatsAppProperties;
|
|
8
|
+
}
|
|
9
|
+
export interface WhatsAppProperties extends WithAdditionalProperties {
|
|
10
|
+
/** Selects type of code which will be sent to customer */
|
|
11
|
+
codeType?: WhatsAppCodeType;
|
|
12
|
+
/** The WhatsApp verification content language. Set in the verification request. */
|
|
13
|
+
acceptLanguage?: string[];
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whatsapp-request-event-response.js","sourceRoot":"","sources":["../../../../../src/models/v1/mod-callbacks/whatsapp-request-event-response/whatsapp-request-event-response.ts"],"names":[],"mappings":""}
|
|
@@ -11,11 +11,11 @@ export interface PhoneCallVerificationReportResponse {
|
|
|
11
11
|
status?: VerificationStatusEnum;
|
|
12
12
|
/** Displays the reason why a verification has `FAILED`, was `DENIED`, or was `ABORTED`. */
|
|
13
13
|
reason?: ReasonEnum;
|
|
14
|
-
/** The reference ID that was optionally passed together with the verification request. */
|
|
14
|
+
/** @deprecated The reference ID that was optionally passed together with the verification request. */
|
|
15
15
|
reference?: string;
|
|
16
|
-
/** Free text that the client is sending, used to show if the call/SMS was intercepted or not. */
|
|
16
|
+
/** @deprecated Free text that the client is sending, used to show if the call/SMS was intercepted or not. */
|
|
17
17
|
source?: SourceEnum;
|
|
18
|
-
/** @see Identity */
|
|
18
|
+
/** @deprecated @see Identity */
|
|
19
19
|
identity?: Identity;
|
|
20
20
|
/** Shows whether the call is complete or not. */
|
|
21
21
|
callComplete?: boolean;
|
|
@@ -6,7 +6,7 @@ export interface VerificationStatusByIdentityRequestData {
|
|
|
6
6
|
/** For type `number` use a [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537)-compatible phone number. */
|
|
7
7
|
'endpoint': string;
|
|
8
8
|
/** The method of the verification. */
|
|
9
|
-
'method': 'sms' | 'callout' | 'phonecall' | 'flashCall' | 'flashcall';
|
|
9
|
+
'method': 'sms' | 'callout' | 'phonecall' | 'flashCall' | 'flashcall' | 'whatsapp' | string;
|
|
10
10
|
}
|
|
11
11
|
export interface VerificationStatusByReferenceRequestData {
|
|
12
12
|
/** The custom reference of the verification. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CalloutVerificationReportRequest, FlashCallVerificationReportRequest, PhoneCallVerificationReportRequest, SmsVerificationReportRequest } from '../../verification-report-request';
|
|
2
|
-
import { StartDataVerification, StartSeamlessVerification, StartVerificationWithCallout, StartVerificationWithFlashCall, StartVerificationWithPhoneCall, StartVerificationWithSms } from '../../start-verification-request';
|
|
1
|
+
import { CalloutVerificationReportRequest, FlashCallVerificationReportRequest, PhoneCallVerificationReportRequest, SmsVerificationReportRequest, WhatsAppVerificationReportRequest } from '../../verification-report-request';
|
|
2
|
+
import { StartDataVerification, StartSeamlessVerification, StartVerificationWithCallout, StartVerificationWithFlashCall, StartVerificationWithPhoneCall, StartVerificationWithSms, StartVerificationWithWhatsApp } from '../../start-verification-request';
|
|
3
3
|
interface ReportVerificationByIdRequestDataBase {
|
|
4
4
|
/** The ID of the verification. */
|
|
5
5
|
'id': string;
|
|
@@ -21,6 +21,10 @@ export interface ReportCalloutVerificationByIdRequestData extends ReportVerifica
|
|
|
21
21
|
/** Request body to report a verification started with a callout by its ID */
|
|
22
22
|
'reportCalloutVerificationByIdRequestBody': CalloutVerificationReportRequest;
|
|
23
23
|
}
|
|
24
|
+
export interface ReportWhatsAppVerificationByIdRequestData extends ReportVerificationByIdRequestDataBase {
|
|
25
|
+
/** Request body to report a verification started with WhatsApp by its ID */
|
|
26
|
+
'reportWhatsAppVerificationByIdRequestBody': WhatsAppVerificationReportRequest;
|
|
27
|
+
}
|
|
24
28
|
interface ReportVerificationByIdentityRequestDataBase {
|
|
25
29
|
/** For type `number` use a [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537)-compatible phone number. */
|
|
26
30
|
'endpoint': string;
|
|
@@ -42,6 +46,10 @@ export interface ReportCalloutVerificationByIdentityRequestData extends ReportVe
|
|
|
42
46
|
/** Request body to report a verification started with a callout by its identity */
|
|
43
47
|
'reportCalloutVerificationByIdentityRequestBody': CalloutVerificationReportRequest;
|
|
44
48
|
}
|
|
49
|
+
export interface ReportWhatsAppVerificationByIdentityRequestData extends ReportVerificationByIdentityRequestDataBase {
|
|
50
|
+
/** Request body to report a verification started with WhatsApp by its identity */
|
|
51
|
+
'reportWhatsAppVerificationByIdentityRequestBody': WhatsAppVerificationReportRequest;
|
|
52
|
+
}
|
|
45
53
|
export interface StartSmsVerificationRequestData {
|
|
46
54
|
/** Request body to start a verification with an SMS */
|
|
47
55
|
'startVerificationWithSmsRequestBody': StartVerificationWithSms;
|
|
@@ -68,4 +76,8 @@ export interface StartSeamlessVerificationRequestData {
|
|
|
68
76
|
/** Request body to start a seamless verification */
|
|
69
77
|
'startSeamlessVerificationRequestBody': StartSeamlessVerification;
|
|
70
78
|
}
|
|
79
|
+
export interface StartWhatsAppVerificationRequestData {
|
|
80
|
+
/** Request body to start a verification with whatsapp */
|
|
81
|
+
'startVerificationWithWhatsAppRequestBody': StartVerificationWithWhatsApp;
|
|
82
|
+
}
|
|
71
83
|
export {};
|
package/dist/models/v1/sms-verification-report-response/sms-verification-report-response.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ export interface SmsVerificationReportResponse {
|
|
|
9
9
|
status?: VerificationStatusEnum;
|
|
10
10
|
/** Displays the reason why a verification has `FAILED`, was `DENIED`, or was `ABORTED`. */
|
|
11
11
|
reason?: ReasonEnum;
|
|
12
|
-
/** The reference ID that was optionally passed together with the verification request. */
|
|
12
|
+
/** @deprecated The reference ID that was optionally passed together with the verification request. */
|
|
13
13
|
reference?: string;
|
|
14
|
-
/** Free text that the client is sending, used to show if the call/SMS was intercepted or not. */
|
|
14
|
+
/** @deprecated Free text that the client is sending, used to show if the call/SMS was intercepted or not. */
|
|
15
15
|
source?: SourceEnum;
|
|
16
|
-
/** @see Identity */
|
|
16
|
+
/** @deprecated @see Identity */
|
|
17
17
|
identity?: Identity;
|
|
18
18
|
}
|
|
19
19
|
/** @deprecated Use SmsVerificationReportResponse instead */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LinksObject } from '../links-object';
|
|
2
|
+
import { WithAdditionalProperties } from '@sinch/sdk-client';
|
|
2
3
|
export interface StartFlashCallVerificationResponse {
|
|
3
4
|
/** Verification identifier used to query for status. */
|
|
4
5
|
id?: string;
|
|
@@ -9,14 +10,14 @@ export interface StartFlashCallVerificationResponse {
|
|
|
9
10
|
/** @see LinksObject */
|
|
10
11
|
_links?: LinksObject[];
|
|
11
12
|
}
|
|
12
|
-
interface FlashCallContent {
|
|
13
|
-
/** Filter that should be applied for incoming calls to intercept the
|
|
13
|
+
interface FlashCallContent extends WithAdditionalProperties {
|
|
14
|
+
/** Filter that should be applied for incoming calls to intercept the flash call. */
|
|
14
15
|
cliFilter: string;
|
|
15
|
-
/** Amount of seconds client should wait for the
|
|
16
|
+
/** Amount of seconds client should wait for the flash call. */
|
|
16
17
|
interceptionTimeout: number;
|
|
17
18
|
/** The time in seconds allowed for reporting the code after which the verification will expire. */
|
|
18
19
|
reportTimeout?: number;
|
|
19
|
-
/** Used by the SDKs, this setting makes the handset deny the
|
|
20
|
+
/** Used by the mobile SDKs, this setting makes the handset deny the flash call after the set time in seconds. */
|
|
20
21
|
denyCallAfter?: number;
|
|
21
22
|
}
|
|
22
23
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { LinksObject } from '../links-object';
|
|
2
|
+
import { WithAdditionalProperties } from '@sinch/sdk-client';
|
|
3
|
+
import { CodeType } from '../enums';
|
|
2
4
|
export interface StartSmsVerificationResponse {
|
|
3
5
|
/** Verification identifier used to query for status. */
|
|
4
6
|
id?: string;
|
|
@@ -9,10 +11,12 @@ export interface StartSmsVerificationResponse {
|
|
|
9
11
|
/** @see LinksObject */
|
|
10
12
|
_links?: LinksObject[];
|
|
11
13
|
}
|
|
12
|
-
interface SmsContent {
|
|
14
|
+
interface SmsContent extends WithAdditionalProperties {
|
|
13
15
|
/** The expected template for the SMS response. */
|
|
14
16
|
template?: string;
|
|
15
17
|
/** The amount of time in seconds that the client should wait for the SMS. */
|
|
16
18
|
interceptionTimeout?: number;
|
|
19
|
+
/** Accepted values for the type of code to be generated are `Numeric`, `Alpha`, and `Alphanumeric`. Default is `Numeric`. */
|
|
20
|
+
codeType?: CodeType;
|
|
17
21
|
}
|
|
18
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { StartVerificationBase, StartVerificationWithSms, StartVerificationWithFlashCall, StartVerificationWithPhoneCall, StartVerificationWithPhoneCallServerModel, StartVerificationWithCallout, StartDataVerification, StartSeamlessVerification,
|
|
1
|
+
export type { StartVerificationBase, StartVerificationWithSms, StartVerificationWithFlashCall, StartVerificationWithPhoneCall, StartVerificationWithPhoneCallServerModel, StartVerificationWithCallout, StartDataVerification, StartSeamlessVerification, StartVerificationWithWhatsApp, SmsOptions, PhoneCallOptions, CalloutOptions, PhoneCallOptionsSpeech, CalloutOptionsSpeech, FlashCallOptions, WhatsAppOptions, } from './start-verification-request';
|