@doist/todoist-api-typescript 6.2.1 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/consts/endpoints.js +4 -1
- package/dist/cjs/todoist-api.js +60 -0
- package/dist/esm/consts/endpoints.js +3 -0
- package/dist/esm/todoist-api.js +61 -1
- package/dist/types/consts/endpoints.d.ts +3 -0
- package/dist/types/todoist-api.d.ts +22 -1
- package/dist/types/types/requests.d.ts +19 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ENDPOINT_WORKSPACE_USERS = exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = exports.ENDPOINT_WORKSPACE_LOGO = exports.ENDPOINT_WORKSPACE_JOIN = exports.ENDPOINT_WORKSPACE_INVITATIONS_DELETE = exports.ENDPOINT_WORKSPACE_INVITATIONS_ALL = exports.ENDPOINT_WORKSPACE_INVITATIONS = exports.ENDPOINT_REVOKE = exports.ENDPOINT_REVOKE_TOKEN = exports.ENDPOINT_GET_TOKEN = exports.ENDPOINT_AUTHORIZATION = exports.ENDPOINT_SYNC = exports.ENDPOINT_SYNC_QUICK_ADD = exports.PROJECT_UNARCHIVE = exports.PROJECT_ARCHIVE = exports.ENDPOINT_REST_UPLOADS = exports.ENDPOINT_REST_ACTIVITIES = exports.ENDPOINT_REST_PRODUCTIVITY = exports.ENDPOINT_REST_USER = exports.ENDPOINT_REST_PROJECT_COLLABORATORS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS = exports.ENDPOINT_REST_TASK_MOVE = exports.ENDPOINT_REST_TASK_REOPEN = exports.ENDPOINT_REST_TASK_CLOSE = exports.ENDPOINT_REST_COMMENTS = exports.ENDPOINT_REST_LABELS_SHARED_REMOVE = exports.ENDPOINT_REST_LABELS_SHARED_RENAME = exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS = exports.ENDPOINT_REST_SECTIONS = exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST_TASKS_FILTER = exports.ENDPOINT_REST_TASKS = exports.API_BASE_URI = exports.API_VERSION = exports.TODOIST_WEB_URI = void 0;
|
|
3
|
+
exports.ENDPOINT_WORKSPACE_USERS = exports.ENDPOINT_WORKSPACE_PLAN_DETAILS = exports.ENDPOINT_WORKSPACE_LOGO = exports.ENDPOINT_WORKSPACE_JOIN = exports.ENDPOINT_WORKSPACE_INVITATIONS_DELETE = exports.ENDPOINT_WORKSPACE_INVITATIONS_ALL = exports.ENDPOINT_WORKSPACE_INVITATIONS = exports.ENDPOINT_REVOKE = exports.ENDPOINT_REVOKE_TOKEN = exports.ENDPOINT_GET_TOKEN = exports.ENDPOINT_AUTHORIZATION = exports.ENDPOINT_SYNC = exports.ENDPOINT_SYNC_QUICK_ADD = exports.PROJECT_UNARCHIVE = exports.PROJECT_ARCHIVE = exports.ENDPOINT_REST_UPLOADS = exports.ENDPOINT_REST_ACTIVITIES = exports.ENDPOINT_REST_PRODUCTIVITY = exports.ENDPOINT_REST_USER = exports.ENDPOINT_REST_PROJECT_COLLABORATORS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS_SEARCH = exports.ENDPOINT_REST_PROJECTS = exports.ENDPOINT_REST_TASK_MOVE = exports.ENDPOINT_REST_TASK_REOPEN = exports.ENDPOINT_REST_TASK_CLOSE = exports.ENDPOINT_REST_COMMENTS = exports.ENDPOINT_REST_LABELS_SHARED_REMOVE = exports.ENDPOINT_REST_LABELS_SHARED_RENAME = exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS_SEARCH = exports.ENDPOINT_REST_LABELS = exports.ENDPOINT_REST_SECTIONS_SEARCH = exports.ENDPOINT_REST_SECTIONS = exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST_TASKS_FILTER = exports.ENDPOINT_REST_TASKS = exports.API_BASE_URI = exports.API_VERSION = exports.TODOIST_WEB_URI = void 0;
|
|
4
4
|
exports.getSyncBaseUri = getSyncBaseUri;
|
|
5
5
|
exports.getAuthBaseUri = getAuthBaseUri;
|
|
6
6
|
exports.getWorkspaceInvitationAcceptEndpoint = getWorkspaceInvitationAcceptEndpoint;
|
|
@@ -27,7 +27,9 @@ exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST
|
|
|
27
27
|
exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS + '/completed/by_due_date';
|
|
28
28
|
exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = 'completed/search';
|
|
29
29
|
exports.ENDPOINT_REST_SECTIONS = 'sections';
|
|
30
|
+
exports.ENDPOINT_REST_SECTIONS_SEARCH = exports.ENDPOINT_REST_SECTIONS + '/search';
|
|
30
31
|
exports.ENDPOINT_REST_LABELS = 'labels';
|
|
32
|
+
exports.ENDPOINT_REST_LABELS_SEARCH = exports.ENDPOINT_REST_LABELS + '/search';
|
|
31
33
|
exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS + '/shared';
|
|
32
34
|
exports.ENDPOINT_REST_LABELS_SHARED_RENAME = exports.ENDPOINT_REST_LABELS_SHARED + '/rename';
|
|
33
35
|
exports.ENDPOINT_REST_LABELS_SHARED_REMOVE = exports.ENDPOINT_REST_LABELS_SHARED + '/remove';
|
|
@@ -36,6 +38,7 @@ exports.ENDPOINT_REST_TASK_CLOSE = 'close';
|
|
|
36
38
|
exports.ENDPOINT_REST_TASK_REOPEN = 'reopen';
|
|
37
39
|
exports.ENDPOINT_REST_TASK_MOVE = 'move';
|
|
38
40
|
exports.ENDPOINT_REST_PROJECTS = 'projects';
|
|
41
|
+
exports.ENDPOINT_REST_PROJECTS_SEARCH = exports.ENDPOINT_REST_PROJECTS + '/search';
|
|
39
42
|
exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS + '/archived';
|
|
40
43
|
exports.ENDPOINT_REST_PROJECT_COLLABORATORS = 'collaborators';
|
|
41
44
|
exports.ENDPOINT_REST_USER = 'user';
|
package/dist/cjs/todoist-api.js
CHANGED
|
@@ -406,6 +406,26 @@ class TodoistApi {
|
|
|
406
406
|
nextCursor,
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
|
+
/**
|
|
410
|
+
* Searches projects by name.
|
|
411
|
+
*
|
|
412
|
+
* @param args - Search parameters including the query string.
|
|
413
|
+
* @returns A promise that resolves to a paginated response of projects.
|
|
414
|
+
*/
|
|
415
|
+
async searchProjects(args) {
|
|
416
|
+
const { data: { results, nextCursor }, } = await (0, rest_client_1.request)({
|
|
417
|
+
httpMethod: 'GET',
|
|
418
|
+
baseUri: this.syncApiBase,
|
|
419
|
+
relativePath: endpoints_1.ENDPOINT_REST_PROJECTS_SEARCH,
|
|
420
|
+
apiToken: this.authToken,
|
|
421
|
+
customFetch: this.customFetch,
|
|
422
|
+
payload: args,
|
|
423
|
+
});
|
|
424
|
+
return {
|
|
425
|
+
results: (0, validators_1.validateProjectArray)(results),
|
|
426
|
+
nextCursor,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
409
429
|
/**
|
|
410
430
|
* Retrieves all archived projects with optional filters.
|
|
411
431
|
*
|
|
@@ -566,6 +586,26 @@ class TodoistApi {
|
|
|
566
586
|
nextCursor,
|
|
567
587
|
};
|
|
568
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Searches sections by name.
|
|
591
|
+
*
|
|
592
|
+
* @param args - Search parameters including the query string.
|
|
593
|
+
* @returns A promise that resolves to a paginated response of sections.
|
|
594
|
+
*/
|
|
595
|
+
async searchSections(args) {
|
|
596
|
+
const { data: { results, nextCursor }, } = await (0, rest_client_1.request)({
|
|
597
|
+
httpMethod: 'GET',
|
|
598
|
+
baseUri: this.syncApiBase,
|
|
599
|
+
relativePath: endpoints_1.ENDPOINT_REST_SECTIONS_SEARCH,
|
|
600
|
+
apiToken: this.authToken,
|
|
601
|
+
customFetch: this.customFetch,
|
|
602
|
+
payload: args,
|
|
603
|
+
});
|
|
604
|
+
return {
|
|
605
|
+
results: (0, validators_1.validateSectionArray)(results),
|
|
606
|
+
nextCursor,
|
|
607
|
+
};
|
|
608
|
+
}
|
|
569
609
|
/**
|
|
570
610
|
* Retrieves a single section by its ID.
|
|
571
611
|
*
|
|
@@ -679,6 +719,26 @@ class TodoistApi {
|
|
|
679
719
|
nextCursor,
|
|
680
720
|
};
|
|
681
721
|
}
|
|
722
|
+
/**
|
|
723
|
+
* Searches labels by name.
|
|
724
|
+
*
|
|
725
|
+
* @param args - Search parameters including the query string.
|
|
726
|
+
* @returns A promise that resolves to a paginated response of labels.
|
|
727
|
+
*/
|
|
728
|
+
async searchLabels(args) {
|
|
729
|
+
const { data: { results, nextCursor }, } = await (0, rest_client_1.request)({
|
|
730
|
+
httpMethod: 'GET',
|
|
731
|
+
baseUri: this.syncApiBase,
|
|
732
|
+
relativePath: endpoints_1.ENDPOINT_REST_LABELS_SEARCH,
|
|
733
|
+
apiToken: this.authToken,
|
|
734
|
+
customFetch: this.customFetch,
|
|
735
|
+
payload: args,
|
|
736
|
+
});
|
|
737
|
+
return {
|
|
738
|
+
results: (0, validators_1.validateLabelArray)(results),
|
|
739
|
+
nextCursor,
|
|
740
|
+
};
|
|
741
|
+
}
|
|
682
742
|
/**
|
|
683
743
|
* Adds a new label.
|
|
684
744
|
*
|
|
@@ -18,7 +18,9 @@ export const ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = ENDPOINT_REST_TA
|
|
|
18
18
|
export const ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = ENDPOINT_REST_TASKS + '/completed/by_due_date';
|
|
19
19
|
export const ENDPOINT_REST_TASKS_COMPLETED_SEARCH = 'completed/search';
|
|
20
20
|
export const ENDPOINT_REST_SECTIONS = 'sections';
|
|
21
|
+
export const ENDPOINT_REST_SECTIONS_SEARCH = ENDPOINT_REST_SECTIONS + '/search';
|
|
21
22
|
export const ENDPOINT_REST_LABELS = 'labels';
|
|
23
|
+
export const ENDPOINT_REST_LABELS_SEARCH = ENDPOINT_REST_LABELS + '/search';
|
|
22
24
|
export const ENDPOINT_REST_LABELS_SHARED = ENDPOINT_REST_LABELS + '/shared';
|
|
23
25
|
export const ENDPOINT_REST_LABELS_SHARED_RENAME = ENDPOINT_REST_LABELS_SHARED + '/rename';
|
|
24
26
|
export const ENDPOINT_REST_LABELS_SHARED_REMOVE = ENDPOINT_REST_LABELS_SHARED + '/remove';
|
|
@@ -27,6 +29,7 @@ export const ENDPOINT_REST_TASK_CLOSE = 'close';
|
|
|
27
29
|
export const ENDPOINT_REST_TASK_REOPEN = 'reopen';
|
|
28
30
|
export const ENDPOINT_REST_TASK_MOVE = 'move';
|
|
29
31
|
export const ENDPOINT_REST_PROJECTS = 'projects';
|
|
32
|
+
export const ENDPOINT_REST_PROJECTS_SEARCH = ENDPOINT_REST_PROJECTS + '/search';
|
|
30
33
|
export const ENDPOINT_REST_PROJECTS_ARCHIVED = ENDPOINT_REST_PROJECTS + '/archived';
|
|
31
34
|
export const ENDPOINT_REST_PROJECT_COLLABORATORS = 'collaborators';
|
|
32
35
|
export const ENDPOINT_REST_USER = 'user';
|
package/dist/esm/todoist-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { request, isSuccess } from './rest-client.js';
|
|
2
|
-
import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_PROJECTS, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, } from './consts/endpoints.js';
|
|
2
|
+
import { getSyncBaseUri, ENDPOINT_REST_TASKS, ENDPOINT_REST_TASKS_FILTER, ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE, ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE, ENDPOINT_REST_TASKS_COMPLETED_SEARCH, ENDPOINT_REST_PROJECTS, ENDPOINT_REST_PROJECTS_SEARCH, ENDPOINT_SYNC_QUICK_ADD, ENDPOINT_REST_TASK_CLOSE, ENDPOINT_REST_TASK_REOPEN, ENDPOINT_REST_TASK_MOVE, ENDPOINT_REST_LABELS, ENDPOINT_REST_LABELS_SEARCH, ENDPOINT_REST_PROJECT_COLLABORATORS, ENDPOINT_REST_SECTIONS, ENDPOINT_REST_SECTIONS_SEARCH, ENDPOINT_REST_COMMENTS, ENDPOINT_REST_LABELS_SHARED, ENDPOINT_REST_LABELS_SHARED_RENAME, ENDPOINT_REST_LABELS_SHARED_REMOVE, ENDPOINT_SYNC, PROJECT_ARCHIVE, PROJECT_UNARCHIVE, ENDPOINT_REST_PROJECTS_ARCHIVED, ENDPOINT_REST_USER, ENDPOINT_REST_PRODUCTIVITY, ENDPOINT_REST_ACTIVITIES, ENDPOINT_REST_UPLOADS, ENDPOINT_WORKSPACE_INVITATIONS, ENDPOINT_WORKSPACE_INVITATIONS_ALL, ENDPOINT_WORKSPACE_INVITATIONS_DELETE, getWorkspaceInvitationAcceptEndpoint, getWorkspaceInvitationRejectEndpoint, ENDPOINT_WORKSPACE_JOIN, ENDPOINT_WORKSPACE_LOGO, ENDPOINT_WORKSPACE_PLAN_DETAILS, ENDPOINT_WORKSPACE_USERS, getWorkspaceActiveProjectsEndpoint, getWorkspaceArchivedProjectsEndpoint, } from './consts/endpoints.js';
|
|
3
3
|
import { validateAttachment, validateComment, validateCommentArray, validateCurrentUser, validateLabel, validateLabelArray, validateProject, validateProjectArray, validateSection, validateSectionArray, validateTask, validateTaskArray, validateUserArray, validateProductivityStats, validateActivityEventArray, validateWorkspaceUserArray, validateWorkspaceInvitation, validateWorkspaceInvitationArray, validateWorkspacePlanDetails, validateJoinWorkspaceResult, } from './utils/validators.js';
|
|
4
4
|
import { formatDateToYYYYMMDD } from './utils/url-helpers.js';
|
|
5
5
|
import { uploadMultipartFile } from './utils/multipart-upload.js';
|
|
@@ -403,6 +403,26 @@ export class TodoistApi {
|
|
|
403
403
|
nextCursor,
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Searches projects by name.
|
|
408
|
+
*
|
|
409
|
+
* @param args - Search parameters including the query string.
|
|
410
|
+
* @returns A promise that resolves to a paginated response of projects.
|
|
411
|
+
*/
|
|
412
|
+
async searchProjects(args) {
|
|
413
|
+
const { data: { results, nextCursor }, } = await request({
|
|
414
|
+
httpMethod: 'GET',
|
|
415
|
+
baseUri: this.syncApiBase,
|
|
416
|
+
relativePath: ENDPOINT_REST_PROJECTS_SEARCH,
|
|
417
|
+
apiToken: this.authToken,
|
|
418
|
+
customFetch: this.customFetch,
|
|
419
|
+
payload: args,
|
|
420
|
+
});
|
|
421
|
+
return {
|
|
422
|
+
results: validateProjectArray(results),
|
|
423
|
+
nextCursor,
|
|
424
|
+
};
|
|
425
|
+
}
|
|
406
426
|
/**
|
|
407
427
|
* Retrieves all archived projects with optional filters.
|
|
408
428
|
*
|
|
@@ -563,6 +583,26 @@ export class TodoistApi {
|
|
|
563
583
|
nextCursor,
|
|
564
584
|
};
|
|
565
585
|
}
|
|
586
|
+
/**
|
|
587
|
+
* Searches sections by name.
|
|
588
|
+
*
|
|
589
|
+
* @param args - Search parameters including the query string.
|
|
590
|
+
* @returns A promise that resolves to a paginated response of sections.
|
|
591
|
+
*/
|
|
592
|
+
async searchSections(args) {
|
|
593
|
+
const { data: { results, nextCursor }, } = await request({
|
|
594
|
+
httpMethod: 'GET',
|
|
595
|
+
baseUri: this.syncApiBase,
|
|
596
|
+
relativePath: ENDPOINT_REST_SECTIONS_SEARCH,
|
|
597
|
+
apiToken: this.authToken,
|
|
598
|
+
customFetch: this.customFetch,
|
|
599
|
+
payload: args,
|
|
600
|
+
});
|
|
601
|
+
return {
|
|
602
|
+
results: validateSectionArray(results),
|
|
603
|
+
nextCursor,
|
|
604
|
+
};
|
|
605
|
+
}
|
|
566
606
|
/**
|
|
567
607
|
* Retrieves a single section by its ID.
|
|
568
608
|
*
|
|
@@ -676,6 +716,26 @@ export class TodoistApi {
|
|
|
676
716
|
nextCursor,
|
|
677
717
|
};
|
|
678
718
|
}
|
|
719
|
+
/**
|
|
720
|
+
* Searches labels by name.
|
|
721
|
+
*
|
|
722
|
+
* @param args - Search parameters including the query string.
|
|
723
|
+
* @returns A promise that resolves to a paginated response of labels.
|
|
724
|
+
*/
|
|
725
|
+
async searchLabels(args) {
|
|
726
|
+
const { data: { results, nextCursor }, } = await request({
|
|
727
|
+
httpMethod: 'GET',
|
|
728
|
+
baseUri: this.syncApiBase,
|
|
729
|
+
relativePath: ENDPOINT_REST_LABELS_SEARCH,
|
|
730
|
+
apiToken: this.authToken,
|
|
731
|
+
customFetch: this.customFetch,
|
|
732
|
+
payload: args,
|
|
733
|
+
});
|
|
734
|
+
return {
|
|
735
|
+
results: validateLabelArray(results),
|
|
736
|
+
nextCursor,
|
|
737
|
+
};
|
|
738
|
+
}
|
|
679
739
|
/**
|
|
680
740
|
* Adds a new label.
|
|
681
741
|
*
|
|
@@ -9,7 +9,9 @@ export declare const ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE: string;
|
|
|
9
9
|
export declare const ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE: string;
|
|
10
10
|
export declare const ENDPOINT_REST_TASKS_COMPLETED_SEARCH = "completed/search";
|
|
11
11
|
export declare const ENDPOINT_REST_SECTIONS = "sections";
|
|
12
|
+
export declare const ENDPOINT_REST_SECTIONS_SEARCH: string;
|
|
12
13
|
export declare const ENDPOINT_REST_LABELS = "labels";
|
|
14
|
+
export declare const ENDPOINT_REST_LABELS_SEARCH: string;
|
|
13
15
|
export declare const ENDPOINT_REST_LABELS_SHARED: string;
|
|
14
16
|
export declare const ENDPOINT_REST_LABELS_SHARED_RENAME: string;
|
|
15
17
|
export declare const ENDPOINT_REST_LABELS_SHARED_REMOVE: string;
|
|
@@ -18,6 +20,7 @@ export declare const ENDPOINT_REST_TASK_CLOSE = "close";
|
|
|
18
20
|
export declare const ENDPOINT_REST_TASK_REOPEN = "reopen";
|
|
19
21
|
export declare const ENDPOINT_REST_TASK_MOVE = "move";
|
|
20
22
|
export declare const ENDPOINT_REST_PROJECTS = "projects";
|
|
23
|
+
export declare const ENDPOINT_REST_PROJECTS_SEARCH: string;
|
|
21
24
|
export declare const ENDPOINT_REST_PROJECTS_ARCHIVED: string;
|
|
22
25
|
export declare const ENDPOINT_REST_PROJECT_COLLABORATORS = "collaborators";
|
|
23
26
|
export declare const ENDPOINT_REST_USER = "user";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Attachment, PersonalProject, WorkspaceProject, Label, Section, Comment, Task, CurrentUser, ProductivityStats, WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult } from './types/entities.js';
|
|
2
|
-
import { AddCommentArgs, AddLabelArgs, AddProjectArgs, AddSectionArgs, AddTaskArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateCommentArgs, UpdateLabelArgs, UpdateProjectArgs, UpdateSectionArgs, UpdateTaskArgs, QuickAddTaskArgs, GetSharedLabelsArgs, RenameSharedLabelArgs, RemoveSharedLabelArgs, GetProjectsArgs, GetProjectCollaboratorsArgs, GetLabelsArgs, GetLabelsResponse, GetTasksResponse, GetProjectsResponse, GetProjectCollaboratorsResponse, GetSectionsArgs, GetSectionsResponse, GetSharedLabelsResponse, GetCommentsResponse, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, SearchCompletedTasksArgs, GetActivityLogsArgs, GetActivityLogsResponse, UploadFileArgs, DeleteUploadArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/requests.js';
|
|
2
|
+
import { AddCommentArgs, AddLabelArgs, AddProjectArgs, AddSectionArgs, AddTaskArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateCommentArgs, UpdateLabelArgs, UpdateProjectArgs, UpdateSectionArgs, UpdateTaskArgs, QuickAddTaskArgs, GetSharedLabelsArgs, RenameSharedLabelArgs, RemoveSharedLabelArgs, GetProjectsArgs, SearchProjectsArgs, GetProjectCollaboratorsArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetTasksResponse, GetProjectsResponse, GetProjectCollaboratorsResponse, GetSectionsArgs, SearchSectionsArgs, GetSectionsResponse, GetSharedLabelsResponse, GetCommentsResponse, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, GetArchivedProjectsArgs, GetArchivedProjectsResponse, SearchCompletedTasksArgs, GetActivityLogsArgs, GetActivityLogsResponse, UploadFileArgs, DeleteUploadArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/requests.js';
|
|
3
3
|
import { CustomFetch } from './types/http.js';
|
|
4
4
|
/**
|
|
5
5
|
* A client for interacting with the Todoist API v1.
|
|
@@ -174,6 +174,13 @@ export declare class TodoistApi {
|
|
|
174
174
|
* @returns A promise that resolves to an array of projects.
|
|
175
175
|
*/
|
|
176
176
|
getProjects(args?: GetProjectsArgs): Promise<GetProjectsResponse>;
|
|
177
|
+
/**
|
|
178
|
+
* Searches projects by name.
|
|
179
|
+
*
|
|
180
|
+
* @param args - Search parameters including the query string.
|
|
181
|
+
* @returns A promise that resolves to a paginated response of projects.
|
|
182
|
+
*/
|
|
183
|
+
searchProjects(args: SearchProjectsArgs): Promise<GetProjectsResponse>;
|
|
177
184
|
/**
|
|
178
185
|
* Retrieves all archived projects with optional filters.
|
|
179
186
|
*
|
|
@@ -238,6 +245,13 @@ export declare class TodoistApi {
|
|
|
238
245
|
* @returns A promise that resolves to an array of sections.
|
|
239
246
|
*/
|
|
240
247
|
getSections(args?: GetSectionsArgs): Promise<GetSectionsResponse>;
|
|
248
|
+
/**
|
|
249
|
+
* Searches sections by name.
|
|
250
|
+
*
|
|
251
|
+
* @param args - Search parameters including the query string.
|
|
252
|
+
* @returns A promise that resolves to a paginated response of sections.
|
|
253
|
+
*/
|
|
254
|
+
searchSections(args: SearchSectionsArgs): Promise<GetSectionsResponse>;
|
|
241
255
|
/**
|
|
242
256
|
* Retrieves a single section by its ID.
|
|
243
257
|
*
|
|
@@ -284,6 +298,13 @@ export declare class TodoistApi {
|
|
|
284
298
|
* @returns A promise that resolves to an array of labels.
|
|
285
299
|
*/
|
|
286
300
|
getLabels(args?: GetLabelsArgs): Promise<GetLabelsResponse>;
|
|
301
|
+
/**
|
|
302
|
+
* Searches labels by name.
|
|
303
|
+
*
|
|
304
|
+
* @param args - Search parameters including the query string.
|
|
305
|
+
* @returns A promise that resolves to a paginated response of labels.
|
|
306
|
+
*/
|
|
307
|
+
searchLabels(args: SearchLabelsArgs): Promise<GetLabelsResponse>;
|
|
287
308
|
/**
|
|
288
309
|
* Adds a new label.
|
|
289
310
|
*
|
|
@@ -160,6 +160,15 @@ export type GetProjectsArgs = {
|
|
|
160
160
|
cursor?: string | null;
|
|
161
161
|
limit?: number;
|
|
162
162
|
};
|
|
163
|
+
/**
|
|
164
|
+
* Arguments for searching projects.
|
|
165
|
+
*/
|
|
166
|
+
type SearchArgs = {
|
|
167
|
+
query: string;
|
|
168
|
+
cursor?: string | null;
|
|
169
|
+
limit?: number;
|
|
170
|
+
};
|
|
171
|
+
export type SearchProjectsArgs = SearchArgs;
|
|
163
172
|
/**
|
|
164
173
|
* Response from retrieving projects.
|
|
165
174
|
* @see https://todoist.com/api/v1/docs#tag/Projects/operation/get_projects_api_v1_projects_get
|
|
@@ -230,6 +239,12 @@ export type GetSectionsArgs = {
|
|
|
230
239
|
cursor?: string | null;
|
|
231
240
|
limit?: number;
|
|
232
241
|
};
|
|
242
|
+
/**
|
|
243
|
+
* Arguments for searching sections.
|
|
244
|
+
*/
|
|
245
|
+
export type SearchSectionsArgs = SearchArgs & {
|
|
246
|
+
projectId?: string | null;
|
|
247
|
+
};
|
|
233
248
|
/**
|
|
234
249
|
* Response from retrieving sections.
|
|
235
250
|
* @see https://todoist.com/api/v1/docs#tag/Sections/operation/get_sections_api_v1_sections_get
|
|
@@ -262,6 +277,10 @@ export type GetLabelsArgs = {
|
|
|
262
277
|
cursor?: string | null;
|
|
263
278
|
limit?: number;
|
|
264
279
|
};
|
|
280
|
+
/**
|
|
281
|
+
* Arguments for searching labels.
|
|
282
|
+
*/
|
|
283
|
+
export type SearchLabelsArgs = SearchArgs;
|
|
265
284
|
/**
|
|
266
285
|
* Response from retrieving labels.
|
|
267
286
|
* @see https://todoist.com/api/v1/docs#tag/Labels/operation/get_labels_api_v1_labels_get
|
package/package.json
CHANGED