Skip to content

[Components] momentum_ams #17276 #17507

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

[Components] momentum_ams #17276 #17507

wants to merge 4 commits into from

Conversation

lcaresia
Copy link
Collaborator

@lcaresia lcaresia commented Jul 7, 2025

WHY

Summary by CodeRabbit

  • New Features
    • Added ability to retrieve client data with filtering and pagination options.
    • Introduced functionality to insert notes with customizable fields such as subject, creator name, type, and visibility.
    • Added actions to get individual client details by ID.
  • Improvements
    • Enhanced app with structured input properties and streamlined authenticated API interactions.
  • Chores
    • Updated package version and dependencies.

@lcaresia lcaresia linked an issue Jul 7, 2025 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Jul 7, 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

New action modules for retrieving clients and inserting notes into the Momentum AMS system were added. The main app module was extended with detailed property definitions and API methods for client retrieval and note insertion, centralizing HTTP requests and OAuth authentication. The package metadata was updated with a version bump and a new dependency.

Changes

File(s) Change Summary
components/momentum_ams/actions/get-clients/get-clients.mjs Added "Get Clients" action module for retrieving client data with pagination/filtering support.
components/momentum_ams/actions/get-client/get-client.mjs Added "Get Client" action module for retrieving a client by specified ID.
components/momentum_ams/actions/insert-note/insert-note.mjs Added "Insert Note" action module for inserting notes with various input properties.
components/momentum_ams/momentum_ams.app.mjs Added property definitions and API methods for client retrieval and note insertion; centralized HTTP requests and OAuth handling.
components/momentum_ams/package.json Updated version to 0.1.0, added @pipedream/platform dependency, fixed publishConfig syntax.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GetClientsAction
    participant App
    participant MomentumAMSAPI

    User->>GetClientsAction: Trigger "Get Clients"
    GetClientsAction->>App: getClient(id, context)
    App->>MomentumAMSAPI: GET /InsuredList({id}) with OAuth token
    MomentumAMSAPI-->>App: Client data response
    App-->>GetClientsAction: Client data
    GetClientsAction-->>User: Return client data summary
Loading
sequenceDiagram
    participant User
    participant GetClientAction
    participant App
    participant MomentumAMSAPI

    User->>GetClientAction: Trigger "Get Client" with ID
    GetClientAction->>App: getClient(id, context)
    App->>MomentumAMSAPI: GET /InsuredList({id}) with OAuth token
    MomentumAMSAPI-->>App: Client data response
    App-->>GetClientAction: Client data
    GetClientAction-->>User: Return client data summary
Loading
sequenceDiagram
    participant User
    participant InsertNoteAction
    participant App
    participant MomentumAMSAPI

    User->>InsertNoteAction: Trigger "Insert Note"
    InsertNoteAction->>App: insertNote(noteData)
    App->>MomentumAMSAPI: POST /Zapier/InsertNote with noteData and OAuth token
    MomentumAMSAPI-->>App: Insert confirmation
    App-->>InsertNoteAction: Insert result
    InsertNoteAction-->>User: Return note insertion summary
Loading

Poem

A hop, a skip, two actions new,
Clients fetched and notes slipped through.
With OAuth keys and data neat,
The bunny’s code is now complete.
Version bumped, dependencies grow,
Momentum AMS, let’s hop—let’s go!
🐇✨


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.

@lcaresia lcaresia self-assigned this Jul 7, 2025
Copy link

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

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/momentum_ams/actions/insert-note/insert-note.mjs (1)

11-46: Consider simplifying the prop structure for better UX.

The action includes pagination props (count, orderby, skip, top) that are only used to populate the id dropdown options. While functionally correct, this creates unnecessary complexity in the action interface for end users.

Consider one of these approaches:

  1. Use default values for pagination in the id prop's options method
  2. Create a separate helper method to abstract the pagination complexity
  3. Move pagination props to an advanced/optional section

This would simplify the user experience while maintaining the same functionality.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 65d964b and 7404196.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • components/momentum_ams/actions/get-clients/get-clients.mjs (1 hunks)
  • components/momentum_ams/actions/insert-note/insert-note.mjs (1 hunks)
  • components/momentum_ams/momentum_ams.app.mjs (1 hunks)
  • components/momentum_ams/package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
