-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
16246 feature update pipedrive to use webhooks v2 #16297
Conversation
Sources - New Deal (Instant) - New Person (Instant) - New Deal Updated (Instant) - New Person Updated (Instant)
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis change updates the Pipedrive integration to use Webhooks API version 2.0 instead of version 1.0. The webhook activation logic, event payload parsing, and test event data structures were modified to align with the new schema introduced in v2. The event processing methods now reference updated payload fields, and the event action strings were revised to match the new webhook event types. All relevant source component versions were incremented, and the package version was updated to reflect these changes. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SourceComponent
participant PipedriveAPI
User->>SourceComponent: Activate webhook
SourceComponent->>PipedriveAPI: Register webhook (version 2.0)
PipedriveAPI-->>SourceComponent: Webhook registration confirmation
PipedriveAPI-->>SourceComponent: Send event (v2 schema)
SourceComponent->>SourceComponent: Parse event using v2 fields
SourceComponent-->>User: Emit event with updated payload structure
Assessment against linked issues
Possibly related PRs
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/agentx/agentx.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/ai_chatbot_hub/ai_chatbot_hub.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/easyfill_ai/easyfill_ai.app.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
✅ Files skipped from review due to trivial changes (11)
⏰ Context from checks skipped due to timeout of 90000ms (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (10)
components/pipedrive/package.json
(1 hunks)components/pipedrive/sources/common/base.mjs
(2 hunks)components/pipedrive/sources/new-deal-instant/new-deal-instant.mjs
(1 hunks)components/pipedrive/sources/new-deal-instant/test-event.mjs
(1 hunks)components/pipedrive/sources/new-person-instant/new-person-instant.mjs
(1 hunks)components/pipedrive/sources/new-person-instant/test-event.mjs
(1 hunks)components/pipedrive/sources/updated-deal-instant/test-event.mjs
(1 hunks)components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs
(1 hunks)components/pipedrive/sources/updated-person-instant/test-event.mjs
(1 hunks)components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: pnpm publish
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (23)
components/pipedrive/sources/common/base.mjs (3)
23-23
: Webhook API version updated correctly to 2.0The update from webhook version "1.0" to "2.0" aligns with the PR objective to migrate to Pipedrive's v2 webhooks API.
36-36
: Timestamp parsing adjusted for v2 payload structureThe timestamp extraction now correctly uses
body.meta.timestamp
instead of the previousbody.current.update_time
to match Pipedrive's v2 webhook payload structure.Consider adding validation to handle potential format mismatches when parsing the timestamp:
-const ts = Date.parse(body.meta.timestamp); +const ts = body.meta?.timestamp ? Date.parse(body.meta.timestamp) : Date.now();
39-39
: Event ID reference updated for new payload structureThe event ID generation now correctly references
body.data.id
instead ofbody.current.id
to align with the v2 webhook payload structure.Consider adding defensive programming to handle potential payload format variations:
-id: `${body.data.id}-${ts}`, +id: `${body.data?.id || body.current?.id || "unknown"}-${ts}`,components/pipedrive/package.json (1)
3-3
: Package version increment is appropriateThe package version increment from 0.3.12 to 0.3.13 follows proper semantic versioning practices for this type of API update.
components/pipedrive/sources/updated-person-instant/updated-person-instant.mjs (3)
9-9
: Component version increment is appropriateThe version bump from 0.0.2 to 0.0.3 properly reflects the changes to webhook API integration.
16-16
: Event action updated to match v2 webhook terminologyChanged from "updated" to "change" to align with Pipedrive's webhook v2 event action naming.
21-21
: Updated reference to person ID in webhook payloadThe reference to
body.data.id
correctly reflects the new structure in Pipedrive webhook v2 payload.components/pipedrive/sources/new-person-instant/new-person-instant.mjs (3)
9-9
: Component version increment is appropriateThe version bump from 0.0.2 to 0.0.3 properly reflects the changes to webhook API integration.
16-16
: Event action updated to match v2 webhook terminologyChanged from "added" to "create" to align with Pipedrive's webhook v2 event action naming.
21-21
: Updated reference to person ID in webhook payloadThe reference to
body.data.id
correctly reflects the new structure in Pipedrive webhook v2 payload.components/pipedrive/sources/new-deal-instant/new-deal-instant.mjs (3)
9-9
: Version incremented correctlyThe component version increment from "0.0.2" to "0.0.3" correctly reflects the changes to webhook API integration.
16-16
: Event action updated to match Webhooks v2 terminologyThe change from "added" to "create" aligns with Pipedrive's Webhooks API v2 event action terminology.
21-21
: Summary method updated for new event payload structureThe update to reference
body.data.id
instead ofbody.current.id
correctly handles the new webhook payload structure in v2.components/pipedrive/sources/updated-deal-instant/updated-deal-instant.mjs (3)
9-9
: Version incremented correctlyThe component version increment from "0.0.2" to "0.0.3" properly reflects the changes to webhook API integration.
16-16
: Event action updated to match Webhooks v2 terminologyThe change from "updated" to "change" aligns with Pipedrive's Webhooks API v2 event action terminology.
21-21
: Summary method updated for new event payload structureThe update to reference
body.data.id
instead ofbody.current.id
correctly handles the new webhook payload structure in v2.components/pipedrive/sources/updated-deal-instant/test-event.mjs (2)
3-17
: Meta object updated for Webhooks v2 formatThe meta object structure has been properly updated to follow Pipedrive's Webhooks API v2 format, including the appropriate version identifier and new required fields.
19-50
: Event data structure updated from 'current' to 'data'The event payload structure has been correctly updated from using a 'current' object to using a 'data' object, following Pipedrive's Webhooks API v2 format.
components/pipedrive/sources/updated-person-instant/test-event.mjs (2)
3-17
: Meta object updated for Webhooks v2 formatThe meta object structure has been properly updated to follow Pipedrive's Webhooks API v2 format, including the appropriate version identifier and new required fields.
19-34
: Event data structure updated from 'current' to 'data'The event payload structure has been correctly updated from using a 'current' object to using a 'data' object, following Pipedrive's Webhooks API v2 format.
components/pipedrive/sources/new-deal-instant/test-event.mjs (1)
3-17
: Meta structure correctly updated for webhook v2 formatThe meta structure has been properly updated to match Pipedrive's webhook v2 format with all required fields. The action value has been changed from "added" to "create" and object has been renamed to "entity", reflecting the new webhook schema.
components/pipedrive/sources/new-person-instant/test-event.mjs (2)
3-17
: Meta structure correctly updated for webhook v2 formatThe meta structure has been properly updated to match Pipedrive's webhook v2 format with all required fields. The action value has been changed from "added" to "create" and object has been renamed to "entity".
19-34
: Person data structure correctly updated to v2 formatThe data structure for the person object has been simplified to match Pipedrive's webhook v2 format with appropriate fields for a person entity. The relevant fields like name, first_name, emails, phones, etc. are correctly included.
/approve |
Resolves #16246
Summary by CodeRabbit