@activepieces/piece-presentation 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-presenton
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build pieces-presenton` to build the library.
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@activepieces/piece-presentation",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@sinclair/typebox": "0.34.11",
9
+ "axios": "1.8.3",
10
+ "axios-retry": "4.4.1",
11
+ "dayjs": "1.11.9",
12
+ "deepmerge-ts": "7.1.0",
13
+ "mime-types": "2.1.35",
14
+ "nanoid": "3.3.8",
15
+ "semver": "7.6.0",
16
+ "socket.io-client": "4.8.1",
17
+ "tslib": "^2.3.0",
18
+ "zod": "3.25.76",
19
+ "@activepieces/pieces-common": "0.8.1",
20
+ "@activepieces/pieces-framework": "0.20.2",
21
+ "@activepieces/shared": "0.25.2"
22
+ },
23
+ "resolutions": {
24
+ "rollup": "npm:@rollup/wasm-node"
25
+ }
26
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const presentation: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.presentation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const generate_presentations_1 = require("./lib/actions/generate-presentations");
7
+ const auth_1 = require("./lib/common/auth");
8
+ const shared_1 = require("@activepieces/shared");
9
+ const new_presentation_1 = require("./lib/triggers/new-presentation");
10
+ const pieces_common_1 = require("@activepieces/pieces-common");
11
+ exports.presentation = (0, pieces_framework_1.createPiece)({
12
+ displayName: 'Presenton',
13
+ 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.',
14
+ auth: auth_1.presentonAuth,
15
+ minimumSupportedRelease: '0.36.1',
16
+ logoUrl: 'https://cdn.activepieces.com/pieces/presenton.png',
17
+ categories: [
18
+ shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE,
19
+ shared_1.PieceCategory.CONTENT_AND_FILES,
20
+ ],
21
+ authors: ['sanket-a11y'],
22
+ actions: [
23
+ generate_presentations_1.generatePresentations,
24
+ (0, pieces_common_1.createCustomApiCallAction)({
25
+ auth: auth_1.presentonAuth,
26
+ baseUrl: () => 'https://api.presenton.ai/api/v1',
27
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
28
+ return {
29
+ Authorization: `Bearer ${auth}`,
30
+ };
31
+ }),
32
+ }),
33
+ ],
34
+ triggers: [new_presentation_1.newPresentation],
35
+ });
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/presenton/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,iFAA6E;AAE7E,4CAAkD;AAClD,iDAAqD;AACrD,sEAAkE;AAClE,+DAAwE;AAE3D,QAAA,YAAY,GAAG,IAAA,8BAAW,EAAC;IACtC,WAAW,EAAE,WAAW;IACxB,WAAW,EACT,gMAAgM;IAClM,IAAI,EAAE,oBAAa;IACnB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,mDAAmD;IAC5D,UAAU,EAAE;QACV,sBAAa,CAAC,uBAAuB;QACrC,sBAAa,CAAC,iBAAiB;KAChC;IACD,OAAO,EAAE,CAAC,aAAa,CAAC;IACxB,OAAO,EAAE;QACP,8CAAqB;QACrB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,oBAAa;YACnB,OAAO,EAAE,GAAG,EAAE,CAAC,iCAAiC;YAChD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,EAAE;iBAChC,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,kCAAe,CAAC;CAC5B,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const generatePresentations: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
+ content: import("@activepieces/pieces-framework").LongTextProperty<false>;
3
+ instructions: import("@activepieces/pieces-framework").LongTextProperty<false>;
4
+ tone: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
5
+ verbosity: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
6
+ slides_markdown: import("@activepieces/pieces-framework").ArrayProperty<false>;
7
+ markdown_emphasis: import("@activepieces/pieces-framework").CheckboxProperty<false>;
8
+ web_search: import("@activepieces/pieces-framework").CheckboxProperty<false>;
9
+ image_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
10
+ theme: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ n_slides: import("@activepieces/pieces-framework").NumberProperty<false>;
12
+ language: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
+ template: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
14
+ include_table_of_contents: import("@activepieces/pieces-framework").CheckboxProperty<false>;
15
+ include_title_slide: import("@activepieces/pieces-framework").CheckboxProperty<false>;
16
+ allow_access_to_user_info: import("@activepieces/pieces-framework").CheckboxProperty<false>;
17
+ files: import("@activepieces/pieces-framework").ArrayProperty<false>;
18
+ export_as: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
19
+ trigger_webhook: import("@activepieces/pieces-framework").CheckboxProperty<false>;
20
+ }>;
@@ -0,0 +1,217 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generatePresentations = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const client_1 = require("../common/client");
8
+ const pieces_common_1 = require("@activepieces/pieces-common");
9
+ exports.generatePresentations = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.presentonAuth,
11
+ name: 'generate_presentations',
12
+ displayName: 'Generate Presentations (async)',
13
+ description: 'Create an asynchronous presentation generation task at Presenton and return the created task.',
14
+ props: {
15
+ content: pieces_framework_1.Property.LongText({
16
+ displayName: 'Content',
17
+ description: 'The content for generating the presentation',
18
+ required: false,
19
+ }),
20
+ instructions: pieces_framework_1.Property.LongText({
21
+ displayName: 'Instructions',
22
+ description: 'Instruction for generating the presentation (optional).',
23
+ required: false,
24
+ }),
25
+ tone: pieces_framework_1.Property.StaticDropdown({
26
+ displayName: 'Tone',
27
+ description: 'Tone to use for the text',
28
+ required: false,
29
+ defaultValue: 'default',
30
+ options: {
31
+ options: [
32
+ { value: 'default', label: 'Default' },
33
+ { value: 'casual', label: 'Casual' },
34
+ { value: 'professional', label: 'Professional' },
35
+ { value: 'funny', label: 'Funny' },
36
+ { value: 'educational', label: 'Educational' },
37
+ { value: 'sales_pitch', label: 'Sales pitch' },
38
+ ],
39
+ },
40
+ }),
41
+ verbosity: pieces_framework_1.Property.StaticDropdown({
42
+ displayName: 'Verbosity',
43
+ description: 'How verbose the text should be',
44
+ required: false,
45
+ defaultValue: 'standard',
46
+ options: {
47
+ options: [
48
+ { value: 'concise', label: 'Concise' },
49
+ { value: 'standard', label: 'Standard' },
50
+ { value: 'text-heavy', label: 'Text-heavy' },
51
+ ],
52
+ },
53
+ }),
54
+ slides_markdown: pieces_framework_1.Property.Array({
55
+ displayName: 'Slides markdown',
56
+ description: 'An array of markdown strings for each slide (optional).',
57
+ required: false,
58
+ defaultValue: [],
59
+ }),
60
+ markdown_emphasis: pieces_framework_1.Property.Checkbox({
61
+ displayName: 'Markdown emphasis',
62
+ description: 'Whether to emphasize the markdown',
63
+ required: false,
64
+ defaultValue: true,
65
+ }),
66
+ web_search: pieces_framework_1.Property.Checkbox({
67
+ displayName: 'Enable web search',
68
+ description: 'Whether to enable web search',
69
+ required: false,
70
+ defaultValue: false,
71
+ }),
72
+ image_type: pieces_framework_1.Property.StaticDropdown({
73
+ displayName: 'Image type',
74
+ description: 'Type of image to generate',
75
+ required: false,
76
+ defaultValue: 'stock',
77
+ options: {
78
+ options: [
79
+ { value: 'stock', label: 'Stock' },
80
+ { value: 'ai-generated', label: 'AI generated' },
81
+ ],
82
+ },
83
+ }),
84
+ theme: pieces_framework_1.Property.ShortText({
85
+ displayName: 'Theme',
86
+ description: 'Theme to use for the presentation (e.g. edge-yellow, light-rose)',
87
+ required: false,
88
+ }),
89
+ n_slides: pieces_framework_1.Property.Number({
90
+ displayName: 'Number of slides',
91
+ description: 'Number of slides to generate',
92
+ required: false,
93
+ defaultValue: 8,
94
+ }),
95
+ language: pieces_framework_1.Property.ShortText({
96
+ displayName: 'Language',
97
+ description: 'Language for the presentation',
98
+ required: false,
99
+ defaultValue: 'English',
100
+ }),
101
+ template: pieces_framework_1.Property.StaticDropdown({
102
+ displayName: 'Template',
103
+ description: 'Template to use for the presentation',
104
+ required: false,
105
+ defaultValue: 'general',
106
+ options: {
107
+ options: [
108
+ { value: 'general', label: 'General' },
109
+ { value: 'modern', label: 'Modern' },
110
+ { value: 'standard', label: 'Standard' },
111
+ { value: 'swift', label: 'Swift' },
112
+ ],
113
+ },
114
+ }),
115
+ include_table_of_contents: pieces_framework_1.Property.Checkbox({
116
+ displayName: 'Include table of contents',
117
+ description: 'Whether to include a table of contents',
118
+ required: false,
119
+ defaultValue: false,
120
+ }),
121
+ include_title_slide: pieces_framework_1.Property.Checkbox({
122
+ displayName: 'Include title slide',
123
+ description: 'Whether to include a title slide',
124
+ required: false,
125
+ defaultValue: true,
126
+ }),
127
+ allow_access_to_user_info: pieces_framework_1.Property.Checkbox({
128
+ displayName: "Allow access to user's info",
129
+ description: "Whether to allow access to user's info",
130
+ required: false,
131
+ defaultValue: true,
132
+ }),
133
+ files: pieces_framework_1.Property.Array({
134
+ displayName: 'Files',
135
+ description: 'Array of file identifiers uploaded via Presenton files API (optional).',
136
+ required: false,
137
+ defaultValue: [],
138
+ }),
139
+ export_as: pieces_framework_1.Property.StaticDropdown({
140
+ displayName: 'Export as',
141
+ description: 'Export format',
142
+ required: false,
143
+ defaultValue: 'pptx',
144
+ options: {
145
+ options: [
146
+ { value: 'pptx', label: 'PPTX' },
147
+ { value: 'pdf', label: 'PDF' },
148
+ ],
149
+ },
150
+ }),
151
+ trigger_webhook: pieces_framework_1.Property.Checkbox({
152
+ displayName: 'Trigger webhook',
153
+ description: 'Whether to trigger subscribed webhooks',
154
+ required: false,
155
+ defaultValue: false,
156
+ }),
157
+ },
158
+ run(_a) {
159
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
160
+ const apiKey = auth;
161
+ const { content, slides_markdown, instructions, tone, verbosity, markdown_emphasis, web_search, image_type, theme, n_slides, language, template, include_table_of_contents, include_title_slide, allow_access_to_user_info, files, export_as, trigger_webhook, } = propsValue;
162
+ const body = {};
163
+ if (content)
164
+ body['content'] = content;
165
+ if (slides_markdown)
166
+ body['slides_markdown'] = slides_markdown;
167
+ if (instructions)
168
+ body['instructions'] = instructions;
169
+ if (tone)
170
+ body['tone'] = tone;
171
+ if (verbosity)
172
+ body['verbosity'] = verbosity;
173
+ body['markdown_emphasis'] = markdown_emphasis !== null && markdown_emphasis !== void 0 ? markdown_emphasis : true;
174
+ body['web_search'] = web_search !== null && web_search !== void 0 ? web_search : false;
175
+ if (image_type)
176
+ body['image_type'] = image_type;
177
+ if (theme)
178
+ body['theme'] = theme;
179
+ body['n_slides'] = Number(n_slides !== null && n_slides !== void 0 ? n_slides : 8);
180
+ body['language'] = language !== null && language !== void 0 ? language : 'English';
181
+ body['template'] = template !== null && template !== void 0 ? template : 'general';
182
+ body['include_table_of_contents'] = include_table_of_contents !== null && include_table_of_contents !== void 0 ? include_table_of_contents : false;
183
+ body['include_title_slide'] = include_title_slide !== null && include_title_slide !== void 0 ? include_title_slide : true;
184
+ body['allow_access_to_user_info'] = allow_access_to_user_info !== null && allow_access_to_user_info !== void 0 ? allow_access_to_user_info : true;
185
+ if (files)
186
+ body['files'] = files;
187
+ body['export_as'] = export_as !== null && export_as !== void 0 ? export_as : 'pptx';
188
+ body['trigger_webhook'] = trigger_webhook !== null && trigger_webhook !== void 0 ? trigger_webhook : false;
189
+ try {
190
+ const response = yield (0, client_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.POST, '/ppt/presentation/generate/async', body);
191
+ const pollIntervalSeconds = 5;
192
+ const taskId = response.id;
193
+ if (!taskId) {
194
+ throw new Error(`Presenton did not return a task id: ${JSON.stringify(response)}`);
195
+ }
196
+ const start = Date.now();
197
+ const timeoutMs = 120 * 1000;
198
+ const sleep = (ms) => new Promise((res) => setTimeout(res, ms));
199
+ while (Date.now() - start < timeoutMs) {
200
+ const statusResp = yield (0, client_1.makeRequest)(apiKey, pieces_common_1.HttpMethod.GET, `/ppt/presentation/status/${taskId}`);
201
+ if (statusResp.status === 'completed') {
202
+ return statusResp;
203
+ }
204
+ if (statusResp.status === 'failed') {
205
+ throw new Error(`Presentation generation failed: ${JSON.stringify(statusResp)}`);
206
+ }
207
+ yield sleep(pollIntervalSeconds * 1000);
208
+ }
209
+ throw new Error(`Timed out waiting for presentation generation after 120 seconds`);
210
+ }
211
+ catch (err) {
212
+ throw new Error(`Presenton API error: ${err}`);
213
+ }
214
+ });
215
+ },
216
+ });
217
+ //# sourceMappingURL=generate-presentations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-presentations.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/presenton/src/lib/actions/generate-presentations.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAA+C;AAC/C,6CAA+C;AAC/C,+DAAyD;AAE5C,Q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F,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const presentonAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.presentonAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const client_1 = require("./client");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ exports.presentonAuth = pieces_framework_1.PieceAuth.SecretText({
9
+ displayName: 'Presenton API Key',
10
+ description: `
11
+ `,
12
+ required: true,
13
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
14
+ if (auth) {
15
+ try {
16
+ yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.GET, '/ppt/presentation/all', {});
17
+ return {
18
+ valid: true,
19
+ };
20
+ }
21
+ catch (error) {
22
+ return {
23
+ valid: false,
24
+ error: 'Invalid Api Key',
25
+ };
26
+ }
27
+ }
28
+ return {
29
+ valid: false,
30
+ error: 'Invalid Api Key',
31
+ };
32
+ }),
33
+ });
34
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/presenton/src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,qCAAuC;AACvC,+DAAyD;AAE5C,QAAA,aAAa,GAAG,4BAAS,CAAC,UAAU,CAAC;IAChD,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE;CACd;IACC,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,IAAI,EAAE,CAAC;YACT,IAAI,CAAC;gBACH,MAAM,IAAA,oBAAW,EACf,IAAc,EACd,0BAAU,CAAC,GAAG,EACd,uBAAuB,EACvB,EAAE,CACH,CAAC;gBACF,OAAO;oBACL,KAAK,EAAE,IAAI;iBACZ,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,iBAAiB;iBACzB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO;YACL,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,iBAAiB;SACzB,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { HttpMethod } from '@activepieces/pieces-common';
2
+ export declare const BASE_URL = "https://api.presenton.ai/api/v1";
3
+ export declare function makeRequest(api_key: string, method: HttpMethod, path: string, body?: unknown): Promise<any>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BASE_URL = void 0;
4
+ exports.makeRequest = makeRequest;
5
+ const tslib_1 = require("tslib");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ exports.BASE_URL = `https://api.presenton.ai/api/v1`;
8
+ function makeRequest(api_key, method, path, body) {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
+ try {
11
+ const response = yield pieces_common_1.httpClient.sendRequest({
12
+ method,
13
+ url: `${exports.BASE_URL}${path}`,
14
+ headers: {
15
+ Authorization: `Bearer ${api_key}`,
16
+ 'Content-Type': 'application/json',
17
+ },
18
+ body,
19
+ });
20
+ return response.body;
21
+ }
22
+ catch (error) {
23
+ throw new Error(`Unexpected error: ${error.message || String(error)}`);
24
+ }
25
+ });
26
+ }
27
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/presenton/src/lib/common/client.ts"],"names":[],"mappings":";;;AAIA,kCAoBC;;AAxBD,+DAAqE;AAExD,QAAA,QAAQ,GAAG,iCAAiC,CAAC;AAE1D,SAAsB,WAAW,CAC/B,OAAe,EACf,MAAkB,EAClB,IAAY,EACZ,IAAc;;QAEd,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM;gBACN,GAAG,EAAE,GAAG,gBAAQ,GAAG,IAAI,EAAE;gBACzB,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,OAAO,EAAE;oBAClC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI;aACL,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CAAA"}
@@ -0,0 +1,2 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const newPresentation: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.newPresentation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
8
+ const auth_1 = require("../common/auth");
9
+ const client_1 = require("../common/client");
10
+ const pieces_common_2 = require("@activepieces/pieces-common");
11
+ const polling = {
12
+ strategy: pieces_common_1.DedupeStrategy.TIMEBASED,
13
+ items: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, propsValue, lastFetchEpochMS }) {
14
+ const apiKey = auth;
15
+ const response = yield (0, client_1.makeRequest)(apiKey, pieces_common_2.HttpMethod.GET, '/ppt/presentation/all');
16
+ const itemsArray = response.results;
17
+ return itemsArray.map((item) => ({
18
+ epochMilliSeconds: (0, dayjs_1.default)(item.created_at).valueOf(),
19
+ data: item,
20
+ }));
21
+ }),
22
+ };
23
+ exports.newPresentation = (0, pieces_framework_1.createTrigger)({
24
+ auth: auth_1.presentonAuth,
25
+ name: 'newPresentation',
26
+ displayName: 'New Presentation',
27
+ description: 'Triggers when a new presentation is created in Presenton.',
28
+ props: {},
29
+ sampleData: {
30
+ id: '93d4092b-2a20-4637-bbe7-2addb6273761',
31
+ user: 'fa86a74f-53b9-46fa-9ac9-e3a526d125ca',
32
+ content: 'Indian society ',
33
+ n_slides: 1,
34
+ language: 'English',
35
+ title: ' AI **Presented by:** Jon deo -',
36
+ created_at: '2025-11-11T11:33:55.269027Z',
37
+ updated_at: '2025-11-11T11:34:12.978847Z',
38
+ tone: 'default',
39
+ verbosity: 'standard',
40
+ theme: null,
41
+ slides: [
42
+ {
43
+ presentation: '93d4092b-2a20-4637-bbe7-2addb6273761',
44
+ layout: 'general:general-intro-slide',
45
+ index: 0,
46
+ layout_group: 'general',
47
+ speaker_note: '',
48
+ id: '38ca1626-83ef-451f-8529-8b10725bcb3f',
49
+ content: {
50
+ title: 'AI Presentation',
51
+ description: '',
52
+ presenterName: 'Jon Deo',
53
+ presentationDate: '2025-11-11',
54
+ image: {
55
+ __image_prompt__: 'r',
56
+ __image_url__: 'https://images.pexels.com/photos/17898879/pexels-photo-17898879.jpeg?auto=compress&cs=tinysrgb&h=650&w=940',
57
+ },
58
+ __speaker_note__: '',
59
+ },
60
+ html_content: null,
61
+ properties: null,
62
+ },
63
+ ],
64
+ },
65
+ type: pieces_framework_1.TriggerStrategy.POLLING,
66
+ test(context) {
67
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
68
+ return yield pieces_common_1.pollingHelper.test(polling, context);
69
+ });
70
+ },
71
+ onEnable(context) {
72
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
73
+ const { store, auth, propsValue } = context;
74
+ yield pieces_common_1.pollingHelper.onEnable(polling, { store, auth, propsValue });
75
+ });
76
+ },
77
+ onDisable(context) {
78
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
+ const { store, auth, propsValue } = context;
80
+ yield pieces_common_1.pollingHelper.onDisable(polling, { store, auth, propsValue });
81
+ });
82
+ },
83
+ run(context) {
84
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
85
+ return yield pieces_common_1.pollingHelper.poll(polling, context);
86
+ });
87
+ },
88
+ });
89
+ //# sourceMappingURL=new-presentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"new-presentation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/presenton/src/lib/triggers/new-presentation.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,+DAIqC;AACrC,0DAA0B;AAC1B,yCAA+C;AAC/C,6CAA+C;AAC/C,+DAAyD;AAEzD,MAAM,OAAO,GAGT;IACF,QAAQ,EAAE,8BAAc,CAAC,SAAS;IAClC,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE;QAClD,MAAM,MAAM,GAAG,IAAc,CAAC;QAE9B,MAAM,QAAQ,GAAQ,MAAM,IAAA,oBAAW,EACrC,MAAM,EACN,0BAAU,CAAC,GAAG,EACd,uBAAuB,CACxB,CAAC;QAEF,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC;QAEpC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC;YACpC,iBAAiB,EAAE,IAAA,eAAK,EAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE;YACnD,IAAI,EAAE,IAAI;SACX,CAAC,CAAC,CAAC;IACN,CAAC,CAAA;CACF,CAAC;AAEW,QAAA,eA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