@sinch/voice 1.0.0 → 1.2.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/conference-callout-request/conference-callout-request.d.ts +2 -1
- package/dist/models/v1/mod-callbacks/index.d.ts +1 -0
- package/dist/models/v1/mod-callbacks/index.js +1 -0
- package/dist/models/v1/mod-callbacks/index.js.map +1 -1
- 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 -1
- package/dist/models/v1/mod-callbacks/voice-callback-event.d.ts +6 -0
- package/dist/models/v1/mod-callbacks/voice-callback-event.js +3 -0
- package/dist/models/v1/mod-callbacks/voice-callback-event.js.map +1 -0
- package/dist/models/v1/participant/participant.d.ts +1 -1
- package/dist/rest/v1/callbacks/callbacks-webhook.d.ts +5 -4
- package/dist/rest/v1/callbacks/callbacks-webhook.js +1 -1
- package/dist/rest/v1/callbacks/callbacks-webhook.js.map +1 -1
- package/dist/rest/v1/voice-domain-api.js +2 -2
- package/dist/rest/v1/voice-domain-api.js.map +1 -1
- package/package.json +6 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Destination } from '../destination';
|
|
2
2
|
import { ConferenceDtmfOptions } from '../conference-dtmf-options';
|
|
3
|
+
import { MusicOnHold } from '../enums';
|
|
3
4
|
/**
|
|
4
5
|
* The conference callout calls a phone number or a user. When the call is answered, it's connected to a conference room.
|
|
5
6
|
*/
|
|
@@ -26,7 +27,7 @@ export interface ConferenceCalloutRequest {
|
|
|
26
27
|
/** The text that will be spoken as a greeting. */
|
|
27
28
|
greeting?: string;
|
|
28
29
|
/** Means "music-on-hold." It's an optional parameter that specifies what the first participant should listen to while they're alone in the conference, waiting for other participants to join. It can take one of these pre-defined values:<ul><li>`ring` (progress tone)</li><li>`music1` (music file)</li><li>`music2` (music file)</li><li>`music3` (music file)</li></ul></br>If no “music-on-hold” is specified, the user will only hear silence. */
|
|
29
|
-
mohClass?:
|
|
30
|
+
mohClass?: MusicOnHold;
|
|
30
31
|
/** Used to input custom data. */
|
|
31
32
|
custom?: string;
|
|
32
33
|
/** can be either “pstn” for PSTN endpoint or “mxp” for data (app or web) clients. */
|
|
@@ -24,4 +24,5 @@ __exportStar(require("./notify-request"), exports);
|
|
|
24
24
|
__exportStar(require("./pie-request"), exports);
|
|
25
25
|
__exportStar(require("./pie-response"), exports);
|
|
26
26
|
__exportStar(require("./callback-response"), exports);
|
|
27
|
+
__exportStar(require("./voice-callback-event"), exports);
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/mod-callbacks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,iDAA+B;AAC/B,yDAAuC;AACvC,mDAAiC;AACjC,gDAA8B;AAC9B,iDAA+B;AAC/B,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/v1/mod-callbacks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,iDAA+B;AAC/B,iDAA+B;AAC/B,gDAA8B;AAC9B,iDAA+B;AAC/B,yDAAuC;AACvC,mDAAiC;AACjC,gDAA8B;AAC9B,iDAA+B;AAC/B,sDAAoC;AACpC,yDAAuC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { PieRequest, MenuResult } from './pie-request';
|
|
1
|
+
export type { PieRequest, MenuResult, PieInformationType } from './pie-request';
|
|
@@ -21,9 +21,10 @@ 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?: PieInformationType;
|
|
25
25
|
/** The value of the returned information. */
|
|
26
26
|
value?: string;
|
|
27
27
|
/** The type of input received. */
|
|
28
28
|
inputMethod?: string;
|
|
29
29
|
}
|
|
30
|
+
export type PieInformationType = 'error' | 'return' | 'sequence' | 'timeout' | 'hangup' | 'invalidinput';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IceRequest } from './ice-request';
|
|
2
|
+
import { AceRequest } from './ace-request';
|
|
3
|
+
import { DiceRequest } from './dice-request';
|
|
4
|
+
import { PieRequest } from './pie-request';
|
|
5
|
+
import { NotifyRequest } from './notify-request';
|
|
6
|
+
export type VoiceCallbackEvent = IceRequest | AceRequest | DiceRequest | PieRequest | NotifyRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice-callback-event.js","sourceRoot":"","sources":["../../../../src/models/v1/mod-callbacks/voice-callback-event.ts"],"names":[],"mappings":""}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface Participant {
|
|
5
5
|
/** The type of the participant (caller or callee). */
|
|
6
|
-
type?: string;
|
|
6
|
+
type?: 'number' | 'Number' | 'username' | 'Username' | 'sip' | 'did' | string;
|
|
7
7
|
/** The phone number, user name, or other identifier of the participant (caller or callee). */
|
|
8
8
|
endpoint?: string;
|
|
9
9
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AceRequest, DiceRequest, IceRequest, NotifyRequest, PieRequest } from '../../../models';
|
|
2
|
+
import { AceRequest, DiceRequest, IceRequest, NotifyRequest, PieRequest, VoiceCallbackEvent } from '../../../models';
|
|
3
3
|
import { CallbackProcessor, SinchClientParameters } from '@sinch/sdk-client';
|
|
4
4
|
import { IncomingHttpHeaders } from 'http';
|
|
5
|
+
/** @deprecated Use Voice.VoiceCallbackEvent instead */
|
|
5
6
|
export type VoiceCallback = IceRequest | AceRequest | DiceRequest | PieRequest | NotifyRequest;
|
|
6
|
-
export declare class VoiceCallbackWebhooks implements CallbackProcessor<
|
|
7
|
+
export declare class VoiceCallbackWebhooks implements CallbackProcessor<VoiceCallbackEvent> {
|
|
7
8
|
private readonly sinchClientParameters;
|
|
8
9
|
constructor(sinchClientParameters: SinchClientParameters);
|
|
9
10
|
/**
|
|
@@ -19,7 +20,7 @@ export declare class VoiceCallbackWebhooks implements CallbackProcessor<VoiceCal
|
|
|
19
20
|
* Reviver for a Voice Event.
|
|
20
21
|
* This method ensures the object can be treated as a Voice Event and should be called before any action is taken to manipulate the object.
|
|
21
22
|
* @param {any} eventBody - The event body containing the voice event notification.
|
|
22
|
-
* @return {
|
|
23
|
+
* @return {VoiceCallbackEvent} - The parsed voice event object.
|
|
23
24
|
*/
|
|
24
|
-
parseEvent(eventBody: any):
|
|
25
|
+
parseEvent(eventBody: any): VoiceCallbackEvent;
|
|
25
26
|
}
|
|
@@ -24,7 +24,7 @@ class VoiceCallbackWebhooks {
|
|
|
24
24
|
* Reviver for a Voice Event.
|
|
25
25
|
* This method ensures the object can be treated as a Voice Event and should be called before any action is taken to manipulate the object.
|
|
26
26
|
* @param {any} eventBody - The event body containing the voice event notification.
|
|
27
|
-
* @return {
|
|
27
|
+
* @return {VoiceCallbackEvent} - The parsed voice event object.
|
|
28
28
|
*/
|
|
29
29
|
parseEvent(eventBody) {
|
|
30
30
|
if (eventBody.timestamp) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks-webhook.js","sourceRoot":"","sources":["../../../../src/rest/v1/callbacks/callbacks-webhook.ts"],"names":[],"mappings":";;;AACA,kDAA2G;
|
|
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,CACjC,OA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
78
|
-
return this.sinchClientParameters.voiceApplicationManagementHostname ??
|
|
78
|
+
return this.sinchClientParameters.voiceApplicationManagementHostname ?? sdk_client_1.VOICE_APPLICATION_MANAGEMENT_HOSTNAME;
|
|
79
79
|
default: {
|
|
80
80
|
const formattedRegion = region === sdk_client_1.VoiceRegion.DEFAULT ? region : `-${region}`;
|
|
81
|
-
return this.sinchClientParameters.voiceHostname ??
|
|
81
|
+
return this.sinchClientParameters.voiceHostname ?? (0, sdk_client_1.formatRegionalizedHostname)(sdk_client_1.VOICE_HOSTNAME, formattedRegion);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v1/voice-domain-api.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"voice-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v1/voice-domain-api.ts"],"names":[],"mappings":";;;AAAA,kDAY2B;AAE3B,MAAa,cAAc;IAKzB,YAAY,qBAA4C,EAAE,OAAe;QACvE,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,QAAgB;QACjC,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,0FAA0F,CAAC,CAAC;YAC1G,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,MAAmB;QAClC,IAAI,CAAC,qBAAqB,CAAC,WAAW,GAAG,MAAM,CAAC;QAChD,IAAI,IAAI,CAAC,MAAM,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I,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAEO,aAAa,CAAC,MAAmB;QACvC,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;YACvB,KAAK,iBAAiB;gBACpB,OAAO,IAAI,CAAC,qBAAqB,CAAC,kCAAkC,IAAI,kDAAqC,CAAC;YAChH,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,eAAe,GAAG,MAAM,KAAK,wBAAW,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;gBAC/E,OAAO,IAAI,CAAC,qBAAqB,CAAC,aAAa,IAAI,IAAA,uCAA0B,EAAC,2BAAc,EAAE,eAAe,CAAC,CAAC;YACjH,CAAC;QACD,CAAC;IACH,CAAC;CAEF;AAzFD,wCAyFC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinch/voice",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Sinch Voice API",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -25,13 +25,15 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"build": "yarn run clean && yarn run compile",
|
|
27
27
|
"clean": "rimraf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo",
|
|
28
|
-
"compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests tsconfig.build.tsbuildinfo"
|
|
28
|
+
"compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests tsconfig.build.tsbuildinfo",
|
|
29
|
+
"test:e2e": "cucumber-js"
|
|
29
30
|
},
|
|
30
31
|
"dependencies": {
|
|
31
|
-
"@sinch/sdk-client": "^1.
|
|
32
|
+
"@sinch/sdk-client": "^1.2.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {},
|
|
34
35
|
"publishConfig": {
|
|
35
|
-
"directory": "dist"
|
|
36
|
+
"directory": "dist",
|
|
37
|
+
"access": "public"
|
|
36
38
|
}
|
|
37
39
|
}
|