Files
filezzy-staging/backend/scripts/add-pdf-to-presentation-tool.ts
2026-02-04 14:16:04 +01:00

91 lines
3.5 KiB
TypeScript

/**
* One-off script: add the pdf-to-presentation tool (and batch variant) to the database.
* Run from backend: npx ts-node scripts/add-pdf-to-presentation-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_PRESENTATION_TOOL = {
slug: 'pdf-to-presentation',
category: 'pdf',
name: 'PDF to PowerPoint',
description: 'Convert PDF to PowerPoint presentation (.pptx)',
accessLevel: AccessLevel.GUEST,
countsAsOperation: true,
dockerService: 'stirling-pdf',
processingType: ProcessingType.API,
isActive: true,
metaTitle: 'Convert PDF to PowerPoint - PDF to PPTX Online | Filezzy',
metaDescription: 'Convert PDF files to PowerPoint presentation (.pptx). Turn PDF pages into editable slides. Free online PDF to PowerPoint converter.',
nameLocalized: { en: 'PDF to PowerPoint', fr: 'PDF en PowerPoint' },
descriptionLocalized: {
en: 'Convert PDF to PowerPoint presentation (.pptx)',
fr: 'Convertir PDF en présentation PowerPoint (.pptx)',
},
metaTitleLocalized: {
en: 'Convert PDF to PowerPoint - PDF to PPTX Online | Filezzy',
fr: 'Convertir PDF en PowerPoint - PDF vers PPTX en ligne | Filezzy',
},
metaDescriptionLocalized: {
en: 'Convert PDF files to PowerPoint presentation (.pptx). Turn PDF pages into editable slides. Free online PDF to PowerPoint converter.',
fr: 'Convertissez PDF en présentation PowerPoint (.pptx). Pages PDF en diapositives éditables. Convertisseur PDF vers PowerPoint gratuit en ligne.',
},
};
const BATCH_PDF_TO_PRESENTATION_TOOL = {
slug: 'batch-pdf-to-presentation',
category: 'batch',
name: 'Batch PDF to PowerPoint',
description: 'Convert multiple PDFs to PowerPoint at once.',
accessLevel: AccessLevel.GUEST,
countsAsOperation: true,
dockerService: 'stirling-pdf',
processingType: ProcessingType.API,
isActive: true,
metaTitle: 'Batch PDF to PowerPoint - Convert Multiple PDFs | Filezzy',
metaDescription: 'Convert multiple PDF files to PowerPoint (.pptx) at once. Free batch PDF to PowerPoint converter.',
nameLocalized: { en: 'Batch PDF to PowerPoint', fr: 'PDF en PowerPoint par lot' },
descriptionLocalized: {
en: 'Convert multiple PDFs to PowerPoint at once.',
fr: 'Convertir plusieurs PDF en PowerPoint en une fois.',
},
metaTitleLocalized: {
en: 'Batch PDF to PowerPoint - Convert Multiple PDFs | Filezzy',
fr: 'PDF vers PowerPoint par Lot | Filezzy',
},
metaDescriptionLocalized: {
en: 'Convert multiple PDF files to PowerPoint (.pptx) at once. Free batch PDF to PowerPoint converter.',
fr: 'Convertissez plusieurs PDF en PowerPoint (.pptx) en une fois. Convertisseur PDF vers PowerPoint par lot gratuit.',
},
};
async function main() {
console.log('\nAdding pdf-to-presentation and batch-pdf-to-presentation tools...\n');
await prisma.tool.upsert({
where: { slug: PDF_TO_PRESENTATION_TOOL.slug },
create: PDF_TO_PRESENTATION_TOOL,
update: PDF_TO_PRESENTATION_TOOL,
});
console.log(' ✅ pdf-to-presentation upserted');
await prisma.tool.upsert({
where: { slug: BATCH_PDF_TO_PRESENTATION_TOOL.slug },
create: BATCH_PDF_TO_PRESENTATION_TOOL,
update: BATCH_PDF_TO_PRESENTATION_TOOL,
});
console.log(' ✅ batch-pdf-to-presentation 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());