@sinch/verification 1.1.0 → 1.2.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.
Files changed (165) hide show
  1. package/README.md +22 -16
  2. package/dist/index.js +17 -7
  3. package/dist/index.js.map +1 -1
  4. package/dist/models/v1/enums.d.ts +0 -3
  5. package/dist/models/v1/helper.d.ts +113 -1
  6. package/dist/models/v1/helper.js +157 -0
  7. package/dist/models/v1/helper.js.map +1 -1
  8. package/dist/models/v1/identity/identity.d.ts +4 -4
  9. package/dist/models/v1/identity/index.d.ts +1 -1
  10. package/dist/models/v1/index.d.ts +13 -22
  11. package/dist/models/v1/index.js +24 -22
  12. package/dist/models/v1/index.js.map +1 -1
  13. package/dist/models/v1/{flashcall-request-event-response → mod-callbacks/flashcall-request-event-response}/flashcall-request-event-response.d.ts +6 -5
  14. package/dist/models/v1/mod-callbacks/flashcall-request-event-response/flashcall-request-event-response.js.map +1 -0
  15. package/dist/models/v1/mod-callbacks/flashcall-request-event-response/index.d.ts +1 -0
  16. package/dist/models/v1/mod-callbacks/flashcall-request-event-response/index.js.map +1 -0
  17. package/dist/models/v1/mod-callbacks/index.d.ts +8 -0
  18. package/dist/models/v1/mod-callbacks/index.js +28 -0
  19. package/dist/models/v1/mod-callbacks/index.js.map +1 -0
  20. package/dist/models/v1/mod-callbacks/phonecall-request-event-response/index.d.ts +1 -0
  21. package/dist/models/v1/mod-callbacks/phonecall-request-event-response/index.js.map +1 -0
  22. package/dist/models/v1/mod-callbacks/phonecall-request-event-response/phonecall-request-event-response.d.ts +24 -0
  23. package/dist/models/v1/{callout-request-event-response/callout-request-event-response.js → mod-callbacks/phonecall-request-event-response/phonecall-request-event-response.js} +1 -1
  24. package/dist/models/v1/mod-callbacks/phonecall-request-event-response/phonecall-request-event-response.js.map +1 -0
  25. package/dist/models/v1/mod-callbacks/sms-request-event-response/index.d.ts +1 -0
  26. package/dist/models/v1/mod-callbacks/sms-request-event-response/index.js.map +1 -0
  27. package/dist/models/v1/{sms-request-event-response → mod-callbacks/sms-request-event-response}/sms-request-event-response.d.ts +9 -6
  28. package/dist/models/v1/mod-callbacks/sms-request-event-response/sms-request-event-response.js.map +1 -0
  29. package/dist/models/v1/mod-callbacks/verification-callback-event.d.ts +3 -0
  30. package/dist/models/v1/mod-callbacks/verification-callback-event.js +3 -0
  31. package/dist/models/v1/mod-callbacks/verification-callback-event.js.map +1 -0
  32. package/dist/models/v1/mod-callbacks/verification-request-event/index.d.ts +1 -0
  33. package/dist/models/v1/mod-callbacks/verification-request-event/index.js.map +1 -0
  34. package/dist/models/v1/{verification-request-event → mod-callbacks/verification-request-event}/verification-request-event.d.ts +2 -2
  35. package/dist/models/v1/mod-callbacks/verification-request-event/verification-request-event.js.map +1 -0
  36. package/dist/models/v1/mod-callbacks/verification-request-event-response/index.js.map +1 -0
  37. package/dist/models/v1/mod-callbacks/verification-request-event-response/verification-request-event-response.d.ts +4 -0
  38. package/dist/models/v1/mod-callbacks/verification-request-event-response/verification-request-event-response.js.map +1 -0
  39. package/dist/models/v1/mod-callbacks/verification-result-event/index.js.map +1 -0
  40. package/dist/models/v1/{verification-result-event → mod-callbacks/verification-result-event}/verification-result-event.d.ts +2 -2
  41. package/dist/models/v1/mod-callbacks/verification-result-event/verification-result-event.js.map +1 -0
  42. package/dist/models/v1/mod-callbacks/verification-result-event-response/index.js.map +1 -0
  43. package/dist/models/v1/mod-callbacks/verification-result-event-response/verification-result-event-response.d.ts +4 -0
  44. package/dist/models/v1/mod-callbacks/verification-result-event-response/verification-result-event-response.js.map +1 -0
  45. package/dist/models/v1/phonecall-verification-report-response/index.d.ts +1 -0
  46. package/dist/models/v1/phonecall-verification-report-response/index.js.map +1 -0
  47. package/dist/models/v1/{callout-verification-report-response/callout-verification-report-response.d.ts → phonecall-verification-report-response/phonecall-verification-report-response.d.ts} +3 -1
  48. package/dist/models/v1/{callout-request-event-response-callout/callout-request-event-response-callout.js → phonecall-verification-report-response/phonecall-verification-report-response.js} +1 -1
  49. package/dist/models/v1/phonecall-verification-report-response/phonecall-verification-report-response.js.map +1 -0
  50. package/dist/models/v1/phonecall-verification-status-response/index.d.ts +1 -0
  51. package/dist/models/v1/phonecall-verification-status-response/index.js.map +1 -0
  52. package/dist/models/v1/{callout-verification-status-response/callout-verification-status-response.d.ts → phonecall-verification-status-response/phonecall-verification-status-response.d.ts} +3 -1
  53. package/dist/models/v1/phonecall-verification-status-response/phonecall-verification-status-response.js +3 -0
  54. package/dist/models/v1/phonecall-verification-status-response/phonecall-verification-status-response.js.map +1 -0
  55. package/dist/models/v1/requests/verification-status/verification-status-request-data.d.ts +1 -1
  56. package/dist/models/v1/requests/verifications/verifications-request-data.d.ts +22 -2
  57. package/dist/models/v1/sms-verification-report-response/index.d.ts +1 -1
  58. package/dist/models/v1/sms-verification-report-response/sms-verification-report-response.d.ts +3 -1
  59. package/dist/models/v1/sms-verification-status-response/index.d.ts +1 -1
  60. package/dist/models/v1/sms-verification-status-response/index.js +0 -15
  61. package/dist/models/v1/sms-verification-status-response/index.js.map +1 -1
  62. package/dist/models/v1/sms-verification-status-response/sms-verification-status-response.d.ts +5 -3
  63. package/dist/models/v1/start-data-verification-response/index.d.ts +1 -0
  64. package/dist/models/v1/start-data-verification-response/index.js.map +1 -0
  65. package/dist/models/v1/{start-seamless-verification-response/start-seamless-verification-response.d.ts → start-data-verification-response/start-data-verification-response.d.ts} +3 -1
  66. package/dist/models/v1/start-data-verification-response/start-data-verification-response.js +3 -0
  67. package/dist/models/v1/start-data-verification-response/start-data-verification-response.js.map +1 -0
  68. package/dist/models/v1/start-phonecall-verification-response/index.d.ts +1 -0
  69. package/dist/models/v1/start-phonecall-verification-response/index.js.map +1 -0
  70. package/dist/models/v1/{start-callout-verification-response/start-callout-verification-response.d.ts → start-phonecall-verification-response/start-phonecall-verification-response.d.ts} +3 -1
  71. package/dist/models/v1/start-phonecall-verification-response/start-phonecall-verification-response.js +3 -0
  72. package/dist/models/v1/start-phonecall-verification-response/start-phonecall-verification-response.js.map +1 -0
  73. package/dist/models/v1/start-verification-request/index.d.ts +1 -1
  74. package/dist/models/v1/start-verification-request/start-verification-request.d.ts +22 -5
  75. package/dist/models/v1/verification-price-sms/verification-price-sms.d.ts +3 -1
  76. package/dist/models/v1/verification-report-request/index.d.ts +1 -1
  77. package/dist/models/v1/verification-report-request/verification-report-request.d.ts +12 -1
  78. package/dist/models/v1/verification-status-response/verification-status-response.d.ts +3 -3
  79. package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +5 -5
  80. package/dist/rest/v1/callbacks/callbacks-webhook.js +1 -1
  81. package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
  82. package/dist/rest/v1/verification-status/verification-status-api.jest.fixture.d.ts +0 -1
  83. package/dist/rest/v1/verification-status/verification-status-api.js +5 -1
  84. package/dist/rest/v1/verification-status/verification-status-api.js.map +1 -1
  85. package/dist/rest/v1/verifications/verifications-api.d.ts +34 -3
  86. package/dist/rest/v1/verifications/verifications-api.jest.fixture.d.ts +27 -4
  87. package/dist/rest/v1/verifications/verifications-api.jest.fixture.js +16 -0
  88. package/dist/rest/v1/verifications/verifications-api.jest.fixture.js.map +1 -1
  89. package/dist/rest/v1/verifications/verifications-api.js +156 -13
  90. package/dist/rest/v1/verifications/verifications-api.js.map +1 -1
  91. package/package.json +6 -4
  92. package/dist/models/v1/callout-request-event-response/callout-request-event-response.d.ts +0 -8
  93. package/dist/models/v1/callout-request-event-response/callout-request-event-response.js.map +0 -1
  94. package/dist/models/v1/callout-request-event-response/index.d.ts +0 -1
  95. package/dist/models/v1/callout-request-event-response/index.js.map +0 -1
  96. package/dist/models/v1/callout-request-event-response-callout/callout-request-event-response-callout.d.ts +0 -7
  97. package/dist/models/v1/callout-request-event-response-callout/callout-request-event-response-callout.js.map +0 -1
  98. package/dist/models/v1/callout-request-event-response-callout/index.d.ts +0 -1
  99. package/dist/models/v1/callout-request-event-response-callout/index.js.map +0 -1
  100. package/dist/models/v1/callout-request-event-response-callout-speech/callout-request-event-response-callout-speech.d.ts +0 -7
  101. package/dist/models/v1/callout-request-event-response-callout-speech/callout-request-event-response-callout-speech.js +0 -3
  102. package/dist/models/v1/callout-request-event-response-callout-speech/callout-request-event-response-callout-speech.js.map +0 -1
  103. package/dist/models/v1/callout-request-event-response-callout-speech/index.d.ts +0 -1
  104. package/dist/models/v1/callout-request-event-response-callout-speech/index.js.map +0 -1
  105. package/dist/models/v1/callout-verification-report-response/callout-verification-report-response.js +0 -3
  106. package/dist/models/v1/callout-verification-report-response/callout-verification-report-response.js.map +0 -1
  107. package/dist/models/v1/callout-verification-report-response/index.d.ts +0 -1
  108. package/dist/models/v1/callout-verification-report-response/index.js.map +0 -1
  109. package/dist/models/v1/callout-verification-status-response/callout-verification-status-response.js +0 -3
  110. package/dist/models/v1/callout-verification-status-response/callout-verification-status-response.js.map +0 -1
  111. package/dist/models/v1/callout-verification-status-response/index.d.ts +0 -1
  112. package/dist/models/v1/callout-verification-status-response/index.js +0 -18
  113. package/dist/models/v1/callout-verification-status-response/index.js.map +0 -1
  114. package/dist/models/v1/flashcall-request-event-response/flashcall-request-event-response.js.map +0 -1
  115. package/dist/models/v1/flashcall-request-event-response/index.d.ts +0 -1
  116. package/dist/models/v1/flashcall-request-event-response/index.js.map +0 -1
  117. package/dist/models/v1/sms-request-event-response/index.d.ts +0 -1
  118. package/dist/models/v1/sms-request-event-response/index.js.map +0 -1
  119. package/dist/models/v1/sms-request-event-response/sms-request-event-response.js.map +0 -1
  120. package/dist/models/v1/start-callout-verification-response/index.d.ts +0 -1
  121. package/dist/models/v1/start-callout-verification-response/index.js.map +0 -1
  122. package/dist/models/v1/start-callout-verification-response/start-callout-verification-response.js +0 -3
  123. package/dist/models/v1/start-callout-verification-response/start-callout-verification-response.js.map +0 -1
  124. package/dist/models/v1/start-seamless-verification-response/index.d.ts +0 -1
  125. package/dist/models/v1/start-seamless-verification-response/index.js.map +0 -1
  126. package/dist/models/v1/start-seamless-verification-response/start-seamless-verification-response.js +0 -3
  127. package/dist/models/v1/start-seamless-verification-response/start-seamless-verification-response.js.map +0 -1
  128. package/dist/models/v1/verification-report-response-price/index.d.ts +0 -1
  129. package/dist/models/v1/verification-report-response-price/index.js.map +0 -1
  130. package/dist/models/v1/verification-report-response-price/verification-report-response-price.d.ts +0 -19
  131. package/dist/models/v1/verification-report-response-price/verification-report-response-price.js +0 -3
  132. package/dist/models/v1/verification-report-response-price/verification-report-response-price.js.map +0 -1
  133. package/dist/models/v1/verification-request-event/index.d.ts +0 -1
  134. package/dist/models/v1/verification-request-event/index.js.map +0 -1
  135. package/dist/models/v1/verification-request-event/verification-request-event.js.map +0 -1
  136. package/dist/models/v1/verification-request-event-response/index.js.map +0 -1
  137. package/dist/models/v1/verification-request-event-response/verification-request-event-response.d.ts +0 -4
  138. package/dist/models/v1/verification-request-event-response/verification-request-event-response.js.map +0 -1
  139. package/dist/models/v1/verification-result-event/index.js +0 -3
  140. package/dist/models/v1/verification-result-event/index.js.map +0 -1
  141. package/dist/models/v1/verification-result-event/verification-result-event.js.map +0 -1
  142. package/dist/models/v1/verification-result-event-response/index.js +0 -3
  143. package/dist/models/v1/verification-result-event-response/index.js.map +0 -1
  144. package/dist/models/v1/verification-result-event-response/verification-result-event-response.d.ts +0 -4
  145. package/dist/models/v1/verification-result-event-response/verification-result-event-response.js.map +0 -1
  146. /package/dist/models/v1/{flashcall-request-event-response → mod-callbacks/flashcall-request-event-response}/flashcall-request-event-response.js +0 -0
  147. /package/dist/models/v1/{callout-request-event-response-callout-speech → mod-callbacks/flashcall-request-event-response}/index.js +0 -0
  148. /package/dist/models/v1/{callout-request-event-response-callout → mod-callbacks/phonecall-request-event-response}/index.js +0 -0
  149. /package/dist/models/v1/{callout-request-event-response → mod-callbacks/sms-request-event-response}/index.js +0 -0
  150. /package/dist/models/v1/{sms-request-event-response → mod-callbacks/sms-request-event-response}/sms-request-event-response.js +0 -0
  151. /package/dist/models/v1/{flashcall-request-event-response → mod-callbacks/verification-request-event}/index.js +0 -0
  152. /package/dist/models/v1/{verification-request-event → mod-callbacks/verification-request-event}/verification-request-event.js +0 -0
  153. /package/dist/models/v1/{verification-request-event-response → mod-callbacks/verification-request-event-response}/index.d.ts +0 -0
  154. /package/dist/models/v1/{callout-verification-report-response → mod-callbacks/verification-request-event-response}/index.js +0 -0
  155. /package/dist/models/v1/{verification-request-event-response → mod-callbacks/verification-request-event-response}/verification-request-event-response.js +0 -0
  156. /package/dist/models/v1/{verification-result-event → mod-callbacks/verification-result-event}/index.d.ts +0 -0
  157. /package/dist/models/v1/{start-callout-verification-response → mod-callbacks/verification-result-event}/index.js +0 -0
  158. /package/dist/models/v1/{verification-result-event → mod-callbacks/verification-result-event}/verification-result-event.js +0 -0
  159. /package/dist/models/v1/{verification-result-event-response → mod-callbacks/verification-result-event-response}/index.d.ts +0 -0
  160. /package/dist/models/v1/{sms-request-event-response → mod-callbacks/verification-result-event-response}/index.js +0 -0
  161. /package/dist/models/v1/{verification-result-event-response → mod-callbacks/verification-result-event-response}/verification-result-event-response.js +0 -0
  162. /package/dist/models/v1/{start-seamless-verification-response → phonecall-verification-report-response}/index.js +0 -0
  163. /package/dist/models/v1/{verification-report-response-price → phonecall-verification-status-response}/index.js +0 -0
  164. /package/dist/models/v1/{verification-request-event-response → start-data-verification-response}/index.js +0 -0
  165. /package/dist/models/v1/{verification-request-event → start-phonecall-verification-response}/index.js +0 -0
