Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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/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": "[email protected]",
"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
134 changes: 30 additions & 104 deletions components/pipedrive/sources/new-person-instant/test-event.mjs
Original file line number Diff line number Diff line change
@@ -1,110 +1,36 @@
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": "person",
"permitted_user_ids": [
1234567890
],
"pipedrive_service_name": false,
"timestamp": 1739826941,
"timestamp_micro": 1739826941509060,
"prepublish_timestamp": 1739826941605,
"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": {
"related_closed_deals_count": 0,
"notes": null,
"email_messages_count": 0,
"cc_email": "[email protected]",
"owner_id": 1234567890,
"open_deals_count": 0,
"postal_address_subpremise": null,
"next_activity_date": null,
"participant_open_deals_count": 0,
"postal_address_locality": null,
"id": 10,
"job_title": null,
"postal_address": null,
"owner_name": "Owner Name",
"im": [
{
"value": "",
"primary": true
}
],
"related_won_deals_count": 0,
"label_ids": [],
"undone_activities_count": 0,
"last_activity_date": null,
"next_activity_id": null,
"postal_address_country": null,
"phone": [
{
"value": "",
"primary": true
}
],
"visible_to": "3",
"org_id": null,
"notes_count": 0,
"name": "Person Name",
"participant_closed_deals_count": 0,
"lost_deals_count": 0,
"next_activity_time": null,
"birthday": null,
"delete_time": null,
"postal_address_postal_code": null,
"last_outgoing_mail_time": null,
"active_flag": true,
"picture_id": null,
"last_activity_id": null,
"update_time": "2025-02-17 21:15:41",
"activities_count": 0,
"postal_address_route": null,
"org_name": null,
"first_name": "Person Name",
"email": [
{
"value": "",
"primary": true
}
],
"postal_address_street_number": null,
"won_deals_count": 0,
"files_count": 0,
"company_id": 1234567890,
"last_incoming_mail_time": null,
"first_char": "p",
"closed_deals_count": 0,
"last_name": "02",
"label": null,
"related_lost_deals_count": 0,
"related_open_deals_count": 0,
"postal_address_formatted_address": null,
"postal_address_sublocality": null,
"postal_address_admin_area_level_2": null,
"postal_address_admin_area_level_1": null,
"followers_count": 0,
"primary_email": null,
"add_time": "2025-02-17 21:15:41",
"done_activities_count": 0
"data": {
"add_time":"2025-04-15T15:35:54Z",
"custom_fields":{},
"emails":[],
"first_name":"First Name",
"id":1,
"label":null,
"label_ids":[],
"last_name":null,
"name":"Person Name",
"org_id":null,
"owner_id":123123,
"phones":[],
"update_time":"2025-04-15T15:35:54Z",
"visible_to":"3"
},
"previous": null,
"retry": 0,
"event": "added.person"
}
Loading
Loading