Skip to content

New Components - channable #17630

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

Merged
merged 5 commits into from
Jul 16, 2025
Merged

New Components - channable #17630

merged 5 commits into from
Jul 16, 2025

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 15, 2025

Resolves #17463

Summary by CodeRabbit

  • New Features

    • Added the ability to list stock updates with filtering and pagination options for Channable integration.
    • Introduced an action to update stock updates, allowing modification of stock quantity, title, and GTIN.
    • Implemented new event sources to emit events when a stock update is created or updated.
    • Added a structured polling mechanism for fetching and emitting updated resources.
    • Enhanced API client with robust pagination and dynamic property options for improved data retrieval.
  • Chores

    • Updated package version and dependencies for improved compatibility and stability.

Copy link

vercel bot commented Jul 15, 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 16, 2025 2:44pm
pipedream-docs ⬜️ Ignored (Inspect) Jul 16, 2025 2:44pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Jul 16, 2025 2:44pm

Copy link
Contributor

coderabbitai bot commented Jul 15, 2025

Walkthrough

This update introduces a comprehensive Channable integration, adding new action modules for listing and updating stock updates, a robust API client with pagination support, and new source modules for emitting events on stock update creation and modification. The package metadata and dependencies are also updated, and a reusable polling base for sources is implemented.

Changes

Files/Paths Change Summary
components/channable/actions/list-stock-updates/list-stock-updates.mjs Added new action to list stock updates with filtering and pagination.
components/channable/actions/update-stock-update/update-stock-update.mjs Added new action to update a stock update entry via the API.
components/channable/channable.app.mjs Implemented full API client: request helpers, pagination, stock update methods, and dynamic property options.
components/channable/sources/common/base.mjs Introduced a reusable base module for polling sources with timestamp tracking and event emission.
components/channable/sources/new-stock-update-created/new-stock-update-created.mjs Added new source to emit events for new stock update creations.
components/channable/sources/stock-update-updated/stock-update-updated.mjs Added new source to emit events when a stock update is modified.
components/channable/package.json Updated version to 0.1.0, added dependency on "@pipedream/platform", fixed JSON structure.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action/Source
    participant ChannableApp
    participant ChannableAPI

    User->>Action/Source: Trigger action/source (e.g., list, update, poll)
    Action/Source->>ChannableApp: Call method (e.g., listStockUpdates, updateStockUpdate)
    ChannableApp->>ChannableAPI: Make HTTP request (GET/POST)
    ChannableAPI-->>ChannableApp: Return API response
    ChannableApp-->>Action/Source: Return processed data
    Action/Source-->>User: Emit event or return result
Loading

Assessment against linked issues

