@doist/todoist-api-typescript 5.5.0 → 5.6.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/TodoistApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PersonalProject, WorkspaceProject, Label, Section, Comment, Task, CurrentUser, ProductivityStats } from './types/entities';
|
|
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 } from './types/requests';
|
|
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 } from './types/requests';
|
|
3
3
|
/**
|
|
4
4
|
* A client for interacting with the Todoist API v1.
|
|
5
5
|
* This class provides methods to manage tasks, projects, sections, labels, and comments in Todoist.
|
|
@@ -74,6 +74,13 @@ export declare class TodoistApi {
|
|
|
74
74
|
* @returns A promise that resolves to a paginated response of completed tasks.
|
|
75
75
|
*/
|
|
76
76
|
getCompletedTasksByDueDate(args: GetCompletedTasksByDueDateArgs): Promise<GetCompletedTasksResponse>;
|
|
77
|
+
/**
|
|
78
|
+
* Searches completed tasks by query string.
|
|
79
|
+
*
|
|
80
|
+
* @param args - Parameters for searching, including the query string.
|
|
81
|
+
* @returns A promise that resolves to a paginated response of completed tasks.
|
|
82
|
+
*/
|
|
83
|
+
searchCompletedTasks(args: SearchCompletedTasksArgs): Promise<GetCompletedTasksResponse>;
|
|
77
84
|
/**
|
|
78
85
|
* Creates a new task with the provided parameters.
|
|
79
86
|
*
|
package/dist/TodoistApi.js
CHANGED
|
@@ -229,6 +229,28 @@ var TodoistApi = /** @class */ (function () {
|
|
|
229
229
|
});
|
|
230
230
|
});
|
|
231
231
|
};
|
|
232
|
+
/**
|
|
233
|
+
* Searches completed tasks by query string.
|
|
234
|
+
*
|
|
235
|
+
* @param args - Parameters for searching, including the query string.
|
|
236
|
+
* @returns A promise that resolves to a paginated response of completed tasks.
|
|
237
|
+
*/
|
|
238
|
+
TodoistApi.prototype.searchCompletedTasks = function (args) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
240
|
+
var _a, items, nextCursor;
|
|
241
|
+
return __generator(this, function (_b) {
|
|
242
|
+
switch (_b.label) {
|
|
243
|
+
case 0: return [4 /*yield*/, (0, restClient_1.request)('GET', this.syncApiBase, endpoints_1.ENDPOINT_REST_TASKS_COMPLETED_SEARCH, this.authToken, args)];
|
|
244
|
+
case 1:
|
|
245
|
+
_a = (_b.sent()).data, items = _a.items, nextCursor = _a.nextCursor;
|
|
246
|
+
return [2 /*return*/, {
|
|
247
|
+
items: (0, validators_1.validateTaskArray)(items),
|
|
248
|
+
nextCursor: nextCursor,
|
|
249
|
+
}];
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
};
|
|
232
254
|
/**
|
|
233
255
|
* Creates a new task with the provided parameters.
|
|
234
256
|
*
|
|
@@ -7,6 +7,7 @@ export declare const ENDPOINT_REST_TASKS = "tasks";
|
|
|
7
7
|
export declare const ENDPOINT_REST_TASKS_FILTER: string;
|
|
8
8
|
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
|
+
export declare const ENDPOINT_REST_TASKS_COMPLETED_SEARCH = "completed/search";
|
|
10
11
|
export declare const ENDPOINT_REST_SECTIONS = "sections";
|
|
11
12
|
export declare const ENDPOINT_REST_LABELS = "labels";
|
|
12
13
|
export declare const ENDPOINT_REST_LABELS_SHARED: string;
|
package/dist/consts/endpoints.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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_PRODUCTIVITY = exports.ENDPOINT_REST_USER = exports.ENDPOINT_REST_PROJECT_COLLABORATORS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS = 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_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_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_PRODUCTIVITY = exports.ENDPOINT_REST_USER = exports.ENDPOINT_REST_PROJECT_COLLABORATORS = exports.ENDPOINT_REST_PROJECTS_ARCHIVED = exports.ENDPOINT_REST_PROJECTS = 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;
|
|
4
4
|
exports.getSyncBaseUri = getSyncBaseUri;
|
|
5
5
|
exports.getAuthBaseUri = getAuthBaseUri;
|
|
6
6
|
var BASE_URI = 'https://api.todoist.com';
|
|
@@ -23,6 +23,7 @@ exports.ENDPOINT_REST_TASKS = 'tasks';
|
|
|
23
23
|
exports.ENDPOINT_REST_TASKS_FILTER = exports.ENDPOINT_REST_TASKS + '/filter';
|
|
24
24
|
exports.ENDPOINT_REST_TASKS_COMPLETED_BY_COMPLETION_DATE = exports.ENDPOINT_REST_TASKS + '/completed/by_completion_date';
|
|
25
25
|
exports.ENDPOINT_REST_TASKS_COMPLETED_BY_DUE_DATE = exports.ENDPOINT_REST_TASKS + '/completed/by_due_date';
|
|
26
|
+
exports.ENDPOINT_REST_TASKS_COMPLETED_SEARCH = 'completed/search';
|
|
26
27
|
exports.ENDPOINT_REST_SECTIONS = 'sections';
|
|
27
28
|
exports.ENDPOINT_REST_LABELS = 'labels';
|
|
28
29
|
exports.ENDPOINT_REST_LABELS_SHARED = exports.ENDPOINT_REST_LABELS + '/shared';
|
package/dist/types/entities.d.ts
CHANGED
|
@@ -543,10 +543,10 @@ export declare const CurrentUserSchema: z.ZodObject<{
|
|
|
543
543
|
id: z.ZodString;
|
|
544
544
|
email: z.ZodString;
|
|
545
545
|
fullName: z.ZodString;
|
|
546
|
-
avatarBig: z.ZodNullable<z.ZodString
|
|
547
|
-
avatarMedium: z.ZodNullable<z.ZodString
|
|
548
|
-
avatarS640: z.ZodNullable<z.ZodString
|
|
549
|
-
avatarSmall: z.ZodNullable<z.ZodString
|
|
546
|
+
avatarBig: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
547
|
+
avatarMedium: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
548
|
+
avatarS640: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
549
|
+
avatarSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
550
550
|
businessAccountId: z.ZodNullable<z.ZodString>;
|
|
551
551
|
isPremium: z.ZodBoolean;
|
|
552
552
|
dateFormat: z.ZodNumber;
|
package/dist/types/entities.js
CHANGED
|
@@ -202,10 +202,10 @@ exports.CurrentUserSchema = zod_1.z.object({
|
|
|
202
202
|
id: zod_1.z.string(),
|
|
203
203
|
email: zod_1.z.string(),
|
|
204
204
|
fullName: zod_1.z.string(),
|
|
205
|
-
avatarBig: zod_1.z.string().
|
|
206
|
-
avatarMedium: zod_1.z.string().
|
|
207
|
-
avatarS640: zod_1.z.string().
|
|
208
|
-
avatarSmall: zod_1.z.string().
|
|
205
|
+
avatarBig: zod_1.z.string().nullish(),
|
|
206
|
+
avatarMedium: zod_1.z.string().nullish(),
|
|
207
|
+
avatarS640: zod_1.z.string().nullish(),
|
|
208
|
+
avatarSmall: zod_1.z.string().nullish(),
|
|
209
209
|
businessAccountId: zod_1.z.string().nullable(),
|
|
210
210
|
isPremium: zod_1.z.boolean(),
|
|
211
211
|
dateFormat: zod_1.z.number().int(),
|
package/dist/types/requests.d.ts
CHANGED
|
@@ -81,6 +81,14 @@ export type GetCompletedTasksByDueDateArgs = {
|
|
|
81
81
|
cursor?: string | null;
|
|
82
82
|
limit?: number;
|
|
83
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* Arguments for searching completed tasks.
|
|
86
|
+
*/
|
|
87
|
+
export type SearchCompletedTasksArgs = {
|
|
88
|
+
query: string;
|
|
89
|
+
cursor?: string | null;
|
|
90
|
+
limit?: number;
|
|
91
|
+
};
|
|
84
92
|
/**
|
|
85
93
|
* @see https://todoist.com/api/v1/docs#tag/Tasks/operation/get_tasks_api_v1_tasks_get
|
|
86
94
|
*/
|
package/package.json
CHANGED