@doist/todoist-api-typescript 7.5.0 → 7.6.1
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/dist/cjs/authentication.js +46 -2
- package/dist/cjs/consts/endpoints.js +54 -2
- package/dist/cjs/todoist-api.js +524 -6
- package/dist/cjs/types/activity/index.js +18 -0
- package/dist/cjs/types/activity/requests.js +2 -0
- package/dist/cjs/types/activity/types.js +28 -0
- package/dist/cjs/types/backups/index.js +18 -0
- package/dist/cjs/types/backups/requests.js +2 -0
- package/dist/cjs/types/backups/types.js +8 -0
- package/dist/cjs/types/comments/index.js +18 -0
- package/dist/cjs/types/comments/requests.js +2 -0
- package/dist/cjs/types/comments/types.js +60 -0
- package/dist/cjs/types/common.js +2 -0
- package/dist/cjs/types/emails/index.js +17 -0
- package/dist/cjs/types/emails/requests.js +5 -0
- package/dist/cjs/types/id-mappings/index.js +18 -0
- package/dist/cjs/types/id-mappings/requests.js +20 -0
- package/dist/cjs/types/id-mappings/types.js +12 -0
- package/dist/cjs/types/index.js +16 -2
- package/dist/cjs/types/insights/index.js +18 -0
- package/dist/cjs/types/insights/requests.js +2 -0
- package/dist/cjs/types/insights/types.js +84 -0
- package/dist/cjs/types/labels/index.js +18 -0
- package/dist/cjs/types/labels/requests.js +2 -0
- package/dist/cjs/types/labels/types.js +11 -0
- package/dist/cjs/types/productivity/index.js +17 -0
- package/dist/cjs/types/productivity/types.js +67 -0
- package/dist/cjs/types/projects/index.js +18 -0
- package/dist/cjs/types/projects/requests.js +2 -0
- package/dist/cjs/types/projects/types.js +56 -0
- package/dist/cjs/types/reminders/index.js +17 -0
- package/dist/cjs/types/sections/index.js +18 -0
- package/dist/cjs/types/sections/requests.js +2 -0
- package/dist/cjs/types/sections/types.js +22 -0
- package/dist/cjs/types/sync/commands/shared.js +2 -2
- package/dist/cjs/types/sync/resources/collaborators.js +2 -2
- package/dist/cjs/types/sync/resources/notes.js +2 -2
- package/dist/cjs/types/sync/resources/reminders.js +3 -3
- package/dist/cjs/types/sync/resources/user.js +2 -2
- package/dist/cjs/types/sync/resources/workspaces.js +5 -5
- package/dist/cjs/types/tasks/index.js +18 -0
- package/dist/cjs/types/tasks/requests.js +2 -0
- package/dist/cjs/types/tasks/types.js +59 -0
- package/dist/cjs/types/templates/index.js +17 -0
- package/dist/cjs/types/templates/requests.js +2 -0
- package/dist/cjs/types/uploads/index.js +17 -0
- package/dist/cjs/types/uploads/requests.js +2 -0
- package/dist/cjs/types/users/index.js +17 -0
- package/dist/cjs/types/users/types.js +51 -0
- package/dist/cjs/types/workspaces/index.js +18 -0
- package/dist/cjs/types/workspaces/requests.js +2 -0
- package/dist/cjs/types/workspaces/types.js +137 -0
- package/dist/cjs/utils/validators.js +47 -19
- package/dist/esm/authentication.js +46 -3
- package/dist/esm/consts/endpoints.js +43 -0
- package/dist/esm/todoist-api.js +522 -4
- package/dist/esm/types/activity/index.js +2 -0
- package/dist/esm/types/activity/requests.js +1 -0
- package/dist/esm/types/activity/types.js +25 -0
- package/dist/esm/types/backups/index.js +2 -0
- package/dist/esm/types/backups/requests.js +1 -0
- package/dist/esm/types/backups/types.js +5 -0
- package/dist/esm/types/comments/index.js +2 -0
- package/dist/esm/types/comments/requests.js +1 -0
- package/dist/esm/types/comments/types.js +57 -0
- package/dist/esm/types/common.js +1 -0
- package/dist/esm/types/emails/index.js +1 -0
- package/dist/esm/types/emails/requests.js +2 -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 +16 -2
- package/dist/esm/types/insights/index.js +2 -0
- package/dist/esm/types/insights/requests.js +1 -0
- package/dist/esm/types/insights/types.js +81 -0
- package/dist/esm/types/labels/index.js +2 -0
- package/dist/esm/types/labels/requests.js +1 -0
- package/dist/esm/types/labels/types.js +8 -0
- package/dist/esm/types/productivity/index.js +1 -0
- package/dist/esm/types/productivity/types.js +64 -0
- package/dist/esm/types/projects/index.js +2 -0
- package/dist/esm/types/projects/requests.js +1 -0
- package/dist/esm/types/projects/types.js +53 -0
- package/dist/esm/types/reminders/index.js +1 -0
- package/dist/esm/types/sections/index.js +2 -0
- package/dist/esm/types/sections/requests.js +1 -0
- package/dist/esm/types/sections/types.js +19 -0
- package/dist/esm/types/sync/commands/shared.js +1 -1
- package/dist/esm/types/sync/resources/collaborators.js +1 -1
- package/dist/esm/types/sync/resources/notes.js +1 -1
- package/dist/esm/types/sync/resources/reminders.js +1 -1
- package/dist/esm/types/sync/resources/user.js +1 -1
- package/dist/esm/types/sync/resources/workspaces.js +1 -1
- package/dist/esm/types/tasks/index.js +2 -0
- package/dist/esm/types/tasks/requests.js +1 -0
- package/dist/esm/types/tasks/types.js +56 -0
- package/dist/esm/types/templates/index.js +1 -0
- package/dist/esm/types/templates/requests.js +1 -0
- package/dist/esm/types/uploads/index.js +1 -0
- package/dist/esm/types/uploads/requests.js +1 -0
- package/dist/esm/types/users/index.js +1 -0
- package/dist/esm/types/users/types.js +48 -0
- package/dist/esm/types/workspaces/index.js +2 -0
- package/dist/esm/types/workspaces/requests.js +1 -0
- package/dist/esm/types/workspaces/types.js +134 -0
- package/dist/esm/utils/validators.js +30 -2
- package/dist/types/authentication.d.ts +51 -6
- package/dist/types/consts/endpoints.d.ts +22 -0
- package/dist/types/test-utils/test-defaults.d.ts +5 -5
- package/dist/types/todoist-api.d.ts +209 -4
- package/dist/types/types/activity/index.d.ts +2 -0
- package/dist/types/types/activity/requests.d.ts +85 -0
- package/dist/types/types/activity/types.d.ts +49 -0
- package/dist/types/types/backups/index.d.ts +2 -0
- package/dist/types/types/backups/requests.d.ts +16 -0
- package/dist/types/types/backups/types.d.ts +7 -0
- package/dist/types/types/comments/index.d.ts +2 -0
- package/dist/types/types/comments/requests.d.ts +63 -0
- package/dist/types/types/comments/types.d.ts +141 -0
- package/dist/types/types/common.d.ts +6 -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/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 +16 -2
- package/dist/types/types/insights/index.d.ts +2 -0
- package/dist/types/types/insights/requests.d.ts +26 -0
- package/dist/types/types/insights/types.d.ts +186 -0
- package/dist/types/types/labels/index.d.ts +2 -0
- package/dist/types/types/labels/requests.d.ts +75 -0
- package/dist/types/types/labels/types.d.ts +13 -0
- package/dist/types/types/productivity/index.d.ts +1 -0
- package/dist/types/types/productivity/types.d.ts +115 -0
- package/dist/types/types/projects/index.d.ts +2 -0
- package/dist/types/types/projects/requests.d.ts +169 -0
- package/dist/types/types/projects/types.d.ts +201 -0
- package/dist/types/types/reminders/index.d.ts +1 -0
- package/dist/types/types/reminders/requests.d.ts +91 -0
- package/dist/types/types/sections/index.d.ts +2 -0
- package/dist/types/types/sections/requests.d.ts +41 -0
- package/dist/types/types/sections/types.d.ts +44 -0
- package/dist/types/types/sync/commands/projects.d.ts +2 -1
- package/dist/types/types/sync/commands/shared.d.ts +2 -2
- package/dist/types/types/sync/commands/workspaces.d.ts +1 -1
- package/dist/types/types/sync/resources/notes.d.ts +1 -1
- package/dist/types/types/sync/resources/user.d.ts +2 -2
- package/dist/types/types/sync/resources/view-options.d.ts +5 -5
- package/dist/types/types/sync/response.d.ts +5 -1
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/types/tasks/index.d.ts +2 -0
- package/dist/types/types/tasks/requests.d.ts +197 -0
- package/dist/types/types/tasks/types.d.ts +162 -0
- package/dist/types/types/templates/index.d.ts +1 -0
- package/dist/types/types/templates/requests.d.ts +92 -0
- package/dist/types/types/uploads/index.d.ts +1 -0
- package/dist/types/types/uploads/requests.d.ts +32 -0
- package/dist/types/types/users/index.d.ts +1 -0
- package/dist/types/types/users/types.d.ts +66 -0
- package/dist/types/types/workspaces/index.d.ts +2 -0
- package/dist/types/types/workspaces/requests.d.ts +260 -0
- package/dist/types/types/workspaces/types.d.ts +225 -0
- package/dist/types/utils/colors.d.ts +1 -1
- package/dist/types/utils/validators.d.ts +205 -12
- package/package.json +1 -1
- package/dist/cjs/types/entities.js +0 -437
- package/dist/esm/types/entities.js +0 -434
- package/dist/types/types/entities.d.ts +0 -971
- package/dist/types/types/requests.d.ts +0 -856
- /package/dist/cjs/types/{requests.js → reminders/requests.js} +0 -0
- /package/dist/esm/types/{requests.js → reminders/requests.js} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ActivityEvent, ActivityObjectEventType } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Common arguments for retrieving activity logs (excluding filter-type params).
|
|
4
|
+
*/
|
|
5
|
+
type GetActivityLogsArgsCommon = {
|
|
6
|
+
/**
|
|
7
|
+
* Filter by the ID of a specific object.
|
|
8
|
+
*/
|
|
9
|
+
objectId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Filter events by parent project ID.
|
|
12
|
+
*/
|
|
13
|
+
parentProjectId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Filter events by parent task ID.
|
|
16
|
+
*/
|
|
17
|
+
parentItemId?: string;
|
|
18
|
+
/**
|
|
19
|
+
* When true, includes the parent object data in the response.
|
|
20
|
+
*/
|
|
21
|
+
includeParentObject?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* When true, includes child object data in the response.
|
|
24
|
+
*/
|
|
25
|
+
includeChildObjects?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Filter by the user ID who initiated the event.
|
|
28
|
+
*/
|
|
29
|
+
initiatorId?: string;
|
|
30
|
+
/**
|
|
31
|
+
* When true, filters for events with no initiator (system-generated events).
|
|
32
|
+
* When false, filters for events with an initiator.
|
|
33
|
+
* When null or undefined, no filtering on initiator is applied.
|
|
34
|
+
*/
|
|
35
|
+
initiatorIdNull?: boolean | null;
|
|
36
|
+
/**
|
|
37
|
+
* When true, ensures the last state of objects is included in the response.
|
|
38
|
+
*/
|
|
39
|
+
ensureLastState?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* When true, includes comment annotations in the response.
|
|
42
|
+
*/
|
|
43
|
+
annotateNotes?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* When true, includes parent object annotations in the response.
|
|
46
|
+
*/
|
|
47
|
+
annotateParents?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Pagination cursor for retrieving the next page of results.
|
|
50
|
+
*/
|
|
51
|
+
cursor?: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum number of results to return per page.
|
|
54
|
+
*/
|
|
55
|
+
limit?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Start date for filtering events (inclusive). Replaces deprecated `since`.
|
|
58
|
+
* Accepts a Date object or YYYY-MM-DD string.
|
|
59
|
+
*/
|
|
60
|
+
dateFrom?: Date | string;
|
|
61
|
+
/**
|
|
62
|
+
* End date for filtering events (inclusive). Replaces deprecated `until`.
|
|
63
|
+
* Accepts a Date object or YYYY-MM-DD string.
|
|
64
|
+
*/
|
|
65
|
+
dateTo?: Date | string;
|
|
66
|
+
};
|
|
67
|
+
export type GetActivityLogsArgs = GetActivityLogsArgsCommon & {
|
|
68
|
+
objectEventTypes?: ActivityObjectEventType | ActivityObjectEventType[];
|
|
69
|
+
/** @removed Use `objectEventTypes` instead. */
|
|
70
|
+
objectType?: never;
|
|
71
|
+
/** @removed Use `objectEventTypes` instead. */
|
|
72
|
+
eventType?: never;
|
|
73
|
+
/** @removed Use `dateFrom` instead. */
|
|
74
|
+
since?: never;
|
|
75
|
+
/** @removed Use `dateTo` instead. */
|
|
76
|
+
until?: never;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Response from retrieving activity logs.
|
|
80
|
+
*/
|
|
81
|
+
export type GetActivityLogsResponse = {
|
|
82
|
+
results: ActivityEvent[];
|
|
83
|
+
nextCursor: string | null;
|
|
84
|
+
};
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Type hints for known object types. Accepts any string for forward compatibility.
|
|
4
|
+
*/
|
|
5
|
+
export type ActivityObjectType = 'task' | 'comment' | 'project' | (string & Record<string, never>);
|
|
6
|
+
/**
|
|
7
|
+
* Type hints for known event types. Accepts any string for forward compatibility.
|
|
8
|
+
*/
|
|
9
|
+
export type ActivityEventType = 'added' | 'updated' | 'deleted' | 'completed' | 'uncompleted' | 'archived' | 'unarchived' | 'shared' | 'left' | (string & Record<string, never>);
|
|
10
|
+
type ModernActivityObjectType = 'task' | 'comment' | 'project' | (string & Record<string, never>);
|
|
11
|
+
/**
|
|
12
|
+
* Combined object:event filter string for the `objectEventTypes` parameter of `getActivityLogs`.
|
|
13
|
+
*
|
|
14
|
+
* Uses modern object type names (`task`, `comment`) rather than legacy API names (`item`, `note`).
|
|
15
|
+
* Either part may be omitted:
|
|
16
|
+
* - `'task:added'` — task additions only
|
|
17
|
+
* - `'task:'` — all events for tasks
|
|
18
|
+
* - `':deleted'` — all deleted events across all object types
|
|
19
|
+
*
|
|
20
|
+
* The final `string & Record<string, never>` member allows any arbitrary string
|
|
21
|
+
* to be passed for forward compatibility, while still providing autocomplete for
|
|
22
|
+
* the known combinations above.
|
|
23
|
+
*/
|
|
24
|
+
export type ActivityObjectEventType = `${ModernActivityObjectType}:${ActivityEventType}` | `${ModernActivityObjectType}:` | `:${ActivityEventType}` | (string & Record<string, never>);
|
|
25
|
+
/**
|
|
26
|
+
* Flexible object containing event-specific data.
|
|
27
|
+
* Uses z.record to accept any properties for forward compatibility.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ActivityEventExtraDataSchema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
30
|
+
export type ActivityEventExtraData = z.infer<typeof ActivityEventExtraDataSchema>;
|
|
31
|
+
/**
|
|
32
|
+
* Activity log event schema. Accepts unknown fields for forward compatibility.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ActivityEventSchema: z.ZodObject<{
|
|
35
|
+
objectType: z.ZodString;
|
|
36
|
+
objectId: z.ZodString;
|
|
37
|
+
eventType: z.ZodString;
|
|
38
|
+
eventDate: z.ZodString;
|
|
39
|
+
id: z.ZodNullable<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>>;
|
|
40
|
+
parentProjectId: z.ZodNullable<z.ZodString>;
|
|
41
|
+
parentItemId: z.ZodNullable<z.ZodString>;
|
|
42
|
+
initiatorId: z.ZodNullable<z.ZodString>;
|
|
43
|
+
extraData: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
44
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
45
|
+
/**
|
|
46
|
+
* Represents an activity log event in Todoist.
|
|
47
|
+
*/
|
|
48
|
+
export type ActivityEvent = z.infer<typeof ActivityEventSchema>;
|
|
49
|
+
export {};
|
|
@@ -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,63 @@
|
|
|
1
|
+
import type { RequireExactlyOne } from 'type-fest';
|
|
2
|
+
import type { Comment } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for retrieving comments.
|
|
5
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
6
|
+
*/
|
|
7
|
+
export type GetCommentsArgs = {
|
|
8
|
+
taskId: string;
|
|
9
|
+
projectId?: never;
|
|
10
|
+
cursor?: string | null;
|
|
11
|
+
limit?: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Arguments for retrieving task comments.
|
|
15
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
16
|
+
*/
|
|
17
|
+
export type GetTaskCommentsArgs = {
|
|
18
|
+
taskId: string;
|
|
19
|
+
projectId?: never;
|
|
20
|
+
cursor?: string | null;
|
|
21
|
+
limit?: number;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Arguments for retrieving project comments.
|
|
25
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
26
|
+
*/
|
|
27
|
+
export type GetProjectCommentsArgs = {
|
|
28
|
+
projectId: string;
|
|
29
|
+
taskId?: never;
|
|
30
|
+
cursor?: string | null;
|
|
31
|
+
limit?: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Response from retrieving comments.
|
|
35
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/get_comments_api_v1_comments_get
|
|
36
|
+
*/
|
|
37
|
+
export type GetCommentsResponse = {
|
|
38
|
+
results: Comment[];
|
|
39
|
+
nextCursor: string | null;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Arguments for creating a new comment.
|
|
43
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/create_comment_api_v1_comments_post
|
|
44
|
+
*/
|
|
45
|
+
export type AddCommentArgs = {
|
|
46
|
+
content: string;
|
|
47
|
+
attachment?: {
|
|
48
|
+
fileName?: string;
|
|
49
|
+
fileUrl: string;
|
|
50
|
+
fileType?: string;
|
|
51
|
+
resourceType?: string;
|
|
52
|
+
} | null;
|
|
53
|
+
} & RequireExactlyOne<{
|
|
54
|
+
taskId?: string;
|
|
55
|
+
projectId?: string;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Arguments for updating a comment.
|
|
59
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments/operation/update_comment_api_v1_comments__comment_id__post
|
|
60
|
+
*/
|
|
61
|
+
export type UpdateCommentArgs = {
|
|
62
|
+
content: string;
|
|
63
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Available file attachment upload states. */
|
|
3
|
+
export declare const UPLOAD_STATES: readonly ["pending", "completed"];
|
|
4
|
+
/** Upload state of a file attachment. */
|
|
5
|
+
export type UploadState = (typeof UPLOAD_STATES)[number];
|
|
6
|
+
export declare const AttachmentSchema: z.ZodObject<{
|
|
7
|
+
resourceType: z.ZodString;
|
|
8
|
+
fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
fileSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10
|
+
fileType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
fileUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
fileDuration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
13
|
+
uploadState: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
14
|
+
completed: "completed";
|
|
15
|
+
pending: "pending";
|
|
16
|
+
}>>>;
|
|
17
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
18
|
+
imageWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
|
+
imageHeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
/**
|
|
24
|
+
* Represents a file attachment in a comment.
|
|
25
|
+
* @see https://developer.todoist.com/api/v1/#tag/Sync/Comments/File-Attachments
|
|
26
|
+
*/
|
|
27
|
+
export type Attachment = z.infer<typeof AttachmentSchema>;
|
|
28
|
+
export declare const RawCommentSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
32
|
+
content: z.ZodString;
|
|
33
|
+
postedAt: z.ZodString;
|
|
34
|
+
fileAttachment: z.ZodNullable<z.ZodObject<{
|
|
35
|
+
resourceType: z.ZodString;
|
|
36
|
+
fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
37
|
+
fileSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
38
|
+
fileType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
39
|
+
fileUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
40
|
+
fileDuration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
41
|
+
uploadState: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
42
|
+
completed: "completed";
|
|
43
|
+
pending: "pending";
|
|
44
|
+
}>>>;
|
|
45
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
imageWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
47
|
+
imageHeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
48
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
49
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
postedUid: z.ZodString;
|
|
52
|
+
uidsToNotify: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
53
|
+
reactions: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
54
|
+
isDeleted: z.ZodBoolean;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
/**
|
|
57
|
+
* Represents a raw comment response from the API.
|
|
58
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments
|
|
59
|
+
*/
|
|
60
|
+
export type RawComment = z.infer<typeof RawCommentSchema>;
|
|
61
|
+
export declare const CommentSchema: z.ZodPipe<z.ZodObject<{
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
64
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
content: z.ZodString;
|
|
66
|
+
postedAt: z.ZodString;
|
|
67
|
+
fileAttachment: z.ZodNullable<z.ZodObject<{
|
|
68
|
+
resourceType: z.ZodString;
|
|
69
|
+
fileName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
fileSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
71
|
+
fileType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
fileUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
73
|
+
fileDuration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
74
|
+
uploadState: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
75
|
+
completed: "completed";
|
|
76
|
+
pending: "pending";
|
|
77
|
+
}>>>;
|
|
78
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
imageWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
80
|
+
imageHeight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
81
|
+
url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
postedUid: z.ZodString;
|
|
85
|
+
uidsToNotify: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
86
|
+
reactions: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
87
|
+
isDeleted: z.ZodBoolean;
|
|
88
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
89
|
+
taskId: string | undefined;
|
|
90
|
+
id: string;
|
|
91
|
+
content: string;
|
|
92
|
+
postedAt: string;
|
|
93
|
+
fileAttachment: {
|
|
94
|
+
resourceType: string;
|
|
95
|
+
fileName?: string | null | undefined;
|
|
96
|
+
fileSize?: number | null | undefined;
|
|
97
|
+
fileType?: string | null | undefined;
|
|
98
|
+
fileUrl?: string | null | undefined;
|
|
99
|
+
fileDuration?: number | null | undefined;
|
|
100
|
+
uploadState?: "completed" | "pending" | null | undefined;
|
|
101
|
+
image?: string | null | undefined;
|
|
102
|
+
imageWidth?: number | null | undefined;
|
|
103
|
+
imageHeight?: number | null | undefined;
|
|
104
|
+
url?: string | null | undefined;
|
|
105
|
+
title?: string | null | undefined;
|
|
106
|
+
} | null;
|
|
107
|
+
postedUid: string;
|
|
108
|
+
uidsToNotify: string[] | null;
|
|
109
|
+
reactions: Record<string, string[]> | null;
|
|
110
|
+
isDeleted: boolean;
|
|
111
|
+
projectId?: string | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
id: string;
|
|
114
|
+
content: string;
|
|
115
|
+
postedAt: string;
|
|
116
|
+
fileAttachment: {
|
|
117
|
+
resourceType: string;
|
|
118
|
+
fileName?: string | null | undefined;
|
|
119
|
+
fileSize?: number | null | undefined;
|
|
120
|
+
fileType?: string | null | undefined;
|
|
121
|
+
fileUrl?: string | null | undefined;
|
|
122
|
+
fileDuration?: number | null | undefined;
|
|
123
|
+
uploadState?: "completed" | "pending" | null | undefined;
|
|
124
|
+
image?: string | null | undefined;
|
|
125
|
+
imageWidth?: number | null | undefined;
|
|
126
|
+
imageHeight?: number | null | undefined;
|
|
127
|
+
url?: string | null | undefined;
|
|
128
|
+
title?: string | null | undefined;
|
|
129
|
+
} | null;
|
|
130
|
+
postedUid: string;
|
|
131
|
+
uidsToNotify: string[] | null;
|
|
132
|
+
reactions: Record<string, string[]> | null;
|
|
133
|
+
isDeleted: boolean;
|
|
134
|
+
itemId?: string | undefined;
|
|
135
|
+
projectId?: string | undefined;
|
|
136
|
+
}>>;
|
|
137
|
+
/**
|
|
138
|
+
* Represents a comment in Todoist.
|
|
139
|
+
* @see https://developer.todoist.com/api/v1/#tag/Comments
|
|
140
|
+
*/
|
|
141
|
+
export type Comment = z.infer<typeof CommentSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './requests.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Object types that support email forwarding. */
|
|
2
|
+
export declare const EMAIL_OBJECT_TYPES: readonly ["project", "project_comments", "task"];
|
|
3
|
+
/** Object type that supports email forwarding. */
|
|
4
|
+
export type EmailObjectType = (typeof EMAIL_OBJECT_TYPES)[number];
|
|
5
|
+
/**
|
|
6
|
+
* Arguments for getting or creating an email forwarding address.
|
|
7
|
+
* @see https://developer.todoist.com/api/v1/#tag/Emails/operation/email_get_or_create_api_v1_emails_put
|
|
8
|
+
*/
|
|
9
|
+
export type GetOrCreateEmailArgs = {
|
|
10
|
+
/** The type of object to forward emails to. */
|
|
11
|
+
objType: EmailObjectType;
|
|
12
|
+
/** The ID of the object. */
|
|
13
|
+
objId: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Response from getting or creating an email forwarding address.
|
|
17
|
+
*/
|
|
18
|
+
export type GetOrCreateEmailResponse = {
|
|
19
|
+
email: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Arguments for disabling email forwarding.
|
|
23
|
+
* @see https://developer.todoist.com/api/v1/#tag/Emails/operation/email_disable_api_v1_emails_delete
|
|
24
|
+
*/
|
|
25
|
+
export type DisableEmailArgs = {
|
|
26
|
+
/** The type of object to disable forwarding for. */
|
|
27
|
+
objType: EmailObjectType;
|
|
28
|
+
/** The ID of the object. */
|
|
29
|
+
objId: string;
|
|
30
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Object types that support ID mappings. */
|
|
2
|
+
export declare const ID_MAPPING_OBJECT_TYPES: readonly ["sections", "tasks", "comments", "reminders", "location_reminders", "projects"];
|
|
3
|
+
/** Object type that supports ID mappings. */
|
|
4
|
+
export type IdMappingObjectType = (typeof ID_MAPPING_OBJECT_TYPES)[number];
|
|
5
|
+
/** Object types that support moved ID lookups. */
|
|
6
|
+
export declare const MOVED_ID_OBJECT_TYPES: readonly ["sections", "tasks", "comments", "reminders", "location_reminders"];
|
|
7
|
+
/** Object type that supports moved ID lookups. */
|
|
8
|
+
export type MovedIdObjectType = (typeof MOVED_ID_OBJECT_TYPES)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Arguments for getting ID mappings between old and new IDs.
|
|
11
|
+
* @see https://developer.todoist.com/api/v1/#tag/Ids/operation/id_mappings_api_v1_id_mappings__obj_name___obj_ids__get
|
|
12
|
+
*/
|
|
13
|
+
export type GetIdMappingsArgs = {
|
|
14
|
+
/** The type of object to look up. */
|
|
15
|
+
objName: IdMappingObjectType;
|
|
16
|
+
/** Array of IDs to look up. */
|
|
17
|
+
objIds: [string, ...string[]];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Arguments for getting moved IDs.
|
|
21
|
+
* @see https://developer.todoist.com/api/v1/#tag/Ids/operation/moved_ids_api_v1_moved_ids__obj_name__get
|
|
22
|
+
*/
|
|
23
|
+
export type GetMovedIdsArgs = {
|
|
24
|
+
/** The type of object to look up. */
|
|
25
|
+
objName: MovedIdObjectType;
|
|
26
|
+
/** Array of old IDs to look up. */
|
|
27
|
+
oldIds?: string[];
|
|
28
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const IdMappingSchema: z.ZodObject<{
|
|
3
|
+
oldId: z.ZodNullable<z.ZodString>;
|
|
4
|
+
newId: z.ZodNullable<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
/** Mapping between old and new IDs after migration. */
|
|
7
|
+
export type IdMapping = z.infer<typeof IdMappingSchema>;
|
|
8
|
+
export declare const MovedIdSchema: z.ZodObject<{
|
|
9
|
+
oldId: z.ZodString;
|
|
10
|
+
newId: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
/** A moved ID pair (old to new). */
|
|
13
|
+
export type MovedId = z.infer<typeof MovedIdSchema>;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './tasks/index.js';
|
|
2
|
+
export * from './projects/index.js';
|
|
3
|
+
export * from './sections/index.js';
|
|
4
|
+
export * from './labels/index.js';
|
|
5
|
+
export * from './comments/index.js';
|
|
6
|
+
export * from './reminders/index.js';
|
|
7
|
+
export * from './users/index.js';
|
|
8
|
+
export * from './productivity/index.js';
|
|
9
|
+
export * from './activity/index.js';
|
|
10
|
+
export * from './workspaces/index.js';
|
|
11
|
+
export * from './insights/index.js';
|
|
12
|
+
export * from './backups/index.js';
|
|
13
|
+
export * from './id-mappings/index.js';
|
|
14
|
+
export * from './emails/index.js';
|
|
15
|
+
export * from './uploads/index.js';
|
|
16
|
+
export * from './templates/index.js';
|
|
2
17
|
export * from './errors.js';
|
|
3
|
-
export * from './requests.js';
|
|
4
18
|
export * from './http.js';
|
|
5
19
|
export * from './sync/index.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Known activity object types. Accepts any string for forward compatibility. */
|
|
2
|
+
export type InsightsObjectType = 'ITEM' | 'PROJECT' | 'NOTE' | (string & Record<string, never>);
|
|
3
|
+
/** Known activity event types. Accepts any string for forward compatibility. */
|
|
4
|
+
export type InsightsEventType = 'ADDED' | 'DELETED' | 'UPDATED' | 'ARCHIVED' | 'UNARCHIVED' | 'COMPLETED' | 'UNCOMPLETED' | 'SHARED' | 'LEFT' | (string & Record<string, never>);
|
|
5
|
+
/**
|
|
6
|
+
* Arguments for getting project activity stats.
|
|
7
|
+
* @see https://developer.todoist.com/api/v1/#tag/Insights/operation/get_project_activity_stats_api_v1_projects__project_id__insights_activity_stats_get
|
|
8
|
+
*/
|
|
9
|
+
export type GetProjectActivityStatsArgs = {
|
|
10
|
+
/** The type of object to get activity counts for (default: 'ITEM'). */
|
|
11
|
+
objectType?: InsightsObjectType;
|
|
12
|
+
/** The type of event to count (default: 'COMPLETED'). */
|
|
13
|
+
eventType?: InsightsEventType;
|
|
14
|
+
/** Number of weeks of activity counts to retrieve (1-12, default 2). */
|
|
15
|
+
weeks?: number;
|
|
16
|
+
/** Whether to include weekly rollup counts in the response. */
|
|
17
|
+
includeWeeklyCounts?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Arguments for getting workspace insights.
|
|
21
|
+
* @see https://developer.todoist.com/api/v1/#tag/Insights/operation/get_workspace_insights_api_v1_workspaces__workspace_id__insights_get
|
|
22
|
+
*/
|
|
23
|
+
export type GetWorkspaceInsightsArgs = {
|
|
24
|
+
/** Project IDs to get insights for. */
|
|
25
|
+
projectIds?: string[];
|
|
26
|
+
};
|