Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 28, 2025

Resolves #17430

Summary by CodeRabbit

  • New Features

    • Added support for managing macros, including creating, updating, deleting, and listing macros in the Gorgias OAuth integration.
    • Introduced new event sources to emit events when macros are created or updated.
    • Added the ability to retrieve individual tickets by ID.
  • Enhancements

    • Expanded available intent options for macros.
    • Improved event type handling with new macro-related event types.
  • Bug Fixes

    • Updated version numbers for several existing actions and sources to ensure consistency and clarity.
  • Chores

    • Updated package dependencies to the latest versions.

@vercel
Copy link

vercel bot commented Jul 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Jul 28, 2025 8:24pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 28, 2025 8:24pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 28, 2025 8:24pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

Walkthrough

This update introduces comprehensive macro (canned response) management for the Gorgias OAuth integration, including new actions and sources for creating, updating, deleting, and listing macros. It also adds supporting constants, event types, and test events. Several version bumps are made to existing actions and sources, with no logic changes.

Changes

Cohort / File(s) Change Summary
Macro Management Actions
components/gorgias_oauth/actions/create-macro/create-macro.mjs, .../actions/update-macro/update-macro.mjs, .../actions/delete-macro/delete-macro.mjs, .../actions/list-macros/list-macros.mjs
Added new actions for creating, updating, deleting, and listing macros (canned responses) in Gorgias.
Macro Management Sources
components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs, .../sources/new-macro-created/test-event.mjs, .../sources/macro-updated/macro-updated.mjs, .../sources/macro-updated/test-event.mjs
Introduced new sources to emit events when macros are created or updated, including test event data for both.
Macro Support in App
components/gorgias_oauth/gorgias_oauth.app.mjs, .../common/constants.mjs, .../sources/common/event-types.mjs
Extended app methods and prop definitions to support macro CRUD operations and macro intent constants; added macro-related event types.
Base Polling Source
components/gorgias_oauth/sources/common/base-polling.mjs
Added a reusable base polling source class for event-driven sources, supporting macro event polling.
Version Bumps (Actions)
.../actions/create-customer/create-customer.mjs, .../actions/create-ticket-message/create-ticket-message.mjs, .../actions/create-ticket/create-ticket.mjs, .../actions/list-tickets/list-tickets.mjs, .../actions/retrieve-customer/retrieve-customer.mjs, .../actions/update-customer/update-customer.mjs, .../actions/update-ticket/update-ticket.mjs
Updated version numbers for multiple existing actions; no logic changes.
Version Bumps (Sources)
.../sources/internal-note-created/internal-note-created.mjs, .../sources/ticket-created/ticket-created.mjs, .../sources/ticket-message-created/ticket-message-created.mjs, .../sources/ticket-updated/ticket-updated.mjs
Updated version numbers for several existing sources; no logic changes.
Package Metadata
components/gorgias_oauth/package.json
Updated package version and upgraded a dependency.
New Action
components/gorgias_oauth/actions/get-ticket/get-ticket.mjs
Added action to fetch ticket details by ID.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Action
  participant GorgiasOAuthApp
  participant GorgiasAPI

  User->>Action: Trigger (e.g., Create Macro)
  Action->>GorgiasOAuthApp: Call createMacro({ data })
  GorgiasOAuthApp->>GorgiasAPI: POST /macros with data
  GorgiasAPI-->>GorgiasOAuthApp: Macro created response
  GorgiasOAuthApp-->>Action: Return macro data
  Action-->>User: Output macro info
Loading
sequenceDiagram
  participant Source
  participant BasePolling
  participant GorgiasOAuthApp
  participant GorgiasAPI

  Source->>BasePolling: run()
  BasePolling->>GorgiasOAuthApp: list events (e.g., macro-updated)
  GorgiasOAuthApp->>GorgiasAPI: GET /events?type=macro-updated
  GorgiasAPI-->>GorgiasOAuthApp: Event list
  GorgiasOAuthApp-->>BasePolling: Return events
  BasePolling->>Source: For each event, getEventData(event)
  Source->>GorgiasOAuthApp: getMacro({ id })
  GorgiasOAuthApp->>GorgiasAPI: GET /macros/{id}
  GorgiasAPI-->>GorgiasOAuthApp: Macro data
  GorgiasOAuthApp-->>Source: Macro details
  Source-->>BasePolling: Emit event
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Assessment against linked issues

