From b0364a78d2219c57e8912d0b33b2ec284534ff0f Mon Sep 17 00:00:00 2001 From: Jorge Cortes Date: Tue, 28 Oct 2025 18:11:18 -0500 Subject: [PATCH] [FIX] Lusha API Authentication Issue --- .../actions/company-enrich/company-enrich.mjs | 2 +- .../actions/company-search/company-search.mjs | 2 +- .../actions/contact-enrich/contact-enrich.mjs | 2 +- .../actions/contact-search/contact-search.mjs | 2 +- .../search-and-enrich-companies.mjs | 2 +- .../search-and-enrich-contacts.mjs | 2 +- components/lusha/lusha.app.mjs | 14 ++++++++------ components/lusha/package.json | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/components/lusha/actions/company-enrich/company-enrich.mjs b/components/lusha/actions/company-enrich/company-enrich.mjs index 08794aa0e5c82..9f3c4850708d1 100644 --- a/components/lusha/actions/company-enrich/company-enrich.mjs +++ b/components/lusha/actions/company-enrich/company-enrich.mjs @@ -4,7 +4,7 @@ export default { key: "lusha-company-enrich", name: "Enrich Companies", description: "Enriches company information based on provided company IDs. [See the documentation](https://docs.lusha.com/apis/openapi/company-search-and-enrich/enrichprospectingcompanies)", - version: "0.0.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/actions/company-search/company-search.mjs b/components/lusha/actions/company-search/company-search.mjs index 4ab514e66d63a..aa252621ea820 100644 --- a/components/lusha/actions/company-search/company-search.mjs +++ b/components/lusha/actions/company-search/company-search.mjs @@ -5,7 +5,7 @@ export default { key: "lusha-company-search", name: "Search Companies", description: "Search for companies using various filters. [See the documentation](https://docs.lusha.com/apis/openapi/company-search-and-enrich/searchprospectingcompanies)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/actions/contact-enrich/contact-enrich.mjs b/components/lusha/actions/contact-enrich/contact-enrich.mjs index ff08da6ff3f14..7c2828559e934 100644 --- a/components/lusha/actions/contact-enrich/contact-enrich.mjs +++ b/components/lusha/actions/contact-enrich/contact-enrich.mjs @@ -4,7 +4,7 @@ export default { key: "lusha-contact-enrich", name: "Enrich Contacts", description: "Enriches contacts based on provided IDs. [See the documentation](https://docs.lusha.com/apis/openapi/contact-search-and-enrich/enrichprospectingcontacts)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/actions/contact-search/contact-search.mjs b/components/lusha/actions/contact-search/contact-search.mjs index e6222f0d022a8..4df53816d2d50 100644 --- a/components/lusha/actions/contact-search/contact-search.mjs +++ b/components/lusha/actions/contact-search/contact-search.mjs @@ -5,7 +5,7 @@ export default { key: "lusha-contact-search", name: "Search Contacts", description: "Search for contacts using various filters. [See the documentation](https://docs.lusha.com/apis/openapi/contact-search-and-enrich/searchprospectingcontacts)", - version: "0.0.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs b/components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs index 3964414f63295..0cc741bd4b1c8 100644 --- a/components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs +++ b/components/lusha/actions/search-and-enrich-companies/search-and-enrich-companies.mjs @@ -5,7 +5,7 @@ export default { key: "lusha-search-and-enrich-companies", name: "Search and Enrich Companies", description: "Search for companies and enrich them. [See the documentation](https://docs.lusha.com/apis/openapi/company-search-and-enrich)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs b/components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs index a1ed92d5b2ad4..90ab106ff922b 100644 --- a/components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs +++ b/components/lusha/actions/search-and-enrich-contacts/search-and-enrich-contacts.mjs @@ -5,7 +5,7 @@ export default { key: "lusha-search-and-enrich-contacts", name: "Search and Enrich Contacts", description: "Search for contacts and enrich them. [See the documentation](https://docs.lusha.com/apis/openapi/contact-search-and-enrich)", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/lusha.app.mjs b/components/lusha/lusha.app.mjs index c65c7047ab54c..ec20f97db438f 100644 --- a/components/lusha/lusha.app.mjs +++ b/components/lusha/lusha.app.mjs @@ -179,6 +179,7 @@ export default { $ = this, path, ...opts }) { return axios($, { + debug: true, url: `${this._baseUrl()}${path}`, headers: this._headers(), ...opts, @@ -261,22 +262,23 @@ export default { }); }, async *paginate({ - fn, params = {}, maxResults = null, ...opts + fn, data = {}, maxResults = null, ...opts }) { let hasMore = false; let count = 0; let page = -1; do { - params.pages = { + data.pages = { page: ++page, size: 50, }; - const { data } = await fn({ - params, + const response = await fn({ + data, ...opts, }); - for (const d of data) { + const results = response.data || []; + for (const d of results) { yield d; if (maxResults && ++count === maxResults) { @@ -284,7 +286,7 @@ export default { } } - hasMore = data.length; + hasMore = results.length; } while (hasMore); }, diff --git a/components/lusha/package.json b/components/lusha/package.json index aad5b4eea784c..748cd11c81376 100644 --- a/components/lusha/package.json +++ b/components/lusha/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/lusha", - "version": "0.2.0", + "version": "0.2.1", "description": "Pipedream Lusha Components", "main": "lusha.app.mjs", "keywords": [