Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions components/pipedrive/actions/merge-deals/merge-deals.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import pipedriveApp from "../../pipedrive.app.mjs";

export default {
key: "pipedrive-merge-deals",
name: "Merge Deals",
description: "Merge two deals in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Deals#mergeDeals)",
version: "0.0.1",
type: "action",
props: {
pipedriveApp,
dealId: {
propDefinition: [
pipedriveApp,
"dealId",
],
description: "The ID of the deal to merge",
optional: false,
},
targetDealId: {
propDefinition: [
pipedriveApp,
"dealId",
],
label: "Target Deal ID",
description: "The ID of the deal that the deal will be merged with",
optional: false,
},
},
methods: {
mergeDeals({
id, ...opts
}) {
const dealsApi = this.pipedriveApp.api("DealsApi");
return dealsApi.mergeDeals({
id,
MergeDealsRequest: opts,
});
},
},
async run({ $ }) {
const { data } = await this.mergeDeals({
id: this.dealId,
merge_with_id: this.targetDealId,
});

$.export("$summary", `Successfully merged deals with IDs ${this.dealId} and ${this.targetDealId}`);

return data;
},
};
50 changes: 50 additions & 0 deletions components/pipedrive/actions/merge-persons/merge-persons.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import pipedriveApp from "../../pipedrive.app.mjs";

export default {
key: "pipedrive-merge-persons",
name: "Merge Persons",
description: "Merge two persons in Pipedrive. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Persons#mergePersons)",
version: "0.0.1",
type: "action",
props: {
pipedriveApp,
personId: {
propDefinition: [
pipedriveApp,
"personId",
],
description: "The ID of the person to merge",
optional: false,
},
targetPersonId: {
propDefinition: [
pipedriveApp,
"personId",
],
label: "Target Person ID",
description: "The ID of the person that will not be overwritten. This person's data will be prioritized in case of conflict with the other person.",
optional: false,
},
},
methods: {
mergePersons({
id, ...opts
}) {
const personsApi = this.pipedriveApp.api("PersonsApi");
return personsApi.mergePersons({
id,
MergePersonsRequest: opts,
});
},
},
async run({ $ }) {
const { data } = await this.mergePersons({
id: this.personId,
merge_with_id: this.targetPersonId,
});

$.export("$summary", `Successfully merged persons with IDs ${this.personId} and ${this.targetPersonId}`);

return data;
},
};
2 changes: 1 addition & 1 deletion components/pipedrive/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/pipedrive",
"version": "0.9.0",
"version": "0.10.0",
"description": "Pipedream Pipedrive Components",
"main": "pipedrive.app.mjs",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion components/pipedrive/sources/common/base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
const ts = Date.parse(body.meta.timestamp);

this.$emit(await this.parseData(body), {
id: `${body.data.id}-${ts}`,
id: `${body.data?.id || body.meta?.id}-${ts}`,
summary: this.getSummary(body),
ts,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "pipedrive-new-deal-instant",
name: "New Deal (Instant)",
description: "Emit new event when a new deal is created.",
version: "0.0.9",
version: "0.0.10",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import common from "../common/base.mjs";

export default {
...common,
key: "pipedrive-new-event-instant",
name: "New Event (Instant)",
description: "Emit new event when a new webhook event is received. [See the documentation](https://developers.pipedrive.com/docs/api/v1/Webhooks#addWebhook)",
version: "0.0.1",
type: "source",
dedupe: "unique",
props: {
...common.props,
eventAction: {
type: "string",
label: "Event Action",
description: "The type of action to receive notifications about. Wildcard (*) will match all supported actions.",
options: [
"*",
"create",
"change",
"delete",
],
},
eventObject: {
type: "string",
label: "Event Object",
description: "The type of object to receive notifications about. Wildcard (*) will match all supported objects.",
options: [
"*",
"activity",
"deal",
"lead",
"note",
"organization",
"person",
"pipeline",
"product",
"stage",
"user",
],
},
},
methods: {
...common.methods,
getExtraData() {
return {
event_action: this.eventAction,
event_object: this.eventObject,
};
},
getSummary(body) {
return `New ${body.meta.action}.${body.meta.entity} event`;
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "pipedrive-new-person-instant",
name: "New Person (Instant)",
description: "Emit new event when a new person is created.",
version: "0.0.9",
version: "0.0.10",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export default {
...common,
key: "pipedrive-updated-deal-instant",
name: "Deal Updated (Instant)",

Check warning on line 8 in components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a deal is updated.",
version: "0.1.2",
version: "0.1.3",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export default {
...common,
key: "pipedrive-updated-lead-instant",
name: "Lead Updated (Instant)",

Check warning on line 8 in components/pipedrive/sources/updated-lead-instant/updated-lead-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a lead is updated.",
version: "0.1.2",
version: "0.1.3",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
export default {
...common,
key: "pipedrive-updated-person-instant",
name: "Person Updated (Instant)",

Check warning on line 8 in components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
description: "Emit new event when a person is updated.",
version: "0.1.2",
version: "0.1.3",
type: "source",
dedupe: "unique",
methods: {
Expand Down
Loading
Loading