From c90e8e60841f980b20947a2179697e21be9acd40 Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Tue, 30 Sep 2025 15:57:51 -0300 Subject: [PATCH 1/5] Added actions --- .../submit-feedback/submit-feedback.mjs | 56 +++++++++ .../url-data-extraction.mjs | 64 ++++++++++ .../verbose-url-data-extraction.mjs | 64 ++++++++++ components/taggun/common/constants.mjs | 17 +++ components/taggun/package.json | 3 + components/taggun/taggun.app.mjs | 110 +++++++++++++++++- pnpm-lock.yaml | 20 ++-- 7 files changed, 320 insertions(+), 14 deletions(-) create mode 100644 components/taggun/actions/submit-feedback/submit-feedback.mjs create mode 100644 components/taggun/actions/url-data-extraction/url-data-extraction.mjs create mode 100644 components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs create mode 100644 components/taggun/common/constants.mjs diff --git a/components/taggun/actions/submit-feedback/submit-feedback.mjs b/components/taggun/actions/submit-feedback/submit-feedback.mjs new file mode 100644 index 0000000000000..030f2c0bb2dc3 --- /dev/null +++ b/components/taggun/actions/submit-feedback/submit-feedback.mjs @@ -0,0 +1,56 @@ +import app from "../../taggun.app.mjs"; + +export default { + key: "taggun-submit-feedback", + name: "Submit Feedback", + description: "Add manually verified receipt data to a given receipt for feedback and training purposes. [See the documentation](https://developers.taggun.io/reference/improve-your-restuls)", + version: "0.0.1", + type: "action", + props: { + app, + referenceId: { + propDefinition: [ + app, + "referenceId", + ], + }, + totalAmount: { + propDefinition: [ + app, + "totalAmount", + ], + }, + taxAmount: { + propDefinition: [ + app, + "taxAmount", + ], + }, + merchantName: { + propDefinition: [ + app, + "merchantName", + ], + }, + currencyCode: { + propDefinition: [ + app, + "currencyCode", + ], + }, + }, + async run({ $ }) { + const response = await this.app.submitFeedback({ + $, + data: { + referenceId: this.referenceId, + totalAmount: this.totalAmount, + taxAmount: this.taxAmount, + merchantName: this.merchantName, + currencyCode: this.currencyCode, + }, + }); + $.export("$summary", "Successfully submitted feedback"); + return response; + }, +}; diff --git a/components/taggun/actions/url-data-extraction/url-data-extraction.mjs b/components/taggun/actions/url-data-extraction/url-data-extraction.mjs new file mode 100644 index 0000000000000..0cc0643366dd3 --- /dev/null +++ b/components/taggun/actions/url-data-extraction/url-data-extraction.mjs @@ -0,0 +1,64 @@ +import app from "../../taggun.app.mjs"; + +export default { + key: "taggun-url-data-extraction", + name: "URL Data Extraction", + description: "Provide a URL for a receipt or invoice to extract clear and basic data. [See the documentation](https://developers.taggun.io/reference/url-simple)", + version: "0.0.1", + type: "action", + props: { + app, + url: { + propDefinition: [ + app, + "url", + ], + }, + referenceId: { + propDefinition: [ + app, + "referenceId", + ], + optional: true, + }, + refresh: { + propDefinition: [ + app, + "refresh", + ], + }, + near: { + propDefinition: [ + app, + "near", + ], + }, + language: { + propDefinition: [ + app, + "language", + ], + }, + incognito: { + propDefinition: [ + app, + "incognito", + ], + }, + }, + async run({ $ }) { + const response = await this.app.urlDataExtraction({ + $, + data: { + url: this.url, + referenceId: this.referenceId, + refresh: this.refresh, + near: this.near, + language: this.language, + incognito: this.incognito, + }, + }); + $.export("$summary", "Successfully sent the image for processing"); + return response; + }, +}; diff --git a/components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs b/components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs new file mode 100644 index 0000000000000..299112b1bf4b2 --- /dev/null +++ b/components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs @@ -0,0 +1,64 @@ +import app from "../../taggun.app.mjs"; + +export default { + key: "taggun-verbose-url-data-extraction", + name: "Verbose URL Data Extraction", + description: "Provide a URL for a receipt or invoice to extract clear and comprehensive data. [See the documentation](https://developers.taggun.io/reference/url-verbose)", + version: "0.0.1", + type: "action", + props: { + app, + url: { + propDefinition: [ + app, + "url", + ], + }, + referenceId: { + propDefinition: [ + app, + "referenceId", + ], + optional: true, + }, + refresh: { + propDefinition: [ + app, + "refresh", + ], + }, + near: { + propDefinition: [ + app, + "near", + ], + }, + language: { + propDefinition: [ + app, + "language", + ], + }, + incognito: { + propDefinition: [ + app, + "incognito", + ], + }, + }, + async run({ $ }) { + const response = await this.app.verboseUrlDataExtraction({ + $, + data: { + url: this.url, + referenceId: this.referenceId, + refresh: this.refresh, + near: this.near, + language: this.language, + incognito: this.incognito, + }, + }); + $.export("$summary", "Successfully sent the image for processing"); + return response; + }, +}; diff --git a/components/taggun/common/constants.mjs b/components/taggun/common/constants.mjs new file mode 100644 index 0000000000000..f20c68df8a204 --- /dev/null +++ b/components/taggun/common/constants.mjs @@ -0,0 +1,17 @@ +export default { + LANGUAGE_OPTIONS: [ + "en", + "es", + "fr", + "jp", + "he", + "iw", + "et", + "lv", + "lt", + "fi", + "el", + "zh", + "th", + ], +}; diff --git a/components/taggun/package.json b/components/taggun/package.json index 1be2d23a08b96..4b44813309a2f 100644 --- a/components/taggun/package.json +++ b/components/taggun/package.json @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } } diff --git a/components/taggun/taggun.app.mjs b/components/taggun/taggun.app.mjs index 74fb1a3da2669..f6bd56ce60a98 100644 --- a/components/taggun/taggun.app.mjs +++ b/components/taggun/taggun.app.mjs @@ -1,11 +1,111 @@ +import { axios } from "@pipedream/platform"; +import constants from "./common/constants.mjs"; + export default { type: "app", app: "taggun", - propDefinitions: {}, + propDefinitions: { + url: { + type: "string", + label: "URL", + description: "Image URL to process", + }, + referenceId: { + type: "string", + label: "Reference ID", + description: "Custom reference ID for tracking the request", + }, + refresh: { + type: "boolean", + label: "Refresh", + description: "Force reprocessing of the image instead of using cached results", + optional: true, + }, + near: { + type: "string", + label: "Near", + description: "Provide a nearby location to improve result accuracy", + optional: true, + }, + language: { + type: "string", + label: "Language", + description: "Preferred language for extracted text", + options: constants.LANGUAGE_OPTIONS, + optional: true, + }, + incognito: { + type: "boolean", + label: "Incognito", + description: "Do not store or use the image for system training", + optional: true, + }, + totalAmount: { + type: "string", + label: "Total Amount", + description: "The expected total amount from the user", + optional: true, + }, + taxAmount: { + type: "string", + label: "Tax Amount", + description: "The expected tax amount from the user", + optional: true, + }, + merchantName: { + type: "string", + label: "Merchant Name", + description: "The expected merchant name from the user", + optional: true, + }, + currencyCode: { + type: "string", + label: "Currency Code", + description: "The expected currency code from the user.", + optional: true, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://api.taggun.io/api"; + }, + async _makeRequest(opts = {}) { + const { + $ = this, + path, + headers, + ...otherOpts + } = opts; + return axios($, { + ...otherOpts, + url: this._baseUrl() + path, + headers: { + "apikey": `${this.$auth.api_key}`, + "Content-Type": "application/json", + ...headers, + }, + }); + }, + async urlDataExtraction(args = {}) { + return this._makeRequest({ + path: "/receipt/v1/simple/url", + method: "post", + ...args, + }); + }, + async submitFeedback(args = {}) { + return this._makeRequest({ + path: "/account/v1/feedback", + method: "post", + ...args, + }); + }, + async verboseUrlDataExtraction(args = {}) { + return this._makeRequest({ + path: "/receipt/v1/verbose/url", + method: "post", + ...args, + }); }, }, -}; \ No newline at end of file +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2566e58986c87..49974cc644301 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6797,8 +6797,7 @@ importers: components/humanloop: {} - components/humantic_ai: - specifiers: {} + components/humantic_ai: {} components/humor_api: dependencies: @@ -12646,8 +12645,7 @@ importers: specifier: ^4.0.0 version: 4.0.1 - components/securityscorecard: - specifiers: {} + components/securityscorecard: {} components/securitytrails: dependencies: @@ -14139,7 +14137,11 @@ importers: specifier: ^1.6.0 version: 1.6.6 - components/taggun: {} + components/taggun: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/taiga: dependencies: @@ -30986,22 +30988,22 @@ packages: superagent@3.8.1: resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==} engines: {node: '>= 4.0'} - 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 + 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 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 + 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 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 + 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 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 + 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@10.0.0: resolution: {integrity: sha512-HRVVSbCCMbj7/kdWF9Q+bbckjBHLtHMEoJWlkmYzzdwhYMkjkOwubLM6t7NbWKjgKamGDrWL1++KrjUO1t9oAQ==} From 19821e2aed53680b32af5ef03047a0d07c311074 Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Tue, 30 Sep 2025 16:06:28 -0300 Subject: [PATCH 2/5] Added actions --- components/taggun/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/taggun/package.json b/components/taggun/package.json index 4b44813309a2f..de5c97a1a24cf 100644 --- a/components/taggun/package.json +++ b/components/taggun/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/taggun", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Taggun Components", "main": "taggun.app.mjs", "keywords": [ From b4b10c4ed5560f6e26c2f8cff34c0038f41c5129 Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Wed, 8 Oct 2025 12:23:56 -0300 Subject: [PATCH 3/5] Added actions --- .../extract-data-from-url.mjs | 71 +++++++++++++++++++ components/taggun/taggun.app.mjs | 23 +++--- 2 files changed, 84 insertions(+), 10 deletions(-) create mode 100644 components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs diff --git a/components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs b/components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs new file mode 100644 index 0000000000000..eae0d23610f72 --- /dev/null +++ b/components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs @@ -0,0 +1,71 @@ +import app from "../../taggun.app.mjs"; + +export default { + key: "taggun-extract-data-from-url", + name: "Extract Data from URL", + description: "Provide a URL for a receipt or invoice to extract clear and basic data. [See the documentation](https://developers.taggun.io/reference/url-simple)", + version: "0.0.1", + type: "action", + props: { + app, + url: { + propDefinition: [ + app, + "url", + ], + }, + referenceId: { + propDefinition: [ + app, + "referenceId", + ], + optional: true, + }, + refresh: { + propDefinition: [ + app, + "refresh", + ], + }, + near: { + propDefinition: [ + app, + "near", + ], + }, + language: { + propDefinition: [ + app, + "language", + ], + }, + incognito: { + propDefinition: [ + app, + "incognito", + ], + }, + verbose: { + propDefinition: [ + app, + "verbose", + ], + }, + }, + async run({ $ }) { + const response = await this.app.urlDataExtraction({ + $, + verbose: this.verbose, + data: { + url: this.url, + referenceId: this.referenceId, + refresh: this.refresh, + near: this.near, + language: this.language, + incognito: this.incognito, + }, + }); + $.export("$summary", "Successfully sent the image for processing"); + return response; + }, +}; diff --git a/components/taggun/taggun.app.mjs b/components/taggun/taggun.app.mjs index f6bd56ce60a98..733f3bd497842 100644 --- a/components/taggun/taggun.app.mjs +++ b/components/taggun/taggun.app.mjs @@ -61,7 +61,13 @@ export default { currencyCode: { type: "string", label: "Currency Code", - description: "The expected currency code from the user.", + description: "The expected currency code from the user", + optional: true, + }, + verbose: { + type: "boolean", + label: "Verbose", + description: "Whether the data extraction will be simple or verbose", optional: true, }, }, @@ -86,9 +92,13 @@ export default { }, }); }, - async urlDataExtraction(args = {}) { + async urlDataExtraction({ + verbose, ...args + }) { return this._makeRequest({ - path: "/receipt/v1/simple/url", + path: `/receipt/v1/${verbose + ? "verbose" + : "simple"}/url`, method: "post", ...args, }); @@ -100,12 +110,5 @@ export default { ...args, }); }, - async verboseUrlDataExtraction(args = {}) { - return this._makeRequest({ - path: "/receipt/v1/verbose/url", - method: "post", - ...args, - }); - }, }, }; From 4b3098bdb6773aea89bf225e675500a3c47b2f53 Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Wed, 15 Oct 2025 11:11:36 -0300 Subject: [PATCH 4/5] Added actions --- .../url-data-extraction.mjs | 64 ------------------- .../verbose-url-data-extraction.mjs | 64 ------------------- 2 files changed, 128 deletions(-) delete mode 100644 components/taggun/actions/url-data-extraction/url-data-extraction.mjs delete mode 100644 components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs diff --git a/components/taggun/actions/url-data-extraction/url-data-extraction.mjs b/components/taggun/actions/url-data-extraction/url-data-extraction.mjs deleted file mode 100644 index 0cc0643366dd3..0000000000000 --- a/components/taggun/actions/url-data-extraction/url-data-extraction.mjs +++ /dev/null @@ -1,64 +0,0 @@ -import app from "../../taggun.app.mjs"; - -export default { - key: "taggun-url-data-extraction", - name: "URL Data Extraction", - description: "Provide a URL for a receipt or invoice to extract clear and basic data. [See the documentation](https://developers.taggun.io/reference/url-simple)", - version: "0.0.1", - type: "action", - props: { - app, - url: { - propDefinition: [ - app, - "url", - ], - }, - referenceId: { - propDefinition: [ - app, - "referenceId", - ], - optional: true, - }, - refresh: { - propDefinition: [ - app, - "refresh", - ], - }, - near: { - propDefinition: [ - app, - "near", - ], - }, - language: { - propDefinition: [ - app, - "language", - ], - }, - incognito: { - propDefinition: [ - app, - "incognito", - ], - }, - }, - async run({ $ }) { - const response = await this.app.urlDataExtraction({ - $, - data: { - url: this.url, - referenceId: this.referenceId, - refresh: this.refresh, - near: this.near, - language: this.language, - incognito: this.incognito, - }, - }); - $.export("$summary", "Successfully sent the image for processing"); - return response; - }, -}; diff --git a/components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs b/components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs deleted file mode 100644 index 299112b1bf4b2..0000000000000 --- a/components/taggun/actions/verbose-url-data-extraction/verbose-url-data-extraction.mjs +++ /dev/null @@ -1,64 +0,0 @@ -import app from "../../taggun.app.mjs"; - -export default { - key: "taggun-verbose-url-data-extraction", - name: "Verbose URL Data Extraction", - description: "Provide a URL for a receipt or invoice to extract clear and comprehensive data. [See the documentation](https://developers.taggun.io/reference/url-verbose)", - version: "0.0.1", - type: "action", - props: { - app, - url: { - propDefinition: [ - app, - "url", - ], - }, - referenceId: { - propDefinition: [ - app, - "referenceId", - ], - optional: true, - }, - refresh: { - propDefinition: [ - app, - "refresh", - ], - }, - near: { - propDefinition: [ - app, - "near", - ], - }, - language: { - propDefinition: [ - app, - "language", - ], - }, - incognito: { - propDefinition: [ - app, - "incognito", - ], - }, - }, - async run({ $ }) { - const response = await this.app.verboseUrlDataExtraction({ - $, - data: { - url: this.url, - referenceId: this.referenceId, - refresh: this.refresh, - near: this.near, - language: this.language, - incognito: this.incognito, - }, - }); - $.export("$summary", "Successfully sent the image for processing"); - return response; - }, -}; From 7da1c166f1be6ca62d896d7610672e16436ebadf Mon Sep 17 00:00:00 2001 From: Lucas Caresia Date: Thu, 16 Oct 2025 08:27:47 -0300 Subject: [PATCH 5/5] Added actions --- .../actions/extract-data-from-url/extract-data-from-url.mjs | 5 +++++ .../taggun/actions/submit-feedback/submit-feedback.mjs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs b/components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs index eae0d23610f72..c9da8ad58e1b4 100644 --- a/components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs +++ b/components/taggun/actions/extract-data-from-url/extract-data-from-url.mjs @@ -5,6 +5,11 @@ export default { name: "Extract Data from URL", description: "Provide a URL for a receipt or invoice to extract clear and basic data. [See the documentation](https://developers.taggun.io/reference/url-simple)", version: "0.0.1", + annotations: { + openWorldHint: true, + destructiveHint: false, + readOnlyHint: true, + }, type: "action", props: { app, diff --git a/components/taggun/actions/submit-feedback/submit-feedback.mjs b/components/taggun/actions/submit-feedback/submit-feedback.mjs index 030f2c0bb2dc3..8edff38fce50a 100644 --- a/components/taggun/actions/submit-feedback/submit-feedback.mjs +++ b/components/taggun/actions/submit-feedback/submit-feedback.mjs @@ -5,6 +5,11 @@ export default { name: "Submit Feedback", description: "Add manually verified receipt data to a given receipt for feedback and training purposes. [See the documentation](https://developers.taggun.io/reference/improve-your-restuls)", version: "0.0.1", + annotations: { + openWorldHint: true, + destructiveHint: false, + readOnlyHint: false, + }, type: "action", props: { app,