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+
};
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+
};

0 commit comments

Comments
 (0)