From 72a1733c5f81b8fd0c2b8cd3286b254b4766a6f1 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 17 Dec 2025 18:06:31 -0300 Subject: [PATCH 1/5] Enhance Lusha component with new actions and properties - Added new actions: Get Company Recommendations, Get Contact Recommendations, Get Company Signals By IDs, Get Contact Signals By IDs, Search Company Signals, and Search Contact Signals. - Introduced new properties for signal retrieval, including startDate and various signal types. - Updated existing actions to improve functionality and added new methods for single company and contact searches. - Bumped package version to 0.3.0 and updated action versions accordingly. --- .../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 +- .../get-company-recomendations.mjs | 61 +++++++++ .../get-company-signals.mjs | 61 +++++++++ .../get-contact-recomendations.mjs | 61 +++++++++ .../get-contact-signals.mjs | 63 +++++++++ .../get-signal-options/get-signal-options.mjs | 40 ++++++ .../search-and-enrich-companies.mjs | 4 +- .../search-and-enrich-contacts.mjs | 4 +- .../search-company-signals.mjs | 69 ++++++++++ .../search-contact-signals.mjs | 61 +++++++++ .../single-company-search.mjs | 49 +++++++ .../single-contact-search.mjs | 124 ++++++++++++++++++ components/lusha/lusha.app.mjs | 77 +++++++++++ components/lusha/package.json | 2 +- 17 files changed, 675 insertions(+), 9 deletions(-) create mode 100644 components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs create mode 100644 components/lusha/actions/get-company-signals/get-company-signals.mjs create mode 100644 components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs create mode 100644 components/lusha/actions/get-contact-signals/get-contact-signals.mjs create mode 100644 components/lusha/actions/get-signal-options/get-signal-options.mjs create mode 100644 components/lusha/actions/search-company-signals/search-company-signals.mjs create mode 100644 components/lusha/actions/search-contact-signals/search-contact-signals.mjs create mode 100644 components/lusha/actions/single-company-search/single-company-search.mjs create mode 100644 components/lusha/actions/single-contact-search/single-contact-search.mjs diff --git a/components/lusha/actions/company-enrich/company-enrich.mjs b/components/lusha/actions/company-enrich/company-enrich.mjs index 9f3c4850708d1..fccd291216710 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.5", + version: "0.0.6", 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 e0c24d25a4f0b..61578115e3ada 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.4", + version: "0.0.5", 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 7c2828559e934..b053c13a4ef94 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.4", + version: "0.0.5", 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 0ab223a6dc16d..2c2e7ede306ae 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.4", + version: "0.0.5", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs b/components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs new file mode 100644 index 0000000000000..f67eef6bc3da3 --- /dev/null +++ b/components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs @@ -0,0 +1,61 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-get-company-recomendations", + name: "Get Company Recommendations", + description: "Get company recommendations based on other companies. Use requestId to get more results from a previous search. [See the documentation](https://docs.lusha.com/apis/openapi/company-recommendations/getcompanyrecommendations)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + requestId: { + type: "string", + label: "Request ID", + description: "Request ID for getting more results", + optional: true, + }, + companies: { + type: "string[]", + label: "Companies", + description: "List of company objects to retrieve recommendations for. Example: [{ \"companyId\": \"123321\" }]. [See the documentation](https://docs.lusha.com/apis/openapi/company-recommendations/getcompanyrecommendations) for more information.", + }, + exclude: { + type: "string[]", + label: "Exclude", + description: "List of company objects to exclude from the recommendations. Example: [{ \"companyId\": \"123321\" }]. [See the documentation](https://docs.lusha.com/apis/openapi/company-recommendations/getcompanyrecommendations) for more information.", + }, + limit: { + type: "integer", + label: "Limit", + description: "The maximum number of results to return.", + min: 5, + max: 25, + default: 25, + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.getCompanyRecommendations({ + $, + params: { + companies: parseObject(this.companies), + exclude: parseObject(this.exclude), + limit: this.limit, + requestId: this.requestId, + }, + }); + $.export("$summary", `Successfully retrieved company ${response.count} recommendations`); + + return response; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; diff --git a/components/lusha/actions/get-company-signals/get-company-signals.mjs b/components/lusha/actions/get-company-signals/get-company-signals.mjs new file mode 100644 index 0000000000000..d9c417c9eca9b --- /dev/null +++ b/components/lusha/actions/get-company-signals/get-company-signals.mjs @@ -0,0 +1,61 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-get-company-signals", + name: "Get Company Signals By IDs", + description: "Retrieve signals data for a list of company IDs. This endpoint allows you to get recent activities and signals for up to 100 companies per request. [See the documentation](https://docs.lusha.com/apis/openapi/signals/getcompanysignalsbyid)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + info: { + type: "alert", + alertType: "info", + content: "* Returns signals from the last 6 months by default\ + \n* Use `startDate` to customize the timeframe", + }, + companyIds: { + propDefinition: [ + lusha, + "companyIds", + ], + description: "List of company IDs to retrieve signals for", + }, + signals: { + propDefinition: [ + lusha, + "companySignals", + ], + }, + startDate: { + propDefinition: [ + lusha, + "startDate", + ], + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.getCompanySignalsById({ + $, + params: { + companyIds: parseObject(this.companyIds), + signals: this.signals, + startDate: this.startDate, + }, + }); + $.export("$summary", "Successfully retrieved company signals"); + + return response; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; diff --git a/components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs b/components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs new file mode 100644 index 0000000000000..38975ce35b880 --- /dev/null +++ b/components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs @@ -0,0 +1,61 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-get-contact-recomendations", + name: "Get Contact Recommendations", + description: "Fetch recommended contacts by supplying the contact's IDs, enabling Lusha to return similar profiles aligned by job title, seniority, and company context. Use requestId to get more results from a previous search. [See the documentation](https://docs.lusha.com/apis/openapi/contact-recommendations/getcontactrecommendations)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + requestId: { + type: "string", + label: "Request ID", + description: "Request ID for getting more results", + optional: true, + }, + contacts: { + type: "string[]", + label: "Contacts", + description: "List of contact objects to retrieve recommendations for. Example: [{ \"personId\": \"123321\", \"companyId\": \"456789\" }]. [See the documentation](https://docs.lusha.com/apis/openapi/contact-recommendations/getcontactrecommendations) for more information.", + }, + exclude: { + type: "string[]", + label: "Exclude", + description: "List of contact objects to exclude from the recommendations. Example: [{ \"personId\": \"123321\", \"companyId\": \"456789\" }]. [See the documentation](https://docs.lusha.com/apis/openapi/contact-recommendations/getcontactrecommendations) for more information.", + }, + limit: { + type: "integer", + label: "Limit", + description: "The maximum number of results to return.", + min: 5, + max: 25, + default: 25, + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.getContactRecommendations({ + $, + params: { + contacts: parseObject(this.contacts), + exclude: parseObject(this.exclude), + limit: this.limit, + requestId: this.requestId, + }, + }); + $.export("$summary", `Successfully retrieved contact ${response.count} recommendations`); + + return response; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; diff --git a/components/lusha/actions/get-contact-signals/get-contact-signals.mjs b/components/lusha/actions/get-contact-signals/get-contact-signals.mjs new file mode 100644 index 0000000000000..a56070a02db9e --- /dev/null +++ b/components/lusha/actions/get-contact-signals/get-contact-signals.mjs @@ -0,0 +1,63 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-get-contact-signals", + name: "Get Contact Signals By IDs", + description: "Retrieve signals data for a list of contact IDs. This endpoint allows you to get recent activities and signals for up to 100 contacts per request. [See the documentation](https://docs.lusha.com/apis/openapi/signals/getcontactsignalsbyid)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + info: { + type: "alert", + alertType: "info", + content: `* Returns signals from the last 6 months by default\ + \n* Use \`startDate\` to customize the timeframe\ + \n* Each signal type requested counts towards credit usage + `, + }, + contactIds: { + propDefinition: [ + lusha, + "contactIds", + ], + description: "List of contact IDs to retrieve signals for", + }, + signals: { + propDefinition: [ + lusha, + "signals", + ], + }, + startDate: { + propDefinition: [ + lusha, + "startDate", + ], + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.getContactSignalsById({ + $, + params: { + contactIds: parseObject(this.contactIds), + signals: this.signals, + startDate: this.startDate, + }, + }); + $.export("$summary", "Successfully retrieved contact signals"); + + return response; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; diff --git a/components/lusha/actions/get-signal-options/get-signal-options.mjs b/components/lusha/actions/get-signal-options/get-signal-options.mjs new file mode 100644 index 0000000000000..a9e7c77dce3ce --- /dev/null +++ b/components/lusha/actions/get-signal-options/get-signal-options.mjs @@ -0,0 +1,40 @@ +import { ConfigurationError } from "@pipedream/platform"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-get-signal-options", + name: "Get Signal Options", + description: "Retrieve available signal options for a specific entity type (contact or company). This endpoint returns the list of signal types you can filter by when enriching contacts or companies. [See the documentation](https://docs.lusha.com/apis/openapi/signal-filters/getsignaloptions)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + objectType: { + type: "string", + label: "Object Type", + description: "The type of object to get signal options for.", + options: [ + "contact", + "company", + ], + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.getSignalOptions({ + $, + objectType: this.objectType, + }); + $.export("$summary", `Successfully retrieved signal options for ${this.objectType}`); + + return response; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; 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 8eb8e440755c8..a3f1a9e37679f 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 @@ -1,11 +1,11 @@ -import lusha from "../../lusha.app.mjs"; import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; 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.3", + version: "0.0.4", 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 bea0c4c17ee82..9b2253eeef32f 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 @@ -1,11 +1,11 @@ -import lusha from "../../lusha.app.mjs"; import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; 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.3", + version: "0.0.4", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/lusha/actions/search-company-signals/search-company-signals.mjs b/components/lusha/actions/search-company-signals/search-company-signals.mjs new file mode 100644 index 0000000000000..4ff0477e204df --- /dev/null +++ b/components/lusha/actions/search-company-signals/search-company-signals.mjs @@ -0,0 +1,69 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-search-company-signals", + name: "Search Company Signals", + description: "Search for company signals using identifiers like domain name or company name. This endpoint combines search and signal enrichment in a single request. [See the documentation](https://docs.lusha.com/apis/openapi/signals/searchcompanysignals)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + info: { + type: "alert", + alertType: "info", + content: `Each company must have at least one identifier:\ + \n* Company ID\ + \n* Domain Name\ + \n* Company Domain + `, + }, + info2: { + type: "alert", + alertType: "info", + content: `* Use \`startDate\` to customize the timeframe\ + \n* Companies are matched based on provided identifiers + `, + }, + companies: { + type: "string[]", + label: "Companies", + description: "List of company objects to search for. Example: [{ \"id\": \"123321\", \"domain\": \"lusha.com\", \"name\": \"Lusha\" }]. [See the documentation](https://docs.lusha.com/apis/openapi/signals/searchcompanysignals) for more information.", + }, + signals: { + propDefinition: [ + lusha, + "companySignals", + ], + }, + startDate: { + propDefinition: [ + lusha, + "startDate", + ], + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.searchCompanySignals({ + $, + params: { + companies: parseObject(this.companies), + signals: this.signals, + startDate: this.startDate, + }, + }); + $.export("$summary", "Successfully searched for company signals"); + + return response; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; diff --git a/components/lusha/actions/search-contact-signals/search-contact-signals.mjs b/components/lusha/actions/search-contact-signals/search-contact-signals.mjs new file mode 100644 index 0000000000000..8f3d8551db5b2 --- /dev/null +++ b/components/lusha/actions/search-contact-signals/search-contact-signals.mjs @@ -0,0 +1,61 @@ +import { ConfigurationError } from "@pipedream/platform"; +import { parseObject } from "../../common/utils.mjs"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-search-contact-signals", + name: "Search Contact Signals", + description: "Search for contact signals using identifiers like LinkedIn URL, email, or name + company. This endpoint combines search and signal enrichment in a single request. [See the documentation](https://docs.lusha.com/apis/openapi/signals/searchcontactsignals)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + info: { + type: "alert", + alertType: "info", + content: `* Returns signals from the last 6 months by default\ + \n* Contacts are matched based on provided identifiers\ + \n* Returns both contact data and associated signals + `, + }, + contacts: { + type: "string[]", + label: "Contacts", + description: "List of contact objects to search for. Example: [{ \"id\": \"123321\", \"social_links\": [\"https://www.linkedin.com/in/ron-nabet\"], \"full_name\": \"Ron Nabet\", \"email\": \"dustin@lusha.com\", \"companies\": [\"name\": \"Lusha\", \"domain\": \"lusha.com\", \"is_current\": true] }]. [See the documentation](https://docs.lusha.com/apis/openapi/signals/searchcontactsignals) for more information.", + }, + signals: { + propDefinition: [ + lusha, + "signals", + ], + }, + startDate: { + propDefinition: [ + lusha, + "startDate", + ], + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.searchContactSignals({ + $, + params: { + contacts: parseObject(this.contacts), + signals: this.signals, + startDate: this.startDate, + }, + }); + $.export("$summary", "Successfully searched for contact signals"); + + return response; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; diff --git a/components/lusha/actions/single-company-search/single-company-search.mjs b/components/lusha/actions/single-company-search/single-company-search.mjs new file mode 100644 index 0000000000000..8abf9080fceb3 --- /dev/null +++ b/components/lusha/actions/single-company-search/single-company-search.mjs @@ -0,0 +1,49 @@ +import { ConfigurationError } from "@pipedream/platform"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-single-company-search", + name: "Search Single Company", + description: "Search for companies using various filters. [See the documentation](https://docs.lusha.com/apis/index2/company/companycontroller_searchsinglecompany)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + domain: { + type: "string", + label: "Company Domain", + description: "The domain name associated with the company", + optional: true, + }, + company: { + type: "string", + label: "Company Name", + description: "The name of the company", + optional: true, + }, + }, + async run({ $ }) { + if (!this.domain && !this.company) { + throw new ConfigurationError("You must provide either a **Domain** or **Company** name"); + } + const response = await this.lusha.searchSingleCompany({ + $, + params: { + domain: this.domain, + company: this.company, + }, + }); + + if (response.errors) { + throw new Error(response.errors.message); + } + $.export("$summary", `Successfully found a company with ID: ${response.data.id}`); + + return response; + }, +}; diff --git a/components/lusha/actions/single-contact-search/single-contact-search.mjs b/components/lusha/actions/single-contact-search/single-contact-search.mjs new file mode 100644 index 0000000000000..4745fd195c5aa --- /dev/null +++ b/components/lusha/actions/single-contact-search/single-contact-search.mjs @@ -0,0 +1,124 @@ +import { ConfigurationError } from "@pipedream/platform"; +import lusha from "../../lusha.app.mjs"; + +export default { + key: "lusha-single-contact-search", + name: "Search Single Contact", + description: "Search for a single contact using various filters. [See the documentation](https://docs.lusha.com/apis/index2/person/personcontroller_searchsinglecontact)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + lusha, + firstName: { + type: "string", + label: "First Name", + description: "First name of the person", + optional: true, + }, + lastName: { + type: "string", + label: "Last Name", + description: "Last name of the person", + optional: true, + }, + companyName: { + type: "string", + label: "Company Name", + description: "The name of the company the person works at", + optional: true, + }, + companyDomain: { + type: "string", + label: "Company Domain", + description: "The domain name of the company", + optional: true, + }, + email: { + type: "string", + label: "Email", + description: "The email address of the person", + optional: true, + }, + linkedinUrl: { + type: "string", + label: "LinkedIn URL", + description: "The LinkedIn URL of the person", + optional: true, + }, + refreshJobInfo: { + type: "boolean", + label: "Refresh Job Info", + description: "Set to true to refresh and update the job details for the person. This ensures that outdated job information is replaced with the most recent data", + optional: true, + }, + filterBy: { + type: "string", + label: "Filter By", + description: "Filters results based on specific contact details. By default, results will include contacts with at least one contact detail", + optional: true, + options: [ + { + label: "Only return contacts with phone numbers", + value: "phoneNumbers", + }, + { + label: "Only return contacts with email addresses", + value: "emailAddresses", + }, + ], + }, + revealEmails: { + type: "boolean", + label: "Reveal Emails", + description: "Whether to reveal email addresses in the response", + optional: true, + }, + revealPhones: { + type: "boolean", + label: "Reveal Phones", + description: "Whether to reveal phone numbers in the response", + optional: true, + }, + }, + async run({ $ }) { + try { + const response = await this.lusha.searchSingleContact({ + $, + params: { + firstName: this.firstName, + lastName: this.lastName, + companyName: this.companyName, + companyDomain: this.companyDomain, + email: this.email, + linkedinUrl: this.linkedinUrl, + refreshJobInfo: this.refreshJobInfo, + filterBy: this.filterBy, + revealEmails: this.revealEmails, + revealPhones: this.revealPhones, + }, + }); + let summary = ""; + if (response.contact?.error?.name) { + + if (response.contact.error.name !== "EMPTY_DATA") { + throw new Error(response.contact.error.message || response.contact.error.name); + } + summary = "No contact found"; + } + + if (response.contact.data?.personId) { + summary = `Successfully found a contact with ID: ${response.contact.data.personId}`; + } + $.export("$summary", summary); + + return response.contact.data; + } catch ({ response }) { + throw new ConfigurationError(response?.data?.message); + } + }, +}; diff --git a/components/lusha/lusha.app.mjs b/components/lusha/lusha.app.mjs index c13cc35859503..ca1b356e3b3b7 100644 --- a/components/lusha/lusha.app.mjs +++ b/components/lusha/lusha.app.mjs @@ -1,4 +1,8 @@ import { axios } from "@pipedream/platform"; +import { + COMPANY_SIGNALS_OPTIONS, + SIGNALS_OPTIONS, +} from "./common/constants.mjs"; export default { type: "app", @@ -184,6 +188,24 @@ export default { description: "The maximum number of results to return. **This feature is used to avoid timeouts due to very long returns.**", default: 50, }, + signals: { + type: "string[]", + label: "Signals", + description: "Types of signals to retrieve", + options: SIGNALS_OPTIONS, + }, + companySignals: { + type: "string[]", + label: "Company Signals", + description: "Types of company to retrieve", + options: COMPANY_SIGNALS_OPTIONS, + }, + startDate: { + type: "string", + label: "Start Date", + description: "Start date for signal retrieval **Format: YYYY-MM-DD**", + optional: true, + }, }, methods: { _baseUrl() { @@ -203,6 +225,12 @@ export default { ...opts, }); }, + searchSingleContact(opts = {}) { + return this._makeRequest({ + path: "/v2/person", + ...opts, + }); + }, searchContacts(opts = {}) { return this._makeRequest({ method: "POST", @@ -210,6 +238,12 @@ export default { ...opts, }); }, + searchSingleCompany(opts = {}) { + return this._makeRequest({ + path: "/v2/company", + ...opts, + }); + }, searchCompanies(opts = {}) { return this._makeRequest({ method: "POST", @@ -279,6 +313,49 @@ export default { ...opts, }); }, + getContactSignalsById(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/api/signals/contacts", + ...opts, + }); + }, + searchContactSignals(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/api/signals/contacts/search", + ...opts, + }); + }, + searchCompanySignals(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/api/signals/companies/search", + ...opts, + }); + }, + getContactRecommendations(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/api/recommendations/contacts", + ...opts, + }); + }, + getCompanyRecommendations(opts = {}) { + return this._makeRequest({ + method: "POST", + path: "/api/recommendations/companies", + ...opts, + }); + }, + getSignalOptions({ + objectType, ...opts + }) { + return this._makeRequest({ + path: `/api/signals/filters/${objectType}`, + ...opts, + }); + }, async *paginate({ fn, data = {}, maxResults = null, ...opts }) { diff --git a/components/lusha/package.json b/components/lusha/package.json index 288d89c6053cf..04eb7e4dcfe0a 100644 --- a/components/lusha/package.json +++ b/components/lusha/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/lusha", - "version": "0.2.1", + "version": "0.3.0", "description": "Pipedream Lusha Components", "main": "lusha.app.mjs", "keywords": [ From 1f6f23457473c62b90c9780fd45ca91da6a7456b Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 17 Dec 2025 19:18:27 -0300 Subject: [PATCH 2/5] Add constants for signal options in Lusha component - Introduced SIGNALS_OPTIONS and COMPANY_SIGNALS_OPTIONS constants to standardize signal types and enhance component functionality. - Each constant includes labels and values for various signal categories, improving clarity and usability for users interacting with the Lusha component. --- components/lusha/common/constants.mjs | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 components/lusha/common/constants.mjs diff --git a/components/lusha/common/constants.mjs b/components/lusha/common/constants.mjs new file mode 100644 index 0000000000000..950e88ff44b75 --- /dev/null +++ b/components/lusha/common/constants.mjs @@ -0,0 +1,33 @@ +export const SIGNALS_OPTIONS = [ + { + label: "All Signals", + value: "allSignals", + }, + { + label: "Promotion", + value: "promotion", + }, + { + label: "Company Changes", + value: "companyChange", + }, +]; + +export const COMPANY_SIGNALS_OPTIONS = [ + { + label: "All Signals", + value: "allSignals", + }, + { + label: "Headcount Growth", + value: "headcountGrowth", + }, + { + label: "New Jobs Open", + value: "newJobsOpen", + }, + { + label: "News Event", + value: "newsEvent", + }, +]; From e8fdeccb8df9204992aa4d06e7d98f38003fadb7 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 17 Dec 2025 19:20:34 -0300 Subject: [PATCH 3/5] Add new actions for company and contact recommendations in Lusha component - Introduced two new actions: Get Company Recommendations and Get Contact Recommendations. - Each action allows users to retrieve recommendations based on provided company or contact IDs, with options to exclude certain entries and limit results. - Enhanced error handling for API responses to improve user experience. - Updated documentation links for better guidance on usage. --- .../get-company-recommendations.mjs} | 4 ++-- .../get-contact-recommendations.mjs} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename components/lusha/actions/{get-company-recomendations/get-company-recomendations.mjs => get-company-recommendations/get-company-recommendations.mjs} (93%) rename components/lusha/actions/{get-contact-recomendations/get-contact-recomendations.mjs => get-contact-recommendations/get-contact-recommendations.mjs} (93%) diff --git a/components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs b/components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs similarity index 93% rename from components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs rename to components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs index f67eef6bc3da3..8c7a3ff3151d6 100644 --- a/components/lusha/actions/get-company-recomendations/get-company-recomendations.mjs +++ b/components/lusha/actions/get-company-recommendations/get-company-recommendations.mjs @@ -3,7 +3,7 @@ import { parseObject } from "../../common/utils.mjs"; import lusha from "../../lusha.app.mjs"; export default { - key: "lusha-get-company-recomendations", + key: "lusha-get-company-recommendations", name: "Get Company Recommendations", description: "Get company recommendations based on other companies. Use requestId to get more results from a previous search. [See the documentation](https://docs.lusha.com/apis/openapi/company-recommendations/getcompanyrecommendations)", version: "0.0.1", @@ -51,7 +51,7 @@ export default { requestId: this.requestId, }, }); - $.export("$summary", `Successfully retrieved company ${response.count} recommendations`); + $.export("$summary", `Successfully retrieved ${response.count} company recommendations`); return response; } catch ({ response }) { diff --git a/components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs b/components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs similarity index 93% rename from components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs rename to components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs index 38975ce35b880..d5e49cd5428e0 100644 --- a/components/lusha/actions/get-contact-recomendations/get-contact-recomendations.mjs +++ b/components/lusha/actions/get-contact-recommendations/get-contact-recommendations.mjs @@ -3,7 +3,7 @@ import { parseObject } from "../../common/utils.mjs"; import lusha from "../../lusha.app.mjs"; export default { - key: "lusha-get-contact-recomendations", + key: "lusha-get-contact-recommendations", name: "Get Contact Recommendations", description: "Fetch recommended contacts by supplying the contact's IDs, enabling Lusha to return similar profiles aligned by job title, seniority, and company context. Use requestId to get more results from a previous search. [See the documentation](https://docs.lusha.com/apis/openapi/contact-recommendations/getcontactrecommendations)", version: "0.0.1", @@ -51,7 +51,7 @@ export default { requestId: this.requestId, }, }); - $.export("$summary", `Successfully retrieved contact ${response.count} recommendations`); + $.export("$summary", `Successfully retrieved ${response.count} contact recommendations`); return response; } catch ({ response }) { From ca667626b059fbcb9960da8d34de577e8b7d4b93 Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Wed, 17 Dec 2025 19:22:08 -0300 Subject: [PATCH 4/5] Update description for company signals in Lusha component - Revised the description for the companySignals property to clarify that it pertains to types of company signals to retrieve, enhancing user understanding. --- components/lusha/lusha.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lusha/lusha.app.mjs b/components/lusha/lusha.app.mjs index ca1b356e3b3b7..4525edc284c2a 100644 --- a/components/lusha/lusha.app.mjs +++ b/components/lusha/lusha.app.mjs @@ -197,7 +197,7 @@ export default { companySignals: { type: "string[]", label: "Company Signals", - description: "Types of company to retrieve", + description: "Types of company signals to retrieve", options: COMPANY_SIGNALS_OPTIONS, }, startDate: { From 7fe2e9d38062c1de94b65cb74fdb635b14e6affd Mon Sep 17 00:00:00 2001 From: Luan Cazarine Date: Thu, 18 Dec 2025 16:32:20 -0300 Subject: [PATCH 5/5] Enhance Lusha component summaries with dynamic signal counts - Updated summary messages in get-company-signals, get-contact-signals, search-company-signals, and search-contact-signals actions to include the count of retrieved signals. - Introduced FILTER_BY_OPTIONS constant in single-contact-search for improved filtering options. --- .../get-company-signals/get-company-signals.mjs | 2 +- .../get-contact-signals/get-contact-signals.mjs | 2 +- .../search-company-signals.mjs | 2 +- .../search-contact-signals.mjs | 2 +- .../single-contact-search/single-contact-search.mjs | 12 ++---------- components/lusha/common/constants.mjs | 11 +++++++++++ 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/components/lusha/actions/get-company-signals/get-company-signals.mjs b/components/lusha/actions/get-company-signals/get-company-signals.mjs index d9c417c9eca9b..d76d1f8909614 100644 --- a/components/lusha/actions/get-company-signals/get-company-signals.mjs +++ b/components/lusha/actions/get-company-signals/get-company-signals.mjs @@ -51,7 +51,7 @@ export default { startDate: this.startDate, }, }); - $.export("$summary", "Successfully retrieved company signals"); + $.export("$summary", `Successfully retrieved ${Object.keys(response.companies).length} company signals`); return response; } catch ({ response }) { diff --git a/components/lusha/actions/get-contact-signals/get-contact-signals.mjs b/components/lusha/actions/get-contact-signals/get-contact-signals.mjs index a56070a02db9e..27ad6e559b180 100644 --- a/components/lusha/actions/get-contact-signals/get-contact-signals.mjs +++ b/components/lusha/actions/get-contact-signals/get-contact-signals.mjs @@ -53,7 +53,7 @@ export default { startDate: this.startDate, }, }); - $.export("$summary", "Successfully retrieved contact signals"); + $.export("$summary", `Successfully retrieved ${Object.keys(response.contacts).length} contact signals`); return response; } catch ({ response }) { diff --git a/components/lusha/actions/search-company-signals/search-company-signals.mjs b/components/lusha/actions/search-company-signals/search-company-signals.mjs index 4ff0477e204df..6def1a1749974 100644 --- a/components/lusha/actions/search-company-signals/search-company-signals.mjs +++ b/components/lusha/actions/search-company-signals/search-company-signals.mjs @@ -59,7 +59,7 @@ export default { startDate: this.startDate, }, }); - $.export("$summary", "Successfully searched for company signals"); + $.export("$summary", `Successfully searched for ${Object.keys(response.companies).length} company signals`); return response; } catch ({ response }) { diff --git a/components/lusha/actions/search-contact-signals/search-contact-signals.mjs b/components/lusha/actions/search-contact-signals/search-contact-signals.mjs index 8f3d8551db5b2..523815f6e3fbf 100644 --- a/components/lusha/actions/search-contact-signals/search-contact-signals.mjs +++ b/components/lusha/actions/search-contact-signals/search-contact-signals.mjs @@ -51,7 +51,7 @@ export default { startDate: this.startDate, }, }); - $.export("$summary", "Successfully searched for contact signals"); + $.export("$summary", `Successfully searched for ${Object.keys(response.contacts).length} contact signals`); return response; } catch ({ response }) { diff --git a/components/lusha/actions/single-contact-search/single-contact-search.mjs b/components/lusha/actions/single-contact-search/single-contact-search.mjs index 4745fd195c5aa..dd15a74ee1abd 100644 --- a/components/lusha/actions/single-contact-search/single-contact-search.mjs +++ b/components/lusha/actions/single-contact-search/single-contact-search.mjs @@ -1,4 +1,5 @@ import { ConfigurationError } from "@pipedream/platform"; +import { FILTER_BY_OPTIONS } from "../../common/constants.mjs"; import lusha from "../../lusha.app.mjs"; export default { @@ -61,16 +62,7 @@ export default { label: "Filter By", description: "Filters results based on specific contact details. By default, results will include contacts with at least one contact detail", optional: true, - options: [ - { - label: "Only return contacts with phone numbers", - value: "phoneNumbers", - }, - { - label: "Only return contacts with email addresses", - value: "emailAddresses", - }, - ], + options: FILTER_BY_OPTIONS, }, revealEmails: { type: "boolean", diff --git a/components/lusha/common/constants.mjs b/components/lusha/common/constants.mjs index 950e88ff44b75..9b8269c9dd157 100644 --- a/components/lusha/common/constants.mjs +++ b/components/lusha/common/constants.mjs @@ -31,3 +31,14 @@ export const COMPANY_SIGNALS_OPTIONS = [ value: "newsEvent", }, ]; + +export const FILTER_BY_OPTIONS = [ + { + label: "Only return contacts with phone numbers", + value: "phoneNumbers", + }, + { + label: "Only return contacts with email addresses", + value: "emailAddresses", + }, +];