Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(presentation): add AI actions and output schemas (#16045)

Kishan Parmar426f3a160104
diff --git a/bun.lock b/bun.lock
index 013ac94afd5..db3fabecc8b 100644
--- a/bun.lock
+++ b/bun.lock
@@ -7245,13 +7245,14 @@
},
"packages/pieces/community/presentation": {
"name": "@activepieces/piece-presentation",
- "version": "0.2.0",
+ "version": "0.3.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
"@activepieces/pieces-common": "workspace:*",
"@activepieces/pieces-framework": "workspace:*",
"dayjs": "1.11.9",
+ "form-data": "4.0.6",
},
"devDependencies": {
"tslib": "^2.3.0",
diff --git a/packages/pieces/community/presentation/package.json b/packages/pieces/community/presentation/package.json
index 534afdc1179..70aaa0083c6 100644
--- a/packages/pieces/community/presentation/package.json
+++ b/packages/pieces/community/presentation/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-presentation",
- "version": "0.2.0",
+ "version": "0.3.0",
"type": "commonjs",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
@@ -8,6 +8,7 @@
"@activepieces/pieces-common": "workspace:*",
"@activepieces/pieces-framework": "workspace:*",
"dayjs": "1.11.9",
+ "form-data": "4.0.6",
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*"
},
diff --git a/packages/pieces/community/presentation/src/index.ts b/packages/pieces/community/presentation/src/index.ts
index de3497060df..b8d531cca5f 100644
--- a/packages/pieces/community/presentation/src/index.ts
+++ b/packages/pieces/community/presentation/src/index.ts
@@ -1,3 +1,18 @@
+import { createIntegrationToken } from './lib/actions/ai/create-integration-token';
+import { createPresentationFromJson } from './lib/actions/ai/create-presentation-from-json';
+import { deleteImage } from './lib/actions/ai/delete-image';
+import { exportPresentation } from './lib/actions/ai/export-presentation';
+import { generateOutline } from './lib/actions/ai/generate-outline';
+import { generatePresentation } from './lib/actions/ai/generate-presentation';
+import { getStandardTemplate } from './lib/actions/ai/get-standard-template';
+import { getTaskStatus } from './lib/actions/ai/get-task-status';
+import { getTemplateExample } from './lib/actions/ai/get-template-example';
+import { listImages } from './lib/actions/ai/list-images';
+import { listPresentations } from './lib/actions/ai/list-presentations';
+import { listSmartDesigns } from './lib/actions/ai/list-smart-designs';
+import { listStandardTemplates } from './lib/actions/ai/list-standard-templates';
+import { uploadImage } from './lib/actions/ai/upload-image';
+import { uploadSourceFiles } from './lib/actions/ai/upload-source-files';
import { createPiece } from '@activepieces/pieces-framework';
import { generatePresentations } from './lib/actions/generate-presentations';
@@ -11,7 +26,7 @@ export const presentation = createPiece({
description:
'Generate AI-powered presentations using Presenton (https://presenton.ai). Supports templates, themes, images, synchronous and asynchronous generation, status polling, and export to PPTX/PDF.',
auth: presentonAuth,
- minimumSupportedRelease: '0.36.1',
+ minimumSupportedRelease: '0.88.2',
logoUrl: 'https://cdn.activepieces.com/pieces/presenton.png',
categories: [
PieceCategory.ARTIFICIAL_INTELLIGENCE,
@@ -20,6 +35,21 @@ export const presentation = createPiece({
authors: ['sanket-a11y'],
actions: [
generatePresentations,
+ createIntegrationToken,
+ createPresentationFromJson,
+ deleteImage,
+ exportPresentation,
+ generateOutline,
+ generatePresentation,
+ getStandardTemplate,
+ getTaskStatus,
+ getTemplateExample,
+ listImages,
+ listPresentations,
+ listSmartDesigns,
+ listStandardTemplates,
+ uploadImage,
+ uploadSourceFiles,
createCustomApiCallAction({
auth: presentonAuth,
baseUrl: () => 'https://api.presenton.ai/api/v1',
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/create-integration-token.ts b/packages/pieces/community/presentation/src/lib/actions/ai/create-integration-token.ts
new file mode 100644
index 00000000000..b92cbddd7aa
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/create-integration-token.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationCreateIntegrationTokenOutputSchema } from '../../output-schemas';
+
+export const createIntegrationToken = createAction({
+ auth: presentonAuth,
+ name: 'presentation_create_integration_token',
+ outputSchema: presentationCreateIntegrationTokenOutputSchema,
+ displayName: 'Create Integration Token',
+ description: 'Create an embed token for viewing or editing a presentation.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Creates a scoped integration token and frontend URL for embedding one presentation. Get the presentation id from presentation_list_presentations. Each call issues a new token.',
+ idempotent: false,
+ },
+ props: {
+ presentation: Property.ShortText({ displayName: 'Presentation ID', required: true }),
+ scopes: Property.StaticMultiSelectDropdown({
+ displayName: 'Scopes',
+ required: true,
+ options: {
+ options: [
+ { value: 'presentation:read', label: 'Read' },
+ { value: 'presentation:edit', label: 'Edit' },
+ { value: 'presentation:export', label: 'Export' },
+ ],
+ },
+ }),
+ expires_at: Property.ShortText({ displayName: 'Expires At', description: 'ISO 8601 date-time.', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ return presentonClient.request<Record<string, unknown>>({
+ auth: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/api/v3/presentation/integrate',
+ body: presentonClient.dropUndefined({
+ presentation: propsValue.presentation,
+ scopes: propsValue.scopes,
+ expires_at: propsValue.expires_at,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/create-presentation-from-json.ts b/packages/pieces/community/presentation/src/lib/actions/ai/create-presentation-from-json.ts
new file mode 100644
index 00000000000..d2954d0a183
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/create-presentation-from-json.ts
@@ -0,0 +1,59 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationExportPresentationOutputSchema } from '../../output-schemas';
+
+export const createPresentationFromJson = createAction({
+ auth: presentonAuth,
+ name: 'presentation_create_presentation_from_json',
+ outputSchema: presentationExportPresentationOutputSchema,
+ displayName: 'Create Presentation From JSON',
+ description: 'Create a presentation from explicit slide layouts and content.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Builds a presentation synchronously from a list of slides, each with a layout name and a content object. Get the standard_template id from presentation_list_standard_templates and valid layouts and content schemas from presentation_get_standard_template. Each call creates a new presentation.',
+ idempotent: false,
+ },
+ props: {
+ standard_template: Property.ShortText({ displayName: 'Standard Template ID', required: true }),
+ slides: Property.Json({
+ displayName: 'Slides',
+ description: 'Array of {"layout": string, "content": object, "speaker_note"?: string}.',
+ required: true,
+ }),
+ title: Property.ShortText({ displayName: 'Title', required: false }),
+ language: Property.ShortText({ displayName: 'Language', required: false, defaultValue: 'English' }),
+ export_as: Property.StaticDropdown({
+ displayName: 'Export As',
+ required: false,
+ defaultValue: 'pptx',
+ options: {
+ options: [
+ { value: 'pptx', label: 'PPTX' },
+ { value: 'pdf', label: 'PDF' },
+ { value: 'png', label: 'PNG' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ if (!Array.isArray(propsValue.slides) || propsValue.slides.length === 0) {
+ throw new Error('Slides must be a non-empty array.');
+ }
+ return presentonClient.request<Record<string, unknown>>({
+ auth: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/api/v3/presentation/from-json',
+ body: presentonClient.dropUndefined({
+ standard_template: propsValue.standard_template,
+ slides: propsValue.slides,
+ title: propsValue.title,
+ language: propsValue.language,
+ export_as: propsValue.export_as,
+ }),
+ });
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/delete-image.ts b/packages/pieces/community/presentation/src/lib/actions/ai/delete-image.ts
new file mode 100644
index 00000000000..a78c01f77ca
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/delete-image.ts
@@ -0,0 +1,31 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationDeleteImageOutputSchema } from '../../output-schemas';
+
+export const deleteImage = createAction({
+ auth: presentonAuth,
+ name: 'presentation_delete_image',
+ outputSchema: presentationDeleteImageOutputSchema,
+ displayName: 'Delete Image',
+ description: 'Permanently delete an uploaded image.',
+ audience: 'ai',
+ classification: 'DESTRUCTIVE',
+ aiMetadata: {
+ description:
+ 'Permanently deletes an uploaded image by id; this cannot be undone. Get the id from presentation_list_images or presentation_upload_image.',
+ idempotent: true,
+ },
+ props: {
+ id: Property.ShortText({ displayName: 'Image ID', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ await presentonClient.request<unknown>({
+ auth: auth.secret_text,
+ method: HttpMethod.DELETE,
+ path: `/api/v3/images/${encodeURIComponent(propsValue.id)}`,
+ });
+ return { success: true, id: propsValue.id };
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/export-presentation.ts b/packages/pieces/community/presentation/src/lib/actions/ai/export-presentation.ts
new file mode 100644
index 00000000000..4f3ee03e395
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/export-presentation.ts
@@ -0,0 +1,42 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationExportPresentationOutputSchema } from '../../output-schemas';
+
+export const exportPresentation = createAction({
+ auth: presentonAuth,
+ name: 'presentation_export_presentation',
+ outputSchema: presentationExportPresentationOutputSchema,
+ displayName: 'Export Presentation',
+ description: 'Export a presentation as PPTX, PDF or PNG.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Exports an existing presentation to a downloadable file and returns its path. Get the presentation id from presentation_list_presentations. Consumes credits on every call, so it is not idempotent.',
+ idempotent: false,
+ },
+ props: {
+ id: Property.ShortText({ displayName: 'Presentation ID', description: 'From presentation_list_presentations.', required: true }),
+ export_as: Property.StaticDropdown({
+ displayName: 'Export As',
+ required: true,
+ options: {
+ options: [
+ { value: 'pptx', label: 'PPTX' },
+ { value: 'pdf', label: 'PDF' },
+ { value: 'png', label: 'PNG' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ return presentonClient.request<Record<string, unknown>>({
+ auth: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/api/v3/presentation/export',
+ body: { id: propsValue.id, export_as: propsValue.export_as },
+ });
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/generate-outline.ts b/packages/pieces/community/presentation/src/lib/actions/ai/generate-outline.ts
new file mode 100644
index 00000000000..466b5012198
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/generate-outline.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationGenerateOutlineOutputSchema } from '../../output-schemas';
+
+export const generateOutline = createAction({
+ auth: presentonAuth,
+ name: 'presentation_generate_outline',
+ outputSchema: presentationGenerateOutlineOutputSchema,
+ displayName: 'Generate Outline',
+ description: 'Generate slide outlines for a topic without creating a deck.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Generates an array of slide outlines from content using a paid LLM call; no presentation is created. Output differs on every call. Use to draft or review structure before presentation_generate_presentation.',
+ idempotent: false,
+ },
+ props: {
+ content: Property.LongText({ displayName: 'Content', required: true }),
+ instructions: Property.LongText({ displayName: 'Instructions', required: false }),
+ n_slides: Property.Number({ displayName: 'Number of Slides', required: false }),
+ language: Property.ShortText({ displayName: 'Language', required: false }),
+ tone: Property.StaticDropdown({
+ displayName: 'Tone',
+ required: false,
+ options: {
+ options: [
+ { value: 'default', label: 'Default' },
+ { value: 'casual', label: 'Casual' },
+ { value: 'professional', label: 'Professional' },
+ { value: 'funny', label: 'Funny' },
+ { value: 'educational', label: 'Educational' },
+ { value: 'sales_pitch', label: 'Sales pitch' },
+ ],
+ },
+ }),
+ verbosity: Property.StaticDropdown({
+ displayName: 'Verbosity',
+ required: false,
+ options: {
+ options: [
+ { value: 'concise', label: 'Concise' },
+ { value: 'standard', label: 'Standard' },
+ { value: 'text-heavy', label: 'Text-heavy' },
+ ],
+ },
+ }),
+ files: Property.Array({ displayName: 'File IDs', description: 'Ids returned by presentation_upload_source_files.', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const outlines = await presentonClient.request<unknown[]>({
+ auth: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/api/v3/presentation/outlines/generate',
+ body: presentonClient.dropUndefined({
+ ...propsValue,
+ files: presentonClient.toStringArray(propsValue.files),
+ }),
+ });
+ return { count: outlines.length, outlines };
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/generate-presentation.ts b/packages/pieces/community/presentation/src/lib/actions/ai/generate-presentation.ts
new file mode 100644
index 00000000000..01ab153c7d2
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/generate-presentation.ts
@@ -0,0 +1,123 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationGeneratePresentationOutputSchema } from '../../output-schemas';
+
+const POLL_INTERVAL_MS = 5000;
+const MAX_WAIT_MS = 55000;
+
+const FAILED_STATUSES = ['failed', 'error'];
+
+type TaskStatus = { id: string; status: string } & Record<string, unknown>;
+
+function sleep({ ms }: { ms: number }) {
+ return new Promise((resolve) => setTimeout(resolve, ms));
+}
+
+export const generatePresentation = createAction({
+ auth: presentonAuth,
+ name: 'presentation_generate_presentation',
+ outputSchema: presentationGeneratePresentationOutputSchema,
+ displayName: 'Generate Presentation',
+ description: 'Generate an AI presentation from a prompt and wait for the result.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Starts a Presenton generation task (v3) from a content prompt, then waits up to 55 seconds for it to finish. If the task is still running when the wait ends, returns its id and status instead of failing: pass that id to presentation_get_task_status to keep polling. Use presentation_upload_source_files to get ids for files, and presentation_list_standard_templates for standard_template ids. Each call starts a new paid task.',
+ idempotent: false,
+ },
+ props: {
+ content: Property.LongText({ displayName: 'Content', description: 'Topic or text the presentation is generated from.', required: true }),
+ instructions: Property.LongText({ displayName: 'Instructions', required: false }),
+ n_slides: Property.Number({ displayName: 'Number of Slides', required: false }),
+ language: Property.ShortText({ displayName: 'Language', required: false }),
+ tone: Property.StaticDropdown({
+ displayName: 'Tone',
+ required: false,
+ options: {
+ options: [
+ { value: 'default', label: 'Default' },
+ { value: 'casual', label: 'Casual' },
+ { value: 'professional', label: 'Professional' },
+ { value: 'funny', label: 'Funny' },
+ { value: 'educational', label: 'Educational' },
+ { value: 'sales_pitch', label: 'Sales pitch' },
+ ],
+ },
+ }),
+ verbosity: Property.StaticDropdown({
+ displayName: 'Verbosity',
+ required: false,
+ options: {
+ options: [
+ { value: 'concise', label: 'Concise' },
+ { value: 'standard', label: 'Standard' },
+ { value: 'text-heavy', label: 'Text-heavy' },
+ ],
+ },
+ }),
+ standard_template: Property.ShortText({ displayName: 'Standard Template ID', description: 'From presentation_list_standard_templates.', required: false }),
+ smart_design: Property.ShortText({ displayName: 'Smart Design ID', description: 'From presentation_list_smart_designs.', required: false }),
+ image_type: Property.StaticDropdown({
+ displayName: 'Image Type',
+ required: false,
+ options: {
+ options: [
+ { value: 'stock', label: 'Stock' },
+ { value: 'ai-generated', label: 'AI generated' },
+ ],
+ },
+ }),
+ web_search: Property.Checkbox({ displayName: 'Enable Web Search', required: false, defaultValue: false }),
+ include_title_slide: Property.Checkbox({ displayName: 'Include Title Slide', required: false, defaultValue: true }),
+ include_table_of_contents: Property.Checkbox({ displayName: 'Include Table of Contents', required: false, defaultValue: false }),
+ files: Property.Array({ displayName: 'File IDs', description: 'Ids returned by presentation_upload_source_files.', required: false }),
+ reference_urls: Property.Array({ displayName: 'Reference URLs', required: false }),
+ export_as: Property.StaticDropdown({
+ displayName: 'Export As',
+ required: false,
+ defaultValue: 'pptx',
+ options: {
+ options: [
+ { value: 'pptx', label: 'PPTX' },
+ { value: 'pdf', label: 'PDF' },
+ { value: 'png', label: 'PNG' },
+ ],
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const apiKey = auth.secret_text;
+ const started = await presentonClient.request<TaskStatus>({
+ auth: apiKey,
+ method: HttpMethod.POST,
+ path: '/api/v3/presentation/generate/async',
+ body: presentonClient.dropUndefined({
+ ...propsValue,
+ files: presentonClient.toStringArray(propsValue.files),
+ reference_urls: presentonClient.toStringArray(propsValue.reference_urls),
+ }),
+ });
+
+ const deadline = Date.now() + MAX_WAIT_MS;
+ let task = started;
+ while (task.status !== 'completed' && !FAILED_STATUSES.includes(task.status) && Date.now() < deadline) {
+ await sleep({ ms: POLL_INTERVAL_MS });
+ task = await presentonClient.request<TaskStatus>({
+ auth: apiKey,
+ method: HttpMethod.GET,
+ path: `/api/v3/async-task/status/${started.id}`,
+ });
+ }
+
+ if (FAILED_STATUSES.includes(task.status)) {
+ throw new Error(`Presentation generation failed: ${JSON.stringify(task)}`);
+ }
+ if (task.status !== 'completed') {
+ return { id: started.id, status: task.status };
+ }
+ return task;
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/get-standard-template.ts b/packages/pieces/community/presentation/src/lib/actions/ai/get-standard-template.ts
new file mode 100644
index 00000000000..94c76c7742c
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/get-standard-template.ts
@@ -0,0 +1,30 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationGetStandardTemplateOutputSchema } from '../../output-schemas';
+
+export const getStandardTemplate = createAction({
+ auth: presentonAuth,
+ name: 'presentation_get_standard_template',
+ outputSchema: presentationGetStandardTemplateOutputSchema,
+ displayName: 'Get Standard Template',
+ description: 'Get a standard template with its layouts and schemas.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Reads one standard template, including its slide layouts and the content schema of each layout. Use before presentation_create_presentation_from_json to learn valid layout names and content shapes. Get the template id from presentation_list_standard_templates.',
+ idempotent: true,
+ },
+ props: {
+ template_id: Property.ShortText({ displayName: 'Template ID', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return presentonClient.request<Record<string, unknown>>({
+ auth: auth.secret_text,
+ method: HttpMethod.GET,
+ path: `/api/v3/standard-template/${encodeURIComponent(propsValue.template_id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/get-task-status.ts b/packages/pieces/community/presentation/src/lib/actions/ai/get-task-status.ts
new file mode 100644
index 00000000000..1e452348d7f
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/get-task-status.ts
@@ -0,0 +1,30 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationGetTaskStatusOutputSchema } from '../../output-schemas';
+
+export const getTaskStatus = createAction({
+ auth: presentonAuth,
+ name: 'presentation_get_task_status',
+ outputSchema: presentationGetTaskStatusOutputSchema,
+ displayName: 'Get Task Status',
+ description: 'Check the status of an asynchronous Presenton task.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Reads the current status of a Presenton async task once, returning status, message, error and result data when completed. Use the id returned by presentation_generate_presentation when it did not finish within its wait window.',
+ idempotent: true,
+ },
+ props: {
+ id: Property.ShortText({ displayName: 'Task ID', description: 'Task id returned by presentation_generate_presentation.', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return presentonClient.request<Record<string, unknown>>({
+ auth: auth.secret_text,
+ method: HttpMethod.GET,
+ path: `/api/v3/async-task/status/${encodeURIComponent(propsValue.id)}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/get-template-example.ts b/packages/pieces/community/presentation/src/lib/actions/ai/get-template-example.ts
new file mode 100644
index 00000000000..a210d5a3438
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/get-template-example.ts
@@ -0,0 +1,30 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationGetTemplateExampleOutputSchema } from '../../output-schemas';
+
+export const getTemplateExample = createAction({
+ auth: presentonAuth,
+ name: 'presentation_get_template_example',
+ outputSchema: presentationGetTemplateExampleOutputSchema,
+ displayName: 'Get Template Example',
+ description: 'Get an example deck for a standard template.',
+ audience: 'ai',
+ classification: 'READ',
+ aiMetadata: {
+ description:
+ 'Reads an example set of slides for a standard template, showing populated content for each layout. Use as a model when writing slides for presentation_create_presentation_from_json. Get the template id from presentation_list_standard_templates.',
+ idempotent: true,
+ },
+ props: {
+ template_id: Property.ShortText({ displayName: 'Template ID', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ return presentonClient.request<Record<string, unknown>>({
+ auth: auth.secret_text,
+ method: HttpMethod.GET,
+ path: `/api/v3/standard-template/${encodeURIComponent(propsValue.template_id)}/example`,
+ });
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/list-images.ts b/packages/pieces/community/presentation/src/lib/actions/ai/list-images.ts
new file mode 100644
index 00000000000..8cc16359042
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/list-images.ts
@@ -0,0 +1,30 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationListImagesOutputSchema } from '../../output-schemas';
+
+export const listImages = createAction({
+ auth: presentonAuth,
+ name: 'presentation_list_images',
+ outputSchema: presentationListImagesOutputSchema,
+ displayName: 'List Images',
+ description: 'List images uploaded to the Presenton image library.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists uploaded images with their ids and urls. Get the id for presentation_delete_image here.',
+ idempotent: true,
+ },
+ props: {},
+ async run({ auth }) {
+ const images = await presentonClient.request<unknown>({
+ auth: auth.secret_text,
+ method: HttpMethod.GET,
+ path: '/api/v3/images/uploaded',
+ });
+ const items = Array.isArray(images) ? images : [];
+ return { count: items.length, images: items };
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/list-presentations.ts b/packages/pieces/community/presentation/src/lib/actions/ai/list-presentations.ts
new file mode 100644
index 00000000000..f83f92042b1
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/list-presentations.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationListPresentationsOutputSchema } from '../../output-schemas';
+
+type Page = { results: unknown[] } & Record<string, unknown>;
+
+export const listPresentations = createAction({
+ auth: presentonAuth,
+ name: 'presentation_list_presentations',
+ outputSchema: presentationListPresentationsOutputSchema,
+ displayName: 'List Presentations',
+ description: 'List presentations in the Presenton account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists presentations with their ids, titles and creation times, one page at a time. Use to find the presentation id needed by presentation_export_presentation and presentation_create_integration_token. Filter by type to see only standard or smart-design decks.',
+ idempotent: true,
+ },
+ props: {
+ type: Property.StaticDropdown({
+ displayName: 'Type',
+ required: false,
+ options: {
+ options: [
+ { value: 'standard', label: 'Standard' },
+ { value: 'smart', label: 'Smart' },
+ ],
+ },
+ }),
+ page: Property.Number({ displayName: 'Page', required: false }),
+ page_size: Property.Number({ displayName: 'Page Size', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { type, page, page_size } = propsValue;
+ const response = await presentonClient.request<Page>({
+ auth: auth.secret_text,
+ method: HttpMethod.GET,
+ path: '/api/v3/presentation/all',
+ queryParams: {
+ type,
+ page: page === undefined ? undefined : String(page),
+ page_size: page_size === undefined ? undefined : String(page_size),
+ },
+ });
+ return { ...response, count: response.results.length };
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/list-smart-designs.ts b/packages/pieces/community/presentation/src/lib/actions/ai/list-smart-designs.ts
new file mode 100644
index 00000000000..58ac7af4aa3
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/list-smart-designs.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationListSmartDesignsOutputSchema } from '../../output-schemas';
+
+type Page = { results: unknown[] } & Record<string, unknown>;
+
+export const listSmartDesigns = createAction({
+ auth: presentonAuth,
+ name: 'presentation_list_smart_designs',
+ outputSchema: presentationListSmartDesignsOutputSchema,
+ displayName: 'List Smart Designs',
+ description: 'List Smart Designs available to the account.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists Smart Designs with their ids, one page at a time. Use the id as smart_design in presentation_generate_presentation.',
+ idempotent: true,
+ },
+ props: {
+ default: Property.Checkbox({ displayName: 'Default Designs Only', required: false }),
+ page: Property.Number({ displayName: 'Page', required: false }),
+ page_size: Property.Number({ displayName: 'Page Size', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { page, page_size } = propsValue;
+ const response = await presentonClient.request<Page>({
+ auth: auth.secret_text,
+ method: HttpMethod.GET,
+ path: '/api/v3/smart-design/all',
+ queryParams: {
+ default: propsValue.default ? 'true' : undefined,
+ page: page === undefined ? undefined : String(page),
+ page_size: page_size === undefined ? undefined : String(page_size),
+ },
+ });
+ return { ...response, count: response.results.length };
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/list-standard-templates.ts b/packages/pieces/community/presentation/src/lib/actions/ai/list-standard-templates.ts
new file mode 100644
index 00000000000..4b7ba33d263
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/list-standard-templates.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationListStandardTemplatesOutputSchema } from '../../output-schemas';
+
+type Page = { items: unknown[] } & Record<string, unknown>;
+
+export const listStandardTemplates = createAction({
+ auth: presentonAuth,
+ name: 'presentation_list_standard_templates',
+ outputSchema: presentationListStandardTemplatesOutputSchema,
+ displayName: 'List Standard Templates',
+ description: 'List standard presentation templates.',
+ audience: 'ai',
+ classification: 'SEARCH',
+ aiMetadata: {
+ description:
+ 'Lists standard templates with their ids and names, one page at a time. Use the id as standard_template in presentation_generate_presentation or presentation_create_presentation_from_json, or in presentation_get_standard_template.',
+ idempotent: true,
+ },
+ props: {
+ page: Property.Number({ displayName: 'Page', required: false }),
+ page_size: Property.Number({ displayName: 'Page Size', required: false }),
+ default: Property.Checkbox({ displayName: 'Default Templates Only', required: false }),
+ },
+ async run({ auth, propsValue }) {
+ const { page, page_size } = propsValue;
+ const response = await presentonClient.request<Page>({
+ auth: auth.secret_text,
+ method: HttpMethod.GET,
+ path: '/api/v3/standard-template/all',
+ queryParams: {
+ page: page === undefined ? undefined : String(page),
+ page_size: page_size === undefined ? undefined : String(page_size),
+ default: propsValue.default ? 'true' : undefined,
+ },
+ });
+ return { ...response, count: response.items.length };
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/upload-image.ts b/packages/pieces/community/presentation/src/lib/actions/ai/upload-image.ts
new file mode 100644
index 00000000000..778a8f3c823
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/upload-image.ts
@@ -0,0 +1,35 @@
+import FormData from 'form-data';
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationUploadImageOutputSchema } from '../../output-schemas';
+
+export const uploadImage = createAction({
+ auth: presentonAuth,
+ name: 'presentation_upload_image',
+ outputSchema: presentationUploadImageOutputSchema,
+ displayName: 'Upload Image',
+ description: 'Upload an image to the Presenton image library.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads one image and returns its id, path and url. Each call stores a new copy, so it is not idempotent. Remove it later with presentation_delete_image.',
+ idempotent: false,
+ },
+ props: {
+ file: Property.File({ displayName: 'Image', required: true }),
+ },
+ async run({ auth, propsValue }) {
+ const form = new FormData();
+ form.append('file', propsValue.file.data, propsValue.file.filename);
+ return presentonClient.request<Record<string, unknown>>({
+ auth: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/api/v3/images/upload',
+ body: form,
+ headers: form.getHeaders(),
+ });
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/ai/upload-source-files.ts b/packages/pieces/community/presentation/src/lib/actions/ai/upload-source-files.ts
new file mode 100644
index 00000000000..cfbc83d5905
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/actions/ai/upload-source-files.ts
@@ -0,0 +1,58 @@
+import FormData from 'form-data';
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { HttpMethod } from '@activepieces/pieces-common';
+import { presentonAuth } from '../../common/auth';
+import { presentonClient } from '../../common/client';
+import { presentationUploadSourceFilesOutputSchema } from '../../output-schemas';
+
+export const uploadSourceFiles = createAction({
+ auth: presentonAuth,
+ name: 'presentation_upload_source_files',
+ outputSchema: presentationUploadSourceFilesOutputSchema,
+ displayName: 'Upload Source Files',
+ description: 'Upload documents to use as source material for a presentation.',
+ audience: 'ai',
+ classification: 'WRITE',
+ aiMetadata: {
+ description:
+ 'Uploads one or more files and returns their ids as file_ids. Pass them as files to presentation_generate_presentation or presentation_generate_outline. Each call stores new copies, so it is not idempotent.',
+ idempotent: false,
+ },
+ props: {
+ files: Property.Array({
+ displayName: 'Files',
+ required: true,
+ properties: {
+ file: Property.File({ displayName: 'File', required: true }),
+ },
+ }),
+ },
+ async run({ auth, propsValue }) {
+ const items = Array.isArray(propsValue.files) ? propsValue.files : [];
+ if (items.length === 0) {
+ throw new Error('At least one file is required.');
+ }
+ const form = new FormData();
+ items.forEach((item) => {
+ if (typeof item === 'object' && item !== null && 'file' in item) {
+ const file = item.file;
+ if (
+ typeof file === 'object' && file !== null &&
+ 'data' in file && 'filename' in file &&
+ Buffer.isBuffer(file.data) && typeof file.filename === 'string'
+ ) {
+ form.append('files', file.data, file.filename);
+ }
+ }
+ });
+ const uploaded = await presentonClient.request<unknown[]>({
+ auth: auth.secret_text,
+ method: HttpMethod.POST,
+ path: '/api/v3/files/upload',
+ body: form,
+ headers: form.getHeaders(),
+ });
+ const fileIds = uploaded.filter((id): id is string => typeof id === 'string');
+ return { count: fileIds.length, file_ids: fileIds };
+ },
+});
diff --git a/packages/pieces/community/presentation/src/lib/actions/generate-presentations.ts b/packages/pieces/community/presentation/src/lib/actions/generate-presentations.ts
index 6248fe42892..756ef998101 100644
--- a/packages/pieces/community/presentation/src/lib/actions/generate-presentations.ts
+++ b/packages/pieces/community/presentation/src/lib/actions/generate-presentations.ts
@@ -1,6 +1,6 @@
import { createAction, Property } from '@activepieces/pieces-framework';
import { presentonAuth } from '../common/auth';
-import { makeRequest } from '../common/client';
+import { presentonClient } from '../common/client';
import { HttpMethod } from '@activepieces/pieces-common';
export const generatePresentations = createAction({
@@ -10,7 +10,7 @@ export const generatePresentations = createAction({
displayName: 'Generate Presentations (async)',
description:
'Create an asynchronous presentation generation task at Presenton and return the created task.',
- audience: 'both',
+ audience: 'human',
aiMetadata: {
description:
'Generate an AI-powered slide presentation in Presenton from a content prompt (or per-slide markdown), then poll until generation completes (up to 120 seconds) and return the finished presentation. Use when an agent needs to produce a deck from a topic or outline, optionally controlling tone, slide count, theme/template, image style (stock vs. AI-generated), web search, and export format (PPTX or PDF). Each call starts a new generation task, so it is not idempotent.',
@@ -209,12 +209,12 @@ export const generatePresentations = createAction({
body['trigger_webhook'] = trigger_webhook ?? false;
try {
- const response = await makeRequest(
- apiKey,
- HttpMethod.POST,
- '/ppt/presentation/generate/async',
- body
- );
+ const response = await presentonClient.request<{ id?: string; status?: string }>({
+ auth: apiKey,
+ method: HttpMethod.POST,
+ path: '/api/v1/ppt/presentation/generate/async',
+ body,
+ });
const pollIntervalSeconds = 5;
@@ -231,11 +231,11 @@ export const generatePresentations = createAction({
const sleep = (ms: number) => new Promise((res) => setTimeout(res, ms));
while (Date.now() - start < timeoutMs) {
- const statusResp = await makeRequest(
- apiKey,
- HttpMethod.GET,
- `/ppt/presentation/status/${taskId}`
- );
+ const statusResp = await presentonClient.request<{ id?: string; status?: string }>({
+ auth: apiKey,
+ method: HttpMethod.GET,
+ path: `/api/v1/ppt/presentation/status/${taskId}`,
+ });
if (statusResp.status === 'completed') {
return statusResp;
diff --git a/packages/pieces/community/presentation/src/lib/common/auth.ts b/packages/pieces/community/presentation/src/lib/common/auth.ts
index 848da86dc0c..f9baf88a033 100644
--- a/packages/pieces/community/presentation/src/lib/common/auth.ts
+++ b/packages/pieces/community/presentation/src/lib/common/auth.ts
@@ -1,21 +1,20 @@
import { PieceAuth } from '@activepieces/pieces-framework';
-import { makeRequest } from './client';
+import { presentonClient } from './client';
import { HttpMethod } from '@activepieces/pieces-common';
export const presentonAuth = PieceAuth.SecretText({
displayName: 'Presenton API Key',
- description: `
-`,
+ description:
+ 'Your Presenton API key. Create one from your account at https://presenton.ai.',
required: true,
validate: async ({ auth }) => {
if (auth) {
try {
- await makeRequest(
- auth as string,
- HttpMethod.GET,
- '/ppt/presentation/all',
- {}
- );
+ await presentonClient.request({
+ auth: auth as string,
+ method: HttpMethod.GET,
+ path: '/api/v1/ppt/presentation/all',
+ });
return {
valid: true,
};
diff --git a/packages/pieces/community/presentation/src/lib/common/client.ts b/packages/pieces/community/presentation/src/lib/common/client.ts
index 1707a187d4c..c8e39d7e971 100644
--- a/packages/pieces/community/presentation/src/lib/common/client.ts
+++ b/packages/pieces/community/presentation/src/lib/common/client.ts
@@ -1,25 +1,56 @@
-import { HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { HttpError, HttpMethod, httpClient } from '@activepieces/pieces-common';
-export const BASE_URL = `https://api.presenton.ai/api/v1`;
+const BASE_URL = 'https://api.presenton.ai';
-export async function makeRequest(
- api_key: string,
- method: HttpMethod,
- path: string,
- body?: unknown
-) {
+async function request<T>({
+ auth,
+ method,
+ path,
+ queryParams,
+ body,
+ headers,
+}: {
+ auth: string;
+ method: HttpMethod;
+ path: string;
+ queryParams?: Record<string, string | undefined>;
+ body?: unknown;
+ headers?: Record<string, string>;
+}): Promise<T> {
+ const query = Object.fromEntries(
+ Object.entries(queryParams ?? {}).filter(
+ (entry): entry is [string, string] => entry[1] !== undefined
+ )
+ );
try {
- const response = await httpClient.sendRequest({
+ const response = await httpClient.sendRequest<T>({
method,
url: `${BASE_URL}${path}`,
- headers: {
- Authorization: `Bearer ${api_key}`,
- 'Content-Type': 'application/json',
- },
+ headers: { Authorization: `Bearer ${auth}`, ...headers },
+ queryParams: query,
body,
});
return response.body;
- } catch (error: any) {
- throw new Error(`Unexpected error: ${error.message || String(error)}`);
+ } catch (error) {
+ if (error instanceof HttpError) {
+ const status = error.response.status;
+ throw new Error(
+ `Presenton API error (${status}): ${JSON.stringify(error.response.body)}`
+ );
+ }
+ throw error;
}
}
+
+function toStringArray(value: unknown): string[] | undefined {
+ if (!Array.isArray(value) || value.length === 0) return undefined;
+ return value.filter((item): item is string => typeof item === 'string');
+}
+
+function dropUndefined(obj: Record<string, unknown>): Record<string, unknown> {
+ return Object.fromEntries(
+ Object.entries(obj).filter(([, v]) => v !== undefined && v !== null)
+ );
+}
+
+export const presentonClient = { request: request, toStringArray, dropUndefined };
diff --git a/packages/pieces/community/presentation/src/lib/output-schemas.ts b/packages/pieces/community/presentation/src/lib/output-schemas.ts
new file mode 100644
index 00000000000..229545e3f1f
--- /dev/null
+++ b/packages/pieces/community/presentation/src/lib/output-schemas.ts
@@ -0,0 +1,235 @@
+import { OutputSchema } from '@activepieces/pieces-framework';
+
+const presentationFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'title', label: 'Title' },
+ { key: 'content', label: 'Content' },
+ { key: 'n_slides', label: 'Slides', format: 'number' },
+ { key: 'language', label: 'Language' },
+ { key: 'tone', label: 'Tone' },
+ { key: 'verbosity', label: 'Verbosity' },
+ { key: 'status', label: 'Status' },
+ {
+ key: 'theme',
+ label: 'Theme',
+ children: [
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ ],
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+];
+
+export const presentationListSmartDesignsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'total_pages', label: 'Total Pages', format: 'number' },
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'page_size', label: 'Page Size', format: 'number' },
+ {
+ key: 'results',
+ label: 'Results',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'thumbnail_url', label: 'Thumbnail URL', format: 'image' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ ],
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const presentationExportPresentationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'presentation_id', label: 'Presentation ID' },
+ { key: 'path', label: 'Path', format: 'url' },
+ { key: 'edit_path', label: 'Edit Path', format: 'url' },
+ { key: 'credits_consumed', label: 'Credits Consumed', format: 'number' },
+ ],
+};
+
+export const presentationGeneratePresentationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'status', label: 'Status' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'presentation_id', label: 'Presentation ID' },
+ { key: 'path', label: 'Path', format: 'url' },
+ { key: 'edit_path', label: 'Edit Path', format: 'url' },
+ { key: 'credits_consumed', label: 'Credits Consumed', format: 'number' },
+ ],
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'user', label: 'User' },
+ { key: 'type', label: 'Type' },
+ { key: 'message', label: 'Message' },
+ { key: 'error', label: 'Error' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
+
+export const presentationDeleteImageOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', format: 'boolean' },
+ { key: 'id', label: 'ID' },
+ ],
+};
+
+export const presentationListImagesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'images',
+ label: 'Images',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'path', label: 'Path' },
+ { key: 'extras', label: 'Extras' },
+ { key: 'is_uploaded', label: 'Is Uploaded', format: 'boolean' },
+ { key: 'user', label: 'User' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'url', label: 'URL', format: 'image' },
+ ],
+ },
+ ],
+};
+
+export const presentationUploadImageOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'user', label: 'User' },
+ { key: 'path', label: 'Path' },
+ { key: 'is_uploaded', label: 'Is Uploaded', format: 'boolean' },
+ { key: 'url', label: 'URL', format: 'image' },
+ { key: 'id', label: 'ID' },
+ { key: 'extras', label: 'Extras' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ ],
+};
+
+export const presentationGenerateOutlineOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'outlines', label: 'Outlines' },
+ ],
+};
+
+export const presentationListPresentationsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'total_pages', label: 'Total Pages', format: 'number' },
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'page_size', label: 'Page Size', format: 'number' },
+ { key: 'results', label: 'Results', labelKey: 'title', listItems: presentationFields },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const presentationUploadSourceFilesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'file_ids',
+ label: 'File IDs',
+ description: 'Pass these as the files input of Generate Presentation or Generate Outline.',
+ },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
+
+export const newpresentationOutputSchema: OutputSchema = {
+ fields: presentationFields,
+};
+
+export const presentationGetTaskStatusOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'status', label: 'Status' },
+ {
+ key: 'data',
+ label: 'Data',
+ children: [
+ { key: 'presentation_id', label: 'Presentation ID' },
+ { key: 'path', label: 'Path', format: 'url' },
+ { key: 'edit_path', label: 'Edit Path', format: 'url' },
+ { key: 'credits_consumed', label: 'Credits Consumed', format: 'number' },
+ ],
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'message', label: 'Message' },
+ { key: 'user', label: 'User' },
+ { key: 'type', label: 'Type' },
+ { key: 'error', label: 'Error' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
+
+export const presentationCreateIntegrationTokenOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'token', label: 'Token' },
+ { key: 'frontend_url', label: 'Frontend URL', format: 'url' },
+ { key: 'user', label: 'User' },
+ { key: 'presentation', label: 'Presentation' },
+ { key: 'scopes', label: 'Scopes' },
+ { key: 'version', label: 'Version' },
+ { key: 'expires_at', label: 'Expires At', format: 'datetime' },
+ ],
+};
+
+export const presentationGetTemplateExampleOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'standard_template', label: 'Standard Template' },
+ {
+ key: 'slides',
+ label: 'Slides',
+ labelKey: 'layout',
+ listItems: [
+ { key: 'layout', label: 'Layout' },
+ { key: 'content', label: 'Content' },
+ ],
+ },
+ ],
+};
+
+export const presentationGetStandardTemplateOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'layout_count', label: 'Layout Count', format: 'number' },
+ { key: 'thumbnail', label: 'Thumbnail', format: 'image' },
+ { key: 'is_default', label: 'Is Default', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'layouts', label: 'Layouts' },
+ { key: 'fonts', label: 'Fonts', dynamicKey: true, format: 'url' },
+ { key: 'schemas', label: 'Layout Schemas' },
+ ],
+};
+
+export const presentationListStandardTemplatesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Items',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'layout_count', label: 'Layout Count', format: 'number' },
+ { key: 'thumbnail', label: 'Thumbnail', format: 'image' },
+ { key: 'is_default', label: 'Is Default', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'page', label: 'Page', format: 'number' },
+ { key: 'page_size', label: 'Page Size', format: 'number' },
+ { key: 'count', label: 'Count', format: 'number' },
+ ],
+};
diff --git a/packages/pieces/community/presentation/src/lib/triggers/new-presentation.ts b/packages/pieces/community/presentation/src/lib/triggers/new-presentation.ts
index 5b6a81b4a47..13ff14a2587 100644
--- a/packages/pieces/community/presentation/src/lib/triggers/new-presentation.ts
+++ b/packages/pieces/community/presentation/src/lib/triggers/new-presentation.ts
@@ -11,8 +11,9 @@ import {
} from '@activepieces/pieces-common';
import dayjs from 'dayjs';
import { presentonAuth } from '../common/auth';
-import { makeRequest } from '../common/client';
+import { presentonClient } from '../common/client';
import { HttpMethod } from '@activepieces/pieces-common';
+import { newpresentationOutputSchema } from '../output-schemas';
const polling: Polling<
AppConnectionValueForAuthProperty<typeof presentonAuth>,
@@ -22,15 +23,17 @@ const polling: Polling<
items: async ({ auth, propsValue, lastFetchEpochMS }) => {
const apiKey = auth.secret_text;
- const response: any = await makeRequest(
- apiKey,
- HttpMethod.GET,
- '/ppt/presentation/all'
- );
+ const response = await presentonClient.request<{
+ results: { created_at: string }[];
+ }>({
+ auth: apiKey,
+ method: HttpMethod.GET,
+ path: '/api/v1/ppt/presentation/all',
+ });
const itemsArray = response.results;
- return itemsArray.map((item: any) => ({
+ return itemsArray.map((item) => ({
epochMilliSeconds: dayjs(item.created_at).valueOf(),
data: item,
}));
@@ -40,6 +43,7 @@ const polling: Polling<
export const newPresentation = createTrigger({
auth: presentonAuth,
name: 'newPresentation',
+ outputSchema: newpresentationOutputSchema,
classification: 'READ',
displayName: 'New Presentation',
description: 'Triggers when a new presentation is created in Presenton.',