@doist/todoist-sdk 9.0.0 → 9.1.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/authentication.js +1 -0
- package/dist/cjs/clients/activity-client.js +63 -0
- package/dist/cjs/clients/app-client.js +347 -0
- package/dist/cjs/clients/backup-client.js +65 -0
- package/dist/cjs/clients/base-client.js +30 -0
- package/dist/cjs/clients/comment-client.js +92 -0
- package/dist/cjs/clients/email-client.js +43 -0
- package/dist/cjs/clients/folder-client.js +80 -0
- package/dist/cjs/clients/id-mapping-client.js +39 -0
- package/dist/cjs/clients/insights-client.js +88 -0
- package/dist/cjs/clients/label-client.js +127 -0
- package/dist/cjs/clients/productivity-client.js +27 -0
- package/dist/cjs/clients/project-client.js +232 -0
- package/dist/cjs/clients/reminder-client.js +198 -0
- package/dist/cjs/clients/section-client.js +118 -0
- package/dist/cjs/clients/task-client.js +255 -0
- package/dist/cjs/clients/template-client.js +89 -0
- package/dist/cjs/clients/ui-extension-client.js +109 -0
- package/dist/cjs/clients/upload-client.js +102 -0
- package/dist/cjs/clients/workspace-client.js +367 -0
- package/dist/cjs/consts/endpoints.js +66 -1
- package/dist/cjs/test-utils/test-defaults.js +77 -1
- package/dist/cjs/todoist-api.js +422 -1537
- package/dist/cjs/transport/http-client.js +1 -0
- package/dist/cjs/transport/sync-request.js +75 -0
- package/dist/cjs/types/apps/index.js +18 -0
- package/dist/cjs/types/apps/requests.js +2 -0
- package/dist/cjs/types/apps/types.js +253 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/ui-extensions/index.js +18 -0
- package/dist/cjs/types/ui-extensions/requests.js +2 -0
- package/dist/cjs/types/ui-extensions/types.js +77 -0
- package/dist/cjs/utils/headers.js +16 -0
- package/dist/cjs/utils/request-helpers.js +21 -0
- package/dist/cjs/utils/validators.js +52 -38
- package/dist/esm/authentication.js +1 -0
- package/dist/esm/clients/activity-client.js +59 -0
- package/dist/esm/clients/app-client.js +343 -0
- package/dist/esm/clients/backup-client.js +61 -0
- package/dist/esm/clients/base-client.js +26 -0
- package/dist/esm/clients/comment-client.js +88 -0
- package/dist/esm/clients/email-client.js +39 -0
- package/dist/esm/clients/folder-client.js +76 -0
- package/dist/esm/clients/id-mapping-client.js +35 -0
- package/dist/esm/clients/insights-client.js +84 -0
- package/dist/esm/clients/label-client.js +123 -0
- package/dist/esm/clients/productivity-client.js +23 -0
- package/dist/esm/clients/project-client.js +228 -0
- package/dist/esm/clients/reminder-client.js +194 -0
- package/dist/esm/clients/section-client.js +114 -0
- package/dist/esm/clients/task-client.js +251 -0
- package/dist/esm/clients/template-client.js +85 -0
- package/dist/esm/clients/ui-extension-client.js +105 -0
- package/dist/esm/clients/upload-client.js +98 -0
- package/dist/esm/clients/workspace-client.js +363 -0
- package/dist/esm/consts/endpoints.js +51 -0
- package/dist/esm/test-utils/test-defaults.js +75 -0
- package/dist/esm/todoist-api.js +425 -1540
- package/dist/esm/transport/http-client.js +1 -0
- package/dist/esm/transport/sync-request.js +72 -0
- package/dist/esm/types/apps/index.js +2 -0
- package/dist/esm/types/apps/requests.js +1 -0
- package/dist/esm/types/apps/types.js +248 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/ui-extensions/index.js +2 -0
- package/dist/esm/types/ui-extensions/requests.js +1 -0
- package/dist/esm/types/ui-extensions/types.js +74 -0
- package/dist/esm/utils/headers.js +13 -0
- package/dist/esm/utils/request-helpers.js +17 -0
- package/dist/esm/utils/validators.js +14 -0
- package/dist/types/authentication.d.ts +1 -1
- package/dist/types/clients/activity-client.d.ts +12 -0
- package/dist/types/clients/app-client.d.ts +37 -0
- package/dist/types/clients/backup-client.d.ts +14 -0
- package/dist/types/clients/base-client.d.ts +21 -0
- package/dist/types/clients/comment-client.d.ts +15 -0
- package/dist/types/clients/email-client.d.ts +13 -0
- package/dist/types/clients/folder-client.d.ts +16 -0
- package/dist/types/clients/id-mapping-client.d.ts +13 -0
- package/dist/types/clients/insights-client.d.ts +18 -0
- package/dist/types/clients/label-client.d.ts +19 -0
- package/dist/types/clients/productivity-client.d.ts +12 -0
- package/dist/types/clients/project-client.d.ts +26 -0
- package/dist/types/clients/reminder-client.d.ts +25 -0
- package/dist/types/clients/section-client.d.ts +18 -0
- package/dist/types/clients/task-client.d.ts +25 -0
- package/dist/types/clients/template-client.d.ts +17 -0
- package/dist/types/clients/ui-extension-client.d.ts +18 -0
- package/dist/types/clients/upload-client.d.ts +17 -0
- package/dist/types/clients/workspace-client.d.ts +43 -0
- package/dist/types/consts/endpoints.d.ts +24 -0
- package/dist/types/test-utils/test-defaults.d.ts +16 -1
- package/dist/types/todoist-api.d.ts +238 -17
- package/dist/types/transport/sync-request.d.ts +27 -0
- package/dist/types/types/apps/index.d.ts +2 -0
- package/dist/types/types/apps/requests.d.ts +89 -0
- package/dist/types/types/apps/types.d.ts +414 -0
- package/dist/types/types/http.d.ts +8 -1
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/sync/resources/user.d.ts +2 -2
- package/dist/types/types/sync/response.d.ts +2 -2
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/types/ui-extensions/index.d.ts +2 -0
- package/dist/types/types/ui-extensions/requests.d.ts +108 -0
- package/dist/types/types/ui-extensions/types.d.ts +185 -0
- package/dist/types/utils/headers.d.ts +7 -0
- package/dist/types/utils/request-helpers.d.ts +13 -0
- package/dist/types/utils/validators.d.ts +223 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs, ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights } from '../types/insights/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all insights-domain endpoints
|
|
5
|
+
* (project activity stats, health, progress, workspace insights).
|
|
6
|
+
*
|
|
7
|
+
* Instantiated by `TodoistApi`; every public insights method on
|
|
8
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
9
|
+
* JSDoc.
|
|
10
|
+
*/
|
|
11
|
+
export declare class InsightsClient extends BaseClient {
|
|
12
|
+
getProjectActivityStats(projectId: string, args?: GetProjectActivityStatsArgs): Promise<ProjectActivityStats>;
|
|
13
|
+
getProjectHealth(projectId: string): Promise<ProjectHealth>;
|
|
14
|
+
getProjectHealthContext(projectId: string): Promise<ProjectHealthContext>;
|
|
15
|
+
getProjectProgress(projectId: string): Promise<ProjectProgress>;
|
|
16
|
+
getWorkspaceInsights(workspaceId: string, args?: GetWorkspaceInsightsArgs): Promise<WorkspaceInsights>;
|
|
17
|
+
analyzeProjectHealth(projectId: string, requestId?: string): Promise<ProjectHealth>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AddLabelArgs, GetLabelsArgs, GetLabelsResponse, GetSharedLabelsArgs, GetSharedLabelsResponse, Label, RemoveSharedLabelArgs, RenameSharedLabelArgs, SearchLabelsArgs, UpdateLabelArgs } from '../types/labels/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all label-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public label method on `TodoistApi`
|
|
7
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
8
|
+
*/
|
|
9
|
+
export declare class LabelClient extends BaseClient {
|
|
10
|
+
getLabel(id: string): Promise<Label>;
|
|
11
|
+
getLabels(args?: GetLabelsArgs): Promise<GetLabelsResponse>;
|
|
12
|
+
searchLabels(args: SearchLabelsArgs): Promise<GetLabelsResponse>;
|
|
13
|
+
addLabel(args: AddLabelArgs, requestId?: string): Promise<Label>;
|
|
14
|
+
updateLabel(id: string, args: UpdateLabelArgs, requestId?: string): Promise<Label>;
|
|
15
|
+
deleteLabel(id: string, requestId?: string): Promise<boolean>;
|
|
16
|
+
getSharedLabels(args?: GetSharedLabelsArgs): Promise<GetSharedLabelsResponse>;
|
|
17
|
+
renameSharedLabel(args: RenameSharedLabelArgs): Promise<boolean>;
|
|
18
|
+
removeSharedLabel(args: RemoveSharedLabelArgs): Promise<boolean>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ProductivityStats } from '../types/productivity/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling the productivity-stats endpoint.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; the public `getProductivityStats` method
|
|
7
|
+
* on `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
8
|
+
* JSDoc.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ProductivityClient extends BaseClient {
|
|
11
|
+
getProductivityStats(): Promise<ProductivityStats>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AddProjectArgs, GetArchivedProjectsArgs, GetArchivedProjectsCountArgs, GetArchivedProjectsCountResponse, GetArchivedProjectsResponse, GetFullProjectArgs, GetFullProjectResponse, GetProjectCollaboratorsArgs, GetProjectCollaboratorsResponse, GetProjectPermissionsResponse, GetProjectsArgs, GetProjectsResponse, JoinProjectResponse, MoveProjectToPersonalArgs, MoveProjectToWorkspaceArgs, PersonalProject, SearchProjectsArgs, UpdateProjectArgs, WorkspaceProject } from '../types/projects/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all project-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public project method on `TodoistApi`
|
|
7
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ProjectClient extends BaseClient {
|
|
10
|
+
getProject(id: string): Promise<PersonalProject | WorkspaceProject>;
|
|
11
|
+
getProjects(args?: GetProjectsArgs): Promise<GetProjectsResponse>;
|
|
12
|
+
searchProjects(args: SearchProjectsArgs): Promise<GetProjectsResponse>;
|
|
13
|
+
getArchivedProjects(args?: GetArchivedProjectsArgs): Promise<GetArchivedProjectsResponse>;
|
|
14
|
+
addProject(args: AddProjectArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
|
|
15
|
+
updateProject(id: string, args: UpdateProjectArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
|
|
16
|
+
deleteProject(id: string, requestId?: string): Promise<boolean>;
|
|
17
|
+
archiveProject(id: string, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
|
|
18
|
+
unarchiveProject(id: string, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
|
|
19
|
+
moveProjectToWorkspace(args: MoveProjectToWorkspaceArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
|
|
20
|
+
moveProjectToPersonal(args: MoveProjectToPersonalArgs, requestId?: string): Promise<PersonalProject | WorkspaceProject>;
|
|
21
|
+
getArchivedProjectsCount(args?: GetArchivedProjectsCountArgs): Promise<GetArchivedProjectsCountResponse>;
|
|
22
|
+
getProjectPermissions(): Promise<GetProjectPermissionsResponse>;
|
|
23
|
+
getFullProject(id: string, args?: GetFullProjectArgs): Promise<GetFullProjectResponse>;
|
|
24
|
+
joinProject(id: string, requestId?: string): Promise<JoinProjectResponse>;
|
|
25
|
+
getProjectCollaborators(projectId: string, args?: GetProjectCollaboratorsArgs): Promise<GetProjectCollaboratorsResponse>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Reminder } from '../types/index.js';
|
|
2
|
+
import type { AddLocationReminderArgs, AddReminderArgs, GetLocationRemindersArgs, GetLocationRemindersResponse, GetRemindersArgs, GetRemindersResponse, UpdateLocationReminderArgs, UpdateReminderArgs } from '../types/reminders/index.js';
|
|
3
|
+
import { BaseClient } from './base-client.js';
|
|
4
|
+
/**
|
|
5
|
+
* Internal sub-client handling all reminder-domain endpoints
|
|
6
|
+
* (both time-based and location-based reminders).
|
|
7
|
+
*
|
|
8
|
+
* Instantiated by `TodoistApi`; every public reminder method on
|
|
9
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
10
|
+
* JSDoc. The time-vs-location 404 translation is preserved here so a
|
|
11
|
+
* caller who used the wrong endpoint gets a TodoistArgumentError
|
|
12
|
+
* pointing at the correct method, rather than a bare 404.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ReminderClient extends BaseClient {
|
|
15
|
+
getReminders(args?: GetRemindersArgs): Promise<GetRemindersResponse>;
|
|
16
|
+
getLocationReminders(args?: GetLocationRemindersArgs): Promise<GetLocationRemindersResponse>;
|
|
17
|
+
getReminder(id: string): Promise<Reminder>;
|
|
18
|
+
getLocationReminder(id: string): Promise<Reminder>;
|
|
19
|
+
addReminder(args: AddReminderArgs, requestId?: string): Promise<Reminder>;
|
|
20
|
+
addLocationReminder(args: AddLocationReminderArgs, requestId?: string): Promise<Reminder>;
|
|
21
|
+
updateReminder(id: string, args: UpdateReminderArgs, requestId?: string): Promise<Reminder>;
|
|
22
|
+
updateLocationReminder(id: string, args: UpdateLocationReminderArgs, requestId?: string): Promise<Reminder>;
|
|
23
|
+
deleteReminder(id: string, requestId?: string): Promise<boolean>;
|
|
24
|
+
deleteLocationReminder(id: string, requestId?: string): Promise<boolean>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AddSectionArgs, GetSectionsArgs, GetSectionsResponse, SearchSectionsArgs, Section, UpdateSectionArgs } from '../types/sections/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all section-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public section method on `TodoistApi`
|
|
7
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SectionClient extends BaseClient {
|
|
10
|
+
getSections(args?: GetSectionsArgs): Promise<GetSectionsResponse>;
|
|
11
|
+
searchSections(args: SearchSectionsArgs): Promise<GetSectionsResponse>;
|
|
12
|
+
getSection(id: string): Promise<Section>;
|
|
13
|
+
addSection(args: AddSectionArgs, requestId?: string): Promise<Section>;
|
|
14
|
+
updateSection(id: string, args: UpdateSectionArgs, requestId?: string): Promise<Section>;
|
|
15
|
+
deleteSection(id: string, requestId?: string): Promise<boolean>;
|
|
16
|
+
archiveSection(id: string, requestId?: string): Promise<Section>;
|
|
17
|
+
unarchiveSection(id: string, requestId?: string): Promise<Section>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AddTaskArgs, GetAllCompletedTasksArgs, GetAllCompletedTasksResponse, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, GetTasksArgs, GetTasksByFilterArgs, GetTasksResponse, MoveTaskArgs, QuickAddTaskArgs, SearchCompletedTasksArgs, Task, UpdateTaskArgs } from '../types/tasks/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all task-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public task method on `TodoistApi`
|
|
7
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
8
|
+
*/
|
|
9
|
+
export declare class TaskClient extends BaseClient {
|
|
10
|
+
getTask(id: string): Promise<Task>;
|
|
11
|
+
getTasks(args?: GetTasksArgs): Promise<GetTasksResponse>;
|
|
12
|
+
getTasksByFilter(args: GetTasksByFilterArgs): Promise<GetTasksResponse>;
|
|
13
|
+
getCompletedTasksByCompletionDate(args: GetCompletedTasksByCompletionDateArgs): Promise<GetCompletedTasksResponse>;
|
|
14
|
+
getCompletedTasksByDueDate(args: GetCompletedTasksByDueDateArgs): Promise<GetCompletedTasksResponse>;
|
|
15
|
+
searchCompletedTasks(args: SearchCompletedTasksArgs): Promise<GetCompletedTasksResponse>;
|
|
16
|
+
getAllCompletedTasks(args?: GetAllCompletedTasksArgs): Promise<GetAllCompletedTasksResponse>;
|
|
17
|
+
addTask(args: AddTaskArgs, requestId?: string): Promise<Task>;
|
|
18
|
+
quickAddTask(args: QuickAddTaskArgs): Promise<Task>;
|
|
19
|
+
updateTask(id: string, args: UpdateTaskArgs, requestId?: string): Promise<Task>;
|
|
20
|
+
moveTasks(ids: string[], args: MoveTaskArgs, requestId?: string): Promise<Task[]>;
|
|
21
|
+
moveTask(id: string, args: MoveTaskArgs, requestId?: string): Promise<Task>;
|
|
22
|
+
closeTask(id: string, requestId?: string): Promise<boolean>;
|
|
23
|
+
reopenTask(id: string, requestId?: string): Promise<boolean>;
|
|
24
|
+
deleteTask(id: string, requestId?: string): Promise<boolean>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, ImportTemplateFromIdArgs, ImportTemplateIntoProjectArgs, ImportTemplateResponse } from '../types/templates/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all template-domain endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public template method on
|
|
7
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
8
|
+
* JSDoc.
|
|
9
|
+
*/
|
|
10
|
+
export declare class TemplateClient extends BaseClient {
|
|
11
|
+
exportTemplateAsFile(args: ExportTemplateFileArgs): Promise<string>;
|
|
12
|
+
exportTemplateAsUrl(args: ExportTemplateUrlArgs): Promise<ExportTemplateUrlResponse>;
|
|
13
|
+
createProjectFromTemplate(args: CreateProjectFromTemplateArgs, requestId?: string): Promise<CreateProjectFromTemplateResponse>;
|
|
14
|
+
importTemplateIntoProject(args: ImportTemplateIntoProjectArgs, requestId?: string): Promise<ImportTemplateResponse>;
|
|
15
|
+
importTemplateFromId(args: ImportTemplateFromIdArgs, requestId?: string): Promise<ImportTemplateResponse>;
|
|
16
|
+
private validateTemplateResponse;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AddUiExtensionArgs, UiExtension, UpdateUiExtensionArgs, UploadUiExtensionIconArgs } from '../types/ui-extensions/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling all UI-extension endpoints for developer
|
|
5
|
+
* applications. All endpoints require the `dev:app_console` OAuth scope.
|
|
6
|
+
*
|
|
7
|
+
* Instantiated by `TodoistApi`; every public UI-extension method on
|
|
8
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing JSDoc.
|
|
9
|
+
*/
|
|
10
|
+
export declare class UiExtensionClient extends BaseClient {
|
|
11
|
+
getUiExtension(uiExtensionId: string, requestId?: string): Promise<UiExtension>;
|
|
12
|
+
getInstalledUiExtensions(requestId?: string): Promise<UiExtension[]>;
|
|
13
|
+
getUiExtensionsForApp(appId: string, requestId?: string): Promise<UiExtension[]>;
|
|
14
|
+
addUiExtension(args: AddUiExtensionArgs, requestId?: string): Promise<UiExtension>;
|
|
15
|
+
updateUiExtension(uiExtensionId: string, args: UpdateUiExtensionArgs, requestId?: string): Promise<UiExtension>;
|
|
16
|
+
deleteUiExtension(uiExtensionId: string, requestId?: string): Promise<boolean>;
|
|
17
|
+
uploadUiExtensionIcon(args: UploadUiExtensionIconArgs, requestId?: string): Promise<UiExtension>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Attachment, Comment } from '../types/comments/index.js';
|
|
2
|
+
import type { FileResponse } from '../types/http.js';
|
|
3
|
+
import type { DeleteUploadArgs, UploadFileArgs } from '../types/uploads/index.js';
|
|
4
|
+
import { BaseClient } from './base-client.js';
|
|
5
|
+
/**
|
|
6
|
+
* Internal sub-client handling upload + attachment endpoints
|
|
7
|
+
* (file upload, upload delete, attachment view).
|
|
8
|
+
*
|
|
9
|
+
* Instantiated by `TodoistApi`; every public upload method on
|
|
10
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
11
|
+
* JSDoc.
|
|
12
|
+
*/
|
|
13
|
+
export declare class UploadClient extends BaseClient {
|
|
14
|
+
uploadFile(args: UploadFileArgs, requestId?: string): Promise<Attachment>;
|
|
15
|
+
deleteUpload(args: DeleteUploadArgs, requestId?: string): Promise<boolean>;
|
|
16
|
+
viewAttachment(commentOrUrl: Comment | string): Promise<FileResponse>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { GetProjectsResponse } from '../types/projects/index.js';
|
|
2
|
+
import type { AddWorkspaceArgs, AllWorkspaceInvitationsResponse, DeleteWorkspaceInvitationArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceProjectsArgs, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, JoinWorkspaceArgs, JoinWorkspaceResult, RemoveWorkspaceUserArgs, UpdateWorkspaceArgs, UpdateWorkspaceUserArgs, Workspace, WorkspaceInvitation, WorkspaceInvitationActionArgs, WorkspaceInvitationsResponse, WorkspaceLogoArgs, WorkspaceLogoResponse, WorkspacePlanDetails } from '../types/workspaces/index.js';
|
|
3
|
+
import { BaseClient } from './base-client.js';
|
|
4
|
+
type GetAllWorkspaceInvitationsArgs = {
|
|
5
|
+
workspaceId?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Internal sub-client handling all workspace-domain endpoints —
|
|
9
|
+
* workspaces, invitations, users, plans, logos, and workspace project
|
|
10
|
+
* pagination.
|
|
11
|
+
*
|
|
12
|
+
* Instantiated by `TodoistApi`; every public workspace method on
|
|
13
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
14
|
+
* JSDoc.
|
|
15
|
+
*/
|
|
16
|
+
export declare class WorkspaceClient extends BaseClient {
|
|
17
|
+
getWorkspaceInvitations(args: {
|
|
18
|
+
workspaceId: string;
|
|
19
|
+
}, requestId?: string): Promise<WorkspaceInvitationsResponse>;
|
|
20
|
+
getAllWorkspaceInvitations(args?: GetAllWorkspaceInvitationsArgs, requestId?: string): Promise<AllWorkspaceInvitationsResponse>;
|
|
21
|
+
deleteWorkspaceInvitation(args: DeleteWorkspaceInvitationArgs, requestId?: string): Promise<WorkspaceInvitation>;
|
|
22
|
+
acceptWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<WorkspaceInvitation>;
|
|
23
|
+
rejectWorkspaceInvitation(args: WorkspaceInvitationActionArgs, requestId?: string): Promise<WorkspaceInvitation>;
|
|
24
|
+
joinWorkspace(args: JoinWorkspaceArgs, requestId?: string): Promise<JoinWorkspaceResult>;
|
|
25
|
+
uploadWorkspaceLogo(args: WorkspaceLogoArgs, requestId?: string): Promise<WorkspaceLogoResponse>;
|
|
26
|
+
getWorkspacePlanDetails(args: {
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
}, requestId?: string): Promise<WorkspacePlanDetails>;
|
|
29
|
+
getWorkspaceUsers(args?: GetWorkspaceUsersArgs, requestId?: string): Promise<GetWorkspaceUsersResponse>;
|
|
30
|
+
getWorkspaces(requestId?: string): Promise<Workspace[]>;
|
|
31
|
+
getWorkspace(id: string, requestId?: string): Promise<Workspace>;
|
|
32
|
+
addWorkspace(args: AddWorkspaceArgs, requestId?: string): Promise<Workspace>;
|
|
33
|
+
updateWorkspace(id: string, args: UpdateWorkspaceArgs, requestId?: string): Promise<Workspace>;
|
|
34
|
+
deleteWorkspace(id: string, requestId?: string): Promise<boolean>;
|
|
35
|
+
getWorkspaceMembersActivity(args: GetWorkspaceMembersActivityArgs, requestId?: string): Promise<GetWorkspaceMembersActivityResponse>;
|
|
36
|
+
getWorkspaceUserTasks(args: GetWorkspaceUserTasksArgs, requestId?: string): Promise<GetWorkspaceUserTasksResponse>;
|
|
37
|
+
inviteWorkspaceUsers(args: InviteWorkspaceUsersArgs, requestId?: string): Promise<InviteWorkspaceUsersResponse>;
|
|
38
|
+
updateWorkspaceUser(args: UpdateWorkspaceUserArgs, requestId?: string): Promise<JoinWorkspaceResult>;
|
|
39
|
+
removeWorkspaceUser(args: RemoveWorkspaceUserArgs, requestId?: string): Promise<boolean>;
|
|
40
|
+
getWorkspaceActiveProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
|
|
41
|
+
getWorkspaceArchivedProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -80,3 +80,27 @@ export declare function getWorkspaceInviteUsersEndpoint(workspaceId: string): st
|
|
|
80
80
|
export declare function getWorkspaceUserEndpoint(workspaceId: string, userId: string): string;
|
|
81
81
|
export declare function getWorkspaceActiveProjectsEndpoint(workspaceId: string): string;
|
|
82
82
|
export declare function getWorkspaceArchivedProjectsEndpoint(workspaceId: string): string;
|
|
83
|
+
export declare const ENDPOINT_REST_APPS = "apps";
|
|
84
|
+
export declare const ENDPOINT_REST_APPS_INSTALLATIONS = "apps/installations";
|
|
85
|
+
export declare const ENDPOINT_REST_APPS_UI_EXTENSIONS = "apps/ui_extensions";
|
|
86
|
+
export declare const ENDPOINT_REST_APPS_UI_EXTENSIONS_INSTALLED = "apps/ui_extensions/installed";
|
|
87
|
+
export declare const ENDPOINT_REST_USER_AUTHORIZATIONS = "user/authorizations";
|
|
88
|
+
export declare const ENDPOINT_REST_USER_AUTHORIZATIONS_DELETE = "user/authorizations/delete";
|
|
89
|
+
/** Available app icon sizes (small 60x60, medium 300x300, large 600x600). */
|
|
90
|
+
export declare const APP_ICON_SIZES: readonly ["small", "medium", "large"];
|
|
91
|
+
/** Size of an app icon. */
|
|
92
|
+
export type AppIconSize = (typeof APP_ICON_SIZES)[number];
|
|
93
|
+
export declare function getAppEndpoint(appId: string): string;
|
|
94
|
+
export declare function getAppSecretsEndpoint(appId: string): string;
|
|
95
|
+
export declare function getAppClientSecretEndpoint(appId: string): string;
|
|
96
|
+
export declare function getAppTokensEndpoint(appId: string): string;
|
|
97
|
+
export declare function getAppTestTokenEndpoint(appId: string): string;
|
|
98
|
+
export declare function getAppDistributionTokenEndpoint(appId: string): string;
|
|
99
|
+
export declare function getAppVerificationTokenEndpoint(appId: string): string;
|
|
100
|
+
export declare function getAppWebhookEndpoint(appId: string): string;
|
|
101
|
+
export declare function getAppIconEndpoint(appId: string, size: AppIconSize): string;
|
|
102
|
+
export declare function getAppInstallationEndpoint(installationId: string): string;
|
|
103
|
+
export declare function getAppByDistributionTokenEndpoint(distributionToken: string): string;
|
|
104
|
+
export declare function getUiExtensionEndpoint(uiExtensionId: string): string;
|
|
105
|
+
export declare function getUiExtensionIconEndpoint(uiExtensionId: string): string;
|
|
106
|
+
export declare function getUiExtensionsByIntegrationEndpoint(integrationId: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder } from '../types/index.js';
|
|
1
|
+
import { Label, Section, Task, User, Attachment, Duration, Deadline, RawComment, PersonalProject, WorkspaceProject, Reminder, Folder, App, AppWithUserCount, AppSecrets, AppVerificationToken, AppTestToken, AppDistributionToken, AppWebhook, AppInstallation, UserAuthorization, UiExtension } from '../types/index.js';
|
|
2
2
|
import type { Collaborator, CollaboratorState } from '../types/sync/resources/collaborators.js';
|
|
3
3
|
import type { Note } from '../types/sync/resources/notes.js';
|
|
4
4
|
export declare const DEFAULT_TASK_ID = "1234";
|
|
@@ -264,4 +264,19 @@ export declare const COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT: {
|
|
|
264
264
|
export declare const DEFAULT_FOLDER: Folder;
|
|
265
265
|
export declare const DEFAULT_COLLABORATOR: Collaborator;
|
|
266
266
|
export declare const DEFAULT_COLLABORATOR_STATE: CollaboratorState;
|
|
267
|
+
export declare const DEFAULT_APP_ID = "42";
|
|
268
|
+
export declare const DEFAULT_INSTALLATION_ID = "1001";
|
|
269
|
+
export declare const DEFAULT_UI_EXTENSION_ID = "2002";
|
|
270
|
+
export declare const DEFAULT_DISTRIBUTION_TOKEN = "dist-token-abc";
|
|
271
|
+
export declare const DEFAULT_ACCESS_TOKEN_ID = "3003";
|
|
272
|
+
export declare const DEFAULT_APP: App;
|
|
273
|
+
export declare const DEFAULT_APP_WITH_USER_COUNT: AppWithUserCount;
|
|
274
|
+
export declare const DEFAULT_APP_SECRETS: AppSecrets;
|
|
275
|
+
export declare const DEFAULT_APP_VERIFICATION_TOKEN: AppVerificationToken;
|
|
276
|
+
export declare const DEFAULT_APP_TEST_TOKEN: AppTestToken;
|
|
277
|
+
export declare const DEFAULT_APP_DISTRIBUTION_TOKEN: AppDistributionToken;
|
|
278
|
+
export declare const DEFAULT_APP_WEBHOOK: AppWebhook;
|
|
279
|
+
export declare const DEFAULT_APP_INSTALLATION: AppInstallation;
|
|
280
|
+
export declare const DEFAULT_USER_AUTHORIZATION: UserAuthorization;
|
|
281
|
+
export declare const DEFAULT_UI_EXTENSION: UiExtension;
|
|
267
282
|
export declare const DEFAULT_NOTE: Note;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Reminder } from './types/index.js';
|
|
2
2
|
import { GetActivityLogsArgs, GetActivityLogsResponse } from './types/activity/index.js';
|
|
3
|
+
import type { AddAppArgs, App, AppByDistributionToken, AppDistributionToken, AppInstallation, AppSecrets, AppTestToken, AppVerificationToken, AppWebhook, AppWithUserCount, InstallAppArgs, RevokeUserAuthorizationArgs, UpdateAppArgs, UpdateAppInstallationArgs, UpdateAppWebhookArgs, UploadAppIconArgs, UserAuthorization } from './types/apps/index.js';
|
|
3
4
|
import { Backup, GetBackupsArgs, DownloadBackupArgs } from './types/backups/index.js';
|
|
4
5
|
import { Attachment, Comment, AddCommentArgs, UpdateCommentArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetCommentsResponse } from './types/comments/index.js';
|
|
5
6
|
import { GetOrCreateEmailArgs, GetOrCreateEmailResponse, DisableEmailArgs } from './types/emails/index.js';
|
|
6
7
|
import { GetFoldersArgs, GetFoldersResponse, AddFolderArgs, UpdateFolderArgs } from './types/folders/index.js';
|
|
7
|
-
import { CustomFetch,
|
|
8
|
+
import { CustomFetch, FileResponse } from './types/http.js';
|
|
8
9
|
import { IdMapping, MovedId, GetIdMappingsArgs, GetMovedIdsArgs } from './types/id-mappings/index.js';
|
|
9
10
|
import { ProjectActivityStats, ProjectHealth, ProjectHealthContext, ProjectProgress, WorkspaceInsights, GetProjectActivityStatsArgs, GetWorkspaceInsightsArgs } from './types/insights/index.js';
|
|
10
11
|
import { Label, AddLabelArgs, UpdateLabelArgs, GetLabelsArgs, SearchLabelsArgs, GetLabelsResponse, GetSharedLabelsArgs, GetSharedLabelsResponse, RenameSharedLabelArgs, RemoveSharedLabelArgs } from './types/labels/index.js';
|
|
@@ -15,17 +16,32 @@ import { Section, AddSectionArgs, UpdateSectionArgs, GetSectionsArgs, SearchSect
|
|
|
15
16
|
import type { Folder } from './types/sync/resources/folders.js';
|
|
16
17
|
import { Task, AddTaskArgs, GetTasksArgs, GetTasksByFilterArgs, UpdateTaskArgs, QuickAddTaskArgs, type MoveTaskArgs, GetCompletedTasksByCompletionDateArgs, GetCompletedTasksByDueDateArgs, GetCompletedTasksResponse, SearchCompletedTasksArgs, GetTasksResponse, GetAllCompletedTasksArgs, GetAllCompletedTasksResponse } from './types/tasks/index.js';
|
|
17
18
|
import { ExportTemplateFileArgs, ExportTemplateUrlArgs, ExportTemplateUrlResponse, CreateProjectFromTemplateArgs, CreateProjectFromTemplateResponse, ImportTemplateIntoProjectArgs, ImportTemplateFromIdArgs, ImportTemplateResponse } from './types/templates/index.js';
|
|
19
|
+
import type { AddUiExtensionArgs, UiExtension, UpdateUiExtensionArgs, UploadUiExtensionIconArgs } from './types/ui-extensions/index.js';
|
|
18
20
|
import { UploadFileArgs, DeleteUploadArgs } from './types/uploads/index.js';
|
|
19
21
|
import { CurrentUser } from './types/users/index.js';
|
|
20
22
|
import { WorkspaceInvitation, WorkspacePlanDetails, JoinWorkspaceResult, Workspace, AddWorkspaceArgs, UpdateWorkspaceArgs, GetWorkspaceMembersActivityArgs, GetWorkspaceMembersActivityResponse, GetWorkspaceUserTasksArgs, GetWorkspaceUserTasksResponse, InviteWorkspaceUsersArgs, InviteWorkspaceUsersResponse, UpdateWorkspaceUserArgs, RemoveWorkspaceUserArgs, GetWorkspaceInvitationsArgs, DeleteWorkspaceInvitationArgs, WorkspaceInvitationActionArgs, JoinWorkspaceArgs, WorkspaceLogoArgs, GetWorkspacePlanDetailsArgs, GetWorkspaceUsersArgs, GetWorkspaceUsersResponse, GetWorkspaceProjectsArgs, WorkspaceInvitationsResponse, AllWorkspaceInvitationsResponse, WorkspaceLogoResponse } from './types/workspaces/index.js';
|
|
21
23
|
import { type SyncResponse, type SyncRequest } from './types/sync/index.js';
|
|
22
24
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
+
* A client for interacting with the Todoist API v1.
|
|
26
|
+
* This class provides methods to manage tasks, projects, sections, labels, and comments in Todoist.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const api = new TodoistApi('your-api-token');
|
|
31
|
+
*
|
|
32
|
+
* // Get all tasks
|
|
33
|
+
* const tasks = await api.getTasks();
|
|
34
|
+
*
|
|
35
|
+
* // Create a new task
|
|
36
|
+
* const newTask = await api.addTask({
|
|
37
|
+
* content: 'My new task',
|
|
38
|
+
* projectId: '12345'
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* For more information about the Todoist API v1, see the [official documentation](https://todoist.com/api/v1).
|
|
43
|
+
* If you're migrating from v9, please refer to the [migration guide](https://todoist.com/api/v1/docs#tag/Migrating-from-v9).
|
|
25
44
|
*/
|
|
26
|
-
export type FileResponse = CustomFetchResponse & {
|
|
27
|
-
arrayBuffer(): Promise<ArrayBuffer>;
|
|
28
|
-
};
|
|
29
45
|
/**
|
|
30
46
|
* Configuration options for the TodoistApi constructor
|
|
31
47
|
*/
|
|
@@ -43,6 +59,24 @@ export declare class TodoistApi {
|
|
|
43
59
|
private authToken;
|
|
44
60
|
private syncApiBase;
|
|
45
61
|
private customFetch?;
|
|
62
|
+
private readonly taskClient;
|
|
63
|
+
private readonly projectClient;
|
|
64
|
+
private readonly sectionClient;
|
|
65
|
+
private readonly labelClient;
|
|
66
|
+
private readonly commentClient;
|
|
67
|
+
private readonly reminderClient;
|
|
68
|
+
private readonly insightsClient;
|
|
69
|
+
private readonly folderClient;
|
|
70
|
+
private readonly templateClient;
|
|
71
|
+
private readonly uploadClient;
|
|
72
|
+
private readonly backupClient;
|
|
73
|
+
private readonly emailClient;
|
|
74
|
+
private readonly idMappingClient;
|
|
75
|
+
private readonly activityClient;
|
|
76
|
+
private readonly productivityClient;
|
|
77
|
+
private readonly workspaceClient;
|
|
78
|
+
private readonly appClient;
|
|
79
|
+
private readonly uiExtensionClient;
|
|
46
80
|
constructor(
|
|
47
81
|
/**
|
|
48
82
|
* Your Todoist API token.
|
|
@@ -52,16 +86,6 @@ export declare class TodoistApi {
|
|
|
52
86
|
* Optional configuration options
|
|
53
87
|
*/
|
|
54
88
|
options?: TodoistApiOptions);
|
|
55
|
-
/**
|
|
56
|
-
* Makes a request to the Sync API and handles error checking.
|
|
57
|
-
*
|
|
58
|
-
* @param syncRequest - The sync request payload
|
|
59
|
-
* @param requestId - Optional request identifier
|
|
60
|
-
* @param hasSyncCommands - Whether this request contains sync commands (write operations)
|
|
61
|
-
* @returns The sync response data
|
|
62
|
-
* @throws TodoistRequestError if sync status contains errors
|
|
63
|
-
*/
|
|
64
|
-
private requestSync;
|
|
65
89
|
/**
|
|
66
90
|
* Executes a raw Sync API request.
|
|
67
91
|
*
|
|
@@ -845,7 +869,6 @@ export declare class TodoistApi {
|
|
|
845
869
|
* @returns A promise that resolves to the import result.
|
|
846
870
|
*/
|
|
847
871
|
importTemplateFromId(args: ImportTemplateFromIdArgs, requestId?: string): Promise<ImportTemplateResponse>;
|
|
848
|
-
private validateTemplateResponse;
|
|
849
872
|
/**
|
|
850
873
|
* Gets pending invitations for a workspace.
|
|
851
874
|
*
|
|
@@ -1023,4 +1046,202 @@ export declare class TodoistApi {
|
|
|
1023
1046
|
* @returns Paginated list of archived workspace projects.
|
|
1024
1047
|
*/
|
|
1025
1048
|
getWorkspaceArchivedProjects(args: GetWorkspaceProjectsArgs, requestId?: string): Promise<GetProjectsResponse>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Lists all developer applications owned by the authenticated user.
|
|
1051
|
+
*
|
|
1052
|
+
* Requires the `dev:app_console` scope.
|
|
1053
|
+
*
|
|
1054
|
+
* @param requestId - Optional request ID for idempotency.
|
|
1055
|
+
* @returns A promise that resolves to the list of apps.
|
|
1056
|
+
*/
|
|
1057
|
+
getApps(requestId?: string): Promise<App[]>;
|
|
1058
|
+
/**
|
|
1059
|
+
* Retrieves a single developer application by ID.
|
|
1060
|
+
*
|
|
1061
|
+
* Requires the `dev:app_console` scope.
|
|
1062
|
+
*/
|
|
1063
|
+
getApp(appId: string, requestId?: string): Promise<AppWithUserCount>;
|
|
1064
|
+
/**
|
|
1065
|
+
* Creates a new developer application.
|
|
1066
|
+
*
|
|
1067
|
+
* Requires the `dev:app_console` scope.
|
|
1068
|
+
*/
|
|
1069
|
+
addApp(args: AddAppArgs, requestId?: string): Promise<App>;
|
|
1070
|
+
/**
|
|
1071
|
+
* Updates a developer application.
|
|
1072
|
+
*
|
|
1073
|
+
* Requires the `dev:app_console` scope.
|
|
1074
|
+
*/
|
|
1075
|
+
updateApp(appId: string, args: UpdateAppArgs, requestId?: string): Promise<AppWithUserCount>;
|
|
1076
|
+
/**
|
|
1077
|
+
* Deletes a developer application.
|
|
1078
|
+
*
|
|
1079
|
+
* Requires the `dev:app_console` scope.
|
|
1080
|
+
*/
|
|
1081
|
+
deleteApp(appId: string, requestId?: string): Promise<boolean>;
|
|
1082
|
+
/**
|
|
1083
|
+
* Retrieves the OAuth client credentials (client ID and secret) for an app.
|
|
1084
|
+
*
|
|
1085
|
+
* Requires the `dev:app_console` scope.
|
|
1086
|
+
*/
|
|
1087
|
+
getAppSecrets(appId: string, requestId?: string): Promise<AppSecrets>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Rotates the app's OAuth client secret, returning the updated app record.
|
|
1090
|
+
*
|
|
1091
|
+
* Requires the `dev:app_console` scope.
|
|
1092
|
+
*/
|
|
1093
|
+
resetAppClientSecret(appId: string, requestId?: string): Promise<AppWithUserCount>;
|
|
1094
|
+
/**
|
|
1095
|
+
* Revokes every access token issued for the given app.
|
|
1096
|
+
*
|
|
1097
|
+
* Requires the `dev:app_console` scope.
|
|
1098
|
+
*/
|
|
1099
|
+
revokeAppTokens(appId: string, requestId?: string): Promise<AppWithUserCount>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Uploads an icon for a developer application. The `size` argument
|
|
1102
|
+
* selects which icon slot to update (defaults to `'medium'`).
|
|
1103
|
+
*
|
|
1104
|
+
* Requires the `dev:app_console` scope.
|
|
1105
|
+
*/
|
|
1106
|
+
uploadAppIcon(args: UploadAppIconArgs, requestId?: string): Promise<AppWithUserCount>;
|
|
1107
|
+
/**
|
|
1108
|
+
* Gets the currently issued developer test token for an app (null if none exists).
|
|
1109
|
+
*
|
|
1110
|
+
* Requires the `dev:app_console` scope.
|
|
1111
|
+
*/
|
|
1112
|
+
getAppTestToken(appId: string, requestId?: string): Promise<AppTestToken>;
|
|
1113
|
+
/**
|
|
1114
|
+
* Creates (or rotates) a developer test token for an app.
|
|
1115
|
+
*
|
|
1116
|
+
* Requires the `dev:app_console` scope.
|
|
1117
|
+
*/
|
|
1118
|
+
createAppTestToken(appId: string, requestId?: string): Promise<AppTestToken>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Gets the distribution token for an app, which third parties use to install it.
|
|
1121
|
+
*
|
|
1122
|
+
* Requires the `dev:app_console` scope.
|
|
1123
|
+
*/
|
|
1124
|
+
getAppDistributionToken(appId: string, requestId?: string): Promise<AppDistributionToken>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Gets the current webhook verification token for an app.
|
|
1127
|
+
*
|
|
1128
|
+
* Requires the `dev:app_console` scope.
|
|
1129
|
+
*/
|
|
1130
|
+
getAppVerificationToken(appId: string, requestId?: string): Promise<AppVerificationToken>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Resets the webhook verification token for an app, returning the new value.
|
|
1133
|
+
*
|
|
1134
|
+
* Requires the `dev:app_console` scope.
|
|
1135
|
+
*/
|
|
1136
|
+
resetAppVerificationToken(appId: string, requestId?: string): Promise<AppVerificationToken>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Resolves a public-facing app view from a distribution token. Used during
|
|
1139
|
+
* the installation flow to show prospective installers what the app does
|
|
1140
|
+
* and which scopes it requests.
|
|
1141
|
+
*
|
|
1142
|
+
* Requires the `dev:app_console` scope.
|
|
1143
|
+
*/
|
|
1144
|
+
getAppByDistributionToken(distributionToken: string, requestId?: string): Promise<AppByDistributionToken>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Gets the webhook configuration for an app (null if no webhook is configured).
|
|
1147
|
+
*
|
|
1148
|
+
* Requires the `dev:app_console` scope.
|
|
1149
|
+
*/
|
|
1150
|
+
getAppWebhook(appId: string, requestId?: string): Promise<AppWebhook | null>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Creates or updates an app webhook configuration (upsert).
|
|
1153
|
+
*
|
|
1154
|
+
* Requires the `dev:app_console` scope.
|
|
1155
|
+
*/
|
|
1156
|
+
updateAppWebhook(args: UpdateAppWebhookArgs, requestId?: string): Promise<AppWebhook>;
|
|
1157
|
+
/**
|
|
1158
|
+
* Deletes an app webhook configuration.
|
|
1159
|
+
*
|
|
1160
|
+
* Requires the `dev:app_console` scope.
|
|
1161
|
+
*/
|
|
1162
|
+
deleteAppWebhook(appId: string, requestId?: string): Promise<boolean>;
|
|
1163
|
+
/**
|
|
1164
|
+
* Lists all apps installed on the authenticated user's account.
|
|
1165
|
+
*
|
|
1166
|
+
* Requires the `dev:app_console` scope.
|
|
1167
|
+
*/
|
|
1168
|
+
getAppInstallations(requestId?: string): Promise<AppInstallation[]>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Installs an application via its distribution token.
|
|
1171
|
+
*
|
|
1172
|
+
* Requires the `dev:app_console` scope.
|
|
1173
|
+
*/
|
|
1174
|
+
installApp(args: InstallAppArgs, requestId?: string): Promise<AppInstallation>;
|
|
1175
|
+
/**
|
|
1176
|
+
* Retrieves a single app installation by ID.
|
|
1177
|
+
*
|
|
1178
|
+
* Requires the `dev:app_console` scope.
|
|
1179
|
+
*/
|
|
1180
|
+
getAppInstallation(installationId: string, requestId?: string): Promise<AppInstallation>;
|
|
1181
|
+
/**
|
|
1182
|
+
* Updates an app installation.
|
|
1183
|
+
*
|
|
1184
|
+
* Requires the `dev:app_console` scope.
|
|
1185
|
+
*/
|
|
1186
|
+
updateAppInstallation(installationId: string, args: UpdateAppInstallationArgs, requestId?: string): Promise<AppInstallation>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Uninstalls (removes) an app installation.
|
|
1189
|
+
*
|
|
1190
|
+
* Requires the `dev:app_console` scope.
|
|
1191
|
+
*/
|
|
1192
|
+
uninstallApp(installationId: string, requestId?: string): Promise<boolean>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Retrieves a single UI extension by ID.
|
|
1195
|
+
*
|
|
1196
|
+
* Requires the `dev:app_console` scope.
|
|
1197
|
+
*/
|
|
1198
|
+
getUiExtension(uiExtensionId: string, requestId?: string): Promise<UiExtension>;
|
|
1199
|
+
/**
|
|
1200
|
+
* Lists UI extensions available (installed) in the web client for the current user.
|
|
1201
|
+
*
|
|
1202
|
+
* Requires the `dev:app_console` scope.
|
|
1203
|
+
*/
|
|
1204
|
+
getInstalledUiExtensions(requestId?: string): Promise<UiExtension[]>;
|
|
1205
|
+
/**
|
|
1206
|
+
* Lists all UI extensions belonging to a given app (integration).
|
|
1207
|
+
*
|
|
1208
|
+
* Requires the `dev:app_console` scope.
|
|
1209
|
+
*/
|
|
1210
|
+
getUiExtensionsForApp(appId: string, requestId?: string): Promise<UiExtension[]>;
|
|
1211
|
+
/**
|
|
1212
|
+
* Adds a new UI extension to an app.
|
|
1213
|
+
*
|
|
1214
|
+
* Requires the `dev:app_console` scope.
|
|
1215
|
+
*/
|
|
1216
|
+
addUiExtension(args: AddUiExtensionArgs, requestId?: string): Promise<UiExtension>;
|
|
1217
|
+
/**
|
|
1218
|
+
* Updates an existing UI extension.
|
|
1219
|
+
*
|
|
1220
|
+
* Requires the `dev:app_console` scope.
|
|
1221
|
+
*/
|
|
1222
|
+
updateUiExtension(uiExtensionId: string, args: UpdateUiExtensionArgs, requestId?: string): Promise<UiExtension>;
|
|
1223
|
+
/**
|
|
1224
|
+
* Deletes a UI extension.
|
|
1225
|
+
*
|
|
1226
|
+
* Requires the `dev:app_console` scope.
|
|
1227
|
+
*/
|
|
1228
|
+
deleteUiExtension(uiExtensionId: string, requestId?: string): Promise<boolean>;
|
|
1229
|
+
/**
|
|
1230
|
+
* Uploads an icon for a UI extension.
|
|
1231
|
+
*
|
|
1232
|
+
* Requires the `dev:app_console` scope.
|
|
1233
|
+
*/
|
|
1234
|
+
uploadUiExtensionIcon(args: UploadUiExtensionIconArgs, requestId?: string): Promise<UiExtension>;
|
|
1235
|
+
/**
|
|
1236
|
+
* Lists all apps the user has authorized (granted a token to).
|
|
1237
|
+
*
|
|
1238
|
+
* Requires the `dev:app_console` scope.
|
|
1239
|
+
*/
|
|
1240
|
+
getUserAuthorizations(requestId?: string): Promise<UserAuthorization[]>;
|
|
1241
|
+
/**
|
|
1242
|
+
* Revokes a specific user authorization (access token granted to a third-party app).
|
|
1243
|
+
*
|
|
1244
|
+
* Requires the `dev:app_console` scope.
|
|
1245
|
+
*/
|
|
1246
|
+
revokeUserAuthorization(args: RevokeUserAuthorizationArgs, requestId?: string): Promise<boolean>;
|
|
1026
1247
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { CustomFetch } from '../types/http.js';
|
|
2
|
+
import { type SyncRequest, type SyncResponse } from '../types/sync/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Shared context needed to issue Sync API requests.
|
|
5
|
+
*
|
|
6
|
+
* Constructed by {@link TodoistApi} and each {@link BaseClient} subclass so
|
|
7
|
+
* that sub-clients can delegate to {@link performSyncRequest} without
|
|
8
|
+
* rebuilding the HTTP identity on every call.
|
|
9
|
+
*/
|
|
10
|
+
export type SyncRequestContext = {
|
|
11
|
+
authToken: string;
|
|
12
|
+
syncApiBase: string;
|
|
13
|
+
customFetch?: CustomFetch;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Makes a request to the Sync API and handles error checking.
|
|
17
|
+
*
|
|
18
|
+
* @param ctx - HTTP identity (auth token, sync API base URI, optional custom fetch).
|
|
19
|
+
* @param syncRequest - The sync request payload.
|
|
20
|
+
* @param options - Optional request identifier and commands flag.
|
|
21
|
+
* @returns The sync response data.
|
|
22
|
+
* @throws TodoistRequestError if sync status contains errors.
|
|
23
|
+
*/
|
|
24
|
+
export declare function performSyncRequest(ctx: SyncRequestContext, syncRequest: SyncRequest, options?: {
|
|
25
|
+
requestId?: string;
|
|
26
|
+
hasSyncCommands?: boolean;
|
|
27
|
+
}): Promise<SyncResponse>;
|