-
Notifications
You must be signed in to change notification settings - Fork 5.4k
17281 components lark #17688
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
base: master
Are you sure you want to change the base?
17281 components lark #17688
Conversation
Sources - New User Added To Group Chat Actions - Create New Base Table Record - Create New Lark Document - Create Lark Spreadsheet - Add User To Lark Group Chat - Update Base Table Record - Create New Lark Folder - Create New Lark Calendar Event
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
WalkthroughThis update introduces a comprehensive Lark integration, adding multiple new action and source components for document, spreadsheet, folder, task, calendar event, and base table record management, as well as group chat membership. It implements a robust app module with extensive API wrappers, utility functions, constants, and polling-based event sources for group chat changes. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Action
participant LarkApp
participant LarkAPI
User->>Action: Triggers action (e.g., create document, add user)
Action->>LarkApp: Calls corresponding method (e.g., createDocument)
LarkApp->>LarkAPI: Makes API request
LarkAPI-->>LarkApp: Returns API response
LarkApp-->>Action: Returns processed result
Action-->>User: Outputs summary and response
sequenceDiagram
participant Source
participant Timer
participant LarkApp
participant LarkAPI
participant DB
Timer->>Source: Triggers polling run
Source->>LarkApp: Fetch group chat members
LarkApp->>LarkAPI: API call to list members
LarkAPI-->>LarkApp: Returns member list
LarkApp-->>Source: Provides member data
Source->>DB: Reads stored member IDs
Source->>DB: Stores updated member IDs
Source-->>User: Emits event for each new user detected
Suggested labels
Suggested reviewers
Poem
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
components/lark/actions/create-new-lark-document/create-new-lark-document.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/lark/actions/add-user-to-lark-group-chat/add-user-to-lark-group-chat.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/lark/actions/create-new-base-table-record/create-new-base-table-record.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
🧹 Nitpick comments (2)
components/lark/actions/create-new-lark-task/create-new-lark-task.mjs (1)
52-56
: Clarify the startTimestamp requirementThe
startTimestamp
prop is missing theoptional: true
property, suggesting it's required, but the description mentions it's used "If you set both the start time and the deadline". This creates ambiguity about whether this field is required or optional.Consider adding
optional: true
if this field is indeed optional:startTimestamp: { type: "string", label: "Start Timestamp", description: "The timestamp of the start time/date in milliseconds from 1970-01-01 00:00:00. If the start time is a date, you need to convert the date to timestamp and set `Due Is All Day` to true. If you set both the start time and the deadline for the task, the start time must be < = deadline, and the `Is All Day` settings for the start/deadline must be the same.", + optional: true, },
components/lark/lark.app.mjs (1)
189-210
: Optimize folder tree serialization performanceThe current implementation uses
await Promise.all()
with recursive calls which could cause performance issues with deep folder structures. Consider using sequential processing to avoid potential stack overflow.Instead of processing all folders in parallel, consider sequential processing:
- await Promise.all(data.files + for (const file of data.files .filter(({ type }) => type === "folder") - .sort((a, b) => a.created_time - b.created_time) - .map(async ({ - token: value, name: label, - }) => { + .sort((a, b) => a.created_time - b.created_time)) { + const { token: value, name: label } = file; response.push({ label: `${parentName}${parentName ? " / " : ""}${label}`, value, }); - response.push(...await this.serealizeFolderTree({ + response.push(...await this.serializeFolderTree({ token: value, - pageToken: data.next_page_token, + pageToken: undefined, parentName: `${parentName}${parentName ? " / " : ""}${label}`, })); - })); + }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (14)
components/lark/actions/add-user-to-lark-group-chat/add-user-to-lark-group-chat.mjs
(1 hunks)components/lark/actions/create-new-base-table-record/create-new-base-table-record.mjs
(1 hunks)components/lark/actions/create-new-lark-calendar-event/create-new-lark-calendar-event.mjs
(1 hunks)components/lark/actions/create-new-lark-document/create-new-lark-document.mjs
(1 hunks)components/lark/actions/create-new-lark-folder/create-new-lark-folder.mjs
(1 hunks)components/lark/actions/create-new-lark-spreadsheet/create-new-lark-spreadsheet.mjs
(1 hunks)components/lark/actions/create-new-lark-task/create-new-lark-task.mjs
(1 hunks)components/lark/actions/update-base-table-record/update-base-table-record.mjs
(1 hunks)components/lark/common/constants.mjs
(1 hunks)components/lark/common/utils.mjs
(1 hunks)components/lark/lark.app.mjs
(1 hunks)components/lark/package.json
(2 hunks)components/lark/sources/new-user-added-to-group-chat/new-user-added-to-group-chat.mjs
(1 hunks)components/lark/sources/new-user-added-to-group-chat/test-event.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (10)
components/lark/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/lark/sources/new-user-added-to-group-chat/test-event.mjs (1)
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.
components/lark/actions/create-new-lark-calendar-event/create-new-lark-calendar-event.mjs (3)
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".
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/lark/actions/add-user-to-lark-group-chat/add-user-to-lark-group-chat.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/lark/sources/new-user-added-to-group-chat/new-user-added-to-group-chat.mjs (2)
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.
components/lark/actions/create-new-lark-spreadsheet/create-new-lark-spreadsheet.mjs (3)
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`.
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/lark/actions/create-new-lark-task/create-new-lark-task.mjs (3)
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`.
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/lark/actions/create-new-lark-document/create-new-lark-document.mjs (3)
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`.
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/lark/actions/create-new-base-table-record/create-new-base-table-record.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/lark/lark.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#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: 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.
🧬 Code Graph Analysis (7)
components/lark/sources/new-user-added-to-group-chat/new-user-added-to-group-chat.mjs (1)
components/lark/lark.app.mjs (2)
response
(15-20)response
(177-177)
components/lark/actions/create-new-lark-spreadsheet/create-new-lark-spreadsheet.mjs (2)
components/lark/actions/create-new-lark-document/create-new-lark-document.mjs (1)
response
(26-32)components/lark/actions/create-new-lark-folder/create-new-lark-folder.mjs (1)
response
(24-30)
components/lark/actions/create-new-lark-folder/create-new-lark-folder.mjs (3)
components/lark/actions/create-new-lark-document/create-new-lark-document.mjs (1)
response
(26-32)components/lark/actions/create-new-lark-spreadsheet/create-new-lark-spreadsheet.mjs (1)
response
(26-32)components/lark/lark.app.mjs (2)
response
(15-20)response
(177-177)
components/lark/actions/create-new-lark-task/create-new-lark-task.mjs (2)
components/lark/common/constants.mjs (2)
MODE_OPTIONS
(3-12)MODE_OPTIONS
(3-12)components/lark/lark.app.mjs (2)
response
(15-20)response
(177-177)
components/lark/common/constants.mjs (1)
components/lark/lark.app.mjs (1)
LIMIT
(181-187)
components/lark/actions/create-new-lark-document/create-new-lark-document.mjs (3)
components/lark/actions/create-new-lark-spreadsheet/create-new-lark-spreadsheet.mjs (1)
response
(26-32)components/lark/actions/create-new-lark-folder/create-new-lark-folder.mjs (1)
response
(24-30)components/lark/lark.app.mjs (2)
response
(15-20)response
(177-177)
components/lark/actions/create-new-base-table-record/create-new-base-table-record.mjs (3)
components/lark/actions/update-base-table-record/update-base-table-record.mjs (1)
response
(50-58)components/lark/lark.app.mjs (2)
response
(15-20)response
(177-177)components/lark/common/utils.mjs (2)
parseObject
(1-24)parseObject
(1-24)
🔇 Additional comments (32)
components/lark/package.json (2)
3-3
: LGTM! Version bump reflects new functionality.The version increment from 0.0.1 to 0.1.0 appropriately reflects the addition of new action and source components in this comprehensive Lark integration update.
14-17
: LGTM! Dependency and formatting updates look correct.The addition of
@pipedream/platform
dependency and JSON formatting fix are appropriate for the new Lark components being introduced.components/lark/sources/new-user-added-to-group-chat/test-event.mjs (1)
1-6
: LGTM! Test event structure is appropriate.The test event object contains the expected fields for a Lark group chat member addition event, providing realistic test data for the source component.
components/lark/common/utils.mjs (1)
1-24
: LGTM! Robust JSON parsing utility.The
parseObject
function handles various input types gracefully with proper error handling. The defensive approach of returning original values on parse failures prevents runtime errors while maintaining flexibility for different input formats.components/lark/actions/add-user-to-lark-group-chat/add-user-to-lark-group-chat.mjs (1)
25-45
: LGTM! Well-structured action implementation.The action properly handles the API call with appropriate error checking, exports a clear summary message, and returns the full response. The use of
ConfigurationError
for API failures and the structured parameter passing are both correct.components/lark/actions/update-base-table-record/update-base-table-record.mjs (1)
49-66
: LGTM! Solid action implementation with proper input parsing.The action correctly uses the
parseObject
utility for fields input, implements appropriate error handling, and provides a clear summary message. The structured approach with dependent prop definitions is well-designed.components/lark/actions/create-new-base-table-record/create-new-base-table-record.mjs (5)
1-3
: LGTM - Clean imports and proper error handling setupThe imports are well-organized, including the necessary ConfigurationError for proper error handling and the parseObject utility for input parsing.
5-10
: LGTM - Consistent action metadata structureThe action metadata follows the standard Pipedream action format with appropriate key, name, description, version, and type fields.
35-43
: LGTM - Proper API call structure with field parsingThe API call correctly uses the parseObject utility to handle field inputs and follows the expected pattern for calling Lark app methods.
45-47
: LGTM - Appropriate error handlingThe error handling correctly checks for API response errors and throws a ConfigurationError with the error message, which is the proper pattern for user-facing errors.
49-50
: LGTM - Well-formatted summary messageThe summary message follows the established pattern of including the operation result and relevant ID information.
components/lark/sources/new-user-added-to-group-chat/new-user-added-to-group-chat.mjs (7)
1-3
: LGTM - Proper polling source importsThe imports include the necessary polling timer interval constant, app instance, and test event sample.
5-11
: LGTM - Correct source metadata and deduplicationThe source metadata is properly structured with appropriate deduplication strategy for preventing duplicate events.
28-34
: LGTM - Proper database state managementThe database methods correctly handle storing and retrieving member IDs for comparison between polling intervals.
38-46
: LGTM - Correct pagination handlingThe pagination implementation correctly uses the lark.paginate method and processes all pages of results.
48-57
: LGTM - Proper new member detection and state updateThe logic correctly filters new members, handles maxResults limiting, and updates the stored member IDs with all current members.
59-65
: LGTM - Proper event emission structureThe event emission follows the standard pattern with ID, summary, and timestamp fields.
68-71
: LGTM - Appropriate deploy hook implementationThe deploy hook correctly limits initial events to prevent overwhelming the system with historical data.
components/lark/actions/create-new-lark-folder/create-new-lark-folder.mjs (5)
1-1
: LGTM - Minimal and appropriate importsOnly imports the necessary lark app module, keeping the dependencies clean.
3-8
: LGTM - Consistent action metadataThe action metadata follows standard conventions with appropriate key, name, description, version, and type.
11-21
: LGTM - Well-structured props definitionThe props are properly defined with appropriate types and descriptions. The use of propDefinition for folderToken ensures consistency across actions.
24-30
: LGTM - Correct API call structureThe API call follows the expected pattern for Lark actions with proper parameter structure.
31-32
: LGTM - Informative summary messageThe summary message correctly includes the token of the newly created folder, which is useful for subsequent operations.
components/lark/actions/create-new-lark-calendar-event/create-new-lark-calendar-event.mjs (5)
1-9
: LGTM - Comprehensive imports for calendar functionalityThe imports include necessary error handling, constants for option definitions, and the lark app module.
11-16
: LGTM - Consistent action metadataThe action metadata follows standard conventions with appropriate naming and documentation reference.
163-174
: LGTM - Proper input validation for time fieldsThe validation logic correctly ensures that exactly one of date or timestamp is provided for both start and end times, preventing invalid combinations.
205-210
: LGTM - Correct coordinate type conversionThe latitude and longitude conversion using parseFloat is appropriate for handling string inputs that need to be numeric for the API.
217-218
: LGTM - Well-formatted summary messageThe summary message correctly includes the event ID and follows the established pattern for success messages.
components/lark/actions/create-new-lark-task/create-new-lark-task.mjs (4)
1-2
: LGTM - Appropriate importsThe imports include necessary constants and the lark app module.
4-9
: LGTM - Consistent action metadataThe action metadata follows standard conventions with appropriate key, name, description, version, and type.
78-97
: LGTM - Proper API call structureThe API call correctly structures the data object with nested objects for due and start time information, following the expected API format.
99-100
: LGTM - Informative summary messageThe summary message correctly includes the task GUID, which is useful for tracking the created task.
components/lark/actions/create-new-lark-document/create-new-lark-document.mjs
Show resolved
Hide resolved
components/lark/actions/create-new-lark-spreadsheet/create-new-lark-spreadsheet.mjs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @luancazarine lgtm! Ready for QA!
Resolves #17281
Summary by CodeRabbit