UNPKG

@speechmatics/batch-client

Version:

Javascript client for the Speechmatics batch jobs API

1 lines 63.2 kB
{"version":3,"file":"index.mjs","sources":["../models/error-response.ts","../src/errors.ts","../src/request.ts","../src/poll.ts","../src/client.ts","../models/auto-chapters-result-error.ts","../models/job-details.ts","../models/job-mode.ts","../models/job-type.ts","../models/language-identification-config.ts","../models/language-identification-result.ts","../models/language-pack-info.ts","../models/notification-config.ts","../models/operating-point.ts","../models/recognition-display.ts","../models/recognition-result.ts","../models/sentiment-analysis-error.ts","../models/spoken-form-recognition-result.ts","../models/summarization-config.ts","../models/summarization-error.ts","../models/topic-detection-error.ts","../models/transcription-config.ts","../models/translation-error.ts","../models/written-form-recognition-result.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface ErrorResponse\n */\nexport interface ErrorResponse {\n /**\n * The HTTP status code.\n * @type {number}\n * @memberof ErrorResponse\n */\n code: number;\n /**\n * The error message.\n * @type {string}\n * @memberof ErrorResponse\n */\n error: ErrorResponseErrorEnum;\n /**\n * The details of the error.\n * @type {string}\n * @memberof ErrorResponse\n */\n detail?: string;\n}\n\nexport const ErrorResponseErrorEnum = {\n BadRequest: 'Bad Request',\n FileExpired: 'File Expired',\n Forbidden: 'Forbidden',\n ResourceLocked: 'Resource Locked',\n FormatNotSupported: 'Format Not Supported',\n InternalServerError: 'Internal Server Error',\n JobError: 'Job error',\n JobExpired: 'Job Expired',\n JobInProgress: 'Job In Progress',\n JobIsNotOfTypeAlignment: 'Job is not of type alignment',\n JobIsNotOfTypeTranscription: 'Job is not of type transcription',\n JobNotFound: 'Job not found',\n JobRejected: 'Job rejected',\n JobRejectedDueToInvalidAudio: 'Job rejected due to invalid audio',\n JobRejectedDueToInvalidText: 'Job rejected due to invalid text',\n MalformedRequest: 'Malformed request',\n MissingCallback: 'Missing callback',\n MissingDataFile: 'Missing data_file',\n MissingTextFile: 'Missing text_file',\n NoLanguageSelected: 'No language selected',\n NotImplemented: 'Not Implemented',\n PermissionDenied: 'Permission Denied',\n RequestedProductNotAvailable: 'Requested product not available',\n TranscriptionNotReady: 'Transcription not ready',\n LogFileNotAvailable: 'Log file not available',\n RequestedEarlyAccessReleaseNotAvailable:\n 'Requested Early Access Release not available',\n UnprocessableEntity: 'Unprocessable Entity',\n} as const;\n\nexport type ErrorResponseErrorEnum =\n (typeof ErrorResponseErrorEnum)[keyof typeof ErrorResponseErrorEnum];\n","import { z } from 'zod';\n\nimport {\n type ErrorResponse,\n ErrorResponseErrorEnum,\n} from '../models/error-response';\n\nconst ErrorResponseSchema: z.ZodType<ErrorResponse> = z.object({\n code: z.number(),\n detail: z.optional(z.string()),\n error: z.nativeEnum(ErrorResponseErrorEnum),\n});\n\ntype SpeechamticsErrorEnum = InternalErrorEnum | ErrorResponseErrorEnum;\ninterface SpeechmaticsErrorInterface extends Error {\n error: SpeechamticsErrorEnum;\n}\n\nexport class SpeechmaticsResponseError\n extends Error\n implements SpeechmaticsErrorInterface\n{\n response: ErrorResponse;\n error: ErrorResponseErrorEnum;\n\n constructor(errorResponse: ErrorResponse | unknown) {\n const parse = ErrorResponseSchema.safeParse(errorResponse);\n if (parse.success) {\n super(parse.data.error);\n this.response = parse.data;\n this.error = parse.data.error;\n this.name = 'SpeechmaticsResponseError';\n } else {\n throw new SpeechmaticsUnexpectedResponse(undefined, errorResponse);\n }\n }\n}\n\nexport const InternalErrorEnum = {\n ConfigurationError: 'Configuration error',\n NetworkError: 'Network error',\n UnsupportedEnvironment: 'Unsupported environment',\n UnexpectedMessage: 'Unexpected message',\n UnexpectedResponse: 'Unexpected response',\n InvalidTypeError: 'Invalid type error',\n} as const;\n\nexport type InternalErrorEnum =\n (typeof InternalErrorEnum)[keyof typeof InternalErrorEnum];\n\nclass SpeechmaticsInternalError extends Error {\n error: InternalErrorEnum;\n cause?: unknown; // e.g. a caught error or response\n\n constructor(error: InternalErrorEnum, message?: string, cause?: unknown) {\n super(message ?? error);\n this.name = 'SpeechmaticsInternalError';\n this.error = error;\n this.cause = cause;\n }\n}\n\nexport class SpeechmaticsConfigurationError extends SpeechmaticsInternalError {\n constructor(message?: string) {\n super(InternalErrorEnum.ConfigurationError, message);\n this.name = 'SpeechmaticsConfigurationError';\n }\n}\nexport class SpeechmaticsNetworkError extends SpeechmaticsInternalError {\n constructor(message?: string, cause?: unknown) {\n super(InternalErrorEnum.NetworkError, message, cause);\n this.name = 'SpeechmaticsNetworkError';\n }\n}\nexport class SpeechmaticsUnsupportedEnvironment extends SpeechmaticsInternalError {\n constructor(message?: string) {\n super(InternalErrorEnum.UnsupportedEnvironment, message);\n this.name = 'SpeechmaticsUnsupportedEnvironment';\n }\n}\nexport class SpeechmaticsUnexpectedMessage extends SpeechmaticsInternalError {\n constructor(message?: string) {\n super(InternalErrorEnum.UnexpectedMessage, message);\n this.name = 'SpeechmaticsUnexpectedMessage';\n }\n}\nexport class SpeechmaticsUnexpectedResponse extends SpeechmaticsInternalError {\n constructor(message?: string, response?: unknown) {\n super(InternalErrorEnum.UnexpectedResponse, message, response);\n this.name = 'SpeechmaticsUnexpectedResponse';\n }\n}\nexport class SpeechmaticsInvalidTypeError extends SpeechmaticsInternalError {\n constructor(message?: string, cause?: unknown) {\n super(InternalErrorEnum.InvalidTypeError, message, cause);\n this.name = 'SpeechmaticsInvalidTypeError';\n }\n}\n\nexport type SpeechmaticsError =\n | SpeechmaticsInternalError\n | SpeechmaticsResponseError;\n","import {\n SpeechmaticsInvalidTypeError,\n SpeechmaticsNetworkError,\n SpeechmaticsResponseError,\n} from './errors';\n\nexport type HttpMethod = 'GET' | 'PUT' | 'POST' | 'DELETE';\n\nexport type QueryParams = Readonly<\n Record<string, string | number | boolean | undefined>\n>;\n\nexport async function request<T>(\n apiKey: string,\n url: string,\n path: string,\n method: HttpMethod = 'POST',\n payload?: BodyInit | null | undefined,\n params?: QueryParams,\n contentType?: string,\n): Promise<T> {\n const requestOptions: RequestInit = {\n method,\n headers: {\n ...(contentType ? { 'Content-Type': contentType } : {}),\n Authorization: `Bearer ${apiKey}`,\n },\n body: payload,\n };\n\n // Add sdk information as url query parameter\n const parsedUrl = new URL(path, url);\n let fullUrl = addSDKInfoToRequestUrl(parsedUrl.href);\n if (params) {\n fullUrl = addQueryParamsToUrl(fullUrl, params);\n }\n\n let response: Response;\n try {\n response = await fetch(fullUrl, requestOptions);\n } catch (err) {\n throw new SpeechmaticsNetworkError(`Error fetching from ${path}`, err);\n }\n\n if (!response.ok) {\n const responseJson = await response.json();\n throw new SpeechmaticsResponseError(responseJson);\n }\n\n const isPlain = contentType === 'text/plain';\n\n let result: T;\n\n if (isPlain) {\n try {\n result = (await response.text()) as T;\n } catch (err) {\n throw new SpeechmaticsInvalidTypeError(\n 'Failed to parse response text',\n err,\n );\n }\n } else {\n try {\n result = (await response.json()) as T;\n } catch (err) {\n throw new SpeechmaticsInvalidTypeError(\n 'Failed to parse response JSON',\n err,\n );\n }\n }\n\n return result;\n}\n\nexport const SM_SDK_PARAM_NAME = 'sm-sdk';\nexport const SM_APP_PARAM_NAME = 'sm-app';\n\n// This is templated by the build process\ndeclare const SDK_VERSION: string;\n\nexport function getSmSDKVersion(): string {\n return `js-${SDK_VERSION}`;\n}\n\nexport function addQueryParamsToUrl(\n url: string,\n queryParams: QueryParams,\n): string {\n const parsedUrl = new URL(url);\n const params = new URLSearchParams(parsedUrl.search);\n\n for (const key of Object.keys(queryParams)) {\n const value = queryParams[key];\n if (value !== undefined) params.append(key, `${value}`);\n }\n\n parsedUrl.search = params.toString();\n return parsedUrl.href;\n}\n\nexport function addSDKInfoToRequestUrl(url: string): string {\n return addQueryParamsToUrl(url, { [SM_SDK_PARAM_NAME]: getSmSDKVersion() });\n}\n","export function poll(\n cb: () => Promise<boolean>,\n interval = 500,\n timeout = 60 * 1000,\n): Promise<void> {\n return new Promise((resolve, reject) => {\n let pollInterval: ReturnType<typeof setInterval> | undefined = undefined;\n\n const errTimeout = setTimeout(() => {\n typeof pollInterval !== 'undefined' && clearInterval(pollInterval);\n reject(new Error(`Exceeded timeout of ${timeout} ms`));\n }, timeout);\n\n pollInterval = setInterval(() => {\n cb()\n .then((resolved) => {\n if (resolved) {\n clearTimeout(errTimeout);\n clearInterval(pollInterval);\n resolve();\n }\n })\n .catch((err) => {\n clearTimeout(errTimeout);\n clearInterval(pollInterval);\n reject(err);\n });\n }, interval);\n });\n}\n","import type { CreateJobResponse } from '../models/create-job-response';\nimport type { RetrieveJobResponse } from '../models/retrieve-job-response';\nimport type { RetrieveTranscriptResponse } from '../models/retrieve-transcript-response';\nimport type { RetrieveJobsResponse } from '../models/retrieve-jobs-response';\nimport type { DeleteJobResponse } from '../models/delete-job-response';\nimport type { DataFetchConfig } from '../models/data-fetch-config';\nimport type { JobConfig } from '../models/job-config';\nimport type { TranscriptionConfig } from '../models/transcription-config';\nimport type { BatchFeatureDiscovery } from './features';\nimport { type QueryParams, request, SM_APP_PARAM_NAME } from './request';\nimport { poll } from './poll';\n\nexport class BatchClient {\n public apiKey: string;\n private apiUrl: string;\n public readonly appId: string;\n\n constructor({\n apiKey,\n apiUrl,\n appId,\n }: { apiKey: string; apiUrl?: string; appId: string }) {\n this.apiKey = apiKey;\n this.apiUrl = apiUrl ?? 'https://asr.api.speechmatics.com/v2';\n this.appId = appId;\n }\n\n private async get<T>(\n endpoint: string,\n contentType?: string,\n queryParams?: QueryParams,\n ): Promise<T> {\n return await request(\n this.apiKey,\n this.apiUrl,\n endpoint,\n 'GET',\n null,\n { ...queryParams, [SM_APP_PARAM_NAME]: this.appId },\n contentType,\n );\n }\n\n private async post<T>(\n endpoint: string,\n body: FormData | null = null,\n contentType?: string,\n ): Promise<T> {\n return await request(\n this.apiKey,\n this.apiUrl,\n endpoint,\n 'POST',\n body,\n { [SM_APP_PARAM_NAME]: this.appId },\n contentType,\n );\n }\n\n private async delete<T>(endpoint: string, params?: QueryParams): Promise<T> {\n return request(this.apiKey, this.apiUrl, endpoint, 'DELETE', null, {\n ...params,\n [SM_APP_PARAM_NAME]: this.appId,\n });\n }\n\n /**\n * The main method for transcribing audio files. It takes a url or a buffer and returns a promise with a transcript.\n *\n *\n * @param config TranscribeConfig\n * @returns Promise<RetrieveTranscriptResponse>. A promise that resolves to a transcript.\n */\n async transcribe(\n input: JobInput,\n jobConfig: Parameters<typeof this.createTranscriptionJob>[1],\n format?: TranscriptionFormat,\n timeoutMS?: number,\n ): Promise<RetrieveTranscriptResponse | string> {\n const submitResponse = await this.createTranscriptionJob(input, jobConfig);\n\n if (submitResponse === null || submitResponse === undefined) {\n throw 'Error: submitResponse is undefined';\n }\n\n await poll(\n async () => {\n const { job } = await this.getJob(submitResponse.id);\n if (job.status === 'rejected') {\n throw job.errors;\n }\n return job.status === 'done';\n },\n 3000, // repeat every 3 seconds\n timeoutMS ?? 15 * 60 * 1000, // 15 minutes timeout default\n );\n\n return await this.getJobResult(submitResponse.id, format);\n }\n\n async createTranscriptionJob(\n input: JobInput,\n jobConfig: CreateJobConfig,\n ): Promise<CreateJobResponse> {\n const config: JobConfig = {\n ...jobConfig,\n type: 'transcription',\n };\n\n const formData = new FormData();\n if ('url' in input) {\n config.fetch_data = input;\n } else if ('data' in input) {\n formData.append('data_file', input.data, input.fileName);\n } else {\n formData.append('data_file', input);\n }\n formData.append('config', JSON.stringify(config));\n\n return this.post('/v2/jobs', formData);\n }\n\n async listJobs(\n filters: RetrieveJobsFilters = {},\n ): Promise<RetrieveJobsResponse> {\n return this.get('/v2/jobs', 'application/json', { ...filters });\n }\n\n async getJob(id: string): Promise<RetrieveJobResponse> {\n return this.get(`/v2/jobs/${id}`, 'application/json');\n }\n\n async deleteJob(id: string, force = false): Promise<DeleteJobResponse> {\n const params = force ? { force } : undefined;\n return this.delete(`/v2/jobs/${id}`, params);\n }\n\n // No format, defaults to JSON-V2 with response body returned\n async getJobResult(jobId: string): Promise<RetrieveTranscriptResponse>;\n async getJobResult(\n jobId: string,\n format: 'json-v2',\n ): Promise<RetrieveTranscriptResponse>;\n // Text/SRT returns string\n async getJobResult(jobId: string, format: 'text' | 'srt'): Promise<string>;\n // If which precise format is unknown at compile time, could be either response body or string\n async getJobResult(\n jobId: string,\n format?: TranscriptionFormat,\n ): Promise<RetrieveTranscriptResponse | string>;\n async getJobResult(\n jobId: string,\n format: TranscriptionFormat = 'json-v2',\n ): Promise<RetrieveTranscriptResponse | string> {\n const params = { format: format === 'text' ? 'txt' : format };\n const contentType =\n format === 'json-v2' ? 'application/json' : 'text/plain';\n return this.get(`/v2/jobs/${jobId}/transcript`, contentType, params);\n }\n\n async getDataFile(jobId: string) {\n return this.get(`/v2/jobs/${jobId}/data`, 'application/json');\n }\n\n async getFeatureDiscovery(): Promise<BatchFeatureDiscovery> {\n return this.get('/v1/discovery/features');\n }\n}\n\nexport type TranscriptionFormat = 'json-v2' | 'text' | 'srt';\n\nexport type JobInput =\n | File\n | { data: Blob; fileName: string }\n | DataFetchConfig;\n\ntype CreateJobConfig = Omit<JobConfig, 'type' | 'fetch_data'> & {\n transcription_config: TranscriptionConfig;\n};\n\n/* Note: This type is based on the schema but it is not in a model.\n Currently we are only generating types for models, but if that changes, we can move this. */\nexport interface RetrieveJobsFilters {\n created_before?: string;\n limit?: number;\n include_deleted?: boolean;\n}\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface AutoChaptersResultError\n */\nexport interface AutoChaptersResultError {\n /**\n *\n * @type {string}\n * @memberof AutoChaptersResultError\n */\n type?: AutoChaptersResultErrorTypeEnum;\n /**\n * Human readable error message\n * @type {string}\n * @memberof AutoChaptersResultError\n */\n message?: string;\n}\n\nexport const AutoChaptersResultErrorTypeEnum = {\n AutoChaptersFailed: 'auto_chapters_failed',\n UnsupportedLanguage: 'unsupported_language',\n} as const;\n\nexport type AutoChaptersResultErrorTypeEnum =\n (typeof AutoChaptersResultErrorTypeEnum)[keyof typeof AutoChaptersResultErrorTypeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { JobConfig } from './job-config';\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { JobDetailError } from './job-detail-error';\n\n/**\n * Document describing a job. JobConfig will be present in JobDetails returned for GET jobs/<id> request in SaaS and in Batch Appliance, but it will not be present in JobDetails returned as item in RetrieveJobsResponse in case of Batch Appliance.\n * @export\n * @interface JobDetails\n */\nexport interface JobDetails {\n /**\n * The UTC date time the job was created.\n * @type {string}\n * @memberof JobDetails\n */\n created_at: string;\n /**\n * Name of the data file submitted for job.\n * @type {string}\n * @memberof JobDetails\n */\n data_name: string;\n /**\n * Name of the text file submitted to be aligned to audio.\n * @type {string}\n * @memberof JobDetails\n */\n text_name?: string;\n /**\n * The file duration (in seconds). May be missing for fetch URL jobs.\n * @type {number}\n * @memberof JobDetails\n */\n duration?: number;\n /**\n * The unique id assigned to the job.\n * @type {string}\n * @memberof JobDetails\n */\n id: string;\n /**\n * The status of the job. * `running` - The job is actively running. * `done` - The job completed successfully. * `rejected` - The job was accepted at first, but later could not be processed by the transcriber. * `deleted` - The user deleted the job. * `expired` - The system deleted the job. Usually because the job was in the `done` state for a very long time.\n * @type {string}\n * @memberof JobDetails\n */\n status: JobDetailsStatusEnum;\n /**\n *\n * @type {JobConfig}\n * @memberof JobDetails\n */\n config?: JobConfig;\n /**\n * Optional parameter used for backwards compatibility with v1 api\n * @type {string}\n * @memberof JobDetails\n */\n lang?: string;\n /**\n * Optional list of errors that have occurred in user interaction, for example: audio could not be fetched or notification could not be sent.\n * @type {Array<JobDetailError>}\n * @memberof JobDetails\n */\n errors?: Array<JobDetailError>;\n}\n\nexport const JobDetailsStatusEnum = {\n Running: 'running',\n Done: 'done',\n Rejected: 'rejected',\n Deleted: 'deleted',\n Expired: 'expired',\n} as const;\n\nexport type JobDetailsStatusEnum =\n (typeof JobDetailsStatusEnum)[keyof typeof JobDetailsStatusEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @enum {string}\n */\n\nexport const JobMode = {\n Batch: 'batch',\n} as const;\n\nexport type JobMode = (typeof JobMode)[keyof typeof JobMode];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @enum {string}\n */\n\nexport const JobType = {\n Alignment: 'alignment',\n Transcription: 'transcription',\n} as const;\n\nexport type JobType = (typeof JobType)[keyof typeof JobType];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface LanguageIdentificationConfig\n */\nexport interface LanguageIdentificationConfig {\n /**\n *\n * @type {Array<string>}\n * @memberof LanguageIdentificationConfig\n */\n expected_languages?: Array<string>;\n /**\n * Action to take if all of the predicted languages are below the confidence threshold\n * @type {string}\n * @memberof LanguageIdentificationConfig\n */\n low_confidence_action?: LanguageIdentificationConfigLowConfidenceActionEnum;\n /**\n *\n * @type {string}\n * @memberof LanguageIdentificationConfig\n */\n default_language?: string;\n}\n\nexport const LanguageIdentificationConfigLowConfidenceActionEnum = {\n Allow: 'allow',\n Reject: 'reject',\n UseDefaultLanguage: 'use_default_language',\n} as const;\n\nexport type LanguageIdentificationConfigLowConfidenceActionEnum =\n (typeof LanguageIdentificationConfigLowConfidenceActionEnum)[keyof typeof LanguageIdentificationConfigLowConfidenceActionEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { LanguageIdentificationResultItem } from './language-identification-result-item';\n\n/**\n *\n * @export\n * @interface LanguageIdentificationResult\n */\nexport interface LanguageIdentificationResult {\n /**\n *\n * @type {Array<LanguageIdentificationResultItem>}\n * @memberof LanguageIdentificationResult\n */\n results?: Array<LanguageIdentificationResultItem>;\n /**\n *\n * @type {string}\n * @memberof LanguageIdentificationResult\n */\n error?: LanguageIdentificationResultErrorEnum;\n /**\n *\n * @type {string}\n * @memberof LanguageIdentificationResult\n */\n message?: string;\n}\n\nexport const LanguageIdentificationResultErrorEnum = {\n LowConfidence: 'LOW_CONFIDENCE',\n UnexpectedLanguage: 'UNEXPECTED_LANGUAGE',\n NoSpeech: 'NO_SPEECH',\n FileUnreadable: 'FILE_UNREADABLE',\n Other: 'OTHER',\n} as const;\n\nexport type LanguageIdentificationResultErrorEnum =\n (typeof LanguageIdentificationResultErrorEnum)[keyof typeof LanguageIdentificationResultErrorEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n * Properties of the language pack.\n * @export\n * @interface LanguagePackInfo\n */\nexport interface LanguagePackInfo {\n /**\n * Full descriptive name of the language, e.g. \\'Japanese\\'.\n * @type {string}\n * @memberof LanguagePackInfo\n */\n language_description?: string;\n /**\n * The character to use to separate words.\n * @type {string}\n * @memberof LanguagePackInfo\n */\n word_delimiter: string;\n /**\n * The direction that words in the language should be written and read in.\n * @type {string}\n * @memberof LanguagePackInfo\n */\n writing_direction?: LanguagePackInfoWritingDirectionEnum;\n /**\n * Whether or not ITN (inverse text normalization) is available for the language pack.\n * @type {boolean}\n * @memberof LanguagePackInfo\n */\n itn?: boolean;\n /**\n * Whether or not language model adaptation has been applied to the language pack.\n * @type {boolean}\n * @memberof LanguagePackInfo\n */\n adapted?: boolean;\n}\n\nexport const LanguagePackInfoWritingDirectionEnum = {\n LeftToRight: 'left-to-right',\n RightToLeft: 'right-to-left',\n} as const;\n\nexport type LanguagePackInfoWritingDirectionEnum =\n (typeof LanguagePackInfoWritingDirectionEnum)[keyof typeof LanguagePackInfoWritingDirectionEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface NotificationConfig\n */\nexport interface NotificationConfig {\n /**\n * The url to which a notification message will be sent upon completion of the job. The job `id` and `status` are added as query parameters, and any combination of the job inputs and outputs can be included by listing them in `contents`. If `contents` is empty, the body of the request will be empty. If only one item is listed, it will be sent as the body of the request with `Content-Type` set to an appropriate value such as `application/octet-stream` or `application/json`. If multiple items are listed they will be sent as named file attachments using the multipart content type. If `contents` is not specified, the `transcript` item will be sent as a file attachment named `data_file`, for backwards compatibility. If the job was rejected or failed during processing, that will be indicated by the status, and any output items that are not available as a result will be omitted. The body formatting rules will still be followed as if all items were available. The user-agent header is set to `Speechmatics-API/2.0`, or `Speechmatics API V2` in older API versions.\n * @type {string}\n * @memberof NotificationConfig\n */\n url: string;\n /**\n * Specifies a list of items to be attached to the notification message. When multiple items are requested, they are included as named file attachments.\n * @type {Array<string>}\n * @memberof NotificationConfig\n */\n contents?: Array<NotificationConfigContentsEnum>;\n /**\n * The method to be used with http and https urls. The default is post.\n * @type {string}\n * @memberof NotificationConfig\n */\n method?: NotificationConfigMethodEnum;\n /**\n * A list of additional headers to be added to the notification request when using http or https. This is intended to support authentication or authorization, for example by supplying an OAuth2 bearer token.\n * @type {Array<string>}\n * @memberof NotificationConfig\n */\n auth_headers?: Array<string>;\n}\n\nexport const NotificationConfigContentsEnum = {\n Jobinfo: 'jobinfo',\n Transcript: 'transcript',\n TranscriptJsonV2: 'transcript.json-v2',\n TranscriptTxt: 'transcript.txt',\n TranscriptSrt: 'transcript.srt',\n Alignment: 'alignment',\n AlignmentWordStartAndEnd: 'alignment.word_start_and_end',\n AlignmentOnePerLine: 'alignment.one_per_line',\n Data: 'data',\n Text: 'text',\n} as const;\n\nexport type NotificationConfigContentsEnum =\n (typeof NotificationConfigContentsEnum)[keyof typeof NotificationConfigContentsEnum];\nexport const NotificationConfigMethodEnum = {\n Post: 'post',\n Put: 'put',\n} as const;\n\nexport type NotificationConfigMethodEnum =\n (typeof NotificationConfigMethodEnum)[keyof typeof NotificationConfigMethodEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @enum {string}\n */\n\nexport const OperatingPoint = {\n Standard: 'standard',\n Enhanced: 'enhanced',\n} as const;\n\nexport type OperatingPoint =\n (typeof OperatingPoint)[keyof typeof OperatingPoint];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface RecognitionDisplay\n */\nexport interface RecognitionDisplay {\n /**\n *\n * @type {string}\n * @memberof RecognitionDisplay\n */\n direction: RecognitionDisplayDirectionEnum;\n}\n\nexport const RecognitionDisplayDirectionEnum = {\n Ltr: 'ltr',\n Rtl: 'rtl',\n} as const;\n\nexport type RecognitionDisplayDirectionEnum =\n (typeof RecognitionDisplayDirectionEnum)[keyof typeof RecognitionDisplayDirectionEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { RecognitionAlternative } from './recognition-alternative';\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { SpokenFormRecognitionResult } from './spoken-form-recognition-result';\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { WrittenFormRecognitionResult } from './written-form-recognition-result';\n\n/**\n * An ASR job output item. The primary item types are `word` and `punctuation`. Other item types may be present, for example to provide semantic information of different forms.\n * @export\n * @interface RecognitionResult\n */\nexport interface RecognitionResult {\n /**\n *\n * @type {string}\n * @memberof RecognitionResult\n */\n channel?: string;\n /**\n *\n * @type {number}\n * @memberof RecognitionResult\n */\n start_time: number;\n /**\n *\n * @type {number}\n * @memberof RecognitionResult\n */\n end_time: number;\n /**\n * An indication of the volume of audio across the time period the word was spoken.\n * @type {number}\n * @memberof RecognitionResult\n */\n volume?: number;\n /**\n * Whether the punctuation mark is an end of sentence character. Only applies to punctuation marks.\n * @type {boolean}\n * @memberof RecognitionResult\n */\n is_eos?: boolean;\n /**\n * New types of items may appear without being requested; unrecognized item types can be ignored.\n * @type {string}\n * @memberof RecognitionResult\n */\n type: RecognitionResultTypeEnum;\n /**\n *\n * @type {Array<WrittenFormRecognitionResult>}\n * @memberof RecognitionResult\n */\n written_form?: Array<WrittenFormRecognitionResult>;\n /**\n *\n * @type {Array<SpokenFormRecognitionResult>}\n * @memberof RecognitionResult\n */\n spoken_form?: Array<SpokenFormRecognitionResult>;\n /**\n *\n * @type {Array<RecognitionAlternative>}\n * @memberof RecognitionResult\n */\n alternatives?: Array<RecognitionAlternative>;\n /**\n * Attachment direction of the punctuation mark. This only applies to punctuation marks. This information can be used to produce a well-formed text representation by placing the `word_delimiter` from `language_pack_info` on the correct side of the punctuation mark.\n * @type {string}\n * @memberof RecognitionResult\n */\n attaches_to?: RecognitionResultAttachesToEnum;\n}\n\nexport const RecognitionResultTypeEnum = {\n Word: 'word',\n Punctuation: 'punctuation',\n Entity: 'entity',\n} as const;\n\nexport type RecognitionResultTypeEnum =\n (typeof RecognitionResultTypeEnum)[keyof typeof RecognitionResultTypeEnum];\nexport const RecognitionResultAttachesToEnum = {\n Previous: 'previous',\n Next: 'next',\n Both: 'both',\n None: 'none',\n} as const;\n\nexport type RecognitionResultAttachesToEnum =\n (typeof RecognitionResultAttachesToEnum)[keyof typeof RecognitionResultAttachesToEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface SentimentAnalysisError\n */\nexport interface SentimentAnalysisError {\n /**\n *\n * @type {string}\n * @memberof SentimentAnalysisError\n */\n type?: SentimentAnalysisErrorTypeEnum;\n /**\n * Human readable error message\n * @type {string}\n * @memberof SentimentAnalysisError\n */\n message?: string;\n}\n\nexport const SentimentAnalysisErrorTypeEnum = {\n SentimentAnalysisFailed: 'sentiment_analysis_failed',\n UnsupportedLanguage: 'unsupported_language',\n} as const;\n\nexport type SentimentAnalysisErrorTypeEnum =\n (typeof SentimentAnalysisErrorTypeEnum)[keyof typeof SentimentAnalysisErrorTypeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { RecognitionAlternative } from './recognition-alternative';\n\n/**\n * A SpokenFormRecognitionResult describes a simple object which consists solely of \\'word\\' or \\'punctuation\\' type entries with a start and end time. It can occur only inside the spoken_form property of a full \\\"RecognitionResult\\\"\n * @export\n * @interface SpokenFormRecognitionResult\n */\nexport interface SpokenFormRecognitionResult {\n /**\n *\n * @type {Array<RecognitionAlternative>}\n * @memberof SpokenFormRecognitionResult\n */\n alternatives: Array<RecognitionAlternative>;\n /**\n *\n * @type {number}\n * @memberof SpokenFormRecognitionResult\n */\n end_time: number;\n /**\n *\n * @type {number}\n * @memberof SpokenFormRecognitionResult\n */\n start_time: number;\n /**\n * What kind of object this is. See #/Definitions/RecognitionResult for definitions of the enums.\n * @type {string}\n * @memberof SpokenFormRecognitionResult\n */\n type: SpokenFormRecognitionResultTypeEnum;\n}\n\nexport const SpokenFormRecognitionResultTypeEnum = {\n Word: 'word',\n Punctuation: 'punctuation',\n} as const;\n\nexport type SpokenFormRecognitionResultTypeEnum =\n (typeof SpokenFormRecognitionResultTypeEnum)[keyof typeof SpokenFormRecognitionResultTypeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface SummarizationConfig\n */\nexport interface SummarizationConfig {\n /**\n *\n * @type {string}\n * @memberof SummarizationConfig\n */\n content_type?: SummarizationConfigContentTypeEnum;\n /**\n *\n * @type {string}\n * @memberof SummarizationConfig\n */\n summary_length?: SummarizationConfigSummaryLengthEnum;\n /**\n *\n * @type {string}\n * @memberof SummarizationConfig\n */\n summary_type?: SummarizationConfigSummaryTypeEnum;\n}\n\nexport const SummarizationConfigContentTypeEnum = {\n Auto: 'auto',\n Informative: 'informative',\n Conversational: 'conversational',\n} as const;\n\nexport type SummarizationConfigContentTypeEnum =\n (typeof SummarizationConfigContentTypeEnum)[keyof typeof SummarizationConfigContentTypeEnum];\nexport const SummarizationConfigSummaryLengthEnum = {\n Brief: 'brief',\n Detailed: 'detailed',\n} as const;\n\nexport type SummarizationConfigSummaryLengthEnum =\n (typeof SummarizationConfigSummaryLengthEnum)[keyof typeof SummarizationConfigSummaryLengthEnum];\nexport const SummarizationConfigSummaryTypeEnum = {\n Paragraphs: 'paragraphs',\n Bullets: 'bullets',\n} as const;\n\nexport type SummarizationConfigSummaryTypeEnum =\n (typeof SummarizationConfigSummaryTypeEnum)[keyof typeof SummarizationConfigSummaryTypeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface SummarizationError\n */\nexport interface SummarizationError {\n /**\n *\n * @type {string}\n * @memberof SummarizationError\n */\n type?: SummarizationErrorTypeEnum;\n /**\n * Human readable error message\n * @type {string}\n * @memberof SummarizationError\n */\n message?: string;\n}\n\nexport const SummarizationErrorTypeEnum = {\n SummarizationFailed: 'summarization_failed',\n UnsupportedLanguage: 'unsupported_language',\n} as const;\n\nexport type SummarizationErrorTypeEnum =\n (typeof SummarizationErrorTypeEnum)[keyof typeof SummarizationErrorTypeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface TopicDetectionError\n */\nexport interface TopicDetectionError {\n /**\n *\n * @type {string}\n * @memberof TopicDetectionError\n */\n type?: TopicDetectionErrorTypeEnum;\n /**\n * Human readable error message\n * @type {string}\n * @memberof TopicDetectionError\n */\n message?: string;\n}\n\nexport const TopicDetectionErrorTypeEnum = {\n TopicDetectionFailed: 'topic_detection_failed',\n UnsupportedListOfTopics: 'unsupported_list_of_topics',\n UnsupportedLanguage: 'unsupported_language',\n} as const;\n\nexport type TopicDetectionErrorTypeEnum =\n (typeof TopicDetectionErrorTypeEnum)[keyof typeof TopicDetectionErrorTypeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { OperatingPoint } from './operating-point';\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { TranscriptionConfigAdditionalVocabInner } from './transcription-config-additional-vocab-inner';\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { TranscriptionConfigPunctuationOverrides } from './transcription-config-punctuation-overrides';\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { TranscriptionConfigSpeakerDiarizationConfig } from './transcription-config-speaker-diarization-config';\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { TranscriptionConfigTranscriptFilteringConfig } from './transcription-config-transcript-filtering-config';\n\n/**\n *\n * @export\n * @interface TranscriptionConfig\n */\nexport interface TranscriptionConfig {\n /**\n * Language model to process the audio input, normally specified as an ISO language code\n * @type {string}\n * @memberof TranscriptionConfig\n */\n language: string;\n /**\n * Request a specialized model based on \\'language\\' but optimized for a particular field, e.g. \\\"finance\\\" or \\\"medical\\\".\n * @type {string}\n * @memberof TranscriptionConfig\n */\n domain?: string;\n /**\n * Language locale to be used when generating the transcription output, normally specified as an ISO language code\n * @type {string}\n * @memberof TranscriptionConfig\n */\n output_locale?: string;\n /**\n *\n * @type {OperatingPoint}\n * @memberof TranscriptionConfig\n */\n operating_point?: OperatingPoint;\n /**\n * List of custom words or phrases that should be recognized. Alternative pronunciations can be specified to aid recognition.\n * @type {Array<TranscriptionConfigAdditionalVocabInner>}\n * @memberof TranscriptionConfig\n */\n additional_vocab?: Array<TranscriptionConfigAdditionalVocabInner>;\n /**\n *\n * @type {TranscriptionConfigPunctuationOverrides}\n * @memberof TranscriptionConfig\n */\n punctuation_overrides?: TranscriptionConfigPunctuationOverrides;\n /**\n * Specify whether speaker or channel labels are added to the transcript. The default is `none`. - **none**: no speaker or channel labels are added. - **speaker**: speaker attribution is performed based on acoustic matching; all input channels are mixed into a single stream for processing. - **channel**: multiple input channels are processed individually and collated into a single transcript.\n * @type {string}\n * @memberof TranscriptionConfig\n */\n diarization?: TranscriptionConfigDiarizationEnum;\n /**\n * Transcript labels to use when using collating separate input channels.\n * @type {Array<string>}\n * @memberof TranscriptionConfig\n */\n channel_diarization_labels?: Array<string>;\n /**\n * Include additional \\'entity\\' objects in the transcription results (e.g. dates, numbers) and their original spoken form. These entities are interleaved with other types of results. The concatenation of these words is represented as a single entity with the concatenated written form present in the \\'content\\' field. The entities contain a \\'spoken_form\\' field, which can be used in place of the corresponding \\'word\\' type results, in case a spoken form is preferred to a written form. They also contain a \\'written_form\\', which can be used instead of the entity, if you want a breakdown of the words without spaces. They can still contain non-breaking spaces and other special whitespace characters, as they are considered part of the word for the formatting output. In case of a written_form, the individual word times are estimated and might not be accurate if the order of the words in the written form does not correspond to the order they were actually spoken (such as \\'one hundred million dollars\\' and \\'$100 million\\').\n * @type {boolean}\n * @memberof TranscriptionConfig\n */\n enable_entities?: boolean;\n /**\n * Whether or not to enable flexible endpointing and allow the entity to continue to be spoken.\n * @type {string}\n * @memberof TranscriptionConfig\n */\n max_delay_mode?: TranscriptionConfigMaxDelayModeEnum;\n /**\n *\n * @type {TranscriptionConfigTranscriptFilteringConfig}\n * @memberof TranscriptionConfig\n */\n transcript_filtering_config?: TranscriptionConfigTranscriptFilteringConfig;\n /**\n *\n * @type {TranscriptionConfigSpeakerDiarizationConfig}\n * @memberof TranscriptionConfig\n */\n speaker_diarization_config?: TranscriptionConfigSpeakerDiarizationConfig;\n}\n\nexport const TranscriptionConfigDiarizationEnum = {\n None: 'none',\n Speaker: 'speaker',\n Channel: 'channel',\n} as const;\n\nexport type TranscriptionConfigDiarizationEnum =\n (typeof TranscriptionConfigDiarizationEnum)[keyof typeof TranscriptionConfigDiarizationEnum];\nexport const TranscriptionConfigMaxDelayModeEnum = {\n Fixed: 'fixed',\n Flexible: 'flexible',\n} as const;\n\nexport type TranscriptionConfigMaxDelayModeEnum =\n (typeof TranscriptionConfigMaxDelayModeEnum)[keyof typeof TranscriptionConfigMaxDelayModeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/**\n *\n * @export\n * @interface TranslationError\n */\nexport interface TranslationError {\n /**\n *\n * @type {string}\n * @memberof TranslationError\n */\n type?: TranslationErrorTypeEnum;\n /**\n * Human readable error message\n * @type {string}\n * @memberof TranslationError\n */\n message?: string;\n}\n\nexport const TranslationErrorTypeEnum = {\n TranslationFailed: 'translation_failed',\n UnsupportedTranslationPair: 'unsupported_translation_pair',\n} as const;\n\nexport type TranslationErrorTypeEnum =\n (typeof TranslationErrorTypeEnum)[keyof typeof TranslationErrorTypeEnum];\n","/* tslint:disable */\n/* eslint-disable */\n/**\n * Speechmatics ASR REST API\n * The Speechmatics Automatic Speech Recognition REST API is used to submit ASR jobs and receive the results. The supported job type is transcription of audio files.\n *\n * The version of the OpenAPI document: 2.0.0\n * Contact: support@speechmatics.com\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n// May contain unused imports in some cases\n// @ts-ignore\nimport type { RecognitionAlternative } from './recognition-alternative';\n\n/**\n * A WrittenFormRecognitionResult describes a simple object which consists solely of \\'word\\' type entries with a start and end tim