From 4bfd5834fd4cd9650b42e3ade44996f9660f391b Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 11:05:38 -0300 Subject: [PATCH 1/9] hamsa init --- .../actions/create-content/create-content.mjs | 50 +++++++ .../synthethize-voice/synthethize-voice.mjs | 57 +++++++ .../transcribe-video/transcribe-video.mjs | 50 +++++++ components/hamsa/hamsa.app.mjs | 139 +++++++++++++++++- components/hamsa/package.json | 2 +- 5 files changed, 292 insertions(+), 6 deletions(-) create mode 100644 components/hamsa/actions/create-content/create-content.mjs create mode 100644 components/hamsa/actions/synthethize-voice/synthethize-voice.mjs create mode 100644 components/hamsa/actions/transcribe-video/transcribe-video.mjs diff --git a/components/hamsa/actions/create-content/create-content.mjs b/components/hamsa/actions/create-content/create-content.mjs new file mode 100644 index 0000000000000..91d1492cc4827 --- /dev/null +++ b/components/hamsa/actions/create-content/create-content.mjs @@ -0,0 +1,50 @@ +import hamsa from "../../hamsa.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "hamsa-create-content", + name: "Create AI Content", + description: "Transform transcribed content into various formats for content marketing. [See the documentation](https://docs.tryhamsa.com/api-reference/endpoint/post-ai-content)", + version: "0.0.1", + type: "action", + props: { + hamsa, + mediaUrl: { + propDefinition: [ + hamsa, + "mediaUrl", + ], + }, + webhookUrl: { + propDefinition: [ + hamsa, + "webhookUrl", + ], + }, + aiParts: { + propDefinition: [ + hamsa, + "aiParts", + ], + }, + }, + async run({ $ }) { + const transcribeResponse = await this.hamsa.transcribeVideo({ + mediaUrl: this.mediaUrl, + webhookUrl: this.webhookUrl, + }); + + $.export("$summary", `Video transcription job created with ID: ${transcribeResponse.id}`); + + const aiContentResponse = await this.hamsa.createAIContent({ + aiParts: this.aiParts, + }); + + $.export("$summary", `AI content creation job created with ID: ${aiContentResponse.id}`); + + return { + transcriptionJob: transcribeResponse, + aiContentJob: aiContentResponse, + }; + }, +}; diff --git a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs new file mode 100644 index 0000000000000..c33863bff9488 --- /dev/null +++ b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs @@ -0,0 +1,57 @@ +import hamsa from "../../hamsa.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "hamsa-synthesize-voice", + name: "Synthesize Voice", + description: "Converts text input into artificial speech using Hamsa. [See the documentation](https://docs.tryhamsa.com/api-reference/endpoint/generate-tts)", + version: "0.0.1", + type: "action", + props: { + hamsa, + voiceId: { + propDefinition: [ + hamsa, + "voiceId", + ], + }, + text: { + propDefinition: [ + hamsa, + "text", + ], + }, + webhookUrl: { + propDefinition: [ + hamsa, + "webhookUrl", + ], + }, + authKey: { + type: "string", + label: "Webhook Auth Key", + description: "Authorization key for the webhook notifications.", + optional: true, + }, + authSecret: { + type: "string", + label: "Webhook Auth Secret", + description: "Authorization secret for the webhook notifications.", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hamsa.generateTTS({ + voiceId: this.voiceId, + text: this.text, + webhookUrl: this.webhookUrl, + webhookAuth: { + authKey: this.authKey, + authSecret: this.authSecret, + }, + }); + + $.export("$summary", `Text to speech job successfully created with ID ${response.id}`); + return response; + }, +}; diff --git a/components/hamsa/actions/transcribe-video/transcribe-video.mjs b/components/hamsa/actions/transcribe-video/transcribe-video.mjs new file mode 100644 index 0000000000000..d68722d2a99bc --- /dev/null +++ b/components/hamsa/actions/transcribe-video/transcribe-video.mjs @@ -0,0 +1,50 @@ +import hamsa from "../../hamsa.app.mjs"; +import { axios } from "@pipedream/platform"; + +export default { + key: "hamsa-transcribe-video", + name: "Transcribe Video", + description: "Automatically transcribe Arabic videos from YouTube URLs or direct links. [See the documentation](https://docs.tryhamsa.com/api-reference/endpoint/transcribe)", + version: "0.0.1", + type: "action", + props: { + hamsa, + mediaUrl: { + propDefinition: [ + hamsa, + "mediaUrl", + ], + }, + webhookUrl: { + propDefinition: [ + hamsa, + "webhookUrl", + ], + }, + webhookAuthKey: { + type: "string", + label: "Webhook Auth Key", + description: "The key to use for authenticating the webhook.", + optional: true, + }, + webhookAuthSecret: { + type: "string", + label: "Webhook Auth Secret", + description: "The secret to use for authenticating the webhook.", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.hamsa.transcribeVideo({ + mediaUrl: this.mediaUrl, + webhookUrl: this.webhookUrl, + webhookAuth: { + authKey: this.webhookAuthKey || null, + authSecret: this.webhookAuthSecret || null, + }, + }); + + $.export("$summary", "Transcription job started successfully."); + return response; + }, +}; diff --git a/components/hamsa/hamsa.app.mjs b/components/hamsa/hamsa.app.mjs index b947004d61afb..5914cc035c074 100644 --- a/components/hamsa/hamsa.app.mjs +++ b/components/hamsa/hamsa.app.mjs @@ -1,11 +1,140 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "hamsa", - propDefinitions: {}, + propDefinitions: { + mediaUrl: { + type: "string", + label: "Media URL", + description: "The URL of the video to be transcribed.", + }, + voiceId: { + type: "string", + label: "Voice ID", + description: "The voice ID for Text to Speech conversion.", + }, + text: { + type: "string", + label: "Text for TTS", + description: "The text you want to convert to speech. Minimum 5 words required.", + }, + webhookUrl: { + type: "string", + label: "Webhook URL", + description: "The URL to receive the webhook notifications.", + }, + aiParts: { + type: "string[]", + label: "AI Parts", + description: "Parts for AI content in marketing, e.g., introduction, titles, etc.", + async options() { + return [ + { + label: "Introduction", + value: "introduction", + }, + { + label: "Titles", + value: "titles", + }, + { + label: "Summary", + value: "summary", + }, + { + label: "Web Article SEO Friendly", + value: "webArticleSEOFriendly", + }, + { + label: "Key Topics With Bullets", + value: "keyTopicsWithBullets", + }, + { + label: "Keywords", + value: "keywords", + }, + { + label: "Threads By Instagram", + value: "threadsByInstagram", + }, + { + label: "FAQ", + value: "faq", + }, + { + label: "Facebook Post", + value: "facebookPost", + }, + { + label: "YouTube Description", + value: "youtubeDescription", + }, + { + label: "Twitter Thread", + value: "twitterThread", + }, + { + label: "LinkedIn Post", + value: "linkedInPost", + }, + ]; + }, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.tryhamsa.com/v1"; + }, + async _makeRequest(opts = {}) { + const { + $ = this, method = "POST", path = "/", headers, ...otherOpts + } = opts; + return axios($, { + ...otherOpts, + method, + url: this._baseUrl() + path, + headers: { + ...headers, + Authorization: `Token ${this.$auth.api_key}`, + }, + }); + }, + async transcribeVideo({ + mediaUrl, webhookUrl, webhookAuth, + }) { + return this._makeRequest({ + path: "/jobs/transcribe", + data: { + mediaUrl, + processingType: "async", + webhookUrl, + webhookAuth, + model: "Hamsa-General-V2.0", + language: "ar", + }, + }); + }, + async generateTTS({ + voiceId, text, webhookUrl, webhookAuth, + }) { + return this._makeRequest({ + path: "/jobs/text-to-speech", + data: { + voiceId, + text, + webhookUrl, + webhookAuth, + }, + }); + }, + async createAIContent({ aiParts }) { + return this._makeRequest({ + path: "/jobs/ai-content", + data: { + aiParts, + }, + }); }, }, -}; \ No newline at end of file +}; diff --git a/components/hamsa/package.json b/components/hamsa/package.json index 3e9a0c9fd4bce..f631a9899a3de 100644 --- a/components/hamsa/package.json +++ b/components/hamsa/package.json @@ -12,4 +12,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} From 698e80bed5552fd996fc3b665752252551b2cb51 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 13:53:00 -0300 Subject: [PATCH 2/9] [Components] hamsa #16189 Actions - Transcribe Video - Create Content - Synthethize Voice --- .../actions/create-content/create-content.mjs | 44 ++--- .../synthethize-voice/synthethize-voice.mjs | 33 ++-- .../transcribe-video/transcribe-video.mjs | 58 +++++- components/hamsa/common/constants.mjs | 68 +++++++ components/hamsa/hamsa.app.mjs | 177 ++++++++---------- components/hamsa/package.json | 5 +- 6 files changed, 237 insertions(+), 148 deletions(-) create mode 100644 components/hamsa/common/constants.mjs diff --git a/components/hamsa/actions/create-content/create-content.mjs b/components/hamsa/actions/create-content/create-content.mjs index 91d1492cc4827..c181e0d1a0b94 100644 --- a/components/hamsa/actions/create-content/create-content.mjs +++ b/components/hamsa/actions/create-content/create-content.mjs @@ -1,5 +1,5 @@ +import { AI_PARTS_OPTIONS } from "../../common/constants.mjs"; import hamsa from "../../hamsa.app.mjs"; -import { axios } from "@pipedream/platform"; export default { key: "hamsa-create-content", @@ -9,42 +9,32 @@ export default { type: "action", props: { hamsa, - mediaUrl: { + jobId: { propDefinition: [ hamsa, - "mediaUrl", - ], - }, - webhookUrl: { - propDefinition: [ - hamsa, - "webhookUrl", + "jobId", ], }, aiParts: { - propDefinition: [ - hamsa, - "aiParts", - ], + type: "string[]", + label: "AI Parts", + description: "Parts for AI content in marketing.", + options: AI_PARTS_OPTIONS, }, }, async run({ $ }) { - const transcribeResponse = await this.hamsa.transcribeVideo({ - mediaUrl: this.mediaUrl, - webhookUrl: this.webhookUrl, - }); - - $.export("$summary", `Video transcription job created with ID: ${transcribeResponse.id}`); - - const aiContentResponse = await this.hamsa.createAIContent({ - aiParts: this.aiParts, + const response = await this.hamsa.createAIContent({ + $, + params: { + jobId: this.jobId, + }, + data: { + aiParts: this.aiParts, + }, }); - $.export("$summary", `AI content creation job created with ID: ${aiContentResponse.id}`); + $.export("$summary", `AI content creation job created with ID: ${response.data.id}`); - return { - transcriptionJob: transcribeResponse, - aiContentJob: aiContentResponse, - }; + return response; }, }; diff --git a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs index c33863bff9488..1371c289254dd 100644 --- a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs +++ b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs @@ -1,5 +1,4 @@ import hamsa from "../../hamsa.app.mjs"; -import { axios } from "@pipedream/platform"; export default { key: "hamsa-synthesize-voice", @@ -16,24 +15,24 @@ export default { ], }, text: { - propDefinition: [ - hamsa, - "text", - ], + type: "string", + label: "Text for TTS", + description: "The text you want to convert to speech. Minimum 5 words required.", }, webhookUrl: { propDefinition: [ hamsa, "webhookUrl", ], + optional: true, }, - authKey: { + webhookAuthKey: { type: "string", label: "Webhook Auth Key", description: "Authorization key for the webhook notifications.", optional: true, }, - authSecret: { + webhookAuthSecret: { type: "string", label: "Webhook Auth Secret", description: "Authorization secret for the webhook notifications.", @@ -41,14 +40,24 @@ export default { }, }, async run({ $ }) { - const response = await this.hamsa.generateTTS({ + const webhookAuth = {}; + if (this.webhookAuthKey) { + webhookAuth.authKey = this.webhookAuthKey; + } + if (this.webhookAuthSecret) { + webhookAuth.authSecret = this.webhookAuthSecret; + } + const data = { voiceId: this.voiceId, text: this.text, webhookUrl: this.webhookUrl, - webhookAuth: { - authKey: this.authKey, - authSecret: this.authSecret, - }, + }; + if (Object.keys(webhookAuth).length) { + data.webhookAuth = webhookAuth; + } + const response = await this.hamsa.generateTTS({ + $, + data, }); $.export("$summary", `Text to speech job successfully created with ID ${response.id}`); diff --git a/components/hamsa/actions/transcribe-video/transcribe-video.mjs b/components/hamsa/actions/transcribe-video/transcribe-video.mjs index d68722d2a99bc..c0fa078ecffb5 100644 --- a/components/hamsa/actions/transcribe-video/transcribe-video.mjs +++ b/components/hamsa/actions/transcribe-video/transcribe-video.mjs @@ -1,5 +1,8 @@ +import { + LANGUAGE_OPTIONS, + MODEL_OPTIONS, +} from "../../common/constants.mjs"; import hamsa from "../../hamsa.app.mjs"; -import { axios } from "@pipedream/platform"; export default { key: "hamsa-transcribe-video", @@ -10,16 +13,22 @@ export default { props: { hamsa, mediaUrl: { - propDefinition: [ - hamsa, - "mediaUrl", - ], + type: "string", + label: "Media URL", + description: "The URL of the video to be transcribed.", + }, + model: { + type: "string", + label: "Model", + description: "The model you want to use to transcribe.", + options: MODEL_OPTIONS, }, webhookUrl: { propDefinition: [ hamsa, "webhookUrl", ], + optional: true, }, webhookAuthKey: { type: "string", @@ -31,17 +40,46 @@ export default { type: "string", label: "Webhook Auth Secret", description: "The secret to use for authenticating the webhook.", + secret: true, + optional: true, + }, + title: { + type: "string", + label: "Title", + description: "The title of the transcription.", + optional: true, + }, + language: { + type: "string", + label: "Language", + description: "The language of the transcription.", + options: LANGUAGE_OPTIONS, optional: true, }, }, async run({ $ }) { - const response = await this.hamsa.transcribeVideo({ + const webhookAuth = {}; + if (this.webhookAuthKey) { + webhookAuth.authKey = this.webhookAuthKey; + } + if (this.webhookAuthSecret) { + webhookAuth.authSecret = this.webhookAuthSecret; + } + const data = { mediaUrl: this.mediaUrl, + model: this.model, + processingType: "async", webhookUrl: this.webhookUrl, - webhookAuth: { - authKey: this.webhookAuthKey || null, - authSecret: this.webhookAuthSecret || null, - }, + title: this.title, + language: this.language, + }; + if (Object.keys(webhookAuth).length) { + data.webhookAuth = webhookAuth; + } + + const response = await this.hamsa.transcribeVideo({ + $, + data, }); $.export("$summary", "Transcription job started successfully."); diff --git a/components/hamsa/common/constants.mjs b/components/hamsa/common/constants.mjs new file mode 100644 index 0000000000000..83d62eff0a1be --- /dev/null +++ b/components/hamsa/common/constants.mjs @@ -0,0 +1,68 @@ +export const LIMIT = 100; + +export const MODEL_OPTIONS = [ + { + label: "Hamsa-General-V2.0 - Our most advanced ASR model, optimized for high accuracy across podcasts, videos, and general audio.", + value: "Hamsa-General-V2.0", + }, + { + label: "Hamsa-Conversational-V1.0 - Best suited for conversational use cases, optimized for accurately transcribing phone calls and meetings.", + value: "Hamsa-Conversational-V1.0", + }, +]; + +export const LANGUAGE_OPTIONS = [ + "ar", + "en", +]; + +export const AI_PARTS_OPTIONS = [ + { + label: "Introduction", + value: "introduction", + }, + { + label: "Titles", + value: "titles", + }, + { + label: "Summary", + value: "summary", + }, + { + label: "Web Article SEO Friendly", + value: "webArticleSEOFriendly", + }, + { + label: "Key Topics With Bullets", + value: "keyTopicsWithBullets", + }, + { + label: "Keywords", + value: "keywords", + }, + { + label: "Threads By Instagram", + value: "threadsByInstagram", + }, + { + label: "FAQ", + value: "faq", + }, + { + label: "Facebook Post", + value: "facebookPost", + }, + { + label: "YouTube Description", + value: "youtubeDescription", + }, + { + label: "Twitter Thread", + value: "twitterThread", + }, + { + label: "LinkedIn Post", + value: "linkedInPost", + }, +]; diff --git a/components/hamsa/hamsa.app.mjs b/components/hamsa/hamsa.app.mjs index 5914cc035c074..1617ec75b22b4 100644 --- a/components/hamsa/hamsa.app.mjs +++ b/components/hamsa/hamsa.app.mjs @@ -1,139 +1,120 @@ import { axios } from "@pipedream/platform"; +import { LIMIT } from "./common/constants.mjs"; export default { type: "app", app: "hamsa", propDefinitions: { - mediaUrl: { + jobId: { type: "string", - label: "Media URL", - description: "The URL of the video to be transcribed.", + label: "Job Id", + description: "The ID of the job you want to use.", + async options({ page }) { + const { data: { jobs } } = await this.listJobs({ + params: { + take: LIMIT, + skip: page * LIMIT, + }, + }); + + return jobs.map(({ + id: value, title: label, + }) => ({ + label, + value, + })); + }, }, voiceId: { type: "string", label: "Voice ID", description: "The voice ID for Text to Speech conversion.", - }, - text: { - type: "string", - label: "Text for TTS", - description: "The text you want to convert to speech. Minimum 5 words required.", + async options({ page }) { + const params = { + take: LIMIT, + }; + if (page) { + params.skip = page * LIMIT; + } + const { data: { voiceAgents } } = await this.listVoiceAgents({ + params, + }); + + return voiceAgents.map(({ + id: value, agentName: label, + }) => ({ + label, + value, + })); + }, }, webhookUrl: { type: "string", label: "Webhook URL", description: "The URL to receive the webhook notifications.", }, - aiParts: { - type: "string[]", - label: "AI Parts", - description: "Parts for AI content in marketing, e.g., introduction, titles, etc.", - async options() { - return [ - { - label: "Introduction", - value: "introduction", - }, - { - label: "Titles", - value: "titles", - }, - { - label: "Summary", - value: "summary", - }, - { - label: "Web Article SEO Friendly", - value: "webArticleSEOFriendly", - }, - { - label: "Key Topics With Bullets", - value: "keyTopicsWithBullets", - }, - { - label: "Keywords", - value: "keywords", - }, - { - label: "Threads By Instagram", - value: "threadsByInstagram", - }, - { - label: "FAQ", - value: "faq", - }, - { - label: "Facebook Post", - value: "facebookPost", - }, - { - label: "YouTube Description", - value: "youtubeDescription", - }, - { - label: "Twitter Thread", - value: "twitterThread", - }, - { - label: "LinkedIn Post", - value: "linkedInPost", - }, - ]; - }, - }, }, methods: { _baseUrl() { return "https://api.tryhamsa.com/v1"; }, - async _makeRequest(opts = {}) { - const { - $ = this, method = "POST", path = "/", headers, ...otherOpts - } = opts; + _headers() { + return { + "authorization": `Token ${this.$auth.api_key}`, + }; + }, + _makeRequest({ + $ = this, path, ...opts + }) { return axios($, { - ...otherOpts, - method, url: this._baseUrl() + path, - headers: { - ...headers, - Authorization: `Token ${this.$auth.api_key}`, - }, + headers: this._headers(), + ...opts, }); }, - async transcribeVideo({ - mediaUrl, webhookUrl, webhookAuth, + async listJobs({ + params, ...opts }) { + const { data: { id: projectId } } = await this._makeRequest({ + path: "/projects/by-api-key", + ...opts, + }); + return this._makeRequest({ - path: "/jobs/transcribe", - data: { - mediaUrl, - processingType: "async", - webhookUrl, - webhookAuth, - model: "Hamsa-General-V2.0", - language: "ar", + method: "POST", + path: "/jobs/all", + params: { + ...params, + projectId, }, + ...opts, }); }, - async generateTTS({ - voiceId, text, webhookUrl, webhookAuth, - }) { + listVoiceAgents(opts = {}) { return this._makeRequest({ + path: "/voice-agents", + ...opts, + }); + }, + transcribeVideo(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/jobs/transcribe", + ...opts, + }); + }, + generateTTS(opts = {}) { + return this._makeRequest({ + method: "POST", path: "/jobs/text-to-speech", - data: { - voiceId, - text, - webhookUrl, - webhookAuth, - }, + ...opts, }); }, - async createAIContent({ aiParts }) { + createAIContent(opts = {}) { return this._makeRequest({ + method: "POST", path: "/jobs/ai-content", - data: { - aiParts, - }, + ...opts, }); }, }, diff --git a/components/hamsa/package.json b/components/hamsa/package.json index f631a9899a3de..8c5f0faae14fb 100644 --- a/components/hamsa/package.json +++ b/components/hamsa/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/hamsa", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Hamsa Components", "main": "hamsa.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } } From 8a8371271fc57b6c60a9cfa75c075ac860b63398 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 13:55:35 -0300 Subject: [PATCH 3/9] pnpm update --- pnpm-lock.yaml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7436336fb5c61..bfc13a9053a2d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5776,7 +5776,11 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/hamsa: {} + components/hamsa: + dependencies: + '@pipedream/platform': + specifier: ^3.0.3 + version: 3.0.3 components/handwrytten: {} @@ -8808,8 +8812,7 @@ importers: specifier: ^3.0.0 version: 3.0.3 - components/onehash: - specifiers: {} + components/onehash: {} components/onelogin: {} @@ -10120,8 +10123,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/public_record: - specifiers: {} + components/public_record: {} components/publisherkit: dependencies: @@ -10171,8 +10173,7 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/pushengage: - specifiers: {} + components/pushengage: {} components/pusher: dependencies: @@ -27765,22 +27766,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + 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 superagent@4.1.0: resolution: {integrity: sha512-FT3QLMasz0YyCd4uIi5HNe+3t/onxMyEho7C3PSqmti3Twgy2rXT4fmkTz6wRL6bTF4uzPcfkUCa8u4JWHw8Ag==} engines: {node: '>= 6.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + 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 superagent@5.3.1: resolution: {integrity: sha512-wjJ/MoTid2/RuGCOFtlacyGNxN9QLMgcpYLDQlWFIhhdJ93kNscFonGvrpAHSCVjRVj++DGCglocF7Aej1KHvQ==} engines: {node: '>= 7.0.0'} - deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at . + 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 superagent@7.1.6: resolution: {integrity: sha512-gZkVCQR1gy/oUXr+kxJMLDjla434KmSOKbx5iGD30Ql+AkJQ/YlPKECJy2nhqOsHLjGHzoDTXNSjhnvWhzKk7g==} engines: {node: '>=6.4.0 <13 || >=14'} - deprecated: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see https://github.com/visionmedia/superagent/issues/1731) + 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 supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} From 9499cf8afed5ada805549797afc596da8f2ce915 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 14:05:51 -0300 Subject: [PATCH 4/9] fix action key --- .../hamsa/actions/synthethize-voice/synthethize-voice.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs index 1371c289254dd..d3d09ef3f7509 100644 --- a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs +++ b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs @@ -1,7 +1,7 @@ import hamsa from "../../hamsa.app.mjs"; export default { - key: "hamsa-synthesize-voice", + key: "hamsa-synthethize-voice", name: "Synthesize Voice", description: "Converts text input into artificial speech using Hamsa. [See the documentation](https://docs.tryhamsa.com/api-reference/endpoint/generate-tts)", version: "0.0.1", From 0fd8ddda9738566bf5b83625ed12ddbf6a68b8a7 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 15:11:36 -0300 Subject: [PATCH 5/9] some adjsuts and added List Jobs action --- .../hamsa/actions/list-jobs/list-jobs.mjs | 21 +++++++++++++++++++ .../synthethize-voice/synthethize-voice.mjs | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 components/hamsa/actions/list-jobs/list-jobs.mjs diff --git a/components/hamsa/actions/list-jobs/list-jobs.mjs b/components/hamsa/actions/list-jobs/list-jobs.mjs new file mode 100644 index 0000000000000..106ccbf25df46 --- /dev/null +++ b/components/hamsa/actions/list-jobs/list-jobs.mjs @@ -0,0 +1,21 @@ +import hamsa from "../../hamsa.app.mjs"; + +export default { + key: "hamsa-list-jobs", + name: "List Jobs", + description: "Fetch the list of jobs from Hamsa. [See the documentation](https://docs.tryhamsa.com/api-reference/endpoint/get-jobs-list)", + version: "0.0.1", + type: "action", + props: { + hamsa, + }, + async run({ $ }) { + const response = await this.hamsa.listJobs({ + $, + }); + + $.export("$summary", `Successfully fetched ${response?.data?.jobs?.legnth} jobs.`); + + return response; + }, +}; diff --git a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs index d3d09ef3f7509..d05f52cd446b0 100644 --- a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs +++ b/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs @@ -2,7 +2,7 @@ import hamsa from "../../hamsa.app.mjs"; export default { key: "hamsa-synthethize-voice", - name: "Synthesize Voice", + name: "Synthethize Voice", description: "Converts text input into artificial speech using Hamsa. [See the documentation](https://docs.tryhamsa.com/api-reference/endpoint/generate-tts)", version: "0.0.1", type: "action", From 8bdf615ad7e8b61d3d43c159859275d35e2fc20f Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 9 Apr 2025 16:06:57 -0300 Subject: [PATCH 6/9] Update components/hamsa/actions/list-jobs/list-jobs.mjs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- components/hamsa/actions/list-jobs/list-jobs.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hamsa/actions/list-jobs/list-jobs.mjs b/components/hamsa/actions/list-jobs/list-jobs.mjs index 106ccbf25df46..ecb471b0cc7f0 100644 --- a/components/hamsa/actions/list-jobs/list-jobs.mjs +++ b/components/hamsa/actions/list-jobs/list-jobs.mjs @@ -14,7 +14,7 @@ export default { $, }); - $.export("$summary", `Successfully fetched ${response?.data?.jobs?.legnth} jobs.`); + $.export("$summary", `Successfully fetched ${response?.data?.jobs?.length} jobs.`); return response; }, From c80d53ebcd9c98b7b5057a048ae5e5a22bc83ccc Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Wed, 9 Apr 2025 15:30:05 -0400 Subject: [PATCH 7/9] fix synthesize spelling --- .../synthesize-voice.mjs} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename components/hamsa/actions/{synthethize-voice/synthethize-voice.mjs => synthesize-voice/synthesize-voice.mjs} (96%) diff --git a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs b/components/hamsa/actions/synthesize-voice/synthesize-voice.mjs similarity index 96% rename from components/hamsa/actions/synthethize-voice/synthethize-voice.mjs rename to components/hamsa/actions/synthesize-voice/synthesize-voice.mjs index d05f52cd446b0..1371c289254dd 100644 --- a/components/hamsa/actions/synthethize-voice/synthethize-voice.mjs +++ b/components/hamsa/actions/synthesize-voice/synthesize-voice.mjs @@ -1,8 +1,8 @@ import hamsa from "../../hamsa.app.mjs"; export default { - key: "hamsa-synthethize-voice", - name: "Synthethize Voice", + key: "hamsa-synthesize-voice", + name: "Synthesize Voice", description: "Converts text input into artificial speech using Hamsa. [See the documentation](https://docs.tryhamsa.com/api-reference/endpoint/generate-tts)", version: "0.0.1", type: "action", From 3b88011342a267ba3ccaab0bee16452ef2457dfb Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 10 Apr 2025 16:10:07 -0300 Subject: [PATCH 8/9] some adjusts --- .../actions/synthesize-voice/synthesize-voice.mjs | 2 +- components/hamsa/hamsa.app.mjs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/hamsa/actions/synthesize-voice/synthesize-voice.mjs b/components/hamsa/actions/synthesize-voice/synthesize-voice.mjs index 1371c289254dd..843f8beb6cc6f 100644 --- a/components/hamsa/actions/synthesize-voice/synthesize-voice.mjs +++ b/components/hamsa/actions/synthesize-voice/synthesize-voice.mjs @@ -60,7 +60,7 @@ export default { data, }); - $.export("$summary", `Text to speech job successfully created with ID ${response.id}`); + $.export("$summary", `Text to speech job successfully created with ID ${response.data.id}`); return response; }, }; diff --git a/components/hamsa/hamsa.app.mjs b/components/hamsa/hamsa.app.mjs index 1617ec75b22b4..3dab4270657d3 100644 --- a/components/hamsa/hamsa.app.mjs +++ b/components/hamsa/hamsa.app.mjs @@ -36,14 +36,14 @@ export default { if (page) { params.skip = page * LIMIT; } - const { data: { voiceAgents } } = await this.listVoiceAgents({ + const { data } = await this.listVoices({ params, }); - return voiceAgents.map(({ - id: value, agentName: label, + return data.map(({ + id: value, name, tags, }) => ({ - label, + label: `${name} (${tags.join(" - ")})`, value, })); }, @@ -90,9 +90,9 @@ export default { ...opts, }); }, - listVoiceAgents(opts = {}) { + listVoices(opts = {}) { return this._makeRequest({ - path: "/voice-agents", + path: "/tts/voices", ...opts, }); }, From 1748a53fcb9bad0f4ad608b67c989091e1056320 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 10 Apr 2025 16:13:25 -0300 Subject: [PATCH 9/9] pnpm update --- pnpm-lock.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 531b091859a79..a68a4edf98b36 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4308,8 +4308,7 @@ importers: components/facebook_conversions: {} - components/facebook_graph_api: - specifiers: {} + components/facebook_graph_api: {} components/facebook_groups: dependencies: @@ -4929,8 +4928,7 @@ importers: components/gatekeeper: {} - components/gather: - specifiers: {} + components/gather: {} components/gatherup: dependencies: