diff --git a/src/__tests__/convertMarkdownToPdf.test.ts b/src/__tests__/convertMarkdownToPdf.test.ts index 9435442..18c608b 100644 --- a/src/__tests__/convertMarkdownToPdf.test.ts +++ b/src/__tests__/convertMarkdownToPdf.test.ts @@ -102,7 +102,7 @@ describe("convertMarkdownToPdf", () => { }); expect(mockedCreateConversionPayload).toHaveBeenCalledWith(mockMarkdown, "Custom Title", "January 1, 2025"); - expect(mockedAxiosPost).toHaveBeenCalledWith(`${M2PDF_API_URL}/v1/markdown`, mockPayload); + expect(mockedAxiosPost).toHaveBeenCalledWith(`${M2PDF_API_URL}/markdown`, mockPayload); expect(mockedPollConversionStatus).toHaveBeenCalledWith(mockPath, M2PDF_API_URL); expect(mockedDownloadPdf).toHaveBeenCalledWith(mockDownloadUrl, { downloadPath: undefined, @@ -120,7 +120,7 @@ describe("convertMarkdownToPdf", () => { apiUrl: customApiUrl, }); - expect(mockedAxiosPost).toHaveBeenCalledWith(`${customApiUrl}/v1/markdown`, mockPayload); + expect(mockedAxiosPost).toHaveBeenCalledWith(`${customApiUrl}/markdown`, mockPayload); expect(mockedPollConversionStatus).toHaveBeenCalledWith(mockPath, customApiUrl); expect(result).toBe(mockPdfBuffer); }); @@ -132,7 +132,7 @@ describe("convertMarkdownToPdf", () => { onPaymentRequest: mockPaymentHandler, }); - expect(mockedAxiosPost).toHaveBeenCalledWith(`${M2PDF_API_URL}/v1/markdown`, mockPayload); + expect(mockedAxiosPost).toHaveBeenCalledWith(`${M2PDF_API_URL}/markdown`, mockPayload); expect(mockedPollConversionStatus).toHaveBeenCalledWith(mockPath, M2PDF_API_URL); expect(result).toBe(mockPdfBuffer); }); diff --git a/src/convertMarkdownToPdf.ts b/src/convertMarkdownToPdf.ts index 559328a..224eba7 100644 --- a/src/convertMarkdownToPdf.ts +++ b/src/convertMarkdownToPdf.ts @@ -41,7 +41,7 @@ export async function convertMarkdownToPdf( if (Date.now() - startTime > M2PDF_TIMEOUTS.POLLING) throw new Markdown2PdfError(`Conversion timed out after ${M2PDF_TIMEOUTS.POLLING}ms`); - const response = await withTimeout(axios.post(`${apiUrl}/v1/markdown`, payload), M2PDF_TIMEOUTS.REQUEST); + const response = await withTimeout(axios.post(`${apiUrl}/markdown`, payload), M2PDF_TIMEOUTS.REQUEST); if (response.status === 402) { const l402Offer = response.data;