Stirling-PDF/frontend/src/core/utils/urlMapping.ts
Anthony Stirling bdb3c887f3
opensource text editor (#5146)
# Description of Changes

<!--
Please provide a summary of the changes, including:

- What was changed
- Why the change was made
- Any challenges encountered

Closes #(issue_number)
-->

---

## Checklist

### General

- [ ] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [ ] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md)
(if applicable)
- [ ] I have performed a self-review of my own code
- [ ] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [ ] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/devGuide/DeveloperGuide.md#6-testing)
for more details.
2025-12-03 12:55:34 +00:00

132 lines
3.8 KiB
TypeScript

import { ToolId } from '@app/types/toolId';
// Map URL paths to tool keys (multiple URLs can map to same tool)
export const URL_TO_TOOL_MAP: Record<string, ToolId> = {
// Basic tools - standard patterns
'/split': 'split',
'/split-pdfs': 'split',
'/merge': 'merge',
'/merge-pdfs': 'merge',
'/compress': 'compress',
'/compress-pdf': 'compress',
'/rotate': 'rotate',
'/rotate-pdf': 'rotate',
'/repair': 'repair',
'/flatten': 'flatten',
'/crop': 'crop',
// Convert tool and all its variants
'/convert': 'convert',
'/convert-pdf': 'convert',
'/file-to-pdf': 'convert',
'/eml-to-pdf': 'convert',
'/html-to-pdf': 'convert',
'/markdown-to-pdf': 'convert',
'/pdf-to-csv': 'convert',
'/pdf-to-img': 'convert',
'/pdf-to-markdown': 'convert',
'/pdf-to-pdfa': 'convert',
'/pdf-to-word': 'convert',
'/pdf-to-xml': 'convert',
'/cbz-to-pdf': 'convert',
'/pdf-to-cbz': 'convert',
// Security tools
'/add-password': 'addPassword',
'/remove-password': 'removePassword',
'/change-permissions': 'changePermissions',
'/cert-sign': 'certSign',
'/manage-signatures': 'certSign',
'/remove-certificate-sign': 'removeCertSign',
'/remove-cert-sign': 'removeCertSign',
'/unlock-pdf-forms': 'unlockPDFForms',
'/validate-signature': 'validateSignature',
// Content manipulation
'/sanitize': 'sanitize',
'/sanitize-pdf': 'sanitize',
'/ocr': 'ocr',
'/ocr-pdf': 'ocr',
'/watermark': 'watermark',
'/add-watermark': 'watermark',
'/add-image': 'addImage',
'/add-stamp': 'addStamp',
'/add-page-numbers': 'addPageNumbers',
'/redact': 'redact',
// Page manipulation
'/remove-pages': 'removePages',
'/remove-blanks': 'removeBlanks',
'/extract-pages': 'extractPages',
'/reorganize-pages': 'reorganizePages',
'/single-large-page': 'pdfToSinglePage',
'/page-layout': 'pageLayout',
'/scale-pages': 'scalePages',
'/booklet-imposition': 'bookletImposition',
// Splitting tools
'/auto-split-pdf': 'split',
'/auto-size-split-pdf': 'split',
'/scanner-image-split': 'scannerImageSplit',
// Annotation and content removal
'/remove-annotations': 'removeAnnotations',
'/remove-image': 'removeImage',
// Image and visual tools
'/extract-images': 'extractImages',
'/adjust-contrast': 'adjustContrast',
'/fake-scan': 'scannerEffect',
'/replace-color-pdf': 'replaceColor',
// Metadata and info
'/change-metadata': 'changeMetadata',
'/get-pdf-info': 'getPdfInfo',
'/add-attachments': 'addAttachments',
// Advanced tools
'/overlay-pdfs': 'overlayPdfs',
'/edit-table-of-contents': 'editTableOfContents',
'/auto-rename': 'autoRename',
'/compare': 'compare',
'/multi-tool': 'multiTool',
'/show-js': 'showJS',
// Special/utility tools
'/read': 'read',
'/automate': 'automate',
'/sign': 'sign',
'/add-text': 'addText',
'/pdf-text-editor': 'pdfTextEditor',
// Developer tools
'/dev-api': 'devApi',
'/dev-folder-scanning': 'devFolderScanning',
'/dev-sso-guide': 'devSsoGuide',
'/dev-airgapped': 'devAirgapped',
// Legacy URL mappings from sitemap
'/pdf-organizer': 'reorganizePages',
'/multi-page-layout': 'pageLayout',
'/extract-page': 'extractPages',
'/pdf-to-single-page': 'pdfToSinglePage',
'/img-to-pdf': 'convert',
'/pdf-to-presentation': 'convert',
'/pdf-to-text': 'convert',
'/pdf-to-html': 'convert',
'/auto-redact': 'redact',
'/stamp': 'addStamp',
'/view-pdf': 'read',
'/get-info-on-pdf': 'getPdfInfo',
'/remove-image-pdf': 'removeImage',
'/replace-and-invert-color-pdf': 'replaceColor',
'/pipeline': 'automate',
'/extract-image-scans': 'scannerImageSplit',
'/show-javascript': 'showJS',
'/scanner-effect': 'scannerEffect',
'/split-by-size-or-count': 'split',
'/overlay-pdf': 'overlayPdfs',
'/split-pdf-by-sections': 'split',
'/split-pdf-by-chapters': 'split',
};