@todoist/sdk 0.0.1 → 18.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.
- package/LICENSE +21 -0
- package/README.md +293 -29
- package/dist/esm/authentication.js +307 -0
- package/dist/esm/clients/activity-client.js +60 -0
- package/dist/esm/clients/app-client.js +366 -0
- package/dist/esm/clients/backup-client.js +47 -0
- package/dist/esm/clients/base-client.js +29 -0
- package/dist/esm/clients/billing-client.js +160 -0
- package/dist/esm/clients/comment-client.js +92 -0
- package/dist/esm/clients/email-client.js +41 -0
- package/dist/esm/clients/filter-client.js +26 -0
- package/dist/esm/clients/folder-client.js +80 -0
- package/dist/esm/clients/id-mapping-client.js +37 -0
- package/dist/esm/clients/insights-client.js +89 -0
- package/dist/esm/clients/label-client.js +131 -0
- package/dist/esm/clients/productivity-client.js +24 -0
- package/dist/esm/clients/project-client.js +284 -0
- package/dist/esm/clients/reminder-client.js +204 -0
- package/dist/esm/clients/section-client.js +121 -0
- package/dist/esm/clients/task-client.js +264 -0
- package/dist/esm/clients/template-client.js +89 -0
- package/dist/esm/clients/ui-extension-client.js +110 -0
- package/dist/esm/clients/upload-client.js +153 -0
- package/dist/esm/clients/view-options-client.js +21 -0
- package/dist/esm/clients/workspace-client.js +384 -0
- package/dist/esm/consts/endpoints.js +193 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/test-utils/asserts.js +8 -0
- package/dist/esm/test-utils/msw-setup.js +88 -0
- package/dist/esm/test-utils/obsidian-fetch-adapter.js +51 -0
- package/dist/esm/test-utils/test-defaults.js +367 -0
- package/dist/esm/test-utils/transport-seam.js +15 -0
- package/dist/esm/test-utils/webhook-fixtures.js +26 -0
- package/dist/esm/todoist-api.js +1757 -0
- package/dist/esm/transport/fetch-with-retry.js +216 -0
- package/dist/esm/transport/http-client.js +140 -0
- package/dist/esm/transport/http-dispatcher.js +158 -0
- package/dist/esm/transport/sync-request.js +106 -0
- package/dist/esm/types/activity/index.js +2 -0
- package/dist/esm/types/activity/requests.js +1 -0
- package/dist/esm/types/activity/types.js +45 -0
- package/dist/esm/types/apps/index.js +2 -0
- package/dist/esm/types/apps/requests.js +1 -0
- package/dist/esm/types/apps/types.js +249 -0
- package/dist/esm/types/backups/index.js +2 -0
- package/dist/esm/types/backups/requests.js +1 -0
- package/dist/esm/types/backups/types.js +5 -0
- package/dist/esm/types/billing/index.js +2 -0
- package/dist/esm/types/billing/requests.js +1 -0
- package/dist/esm/types/billing/types.js +89 -0
- package/dist/esm/types/comments/index.js +2 -0
- package/dist/esm/types/comments/requests.js +1 -0
- package/dist/esm/types/comments/types.js +57 -0
- package/dist/esm/types/common.js +7 -0
- package/dist/esm/types/emails/index.js +1 -0
- package/dist/esm/types/emails/requests.js +2 -0
- package/dist/esm/types/errors.js +41 -0
- package/dist/esm/types/folders/index.js +1 -0
- package/dist/esm/types/folders/requests.js +1 -0
- package/dist/esm/types/http.js +20 -0
- package/dist/esm/types/id-mappings/index.js +2 -0
- package/dist/esm/types/id-mappings/requests.js +17 -0
- package/dist/esm/types/id-mappings/types.js +9 -0
- package/dist/esm/types/index.js +24 -0
- package/dist/esm/types/insights/index.js +2 -0
- package/dist/esm/types/insights/requests.js +1 -0
- package/dist/esm/types/insights/types.js +77 -0
- package/dist/esm/types/labels/index.js +2 -0
- package/dist/esm/types/labels/requests.js +1 -0
- package/dist/esm/types/labels/types.js +8 -0
- package/dist/esm/types/productivity/index.js +1 -0
- package/dist/esm/types/productivity/types.js +65 -0
- package/dist/esm/types/projects/index.js +2 -0
- package/dist/esm/types/projects/requests.js +1 -0
- package/dist/esm/types/projects/types.js +65 -0
- package/dist/esm/types/reminders/index.js +1 -0
- package/dist/esm/types/reminders/requests.js +92 -0
- package/dist/esm/types/sections/index.js +2 -0
- package/dist/esm/types/sections/requests.js +1 -0
- package/dist/esm/types/sections/types.js +23 -0
- package/dist/esm/types/sync/commands/calendars.js +1 -0
- package/dist/esm/types/sync/commands/filters.js +1 -0
- package/dist/esm/types/sync/commands/folders.js +1 -0
- package/dist/esm/types/sync/commands/index.js +18 -0
- package/dist/esm/types/sync/commands/labels.js +2 -0
- package/dist/esm/types/sync/commands/notes.js +1 -0
- package/dist/esm/types/sync/commands/notifications.js +1 -0
- package/dist/esm/types/sync/commands/others.js +1 -0
- package/dist/esm/types/sync/commands/project-view-options.js +1 -0
- package/dist/esm/types/sync/commands/projects.js +1 -0
- package/dist/esm/types/sync/commands/reminders.js +1 -0
- package/dist/esm/types/sync/commands/sections.js +1 -0
- package/dist/esm/types/sync/commands/shared.js +16 -0
- package/dist/esm/types/sync/commands/sharing.js +1 -0
- package/dist/esm/types/sync/commands/tasks.js +1 -0
- package/dist/esm/types/sync/commands/view-options.js +1 -0
- package/dist/esm/types/sync/commands/workspace-filters.js +1 -0
- package/dist/esm/types/sync/commands/workspaces.js +1 -0
- package/dist/esm/types/sync/index.js +6 -0
- package/dist/esm/types/sync/request.js +1 -0
- package/dist/esm/types/sync/resource-types.js +36 -0
- package/dist/esm/types/sync/resources/calendars.js +24 -0
- package/dist/esm/types/sync/resources/collaborators.js +21 -0
- package/dist/esm/types/sync/resources/completed-info.js +21 -0
- package/dist/esm/types/sync/resources/filters.js +12 -0
- package/dist/esm/types/sync/resources/folders.js +10 -0
- package/dist/esm/types/sync/resources/index.js +18 -0
- package/dist/esm/types/sync/resources/labels.js +7 -0
- package/dist/esm/types/sync/resources/live-notifications.js +35 -0
- package/dist/esm/types/sync/resources/notes.js +18 -0
- package/dist/esm/types/sync/resources/reminders.js +58 -0
- package/dist/esm/types/sync/resources/suggestions.js +33 -0
- package/dist/esm/types/sync/resources/tooltips.js +5 -0
- package/dist/esm/types/sync/resources/user-plan-limits.js +21 -0
- package/dist/esm/types/sync/resources/user-settings.js +41 -0
- package/dist/esm/types/sync/resources/user-status.js +22 -0
- package/dist/esm/types/sync/resources/user.js +109 -0
- package/dist/esm/types/sync/resources/view-options.js +128 -0
- package/dist/esm/types/sync/resources/workspace-filters.js +17 -0
- package/dist/esm/types/sync/resources/workspaces.js +69 -0
- package/dist/esm/types/sync/response.js +57 -0
- package/dist/esm/types/sync/user-preferences.js +68 -0
- package/dist/esm/types/tasks/index.js +2 -0
- package/dist/esm/types/tasks/requests.js +1 -0
- package/dist/esm/types/tasks/types.js +56 -0
- package/dist/esm/types/templates/index.js +1 -0
- package/dist/esm/types/templates/requests.js +1 -0
- package/dist/esm/types/ui-extensions/index.js +2 -0
- package/dist/esm/types/ui-extensions/requests.js +1 -0
- package/dist/esm/types/ui-extensions/types.js +74 -0
- package/dist/esm/types/uploads/index.js +1 -0
- package/dist/esm/types/uploads/requests.js +1 -0
- package/dist/esm/types/users/index.js +1 -0
- package/dist/esm/types/users/types.js +49 -0
- package/dist/esm/types/webhooks/comments.js +93 -0
- package/dist/esm/types/webhooks/envelope.js +23 -0
- package/dist/esm/types/webhooks/filters.js +27 -0
- package/dist/esm/types/webhooks/index.js +9 -0
- package/dist/esm/types/webhooks/labels.js +51 -0
- package/dist/esm/types/webhooks/projects.js +33 -0
- package/dist/esm/types/webhooks/reminders.js +32 -0
- package/dist/esm/types/webhooks/sections.js +50 -0
- package/dist/esm/types/webhooks/tasks.js +65 -0
- package/dist/esm/types/webhooks/types.js +52 -0
- package/dist/esm/types/workspaces/index.js +2 -0
- package/dist/esm/types/workspaces/requests.js +1 -0
- package/dist/esm/types/workspaces/types.js +151 -0
- package/dist/esm/utils/activity-helpers.js +53 -0
- package/dist/esm/utils/case-conversion.js +84 -0
- package/dist/esm/utils/colors.js +145 -0
- package/dist/esm/utils/file-response.js +29 -0
- package/dist/esm/utils/filter-queries.js +231 -0
- package/dist/esm/utils/filter-query-definitions.js +2789 -0
- package/dist/esm/utils/headers.js +42 -0
- package/dist/esm/utils/index.js +11 -0
- package/dist/esm/utils/multipart-upload.js +267 -0
- package/dist/esm/utils/person-names.js +61 -0
- package/dist/esm/utils/processing-helpers.js +12 -0
- package/dist/esm/utils/project-helpers.js +29 -0
- package/dist/esm/utils/request-helpers.js +43 -0
- package/dist/esm/utils/sanitization.js +131 -0
- package/dist/esm/utils/sync-helpers.js +19 -0
- package/dist/esm/utils/task-sorting.js +280 -0
- package/dist/esm/utils/uncompletable-helpers.js +54 -0
- package/dist/esm/utils/url-helpers.js +196 -0
- package/dist/esm/utils/validators.js +102 -0
- package/dist/esm/utils/view-options.js +15 -0
- package/dist/esm/utils/webhook-parser.js +56 -0
- package/dist/types/authentication.d.ts +262 -0
- package/dist/types/clients/activity-client.d.ts +12 -0
- package/dist/types/clients/app-client.d.ts +37 -0
- package/dist/types/clients/backup-client.d.ts +14 -0
- package/dist/types/clients/base-client.d.ts +23 -0
- package/dist/types/clients/billing-client.d.ts +22 -0
- package/dist/types/clients/comment-client.d.ts +15 -0
- package/dist/types/clients/email-client.d.ts +13 -0
- package/dist/types/clients/filter-client.d.ts +10 -0
- package/dist/types/clients/folder-client.d.ts +16 -0
- package/dist/types/clients/id-mapping-client.d.ts +13 -0
- package/dist/types/clients/insights-client.d.ts +18 -0
- package/dist/types/clients/label-client.d.ts +19 -0
- package/dist/types/clients/productivity-client.d.ts +12 -0
- package/dist/types/clients/project-client.d.ts +22 -0
- package/dist/types/clients/reminder-client.d.ts +25 -0
- package/dist/types/clients/section-client.d.ts +18 -0
- package/dist/types/clients/task-client.d.ts +25 -0
- package/dist/types/clients/template-client.d.ts +17 -0
- package/dist/types/clients/ui-extension-client.d.ts +18 -0
- package/dist/types/clients/upload-client.d.ts +17 -0
- package/dist/types/clients/view-options-client.d.ts +8 -0
- package/dist/types/clients/workspace-client.d.ts +43 -0
- package/dist/types/consts/endpoints.d.ts +120 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/test-utils/asserts.d.ts +1 -0
- package/dist/types/test-utils/msw-setup.d.ts +33 -0
- package/dist/types/test-utils/obsidian-fetch-adapter.d.ts +29 -0
- package/dist/types/test-utils/test-defaults.d.ts +286 -0
- package/dist/types/test-utils/transport-seam.d.ts +1 -0
- package/dist/types/test-utils/webhook-fixtures.d.ts +13 -0
- package/dist/types/todoist-api.d.ts +1437 -0
- package/dist/types/transport/fetch-with-retry.d.ts +12 -0
- package/dist/types/transport/http-client.d.ts +25 -0
- package/dist/types/transport/http-dispatcher.d.ts +65 -0
- package/dist/types/transport/sync-request.d.ts +31 -0
- package/dist/types/types/activity/index.d.ts +2 -0
- package/dist/types/types/activity/requests.d.ts +85 -0
- package/dist/types/types/activity/types.d.ts +56 -0
- package/dist/types/types/apps/index.d.ts +2 -0
- package/dist/types/types/apps/requests.d.ts +89 -0
- package/dist/types/types/apps/types.d.ts +418 -0
- package/dist/types/types/backups/index.d.ts +2 -0
- package/dist/types/types/backups/requests.d.ts +16 -0
- package/dist/types/types/backups/types.d.ts +7 -0
- package/dist/types/types/billing/index.d.ts +2 -0
- package/dist/types/types/billing/requests.d.ts +62 -0
- package/dist/types/types/billing/types.d.ts +207 -0
- package/dist/types/types/comments/index.d.ts +2 -0
- package/dist/types/types/comments/requests.d.ts +64 -0
- package/dist/types/types/comments/types.d.ts +141 -0
- package/dist/types/types/common.d.ts +13 -0
- package/dist/types/types/emails/index.d.ts +1 -0
- package/dist/types/types/emails/requests.d.ts +30 -0
- package/dist/types/types/errors.d.ts +29 -0
- package/dist/types/types/folders/index.d.ts +1 -0
- package/dist/types/types/folders/requests.d.ts +20 -0
- package/dist/types/types/http.d.ts +104 -0
- package/dist/types/types/id-mappings/index.d.ts +2 -0
- package/dist/types/types/id-mappings/requests.d.ts +28 -0
- package/dist/types/types/id-mappings/types.d.ts +13 -0
- package/dist/types/types/index.d.ts +24 -0
- package/dist/types/types/insights/index.d.ts +2 -0
- package/dist/types/types/insights/requests.d.ts +26 -0
- package/dist/types/types/insights/types.d.ts +167 -0
- package/dist/types/types/labels/index.d.ts +2 -0
- package/dist/types/types/labels/requests.d.ts +75 -0
- package/dist/types/types/labels/types.d.ts +13 -0
- package/dist/types/types/productivity/index.d.ts +1 -0
- package/dist/types/types/productivity/types.d.ts +115 -0
- package/dist/types/types/projects/index.d.ts +2 -0
- package/dist/types/types/projects/requests.d.ts +206 -0
- package/dist/types/types/projects/types.d.ts +286 -0
- package/dist/types/types/reminders/index.d.ts +1 -0
- package/dist/types/types/reminders/requests.d.ts +205 -0
- package/dist/types/types/sections/index.d.ts +2 -0
- package/dist/types/types/sections/requests.d.ts +49 -0
- package/dist/types/types/sections/types.d.ts +70 -0
- package/dist/types/types/sync/commands/calendars.d.ts +14 -0
- package/dist/types/types/sync/commands/filters.d.ts +24 -0
- package/dist/types/types/sync/commands/folders.d.ts +20 -0
- package/dist/types/types/sync/commands/index.d.ts +167 -0
- package/dist/types/types/sync/commands/labels.d.ts +32 -0
- package/dist/types/types/sync/commands/notes.d.ts +27 -0
- package/dist/types/types/sync/commands/notifications.d.ts +10 -0
- package/dist/types/types/sync/commands/others.d.ts +61 -0
- package/dist/types/types/sync/commands/project-view-options.d.ts +13 -0
- package/dist/types/types/sync/commands/projects.d.ts +96 -0
- package/dist/types/types/sync/commands/reminders.d.ts +51 -0
- package/dist/types/types/sync/commands/sections.d.ts +36 -0
- package/dist/types/types/sync/commands/shared.d.ts +51 -0
- package/dist/types/types/sync/commands/sharing.d.ts +16 -0
- package/dist/types/types/sync/commands/tasks.d.ts +78 -0
- package/dist/types/types/sync/commands/view-options.d.ts +18 -0
- package/dist/types/types/sync/commands/workspace-filters.d.ts +25 -0
- package/dist/types/types/sync/commands/workspaces.d.ts +82 -0
- package/dist/types/types/sync/index.d.ts +6 -0
- package/dist/types/types/sync/request.d.ts +7 -0
- package/dist/types/types/sync/resource-types.d.ts +5 -0
- package/dist/types/types/sync/resources/calendars.d.ts +38 -0
- package/dist/types/types/sync/resources/collaborators.d.ts +45 -0
- package/dist/types/types/sync/resources/completed-info.d.ts +33 -0
- package/dist/types/types/sync/resources/filters.d.ts +13 -0
- package/dist/types/types/sync/resources/folders.d.ts +11 -0
- package/dist/types/types/sync/resources/index.d.ts +18 -0
- package/dist/types/types/sync/resources/labels.d.ts +12 -0
- package/dist/types/types/sync/resources/live-notifications.d.ts +32 -0
- package/dist/types/types/sync/resources/notes.d.ts +34 -0
- package/dist/types/types/sync/resources/reminders.d.ts +213 -0
- package/dist/types/types/sync/resources/suggestions.d.ts +96 -0
- package/dist/types/types/sync/resources/tooltips.d.ts +6 -0
- package/dist/types/types/sync/resources/user-plan-limits.d.ts +47 -0
- package/dist/types/types/sync/resources/user-settings.d.ts +40 -0
- package/dist/types/types/sync/resources/user-status.d.ts +46 -0
- package/dist/types/types/sync/resources/user.d.ts +151 -0
- package/dist/types/types/sync/resources/view-options.d.ts +157 -0
- package/dist/types/types/sync/resources/workspace-filters.d.ts +18 -0
- package/dist/types/types/sync/resources/workspaces.d.ts +142 -0
- package/dist/types/types/sync/response.d.ts +930 -0
- package/dist/types/types/sync/user-preferences.d.ts +39 -0
- package/dist/types/types/tasks/index.d.ts +2 -0
- package/dist/types/types/tasks/requests.d.ts +197 -0
- package/dist/types/types/tasks/types.d.ts +162 -0
- package/dist/types/types/templates/index.d.ts +1 -0
- package/dist/types/types/templates/requests.d.ts +92 -0
- package/dist/types/types/ui-extensions/index.d.ts +2 -0
- package/dist/types/types/ui-extensions/requests.d.ts +108 -0
- package/dist/types/types/ui-extensions/types.d.ts +185 -0
- package/dist/types/types/uploads/index.d.ts +1 -0
- package/dist/types/types/uploads/requests.d.ts +32 -0
- package/dist/types/types/users/index.d.ts +1 -0
- package/dist/types/types/users/types.d.ts +67 -0
- package/dist/types/types/webhooks/comments.d.ts +1600 -0
- package/dist/types/types/webhooks/envelope.d.ts +34 -0
- package/dist/types/types/webhooks/filters.d.ts +99 -0
- package/dist/types/types/webhooks/index.d.ts +9 -0
- package/dist/types/types/webhooks/labels.d.ts +160 -0
- package/dist/types/types/webhooks/projects.d.ts +365 -0
- package/dist/types/types/webhooks/reminders.d.ts +82 -0
- package/dist/types/types/webhooks/sections.d.ts +372 -0
- package/dist/types/types/webhooks/tasks.d.ts +981 -0
- package/dist/types/types/webhooks/types.d.ts +2606 -0
- package/dist/types/types/workspaces/index.d.ts +2 -0
- package/dist/types/types/workspaces/requests.d.ts +260 -0
- package/dist/types/types/workspaces/types.d.ts +266 -0
- package/dist/types/utils/activity-helpers.d.ts +28 -0
- package/dist/types/utils/case-conversion.d.ts +20 -0
- package/dist/types/utils/colors.d.ts +201 -0
- package/dist/types/utils/file-response.d.ts +15 -0
- package/dist/types/utils/filter-queries.d.ts +42 -0
- package/dist/types/utils/filter-query-definitions.d.ts +27 -0
- package/dist/types/utils/headers.d.ts +20 -0
- package/dist/types/utils/index.d.ts +15 -0
- package/dist/types/utils/multipart-upload.d.ts +58 -0
- package/dist/types/utils/person-names.d.ts +52 -0
- package/dist/types/utils/processing-helpers.d.ts +1 -0
- package/dist/types/utils/project-helpers.d.ts +21 -0
- package/dist/types/utils/request-helpers.d.ts +33 -0
- package/dist/types/utils/sanitization.d.ts +52 -0
- package/dist/types/utils/sync-helpers.d.ts +17 -0
- package/dist/types/utils/task-sorting.d.ts +46 -0
- package/dist/types/utils/uncompletable-helpers.d.ts +30 -0
- package/dist/types/utils/url-helpers.d.ts +120 -0
- package/dist/types/utils/validators.d.ts +1917 -0
- package/dist/types/utils/view-options.d.ts +11 -0
- package/dist/types/utils/webhook-parser.d.ts +48 -0
- package/package.json +87 -8
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AddTaskArgs, GetAllCompletedTasksArgs, GetAllCompletedTasksResponse, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, GetTasksArgs, GetTasksByFilterArgs, GetTasksResponse, MoveTaskArgs, QuickAddTaskArgs, SearchCompletedTasksArgs, Task, UpdateTaskArgs } from '../types/tasks/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all task-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public task method on `TodoistApi`
|
|
7
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TaskClient extends BaseClient {
|
|
10
|
+
getTask(id: string): Promise<Task>;
|
|
11
|
+
getTasks(args?: GetTasksArgs): Promise<GetTasksResponse>;
|
|
12
|
+
getTasksByFilter(args: GetTasksByFilterArgs): Promise<GetTasksResponse>;
|
|
13
|
+
getCompletedTasksByCompletionDate(args: GetCompletedTasksByCompletionDateArgs): Promise<GetCompletedTasksResponse>;
|
|
14
|
+
getCompletedTasksByDueDate(args: GetCompletedTasksByDueDateArgs): Promise<GetCompletedTasksResponse>;
|
|
15
|
+
searchCompletedTasks(args: SearchCompletedTasksArgs): Promise<GetCompletedTasksResponse>;
|
|
16
|
+
getAllCompletedTasks(args?: GetAllCompletedTasksArgs): Promise<GetAllCompletedTasksResponse>;
|
|
17
|
+
addTask(args: AddTaskArgs, requestId?: string): Promise<Task>;
|
|
18
|
+
quickAddTask(args: QuickAddTaskArgs): Promise<Task>;
|
|
19
|
+
updateTask(id: string, args: UpdateTaskArgs, requestId?: string): Promise<Task>;
|
|
20
|
+
moveTasks(ids: string[], args: MoveTaskArgs, requestId?: string): Promise<Task[]>;
|
|
21
|
+
moveTask(id: string, args: MoveTaskArgs, requestId?: string): Promise<Task>;
|
|
22
|
+
closeTask(id: string, requestId?: string): Promise<boolean>;
|
|
23
|
+
reopenTask(id: string, requestId?: string): Promise<boolean>;
|
|
24
|
+
deleteTask(id: string, requestId?: string): Promise<boolean>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, ImportTemplateFromIdArgs, ImportTemplateIntoProjectArgs, ImportTemplateResponse } from '../types/templates/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all template-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public template method on
|
|
7
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
8
|
+
* JSDoc.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TemplateClient extends BaseClient {
|
|
11
|
+
exportTemplateAsFile(args: ExportTemplateFileArgs): Promise<string>;
|
|
12
|
+
exportTemplateAsUrl(args: ExportTemplateUrlArgs): Promise<ExportTemplateUrlResponse>;
|
|
13
|
+
createProjectFromTemplate(args: CreateProjectFromTemplateArgs, requestId?: string): Promise<CreateProjectFromTemplateResponse>;
|
|
14
|
+
importTemplateIntoProject(args: ImportTemplateIntoProjectArgs, requestId?: string): Promise<ImportTemplateResponse>;
|
|
15
|
+
importTemplateFromId(args: ImportTemplateFromIdArgs, requestId?: string): Promise<ImportTemplateResponse>;
|
|
16
|
+
private validateTemplateResponse;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AddUiExtensionArgs, UiExtension, UpdateUiExtensionArgs, UploadUiExtensionIconArgs } from '../types/ui-extensions/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all UI-extension endpoints for developer
|
|
5
|
+
* applications. All endpoints require the `dev:app_console` OAuth scope.
|
|
6
|
+
*
|
|
7
|
+
* Instantiated by `TodoistApi`; every public UI-extension method on
|
|
8
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing JSDoc.
|
|
9
|
+
*/
|
|
10
|
+
export declare class UiExtensionClient extends BaseClient {
|
|
11
|
+
getUiExtension(uiExtensionId: string, requestId?: string): Promise<UiExtension>;
|
|
12
|
+
getInstalledUiExtensions(requestId?: string): Promise<UiExtension[]>;
|
|
13
|
+
getUiExtensionsForApp(appId: string, requestId?: string): Promise<UiExtension[]>;
|
|
14
|
+
addUiExtension(args: AddUiExtensionArgs, requestId?: string): Promise<UiExtension>;
|
|
15
|
+
updateUiExtension(uiExtensionId: string, args: UpdateUiExtensionArgs, requestId?: string): Promise<UiExtension>;
|
|
16
|
+
deleteUiExtension(uiExtensionId: string, requestId?: string): Promise<boolean>;
|
|
17
|
+
uploadUiExtensionIcon(args: UploadUiExtensionIconArgs, requestId?: string): Promise<UiExtension>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Attachment, Comment } from '../types/comments/index.js';
|
|
2
|
+
import type { FileResponse } from '../types/http.js';
|
|
3
|
+
import type { DeleteUploadArgs, UploadFileArgs } from '../types/uploads/index.js';
|
|
4
|
+
import { BaseClient } from './base-client.js';
|
|
5
|
+
/**
|
|
6
|
+
* Internal sub-client handling upload + attachment endpoints
|
|
7
|
+
* (file upload, upload delete, attachment view).
|
|
8
|
+
*
|
|
9
|
+
* Instantiated by `TodoistApi`; every public upload method on
|
|
10
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
11
|
+
* JSDoc.
|
|
12
|
+
*/
|
|
13
|
+
export declare class UploadClient extends BaseClient {
|
|
14
|
+
uploadFile(args: UploadFileArgs, requestId?: string): Promise<Attachment>;
|
|
15
|
+
deleteUpload(args: DeleteUploadArgs, requestId?: string): Promise<boolean>;
|
|
16
|
+
viewAttachment(commentOrUrl: Comment | string): Promise<FileResponse>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ViewOptions, ViewOptionsDeleteArgs, ViewOptionsSetArgs } from '../types/sync/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/** Internal sub-client for saved view-option reads and writes. */
|
|
4
|
+
export declare class ViewOptionsClient extends BaseClient {
|
|
5
|
+
getViewOptions(): Promise<ViewOptions[]>;
|
|
6
|
+
setViewOptions(args: ViewOptionsSetArgs, requestId?: string): Promise<void>;
|
|
7
|
+
deleteViewOptions(args: ViewOptionsDeleteArgs, requestId?: string): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { GetProjectsResponse } from '../types/projects/index.js';
|
|
2
|
+
import type { AddWorkspaceArgs, AllWorkspaceInvitationsResponse, DeleteWorkspaceInvitationArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceProjectsArgs, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, JoinWorkspaceArgs, JoinWorkspaceResult, RemoveWorkspaceUserArgs, UpdateWorkspaceArgs, UpdateWorkspaceUserArgs, Workspace, WorkspaceInvitation, WorkspaceInvitationActionArgs, WorkspaceInvitationsResponse, WorkspaceLogoArgs, WorkspaceLogoResponse, WorkspacePlanDetails } from '../types/workspaces/index.js';
|
|
3
|
+
import { BaseClient } from './base-client.js';
|
|
4
|
+
type GetAllWorkspaceInvitationsArgs = {
|
|
5
|
+
workspaceId?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Internal sub-client handling all workspace-domain endpoints —
|
|
9
|
+
* workspaces, invitations, users, plans, logos, and workspace project
|
|
10
|
+
* pagination.
|
|
11
|
+
*
|
|
12
|
+
* Instantiated by `TodoistApi`; every public workspace method on
|
|
13
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
14
|
+
* JSDoc.
|
|
15
|
+
*/
|
|
16
|
+
export declare class WorkspaceClient extends BaseClient {
|
|
17
|
+
getWorkspaceInvitations(args: {
|
|
18
|
+
workspaceId: string;
|
|
19
|
+
}, requestId?: string): Promise<WorkspaceInvitationsResponse>;
|
|
20
|
+
getAllWorkspaceInvitations(args?: GetAllWorkspaceInvitationsArgs, requestId?: string): Promise<AllWorkspaceInvitationsResponse>;
|
|
21
|
+
deleteWorkspaceInvitation(args: DeleteWorkspaceInvitationArgs, requestId?: string): Promise<WorkspaceInvitation>;
|
|
22
|
+
acceptWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<WorkspaceInvitation>;
|
|
23
|
+
rejectWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<WorkspaceInvitation>;
|
|
24
|
+
joinWorkspace(args: JoinWorkspaceArgs, requestId?: string): Promise<JoinWorkspaceResult>;
|
|
25
|
+
uploadWorkspaceLogo(args: WorkspaceLogoArgs, requestId?: string): Promise<WorkspaceLogoResponse>;
|
|
26
|
+
getWorkspacePlanDetails(args: {
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
}, requestId?: string): Promise<WorkspacePlanDetails>;
|
|
29
|
+
getWorkspaceUsers(args?: GetWorkspaceUsersArgs, requestId?: string): Promise<GetWorkspaceUsersResponse>;
|
|
30
|
+
getWorkspaces(requestId?: string): Promise<Workspace[]>;
|
|
31
|
+
getWorkspace(id: string, requestId?: string): Promise<Workspace>;
|
|
32
|
+
addWorkspace(args: AddWorkspaceArgs, requestId?: string): Promise<Workspace>;
|
|
33
|
+
updateWorkspace(id: string, args: UpdateWorkspaceArgs, requestId?: string): Promise<Workspace>;
|
|
34
|
+
deleteWorkspace(id: string, requestId?: string): Promise<boolean>;
|
|
35
|
+
getWorkspaceMembersActivity(args: GetWorkspaceMembersActivityArgs, requestId?: string): Promise<GetWorkspaceMembersActivityResponse>;
|
|
36
|
+
getWorkspaceUserTasks(args: GetWorkspaceUserTasksArgs, requestId?: string): Promise<GetWorkspaceUserTasksResponse>;
|
|
37
|
+
inviteWorkspaceUsers(args: InviteWorkspaceUsersArgs, requestId?: string): Promise<InviteWorkspaceUsersResponse>;
|
|
38
|
+
updateWorkspaceUser(args: UpdateWorkspaceUserArgs, requestId?: string): Promise<JoinWorkspaceResult>;
|
|
39
|
+
removeWorkspaceUser(args: RemoveWorkspaceUserArgs, requestId?: string): Promise<boolean>;
|
|
40
|
+
getWorkspaceActiveProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
|
|
41
|
+
getWorkspaceArchivedProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export declare const TODOIST_WEB_URI = "https://app.todoist.com/app";
|
|
2
|
+
export declare const API_VERSION = "v1";
|
|
3
|
+
export declare const API_BASE_URI = "/api/v1/";
|
|
4
|
+
export declare function getSyncBaseUri(domainBase?: string): string;
|
|
5
|
+
export declare function getApiRootBaseUri(domainBase?: string): string;
|
|
6
|
+
export declare function getAuthBaseUri(domainBase?: string): string;
|
|
7
|
+
export declare const ENDPOINT_REST_TASKS = "tasks";
|
|
8
|
+
export declare const ENDPOINT_REST_TASKS_FILTER: string;
|
|
9
|
+
export declare const ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE: string;
|
|
10
|
+
export declare const ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE: string;
|
|
11
|
+
export declare const ENDPOINT_REST_TASKS_COMPLETED_SEARCH = "completed/search";
|
|
12
|
+
export declare const ENDPOINT_REST_SECTIONS = "sections";
|
|
13
|
+
export declare const ENDPOINT_REST_SECTIONS_SEARCH: string;
|
|
14
|
+
export declare const ENDPOINT_REST_LABELS = "labels";
|
|
15
|
+
export declare const ENDPOINT_REST_LABELS_SEARCH: string;
|
|
16
|
+
export declare const ENDPOINT_REST_LABELS_SHARED: string;
|
|
17
|
+
export declare const ENDPOINT_REST_LABELS_SHARED_RENAME: string;
|
|
18
|
+
export declare const ENDPOINT_REST_LABELS_SHARED_REMOVE: string;
|
|
19
|
+
export declare const ENDPOINT_REST_COMMENTS = "comments";
|
|
20
|
+
export declare const ENDPOINT_REST_REMINDERS = "reminders";
|
|
21
|
+
export declare const ENDPOINT_REST_LOCATION_REMINDERS = "location_reminders";
|
|
22
|
+
export declare const ENDPOINT_REST_TASK_CLOSE = "close";
|
|
23
|
+
export declare const ENDPOINT_REST_TASK_REOPEN = "reopen";
|
|
24
|
+
export declare const ENDPOINT_REST_TASK_MOVE = "move";
|
|
25
|
+
export declare const ENDPOINT_REST_PROJECTS = "projects";
|
|
26
|
+
export declare const ENDPOINT_REST_PROJECTS_SEARCH: string;
|
|
27
|
+
export declare const ENDPOINT_REST_PROJECTS_ARCHIVED: string;
|
|
28
|
+
export declare const ENDPOINT_REST_PROJECT_COLLABORATORS = "collaborators";
|
|
29
|
+
export declare const ENDPOINT_REST_USER = "user";
|
|
30
|
+
export declare const ENDPOINT_REST_PRODUCTIVITY: string;
|
|
31
|
+
export declare const ENDPOINT_REST_ACTIVITIES = "activities";
|
|
32
|
+
export declare const ENDPOINT_REST_UPLOADS = "uploads";
|
|
33
|
+
export declare const PROJECT_ARCHIVE = "archive";
|
|
34
|
+
export declare const PROJECT_UNARCHIVE = "unarchive";
|
|
35
|
+
export declare const ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT: string;
|
|
36
|
+
export declare const ENDPOINT_REST_PROJECTS_PERMISSIONS: string;
|
|
37
|
+
export declare const ENDPOINT_REST_PROJECT_FULL = "full";
|
|
38
|
+
export declare const ENDPOINT_REST_PROJECT_JOIN = "join";
|
|
39
|
+
export declare const SECTION_ARCHIVE = "archive";
|
|
40
|
+
export declare const SECTION_UNARCHIVE = "unarchive";
|
|
41
|
+
export declare const ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE: string;
|
|
42
|
+
export declare const ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL: string;
|
|
43
|
+
export declare const ENDPOINT_REST_TASKS_COMPLETED: string;
|
|
44
|
+
export declare const ENDPOINT_REST_TEMPLATES_FILE = "templates/file";
|
|
45
|
+
export declare const ENDPOINT_REST_TEMPLATES_URL = "templates/url";
|
|
46
|
+
export declare const ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE = "templates/create_project_from_file";
|
|
47
|
+
export declare const ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE = "templates/import_into_project_from_file";
|
|
48
|
+
export declare const ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID = "templates/import_into_project_from_template_id";
|
|
49
|
+
export declare const ENDPOINT_REST_ACCESS_TOKENS_MIGRATE = "access_tokens/migrate_personal_token";
|
|
50
|
+
export declare const ENDPOINT_REST_BACKUPS = "backups";
|
|
51
|
+
export declare const ENDPOINT_REST_BACKUPS_DOWNLOAD = "backups/download";
|
|
52
|
+
export declare const ENDPOINT_REST_EMAILS = "emails";
|
|
53
|
+
export declare const ENDPOINT_REST_ID_MAPPINGS = "id_mappings";
|
|
54
|
+
export declare const ENDPOINT_REST_MOVED_IDS = "moved_ids";
|
|
55
|
+
export declare const ENDPOINT_SYNC_QUICK_ADD: string;
|
|
56
|
+
export declare const ENDPOINT_SYNC = "sync";
|
|
57
|
+
export declare const ENDPOINT_AUTHORIZATION = "authorize";
|
|
58
|
+
export declare const ENDPOINT_GET_TOKEN = "access_token";
|
|
59
|
+
export declare const ENDPOINT_REVOKE = "revoke";
|
|
60
|
+
export declare const ENDPOINT_REGISTER = "register";
|
|
61
|
+
export declare const ENDPOINT_REST_FOLDERS = "folders";
|
|
62
|
+
export declare const ENDPOINT_REST_FILTERS = "filters";
|
|
63
|
+
export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
|
|
64
|
+
export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
|
|
65
|
+
export declare const ENDPOINT_WORKSPACE_INVITATIONS_ALL = "workspaces/invitations/all";
|
|
66
|
+
export declare const ENDPOINT_WORKSPACE_INVITATIONS_DELETE = "workspaces/invitations/delete";
|
|
67
|
+
export declare const ENDPOINT_WORKSPACE_JOIN = "workspaces/join";
|
|
68
|
+
export declare const ENDPOINT_WORKSPACE_LOGO = "workspaces/logo";
|
|
69
|
+
export declare const ENDPOINT_WORKSPACE_PLAN_DETAILS = "workspaces/plan_details";
|
|
70
|
+
export declare const ENDPOINT_WORKSPACE_USERS = "workspaces/users";
|
|
71
|
+
export declare const ENDPOINT_PAYMENTS_SUBSCRIPTION_INFO = "payments/get_subscription_info";
|
|
72
|
+
export declare const ENDPOINT_PAYMENTS_CANCEL_PLAN = "payments/cancel_plan_with_redirect_to_stripe";
|
|
73
|
+
export declare const ENDPOINT_PAYMENTS_REACTIVATE_PLAN = "payments/reactivate_plan";
|
|
74
|
+
export declare const ENDPOINT_PRO_UPGRADE = "pro/upgrade";
|
|
75
|
+
export declare const ENDPOINT_PRO_TRIAL = "pro/trial";
|
|
76
|
+
export declare const ENDPOINT_PRO_BILLING_PORTAL = "pro/billing_portal";
|
|
77
|
+
export declare const ENDPOINT_PRO_PLAN_DETAILS = "pro/plan_details";
|
|
78
|
+
export declare const ENDPOINT_WORKSPACE_UPGRADE = "workspaces/upgrade";
|
|
79
|
+
export declare const ENDPOINT_WORKSPACE_TRIAL = "workspaces/trial";
|
|
80
|
+
export declare const ENDPOINT_WORKSPACE_BILLING_PORTAL = "workspaces/billing_portal";
|
|
81
|
+
export declare const ENDPOINT_PRICES = "prices";
|
|
82
|
+
export declare const ENDPOINT_PRICING = "pricing";
|
|
83
|
+
export declare function getWorkspaceInvitationAcceptEndpoint(inviteCode: string): string;
|
|
84
|
+
export declare function getWorkspaceInvitationRejectEndpoint(inviteCode: string): string;
|
|
85
|
+
export declare function getProjectInsightsActivityStatsEndpoint(projectId: string): string;
|
|
86
|
+
export declare function getProjectInsightsHealthEndpoint(projectId: string): string;
|
|
87
|
+
export declare function getProjectInsightsHealthContextEndpoint(projectId: string): string;
|
|
88
|
+
export declare function getProjectInsightsProgressEndpoint(projectId: string): string;
|
|
89
|
+
export declare function getProjectInsightsHealthAnalyzeEndpoint(projectId: string): string;
|
|
90
|
+
export declare function getWorkspaceInsightsEndpoint(workspaceId: string): string;
|
|
91
|
+
export declare const ENDPOINT_WORKSPACE_MEMBERS = "workspaces/members";
|
|
92
|
+
export declare function getWorkspaceUserTasksEndpoint(workspaceId: string, userId: string): string;
|
|
93
|
+
export declare function getWorkspaceInviteUsersEndpoint(workspaceId: string): string;
|
|
94
|
+
export declare function getWorkspaceUserEndpoint(workspaceId: string, userId: string): string;
|
|
95
|
+
export declare function getWorkspaceActiveProjectsEndpoint(workspaceId: string): string;
|
|
96
|
+
export declare function getWorkspaceArchivedProjectsEndpoint(workspaceId: string): string;
|
|
97
|
+
export declare const ENDPOINT_REST_APPS = "apps";
|
|
98
|
+
export declare const ENDPOINT_REST_APPS_INSTALLATIONS = "apps/installations";
|
|
99
|
+
export declare const ENDPOINT_REST_APPS_UI_EXTENSIONS = "apps/ui_extensions";
|
|
100
|
+
export declare const ENDPOINT_REST_APPS_UI_EXTENSIONS_INSTALLED = "apps/ui_extensions/installed";
|
|
101
|
+
export declare const ENDPOINT_REST_USER_AUTHORIZATIONS = "user/authorizations";
|
|
102
|
+
export declare const ENDPOINT_REST_USER_AUTHORIZATIONS_DELETE = "user/authorizations/delete";
|
|
103
|
+
/** Available app icon sizes (small 60x60, medium 300x300, large 600x600). */
|
|
104
|
+
export declare const APP_ICON_SIZES: readonly ["small", "medium", "large"];
|
|
105
|
+
/** Size of an app icon. */
|
|
106
|
+
export type AppIconSize = (typeof APP_ICON_SIZES)[number];
|
|
107
|
+
export declare function getAppEndpoint(appId: string): string;
|
|
108
|
+
export declare function getAppSecretsEndpoint(appId: string): string;
|
|
109
|
+
export declare function getAppClientSecretEndpoint(appId: string): string;
|
|
110
|
+
export declare function getAppTokensEndpoint(appId: string): string;
|
|
111
|
+
export declare function getAppTestTokenEndpoint(appId: string): string;
|
|
112
|
+
export declare function getAppDistributionTokenEndpoint(appId: string): string;
|
|
113
|
+
export declare function getAppVerificationTokenEndpoint(appId: string): string;
|
|
114
|
+
export declare function getAppWebhookEndpoint(appId: string): string;
|
|
115
|
+
export declare function getAppIconEndpoint(appId: string, size: AppIconSize): string;
|
|
116
|
+
export declare function getAppInstallationEndpoint(installationId: string): string;
|
|
117
|
+
export declare function getAppByDistributionTokenEndpoint(distributionToken: string): string;
|
|
118
|
+
export declare function getUiExtensionEndpoint(uiExtensionId: string): string;
|
|
119
|
+
export declare function getUiExtensionIconEndpoint(uiExtensionId: string): string;
|
|
120
|
+
export declare function getUiExtensionsByIntegrationEndpoint(integrationId: string): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './todoist-api.js';
|
|
2
|
+
export * from './authentication.js';
|
|
3
|
+
export * from './types/index.js';
|
|
4
|
+
export * from './utils/index.js';
|
|
5
|
+
export { getDefaultDispatcher, getDefaultTransport } from './transport/http-dispatcher.js';
|
|
6
|
+
export type { DefaultTransport } from './transport/http-dispatcher.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertInstance<T extends new (...args: any) => any>(value: unknown, type: T): asserts value is InstanceType<T>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { http, HttpResponse, type DefaultBodyType } from 'msw';
|
|
2
|
+
export type MockApiOptions = {
|
|
3
|
+
status?: number;
|
|
4
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
export type CapturedRequest = {
|
|
8
|
+
url: string;
|
|
9
|
+
method: string;
|
|
10
|
+
headers: Record<string, string>;
|
|
11
|
+
body: unknown;
|
|
12
|
+
};
|
|
13
|
+
export declare function captureRequest({ request, body }: {
|
|
14
|
+
request: Request;
|
|
15
|
+
body: unknown;
|
|
16
|
+
}): void;
|
|
17
|
+
export declare function getLastRequest(): CapturedRequest | undefined;
|
|
18
|
+
export declare function getAllRequests(): CapturedRequest[];
|
|
19
|
+
export declare function clearCapturedRequests(): void;
|
|
20
|
+
export declare const handlers: never[];
|
|
21
|
+
export declare const server: import("msw/node").SetupServer;
|
|
22
|
+
export declare function mockApiResponse<T extends DefaultBodyType>({ endpoint, data, options, }: {
|
|
23
|
+
endpoint: string;
|
|
24
|
+
data: T;
|
|
25
|
+
options?: MockApiOptions;
|
|
26
|
+
}): void;
|
|
27
|
+
export declare function mockApiError<T extends DefaultBodyType>({ endpoint, data, status, options, }: {
|
|
28
|
+
endpoint: string;
|
|
29
|
+
data: T;
|
|
30
|
+
status: number;
|
|
31
|
+
options?: Omit<MockApiOptions, 'status'>;
|
|
32
|
+
}): void;
|
|
33
|
+
export { http, HttpResponse };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RequestUrlParam, RequestUrlResponse } from 'obsidian';
|
|
2
|
+
import type { CustomFetch } from '../types/http.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a CustomFetch adapter for Obsidian's requestUrl API.
|
|
5
|
+
*
|
|
6
|
+
* This adapter bridges the gap between Obsidian's requestUrl interface and the
|
|
7
|
+
* standard fetch-like interface expected by the Todoist API SDK.
|
|
8
|
+
*
|
|
9
|
+
* Key differences handled by this adapter:
|
|
10
|
+
* - Obsidian returns response data as properties (response.json, response.text)
|
|
11
|
+
* while the SDK expects methods (response.json(), response.text())
|
|
12
|
+
* - Obsidian's requestUrl bypasses CORS restrictions that would block standard fetch
|
|
13
|
+
* - Obsidian throws on HTTP errors by default; we set throw: false to handle manually
|
|
14
|
+
* - Obsidian doesn't provide statusText; we default to empty string
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { requestUrl } from 'obsidian';
|
|
19
|
+
* import { createObsidianFetchAdapter } from './obsidian-fetch-adapter.js';
|
|
20
|
+
*
|
|
21
|
+
* const api = new TodoistApi('your-token', {
|
|
22
|
+
* customFetch: createObsidianFetchAdapter(requestUrl)
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param requestUrl - The Obsidian requestUrl function
|
|
27
|
+
* @returns A CustomFetch function compatible with the Todoist API SDK
|
|
28
|
+
*/
|
|
29
|
+
export declare function createObsidianFetchAdapter(requestUrl: (request: RequestUrlParam | string) => Promise<RequestUrlResponse>): CustomFetch;
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder, App, AppWithUserCount, AppSecrets, AppVerificationToken, AppTestToken, AppDistributionToken, AppWebhook, AppInstallation, UserAuthorization, UiExtension } from '../types/index.js';
|
|
2
|
+
import type { Collaborator, CollaboratorState } from '../types/sync/resources/collaborators.js';
|
|
3
|
+
import type { Note } from '../types/sync/resources/notes.js';
|
|
4
|
+
export declare const DEFAULT_TASK_ID = "1234";
|
|
5
|
+
export declare const DEFAULT_TASK_CONTENT = "This is a task";
|
|
6
|
+
export declare const DEFAULT_TASK_DESCRIPTION = "A description";
|
|
7
|
+
export declare const DEFAULT_TASK_PRIORITY = 1;
|
|
8
|
+
export declare const DEFAULT_ORDER = 3;
|
|
9
|
+
export declare const DEFAULT_PROJECT_ID = "123";
|
|
10
|
+
export declare const DEFAULT_PROJECT_NAME = "This is a project";
|
|
11
|
+
export declare const DEFAULT_PROJECT_VIEW_STYLE = "list";
|
|
12
|
+
export declare const DEFAULT_AUTH_TOKEN = "AToken";
|
|
13
|
+
export declare const DEFAULT_REQUEST_ID = "ARequestID";
|
|
14
|
+
export declare const INVALID_ENTITY_ID = 1234;
|
|
15
|
+
export declare const DEFAULT_DUE_DATE: {
|
|
16
|
+
isRecurring: boolean;
|
|
17
|
+
string: string;
|
|
18
|
+
date: string;
|
|
19
|
+
lang: string;
|
|
20
|
+
timezone: null;
|
|
21
|
+
};
|
|
22
|
+
export declare const DEFAULT_DURATION: Duration;
|
|
23
|
+
export declare const DEFAULT_DEADLINE: Deadline;
|
|
24
|
+
export declare const DEFAULT_TASK: Task;
|
|
25
|
+
export declare const INVALID_TASK: {
|
|
26
|
+
due: string;
|
|
27
|
+
isUncompletable: boolean;
|
|
28
|
+
url: string;
|
|
29
|
+
id: string;
|
|
30
|
+
userId: string;
|
|
31
|
+
projectId: string;
|
|
32
|
+
sectionId: string | null;
|
|
33
|
+
parentId: string | null;
|
|
34
|
+
addedByUid: string | null;
|
|
35
|
+
assignedByUid: string | null;
|
|
36
|
+
responsibleUid: string | null;
|
|
37
|
+
labels: string[];
|
|
38
|
+
deadline: {
|
|
39
|
+
date: string;
|
|
40
|
+
lang: string;
|
|
41
|
+
} | null;
|
|
42
|
+
duration: {
|
|
43
|
+
amount: number;
|
|
44
|
+
unit: "minute" | "day";
|
|
45
|
+
} | null;
|
|
46
|
+
checked: boolean;
|
|
47
|
+
isDeleted: boolean;
|
|
48
|
+
addedAt: Date | null;
|
|
49
|
+
completedAt: Date | null;
|
|
50
|
+
updatedAt: Date | null;
|
|
51
|
+
priority: number;
|
|
52
|
+
childOrder: number;
|
|
53
|
+
content: string;
|
|
54
|
+
description: string;
|
|
55
|
+
dayOrder: number;
|
|
56
|
+
isCollapsed: boolean;
|
|
57
|
+
};
|
|
58
|
+
export declare const TASK_WITH_OPTIONALS_AS_NULL: Task;
|
|
59
|
+
export declare const DEFAULT_PROJECT: PersonalProject;
|
|
60
|
+
export declare const INVALID_PROJECT: {
|
|
61
|
+
name: number;
|
|
62
|
+
url: string;
|
|
63
|
+
id: string;
|
|
64
|
+
canAssignTasks: boolean;
|
|
65
|
+
childOrder: number;
|
|
66
|
+
color: string;
|
|
67
|
+
createdAt: Date | null;
|
|
68
|
+
isArchived: boolean;
|
|
69
|
+
isDeleted: boolean;
|
|
70
|
+
isFavorite: boolean;
|
|
71
|
+
isFrozen: boolean;
|
|
72
|
+
updatedAt: Date | null;
|
|
73
|
+
viewStyle: string;
|
|
74
|
+
defaultOrder: number;
|
|
75
|
+
description: string;
|
|
76
|
+
isCollapsed: boolean;
|
|
77
|
+
isShared: boolean;
|
|
78
|
+
parentId: string | null;
|
|
79
|
+
inboxProject: boolean;
|
|
80
|
+
orderKey?: string | null | undefined;
|
|
81
|
+
defaultOrderKey?: string | null | undefined;
|
|
82
|
+
};
|
|
83
|
+
export declare const PROJECT_WITH_OPTIONALS_AS_NULL: PersonalProject;
|
|
84
|
+
export declare const DEFAULT_WORKSPACE_PROJECT: WorkspaceProject;
|
|
85
|
+
export declare const DEFAULT_SECTION: Section;
|
|
86
|
+
export declare const INVALID_SECTION: {
|
|
87
|
+
projectId: undefined;
|
|
88
|
+
url: string;
|
|
89
|
+
id: string;
|
|
90
|
+
userId: string;
|
|
91
|
+
addedAt: Date;
|
|
92
|
+
updatedAt: Date;
|
|
93
|
+
archivedAt: Date | null;
|
|
94
|
+
name: string;
|
|
95
|
+
description: string | null;
|
|
96
|
+
sectionOrder: number;
|
|
97
|
+
isArchived: boolean;
|
|
98
|
+
isDeleted: boolean;
|
|
99
|
+
isCollapsed: boolean;
|
|
100
|
+
orderKey?: string | null | undefined;
|
|
101
|
+
};
|
|
102
|
+
export declare const DEFAULT_LABEL: Label;
|
|
103
|
+
export declare const INVALID_LABEL: {
|
|
104
|
+
isFavorite: string;
|
|
105
|
+
id: string;
|
|
106
|
+
order: number | null;
|
|
107
|
+
name: string;
|
|
108
|
+
color: string;
|
|
109
|
+
};
|
|
110
|
+
export declare const DEFAULT_USER: User;
|
|
111
|
+
export declare const INVALID_USER: {
|
|
112
|
+
email: undefined;
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
116
|
+
export declare const DEFAULT_ATTACHMENT: Attachment;
|
|
117
|
+
export declare const INVALID_ATTACHMENT: {
|
|
118
|
+
uploadState: string;
|
|
119
|
+
resourceType: string;
|
|
120
|
+
fileName?: string | null | undefined;
|
|
121
|
+
fileSize?: number | null | undefined;
|
|
122
|
+
fileType?: string | null | undefined;
|
|
123
|
+
fileUrl?: string | null | undefined;
|
|
124
|
+
fileDuration?: number | null | undefined;
|
|
125
|
+
image?: string | null | undefined;
|
|
126
|
+
imageWidth?: number | null | undefined;
|
|
127
|
+
imageHeight?: number | null | undefined;
|
|
128
|
+
url?: string | null | undefined;
|
|
129
|
+
title?: string | null | undefined;
|
|
130
|
+
};
|
|
131
|
+
export declare const DEFAULT_RAW_COMMENT: RawComment;
|
|
132
|
+
export declare const DEFAULT_COMMENT: {
|
|
133
|
+
taskId: string | undefined;
|
|
134
|
+
itemId: undefined;
|
|
135
|
+
id: string;
|
|
136
|
+
content: string;
|
|
137
|
+
postedAt: Date;
|
|
138
|
+
fileAttachment: {
|
|
139
|
+
resourceType: string;
|
|
140
|
+
fileName?: string | null | undefined;
|
|
141
|
+
fileSize?: number | null | undefined;
|
|
142
|
+
fileType?: string | null | undefined;
|
|
143
|
+
fileUrl?: string | null | undefined;
|
|
144
|
+
fileDuration?: number | null | undefined;
|
|
145
|
+
uploadState?: "pending" | "completed" | null | undefined;
|
|
146
|
+
image?: string | null | undefined;
|
|
147
|
+
imageWidth?: number | null | undefined;
|
|
148
|
+
imageHeight?: number | null | undefined;
|
|
149
|
+
url?: string | null | undefined;
|
|
150
|
+
title?: string | null | undefined;
|
|
151
|
+
} | null;
|
|
152
|
+
postedUid: string;
|
|
153
|
+
uidsToNotify: string[] | null;
|
|
154
|
+
reactions: Record<string, string[]> | null;
|
|
155
|
+
isDeleted: boolean;
|
|
156
|
+
projectId?: string | undefined;
|
|
157
|
+
};
|
|
158
|
+
export declare const DEFAULT_REMINDER_ID = "6XGgmFQrx44wfGHr";
|
|
159
|
+
export declare const DEFAULT_RELATIVE_REMINDER: Reminder;
|
|
160
|
+
export declare const DEFAULT_ABSOLUTE_REMINDER: Reminder;
|
|
161
|
+
export declare const DEFAULT_LOCATION_REMINDER: Reminder;
|
|
162
|
+
export declare const INVALID_COMMENT: {
|
|
163
|
+
isDeleted: string;
|
|
164
|
+
id: string;
|
|
165
|
+
content: string;
|
|
166
|
+
postedAt: Date;
|
|
167
|
+
fileAttachment: {
|
|
168
|
+
resourceType: string;
|
|
169
|
+
fileName?: string | null | undefined;
|
|
170
|
+
fileSize?: number | null | undefined;
|
|
171
|
+
fileType?: string | null | undefined;
|
|
172
|
+
fileUrl?: string | null | undefined;
|
|
173
|
+
fileDuration?: number | null | undefined;
|
|
174
|
+
uploadState?: "pending" | "completed" | null | undefined;
|
|
175
|
+
image?: string | null | undefined;
|
|
176
|
+
imageWidth?: number | null | undefined;
|
|
177
|
+
imageHeight?: number | null | undefined;
|
|
178
|
+
url?: string | null | undefined;
|
|
179
|
+
title?: string | null | undefined;
|
|
180
|
+
} | null;
|
|
181
|
+
postedUid: string;
|
|
182
|
+
uidsToNotify: string[] | null;
|
|
183
|
+
reactions: Record<string, string[]> | null;
|
|
184
|
+
itemId?: string | undefined;
|
|
185
|
+
projectId?: string | undefined;
|
|
186
|
+
};
|
|
187
|
+
export declare const RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK: RawComment;
|
|
188
|
+
export declare const COMMENT_WITH_OPTIONALS_AS_NULL_TASK: {
|
|
189
|
+
taskId: string | undefined;
|
|
190
|
+
itemId: undefined;
|
|
191
|
+
id: string;
|
|
192
|
+
content: string;
|
|
193
|
+
postedAt: Date;
|
|
194
|
+
fileAttachment: {
|
|
195
|
+
resourceType: string;
|
|
196
|
+
fileName?: string | null | undefined;
|
|
197
|
+
fileSize?: number | null | undefined;
|
|
198
|
+
fileType?: string | null | undefined;
|
|
199
|
+
fileUrl?: string | null | undefined;
|
|
200
|
+
fileDuration?: number | null | undefined;
|
|
201
|
+
uploadState?: "pending" | "completed" | null | undefined;
|
|
202
|
+
image?: string | null | undefined;
|
|
203
|
+
imageWidth?: number | null | undefined;
|
|
204
|
+
imageHeight?: number | null | undefined;
|
|
205
|
+
url?: string | null | undefined;
|
|
206
|
+
title?: string | null | undefined;
|
|
207
|
+
} | null;
|
|
208
|
+
postedUid: string;
|
|
209
|
+
uidsToNotify: string[] | null;
|
|
210
|
+
reactions: Record<string, string[]> | null;
|
|
211
|
+
isDeleted: boolean;
|
|
212
|
+
projectId?: string | undefined;
|
|
213
|
+
};
|
|
214
|
+
export declare const RAW_COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL: RawComment;
|
|
215
|
+
export declare const COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL: {
|
|
216
|
+
taskId: string | undefined;
|
|
217
|
+
itemId: undefined;
|
|
218
|
+
id: string;
|
|
219
|
+
content: string;
|
|
220
|
+
postedAt: Date;
|
|
221
|
+
fileAttachment: {
|
|
222
|
+
resourceType: string;
|
|
223
|
+
fileName?: string | null | undefined;
|
|
224
|
+
fileSize?: number | null | undefined;
|
|
225
|
+
fileType?: string | null | undefined;
|
|
226
|
+
fileUrl?: string | null | undefined;
|
|
227
|
+
fileDuration?: number | null | undefined;
|
|
228
|
+
uploadState?: "pending" | "completed" | null | undefined;
|
|
229
|
+
image?: string | null | undefined;
|
|
230
|
+
imageWidth?: number | null | undefined;
|
|
231
|
+
imageHeight?: number | null | undefined;
|
|
232
|
+
url?: string | null | undefined;
|
|
233
|
+
title?: string | null | undefined;
|
|
234
|
+
} | null;
|
|
235
|
+
postedUid: string;
|
|
236
|
+
uidsToNotify: string[] | null;
|
|
237
|
+
reactions: Record<string, string[]> | null;
|
|
238
|
+
isDeleted: boolean;
|
|
239
|
+
projectId?: string | undefined;
|
|
240
|
+
};
|
|
241
|
+
export declare const RAW_COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT: RawComment;
|
|
242
|
+
export declare const COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT: {
|
|
243
|
+
taskId: undefined;
|
|
244
|
+
id: string;
|
|
245
|
+
content: string;
|
|
246
|
+
postedAt: Date;
|
|
247
|
+
fileAttachment: {
|
|
248
|
+
resourceType: string;
|
|
249
|
+
fileName?: string | null | undefined;
|
|
250
|
+
fileSize?: number | null | undefined;
|
|
251
|
+
fileType?: string | null | undefined;
|
|
252
|
+
fileUrl?: string | null | undefined;
|
|
253
|
+
fileDuration?: number | null | undefined;
|
|
254
|
+
uploadState?: "pending" | "completed" | null | undefined;
|
|
255
|
+
image?: string | null | undefined;
|
|
256
|
+
imageWidth?: number | null | undefined;
|
|
257
|
+
imageHeight?: number | null | undefined;
|
|
258
|
+
url?: string | null | undefined;
|
|
259
|
+
title?: string | null | undefined;
|
|
260
|
+
} | null;
|
|
261
|
+
postedUid: string;
|
|
262
|
+
uidsToNotify: string[] | null;
|
|
263
|
+
reactions: Record<string, string[]> | null;
|
|
264
|
+
isDeleted: boolean;
|
|
265
|
+
itemId?: string | undefined;
|
|
266
|
+
projectId?: string | undefined;
|
|
267
|
+
};
|
|
268
|
+
export declare const DEFAULT_FOLDER: Folder;
|
|
269
|
+
export declare const DEFAULT_COLLABORATOR: Collaborator;
|
|
270
|
+
export declare const DEFAULT_COLLABORATOR_STATE: CollaboratorState;
|
|
271
|
+
export declare const DEFAULT_APP_ID = "42";
|
|
272
|
+
export declare const DEFAULT_INSTALLATION_ID = "1001";
|
|
273
|
+
export declare const DEFAULT_UI_EXTENSION_ID = "2002";
|
|
274
|
+
export declare const DEFAULT_DISTRIBUTION_TOKEN = "dist-token-abc";
|
|
275
|
+
export declare const DEFAULT_ACCESS_TOKEN_ID = "3003";
|
|
276
|
+
export declare const DEFAULT_APP: App;
|
|
277
|
+
export declare const DEFAULT_APP_WITH_USER_COUNT: AppWithUserCount;
|
|
278
|
+
export declare const DEFAULT_APP_SECRETS: AppSecrets;
|
|
279
|
+
export declare const DEFAULT_APP_VERIFICATION_TOKEN: AppVerificationToken;
|
|
280
|
+
export declare const DEFAULT_APP_TEST_TOKEN: AppTestToken;
|
|
281
|
+
export declare const DEFAULT_APP_DISTRIBUTION_TOKEN: AppDistributionToken;
|
|
282
|
+
export declare const DEFAULT_APP_WEBHOOK: AppWebhook;
|
|
283
|
+
export declare const DEFAULT_APP_INSTALLATION: AppInstallation;
|
|
284
|
+
export declare const DEFAULT_USER_AUTHORIZATION: UserAuthorization;
|
|
285
|
+
export declare const DEFAULT_UI_EXTENSION: UiExtension;
|
|
286
|
+
export declare const DEFAULT_NOTE: Note;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const CLIENT_SECRET = "test-client-secret";
|
|
2
|
+
/** HMAC-SHA256 signs a raw body with the test client secret (or an override). */
|
|
3
|
+
export declare function sign(body: string, secret?: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* Snake_case task payload matching the v1 webhook wire shape.
|
|
6
|
+
*/
|
|
7
|
+
export declare function rawTask(overrides?: Record<string, unknown>): Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Wraps an event's `event_data` in the snake_case envelope the backend sends
|
|
10
|
+
* (initiator, version, timestamps, etc). `extra` passes extra top-level keys
|
|
11
|
+
* like `event_data_extra`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function envelope(event: string, eventData: unknown, extra?: Record<string, unknown>): Record<string, unknown>;
|