Objective Addressed Explanation
Add actions: Fetch current stock levels, Post stock update (Issue #17463)
Add sources: stock update received, stock update failed (Issue #17463) Only sources for "stock update created" and "stock update updated" are present.
Add action: Bulk update stock (Issue #17463) No action for bulk updating stock is implemented in the provided changes.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of polling base module for sources (components/channable/sources/common/base.mjs) The base module is a reusable utility and not explicitly required by the objectives, but is supportive.
Update of package.json version and dependencies (components/channable/package.json) Package metadata changes are not specified in the objectives but are standard for new functionality.

Poem

In the warren where code bunnies hop,
New stock updates leap nonstop!
With actions and sources, our carrots abound,
Polling and posting, events all around.
Channable’s garden is now in bloom—
🥕🐇 Techy rabbits cheer, “More features soon!”

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/memento_database/memento_database.app.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)

components/robopost/robopost.app.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:255:9)
at packageResolve (node:internal/modules/esm/resolve:767:81)
at moduleResolve (node:internal/modules/esm/resolve:853:18)
at defaultResolve (node:internal/modules/esm/resolve:983:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:801:12)
at #cachedDefaultResolve (node:internal/modules/esm/loader:725:25)
at ModuleLoader.resolve (node:internal/modules/esm/loader:708:38)
at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:309:38)
at #link (node:internal/modules/esm/module_job:202:49)


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cb6b9ff and 6dfb042.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • components/memento_database/memento_database.app.mjs (1 hunks)
  • components/robopost/robopost.app.mjs (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • components/robopost/robopost.app.mjs
  • components/memento_database/memento_database.app.mjs
⏰ 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: Lint Code Base
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
✨ Finishing Touches
  • 📝 Generate Docstrings

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

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

🧹 Nitpick comments (1)
components/channable/channable.app.mjs (1)

52-58: Consider renaming method for clarity

The method name updateStockUpdate is redundant. Based on the POST method and endpoint path, this appears to create stock updates.

Consider renaming to createStockUpdate:

-    updateStockUpdate(opts = {}) {
+    createStockUpdate(opts = {}) {
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between af19436 and 1002f2c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • components/channable/actions/list-stock-updates/list-stock-updates.mjs (1 hunks)
  • components/channable/actions/update-stock-update/update-stock-update.mjs (1 hunks)
  • components/channable/channable.app.mjs (1 hunks)
  • components/channable/package.json (2 hunks)
  • components/channable/sources/common/base.mjs (1 hunks)
  • components/channable/sources/new-stock-update-created/new-stock-update-created.mjs (1 hunks)
  • components/channable/sources/stock-update-updated/stock-update-updated.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
components/channable/package.json (2)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#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.
Learnt from: js07
PR: PipedreamHQ/pipedream#17375
File: components/zerobounce/actions/get-validation-results-file/get-validation-results-file.mjs:23-27
Timestamp: 2025-07-01T17:07:48.193Z
Learning: "dir" props in Pipedream components are hidden in the component form and not user-facing, so they don't require labels or descriptions for user clarity.
components/channable/sources/new-stock-update-created/new-stock-update-created.mjs (4)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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/channable/sources/stock-update-updated/stock-update-updated.mjs (4)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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/channable/sources/common/base.mjs (4)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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/channable/channable.app.mjs (3)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: The Salesloft API list endpoints (listPeople, listCadences, listUsers, listAccounts) return arrays directly in the response body, not wrapped in a metadata object with a nested data property. The _makeRequest method correctly returns response.data which contains the arrays that can be mapped over directly in propDefinitions.
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#13961
File: components/fakturoid/actions/create-invoice/create-invoice.mjs:95-99
Timestamp: 2024-10-15T15:07:38.361Z
Learning: An "object array" type is not yet supported for Pipedream props.
components/channable/actions/list-stock-updates/list-stock-updates.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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/channable/actions/update-stock-update/update-stock-update.mjs (2)
Learnt from: GTFalcao
PR: PipedreamHQ/pipedream#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: PipedreamHQ/pipedream#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`.
🔇 Additional comments (10)
components/channable/package.json (2)

3-3: Version increment is appropriate for new features.

The version bump from 0.0.1 to 0.1.0 correctly reflects the introduction of new functionality in this Channable integration.


15-16: Dependency addition is correct.

The "@pipedream/platform" dependency is properly added and necessary for the new integration features.

components/channable/actions/list-stock-updates/list-stock-updates.mjs (1)

37-55: Well-implemented action with proper pagination and summary.

The action correctly:

  • Uses getPaginatedResources for handling pagination
  • Maps parameters appropriately (camelCase to snake_case)
  • Provides a properly formatted summary message
  • Returns the paginated results

The implementation follows Pipedream best practices.

components/channable/actions/update-stock-update/update-stock-update.mjs (1)

33-47: Correct implementation of stock update functionality.

The action properly:

  • Uses propDefinition for stockUpdateId selection
  • Structures the API call with data as an array
  • Provides a clear summary message
  • Returns the API response

The implementation follows Pipedream patterns correctly.

components/channable/sources/common/base.mjs (3)

17-26: Proper timestamp tracking implementation.

The timestamp persistence methods are correctly implemented using the database service for state management.


27-65: Well-structured event processing with pagination.

The processEvent method correctly:

  • Retrieves and updates timestamp state
  • Uses pagination to fetch all results
  • Tracks maximum timestamp across items
  • Handles item limiting when max is specified
  • Emits events with proper metadata

The implementation follows good patterns for polling sources.


66-74: Correct abstract method implementation.

The abstract methods properly throw ConfigurationError when not implemented, following the pattern from retrieved learnings for base classes that require subclass implementation.

components/channable/sources/new-stock-update-created/new-stock-update-created.mjs (1)

11-26: Proper implementation of abstract methods.

The source correctly implements all required abstract methods:

  • getResourceFn() returns the appropriate app method
  • getTsField() returns "created" for new items
  • generateMeta() provides proper event metadata

The implementation follows the base class contract correctly.

components/channable/sources/stock-update-updated/stock-update-updated.mjs (1)

1-28: Implementation looks solid!

The source module is well-structured with proper event deduplication and metadata generation. The use of the common base pattern promotes code reuse and consistency.

components/channable/channable.app.mjs (1)

11-22: API response structure verified
listStockUpdates returns an object with an offers array, so the destructuring { offers } is correct. No changes needed.

GTFalcao
GTFalcao previously approved these changes Jul 15, 2025
Copy link
Collaborator

@GTFalcao GTFalcao left a comment

Choose a reason for hiding this comment

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

LGTM!

@michelle0927
Copy link
Collaborator Author

/approve

@michelle0927 michelle0927 merged commit 307085b into master Jul 16, 2025
11 checks passed
@michelle0927 michelle0927 deleted the issue-17463 branch July 16, 2025 17:22
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.

Channable
2 participants