@@ -1,4 +1,4 @@
1
- import { SMSVerificationStatusResponse } from '../sms-verification-status-response';
1
+ import { SmsVerificationStatusResponse } from '../sms-verification-status-response';
2
2
  import { FlashCallVerificationStatusResponse } from '../flashcall-verification-status-response';
3
- import { CalloutVerificationStatusResponse } from '../callout-verification-status-response';
4
- export type VerificationStatusResponse = SMSVerificationStatusResponse | FlashCallVerificationStatusResponse | CalloutVerificationStatusResponse;
3
+ import { CalloutVerificationStatusResponse, PhoneCallVerificationStatusResponse } from '../phonecall-verification-status-response';
4
+ export type VerificationStatusResponse = SmsVerificationStatusResponse | FlashCallVerificationStatusResponse | CalloutVerificationStatusResponse | PhoneCallVerificationStatusResponse;
@@ -1,9 +1,9 @@
1
- /// <reference types="node" />
2
- import { VerificationRequestEvent, VerificationResultEvent } from '../../../models';
1
+ import { VerificationCallbackEvent, VerificationRequestEvent, VerificationResultEvent } from '../../../models';
3
2
  import { CallbackProcessor, SinchClientParameters } from '@sinch/sdk-client';
4
3
  import { IncomingHttpHeaders } from 'http';
