@todoist/sdk 0.0.1 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +293 -29
- package/dist/esm/authentication.js +307 -0
- package/dist/esm/clients/activity-client.js +60 -0
- package/dist/esm/clients/app-client.js +366 -0
- package/dist/esm/clients/backup-client.js +47 -0
- package/dist/esm/clients/base-client.js +29 -0
- package/dist/esm/clients/billing-client.js +160 -0
- package/dist/esm/clients/comment-client.js +92 -0
- package/dist/esm/clients/email-client.js +41 -0
- package/dist/esm/clients/filter-client.js +26 -0
- package/dist/esm/clients/folder-client.js +80 -0
- package/dist/esm/clients/id-mapping-client.js +37 -0
- package/dist/esm/clients/insights-client.js +89 -0
- package/dist/esm/clients/label-client.js +131 -0
- package/dist/esm/clients/productivity-client.js +24 -0
- package/dist/esm/clients/project-client.js +284 -0
- package/dist/esm/clients/reminder-client.js +204 -0
- package/dist/esm/clients/section-client.js +121 -0
- package/dist/esm/clients/task-client.js +264 -0
- package/dist/esm/clients/template-client.js +89 -0
- package/dist/esm/clients/ui-extension-client.js +110 -0
- package/dist/esm/clients/upload-client.js +153 -0
- package/dist/esm/clients/view-options-client.js +21 -0
- package/dist/esm/clients/workspace-client.js +384 -0
- package/dist/esm/consts/endpoints.js +193 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/test-utils/asserts.js +8 -0
- package/dist/esm/test-utils/msw-setup.js +88 -0
- package/dist/esm/test-utils/obsidian-fetch-adapter.js +51 -0
- package/dist/esm/test-utils/test-defaults.js +367 -0
- package/dist/esm/test-utils/transport-seam.js +15 -0
- package/dist/esm/test-utils/webhook-fixtures.js +26 -0
- package/dist/esm/todoist-api.js +1757 -0
- package/dist/esm/transport/fetch-with-retry.js +216 -0
- package/dist/esm/transport/http-client.js +140 -0
- package/dist/esm/transport/http-dispatcher.js +158 -0
- package/dist/esm/transport/sync-request.js +106 -0
- package/dist/esm/types/activity/index.js +2 -0
- package/dist/esm/types/activity/requests.js +1 -0
- package/dist/esm/types/activity/types.js +45 -0
- package/dist/esm/types/apps/index.js +2 -0
- package/dist/esm/types/apps/requests.js +1 -0
- package/dist/esm/types/apps/types.js +249 -0
- package/dist/esm/types/backups/index.js +2 -0
- package/dist/esm/types/backups/requests.js +1 -0
- package/dist/esm/types/backups/types.js +5 -0
- package/dist/esm/types/billing/index.js +2 -0
- package/dist/esm/types/billing/requests.js +1 -0
- package/dist/esm/types/billing/types.js +89 -0
- package/dist/esm/types/comments/index.js +2 -0
- package/dist/esm/types/comments/requests.js +1 -0
- package/dist/esm/types/comments/types.js +57 -0
- package/dist/esm/types/common.js +7 -0
- package/dist/esm/types/emails/index.js +1 -0
- package/dist/esm/types/emails/requests.js +2 -0
- package/dist/esm/types/errors.js +41 -0
- package/dist/esm/types/folders/index.js +1 -0
- package/dist/esm/types/folders/requests.js +1 -0
- package/dist/esm/types/http.js +20 -0
- package/dist/esm/types/id-mappings/index.js +2 -0
- package/dist/esm/types/id-mappings/requests.js +17 -0
- package/dist/esm/types/id-mappings/types.js +9 -0
- package/dist/esm/types/index.js +24 -0
- package/dist/esm/types/insights/index.js +2 -0
- package/dist/esm/types/insights/requests.js +1 -0
- package/dist/esm/types/insights/types.js +77 -0
- package/dist/esm/types/labels/index.js +2 -0
- package/dist/esm/types/labels/requests.js +1 -0
- package/dist/esm/types/labels/types.js +8 -0
- package/dist/esm/types/productivity/index.js +1 -0
- package/dist/esm/types/productivity/types.js +65 -0
- package/dist/esm/types/projects/index.js +2 -0
- package/dist/esm/types/projects/requests.js +1 -0
- package/dist/esm/types/projects/types.js +65 -0
- package/dist/esm/types/reminders/index.js +1 -0
- package/dist/esm/types/reminders/requests.js +92 -0
- package/dist/esm/types/sections/index.js +2 -0
- package/dist/esm/types/sections/requests.js +1 -0
- package/dist/esm/types/sections/types.js +23 -0
- package/dist/esm/types/sync/commands/calendars.js +1 -0
- package/dist/esm/types/sync/commands/filters.js +1 -0
- package/dist/esm/types/sync/commands/folders.js +1 -0
- package/dist/esm/types/sync/commands/index.js +18 -0
- package/dist/esm/types/sync/commands/labels.js +2 -0
- package/dist/esm/types/sync/commands/notes.js +1 -0
- package/dist/esm/types/sync/commands/notifications.js +1 -0
- package/dist/esm/types/sync/commands/others.js +1 -0
- package/dist/esm/types/sync/commands/project-view-options.js +1 -0
- package/dist/esm/types/sync/commands/projects.js +1 -0
- package/dist/esm/types/sync/commands/reminders.js +1 -0
- package/dist/esm/types/sync/commands/sections.js +1 -0
- package/dist/esm/types/sync/commands/shared.js +16 -0
- package/dist/esm/types/sync/commands/sharing.js +1 -0
- package/dist/esm/types/sync/commands/tasks.js +1 -0
- package/dist/esm/types/sync/commands/view-options.js +1 -0
- package/dist/esm/types/sync/commands/workspace-filters.js +1 -0
- package/dist/esm/types/sync/commands/workspaces.js +1 -0
- package/dist/esm/types/sync/index.js +6 -0
- package/dist/esm/types/sync/request.js +1 -0
- package/dist/esm/types/sync/resource-types.js +36 -0
- package/dist/esm/types/sync/resources/calendars.js +24 -0
- package/dist/esm/types/sync/resources/collaborators.js +21 -0
- package/dist/esm/types/sync/resources/completed-info.js +21 -0
- package/dist/esm/types/sync/resources/filters.js +12 -0
- package/dist/esm/types/sync/resources/folders.js +10 -0
- package/dist/esm/types/sync/resources/index.js +18 -0
- package/dist/esm/types/sync/resources/labels.js +7 -0
- package/dist/esm/types/sync/resources/live-notifications.js +35 -0
- package/dist/esm/types/sync/resources/notes.js +18 -0
- package/dist/esm/types/sync/resources/reminders.js +58 -0
- package/dist/esm/types/sync/resources/suggestions.js +33 -0
- package/dist/esm/types/sync/resources/tooltips.js +5 -0
- package/dist/esm/types/sync/resources/user-plan-limits.js +21 -0
- package/dist/esm/types/sync/resources/user-settings.js +41 -0
- package/dist/esm/types/sync/resources/user-status.js +22 -0
- package/dist/esm/types/sync/resources/user.js +109 -0
- package/dist/esm/types/sync/resources/view-options.js +128 -0
- package/dist/esm/types/sync/resources/workspace-filters.js +17 -0
- package/dist/esm/types/sync/resources/workspaces.js +69 -0
- package/dist/esm/types/sync/response.js +57 -0
- package/dist/esm/types/sync/user-preferences.js +68 -0
- package/dist/esm/types/tasks/index.js +2 -0
- package/dist/esm/types/tasks/requests.js +1 -0
- package/dist/esm/types/tasks/types.js +56 -0
- package/dist/esm/types/templates/index.js +1 -0
- package/dist/esm/types/templates/requests.js +1 -0
- package/dist/esm/types/ui-extensions/index.js +2 -0
- package/dist/esm/types/ui-extensions/requests.js +1 -0
- package/dist/esm/types/ui-extensions/types.js +74 -0
- package/dist/esm/types/uploads/index.js +1 -0
- package/dist/esm/types/uploads/requests.js +1 -0
- package/dist/esm/types/users/index.js +1 -0
- package/dist/esm/types/users/types.js +49 -0
- package/dist/esm/types/webhooks/comments.js +93 -0
- package/dist/esm/types/webhooks/envelope.js +23 -0
- package/dist/esm/types/webhooks/filters.js +27 -0
- package/dist/esm/types/webhooks/index.js +9 -0
- package/dist/esm/types/webhooks/labels.js +51 -0
- package/dist/esm/types/webhooks/projects.js +33 -0
- package/dist/esm/types/webhooks/reminders.js +32 -0
- package/dist/esm/types/webhooks/sections.js +50 -0
- package/dist/esm/types/webhooks/tasks.js +65 -0
- package/dist/esm/types/webhooks/types.js +52 -0
- package/dist/esm/types/workspaces/index.js +2 -0
- package/dist/esm/types/workspaces/requests.js +1 -0
- package/dist/esm/types/workspaces/types.js +151 -0
- package/dist/esm/utils/activity-helpers.js +53 -0
- package/dist/esm/utils/case-conversion.js +84 -0
- package/dist/esm/utils/colors.js +145 -0
- package/dist/esm/utils/file-response.js +29 -0
- package/dist/esm/utils/filter-queries.js +231 -0
- package/dist/esm/utils/filter-query-definitions.js +2789 -0
- package/dist/esm/utils/headers.js +42 -0
- package/dist/esm/utils/index.js +11 -0
- package/dist/esm/utils/multipart-upload.js +267 -0
- package/dist/esm/utils/person-names.js +61 -0
- package/dist/esm/utils/processing-helpers.js +12 -0
- package/dist/esm/utils/project-helpers.js +29 -0
- package/dist/esm/utils/request-helpers.js +43 -0
- package/dist/esm/utils/sanitization.js +131 -0
- package/dist/esm/utils/sync-helpers.js +19 -0
- package/dist/esm/utils/task-sorting.js +280 -0
- package/dist/esm/utils/uncompletable-helpers.js +54 -0
- package/dist/esm/utils/url-helpers.js +196 -0
- package/dist/esm/utils/validators.js +102 -0
- package/dist/esm/utils/view-options.js +15 -0
- package/dist/esm/utils/webhook-parser.js +56 -0
- package/dist/types/authentication.d.ts +262 -0
- package/dist/types/clients/activity-client.d.ts +12 -0
- package/dist/types/clients/app-client.d.ts +37 -0
- package/dist/types/clients/backup-client.d.ts +14 -0
- package/dist/types/clients/base-client.d.ts +23 -0
- package/dist/types/clients/billing-client.d.ts +22 -0
- package/dist/types/clients/comment-client.d.ts +15 -0
- package/dist/types/clients/email-client.d.ts +13 -0
- package/dist/types/clients/filter-client.d.ts +10 -0
- package/dist/types/clients/folder-client.d.ts +16 -0
- package/dist/types/clients/id-mapping-client.d.ts +13 -0
- package/dist/types/clients/insights-client.d.ts +18 -0
- package/dist/types/clients/label-client.d.ts +19 -0
- package/dist/types/clients/productivity-client.d.ts +12 -0
- package/dist/types/clients/project-client.d.ts +22 -0
- package/dist/types/clients/reminder-client.d.ts +25 -0
- package/dist/types/clients/section-client.d.ts +18 -0
- package/dist/types/clients/task-client.d.ts +25 -0
- package/dist/types/clients/template-client.d.ts +17 -0
- package/dist/types/clients/ui-extension-client.d.ts +18 -0
- package/dist/types/clients/upload-client.d.ts +17 -0
- package/dist/types/clients/view-options-client.d.ts +8 -0
- package/dist/types/clients/workspace-client.d.ts +43 -0
- package/dist/types/consts/endpoints.d.ts +120 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/test-utils/asserts.d.ts +1 -0
- package/dist/types/test-utils/msw-setup.d.ts +33 -0
- package/dist/types/test-utils/obsidian-fetch-adapter.d.ts +29 -0
- package/dist/types/test-utils/test-defaults.d.ts +286 -0
- package/dist/types/test-utils/transport-seam.d.ts +1 -0
- package/dist/types/test-utils/webhook-fixtures.d.ts +13 -0
- package/dist/types/todoist-api.d.ts +1437 -0
- package/dist/types/transport/fetch-with-retry.d.ts +12 -0
- package/dist/types/transport/http-client.d.ts +25 -0
- package/dist/types/transport/http-dispatcher.d.ts +65 -0
- package/dist/types/transport/sync-request.d.ts +31 -0
- package/dist/types/types/activity/index.d.ts +2 -0
- package/dist/types/types/activity/requests.d.ts +85 -0
- package/dist/types/types/activity/types.d.ts +56 -0
- package/dist/types/types/apps/index.d.ts +2 -0
- package/dist/types/types/apps/requests.d.ts +89 -0
- package/dist/types/types/apps/types.d.ts +418 -0
- package/dist/types/types/backups/index.d.ts +2 -0
- package/dist/types/types/backups/requests.d.ts +16 -0
- package/dist/types/types/backups/types.d.ts +7 -0
- package/dist/types/types/billing/index.d.ts +2 -0
- package/dist/types/types/billing/requests.d.ts +62 -0
- package/dist/types/types/billing/types.d.ts +207 -0
- package/dist/types/types/comments/index.d.ts +2 -0
- package/dist/types/types/comments/requests.d.ts +64 -0
- package/dist/types/types/comments/types.d.ts +141 -0
- package/dist/types/types/common.d.ts +13 -0
- package/dist/types/types/emails/index.d.ts +1 -0
- package/dist/types/types/emails/requests.d.ts +30 -0
- package/dist/types/types/errors.d.ts +29 -0
- package/dist/types/types/folders/index.d.ts +1 -0
- package/dist/types/types/folders/requests.d.ts +20 -0
- package/dist/types/types/http.d.ts +104 -0
- package/dist/types/types/id-mappings/index.d.ts +2 -0
- package/dist/types/types/id-mappings/requests.d.ts +28 -0
- package/dist/types/types/id-mappings/types.d.ts +13 -0
- package/dist/types/types/index.d.ts +24 -0
- package/dist/types/types/insights/index.d.ts +2 -0
- package/dist/types/types/insights/requests.d.ts +26 -0
- package/dist/types/types/insights/types.d.ts +167 -0
- package/dist/types/types/labels/index.d.ts +2 -0
- package/dist/types/types/labels/requests.d.ts +75 -0
- package/dist/types/types/labels/types.d.ts +13 -0
- package/dist/types/types/productivity/index.d.ts +1 -0
- package/dist/types/types/productivity/types.d.ts +115 -0
- package/dist/types/types/projects/index.d.ts +2 -0
- package/dist/types/types/projects/requests.d.ts +206 -0
- package/dist/types/types/projects/types.d.ts +286 -0
- package/dist/types/types/reminders/index.d.ts +1 -0
- package/dist/types/types/reminders/requests.d.ts +205 -0
- package/dist/types/types/sections/index.d.ts +2 -0
- package/dist/types/types/sections/requests.d.ts +49 -0
- package/dist/types/types/sections/types.d.ts +70 -0
- package/dist/types/types/sync/commands/calendars.d.ts +14 -0
- package/dist/types/types/sync/commands/filters.d.ts +24 -0
- package/dist/types/types/sync/commands/folders.d.ts +20 -0
- package/dist/types/types/sync/commands/index.d.ts +167 -0
- package/dist/types/types/sync/commands/labels.d.ts +32 -0
- package/dist/types/types/sync/commands/notes.d.ts +27 -0
- package/dist/types/types/sync/commands/notifications.d.ts +10 -0
- package/dist/types/types/sync/commands/others.d.ts +61 -0
- package/dist/types/types/sync/commands/project-view-options.d.ts +13 -0
- package/dist/types/types/sync/commands/projects.d.ts +96 -0
- package/dist/types/types/sync/commands/reminders.d.ts +51 -0
- package/dist/types/types/sync/commands/sections.d.ts +36 -0
- package/dist/types/types/sync/commands/shared.d.ts +51 -0
- package/dist/types/types/sync/commands/sharing.d.ts +16 -0
- package/dist/types/types/sync/commands/tasks.d.ts +78 -0
- package/dist/types/types/sync/commands/view-options.d.ts +18 -0
- package/dist/types/types/sync/commands/workspace-filters.d.ts +25 -0
- package/dist/types/types/sync/commands/workspaces.d.ts +82 -0
- package/dist/types/types/sync/index.d.ts +6 -0
- package/dist/types/types/sync/request.d.ts +7 -0
- package/dist/types/types/sync/resource-types.d.ts +5 -0
- package/dist/types/types/sync/resources/calendars.d.ts +38 -0
- package/dist/types/types/sync/resources/collaborators.d.ts +45 -0
- package/dist/types/types/sync/resources/completed-info.d.ts +33 -0
- package/dist/types/types/sync/resources/filters.d.ts +13 -0
- package/dist/types/types/sync/resources/folders.d.ts +11 -0
- package/dist/types/types/sync/resources/index.d.ts +18 -0
- package/dist/types/types/sync/resources/labels.d.ts +12 -0
- package/dist/types/types/sync/resources/live-notifications.d.ts +32 -0
- package/dist/types/types/sync/resources/notes.d.ts +34 -0
- package/dist/types/types/sync/resources/reminders.d.ts +213 -0
- package/dist/types/types/sync/resources/suggestions.d.ts +96 -0
- package/dist/types/types/sync/resources/tooltips.d.ts +6 -0
- package/dist/types/types/sync/resources/user-plan-limits.d.ts +47 -0
- package/dist/types/types/sync/resources/user-settings.d.ts +40 -0
- package/dist/types/types/sync/resources/user-status.d.ts +46 -0
- package/dist/types/types/sync/resources/user.d.ts +151 -0
- package/dist/types/types/sync/resources/view-options.d.ts +157 -0
- package/dist/types/types/sync/resources/workspace-filters.d.ts +18 -0
- package/dist/types/types/sync/resources/workspaces.d.ts +142 -0
- package/dist/types/types/sync/response.d.ts +930 -0
- package/dist/types/types/sync/user-preferences.d.ts +39 -0
- package/dist/types/types/tasks/index.d.ts +2 -0
- package/dist/types/types/tasks/requests.d.ts +197 -0
- package/dist/types/types/tasks/types.d.ts +162 -0
- package/dist/types/types/templates/index.d.ts +1 -0
- package/dist/types/types/templates/requests.d.ts +92 -0
- package/dist/types/types/ui-extensions/index.d.ts +2 -0
- package/dist/types/types/ui-extensions/requests.d.ts +108 -0
- package/dist/types/types/ui-extensions/types.d.ts +185 -0
- package/dist/types/types/uploads/index.d.ts +1 -0
- package/dist/types/types/uploads/requests.d.ts +32 -0
- package/dist/types/types/users/index.d.ts +1 -0
- package/dist/types/types/users/types.d.ts +67 -0
- package/dist/types/types/webhooks/comments.d.ts +1600 -0
- package/dist/types/types/webhooks/envelope.d.ts +34 -0
- package/dist/types/types/webhooks/filters.d.ts +99 -0
- package/dist/types/types/webhooks/index.d.ts +9 -0
- package/dist/types/types/webhooks/labels.d.ts +160 -0
- package/dist/types/types/webhooks/projects.d.ts +365 -0
- package/dist/types/types/webhooks/reminders.d.ts +82 -0
- package/dist/types/types/webhooks/sections.d.ts +372 -0
- package/dist/types/types/webhooks/tasks.d.ts +981 -0
- package/dist/types/types/webhooks/types.d.ts +2606 -0
- package/dist/types/types/workspaces/index.d.ts +2 -0
- package/dist/types/types/workspaces/requests.d.ts +260 -0
- package/dist/types/types/workspaces/types.d.ts +266 -0
- package/dist/types/utils/activity-helpers.d.ts +28 -0
- package/dist/types/utils/case-conversion.d.ts +20 -0
- package/dist/types/utils/colors.d.ts +201 -0
- package/dist/types/utils/file-response.d.ts +15 -0
- package/dist/types/utils/filter-queries.d.ts +42 -0
- package/dist/types/utils/filter-query-definitions.d.ts +27 -0
- package/dist/types/utils/headers.d.ts +20 -0
- package/dist/types/utils/index.d.ts +15 -0
- package/dist/types/utils/multipart-upload.d.ts +58 -0
- package/dist/types/utils/person-names.d.ts +52 -0
- package/dist/types/utils/processing-helpers.d.ts +1 -0
- package/dist/types/utils/project-helpers.d.ts +21 -0
- package/dist/types/utils/request-helpers.d.ts +33 -0
- package/dist/types/utils/sanitization.d.ts +52 -0
- package/dist/types/utils/sync-helpers.d.ts +17 -0
- package/dist/types/utils/task-sorting.d.ts +46 -0
- package/dist/types/utils/uncompletable-helpers.d.ts +30 -0
- package/dist/types/utils/url-helpers.d.ts +120 -0
- package/dist/types/utils/validators.d.ts +1917 -0
- package/dist/types/utils/view-options.d.ts +11 -0
- package/dist/types/utils/webhook-parser.d.ts +48 -0
- package/package.json +87 -8
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Available statuses for a developer application.
|
|
4
|
+
*/
|
|
5
|
+
export declare const APP_STATUSES: readonly ["public"];
|
|
6
|
+
/**
|
|
7
|
+
* Status of a developer application.
|
|
8
|
+
*/
|
|
9
|
+
export type AppStatus = (typeof APP_STATUSES)[number];
|
|
10
|
+
export declare const AppStatusSchema: z.ZodEnum<{
|
|
11
|
+
public: "public";
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Webhook event types that can be subscribed to.
|
|
15
|
+
*
|
|
16
|
+
* These are the friendly public names the backend uses in webhook payloads.
|
|
17
|
+
* The on-the-wire config endpoint uses a different (legacy) form (see
|
|
18
|
+
* {@link WEBHOOK_EVENT_WIRE_NAMES}); the SDK converts between the two
|
|
19
|
+
* so consumers only ever work with these pretty names.
|
|
20
|
+
*
|
|
21
|
+
* @see https://developer.todoist.com/sync/v1/#webhooks
|
|
22
|
+
*/
|
|
23
|
+
export declare const WEBHOOK_EVENTS: readonly ["item:added", "item:updated", "item:completed", "item:uncompleted", "item:deleted", "note:added", "note:updated", "note:deleted", "project:added", "project:updated", "project:deleted", "project:archived", "project:unarchived", "section:added", "section:updated", "section:deleted", "section:archived", "section:unarchived", "label:added", "label:updated", "label:deleted", "filter:added", "filter:updated", "filter:deleted", "reminder:fired"];
|
|
24
|
+
/**
|
|
25
|
+
* A webhook event that can be subscribed to.
|
|
26
|
+
*/
|
|
27
|
+
export type WebhookEvent = (typeof WEBHOOK_EVENTS)[number];
|
|
28
|
+
export declare const WebhookEventSchema: z.ZodEnum<{
|
|
29
|
+
"project:added": "project:added";
|
|
30
|
+
"project:updated": "project:updated";
|
|
31
|
+
"project:deleted": "project:deleted";
|
|
32
|
+
"project:archived": "project:archived";
|
|
33
|
+
"project:unarchived": "project:unarchived";
|
|
34
|
+
"item:added": "item:added";
|
|
35
|
+
"item:updated": "item:updated";
|
|
36
|
+
"item:completed": "item:completed";
|
|
37
|
+
"item:uncompleted": "item:uncompleted";
|
|
38
|
+
"item:deleted": "item:deleted";
|
|
39
|
+
"note:added": "note:added";
|
|
40
|
+
"note:updated": "note:updated";
|
|
41
|
+
"note:deleted": "note:deleted";
|
|
42
|
+
"section:added": "section:added";
|
|
43
|
+
"section:updated": "section:updated";
|
|
44
|
+
"section:deleted": "section:deleted";
|
|
45
|
+
"section:archived": "section:archived";
|
|
46
|
+
"section:unarchived": "section:unarchived";
|
|
47
|
+
"label:added": "label:added";
|
|
48
|
+
"label:updated": "label:updated";
|
|
49
|
+
"label:deleted": "label:deleted";
|
|
50
|
+
"filter:added": "filter:added";
|
|
51
|
+
"filter:updated": "filter:updated";
|
|
52
|
+
"filter:deleted": "filter:deleted";
|
|
53
|
+
"reminder:fired": "reminder:fired";
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* Raw wire-format webhook event names used by the config endpoint
|
|
57
|
+
* (`POST/GET /apps/<id>/webhook`). Exported for completeness — prefer
|
|
58
|
+
* {@link WEBHOOK_EVENTS} when working with the SDK.
|
|
59
|
+
*/
|
|
60
|
+
export declare const WEBHOOK_EVENT_WIRE_NAMES: readonly ["e_item_added", "e_item_updated", "e_item_completed", "e_item_uncompleted", "e_item_deleted", "e_note_added", "e_note_updated", "e_note_deleted", "e_project_added", "e_project_updated", "e_project_deleted", "e_project_archived", "e_project_unarchived", "e_section_added", "e_section_updated", "e_section_deleted", "e_section_archived", "e_section_unarchived", "e_label_added", "e_label_updated", "e_label_deleted", "e_filter_added", "e_filter_updated", "e_filter_deleted", "e_reminder_fired"];
|
|
61
|
+
/**
|
|
62
|
+
* Wire-format webhook event name (the `e_*` form).
|
|
63
|
+
*/
|
|
64
|
+
export type WebhookEventWireName = (typeof WEBHOOK_EVENT_WIRE_NAMES)[number];
|
|
65
|
+
export declare const WebhookEventWireNameSchema: z.ZodEnum<{
|
|
66
|
+
e_item_added: "e_item_added";
|
|
67
|
+
e_item_updated: "e_item_updated";
|
|
68
|
+
e_item_completed: "e_item_completed";
|
|
69
|
+
e_item_uncompleted: "e_item_uncompleted";
|
|
70
|
+
e_item_deleted: "e_item_deleted";
|
|
71
|
+
e_note_added: "e_note_added";
|
|
72
|
+
e_note_updated: "e_note_updated";
|
|
73
|
+
e_note_deleted: "e_note_deleted";
|
|
74
|
+
e_project_added: "e_project_added";
|
|
75
|
+
e_project_updated: "e_project_updated";
|
|
76
|
+
e_project_deleted: "e_project_deleted";
|
|
77
|
+
e_project_archived: "e_project_archived";
|
|
78
|
+
e_project_unarchived: "e_project_unarchived";
|
|
79
|
+
e_section_added: "e_section_added";
|
|
80
|
+
e_section_updated: "e_section_updated";
|
|
81
|
+
e_section_deleted: "e_section_deleted";
|
|
82
|
+
e_section_archived: "e_section_archived";
|
|
83
|
+
e_section_unarchived: "e_section_unarchived";
|
|
84
|
+
e_label_added: "e_label_added";
|
|
85
|
+
e_label_updated: "e_label_updated";
|
|
86
|
+
e_label_deleted: "e_label_deleted";
|
|
87
|
+
e_filter_added: "e_filter_added";
|
|
88
|
+
e_filter_updated: "e_filter_updated";
|
|
89
|
+
e_filter_deleted: "e_filter_deleted";
|
|
90
|
+
e_reminder_fired: "e_reminder_fired";
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* Translates a wire-format event name (`'e_item_added'`) to its pretty form (`'item:added'`).
|
|
94
|
+
*/
|
|
95
|
+
export declare function webhookEventFromWireName(wireName: WebhookEventWireName): WebhookEvent;
|
|
96
|
+
/**
|
|
97
|
+
* Translates a pretty event name (`'item:added'`) to its wire-format form (`'e_item_added'`).
|
|
98
|
+
*/
|
|
99
|
+
export declare function webhookEventToWireName(event: WebhookEvent): WebhookEventWireName;
|
|
100
|
+
/**
|
|
101
|
+
* Available statuses for an app webhook.
|
|
102
|
+
*/
|
|
103
|
+
export declare const WEBHOOK_STATUSES: readonly ["active", "invalid"];
|
|
104
|
+
/**
|
|
105
|
+
* Delivery status of an app webhook.
|
|
106
|
+
*/
|
|
107
|
+
export type WebhookStatus = (typeof WEBHOOK_STATUSES)[number];
|
|
108
|
+
export declare const WebhookStatusSchema: z.ZodEnum<{
|
|
109
|
+
active: "active";
|
|
110
|
+
invalid: "invalid";
|
|
111
|
+
}>;
|
|
112
|
+
/**
|
|
113
|
+
* Supported webhook payload versions. v9 is deprecated and intentionally excluded.
|
|
114
|
+
*/
|
|
115
|
+
export declare const WEBHOOK_VERSIONS: readonly ["1"];
|
|
116
|
+
/**
|
|
117
|
+
* Webhook payload version.
|
|
118
|
+
*/
|
|
119
|
+
export type WebhookVersion = (typeof WEBHOOK_VERSIONS)[number];
|
|
120
|
+
export declare const WebhookVersionSchema: z.ZodEnum<{
|
|
121
|
+
1: "1";
|
|
122
|
+
}>;
|
|
123
|
+
/**
|
|
124
|
+
* Available installation types for an app installation.
|
|
125
|
+
*/
|
|
126
|
+
export declare const INSTALLATION_TYPES: readonly ["user"];
|
|
127
|
+
/**
|
|
128
|
+
* Scope of an app installation.
|
|
129
|
+
*/
|
|
130
|
+
export type InstallationType = (typeof INSTALLATION_TYPES)[number];
|
|
131
|
+
export declare const InstallationTypeSchema: z.ZodEnum<{
|
|
132
|
+
user: "user";
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* Transforms a comma-separated scope string into `string[] | null`.
|
|
136
|
+
*
|
|
137
|
+
* The backend stores `app_token_scopes` as a single comma-separated string
|
|
138
|
+
* (e.g. `"data:read,task:add"`). Reads are exposed as `string[]` (rather than
|
|
139
|
+
* `Permission[]`) so that newly added backend scopes don't break parsing —
|
|
140
|
+
* writes accept `Permission` for autocomplete while still permitting `string`
|
|
141
|
+
* (via `UpdateAppArgs`), so a fetched `App.appTokenScopes` can be round-tripped
|
|
142
|
+
* back into `updateApp()` without casts.
|
|
143
|
+
*
|
|
144
|
+
* Preserves `null` on read (backend returns `null` for apps that have had
|
|
145
|
+
* their scopes cleared via `updateApp({ appTokenScopes: null })`) so the
|
|
146
|
+
* read and write shapes line up and information is not lost.
|
|
147
|
+
*/
|
|
148
|
+
export declare const AppTokenScopesSchema: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
|
|
149
|
+
/**
|
|
150
|
+
* Schema for a developer application.
|
|
151
|
+
* @see https://developer.todoist.com/api/v1/#tag/Apps
|
|
152
|
+
*/
|
|
153
|
+
export declare const AppSchema: z.ZodObject<{
|
|
154
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
155
|
+
clientId: z.ZodString;
|
|
156
|
+
status: z.ZodEnum<{
|
|
157
|
+
public: "public";
|
|
158
|
+
}>;
|
|
159
|
+
displayName: z.ZodString;
|
|
160
|
+
userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
161
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
162
|
+
serviceUrl: z.ZodNullable<z.ZodString>;
|
|
163
|
+
oauthRedirectUri: z.ZodNullable<z.ZodString>;
|
|
164
|
+
description: z.ZodNullable<z.ZodString>;
|
|
165
|
+
iconSm: z.ZodNullable<z.ZodString>;
|
|
166
|
+
iconMd: z.ZodNullable<z.ZodString>;
|
|
167
|
+
iconLg: z.ZodNullable<z.ZodString>;
|
|
168
|
+
appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
|
|
169
|
+
}, z.core.$strip>;
|
|
170
|
+
/**
|
|
171
|
+
* A developer application.
|
|
172
|
+
*/
|
|
173
|
+
export type App = z.infer<typeof AppSchema>;
|
|
174
|
+
/**
|
|
175
|
+
* Schema for a developer application that includes the user count.
|
|
176
|
+
* Returned by most endpoints that manage a single app (get, update, delete).
|
|
177
|
+
*/
|
|
178
|
+
export declare const AppWithUserCountSchema: z.ZodObject<{
|
|
179
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
180
|
+
clientId: z.ZodString;
|
|
181
|
+
status: z.ZodEnum<{
|
|
182
|
+
public: "public";
|
|
183
|
+
}>;
|
|
184
|
+
displayName: z.ZodString;
|
|
185
|
+
userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
186
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
187
|
+
serviceUrl: z.ZodNullable<z.ZodString>;
|
|
188
|
+
oauthRedirectUri: z.ZodNullable<z.ZodString>;
|
|
189
|
+
description: z.ZodNullable<z.ZodString>;
|
|
190
|
+
iconSm: z.ZodNullable<z.ZodString>;
|
|
191
|
+
iconMd: z.ZodNullable<z.ZodString>;
|
|
192
|
+
iconLg: z.ZodNullable<z.ZodString>;
|
|
193
|
+
appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
|
|
194
|
+
userCount: z.ZodNumber;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
/**
|
|
197
|
+
* A developer application with authorized user count.
|
|
198
|
+
*/
|
|
199
|
+
export type AppWithUserCount = z.infer<typeof AppWithUserCountSchema>;
|
|
200
|
+
/**
|
|
201
|
+
* OAuth client credentials for a developer application.
|
|
202
|
+
*/
|
|
203
|
+
export declare const AppSecretsSchema: z.ZodObject<{
|
|
204
|
+
clientId: z.ZodString;
|
|
205
|
+
clientSecret: z.ZodString;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
/**
|
|
208
|
+
* OAuth client credentials for a developer application.
|
|
209
|
+
*/
|
|
210
|
+
export type AppSecrets = z.infer<typeof AppSecretsSchema>;
|
|
211
|
+
/**
|
|
212
|
+
* Webhook verification token for a developer application.
|
|
213
|
+
*/
|
|
214
|
+
export declare const AppVerificationTokenSchema: z.ZodObject<{
|
|
215
|
+
verificationToken: z.ZodString;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
/**
|
|
218
|
+
* Webhook verification token for a developer application.
|
|
219
|
+
*/
|
|
220
|
+
export type AppVerificationToken = z.infer<typeof AppVerificationTokenSchema>;
|
|
221
|
+
/**
|
|
222
|
+
* Developer test access token for a developer application.
|
|
223
|
+
*/
|
|
224
|
+
export declare const AppTestTokenSchema: z.ZodObject<{
|
|
225
|
+
accessToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
/**
|
|
228
|
+
* Developer test access token for a developer application.
|
|
229
|
+
*/
|
|
230
|
+
export type AppTestToken = z.infer<typeof AppTestTokenSchema>;
|
|
231
|
+
/**
|
|
232
|
+
* Distribution token for a developer application.
|
|
233
|
+
*/
|
|
234
|
+
export declare const AppDistributionTokenSchema: z.ZodObject<{
|
|
235
|
+
distributionToken: z.ZodString;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
/**
|
|
238
|
+
* Distribution token for a developer application.
|
|
239
|
+
*/
|
|
240
|
+
export type AppDistributionToken = z.infer<typeof AppDistributionTokenSchema>;
|
|
241
|
+
/**
|
|
242
|
+
* Subset of an app returned when resolving by distribution token — used by the installation flow.
|
|
243
|
+
* Includes a lightweight list of the app's UI extensions (not full `UIExtension` records).
|
|
244
|
+
*/
|
|
245
|
+
export declare const AppByDistributionTokenUiExtensionSchema: z.ZodObject<{
|
|
246
|
+
name: z.ZodString;
|
|
247
|
+
description: z.ZodString;
|
|
248
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
249
|
+
extensionType: z.ZodEnum<{
|
|
250
|
+
"context-menu": "context-menu";
|
|
251
|
+
composer: "composer";
|
|
252
|
+
settings: "settings";
|
|
253
|
+
}>;
|
|
254
|
+
}, z.core.$strip>;
|
|
255
|
+
/**
|
|
256
|
+
* UI extension metadata returned by the `by_distribution_token` endpoint.
|
|
257
|
+
*/
|
|
258
|
+
export type AppByDistributionTokenUiExtension = z.infer<typeof AppByDistributionTokenUiExtensionSchema>;
|
|
259
|
+
export declare const AppByDistributionTokenSchema: z.ZodObject<{
|
|
260
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
261
|
+
displayName: z.ZodString;
|
|
262
|
+
description: z.ZodNullable<z.ZodString>;
|
|
263
|
+
iconMd: z.ZodNullable<z.ZodString>;
|
|
264
|
+
appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
|
|
265
|
+
uiExtensions: z.ZodArray<z.ZodObject<{
|
|
266
|
+
name: z.ZodString;
|
|
267
|
+
description: z.ZodString;
|
|
268
|
+
icon: z.ZodNullable<z.ZodString>;
|
|
269
|
+
extensionType: z.ZodEnum<{
|
|
270
|
+
"context-menu": "context-menu";
|
|
271
|
+
composer: "composer";
|
|
272
|
+
settings: "settings";
|
|
273
|
+
}>;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
}, z.core.$strip>;
|
|
276
|
+
/**
|
|
277
|
+
* Public-facing app info resolved via distribution token — used during installation.
|
|
278
|
+
*/
|
|
279
|
+
export type AppByDistributionToken = z.infer<typeof AppByDistributionTokenSchema>;
|
|
280
|
+
/**
|
|
281
|
+
* Schema for an app webhook.
|
|
282
|
+
*
|
|
283
|
+
* Events arrive from the wire in their `e_*` form and are transformed to
|
|
284
|
+
* their pretty `item:added`-style names for SDK consumers.
|
|
285
|
+
*/
|
|
286
|
+
export declare const AppWebhookSchema: z.ZodObject<{
|
|
287
|
+
status: z.ZodEnum<{
|
|
288
|
+
active: "active";
|
|
289
|
+
invalid: "invalid";
|
|
290
|
+
}>;
|
|
291
|
+
callbackUrl: z.ZodString;
|
|
292
|
+
version: z.ZodEnum<{
|
|
293
|
+
1: "1";
|
|
294
|
+
}>;
|
|
295
|
+
events: z.ZodArray<z.ZodPipe<z.ZodEnum<{
|
|
296
|
+
e_item_added: "e_item_added";
|
|
297
|
+
e_item_updated: "e_item_updated";
|
|
298
|
+
e_item_completed: "e_item_completed";
|
|
299
|
+
e_item_uncompleted: "e_item_uncompleted";
|
|
300
|
+
e_item_deleted: "e_item_deleted";
|
|
301
|
+
e_note_added: "e_note_added";
|
|
302
|
+
e_note_updated: "e_note_updated";
|
|
303
|
+
e_note_deleted: "e_note_deleted";
|
|
304
|
+
e_project_added: "e_project_added";
|
|
305
|
+
e_project_updated: "e_project_updated";
|
|
306
|
+
e_project_deleted: "e_project_deleted";
|
|
307
|
+
e_project_archived: "e_project_archived";
|
|
308
|
+
e_project_unarchived: "e_project_unarchived";
|
|
309
|
+
e_section_added: "e_section_added";
|
|
310
|
+
e_section_updated: "e_section_updated";
|
|
311
|
+
e_section_deleted: "e_section_deleted";
|
|
312
|
+
e_section_archived: "e_section_archived";
|
|
313
|
+
e_section_unarchived: "e_section_unarchived";
|
|
314
|
+
e_label_added: "e_label_added";
|
|
315
|
+
e_label_updated: "e_label_updated";
|
|
316
|
+
e_label_deleted: "e_label_deleted";
|
|
317
|
+
e_filter_added: "e_filter_added";
|
|
318
|
+
e_filter_updated: "e_filter_updated";
|
|
319
|
+
e_filter_deleted: "e_filter_deleted";
|
|
320
|
+
e_reminder_fired: "e_reminder_fired";
|
|
321
|
+
}>, z.ZodTransform<"project:added" | "project:updated" | "project:deleted" | "project:archived" | "project:unarchived" | "item:added" | "item:updated" | "item:completed" | "item:uncompleted" | "item:deleted" | "note:added" | "note:updated" | "note:deleted" | "section:added" | "section:updated" | "section:deleted" | "section:archived" | "section:unarchived" | "label:added" | "label:updated" | "label:deleted" | "filter:added" | "filter:updated" | "filter:deleted" | "reminder:fired", "e_item_added" | "e_item_updated" | "e_item_completed" | "e_item_uncompleted" | "e_item_deleted" | "e_note_added" | "e_note_updated" | "e_note_deleted" | "e_project_added" | "e_project_updated" | "e_project_deleted" | "e_project_archived" | "e_project_unarchived" | "e_section_added" | "e_section_updated" | "e_section_deleted" | "e_section_archived" | "e_section_unarchived" | "e_label_added" | "e_label_updated" | "e_label_deleted" | "e_filter_added" | "e_filter_updated" | "e_filter_deleted" | "e_reminder_fired">>>;
|
|
322
|
+
}, z.core.$strip>;
|
|
323
|
+
/**
|
|
324
|
+
* Webhook configuration for a developer application.
|
|
325
|
+
*/
|
|
326
|
+
export type AppWebhook = z.infer<typeof AppWebhookSchema>;
|
|
327
|
+
/**
|
|
328
|
+
* Lightweight view of an app embedded in an installation record.
|
|
329
|
+
* Mirrors `AppSchema` shape — backend returns the same `ApplicationRestView`.
|
|
330
|
+
*/
|
|
331
|
+
export declare const InstalledIntegrationSchema: z.ZodObject<{
|
|
332
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
333
|
+
clientId: z.ZodString;
|
|
334
|
+
status: z.ZodEnum<{
|
|
335
|
+
public: "public";
|
|
336
|
+
}>;
|
|
337
|
+
displayName: z.ZodString;
|
|
338
|
+
userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
339
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
340
|
+
serviceUrl: z.ZodNullable<z.ZodString>;
|
|
341
|
+
oauthRedirectUri: z.ZodNullable<z.ZodString>;
|
|
342
|
+
description: z.ZodNullable<z.ZodString>;
|
|
343
|
+
iconSm: z.ZodNullable<z.ZodString>;
|
|
344
|
+
iconMd: z.ZodNullable<z.ZodString>;
|
|
345
|
+
iconLg: z.ZodNullable<z.ZodString>;
|
|
346
|
+
appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
|
|
347
|
+
}, z.core.$strip>;
|
|
348
|
+
/**
|
|
349
|
+
* Embedded app info on an installation record.
|
|
350
|
+
*/
|
|
351
|
+
export type InstalledIntegration = z.infer<typeof InstalledIntegrationSchema>;
|
|
352
|
+
/**
|
|
353
|
+
* Schema for an installed application (integration installed to a user's account).
|
|
354
|
+
*/
|
|
355
|
+
export declare const AppInstallationSchema: z.ZodObject<{
|
|
356
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
357
|
+
creator: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
358
|
+
createdTs: z.ZodNumber;
|
|
359
|
+
installationType: z.ZodEnum<{
|
|
360
|
+
user: "user";
|
|
361
|
+
}>;
|
|
362
|
+
appTokenScopesValidated: z.ZodBoolean;
|
|
363
|
+
integration: z.ZodNullable<z.ZodObject<{
|
|
364
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
365
|
+
clientId: z.ZodString;
|
|
366
|
+
status: z.ZodEnum<{
|
|
367
|
+
public: "public";
|
|
368
|
+
}>;
|
|
369
|
+
displayName: z.ZodString;
|
|
370
|
+
userId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
371
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
372
|
+
serviceUrl: z.ZodNullable<z.ZodString>;
|
|
373
|
+
oauthRedirectUri: z.ZodNullable<z.ZodString>;
|
|
374
|
+
description: z.ZodNullable<z.ZodString>;
|
|
375
|
+
iconSm: z.ZodNullable<z.ZodString>;
|
|
376
|
+
iconMd: z.ZodNullable<z.ZodString>;
|
|
377
|
+
iconLg: z.ZodNullable<z.ZodString>;
|
|
378
|
+
appTokenScopes: z.ZodPipe<z.ZodNullable<z.ZodString>, z.ZodTransform<string[] | null, string | null>>;
|
|
379
|
+
}, z.core.$strip>>;
|
|
380
|
+
}, z.core.$strip>;
|
|
381
|
+
/**
|
|
382
|
+
* Installation of a developer application on a user's account.
|
|
383
|
+
*/
|
|
384
|
+
export type AppInstallation = z.infer<typeof AppInstallationSchema>;
|
|
385
|
+
/**
|
|
386
|
+
* Lightweight app info included on a user authorization record.
|
|
387
|
+
*/
|
|
388
|
+
export declare const UserAuthorizationAppSchema: z.ZodObject<{
|
|
389
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
390
|
+
displayName: z.ZodString;
|
|
391
|
+
description: z.ZodNullable<z.ZodString>;
|
|
392
|
+
serviceUrl: z.ZodNullable<z.ZodString>;
|
|
393
|
+
iconMd: z.ZodNullable<z.ZodString>;
|
|
394
|
+
}, z.core.$strip>;
|
|
395
|
+
/**
|
|
396
|
+
* App info attached to a user authorization entry.
|
|
397
|
+
*/
|
|
398
|
+
export type UserAuthorizationApp = z.infer<typeof UserAuthorizationAppSchema>;
|
|
399
|
+
/**
|
|
400
|
+
* Schema for a user authorization entry — a token the user has granted to a third-party app.
|
|
401
|
+
*/
|
|
402
|
+
export declare const UserAuthorizationSchema: z.ZodObject<{
|
|
403
|
+
accessTokenId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
404
|
+
scope: z.ZodArray<z.ZodString>;
|
|
405
|
+
scopeDescriptions: z.ZodArray<z.ZodString>;
|
|
406
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
407
|
+
app: z.ZodNullable<z.ZodObject<{
|
|
408
|
+
id: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
409
|
+
displayName: z.ZodString;
|
|
410
|
+
description: z.ZodNullable<z.ZodString>;
|
|
411
|
+
serviceUrl: z.ZodNullable<z.ZodString>;
|
|
412
|
+
iconMd: z.ZodNullable<z.ZodString>;
|
|
413
|
+
}, z.core.$strip>>;
|
|
414
|
+
}, z.core.$strip>;
|
|
415
|
+
/**
|
|
416
|
+
* A user authorization entry (access token granted to a third-party app).
|
|
417
|
+
*/
|
|
418
|
+
export type UserAuthorization = z.infer<typeof UserAuthorizationSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arguments for listing backups.
|
|
3
|
+
* @see https://developer.todoist.com/api/v1/#tag/Backups/operation/get_backups_api_v1_backups_get
|
|
4
|
+
*/
|
|
5
|
+
export type GetBackupsArgs = {
|
|
6
|
+
/** MFA token if required. Not needed when using an OAuth token with the `backups:read` scope. */
|
|
7
|
+
mfaToken?: string | null;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Arguments for downloading a backup.
|
|
11
|
+
* @see https://developer.todoist.com/api/v1/#tag/Backups/operation/download_backup_api_v1_backups_download_get
|
|
12
|
+
*/
|
|
13
|
+
export type DownloadBackupArgs = {
|
|
14
|
+
/** The backup file URL. */
|
|
15
|
+
file: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { BillingCycle } from './types.js';
|
|
2
|
+
/** Arguments for cancelling the current plan. */
|
|
3
|
+
export type CancelPlanArgs = {
|
|
4
|
+
/** Short identifier of the cancellation reason category. */
|
|
5
|
+
reasonFlag?: string;
|
|
6
|
+
/** Human-readable label of the cancellation reason. */
|
|
7
|
+
reasonDescription?: string;
|
|
8
|
+
/** Free-form feedback from the user about the cancellation. */
|
|
9
|
+
reasonText?: string;
|
|
10
|
+
/** URL the user is redirected to after completing the flow. */
|
|
11
|
+
returnUrl?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Common arguments for any Stripe checkout (upgrade or trial) request. */
|
|
14
|
+
export type CheckoutArgs = {
|
|
15
|
+
currency: string;
|
|
16
|
+
billingCycle: BillingCycle;
|
|
17
|
+
successUrl: string;
|
|
18
|
+
cancelUrl: string;
|
|
19
|
+
};
|
|
20
|
+
/** Optional promotion/partnership attribution shared by upgrade requests. */
|
|
21
|
+
export type UpgradeOptions = {
|
|
22
|
+
promotionCode?: string | null;
|
|
23
|
+
partnershipId?: string | null;
|
|
24
|
+
};
|
|
25
|
+
/** Arguments for upgrading to a Pro plan. */
|
|
26
|
+
export type UpgradeToProArgs = CheckoutArgs & UpgradeOptions & {
|
|
27
|
+
trialPeriodDays?: number | null;
|
|
28
|
+
};
|
|
29
|
+
/** Arguments for starting a Pro trial. */
|
|
30
|
+
export type StartProTrialArgs = CheckoutArgs;
|
|
31
|
+
/** Arguments for opening the Pro billing portal. */
|
|
32
|
+
export type ProBillingPortalArgs = {
|
|
33
|
+
returnUrl: string;
|
|
34
|
+
flowType?: string | null;
|
|
35
|
+
promotionCode?: string | null;
|
|
36
|
+
};
|
|
37
|
+
/** Arguments for upgrading a workspace. */
|
|
38
|
+
export type UpgradeWorkspaceArgs = CheckoutArgs & UpgradeOptions & {
|
|
39
|
+
workspaceId: string;
|
|
40
|
+
};
|
|
41
|
+
/** Arguments for starting a workspace trial. */
|
|
42
|
+
export type StartWorkspaceTrialArgs = CheckoutArgs & {
|
|
43
|
+
workspaceId: string;
|
|
44
|
+
};
|
|
45
|
+
/** Arguments for opening the workspace billing portal. */
|
|
46
|
+
export type WorkspaceBillingPortalArgs = {
|
|
47
|
+
workspaceId: string;
|
|
48
|
+
returnUrl: string;
|
|
49
|
+
flowType?: string | null;
|
|
50
|
+
};
|
|
51
|
+
/** Arguments for fetching pricing. */
|
|
52
|
+
export type GetPricingArgs = {
|
|
53
|
+
formatted?: boolean;
|
|
54
|
+
};
|
|
55
|
+
/** Response containing a Stripe checkout session URL. */
|
|
56
|
+
export type CheckoutSessionResponse = {
|
|
57
|
+
checkoutSessionUrl: string;
|
|
58
|
+
};
|
|
59
|
+
/** Response containing a Stripe billing portal URL. */
|
|
60
|
+
export type BillingPortalUrlResponse = {
|
|
61
|
+
billingPortalUrl: string;
|
|
62
|
+
};
|