@doist/todoist-api-typescript 7.9.0 → 7.10.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/README.md +5 -204
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.mjs +1 -0
- package/package.json +12 -92
- package/LICENSE +0 -21
- package/dist/cjs/authentication.js +0 -204
- package/dist/cjs/consts/endpoints.js +0 -141
- package/dist/cjs/index.js +0 -20
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/test-utils/asserts.js +0 -11
- package/dist/cjs/test-utils/msw-setup.js +0 -97
- package/dist/cjs/test-utils/obsidian-fetch-adapter.js +0 -53
- package/dist/cjs/test-utils/test-defaults.js +0 -240
- package/dist/cjs/todoist-api.js +0 -2623
- package/dist/cjs/transport/fetch-with-retry.js +0 -206
- package/dist/cjs/transport/http-client.js +0 -133
- package/dist/cjs/transport/http-dispatcher.js +0 -72
- package/dist/cjs/types/activity/index.js +0 -18
- package/dist/cjs/types/activity/requests.js +0 -2
- package/dist/cjs/types/activity/types.js +0 -28
- package/dist/cjs/types/backups/index.js +0 -18
- package/dist/cjs/types/backups/requests.js +0 -2
- package/dist/cjs/types/backups/types.js +0 -8
- package/dist/cjs/types/comments/index.js +0 -18
- package/dist/cjs/types/comments/requests.js +0 -2
- package/dist/cjs/types/comments/types.js +0 -60
- package/dist/cjs/types/common.js +0 -2
- package/dist/cjs/types/emails/index.js +0 -17
- package/dist/cjs/types/emails/requests.js +0 -5
- package/dist/cjs/types/errors.js +0 -29
- package/dist/cjs/types/folders/index.js +0 -17
- package/dist/cjs/types/folders/requests.js +0 -2
- package/dist/cjs/types/http.js +0 -24
- package/dist/cjs/types/id-mappings/index.js +0 -18
- package/dist/cjs/types/id-mappings/requests.js +0 -20
- package/dist/cjs/types/id-mappings/types.js +0 -12
- package/dist/cjs/types/index.js +0 -36
- package/dist/cjs/types/insights/index.js +0 -18
- package/dist/cjs/types/insights/requests.js +0 -2
- package/dist/cjs/types/insights/types.js +0 -84
- package/dist/cjs/types/labels/index.js +0 -18
- package/dist/cjs/types/labels/requests.js +0 -2
- package/dist/cjs/types/labels/types.js +0 -11
- package/dist/cjs/types/productivity/index.js +0 -17
- package/dist/cjs/types/productivity/types.js +0 -67
- package/dist/cjs/types/projects/index.js +0 -18
- package/dist/cjs/types/projects/requests.js +0 -2
- package/dist/cjs/types/projects/types.js +0 -56
- package/dist/cjs/types/reminders/index.js +0 -17
- package/dist/cjs/types/reminders/requests.js +0 -95
- package/dist/cjs/types/sections/index.js +0 -18
- package/dist/cjs/types/sections/requests.js +0 -2
- package/dist/cjs/types/sections/types.js +0 -22
- package/dist/cjs/types/sync/commands/calendars.js +0 -2
- package/dist/cjs/types/sync/commands/filters.js +0 -2
- package/dist/cjs/types/sync/commands/folders.js +0 -2
- package/dist/cjs/types/sync/commands/index.js +0 -35
- package/dist/cjs/types/sync/commands/labels.js +0 -5
- package/dist/cjs/types/sync/commands/notes.js +0 -2
- package/dist/cjs/types/sync/commands/notifications.js +0 -2
- package/dist/cjs/types/sync/commands/others.js +0 -2
- package/dist/cjs/types/sync/commands/project-view-options.js +0 -2
- package/dist/cjs/types/sync/commands/projects.js +0 -2
- package/dist/cjs/types/sync/commands/reminders.js +0 -2
- package/dist/cjs/types/sync/commands/sections.js +0 -2
- package/dist/cjs/types/sync/commands/shared.js +0 -20
- package/dist/cjs/types/sync/commands/sharing.js +0 -2
- package/dist/cjs/types/sync/commands/tasks.js +0 -2
- package/dist/cjs/types/sync/commands/view-options.js +0 -2
- package/dist/cjs/types/sync/commands/workspace-filters.js +0 -2
- package/dist/cjs/types/sync/commands/workspace-goals.js +0 -2
- package/dist/cjs/types/sync/commands/workspaces.js +0 -2
- package/dist/cjs/types/sync/index.js +0 -22
- package/dist/cjs/types/sync/request.js +0 -2
- package/dist/cjs/types/sync/resource-types.js +0 -40
- package/dist/cjs/types/sync/resources/calendars.js +0 -31
- package/dist/cjs/types/sync/resources/collaborators.js +0 -25
- package/dist/cjs/types/sync/resources/completed-info.js +0 -30
- package/dist/cjs/types/sync/resources/filters.js +0 -16
- package/dist/cjs/types/sync/resources/folders.js +0 -14
- package/dist/cjs/types/sync/resources/index.js +0 -33
- package/dist/cjs/types/sync/resources/live-notifications.js +0 -39
- package/dist/cjs/types/sync/resources/notes.js +0 -23
- package/dist/cjs/types/sync/resources/reminders.js +0 -50
- package/dist/cjs/types/sync/resources/suggestions.js +0 -42
- package/dist/cjs/types/sync/resources/tooltips.js +0 -10
- package/dist/cjs/types/sync/resources/user-plan-limits.js +0 -24
- package/dist/cjs/types/sync/resources/user-settings.js +0 -42
- package/dist/cjs/types/sync/resources/user.js +0 -120
- package/dist/cjs/types/sync/resources/view-options.js +0 -83
- package/dist/cjs/types/sync/resources/workspace-filters.js +0 -21
- package/dist/cjs/types/sync/resources/workspace-goals.js +0 -32
- package/dist/cjs/types/sync/resources/workspaces.js +0 -56
- package/dist/cjs/types/sync/response.js +0 -2
- package/dist/cjs/types/sync/user-preferences.js +0 -71
- package/dist/cjs/types/tasks/index.js +0 -18
- package/dist/cjs/types/tasks/requests.js +0 -2
- package/dist/cjs/types/tasks/types.js +0 -59
- package/dist/cjs/types/templates/index.js +0 -17
- package/dist/cjs/types/templates/requests.js +0 -2
- package/dist/cjs/types/uploads/index.js +0 -17
- package/dist/cjs/types/uploads/requests.js +0 -2
- package/dist/cjs/types/users/index.js +0 -17
- package/dist/cjs/types/users/types.js +0 -51
- package/dist/cjs/types/workspaces/index.js +0 -18
- package/dist/cjs/types/workspaces/requests.js +0 -2
- package/dist/cjs/types/workspaces/types.js +0 -137
- package/dist/cjs/utils/activity-helpers.js +0 -58
- package/dist/cjs/utils/case-conversion.js +0 -69
- package/dist/cjs/utils/colors.js +0 -143
- package/dist/cjs/utils/index.js +0 -25
- package/dist/cjs/utils/multipart-upload.js +0 -178
- package/dist/cjs/utils/processing-helpers.js +0 -18
- package/dist/cjs/utils/sanitization.js +0 -116
- package/dist/cjs/utils/sync-helpers.js +0 -22
- package/dist/cjs/utils/uncompletable-helpers.js +0 -60
- package/dist/cjs/utils/url-helpers.js +0 -74
- package/dist/cjs/utils/validators.js +0 -141
- package/dist/esm/authentication.js +0 -196
- package/dist/esm/consts/endpoints.js +0 -122
- package/dist/esm/index.js +0 -4
- package/dist/esm/test-utils/asserts.js +0 -8
- package/dist/esm/test-utils/msw-setup.js +0 -88
- package/dist/esm/test-utils/obsidian-fetch-adapter.js +0 -50
- package/dist/esm/test-utils/test-defaults.js +0 -237
- package/dist/esm/todoist-api.js +0 -2619
- package/dist/esm/transport/fetch-with-retry.js +0 -203
- package/dist/esm/transport/http-client.js +0 -128
- package/dist/esm/transport/http-dispatcher.js +0 -35
- package/dist/esm/types/activity/index.js +0 -2
- package/dist/esm/types/activity/requests.js +0 -1
- package/dist/esm/types/activity/types.js +0 -25
- package/dist/esm/types/backups/index.js +0 -2
- package/dist/esm/types/backups/requests.js +0 -1
- package/dist/esm/types/backups/types.js +0 -5
- package/dist/esm/types/comments/index.js +0 -2
- package/dist/esm/types/comments/requests.js +0 -1
- package/dist/esm/types/comments/types.js +0 -57
- package/dist/esm/types/common.js +0 -1
- package/dist/esm/types/emails/index.js +0 -1
- package/dist/esm/types/emails/requests.js +0 -2
- package/dist/esm/types/errors.js +0 -24
- package/dist/esm/types/folders/index.js +0 -1
- package/dist/esm/types/folders/requests.js +0 -1
- package/dist/esm/types/http.js +0 -20
- package/dist/esm/types/id-mappings/index.js +0 -2
- package/dist/esm/types/id-mappings/requests.js +0 -17
- package/dist/esm/types/id-mappings/types.js +0 -9
- package/dist/esm/types/index.js +0 -20
- package/dist/esm/types/insights/index.js +0 -2
- package/dist/esm/types/insights/requests.js +0 -1
- package/dist/esm/types/insights/types.js +0 -81
- package/dist/esm/types/labels/index.js +0 -2
- package/dist/esm/types/labels/requests.js +0 -1
- package/dist/esm/types/labels/types.js +0 -8
- package/dist/esm/types/productivity/index.js +0 -1
- package/dist/esm/types/productivity/types.js +0 -64
- package/dist/esm/types/projects/index.js +0 -2
- package/dist/esm/types/projects/requests.js +0 -1
- package/dist/esm/types/projects/types.js +0 -53
- package/dist/esm/types/reminders/index.js +0 -1
- package/dist/esm/types/reminders/requests.js +0 -92
- package/dist/esm/types/sections/index.js +0 -2
- package/dist/esm/types/sections/requests.js +0 -1
- package/dist/esm/types/sections/types.js +0 -19
- package/dist/esm/types/sync/commands/calendars.js +0 -1
- package/dist/esm/types/sync/commands/filters.js +0 -1
- package/dist/esm/types/sync/commands/folders.js +0 -1
- package/dist/esm/types/sync/commands/index.js +0 -19
- package/dist/esm/types/sync/commands/labels.js +0 -2
- package/dist/esm/types/sync/commands/notes.js +0 -1
- package/dist/esm/types/sync/commands/notifications.js +0 -1
- package/dist/esm/types/sync/commands/others.js +0 -1
- package/dist/esm/types/sync/commands/project-view-options.js +0 -1
- package/dist/esm/types/sync/commands/projects.js +0 -1
- package/dist/esm/types/sync/commands/reminders.js +0 -1
- package/dist/esm/types/sync/commands/sections.js +0 -1
- package/dist/esm/types/sync/commands/shared.js +0 -16
- package/dist/esm/types/sync/commands/sharing.js +0 -1
- package/dist/esm/types/sync/commands/tasks.js +0 -1
- package/dist/esm/types/sync/commands/view-options.js +0 -1
- package/dist/esm/types/sync/commands/workspace-filters.js +0 -1
- package/dist/esm/types/sync/commands/workspace-goals.js +0 -1
- package/dist/esm/types/sync/commands/workspaces.js +0 -1
- package/dist/esm/types/sync/index.js +0 -6
- package/dist/esm/types/sync/request.js +0 -1
- package/dist/esm/types/sync/resource-types.js +0 -37
- package/dist/esm/types/sync/resources/calendars.js +0 -28
- package/dist/esm/types/sync/resources/collaborators.js +0 -22
- package/dist/esm/types/sync/resources/completed-info.js +0 -27
- package/dist/esm/types/sync/resources/filters.js +0 -13
- package/dist/esm/types/sync/resources/folders.js +0 -11
- package/dist/esm/types/sync/resources/index.js +0 -17
- package/dist/esm/types/sync/resources/live-notifications.js +0 -36
- package/dist/esm/types/sync/resources/notes.js +0 -20
- package/dist/esm/types/sync/resources/reminders.js +0 -47
- package/dist/esm/types/sync/resources/suggestions.js +0 -39
- package/dist/esm/types/sync/resources/tooltips.js +0 -7
- package/dist/esm/types/sync/resources/user-plan-limits.js +0 -21
- package/dist/esm/types/sync/resources/user-settings.js +0 -39
- package/dist/esm/types/sync/resources/user.js +0 -117
- package/dist/esm/types/sync/resources/view-options.js +0 -80
- package/dist/esm/types/sync/resources/workspace-filters.js +0 -18
- package/dist/esm/types/sync/resources/workspace-goals.js +0 -29
- package/dist/esm/types/sync/resources/workspaces.js +0 -53
- package/dist/esm/types/sync/response.js +0 -1
- package/dist/esm/types/sync/user-preferences.js +0 -68
- package/dist/esm/types/tasks/index.js +0 -2
- package/dist/esm/types/tasks/requests.js +0 -1
- package/dist/esm/types/tasks/types.js +0 -56
- package/dist/esm/types/templates/index.js +0 -1
- package/dist/esm/types/templates/requests.js +0 -1
- package/dist/esm/types/uploads/index.js +0 -1
- package/dist/esm/types/uploads/requests.js +0 -1
- package/dist/esm/types/users/index.js +0 -1
- package/dist/esm/types/users/types.js +0 -48
- package/dist/esm/types/workspaces/index.js +0 -2
- package/dist/esm/types/workspaces/requests.js +0 -1
- package/dist/esm/types/workspaces/types.js +0 -134
- package/dist/esm/utils/activity-helpers.js +0 -53
- package/dist/esm/utils/case-conversion.js +0 -61
- package/dist/esm/utils/colors.js +0 -139
- package/dist/esm/utils/index.js +0 -4
- package/dist/esm/utils/multipart-upload.js +0 -142
- package/dist/esm/utils/processing-helpers.js +0 -12
- package/dist/esm/utils/sanitization.js +0 -112
- package/dist/esm/utils/sync-helpers.js +0 -19
- package/dist/esm/utils/uncompletable-helpers.js +0 -54
- package/dist/esm/utils/url-helpers.js +0 -68
- package/dist/esm/utils/validators.js +0 -132
- package/dist/types/authentication.d.ts +0 -158
- package/dist/types/consts/endpoints.d.ts +0 -81
- package/dist/types/index.d.ts +0 -4
- package/dist/types/test-utils/asserts.d.ts +0 -1
- package/dist/types/test-utils/msw-setup.d.ts +0 -33
- package/dist/types/test-utils/obsidian-fetch-adapter.d.ts +0 -29
- package/dist/types/test-utils/test-defaults.d.ts +0 -261
- package/dist/types/todoist-api.d.ts +0 -1018
- package/dist/types/transport/fetch-with-retry.d.ts +0 -12
- package/dist/types/transport/http-client.d.ts +0 -16
- package/dist/types/transport/http-dispatcher.d.ts +0 -3
- package/dist/types/types/activity/index.d.ts +0 -2
- package/dist/types/types/activity/requests.d.ts +0 -85
- package/dist/types/types/activity/types.d.ts +0 -49
- package/dist/types/types/backups/index.d.ts +0 -2
- package/dist/types/types/backups/requests.d.ts +0 -16
- package/dist/types/types/backups/types.d.ts +0 -7
- package/dist/types/types/comments/index.d.ts +0 -2
- package/dist/types/types/comments/requests.d.ts +0 -64
- package/dist/types/types/comments/types.d.ts +0 -141
- package/dist/types/types/common.d.ts +0 -6
- package/dist/types/types/emails/index.d.ts +0 -1
- package/dist/types/types/emails/requests.d.ts +0 -30
- package/dist/types/types/errors.d.ts +0 -12
- package/dist/types/types/folders/index.d.ts +0 -1
- package/dist/types/types/folders/requests.d.ts +0 -20
- package/dist/types/types/http.d.ts +0 -85
- package/dist/types/types/id-mappings/index.d.ts +0 -2
- package/dist/types/types/id-mappings/requests.d.ts +0 -28
- package/dist/types/types/id-mappings/types.d.ts +0 -13
- package/dist/types/types/index.d.ts +0 -20
- package/dist/types/types/insights/index.d.ts +0 -2
- package/dist/types/types/insights/requests.d.ts +0 -26
- package/dist/types/types/insights/types.d.ts +0 -186
- package/dist/types/types/labels/index.d.ts +0 -2
- package/dist/types/types/labels/requests.d.ts +0 -75
- package/dist/types/types/labels/types.d.ts +0 -13
- package/dist/types/types/productivity/index.d.ts +0 -1
- package/dist/types/types/productivity/types.d.ts +0 -115
- package/dist/types/types/projects/index.d.ts +0 -2
- package/dist/types/types/projects/requests.d.ts +0 -169
- package/dist/types/types/projects/types.d.ts +0 -201
- package/dist/types/types/reminders/index.d.ts +0 -1
- package/dist/types/types/reminders/requests.d.ts +0 -205
- package/dist/types/types/sections/index.d.ts +0 -2
- package/dist/types/types/sections/requests.d.ts +0 -41
- package/dist/types/types/sections/types.d.ts +0 -44
- package/dist/types/types/sync/commands/calendars.d.ts +0 -14
- package/dist/types/types/sync/commands/filters.d.ts +0 -22
- package/dist/types/types/sync/commands/folders.d.ts +0 -18
- package/dist/types/types/sync/commands/index.d.ts +0 -171
- package/dist/types/types/sync/commands/labels.d.ts +0 -32
- package/dist/types/types/sync/commands/notes.d.ts +0 -27
- package/dist/types/types/sync/commands/notifications.d.ts +0 -10
- package/dist/types/types/sync/commands/others.d.ts +0 -39
- package/dist/types/types/sync/commands/project-view-options.d.ts +0 -14
- package/dist/types/types/sync/commands/projects.d.ts +0 -90
- package/dist/types/types/sync/commands/reminders.d.ts +0 -51
- package/dist/types/types/sync/commands/sections.d.ts +0 -31
- package/dist/types/types/sync/commands/shared.d.ts +0 -51
- package/dist/types/types/sync/commands/sharing.d.ts +0 -16
- package/dist/types/types/sync/commands/tasks.d.ts +0 -78
- package/dist/types/types/sync/commands/view-options.d.ts +0 -15
- package/dist/types/types/sync/commands/workspace-filters.d.ts +0 -23
- package/dist/types/types/sync/commands/workspace-goals.d.ts +0 -24
- package/dist/types/types/sync/commands/workspaces.d.ts +0 -79
- package/dist/types/types/sync/index.d.ts +0 -6
- package/dist/types/types/sync/request.d.ts +0 -7
- package/dist/types/types/sync/resource-types.d.ts +0 -5
- package/dist/types/types/sync/resources/calendars.d.ts +0 -38
- package/dist/types/types/sync/resources/collaborators.d.ts +0 -28
- package/dist/types/types/sync/resources/completed-info.d.ts +0 -33
- package/dist/types/types/sync/resources/filters.d.ts +0 -12
- package/dist/types/types/sync/resources/folders.d.ts +0 -10
- package/dist/types/types/sync/resources/index.d.ts +0 -17
- package/dist/types/types/sync/resources/live-notifications.d.ts +0 -32
- package/dist/types/types/sync/resources/notes.d.ts +0 -34
- package/dist/types/types/sync/resources/reminders.d.ts +0 -126
- package/dist/types/types/sync/resources/suggestions.d.ts +0 -96
- package/dist/types/types/sync/resources/tooltips.d.ts +0 -6
- package/dist/types/types/sync/resources/user-plan-limits.d.ts +0 -41
- package/dist/types/types/sync/resources/user-settings.d.ts +0 -40
- package/dist/types/types/sync/resources/user.d.ts +0 -134
- package/dist/types/types/sync/resources/view-options.d.ts +0 -169
- package/dist/types/types/sync/resources/workspace-filters.d.ts +0 -17
- package/dist/types/types/sync/resources/workspace-goals.d.ts +0 -29
- package/dist/types/types/sync/resources/workspaces.d.ts +0 -57
- package/dist/types/types/sync/response.d.ts +0 -51
- package/dist/types/types/sync/user-preferences.d.ts +0 -39
- package/dist/types/types/tasks/index.d.ts +0 -2
- package/dist/types/types/tasks/requests.d.ts +0 -197
- package/dist/types/types/tasks/types.d.ts +0 -162
- package/dist/types/types/templates/index.d.ts +0 -1
- package/dist/types/types/templates/requests.d.ts +0 -92
- package/dist/types/types/uploads/index.d.ts +0 -1
- package/dist/types/types/uploads/requests.d.ts +0 -32
- package/dist/types/types/users/index.d.ts +0 -1
- package/dist/types/types/users/types.d.ts +0 -66
- package/dist/types/types/workspaces/index.d.ts +0 -2
- package/dist/types/types/workspaces/requests.d.ts +0 -260
- package/dist/types/types/workspaces/types.d.ts +0 -225
- package/dist/types/utils/activity-helpers.d.ts +0 -28
- package/dist/types/utils/case-conversion.d.ts +0 -12
- package/dist/types/utils/colors.d.ts +0 -197
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/multipart-upload.d.ts +0 -54
- package/dist/types/utils/processing-helpers.d.ts +0 -1
- package/dist/types/utils/sanitization.d.ts +0 -35
- package/dist/types/utils/sync-helpers.d.ts +0 -17
- package/dist/types/utils/uncompletable-helpers.d.ts +0 -30
- package/dist/types/utils/url-helpers.d.ts +0 -32
- package/dist/types/utils/validators.d.ts +0 -1406
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ENDPOINT_REST_ID_MAPPINGS = exports.ENDPOINT_REST_EMAILS = exports.ENDPOINT_REST_BACKUPS_DOWNLOAD = exports.ENDPOINT_REST_BACKUPS = exports.ENDPOINT_REST_ACCESS_TOKENS_MIGRATE = exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID = exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE = exports.ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE = exports.ENDPOINT_REST_TEMPLATES_URL = exports.ENDPOINT_REST_TEMPLATES_FILE = exports.ENDPOINT_REST_TASKS_COMPLETED = exports.ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL = exports.ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE = exports.SECTION_UNARCHIVE = exports.SECTION_ARCHIVE = exports.ENDPOINT_REST_PROJECT_JOIN = exports.ENDPOINT_REST_PROJECT_FULL = exports.ENDPOINT_REST_PROJECTS_PERMISSIONS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT = exports.PROJECT_UNARCHIVE = exports.PROJECT_ARCHIVE = exports.ENDPOINT_REST_UPLOADS = exports.ENDPOINT_REST_ACTIVITIES = exports.ENDPOINT_REST_PRODUCTIVITY = exports.ENDPOINT_REST_USER = exports.ENDPOINT_REST_PROJECT_COLLABORATORS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS_SEARCH = exports.ENDPOINT_REST_PROJECTS = exports.ENDPOINT_REST_TASK_MOVE = exports.ENDPOINT_REST_TASK_REOPEN = exports.ENDPOINT_REST_TASK_CLOSE = exports.ENDPOINT_REST_LOCATION_REMINDERS = exports.ENDPOINT_REST_REMINDERS = exports.ENDPOINT_REST_COMMENTS = exports.ENDPOINT_REST_LABELS_SHARED_REMOVE = exports.ENDPOINT_REST_LABELS_SHARED_RENAME = exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS_SEARCH = exports.ENDPOINT_REST_LABELS = exports.ENDPOINT_REST_SECTIONS_SEARCH = exports.ENDPOINT_REST_SECTIONS = exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST_TASKS_FILTER = exports.ENDPOINT_REST_TASKS = exports.API_BASE_URI = exports.API_VERSION = exports.TODOIST_WEB_URI = void 0;
|
|
4
|
-
exports.ENDPOINT_WORKSPACE_MEMBERS = exports.ENDPOINT_WORKSPACE_USERS = exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = exports.ENDPOINT_WORKSPACE_LOGO = exports.ENDPOINT_WORKSPACE_JOIN = exports.ENDPOINT_WORKSPACE_INVITATIONS_DELETE = exports.ENDPOINT_WORKSPACE_INVITATIONS_ALL = exports.ENDPOINT_WORKSPACE_INVITATIONS = exports.ENDPOINT_REST_WORKSPACES = exports.ENDPOINT_REST_FOLDERS = exports.ENDPOINT_REVOKE = exports.ENDPOINT_GET_TOKEN = exports.ENDPOINT_AUTHORIZATION = exports.ENDPOINT_SYNC = exports.ENDPOINT_SYNC_QUICK_ADD = exports.ENDPOINT_REST_MOVED_IDS = void 0;
|
|
5
|
-
exports.getSyncBaseUri = getSyncBaseUri;
|
|
6
|
-
exports.getAuthBaseUri = getAuthBaseUri;
|
|
7
|
-
exports.getWorkspaceInvitationAcceptEndpoint = getWorkspaceInvitationAcceptEndpoint;
|
|
8
|
-
exports.getWorkspaceInvitationRejectEndpoint = getWorkspaceInvitationRejectEndpoint;
|
|
9
|
-
exports.getProjectInsightsActivityStatsEndpoint = getProjectInsightsActivityStatsEndpoint;
|
|
10
|
-
exports.getProjectInsightsHealthEndpoint = getProjectInsightsHealthEndpoint;
|
|
11
|
-
exports.getProjectInsightsHealthContextEndpoint = getProjectInsightsHealthContextEndpoint;
|
|
12
|
-
exports.getProjectInsightsProgressEndpoint = getProjectInsightsProgressEndpoint;
|
|
13
|
-
exports.getProjectInsightsHealthAnalyzeEndpoint = getProjectInsightsHealthAnalyzeEndpoint;
|
|
14
|
-
exports.getWorkspaceInsightsEndpoint = getWorkspaceInsightsEndpoint;
|
|
15
|
-
exports.getWorkspaceUserTasksEndpoint = getWorkspaceUserTasksEndpoint;
|
|
16
|
-
exports.getWorkspaceInviteUsersEndpoint = getWorkspaceInviteUsersEndpoint;
|
|
17
|
-
exports.getWorkspaceUserEndpoint = getWorkspaceUserEndpoint;
|
|
18
|
-
exports.getWorkspaceActiveProjectsEndpoint = getWorkspaceActiveProjectsEndpoint;
|
|
19
|
-
exports.getWorkspaceArchivedProjectsEndpoint = getWorkspaceArchivedProjectsEndpoint;
|
|
20
|
-
const BASE_URI = 'https://api.todoist.com';
|
|
21
|
-
const TODOIST_URI = 'https://todoist.com';
|
|
22
|
-
exports.TODOIST_WEB_URI = 'https://app.todoist.com/app';
|
|
23
|
-
// The API version is not configurable, to ensure
|
|
24
|
-
// compatibility between the API and the client.
|
|
25
|
-
exports.API_VERSION = 'v1';
|
|
26
|
-
exports.API_BASE_URI = `/api/${exports.API_VERSION}/`;
|
|
27
|
-
const API_AUTHORIZATION_BASE_URI = '/oauth/';
|
|
28
|
-
function getSyncBaseUri(domainBase = BASE_URI) {
|
|
29
|
-
return new URL(exports.API_BASE_URI, domainBase).toString();
|
|
30
|
-
}
|
|
31
|
-
function getAuthBaseUri(domainBase = TODOIST_URI) {
|
|
32
|
-
return new URL(API_AUTHORIZATION_BASE_URI, domainBase).toString();
|
|
33
|
-
}
|
|
34
|
-
exports.ENDPOINT_REST_TASKS = 'tasks';
|
|
35
|
-
exports.ENDPOINT_REST_TASKS_FILTER = exports.ENDPOINT_REST_TASKS + '/filter';
|
|
36
|
-
exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST_TASKS + '/completed/by_completion_date';
|
|
37
|
-
exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS + '/completed/by_due_date';
|
|
38
|
-
exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = 'completed/search';
|
|
39
|
-
exports.ENDPOINT_REST_SECTIONS = 'sections';
|
|
40
|
-
exports.ENDPOINT_REST_SECTIONS_SEARCH = exports.ENDPOINT_REST_SECTIONS + '/search';
|
|
41
|
-
exports.ENDPOINT_REST_LABELS = 'labels';
|
|
42
|
-
exports.ENDPOINT_REST_LABELS_SEARCH = exports.ENDPOINT_REST_LABELS + '/search';
|
|
43
|
-
exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS + '/shared';
|
|
44
|
-
exports.ENDPOINT_REST_LABELS_SHARED_RENAME = exports.ENDPOINT_REST_LABELS_SHARED + '/rename';
|
|
45
|
-
exports.ENDPOINT_REST_LABELS_SHARED_REMOVE = exports.ENDPOINT_REST_LABELS_SHARED + '/remove';
|
|
46
|
-
exports.ENDPOINT_REST_COMMENTS = 'comments';
|
|
47
|
-
exports.ENDPOINT_REST_REMINDERS = 'reminders';
|
|
48
|
-
exports.ENDPOINT_REST_LOCATION_REMINDERS = 'location_reminders';
|
|
49
|
-
exports.ENDPOINT_REST_TASK_CLOSE = 'close';
|
|
50
|
-
exports.ENDPOINT_REST_TASK_REOPEN = 'reopen';
|
|
51
|
-
exports.ENDPOINT_REST_TASK_MOVE = 'move';
|
|
52
|
-
exports.ENDPOINT_REST_PROJECTS = 'projects';
|
|
53
|
-
exports.ENDPOINT_REST_PROJECTS_SEARCH = exports.ENDPOINT_REST_PROJECTS + '/search';
|
|
54
|
-
exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS + '/archived';
|
|
55
|
-
exports.ENDPOINT_REST_PROJECT_COLLABORATORS = 'collaborators';
|
|
56
|
-
exports.ENDPOINT_REST_USER = 'user';
|
|
57
|
-
exports.ENDPOINT_REST_PRODUCTIVITY = exports.ENDPOINT_REST_TASKS + '/completed/stats';
|
|
58
|
-
exports.ENDPOINT_REST_ACTIVITIES = 'activities';
|
|
59
|
-
exports.ENDPOINT_REST_UPLOADS = 'uploads';
|
|
60
|
-
exports.PROJECT_ARCHIVE = 'archive';
|
|
61
|
-
exports.PROJECT_UNARCHIVE = 'unarchive';
|
|
62
|
-
exports.ENDPOINT_REST_PROJECTS_ARCHIVED_COUNT = exports.ENDPOINT_REST_PROJECTS + '/archived/count';
|
|
63
|
-
exports.ENDPOINT_REST_PROJECTS_PERMISSIONS = exports.ENDPOINT_REST_PROJECTS + '/permissions';
|
|
64
|
-
exports.ENDPOINT_REST_PROJECT_FULL = 'full';
|
|
65
|
-
exports.ENDPOINT_REST_PROJECT_JOIN = 'join';
|
|
66
|
-
exports.SECTION_ARCHIVE = 'archive';
|
|
67
|
-
exports.SECTION_UNARCHIVE = 'unarchive';
|
|
68
|
-
exports.ENDPOINT_REST_PROJECTS_MOVE_TO_WORKSPACE = exports.ENDPOINT_REST_PROJECTS + '/move_to_workspace';
|
|
69
|
-
exports.ENDPOINT_REST_PROJECTS_MOVE_TO_PERSONAL = exports.ENDPOINT_REST_PROJECTS + '/move_to_personal';
|
|
70
|
-
exports.ENDPOINT_REST_TASKS_COMPLETED = exports.ENDPOINT_REST_TASKS + '/completed';
|
|
71
|
-
exports.ENDPOINT_REST_TEMPLATES_FILE = 'templates/file';
|
|
72
|
-
exports.ENDPOINT_REST_TEMPLATES_URL = 'templates/url';
|
|
73
|
-
exports.ENDPOINT_REST_TEMPLATES_CREATE_FROM_FILE = 'templates/create_project_from_file';
|
|
74
|
-
exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_FILE = 'templates/import_into_project_from_file';
|
|
75
|
-
exports.ENDPOINT_REST_TEMPLATES_IMPORT_FROM_ID = 'templates/import_into_project_from_template_id';
|
|
76
|
-
exports.ENDPOINT_REST_ACCESS_TOKENS_MIGRATE = 'access_tokens/migrate_personal_token';
|
|
77
|
-
exports.ENDPOINT_REST_BACKUPS = 'backups';
|
|
78
|
-
exports.ENDPOINT_REST_BACKUPS_DOWNLOAD = 'backups/download';
|
|
79
|
-
exports.ENDPOINT_REST_EMAILS = 'emails';
|
|
80
|
-
exports.ENDPOINT_REST_ID_MAPPINGS = 'id_mappings';
|
|
81
|
-
exports.ENDPOINT_REST_MOVED_IDS = 'moved_ids';
|
|
82
|
-
exports.ENDPOINT_SYNC_QUICK_ADD = exports.ENDPOINT_REST_TASKS + '/quick';
|
|
83
|
-
exports.ENDPOINT_SYNC = 'sync';
|
|
84
|
-
exports.ENDPOINT_AUTHORIZATION = 'authorize';
|
|
85
|
-
exports.ENDPOINT_GET_TOKEN = 'access_token';
|
|
86
|
-
exports.ENDPOINT_REVOKE = 'revoke';
|
|
87
|
-
exports.ENDPOINT_REST_FOLDERS = 'folders';
|
|
88
|
-
// Workspace endpoints
|
|
89
|
-
exports.ENDPOINT_REST_WORKSPACES = 'workspaces';
|
|
90
|
-
exports.ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
|
|
91
|
-
exports.ENDPOINT_WORKSPACE_INVITATIONS_ALL = 'workspaces/invitations/all';
|
|
92
|
-
exports.ENDPOINT_WORKSPACE_INVITATIONS_DELETE = 'workspaces/invitations/delete';
|
|
93
|
-
exports.ENDPOINT_WORKSPACE_JOIN = 'workspaces/join';
|
|
94
|
-
exports.ENDPOINT_WORKSPACE_LOGO = 'workspaces/logo';
|
|
95
|
-
exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = 'workspaces/plan_details';
|
|
96
|
-
exports.ENDPOINT_WORKSPACE_USERS = 'workspaces/users';
|
|
97
|
-
// Workspace invitation actions (require invite_code parameter)
|
|
98
|
-
function getWorkspaceInvitationAcceptEndpoint(inviteCode) {
|
|
99
|
-
return `workspaces/invitations/${inviteCode}/accept`;
|
|
100
|
-
}
|
|
101
|
-
function getWorkspaceInvitationRejectEndpoint(inviteCode) {
|
|
102
|
-
return `workspaces/invitations/${inviteCode}/reject`;
|
|
103
|
-
}
|
|
104
|
-
// Insights endpoints
|
|
105
|
-
function getProjectInsightsActivityStatsEndpoint(projectId) {
|
|
106
|
-
return `projects/${projectId}/insights/activity_stats`;
|
|
107
|
-
}
|
|
108
|
-
function getProjectInsightsHealthEndpoint(projectId) {
|
|
109
|
-
return `projects/${projectId}/insights/health`;
|
|
110
|
-
}
|
|
111
|
-
function getProjectInsightsHealthContextEndpoint(projectId) {
|
|
112
|
-
return `projects/${projectId}/insights/health/context`;
|
|
113
|
-
}
|
|
114
|
-
function getProjectInsightsProgressEndpoint(projectId) {
|
|
115
|
-
return `projects/${projectId}/insights/progress`;
|
|
116
|
-
}
|
|
117
|
-
function getProjectInsightsHealthAnalyzeEndpoint(projectId) {
|
|
118
|
-
return `projects/${projectId}/insights/health/analyze`;
|
|
119
|
-
}
|
|
120
|
-
function getWorkspaceInsightsEndpoint(workspaceId) {
|
|
121
|
-
return `workspaces/${workspaceId}/insights`;
|
|
122
|
-
}
|
|
123
|
-
// Workspace members
|
|
124
|
-
exports.ENDPOINT_WORKSPACE_MEMBERS = 'workspaces/members';
|
|
125
|
-
// Workspace user management (require workspace_id and/or user_id parameters)
|
|
126
|
-
function getWorkspaceUserTasksEndpoint(workspaceId, userId) {
|
|
127
|
-
return `workspaces/${workspaceId}/users/${userId}/tasks`;
|
|
128
|
-
}
|
|
129
|
-
function getWorkspaceInviteUsersEndpoint(workspaceId) {
|
|
130
|
-
return `workspaces/${workspaceId}/users/invite`;
|
|
131
|
-
}
|
|
132
|
-
function getWorkspaceUserEndpoint(workspaceId, userId) {
|
|
133
|
-
return `workspaces/${workspaceId}/users/${userId}`;
|
|
134
|
-
}
|
|
135
|
-
// Workspace projects (require workspace_id parameter)
|
|
136
|
-
function getWorkspaceActiveProjectsEndpoint(workspaceId) {
|
|
137
|
-
return `workspaces/${workspaceId}/projects/active`;
|
|
138
|
-
}
|
|
139
|
-
function getWorkspaceArchivedProjectsEndpoint(workspaceId) {
|
|
140
|
-
return `workspaces/${workspaceId}/projects/archived`;
|
|
141
|
-
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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("./todoist-api"), exports);
|
|
18
|
-
__exportStar(require("./authentication"), exports);
|
|
19
|
-
__exportStar(require("./types"), exports);
|
|
20
|
-
__exportStar(require("./utils"), exports);
|
package/dist/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"commonjs"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assertInstance = assertInstance;
|
|
4
|
-
// Has to use 'any' to express constructor type
|
|
5
|
-
// oxlint-disable-next-line no-explicit-any
|
|
6
|
-
function assertInstance(value, type) {
|
|
7
|
-
if (value instanceof type) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
throw new TypeError(`Unexpected type ${typeof value}`);
|
|
11
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpResponse = exports.http = exports.server = exports.handlers = void 0;
|
|
4
|
-
exports.captureRequest = captureRequest;
|
|
5
|
-
exports.getLastRequest = getLastRequest;
|
|
6
|
-
exports.getAllRequests = getAllRequests;
|
|
7
|
-
exports.clearCapturedRequests = clearCapturedRequests;
|
|
8
|
-
exports.mockApiResponse = mockApiResponse;
|
|
9
|
-
exports.mockApiError = mockApiError;
|
|
10
|
-
const vitest_1 = require("vitest");
|
|
11
|
-
const node_1 = require("msw/node");
|
|
12
|
-
const msw_1 = require("msw");
|
|
13
|
-
Object.defineProperty(exports, "http", { enumerable: true, get: function () { return msw_1.http; } });
|
|
14
|
-
Object.defineProperty(exports, "HttpResponse", { enumerable: true, get: function () { return msw_1.HttpResponse; } });
|
|
15
|
-
// Request capture storage
|
|
16
|
-
const capturedRequests = [];
|
|
17
|
-
// Helper function to capture requests
|
|
18
|
-
function captureRequest({ request, body }) {
|
|
19
|
-
const headers = {};
|
|
20
|
-
request.headers.forEach((value, key) => {
|
|
21
|
-
headers[key] = value;
|
|
22
|
-
});
|
|
23
|
-
capturedRequests.push({
|
|
24
|
-
url: request.url,
|
|
25
|
-
method: request.method,
|
|
26
|
-
headers,
|
|
27
|
-
body,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
// Helper function to get the last captured request
|
|
31
|
-
function getLastRequest() {
|
|
32
|
-
return capturedRequests[capturedRequests.length - 1];
|
|
33
|
-
}
|
|
34
|
-
// Helper function to get all captured requests
|
|
35
|
-
function getAllRequests() {
|
|
36
|
-
return [...capturedRequests];
|
|
37
|
-
}
|
|
38
|
-
// Helper function to clear captured requests
|
|
39
|
-
function clearCapturedRequests() {
|
|
40
|
-
capturedRequests.length = 0;
|
|
41
|
-
}
|
|
42
|
-
// Default handlers for common API responses
|
|
43
|
-
exports.handlers = [
|
|
44
|
-
// Default handlers can be added here for common endpoints
|
|
45
|
-
// Individual test files will add their own specific handlers
|
|
46
|
-
];
|
|
47
|
-
// Create MSW server instance
|
|
48
|
-
exports.server = (0, node_1.setupServer)(...exports.handlers);
|
|
49
|
-
// Helper to create a resolver function for MSW handlers
|
|
50
|
-
function createResolver(data, status, headers) {
|
|
51
|
-
return async function resolver({ request }) {
|
|
52
|
-
let body = undefined;
|
|
53
|
-
if (request.method !== 'GET') {
|
|
54
|
-
try {
|
|
55
|
-
body = await request.json();
|
|
56
|
-
}
|
|
57
|
-
catch (_a) {
|
|
58
|
-
// Body might not be JSON
|
|
59
|
-
try {
|
|
60
|
-
body = await request.text();
|
|
61
|
-
}
|
|
62
|
-
catch (_b) {
|
|
63
|
-
// Body might be FormData or not parseable
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
captureRequest({ request, body });
|
|
68
|
-
return msw_1.HttpResponse.json(data, {
|
|
69
|
-
status,
|
|
70
|
-
headers,
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// Helper to mock a successful API response
|
|
75
|
-
function mockApiResponse({ endpoint, data, options = {}, }) {
|
|
76
|
-
const { status = 200, method = 'GET', headers = {} } = options;
|
|
77
|
-
const resolver = createResolver(data, status, headers);
|
|
78
|
-
const httpMethod = method.toLowerCase();
|
|
79
|
-
exports.server.use(msw_1.http[httpMethod](endpoint, resolver));
|
|
80
|
-
}
|
|
81
|
-
// Helper to mock an error response
|
|
82
|
-
function mockApiError({ endpoint, data, status, options = {}, }) {
|
|
83
|
-
mockApiResponse({ endpoint, data, options: Object.assign(Object.assign({}, options), { status }) });
|
|
84
|
-
}
|
|
85
|
-
// Setup MSW for tests
|
|
86
|
-
(0, vitest_1.beforeAll)(() => {
|
|
87
|
-
exports.server.listen({
|
|
88
|
-
onUnhandledRequest: 'error', // Throw errors for unhandled requests to catch unexpected fetch calls
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
(0, vitest_1.afterEach)(() => {
|
|
92
|
-
exports.server.resetHandlers(); // Reset handlers between tests
|
|
93
|
-
clearCapturedRequests(); // Clear captured requests between tests
|
|
94
|
-
});
|
|
95
|
-
(0, vitest_1.afterAll)(() => {
|
|
96
|
-
exports.server.close(); // Clean up after all tests
|
|
97
|
-
});
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createObsidianFetchAdapter = createObsidianFetchAdapter;
|
|
4
|
-
/**
|
|
5
|
-
* Creates a CustomFetch adapter for Obsidian's requestUrl API.
|
|
6
|
-
*
|
|
7
|
-
* This adapter bridges the gap between Obsidian's requestUrl interface and the
|
|
8
|
-
* standard fetch-like interface expected by the Todoist API SDK.
|
|
9
|
-
*
|
|
10
|
-
* Key differences handled by this adapter:
|
|
11
|
-
* - Obsidian returns response data as properties (response.json, response.text)
|
|
12
|
-
* while the SDK expects methods (response.json(), response.text())
|
|
13
|
-
* - Obsidian's requestUrl bypasses CORS restrictions that would block standard fetch
|
|
14
|
-
* - Obsidian throws on HTTP errors by default; we set throw: false to handle manually
|
|
15
|
-
* - Obsidian doesn't provide statusText; we default to empty string
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* ```typescript
|
|
19
|
-
* import { requestUrl } from 'obsidian';
|
|
20
|
-
* import { createObsidianFetchAdapter } from './obsidian-fetch-adapter';
|
|
21
|
-
*
|
|
22
|
-
* const api = new TodoistApi('your-token', {
|
|
23
|
-
* customFetch: createObsidianFetchAdapter(requestUrl)
|
|
24
|
-
* });
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @param requestUrl - The Obsidian requestUrl function
|
|
28
|
-
* @returns A CustomFetch function compatible with the Todoist API SDK
|
|
29
|
-
*/
|
|
30
|
-
function createObsidianFetchAdapter(requestUrl) {
|
|
31
|
-
return async (url, options) => {
|
|
32
|
-
// Build the request parameters in Obsidian's format
|
|
33
|
-
const requestParams = {
|
|
34
|
-
url,
|
|
35
|
-
method: (options === null || options === void 0 ? void 0 : options.method) || 'GET',
|
|
36
|
-
headers: options === null || options === void 0 ? void 0 : options.headers,
|
|
37
|
-
body: options === null || options === void 0 ? void 0 : options.body,
|
|
38
|
-
throw: false, // Don't throw on HTTP errors; let the SDK handle status codes
|
|
39
|
-
};
|
|
40
|
-
// Make the request using Obsidian's requestUrl
|
|
41
|
-
const response = await requestUrl(requestParams);
|
|
42
|
-
// Transform Obsidian's response format to match CustomFetchResponse interface
|
|
43
|
-
return {
|
|
44
|
-
ok: response.status >= 200 && response.status < 300,
|
|
45
|
-
status: response.status,
|
|
46
|
-
statusText: '', // Obsidian doesn't provide statusText
|
|
47
|
-
headers: response.headers,
|
|
48
|
-
// Wrap Obsidian's direct properties as methods returning promises
|
|
49
|
-
text: () => Promise.resolve(response.text),
|
|
50
|
-
json: () => Promise.resolve(response.json),
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_FOLDER = exports.COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = exports.COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = exports.RAW_COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = exports.COMMENT_WITH_OPTIONALS_AS_NULL_TASK = exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK = exports.INVALID_COMMENT = exports.DEFAULT_LOCATION_REMINDER = exports.DEFAULT_ABSOLUTE_REMINDER = exports.DEFAULT_RELATIVE_REMINDER = exports.DEFAULT_REMINDER_ID = exports.DEFAULT_COMMENT = exports.DEFAULT_RAW_COMMENT = exports.INVALID_ATTACHMENT = exports.DEFAULT_ATTACHMENT = exports.INVALID_USER = exports.DEFAULT_USER = exports.INVALID_LABEL = exports.DEFAULT_LABEL = exports.INVALID_SECTION = exports.DEFAULT_SECTION = exports.PROJECT_WITH_OPTIONALS_AS_NULL = exports.INVALID_PROJECT = exports.DEFAULT_PROJECT = exports.TASK_WITH_OPTIONALS_AS_NULL = exports.INVALID_TASK = exports.DEFAULT_TASK = exports.DEFAULT_DEADLINE = exports.DEFAULT_DURATION = exports.DEFAULT_DUE_DATE = exports.INVALID_ENTITY_ID = exports.DEFAULT_REQUEST_ID = exports.DEFAULT_AUTH_TOKEN = exports.DEFAULT_PROJECT_VIEW_STYLE = exports.DEFAULT_PROJECT_NAME = exports.DEFAULT_PROJECT_ID = exports.DEFAULT_ORDER = exports.DEFAULT_TASK_PRIORITY = exports.DEFAULT_TASK_DESCRIPTION = exports.DEFAULT_TASK_CONTENT = exports.DEFAULT_TASK_ID = void 0;
|
|
4
|
-
const url_helpers_1 = require("../utils/url-helpers");
|
|
5
|
-
exports.DEFAULT_TASK_ID = '1234';
|
|
6
|
-
exports.DEFAULT_TASK_CONTENT = 'This is a task';
|
|
7
|
-
exports.DEFAULT_TASK_DESCRIPTION = 'A description';
|
|
8
|
-
exports.DEFAULT_TASK_PRIORITY = 1;
|
|
9
|
-
exports.DEFAULT_ORDER = 3;
|
|
10
|
-
exports.DEFAULT_PROJECT_ID = '123';
|
|
11
|
-
exports.DEFAULT_PROJECT_NAME = 'This is a project';
|
|
12
|
-
exports.DEFAULT_PROJECT_VIEW_STYLE = 'list';
|
|
13
|
-
const DEFAULT_LABEL_ID = '456';
|
|
14
|
-
const DEFAULT_LABEL_NAME = 'This is a label';
|
|
15
|
-
const DEFAULT_SECTION_ID = '456';
|
|
16
|
-
const DEFAULT_SECTION_NAME = 'This is a section';
|
|
17
|
-
const DEFAULT_PARENT_ID = '5678';
|
|
18
|
-
const DEFAULT_ASSIGNEE = '1234';
|
|
19
|
-
const DEFAULT_CREATOR = '1234';
|
|
20
|
-
const DEFAULT_DATE = '2020-09-08T12:00:00Z';
|
|
21
|
-
const DEFAULT_ENTITY_COLOR = 'berry_red';
|
|
22
|
-
const DEFAULT_LABELS = ['personal', 'work', 'hobby'];
|
|
23
|
-
const DEFAULT_USER_ID = '5';
|
|
24
|
-
const DEFAULT_USER_NAME = 'A User';
|
|
25
|
-
const DEFAULT_USER_EMAIL = 'atestuser@doist.com';
|
|
26
|
-
const DEFAULT_COMMENT_ID = '4';
|
|
27
|
-
const DEFAULT_COMMENT_CONTENT = 'A comment';
|
|
28
|
-
const DEFAULT_COMMENT_REACTIONS = { '👍': ['1234', '5678'] };
|
|
29
|
-
const DEFAULT_CAN_ASSIGN_TASKS = true;
|
|
30
|
-
const DEFAULT_IS_ARCHIVED = false;
|
|
31
|
-
const DEFAULT_IS_DELETED = false;
|
|
32
|
-
const DEFAULT_IS_FROZEN = false;
|
|
33
|
-
const DEFAULT_IS_COLLAPSED = false;
|
|
34
|
-
// URL constants using the helper functions
|
|
35
|
-
const DEFAULT_TASK_URL = (0, url_helpers_1.getTaskUrl)(exports.DEFAULT_TASK_ID, exports.DEFAULT_TASK_CONTENT);
|
|
36
|
-
const DEFAULT_PROJECT_URL = (0, url_helpers_1.getProjectUrl)(exports.DEFAULT_PROJECT_ID, exports.DEFAULT_PROJECT_NAME);
|
|
37
|
-
const DEFAULT_SECTION_URL = (0, url_helpers_1.getSectionUrl)(DEFAULT_SECTION_ID, DEFAULT_SECTION_NAME);
|
|
38
|
-
exports.DEFAULT_AUTH_TOKEN = 'AToken';
|
|
39
|
-
exports.DEFAULT_REQUEST_ID = 'ARequestID';
|
|
40
|
-
exports.INVALID_ENTITY_ID = 1234;
|
|
41
|
-
exports.DEFAULT_DUE_DATE = {
|
|
42
|
-
isRecurring: false,
|
|
43
|
-
string: 'a date string',
|
|
44
|
-
date: DEFAULT_DATE,
|
|
45
|
-
lang: 'en',
|
|
46
|
-
timezone: null,
|
|
47
|
-
};
|
|
48
|
-
exports.DEFAULT_DURATION = {
|
|
49
|
-
amount: 10,
|
|
50
|
-
unit: 'minute',
|
|
51
|
-
};
|
|
52
|
-
exports.DEFAULT_DEADLINE = {
|
|
53
|
-
date: '2020-09-08',
|
|
54
|
-
lang: 'en',
|
|
55
|
-
};
|
|
56
|
-
exports.DEFAULT_TASK = {
|
|
57
|
-
id: exports.DEFAULT_TASK_ID,
|
|
58
|
-
userId: DEFAULT_CREATOR,
|
|
59
|
-
projectId: exports.DEFAULT_PROJECT_ID,
|
|
60
|
-
sectionId: DEFAULT_SECTION_ID,
|
|
61
|
-
parentId: DEFAULT_PARENT_ID,
|
|
62
|
-
addedByUid: DEFAULT_CREATOR,
|
|
63
|
-
assignedByUid: DEFAULT_CREATOR,
|
|
64
|
-
responsibleUid: DEFAULT_ASSIGNEE,
|
|
65
|
-
labels: DEFAULT_LABELS,
|
|
66
|
-
deadline: exports.DEFAULT_DEADLINE,
|
|
67
|
-
duration: exports.DEFAULT_DURATION,
|
|
68
|
-
checked: false,
|
|
69
|
-
isDeleted: DEFAULT_IS_DELETED,
|
|
70
|
-
addedAt: DEFAULT_DATE,
|
|
71
|
-
completedAt: null,
|
|
72
|
-
updatedAt: DEFAULT_DATE,
|
|
73
|
-
due: exports.DEFAULT_DUE_DATE,
|
|
74
|
-
priority: exports.DEFAULT_TASK_PRIORITY,
|
|
75
|
-
childOrder: exports.DEFAULT_ORDER,
|
|
76
|
-
content: exports.DEFAULT_TASK_CONTENT,
|
|
77
|
-
description: exports.DEFAULT_TASK_DESCRIPTION,
|
|
78
|
-
dayOrder: exports.DEFAULT_ORDER,
|
|
79
|
-
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
80
|
-
isUncompletable: false,
|
|
81
|
-
url: DEFAULT_TASK_URL,
|
|
82
|
-
};
|
|
83
|
-
exports.INVALID_TASK = Object.assign(Object.assign({}, exports.DEFAULT_TASK), { due: '2020-01-31' });
|
|
84
|
-
exports.TASK_WITH_OPTIONALS_AS_NULL = {
|
|
85
|
-
userId: DEFAULT_CREATOR,
|
|
86
|
-
id: exports.DEFAULT_TASK_ID,
|
|
87
|
-
projectId: exports.DEFAULT_PROJECT_ID,
|
|
88
|
-
sectionId: null,
|
|
89
|
-
parentId: null,
|
|
90
|
-
addedByUid: DEFAULT_CREATOR,
|
|
91
|
-
assignedByUid: null,
|
|
92
|
-
responsibleUid: null,
|
|
93
|
-
labels: [],
|
|
94
|
-
deadline: null,
|
|
95
|
-
duration: null,
|
|
96
|
-
checked: false,
|
|
97
|
-
isDeleted: DEFAULT_IS_DELETED,
|
|
98
|
-
addedAt: DEFAULT_DATE,
|
|
99
|
-
completedAt: null,
|
|
100
|
-
updatedAt: DEFAULT_DATE,
|
|
101
|
-
due: null,
|
|
102
|
-
priority: exports.DEFAULT_TASK_PRIORITY,
|
|
103
|
-
childOrder: exports.DEFAULT_ORDER,
|
|
104
|
-
content: exports.DEFAULT_TASK_CONTENT,
|
|
105
|
-
description: exports.DEFAULT_TASK_DESCRIPTION,
|
|
106
|
-
dayOrder: exports.DEFAULT_ORDER,
|
|
107
|
-
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
108
|
-
isUncompletable: false,
|
|
109
|
-
url: DEFAULT_TASK_URL,
|
|
110
|
-
};
|
|
111
|
-
exports.DEFAULT_PROJECT = {
|
|
112
|
-
id: exports.DEFAULT_PROJECT_ID,
|
|
113
|
-
name: exports.DEFAULT_PROJECT_NAME,
|
|
114
|
-
color: DEFAULT_ENTITY_COLOR,
|
|
115
|
-
childOrder: exports.DEFAULT_ORDER,
|
|
116
|
-
parentId: exports.DEFAULT_PROJECT_ID,
|
|
117
|
-
isFavorite: false,
|
|
118
|
-
isShared: false,
|
|
119
|
-
inboxProject: false,
|
|
120
|
-
viewStyle: exports.DEFAULT_PROJECT_VIEW_STYLE,
|
|
121
|
-
canAssignTasks: DEFAULT_CAN_ASSIGN_TASKS,
|
|
122
|
-
isArchived: DEFAULT_IS_ARCHIVED,
|
|
123
|
-
isDeleted: DEFAULT_IS_DELETED,
|
|
124
|
-
isFrozen: DEFAULT_IS_FROZEN,
|
|
125
|
-
createdAt: DEFAULT_DATE,
|
|
126
|
-
updatedAt: DEFAULT_DATE,
|
|
127
|
-
defaultOrder: exports.DEFAULT_ORDER,
|
|
128
|
-
description: '',
|
|
129
|
-
isCollapsed: DEFAULT_IS_COLLAPSED,
|
|
130
|
-
url: DEFAULT_PROJECT_URL,
|
|
131
|
-
};
|
|
132
|
-
exports.INVALID_PROJECT = Object.assign(Object.assign({}, exports.DEFAULT_PROJECT), { name: 123 });
|
|
133
|
-
exports.PROJECT_WITH_OPTIONALS_AS_NULL = Object.assign(Object.assign({}, exports.DEFAULT_PROJECT), { parentId: null });
|
|
134
|
-
exports.DEFAULT_SECTION = {
|
|
135
|
-
id: DEFAULT_SECTION_ID,
|
|
136
|
-
userId: DEFAULT_USER_ID,
|
|
137
|
-
projectId: exports.DEFAULT_PROJECT_ID,
|
|
138
|
-
addedAt: '2025-03-28T14:01:23.334881Z',
|
|
139
|
-
updatedAt: '2025-03-28T14:01:23.334885Z',
|
|
140
|
-
archivedAt: null,
|
|
141
|
-
name: DEFAULT_SECTION_NAME,
|
|
142
|
-
sectionOrder: exports.DEFAULT_ORDER,
|
|
143
|
-
isArchived: false,
|
|
144
|
-
isDeleted: false,
|
|
145
|
-
isCollapsed: false,
|
|
146
|
-
url: DEFAULT_SECTION_URL,
|
|
147
|
-
};
|
|
148
|
-
exports.INVALID_SECTION = Object.assign(Object.assign({}, exports.DEFAULT_SECTION), { projectId: undefined });
|
|
149
|
-
exports.DEFAULT_LABEL = {
|
|
150
|
-
id: DEFAULT_LABEL_ID,
|
|
151
|
-
name: DEFAULT_LABEL_NAME,
|
|
152
|
-
color: DEFAULT_ENTITY_COLOR,
|
|
153
|
-
order: exports.DEFAULT_ORDER,
|
|
154
|
-
isFavorite: false,
|
|
155
|
-
};
|
|
156
|
-
exports.INVALID_LABEL = Object.assign(Object.assign({}, exports.DEFAULT_LABEL), { isFavorite: 'true' });
|
|
157
|
-
exports.DEFAULT_USER = {
|
|
158
|
-
id: DEFAULT_USER_ID,
|
|
159
|
-
name: DEFAULT_USER_NAME,
|
|
160
|
-
email: DEFAULT_USER_EMAIL,
|
|
161
|
-
};
|
|
162
|
-
exports.INVALID_USER = Object.assign(Object.assign({}, exports.DEFAULT_USER), { email: undefined });
|
|
163
|
-
exports.DEFAULT_ATTACHMENT = {
|
|
164
|
-
resourceType: 'file',
|
|
165
|
-
fileType: 'image/png',
|
|
166
|
-
fileUrl: 'https://someurl.com/image.jpg',
|
|
167
|
-
uploadState: 'completed',
|
|
168
|
-
};
|
|
169
|
-
exports.INVALID_ATTACHMENT = Object.assign(Object.assign({}, exports.DEFAULT_ATTACHMENT), { uploadState: 'something random' });
|
|
170
|
-
exports.DEFAULT_RAW_COMMENT = {
|
|
171
|
-
id: DEFAULT_COMMENT_ID,
|
|
172
|
-
postedUid: DEFAULT_USER_ID,
|
|
173
|
-
content: DEFAULT_COMMENT_CONTENT,
|
|
174
|
-
fileAttachment: exports.DEFAULT_ATTACHMENT,
|
|
175
|
-
uidsToNotify: null,
|
|
176
|
-
isDeleted: false,
|
|
177
|
-
postedAt: DEFAULT_DATE,
|
|
178
|
-
reactions: DEFAULT_COMMENT_REACTIONS,
|
|
179
|
-
itemId: exports.DEFAULT_TASK_ID,
|
|
180
|
-
};
|
|
181
|
-
exports.DEFAULT_COMMENT = Object.assign(Object.assign({}, exports.DEFAULT_RAW_COMMENT), { taskId: exports.DEFAULT_RAW_COMMENT.itemId, itemId: undefined });
|
|
182
|
-
exports.DEFAULT_REMINDER_ID = '6XGgmFQrx44wfGHr';
|
|
183
|
-
exports.DEFAULT_RELATIVE_REMINDER = {
|
|
184
|
-
id: exports.DEFAULT_REMINDER_ID,
|
|
185
|
-
itemId: exports.DEFAULT_TASK_ID,
|
|
186
|
-
notifyUid: DEFAULT_USER_ID,
|
|
187
|
-
isDeleted: false,
|
|
188
|
-
type: 'relative',
|
|
189
|
-
minuteOffset: 30,
|
|
190
|
-
due: exports.DEFAULT_DUE_DATE,
|
|
191
|
-
isUrgent: false,
|
|
192
|
-
};
|
|
193
|
-
exports.DEFAULT_ABSOLUTE_REMINDER = {
|
|
194
|
-
id: exports.DEFAULT_REMINDER_ID,
|
|
195
|
-
itemId: exports.DEFAULT_TASK_ID,
|
|
196
|
-
notifyUid: DEFAULT_USER_ID,
|
|
197
|
-
isDeleted: false,
|
|
198
|
-
type: 'absolute',
|
|
199
|
-
due: exports.DEFAULT_DUE_DATE,
|
|
200
|
-
isUrgent: true,
|
|
201
|
-
};
|
|
202
|
-
exports.DEFAULT_LOCATION_REMINDER = {
|
|
203
|
-
id: exports.DEFAULT_REMINDER_ID,
|
|
204
|
-
itemId: exports.DEFAULT_TASK_ID,
|
|
205
|
-
notifyUid: DEFAULT_USER_ID,
|
|
206
|
-
isDeleted: false,
|
|
207
|
-
type: 'location',
|
|
208
|
-
name: 'Aliados',
|
|
209
|
-
locLat: '41.148581',
|
|
210
|
-
locLong: '-8.610945000000015',
|
|
211
|
-
locTrigger: 'on_enter',
|
|
212
|
-
radius: 100,
|
|
213
|
-
};
|
|
214
|
-
exports.INVALID_COMMENT = Object.assign(Object.assign({}, exports.DEFAULT_RAW_COMMENT), { isDeleted: 'true' });
|
|
215
|
-
exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK = Object.assign(Object.assign({}, exports.DEFAULT_RAW_COMMENT), { fileAttachment: null, uidsToNotify: null, reactions: null });
|
|
216
|
-
exports.COMMENT_WITH_OPTIONALS_AS_NULL_TASK = Object.assign(Object.assign({}, exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK), { taskId: exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_TASK.itemId, itemId: undefined });
|
|
217
|
-
exports.RAW_COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = Object.assign(Object.assign({}, exports.DEFAULT_RAW_COMMENT), { fileAttachment: {
|
|
218
|
-
resourceType: 'file',
|
|
219
|
-
fileName: null,
|
|
220
|
-
fileSize: null,
|
|
221
|
-
fileType: null,
|
|
222
|
-
fileDuration: null,
|
|
223
|
-
uploadState: null,
|
|
224
|
-
image: null,
|
|
225
|
-
imageWidth: null,
|
|
226
|
-
imageHeight: null,
|
|
227
|
-
url: null,
|
|
228
|
-
title: null,
|
|
229
|
-
} });
|
|
230
|
-
exports.COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = Object.assign(Object.assign({}, exports.RAW_COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL), { taskId: exports.RAW_COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL.itemId, itemId: undefined });
|
|
231
|
-
exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = Object.assign(Object.assign({}, exports.DEFAULT_RAW_COMMENT), { itemId: undefined, projectId: exports.DEFAULT_PROJECT_ID });
|
|
232
|
-
exports.COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = Object.assign(Object.assign({}, exports.RAW_COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT), { taskId: undefined });
|
|
233
|
-
exports.DEFAULT_FOLDER = {
|
|
234
|
-
id: '789',
|
|
235
|
-
name: 'This is a folder',
|
|
236
|
-
workspaceId: '100',
|
|
237
|
-
defaultOrder: 3,
|
|
238
|
-
childOrder: 3,
|
|
239
|
-
isDeleted: false,
|
|
240
|
-
};
|