-
Notifications
You must be signed in to change notification settings - Fork 0
[Cloned] feat(Todoist Node): Add more resources and operations #3
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
Conversation
Original PR: n8n-io/n8n#17925 Author: mutdmour ## Summary Add more resources and operations to Todoist node https://github.com/user-attachments/assets/4bbee79f-ea0e-4c20-9e34-e00add862cd9 <!-- Describe what the PR does and how to test. Photos and videos are recommended. --> ## Related Linear tickets, Github issues, and Community forum posts <!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/ --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. --> ## Review / Merge checklist - [ ] PR title and summary are descriptive. ([conventions](../blob/master/.github/pull_request_title_conventions.md)) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** --> - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created. - [ ] Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. --> - [ ] PR Labeled with `release/backport` (if the PR is an urgent fix that needs to be backported) --- This is a cloned PR for AI code review benchmarking.
PR Reviewer Guide 🔍(Review updated until commit 32d24a1)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||||
|
/review Please review this code for potential issues, security vulnerabilities, and improvements. Review triggered at: 2025-08-05T10:44:24.922Z |
|
Persistent review updated to latest commit 32d24a1 |
User description
Cloned Pull Request
This PR is a clone of the original PR: n8n-io/n8n#17925
Original Author: mutdmour
Original PR Number: #17925
Original Repository: n8n-io/n8n
Original Description:
Summary
Add more resources and operations to Todoist node
Screen.Recording.2025-08-03.at.15.40.57.mov
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)Files Changed:
packages/nodes-base/nodes/Todoist/GenericFunctions.tspackages/nodes-base/nodes/Todoist/v2/OperationHandler.tspackages/nodes-base/nodes/Todoist/v2/Service.tspackages/nodes-base/nodes/Todoist/v2/TodoistV2.node.tspackages/nodes-base/nodes/Todoist/v2/test/OperationHandler.test.tspackages/nodes-base/nodes/Todoist/v2/test/TodoistV2.node.test.tspackages/nodes-base/nodes/Todoist/v2/test/workflow.jsonpackages/nodes-base/utils/__tests__/types.test.tspackages/nodes-base/utils/types.tsThis PR was automatically cloned for AI code review benchmarking purposes.
PR Type
Enhancement, Tests
Description
• Major expansion of Todoist node functionality - Added support for new resources: Projects, Sections, Comments, and Labels with full CRUD operations
• Enhanced task operations - Added QuickAdd functionality, duration tracking, assignee management, and deadline support
• Comprehensive type validation system - Implemented robust parameter validation with new assertion utilities (
assertIsString,assertIsNumber,assertIsNodeParameters)• Complete test coverage - Added extensive test suites for operation handlers, node integration tests, and type assertion utilities
• Improved API flexibility - Enhanced sync request function to support configurable endpoints beyond the default
/sync• Better UI/UX - Added color selection options and comprehensive field configurations for all new resources
Diagram Walkthrough
File Walkthrough
4 files
OperationHandler.test.ts
Add comprehensive test suite for Todoist operation handlerspackages/nodes-base/nodes/Todoist/v2/test/OperationHandler.test.ts
• Added comprehensive test suite for all Todoist operation handlers
including tasks, projects, sections, comments, and labels
•
Implemented mock functions for
todoistApiRequestandtodoistSyncRequestwith Jest• Created test cases covering CRUD
operations, error handling, and type validation for all resources
•
Added tests for special operations like QuickAdd and Sync handlers
with various parameter combinations
TodoistV2.node.test.ts
Add integration tests for TodoistV2 node functionalitypackages/nodes-base/nodes/Todoist/v2/test/TodoistV2.node.test.ts
• Created integration tests for the TodoistV2 node using
NodeTestHarness
• Added mock data for all resources (projects,
sections, tasks, labels, comments) with realistic sample data
•
Implemented nock HTTP mocking for all API endpoints and operations
•
Added comprehensive workflow test data covering all supported
operations and their expected outputs
types.test.ts
Add comprehensive test suite for type assertion utilitiespackages/nodes-base/utils/tests/types.test.ts
• Added comprehensive test suite for type assertion functions
• Tests
cover
assertIsNodeParameters,assertIsString,assertIsNumber, andassertIsArrayfunctions• Includes positive and negative test cases
for various parameter types and validation scenarios
• Tests complex
nested scenarios, array validation, resource-locator types, and error
handling
workflow.json
Add comprehensive workflow test configuration for Todoist operationspackages/nodes-base/nodes/Todoist/v2/test/workflow.json
• Added comprehensive workflow test configuration for Todoist node
•
Includes test nodes for all resource types: tasks, projects, sections,
comments, and labels
• Covers all CRUD operations and special
operations like archive/unarchive, quick add
• Contains node
connections and parameter configurations for end-to-end testing
5 files
OperationHandler.ts
Expand operation handlers with new resources and type validationpackages/nodes-base/nodes/Todoist/v2/OperationHandler.ts
• Added type validation using
assertIsString,assertIsNumber,assertIsStringOrNumber, andassertIsNodeParametersfunctions•
Expanded
CreateTaskRequestinterface with new fields likeassignee_id,duration,duration_unit,deadline_date• Added comprehensive operation
handlers for projects, sections, comments, and labels (create, read,
update, delete operations)
• Enhanced command types with additional
Todoist sync API commands and improved error handling
TodoistV2.node.ts
Add new resources and operations to Todoist node interfacepackages/nodes-base/nodes/Todoist/v2/TodoistV2.node.ts
• Added support for new resources: Project, Section, Comment, and
Label with their respective operations
• Implemented comprehensive UI
fields for all new resources including creation, update, and filter
options
• Added
TODOIST_COLOR_OPTIONSconstant for color selectionacross resources
• Enhanced task operations with QuickAdd
functionality and additional fields like duration, assignee, and
deadline
GenericFunctions.ts
Enhance sync request function with configurable endpointspackages/nodes-base/nodes/Todoist/GenericFunctions.ts
• Modified
todoistSyncRequestfunction to accept an optionalendpointparameter
• Updated the function to support different sync API
endpoints beyond the default
/sync• Enhanced flexibility for calling
various Todoist sync API endpoints like
/quick/addService.ts
Expand Todoist service to support multiple resource typespackages/nodes-base/nodes/Todoist/v2/Service.ts
• Refactored service to support multiple resource types (tasks,
projects, sections, comments, labels)
• Added separate execution
methods for each resource type with dedicated handlers
• Introduced
type-safe operation types and type guards for different resources
•
Added
QuickAddHandlerfor tasks and comprehensive handlers for all newresource operations
types.ts
Add type assertion utilities for parameter validationpackages/nodes-base/utils/types.ts
• Added new type assertion utility functions for parameter validation
• Implemented
assertIsNodeParametersfor complex object validationwith type definitions
• Added basic type assertions for strings,
numbers, arrays, and string/number combinations
• Includes support for
optional parameters, resource-locator types, and multi-type validation