4
+ /** @deprecated Use Verification.VerificationCallback instead */
5
5
  export type VerificationCallback = VerificationRequestEvent | VerificationResultEvent;
6
- export declare class VerificationCallbackWebhooks implements CallbackProcessor<VerificationCallback> {
6
+ export declare class VerificationCallbackWebhooks implements CallbackProcessor<VerificationCallbackEvent> {
7
7
  private readonly sinchClientParameters;
8
8
  constructor(sinchClientParameters: SinchClientParameters);
9
9
  /**
@@ -19,7 +19,7 @@ export declare class VerificationCallbackWebhooks implements CallbackProcessor<V
19
19
  * Reviver for a Verification Event.
20
20
  * This method ensures the object can be treated as a Verification Event and should be called before any action is taken to manipulate the object.
21
21
  * @param {any} eventBody - The event body containing the verification event notification.
22
- * @return {VerificationCallback} - The parsed verification event object.
22
+ * @return {VerificationCallbackEvent} - The parsed verification event object.
23
23
  */
24
- parseEvent(eventBody: any): VerificationCallback;
24
+ parseEvent(eventBody: any): VerificationCallbackEvent;
25
25
  }
@@ -24,7 +24,7 @@ class VerificationCallbackWebhooks {
24
24
  * Reviver for a Verification Event.
25
25
  * This method ensures the object can be treated as a Verification Event and should be called before any action is taken to manipulate the object.
26
26
  * @param {any} eventBody - The event body containing the verification event notification.
27
- * @return {VerificationCallback} - The parsed verification event object.
27
+ * @return {VerificationCallbackEvent} - The parsed verification event object.
28
28
  */
29
29
  parseEvent(eventBody) {
30
30
  if (eventBody.event) {
@@ -1 +1 @@
1
- {"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;AACA,kDAA2G;AAK3G,MAAa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ACrD,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,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;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;AApDD,oEAoDC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="jest" />
2
1
  import { VerificationStatusApi } from './verification-status-api';
3
2
  import { VerificationStatusResponse, VerificationStatusByIdRequestData, VerificationStatusByIdentityRequestData, VerificationStatusByReferenceRequestData } from '../../../models';
4
3
  export declare class VerificationStatusApiFixture implements Partial<Readonly<VerificationStatusApi>> {
@@ -47,8 +47,12 @@ class VerificationStatusApi extends verification_domain_api_1.VerificationDomain
47
47
  'Content-Type': 'application/json',
48
48
  'Accept': 'application/json',
49
49
  };
50
+ let verificationMethod = data['method'];
51
+ if (verificationMethod === 'phonecall') {
52
+ verificationMethod = 'callout';
53
+ }
50
54
  const body = '';
51
- const path = `/verification/v1/verifications/${data['method']}/number/${data['endpoint']}`;
55
+ const path = `/verification/v1/verifications/${verificationMethod}/number/${data['endpoint']}`;
52
56
  const basePathUrl = this.client.apiClientOptions.hostname + path;
53
57
  const requestOptions = await this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined, path);
54
58
  const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
@@ -1 +1 @@
1
- {"version":3,"file":"verification-status-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/verification-status/verification-status-api.ts"],"names":[],"mappings":";;;AAUA,wEAAmE;AAEnE,MAAa,qBAAsB,SAAQ,+CAAqB;IAE9D;;;;OAIG;IACH,YAAY,qBAA4C;QACtD,KAAK,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC;IACxD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,IAAuC;QAC1D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAoC,IAAI,EAAE,EAAa,CAAC,CAAC;QACzG,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,qCAAqC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEjE,MAAM,cAAc,GAChB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE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,OAAO;YACrB,WAAW,EAAE,8BAA8B;SAC5C,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,cAAc,CAAC,IAA8C;QACxE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAA2C,IAAI,EAAE,EAAa,CAAC,CAAC;QAChH,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,4CAA4C,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7E,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEjE,MAAM,cAAc,GAChB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;QACtG,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;QAExF,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAA6B;YACzD,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,+BAA+B;SAC7C,CAAC,CAAC;IACL,CAAC;CAEF;AAlGD,sDAkGC"}
1
+ {"version":3,"file":"verification-status-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/verification-status/verification-status-api.ts"],"names":[],"mappings":";;;AAUA,wEAAmE;AAEnE,MAAa,qBAAsB,SAAQ,+CAAqB;IAE9D;;;;OAIG;IACH,YAAY,qBAA4C;QACtD,KAAK,CAAC,qBAAqB,EAAE,u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MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEjE,MAAM,cAAc,GAChB,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;QACtG,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;QAExF,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAA6B;YACzD,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,+BAA+B;SAC7C,CAAC,CAAC;IACL,CAAC;CAEF;AAvGD,sDAuGC"}
@@ -1,4 +1,4 @@
1
- import { StartCalloutVerificationResponse, CalloutVerificationReportResponse, StartSeamlessVerificationResponse, StartFlashCallVerificationResponse, FlashCallVerificationReportResponse, StartSmsVerificationResponse, SMSVerificationReportResponse, ReportSmsVerificationByIdRequestData, ReportFlashCallVerificationByIdRequestData, ReportCalloutVerificationByIdRequestData, ReportSmsVerificationByIdentityRequestData, ReportFlashCallVerificationByIdentityRequestData, ReportCalloutVerificationByIdentityRequestData, StartSmsVerificationRequestData, StartFlashCallVerificationRequestData, StartCalloutVerificationRequestData, StartSeamlessVerificationRequestData, StartVerificationWithSms } from '../../../models';
1
+ import { StartCalloutVerificationResponse, CalloutVerificationReportResponse, StartSeamlessVerificationResponse, StartFlashCallVerificationResponse, FlashCallVerificationReportResponse, StartSmsVerificationResponse, SmsVerificationReportResponse, ReportSmsVerificationByIdRequestData, ReportFlashCallVerificationByIdRequestData, ReportCalloutVerificationByIdRequestData, ReportSmsVerificationByIdentityRequestData, ReportFlashCallVerificationByIdentityRequestData, ReportCalloutVerificationByIdentityRequestData, StartSmsVerificationRequestData, StartFlashCallVerificationRequestData, StartCalloutVerificationRequestData, StartSeamlessVerificationRequestData, StartVerificationWithSms, StartPhoneCallVerificationRequestData, StartPhoneCallVerificationResponse, StartVerificationWithPhoneCall, StartDataVerificationRequestData, StartDataVerificationResponse, ReportPhoneCallVerificationByIdRequestData, PhoneCallVerificationReportRequest, StartVerificationWithPhoneCallServerModel, PhoneCallVerificationReportRequestServerModel, ReportPhoneCallVerificationByIdentityRequestData, PhoneCallVerificationReportResponse } from '../../../models';
2
2
  import { SinchClientParameters } from '@sinch/sdk-client';
3
3
  import { VerificationDomainApi } from '../verification-domain-api';
4
4
  export declare class VerificationsApi extends VerificationDomainApi {
@@ -13,17 +13,25 @@ export declare class VerificationsApi extends VerificationDomainApi {
13
13
  * Report the received verification code to verify it, using the Verification ID of the Verification request.
14
14
  * @param { ReportSmsVerificationByIdRequestData } data - The data to provide to the API call.
15
15
  */
16
- reportSmsById(data: ReportSmsVerificationByIdRequestData): Promise<SMSVerificationReportResponse>;
16
+ reportSmsById(data: ReportSmsVerificationByIdRequestData): Promise<SmsVerificationReportResponse>;
17
17
  /**
18
18
  * Report a FlashCall verification with ID
19
19
  * Report the received verification code to verify it, using the Verification ID of the Verification request.
20
20
  * @param { ReportFlashCallVerificationByIdRequestData } data - The data to provide to the API call.
21
21
  */
22
22
  reportFlashCallById(data: ReportFlashCallVerificationByIdRequestData): Promise<FlashCallVerificationReportResponse>;
23
+ /**
24
+ * Report a Phone Call verification with ID
25
+ * Report the received verification code to verify it, using the Verification ID of the Verification request.
26
+ * @param { ReportCalloutVerificationByIdRequestData } data - The data to provide to the API call.
27
+ */
28
+ reportPhoneCallById(data: ReportPhoneCallVerificationByIdRequestData): Promise<PhoneCallVerificationReportResponse>;
29
+ performReportPhoneCallByIdRequestBodyTransformation(body: PhoneCallVerificationReportRequest): PhoneCallVerificationReportRequestServerModel;
23
30
  /**
24
31
  * Report a Callout verification with ID
25
32
  * Report the received verification code to verify it, using the Verification ID of the Verification request.
26
33
  * @param { ReportCalloutVerificationByIdRequestData } data - The data to provide to the API call.
34
+ * @deprecated Use the method reportPhoneCallById() instead
27
35
  */
28
36
  reportCalloutById(data: ReportCalloutVerificationByIdRequestData): Promise<CalloutVerificationReportResponse>;
29
37
  /**
@@ -31,17 +39,25 @@ export declare class VerificationsApi extends VerificationDomainApi {
31
39
  * Report the received verification code (OTP) to verify it, using the identity of the user (in most cases, the phone number).
32
40
  * @param { ReportSmsVerificationByIdentityRequestData } data - The data to provide to the API call.
33
41
  */
34
- reportSmsByIdentity(data: ReportSmsVerificationByIdentityRequestData): Promise<SMSVerificationReportResponse>;
42
+ reportSmsByIdentity(data: ReportSmsVerificationByIdentityRequestData): Promise<SmsVerificationReportResponse>;
35
43
  /**
36
44
  * Report a FlashCall verification using Identity
37
45
  * Report the received verification code (CLI) to verify it, using the identity of the user (in most cases, the phone number).
38
46
  * @param { ReportFlashCallVerificationByIdentityRequestData } data - The data to provide to the API call.
39
47
  */
40
48
  reportFlashCallByIdentity(data: ReportFlashCallVerificationByIdentityRequestData): Promise<FlashCallVerificationReportResponse>;
49
+ /**
50
+ * Report a Phone Call verification using Identity
51
+ * Report the received verification code (OTP) to verify it, using the identity of the user (in most cases, the phone number).
52
+ * @param { ReportPhoneCallVerificationByIdentityRequestData } data - The data to provide to the API call.
53
+ */
54
+ reportPhoneCallByIdentity(data: ReportPhoneCallVerificationByIdentityRequestData): Promise<PhoneCallVerificationReportResponse>;
55
+ performReportPhoneCallByIdentityRequestBodyTransformation(body: PhoneCallVerificationReportRequest): PhoneCallVerificationReportRequestServerModel;
41
56
  /**
42
57
  * Report a Callout verification using Identity
43
58
  * Report the received verification code (OTP) to verify it, using the identity of the user (in most cases, the phone number).
44
59
  * @param { ReportCalloutVerificationByIdentityRequestData } data - The data to provide to the API call.
60
+ * @deprecated Use the method reportPhoneCallByIdentity() instead
45
61
  */
46
62
  reportCalloutByIdentity(data: ReportCalloutVerificationByIdentityRequestData): Promise<CalloutVerificationReportResponse>;
47
63
  /**
@@ -58,16 +74,31 @@ export declare class VerificationsApi extends VerificationDomainApi {
58
74
  * @param { StartFlashCallVerificationRequestData } data - The data to provide to the API call.
59
75
  */
60
76
  startFlashCall(data: StartFlashCallVerificationRequestData): Promise<StartFlashCallVerificationResponse>;
77
+ /**
78
+ * Start verification with a phone call
79
+ * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
80
+ * @param { StartPhoneCallVerificationRequestData } data - The data to provide to the API call.
81
+ */
82
+ startPhoneCall(data: StartPhoneCallVerificationRequestData): Promise<StartPhoneCallVerificationResponse>;
83
+ performStartPhoneCallRequestBodyTransformation(body: StartVerificationWithPhoneCall): StartVerificationWithPhoneCallServerModel;
84
+ /**
85
+ * Start data verification
86
+ * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
87
+ * @param { StartDataVerificationRequestData } data - The data to provide to the API call.
88
+ */
89
+ startData(data: StartDataVerificationRequestData): Promise<StartDataVerificationResponse>;
61
90
  /**
62
91
  * Start verification with a callout
63
92
  * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
64
93
  * @param { StartCalloutVerificationRequestData } data - The data to provide to the API call.
94
+ * @deprecated Use the method startPhoneCall() instead
65
95
  */
66
96
  startCallout(data: StartCalloutVerificationRequestData): Promise<StartCalloutVerificationResponse>;
67
97
  /**
68
98
  * Start seamless verification (= data verification)
69
99
  * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
70
100
  * @param { StartSeamlessVerificationRequestData } data - The data to provide to the API call.
101
+ * @deprecated Use the method startData() instead
71
102
  */
72
103
  startSeamless(data: StartSeamlessVerificationRequestData): Promise<StartSeamlessVerificationResponse>;
73
104
  }
@@ -1,11 +1,10 @@
1
- /// <reference types="jest" />
2
1
  import { VerificationsApi } from './verifications-api';
3
- import { StartCalloutVerificationResponse, CalloutVerificationReportResponse, StartSeamlessVerificationResponse, StartFlashCallVerificationResponse, FlashCallVerificationReportResponse, StartSmsVerificationResponse, SMSVerificationReportResponse, StartSmsVerificationRequestData, StartFlashCallVerificationRequestData, StartCalloutVerificationRequestData, StartSeamlessVerificationRequestData, ReportSmsVerificationByIdRequestData, ReportCalloutVerificationByIdRequestData, ReportFlashCallVerificationByIdRequestData, ReportSmsVerificationByIdentityRequestData, ReportFlashCallVerificationByIdentityRequestData, ReportCalloutVerificationByIdentityRequestData } from '../../../models';
2
+ import { StartCalloutVerificationResponse, CalloutVerificationReportResponse, StartSeamlessVerificationResponse, StartFlashCallVerificationResponse, FlashCallVerificationReportResponse, StartSmsVerificationResponse, SmsVerificationReportResponse, StartSmsVerificationRequestData, StartFlashCallVerificationRequestData, StartCalloutVerificationRequestData, StartSeamlessVerificationRequestData, ReportSmsVerificationByIdRequestData, ReportCalloutVerificationByIdRequestData, ReportFlashCallVerificationByIdRequestData, ReportSmsVerificationByIdentityRequestData, ReportFlashCallVerificationByIdentityRequestData, ReportCalloutVerificationByIdentityRequestData, StartDataVerificationRequestData, StartPhoneCallVerificationResponse, StartPhoneCallVerificationRequestData, StartDataVerificationResponse, ReportPhoneCallVerificationByIdRequestData, ReportPhoneCallVerificationByIdentityRequestData, PhoneCallVerificationReportResponse } from '../../../models';
4
3
  export declare class VerificationsApiFixture implements Partial<Readonly<VerificationsApi>> {
5
4
  /**
6
5
  * Fixture associated to function reportSmsById
7
6
  */
8
- reportSmsById: jest.Mock<Promise<SMSVerificationReportResponse>, [
7
+ reportSmsById: jest.Mock<Promise<SmsVerificationReportResponse>, [
9
8
  ReportSmsVerificationByIdRequestData
10
9
  ]>;
11
10
  /**
@@ -14,6 +13,12 @@ export declare class VerificationsApiFixture implements Partial<Readonly<Verific
14
13
  reportFlashCallById: jest.Mock<Promise<FlashCallVerificationReportResponse>, [
15
14
  ReportFlashCallVerificationByIdRequestData
16
15
  ]>;
16
+ /**
17
+ * Fixture associated to function reportPhoneCallById
18
+ */
19
+ reportPhoneCallById: jest.Mock<Promise<PhoneCallVerificationReportResponse>, [
20
+ ReportPhoneCallVerificationByIdRequestData
21
+ ]>;
17
22
  /**
18
23
  * Fixture associated to function reportCalloutById
19
24
  */
@@ -23,7 +28,7 @@ export declare class VerificationsApiFixture implements Partial<Readonly<Verific
23
28
  /**
24
29
  * Fixture associated to function reportSmsByIdentity
25
30
  */
26
- reportSmsByIdentity: jest.Mock<Promise<SMSVerificationReportResponse>, [
31
+ reportSmsByIdentity: jest.Mock<Promise<SmsVerificationReportResponse>, [
27
32
  ReportSmsVerificationByIdentityRequestData
28
33
  ]>;
29
34
  /**
@@ -32,6 +37,12 @@ export declare class VerificationsApiFixture implements Partial<Readonly<Verific
32
37
  reportFlashCallByIdentity: jest.Mock<Promise<FlashCallVerificationReportResponse>, [
33
38
  ReportFlashCallVerificationByIdentityRequestData
34
39
  ]>;
40
+ /**
41
+ * Fixture associated to function reportPhoneCallByIdentity
42
+ */
43
+ reportPhoneCallByIdentity: jest.Mock<Promise<PhoneCallVerificationReportResponse>, [
44
+ ReportPhoneCallVerificationByIdentityRequestData
45
+ ]>;
35
46
  /**
36
47
  * Fixture associated to function reportCalloutByIdentity
37
48
  */
@@ -50,6 +61,18 @@ export declare class VerificationsApiFixture implements Partial<Readonly<Verific
50
61
  startFlashCall: jest.Mock<Promise<StartFlashCallVerificationResponse>, [
51
62
  StartFlashCallVerificationRequestData
52
63
  ]>;
64
+ /**
65
+ * Fixture associated to function startPhoneCall
66
+ */
67
+ startPhoneCall: jest.Mock<Promise<StartPhoneCallVerificationResponse>, [
68
+ StartPhoneCallVerificationRequestData
69
+ ]>;
70
+ /**
71
+ * Fixture associated to function startData
72
+ */
73
+ startData: jest.Mock<Promise<StartDataVerificationResponse>, [
74
+ StartDataVerificationRequestData
75
+ ]>;
53
76
  /**
54
77
  * Fixture associated to function startCallout
55
78
  */
@@ -11,6 +11,10 @@ class VerificationsApiFixture {
11
11
  * Fixture associated to function reportFlashCallById
12
12
  */
13
13
  this.reportFlashCallById = jest.fn();
14
+ /**
15
+ * Fixture associated to function reportPhoneCallById
16
+ */
17
+ this.reportPhoneCallById = jest.fn();
14
18
  /**
15
19
  * Fixture associated to function reportCalloutById
16
20
  */
@@ -23,6 +27,10 @@ class VerificationsApiFixture {
23
27
  * Fixture associated to function reportFlashCallByIdentity
24
28
  */
25
29
  this.reportFlashCallByIdentity = jest.fn();
30
+ /**
31
+ * Fixture associated to function reportPhoneCallByIdentity
32
+ */
33
+ this.reportPhoneCallByIdentity = jest.fn();
26
34
  /**
27
35
  * Fixture associated to function reportCalloutByIdentity
28
36
  */
@@ -35,6 +43,14 @@ class VerificationsApiFixture {
35
43
  * Fixture associated to function startFlashCall
36
44
  */
37
45
  this.startFlashCall = jest.fn();
46
+ /**
47
+ * Fixture associated to function startPhoneCall
48
+ */
49
+ this.startPhoneCall = jest.fn();
50
+ /**
51
+ * Fixture associated to function startData
52
+ */
53
+ this.startData = jest.fn();
38
54
  /**
39
55
  * Fixture associated to function startCallout
40
56
  */
@@ -1 +1 @@
1
- {"version":3,"file":"verifications-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v1/verifications/verifications-api.jest.fixture.ts"],"names":[],"mappings":";;;AAqBA,MAAa,uBAAuB;IAApC;QAEE;;WAEG;QACI,kBAAa,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACtD;;WAEG;QACI,wBAAmB,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QAC5D;;WAEG;QACI,sBAAiB,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QAC1D;;WAEG;QACI,wBAAmB,GAG0B,IAAI,CAAC,EAAE,EAAE,CAAC;QAC9D;;WAEG;QACI,8BAAyB,GAG0B,IAAI,CAAC,EAAE,EAAE,CAAC;QACpE;;WAEG;QACI,4BAAuB,GAG0B,IAAI,CAAC,EAAE,EAAE,CAAC;QAClE;;WAEG;QACI,aAAQ,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACjD;;WAEG;QACI,mBAAc,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACvD;;WAEG;QACI,iBAAY,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACrD;;WAEG;QACI,kBAAa,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;IACxD,CAAC;CAAA;AAjED,0DAiEC"}
1
+ {"version":3,"file":"verifications-api.jest.fixture.js","sourceRoot":"","sources":["../../../../src/rest/v1/verifications/verifications-api.jest.fixture.ts"],"names":[],"mappings":";;;AA4BA,MAAa,uBAAuB;IAApC;QAEE;;WAEG;QACI,kBAAa,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACtD;;WAEG;QACI,wBAAmB,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QAC5D;;WAEG;QACI,wBAAmB,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QAC5D;;WAEG;QACI,sBAAiB,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QAC1D;;WAEG;QACI,wBAAmB,GAG0B,IAAI,CAAC,EAAE,EAAE,CAAC;QAC9D;;WAEG;QACI,8BAAyB,GAG0B,IAAI,CAAC,EAAE,EAAE,CAAC;QACpE;;WAEG;QACI,8BAAyB,GAG0B,IAAI,CAAC,EAAE,EAAE,CAAC;QACpE;;WAEG;QACI,4BAAuB,GAG0B,IAAI,CAAC,EAAE,EAAE,CAAC;QAClE;;WAEG;QACI,aAAQ,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACjD;;WAEG;QACI,mBAAc,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACvD;;WAEG;QACI,mBAAc,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACvD;;WAEG;QACI,cAAS,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QAClD;;WAEG;QACI,iBAAY,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;QACrD;;WAEG;QACI,kBAAa,GAEwB,IAAI,CAAC,EAAE,EAAE,CAAC;IACxD,CAAC;CAAA;AA1FD,0DA0FC"}
@@ -21,7 +21,7 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
21
21
  data.reportSmsVerificationByIdRequestBody.method = 'sms';
22
22
  const getParams = this.client.extractQueryParams(data, []);
23
23
  const headers = {
24
- 'Content-Type': 'application/json; charset=UTF-8',
24
+ 'Content-Type': 'application/json',
25
25
  'Accept': 'application/json',
26
26
  };
27
27
  const body = data['reportSmsVerificationByIdRequestBody']
@@ -45,10 +45,10 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
45
45
  */
46
46
  async reportFlashCallById(data) {
47
47
  this.client = this.getSinchClient();
48
- data.reportFlashCallVerificationByIdRequestBody.method = 'flashCall';
48
+ data.reportFlashCallVerificationByIdRequestBody.method = 'flashcall';
49
49
  const getParams = this.client.extractQueryParams(data, []);
50
50
  const headers = {
51
- 'Content-Type': 'application/json; charset=UTF-8',
51
+ 'Content-Type': 'application/json',
52
52
  'Accept': 'application/json',
53
53
  };
54
54
  const body = data['reportFlashCallVerificationByIdRequestBody']
@@ -65,17 +65,53 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
65
65
  operationId: 'ReportFlashCallVerificationById',
66
66
  });
67
67
  }
68
+ /**
69
+ * Report a Phone Call verification with ID
70
+ * Report the received verification code to verify it, using the Verification ID of the Verification request.
71
+ * @param { ReportCalloutVerificationByIdRequestData } data - The data to provide to the API call.
72
+ */
73
+ async reportPhoneCallById(data) {
74
+ this.client = this.getSinchClient();
75
+ data.reportPhoneCallVerificationByIdRequestBody.method = 'callout';
76
+ const getParams = this.client.extractQueryParams(data, []);
77
+ const headers = {
78
+ 'Content-Type': 'application/json',
79
+ 'Accept': 'application/json',
80
+ };
81
+ // Special fields handling: see method for details
82
+ const requestDataBody = this.performReportPhoneCallByIdRequestBodyTransformation(data.reportPhoneCallVerificationByIdRequestBody);
83
+ const body = requestDataBody
84
+ ? JSON.stringify(requestDataBody)
85
+ : '{}';
86
+ const path = `/verification/v1/verifications/id/${data['id']}`;
87
+ const basePathUrl = this.client.apiClientOptions.hostname + path;
88
+ const requestOptions = await this.client.prepareOptions(basePathUrl, 'PUT', getParams, headers, body || undefined, path);
89
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
90
+ return this.client.processCall({
91
+ url,
92
+ requestOptions,
93
+ apiName: this.apiName,
94
+ operationId: 'ReportPhoneCallVerificationById',
95
+ });
96
+ }
97
+ performReportPhoneCallByIdRequestBodyTransformation(body) {
98
+ const requestDataBody = { ...body };
99
+ (requestDataBody).callout = { ...requestDataBody.phoneCall };
100
+ delete requestDataBody.phoneCall;
101
+ return requestDataBody;
102
+ }
68
103
  /**
69
104
  * Report a Callout verification with ID
70
105
  * Report the received verification code to verify it, using the Verification ID of the Verification request.
71
106
  * @param { ReportCalloutVerificationByIdRequestData } data - The data to provide to the API call.
107
+ * @deprecated Use the method reportPhoneCallById() instead
72
108
  */
73
109
  async reportCalloutById(data) {
74
110
  this.client = this.getSinchClient();
75
111
  data.reportCalloutVerificationByIdRequestBody.method = 'callout';
76
112
  const getParams = this.client.extractQueryParams(data, []);
77
113
  const headers = {
78
- 'Content-Type': 'application/json; charset=UTF-8',
114
+ 'Content-Type': 'application/json',
79
115
  'Accept': 'application/json',
80
116
  };
81
117
  const body = data['reportCalloutVerificationByIdRequestBody']
@@ -102,7 +138,7 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
102
138
  data.reportSmsVerificationByIdentityRequestBody.method = 'sms';
103
139
  const getParams = this.client.extractQueryParams(data, []);
104
140
  const headers = {
105
- 'Content-Type': 'application/json; charset=UTF-8',
141
+ 'Content-Type': 'application/json',
106
142
  'Accept': 'application/json',
107
143
  };
108
144
  const body = data['reportSmsVerificationByIdentityRequestBody']
@@ -126,10 +162,10 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
126
162
  */
127
163
  async reportFlashCallByIdentity(data) {
128
164
  this.client = this.getSinchClient();
129
- data.reportFlashCallVerificationByIdentityRequestBody.method = 'flashCall';
165
+ data.reportFlashCallVerificationByIdentityRequestBody.method = 'flashcall';
130
166
  const getParams = this.client.extractQueryParams(data, []);
131
167
  const headers = {
132
- 'Content-Type': 'application/json; charset=UTF-8',
168
+ 'Content-Type': 'application/json',
133
169
  'Accept': 'application/json',
134
170
  };
135
171
  const body = data['reportFlashCallVerificationByIdentityRequestBody']
@@ -146,17 +182,53 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
146
182
  operationId: 'ReportFlashCallVerificationByIdentity',
147
183
  });
148
184
  }
185
+ /**
186
+ * Report a Phone Call verification using Identity
187
+ * Report the received verification code (OTP) to verify it, using the identity of the user (in most cases, the phone number).
188
+ * @param { ReportPhoneCallVerificationByIdentityRequestData } data - The data to provide to the API call.
189
+ */
190
+ async reportPhoneCallByIdentity(data) {
191
+ this.client = this.getSinchClient();
192
+ data.reportPhoneCallVerificationByIdentityRequestBody.method = 'callout';
193
+ const getParams = this.client.extractQueryParams(data, []);
194
+ const headers = {
195
+ 'Content-Type': 'application/json',
196
+ 'Accept': 'application/json',
197
+ };
198
+ // Special fields handling: see method for details
199
+ const requestDataBody = this.performReportPhoneCallByIdentityRequestBodyTransformation(data.reportPhoneCallVerificationByIdentityRequestBody);
200
+ const body = requestDataBody
201
+ ? JSON.stringify(requestDataBody)
202
+ : '{}';
203
+ const path = `/verification/v1/verifications/number/${data['endpoint']}`;
204
+ const basePathUrl = this.client.apiClientOptions.hostname + path;
205
+ const requestOptions = await this.client.prepareOptions(basePathUrl, 'PUT', getParams, headers, body || undefined, path);
206
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
207
+ return this.client.processCall({
208
+ url,
209
+ requestOptions,
210
+ apiName: this.apiName,
211
+ operationId: 'ReportPhoneCallVerificationByIdentity',
212
+ });
213
+ }
214
+ performReportPhoneCallByIdentityRequestBodyTransformation(body) {
215
+ const requestDataBody = { ...body };
216
+ (requestDataBody).callout = { ...requestDataBody.phoneCall };
217
+ delete requestDataBody.phoneCall;
218
+ return requestDataBody;
219
+ }
149
220
  /**
150
221
  * Report a Callout verification using Identity
151
222
  * Report the received verification code (OTP) to verify it, using the identity of the user (in most cases, the phone number).
152
223
  * @param { ReportCalloutVerificationByIdentityRequestData } data - The data to provide to the API call.
224
+ * @deprecated Use the method reportPhoneCallByIdentity() instead
153
225
  */
154
226
  async reportCalloutByIdentity(data) {
155
227
  this.client = this.getSinchClient();
156
228
  data.reportCalloutVerificationByIdentityRequestBody.method = 'callout';
157
229
  const getParams = this.client.extractQueryParams(data, []);
158
230
  const headers = {
159
- 'Content-Type': 'application/json; charset=UTF-8',
231
+ 'Content-Type': 'application/json',
160
232
  'Accept': 'application/json',
161
233
  };
162
234
  const body = data['reportCalloutVerificationByIdentityRequestBody']
@@ -183,9 +255,12 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
183
255
  data.startVerificationWithSmsRequestBody.method = 'sms';
184
256
  const getParams = this.client.extractQueryParams(data, []);
185
257
  const headers = {
186
- 'Content-Type': 'application/json; charset=UTF-8',
258
+ 'Content-Type': 'application/json',
187
259
  'Accept': 'application/json',
188
260
  };
261
+ if (data.startVerificationWithSmsRequestBody.smsOptions?.locale !== undefined) {
262
+ headers['Accept-Language'] = data.startVerificationWithSmsRequestBody.smsOptions.locale;
263
+ }
189
264
  // Special fields handling: see method for details
190
265
  const requestDataBody = this.performStartSmsRequestBodyTransformation(data.startVerificationWithSmsRequestBody);
191
266
  const body = requestDataBody
@@ -210,6 +285,8 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
210
285
  requestDataBody.smsOptions.expiry = this.formatTime(expiry);
211
286
  }
212
287
  }
288
+ // Remove the `locale` property from the body as it is used as a header parameter for the API call
289
+ delete requestDataBody.smsOptions?.locale;
213
290
  return requestDataBody;
214
291
  }
215
292
  formatTime(date) {
@@ -227,10 +304,10 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
227
304
  */
228
305
  async startFlashCall(data) {
229
306
  this.client = this.getSinchClient();
230
- data.startVerificationWithFlashCallRequestBody.method = 'flashCall';
307
+ data.startVerificationWithFlashCallRequestBody.method = 'flashcall';
231
308
  const getParams = this.client.extractQueryParams(data, []);
232
309
  const headers = {
233
- 'Content-Type': 'application/json; charset=UTF-8',
310
+ 'Content-Type': 'application/json',
234
311
  'Accept': 'application/json',
235
312
  };
236
313
  const body = data['startVerificationWithFlashCallRequestBody']
@@ -247,17 +324,82 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
247
324
  operationId: 'StartVerificationWithFlashCall',
248
325
  });
249
326
  }
327
+ /**
328
+ * Start verification with a phone call
329
+ * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
330
+ * @param { StartPhoneCallVerificationRequestData } data - The data to provide to the API call.
331
+ */
332
+ async startPhoneCall(data) {
333
+ this.client = this.getSinchClient();
334
+ data.startVerificationWithPhoneCallRequestBody.method = 'callout';
335
+ const getParams = this.client.extractQueryParams(data, []);
336
+ const headers = {
337
+ 'Content-Type': 'application/json',
338
+ 'Accept': 'application/json',
339
+ };
340
+ // Special fields handling: see method for details
341
+ const requestDataBody = this.performStartPhoneCallRequestBodyTransformation(data.startVerificationWithPhoneCallRequestBody);
342
+ const body = requestDataBody
343
+ ? JSON.stringify(requestDataBody)
344
+ : '{}';
345
+ const path = '/verification/v1/verifications';
346
+ const basePathUrl = this.client.apiClientOptions.hostname + path;
347
+ const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined, path);
348
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
349
+ return this.client.processCall({
350
+ url,
351
+ requestOptions,
352
+ apiName: this.apiName,
353
+ operationId: 'StartVerificationWithPhoneCall',
354
+ });
355
+ }
356
+ performStartPhoneCallRequestBodyTransformation(body) {
357
+ const requestDataBody = { ...body };
358
+ if (requestDataBody.phoneCallOptions !== undefined) {
359
+ requestDataBody.calloutOptions = { ...requestDataBody.phoneCallOptions };
360
+ delete requestDataBody.phoneCallOptions;
361
+ }
362
+ return requestDataBody;
363
+ }
364
+ /**
365
+ * Start data verification
366
+ * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
367
+ * @param { StartDataVerificationRequestData } data - The data to provide to the API call.
368
+ */
369
+ async startData(data) {
370
+ this.client = this.getSinchClient();
371
+ data.startDataVerificationRequestBody.method = 'seamless';
372
+ const getParams = this.client.extractQueryParams(data, []);
373
+ const headers = {
374
+ 'Content-Type': 'application/json',
375
+ 'Accept': 'application/json',
376
+ };
377
+ const body = data['startDataVerificationRequestBody']
378
+ ? JSON.stringify(data['startDataVerificationRequestBody'])
379
+ : '{}';
380
+ const path = '/verification/v1/verifications';
381
+ const basePathUrl = this.client.apiClientOptions.hostname + path;
382
+ const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined, path);
383
+ const url = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
384
+ return this.client.processCall({
385
+ url,
386
+ requestOptions,
387
+ apiName: this.apiName,
388
+ operationId: 'StartDataVerification',
389
+ });
390
+ }
250
391
  /**
251
392
  * Start verification with a callout
252
393
  * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
253
394
  * @param { StartCalloutVerificationRequestData } data - The data to provide to the API call.
395
+ * @deprecated Use the method startPhoneCall() instead
254
396
  */
