Skip to content

Conversation

@luancazarine
Copy link
Collaborator

@luancazarine luancazarine commented Nov 10, 2025

Resolves #12502

Summary by CodeRabbit

  • New Features

    • Added Ticket Source actions: Create Customer, List Customers, Get Booking, Get Event, List Events, List Bookings for Date
    • Dynamic field selection for events, dates, and bookings (live option lists)
    • Improved pagination to stream and aggregate large result sets
    • Customer creation and additional API-backed listing/retrieval methods
  • Chores

    • Ticket Source package bumped to 0.1.0

…or creating customers, retrieving events, bookings, and listing customers and events. Introduced pagination for customer and event retrieval, and added constants for limiting results.
@luancazarine luancazarine linked an issue Nov 10, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Nov 12, 2025 5:36pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 12, 2025 5:36pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds a Ticket Source integration: six new action modules, a pagination constant, an expanded app module with HTTP helpers, dynamic propDefinitions, API methods and a paginate generator, and bumps the package version and dependency.

Changes

Cohort / File(s) Summary
Action modules
components/ticket_source/actions/create-customer/create-customer.mjs, components/ticket_source/actions/get-booking/get-booking.mjs, components/ticket_source/actions/get-event/get-event.mjs, components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs, components/ticket_source/actions/list-customers/list-customers.mjs, components/ticket_source/actions/list-events/list-events.mjs
Six new action files exporting default action objects (metadata, props, type) with async run implementations that call corresponding methods on ticketSource, handle pagination where applicable, export $summary, and return API responses.
Constants
components/ticket_source/common/constants.mjs
Adds export const LIMIT = 100 for pagination control.
App module
components/ticket_source/ticket_source.app.mjs
Adds propDefinitions (eventId, eventDate, bookingId), HTTP helpers (_baseUrl, _headers, _makeRequest), public API methods (listEvents, getEvent, listEventDates, listBookingsForDate, getBooking, listCustomers, createCustomer), and an async paginate generator.
Package config
components/ticket_source/package.json
Bumps version 0.0.10.1.0 and adds dependency "@pipedream/platform": "^3.1.1".

Sequence Diagram(s)

sequenceDiagram
    participant Action as Action Module
    participant App as ticket_source.app
    participant API as TicketSource API

    Action->>App: call method (e.g., listEvents, getEvent, createCustomer) with {$, params}
    App->>App: prepare request (_baseUrl, _headers) and call _makeRequest
    App->>API: HTTP request (GET/POST)
    API-->>App: Response (single or paginated)
    alt Paginated
        App->>App: paginate(fn, params, maxResults)
        loop pages
            App->>API: Fetch page
            API-->>App: Page data
        end
    end
    App-->>Action: Return response data
    Action->>Action: $.export("$summary", message)
    Action-->>User: Return aggregated result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to:
    • components/ticket_source/ticket_source.app.mjs: _makeRequest implementation, header/auth handling, and error paths.
    • paginate generator correctness and use of LIMIT.
    • components/ticket_source/actions/create-customer/create-customer.mjs: payload mapping and optional fields/consent flags.
    • Dynamic propDefinitions for eventId, eventDate, and bookingId.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 2 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description only contains 'Resolves #12502' and lacks substantive details about the changes, objectives, implementation approach, or testing performed. Expand the description to explain what was implemented (new Ticket Source component with actions), why it was added, and any relevant implementation details or testing performed.
