@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,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vikunja API Types
|
|
3
|
+
* Adapted from the Deno prototype with additions from API documentation
|
|
4
|
+
*/
|
|
5
|
+
import type { Task as VikunjaTask } from 'node-vikunja';
|
|
6
|
+
export interface LoginCredentials {
|
|
7
|
+
username: string;
|
|
8
|
+
password: string;
|
|
9
|
+
totp_passcode?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface AuthToken {
|
|
12
|
+
token: string;
|
|
13
|
+
expires_at: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AuthSession {
|
|
16
|
+
apiUrl: string;
|
|
17
|
+
apiToken: string;
|
|
18
|
+
tokenExpiry?: Date;
|
|
19
|
+
userId?: string;
|
|
20
|
+
authType: 'api-token' | 'jwt';
|
|
21
|
+
}
|
|
22
|
+
export interface Message {
|
|
23
|
+
message: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Pagination {
|
|
26
|
+
page?: number;
|
|
27
|
+
per_page?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface SearchParams {
|
|
30
|
+
s?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DateRange {
|
|
33
|
+
date_from?: string;
|
|
34
|
+
date_to?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface User {
|
|
37
|
+
id: number;
|
|
38
|
+
username: string;
|
|
39
|
+
email?: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
created?: string;
|
|
42
|
+
updated?: string;
|
|
43
|
+
email_reminders_enabled?: boolean;
|
|
44
|
+
overdue_tasks_reminders_enabled?: boolean;
|
|
45
|
+
overdue_tasks_reminders_time?: string;
|
|
46
|
+
language?: string;
|
|
47
|
+
timezone?: string;
|
|
48
|
+
week_start?: number;
|
|
49
|
+
frontend_settings?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export interface ExtendedUserSettings {
|
|
52
|
+
name?: string;
|
|
53
|
+
email?: string;
|
|
54
|
+
language?: string;
|
|
55
|
+
timezone?: string;
|
|
56
|
+
week_start?: number;
|
|
57
|
+
frontend_settings?: Record<string, unknown>;
|
|
58
|
+
email_reminders_enabled?: boolean;
|
|
59
|
+
overdue_tasks_reminders_enabled?: boolean;
|
|
60
|
+
overdue_tasks_reminders_time?: string;
|
|
61
|
+
discoverable_by_name?: boolean;
|
|
62
|
+
discoverable_by_email?: boolean;
|
|
63
|
+
default_project_id?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface Project {
|
|
66
|
+
id?: number;
|
|
67
|
+
title: string;
|
|
68
|
+
description?: string;
|
|
69
|
+
parent_project_id?: number;
|
|
70
|
+
is_archived?: boolean;
|
|
71
|
+
hex_color?: string;
|
|
72
|
+
created?: string;
|
|
73
|
+
updated?: string;
|
|
74
|
+
owner?: User;
|
|
75
|
+
}
|
|
76
|
+
export interface ProjectUser {
|
|
77
|
+
user_id: number;
|
|
78
|
+
project_id: number;
|
|
79
|
+
right: number;
|
|
80
|
+
created?: string;
|
|
81
|
+
updated?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface ProjectView {
|
|
84
|
+
id?: number;
|
|
85
|
+
project_id: number;
|
|
86
|
+
title: string;
|
|
87
|
+
view_kind: 'list' | 'board' | 'table' | 'gantt';
|
|
88
|
+
position?: number;
|
|
89
|
+
bucket_configuration?: unknown;
|
|
90
|
+
created?: string;
|
|
91
|
+
updated?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface Task {
|
|
94
|
+
id?: number;
|
|
95
|
+
project_id: number;
|
|
96
|
+
title: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
done?: boolean;
|
|
99
|
+
done_at?: string | null;
|
|
100
|
+
due_date?: string | null;
|
|
101
|
+
start_date?: string | null;
|
|
102
|
+
end_date?: string | null;
|
|
103
|
+
repeat_after?: number;
|
|
104
|
+
repeat_mode?: 'day' | 'week' | 'month' | 'year';
|
|
105
|
+
priority?: number;
|
|
106
|
+
percent_done?: number;
|
|
107
|
+
labels?: Label[];
|
|
108
|
+
assignees?: User[];
|
|
109
|
+
attachments?: Attachment[];
|
|
110
|
+
reminders?: TaskReminder[];
|
|
111
|
+
created?: string;
|
|
112
|
+
updated?: string;
|
|
113
|
+
created_by?: User;
|
|
114
|
+
}
|
|
115
|
+
export interface TaskReminder {
|
|
116
|
+
id: number;
|
|
117
|
+
reminder_date: string;
|
|
118
|
+
}
|
|
119
|
+
export interface TaskComment {
|
|
120
|
+
id?: number;
|
|
121
|
+
task_id: number;
|
|
122
|
+
comment: string;
|
|
123
|
+
author?: User;
|
|
124
|
+
created?: string;
|
|
125
|
+
updated?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface TaskRelation {
|
|
128
|
+
id?: number;
|
|
129
|
+
task_id: number;
|
|
130
|
+
other_task_id: number;
|
|
131
|
+
relation_kind: string;
|
|
132
|
+
created_by?: User;
|
|
133
|
+
created?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface Label {
|
|
136
|
+
id?: number;
|
|
137
|
+
title: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
hex_color?: string;
|
|
140
|
+
created_by?: User;
|
|
141
|
+
created?: string;
|
|
142
|
+
updated?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface Team {
|
|
145
|
+
id?: number;
|
|
146
|
+
name: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
members?: TeamMember[];
|
|
149
|
+
created?: string;
|
|
150
|
+
updated?: string;
|
|
151
|
+
created_by?: User;
|
|
152
|
+
}
|
|
153
|
+
export interface TeamMember {
|
|
154
|
+
id: number;
|
|
155
|
+
username: string;
|
|
156
|
+
email?: string;
|
|
157
|
+
admin: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface Attachment {
|
|
160
|
+
id: number;
|
|
161
|
+
task_id: number;
|
|
162
|
+
file_name: string;
|
|
163
|
+
file_size: number;
|
|
164
|
+
created_by: {
|
|
165
|
+
id: number;
|
|
166
|
+
username: string;
|
|
167
|
+
};
|
|
168
|
+
created: string;
|
|
169
|
+
file?: File | string;
|
|
170
|
+
}
|
|
171
|
+
export interface SavedFilter {
|
|
172
|
+
id?: number;
|
|
173
|
+
title: string;
|
|
174
|
+
description?: string;
|
|
175
|
+
filters: FilterQuery;
|
|
176
|
+
created?: string;
|
|
177
|
+
updated?: string;
|
|
178
|
+
owner?: User;
|
|
179
|
+
}
|
|
180
|
+
export interface FilterQuery {
|
|
181
|
+
filter?: string;
|
|
182
|
+
filter_timezone?: string;
|
|
183
|
+
filter_include_nulls?: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface Notification {
|
|
186
|
+
id?: number;
|
|
187
|
+
name?: string;
|
|
188
|
+
notification?: unknown;
|
|
189
|
+
read?: boolean;
|
|
190
|
+
read_at?: string | null;
|
|
191
|
+
created?: string;
|
|
192
|
+
}
|
|
193
|
+
export interface Bucket {
|
|
194
|
+
id?: number;
|
|
195
|
+
project_id: number;
|
|
196
|
+
view_id: number;
|
|
197
|
+
title: string;
|
|
198
|
+
position: number;
|
|
199
|
+
limit?: number;
|
|
200
|
+
is_done_bucket?: boolean;
|
|
201
|
+
created?: string;
|
|
202
|
+
updated?: string;
|
|
203
|
+
created_by?: User;
|
|
204
|
+
}
|
|
205
|
+
export interface Webhook {
|
|
206
|
+
id?: number;
|
|
207
|
+
project_id: number;
|
|
208
|
+
target_url: string;
|
|
209
|
+
events: string[];
|
|
210
|
+
secret?: string;
|
|
211
|
+
created?: string;
|
|
212
|
+
updated?: string;
|
|
213
|
+
created_by?: User;
|
|
214
|
+
}
|
|
215
|
+
export interface MigrationStatus {
|
|
216
|
+
id?: number;
|
|
217
|
+
migrator_name?: string;
|
|
218
|
+
started?: string;
|
|
219
|
+
finished?: string | null;
|
|
220
|
+
}
|
|
221
|
+
export interface ProjectShare {
|
|
222
|
+
id?: number;
|
|
223
|
+
project_id: number;
|
|
224
|
+
hash?: string;
|
|
225
|
+
right?: number;
|
|
226
|
+
sharing_type?: number;
|
|
227
|
+
shared_by?: User;
|
|
228
|
+
created?: string;
|
|
229
|
+
updated?: string;
|
|
230
|
+
}
|
|
231
|
+
export interface Subscription {
|
|
232
|
+
id?: number;
|
|
233
|
+
entity: string;
|
|
234
|
+
entity_id: number;
|
|
235
|
+
user?: User;
|
|
236
|
+
created?: string;
|
|
237
|
+
}
|
|
238
|
+
export interface VikunjaError {
|
|
239
|
+
code?: number;
|
|
240
|
+
message: string;
|
|
241
|
+
}
|
|
242
|
+
export interface ApiResponse<T> {
|
|
243
|
+
data?: T;
|
|
244
|
+
error?: VikunjaError;
|
|
245
|
+
}
|
|
246
|
+
export interface TaskCreationData {
|
|
247
|
+
project_id: number;
|
|
248
|
+
title: string;
|
|
249
|
+
done?: boolean;
|
|
250
|
+
priority?: number;
|
|
251
|
+
percent_done?: number;
|
|
252
|
+
description?: string;
|
|
253
|
+
due_date?: string;
|
|
254
|
+
start_date?: string;
|
|
255
|
+
end_date?: string;
|
|
256
|
+
hex_color?: string;
|
|
257
|
+
repeat_after?: number;
|
|
258
|
+
repeat_mode?: string;
|
|
259
|
+
}
|
|
260
|
+
export interface TaskUpdateData extends Partial<TaskCreationData> {
|
|
261
|
+
id: number;
|
|
262
|
+
}
|
|
263
|
+
export interface MinimalTask {
|
|
264
|
+
id?: number;
|
|
265
|
+
title: string;
|
|
266
|
+
assignees?: User[];
|
|
267
|
+
}
|
|
268
|
+
export interface StandardTaskResponse {
|
|
269
|
+
success: boolean;
|
|
270
|
+
operation: 'create' | 'update' | 'delete' | 'list' | 'get' | 'assign' | 'unassign' | 'comment' | 'bulk-update' | 'bulk-delete' | 'relate' | 'unrelate' | 'relations' | 'add-reminder' | 'remove-reminder' | 'list-reminders';
|
|
271
|
+
message?: string;
|
|
272
|
+
task?: VikunjaTask | MinimalTask;
|
|
273
|
+
tasks?: VikunjaTask[];
|
|
274
|
+
comment?: TaskComment;
|
|
275
|
+
comments?: TaskComment[];
|
|
276
|
+
reminder?: TaskReminder;
|
|
277
|
+
reminders?: TaskReminder[];
|
|
278
|
+
metadata?: {
|
|
279
|
+
timestamp: string;
|
|
280
|
+
affectedFields?: string[];
|
|
281
|
+
previousState?: Partial<VikunjaTask> | VikunjaTask[];
|
|
282
|
+
count?: number;
|
|
283
|
+
fetchErrors?: number;
|
|
284
|
+
failedCount?: number;
|
|
285
|
+
failedIds?: number[];
|
|
286
|
+
performanceMetrics?: {
|
|
287
|
+
totalDuration: number;
|
|
288
|
+
operationsPerSecond: number;
|
|
289
|
+
apiCallsUsed: number;
|
|
290
|
+
concurrencyLevel: string;
|
|
291
|
+
cacheEfficiency: number;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
export interface StandardProjectResponse {
|
|
296
|
+
success: boolean;
|
|
297
|
+
operation: 'create' | 'update' | 'delete' | 'list' | 'get' | 'archive' | 'unarchive';
|
|
298
|
+
message?: string;
|
|
299
|
+
project?: Project;
|
|
300
|
+
projects?: Project[];
|
|
301
|
+
metadata?: {
|
|
302
|
+
timestamp: string;
|
|
303
|
+
count?: number;
|
|
304
|
+
affectedFields?: string[];
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
export interface ApiToken {
|
|
308
|
+
id?: number;
|
|
309
|
+
title: string;
|
|
310
|
+
token?: string;
|
|
311
|
+
permissions?: string[];
|
|
312
|
+
expires_at?: string;
|
|
313
|
+
created?: string;
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=vikunja.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vikunja.d.ts","sourceRoot":"","sources":["../../src/types/vikunja.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AAGxD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB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B,CAAC,EAAE;YACnB,aAAa,EAAE,MAAM,CAAC;YACtB,mBAAmB,EAAE,MAAM,CAAC;YAC5B,YAAY,EAAE,MAAM,CAAC;YACrB,gBAAgB,EAAE,MAAM,CAAC;YACzB,eAAe,EAAE,MAAM,CAAC;SACzB,CAAC;KACH,CAAC;CACH;AAGD,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,CAAC;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;KAC3B,CAAC;CACH;AAGD,MAAM,WAAW,QAAQ;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vikunja.js","sourceRoot":"","sources":["../../src/types/vikunja.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authentication Error Handler
|
|
3
|
+
* Provides consistent handling of authentication errors across all tools
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check if an error is authentication-related using structured error classification
|
|
7
|
+
* This replaces unsafe string-based classification to prevent false positives
|
|
8
|
+
*/
|
|
9
|
+
export declare function isAuthenticationError(error: unknown): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if an error is specifically a JWT expiration error using precise pattern matching
|
|
12
|
+
* This replaces unsafe substring matching to prevent false positives
|
|
13
|
+
*/
|
|
14
|
+
export declare function isJWTExpiredError(error: unknown): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Create a detailed authentication error message based on the operation
|
|
17
|
+
*/
|
|
18
|
+
export declare function createAuthErrorMessage(operation: string, originalError: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Handle authentication errors consistently
|
|
21
|
+
*/
|
|
22
|
+
export declare function handleAuthError(error: unknown, operation: string, fallbackMessage?: string): never;
|
|
23
|
+
//# sourceMappingURL=auth-error-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-error-handler.d.ts","sourceRoot":"","sources":["../../src/utils/auth-error-handler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAsD7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CA2BzD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAkDvF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,MAAM,GACvB,KAAK,CA6BP"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Authentication Error Handler
|
|
4
|
+
* Provides consistent handling of authentication errors across all tools
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.isAuthenticationError = isAuthenticationError;
|
|
8
|
+
exports.isJWTExpiredError = isJWTExpiredError;
|
|
9
|
+
exports.createAuthErrorMessage = createAuthErrorMessage;
|
|
10
|
+
exports.handleAuthError = handleAuthError;
|
|
11
|
+
const types_1 = require("../types");
|
|
12
|
+
const logger_1 = require("./logger");
|
|
13
|
+
/**
|
|
14
|
+
* Check if an error is authentication-related using structured error classification
|
|
15
|
+
* This replaces unsafe string-based classification to prevent false positives
|
|
16
|
+
*/
|
|
17
|
+
function isAuthenticationError(error) {
|
|
18
|
+
if (!(error instanceof Error)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
// Layer 1: Check structured error properties (most reliable)
|
|
22
|
+
const errorWithStatus = error;
|
|
23
|
+
// Check for HTTP status codes as numbers (not strings)
|
|
24
|
+
if (errorWithStatus.status === 401 || errorWithStatus.status === 403) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
// Check for Axios-style errors with response.status
|
|
28
|
+
if (errorWithStatus.response?.status === 401 || errorWithStatus.response?.status === 403) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
// Layer 2: Precise pattern matching for error messages (avoid false positives)
|
|
32
|
+
const errorMessage = error.message.toLowerCase();
|
|
33
|
+
// Use regex patterns for exact matching instead of substring matching
|
|
34
|
+
// Trim and normalize the message first
|
|
35
|
+
const normalizedMessage = errorMessage.trim();
|
|
36
|
+
const authErrorPatterns = [
|
|
37
|
+
/^unauthorized[!.]*$/i, // "unauthorized" with optional punctuation
|
|
38
|
+
/^forbidden[!.]*$/i, // "forbidden" with optional punctuation
|
|
39
|
+
/^unauthorized\s+\w+[!.]*$/i, // "unauthorized" + single word with optional punctuation
|
|
40
|
+
/^forbidden\s+\w+[!.]*$/i, // "forbidden" + single word with optional punctuation
|
|
41
|
+
/^\w+\s+forbidden[!.]*$/i, // single word + "forbidden" with optional punctuation
|
|
42
|
+
/^\w+\s+unauthorized[!.]*$/i, // single word + "unauthorized" with optional punctuation
|
|
43
|
+
/\bauthentication\s+failed\b/i, // "authentication failed" as phrase
|
|
44
|
+
/\bauthentication\s+required\b/i, // "authentication required" as phrase
|
|
45
|
+
/\bnot\s+authenticated\b/i, // "not authenticated" as phrase
|
|
46
|
+
/\binvalid\s+token\b/i, // "invalid token" as phrase
|
|
47
|
+
/\btoken\s+invalid\b/i, // "token invalid" as phrase
|
|
48
|
+
/\btoken\s+expired\b/i, // "token expired" as phrase (for auth detection)
|
|
49
|
+
/\baccess\s+denied\b/i, // "access denied" as phrase
|
|
50
|
+
/\bauth\s+failed\b/i, // "auth failed" as phrase
|
|
51
|
+
/\bauth_required\b/i, // "auth_required" pattern
|
|
52
|
+
/\btoken_invalid\b/i, // "token_invalid" pattern
|
|
53
|
+
/^401\b/, // HTTP status at start of message
|
|
54
|
+
/^403\b/, // HTTP status at start of message
|
|
55
|
+
/\berror:\s*401\b/i, // "Error: 401" pattern
|
|
56
|
+
/\berror:\s*403\b/i, // "Error: 403" pattern
|
|
57
|
+
// Vikunja-specific patterns
|
|
58
|
+
/\bmissing,\s+malformed,\s+expired\s+or\s+otherwise\s+invalid\s+token\s+provided\b/i, // Vikunja API error
|
|
59
|
+
/\bmalformed\s+token\b/i, // "malformed token"
|
|
60
|
+
/\bexpired\s+token\b/i, // "expired token"
|
|
61
|
+
/\bmissing\s+token\b/i // "missing token"
|
|
62
|
+
];
|
|
63
|
+
return authErrorPatterns.some(pattern => pattern.test(normalizedMessage));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check if an error is specifically a JWT expiration error using precise pattern matching
|
|
67
|
+
* This replaces unsafe substring matching to prevent false positives
|
|
68
|
+
*/
|
|
69
|
+
function isJWTExpiredError(error) {
|
|
70
|
+
if (!(error instanceof Error)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
// Check for known JWT library error codes or properties
|
|
74
|
+
const errorWithCode = error;
|
|
75
|
+
// Check for specific JWT library error codes
|
|
76
|
+
if (errorWithCode.code === 'TokenExpiredError' || errorWithCode.name === 'TokenExpiredError') {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
// Use precise regex patterns for JWT expiration messages
|
|
80
|
+
const errorMessage = error.message.toLowerCase();
|
|
81
|
+
const jwtExpirationPatterns = [
|
|
82
|
+
/\btoken\s+expired\b/, // "token expired" as phrase
|
|
83
|
+
/\bjwt\s+expired\b/, // "jwt expired" as phrase
|
|
84
|
+
/\bexp\s+claim\b/, // "exp claim" for JWT exp validation
|
|
85
|
+
/\btoken\s+has\s+expired\b/, // "token has expired"
|
|
86
|
+
/\bjwt\s+has\s+expired\b/, // "jwt has expired"
|
|
87
|
+
/\bexpired\s+token\b/, // "expired token"
|
|
88
|
+
/\bexpired\s+jwt\b/ // "expired jwt"
|
|
89
|
+
];
|
|
90
|
+
return jwtExpirationPatterns.some(pattern => pattern.test(errorMessage));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Create a detailed authentication error message based on the operation
|
|
94
|
+
*/
|
|
95
|
+
function createAuthErrorMessage(operation, originalError) {
|
|
96
|
+
const knownIssues = {
|
|
97
|
+
user: 'User endpoint authentication error. This is a known Vikunja API limitation. ' +
|
|
98
|
+
'User endpoints require JWT authentication instead of API tokens. ' +
|
|
99
|
+
'To use user operations, connect with a JWT token (starting with eyJ).',
|
|
100
|
+
bulk: 'Bulk operations may have authentication issues with certain Vikunja API versions. ' +
|
|
101
|
+
'This is a known limitation. Consider using individual operations instead.',
|
|
102
|
+
labels: 'Label operations may have authentication issues with certain Vikunja API versions. ' +
|
|
103
|
+
'This is a known limitation. Try updating the task without labels first.',
|
|
104
|
+
assignees: 'Assignee operations may have authentication issues with certain Vikunja API versions. ' +
|
|
105
|
+
'This is a known limitation. Try updating the task without assignees first.',
|
|
106
|
+
};
|
|
107
|
+
// Determine the type of operation
|
|
108
|
+
let operationType = 'default';
|
|
109
|
+
if (operation.includes('user')) {
|
|
110
|
+
operationType = 'user';
|
|
111
|
+
}
|
|
112
|
+
else if (operation.includes('bulk')) {
|
|
113
|
+
operationType = 'bulk';
|
|
114
|
+
}
|
|
115
|
+
else if (operation.includes('label')) {
|
|
116
|
+
operationType = 'labels';
|
|
117
|
+
}
|
|
118
|
+
else if (operation.includes('assignee')) {
|
|
119
|
+
operationType = 'assignees';
|
|
120
|
+
}
|
|
121
|
+
// Check for specific Vikunja token errors and provide enhanced guidance
|
|
122
|
+
const errorMessage = originalError.toLowerCase();
|
|
123
|
+
if (errorMessage.includes('missing, malformed, expired') ||
|
|
124
|
+
errorMessage.includes('malformed token') ||
|
|
125
|
+
errorMessage.includes('expired token') ||
|
|
126
|
+
errorMessage.includes('missing token')) {
|
|
127
|
+
return `Authentication failed: Invalid or expired API token.\n\n` +
|
|
128
|
+
`To fix this:\n` +
|
|
129
|
+
`1. Log into your Vikunja instance\n` +
|
|
130
|
+
`2. Go to Settings > API Access\n` +
|
|
131
|
+
`3. Generate a new API token or copy your existing one\n` +
|
|
132
|
+
`4. Reconnect with: vikunja_auth.connect({ apiUrl: '${process.env.VIKUNJA_URL || 'https://your-vikunja.com/api/v1'}', apiToken: 'your-new-token' })\n\n` +
|
|
133
|
+
`Note: API tokens start with 'tk_' and JWT tokens start with 'eyJ'. Make sure you're using the correct token type.`;
|
|
134
|
+
}
|
|
135
|
+
return (knownIssues[operationType] ||
|
|
136
|
+
`Authentication error during ${operation}: ${originalError}. ` +
|
|
137
|
+
'Please verify your API token is valid and has the necessary permissions.');
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Handle authentication errors consistently
|
|
141
|
+
*/
|
|
142
|
+
function handleAuthError(error, operation, fallbackMessage) {
|
|
143
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
144
|
+
logger_1.logger.debug('Auth error detected during %s: %s', operation, errorMessage);
|
|
145
|
+
// Check for JWT expiration first (more specific error)
|
|
146
|
+
if (isJWTExpiredError(error)) {
|
|
147
|
+
logger_1.logger.warn('JWT token expired during %s operation', operation);
|
|
148
|
+
throw new types_1.MCPError(types_1.ErrorCode.AUTH_REQUIRED, `JWT token has expired. Please reconnect with a fresh JWT token:\n` +
|
|
149
|
+
`1. Log into Vikunja in your browser\n` +
|
|
150
|
+
`2. Open DevTools → Application → Local Storage\n` +
|
|
151
|
+
`3. Copy the new JWT token\n` +
|
|
152
|
+
`4. Run: vikunja_auth.connect with the new token`);
|
|
153
|
+
}
|
|
154
|
+
if (isAuthenticationError(error)) {
|
|
155
|
+
logger_1.logger.warn('Authentication error during %s: %s', operation, errorMessage);
|
|
156
|
+
throw new types_1.MCPError(types_1.ErrorCode.API_ERROR, createAuthErrorMessage(operation, errorMessage));
|
|
157
|
+
}
|
|
158
|
+
// If not an auth error, throw the original error
|
|
159
|
+
logger_1.logger.debug('Non-auth error during %s: %s', operation, errorMessage);
|
|
160
|
+
throw new types_1.MCPError(types_1.ErrorCode.API_ERROR, fallbackMessage || `${operation} failed: ${errorMessage}`);
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=auth-error-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-error-handler.js","sourceRoot":"","sources":["../../src/utils/auth-error-handler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AASH,sDAsDC;AAMD,8CA2BC;AAKD,wDAkDC;AAKD,0CAiCC;AA3LD,oCAA+C;AAC/C,qCAAkC;AAElC;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,KAAc;IAClD,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,6DAA6D;IAC7D,MAAM,eAAe,GAAG,KAAoE,CAAC;IAE7F,uDAAuD;IACvD,IAAI,eAAe,CAAC,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,oDAAoD;IACpD,IAAI,eAAe,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,QAAQ,EAAE,MAAM,KAAK,GA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C;YACvC,kDAAkD;YAClD,6BAA6B;YAC7B,iDAAiD,CAClD,CAAC;IACJ,CAAC;IAED,IAAI,qBAAqB,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,eAAM,CAAC,IAAI,CAAC,oCAAoC,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QAC3E,MAAM,IAAI,gBAAQ,CAAC,iBAAS,CAAC,SAAS,EAAE,sBAAsB,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED,iDAAiD;IACjD,eAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IACtE,MAAM,IAAI,gBAAQ,CAChB,iBAAS,CAAC,SAAS,EACnB,eAAe,IAAI,GAAG,SAAS,YAAY,YAAY,EAAE,CAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplified Error Handling using Zod + Security Patterns
|
|
3
|
+
*
|
|
4
|
+
* Replaces 461 lines of custom error handling with concise,
|
|
5
|
+
* secure patterns using Zod validation and minimal sanitization.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
import { MCPError } from '../types/errors';
|
|
9
|
+
export declare const handleStatusCodeError: (error: unknown, operation: string, resourceId?: string | number, customMessage?: string) => MCPError;
|
|
10
|
+
export declare const transformApiError: (error: unknown, context: string) => MCPError;
|
|
11
|
+
export declare const wrapToolError: (error: unknown, toolName: string, operation: string, resourceId?: string | number, customMessage?: string) => MCPError;
|
|
12
|
+
export declare const createAuthRequiredError: (operation?: string) => MCPError;
|
|
13
|
+
export declare const wrapAuthError: (error: unknown, operation: string) => MCPError;
|
|
14
|
+
export declare const createValidationError: (message: string) => MCPError;
|
|
15
|
+
export declare const createInternalError: (message: string, originalError?: unknown) => MCPError;
|
|
16
|
+
export declare const handleFetchError: (error: unknown, operation: string) => MCPError;
|
|
17
|
+
export declare function isMCPError(error: unknown): error is MCPError;
|
|
18
|
+
export declare function hasStatusCode(error: unknown): error is {
|
|
19
|
+
statusCode: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const ErrorSchema: z.ZodObject<{
|
|
22
|
+
message: z.ZodString;
|
|
23
|
+
statusCode: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
code: z.ZodOptional<z.ZodString>;
|
|
25
|
+
stack: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
message: string;
|
|
28
|
+
code?: string | undefined;
|
|
29
|
+
statusCode?: number | undefined;
|
|
30
|
+
stack?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
message: string;
|
|
33
|
+
code?: string | undefined;
|
|
34
|
+
statusCode?: number | undefined;
|
|
35
|
+
stack?: string | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
export type ValidationError = z.infer<typeof ErrorSchema>;
|
|
38
|
+
//# sourceMappingURL=error-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/utils/error-handler.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAa,MAAM,iBAAiB,CAAC;AAyTtD,eAAO,MAAM,qBAAqB,GAChC,OAAO,OAAO,EACd,WAAW,MAAM,EACjB,aAAa,MAAM,GAAG,MAAM,EAC5B,gBAAgB,MAAM,KACrB,QAAsF,CAAC;AAE1F,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,EAAE,SAAS,MAAM,KAAG,QAC5B,CAAC;AAEzC,eAAO,MAAM,aAAa,GACxB,OAAO,OAAO,EACd,UAAU,MAAM,EAChB,WAAW,MAAM,EACjB,aAAa,MAAM,GAAG,MAAM,EAC5B,gBAAgB,MAAM,KACrB,QAAoF,CAAC;AAExF,eAAO,MAAM,uBAAuB,GAAI,Y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