@doist/todoist-sdk 0.0.1 → 8.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 +194 -29
- package/dist/cjs/authentication.js +204 -0
- package/dist/cjs/consts/endpoints.js +141 -0
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/test-utils/asserts.js +11 -0
- package/dist/cjs/test-utils/msw-setup.js +97 -0
- package/dist/cjs/test-utils/obsidian-fetch-adapter.js +53 -0
- package/dist/cjs/test-utils/test-defaults.js +240 -0
- package/dist/cjs/todoist-api.js +2623 -0
- package/dist/cjs/transport/fetch-with-retry.js +206 -0
- package/dist/cjs/transport/http-client.js +133 -0
- package/dist/cjs/transport/http-dispatcher.js +72 -0
- package/dist/cjs/types/activity/index.js +18 -0
- package/dist/cjs/types/activity/requests.js +2 -0
- package/dist/cjs/types/activity/types.js +28 -0
- package/dist/cjs/types/backups/index.js +18 -0
- package/dist/cjs/types/backups/requests.js +2 -0
- package/dist/cjs/types/backups/types.js +8 -0
- package/dist/cjs/types/comments/index.js +18 -0
- package/dist/cjs/types/comments/requests.js +2 -0
- package/dist/cjs/types/comments/types.js +60 -0
- package/dist/cjs/types/common.js +10 -0
- package/dist/cjs/types/emails/index.js +17 -0
- package/dist/cjs/types/emails/requests.js +5 -0
- package/dist/cjs/types/errors.js +29 -0
- package/dist/cjs/types/folders/index.js +17 -0
- package/dist/cjs/types/folders/requests.js +2 -0
- package/dist/cjs/types/http.js +24 -0
- package/dist/cjs/types/id-mappings/index.js +18 -0
- package/dist/cjs/types/id-mappings/requests.js +20 -0
- package/dist/cjs/types/id-mappings/types.js +12 -0
- package/dist/cjs/types/index.js +36 -0
- package/dist/cjs/types/insights/index.js +18 -0
- package/dist/cjs/types/insights/requests.js +2 -0
- package/dist/cjs/types/insights/types.js +84 -0
- package/dist/cjs/types/labels/index.js +18 -0
- package/dist/cjs/types/labels/requests.js +2 -0
- package/dist/cjs/types/labels/types.js +11 -0
- package/dist/cjs/types/productivity/index.js +17 -0
- package/dist/cjs/types/productivity/types.js +67 -0
- package/dist/cjs/types/projects/index.js +18 -0
- package/dist/cjs/types/projects/requests.js +2 -0
- package/dist/cjs/types/projects/types.js +56 -0
- package/dist/cjs/types/reminders/index.js +17 -0
- package/dist/cjs/types/reminders/requests.js +95 -0
- package/dist/cjs/types/sections/index.js +18 -0
- package/dist/cjs/types/sections/requests.js +2 -0
- package/dist/cjs/types/sections/types.js +22 -0
- package/dist/cjs/types/sync/commands/calendars.js +2 -0
- package/dist/cjs/types/sync/commands/filters.js +2 -0
- package/dist/cjs/types/sync/commands/folders.js +2 -0
- package/dist/cjs/types/sync/commands/index.js +35 -0
- package/dist/cjs/types/sync/commands/labels.js +5 -0
- package/dist/cjs/types/sync/commands/notes.js +2 -0
- package/dist/cjs/types/sync/commands/notifications.js +2 -0
- package/dist/cjs/types/sync/commands/others.js +2 -0
- package/dist/cjs/types/sync/commands/project-view-options.js +2 -0
- package/dist/cjs/types/sync/commands/projects.js +2 -0
- package/dist/cjs/types/sync/commands/reminders.js +2 -0
- package/dist/cjs/types/sync/commands/sections.js +2 -0
- package/dist/cjs/types/sync/commands/shared.js +20 -0
- package/dist/cjs/types/sync/commands/sharing.js +2 -0
- package/dist/cjs/types/sync/commands/tasks.js +2 -0
- package/dist/cjs/types/sync/commands/view-options.js +2 -0
- package/dist/cjs/types/sync/commands/workspace-filters.js +2 -0
- package/dist/cjs/types/sync/commands/workspace-goals.js +2 -0
- package/dist/cjs/types/sync/commands/workspaces.js +2 -0
- package/dist/cjs/types/sync/index.js +22 -0
- package/dist/cjs/types/sync/request.js +2 -0
- package/dist/cjs/types/sync/resource-types.js +40 -0
- package/dist/cjs/types/sync/resources/calendars.js +31 -0
- package/dist/cjs/types/sync/resources/collaborators.js +25 -0
- package/dist/cjs/types/sync/resources/completed-info.js +30 -0
- package/dist/cjs/types/sync/resources/filters.js +16 -0
- package/dist/cjs/types/sync/resources/folders.js +14 -0
- package/dist/cjs/types/sync/resources/index.js +33 -0
- package/dist/cjs/types/sync/resources/live-notifications.js +39 -0
- package/dist/cjs/types/sync/resources/notes.js +23 -0
- package/dist/cjs/types/sync/resources/reminders.js +50 -0
- package/dist/cjs/types/sync/resources/suggestions.js +42 -0
- package/dist/cjs/types/sync/resources/tooltips.js +10 -0
- package/dist/cjs/types/sync/resources/user-plan-limits.js +24 -0
- package/dist/cjs/types/sync/resources/user-settings.js +42 -0
- package/dist/cjs/types/sync/resources/user.js +120 -0
- package/dist/cjs/types/sync/resources/view-options.js +83 -0
- package/dist/cjs/types/sync/resources/workspace-filters.js +21 -0
- package/dist/cjs/types/sync/resources/workspace-goals.js +32 -0
- package/dist/cjs/types/sync/resources/workspaces.js +73 -0
- package/dist/cjs/types/sync/response.js +2 -0
- package/dist/cjs/types/sync/user-preferences.js +71 -0
- package/dist/cjs/types/tasks/index.js +18 -0
- package/dist/cjs/types/tasks/requests.js +2 -0
- package/dist/cjs/types/tasks/types.js +59 -0
- package/dist/cjs/types/templates/index.js +17 -0
- package/dist/cjs/types/templates/requests.js +2 -0
- package/dist/cjs/types/uploads/index.js +17 -0
- package/dist/cjs/types/uploads/requests.js +2 -0
- package/dist/cjs/types/users/index.js +17 -0
- package/dist/cjs/types/users/types.js +51 -0
- package/dist/cjs/types/workspaces/index.js +18 -0
- package/dist/cjs/types/workspaces/requests.js +2 -0
- package/dist/cjs/types/workspaces/types.js +155 -0
- package/dist/cjs/utils/activity-helpers.js +58 -0
- package/dist/cjs/utils/case-conversion.js +69 -0
- package/dist/cjs/utils/colors.js +143 -0
- package/dist/cjs/utils/index.js +25 -0
- package/dist/cjs/utils/multipart-upload.js +178 -0
- package/dist/cjs/utils/processing-helpers.js +18 -0
- package/dist/cjs/utils/sanitization.js +116 -0
- package/dist/cjs/utils/sync-helpers.js +22 -0
- package/dist/cjs/utils/uncompletable-helpers.js +60 -0
- package/dist/cjs/utils/url-helpers.js +74 -0
- package/dist/cjs/utils/validators.js +141 -0
- package/dist/esm/authentication.js +196 -0
- package/dist/esm/consts/endpoints.js +122 -0
- package/dist/esm/index.js +4 -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 +50 -0
- package/dist/esm/test-utils/test-defaults.js +237 -0
- package/dist/esm/todoist-api.js +2619 -0
- package/dist/esm/transport/fetch-with-retry.js +203 -0
- package/dist/esm/transport/http-client.js +128 -0
- package/dist/esm/transport/http-dispatcher.js +35 -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 +25 -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/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 +24 -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 +20 -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 +81 -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 +64 -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 +53 -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 +19 -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 +19 -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/workspace-goals.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 +37 -0
- package/dist/esm/types/sync/resources/calendars.js +28 -0
- package/dist/esm/types/sync/resources/collaborators.js +22 -0
- package/dist/esm/types/sync/resources/completed-info.js +27 -0
- package/dist/esm/types/sync/resources/filters.js +13 -0
- package/dist/esm/types/sync/resources/folders.js +11 -0
- package/dist/esm/types/sync/resources/index.js +17 -0
- package/dist/esm/types/sync/resources/live-notifications.js +36 -0
- package/dist/esm/types/sync/resources/notes.js +20 -0
- package/dist/esm/types/sync/resources/reminders.js +47 -0
- package/dist/esm/types/sync/resources/suggestions.js +39 -0
- package/dist/esm/types/sync/resources/tooltips.js +7 -0
- package/dist/esm/types/sync/resources/user-plan-limits.js +21 -0
- package/dist/esm/types/sync/resources/user-settings.js +39 -0
- package/dist/esm/types/sync/resources/user.js +117 -0
- package/dist/esm/types/sync/resources/view-options.js +80 -0
- package/dist/esm/types/sync/resources/workspace-filters.js +18 -0
- package/dist/esm/types/sync/resources/workspace-goals.js +29 -0
- package/dist/esm/types/sync/resources/workspaces.js +70 -0
- package/dist/esm/types/sync/response.js +1 -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/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 +48 -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 +152 -0
- package/dist/esm/utils/activity-helpers.js +53 -0
- package/dist/esm/utils/case-conversion.js +61 -0
- package/dist/esm/utils/colors.js +139 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/multipart-upload.js +142 -0
- package/dist/esm/utils/processing-helpers.js +12 -0
- package/dist/esm/utils/sanitization.js +112 -0
- package/dist/esm/utils/sync-helpers.js +19 -0
- package/dist/esm/utils/uncompletable-helpers.js +54 -0
- package/dist/esm/utils/url-helpers.js +68 -0
- package/dist/esm/utils/validators.js +132 -0
- package/dist/types/authentication.d.ts +158 -0
- package/dist/types/consts/endpoints.d.ts +81 -0
- package/dist/types/index.d.ts +4 -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 +261 -0
- package/dist/types/todoist-api.d.ts +1018 -0
- package/dist/types/transport/fetch-with-retry.d.ts +12 -0
- package/dist/types/transport/http-client.d.ts +16 -0
- package/dist/types/transport/http-dispatcher.d.ts +3 -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 +49 -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/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 +12 -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 +85 -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 +20 -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 +186 -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 +169 -0
- package/dist/types/types/projects/types.d.ts +201 -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 +41 -0
- package/dist/types/types/sections/types.d.ts +44 -0
- package/dist/types/types/sync/commands/calendars.d.ts +14 -0
- package/dist/types/types/sync/commands/filters.d.ts +22 -0
- package/dist/types/types/sync/commands/folders.d.ts +18 -0
- package/dist/types/types/sync/commands/index.d.ts +171 -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 +39 -0
- package/dist/types/types/sync/commands/project-view-options.d.ts +14 -0
- package/dist/types/types/sync/commands/projects.d.ts +90 -0
- package/dist/types/types/sync/commands/reminders.d.ts +51 -0
- package/dist/types/types/sync/commands/sections.d.ts +31 -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 +15 -0
- package/dist/types/types/sync/commands/workspace-filters.d.ts +23 -0
- package/dist/types/types/sync/commands/workspace-goals.d.ts +24 -0
- package/dist/types/types/sync/commands/workspaces.d.ts +79 -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 +28 -0
- package/dist/types/types/sync/resources/completed-info.d.ts +33 -0
- package/dist/types/types/sync/resources/filters.d.ts +12 -0
- package/dist/types/types/sync/resources/folders.d.ts +10 -0
- package/dist/types/types/sync/resources/index.d.ts +17 -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 +126 -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 +41 -0
- package/dist/types/types/sync/resources/user-settings.d.ts +40 -0
- package/dist/types/types/sync/resources/user.d.ts +134 -0
- package/dist/types/types/sync/resources/view-options.d.ts +169 -0
- package/dist/types/types/sync/resources/workspace-filters.d.ts +17 -0
- package/dist/types/types/sync/resources/workspace-goals.d.ts +29 -0
- package/dist/types/types/sync/resources/workspaces.d.ts +142 -0
- package/dist/types/types/sync/response.d.ts +51 -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/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 +66 -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 +267 -0
- package/dist/types/utils/activity-helpers.d.ts +28 -0
- package/dist/types/utils/case-conversion.d.ts +12 -0
- package/dist/types/utils/colors.d.ts +197 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/dist/types/utils/multipart-upload.d.ts +54 -0
- package/dist/types/utils/processing-helpers.d.ts +1 -0
- package/dist/types/utils/sanitization.d.ts +35 -0
- package/dist/types/utils/sync-helpers.d.ts +17 -0
- package/dist/types/utils/uncompletable-helpers.d.ts +30 -0
- package/dist/types/utils/url-helpers.d.ts +32 -0
- package/dist/types/utils/validators.d.ts +1404 -0
- package/package.json +99 -8
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNetworkError = isNetworkError;
|
|
4
|
+
exports.isHttpError = isHttpError;
|
|
5
|
+
/**
|
|
6
|
+
* Type guard to check if an error is a network error
|
|
7
|
+
*/
|
|
8
|
+
function isNetworkError(error) {
|
|
9
|
+
// Network errors in fetch are typically TypeError with specific messages.
|
|
10
|
+
// Timeout errors are created by fetch-with-retry with the TimeoutError name.
|
|
11
|
+
return ((error instanceof TypeError &&
|
|
12
|
+
(error.message.includes('fetch') ||
|
|
13
|
+
error.message.includes('network') ||
|
|
14
|
+
error.message.includes('Failed to fetch') ||
|
|
15
|
+
error.message.includes('NetworkError'))) ||
|
|
16
|
+
error.name === 'TimeoutError' ||
|
|
17
|
+
error.isNetworkError === true);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Type guard to check if an error is an HTTP error
|
|
21
|
+
*/
|
|
22
|
+
function isHttpError(error) {
|
|
23
|
+
return 'status' in error && typeof error.status === 'number';
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MOVED_ID_OBJECT_TYPES = exports.ID_MAPPING_OBJECT_TYPES = void 0;
|
|
4
|
+
/** Object types that support ID mappings. */
|
|
5
|
+
exports.ID_MAPPING_OBJECT_TYPES = [
|
|
6
|
+
'sections',
|
|
7
|
+
'tasks',
|
|
8
|
+
'comments',
|
|
9
|
+
'reminders',
|
|
10
|
+
'location_reminders',
|
|
11
|
+
'projects',
|
|
12
|
+
];
|
|
13
|
+
/** Object types that support moved ID lookups. */
|
|
14
|
+
exports.MOVED_ID_OBJECT_TYPES = [
|
|
15
|
+
'sections',
|
|
16
|
+
'tasks',
|
|
17
|
+
'comments',
|
|
18
|
+
'reminders',
|
|
19
|
+
'location_reminders',
|
|
20
|
+
];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MovedIdSchema = exports.IdMappingSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.IdMappingSchema = zod_1.z.object({
|
|
6
|
+
oldId: zod_1.z.string().nullable(),
|
|
7
|
+
newId: zod_1.z.string().nullable(),
|
|
8
|
+
});
|
|
9
|
+
exports.MovedIdSchema = zod_1.z.object({
|
|
10
|
+
oldId: zod_1.z.string(),
|
|
11
|
+
newId: zod_1.z.string(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./tasks"), exports);
|
|
18
|
+
__exportStar(require("./projects"), exports);
|
|
19
|
+
__exportStar(require("./sections"), exports);
|
|
20
|
+
__exportStar(require("./labels"), exports);
|
|
21
|
+
__exportStar(require("./comments"), exports);
|
|
22
|
+
__exportStar(require("./reminders"), exports);
|
|
23
|
+
__exportStar(require("./users"), exports);
|
|
24
|
+
__exportStar(require("./productivity"), exports);
|
|
25
|
+
__exportStar(require("./activity"), exports);
|
|
26
|
+
__exportStar(require("./workspaces"), exports);
|
|
27
|
+
__exportStar(require("./folders"), exports);
|
|
28
|
+
__exportStar(require("./insights"), exports);
|
|
29
|
+
__exportStar(require("./backups"), exports);
|
|
30
|
+
__exportStar(require("./id-mappings"), exports);
|
|
31
|
+
__exportStar(require("./emails"), exports);
|
|
32
|
+
__exportStar(require("./uploads"), exports);
|
|
33
|
+
__exportStar(require("./templates"), exports);
|
|
34
|
+
__exportStar(require("./errors"), exports);
|
|
35
|
+
__exportStar(require("./http"), exports);
|
|
36
|
+
__exportStar(require("./sync"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkspaceInsightsSchema = exports.ProjectInsightSchema = exports.ProjectProgressSchema = exports.ProjectHealthContextSchema = exports.TaskContextSchema = exports.ProjectMetricsSchema = exports.ProjectHealthSchema = exports.TaskRecommendationSchema = exports.HEALTH_STATUSES = exports.ProjectActivityStatsSchema = exports.WeekRollupSchema = exports.DayActivitySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.DayActivitySchema = zod_1.z.object({
|
|
6
|
+
date: zod_1.z.string(),
|
|
7
|
+
totalCount: zod_1.z.number().int(),
|
|
8
|
+
});
|
|
9
|
+
exports.WeekRollupSchema = zod_1.z.object({
|
|
10
|
+
fromDate: zod_1.z.string(),
|
|
11
|
+
toDate: zod_1.z.string(),
|
|
12
|
+
totalCount: zod_1.z.number().int(),
|
|
13
|
+
});
|
|
14
|
+
exports.ProjectActivityStatsSchema = zod_1.z.object({
|
|
15
|
+
dayItems: zod_1.z.array(exports.DayActivitySchema),
|
|
16
|
+
weekItems: zod_1.z.array(exports.WeekRollupSchema).nullable(),
|
|
17
|
+
});
|
|
18
|
+
/** Available project health statuses. */
|
|
19
|
+
exports.HEALTH_STATUSES = [
|
|
20
|
+
'UNKNOWN',
|
|
21
|
+
'ON_TRACK',
|
|
22
|
+
'AT_RISK',
|
|
23
|
+
'CRITICAL',
|
|
24
|
+
'EXCELLENT',
|
|
25
|
+
'ERROR',
|
|
26
|
+
];
|
|
27
|
+
exports.TaskRecommendationSchema = zod_1.z.object({
|
|
28
|
+
taskId: zod_1.z.string(),
|
|
29
|
+
recommendation: zod_1.z.string(),
|
|
30
|
+
});
|
|
31
|
+
exports.ProjectHealthSchema = zod_1.z.object({
|
|
32
|
+
status: zod_1.z.enum(exports.HEALTH_STATUSES),
|
|
33
|
+
description: zod_1.z.string().nullable().optional(),
|
|
34
|
+
descriptionSummary: zod_1.z.string().nullable().optional(),
|
|
35
|
+
taskRecommendations: zod_1.z.array(exports.TaskRecommendationSchema).nullable().optional(),
|
|
36
|
+
projectId: zod_1.z.string().nullable().optional(),
|
|
37
|
+
updatedAt: zod_1.z.string().nullable().optional(),
|
|
38
|
+
isStale: zod_1.z.boolean().default(false),
|
|
39
|
+
updateInProgress: zod_1.z.boolean().default(false),
|
|
40
|
+
});
|
|
41
|
+
exports.ProjectMetricsSchema = zod_1.z.object({
|
|
42
|
+
totalTasks: zod_1.z.number().int(),
|
|
43
|
+
completedTasks: zod_1.z.number().int(),
|
|
44
|
+
overdueTasks: zod_1.z.number().int(),
|
|
45
|
+
tasksCreatedThisWeek: zod_1.z.number().int(),
|
|
46
|
+
tasksCompletedThisWeek: zod_1.z.number().int(),
|
|
47
|
+
averageCompletionTime: zod_1.z.number().nullable(),
|
|
48
|
+
});
|
|
49
|
+
exports.TaskContextSchema = zod_1.z.object({
|
|
50
|
+
id: zod_1.z.string(),
|
|
51
|
+
content: zod_1.z.string(),
|
|
52
|
+
due: zod_1.z.string().nullable().optional(),
|
|
53
|
+
deadline: zod_1.z.string().nullable().optional(),
|
|
54
|
+
priority: zod_1.z.string(),
|
|
55
|
+
isCompleted: zod_1.z.boolean(),
|
|
56
|
+
createdAt: zod_1.z.string(),
|
|
57
|
+
updatedAt: zod_1.z.string(),
|
|
58
|
+
completedAt: zod_1.z.string().nullable(),
|
|
59
|
+
completedByUid: zod_1.z.string().nullable(),
|
|
60
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
61
|
+
});
|
|
62
|
+
exports.ProjectHealthContextSchema = zod_1.z.object({
|
|
63
|
+
projectId: zod_1.z.string(),
|
|
64
|
+
projectName: zod_1.z.string(),
|
|
65
|
+
projectDescription: zod_1.z.string().nullable(),
|
|
66
|
+
projectMetrics: exports.ProjectMetricsSchema,
|
|
67
|
+
tasks: zod_1.z.array(exports.TaskContextSchema),
|
|
68
|
+
language: zod_1.z.string().nullable().optional(),
|
|
69
|
+
});
|
|
70
|
+
exports.ProjectProgressSchema = zod_1.z.object({
|
|
71
|
+
projectId: zod_1.z.string(),
|
|
72
|
+
completedCount: zod_1.z.number().int(),
|
|
73
|
+
activeCount: zod_1.z.number().int(),
|
|
74
|
+
progressPercent: zod_1.z.number().int(),
|
|
75
|
+
});
|
|
76
|
+
exports.ProjectInsightSchema = zod_1.z.object({
|
|
77
|
+
projectId: zod_1.z.string(),
|
|
78
|
+
health: exports.ProjectHealthSchema.nullable(),
|
|
79
|
+
progress: exports.ProjectProgressSchema.nullable(),
|
|
80
|
+
});
|
|
81
|
+
exports.WorkspaceInsightsSchema = zod_1.z.object({
|
|
82
|
+
folderId: zod_1.z.string().nullable(),
|
|
83
|
+
projectInsights: zod_1.z.array(exports.ProjectInsightSchema),
|
|
84
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LabelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.LabelSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string(),
|
|
7
|
+
order: zod_1.z.number().int().nullable(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
color: zod_1.z.string(),
|
|
10
|
+
isFavorite: zod_1.z.boolean(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColorSchema = exports.ProductivityStatsSchema = exports.KarmaUpdateSchema = exports.ItemsWithDateSchema = exports.CompletedItemSchema = exports.StreakSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.StreakSchema = zod_1.z.object({
|
|
6
|
+
count: zod_1.z.number(),
|
|
7
|
+
start: zod_1.z.string(),
|
|
8
|
+
end: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
exports.CompletedItemSchema = zod_1.z.object({
|
|
11
|
+
id: zod_1.z.string(),
|
|
12
|
+
completed: zod_1.z.number(),
|
|
13
|
+
});
|
|
14
|
+
exports.ItemsWithDateSchema = zod_1.z.object({
|
|
15
|
+
items: zod_1.z.array(exports.CompletedItemSchema),
|
|
16
|
+
totalCompleted: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
exports.KarmaUpdateSchema = zod_1.z.object({
|
|
19
|
+
time: zod_1.z.string(),
|
|
20
|
+
newKarma: zod_1.z.number(),
|
|
21
|
+
positiveKarma: zod_1.z.number(),
|
|
22
|
+
negativeKarma: zod_1.z.number(),
|
|
23
|
+
positiveKarmaReasons: zod_1.z.array(zod_1.z.any()),
|
|
24
|
+
negativeKarmaReasons: zod_1.z.array(zod_1.z.any()),
|
|
25
|
+
});
|
|
26
|
+
exports.ProductivityStatsSchema = zod_1.z.object({
|
|
27
|
+
completedCount: zod_1.z.number(),
|
|
28
|
+
daysItems: zod_1.z.array(exports.ItemsWithDateSchema.extend({
|
|
29
|
+
date: zod_1.z.string(),
|
|
30
|
+
})),
|
|
31
|
+
goals: zod_1.z.object({
|
|
32
|
+
currentDailyStreak: exports.StreakSchema,
|
|
33
|
+
currentWeeklyStreak: exports.StreakSchema,
|
|
34
|
+
dailyGoal: zod_1.z.number(),
|
|
35
|
+
ignoreDays: zod_1.z.array(zod_1.z.number()),
|
|
36
|
+
karmaDisabled: zod_1.z.number(),
|
|
37
|
+
lastDailyStreak: exports.StreakSchema,
|
|
38
|
+
lastWeeklyStreak: exports.StreakSchema,
|
|
39
|
+
maxDailyStreak: exports.StreakSchema,
|
|
40
|
+
maxWeeklyStreak: exports.StreakSchema,
|
|
41
|
+
user: zod_1.z.string(),
|
|
42
|
+
userId: zod_1.z.string(),
|
|
43
|
+
vacationMode: zod_1.z.number(),
|
|
44
|
+
weeklyGoal: zod_1.z.number(),
|
|
45
|
+
}),
|
|
46
|
+
karma: zod_1.z.number(),
|
|
47
|
+
karmaGraphData: zod_1.z.array(zod_1.z.object({
|
|
48
|
+
date: zod_1.z.string(),
|
|
49
|
+
karmaAvg: zod_1.z.number(),
|
|
50
|
+
})),
|
|
51
|
+
karmaLastUpdate: zod_1.z.number(),
|
|
52
|
+
karmaTrend: zod_1.z.string(),
|
|
53
|
+
karmaUpdateReasons: zod_1.z.array(exports.KarmaUpdateSchema),
|
|
54
|
+
projectColors: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
|
|
55
|
+
weekItems: zod_1.z.array(exports.ItemsWithDateSchema.extend({
|
|
56
|
+
from: zod_1.z.string(),
|
|
57
|
+
to: zod_1.z.string(),
|
|
58
|
+
})),
|
|
59
|
+
});
|
|
60
|
+
exports.ColorSchema = zod_1.z.object({
|
|
61
|
+
/** The key of the color (i.e. 'berry_red') */
|
|
62
|
+
key: zod_1.z.string(),
|
|
63
|
+
/** The display name of the color (i.e. 'Berry Red') */
|
|
64
|
+
displayName: zod_1.z.string(),
|
|
65
|
+
/** The hex value of the color (i.e. '#b8255f') */
|
|
66
|
+
hexValue: zod_1.z.string(),
|
|
67
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROJECT_VIEW_STYLES = exports.WorkspaceProjectSchema = exports.ProjectVisibilitySchema = exports.PROJECT_VISIBILITIES = exports.PersonalProjectSchema = exports.BaseProjectSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const url_helpers_1 = require("../../utils/url-helpers");
|
|
6
|
+
/**
|
|
7
|
+
* Base schema for all project types in Todoist.
|
|
8
|
+
* Contains common fields shared between personal and workspace projects.
|
|
9
|
+
*/
|
|
10
|
+
exports.BaseProjectSchema = zod_1.z.object({
|
|
11
|
+
id: zod_1.z.string(),
|
|
12
|
+
canAssignTasks: zod_1.z.boolean(),
|
|
13
|
+
childOrder: zod_1.z.number().int(),
|
|
14
|
+
color: zod_1.z.string(),
|
|
15
|
+
createdAt: zod_1.z.string().nullable(),
|
|
16
|
+
isArchived: zod_1.z.boolean(),
|
|
17
|
+
isDeleted: zod_1.z.boolean(),
|
|
18
|
+
isFavorite: zod_1.z.boolean(),
|
|
19
|
+
isFrozen: zod_1.z.boolean(),
|
|
20
|
+
name: zod_1.z.string(),
|
|
21
|
+
updatedAt: zod_1.z.string().nullable(),
|
|
22
|
+
viewStyle: zod_1.z.string(),
|
|
23
|
+
defaultOrder: zod_1.z.number().int(),
|
|
24
|
+
description: zod_1.z.string(),
|
|
25
|
+
isCollapsed: zod_1.z.boolean(),
|
|
26
|
+
isShared: zod_1.z.boolean(),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Schema for personal projects in Todoist.
|
|
30
|
+
*/
|
|
31
|
+
exports.PersonalProjectSchema = exports.BaseProjectSchema.extend({
|
|
32
|
+
parentId: zod_1.z.string().nullable(),
|
|
33
|
+
inboxProject: zod_1.z.boolean().optional().default(false),
|
|
34
|
+
}).transform((data) => {
|
|
35
|
+
return Object.assign(Object.assign({}, data), { url: (0, url_helpers_1.getProjectUrl)(data.id, data.name) });
|
|
36
|
+
});
|
|
37
|
+
/** Available project visibility levels. */
|
|
38
|
+
exports.PROJECT_VISIBILITIES = ['restricted', 'team', 'public'];
|
|
39
|
+
exports.ProjectVisibilitySchema = zod_1.z.enum(exports.PROJECT_VISIBILITIES);
|
|
40
|
+
/**
|
|
41
|
+
* Schema for workspace projects in Todoist.
|
|
42
|
+
*/
|
|
43
|
+
exports.WorkspaceProjectSchema = exports.BaseProjectSchema.extend({
|
|
44
|
+
access: zod_1.z.object({ visibility: exports.ProjectVisibilitySchema }).optional(),
|
|
45
|
+
collaboratorRoleDefault: zod_1.z.string(),
|
|
46
|
+
folderId: zod_1.z.string().nullable(),
|
|
47
|
+
isInviteOnly: zod_1.z.boolean().nullable(),
|
|
48
|
+
isLinkSharingEnabled: zod_1.z.boolean(),
|
|
49
|
+
role: zod_1.z.string().nullable(),
|
|
50
|
+
status: zod_1.z.string(),
|
|
51
|
+
workspaceId: zod_1.z.string(),
|
|
52
|
+
}).transform((data) => {
|
|
53
|
+
return Object.assign(Object.assign({}, data), { url: (0, url_helpers_1.getProjectUrl)(data.id, data.name) });
|
|
54
|
+
});
|
|
55
|
+
/** Available project view styles. */
|
|
56
|
+
exports.PROJECT_VIEW_STYLES = ['list', 'board', 'calendar'];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateLocationReminderArgsSchema = exports.UpdateReminderArgsSchema = exports.UpdateAbsoluteReminderArgsSchema = exports.UpdateRelativeReminderArgsSchema = exports.AddLocationReminderArgsSchema = exports.AddReminderArgsSchema = exports.AddAbsoluteReminderArgsSchema = exports.AddRelativeReminderArgsSchema = exports.ReminderDueDateSchema = exports.ReminderIdSchema = exports.ReminderDeliveryServiceSchema = exports.REMINDER_DELIVERY_SERVICES = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const types_1 = require("../tasks/types");
|
|
6
|
+
const reminders_1 = require("../sync/resources/reminders");
|
|
7
|
+
/** Available reminder delivery services. */
|
|
8
|
+
exports.REMINDER_DELIVERY_SERVICES = ['email', 'push'];
|
|
9
|
+
exports.ReminderDeliveryServiceSchema = zod_1.z.enum(exports.REMINDER_DELIVERY_SERVICES);
|
|
10
|
+
exports.ReminderIdSchema = zod_1.z.string();
|
|
11
|
+
exports.ReminderDueDateSchema = types_1.DueDateSchema.pick({
|
|
12
|
+
date: true,
|
|
13
|
+
string: true,
|
|
14
|
+
timezone: true,
|
|
15
|
+
lang: true,
|
|
16
|
+
isRecurring: true,
|
|
17
|
+
})
|
|
18
|
+
.partial()
|
|
19
|
+
.strict();
|
|
20
|
+
// ── Add schemas ──────────────────────────────────────────────────────
|
|
21
|
+
exports.AddRelativeReminderArgsSchema = zod_1.z
|
|
22
|
+
.object({
|
|
23
|
+
taskId: zod_1.z.string(),
|
|
24
|
+
reminderType: zod_1.z.literal(reminders_1.ReminderTypeEnum.Relative).optional(),
|
|
25
|
+
minuteOffset: zod_1.z.number().int(),
|
|
26
|
+
service: exports.ReminderDeliveryServiceSchema.optional(),
|
|
27
|
+
notifyUid: zod_1.z.string().optional(),
|
|
28
|
+
isUrgent: zod_1.z.boolean().optional(),
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
31
|
+
exports.AddAbsoluteReminderArgsSchema = zod_1.z
|
|
32
|
+
.object({
|
|
33
|
+
taskId: zod_1.z.string(),
|
|
34
|
+
reminderType: zod_1.z.literal(reminders_1.ReminderTypeEnum.Absolute),
|
|
35
|
+
due: exports.ReminderDueDateSchema,
|
|
36
|
+
service: exports.ReminderDeliveryServiceSchema.optional(),
|
|
37
|
+
notifyUid: zod_1.z.string().optional(),
|
|
38
|
+
isUrgent: zod_1.z.boolean().optional(),
|
|
39
|
+
})
|
|
40
|
+
.strict();
|
|
41
|
+
exports.AddReminderArgsSchema = zod_1.z.union([
|
|
42
|
+
exports.AddRelativeReminderArgsSchema,
|
|
43
|
+
exports.AddAbsoluteReminderArgsSchema,
|
|
44
|
+
]);
|
|
45
|
+
exports.AddLocationReminderArgsSchema = zod_1.z
|
|
46
|
+
.object({
|
|
47
|
+
taskId: zod_1.z.string(),
|
|
48
|
+
notifyUid: zod_1.z.string().optional(),
|
|
49
|
+
name: zod_1.z.string(),
|
|
50
|
+
locLat: zod_1.z.string(),
|
|
51
|
+
locLong: zod_1.z.string(),
|
|
52
|
+
locTrigger: zod_1.z.enum(reminders_1.LOCATION_TRIGGERS),
|
|
53
|
+
radius: zod_1.z.number().int().optional(),
|
|
54
|
+
})
|
|
55
|
+
.strict();
|
|
56
|
+
// ── Update schemas ───────────────────────────────────────────────────
|
|
57
|
+
exports.UpdateRelativeReminderArgsSchema = zod_1.z
|
|
58
|
+
.object({
|
|
59
|
+
reminderType: zod_1.z.literal(reminders_1.ReminderTypeEnum.Relative),
|
|
60
|
+
minuteOffset: zod_1.z.number().int().optional(),
|
|
61
|
+
notifyUid: zod_1.z.string().optional(),
|
|
62
|
+
service: exports.ReminderDeliveryServiceSchema.optional(),
|
|
63
|
+
isUrgent: zod_1.z.boolean().optional(),
|
|
64
|
+
})
|
|
65
|
+
.strict();
|
|
66
|
+
exports.UpdateAbsoluteReminderArgsSchema = zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
reminderType: zod_1.z.literal(reminders_1.ReminderTypeEnum.Absolute),
|
|
69
|
+
due: exports.ReminderDueDateSchema.optional(),
|
|
70
|
+
notifyUid: zod_1.z.string().optional(),
|
|
71
|
+
service: exports.ReminderDeliveryServiceSchema.optional(),
|
|
72
|
+
isUrgent: zod_1.z.boolean().optional(),
|
|
73
|
+
})
|
|
74
|
+
.strict();
|
|
75
|
+
exports.UpdateReminderArgsSchema = zod_1.z
|
|
76
|
+
.discriminatedUnion('reminderType', [
|
|
77
|
+
exports.UpdateRelativeReminderArgsSchema,
|
|
78
|
+
exports.UpdateAbsoluteReminderArgsSchema,
|
|
79
|
+
])
|
|
80
|
+
.refine((args) => Object.entries(args).some(([key, value]) => key !== 'reminderType' && value !== undefined), {
|
|
81
|
+
message: 'At least one reminder field must be provided to updateReminder',
|
|
82
|
+
});
|
|
83
|
+
exports.UpdateLocationReminderArgsSchema = zod_1.z
|
|
84
|
+
.object({
|
|
85
|
+
notifyUid: zod_1.z.string().optional(),
|
|
86
|
+
name: zod_1.z.string().optional(),
|
|
87
|
+
locLat: zod_1.z.string().optional(),
|
|
88
|
+
locLong: zod_1.z.string().optional(),
|
|
89
|
+
locTrigger: zod_1.z.enum(reminders_1.LOCATION_TRIGGERS).optional(),
|
|
90
|
+
radius: zod_1.z.number().int().optional(),
|
|
91
|
+
})
|
|
92
|
+
.strict()
|
|
93
|
+
.refine((args) => Object.values(args).some((value) => value !== undefined), {
|
|
94
|
+
message: 'At least one reminder field must be provided to updateLocationReminder',
|
|
95
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SectionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const url_helpers_1 = require("../../utils/url-helpers");
|
|
6
|
+
exports.SectionSchema = zod_1.z
|
|
7
|
+
.object({
|
|
8
|
+
id: zod_1.z.string(),
|
|
9
|
+
userId: zod_1.z.string(),
|
|
10
|
+
projectId: zod_1.z.string(),
|
|
11
|
+
addedAt: zod_1.z.string(),
|
|
12
|
+
updatedAt: zod_1.z.string(),
|
|
13
|
+
archivedAt: zod_1.z.string().nullable(),
|
|
14
|
+
name: zod_1.z.string(),
|
|
15
|
+
sectionOrder: zod_1.z.number().int(),
|
|
16
|
+
isArchived: zod_1.z.boolean(),
|
|
17
|
+
isDeleted: zod_1.z.boolean(),
|
|
18
|
+
isCollapsed: zod_1.z.boolean(),
|
|
19
|
+
})
|
|
20
|
+
.transform((data) => {
|
|
21
|
+
return Object.assign(Object.assign({}, data), { url: (0, url_helpers_1.getSectionUrl)(data.id, data.name) });
|
|
22
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Re-export all domain types
|
|
18
|
+
__exportStar(require("./shared"), exports);
|
|
19
|
+
__exportStar(require("./tasks"), exports);
|
|
20
|
+
__exportStar(require("./projects"), exports);
|
|
21
|
+
__exportStar(require("./sections"), exports);
|
|
22
|
+
__exportStar(require("./labels"), exports);
|
|
23
|
+
__exportStar(require("./filters"), exports);
|
|
24
|
+
__exportStar(require("./notes"), exports);
|
|
25
|
+
__exportStar(require("./reminders"), exports);
|
|
26
|
+
__exportStar(require("./workspaces"), exports);
|
|
27
|
+
__exportStar(require("./folders"), exports);
|
|
28
|
+
__exportStar(require("./workspace-filters"), exports);
|
|
29
|
+
__exportStar(require("./workspace-goals"), exports);
|
|
30
|
+
__exportStar(require("./notifications"), exports);
|
|
31
|
+
__exportStar(require("./sharing"), exports);
|
|
32
|
+
__exportStar(require("./view-options"), exports);
|
|
33
|
+
__exportStar(require("./project-view-options"), exports);
|
|
34
|
+
__exportStar(require("./calendars"), exports);
|
|
35
|
+
__exportStar(require("./others"), exports);
|