@sinch/voice 1.3.0 → 1.4.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.
- package/dist/models/v1/mod-svaml/svaml-action-connect-stream/index.d.ts +1 -1
- package/dist/models/v1/mod-svaml/svaml-action-connect-stream/svaml-action-connect-stream.d.ts +11 -0
- 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 +10 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { SvamlActionConnectStream, ConnectStreamProps } from './svaml-action-connect-stream';
|
|
1
|
+
export type { SvamlActionConnectStream, ConnectStreamProps, StreamingOptions } from './svaml-action-connect-stream';
|
package/dist/models/v1/mod-svaml/svaml-action-connect-stream/svaml-action-connect-stream.d.ts
CHANGED
|
@@ -8,9 +8,20 @@ export interface SvamlActionConnectStream {
|
|
|
8
8
|
name: 'connectStream';
|
|
9
9
|
/** Specifies where to route the Stream call. */
|
|
10
10
|
destination: DestinationStream;
|
|
11
|
+
/** @see StreamingOptions */
|
|
12
|
+
streamingOptions?: StreamingOptions;
|
|
11
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. */
|
|
12
14
|
maxDuration?: number;
|
|
13
15
|
/** "These custom parameters (headers/messages) are sent to your WebSocket server in the initial message when the ConnectStream is established." */
|
|
14
16
|
callHeaders?: CallHeader[];
|
|
15
17
|
}
|
|
16
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
|
+
}
|
|
@@ -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,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ed 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
|
}
|
|
@@ -52,6 +52,16 @@ class VoiceCallbackWebhooks {
|
|
|
52
52
|
console.log(eventBody);
|
|
53
53
|
throw new Error('Unknown Voice event');
|
|
54
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
|
+
}
|
|
55
65
|
}
|
|
56
66
|
exports.VoiceCallbackWebhooks = VoiceCallbackWebhooks;
|
|
57
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,CACjC,OAA4B,EAC5B,IAAS,EACT,IAAY,EACZ,MAAc;QAEd,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,cAAc,IAAI,CAAC,IAAI,CAAC,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AC5C,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.
|
|
@@ -3,13 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CalloutsApi = void 0;
|
|
4
4
|
const voice_domain_api_1 = require("../voice-domain-api");
|
|
5
5
|
class CalloutsApi 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, 'CalloutsApi');
|
|
6
|
+
constructor(lazyClient) {
|
|
7
|
+
super(lazyClient, 'CalloutsApi');
|
|
13
8
|
}
|
|
14
9
|
/**
|
|
15
10
|
* TTS Callout Request
|
|
@@ -17,7 +12,6 @@ class CalloutsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
17
12
|
* @param { TtsCalloutRequestData } data - The data to provide to the API call.
|
|
18
13
|
*/
|
|
19
14
|
async tts(data) {
|
|
20
|
-
this.client = this.getSinchClient();
|
|
21
15
|
const getParams = this.client.extractQueryParams(data, []);
|
|
22
16
|
const headers = {
|
|
23
17
|
'Content-Type': 'application/json',
|
|
@@ -41,7 +35,6 @@ class CalloutsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
41
35
|
* @param { ConferenceCalloutRequestData } data - The data to provide to the API call.
|
|
42
36
|
*/
|
|
43
37
|
async conference(data) {
|
|
44
|
-
this.client = this.getSinchClient();
|
|
45
38
|
const getParams = this.client.extractQueryParams(data, []);
|
|
46
39
|
const headers = {
|
|
47
40
|
'Content-Type': 'application/json',
|
|
@@ -65,7 +58,6 @@ class CalloutsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
65
58
|
* @param { CustomCalloutRequestData } data - The data to provide to the API call.
|
|
66
59
|
*/
|
|
67
60
|
async custom(data) {
|
|
68
|
-
this.client = this.getSinchClient();
|
|
69
61
|
const getParams = this.client.extractQueryParams(data, []);
|
|
70
62
|
const headers = {
|
|
71
63
|
'Content-Type': 'application/json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callouts-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/callouts/callouts-api.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"callouts-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/callouts/callouts-api.ts"],"names":[],"mappings":";;;AAOA,0DAAqD;AAGrD,MAAa,WAAY,SAAQ,iCAAc;IAE7C,YAAY,UAA8B;QACxC,KAAK,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,GAAG,CAAC,IAA2B;QAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAwB,IAAI,EAAE,EAAa,CAAC,CAAC;QAC7F,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/G,MAAM,IAAI,GAAG,sBAAsB,CAAC;QACpC,MAAM,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GetCallResultRequestData, ManageWithCallLegRequestData, UpdateCallRequestData } 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 CallsApi 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
|
* Get information about a call
|
|
13
8
|
* You can retrieve information about an ongoing or completed call using a call ID. You can find the call ID of an ongoing call by viewing the response object from a callout request. You can find the call ID of a completed call by looking at your call logs in your Sinch [Dashboard](https://dashboard.sinch.com/voice/logs). Note: You can only use this method for calls that terminate to PSTN or SIP networks from an In-app call.
|
|
@@ -3,13 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CallsApi = void 0;
|
|
4
4
|
const voice_domain_api_1 = require("../voice-domain-api");
|
|
5
5
|
class CallsApi 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, 'CallsApi');
|
|
6
|
+
constructor(lazyClient) {
|
|
7
|
+
super(lazyClient, 'CallsApi');
|
|
13
8
|
}
|
|
14
9
|
/**
|
|
15
10
|
* Get information about a call
|
|
@@ -17,7 +12,6 @@ class CallsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
17
12
|
* @param { GetCallResultRequestData } data - The data to provide to the API call.
|
|
18
13
|
*/
|
|
19
14
|
async get(data) {
|
|
20
|
-
this.client = this.getSinchClient();
|
|
21
15
|
const getParams = this.client.extractQueryParams(data, []);
|
|
22
16
|
const headers = {
|
|
23
17
|
'Content-Type': 'application/json',
|
|
@@ -41,7 +35,6 @@ class CallsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
41
35
|
* @param { ManageWithCallLegRequestData } data - The data to provide to the API call.
|
|
42
36
|
*/
|
|
43
37
|
async manageWithCallLeg(data) {
|
|
44
|
-
this.client = this.getSinchClient();
|
|
45
38
|
const getParams = this.client.extractQueryParams(data, []);
|
|
46
39
|
const headers = {
|
|
47
40
|
'Content-Type': 'application/json',
|
|
@@ -67,7 +60,6 @@ class CallsApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
67
60
|
* @param { UpdateCallRequestData } data - The data to provide to the API call.
|
|
68
61
|
*/
|
|
69
62
|
async update(data) {
|
|
70
|
-
this.client = this.getSinchClient();
|
|
71
63
|
const getParams = this.client.extractQueryParams(data, []);
|
|
72
64
|
const headers = {
|
|
73
65
|
'Content-Type': 'application/json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calls-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/calls/calls-api.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"calls-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/calls/calls-api.ts"],"names":[],"mappings":";;;AAOA,0DAAqD;AAGrD,MAAa,QAAS,SAAQ,iCAAc;IAE1C,YAAY,UAA8B;QACxC,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,GAAG,CAAC,IAA8B;QAC7C,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,MAA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,CAAC,MAAM,CAAC,WAAW,CAAO;YACnC,GAAG;YACH,cAAc;YACd,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,YAAY;SAC1B,CAAC,CAAC;IACL,CAAC;CAEF;AA1FD,4BA0FC"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import { CalloutResponse, ConferenceCalloutRequestData, GetConferenceInfoRequestData, GetConferenceInfoResponse, KickAllRequestData, KickParticipantRequestData, ManageParticipantRequestData } 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 ConferencesApi extends VoiceDomainApi {
|
|
5
5
|
private calloutApi;
|
|
6
|
-
|
|
7
|
-
* Initialize your interface
|
|
8
|
-
*
|
|
9
|
-
* @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
|
|
10
|
-
*/
|
|
11
|
-
constructor(sinchClientParameters: SinchClientParameters);
|
|
6
|
+
constructor(lazyClient: LazyVoiceApiClient);
|
|
12
7
|
/**
|
|
13
8
|
* Conference Callout Request
|
|
14
9
|
* Makes a conference callout to a phone number.
|
|
@@ -4,14 +4,9 @@ exports.ConferencesApi = void 0;
|
|
|
4
4
|
const voice_domain_api_1 = require("../voice-domain-api");
|
|
5
5
|
const callouts_1 = require("../callouts");
|
|
6
6
|
class ConferencesApi extends voice_domain_api_1.VoiceDomainApi {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client.
|
|
11
|
-
*/
|
|
12
|
-
constructor(sinchClientParameters) {
|
|
13
|
-
super(sinchClientParameters, 'ConferencesApi');
|
|
14
|
-
this.calloutApi = new callouts_1.CalloutsApi(sinchClientParameters);
|
|
7
|
+
constructor(lazyClient) {
|
|
8
|
+
super(lazyClient, 'ConferencesApi');
|
|
9
|
+
this.calloutApi = new callouts_1.CalloutsApi(lazyClient);
|
|
15
10
|
}
|
|
16
11
|
/**
|
|
17
12
|
* Conference Callout Request
|
|
@@ -27,7 +22,6 @@ class ConferencesApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
27
22
|
* @param { GetConferenceInfoRequestData } data - The data to provide to the API call.
|
|
28
23
|
*/
|
|
29
24
|
async get(data) {
|
|
30
|
-
this.client = this.getSinchClient();
|
|
31
25
|
const getParams = this.client.extractQueryParams(data, []);
|
|
32
26
|
const headers = {
|
|
33
27
|
'Content-Type': 'application/json',
|
|
@@ -51,7 +45,6 @@ class ConferencesApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
51
45
|
* @param { KickAllRequestData } data - The data to provide to the API call.
|
|
52
46
|
*/
|
|
53
47
|
async kickAll(data) {
|
|
54
|
-
this.client = this.getSinchClient();
|
|
55
48
|
const getParams = this.client.extractQueryParams(data, []);
|
|
56
49
|
const headers = {
|
|
57
50
|
'Content-Type': 'application/json',
|
|
@@ -75,7 +68,6 @@ class ConferencesApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
75
68
|
* @param { KickParticipantRequestData } data - The data to provide to the API call.
|
|
76
69
|
*/
|
|
77
70
|
async kickParticipant(data) {
|
|
78
|
-
this.client = this.getSinchClient();
|
|
79
71
|
const getParams = this.client.extractQueryParams(data, []);
|
|
80
72
|
const headers = {
|
|
81
73
|
'Content-Type': 'application/json',
|
|
@@ -99,7 +91,6 @@ class ConferencesApi extends voice_domain_api_1.VoiceDomainApi {
|
|
|
99
91
|
* @param { ManageParticipantRequestData } data - The data to provide to the API call.
|
|
100
92
|
*/
|
|
101
93
|
async manageParticipant(data) {
|
|
102
|
-
this.client = this.getSinchClient();
|
|
103
94
|
const getParams = this.client.extractQueryParams(data, []);
|
|
104
95
|
const headers = {
|
|
105
96
|
'Content-Type': 'application/json',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conferences-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/conferences/conferences-api.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"conferences-api.js","sourceRoot":"","sources":["../../../../src/rest/v1/conferences/conferences-api.ts"],"names":[],"mappings":";;;AAUA,0DAAqD;AACrD,0CAA0C;AAG1C,MAAa,cAAe,SAAQ,iCAAc;IAIhD,YAAY,UAA8B;QACxC,KAAK,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QACpC,IAAI,CAAC,UAAU,GAAG,IAAI,sBAAW,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,IAAI,CAAC,IAAkC;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,GAAG,CAAC,IAAkC;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAA+B,IAAI,EAAE,EAAa,CAAC,CAAC;QACpG,MAAM,OAAO,GAA0C;YACrD,cAAc,EAAE,kBAAkB;YAClC,QAAQ,EAAE,kBAAkB;SAC7B,CAAC;QAEF,MAAM,IAAI,GAAgB,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,8BAA8B,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAClE,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,WA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,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QAC9G,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,6BAA6B;SAC3C,CAAC,CAAC;IACL,CAAC;CAEF;AAhID,wCAgIC"}
|
package/dist/rest/v1/index.d.ts
CHANGED
package/dist/rest/v1/index.js
CHANGED
|
@@ -20,5 +20,6 @@ __exportStar(require("./callouts"), exports);
|
|
|
20
20
|
__exportStar(require("./calls"), exports);
|
|
21
21
|
__exportStar(require("./conferences"), exports);
|
|
22
22
|
__exportStar(require("./enums"), exports);
|
|
23
|
+
__exportStar(require("./voice-domain-api"), exports);
|
|
23
24
|
__exportStar(require("./voice-service"), exports);
|
|
24
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,gDAA8B;AAC9B,0CAAwB;AACxB,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rest/v1/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8CAA4B;AAC5B,6CAA2B;AAC3B,0CAAwB;AACxB,gDAA8B;AAC9B,0CAAwB;AACxB,qDAAmC;AACnC,kDAAgC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import { Api, ApiClient, ApplicationCredentials,
|
|
1
|
+
import { Api, ApiClient, ApplicationCredentials, VoiceRegion } from '@sinch/sdk-client';
|
|
2
|
+
import { LazyVoiceApiClient, LazyVoiceApplicationManagementApiClient } from './voice-service';
|
|
2
3
|
export declare class VoiceDomainApi implements Api {
|
|
4
|
+
readonly lazyClient: LazyVoiceApiClient | LazyVoiceApplicationManagementApiClient;
|
|
3
5
|
readonly apiName: string;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
constructor(lazyClient: LazyVoiceApiClient | LazyVoiceApplicationManagementApiClient, apiName: string);
|
|
7
|
+
get client(): ApiClient;
|
|
8
|
+
/**
|
|
9
|
+
* Kept for backward compatibility - TODO: remove in future major release
|
|
10
|
+
* @return {ApiClient}
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
13
|
+
getSinchClient(): ApiClient;
|
|
7
14
|
/**
|
|
8
15
|
* Update the default hostname for the API
|
|
9
16
|
* @param {string} hostname - The new hostname to use for the APIs.
|
|
@@ -18,14 +25,9 @@ export declare class VoiceDomainApi implements Api {
|
|
|
18
25
|
* Updates the application credentials used to authenticate API requests
|
|
19
26
|
* @param {ApplicationCredentials} credentials
|
|
20
27
|
*/
|
|
21
|
-
|
|
22
|
-
private resetApiClient;
|
|
28
|
+
setCredentials(credentials: Partial<ApplicationCredentials>): void;
|
|
23
29
|
/**
|
|
24
|
-
*
|
|
25
|
-
* be returned for the subsequent API calls (singleton pattern)
|
|
26
|
-
* @return {ApiClient} the API Client or throws an error in case the configuration parameters are not ok
|
|
27
|
-
* @private
|
|
30
|
+
* @deprecated Use setCredentials instead
|
|
28
31
|
*/
|
|
29
|
-
|
|
30
|
-
private buildHostname;
|
|
32
|
+
setApplication(credentials: ApplicationCredentials): void;
|
|
31
33
|
}
|
|
@@ -1,86 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VoiceDomainApi = void 0;
|
|
4
|
-
const sdk_client_1 = require("@sinch/sdk-client");
|
|
5
4
|
class VoiceDomainApi {
|
|
6
|
-
constructor(
|
|
7
|
-
this.
|
|
5
|
+
constructor(lazyClient, apiName) {
|
|
6
|
+
this.lazyClient = lazyClient;
|
|
8
7
|
this.apiName = apiName;
|
|
9
8
|
}
|
|
9
|
+
get client() {
|
|
10
|
+
return this.lazyClient.getApiClient();
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Kept for backward compatibility - TODO: remove in future major release
|
|
14
|
+
* @return {ApiClient}
|
|
15
|
+
* @deprecated
|
|
16
|
+
*/
|
|
17
|
+
getSinchClient() {
|
|
18
|
+
return this.lazyClient.getApiClient();
|
|
19
|
+
}
|
|
10
20
|
/**
|
|
11
21
|
* Update the default hostname for the API
|
|
12
22
|
* @param {string} hostname - The new hostname to use for the APIs.
|
|
13
23
|
*/
|
|
14
24
|
setHostname(hostname) {
|
|
15
|
-
|
|
16
|
-
this.
|
|
17
|
-
this.client.apiClientOptions.hostname = hostname;
|
|
25
|
+
if (this.apiName === 'ApplicationsApi') {
|
|
26
|
+
this.lazyClient.sharedConfig.voiceApplicationManagementHostname = hostname;
|
|
18
27
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
throw error;
|
|
28
|
+
else {
|
|
29
|
+
this.lazyClient.sharedConfig.voiceHostname = hostname;
|
|
22
30
|
}
|
|
31
|
+
this.lazyClient.getApiClient().apiClientOptions.hostname = hostname;
|
|
23
32
|
}
|
|
24
33
|
/**
|
|
25
34
|
* Update the region in the hostname
|
|
26
35
|
* @param {VoiceRegion} region - The new region to send the requests to
|
|
27
36
|
*/
|
|
28
37
|
setRegion(region) {
|
|
29
|
-
this.
|
|
30
|
-
|
|
31
|
-
this.client.apiClientOptions.hostname = this.buildHostname(region);
|
|
32
|
-
}
|
|
38
|
+
this.lazyClient.sharedConfig.voiceRegion = region;
|
|
39
|
+
this.lazyClient.resetApiClient();
|
|
33
40
|
}
|
|
34
41
|
/**
|
|
35
42
|
* Updates the application credentials used to authenticate API requests
|
|
36
43
|
* @param {ApplicationCredentials} credentials
|
|
37
44
|
*/
|
|
38
|
-
|
|
39
|
-
const parametersBackup = { ...this.
|
|
40
|
-
this.
|
|
45
|
+
setCredentials(credentials) {
|
|
46
|
+
const parametersBackup = { ...this.lazyClient.sharedConfig };
|
|
47
|
+
this.lazyClient.sharedConfig = {
|
|
41
48
|
...parametersBackup,
|
|
42
49
|
...credentials,
|
|
43
50
|
};
|
|
44
|
-
this.resetApiClient();
|
|
51
|
+
this.lazyClient.resetApiClient();
|
|
45
52
|
try {
|
|
46
|
-
this.
|
|
53
|
+
this.lazyClient.getApiClient();
|
|
47
54
|
}
|
|
48
55
|
catch (error) {
|
|
49
|
-
console.error('Impossible to assign the new
|
|
50
|
-
this.
|
|
56
|
+
console.error('Impossible to assign the new credentials to the Voice API');
|
|
57
|
+
this.lazyClient.sharedConfig = parametersBackup;
|
|
51
58
|
throw error;
|
|
52
59
|
}
|
|
53
60
|
}
|
|
54
|
-
resetApiClient() {
|
|
55
|
-
this.client = undefined;
|
|
56
|
-
}
|
|
57
61
|
/**
|
|
58
|
-
*
|
|
59
|
-
* be returned for the subsequent API calls (singleton pattern)
|
|
60
|
-
* @return {ApiClient} the API Client or throws an error in case the configuration parameters are not ok
|
|
61
|
-
* @private
|
|
62
|
+
* @deprecated Use setCredentials instead
|
|
62
63
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const apiClientOptions = (0, sdk_client_1.buildApplicationSignedApiClientOptions)(this.sinchClientParameters, 'Voice');
|
|
66
|
-
this.client = new sdk_client_1.ApiFetchClient(apiClientOptions);
|
|
67
|
-
const region = this.sinchClientParameters.voiceRegion ?? sdk_client_1.VoiceRegion.DEFAULT;
|
|
68
|
-
if (!Object.values(sdk_client_1.SupportedVoiceRegion).includes(region)) {
|
|
69
|
-
console.warn(`The region "${region}" is not known as a supported region for the Voice API`);
|
|
70
|
-
}
|
|
71
|
-
this.client.apiClientOptions.hostname = this.buildHostname(region);
|
|
72
|
-
}
|
|
73
|
-
return this.client;
|
|
74
|
-
}
|
|
75
|
-
buildHostname(region) {
|
|
76
|
-
switch (this.apiName) {
|
|
77
|
-
case 'ApplicationsApi':
|
|
78
|
-
return this.sinchClientParameters.voiceApplicationManagementHostname ?? sdk_client_1.VOICE_APPLICATION_MANAGEMENT_HOSTNAME;
|
|
79
|
-
default: {
|
|
80
|
-
const formattedRegion = region === sdk_client_1.VoiceRegion.DEFAULT ? region : `-${region}`;
|
|
81
|
-
return this.sinchClientParameters.voiceHostname ?? (0, sdk_client_1.formatRegionalizedHostname)(sdk_client_1.VOICE_HOSTNAME, formattedRegion);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
64
|
+
setApplication(credentials) {
|
|
65
|
+
this.setCredentials(credentials);
|
|
84
66
|
}
|
|
85
67
|
}
|
|
86
68
|
exports.VoiceDomainApi = VoiceDomainApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v1/voice-domain-api.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"voice-domain-api.js","sourceRoot":"","sources":["../../../src/rest/v1/voice-domain-api.ts"],"names":[],"mappings":";;;AAQA,MAAa,cAAc;IAEzB,YACkB,UAAwE,EACxE,OAAe;QADf,eAAU,GAAV,UAAU,CAA8D;QACxE,YAAO,GAAP,OAAO,CAAQ;IAC9B,CAAC;IAEJ,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,QAAgB;QACjC,IAAI,IAAI,CAAC,OAAO,KAAK,iBAAiB,EAAE,CAAC;YACvC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,kCAAkC,GAAG,QAAQ,CAAC;QAC7E,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,aAAa,GAAG,QAAQ,CAAC;QACxD,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC,gBAAgB,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACtE,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,MAAmB;QAClC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,WAAW,GAAG,MAAM,CAAC;QAClD,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IACnC,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,WAA4C;QAChE,MAAM,gBAAgB,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAC7D,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG;YAC7B,GAAG,gBAAgB;YACnB,GAAG,WAAW;SACf,CAAC;QACF,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;QACjC,IAAI,CAAC;YACH,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;YAC3E,IAAI,CAAC,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;YAChD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,WAAmC;QACvD,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;CAEF;AArED,wCAqEC"}
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { SinchClientParameters, VoiceRegion } from '@sinch/sdk-client';
|
|
1
|
+
import { ApiFetchClient, ApplicationCredentials, SinchClientParameters, VoiceRegion } from '@sinch/sdk-client';
|
|
2
2
|
import { ApplicationsApi } from './applications';
|
|
3
3
|
import { ConferencesApi } from './conferences';
|
|
4
4
|
import { CallsApi } from './calls';
|
|
5
5
|
import { CalloutsApi } from './callouts';
|
|
6
|
+
export declare class LazyVoiceApiClient {
|
|
7
|
+
sharedConfig: SinchClientParameters;
|
|
8
|
+
apiFetchClient?: ApiFetchClient;
|
|
9
|
+
constructor(sharedConfig: SinchClientParameters);
|
|
10
|
+
getApiClient(): ApiFetchClient;
|
|
11
|
+
resetApiClient(): void;
|
|
12
|
+
private buildHostname;
|
|
13
|
+
}
|
|
14
|
+
export declare class LazyVoiceApplicationManagementApiClient {
|
|
15
|
+
sharedConfig: SinchClientParameters;
|
|
16
|
+
apiFetchClient?: ApiFetchClient;
|
|
17
|
+
constructor(sharedConfig: SinchClientParameters);
|
|
18
|
+
getApiClient(): ApiFetchClient;
|
|
19
|
+
resetApiClient(): void;
|
|
20
|
+
}
|
|
6
21
|
/**
|
|
7
22
|
* The Voice Service exposes the following APIs:
|
|
8
23
|
* - applications
|
|
@@ -15,6 +30,8 @@ export declare class VoiceService {
|
|
|
15
30
|
readonly conferences: ConferencesApi;
|
|
16
31
|
readonly calls: CallsApi;
|
|
17
32
|
readonly callouts: CalloutsApi;
|
|
33
|
+
readonly lazyVoiceClient: LazyVoiceApiClient;
|
|
34
|
+
readonly lazyVoiceAppMgmtClient: LazyVoiceApplicationManagementApiClient;
|
|
18
35
|
/**
|
|
19
36
|
* Create a new VoiceService instance with its configuration. It needs the following parameters for authentication:
|
|
20
37
|
* - `applicationKey`
|
|
@@ -27,6 +44,7 @@ export declare class VoiceService {
|
|
|
27
44
|
* @param {SinchClientParameters} params - an Object containing the necessary properties to initialize the service
|
|
28
45
|
*/
|
|
29
46
|
constructor(params: SinchClientParameters);
|
|
47
|
+
setApiClientConfig(newParams: SinchClientParameters): void;
|
|
30
48
|
/**
|
|
31
49
|
* Update the default hostname for each API except Applications
|
|
32
50
|
* @param {string} hostname - The new hostname to use for all the APIs except Applications.
|
|
@@ -42,4 +60,9 @@ export declare class VoiceService {
|
|
|
42
60
|
* @param {VoiceRegion} region - The new region to use in the production URL
|
|
43
61
|
*/
|
|
44
62
|
setRegion(region: VoiceRegion): void;
|
|
63
|
+
/**
|
|
64
|
+
* Updates the credentials used to authenticate API requests.
|
|
65
|
+
* @param credentials - The new credentials to use for the APIs.
|
|
66
|
+
*/
|
|
67
|
+
setCredentials(credentials: Partial<ApplicationCredentials>): void;
|
|
45
68
|
}
|
|
@@ -1,10 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VoiceService = void 0;
|
|
3
|
+
exports.VoiceService = exports.LazyVoiceApplicationManagementApiClient = exports.LazyVoiceApiClient = void 0;
|
|
4
|
+
const sdk_client_1 = require("@sinch/sdk-client");
|
|
4
5
|
const applications_1 = require("./applications");
|
|
5
6
|
const conferences_1 = require("./conferences");
|
|
6
7
|
const calls_1 = require("./calls");
|
|
7
8
|
const callouts_1 = require("./callouts");
|
|
9
|
+
class LazyVoiceApiClient {
|
|
10
|
+
constructor(sharedConfig) {
|
|
11
|
+
this.sharedConfig = sharedConfig;
|
|
12
|
+
}
|
|
13
|
+
getApiClient() {
|
|
14
|
+
if (!this.apiFetchClient) {
|
|
15
|
+
const region = this.sharedConfig.voiceRegion ?? sdk_client_1.VoiceRegion.DEFAULT;
|
|
16
|
+
if (!Object.values(sdk_client_1.SupportedVoiceRegion).includes(region)) {
|
|
17
|
+
console.warn(`The region "${region}" is not known as a supported region for the Voice API`);
|
|
18
|
+
}
|
|
19
|
+
const apiClientOptions = (0, sdk_client_1.buildApplicationSignedApiClientOptions)(this.sharedConfig, 'Voice');
|
|
20
|
+
this.apiFetchClient = new sdk_client_1.ApiFetchClient(apiClientOptions);
|
|
21
|
+
this.apiFetchClient.apiClientOptions.hostname = this.buildHostname(region);
|
|
22
|
+
}
|
|
23
|
+
return this.apiFetchClient;
|
|
24
|
+
}
|
|
25
|
+
resetApiClient() {
|
|
26
|
+
this.apiFetchClient = undefined;
|
|
27
|
+
}
|
|
28
|
+
buildHostname(region) {
|
|
29
|
+
const formattedRegion = region === sdk_client_1.VoiceRegion.DEFAULT ? region : `-${region}`;
|
|
30
|
+
return this.sharedConfig.voiceHostname ?? (0, sdk_client_1.formatRegionalizedHostname)(sdk_client_1.VOICE_HOSTNAME, formattedRegion);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.LazyVoiceApiClient = LazyVoiceApiClient;
|
|
34
|
+
class LazyVoiceApplicationManagementApiClient {
|
|
35
|
+
constructor(sharedConfig) {
|
|
36
|
+
this.sharedConfig = sharedConfig;
|
|
37
|
+
}
|
|
38
|
+
getApiClient() {
|
|
39
|
+
if (!this.apiFetchClient) {
|
|
40
|
+
const apiClientOptions = (0, sdk_client_1.buildApplicationSignedApiClientOptions)(this.sharedConfig, 'Voice');
|
|
41
|
+
this.apiFetchClient = new sdk_client_1.ApiFetchClient(apiClientOptions);
|
|
42
|
+
this.apiFetchClient.apiClientOptions.hostname
|
|
43
|
+
= this.sharedConfig.voiceApplicationManagementHostname ?? sdk_client_1.VOICE_APPLICATION_MANAGEMENT_HOSTNAME;
|
|
44
|
+
}
|
|
45
|
+
return this.apiFetchClient;
|
|
46
|
+
}
|
|
47
|
+
resetApiClient() {
|
|
48
|
+
this.apiFetchClient = undefined;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.LazyVoiceApplicationManagementApiClient = LazyVoiceApplicationManagementApiClient;
|
|
8
52
|
/**
|
|
9
53
|
* The Voice Service exposes the following APIs:
|
|
10
54
|
* - applications
|
|
@@ -25,35 +69,72 @@ class VoiceService {
|
|
|
25
69
|
* @param {SinchClientParameters} params - an Object containing the necessary properties to initialize the service
|
|
26
70
|
*/
|
|
27
71
|
constructor(params) {
|
|
28
|
-
|
|
29
|
-
this.
|
|
30
|
-
|
|
31
|
-
this.
|
|
72
|
+
const sharedVoiceClient = new LazyVoiceApiClient(params);
|
|
73
|
+
this.lazyVoiceClient = sharedVoiceClient;
|
|
74
|
+
const sharedVoiceAppMgmtClient = new LazyVoiceApplicationManagementApiClient(params);
|
|
75
|
+
this.lazyVoiceAppMgmtClient = sharedVoiceAppMgmtClient;
|
|
76
|
+
this.applications = new applications_1.ApplicationsApi(sharedVoiceAppMgmtClient);
|
|
77
|
+
this.conferences = new conferences_1.ConferencesApi(sharedVoiceClient);
|
|
78
|
+
this.calls = new calls_1.CallsApi(sharedVoiceClient);
|
|
79
|
+
this.callouts = new callouts_1.CalloutsApi(sharedVoiceClient);
|
|
80
|
+
}
|
|
81
|
+
setApiClientConfig(newParams) {
|
|
82
|
+
this.lazyVoiceClient.sharedConfig = newParams;
|
|
83
|
+
this.lazyVoiceClient.resetApiClient();
|
|
84
|
+
this.lazyVoiceAppMgmtClient.sharedConfig = newParams;
|
|
85
|
+
this.lazyVoiceAppMgmtClient.resetApiClient();
|
|
32
86
|
}
|
|
33
87
|
/**
|
|
34
88
|
* Update the default hostname for each API except Applications
|
|
35
89
|
* @param {string} hostname - The new hostname to use for all the APIs except Applications.
|
|
36
90
|
*/
|
|
37
91
|
setHostname(hostname) {
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.callouts.setHostname(hostname);
|
|
92
|
+
this.lazyVoiceClient.sharedConfig.voiceHostname = hostname;
|
|
93
|
+
this.lazyVoiceClient.getApiClient().apiClientOptions.hostname = hostname;
|
|
41
94
|
}
|
|
42
95
|
/**
|
|
43
96
|
* Update the default hostname for the Applications API
|
|
44
97
|
* @param {string} hostname - The new hostname to use for the Applications API.
|
|
45
98
|
*/
|
|
46
99
|
setApplicationsManagementHostname(hostname) {
|
|
47
|
-
this.
|
|
100
|
+
this.lazyVoiceAppMgmtClient.sharedConfig.voiceApplicationManagementHostname = hostname;
|
|
101
|
+
this.lazyVoiceAppMgmtClient.getApiClient().apiClientOptions.hostname = hostname;
|
|
48
102
|
}
|
|
49
103
|
/**
|
|
50
104
|
* Update the current region for each API
|
|
51
105
|
* @param {VoiceRegion} region - The new region to use in the production URL
|
|
52
106
|
*/
|
|
53
107
|
setRegion(region) {
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
|
|
108
|
+
this.lazyVoiceClient.sharedConfig.voiceRegion = region;
|
|
109
|
+
this.lazyVoiceClient.resetApiClient();
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Updates the credentials used to authenticate API requests.
|
|
113
|
+
* @param credentials - The new credentials to use for the APIs.
|
|
114
|
+
*/
|
|
115
|
+
setCredentials(credentials) {
|
|
116
|
+
const parametersBackup = { ...this.lazyVoiceClient.sharedConfig };
|
|
117
|
+
const parametersAppMgmtBackup = { ...this.lazyVoiceAppMgmtClient.sharedConfig };
|
|
118
|
+
this.lazyVoiceClient.sharedConfig = {
|
|
119
|
+
...parametersBackup,
|
|
120
|
+
...credentials,
|
|
121
|
+
};
|
|
122
|
+
this.lazyVoiceAppMgmtClient.sharedConfig = {
|
|
123
|
+
...parametersAppMgmtBackup,
|
|
124
|
+
...credentials,
|
|
125
|
+
};
|
|
126
|
+
this.lazyVoiceClient.resetApiClient();
|
|
127
|
+
this.lazyVoiceAppMgmtClient.resetApiClient();
|
|
128
|
+
try {
|
|
129
|
+
this.lazyVoiceClient.getApiClient();
|
|
130
|
+
this.lazyVoiceAppMgmtClient.getApiClient();
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
console.error('Impossible to assign the new credentials to the Voice API');
|
|
134
|
+
this.lazyVoiceClient.sharedConfig = parametersBackup;
|
|
135
|
+
this.lazyVoiceAppMgmtClient.sharedConfig = parametersAppMgmtBackup;
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
57
138
|
}
|
|
58
139
|
}
|
|
59
140
|
exports.VoiceService = VoiceService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice-service.js","sourceRoot":"","sources":["../../../src/rest/v1/voice-service.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"voice-service.js","sourceRoot":"","sources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I,CAAC;YACH,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC;YACpC,IAAI,CAAC,sBAAsB,CAAC,YAAY,EAAE,CAAC;QAC7C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;YAC3E,IAAI,CAAC,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;YACrD,IAAI,CAAC,sBAAsB,CAAC,YAAY,GAAG,uBAAuB,CAAC;YACnE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA9FD,oCA8FC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sinch/voice",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Sinch Voice API",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"test:e2e": "cucumber-js"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@sinch/sdk-client": "
|
|
32
|
+
"@sinch/sdk-client": "1.4.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {},
|
|
35
35
|
"publishConfig": {
|