components/momentum_ams/package.json (1)
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.
components/momentum_ams/actions/insert-note/insert-note.mjs (1)
Learnt from: jcortes
PR: PipedreamHQ/pipedream#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/momentum_ams/actions/get-clients/get-clients.mjs (3)
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`.
Learnt from: jcortes
PR: PipedreamHQ/pipedream#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/momentum_ams/momentum_ams.app.mjs (1)
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.
⏰ 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: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: pnpm publish
  • GitHub Check: Lint Code Base
🔇 Additional comments (7)
components/momentum_ams/package.json (1)

3-3: LGTM! Appropriate version bump and dependency addition.

The version bump to 0.1.0 and the addition of the @pipedream/platform dependency are appropriate for this new component release. The dependency is correctly used in the main app module for axios functionality.

Also applies to: 14-17

components/momentum_ams/actions/get-clients/get-clients.mjs (1)

1-56: LGTM! Clean implementation following Pipedream patterns.

The action correctly implements the standard Pipedream structure with proper prop definitions, method calls, and summary formatting. The integration with the app module is well-structured.

components/momentum_ams/momentum_ams.app.mjs (5)

1-1: LGTM! Correct import for axios functionality.

The import statement correctly uses the @pipedream/platform package for axios, which aligns with the dependency added in package.json.


6-78: Well-structured propDefinitions with comprehensive coverage.

The propDefinitions provide a complete set of properties for note management and client operations. The async options method for the id property correctly implements dynamic client selection with proper parameter passing.


80-98: Proper implementation of authenticated requests.

The _baseUrl and _makeRequest methods correctly implement the API communication pattern with OAuth authentication. The Authorization header format is appropriate for bearer token authentication.


106-127: API methods follow consistent patterns.

The getClient and getClients methods properly implement the API communication with appropriate parameter handling. The OData query parameters ($count, $orderby, $skip, $top) are correctly formatted for the API endpoints.


100-105: Specify HTTP method for insertNote and confirm with API docs

The insertNote call in components/momentum_ams/momentum_ams.app.mjs currently defaults to GET. For data-insertion endpoints you should explicitly set the method (usually POST). Please verify against the Momentum AMS API spec and, if POST is correct, update as follows:

• File: components/momentum_ams/momentum_ams.app.mjs
• Lines: 100–105

     async insertNote(args = {}) {
-      return this._makeRequest({
-        path: "/InsertNote",
-        ...args,
-      });
+      return this._makeRequest({
+        method: "POST",
+        path: "/InsertNote",
+        ...args,
+      });
     }

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

🧹 Nitpick comments (1)
components/momentum_ams/actions/get-client/get-client.mjs (1)

23-23: Use template literals for the summary message.

The summary message uses string concatenation instead of template literals. Based on coding best practices and consistency with other actions, consider using template literals.

Apply this diff to improve the summary message format:

-    $.export("$summary", "Successfully retrieved the client with ID: " + this.id);
+    $.export("$summary", `Successfully retrieved the client with ID: ${this.id}`);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7404196 and 5f0cc01.

📒 Files selected for processing (3)
  • components/momentum_ams/actions/get-client/get-client.mjs (1 hunks)
  • components/momentum_ams/actions/insert-note/insert-note.mjs (1 hunks)
  • components/momentum_ams/momentum_ams.app.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/momentum_ams/actions/insert-note/insert-note.mjs
  • components/momentum_ams/momentum_ams.app.mjs
🧰 Additional context used
🧠 Learnings (1)
components/momentum_ams/actions/get-client/get-client.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`.
⏰ 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 (3)
components/momentum_ams/actions/get-client/get-client.mjs (3)

1-1: LGTM!

The import statement is correct and follows standard ES module syntax.


4-8: LGTM!

The metadata is well-structured and follows Pipedream action conventions. The inclusion of a documentation link is a good practice.


9-17: LGTM!

The props definition correctly uses the propDefinition pattern, which is the recommended approach for Pipedream actions to ensure proper validation and reusability.

@lcaresia
Copy link
Collaborator Author

Hey @michelle0927, sorry. I forgot to delete get-clients action, all right now. Thanks!

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.

LGMT!

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] momentum_ams
2 participants