@doist/todoist-mcp 0.0.1 → 10.0.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.
Files changed (165) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +205 -29
  3. package/dist/filter-helpers.d.ts +51 -0
  4. package/dist/filter-helpers.d.ts.map +1 -0
  5. package/dist/index.d.ts +2954 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +103 -0
  8. package/dist/main-http.d.ts +3 -0
  9. package/dist/main-http.d.ts.map +1 -0
  10. package/dist/main-http.js +41 -0
  11. package/dist/main.d.ts +3 -0
  12. package/dist/main.d.ts.map +1 -0
  13. package/dist/main.js +17 -0
  14. package/dist/mcp-apps/index.html +98 -0
  15. package/dist/mcp-helpers.d.ts +58 -0
  16. package/dist/mcp-helpers.d.ts.map +1 -0
  17. package/dist/mcp-server-B08TNWfi.js +6129 -0
  18. package/dist/mcp-server.d.ts +16 -0
  19. package/dist/mcp-server.d.ts.map +1 -0
  20. package/dist/middleware/require-valid-todoist-token.d.ts +38 -0
  21. package/dist/middleware/require-valid-todoist-token.d.ts.map +1 -0
  22. package/dist/prompts/productivity-analysis.d.ts +58 -0
  23. package/dist/prompts/productivity-analysis.d.ts.map +1 -0
  24. package/dist/require-valid-todoist-token-CoZu2QoC.js +72 -0
  25. package/dist/todoist-tool.d.ts +62 -0
  26. package/dist/todoist-tool.d.ts.map +1 -0
  27. package/dist/tool-execution-error.d.ts +7 -0
  28. package/dist/tool-execution-error.d.ts.map +1 -0
  29. package/dist/tool-helpers.d.ts +265 -0
  30. package/dist/tool-helpers.d.ts.map +1 -0
  31. package/dist/tools/add-comments.d.ts +83 -0
  32. package/dist/tools/add-comments.d.ts.map +1 -0
  33. package/dist/tools/add-filters.d.ts +94 -0
  34. package/dist/tools/add-filters.d.ts.map +1 -0
  35. package/dist/tools/add-labels.d.ts +92 -0
  36. package/dist/tools/add-labels.d.ts.map +1 -0
  37. package/dist/tools/add-projects.d.ts +112 -0
  38. package/dist/tools/add-projects.d.ts.map +1 -0
  39. package/dist/tools/add-reminders.d.ts +148 -0
  40. package/dist/tools/add-reminders.d.ts.map +1 -0
  41. package/dist/tools/add-sections.d.ts +40 -0
  42. package/dist/tools/add-sections.d.ts.map +1 -0
  43. package/dist/tools/add-tasks.d.ts +118 -0
  44. package/dist/tools/add-tasks.d.ts.map +1 -0
  45. package/dist/tools/analyze-project-health.d.ts +45 -0
  46. package/dist/tools/analyze-project-health.d.ts.map +1 -0
  47. package/dist/tools/complete-tasks.d.ts +42 -0
  48. package/dist/tools/complete-tasks.d.ts.map +1 -0
  49. package/dist/tools/delete-object.d.ts +54 -0
  50. package/dist/tools/delete-object.d.ts.map +1 -0
  51. package/dist/tools/fetch-object.d.ts +199 -0
  52. package/dist/tools/fetch-object.d.ts.map +1 -0
  53. package/dist/tools/fetch.d.ts +41 -0
  54. package/dist/tools/fetch.d.ts.map +1 -0
  55. package/dist/tools/find-activity.d.ts +91 -0
  56. package/dist/tools/find-activity.d.ts.map +1 -0
  57. package/dist/tools/find-comments.d.ts +89 -0
  58. package/dist/tools/find-comments.d.ts.map +1 -0
  59. package/dist/tools/find-completed-tasks.d.ts +115 -0
  60. package/dist/tools/find-completed-tasks.d.ts.map +1 -0
  61. package/dist/tools/find-filters.d.ts +92 -0
  62. package/dist/tools/find-filters.d.ts.map +1 -0
  63. package/dist/tools/find-labels.d.ts +81 -0
  64. package/dist/tools/find-labels.d.ts.map +1 -0
  65. package/dist/tools/find-project-collaborators.d.ts +94 -0
  66. package/dist/tools/find-project-collaborators.d.ts.map +1 -0
  67. package/dist/tools/find-projects.d.ts +87 -0
  68. package/dist/tools/find-projects.d.ts.map +1 -0
  69. package/dist/tools/find-reminders.d.ts +95 -0
  70. package/dist/tools/find-reminders.d.ts.map +1 -0
  71. package/dist/tools/find-sections.d.ts +41 -0
  72. package/dist/tools/find-sections.d.ts.map +1 -0
  73. package/dist/tools/find-tasks-by-date.d.ts +133 -0
  74. package/dist/tools/find-tasks-by-date.d.ts.map +1 -0
  75. package/dist/tools/find-tasks.d.ts +116 -0
  76. package/dist/tools/find-tasks.d.ts.map +1 -0
  77. package/dist/tools/get-overview.d.ts +123 -0
  78. package/dist/tools/get-overview.d.ts.map +1 -0
  79. package/dist/tools/get-productivity-stats.d.ts +160 -0
  80. package/dist/tools/get-productivity-stats.d.ts.map +1 -0
  81. package/dist/tools/get-project-activity-stats.d.ts +48 -0
  82. package/dist/tools/get-project-activity-stats.d.ts.map +1 -0
  83. package/dist/tools/get-project-health.d.ts +112 -0
  84. package/dist/tools/get-project-health.d.ts.map +1 -0
  85. package/dist/tools/get-workspace-insights.d.ts +65 -0
  86. package/dist/tools/get-workspace-insights.d.ts.map +1 -0
  87. package/dist/tools/list-workspaces.d.ts +54 -0
  88. package/dist/tools/list-workspaces.d.ts.map +1 -0
  89. package/dist/tools/manage-assignments.d.ts +72 -0
  90. package/dist/tools/manage-assignments.d.ts.map +1 -0
  91. package/dist/tools/project-management.d.ts +78 -0
  92. package/dist/tools/project-management.d.ts.map +1 -0
  93. package/dist/tools/project-move.d.ts +88 -0
  94. package/dist/tools/project-move.d.ts.map +1 -0
  95. package/dist/tools/reorder-objects.d.ts +50 -0
  96. package/dist/tools/reorder-objects.d.ts.map +1 -0
  97. package/dist/tools/reschedule-tasks.d.ts +78 -0
  98. package/dist/tools/reschedule-tasks.d.ts.map +1 -0
  99. package/dist/tools/search.d.ts +43 -0
  100. package/dist/tools/search.d.ts.map +1 -0
  101. package/dist/tools/uncomplete-tasks.d.ts +42 -0
  102. package/dist/tools/uncomplete-tasks.d.ts.map +1 -0
  103. package/dist/tools/update-comments.d.ts +87 -0
  104. package/dist/tools/update-comments.d.ts.map +1 -0
  105. package/dist/tools/update-filters.d.ts +106 -0
  106. package/dist/tools/update-filters.d.ts.map +1 -0
  107. package/dist/tools/update-labels.d.ts +122 -0
  108. package/dist/tools/update-labels.d.ts.map +1 -0
  109. package/dist/tools/update-projects.d.ts +120 -0
  110. package/dist/tools/update-projects.d.ts.map +1 -0
  111. package/dist/tools/update-reminders.d.ts +148 -0
  112. package/dist/tools/update-reminders.d.ts.map +1 -0
  113. package/dist/tools/update-sections.d.ts +42 -0
  114. package/dist/tools/update-sections.d.ts.map +1 -0
  115. package/dist/tools/update-tasks.d.ts +113 -0
  116. package/dist/tools/update-tasks.d.ts.map +1 -0
  117. package/dist/tools/user-info.d.ts +57 -0
  118. package/dist/tools/user-info.d.ts.map +1 -0
  119. package/dist/tools/view-attachment.d.ts +25 -0
  120. package/dist/tools/view-attachment.d.ts.map +1 -0
  121. package/dist/usage-tracking.d.ts +27 -0
  122. package/dist/usage-tracking.d.ts.map +1 -0
  123. package/dist/utils/assignment-validator.d.ts +69 -0
  124. package/dist/utils/assignment-validator.d.ts.map +1 -0
  125. package/dist/utils/colors.d.ts +68 -0
  126. package/dist/utils/colors.d.ts.map +1 -0
  127. package/dist/utils/constants.d.ts +53 -0
  128. package/dist/utils/constants.d.ts.map +1 -0
  129. package/dist/utils/date.d.ts +18 -0
  130. package/dist/utils/date.d.ts.map +1 -0
  131. package/dist/utils/duration-parser.d.ts +36 -0
  132. package/dist/utils/duration-parser.d.ts.map +1 -0
  133. package/dist/utils/filter-resolver.d.ts +27 -0
  134. package/dist/utils/filter-resolver.d.ts.map +1 -0
  135. package/dist/utils/labels.d.ts +13 -0
  136. package/dist/utils/labels.d.ts.map +1 -0
  137. package/dist/utils/output-schemas.d.ts +199 -0
  138. package/dist/utils/output-schemas.d.ts.map +1 -0
  139. package/dist/utils/priorities.d.ts +14 -0
  140. package/dist/utils/priorities.d.ts.map +1 -0
  141. package/dist/utils/reminder-schemas.d.ts +33 -0
  142. package/dist/utils/reminder-schemas.d.ts.map +1 -0
  143. package/dist/utils/response-builders.d.ts +93 -0
  144. package/dist/utils/response-builders.d.ts.map +1 -0
  145. package/dist/utils/retry.d.ts +10 -0
  146. package/dist/utils/retry.d.ts.map +1 -0
  147. package/dist/utils/sanitize-data.d.ts +10 -0
  148. package/dist/utils/sanitize-data.d.ts.map +1 -0
  149. package/dist/utils/schema-helpers.d.ts +10 -0
  150. package/dist/utils/schema-helpers.d.ts.map +1 -0
  151. package/dist/utils/test-helpers.d.ts +91 -0
  152. package/dist/utils/test-helpers.d.ts.map +1 -0
  153. package/dist/utils/tool-names.d.ts +56 -0
  154. package/dist/utils/tool-names.d.ts.map +1 -0
  155. package/dist/utils/user-resolver.d.ts +39 -0
  156. package/dist/utils/user-resolver.d.ts.map +1 -0
  157. package/dist/utils/validate-todoist-token.d.ts +9 -0
  158. package/dist/utils/validate-todoist-token.d.ts.map +1 -0
  159. package/dist/utils/workspace-resolver.d.ts +31 -0
  160. package/dist/utils/workspace-resolver.d.ts.map +1 -0
  161. package/package.json +122 -8
  162. package/scripts/bump-plugin-version.mjs +14 -0
  163. package/scripts/run-tool.ts +240 -0
  164. package/scripts/test-executable.cjs +69 -0
  165. package/scripts/validate-schemas.ts +284 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Doist
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,45 +1,221 @@
1
- # @doist/todoist-mcp
1
+ # Todoist MCP Server
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ > **Note:** This package was previously named `@doist/todoist-ai`. The old name continues to work as a thin shim that re-exports from `@doist/todoist-mcp`, but new installs should use `@doist/todoist-mcp` directly.
4
4
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
5
+ Library for connecting AI agents to Todoist. Includes tools that can be integrated into LLMs,
6
+ enabling them to access and modify a Todoist account on the user's behalf.
6
7
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
8
+ These tools can be used both through an MCP server, or imported directly in other projects to
9
+ integrate them to your own AI conversational interfaces.
8
10
 
