@doist/todoist-api-typescript 7.9.0 → 7.10.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.
Files changed (343) hide show
  1. package/README.md +5 -204
  2. package/index.d.ts +1 -0
  3. package/index.js +1 -0
  4. package/index.mjs +1 -0
  5. package/package.json +12 -92
  6. package/LICENSE +0 -21
  7. package/dist/cjs/authentication.js +0 -204
  8. package/dist/cjs/consts/endpoints.js +0 -141
  9. package/dist/cjs/index.js +0 -20
  10. package/dist/cjs/package.json +0 -1
  11. package/dist/cjs/test-utils/asserts.js +0 -11
  12. package/dist/cjs/test-utils/msw-setup.js +0 -97
  13. package/dist/cjs/test-utils/obsidian-fetch-adapter.js +0 -53
  14. package/dist/cjs/test-utils/test-defaults.js +0 -240
  15. package/dist/cjs/todoist-api.js +0 -2623
  16. package/dist/cjs/transport/fetch-with-retry.js +0 -206
  17. package/dist/cjs/transport/http-client.js +0 -133
  18. package/dist/cjs/transport/http-dispatcher.js +0 -72
  19. package/dist/cjs/types/activity/index.js +0 -18
  20. package/dist/cjs/types/activity/requests.js +0 -2
  21. package/dist/cjs/types/activity/types.js +0 -28
  22. package/dist/cjs/types/backups/index.js +0 -18
  23. package/dist/cjs/types/backups/requests.js +0 -2
  24. package/dist/cjs/types/backups/types.js +0 -8
  25. package/dist/cjs/types/comments/index.js +0 -18
  26. package/dist/cjs/types/comments/requests.js +0 -2
  27. package/dist/cjs/types/comments/types.js +0 -60
  28. package/dist/cjs/types/common.js +0 -2
  29. package/dist/cjs/types/emails/index.js +0 -17
  30. package/dist/cjs/types/emails/requests.js +0 -5
  31. package/dist/cjs/types/errors.js +0 -29
  32. package/dist/cjs/types/folders/index.js +0 -17
  33. package/dist/cjs/types/folders/requests.js +0 -2
  34. package/dist/cjs/types/http.js +0 -24
  35. package/dist/cjs/types/id-mappings/index.js +0 -18
  36. package/dist/cjs/types/id-mappings/requests.js +0 -20
  37. package/dist/cjs/types/id-mappings/types.js +0 -12
  38. package/dist/cjs/types/index.js +0 -36
  39. package/dist/cjs/types/insights/index.js +0 -18
  40. package/dist/cjs/types/insights/requests.js +0 -2
  41. package/dist/cjs/types/insights/types.js +0 -84
  42. package/dist/cjs/types/labels/index.js +0 -18
  43. package/dist/cjs/types/labels/requests.js +0 -2
  44. package/dist/cjs/types/labels/types.js +0 -11
  45. package/dist/cjs/types/productivity/index.js +0 -17
  46. package/dist/cjs/types/productivity/types.js +0 -67
  47. package/dist/cjs/types/projects/index.js +0 -18
  48. package/dist/cjs/types/projects/requests.js +0 -2
  49. package/dist/cjs/types/projects/types.js +0 -56
  50. package/dist/cjs/types/reminders/index.js +0 -17
  51. package/dist/cjs/types/reminders/requests.js +0 -95
  52. package/dist/cjs/types/sections/index.js +0 -18
  53. package/dist/cjs/types/sections/requests.js +0 -2
  54. package/dist/cjs/types/sections/types.js +0 -22
  55. package/dist/cjs/types/sync/commands/calendars.js +0 -2
  56. package/dist/cjs/types/sync/commands/filters.js +0 -2
  57. package/dist/cjs/types/sync/commands/folders.js +0 -2
  58. package/dist/cjs/types/sync/commands/index.js +0 -35
  59. package/dist/cjs/types/sync/commands/labels.js +0 -5
  60. package/dist/cjs/types/sync/commands/notes.js +0 -2
  61. package/dist/cjs/types/sync/commands/notifications.js +0 -2
  62. package/dist/cjs/types/sync/commands/others.js +0 -2
  63. package/dist/cjs/types/sync/commands/project-view-options.js +0 -2
  64. package/dist/cjs/types/sync/commands/projects.js +0 -2
  65. package/dist/cjs/types/sync/commands/reminders.js +0 -2
  66. package/dist/cjs/types/sync/commands/sections.js +0 -2
  67. package/dist/cjs/types/sync/commands/shared.js +0 -20
  68. package/dist/cjs/types/sync/commands/sharing.js +0 -2
  69. package/dist/cjs/types/sync/commands/tasks.js +0 -2
  70. package/dist/cjs/types/sync/commands/view-options.js +0 -2
  71. package/dist/cjs/types/sync/commands/workspace-filters.js +0 -2
  72. package/dist/cjs/types/sync/commands/workspace-goals.js +0 -2
  73. package/dist/cjs/types/sync/commands/workspaces.js +0 -2
  74. package/dist/cjs/types/sync/index.js +0 -22
  75. package/dist/cjs/types/sync/request.js +0 -2
  76. package/dist/cjs/types/sync/resource-types.js +0 -40
  77. package/dist/cjs/types/sync/resources/calendars.js +0 -31
  78. package/dist/cjs/types/sync/resources/collaborators.js +0 -25
  79. package/dist/cjs/types/sync/resources/completed-info.js +0 -30
  80. package/dist/cjs/types/sync/resources/filters.js +0 -16
  81. package/dist/cjs/types/sync/resources/folders.js +0 -14
  82. package/dist/cjs/types/sync/resources/index.js +0 -33
  83. package/dist/cjs/types/sync/resources/live-notifications.js +0 -39
  84. package/dist/cjs/types/sync/resources/notes.js +0 -23
  85. package/dist/cjs/types/sync/resources/reminders.js +0 -50
  86. package/dist/cjs/types/sync/resources/suggestions.js +0 -42
  87. package/dist/cjs/types/sync/resources/tooltips.js +0 -10
  88. package/dist/cjs/types/sync/resources/user-plan-limits.js +0 -24
  89. package/dist/cjs/types/sync/resources/user-settings.js +0 -42
  90. package/dist/cjs/types/sync/resources/user.js +0 -120
  91. package/dist/cjs/types/sync/resources/view-options.js +0 -83
  92. package/dist/cjs/types/sync/resources/workspace-filters.js +0 -21
  93. package/dist/cjs/types/sync/resources/workspace-goals.js +0 -32
  94. package/dist/cjs/types/sync/resources/workspaces.js +0 -56
  95. package/dist/cjs/types/sync/response.js +0 -2
  96. package/dist/cjs/types/sync/user-preferences.js +0 -71
  97. package/dist/cjs/types/tasks/index.js +0 -18
  98. package/dist/cjs/types/tasks/requests.js +0 -2
  99. package/dist/cjs/types/tasks/types.js +0 -59
  100. package/dist/cjs/types/templates/index.js +0 -17
  101. package/dist/cjs/types/templates/requests.js +0 -2
  102. package/dist/cjs/types/uploads/index.js +0 -17
  103. package/dist/cjs/types/uploads/requests.js +0 -2
  104. package/dist/cjs/types/users/index.js +0 -17
  105. package/dist/cjs/types/users/types.js +0 -51
  106. package/dist/cjs/types/workspaces/index.js +0 -18
  107. package/dist/cjs/types/workspaces/requests.js +0 -2
  108. package/dist/cjs/types/workspaces/types.js +0 -137
  109. package/dist/cjs/utils/activity-helpers.js +0 -58
  110. package/dist/cjs/utils/case-conversion.js +0 -69
  111. package/dist/cjs/utils/colors.js +0 -143
  112. package/dist/cjs/utils/index.js +0 -25
  113. package/dist/cjs/utils/multipart-upload.js +0 -178
  114. package/dist/cjs/utils/processing-helpers.js +0 -18
  115. package/dist/cjs/utils/sanitization.js +0 -116
  116. package/dist/cjs/utils/sync-helpers.js +0 -22
  117. package/dist/cjs/utils/uncompletable-helpers.js +0 -60
  118. package/dist/cjs/utils/url-helpers.js +0 -74
  119. package/dist/cjs/utils/validators.js +0 -141
  120. package/dist/esm/authentication.js +0 -196
  121. package/dist/esm/consts/endpoints.js +0 -122
  122. package/dist/esm/index.js +0 -4
  123. package/dist/esm/test-utils/asserts.js +0 -8
  124. package/dist/esm/test-utils/msw-setup.js +0 -88
  125. package/dist/esm/test-utils/obsidian-fetch-adapter.js +0 -50
  126. package/dist/esm/test-utils/test-defaults.js +0 -237
  127. package/dist/esm/todoist-api.js +0 -2619
  128. package/dist/esm/transport/fetch-with-retry.js +0 -203
  129. package/dist/esm/transport/http-client.js +0 -128
  130. package/dist/esm/transport/http-dispatcher.js +0 -35
  131. package/dist/esm/types/activity/index.js +0 -2
  132. package/dist/esm/types/activity/requests.js +0 -1
  133. package/dist/esm/types/activity/types.js +0 -25
  134. package/dist/esm/types/backups/index.js +0 -2
  135. package/dist/esm/types/backups/requests.js +0 -1
  136. package/dist/esm/types/backups/types.js +0 -5
  137. package/dist/esm/types/comments/index.js +0 -2
  138. package/dist/esm/types/comments/requests.js +0 -1
  139. package/dist/esm/types/comments/types.js +0 -57
  140. package/dist/esm/types/common.js +0 -1
  141. package/dist/esm/types/emails/index.js +0 -1
  142. package/dist/esm/types/emails/requests.js +0 -2
  143. package/dist/esm/types/errors.js +0 -24
  144. package/dist/esm/types/folders/index.js +0 -1
  145. package/dist/esm/types/folders/requests.js +0 -1
  146. package/dist/esm/types/http.js +0 -20
  147. package/dist/esm/types/id-mappings/index.js +0 -2
  148. package/dist/esm/types/id-mappings/requests.js +0 -17
  149. package/dist/esm/types/id-mappings/types.js +0 -9
  150. package/dist/esm/types/index.js +0 -20
  151. package/dist/esm/types/insights/index.js +0 -2
  152. package/dist/esm/types/insights/requests.js +0 -1
  153. package/dist/esm/types/insights/types.js +0 -81
  154. package/dist/esm/types/labels/index.js +0 -2
  155. package/dist/esm/types/labels/requests.js +0 -1
  156. package/dist/esm/types/labels/types.js +0 -8
  157. package/dist/esm/types/productivity/index.js +0 -1
  158. package/dist/esm/types/productivity/types.js +0 -64
  159. package/dist/esm/types/projects/index.js +0 -2
  160. package/dist/esm/types/projects/requests.js +0 -1
  161. package/dist/esm/types/projects/types.js +0 -53
  162. package/dist/esm/types/reminders/index.js +0 -1
  163. package/dist/esm/types/reminders/requests.js +0 -92
  164. package/dist/esm/types/sections/index.js +0 -2
  165. package/dist/esm/types/sections/requests.js +0 -1
  166. package/dist/esm/types/sections/types.js +0 -19
  167. package/dist/esm/types/sync/commands/calendars.js +0 -1
  168. package/dist/esm/types/sync/commands/filters.js +0 -1
  169. package/dist/esm/types/sync/commands/folders.js +0 -1
  170. package/dist/esm/types/sync/commands/index.js +0 -19
  171. package/dist/esm/types/sync/commands/labels.js +0 -2
  172. package/dist/esm/types/sync/commands/notes.js +0 -1
  173. package/dist/esm/types/sync/commands/notifications.js +0 -1
  174. package/dist/esm/types/sync/commands/others.js +0 -1
  175. package/dist/esm/types/sync/commands/project-view-options.js +0 -1
  176. package/dist/esm/types/sync/commands/projects.js +0 -1
  177. package/dist/esm/types/sync/commands/reminders.js +0 -1
  178. package/dist/esm/types/sync/commands/sections.js +0 -1
  179. package/dist/esm/types/sync/commands/shared.js +0 -16
  180. package/dist/esm/types/sync/commands/sharing.js +0 -1
  181. package/dist/esm/types/sync/commands/tasks.js +0 -1
  182. package/dist/esm/types/sync/commands/view-options.js +0 -1
  183. package/dist/esm/types/sync/commands/workspace-filters.js +0 -1
  184. package/dist/esm/types/sync/commands/workspace-goals.js +0 -1
  185. package/dist/esm/types/sync/commands/workspaces.js +0 -1
  186. package/dist/esm/types/sync/index.js +0 -6
  187. package/dist/esm/types/sync/request.js +0 -1
  188. package/dist/esm/types/sync/resource-types.js +0 -37
  189. package/dist/esm/types/sync/resources/calendars.js +0 -28
  190. package/dist/esm/types/sync/resources/collaborators.js +0 -22
  191. package/dist/esm/types/sync/resources/completed-info.js +0 -27
  192. package/dist/esm/types/sync/resources/filters.js +0 -13
  193. package/dist/esm/types/sync/resources/folders.js +0 -11
  194. package/dist/esm/types/sync/resources/index.js +0 -17
  195. package/dist/esm/types/sync/resources/live-notifications.js +0 -36
  196. package/dist/esm/types/sync/resources/notes.js +0 -20
  197. package/dist/esm/types/sync/resources/reminders.js +0 -47
  198. package/dist/esm/types/sync/resources/suggestions.js +0 -39
  199. package/dist/esm/types/sync/resources/tooltips.js +0 -7
  200. package/dist/esm/types/sync/resources/user-plan-limits.js +0 -21
  201. package/dist/esm/types/sync/resources/user-settings.js +0 -39
  202. package/dist/esm/types/sync/resources/user.js +0 -117
  203. package/dist/esm/types/sync/resources/view-options.js +0 -80
  204. package/dist/esm/types/sync/resources/workspace-filters.js +0 -18
  205. package/dist/esm/types/sync/resources/workspace-goals.js +0 -29
  206. package/dist/esm/types/sync/resources/workspaces.js +0 -53
  207. package/dist/esm/types/sync/response.js +0 -1
  208. package/dist/esm/types/sync/user-preferences.js +0 -68
  209. package/dist/esm/types/tasks/index.js +0 -2
  210. package/dist/esm/types/tasks/requests.js +0 -1
  211. package/dist/esm/types/tasks/types.js +0 -56
  212. package/dist/esm/types/templates/index.js +0 -1
  213. package/dist/esm/types/templates/requests.js +0 -1
  214. package/dist/esm/types/uploads/index.js +0 -1
  215. package/dist/esm/types/uploads/requests.js +0 -1
  216. package/dist/esm/types/users/index.js +0 -1
  217. package/dist/esm/types/users/types.js +0 -48
  218. package/dist/esm/types/workspaces/index.js +0 -2
  219. package/dist/esm/types/workspaces/requests.js +0 -1
  220. package/dist/esm/types/workspaces/types.js +0 -134
  221. package/dist/esm/utils/activity-helpers.js +0 -53
  222. package/dist/esm/utils/case-conversion.js +0 -61
  223. package/dist/esm/utils/colors.js +0 -139
  224. package/dist/esm/utils/index.js +0 -4
  225. package/dist/esm/utils/multipart-upload.js +0 -142
  226. package/dist/esm/utils/processing-helpers.js +0 -12
  227. package/dist/esm/utils/sanitization.js +0 -112
  228. package/dist/esm/utils/sync-helpers.js +0 -19
  229. package/dist/esm/utils/uncompletable-helpers.js +0 -54
  230. package/dist/esm/utils/url-helpers.js +0 -68
  231. package/dist/esm/utils/validators.js +0 -132
  232. package/dist/types/authentication.d.ts +0 -158
  233. package/dist/types/consts/endpoints.d.ts +0 -81
  234. package/dist/types/index.d.ts +0 -4
  235. package/dist/types/test-utils/asserts.d.ts +0 -1
  236. package/dist/types/test-utils/msw-setup.d.ts +0 -33
  237. package/dist/types/test-utils/obsidian-fetch-adapter.d.ts +0 -29
  238. package/dist/types/test-utils/test-defaults.d.ts +0 -261
  239. package/dist/types/todoist-api.d.ts +0 -1018
  240. package/dist/types/transport/fetch-with-retry.d.ts +0 -12
  241. package/dist/types/transport/http-client.d.ts +0 -16
  242. package/dist/types/transport/http-dispatcher.d.ts +0 -3
  243. package/dist/types/types/activity/index.d.ts +0 -2
  244. package/dist/types/types/activity/requests.d.ts +0 -85
  245. package/dist/types/types/activity/types.d.ts +0 -49
  246. package/dist/types/types/backups/index.d.ts +0 -2
  247. package/dist/types/types/backups/requests.d.ts +0 -16
  248. package/dist/types/types/backups/types.d.ts +0 -7
  249. package/dist/types/types/comments/index.d.ts +0 -2
  250. package/dist/types/types/comments/requests.d.ts +0 -64
  251. package/dist/types/types/comments/types.d.ts +0 -141
  252. package/dist/types/types/common.d.ts +0 -6
  253. package/dist/types/types/emails/index.d.ts +0 -1
  254. package/dist/types/types/emails/requests.d.ts +0 -30
  255. package/dist/types/types/errors.d.ts +0 -12
  256. package/dist/types/types/folders/index.d.ts +0 -1
  257. package/dist/types/types/folders/requests.d.ts +0 -20
  258. package/dist/types/types/http.d.ts +0 -85
  259. package/dist/types/types/id-mappings/index.d.ts +0 -2
  260. package/dist/types/types/id-mappings/requests.d.ts +0 -28
  261. package/dist/types/types/id-mappings/types.d.ts +0 -13
  262. package/dist/types/types/index.d.ts +0 -20
  263. package/dist/types/types/insights/index.d.ts +0 -2
  264. package/dist/types/types/insights/requests.d.ts +0 -26
  265. package/dist/types/types/insights/types.d.ts +0 -186
  266. package/dist/types/types/labels/index.d.ts +0 -2
  267. package/dist/types/types/labels/requests.d.ts +0 -75
  268. package/dist/types/types/labels/types.d.ts +0 -13
  269. package/dist/types/types/productivity/index.d.ts +0 -1
  270. package/dist/types/types/productivity/types.d.ts +0 -115
  271. package/dist/types/types/projects/index.d.ts +0 -2
  272. package/dist/types/types/projects/requests.d.ts +0 -169
  273. package/dist/types/types/projects/types.d.ts +0 -201
  274. package/dist/types/types/reminders/index.d.ts +0 -1
  275. package/dist/types/types/reminders/requests.d.ts +0 -205
  276. package/dist/types/types/sections/index.d.ts +0 -2
  277. package/dist/types/types/sections/requests.d.ts +0 -41
  278. package/dist/types/types/sections/types.d.ts +0 -44
  279. package/dist/types/types/sync/commands/calendars.d.ts +0 -14
  280. package/dist/types/types/sync/commands/filters.d.ts +0 -22
  281. package/dist/types/types/sync/commands/folders.d.ts +0 -18
  282. package/dist/types/types/sync/commands/index.d.ts +0 -171
  283. package/dist/types/types/sync/commands/labels.d.ts +0 -32
  284. package/dist/types/types/sync/commands/notes.d.ts +0 -27
  285. package/dist/types/types/sync/commands/notifications.d.ts +0 -10
  286. package/dist/types/types/sync/commands/others.d.ts +0 -39
  287. package/dist/types/types/sync/commands/project-view-options.d.ts +0 -14
  288. package/dist/types/types/sync/commands/projects.d.ts +0 -90
  289. package/dist/types/types/sync/commands/reminders.d.ts +0 -51
  290. package/dist/types/types/sync/commands/sections.d.ts +0 -31
  291. package/dist/types/types/sync/commands/shared.d.ts +0 -51
  292. package/dist/types/types/sync/commands/sharing.d.ts +0 -16
  293. package/dist/types/types/sync/commands/tasks.d.ts +0 -78
  294. package/dist/types/types/sync/commands/view-options.d.ts +0 -15
  295. package/dist/types/types/sync/commands/workspace-filters.d.ts +0 -23
  296. package/dist/types/types/sync/commands/workspace-goals.d.ts +0 -24
  297. package/dist/types/types/sync/commands/workspaces.d.ts +0 -79
  298. package/dist/types/types/sync/index.d.ts +0 -6
  299. package/dist/types/types/sync/request.d.ts +0 -7
  300. package/dist/types/types/sync/resource-types.d.ts +0 -5
  301. package/dist/types/types/sync/resources/calendars.d.ts +0 -38
  302. package/dist/types/types/sync/resources/collaborators.d.ts +0 -28
  303. package/dist/types/types/sync/resources/completed-info.d.ts +0 -33
  304. package/dist/types/types/sync/resources/filters.d.ts +0 -12
  305. package/dist/types/types/sync/resources/folders.d.ts +0 -10
  306. package/dist/types/types/sync/resources/index.d.ts +0 -17
  307. package/dist/types/types/sync/resources/live-notifications.d.ts +0 -32
  308. package/dist/types/types/sync/resources/notes.d.ts +0 -34
  309. package/dist/types/types/sync/resources/reminders.d.ts +0 -126
  310. package/dist/types/types/sync/resources/suggestions.d.ts +0 -96
  311. package/dist/types/types/sync/resources/tooltips.d.ts +0 -6
  312. package/dist/types/types/sync/resources/user-plan-limits.d.ts +0 -41
  313. package/dist/types/types/sync/resources/user-settings.d.ts +0 -40
  314. package/dist/types/types/sync/resources/user.d.ts +0 -134
  315. package/dist/types/types/sync/resources/view-options.d.ts +0 -169
  316. package/dist/types/types/sync/resources/workspace-filters.d.ts +0 -17
  317. package/dist/types/types/sync/resources/workspace-goals.d.ts +0 -29
  318. package/dist/types/types/sync/resources/workspaces.d.ts +0 -57
  319. package/dist/types/types/sync/response.d.ts +0 -51
  320. package/dist/types/types/sync/user-preferences.d.ts +0 -39
  321. package/dist/types/types/tasks/index.d.ts +0 -2
  322. package/dist/types/types/tasks/requests.d.ts +0 -197
  323. package/dist/types/types/tasks/types.d.ts +0 -162
  324. package/dist/types/types/templates/index.d.ts +0 -1
  325. package/dist/types/types/templates/requests.d.ts +0 -92
  326. package/dist/types/types/uploads/index.d.ts +0 -1
  327. package/dist/types/types/uploads/requests.d.ts +0 -32
  328. package/dist/types/types/users/index.d.ts +0 -1
  329. package/dist/types/types/users/types.d.ts +0 -66
  330. package/dist/types/types/workspaces/index.d.ts +0 -2
  331. package/dist/types/types/workspaces/requests.d.ts +0 -260
  332. package/dist/types/types/workspaces/types.d.ts +0 -225
  333. package/dist/types/utils/activity-helpers.d.ts +0 -28
  334. package/dist/types/utils/case-conversion.d.ts +0 -12
  335. package/dist/types/utils/colors.d.ts +0 -197
  336. package/dist/types/utils/index.d.ts +0 -4
  337. package/dist/types/utils/multipart-upload.d.ts +0 -54
  338. package/dist/types/utils/processing-helpers.d.ts +0 -1
  339. package/dist/types/utils/sanitization.d.ts +0 -35
  340. package/dist/types/utils/sync-helpers.d.ts +0 -17
  341. package/dist/types/utils/uncompletable-helpers.d.ts +0 -30
  342. package/dist/types/utils/url-helpers.d.ts +0 -32
  343. package/dist/types/utils/validators.d.ts +0 -1406
