Skip to content

Commit aacc382

Browse files
authored
[ACTION] Pipedrive - Get All Leads (#19220)
1 parent a77314f commit aacc382

File tree

25 files changed

+143
-23
lines changed

25 files changed

+143
-23
lines changed

components/pipedrive/actions/add-activity/add-activity.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "pipedrive-add-activity",
88
name: "Add Activity",
99
description: "Adds a new activity. Includes `more_activities_scheduled_in_context` property in response's `additional_data` which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). See the Pipedrive API docs for Activities [here](https://developers.pipedrive.com/docs/api/v1/#!/Activities). For info on [adding an activity in Pipedrive](https://developers.pipedrive.com/docs/api/v1/Activities#addActivity)",
10-
version: "0.1.18",
10+
version: "0.1.19",
1111
annotations: {
1212
destructiveHint: false,
1313
openWorldHint: true,

components/pipedrive/actions/add-deal/add-deal.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "pipedrive-add-deal",
77
name: "Add Deal",
88
description: "Adds a new deal. See the Pipedrive API docs for Deals [here](https://developers.pipedrive.com/docs/api/v1/Deals#addDeal)",
9-
version: "0.1.19",
9+
version: "0.1.20",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,

components/pipedrive/actions/add-lead/add-lead.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "pipedrive-add-lead",
77
name: "Add Lead",
88
description: "Create a new lead in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#addLead)",
9-
version: "0.0.12",
9+
version: "0.0.13",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,

components/pipedrive/actions/add-note/add-note.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "pipedrive-add-note",
66
name: "Add Note",
77
description: "Adds a new note. For info on [adding an note in Pipedrive](https://developers.pipedrive.com/docs/api/v1/Notes#addNote)",
8-
version: "0.0.15",
8+
version: "0.0.16",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/pipedrive/actions/add-organization/add-organization.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "pipedrive-add-organization",
66
name: "Add Organization",
77
description: "Adds a new organization. See the Pipedrive API docs for Organizations [here](https://developers.pipedrive.com/docs/api/v1/Organizations#addOrganization)",
8-
version: "0.1.17",
8+
version: "0.1.18",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/pipedrive/actions/add-person/add-person.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "pipedrive-add-person",
77
name: "Add Person",
88
description: "Adds a new person. See the Pipedrive API docs for People [here](https://developers.pipedrive.com/docs/api/v1/Persons#addPerson)",
9-
version: "0.1.18",
9+
version: "0.1.19",
1010
annotations: {
1111
destructiveHint: false,
1212
openWorldHint: true,
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import app from "../../pipedrive.app.mjs";
2+
3+
export default {
4+
key: "pipedrive-get-all-leads",
5+
name: "Get All Leads",
6+
description: "Get all leads from Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#getLeads)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
app,
16+
maxResults: {
17+
type: "integer",
18+
label: "Max Results",
19+
description: "The maximum number of results to return. If not provided, all leads will be returned.",
20+
optional: true,
21+
},
22+
ownerId: {
23+
label: "Owner ID",
24+
description: "If supplied, only leads matching the given user will be returned. However, **Filter ID** takes precedence over **Owner ID** when supplied.",
25+
propDefinition: [
26+
app,
27+
"userId",
28+
],
29+
},
30+
personId: {
31+
propDefinition: [
32+
app,
33+
"personId",
34+
],
35+
description: "If supplied, only leads matching the given person will be returned. However, **Filter ID** takes precedence over **Person ID** when supplied.",
36+
optional: true,
37+
},
38+
organizationId: {
39+
propDefinition: [
40+
app,
41+
"organizationId",
42+
],
43+
description: "If supplied, only leads matching the given organization will be returned. However, **Filter ID** takes precedence over **Organization ID** when supplied.",
44+
optional: true,
45+
},
46+
filterId: {
47+
propDefinition: [
48+
app,
49+
"filterId",
50+
],
51+
description: "The ID of the filter to use. Takes precedence over **Owner ID**, **Person ID**, and **Organization ID** when supplied.",
52+
},
53+
sort: {
54+
type: "string",
55+
label: "Sort",
56+
description: "The field names and sorting mode separated by a comma (`field_name_1 ASC, field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Valid fields: `id, title, owner_id, creator_id, was_seen, expected_close_date, next_activity_id, add_time, update_time`",
57+
optional: true,
58+
},
59+
},
60+
async run({ $ }) {
61+
const {
62+
app,
63+
maxResults,
64+
ownerId,
65+
personId,
66+
organizationId,
67+
filterId,
68+
sort,
69+
} = this;
70+
71+
const leads = await app.getPaginatedResources({
72+
fn: app.getLeads,
73+
params: {
74+
...(ownerId && {
75+
owner_id: ownerId,
76+
}),
77+
...(personId && {
78+
person_id: personId,
79+
}),
80+
...(organizationId && {
81+
organization_id: organizationId,
82+
}),
83+
...(filterId && {
84+
filter_id: filterId,
85+
}),
86+
...(sort && {
87+
sort: sort,
88+
}),
89+
},
90+
max: maxResults,
91+
});
92+
93+
$.export("$summary", `Successfully retrieved ${leads.length} lead${leads.length === 1
94+
? ""
95+
: "s"}`);
96+
return leads;
97+
},
98+
};

components/pipedrive/actions/get-lead-by-id/get-lead-by-id.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "pipedrive-get-lead-by-id",
55
name: "Get Lead by ID",
66
description: "Get a lead by its ID. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Leads#getLead)",
7-
version: "0.0.5",
7+
version: "0.0.6",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/pipedrive/actions/get-person-details/get-person-details.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "pipedrive-get-person-details",
66
name: "Get person details",
77
description: "Get details of a person by their ID. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#getPerson)",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/pipedrive/actions/merge-deals/merge-deals.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "pipedrive-merge-deals",
55
name: "Merge Deals",
66
description: "Merge two deals in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Deals#mergeDeals)",
7-
version: "0.0.5",
7+
version: "0.0.6",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

0 commit comments

Comments
 (0)