mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
Normalise tool IDs and fix file history to render IDs properly (#4470)
# Description of Changes Normalise tool IDs and fix file history to render IDs properly
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
* FileContext uses pure File objects with separate ID tracking
|
||||
*/
|
||||
|
||||
import { ToolId } from "./toolId";
|
||||
|
||||
declare const tag: unique symbol;
|
||||
export type FileId = string & { readonly [tag]: 'FileId' };
|
||||
|
||||
@@ -11,7 +13,7 @@ export type FileId = string & { readonly [tag]: 'FileId' };
|
||||
* Note: Parameters removed for security - sensitive data like passwords should not be stored in history
|
||||
*/
|
||||
export interface ToolOperation {
|
||||
toolName: string;
|
||||
toolId: ToolId;
|
||||
timestamp: number;
|
||||
}
|
||||
|
||||
@@ -32,9 +34,5 @@ export interface BaseFileMetadata {
|
||||
originalFileId: string; // Root file ID for grouping versions
|
||||
versionNumber: number; // Version number in chain
|
||||
parentFileId?: FileId; // Immediate parent file ID
|
||||
toolHistory?: Array<{
|
||||
toolName: string;
|
||||
timestamp: number;
|
||||
}>; // Tool chain for history tracking
|
||||
|
||||
toolHistory?: ToolOperation[]; // Tool chain for history tracking
|
||||
}
|
||||
|
||||
@@ -1,19 +1,60 @@
|
||||
// Define all possible tool IDs as source of truth
|
||||
const TOOL_IDS = [
|
||||
'certSign', 'sign', 'addPassword', 'remove-password', 'removePages', 'remove-blank-pages', 'remove-annotations', 'remove-image',
|
||||
'change-permissions', 'addWatermark',
|
||||
'sanitize', 'auto-split-pages', 'auto-split-by-size-count', 'split', 'mergePdfs',
|
||||
'convert', 'ocr', 'add-image', 'rotate',
|
||||
'detect-split-scanned-photos',
|
||||
'edit-table-of-contents',
|
||||
'scanner-effect',
|
||||
'auto-rename-pdf-file', 'multi-page-layout', 'adjust-page-size-scale', 'adjust-contrast', 'cropPdf', 'single-large-page', 'multi-tool',
|
||||
'repair', 'compare', 'addPageNumbers', 'redact',
|
||||
'flatten', 'remove-certificate-sign',
|
||||
'unlock-pdf-forms', 'compress', 'extract-page', 'reorganize-pages', 'extract-images',
|
||||
'add-stamp', 'add-attachments', 'change-metadata', 'overlay-pdfs',
|
||||
'manage-certificates', 'get-all-info-on-pdf', 'validate-pdf-signature', 'read', 'automate', 'replace-and-invert-color',
|
||||
'show-javascript', 'dev-api', 'dev-folder-scanning', 'dev-sso-guide', 'dev-airgapped'
|
||||
'certSign',
|
||||
'sign',
|
||||
'addPassword',
|
||||
'removePassword',
|
||||
'removePages',
|
||||
'removeBlanks',
|
||||
'removeAnnotations',
|
||||
'removeImage',
|
||||
'changePermissions',
|
||||
'watermark',
|
||||
'sanitize',
|
||||
'autoSplitPDF',
|
||||
'autoSizeSplitPDF',
|
||||
'split',
|
||||
'merge',
|
||||
'convert',
|
||||
'ocr',
|
||||
'addImage',
|
||||
'rotate',
|
||||
'scannerImageSplit',
|
||||
'editTableOfContents',
|
||||
'fakeScan',
|
||||
'autoRename',
|
||||
'pageLayout',
|
||||
'scalePages',
|
||||
'adjustContrast',
|
||||
'crop',
|
||||
'pdfToSinglePage',
|
||||
'multiTool',
|
||||
'repair',
|
||||
'compare',
|
||||
'addPageNumbers',
|
||||
'redact',
|
||||
'flatten',
|
||||
'removeCertSign',
|
||||
'unlockPDFForms',
|
||||
'compress',
|
||||
'extractPages',
|
||||
'reorganizePages',
|
||||
'extractImages',
|
||||
'addStamp',
|
||||
'addAttachments',
|
||||
'changeMetadata',
|
||||
'overlayPdfs',
|
||||
'manageCertificates',
|
||||
'getPdfInfo',
|
||||
'validateSignature',
|
||||
'read',
|
||||
'automate',
|
||||
'replaceColorPdf',
|
||||
'showJS',
|
||||
'devApi',
|
||||
'devFolderScanning',
|
||||
'devSsoGuide',
|
||||
'devAirgapped',
|
||||
] as const;
|
||||
|
||||
// Tool identity - what PDF operation we're performing (type-safe)
|
||||
|
||||
Reference in New Issue
Block a user