@@ -33,6 +33,8 @@ import {
33
33
GetCompletedTasksByCompletionDateArgs ,
34
34
GetCompletedTasksByDueDateArgs ,
35
35
GetCompletedTasksResponse ,
36
+ GetArchivedProjectsArgs ,
37
+ GetArchivedProjectsResponse ,
36
38
} from './types/requests'
37
39
import { request , isSuccess } from './restClient'
38
40
import {
@@ -55,6 +57,7 @@ import {
55
57
ENDPOINT_SYNC ,
56
58
PROJECT_ARCHIVE ,
57
59
PROJECT_UNARCHIVE ,
60
+ ENDPOINT_REST_PROJECTS_ARCHIVED ,
58
61
} from './consts/endpoints'
59
62
import {
60
63
validateComment ,
@@ -458,6 +461,31 @@ export class TodoistApi {
458
461
}
459
462
}
460
463
464
+ /**
465
+ * Retrieves all archived projects with optional filters.
466
+ *
467
+ * @param args - Optional filters for retrieving archived projects.
468
+ * @returns A promise that resolves to an array of archived projects.
469
+ */
470
+ async getArchivedProjects (
471
+ args : GetArchivedProjectsArgs = { } ,
472
+ ) : Promise < GetArchivedProjectsResponse > {
473
+ const {
474
+ data : { results, nextCursor } ,
475
+ } = await request < GetArchivedProjectsResponse > (
476
+ 'GET' ,
477
+ this . syncApiBase ,
478
+ ENDPOINT_REST_PROJECTS_ARCHIVED ,
479
+ this . authToken ,
480
+ args ,
481
+ )
482
+
483
+ return {
484
+ results : validateProjectArray ( results ) ,
485
+ nextCursor,
486
+ }
487
+ }
488
+
461
489
/**
462
490
* Creates a new project with the provided parameters.
463
491
*
0 commit comments