Skip to content

16246 feature update pipedrive to use webhooks v2 #16297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
2 changes: 1 addition & 1 deletion components/agentx/agentx.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/ai_chatbot_hub/ai_chatbot_hub.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/easyfill_ai/easyfill_ai.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/ifthenpay/ifthenpay.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/musicbrainz/musicbrainz.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
2 changes: 1 addition & 1 deletion components/notion_api_key/notion_api_key.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default {
console.log(Object.keys(this.$auth));
},
},
};
};
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.3.12",
"version": "0.3.13",
"description": "Pipedream Pipedrive Components",
"main": "pipedrive.app.mjs",
"keywords": [
Expand Down
9 changes: 3 additions & 6 deletions components/pipedrive/sources/common/base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ export default {
hooks: {
async activate() {
const response = await this.pipedrive.addWebhook({
// Specifying v1 because webhooks v2 became the default on March 17, 2025:
// https://developers.pipedrive.com/changelog/post/breaking-change-webhooks-v2-will-become-the-new-default-version
version: "1.0",
version: "2.0",
subscription_url: this.http.endpoint,
...this.getExtraData(),
});
console.log("response: ", response);

this._setHookId(response.data.id);
},
Expand All @@ -36,10 +33,10 @@ export default {
},
},
async run({ body }) {
const ts = Date.parse(body.current.update_time);
const ts = Date.parse(body.meta.timestamp);

this.$emit(body, {
id: `${body.current.id}-${ts}`,
id: `${body.data.id}-${ts}`,
summary: this.getSummary(body),
ts,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ export default {
key: "pipedrive-new-deal-instant",
name: "New Deal (Instant)",
description: "Emit new event when a new deal is created.",
version: "0.0.2",
version: "0.0.3",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getExtraData() {
return {
event_action: "added",
event_action: "create",
event_object: "deal",
};
},
getSummary(body) {
return `New Deal successfully created: ${body.current.id}`;
return `New Deal successfully created: ${body.data.id}`;
},
},
sampleEmit,
Expand Down
146 changes: 46 additions & 100 deletions components/pipedrive/sources/new-deal-instant/test-event.mjs
Original file line number Diff line number Diff line change
@@ -1,106 +1,52 @@
export default {
"v": 1,
"matches_filters": {
"current": []
},
"meta": {
"action": "added",
"change_source": "api",
"company_id": 1234567890,
"host": "subdomain.pipedrive.com",
"id": 10,
"is_bulk_update": false,
"matches_filters": {
"current": []
},
"object": "deal",
"permitted_user_ids": [
1234567890
],
"pipedrive_service_name": false,
"timestamp": 1739826584,
"timestamp_micro": 1739826584443168,
"prepublish_timestamp": 1739826584525,
"trans_pending": false,
"user_id": 1234567890,
"v": 1,
"webhook_id": "1234567890"
"action": "create",
"entity": "deal",
"company_id": 123123,
"correlation_id": "123456789-1234-1234-1234-123456789012",
"entity_id": 123,
"id": "123456789-1234-1234-1234-123456789012",
"is_bulk_edit": false,
"timestamp": "2023-01-01T00:00:00.000Z",
"type": "general",
"user_id": 123123,
"version": "2.0",
"webhook_id": 123,
"webhook_owner_id": 123123,
"attempt": 1,
"host": "company.pipedrive.com"
},
"current": {
"email_messages_count": 0,
"cc_email": "subomain+deal11@pipedrivemail.com",
"channel": 8,
"products_count": 0,
"archive_time": null,
"acv_currency": null,
"next_activity_date": null,
"acv": null,
"next_activity_type": null,
"local_close_date": null,
"next_activity_duration": null,
"id": 11,
"person_id": null,
"creator_user_id": 1234567890,
"expected_close_date": null,
"owner_name": "Owner Name",
"arr_currency": null,
"participants_count": 0,
"stage_id": 1,
"probability": null,
"undone_activities_count": 0,
"active": true,
"local_lost_date": null,
"person_name": null,
"last_activity_date": null,
"close_time": null,
"org_hidden": false,
"next_activity_id": null,
"weighted_value_currency": "USD",
"local_won_date": null,
"stage_order_nr": 0,
"next_activity_subject": null,
"rotten_time": null,
"is_archived": false,
"user_id": 1234567890,
"visible_to": "3",
"org_id": null,
"notes_count": 0,
"next_activity_time": null,
"channel_id": "Pipedream",
"formatted_value": "$ 0",
"status": "open",
"formatted_weighted_value": "$ 0",
"mrr_currency": null,
"first_won_time": null,
"origin": "Marketplace",
"last_outgoing_mail_time": null,
"origin_id": "5d80274eae050b58",
"title": "Deal Title",
"last_activity_id": null,
"update_time": "2025-02-17 21:09:44",
"activities_count": 0,
"pipeline_id": 1,
"lost_time": null,
"currency": "USD",
"weighted_value": 0,
"org_name": null,
"value": 0,
"person_hidden": false,
"next_activity_note": null,
"arr": null,
"files_count": 0,
"last_incoming_mail_time": null,
"label": null,
"mrr": null,
"lost_reason": null,
"deleted": false,
"won_time": null,
"followers_count": 0,
"stage_change_time": null,
"add_time": "2025-02-17 21:09:44",
"done_activities_count": 0
"data": {
"add_time":"2025-04-15T15:31:17Z",
"channel":null,
"channel_id":null,
"close_time":null,
"creator_user_id":123123,
"currency":"BRL",
"custom_fields":{},
"expected_close_date":null,
"first_won_time":null,
"id":1,
"label_ids":[],
"lost_reason":null,
"lost_time":null,
"org_id":2,
"origin":"ManuallyCreated",
"origin_id":null,
"owner_id":123123,
"person_id":3,
"pipeline_id":1,
"probability":null,
"stage_change_time":null,
"stage_id":1,
"status":"open",
"title":"Title",
"update_time":null,
"value":2,
"visible_to":"3",
"won_time":null,
"is_archived":false,
"archive_time":null
},
"previous": null,
"retry": 0,
"event": "added.deal"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ export default {
key: "pipedrive-new-person-instant",
name: "New Person (Instant)",
description: "Emit new event when a new person is created.",
version: "0.0.2",
version: "0.0.3",
type: "source",
dedupe: "unique",
methods: {
...common.methods,
getExtraData() {
return {
event_action: "added",
event_action: "create",
event_object: "person",
};
},
getSummary(body) {
return `New Person successfully created: ${body.current.id}`;
return `New Person successfully created: ${body.data.id}`;
},
},
sampleEmit,
Expand Down
Loading
Loading