From 486b78c5f81b65b5d01d500020038cb52f07e53b Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Tue, 25 Nov 2025 12:25:59 -0300 Subject: [PATCH 1/3] Added actions --- .../create-video-configuration.mjs | 68 +++++++++ .../actions/generate-video/generate-video.mjs | 31 +++++ .../get-video-status/get-video-status.mjs | 31 +++++ components/robopost/common/constants.mjs | 50 +++++++ components/robopost/package.json | 7 +- components/robopost/robopost.app.mjs | 129 +++++++++++++++++- 6 files changed, 310 insertions(+), 6 deletions(-) create mode 100644 components/robopost/actions/create-video-configuration/create-video-configuration.mjs create mode 100644 components/robopost/actions/generate-video/generate-video.mjs create mode 100644 components/robopost/actions/get-video-status/get-video-status.mjs create mode 100644 components/robopost/common/constants.mjs diff --git a/components/robopost/actions/create-video-configuration/create-video-configuration.mjs b/components/robopost/actions/create-video-configuration/create-video-configuration.mjs new file mode 100644 index 0000000000000..093d0c4b7c28c --- /dev/null +++ b/components/robopost/actions/create-video-configuration/create-video-configuration.mjs @@ -0,0 +1,68 @@ +import app from "../../robopost.app.mjs"; + +export default { + key: "robopost-create-video-configuration", + name: "Create Video Configuration", + description: "Create a new faceless video series configuration for generating multiple videos with consistent settings. [See the documentation](https://robopost.app/docs/robopost-api/#videogenerationendpoints)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + app, + name: { + propDefinition: [ + app, + "name", + ], + }, + contentType: { + propDefinition: [ + app, + "contentType", + ], + }, + style: { + propDefinition: [ + app, + "style", + ], + }, + voice: { + propDefinition: [ + app, + "voice", + ], + }, + lang: { + propDefinition: [ + app, + "lang", + ], + }, + maxDuration: { + propDefinition: [ + app, + "maxDuration", + ], + }, + }, + async run({ $ }) { + const response = await this.app.createVideoConfiguration({ + $, + data: { + name: this.name, + content_type: this.contentType, + style: this.style, + voice: this.voice, + lang: this.lang, + max_duration: this.maxDuration, + }, + }); + $.export("$summary", `Successfully created video series configuration with ID: ${response.id}`); + return response; + }, +}; diff --git a/components/robopost/actions/generate-video/generate-video.mjs b/components/robopost/actions/generate-video/generate-video.mjs new file mode 100644 index 0000000000000..bf09e554aac88 --- /dev/null +++ b/components/robopost/actions/generate-video/generate-video.mjs @@ -0,0 +1,31 @@ +import app from "../../robopost.app.mjs"; + +export default { + key: "robopost-generate-video", + name: "Generate Video", + description: "Create a new video generation task from a video series. [See the documentation](https://robopost.app/docs/robopost-api/#videogenerationtasks)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + app, + configurationId: { + propDefinition: [ + app, + "configurationId", + ], + }, + }, + async run({ $ }) { + const response = await this.app.generateVideo({ + $, + configurationId: this.configurationId, + }); + $.export("$summary", `Successfully started the task to generate the video. Task ID: ${response.task_id}`); + return response; + }, +}; diff --git a/components/robopost/actions/get-video-status/get-video-status.mjs b/components/robopost/actions/get-video-status/get-video-status.mjs new file mode 100644 index 0000000000000..4f86bb4e4265a --- /dev/null +++ b/components/robopost/actions/get-video-status/get-video-status.mjs @@ -0,0 +1,31 @@ +import app from "../../robopost.app.mjs"; + +export default { + key: "robopost-get-video-status", + name: "Get Video Status", + description: "Check the status of a video generation task. [See the documentation](https://robopost.app/docs/robopost-api/#videogenerationtasks)", + version: "0.0.2", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + app, + taskId: { + propDefinition: [ + app, + "taskId", + ], + }, + }, + async run({ $ }) { + const response = await this.app.getVideoStatus({ + $, + taskId: this.taskId, + }); + $.export("$summary", `The task status is: ${response.status}`); + return response; + }, +}; diff --git a/components/robopost/common/constants.mjs b/components/robopost/common/constants.mjs new file mode 100644 index 0000000000000..feb4138ddebaf --- /dev/null +++ b/components/robopost/common/constants.mjs @@ -0,0 +1,50 @@ +export default { + CONTENT_TYPES: [ + "RANDOM_AI_STORY", + "SCARY_STORIES", + "BEDTIME_STORIES", + "INTERESTING_HISTORY", + "URBAN_LEGENDS", + "MOTIVATIONAL", + "FUN_FACTS", + "LONG_FORM_JOKES", + "LIFE_PRO_TIPS", + "ELI5", + "DID_YOU_KNOW", + "PHILOSOPHY", + "RECIPES", + "FITNESS", + "BEAUTY", + "GROWTH_ADVICE", + "PRODUCT_MARKETING", + "CUSTOM", + "BLOG_ARTICLE", + ], + STYLE_OPTIONS: [ + "DEFAULT", + "REALISM", + "IMPRESSIONISM", + "SURREALISM", + "ABSTRACT", + "ART_NOUVEAU", + "CUBISM", + "POP_ART", + "FUTURISM", + "FANTASY_CONCEPT_ART", + "MINIMALISM", + "WATERCOLOR", + "GOTHIC_MEDIEVAL_ART", + "ANIME", + "COMIC", + ], + VOICE_OPTIONS: [ + "ALICE", + "BILL", + "SARAH", + "BRIAN", + "LAURA", + "ARIA", + "CALLUM", + "CHARLIE", + ], +}; diff --git a/components/robopost/package.json b/components/robopost/package.json index 84994b60a0e74..c4bb73b23262a 100644 --- a/components/robopost/package.json +++ b/components/robopost/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/robopost", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Robopost Components", "main": "robopost.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.1" } -} \ No newline at end of file +} diff --git a/components/robopost/robopost.app.mjs b/components/robopost/robopost.app.mjs index 5281f98336489..cd5647581b0f8 100644 --- a/components/robopost/robopost.app.mjs +++ b/components/robopost/robopost.app.mjs @@ -1,11 +1,132 @@ +import { axios } from "@pipedream/platform"; +import constants from "./common/constants.mjs"; + export default { type: "app", app: "robopost", - propDefinitions: {}, + propDefinitions: { + name: { + type: "string", + label: "Name", + description: "Name of the video series configuration", + }, + contentType: { + type: "string", + label: "Content Type", + description: "The type of the content of the video", + options: constants.CONTENT_TYPES, + optional: true, + }, + style: { + type: "string", + label: "Style", + description: "The style of the video", + options: constants.STYLE_OPTIONS, + optional: true, + }, + voice: { + type: "string", + label: "Voice", + description: "The voice used for the video", + options: constants.VOICE_OPTIONS, + optional: true, + }, + lang: { + type: "string", + label: "Language Code", + description: "Language of the video, i.e.: `en`", + optional: true, + }, + maxDuration: { + type: "integer", + label: "Max Duration", + description: "Maximum video duration in seconds (5-600)", + optional: true, + }, + configurationId: { + type: "string", + label: "Configuration ID", + description: "ID of the configuration for the video generation", + async options() { + const response = await this.getVideoSeries(); + return response.map(({ + name, id, + }) => ({ + label: name, + value: id, + })); + }, + }, + taskId: { + type: "string", + label: "Task ID", + description: "ID of the task to be checked", + async options() { + const response = await this.getTaskStatus(); + return response.map(({ + created_at, task_id, + }) => ({ + label: created_at, + value: task_id, + })); + }, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://public-api.robopost.app/v1"; + }, + async _makeRequest(opts = {}) { + const { + $ = this, + path, + params, + ...otherOpts + } = opts; + return axios($, { + ...otherOpts, + url: this._baseUrl() + path, + params: { + apikey: `${this.$auth.api_key}`, + ...params, + }, + }); + }, + async createVideoConfiguration(args = {}) { + return this._makeRequest({ + path: "/video-series", + method: "post", + ...args, + }); + }, + async generateVideo({ + configurationId, ...args + }) { + return this._makeRequest({ + path: `/video-tasks/${configurationId}/generate`, + method: "post", + ...args, + }); + }, + async getVideoStatus({ + taskId, ...args + }) { + return this._makeRequest({ + path: `/video-tasks/${taskId}`, + ...args, + }); + }, + async getVideoSeries(args = {}) { + return this._makeRequest({ + path: "/video-series", + ...args, + }); + }, + async getTaskStatus(args = {}) { + return this._makeRequest({ + path: "/video-tasks", + ...args, + }); }, }, }; From 284655431319a74eb2d0c1795dd066879ddf893a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Falc=C3=A3o?= <48412907+GTFalcao@users.noreply.github.com> Date: Tue, 25 Nov 2025 14:06:40 -0300 Subject: [PATCH 2/3] Update components/robopost/robopost.app.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- components/robopost/robopost.app.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/robopost/robopost.app.mjs b/components/robopost/robopost.app.mjs index cd5647581b0f8..d558f5106ff82 100644 --- a/components/robopost/robopost.app.mjs +++ b/components/robopost/robopost.app.mjs @@ -42,6 +42,8 @@ export default { label: "Max Duration", description: "Maximum video duration in seconds (5-600)", optional: true, + min: 5, + max: 600, }, configurationId: { type: "string", From 6569022c948d3dab14e884bf863ff32370e651da Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Wed, 26 Nov 2025 09:01:08 -0300 Subject: [PATCH 3/3] pnpm --- pnpm-lock.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4137752ce7af3..319a6e0dd10aa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12655,7 +12655,11 @@ importers: specifier: ^3.1.1 version: 3.1.1 - components/robopost: {} + components/robopost: + dependencies: + '@pipedream/platform': + specifier: ^3.1.1 + version: 3.1.1 components/rocket_chat: dependencies: @@ -31499,17 +31503,17 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net + deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net supports-color@10.2.2: resolution: {integrity: sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==}