Skip to content

New Components - teamwork #17721

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 22, 2025
Merged

New Components - teamwork #17721

merged 5 commits into from
Jul 22, 2025

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Jul 21, 2025

Resolves #17464

Sources

  • New User Created
  • User Updated
  • all other event types in issue are hallucinations

Actions

  • List Users
  • Get User
  • Create User
  • Update User
  • all other action endpoints in issue are hallucinations

Summary by CodeRabbit

  • New Features

    • Added actions to create, update, retrieve, and list users in Teamwork with detailed user attributes.
    • Introduced new instant event sources for user creation and updates.
    • Enabled listing of companies for user assignment.
  • Improvements

    • Enhanced app integration with expanded user and company management capabilities, including CRUD operations.
    • Updated event sources for tasks to use instant event processing and improved metadata.
  • Bug Fixes

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

    • Upgraded dependencies and package version.

Copy link

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

Copy link
Contributor

coderabbitai bot commented Jul 21, 2025

"""

Walkthrough

This update introduces new actions and sources for Teamwork user management, including creating, updating, retrieving, and listing users, as well as sources for user-related events. The Teamwork app gains CRUD methods for people and companies. Supporting utilities and common event-handling logic are added, and several existing actions and sources receive minor version bumps and metadata updates.

Changes

File(s) Change Summary
components/teamwork/actions/create-user/create-user.mjs New action: Create User with comprehensive property definitions and API call logic.
components/teamwork/actions/get-user/get-user.mjs New action: Get User by ID, returning user details from Teamwork API.
components/teamwork/actions/list-users/list-users.mjs New action: List Users with pagination, sorting, and max results.
components/teamwork/actions/update-user/update-user.mjs New action: Update User with extensive optional fields and API update logic.
components/teamwork/common/utils.mjs New utility: parseObject for recursively parsing/cleaning input values.
components/teamwork/sources/new-user-created/new-user-created.mjs New source: Emits event when a new user is created, with metadata extraction.
components/teamwork/sources/user-updated/user-updated.mjs New source: Emits event when a user is updated, with metadata extraction.
components/teamwork/teamwork.app.mjs Adds CRUD methods for people and companies, new propDefinitions, and method enhancements.
components/teamwork/sources/common/common-sources.mjs Adds abstract generateMeta() and new run(event) for standardized event processing and HMAC validation.
components/teamwork/sources/new-task/new-task.mjs Refactors: Removes run, adds generateMeta, updates name/version.
components/teamwork/sources/task-deleted/task-deleted.mjs Refactors: Removes run, adds generateMeta, updates name/version.
components/teamwork/sources/task-updated/task-updated.mjs Refactors: Removes run, adds generateMeta, updates name/version.
components/teamwork/actions/create-task/create-task.mjs
components/teamwork/actions/delete-task/delete-task.mjs
components/teamwork/actions/list-project-tasks/list-project-tasks.mjs
components/teamwork/actions/update-task/update-task.mjs
Version bump only: "0.0.1""0.0.2"
components/teamwork/package.json Updates package version to 0.1.0 and bumps dependency on @pipedream/platform.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant TeamworkApp
    participant TeamworkAPI

    User->>Action: Trigger (e.g., Create User)
    Action->>TeamworkApp: Call createPerson(data)
    TeamworkApp->>TeamworkAPI: POST /people.json (with data)
    TeamworkAPI-->>TeamworkApp: Response (user details)
    TeamworkApp-->>Action: Return response
    Action-->>User: Summary and user details
Loading
sequenceDiagram
    participant TeamworkAPI
    participant WebhookSource
    participant CommonSource
    participant Consumer

    TeamworkAPI->>WebhookSource: Send event (e.g., USER.CREATED)
    WebhookSource->>CommonSource: run(event)
    CommonSource->>CommonSource: Validate HMAC
    CommonSource->>WebhookSource: generateMeta(body)
    CommonSource-->>Consumer: Emit event with metadata
Loading

Estimated code review effort

4 (~90 minutes)

Poem

A flurry of users, both shiny and new,
With updates and lookups, our teamwork grew!
Sources now sparkle, events leap and bound,
Utilities parse as the changes resound.
Version bumps hop, while new features appear—
This rabbit applauds: Teamwork’s future is here!
🐇✨
"""

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/teamwork/actions/create-user/create-user.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/teamwork/actions/list-users/list-users.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 d7f4e8e and 5bf867d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • components/teamwork/actions/create-user/create-user.mjs (1 hunks)
  • components/teamwork/actions/list-users/list-users.mjs (1 hunks)
  • components/teamwork/package.json (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • components/teamwork/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • components/teamwork/actions/list-users/list-users.mjs
  • components/teamwork/actions/create-user/create-user.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). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
