From 6523ba82d71d50f263d140f9bbf32ed044ceaf72 Mon Sep 17 00:00:00 2001 From: Serge Mosin Date: Wed, 18 Feb 2026 14:10:52 +0000 Subject: [PATCH 1/6] Add integration test for machine_v3 transcriber via submitJobUrl This test currently fails with 400 because submitJobUrl sends media_url which is not supported by the v3 transcriber. It will pass once we migrate to source_config. Co-Authored-By: Claude Opus 4.6 --- test/integration/test/job-v3.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/integration/test/job-v3.test.js diff --git a/test/integration/test/job-v3.test.js b/test/integration/test/job-v3.test.js new file mode 100644 index 00000000..a30ead2e --- /dev/null +++ b/test/integration/test/job-v3.test.js @@ -0,0 +1,14 @@ +const clientHelper = require('../src/client-helper'); + +test('Can submit url with machine_v3 transcriber', async () => { + const client = clientHelper.getAsyncClient(); + const options = { + metadata: 'Node sdk v3 submit url test', + transcriber: 'machine_v3' + }; + + const job = await client.submitJobUrl('https://www.rev.ai/FTC_Sample_1.mp3', options); + + expect(job.status).toBe('in_progress'); + expect(job.id).not.toBeNull(); +}, 30000); From dbff9dfdb2a42e57008af644adb919452a82d567 Mon Sep 17 00:00:00 2001 From: Serge Mosin Date: Wed, 18 Feb 2026 14:11:41 +0000 Subject: [PATCH 2/6] Add unit tests for source_config migration in submitJobUrl Two failing tests: - submitJobUrl should send source_config instead of media_url - submitJobUrl should throw when options contain source_config Co-Authored-By: Claude Opus 4.6 --- .../unit/api-client/api-client.submit.spec.ts | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/unit/api-client/api-client.submit.spec.ts b/test/unit/api-client/api-client.submit.spec.ts index 8736a5e1..d3d69ffa 100644 --- a/test/unit/api-client/api-client.submit.spec.ts +++ b/test/unit/api-client/api-client.submit.spec.ts @@ -148,6 +148,26 @@ describe('api-client job submission', () => { expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); + + it('submit job with media url sends source_config instead of media_url', async () => { + const job = await sut.submitJobUrl(mediaUrl); + + expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', + { 'Content-Type': 'application/json' }, 'json', { source_config: { url: mediaUrl } }); + expect(mockMakeApiRequest).toBeCalledTimes(1); + expect(job).toEqual(jobDetails); + }); + + it('submit job with media url throws error when options contain source_config', async () => { + const options: RevAiJobOptions = { + source_config: { url: 'https://other.url/audio.mp3' } + }; + + await expect(sut.submitJobUrl(mediaUrl, options)).rejects.toThrow( + 'source_config.url is not compatible with submitJobUrl. Remove source_config.url from options or use submitJob instead.' + ); + expect(mockMakeApiRequest).not.toBeCalled(); + }); }); describe('submitJob', () => { From 8859a1d921b65fff2fee902ae52cc84671220983 Mon Sep 17 00:00:00 2001 From: Serge Mosin Date: Wed, 18 Feb 2026 14:13:16 +0000 Subject: [PATCH 3/6] Migrate submitJobUrl from media_url to source_config - submitJobUrl now sends source_config: { url: mediaUrl } instead of media_url, enabling support for the machine_v3 transcriber - Add validation: throw error if options already contain source_config - Update existing unit test assertions accordingly Co-Authored-By: Claude Opus 4.6 --- src/api-client.ts | 6 +++++- test/unit/api-client/api-client.submit.spec.ts | 16 ++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/api-client.ts b/src/api-client.ts index ff3a4c84..adb1a1de 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -118,8 +118,12 @@ export class RevAiApiClient { * @deprecated Use submitJob and provide a source config to the job options */ async submitJobUrl(mediaUrl: string, options?: RevAiJobOptions): Promise { + if (options?.source_config) { + throw new Error('source_config.url is not compatible with submitJobUrl. Remove source_config.url from options or use submitJob instead.'); + } + options = this.filterNullOptions({ - media_url: mediaUrl, + source_config: { url: mediaUrl }, ...(options || {}) }); diff --git a/test/unit/api-client/api-client.submit.spec.ts b/test/unit/api-client/api-client.submit.spec.ts index d3d69ffa..a863776a 100644 --- a/test/unit/api-client/api-client.submit.spec.ts +++ b/test/unit/api-client/api-client.submit.spec.ts @@ -47,7 +47,7 @@ describe('api-client job submission', () => { const job = await sut.submitJobUrl(mediaUrl); expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', - { 'Content-Type': 'application/json' }, 'json', { media_url: mediaUrl }); + { 'Content-Type': 'application/json' }, 'json', { source_config: { url: mediaUrl } }); expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); @@ -56,7 +56,7 @@ describe('api-client job submission', () => { const job = await sut.submitJobUrl(mediaUrl, null); expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', - { 'Content-Type': 'application/json' }, 'json', { media_url: mediaUrl }); + { 'Content-Type': 'application/json' }, 'json', { source_config: { url: mediaUrl } }); expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); @@ -65,7 +65,7 @@ describe('api-client job submission', () => { const job = await sut.submitJobUrl(mediaUrl, {}); expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', - { 'Content-Type': 'application/json' }, 'json', { media_url: mediaUrl }); + { 'Content-Type': 'application/json' }, 'json', { source_config: { url: mediaUrl } }); expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); @@ -76,7 +76,7 @@ describe('api-client job submission', () => { const job = await sut.submitJobUrl(mediaUrl, options); expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', - { 'Content-Type': 'application/json' }, 'json', { media_url: mediaUrl }); + { 'Content-Type': 'application/json' }, 'json', { source_config: { url: mediaUrl } }); expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); @@ -91,7 +91,6 @@ describe('api-client job submission', () => { speaker_channels_count: 1, speakers_count: 123, filter_profanity: true, - media_url: mediaUrl, remove_disfluencies: true, delete_after_seconds: 0, language: 'en', @@ -102,7 +101,8 @@ describe('api-client job submission', () => { const job = await sut.submitJobUrl(mediaUrl, options); expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', - { 'Content-Type': 'application/json' }, 'json', options); + { 'Content-Type': 'application/json' }, 'json', + { ...options, source_config: { url: mediaUrl } }); expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); @@ -115,7 +115,7 @@ describe('api-client job submission', () => { const job = await sut.submitJobUrl(mediaUrl, options); expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', - { 'Content-Type': 'application/json' }, 'json', { ...options, media_url: mediaUrl }); + { 'Content-Type': 'application/json' }, 'json', { ...options, source_config: { url: mediaUrl } }); expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); @@ -144,7 +144,7 @@ describe('api-client job submission', () => { const job = await sut.submitJobUrl(mediaUrl, options); expect(mockMakeApiRequest).toBeCalledWith('post', '/jobs', - { 'Content-Type': 'application/json' }, 'json', { ...options, media_url: mediaUrl }); + { 'Content-Type': 'application/json' }, 'json', { ...options, source_config: { url: mediaUrl } }); expect(mockMakeApiRequest).toBeCalledTimes(1); expect(job).toEqual(jobDetails); }); From d73cdc01fac6fa72c8bade6b7f1b3e4c1854a923 Mon Sep 17 00:00:00 2001 From: Serge Mosin Date: Wed, 18 Feb 2026 17:35:32 +0000 Subject: [PATCH 4/6] Fix CI: line length lint errors and linkChecker false positive - Break long error message in submitJobUrl across multiple lines - Break long assertion string in unit test - Replace fake URL with existing mediaUrl constant to avoid linkChecker DNS resolution failure Co-Authored-By: Claude Opus 4.6 --- src/api-client.ts | 5 ++++- test/unit/api-client/api-client.submit.spec.ts | 10 ++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/api-client.ts b/src/api-client.ts index adb1a1de..3f08cea1 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -119,7 +119,10 @@ export class RevAiApiClient { */ async submitJobUrl(mediaUrl: string, options?: RevAiJobOptions): Promise { if (options?.source_config) { - throw new Error('source_config.url is not compatible with submitJobUrl. Remove source_config.url from options or use submitJob instead.'); + throw new Error( + 'source_config is not compatible with submitJobUrl.' + + ' Remove source_config from options or use submitJob instead.' + ); } options = this.filterNullOptions({ diff --git a/test/unit/api-client/api-client.submit.spec.ts b/test/unit/api-client/api-client.submit.spec.ts index a863776a..4fcf46f0 100644 --- a/test/unit/api-client/api-client.submit.spec.ts +++ b/test/unit/api-client/api-client.submit.spec.ts @@ -160,12 +160,14 @@ describe('api-client job submission', () => { it('submit job with media url throws error when options contain source_config', async () => { const options: RevAiJobOptions = { - source_config: { url: 'https://other.url/audio.mp3' } + source_config: { url: mediaUrl } }; - await expect(sut.submitJobUrl(mediaUrl, options)).rejects.toThrow( - 'source_config.url is not compatible with submitJobUrl. Remove source_config.url from options or use submitJob instead.' - ); + await expect(sut.submitJobUrl(mediaUrl, options)) + .rejects.toThrow( + 'source_config is not compatible with submitJobUrl.' + + ' Remove source_config from options' + ); expect(mockMakeApiRequest).not.toBeCalled(); }); }); From 430b8453700962316113b9abbd2b404170e7baba Mon Sep 17 00:00:00 2001 From: Serge Mosin Date: Thu, 19 Feb 2026 19:06:56 +0000 Subject: [PATCH 5/6] Fix linkChecker CI: exclude npmjs.com from lychee npmjs.com returns 403 to automated link checkers, causing a false positive failure on the README npm badge link. Co-Authored-By: Claude Opus 4.6 --- .lycheeignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.lycheeignore b/.lycheeignore index b69e5c08..7d766c79 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -5,5 +5,8 @@ getbaseurl # example domains used in unit tests www.example.com +# npmjs.com blocks automated link checkers with 403 +https://www.npmjs.com + # email used in unit tests test@rev.com From 05b62e78b9f38579bf47a6f4ed68a0f47043fd0b Mon Sep 17 00:00:00 2001 From: Serge Mosin Date: Thu, 19 Feb 2026 19:22:13 +0000 Subject: [PATCH 6/6] Bump version to 3.9.0 Co-Authored-By: Claude Opus 4.6 --- package-lock.json | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5e59e35c..bed73174 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,12 @@ { "name": "revai-node-sdk", - "version": "3.8.0", + "version": "3.9.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "3.8.0", + "name": "revai-node-sdk", + "version": "3.9.0", "license": "MIT", "dependencies": { "axios": "^0.21.1", diff --git a/package.json b/package.json index 3f3e544c..748e47e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revai-node-sdk", - "version": "3.8.6", + "version": "3.9.0", "description": "Rev AI makes speech applications easy to build!", "main": "src/index.js", "scripts": {