Title check ❓ Inconclusive The title '12502 components ticket source' is partially related to the changeset - it references the issue number and component name, but lacks clarity about the main change being the creation of a new Ticket Source integration. Consider revising the title to be more descriptive of the primary change, such as 'Add Ticket Source integration component with CRUD actions' or similar.
Linked Issues check ❓ Inconclusive The linked issue #12502 provides only a title and reference URL without specific coding requirements, making it impossible to validate whether all stated objectives were met. Add detailed coding requirements or acceptance criteria to issue #12502, or verify that the implementation aligns with the Ticketsource API documentation referenced.
✅ Passed checks (2 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All changes appear focused on implementing the Ticket Source integration component with related actions, props, and API methods without introducing unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Comment @coderabbitai help to get the list of available commands and usage tips.

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: 4

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62c454f and 1af8492.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • components/ticket_source/actions/create-customer/create-customer.mjs (1 hunks)
  • components/ticket_source/actions/get-booking/get-booking.mjs (1 hunks)
  • components/ticket_source/actions/get-event/get-event.mjs (1 hunks)
  • components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs (1 hunks)
  • components/ticket_source/actions/list-customers/list-customers.mjs (1 hunks)
  • components/ticket_source/actions/list-events/list-events.mjs (1 hunks)
  • components/ticket_source/common/constants.mjs (1 hunks)
  • components/ticket_source/package.json (2 hunks)
  • components/ticket_source/ticket_source.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2025-10-17T06:58:24.577Z
Learnt from: sergio-eliot-rodriguez
Repo: PipedreamHQ/pipedream PR: 18787
File: components/ticketsauce/ticketsauce.app.mjs:7-30
Timestamp: 2025-10-17T06:58:24.577Z
Learning: The TicketSauce "List of Events" API endpoint (GET /v2/events) does not support pagination and returns all events. Users can filter the data using the available query parameters (partner_id, organization_id, etc.) rather than paginating through results.

Applied to files:

  • components/ticket_source/actions/list-events/list-events.mjs
  • components/ticket_source/ticket_source.app.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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`.

Applied to files:

  • components/ticket_source/actions/list-customers/list-customers.mjs
📚 Learning: 2024-10-30T15:24:39.294Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream 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".

Applied to files:

  • components/ticket_source/actions/create-customer/create-customer.mjs
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
Repo: PipedreamHQ/pipedream 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.

Applied to files:

  • components/ticket_source/package.json
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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.

Applied to files:

  • components/ticket_source/ticket_source.app.mjs
🧬 Code graph analysis (7)
components/ticket_source/actions/list-events/list-events.mjs (2)
components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs (1)
  • response (33-37)
components/ticket_source/actions/list-customers/list-customers.mjs (1)
  • response (24-28)
components/ticket_source/actions/list-customers/list-customers.mjs (2)
components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs (1)
  • response (33-37)
components/ticket_source/actions/list-events/list-events.mjs (1)
  • response (24-28)
components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs (2)
components/ticket_source/actions/list-customers/list-customers.mjs (1)
  • response (24-28)
components/ticket_source/actions/list-events/list-events.mjs (1)
  • response (24-28)
components/ticket_source/actions/get-booking/get-booking.mjs (2)
components/ticket_source/actions/create-customer/create-customer.mjs (1)
  • response (107-137)
components/ticket_source/actions/get-event/get-event.mjs (1)
  • response (24-27)
components/ticket_source/actions/get-event/get-event.mjs (2)
components/ticket_source/actions/create-customer/create-customer.mjs (1)
  • response (107-137)
components/ticket_source/actions/get-booking/get-booking.mjs (1)
  • response (42-45)
components/ticket_source/actions/create-customer/create-customer.mjs (3)
components/ticket_source/actions/get-booking/get-booking.mjs (1)
  • response (42-45)
components/ticket_source/actions/get-event/get-event.mjs (1)
  • response (24-27)
components/ticket_source/actions/list-customers/list-customers.mjs (1)
  • response (24-28)
components/ticket_source/ticket_source.app.mjs (1)
components/ticket_source/common/constants.mjs (2)
  • LIMIT (1-1)
  • LIMIT (1-1)
⏰ 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: Lint Code Base
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
🔇 Additional comments (10)
components/ticket_source/package.json (1)

3-3: LGTM!

The version bump to 0.1.0 and the addition of the @pipedream/platform dependency are appropriate for this initial feature release.

Also applies to: 14-17

components/ticket_source/common/constants.mjs (1)

1-1: LGTM!

The pagination limit constant is properly defined and the value of 100 is reasonable.

components/ticket_source/actions/get-booking/get-booking.mjs (1)

3-50: LGTM!

The action implementation is clean with properly chained prop dependencies and a clear summary message.

components/ticket_source/actions/list-customers/list-customers.mjs (1)

3-40: LGTM!

The pagination implementation and pluralization logic are correct and follow established patterns.

components/ticket_source/actions/list-events/list-events.mjs (1)

3-40: LGTM!

The implementation follows the same consistent pagination pattern as other list actions with proper pluralization.

components/ticket_source/actions/get-event/get-event.mjs (1)

3-31: LGTM!

The action implementation is straightforward and follows the expected pattern for GET operations.

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

138-138: Remove the concern—TicketSource API guarantees response.id exists.

The TicketSource Create Customer API response follows JSON:API format with a top-level "data" object containing "id", "type" ("customer"), "attributes", and "links". After destructuring (const { data: response } = ...), the response variable contains this object with the id field guaranteed to be present. The code correctly accesses response.id in the summary export.

components/ticket_source/ticket_source.app.mjs (3)

1-2: LGTM!

The imports are appropriate for this integration. The axios helper from @pipedream/platform and the LIMIT constant for pagination are correctly referenced.


72-89: LGTM! Solid HTTP abstraction layer.

The _baseUrl, _headers, and _makeRequest methods provide a clean, reusable foundation for API calls. The Bearer token authentication is correctly implemented using this.$auth.api_key, and the axios wrapper properly combines the base URL, headers, and additional options.


90-140: LGTM! Well-structured API methods.

All seven API methods follow a consistent pattern and correctly delegate to _makeRequest. The RESTful path conventions are appropriate, and the createCustomer method correctly specifies method: "POST". The destructuring of path parameters (e.g., eventId, bookingId) with spread opts provides good flexibility.

luancazarine and others added 3 commits November 10, 2025 20:34
…ookings-for-date.mjs

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…number by 1 for event, event dates, and bookings retrieval.
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: 1

♻️ Duplicate comments (1)
components/ticket_source/ticket_source.app.mjs (1)

141-166: Optimize pagination termination condition using TicketSource's links metadata.

The pagination logic at line 163 sets hasMore = data.length, which continues whenever any data exists. This causes an unnecessary API call when the last page contains exactly LIMIT (100) items—the loop fetches again to discover an empty result.

TicketSource API responses include a links object with next/prev navigation (next is null if no next page) and a meta object with pagination details, so the paginate function should leverage this instead:

-      const { data } = await fn({
+      const { data, links } = await fn({
         params,
         ...opts,
       });
       for (const d of data) {
         yield d;

         if (maxResults && ++count === maxResults) {
           return count;
         }
       }

-      hasMore = data.length;
+      hasMore = links?.next !== null;

Alternatively, if metadata is unavailable, use hasMore = data.length === LIMIT; but verify this matches the API's actual pagination behavior.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1af8492 and 52d975a.

📒 Files selected for processing (2)
  • components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs (1 hunks)
  • components/ticket_source/ticket_source.app.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2024-07-04T18:11:59.822Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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`.

Applied to files:

  • components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs
📚 Learning: 2025-06-04T17:52:05.780Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream 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.

Applied to files:

  • components/ticket_source/ticket_source.app.mjs
📚 Learning: 2024-10-08T15:33:38.240Z
Learnt from: LucBerge
Repo: PipedreamHQ/pipedream PR: 14080
File: components/nocodb/nocodb.app.mjs:133-133
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When implementing pagination with an offset, incrementing `args.params.offset` within the loop ensures correct tracking of the offset, particularly when a maximum count limit (`max`) is used.

Applied to files:

  • components/ticket_source/ticket_source.app.mjs
📚 Learning: 2025-10-17T06:58:24.577Z
Learnt from: sergio-eliot-rodriguez
Repo: PipedreamHQ/pipedream PR: 18787
File: components/ticketsauce/ticketsauce.app.mjs:7-30
Timestamp: 2025-10-17T06:58:24.577Z
Learning: The TicketSauce "List of Events" API endpoint (GET /v2/events) does not support pagination and returns all events. Users can filter the data using the available query parameters (partner_id, organization_id, etc.) rather than paginating through results.

Applied to files:

  • components/ticket_source/ticket_source.app.mjs
🧬 Code graph analysis (2)
components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs (2)
components/ticket_source/actions/list-customers/list-customers.mjs (1)
  • response (24-28)
components/ticket_source/actions/list-events/list-events.mjs (1)
  • response (24-28)
components/ticket_source/ticket_source.app.mjs (1)
components/ticket_source/common/constants.mjs (2)
  • LIMIT (1-1)
  • LIMIT (1-1)
⏰ 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: Lint Code Base
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (4)
components/ticket_source/actions/list-bookings-for-date/list-bookings-for-date.mjs (1)

44-46: LGTM! Pluralization correctly implemented.

The conditional pluralization follows the established pattern from other list actions and provides clean, grammatically correct summary messages.

components/ticket_source/ticket_source.app.mjs (3)

1-3: LGTM! Clean imports.

The imports are appropriate: axios for HTTP requests and LIMIT constant for pagination configuration.


7-70: LGTM! Well-structured propDefinitions with proper dependency chain.

The three propDefinitions (eventId → eventDate → bookingId) correctly implement dynamic options with appropriate dependencies. The page + 1 offset correctly translates Pipedream's 0-indexed pagination to the API's 1-indexed pagination.


72-140: LGTM! Consistent API method implementations.

The HTTP abstraction layer and API methods follow a clean, consistent pattern. Authorization headers are properly configured, and path construction is correct for all endpoints.

michelle0927
michelle0927 previously approved these changes Nov 11, 2025
Copy link
Collaborator

@michelle0927 michelle0927 left a comment

Choose a reason for hiding this comment

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

LGTM!

@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test reports

@luancazarine
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 11446b8 into master Nov 12, 2025
10 checks passed
@michelle0927 michelle0927 deleted the 12502-components-ticket_source branch November 12, 2025 19:10
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.

[Components] ticket_source

4 participants