✨ 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: 6

🧹 Nitpick comments (5)
components/teamwork/common/utils.mjs (1)

1-25: Well-implemented recursive object parser with minor considerations.

The parseObject function correctly handles the recursive parsing of nested data structures. The implementation properly handles edge cases like falsy values and JSON parsing failures.

Consider these potential improvements:

  • Add protection against circular references to prevent stack overflow
  • Consider performance implications for deeply nested structures
  • Document the intended use cases and limitations
+/**
+ * Recursively parses an object, attempting to JSON.parse string values
+ * while preserving the original structure for arrays and objects.
+ * @param {any} obj - The value to parse
+ * @returns {any} - The parsed value
+ */
 export const parseObject = (obj) => {
components/teamwork/sources/new-user-created/new-user-created.mjs (1)

16-22: Consider defensive programming for name concatenation.

The name concatenation in line 19 could fail if User.FirstName or User.LastName are null/undefined. Consider adding null checks or default values.

generateMeta(body) {
  return {
    id: body["User.ID"],
-   summary: body["User.FirstName"] + " " + body["User.LastName"],
+   summary: `${body["User.FirstName"] || ""} ${body["User.LastName"] || ""}`.trim() || "Unknown User",
    ts: Date.parse(body["User.DateCreated"]),
  };
},
components/teamwork/actions/list-users/list-users.mjs (1)

45-72: Consider optimizing pagination logic.

The current implementation may fetch more records than needed when approaching the maxResults limit. Consider adjusting the pageSize parameter based on remaining needed records.

async run({ $ }) {
  let total, count = 0, page = 1;
  let users = [];
  const params = {
    sort: this.sort,
    sortOrder: this.sortDirection,
-   pageSize: 100,
  };
  do {
+   const remaining = this.maxResults - count;
+   params.pageSize = Math.min(100, remaining);
    const items = await this.app.listPeople(page, $, params);
    total = items?.length;
    if (!total) {
      break;
    }
    users.push(...items);
    count += items.length;
    page++;
  } while (count < this.maxResults);

-  if (users.length > this.maxResults) {
-    users = users.slice(0, this.maxResults);
-  }

  $.export("$summary", `Found ${users.length} user${users.length === 1
    ? ""
    : "s"}`);
  return users;
},
components/teamwork/actions/update-user/update-user.mjs (1)

203-203: Fix typo in working hours description.

There's a double period in the description.

-      description: "Object containing working hours information. . [See the documentation](https://apidocs.teamwork.com/docs/teamwork/v1/people/post-people-json) for more information.",
+      description: "Object containing working hours information. [See the documentation](https://apidocs.teamwork.com/docs/teamwork/v1/people/post-people-json) for more information.",
components/teamwork/actions/create-user/create-user.mjs (1)

192-192: Fix typo in working hours description.

There's a double period in the description, same as in the update-user action.

-      description: "Object containing working hours information. . [See the documentation](https://apidocs.teamwork.com/docs/teamwork/v1/people/post-people-json) for more information.",
+      description: "Object containing working hours information. [See the documentation](https://apidocs.teamwork.com/docs/teamwork/v1/people/post-people-json) for more information.",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8138a13 and d7f4e8e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • components/teamwork/actions/create-task/create-task.mjs (1 hunks)
  • components/teamwork/actions/create-user/create-user.mjs (1 hunks)
  • components/teamwork/actions/delete-task/delete-task.mjs (1 hunks)
  • components/teamwork/actions/get-user/get-user.mjs (1 hunks)
  • components/teamwork/actions/list-project-tasks/list-project-tasks.mjs (1 hunks)
  • components/teamwork/actions/list-users/list-users.mjs (1 hunks)
  • components/teamwork/actions/update-task/update-task.mjs (1 hunks)
  • components/teamwork/actions/update-user/update-user.mjs (1 hunks)
  • components/teamwork/common/utils.mjs (1 hunks)
  • components/teamwork/package.json (2 hunks)
  • components/teamwork/sources/common/common-sources.mjs (2 hunks)
  • components/teamwork/sources/new-task/new-task.mjs (1 hunks)
  • components/teamwork/sources/new-user-created/new-user-created.mjs (1 hunks)
  • components/teamwork/sources/task-deleted/task-deleted.mjs (1 hunks)
  • components/teamwork/sources/task-updated/task-updated.mjs (1 hunks)
  • components/teamwork/sources/user-updated/user-updated.mjs (1 hunks)
  • components/teamwork/teamwork.app.mjs (2 hunks)
🧰 Additional context used
🧠 Learnings (13)
components/teamwork/actions/create-task/create-task.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/teamwork/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/teamwork/sources/common/common-sources.mjs (4)

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #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.

components/teamwork/sources/new-user-created/new-user-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-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

components/teamwork/actions/list-users/list-users.mjs (3)

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

Learnt from: GTFalcao
PR: #16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

components/teamwork/sources/new-task/new-task.mjs (3)

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-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

components/teamwork/sources/task-updated/task-updated.mjs (5)

Learnt from: GTFalcao
PR: #15376
File: components/monday/sources/name-updated/name-updated.mjs:6-6
Timestamp: 2025-01-23T03:55:15.166Z
Learning: Source names in Monday.com components don't need to start with "New" if they emit events for updated items (e.g., "Name Updated", "Column Value Updated") rather than new items. This follows the component guidelines exception where the "New" prefix is only required when emits are limited to new items.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In components/the_magic_drip/sources/common.mjs, when processing items in getAndProcessData, savedIds is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.

Learnt from: GTFalcao
PR: #17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the created_at field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using Date.parse() before assigning to the ts field in generateMeta().

components/teamwork/actions/create-user/create-user.mjs (3)

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

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/teamwork/sources/user-updated/user-updated.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-10-08T15:33:38.240Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

Learnt from: GTFalcao
PR: #12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The common-webhook-methods.mjs object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like generateWebhookMeta and getEventType to enforce implementation in subclasses.

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

Learnt from: GTFalcao
PR: #16954
File: components/salesloft/salesloft.app.mjs:14-23
Timestamp: 2025-06-04T17:52:05.780Z
Learning: In the Salesloft API integration (components/salesloft/salesloft.app.mjs), the _makeRequest method returns response.data which directly contains arrays for list endpoints like listPeople, listCadences, listUsers, and listAccounts. The propDefinitions correctly call .map() directly on these responses without needing to destructure a nested data property.

components/teamwork/actions/get-user/get-user.mjs (2)

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-10-08T15:33:38.240Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

Learnt from: GTFalcao
PR: #12731
File: components/hackerone/actions/get-members/get-members.mjs:3-28
Timestamp: 2024-07-04T18:11:59.822Z
Learning: When exporting a summary message in the run method of an action, ensure the message is correctly formatted. For example, in the hackerone-get-members action, the correct format is Successfully retrieved ${response.data.length} members.

components/teamwork/actions/update-user/update-user.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/teamwork/sources/task-deleted/task-deleted.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 (2)
components/teamwork/actions/create-user/create-user.mjs (2)
components/teamwork/actions/update-user/update-user.mjs (1)
  • data (420-484)
components/teamwork/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
components/teamwork/actions/update-user/update-user.mjs (2)
components/teamwork/actions/create-user/create-user.mjs (1)
  • data (409-474)
components/teamwork/common/utils.mjs (2)
  • parseObject (1-25)
  • parseObject (1-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (24)
components/teamwork/actions/delete-task/delete-task.mjs (1)

8-8: Version bump looks good.

The version increment aligns with the coordinated updates across task-related actions mentioned in the PR summary.

components/teamwork/package.json (2)

3-3: Appropriate version bump for new features.

The minor version increment from 0.0.2 to 0.1.0 is appropriate given the addition of new user management actions and enhanced app methods.


16-16: No breaking changes detected for axios usage

I’ve verified that the Teamwork component:

  • Imports axios from @pipedream/platform
  • Awaits axios(ctx, params) and treats the result as the HTTP response body (e.g. res.projects)
  • Uses no other APIs whose behavior changed in v3

Since v3’s axios still returns the response body directly (same as v1.x) and the import path and component definitions are unchanged, the upgrade to @pipedream/platform@^3.1.0 won’t break existing code.

components/teamwork/actions/list-project-tasks/list-project-tasks.mjs (1)

8-8: Version bump is consistent with other task actions.

The version increment aligns with the coordinated updates across task-related actions in this PR.

components/teamwork/actions/update-task/update-task.mjs (1)

8-8: Version bump completes the coordinated task action updates.

The version increment is consistent with the other task-related actions updated in this PR.

components/teamwork/actions/create-task/create-task.mjs (1)

6-6: Version bump looks good.

The version increment from "0.0.1" to "0.0.2" aligns with similar updates across other Teamwork task-related actions and maintains consistency without introducing functional changes.

components/teamwork/sources/common/common-sources.mjs (2)

30-32: Good use of abstract method pattern.

The generateMeta() method properly enforces implementation in subclasses, following established patterns for extensible base components. This ensures consistent metadata generation across different event types.


68-72: Excellent standardization of event processing flow.

The new run() method centralizes HMAC validation and event emission logic, reducing code duplication across event sources. The security validation with _checkHmac() ensures webhook authenticity before processing events.

components/teamwork/sources/new-user-created/new-user-created.mjs (1)

1-24: Well-implemented user creation source.

The source properly extends the common base and implements the required abstract methods. The event name "USER.CREATED" and metadata extraction using User fields are appropriate.

components/teamwork/sources/new-task/new-task.mjs (2)

8-10: Good alignment with the new source architecture.

The name update to include "(Instant)" and version bump properly reflect the refactoring to use the new common source pattern.


16-22: Well-implemented generateMeta method.

The metadata generation correctly uses Task fields and follows the established pattern from the common base. This refactoring eliminates code duplication while maintaining the same functionality.

components/teamwork/sources/task-updated/task-updated.mjs (1)

15-21: Use the task’s update timestamp and convert it to milliseconds

For an “updated” event, you should emit when the change occurred (not when the task was created), and convert the ISO-8601 string into a numeric timestamp. Please confirm which field the webhook actually returns (e.g. Task.DateUpdated or Task.LastModified) so you can reference it below.

• File: components/teamwork/sources/task-updated/task-updated.mjs
• Lines: 15–21

Suggested diff:

generateMeta(body) {
  return {
    id: body["Task.ID"],
    summary: body["Task.Name"],
-   ts: body["Task.DateCreated"],
+   ts: Date.parse(
+     body["Task.DateUpdated"]
+       ?? body["Task.LastModified"]
+       ?? body["Task.DateCreated"]
+   ),
  };
},

– Replace Task.DateUpdated/Task.LastModified with the actual update field.
– Fallback to creation date only if no update timestamp is available.
Date.parse() ensures ts is a number, not a string.

components/teamwork/sources/user-updated/user-updated.mjs (1)

16-23: Use update timestamp for user-updated events

The user-updated source is currently using User.DateCreated as the event timestamp. For updates, you should prefer the actual update time (if provided by the webhook) and fall back to creation or now if not:

• File: components/teamwork/sources/user-updated/user-updated.mjs
Lines: 16–23

Suggested diff:

 generateMeta(body) {
-  const ts = Date.parse(body["User.DateCreated"]);
+  // Prefer update time; fall back to creation date or current time
+  const rawTs =
+    body["User.DateUpdated"] ||
+    body["User.LastModified"] ||
+    body["User.DateCreated"];
+  const ts = Date.parse(rawTs) || Date.now();

   return {
     id: `${body["User.ID"]}-${ts}`,
     summary: body["User.FirstName"] + " " + body["User.LastName"],
     ts,
   };
 },

Please verify that the Teamwork webhook payload for user updates includes a User.DateUpdated or User.LastModified field. If not, confirm with the API spec or add appropriate field mapping.

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

79-91: Well-structured API method implementations

The new methods for user and company management are properly implemented following the existing patterns:

  • Consistent error handling with empty defaults
  • Proper HTTP methods and endpoint structure
  • Backward-compatible extension of listPeople

Also applies to: 173-218

components/teamwork/actions/update-user/update-user.mjs (5)

1-2: LGTM - Clean imports.

Proper imports of the app and parseObject utility function.


4-9: LGTM - Well-structured action definition.

The action metadata is properly defined with appropriate key, name, description, version, and type.


12-19: LGTM - Proper user ID property definition.

The peopleId property correctly uses propDefinition from the app and provides clear labeling for the user update context.


419-484: LGTM - Comprehensive data mapping with proper object parsing.

The data object construction correctly maps all properties to their API field names and properly uses parseObject for complex fields like address and working hours. The API call structure is appropriate.


485-487: LGTM - Clear and informative summary message.

The summary message follows the established pattern from the learnings and provides clear feedback about the operation result.

components/teamwork/actions/create-user/create-user.mjs (5)

1-2: LGTM - Clean imports.

Proper imports of the app and parseObject utility function.


4-9: LGTM - Well-structured action definition.

The action metadata is properly defined with appropriate key, name, description, version, and type.


12-32: LGTM - Required fields properly defined.

The essential user creation fields (email, first name, last name, company) are correctly defined with appropriate types and descriptions.


476-481: LGTM - Proper cleanup of undefined values.

The logic to remove undefined values from the data object before sending to the API is appropriate and prevents sending unnecessary null/undefined values.


409-474: Add missing allowEmailNotifications field to data object.

The data object is missing the allowEmailNotifications field that exists in the properties and is present in the update-user action.

       "removeAvatar": this.removeAvatar,
+      "allowEmailNotifications": this.allowEmailNotifications,
       "user-type": this.userType,

Likely an incorrect or invalid review comment.

Copy link
Collaborator

@luancazarine luancazarine left a comment

Choose a reason for hiding this comment

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

Hi @michelle0927, LGTM! Ready for QA!

@vunguyenhung vunguyenhung merged commit fb4fd35 into master Jul 22, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the issue-17464 branch July 22, 2025 03:53
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.

Teamwork
3 participants