Skip to content

Commit fb1c64a

Browse files
authored
Pipedrive - Update Person action (#16881)
* update-person action * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml * formatting * pnpm-lock.yaml * pnpm-lock.yaml
1 parent 90175ce commit fb1c64a

File tree

15 files changed

+128
-24
lines changed

15 files changed

+128
-24
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.8",
10+
version: "0.1.9",
1111
type: "action",
1212
props: {
1313
pipedriveApp,

components/pipedrive/actions/add-deal/add-deal.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-deal",
66
name: "Add Deal",
77
description: "Adds a new deal. See the Pipedrive API docs for Deals [here](https://developers.pipedrive.com/docs/api/v1/Deals#addDeal)",
8-
version: "0.1.8",
8+
version: "0.1.9",
99
type: "action",
1010
props: {
1111
pipedriveApp,

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.2",
9+
version: "0.0.3",
1010
type: "action",
1111
props: {
1212
pipedrive,

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.6",
8+
version: "0.0.7",
99
type: "action",
1010
props: {
1111
pipedriveApp,

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.8",
8+
version: "0.1.9",
99
type: "action",
1010
props: {
1111
pipedriveApp,

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

Lines changed: 9 additions & 9 deletions
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.8",
9+
version: "0.1.9",
1010
type: "action",
1111
props: {
1212
pipedriveApp,
@@ -31,16 +31,16 @@ export default {
3131
description: "ID of the organization this person will belong to.",
3232
},
3333
emails: {
34-
type: "string[]",
35-
label: "Emails",
36-
description: "Email addresses (one or more) associated with the person, presented in the same manner as received by GET request of a person. **Example: {\"value\":\"email1@email.com\", \"primary\":true, \"label\":\"work\"}**",
37-
optional: true,
34+
propDefinition: [
35+
pipedriveApp,
36+
"emails",
37+
],
3838
},
3939
phones: {
40-
type: "string[]",
41-
label: "Phones",
42-
description: "Phone numbers (one or more) associated with the person, presented in the same manner as received by GET request of a person. **Example: {\"value\":\"12345\", \"primary\":true, \"label\":\"work\"}**",
43-
optional: true,
40+
propDefinition: [
41+
pipedriveApp,
42+
"phones",
43+
],
4444
},
4545
visibleTo: {
4646
propDefinition: [

components/pipedrive/actions/search-persons/search-persons.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "pipedrive-search-persons",
88
name: "Search persons",
99
description: "Searches all Persons by `name`, `email`, `phone`, `notes` and/or custom fields. This endpoint is a wrapper of `/v1/itemSearch` with a narrower OAuth scope. Found Persons can be filtered by Organization ID. See the Pipedrive API docs [here](https://developers.pipedrive.com/docs/api/v1/Persons#searchPersons)",
10-
version: "0.1.8",
10+
version: "0.1.9",
1111
type: "action",
1212
props: {
1313
pipedriveApp,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "pipedrive-update-deal",
66
name: "Update Deal",
77
description: "Updates the properties of a deal. See the Pipedrive API docs for Deals [here](https://developers.pipedrive.com/docs/api/v1/Deals#updateDeal)",
8-
version: "0.1.9",
8+
version: "0.1.10",
99
type: "action",
1010
props: {
1111
pipedriveApp,
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { ConfigurationError } from "@pipedream/platform";
2+
import { parseObject } from "../../common/utils.mjs";
3+
import pipedriveApp from "../../pipedrive.app.mjs";
4+
5+
export default {
6+
key: "pipedrive-update-person",
7+
name: "Update Person",
8+
description: "Updates an existing person in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#updatePerson)",
9+
version: "0.0.1",
10+
type: "action",
11+
props: {
12+
pipedriveApp,
13+
personId: {
14+
propDefinition: [
15+
pipedriveApp,
16+
"personId",
17+
],
18+
description: "The ID of the person to update",
19+
optional: false,
20+
},
21+
name: {
22+
type: "string",
23+
label: "Name",
24+
description: "New name of the person",
25+
optional: true,
26+
},
27+
ownerId: {
28+
label: "Owner ID",
29+
description: "ID of the user who will be marked as the owner of this person. When omitted, the authorized user ID will be used.",
30+
propDefinition: [
31+
pipedriveApp,
32+
"userId",
33+
],
34+
},
35+
organizationId: {
36+
propDefinition: [
37+
pipedriveApp,
38+
"organizationId",
39+
],
40+
description: "ID of the organization this person will belong to",
41+
},
42+
emails: {
43+
propDefinition: [
44+
pipedriveApp,
45+
"emails",
46+
],
47+
},
48+
phones: {
49+
propDefinition: [
50+
pipedriveApp,
51+
"phones",
52+
],
53+
},
54+
visibleTo: {
55+
propDefinition: [
56+
pipedriveApp,
57+
"visibleTo",
58+
],
59+
description: "Visibility of the person. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.",
60+
},
61+
},
62+
async run({ $ }) {
63+
try {
64+
const resp =
65+
await this.pipedriveApp.updatePerson({
66+
personId: this.personId,
67+
name: this.name,
68+
owner_id: this.ownerId,
69+
org_id: this.organizationId,
70+
emails: parseObject(this.emails),
71+
phones: parseObject(this.phones),
72+
visible_to: this.visibleTo,
73+
});
74+
75+
$.export("$summary", `Successfully updated person with ID: ${this.personId}`);
76+
77+
return resp;
78+
79+
} catch ({ error }) {
80+
throw new ConfigurationError(error);
81+
}
82+
},
83+
};

components/pipedrive/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/pipedrive",
3-
"version": "0.4.1",
3+
"version": "0.5.0",
44
"description": "Pipedream Pipedrive Components",
55
"main": "pipedrive.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)