diff --git a/components/flash_by_velora_ai/actions/add-feedback/add-feedback.mjs b/components/flash_by_velora_ai/actions/add-feedback/add-feedback.mjs new file mode 100644 index 0000000000000..76cc99d8267b3 --- /dev/null +++ b/components/flash_by_velora_ai/actions/add-feedback/add-feedback.mjs @@ -0,0 +1,41 @@ +import flashByVeloraAi from "../../flash_by_velora_ai.app.mjs"; + +export default { + key: "flash_by_velora_ai-add-feedback", + name: "Add Feedback", + description: "Send customer-related feedback to Flash System for comprehensive analysis.", + version: "0.0.1", + type: "action", + props: { + flashByVeloraAi, + feedback: { + type: "string", + label: "Feedback", + description: "Actual text customer feedback", + }, + title: { + type: "string", + label: "Title", + description: "Title of the customer feedback, if any", + optional: true, + }, + source: { + type: "string", + label: "Source", + description: "Source where the feedback was received. For example, GitHub, Slack etc.", + optional: true, + }, + }, + async run({ $ }) { + const response = await this.flashByVeloraAi.sendFeedback({ + $, + data: { + feedback: this.feedback, + title: this.title, + source: this.source, + }, + }); + $.export("$summary", "Successfully sent feedback"); + return response; + }, +}; diff --git a/components/flash_by_velora_ai/actions/upload-transcript/upload-transcript.mjs b/components/flash_by_velora_ai/actions/upload-transcript/upload-transcript.mjs new file mode 100644 index 0000000000000..4b2165301a01e --- /dev/null +++ b/components/flash_by_velora_ai/actions/upload-transcript/upload-transcript.mjs @@ -0,0 +1,39 @@ +import flashByVeloraAi from "../../flash_by_velora_ai.app.mjs"; + +export default { + key: "flash_by_velora_ai-upload-transcript", + name: "Upload Transcript", + description: "Transfers a contact call transcript to the flash system for thorough analysis. [See the documentation](https://flash.velora.ai/developers/documentation/api)", + version: "0.0.1", + type: "action", + props: { + flashByVeloraAi, + title: { + type: "string", + label: "Title", + description: "Title of the meeting", + }, + fileUrl: { + type: "string", + label: "File URL", + description: "Transcript file (supported types: text/plain, pdf, vtt) or transcript text", + }, + sourceType: { + type: "string", + label: "Source Type", + description: "Type of the source system of the file. For example, Google Drive, Fireflies.ai etc.", + }, + }, + async run({ $ }) { + const response = await this.flashByVeloraAi.sendTranscript({ + $, + data: { + title: this.title, + file_url: this.fileUrl, + source_type: this.sourceType, + }, + }); + $.export("$summary", "Transcript uploaded successfully"); + return response; + }, +}; diff --git a/components/flash_by_velora_ai/flash_by_velora_ai.app.mjs b/components/flash_by_velora_ai/flash_by_velora_ai.app.mjs index 49a2f099ce71e..19d9a086c6a4e 100644 --- a/components/flash_by_velora_ai/flash_by_velora_ai.app.mjs +++ b/components/flash_by_velora_ai/flash_by_velora_ai.app.mjs @@ -1,11 +1,38 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "flash_by_velora_ai", - propDefinitions: {}, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://flash-api.velora.ai/v1/api"; + }, + _makeRequest(opts = {}) { + const { + $ = this, + path, + ...otherOpts + } = opts; + return axios($, { + ...otherOpts, + method: "POST", + url: `${this._baseUrl()}${path}`, + headers: { + "x-api-key": `${this.$auth.api_key}`, + }, + }); + }, + sendFeedback(opts = {}) { + return this._makeRequest({ + path: "/add-feedback", + ...opts, + }); + }, + sendTranscript(opts = {}) { + return this._makeRequest({ + path: "/upload-transcript", + ...opts, + }); }, }, -}; \ No newline at end of file +}; diff --git a/components/flash_by_velora_ai/package.json b/components/flash_by_velora_ai/package.json index f349318edc68b..0aa8144ff4e77 100644 --- a/components/flash_by_velora_ai/package.json +++ b/components/flash_by_velora_ai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/flash_by_velora_ai", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Flash (by Velora AI) Components", "main": "flash_by_velora_ai.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.0.3" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 38e0661abe6b8..8d7257eb8a803 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3490,7 +3490,10 @@ importers: specifiers: {} components/flash_by_velora_ai: - specifiers: {} + specifiers: + '@pipedream/platform': ^3.0.3 + dependencies: + '@pipedream/platform': 3.0.3 components/flexmail: specifiers: