diff --git a/src/index.ts b/src/index.ts index f0e8048..cbb524c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,7 +30,7 @@ export { DisconnectMethodEnum } from './models/disconnectMethodEnum'; export { Diversion } from './models/diversion'; export { FallbackMethodEnum } from './models/fallbackMethodEnum'; export { FileFormatEnum } from './models/fileFormatEnum'; -export { MachineDetectionRequest } from './models/machineDetectionRequest'; +export { MachineDetectionConfiguration } from './models/machineDetectionConfiguration'; export { ModeEnum } from './models/modeEnum'; export { ModifyCallRecordingRequest } from './models/modifyCallRecordingRequest'; export { ModifyCallRequest } from './models/modifyCallRequest'; diff --git a/src/models/createCallRequest.ts b/src/models/createCallRequest.ts index 1461b45..7a10002 100644 --- a/src/models/createCallRequest.ts +++ b/src/models/createCallRequest.ts @@ -23,9 +23,9 @@ import { disconnectMethodEnumSchema, } from './disconnectMethodEnum'; import { - MachineDetectionRequest, - machineDetectionRequestSchema, -} from './machineDetectionRequest'; + MachineDetectionConfiguration, + machineDetectionConfigurationSchema, +} from './machineDetectionConfiguration'; export interface CreateCallRequest { /** Format is E164 */ @@ -48,7 +48,7 @@ export interface CreateCallRequest { disconnectMethod?: DisconnectMethodEnum | null; tag?: string | null; applicationId: string; - machineDetection?: MachineDetectionRequest; + machineDetection?: MachineDetectionConfiguration; } export const createCallRequestSchema: Schema = object({ @@ -77,6 +77,6 @@ export const createCallRequestSchema: Schema = object({ applicationId: ['applicationId', string()], machineDetection: [ 'machineDetection', - optional(lazy(() => machineDetectionRequestSchema)), + optional(lazy(() => machineDetectionConfigurationSchema)), ], }); diff --git a/src/models/machineDetectionRequest.ts b/src/models/machineDetectionConfiguration.ts similarity index 95% rename from src/models/machineDetectionRequest.ts rename to src/models/machineDetectionConfiguration.ts index 7cc5778..2eec760 100644 --- a/src/models/machineDetectionRequest.ts +++ b/src/models/machineDetectionConfiguration.ts @@ -23,7 +23,7 @@ import { } from './fallbackMethodEnum'; import { ModeEnum, modeEnumSchema } from './modeEnum'; -export interface MachineDetectionRequest { +export interface MachineDetectionConfiguration { /** The machine detection mode. If set to 'async', the detection result will be sent in a 'machineDetectionComplete' callback. If set to 'sync', the 'answer' callback will wait for the machine detection to complete and will include its result. Default is 'async'. */ mode?: ModeEnum; /** Total amount of time (in seconds) before giving up. */ @@ -47,7 +47,7 @@ export interface MachineDetectionRequest { fallbackPassword?: string | null; } -export const machineDetectionRequestSchema: Schema = object( +export const machineDetectionConfigurationSchema: Schema = object( { mode: ['mode', optional(modeEnumSchema)], detectionTimeout: ['detectionTimeout', optional(number())], diff --git a/tests/api.test.js b/tests/api.test.js index 5b5f00c..9d8d82b 100644 --- a/tests/api.test.js +++ b/tests/api.test.js @@ -1,4 +1,4 @@ -import { ApiError, ApiController, Client, ModeEnum, CallbackMethodEnum, MachineDetectionRequest } from '../src'; +import { ApiError, ApiController, Client, ModeEnum, CallbackMethodEnum, MachineDetectionConfiguration } from '../src'; let controller;