9
- ## Purpose
11
+ ## Using tools
10
12
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@doist/todoist-mcp`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
13
+ ### 1. Add this repository as a dependency
15
14
 
16
- ## What is OIDC Trusted Publishing?
15
+ ```sh
16
+ npm install @doist/todoist-mcp
17
+ ```
17
18
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
+ ### 2. Import the tools and plug them to an AI
19
20
 
20
- ## Setup Instructions
21
+ Here's an example using [Vercel's AI SDK](https://ai-sdk.dev/docs/ai-sdk-core/generating-text#streamtext).
21
22
 
22
- To properly configure OIDC trusted publishing for this package:
23
+ ```js
24
+ import { findTasksByDate, addTasks } from '@doist/todoist-mcp'
25
+ import { TodoistApi } from '@doist/todoist-sdk'
26
+ import { streamText } from 'ai'
23
27
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
+ // Create Todoist API client
29
+ const client = new TodoistApi(process.env.TODOIST_API_KEY)
28
30
 
29
- ## DO NOT USE THIS PACKAGE
31
+ // Helper to wrap tools with the client
32
+ function wrapTool(tool, todoistClient) {
33
+ return {
34
+ ...tool,
35
+ execute(args) {
36
+ return tool.execute(args, todoistClient)
37
+ },
38
+ }
39
+ }
30
40
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
41
+ const result = streamText({
42
+ model: yourModel,
43
+ system: 'You are a helpful Todoist assistant',
44
+ tools: {
45
+ findTasksByDate: wrapTool(findTasksByDate, client),
46
+ addTasks: wrapTool(addTasks, client),
47
+ },
48
+ })
49
+ ```
36
50
 
37
- ## More Information
51
+ ## Using as an MCP server
38
52
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
53
+ ### Quick Start
42
54
 
43
- ---
55
+ You can run the MCP server directly with npx:
44
56
 
45
- **Maintained for OIDC setup purposes only**
57
+ ```bash
58
+ npx @doist/todoist-mcp
59
+ ```
60
+
61
+ ### Setup Guide
62
+
63
+ The Todoist MCP server is available as a streamable HTTP service for easy integration with various AI clients:
64
+
65
+ **Primary URL (Streamable HTTP):** `https://ai.todoist.net/mcp`
66
+
67
+ #### Claude Desktop
68
+
69
+ 1. Open Settings → Connectors → Add custom connector
70
+ 2. Enter `https://ai.todoist.net/mcp` and complete OAuth authentication
71
+
72
+ #### Cursor
73
+
74
+ Create a configuration file:
75
+
76
+ - **Global:** `~/.cursor/mcp.json`
77
+ - **Project-specific:** `.cursor/mcp.json`
78
+
79
+ ```json
80
+ {
81
+ "mcpServers": {
82
+ "todoist": {
83
+ "command": "npx",
84
+ "args": ["-y", "mcp-remote", "https://ai.todoist.net/mcp"]
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ Then enable the server in Cursor settings if prompted.
91
+
92
+ #### Claude Code (CLI)
93
+
94
+ The fastest setup is the official Todoist plugin, which wires up the MCP server for you:
95
+
96
+ ```bash
97
+ /plugin marketplace add doist/todoist-mcp
98
+ /plugin install todoist@doist
99
+ ```
100
+
101
+ OAuth runs in your browser the first time you use a Todoist tool. See [Anthropic's plugin docs](https://code.claude.com/docs/en/plugins-reference) for more.
102
+
103
+ If you'd rather configure the MCP server manually, run:
104
+
105
+ ```bash
106
+ claude mcp add --transport http todoist https://ai.todoist.net/mcp
107
+ ```
108
+
109
+ Then launch `claude`, execute `/mcp`, and select the `todoist` MCP server to authenticate.
110
+
111
+ #### Visual Studio Code
112
+
113
+ 1. Open Command Palette → MCP: Add Server
114
+ 2. Select HTTP transport and use:
115
+
116
+ ```json
117
+ {
118
+ "servers": {
119
+ "todoist": {
120
+ "type": "http",
121
+ "url": "https://ai.todoist.net/mcp"
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ #### Other MCP Clients
128
+
129
+ ```bash
130
+ npx -y mcp-remote https://ai.todoist.net/mcp
131
+ ```
132
+
133
+ For more details on setting up and using the MCP server, including creating custom servers, see [docs/mcp-server.md](docs/mcp-server.md).
134
+
135
+ ## Features
136
+
137
+ A key feature of this project is that tools can be reused, and are not written specifically for use in an MCP server. They can be hooked up as tools to other conversational AI interfaces (e.g. Vercel's AI SDK).
138
+
139
+ This project is in its early stages. Expect more and/or better tools soon.
140
+
141
+ Nevertheless, our goal is to provide a small set of tools that enable complete workflows, rather than just atomic actions, striking a balance between flexibility and efficiency for LLMs.
142
+
143
+ For our design philosophy, guidelines, and development patterns, see [docs/tool-design.md](docs/tool-design.md).
144
+
145
+ ### Available Tools
146
+
147
+ For a complete list of available tools, see the [src/tools](src/tools) directory.
148
+
149
+ #### OpenAI MCP Compatibility
150
+
151
+ This server includes `search` and `fetch` tools that follow the [OpenAI MCP specification](https://platform.openai.com/docs/mcp), enabling seamless integration with OpenAI's MCP protocol. These tools return JSON-encoded results optimized for OpenAI's requirements while maintaining compatibility with the broader MCP ecosystem.
152
+
153
+ ## Dependencies
154
+
155
+ - MCP server using the official [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#installation)
156
+ - Todoist Typescript API client [@doist/todoist-sdk](https://github.com/Doist/todoist-sdk)
157
+
158
+ ## MCP Server Setup
159
+
160
+ See [docs/mcp-server.md](docs/mcp-server.md) for full instructions on setting up the MCP server.
161
+
162
+ ## Local Development Setup
163
+
164
+ See [docs/dev-setup.md](docs/dev-setup.md) for full setup instructions and [CONTRIBUTING.md](CONTRIBUTING.md) for contributor workflows and quality checks.
165
+
166
+ ### MCP Apps
167
+
168
+ This project includes support for **MCP Apps** – interactive UI widgets rendered inline in AI chat interfaces. Widgets provide rich visual representations of tool outputs (e.g., task lists) instead of plain text.
169
+
170
+ See [docs/mcp-apps.md](docs/mcp-apps.md) for the widget architecture, build pipeline, and development workflow.
171
+
172
+ ### Quick Start
173
+
174
+ After cloning and setting up the repository:
175
+
176
+ - `npm start` - Build and run the MCP inspector for testing
177
+ - `npm run dev` - Development mode with auto-rebuild and restart
178
+ - `npm run tool:list` - List available tools for direct execution
179
+ - `npm run tool -- <tool-name> '<json-args>'` - Run a tool directly without MCP
180
+
181
+ When using `npm run tool`, include `--` before tool arguments so npm forwards them to `scripts/run-tool.ts`.
182
+
183
+ Example check before write operations:
184
+ `npm run tool -- user-info '{}'`
185
+ This confirms which Todoist account the current `TODOIST_API_KEY` is connected to.
186
+
187
+ `run-tool` uses `TODOIST_API_KEY` from your `.env` file (created from `.env.example` by `npm run setup`). Use a test account or a temporary project when running write operations to avoid modifying real data.
188
+
189
+ ## Contributing
190
+
191
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for:
192
+
193
+ - Development workflow
194
+ - Running tools directly with `scripts/run-tool.ts`
195
+ - Testing and quality checks
196
+ - Commit conventions
197
+
198
+ ## Releasing
199
+
200
+ This project uses [release-please](https://github.com/googleapis/release-please) to automate version management and package publishing.
201
+
202
+ ### How it works
203
+
204
+ 1. Make your changes using [Conventional Commits](https://www.conventionalcommits.org/):
205
+ - `feat:` for new features (minor version bump)
206
+ - `fix:` for bug fixes (patch version bump)
207
+ - `feat!:` or `fix!:` for breaking changes (major version bump)
208
+ - `docs:` for documentation changes
209
+ - `chore:` for maintenance tasks
210
+ - `ci:` for CI changes
211
+
212
+ 2. When commits are pushed to `main`:
213
+ - Release-please automatically creates/updates a release PR
214
+ - The PR includes version bump and changelog updates
215
+ - Review the PR and merge when ready
216
+
217
+ 3. After merging the release PR:
218
+ - A new GitHub release is automatically created
219
+ - A new tag is created
220
+ - The `publish` workflow is triggered
221
+ - The package is published to npm
@@ -0,0 +1,51 @@
1
+ import { TodoistApi } from '@doist/todoist-sdk';
2
+ export declare const RESPONSIBLE_USER_FILTERING: readonly ["assigned", "unassignedOrMe", "all"];
3
+ export type ResponsibleUserFiltering = (typeof RESPONSIBLE_USER_FILTERING)[number];
4
+ /**
5
+ * Resolves a responsible user name/email to user ID and email.
6
+ * @param client - Todoist API client
7
+ * @param responsibleUser - User identifier (can be user ID, name, or email)
8
+ * @returns Object with userId and email, or undefined if not provided
9
+ * @throws Error if user cannot be found
10
+ */
11
+ export declare function resolveResponsibleUser(client: TodoistApi, responsibleUser: string | undefined): Promise<{
12
+ userId: string;
13
+ email: string;
14
+ } | undefined>;
15
+ /**
16
+ * Appends a filter component to a query string with proper ' & ' separator.
17
+ * @param query - The existing query string
18
+ * @param filterComponent - The filter component to append
19
+ * @returns The updated query string
20
+ */
21
+ export declare function appendToQuery(query: string, filterComponent: string): string;
22
+ /**
23
+ * Builds a query filter string for responsible user filtering that can be appended to a Todoist filter query.
24
+ * @param resolvedAssigneeId - The resolved assignee ID (if provided)
25
+ * @param assigneeEmail - The assignee email (if provided)
26
+ * @param responsibleUserFiltering - The filtering mode ('assigned', 'unassignedOrMe', 'all')
27
+ * @returns Query filter string (e.g., "assigned to: email@example.com" or "!assigned to: others")
28
+ */
29
+ export declare function buildResponsibleUserQueryFilter({ resolvedAssigneeId, assigneeEmail, responsibleUserFiltering, }: {
30
+ resolvedAssigneeId: string | undefined;
31
+ assigneeEmail: string | undefined;
32
+ responsibleUserFiltering?: ResponsibleUserFiltering;
33
+ }): string;
34
+ /**
35
+ * Filters tasks based on responsible user logic:
36
+ * - If resolvedAssigneeId is provided: returns only tasks assigned to that user
37
+ * - If no resolvedAssigneeId: returns only unassigned tasks or tasks assigned to current user
38
+ * @param tasks - Array of tasks to filter (must have responsibleUid property)
39
+ * @param resolvedAssigneeId - The resolved assignee ID to filter by (optional)
40
+ * @param currentUserId - The current authenticated user's ID
41
+ * @returns Filtered array of tasks
42
+ */
43
+ export declare function filterTasksByResponsibleUser<T extends {
44
+ responsibleUid?: string;
45
+ }>({ tasks, resolvedAssigneeId, currentUserId, responsibleUserFiltering, }: {
46
+ tasks: T[];
47
+ resolvedAssigneeId: string | undefined;
48
+ currentUserId: string;
49
+ responsibleUserFiltering?: ResponsibleUserFiltering;
50
+ }): T[];
51
+ //# sourceMappingURL=filter-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-helpers.d.ts","sourceRoot":"","sources":["../src/filter-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAGpD,eAAO,MAAM,0BAA0B,gDAAiD,CAAA;AACxF,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAA;AAElF;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CACxC,MAAM,EAAE,UAAU,EAClB,eAAe,EAAE,MAAM,GAAG,SAAS,GACpC,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,CAaxD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,CAQ5E;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,EAC5C,kBAAkB,EAClB,aAAa,EACb,wBAA2C,GAC9C,EAAE;IACC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;CACtD,GAAG,MAAM,CAmBT;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EAChF,KAAK,EACL,kBAAkB,EAClB,aAAa,EACb,wBAA2C,GAC9C,EAAE;IACC,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAA;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;CACtD,GAAG,CAAC,EAAE,CAWN"}