Skip to content

Commit 5ac9a44

Browse files
committed
lusha init
1 parent 1006518 commit 5ac9a44

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+9259
-7
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import lusha from "../../lusha.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "lusha-company-enrich",
6+
name: "Enrich Companies",
7+
description: "Enriches company information based on provided company IDs. [See the documentation]()",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
lusha,
12+
enrichCompanyRequestId: {
13+
propDefinition: [
14+
lusha,
15+
"enrichCompanyRequestId",
16+
],
17+
},
18+
enrichCompanyIds: {
19+
propDefinition: [
20+
lusha,
21+
"enrichCompanyIds",
22+
],
23+
},
24+
},
25+
async run({ $ }) {
26+
const response = await this.lusha.enrichCompanies({
27+
enrichCompanyRequestId: this.enrichCompanyRequestId,
28+
enrichCompanyIds: this.enrichCompanyIds,
29+
});
30+
$.export("$summary", `Successfully enriched ${this.enrichCompanyIds.length} companies`);
31+
return response;
32+
},
33+
};
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import lusha from "../../lusha.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "lusha-company-search",
6+
name: "Search Companies",
7+
description: "Search for companies using various filters. [See the documentation](https://www.lusha.com/docs/)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
lusha,
12+
searchCompanyNames: {
13+
propDefinition: [
14+
lusha,
15+
"searchCompanyNames",
16+
],
17+
},
18+
searchCompanyDomains: {
19+
propDefinition: [
20+
lusha,
21+
"searchCompanyDomains",
22+
],
23+
},
24+
searchCompanyLocations: {
25+
propDefinition: [
26+
lusha,
27+
"searchCompanyLocations",
28+
],
29+
},
30+
searchCompanySizes: {
31+
propDefinition: [
32+
lusha,
33+
"searchCompanySizes",
34+
],
35+
},
36+
searchCompanyRevenues: {
37+
propDefinition: [
38+
lusha,
39+
"searchCompanyRevenues",
40+
],
41+
},
42+
searchCompanySicCodes: {
43+
propDefinition: [
44+
lusha,
45+
"searchCompanySicCodes",
46+
],
47+
},
48+
searchCompanyNaicsCodes: {
49+
propDefinition: [
50+
lusha,
51+
"searchCompanyNaicsCodes",
52+
],
53+
},
54+
},
55+
async run({ $ }) {
56+
try {
57+
const response = await this.lusha.searchCompanies({
58+
searchCompanyNames: this.searchCompanyNames,
59+
searchCompanyDomains: this.searchCompanyDomains,
60+
searchCompanyLocations: this.searchCompanyLocations,
61+
searchCompanySizes: this.searchCompanySizes,
62+
searchCompanyRevenues: this.searchCompanyRevenues,
63+
searchCompanySicCodes: this.searchCompanySicCodes,
64+
searchCompanyNaicsCodes: this.searchCompanyNaicsCodes,
65+
});
66+
67+
const totalResults = response.totalResults;
68+
$.export("$summary", `Successfully retrieved ${totalResults} companies`);
69+
return response;
70+
} catch (error) {
71+
$.export("$summary", "Failed to search companies");
72+
throw error;
73+
}
74+
},
75+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import lusha from "../../lusha.app.mjs";
2+
3+
export default {
4+
key: "lusha-contact-enrich",
5+
name: "Enrich Contacts",
6+
description: "Enriches contacts based on provided IDs. [See the documentation](https://www.lusha.com/docs/)",
7+
version: "0.0.{{ts}}",
8+
type: "action",
9+
props: {
10+
lusha: {
11+
type: "app",
12+
app: "lusha",
13+
},
14+
enrichContactRequestId: {
15+
propDefinition: [
16+
"lusha",
17+
"enrichContactRequestId",
18+
],
19+
},
20+
enrichContactIds: {
21+
propDefinition: [
22+
"lusha",
23+
"enrichContactIds",
24+
],
25+
},
26+
},
27+
async run({ $ }) {
28+
const response = await this.lusha.enrichContacts({
29+
enrichContactRequestId: this.enrichContactRequestId,
30+
enrichContactIds: this.enrichContactIds,
31+
});
32+
$.export("$summary", `Successfully enriched ${this.enrichContactIds.length} contacts`);
33+
return response;
34+
},
35+
};
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import lusha from "../../lusha.app.mjs";
2+
import { axios } from "@pipedream/platform";
3+
4+
export default {
5+
key: "lusha-contact-search",
6+
name: "Search Contacts",
7+
description: "Search for contacts using various filters. [See the documentation](https://www.lusha.com/docs/)",
8+
version: "0.0.{{ts}}",
9+
type: "action",
10+
props: {
11+
lusha,
12+
searchContactNames: {
13+
propDefinition: [
14+
lusha,
15+
"searchContactNames",
16+
],
17+
},
18+
searchContactJobTitles: {
19+
propDefinition: [
20+
lusha,
21+
"searchContactJobTitles",
22+
],
23+
},
24+
searchContactJobTitlesExactMatch: {
25+
propDefinition: [
26+
lusha,
27+
"searchContactJobTitlesExactMatch",
28+
],
29+
},
30+
searchContactCountries: {
31+
propDefinition: [
32+
lusha,
33+
"searchContactCountries",
34+
],
35+
},
36+
searchContactSeniority: {
37+
propDefinition: [
38+
lusha,
39+
"searchContactSeniority",
40+
],
41+
},
42+
searchContactDepartments: {
43+
propDefinition: [
44+
lusha,
45+
"searchContactDepartments",
46+
],
47+
},
48+
searchContactExistingDataPoints: {
49+
propDefinition: [
50+
lusha,
51+
"searchContactExistingDataPoints",
52+
],
53+
},
54+
searchContactLocation: {
55+
propDefinition: [
56+
lusha,
57+
"searchContactLocation",
58+
],
59+
},
60+
},
61+
async run({ $ }) {
62+
const args = {};
63+
64+
if (this.searchContactNames && this.searchContactNames.length > 0) {
65+
args.searchContactNames = this.searchContactNames;
66+
}
67+
68+
if (this.searchContactJobTitles && this.searchContactJobTitles.length > 0) {
69+
args.searchContactJobTitles = this.searchContactJobTitles;
70+
}
71+
72+
if (
73+
this.searchContactJobTitlesExactMatch &&
74+
this.searchContactJobTitlesExactMatch.length > 0
75+
) {
76+
args.searchContactJobTitlesExactMatch = this.searchContactJobTitlesExactMatch;
77+
}
78+
79+
if (this.searchContactCountries && this.searchContactCountries.length > 0) {
80+
args.searchContactCountries = this.searchContactCountries;
81+
}
82+
83+
if (this.searchContactSeniority && this.searchContactSeniority.length > 0) {
84+
args.searchContactSeniority = this.searchContactSeniority;
85+
}
86+
87+
if (this.searchContactDepartments && this.searchContactDepartments.length > 0) {
88+
args.searchContactDepartments = this.searchContactDepartments;
89+
}
90+
91+
if (
92+
this.searchContactExistingDataPoints &&
93+
this.searchContactExistingDataPoints.length > 0
94+
) {
95+
args.searchContactExistingDataPoints = this.searchContactExistingDataPoints;
96+
}
97+
98+
if (this.searchContactLocation && this.searchContactLocation.length > 0) {
99+
args.searchContactLocation = this.searchContactLocation;
100+
}
101+
102+
const response = await this.lusha.searchContacts(args);
103+
104+
$.export("$summary", `Found ${response.totalResults} contacts`);
105+
return response;
106+
},
107+
};

0 commit comments

Comments
 (0)