From 6f57969c413c8410365fc6cf845bfe0b6b87df27 Mon Sep 17 00:00:00 2001 From: Antoine SEIN <142824551+asein-sinch@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:11:40 +0200 Subject: [PATCH] DEVEXP-413: Integrate EST API in the SinchClient (#72) --- README.md | 21 +-- jest.config.ts | 5 + packages/elastic-sip-trunking/CHANGELOG.md | 8 ++ packages/elastic-sip-trunking/README.md | 121 ++++++++++++++++++ packages/elastic-sip-trunking/package.json | 36 ++++++ packages/elastic-sip-trunking/src/index.ts | 2 + .../elastic-sip-trunking/src/rest/index.ts | 1 + .../v1/elastic-sip-trunking-domain-api.ts | 68 ++++++++++ .../rest/v1/elastic-sip-trunking-service.ts | 19 +++ .../elastic-sip-trunking/src/rest/v1/index.ts | 1 + .../elastic-sip-trunking/tsconfig.build.json | 17 +++ packages/elastic-sip-trunking/tsconfig.json | 11 ++ .../elastic-sip-trunking/tsconfig.tests.json | 17 +++ .../sdk-client/src/domain/domain-interface.ts | 2 + packages/sdk-core/CHANGELOG.md | 3 + packages/sdk-core/README.md | 52 +++++--- packages/sdk-core/package.json | 1 + packages/sdk-core/src/index.ts | 1 + packages/sdk-core/src/sinch-client.ts | 3 + 19 files changed, 359 insertions(+), 30 deletions(-) create mode 100644 packages/elastic-sip-trunking/CHANGELOG.md create mode 100644 packages/elastic-sip-trunking/README.md create mode 100644 packages/elastic-sip-trunking/package.json create mode 100644 packages/elastic-sip-trunking/src/index.ts create mode 100644 packages/elastic-sip-trunking/src/rest/index.ts create mode 100644 packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-domain-api.ts create mode 100644 packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-service.ts create mode 100644 packages/elastic-sip-trunking/src/rest/v1/index.ts create mode 100644 packages/elastic-sip-trunking/tsconfig.build.json create mode 100644 packages/elastic-sip-trunking/tsconfig.json create mode 100644 packages/elastic-sip-trunking/tsconfig.tests.json diff --git a/README.md b/README.md index 7ecdc056..3698809a 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ import { const sinch = new SinchClient(sinchClientParameters); const conversationService = sinch.conversation; +const elasticSipTrunkingService = sinch.elasticSipTrunking; const faxService = sinch.fax; const numbersService = sinch.numbers; const smsService = sinch.sms; @@ -135,14 +136,15 @@ console.log(`The SMS has been sent successfully. Here is the batch id: ${respons Here is the list of the Sinch products and their level of support by the Node.js SDK: -| API Category | API Name | Status | -|------------------------|------------------|:------:| -| Messaging | SMS API | ✅ | -| | Conversation API | ✅ | -| | Fax API | ✅ | -| Voice and Video | Voice API | ✅ | -| Numbers & Connectivity | Numbers API | ✅ | -| Verification | Verification API | ✅ | +| API Category | API Name | Status | +|------------------------|--------------------------|:------:| +| Messaging | SMS API | ✅ | +| | Conversation API | ✅ | +| | Fax API | ✅ | +| Voice and Video | Voice API | ✅ | +| | Elastic SIP Trunking API | ✅ | +| Numbers & Connectivity | Numbers API | ✅ | +| Verification | Verification API | ✅ | ### Packages @@ -153,7 +155,8 @@ The Sinch Node.js SDK is packaged in the following way: - [`@sinch/voice`](./packages/voice): package that contains the Voice services: Callouts, Calls, Conferences, Applications management and Webhooks callbacks. - [`@sinch/numbers`](./packages/numbers): package that contains the Numbers services: Available number, Active number, Available regions, Callbacks management and Webhooks callbacks. - [`@sinch/verification`](./packages/verification): package that contains the Verification services: Verification start and report, Verification status and Webhooks callbacks. - - [`@sinch/fax`](./packages/fax): package that contains the Fax services: Services, Faxes and Faxes-on-emails + - [`@sinch/fax`](./packages/fax): package that contains the Fax services: Services, Faxes and Faxes-on-emails. + - [`@sinch/elastic-sip-trunking`](./packages/elastic-sip-trunking): package that contains the Elastic SIP Trunking services: SIP Trunks, Access Control List, SIP Endpoints, Country Permissions, Phones Numbers and Calls. - [`@sinch/sdk-client`](./packages/sdk-client): package included by all the other ones that contains the API client classes and helpers. ## Examples diff --git a/jest.config.ts b/jest.config.ts index 75e554cd..4bf4fc90 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -14,6 +14,11 @@ const config: Config.InitialOptions = { testMatch: ['/packages/conversation/tests/**/*.test.ts'], coveragePathIgnorePatterns: ['node_modules', 'tests'], }, + { + displayName: 'Elastic SIP Trunking', + testMatch: ['/packages/elastic-sip-trunking/tests/**/*.test.ts'], + coveragePathIgnorePatterns: ['node_modules', 'tests'], + }, { displayName: 'Fax', testMatch: ['/packages/fax/tests/**/*.test.ts'], diff --git a/packages/elastic-sip-trunking/CHANGELOG.md b/packages/elastic-sip-trunking/CHANGELOG.md new file mode 100644 index 00000000..6d6abc69 --- /dev/null +++ b/packages/elastic-sip-trunking/CHANGELOG.md @@ -0,0 +1,8 @@ +# Version 1.0.1 + - Initial version. Support for: + - SIP Trunks + - Access Control List + - SIP Endpoints + - Country Permissions + - Phone Numbers + - Calls diff --git a/packages/elastic-sip-trunking/README.md b/packages/elastic-sip-trunking/README.md new file mode 100644 index 00000000..28da3020 --- /dev/null +++ b/packages/elastic-sip-trunking/README.md @@ -0,0 +1,121 @@ +# Sinch Elastic SIP Trunking SDK for Node.js + +This package contains the Sinch Elastic SIP Trunking SDK for Node.js for use with [Sinch APIs](https://developers.sinch.com/). To use it, you will need a Sinch account. Please [sign up](https://dashboard.sinch.com/signup) or [log in](https://dashboard.sinch.com/login) if you already have one. + +## Installation + +We recommend to use this SDK as part of the `@sinch/sdk-core` package as it will take care about the authentication plugins to use. + +However, it's still possible to use this SDK standalone is you need to access the Elastic SIP Trunking API only. + +### With NPM + +```bash +npm install @sinch/elastic-sip-trunking +``` + +### With Yarn + +```bash +yarn add @sinch/elastic-sip-trunking +``` + +## Usage + +### Credentials + +The `Elastic SIP Trunking` API uses the Sinch unified authentication with OAuth2. You will need to provide the following credentials: +- projectId: can be found in the [Account Dashboard](https://dashboard.sinch.com/settings/access-keys) +- keyId:: can be found in your Access key list in the [Account Dashboard](https://dashboard.sinch.com/settings/access-keys) +- keySecret: can be found **ONLY** when generating a new access key: keep it safe! + +### As part of the Sinch SDK + +If you are using this SDK as part of the Sinch SDK (`@sinch/sdk-core`) you can access it as the `elasticSipTrunking` property of the client that you would have instantiated. + +```typescript +import { + ElasticSipTrunkingService, + ElasticSipTrunking, + SinchClient, + UnifiedCredentials, +} from '@sinch/sdk-core'; + +const credentials: UnifiedCredentials = { + projectId: 'PROJECT_ID', + keyId: 'KEY_ID', + keySecret: 'KEY_SECRET', +}; + +// Access the 'elasticSipTrunking' service registered on the Sinch Client +const sinch = new SinchClient(credentials); +const elasticSipTrunkingService: ElasticSipTrunkingService = sinch.elasticSipTrunking; + +// Build the request data +const requestData: ElasticSipTrunking.CreateSipTrunkRequestData = { + createSipTrunkRequestBody: { + name: 'Acme Trunk', + hostName: 'acme-domain-1', + } +}; + +// Use the 'elasticSipTrunking' service registered on the Sinch Client +const result = await sinch.elasticSipTrunking.sipTrunks.create(requestData); +``` + +### Standalone + +The SDK can be used standalone if you need to use only the Elastic SIP Trunking APIs. + +```typescript +import { + UnifiedCredentials, +} from '@sinch/sdk-client'; +import { + ElasticSipTrunkingService, + ElasticSipTrunking, +} from '@sinch/elastic-sip-trunking'; + +const credentials: UnifiedCredentials = { + projectId: 'PROJECT_ID', + keyId: 'KEY_ID', + keySecret: 'KEY_SECRET', +}; + +// Declare the 'elasticSipTrunking' service in a standalone way +const elasticSipTrunkingService = new ElasticSipTrunkingService(options); + +// Build the request data +const requestData: ElasticSipTrunking.CreateSipTrunkRequestData = { + createSipTrunkRequestBody: { + name: 'Acme Trunk', + hostName: 'acme-domain-1', + } +}; + +// Use the standalone declaration of the 'elasticSipTrunking' service +const result = await elasticSipTrunkingService.sipTrunks.create(requestData); +``` + +## Promises + +All the methods that interact with the Sinch APIs use Promises. You can use `await` in an `async` method to wait for the response or you can resolve them yourself with `then()` / `catch()`. + +```typescript +// Method 1: Wait for the Promise to complete +let result: ElasticSipTrunking.SipTrunk; +try { + result = await elasticSipTrunkingService.sipTrunks.create(requestData); + console.log(`SIP trunk successfully created at '${response.createTime.toISOString()}' with the id '${response.id}'`); +} catch (error: any) { + console.error(`ERROR ${error.statusCode}: Impossible to create a SIP Trunk with the hostname '${requestData.hostName}'`); +} + +// Method 2: Resolve the promise +elasticSipTrunkingService.sipTrunks.create(requestData) + .then(response => console.log(`SIP trunk successfully created at '${response.createTime.toISOString()}' with the id '${response.id}'`)) + .catch(error => console.error(`ERROR ${error.statusCode}: Impossible to create a SIP Trunk with the hostname '${requestData.hostName}'`)); +``` + +## Contact +Developer Experience team: [devexp@sinch.com](mailto:devexp@sinch.com) diff --git a/packages/elastic-sip-trunking/package.json b/packages/elastic-sip-trunking/package.json new file mode 100644 index 00000000..37f893b1 --- /dev/null +++ b/packages/elastic-sip-trunking/package.json @@ -0,0 +1,36 @@ +{ + "name": "@sinch/elastic-sip-trunking", + "version": "1.0.0", + "description": "Sinch Elastic SIP Trunking API", + "homepage": "", + "repository": { + "type": "git" + }, + "license": "Apache-2.0", + "author": "Sinch", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.js" + } + }, + "directories": { + "src": "dist", + "test": "tests" + }, + "files": ["/dist"], + "scripts": { + "build": "yarn run clean && yarn run compile", + "clean": "rimraf dist tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo", + "compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests tsconfig.build.tsbuildinfo" + }, + "dependencies": { + "@sinch/sdk-client": "^1.0.0" + }, + "devDependencies": {}, + "publishConfig": { + "directory": "dist" + } +} diff --git a/packages/elastic-sip-trunking/src/index.ts b/packages/elastic-sip-trunking/src/index.ts new file mode 100644 index 00000000..bb7724b7 --- /dev/null +++ b/packages/elastic-sip-trunking/src/index.ts @@ -0,0 +1,2 @@ +export * from './rest'; +export * from '@sinch/sdk-client'; diff --git a/packages/elastic-sip-trunking/src/rest/index.ts b/packages/elastic-sip-trunking/src/rest/index.ts new file mode 100644 index 00000000..5b98253d --- /dev/null +++ b/packages/elastic-sip-trunking/src/rest/index.ts @@ -0,0 +1 @@ +export * from './v1'; diff --git a/packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-domain-api.ts b/packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-domain-api.ts new file mode 100644 index 00000000..007eee92 --- /dev/null +++ b/packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-domain-api.ts @@ -0,0 +1,68 @@ +import { + Api, + ApiClient, + ApiFetchClient, + buildOAuth2ApiClientOptions, + SinchClientParameters, + UnifiedCredentials, +} from '@sinch/sdk-client'; + +export class ElasticSipTrunkingDomainApi implements Api { + public readonly apiName: string; + public client?: ApiClient; + private sinchClientParameters: SinchClientParameters; + + constructor(sinchClientParameters: SinchClientParameters, apiName: string) { + this.sinchClientParameters = sinchClientParameters; + this.apiName = apiName; + } + + /** + * Update the default hostname for the API + * @param {string} hostname - The new hostname to use for the APIs. + */ + public setHostname(hostname: string) { + this.client = this.getSinchClient(); + this.client.apiClientOptions.hostname = hostname; + } + + /** + * Updates the credentials used to authenticate API requests + * @param {UnifiedCredentials} credentials + */ + public setCredentials(credentials: UnifiedCredentials) { + const parametersBackup = { ...this.sinchClientParameters }; + this.sinchClientParameters = { + ...parametersBackup, + ...credentials, + }; + this.resetApiClient(); + try { + this.getSinchClient(); + } catch (error) { + console.error('Impossible to assign the new credentials to the Elastic SIP Trunking API'); + this.sinchClientParameters = parametersBackup; + throw error; + } + } + + private resetApiClient() { + this.client = undefined; + } + + /** + * Checks the configuration parameters are ok and initialize the API client. Once initialized, the same instance will + * be returned for the subsequent API calls (singleton pattern) + * @return {ApiClient} the API Client or throws an error in case the configuration parameters are not ok + * @private + */ + public getSinchClient(): ApiClient { + if (!this.client) { + const apiClientOptions = buildOAuth2ApiClientOptions(this.sinchClientParameters, 'Elastic SIP Trunking'); + this.client = new ApiFetchClient(apiClientOptions); + this.client.apiClientOptions.hostname = this.sinchClientParameters.elasticSipTrunkingHostname ?? 'https://elastic-trunking.api.sinch.com'; + } + return this.client; + } + +} diff --git a/packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-service.ts b/packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-service.ts new file mode 100644 index 00000000..cb2578fb --- /dev/null +++ b/packages/elastic-sip-trunking/src/rest/v1/elastic-sip-trunking-service.ts @@ -0,0 +1,19 @@ +import { SinchClientParameters } from '@sinch/sdk-client'; + +export class ElasticSipTrunkingService { + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + constructor(_params: SinchClientParameters) { + + } + + /** + * Update the default basePath for each API + * + * @param {string} _basePath - The new base path to use for all the APIs. + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public setBasePath(_basePath: string) { + + } +} diff --git a/packages/elastic-sip-trunking/src/rest/v1/index.ts b/packages/elastic-sip-trunking/src/rest/v1/index.ts new file mode 100644 index 00000000..e45986c4 --- /dev/null +++ b/packages/elastic-sip-trunking/src/rest/v1/index.ts @@ -0,0 +1 @@ +export * from './elastic-sip-trunking-service'; diff --git a/packages/elastic-sip-trunking/tsconfig.build.json b/packages/elastic-sip-trunking/tsconfig.build.json new file mode 100644 index 00000000..73f1cf60 --- /dev/null +++ b/packages/elastic-sip-trunking/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + }, + + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"], + + "references": [{ "path": "../sdk-client" }], + + "ts-node": { + "esm": true + } +} diff --git a/packages/elastic-sip-trunking/tsconfig.json b/packages/elastic-sip-trunking/tsconfig.json new file mode 100644 index 00000000..2684d3e0 --- /dev/null +++ b/packages/elastic-sip-trunking/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "references": [ + { + "path": "tsconfig.build.json" + }, + { + "path": "tsconfig.tests.json" + } + ] +} diff --git a/packages/elastic-sip-trunking/tsconfig.tests.json b/packages/elastic-sip-trunking/tsconfig.tests.json new file mode 100644 index 00000000..2e454981 --- /dev/null +++ b/packages/elastic-sip-trunking/tsconfig.tests.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + + "compilerOptions": { + "rootDir": ".", + "outDir": "dist/tests" + }, + + "include": ["src/**/*.ts", "tests/**/*.ts"], + "exclude": ["node_modules", "dist"], + + "references": [{ "path": "../sdk-client" }], + + "ts-node": { + "esm": true + } +} diff --git a/packages/sdk-client/src/domain/domain-interface.ts b/packages/sdk-client/src/domain/domain-interface.ts index bfb7d186..686be565 100644 --- a/packages/sdk-client/src/domain/domain-interface.ts +++ b/packages/sdk-client/src/domain/domain-interface.ts @@ -59,6 +59,8 @@ export interface ApiHostname { conversationHostname?: string; /** Override the hostname for the Conversation Templates API - Note the regions become ineffective */ conversationTemplatesHostname?: string; + /** Override the hostname for the Elastic SIP Trunking API */ + elasticSipTrunkingHostname?: string; /** Override the hostname for the Fax API - Note the regions become ineffective */ faxHostname?: string; /** Override the hostname for the Numbers API */ diff --git a/packages/sdk-core/CHANGELOG.md b/packages/sdk-core/CHANGELOG.md index 296846e3..687cde66 100644 --- a/packages/sdk-core/CHANGELOG.md +++ b/packages/sdk-core/CHANGELOG.md @@ -1,3 +1,6 @@ +## Version 1.0.1 +- Add support for the Elastic SIP Trunking API with `@sinch/elastic-sip-trunking` version `1.0.1` + ## Version 1.0.0 - Update dependency `@sinch/numbers` to version `1.0.0` - Update dependency `@sinch/sms` to version `1.0.0` diff --git a/packages/sdk-core/README.md b/packages/sdk-core/README.md index 8d85220c..fd3114dc 100644 --- a/packages/sdk-core/README.md +++ b/packages/sdk-core/README.md @@ -29,7 +29,7 @@ import { SinchClient } from '@sinch/sdk-core'; (async () => { // The credentials can be found on the Account dashboard: https://dashboard.sinch.com/account/access-keys - const sinch: Pick = new SinchClient({ + const sinch: Pick = new SinchClient({ projectId: 'my-project-id', keyId: 'my-key-id', keySecret: 'my-key-secret', @@ -93,12 +93,20 @@ import { SinchClient } from '@sinch/sdk-core'; For convenience, importing `@sinch/sdk-core` is sufficient to be able to access to all the APIs' classes and interfaces. In case you need to use a single API, they are also packaged as single NPM packages: - SMS: [`@sinch/sms`](https://www.npmjs.com/package/@sinch/sms) - Conversation: [`@sinch/conversation`](https://www.npmjs.com/package/@sinch/conversation) + - Elastic SIP Trunking: [`@sinch/elastic-sip-trunking`](https://www.npmjs.com/package/@sinch/elastic-sip-trunking) - Fax: [`@sinch/fax`](https://www.npmjs.com/package/@sinch/fax) - Numbers: [`@sinch/numbers`](https://www.npmjs.com/package/@sinch/numbers) - Verification: [`@sinch/verification`](https://www.npmjs.com/package/@sinch/verification) - Voice: [`@sinch/voice`](https://www.npmjs.com/package/@sinch/voice) -All the interfaces are exported with an alias, equal to the API name: `Sms` for the SMS API, `Conversation` for the Conversation API, `Fax` for the Fax API and so on. +All the interfaces are exported with an alias, equal to the API name: + - `Sms` for the SMS API + - `Conversation` for the Conversation API + - `ElasticSipTrunking` for the Elastic SIP Trunking API + - `Fax` for the Fax API + - `Numbers` for the Numbers API + - `Verification` for the Verification API + - `Voice` for the Voice API Here is an example about using the TypeScript types to send a fax: @@ -166,17 +174,18 @@ const { SinchClient } = require('@sinch/sdk-core'); For various reasons (development phase, testing, network restrictions, ...), one may need to update the default API endpoint, pointing to production. Each API exposes dedicated parameters to override the default hostname and region: -| API Name | Parameter | Region | -|----------------|------------------------------------|--------------------| -| Authentication | authHostname | N/A | -| SMS | smsHostname | smsRegion | -| Conversation | conversationHostname | conversationRegion | -| | conversationTemplatesHostname | | -| Fax | faxHostname | faxRegion | -| Voice | voiceHostname | voiceRegion | -| | voiceApplicationManagementHostname | | -| Numbers | numbersHostname | N/A | -| Verification | verificationHostname | N/A | +| API Name | Parameter | Region | +|-----------------------|------------------------------------|--------------------| +| Authentication | authHostname | N/A | +| SMS | smsHostname | smsRegion | +| Conversation | conversationHostname | conversationRegion | +| | conversationTemplatesHostname | | +| Elastic SIP Trunking | elasticSipTrunkingHostname | N/A | +| Fax | faxHostname | faxRegion | +| Voice | voiceHostname | voiceRegion | +| | voiceApplicationManagementHostname | | +| Numbers | numbersHostname | N/A | +| Verification | verificationHostname | N/A | And here are the list of supported regions per regionalized API: @@ -332,11 +341,12 @@ Developer Experience team: [devexp@sinch.com](mailto:devexp@sinch.com) Here is the list of the Sinch API and there level of support by the Node.js SDK: -| API Category | API Name | Status | -|------------------------|------------------|:------:| -| Messaging | SMS API | ✅ | -| | Conversation API | ✅ | -| | Fax API | ✅ | -| Voice and Video | Voice API | ✅ | -| Numbers & Connectivity | Numbers API | ✅ | -| Verification | Verification API | ✅ | +| API Category | API Name | Status | +|------------------------|--------------------------|:------:| +| Messaging | SMS API | ✅ | +| | Conversation API | ✅ | +| | Fax API | ✅ | +| Voice and Video | Voice API | ✅ | +| | Elastic SIP Trunking API | ✅ | +| Numbers & Connectivity | Numbers API | ✅ | +| Verification | Verification API | ✅ | diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index 8aab9e3d..cbab72fc 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -30,6 +30,7 @@ }, "dependencies": { "@sinch/conversation": "^1.0.0", + "@sinch/elastic-sip-trunking": "^1.0.0", "@sinch/fax": "^1.0.0", "@sinch/numbers": "^1.0.0", "@sinch/sms": "^1.0.0", diff --git a/packages/sdk-core/src/index.ts b/packages/sdk-core/src/index.ts index d40dd410..f4683389 100644 --- a/packages/sdk-core/src/index.ts +++ b/packages/sdk-core/src/index.ts @@ -1,5 +1,6 @@ export * from './sinch-client'; export * from '@sinch/conversation'; +export * from '@sinch/elastic-sip-trunking'; export * from '@sinch/fax'; export * from '@sinch/numbers'; export * from '@sinch/sms'; diff --git a/packages/sdk-core/src/sinch-client.ts b/packages/sdk-core/src/sinch-client.ts index 2713cc00..da27e38c 100644 --- a/packages/sdk-core/src/sinch-client.ts +++ b/packages/sdk-core/src/sinch-client.ts @@ -5,12 +5,14 @@ import { SmsService } from '@sinch/sms'; import { VerificationService } from '@sinch/verification'; import { VoiceService } from '@sinch/voice'; import { SinchClientParameters } from '@sinch/sdk-client'; +import { ElasticSipTrunkingService } from '@sinch/elastic-sip-trunking'; /** Sinch Client to declare and initialize the supported APIs */ export class SinchClient { public readonly conversation: ConversationService; public readonly fax: FaxService; + public readonly elasticSipTrunking: ElasticSipTrunkingService; public readonly numbers: NumbersService; public readonly sms: SmsService; public readonly verification: VerificationService; @@ -23,6 +25,7 @@ export class SinchClient { */ constructor(params: SinchClientParameters) { this.conversation = new ConversationService(params); + this.elasticSipTrunking = new ElasticSipTrunkingService(params); this.fax = new FaxService(params); this.numbers = new NumbersService(params); this.sms = new SmsService(params);