@joyjit/vikunja-mcp 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/LICENSE +21 -0
- package/README.md +1377 -0
- package/dist/auth/AuthManager.d.ts +63 -0
- package/dist/auth/AuthManager.d.ts.map +1 -0
- package/dist/auth/AuthManager.js +137 -0
- package/dist/auth/AuthManager.js.map +1 -0
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +14 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/permissions.d.ts +60 -0
- package/dist/auth/permissions.d.ts.map +1 -0
- package/dist/auth/permissions.js +173 -0
- package/dist/auth/permissions.js.map +1 -0
- package/dist/client/VikunjaClientFactory.d.ts +32 -0
- package/dist/client/VikunjaClientFactory.d.ts.map +1 -0
- package/dist/client/VikunjaClientFactory.js +66 -0
- package/dist/client/VikunjaClientFactory.js.map +1 -0
- package/dist/client.d.ts +57 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +128 -0
- package/dist/client.js.map +1 -0
- package/dist/config/ConfigurationManager.d.ts +63 -0
- package/dist/config/ConfigurationManager.d.ts.map +1 -0
- package/dist/config/ConfigurationManager.js +243 -0
- package/dist/config/ConfigurationManager.js.map +1 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +27 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/types.d.ts +434 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +93 -0
- package/dist/config/types.js.map +1 -0
- package/dist/formatters/BatchImportResponseFormatter.d.ts +89 -0
- package/dist/formatters/BatchImportResponseFormatter.d.ts.map +1 -0
- package/dist/formatters/BatchImportResponseFormatter.js +125 -0
- package/dist/formatters/BatchImportResponseFormatter.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware/direct-middleware.d.ts +9 -0
- package/dist/middleware/direct-middleware.d.ts.map +1 -0
- package/dist/middleware/direct-middleware.js +49 -0
- package/dist/middleware/direct-middleware.js.map +1 -0
- package/dist/middleware/index.d.ts +8 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +21 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/simplified-rate-limit.d.ts +147 -0
- package/dist/middleware/simplified-rate-limit.d.ts.map +1 -0
- package/dist/middleware/simplified-rate-limit.js +542 -0
- package/dist/middleware/simplified-rate-limit.js.map +1 -0
- package/dist/parsers/CSVParser.d.ts +36 -0
- package/dist/parsers/CSVParser.d.ts.map +1 -0
- package/dist/parsers/CSVParser.js +69 -0
- package/dist/parsers/CSVParser.js.map +1 -0
- package/dist/parsers/InputParserFactory.d.ts +17 -0
- package/dist/parsers/InputParserFactory.d.ts.map +1 -0
- package/dist/parsers/InputParserFactory.js +137 -0
- package/dist/parsers/InputParserFactory.js.map +1 -0
- package/dist/parsers/JSONParser.d.ts +74 -0
- package/dist/parsers/JSONParser.d.ts.map +1 -0
- package/dist/parsers/JSONParser.js +69 -0
- package/dist/parsers/JSONParser.js.map +1 -0
- package/dist/services/EntityResolver.d.ts +75 -0
- package/dist/services/EntityResolver.d.ts.map +1 -0
- package/dist/services/EntityResolver.js +176 -0
- package/dist/services/EntityResolver.js.map +1 -0
- package/dist/services/TaskCreationService.d.ts +96 -0
- package/dist/services/TaskCreationService.d.ts.map +1 -0
- package/dist/services/TaskCreationService.js +361 -0
- package/dist/services/TaskCreationService.js.map +1 -0
- package/dist/storage/SimpleFilterStorage.d.ts +110 -0
- package/dist/storage/SimpleFilterStorage.d.ts.map +1 -0
- package/dist/storage/SimpleFilterStorage.js +358 -0
- package/dist/storage/SimpleFilterStorage.js.map +1 -0
- package/dist/storage/index.d.ts +59 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +117 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/tools/auth.d.ts +9 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +80 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/batch-import.d.ts +5 -0
- package/dist/tools/batch-import.d.ts.map +1 -0
- package/dist/tools/batch-import.js +150 -0
- package/dist/tools/batch-import.js.map +1 -0
- package/dist/tools/export.d.ts +14 -0
- package/dist/tools/export.d.ts.map +1 -0
- package/dist/tools/export.js +232 -0
- package/dist/tools/export.js.map +1 -0
- package/dist/tools/filters.d.ts +8 -0
- package/dist/tools/filters.d.ts.map +1 -0
- package/dist/tools/filters.js +419 -0
- package/dist/tools/filters.js.map +1 -0
- package/dist/tools/index.d.ts +36 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +87 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/labels.d.ts +9 -0
- package/dist/tools/labels.d.ts.map +1 -0
- package/dist/tools/labels.js +152 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/projects/crud.d.ts +118 -0
- package/dist/tools/projects/crud.d.ts.map +1 -0
- package/dist/tools/projects/crud.js +389 -0
- package/dist/tools/projects/crud.js.map +1 -0
- package/dist/tools/projects/hierarchy.d.ts +68 -0
- package/dist/tools/projects/hierarchy.d.ts.map +1 -0
- package/dist/tools/projects/hierarchy.js +280 -0
- package/dist/tools/projects/hierarchy.js.map +1 -0
- package/dist/tools/projects/index.d.ts +17 -0
- package/dist/tools/projects/index.d.ts.map +1 -0
- package/dist/tools/projects/index.js +169 -0
- package/dist/tools/projects/index.js.map +1 -0
- package/dist/tools/projects/response-formatter.d.ts +46 -0
- package/dist/tools/projects/response-formatter.d.ts.map +1 -0
- package/dist/tools/projects/response-formatter.js +131 -0
- package/dist/tools/projects/response-formatter.js.map +1 -0
- package/dist/tools/projects/sharing.d.ts +89 -0
- package/dist/tools/projects/sharing.d.ts.map +1 -0
- package/dist/tools/projects/sharing.js +272 -0
- package/dist/tools/projects/sharing.js.map +1 -0
- package/dist/tools/projects/validation.d.ts +39 -0
- package/dist/tools/projects/validation.d.ts.map +1 -0
- package/dist/tools/projects/validation.js +129 -0
- package/dist/tools/projects/validation.js.map +1 -0
- package/dist/tools/projects.d.ts +10 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +42 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/task-assignees.d.ts +13 -0
- package/dist/tools/task-assignees.d.ts.map +1 -0
- package/dist/tools/task-assignees.js +62 -0
- package/dist/tools/task-assignees.js.map +1 -0
- package/dist/tools/task-bulk.d.ts +13 -0
- package/dist/tools/task-bulk.d.ts.map +1 -0
- package/dist/tools/task-bulk.js +113 -0
- package/dist/tools/task-bulk.js.map +1 -0
- package/dist/tools/task-comments.d.ts +13 -0
- package/dist/tools/task-comments.d.ts.map +1 -0
- package/dist/tools/task-comments.js +53 -0
- package/dist/tools/task-comments.js.map +1 -0
- package/dist/tools/task-crud.d.ts +13 -0
- package/dist/tools/task-crud.d.ts.map +1 -0
- package/dist/tools/task-crud.js +163 -0
- package/dist/tools/task-crud.js.map +1 -0
- package/dist/tools/task-labels.d.ts +13 -0
- package/dist/tools/task-labels.d.ts.map +1 -0
- package/dist/tools/task-labels.js +62 -0
- package/dist/tools/task-labels.js.map +1 -0
- package/dist/tools/task-relations.d.ts +13 -0
- package/dist/tools/task-relations.d.ts.map +1 -0
- package/dist/tools/task-relations.js +72 -0
- package/dist/tools/task-relations.js.map +1 -0
- package/dist/tools/task-reminders.d.ts +13 -0
- package/dist/tools/task-reminders.d.ts.map +1 -0
- package/dist/tools/task-reminders.js +63 -0
- package/dist/tools/task-reminders.js.map +1 -0
- package/dist/tools/tasks/assignees/AssigneeOperationsService.d.ts +31 -0
- package/dist/tools/tasks/assignees/AssigneeOperationsService.d.ts.map +1 -0
- package/dist/tools/tasks/assignees/AssigneeOperationsService.js +95 -0
- package/dist/tools/tasks/assignees/AssigneeOperationsService.js.map +1 -0
- package/dist/tools/tasks/assignees/AssigneeResponseFormatter.d.ts +32 -0
- package/dist/tools/tasks/assignees/AssigneeResponseFormatter.d.ts.map +1 -0
- package/dist/tools/tasks/assignees/AssigneeResponseFormatter.js +84 -0
- package/dist/tools/tasks/assignees/AssigneeResponseFormatter.js.map +1 -0
- package/dist/tools/tasks/assignees/AssigneeValidationService.d.ts +36 -0
- package/dist/tools/tasks/assignees/AssigneeValidationService.d.ts.map +1 -0
- package/dist/tools/tasks/assignees/AssigneeValidationService.js +63 -0
- package/dist/tools/tasks/assignees/AssigneeValidationService.js.map +1 -0
- package/dist/tools/tasks/assignees/index.d.ts +40 -0
- package/dist/tools/tasks/assignees/index.d.ts.map +1 -0
- package/dist/tools/tasks/assignees/index.js +72 -0
- package/dist/tools/tasks/assignees/index.js.map +1 -0
- package/dist/tools/tasks/bulk/BulkOperationValidator.d.ts +51 -0
- package/dist/tools/tasks/bulk/BulkOperationValidator.d.ts.map +1 -0
- package/dist/tools/tasks/bulk/BulkOperationValidator.js +149 -0
- package/dist/tools/tasks/bulk/BulkOperationValidator.js.map +1 -0
- package/dist/tools/tasks/bulk-operations-simplified.d.ts +39 -0
- package/dist/tools/tasks/bulk-operations-simplified.d.ts.map +1 -0
- package/dist/tools/tasks/bulk-operations-simplified.js +249 -0
- package/dist/tools/tasks/bulk-operations-simplified.js.map +1 -0
- package/dist/tools/tasks/bulk-operations.d.ts +8 -0
- package/dist/tools/tasks/bulk-operations.d.ts.map +1 -0
- package/dist/tools/tasks/bulk-operations.js +14 -0
- package/dist/tools/tasks/bulk-operations.js.map +1 -0
- package/dist/tools/tasks/comments/CommentOperationsService.d.ts +23 -0
- package/dist/tools/tasks/comments/CommentOperationsService.d.ts.map +1 -0
- package/dist/tools/tasks/comments/CommentOperationsService.js +37 -0
- package/dist/tools/tasks/comments/CommentOperationsService.js.map +1 -0
- package/dist/tools/tasks/comments/CommentResponseFormatter.d.ts +29 -0
- package/dist/tools/tasks/comments/CommentResponseFormatter.d.ts.map +1 -0
- package/dist/tools/tasks/comments/CommentResponseFormatter.js +69 -0
- package/dist/tools/tasks/comments/CommentResponseFormatter.js.map +1 -0
- package/dist/tools/tasks/comments/CommentValidationService.d.ts +33 -0
- package/dist/tools/tasks/comments/CommentValidationService.d.ts.map +1 -0
- package/dist/tools/tasks/comments/CommentValidationService.js +50 -0
- package/dist/tools/tasks/comments/CommentValidationService.js.map +1 -0
- package/dist/tools/tasks/comments/index.d.ts +38 -0
- package/dist/tools/tasks/comments/index.d.ts.map +1 -0
- package/dist/tools/tasks/comments/index.js +62 -0
- package/dist/tools/tasks/comments/index.js.map +1 -0
- package/dist/tools/tasks/constants.d.ts +17 -0
- package/dist/tools/tasks/constants.d.ts.map +1 -0
- package/dist/tools/tasks/constants.js +36 -0
- package/dist/tools/tasks/constants.js.map +1 -0
- package/dist/tools/tasks/crud/TaskCreationService.d.ts +26 -0
- package/dist/tools/tasks/crud/TaskCreationService.d.ts.map +1 -0
- package/dist/tools/tasks/crud/TaskCreationService.js +228 -0
- package/dist/tools/tasks/crud/TaskCreationService.js.map +1 -0
- package/dist/tools/tasks/crud/TaskDeletionService.d.ts +18 -0
- package/dist/tools/tasks/crud/TaskDeletionService.d.ts.map +1 -0
- package/dist/tools/tasks/crud/TaskDeletionService.js +89 -0
- package/dist/tools/tasks/crud/TaskDeletionService.js.map +1 -0
- package/dist/tools/tasks/crud/TaskReadService.d.ts +18 -0
- package/dist/tools/tasks/crud/TaskReadService.d.ts.map +1 -0
- package/dist/tools/tasks/crud/TaskReadService.js +58 -0
- package/dist/tools/tasks/crud/TaskReadService.js.map +1 -0
- package/dist/tools/tasks/crud/TaskResponseFormatter.d.ts +18 -0
- package/dist/tools/tasks/crud/TaskResponseFormatter.d.ts.map +1 -0
- package/dist/tools/tasks/crud/TaskResponseFormatter.js +244 -0
- package/dist/tools/tasks/crud/TaskResponseFormatter.js.map +1 -0
- package/dist/tools/tasks/crud/TaskUpdateService.d.ts +29 -0
- package/dist/tools/tasks/crud/TaskUpdateService.d.ts.map +1 -0
- package/dist/tools/tasks/crud/TaskUpdateService.js +231 -0
- package/dist/tools/tasks/crud/TaskUpdateService.js.map +1 -0
- package/dist/tools/tasks/crud/index.d.ts +16 -0
- package/dist/tools/tasks/crud/index.d.ts.map +1 -0
- package/dist/tools/tasks/crud/index.js +20 -0
- package/dist/tools/tasks/crud/index.js.map +1 -0
- package/dist/tools/tasks/filtering/FilterExecutor.d.ts +38 -0
- package/dist/tools/tasks/filtering/FilterExecutor.d.ts.map +1 -0
- package/dist/tools/tasks/filtering/FilterExecutor.js +200 -0
- package/dist/tools/tasks/filtering/FilterExecutor.js.map +1 -0
- package/dist/tools/tasks/filtering/FilterValidator.d.ts +56 -0
- package/dist/tools/tasks/filtering/FilterValidator.d.ts.map +1 -0
- package/dist/tools/tasks/filtering/FilterValidator.js +183 -0
- package/dist/tools/tasks/filtering/FilterValidator.js.map +1 -0
- package/dist/tools/tasks/filtering/TaskFilteringOrchestrator.d.ts +75 -0
- package/dist/tools/tasks/filtering/TaskFilteringOrchestrator.d.ts.map +1 -0
- package/dist/tools/tasks/filtering/TaskFilteringOrchestrator.js +193 -0
- package/dist/tools/tasks/filtering/TaskFilteringOrchestrator.js.map +1 -0
- package/dist/tools/tasks/filtering/evaluators.d.ts +38 -0
- package/dist/tools/tasks/filtering/evaluators.d.ts.map +1 -0
- package/dist/tools/tasks/filtering/evaluators.js +200 -0
- package/dist/tools/tasks/filtering/evaluators.js.map +1 -0
- package/dist/tools/tasks/filtering/index.d.ts +11 -0
- package/dist/tools/tasks/filtering/index.d.ts.map +1 -0
- package/dist/tools/tasks/filtering/index.js +26 -0
- package/dist/tools/tasks/filtering/index.js.map +1 -0
- package/dist/tools/tasks/index.d.ts +9 -0
- package/dist/tools/tasks/index.d.ts.map +1 -0
- package/dist/tools/tasks/index.js +245 -0
- package/dist/tools/tasks/index.js.map +1 -0
- package/dist/tools/tasks/labels.d.ts +39 -0
- package/dist/tools/tasks/labels.d.ts.map +1 -0
- package/dist/tools/tasks/labels.js +150 -0
- package/dist/tools/tasks/labels.js.map +1 -0
- package/dist/tools/tasks/reminders.d.ts +39 -0
- package/dist/tools/tasks/reminders.d.ts.map +1 -0
- package/dist/tools/tasks/reminders.js +147 -0
- package/dist/tools/tasks/reminders.js.map +1 -0
- package/dist/tools/tasks/types/filters.d.ts +121 -0
- package/dist/tools/tasks/types/filters.d.ts.map +1 -0
- package/dist/tools/tasks/types/filters.js +7 -0
- package/dist/tools/tasks/types/filters.js.map +1 -0
- package/dist/tools/tasks/validation.d.ts +44 -0
- package/dist/tools/tasks/validation.d.ts.map +1 -0
- package/dist/tools/tasks/validation.js +121 -0
- package/dist/tools/tasks/validation.js.map +1 -0
- package/dist/tools/tasks-relations.d.ts +24 -0
- package/dist/tools/tasks-relations.d.ts.map +1 -0
- package/dist/tools/tasks-relations.js +203 -0
- package/dist/tools/tasks-relations.js.map +1 -0
- package/dist/tools/tasks.d.ts +6 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +10 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/teams.d.ts +9 -0
- package/dist/tools/teams.d.ts.map +1 -0
- package/dist/tools/teams.js +332 -0
- package/dist/tools/teams.js.map +1 -0
- package/dist/tools/templates.d.ts +9 -0
- package/dist/tools/templates.d.ts.map +1 -0
- package/dist/tools/templates.js +356 -0
- package/dist/tools/templates.js.map +1 -0
- package/dist/tools/users.d.ts +9 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +239 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/tools/webhooks.d.ts +11 -0
- package/dist/tools/webhooks.d.ts.map +1 -0
- package/dist/tools/webhooks.js +378 -0
- package/dist/tools/webhooks.js.map +1 -0
- package/dist/transforms/base.d.ts +178 -0
- package/dist/transforms/base.d.ts.map +1 -0
- package/dist/transforms/base.js +134 -0
- package/dist/transforms/base.js.map +1 -0
- package/dist/transforms/field-selector.d.ts +27 -0
- package/dist/transforms/field-selector.d.ts.map +1 -0
- package/dist/transforms/field-selector.js +91 -0
- package/dist/transforms/field-selector.js.map +1 -0
- package/dist/transforms/task.d.ts +207 -0
- package/dist/transforms/task.d.ts.map +1 -0
- package/dist/transforms/task.js +259 -0
- package/dist/transforms/task.js.map +1 -0
- package/dist/types/errors.d.ts +55 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +44 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/filters.d.ts +146 -0
- package/dist/types/filters.d.ts.map +1 -0
- package/dist/types/filters.js +22 -0
- package/dist/types/filters.js.map +1 -0
- package/dist/types/index.d.ts +151 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +24 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/node-vikunja-extended.d.ts +36 -0
- package/dist/types/node-vikunja-extended.d.ts.map +1 -0
- package/dist/types/node-vikunja-extended.js +25 -0
- package/dist/types/node-vikunja-extended.js.map +1 -0
- package/dist/types/responses.d.ts +118 -0
- package/dist/types/responses.d.ts.map +1 -0
- package/dist/types/responses.js +26 -0
- package/dist/types/responses.js.map +1 -0
- package/dist/types/vikunja.d.ts +315 -0
- package/dist/types/vikunja.d.ts.map +1 -0
- package/dist/types/vikunja.js +7 -0
- package/dist/types/vikunja.js.map +1 -0
- package/dist/utils/auth-error-handler.d.ts +23 -0
- package/dist/utils/auth-error-handler.d.ts.map +1 -0
- package/dist/utils/auth-error-handler.js +162 -0
- package/dist/utils/auth-error-handler.js.map +1 -0
- package/dist/utils/error-handler.d.ts +38 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +288 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/filtering/ClientSideFilteringStrategy.d.ts +13 -0
- package/dist/utils/filtering/ClientSideFilteringStrategy.d.ts.map +1 -0
- package/dist/utils/filtering/ClientSideFilteringStrategy.js +63 -0
- package/dist/utils/filtering/ClientSideFilteringStrategy.js.map +1 -0
- package/dist/utils/filtering/FilteringContext.d.ts +27 -0
- package/dist/utils/filtering/FilteringContext.d.ts.map +1 -0
- package/dist/utils/filtering/FilteringContext.js +43 -0
- package/dist/utils/filtering/FilteringContext.js.map +1 -0
- package/dist/utils/filtering/HybridFilteringStrategy.d.ts +15 -0
- package/dist/utils/filtering/HybridFilteringStrategy.d.ts.map +1 -0
- package/dist/utils/filtering/HybridFilteringStrategy.js +55 -0
- package/dist/utils/filtering/HybridFilteringStrategy.js.map +1 -0
- package/dist/utils/filtering/ServerSideFilteringStrategy.d.ts +13 -0
- package/dist/utils/filtering/ServerSideFilteringStrategy.d.ts.map +1 -0
- package/dist/utils/filtering/ServerSideFilteringStrategy.js +64 -0
- package/dist/utils/filtering/ServerSideFilteringStrategy.js.map +1 -0
- package/dist/utils/filtering/TaskFilteringStrategy.d.ts +19 -0
- package/dist/utils/filtering/TaskFilteringStrategy.d.ts.map +1 -0
- package/dist/utils/filtering/TaskFilteringStrategy.js +10 -0
- package/dist/utils/filtering/TaskFilteringStrategy.js.map +1 -0
- package/dist/utils/filtering/index.d.ts +13 -0
- package/dist/utils/filtering/index.d.ts.map +1 -0
- package/dist/utils/filtering/index.js +20 -0
- package/dist/utils/filtering/index.js.map +1 -0
- package/dist/utils/filtering/types.d.ts +62 -0
- package/dist/utils/filtering/types.d.ts.map +1 -0
- package/dist/utils/filtering/types.js +6 -0
- package/dist/utils/filtering/types.js.map +1 -0
- package/dist/utils/filters.d.ts +97 -0
- package/dist/utils/filters.d.ts.map +1 -0
- package/dist/utils/filters.js +939 -0
- package/dist/utils/filters.js.map +1 -0
- package/dist/utils/logger.d.ts +26 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +83 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/memory.d.ts +71 -0
- package/dist/utils/memory.d.ts.map +1 -0
- package/dist/utils/memory.js +194 -0
- package/dist/utils/memory.js.map +1 -0
- package/dist/utils/performance/batch-processor.d.ts +77 -0
- package/dist/utils/performance/batch-processor.d.ts.map +1 -0
- package/dist/utils/performance/batch-processor.js +218 -0
- package/dist/utils/performance/batch-processor.js.map +1 -0
- package/dist/utils/performance/index.d.ts +42 -0
- package/dist/utils/performance/index.d.ts.map +1 -0
- package/dist/utils/performance/index.js +49 -0
- package/dist/utils/performance/index.js.map +1 -0
- package/dist/utils/performance/performance-monitor.d.ts +116 -0
- package/dist/utils/performance/performance-monitor.d.ts.map +1 -0
- package/dist/utils/performance/performance-monitor.js +307 -0
- package/dist/utils/performance/performance-monitor.js.map +1 -0
- package/dist/utils/response-factory.d.ts +81 -0
- package/dist/utils/response-factory.d.ts.map +1 -0
- package/dist/utils/response-factory.js +86 -0
- package/dist/utils/response-factory.js.map +1 -0
- package/dist/utils/retry.d.ts +146 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +281 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/security.d.ts +70 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +358 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/simple-response.d.ts +75 -0
- package/dist/utils/simple-response.d.ts.map +1 -0
- package/dist/utils/simple-response.js +208 -0
- package/dist/utils/simple-response.js.map +1 -0
- package/dist/utils/storage-errors.d.ts +9 -0
- package/dist/utils/storage-errors.d.ts.map +1 -0
- package/dist/utils/storage-errors.js +20 -0
- package/dist/utils/storage-errors.js.map +1 -0
- package/dist/utils/unicode-fix.d.ts +19 -0
- package/dist/utils/unicode-fix.d.ts.map +1 -0
- package/dist/utils/unicode-fix.js +70 -0
- package/dist/utils/unicode-fix.js.map +1 -0
- package/dist/utils/validation.d.ts +103 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +729 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +148 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Filter execution engine for task filtering operations
|
|
4
|
+
* Handles the execution of filters and applies additional post-processing
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.FilterExecutor = void 0;
|
|
8
|
+
const filtering_1 = require("../../../utils/filtering");
|
|
9
|
+
const memory_1 = require("../../../utils/memory");
|
|
10
|
+
const types_1 = require("../../../types");
|
|
11
|
+
const logger_1 = require("../../../utils/logger");
|
|
12
|
+
/**
|
|
13
|
+
* Executes filtering operations on tasks with comprehensive error handling
|
|
14
|
+
*/
|
|
15
|
+
exports.FilterExecutor = {
|
|
16
|
+
/**
|
|
17
|
+
* Executes task filtering with the provided parameters
|
|
18
|
+
*/
|
|
19
|
+
async executeFiltering(args, filterExpression, filterString, params, _storage) {
|
|
20
|
+
try {
|
|
21
|
+
// Execute filtering using strategy pattern
|
|
22
|
+
const filteringContext = new filtering_1.FilteringContext({
|
|
23
|
+
enableServerSide: Boolean(filterString)
|
|
24
|
+
});
|
|
25
|
+
const filteringParams = {
|
|
26
|
+
args: args,
|
|
27
|
+
filterExpression,
|
|
28
|
+
filterString,
|
|
29
|
+
params
|
|
30
|
+
};
|
|
31
|
+
const filteringResult = await filteringContext.execute(filteringParams);
|
|
32
|
+
const tasks = filteringResult.tasks;
|
|
33
|
+
// Extract metadata for response formatting
|
|
34
|
+
const { serverSideFilteringUsed, serverSideFilteringAttempted, } = filteringResult.metadata;
|
|
35
|
+
// Additional memory protection: validate actual loaded task count
|
|
36
|
+
const actualTaskCount = tasks.length;
|
|
37
|
+
const finalTaskCountValidation = (0, memory_1.validateTaskCountLimit)(actualTaskCount);
|
|
38
|
+
let memoryInfo;
|
|
39
|
+
if (!finalTaskCountValidation.allowed) {
|
|
40
|
+
// Log warning but don't fail since tasks are already loaded
|
|
41
|
+
logger_1.logger.warn('Loaded task count exceeds recommended limits', {
|
|
42
|
+
actualCount: actualTaskCount,
|
|
43
|
+
maxRecommended: finalTaskCountValidation.maxAllowed,
|
|
44
|
+
estimatedMemoryMB: finalTaskCountValidation.estimatedMemoryMB
|
|
45
|
+
});
|
|
46
|
+
memoryInfo = {
|
|
47
|
+
actualCount: actualTaskCount,
|
|
48
|
+
maxAllowed: finalTaskCountValidation.maxAllowed,
|
|
49
|
+
estimatedMemoryMB: finalTaskCountValidation.estimatedMemoryMB
|
|
50
|
+
};
|
|
51
|
+
// For extremely large datasets, still enforce hard limits
|
|
52
|
+
if (actualTaskCount > finalTaskCountValidation.maxAllowed * 1.5) {
|
|
53
|
+
throw new types_1.MCPError(types_1.ErrorCode.INTERNAL_ERROR, (0, memory_1.createTaskLimitExceededMessage)('process loaded tasks', actualTaskCount));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Log memory usage for monitoring
|
|
57
|
+
(0, memory_1.logMemoryUsage)('task listing', actualTaskCount);
|
|
58
|
+
// Apply post-processing filters
|
|
59
|
+
const processedTasks = exports.FilterExecutor.applyPostProcessingFilters(tasks, args);
|
|
60
|
+
// Determine filtering method message and metadata from strategy result
|
|
61
|
+
const filteringMetadata = exports.FilterExecutor.createFilteringMetadata(filterString, serverSideFilteringUsed, serverSideFilteringAttempted, filteringResult.metadata.filteringNote);
|
|
62
|
+
// Build return object, only including defined properties to satisfy exactOptionalPropertyTypes
|
|
63
|
+
const result = {
|
|
64
|
+
success: true,
|
|
65
|
+
tasks: processedTasks,
|
|
66
|
+
metadata: filteringMetadata,
|
|
67
|
+
};
|
|
68
|
+
if (memoryInfo !== undefined) {
|
|
69
|
+
result.memoryInfo = memoryInfo;
|
|
70
|
+
}
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if (error instanceof types_1.MCPError) {
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
// Log the full error for debugging filter issues
|
|
78
|
+
logger_1.logger.error('Task filtering execution error:', {
|
|
79
|
+
error: error instanceof Error ? error.message : String(error),
|
|
80
|
+
params: params,
|
|
81
|
+
filter: args.filter,
|
|
82
|
+
filterId: args.filterId,
|
|
83
|
+
});
|
|
84
|
+
// Re-throw original error to be handled by main function
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Applies post-processing filters that aren't handled by the main filtering strategies
|
|
90
|
+
*/
|
|
91
|
+
applyPostProcessingFilters(tasks, args) {
|
|
92
|
+
let filteredTasks = [...tasks];
|
|
93
|
+
// Filter by done status if specified (this is a simpler filter that works)
|
|
94
|
+
if (args.done !== undefined) {
|
|
95
|
+
filteredTasks = filteredTasks.filter((task) => task.done === args.done);
|
|
96
|
+
}
|
|
97
|
+
return filteredTasks;
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* Creates filtering metadata for response formatting
|
|
101
|
+
*/
|
|
102
|
+
createFilteringMetadata(filterString, serverSideFilteringUsed, serverSideFilteringAttempted, filteringNote) {
|
|
103
|
+
if (filterString) {
|
|
104
|
+
if (serverSideFilteringUsed) {
|
|
105
|
+
return {
|
|
106
|
+
serverSideFilteringUsed: true,
|
|
107
|
+
serverSideFilteringAttempted: true,
|
|
108
|
+
clientSideFiltering: false,
|
|
109
|
+
filteringNote,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
else if (serverSideFilteringAttempted) {
|
|
113
|
+
return {
|
|
114
|
+
serverSideFilteringUsed: false,
|
|
115
|
+
serverSideFilteringAttempted: true,
|
|
116
|
+
clientSideFiltering: true,
|
|
117
|
+
filteringNote,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return {
|
|
122
|
+
serverSideFilteringUsed: false,
|
|
123
|
+
serverSideFilteringAttempted: false,
|
|
124
|
+
clientSideFiltering: true,
|
|
125
|
+
filteringNote,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
return {
|
|
131
|
+
serverSideFilteringUsed: false,
|
|
132
|
+
serverSideFilteringAttempted: false,
|
|
133
|
+
clientSideFiltering: false,
|
|
134
|
+
filteringNote,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* Prepares query parameters for API calls
|
|
140
|
+
*/
|
|
141
|
+
prepareQueryParameters(args) {
|
|
142
|
+
const params = {};
|
|
143
|
+
// Build query parameters
|
|
144
|
+
if (args.page !== undefined)
|
|
145
|
+
params.page = args.page;
|
|
146
|
+
if (args.perPage !== undefined)
|
|
147
|
+
params.per_page = args.perPage;
|
|
148
|
+
if (args.search !== undefined)
|
|
149
|
+
params.s = args.search;
|
|
150
|
+
if (args.sort !== undefined)
|
|
151
|
+
params.sort_by = args.sort;
|
|
152
|
+
// Memory protection: Check if we should implement pagination limits
|
|
153
|
+
// Note: Vikunja API doesn't provide task count endpoints, so we use conservative defaults
|
|
154
|
+
// and rely on user-provided pagination parameters
|
|
155
|
+
if (!params.per_page) {
|
|
156
|
+
// Set default pagination to prevent unbounded loading
|
|
157
|
+
params.per_page = 1000; // Conservative default
|
|
158
|
+
if (!params.page) {
|
|
159
|
+
params.page = 1;
|
|
160
|
+
}
|
|
161
|
+
logger_1.logger.info('Applied default pagination for memory protection', {
|
|
162
|
+
per_page: params.per_page,
|
|
163
|
+
page: params.page
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return params;
|
|
167
|
+
},
|
|
168
|
+
/**
|
|
169
|
+
* Validates loaded tasks against memory constraints
|
|
170
|
+
*/
|
|
171
|
+
validateLoadedTaskCount(tasks) {
|
|
172
|
+
const actualTaskCount = tasks.length;
|
|
173
|
+
const finalTaskCountValidation = (0, memory_1.validateTaskCountLimit)(actualTaskCount);
|
|
174
|
+
const warnings = [];
|
|
175
|
+
if (!finalTaskCountValidation.allowed) {
|
|
176
|
+
// Log warning but don't fail since tasks are already loaded
|
|
177
|
+
logger_1.logger.warn('Loaded task count exceeds recommended limits', {
|
|
178
|
+
actualCount: actualTaskCount,
|
|
179
|
+
maxRecommended: finalTaskCountValidation.maxAllowed,
|
|
180
|
+
estimatedMemoryMB: finalTaskCountValidation.estimatedMemoryMB
|
|
181
|
+
});
|
|
182
|
+
warnings.push(`Loaded ${actualTaskCount} tasks, which exceeds recommended limit of ${finalTaskCountValidation.maxAllowed}. ` +
|
|
183
|
+
`Estimated memory usage: ${finalTaskCountValidation.estimatedMemoryMB}MB.`);
|
|
184
|
+
// For extremely large datasets, still enforce hard limits
|
|
185
|
+
if (actualTaskCount > finalTaskCountValidation.maxAllowed * 1.5) {
|
|
186
|
+
return {
|
|
187
|
+
isValid: false,
|
|
188
|
+
warnings,
|
|
189
|
+
shouldThrow: true
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
isValid: true,
|
|
195
|
+
warnings,
|
|
196
|
+
shouldThrow: false
|
|
197
|
+
};
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
//# sourceMappingURL=FilterExecutor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterExecutor.js","sourceRoot":"","sources":["../../../../src/tools/tasks/filtering/FilterExecutor.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,wDAA4D;AAC5D,kDAA+G;AAC/G,0CAAqD;AACrD,kDAA+C;AAE/C;;GAEG;AACU,QAAA,cAAc,GAAG;IAC5B;;OAEG;IACH,KAAK,CAAC,gBAAgB,CACpB,IAAqB,EACrB,gBAAyC,EACzC,YAAgC,EAChC,MAAsB,EACtB,QAA2B;QAE3B,IAAI,CAAC;YACH,2CAA2C;YAC3C,MAAM,gBAAgB,GAAG,IAAI,4BAAgB,CAAC;gBAC5C,gBAAgB,EAAE,OAAO,CAAC,YAAY,CAAC;aACxC,CAAC,CAAC;YAEH,MAAM,eAAe,GAAoB;gBACvC,IAAI,EAAE,IAAqB;gBAC3B,gBAAgB;gBAChB,YAAY;gBACZ,MAAM;aACP,CAAC;YAEF,MAAM,eAAe,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe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1
|
+
/**
|
|
2
|
+
* Filter validation for task filtering operations
|
|
3
|
+
* Handles validation of filter expressions and task listing parameters
|
|
4
|
+
*/
|
|
5
|
+
import type { Task } from 'node-vikunja';
|
|
6
|
+
import type { FilterExpression } from '../../../types/filters';
|
|
7
|
+
import type { TaskListingArgs, TaskFilterValidationConfig, TaskFilterStorage } from '../types/filters';
|
|
8
|
+
/**
|
|
9
|
+
* Validates filter parameters for task listing operations
|
|
10
|
+
*/
|
|
11
|
+
export declare const FilterValidator: {
|
|
12
|
+
/**
|
|
13
|
+
* Validates and processes filter string or filter ID
|
|
14
|
+
*/
|
|
15
|
+
validateAndParseFilter(args: TaskListingArgs, storage: TaskFilterStorage): Promise<{
|
|
16
|
+
filterExpression: FilterExpression | null;
|
|
17
|
+
filterString: string | undefined;
|
|
18
|
+
validationWarnings: string[];
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Validates pagination and memory constraints
|
|
22
|
+
*/
|
|
23
|
+
validateMemoryConstraints(args: TaskListingArgs, requestedPageSize: number): {
|
|
24
|
+
isValid: boolean;
|
|
25
|
+
warnings: string[];
|
|
26
|
+
maxAllowed?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Validates the actual loaded task count against limits
|
|
30
|
+
*/
|
|
31
|
+
validateLoadedTasks(actualTaskCount: number, sampleTask?: Task): {
|
|
32
|
+
isValid: boolean;
|
|
33
|
+
warnings: string[];
|
|
34
|
+
shouldThrow: boolean;
|
|
35
|
+
riskLevel?: "low" | "medium" | "high";
|
|
36
|
+
estimatedMemoryMB?: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Validates task listing arguments
|
|
40
|
+
*/
|
|
41
|
+
validateTaskListingArgs(args: TaskListingArgs): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Performs comprehensive validation of task filtering parameters
|
|
44
|
+
*/
|
|
45
|
+
validateTaskFiltering(args: TaskListingArgs, storage: TaskFilterStorage, _config?: TaskFilterValidationConfig): Promise<{
|
|
46
|
+
filterExpression: FilterExpression | null;
|
|
47
|
+
filterString: string | undefined;
|
|
48
|
+
validationWarnings: string[];
|
|
49
|
+
memoryValidation: {
|
|
50
|
+
isValid: boolean;
|
|
51
|
+
warnings: string[];
|
|
52
|
+
maxAllowed?: number;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=FilterValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterValidator.d.ts","sourceRoot":"","sources":["../../../../src/tools/tasks/filtering/FilterValidator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAMvG;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;iCAEK,eAAe,WACZ,iBAAiB,GACzB,OAAO,CAAC;QACT,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;QAC1C,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;QACjC,kBAAkB,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;IAiDF;;OAEG;oCAEK,eAAe,qBACF,MAAM,GACxB;QACD,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB;IA6CD;;OAEG;yCACkC,MAAM,eAAe,IAAI,GAAG;QAC/D,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,WAAW,EAAE,OAAO,CAAC;QACrB,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;QACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;IA4CD;;OAEG;kCAC2B,eAAe,GAAG,MAAM,EAAE;IAyCxD;;OAEG;gCAEK,eAAe,WACZ,iBAAiB,YACjB,0BAA0B,GAClC,OAAO,CAAC;QACT,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;QAC1C,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;QACjC,kBAAkB,EAAE,MAAM,EAAE,CAAC;QAC7B,gBAAgB,EAAE;YAChB,OAAO,EAAE,OAAO,CAAC;YACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;CA4BH,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Filter validation for task filtering operations
|
|
4
|
+
* Handles validation of filter expressions and task listing parameters
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.FilterValidator = void 0;
|
|
8
|
+
const types_1 = require("../../../types");
|
|
9
|
+
const filters_1 = require("../../../utils/filters");
|
|
10
|
+
const memory_1 = require("../../../utils/memory");
|
|
11
|
+
const logger_1 = require("../../../utils/logger");
|
|
12
|
+
/**
|
|
13
|
+
* Validates filter parameters for task listing operations
|
|
14
|
+
*/
|
|
15
|
+
exports.FilterValidator = {
|
|
16
|
+
/**
|
|
17
|
+
* Validates and processes filter string or filter ID
|
|
18
|
+
*/
|
|
19
|
+
async validateAndParseFilter(args, storage) {
|
|
20
|
+
let filterExpression = null;
|
|
21
|
+
let filterString;
|
|
22
|
+
const validationWarnings = [];
|
|
23
|
+
try {
|
|
24
|
+
// Handle filter - either direct filter string or saved filter ID
|
|
25
|
+
if (args.filterId) {
|
|
26
|
+
const savedFilter = await storage.get(args.filterId);
|
|
27
|
+
if (!savedFilter) {
|
|
28
|
+
throw new types_1.MCPError(types_1.ErrorCode.VALIDATION_ERROR, `Filter with id ${args.filterId} not found`);
|
|
29
|
+
}
|
|
30
|
+
filterString = savedFilter.filter;
|
|
31
|
+
}
|
|
32
|
+
else if (args.filter !== undefined) {
|
|
33
|
+
filterString = args.filter;
|
|
34
|
+
}
|
|
35
|
+
// Parse the filter string for client-side filtering
|
|
36
|
+
if (filterString) {
|
|
37
|
+
const parseResult = (0, filters_1.parseFilterString)(filterString);
|
|
38
|
+
if (parseResult.error) {
|
|
39
|
+
throw new types_1.MCPError(types_1.ErrorCode.VALIDATION_ERROR, `Invalid filter syntax: ${parseResult.error.message}${parseResult.error.context ? `\n${parseResult.error.context}` : ''}`);
|
|
40
|
+
}
|
|
41
|
+
filterExpression = parseResult.expression;
|
|
42
|
+
// Log that we're preparing to attempt hybrid filtering
|
|
43
|
+
logger_1.logger.info('Preparing hybrid filtering (server-side attempt + client-side fallback)', {
|
|
44
|
+
filter: filterString,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return { filterExpression, filterString, validationWarnings };
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (error instanceof types_1.MCPError) {
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
throw new types_1.MCPError(types_1.ErrorCode.VALIDATION_ERROR, `Filter validation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Validates pagination and memory constraints
|
|
58
|
+
*/
|
|
59
|
+
validateMemoryConstraints(args, requestedPageSize) {
|
|
60
|
+
const warnings = [];
|
|
61
|
+
// Validate pagination limits for memory protection with enhanced analysis
|
|
62
|
+
const taskCountValidation = (0, memory_1.validateTaskCountLimit)(requestedPageSize, undefined, args.filter ? {
|
|
63
|
+
filterExpression: args.filter,
|
|
64
|
+
operationType: 'list'
|
|
65
|
+
} : undefined);
|
|
66
|
+
if (!taskCountValidation.allowed) {
|
|
67
|
+
throw new types_1.MCPError(types_1.ErrorCode.VALIDATION_ERROR, `Task count limit exceeded. Requested: ${requestedPageSize}, Max allowed: ${taskCountValidation.maxAllowed}. ` +
|
|
68
|
+
`Estimated memory usage: ${taskCountValidation.estimatedMemoryMB}MB (risk: ${taskCountValidation.riskLevel}). ` +
|
|
69
|
+
'Reduce the perPage parameter, use pagination with smaller page sizes, or apply more specific filters.');
|
|
70
|
+
}
|
|
71
|
+
// Add warnings for large page sizes
|
|
72
|
+
if (requestedPageSize > 500) {
|
|
73
|
+
warnings.push(`Large page size (${requestedPageSize}) may impact performance. Consider using smaller pages or more specific filters.`);
|
|
74
|
+
}
|
|
75
|
+
// Include enhanced memory validation warnings
|
|
76
|
+
if (taskCountValidation.warnings.length > 0) {
|
|
77
|
+
warnings.push(...taskCountValidation.warnings);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
isValid: true,
|
|
81
|
+
warnings,
|
|
82
|
+
maxAllowed: taskCountValidation.maxAllowed
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Validates the actual loaded task count against limits
|
|
87
|
+
*/
|
|
88
|
+
validateLoadedTasks(actualTaskCount, sampleTask) {
|
|
89
|
+
const warnings = [];
|
|
90
|
+
const finalTaskCountValidation = (0, memory_1.validateTaskCountLimit)(actualTaskCount, sampleTask);
|
|
91
|
+
if (!finalTaskCountValidation.allowed) {
|
|
92
|
+
// Log warning but don't fail since tasks are already loaded
|
|
93
|
+
logger_1.logger.warn('Loaded task count exceeds recommended limits', {
|
|
94
|
+
actualCount: actualTaskCount,
|
|
95
|
+
maxRecommended: finalTaskCountValidation.maxAllowed,
|
|
96
|
+
estimatedMemoryMB: finalTaskCountValidation.estimatedMemoryMB,
|
|
97
|
+
riskLevel: finalTaskCountValidation.riskLevel
|
|
98
|
+
});
|
|
99
|
+
warnings.push(`Loaded ${actualTaskCount} tasks, which exceeds recommended limit of ${finalTaskCountValidation.maxAllowed}. ` +
|
|
100
|
+
`Estimated memory usage: ${finalTaskCountValidation.estimatedMemoryMB}MB (risk: ${finalTaskCountValidation.riskLevel}).`);
|
|
101
|
+
// For extremely large datasets, still enforce hard limits
|
|
102
|
+
if (actualTaskCount > finalTaskCountValidation.maxAllowed * 1.5) {
|
|
103
|
+
return {
|
|
104
|
+
isValid: false,
|
|
105
|
+
warnings,
|
|
106
|
+
shouldThrow: true,
|
|
107
|
+
riskLevel: finalTaskCountValidation.riskLevel,
|
|
108
|
+
estimatedMemoryMB: finalTaskCountValidation.estimatedMemoryMB
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Include warnings from enhanced validation
|
|
113
|
+
if (finalTaskCountValidation.warnings.length > 0) {
|
|
114
|
+
warnings.push(...finalTaskCountValidation.warnings);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
isValid: true,
|
|
118
|
+
warnings,
|
|
119
|
+
shouldThrow: false,
|
|
120
|
+
riskLevel: finalTaskCountValidation.riskLevel,
|
|
121
|
+
estimatedMemoryMB: finalTaskCountValidation.estimatedMemoryMB
|
|
122
|
+
};
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Validates task listing arguments
|
|
126
|
+
*/
|
|
127
|
+
validateTaskListingArgs(args) {
|
|
128
|
+
const errors = [];
|
|
129
|
+
// Validate numeric parameters
|
|
130
|
+
if (args.page !== undefined && (args.page < 1 || !Number.isInteger(args.page))) {
|
|
131
|
+
errors.push('Page number must be a positive integer');
|
|
132
|
+
}
|
|
133
|
+
if (args.perPage !== undefined && (args.perPage < 1 || !Number.isInteger(args.perPage))) {
|
|
134
|
+
errors.push('Per page count must be a positive integer');
|
|
135
|
+
}
|
|
136
|
+
if (args.projectId !== undefined && (args.projectId < 1 || !Number.isInteger(args.projectId))) {
|
|
137
|
+
errors.push('Project ID must be a positive integer');
|
|
138
|
+
}
|
|
139
|
+
// Validate boolean parameters
|
|
140
|
+
if (args.done !== undefined && typeof args.done !== 'boolean') {
|
|
141
|
+
errors.push('Done parameter must be a boolean value');
|
|
142
|
+
}
|
|
143
|
+
// Validate string parameters
|
|
144
|
+
if (args.search !== undefined && typeof args.search !== 'string') {
|
|
145
|
+
errors.push('Search parameter must be a string');
|
|
146
|
+
}
|
|
147
|
+
if (args.sort !== undefined && typeof args.sort !== 'string') {
|
|
148
|
+
errors.push('Sort parameter must be a string');
|
|
149
|
+
}
|
|
150
|
+
if (args.filter !== undefined && typeof args.filter !== 'string') {
|
|
151
|
+
errors.push('Filter parameter must be a string');
|
|
152
|
+
}
|
|
153
|
+
if (args.filterId !== undefined && typeof args.filterId !== 'string') {
|
|
154
|
+
errors.push('Filter ID parameter must be a string');
|
|
155
|
+
}
|
|
156
|
+
return errors;
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Performs comprehensive validation of task filtering parameters
|
|
160
|
+
*/
|
|
161
|
+
async validateTaskFiltering(args, storage, _config = {}) {
|
|
162
|
+
const allWarnings = [];
|
|
163
|
+
// Validate basic arguments
|
|
164
|
+
const argValidationErrors = exports.FilterValidator.validateTaskListingArgs(args);
|
|
165
|
+
if (argValidationErrors.length > 0) {
|
|
166
|
+
throw new types_1.MCPError(types_1.ErrorCode.VALIDATION_ERROR, `Invalid task listing arguments: ${argValidationErrors.join(', ')}`);
|
|
167
|
+
}
|
|
168
|
+
// Validate and parse filter
|
|
169
|
+
const filterValidation = await exports.FilterValidator.validateAndParseFilter(args, storage);
|
|
170
|
+
allWarnings.push(...filterValidation.validationWarnings);
|
|
171
|
+
// Validate memory constraints
|
|
172
|
+
const pageSize = args.perPage || 1000; // Default pagination
|
|
173
|
+
const memoryValidation = exports.FilterValidator.validateMemoryConstraints(args, pageSize);
|
|
174
|
+
allWarnings.push(...memoryValidation.warnings);
|
|
175
|
+
return {
|
|
176
|
+
filterExpression: filterValidation.filterExpression,
|
|
177
|
+
filterString: filterValidation.filterString,
|
|
178
|
+
validationWarnings: allWarnings,
|
|
179
|
+
memoryValidation
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=FilterValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterValidator.js","sourceRoot":"","sources":["../../../../src/tools/tasks/filtering/FilterValidator.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,0CAAqD;AACrD,oDAA2D;AAC3D,kDAA+D;AAC/D,kDAA+C;AAE/C;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,IAAqB,EACrB,OAA0B;QAM1B,IAAI,gBAAgB,GAA4B,IAAI,CAAC;QACrD,IAAI,YAAgC,CAAC;QACrC,MAAM,kBAAkB,GAAa,EAAE,CAAC;QAExC,IAAI,CAAC;YACH,iEAAiE;YACjE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACrD,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,MAAM,IAAI,gBAAQ,CAChB,iBAAS,CAAC,gBAAgB,EAC1B,kBAAkB,IAAI,CAAC,QAAQ,YAAY,CAC5C,CAAC;gBACJ,CAAC;gBACD,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC;YACpC,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACrC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC;YAC7B,CAAC;YAED,oDAAoD;YACpD,IAAI,YAAY,EAAE,CAAC;gBACjB,MAAM,WAAW,GAAgB,IAAA,2BAAiB,EAAC,YAAY,CAAC,CAAC;gBACjE,IAAI,WAAW,CAAC,KAAK,EAAE,CAAC;oBACtB,MAAM,IAAI,gBAAQ,CAChB,iBAAS,CAAC,gBAAgB,EAC1B,0BAA0B,WAAW,CAAC,KAAK,CAAC,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KA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C;QACJ,CAAC;QAED,4BAA4B;QAC5B,MAAM,gBAAgB,GAAG,MAAM,uBAAe,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACrF,WAAW,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QAEzD,8BAA8B;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,qBAAqB;QAC5D,MAAM,gBAAgB,GAAG,uBAAe,CAAC,yBAAyB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACnF,WAAW,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAE/C,OAAO;YACL,gBAAgB,EAAE,gBAAgB,CAAC,gBAAgB;YACnD,YAAY,EAAE,gBAAgB,CAAC,YAAY;YAC3C,kBAAkB,EAAE,WAAW;YAC/B,gBAAgB;SACjB,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task Filtering Orchestrator
|
|
3
|
+
* Main service that coordinates all filtering operations for tasks
|
|
4
|
+
*/
|
|
5
|
+
import type { TaskListingArgs, TaskFilterExecutionResult } from '../types/filters';
|
|
6
|
+
import type { FilterValidationConfig } from '../../../types/filters';
|
|
7
|
+
import type { SimpleFilterStorage } from '../../../storage';
|
|
8
|
+
/**
|
|
9
|
+
* Main orchestrator for task filtering operations
|
|
10
|
+
* Coordinates validation, execution, and result processing
|
|
11
|
+
*/
|
|
12
|
+
export declare const TaskFilteringOrchestrator: {
|
|
13
|
+
/**
|
|
14
|
+
* Executes the complete task filtering workflow
|
|
15
|
+
*
|
|
16
|
+
* @param args - Task listing arguments including filters
|
|
17
|
+
* @param storage - Storage interface for saved filters
|
|
18
|
+
* @param config - Optional validation configuration
|
|
19
|
+
* @returns Promise resolving to filtering result with metadata
|
|
20
|
+
*/
|
|
21
|
+
executeTaskFiltering(args: TaskListingArgs, storage: SimpleFilterStorage, config?: FilterValidationConfig): Promise<TaskFilterExecutionResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Validates task filtering parameters without executing the filtering
|
|
24
|
+
* Useful for pre-validation or UI validation scenarios
|
|
25
|
+
*/
|
|
26
|
+
validateTaskFiltering(args: TaskListingArgs, storage: SimpleFilterStorage, config?: FilterValidationConfig): Promise<{
|
|
27
|
+
isValid: boolean;
|
|
28
|
+
warnings: string[];
|
|
29
|
+
errors: string[];
|
|
30
|
+
memoryValidation: {
|
|
31
|
+
isValid: boolean;
|
|
32
|
+
warnings: string[];
|
|
33
|
+
maxAllowed?: number;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Prepares filtering context information for debugging and monitoring
|
|
38
|
+
*/
|
|
39
|
+
createFilteringContext(args: TaskListingArgs, result: TaskFilterExecutionResult): {
|
|
40
|
+
input: {
|
|
41
|
+
hasFilter: boolean;
|
|
42
|
+
hasFilterId: boolean;
|
|
43
|
+
projectId?: number;
|
|
44
|
+
page?: number;
|
|
45
|
+
perPage?: number;
|
|
46
|
+
search?: string;
|
|
47
|
+
sort?: string;
|
|
48
|
+
};
|
|
49
|
+
output: {
|
|
50
|
+
taskCount: number;
|
|
51
|
+
serverSideFilteringUsed: boolean;
|
|
52
|
+
serverSideFilteringAttempted: boolean;
|
|
53
|
+
clientSideFiltering: boolean;
|
|
54
|
+
filteringNote: string;
|
|
55
|
+
memoryInfo?: {
|
|
56
|
+
actualCount: number;
|
|
57
|
+
maxAllowed: number;
|
|
58
|
+
estimatedMemoryMB: number;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
performance: {
|
|
62
|
+
timestamp: string;
|
|
63
|
+
processingTimeMs?: number;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Analyzes filtering performance and provides recommendations
|
|
68
|
+
*/
|
|
69
|
+
analyzeFilteringPerformance(args: TaskListingArgs, result: TaskFilterExecutionResult): {
|
|
70
|
+
isOptimal: boolean;
|
|
71
|
+
recommendations: string[];
|
|
72
|
+
issues: string[];
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=TaskFilteringOrchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskFilteringOrchestrator.d.ts","sourceRoot":"","sources":["../../../../src/tools/tasks/filtering/TaskFilteringOrchestrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAKrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,yBAAyB;IACpC;;;;;;;OAOG;+BAEK,eAAe,WACZ,mBAAmB,WACpB,sBAAsB,GAC7B,OAAO,CAAC,yBAAyB,CAAC;IA0ErC;;;OAGG;gCAEK,eAAe,WACZ,mBAAmB,WACpB,sBAAsB,GAC7B,OAAO,CAAC;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,gBAAgB,EAAE;YAChB,OAAO,EAAE,OAAO,CAAC;YACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB,CAAC;KACH,CAAC;IA8BF;;OAEG;iCAEK,eAAe,UACb,yBAAyB,GAChC;QACD,KAAK,EAAE;YACL,SAAS,EAAE,OAAO,CAAC;YACnB,WAAW,EAAE,OAAO,CAAC;YACrB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,OAAO,CAAC,EAAE,MAAM,CAAC;YACjB,MAAM,CAAC,EAAE,MAA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