From db6dade7686d76934b892267eee570db7b3f4ef4 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Fri, 31 Oct 2025 13:35:05 -0400 Subject: [PATCH 1/4] new components --- .../google-image-search.mjs | 83 ++++++++++ .../google-news-search/google-news-search.mjs | 83 ++++++++++ .../actions/google-search/google-search.mjs | 82 ++++++++++ components/zenserp/package.json | 5 +- components/zenserp/zenserp.app.mjs | 150 +++++++++++++++++- 5 files changed, 397 insertions(+), 6 deletions(-) create mode 100644 components/zenserp/actions/google-image-search/google-image-search.mjs create mode 100644 components/zenserp/actions/google-news-search/google-news-search.mjs create mode 100644 components/zenserp/actions/google-search/google-search.mjs diff --git a/components/zenserp/actions/google-image-search/google-image-search.mjs b/components/zenserp/actions/google-image-search/google-image-search.mjs new file mode 100644 index 0000000000000..d0860d9816d9e --- /dev/null +++ b/components/zenserp/actions/google-image-search/google-image-search.mjs @@ -0,0 +1,83 @@ +import zenserp from "../../zenserp.app.mjs"; + +export default { + key: "zenserp-google-image-search", + name: "Google Image Search", + description: "Perform a Google image search using the Zenserp API. [See the documentation](https://app.zenserp.com/documentation#imageSearch)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + zenserp, + q: { + propDefinition: [ + zenserp, + "q", + ], + }, + searchEngine: { + propDefinition: [ + zenserp, + "searchEngine", + ], + }, + country: { + propDefinition: [ + zenserp, + "country", + ], + }, + language: { + propDefinition: [ + zenserp, + "language", + ], + }, + num: { + propDefinition: [ + zenserp, + "num", + ], + }, + start: { + propDefinition: [ + zenserp, + "start", + ], + }, + device: { + propDefinition: [ + zenserp, + "device", + ], + }, + timeframe: { + propDefinition: [ + zenserp, + "timeframe", + ], + }, + }, + async run({ $ }) { + const response = await this.zenserp.search({ + $, + params: { + q: this.q, + tbm: "isch", + search_engine: this.searchEngine, + gl: this.country, + lr: this.language, + num: this.num, + start: this.start, + device: this.device, + timeframe: this.timeframe, + }, + }); + $.export("$summary", `Successfully searched for images with query "${this.q}"`); + return response; + }, +}; diff --git a/components/zenserp/actions/google-news-search/google-news-search.mjs b/components/zenserp/actions/google-news-search/google-news-search.mjs new file mode 100644 index 0000000000000..ffbf336f0365d --- /dev/null +++ b/components/zenserp/actions/google-news-search/google-news-search.mjs @@ -0,0 +1,83 @@ +import zenserp from "../../zenserp.app.mjs"; + +export default { + key: "zenserp-google-news-search", + name: "Google News Search", + description: "Perform a Google news search using the Zenserp API. [See the documentation](https://app.zenserp.com/documentation#newsSearch)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + zenserp, + q: { + propDefinition: [ + zenserp, + "q", + ], + }, + searchEngine: { + propDefinition: [ + zenserp, + "searchEngine", + ], + }, + country: { + propDefinition: [ + zenserp, + "country", + ], + }, + language: { + propDefinition: [ + zenserp, + "language", + ], + }, + num: { + propDefinition: [ + zenserp, + "num", + ], + }, + start: { + propDefinition: [ + zenserp, + "start", + ], + }, + device: { + propDefinition: [ + zenserp, + "device", + ], + }, + timeframe: { + propDefinition: [ + zenserp, + "timeframe", + ], + }, + }, + async run({ $ }) { + const response = await this.zenserp.search({ + $, + params: { + q: this.q, + tbm: "nws", + search_engine: this.searchEngine, + gl: this.country, + lr: this.language, + num: this.num, + start: this.start, + device: this.device, + timeframe: this.timeframe, + }, + }); + $.export("$summary", `Successfully searched for news with query "${this.q}"`); + return response; + }, +}; diff --git a/components/zenserp/actions/google-search/google-search.mjs b/components/zenserp/actions/google-search/google-search.mjs new file mode 100644 index 0000000000000..f81f26099456a --- /dev/null +++ b/components/zenserp/actions/google-search/google-search.mjs @@ -0,0 +1,82 @@ +import zenserp from "../../zenserp.app.mjs"; + +export default { + key: "zenserp-google-search", + name: "Google Search", + description: "Perform a Google search using the Zenserp API. [See the documentation](https://app.zenserp.com/documentation#search)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + zenserp, + q: { + propDefinition: [ + zenserp, + "q", + ], + }, + searchEngine: { + propDefinition: [ + zenserp, + "searchEngine", + ], + }, + country: { + propDefinition: [ + zenserp, + "country", + ], + }, + language: { + propDefinition: [ + zenserp, + "language", + ], + }, + num: { + propDefinition: [ + zenserp, + "num", + ], + }, + start: { + propDefinition: [ + zenserp, + "start", + ], + }, + device: { + propDefinition: [ + zenserp, + "device", + ], + }, + timeframe: { + propDefinition: [ + zenserp, + "timeframe", + ], + }, + }, + async run({ $ }) { + const response = await this.zenserp.search({ + $, + params: { + q: this.q, + search_engine: this.searchEngine, + gl: this.country, + lr: this.language, + num: this.num, + start: this.start, + device: this.device, + timeframe: this.timeframe, + }, + }); + $.export("$summary", `Successfully searched "${this.q}"`); + return response; + }, +}; diff --git a/components/zenserp/package.json b/components/zenserp/package.json index c76e1fd3cb040..c69453a6a864c 100644 --- a/components/zenserp/package.json +++ b/components/zenserp/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zenserp", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Zenserp Components", "main": "zenserp.app.mjs", "keywords": [ @@ -11,5 +11,8 @@ "author": "Pipedream (https://pipedream.com/)", "publishConfig": { "access": "public" + }, + "dependencies": { + "@pipedream/platform": "^3.1.0" } } diff --git a/components/zenserp/zenserp.app.mjs b/components/zenserp/zenserp.app.mjs index a290d51c2b58f..d716f82956aa8 100644 --- a/components/zenserp/zenserp.app.mjs +++ b/components/zenserp/zenserp.app.mjs @@ -1,11 +1,151 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "zenserp", - propDefinitions: {}, + propDefinitions: { + q: { + type: "string", + label: "Search Query", + description: "The search query you want to perform", + }, + searchEngine: { + type: "string", + label: "Search Engine", + description: "The search engine you want to use", + optional: true, + async options() { + return this.listSearchEngines(); + }, + }, + country: { + type: "string", + label: "Country", + description: "The country you want to search in", + optional: true, + async options() { + const countries = await this.listCountries(); + return countries.map((country) => ({ + value: country.code, + label: country.name, + })); + }, + }, + language: { + type: "string", + label: "Language", + description: "The language you want to use for the search", + optional: true, + async options() { + const languages = await this.listLanguages(); + return languages.map((language) => ({ + value: `lang_${language.code}`, + label: language.name, + })); + }, + }, + num: { + type: "integer", + label: "Number of Results", + description: "The number of results you want to return", + optional: true, + max: 100, + }, + start: { + type: "integer", + label: "Start", + description: "The offset for the search results - if you use num=100 and want the second page, use start=100. start=0 (default) - first page of results", + optional: true, + }, + device: { + type: "string", + label: "Device", + description: "The device you want to use for the search", + optional: true, + options: [ + "desktop", + "mobile", + ], + }, + timeframe: { + type: "string", + label: "Timeframe", + description: "The timeframe you want to use for the search", + optional: true, + options: [ + { + value: "now 1-H", + label: "Past hour", + }, + { + value: "now 4-H", + label: "Past 4 hours", + }, + { + value: "now 1-d", + label: "Past day", + }, + { + value: "now 7-d", + label: "Past 7 days", + }, + { + value: "today 1-m", + label: "Past 30 days", + }, + { + value: "today 3-m", + label: "Past 90 days", + }, + { + value: "today 12-m", + label: "Past 12 months", + }, + { + value: "today 5-y", + label: "Past 5 years", + }, + ], + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + _baseUrl() { + return "https://app.zenserp.com/api/v2"; + }, + _makeRequest({ + $ = this, path, ...opts + }) { + return axios($, { + url: `${this._baseUrl()}${path}`, + headers: { + apikey: `${this.$auth.api_key}`, + }, + ...opts, + }); + }, + listSearchEngines(opts = {}) { + return this._makeRequest({ + path: "/search_engines", + ...opts, + }); + }, + listCountries(opts = {}) { + return this._makeRequest({ + path: "/gl", + ...opts, + }); + }, + listLanguages(opts = {}) { + return this._makeRequest({ + path: "/hl", + ...opts, + }); + }, + search(opts = {}) { + return this._makeRequest({ + path: "/search", + ...opts, + }); }, }, -}; \ No newline at end of file +}; From 9c4b99b69118d59a818613cfe551f2cc5e679d20 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Fri, 31 Oct 2025 13:35:42 -0400 Subject: [PATCH 2/4] pnpm-lock.yaml --- pnpm-lock.yaml | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ed53e34a1a7a..ecb5e9a3477dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3414,8 +3414,7 @@ importers: components/cronly: {} - components/cronlytic: - specifiers: {} + components/cronlytic: {} components/crossmint: {} @@ -3624,8 +3623,7 @@ importers: components/data_police_uk: {} - components/data_soap: - specifiers: {} + components/data_soap: {} components/data_stores: dependencies: @@ -3733,13 +3731,11 @@ importers: specifier: ^1.5.1 version: 1.6.6 - components/decodo: - specifiers: {} + components/decodo: {} components/deel: {} - components/deep_tagger: - specifiers: {} + components/deep_tagger: {} components/deepgram: dependencies: @@ -3834,8 +3830,7 @@ importers: specifier: ^0.3.2 version: 0.3.2 - components/deutschlandgpt: - specifiers: {} + components/deutschlandgpt: {} components/dev_to: dependencies: @@ -4472,8 +4467,7 @@ importers: components/ebay: {} - components/echowin: - specifiers: {} + components/echowin: {} components/echtpost_postcards: dependencies: @@ -4794,8 +4788,7 @@ importers: specifier: ^1.1.1 version: 1.6.6 - components/evervault: - specifiers: {} + components/evervault: {} components/everwebinar: dependencies: @@ -4862,8 +4855,7 @@ importers: components/extracta_ai: {} - components/extruct_ai: - specifiers: {} + components/extruct_ai: {} components/eyepop_ai: {} @@ -7358,8 +7350,7 @@ importers: specifier: ^1.1.1 version: 1.6.6 - components/ipregistry: - specifiers: {} + components/ipregistry: {} components/ipstack: dependencies: @@ -8213,8 +8204,7 @@ importers: specifier: ^1.0.3 version: 1.0.3 - components/linkupapi: - specifiers: {} + components/linkupapi: {} components/linode: dependencies: @@ -16546,7 +16536,11 @@ importers: specifier: ^2.3.0 version: 2.3.0 - components/zenserp: {} + components/zenserp: + dependencies: + '@pipedream/platform': + specifier: ^3.1.0 + version: 3.1.0 components/zenventory: dependencies: From b0bb0b43f8750194676266a537d3781a0cdbae42 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 3 Nov 2025 09:41:03 -0500 Subject: [PATCH 3/4] remove unsupported props --- .../google-image-search/google-image-search.mjs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/components/zenserp/actions/google-image-search/google-image-search.mjs b/components/zenserp/actions/google-image-search/google-image-search.mjs index d0860d9816d9e..18cd47911d5ad 100644 --- a/components/zenserp/actions/google-image-search/google-image-search.mjs +++ b/components/zenserp/actions/google-image-search/google-image-search.mjs @@ -37,18 +37,6 @@ export default { "language", ], }, - num: { - propDefinition: [ - zenserp, - "num", - ], - }, - start: { - propDefinition: [ - zenserp, - "start", - ], - }, device: { propDefinition: [ zenserp, From 8f041214817331eef3d181dc872841f6f9f2196d Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 3 Nov 2025 09:47:12 -0500 Subject: [PATCH 4/4] remove unsupported props --- .../zenserp/actions/google-image-search/google-image-search.mjs | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/zenserp/actions/google-image-search/google-image-search.mjs b/components/zenserp/actions/google-image-search/google-image-search.mjs index 18cd47911d5ad..6b92d11c8e8aa 100644 --- a/components/zenserp/actions/google-image-search/google-image-search.mjs +++ b/components/zenserp/actions/google-image-search/google-image-search.mjs @@ -59,8 +59,6 @@ export default { search_engine: this.searchEngine, gl: this.country, lr: this.language, - num: this.num, - start: this.start, device: this.device, timeframe: this.timeframe, },