@doist/todoist-sdk 15.7.0 → 15.8.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.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ENDPOINT_REST_FILTERS } from '../consts/endpoints.js';
|
|
2
|
+
import { isSuccess, request } from '../transport/http-client.js';
|
|
3
|
+
import { generatePath } from '../utils/request-helpers.js';
|
|
4
|
+
import { IdSchema } from '../utils/validators.js';
|
|
5
|
+
import { BaseClient } from './base-client.js';
|
|
6
|
+
/**
|
|
7
|
+
* Internal sub-client handling all filter-domain endpoints.
|
|
8
|
+
*
|
|
9
|
+
* Instantiated by `TodoistApi`; every public filter method on `TodoistApi`
|
|
10
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
11
|
+
*/
|
|
12
|
+
export class FilterClient extends BaseClient {
|
|
13
|
+
async deleteFilter(id, requestId) {
|
|
14
|
+
IdSchema.parse(id);
|
|
15
|
+
const response = await request({
|
|
16
|
+
httpMethod: 'DELETE',
|
|
17
|
+
baseUri: this.syncApiBase,
|
|
18
|
+
relativePath: generatePath(ENDPOINT_REST_FILTERS, id),
|
|
19
|
+
apiToken: this.authToken,
|
|
20
|
+
customFetch: this.customFetch,
|
|
21
|
+
customHeaders: this.customHeaders,
|
|
22
|
+
requestId: requestId,
|
|
23
|
+
});
|
|
24
|
+
return isSuccess(response);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -71,6 +71,7 @@ export const ENDPOINT_GET_TOKEN = 'access_token';
|
|
|
71
71
|
export const ENDPOINT_REVOKE = 'revoke';
|
|
72
72
|
export const ENDPOINT_REGISTER = 'register';
|
|
73
73
|
export const ENDPOINT_REST_FOLDERS = 'folders';
|
|
74
|
+
export const ENDPOINT_REST_FILTERS = 'filters';
|
|
74
75
|
// Workspace endpoints
|
|
75
76
|
export const ENDPOINT_REST_WORKSPACES = 'workspaces';
|
|
76
77
|
export const ENDPOINT_WORKSPACE_INVITATIONS = 'workspaces/invitations';
|
package/dist/esm/todoist-api.js
CHANGED
|
@@ -4,6 +4,7 @@ import { BackupClient } from './clients/backup-client.js';
|
|
|
4
4
|
import { BillingClient } from './clients/billing-client.js';
|
|
5
5
|
import { CommentClient } from './clients/comment-client.js';
|
|
6
6
|
import { EmailClient } from './clients/email-client.js';
|
|
7
|
+
import { FilterClient } from './clients/filter-client.js';
|
|
7
8
|
import { FolderClient } from './clients/folder-client.js';
|
|
8
9
|
import { IdMappingClient } from './clients/id-mapping-client.js';
|
|
9
10
|
import { InsightsClient } from './clients/insights-client.js';
|
|
@@ -54,6 +55,7 @@ export class TodoistApi {
|
|
|
54
55
|
this.reminderClient = new ReminderClient(clientDeps);
|
|
55
56
|
this.insightsClient = new InsightsClient(clientDeps);
|
|
56
57
|
this.folderClient = new FolderClient(clientDeps);
|
|
58
|
+
this.filterClient = new FilterClient(clientDeps);
|
|
57
59
|
this.templateClient = new TemplateClient(clientDeps);
|
|
58
60
|
this.uploadClient = new UploadClient(clientDeps);
|
|
59
61
|
this.backupClient = new BackupClient(clientDeps);
|
|
@@ -980,6 +982,17 @@ export class TodoistApi {
|
|
|
980
982
|
async deleteFolder(id, requestId) {
|
|
981
983
|
return this.folderClient.deleteFolder(id, requestId);
|
|
982
984
|
}
|
|
985
|
+
// ── Filters ──
|
|
986
|
+
/**
|
|
987
|
+
* Deletes a personal filter by its ID.
|
|
988
|
+
*
|
|
989
|
+
* @param id - The unique identifier of the filter to delete.
|
|
990
|
+
* @param requestId - Optional custom identifier for the request.
|
|
991
|
+
* @returns A promise that resolves to `true` if successful.
|
|
992
|
+
*/
|
|
993
|
+
async deleteFilter(id, requestId) {
|
|
994
|
+
return this.filterClient.deleteFilter(id, requestId);
|
|
995
|
+
}
|
|
983
996
|
// ── Billing ──
|
|
984
997
|
/**
|
|
985
998
|
* Retrieves the current user's subscription state.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseClient } from './base-client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Internal sub-client handling all filter-domain endpoints.
|
|
4
|
+
*
|
|
5
|
+
* Instantiated by `TodoistApi`; every public filter method on `TodoistApi`
|
|
6
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FilterClient extends BaseClient {
|
|
9
|
+
deleteFilter(id: string, requestId?: string): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -59,6 +59,7 @@ export declare const ENDPOINT_GET_TOKEN = "access_token";
|
|
|
59
59
|
export declare const ENDPOINT_REVOKE = "revoke";
|
|
60
60
|
export declare const ENDPOINT_REGISTER = "register";
|
|
61
61
|
export declare const ENDPOINT_REST_FOLDERS = "folders";
|
|
62
|
+
export declare const ENDPOINT_REST_FILTERS = "filters";
|
|
62
63
|
export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
|
|
63
64
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
|
|
64
65
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS_ALL = "workspaces/invitations/all";
|
|
@@ -76,6 +76,7 @@ export declare class TodoistApi {
|
|
|
76
76
|
private readonly reminderClient;
|
|
77
77
|
private readonly insightsClient;
|
|
78
78
|
private readonly folderClient;
|
|
79
|
+
private readonly filterClient;
|
|
79
80
|
private readonly templateClient;
|
|
80
81
|
private readonly uploadClient;
|
|
81
82
|
private readonly backupClient;
|
|
@@ -825,6 +826,14 @@ export declare class TodoistApi {
|
|
|
825
826
|
* @returns A promise that resolves to `true` if successful.
|
|
826
827
|
*/
|
|
827
828
|
deleteFolder(id: string, requestId?: string): Promise<boolean>;
|
|
829
|
+
/**
|
|
830
|
+
* Deletes a personal filter by its ID.
|
|
831
|
+
*
|
|
832
|
+
* @param id - The unique identifier of the filter to delete.
|
|
833
|
+
* @param requestId - Optional custom identifier for the request.
|
|
834
|
+
* @returns A promise that resolves to `true` if successful.
|
|
835
|
+
*/
|
|
836
|
+
deleteFilter(id: string, requestId?: string): Promise<boolean>;
|
|
828
837
|
/**
|
|
829
838
|
* Retrieves the current user's subscription state.
|
|
830
839
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-sdk",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.8.0",
|
|
4
4
|
"description": "The official TypeScript SDK for the Todoist REST API.",
|
|
5
5
|
"author": "Doist developers",
|
|
6
6
|
"repository": "https://github.com/Doist/todoist-sdk-typescript",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"ts-node": "10.9.2",
|
|
73
73
|
"type-fest": "^5.0.0",
|
|
74
74
|
"typescript": "5.9.3",
|
|
75
|
-
"vitest": "4.1.
|
|
75
|
+
"vitest": "4.1.12"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"type-fest": "^4.12.0 || ^5.5.0"
|