@sinch/voice 1.2.1 → 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/answering-machine-detection/answering-machine-detection.d.ts +8 -0
- package/dist/models/v1/answering-machine-detection/answering-machine-detection.js +3 -0
- package/dist/models/v1/answering-machine-detection/answering-machine-detection.js.map +1 -0
- package/dist/models/v1/answering-machine-detection/index.d.ts +1 -0
- package/dist/models/v1/answering-machine-detection/index.js.map +1 -0
- package/dist/models/v1/assign-numbers/assign-numbers.d.ts +2 -1
- package/dist/models/v1/conference-callout-request/conference-callout-request.d.ts +8 -8
- package/dist/models/v1/conference-dtmf-options/conference-dtmf-options.d.ts +2 -2
- package/dist/models/v1/custom-callout-request/custom-callout-request.d.ts +6 -6
- package/dist/models/v1/destination/destination.d.ts +52 -4
- package/dist/models/v1/destination/index.d.ts +1 -1
- package/dist/models/v1/enums.d.ts +21 -4
- package/dist/models/v1/get-call-information/get-call-information.d.ts +3 -3
- package/dist/models/v1/get-callbacks/get-callbacks.d.ts +3 -0
- package/dist/models/v1/get-conference-info-response/get-conference-info-response.d.ts +1 -1
- package/dist/models/v1/helper.d.ts +5 -1
- package/dist/models/v1/helper.js +9 -0
- package/dist/models/v1/helper.js.map +1 -1
- package/dist/models/v1/index.d.ts +1 -1
- package/dist/models/v1/index.js +1 -1
- package/dist/models/v1/index.js.map +1 -1
- package/dist/models/v1/list-numbers-response/list-numbers-response.d.ts +2 -1
- package/dist/models/v1/manage-conference-participant-request/manage-conference-participant-request.d.ts +1 -1
- package/dist/models/v1/menu/menu.d.ts +3 -3
- package/dist/models/v1/mod-callbacks/ace-request/ace-request.d.ts +2 -9
- package/dist/models/v1/mod-callbacks/ace-request/index.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/dice-request/dice-request.d.ts +7 -6
- package/dist/models/v1/mod-callbacks/dice-request/index.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/ice-request/ice-request.d.ts +6 -5
- package/dist/models/v1/mod-callbacks/ice-response/ice-response.d.ts +2 -2
- package/dist/models/v1/mod-callbacks/notify-request/notify-request.d.ts +5 -10
- package/dist/models/v1/mod-callbacks/pie-request/index.d.ts +1 -1
- package/dist/models/v1/mod-callbacks/pie-request/pie-request.d.ts +2 -3
- package/dist/models/v1/mod-svaml/index.d.ts +1 -0
- package/dist/models/v1/mod-svaml/index.js +1 -0
- package/dist/models/v1/mod-svaml/index.js.map +1 -1
- package/dist/models/v1/mod-svaml/svaml-action-connect-conf/svaml-action-connect-conf.d.ts +2 -2
- package/dist/models/v1/mod-svaml/svaml-action-connect-mxp/svaml-action-connect-mxp.d.ts +4 -4
- package/dist/models/v1/mod-svaml/svaml-action-connect-pstn/svaml-action-connect-pstn.d.ts +2 -2
- package/dist/models/v1/mod-svaml/svaml-action-connect-sip/index.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-action-connect-sip/svaml-action-connect-sip.d.ts +6 -11
- package/dist/models/v1/mod-svaml/svaml-action-connect-stream/index.d.ts +1 -0
- package/dist/models/v1/{participant/participant.js → mod-svaml/svaml-action-connect-stream/index.js} +1 -1
- package/dist/models/v1/mod-svaml/svaml-action-connect-stream/index.js.map +1 -0
- package/dist/models/v1/mod-svaml/svaml-action-connect-stream/svaml-action-connect-stream.d.ts +27 -0
- package/dist/models/v1/mod-svaml/svaml-action-connect-stream/svaml-action-connect-stream.js +3 -0
- package/dist/models/v1/mod-svaml/svaml-action-connect-stream/svaml-action-connect-stream.js.map +1 -0
- package/dist/models/v1/mod-svaml/svaml-action-continue/svaml-action-continue.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-action-hangup/svaml-action-hangup.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-action-park/svaml-action-park.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-action-run-menu/svaml-action-run-menu.d.ts +2 -2
- package/dist/models/v1/mod-svaml/svaml-instruction/svaml-instruction.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-instruction-play-files/svaml-instruction-play-files.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-instruction-say/svaml-instruction-say.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-instruction-start-recording/svaml-instruction-start-recording.d.ts +1 -1
- package/dist/models/v1/option/option.d.ts +5 -1
- package/dist/models/v1/query-number-response/query-number-response.d.ts +5 -2
- package/dist/models/v1/requests/calls/calls-request-data.d.ts +1 -1
- package/dist/models/v1/tts-callout-request/tts-callout-request.d.ts +4 -4
- package/dist/models/v1/unassign-numbers/unassign-numbers.d.ts +1 -1
- package/dist/rest/v1/applications/applications-api.d.ts +3 -8
- package/dist/rest/v1/applications/applications-api.js +3 -14
- package/dist/rest/v1/applications/applications-api.js.map +1 -1
- package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +7 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.js +13 -0
- package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
- package/dist/rest/v1/callouts/callouts-api.d.ts +2 -7
- package/dist/rest/v1/callouts/callouts-api.js +2 -10
- package/dist/rest/v1/callouts/callouts-api.js.map +1 -1
- package/dist/rest/v1/calls/calls-api.d.ts +2 -7
- package/dist/rest/v1/calls/calls-api.js +2 -10
- package/dist/rest/v1/calls/calls-api.js.map +1 -1
- package/dist/rest/v1/conferences/conferences-api.d.ts +2 -7
- package/dist/rest/v1/conferences/conferences-api.js +3 -12
- package/dist/rest/v1/conferences/conferences-api.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/voice-domain-api.d.ts +14 -12
- package/dist/rest/v1/voice-domain-api.js +30 -48
- package/dist/rest/v1/voice-domain-api.js.map +1 -1
- package/dist/rest/v1/voice-service.d.ts +24 -1
- package/dist/rest/v1/voice-service.js +93 -12
- package/dist/rest/v1/voice-service.js.map +1 -1
- package/package.json +2 -2
- package/dist/models/v1/participant/index.d.ts +0 -1
- package/dist/models/v1/participant/index.js.map +0 -1
- package/dist/models/v1/participant/participant.d.ts +0 -9
- package/dist/models/v1/participant/participant.js.map +0 -1
- /package/dist/models/v1/{participant → answering-machine-detection}/index.js +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AnsweringMachineDetection } from '../../answering-machine-detection';
|
|
1
2
|
/**
|
|
2
3
|
* The request body of a Notify Event.
|
|
3
4
|
*/
|
|
@@ -14,16 +15,10 @@ export interface NotifyRequest {
|
|
|
14
15
|
type?: NotifyRequestType;
|
|
15
16
|
/** An optional parameter containing notification-specific information. */
|
|
16
17
|
custom?: string;
|
|
17
|
-
/** The
|
|
18
|
-
amd?:
|
|
18
|
+
/** The results of the detection and/or the beep detection. */
|
|
19
|
+
amd?: AnsweringMachineDetection;
|
|
20
|
+
/** The URL where the recording or transcription is available */
|
|
21
|
+
destination?: string;
|
|
19
22
|
}
|
|
20
23
|
type NotifyRequestType = 'recording_finished' | 'recording_available' | 'transcription_available' | 'amd' | 'amd_beep' | string;
|
|
21
|
-
interface AmdStatus {
|
|
22
|
-
/** */
|
|
23
|
-
status?: 'machine' | 'human' | string;
|
|
24
|
-
/** */
|
|
25
|
-
reason?: 'greeting' | 'beep' | 'n/a' | string;
|
|
26
|
-
/** */
|
|
27
|
-
duration?: number;
|
|
28
|
-
}
|
|
29
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { PieRequest, MenuResult
|
|
1
|
+
export type { PieRequest, MenuResult } from './pie-request';
|
|
@@ -21,10 +21,9 @@ export interface MenuResult {
|
|
|
21
21
|
/** The ID of the menu that triggered the prompt input event. */
|
|
22
22
|
menuId?: string;
|
|
23
23
|
/** The type of information that's returned. */
|
|
24
|
-
type?:
|
|
24
|
+
type?: 'error' | 'return' | 'sequence' | 'timeout' | 'hangup' | 'invalidinput' | string;
|
|
25
25
|
/** The value of the returned information. */
|
|
26
26
|
value?: string;
|
|
27
27
|
/** The type of input received. */
|
|
28
|
-
inputMethod?: string;
|
|
28
|
+
inputMethod?: 'dtmf' | 'voice' | string;
|
|
29
29
|
}
|
|
30
|
-
export type PieInformationType = 'error' | 'return' | 'sequence' | 'timeout' | 'hangup' | 'invalidinput';
|
|
@@ -3,6 +3,7 @@ export * from './svaml-action-connect-conf';
|
|
|
3
3
|
export * from './svaml-action-connect-mxp';
|
|
4
4
|
export * from './svaml-action-connect-pstn';
|
|
5
5
|
export * from './svaml-action-connect-sip';
|
|
6
|
+
export * from './svaml-action-connect-stream';
|
|
6
7
|
export * from './svaml-action-continue';
|
|
7
8
|
export * from './svaml-action-hangup';
|
|
8
9
|
export * from './svaml-action-park';
|
|
@@ -19,6 +19,7 @@ __exportStar(require("./svaml-action-connect-conf"), exports);
|
|
|
19
19
|
__exportStar(require("./svaml-action-connect-mxp"), exports);
|
|
20
20
|
__exportStar(require("./svaml-action-connect-pstn"), exports);
|
|
21
21
|
__exportStar(require("./svaml-action-connect-sip"), exports);
|
|
22
|
+
__exportStar(require("./svaml-action-connect-stream"), exports);
|
|
22
23
|
__exportStar(require("./svaml-action-continue"), exports);
|
|
23
24
|
__exportStar(require("./svaml-action-hangup"), exports);
|
|
24
25
|
__exportStar(require("./svaml-action-park"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/mod-svaml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8DAA4C;AAC5C,6DAA2C;AAC3C,8DAA4C;AAC5C,6DAA2C;AAC3C,0DAAwC;AACxC,wDAAsC;AACtC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,6DAA2C;AAC3C,iEAA+C;AAC/C,0DAAwC;AACxC,gEAA8C;AAC9C,iEAA+C;AAC/C,sEAAoD;AACpD,qEAAmD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/mod-svaml/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8DAA4C;AAC5C,6DAA2C;AAC3C,8DAA4C;AAC5C,6DAA2C;AAC3C,gEAA8C;AAC9C,0DAAwC;AACxC,wDAAsC;AACtC,sDAAoC;AACpC,0DAAwC;AACxC,sDAAoC;AACpC,6DAA2C;AAC3C,iEAA+C;AAC/C,0DAAwC;AACxC,gEAA8C;AAC9C,iEAA+C;AAC/C,sEAAoD;AACpD,qEAAmD"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ConferenceDtmfOptions } from '../../conference-dtmf-options';
|
|
2
2
|
import { MusicOnHold } from '../../enums';
|
|
3
3
|
/**
|
|
4
|
-
* Connects an incoming call to a conference. Available to use in a response to an [Incoming Call Event](
|
|
4
|
+
* Connects an incoming call to a conference. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback.
|
|
5
5
|
*/
|
|
6
6
|
export interface SvamlActionConnectConf {
|
|
7
7
|
/** The name property. Must have the value `connectConf`. */
|
|
8
8
|
name: 'connectConf';
|
|
9
9
|
/** The unique identifier of the conference. Shouldn't exceed 64 characters. */
|
|
10
10
|
conferenceId: string;
|
|
11
|
-
/** Options to control how DTMF signals are used by the participant in the conference. For information on how to use this feature, read more [here](
|
|
11
|
+
/** Options to control how DTMF signals are used by the participant in the conference. For information on how to use this feature, read more [here](https://developers.sinch.com/docs/voice/api-reference/conference-dtmf). */
|
|
12
12
|
conferenceDtmfOptions?: ConferenceDtmfOptions;
|
|
13
13
|
/** Means "music on hold". If this optional parameter is included, plays music to the first participant in a conference while they're alone and waiting for other participants to join. If `moh` isn't specified, the user will only hear silence while alone in the conference. */
|
|
14
14
|
moh?: MusicOnHold;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CallHeader } from '../../call-header';
|
|
2
|
-
import {
|
|
2
|
+
import { DestinationMxp } from '../../destination';
|
|
3
3
|
/**
|
|
4
|
-
* Determines how an application-to-application call is connected. Available to use in a response to an [Incoming Call Event](
|
|
4
|
+
* Determines how an application-to-application call is connected. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback.
|
|
5
5
|
*/
|
|
6
6
|
export interface SvamlActionConnectMxp {
|
|
7
7
|
/** The name property. Must have the value `connectMxp`. */
|
|
8
8
|
name: 'connectMxp';
|
|
9
9
|
/** Allows you to specify or override the final destination of the call. If the final destination of the call is not dialed, this is a required parameter. */
|
|
10
|
-
destination?:
|
|
11
|
-
/** An optional parameter that allows you to specify or override call headers provided to the receiving Sinch SDK client. Read more about call headers [here](
|
|
10
|
+
destination?: DestinationMxp;
|
|
11
|
+
/** An optional parameter that allows you to specify or override call headers provided to the receiving Sinch SDK client. Read more about call headers [here](https://developers.sinch.com/docs/voice/api-reference/call-headers/). */
|
|
12
12
|
callHeaders?: CallHeader[];
|
|
13
13
|
}
|
|
14
14
|
export type ConnectMxpProps = Omit<SvamlActionConnectMxp, 'name'>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Determines how a PSTN call is connected. Available to use in a response to an [Incoming Call Event](
|
|
2
|
+
* Determines how a PSTN call is connected. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback.
|
|
3
3
|
*/
|
|
4
4
|
export interface SvamlActionConnectPstn {
|
|
5
5
|
/** The name property. Must have the value `connectPstn`. */
|
|
@@ -14,7 +14,7 @@ export interface SvamlActionConnectPstn {
|
|
|
14
14
|
dialTimeout?: number;
|
|
15
15
|
/** Used to override the CLI (or caller ID) of the client. The phone number of the person who initiated the call is shown as the CLI. To set your own CLI, you may use your verified number or your Dashboard virtual number. */
|
|
16
16
|
cli?: string;
|
|
17
|
-
/** If enabled, suppresses [ACE](
|
|
17
|
+
/** If enabled, suppresses [ACE](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ace) and [DICE](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/dice) callbacks for the call. */
|
|
18
18
|
suppressCallbacks?: boolean;
|
|
19
19
|
/** A string that determines the DTMF tones to play to the callee when the call is picked up. Valid characters are: `0-9`, `#`, and `w`. `w` renders a 500ms pause. For example, the string `ww1234#w#`, plays a 1-second pause, the DTMF tones for `1`, `2`, `3`, `4`, and `#`, followed by a 500ms pause and finally the `#` tone. This is useful if the callout destination requires a conference PIN code or an extension. If there is a calling party, it will hear progress while the DTMF is sent. */
|
|
20
20
|
dtmf?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { SvamlActionConnectSip,
|
|
1
|
+
export type { SvamlActionConnectSip, ConnectSipProps } from './svaml-action-connect-sip';
|
|
@@ -1,30 +1,25 @@
|
|
|
1
1
|
import { CallHeader } from '../../call-header';
|
|
2
2
|
import { MusicOnHold } from '../../enums';
|
|
3
|
+
import { DestinationSip } from '../../destination';
|
|
3
4
|
/**
|
|
4
|
-
* Determines how to route a call to a SIP server. Available to use in a response to an [Incoming Call Event](
|
|
5
|
+
* Determines how to route a call to a SIP server. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback.
|
|
5
6
|
*/
|
|
6
7
|
export interface SvamlActionConnectSip {
|
|
7
8
|
/** The name property. Must have the value `connectSip`. */
|
|
8
9
|
name: 'connectSip';
|
|
9
10
|
/** Specifies where to route the SIP call. */
|
|
10
|
-
destination:
|
|
11
|
+
destination: DestinationSip;
|
|
11
12
|
/** The max duration of the call in seconds (max 14400 seconds). If the call is still connected at that time, it will be automatically disconnected. */
|
|
12
13
|
maxDuration?: number;
|
|
13
14
|
/** Used to override the CLI (or caller ID) of the client. The phone number of the person who initiated the call is shown as the CLI. To set your own CLI, you may use your verified number or your Dashboard virtual number. */
|
|
14
15
|
cli?: string;
|
|
15
16
|
/** An optional parameter to specify the SIP transport protocol. If unspecified, UDP is used. */
|
|
16
|
-
transport?: 'udp' | 'tcp' | 'tls';
|
|
17
|
-
/** If enabled, suppresses [ACE](
|
|
17
|
+
transport?: 'udp' | 'tcp' | 'tls' | 'UDP' | 'TCP' | 'TLS' | string;
|
|
18
|
+
/** If enabled, suppresses [ACE](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ace) and [DICE](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/dice) callbacks for the call. */
|
|
18
19
|
suppressCallbacks?: boolean;
|
|
19
|
-
/** [Private SIP headers](
|
|
20
|
+
/** [Private SIP headers](https://developers.sinch.com/docs/voice/api-reference/sip-trunking/#receiving-calls-from-sinch-platform-to-your-sip-infrastructure) to send with the call. */
|
|
20
21
|
callHeaders?: CallHeader[];
|
|
21
22
|
/** Means \"music on hold\". If this optional parameter is included, plays music to the connected participant if the SIP call is placed on hold. If `moh` isn't specified and the SIP call is placed on hold, the user will only hear silence while during the holding period . */
|
|
22
23
|
moh?: MusicOnHold;
|
|
23
24
|
}
|
|
24
|
-
export interface SipDestination {
|
|
25
|
-
/** The SIP address. */
|
|
26
|
-
endpoint: string;
|
|
27
|
-
/** */
|
|
28
|
-
type?: 'Sip';
|
|
29
|
-
}
|
|
30
25
|
export type ConnectSipProps = Omit<SvamlActionConnectSip, 'name'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { SvamlActionConnectStream, ConnectStreamProps, StreamingOptions } from './svaml-action-connect-stream';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/models/v1/mod-svaml/svaml-action-connect-stream/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CallHeader } from '../../call-header';
|
|
2
|
+
import { DestinationStream } from '../../destination';
|
|
3
|
+
/**
|
|
4
|
+
* Determines how to route a call to a Stream/websocket server. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback.
|
|
5
|
+
*/
|
|
6
|
+
export interface SvamlActionConnectStream {
|
|
7
|
+
/** The name property. Must have the value `connectStream`. */
|
|
8
|
+
name: 'connectStream';
|
|
9
|
+
/** Specifies where to route the Stream call. */
|
|
10
|
+
destination: DestinationStream;
|
|
11
|
+
/** @see StreamingOptions */
|
|
12
|
+
streamingOptions?: StreamingOptions;
|
|
13
|
+
/** The max duration of the call in seconds (max 14400 seconds). If the call is still connected at that time, it will be automatically disconnected. */
|
|
14
|
+
maxDuration?: number;
|
|
15
|
+
/** "These custom parameters (headers/messages) are sent to your WebSocket server in the initial message when the ConnectStream is established." */
|
|
16
|
+
callHeaders?: CallHeader[];
|
|
17
|
+
}
|
|
18
|
+
export type ConnectStreamProps = Omit<SvamlActionConnectStream, 'name'>;
|
|
19
|
+
/**
|
|
20
|
+
* Optional parameters for the WebSocket stream.
|
|
21
|
+
*/
|
|
22
|
+
export interface StreamingOptions {
|
|
23
|
+
/** The version of the streaming feature. */
|
|
24
|
+
version?: number;
|
|
25
|
+
/** The sample rate for the audio stream in Hz. */
|
|
26
|
+
sampleRate?: number;
|
|
27
|
+
}
|
package/dist/models/v1/mod-svaml/svaml-action-connect-stream/svaml-action-connect-stream.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svaml-action-connect-stream.js","sourceRoot":"","sources":["../../../../../src/models/v1/mod-svaml/svaml-action-connect-stream/svaml-action-connect-stream.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Continues to set up a call. Available to use in a response to an [Answered Call Event](
|
|
2
|
+
* Continues to set up a call. Available to use in a response to an [Answered Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ace) callback.
|
|
3
3
|
*/
|
|
4
4
|
export interface SvamlActionContinue {
|
|
5
5
|
/** The name property. Must have the value `continue`. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Hangs up a call. Available to use in a response to an [Incoming Call Event](
|
|
2
|
+
* Hangs up a call. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback or an [Answered Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ace) callback.
|
|
3
3
|
*/
|
|
4
4
|
export interface SvamlActionHangup {
|
|
5
5
|
/** The name property. Must have the value `hangup`. */
|
|
@@ -5,7 +5,7 @@ import { TtsVoice } from '../../enums';
|
|
|
5
5
|
export interface SvamlActionPark {
|
|
6
6
|
/** The name property. Must have the value `park`. */
|
|
7
7
|
name: 'park';
|
|
8
|
-
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](
|
|
8
|
+
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales). */
|
|
9
9
|
locale?: TtsVoice;
|
|
10
10
|
/** That prompt that is played when the call is first answered. You can use text-to-speech using the `#tts[]` element, SSML commands using the `#ssml[]` element. */
|
|
11
11
|
introPrompt?: string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Menu } from '../../menu';
|
|
2
2
|
import { TtsVoice } from '../../enums';
|
|
3
3
|
/**
|
|
4
|
-
* Plays an interactive voice response (IVR) menu to the callee. This menu can play pre-recorded files or text-to-speech messages, collect DTMF tones, and trigger the [Prompt Input Event](
|
|
4
|
+
* Plays an interactive voice response (IVR) menu to the callee. This menu can play pre-recorded files or text-to-speech messages, collect DTMF tones, and trigger the [Prompt Input Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/pie) (PIE) callback towards your backend, notifying you of the actions the callee took. Available to use in a response to an [Incoming Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ice) callback or an [Answered Call Event](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/#tag/Callbacks/operation/ace) callback. Also be used in combination with the [Conferences](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Conferences/#tag/Conferences) endpoint of the Calling API.
|
|
5
5
|
*/
|
|
6
6
|
export interface SvamlActionRunMenu {
|
|
7
7
|
/** The name property. Must have the value `runMenu`. */
|
|
8
8
|
name: 'runMenu';
|
|
9
9
|
/** 'Barging' means that the user can press a DTMF digit before the prompt has finished playing. If a valid input is pressed, the message will stop playing and accept the input. If `barge` is disabled, the user must listen to the entire prompt before input is accepted. By default, barging is enabled. */
|
|
10
10
|
barge?: boolean;
|
|
11
|
-
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](
|
|
11
|
+
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales). If using the `enableVoice` to enable voice detection, the `locale` property is required in order to select the input language. */
|
|
12
12
|
locale?: TtsVoice;
|
|
13
13
|
/** Selects the menu item from the `menus` array to play first. */
|
|
14
14
|
mainMenu?: string;
|
|
@@ -6,6 +6,6 @@ import { SvamlInstructionSetCookie } from '../svaml-instruction-set-cookie';
|
|
|
6
6
|
import { SvamlInstructionStartRecording } from '../svaml-instruction-start-recording';
|
|
7
7
|
import { SvamlInstructionStopRecording } from '../svaml-instruction-stop-recording';
|
|
8
8
|
/**
|
|
9
|
-
* Instructions allow an application to play a message or file, start recording, and various other tasks. For more information about instructions, see the [SVAML](
|
|
9
|
+
* Instructions allow an application to play a message or file, start recording, and various other tasks. For more information about instructions, see the [SVAML](https://developers.sinch.com/docs/voice/api-reference/svaml/) documentation.
|
|
10
10
|
*/
|
|
11
11
|
export type SvamlInstruction = SvamlInstructionPlayFiles | SvamlInstructionSay | SvamlInstructionSendDtmf | SvamlInstructionSetCookie | SvamlInstructionAnswer | SvamlInstructionStartRecording | SvamlInstructionStopRecording;
|
package/dist/models/v1/mod-svaml/svaml-instruction-play-files/svaml-instruction-play-files.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface SvamlInstructionPlayFiles {
|
|
|
7
7
|
name: 'playFiles';
|
|
8
8
|
/** The IDs of the files which will be played. These can be a URL to a file, SSML commands using the `#ssml[]` element, or text using the `#tts[]` element. */
|
|
9
9
|
ids: string[];
|
|
10
|
-
/** If using SSML or TTS, this is a required field. The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](
|
|
10
|
+
/** If using SSML or TTS, this is a required field. The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales). */
|
|
11
11
|
locale?: TtsVoice;
|
|
12
12
|
}
|
|
13
13
|
export type PlayFilesProps = Omit<SvamlInstructionPlayFiles, 'name'>;
|
|
@@ -7,7 +7,7 @@ export interface SvamlInstructionSay {
|
|
|
7
7
|
name: 'say';
|
|
8
8
|
/** Contains the message that will be spoken. Default maximum length is 600 characters. To change this limit, please contact support. */
|
|
9
9
|
text?: string;
|
|
10
|
-
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](
|
|
10
|
+
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales). */
|
|
11
11
|
locale?: TtsVoice;
|
|
12
12
|
}
|
|
13
13
|
export type SayProps = Omit<SvamlInstructionSay, 'name'>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
export interface SvamlInstructionStartRecording {
|
|
5
5
|
/** The `name` property. Must have the value `startRecording`. */
|
|
6
6
|
name: 'startRecording';
|
|
7
|
-
/** An object that specifies details about the recording. For more details, see [Recording Options](
|
|
7
|
+
/** An object that specifies details about the recording. For more details, see [Recording Options](https://developers.sinch.com/docs/voice/api-reference/recording/#recording-options). */
|
|
8
8
|
options?: StartRecordingOptions;
|
|
9
9
|
}
|
|
10
10
|
export interface StartRecordingOptions {
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
export interface Option {
|
|
5
5
|
/** A DTMF digit the user can press to trigger the configured action. */
|
|
6
6
|
dtmf: string;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Determines which action is taken when the DTMF digit is pressed. The following values are accepted:
|
|
9
|
+
* - If you want to navigate to another menu, use `menu(value)`.
|
|
10
|
+
* - If you want to perform another behavior you have coded in your application, use `return(value)`, where `(value)` is the name of the method you want to execute.
|
|
11
|
+
*/
|
|
8
12
|
action: string;
|
|
9
13
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { VoicePrice } from '../voice-price';
|
|
2
2
|
export interface QueryNumberResponse {
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The type of method.
|
|
5
|
+
* @deprecated To remove in V2
|
|
6
|
+
*/
|
|
4
7
|
method?: string;
|
|
5
8
|
/** The number details object. */
|
|
6
9
|
number?: NumberDetails;
|
|
@@ -9,7 +12,7 @@ export interface NumberDetails {
|
|
|
9
12
|
/** The ISO 3166-1 formatted country code. */
|
|
10
13
|
countryId?: string;
|
|
11
14
|
/** The type of the number. */
|
|
12
|
-
numberType?: 'Unknown' | 'Fixed' | 'Mobile' | 'Other';
|
|
15
|
+
numberType?: 'Unknown' | 'Fixed' | 'Mobile' | 'Other' | string;
|
|
13
16
|
/** The number in E.164 format. */
|
|
14
17
|
normalizedNumber?: string;
|
|
15
18
|
/** Concerns whether the call is restricted or not. */
|
|
@@ -7,7 +7,7 @@ export interface ManageWithCallLegRequestData {
|
|
|
7
7
|
/** The unique identifier of the call. This value is generated by the system. */
|
|
8
8
|
'callId': string;
|
|
9
9
|
/** Specifies which part of the call will be managed. This option is used only by the `PlayFiles` and `Say` instructions to indicate which channel the sound will be played on. Valid options are `caller`, `callee` or `both`. If not specified, the default value is `caller`.</br><Warning>The `callLeg` identifier is ignored for calls that are part of a conference and calls initiated using the Callout API.</Warning> */
|
|
10
|
-
'callLeg': 'caller' | 'callee' | 'both';
|
|
10
|
+
'callLeg': 'caller' | 'callee' | 'both' | string;
|
|
11
11
|
/** */
|
|
12
12
|
'manageWithCallLegRequestBody'?: SVAMLRequestBody;
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CalloutDestination } from '../destination';
|
|
2
2
|
import { TtsVoice } from '../enums';
|
|
3
3
|
/**
|
|
4
4
|
* The text-to-speech callout calls a phone number and plays a synthesized text messages or pre-recorded sound files.
|
|
@@ -7,18 +7,18 @@ export interface TtsCalloutRequest {
|
|
|
7
7
|
/** The number that will be displayed as the incoming caller. To set your own CLI, you may use your verified number or your Dashboard number. The number must be in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format. */
|
|
8
8
|
cli?: string;
|
|
9
9
|
/** The type of device and number or endpoint to call. */
|
|
10
|
-
destination:
|
|
10
|
+
destination: CalloutDestination;
|
|
11
11
|
/** When the destination picks up, this DTMF tones will be played to the callee. Valid characters in the string are "0"-"9", "#", and "w". A "w" will render a 500 ms pause. For example, "ww1234#w#" will render a 1s pause, the DTMF tones "1", "2", "3", "4" and "#" followed by a 0.5s pause and finally the DTMF tone for "#". This can be used if the callout destination for instance require a conference PIN code or an extension to be entered. */
|
|
12
12
|
dtmf?: string;
|
|
13
13
|
/** Can be either `pstn` for PSTN endpoint or `mxp` for data (app or web) clients. */
|
|
14
14
|
domain?: 'pstn' | 'mxp';
|
|
15
15
|
/** Can be used to input custom data. */
|
|
16
16
|
custom?: string;
|
|
17
|
-
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](
|
|
17
|
+
/** The voice and language you want to use for the text-to-speech message. This can either be defined by the ISO 639 locale and language code or by specifying a particular voice. Supported languages and voices are detailed [here](https://developers.sinch.com/docs/voice/api-reference/voice-locales/). */
|
|
18
18
|
locale?: TtsVoice;
|
|
19
19
|
/** The text that will be spoken in the text-to-speech message. _Every application's default maximum characters allowed in text-to-speech is 600 characters. Contact support if you wish this limit to be changed._ */
|
|
20
20
|
text?: string;
|
|
21
|
-
/** An advanced alternative to using ```text```. __TTS__ _Text To Speech:_ The equivalent of text but within the prompt property. Example: _```#tts[Hello from Sinch]```_ __TTS with SSML__ _Text To Speech with Speech Synthesis Markup Language (SSML)._ This is an XML-based markup language for assisting the generation of synthetic speech in the Web and other applications. AWS Polly supports a sub-set of SSML. This allows us to use SSML-enhanced text for additional control over how Polly generates speech from the text. Details and examples of supported tags are [here](https://docs.aws.amazon.com/polly/latest/dg/supportedtags.html) __Externally hosted media:__ Provide a URL to your own hosted media. Please check [here](
|
|
21
|
+
/** An advanced alternative to using ```text```. __TTS__ _Text To Speech:_ The equivalent of text but within the prompt property. Example: _```#tts[Hello from Sinch]```_ __TTS with SSML__ _Text To Speech with Speech Synthesis Markup Language (SSML)._ This is an XML-based markup language for assisting the generation of synthetic speech in the Web and other applications. AWS Polly supports a sub-set of SSML. This allows us to use SSML-enhanced text for additional control over how Polly generates speech from the text. Details and examples of supported tags are [here](https://docs.aws.amazon.com/polly/latest/dg/supportedtags.html) __Externally hosted media:__ Provide a URL to your own hosted media. Please check [here](https://developers.sinch.com/docs/voice/api-reference/supported-audio-formats/#limits) to read about audio content type and usage limits. _Every application\'s default maximum allowed in TTS or TTS SSML is 600 characters. Contact support if you wish this limit to be changed._ _Several prompts can be used, separated by a semi-colon_ ```;``` Example: _```#tts[Hello from Sinch];#ssml[<speak><break time=\\\"250ms\\\"/>Have a great day!</speak>]```_ */
|
|
22
22
|
prompts?: string;
|
|
23
23
|
/** If `enableAce` is set to `true` and the application has a callback URL specified, you will receive an ACE callback when the call is answered. When the callback is received, your platform must respond with a svamlet, containing the “connectconf” action in order to add the call to a conference or create the conference if it's the first call. If it's set to `false`, no ACE event will be sent to your backend. */
|
|
24
24
|
enableAce?: boolean;
|
|
@@ -4,5 +4,5 @@ export interface UnassignNumbers {
|
|
|
4
4
|
/** Indicates the application where the number(s) was assigned. If empty, the application key that is used to sign the request will be used. */
|
|
5
5
|
applicationkey?: string;
|
|
6
6
|
/** (optional) indicates the DID capability that was assigned to the chosen application. Please note that the DID needs to support the selected capability. */
|
|
7
|
-
capability?: 'voice' | 'sms';
|
|
7
|
+
capability?: 'voice' | 'sms' | string;
|
|
8
8
|
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { AssignNumbersRequestData, GetCallbacks, GetCallbackURLsRequestData, GetNumbersRequestData, ListNumbersResponse, QueryNumberRequestData, QueryNumberResponse, UnassignNumberRequestData, UpdateCallbackURLsRequestData } from '../../../models';
|
|
2
|
-
import { SinchClientParameters } from '@sinch/sdk-client';
|
|
3
2
|
import { VoiceDomainApi } from '../voice-domain-api';
|
|
3
|
+
import { LazyVoiceApplicationManagementApiClient } from '../voice-service';
|
|
4
4
|
export declare class ApplicationsApi extends VoiceDomainApi {
|
|
5
|
-
|
|
6
|
-
* Initialize your interface
|
|
7
|
-
*
|
|
8
|
-
* @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
|
|
9
|
-
*/
|
|
10
|
-
constructor(sinchClientParameters: SinchClientParameters);
|
|
5
|
+
constructor(lazyClient: LazyVoiceApplicationManagementApiClient);
|
|
11
6
|
/**
|
|
12
7
|
* Query number
|
|
13
8
|
* Returns information about the requested number.
|
|
@@ -25,7 +20,7 @@ export declare class ApplicationsApi extends VoiceDomainApi {
|
|
|
25
20
|
* Get information about your numbers. It returns a list of numbers that you own, as well as their capability (voice or SMS). For the ones that are assigned to an app, it returns the application key of the app.
|
|
26
21
|
* @param { GetNumbersRequestData } data - The data to provide to the API call.
|
|
27
22
|
*/
|
|
28
|
-
listNumbers(data
|
|
23
|
+
listNumbers(data?: GetNumbersRequestData): Promise<ListNumbersResponse>;
|
|
29
24
|
/**
|
|
30
25
|
* Un-assign number
|
|
31
26
|
* Un-assign a number from an application.
|
|
@@ -3,13 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ApplicationsApi = void 0;
|
|
4
4
|
const voice_domain_api_1 = require("../voice-domain-api");
|
|
5
5
|
class ApplicationsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
|
|
10
|
-
*/
|
|
11
|
-
constructor(sinchClientParameters) {
|
|
12
|
-
super(sinchClientParameters, 'ApplicationsApi');
|
|
6
|
+
constructor(lazyClient) {
|
|
7
|
+
super(lazyClient, 'ApplicationsApi');
|
|
13
8
|
}
|
|
14
9
|
/**
|
|
15
10
|
* Query number
|
|
@@ -17,7 +12,6 @@ class ApplicationsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
17
12
|
* @param { QueryNumberRequestData } data - The data to provide to the API call.
|
|
18
13
|
*/
|
|
19
14
|
async queryNumber(data) {
|
|
20
|
-
this.client = this.getSinchClient();
|
|
21
15
|
const getParams = this.client.extractQueryParams(data, []);
|
|
22
16
|
const headers = {
|
|
23
17
|
'Content-Type': 'application/json',
|
|
@@ -42,7 +36,6 @@ class ApplicationsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
42
36
|
* @param { GetCallbackURLsRequestData } data - The data to provide to the API call.
|
|
43
37
|
*/
|
|
44
38
|
async getCallbackURLs(data) {
|
|
45
|
-
this.client = this.getSinchClient();
|
|
46
39
|
const getParams = this.client.extractQueryParams(data, []);
|
|
47
40
|
const headers = {
|
|
48
41
|
'Content-Type': 'application/json',
|
|
@@ -66,8 +59,7 @@ class ApplicationsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
66
59
|
* @param { GetNumbersRequestData } data - The data to provide to the API call.
|
|
67
60
|
*/
|
|
68
61
|
async listNumbers(data) {
|
|
69
|
-
|
|
70
|
-
const getParams = this.client.extractQueryParams(data, []);
|
|
62
|
+
const getParams = this.client.extractQueryParams(data ?? {}, []);
|
|
71
63
|
const headers = {
|
|
72
64
|
'Content-Type': 'application/json',
|
|
73
65
|
'Accept': 'application/json',
|
|
@@ -90,7 +82,6 @@ class ApplicationsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
90
82
|
* @param { UnassignNumberRequestData } data - The data to provide to the API call.
|
|
91
83
|
*/
|
|
92
84
|
async unassignNumber(data) {
|
|
93
|
-
this.client = this.getSinchClient();
|
|
94
85
|
const getParams = this.client.extractQueryParams(data, []);
|
|
95
86
|
const headers = {
|
|
96
87
|
'Content-Type': 'application/json',
|
|
@@ -115,7 +106,6 @@ class ApplicationsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
115
106
|
* @param { UpdateCallbackURLsRequestData } data - The data to provide to the API call.
|
|
116
107
|
*/
|
|
117
108
|
async updateCallbackURLs(data) {
|
|
118
|
-
this.client = this.getSinchClient();
|
|
119
109
|
const getParams = this.client.extractQueryParams(data, []);
|
|
120
110
|
const headers = {
|
|
121
111
|
'Content-Type': 'application/json',
|
|
@@ -140,7 +130,6 @@ class ApplicationsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
140
130
|
* @param { AssignNumbersRequestData } data - The data to provide to the API call.
|
|
141
131
|
*/
|
|
142
132
|
async assignNumbers(data) {
|
|
143
|
-
this.client = this.getSinchClient();
|
|
144
133
|
const getParams = this.client.extractQueryParams(data, []);
|
|
145
134
|
const headers = {
|
|
146
135
|
'Content-Type': 'application/json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/applications/applications-api.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"applications-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/applications/applications-api.ts"],"names":[],"mappings":";;;AAYA,0DAAqD;AAGrD,MAAa,eAAgB,SAAQ,iCAAc;IAEjD,YAAY,UAAmD;QAC7D,KAAK,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,WAAW,CAAC,IAA4B;QACnD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAyB,IAAI,EAAE,EAAa,CAAC,CAAC;QAC9F,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,EAAE,CAAC;QAC7B,6KAA6K;QAC7K,MAAM,IAAI,GAAG,4BAA4B,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9E,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEjE,MAAM,cAAc,GACd,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;QACxG,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,CAAsB;YAClD,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,aAAa;SAC3B,CAAC,CAAC;IACL,CAA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AAC,aAAa,CAAC,IAA8B;QACvD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAA2B,IAAI,EAAE,EAAa,CAAC,CAAC;QAChG,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,IAAI,CAAC,0BAA0B,CAAC;YACxD,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC5D,MAAM,IAAI,GAAG,2BAA2B,CAAC;QACzC,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEjE,MAAM,cAAc,GACd,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,IAAI,CAAC,CAAC;QACzG,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,CAAO;YACnC,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,eAAe;SAC7B,CAAC,CAAC;IACL,CAAC;CAEF;AAlLD,0CAkLC"}
|
|
@@ -22,4 +22,11 @@ export declare class VoiceCallbackWebhooks implements CallbackProcessor<VoiceCal
|
|
|
22
22
|
* @return {VoiceCallbackEvent} - The parsed voice event object.
|
|
23
23
|
*/
|
|
24
24
|
parseEvent(eventBody: any): VoiceCallbackEvent;
|
|
25
|
+
/**
|
|
26
|
+
* Static reviver for a Voice Event.
|
|
27
|
+
* This method ensures the object can be treated as a Voice Event.
|
|
28
|
+
* @param {any} eventBody - The event body containing the Voice event notification.
|
|
29
|
+
* @return {VoiceCallbackEvent} - The parsed Voice event object
|
|
30
|
+
*/
|
|
31
|
+
static parseEvent(eventBody: any): VoiceCallbackEvent;
|
|
25
32
|
}
|
|
@@ -27,6 +27,9 @@ class VoiceCallbackWebhooks {
|
|
|
27
27
|
* @return {VoiceCallbackEvent} - The parsed voice event object.
|
|
28
28
|
*/
|
|
29
29
|
parseEvent(eventBody) {
|
|
30
|
+
if (typeof eventBody === 'string') {
|
|
31
|
+
eventBody = JSON.parse(eventBody);
|
|
32
|
+
}
|
|
30
33
|
if (eventBody.timestamp) {
|
|
31
34
|
eventBody.timestamp = new Date(eventBody.timestamp);
|
|
32
35
|
}
|
|
@@ -49,6 +52,16 @@ class VoiceCallbackWebhooks {
|
|
|
49
52
|
console.log(eventBody);
|
|
50
53
|
throw new Error('Unknown Voice event');
|
|
51
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Static reviver for a Voice Event.
|
|
57
|
+
* This method ensures the object can be treated as a Voice Event.
|
|
58
|
+
* @param {any} eventBody - The event body containing the Voice event notification.
|
|
59
|
+
* @return {VoiceCallbackEvent} - The parsed Voice event object
|
|
60
|
+
*/
|
|
61
|
+
static parseEvent(eventBody) {
|
|
62
|
+
const webhooks = new VoiceCallbackWebhooks({});
|
|
63
|
+
return webhooks.parseEvent(eventBody);
|
|
64
|
+
}
|
|
52
65
|
}
|
|
53
66
|
exports.VoiceCallbackWebhooks = VoiceCallbackWebhooks;
|
|
54
67
|
//# sourceMappingURL=callbacks-webhook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;AACA,kDAA2G;AAM3G,MAAa,qBAAqB;IAGhC,YAAY,qBAA4C;QACtD,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;IACrD,CAAC;IAED;;;;;;;OAOG;IACI,4BAA4B,CAC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EAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;;;OAKG;IACI,UAAU,CAAC,SAAc;QAC9B,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAClC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,SAAS,CAAC,SAAS,EAAE,CAAC;YACxB,SAAS,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,SAAS,CAAC,KAAK,EAAE,CAAC;YACpB,QAAQ,SAAS,CAAC,KAAK,EAAE,CAAC;gBACxB,KAAK,KAAK;oBACR,OAAO,SAAuB,CAAC;gBACjC,KAAK,KAAK;oBACR,OAAO,SAAuB,CAAC;gBACjC,KAAK,MAAM;oBACT,OAAO,SAAwB,CAAC;gBAClC,KAAK,KAAK;oBACR,OAAO,SAAuB,CAAC;gBACjC,KAAK,QAAQ;oBACX,OAAO,SAA0B,CAAC;gBACpC;oBACE,MAAM,IAAI,KAAK,CAAC,6BAA6B,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAU,CAAC,SAAc;QACrC,MAAM,QAAQ,GAAG,IAAI,qBAAqB,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CAEF;AA1ED,sDA0EC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { CalloutResponse, ConferenceCalloutRequestData, CustomCalloutRequestData, TtsCalloutRequestData } from '../../../models';
|
|
2
|
-
import { SinchClientParameters } from '@sinch/sdk-client';
|
|
3
2
|
import { VoiceDomainApi } from '../voice-domain-api';
|
|
3
|
+
import { LazyVoiceApiClient } from '../voice-service';
|
|
4
4
|
export declare class CalloutsApi extends VoiceDomainApi {
|
|
5
|
-
|
|
6
|
-
* Initialize your interface
|
|
7
|
-
*
|
|
8
|
-
* @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
|
|
9
|
-
*/
|
|
10
|
-
constructor(sinchClientParameters: SinchClientParameters);
|
|
5
|
+
constructor(lazyClient: LazyVoiceApiClient);
|
|
11
6
|
/**
|
|
12
7
|
* TTS Callout Request
|
|
13
8
|
* Makes a text-to-speech callout to a phone number.
|