diff --git a/components/alt_text_generator_ai/actions/generate-alt-text/generate-alt-text.mjs b/components/alt_text_generator_ai/actions/generate-alt-text/generate-alt-text.mjs new file mode 100644 index 0000000000000..f4a8963739f03 --- /dev/null +++ b/components/alt_text_generator_ai/actions/generate-alt-text/generate-alt-text.mjs @@ -0,0 +1,27 @@ +import altTextGeneratorAi from "../../alt_text_generator_ai.app.mjs"; + +export default { + key: "alt_text_generator_ai-generate-alt-text", + name: "Generate Alt Text", + description: "Generate alt text for an image. [See the documentation](https://alttextgeneratorai.com/api-docs)", + version: "0.0.1", + type: "action", + props: { + altTextGeneratorAi, + image: { + type: "string", + label: "Image URL", + description: "The URL of the image to generate alt text for", + }, + }, + async run({ $ }) { + const response = await this.altTextGeneratorAi.generateAltText({ + $, + data: { + image: this.image, + }, + }); + $.export("$summary", `Successfully generated alt text for ${this.image}`); + return response; + }, +}; diff --git a/components/alt_text_generator_ai/alt_text_generator_ai.app.mjs b/components/alt_text_generator_ai/alt_text_generator_ai.app.mjs index 83753792b281c..4a7e13ab5a1b0 100644 --- a/components/alt_text_generator_ai/alt_text_generator_ai.app.mjs +++ b/components/alt_text_generator_ai/alt_text_generator_ai.app.mjs @@ -1,11 +1,22 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "alt_text_generator_ai", propDefinitions: {}, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + generateAltText({ + $ = this, data, ...opts + }) { + return axios($, { + url: "https://alttextgeneratorai.com/api/wp", + method: "POST", + data: { + ...data, + wpkey: `${this.$auth.api_key}`, + }, + ...opts, + }); }, }, }; diff --git a/components/alt_text_generator_ai/package.json b/components/alt_text_generator_ai/package.json index 0a8c87dd49c5c..40f7c92d94bd6 100644 --- a/components/alt_text_generator_ai/package.json +++ b/components/alt_text_generator_ai/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/alt_text_generator_ai", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Alt Text Generator AI Components", "main": "alt_text_generator_ai.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c3c7bbacd1e1..7df726d611ac8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -713,7 +713,11 @@ importers: components/alphamoon: {} - components/alt_text_generator_ai: {} + components/alt_text_generator_ai: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/alteryx_analytics_cloud: {} @@ -10159,8 +10163,7 @@ importers: specifier: ^6.11.1 version: 6.13.1 - components/pingback: - specifiers: {} + components/pingback: {} components/pingbell: dependencies: @@ -29916,22 +29919,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==}