@doist/todoist-api-typescript 2.2.0 → 3.0.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/TodoistApi.d.ts +3 -3
- package/dist/TodoistApi.js +2 -2
- package/dist/authentication.d.ts +1 -1
- package/dist/types/entities.d.ts +3 -0
- package/dist/types/entities.js +1 -0
- package/dist/types/requests.d.ts +19 -21
- package/package.json +1 -1
package/dist/TodoistApi.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Task, Project, Label, User, Section, Comment } from './types/entities';
|
|
2
|
-
import { AddLabelArgs, AddProjectArgs, AddSectionArgs,
|
|
2
|
+
import { AddCommentArgs, AddLabelArgs, AddProjectArgs, AddSectionArgs, AddTaskArgs, GetProjectCommentsArgs, GetTaskCommentsArgs, GetTasksArgs, UpdateCommentArgs, UpdateLabelArgs, UpdateProjectArgs, UpdateSectionArgs, UpdateTaskArgs, QuickAddTaskArgs, GetSharedLabelsArgs, RenameSharedLabelArgs, RemoveSharedLabelArgs } from './types/requests';
|
|
3
3
|
export declare class TodoistApi {
|
|
4
4
|
authToken: string;
|
|
5
5
|
constructor(authToken: string, baseUrl?: string);
|
|
@@ -44,12 +44,12 @@ export declare class TodoistApi {
|
|
|
44
44
|
* Deletes a personal label
|
|
45
45
|
*/
|
|
46
46
|
deleteLabel(id: string, requestId?: string): Promise<boolean>;
|
|
47
|
-
getSharedLabels(): Promise<string[]>;
|
|
47
|
+
getSharedLabels(args?: GetSharedLabelsArgs): Promise<string[]>;
|
|
48
48
|
renameSharedLabel(args: RenameSharedLabelArgs): Promise<void>;
|
|
49
49
|
removeSharedLabel(args: RemoveSharedLabelArgs): Promise<void>;
|
|
50
50
|
getComments(args: GetTaskCommentsArgs | GetProjectCommentsArgs): Promise<Comment[]>;
|
|
51
51
|
getComment(id: string): Promise<Comment>;
|
|
52
|
-
addComment(args:
|
|
52
|
+
addComment(args: AddCommentArgs, requestId?: string): Promise<Comment>;
|
|
53
53
|
updateComment(id: string, args: UpdateCommentArgs, requestId?: string): Promise<Comment>;
|
|
54
54
|
deleteComment(id: string, requestId?: string): Promise<boolean>;
|
|
55
55
|
}
|
package/dist/TodoistApi.js
CHANGED
|
@@ -418,12 +418,12 @@ var TodoistApi = /** @class */ (function () {
|
|
|
418
418
|
});
|
|
419
419
|
});
|
|
420
420
|
};
|
|
421
|
-
TodoistApi.prototype.getSharedLabels = function () {
|
|
421
|
+
TodoistApi.prototype.getSharedLabels = function (args) {
|
|
422
422
|
return __awaiter(this, void 0, void 0, function () {
|
|
423
423
|
var response;
|
|
424
424
|
return __generator(this, function (_a) {
|
|
425
425
|
switch (_a.label) {
|
|
426
|
-
case 0: return [4 /*yield*/, (0, restClient_1.request)('GET', this.restApiBase, endpoints_1.ENDPOINT_REST_LABELS_SHARED, this.authToken)];
|
|
426
|
+
case 0: return [4 /*yield*/, (0, restClient_1.request)('GET', this.restApiBase, endpoints_1.ENDPOINT_REST_LABELS_SHARED, this.authToken, args)];
|
|
427
427
|
case 1:
|
|
428
428
|
response = _a.sent();
|
|
429
429
|
return [2 /*return*/, response.data];
|
package/dist/authentication.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type Permission = 'task:add' | 'data:read' | 'data:read_write' | 'data:delete' | 'project:delete';
|
|
2
2
|
export type AuthTokenResponse = {
|
|
3
3
|
accessToken: string;
|
|
4
|
-
|
|
4
|
+
tokenType: string;
|
|
5
5
|
};
|
|
6
6
|
export type AuthTokenRequestArgs = {
|
|
7
7
|
clientId: string;
|
package/dist/types/entities.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const DueDate: import("runtypes").Intersect<[Record<{
|
|
|
16
16
|
}, false>, Partial<{
|
|
17
17
|
datetime: Union<[String, Literal<null>]>;
|
|
18
18
|
timezone: Union<[String, Literal<null>]>;
|
|
19
|
+
lang: Union<[String, Literal<null>]>;
|
|
19
20
|
}, false>]>;
|
|
20
21
|
export type DueDate = Static<typeof DueDate>;
|
|
21
22
|
export declare const Duration: Record<{
|
|
@@ -48,6 +49,7 @@ export declare const Task: import("runtypes").Intersect<[Record<{
|
|
|
48
49
|
}, false>, Partial<{
|
|
49
50
|
datetime: Union<[String, Literal<null>]>;
|
|
50
51
|
timezone: Union<[String, Literal<null>]>;
|
|
52
|
+
lang: Union<[String, Literal<null>]>;
|
|
51
53
|
}, false>]>, Literal<null>]>;
|
|
52
54
|
assigneeId: Union<[String, Literal<null>]>;
|
|
53
55
|
assignerId: Union<[String, Literal<null>]>;
|
|
@@ -71,6 +73,7 @@ export declare const Project: import("runtypes").Intersect<[Record<{
|
|
|
71
73
|
parentId: Union<[String, Literal<null>]>;
|
|
72
74
|
}, false>]>;
|
|
73
75
|
export type Project = Static<typeof Project>;
|
|
76
|
+
export type ProjectViewStyle = 'list' | 'board';
|
|
74
77
|
export declare const Section: Record<{
|
|
75
78
|
id: String;
|
|
76
79
|
order: import("runtypes").Constraint<NumberRunType, number, unknown>;
|
package/dist/types/entities.js
CHANGED
|
@@ -10,6 +10,7 @@ exports.DueDate = (0, runtypes_1.Record)({
|
|
|
10
10
|
}).And((0, runtypes_1.Partial)({
|
|
11
11
|
datetime: runtypes_1.String.Or(runtypes_1.Null),
|
|
12
12
|
timezone: runtypes_1.String.Or(runtypes_1.Null),
|
|
13
|
+
lang: runtypes_1.String.Or(runtypes_1.Null),
|
|
13
14
|
}));
|
|
14
15
|
exports.Duration = (0, runtypes_1.Record)({
|
|
15
16
|
amount: runtypes_1.Number.withConstraint(function (n) { return n > 0 || 'Value should be greater than zero'; }),
|
package/dist/types/requests.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RequireAllOrNone } from 'type-fest';
|
|
2
|
-
import type { Duration } from './entities';
|
|
1
|
+
import type { RequireAllOrNone, RequireOneOrNone, RequireExactlyOne } from 'type-fest';
|
|
2
|
+
import type { Duration, ProjectViewStyle } from './entities';
|
|
3
3
|
export type AddTaskArgs = {
|
|
4
4
|
content: string;
|
|
5
5
|
description?: string;
|
|
@@ -9,12 +9,13 @@ export type AddTaskArgs = {
|
|
|
9
9
|
order?: number;
|
|
10
10
|
labels?: string[];
|
|
11
11
|
priority?: number;
|
|
12
|
-
dueString?: string;
|
|
13
12
|
dueLang?: string;
|
|
13
|
+
assigneeId?: string;
|
|
14
|
+
dueString?: string;
|
|
15
|
+
} & RequireOneOrNone<{
|
|
14
16
|
dueDate?: string;
|
|
15
17
|
dueDatetime?: string;
|
|
16
|
-
|
|
17
|
-
} & RequireAllOrNone<{
|
|
18
|
+
}> & RequireAllOrNone<{
|
|
18
19
|
duration?: Duration['amount'];
|
|
19
20
|
durationUnit?: Duration['unit'];
|
|
20
21
|
}>;
|
|
@@ -37,16 +38,16 @@ export type UpdateTaskArgs = {
|
|
|
37
38
|
description?: string;
|
|
38
39
|
labels?: string[];
|
|
39
40
|
priority?: number;
|
|
40
|
-
dueString?: string | null;
|
|
41
41
|
dueLang?: string | null;
|
|
42
|
-
dueDate?: string | null;
|
|
43
|
-
dueDatetime?: string | null;
|
|
44
42
|
assigneeId?: string | null;
|
|
45
|
-
|
|
43
|
+
dueString?: string;
|
|
44
|
+
} & RequireOneOrNone<{
|
|
45
|
+
dueDate?: string;
|
|
46
|
+
dueDatetime?: string;
|
|
47
|
+
}> & RequireAllOrNone<{
|
|
46
48
|
duration?: Duration['amount'];
|
|
47
49
|
durationUnit?: Duration['unit'];
|
|
48
50
|
}>;
|
|
49
|
-
export type ProjectViewStyle = 'list' | 'board';
|
|
50
51
|
export type AddProjectArgs = {
|
|
51
52
|
name: string;
|
|
52
53
|
parentId?: string;
|
|
@@ -88,7 +89,7 @@ export type GetProjectCommentsArgs = {
|
|
|
88
89
|
projectId: string;
|
|
89
90
|
taskId?: never;
|
|
90
91
|
};
|
|
91
|
-
type AddCommentArgs = {
|
|
92
|
+
export type AddCommentArgs = {
|
|
92
93
|
content: string;
|
|
93
94
|
attachment?: {
|
|
94
95
|
fileName?: string;
|
|
@@ -96,18 +97,16 @@ type AddCommentArgs = {
|
|
|
96
97
|
fileType?: string;
|
|
97
98
|
resourceType?: string;
|
|
98
99
|
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
};
|
|
104
|
-
export type AddProjectCommentArgs = AddCommentArgs & {
|
|
105
|
-
projectId: string;
|
|
106
|
-
taskId?: never;
|
|
107
|
-
};
|
|
100
|
+
} & RequireExactlyOne<{
|
|
101
|
+
taskId?: string;
|
|
102
|
+
projectId?: string;
|
|
103
|
+
}>;
|
|
108
104
|
export type UpdateCommentArgs = {
|
|
109
105
|
content: string;
|
|
110
106
|
};
|
|
107
|
+
export type GetSharedLabelsArgs = {
|
|
108
|
+
omitPersonal?: boolean;
|
|
109
|
+
};
|
|
111
110
|
export type RenameSharedLabelArgs = {
|
|
112
111
|
name: string;
|
|
113
112
|
newName: string;
|
|
@@ -115,4 +114,3 @@ export type RenameSharedLabelArgs = {
|
|
|
115
114
|
export type RemoveSharedLabelArgs = {
|
|
116
115
|
name: string;
|
|
117
116
|
};
|
|
118
|
-
export {};
|
package/package.json
CHANGED