Skip to content

Commit 33d26f3

Browse files
committed
wip
1 parent 0c007db commit 33d26f3

File tree

8 files changed

+289
-40
lines changed

8 files changed

+289
-40
lines changed

components/lusha/actions/company-enrich/company-enrich.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import lusha from "../../lusha.app.mjs";
33
export default {
44
key: "lusha-company-enrich",
55
name: "Enrich Companies",
6-
description: "Enriches company information based on provided company IDs. [See the documentation](https://www.lusha.com/docs/#company-enrich)",
7-
version: "0.0.2",
6+
description: "Enriches company information based on provided company IDs. [See the documentation](https://docs.lusha.com/apis/openapi/company-search-and-enrich/enrichprospectingcompanies)",
7+
//version: "0.0.3",
8+
version: "0.0.{{ts}}",
89
type: "action",
910
props: {
1011
lusha,
@@ -14,7 +15,7 @@ export default {
1415
"requestId",
1516
],
1617
label: "Company Request ID",
17-
description: "The request ID generated from the company search response.",
18+
description: "The request ID generated from the company search response",
1819
},
1920
companiesIds: {
2021
propDefinition: [

components/lusha/actions/company-search/company-search.mjs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import lusha from "../../lusha.app.mjs";
44
export default {
55
key: "lusha-company-search",
66
name: "Search Companies",
7-
description: "Search for companies using various filters. [See the documentation](https://www.lusha.com/docs/#contactcompany-search)",
8-
version: "0.0.1",
7+
description: "Search for companies using various filters. [See the documentation](https://docs.lusha.com/apis/openapi/company-search-and-enrich/searchprospectingcompanies)",
8+
//version: "0.0.2",
9+
version: "0.0.{{ts}}",
910
type: "action",
1011
props: {
1112
lusha,
@@ -14,49 +15,42 @@ export default {
1415
lusha,
1516
"companyNames",
1617
],
17-
optional: true,
1818
},
1919
domains: {
2020
propDefinition: [
2121
lusha,
2222
"domains",
2323
],
24-
optional: true,
2524
},
2625
locations: {
2726
propDefinition: [
2827
lusha,
2928
"locations",
3029
],
31-
optional: true,
3230
},
3331
sizes: {
3432
propDefinition: [
3533
lusha,
3634
"sizes",
3735
],
38-
optional: true,
3936
},
4037
revenues: {
4138
propDefinition: [
4239
lusha,
4340
"revenues",
4441
],
45-
optional: true,
4642
},
4743
sicCodes: {
4844
propDefinition: [
4945
lusha,
5046
"sicCodes",
5147
],
52-
optional: true,
5348
},
5449
naicsCodes: {
5550
propDefinition: [
5651
lusha,
5752
"naicsCodes",
5853
],
59-
optional: true,
6054
},
6155
limit: {
6256
type: "string",

components/lusha/actions/contact-enrich/contact-enrich.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import lusha from "../../lusha.app.mjs";
33
export default {
44
key: "lusha-contact-enrich",
55
name: "Enrich Contacts",
6-
description: "Enriches contacts based on provided IDs. [See the documentation](https://www.lusha.com/docs/#contact-enrich)",
6+
description: "Enriches contacts based on provided IDs. [See the documentation](https://docs.lusha.com/apis/openapi/contact-search-and-enrich/enrichprospectingcontacts)",
77
version: "0.0.1",
88
type: "action",
99
props: {
@@ -14,7 +14,7 @@ export default {
1414
"requestId",
1515
],
1616
label: "Contact Request ID",
17-
description: "The request ID generated from the contact search response.",
17+
description: "The request ID generated from the contact search response",
1818
},
1919
contactIds: {
2020
propDefinition: [

components/lusha/actions/contact-search/contact-search.mjs

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import lusha from "../../lusha.app.mjs";
44
export default {
55
key: "lusha-contact-search",
66
name: "Search Contacts",
7-
description: "Search for contacts using various filters. [See the documentation](https://www.lusha.com/docs/#contactcompany-search)",
8-
version: "0.0.1",
7+
description: "Search for contacts using various filters. [See the documentation](https://docs.lusha.com/apis/openapi/contact-search-and-enrich/searchprospectingcontacts)",
8+
//version: "0.0.2",
9+
version: "0.0.{{ts}}",
910
type: "action",
1011
props: {
1112
lusha,
@@ -15,7 +16,7 @@ export default {
1516
"contactNames",
1617
],
1718
label: "Contact Names",
18-
description: "Names of contacts to search.",
19+
description: "Names of contacts to search",
1920
},
2021
jobTitles: {
2122
propDefinition: [
@@ -61,7 +62,7 @@ export default {
6162
},
6263
},
6364
async run({ $ }) {
64-
const include = {};
65+
/* const include = {};
6566
6667
if (this.names) include.names = parseObject(this.names);
6768
if (this.jobTitles) include.jobTitles = parseObject(this.jobTitles);
@@ -90,9 +91,29 @@ export default {
9091
9192
for await (const item of response) {
9293
responseArray.push(item);
93-
}
94+
} */
9495

95-
$.export("$summary", `Found ${responseArray.length} contacts`);
96+
const response = await this.lusha.searchContacts({
97+
$,
98+
data: {
99+
filters: {
100+
contacts: {
101+
include: {
102+
names: parseObject(this.names),
103+
jobTitles: parseObject(this.jobTitles),
104+
jobTitlesExactMatch: parseObject(this.jobTitlesExactMatch),
105+
countries: parseObject(this.countries),
106+
seniority: parseObject(this.seniority),
107+
departments: parseObject(this.departments),
108+
existingDataPoints: parseObject(this.existingDataPoints),
109+
location: parseObject(this.location),
110+
},
111+
},
112+
},
113+
},
114+
});
115+
116+
// $.export("$summary", `Found ${responseArray.length} contacts`);
96117
return response;
97118
},
98119
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import lusha from "../../lusha.app.mjs";
2+
3+
export default {
4+
key: "lusha-search-and-enrich-companies",
5+
name: "Search and Enrich Companies",
6+
description: "Search for companies and enrich them. [See the documentation](https://docs.lusha.com/apis/openapi/company-search-and-enrich)",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
lusha,
11+
names: {
12+
propDefinition: [
13+
lusha,
14+
"companyNames",
15+
],
16+
},
17+
domains: {
18+
propDefinition: [
19+
lusha,
20+
"domains",
21+
],
22+
},
23+
locations: {
24+
propDefinition: [
25+
lusha,
26+
"locations",
27+
],
28+
},
29+
sizes: {
30+
propDefinition: [
31+
lusha,
32+
"sizes",
33+
],
34+
},
35+
revenues: {
36+
propDefinition: [
37+
lusha,
38+
"revenues",
39+
],
40+
},
41+
sicCodes: {
42+
propDefinition: [
43+
lusha,
44+
"sicCodes",
45+
],
46+
},
47+
naicsCodes: {
48+
propDefinition: [
49+
lusha,
50+
"naicsCodes",
51+
],
52+
},
53+
limit: {
54+
type: "string",
55+
label: "Limit",
56+
description: "The maximum number of results to return. **This feature is used to avoid timeouts due to very long returns.**",
57+
},
58+
},
59+
async run() {
60+
},
61+
};
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import lusha from "../../lusha.app.mjs";
2+
3+
export default {
4+
key: "lusha-search-and-enrich-contacts",
5+
name: "Search and Enrich Contacts",
6+
description: "Search for contacts and enrich them. [See the documentation](https://docs.lusha.com/apis/openapi/contact-search-and-enrich)",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
lusha,
11+
names: {
12+
propDefinition: [
13+
lusha,
14+
"contactNames",
15+
],
16+
label: "Contact Names",
17+
description: "Names of contacts to search",
18+
},
19+
jobTitles: {
20+
propDefinition: [
21+
lusha,
22+
"jobTitles",
23+
],
24+
},
25+
jobTitlesExactMatch: {
26+
propDefinition: [
27+
lusha,
28+
"jobTitlesExactMatch",
29+
],
30+
},
31+
countries: {
32+
propDefinition: [
33+
lusha,
34+
"countries",
35+
],
36+
},
37+
seniority: {
38+
propDefinition: [
39+
lusha,
40+
"seniority",
41+
],
42+
},
43+
departments: {
44+
propDefinition: [
45+
lusha,
46+
"departments",
47+
],
48+
},
49+
existingDataPoints: {
50+
propDefinition: [
51+
lusha,
52+
"existingDataPoints",
53+
],
54+
},
55+
location: {
56+
propDefinition: [
57+
lusha,
58+
"location",
59+
],
60+
},
61+
},
62+
async run() {
63+
64+
},
65+
};

0 commit comments

Comments
 (0)