-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New Components - zendesk #17748
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
New Components - zendesk #17748
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
WalkthroughThis update introduces several new Zendesk integration actions and sources, including listing macros, locales, ticket comments, and retrieving user info. It also adds a polling source for locale updates and an instant source for new ticket comments. Existing actions and sources have version increments. The Zendesk app gains new prop definitions and API methods for users, groups, macros, locales, and ticket comments. The webhook source centralizes event emission logic. Changes
Sequence Diagram(s)Example: "List Macros" ActionsequenceDiagram
participant User
participant ListMacrosAction
participant ZendeskApp
participant ZendeskAPI
User->>ListMacrosAction: Trigger action with filters
ListMacrosAction->>ZendeskApp: listMacros(params)
loop Paginated fetch
ZendeskApp->>ZendeskAPI: GET /macros with params
ZendeskAPI-->>ZendeskApp: Macros page
ZendeskApp-->>ListMacrosAction: Macros page
end
ListMacrosAction-->>User: Return all macros
Example: "Locale Updated" Source (Polling)sequenceDiagram
participant PollingSource
participant ZendeskApp
participant ZendeskAPI
participant EventEmitter
PollingSource->>ZendeskApp: listLocales()
ZendeskApp->>ZendeskAPI: GET /locales
ZendeskAPI-->>ZendeskApp: Locales list
ZendeskApp-->>PollingSource: Locales list
PollingSource->>EventEmitter: Emit event for each updated locale
PollingSource->>PollingSource: Update last timestamp
Example: "New Ticket Comment Added" Source (Instant)sequenceDiagram
participant Zendesk
participant WebhookSource
participant EventEmitter
Zendesk-->>WebhookSource: Webhook payload (ticket updated)
WebhookSource->>WebhookSource: Parse comments, check timestamps
WebhookSource->>EventEmitter: Emit event for each new comment
WebhookSource->>WebhookSource: Update last processed timestamp
Estimated code review effort3 (Moderate) | ⏱️ ~40 minutes 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/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 0
🔭 Outside diff range comments (1)
components/zendesk/package.json (1)
16-19
: Remove built-in modulecrypto
fromdependencies
crypto
ships with Node.js; declaring it here can confuse bundlers and needlessly inflates lockfiles."dependencies": { "@pipedream/platform": "^3.0.3", - "crypto": "^1.0.1" + /* no external dependencies beyond @pipedream/platform */ }
🧹 Nitpick comments (7)
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs (1)
45-46
: Guard against undefined / non-arrayticketTags
before using.length
If the prop is ever omitted or supplied as a string,ticketTags.length
may throw or give misleading output.- step.export("$summary", `Successfully added ${ticketTags.length} tag(s) to ticket ${ticketId}`); + const count = Array.isArray(ticketTags) ? ticketTags.length : 0; + step.export("$summary", `Successfully added ${count} tag(s) to ticket ${ticketId}`);components/zendesk/actions/delete-ticket/delete-ticket.mjs (1)
40-49
: Return the API response for better downstream debugging
Currently the action discards the Zendesk response and always returnstrue
, losing potentially valuable context (rate-limit headers, deleted ticket ID, etc.).- await this.deleteTicket({ + const response = await this.deleteTicket({ step, ticketId, customSubdomain, }); - step.export("$summary", "Successfully deleted ticket"); - - return true; + step.export("$summary", `Successfully deleted ticket ${ticketId}`); + return response;components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs (1)
8-8
: Version bump is reasonable but document itThe minor patch bump (
0.0.1 → 0.0.2
) is fine; however, make sure the changelog and package manifest (components/zendesk/package.json
) reflect this increment so that downstream consumers get a consistent version story.components/zendesk/actions/list-tickets/list-tickets.mjs (1)
8-8
: Synchronize package version
0.0.3 → 0.0.4
aligns with other actions. Ensurecomponents/zendesk/package.json
has been bumped to at least0.8.x
to avoid a mismatch between action files and the published package version.components/zendesk/actions/update-ticket/update-ticket.mjs (1)
8-8
: Confirm semantic intent for0.1.5 → 0.1.6
No behavioral changes detected, so a patch bump is appropriate. If any new optional props or edge-case fixes were introduced elsewhere in the PR, consider a minor bump instead to follow semver.
components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (1)
45-48
: Consider simplifying result collection.The manual iteration to collect paginated results could be more concise:
- const comments = []; - for await (const comment of results) { - comments.push(comment); - } + const comments = []; + for await (const comment of results) { + comments.push(comment); + }Actually, the current approach is clear and readable. Consider keeping it as-is for maintainability.
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (1)
42-67
: Consider the robustness of the regex-based comment parsing.The
convertCommentsToJson
method relies on a specific comment format using regex parsing. While functional, this approach could be brittle if Zendesk changes their internal comment representation format.Consider adding error handling around the regex parsing and type conversion logic to gracefully handle unexpected formats.
convertCommentsToJson(raw) { + try { return [ ...raw.matchAll(/#<Comment (.*?)>/g), ].map((match) => { const fields = match[1] .split(",") .map((part) => part.trim()) .map((pair) => { const [ key, value, ] = pair.split(/:\s+/); // Clean up values: remove extra quotes or cast to appropriate types let cleaned = value; if (cleaned === "nil") cleaned = null; else if (cleaned === "true") cleaned = true; else if (cleaned === "false") cleaned = false; else if (/^\d+$/.test(cleaned)) cleaned = parseInt(cleaned, 10); else if (/^".*"$/.test(cleaned)) cleaned = cleaned.slice(1, -1); return [ key, cleaned, ]; }); return Object.fromEntries(fields); }); + } catch (error) { + console.error("Failed to parse ticket comments:", error); + return []; + } },
📜 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 (25)
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs
(1 hunks)components/zendesk/actions/create-ticket/create-ticket.mjs
(1 hunks)components/zendesk/actions/delete-ticket/delete-ticket.mjs
(1 hunks)components/zendesk/actions/get-ticket-info/get-ticket-info.mjs
(1 hunks)components/zendesk/actions/get-user-info/get-user-info.mjs
(1 hunks)components/zendesk/actions/list-locales/list-locales.mjs
(1 hunks)components/zendesk/actions/list-macros/list-macros.mjs
(1 hunks)components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs
(1 hunks)components/zendesk/actions/list-tickets/list-tickets.mjs
(1 hunks)components/zendesk/actions/remove-ticket-tags/remove-ticket-tags.mjs
(1 hunks)components/zendesk/actions/search-tickets/search-tickets.mjs
(1 hunks)components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs
(1 hunks)components/zendesk/actions/update-ticket/update-ticket.mjs
(1 hunks)components/zendesk/package.json
(1 hunks)components/zendesk/sources/common/polling.mjs
(1 hunks)components/zendesk/sources/common/webhook.mjs
(2 hunks)components/zendesk/sources/locale-updated/locale-updated.mjs
(1 hunks)components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs
(1 hunks)components/zendesk/sources/new-ticket/new-ticket.mjs
(1 hunks)components/zendesk/sources/ticket-added-to-view/ticket-added-to-view.mjs
(1 hunks)components/zendesk/sources/ticket-closed/ticket-closed.mjs
(1 hunks)components/zendesk/sources/ticket-pended/ticket-pended.mjs
(1 hunks)components/zendesk/sources/ticket-solved/ticket-solved.mjs
(1 hunks)components/zendesk/sources/ticket-updated/ticket-updated.mjs
(1 hunks)components/zendesk/zendesk.app.mjs
(3 hunks)
🧠 Learnings (11)
components/zendesk/package.json (1)
Learnt from: jcortes
PR: #14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like fs
to package.json
dependencies, as they are native modules provided by the Node.js runtime.
components/zendesk/actions/create-ticket/create-ticket.mjs (1)
Learnt from: jcortes
PR: #14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In components/gainsight_px/actions/create-account/create-account.mjs
, the action name should be "Create Account" instead of "Create Memory".
components/zendesk/sources/ticket-updated/ticket-updated.mjs (2)
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
components/zendesk/sources/common/webhook.mjs (6)
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: #17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the created_at
field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using Date.parse()
before assigning to the ts
field in generateMeta()
.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common.mjs:97-98
Timestamp: 2024-07-24T02:05:59.531Z
Learning: The processTimerEvent
method in the components/salesforce_rest_api/sources/common.mjs
file is intentionally left unimplemented to enforce that subclasses must implement this method, similar to an abstract class in object-oriented programming.
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
components/zendesk/actions/list-locales/list-locales.mjs (3)
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: jcortes
PR: #14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In components/gainsight_px/actions/create-account/create-account.mjs
, the action name should be "Create Account" instead of "Create Memory".
components/zendesk/sources/ticket-added-to-view/ticket-added-to-view.mjs (1)
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
components/zendesk/actions/get-user-info/get-user-info.mjs (2)
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
components/zendesk/actions/list-macros/list-macros.mjs (2)
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
components/zendesk/sources/locale-updated/locale-updated.mjs (2)
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (5)
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: #17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the created_at
field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using Date.parse()
before assigning to the ts
field in generateMeta()
.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
components/zendesk/zendesk.app.mjs (1)
Learnt from: GTFalcao
PR: #16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
🧬 Code Graph Analysis (3)
components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (2)
components/zendesk/actions/list-macros/list-macros.mjs (1)
results
(71-86)components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (1)
comments
(72-72)
components/zendesk/actions/list-macros/list-macros.mjs (1)
components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (1)
results
(32-43)
components/zendesk/sources/locale-updated/locale-updated.mjs (2)
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (4)
lastTs
(70-70)maxTs
(71-71)ts
(74-74)ts
(83-83)components/zendesk/sources/common/webhook.mjs (1)
ts
(216-216)
🧰 Additional context used
🧠 Learnings (11)
components/zendesk/package.json (1)
Learnt from: jcortes
PR: #14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like fs
to package.json
dependencies, as they are native modules provided by the Node.js runtime.
components/zendesk/actions/create-ticket/create-ticket.mjs (1)
Learnt from: jcortes
PR: #14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In components/gainsight_px/actions/create-account/create-account.mjs
, the action name should be "Create Account" instead of "Create Memory".
components/zendesk/sources/ticket-updated/ticket-updated.mjs (2)
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
components/zendesk/sources/common/webhook.mjs (6)
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: #17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the created_at
field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using Date.parse()
before assigning to the ts
field in generateMeta()
.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common.mjs:97-98
Timestamp: 2024-07-24T02:05:59.531Z
Learning: The processTimerEvent
method in the components/salesforce_rest_api/sources/common.mjs
file is intentionally left unimplemented to enforce that subclasses must implement this method, similar to an abstract class in object-oriented programming.
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
components/zendesk/actions/list-locales/list-locales.mjs (3)
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: jcortes
PR: #14467
File: components/gainsight_px/actions/create-account/create-account.mjs:4-6
Timestamp: 2024-10-30T15:24:39.294Z
Learning: In components/gainsight_px/actions/create-account/create-account.mjs
, the action name should be "Create Account" instead of "Create Memory".
components/zendesk/sources/ticket-added-to-view/ticket-added-to-view.mjs (1)
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
components/zendesk/actions/get-user-info/get-user-info.mjs (2)
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
components/zendesk/actions/list-macros/list-macros.mjs (2)
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run
method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members
action, the correct format is Successfully retrieved ${response.data.length} members
.
components/zendesk/sources/locale-updated/locale-updated.mjs (2)
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (5)
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs
, when processing items in getAndProcessData
, savedIds
is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Learnt from: GTFalcao
PR: #17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the created_at
field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using Date.parse()
before assigning to the ts
field in generateMeta()
.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
components/zendesk/zendesk.app.mjs (1)
Learnt from: GTFalcao
PR: #16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.
🧬 Code Graph Analysis (3)
components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (2)
components/zendesk/actions/list-macros/list-macros.mjs (1)
results
(71-86)components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (1)
comments
(72-72)
components/zendesk/actions/list-macros/list-macros.mjs (1)
components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (1)
results
(32-43)
components/zendesk/sources/locale-updated/locale-updated.mjs (2)
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (4)
lastTs
(70-70)maxTs
(71-71)ts
(74-74)ts
(83-83)components/zendesk/sources/common/webhook.mjs (1)
ts
(216-216)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (24)
components/zendesk/actions/add-ticket-tags/add-ticket-tags.mjs (1)
8-8
: Version bump acknowledged – no further concerns
No functional change was introduced; version alignment looks correct.components/zendesk/package.json (1)
3-3
: Package version bump LGTM
The jump to0.8.0
is consistent with the newly added features.components/zendesk/actions/delete-ticket/delete-ticket.mjs (1)
8-8
: Version bump acknowledged – no issuescomponents/zendesk/sources/ticket-pended/ticket-pended.mjs (1)
9-9
: Version bump looks fine – source remains unchangedcomponents/zendesk/actions/create-ticket/create-ticket.mjs (1)
8-8
: Version bump acknowledged – no issuescomponents/zendesk/actions/get-ticket-info/get-ticket-info.mjs (1)
8-8
: Maintain changelog consistencyPatch-level bump (
0.0.3 → 0.0.4
) looks good. Double-check that any consumer-visible changes (even if just dependency updates) are captured in your release notes.components/zendesk/sources/new-ticket/new-ticket.mjs (1)
9-9
: Source version bump acknowledgedIncrement to
0.2.6
is OK. Verify webhook migrations (if any) are backward-compatible so existing users aren’t forced to re-subscribe.components/zendesk/sources/ticket-solved/ticket-solved.mjs (1)
9-9
: Version bump only – looks goodNo functional code was touched; bump aligns with the rest of the Zendesk sources.
components/zendesk/sources/ticket-added-to-view/ticket-added-to-view.mjs (1)
8-8
: Version bump only – looks goodConsistent with coordinated release; no further action needed.
components/zendesk/actions/set-ticket-tags/set-ticket-tags.mjs (1)
8-8
: Version bump only – looks goodAction logic unchanged; version matches other tag-related actions.
components/zendesk/actions/search-tickets/search-tickets.mjs (1)
8-8
: Version bump only – looks goodSearch action unchanged; version sync confirmed.
components/zendesk/sources/ticket-closed/ticket-closed.mjs (1)
9-9
: Version bump only – looks goodMatches other ticket lifecycle source bumps; no issues.
components/zendesk/sources/ticket-updated/ticket-updated.mjs (1)
9-9
: LGTM - Version bump is appropriate.This coordinated version increment aligns with the broader Zendesk integration enhancements mentioned in the PR summary.
components/zendesk/actions/list-locales/list-locales.mjs (1)
1-21
: LGTM - Well-implemented action following established patterns.The action correctly:
- Uses the Zendesk app integration
- Calls the appropriate API method
- Handles singular/plural summary messages properly
- Returns the retrieved data
The implementation is clean and follows Pipedream action conventions.
components/zendesk/sources/common/webhook.mjs (2)
215-223
: LGTM - Good refactoring to centralize event emission.The new
emitEvent
method properly centralizes the event emission logic with appropriate metadata generation. The ID creation usingticketId
and timestamp ensures uniqueness, and the summary fallback logic is solid.
216-216
: ✅payload.updatedAt
parsing is correct
Zendesk’supdated_at
arrives as an ISO 8601 UTC string (YYYY-MM-DDTHH:MM:SSZ
), whichDate.parse()
handles natively—returning milliseconds since epoch. No changes are required.components/zendesk/actions/list-ticket-comments/list-ticket-comments.mjs (1)
32-48
: LGTM - Correct pagination implementation.The pagination usage correctly follows the established pattern with proper parameters and resource key. The async iteration to collect results is functional.
components/zendesk/sources/common/polling.mjs (1)
1-23
: LGTM - Clean and reusable polling source foundation.This common module provides a solid foundation for Zendesk polling sources with:
- Proper integration setup with the Zendesk app
- Standard timer configuration using platform defaults
- Simple timestamp persistence methods with clear naming
- Appropriate database key naming (
lastTs
)The design follows established Pipedream patterns and will enable consistent polling behavior across Zendesk sources.
components/zendesk/actions/get-user-info/get-user-info.mjs (1)
1-28
: LGTM! Well-implemented action following standard patterns.The action correctly implements user info retrieval with proper error handling, summary formatting, and integration with the Zendesk app component. The summary message format aligns with established conventions.
components/zendesk/actions/list-macros/list-macros.mjs (1)
1-99
: LGTM! Comprehensive macro listing action with proper pagination.The action correctly implements macro retrieval with extensive filtering options, proper pagination using the established pattern, and appropriate summary formatting with pluralization handling. The implementation follows Zendesk component conventions.
components/zendesk/sources/locale-updated/locale-updated.mjs (1)
1-29
: LGTM! Well-implemented polling source for locale updates.The source correctly implements locale update detection with proper timestamp tracking, event emission patterns, and follows the established convention where "New" prefix isn't required for update events. The implementation aligns with other polling sources in the codebase.
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (1)
69-91
: LGTM! Proper webhook implementation with timestamp tracking.The webhook implementation correctly handles relevance checking and event emission patterns. The timestamp tracking logic follows established conventions and properly handles multiple comments per payload.
components/zendesk/zendesk.app.mjs (2)
104-174
: LGTM! Well-implemented prop definitions with proper pagination.The new
userId
,groupId
, andmacroCategory
prop definitions correctly implement async option loading with cursor-based pagination, following established patterns in the codebase. The optional flags are appropriately set and the label/value mappings are consistent.
308-409
: LGTM! Comprehensive API method additions following established patterns.The new API methods (
getUserInfo
,listUsers
,listGroups
,listLocales
,listMacros
,listMacroCategories
,listTicketComments
) all follow the establishedmakeRequest
pattern with consistent method signatures and proper path construction. These additions provide solid foundation for the new actions and sources.
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.
Hi @michelle0927, LGTM! Ready for QA!
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: 1
🧹 Nitpick comments (2)
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (2)
87-97
: Consider separating timestamp update from relevance check.The
isRelevant
method has side effects by updating the timestamp, which could potentially cause issues if the method is called multiple times or if there are errors during event processing.Consider separating concerns:
isRelevant(payload) { const lastTs = this._getLastTs() || 0; - let maxTs = lastTs; const comments = this.convertCommentsToJson(payload.ticketComments); + let maxTs = lastTs; for (const comment of comments) { const ts = Date.parse(comment.created_at); maxTs = Math.max(maxTs, ts); } - this._setLastTs(maxTs); - return comments.length > 0 && maxTs > lastTs; + const isRelevant = comments.length > 0 && maxTs > lastTs; + if (isRelevant) { + this._setLastTs(maxTs); + } + return isRelevant; },This ensures the timestamp is only updated when events are actually processed.
98-109
: Event emission logic looks good with minor suggestion.The approach of emitting individual comment events is appropriate and the ID generation strategy ensures uniqueness.
Consider adding validation for the timestamp:
emitEvent(payload) { payload.ticketComments = this.convertCommentsToJson(payload.ticketComments); for (const comment of payload.ticketComments) { + if (!comment.created_at) { + console.warn('Comment missing created_at timestamp:', comment); + continue; + } const ts = Date.parse(comment.created_at); + if (isNaN(ts)) { + console.warn('Invalid timestamp format:', comment.created_at); + continue; + } const id = `${payload.ticketId}-${ts}`; this.$emit(comment, { id, summary: comment.value, ts, }); } },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (3)
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs
object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta
and getEventType
to enforce implementation in subclasses.
Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (4)
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs (4)
1-11
: LGTM! Clean component structure following Pipedream conventions.The imports, naming convention, and basic configuration are well-structured and follow established patterns.
12-28
: Props configuration looks good.The component includes appropriate props for Zendesk webhook functionality with proper prop definitions.
31-36
: Good timestamp management pattern.The database-backed timestamp methods provide proper state management for duplicate prevention.
37-59
: Webhook configuration is properly implemented.The methods correctly configure webhook behavior with appropriate filtering for ticket change events and include necessary comment data in the payload.
components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs
Show resolved
Hide resolved
/approve |
Resolves #17426
Summary by CodeRabbit
New Features
Improvements
Updates