255
397
  async startCallout(data) {
256
398
  this.client = this.getSinchClient();
257
399
  data.startVerificationWithCalloutRequestBody.method = 'callout';
258
400
  const getParams = this.client.extractQueryParams(data, []);
259
401
  const headers = {
260
- 'Content-Type': 'application/json; charset=UTF-8',
402
+ 'Content-Type': 'application/json',
261
403
  'Accept': 'application/json',
262
404
  };
263
405
  const body = data['startVerificationWithCalloutRequestBody']
@@ -278,13 +420,14 @@ class VerificationsApi extends verification_domain_api_1.VerificationDomainApi {
278
420
  * Start seamless verification (= data verification)
279
421
  * This method is used by the mobile and web Verification SDKs to start a verification. It can also be used to request a verification from your backend, by making a request.
280
422
  * @param { StartSeamlessVerificationRequestData } data - The data to provide to the API call.
423
+ * @deprecated Use the method startData() instead
281
424
  */
282
425
  async startSeamless(data) {
283
426
  this.client = this.getSinchClient();
284
427
  data.startSeamlessVerificationRequestBody.method = 'seamless';
285
428
  const getParams = this.client.extractQueryParams(data, []);
286
429
  const headers = {
287
- 'Content-Type': 'application/json; charset=UTF-8',
430
+ 'Content-Type': 'application/json',
288
431
  'Accept': 'application/json',
289
432
  };
290
433
  const body = data['startSeamlessVerificationRequestBody']