91 lines
3.5 KiB
TypeScript
91 lines
3.5 KiB
TypeScript
/**
|
|
* One-off script: add the pdf-to-pdfa tool (and batch variant) to the database.
|
|
* Run from backend: npx ts-node scripts/add-pdf-to-pdfa-tool.ts
|
|
* Then export: npm run db:export-tools-json -- prisma/tools.json
|
|
*/
|
|
|
|
import { PrismaClient, AccessLevel, ProcessingType } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
const PDF_TO_PDFA_TOOL = {
|
|
slug: 'pdf-to-pdfa',
|
|
category: 'pdf',
|
|
name: 'PDF to PDF/A',
|
|
description: 'Convert PDF to archival PDF/A or PDF/X for long-term preservation',
|
|
accessLevel: AccessLevel.GUEST,
|
|
countsAsOperation: true,
|
|
dockerService: 'stirling-pdf',
|
|
processingType: ProcessingType.API,
|
|
isActive: true,
|
|
metaTitle: 'Convert PDF to PDF/A - Archival PDF Converter | Filezzy',
|
|
metaDescription: 'Convert PDF files to PDF/A or PDF/X for long-term archiving. PDF/A-1b, PDF/A-2b, PDF/A-3b. Free online PDF to PDF/A converter.',
|
|
nameLocalized: { en: 'PDF to PDF/A', fr: 'PDF en PDF/A' },
|
|
descriptionLocalized: {
|
|
en: 'Convert PDF to archival PDF/A or PDF/X for long-term preservation',
|
|
fr: 'Convertir PDF en PDF/A ou PDF/X pour archivage à long terme',
|
|
},
|
|
metaTitleLocalized: {
|
|
en: 'Convert PDF to PDF/A - Archival PDF Converter | Filezzy',
|
|
fr: 'Convertir PDF en PDF/A - Convertisseur PDF d\'archivage | Filezzy',
|
|
},
|
|
metaDescriptionLocalized: {
|
|
en: 'Convert PDF files to PDF/A or PDF/X for long-term archiving. PDF/A-1b, PDF/A-2b, PDF/A-3b. Free online PDF to PDF/A converter.',
|
|
fr: 'Convertissez PDF en PDF/A ou PDF/X pour archivage. PDF/A-1b, PDF/A-2b, PDF/A-3b. Convertisseur PDF vers PDF/A gratuit en ligne.',
|
|
},
|
|
};
|
|
|
|
const BATCH_PDF_TO_PDFA_TOOL = {
|
|
slug: 'batch-pdf-to-pdfa',
|
|
category: 'batch',
|
|
name: 'Batch PDF to PDF/A',
|
|
description: 'Convert multiple PDFs to PDF/A at once. Same standard for all files.',
|
|
accessLevel: AccessLevel.GUEST,
|
|
countsAsOperation: true,
|
|
dockerService: 'stirling-pdf',
|
|
processingType: ProcessingType.API,
|
|
isActive: true,
|
|
metaTitle: 'Batch PDF to PDF/A - Convert Multiple PDFs | Filezzy',
|
|
metaDescription: 'Convert multiple PDF files to PDF/A archival format at once. Same PDF/A standard for all. Free batch PDF to PDF/A converter.',
|
|
nameLocalized: { en: 'Batch PDF to PDF/A', fr: 'PDF en PDF/A par lot' },
|
|
descriptionLocalized: {
|
|
en: 'Convert multiple PDFs to PDF/A at once. Same standard for all files.',
|
|
fr: 'Convertir plusieurs PDF en PDF/A en une fois. Même norme pour tous.',
|
|
},
|
|
metaTitleLocalized: {
|
|
en: 'Batch PDF to PDF/A - Convert Multiple PDFs | Filezzy',
|
|
fr: 'PDF vers PDF/A par Lot | Filezzy',
|
|
},
|
|
metaDescriptionLocalized: {
|
|
en: 'Convert multiple PDF files to PDF/A archival format at once. Same PDF/A standard for all. Free batch PDF to PDF/A converter.',
|
|
fr: 'Convertissez plusieurs PDF en PDF/A en une fois. Même norme pour tous. Convertisseur PDF vers PDF/A par lot gratuit.',
|
|
},
|
|
};
|
|
|
|
async function main() {
|
|
console.log('\nAdding pdf-to-pdfa and batch-pdf-to-pdfa tools...\n');
|
|
|
|
await prisma.tool.upsert({
|
|
where: { slug: PDF_TO_PDFA_TOOL.slug },
|
|
create: PDF_TO_PDFA_TOOL,
|
|
update: PDF_TO_PDFA_TOOL,
|
|
});
|
|
console.log(' ✅ pdf-to-pdfa upserted');
|
|
|
|
await prisma.tool.upsert({
|
|
where: { slug: BATCH_PDF_TO_PDFA_TOOL.slug },
|
|
create: BATCH_PDF_TO_PDFA_TOOL,
|
|
update: BATCH_PDF_TO_PDFA_TOOL,
|
|
});
|
|
console.log(' ✅ batch-pdf-to-pdfa upserted');
|
|
|
|
console.log('\nDone. To refresh prisma/tools.json run: npm run db:export-tools-json -- prisma/tools.json\n');
|
|
}
|
|
|
|
main()
|
|
.catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
})
|
|
.finally(() => prisma.$disconnect());
|