Objective Addressed Explanation
Fetch ticket details → /tickets/{id} (17430)
List tickets → /tickets (17430)
Add reply to ticket → /tickets/{id}/messages (17430)
Fetch canned responses (macros), Create/update/delete canned response → /canned-responses* (17430)
Emit events for canned response (macro) created/updated/deleted (17430)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Suggested reviewers

  • jcortes

Poem

In fields of code, macros bloom anew,
With actions and sources, the features grew!
Canned replies now dance and spin,
With polling and updates, let the flows begin.
🐇✨ From version bumps to macro delight,
This rabbit hops with code done right!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-17430

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@michelle0927 michelle0927 marked this pull request as ready for review July 28, 2025 20:24
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🔭 Outside diff range comments (2)
components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs (2)

60-65: Potential crash when optional nested objects are missing

message.source, message.sender, or message.receiver can be null/undefined for some channels (e.g. internal notes).
Direct property access (message.source.type) throws, causing the whole poll cycle to fail.

-      && (!this.sourceType || message.source.type === this.sourceType)
-      && (!this.sender || message.sender.email === this.sender)
-      && (!this.receiver || message.receiver.email === this.receiver);
+      && (!this.sourceType || message.source?.type === this.sourceType)
+      && (!this.sender || message.sender?.email === this.sender)
+      && (!this.receiver || message.receiver?.email === this.receiver);

67-71: Minor: guard against malformed events

event objects without a message field will throw inside isRelevant. Consider a simple guard:

-    const { message } = event;
-    if (this.isRelevant(message)) {
-      this.emitEvent(message);
+    const { message } = event ?? {};
+    if (message && this.isRelevant(message)) {
+      this.emitEvent(message);
     }
♻️ Duplicate comments (1)
components/gorgias_oauth/actions/update-macro/update-macro.mjs (1)

39-52: Same actions property type issue as create-macro.

The actions property has the same type definition confusion as the create-macro action. Consider applying the same fix to clarify the expected input format.

🧹 Nitpick comments (5)
components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs (1)

8-9: Drop the “New” prefix – follow source-naming guideline

Per Pipedream component guidelines (and past learnings), sources that emit updates should be named <Entity> Updated, not “New Updated ”.
Suggested:

-  name: "New Updated Ticket",
+  name: "Ticket Updated",
components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs (2)

11-12: Version bump looks good – please reflect it in CHANGELOG

The component’s semantic version has been incremented to 0.1.8, but there’s no accompanying CHANGELOG entry in the repository (or at least not in this PR). Adding it keeps consumers informed of the change.


51-54: Unused empty deploy() hook

An empty override silently shadows any logic that base.hooks.deploy might contain.
If no custom boot-time work is needed, simply omit the override to inherit the base behaviour; otherwise document why it’s intentionally empty.

   hooks: {
     ...base.hooks,
-    deploy() {},
+    // deploy() intentionally left blank – no bootstrap work required
   },
components/gorgias_oauth/actions/create-macro/create-macro.mjs (1)

32-45: Clarify the actions property type definition.

The actions property is defined as type: "string[]" but the description and example show JSON objects. This could confuse users about the expected input format. Consider updating the type to "string" with a note that it should be a JSON string array, or provide clearer documentation about the expected format.

   actions: {
-    type: "string[]",
+    type: "string",
     label: "Actions",
-    description: `A list of actions to be applied on tickets. [See the documentation](https://developers.gorgias.com/reference/create-macro) for more info.
+    description: `A JSON string array of actions to be applied on tickets. [See the documentation](https://developers.gorgias.com/reference/create-macro) for more info.
       \nExample: [{
components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs (1)

20-29: Consider using $ context for logging instead of console.log.

The error handling logic is sound, but consider using the execution context for logging instead of console.log for consistency with Pipedream logging practices.

   async getEventData(event) {
     try {
       return await this.gorgias_oauth.getMacro({
         id: event.object_id,
       });
     } catch (e) {
-      console.log(`Macro ${event.object_id} not found`);
+      // Macro not found - likely deleted after event was created
       return null;
     }
   },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28e91bb and fa68c7d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (25)
  • components/gorgias_oauth/actions/create-customer/create-customer.mjs (1 hunks)
  • components/gorgias_oauth/actions/create-macro/create-macro.mjs (1 hunks)
  • components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs (1 hunks)
  • components/gorgias_oauth/actions/create-ticket/create-ticket.mjs (1 hunks)
  • components/gorgias_oauth/actions/delete-macro/delete-macro.mjs (1 hunks)
  • components/gorgias_oauth/actions/get-ticket/get-ticket.mjs (1 hunks)
  • components/gorgias_oauth/actions/list-macros/list-macros.mjs (1 hunks)
  • components/gorgias_oauth/actions/list-tickets/list-tickets.mjs (1 hunks)
  • components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs (1 hunks)
  • components/gorgias_oauth/actions/update-customer/update-customer.mjs (1 hunks)
  • components/gorgias_oauth/actions/update-macro/update-macro.mjs (1 hunks)
  • components/gorgias_oauth/actions/update-ticket/update-ticket.mjs (1 hunks)
  • components/gorgias_oauth/common/constants.mjs (1 hunks)
  • components/gorgias_oauth/gorgias_oauth.app.mjs (2 hunks)
  • components/gorgias_oauth/package.json (2 hunks)
  • components/gorgias_oauth/sources/common/base-polling.mjs (1 hunks)
  • components/gorgias_oauth/sources/common/event-types.mjs (1 hunks)
  • components/gorgias_oauth/sources/internal-note-created/internal-note-created.mjs (1 hunks)
  • components/gorgias_oauth/sources/macro-updated/macro-updated.mjs (1 hunks)
  • components/gorgias_oauth/sources/macro-updated/test-event.mjs (1 hunks)
  • components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs (1 hunks)
  • components/gorgias_oauth/sources/new-macro-created/test-event.mjs (1 hunks)
  • components/gorgias_oauth/sources/ticket-created/ticket-created.mjs (1 hunks)
  • components/gorgias_oauth/sources/ticket-message-created/ticket-message-created.mjs (1 hunks)
  • components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (15)
components/gorgias_oauth/actions/update-customer/update-customer.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/gorgias_oauth/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/gorgias_oauth/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/gorgias_oauth/sources/ticket-updated/ticket-updated.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/gorgias_oauth/sources/common/event-types.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/gorgias_oauth/actions/create-customer/create-customer.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/gorgias_oauth/actions/create-ticket-message/create-ticket-message.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/gorgias_oauth/sources/macro-updated/test-event.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/gorgias_oauth/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/gorgias_oauth/sources/new-macro-created/test-event.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/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs (4)

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: #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.

components/gorgias_oauth/actions/update-macro/update-macro.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/gorgias_oauth/actions/create-macro/create-macro.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/gorgias_oauth/sources/common/base-polling.mjs (4)

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: #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: #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.

components/gorgias_oauth/sources/macro-updated/macro-updated.mjs (4)

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.

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.

🧬 Code Graph Analysis (5)
components/gorgias_oauth/actions/list-macros/list-macros.mjs (2)
components/gorgias_oauth/gorgias_oauth.app.mjs (2)
  • params (264-264)
  • macros (88-95)
components/gorgias_oauth/actions/update-macro/update-macro.mjs (1)
  • macro (55-58)
components/gorgias_oauth/actions/get-ticket/get-ticket.mjs (4)
components/gorgias_oauth/actions/create-macro/create-macro.mjs (1)
  • response (54-57)
components/gorgias_oauth/actions/delete-macro/delete-macro.mjs (1)
  • response (19-22)
components/gorgias_oauth/actions/update-macro/update-macro.mjs (1)
  • response (65-69)
components/gorgias_oauth/gorgias_oauth.app.mjs (1)
  • response (254-254)
components/gorgias_oauth/actions/update-macro/update-macro.mjs (3)
components/gorgias_oauth/actions/create-macro/create-macro.mjs (2)
  • data (48-53)
  • response (54-57)
components/gorgias_oauth/actions/delete-macro/delete-macro.mjs (1)
  • response (19-22)
components/gorgias_oauth/gorgias_oauth.app.mjs (1)
  • response (254-254)
components/gorgias_oauth/actions/create-macro/create-macro.mjs (3)
components/gorgias_oauth/actions/update-macro/update-macro.mjs (2)
  • data (59-64)
  • response (65-69)
components/gorgias_oauth/actions/delete-macro/delete-macro.mjs (1)
  • response (19-22)
components/gorgias_oauth/gorgias_oauth.app.mjs (1)
  • response (254-254)
components/gorgias_oauth/actions/delete-macro/delete-macro.mjs (4)
components/gorgias_oauth/actions/create-macro/create-macro.mjs (1)
  • response (54-57)
components/gorgias_oauth/actions/get-ticket/get-ticket.mjs (1)
  • response (20-23)
components/gorgias_oauth/actions/update-macro/update-macro.mjs (1)
  • response (65-69)
components/gorgias_oauth/gorgias_oauth.app.mjs (1)
  • response (254-254)
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (30)
components/gorgias_oauth/sources/ticket-updated/ticket-updated.mjs (1)

10-10: Confirm accompanying changelog / dependency bumps

The version bump to 0.1.8 is fine in isolation, but please ensure the change is reflected in:
CHANGELOG.md (or equivalent)
• Any package‐level manifest/version aggregation (e.g. index.js, app definition)

This keeps automated release tooling and user docs in sync.

components/gorgias_oauth/sources/internal-note-created/internal-note-created.mjs (1)

10-10: Version bump acknowledged – LGTM

No functional changes introduced in this module. The version bump to 0.0.2 stays consistent with the coordinated release.

components/gorgias_oauth/actions/create-ticket/create-ticket.mjs (1)

7-7: Minor version bump only – looks good

Create Ticket action is now v0.0.8; no logic modifications detected.

components/gorgias_oauth/package.json (1)

3-3: Confirm compatibility with @pipedream/platform v3
We’ve bumped @pipedream/platform from ^2^3.1.0. Please verify that no v2-only or deprecated SDK methods remain in use and that all components still build and run correctly. Our quick import scan surfaced these files:

  • components/gorgias_oauth/gorgias_oauth.app.mjs
  • components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs
  • components/gorgias_oauth/actions/update-customer/update-customer.mjs
  • components/gorgias_oauth/sources/common/base-polling.mjs

• Ensure none of these use removed or renamed APIs.
• Run your CI/build/test suite to confirm everything works under v3.1.0.

components/gorgias_oauth/sources/ticket-created/ticket-created.mjs (1)

10-10: Ticket source version bump ok

New Ticket source moves to v0.1.8; no additional changes.

components/gorgias_oauth/actions/create-customer/create-customer.mjs (1)

8-8: Create Customer version bump ok

Action incremented to v0.0.7; implementation unchanged.

components/gorgias_oauth/actions/update-customer/update-customer.mjs (1)

13-13: Version bump looks correct

Only the version field changed from 0.0.60.0.7. No functional impact detected. 👍

components/gorgias_oauth/actions/retrieve-customer/retrieve-customer.mjs (1)

7-7: Version bump looks correct

version updated to 0.0.7, consistent with related customer actions. No further changes. 👍

components/gorgias_oauth/actions/update-ticket/update-ticket.mjs (1)

8-8: Version bump looks correct

Increment to 0.0.4 aligns with ticket-related actions. No logic affected. 👍

components/gorgias_oauth/actions/list-tickets/list-tickets.mjs (1)

7-7: Version bump looks correct

version moved to 0.0.8. Matches coordinated release. 👍

components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs (1)

10-10: Version bump looks correct

Updated to 0.0.4; no functional changes. 👍

components/gorgias_oauth/sources/common/event-types.mjs (1)

9-11: LGTM! Macro event types follow established patterns.

The new macro-related event types are consistently named and follow the existing kebab-case convention for string values. These additions align perfectly with the PR's objective of implementing comprehensive macro management functionality.

components/gorgias_oauth/sources/new-macro-created/test-event.mjs (1)

1-13: LGTM! Well-structured test event for macro creation.

The test event provides a realistic representation of a newly created macro with appropriate field types and values. The empty actions array is appropriate for a new macro, and the timestamp format follows ISO standards with timezone information.

components/gorgias_oauth/sources/macro-updated/test-event.mjs (1)

1-22: LGTM! Comprehensive test event for macro updates.

The test event effectively demonstrates an updated macro with a populated actions array containing a realistic "addTags" action. The updated_datetime field being populated and the configured intent and language fields appropriately represent a macro that has been modified after creation.

components/gorgias_oauth/common/constants.mjs (2)

103-128: LGTM! Comprehensive macro intents with logical categorization.

The macroIntents array provides excellent coverage of customer service scenarios with a consistent category/action naming pattern. The intents span common e-commerce use cases including orders, returns, shipping, subscriptions, and general inquiries.


134-134: LGTM! Proper export of new constant.

The macroIntents constant is correctly added to the default export object, maintaining consistency with the existing export structure.

components/gorgias_oauth/actions/list-macros/list-macros.mjs (3)

1-23: LGTM! Well-structured action definition.

The action definition follows established patterns with proper imports, metadata, and prop definitions. The optional search parameter and limit prop using propDefinition are appropriately configured.


24-38: LGTM! Proper pagination implementation.

The pagination logic correctly uses the paginate utility method and accumulates results in an array. This approach handles large result sets efficiently by streaming through paginated responses.


40-44: LGTM! Correct pluralization and summary formatting.

The pluralization logic correctly handles both singular and plural cases for the summary message, following the established pattern from other actions. The summary message format aligns with platform conventions.

components/gorgias_oauth/actions/get-ticket/get-ticket.mjs (1)

1-27: LGTM! Clean and consistent implementation.

The action follows established patterns from other Gorgias OAuth actions, correctly uses the propDefinition for ticketId, and implements proper error context passing with $. The implementation is straightforward and consistent with the codebase standards.

components/gorgias_oauth/actions/create-macro/create-macro.mjs (1)

47-60: LGTM! Proper data construction and API call pattern.

The data object construction and API call follow the established patterns. The use of parseObject to handle the actions input and the response handling are implemented correctly.

components/gorgias_oauth/actions/delete-macro/delete-macro.mjs (1)

1-26: LGTM! Clean delete action implementation.

The action follows the established patterns, properly uses the propDefinition for macroId, and implements the delete operation correctly. The implementation is minimal and focused, which is appropriate for a delete action.

components/gorgias_oauth/sources/new-macro-created/new-macro-created.mjs (1)

1-32: LGTM! Well-structured event source implementation.

The source properly extends the base polling source, uses appropriate event types and deduplication settings, and handles the scenario where a macro might not be found (likely due to deletion after the event was created). The overall structure follows established patterns.

components/gorgias_oauth/sources/common/base-polling.mjs (3)

44-52: LGTM! Abstract method pattern correctly implemented.

The abstract methods (getTsKey, getEventType, getEventData) properly throw ConfigurationError when not implemented, enforcing that subclasses must provide these implementations. This follows the established pattern seen in other Pipedream components.


19-35: Event processing logic is well-structured.

The processEvent method correctly:

  • Fetches events with proper ordering (desc) and filtering by type
  • Processes events asynchronously with Promise.all for performance
  • Filters out null events (for cases where getEventData returns null)
  • Emits events in chronological order using reverse()

36-43: Event emission logic is correctly implemented.

The emitEvent method properly:

  • Generates unique event IDs combining object ID and timestamp
  • Uses the timestamp key from the abstract method
  • Creates descriptive summaries with event type and ID
components/gorgias_oauth/sources/macro-updated/macro-updated.mjs (2)

14-19: Abstract method implementations are correct.

The implementations properly override the base class methods:

  • getEventType() returns "macro-updated" for event filtering
  • getTsKey() returns "updated_datetime" for timestamp extraction

20-32: Smart event filtering and error handling.

The getEventData method implements good logic:

  • Filters out events where created_datetime === updated_datetime to avoid emitting creation events as updates
  • Properly handles errors when fetching macro details, logging the issue and returning null to prevent emission
  • Uses the app's getMacro method for consistent API interaction
components/gorgias_oauth/gorgias_oauth.app.mjs (2)

83-106: macroId prop definition follows established patterns.

The macroId prop definition correctly implements:

  • Async options loading with pagination support via prevContext.nextCursor
  • Proper mapping of macro data to label/value format
  • Consistent structure with other ID prop definitions in the file

437-479: Macro CRUD methods are well-implemented.

All five macro methods follow excellent patterns:

  • Consistent parameter destructuring and method signatures
  • Proper use of the _makeRequest helper for API calls
  • Correct HTTP methods (GET, POST, PUT, DELETE) for REST operations
  • Standard endpoint patterns (/macros, /macros/{id})
  • Consistent with existing methods in the app

@vunguyenhung vunguyenhung merged commit 8b79b7f into master Jul 29, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the issue-17430 branch July 29, 2025 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gorgias

3 participants