@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,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectViewOptionsDefaultsSchema = exports.ViewOptionsSchema = exports.CalendarSettingsSchema = exports.CALENDAR_LAYOUTS = exports.SortOrderSchema = exports.SORT_ORDERS = exports.SortedBySchema = exports.SORTED_BY_OPTIONS = exports.GroupedBySchema = exports.GROUPED_BY_OPTIONS = exports.ViewModeSchema = exports.VIEW_MODES = exports.ViewTypeSchema = exports.VIEW_TYPES = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/** Available view types. */
|
|
6
|
+
exports.VIEW_TYPES = [
|
|
7
|
+
'TODAY',
|
|
8
|
+
'UPCOMING',
|
|
9
|
+
'PROJECT',
|
|
10
|
+
'LABEL',
|
|
11
|
+
'FILTER',
|
|
12
|
+
'WORKSPACE_FILTER',
|
|
13
|
+
'SEARCH',
|
|
14
|
+
'TEMPLATE_PREVIEW',
|
|
15
|
+
'TASK_DETAIL',
|
|
16
|
+
'AUTOMATION',
|
|
17
|
+
'ASSIGNED',
|
|
18
|
+
'OVERDUE',
|
|
19
|
+
'WORKSPACE_OVERVIEW',
|
|
20
|
+
];
|
|
21
|
+
exports.ViewTypeSchema = zod_1.z.enum(exports.VIEW_TYPES);
|
|
22
|
+
/** Available view modes. */
|
|
23
|
+
exports.VIEW_MODES = ['LIST', 'BOARD', 'CALENDAR'];
|
|
24
|
+
exports.ViewModeSchema = zod_1.z.enum(exports.VIEW_MODES);
|
|
25
|
+
/** Available grouping options. */
|
|
26
|
+
exports.GROUPED_BY_OPTIONS = [
|
|
27
|
+
'ASSIGNEE',
|
|
28
|
+
'ADDED_DATE',
|
|
29
|
+
'DUE_DATE',
|
|
30
|
+
'DEADLINE',
|
|
31
|
+
'LABEL',
|
|
32
|
+
'PRIORITY',
|
|
33
|
+
'PROJECT',
|
|
34
|
+
'WORKSPACE',
|
|
35
|
+
];
|
|
36
|
+
exports.GroupedBySchema = zod_1.z.enum(exports.GROUPED_BY_OPTIONS).nullable();
|
|
37
|
+
/** Available sorting options. */
|
|
38
|
+
exports.SORTED_BY_OPTIONS = [
|
|
39
|
+
'MANUAL',
|
|
40
|
+
'ALPHABETICALLY',
|
|
41
|
+
'ASSIGNEE',
|
|
42
|
+
'DUE_DATE',
|
|
43
|
+
'DEADLINE',
|
|
44
|
+
'ADDED_DATE',
|
|
45
|
+
'PRIORITY',
|
|
46
|
+
'PROJECT',
|
|
47
|
+
'WORKSPACE',
|
|
48
|
+
];
|
|
49
|
+
exports.SortedBySchema = zod_1.z.enum(exports.SORTED_BY_OPTIONS).nullable();
|
|
50
|
+
/** Available sort directions. */
|
|
51
|
+
exports.SORT_ORDERS = ['ASC', 'DESC'];
|
|
52
|
+
exports.SortOrderSchema = zod_1.z.enum(exports.SORT_ORDERS).nullable();
|
|
53
|
+
/** Available calendar layout modes. */
|
|
54
|
+
exports.CALENDAR_LAYOUTS = ['WEEK', 'MONTH'];
|
|
55
|
+
exports.CalendarSettingsSchema = zod_1.z
|
|
56
|
+
.object({
|
|
57
|
+
layout: zod_1.z.enum(exports.CALENDAR_LAYOUTS).optional(),
|
|
58
|
+
})
|
|
59
|
+
.passthrough();
|
|
60
|
+
exports.ViewOptionsSchema = zod_1.z
|
|
61
|
+
.object({
|
|
62
|
+
viewType: exports.ViewTypeSchema,
|
|
63
|
+
objectId: zod_1.z.string().optional(),
|
|
64
|
+
groupedBy: exports.GroupedBySchema.optional(),
|
|
65
|
+
filteredBy: zod_1.z.string().nullable().optional(),
|
|
66
|
+
viewMode: exports.ViewModeSchema.optional(),
|
|
67
|
+
showCompletedTasks: zod_1.z.boolean().optional(),
|
|
68
|
+
sortedBy: exports.SortedBySchema.optional(),
|
|
69
|
+
sortOrder: exports.SortOrderSchema.optional(),
|
|
70
|
+
})
|
|
71
|
+
.passthrough();
|
|
72
|
+
exports.ProjectViewOptionsDefaultsSchema = zod_1.z
|
|
73
|
+
.object({
|
|
74
|
+
projectId: zod_1.z.string(),
|
|
75
|
+
viewMode: exports.ViewModeSchema.nullable().optional(),
|
|
76
|
+
groupedBy: exports.GroupedBySchema.optional(),
|
|
77
|
+
sortedBy: exports.SortedBySchema.optional(),
|
|
78
|
+
sortOrder: exports.SortOrderSchema.optional(),
|
|
79
|
+
showCompletedTasks: zod_1.z.boolean().optional(),
|
|
80
|
+
filteredBy: zod_1.z.string().nullable().optional(),
|
|
81
|
+
calendarSettings: exports.CalendarSettingsSchema.nullable().optional(),
|
|
82
|
+
})
|
|
83
|
+
.passthrough();
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkspaceFilterSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.WorkspaceFilterSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
workspaceId: zod_1.z.string(),
|
|
9
|
+
name: zod_1.z.string(),
|
|
10
|
+
query: zod_1.z.string(),
|
|
11
|
+
color: zod_1.z.string(),
|
|
12
|
+
itemOrder: zod_1.z.number().int(),
|
|
13
|
+
isDeleted: zod_1.z.boolean(),
|
|
14
|
+
isFavorite: zod_1.z.boolean(),
|
|
15
|
+
isFrozen: zod_1.z.boolean(),
|
|
16
|
+
creatorUid: zod_1.z.string(),
|
|
17
|
+
updaterUid: zod_1.z.string(),
|
|
18
|
+
createdAt: zod_1.z.string(),
|
|
19
|
+
updatedAt: zod_1.z.string(),
|
|
20
|
+
})
|
|
21
|
+
.passthrough();
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkspaceGoalSchema = exports.WorkspaceGoalProgressSchema = exports.WorkspaceGoalMilestoneSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.WorkspaceGoalMilestoneSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
isCompleted: zod_1.z.boolean(),
|
|
10
|
+
})
|
|
11
|
+
.passthrough();
|
|
12
|
+
exports.WorkspaceGoalProgressSchema = zod_1.z
|
|
13
|
+
.object({
|
|
14
|
+
completedItems: zod_1.z.number().int(),
|
|
15
|
+
totalItems: zod_1.z.number().int(),
|
|
16
|
+
})
|
|
17
|
+
.passthrough();
|
|
18
|
+
exports.WorkspaceGoalSchema = zod_1.z
|
|
19
|
+
.object({
|
|
20
|
+
id: zod_1.z.string(),
|
|
21
|
+
workspaceId: zod_1.z.string(),
|
|
22
|
+
title: zod_1.z.string(),
|
|
23
|
+
description: zod_1.z.string().nullable(),
|
|
24
|
+
deadline: zod_1.z.string().nullable(),
|
|
25
|
+
isDeleted: zod_1.z.boolean(),
|
|
26
|
+
projectIds: zod_1.z.array(zod_1.z.string()),
|
|
27
|
+
progress: exports.WorkspaceGoalProgressSchema.nullable(),
|
|
28
|
+
creatorUid: zod_1.z.string(),
|
|
29
|
+
createdAt: zod_1.z.string(),
|
|
30
|
+
updatedAt: zod_1.z.string(),
|
|
31
|
+
})
|
|
32
|
+
.passthrough();
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.SyncWorkspaceSchema = void 0;
|
|
15
|
+
const zod_1 = require("zod");
|
|
16
|
+
const common_1 = require("../../common");
|
|
17
|
+
const types_1 = require("../../workspaces/types");
|
|
18
|
+
/**
|
|
19
|
+
* Sync API workspace resource.
|
|
20
|
+
*
|
|
21
|
+
* This is a superset of the REST `WorkspaceSchema` — the Sync API returns
|
|
22
|
+
* additional fields like description, isDeleted, isCollapsed, member counts,
|
|
23
|
+
* domain settings, and sorting preferences.
|
|
24
|
+
*/
|
|
25
|
+
exports.SyncWorkspaceSchema = zod_1.z
|
|
26
|
+
.object({
|
|
27
|
+
id: common_1.StringOrNumberSchema,
|
|
28
|
+
name: zod_1.z.string(),
|
|
29
|
+
description: zod_1.z.string(),
|
|
30
|
+
logoBig: zod_1.z.string().optional(),
|
|
31
|
+
logoMedium: zod_1.z.string().optional(),
|
|
32
|
+
logoSmall: zod_1.z.string().optional(),
|
|
33
|
+
logoS640: zod_1.z.string().optional(),
|
|
34
|
+
creatorId: common_1.StringOrNumberSchema,
|
|
35
|
+
createdAt: zod_1.z.string().optional(),
|
|
36
|
+
dateCreated: zod_1.z.string().optional(),
|
|
37
|
+
isDeleted: zod_1.z.boolean(),
|
|
38
|
+
isCollapsed: zod_1.z.boolean(),
|
|
39
|
+
role: types_1.WorkspaceRoleSchema.optional(),
|
|
40
|
+
plan: types_1.WorkspacePlanSchema,
|
|
41
|
+
limits: types_1.WorkspaceLimitsSchema.optional(),
|
|
42
|
+
inviteCode: zod_1.z.string().nullable().optional(),
|
|
43
|
+
isLinkSharingEnabled: zod_1.z.boolean().nullable().optional(),
|
|
44
|
+
isGuestAllowed: zod_1.z.boolean().nullable().optional(),
|
|
45
|
+
currentActiveProjects: zod_1.z.number().nullable(),
|
|
46
|
+
currentMemberCount: zod_1.z.number().nullable(),
|
|
47
|
+
memberCountByType: zod_1.z
|
|
48
|
+
.object({
|
|
49
|
+
adminCount: zod_1.z.number().int(),
|
|
50
|
+
guestCount: zod_1.z.number().int(),
|
|
51
|
+
memberCount: zod_1.z.number().int(),
|
|
52
|
+
})
|
|
53
|
+
.optional(),
|
|
54
|
+
currentTemplateCount: zod_1.z.number().nullable(),
|
|
55
|
+
pendingInvitations: zod_1.z.array(zod_1.z.string()).nullable().optional(),
|
|
56
|
+
domainName: zod_1.z.string().optional(),
|
|
57
|
+
domainDiscovery: zod_1.z.boolean().optional(),
|
|
58
|
+
restrictEmailDomains: zod_1.z.boolean().optional(),
|
|
59
|
+
adminSortingApplied: zod_1.z.boolean(),
|
|
60
|
+
projectSortPreference: zod_1.z.string().optional(),
|
|
61
|
+
defaultCollaborators: zod_1.z
|
|
62
|
+
.object({
|
|
63
|
+
predefinedGroupIds: zod_1.z.array(zod_1.z.string()),
|
|
64
|
+
userIds: zod_1.z.array(zod_1.z.number()),
|
|
65
|
+
})
|
|
66
|
+
.optional(),
|
|
67
|
+
properties: types_1.WorkspacePropertiesSchema.optional(),
|
|
68
|
+
})
|
|
69
|
+
.passthrough()
|
|
70
|
+
.transform((_a) => {
|
|
71
|
+
var { dateCreated, createdAt } = _a, rest = __rest(_a, ["dateCreated", "createdAt"]);
|
|
72
|
+
return (Object.assign(Object.assign({}, rest), { createdAt: createdAt !== null && createdAt !== void 0 ? createdAt : dateCreated }));
|
|
73
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DayOfWeekSchema = exports.TimeFormatSchema = exports.DateFormatSchema = exports.BooleanFromZeroOneSchema = exports.DAY_OF_WEEK_TO_API = exports.TIME_FORMAT_TO_API = exports.DATE_FORMAT_TO_API = exports.DAY_OF_WEEK_FROM_API = exports.TIME_FORMAT_FROM_API = exports.DATE_FORMAT_FROM_API = exports.DAYS_OF_WEEK = exports.TIME_FORMATS = exports.DATE_FORMATS = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/** Available date format options. */
|
|
6
|
+
exports.DATE_FORMATS = ['DD/MM/YYYY', 'MM/DD/YYYY'];
|
|
7
|
+
/** Available time format options. */
|
|
8
|
+
exports.TIME_FORMATS = ['24h', '12h'];
|
|
9
|
+
/** Available days of the week. */
|
|
10
|
+
exports.DAYS_OF_WEEK = [
|
|
11
|
+
'Monday',
|
|
12
|
+
'Tuesday',
|
|
13
|
+
'Wednesday',
|
|
14
|
+
'Thursday',
|
|
15
|
+
'Friday',
|
|
16
|
+
'Saturday',
|
|
17
|
+
'Sunday',
|
|
18
|
+
];
|
|
19
|
+
exports.DATE_FORMAT_FROM_API = {
|
|
20
|
+
0: 'DD/MM/YYYY',
|
|
21
|
+
1: 'MM/DD/YYYY',
|
|
22
|
+
};
|
|
23
|
+
exports.TIME_FORMAT_FROM_API = {
|
|
24
|
+
0: '24h',
|
|
25
|
+
1: '12h',
|
|
26
|
+
};
|
|
27
|
+
exports.DAY_OF_WEEK_FROM_API = {
|
|
28
|
+
1: 'Monday',
|
|
29
|
+
2: 'Tuesday',
|
|
30
|
+
3: 'Wednesday',
|
|
31
|
+
4: 'Thursday',
|
|
32
|
+
5: 'Friday',
|
|
33
|
+
6: 'Saturday',
|
|
34
|
+
7: 'Sunday',
|
|
35
|
+
};
|
|
36
|
+
exports.DATE_FORMAT_TO_API = {
|
|
37
|
+
'DD/MM/YYYY': 0,
|
|
38
|
+
'MM/DD/YYYY': 1,
|
|
39
|
+
};
|
|
40
|
+
exports.TIME_FORMAT_TO_API = { '24h': 0, '12h': 1 };
|
|
41
|
+
exports.DAY_OF_WEEK_TO_API = {
|
|
42
|
+
Monday: 1,
|
|
43
|
+
Tuesday: 2,
|
|
44
|
+
Wednesday: 3,
|
|
45
|
+
Thursday: 4,
|
|
46
|
+
Friday: 5,
|
|
47
|
+
Saturday: 6,
|
|
48
|
+
Sunday: 7,
|
|
49
|
+
};
|
|
50
|
+
/** Zod read-schema: parse API 0/1 integer, emit boolean */
|
|
51
|
+
exports.BooleanFromZeroOneSchema = zod_1.z
|
|
52
|
+
.union([zod_1.z.literal(0), zod_1.z.literal(1)])
|
|
53
|
+
.transform((v) => v === 1);
|
|
54
|
+
/** Zod read-schemas: parse API numbers, emit descriptive strings */
|
|
55
|
+
exports.DateFormatSchema = zod_1.z
|
|
56
|
+
.union([zod_1.z.literal(0), zod_1.z.literal(1)])
|
|
57
|
+
.transform((v) => exports.DATE_FORMAT_FROM_API[v]);
|
|
58
|
+
exports.TimeFormatSchema = zod_1.z
|
|
59
|
+
.union([zod_1.z.literal(0), zod_1.z.literal(1)])
|
|
60
|
+
.transform((v) => exports.TIME_FORMAT_FROM_API[v]);
|
|
61
|
+
exports.DayOfWeekSchema = zod_1.z
|
|
62
|
+
.union([
|
|
63
|
+
zod_1.z.literal(1),
|
|
64
|
+
zod_1.z.literal(2),
|
|
65
|
+
zod_1.z.literal(3),
|
|
66
|
+
zod_1.z.literal(4),
|
|
67
|
+
zod_1.z.literal(5),
|
|
68
|
+
zod_1.z.literal(6),
|
|
69
|
+
zod_1.z.literal(7),
|
|
70
|
+
])
|
|
71
|
+
.transform((v) => exports.DAY_OF_WEEK_FROM_API[v]);
|
|
@@ -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,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskSchema = exports.DeadlineSchema = exports.DurationSchema = exports.DURATION_UNITS = exports.DueDateSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const url_helpers_1 = require("../../utils/url-helpers");
|
|
6
|
+
const uncompletable_helpers_1 = require("../../utils/uncompletable-helpers");
|
|
7
|
+
exports.DueDateSchema = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
isRecurring: zod_1.z.boolean(),
|
|
10
|
+
string: zod_1.z.string(),
|
|
11
|
+
date: zod_1.z.string(),
|
|
12
|
+
})
|
|
13
|
+
.extend({
|
|
14
|
+
datetime: zod_1.z.string().nullable().optional(),
|
|
15
|
+
timezone: zod_1.z.string().nullable().optional(),
|
|
16
|
+
lang: zod_1.z.string().nullable().optional(),
|
|
17
|
+
});
|
|
18
|
+
/** Available duration units for task deadlines. */
|
|
19
|
+
exports.DURATION_UNITS = ['minute', 'day'];
|
|
20
|
+
exports.DurationSchema = zod_1.z.object({
|
|
21
|
+
amount: zod_1.z.number().positive('Value should be greater than zero'),
|
|
22
|
+
unit: zod_1.z.enum(exports.DURATION_UNITS),
|
|
23
|
+
});
|
|
24
|
+
exports.DeadlineSchema = zod_1.z.object({
|
|
25
|
+
date: zod_1.z.string(),
|
|
26
|
+
lang: zod_1.z.string(),
|
|
27
|
+
});
|
|
28
|
+
exports.TaskSchema = zod_1.z
|
|
29
|
+
.object({
|
|
30
|
+
id: zod_1.z.string(),
|
|
31
|
+
userId: zod_1.z.string(),
|
|
32
|
+
projectId: zod_1.z.string(),
|
|
33
|
+
sectionId: zod_1.z.string().nullable(),
|
|
34
|
+
parentId: zod_1.z.string().nullable(),
|
|
35
|
+
addedByUid: zod_1.z.string().nullable(),
|
|
36
|
+
assignedByUid: zod_1.z.string().nullable(),
|
|
37
|
+
responsibleUid: zod_1.z.string().nullable(),
|
|
38
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
39
|
+
deadline: exports.DeadlineSchema.nullable(),
|
|
40
|
+
duration: exports.DurationSchema.nullable(),
|
|
41
|
+
checked: zod_1.z.boolean(),
|
|
42
|
+
isDeleted: zod_1.z.boolean(),
|
|
43
|
+
addedAt: zod_1.z.string().nullable(),
|
|
44
|
+
completedAt: zod_1.z.string().nullable(),
|
|
45
|
+
updatedAt: zod_1.z.string().nullable(),
|
|
46
|
+
due: exports.DueDateSchema.nullable(),
|
|
47
|
+
priority: zod_1.z.number().int(),
|
|
48
|
+
childOrder: zod_1.z.number().int(),
|
|
49
|
+
content: zod_1.z.string(),
|
|
50
|
+
description: zod_1.z.string(),
|
|
51
|
+
dayOrder: zod_1.z.number().int(),
|
|
52
|
+
isCollapsed: zod_1.z.boolean(),
|
|
53
|
+
isUncompletable: zod_1.z.boolean().default(false),
|
|
54
|
+
})
|
|
55
|
+
.transform((data) => {
|
|
56
|
+
// Auto-detect uncompletable status from content prefix
|
|
57
|
+
const isUncompletable = (0, uncompletable_helpers_1.hasUncompletablePrefix)(data.content);
|
|
58
|
+
return Object.assign(Object.assign({}, data), { isUncompletable, url: (0, url_helpers_1.getTaskUrl)(data.id, data.content) });
|
|
59
|
+
});
|
|
@@ -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,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,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,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CurrentUserSchema = exports.PREMIUM_STATUSES = exports.TimezoneInfoSchema = exports.UserSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.UserSchema = zod_1.z.object({
|
|
6
|
+
id: zod_1.z.string(),
|
|
7
|
+
name: zod_1.z.string(),
|
|
8
|
+
email: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
exports.TimezoneInfoSchema = zod_1.z.object({
|
|
11
|
+
gmtString: zod_1.z.string(),
|
|
12
|
+
hours: zod_1.z.number().int(),
|
|
13
|
+
isDst: zod_1.z.number().int(),
|
|
14
|
+
minutes: zod_1.z.number().int(),
|
|
15
|
+
timezone: zod_1.z.string(),
|
|
16
|
+
});
|
|
17
|
+
/** Available user premium statuses. */
|
|
18
|
+
exports.PREMIUM_STATUSES = [
|
|
19
|
+
'not_premium',
|
|
20
|
+
'current_personal_plan',
|
|
21
|
+
'legacy_personal_plan',
|
|
22
|
+
'teams_business_member',
|
|
23
|
+
];
|
|
24
|
+
exports.CurrentUserSchema = zod_1.z.object({
|
|
25
|
+
id: zod_1.z.string(),
|
|
26
|
+
email: zod_1.z.string(),
|
|
27
|
+
fullName: zod_1.z.string(),
|
|
28
|
+
avatarBig: zod_1.z.string().nullish(),
|
|
29
|
+
avatarMedium: zod_1.z.string().nullish(),
|
|
30
|
+
avatarS640: zod_1.z.string().nullish(),
|
|
31
|
+
avatarSmall: zod_1.z.string().nullish(),
|
|
32
|
+
businessAccountId: zod_1.z.string().nullable(),
|
|
33
|
+
isPremium: zod_1.z.boolean(),
|
|
34
|
+
premiumStatus: zod_1.z.enum(exports.PREMIUM_STATUSES),
|
|
35
|
+
dateFormat: zod_1.z.number().int(),
|
|
36
|
+
timeFormat: zod_1.z.number().int(),
|
|
37
|
+
weeklyGoal: zod_1.z.number().int(),
|
|
38
|
+
dailyGoal: zod_1.z.number().int(),
|
|
39
|
+
completedCount: zod_1.z.number().int(),
|
|
40
|
+
completedToday: zod_1.z.number().int(),
|
|
41
|
+
karma: zod_1.z.number(),
|
|
42
|
+
karmaTrend: zod_1.z.string(),
|
|
43
|
+
lang: zod_1.z.string(),
|
|
44
|
+
nextWeek: zod_1.z.number().int(),
|
|
45
|
+
startDay: zod_1.z.number().int(),
|
|
46
|
+
startPage: zod_1.z.string(),
|
|
47
|
+
tzInfo: exports.TimezoneInfoSchema,
|
|
48
|
+
inboxProjectId: zod_1.z.string(),
|
|
49
|
+
daysOff: zod_1.z.array(zod_1.z.number().int()),
|
|
50
|
+
weekendStartDay: zod_1.z.number().int(),
|
|
51
|
+
});
|
|
@@ -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,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.WorkspaceUserTaskSchema = exports.MemberActivityInfoSchema = exports.WorkspaceSchema = exports.WorkspacePropertiesSchema = exports.WorkspaceLimitsSchema = exports.WorkspacePlanSchema = exports.WORKSPACE_PLANS = exports.JoinWorkspaceResultSchema = exports.WorkspacePlanDetailsSchema = exports.WORKSPACE_PLAN_STATUSES = exports.WORKSPACE_CURRENT_PLANS = exports.FormattedPriceListingSchema = exports.PlanPriceSchema = exports.WorkspaceInvitationSchema = exports.WorkspaceUserSchema = exports.WorkspaceRoleSchema = exports.WORKSPACE_ROLES = exports.COLLABORATOR_ROLES = void 0;
|
|
15
|
+
const zod_1 = require("zod");
|
|
16
|
+
const common_1 = require("../common");
|
|
17
|
+
const types_1 = require("../tasks/types");
|
|
18
|
+
/** Available project collaborator roles. */
|
|
19
|
+
exports.COLLABORATOR_ROLES = [
|
|
20
|
+
'CREATOR',
|
|
21
|
+
'ADMIN',
|
|
22
|
+
'READ_WRITE',
|
|
23
|
+
'EDIT_ONLY',
|
|
24
|
+
'COMPLETE_ONLY',
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Available workspace roles.
|
|
28
|
+
*/
|
|
29
|
+
exports.WORKSPACE_ROLES = ['ADMIN', 'MEMBER', 'GUEST'];
|
|
30
|
+
exports.WorkspaceRoleSchema = zod_1.z.enum(exports.WORKSPACE_ROLES);
|
|
31
|
+
exports.WorkspaceUserSchema = zod_1.z.object({
|
|
32
|
+
userId: zod_1.z.string(),
|
|
33
|
+
workspaceId: zod_1.z.string(),
|
|
34
|
+
userEmail: zod_1.z.string(),
|
|
35
|
+
fullName: zod_1.z.string(),
|
|
36
|
+
timezone: zod_1.z.string(),
|
|
37
|
+
role: exports.WorkspaceRoleSchema,
|
|
38
|
+
imageId: zod_1.z.string().nullable(),
|
|
39
|
+
isDeleted: zod_1.z.boolean().default(false),
|
|
40
|
+
});
|
|
41
|
+
exports.WorkspaceInvitationSchema = zod_1.z.object({
|
|
42
|
+
id: zod_1.z.string().default('0'),
|
|
43
|
+
inviterId: zod_1.z.string(),
|
|
44
|
+
userEmail: zod_1.z.string(),
|
|
45
|
+
workspaceId: zod_1.z.string(),
|
|
46
|
+
role: exports.WorkspaceRoleSchema,
|
|
47
|
+
isExistingUser: zod_1.z.boolean(),
|
|
48
|
+
});
|
|
49
|
+
exports.PlanPriceSchema = zod_1.z.object({
|
|
50
|
+
currency: zod_1.z.string(),
|
|
51
|
+
amount: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
|
|
52
|
+
interval: zod_1.z.string().optional(),
|
|
53
|
+
});
|
|
54
|
+
exports.FormattedPriceListingSchema = zod_1.z.object({
|
|
55
|
+
currency: zod_1.z.string().optional(),
|
|
56
|
+
amount: zod_1.z.number().optional(),
|
|
57
|
+
interval: zod_1.z.string().optional(),
|
|
58
|
+
formatted: zod_1.z.string().optional(),
|
|
59
|
+
});
|
|
60
|
+
/** Available workspace plan names. */
|
|
61
|
+
exports.WORKSPACE_CURRENT_PLANS = ['Business', 'Starter'];
|
|
62
|
+
/** Available workspace plan statuses. */
|
|
63
|
+
exports.WORKSPACE_PLAN_STATUSES = [
|
|
64
|
+
'Active',
|
|
65
|
+
'Downgraded',
|
|
66
|
+
'Cancelled',
|
|
67
|
+
'NeverSubscribed',
|
|
68
|
+
];
|
|
69
|
+
exports.WorkspacePlanDetailsSchema = zod_1.z.object({
|
|
70
|
+
currentMemberCount: zod_1.z.number(),
|
|
71
|
+
currentPlan: zod_1.z.enum(exports.WORKSPACE_CURRENT_PLANS),
|
|
72
|
+
currentPlanStatus: zod_1.z.enum(exports.WORKSPACE_PLAN_STATUSES),
|
|
73
|
+
downgradeAt: zod_1.z.string().nullable(),
|
|
74
|
+
currentActiveProjects: zod_1.z.number(),
|
|
75
|
+
maximumActiveProjects: zod_1.z.number(),
|
|
76
|
+
priceList: zod_1.z.array(exports.FormattedPriceListingSchema),
|
|
77
|
+
workspaceId: zod_1.z.number(),
|
|
78
|
+
isTrialing: zod_1.z.boolean(),
|
|
79
|
+
trialEndsAt: zod_1.z.string().nullable(),
|
|
80
|
+
cancelAtPeriodEnd: zod_1.z.boolean(),
|
|
81
|
+
hasTrialed: zod_1.z.boolean(),
|
|
82
|
+
planPrice: exports.PlanPriceSchema.nullable(),
|
|
83
|
+
hasBillingPortal: zod_1.z.boolean(),
|
|
84
|
+
hasBillingPortalSwitchToAnnual: zod_1.z.boolean(),
|
|
85
|
+
});
|
|
86
|
+
exports.JoinWorkspaceResultSchema = zod_1.z.object({
|
|
87
|
+
customSortingApplied: zod_1.z.boolean(),
|
|
88
|
+
projectSortPreference: zod_1.z.string(),
|
|
89
|
+
role: exports.WorkspaceRoleSchema,
|
|
90
|
+
userId: zod_1.z.string(),
|
|
91
|
+
workspaceId: zod_1.z.string(),
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Available workspace plans.
|
|
95
|
+
*/
|
|
96
|
+
exports.WORKSPACE_PLANS = ['STARTER', 'BUSINESS'];
|
|
97
|
+
exports.WorkspacePlanSchema = zod_1.z.enum(exports.WORKSPACE_PLANS);
|
|
98
|
+
/**
|
|
99
|
+
* Workspace resource limits.
|
|
100
|
+
*/
|
|
101
|
+
exports.WorkspaceLimitsSchema = zod_1.z
|
|
102
|
+
.object({
|
|
103
|
+
current: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable(),
|
|
104
|
+
next: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullable(),
|
|
105
|
+
})
|
|
106
|
+
.catchall(zod_1.z.any());
|
|
107
|
+
/**
|
|
108
|
+
* Workspace properties (flexible object for unknown fields).
|
|
109
|
+
*/
|
|
110
|
+
exports.WorkspacePropertiesSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
|
|
111
|
+
/**
|
|
112
|
+
* Represents a workspace in Todoist.
|
|
113
|
+
*/
|
|
114
|
+
exports.WorkspaceSchema = zod_1.z
|
|
115
|
+
.object({
|
|
116
|
+
id: common_1.StringOrNumberSchema,
|
|
117
|
+
name: zod_1.z.string(),
|
|
118
|
+
plan: exports.WorkspacePlanSchema,
|
|
119
|
+
role: exports.WorkspaceRoleSchema.optional(),
|
|
120
|
+
inviteCode: zod_1.z.string(),
|
|
121
|
+
isLinkSharingEnabled: zod_1.z.boolean(),
|
|
122
|
+
isGuestAllowed: zod_1.z.boolean(),
|
|
123
|
+
limits: exports.WorkspaceLimitsSchema.optional(),
|
|
124
|
+
logoBig: zod_1.z.string().nullish(),
|
|
125
|
+
logoMedium: zod_1.z.string().nullish(),
|
|
126
|
+
logoSmall: zod_1.z.string().nullish(),
|
|
127
|
+
logoS640: zod_1.z.string().nullish(),
|
|
128
|
+
createdAt: zod_1.z.string().optional(),
|
|
129
|
+
dateCreated: zod_1.z.string().optional(),
|
|
130
|
+
creatorId: common_1.StringOrNumberSchema,
|
|
131
|
+
properties: exports.WorkspacePropertiesSchema,
|
|
132
|
+
})
|
|
133
|
+
.transform((_a) => {
|
|
134
|
+
var { dateCreated, createdAt } = _a, rest = __rest(_a, ["dateCreated", "createdAt"]);
|
|
135
|
+
return (Object.assign(Object.assign({}, rest), { createdAt: createdAt !== null && createdAt !== void 0 ? createdAt : dateCreated }));
|
|
136
|
+
});
|
|
137
|
+
exports.MemberActivityInfoSchema = zod_1.z.object({
|
|
138
|
+
userId: zod_1.z.string(),
|
|
139
|
+
tasksAssigned: zod_1.z.number().int(),
|
|
140
|
+
tasksOverdue: zod_1.z.number().int(),
|
|
141
|
+
});
|
|
142
|
+
exports.WorkspaceUserTaskSchema = zod_1.z.object({
|
|
143
|
+
id: zod_1.z.string(),
|
|
144
|
+
content: zod_1.z.string(),
|
|
145
|
+
responsibleUid: zod_1.z.string().nullable(),
|
|
146
|
+
due: types_1.DueDateSchema.nullable(),
|
|
147
|
+
deadline: types_1.DeadlineSchema.nullable(),
|
|
148
|
+
labels: zod_1.z.array(zod_1.z.string()),
|
|
149
|
+
notesCount: zod_1.z.number().int(),
|
|
150
|
+
projectId: zod_1.z.string(),
|
|
151
|
+
projectName: zod_1.z.string(),
|
|
152
|
+
priority: zod_1.z.number().int(),
|
|
153
|
+
description: zod_1.z.string(),
|
|
154
|
+
isOverdue: zod_1.z.boolean(),
|
|
155
|
+
});
|