Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/lusha/actions/company-enrich/company-enrich.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
33 changes: 25 additions & 8 deletions components/lusha/actions/company-search/company-search.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -67,13 +67,30 @@ export default {
try {
const include = {};

if (this.names) include.names = parseObject(this.names);
if (this.domains) include.domains = parseObject(this.domains);
if (this.locations) include.locations = parseObject(this.locations);
if (this.sizes) include.sizes = parseObject(this.sizes);
if (this.revenues) include.revenues = parseObject(this.revenues);
if (this.sicCodes) include.sicCodes = parseObject(this.sicCodes);
if (this.naicsCodes) include.naicsCodes = parseObject(this.naicsCodes);
if (this.names) {
include.names = parseObject(this.names);
}
if (this.domains) {
include.domains = parseObject(this.domains);
}
if (this.locations) {
include.locations = parseObject(this.locations)
.map((country) => ({
country,
}));
}
if (this.sizes) {
include.sizes = parseObject(this.sizes);
}
if (this.revenues) {
include.revenues = parseObject(this.revenues);
}
if (this.sicCodes) {
include.sicCodes = parseObject(this.sicCodes);
}
if (this.naicsCodes) {
include.naicsCodes = parseObject(this.naicsCodes);
}

const response = this.lusha.paginate({
$,
Expand Down
2 changes: 1 addition & 1 deletion components/lusha/actions/contact-enrich/contact-enrich.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions components/lusha/actions/contact-search/contact-search.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -82,7 +82,7 @@ export default {
if (this.seniority) include.seniority = parseObject(this.seniority);
if (this.departments) include.departments = parseObject(this.departments);
if (this.existingDataPoints) include.existingDataPoints = parseObject(this.existingDataPoints);
if (this.location) include.location = parseObject(this.location);
if (this.location) include.locations = parseObject(this.location);

const response = this.lusha.paginate({
$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -82,7 +82,7 @@ export default {
if (this.seniority) include.seniority = parseObject(this.seniority);
if (this.departments) include.departments = parseObject(this.departments);
if (this.existingDataPoints) include.existingDataPoints = parseObject(this.existingDataPoints);
if (this.location) include.location = parseObject(this.location);
if (this.location) include.locations = parseObject(this.location);

const contacts = [];
let hasMore, count = 0, page = 0;
Expand Down
34 changes: 27 additions & 7 deletions components/lusha/lusha.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,26 @@ export default {
location: {
type: "string[]",
label: "Contact Locations",
description: "Location filters for contacts to search (JSON strings)",
description: `Location filters for contacts to search. Each entry should be a JSON object with the following optional fields:

**Available Fields:**
- \`continent\` - The continent name (e.g., "North America")
- \`country\` - The country name (e.g., "United States")
- \`country_grouping\` - Country grouping code (e.g., "na" for North America)
- \`state\` - The state or region name (e.g., "New York")
- \`city\` - The city name (e.g., "New York")

**Example JSON:**
\`\`\`json
[
{
"continent": "North America",
"country": "United States",
"state": "New York",
"city": "New York"
}
]
\`\`\``,
optional: true,
},
requestId: {
Expand Down Expand Up @@ -261,30 +280,31 @@ 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) {
return count;
}
}

hasMore = data.length;
hasMore = results.length;

} while (hasMore);
},
Expand Down
2 changes: 1 addition & 1 deletion components/lusha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/lusha",
"version": "0.2.0",
"version": "0.2.1",
"description": "Pipedream Lusha Components",
"main": "lusha.app.mjs",
"keywords": [
Expand Down
Loading