@doist/todoist-api-typescript 7.6.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/todoist-api.js +6 -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/{requests.js → id-mappings/requests.js} +1 -7
- 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/reminders/requests.js +5 -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 +38 -27
- package/dist/esm/todoist-api.js +2 -2
- 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/{requests.js → id-mappings/requests.js} +0 -6
- 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/reminders/requests.js +2 -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 +12 -1
- package/dist/types/test-utils/test-defaults.d.ts +5 -5
- package/dist/types/todoist-api.d.ts +16 -2
- 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/response.d.ts +5 -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 +7 -6
- package/package.json +1 -1
- package/dist/cjs/types/entities.js +0 -552
- package/dist/esm/types/entities.js +0 -548
- package/dist/types/types/entities.d.ts +0 -1211
- package/dist/types/types/requests.d.ts +0 -1188
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const DueDateSchema: z.ZodObject<{
|
|
3
|
+
isRecurring: z.ZodBoolean;
|
|
4
|
+
string: z.ZodString;
|
|
5
|
+
date: z.ZodString;
|
|
6
|
+
datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
/**
|
|
11
|
+
* Represents a due date for a task.
|
|
12
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
13
|
+
*/
|
|
14
|
+
export type DueDate = z.infer<typeof DueDateSchema>;
|
|
15
|
+
/** Available duration units for task deadlines. */
|
|
16
|
+
export declare const DURATION_UNITS: readonly ["minute", "day"];
|
|
17
|
+
/** Unit of time for a task duration. */
|
|
18
|
+
export type DurationUnit = (typeof DURATION_UNITS)[number];
|
|
19
|
+
export declare const DurationSchema: z.ZodObject<{
|
|
20
|
+
amount: z.ZodNumber;
|
|
21
|
+
unit: z.ZodEnum<{
|
|
22
|
+
minute: "minute";
|
|
23
|
+
day: "day";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
/**
|
|
27
|
+
* Represents a duration for a task deadline.
|
|
28
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks
|
|
29
|
+
*/
|
|
30
|
+
export type Duration = z.infer<typeof DurationSchema>;
|
|
31
|
+
export declare const DeadlineSchema: z.ZodObject<{
|
|
32
|
+
date: z.ZodString;
|
|
33
|
+
lang: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/**
|
|
36
|
+
* Represents a task deadline.
|
|
37
|
+
*/
|
|
38
|
+
export type Deadline = z.infer<typeof DeadlineSchema>;
|
|
39
|
+
export declare const TaskSchema: z.ZodPipe<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
userId: z.ZodString;
|
|
42
|
+
projectId: z.ZodString;
|
|
43
|
+
sectionId: z.ZodNullable<z.ZodString>;
|
|
44
|
+
parentId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
addedByUid: z.ZodNullable<z.ZodString>;
|
|
46
|
+
assignedByUid: z.ZodNullable<z.ZodString>;
|
|
47
|
+
responsibleUid: z.ZodNullable<z.ZodString>;
|
|
48
|
+
labels: z.ZodArray<z.ZodString>;
|
|
49
|
+
deadline: z.ZodNullable<z.ZodObject<{
|
|
50
|
+
date: z.ZodString;
|
|
51
|
+
lang: z.ZodString;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
duration: z.ZodNullable<z.ZodObject<{
|
|
54
|
+
amount: z.ZodNumber;
|
|
55
|
+
unit: z.ZodEnum<{
|
|
56
|
+
minute: "minute";
|
|
57
|
+
day: "day";
|
|
58
|
+
}>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
checked: z.ZodBoolean;
|
|
61
|
+
isDeleted: z.ZodBoolean;
|
|
62
|
+
addedAt: z.ZodNullable<z.ZodString>;
|
|
63
|
+
completedAt: z.ZodNullable<z.ZodString>;
|
|
64
|
+
updatedAt: z.ZodNullable<z.ZodString>;
|
|
65
|
+
due: z.ZodNullable<z.ZodObject<{
|
|
66
|
+
isRecurring: z.ZodBoolean;
|
|
67
|
+
string: z.ZodString;
|
|
68
|
+
date: z.ZodString;
|
|
69
|
+
datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
priority: z.ZodNumber;
|
|
74
|
+
childOrder: z.ZodNumber;
|
|
75
|
+
content: z.ZodString;
|
|
76
|
+
description: z.ZodString;
|
|
77
|
+
dayOrder: z.ZodNumber;
|
|
78
|
+
isCollapsed: z.ZodBoolean;
|
|
79
|
+
isUncompletable: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
81
|
+
isUncompletable: boolean;
|
|
82
|
+
url: string;
|
|
83
|
+
id: string;
|
|
84
|
+
userId: string;
|
|
85
|
+
projectId: string;
|
|
86
|
+
sectionId: string | null;
|
|
87
|
+
parentId: string | null;
|
|
88
|
+
addedByUid: string | null;
|
|
89
|
+
assignedByUid: string | null;
|
|
90
|
+
responsibleUid: string | null;
|
|
91
|
+
labels: string[];
|
|
92
|
+
deadline: {
|
|
93
|
+
date: string;
|
|
94
|
+
lang: string;
|
|
95
|
+
} | null;
|
|
96
|
+
duration: {
|
|
97
|
+
amount: number;
|
|
98
|
+
unit: "minute" | "day";
|
|
99
|
+
} | null;
|
|
100
|
+
checked: boolean;
|
|
101
|
+
isDeleted: boolean;
|
|
102
|
+
addedAt: string | null;
|
|
103
|
+
completedAt: string | null;
|
|
104
|
+
updatedAt: string | null;
|
|
105
|
+
due: {
|
|
106
|
+
isRecurring: boolean;
|
|
107
|
+
string: string;
|
|
108
|
+
date: string;
|
|
109
|
+
datetime?: string | null | undefined;
|
|
110
|
+
timezone?: string | null | undefined;
|
|
111
|
+
lang?: string | null | undefined;
|
|
112
|
+
} | null;
|
|
113
|
+
priority: number;
|
|
114
|
+
childOrder: number;
|
|
115
|
+
content: string;
|
|
116
|
+
description: string;
|
|
117
|
+
dayOrder: number;
|
|
118
|
+
isCollapsed: boolean;
|
|
119
|
+
}, {
|
|
120
|
+
id: string;
|
|
121
|
+
userId: string;
|
|
122
|
+
projectId: string;
|
|
123
|
+
sectionId: string | null;
|
|
124
|
+
parentId: string | null;
|
|
125
|
+
addedByUid: string | null;
|
|
126
|
+
assignedByUid: string | null;
|
|
127
|
+
responsibleUid: string | null;
|
|
128
|
+
labels: string[];
|
|
129
|
+
deadline: {
|
|
130
|
+
date: string;
|
|
131
|
+
lang: string;
|
|
132
|
+
} | null;
|
|
133
|
+
duration: {
|
|
134
|
+
amount: number;
|
|
135
|
+
unit: "minute" | "day";
|
|
136
|
+
} | null;
|
|
137
|
+
checked: boolean;
|
|
138
|
+
isDeleted: boolean;
|
|
139
|
+
addedAt: string | null;
|
|
140
|
+
completedAt: string | null;
|
|
141
|
+
updatedAt: string | null;
|
|
142
|
+
due: {
|
|
143
|
+
isRecurring: boolean;
|
|
144
|
+
string: string;
|
|
145
|
+
date: string;
|
|
146
|
+
datetime?: string | null | undefined;
|
|
147
|
+
timezone?: string | null | undefined;
|
|
148
|
+
lang?: string | null | undefined;
|
|
149
|
+
} | null;
|
|
150
|
+
priority: number;
|
|
151
|
+
childOrder: number;
|
|
152
|
+
content: string;
|
|
153
|
+
description: string;
|
|
154
|
+
dayOrder: number;
|
|
155
|
+
isCollapsed: boolean;
|
|
156
|
+
isUncompletable: boolean;
|
|
157
|
+
}>>;
|
|
158
|
+
/**
|
|
159
|
+
* Represents a task in Todoist.
|
|
160
|
+
* @see https://developer.todoist.com/api/v1/#tag/Tasks
|
|
161
|
+
*/
|
|
162
|
+
export type Task = z.infer<typeof TaskSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './requests.js';
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Comment } from '../comments/types.js';
|
|
2
|
+
import type { PersonalProject, WorkspaceProject } from '../projects/types.js';
|
|
3
|
+
import type { Section } from '../sections/types.js';
|
|
4
|
+
import type { Task } from '../tasks/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Arguments for exporting a project as a template file.
|
|
7
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/export_as_file_api_v1_templates_file_get
|
|
8
|
+
*/
|
|
9
|
+
export type ExportTemplateFileArgs = {
|
|
10
|
+
/** The project ID to export. */
|
|
11
|
+
projectId: string;
|
|
12
|
+
/** Whether to use relative dates in the export. */
|
|
13
|
+
useRelativeDates?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Arguments for exporting a project as a template URL.
|
|
17
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/export_as_url_api_v1_templates_url_get
|
|
18
|
+
*/
|
|
19
|
+
export type ExportTemplateUrlArgs = {
|
|
20
|
+
/** The project ID to export. */
|
|
21
|
+
projectId: string;
|
|
22
|
+
/** Whether to use relative dates in the export. */
|
|
23
|
+
useRelativeDates?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Response from exporting a project as a template URL.
|
|
27
|
+
*/
|
|
28
|
+
export type ExportTemplateUrlResponse = {
|
|
29
|
+
fileName: string;
|
|
30
|
+
fileUrl: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Arguments for creating a project from a template file.
|
|
34
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/create_project_from_file_api_v1_templates_create_project_from_file_post
|
|
35
|
+
*/
|
|
36
|
+
export type CreateProjectFromTemplateArgs = {
|
|
37
|
+
/** Name for the new project. */
|
|
38
|
+
name: string;
|
|
39
|
+
/** The template file content. */
|
|
40
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
41
|
+
/** Optional file name (required for Buffer/Stream). */
|
|
42
|
+
fileName?: string;
|
|
43
|
+
/** Optional workspace ID. */
|
|
44
|
+
workspaceId?: string | null;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Response from creating a project from a template.
|
|
48
|
+
*/
|
|
49
|
+
export type CreateProjectFromTemplateResponse = {
|
|
50
|
+
status: string;
|
|
51
|
+
projectId: string;
|
|
52
|
+
templateType: string;
|
|
53
|
+
projects: (PersonalProject | WorkspaceProject)[];
|
|
54
|
+
sections: Section[];
|
|
55
|
+
tasks: Task[];
|
|
56
|
+
comments: Comment[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Arguments for importing a template file into an existing project.
|
|
60
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/import_into_project_from_file_api_v1_templates_import_into_project_from_file_post
|
|
61
|
+
*/
|
|
62
|
+
export type ImportTemplateIntoProjectArgs = {
|
|
63
|
+
/** The project ID to import into. */
|
|
64
|
+
projectId: string;
|
|
65
|
+
/** The template file content. */
|
|
66
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
67
|
+
/** Optional file name (required for Buffer/Stream). */
|
|
68
|
+
fileName?: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Arguments for importing a template by ID into an existing project.
|
|
72
|
+
* @see https://developer.todoist.com/api/v1/#tag/Templates/operation/import_into_project_from_template_id_api_v1_templates_import_into_project_from_template_id_post
|
|
73
|
+
*/
|
|
74
|
+
export type ImportTemplateFromIdArgs = {
|
|
75
|
+
/** The project ID to import into. */
|
|
76
|
+
projectId: string;
|
|
77
|
+
/** The template ID to import. */
|
|
78
|
+
templateId: string;
|
|
79
|
+
/** Locale for the import (default: 'en'). */
|
|
80
|
+
locale?: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Response from importing a template into a project.
|
|
84
|
+
*/
|
|
85
|
+
export type ImportTemplateResponse = {
|
|
86
|
+
status: string;
|
|
87
|
+
templateType: string;
|
|
88
|
+
projects: (PersonalProject | WorkspaceProject)[];
|
|
89
|
+
sections: Section[];
|
|
90
|
+
tasks: Task[];
|
|
91
|
+
comments: Comment[];
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './requests.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arguments for uploading a file.
|
|
3
|
+
* @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/upload_file_api_v1_uploads_post
|
|
4
|
+
*/
|
|
5
|
+
export type UploadFileArgs = {
|
|
6
|
+
/**
|
|
7
|
+
* The file content to upload. Can be:
|
|
8
|
+
* - Buffer: File content as a Buffer (requires fileName)
|
|
9
|
+
* - ReadableStream: File content as a stream (requires fileName)
|
|
10
|
+
* - string: Path to a file on the filesystem (fileName is optional, will be inferred from path)
|
|
11
|
+
*/
|
|
12
|
+
file: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the file. Required for Buffer and Stream inputs.
|
|
15
|
+
* Optional for file path strings and File objects (will be inferred if not provided).
|
|
16
|
+
*/
|
|
17
|
+
fileName?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The project ID to associate the upload with.
|
|
20
|
+
*/
|
|
21
|
+
projectId?: string | null;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Arguments for deleting an uploaded file.
|
|
25
|
+
* @see https://developer.todoist.com/api/v1/#tag/Uploads/operation/delete_upload_api_v1_uploads_delete
|
|
26
|
+
*/
|
|
27
|
+
export type DeleteUploadArgs = {
|
|
28
|
+
/**
|
|
29
|
+
* The URL of the file to delete.
|
|
30
|
+
*/
|
|
31
|
+
fileUrl: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types.js';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const UserSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
email: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
/**
|
|
8
|
+
* Represents a user in Todoist (simplified for collaborators).
|
|
9
|
+
* @see https://developer.todoist.com/api/v1/#tag/User
|
|
10
|
+
*/
|
|
11
|
+
export type User = z.infer<typeof UserSchema>;
|
|
12
|
+
export declare const TimezoneInfoSchema: z.ZodObject<{
|
|
13
|
+
gmtString: z.ZodString;
|
|
14
|
+
hours: z.ZodNumber;
|
|
15
|
+
isDst: z.ZodNumber;
|
|
16
|
+
minutes: z.ZodNumber;
|
|
17
|
+
timezone: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/** Available user premium statuses. */
|
|
20
|
+
export declare const PREMIUM_STATUSES: readonly ["not_premium", "current_personal_plan", "legacy_personal_plan", "teams_business_member"];
|
|
21
|
+
/** Premium subscription status of a user. */
|
|
22
|
+
export type PremiumStatus = (typeof PREMIUM_STATUSES)[number];
|
|
23
|
+
export declare const CurrentUserSchema: z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
fullName: z.ZodString;
|
|
27
|
+
avatarBig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
avatarMedium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
avatarS640: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
|
+
avatarSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
31
|
+
businessAccountId: z.ZodNullable<z.ZodString>;
|
|
32
|
+
isPremium: z.ZodBoolean;
|
|
33
|
+
premiumStatus: z.ZodEnum<{
|
|
34
|
+
not_premium: "not_premium";
|
|
35
|
+
current_personal_plan: "current_personal_plan";
|
|
36
|
+
legacy_personal_plan: "legacy_personal_plan";
|
|
37
|
+
teams_business_member: "teams_business_member";
|
|
38
|
+
}>;
|
|
39
|
+
dateFormat: z.ZodNumber;
|
|
40
|
+
timeFormat: z.ZodNumber;
|
|
41
|
+
weeklyGoal: z.ZodNumber;
|
|
42
|
+
dailyGoal: z.ZodNumber;
|
|
43
|
+
completedCount: z.ZodNumber;
|
|
44
|
+
completedToday: z.ZodNumber;
|
|
45
|
+
karma: z.ZodNumber;
|
|
46
|
+
karmaTrend: z.ZodString;
|
|
47
|
+
lang: z.ZodString;
|
|
48
|
+
nextWeek: z.ZodNumber;
|
|
49
|
+
startDay: z.ZodNumber;
|
|
50
|
+
startPage: z.ZodString;
|
|
51
|
+
tzInfo: z.ZodObject<{
|
|
52
|
+
gmtString: z.ZodString;
|
|
53
|
+
hours: z.ZodNumber;
|
|
54
|
+
isDst: z.ZodNumber;
|
|
55
|
+
minutes: z.ZodNumber;
|
|
56
|
+
timezone: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
inboxProjectId: z.ZodString;
|
|
59
|
+
daysOff: z.ZodArray<z.ZodNumber>;
|
|
60
|
+
weekendStartDay: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* Represents the current authenticated user with detailed information.
|
|
64
|
+
* @see https://developer.todoist.com/api/v1/#tag/User
|
|
65
|
+
*/
|
|
66
|
+
export type CurrentUser = z.infer<typeof CurrentUserSchema>;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import type { MemberActivityInfo, WorkspaceInvitation, WorkspaceRole, WorkspaceUser, WorkspaceUserTask } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Arguments for creating a new workspace.
|
|
4
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/create_workspace_api_v1_workspaces_post
|
|
5
|
+
*/
|
|
6
|
+
export type AddWorkspaceArgs = {
|
|
7
|
+
/** Name of the workspace. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** Description of the workspace. */
|
|
10
|
+
description?: string | null;
|
|
11
|
+
/** Whether link sharing is enabled for the workspace. */
|
|
12
|
+
isLinkSharingEnabled?: boolean;
|
|
13
|
+
/** Whether guests are allowed in the workspace. */
|
|
14
|
+
isGuestAllowed?: boolean;
|
|
15
|
+
/** Workspace email domain. */
|
|
16
|
+
domainName?: string | null;
|
|
17
|
+
/** Whether users with matching email domains can discover this workspace. */
|
|
18
|
+
domainDiscovery?: boolean;
|
|
19
|
+
/** Whether workspace invites are restricted to workspace domain. */
|
|
20
|
+
restrictEmailDomains?: boolean;
|
|
21
|
+
/** Workspace properties. */
|
|
22
|
+
properties?: Record<string, unknown> | null;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Arguments for updating an existing workspace.
|
|
26
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/update_workspace_api_v1_workspaces__workspace_id__post
|
|
27
|
+
*/
|
|
28
|
+
export type UpdateWorkspaceArgs = {
|
|
29
|
+
/** Updated workspace name. */
|
|
30
|
+
name?: string;
|
|
31
|
+
/** Updated workspace description. */
|
|
32
|
+
description?: string | null;
|
|
33
|
+
/** Updated link sharing status. */
|
|
34
|
+
isLinkSharingEnabled?: boolean;
|
|
35
|
+
/** Updated guest access status. */
|
|
36
|
+
isGuestAllowed?: boolean | null;
|
|
37
|
+
/** Updated workspace email domain. */
|
|
38
|
+
domainName?: string | null;
|
|
39
|
+
/** Updated domain discovery setting. */
|
|
40
|
+
domainDiscovery?: boolean;
|
|
41
|
+
/** Updated email domain restriction setting. */
|
|
42
|
+
restrictEmailDomains?: boolean;
|
|
43
|
+
/** Updated workspace properties. */
|
|
44
|
+
properties?: Record<string, unknown> | null;
|
|
45
|
+
/** Updated collapse state for current user. */
|
|
46
|
+
isCollapsed?: boolean;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Arguments for getting workspace members activity.
|
|
50
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/get_workspace_members_activity_api_v1_workspaces_members_get
|
|
51
|
+
*/
|
|
52
|
+
export type GetWorkspaceMembersActivityArgs = {
|
|
53
|
+
/** The workspace ID. */
|
|
54
|
+
workspaceId: string;
|
|
55
|
+
/** Comma-separated list of user IDs to filter by. */
|
|
56
|
+
userIds?: string | null;
|
|
57
|
+
/** Comma-separated list of project IDs to filter by. */
|
|
58
|
+
projectIds?: string | null;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Response from getting workspace members activity.
|
|
62
|
+
*/
|
|
63
|
+
export type GetWorkspaceMembersActivityResponse = {
|
|
64
|
+
members: MemberActivityInfo[];
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Arguments for getting tasks assigned to a workspace user.
|
|
68
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/get_workspace_user_tasks_api_v1_workspaces__workspace_id__users__user_id__tasks_get
|
|
69
|
+
*/
|
|
70
|
+
export type GetWorkspaceUserTasksArgs = {
|
|
71
|
+
/** The workspace ID. */
|
|
72
|
+
workspaceId: string;
|
|
73
|
+
/** The user ID. */
|
|
74
|
+
userId: string;
|
|
75
|
+
/** Comma-separated list of project IDs to filter by. */
|
|
76
|
+
projectIds?: string | null;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Response from getting workspace user tasks.
|
|
80
|
+
*/
|
|
81
|
+
export type GetWorkspaceUserTasksResponse = {
|
|
82
|
+
tasks: WorkspaceUserTask[];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Arguments for inviting users to a workspace.
|
|
86
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/invite_workspace_users_api_v1_workspaces__workspace_id__users_invite_post
|
|
87
|
+
*/
|
|
88
|
+
export type InviteWorkspaceUsersArgs = {
|
|
89
|
+
/** The workspace ID. */
|
|
90
|
+
workspaceId: string;
|
|
91
|
+
/** List of user emails to invite. */
|
|
92
|
+
emailList: string[];
|
|
93
|
+
/** Role assigned to invited users. */
|
|
94
|
+
role?: WorkspaceRole;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Response from inviting workspace users.
|
|
98
|
+
*/
|
|
99
|
+
export type InviteWorkspaceUsersResponse = {
|
|
100
|
+
invitedEmails: string[];
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Arguments for updating a workspace user's role.
|
|
104
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/update_workspace_user_api_v1_workspaces__workspace_id__users__user_id__post
|
|
105
|
+
*/
|
|
106
|
+
export type UpdateWorkspaceUserArgs = {
|
|
107
|
+
/** The workspace ID. */
|
|
108
|
+
workspaceId: string;
|
|
109
|
+
/** The user ID. */
|
|
110
|
+
userId: string;
|
|
111
|
+
/** Updated role for the user. */
|
|
112
|
+
role: WorkspaceRole;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Arguments for removing a user from a workspace.
|
|
116
|
+
* @see https://developer.todoist.com/api/v1/#tag/Workspace/operation/remove_workspace_user_api_v1_workspaces__workspace_id__users__user_id__delete
|
|
117
|
+
*/
|
|
118
|
+
export type RemoveWorkspaceUserArgs = {
|
|
119
|
+
/** The workspace ID. */
|
|
120
|
+
workspaceId: string;
|
|
121
|
+
/** The user ID. */
|
|
122
|
+
userId: string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Arguments for getting workspace invitations.
|
|
126
|
+
*/
|
|
127
|
+
export type GetWorkspaceInvitationsArgs = {
|
|
128
|
+
/**
|
|
129
|
+
* The workspace ID to get invitations for.
|
|
130
|
+
*/
|
|
131
|
+
workspaceId: number;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Arguments for deleting a workspace invitation.
|
|
135
|
+
*/
|
|
136
|
+
export type DeleteWorkspaceInvitationArgs = {
|
|
137
|
+
/**
|
|
138
|
+
* The workspace ID.
|
|
139
|
+
*/
|
|
140
|
+
workspaceId: number;
|
|
141
|
+
/**
|
|
142
|
+
* The email address of the invitation to delete.
|
|
143
|
+
*/
|
|
144
|
+
userEmail: string;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Arguments for accepting/rejecting a workspace invitation.
|
|
148
|
+
*/
|
|
149
|
+
export type WorkspaceInvitationActionArgs = {
|
|
150
|
+
/**
|
|
151
|
+
* The invitation code from the email.
|
|
152
|
+
*/
|
|
153
|
+
inviteCode: string;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Arguments for joining a workspace.
|
|
157
|
+
*/
|
|
158
|
+
export type JoinWorkspaceArgs = {
|
|
159
|
+
/**
|
|
160
|
+
* Optional invitation code/link to join via.
|
|
161
|
+
*/
|
|
162
|
+
inviteCode?: string | null;
|
|
163
|
+
/**
|
|
164
|
+
* Optional workspace ID to join via domain auto-join.
|
|
165
|
+
*/
|
|
166
|
+
workspaceId?: number | null;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Arguments for uploading/updating workspace logo.
|
|
170
|
+
*/
|
|
171
|
+
export type WorkspaceLogoArgs = {
|
|
172
|
+
/**
|
|
173
|
+
* The workspace ID.
|
|
174
|
+
*/
|
|
175
|
+
workspaceId: number;
|
|
176
|
+
/**
|
|
177
|
+
* The image file to upload (Buffer, Stream, or file path).
|
|
178
|
+
*/
|
|
179
|
+
file?: Buffer | NodeJS.ReadableStream | string | Blob;
|
|
180
|
+
/**
|
|
181
|
+
* The file name (required for Buffer/Stream uploads).
|
|
182
|
+
*/
|
|
183
|
+
fileName?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Whether to delete the logo instead of updating it.
|
|
186
|
+
*/
|
|
187
|
+
delete?: boolean;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Arguments for getting workspace plan details.
|
|
191
|
+
*/
|
|
192
|
+
export type GetWorkspacePlanDetailsArgs = {
|
|
193
|
+
/**
|
|
194
|
+
* The workspace ID.
|
|
195
|
+
*/
|
|
196
|
+
workspaceId: number;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Arguments for getting workspace users (paginated).
|
|
200
|
+
*/
|
|
201
|
+
export type GetWorkspaceUsersArgs = {
|
|
202
|
+
/**
|
|
203
|
+
* Optional workspace ID. If not provided, returns users for all workspaces.
|
|
204
|
+
*/
|
|
205
|
+
workspaceId?: number | null;
|
|
206
|
+
/**
|
|
207
|
+
* Cursor for pagination.
|
|
208
|
+
*/
|
|
209
|
+
cursor?: string | null;
|
|
210
|
+
/**
|
|
211
|
+
* Maximum number of users to return (default: 100).
|
|
212
|
+
*/
|
|
213
|
+
limit?: number;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* Arguments for getting workspace projects (paginated).
|
|
217
|
+
*/
|
|
218
|
+
export type GetWorkspaceProjectsArgs = {
|
|
219
|
+
/**
|
|
220
|
+
* The workspace ID.
|
|
221
|
+
*/
|
|
222
|
+
workspaceId: number;
|
|
223
|
+
/**
|
|
224
|
+
* Cursor for pagination.
|
|
225
|
+
*/
|
|
226
|
+
cursor?: string | null;
|
|
227
|
+
/**
|
|
228
|
+
* Maximum number of projects to return (default: 100).
|
|
229
|
+
*/
|
|
230
|
+
limit?: number;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* Paginated response for workspace users.
|
|
234
|
+
*/
|
|
235
|
+
export type GetWorkspaceUsersResponse = {
|
|
236
|
+
/**
|
|
237
|
+
* Whether there are more users available.
|
|
238
|
+
*/
|
|
239
|
+
hasMore: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Cursor for the next page of results.
|
|
242
|
+
*/
|
|
243
|
+
nextCursor?: string;
|
|
244
|
+
/**
|
|
245
|
+
* Array of workspace users.
|
|
246
|
+
*/
|
|
247
|
+
workspaceUsers: WorkspaceUser[];
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* Response type for workspace invitations endpoint (simple email list).
|
|
251
|
+
*/
|
|
252
|
+
export type WorkspaceInvitationsResponse = string[];
|
|
253
|
+
/**
|
|
254
|
+
* Response type for all workspace invitations endpoint (detailed objects).
|
|
255
|
+
*/
|
|
256
|
+
export type AllWorkspaceInvitationsResponse = WorkspaceInvitation[];
|
|
257
|
+
/**
|
|
258
|
+
* Response type for workspace logo upload.
|
|
259
|
+
*/
|
|
260
|
+
export type WorkspaceLogoResponse = Record<string, unknown> | null;
|