@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.
Files changed (162) hide show
  1. package/dist/cjs/todoist-api.js +6 -6
  2. package/dist/cjs/types/activity/index.js +18 -0
  3. package/dist/cjs/types/activity/requests.js +2 -0
  4. package/dist/cjs/types/activity/types.js +28 -0
  5. package/dist/cjs/types/backups/index.js +18 -0
  6. package/dist/cjs/types/backups/requests.js +2 -0
  7. package/dist/cjs/types/backups/types.js +8 -0
  8. package/dist/cjs/types/comments/index.js +18 -0
  9. package/dist/cjs/types/comments/requests.js +2 -0
  10. package/dist/cjs/types/comments/types.js +60 -0
  11. package/dist/cjs/types/common.js +2 -0
  12. package/dist/cjs/types/emails/index.js +17 -0
  13. package/dist/cjs/types/emails/requests.js +5 -0
  14. package/dist/cjs/types/id-mappings/index.js +18 -0
  15. package/dist/cjs/types/{requests.js → id-mappings/requests.js} +1 -7
  16. package/dist/cjs/types/id-mappings/types.js +12 -0
  17. package/dist/cjs/types/index.js +16 -2
  18. package/dist/cjs/types/insights/index.js +18 -0
  19. package/dist/cjs/types/insights/requests.js +2 -0
  20. package/dist/cjs/types/insights/types.js +84 -0
  21. package/dist/cjs/types/labels/index.js +18 -0
  22. package/dist/cjs/types/labels/requests.js +2 -0
  23. package/dist/cjs/types/labels/types.js +11 -0
  24. package/dist/cjs/types/productivity/index.js +17 -0
  25. package/dist/cjs/types/productivity/types.js +67 -0
  26. package/dist/cjs/types/projects/index.js +18 -0
  27. package/dist/cjs/types/projects/requests.js +2 -0
  28. package/dist/cjs/types/projects/types.js +56 -0
  29. package/dist/cjs/types/reminders/index.js +17 -0
  30. package/dist/cjs/types/reminders/requests.js +5 -0
  31. package/dist/cjs/types/sections/index.js +18 -0
  32. package/dist/cjs/types/sections/requests.js +2 -0
  33. package/dist/cjs/types/sections/types.js +22 -0
  34. package/dist/cjs/types/sync/commands/shared.js +2 -2
  35. package/dist/cjs/types/sync/resources/collaborators.js +2 -2
  36. package/dist/cjs/types/sync/resources/notes.js +2 -2
  37. package/dist/cjs/types/sync/resources/reminders.js +3 -3
  38. package/dist/cjs/types/sync/resources/user.js +2 -2
  39. package/dist/cjs/types/sync/resources/workspaces.js +5 -5
  40. package/dist/cjs/types/tasks/index.js +18 -0
  41. package/dist/cjs/types/tasks/requests.js +2 -0
  42. package/dist/cjs/types/tasks/types.js +59 -0
  43. package/dist/cjs/types/templates/index.js +17 -0
  44. package/dist/cjs/types/templates/requests.js +2 -0
  45. package/dist/cjs/types/uploads/index.js +17 -0
  46. package/dist/cjs/types/uploads/requests.js +2 -0
  47. package/dist/cjs/types/users/index.js +17 -0
  48. package/dist/cjs/types/users/types.js +51 -0
  49. package/dist/cjs/types/workspaces/index.js +18 -0
  50. package/dist/cjs/types/workspaces/requests.js +2 -0
  51. package/dist/cjs/types/workspaces/types.js +137 -0
  52. package/dist/cjs/utils/validators.js +38 -27
  53. package/dist/esm/todoist-api.js +2 -2
  54. package/dist/esm/types/activity/index.js +2 -0
  55. package/dist/esm/types/activity/requests.js +1 -0
  56. package/dist/esm/types/activity/types.js +25 -0
  57. package/dist/esm/types/backups/index.js +2 -0
  58. package/dist/esm/types/backups/requests.js +1 -0
  59. package/dist/esm/types/backups/types.js +5 -0
  60. package/dist/esm/types/comments/index.js +2 -0
  61. package/dist/esm/types/comments/requests.js +1 -0
  62. package/dist/esm/types/comments/types.js +57 -0
  63. package/dist/esm/types/common.js +1 -0
  64. package/dist/esm/types/emails/index.js +1 -0
  65. package/dist/esm/types/emails/requests.js +2 -0
  66. package/dist/esm/types/id-mappings/index.js +2 -0
  67. package/dist/esm/types/{requests.js → id-mappings/requests.js} +0 -6
  68. package/dist/esm/types/id-mappings/types.js +9 -0
  69. package/dist/esm/types/index.js +16 -2
  70. package/dist/esm/types/insights/index.js +2 -0
  71. package/dist/esm/types/insights/requests.js +1 -0
  72. package/dist/esm/types/insights/types.js +81 -0
  73. package/dist/esm/types/labels/index.js +2 -0
  74. package/dist/esm/types/labels/requests.js +1 -0
  75. package/dist/esm/types/labels/types.js +8 -0
  76. package/dist/esm/types/productivity/index.js +1 -0
  77. package/dist/esm/types/productivity/types.js +64 -0
  78. package/dist/esm/types/projects/index.js +2 -0
  79. package/dist/esm/types/projects/requests.js +1 -0
  80. package/dist/esm/types/projects/types.js +53 -0
  81. package/dist/esm/types/reminders/index.js +1 -0
  82. package/dist/esm/types/reminders/requests.js +2 -0
  83. package/dist/esm/types/sections/index.js +2 -0
  84. package/dist/esm/types/sections/requests.js +1 -0
  85. package/dist/esm/types/sections/types.js +19 -0
  86. package/dist/esm/types/sync/commands/shared.js +1 -1
  87. package/dist/esm/types/sync/resources/collaborators.js +1 -1
  88. package/dist/esm/types/sync/resources/notes.js +1 -1
  89. package/dist/esm/types/sync/resources/reminders.js +1 -1
  90. package/dist/esm/types/sync/resources/user.js +1 -1
  91. package/dist/esm/types/sync/resources/workspaces.js +1 -1
  92. package/dist/esm/types/tasks/index.js +2 -0
  93. package/dist/esm/types/tasks/requests.js +1 -0
  94. package/dist/esm/types/tasks/types.js +56 -0
  95. package/dist/esm/types/templates/index.js +1 -0
  96. package/dist/esm/types/templates/requests.js +1 -0
  97. package/dist/esm/types/uploads/index.js +1 -0
  98. package/dist/esm/types/uploads/requests.js +1 -0
  99. package/dist/esm/types/users/index.js +1 -0
  100. package/dist/esm/types/users/types.js +48 -0
  101. package/dist/esm/types/workspaces/index.js +2 -0
  102. package/dist/esm/types/workspaces/requests.js +1 -0
  103. package/dist/esm/types/workspaces/types.js +134 -0
  104. package/dist/esm/utils/validators.js +12 -1
  105. package/dist/types/test-utils/test-defaults.d.ts +5 -5
  106. package/dist/types/todoist-api.d.ts +16 -2
  107. package/dist/types/types/activity/index.d.ts +2 -0
  108. package/dist/types/types/activity/requests.d.ts +85 -0
  109. package/dist/types/types/activity/types.d.ts +49 -0
  110. package/dist/types/types/backups/index.d.ts +2 -0
  111. package/dist/types/types/backups/requests.d.ts +16 -0
  112. package/dist/types/types/backups/types.d.ts +7 -0
  113. package/dist/types/types/comments/index.d.ts +2 -0
  114. package/dist/types/types/comments/requests.d.ts +63 -0
  115. package/dist/types/types/comments/types.d.ts +141 -0
  116. package/dist/types/types/common.d.ts +6 -0
  117. package/dist/types/types/emails/index.d.ts +1 -0
  118. package/dist/types/types/emails/requests.d.ts +30 -0
  119. package/dist/types/types/id-mappings/index.d.ts +2 -0
  120. package/dist/types/types/id-mappings/requests.d.ts +28 -0
  121. package/dist/types/types/id-mappings/types.d.ts +13 -0
  122. package/dist/types/types/index.d.ts +16 -2
  123. package/dist/types/types/insights/index.d.ts +2 -0
  124. package/dist/types/types/insights/requests.d.ts +26 -0
  125. package/dist/types/types/insights/types.d.ts +186 -0
  126. package/dist/types/types/labels/index.d.ts +2 -0
  127. package/dist/types/types/labels/requests.d.ts +75 -0
  128. package/dist/types/types/labels/types.d.ts +13 -0
  129. package/dist/types/types/productivity/index.d.ts +1 -0
  130. package/dist/types/types/productivity/types.d.ts +115 -0
  131. package/dist/types/types/projects/index.d.ts +2 -0
  132. package/dist/types/types/projects/requests.d.ts +169 -0
  133. package/dist/types/types/projects/types.d.ts +201 -0
  134. package/dist/types/types/reminders/index.d.ts +1 -0
  135. package/dist/types/types/reminders/requests.d.ts +91 -0
  136. package/dist/types/types/sections/index.d.ts +2 -0
  137. package/dist/types/types/sections/requests.d.ts +41 -0
  138. package/dist/types/types/sections/types.d.ts +44 -0
  139. package/dist/types/types/sync/commands/projects.d.ts +2 -1
  140. package/dist/types/types/sync/commands/shared.d.ts +2 -2
  141. package/dist/types/types/sync/commands/workspaces.d.ts +1 -1
  142. package/dist/types/types/sync/resources/notes.d.ts +1 -1
  143. package/dist/types/types/sync/response.d.ts +5 -1
  144. package/dist/types/types/tasks/index.d.ts +2 -0
  145. package/dist/types/types/tasks/requests.d.ts +197 -0
  146. package/dist/types/types/tasks/types.d.ts +162 -0
  147. package/dist/types/types/templates/index.d.ts +1 -0
  148. package/dist/types/types/templates/requests.d.ts +92 -0
  149. package/dist/types/types/uploads/index.d.ts +1 -0
  150. package/dist/types/types/uploads/requests.d.ts +32 -0
  151. package/dist/types/types/users/index.d.ts +1 -0
  152. package/dist/types/types/users/types.d.ts +66 -0
  153. package/dist/types/types/workspaces/index.d.ts +2 -0
  154. package/dist/types/types/workspaces/requests.d.ts +260 -0
  155. package/dist/types/types/workspaces/types.d.ts +225 -0
  156. package/dist/types/utils/colors.d.ts +1 -1
  157. package/dist/types/utils/validators.d.ts +7 -6
  158. package/package.json +1 -1
  159. package/dist/cjs/types/entities.js +0 -552
  160. package/dist/esm/types/entities.js +0 -548
  161. package/dist/types/types/entities.d.ts +0 -1211
  162. package/dist/types/types/requests.d.ts +0 -1188
