Skip to content

Commit 521c513

Browse files
authored
New Components - nextlead (#16752)
* new components * pnpm-lock.yaml * updates * pnpm-lock.yaml
1 parent 16d9788 commit 521c513

File tree

20 files changed

+246
-21
lines changed

20 files changed

+246
-21
lines changed

components/all_voice_lab/all_voice_lab.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/google_cloud_document_ai/google_cloud_document_ai.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/heylibby/heylibby.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/heyreach/heyreach.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/neetocal/neetocal.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/neetodesk/neetodesk.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import nextlead from "../../nextlead.app.mjs";
2+
3+
export default {
4+
key: "nextlead-search-leads",
5+
name: "Search Leads",
6+
description: "Search for leads by email in NextLead. [See the documentation](https://dashboard.nextlead.app/en/api-documentation#find)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
nextlead,
11+
email: {
12+
type: "string",
13+
label: "Email",
14+
description: "The email address to search for",
15+
},
16+
},
17+
async run({ $ }) {
18+
const response = await this.nextlead.searchLeads({
19+
$,
20+
data: {
21+
email: this.email,
22+
},
23+
});
24+
$.export("$summary", `Found ${response.length && response[0].found
25+
? response.length
26+
: 0} lead(s) for email: ${this.email}`);
27+
return response;
28+
},
29+
};

components/nextlead/nextlead.app.mjs

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "nextlead",
46
propDefinitions: {},
57
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
8+
_baseUrl() {
9+
return this.$auth.api_url;
10+
},
11+
_makeRequest({
12+
$ = this, path, ...opts
13+
}) {
14+
return axios($, {
15+
url: `${this._baseUrl()}${path}`,
16+
headers: {
17+
Authorization: `Bearer ${this.$auth.api_key}`,
18+
},
19+
...opts,
20+
});
21+
},
22+
searchLeads(opts = {}) {
23+
return this._makeRequest({
24+
path: "/receive/contact/find-contact",
25+
method: "POST",
26+
...opts,
27+
});
28+
},
29+
getNewlyCreatedLeads(opts = {}) {
30+
return this._makeRequest({
31+
path: "/polling/contact/user-created",
32+
...opts,
33+
});
34+
},
35+
getNewlyUpdatedLeads(opts = {}) {
36+
return this._makeRequest({
37+
path: "/polling/contact/user-edited",
38+
...opts,
39+
});
40+
},
41+
getContactsAddedToList(opts = {}) {
42+
return this._makeRequest({
43+
path: "/polling/email/added-to-list",
44+
...opts,
45+
});
946
},
1047
},
1148
};

components/nextlead/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/nextlead",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Nextlead Components",
55
"main": "nextlead.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
15-
}
18+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import nextlead from "../../nextlead.app.mjs";
2+
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
3+
4+
export default {
5+
props: {
6+
nextlead,
7+
timer: {
8+
type: "$.interface.timer",
9+
default: {
10+
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
11+
},
12+
},
13+
},
14+
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import common from "../common/base.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "nextlead-new-lead-added-to-list",
7+
name: "New Lead Added to List",
8+
description: "Emit new event when a lead is added to a list in NextLead. [See the documentation](https://dashboard.nextlead.app/en/api-documentation#addedToList)",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
methods: {
13+
generateMeta(lead) {
14+
return {
15+
id: lead.id,
16+
summary: "Lead Added to List",
17+
ts: Date.parse(lead.result.created_at),
18+
};
19+
},
20+
},
21+
async run() {
22+
const leads = await this.nextlead.getContactsAddedToList();
23+
for (const lead of leads) {
24+
const meta = this.generateMeta(lead);
25+
this.$emit(lead, meta);
26+
}
27+
},
28+
sampleEmit,
29+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default {
2+
"id": "cmay8b4jx0001ky04yb204e5b",
3+
"result": {
4+
"created_at": "2025-05-21T17:40:39.501Z",
5+
"organization_id": "cmay3tgaa0002jr04l5tga7my",
6+
"email": null,
7+
"first_name": "Jane",
8+
"last_name": "Doe",
9+
"phone": null,
10+
"address": null,
11+
"civility": "NEUTRAL",
12+
"status": null,
13+
"opt_in_marketing": true,
14+
"opt_in_newsletter": true
15+
}
16+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import common from "../common/base.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "nextlead-new-lead-created",
7+
name: "New Lead Created",
8+
description: "Emit new event when a new lead is captured in NextLead. [See the documentation](https://dashboard.nextlead.app/en/api-documentation#created)",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
methods: {
13+
generateMeta(lead) {
14+
return {
15+
id: lead.id,
16+
summary: "New Lead Created",
17+
ts: Date.now(),
18+
};
19+
},
20+
},
21+
async run() {
22+
const leads = await this.nextlead.getNewlyCreatedLeads();
23+
for (const lead of leads) {
24+
const meta = this.generateMeta(lead);
25+
this.$emit(lead, meta);
26+
}
27+
},
28+
sampleEmit,
29+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export default {
2+
"id": "cmay7x5ou0001k10442mgpngp",
3+
"type": "CLIENT",
4+
"civility": "NEUTRAL",
5+
"first_name": null,
6+
"last_name": null,
7+
"birth_date": null,
8+
"sector": null,
9+
"activity": null,
10+
"status": null,
11+
"conversion_status": null,
12+
"lead_score": null,
13+
"phone": null,
14+
"mobile": null,
15+
"phone_pro": null,
16+
"email": null,
17+
"email2": null,
18+
"email_verified": null
19+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import common from "../common/base.mjs";
2+
import sampleEmit from "./test-event.mjs";
3+
4+
export default {
5+
...common,
6+
key: "nextlead-new-lead-updated",
7+
name: "New Lead Updated",
8+
description: "Emit new event when a lead is updated in NextLead. [See the documentation](https://dashboard.nextlead.app/en/api-documentation#edited)",
9+
version: "0.0.1",
10+
type: "source",
11+
dedupe: "unique",
12+
methods: {
13+
generateMeta(lead) {
14+
return {
15+
id: lead.id,
16+
summary: "Lead Updated",
17+
ts: Date.now(),
18+
};
19+
},
20+
},
21+
async run() {
22+
const leads = await this.nextlead.getNewlyUpdatedLeads();
23+
for (const lead of leads) {
24+
const meta = this.generateMeta(lead);
25+
this.$emit(lead, meta);
26+
}
27+
},
28+
sampleEmit,
29+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export default {
2+
"id": "cmay7zwqw000fib046wynimr1",
3+
"type": "CLIENT",
4+
"civility": "NEUTRAL",
5+
"first_name": "Jane",
6+
"last_name": "Doe",
7+
"birth_date": null,
8+
"sector": null,
9+
"activity": null,
10+
"status": null,
11+
"conversion_status": null,
12+
"lead_score": null,
13+
"phone": null,
14+
"mobile": null,
15+
"phone_pro": null,
16+
"email": null,
17+
"email2": null,
18+
"email_verified": null
19+
}

components/scrapecreators/scrapecreators.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/test_apps_for_checking_something_009/test_apps_for_checking_something_009.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/test_apps_for_checking_something_010/test_apps_for_checking_something_010.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

pnpm-lock.yaml

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)