From f80444791b3dbe72fd2def185c3761de969ea5ee Mon Sep 17 00:00:00 2001 From: SnapOtter Date: Sat, 20 Jun 2026 12:20:07 +0800 Subject: [PATCH] test(api): section-prefix tool URLs across integration, docker, and e2e api specs --- tests/e2e-docker/adjustment-tools.spec.ts | 76 +++---- tests/e2e-docker/ai-tools.spec.ts | 25 ++- tests/e2e-docker/batch-extended.spec.ts | 30 +-- tests/e2e-docker/batch-processing.spec.ts | 74 +++---- tests/e2e-docker/batch-workflows.spec.ts | 56 ++--- tests/e2e-docker/blur-faces.spec.ts | 2 +- tests/e2e-docker/conversion-tools.spec.ts | 70 +++--- tests/e2e-docker/creative-tools.spec.ts | 54 ++--- tests/e2e-docker/cross-format-docker.spec.ts | 106 ++++----- tests/e2e-docker/essential-tools.spec.ts | 206 +++++++++--------- tests/e2e-docker/exotic-formats.spec.ts | 76 +++---- tests/e2e-docker/feature-lifecycle.spec.ts | 3 +- tests/e2e-docker/features.spec.ts | 9 +- tests/e2e-docker/fixes-verification.spec.ts | 4 +- .../format-conversion-tools.spec.ts | 144 ++++++------ tests/e2e-docker/full-tool-audit.mjs | 6 +- tests/e2e-docker/layout-tools.spec.ts | 90 ++++---- tests/e2e-docker/meme-beautify-tools.spec.ts | 68 +++--- tests/e2e-docker/optimization-tools.spec.ts | 126 +++++------ tests/e2e-docker/pipeline-extended.spec.ts | 2 +- tests/e2e-docker/pipeline-tools.spec.ts | 2 +- tests/e2e-docker/playwright-gpu-test.mjs | 4 +- tests/e2e-docker/tool-edge-cases.spec.ts | 88 ++++---- tests/e2e-docker/utility-tools.spec.ts | 148 ++++++------- .../watermark-overlay-tools.spec.ts | 82 +++---- tests/e2e/api.spec.ts | 38 ++-- tests/e2e/gui-resilience.spec.ts | 38 ++-- tests/e2e/security.spec.ts | 10 +- .../adversarial-comprehensive.test.ts | 19 +- .../adversarial-coverage-gaps.test.ts | 23 +- .../integration/adversarial-extended.test.ts | 21 +- .../adversarial-final-gaps.test.ts | 11 +- tests/integration/adversarial-matrix.test.ts | 9 +- .../integration/adversarial-security.test.ts | 7 +- tests/integration/adversarial.test.ts | 9 +- tests/integration/ai-canvas-expand.test.ts | 20 +- tests/integration/api.test.ts | 183 ++++++++-------- tests/integration/aspect-pad.test.ts | 2 +- tests/integration/audio-channels.test.ts | 2 +- tests/integration/audio-metadata.test.ts | 2 +- tests/integration/audio-speed.test.ts | 2 +- .../integration/audit-tool-operations.test.ts | 2 +- tests/integration/auto-subtitles.test.ts | 10 +- tests/integration/background-replace.test.ts | 14 +- tests/integration/barcode-generate.test.ts | 34 +-- tests/integration/barcode-read.test.ts | 86 ++++---- tests/integration/batch.test.ts | 38 ++-- tests/integration/beautify.test.ts | 116 +++++----- tests/integration/blur-background.test.ts | 12 +- tests/integration/blur-faces.test.ts | 26 +-- tests/integration/blur-pad.test.ts | 2 +- tests/integration/booklet-pdf.test.ts | 2 +- tests/integration/border.test.ts | 106 ++++----- tests/integration/bulk-rename.test.ts | 90 ++++---- tests/integration/burn-subtitles.test.ts | 6 +- tests/integration/change-fps.test.ts | 2 +- tests/integration/chart-maker.test.ts | 22 +- tests/integration/circle-crop.test.ts | 10 +- tests/integration/collage.test.ts | 144 ++++++------ tests/integration/color-adjustments.test.ts | 9 +- tests/integration/color-blindness.test.ts | 8 +- tests/integration/color-palette.test.ts | 70 +++--- tests/integration/colorize.test.ts | 26 +-- tests/integration/compare.test.ts | 84 +++---- tests/integration/compose.test.ts | 106 ++++----- tests/integration/compress-pdf.test.ts | 2 +- tests/integration/compress-video.test.ts | 2 +- tests/integration/compress.test.ts | 4 +- tests/integration/concurrent.test.ts | 7 +- .../integration/content-aware-resize.test.ts | 52 ++--- tests/integration/convert-audio.test.ts | 2 +- tests/integration/convert-document.test.ts | 4 +- tests/integration/convert-formats.test.ts | 24 +- .../integration/convert-presentation.test.ts | 4 +- tests/integration/convert-spreadsheet.test.ts | 4 +- tests/integration/convert-video.test.ts | 4 +- tests/integration/create-zip.test.ts | 4 +- tests/integration/crop-pdf.test.ts | 2 +- tests/integration/crop-video.test.ts | 2 +- tests/integration/crop.test.ts | 20 +- tests/integration/csv-excel.test.ts | 2 +- tests/integration/csv-json.test.ts | 2 +- tests/integration/duotone.test.ts | 8 +- tests/integration/edge-cases.test.ts | 72 +++--- tests/integration/edit-metadata.test.ts | 26 +-- tests/integration/embed-subtitles.test.ts | 4 +- tests/integration/enhance-faces.test.ts | 26 +-- tests/integration/epub-convert.test.ts | 2 +- tests/integration/erase-object.test.ts | 26 +-- tests/integration/excel-to-pdf.test.ts | 4 +- tests/integration/extract-audio.test.ts | 2 +- tests/integration/extract-pages.test.ts | 2 +- tests/integration/extract-subtitles.test.ts | 4 +- tests/integration/extract-zip.test.ts | 2 +- tests/integration/factory-multi-input.test.ts | 2 +- tests/integration/fade-audio.test.ts | 2 +- tests/integration/favicon.test.ts | 84 +++---- tests/integration/find-duplicates.test.ts | 96 ++++---- tests/integration/flatten-pdf.test.ts | 2 +- tests/integration/format-matrix-ai.test.ts | 9 +- .../format-matrix-comprehensive.test.ts | 11 +- .../integration/format-matrix-exotic.test.ts | 9 +- .../format-matrix-expanded.test.ts | 118 +++++----- .../format-matrix-generated.test.ts | 4 +- .../format-matrix-multimodal.test.ts | 4 +- tests/integration/format-matrix.test.ts | 35 +-- tests/integration/gif-to-video.test.ts | 2 +- tests/integration/gif-tools.test.ts | 92 ++++---- tests/integration/gif-webp.test.ts | 10 +- tests/integration/grayscale-pdf.test.ts | 2 +- tests/integration/histogram.test.ts | 4 +- tests/integration/hostile-inputs.test.ts | 4 +- tests/integration/html-to-image.test.ts | 2 +- tests/integration/html-to-pdf.test.ts | 2 +- tests/integration/image-enhancement.test.ts | 34 +-- tests/integration/image-pad.test.ts | 14 +- tests/integration/image-to-base64.test.ts | 106 ++++----- tests/integration/image-to-pdf.test.ts | 104 ++++----- tests/integration/images-to-video.test.ts | 4 +- tests/integration/info.test.ts | 82 +++---- tests/integration/json-xml.test.ts | 2 +- tests/integration/linearize-pdf.test.ts | 2 +- tests/integration/lqip-placeholder.test.ts | 8 +- tests/integration/markdown-to-docx.test.ts | 4 +- tests/integration/markdown-to-html.test.ts | 4 +- tests/integration/markdown-to-pdf.test.ts | 2 +- tests/integration/meme-generator.test.ts | 48 ++-- tests/integration/merge-audio.test.ts | 4 +- tests/integration/merge-csvs.test.ts | 6 +- tests/integration/merge-pdf.test.ts | 4 +- tests/integration/merge-videos.test.ts | 4 +- tests/integration/mute-video.test.ts | 4 +- tests/integration/new-formats.test.ts | 10 +- tests/integration/noise-reduction.test.ts | 2 +- tests/integration/noise-removal.test.ts | 26 +-- tests/integration/normalize-audio.test.ts | 2 +- tests/integration/nup-pdf.test.ts | 2 +- tests/integration/ocr-pdf.test.ts | 8 +- tests/integration/ocr.test.ts | 26 +-- tests/integration/optimize-for-web.test.ts | 36 +-- tests/integration/organize-pdf.test.ts | 2 +- tests/integration/passport-photo.test.ts | 30 +-- tests/integration/pdf-metadata.test.ts | 2 +- tests/integration/pdf-page-numbers.test.ts | 2 +- tests/integration/pdf-to-image.test.ts | 66 +++--- tests/integration/pdf-to-text.test.ts | 2 +- tests/integration/pdf-to-word.test.ts | 2 +- tests/integration/pdfa-convert.test.ts | 2 +- tests/integration/permissions.test.ts | 4 +- tests/integration/pitch-shift.test.ts | 2 +- tests/integration/pixelate.test.ts | 12 +- tests/integration/powerpoint-to-pdf.test.ts | 4 +- tests/integration/progress.test.ts | 12 +- tests/integration/protect-pdf.test.ts | 2 +- tests/integration/qr-generate.test.ts | 122 +++++------ tests/integration/red-eye-removal.test.ts | 26 +-- tests/integration/redact-pdf.test.ts | 2 +- tests/integration/remove-background.test.ts | 40 ++-- tests/integration/remove-pages.test.ts | 4 +- tests/integration/repair-pdf.test.ts | 2 +- tests/integration/replace-audio.test.ts | 6 +- tests/integration/replace-color.test.ts | 8 +- tests/integration/resize-video.test.ts | 2 +- tests/integration/resize.test.ts | 14 +- tests/integration/restore-photo.test.ts | 30 +-- tests/integration/reverse-audio.test.ts | 2 +- tests/integration/reverse-video.test.ts | 2 +- tests/integration/ringtone-maker.test.ts | 2 +- tests/integration/rotate-pdf.test.ts | 2 +- tests/integration/rotate-video.test.ts | 2 +- tests/integration/rotate.test.ts | 12 +- tests/integration/settings-matrix.test.ts | 3 +- tests/integration/sharpening.test.ts | 8 +- tests/integration/silence-removal.test.ts | 2 +- tests/integration/smart-crop.test.ts | 28 +-- tests/integration/split-audio.test.ts | 10 +- tests/integration/split-csv.test.ts | 4 +- tests/integration/split-pdf.test.ts | 2 +- tests/integration/split.test.ts | 122 +++++------ tests/integration/sprite-sheet.test.ts | 8 +- tests/integration/stabilize-video.test.ts | 2 +- tests/integration/stitch.test.ts | 130 +++++------ tests/integration/strip-metadata.test.ts | 24 +- tests/integration/svg-to-raster.test.ts | 116 +++++----- tests/integration/text-overlay.test.ts | 92 ++++---- tests/integration/to-epub.test.ts | 4 +- tests/integration/tool-async-window.test.ts | 6 +- tests/integration/tool-route-drift.test.ts | 6 +- tests/integration/tracing-lifecycle.test.ts | 4 +- tests/integration/transcribe-audio.test.ts | 10 +- tests/integration/transparency-fixer.test.ts | 2 +- tests/integration/trim-audio.test.ts | 2 +- tests/integration/trim-video.test.ts | 2 +- tests/integration/unlock-pdf.test.ts | 2 +- tests/integration/upscale.test.ts | 28 +-- tests/integration/vectorize.test.ts | 132 +++++------ tests/integration/video-color.test.ts | 2 +- tests/integration/video-loudnorm.test.ts | 4 +- tests/integration/video-metadata.test.ts | 2 +- tests/integration/video-speed.test.ts | 2 +- tests/integration/video-to-frames.test.ts | 2 +- tests/integration/video-to-gif.test.ts | 2 +- tests/integration/video-to-webp.test.ts | 2 +- tests/integration/vignette.test.ts | 10 +- tests/integration/volume-adjust.test.ts | 2 +- tests/integration/watermark-image.test.ts | 78 +++---- tests/integration/watermark-pdf.test.ts | 2 +- tests/integration/watermark-text.test.ts | 92 ++++---- tests/integration/watermark-video.test.ts | 2 +- tests/integration/waveform-image.test.ts | 2 +- tests/integration/word-to-pdf.test.ts | 2 +- tests/integration/xml-to-csv.test.ts | 2 +- tests/integration/yaml-json.test.ts | 2 +- 213 files changed, 2868 insertions(+), 2846 deletions(-) diff --git a/tests/e2e-docker/adjustment-tools.spec.ts b/tests/e2e-docker/adjustment-tools.spec.ts index 9316d18d..64266430 100644 --- a/tests/e2e-docker/adjustment-tools.spec.ts +++ b/tests/e2e-docker/adjustment-tools.spec.ts @@ -33,7 +33,7 @@ const JPG_SAMPLE = readFileSync(join(FORMATS, "sample.jpg")); test.describe("Color Adjustments", () => { test("adjust brightness", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -47,7 +47,7 @@ test.describe("Color Adjustments", () => { }); test("adjust contrast", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -60,7 +60,7 @@ test.describe("Color Adjustments", () => { }); test("adjust saturation", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -73,7 +73,7 @@ test.describe("Color Adjustments", () => { }); test("apply grayscale", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -86,7 +86,7 @@ test.describe("Color Adjustments", () => { }); test("multiple adjustments at once", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -107,7 +107,7 @@ test.describe("Color Adjustments", () => { test.describe("Sharpening", () => { test("sharpen with default settings", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -121,7 +121,7 @@ test.describe("Sharpening", () => { }); test("sharpen with explicit sigma and amount", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -134,7 +134,7 @@ test.describe("Sharpening", () => { }); test("heavy sharpening changes file size", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -153,7 +153,7 @@ test.describe("Sharpening", () => { test.describe("Replace Color", () => { test("replace white with black", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -171,7 +171,7 @@ test.describe("Replace Color", () => { }); test("replace with low tolerance", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -188,7 +188,7 @@ test.describe("Replace Color", () => { }); test("replace with high tolerance", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -209,7 +209,7 @@ test.describe("Replace Color", () => { test.describe("Strip Metadata", () => { test("strip metadata from JPEG with EXIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_WITH_EXIF }, @@ -225,7 +225,7 @@ test.describe("Strip Metadata", () => { }); test("strip metadata from PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -239,7 +239,7 @@ test.describe("Strip Metadata", () => { test("stripped image has no EXIF data", async ({ request }) => { // First strip metadata - const stripRes = await request.post("/api/v1/tools/strip-metadata", { + const stripRes = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_WITH_EXIF }, @@ -257,7 +257,7 @@ test.describe("Strip Metadata", () => { const strippedBuffer = Buffer.from(await downloadRes.body()); // Verify stripped image via info tool - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stripped.jpg", mimeType: "image/jpeg", buffer: strippedBuffer }, @@ -273,7 +273,7 @@ test.describe("Strip Metadata", () => { test.describe("Edit Metadata", () => { test("set artist and copyright fields", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -290,7 +290,7 @@ test.describe("Edit Metadata", () => { }); test("edit metadata on PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -310,7 +310,7 @@ test.describe("Edit Metadata", () => { test.describe("Optimize for Web", () => { test("optimize with default settings", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -324,7 +324,7 @@ test.describe("Optimize for Web", () => { }); test("optimize with maxWidth constraint", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -339,7 +339,7 @@ test.describe("Optimize for Web", () => { }); test("optimize PNG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -356,7 +356,7 @@ test.describe("Optimize for Web", () => { test.describe("Image Enhancement", () => { test("auto enhancement", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -370,7 +370,7 @@ test.describe("Image Enhancement", () => { }); test("vivid enhancement preset", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -383,7 +383,7 @@ test.describe("Image Enhancement", () => { }); test("enhancement changes the image", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -403,7 +403,7 @@ test.describe("Image Enhancement", () => { test.describe("Color Blindness Simulation", () => { test("simulate deuteranomaly (default)", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -417,7 +417,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate protanopia on JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -430,7 +430,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate tritanopia", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -443,7 +443,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate achromatopsia (total color blindness)", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -456,7 +456,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate protanomaly", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -469,7 +469,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate tritanomaly", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -482,7 +482,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate blueConeMonochromacy", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -496,7 +496,7 @@ test.describe("Color Blindness Simulation", () => { test("color-blindness on HEIC image", async ({ request }) => { const heic = readFileSync(join(FIXTURES, "test-200x150.heic")); - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: heic }, @@ -513,7 +513,7 @@ test.describe("Color Blindness Simulation", () => { test.describe("Color Adjustments — additional", () => { test("adjust hue rotation", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -526,7 +526,7 @@ test.describe("Color Adjustments — additional", () => { }); test("extreme brightness and contrast", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -540,7 +540,7 @@ test.describe("Color Adjustments — additional", () => { test("color adjustments on HEIC image", async ({ request }) => { const heic = readFileSync(join(FIXTURES, "test-200x150.heic")); - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: heic }, @@ -557,7 +557,7 @@ test.describe("Color Adjustments — additional", () => { test.describe("Auth failure", () => { test("adjust-colors without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ brightness: 20 }), @@ -567,7 +567,7 @@ test.describe("Auth failure", () => { }); test("strip-metadata without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_WITH_EXIF }, settings: JSON.stringify({}), @@ -577,7 +577,7 @@ test.describe("Auth failure", () => { }); test("edit-metadata without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, settings: JSON.stringify({ artist: "Test" }), @@ -587,7 +587,7 @@ test.describe("Auth failure", () => { }); test("color-blindness without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({}), diff --git a/tests/e2e-docker/ai-tools.spec.ts b/tests/e2e-docker/ai-tools.spec.ts index b154e2bf..f293c430 100644 --- a/tests/e2e-docker/ai-tools.spec.ts +++ b/tests/e2e-docker/ai-tools.spec.ts @@ -1,6 +1,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; import { expect, test } from "@playwright/test"; +import { apiToolPath } from "@snapotter/shared"; // ─── AI Tools ─────────────────────────────────────────────────────── // Tests for: remove-background, upscale, ocr, blur-faces, smart-crop, @@ -92,7 +93,7 @@ async function callAiTool( filename = "test.png", mimeType = "image/png", ): Promise<{ installed: boolean; ok: boolean; status: number; body: Record }> { - const res = await request.post(`/api/v1/tools/${toolId}`, { + const res = await request.post(apiToolPath(toolId), { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: filename, mimeType, buffer: imageBuffer }, @@ -808,7 +809,7 @@ test.describe("AI Feature Bundle Status", () => { if (installed) continue; testedCount++; - const res = await request.post(`/api/v1/tools/${tool}`, { + const res = await request.post(apiToolPath(tool), { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, @@ -838,7 +839,7 @@ test.describe("AI Feature Bundle Status", () => { test.describe("Transparency Fixer", () => { test("transparency fixer returns 202 or 501", async ({ request }) => { const portrait = contentFixture("portrait-color.jpg"); - const res = await request.post("/api/v1/tools/transparency-fixer", { + const res = await request.post("/api/v1/tools/image/transparency-fixer", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.jpg", mimeType: "image/jpeg", buffer: portrait }, @@ -860,7 +861,7 @@ test.describe("Transparency Fixer", () => { }); test("transparency fixer with custom defringe", async ({ request }) => { - const res = await request.post("/api/v1/tools/transparency-fixer", { + const res = await request.post("/api/v1/tools/image/transparency-fixer", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, @@ -879,7 +880,7 @@ test.describe("Transparency Fixer", () => { }); test("transparency fixer with webp output", async ({ request }) => { - const res = await request.post("/api/v1/tools/transparency-fixer", { + const res = await request.post("/api/v1/tools/image/transparency-fixer", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -898,7 +899,7 @@ test.describe("Transparency Fixer", () => { }); test("transparency fixer rejects empty file", async ({ request }) => { - const res = await request.post("/api/v1/tools/transparency-fixer", { + const res = await request.post("/api/v1/tools/image/transparency-fixer", { headers: { Authorization: `Bearer ${token}` }, multipart: { settings: JSON.stringify({}), @@ -977,7 +978,7 @@ test.describe("Colorize — additional", () => { test.describe("Auth failure", () => { test("remove-background without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/remove-background", { + const res = await request.post("/api/v1/tools/image/remove-background", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, settings: JSON.stringify({}), @@ -987,7 +988,7 @@ test.describe("Auth failure", () => { }); test("upscale without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/upscale", { + const res = await request.post("/api/v1/tools/image/upscale", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, settings: JSON.stringify({ scale: 2, model: "auto" }), @@ -997,7 +998,7 @@ test.describe("Auth failure", () => { }); test("ocr without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/ocr", { + const res = await request.post("/api/v1/tools/image/ocr", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, settings: JSON.stringify({}), @@ -1007,7 +1008,7 @@ test.describe("Auth failure", () => { }); test("transparency-fixer without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/transparency-fixer", { + const res = await request.post("/api/v1/tools/image/transparency-fixer", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, settings: JSON.stringify({}), @@ -1017,7 +1018,7 @@ test.describe("Auth failure", () => { }); test("blur-faces without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/blur-faces", { + const res = await request.post("/api/v1/tools/image/blur-faces", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, settings: JSON.stringify({ blurRadius: 30 }), @@ -1027,7 +1028,7 @@ test.describe("Auth failure", () => { }); test("colorize without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/colorize", { + const res = await request.post("/api/v1/tools/image/colorize", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: TINY_PNG }, settings: JSON.stringify({}), diff --git a/tests/e2e-docker/batch-extended.spec.ts b/tests/e2e-docker/batch-extended.spec.ts index 22a0d717..48aa77fc 100644 --- a/tests/e2e-docker/batch-extended.spec.ts +++ b/tests/e2e-docker/batch-extended.spec.ts @@ -98,7 +98,7 @@ test.describe("Batch color-blindness simulation", () => { ], [{ name: "settings", value: JSON.stringify({ simulationType: "deuteranomaly" }) }], ); - const res = await request.post("/api/v1/tools/color-blindness/batch", { + const res = await request.post("/api/v1/tools/image/color-blindness/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -114,7 +114,7 @@ test.describe("Batch color-blindness simulation", () => { ], [{ name: "settings", value: JSON.stringify({ simulationType: "protanopia" }) }], ); - const res = await request.post("/api/v1/tools/color-blindness/batch", { + const res = await request.post("/api/v1/tools/image/color-blindness/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -145,7 +145,7 @@ test.describe("Batch edit-metadata", () => { }, ], ); - const res = await request.post("/api/v1/tools/edit-metadata/batch", { + const res = await request.post("/api/v1/tools/image/edit-metadata/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -176,7 +176,7 @@ test.describe("Batch beautify", () => { }, ], ); - const res = await request.post("/api/v1/tools/beautify/batch", { + const res = await request.post("/api/v1/tools/image/beautify/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -205,7 +205,7 @@ test.describe("Batch beautify", () => { }, ], ); - const res = await request.post("/api/v1/tools/beautify/batch", { + const res = await request.post("/api/v1/tools/image/beautify/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -225,7 +225,7 @@ test.describe("Batch vectorize", () => { ], [{ name: "settings", value: JSON.stringify({}) }], ); - const res = await request.post("/api/v1/tools/vectorize/batch", { + const res = await request.post("/api/v1/tools/image/vectorize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -259,7 +259,7 @@ test.describe("Batch replace-color (5+ images)", () => { }, ], ); - const res = await request.post("/api/v1/tools/replace-color/batch", { + const res = await request.post("/api/v1/tools/image/replace-color/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -280,7 +280,7 @@ test.describe("Batch favicon", () => { ], [{ name: "settings", value: JSON.stringify({}) }], ); - const res = await request.post("/api/v1/tools/favicon/batch", { + const res = await request.post("/api/v1/tools/image/favicon/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -311,7 +311,7 @@ test.describe("Batch image-enhancement (5+ images)", () => { ], [{ name: "settings", value: JSON.stringify({ preset: "auto" }) }], ); - const res = await request.post("/api/v1/tools/image-enhancement/batch", { + const res = await request.post("/api/v1/tools/image/image-enhancement/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -334,7 +334,7 @@ test.describe("Batch svg-to-raster", () => { ], [{ name: "settings", value: JSON.stringify({ format: "png", width: 256 }) }], ); - const res = await request.post("/api/v1/tools/svg-to-raster/batch", { + const res = await request.post("/api/v1/tools/image/svg-to-raster/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -357,7 +357,7 @@ test.describe("Batch convert HEIC to web formats", () => { ], [{ name: "settings", value: JSON.stringify({ format: "jpg", quality: 85 }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -388,7 +388,7 @@ test.describe("Batch meme-generator", () => { }, ], ); - const res = await request.post("/api/v1/tools/meme-generator/batch", { + const res = await request.post("/api/v1/tools/image/meme-generator/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -422,7 +422,7 @@ test.describe("Batch resize large set", () => { ], [{ name: "settings", value: JSON.stringify({ width: 64, height: 64, fit: "cover" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -441,7 +441,7 @@ test.describe("Auth failure", () => { ], [{ name: "settings", value: JSON.stringify({ width: 100, fit: "contain" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { "Content-Type": contentType }, data: reqBody, }); @@ -456,7 +456,7 @@ test.describe("Auth failure", () => { ], [{ name: "settings", value: JSON.stringify({ format: "webp" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { "Content-Type": contentType }, data: reqBody, }); diff --git a/tests/e2e-docker/batch-processing.spec.ts b/tests/e2e-docker/batch-processing.spec.ts index 7f5622ac..0c8a52ea 100644 --- a/tests/e2e-docker/batch-processing.spec.ts +++ b/tests/e2e-docker/batch-processing.spec.ts @@ -77,7 +77,7 @@ test.describe("Batch Resize", () => { ], [{ name: "settings", value: JSON.stringify({ width: 80, fit: "contain" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -112,7 +112,7 @@ test.describe("Batch Resize", () => { ], [{ name: "settings", value: JSON.stringify({ width: 64, fit: "cover" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -145,7 +145,7 @@ test.describe("Batch Crop", () => { }, ], ); - const res = await request.post("/api/v1/tools/crop/batch", { + const res = await request.post("/api/v1/tools/image/crop/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -173,7 +173,7 @@ test.describe("Batch Rotate", () => { ], [{ name: "settings", value: JSON.stringify({ angle: 90 }) }], ); - const res = await request.post("/api/v1/tools/rotate/batch", { + const res = await request.post("/api/v1/tools/image/rotate/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -207,7 +207,7 @@ test.describe("Batch Convert", () => { ], [{ name: "settings", value: JSON.stringify({ format: "webp" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -230,7 +230,7 @@ test.describe("Batch Convert", () => { ], [{ name: "settings", value: JSON.stringify({ format: "avif" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -256,7 +256,7 @@ test.describe("Batch Compress", () => { ], [{ name: "settings", value: JSON.stringify({ quality: 30 }) }], ); - const res = await request.post("/api/v1/tools/compress/batch", { + const res = await request.post("/api/v1/tools/image/compress/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -289,7 +289,7 @@ test.describe("Batch Color Adjustments", () => { }, ], ); - const res = await request.post("/api/v1/tools/adjust-colors/batch", { + const res = await request.post("/api/v1/tools/image/adjust-colors/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -312,7 +312,7 @@ test.describe("Batch Color Adjustments", () => { ], [{ name: "settings", value: JSON.stringify({ grayscale: true }) }], ); - const res = await request.post("/api/v1/tools/adjust-colors/batch", { + const res = await request.post("/api/v1/tools/image/adjust-colors/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -332,7 +332,7 @@ test.describe("Batch Sharpening", () => { ], [{ name: "settings", value: JSON.stringify({ sigma: 1.5 }) }], ); - const res = await request.post("/api/v1/tools/sharpening/batch", { + const res = await request.post("/api/v1/tools/image/sharpening/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -371,7 +371,7 @@ test.describe("Batch Watermark Text", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-text/batch", { + const res = await request.post("/api/v1/tools/image/watermark-text/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -400,7 +400,7 @@ test.describe("Batch Strip Metadata", () => { ], [{ name: "settings", value: JSON.stringify({}) }], ); - const res = await request.post("/api/v1/tools/strip-metadata/batch", { + const res = await request.post("/api/v1/tools/image/strip-metadata/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -434,7 +434,7 @@ test.describe("Batch Optimize for Web", () => { ], [{ name: "settings", value: JSON.stringify({ maxWidth: 800, quality: 70 }) }], ); - const res = await request.post("/api/v1/tools/optimize-for-web/batch", { + const res = await request.post("/api/v1/tools/image/optimize-for-web/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -462,7 +462,7 @@ test.describe("Batch Border", () => { ], [{ name: "settings", value: JSON.stringify({ size: 10, color: "#0000ff" }) }], ); - const res = await request.post("/api/v1/tools/border/batch", { + const res = await request.post("/api/v1/tools/image/border/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -499,7 +499,7 @@ test.describe("Batch Replace Color", () => { }, ], ); - const res = await request.post("/api/v1/tools/replace-color/batch", { + const res = await request.post("/api/v1/tools/image/replace-color/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -527,7 +527,7 @@ test.describe("Batch Enhancement", () => { ], [{ name: "settings", value: JSON.stringify({ preset: "auto" }) }], ); - const res = await request.post("/api/v1/tools/image-enhancement/batch", { + const res = await request.post("/api/v1/tools/image/image-enhancement/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -555,7 +555,7 @@ test.describe("Batch Vectorize", () => { ], [{ name: "settings", value: JSON.stringify({}) }], ); - const res = await request.post("/api/v1/tools/vectorize/batch", { + const res = await request.post("/api/v1/tools/image/vectorize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -600,7 +600,7 @@ test.describe("Batch Text Overlay", () => { }, ], ); - const res = await request.post("/api/v1/tools/text-overlay/batch", { + const res = await request.post("/api/v1/tools/image/text-overlay/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -628,7 +628,7 @@ test.describe("Batch Favicon", () => { ], [{ name: "settings", value: JSON.stringify({}) }], ); - const res = await request.post("/api/v1/tools/favicon/batch", { + const res = await request.post("/api/v1/tools/image/favicon/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -667,7 +667,7 @@ test.describe("Batch Edit Metadata", () => { }, ], ); - const res = await request.post("/api/v1/tools/edit-metadata/batch", { + const res = await request.post("/api/v1/tools/image/edit-metadata/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -701,7 +701,7 @@ test.describe("Batch Convert — format variety", () => { ], [{ name: "settings", value: JSON.stringify({ format: "png" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -725,7 +725,7 @@ test.describe("Batch Convert — format variety", () => { ], [{ name: "settings", value: JSON.stringify({ format: "tiff" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -745,7 +745,7 @@ test.describe("Batch Rotate — angles", () => { ], [{ name: "settings", value: JSON.stringify({ angle: 180 }) }], ); - const res = await request.post("/api/v1/tools/rotate/batch", { + const res = await request.post("/api/v1/tools/image/rotate/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -768,7 +768,7 @@ test.describe("Batch Rotate — angles", () => { ], [{ name: "settings", value: JSON.stringify({ angle: 270 }) }], ); - const res = await request.post("/api/v1/tools/rotate/batch", { + const res = await request.post("/api/v1/tools/image/rotate/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -788,7 +788,7 @@ test.describe("Batch with HEIC input", () => { ], [{ name: "settings", value: JSON.stringify({ width: 64, fit: "contain" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -812,7 +812,7 @@ test.describe("Batch with HEIC input", () => { ], [{ name: "settings", value: JSON.stringify({ quality: 50 }) }], ); - const res = await request.post("/api/v1/tools/compress/batch", { + const res = await request.post("/api/v1/tools/image/compress/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -832,7 +832,7 @@ test.describe("Batch Color Blindness", () => { ], [{ name: "settings", value: JSON.stringify({ simulationType: "deuteranopia" }) }], ); - const res = await request.post("/api/v1/tools/color-blindness/batch", { + const res = await request.post("/api/v1/tools/image/color-blindness/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -871,7 +871,7 @@ test.describe("Batch Meme Generator", () => { }, ], ); - const res = await request.post("/api/v1/tools/meme-generator/batch", { + const res = await request.post("/api/v1/tools/image/meme-generator/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -917,7 +917,7 @@ test.describe("Batch Beautify", () => { }, ], ); - const res = await request.post("/api/v1/tools/beautify/batch", { + const res = await request.post("/api/v1/tools/image/beautify/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -959,7 +959,7 @@ test.describe("Batch Resize -- 5+ images verified", () => { ], [{ name: "settings", value: JSON.stringify({ width: 50, fit: "contain" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1007,7 +1007,7 @@ test.describe("Batch Convert -- 5+ images", () => { ], [{ name: "settings", value: JSON.stringify({ format: "jpg", quality: 80 }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1042,7 +1042,7 @@ test.describe("Batch Compress -- 5+ images", () => { ], [{ name: "settings", value: JSON.stringify({ quality: 40 }) }], ); - const res = await request.post("/api/v1/tools/compress/batch", { + const res = await request.post("/api/v1/tools/image/compress/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1077,7 +1077,7 @@ test.describe("Batch Enhancement -- 5+ images", () => { ], [{ name: "settings", value: JSON.stringify({ preset: "auto" }) }], ); - const res = await request.post("/api/v1/tools/image-enhancement/batch", { + const res = await request.post("/api/v1/tools/image/image-enhancement/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1124,7 +1124,7 @@ test.describe("Batch Watermark Text -- 5+ images", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-text/batch", { + const res = await request.post("/api/v1/tools/image/watermark-text/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1152,7 +1152,7 @@ test.describe("Batch Optimize -- download verification", () => { ], [{ name: "settings", value: JSON.stringify({ maxWidth: 400, quality: 60 }) }], ); - const res = await request.post("/api/v1/tools/optimize-for-web/batch", { + const res = await request.post("/api/v1/tools/image/optimize-for-web/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1185,7 +1185,7 @@ test.describe("Batch validation", () => { [], [{ name: "settings", value: JSON.stringify({ width: 80 }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1203,7 +1203,7 @@ test.describe("Batch validation", () => { [{ name: "file", filename: "a.png", contentType: "image/png", buffer: PNG_200x150 }], [{ name: "settings", value: JSON.stringify({ quality: 50 }) }], ); - const res = await request.post("/api/v1/tools/compress/batch", { + const res = await request.post("/api/v1/tools/image/compress/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); diff --git a/tests/e2e-docker/batch-workflows.spec.ts b/tests/e2e-docker/batch-workflows.spec.ts index a861cd1a..b963f415 100644 --- a/tests/e2e-docker/batch-workflows.spec.ts +++ b/tests/e2e-docker/batch-workflows.spec.ts @@ -107,7 +107,7 @@ test.describe("Essential: batch resize 5 images", () => { ], [{ name: "settings", value: JSON.stringify({ width: 120, fit: "contain" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -126,7 +126,7 @@ test.describe("Essential: batch resize 5 images", () => { ], [{ name: "settings", value: JSON.stringify({ width: 64, height: 64, fit: "cover" }) }], ); - const res = await request.post("/api/v1/tools/resize/batch", { + const res = await request.post("/api/v1/tools/image/resize/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -149,7 +149,7 @@ test.describe("Essential: batch compress", () => { ], [{ name: "settings", value: JSON.stringify({ quality: 20 }) }], ); - const res = await request.post("/api/v1/tools/compress/batch", { + const res = await request.post("/api/v1/tools/image/compress/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -165,7 +165,7 @@ test.describe("Essential: batch compress", () => { ], [{ name: "settings", value: JSON.stringify({ quality: 60 }) }], ); - const res = await request.post("/api/v1/tools/compress/batch", { + const res = await request.post("/api/v1/tools/image/compress/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -186,7 +186,7 @@ test.describe("Essential: batch rotate", () => { ], [{ name: "settings", value: JSON.stringify({ angle: 90 }) }], ); - const res = await request.post("/api/v1/tools/rotate/batch", { + const res = await request.post("/api/v1/tools/image/rotate/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -202,7 +202,7 @@ test.describe("Essential: batch rotate", () => { ], [{ name: "settings", value: JSON.stringify({ angle: 45, background: "#ffffff" }) }], ); - const res = await request.post("/api/v1/tools/rotate/batch", { + const res = await request.post("/api/v1/tools/image/rotate/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -228,7 +228,7 @@ test.describe("Adjustment: batch color adjustments", () => { }, ], ); - const res = await request.post("/api/v1/tools/adjust-colors/batch", { + const res = await request.post("/api/v1/tools/image/adjust-colors/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -247,7 +247,7 @@ test.describe("Adjustment: batch color adjustments", () => { ], [{ name: "settings", value: JSON.stringify({ grayscale: true }) }], ); - const res = await request.post("/api/v1/tools/adjust-colors/batch", { + const res = await request.post("/api/v1/tools/image/adjust-colors/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -263,7 +263,7 @@ test.describe("Adjustment: batch color adjustments", () => { ], [{ name: "settings", value: JSON.stringify({ brightness: -30, contrast: 20 }) }], ); - const res = await request.post("/api/v1/tools/adjust-colors/batch", { + const res = await request.post("/api/v1/tools/image/adjust-colors/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -284,7 +284,7 @@ test.describe("Adjustment: batch sharpening", () => { ], [{ name: "settings", value: JSON.stringify({ sigma: 2.0 }) }], ); - const res = await request.post("/api/v1/tools/sharpening/batch", { + const res = await request.post("/api/v1/tools/image/sharpening/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -300,7 +300,7 @@ test.describe("Adjustment: batch sharpening", () => { ], [{ name: "settings", value: JSON.stringify({ sigma: 0.5 }) }], ); - const res = await request.post("/api/v1/tools/sharpening/batch", { + const res = await request.post("/api/v1/tools/image/sharpening/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -335,7 +335,7 @@ test.describe("Overlay: batch watermark text", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-text/batch", { + const res = await request.post("/api/v1/tools/image/watermark-text/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -362,7 +362,7 @@ test.describe("Overlay: batch watermark text", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-text/batch", { + const res = await request.post("/api/v1/tools/image/watermark-text/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -394,7 +394,7 @@ test.describe("Overlay: batch watermark image", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image/batch", { + const res = await request.post("/api/v1/tools/image/watermark-image/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -429,7 +429,7 @@ test.describe("Format: batch convert JPEG to PNG", () => { ], [{ name: "settings", value: JSON.stringify({ format: "png" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -447,7 +447,7 @@ test.describe("Format: batch convert JPEG to PNG", () => { ], [{ name: "settings", value: JSON.stringify({ format: "webp", quality: 80 }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -463,7 +463,7 @@ test.describe("Format: batch convert JPEG to PNG", () => { ], [{ name: "settings", value: JSON.stringify({ format: "avif" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -486,7 +486,7 @@ test.describe("Utility: batch info", () => { ], [], ); - const res = await request.post("/api/v1/tools/info/batch", { + const res = await request.post("/api/v1/tools/image/info/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -522,7 +522,7 @@ test.describe("Utility: batch strip metadata", () => { ], [{ name: "settings", value: JSON.stringify({}) }], ); - const res = await request.post("/api/v1/tools/strip-metadata/batch", { + const res = await request.post("/api/v1/tools/image/strip-metadata/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -539,7 +539,7 @@ test.describe("Utility: batch strip metadata", () => { ], [{ name: "settings", value: JSON.stringify({}) }], ); - const res = await request.post("/api/v1/tools/strip-metadata/batch", { + const res = await request.post("/api/v1/tools/image/strip-metadata/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -565,7 +565,7 @@ test.describe("Essential: batch crop", () => { }, ], ); - const res = await request.post("/api/v1/tools/crop/batch", { + const res = await request.post("/api/v1/tools/image/crop/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -598,7 +598,7 @@ test.describe("Overlay: batch text overlay", () => { }, ], ); - const res = await request.post("/api/v1/tools/text-overlay/batch", { + const res = await request.post("/api/v1/tools/image/text-overlay/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -618,7 +618,7 @@ test.describe("Format: batch convert to TIFF", () => { ], [{ name: "settings", value: JSON.stringify({ format: "tiff" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -639,7 +639,7 @@ test.describe("Adjustment: batch enhance", () => { ], [{ name: "settings", value: JSON.stringify({ preset: "vivid" }) }], ); - const res = await request.post("/api/v1/tools/image-enhancement/batch", { + const res = await request.post("/api/v1/tools/image/image-enhancement/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -662,7 +662,7 @@ test.describe("Utility: batch optimize for web", () => { ], [{ name: "settings", value: JSON.stringify({ maxWidth: 600, quality: 65 }) }], ); - const res = await request.post("/api/v1/tools/optimize-for-web/batch", { + const res = await request.post("/api/v1/tools/image/optimize-for-web/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -683,7 +683,7 @@ test.describe("Overlay: batch border", () => { ], [{ name: "settings", value: JSON.stringify({ size: 20, color: "#ff0000" }) }], ); - const res = await request.post("/api/v1/tools/border/batch", { + const res = await request.post("/api/v1/tools/image/border/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -703,7 +703,7 @@ test.describe("Format: batch convert to GIF", () => { ], [{ name: "settings", value: JSON.stringify({ format: "gif" }) }], ); - const res = await request.post("/api/v1/tools/convert/batch", { + const res = await request.post("/api/v1/tools/image/convert/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -732,7 +732,7 @@ test.describe("Adjustment: batch replace color", () => { }, ], ); - const res = await request.post("/api/v1/tools/replace-color/batch", { + const res = await request.post("/api/v1/tools/image/replace-color/batch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); diff --git a/tests/e2e-docker/blur-faces.spec.ts b/tests/e2e-docker/blur-faces.spec.ts index 79949efa..3378c66b 100644 --- a/tests/e2e-docker/blur-faces.spec.ts +++ b/tests/e2e-docker/blur-faces.spec.ts @@ -46,7 +46,7 @@ test.describe("Blur Faces - HEIC fix and no-face warning", () => { }); const { token } = await loginRes.json(); - const response = await request.post("/api/v1/tools/blur-faces", { + const response = await request.post("/api/v1/tools/image/blur-faces", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { diff --git a/tests/e2e-docker/conversion-tools.spec.ts b/tests/e2e-docker/conversion-tools.spec.ts index 4c95cad2..e2aa2638 100644 --- a/tests/e2e-docker/conversion-tools.spec.ts +++ b/tests/e2e-docker/conversion-tools.spec.ts @@ -78,7 +78,7 @@ const HEIC_200x150 = fixture("test-200x150.heic"); test.describe("SVG to Raster", () => { test("convert SVG to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -92,7 +92,7 @@ test.describe("SVG to Raster", () => { }); test("convert SVG to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -105,7 +105,7 @@ test.describe("SVG to Raster", () => { }); test("convert SVG to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -119,7 +119,7 @@ test.describe("SVG to Raster", () => { test("convert complex SVG from fixtures", async ({ request }) => { const svgLogo = contentFixture("svg-logo.svg"); - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "logo.svg", mimeType: "image/svg+xml", buffer: svgLogo }, @@ -133,7 +133,7 @@ test.describe("SVG to Raster", () => { test("convert large format SVG fixture", async ({ request }) => { const svgSample = formatFixture("sample.svg"); - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.svg", mimeType: "image/svg+xml", buffer: svgSample }, @@ -150,7 +150,7 @@ test.describe("SVG to Raster", () => { test.describe("Vectorize", () => { test("vectorize PNG to SVG", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -164,7 +164,7 @@ test.describe("Vectorize", () => { }); test("vectorize JPEG to SVG", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -177,7 +177,7 @@ test.describe("Vectorize", () => { }); test("vectorized output is an SVG file", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -194,7 +194,7 @@ test.describe("Vectorize", () => { test.describe("GIF Tools", () => { test("process animated GIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, @@ -215,7 +215,7 @@ test.describe("GIF Tools", () => { test("process GIF from formats fixture", async ({ request }) => { const gifSample = formatFixture("sample.gif"); - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: gifSample }, @@ -233,7 +233,7 @@ test.describe("GIF Tools", () => { test("process animated Simpsons GIF", async ({ request }) => { const animGif = contentFixture("animated-simpsons.gif"); - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated-simpsons.gif", mimeType: "image/gif", buffer: animGif }, @@ -254,7 +254,7 @@ test.describe("GIF Tools", () => { test.describe("PDF to Image", () => { test("convert first page of PDF to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -268,7 +268,7 @@ test.describe("PDF to Image", () => { }); test("convert all pages of PDF", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -281,7 +281,7 @@ test.describe("PDF to Image", () => { }); test("convert PDF to JPEG format", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -294,7 +294,7 @@ test.describe("PDF to Image", () => { }); test("convert specific page range", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -307,7 +307,7 @@ test.describe("PDF to Image", () => { }); test("convert PDF to WebP format", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -318,7 +318,7 @@ test.describe("PDF to Image", () => { }); test("reject out-of-range page number", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -340,7 +340,7 @@ test.describe("Image to PDF", () => { [{ name: "file", filename: "test.jpg", contentType: "image/jpeg", buffer: jpg }], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -360,7 +360,7 @@ test.describe("Image to PDF", () => { ], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -375,7 +375,7 @@ test.describe("Image to PDF", () => { test.describe("Image to Base64", () => { test("encode PNG to base64", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -398,7 +398,7 @@ test.describe("Image to Base64", () => { }); test("encode JPEG to base64", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -412,7 +412,7 @@ test.describe("Image to Base64", () => { }); test("encode with output format conversion", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -426,7 +426,7 @@ test.describe("Image to Base64", () => { }); test("encode with maxWidth constraint", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -439,7 +439,7 @@ test.describe("Image to Base64", () => { }); test("base64 overhead percent is calculated", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -458,7 +458,7 @@ test.describe("Image to Base64", () => { test.describe("Favicon", () => { test("generate favicon from PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -479,7 +479,7 @@ test.describe("Favicon", () => { }); test("generate favicon from JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -491,7 +491,7 @@ test.describe("Favicon", () => { test("generate favicon from SVG", async ({ request }) => { const svgLogo = contentFixture("svg-logo.svg"); - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "logo.svg", mimeType: "image/svg+xml", buffer: svgLogo }, @@ -509,7 +509,7 @@ test.describe("Convert format matrix", () => { for (const targetFormat of formats) { test(`PNG to ${targetFormat}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -524,7 +524,7 @@ test.describe("Convert format matrix", () => { } test("HEIC to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -537,7 +537,7 @@ test.describe("Convert format matrix", () => { }); test("HEIC to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -551,7 +551,7 @@ test.describe("Convert format matrix", () => { test("WebP to PNG", async ({ request }) => { const webp = fixture("test-50x50.webp"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: webp }, @@ -565,7 +565,7 @@ test.describe("Convert format matrix", () => { test("BMP to PNG", async ({ request }) => { const bmp = formatFixture("sample.bmp"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.bmp", mimeType: "image/bmp", buffer: bmp }, @@ -586,7 +586,7 @@ test.describe("Convert format matrix", () => { test.describe("Auth failure", () => { test("gif-tools without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, settings: JSON.stringify({}), @@ -596,7 +596,7 @@ test.describe("Auth failure", () => { }); test("image-to-base64 without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({}), @@ -610,7 +610,7 @@ test.describe("Auth failure", () => { [{ name: "file", filename: "test.jpg", contentType: "image/jpeg", buffer: JPG_100x100 }], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { "Content-Type": contentType }, data: body, }); diff --git a/tests/e2e-docker/creative-tools.spec.ts b/tests/e2e-docker/creative-tools.spec.ts index ee78f174..9e0d9d7b 100644 --- a/tests/e2e-docker/creative-tools.spec.ts +++ b/tests/e2e-docker/creative-tools.spec.ts @@ -105,7 +105,7 @@ test.describe("Collage", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -133,7 +133,7 @@ test.describe("Collage", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType, @@ -157,7 +157,7 @@ test.describe("Stitch", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "horizontal", gap: 0 }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -175,7 +175,7 @@ test.describe("Stitch", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "vertical", gap: 0 }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -201,7 +201,7 @@ test.describe("Stitch", () => { }, ], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -219,7 +219,7 @@ test.describe("Stitch", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "grid", gridColumns: 2 }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -233,7 +233,7 @@ test.describe("Stitch", () => { [{ name: "file", filename: "a.png", contentType: "image/png", buffer: PNG_200x150 }], [{ name: "settings", value: JSON.stringify({ direction: "horizontal" }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -247,7 +247,7 @@ test.describe("Stitch", () => { test.describe("Split", () => { test("split image into 2x2 tiles via API", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -263,7 +263,7 @@ test.describe("Split", () => { }); test("split image into 3x3 tiles via API", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -283,7 +283,7 @@ test.describe("Split", () => { test.describe("Border", () => { test("add solid color border", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -298,7 +298,7 @@ test.describe("Border", () => { }); test("add thin border", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -311,7 +311,7 @@ test.describe("Border", () => { }); test("add wide white border", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -340,7 +340,7 @@ test.describe("Compose", () => { ], [{ name: "settings", value: JSON.stringify({ x: 10, y: 10, opacity: 80 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -355,7 +355,7 @@ test.describe("Compose", () => { test.describe("Watermark Text", () => { test("add center watermark", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -375,7 +375,7 @@ test.describe("Watermark Text", () => { }); test("add tiled watermark", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -396,7 +396,7 @@ test.describe("Watermark Text", () => { test("add corner watermark positions", async ({ request }) => { const positions = ["top-left", "top-right", "bottom-left", "bottom-right"] as const; for (const position of positions) { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -416,7 +416,7 @@ test.describe("Watermark Text", () => { }); test("add rotated watermark", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -457,7 +457,7 @@ test.describe("Watermark Image", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -472,7 +472,7 @@ test.describe("Watermark Image", () => { test.describe("Text Overlay", () => { test("add text overlay at center", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -491,7 +491,7 @@ test.describe("Text Overlay", () => { }); test("add text overlay at top", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -509,7 +509,7 @@ test.describe("Text Overlay", () => { }); test("add text overlay at bottom with background box", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -529,7 +529,7 @@ test.describe("Text Overlay", () => { }); test("add text overlay with shadow", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -552,7 +552,7 @@ test.describe("Text Overlay", () => { test.describe("Content-Aware Resize", () => { test("content-aware resize to smaller width", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -572,7 +572,7 @@ test.describe("Content-Aware Resize", () => { }); test("content-aware resize JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -606,7 +606,7 @@ test.describe("Auth failure", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { "Content-Type": contentType }, data: body, }); @@ -621,7 +621,7 @@ test.describe("Auth failure", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "horizontal" }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { "Content-Type": contentType }, data: body, }); @@ -629,7 +629,7 @@ test.describe("Auth failure", () => { }); test("text-overlay without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ diff --git a/tests/e2e-docker/cross-format-docker.spec.ts b/tests/e2e-docker/cross-format-docker.spec.ts index 8a4cd9ae..0d570f39 100644 --- a/tests/e2e-docker/cross-format-docker.spec.ts +++ b/tests/e2e-docker/cross-format-docker.spec.ts @@ -37,7 +37,7 @@ const HEIC_200x150 = fixture("test-200x150.heic"); test.describe("Resize: JPEG", () => { test("resize JPEG to 50px wide", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -53,7 +53,7 @@ test.describe("Resize: JPEG", () => { test.describe("Resize: PNG", () => { test("resize PNG to 80px wide", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -69,7 +69,7 @@ test.describe("Resize: PNG", () => { test.describe("Resize: WebP", () => { test("resize WebP to 30px wide", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -86,7 +86,7 @@ test.describe("Resize: WebP", () => { test.describe("Resize: AVIF", () => { test("resize AVIF to 60px wide", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -102,7 +102,7 @@ test.describe("Resize: AVIF", () => { test.describe("Resize: HEIC", () => { test("resize HEIC to 80px wide", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -119,7 +119,7 @@ test.describe("Resize: HEIC", () => { test.describe("Resize: TIFF", () => { test("resize TIFF to 60px wide", async ({ request }) => { const tiff = formatFixture("sample.tiff"); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -136,7 +136,7 @@ test.describe("Resize: TIFF", () => { test.describe("Resize: BMP", () => { test("resize BMP to 40px wide", async ({ request }) => { const bmp = formatFixture("sample.bmp"); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.bmp", mimeType: "image/bmp", buffer: bmp }, @@ -157,7 +157,7 @@ test.describe("Resize: BMP", () => { test.describe("Resize: GIF", () => { test("resize GIF to 40px wide", async ({ request }) => { const gif = formatFixture("sample.gif"); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: gif }, @@ -175,7 +175,7 @@ test.describe("Resize: GIF", () => { test.describe("Convert to PNG: from JPEG", () => { test("JPEG to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -191,7 +191,7 @@ test.describe("Convert to PNG: from JPEG", () => { test.describe("Convert to PNG: from WebP", () => { test("WebP to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -208,7 +208,7 @@ test.describe("Convert to PNG: from WebP", () => { test.describe("Convert to PNG: from AVIF", () => { test("AVIF to PNG", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -224,7 +224,7 @@ test.describe("Convert to PNG: from AVIF", () => { test.describe("Convert to PNG: from HEIC", () => { test("HEIC to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -241,7 +241,7 @@ test.describe("Convert to PNG: from HEIC", () => { test.describe("Convert to PNG: from TIFF", () => { test("TIFF to PNG", async ({ request }) => { const tiff = formatFixture("sample.tiff"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -258,7 +258,7 @@ test.describe("Convert to PNG: from TIFF", () => { test.describe("Convert to PNG: from GIF", () => { test("GIF to PNG", async ({ request }) => { const gif = formatFixture("sample.gif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: gif }, @@ -275,7 +275,7 @@ test.describe("Convert to PNG: from GIF", () => { test.describe("Convert to PNG: from HEIF", () => { test("HEIF to PNG", async ({ request }) => { const heif = formatFixture("sample.heif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.heif", mimeType: "image/heif", buffer: heif }, @@ -292,7 +292,7 @@ test.describe("Convert to PNG: from HEIF", () => { test.describe("Convert to PNG: from BMP", () => { test("BMP to PNG", async ({ request }) => { const bmp = formatFixture("sample.bmp"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.bmp", mimeType: "image/bmp", buffer: bmp }, @@ -314,7 +314,7 @@ test.describe("Convert to PNG: from BMP", () => { test.describe("Compress: JPEG", () => { test("compress JPEG with quality 30", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: formatFixture("sample.jpg") }, @@ -331,7 +331,7 @@ test.describe("Compress: JPEG", () => { test.describe("Compress: PNG", () => { test("compress PNG with quality 40", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -348,7 +348,7 @@ test.describe("Compress: PNG", () => { test.describe("Compress: WebP", () => { test("compress WebP with quality 25", async ({ request }) => { const webp = formatFixture("sample.webp"); - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.webp", mimeType: "image/webp", buffer: webp }, @@ -365,7 +365,7 @@ test.describe("Compress: WebP", () => { test.describe("Compress: AVIF", () => { test("compress AVIF with quality 40", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -385,7 +385,7 @@ test.describe("Compress: AVIF", () => { test.describe("Compress: HEIC", () => { test("compress HEIC with quality 50", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -407,7 +407,7 @@ test.describe("Compress: HEIC", () => { test.describe("Info: JPEG", () => { test("get info for JPEG returns correct dimensions", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -424,7 +424,7 @@ test.describe("Info: JPEG", () => { test.describe("Info: PNG", () => { test("get info for PNG returns correct dimensions", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -441,7 +441,7 @@ test.describe("Info: PNG", () => { test.describe("Info: WebP", () => { test("get info for WebP returns correct dimensions", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -459,7 +459,7 @@ test.describe("Info: WebP", () => { test.describe("Info: AVIF", () => { test("get info for AVIF returns dimensions and format", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -475,7 +475,7 @@ test.describe("Info: AVIF", () => { test.describe("Info: HEIC", () => { test("get info for HEIC returns dimensions", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -492,7 +492,7 @@ test.describe("Info: HEIC", () => { test.describe("Info: TIFF", () => { test("get info for TIFF returns dimensions and format", async ({ request }) => { const tiff = formatFixture("sample.tiff"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -509,7 +509,7 @@ test.describe("Info: TIFF", () => { test.describe("Info: GIF", () => { test("get info for GIF returns dimensions and format", async ({ request }) => { const gif = formatFixture("sample.gif"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: gif }, @@ -527,7 +527,7 @@ test.describe("Info: GIF", () => { test.describe("Info: HEIF", () => { test("get info for HEIF returns dimensions", async ({ request }) => { const heif = formatFixture("sample.heif"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.heif", mimeType: "image/heif", buffer: heif }, @@ -544,7 +544,7 @@ test.describe("Info: HEIF", () => { test.describe("Info: BMP", () => { test("get info for BMP returns dimensions if supported", async ({ request }) => { const bmp = formatFixture("sample.bmp"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.bmp", mimeType: "image/bmp", buffer: bmp }, @@ -565,7 +565,7 @@ test.describe("Info: BMP", () => { test.describe("Cross-format: JPEG to all targets", () => { test("JPEG to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -579,7 +579,7 @@ test.describe("Cross-format: JPEG to all targets", () => { }); test("JPEG to AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -593,7 +593,7 @@ test.describe("Cross-format: JPEG to all targets", () => { }); test("JPEG to TIFF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -607,7 +607,7 @@ test.describe("Cross-format: JPEG to all targets", () => { }); test("JPEG to GIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -621,7 +621,7 @@ test.describe("Cross-format: JPEG to all targets", () => { }); test("JPEG to HEIC", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -637,7 +637,7 @@ test.describe("Cross-format: JPEG to all targets", () => { test.describe("Cross-format: PNG to all targets", () => { test("PNG to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -651,7 +651,7 @@ test.describe("Cross-format: PNG to all targets", () => { }); test("PNG to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -665,7 +665,7 @@ test.describe("Cross-format: PNG to all targets", () => { }); test("PNG to AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -681,7 +681,7 @@ test.describe("Cross-format: PNG to all targets", () => { test.describe("Cross-format: WebP to all targets", () => { test("WebP to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -695,7 +695,7 @@ test.describe("Cross-format: WebP to all targets", () => { }); test("WebP to AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -709,7 +709,7 @@ test.describe("Cross-format: WebP to all targets", () => { }); test("WebP to TIFF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -725,7 +725,7 @@ test.describe("Cross-format: WebP to all targets", () => { test.describe("Cross-format: HEIC to all targets", () => { test("HEIC to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -739,7 +739,7 @@ test.describe("Cross-format: HEIC to all targets", () => { }); test("HEIC to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -753,7 +753,7 @@ test.describe("Cross-format: HEIC to all targets", () => { }); test("HEIC to AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -767,7 +767,7 @@ test.describe("Cross-format: HEIC to all targets", () => { }); test("HEIC to TIFF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -786,7 +786,7 @@ test.describe("Cross-format: HEIC to all targets", () => { test.describe("Resize + info verification: JPEG", () => { test("resize JPEG then verify dimensions via info", async ({ request }) => { // Step 1: Resize - const resizeRes = await request.post("/api/v1/tools/resize", { + const resizeRes = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -805,7 +805,7 @@ test.describe("Resize + info verification: JPEG", () => { const resizedBuffer = Buffer.from(await dlRes.body()); // Step 3: Verify dimensions via info - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "resized.jpg", mimeType: "image/jpeg", buffer: resizedBuffer }, @@ -820,7 +820,7 @@ test.describe("Resize + info verification: JPEG", () => { test.describe("Resize + info verification: PNG", () => { test("resize PNG then verify dimensions via info", async ({ request }) => { - const resizeRes = await request.post("/api/v1/tools/resize", { + const resizeRes = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -836,7 +836,7 @@ test.describe("Resize + info verification: PNG", () => { expect(dlRes.ok()).toBe(true); const resizedBuffer = Buffer.from(await dlRes.body()); - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "resized.png", mimeType: "image/png", buffer: resizedBuffer }, @@ -855,7 +855,7 @@ test.describe("Resize + info verification: PNG", () => { test.describe("Convert + info verification", () => { test("convert JPEG to WebP then verify format via info", async ({ request }) => { - const convertRes = await request.post("/api/v1/tools/convert", { + const convertRes = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -871,7 +871,7 @@ test.describe("Convert + info verification", () => { expect(dlRes.ok()).toBe(true); const convertedBuffer = Buffer.from(await dlRes.body()); - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "converted.webp", mimeType: "image/webp", buffer: convertedBuffer }, @@ -885,7 +885,7 @@ test.describe("Convert + info verification", () => { }); test("convert PNG to AVIF then verify format via info", async ({ request }) => { - const convertRes = await request.post("/api/v1/tools/convert", { + const convertRes = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -901,7 +901,7 @@ test.describe("Convert + info verification", () => { expect(dlRes.ok()).toBe(true); const convertedBuffer = Buffer.from(await dlRes.body()); - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "converted.avif", mimeType: "image/avif", buffer: convertedBuffer }, diff --git a/tests/e2e-docker/essential-tools.spec.ts b/tests/e2e-docker/essential-tools.spec.ts index f0af4f19..65ab83f0 100644 --- a/tests/e2e-docker/essential-tools.spec.ts +++ b/tests/e2e-docker/essential-tools.spec.ts @@ -61,7 +61,7 @@ const JPG_WITH_EXIF = fixture("test-with-exif.jpg"); test.describe("Resize", () => { test("resize to explicit width and height", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -75,7 +75,7 @@ test.describe("Resize", () => { }); test("resize with only width preserves aspect ratio", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -89,7 +89,7 @@ test.describe("Resize", () => { }); test("resize with only height preserves aspect ratio", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -102,7 +102,7 @@ test.describe("Resize", () => { }); test("resize with fit=cover", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -115,7 +115,7 @@ test.describe("Resize", () => { }); test("resize with withoutEnlargement prevents upscaling", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -129,7 +129,7 @@ test.describe("Resize", () => { }); test("resize HEIC image succeeds", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -142,7 +142,7 @@ test.describe("Resize", () => { }); test("resize rejects invalid width=0", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -155,7 +155,7 @@ test.describe("Resize", () => { }); test("resize rejects request with no file", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { settings: JSON.stringify({ width: 100 }), @@ -169,7 +169,7 @@ test.describe("Resize", () => { test.describe("Crop", () => { test("crop to specific region", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -185,7 +185,7 @@ test.describe("Crop", () => { }); test("crop with zero offset extracts from corner", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -198,7 +198,7 @@ test.describe("Crop", () => { }); test("crop JPEG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -215,7 +215,7 @@ test.describe("Crop", () => { test.describe("Rotate", () => { test("rotate 90 degrees", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -229,7 +229,7 @@ test.describe("Rotate", () => { }); test("rotate 180 degrees", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -242,7 +242,7 @@ test.describe("Rotate", () => { }); test("rotate 270 degrees", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -255,7 +255,7 @@ test.describe("Rotate", () => { }); test("rotate 45 degrees with background fill", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -270,7 +270,7 @@ test.describe("Rotate", () => { }); test("rotate 0 degrees returns image unchanged", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -287,7 +287,7 @@ test.describe("Rotate", () => { test.describe("Convert", () => { test("convert PNG to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -301,7 +301,7 @@ test.describe("Convert", () => { }); test("convert PNG to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -314,7 +314,7 @@ test.describe("Convert", () => { }); test("convert PNG to AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -327,7 +327,7 @@ test.describe("Convert", () => { }); test("convert PNG to TIFF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -340,7 +340,7 @@ test.describe("Convert", () => { }); test("convert PNG to GIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -353,7 +353,7 @@ test.describe("Convert", () => { }); test("convert JPEG to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -366,7 +366,7 @@ test.describe("Convert", () => { }); test("convert HEIC to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -379,7 +379,7 @@ test.describe("Convert", () => { }); test("convert PNG to HEIC", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -392,7 +392,7 @@ test.describe("Convert", () => { }); test("convert with quality parameter", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -405,7 +405,7 @@ test.describe("Convert", () => { }); test("convert PNG to BMP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -423,7 +423,7 @@ test.describe("Convert", () => { test.describe("Compress", () => { test("compress with default settings", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -437,7 +437,7 @@ test.describe("Compress", () => { }); test("compress with low quality produces smaller file", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: formatFixture("sample.jpg") }, @@ -452,7 +452,7 @@ test.describe("Compress", () => { }); test("compress PNG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -466,7 +466,7 @@ test.describe("Compress", () => { test("compress WebP image", async ({ request }) => { const webp = readFileSync(join(FIXTURES, "test-50x50.webp")); - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: webp }, @@ -483,7 +483,7 @@ test.describe("Compress", () => { test.describe("Metadata", () => { test("returns dimensions and format for PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -498,7 +498,7 @@ test.describe("Metadata", () => { }); test("returns dimensions for JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -513,7 +513,7 @@ test.describe("Metadata", () => { test("returns EXIF data when present", async ({ request }) => { const jpgExif = fixture("test-with-exif.jpg"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test-with-exif.jpg", mimeType: "image/jpeg", buffer: jpgExif }, @@ -525,7 +525,7 @@ test.describe("Metadata", () => { }); test("returns channel and alpha info", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -543,7 +543,7 @@ test.describe("Metadata", () => { test.describe("Colors", () => { test("adjust brightness", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -557,7 +557,7 @@ test.describe("Colors", () => { }); test("adjust contrast and saturation together", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -570,7 +570,7 @@ test.describe("Colors", () => { }); test("convert to grayscale", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -583,7 +583,7 @@ test.describe("Colors", () => { }); test("negative brightness darkens image", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -601,7 +601,7 @@ test.describe("Colors", () => { test.describe("Sharpening", () => { test("sharpen with default sigma", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -615,7 +615,7 @@ test.describe("Sharpening", () => { }); test("sharpen with explicit sigma", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -628,7 +628,7 @@ test.describe("Sharpening", () => { }); test("sharpen HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -645,7 +645,7 @@ test.describe("Sharpening", () => { test.describe("Resize — additional", () => { test("resize with fit=inside constrains within bounds", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -659,7 +659,7 @@ test.describe("Resize — additional", () => { }); test("resize with percentage scale via width only", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -673,7 +673,7 @@ test.describe("Resize — additional", () => { test("resize WebP image", async ({ request }) => { const webp = readFileSync(join(FIXTURES, "test-50x50.webp")); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: webp }, @@ -686,7 +686,7 @@ test.describe("Resize — additional", () => { }); test("resize rejects negative width", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -703,7 +703,7 @@ test.describe("Resize — additional", () => { test.describe("Crop — additional", () => { test("crop HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -718,7 +718,7 @@ test.describe("Crop — additional", () => { test("crop WebP image", async ({ request }) => { const webp = readFileSync(join(FIXTURES, "test-50x50.webp")); - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: webp }, @@ -731,7 +731,7 @@ test.describe("Crop — additional", () => { }); test("crop full image returns same-size output", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -749,7 +749,7 @@ test.describe("Crop — additional", () => { test.describe("Rotate — additional", () => { test("rotate HEIC image 90 degrees", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -762,7 +762,7 @@ test.describe("Rotate — additional", () => { }); test("rotate arbitrary angle (30 degrees)", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -780,7 +780,7 @@ test.describe("Rotate — additional", () => { test.describe("Compress — additional", () => { test("compress HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -794,7 +794,7 @@ test.describe("Compress — additional", () => { }); test("compress with high quality (95)", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -807,7 +807,7 @@ test.describe("Compress — additional", () => { }); test("compress with minimum quality (1)", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: formatFixture("sample.jpg") }, @@ -825,7 +825,7 @@ test.describe("Compress — additional", () => { test.describe("Convert — output verification", () => { test("converted file can be downloaded", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -847,7 +847,7 @@ test.describe("Convert — output verification", () => { test("convert WebP to AVIF", async ({ request }) => { const webp = readFileSync(join(FIXTURES, "test-50x50.webp")); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: webp }, @@ -865,7 +865,7 @@ test.describe("Convert — output verification", () => { test.describe("Metadata — additional", () => { test("returns metadata for SVG image", async ({ request }) => { const svg = readFileSync(join(FIXTURES, "test-100x100.svg")); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: svg }, @@ -879,7 +879,7 @@ test.describe("Metadata — additional", () => { test("returns metadata for WebP image", async ({ request }) => { const webp = readFileSync(join(FIXTURES, "test-50x50.webp")); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: webp }, @@ -897,7 +897,7 @@ test.describe("Metadata — additional", () => { test.describe("Color Blindness Simulation", () => { test("simulate deuteranomaly (default)", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -911,7 +911,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate protanopia", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -924,7 +924,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate tritanopia", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -937,7 +937,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate achromatopsia (total color blindness)", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -950,7 +950,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate deuteranopia on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -963,7 +963,7 @@ test.describe("Color Blindness Simulation", () => { }); test("simulate blueConeMonochromacy", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -976,7 +976,7 @@ test.describe("Color Blindness Simulation", () => { }); test("color-blindness without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-blindness", { + const res = await request.post("/api/v1/tools/image/color-blindness", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ simulationType: "protanopia" }), @@ -990,7 +990,7 @@ test.describe("Color Blindness Simulation", () => { test.describe("Strip Metadata", () => { test("strip metadata with default settings", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_WITH_EXIF }, @@ -1006,7 +1006,7 @@ test.describe("Strip Metadata", () => { }); test("strip metadata from PNG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1019,7 +1019,7 @@ test.describe("Strip Metadata", () => { }); test("strip metadata from HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -1033,7 +1033,7 @@ test.describe("Strip Metadata", () => { test("strip then verify no EXIF via info tool", async ({ request }) => { // Strip metadata - const stripRes = await request.post("/api/v1/tools/strip-metadata", { + const stripRes = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_WITH_EXIF }, @@ -1051,7 +1051,7 @@ test.describe("Strip Metadata", () => { const strippedBuffer = Buffer.from(await dlRes.body()); // Verify via info tool - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stripped.jpg", mimeType: "image/jpeg", buffer: strippedBuffer }, @@ -1067,7 +1067,7 @@ test.describe("Strip Metadata", () => { test.describe("Edit Metadata", () => { test("set artist field on JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -1081,7 +1081,7 @@ test.describe("Edit Metadata", () => { }); test("set all EXIF fields at once", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -1100,7 +1100,7 @@ test.describe("Edit Metadata", () => { }); test("edit metadata on PNG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1113,7 +1113,7 @@ test.describe("Edit Metadata", () => { }); test("edit metadata round-trip verification", async ({ request }) => { - const editRes = await request.post("/api/v1/tools/edit-metadata", { + const editRes = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -1131,7 +1131,7 @@ test.describe("Edit Metadata", () => { const editedBuffer = Buffer.from(await dlRes.body()); // Check info on the edited image - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "edited.jpg", mimeType: "image/jpeg", buffer: editedBuffer }, @@ -1143,7 +1143,7 @@ test.describe("Edit Metadata", () => { }); test("edit metadata on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -1160,7 +1160,7 @@ test.describe("Edit Metadata", () => { test.describe("SVG Input", () => { test("resize SVG input", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -1174,7 +1174,7 @@ test.describe("SVG Input", () => { }); test("rotate SVG input", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -1187,7 +1187,7 @@ test.describe("SVG Input", () => { }); test("compress SVG input (rasterized)", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -1200,7 +1200,7 @@ test.describe("SVG Input", () => { }); test("convert SVG to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -1218,7 +1218,7 @@ test.describe("SVG Input", () => { test.describe("Tiny file (1x1 pixel)", () => { test("resize 1x1 PNG to larger dimensions", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -1232,7 +1232,7 @@ test.describe("Tiny file (1x1 pixel)", () => { }); test("crop 1x1 PNG to same size succeeds", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -1245,7 +1245,7 @@ test.describe("Tiny file (1x1 pixel)", () => { }); test("rotate 1x1 PNG by 90 degrees", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -1258,7 +1258,7 @@ test.describe("Tiny file (1x1 pixel)", () => { }); test("convert 1x1 PNG to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -1271,7 +1271,7 @@ test.describe("Tiny file (1x1 pixel)", () => { }); test("compress 1x1 PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -1284,7 +1284,7 @@ test.describe("Tiny file (1x1 pixel)", () => { }); test("info returns 1x1 dimensions", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -1302,7 +1302,7 @@ test.describe("Tiny file (1x1 pixel)", () => { test.describe("Large file processing", () => { test("resize large JPEG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stress.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE_LARGE }, @@ -1318,7 +1318,7 @@ test.describe("Large file processing", () => { }); test("compress large JPEG with aggressive quality", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stress.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE_LARGE }, @@ -1332,7 +1332,7 @@ test.describe("Large file processing", () => { }); test("convert large JPEG to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stress.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE_LARGE }, @@ -1346,7 +1346,7 @@ test.describe("Large file processing", () => { }); test("rotate large JPEG 270 degrees", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stress.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE_LARGE }, @@ -1360,7 +1360,7 @@ test.describe("Large file processing", () => { }); test("info on large JPEG returns dimensions", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stress.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE_LARGE }, @@ -1378,7 +1378,7 @@ test.describe("Large file processing", () => { test.describe("Output download verification", () => { test("resized file is downloadable and valid", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1397,7 +1397,7 @@ test.describe("Output download verification", () => { expect(buffer.length).toBeGreaterThan(0); // Verify dimensions via info tool - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "resized.png", mimeType: "image/png", buffer: buffer }, @@ -1409,7 +1409,7 @@ test.describe("Output download verification", () => { }); test("cropped file dimensions match request", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1425,7 +1425,7 @@ test.describe("Output download verification", () => { expect(dlRes.ok()).toBe(true); const buffer = Buffer.from(await dlRes.body()); - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "cropped.png", mimeType: "image/png", buffer: buffer }, @@ -1438,7 +1438,7 @@ test.describe("Output download verification", () => { }); test("90-degree rotation swaps width and height", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1454,7 +1454,7 @@ test.describe("Output download verification", () => { expect(dlRes.ok()).toBe(true); const buffer = Buffer.from(await dlRes.body()); - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "rotated.png", mimeType: "image/png", buffer: buffer }, @@ -1472,7 +1472,7 @@ test.describe("Output download verification", () => { test.describe("Auth failure", () => { test("resize without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ width: 100 }), @@ -1482,7 +1482,7 @@ test.describe("Auth failure", () => { }); test("crop without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ left: 0, top: 0, width: 50, height: 50 }), @@ -1492,7 +1492,7 @@ test.describe("Auth failure", () => { }); test("convert without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ format: "jpg" }), @@ -1502,7 +1502,7 @@ test.describe("Auth failure", () => { }); test("compress without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, settings: JSON.stringify({ quality: 50 }), @@ -1512,7 +1512,7 @@ test.describe("Auth failure", () => { }); test("sharpening without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, settings: JSON.stringify({}), @@ -1522,7 +1522,7 @@ test.describe("Auth failure", () => { }); test("strip-metadata without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_WITH_EXIF }, settings: JSON.stringify({}), @@ -1532,7 +1532,7 @@ test.describe("Auth failure", () => { }); test("edit-metadata without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, settings: JSON.stringify({ artist: "Test" }), diff --git a/tests/e2e-docker/exotic-formats.spec.ts b/tests/e2e-docker/exotic-formats.spec.ts index 0d0bbd12..7fa9f0b1 100644 --- a/tests/e2e-docker/exotic-formats.spec.ts +++ b/tests/e2e-docker/exotic-formats.spec.ts @@ -42,7 +42,7 @@ const SVG_SAMPLE = formatFixture("sample.svg"); test.describe("TIFF input through core tools", () => { test("resize TIFF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: TIFF_SAMPLE }, @@ -56,7 +56,7 @@ test.describe("TIFF input through core tools", () => { }); test("crop TIFF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: TIFF_SAMPLE }, @@ -69,7 +69,7 @@ test.describe("TIFF input through core tools", () => { }); test("rotate TIFF image 90 degrees", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: TIFF_SAMPLE }, @@ -82,7 +82,7 @@ test.describe("TIFF input through core tools", () => { }); test("sharpen TIFF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: TIFF_SAMPLE }, @@ -95,7 +95,7 @@ test.describe("TIFF input through core tools", () => { }); test("adjust colors on TIFF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: TIFF_SAMPLE }, @@ -108,7 +108,7 @@ test.describe("TIFF input through core tools", () => { }); test("color palette from TIFF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: TIFF_SAMPLE }, @@ -121,7 +121,7 @@ test.describe("TIFF input through core tools", () => { }); test("border on TIFF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: TIFF_SAMPLE }, @@ -138,7 +138,7 @@ test.describe("TIFF input through core tools", () => { test.describe("AVIF input through core tools", () => { test("resize AVIF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: AVIF_SAMPLE }, @@ -151,7 +151,7 @@ test.describe("AVIF input through core tools", () => { }); test("crop AVIF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: AVIF_SAMPLE }, @@ -164,7 +164,7 @@ test.describe("AVIF input through core tools", () => { }); test("compress AVIF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/compress", { + const res = await request.post("/api/v1/tools/image/compress", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: AVIF_SAMPLE }, @@ -177,7 +177,7 @@ test.describe("AVIF input through core tools", () => { }); test("convert AVIF to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: AVIF_SAMPLE }, @@ -190,7 +190,7 @@ test.describe("AVIF input through core tools", () => { }); test("convert AVIF to JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: AVIF_SAMPLE }, @@ -203,7 +203,7 @@ test.describe("AVIF input through core tools", () => { }); test("info on AVIF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: AVIF_SAMPLE }, @@ -216,7 +216,7 @@ test.describe("AVIF input through core tools", () => { }); test("watermark text on AVIF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: AVIF_SAMPLE }, @@ -239,7 +239,7 @@ test.describe("AVIF input through core tools", () => { test.describe("GIF input through core tools", () => { test("resize GIF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: GIF_SAMPLE }, @@ -252,7 +252,7 @@ test.describe("GIF input through core tools", () => { }); test("convert GIF to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: GIF_SAMPLE }, @@ -265,7 +265,7 @@ test.describe("GIF input through core tools", () => { }); test("convert GIF to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: GIF_SAMPLE }, @@ -278,7 +278,7 @@ test.describe("GIF input through core tools", () => { }); test("info on GIF image", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: GIF_SAMPLE }, @@ -296,7 +296,7 @@ test.describe("GIF input through core tools", () => { test.describe("PSD input through core tools", () => { test("info on PSD image", async ({ request }) => { const psd = formatFixture("sample.psd"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.psd", mimeType: "image/vnd.adobe.photoshop", buffer: psd }, @@ -314,7 +314,7 @@ test.describe("PSD input through core tools", () => { test("resize PSD image", async ({ request }) => { const psd = formatFixture("sample.psd"); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.psd", mimeType: "image/vnd.adobe.photoshop", buffer: psd }, @@ -332,7 +332,7 @@ test.describe("PSD input through core tools", () => { test("convert PSD to PNG", async ({ request }) => { const psd = formatFixture("sample.psd"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.psd", mimeType: "image/vnd.adobe.photoshop", buffer: psd }, @@ -354,7 +354,7 @@ test.describe("SVG input through extended tools", () => { test("SVG to raster at multiple widths", async ({ request }) => { const widths = [64, 256, 512, 1024] as const; for (const width of widths) { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.svg", mimeType: "image/svg+xml", buffer: SVG_SAMPLE }, @@ -369,7 +369,7 @@ test.describe("SVG input through extended tools", () => { }); test("SVG to raster as JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.svg", mimeType: "image/svg+xml", buffer: SVG_SAMPLE }, @@ -382,7 +382,7 @@ test.describe("SVG input through extended tools", () => { }); test("SVG to raster as AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.svg", mimeType: "image/svg+xml", buffer: SVG_SAMPLE }, @@ -396,7 +396,7 @@ test.describe("SVG input through extended tools", () => { test("color palette from SVG input", async ({ request }) => { const svgLogo = contentFixture("svg-logo.svg"); - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "logo.svg", mimeType: "image/svg+xml", buffer: svgLogo }, @@ -410,7 +410,7 @@ test.describe("SVG input through extended tools", () => { test("beautify SVG input", async ({ request }) => { const svg100 = fixture("test-100x100.svg"); - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: svg100 }, @@ -433,7 +433,7 @@ test.describe("SVG input through extended tools", () => { test.describe("HEIF input through core tools", () => { test("info on HEIF image", async ({ request }) => { const heif = contentFixture("motorcycle.heif"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "motorcycle.heif", mimeType: "image/heif", buffer: heif }, @@ -447,7 +447,7 @@ test.describe("HEIF input through core tools", () => { test("resize HEIF image", async ({ request }) => { const heif = contentFixture("motorcycle.heif"); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "motorcycle.heif", mimeType: "image/heif", buffer: heif }, @@ -461,7 +461,7 @@ test.describe("HEIF input through core tools", () => { test("convert HEIF to JPEG", async ({ request }) => { const heif = contentFixture("motorcycle.heif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "motorcycle.heif", mimeType: "image/heif", buffer: heif }, @@ -475,7 +475,7 @@ test.describe("HEIF input through core tools", () => { test("convert HEIF to WebP", async ({ request }) => { const heif = contentFixture("motorcycle.heif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "motorcycle.heif", mimeType: "image/heif", buffer: heif }, @@ -489,7 +489,7 @@ test.describe("HEIF input through core tools", () => { test("color palette from HEIF image", async ({ request }) => { const heif = contentFixture("motorcycle.heif"); - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "motorcycle.heif", mimeType: "image/heif", buffer: heif }, @@ -503,7 +503,7 @@ test.describe("HEIF input through core tools", () => { test("adjust colors on HEIF image", async ({ request }) => { const heif = contentFixture("motorcycle.heif"); - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "motorcycle.heif", mimeType: "image/heif", buffer: heif }, @@ -521,7 +521,7 @@ test.describe("HEIF input through core tools", () => { test.describe("Multipage TIFF", () => { test("info on multipage TIFF", async ({ request }) => { const multiTiff = formatFixture("multipage.tiff"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "multipage.tiff", mimeType: "image/tiff", buffer: multiTiff }, @@ -535,7 +535,7 @@ test.describe("Multipage TIFF", () => { test("convert multipage TIFF to PNG", async ({ request }) => { const multiTiff = formatFixture("multipage.tiff"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "multipage.tiff", mimeType: "image/tiff", buffer: multiTiff }, @@ -553,7 +553,7 @@ test.describe("Multipage TIFF", () => { test.describe("Animated GIF through core tools", () => { test("info on animated GIF", async ({ request }) => { const animated = fixture("animated.gif"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: animated }, @@ -567,7 +567,7 @@ test.describe("Animated GIF through core tools", () => { test("resize animated GIF (first frame)", async ({ request }) => { const animated = fixture("animated.gif"); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: animated }, @@ -581,7 +581,7 @@ test.describe("Animated GIF through core tools", () => { test("convert animated GIF to PNG (first frame)", async ({ request }) => { const animated = fixture("animated.gif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: animated }, @@ -610,7 +610,7 @@ test.describe("Cross-format conversion matrix", () => { for (const { from, file, mime, to } of conversions) { test(`convert ${from} to ${to}`, async ({ request }) => { const buffer = formatFixture(file); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: file, mimeType: mime, buffer }, diff --git a/tests/e2e-docker/feature-lifecycle.spec.ts b/tests/e2e-docker/feature-lifecycle.spec.ts index a3f71a2a..2b7d85d9 100644 --- a/tests/e2e-docker/feature-lifecycle.spec.ts +++ b/tests/e2e-docker/feature-lifecycle.spec.ts @@ -1,5 +1,6 @@ import type { APIRequestContext } from "@playwright/test"; import { expect, test } from "@playwright/test"; +import { apiToolPath } from "@snapotter/shared"; // ---- Helpers --------------------------------------------------------------- @@ -87,7 +88,7 @@ async function callTool( settings: Record = {}, ) { const headers = await authHeaders(request); - return request.post(`${API}/api/v1/tools/${toolId}`, { + return request.post(`${API}${apiToolPath(toolId)}`, { headers, multipart: { file: { diff --git a/tests/e2e-docker/features.spec.ts b/tests/e2e-docker/features.spec.ts index 62d036c5..939437d0 100644 --- a/tests/e2e-docker/features.spec.ts +++ b/tests/e2e-docker/features.spec.ts @@ -1,4 +1,5 @@ import { expect, test } from "@playwright/test"; +import { apiToolPath } from "@snapotter/shared"; // ─── Helpers ──────────────────────────────────────────────────────── @@ -144,7 +145,7 @@ test.describe("Tool route guards", () => { // ocr bundle is uninstalled -- expect 501 test("ocr returns 501 FEATURE_NOT_INSTALLED with correct bundle", async ({ request }) => { - const response = await request.post("/api/v1/tools/ocr", { + const response = await request.post("/api/v1/tools/image/ocr", { multipart: { file: { name: "test.png", @@ -178,7 +179,7 @@ test.describe("Tool route guards", () => { for (const { tool } of installedAiTools) { test(`${tool} returns 200 when bundle is installed`, async ({ request }) => { - const response = await request.post(`/api/v1/tools/${tool}`, { + const response = await request.post(apiToolPath(tool), { multipart: { file: { name: "test.png", @@ -193,7 +194,7 @@ test.describe("Tool route guards", () => { } test("non-AI tool works normally (resize)", async ({ request }) => { - const response = await request.post("/api/v1/tools/resize", { + const response = await request.post("/api/v1/tools/image/resize", { multipart: { file: { name: "test.png", @@ -217,7 +218,7 @@ test.describe("Tool route guards", () => { // ─── Batch guard (ocr is not installed at this point) ───────────── test("batch endpoint returns 501 for uninstalled AI tool", async ({ request }) => { - const response = await request.post("/api/v1/tools/ocr/batch", { + const response = await request.post("/api/v1/tools/image/ocr/batch", { multipart: { "files[]": { name: "test.png", diff --git a/tests/e2e-docker/fixes-verification.spec.ts b/tests/e2e-docker/fixes-verification.spec.ts index 00e389bc..7ab2dfef 100644 --- a/tests/e2e-docker/fixes-verification.spec.ts +++ b/tests/e2e-docker/fixes-verification.spec.ts @@ -33,7 +33,7 @@ async function waitForProcessingDone(page: Page, timeoutMs = 120_000): Promise { test("tool validation error shows readable message, not [object Object]", async ({ request }) => { // Send a malformed request directly to trigger a validation error - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { multipart: { file: { name: "test.jpg", @@ -421,7 +421,7 @@ test.describe("Container health", () => { test("error responses have string details, not objects", async ({ request }) => { const formData = new URLSearchParams(); - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { "Content-Type": "application/x-www-form-urlencoded" }, data: formData.toString(), }); diff --git a/tests/e2e-docker/format-conversion-tools.spec.ts b/tests/e2e-docker/format-conversion-tools.spec.ts index aeab40da..f6b02dfb 100644 --- a/tests/e2e-docker/format-conversion-tools.spec.ts +++ b/tests/e2e-docker/format-conversion-tools.spec.ts @@ -45,7 +45,7 @@ const PDF_3PAGE = fixture("test-3page.pdf"); test.describe("SVG to Raster — extended", () => { test("convert SVG to AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -59,7 +59,7 @@ test.describe("SVG to Raster — extended", () => { }); test("convert SVG to TIFF", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -72,7 +72,7 @@ test.describe("SVG to Raster — extended", () => { }); test("convert SVG with large render width (1024px)", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -87,7 +87,7 @@ test.describe("SVG to Raster — extended", () => { test("convert QR code SVG to raster", async ({ request }) => { const qrSvg = contentFixture("qr-code.svg"); - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "qr.svg", mimeType: "image/svg+xml", buffer: qrSvg }, @@ -104,7 +104,7 @@ test.describe("SVG to Raster — extended", () => { test.describe("Vectorize — extended", () => { test("vectorize WebP to SVG", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -118,7 +118,7 @@ test.describe("Vectorize — extended", () => { }); test("vectorize HEIC to SVG", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -132,7 +132,7 @@ test.describe("Vectorize — extended", () => { test("vectorize AVIF sample to SVG", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -146,7 +146,7 @@ test.describe("Vectorize — extended", () => { test("vectorize TIFF sample to SVG", async ({ request }) => { const tiff = formatFixture("sample.tiff"); - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -163,7 +163,7 @@ test.describe("Vectorize — extended", () => { test.describe("GIF Tools — extended", () => { test("GIF tool with resize settings", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, @@ -180,7 +180,7 @@ test.describe("GIF Tools — extended", () => { }); test("GIF tool with extract-frames action", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, @@ -198,7 +198,7 @@ test.describe("GIF Tools — extended", () => { test("GIF tool with speed adjustment", async ({ request }) => { const simpsons = contentFixture("animated-simpsons.gif"); - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "simpsons.gif", mimeType: "image/gif", buffer: simpsons }, @@ -215,7 +215,7 @@ test.describe("GIF Tools — extended", () => { }); test("GIF tool with reverse action", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, @@ -232,7 +232,7 @@ test.describe("GIF Tools — extended", () => { }); test("reject non-GIF file", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -251,7 +251,7 @@ test.describe("GIF Tools — extended", () => { test.describe("PDF to Image — extended", () => { test("convert PDF to AVIF format", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -264,7 +264,7 @@ test.describe("PDF to Image — extended", () => { }); test("convert PDF at high DPI (300)", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -277,7 +277,7 @@ test.describe("PDF to Image — extended", () => { }); test("convert PDF at low DPI (72)", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -290,7 +290,7 @@ test.describe("PDF to Image — extended", () => { }); test("convert specific middle page", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -303,7 +303,7 @@ test.describe("PDF to Image — extended", () => { }); test("convert last page only", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -321,7 +321,7 @@ test.describe("PDF to Image — extended", () => { test.describe("Convert from exotic formats", () => { test("TIFF to PNG", async ({ request }) => { const tiff = formatFixture("sample.tiff"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -336,7 +336,7 @@ test.describe("Convert from exotic formats", () => { test("TIFF to JPEG", async ({ request }) => { const tiff = formatFixture("sample.tiff"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -350,7 +350,7 @@ test.describe("Convert from exotic formats", () => { test("AVIF to PNG", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -364,7 +364,7 @@ test.describe("Convert from exotic formats", () => { test("AVIF to WebP", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -378,7 +378,7 @@ test.describe("Convert from exotic formats", () => { test("GIF to PNG (single frame)", async ({ request }) => { const gif = formatFixture("sample.gif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: gif }, @@ -392,7 +392,7 @@ test.describe("Convert from exotic formats", () => { test("HEIF to WebP", async ({ request }) => { const heif = formatFixture("sample.heif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.heif", mimeType: "image/heif", buffer: heif }, @@ -406,7 +406,7 @@ test.describe("Convert from exotic formats", () => { test("HEIF to JPEG", async ({ request }) => { const heif = formatFixture("sample.heif"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.heif", mimeType: "image/heif", buffer: heif }, @@ -423,7 +423,7 @@ test.describe("Convert from exotic formats", () => { test.describe("Image to Base64 — extended", () => { test("encode WebP to base64", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -439,7 +439,7 @@ test.describe("Image to Base64 — extended", () => { }); test("encode HEIC to base64 with format conversion", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -454,7 +454,7 @@ test.describe("Image to Base64 — extended", () => { test("encode with both maxWidth and format conversion", async ({ request }) => { const sample = formatFixture("sample.jpg"); - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: sample }, @@ -473,7 +473,7 @@ test.describe("Image to Base64 — extended", () => { test.describe("Multipage TIFF handling", () => { test("convert multipage TIFF to PNG", async ({ request }) => { const multiTiff = formatFixture("multipage.tiff"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "multipage.tiff", mimeType: "image/tiff", buffer: multiTiff }, @@ -488,7 +488,7 @@ test.describe("Multipage TIFF handling", () => { test("get info from multipage TIFF", async ({ request }) => { const multiTiff = formatFixture("multipage.tiff"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "multipage.tiff", mimeType: "image/tiff", buffer: multiTiff }, @@ -507,7 +507,7 @@ test.describe("Multipage TIFF handling", () => { test.describe("JXL format handling", () => { test("convert JXL to PNG", async ({ request }) => { const jxl = formatFixture("sample.jxl"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jxl", mimeType: "image/jxl", buffer: jxl }, @@ -526,7 +526,7 @@ test.describe("JXL format handling", () => { test("convert JXL to JPEG", async ({ request }) => { const jxl = formatFixture("sample.jxl"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jxl", mimeType: "image/jxl", buffer: jxl }, @@ -543,7 +543,7 @@ test.describe("JXL format handling", () => { test("get info from JXL file", async ({ request }) => { const jxl = formatFixture("sample.jxl"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jxl", mimeType: "image/jxl", buffer: jxl }, @@ -565,7 +565,7 @@ test.describe("JXL format handling", () => { test.describe("ICO format handling", () => { test("convert ICO to PNG", async ({ request }) => { const ico = formatFixture("sample.ico"); - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.ico", mimeType: "image/x-icon", buffer: ico }, @@ -586,7 +586,7 @@ test.describe("ICO format handling", () => { test.describe("SVG to Raster — all output formats", () => { test("convert SVG to GIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -604,7 +604,7 @@ test.describe("SVG to Raster — all output formats", () => { }); test("convert SVG with small render width (32px)", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -619,7 +619,7 @@ test.describe("SVG to Raster — all output formats", () => { test("convert SVG logo to WebP", async ({ request }) => { const svgLogo = contentFixture("svg-logo.svg"); - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "logo.svg", mimeType: "image/svg+xml", buffer: svgLogo }, @@ -637,7 +637,7 @@ test.describe("SVG to Raster — all output formats", () => { test.describe("Vectorize — round-trip", () => { test("vectorize PNG then convert SVG back to raster", async ({ request }) => { // Step 1: Vectorize PNG to SVG - const vecRes = await request.post("/api/v1/tools/vectorize", { + const vecRes = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -656,7 +656,7 @@ test.describe("Vectorize — round-trip", () => { const svgBuffer = Buffer.from(await dlRes.body()); // Step 3: Convert SVG back to PNG - const rasterRes = await request.post("/api/v1/tools/svg-to-raster", { + const rasterRes = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "vectorized.svg", mimeType: "image/svg+xml", buffer: svgBuffer }, @@ -674,7 +674,7 @@ test.describe("Vectorize — round-trip", () => { test.describe("PDF to Image — additional formats", () => { test("convert PDF to TIFF format", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -692,7 +692,7 @@ test.describe("PDF to Image — additional formats", () => { }); test("convert all 3 pages to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -705,7 +705,7 @@ test.describe("PDF to Image — additional formats", () => { }); test("convert page range 1-3 to PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -722,7 +722,7 @@ test.describe("PDF to Image — additional formats", () => { test.describe("SVG to Raster — output verification", () => { test("SVG-to-raster output can be downloaded", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -747,7 +747,7 @@ test.describe("SVG to Raster — output verification", () => { test.describe("GIF Tools — output verification", () => { test("GIF tool with optimize action", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, @@ -764,7 +764,7 @@ test.describe("GIF Tools — output verification", () => { }); test("GIF tool with crop action", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, @@ -791,7 +791,7 @@ test.describe("GIF Tools — output verification", () => { test.describe("Vectorize — output verification", () => { test("vectorized SVG output can be downloaded", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -817,7 +817,7 @@ test.describe("Vectorize — output verification", () => { test.describe("PDF to Image — output verification", () => { test("PDF conversion output can be downloaded", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -842,7 +842,7 @@ test.describe("PDF to Image — output verification", () => { test.describe("SVG to Raster -- background color", () => { test("SVG to PNG with white background", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -856,7 +856,7 @@ test.describe("SVG to Raster -- background color", () => { }); test("SVG to JPEG with red background", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -869,7 +869,7 @@ test.describe("SVG to Raster -- background color", () => { }); test("SVG to WebP with transparent background", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -886,7 +886,7 @@ test.describe("SVG to Raster -- background color", () => { test.describe("SVG to Raster -- dimensions", () => { test("SVG to PNG with width only", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -900,7 +900,7 @@ test.describe("SVG to Raster -- dimensions", () => { }); test("SVG to PNG with height only", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -913,7 +913,7 @@ test.describe("SVG to Raster -- dimensions", () => { }); test("SVG to PNG with both width and height", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, @@ -930,7 +930,7 @@ test.describe("SVG to Raster -- dimensions", () => { test.describe("Vectorize -- options", () => { test("vectorize with default options", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: fixture("test-100x100.jpg") }, @@ -944,7 +944,7 @@ test.describe("Vectorize -- options", () => { }); test("vectorize with high detail (if supported)", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -958,7 +958,7 @@ test.describe("Vectorize -- options", () => { }); test("vectorize with color count (if supported)", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -971,7 +971,7 @@ test.describe("Vectorize -- options", () => { }); test("vectorized SVG content is valid XML", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -996,7 +996,7 @@ test.describe("Vectorize -- options", () => { test.describe("GIF Tools -- all modes", () => { test("GIF tool with slow speed (0.5x)", async ({ request }) => { const simpsons = contentFixture("animated-simpsons.gif"); - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "simpsons.gif", mimeType: "image/gif", buffer: simpsons }, @@ -1014,7 +1014,7 @@ test.describe("GIF Tools -- all modes", () => { test("GIF tool with fast speed (4x)", async ({ request }) => { const simpsons = contentFixture("animated-simpsons.gif"); - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "simpsons.gif", mimeType: "image/gif", buffer: simpsons }, @@ -1031,7 +1031,7 @@ test.describe("GIF Tools -- all modes", () => { }); test("GIF tool with bounce (forward+reverse)", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, @@ -1052,7 +1052,7 @@ test.describe("GIF Tools -- all modes", () => { test.describe("PDF to Image -- page selection", () => { test("convert PDF page range 1-2", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -1065,7 +1065,7 @@ test.describe("PDF to Image -- page selection", () => { }); test("convert PDF page range 2-3", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -1085,7 +1085,7 @@ test.describe("PDF to Image -- DPI variations", () => { for (const dpi of dpis) { test(`convert PDF at DPI=${dpi}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, @@ -1139,7 +1139,7 @@ test.describe("Image to PDF -- orientation", () => { [{ name: "file", filename: "test.png", contentType: "image/png", buffer: PNG_200x150 }], [{ name: "settings", value: JSON.stringify({ pageSize: "A4", orientation: "landscape" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -1154,7 +1154,7 @@ test.describe("Image to PDF -- orientation", () => { [{ name: "file", filename: "test.png", contentType: "image/png", buffer: PNG_200x150 }], [{ name: "settings", value: JSON.stringify({ pageSize: "A4", orientation: "portrait" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -1183,7 +1183,7 @@ test.describe("Image to PDF -- orientation", () => { ], [{ name: "settings", value: JSON.stringify({ pageSize: "Letter" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -1205,7 +1205,7 @@ test.describe("Image to PDF -- orientation", () => { ], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -1230,7 +1230,7 @@ test.describe("Image to PDF -- orientation", () => { test.describe("Auth failure", () => { test("svg-to-raster without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/svg-to-raster", { + const res = await request.post("/api/v1/tools/image/svg-to-raster", { multipart: { file: { name: "test.svg", mimeType: "image/svg+xml", buffer: SVG_100x100 }, settings: JSON.stringify({ format: "png", width: 200 }), @@ -1240,7 +1240,7 @@ test.describe("Auth failure", () => { }); test("vectorize without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({}), @@ -1250,7 +1250,7 @@ test.describe("Auth failure", () => { }); test("pdf-to-image without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/pdf-to-image", { + const res = await request.post("/api/v1/tools/pdf/pdf-to-image", { multipart: { file: { name: "test.pdf", mimeType: "application/pdf", buffer: PDF_3PAGE }, settings: JSON.stringify({ format: "png", dpi: 150, pages: "1" }), @@ -1260,7 +1260,7 @@ test.describe("Auth failure", () => { }); test("gif-tools without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/gif-tools", { + const res = await request.post("/api/v1/tools/image/gif-tools", { multipart: { file: { name: "animated.gif", mimeType: "image/gif", buffer: ANIMATED_GIF }, settings: JSON.stringify({}), @@ -1270,7 +1270,7 @@ test.describe("Auth failure", () => { }); test("convert without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ format: "jpg" }), diff --git a/tests/e2e-docker/full-tool-audit.mjs b/tests/e2e-docker/full-tool-audit.mjs index bda66beb..669731d7 100644 --- a/tests/e2e-docker/full-tool-audit.mjs +++ b/tests/e2e-docker/full-tool-audit.mjs @@ -26,7 +26,9 @@ async function callTool(path, settings, filename = "test.webp") { const formData = new FormData(); formData.append("file", new File([imageBlob], filename, { type: "image/webp" })); formData.append("settings", JSON.stringify(settings)); - const res = await fetch(`${BASE}/api/v1/tools/${path}`, { + // All audited tools are image-modality; section prefix hardcoded + // (cannot import apiToolPath from @snapotter/shared in plain .mjs). + const res = await fetch(`${BASE}/api/v1/tools/image/${path}`, { method: "POST", headers: { Authorization: `Bearer ${token}` }, body: formData, @@ -259,7 +261,7 @@ async function main() { const formData = new FormData(); formData.append("file", new File([imageBlob], "test.webp", { type: "image/webp" })); formData.append("settings", JSON.stringify({})); - const res = await fetch(`${BASE}/api/v1/tools/favicon`, { + const res = await fetch(`${BASE}/api/v1/tools/image/favicon`, { method: "POST", headers: { Authorization: `Bearer ${token}` }, body: formData, diff --git a/tests/e2e-docker/layout-tools.spec.ts b/tests/e2e-docker/layout-tools.spec.ts index b3895228..3f387b7a 100644 --- a/tests/e2e-docker/layout-tools.spec.ts +++ b/tests/e2e-docker/layout-tools.spec.ts @@ -95,7 +95,7 @@ test.describe("Collage — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -123,7 +123,7 @@ test.describe("Collage — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -153,7 +153,7 @@ test.describe("Collage — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -179,7 +179,7 @@ test.describe("Collage — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -198,7 +198,7 @@ test.describe("Collage — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -221,7 +221,7 @@ test.describe("Stitch — extended", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "horizontal", gap: 5 }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -241,7 +241,7 @@ test.describe("Stitch — extended", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "vertical", gap: 10 }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -267,7 +267,7 @@ test.describe("Stitch — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -291,7 +291,7 @@ test.describe("Stitch — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -321,7 +321,7 @@ test.describe("Stitch — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -338,7 +338,7 @@ test.describe("Stitch — extended", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "horizontal", gap: 0 }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -352,7 +352,7 @@ test.describe("Stitch — extended", () => { test.describe("Split — extended", () => { test("split into 1x3 columns (vertical strips)", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -368,7 +368,7 @@ test.describe("Split — extended", () => { }); test("split into 1x2 rows (horizontal strips)", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -384,7 +384,7 @@ test.describe("Split — extended", () => { }); test("split into 4x4 tiles", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -400,7 +400,7 @@ test.describe("Split — extended", () => { }); test("split JPEG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -417,7 +417,7 @@ test.describe("Split — extended", () => { test("split WebP image", async ({ request }) => { const webpSample = formatFixture("sample.webp"); - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.webp", mimeType: "image/webp", buffer: webpSample }, @@ -433,7 +433,7 @@ test.describe("Split — extended", () => { }); test("split portrait-oriented image", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.jpg", mimeType: "image/jpeg", buffer: JPG_PORTRAIT }, @@ -449,7 +449,7 @@ test.describe("Split — extended", () => { }); test("split HEIC image into tiles", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -469,7 +469,7 @@ test.describe("Split — extended", () => { test.describe("Border — extended", () => { test("border on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -484,7 +484,7 @@ test.describe("Border — extended", () => { test("border on WebP image", async ({ request }) => { const webpSample = formatFixture("sample.webp"); - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.webp", mimeType: "image/webp", buffer: webpSample }, @@ -497,7 +497,7 @@ test.describe("Border — extended", () => { }); test("very wide border (100px)", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -511,7 +511,7 @@ test.describe("Border — extended", () => { }); test("border with transparent color on PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -530,7 +530,7 @@ test.describe("Border — extended", () => { test("border on large content image", async ({ request }) => { const portrait = contentFixture("portrait-color.jpg"); - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.jpg", mimeType: "image/jpeg", buffer: portrait }, @@ -564,7 +564,7 @@ test.describe("Collage — output verification", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -598,7 +598,7 @@ test.describe("Collage — output verification", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -619,7 +619,7 @@ test.describe("Stitch — output verification", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "horizontal", gap: 0 }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -640,7 +640,7 @@ test.describe("Stitch — output verification", () => { test.describe("Border — output verification", () => { test("bordered image can be downloaded and is larger", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -661,7 +661,7 @@ test.describe("Border — output verification", () => { }); test("border with minimum size (1px)", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -707,7 +707,7 @@ test.describe("Collage -- template types", () => { }), }, ]); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -743,7 +743,7 @@ test.describe("Collage -- background colors", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -771,7 +771,7 @@ test.describe("Stitch -- alignment options", () => { }, ], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -793,7 +793,7 @@ test.describe("Stitch -- alignment options", () => { }, ], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -816,7 +816,7 @@ test.describe("Stitch -- alignment options", () => { }, ], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -830,7 +830,7 @@ test.describe("Stitch -- alignment options", () => { test.describe("Split -- grid variations", () => { test("split into 1x1 (single tile returns full image)", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -846,7 +846,7 @@ test.describe("Split -- grid variations", () => { }); test("split into 5x5 tiles", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -861,7 +861,7 @@ test.describe("Split -- grid variations", () => { }); test("split into 2x5 tiles (more rows than columns)", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -876,7 +876,7 @@ test.describe("Split -- grid variations", () => { }); test("split into 10x1 columns", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -898,7 +898,7 @@ test.describe("Border -- width and color variations", () => { for (const size of borderSizes) { test(`border with size=${size}px`, async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -916,7 +916,7 @@ test.describe("Border -- width and color variations", () => { for (const color of borderColors) { test(`border with color=${color}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -935,7 +935,7 @@ test.describe("Border -- width and color variations", () => { test.describe("Border -- dimension verification", () => { test("bordered image dimensions increase by 2x border size", async ({ request }) => { const borderSize = 20; - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -952,7 +952,7 @@ test.describe("Border -- dimension verification", () => { expect(dlRes.ok()).toBe(true); const buffer = Buffer.from(await dlRes.body()); - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "bordered.png", mimeType: "image/png", buffer: buffer }, @@ -970,7 +970,7 @@ test.describe("Border -- dimension verification", () => { test.describe("Auth failure", () => { test("split without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/split", { + const res = await request.post("/api/v1/tools/image/split", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ columns: 2, rows: 2 }), @@ -980,7 +980,7 @@ test.describe("Auth failure", () => { }); test("border without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/border", { + const res = await request.post("/api/v1/tools/image/border", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ size: 10, color: "#ff0000" }), @@ -1002,7 +1002,7 @@ test.describe("Auth failure", () => { }, ], ); - const res = await request.post("/api/v1/tools/collage", { + const res = await request.post("/api/v1/tools/image/collage", { headers: { "Content-Type": contentType }, data: body, }); @@ -1017,7 +1017,7 @@ test.describe("Auth failure", () => { ], [{ name: "settings", value: JSON.stringify({ direction: "horizontal" }) }], ); - const res = await request.post("/api/v1/tools/stitch", { + const res = await request.post("/api/v1/tools/image/stitch", { headers: { "Content-Type": contentType }, data: body, }); diff --git a/tests/e2e-docker/meme-beautify-tools.spec.ts b/tests/e2e-docker/meme-beautify-tools.spec.ts index 0cccccae..52caae6e 100644 --- a/tests/e2e-docker/meme-beautify-tools.spec.ts +++ b/tests/e2e-docker/meme-beautify-tools.spec.ts @@ -69,7 +69,7 @@ const JPG_SAMPLE = formatFixture("sample.jpg"); test.describe("Meme Generator — custom image", () => { test("meme with top-bottom text layout", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -89,7 +89,7 @@ test.describe("Meme Generator — custom image", () => { }); test("meme with top-only text", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -108,7 +108,7 @@ test.describe("Meme Generator — custom image", () => { }); test("meme with bottom-only text", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -126,7 +126,7 @@ test.describe("Meme Generator — custom image", () => { }); test("meme with center text", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -143,7 +143,7 @@ test.describe("Meme Generator — custom image", () => { }); test("meme with no text boxes passes image through", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -159,7 +159,7 @@ test.describe("Meme Generator — custom image", () => { }); test("meme with custom font and colors", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -183,7 +183,7 @@ test.describe("Meme Generator — custom image", () => { }); test("meme on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -202,7 +202,7 @@ test.describe("Meme Generator — custom image", () => { }); test("meme rejects request with no image and no template", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, data: { textLayout: "top-bottom", @@ -221,7 +221,7 @@ test.describe("Meme Generator — template mode", () => { test("meme with template ID (JSON body)", async ({ request }) => { // First, fetch the available templates to find a valid ID // Use a well-known template if available, otherwise skip - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, data: { templateId: "drake", @@ -243,7 +243,7 @@ test.describe("Meme Generator — template mode", () => { }); test("meme with invalid template ID returns error", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, data: { templateId: "nonexistent-template-99999", @@ -260,7 +260,7 @@ test.describe("Meme Generator — template mode", () => { test.describe("Beautify — basic", () => { test("beautify with default settings", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -274,7 +274,7 @@ test.describe("Beautify — basic", () => { }); test("beautify with solid background", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -293,7 +293,7 @@ test.describe("Beautify — basic", () => { }); test("beautify with transparent background", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -311,7 +311,7 @@ test.describe("Beautify — basic", () => { }); test("beautify with linear gradient background", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -332,7 +332,7 @@ test.describe("Beautify — basic", () => { }); test("beautify with radial gradient background", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -356,7 +356,7 @@ test.describe("Beautify — basic", () => { test.describe("Beautify — shadows", () => { test("beautify with subtle shadow", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -372,7 +372,7 @@ test.describe("Beautify — shadows", () => { }); test("beautify with dramatic shadow", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -388,7 +388,7 @@ test.describe("Beautify — shadows", () => { }); test("beautify with no shadow", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -408,7 +408,7 @@ test.describe("Beautify — shadows", () => { test.describe("Beautify — frames", () => { test("beautify with macOS light frame", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -425,7 +425,7 @@ test.describe("Beautify — frames", () => { }); test("beautify with macOS dark frame", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -444,7 +444,7 @@ test.describe("Beautify — frames", () => { }); test("beautify with browser light frame", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -461,7 +461,7 @@ test.describe("Beautify — frames", () => { }); test("beautify with no frame", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -482,7 +482,7 @@ test.describe("Beautify — frames", () => { test.describe("Beautify — social presets", () => { test("beautify for Twitter", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -498,7 +498,7 @@ test.describe("Beautify — social presets", () => { }); test("beautify for Instagram square", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -516,7 +516,7 @@ test.describe("Beautify — social presets", () => { }); test("beautify for LinkedIn", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -536,7 +536,7 @@ test.describe("Beautify — social presets", () => { test.describe("Beautify — watermark", () => { test("beautify with watermark text", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -554,7 +554,7 @@ test.describe("Beautify — watermark", () => { }); test("beautify with center watermark", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -576,7 +576,7 @@ test.describe("Beautify — watermark", () => { test.describe("Beautify — output formats", () => { test("beautify with JPEG output", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -597,7 +597,7 @@ test.describe("Beautify — output formats", () => { }); test("beautify with WebP output", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -613,7 +613,7 @@ test.describe("Beautify — output formats", () => { }); test("beautify HEIC input image", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -654,7 +654,7 @@ test.describe("Beautify — background image", () => { }, ], ); - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -669,7 +669,7 @@ test.describe("Beautify — background image", () => { test.describe("Beautify — validation", () => { test("beautify rejects request with no file", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { settings: JSON.stringify({ padding: 32 }), @@ -685,7 +685,7 @@ test.describe("Beautify — validation", () => { test.describe("Auth failure", () => { test("meme-generator without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, settings: JSON.stringify({ @@ -698,7 +698,7 @@ test.describe("Auth failure", () => { }); test("beautify without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({}), diff --git a/tests/e2e-docker/optimization-tools.spec.ts b/tests/e2e-docker/optimization-tools.spec.ts index 291439b4..a82fff9f 100644 --- a/tests/e2e-docker/optimization-tools.spec.ts +++ b/tests/e2e-docker/optimization-tools.spec.ts @@ -77,7 +77,7 @@ const JPG_SAMPLE = formatFixture("sample.jpg"); test.describe("Optimize for Web — extended", () => { test("optimize with aggressive quality (20)", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -91,7 +91,7 @@ test.describe("Optimize for Web — extended", () => { }); test("optimize with high quality (95) preserves detail", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -105,7 +105,7 @@ test.describe("Optimize for Web — extended", () => { }); test("optimize HEIC for web", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -119,7 +119,7 @@ test.describe("Optimize for Web — extended", () => { test("optimize WebP for web", async ({ request }) => { const webpSample = formatFixture("sample.webp"); - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.webp", mimeType: "image/webp", buffer: webpSample }, @@ -133,7 +133,7 @@ test.describe("Optimize for Web — extended", () => { }); test("optimize without maxWidth (no resize, only compress)", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -147,7 +147,7 @@ test.describe("Optimize for Web — extended", () => { test("optimize large content image for web", async ({ request }) => { const stressImg = contentFixture("stress-large.jpg"); - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stress-large.jpg", mimeType: "image/jpeg", buffer: stressImg }, @@ -173,7 +173,7 @@ test.describe("Bulk Rename — extended", () => { ], [{ name: "settings", value: JSON.stringify({ pattern: "2024-01-{{index}}" }) }], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -201,7 +201,7 @@ test.describe("Bulk Rename — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -229,7 +229,7 @@ test.describe("Bulk Rename — extended", () => { ], [{ name: "settings", value: JSON.stringify({ pattern: "gallery-{{index}}" }) }], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -241,7 +241,7 @@ test.describe("Bulk Rename — extended", () => { test.describe("Favicon — extended", () => { test("generate favicon from WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -260,7 +260,7 @@ test.describe("Favicon — extended", () => { }); test("generate favicon from HEIC", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -271,7 +271,7 @@ test.describe("Favicon — extended", () => { }); test("generate favicon from large sample JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -291,7 +291,7 @@ test.describe("Favicon — extended", () => { test("generate favicon from AVIF format", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -314,7 +314,7 @@ test.describe("Image to PDF — extended", () => { ], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -329,7 +329,7 @@ test.describe("Image to PDF — extended", () => { [{ name: "file", filename: "test.jpg", contentType: "image/jpeg", buffer: JPG_100x100 }], [{ name: "settings", value: JSON.stringify({ pageSize: "Letter" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -344,7 +344,7 @@ test.describe("Image to PDF — extended", () => { [{ name: "file", filename: "test.heic", contentType: "image/heic", buffer: HEIC_200x150 }], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -370,7 +370,7 @@ test.describe("Image to PDF — extended", () => { ], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -385,7 +385,7 @@ test.describe("Image to PDF — extended", () => { test.describe("Replace Color — extended", () => { test("replace color on WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -403,7 +403,7 @@ test.describe("Replace Color — extended", () => { }); test("replace color with zero tolerance (exact match)", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -420,7 +420,7 @@ test.describe("Replace Color — extended", () => { }); test("replace color with maximum tolerance (100)", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -437,7 +437,7 @@ test.describe("Replace Color — extended", () => { }); test("replace color on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -455,7 +455,7 @@ test.describe("Replace Color — extended", () => { test("replace color on content image", async ({ request }) => { const portrait = contentFixture("portrait-color.jpg"); - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.jpg", mimeType: "image/jpeg", buffer: portrait }, @@ -477,7 +477,7 @@ test.describe("Replace Color — extended", () => { test.describe("Edit Metadata — extended", () => { test("set all EXIF fields at once", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -496,7 +496,7 @@ test.describe("Edit Metadata — extended", () => { }); test("edit metadata on WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/edit-metadata", { + const res = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -510,7 +510,7 @@ test.describe("Edit Metadata — extended", () => { test("edit metadata round-trip verification", async ({ request }) => { // Set metadata - const editRes = await request.post("/api/v1/tools/edit-metadata", { + const editRes = await request.post("/api/v1/tools/image/edit-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -528,7 +528,7 @@ test.describe("Edit Metadata — extended", () => { const editedBuffer = Buffer.from(await dlRes.body()); // Check info on the edited image - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "edited.jpg", mimeType: "image/jpeg", buffer: editedBuffer }, @@ -545,7 +545,7 @@ test.describe("Edit Metadata — extended", () => { test.describe("Strip Metadata — extended", () => { test("strip metadata from JPEG with EXIF preserves dimensions", async ({ request }) => { const jpgExif = fixture("test-with-exif.jpg"); - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: jpgExif }, @@ -560,7 +560,7 @@ test.describe("Strip Metadata — extended", () => { }); test("strip metadata from WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -573,7 +573,7 @@ test.describe("Strip Metadata — extended", () => { }); test("strip metadata from HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/strip-metadata", { + const res = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -587,7 +587,7 @@ test.describe("Strip Metadata — extended", () => { test("stripped image verified via info has no EXIF", async ({ request }) => { const jpgExif = fixture("test-with-exif.jpg"); - const stripRes = await request.post("/api/v1/tools/strip-metadata", { + const stripRes = await request.post("/api/v1/tools/image/strip-metadata", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: jpgExif }, @@ -605,7 +605,7 @@ test.describe("Strip Metadata — extended", () => { const strippedBuffer = Buffer.from(await dlRes.body()); // Verify via info tool - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stripped.jpg", mimeType: "image/jpeg", buffer: strippedBuffer }, @@ -621,7 +621,7 @@ test.describe("Strip Metadata — extended", () => { test.describe("Image Enhancement — extended", () => { test("enhancement with auto preset", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -635,7 +635,7 @@ test.describe("Image Enhancement — extended", () => { }); test("enhancement with vivid preset", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -650,7 +650,7 @@ test.describe("Image Enhancement — extended", () => { }); test("enhancement on WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -663,7 +663,7 @@ test.describe("Image Enhancement — extended", () => { }); test("enhancement on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -680,7 +680,7 @@ test.describe("Image Enhancement — extended", () => { test.describe("Content-Aware Resize — extended", () => { test("content-aware resize to smaller width", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -699,7 +699,7 @@ test.describe("Content-Aware Resize — extended", () => { }); test("content-aware resize JPEG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -717,7 +717,7 @@ test.describe("Content-Aware Resize — extended", () => { }); test("content-aware resize on large content image", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -739,7 +739,7 @@ test.describe("Content-Aware Resize — extended", () => { test.describe("Content-Aware Resize — HEIC & edge cases", () => { test("content-aware resize HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -757,7 +757,7 @@ test.describe("Content-Aware Resize — HEIC & edge cases", () => { }); test("content-aware resize WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -779,7 +779,7 @@ test.describe("Content-Aware Resize — HEIC & edge cases", () => { test.describe("Optimize for Web — output verification", () => { test("optimized file can be downloaded and is valid", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -805,7 +805,7 @@ test.describe("Optimize for Web — output verification", () => { test.describe("Favicon — output verification", () => { test("favicon output can be downloaded", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -832,7 +832,7 @@ test.describe("Favicon — output verification", () => { test("favicon from TIFF format", async ({ request }) => { const tiff = formatFixture("sample.tiff"); - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -847,7 +847,7 @@ test.describe("Favicon — output verification", () => { test.describe("Optimize for Web -- target format", () => { test("optimize with target format WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -861,7 +861,7 @@ test.describe("Optimize for Web -- target format", () => { }); test("optimize with target format AVIF", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -874,7 +874,7 @@ test.describe("Optimize for Web -- target format", () => { }); test("optimize preserves original format when no target specified", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -891,7 +891,7 @@ test.describe("Optimize for Web -- target format", () => { test.describe("Optimize for Web -- constraints", () => { test("optimize with maxWidth only (no quality)", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -905,7 +905,7 @@ test.describe("Optimize for Web -- constraints", () => { }); test("optimize with quality only (no resize)", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -919,7 +919,7 @@ test.describe("Optimize for Web -- constraints", () => { }); test("optimize with very small maxWidth", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -937,7 +937,7 @@ test.describe("Optimize for Web -- constraints", () => { test.describe("Favicon -- multi-size", () => { test("favicon from PNG generates downloadable output", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -964,7 +964,7 @@ test.describe("Favicon -- multi-size", () => { }); test("favicon from JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -976,7 +976,7 @@ test.describe("Favicon -- multi-size", () => { test("favicon from PNG content image", async ({ request }) => { const portrait = contentFixture("portrait-isolated.png"); - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.png", mimeType: "image/png", buffer: portrait }, @@ -988,7 +988,7 @@ test.describe("Favicon -- multi-size", () => { test("favicon from GIF format", async ({ request }) => { const gif = formatFixture("sample.gif"); - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.gif", mimeType: "image/gif", buffer: gif }, @@ -1006,7 +1006,7 @@ test.describe("Replace Color -- tolerance levels", () => { for (const tolerance of tolerances) { test(`replace color with tolerance=${tolerance}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1029,7 +1029,7 @@ test.describe("Replace Color -- tolerance levels", () => { test.describe("Replace Color -- download verification", () => { test("replaced-color image is downloadable and valid", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1076,7 +1076,7 @@ test.describe("Bulk Rename -- ZIP output", () => { ], [{ name: "settings", value: JSON.stringify({ pattern: "photo-{{index}}", startIndex: 1 }) }], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1116,7 +1116,7 @@ test.describe("Bulk Rename -- ZIP output", () => { }, ], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1131,7 +1131,7 @@ test.describe("Image Enhancement -- presets", () => { for (const preset of presets) { test(`enhancement with preset=${preset}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/image-enhancement", { + const res = await request.post("/api/v1/tools/image/image-enhancement", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -1150,7 +1150,7 @@ test.describe("Image Enhancement -- presets", () => { test.describe("Auth failure", () => { test("optimize-for-web without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, settings: JSON.stringify({ maxWidth: 800, quality: 75 }), @@ -1160,7 +1160,7 @@ test.describe("Auth failure", () => { }); test("favicon without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/favicon", { + const res = await request.post("/api/v1/tools/image/favicon", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({}), @@ -1170,7 +1170,7 @@ test.describe("Auth failure", () => { }); test("replace-color without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/replace-color", { + const res = await request.post("/api/v1/tools/image/replace-color", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ @@ -1188,7 +1188,7 @@ test.describe("Auth failure", () => { [{ name: "file", filename: "test.jpg", contentType: "image/jpeg", buffer: JPG_100x100 }], [{ name: "settings", value: JSON.stringify({ pageSize: "A4" }) }], ); - const res = await request.post("/api/v1/tools/image-to-pdf", { + const res = await request.post("/api/v1/tools/image/image-to-pdf", { headers: { "Content-Type": contentType }, data: reqBody, }); @@ -1196,7 +1196,7 @@ test.describe("Auth failure", () => { }); test("content-aware-resize without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/content-aware-resize", { + const res = await request.post("/api/v1/tools/image/content-aware-resize", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ width: 100, height: 100 }), diff --git a/tests/e2e-docker/pipeline-extended.spec.ts b/tests/e2e-docker/pipeline-extended.spec.ts index 1bf49298..10163616 100644 --- a/tests/e2e-docker/pipeline-extended.spec.ts +++ b/tests/e2e-docker/pipeline-extended.spec.ts @@ -465,7 +465,7 @@ test.describe("Pipeline output verification", () => { expect(buffer.length).toBeGreaterThan(0); // Verify dimensions via info - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "pipeline-output.png", mimeType: "image/png", buffer: buffer }, diff --git a/tests/e2e-docker/pipeline-tools.spec.ts b/tests/e2e-docker/pipeline-tools.spec.ts index 8b8c5ee2..5b54cbb5 100644 --- a/tests/e2e-docker/pipeline-tools.spec.ts +++ b/tests/e2e-docker/pipeline-tools.spec.ts @@ -811,7 +811,7 @@ test.describe("Pipeline output verification", () => { const buffer = Buffer.from(await dlRes.body()); // Verify dimensions via info - const infoRes = await request.post("/api/v1/tools/info", { + const infoRes = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "output.png", mimeType: "image/png", buffer: buffer }, diff --git a/tests/e2e-docker/playwright-gpu-test.mjs b/tests/e2e-docker/playwright-gpu-test.mjs index f7bf868b..8095b1e1 100644 --- a/tests/e2e-docker/playwright-gpu-test.mjs +++ b/tests/e2e-docker/playwright-gpu-test.mjs @@ -108,7 +108,9 @@ async function main() { formData.append("file", new File([imageBlob], "test.webp", { type: "image/webp" })); formData.append("settings", JSON.stringify(tool.settings)); - const res = await fetch(`${BASE}/api/v1/tools/${tool.path}`, { + // All GPU tools are image-modality; section prefix hardcoded + // (cannot import apiToolPath from @snapotter/shared in plain .mjs). + const res = await fetch(`${BASE}/api/v1/tools/image/${tool.path}`, { method: "POST", headers: { Authorization: `Bearer ${token}` }, body: formData, diff --git a/tests/e2e-docker/tool-edge-cases.spec.ts b/tests/e2e-docker/tool-edge-cases.spec.ts index 4697db47..b95a521f 100644 --- a/tests/e2e-docker/tool-edge-cases.spec.ts +++ b/tests/e2e-docker/tool-edge-cases.spec.ts @@ -73,7 +73,7 @@ const JPG_SAMPLE = formatFixture("sample.jpg"); test.describe("Resize edge cases", () => { test("resize with fit=outside", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -86,7 +86,7 @@ test.describe("Resize edge cases", () => { }); test("resize to very large dimensions (4096)", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -100,7 +100,7 @@ test.describe("Resize edge cases", () => { }); test("resize 1x1 image with withoutEnlargement=false", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -118,7 +118,7 @@ test.describe("Resize edge cases", () => { }); test("resize JPEG with explicit height only and fill", async ({ request }) => { - const res = await request.post("/api/v1/tools/resize", { + const res = await request.post("/api/v1/tools/image/resize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -135,7 +135,7 @@ test.describe("Resize edge cases", () => { test.describe("Rotate edge cases", () => { test("rotate 360 degrees returns same image", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -148,7 +148,7 @@ test.describe("Rotate edge cases", () => { }); test("rotate negative angle (-90)", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -166,7 +166,7 @@ test.describe("Rotate edge cases", () => { }); test("rotate 1 degree with transparent background", async ({ request }) => { - const res = await request.post("/api/v1/tools/rotate", { + const res = await request.post("/api/v1/tools/image/rotate", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -188,7 +188,7 @@ test.describe("Rotate edge cases", () => { test.describe("Convert quality extremes", () => { test("convert to JPEG with quality 1 (minimum)", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -202,7 +202,7 @@ test.describe("Convert quality extremes", () => { }); test("convert to JPEG with quality 100 (maximum)", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -215,7 +215,7 @@ test.describe("Convert quality extremes", () => { }); test("convert to WebP with quality 1", async ({ request }) => { - const res = await request.post("/api/v1/tools/convert", { + const res = await request.post("/api/v1/tools/image/convert", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -232,7 +232,7 @@ test.describe("Convert quality extremes", () => { test.describe("Color adjustments extreme values", () => { test("maximum positive brightness (100)", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -245,7 +245,7 @@ test.describe("Color adjustments extreme values", () => { }); test("maximum negative brightness (-100)", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -258,7 +258,7 @@ test.describe("Color adjustments extreme values", () => { }); test("all adjustments at extreme values together", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -276,7 +276,7 @@ test.describe("Color adjustments extreme values", () => { }); test("hue rotation 360 degrees (full cycle)", async ({ request }) => { - const res = await request.post("/api/v1/tools/adjust-colors", { + const res = await request.post("/api/v1/tools/image/adjust-colors", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -293,7 +293,7 @@ test.describe("Color adjustments extreme values", () => { test.describe("Sharpening sigma edge values", () => { test("sharpen with very low sigma (0.1)", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -306,7 +306,7 @@ test.describe("Sharpening sigma edge values", () => { }); test("sharpen with very high sigma (5.0)", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -319,7 +319,7 @@ test.describe("Sharpening sigma edge values", () => { }); test("sharpen with sigma and amount together", async ({ request }) => { - const res = await request.post("/api/v1/tools/sharpening", { + const res = await request.post("/api/v1/tools/image/sharpening", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -336,7 +336,7 @@ test.describe("Sharpening sigma edge values", () => { test.describe("Beautify combined settings", () => { test("beautify with all options: frame, shadow, gradient, watermark", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -366,7 +366,7 @@ test.describe("Beautify combined settings", () => { }); test("beautify with zero padding", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -383,7 +383,7 @@ test.describe("Beautify combined settings", () => { }); test("beautify with very large padding (200)", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -400,7 +400,7 @@ test.describe("Beautify combined settings", () => { }); test("beautify with large border radius (50)", async ({ request }) => { - const res = await request.post("/api/v1/tools/beautify", { + const res = await request.post("/api/v1/tools/image/beautify", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -421,7 +421,7 @@ test.describe("Beautify combined settings", () => { test.describe("Meme generator variations", () => { test("meme with very long text", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -440,7 +440,7 @@ test.describe("Meme generator variations", () => { }); test("meme with unicode/emoji text", async ({ request }) => { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -462,7 +462,7 @@ test.describe("Meme generator variations", () => { test("meme with text alignment variations", async ({ request }) => { const alignments = ["left", "center", "right"] as const; for (const textAlign of alignments) { - const res = await request.post("/api/v1/tools/meme-generator", { + const res = await request.post("/api/v1/tools/image/meme-generator", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -487,7 +487,7 @@ test.describe("Meme generator variations", () => { test.describe("Vectorize additional settings", () => { test("vectorize small WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -501,7 +501,7 @@ test.describe("Vectorize additional settings", () => { }); test("vectorize HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -515,7 +515,7 @@ test.describe("Vectorize additional settings", () => { test("vectorize content image", async ({ request }) => { const portrait = contentFixture("portrait-isolated.png"); - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.png", mimeType: "image/png", buffer: portrait }, @@ -528,7 +528,7 @@ test.describe("Vectorize additional settings", () => { }); test("vectorize output can be downloaded", async ({ request }) => { - const res = await request.post("/api/v1/tools/vectorize", { + const res = await request.post("/api/v1/tools/image/vectorize", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -556,7 +556,7 @@ test.describe("Vectorize additional settings", () => { test.describe("Image to Base64 edge cases", () => { test("encode 1x1 PNG to base64", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -571,7 +571,7 @@ test.describe("Image to Base64 edge cases", () => { }); test("encode HEIC to base64 with format conversion to WebP", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -585,7 +585,7 @@ test.describe("Image to Base64 edge cases", () => { }); test("encode with both maxWidth and outputFormat", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -606,7 +606,7 @@ test.describe("Text overlay position coverage", () => { for (const position of positions) { test(`text overlay at position=${position}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -626,7 +626,7 @@ test.describe("Text overlay position coverage", () => { } test("text overlay with background box on HEIC", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -647,7 +647,7 @@ test.describe("Text overlay position coverage", () => { test("text overlay on AVIF image", async ({ request }) => { const avif = formatFixture("sample.avif"); - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -671,7 +671,7 @@ test.describe("Watermark text extended positions", () => { test("watermark at all 4 corners on same image", async ({ request }) => { const positions = ["top-left", "top-right", "bottom-left", "bottom-right"] as const; for (const position of positions) { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -692,7 +692,7 @@ test.describe("Watermark text extended positions", () => { test("tiled watermark with rotation on large image", async ({ request }) => { const stressImg = contentFixture("stress-large.jpg"); - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "stress.jpg", mimeType: "image/jpeg", buffer: stressImg }, @@ -718,7 +718,7 @@ test.describe("Watermark text extended positions", () => { test.describe("QR generate edge cases", () => { test("generate QR with very long URL", async ({ request }) => { const longUrl = `https://example.com/path/${"a".repeat(200)}?key=value`; - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: longUrl, size: 512, errorCorrection: "H" }, }); @@ -728,7 +728,7 @@ test.describe("QR generate edge cases", () => { }); test("generate QR with unicode text", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "Hello World 12345", size: 400 }, }); @@ -738,7 +738,7 @@ test.describe("QR generate edge cases", () => { }); test("generate QR with custom dark/light colors", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "custom colors", @@ -765,7 +765,7 @@ test.describe("Compare edge cases", () => { ], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -784,7 +784,7 @@ test.describe("Compare edge cases", () => { ], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -798,7 +798,7 @@ test.describe("Compare edge cases", () => { test.describe("Optimize for Web edge cases", () => { test("optimize 1x1 image", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_1x1 }, @@ -811,7 +811,7 @@ test.describe("Optimize for Web edge cases", () => { }); test("optimize with maxWidth smaller than image", async ({ request }) => { - const res = await request.post("/api/v1/tools/optimize-for-web", { + const res = await request.post("/api/v1/tools/image/optimize-for-web", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -840,7 +840,7 @@ test.describe("Invalid request handling", () => { }); test("crop with out-of-bounds region returns error", async ({ request }) => { - const res = await request.post("/api/v1/tools/crop", { + const res = await request.post("/api/v1/tools/image/crop", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, diff --git a/tests/e2e-docker/utility-tools.spec.ts b/tests/e2e-docker/utility-tools.spec.ts index a678380d..920af281 100644 --- a/tests/e2e-docker/utility-tools.spec.ts +++ b/tests/e2e-docker/utility-tools.spec.ts @@ -77,7 +77,7 @@ const WEBP_50x50 = fixture("test-50x50.webp"); test.describe("Info", () => { test("returns metadata for PNG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -97,7 +97,7 @@ test.describe("Info", () => { }); test("returns metadata for JPEG image", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -112,7 +112,7 @@ test.describe("Info", () => { }); test("returns EXIF info for JPEG with metadata", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test-with-exif.jpg", mimeType: "image/jpeg", buffer: JPG_WITH_EXIF }, @@ -126,7 +126,7 @@ test.describe("Info", () => { }); test("returns metadata for HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -141,7 +141,7 @@ test.describe("Info", () => { }); test("returns histogram data", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -162,7 +162,7 @@ test.describe("Info", () => { }); test("returns metadata for WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -178,7 +178,7 @@ test.describe("Info", () => { test("returns metadata for BMP from formats fixture", async ({ request }) => { const bmp = formatFixture("sample.bmp"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.bmp", mimeType: "image/bmp", buffer: bmp }, @@ -195,7 +195,7 @@ test.describe("Info", () => { }); test("rejects request with no file", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: {}, }); @@ -214,7 +214,7 @@ test.describe("Compare", () => { ], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -233,7 +233,7 @@ test.describe("Compare", () => { ], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -250,7 +250,7 @@ test.describe("Compare", () => { [{ name: "file", filename: "a.png", contentType: "image/png", buffer: PNG_200x150 }], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -272,7 +272,7 @@ test.describe("Find Duplicates", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -299,7 +299,7 @@ test.describe("Find Duplicates", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -319,7 +319,7 @@ test.describe("Find Duplicates", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -336,7 +336,7 @@ test.describe("Find Duplicates", () => { test.describe("Color Palette", () => { test("extract colors from PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -357,7 +357,7 @@ test.describe("Color Palette", () => { }); test("extract colors from JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -372,7 +372,7 @@ test.describe("Color Palette", () => { test("extract colors from sample JPEG has diverse palette", async ({ request }) => { const sample = formatFixture("sample.jpg"); - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: sample }, @@ -386,7 +386,7 @@ test.describe("Color Palette", () => { }); test("extract colors from HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -402,7 +402,7 @@ test.describe("Color Palette", () => { test.describe("QR Generate", () => { test("generate QR code from URL", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "https://snapotter.app", @@ -416,7 +416,7 @@ test.describe("QR Generate", () => { }); test("generate QR code with custom colors", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "Hello World", @@ -431,7 +431,7 @@ test.describe("QR Generate", () => { }); test("generate QR code with high error correction", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "https://github.com/snapotter/snapotter", @@ -445,7 +445,7 @@ test.describe("QR Generate", () => { }); test("generate QR code with minimum size", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "test", @@ -458,7 +458,7 @@ test.describe("QR Generate", () => { }); test("reject empty text", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "", @@ -471,7 +471,7 @@ test.describe("QR Generate", () => { }); test("reject size below minimum", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "test", @@ -487,7 +487,7 @@ test.describe("QR Generate", () => { test.describe("Barcode Read", () => { test("read QR code from generated image (round-trip)", async ({ request }) => { // Generate a QR code first, then read it back - const genRes = await request.post("/api/v1/tools/qr-generate", { + const genRes = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "https://example.com/test", size: 400 }, }); @@ -502,7 +502,7 @@ test.describe("Barcode Read", () => { const qrBuffer = Buffer.from(await dlRes.body()); // Now read it with barcode-read - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "qr.png", mimeType: "image/png", buffer: qrBuffer }, @@ -521,7 +521,7 @@ test.describe("Barcode Read", () => { test("read barcode from barcode fixture", async ({ request }) => { const barcodeImage = contentFixture("barcode.avif"); - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "barcode.avif", mimeType: "image/avif", buffer: barcodeImage }, @@ -540,7 +540,7 @@ test.describe("Barcode Read", () => { }); test("return empty array for image with no barcodes", async ({ request }) => { - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -557,7 +557,7 @@ test.describe("Barcode Read", () => { test("annotated image URL returned when barcodes found", async ({ request }) => { const qrImage = contentFixture("qr-code.avif"); - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "qr-code.avif", mimeType: "image/avif", buffer: qrImage }, @@ -591,7 +591,7 @@ test.describe("Bulk Rename", () => { ], [{ name: "settings", value: JSON.stringify({ pattern: "image-{{index}}" }) }], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -623,7 +623,7 @@ test.describe("Bulk Rename", () => { }, ], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -635,7 +635,7 @@ test.describe("Bulk Rename", () => { [], [{ name: "settings", value: JSON.stringify({ pattern: "test-{{index}}" }) }], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -649,7 +649,7 @@ test.describe("Bulk Rename", () => { test.describe("Image to Base64", () => { test("encode PNG to base64 returns data URI", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -670,7 +670,7 @@ test.describe("Image to Base64", () => { }); test("encode JPEG to base64", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -684,7 +684,7 @@ test.describe("Image to Base64", () => { }); test("encode with maxWidth constraint", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -697,7 +697,7 @@ test.describe("Image to Base64", () => { }); test("encode with output format conversion", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -710,7 +710,7 @@ test.describe("Image to Base64", () => { }); test("encode HEIC image to base64", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -724,7 +724,7 @@ test.describe("Image to Base64", () => { }); test("overhead percent is calculated", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -743,7 +743,7 @@ test.describe("Image to Base64", () => { test.describe("QR Read", () => { test("read QR code from content fixture", async ({ request }) => { const qrImage = contentFixture("qr-code.avif"); - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "qr-code.avif", mimeType: "image/avif", buffer: qrImage }, @@ -770,7 +770,7 @@ test.describe("Compare — additional", () => { ], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -789,7 +789,7 @@ test.describe("Compare — additional", () => { ], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -813,7 +813,7 @@ test.describe("Find Duplicates — additional", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -833,7 +833,7 @@ test.describe("Find Duplicates — additional", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -847,7 +847,7 @@ test.describe("Find Duplicates — additional", () => { test.describe("QR Generate — output verification", () => { test("QR code image can be downloaded", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: "https://test.snapotter.app/verify", @@ -870,7 +870,7 @@ test.describe("QR Generate — output verification", () => { test("QR code with all error correction levels", async ({ request }) => { const levels = ["L", "M", "Q", "H"] as const; for (const errorCorrection of levels) { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: `EC-${errorCorrection}`, @@ -889,7 +889,7 @@ test.describe("QR Generate — output verification", () => { test.describe("Color Palette — additional", () => { test("extract colors from WebP image", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -903,7 +903,7 @@ test.describe("Color Palette — additional", () => { test("color palette on content image has rich palette", async ({ request }) => { const portrait = contentFixture("portrait-color.jpg"); - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.jpg", mimeType: "image/jpeg", buffer: portrait }, @@ -935,7 +935,7 @@ test.describe("Find Duplicates -- large set", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -966,7 +966,7 @@ test.describe("Find Duplicates -- large set", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -991,7 +991,7 @@ test.describe("Find Duplicates -- large set", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -1009,7 +1009,7 @@ test.describe("Find Duplicates -- large set", () => { test.describe("Color Palette -- count variations", () => { test("extract palette from monochrome-like image", async ({ request }) => { const portraitBw = contentFixture("portrait-bw.jpeg"); - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "bw.jpeg", mimeType: "image/jpeg", buffer: portraitBw }, @@ -1026,7 +1026,7 @@ test.describe("Color Palette -- count variations", () => { test("extract palette from colorful content image", async ({ request }) => { const portrait = contentFixture("portrait-color.jpg"); - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "colorful.jpg", mimeType: "image/jpeg", buffer: portrait }, @@ -1041,7 +1041,7 @@ test.describe("Color Palette -- count variations", () => { test("extract palette from large stress image", async ({ request }) => { const large = contentFixture("stress-large.jpg"); - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "large.jpg", mimeType: "image/jpeg", buffer: large }, @@ -1063,7 +1063,7 @@ test.describe("QR Generate -- EC levels round-trip", () => { for (const ec of ecLevels) { test(`generate QR with EC=${ec} and verify via barcode-read`, async ({ request }) => { const testText = `EC-${ec}-round-trip`; - const genRes = await request.post("/api/v1/tools/qr-generate", { + const genRes = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: testText, size: 400, errorCorrection: ec }, }); @@ -1080,7 +1080,7 @@ test.describe("QR Generate -- EC levels round-trip", () => { expect(qrBuffer.length).toBeGreaterThan(0); // Read it back - const readRes = await request.post("/api/v1/tools/barcode-read", { + const readRes = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "qr.png", mimeType: "image/png", buffer: qrBuffer }, @@ -1103,7 +1103,7 @@ test.describe("QR Generate -- size variations", () => { for (const size of sizes) { test(`generate QR code at size=${size}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { headers: { Authorization: `Bearer ${token}` }, data: { text: `size-${size}`, size }, }); @@ -1119,7 +1119,7 @@ test.describe("QR Generate -- size variations", () => { test.describe("Barcode Read -- no barcode scenarios", () => { test("return empty for WebP with no barcode", async ({ request }) => { - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.webp", mimeType: "image/webp", buffer: WEBP_50x50 }, @@ -1133,7 +1133,7 @@ test.describe("Barcode Read -- no barcode scenarios", () => { }); test("return empty for HEIC with no barcode", async ({ request }) => { - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -1151,7 +1151,7 @@ test.describe("Barcode Read -- no barcode scenarios", () => { test.describe("Image to Base64 -- data URI verification", () => { test("data URI starts with correct MIME prefix for PNG", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1169,7 +1169,7 @@ test.describe("Image to Base64 -- data URI verification", () => { }); test("data URI starts with correct MIME prefix for JPEG", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.jpg", mimeType: "image/jpeg", buffer: JPG_100x100 }, @@ -1184,7 +1184,7 @@ test.describe("Image to Base64 -- data URI verification", () => { }); test("data URI with format conversion has correct prefix", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1199,7 +1199,7 @@ test.describe("Image to Base64 -- data URI verification", () => { }); test("base64 output with maxWidth and maxHeight", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -1227,7 +1227,7 @@ test.describe("Bulk Rename -- ZIP verification", () => { ], [{ name: "settings", value: JSON.stringify({ pattern: "renamed-{{index}}" }) }], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1268,7 +1268,7 @@ test.describe("Bulk Rename -- ZIP verification", () => { }, ], ); - const res = await request.post("/api/v1/tools/bulk-rename", { + const res = await request.post("/api/v1/tools/image/bulk-rename", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: reqBody, }); @@ -1281,7 +1281,7 @@ test.describe("Bulk Rename -- ZIP verification", () => { test.describe("Info -- detailed metadata", () => { test("info returns density and color space for JPEG", async ({ request }) => { const sample = contentFixture("portrait-color.jpg"); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "portrait.jpg", mimeType: "image/jpeg", buffer: sample }, @@ -1299,7 +1299,7 @@ test.describe("Info -- detailed metadata", () => { test("info returns correct format for AVIF", async ({ request }) => { const avif = readFileSync(join(FORMATS, "sample.avif")); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.avif", mimeType: "image/avif", buffer: avif }, @@ -1313,7 +1313,7 @@ test.describe("Info -- detailed metadata", () => { test("info returns correct format for TIFF", async ({ request }) => { const tiff = readFileSync(join(FORMATS, "sample.tiff")); - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.tiff", mimeType: "image/tiff", buffer: tiff }, @@ -1331,7 +1331,7 @@ test.describe("Info -- detailed metadata", () => { test.describe("Auth failure", () => { test("info without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/info", { + const res = await request.post("/api/v1/tools/image/info", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, }, @@ -1340,14 +1340,14 @@ test.describe("Auth failure", () => { }); test("qr-generate without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/qr-generate", { + const res = await request.post("/api/v1/tools/image/qr-generate", { data: { text: "https://snapotter.app", size: 512 }, }); expect(res.status()).toBe(401); }); test("color-palette without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/color-palette", { + const res = await request.post("/api/v1/tools/image/color-palette", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, }, @@ -1363,7 +1363,7 @@ test.describe("Auth failure", () => { ], [], ); - const res = await request.post("/api/v1/tools/compare", { + const res = await request.post("/api/v1/tools/image/compare", { headers: { "Content-Type": contentType }, data: body, }); @@ -1378,7 +1378,7 @@ test.describe("Auth failure", () => { ], [], ); - const res = await request.post("/api/v1/tools/find-duplicates", { + const res = await request.post("/api/v1/tools/image/find-duplicates", { headers: { "Content-Type": contentType }, data: body, }); @@ -1386,7 +1386,7 @@ test.describe("Auth failure", () => { }); test("barcode-read without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/barcode-read", { + const res = await request.post("/api/v1/tools/image/barcode-read", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({}), @@ -1396,7 +1396,7 @@ test.describe("Auth failure", () => { }); test("image-to-base64 without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/image-to-base64", { + const res = await request.post("/api/v1/tools/image/image-to-base64", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({}), diff --git a/tests/e2e-docker/watermark-overlay-tools.spec.ts b/tests/e2e-docker/watermark-overlay-tools.spec.ts index b38f2e55..30104981 100644 --- a/tests/e2e-docker/watermark-overlay-tools.spec.ts +++ b/tests/e2e-docker/watermark-overlay-tools.spec.ts @@ -75,7 +75,7 @@ const JPG_SAMPLE = formatFixture("sample.jpg"); test.describe("Watermark Text — extended", () => { test("watermark with large font on high-res image", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -95,7 +95,7 @@ test.describe("Watermark Text — extended", () => { }); test("watermark with small font and low opacity", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -114,7 +114,7 @@ test.describe("Watermark Text — extended", () => { }); test("watermark on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -134,7 +134,7 @@ test.describe("Watermark Text — extended", () => { test("watermark on WebP image", async ({ request }) => { const webpSample = formatFixture("sample.webp"); - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.webp", mimeType: "image/webp", buffer: webpSample }, @@ -153,7 +153,7 @@ test.describe("Watermark Text — extended", () => { }); test("tiled watermark with rotation", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -173,7 +173,7 @@ test.describe("Watermark Text — extended", () => { }); test("watermark with full opacity (100)", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -208,7 +208,7 @@ test.describe("Watermark Image — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -236,7 +236,7 @@ test.describe("Watermark Image — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -263,7 +263,7 @@ test.describe("Watermark Image — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -290,7 +290,7 @@ test.describe("Watermark Image — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -318,7 +318,7 @@ test.describe("Watermark Image — extended", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -332,7 +332,7 @@ test.describe("Watermark Image — extended", () => { test.describe("Text Overlay — extended", () => { test("text overlay on HEIC image", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.heic", mimeType: "image/heic", buffer: HEIC_200x150 }, @@ -351,7 +351,7 @@ test.describe("Text Overlay — extended", () => { test("text overlay on WebP image", async ({ request }) => { const webpSample = formatFixture("sample.webp"); - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.webp", mimeType: "image/webp", buffer: webpSample }, @@ -369,7 +369,7 @@ test.describe("Text Overlay — extended", () => { }); test("text overlay with large font on high-res image", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -388,7 +388,7 @@ test.describe("Text Overlay — extended", () => { }); test("text overlay with background box and custom color", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -408,7 +408,7 @@ test.describe("Text Overlay — extended", () => { }); test("text overlay at top position", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -428,7 +428,7 @@ test.describe("Text Overlay — extended", () => { }); test("text overlay with empty text is rejected", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -462,7 +462,7 @@ test.describe("Compose — extended", () => { ], [{ name: "settings", value: JSON.stringify({ x: 0, y: 0, opacity: 100 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -485,7 +485,7 @@ test.describe("Compose — extended", () => { ], [{ name: "settings", value: JSON.stringify({ x: 50, y: 50, opacity: 70 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -507,7 +507,7 @@ test.describe("Compose — extended", () => { ], [{ name: "settings", value: JSON.stringify({ x: 10, y: 10, opacity: 5 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -529,7 +529,7 @@ test.describe("Compose — extended", () => { ], [{ name: "settings", value: JSON.stringify({ x: 150, y: 100, opacity: 50 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -553,7 +553,7 @@ test.describe("Watermark Text — all positions", () => { for (const position of positions) { test(`watermark at ${position} position`, async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -594,7 +594,7 @@ test.describe("Watermark Image — tiled", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -620,7 +620,7 @@ test.describe("Compose — format combinations", () => { ], [{ name: "settings", value: JSON.stringify({ x: 0, y: 0, opacity: 50 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -642,7 +642,7 @@ test.describe("Compose — format combinations", () => { ], [{ name: "settings", value: JSON.stringify({ x: 0, y: 0, opacity: 80 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -656,7 +656,7 @@ test.describe("Compose — format combinations", () => { test.describe("Text Overlay — validation", () => { test("text overlay with multiline text", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -674,7 +674,7 @@ test.describe("Text Overlay — validation", () => { }); test("text overlay with shadow effect", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -700,7 +700,7 @@ test.describe("Watermark Text -- rotation", () => { for (const rotation of rotations) { test(`tiled watermark with rotation=${rotation}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -728,7 +728,7 @@ test.describe("Watermark Text -- opacity range", () => { for (const opacity of opacities) { test(`watermark with opacity=${opacity}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -772,7 +772,7 @@ test.describe("Watermark Image -- all positions", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -807,7 +807,7 @@ test.describe("Watermark Image -- scale variations", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -825,7 +825,7 @@ test.describe("Text Overlay -- all positions", () => { for (const position of positions) { test(`text overlay at ${position}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -851,7 +851,7 @@ test.describe("Text Overlay -- font size range", () => { for (const fontSize of fontSizes) { test(`text overlay with fontSize=${fontSize}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "sample.jpg", mimeType: "image/jpeg", buffer: JPG_SAMPLE }, @@ -877,7 +877,7 @@ test.describe("Text Overlay -- color variations", () => { for (const color of colors) { test(`text overlay with color=${color}`, async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -912,7 +912,7 @@ test.describe("Compose -- output verification", () => { ], [{ name: "settings", value: JSON.stringify({ x: 10, y: 10, opacity: 80 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -942,7 +942,7 @@ test.describe("Compose -- output verification", () => { ], [{ name: "settings", value: JSON.stringify({ x: 0, y: 0, opacity: 100 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { Authorization: `Bearer ${token}`, "Content-Type": contentType }, data: body, }); @@ -957,7 +957,7 @@ test.describe("Compose -- output verification", () => { test.describe("Watermark Text -- download verification", () => { test("watermarked file is downloadable and non-empty", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { headers: { Authorization: `Bearer ${token}` }, multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, @@ -986,7 +986,7 @@ test.describe("Watermark Text -- download verification", () => { test.describe("Auth failure", () => { test("watermark-text without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/watermark-text", { + const res = await request.post("/api/v1/tools/image/watermark-text", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ @@ -1014,7 +1014,7 @@ test.describe("Auth failure", () => { ], [{ name: "settings", value: JSON.stringify({ x: 0, y: 0, opacity: 100 }) }], ); - const res = await request.post("/api/v1/tools/compose", { + const res = await request.post("/api/v1/tools/image/compose", { headers: { "Content-Type": contentType }, data: body, }); @@ -1039,7 +1039,7 @@ test.describe("Auth failure", () => { }, ], ); - const res = await request.post("/api/v1/tools/watermark-image", { + const res = await request.post("/api/v1/tools/image/watermark-image", { headers: { "Content-Type": contentType }, data: body, }); @@ -1047,7 +1047,7 @@ test.describe("Auth failure", () => { }); test("text-overlay without token returns 401", async ({ request }) => { - const res = await request.post("/api/v1/tools/text-overlay", { + const res = await request.post("/api/v1/tools/image/text-overlay", { multipart: { file: { name: "test.png", mimeType: "image/png", buffer: PNG_200x150 }, settings: JSON.stringify({ diff --git a/tests/e2e/api.spec.ts b/tests/e2e/api.spec.ts index 28b1b510..ad66b2d3 100644 --- a/tests/e2e/api.spec.ts +++ b/tests/e2e/api.spec.ts @@ -89,13 +89,13 @@ test.describe("API Endpoints", () => { }); // ── Tool: Resize ─────────────────────────────────────────────────── - test("POST /api/v1/tools/resize processes image", async () => { + test("POST /api/v1/tools/image/resize processes image", async () => { const { blob } = readTestImage(); const formData = new FormData(); formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({ width: 50, height: 50, fit: "contain" })); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", headers: authHeaders(token), body: formData, @@ -107,13 +107,13 @@ test.describe("API Endpoints", () => { }); // ── Tool: Compress ───────────────────────────────────────────────── - test("POST /api/v1/tools/compress processes image", async () => { + test("POST /api/v1/tools/image/compress processes image", async () => { const { blob } = readTestImage(); const formData = new FormData(); formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({ quality: 50 })); - const res = await fetch(`${API}/api/v1/tools/compress`, { + const res = await fetch(`${API}/api/v1/tools/image/compress`, { method: "POST", headers: authHeaders(token), body: formData, @@ -124,13 +124,13 @@ test.describe("API Endpoints", () => { }); // ── Tool: Convert ────────────────────────────────────────────────── - test("POST /api/v1/tools/convert processes image", async () => { + test("POST /api/v1/tools/image/convert processes image", async () => { const { blob } = readTestImage(); const formData = new FormData(); formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({ format: "webp" })); - const res = await fetch(`${API}/api/v1/tools/convert`, { + const res = await fetch(`${API}/api/v1/tools/image/convert`, { method: "POST", headers: authHeaders(token), body: formData, @@ -141,13 +141,13 @@ test.describe("API Endpoints", () => { }); // ── Tool: Info ───────────────────────────────────────────────────── - test("POST /api/v1/tools/info returns metadata", async () => { + test("POST /api/v1/tools/image/info returns metadata", async () => { const { blob } = readTestImage(); const formData = new FormData(); formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({})); - const res = await fetch(`${API}/api/v1/tools/info`, { + const res = await fetch(`${API}/api/v1/tools/image/info`, { method: "POST", headers: authHeaders(token), body: formData, @@ -156,8 +156,8 @@ test.describe("API Endpoints", () => { }); // ── Tool: QR Generate (JSON body, not FormData) ──────────────────── - test("POST /api/v1/tools/qr-generate creates QR code", async () => { - const res = await fetch(`${API}/api/v1/tools/qr-generate`, { + test("POST /api/v1/tools/image/qr-generate creates QR code", async () => { + const res = await fetch(`${API}/api/v1/tools/image/qr-generate`, { method: "POST", headers: { ...authHeaders(token), @@ -171,13 +171,13 @@ test.describe("API Endpoints", () => { }); // ── Tool: Rotate ─────────────────────────────────────────────────── - test("POST /api/v1/tools/rotate processes image", async () => { + test("POST /api/v1/tools/image/rotate processes image", async () => { const { blob } = readTestImage(); const formData = new FormData(); formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({ angle: 90 })); - const res = await fetch(`${API}/api/v1/tools/rotate`, { + const res = await fetch(`${API}/api/v1/tools/image/rotate`, { method: "POST", headers: authHeaders(token), body: formData, @@ -188,13 +188,13 @@ test.describe("API Endpoints", () => { }); // ── Tool: Strip Metadata ─────────────────────────────────────────── - test("POST /api/v1/tools/strip-metadata processes image", async () => { + test("POST /api/v1/tools/image/strip-metadata processes image", async () => { const { blob } = readTestImage(); const formData = new FormData(); formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({})); - const res = await fetch(`${API}/api/v1/tools/strip-metadata`, { + const res = await fetch(`${API}/api/v1/tools/image/strip-metadata`, { method: "POST", headers: authHeaders(token), body: formData, @@ -205,13 +205,13 @@ test.describe("API Endpoints", () => { }); // ── Tool: Border ─────────────────────────────────────────────────── - test("POST /api/v1/tools/border processes image", async () => { + test("POST /api/v1/tools/image/border processes image", async () => { const { blob } = readTestImage(); const formData = new FormData(); formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({ borderWidth: 10, borderColor: "#ff0000" })); - const res = await fetch(`${API}/api/v1/tools/border`, { + const res = await fetch(`${API}/api/v1/tools/image/border`, { method: "POST", headers: authHeaders(token), body: formData, @@ -225,11 +225,11 @@ test.describe("API Endpoints", () => { }); // ── Missing file returns error ───────────────────────────────────── - test("POST /api/v1/tools/resize without file returns 400", async () => { + test("POST /api/v1/tools/image/resize without file returns 400", async () => { const formData = new FormData(); formData.append("settings", JSON.stringify({ width: 50 })); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", headers: authHeaders(token), body: formData, @@ -244,7 +244,7 @@ test.describe("API Endpoints", () => { formData.append("file", blob, "test.png"); formData.append("settings", JSON.stringify({})); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", body: formData, }); diff --git a/tests/e2e/gui-resilience.spec.ts b/tests/e2e/gui-resilience.spec.ts index 1f8035d4..edbbf085 100644 --- a/tests/e2e/gui-resilience.spec.ts +++ b/tests/e2e/gui-resilience.spec.ts @@ -795,7 +795,7 @@ test.describe("Server Error Handling", () => { await uploadTestImage(page); // Intercept to return 413 (payload too large) - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 413, contentType: "application/json", @@ -818,7 +818,7 @@ test.describe("Server Error Handling", () => { expect(bodyText).toBeDefined(); expect(bodyText?.length).toBeGreaterThan(0); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); test("server 500 response shows error, not crash", async ({ loggedInPage: page }) => { @@ -826,7 +826,7 @@ test.describe("Server Error Handling", () => { await uploadTestImage(page); // Intercept the tool API endpoint to return 500 - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 500, contentType: "application/json", @@ -849,7 +849,7 @@ test.describe("Server Error Handling", () => { expect(bodyText).toBeDefined(); expect(bodyText?.length).toBeGreaterThan(0); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); test("empty file upload (0 bytes) is handled gracefully", async ({ loggedInPage: page }) => { @@ -882,7 +882,7 @@ test.describe("Server Error Handling", () => { await uploadTestImage(page); // Intercept to return 400 with a validation message - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 400, contentType: "application/json", @@ -905,7 +905,7 @@ test.describe("Server Error Handling", () => { expect(bodyText).toBeDefined(); expect(bodyText?.length).toBeGreaterThan(0); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); test("auth expiry (401) redirects to login or shows re-auth prompt", async ({ @@ -915,7 +915,7 @@ test.describe("Server Error Handling", () => { await uploadTestImage(page); // Intercept to return 401 (session expired) - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 401, contentType: "application/json", @@ -945,7 +945,7 @@ test.describe("Server Error Handling", () => { expect(content).toBeDefined(); expect(content?.length).toBeGreaterThan(0); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); test("rate limit (429) shows throttle message, not crash", async ({ loggedInPage: page }) => { @@ -953,7 +953,7 @@ test.describe("Server Error Handling", () => { await uploadTestImage(page); // Intercept to return 429 (rate limited) - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 429, contentType: "application/json", @@ -976,7 +976,7 @@ test.describe("Server Error Handling", () => { expect(bodyText).toBeDefined(); expect(bodyText?.length).toBeGreaterThan(0); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); test("network timeout shows error, not infinite spinner", async ({ loggedInPage: page }) => { @@ -984,7 +984,7 @@ test.describe("Server Error Handling", () => { await uploadTestImage(page); // Intercept and never respond -- simulates a timeout/hang - await page.route("**/api/v1/tools/resize", async (route) => { + await page.route("**/api/v1/tools/image/resize", async (route) => { // Just hold the request indefinitely (abort after test timeout) await new Promise(() => {}); void route; @@ -1002,7 +1002,7 @@ test.describe("Server Error Handling", () => { const bodyText = await page.textContent("body"); expect(bodyText).toBeDefined(); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); }); @@ -1088,7 +1088,7 @@ test.describe("Toast Notifications", () => { await uploadTestImage(page); // Intercept to cause a failure - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 500, contentType: "application/json", @@ -1108,7 +1108,7 @@ test.describe("Toast Notifications", () => { expect(bodyText).toBeDefined(); expect(bodyText?.length).toBeGreaterThan(0); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); test("toast does not block interactive elements beneath it", async ({ loggedInPage: page }) => { @@ -1246,7 +1246,7 @@ test.describe("Server Error Handling - Service Unavailable", () => { await page.goto("/resize"); await uploadTestImage(page); - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 503, contentType: "application/json", @@ -1266,7 +1266,7 @@ test.describe("Server Error Handling - Service Unavailable", () => { expect(bodyText).toBeDefined(); expect(bodyText?.length).toBeGreaterThan(0); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); }); @@ -1320,7 +1320,7 @@ test.describe("Double-Click Prevention", () => { const requestCount: string[] = []; page.on("request", (req) => { - if (req.url().includes("/api/v1/tools/resize") && req.method() === "POST") { + if (req.url().includes("/api/v1/tools/image/resize") && req.method() === "POST") { requestCount.push(req.url()); } }); @@ -1450,7 +1450,7 @@ test.describe("Processing State Cleanup", () => { await page.goto("/resize"); await uploadTestImage(page); - await page.route("**/api/v1/tools/resize", (route) => + await page.route("**/api/v1/tools/image/resize", (route) => route.fulfill({ status: 500, contentType: "application/json", @@ -1469,7 +1469,7 @@ test.describe("Processing State Cleanup", () => { await expect(resizeBtn).toBeVisible(); await expect(resizeBtn).toBeEnabled({ timeout: 5_000 }); - await page.unroute("**/api/v1/tools/resize"); + await page.unroute("**/api/v1/tools/image/resize"); }); test("successful processing followed by clear resets fully", async ({ loggedInPage: page }) => { diff --git a/tests/e2e/security.spec.ts b/tests/e2e/security.spec.ts index 428bea76..f663e40c 100644 --- a/tests/e2e/security.spec.ts +++ b/tests/e2e/security.spec.ts @@ -84,7 +84,7 @@ test.describe("Security: XSS in filenames", () => { formData.append("file", blob, ".png"); formData.append("settings", JSON.stringify({ width: 50, height: 50, fit: "contain" })); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", headers: authHeaders(token), body: formData, @@ -110,7 +110,7 @@ test.describe("Security: XSS in filenames", () => { formData.append("file", blob, "../../../etc/passwd.png"); formData.append("settings", JSON.stringify({ width: 50, height: 50, fit: "contain" })); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", headers: authHeaders(token), body: formData, @@ -130,7 +130,7 @@ test.describe("Security: XSS in filenames", () => { formData.append("file", blob, "test\x00.png"); formData.append("settings", JSON.stringify({ width: 50 })); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", headers: authHeaders(token), body: formData, @@ -292,7 +292,7 @@ test.describe("Security: CSRF and request validation", () => { formData.append("file", blob, "not-an-image.txt"); formData.append("settings", JSON.stringify({ width: 50 })); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", headers: authHeaders(token), body: formData, @@ -309,7 +309,7 @@ test.describe("Security: CSRF and request validation", () => { formData.append("file", emptyBlob, "empty.png"); formData.append("settings", JSON.stringify({ width: 50 })); - const res = await fetch(`${API}/api/v1/tools/resize`, { + const res = await fetch(`${API}/api/v1/tools/image/resize`, { method: "POST", headers: authHeaders(token), body: formData, diff --git a/tests/integration/adversarial-comprehensive.test.ts b/tests/integration/adversarial-comprehensive.test.ts index 7debb582..3ded41aa 100644 --- a/tests/integration/adversarial-comprehensive.test.ts +++ b/tests/integration/adversarial-comprehensive.test.ts @@ -18,6 +18,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -89,7 +90,7 @@ function postTool( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -111,7 +112,7 @@ function postBatch( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}/batch`, + url: `${apiToolPath(toolId)}/batch`, headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -157,7 +158,7 @@ function buildToolRequest( ]); return { method: "POST" as const, - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -666,7 +667,7 @@ describe("HTTP method mismatches on tool endpoints", () => { it("returns 404 for GET request to tool endpoint", async () => { const res = await app.inject({ method: "GET", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}` }, }); @@ -686,7 +687,7 @@ describe("HTTP method mismatches on tool endpoints", () => { const res = await app.inject({ method: "PUT", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -700,7 +701,7 @@ describe("HTTP method mismatches on tool endpoints", () => { it("returns 404 for DELETE request to tool endpoint", async () => { const res = await app.inject({ method: "DELETE", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}` }, }); @@ -710,7 +711,7 @@ describe("HTTP method mismatches on tool endpoints", () => { it("returns 404 for PATCH request to tool endpoint", async () => { const res = await app.inject({ method: "PATCH", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": "application/json", authorization: `Bearer ${adminToken}`, @@ -1286,7 +1287,7 @@ describe("Non-multipart content types to tool endpoint", () => { it("rejects JSON body sent to tool endpoint", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": "application/json", authorization: `Bearer ${adminToken}`, @@ -1301,7 +1302,7 @@ describe("Non-multipart content types to tool endpoint", () => { it("rejects plain text body sent to tool endpoint", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": "text/plain", authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/adversarial-coverage-gaps.test.ts b/tests/integration/adversarial-coverage-gaps.test.ts index 59971360..3154ab25 100644 --- a/tests/integration/adversarial-coverage-gaps.test.ts +++ b/tests/integration/adversarial-coverage-gaps.test.ts @@ -19,6 +19,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -64,7 +65,7 @@ function postTool( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -86,7 +87,7 @@ function postBatch( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}/batch`, + url: `${apiToolPath(toolId)}/batch`, headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -132,7 +133,7 @@ function buildToolRequest( ]); return { method: "POST" as const, - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -785,7 +786,7 @@ describe("Multipart edge cases -- malformed requests", () => { it("rejects request with content-type multipart/form-data but no boundary", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": "multipart/form-data", authorization: `Bearer ${adminToken}`, @@ -800,7 +801,7 @@ describe("Multipart edge cases -- malformed requests", () => { it("rejects request with empty body and multipart content-type", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": "multipart/form-data; boundary=----TestBoundary", authorization: `Bearer ${adminToken}`, @@ -814,7 +815,7 @@ describe("Multipart edge cases -- malformed requests", () => { it("rejects request with form-urlencoded content-type", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": "application/x-www-form-urlencoded", authorization: `Bearer ${adminToken}`, @@ -828,7 +829,7 @@ describe("Multipart edge cases -- malformed requests", () => { it("rejects request with no content-type header", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, }, @@ -856,7 +857,7 @@ describe("Multipart with extra unexpected fields", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -876,7 +877,7 @@ describe("Multipart with extra unexpected fields", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -899,7 +900,7 @@ describe("Multipart with extra unexpected fields", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -1319,7 +1320,7 @@ describe("Concurrent batch + single request -- extended scenarios", () => { const [batchRes, resizeRes, rotateRes] = await Promise.all([ app.inject({ method: "POST", - url: "/api/v1/tools/compress/batch", + url: "/api/v1/tools/image/compress/batch", headers: { "content-type": batchPayload.contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/adversarial-extended.test.ts b/tests/integration/adversarial-extended.test.ts index 5c3b34d9..381d5696 100644 --- a/tests/integration/adversarial-extended.test.ts +++ b/tests/integration/adversarial-extended.test.ts @@ -11,6 +11,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -53,7 +54,7 @@ function postTool( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -75,7 +76,7 @@ function postBatch( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}/batch`, + url: `${apiToolPath(toolId)}/batch`, headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -120,7 +121,7 @@ function buildToolRequest( ]); return { method: "POST" as const, - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -135,7 +136,7 @@ function buildToolRequest( describe("Zero-byte file uploads across tools", () => { const zeroBuffer = Buffer.alloc(0); - it("rejects a 0-byte file to /api/v1/tools/resize with 400", async () => { + it("rejects a 0-byte file to /api/v1/tools/image/resize with 400", async () => { const res = await postTool("resize", [ { name: "file", @@ -151,7 +152,7 @@ describe("Zero-byte file uploads across tools", () => { expect(json.error).toBeDefined(); }); - it("rejects a 0-byte file to /api/v1/tools/compress with 400", async () => { + it("rejects a 0-byte file to /api/v1/tools/image/compress with 400", async () => { const res = await postTool("compress", [ { name: "file", @@ -167,7 +168,7 @@ describe("Zero-byte file uploads across tools", () => { expect(json.error).toBeDefined(); }); - it("rejects a 0-byte file to /api/v1/tools/convert with 400", async () => { + it("rejects a 0-byte file to /api/v1/tools/image/convert with 400", async () => { const res = await postTool("convert", [ { name: "file", @@ -183,7 +184,7 @@ describe("Zero-byte file uploads across tools", () => { expect(json.error).toBeDefined(); }); - it("rejects a 0-byte file to /api/v1/tools/rotate with 400", async () => { + it("rejects a 0-byte file to /api/v1/tools/image/rotate with 400", async () => { const res = await postTool("rotate", [ { name: "file", @@ -199,7 +200,7 @@ describe("Zero-byte file uploads across tools", () => { expect(json.error).toBeDefined(); }); - it("rejects a 0-byte file to /api/v1/tools/crop with 400", async () => { + it("rejects a 0-byte file to /api/v1/tools/image/crop with 400", async () => { const res = await postTool("crop", [ { name: "file", @@ -223,7 +224,7 @@ describe("Zero-byte file uploads across tools", () => { expect(json.error).toBeDefined(); }); - it("rejects a 0-byte file to /api/v1/tools/border with 400", async () => { + it("rejects a 0-byte file to /api/v1/tools/image/border with 400", async () => { const res = await postTool("border", [ { name: "file", @@ -933,7 +934,7 @@ describe("Concurrent adversarial and valid requests", () => { ]); return app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/adversarial-final-gaps.test.ts b/tests/integration/adversarial-final-gaps.test.ts index 97e0dd99..de94ffb2 100644 --- a/tests/integration/adversarial-final-gaps.test.ts +++ b/tests/integration/adversarial-final-gaps.test.ts @@ -18,6 +18,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -62,7 +63,7 @@ function postTool( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -84,7 +85,7 @@ function postBatch( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}/batch`, + url: `${apiToolPath(toolId)}/batch`, headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -131,7 +132,7 @@ function buildToolRequest( ]); return { method: "POST" as const, - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -1005,7 +1006,7 @@ describe("Simultaneous batch + single + pipeline with output verification", () = ]); const batchReq = app.inject({ method: "POST", - url: "/api/v1/tools/compress/batch", + url: "/api/v1/tools/image/compress/batch", headers: { "content-type": batchPayload.contentType, authorization: `Bearer ${adminToken}`, @@ -1103,7 +1104,7 @@ describe("Simultaneous batch + single + pipeline with output verification", () = reqs.push( app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": payload.contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/adversarial-matrix.test.ts b/tests/integration/adversarial-matrix.test.ts index fc76585d..9f509997 100644 --- a/tests/integration/adversarial-matrix.test.ts +++ b/tests/integration/adversarial-matrix.test.ts @@ -17,6 +17,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -59,7 +60,7 @@ function postTool( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -81,7 +82,7 @@ function postBatch( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}/batch`, + url: `${apiToolPath(toolId)}/batch`, headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -127,7 +128,7 @@ function buildToolRequest( ]); return { method: "POST" as const, - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -1171,7 +1172,7 @@ describe("Concurrent -- parallel batch, pipeline, and single requests", () => { ]); const batchReq = app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": batchPayload.contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/adversarial-security.test.ts b/tests/integration/adversarial-security.test.ts index 8325be27..e7a10e90 100644 --- a/tests/integration/adversarial-security.test.ts +++ b/tests/integration/adversarial-security.test.ts @@ -16,6 +16,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -58,7 +59,7 @@ function postTool( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -80,7 +81,7 @@ function buildToolRequest( ]); return { method: "POST" as const, - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -593,7 +594,7 @@ describe("Concurrent requests -- data integrity verification", () => { ]); const batchReq = app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": batchPayload.contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/adversarial.test.ts b/tests/integration/adversarial.test.ts index 851b8ad9..dd482e5b 100644 --- a/tests/integration/adversarial.test.ts +++ b/tests/integration/adversarial.test.ts @@ -8,6 +8,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -48,7 +49,7 @@ function postTool( const { body, contentType } = createMultipartPayload(fields); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -288,7 +289,7 @@ describe("Duplicate file fields in multipart", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -524,7 +525,7 @@ describe("Unauthenticated tool access", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType }, body, }); @@ -540,7 +541,7 @@ describe("Unauthenticated tool access", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: "Bearer totally-fake-token-12345", diff --git a/tests/integration/ai-canvas-expand.test.ts b/tests/integration/ai-canvas-expand.test.ts index 5734b1b0..20f918f6 100644 --- a/tests/integration/ai-canvas-expand.test.ts +++ b/tests/integration/ai-canvas-expand.test.ts @@ -48,7 +48,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -75,7 +75,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -98,7 +98,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -126,7 +126,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -157,7 +157,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -188,7 +188,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -220,7 +220,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { "content-type": contentType }, body, }); @@ -248,7 +248,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -277,7 +277,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -308,7 +308,7 @@ describe("AI Canvas Expand", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ai-canvas-expand", + url: "/api/v1/tools/image/ai-canvas-expand", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/api.test.ts b/tests/integration/api.test.ts index 935e49f3..863e040c 100644 --- a/tests/integration/api.test.ts +++ b/tests/integration/api.test.ts @@ -9,6 +9,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -758,7 +759,7 @@ describe("File upload/download", () => { // ═══════════════════════════════════════════════════════════════════════════ describe("Tool processing", () => { // ── Resize ───────────────────────────────────────────────────── - describe("POST /api/v1/tools/resize", () => { + describe("POST /api/v1/tools/image/resize", () => { it("resizes an image successfully", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "resize-me.png", contentType: "image/png", content: PNG_200x150 }, @@ -767,7 +768,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -790,7 +791,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -808,7 +809,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -825,7 +826,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -844,7 +845,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -863,7 +864,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -881,7 +882,7 @@ describe("Tool processing", () => { const resizeRes = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -899,7 +900,7 @@ describe("Tool processing", () => { }); // ── Crop ─────────────────────────────────────────────────────── - describe("POST /api/v1/tools/crop", () => { + describe("POST /api/v1/tools/image/crop", () => { it("crops an image successfully", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "crop.png", contentType: "image/png", content: PNG_200x150 }, @@ -908,7 +909,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -928,7 +929,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -949,7 +950,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -962,7 +963,7 @@ describe("Tool processing", () => { }); // ── Convert ──────────────────────────────────────────────────── - describe("POST /api/v1/tools/convert", () => { + describe("POST /api/v1/tools/image/convert", () => { it("converts PNG to JPEG", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "convert.png", contentType: "image/png", content: PNG_200x150 }, @@ -971,7 +972,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -991,7 +992,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1009,7 +1010,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1027,7 +1028,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1039,7 +1040,7 @@ describe("Tool processing", () => { }); // ── Rotate ───────────────────────────────────────────────────── - describe("POST /api/v1/tools/rotate", () => { + describe("POST /api/v1/tools/image/rotate", () => { it("rotates 90 degrees", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "rotate.png", contentType: "image/png", content: PNG_200x150 }, @@ -1048,7 +1049,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1066,7 +1067,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1084,7 +1085,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1125,7 +1126,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1143,7 +1144,7 @@ describe("Tool processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1299,7 +1300,7 @@ describe("Auth middleware", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType }, payload, }); @@ -1631,7 +1632,7 @@ describe("API Keys", () => { // ═══════════════════════════════════════════════════════════════════════════ // STITCH // ═══════════════════════════════════════════════════════════════════════════ -describe("POST /api/v1/tools/stitch", () => { +describe("POST /api/v1/tools/image/stitch", () => { it("stitches two images horizontally with default settings", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "a.png", contentType: "image/png", content: PNG_200x150 }, @@ -1641,7 +1642,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1665,7 +1666,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1685,7 +1686,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1706,7 +1707,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1726,7 +1727,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1746,7 +1747,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1768,7 +1769,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1791,7 +1792,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1811,7 +1812,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1831,7 +1832,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1851,7 +1852,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1871,7 +1872,7 @@ describe("POST /api/v1/tools/stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2772,7 +2773,7 @@ describe("Pipeline", () => { // OCR API // ═══════════════════════════════════════════════════════════════════════════ describe("OCR API", () => { - describe("POST /api/v1/tools/ocr", () => { + describe("POST /api/v1/tools/image/ocr", () => { it("accepts quality param and returns text without engine field", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "ocr-test.png", contentType: "image/png", content: PNG_200x150 }, @@ -2781,7 +2782,7 @@ describe("OCR API", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2814,7 +2815,7 @@ describe("OCR API", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2839,7 +2840,7 @@ describe("OCR API", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2860,7 +2861,7 @@ describe("OCR API", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2878,7 +2879,7 @@ describe("OCR API", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2905,7 +2906,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2943,7 +2944,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2962,7 +2963,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert/batch", + url: "/api/v1/tools/image/convert/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2982,7 +2983,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compress/batch", + url: "/api/v1/tools/image/compress/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3002,7 +3003,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/batch", + url: "/api/v1/tools/image/strip-metadata/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3022,7 +3023,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate/batch", + url: "/api/v1/tools/image/rotate/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3041,7 +3042,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert/batch", + url: "/api/v1/tools/image/convert/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3059,7 +3060,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3077,7 +3078,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/batch", + url: "/api/v1/tools/image/strip-metadata/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3097,7 +3098,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3119,7 +3120,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3141,7 +3142,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3162,7 +3163,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3182,7 +3183,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3210,7 +3211,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3239,7 +3240,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}/batch`, + url: `${apiToolPath(toolId)}/batch`, headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3269,7 +3270,7 @@ describe("Smart crop format preservation", () => { ]); return app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3380,7 +3381,7 @@ describe("Crop format preservation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3407,7 +3408,7 @@ describe("Crop format preservation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3439,7 +3440,7 @@ describe("Color adjustments format preservation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/adjust-colors", + url: "/api/v1/tools/image/adjust-colors", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3466,7 +3467,7 @@ describe("Color adjustments format preservation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/adjust-colors", + url: "/api/v1/tools/image/adjust-colors", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3551,7 +3552,7 @@ describe("Edge cases & adversarial inputs", () => { return app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3575,7 +3576,7 @@ describe("Edge cases & adversarial inputs", () => { it("rejects a JSON body on multipart-only endpoint", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -3593,7 +3594,7 @@ describe("Edge cases & adversarial inputs", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3612,7 +3613,7 @@ describe("Edge cases & adversarial inputs", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3646,7 +3647,7 @@ describe("Edge cases & adversarial inputs", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3666,7 +3667,7 @@ describe("Edge cases & adversarial inputs", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3725,7 +3726,7 @@ describe("Workspace integrity", () => { const toolRes = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3780,14 +3781,14 @@ describe("Workspace integrity", () => { // EDIT METADATA // ═══════════════════════════════════════════════════════════════════════════ describe("Edit metadata", () => { - describe("POST /api/v1/tools/edit-metadata/inspect", () => { + describe("POST /api/v1/tools/image/edit-metadata/inspect", () => { it("returns parsed EXIF for JPEG with metadata", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "exif.jpg", contentType: "image/jpeg", content: EXIF_JPG }, ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, payload, }); @@ -3807,7 +3808,7 @@ describe("Edit metadata", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, payload, }); @@ -3820,7 +3821,7 @@ describe("Edit metadata", () => { it("rejects request with no file", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", headers: { authorization: `Bearer ${adminToken}`, "content-type": "multipart/form-data; boundary=---test", @@ -3831,7 +3832,7 @@ describe("Edit metadata", () => { }); }); - describe("POST /api/v1/tools/edit-metadata", () => { + describe("POST /api/v1/tools/image/edit-metadata", () => { it("writes metadata and returns downloadable file", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "edit.jpg", contentType: "image/jpeg", content: EXIF_JPG }, @@ -3839,7 +3840,7 @@ describe("Edit metadata", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, payload, }); @@ -3858,7 +3859,7 @@ describe("Edit metadata", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, payload, }); @@ -3873,7 +3874,7 @@ describe("Edit metadata", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, payload, }); @@ -3884,7 +3885,7 @@ describe("Edit metadata", () => { }); describe("Image Enhancement", () => { - it("POST /api/v1/tools/image-enhancement processes an image", async () => { + it("POST /api/v1/tools/image/image-enhancement processes an image", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "test.png", contentType: "image/png", content: PNG_200x150 }, { @@ -3905,7 +3906,7 @@ describe("Image Enhancement", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement", + url: "/api/v1/tools/image/image-enhancement", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3919,13 +3920,13 @@ describe("Image Enhancement", () => { expect(body.processedSize).toBeGreaterThan(0); }); - it("POST /api/v1/tools/image-enhancement/analyze returns analysis data", async () => { + it("POST /api/v1/tools/image/image-enhancement/analyze returns analysis data", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "test.png", contentType: "image/png", content: PNG_200x150 }, ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3954,7 +3955,7 @@ describe("Image Enhancement", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement", + url: "/api/v1/tools/image/image-enhancement", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3976,7 +3977,7 @@ describe("Image Enhancement", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement", + url: "/api/v1/tools/image/image-enhancement", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -3991,7 +3992,7 @@ describe("Image Enhancement", () => { // NOISE REMOVAL // ═══════════════════════════════════════════════════════════════════════════ describe("Noise Removal", () => { - it("POST /api/v1/tools/noise-removal processes with quick tier", async () => { + it("POST /api/v1/tools/image/noise-removal processes with quick tier", async () => { const { body: payload, contentType } = createMultipartPayload([ { name: "file", filename: "noisy.png", contentType: "image/png", content: PNG_200x150 }, { @@ -4001,7 +4002,7 @@ describe("Noise Removal", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -4026,7 +4027,7 @@ describe("Noise Removal", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -4047,7 +4048,7 @@ describe("Noise Removal", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -4068,7 +4069,7 @@ describe("Noise Removal", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -4085,7 +4086,7 @@ describe("Noise Removal", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/aspect-pad.test.ts b/tests/integration/aspect-pad.test.ts index dccb0679..480303e5 100644 --- a/tests/integration/aspect-pad.test.ts +++ b/tests/integration/aspect-pad.test.ts @@ -37,7 +37,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/aspect-pad", + url: "/api/v1/tools/video/aspect-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/audio-channels.test.ts b/tests/integration/audio-channels.test.ts index 52ae8bac..ade7ad07 100644 --- a/tests/integration/audio-channels.test.ts +++ b/tests/integration/audio-channels.test.ts @@ -32,7 +32,7 @@ function postTool( ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/audio-channels", + url: "/api/v1/tools/audio/audio-channels", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/audio-metadata.test.ts b/tests/integration/audio-metadata.test.ts index 3e0c1bc1..5b603c55 100644 --- a/tests/integration/audio-metadata.test.ts +++ b/tests/integration/audio-metadata.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/audio-metadata", + url: "/api/v1/tools/audio/audio-metadata", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/audio-speed.test.ts b/tests/integration/audio-speed.test.ts index 489d38b6..7329d030 100644 --- a/tests/integration/audio-speed.test.ts +++ b/tests/integration/audio-speed.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/audio-speed", + url: "/api/v1/tools/audio/audio-speed", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/audit-tool-operations.test.ts b/tests/integration/audit-tool-operations.test.ts index fdcc6ed4..57cb455c 100644 --- a/tests/integration/audit-tool-operations.test.ts +++ b/tests/integration/audit-tool-operations.test.ts @@ -57,7 +57,7 @@ async function processResize(): Promise { const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/auto-subtitles.test.ts b/tests/integration/auto-subtitles.test.ts index d5803541..568e6c32 100644 --- a/tests/integration/auto-subtitles.test.ts +++ b/tests/integration/auto-subtitles.test.ts @@ -46,7 +46,7 @@ describe("auto-subtitles", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/auto-subtitles", + url: "/api/v1/tools/video/auto-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -80,7 +80,7 @@ describe("auto-subtitles", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/auto-subtitles", + url: "/api/v1/tools/video/auto-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -107,7 +107,7 @@ describe("auto-subtitles", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/auto-subtitles", + url: "/api/v1/tools/video/auto-subtitles", headers: { "content-type": contentType }, body, }); @@ -137,7 +137,7 @@ describe("auto-subtitles", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/auto-subtitles", + url: "/api/v1/tools/video/auto-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -167,7 +167,7 @@ describe("auto-subtitles", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/auto-subtitles", + url: "/api/v1/tools/video/auto-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/background-replace.test.ts b/tests/integration/background-replace.test.ts index da025c85..086d2397 100644 --- a/tests/integration/background-replace.test.ts +++ b/tests/integration/background-replace.test.ts @@ -43,7 +43,7 @@ describe("background-replace", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/background-replace", + url: "/api/v1/tools/image/background-replace", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -69,7 +69,7 @@ describe("background-replace", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/background-replace", + url: "/api/v1/tools/image/background-replace", headers: { "content-type": contentType }, body, }); @@ -87,7 +87,7 @@ describe("background-replace", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/background-replace", + url: "/api/v1/tools/image/background-replace", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -117,7 +117,7 @@ describe("background-replace", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/background-replace", + url: "/api/v1/tools/image/background-replace", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -146,7 +146,7 @@ describe("background-replace", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/background-replace", + url: "/api/v1/tools/image/background-replace", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -173,7 +173,7 @@ describe("background-replace", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/background-replace", + url: "/api/v1/tools/image/background-replace", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -205,7 +205,7 @@ describe("background-replace", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/background-replace", + url: "/api/v1/tools/image/background-replace", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/barcode-generate.test.ts b/tests/integration/barcode-generate.test.ts index bbbb26aa..3f828388 100644 --- a/tests/integration/barcode-generate.test.ts +++ b/tests/integration/barcode-generate.test.ts @@ -28,7 +28,7 @@ describe("Barcode Generate", () => { it("generates a code128 barcode from text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -58,7 +58,7 @@ describe("Barcode Generate", () => { it("generates a valid ean13 barcode from 13-digit number", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -77,7 +77,7 @@ describe("Barcode Generate", () => { it("rejects ean13 with non-numeric text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -96,7 +96,7 @@ describe("Barcode Generate", () => { it("uses code128 as default type", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -114,7 +114,7 @@ describe("Barcode Generate", () => { it("generates a UPC-A barcode", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -131,7 +131,7 @@ describe("Barcode Generate", () => { it("generates a code39 barcode", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -148,7 +148,7 @@ describe("Barcode Generate", () => { it("generates an itf14 barcode", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -165,7 +165,7 @@ describe("Barcode Generate", () => { it("generates a datamatrix barcode", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -182,7 +182,7 @@ describe("Barcode Generate", () => { it("rejects request without text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -198,7 +198,7 @@ describe("Barcode Generate", () => { it("rejects empty text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -212,7 +212,7 @@ describe("Barcode Generate", () => { it("rejects invalid barcode type", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -226,7 +226,7 @@ describe("Barcode Generate", () => { it("rejects unauthenticated requests", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { "content-type": "application/json" }, payload: { text: "test" }, }); @@ -237,7 +237,7 @@ describe("Barcode Generate", () => { it("returns all expected fields in the response", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -257,7 +257,7 @@ describe("Barcode Generate", () => { it("respects scale parameter", async () => { const resSmall = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -267,7 +267,7 @@ describe("Barcode Generate", () => { const resLarge = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -286,7 +286,7 @@ describe("Barcode Generate", () => { it("supports includeText toggle", async () => { const resWithText = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -296,7 +296,7 @@ describe("Barcode Generate", () => { const resNoText = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-generate", + url: "/api/v1/tools/image/barcode-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", diff --git a/tests/integration/barcode-read.test.ts b/tests/integration/barcode-read.test.ts index 3d91aa5d..ab9db961 100644 --- a/tests/integration/barcode-read.test.ts +++ b/tests/integration/barcode-read.test.ts @@ -33,7 +33,7 @@ beforeAll(async () => { // Generate a QR code to use as a reliable fixture const genRes = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -60,7 +60,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -88,7 +88,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -119,7 +119,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -154,7 +154,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -178,7 +178,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -206,7 +206,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -227,7 +227,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -247,7 +247,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { "content-type": contentType }, body, }); @@ -265,7 +265,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -287,7 +287,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -311,7 +311,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -335,7 +335,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -357,7 +357,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -378,7 +378,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -407,7 +407,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -428,7 +428,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -447,7 +447,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -468,7 +468,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -492,7 +492,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -518,7 +518,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -541,7 +541,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -564,7 +564,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -594,7 +594,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -637,7 +637,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -663,7 +663,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -690,7 +690,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -714,7 +714,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -739,7 +739,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -765,7 +765,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -788,7 +788,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -815,7 +815,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -839,7 +839,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -863,7 +863,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -887,7 +887,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -907,7 +907,7 @@ describe("Barcode Read", () => { // Generate a QR code SVG via qr-generate const genRes = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -931,7 +931,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -953,7 +953,7 @@ describe("Barcode Read", () => { const testText = "barcode-read-verification-test-12345"; const genRes = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -973,7 +973,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -999,7 +999,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1024,7 +1024,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1048,7 +1048,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1087,7 +1087,7 @@ describe("Barcode Read", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/batch.test.ts b/tests/integration/batch.test.ts index d40517f7..987f40c2 100644 --- a/tests/integration/batch.test.ts +++ b/tests/integration/batch.test.ts @@ -48,7 +48,7 @@ describe("ZIP response format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -72,7 +72,7 @@ describe("ZIP response format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -98,7 +98,7 @@ describe("Filename deduplication in batch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -127,7 +127,7 @@ describe("X-File-Results header", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -152,7 +152,7 @@ describe("X-File-Results header", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -178,7 +178,7 @@ describe("X-File-Results header", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -208,7 +208,7 @@ describe("X-File-Results header", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -235,7 +235,7 @@ describe("ClientJobId passthrough", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -255,7 +255,7 @@ describe("ClientJobId passthrough", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -299,7 +299,7 @@ describe("Batch error handling", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -322,7 +322,7 @@ describe("Batch error handling", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -341,7 +341,7 @@ describe("Batch error handling", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -365,7 +365,7 @@ describe("Mixed format batch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -389,7 +389,7 @@ describe("Batch with default settings", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/batch", + url: "/api/v1/tools/image/strip-metadata/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -439,7 +439,7 @@ describe("Exotic format batch processing", () => { ]); return app.inject({ method: "POST", - url: "/api/v1/tools/compress/batch", + url: "/api/v1/tools/image/compress/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -485,7 +485,7 @@ describe("Exotic format batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compress/batch", + url: "/api/v1/tools/image/compress/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -516,7 +516,7 @@ describe("Batch preserves upload order", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -555,7 +555,7 @@ describe("Legacy batch SSE wire parity", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -601,7 +601,7 @@ describe.skipIf(!ffmpegAvailable())("Non-image modality batch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate-video/batch", + url: "/api/v1/tools/video/rotate-video/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); diff --git a/tests/integration/beautify.test.ts b/tests/integration/beautify.test.ts index b86ee29e..d80cab26 100644 --- a/tests/integration/beautify.test.ts +++ b/tests/integration/beautify.test.ts @@ -52,7 +52,7 @@ describe("Beautify", () => { { name: "settings", content: JSON.stringify({}) }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -73,7 +73,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -96,7 +96,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -118,7 +118,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -134,7 +134,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -164,7 +164,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -191,7 +191,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -222,7 +222,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -255,7 +255,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -279,7 +279,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -307,7 +307,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -341,7 +341,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -359,7 +359,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -375,7 +375,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -393,7 +393,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -405,7 +405,7 @@ describe("Beautify", () => { it("missing file returns 400", async () => { const payload = createMultipartPayload([{ name: "settings", content: JSON.stringify({}) }]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); const result = JSON.parse(res.body); @@ -421,7 +421,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); const result = JSON.parse(res.body); @@ -439,7 +439,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -461,7 +461,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -483,7 +483,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -504,7 +504,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -536,7 +536,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -556,7 +556,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -593,7 +593,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -619,7 +619,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -646,7 +646,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -668,7 +668,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -702,7 +702,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -731,7 +731,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -753,7 +753,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -779,7 +779,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -802,7 +802,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); }); @@ -822,7 +822,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); }); @@ -839,7 +839,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -860,7 +860,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -880,7 +880,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -898,7 +898,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -911,7 +911,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -924,7 +924,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -937,7 +937,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -950,7 +950,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -966,7 +966,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -985,7 +985,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -995,7 +995,7 @@ describe("Beautify", () => { { name: "settings", content: "{not valid json" }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -1016,7 +1016,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -1053,7 +1053,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -1082,7 +1082,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); @@ -1112,7 +1112,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect([200, 422]).toContain(res.statusCode); if (res.statusCode === 200) { const result = JSON.parse(res.body); @@ -1135,7 +1135,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); expect(result.processedSize).toBeGreaterThan(0); @@ -1157,7 +1157,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); expect(result.processedSize).toBeGreaterThan(0); @@ -1170,7 +1170,7 @@ describe("Beautify", () => { { name: "settings", content: JSON.stringify({}) }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -1183,7 +1183,7 @@ describe("Beautify", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/beautify", + url: "/api/v1/tools/image/beautify", headers: { "content-type": payload.contentType }, body: payload.body, }); @@ -1198,7 +1198,7 @@ describe("Beautify", () => { { name: "settings", content: JSON.stringify({}) }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); expect(result).toHaveProperty("jobId"); @@ -1227,7 +1227,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); const result = JSON.parse(res.body); expect(result.downloadUrl).toBeDefined(); @@ -1243,7 +1243,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -1257,7 +1257,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(400); }); @@ -1275,7 +1275,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); }); @@ -1292,7 +1292,7 @@ describe("Beautify", () => { }, ]); - const res = await post("/api/v1/tools/beautify", payload); + const res = await post("/api/v1/tools/image/beautify", payload); expect(res.statusCode).toBe(200); }); }); diff --git a/tests/integration/blur-background.test.ts b/tests/integration/blur-background.test.ts index 5da7ec7b..13678a50 100644 --- a/tests/integration/blur-background.test.ts +++ b/tests/integration/blur-background.test.ts @@ -43,7 +43,7 @@ describe("blur-background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-background", + url: "/api/v1/tools/image/blur-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -69,7 +69,7 @@ describe("blur-background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-background", + url: "/api/v1/tools/image/blur-background", headers: { "content-type": contentType }, body, }); @@ -87,7 +87,7 @@ describe("blur-background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-background", + url: "/api/v1/tools/image/blur-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -111,7 +111,7 @@ describe("blur-background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-background", + url: "/api/v1/tools/image/blur-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -134,7 +134,7 @@ describe("blur-background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-background", + url: "/api/v1/tools/image/blur-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -164,7 +164,7 @@ describe("blur-background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-background", + url: "/api/v1/tools/image/blur-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/blur-faces.test.ts b/tests/integration/blur-faces.test.ts index bc1bea58..27334c90 100644 --- a/tests/integration/blur-faces.test.ts +++ b/tests/integration/blur-faces.test.ts @@ -41,7 +41,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -56,7 +56,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -80,7 +80,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -99,7 +99,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -118,7 +118,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -136,7 +136,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -154,7 +154,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -175,7 +175,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -195,7 +195,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -214,7 +214,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -233,7 +233,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -249,7 +249,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { "content-type": contentType }, body, }); @@ -268,7 +268,7 @@ describe("blur-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/blur-faces", + url: "/api/v1/tools/image/blur-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/blur-pad.test.ts b/tests/integration/blur-pad.test.ts index 017ef0b4..9f991b6a 100644 --- a/tests/integration/blur-pad.test.ts +++ b/tests/integration/blur-pad.test.ts @@ -37,7 +37,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/blur-pad", + url: "/api/v1/tools/video/blur-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/booklet-pdf.test.ts b/tests/integration/booklet-pdf.test.ts index e46640fd..6e262b52 100644 --- a/tests/integration/booklet-pdf.test.ts +++ b/tests/integration/booklet-pdf.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/booklet-pdf", + url: "/api/v1/tools/pdf/booklet-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/border.test.ts b/tests/integration/border.test.ts index 0200f878..23c32877 100644 --- a/tests/integration/border.test.ts +++ b/tests/integration/border.test.ts @@ -41,7 +41,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -67,7 +67,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -110,7 +110,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -147,7 +147,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -190,7 +190,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -224,7 +224,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -253,7 +253,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -287,7 +287,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -311,7 +311,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -335,7 +335,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -356,7 +356,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { "content-type": contentType }, body, }); @@ -377,7 +377,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -406,7 +406,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -444,7 +444,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -476,7 +476,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -507,7 +507,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -533,7 +533,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -563,7 +563,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -585,7 +585,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -607,7 +607,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -629,7 +629,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -650,7 +650,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -675,7 +675,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -714,7 +714,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -748,7 +748,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -779,7 +779,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -808,7 +808,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -839,7 +839,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -863,7 +863,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -883,7 +883,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -902,7 +902,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -922,7 +922,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -944,7 +944,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -979,7 +979,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1017,7 +1017,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1041,7 +1041,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1064,7 +1064,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1089,7 +1089,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1119,7 +1119,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1149,7 +1149,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1177,7 +1177,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1216,7 +1216,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1239,7 +1239,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1270,7 +1270,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1301,7 +1301,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1333,7 +1333,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1365,7 +1365,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1397,7 +1397,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1429,7 +1429,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1452,7 +1452,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1473,7 +1473,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1501,7 +1501,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1538,7 +1538,7 @@ describe("Border", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/border", + url: "/api/v1/tools/image/border", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/bulk-rename.test.ts b/tests/integration/bulk-rename.test.ts index c2dab103..1ab9fd81 100644 --- a/tests/integration/bulk-rename.test.ts +++ b/tests/integration/bulk-rename.test.ts @@ -52,7 +52,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -80,7 +80,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -105,7 +105,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -132,7 +132,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -156,7 +156,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -179,7 +179,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -207,7 +207,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -228,7 +228,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { "content-type": contentType }, body, }); @@ -250,7 +250,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -275,7 +275,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -309,7 +309,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -335,7 +335,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -359,7 +359,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -382,7 +382,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -403,7 +403,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -424,7 +424,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -451,7 +451,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -475,7 +475,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -498,7 +498,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -530,7 +530,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -557,7 +557,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -581,7 +581,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -604,7 +604,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -629,7 +629,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -653,7 +653,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -681,7 +681,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -704,7 +704,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -727,7 +727,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -756,7 +756,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -789,7 +789,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -814,7 +814,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -841,7 +841,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -872,7 +872,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -902,7 +902,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -927,7 +927,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -953,7 +953,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -977,7 +977,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1002,7 +1002,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1028,7 +1028,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1050,7 +1050,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1073,7 +1073,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1097,7 +1097,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1130,7 +1130,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1168,7 +1168,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1192,7 +1192,7 @@ describe("Bulk Rename", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/bulk-rename", + url: "/api/v1/tools/image/bulk-rename", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/burn-subtitles.test.ts b/tests/integration/burn-subtitles.test.ts index 1e3a6de5..d2ed3720 100644 --- a/tests/integration/burn-subtitles.test.ts +++ b/tests/integration/burn-subtitles.test.ts @@ -69,7 +69,7 @@ describe.skipIf(!ffmpegAvailable())("burn-subtitles (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/burn-subtitles", + url: "/api/v1/tools/video/burn-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -92,7 +92,7 @@ describe.skipIf(!ffmpegAvailable())("burn-subtitles (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/burn-subtitles", + url: "/api/v1/tools/video/burn-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -115,7 +115,7 @@ describe.skipIf(!ffmpegAvailable())("burn-subtitles (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/burn-subtitles", + url: "/api/v1/tools/video/burn-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/change-fps.test.ts b/tests/integration/change-fps.test.ts index daf60fbc..255569d4 100644 --- a/tests/integration/change-fps.test.ts +++ b/tests/integration/change-fps.test.ts @@ -35,7 +35,7 @@ async function runTool( ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/change-fps", + url: "/api/v1/tools/video/change-fps", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/chart-maker.test.ts b/tests/integration/chart-maker.test.ts index 3943da52..c7a4ae3d 100644 --- a/tests/integration/chart-maker.test.ts +++ b/tests/integration/chart-maker.test.ts @@ -49,7 +49,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -81,7 +81,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -105,7 +105,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -127,7 +127,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -145,7 +145,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -165,7 +165,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -189,7 +189,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -210,7 +210,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -236,7 +236,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -254,7 +254,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -271,7 +271,7 @@ describe("Chart Maker", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/chart-maker", + url: "/api/v1/tools/files/chart-maker", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/circle-crop.test.ts b/tests/integration/circle-crop.test.ts index 83cf6862..3ad74624 100644 --- a/tests/integration/circle-crop.test.ts +++ b/tests/integration/circle-crop.test.ts @@ -37,7 +37,7 @@ describe("Circle Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/circle-crop", + url: "/api/v1/tools/image/circle-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -69,7 +69,7 @@ describe("Circle Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/circle-crop", + url: "/api/v1/tools/image/circle-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -103,7 +103,7 @@ describe("Circle Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/circle-crop", + url: "/api/v1/tools/image/circle-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -139,7 +139,7 @@ describe("Circle Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/circle-crop", + url: "/api/v1/tools/image/circle-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -179,7 +179,7 @@ describe("Circle Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/circle-crop", + url: "/api/v1/tools/image/circle-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/collage.test.ts b/tests/integration/collage.test.ts index c6f3c180..6ba52dab 100644 --- a/tests/integration/collage.test.ts +++ b/tests/integration/collage.test.ts @@ -43,7 +43,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -69,7 +69,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -96,7 +96,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -121,7 +121,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -146,7 +146,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -171,7 +171,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -208,7 +208,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -240,7 +240,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -269,7 +269,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -301,7 +301,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -325,7 +325,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -349,7 +349,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -371,7 +371,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -393,7 +393,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { "content-type": contentType }, body, }); @@ -416,7 +416,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -443,7 +443,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -471,7 +471,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -502,7 +502,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -533,7 +533,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -563,7 +563,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -598,7 +598,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -635,7 +635,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -666,7 +666,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -691,7 +691,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -725,7 +725,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -763,7 +763,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -789,7 +789,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -814,7 +814,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -836,7 +836,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -864,7 +864,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -899,7 +899,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -941,7 +941,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -974,7 +974,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1001,7 +1001,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1033,7 +1033,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1065,7 +1065,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1100,7 +1100,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1132,7 +1132,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1167,7 +1167,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1194,7 +1194,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1222,7 +1222,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1250,7 +1250,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1278,7 +1278,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1306,7 +1306,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1332,7 +1332,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1356,7 +1356,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1380,7 +1380,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1405,7 +1405,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1442,7 +1442,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1470,7 +1470,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1499,7 +1499,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1528,7 +1528,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1558,7 +1558,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1586,7 +1586,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1614,7 +1614,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1646,7 +1646,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1678,7 +1678,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1710,7 +1710,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1742,7 +1742,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1774,7 +1774,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1806,7 +1806,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1838,7 +1838,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1870,7 +1870,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1908,7 +1908,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1937,7 +1937,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1966,7 +1966,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2000,7 +2000,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2029,7 +2029,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2060,7 +2060,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2091,7 +2091,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2118,7 +2118,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2157,7 +2157,7 @@ describe("Collage", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/color-adjustments.test.ts b/tests/integration/color-adjustments.test.ts index e264eb61..77729c80 100644 --- a/tests/integration/color-adjustments.test.ts +++ b/tests/integration/color-adjustments.test.ts @@ -8,6 +8,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -53,7 +54,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), payload, headers: { "content-type": contentType, @@ -236,7 +237,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/adjust-colors", + url: "/api/v1/tools/image/adjust-colors", payload, headers: { "content-type": contentType, @@ -489,7 +490,7 @@ describe("Authentication", () => { const { body: payload, contentType } = makePayload({ brightness: 30 }); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/adjust-colors", + url: "/api/v1/tools/image/adjust-colors", payload, headers: { "content-type": contentType }, }); @@ -737,7 +738,7 @@ describe("Invalid settings JSON", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/adjust-colors", + url: "/api/v1/tools/image/adjust-colors", payload: badPayload, headers: { "content-type": badCt, diff --git a/tests/integration/color-blindness.test.ts b/tests/integration/color-blindness.test.ts index 7911d106..b1476397 100644 --- a/tests/integration/color-blindness.test.ts +++ b/tests/integration/color-blindness.test.ts @@ -55,7 +55,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/color-blindness", + url: "/api/v1/tools/image/color-blindness", payload, headers: { "content-type": contentType, @@ -169,7 +169,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-blindness", + url: "/api/v1/tools/image/color-blindness", payload, headers: { "content-type": contentType, @@ -208,7 +208,7 @@ describe("Authentication", () => { const { body: payload, contentType } = makePayload({ simulationType: "protanopia" }); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-blindness", + url: "/api/v1/tools/image/color-blindness", payload, headers: { "content-type": contentType }, }); @@ -291,7 +291,7 @@ describe("Invalid settings JSON", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-blindness", + url: "/api/v1/tools/image/color-blindness", payload, headers: { "content-type": contentType, diff --git a/tests/integration/color-palette.test.ts b/tests/integration/color-palette.test.ts index a821115c..c281ad43 100644 --- a/tests/integration/color-palette.test.ts +++ b/tests/integration/color-palette.test.ts @@ -40,7 +40,7 @@ describe("Color extraction", () => { const { body: payload, contentType } = makeFilePayload(PNG, "test.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -61,7 +61,7 @@ describe("Color extraction", () => { const { body: payload, contentType } = makeFilePayload(PNG, "test.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -88,7 +88,7 @@ describe("Solid color image", () => { const { body: payload, contentType } = makeFilePayload(redBuffer, "red.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -109,7 +109,7 @@ describe("Multiple input formats", () => { const { body: payload, contentType } = makeFilePayload(JPG, "test.jpg", "image/jpeg"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -125,7 +125,7 @@ describe("Multiple input formats", () => { const { body: payload, contentType } = makeFilePayload(WEBP, "test.webp", "image/webp"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -146,7 +146,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -163,7 +163,7 @@ describe("Error handling", () => { const { body: payload, contentType } = makeFilePayload(badBuffer, "bad.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -183,7 +183,7 @@ describe("Multipart error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -203,7 +203,7 @@ describe("HEIC input", () => { const { body: payload, contentType } = makeFilePayload(HEIC, "photo.heic", "image/heic"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -247,7 +247,7 @@ describe("Multi-color extraction", () => { const { body: payload, contentType } = makeFilePayload(halfBuffer, "bicolor.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -267,7 +267,7 @@ describe("Edge size inputs", () => { const { body: payload, contentType } = makeFilePayload(TINY, "tiny.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -284,7 +284,7 @@ describe("Edge size inputs", () => { const { body: payload, contentType } = makeFilePayload(LARGE, "large.jpg", "image/jpeg"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -304,7 +304,7 @@ describe("Authentication", () => { const { body: payload, contentType } = makeFilePayload(PNG, "test.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -340,7 +340,7 @@ describe("Gradient image palette", () => { ); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -366,7 +366,7 @@ describe("Solid white image", () => { const { body: payload, contentType } = makeFilePayload(whiteBuffer, "white.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -388,7 +388,7 @@ describe("HEIF input", () => { const { body: payload, contentType } = makeFilePayload(HEIF, "photo.heif", "image/heif"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -408,7 +408,7 @@ describe("Animated GIF input", () => { const { body: payload, contentType } = makeFilePayload(GIF, "anim.gif", "image/gif"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -428,7 +428,7 @@ describe("SVG input", () => { const { body: payload, contentType } = makeFilePayload(SVG, "icon.svg", "image/svg+xml"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -448,7 +448,7 @@ describe("TIFF input", () => { const { body: payload, contentType } = makeFilePayload(TIFF, "test.tiff", "image/tiff"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -469,7 +469,7 @@ describe("Real photo palette", () => { const { body: payload, contentType } = makeFilePayload(PHOTO, "photo.jpg", "image/jpeg"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -499,7 +499,7 @@ describe("Solid black image", () => { const { body: payload, contentType } = makeFilePayload(blackBuffer, "black.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -519,7 +519,7 @@ describe("Color count bounds", () => { const { body: payload, contentType } = makeFilePayload(PNG, "test.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -541,7 +541,7 @@ describe("AVIF input", () => { const { body: payload, contentType } = makeFilePayload(AVIF, "test.avif", "image/avif"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -560,7 +560,7 @@ describe("Filename tracking", () => { const { body: payload, contentType } = makeFilePayload(PNG, "my-image-2024.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -580,7 +580,7 @@ describe("Color uniqueness", () => { const { body: payload, contentType } = makeFilePayload(PHOTO, "photo.jpg", "image/jpeg"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -601,7 +601,7 @@ describe("SVG logo input", () => { const { body: payload, contentType } = makeFilePayload(SVG_LOGO, "logo.svg", "image/svg+xml"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -646,7 +646,7 @@ describe("Three-color image", () => { const { body: payload, contentType } = makeFilePayload(tricolorBuffer, "tri.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -665,7 +665,7 @@ describe("No settings field", () => { const { body: payload, contentType } = makeFilePayload(PNG, "test.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -686,7 +686,7 @@ describe("BMP input", () => { const { body: payload, contentType } = makeFilePayload(BMP, "test.bmp", "image/bmp"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -709,7 +709,7 @@ describe("Portrait image palette", () => { const { body: payload, contentType } = makeFilePayload(BW, "bw.jpg", "image/jpeg"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -730,7 +730,7 @@ describe("Cross-format WebP input", () => { const { body: payload, contentType } = makeFilePayload(CHAT, "chat.webp", "image/webp"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -753,7 +753,7 @@ describe("Settings: custom count", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -778,7 +778,7 @@ describe("Settings: RGB format", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -804,7 +804,7 @@ describe("Settings: HSL format", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, @@ -826,7 +826,7 @@ describe("Response shape: hex array", () => { const { body: payload, contentType } = makeFilePayload(PNG, "test.png", "image/png"); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-palette", + url: "/api/v1/tools/image/color-palette", payload, headers: { "content-type": contentType, diff --git a/tests/integration/colorize.test.ts b/tests/integration/colorize.test.ts index 01c0f031..f7193d3a 100644 --- a/tests/integration/colorize.test.ts +++ b/tests/integration/colorize.test.ts @@ -41,7 +41,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -56,7 +56,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -80,7 +80,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -99,7 +99,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -118,7 +118,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -137,7 +137,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -156,7 +156,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -174,7 +174,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -191,7 +191,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -212,7 +212,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -231,7 +231,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -250,7 +250,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -266,7 +266,7 @@ describe("colorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/colorize", + url: "/api/v1/tools/image/colorize", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/compare.test.ts b/tests/integration/compare.test.ts index 09e81de3..2480fe56 100644 --- a/tests/integration/compare.test.ts +++ b/tests/integration/compare.test.ts @@ -39,7 +39,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -66,7 +66,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -90,7 +90,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -122,7 +122,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -146,7 +146,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -175,7 +175,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -193,7 +193,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -214,7 +214,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { "content-type": contentType }, body, }); @@ -232,7 +232,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -256,7 +256,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -279,7 +279,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -302,7 +302,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -323,7 +323,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -349,7 +349,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -372,7 +372,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -396,7 +396,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -420,7 +420,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -448,7 +448,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -473,7 +473,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -498,7 +498,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -522,7 +522,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -550,7 +550,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -582,7 +582,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -607,7 +607,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -633,7 +633,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -659,7 +659,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -684,7 +684,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -709,7 +709,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -735,7 +735,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -762,7 +762,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -786,7 +786,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -814,7 +814,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -840,7 +840,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -866,7 +866,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -894,7 +894,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -919,7 +919,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -942,7 +942,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -974,7 +974,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -999,7 +999,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1026,7 +1026,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1056,7 +1056,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1082,7 +1082,7 @@ describe("Compare", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/compose.test.ts b/tests/integration/compose.test.ts index bdd332ef..0cb3469b 100644 --- a/tests/integration/compose.test.ts +++ b/tests/integration/compose.test.ts @@ -40,7 +40,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -73,7 +73,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -105,7 +105,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -127,7 +127,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -149,7 +149,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -177,7 +177,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -201,7 +201,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -222,7 +222,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -244,7 +244,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -266,7 +266,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -286,7 +286,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { "content-type": contentType }, body, }); @@ -305,7 +305,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -327,7 +327,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -347,7 +347,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -367,7 +367,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -387,7 +387,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -407,7 +407,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -427,7 +427,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -448,7 +448,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -478,7 +478,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -498,7 +498,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -519,7 +519,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -542,7 +542,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -565,7 +565,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -588,7 +588,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -610,7 +610,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -630,7 +630,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -656,7 +656,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -682,7 +682,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -707,7 +707,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -731,7 +731,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -763,7 +763,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -788,7 +788,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -810,7 +810,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -834,7 +834,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -856,7 +856,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -881,7 +881,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -905,7 +905,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -936,7 +936,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -960,7 +960,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -997,7 +997,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1022,7 +1022,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1049,7 +1049,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1075,7 +1075,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1102,7 +1102,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1127,7 +1127,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1152,7 +1152,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1183,7 +1183,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1208,7 +1208,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1234,7 +1234,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1265,7 +1265,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1292,7 +1292,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1319,7 +1319,7 @@ describe("Compose", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/compress-pdf.test.ts b/tests/integration/compress-pdf.test.ts index bdbdcea4..82e7c3b5 100644 --- a/tests/integration/compress-pdf.test.ts +++ b/tests/integration/compress-pdf.test.ts @@ -26,7 +26,7 @@ describe.skipIf(!gsAvailable())("compress-pdf (requires gs)", () => { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/compress-pdf", + url: "/api/v1/tools/pdf/compress-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/compress-video.test.ts b/tests/integration/compress-video.test.ts index 3b7eabfc..f41ba604 100644 --- a/tests/integration/compress-video.test.ts +++ b/tests/integration/compress-video.test.ts @@ -37,7 +37,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/compress-video", + url: "/api/v1/tools/video/compress-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/compress.test.ts b/tests/integration/compress.test.ts index ad5a803f..67e13572 100644 --- a/tests/integration/compress.test.ts +++ b/tests/integration/compress.test.ts @@ -56,7 +56,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer ?? largeJpg, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/compress", + url: "/api/v1/tools/image/compress", payload, headers: { "content-type": contentType, @@ -251,7 +251,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compress", + url: "/api/v1/tools/image/compress", payload, headers: { "content-type": contentType, diff --git a/tests/integration/concurrent.test.ts b/tests/integration/concurrent.test.ts index 158f2b28..86ddc1d6 100644 --- a/tests/integration/concurrent.test.ts +++ b/tests/integration/concurrent.test.ts @@ -7,6 +7,7 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -47,7 +48,7 @@ function buildToolRequest( ]); return { method: "POST" as const, - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }; @@ -312,7 +313,7 @@ describe("Simultaneous batch + single requests — no corruption", () => { const [batchRes, singleRes] = await Promise.all([ app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": batchPayload.contentType, authorization: `Bearer ${adminToken}`, @@ -343,7 +344,7 @@ describe("Simultaneous batch + single requests — no corruption", () => { const [batchRes, rotateRes] = await Promise.all([ app.inject({ method: "POST", - url: "/api/v1/tools/compress/batch", + url: "/api/v1/tools/image/compress/batch", headers: { "content-type": batchPayload.contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/content-aware-resize.test.ts b/tests/integration/content-aware-resize.test.ts index 424720c8..ed2d995a 100644 --- a/tests/integration/content-aware-resize.test.ts +++ b/tests/integration/content-aware-resize.test.ts @@ -42,7 +42,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -61,7 +61,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -80,7 +80,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -101,7 +101,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -127,7 +127,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -152,7 +152,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -186,7 +186,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -211,7 +211,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -240,7 +240,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -262,7 +262,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -281,7 +281,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -307,7 +307,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -331,7 +331,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -361,7 +361,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -387,7 +387,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -418,7 +418,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -439,7 +439,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -463,7 +463,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -493,7 +493,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -515,7 +515,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -538,7 +538,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -560,7 +560,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -579,7 +579,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -598,7 +598,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -620,7 +620,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -638,7 +638,7 @@ describe("Content-Aware Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/convert-audio.test.ts b/tests/integration/convert-audio.test.ts index 45f2f60c..a40a41a9 100644 --- a/tests/integration/convert-audio.test.ts +++ b/tests/integration/convert-audio.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record, file = WAV, filename = ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/convert-audio", + url: "/api/v1/tools/audio/convert-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/convert-document.test.ts b/tests/integration/convert-document.test.ts index 4b5ae51a..8efe728e 100644 --- a/tests/integration/convert-document.test.ts +++ b/tests/integration/convert-document.test.ts @@ -31,7 +31,7 @@ async function runTool(filename: string, content: Buffer, settings: Record { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/convert-document", + url: "/api/v1/tools/files/convert-document", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/convert-formats.test.ts b/tests/integration/convert-formats.test.ts index e87ca009..e7706a63 100644 --- a/tests/integration/convert-formats.test.ts +++ b/tests/integration/convert-formats.test.ts @@ -2,7 +2,7 @@ * Comprehensive format conversion tests. * * Verifies that every supported input format can be converted to every - * supported output format via the /api/v1/tools/convert endpoint. + * supported output format via the /api/v1/tools/image/convert endpoint. * Also tests SVG-to-raster via the dedicated endpoint. */ @@ -115,7 +115,7 @@ afterAll(async () => { }, 10_000); // --------------------------------------------------------------------------- -// Raster-to-raster conversions via /api/v1/tools/convert +// Raster-to-raster conversions via /api/v1/tools/image/convert // --------------------------------------------------------------------------- describe("Format conversion matrix", () => { const rasterInputs = ["png", "jpg", "webp", "avif", "tiff", "gif", "heic"]; @@ -136,7 +136,7 @@ describe("Format conversion matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -158,7 +158,7 @@ describe("Format conversion matrix", () => { }); // --------------------------------------------------------------------------- -// SVG-to-raster conversions via /api/v1/tools/convert +// SVG-to-raster conversions via /api/v1/tools/image/convert // --------------------------------------------------------------------------- describe("SVG via convert tool", () => { for (const outputFmt of OUTPUT_FORMATS) { @@ -176,7 +176,7 @@ describe("SVG via convert tool", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -214,7 +214,7 @@ describe("SVG via dedicated svg-to-raster endpoint", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -253,7 +253,7 @@ describe("SVG via dedicated svg-to-raster endpoint", () => { ]); return app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -292,7 +292,7 @@ describe("SVG via dedicated svg-to-raster endpoint", () => { ]); return app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -330,7 +330,7 @@ describe("SVG via dedicated svg-to-raster endpoint", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -346,7 +346,7 @@ describe("SVG via dedicated svg-to-raster endpoint", () => { }); // --------------------------------------------------------------------------- -// Animated format preservation via /api/v1/tools/convert +// Animated format preservation via /api/v1/tools/image/convert // --------------------------------------------------------------------------- describe("Animated format preservation", () => { it("preserves animation when converting animated GIF to WebP", async () => { @@ -363,7 +363,7 @@ describe("Animated format preservation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -403,7 +403,7 @@ describe("Animated format preservation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/convert-presentation.test.ts b/tests/integration/convert-presentation.test.ts index fe7b7399..fb9eb9ff 100644 --- a/tests/integration/convert-presentation.test.ts +++ b/tests/integration/convert-presentation.test.ts @@ -30,7 +30,7 @@ async function runTool(filename: string, content: Buffer, settings: Record { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/convert-presentation", + url: "/api/v1/tools/files/convert-presentation", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/convert-spreadsheet.test.ts b/tests/integration/convert-spreadsheet.test.ts index 2b0373ba..8bcd2fd6 100644 --- a/tests/integration/convert-spreadsheet.test.ts +++ b/tests/integration/convert-spreadsheet.test.ts @@ -30,7 +30,7 @@ async function runTool(filename: string, content: Buffer, settings: Record { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/convert-spreadsheet", + url: "/api/v1/tools/files/convert-spreadsheet", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/convert-video.test.ts b/tests/integration/convert-video.test.ts index b08cecf0..0daf2cf0 100644 --- a/tests/integration/convert-video.test.ts +++ b/tests/integration/convert-video.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/convert-video", + url: "/api/v1/tools/video/convert-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -81,7 +81,7 @@ describe.skipIf(!ffmpegAvailable())("convert-video (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/convert-video", + url: "/api/v1/tools/video/convert-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/create-zip.test.ts b/tests/integration/create-zip.test.ts index 2128c719..17fbc3a8 100644 --- a/tests/integration/create-zip.test.ts +++ b/tests/integration/create-zip.test.ts @@ -27,7 +27,7 @@ describe("create-zip (pure JS, no skipIf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/create-zip", + url: "/api/v1/tools/files/create-zip", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -54,7 +54,7 @@ describe("create-zip (pure JS, no skipIf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/create-zip", + url: "/api/v1/tools/files/create-zip", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/crop-pdf.test.ts b/tests/integration/crop-pdf.test.ts index 245be94a..526a0533 100644 --- a/tests/integration/crop-pdf.test.ts +++ b/tests/integration/crop-pdf.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/crop-pdf", + url: "/api/v1/tools/pdf/crop-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/crop-video.test.ts b/tests/integration/crop-video.test.ts index 0e20e81b..9a9c7be0 100644 --- a/tests/integration/crop-video.test.ts +++ b/tests/integration/crop-video.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/crop-video", + url: "/api/v1/tools/video/crop-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/crop.test.ts b/tests/integration/crop.test.ts index 0c078a4e..7d34b9d7 100644 --- a/tests/integration/crop.test.ts +++ b/tests/integration/crop.test.ts @@ -46,7 +46,7 @@ async function cropAndMeta( const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -82,7 +82,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -140,7 +140,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -175,7 +175,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -211,7 +211,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -232,7 +232,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -253,7 +253,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -277,7 +277,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -301,7 +301,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -325,7 +325,7 @@ describe("Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/csv-excel.test.ts b/tests/integration/csv-excel.test.ts index 49094ebe..085bad82 100644 --- a/tests/integration/csv-excel.test.ts +++ b/tests/integration/csv-excel.test.ts @@ -27,7 +27,7 @@ async function runTool(filename: string, content: Buffer, settings: Record { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/duotone", + url: "/api/v1/tools/image/duotone", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -108,7 +108,7 @@ describe("Duotone", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/duotone", + url: "/api/v1/tools/image/duotone", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -144,7 +144,7 @@ describe("Duotone", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/duotone", + url: "/api/v1/tools/image/duotone", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -195,7 +195,7 @@ describe("Duotone", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/duotone", + url: "/api/v1/tools/image/duotone", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/edge-cases.test.ts b/tests/integration/edge-cases.test.ts index 43fc1787..e7bc7a64 100644 --- a/tests/integration/edge-cases.test.ts +++ b/tests/integration/edge-cases.test.ts @@ -46,7 +46,7 @@ describe("Zero-byte / empty file uploads", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -65,7 +65,7 @@ describe("Zero-byte / empty file uploads", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -86,7 +86,7 @@ describe("1x1 pixel image handling", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -102,7 +102,7 @@ describe("1x1 pixel image handling", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/crop", + url: "/api/v1/tools/image/crop", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -119,7 +119,7 @@ describe("1x1 pixel image handling", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -145,7 +145,7 @@ describe("Wrong file extension (magic byte detection)", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -168,7 +168,7 @@ describe("Extreme filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -184,7 +184,7 @@ describe("Extreme filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -205,7 +205,7 @@ describe("Extreme filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -226,7 +226,7 @@ describe("Extreme filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -251,7 +251,7 @@ describe("Settings field edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -270,7 +270,7 @@ describe("Settings field edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -288,7 +288,7 @@ describe("Settings field edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -308,7 +308,7 @@ describe("Settings field edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -330,7 +330,7 @@ describe("1x1 pixel image through additional tools", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compress", + url: "/api/v1/tools/image/compress", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -345,7 +345,7 @@ describe("1x1 pixel image through additional tools", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -365,7 +365,7 @@ describe("1x1 pixel image through additional tools", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -395,7 +395,7 @@ describe("Unicode and special filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -418,7 +418,7 @@ describe("Unicode and special filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -439,7 +439,7 @@ describe("Unicode and special filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -456,7 +456,7 @@ describe("Unicode and special filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -478,7 +478,7 @@ describe("Unicode and special filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -503,7 +503,7 @@ describe("Unicode and special filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -525,7 +525,7 @@ describe("Unicode and special filenames", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -538,14 +538,14 @@ describe("Unicode and special filenames", () => { // ZERO-BYTE FILES — ADDITIONAL TOOLS // ═══════════════════════════════════════════════════════════════════════════ describe("Zero-byte file to info and border tools", () => { - it("rejects a zero-byte file to /api/v1/tools/info with 400", async () => { + it("rejects a zero-byte file to /api/v1/tools/image/info with 400", async () => { const { body, contentType } = createMultipartPayload([ { name: "file", filename: "empty.png", content: Buffer.alloc(0), contentType: "image/png" }, ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -555,7 +555,7 @@ describe("Zero-byte file to info and border tools", () => { expect(json.error).toBeDefined(); }); - it("rejects a zero-byte file to /api/v1/tools/sharpening with 400", async () => { + it("rejects a zero-byte file to /api/v1/tools/image/sharpening with 400", async () => { const { body, contentType } = createMultipartPayload([ { name: "file", filename: "empty.png", content: Buffer.alloc(0), contentType: "image/png" }, { name: "settings", content: JSON.stringify({ method: "adaptive" }) }, @@ -563,7 +563,7 @@ describe("Zero-byte file to info and border tools", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sharpening", + url: "/api/v1/tools/image/sharpening", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -586,7 +586,7 @@ describe("1x1 pixel image through rotate with flip", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -603,7 +603,7 @@ describe("1x1 pixel image through rotate with flip", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -623,7 +623,7 @@ describe("Missing file part in multipart request", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -674,7 +674,7 @@ describe("Wrong extension — additional format mismatches", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -698,7 +698,7 @@ describe("Wrong extension — additional format mismatches", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -722,7 +722,7 @@ describe("Settings with extreme values", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -746,7 +746,7 @@ describe("Settings with extreme values", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); @@ -769,7 +769,7 @@ describe("Settings with extreme values", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}` }, body, }); diff --git a/tests/integration/edit-metadata.test.ts b/tests/integration/edit-metadata.test.ts index 55e474db..39ba3735 100644 --- a/tests/integration/edit-metadata.test.ts +++ b/tests/integration/edit-metadata.test.ts @@ -54,7 +54,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", payload, headers: { "content-type": contentType, @@ -289,7 +289,7 @@ describe("Inspect endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", payload, headers: { "content-type": contentType, @@ -314,7 +314,7 @@ describe("Inspect endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", payload, headers: { "content-type": contentType, @@ -333,7 +333,7 @@ describe("Inspect endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", payload, headers: { "content-type": contentType, @@ -371,7 +371,7 @@ describe("Write then inspect round-trip", () => { ]); const inspectRes = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", payload: inspectPayload, headers: { "content-type": inspectCt, @@ -393,7 +393,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", payload, headers: { "content-type": contentType, @@ -415,7 +415,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", payload, headers: { "content-type": contentType, @@ -437,7 +437,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", payload, headers: { "content-type": contentType, @@ -461,7 +461,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", payload, headers: { "content-type": contentType, @@ -485,7 +485,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", payload, headers: { "content-type": contentType, @@ -717,7 +717,7 @@ describe("Inspect endpoint edge cases", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", payload, headers: { "content-type": contentType, @@ -741,7 +741,7 @@ describe("Inspect endpoint edge cases", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", payload, headers: { "content-type": contentType, @@ -763,7 +763,7 @@ describe("Inspect endpoint edge cases", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", payload, headers: { "content-type": contentType, diff --git a/tests/integration/embed-subtitles.test.ts b/tests/integration/embed-subtitles.test.ts index 92a8815f..23e94b78 100644 --- a/tests/integration/embed-subtitles.test.ts +++ b/tests/integration/embed-subtitles.test.ts @@ -29,7 +29,7 @@ describe.skipIf(!ffmpegAvailable())("embed-subtitles (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/embed-subtitles", + url: "/api/v1/tools/video/embed-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -58,7 +58,7 @@ describe.skipIf(!ffmpegAvailable())("embed-subtitles (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/embed-subtitles", + url: "/api/v1/tools/video/embed-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/enhance-faces.test.ts b/tests/integration/enhance-faces.test.ts index fed93b8a..18048623 100644 --- a/tests/integration/enhance-faces.test.ts +++ b/tests/integration/enhance-faces.test.ts @@ -41,7 +41,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -56,7 +56,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -80,7 +80,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -99,7 +99,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -118,7 +118,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -137,7 +137,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -156,7 +156,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -174,7 +174,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -191,7 +191,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -212,7 +212,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -231,7 +231,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -250,7 +250,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -266,7 +266,7 @@ describe("enhance-faces", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/enhance-faces", + url: "/api/v1/tools/image/enhance-faces", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/epub-convert.test.ts b/tests/integration/epub-convert.test.ts index 30adae5a..8da7ee67 100644 --- a/tests/integration/epub-convert.test.ts +++ b/tests/integration/epub-convert.test.ts @@ -82,7 +82,7 @@ async function runTool(filename: string, content: Buffer, settings: Record { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -59,7 +59,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -82,7 +82,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -99,7 +99,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -118,7 +118,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -136,7 +136,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -153,7 +153,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -173,7 +173,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -195,7 +195,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -212,7 +212,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -228,7 +228,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { "content-type": contentType }, body, }); @@ -245,7 +245,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -262,7 +262,7 @@ describe("erase-object", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/excel-to-pdf.test.ts b/tests/integration/excel-to-pdf.test.ts index 0cc47e8d..03c3185d 100644 --- a/tests/integration/excel-to-pdf.test.ts +++ b/tests/integration/excel-to-pdf.test.ts @@ -30,7 +30,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/excel-to-pdf", + url: "/api/v1/tools/files/excel-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -73,7 +73,7 @@ it("rejects unsupported file types with 415", async () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/excel-to-pdf", + url: "/api/v1/tools/files/excel-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/extract-audio.test.ts b/tests/integration/extract-audio.test.ts index 239ca0a5..fd56191c 100644 --- a/tests/integration/extract-audio.test.ts +++ b/tests/integration/extract-audio.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/extract-audio", + url: "/api/v1/tools/video/extract-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/extract-pages.test.ts b/tests/integration/extract-pages.test.ts index 7d130c82..0d7351d0 100644 --- a/tests/integration/extract-pages.test.ts +++ b/tests/integration/extract-pages.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/extract-pages", + url: "/api/v1/tools/pdf/extract-pages", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/extract-subtitles.test.ts b/tests/integration/extract-subtitles.test.ts index ba2300bd..ff1c4c79 100644 --- a/tests/integration/extract-subtitles.test.ts +++ b/tests/integration/extract-subtitles.test.ts @@ -27,7 +27,7 @@ describe.skipIf(!ffmpegAvailable())("extract-subtitles (requires ffmpeg)", () => ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/extract-subtitles", + url: "/api/v1/tools/video/extract-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -50,7 +50,7 @@ describe.skipIf(!ffmpegAvailable())("extract-subtitles (requires ffmpeg)", () => ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/extract-subtitles", + url: "/api/v1/tools/video/extract-subtitles", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/extract-zip.test.ts b/tests/integration/extract-zip.test.ts index 59c682de..4c0107e9 100644 --- a/tests/integration/extract-zip.test.ts +++ b/tests/integration/extract-zip.test.ts @@ -52,7 +52,7 @@ async function runExtract(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/extract-zip", + url: "/api/v1/tools/files/extract-zip", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/factory-multi-input.test.ts b/tests/integration/factory-multi-input.test.ts index 494b0b07..24bbea03 100644 --- a/tests/integration/factory-multi-input.test.ts +++ b/tests/integration/factory-multi-input.test.ts @@ -163,7 +163,7 @@ describe("Factory multi-input (maxInputs)", () => { const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/fade-audio.test.ts b/tests/integration/fade-audio.test.ts index e4d14002..9b263a2c 100644 --- a/tests/integration/fade-audio.test.ts +++ b/tests/integration/fade-audio.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/fade-audio", + url: "/api/v1/tools/audio/fade-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/favicon.test.ts b/tests/integration/favicon.test.ts index 74dce0a2..f2ad7214 100644 --- a/tests/integration/favicon.test.ts +++ b/tests/integration/favicon.test.ts @@ -56,7 +56,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -87,7 +87,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -108,7 +108,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -130,7 +130,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -152,7 +152,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -172,7 +172,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -191,7 +191,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -220,7 +220,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -245,7 +245,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -266,7 +266,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -286,7 +286,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -320,7 +320,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -343,7 +343,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -362,7 +362,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -380,7 +380,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -401,7 +401,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -441,7 +441,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -470,7 +470,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -497,7 +497,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -524,7 +524,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -544,7 +544,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -565,7 +565,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { "content-type": contentType }, body, }); @@ -582,7 +582,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -608,7 +608,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -630,7 +630,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -651,7 +651,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -674,7 +674,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -695,7 +695,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -729,7 +729,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -753,7 +753,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -781,7 +781,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -806,7 +806,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -827,7 +827,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -869,7 +869,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -900,7 +900,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -935,7 +935,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -960,7 +960,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -983,7 +983,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1009,7 +1009,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1033,7 +1033,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1056,7 +1056,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1097,7 +1097,7 @@ describe("favicon", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/find-duplicates.test.ts b/tests/integration/find-duplicates.test.ts index 1f515532..1ae6aa6e 100644 --- a/tests/integration/find-duplicates.test.ts +++ b/tests/integration/find-duplicates.test.ts @@ -41,7 +41,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -75,7 +75,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -101,7 +101,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -128,7 +128,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -152,7 +152,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -175,7 +175,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -208,7 +208,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -229,7 +229,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { "content-type": contentType }, body, }); @@ -249,7 +249,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -276,7 +276,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -302,7 +302,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -327,7 +327,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -357,7 +357,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -390,7 +390,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -422,7 +422,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -444,7 +444,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -469,7 +469,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -487,7 +487,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -513,7 +513,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -547,7 +547,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -584,7 +584,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -609,7 +609,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -645,7 +645,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -671,7 +671,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -697,7 +697,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -723,7 +723,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -757,7 +757,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -785,7 +785,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -813,7 +813,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -840,7 +840,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -865,7 +865,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -892,7 +892,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -920,7 +920,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -946,7 +946,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -978,7 +978,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1006,7 +1006,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1031,7 +1031,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1057,7 +1057,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1090,7 +1090,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1127,7 +1127,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1163,7 +1163,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1184,7 +1184,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1210,7 +1210,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1238,7 +1238,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1264,7 +1264,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1291,7 +1291,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1321,7 +1321,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1354,7 +1354,7 @@ describe("Find Duplicates", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/flatten-pdf.test.ts b/tests/integration/flatten-pdf.test.ts index ba44b523..f4871b9d 100644 --- a/tests/integration/flatten-pdf.test.ts +++ b/tests/integration/flatten-pdf.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record = {}) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/flatten-pdf", + url: "/api/v1/tools/pdf/flatten-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/format-matrix-ai.test.ts b/tests/integration/format-matrix-ai.test.ts index 240f3742..f0d13abe 100644 --- a/tests/integration/format-matrix-ai.test.ts +++ b/tests/integration/format-matrix-ai.test.ts @@ -19,6 +19,7 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -340,9 +341,9 @@ const ACCEPTABLE_AI_CODES = [200, 202, 400, 422, 501]; */ function getToolUrl(toolId: string): string { if (toolId === "passport-photo") { - return "/api/v1/tools/passport-photo/analyze"; + return `${apiToolPath("passport-photo")}/analyze`; } - return `/api/v1/tools/${toolId}`; + return apiToolPath(toolId); } /** @@ -664,7 +665,7 @@ describe("Erase-object missing mask returns 400", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/erase-object", + url: "/api/v1/tools/image/erase-object", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -705,7 +706,7 @@ describe("Content-aware-resize without dimensions returns 400", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/content-aware-resize", + url: "/api/v1/tools/image/content-aware-resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/format-matrix-comprehensive.test.ts b/tests/integration/format-matrix-comprehensive.test.ts index 20907b0f..23f555cd 100644 --- a/tests/integration/format-matrix-comprehensive.test.ts +++ b/tests/integration/format-matrix-comprehensive.test.ts @@ -27,6 +27,7 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -256,7 +257,7 @@ async function callTool(toolId: string, fmt: FormatDef, settings: Record { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -685,7 +686,7 @@ describe("Image enhancement across all 16 primary formats", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -782,7 +783,7 @@ describe("Chained operations: resize then compress (core formats)", () => { const compressRes = await app.inject({ method: "POST", - url: "/api/v1/tools/compress", + url: "/api/v1/tools/image/compress", headers: { authorization: `Bearer ${adminToken}`, "content-type": compressCt, @@ -839,7 +840,7 @@ describe("Convert round-trip: format -> WebP -> PNG (core formats)", () => { const toPngRes = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": toPngCt, diff --git a/tests/integration/format-matrix-exotic.test.ts b/tests/integration/format-matrix-exotic.test.ts index 0928d1bb..3e93f79a 100644 --- a/tests/integration/format-matrix-exotic.test.ts +++ b/tests/integration/format-matrix-exotic.test.ts @@ -18,6 +18,7 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -110,7 +111,7 @@ async function callToolWithFile( return app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1267,7 +1268,7 @@ describe("Exotic formats with multi-file tools", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body: payload, }); @@ -1295,7 +1296,7 @@ describe("Exotic formats with multi-file tools", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body: payload, }); @@ -1323,7 +1324,7 @@ describe("Exotic formats with multi-file tools", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body: payload, }); diff --git a/tests/integration/format-matrix-expanded.test.ts b/tests/integration/format-matrix-expanded.test.ts index c53f84e8..04260a8a 100644 --- a/tests/integration/format-matrix-expanded.test.ts +++ b/tests/integration/format-matrix-expanded.test.ts @@ -256,7 +256,7 @@ describe("Color-blindness simulation cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-blindness", + url: "/api/v1/tools/image/color-blindness", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -324,7 +324,7 @@ describe("Beautify cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/beautify", + url: "/api/v1/tools/image/beautify", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -391,7 +391,7 @@ describe("Edit-metadata cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata", + url: "/api/v1/tools/image/edit-metadata", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -444,7 +444,7 @@ describe("Edit-metadata cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/edit-metadata/inspect", + url: "/api/v1/tools/image/edit-metadata/inspect", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -503,7 +503,7 @@ describe("Vectorize cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -564,7 +564,7 @@ describe("Split cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -604,7 +604,7 @@ describe("Split cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -645,7 +645,7 @@ describe("Favicon cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/favicon", + url: "/api/v1/tools/image/favicon", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -705,7 +705,7 @@ describe("Meme-generator cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -767,7 +767,7 @@ describe("Barcode-read cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/barcode-read", + url: "/api/v1/tools/image/barcode-read", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -831,7 +831,7 @@ describe("SVG-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -872,7 +872,7 @@ describe("SVG-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -914,7 +914,7 @@ describe("SVG-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -975,7 +975,7 @@ describe("Compose cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1030,7 +1030,7 @@ describe("Compose cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1091,7 +1091,7 @@ describe("Compose cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1142,7 +1142,7 @@ describe("Compare cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1191,7 +1191,7 @@ describe("Compare cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compare", + url: "/api/v1/tools/image/compare", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1252,7 +1252,7 @@ describe("Collage cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1306,7 +1306,7 @@ describe("Collage cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/collage", + url: "/api/v1/tools/image/collage", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1366,7 +1366,7 @@ describe("Stitch cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1420,7 +1420,7 @@ describe("Stitch cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1468,7 +1468,7 @@ describe("Transparency-fixer cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/transparency-fixer", + url: "/api/v1/tools/image/transparency-fixer", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1538,7 +1538,7 @@ describe("Color-blindness simulation types", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/color-blindness", + url: "/api/v1/tools/image/color-blindness", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1585,7 +1585,7 @@ describe("Vectorize color modes", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1624,7 +1624,7 @@ describe("Vectorize color modes", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1684,7 +1684,7 @@ describe("Compose blend modes", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compose", + url: "/api/v1/tools/image/compose", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1749,7 +1749,7 @@ describe("Stitch direction modes", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1804,7 +1804,7 @@ describe("Find-duplicates cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1856,7 +1856,7 @@ describe("Find-duplicates cross-format", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/find-duplicates", + url: "/api/v1/tools/image/find-duplicates", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1879,26 +1879,26 @@ describe("Find-duplicates cross-format", () => { // --------------------------------------------------------------------------- describe("Missing file returns 400 for expanded tools", () => { const TOOL_ENDPOINTS = [ - { url: "/api/v1/tools/color-blindness", settings: { simulationType: "deuteranomaly" } }, - { url: "/api/v1/tools/beautify", settings: { padding: 20 } }, - { url: "/api/v1/tools/edit-metadata", settings: { title: "test" } }, - { url: "/api/v1/tools/vectorize", settings: { colorMode: "bw" } }, - { url: "/api/v1/tools/split", settings: { columns: 2, rows: 2 } }, - { url: "/api/v1/tools/favicon", settings: {} }, + { url: "/api/v1/tools/image/color-blindness", settings: { simulationType: "deuteranomaly" } }, + { url: "/api/v1/tools/image/beautify", settings: { padding: 20 } }, + { url: "/api/v1/tools/image/edit-metadata", settings: { title: "test" } }, + { url: "/api/v1/tools/image/vectorize", settings: { colorMode: "bw" } }, + { url: "/api/v1/tools/image/split", settings: { columns: 2, rows: 2 } }, + { url: "/api/v1/tools/image/favicon", settings: {} }, { - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", settings: { textLayout: "top-bottom", textBoxes: [{ id: "top", text: "TEST" }], }, }, - { url: "/api/v1/tools/barcode-read", settings: { tryHarder: true } }, - { url: "/api/v1/tools/svg-to-raster", settings: { outputFormat: "png" } }, - { url: "/api/v1/tools/compose", settings: { x: 0, y: 0 } }, - { url: "/api/v1/tools/compare", settings: {} }, - { url: "/api/v1/tools/collage", settings: { templateId: "2-h-equal" } }, - { url: "/api/v1/tools/stitch", settings: { direction: "horizontal" } }, - { url: "/api/v1/tools/find-duplicates", settings: { threshold: 8 } }, + { url: "/api/v1/tools/image/barcode-read", settings: { tryHarder: true } }, + { url: "/api/v1/tools/image/svg-to-raster", settings: { outputFormat: "png" } }, + { url: "/api/v1/tools/image/compose", settings: { x: 0, y: 0 } }, + { url: "/api/v1/tools/image/compare", settings: {} }, + { url: "/api/v1/tools/image/collage", settings: { templateId: "2-h-equal" } }, + { url: "/api/v1/tools/image/stitch", settings: { direction: "horizontal" } }, + { url: "/api/v1/tools/image/find-duplicates", settings: { threshold: 8 } }, ]; for (const { url, settings } of TOOL_ENDPOINTS) { @@ -1936,21 +1936,21 @@ describe("Missing file returns 400 for expanded tools", () => { // --------------------------------------------------------------------------- describe("Unauthenticated requests return 401 for expanded tools", () => { const TOOL_ENDPOINTS = [ - "/api/v1/tools/color-blindness", - "/api/v1/tools/beautify", - "/api/v1/tools/edit-metadata", - "/api/v1/tools/vectorize", - "/api/v1/tools/split", - "/api/v1/tools/favicon", - "/api/v1/tools/meme-generator", - "/api/v1/tools/barcode-read", - "/api/v1/tools/svg-to-raster", - "/api/v1/tools/compose", - "/api/v1/tools/compare", - "/api/v1/tools/collage", - "/api/v1/tools/stitch", - "/api/v1/tools/find-duplicates", - "/api/v1/tools/transparency-fixer", + "/api/v1/tools/image/color-blindness", + "/api/v1/tools/image/beautify", + "/api/v1/tools/image/edit-metadata", + "/api/v1/tools/image/vectorize", + "/api/v1/tools/image/split", + "/api/v1/tools/image/favicon", + "/api/v1/tools/image/meme-generator", + "/api/v1/tools/image/barcode-read", + "/api/v1/tools/image/svg-to-raster", + "/api/v1/tools/image/compose", + "/api/v1/tools/image/compare", + "/api/v1/tools/image/collage", + "/api/v1/tools/image/stitch", + "/api/v1/tools/image/find-duplicates", + "/api/v1/tools/image/transparency-fixer", ]; for (const url of TOOL_ENDPOINTS) { diff --git a/tests/integration/format-matrix-generated.test.ts b/tests/integration/format-matrix-generated.test.ts index 43f2f1d1..3c3a3c9f 100644 --- a/tests/integration/format-matrix-generated.test.ts +++ b/tests/integration/format-matrix-generated.test.ts @@ -1,6 +1,6 @@ import { readdirSync, readFileSync } from "node:fs"; import { join } from "node:path"; -import { TOOLS } from "@snapotter/shared"; +import { apiToolPath, TOOLS } from "@snapotter/shared"; import sharp from "sharp"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { getRegisteredToolIds, getToolConfig } from "../../apps/api/src/routes/tool-factory.js"; @@ -93,7 +93,7 @@ describe("tool x format matrix (generated)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/format-matrix-multimodal.test.ts b/tests/integration/format-matrix-multimodal.test.ts index 7b7dfd23..a2b7c095 100644 --- a/tests/integration/format-matrix-multimodal.test.ts +++ b/tests/integration/format-matrix-multimodal.test.ts @@ -1,6 +1,6 @@ import { existsSync, readdirSync, readFileSync } from "node:fs"; import { extname, join } from "node:path"; -import { TOOL_BUNDLE_MAP, TOOLS } from "@snapotter/shared"; +import { apiToolPath, TOOL_BUNDLE_MAP, TOOLS } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { defaultSettingsFor } from "../helpers/tool-default-settings.js"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -211,7 +211,7 @@ describe("multi-modality tool x format matrix", () => { const { body, contentType } = createMultipartPayload(fields); const res = await testApp.app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/format-matrix.test.ts b/tests/integration/format-matrix.test.ts index c1957ea9..be6db9a4 100644 --- a/tests/integration/format-matrix.test.ts +++ b/tests/integration/format-matrix.test.ts @@ -18,6 +18,7 @@ import { existsSync, readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -517,7 +518,7 @@ describe("Cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: `/api/v1/tools/${tool.id}`, + url: apiToolPath(tool.id), headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -639,7 +640,7 @@ describe("Multipage TIFF handling", () => { const res = await app.inject({ method: "POST", - url: `/api/v1/tools/${tool.id}`, + url: apiToolPath(tool.id), headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -720,7 +721,7 @@ describe("Cross-format conversion matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -765,7 +766,7 @@ describe("Exotic format error resilience", () => { const res = await app.inject({ method: "POST", - url: `/api/v1/tools/${tool.id}`, + url: apiToolPath(tool.id), headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -816,7 +817,7 @@ describe("Image enhancement analysis across formats", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -853,7 +854,7 @@ describe("Image enhancement analysis across formats", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -899,7 +900,7 @@ describe("Strip-metadata inspection across formats", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -966,7 +967,7 @@ describe("Watermark-image cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1036,7 +1037,7 @@ describe("Watermark-image cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1105,7 +1106,7 @@ describe("Watermark-image cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1161,7 +1162,7 @@ describe("Image-to-PDF cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1233,7 +1234,7 @@ describe("Image-to-PDF cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1292,7 +1293,7 @@ describe("Image-to-PDF cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1331,7 +1332,7 @@ describe("Image-to-PDF cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1377,7 +1378,7 @@ describe("Image-to-PDF cross-format matrix", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1439,7 +1440,7 @@ describe("Watermark-image exotic format error resilience", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1490,7 +1491,7 @@ describe("Watermark-image exotic format error resilience", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/gif-to-video.test.ts b/tests/integration/gif-to-video.test.ts index d59a5be4..6048c502 100644 --- a/tests/integration/gif-to-video.test.ts +++ b/tests/integration/gif-to-video.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/gif-to-video", + url: "/api/v1/tools/video/gif-to-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/gif-tools.test.ts b/tests/integration/gif-tools.test.ts index 33f0dc80..b1314689 100644 --- a/tests/integration/gif-tools.test.ts +++ b/tests/integration/gif-tools.test.ts @@ -43,7 +43,7 @@ function makePayload(settings: Record, buffer?: Buffer, filenam } // ── Metadata endpoint ───────────────────────────────────────────── -describe("POST /api/v1/tools/gif-tools/info", () => { +describe("POST /api/v1/tools/image/gif-tools/info", () => { it("returns metadata for an animated GIF", async () => { const { body: payload, contentType } = createMultipartPayload([ { @@ -56,7 +56,7 @@ describe("POST /api/v1/tools/gif-tools/info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools/info", + url: "/api/v1/tools/image/gif-tools/info", payload, headers: { "content-type": contentType, @@ -87,7 +87,7 @@ describe("POST /api/v1/tools/gif-tools/info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools/info", + url: "/api/v1/tools/image/gif-tools/info", payload, headers: { "content-type": contentType, @@ -111,7 +111,7 @@ describe("Resize mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -133,7 +133,7 @@ describe("Resize mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -159,7 +159,7 @@ describe("Optimize mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -183,7 +183,7 @@ describe("Speed mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -216,7 +216,7 @@ describe("Reverse mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -250,7 +250,7 @@ describe("Extract mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -272,7 +272,7 @@ describe("Extract mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -296,7 +296,7 @@ describe("Extract mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -320,7 +320,7 @@ describe("Rotate mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -341,7 +341,7 @@ describe("Rotate mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -360,7 +360,7 @@ describe("Rotate mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -379,7 +379,7 @@ describe("Rotate mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -398,7 +398,7 @@ describe("Rotate mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -419,7 +419,7 @@ describe("Rotate mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -441,7 +441,7 @@ describe("Rotate mode", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -463,7 +463,7 @@ describe("Reverse mode with speed adjustment", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -487,7 +487,7 @@ describe("Reverse mode with speed adjustment", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -511,7 +511,7 @@ describe("Extract mode additional tests", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -535,7 +535,7 @@ describe("Extract mode additional tests", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -559,7 +559,7 @@ describe("Speed mode edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -593,7 +593,7 @@ describe("Resize mode edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -613,7 +613,7 @@ describe("Resize mode edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -631,7 +631,7 @@ describe("Resize mode edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -652,7 +652,7 @@ describe("Metadata endpoint edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools/info", + url: "/api/v1/tools/image/gif-tools/info", payload, headers: { "content-type": contentType, @@ -674,7 +674,7 @@ describe("Loop count", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -695,7 +695,7 @@ describe("Validation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -714,7 +714,7 @@ describe("Validation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -732,7 +732,7 @@ describe("Validation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -752,7 +752,7 @@ describe("Validation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -768,7 +768,7 @@ describe("Validation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType }, }); @@ -787,7 +787,7 @@ describe("Response structure", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -818,7 +818,7 @@ describe("Optimize mode parameter variations", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -838,7 +838,7 @@ describe("Optimize mode parameter variations", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -857,7 +857,7 @@ describe("Optimize mode parameter variations", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -879,7 +879,7 @@ describe("Speed mode boundary values", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -898,7 +898,7 @@ describe("Speed mode boundary values", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -922,7 +922,7 @@ describe("Extract format edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -942,7 +942,7 @@ describe("Extract format edge cases", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -968,7 +968,7 @@ describe("Content animated GIF (animated-simpsons.gif)", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -989,7 +989,7 @@ describe("Content animated GIF (animated-simpsons.gif)", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools/info", + url: "/api/v1/tools/image/gif-tools/info", payload, headers: { "content-type": contentType, @@ -1018,7 +1018,7 @@ describe("Rotate angle validation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -1037,7 +1037,7 @@ describe("Rotate angle validation", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, @@ -1059,7 +1059,7 @@ describe("Resize output dimension verification", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-tools", + url: "/api/v1/tools/image/gif-tools", payload, headers: { "content-type": contentType, diff --git a/tests/integration/gif-webp.test.ts b/tests/integration/gif-webp.test.ts index 50c43a47..9f5c9f3c 100644 --- a/tests/integration/gif-webp.test.ts +++ b/tests/integration/gif-webp.test.ts @@ -40,7 +40,7 @@ describe("GIF/WebP Converter", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-webp", + url: "/api/v1/tools/image/gif-webp", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -70,7 +70,7 @@ describe("GIF/WebP Converter", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-webp", + url: "/api/v1/tools/image/gif-webp", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -109,7 +109,7 @@ describe("GIF/WebP Converter", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-webp", + url: "/api/v1/tools/image/gif-webp", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -139,7 +139,7 @@ describe("GIF/WebP Converter", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-webp", + url: "/api/v1/tools/image/gif-webp", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -160,7 +160,7 @@ describe("GIF/WebP Converter", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/gif-webp", + url: "/api/v1/tools/image/gif-webp", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/grayscale-pdf.test.ts b/tests/integration/grayscale-pdf.test.ts index d0e5539f..55c551d8 100644 --- a/tests/integration/grayscale-pdf.test.ts +++ b/tests/integration/grayscale-pdf.test.ts @@ -25,7 +25,7 @@ async function runTool() { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/grayscale-pdf", + url: "/api/v1/tools/pdf/grayscale-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/histogram.test.ts b/tests/integration/histogram.test.ts index 52309a4c..cd6ef791 100644 --- a/tests/integration/histogram.test.ts +++ b/tests/integration/histogram.test.ts @@ -37,7 +37,7 @@ describe("Histogram", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/histogram", + url: "/api/v1/tools/image/histogram", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -99,7 +99,7 @@ describe("Histogram", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/histogram", + url: "/api/v1/tools/image/histogram", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/hostile-inputs.test.ts b/tests/integration/hostile-inputs.test.ts index 452ba7b0..18cb9df4 100644 --- a/tests/integration/hostile-inputs.test.ts +++ b/tests/integration/hostile-inputs.test.ts @@ -1,6 +1,6 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; -import { TOOLS } from "@snapotter/shared"; +import { apiToolPath, TOOLS } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { TOOL_DISPLAY_MODES } from "../../apps/web/src/lib/tool-display-modes.js"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -63,7 +63,7 @@ describe("hostile input matrix", () => { const started = Date.now(); const res = await testApp.app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/html-to-image.test.ts b/tests/integration/html-to-image.test.ts index 6d702289..9e133e2d 100644 --- a/tests/integration/html-to-image.test.ts +++ b/tests/integration/html-to-image.test.ts @@ -61,7 +61,7 @@ afterAll(async () => { function post(payload: Record, token?: string) { return app.inject({ method: "POST", - url: "/api/v1/tools/html-to-image", + url: "/api/v1/tools/image/html-to-image", headers: { ...(token ? { authorization: `Bearer ${token}` } : {}), "content-type": "application/json", diff --git a/tests/integration/html-to-pdf.test.ts b/tests/integration/html-to-pdf.test.ts index 00b8d62a..8be728c8 100644 --- a/tests/integration/html-to-pdf.test.ts +++ b/tests/integration/html-to-pdf.test.ts @@ -32,7 +32,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/html-to-pdf", + url: "/api/v1/tools/files/html-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/image-enhancement.test.ts b/tests/integration/image-enhancement.test.ts index 837cebe3..e5c58e9a 100644 --- a/tests/integration/image-enhancement.test.ts +++ b/tests/integration/image-enhancement.test.ts @@ -57,7 +57,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement", + url: "/api/v1/tools/image/image-enhancement", payload, headers: { "content-type": contentType, @@ -262,7 +262,7 @@ describe("Analyze endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -282,7 +282,7 @@ describe("Analyze endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -351,7 +351,7 @@ describe("Analyze endpoint details", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -371,7 +371,7 @@ describe("Analyze endpoint details", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -434,7 +434,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement", + url: "/api/v1/tools/image/image-enhancement", payload, headers: { "content-type": contentType, @@ -466,7 +466,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement", + url: "/api/v1/tools/image/image-enhancement", payload, headers: { "content-type": contentType, @@ -485,7 +485,7 @@ describe("Analyze endpoint HEIC handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -514,7 +514,7 @@ describe("Analyze endpoint invalid image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -537,7 +537,7 @@ describe("Analyze endpoint invalid image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -719,7 +719,7 @@ describe("Authentication", () => { const { body: payload, contentType } = makePayload({ mode: "auto" }); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement", + url: "/api/v1/tools/image/image-enhancement", payload, headers: { "content-type": contentType }, }); @@ -921,7 +921,7 @@ describe("Analyze endpoint format coverage", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -947,7 +947,7 @@ describe("Analyze endpoint format coverage", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -1201,7 +1201,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/batch", + url: "/api/v1/tools/image/image-enhancement/batch", payload, headers: { "content-type": contentType, @@ -1231,7 +1231,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/batch", + url: "/api/v1/tools/image/image-enhancement/batch", payload, headers: { "content-type": contentType, @@ -1251,7 +1251,7 @@ describe("Analyze endpoint response structure", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, @@ -1311,7 +1311,7 @@ describe("Low-light image analysis", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-enhancement/analyze", + url: "/api/v1/tools/image/image-enhancement/analyze", payload, headers: { "content-type": contentType, diff --git a/tests/integration/image-pad.test.ts b/tests/integration/image-pad.test.ts index 6eca604a..92502fb3 100644 --- a/tests/integration/image-pad.test.ts +++ b/tests/integration/image-pad.test.ts @@ -55,7 +55,7 @@ describe("Image Pad", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-pad", + url: "/api/v1/tools/image/image-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -88,7 +88,7 @@ describe("Image Pad", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-pad", + url: "/api/v1/tools/image/image-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -125,7 +125,7 @@ describe("Image Pad", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-pad", + url: "/api/v1/tools/image/image-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -144,7 +144,7 @@ describe("Image Pad", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-pad", + url: "/api/v1/tools/image/image-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -177,7 +177,7 @@ describe("Image Pad", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-pad", + url: "/api/v1/tools/image/image-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -213,7 +213,7 @@ describe("Image Pad", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-pad", + url: "/api/v1/tools/image/image-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -246,7 +246,7 @@ describe("Image Pad", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-pad", + url: "/api/v1/tools/image/image-pad", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/image-to-base64.test.ts b/tests/integration/image-to-base64.test.ts index 74379585..fee4fe0c 100644 --- a/tests/integration/image-to-base64.test.ts +++ b/tests/integration/image-to-base64.test.ts @@ -37,7 +37,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -68,7 +68,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -92,7 +92,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -112,7 +112,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -131,7 +131,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -149,7 +149,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -166,7 +166,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -184,7 +184,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -203,7 +203,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -223,7 +223,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -243,7 +243,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -263,7 +263,7 @@ describe("image-to-base64", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -284,7 +284,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -305,7 +305,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -327,7 +327,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -348,7 +348,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -372,7 +372,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -389,7 +389,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -409,7 +409,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -431,7 +431,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -454,7 +454,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -476,7 +476,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -499,7 +499,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -520,7 +520,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -543,7 +543,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -565,7 +565,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -585,7 +585,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -607,7 +607,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -627,7 +627,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -653,7 +653,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -680,7 +680,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -701,7 +701,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { "content-type": contentType }, body, }); @@ -723,7 +723,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -745,7 +745,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -765,7 +765,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -785,7 +785,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -804,7 +804,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -826,7 +826,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -849,7 +849,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -873,7 +873,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -894,7 +894,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -912,7 +912,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -935,7 +935,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -959,7 +959,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -980,7 +980,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1007,7 +1007,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1033,7 +1033,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1056,7 +1056,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1077,7 +1077,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1098,7 +1098,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1118,7 +1118,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1138,7 +1138,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1158,7 +1158,7 @@ describe("image-to-base64", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-base64", + url: "/api/v1/tools/image/image-to-base64", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/image-to-pdf.test.ts b/tests/integration/image-to-pdf.test.ts index be1df940..10b94c38 100644 --- a/tests/integration/image-to-pdf.test.ts +++ b/tests/integration/image-to-pdf.test.ts @@ -38,7 +38,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -59,7 +59,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -87,7 +87,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -105,7 +105,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -121,7 +121,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -137,7 +137,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -152,7 +152,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -170,7 +170,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -186,7 +186,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -204,7 +204,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -225,7 +225,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -246,7 +246,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -283,7 +283,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -304,7 +304,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -325,7 +325,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -349,7 +349,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -368,7 +368,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -391,7 +391,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -435,7 +435,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -458,7 +458,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -479,7 +479,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -498,7 +498,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -518,7 +518,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -538,7 +538,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -559,7 +559,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -580,7 +580,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -601,7 +601,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -628,7 +628,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -656,7 +656,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -676,7 +676,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { "content-type": contentType }, body, }); @@ -700,7 +700,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -729,7 +729,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -753,7 +753,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -777,7 +777,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -799,7 +799,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -821,7 +821,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -847,7 +847,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -867,7 +867,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -889,7 +889,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -907,7 +907,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -927,7 +927,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -948,7 +948,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -972,7 +972,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -990,7 +990,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1015,7 +1015,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1055,7 +1055,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1081,7 +1081,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1107,7 +1107,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1135,7 +1135,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1168,7 +1168,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1194,7 +1194,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1223,7 +1223,7 @@ describe("image-to-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/image-to-pdf", + url: "/api/v1/tools/image/image-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/images-to-video.test.ts b/tests/integration/images-to-video.test.ts index 8553310e..da6ecab3 100644 --- a/tests/integration/images-to-video.test.ts +++ b/tests/integration/images-to-video.test.ts @@ -29,7 +29,7 @@ describe.skipIf(!ffmpegAvailable())("images-to-video (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/images-to-video", + url: "/api/v1/tools/video/images-to-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -66,7 +66,7 @@ describe.skipIf(!ffmpegAvailable())("images-to-video (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/images-to-video", + url: "/api/v1/tools/video/images-to-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/info.test.ts b/tests/integration/info.test.ts index 543abf7f..91fedb6b 100644 --- a/tests/integration/info.test.ts +++ b/tests/integration/info.test.ts @@ -39,7 +39,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -68,7 +68,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -92,7 +92,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -115,7 +115,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -142,7 +142,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -164,7 +164,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -197,7 +197,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -241,7 +241,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -261,7 +261,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { "content-type": contentType }, body, }); @@ -279,7 +279,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -306,7 +306,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -329,7 +329,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -355,7 +355,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -374,7 +374,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -399,7 +399,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -422,7 +422,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -447,7 +447,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -473,7 +473,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -497,7 +497,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -521,7 +521,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -550,7 +550,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -574,7 +574,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -597,7 +597,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -623,7 +623,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -651,7 +651,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -674,7 +674,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -702,7 +702,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -728,7 +728,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -752,7 +752,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -775,7 +775,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -797,7 +797,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -827,7 +827,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -852,7 +852,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -876,7 +876,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -898,7 +898,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -925,7 +925,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -964,7 +964,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -990,7 +990,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1022,7 +1022,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1053,7 +1053,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1082,7 +1082,7 @@ describe("Info", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/info", + url: "/api/v1/tools/image/info", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/json-xml.test.ts b/tests/integration/json-xml.test.ts index bfb9ea44..6cad06f1 100644 --- a/tests/integration/json-xml.test.ts +++ b/tests/integration/json-xml.test.ts @@ -25,7 +25,7 @@ async function runTool(filename: string, content: Buffer, settings: Record { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/lqip-placeholder", + url: "/api/v1/tools/image/lqip-placeholder", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -63,7 +63,7 @@ describe("LQIP Placeholder", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/lqip-placeholder", + url: "/api/v1/tools/image/lqip-placeholder", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -85,7 +85,7 @@ describe("LQIP Placeholder", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/lqip-placeholder", + url: "/api/v1/tools/image/lqip-placeholder", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -112,7 +112,7 @@ describe("LQIP Placeholder", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/lqip-placeholder", + url: "/api/v1/tools/image/lqip-placeholder", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/markdown-to-docx.test.ts b/tests/integration/markdown-to-docx.test.ts index 96dd3c87..c5cf81f3 100644 --- a/tests/integration/markdown-to-docx.test.ts +++ b/tests/integration/markdown-to-docx.test.ts @@ -30,7 +30,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/markdown-to-docx", + url: "/api/v1/tools/files/markdown-to-docx", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -65,7 +65,7 @@ it("rejects unsupported file types with 415", async () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/markdown-to-docx", + url: "/api/v1/tools/files/markdown-to-docx", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/markdown-to-html.test.ts b/tests/integration/markdown-to-html.test.ts index 5cf5b183..bd3db2bf 100644 --- a/tests/integration/markdown-to-html.test.ts +++ b/tests/integration/markdown-to-html.test.ts @@ -30,7 +30,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/markdown-to-html", + url: "/api/v1/tools/files/markdown-to-html", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -65,7 +65,7 @@ it("rejects unsupported file types with 415", async () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/markdown-to-html", + url: "/api/v1/tools/files/markdown-to-html", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/markdown-to-pdf.test.ts b/tests/integration/markdown-to-pdf.test.ts index c9b683d9..5876af1e 100644 --- a/tests/integration/markdown-to-pdf.test.ts +++ b/tests/integration/markdown-to-pdf.test.ts @@ -32,7 +32,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/markdown-to-pdf", + url: "/api/v1/tools/files/markdown-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/meme-generator.test.ts b/tests/integration/meme-generator.test.ts index 92a89618..6ab4df66 100644 --- a/tests/integration/meme-generator.test.ts +++ b/tests/integration/meme-generator.test.ts @@ -72,7 +72,7 @@ describe("Meme Generator", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -108,7 +108,7 @@ describe("Meme Generator", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -128,7 +128,7 @@ describe("Meme Generator", () => { it("invalid templateId returns 400", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -149,7 +149,7 @@ describe("Meme Generator", () => { it("neither templateId nor file returns 400", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -169,7 +169,7 @@ describe("Meme Generator", () => { it("empty text boxes returns 200 (image without text)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -201,7 +201,7 @@ describe("Meme Generator", () => { it(`font family "${font}" returns 200`, async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -255,7 +255,7 @@ describe("Meme Generator", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -275,7 +275,7 @@ describe("Meme Generator", () => { it("rejects unauthenticated requests", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { "content-type": "application/json", }, @@ -292,7 +292,7 @@ describe("Meme Generator", () => { it("returns all expected fields in template mode response", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -336,7 +336,7 @@ describe("Meme Generator", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -354,7 +354,7 @@ describe("Meme Generator", () => { it("accepts custom fontSize parameter", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -376,7 +376,7 @@ describe("Meme Generator", () => { it("accepts custom textColor and strokeColor", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -401,7 +401,7 @@ describe("Meme Generator", () => { it("accepts text alignment left", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -422,7 +422,7 @@ describe("Meme Generator", () => { it("accepts text alignment right", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -444,7 +444,7 @@ describe("Meme Generator", () => { it("accepts allCaps=false (lowercase text)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -466,7 +466,7 @@ describe("Meme Generator", () => { it("accepts roboto font family", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -493,7 +493,7 @@ describe("Meme Generator", () => { it("rejects invalid font family", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -527,7 +527,7 @@ describe("Meme Generator", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -542,7 +542,7 @@ describe("Meme Generator", () => { it("handles special characters in meme text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -576,7 +576,7 @@ describe("Meme Generator", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -595,7 +595,7 @@ describe("Meme Generator", () => { it("accepts minimum fontSize (8)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -616,7 +616,7 @@ describe("Meme Generator", () => { it("accepts maximum fontSize (200)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -637,7 +637,7 @@ describe("Meme Generator", () => { it("rejects fontSize below minimum (7)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -655,7 +655,7 @@ describe("Meme Generator", () => { it("rejects fontSize above maximum (201)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/meme-generator", + url: "/api/v1/tools/image/meme-generator", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", diff --git a/tests/integration/merge-audio.test.ts b/tests/integration/merge-audio.test.ts index cdea1cb3..49913530 100644 --- a/tests/integration/merge-audio.test.ts +++ b/tests/integration/merge-audio.test.ts @@ -29,7 +29,7 @@ describe.skipIf(!ffmpegAvailable())("merge-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-audio", + url: "/api/v1/tools/audio/merge-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -58,7 +58,7 @@ describe.skipIf(!ffmpegAvailable())("merge-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-audio", + url: "/api/v1/tools/audio/merge-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/merge-csvs.test.ts b/tests/integration/merge-csvs.test.ts index 9dace0f3..471b88f7 100644 --- a/tests/integration/merge-csvs.test.ts +++ b/tests/integration/merge-csvs.test.ts @@ -27,7 +27,7 @@ describe("merge-csvs (pure JS, no skipIf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-csvs", + url: "/api/v1/tools/files/merge-csvs", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -56,7 +56,7 @@ describe("merge-csvs (pure JS, no skipIf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-csvs", + url: "/api/v1/tools/files/merge-csvs", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -73,7 +73,7 @@ describe("merge-csvs (pure JS, no skipIf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-csvs", + url: "/api/v1/tools/files/merge-csvs", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/merge-pdf.test.ts b/tests/integration/merge-pdf.test.ts index 358f5795..49f6aa26 100644 --- a/tests/integration/merge-pdf.test.ts +++ b/tests/integration/merge-pdf.test.ts @@ -29,7 +29,7 @@ describe.skipIf(!qpdfAvailable())("merge-pdf (requires qpdf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-pdf", + url: "/api/v1/tools/pdf/merge-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -63,7 +63,7 @@ describe.skipIf(!qpdfAvailable())("merge-pdf (requires qpdf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-pdf", + url: "/api/v1/tools/pdf/merge-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/merge-videos.test.ts b/tests/integration/merge-videos.test.ts index 609858ec..1ba9e25f 100644 --- a/tests/integration/merge-videos.test.ts +++ b/tests/integration/merge-videos.test.ts @@ -67,7 +67,7 @@ describe.skipIf(!ffmpegAvailable())("merge-videos (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-videos", + url: "/api/v1/tools/video/merge-videos", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -105,7 +105,7 @@ describe.skipIf(!ffmpegAvailable())("merge-videos (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/merge-videos", + url: "/api/v1/tools/video/merge-videos", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/mute-video.test.ts b/tests/integration/mute-video.test.ts index f14bed4e..aecb5c78 100644 --- a/tests/integration/mute-video.test.ts +++ b/tests/integration/mute-video.test.ts @@ -26,7 +26,7 @@ describe.skipIf(!ffmpegAvailable())("mute-video (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/mute-video", + url: "/api/v1/tools/video/mute-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -48,7 +48,7 @@ describe.skipIf(!ffmpegAvailable())("mute-video (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/mute-video", + url: "/api/v1/tools/video/mute-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/new-formats.test.ts b/tests/integration/new-formats.test.ts index af1ff819..6903b9b4 100644 --- a/tests/integration/new-formats.test.ts +++ b/tests/integration/new-formats.test.ts @@ -59,7 +59,7 @@ describe("New format support", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -98,7 +98,7 @@ describe("New format support", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -135,7 +135,7 @@ describe("New format support", () => { ]); return app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -190,7 +190,7 @@ describe("New format support", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/convert", + url: "/api/v1/tools/image/convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -232,7 +232,7 @@ describe("New format support", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/noise-reduction.test.ts b/tests/integration/noise-reduction.test.ts index 0590f289..e6ed10d0 100644 --- a/tests/integration/noise-reduction.test.ts +++ b/tests/integration/noise-reduction.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/noise-reduction", + url: "/api/v1/tools/audio/noise-reduction", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/noise-removal.test.ts b/tests/integration/noise-removal.test.ts index b641efa7..1f23c67d 100644 --- a/tests/integration/noise-removal.test.ts +++ b/tests/integration/noise-removal.test.ts @@ -41,7 +41,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -56,7 +56,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -80,7 +80,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -99,7 +99,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -118,7 +118,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -144,7 +144,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -163,7 +163,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -181,7 +181,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -198,7 +198,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -219,7 +219,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -238,7 +238,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -257,7 +257,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -273,7 +273,7 @@ describe("noise-removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/noise-removal", + url: "/api/v1/tools/image/noise-removal", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/normalize-audio.test.ts b/tests/integration/normalize-audio.test.ts index 67701201..64c3b019 100644 --- a/tests/integration/normalize-audio.test.ts +++ b/tests/integration/normalize-audio.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/normalize-audio", + url: "/api/v1/tools/audio/normalize-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/nup-pdf.test.ts b/tests/integration/nup-pdf.test.ts index 11f3a6b3..a5b89362 100644 --- a/tests/integration/nup-pdf.test.ts +++ b/tests/integration/nup-pdf.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/nup-pdf", + url: "/api/v1/tools/pdf/nup-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/ocr-pdf.test.ts b/tests/integration/ocr-pdf.test.ts index 665a119c..2cf1399a 100644 --- a/tests/integration/ocr-pdf.test.ts +++ b/tests/integration/ocr-pdf.test.ts @@ -46,7 +46,7 @@ describe("ocr-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr-pdf", + url: "/api/v1/tools/pdf/ocr-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -77,7 +77,7 @@ describe("ocr-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr-pdf", + url: "/api/v1/tools/pdf/ocr-pdf", headers: { "content-type": contentType }, body, }); @@ -103,7 +103,7 @@ describe("ocr-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr-pdf", + url: "/api/v1/tools/pdf/ocr-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -139,7 +139,7 @@ describe("ocr-pdf", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr-pdf", + url: "/api/v1/tools/pdf/ocr-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/ocr.test.ts b/tests/integration/ocr.test.ts index 7b21047e..688921fc 100644 --- a/tests/integration/ocr.test.ts +++ b/tests/integration/ocr.test.ts @@ -41,7 +41,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -56,7 +56,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -81,7 +81,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -100,7 +100,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -119,7 +119,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -138,7 +138,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -157,7 +157,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -175,7 +175,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -192,7 +192,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -213,7 +213,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -232,7 +232,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -251,7 +251,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -267,7 +267,7 @@ describe("ocr", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/ocr", + url: "/api/v1/tools/image/ocr", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/optimize-for-web.test.ts b/tests/integration/optimize-for-web.test.ts index 6e10f362..e0c5306a 100644 --- a/tests/integration/optimize-for-web.test.ts +++ b/tests/integration/optimize-for-web.test.ts @@ -54,7 +54,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web", + url: "/api/v1/tools/image/optimize-for-web", payload, headers: { "content-type": contentType, @@ -245,7 +245,7 @@ describe("Preview endpoint", () => { const { body: payload, contentType } = makePayload({ format: "webp", quality: 60 }); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -269,7 +269,7 @@ describe("Preview endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -400,7 +400,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web", + url: "/api/v1/tools/image/optimize-for-web", payload, headers: { "content-type": contentType, @@ -442,7 +442,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web", + url: "/api/v1/tools/image/optimize-for-web", payload, headers: { "content-type": contentType, @@ -462,7 +462,7 @@ describe("Preview endpoint SVG handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -485,7 +485,7 @@ describe("Preview endpoint HEIC handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -509,7 +509,7 @@ describe("Preview endpoint validation", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -528,7 +528,7 @@ describe("Preview endpoint validation", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -552,7 +552,7 @@ describe("Preview endpoint validation", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -570,7 +570,7 @@ describe("Preview endpoint validation", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -588,7 +588,7 @@ describe("Preview endpoint validation", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -669,7 +669,7 @@ describe("Preview endpoint format variations", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -690,7 +690,7 @@ describe("Preview endpoint format variations", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -710,7 +710,7 @@ describe("Preview endpoint format variations", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/preview", + url: "/api/v1/tools/image/optimize-for-web/preview", payload, headers: { "content-type": contentType, @@ -729,7 +729,7 @@ describe("Authentication", () => { const { body: payload, contentType } = makePayload({ format: "webp" }); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web", + url: "/api/v1/tools/image/optimize-for-web", payload, headers: { "content-type": contentType }, }); @@ -1002,7 +1002,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/batch", + url: "/api/v1/tools/image/optimize-for-web/batch", payload, headers: { "content-type": contentType, @@ -1033,7 +1033,7 @@ describe("Batch processing", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/optimize-for-web/batch", + url: "/api/v1/tools/image/optimize-for-web/batch", payload, headers: { "content-type": contentType, diff --git a/tests/integration/organize-pdf.test.ts b/tests/integration/organize-pdf.test.ts index 18fa3cbe..8b28880f 100644 --- a/tests/integration/organize-pdf.test.ts +++ b/tests/integration/organize-pdf.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/organize-pdf", + url: "/api/v1/tools/pdf/organize-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/passport-photo.test.ts b/tests/integration/passport-photo.test.ts index 94e5aaa8..184f67a0 100644 --- a/tests/integration/passport-photo.test.ts +++ b/tests/integration/passport-photo.test.ts @@ -2,8 +2,8 @@ * Integration tests for the passport-photo AI tool. * * Two-phase flow: - * Phase 1: POST /api/v1/tools/passport-photo/analyze (face detection + bg removal) - * Phase 2: POST /api/v1/tools/passport-photo/generate (crop/resize, JSON body) + * Phase 1: POST /api/v1/tools/image/passport-photo/analyze (face detection + bg removal) + * Phase 2: POST /api/v1/tools/image/passport-photo/generate (crop/resize, JSON body) * * The Python sidecar may not be running, so processing tests accept both * 200 (sidecar available) and 501 (feature not installed). Validation paths @@ -44,7 +44,7 @@ describe("passport-photo/analyze", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/analyze", + url: "/api/v1/tools/image/passport-photo/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -60,7 +60,7 @@ describe("passport-photo/analyze", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/analyze", + url: "/api/v1/tools/image/passport-photo/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -86,7 +86,7 @@ describe("passport-photo/analyze", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/analyze", + url: "/api/v1/tools/image/passport-photo/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -103,7 +103,7 @@ describe("passport-photo/analyze", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/analyze", + url: "/api/v1/tools/image/passport-photo/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -120,7 +120,7 @@ describe("passport-photo/analyze", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/analyze", + url: "/api/v1/tools/image/passport-photo/analyze", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -140,7 +140,7 @@ describe("passport-photo/analyze", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/analyze", + url: "/api/v1/tools/image/passport-photo/analyze", headers: { "content-type": contentType }, body, }); @@ -155,7 +155,7 @@ describe("passport-photo/generate", () => { it("rejects missing required fields (400)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/generate", + url: "/api/v1/tools/image/passport-photo/generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -171,7 +171,7 @@ describe("passport-photo/generate", () => { it("rejects unknown country code without custom dimensions (400)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/generate", + url: "/api/v1/tools/image/passport-photo/generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -202,7 +202,7 @@ describe("passport-photo/generate", () => { it("rejects invalid dpi value (400)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/generate", + url: "/api/v1/tools/image/passport-photo/generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -233,7 +233,7 @@ describe("passport-photo/generate", () => { it("rejects invalid zoom value (400)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/generate", + url: "/api/v1/tools/image/passport-photo/generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -264,7 +264,7 @@ describe("passport-photo/generate", () => { it("rejects unauthenticated requests to generate (401)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/generate", + url: "/api/v1/tools/image/passport-photo/generate", headers: { "content-type": "application/json" }, payload: { jobId: "test-job", @@ -291,7 +291,7 @@ describe("passport-photo/generate", () => { it("rejects missing landmarks fields (400)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/generate", + url: "/api/v1/tools/image/passport-photo/generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -315,7 +315,7 @@ describe("passport-photo/generate", () => { it("returns 422 when jobId workspace does not exist", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/passport-photo/generate", + url: "/api/v1/tools/image/passport-photo/generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", diff --git a/tests/integration/pdf-metadata.test.ts b/tests/integration/pdf-metadata.test.ts index ce664632..96340159 100644 --- a/tests/integration/pdf-metadata.test.ts +++ b/tests/integration/pdf-metadata.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/pdf-metadata", + url: "/api/v1/tools/pdf/pdf-metadata", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/pdf-page-numbers.test.ts b/tests/integration/pdf-page-numbers.test.ts index 6bd3db28..2ff5a3e9 100644 --- a/tests/integration/pdf-page-numbers.test.ts +++ b/tests/integration/pdf-page-numbers.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/pdf-page-numbers", + url: "/api/v1/tools/pdf/pdf-page-numbers", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/pdf-to-image.test.ts b/tests/integration/pdf-to-image.test.ts index e13cfb6f..e0eb715b 100644 --- a/tests/integration/pdf-to-image.test.ts +++ b/tests/integration/pdf-to-image.test.ts @@ -21,7 +21,7 @@ afterAll(async () => { await testApp.cleanup(); }, 10_000); -describe("POST /api/v1/tools/pdf-to-image/info", () => { +describe("POST /api/v1/tools/pdf/pdf-to-image/info", () => { it("returns page count for a valid PDF", async () => { const { body, contentType } = createMultipartPayload([ { @@ -33,7 +33,7 @@ describe("POST /api/v1/tools/pdf-to-image/info", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image/info", + url: "/api/v1/tools/pdf/pdf-to-image/info", body, headers: { "content-type": contentType, @@ -56,7 +56,7 @@ describe("POST /api/v1/tools/pdf-to-image/info", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image/info", + url: "/api/v1/tools/pdf/pdf-to-image/info", body, headers: { "content-type": contentType, @@ -70,7 +70,7 @@ describe("POST /api/v1/tools/pdf-to-image/info", () => { const { body, contentType } = createMultipartPayload([{ name: "other", content: "hello" }]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image/info", + url: "/api/v1/tools/pdf/pdf-to-image/info", body, headers: { "content-type": contentType, @@ -81,7 +81,7 @@ describe("POST /api/v1/tools/pdf-to-image/info", () => { }); }); -describe("POST /api/v1/tools/pdf-to-image/preview", () => { +describe("POST /api/v1/tools/pdf/pdf-to-image/preview", () => { it("returns thumbnails for all pages", async () => { const { body, contentType } = createMultipartPayload([ { @@ -93,7 +93,7 @@ describe("POST /api/v1/tools/pdf-to-image/preview", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image/preview", + url: "/api/v1/tools/pdf/pdf-to-image/preview", body, headers: { "content-type": contentType, @@ -121,7 +121,7 @@ describe("POST /api/v1/tools/pdf-to-image/preview", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image/preview", + url: "/api/v1/tools/pdf/pdf-to-image/preview", body, headers: { "content-type": contentType, @@ -132,7 +132,7 @@ describe("POST /api/v1/tools/pdf-to-image/preview", () => { }); }); -describe("POST /api/v1/tools/pdf-to-image", () => { +describe("POST /api/v1/tools/pdf/pdf-to-image", () => { it("converts a single page to PNG with per-page URLs and ZIP", async () => { const { body, contentType } = createMultipartPayload([ { @@ -148,7 +148,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -181,7 +181,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -208,7 +208,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -234,7 +234,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -263,7 +263,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -291,7 +291,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -318,7 +318,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -345,7 +345,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -370,7 +370,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -397,7 +397,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -419,7 +419,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -437,7 +437,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -462,7 +462,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -490,7 +490,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -517,7 +517,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -544,7 +544,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -571,7 +571,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -599,7 +599,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -636,7 +636,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -677,13 +677,13 @@ describe("POST /api/v1/tools/pdf-to-image", () => { const res72 = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body: body72, headers: { "content-type": ct72, authorization: `Bearer ${adminToken}` }, }); const res300 = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body: body300, headers: { "content-type": ct300, authorization: `Bearer ${adminToken}` }, }); @@ -711,7 +711,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -738,7 +738,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -763,7 +763,7 @@ describe("POST /api/v1/tools/pdf-to-image", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image", + url: "/api/v1/tools/pdf/pdf-to-image", body, headers: { "content-type": contentType, @@ -780,7 +780,7 @@ describe("Preview endpoint edge cases", () => { const { body, contentType } = createMultipartPayload([{ name: "other", content: "hello" }]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-image/preview", + url: "/api/v1/tools/pdf/pdf-to-image/preview", body, headers: { "content-type": contentType, diff --git a/tests/integration/pdf-to-text.test.ts b/tests/integration/pdf-to-text.test.ts index d09e5529..bed40193 100644 --- a/tests/integration/pdf-to-text.test.ts +++ b/tests/integration/pdf-to-text.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record = {}) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-text", + url: "/api/v1/tools/pdf/pdf-to-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/pdf-to-word.test.ts b/tests/integration/pdf-to-word.test.ts index 20898d29..2dbb918f 100644 --- a/tests/integration/pdf-to-word.test.ts +++ b/tests/integration/pdf-to-word.test.ts @@ -31,7 +31,7 @@ async function runTool(settings: Record = {}) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/pdf-to-word", + url: "/api/v1/tools/pdf/pdf-to-word", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/pdfa-convert.test.ts b/tests/integration/pdfa-convert.test.ts index cc46aba0..7f11bf44 100644 --- a/tests/integration/pdfa-convert.test.ts +++ b/tests/integration/pdfa-convert.test.ts @@ -25,7 +25,7 @@ async function runTool() { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/pdfa-convert", + url: "/api/v1/tools/pdf/pdfa-convert", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/permissions.test.ts b/tests/integration/permissions.test.ts index 1c7d9d65..d49a4c53 100644 --- a/tests/integration/permissions.test.ts +++ b/tests/integration/permissions.test.ts @@ -268,7 +268,7 @@ describe("tool and pipeline permission enforcement", () => { const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { "content-type": contentType }, body, }); @@ -291,7 +291,7 @@ describe("tool and pipeline permission enforcement", () => { const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/pitch-shift.test.ts b/tests/integration/pitch-shift.test.ts index 04d233f1..843421a2 100644 --- a/tests/integration/pitch-shift.test.ts +++ b/tests/integration/pitch-shift.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/pitch-shift", + url: "/api/v1/tools/audio/pitch-shift", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/pixelate.test.ts b/tests/integration/pixelate.test.ts index 3eb9c0fd..bc53351d 100644 --- a/tests/integration/pixelate.test.ts +++ b/tests/integration/pixelate.test.ts @@ -37,7 +37,7 @@ describe("Pixelate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pixelate", + url: "/api/v1/tools/image/pixelate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -59,7 +59,7 @@ describe("Pixelate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pixelate", + url: "/api/v1/tools/image/pixelate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -94,7 +94,7 @@ describe("Pixelate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pixelate", + url: "/api/v1/tools/image/pixelate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -132,7 +132,7 @@ describe("Pixelate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pixelate", + url: "/api/v1/tools/image/pixelate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -169,7 +169,7 @@ describe("Pixelate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pixelate", + url: "/api/v1/tools/image/pixelate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -190,7 +190,7 @@ describe("Pixelate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/pixelate", + url: "/api/v1/tools/image/pixelate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/powerpoint-to-pdf.test.ts b/tests/integration/powerpoint-to-pdf.test.ts index 79c567fc..dede4fce 100644 --- a/tests/integration/powerpoint-to-pdf.test.ts +++ b/tests/integration/powerpoint-to-pdf.test.ts @@ -30,7 +30,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/powerpoint-to-pdf", + url: "/api/v1/tools/files/powerpoint-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -73,7 +73,7 @@ it("rejects unsupported file types with 415", async () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/powerpoint-to-pdf", + url: "/api/v1/tools/files/powerpoint-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/progress.test.ts b/tests/integration/progress.test.ts index b6da47c0..aeecedc7 100644 --- a/tests/integration/progress.test.ts +++ b/tests/integration/progress.test.ts @@ -74,7 +74,7 @@ describe("Batch progress tracking", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -99,7 +99,7 @@ describe("Batch progress tracking", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -123,7 +123,7 @@ describe("Batch progress tracking", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -160,7 +160,7 @@ describe("Batch progress tracking", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -196,7 +196,7 @@ describe("Batch progress tracking", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, @@ -300,7 +300,7 @@ describe("Job DB record structure", () => { await app.inject({ method: "POST", - url: "/api/v1/tools/resize/batch", + url: "/api/v1/tools/image/resize/batch", headers: { "content-type": contentType, authorization: `Bearer ${adminToken}`, diff --git a/tests/integration/protect-pdf.test.ts b/tests/integration/protect-pdf.test.ts index d69e9ed8..89616b81 100644 --- a/tests/integration/protect-pdf.test.ts +++ b/tests/integration/protect-pdf.test.ts @@ -27,7 +27,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/protect-pdf", + url: "/api/v1/tools/pdf/protect-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/qr-generate.test.ts b/tests/integration/qr-generate.test.ts index 4c3c24b2..0feb90dd 100644 --- a/tests/integration/qr-generate.test.ts +++ b/tests/integration/qr-generate.test.ts @@ -27,7 +27,7 @@ describe("QR Generate", () => { it("generates a QR code from a URL string", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -48,7 +48,7 @@ describe("QR Generate", () => { it("generates a downloadable PNG image", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -77,7 +77,7 @@ describe("QR Generate", () => { it("respects the custom size parameter", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -104,7 +104,7 @@ describe("QR Generate", () => { it("uses default size of 400 when not specified", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -130,7 +130,7 @@ describe("QR Generate", () => { it("accepts custom foreground and background colors", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -152,7 +152,7 @@ describe("QR Generate", () => { for (const level of ["L", "M", "Q", "H"]) { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -170,7 +170,7 @@ describe("QR Generate", () => { it("returns all expected fields in the response", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -195,7 +195,7 @@ describe("QR Generate", () => { it("rejects requests without text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -211,7 +211,7 @@ describe("QR Generate", () => { it("rejects empty text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -225,7 +225,7 @@ describe("QR Generate", () => { it("rejects invalid color format", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -244,7 +244,7 @@ describe("QR Generate", () => { it("rejects size below minimum", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -261,7 +261,7 @@ describe("QR Generate", () => { it("rejects size above maximum", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -278,7 +278,7 @@ describe("QR Generate", () => { it("rejects invalid error correction level", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -295,7 +295,7 @@ describe("QR Generate", () => { it("rejects unauthenticated requests", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { "content-type": "application/json" }, payload: { text: "test" }, }); @@ -308,7 +308,7 @@ describe("QR Generate", () => { it("generates QR code for a long URL", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -326,7 +326,7 @@ describe("QR Generate", () => { it("generates QR code for multiline text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -342,7 +342,7 @@ describe("QR Generate", () => { it("generates QR code for special characters", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -360,7 +360,7 @@ describe("QR Generate", () => { it("generates minimum allowed size QR code", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -388,7 +388,7 @@ describe("QR Generate", () => { it("generates QR with white foreground on black background", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -409,7 +409,7 @@ describe("QR Generate", () => { const longText = "A".repeat(2000); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -429,7 +429,7 @@ describe("QR Generate", () => { const tooLong = "A".repeat(2001); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -445,7 +445,7 @@ describe("QR Generate", () => { it("generates QR code at large size (2000)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -464,7 +464,7 @@ describe("QR Generate", () => { it("generates QR with transparent background (3-char hex)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -486,7 +486,7 @@ describe("QR Generate", () => { it("higher error correction produces equal or larger QR", async () => { const resL = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -500,7 +500,7 @@ describe("QR Generate", () => { const resH = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -526,7 +526,7 @@ describe("QR Generate", () => { it("generates QR code for Unicode text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -546,7 +546,7 @@ describe("QR Generate", () => { it("generates QR code for a single character", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -566,7 +566,7 @@ describe("QR Generate", () => { it("generates QR code with identical foreground and background colors", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -587,7 +587,7 @@ describe("QR Generate", () => { it("generates QR code at maximum allowed size (10000)", { timeout: 180_000 }, async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -608,7 +608,7 @@ describe("QR Generate", () => { it("accepts lowercase hex colors", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -628,7 +628,7 @@ describe("QR Generate", () => { it("accepts mixed case hex colors", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -648,7 +648,7 @@ describe("QR Generate", () => { it("downloaded QR code has the exact requested size", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -677,7 +677,7 @@ describe("QR Generate", () => { it("rejects invalid background color format", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -696,7 +696,7 @@ describe("QR Generate", () => { it("generates QR code for WiFi connection string", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -717,7 +717,7 @@ describe("QR Generate", () => { it("generates QR code for mailto link", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -737,7 +737,7 @@ describe("QR Generate", () => { it("generates QR code for numeric-only text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -757,7 +757,7 @@ describe("QR Generate", () => { it("generates QR code at exactly minimum size (100)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -786,7 +786,7 @@ describe("QR Generate", () => { it("rejects size of 99 (just below minimum)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -803,7 +803,7 @@ describe("QR Generate", () => { it("rejects size of 10001 (just above maximum)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -822,7 +822,7 @@ describe("QR Generate", () => { it("uses default error correction level M when not specified", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -842,7 +842,7 @@ describe("QR Generate", () => { it("uses default black/white colors when not specified", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -870,7 +870,7 @@ describe("QR Generate", () => { for (const level of ["L", "M", "Q", "H"] as const) { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -901,7 +901,7 @@ describe("QR Generate", () => { it("rejects numeric text value (must be string)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -919,7 +919,7 @@ describe("QR Generate", () => { it("rejects 8-character hex color (with alpha)", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -938,7 +938,7 @@ describe("QR Generate", () => { it("generates QR code for whitespace-only text", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -959,7 +959,7 @@ describe("QR Generate", () => { it("generates QR with all parameters specified", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -993,7 +993,7 @@ describe("QR Generate", () => { it("rejects request without content-type header", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, }, @@ -1009,7 +1009,7 @@ describe("QR Generate", () => { it("download URL is accessible without auth token", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1036,7 +1036,7 @@ describe("QR Generate", () => { it("generates QR code for URL with encoded characters", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1067,7 +1067,7 @@ describe("QR Generate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1088,7 +1088,7 @@ describe("QR Generate", () => { it("generates QR code for tel: URI", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1108,7 +1108,7 @@ describe("QR Generate", () => { it("QR with custom colors contains correct foreground color", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1148,7 +1148,7 @@ describe("QR Generate", () => { it("higher EC level produces larger or equal processedSize", async () => { const resL = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1162,7 +1162,7 @@ describe("QR Generate", () => { const resH = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1188,7 +1188,7 @@ describe("QR Generate", () => { it("generates QR code for geo location", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1209,7 +1209,7 @@ describe("QR Generate", () => { const jsonText = JSON.stringify({ key: "value", nested: { a: 1 } }); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1237,7 +1237,7 @@ describe("QR Generate", () => { const resNoLogo = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1251,7 +1251,7 @@ describe("QR Generate", () => { const resWithLogo = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1282,7 +1282,7 @@ describe("QR Generate", () => { it("rejects invalid logo base64 data", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1301,7 +1301,7 @@ describe("QR Generate", () => { it("rejects malformed logo data URI format", async () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", @@ -1321,7 +1321,7 @@ describe("QR Generate", () => { for (const size of [150, 300, 500]) { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/qr-generate", + url: "/api/v1/tools/image/qr-generate", headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json", diff --git a/tests/integration/red-eye-removal.test.ts b/tests/integration/red-eye-removal.test.ts index c2dd1043..67d72e71 100644 --- a/tests/integration/red-eye-removal.test.ts +++ b/tests/integration/red-eye-removal.test.ts @@ -43,7 +43,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -62,7 +62,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -95,7 +95,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -117,7 +117,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -136,7 +136,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -158,7 +158,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -179,7 +179,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -200,7 +200,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -224,7 +224,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -250,7 +250,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -276,7 +276,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -302,7 +302,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -325,7 +325,7 @@ describe("Red Eye Removal", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/red-eye-removal", + url: "/api/v1/tools/image/red-eye-removal", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/redact-pdf.test.ts b/tests/integration/redact-pdf.test.ts index 667a7ce4..05c23441 100644 --- a/tests/integration/redact-pdf.test.ts +++ b/tests/integration/redact-pdf.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/redact-pdf", + url: "/api/v1/tools/pdf/redact-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/remove-background.test.ts b/tests/integration/remove-background.test.ts index bcebc3c2..1452a62b 100644 --- a/tests/integration/remove-background.test.ts +++ b/tests/integration/remove-background.test.ts @@ -44,7 +44,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -63,7 +63,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -96,7 +96,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -125,7 +125,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -152,7 +152,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -171,7 +171,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -193,7 +193,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -214,7 +214,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -232,7 +232,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background/effects", + url: "/api/v1/tools/image/remove-background/effects", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -252,7 +252,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background/effects", + url: "/api/v1/tools/image/remove-background/effects", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -275,7 +275,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background/effects", + url: "/api/v1/tools/image/remove-background/effects", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -297,7 +297,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -320,7 +320,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -346,7 +346,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -372,7 +372,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -398,7 +398,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -420,7 +420,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -442,7 +442,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -468,7 +468,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -491,7 +491,7 @@ describe("Remove Background", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/remove-background", + url: "/api/v1/tools/image/remove-background", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/remove-pages.test.ts b/tests/integration/remove-pages.test.ts index 3fd1596a..3978f1d1 100644 --- a/tests/integration/remove-pages.test.ts +++ b/tests/integration/remove-pages.test.ts @@ -57,7 +57,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/remove-pages", + url: "/api/v1/tools/pdf/remove-pages", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -111,7 +111,7 @@ describe.skipIf(!qpdfAvailable())("remove-pages (requires qpdf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/remove-pages", + url: "/api/v1/tools/pdf/remove-pages", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body: reqBody, }); diff --git a/tests/integration/repair-pdf.test.ts b/tests/integration/repair-pdf.test.ts index a183cc06..0ff53d2c 100644 --- a/tests/integration/repair-pdf.test.ts +++ b/tests/integration/repair-pdf.test.ts @@ -26,7 +26,7 @@ async function runTool(pdfBuffer: Buffer, filename = "test-3page.pdf") { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/repair-pdf", + url: "/api/v1/tools/pdf/repair-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/replace-audio.test.ts b/tests/integration/replace-audio.test.ts index 6d819623..3d318958 100644 --- a/tests/integration/replace-audio.test.ts +++ b/tests/integration/replace-audio.test.ts @@ -29,7 +29,7 @@ describe.skipIf(!ffmpegAvailable())("replace-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/replace-audio", + url: "/api/v1/tools/video/replace-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -63,7 +63,7 @@ describe.skipIf(!ffmpegAvailable())("replace-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/replace-audio", + url: "/api/v1/tools/video/replace-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -83,7 +83,7 @@ describe.skipIf(!ffmpegAvailable())("replace-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/replace-audio", + url: "/api/v1/tools/video/replace-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/replace-color.test.ts b/tests/integration/replace-color.test.ts index 7dea6b06..b1a4ae1f 100644 --- a/tests/integration/replace-color.test.ts +++ b/tests/integration/replace-color.test.ts @@ -59,7 +59,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/replace-color", + url: "/api/v1/tools/image/replace-color", payload, headers: { "content-type": contentType, @@ -185,7 +185,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/replace-color", + url: "/api/v1/tools/image/replace-color", payload, headers: { "content-type": contentType, @@ -329,7 +329,7 @@ describe("Authentication", () => { }); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/replace-color", + url: "/api/v1/tools/image/replace-color", payload, headers: { "content-type": contentType }, }); @@ -621,7 +621,7 @@ describe("Invalid settings JSON", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/replace-color", + url: "/api/v1/tools/image/replace-color", payload, headers: { "content-type": contentType, diff --git a/tests/integration/resize-video.test.ts b/tests/integration/resize-video.test.ts index 5e9816b0..3b1e96c5 100644 --- a/tests/integration/resize-video.test.ts +++ b/tests/integration/resize-video.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/resize-video", + url: "/api/v1/tools/video/resize-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/resize.test.ts b/tests/integration/resize.test.ts index e927345b..e7319e45 100644 --- a/tests/integration/resize.test.ts +++ b/tests/integration/resize.test.ts @@ -47,7 +47,7 @@ async function resizeAndMeta( const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -80,7 +80,7 @@ describe("Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -165,7 +165,7 @@ describe("Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -198,7 +198,7 @@ describe("Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -219,7 +219,7 @@ describe("Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -243,7 +243,7 @@ describe("Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -264,7 +264,7 @@ describe("Resize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/restore-photo.test.ts b/tests/integration/restore-photo.test.ts index 125a194c..a921b587 100644 --- a/tests/integration/restore-photo.test.ts +++ b/tests/integration/restore-photo.test.ts @@ -42,7 +42,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -61,7 +61,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -99,7 +99,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -125,7 +125,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -151,7 +151,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -170,7 +170,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -192,7 +192,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -213,7 +213,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -233,7 +233,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -256,7 +256,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -282,7 +282,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -308,7 +308,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -334,7 +334,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -357,7 +357,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { "content-type": contentType }, body, }); @@ -376,7 +376,7 @@ describe("Restore Photo", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/restore-photo", + url: "/api/v1/tools/image/restore-photo", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/reverse-audio.test.ts b/tests/integration/reverse-audio.test.ts index a564afce..2e7cd213 100644 --- a/tests/integration/reverse-audio.test.ts +++ b/tests/integration/reverse-audio.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/reverse-audio", + url: "/api/v1/tools/audio/reverse-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/reverse-video.test.ts b/tests/integration/reverse-video.test.ts index 2ca51e50..f0ddc05d 100644 --- a/tests/integration/reverse-video.test.ts +++ b/tests/integration/reverse-video.test.ts @@ -33,7 +33,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/reverse-video", + url: "/api/v1/tools/video/reverse-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/ringtone-maker.test.ts b/tests/integration/ringtone-maker.test.ts index 5aa30bc8..cbd7ae54 100644 --- a/tests/integration/ringtone-maker.test.ts +++ b/tests/integration/ringtone-maker.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/ringtone-maker", + url: "/api/v1/tools/audio/ringtone-maker", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/rotate-pdf.test.ts b/tests/integration/rotate-pdf.test.ts index b9e137ac..da4724d4 100644 --- a/tests/integration/rotate-pdf.test.ts +++ b/tests/integration/rotate-pdf.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/rotate-pdf", + url: "/api/v1/tools/pdf/rotate-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/rotate-video.test.ts b/tests/integration/rotate-video.test.ts index 60b03071..e4f02ef4 100644 --- a/tests/integration/rotate-video.test.ts +++ b/tests/integration/rotate-video.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/rotate-video", + url: "/api/v1/tools/video/rotate-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/rotate.test.ts b/tests/integration/rotate.test.ts index 532edf0b..0b97d94c 100644 --- a/tests/integration/rotate.test.ts +++ b/tests/integration/rotate.test.ts @@ -46,7 +46,7 @@ async function rotateAndMeta( const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -79,7 +79,7 @@ describe("Rotate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -170,7 +170,7 @@ describe("Rotate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -198,7 +198,7 @@ describe("Rotate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -219,7 +219,7 @@ describe("Rotate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -240,7 +240,7 @@ describe("Rotate", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/rotate", + url: "/api/v1/tools/image/rotate", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/settings-matrix.test.ts b/tests/integration/settings-matrix.test.ts index 17575c5e..8110ab6f 100644 --- a/tests/integration/settings-matrix.test.ts +++ b/tests/integration/settings-matrix.test.ts @@ -1,5 +1,6 @@ import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { apiToolPath } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { buildTestApp, createMultipartPayload, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -1185,7 +1186,7 @@ describe("settings variation matrix", () => { const res = await testApp.app.inject({ method: "POST", - url: `/api/v1/tools/${toolId}`, + url: apiToolPath(toolId), headers: { "content-type": contentType, authorization: `Bearer ${token}`, diff --git a/tests/integration/sharpening.test.ts b/tests/integration/sharpening.test.ts index 40574d6e..724f76a6 100644 --- a/tests/integration/sharpening.test.ts +++ b/tests/integration/sharpening.test.ts @@ -51,7 +51,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/sharpening", + url: "/api/v1/tools/image/sharpening", payload, headers: { "content-type": contentType, @@ -209,7 +209,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sharpening", + url: "/api/v1/tools/image/sharpening", payload, headers: { "content-type": contentType, @@ -324,7 +324,7 @@ describe("Authentication", () => { const { body: payload, contentType } = makePayload({}); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sharpening", + url: "/api/v1/tools/image/sharpening", payload, headers: { "content-type": contentType }, }); @@ -707,7 +707,7 @@ describe("Invalid settings JSON", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sharpening", + url: "/api/v1/tools/image/sharpening", payload, headers: { "content-type": contentType, diff --git a/tests/integration/silence-removal.test.ts b/tests/integration/silence-removal.test.ts index b4481515..da38c5be 100644 --- a/tests/integration/silence-removal.test.ts +++ b/tests/integration/silence-removal.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/silence-removal", + url: "/api/v1/tools/audio/silence-removal", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/smart-crop.test.ts b/tests/integration/smart-crop.test.ts index 4009f047..e48ef0fd 100644 --- a/tests/integration/smart-crop.test.ts +++ b/tests/integration/smart-crop.test.ts @@ -48,7 +48,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -67,7 +67,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -100,7 +100,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -139,7 +139,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -161,7 +161,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -200,7 +200,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -223,7 +223,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -251,7 +251,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -288,7 +288,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -309,7 +309,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -329,7 +329,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -350,7 +350,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -374,7 +374,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -395,7 +395,7 @@ describe("Smart Crop", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/smart-crop", + url: "/api/v1/tools/image/smart-crop", headers: { "content-type": contentType }, body, }); diff --git a/tests/integration/split-audio.test.ts b/tests/integration/split-audio.test.ts index ec37d5c1..fe708d46 100644 --- a/tests/integration/split-audio.test.ts +++ b/tests/integration/split-audio.test.ts @@ -27,7 +27,7 @@ describe.skipIf(!ffmpegAvailable())("split-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-audio", + url: "/api/v1/tools/audio/split-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -53,7 +53,7 @@ describe.skipIf(!ffmpegAvailable())("split-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-audio", + url: "/api/v1/tools/audio/split-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -78,7 +78,7 @@ describe.skipIf(!ffmpegAvailable())("split-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-audio", + url: "/api/v1/tools/audio/split-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -95,7 +95,7 @@ describe.skipIf(!ffmpegAvailable())("split-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-audio", + url: "/api/v1/tools/audio/split-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -116,7 +116,7 @@ describe.skipIf(!ffmpegAvailable())("split-audio (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-audio", + url: "/api/v1/tools/audio/split-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/split-csv.test.ts b/tests/integration/split-csv.test.ts index a520d221..9a8ab0f7 100644 --- a/tests/integration/split-csv.test.ts +++ b/tests/integration/split-csv.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-csv", + url: "/api/v1/tools/files/split-csv", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -73,7 +73,7 @@ describe("split-csv (pure JS, no skipIf)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-csv", + url: "/api/v1/tools/files/split-csv", headers: { authorization: `Bearer ${adminToken}`, "content-type": tsvCt }, body: tsvBody, }); diff --git a/tests/integration/split-pdf.test.ts b/tests/integration/split-pdf.test.ts index 7175d118..b63a6814 100644 --- a/tests/integration/split-pdf.test.ts +++ b/tests/integration/split-pdf.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/split-pdf", + url: "/api/v1/tools/pdf/split-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/split.test.ts b/tests/integration/split.test.ts index 5137556a..2f5e32fe 100644 --- a/tests/integration/split.test.ts +++ b/tests/integration/split.test.ts @@ -42,7 +42,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -82,7 +82,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -117,7 +117,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -144,7 +144,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -176,7 +176,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -200,7 +200,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -224,7 +224,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -243,7 +243,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { "content-type": contentType }, body, }); @@ -264,7 +264,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -293,7 +293,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -324,7 +324,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -355,7 +355,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -386,7 +386,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -416,7 +416,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -445,7 +445,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -477,7 +477,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -522,7 +522,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -554,7 +554,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -585,7 +585,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -615,7 +615,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -646,7 +646,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -670,7 +670,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -689,7 +689,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -713,7 +713,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -735,7 +735,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -767,7 +767,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -799,7 +799,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -829,7 +829,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -857,7 +857,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -888,7 +888,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -919,7 +919,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -949,7 +949,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -985,7 +985,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1015,7 +1015,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1043,7 +1043,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1075,7 +1075,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1108,7 +1108,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1136,7 +1136,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1168,7 +1168,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1196,7 +1196,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1220,7 +1220,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1245,7 +1245,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1278,7 +1278,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1304,7 +1304,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1328,7 +1328,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1350,7 +1350,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1372,7 +1372,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1397,7 +1397,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1420,7 +1420,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1442,7 +1442,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1467,7 +1467,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1502,7 +1502,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1530,7 +1530,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1568,7 +1568,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split/batch", + url: "/api/v1/tools/image/split/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1594,7 +1594,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1619,7 +1619,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1643,7 +1643,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1668,7 +1668,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1703,7 +1703,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1730,7 +1730,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1757,7 +1757,7 @@ describe("Split", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/split", + url: "/api/v1/tools/image/split", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/sprite-sheet.test.ts b/tests/integration/sprite-sheet.test.ts index 97e91ce2..16b2e784 100644 --- a/tests/integration/sprite-sheet.test.ts +++ b/tests/integration/sprite-sheet.test.ts @@ -40,7 +40,7 @@ describe("Sprite Sheet", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sprite-sheet", + url: "/api/v1/tools/image/sprite-sheet", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -75,7 +75,7 @@ describe("Sprite Sheet", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sprite-sheet", + url: "/api/v1/tools/image/sprite-sheet", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -109,7 +109,7 @@ describe("Sprite Sheet", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sprite-sheet", + url: "/api/v1/tools/image/sprite-sheet", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -138,7 +138,7 @@ describe("Sprite Sheet", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/sprite-sheet", + url: "/api/v1/tools/image/sprite-sheet", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/stabilize-video.test.ts b/tests/integration/stabilize-video.test.ts index 8ca0be3c..623d7034 100644 --- a/tests/integration/stabilize-video.test.ts +++ b/tests/integration/stabilize-video.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record = {}) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/stabilize-video", + url: "/api/v1/tools/video/stabilize-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/stitch.test.ts b/tests/integration/stitch.test.ts index 6ca84ef2..736ce5ea 100644 --- a/tests/integration/stitch.test.ts +++ b/tests/integration/stitch.test.ts @@ -43,7 +43,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -81,7 +81,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -116,7 +116,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -156,7 +156,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -187,7 +187,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -226,7 +226,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -264,7 +264,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -300,7 +300,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -334,7 +334,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -357,7 +357,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -380,7 +380,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -405,7 +405,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -425,7 +425,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { "content-type": contentType }, body, }); @@ -447,7 +447,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -480,7 +480,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -512,7 +512,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -544,7 +544,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -576,7 +576,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -612,7 +612,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -641,7 +641,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -671,7 +671,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -710,7 +710,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -741,7 +741,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -772,7 +772,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -807,7 +807,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -845,7 +845,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -874,7 +874,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -908,7 +908,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -940,7 +940,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -969,7 +969,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1001,7 +1001,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1021,7 +1021,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1049,7 +1049,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1076,7 +1076,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1111,7 +1111,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1153,7 +1153,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1193,7 +1193,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1231,7 +1231,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1269,7 +1269,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1303,7 +1303,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1331,7 +1331,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1358,7 +1358,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1383,7 +1383,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1408,7 +1408,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1444,7 +1444,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1472,7 +1472,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1500,7 +1500,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1529,7 +1529,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1558,7 +1558,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1587,7 +1587,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1622,7 +1622,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1664,7 +1664,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1696,7 +1696,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1732,7 +1732,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1766,7 +1766,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1808,7 +1808,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1845,7 +1845,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1874,7 +1874,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1906,7 +1906,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1945,7 +1945,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -1976,7 +1976,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2007,7 +2007,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2044,7 +2044,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2082,7 +2082,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -2112,7 +2112,7 @@ describe("Stitch", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/stitch", + url: "/api/v1/tools/image/stitch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/strip-metadata.test.ts b/tests/integration/strip-metadata.test.ts index 771b8d82..6bf2741e 100644 --- a/tests/integration/strip-metadata.test.ts +++ b/tests/integration/strip-metadata.test.ts @@ -51,7 +51,7 @@ async function postTool( const { body: payload, contentType } = makePayload(settings, buffer, filename, ct); return app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata", + url: "/api/v1/tools/image/strip-metadata", payload, headers: { "content-type": contentType, @@ -158,7 +158,7 @@ describe("Inspect endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -179,7 +179,7 @@ describe("Inspect endpoint", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -379,7 +379,7 @@ describe("Inspect endpoint edge cases", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -403,7 +403,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata", + url: "/api/v1/tools/image/strip-metadata", payload, headers: { "content-type": contentType, @@ -420,7 +420,7 @@ describe("Error handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata", + url: "/api/v1/tools/image/strip-metadata", payload, headers: { "content-type": contentType, @@ -475,7 +475,7 @@ describe("Inspect endpoint: ICC and XMP parsing", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -501,7 +501,7 @@ describe("Inspect endpoint: ICC and XMP parsing", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -529,7 +529,7 @@ describe("Inspect endpoint: ICC and XMP parsing", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -557,7 +557,7 @@ describe("Inspect endpoint: ICC and XMP parsing", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -583,7 +583,7 @@ describe("Inspect endpoint: ICC and XMP parsing", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, @@ -661,7 +661,7 @@ describe("Tiny file handling", () => { ]); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/strip-metadata/inspect", + url: "/api/v1/tools/image/strip-metadata/inspect", payload, headers: { "content-type": contentType, diff --git a/tests/integration/svg-to-raster.test.ts b/tests/integration/svg-to-raster.test.ts index 800f3c29..2e57ede0 100644 --- a/tests/integration/svg-to-raster.test.ts +++ b/tests/integration/svg-to-raster.test.ts @@ -38,7 +38,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -58,7 +58,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -86,7 +86,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -110,7 +110,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -138,7 +138,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -163,7 +163,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -179,7 +179,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -194,7 +194,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -212,7 +212,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -230,7 +230,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -248,7 +248,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -278,13 +278,13 @@ describe("svg-to-raster", () => { const res72 = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": ct72 }, body: body72, }); const res600 = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": ct600 }, body: body600, }); @@ -318,7 +318,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -336,7 +336,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -356,7 +356,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -380,7 +380,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -405,7 +405,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -425,7 +425,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -459,7 +459,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -484,7 +484,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -504,7 +504,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -524,7 +524,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -540,7 +540,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -558,7 +558,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { "content-type": contentType }, body, }); @@ -578,7 +578,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -594,7 +594,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -613,7 +613,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -631,7 +631,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -651,7 +651,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -671,7 +671,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -688,7 +688,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -704,7 +704,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -725,7 +725,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -759,7 +759,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -794,7 +794,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -818,7 +818,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -846,7 +846,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -871,7 +871,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -894,7 +894,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -913,7 +913,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -931,7 +931,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -949,7 +949,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -969,7 +969,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -987,7 +987,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1006,7 +1006,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1029,7 +1029,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1050,7 +1050,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1071,7 +1071,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1098,7 +1098,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1120,7 +1120,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1142,7 +1142,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1171,7 +1171,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1191,7 +1191,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1209,7 +1209,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1229,7 +1229,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1249,7 +1249,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster", + url: "/api/v1/tools/image/svg-to-raster", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1271,7 +1271,7 @@ describe("svg-to-raster", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/svg-to-raster/batch", + url: "/api/v1/tools/image/svg-to-raster/batch", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/text-overlay.test.ts b/tests/integration/text-overlay.test.ts index c33e8028..d1faa9d2 100644 --- a/tests/integration/text-overlay.test.ts +++ b/tests/integration/text-overlay.test.ts @@ -37,7 +37,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -57,7 +57,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -81,7 +81,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -100,7 +100,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -123,7 +123,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -142,7 +142,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -157,7 +157,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -173,7 +173,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -191,7 +191,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -207,7 +207,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -226,7 +226,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -247,7 +247,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -276,7 +276,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -299,7 +299,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -318,7 +318,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -345,7 +345,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -368,7 +368,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -387,7 +387,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -406,7 +406,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -426,7 +426,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { "content-type": contentType }, body, }); @@ -453,7 +453,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -476,7 +476,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -497,7 +497,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -522,7 +522,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -544,7 +544,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -567,7 +567,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -588,7 +588,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -608,7 +608,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -638,7 +638,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -659,7 +659,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -679,7 +679,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -697,7 +697,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -723,7 +723,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -746,7 +746,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -767,7 +767,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -798,7 +798,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -818,7 +818,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -836,7 +836,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -866,7 +866,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -896,7 +896,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -917,7 +917,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -943,7 +943,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -964,7 +964,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -995,7 +995,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1018,7 +1018,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1039,7 +1039,7 @@ describe("text-overlay", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/text-overlay", + url: "/api/v1/tools/image/text-overlay", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/to-epub.test.ts b/tests/integration/to-epub.test.ts index bdca83b0..ae1cb77f 100644 --- a/tests/integration/to-epub.test.ts +++ b/tests/integration/to-epub.test.ts @@ -29,7 +29,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/to-epub", + url: "/api/v1/tools/files/to-epub", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -83,7 +83,7 @@ it("rejects unsupported file types with 415", async () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/to-epub", + url: "/api/v1/tools/files/to-epub", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/tool-async-window.test.ts b/tests/integration/tool-async-window.test.ts index 0ca09d05..2d6db4e3 100644 --- a/tests/integration/tool-async-window.test.ts +++ b/tests/integration/tool-async-window.test.ts @@ -39,7 +39,7 @@ describe("Tool async window (sync-wait path)", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -111,7 +111,7 @@ describe("Tool async window (sync-wait path)", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/resize", + url: "/api/v1/tools/image/resize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -156,7 +156,7 @@ describe("EXIF auto-orientation in factory path", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/compress", + url: "/api/v1/tools/image/compress", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/tool-route-drift.test.ts b/tests/integration/tool-route-drift.test.ts index 59d10f0a..5e8a442d 100644 --- a/tests/integration/tool-route-drift.test.ts +++ b/tests/integration/tool-route-drift.test.ts @@ -1,4 +1,4 @@ -import { TOOLS } from "@snapotter/shared"; +import { apiToolPath, TOOLS } from "@snapotter/shared"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { getRegisteredToolIds, getToolConfig } from "../../apps/api/src/routes/tool-factory.js"; import { buildTestApp, loginAsAdmin, type TestApp } from "./test-server.js"; @@ -96,11 +96,11 @@ describe("tool route drift", () => { } }); - it("every TOOLS entry answers on POST /api/v1/tools/:toolId (no dead routes)", async () => { + it("every TOOLS entry answers on POST /api/v1/tools/:section/:toolId (no dead routes)", async () => { for (const tool of TOOLS) { const res = await testApp.app.inject({ method: "POST", - url: `/api/v1/tools/${tool.id}`, + url: apiToolPath(tool.id), headers: { authorization: `Bearer ${adminToken}`, "content-type": "application/json" }, payload: {}, }); diff --git a/tests/integration/tracing-lifecycle.test.ts b/tests/integration/tracing-lifecycle.test.ts index d8de8421..be53e296 100644 --- a/tests/integration/tracing-lifecycle.test.ts +++ b/tests/integration/tracing-lifecycle.test.ts @@ -70,7 +70,7 @@ describe("tracing lifecycle", () => { trace.setGlobalTracerProvider(provider); const tracer = trace.getTracer("test"); - const httpSpan = tracer.startSpan("HTTP POST /api/v1/tools/resize"); + const httpSpan = tracer.startSpan("HTTP POST /api/v1/tools/image/resize"); const httpCtx = trace.setSpan(ROOT_CONTEXT, httpSpan); const httpTraceId = httpSpan.spanContext().traceId; @@ -97,7 +97,7 @@ describe("tracing lifecycle", () => { const spans = exporter.getFinishedSpans(); const names = spans.map((s) => s.name); - expect(names).toContain("HTTP POST /api/v1/tools/resize"); + expect(names).toContain("HTTP POST /api/v1/tools/image/resize"); expect(names).toContain("job.process"); expect(names).toContain("tool.process"); diff --git a/tests/integration/transcribe-audio.test.ts b/tests/integration/transcribe-audio.test.ts index 968b0668..cc773b9a 100644 --- a/tests/integration/transcribe-audio.test.ts +++ b/tests/integration/transcribe-audio.test.ts @@ -46,7 +46,7 @@ describe("transcribe-audio", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/transcribe-audio", + url: "/api/v1/tools/audio/transcribe-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -80,7 +80,7 @@ describe("transcribe-audio", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/transcribe-audio", + url: "/api/v1/tools/audio/transcribe-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -107,7 +107,7 @@ describe("transcribe-audio", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/transcribe-audio", + url: "/api/v1/tools/audio/transcribe-audio", headers: { "content-type": contentType }, body, }); @@ -137,7 +137,7 @@ describe("transcribe-audio", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/transcribe-audio", + url: "/api/v1/tools/audio/transcribe-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -167,7 +167,7 @@ describe("transcribe-audio", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/transcribe-audio", + url: "/api/v1/tools/audio/transcribe-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/transparency-fixer.test.ts b/tests/integration/transparency-fixer.test.ts index 968e4577..336f6e95 100644 --- a/tests/integration/transparency-fixer.test.ts +++ b/tests/integration/transparency-fixer.test.ts @@ -22,7 +22,7 @@ const SVG = readFileSync(join(FIXTURES, "test-100x100.svg")); const HEIC = readFileSync(join(FIXTURES, "test-200x150.heic")); const TINY = readFileSync(join(FIXTURES, "test-1x1.png")); -const TOOL_URL = "/api/v1/tools/transparency-fixer"; +const TOOL_URL = "/api/v1/tools/image/transparency-fixer"; let testApp: TestApp; let app: TestApp["app"]; diff --git a/tests/integration/trim-audio.test.ts b/tests/integration/trim-audio.test.ts index d5589d9e..db3c7d54 100644 --- a/tests/integration/trim-audio.test.ts +++ b/tests/integration/trim-audio.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/trim-audio", + url: "/api/v1/tools/audio/trim-audio", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/trim-video.test.ts b/tests/integration/trim-video.test.ts index c02050d7..9e4eb768 100644 --- a/tests/integration/trim-video.test.ts +++ b/tests/integration/trim-video.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/trim-video", + url: "/api/v1/tools/video/trim-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/unlock-pdf.test.ts b/tests/integration/unlock-pdf.test.ts index 3d5c7293..d6b4be00 100644 --- a/tests/integration/unlock-pdf.test.ts +++ b/tests/integration/unlock-pdf.test.ts @@ -28,7 +28,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/unlock-pdf", + url: "/api/v1/tools/pdf/unlock-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/upscale.test.ts b/tests/integration/upscale.test.ts index f5cdf6ec..c9964e17 100644 --- a/tests/integration/upscale.test.ts +++ b/tests/integration/upscale.test.ts @@ -43,7 +43,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -62,7 +62,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -95,7 +95,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -121,7 +121,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -148,7 +148,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -170,7 +170,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -189,7 +189,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -211,7 +211,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -232,7 +232,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -252,7 +252,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -275,7 +275,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -298,7 +298,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { "content-type": contentType }, body, }); @@ -317,7 +317,7 @@ describe("Upscale", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -343,7 +343,7 @@ describe("Upscale", () => { const start = Date.now(); const res = await app.inject({ method: "POST", - url: "/api/v1/tools/upscale", + url: "/api/v1/tools/image/upscale", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/vectorize.test.ts b/tests/integration/vectorize.test.ts index d0a0b22f..eef4fea7 100644 --- a/tests/integration/vectorize.test.ts +++ b/tests/integration/vectorize.test.ts @@ -38,7 +38,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -58,7 +58,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -85,7 +85,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -109,7 +109,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -125,7 +125,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -141,7 +141,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -166,7 +166,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -182,7 +182,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -199,7 +199,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -217,7 +217,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -233,7 +233,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -258,14 +258,14 @@ describe("vectorize", () => { const res1 = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": ct1 }, body: body1, }); const res2 = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": ct2 }, body: body2, }); @@ -294,7 +294,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -311,7 +311,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -329,7 +329,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -353,14 +353,14 @@ describe("vectorize", () => { const res1 = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": ct1 }, body: body1, }); const res2 = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": ct2 }, body: body2, }); @@ -382,7 +382,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { "content-type": contentType }, body, }); @@ -399,7 +399,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -420,7 +420,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -436,7 +436,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -456,7 +456,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -487,7 +487,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -508,7 +508,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -533,7 +533,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -554,7 +554,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -583,7 +583,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -602,7 +602,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -627,7 +627,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -650,7 +650,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -671,7 +671,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -692,7 +692,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -711,7 +711,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -735,7 +735,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -759,7 +759,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -780,7 +780,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -798,7 +798,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -816,7 +816,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -832,7 +832,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -850,7 +850,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -871,7 +871,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -890,7 +890,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -906,7 +906,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -927,7 +927,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -945,7 +945,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -974,7 +974,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1004,7 +1004,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1037,7 +1037,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1064,7 +1064,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1088,7 +1088,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1108,7 +1108,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1129,7 +1129,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1145,7 +1145,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1163,7 +1163,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1179,7 +1179,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1196,7 +1196,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1223,7 +1223,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1251,7 +1251,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1279,7 +1279,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1314,13 +1314,13 @@ describe("vectorize", () => { const resBw = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": ctBw }, body: bodyBw, }); const resColor = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": ctColor }, body: bodyColor, }); @@ -1345,7 +1345,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1375,7 +1375,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1407,7 +1407,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1436,7 +1436,7 @@ describe("vectorize", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vectorize", + url: "/api/v1/tools/image/vectorize", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/video-color.test.ts b/tests/integration/video-color.test.ts index 14cf053c..cebab3fe 100644 --- a/tests/integration/video-color.test.ts +++ b/tests/integration/video-color.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-color", + url: "/api/v1/tools/video/video-color", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/video-loudnorm.test.ts b/tests/integration/video-loudnorm.test.ts index 133f4d49..2b73d770 100644 --- a/tests/integration/video-loudnorm.test.ts +++ b/tests/integration/video-loudnorm.test.ts @@ -42,7 +42,7 @@ describe.skipIf(!ffmpegAvailable())("video-loudnorm (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-loudnorm", + url: "/api/v1/tools/video/video-loudnorm", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -62,7 +62,7 @@ describe.skipIf(!ffmpegAvailable())("video-loudnorm (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-loudnorm", + url: "/api/v1/tools/video/video-loudnorm", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/video-metadata.test.ts b/tests/integration/video-metadata.test.ts index ea6adea8..acbf5e59 100644 --- a/tests/integration/video-metadata.test.ts +++ b/tests/integration/video-metadata.test.ts @@ -27,7 +27,7 @@ describe.skipIf(!ffmpegAvailable())("video-metadata (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-metadata", + url: "/api/v1/tools/video/video-metadata", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/video-speed.test.ts b/tests/integration/video-speed.test.ts index 21138d54..d9ef81c9 100644 --- a/tests/integration/video-speed.test.ts +++ b/tests/integration/video-speed.test.ts @@ -39,7 +39,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-speed", + url: "/api/v1/tools/video/video-speed", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/video-to-frames.test.ts b/tests/integration/video-to-frames.test.ts index fda34be7..1ff55e45 100644 --- a/tests/integration/video-to-frames.test.ts +++ b/tests/integration/video-to-frames.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-to-frames", + url: "/api/v1/tools/video/video-to-frames", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/video-to-gif.test.ts b/tests/integration/video-to-gif.test.ts index eaa41935..0d42cac4 100644 --- a/tests/integration/video-to-gif.test.ts +++ b/tests/integration/video-to-gif.test.ts @@ -38,7 +38,7 @@ describe.skipIf(!ffmpegAvailable())("video-to-gif (requires ffmpeg)", () => { ]); const res = await testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-to-gif", + url: "/api/v1/tools/video/video-to-gif", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/video-to-webp.test.ts b/tests/integration/video-to-webp.test.ts index 4c485c7a..f1b1de1a 100644 --- a/tests/integration/video-to-webp.test.ts +++ b/tests/integration/video-to-webp.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/video-to-webp", + url: "/api/v1/tools/video/video-to-webp", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/vignette.test.ts b/tests/integration/vignette.test.ts index 08e62696..cae1f25b 100644 --- a/tests/integration/vignette.test.ts +++ b/tests/integration/vignette.test.ts @@ -37,7 +37,7 @@ describe("Vignette", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vignette", + url: "/api/v1/tools/image/vignette", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -69,7 +69,7 @@ describe("Vignette", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vignette", + url: "/api/v1/tools/image/vignette", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -107,7 +107,7 @@ describe("Vignette", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vignette", + url: "/api/v1/tools/image/vignette", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -145,7 +145,7 @@ describe("Vignette", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vignette", + url: "/api/v1/tools/image/vignette", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, @@ -176,7 +176,7 @@ describe("Vignette", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/vignette", + url: "/api/v1/tools/image/vignette", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType, diff --git a/tests/integration/volume-adjust.test.ts b/tests/integration/volume-adjust.test.ts index 742e3a2c..d25f135a 100644 --- a/tests/integration/volume-adjust.test.ts +++ b/tests/integration/volume-adjust.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/volume-adjust", + url: "/api/v1/tools/audio/volume-adjust", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/watermark-image.test.ts b/tests/integration/watermark-image.test.ts index 11689f2f..59b90491 100644 --- a/tests/integration/watermark-image.test.ts +++ b/tests/integration/watermark-image.test.ts @@ -40,7 +40,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -61,7 +61,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -92,7 +92,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -109,7 +109,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -125,7 +125,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -143,7 +143,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -162,7 +162,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -179,7 +179,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -198,7 +198,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -221,7 +221,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -243,7 +243,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -265,7 +265,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -287,7 +287,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -308,7 +308,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -326,7 +326,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -348,7 +348,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -369,7 +369,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -391,7 +391,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -412,7 +412,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -434,7 +434,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -456,7 +456,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -475,7 +475,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { "content-type": contentType }, body, }); @@ -498,7 +498,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -523,7 +523,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -545,7 +545,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -566,7 +566,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -596,7 +596,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -620,7 +620,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -639,7 +639,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -658,7 +658,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -678,7 +678,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -699,7 +699,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -719,7 +719,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -743,7 +743,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -766,7 +766,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -790,7 +790,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -812,7 +812,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -833,7 +833,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -856,7 +856,7 @@ describe("watermark-image", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-image", + url: "/api/v1/tools/image/watermark-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/watermark-pdf.test.ts b/tests/integration/watermark-pdf.test.ts index 4f7daa7e..95ff500d 100644 --- a/tests/integration/watermark-pdf.test.ts +++ b/tests/integration/watermark-pdf.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/watermark-pdf", + url: "/api/v1/tools/pdf/watermark-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/watermark-text.test.ts b/tests/integration/watermark-text.test.ts index 7d878862..b7ef9a8f 100644 --- a/tests/integration/watermark-text.test.ts +++ b/tests/integration/watermark-text.test.ts @@ -37,7 +37,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -57,7 +57,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -89,7 +89,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -110,7 +110,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -129,7 +129,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -144,7 +144,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -160,7 +160,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -178,7 +178,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -194,7 +194,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -213,7 +213,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -242,7 +242,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -263,7 +263,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -286,7 +286,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -313,7 +313,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -332,7 +332,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -359,7 +359,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -380,7 +380,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -399,7 +399,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -418,7 +418,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -438,7 +438,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { "content-type": contentType }, body, }); @@ -459,7 +459,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -487,7 +487,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -510,7 +510,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -532,7 +532,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -555,7 +555,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -576,7 +576,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -599,7 +599,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -622,7 +622,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -643,7 +643,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -664,7 +664,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -683,7 +683,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -706,7 +706,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -734,7 +734,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -755,7 +755,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -776,7 +776,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -803,7 +803,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -832,7 +832,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -852,7 +852,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -870,7 +870,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -896,7 +896,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -917,7 +917,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -945,7 +945,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -964,7 +964,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -987,7 +987,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1005,7 +1005,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); @@ -1026,7 +1026,7 @@ describe("watermark-text", () => { const res = await app.inject({ method: "POST", - url: "/api/v1/tools/watermark-text", + url: "/api/v1/tools/image/watermark-text", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/watermark-video.test.ts b/tests/integration/watermark-video.test.ts index 4d305ff0..6a33c2ab 100644 --- a/tests/integration/watermark-video.test.ts +++ b/tests/integration/watermark-video.test.ts @@ -26,7 +26,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/watermark-video", + url: "/api/v1/tools/video/watermark-video", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/waveform-image.test.ts b/tests/integration/waveform-image.test.ts index 0ac22599..306512b2 100644 --- a/tests/integration/waveform-image.test.ts +++ b/tests/integration/waveform-image.test.ts @@ -25,7 +25,7 @@ async function runTool(settings: Record) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/waveform-image", + url: "/api/v1/tools/audio/waveform-image", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/word-to-pdf.test.ts b/tests/integration/word-to-pdf.test.ts index f22781f7..0eb25e58 100644 --- a/tests/integration/word-to-pdf.test.ts +++ b/tests/integration/word-to-pdf.test.ts @@ -30,7 +30,7 @@ async function runTool(filename: string, content: Buffer) { ]); return testApp.app.inject({ method: "POST", - url: "/api/v1/tools/word-to-pdf", + url: "/api/v1/tools/files/word-to-pdf", headers: { authorization: `Bearer ${adminToken}`, "content-type": contentType }, body, }); diff --git a/tests/integration/xml-to-csv.test.ts b/tests/integration/xml-to-csv.test.ts index a1f04e3c..baec3dc6 100644 --- a/tests/integration/xml-to-csv.test.ts +++ b/tests/integration/xml-to-csv.test.ts @@ -20,7 +20,7 @@ async function runTool(filename: string, content: Buffer, settings: Record