@doist/todoist-api-typescript 4.0.0-alpha.1 → 4.0.0-alpha.2

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,14 +1,11 @@
1
- import { Task, Project, Label, User, Section, Comment } from './types/entities';
2
- import { AddCommentArgs, AddLabelArgs, AddProjectArgs, AddSectionArgs, AddTaskArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetTasksArgs, UpdateCommentArgs, UpdateLabelArgs, UpdateProjectArgs, UpdateSectionArgs, UpdateTaskArgs, QuickAddTaskArgs, GetSharedLabelsArgs, RenameSharedLabelArgs, RemoveSharedLabelArgs, GetProjectsArgs, GetProjectCollaboratorsArgs, GetSections, GetLabelsArgs } from './types/requests';
1
+ import { Task, Project, Label, Section, Comment } from './types/entities';
2
+ import { AddCommentArgs, AddLabelArgs, AddProjectArgs, AddSectionArgs, AddTaskArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetTasksArgs, UpdateCommentArgs, UpdateLabelArgs, UpdateProjectArgs, UpdateSectionArgs, UpdateTaskArgs, QuickAddTaskArgs, GetSharedLabelsArgs, RenameSharedLabelArgs, RemoveSharedLabelArgs, GetProjectsArgs, GetProjectCollaboratorsArgs, GetLabelsArgs, GetLabelsResponse, GetTasksResponse, GetProjectsResponse, GetProjectCollaboratorsResponse, GetSectionsArgs, GetSectionsResponse, GetSharedLabelsResponse, GetCommentsResponse } from './types/requests';
3
3
  export declare class TodoistApi {
4
4
  authToken: string;
5
5
  constructor(authToken: string, baseUrl?: string);
6
6
  private syncApiBase;
7
7
  getTask(id: string): Promise<Task>;
8
- getTasks(args?: GetTasksArgs): Promise<{
9
- results: Task[];
10
- nextCursor: string | null;
11
- }>;
8
+ getTasks(args?: GetTasksArgs): Promise<GetTasksResponse>;
12
9
  addTask(args: AddTaskArgs, requestId?: string): Promise<Task>;
13
10
  quickAddTask(args: QuickAddTaskArgs): Promise<Task>;
14
11
  updateTask(id: string, args: UpdateTaskArgs, requestId?: string): Promise<Task>;
@@ -16,21 +13,12 @@ export declare class TodoistApi {
16
13
  reopenTask(id: string, requestId?: string): Promise<boolean>;
17
14
  deleteTask(id: string, requestId?: string): Promise<boolean>;
18
15
  getProject(id: string): Promise<Project>;
19
- getProjects(args?: GetProjectsArgs): Promise<{
20
- results: Project[];
21
- nextCursor: string | null;
22
- }>;
16
+ getProjects(args?: GetProjectsArgs): Promise<GetProjectsResponse>;
23
17
  addProject(args: AddProjectArgs, requestId?: string): Promise<Project>;
24
18
  updateProject(id: string, args: UpdateProjectArgs, requestId?: string): Promise<Project>;
25
19
  deleteProject(id: string, requestId?: string): Promise<boolean>;
26
- getProjectCollaborators(projectId: string, args?: GetProjectCollaboratorsArgs): Promise<{
27
- results: User[];
28
- nextCursor: string | null;
29
- }>;
30
- getSections(args: GetSections): Promise<{
31
- results: Section[];
32
- nextCursor: string | null;
33
- }>;
20
+ getProjectCollaborators(projectId: string, args?: GetProjectCollaboratorsArgs): Promise<GetProjectCollaboratorsResponse>;
21
+ getSections(args: GetSectionsArgs): Promise<GetSectionsResponse>;
34
22
  getSection(id: string): Promise<Section>;
35
23
  addSection(args: AddSectionArgs, requestId?: string): Promise<Section>;
36
24
  updateSection(id: string, args: UpdateSectionArgs, requestId?: string): Promise<Section>;
@@ -42,10 +30,7 @@ export declare class TodoistApi {
42
30
  /**
43
31
  * Fetches the personal labels
44
32
  */
45
- getLabels(args?: GetLabelsArgs): Promise<{
46
- results: Label[];
47
- nextCursor: string | null;
48
- }>;
33
+ getLabels(args?: GetLabelsArgs): Promise<GetLabelsResponse>;
49
34
  /**
50
35
  * Adds a personal label
51
36
  */
@@ -58,16 +43,10 @@ export declare class TodoistApi {
58
43
  * Deletes a personal label
59
44
  */
60
45
  deleteLabel(id: string, requestId?: string): Promise<boolean>;
61
- getSharedLabels(args?: GetSharedLabelsArgs): Promise<{
62
- results: string[];
63
- nextCursor: string | null;
64
- }>;
46
+ getSharedLabels(args?: GetSharedLabelsArgs): Promise<GetSharedLabelsResponse>;
65
47
  renameSharedLabel(args: RenameSharedLabelArgs): Promise<boolean>;
66
48
  removeSharedLabel(args: RemoveSharedLabelArgs): Promise<boolean>;
67
- getComments(args: GetTaskCommentsArgs | GetProjectCommentsArgs): Promise<{
68
- results: Comment[];
69
- nextCursor: string | null;
70
- }>;
49
+ getComments(args: GetTaskCommentsArgs | GetProjectCommentsArgs): Promise<GetCommentsResponse>;
71
50
  getComment(id: string): Promise<Comment>;
72
51
  addComment(args: AddCommentArgs, requestId?: string): Promise<Comment>;
73
52
  updateComment(id: string, args: UpdateCommentArgs, requestId?: string): Promise<Comment>;
@@ -1,5 +1,5 @@
1
1
  import type { RequireAllOrNone, RequireOneOrNone, RequireExactlyOne } from 'type-fest';
2
- import type { Duration, ProjectViewStyle } from './entities';
2
+ import type { Comment, Duration, Label, Project, ProjectViewStyle, Section, Task, User } from './entities';
3
3
  export type AddTaskArgs = {
4
4
  content: string;
5
5
  description?: string;
@@ -38,6 +38,10 @@ export type GetTasksArgs = {
38
38
  cursor?: string | null;
39
39
  limit?: number;
40
40
  };
41
+ export type GetTasksResponse = {
42
+ results: Task[];
43
+ nextCursor: string | null;
44
+ };
41
45
  export type UpdateTaskArgs = {
42
46
  content?: string;
43
47
  description?: string;
@@ -59,6 +63,10 @@ export type GetProjectsArgs = {
59
63
  cursor?: string | null;
60
64
  limit?: number;
61
65
  };
66
+ export type GetProjectsResponse = {
67
+ results: Project[];
68
+ nextCursor: string | null;
69
+ };
62
70
  export type AddProjectArgs = {
63
71
  name: string;
64
72
  parentId?: string;
@@ -76,11 +84,19 @@ export type GetProjectCollaboratorsArgs = {
76
84
  cursor?: string | null;
77
85
  limit?: number;
78
86
  };
79
- export type GetSections = {
87
+ export type GetProjectCollaboratorsResponse = {
88
+ results: User[];
89
+ nextCursor: string | null;
90
+ };
91
+ export type GetSectionsArgs = {
80
92
  projectId: string | null;
81
93
  cursor?: string | null;
82
94
  limit?: number;
83
95
  };
96
+ export type GetSectionsResponse = {
97
+ results: Section[];
98
+ nextCursor: string | null;
99
+ };
84
100
  export type AddSectionArgs = {
85
101
  name: string;
86
102
  projectId: string;
@@ -93,6 +109,10 @@ export type GetLabelsArgs = {
93
109
  cursor?: string | null;
94
110
  limit?: number;
95
111
  };
112
+ export type GetLabelsResponse = {
113
+ results: Label[];
114
+ nextCursor: string | null;
115
+ };
96
116
  export type AddLabelArgs = {
97
117
  name: string;
98
118
  order?: number | null;
@@ -109,6 +129,10 @@ export type GetCommentsBaseArgs = {
109
129
  cursor?: string | null;
110
130
  limit?: number;
111
131
  };
132
+ export type GetCommentsResponse = {
133
+ results: Comment[];
134
+ nextCursor: string | null;
135
+ };
112
136
  export type GetTaskCommentsArgs = GetCommentsBaseArgs & {
113
137
  taskId: string;
114
138
  projectId?: never;
@@ -137,6 +161,10 @@ export type GetSharedLabelsArgs = {
137
161
  cursor?: string | null;
138
162
  limit?: number;
139
163
  };
164
+ export type GetSharedLabelsResponse = {
165
+ results: string[];
166
+ nextCursor: string | null;
167
+ };
140
168
  export type RenameSharedLabelArgs = {
141
169
  name: string;
142
170
  newName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-api-typescript",
3
- "version": "4.0.0-alpha.1",
3
+ "version": "4.0.0-alpha.2",
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",