@doist/todoist-sdk 9.1.0-next.1 → 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 -6
- package/dist/cjs/test-utils/test-defaults.js +77 -1
- package/dist/cjs/todoist-api.js +422 -1665
- package/dist/cjs/transport/http-client.js +1 -0
- package/dist/cjs/transport/sync-request.js +75 -0
- package/dist/cjs/types/apps/types.js +253 -0
- package/dist/cjs/types/index.js +2 -1
- package/dist/cjs/types/sync/commands/index.js +0 -1
- package/dist/cjs/types/sync/resource-types.js +0 -1
- package/dist/cjs/types/sync/response.js +10 -12
- package/dist/cjs/types/ui-extensions/index.js +18 -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 +45 -33
- 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 -5
- package/dist/esm/test-utils/test-defaults.js +75 -0
- package/dist/esm/todoist-api.js +425 -1668
- package/dist/esm/transport/http-client.js +1 -0
- package/dist/esm/transport/sync-request.js +72 -0
- package/dist/esm/types/apps/types.js +248 -0
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/types/sync/commands/index.js +0 -1
- package/dist/esm/types/sync/resource-types.js +0 -1
- package/dist/esm/types/sync/response.js +0 -2
- 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 -2
- 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 -5
- package/dist/types/test-utils/test-defaults.d.ts +16 -1
- package/dist/types/todoist-api.d.ts +238 -28
- 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 -1
- package/dist/types/types/sync/commands/index.d.ts +0 -9
- package/dist/types/types/sync/resource-types.d.ts +1 -1
- package/dist/types/types/sync/resources/user.d.ts +2 -2
- package/dist/types/types/sync/resources/view-options.d.ts +6 -6
- package/dist/types/types/sync/response.d.ts +6 -31
- package/dist/types/types/sync/user-preferences.d.ts +1 -1
- package/dist/types/types/tasks/requests.d.ts +0 -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 +231 -55
- package/package.json +1 -1
- package/dist/cjs/types/goals/types.js +0 -29
- package/dist/esm/types/goals/types.js +0 -26
- package/dist/types/types/goals/requests.d.ts +0 -33
- package/dist/types/types/goals/types.d.ts +0 -41
- package/dist/types/types/sync/commands/goals.d.ts +0 -33
- /package/dist/cjs/types/{goals → apps}/index.js +0 -0
- /package/dist/cjs/types/{goals → apps}/requests.js +0 -0
- /package/dist/cjs/types/{sync/commands/goals.js → ui-extensions/requests.js} +0 -0
- /package/dist/esm/types/{goals → apps}/index.js +0 -0
- /package/dist/esm/types/{goals → apps}/requests.js +0 -0
- /package/dist/{types/types/goals/index.d.ts → esm/types/ui-extensions/index.js} +0 -0
- /package/dist/esm/types/{sync/commands/goals.js → ui-extensions/requests.js} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AddFolderArgs, GetFoldersArgs, GetFoldersResponse, UpdateFolderArgs } from '../types/folders/index.js';
|
|
2
|
+
import type { Folder } from '../types/sync/resources/folders.js';
|
|
3
|
+
import { BaseClient } from './base-client.js';
|
|
4
|
+
/**
|
|
5
|
+
* Internal sub-client handling all folder-domain endpoints.
|
|
6
|
+
*
|
|
7
|
+
* Instantiated by `TodoistApi`; every public folder method on `TodoistApi`
|
|
8
|
+
* delegates here. See `todoist-api.ts` for the user-facing JSDoc.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FolderClient extends BaseClient {
|
|
11
|
+
getFolders(args: GetFoldersArgs): Promise<GetFoldersResponse>;
|
|
12
|
+
getFolder(id: string): Promise<Folder>;
|
|
13
|
+
addFolder(args: AddFolderArgs, requestId?: string): Promise<Folder>;
|
|
14
|
+
updateFolder(id: string, args: UpdateFolderArgs, requestId?: string): Promise<Folder>;
|
|
15
|
+
deleteFolder(id: string, requestId?: string): Promise<boolean>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { GetIdMappingsArgs, GetMovedIdsArgs, IdMapping, MovedId } from '../types/id-mappings/index.js';
|
|
2
|
+
import { BaseClient } from './base-client.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal sub-client handling ID-mapping endpoints.
|
|
5
|
+
*
|
|
6
|
+
* Instantiated by `TodoistApi`; every public id-mapping method on
|
|
7
|
+
* `TodoistApi` delegates here. See `todoist-api.ts` for user-facing
|
|
8
|
+
* JSDoc.
|
|
9
|
+
*/
|
|
10
|
+
export declare class IdMappingClient extends BaseClient {
|
|
11
|
+
getIdMappings(args: GetIdMappingsArgs): Promise<IdMapping[]>;
|
|
12
|
+
getMovedIds(args: GetMovedIdsArgs): Promise<MovedId[]>;
|
|
13
|
+
}
|
|
@@ -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 {};
|
|
@@ -58,11 +58,6 @@ export declare const ENDPOINT_GET_TOKEN = "access_token";
|
|
|
58
58
|
export declare const ENDPOINT_REVOKE = "revoke";
|
|
59
59
|
export declare const ENDPOINT_REGISTER = "register";
|
|
60
60
|
export declare const ENDPOINT_REST_FOLDERS = "folders";
|
|
61
|
-
export declare const ENDPOINT_REST_GOALS = "goals";
|
|
62
|
-
export declare const ENDPOINT_REST_GOALS_SEARCH: string;
|
|
63
|
-
export declare const GOAL_COMPLETE = "complete";
|
|
64
|
-
export declare const GOAL_UNCOMPLETE = "uncomplete";
|
|
65
|
-
export declare const GOAL_TASKS = "items";
|
|
66
61
|
export declare const ENDPOINT_REST_WORKSPACES = "workspaces";
|
|
67
62
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS = "workspaces/invitations";
|
|
68
63
|
export declare const ENDPOINT_WORKSPACE_INVITATIONS_ALL = "workspaces/invitations/all";
|
|
@@ -85,3 +80,27 @@ export declare function getWorkspaceInviteUsersEndpoint(workspaceId: string): st
|
|
|
85
80
|
export declare function getWorkspaceUserEndpoint(workspaceId: string, userId: string): string;
|
|
86
81
|
export declare function getWorkspaceActiveProjectsEndpoint(workspaceId: string): string;
|
|
87
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;
|