@doist/todoist-api-typescript 5.5.1 → 5.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
  *
@@ -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;
@@ -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';
@@ -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
  */
@@ -1,2 +1,3 @@
1
1
  export * from './colors';
2
2
  export * from './sanitization';
3
+ export * from './urlHelpers';
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./colors"), exports);
18
18
  __exportStar(require("./sanitization"), exports);
19
+ __exportStar(require("./urlHelpers"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-api-typescript",
3
- "version": "5.5.1",
3
+ "version": "5.6.1",
4
4
  "description": "A typescript wrapper for the Todoist REST API.",
5
5
  "author": "Doist developers",
6
6
  "repository": "git@github.com:doist/todoist-api-typescript.git",