/// /// import { Readable } from 'stream'; import { ApiRequestHandler } from './api-request-handler'; import { CaptionType } from './models/async/CaptionType'; import { RevAiAccount } from './models/async/RevAiAccount'; import { RevAiJobOptions } from './models/async/RevAiJobOptions'; import { RevAiApiClientConfig } from './models/RevAiApiClientConfig'; import { RevAiApiJob } from './models/RevAiApiJob'; import { RevAiApiTranscript } from './models/RevAiApiTranscript'; import { Summary } from './models/async/Summary'; /** * Client which handles connection to the Rev AI speech to text API. */ export declare class RevAiApiClient { private apiClientConfig; apiHandler: ApiRequestHandler; /** * @param either string Access token used to validate API requests or RevAiApiClientConfig object * @param version (optional) version of the API to be used with string Acces token */ constructor(params: RevAiApiClientConfig | string, version?: string); /** * See https://docs.rev.ai/api/asynchronous/reference/#tag/Account * Get information associated with the account whose access token is used by this client * @returns Account object */ getAccount(): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetJobById * Get information about a specific job * @param id Id of job whose details are to be retrieved * @returns Job details */ getJobDetails(id: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetListOfJobs * Get a list of transcription jobs submitted within the last 30 days in reverse chronological order * (last submitted first) up to the provided limit number of jobs per call. Pagination is supported via passing * the last job id from previous call into starting_after. * @param limit (optional) maximum number of jobs to retrieve, default is 100 * @param startingAfter (optional) returns only jobs created after the job with this id, exclusive * @returns List of job details */ getListOfJobs(limit?: number, startingAfter?: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/DeleteJobById * Delete a specific transcription job. * All data related to the job, such as input media and transcript, will be permanently deleted. * A job can only by deleted once it's completed. * @param id Id of job to be deleted */ deleteJob(id: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob * Submit media given a URL for transcription. The audio data is downloaded from the URL. * @param mediaUrl Web location of media to be downloaded and transcribed * @param options (optional) Options submitted with the job: see RevAiJobOptions object * @returns Details of the submitted job * @deprecated Use submitJob and provide a source config to the job options */ submitJobUrl(mediaUrl: string, options?: RevAiJobOptions): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob * Submit a job with a remote source URL for transcription. The audio data is downloaded from the URL. * @param options Options submitted with the job: see RevAiJobOptions object * @returns Details of the submitted job */ submitJob(options?: RevAiJobOptions): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob * Submit audio data for transcription. * @param audioData Audio data to be transcribed. * @param filename (optional) Name of file associated with audio. * @param options (optional) Options submitted with the job, see RevAiJobOptions object * or https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob * @returns Details of submitted job */ submitJobAudioData(audioData: Buffer | Readable, filename?: string, options?: RevAiJobOptions): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob * Send local file for transcription. * @param filepath Path to local file to be transcribed. Assumes the process has access to read this file. * @param options (optional) Options submitted with the job, see RevAiJobOptions object * or https://docs.rev.ai/api/asynchronous/reference/#operation/SubmitTranscriptionJob * @returns Details of submitted job */ submitJobLocalFile(filepath: string, options?: RevAiJobOptions): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get transcript of a job as a javascript object, see the RevAiApiTranscript object. * @param id Id of job to retrieve the transcript of * @returns Transcript of job as a javascript object. */ getTranscriptObject(id: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get translated transcript of a job as a javascript object, see the RevAiApiTranscript object. * @param id Id of job to retrieve the transcript of * @param language requested language * @returns Transcript of job as a javascript object. */ getTranslatedTranscriptObject(id: string, language: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get transcript of a job as a stream of JSON. * Use for large transcripts or transcripts meant to be written directly to file. * @param id Id of job to retrieve transcript of * @returns ReadableStream containing JSON of transcript */ getTranscriptObjectStream(id: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get translated transcript of a job as a stream of JSON. * Use for large transcripts or transcripts meant to be written directly to file. * @param id Id of job to retrieve transcript of * @param language requested language * @returns ReadableStream containing JSON of transcript */ getTranslatedTranscriptObjectStream(id: string, language: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get transcript of a job as plain text. * @param id Id of job to retrieve transcript of * @returns Transcript of the requested job as a readable text string */ getTranscriptText(id: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get translated transcript of a job as plain text. * @param id Id of job to retrieve transcript of * @param language requested language * @returns Transcript of the requested job as a readable text string */ getTranslatedTranscriptText(id: string, language: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get transcript of a job as a stream of plain text. * Use for large transcripts or transcripts meant to be written directly to file. * @param id Id of job to retrieve transcript of * @returns ReadableStream containing text of transcript */ getTranscriptTextStream(id: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetTranscriptById * Get transcript of a job as a stream of plain text. * Use for large transcripts or transcripts meant to be written directly to file. * @param id Id of job to retrieve transcript of * @returns ReadableStream containing text of transcript */ getTranslatedTranscriptTextStream(id: string, language: string): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetCaptions * Get captions created from the transcript of a job. * Captions are only retrievable in a stream and can be obtained in either SRT or VTT format. * @param id Id of job to get captions of * @param contentType Type of Captions to retrieve, see enum CaptionType for options * @param channelId If the job was submitted using speaker_channels_count, * provide a speaker channel to be captioned. If no speaker_channels_count was provided on submission * this parameter should not be provided. * @returns ReadableStream of captions in requested format */ getCaptions(id: string, contentType?: CaptionType, channelId?: number): Promise; /** * See https://docs.rev.ai/api/asynchronous/reference/#operation/GetCaptions * Get captions created from translated transcript of a job. * Captions are only retrievable in a stream and can be obtained in either SRT or VTT format. * @param id Id of job to get captions of * @param language requested language * @param contentType Type of Captions to retrieve, see enum CaptionType for options * @param channelId If the job was submitted using speaker_channels_count, * provide a speaker channel to be captioned. If no speaker_channels_count was provided on submission * this parameter should not be provided. * @returns ReadableStream of captions in requested format */ getTranslatedCaptions(id: string, language: string, contentType?: string): Promise; /** * Get transcript summary as text. * @param id The ID of the job to return a transcript summary for. * @return The transcript summary as a String in text format. */ getTranscriptSummaryText(id: string): Promise; /** * Get transcript summary as text stream. * @param id The ID of the job to return a transcript summary for. * @return The transcript summary as a String in text format. */ getTranscriptSummaryTextStream(id: string): Promise; /** * Get transcript summary as object. * @param id The ID of the job to return a transcript summary for. * @return The transcript summary as a javscript object. See the Summary object. */ getTranscriptSummaryObject(id: string): Promise; /** * Get transcript summary as object stream. * @param id The ID of the job to return a transcript summary for. * @return The transcript summary as a javscript object. See the Summary object. */ getTranscriptSummaryObjectStream(id: string): Promise; private filterNullOptions; }