@@ -1,1018 +0,0 @@
1
- import { Task, AddTaskArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateTaskArgs, QuickAddTaskArgs, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, SearchCompletedTasksArgs, GetTasksResponse, GetAllCompletedTasksArgs, GetAllCompletedTasksResponse } from './types/tasks/index.js';
2
- import { PersonalProject, WorkspaceProject, AddProjectArgs, UpdateProjectArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetProjectsResponse, GetProjectCollaboratorsResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, MoveProjectToWorkspaceArgs, MoveProjectToPersonalArgs, GetArchivedProjectsCountArgs, GetArchivedProjectsCountResponse, GetProjectPermissionsResponse, GetFullProjectArgs, GetFullProjectResponse } from './types/projects/index.js';
3
- import { Section, AddSectionArgs, UpdateSectionArgs, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse } from './types/sections/index.js';
4
- import { Label, AddLabelArgs, UpdateLabelArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetSharedLabelsArgs, GetSharedLabelsResponse, RenameSharedLabelArgs, RemoveSharedLabelArgs } from './types/labels/index.js';
5
- import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
6
- import { AddReminderArgs, UpdateReminderArgs, AddLocationReminderArgs, UpdateLocationReminderArgs, GetRemindersArgs, GetRemindersResponse, GetLocationRemindersArgs, GetLocationRemindersResponse } from './types/reminders/index.js';
7
- import { CurrentUser } from './types/users/index.js';
8
- import { ProductivityStats } from './types/productivity/index.js';
9
- import { GetActivityLogsArgs, GetActivityLogsResponse } from './types/activity/index.js';
10
- import { WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace, AddWorkspaceArgs, UpdateWorkspaceArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, UpdateWorkspaceUserArgs, RemoveWorkspaceUserArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/workspaces/index.js';
11
- import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
12
- import type { Folder } from './types/sync/resources/folders.js';
13
- import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
14
- import { Backup, GetBackupsArgs, DownloadBackupArgs } from './types/backups/index.js';
15
- import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
16
- import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
17
- import { UploadFileArgs, DeleteUploadArgs } from './types/uploads/index.js';
18
- import { ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ImportTemplateIntoProjectArgs, ImportTemplateFromIdArgs, ImportTemplateResponse } from './types/templates/index.js';
19
- import { CustomFetch, CustomFetchResponse } from './types/http.js';
20
- import type { Reminder } from './types/index.js';
21
- import { type SyncResponse, type SyncRequest } from './types/sync/index.js';
22
- /**
23
- * Response from viewAttachment, extending CustomFetchResponse with
24
- * arrayBuffer() support for binary file content.
25
- */
26
- export type FileResponse = CustomFetchResponse & {
27
- arrayBuffer(): Promise<ArrayBuffer>;
28
- };
29
- /**
30
- * Configuration options for the TodoistApi constructor
31
- */
32
- export type TodoistApiOptions = {
33
- /**
34
- * Optional custom API base URL. If not provided, defaults to Todoist's standard API endpoint
35
- */
36
- baseUrl?: string;
37
- /**
38
- * Optional custom fetch function for alternative HTTP clients (e.g., Obsidian's requestUrl, React Native fetch)
39
- */
40
- customFetch?: CustomFetch;
41
- };
42
- export declare class TodoistApi {
43
- private authToken;
44
- private syncApiBase;
45
- private customFetch?;
46
- constructor(
47
- /**
48
- * Your Todoist API token.
49
- */
50
- authToken: string,
51
- /**
52
- * Optional configuration options
53
- */
54
- options?: TodoistApiOptions);
55
- /**
56
- * Makes a request to the Sync API and handles error checking.
57
- *
58
- * @param syncRequest - The sync request payload
59
- * @param requestId - Optional request identifier
60
- * @param hasSyncCommands - Whether this request contains sync commands (write operations)
61
- * @returns The sync response data
62
- * @throws TodoistRequestError if sync status contains errors
63
- */
64
- private requestSync;
65
- /**
66
- * Executes a raw Sync API request.
67
- *
68
- * This method provides direct access to the Sync API, allowing you to send
69
- * strongly-typed commands and request specific resource types.
70
- *
71
- * @param request - The sync request payload containing commands and/or resource types.
72
- * @param requestId - Optional custom identifier for the request.
73
- * @returns A promise that resolves to the sync response.
74
- * @throws TodoistRequestError if the sync status contains errors.
75
- *
76
- * @example
77
- * ```typescript
78
- * import { createCommand } from '@doist/todoist-api-typescript'
79
- *
80
- * const response = await api.sync({
81
- * commands: [
82
- * createCommand('item_add', { content: 'Buy milk' }),
83
- * ],
84
- * resourceTypes: ['items'],
85
- * syncToken: '*',
86
- * })
87
- * ```
88
- */
89
- sync(syncRequest: SyncRequest, requestId?: string): Promise<SyncResponse>;
90
- /**
91
- * Retrieves information about the authenticated user.
92
- *
93
- * @returns A promise that resolves to the current user's information.
94
- */
95
- getUser(): Promise<CurrentUser>;
96
- /**
97
- * Retrieves a single active (non-completed) task by its ID.
98
- *
99
- * @param id - The unique identifier of the task.
100
- * @returns A promise that resolves to the requested task.
101
- */
102
- getTask(id: string): Promise<Task>;
103
- /**
104
- * Retrieves a list of active tasks filtered by specific parameters.
105
- *
106
- * @param args - Filter parameters such as project ID, label ID, or due date.
107
- * @returns A promise that resolves to an array of tasks.
108
- */
109
- getTasks(args?: GetTasksArgs): Promise<GetTasksResponse>;
110
- /**
111
- * Retrieves tasks filtered by a filter string.
112
- *
113
- * @param args - Parameters for filtering tasks, including the query string and optional language.
114
- * @returns A promise that resolves to a paginated response of tasks.
115
- */
116
- getTasksByFilter(args: GetTasksByFilterArgs): Promise<GetTasksResponse>;
117
- /**
118
- * Retrieves completed tasks by completion date.
119
- *
120
- * @param args - Parameters for filtering, including required since, until.
121
- * @returns A promise that resolves to a paginated response of completed tasks.
122
- */
123
- getCompletedTasksByCompletionDate(args: GetCompletedTasksByCompletionDateArgs): Promise<GetCompletedTasksResponse>;
124
- /**
125
- * Retrieves completed tasks by due date.
126
- *
127
- * @param args - Parameters for filtering, including required since, until.
128
- * @returns A promise that resolves to a paginated response of completed tasks.
129
- */
130
- getCompletedTasksByDueDate(args: GetCompletedTasksByDueDateArgs): Promise<GetCompletedTasksResponse>;
131
- /**
132
- * Searches completed tasks by query string.
133
- *
134
- * @param args - Parameters for searching, including the query string.
135
- * @returns A promise that resolves to a paginated response of completed tasks.
136
- */
137
- searchCompletedTasks(args: SearchCompletedTasksArgs): Promise<GetCompletedTasksResponse>;
138
- /**
139
- * Retrieves all completed tasks with optional filters.
140
- *
141
- * Uses offset-based pagination rather than cursor-based.
142
- *
143
- * @param args - Optional parameters including project ID, label, date range, and pagination.
144
- * @returns A promise that resolves to completed tasks with associated project and section data.
145
- */
146
- getAllCompletedTasks(args?: GetAllCompletedTasksArgs): Promise<GetAllCompletedTasksResponse>;
147
- /**
148
- * Creates a new task with the provided parameters.
149
- *
150
- * @param args - Task creation parameters such as content, due date, or priority.
151
- * @param requestId - Optional custom identifier for the request.
152
- * @returns A promise that resolves to the created task.
153
- */
154
- addTask(args: AddTaskArgs, requestId?: string): Promise<Task>;
155
- /**
156
- * Quickly adds a task using natural language processing for due dates.
157
- *
158
- * @param args - Quick add task parameters, including content and due date.
159
- * @returns A promise that resolves to the created task.
160
- */
161
- quickAddTask(args: QuickAddTaskArgs): Promise<Task>;
162
- /**
163
- * Updates an existing task by its ID with the provided parameters.
164
- *
165
- * @param id - The unique identifier of the task to update.
166
- * @param args - Update parameters such as content, priority, or due date. Pass
167
- * `dueString: null` (or `"no date"`) to clear the due date.
168
- * @param requestId - Optional custom identifier for the request.
169
- * @returns A promise that resolves to the updated task.
170
- */
171
- updateTask(id: string, args: UpdateTaskArgs, requestId?: string): Promise<Task>;
172
- /**
173
- * Moves existing tasks by their ID to either a different parent/section/project.
174
- *
175
- * @param ids - The unique identifier of the tasks to be moved.
176
- * @param args - The paramets that should contain only one of projectId, sectionId, or parentId
177
- * @param requestId - Optional custom identifier for the request.
178
- * @returns - A promise that resolves to an array of the updated tasks.
179
- */
180
- moveTasks(ids: string[], args: MoveTaskArgs, requestId?: string): Promise<Task[]>;
181
- /**
182
- * Moves a task by its ID to either a different parent/section/project.
183
- *
184
- * @param id - The unique identifier of the task to be moved.
185
- * @param args - The parameters that should contain exactly one of projectId, sectionId, or parentId
186
- * @param requestId - Optional custom identifier for the request.
187
- * @returns A promise that resolves to the updated task.
188
- */
189
- moveTask(id: string, args: MoveTaskArgs, requestId?: string): Promise<Task>;
190
- /**
191
- * Closes (completes) a task by its ID.
192
- *
193
- * @param id - The unique identifier of the task to close.
194
- * @param requestId - Optional custom identifier for the request.
195
- * @returns A promise that resolves to `true` if successful.
196
- */
197
- closeTask(id: string, requestId?: string): Promise<boolean>;
198
- /**
199
- * Reopens a previously closed (completed) task by its ID.
200
- *
201
- * @param id - The unique identifier of the task to reopen.
202
- * @param requestId - Optional custom identifier for the request.
203
- * @returns A promise that resolves to `true` if successful.
204
- */
205
- reopenTask(id: string, requestId?: string): Promise<boolean>;
206
- /**
207
- * Deletes a task by its ID.
208
- *
209
- * @param id - The unique identifier of the task to delete.
210
- * @param requestId - Optional custom identifier for the request.
211
- * @returns A promise that resolves to `true` if successful.
212
- */
213
- deleteTask(id: string, requestId?: string): Promise<boolean>;
214
- /**
215
- * Retrieves a project by its ID.
216
- *
217
- * @param id - The unique identifier of the project.
218
- * @returns A promise that resolves to the requested project.
219
- */
220
- getProject(id: string): Promise<PersonalProject | WorkspaceProject>;
221
- /**
222
- * Retrieves all projects with optional filters.
223
- *
224
- * @param args - Optional filters for retrieving projects.
225
- * @returns A promise that resolves to an array of projects.
226
- */
227
- getProjects(args?: GetProjectsArgs): Promise<GetProjectsResponse>;
228
- /**
229
- * Searches projects by name.
230
- *
231
- * @param args - Search parameters including the query string.
232
- * @returns A promise that resolves to a paginated response of projects.
233
- */
234
- searchProjects(args: SearchProjectsArgs): Promise<GetProjectsResponse>;
235
- /**
236
- * Retrieves all archived projects with optional filters.
237
- *
238
- * @param args - Optional filters for retrieving archived projects.
239
- * @returns A promise that resolves to an array of archived projects.
240
- */
241
- getArchivedProjects(args?: GetArchivedProjectsArgs): Promise<GetArchivedProjectsResponse>;
242
- /**
243
- * Creates a new project with the provided parameters.
244
- *
245
- * @param args - Project creation parameters such as name or color.
246
- * @param requestId - Optional custom identifier for the request.
247
- * @returns A promise that resolves to the created project.
248
- */
249
- addProject(args: AddProjectArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
250
- /**
251
- * Updates an existing project by its ID with the provided parameters.
252
- *
253
- * @param id - The unique identifier of the project to update.
254
- * @param args - Update parameters such as name or color.
255
- * @param requestId - Optional custom identifier for the request.
256
- * @returns A promise that resolves to the updated project.
257
- */
258
- updateProject(id: string, args: UpdateProjectArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
259
- /**
260
- * Deletes a project by its ID.
261
- *
262
- * @param id - The unique identifier of the project to delete.
263
- * @param requestId - Optional custom identifier for the request.
264
- * @returns A promise that resolves to `true` if successful.
265
- */
266
- deleteProject(id: string, requestId?: string): Promise<boolean>;
267
- /**
268
- * Archives a project by its ID.
269
- *
270
- * @param id - The unique identifier of the project to archive.
271
- * @param requestId - Optional custom identifier for the request.
272
- * @returns A promise that resolves to the updated project.
273
- */
274
- archiveProject(id: string, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
275
- /**
276
- * Unarchives a project by its ID.
277
- *
278
- * @param id - The unique identifier of the project to unarchive.
279
- * @param requestId - Optional custom identifier for the request.
280
- * @returns A promise that resolves to the updated project.
281
- */
282
- unarchiveProject(id: string, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
283
- /**
284
- * Moves a project to a workspace.
285
- *
286
- * @param args - The arguments for moving the project.
287
- * @param requestId - Optional custom identifier for the request.
288
- * @returns A promise that resolves to the moved project.
289
- */
290
- moveProjectToWorkspace(args: MoveProjectToWorkspaceArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
291
- /**
292
- * Moves a project to personal.
293
- *
294
- * @param args - The arguments for moving the project.
295
- * @param requestId - Optional custom identifier for the request.
296
- * @returns A promise that resolves to the moved project.
297
- */
298
- moveProjectToPersonal(args: MoveProjectToPersonalArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
299
- /**
300
- * Counts the number of archived projects.
301
- *
302
- * @param args - Optional parameters to filter the count.
303
- * @returns A promise that resolves to the count of archived projects.
304
- */
305
- getArchivedProjectsCount(args?: GetArchivedProjectsCountArgs): Promise<GetArchivedProjectsCountResponse>;
306
- /**
307
- * Retrieves the role-to-action permission mappings for projects.
308
- *
309
- * @returns A promise that resolves to the permission mappings.
310
- */
311
- getProjectPermissions(): Promise<GetProjectPermissionsResponse>;
312
- /**
313
- * Retrieves full project data including tasks, sections, collaborators, and notes.
314
- *
315
- * @param id - The unique identifier of the project.
316
- * @param args - Optional parameters.
317
- * @returns A promise that resolves to the full project data.
318
- */
319
- getFullProject(id: string, args?: GetFullProjectArgs): Promise<GetFullProjectResponse>;
320
- /**
321
- * Joins a shared project by its ID.
322
- *
323
- * @param id - The unique identifier of the project to join.
324
- * @param requestId - Optional custom identifier for the request.
325
- * @returns A promise that resolves to the joined project.
326
- */
327
- joinProject(id: string, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
328
- /**
329
- * Retrieves a list of collaborators for a specific project.
330
- *
331
- * @param projectId - The unique identifier of the project.
332
- * @param args - Optional parameters to filter collaborators.
333
- * @returns A promise that resolves to an array of collaborators for the project.
334
- */
335
- getProjectCollaborators(projectId: string, args?: GetProjectCollaboratorsArgs): Promise<GetProjectCollaboratorsResponse>;
336
- /**
337
- * Retrieves activity statistics for a project.
338
- *
339
- * @param projectId - The unique identifier of the project.
340
- * @param args - Optional parameters including weeks and weekly counts flag.
341
- * @returns A promise that resolves to the project activity stats.
342
- */
343
- getProjectActivityStats(projectId: string, args?: GetProjectActivityStatsArgs): Promise<ProjectActivityStats>;
344
- /**
345
- * Retrieves the health status of a project.
346
- *
347
- * @param projectId - The unique identifier of the project.
348
- * @returns A promise that resolves to the project health data.
349
- */
350
- getProjectHealth(projectId: string): Promise<ProjectHealth>;
351
- /**
352
- * Retrieves the health context for a project, including metrics and task details.
353
- *
354
- * @param projectId - The unique identifier of the project.
355
- * @returns A promise that resolves to the project health context.
356
- */
357
- getProjectHealthContext(projectId: string): Promise<ProjectHealthContext>;
358
- /**
359
- * Retrieves progress information for a project.
360
- *
361
- * @param projectId - The unique identifier of the project.
362
- * @returns A promise that resolves to the project progress data.
363
- */
364
- getProjectProgress(projectId: string): Promise<ProjectProgress>;
365
- /**
366
- * Retrieves insights for all projects in a workspace.
367
- *
368
- * @param workspaceId - The unique identifier of the workspace.
369
- * @param args - Optional parameters including project IDs filter.
370
- * @returns A promise that resolves to workspace insights data.
371
- */
372
- getWorkspaceInsights(workspaceId: string, args?: GetWorkspaceInsightsArgs): Promise<WorkspaceInsights>;
373
- /**
374
- * Triggers a health analysis for a project.
375
- *
376
- * @param projectId - The unique identifier of the project.
377
- * @param requestId - Optional custom identifier for the request.
378
- * @returns A promise that resolves to the updated project health data.
379
- */
380
- analyzeProjectHealth(projectId: string, requestId?: string): Promise<ProjectHealth>;
381
- /**
382
- * Retrieves all sections within a specific project or matching criteria.
383
- *
384
- * @param args - Filter parameters such as project ID. If no projectId is provided,
385
- * all sections are returned.
386
- * @returns A promise that resolves to an array of sections.
387
- */
388
- getSections(args?: GetSectionsArgs): Promise<GetSectionsResponse>;
389
- /**
390
- * Searches sections by name.
391
- *
392
- * @param args - Search parameters including the query string.
393
- * @returns A promise that resolves to a paginated response of sections.
394
- */
395
- searchSections(args: SearchSectionsArgs): Promise<GetSectionsResponse>;
396
- /**
397
- * Retrieves a single section by its ID.
398
- *
399
- * @param id - The unique identifier of the section.
400
- * @returns A promise that resolves to the requested section.
401
- */
402
- getSection(id: string): Promise<Section>;
403
- /**
404
- * Creates a new section within a project.
405
- *
406
- * @param args - Section creation parameters such as name or project ID.
407
- * @param requestId - Optional custom identifier for the request.
408
- * @returns A promise that resolves to the created section.
409
- */
410
- addSection(args: AddSectionArgs, requestId?: string): Promise<Section>;
411
- /**
412
- * Updates a section by its ID with the provided parameters.
413
- *
414
- * @param id - The unique identifier of the section to update.
415
- * @param args - Update parameters such as name or project ID.
416
- * @param requestId - Optional custom identifier for the request.
417
- * @returns A promise that resolves to the updated section.
418
- */
419
- updateSection(id: string, args: UpdateSectionArgs, requestId?: string): Promise<Section>;
420
- /**
421
- * Deletes a section by its ID.
422
- *
423
- * @param id - The unique identifier of the section to delete.
424
- * @param requestId - Optional custom identifier for the request.
425
- * @returns A promise that resolves to `true` if successful.
426
- */
427
- deleteSection(id: string, requestId?: string): Promise<boolean>;
428
- /**
429
- * Archives a section by its ID.
430
- *
431
- * @param id - The unique identifier of the section to archive.
432
- * @param requestId - Optional custom identifier for the request.
433
- * @returns A promise that resolves to the updated section.
434
- */
435
- archiveSection(id: string, requestId?: string): Promise<Section>;
436
- /**
437
- * Unarchives a section by its ID.
438
- *
439
- * @param id - The unique identifier of the section to unarchive.
440
- * @param requestId - Optional custom identifier for the request.
441
- * @returns A promise that resolves to the updated section.
442
- */
443
- unarchiveSection(id: string, requestId?: string): Promise<Section>;
444
- /**
445
- * Retrieves a label by its ID.
446
- *
447
- * @param id - The unique identifier of the label.
448
- * @returns A promise that resolves to the requested label.
449
- */
450
- getLabel(id: string): Promise<Label>;
451
- /**
452
- * Retrieves all labels.
453
- *
454
- * @param args - Optional filter parameters.
455
- * @returns A promise that resolves to an array of labels.
456
- */
457
- getLabels(args?: GetLabelsArgs): Promise<GetLabelsResponse>;
458
- /**
459
- * Searches labels by name.
460
- *
461
- * @param args - Search parameters including the query string.
462
- * @returns A promise that resolves to a paginated response of labels.
463
- */
464
- searchLabels(args: SearchLabelsArgs): Promise<GetLabelsResponse>;
465
- /**
466
- * Adds a new label.
467
- *
468
- * @param args - Label creation parameters such as name.
469
- * @param requestId - Optional custom identifier for the request.
470
- * @returns A promise that resolves to the created label.
471
- */
472
- addLabel(args: AddLabelArgs, requestId?: string): Promise<Label>;
473
- /**
474
- * Updates an existing label by its ID.
475
- *
476
- * @param id - The unique identifier of the label to update.
477
- * @param args - Update parameters such as name or color.
478
- * @param requestId - Optional custom identifier for the request.
479
- * @returns A promise that resolves to the updated label.
480
- */
481
- updateLabel(id: string, args: UpdateLabelArgs, requestId?: string): Promise<Label>;
482
- /**
483
- * Deletes a label by its ID.
484
- *
485
- * @param id - The unique identifier of the label to delete.
486
- * @param requestId - Optional custom identifier for the request.
487
- * @returns A promise that resolves to `true` if successful.
488
- */
489
- deleteLabel(id: string, requestId?: string): Promise<boolean>;
490
- /**
491
- * Retrieves a list of shared labels.
492
- *
493
- * @param args - Optional parameters to filter shared labels.
494
- * @returns A promise that resolves to an array of shared labels.
495
- */
496
- getSharedLabels(args?: GetSharedLabelsArgs): Promise<GetSharedLabelsResponse>;
497
- /**
498
- * Renames an existing shared label.
499
- *
500
- * @param args - Parameters for renaming the shared label, including the current and new name.
501
- * @returns A promise that resolves to `true` if successful.
502
- */
503
- renameSharedLabel(args: RenameSharedLabelArgs): Promise<boolean>;
504
- /**
505
- * Removes a shared label.
506
- *
507
- * @param args - Parameters for removing the shared label.
508
- * @returns A promise that resolves to `true` if successful.
509
- */
510
- removeSharedLabel(args: RemoveSharedLabelArgs): Promise<boolean>;
511
- /**
512
- * Retrieves all comments associated with a task or project.
513
- *
514
- * @param args - Parameters for retrieving comments, such as task ID or project ID.
515
- * @returns A promise that resolves to an array of comments.
516
- */
517
- getComments(args: GetTaskCommentsArgs | GetProjectCommentsArgs): Promise<GetCommentsResponse>;
518
- /**
519
- * Retrieves a specific comment by its ID.
520
- *
521
- * @param id - The unique identifier of the comment to retrieve.
522
- * @returns A promise that resolves to the requested comment.
523
- */
524
- getComment(id: string): Promise<Comment>;
525
- /**
526
- * Adds a comment to a task or project.
527
- *
528
- * @param args - Parameters for creating the comment, such as content and the target task or project ID.
529
- * @param requestId - Optional custom identifier for the request.
530
- * @returns A promise that resolves to the created comment.
531
- */
532
- addComment(args: AddCommentArgs, requestId?: string): Promise<Comment>;
533
- /**
534
- * Updates an existing comment by its ID.
535
- *
536
- * @param id - The unique identifier of the comment to update.
537
- * @param args - Update parameters such as new content.
538
- * @param requestId - Optional custom identifier for the request.
539
- * @returns A promise that resolves to the updated comment.
540
- */
541
- updateComment(id: string, args: UpdateCommentArgs, requestId?: string): Promise<Comment>;
542
- /**
543
- * Deletes a comment by its ID.
544
- *
545
- * @param id - The unique identifier of the comment to delete.
546
- * @param requestId - Optional custom identifier for the request.
547
- * @returns A promise that resolves to `true` if successful.
548
- */
549
- deleteComment(id: string, requestId?: string): Promise<boolean>;
550
- /**
551
- * Retrieves a paginated list of time-based reminders.
552
- *
553
- * @param args - Optional parameters including task ID filter and pagination.
554
- * @returns A promise that resolves to a paginated list of reminders.
555
- */
556
- getReminders(args?: GetRemindersArgs): Promise<GetRemindersResponse>;
557
- /**
558
- * Retrieves a paginated list of location-based reminders.
559
- *
560
- * @param args - Optional parameters including task ID filter and pagination.
561
- * @returns A promise that resolves to a paginated list of location reminders.
562
- */
563
- getLocationReminders(args?: GetLocationRemindersArgs): Promise<GetLocationRemindersResponse>;
564
- /**
565
- * Retrieves a time-based reminder by its ID.
566
- *
567
- * @param id - The unique identifier of the reminder to retrieve.
568
- * @returns A promise that resolves to the requested reminder.
569
- */
570
- getReminder(id: string): Promise<Reminder>;
571
- /**
572
- * Retrieves a location reminder by its ID.
573
- *
574
- * @param id - The unique identifier of the location reminder to retrieve.
575
- * @returns A promise that resolves to the requested reminder.
576
- */
577
- getLocationReminder(id: string): Promise<Reminder>;
578
- /**
579
- * Creates a time-based reminder for a task.
580
- *
581
- * @param args - Reminder creation parameters for relative or absolute reminders.
582
- * @param requestId - Optional custom identifier for the request.
583
- * @returns A promise that resolves to the created reminder.
584
- */
585
- addReminder(args: AddReminderArgs, requestId?: string): Promise<Reminder>;
586
- /**
587
- * Creates a location reminder for a task.
588
- *
589
- * @param args - Location reminder creation parameters.
590
- * @param requestId - Optional custom identifier for the request.
591
- * @returns A promise that resolves to the created reminder.
592
- */
593
- addLocationReminder(args: AddLocationReminderArgs, requestId?: string): Promise<Reminder>;
594
- /**
595
- * Updates an existing time-based reminder.
596
- *
597
- * @param id - The unique identifier of the reminder to update.
598
- * @param args - Reminder update parameters.
599
- * @param requestId - Optional custom identifier for the request.
600
- * @returns A promise that resolves to the updated reminder.
601
- */
602
- updateReminder(id: string, args: UpdateReminderArgs, requestId?: string): Promise<Reminder>;
603
- /**
604
- * Updates an existing location reminder.
605
- *
606
- * @param id - The unique identifier of the location reminder to update.
607
- * @param args - Location reminder update parameters.
608
- * @param requestId - Optional custom identifier for the request.
609
- * @returns A promise that resolves to the updated reminder.
610
- */
611
- updateLocationReminder(id: string, args: UpdateLocationReminderArgs, requestId?: string): Promise<Reminder>;
612
- /**
613
- * Deletes a time-based reminder by its ID.
614
- *
615
- * @param id - The unique identifier of the reminder to delete.
616
- * @param requestId - Optional custom identifier for the request.
617
- * @returns A promise that resolves to `true` if successful.
618
- */
619
- deleteReminder(id: string, requestId?: string): Promise<boolean>;
620
- /**
621
- * Deletes a location reminder by its ID.
622
- *
623
- * @param id - The unique identifier of the location reminder to delete.
624
- * @param requestId - Optional custom identifier for the request.
625
- * @returns A promise that resolves to `true` if successful.
626
- */
627
- deleteLocationReminder(id: string, requestId?: string): Promise<boolean>;
628
- /**
629
- * Retrieves productivity stats for the authenticated user.
630
- *
631
- * @returns A promise that resolves to the productivity stats.
632
- */
633
- getProductivityStats(): Promise<ProductivityStats>;
634
- /**
635
- * Retrieves activity logs with optional filters.
636
- *
637
- * @param args - Optional filter parameters for activity logs.
638
- * @returns A promise that resolves to a paginated response of activity events.
639
- */
640
- getActivityLogs(args?: GetActivityLogsArgs): Promise<GetActivityLogsResponse>;
641
- /**
642
- * Uploads a file and returns attachment metadata.
643
- * This creates an upload record that can be referenced in tasks or comments.
644
- *
645
- * @param args - Upload parameters including file content, filename, and optional project ID.
646
- * @param requestId - Optional custom identifier for the request.
647
- * @returns A promise that resolves to the uploaded file's attachment metadata.
648
- *
649
- * @example
650
- * ```typescript
651
- * // Upload from a file path
652
- * const upload = await api.uploadFile({
653
- * file: '/path/to/document.pdf',
654
- * projectId: '12345'
655
- * })
656
- *
657
- * // Upload from a Buffer
658
- * const buffer = fs.readFileSync('/path/to/document.pdf')
659
- * const upload = await api.uploadFile({
660
- * file: buffer,
661
- * fileName: 'document.pdf', // Required for Buffer/Stream
662
- * projectId: '12345'
663
- * })
664
- *
665
- * // Use the returned fileUrl in a comment
666
- * await api.addComment({
667
- * content: 'See attached document',
668
- * taskId: '67890',
669
- * attachment: {
670
- * fileUrl: upload.fileUrl,
671
- * fileName: upload.fileName,
672
- * fileType: upload.fileType,
673
- * resourceType: upload.resourceType
674
- * }
675
- * })
676
- * ```
677
- */
678
- uploadFile(args: UploadFileArgs, requestId?: string): Promise<Attachment>;
679
- /**
680
- * Deletes an uploaded file by its URL.
681
- *
682
- * @param args - The file URL to delete.
683
- * @param requestId - Optional custom identifier for the request.
684
- * @returns A promise that resolves to `true` if deletion was successful.
685
- *
686
- * @example
687
- * ```typescript
688
- * await api.deleteUpload({
689
- * fileUrl: 'https://cdn.todoist.com/...'
690
- * })
691
- * ```
692
- */
693
- deleteUpload(args: DeleteUploadArgs, requestId?: string): Promise<boolean>;
694
- /**
695
- * Fetches the content of a file attachment from a Todoist comment.
696
- *
697
- * Accepts either a Comment object (extracts the file URL from its attachment)
698
- * or a direct file URL string. Returns the raw Response object so the caller
699
- * can read the body in the appropriate format (.arrayBuffer(), .text(), etc.).
700
- *
701
- * @param commentOrUrl - A Comment object with a file attachment, or a file URL string.
702
- * @returns The raw fetch Response for the file content.
703
- * @throws Error if a Comment is provided without a file attachment or file URL.
704
- *
705
- * @example
706
- * ```typescript
707
- * // From a comment object
708
- * const comments = await api.getComments({ taskId: '12345' })
709
- * const comment = comments.results[0]
710
- * const response = await api.viewAttachment(comment)
711
- * const imageData = await response.arrayBuffer()
712
- *
713
- * // From a URL string
714
- * const response = await api.viewAttachment('https://files.todoist.com/...')
715
- * const text = await response.text()
716
- * ```
717
- */
718
- viewAttachment(commentOrUrl: Comment | string): Promise<FileResponse>;
719
- /**
720
- * Retrieves a paginated list of folders.
721
- *
722
- * @param args - Filter parameters such as workspace ID.
723
- * @returns A promise that resolves to a paginated response of folders.
724
- */
725
- getFolders(args: GetFoldersArgs): Promise<GetFoldersResponse>;
726
- /**
727
- * Retrieves a single folder by its ID.
728
- *
729
- * @param id - The unique identifier of the folder.
730
- * @returns A promise that resolves to the requested folder.
731
- */
732
- getFolder(id: string): Promise<Folder>;
733
- /**
734
- * Creates a new folder.
735
- *
736
- * @param args - Folder creation parameters including name and workspace ID.
737
- * @param requestId - Optional custom identifier for the request.
738
- * @returns A promise that resolves to the created folder.
739
- */
740
- addFolder(args: AddFolderArgs, requestId?: string): Promise<Folder>;
741
- /**
742
- * Updates an existing folder by its ID.
743
- *
744
- * @param id - The unique identifier of the folder to update.
745
- * @param args - Update parameters such as name or default order.
746
- * @param requestId - Optional custom identifier for the request.
747
- * @returns A promise that resolves to the updated folder.
748
- */
749
- updateFolder(id: string, args: UpdateFolderArgs, requestId?: string): Promise<Folder>;
750
- /**
751
- * Deletes a folder by its ID.
752
- *
753
- * @param id - The unique identifier of the folder to delete.
754
- * @param requestId - Optional custom identifier for the request.
755
- * @returns A promise that resolves to `true` if successful.
756
- */
757
- deleteFolder(id: string, requestId?: string): Promise<boolean>;
758
- /**
759
- * Retrieves a list of available backups.
760
- *
761
- * @param args - Optional parameters including MFA token.
762
- * @returns A promise that resolves to an array of backups.
763
- */
764
- getBackups(args?: GetBackupsArgs): Promise<Backup[]>;
765
- /**
766
- * Downloads a backup file as binary data.
767
- *
768
- * @param args - Arguments including the backup file URL (from getBackups).
769
- * @returns A promise that resolves to a response with binary data accessible via arrayBuffer().
770
- */
771
- downloadBackup(args: DownloadBackupArgs): Promise<FileResponse>;
772
- /**
773
- * Gets or creates an email forwarding address for an object.
774
- *
775
- * @param args - Arguments including object type and ID.
776
- * @param requestId - Optional custom identifier for the request.
777
- * @returns A promise that resolves to the email address.
778
- */
779
- getOrCreateEmailForwarding(args: GetOrCreateEmailArgs, requestId?: string): Promise<GetOrCreateEmailResponse>;
780
- /**
781
- * Disables email forwarding for an object.
782
- *
783
- * @param args - Arguments including object type and ID.
784
- * @param requestId - Optional custom identifier for the request.
785
- * @returns A promise that resolves to `true` if successful.
786
- */
787
- disableEmailForwarding(args: DisableEmailArgs, requestId?: string): Promise<boolean>;
788
- /**
789
- * Retrieves ID mappings between old and new IDs.
790
- *
791
- * @param args - Arguments including object type and IDs to look up.
792
- * @returns A promise that resolves to an array of ID mappings.
793
- */
794
- getIdMappings(args: GetIdMappingsArgs): Promise<IdMapping[]>;
795
- /**
796
- * Retrieves moved IDs for objects that have been migrated.
797
- *
798
- * @param args - Arguments including object type and optional old IDs to look up.
799
- * @returns A promise that resolves to an array of moved ID pairs.
800
- */
801
- getMovedIds(args: GetMovedIdsArgs): Promise<MovedId[]>;
802
- /**
803
- * Exports a project as a template file (CSV format).
804
- *
805
- * @param args - Arguments including project ID and optional date format preference.
806
- * @returns A promise that resolves to the template file content as a string.
807
- */
808
- exportTemplateAsFile(args: ExportTemplateFileArgs): Promise<string>;
809
- /**
810
- * Exports a project as a template URL.
811
- *
812
- * @param args - Arguments including project ID and optional date format preference.
813
- * @returns A promise that resolves to the file name and URL.
814
- */
815
- exportTemplateAsUrl(args: ExportTemplateUrlArgs): Promise<ExportTemplateUrlResponse>;
816
- /**
817
- * Creates a new project from a template file.
818
- *
819
- * @param args - Arguments including project name, template file, and optional workspace ID.
820
- * @param requestId - Optional custom identifier for the request.
821
- * @returns A promise that resolves to the created project data.
822
- */
823
- createProjectFromTemplate(args: CreateProjectFromTemplateArgs, requestId?: string): Promise<CreateProjectFromTemplateResponse>;
824
- /**
825
- * Imports a template file into an existing project.
826
- *
827
- * @param args - Arguments including project ID and template file.
828
- * @param requestId - Optional custom identifier for the request.
829
- * @returns A promise that resolves to the import result.
830
- */
831
- importTemplateIntoProject(args: ImportTemplateIntoProjectArgs, requestId?: string): Promise<ImportTemplateResponse>;
832
- /**
833
- * Imports a template by ID into an existing project.
834
- *
835
- * @param args - Arguments including project ID, template ID, and optional locale.
836
- * @param requestId - Optional custom identifier for the request.
837
- * @returns A promise that resolves to the import result.
838
- */
839
- importTemplateFromId(args: ImportTemplateFromIdArgs, requestId?: string): Promise<ImportTemplateResponse>;
840
- private validateTemplateResponse;
841
- /**
842
- * Gets pending invitations for a workspace.
843
- *
844
- * @param args - Arguments including workspace ID.
845
- * @param requestId - Optional request ID for idempotency.
846
- * @returns Array of email addresses with pending invitations.
847
- */
848
- getWorkspaceInvitations(args: GetWorkspaceInvitationsArgs, requestId?: string): Promise<WorkspaceInvitationsResponse>;
849
- /**
850
- * Gets all workspace invitations (admin only).
851
- *
852
- * @param requestId - Optional request ID for idempotency.
853
- * @returns Array of email addresses with pending invitations.
854
- */
855
- getAllWorkspaceInvitations(args?: {
856
- workspaceId?: number;
857
- }, requestId?: string): Promise<AllWorkspaceInvitationsResponse>;
858
- /**
859
- * Deletes a workspace invitation (admin only).
860
- *
861
- * @param args - Arguments including workspace ID and user email.
862
- * @param requestId - Optional request ID for idempotency.
863
- * @returns The deleted invitation.
864
- */
865
- deleteWorkspaceInvitation(args: DeleteWorkspaceInvitationArgs, requestId?: string): Promise<WorkspaceInvitation>;
866
- /**
867
- * Accepts a workspace invitation.
868
- *
869
- * @param args - Arguments including invite code.
870
- * @param requestId - Optional request ID for idempotency.
871
- * @returns The accepted invitation.
872
- */
873
- acceptWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<WorkspaceInvitation>;
874
- /**
875
- * Rejects a workspace invitation.
876
- *
877
- * @param args - Arguments including invite code.
878
- * @param requestId - Optional request ID for idempotency.
879
- * @returns The rejected invitation.
880
- */
881
- rejectWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<WorkspaceInvitation>;
882
- /**
883
- * Joins a workspace via invitation link or domain auto-join.
884
- *
885
- * @param args - Arguments including invite code or workspace ID.
886
- * @param requestId - Optional request ID for idempotency.
887
- * @returns Workspace user information.
888
- */
889
- joinWorkspace(args: JoinWorkspaceArgs, requestId?: string): Promise<JoinWorkspaceResult>;
890
- /**
891
- * Uploads or updates a workspace logo.
892
- *
893
- * @param args - Arguments including workspace ID, file, and options.
894
- * @param requestId - Optional request ID for idempotency.
895
- * @returns Logo information or null if deleted.
896
- */
897
- uploadWorkspaceLogo(args: WorkspaceLogoArgs, requestId?: string): Promise<WorkspaceLogoResponse>;
898
- /**
899
- * Gets workspace plan and billing details.
900
- *
901
- * @param args - Arguments including workspace ID.
902
- * @param requestId - Optional request ID for idempotency.
903
- * @returns Workspace plan details.
904
- */
905
- getWorkspacePlanDetails(args: GetWorkspacePlanDetailsArgs, requestId?: string): Promise<WorkspacePlanDetails>;
906
- /**
907
- * Gets workspace users with pagination.
908
- *
909
- * @param args - Arguments including optional workspace ID, cursor, and limit.
910
- * @param requestId - Optional request ID for idempotency.
911
- * @returns Paginated list of workspace users.
912
- */
913
- getWorkspaceUsers(args?: GetWorkspaceUsersArgs, requestId?: string): Promise<GetWorkspaceUsersResponse>;
914
- /**
915
- * Retrieves all workspaces for the authenticated user.
916
- *
917
- * @param requestId - Optional custom identifier for the request.
918
- * @returns A promise that resolves to an array of workspaces.
919
- *
920
- * @example
921
- * ```typescript
922
- * const workspaces = await api.getWorkspaces()
923
- * workspaces.forEach(workspace => {
924
- * console.log(`${workspace.name} (${workspace.plan}) - Role: ${workspace.role}`)
925
- * })
926
- * ```
927
- */
928
- getWorkspaces(requestId?: string): Promise<Workspace[]>;
929
- /**
930
- * Retrieves a workspace by its ID.
931
- *
932
- * @param id - The unique identifier of the workspace.
933
- * @param requestId - Optional custom identifier for the request.
934
- * @returns A promise that resolves to the requested workspace.
935
- */
936
- getWorkspace(id: string, requestId?: string): Promise<Workspace>;
937
- /**
938
- * Creates a new workspace.
939
- *
940
- * @param args - The arguments for creating the workspace.
941
- * @param requestId - Optional custom identifier for the request.
942
- * @returns A promise that resolves to the created workspace.
943
- */
944
- addWorkspace(args: AddWorkspaceArgs, requestId?: string): Promise<Workspace>;
945
- /**
946
- * Updates an existing workspace.
947
- *
948
- * @param id - The unique identifier of the workspace to update.
949
- * @param args - The arguments for updating the workspace.
950
- * @param requestId - Optional custom identifier for the request.
951
- * @returns A promise that resolves to the updated workspace.
952
- */
953
- updateWorkspace(id: string, args: UpdateWorkspaceArgs, requestId?: string): Promise<Workspace>;
954
- /**
955
- * Deletes a workspace by its ID.
956
- *
957
- * @param id - The unique identifier of the workspace to delete.
958
- * @param requestId - Optional custom identifier for the request.
959
- * @returns A promise that resolves to `true` if successful.
960
- */
961
- deleteWorkspace(id: string, requestId?: string): Promise<boolean>;
962
- /**
963
- * Retrieves activity information for workspace members.
964
- *
965
- * @param args - Arguments including workspace ID and optional user/project filters.
966
- * @param requestId - Optional custom identifier for the request.
967
- * @returns A promise that resolves to workspace members activity data.
968
- */
969
- getWorkspaceMembersActivity(args: GetWorkspaceMembersActivityArgs, requestId?: string): Promise<GetWorkspaceMembersActivityResponse>;
970
- /**
971
- * Retrieves tasks assigned to a specific user in a workspace.
972
- *
973
- * @param args - Arguments including workspace ID, user ID, and optional project filter.
974
- * @param requestId - Optional custom identifier for the request.
975
- * @returns A promise that resolves to workspace user tasks.
976
- */
977
- getWorkspaceUserTasks(args: GetWorkspaceUserTasksArgs, requestId?: string): Promise<GetWorkspaceUserTasksResponse>;
978
- /**
979
- * Invites users to a workspace by email.
980
- *
981
- * @param args - Arguments including workspace ID, email list, and optional role.
982
- * @param requestId - Optional custom identifier for the request.
983
- * @returns A promise that resolves to the list of invited emails.
984
- */
985
- inviteWorkspaceUsers(args: InviteWorkspaceUsersArgs, requestId?: string): Promise<InviteWorkspaceUsersResponse>;
986
- /**
987
- * Updates a workspace user's role.
988
- *
989
- * @param args - Arguments including workspace ID, user ID, and new role.
990
- * @param requestId - Optional custom identifier for the request.
991
- * @returns A promise that resolves to the updated workspace user view.
992
- */
993
- updateWorkspaceUser(args: UpdateWorkspaceUserArgs, requestId?: string): Promise<JoinWorkspaceResult>;
994
- /**
995
- * Removes a user from a workspace.
996
- *
997
- * @param args - Arguments including workspace ID and user ID.
998
- * @param requestId - Optional custom identifier for the request.
999
- * @returns A promise that resolves to `true` if successful.
1000
- */
1001
- removeWorkspaceUser(args: RemoveWorkspaceUserArgs, requestId?: string): Promise<boolean>;
1002
- /**
1003
- * Gets active projects in a workspace with pagination.
1004
- *
1005
- * @param args - Arguments including workspace ID, cursor, and limit.
1006
- * @param requestId - Optional request ID for idempotency.
1007
- * @returns Paginated list of active workspace projects.
1008
- */
1009
- getWorkspaceActiveProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
1010
- /**
1011
- * Gets archived projects in a workspace with pagination.
1012
- *
1013
- * @param args - Arguments including workspace ID, cursor, and limit.
1014
- * @param requestId - Optional request ID for idempotency.
1015
- * @returns Paginated list of archived workspace projects.
1016
- */
1017
- getWorkspaceArchivedProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
1018
- }