@@ -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 './entities.js';
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,2 @@
1
+ export * from './types.js';
2
+ export * from './requests.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
+ };
@@ -0,0 +1,186 @@
1
+ import { z } from 'zod';
2
+ export declare const DayActivitySchema: z.ZodObject<{
3
+ date: z.ZodString;
4
+ totalCount: z.ZodNumber;
5
+ }, z.core.$strip>;
6
+ /** Daily activity count for a specific date. */
7
+ export type DayActivity = z.infer<typeof DayActivitySchema>;
8
+ export declare const WeekRollupSchema: z.ZodObject<{
9
+ fromDate: z.ZodString;
10
+ toDate: z.ZodString;
11
+ totalCount: z.ZodNumber;
12
+ }, z.core.$strip>;
13
+ /** Weekly rollup of activity data. */
14
+ export type WeekRollup = z.infer<typeof WeekRollupSchema>;
15
+ export declare const ProjectActivityStatsSchema: z.ZodObject<{
16
+ dayItems: z.ZodArray<z.ZodObject<{
17
+ date: z.ZodString;
18
+ totalCount: z.ZodNumber;
19
+ }, z.core.$strip>>;
20
+ weekItems: z.ZodNullable<z.ZodArray<z.ZodObject<{
21
+ fromDate: z.ZodString;
22
+ toDate: z.ZodString;
23
+ totalCount: z.ZodNumber;
24
+ }, z.core.$strip>>>;
25
+ }, z.core.$strip>;
26
+ /** Project activity statistics with daily and optional weekly rollups. */
27
+ export type ProjectActivityStats = z.infer<typeof ProjectActivityStatsSchema>;
28
+ /** Available project health statuses. */
29
+ export declare const HEALTH_STATUSES: readonly ["UNKNOWN", "ON_TRACK", "AT_RISK", "CRITICAL", "EXCELLENT", "ERROR"];
30
+ /** Health status of a project. */
31
+ export type HealthStatus = (typeof HEALTH_STATUSES)[number];
32
+ export declare const TaskRecommendationSchema: z.ZodObject<{
33
+ taskId: z.ZodString;
34
+ recommendation: z.ZodString;
35
+ }, z.core.$strip>;
36
+ /** A recommendation for a specific task. */
37
+ export type TaskRecommendation = z.infer<typeof TaskRecommendationSchema>;
38
+ export declare const ProjectHealthSchema: z.ZodObject<{
39
+ status: z.ZodEnum<{
40
+ UNKNOWN: "UNKNOWN";
41
+ ON_TRACK: "ON_TRACK";
42
+ AT_RISK: "AT_RISK";
43
+ CRITICAL: "CRITICAL";
44
+ EXCELLENT: "EXCELLENT";
45
+ ERROR: "ERROR";
46
+ }>;
47
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
+ descriptionSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
49
+ taskRecommendations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
50
+ taskId: z.ZodString;
51
+ recommendation: z.ZodString;
52
+ }, z.core.$strip>>>>;
53
+ projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ isStale: z.ZodDefault<z.ZodBoolean>;
56
+ updateInProgress: z.ZodDefault<z.ZodBoolean>;
57
+ }, z.core.$strip>;
58
+ /** Project health status and recommendations. */
59
+ export type ProjectHealth = z.infer<typeof ProjectHealthSchema>;
60
+ export declare const ProjectMetricsSchema: z.ZodObject<{
61
+ totalTasks: z.ZodNumber;
62
+ completedTasks: z.ZodNumber;
63
+ overdueTasks: z.ZodNumber;
64
+ tasksCreatedThisWeek: z.ZodNumber;
65
+ tasksCompletedThisWeek: z.ZodNumber;
66
+ averageCompletionTime: z.ZodNullable<z.ZodNumber>;
67
+ }, z.core.$strip>;
68
+ /** Project metrics summary. */
69
+ export type ProjectMetrics = z.infer<typeof ProjectMetricsSchema>;
70
+ export declare const TaskContextSchema: z.ZodObject<{
71
+ id: z.ZodString;
72
+ content: z.ZodString;
73
+ due: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ deadline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ priority: z.ZodString;
76
+ isCompleted: z.ZodBoolean;
77
+ createdAt: z.ZodString;
78
+ updatedAt: z.ZodString;
79
+ completedAt: z.ZodNullable<z.ZodString>;
80
+ completedByUid: z.ZodNullable<z.ZodString>;
81
+ labels: z.ZodArray<z.ZodString>;
82
+ }, z.core.$strip>;
83
+ /** Task context used in health analysis. */
84
+ export type TaskContext = z.infer<typeof TaskContextSchema>;
85
+ export declare const ProjectHealthContextSchema: z.ZodObject<{
86
+ projectId: z.ZodString;
87
+ projectName: z.ZodString;
88
+ projectDescription: z.ZodNullable<z.ZodString>;
89
+ projectMetrics: z.ZodObject<{
90
+ totalTasks: z.ZodNumber;
91
+ completedTasks: z.ZodNumber;
92
+ overdueTasks: z.ZodNumber;
93
+ tasksCreatedThisWeek: z.ZodNumber;
94
+ tasksCompletedThisWeek: z.ZodNumber;
95
+ averageCompletionTime: z.ZodNullable<z.ZodNumber>;
96
+ }, z.core.$strip>;
97
+ tasks: z.ZodArray<z.ZodObject<{
98
+ id: z.ZodString;
99
+ content: z.ZodString;
100
+ due: z.ZodOptional<z.ZodNullable<z.ZodString>>;
101
+ deadline: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
+ priority: z.ZodString;
103
+ isCompleted: z.ZodBoolean;
104
+ createdAt: z.ZodString;
105
+ updatedAt: z.ZodString;
106
+ completedAt: z.ZodNullable<z.ZodString>;
107
+ completedByUid: z.ZodNullable<z.ZodString>;
108
+ labels: z.ZodArray<z.ZodString>;
109
+ }, z.core.$strip>>;
110
+ language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
111
+ }, z.core.$strip>;
112
+ /** Full project context for health analysis. */
113
+ export type ProjectHealthContext = z.infer<typeof ProjectHealthContextSchema>;
114
+ export declare const ProjectProgressSchema: z.ZodObject<{
115
+ projectId: z.ZodString;
116
+ completedCount: z.ZodNumber;
117
+ activeCount: z.ZodNumber;
118
+ progressPercent: z.ZodNumber;
119
+ }, z.core.$strip>;
120
+ /** Project progress with completion counts and percentage. */
121
+ export type ProjectProgress = z.infer<typeof ProjectProgressSchema>;
122
+ export declare const ProjectInsightSchema: z.ZodObject<{
123
+ projectId: z.ZodString;
124
+ health: z.ZodNullable<z.ZodObject<{
125
+ status: z.ZodEnum<{
126
+ UNKNOWN: "UNKNOWN";
127
+ ON_TRACK: "ON_TRACK";
128
+ AT_RISK: "AT_RISK";
129
+ CRITICAL: "CRITICAL";
130
+ EXCELLENT: "EXCELLENT";
131
+ ERROR: "ERROR";
132
+ }>;
133
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
+ descriptionSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ taskRecommendations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
136
+ taskId: z.ZodString;
137
+ recommendation: z.ZodString;
138
+ }, z.core.$strip>>>>;
139
+ projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
141
+ isStale: z.ZodDefault<z.ZodBoolean>;
142
+ updateInProgress: z.ZodDefault<z.ZodBoolean>;
143
+ }, z.core.$strip>>;
144
+ progress: z.ZodNullable<z.ZodObject<{
145
+ projectId: z.ZodString;
146
+ completedCount: z.ZodNumber;
147
+ activeCount: z.ZodNumber;
148
+ progressPercent: z.ZodNumber;
149
+ }, z.core.$strip>>;
150
+ }, z.core.$strip>;
151
+ /** Insight data for a single project within a workspace. */
152
+ export type ProjectInsight = z.infer<typeof ProjectInsightSchema>;
153
+ export declare const WorkspaceInsightsSchema: z.ZodObject<{
154
+ folderId: z.ZodNullable<z.ZodString>;
155
+ projectInsights: z.ZodArray<z.ZodObject<{
156
+ projectId: z.ZodString;
157
+ health: z.ZodNullable<z.ZodObject<{
158
+ status: z.ZodEnum<{
159
+ UNKNOWN: "UNKNOWN";
160
+ ON_TRACK: "ON_TRACK";
161
+ AT_RISK: "AT_RISK";
162
+ CRITICAL: "CRITICAL";
163
+ EXCELLENT: "EXCELLENT";
164
+ ERROR: "ERROR";
165
+ }>;
166
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
167
+ descriptionSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ taskRecommendations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
169
+ taskId: z.ZodString;
170
+ recommendation: z.ZodString;
171
+ }, z.core.$strip>>>>;
172
+ projectId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
173
+ updatedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
174
+ isStale: z.ZodDefault<z.ZodBoolean>;
175
+ updateInProgress: z.ZodDefault<z.ZodBoolean>;
176
+ }, z.core.$strip>>;
177
+ progress: z.ZodNullable<z.ZodObject<{
178
+ projectId: z.ZodString;
179
+ completedCount: z.ZodNumber;
180
+ activeCount: z.ZodNumber;
181
+ progressPercent: z.ZodNumber;
182
+ }, z.core.$strip>>;
183
+ }, z.core.$strip>>;
184
+ }, z.core.$strip>;
185
+ /** Workspace insights grouped by folder. */
186
+ export type WorkspaceInsights = z.infer<typeof WorkspaceInsightsSchema>;
@@ -0,0 +1,2 @@
1
+ export * from './types.js';
2
+ export * from './requests.js';
@@ -0,0 +1,75 @@
1
+ import type { ColorKey } from '../../utils/colors.js';
2
+ import type { SearchArgs } from '../common.js';
3
+ import type { Label } from './types.js';
4
+ /**
5
+ * Arguments for retrieving labels.
6
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/get_labels_api_v1_labels_get
7
+ */
8
+ export type GetLabelsArgs = {
9
+ cursor?: string | null;
10
+ limit?: number;
11
+ };
12
+ /**
13
+ * Arguments for searching labels.
14
+ */
15
+ export type SearchLabelsArgs = SearchArgs;
16
+ /**
17
+ * Response from retrieving labels.
18
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/get_labels_api_v1_labels_get
19
+ */
20
+ export type GetLabelsResponse = {
21
+ results: Label[];
22
+ nextCursor: string | null;
23
+ };
24
+ /**
25
+ * Arguments for creating a new label.
26
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/create_label_api_v1_labels_post
27
+ */
28
+ export type AddLabelArgs = {
29
+ name: string;
30
+ order?: number | null;
31
+ color?: ColorKey;
32
+ isFavorite?: boolean;
33
+ };
34
+ /**
35
+ * Arguments for updating a label.
36
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/update_label_api_v1_labels__label_id__post
37
+ */
38
+ export type UpdateLabelArgs = {
39
+ name?: string;
40
+ order?: number | null;
41
+ color?: ColorKey;
42
+ isFavorite?: boolean;
43
+ };
44
+ /**
45
+ * Arguments for retrieving shared labels.
46
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
47
+ */
48
+ export type GetSharedLabelsArgs = {
49
+ omitPersonal?: boolean;
50
+ cursor?: string | null;
51
+ limit?: number;
52
+ };
53
+ /**
54
+ * Response from retrieving shared labels.
55
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_api_v1_labels_shared_get
56
+ */
57
+ export type GetSharedLabelsResponse = {
58
+ results: string[];
59
+ nextCursor: string | null;
60
+ };
61
+ /**
62
+ * Arguments for renaming a shared label.
63
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_rename_api_v1_labels_shared_rename_post
64
+ */
65
+ export type RenameSharedLabelArgs = {
66
+ name: string;
67
+ newName: string;
68
+ };
69
+ /**
70
+ * Arguments for removing a shared label.
71
+ * @see https://developer.todoist.com/api/v1/#tag/Labels/operation/shared_labels_remove_api_v1_labels_shared_remove_post
72
+ */
73
+ export type RemoveSharedLabelArgs = {
74
+ name: string;
75
+ };
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const LabelSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ order: z.ZodNullable<z.ZodNumber>;
5
+ name: z.ZodString;
6
+ color: z.ZodString;
7
+ isFavorite: z.ZodBoolean;
8
+ }, z.core.$strip>;
9
+ /**
10
+ * Represents a label in Todoist.
11
+ * @see https://developer.todoist.com/api/v1/#tag/Labels
12
+ */
13
+ export type Label = z.infer<typeof LabelSchema>;
@@ -0,0 +1 @@
1
+ export * from './types.js';
@@ -0,0 +1,115 @@
1
+ import { z } from 'zod';
2
+ export declare const StreakSchema: z.ZodObject<{
3
+ count: z.ZodNumber;
4
+ start: z.ZodString;
5
+ end: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export declare const CompletedItemSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ completed: z.ZodNumber;
10
+ }, z.core.$strip>;
11
+ export declare const ItemsWithDateSchema: z.ZodObject<{
12
+ items: z.ZodArray<z.ZodObject<{
13
+ id: z.ZodString;
14
+ completed: z.ZodNumber;
15
+ }, z.core.$strip>>;
16
+ totalCompleted: z.ZodNumber;
17
+ }, z.core.$strip>;
18
+ export declare const KarmaUpdateSchema: z.ZodObject<{
19
+ time: z.ZodString;
20
+ newKarma: z.ZodNumber;
21
+ positiveKarma: z.ZodNumber;
22
+ negativeKarma: z.ZodNumber;
23
+ positiveKarmaReasons: z.ZodArray<z.ZodAny>;
24
+ negativeKarmaReasons: z.ZodArray<z.ZodAny>;
25
+ }, z.core.$strip>;
26
+ export declare const ProductivityStatsSchema: z.ZodObject<{
27
+ completedCount: z.ZodNumber;
28
+ daysItems: z.ZodArray<z.ZodObject<{
29
+ items: z.ZodArray<z.ZodObject<{
30
+ id: z.ZodString;
31
+ completed: z.ZodNumber;
32
+ }, z.core.$strip>>;
33
+ totalCompleted: z.ZodNumber;
34
+ date: z.ZodString;
35
+ }, z.core.$strip>>;
36
+ goals: z.ZodObject<{
37
+ currentDailyStreak: z.ZodObject<{
38
+ count: z.ZodNumber;
39
+ start: z.ZodString;
40
+ end: z.ZodString;
41
+ }, z.core.$strip>;
42
+ currentWeeklyStreak: z.ZodObject<{
43
+ count: z.ZodNumber;
44
+ start: z.ZodString;
45
+ end: z.ZodString;
46
+ }, z.core.$strip>;
47
+ dailyGoal: z.ZodNumber;
48
+ ignoreDays: z.ZodArray<z.ZodNumber>;
49
+ karmaDisabled: z.ZodNumber;
50
+ lastDailyStreak: z.ZodObject<{
51
+ count: z.ZodNumber;
52
+ start: z.ZodString;
53
+ end: z.ZodString;
54
+ }, z.core.$strip>;
55
+ lastWeeklyStreak: z.ZodObject<{
56
+ count: z.ZodNumber;
57
+ start: z.ZodString;
58
+ end: z.ZodString;
59
+ }, z.core.$strip>;
60
+ maxDailyStreak: z.ZodObject<{
61
+ count: z.ZodNumber;
62
+ start: z.ZodString;
63
+ end: z.ZodString;
64
+ }, z.core.$strip>;
65
+ maxWeeklyStreak: z.ZodObject<{
66
+ count: z.ZodNumber;
67
+ start: z.ZodString;
68
+ end: z.ZodString;
69
+ }, z.core.$strip>;
70
+ user: z.ZodString;
71
+ userId: z.ZodString;
72
+ vacationMode: z.ZodNumber;
73
+ weeklyGoal: z.ZodNumber;
74
+ }, z.core.$strip>;
75
+ karma: z.ZodNumber;
76
+ karmaGraphData: z.ZodArray<z.ZodObject<{
77
+ date: z.ZodString;
78
+ karmaAvg: z.ZodNumber;
79
+ }, z.core.$strip>>;
80
+ karmaLastUpdate: z.ZodNumber;
81
+ karmaTrend: z.ZodString;
82
+ karmaUpdateReasons: z.ZodArray<z.ZodObject<{
83
+ time: z.ZodString;
84
+ newKarma: z.ZodNumber;
85
+ positiveKarma: z.ZodNumber;
86
+ negativeKarma: z.ZodNumber;
87
+ positiveKarmaReasons: z.ZodArray<z.ZodAny>;
88
+ negativeKarmaReasons: z.ZodArray<z.ZodAny>;
89
+ }, z.core.$strip>>;
90
+ projectColors: z.ZodRecord<z.ZodString, z.ZodString>;
91
+ weekItems: z.ZodArray<z.ZodObject<{
92
+ items: z.ZodArray<z.ZodObject<{
93
+ id: z.ZodString;
94
+ completed: z.ZodNumber;
95
+ }, z.core.$strip>>;
96
+ totalCompleted: z.ZodNumber;
97
+ from: z.ZodString;
98
+ to: z.ZodString;
99
+ }, z.core.$strip>>;
100
+ }, z.core.$strip>;
101
+ /**
102
+ * Represents the Productivity stats for the authenticated user.
103
+ * @see https://developer.todoist.com/api/v1/#tag/User/operation/get_productivity_stats_api_v1_tasks_completed_stats_get
104
+ */
105
+ export type ProductivityStats = z.infer<typeof ProductivityStatsSchema>;
106
+ export declare const ColorSchema: z.ZodObject<{
107
+ key: z.ZodString;
108
+ displayName: z.ZodString;
109
+ hexValue: z.ZodString;
110
+ }, z.core.$strip>;
111
+ /**
112
+ * Represents a color in Todoist.
113
+ * @see https://developer.todoist.com/api/v1/#tag/Colors
114
+ */
115
+ export type Color = z.infer<typeof ColorSchema>;
@@ -0,0 +1,2 @@
1
+ export * from './types.js';
2
+ export * from './requests.js';
@@ -0,0 +1,169 @@
1
+ import type { ColorKey } from '../../utils/colors.js';
2
+ import type { SearchArgs } from '../common.js';
3
+ import type { Comment } from '../comments/types.js';
4
+ import type { Section } from '../sections/types.js';
5
+ import type { Task } from '../tasks/types.js';
6
+ import type { User } from '../users/types.js';
7
+ import type { CollaboratorRole, WorkspaceRole } from '../workspaces/types.js';
8
+ import type { PersonalProject, ProjectViewStyle, ProjectVisibility, WorkspaceProject } from './types.js';
9
+ /**
10
+ * Arguments for retrieving projects.
11
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_projects_api_v1_projects_get
12
+ */
13
+ export type GetProjectsArgs = {
14
+ cursor?: string | null;
15
+ limit?: number;
16
+ };
17
+ /**
18
+ * Arguments for searching projects.
19
+ */
20
+ export type SearchProjectsArgs = SearchArgs;
21
+ /**
22
+ * Response from retrieving projects.
23
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_projects_api_v1_projects_get
24
+ */
25
+ export type GetProjectsResponse = {
26
+ results: (PersonalProject | WorkspaceProject)[];
27
+ nextCursor: string | null;
28
+ };
29
+ /**
30
+ * Arguments for retrieving archived projects.
31
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
32
+ */
33
+ export type GetArchivedProjectsArgs = {
34
+ cursor?: string | null;
35
+ limit?: number;
36
+ };
37
+ /**
38
+ * Response from retrieving archived projects.
39
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_archived_projects_api_v1_projects_archived_get
40
+ */
41
+ export type GetArchivedProjectsResponse = {
42
+ results: (PersonalProject | WorkspaceProject)[];
43
+ nextCursor: string | null;
44
+ };
45
+ /**
46
+ * Arguments for creating a new project.
47
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/create_project_api_v1_projects_post
48
+ */
49
+ export type AddProjectArgs = {
50
+ name: string;
51
+ parentId?: string;
52
+ color?: ColorKey;
53
+ isFavorite?: boolean;
54
+ viewStyle?: ProjectViewStyle;
55
+ workspaceId?: string;
56
+ };
57
+ /**
58
+ * Arguments for updating a project.
59
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/update_project_api_v1_projects__project_id__post
60
+ */
61
+ export type UpdateProjectArgs = {
62
+ name?: string;
63
+ color?: ColorKey;
64
+ isFavorite?: boolean;
65
+ viewStyle?: ProjectViewStyle;
66
+ };
67
+ /**
68
+ * Arguments for retrieving project collaborators.
69
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
70
+ */
71
+ export type GetProjectCollaboratorsArgs = {
72
+ cursor?: string | null;
73
+ limit?: number;
74
+ };
75
+ /**
76
+ * Response from retrieving project collaborators.
77
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/get_project_collaborators_api_v1_projects__project_id__collaborators_get
78
+ */
79
+ export type GetProjectCollaboratorsResponse = {
80
+ results: User[];
81
+ nextCursor: string | null;
82
+ };
83
+ /**
84
+ * Arguments for moving a project to a workspace.
85
+ */
86
+ export type MoveProjectToWorkspaceArgs = {
87
+ /** The ID of the project to move. */
88
+ projectId: string;
89
+ /** The target workspace ID. */
90
+ workspaceId: string;
91
+ /** Optional target folder ID within the workspace. */
92
+ folderId?: string | null;
93
+ /** Optional access settings for the project in the workspace. */
94
+ access?: {
95
+ visibility: ProjectVisibility;
96
+ };
97
+ };
98
+ /**
99
+ * Arguments for moving a project to personal.
100
+ */
101
+ export type MoveProjectToPersonalArgs = {
102
+ /** The ID of the project to move. */
103
+ projectId: string;
104
+ };
105
+ /**
106
+ * Arguments for counting archived projects.
107
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
108
+ */
109
+ export type GetArchivedProjectsCountArgs = {
110
+ workspaceId?: number | null;
111
+ joined?: boolean | null;
112
+ };
113
+ /**
114
+ * Response from counting archived projects.
115
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/count_projects_archived_api_v1_projects_archived_count_get
116
+ */
117
+ export type GetArchivedProjectsCountResponse = {
118
+ count: number;
119
+ };
120
+ /**
121
+ * An action permitted for a role.
122
+ */
123
+ export type ActionView = {
124
+ name: string;
125
+ };
126
+ /**
127
+ * A project collaborator role with its permitted actions.
128
+ */
129
+ export type ProjectRoleView = {
130
+ name: CollaboratorRole;
131
+ actions: ActionView[];
132
+ };
133
+ /**
134
+ * A workspace role with its permitted actions.
135
+ */
136
+ export type WorkspaceRoleView = {
137
+ name: WorkspaceRole;
138
+ actions: ActionView[];
139
+ };
140
+ /**
141
+ * Response from getting project permissions (role-to-action mappings).
142
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/permissions_api_v1_projects_permissions_get
143
+ */
144
+ export type GetProjectPermissionsResponse = {
145
+ projectCollaboratorActions: ProjectRoleView[];
146
+ workspaceCollaboratorActions: WorkspaceRoleView[];
147
+ };
148
+ /**
149
+ * Arguments for getting full project data.
150
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
151
+ */
152
+ export type GetFullProjectArgs = {
153
+ /**
154
+ * Required to access the public project without authentication.
155
+ */
156
+ publicKey?: string | null;
157
+ };
158
+ /**
159
+ * Response from getting full project data.
160
+ * @see https://developer.todoist.com/api/v1/#tag/Projects/operation/projects_full_data_api_v1_projects__project_id__full_get
161
+ */
162
+ export type GetFullProjectResponse = {
163
+ project: (PersonalProject | WorkspaceProject) | null;
164
+ commentsCount: number;
165
+ tasks: Task[];
166
+ sections: Section[];
167
+ collaborators: User[];
168
+ notes: Comment[];
169
+ };