@doist/todoist-api-typescript 7.6.0 → 7.7.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/dist/cjs/todoist-api.js +8 -7
- 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 +4 -3
- 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 +64 -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 +3 -3
- 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,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;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Available project collaborator roles. */
|
|
3
|
+
export declare const COLLABORATOR_ROLES: readonly ["CREATOR", "ADMIN", "READ_WRITE", "EDIT_ONLY", "COMPLETE_ONLY"];
|
|
4
|
+
/** Role of a collaborator in a project. */
|
|
5
|
+
export type CollaboratorRole = (typeof COLLABORATOR_ROLES)[number];
|
|
6
|
+
/**
|
|
7
|
+
* Available workspace roles.
|
|
8
|
+
*/
|
|
9
|
+
export declare const WORKSPACE_ROLES: readonly ["ADMIN", "MEMBER", "GUEST"];
|
|
10
|
+
/**
|
|
11
|
+
* Role of a user within a workspace.
|
|
12
|
+
*/
|
|
13
|
+
export type WorkspaceRole = (typeof WORKSPACE_ROLES)[number];
|
|
14
|
+
export declare const WorkspaceRoleSchema: z.ZodEnum<{
|
|
15
|
+
ADMIN: "ADMIN";
|
|
16
|
+
MEMBER: "MEMBER";
|
|
17
|
+
GUEST: "GUEST";
|
|
18
|
+
}>;
|
|
19
|
+
export declare const WorkspaceUserSchema: z.ZodObject<{
|
|
20
|
+
userId: z.ZodString;
|
|
21
|
+
workspaceId: z.ZodString;
|
|
22
|
+
userEmail: z.ZodString;
|
|
23
|
+
fullName: z.ZodString;
|
|
24
|
+
timezone: z.ZodString;
|
|
25
|
+
role: z.ZodEnum<{
|
|
26
|
+
ADMIN: "ADMIN";
|
|
27
|
+
MEMBER: "MEMBER";
|
|
28
|
+
GUEST: "GUEST";
|
|
29
|
+
}>;
|
|
30
|
+
imageId: z.ZodNullable<z.ZodString>;
|
|
31
|
+
isDeleted: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
/**
|
|
34
|
+
* Represents a user within a workspace (MemberView from API).
|
|
35
|
+
*/
|
|
36
|
+
export type WorkspaceUser = z.infer<typeof WorkspaceUserSchema>;
|
|
37
|
+
export declare const WorkspaceInvitationSchema: z.ZodObject<{
|
|
38
|
+
id: z.ZodDefault<z.ZodString>;
|
|
39
|
+
inviterId: z.ZodString;
|
|
40
|
+
userEmail: z.ZodString;
|
|
41
|
+
workspaceId: z.ZodString;
|
|
42
|
+
role: z.ZodEnum<{
|
|
43
|
+
ADMIN: "ADMIN";
|
|
44
|
+
MEMBER: "MEMBER";
|
|
45
|
+
GUEST: "GUEST";
|
|
46
|
+
}>;
|
|
47
|
+
isExistingUser: z.ZodBoolean;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
/**
|
|
50
|
+
* Represents a workspace invitation.
|
|
51
|
+
*/
|
|
52
|
+
export type WorkspaceInvitation = z.infer<typeof WorkspaceInvitationSchema>;
|
|
53
|
+
export declare const PlanPriceSchema: z.ZodObject<{
|
|
54
|
+
currency: z.ZodString;
|
|
55
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
56
|
+
interval: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
/**
|
|
59
|
+
* Plan pricing information.
|
|
60
|
+
*/
|
|
61
|
+
export type PlanPrice = z.infer<typeof PlanPriceSchema>;
|
|
62
|
+
export declare const FormattedPriceListingSchema: z.ZodObject<{
|
|
63
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
64
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
interval: z.ZodOptional<z.ZodString>;
|
|
66
|
+
formatted: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
/**
|
|
69
|
+
* Formatted price listing for workspace plans.
|
|
70
|
+
*/
|
|
71
|
+
export type FormattedPriceListing = z.infer<typeof FormattedPriceListingSchema>;
|
|
72
|
+
/** Available workspace plan names. */
|
|
73
|
+
export declare const WORKSPACE_CURRENT_PLANS: readonly ["Business", "Starter"];
|
|
74
|
+
/** Display name of a workspace plan. */
|
|
75
|
+
export type WorkspaceCurrentPlan = (typeof WORKSPACE_CURRENT_PLANS)[number];
|
|
76
|
+
/** Available workspace plan statuses. */
|
|
77
|
+
export declare const WORKSPACE_PLAN_STATUSES: readonly ["Active", "Downgraded", "Cancelled", "NeverSubscribed"];
|
|
78
|
+
/** Subscription status of a workspace plan. */
|
|
79
|
+
export type WorkspacePlanStatus = (typeof WORKSPACE_PLAN_STATUSES)[number];
|
|
80
|
+
export declare const WorkspacePlanDetailsSchema: z.ZodObject<{
|
|
81
|
+
currentMemberCount: z.ZodNumber;
|
|
82
|
+
currentPlan: z.ZodEnum<{
|
|
83
|
+
Business: "Business";
|
|
84
|
+
Starter: "Starter";
|
|
85
|
+
}>;
|
|
86
|
+
currentPlanStatus: z.ZodEnum<{
|
|
87
|
+
Active: "Active";
|
|
88
|
+
Downgraded: "Downgraded";
|
|
89
|
+
Cancelled: "Cancelled";
|
|
90
|
+
NeverSubscribed: "NeverSubscribed";
|
|
91
|
+
}>;
|
|
92
|
+
downgradeAt: z.ZodNullable<z.ZodString>;
|
|
93
|
+
currentActiveProjects: z.ZodNumber;
|
|
94
|
+
maximumActiveProjects: z.ZodNumber;
|
|
95
|
+
priceList: z.ZodArray<z.ZodObject<{
|
|
96
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
97
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
interval: z.ZodOptional<z.ZodString>;
|
|
99
|
+
formatted: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
workspaceId: z.ZodNumber;
|
|
102
|
+
isTrialing: z.ZodBoolean;
|
|
103
|
+
trialEndsAt: z.ZodNullable<z.ZodString>;
|
|
104
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
105
|
+
hasTrialed: z.ZodBoolean;
|
|
106
|
+
planPrice: z.ZodNullable<z.ZodObject<{
|
|
107
|
+
currency: z.ZodString;
|
|
108
|
+
amount: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
109
|
+
interval: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
hasBillingPortal: z.ZodBoolean;
|
|
112
|
+
hasBillingPortalSwitchToAnnual: z.ZodBoolean;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
/**
|
|
115
|
+
* Represents workspace plan and billing details.
|
|
116
|
+
*/
|
|
117
|
+
export type WorkspacePlanDetails = z.infer<typeof WorkspacePlanDetailsSchema>;
|
|
118
|
+
export declare const JoinWorkspaceResultSchema: z.ZodObject<{
|
|
119
|
+
customSortingApplied: z.ZodBoolean;
|
|
120
|
+
projectSortPreference: z.ZodString;
|
|
121
|
+
role: z.ZodEnum<{
|
|
122
|
+
ADMIN: "ADMIN";
|
|
123
|
+
MEMBER: "MEMBER";
|
|
124
|
+
GUEST: "GUEST";
|
|
125
|
+
}>;
|
|
126
|
+
userId: z.ZodString;
|
|
127
|
+
workspaceId: z.ZodString;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
/**
|
|
130
|
+
* Result returned when successfully joining a workspace.
|
|
131
|
+
*/
|
|
132
|
+
export type JoinWorkspaceResult = z.infer<typeof JoinWorkspaceResultSchema>;
|
|
133
|
+
/**
|
|
134
|
+
* Available workspace plans.
|
|
135
|
+
*/
|
|
136
|
+
export declare const WORKSPACE_PLANS: readonly ["STARTER", "BUSINESS"];
|
|
137
|
+
/**
|
|
138
|
+
* Workspace plan type.
|
|
139
|
+
*/
|
|
140
|
+
export type WorkspacePlan = (typeof WORKSPACE_PLANS)[number];
|
|
141
|
+
export declare const WorkspacePlanSchema: z.ZodEnum<{
|
|
142
|
+
STARTER: "STARTER";
|
|
143
|
+
BUSINESS: "BUSINESS";
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* Workspace resource limits.
|
|
147
|
+
*/
|
|
148
|
+
export declare const WorkspaceLimitsSchema: z.ZodObject<{
|
|
149
|
+
current: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
150
|
+
next: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
151
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
152
|
+
export type WorkspaceLimits = z.infer<typeof WorkspaceLimitsSchema>;
|
|
153
|
+
/**
|
|
154
|
+
* Workspace properties (flexible object for unknown fields).
|
|
155
|
+
*/
|
|
156
|
+
export declare const WorkspacePropertiesSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
157
|
+
export type WorkspaceProperties = z.infer<typeof WorkspacePropertiesSchema>;
|
|
158
|
+
/**
|
|
159
|
+
* Represents a workspace in Todoist.
|
|
160
|
+
*/
|
|
161
|
+
export declare const WorkspaceSchema: z.ZodObject<{
|
|
162
|
+
id: z.ZodString;
|
|
163
|
+
name: z.ZodString;
|
|
164
|
+
plan: z.ZodEnum<{
|
|
165
|
+
STARTER: "STARTER";
|
|
166
|
+
BUSINESS: "BUSINESS";
|
|
167
|
+
}>;
|
|
168
|
+
role: z.ZodEnum<{
|
|
169
|
+
ADMIN: "ADMIN";
|
|
170
|
+
MEMBER: "MEMBER";
|
|
171
|
+
GUEST: "GUEST";
|
|
172
|
+
}>;
|
|
173
|
+
inviteCode: z.ZodString;
|
|
174
|
+
isLinkSharingEnabled: z.ZodBoolean;
|
|
175
|
+
isGuestAllowed: z.ZodBoolean;
|
|
176
|
+
limits: z.ZodObject<{
|
|
177
|
+
current: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
178
|
+
next: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
179
|
+
}, z.core.$catchall<z.ZodAny>>;
|
|
180
|
+
logoBig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
+
logoMedium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
+
logoSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
logoS640: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
+
createdAt: z.ZodString;
|
|
185
|
+
creatorId: z.ZodString;
|
|
186
|
+
properties: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
export type Workspace = z.infer<typeof WorkspaceSchema>;
|
|
189
|
+
export declare const MemberActivityInfoSchema: z.ZodObject<{
|
|
190
|
+
userId: z.ZodString;
|
|
191
|
+
tasksAssigned: z.ZodNumber;
|
|
192
|
+
tasksOverdue: z.ZodNumber;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
/**
|
|
195
|
+
* Represents activity information for a workspace member.
|
|
196
|
+
*/
|
|
197
|
+
export type MemberActivityInfo = z.infer<typeof MemberActivityInfoSchema>;
|
|
198
|
+
export declare const WorkspaceUserTaskSchema: z.ZodObject<{
|
|
199
|
+
id: z.ZodString;
|
|
200
|
+
content: z.ZodString;
|
|
201
|
+
responsibleUid: z.ZodNullable<z.ZodString>;
|
|
202
|
+
due: z.ZodNullable<z.ZodObject<{
|
|
203
|
+
isRecurring: z.ZodBoolean;
|
|
204
|
+
string: z.ZodString;
|
|
205
|
+
date: z.ZodString;
|
|
206
|
+
datetime: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
207
|
+
timezone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
lang: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
deadline: z.ZodNullable<z.ZodObject<{
|
|
211
|
+
date: z.ZodString;
|
|
212
|
+
lang: z.ZodString;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
labels: z.ZodArray<z.ZodString>;
|
|
215
|
+
notesCount: z.ZodNumber;
|
|
216
|
+
projectId: z.ZodString;
|
|
217
|
+
projectName: z.ZodString;
|
|
218
|
+
priority: z.ZodNumber;
|
|
219
|
+
description: z.ZodString;
|
|
220
|
+
isOverdue: z.ZodBoolean;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
/**
|
|
223
|
+
* Represents a task assigned to a workspace user.
|
|
224
|
+
*/
|
|
225
|
+
export type WorkspaceUserTask = z.infer<typeof WorkspaceUserTaskSchema>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type WorkspaceProject, type PersonalProject
|
|
1
|
+
import { type WorkspaceProject, type PersonalProject } from '../types/projects/types.js';
|
|
2
|
+
import { type WorkspaceUser } from '../types/workspaces/types.js';
|
|
2
3
|
export declare const validateTask: (input: unknown) => {
|
|
3
4
|
isUncompletable: boolean;
|
|
4
5
|
url: string;
|
|
@@ -152,7 +153,7 @@ export declare const validateComment: (input: unknown) => {
|
|
|
152
153
|
fileType?: string | null | undefined;
|
|
153
154
|
fileUrl?: string | null | undefined;
|
|
154
155
|
fileDuration?: number | null | undefined;
|
|
155
|
-
uploadState?: "
|
|
156
|
+
uploadState?: "completed" | "pending" | null | undefined;
|
|
156
157
|
image?: string | null | undefined;
|
|
157
158
|
imageWidth?: number | null | undefined;
|
|
158
159
|
imageHeight?: number | null | undefined;
|
|
@@ -177,7 +178,7 @@ export declare const validateCommentArray: (input: unknown[]) => {
|
|
|
177
178
|
fileType?: string | null | undefined;
|
|
178
179
|
fileUrl?: string | null | undefined;
|
|
179
180
|
fileDuration?: number | null | undefined;
|
|
180
|
-
uploadState?: "
|
|
181
|
+
uploadState?: "completed" | "pending" | null | undefined;
|
|
181
182
|
image?: string | null | undefined;
|
|
182
183
|
imageWidth?: number | null | undefined;
|
|
183
184
|
imageHeight?: number | null | undefined;
|
|
@@ -340,7 +341,7 @@ export declare const validateAttachment: (input: unknown) => {
|
|
|
340
341
|
fileType?: string | null | undefined;
|
|
341
342
|
fileUrl?: string | null | undefined;
|
|
342
343
|
fileDuration?: number | null | undefined;
|
|
343
|
-
uploadState?: "
|
|
344
|
+
uploadState?: "completed" | "pending" | null | undefined;
|
|
344
345
|
image?: string | null | undefined;
|
|
345
346
|
imageWidth?: number | null | undefined;
|
|
346
347
|
imageHeight?: number | null | undefined;
|
|
@@ -697,7 +698,7 @@ export declare const validateNote: (input: unknown) => {
|
|
|
697
698
|
fileType?: string | null | undefined;
|
|
698
699
|
fileUrl?: string | null | undefined;
|
|
699
700
|
fileDuration?: number | null | undefined;
|
|
700
|
-
uploadState?: "
|
|
701
|
+
uploadState?: "completed" | "pending" | null | undefined;
|
|
701
702
|
image?: string | null | undefined;
|
|
702
703
|
imageWidth?: number | null | undefined;
|
|
703
704
|
imageHeight?: number | null | undefined;
|
|
@@ -723,7 +724,7 @@ export declare const validateNoteArray: (input: unknown[]) => {
|
|
|
723
724
|
fileType?: string | null | undefined;
|
|
724
725
|
fileUrl?: string | null | undefined;
|
|
725
726
|
fileDuration?: number | null | undefined;
|
|
726
|
-
uploadState?: "
|
|
727
|
+
uploadState?: "completed" | "pending" | null | undefined;
|
|
727
728
|
image?: string | null | undefined;
|
|
728
729
|
imageWidth?: number | null | undefined;
|
|
729
730
|
imageHeight?: number | null | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-api-typescript",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"description": "A typescript wrapper for the Todoist REST API.",
|
|
5
5
|
"author": "Doist developers",
|
|
6
6
|
"repository": "https://github.com/Doist/todoist-api-typescript",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"types": "dist/types/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
+
"types": "./dist/types/index.d.ts",
|
|
15
16
|
"import": "./dist/esm/index.js",
|
|
16
|
-
"require": "./dist/cjs/index.js"
|
|
17
|
-
"types": "./dist/types/index.d.ts"
|
|
17
|
+
"require": "./dist/cjs/index.js"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"sideEffects": false,
|