@doist/todoist-api-typescript 2.1.2 → 2.2.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.js +1 -1
- package/dist/authentication.d.ts +4 -4
- package/dist/authentication.js +1 -1
- package/dist/restClient.js +1 -1
- package/dist/testUtils/asserts.js +1 -1
- package/dist/testUtils/testDefaults.d.ts +6 -1
- package/dist/testUtils/testDefaults.js +8 -2
- package/dist/types/entities.d.ts +23 -13
- package/dist/types/entities.js +6 -1
- package/dist/types/http.d.ts +1 -1
- package/dist/types/requests.d.ts +29 -21
- package/dist/utils/sanitization.d.ts +1 -1
- package/dist/utils/taskConverters.js +2 -2
- package/package.json +15 -14
package/dist/TodoistApi.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/authentication.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type Permission = 'task:add' | 'data:read' | 'data:read_write' | 'data:delete' | 'project:delete';
|
|
2
|
+
export type AuthTokenResponse = {
|
|
3
3
|
accessToken: string;
|
|
4
4
|
state: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type AuthTokenRequestArgs = {
|
|
7
7
|
clientId: string;
|
|
8
8
|
clientSecret: string;
|
|
9
9
|
code: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type RevokeAuthTokenRequestArgs = {
|
|
12
12
|
clientId: string;
|
|
13
13
|
clientSecret: string;
|
|
14
14
|
accessToken: string;
|
package/dist/authentication.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/restClient.js
CHANGED
|
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
25
25
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
26
|
function step(op) {
|
|
27
27
|
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
29
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
30
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
31
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Label, Project, QuickAddTaskResponse, Section, Task, User, Comment, Attachment } from '../types';
|
|
1
|
+
import { Label, Project, QuickAddTaskResponse, Section, Task, User, Comment, Attachment, Duration } from '../types';
|
|
2
2
|
export declare const DEFAULT_AUTH_TOKEN = "AToken";
|
|
3
3
|
export declare const DEFAULT_REQUEST_ID = "ARequestID";
|
|
4
4
|
export declare const INVALID_ENTITY_ID = 1234;
|
|
@@ -7,6 +7,7 @@ export declare const DEFAULT_DUE_DATE: {
|
|
|
7
7
|
string: string;
|
|
8
8
|
date: string;
|
|
9
9
|
};
|
|
10
|
+
export declare const DEFAULT_DURATION: Duration;
|
|
10
11
|
export declare const INVALID_DUE_DATE: {
|
|
11
12
|
isRecurring: string;
|
|
12
13
|
string: string;
|
|
@@ -32,6 +33,10 @@ export declare const INVALID_TASK: {
|
|
|
32
33
|
createdAt: string;
|
|
33
34
|
url: string;
|
|
34
35
|
creatorId: string;
|
|
36
|
+
duration: {
|
|
37
|
+
amount: number;
|
|
38
|
+
unit: "minute" | "day";
|
|
39
|
+
} | null;
|
|
35
40
|
assigneeId?: string | null | undefined;
|
|
36
41
|
assignerId?: string | null | undefined;
|
|
37
42
|
parentId?: string | null | undefined;
|
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = exports.COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = exports.COMMENT_WITH_OPTIONALS_AS_NULL_TASK = exports.INVALID_COMMENT = exports.DEFAULT_COMMENT = exports.INVALID_ATTACHMENT = exports.DEFAULT_ATTACHMENT = exports.INVALID_USER = exports.DEFAULT_USER = exports.INVALID_LABEL = exports.DEFAULT_LABEL = exports.INVALID_SECTION = exports.DEFAULT_SECTION = exports.PROJECT_WITH_OPTIONALS_AS_NULL = exports.INVALID_PROJECT = exports.DEFAULT_PROJECT = exports.TASK_WITH_OPTIONALS_AS_NULL = exports.INVALID_TASK = exports.DEFAULT_TASK = exports.DEFAULT_QUICK_ADD_RESPONSE = exports.INVALID_DUE_DATE = exports.DEFAULT_DUE_DATE = exports.INVALID_ENTITY_ID = exports.DEFAULT_REQUEST_ID = exports.DEFAULT_AUTH_TOKEN = void 0;
|
|
14
|
+
exports.COMMENT_WITH_OPTIONALS_AS_NULL_PROJECT = exports.COMMENT_WITH_ATTACHMENT_WITH_OPTIONALS_AS_NULL = exports.COMMENT_WITH_OPTIONALS_AS_NULL_TASK = exports.INVALID_COMMENT = exports.DEFAULT_COMMENT = exports.INVALID_ATTACHMENT = exports.DEFAULT_ATTACHMENT = exports.INVALID_USER = exports.DEFAULT_USER = exports.INVALID_LABEL = exports.DEFAULT_LABEL = exports.INVALID_SECTION = exports.DEFAULT_SECTION = exports.PROJECT_WITH_OPTIONALS_AS_NULL = exports.INVALID_PROJECT = exports.DEFAULT_PROJECT = exports.TASK_WITH_OPTIONALS_AS_NULL = exports.INVALID_TASK = exports.DEFAULT_TASK = exports.DEFAULT_QUICK_ADD_RESPONSE = exports.INVALID_DUE_DATE = exports.DEFAULT_DURATION = exports.DEFAULT_DUE_DATE = exports.INVALID_ENTITY_ID = exports.DEFAULT_REQUEST_ID = exports.DEFAULT_AUTH_TOKEN = void 0;
|
|
15
15
|
var DEFAULT_TASK_ID = '1234';
|
|
16
16
|
var DEFAULT_TASK_CONTENT = 'This is a task';
|
|
17
17
|
var DEFAULT_TASK_DESCRIPTION = 'A description';
|
|
@@ -43,6 +43,10 @@ exports.DEFAULT_DUE_DATE = {
|
|
|
43
43
|
string: 'a date string',
|
|
44
44
|
date: DEFAULT_DATE,
|
|
45
45
|
};
|
|
46
|
+
exports.DEFAULT_DURATION = {
|
|
47
|
+
amount: 10,
|
|
48
|
+
unit: 'minute',
|
|
49
|
+
};
|
|
46
50
|
exports.INVALID_DUE_DATE = __assign(__assign({}, exports.DEFAULT_DUE_DATE), { isRecurring: 'false' });
|
|
47
51
|
exports.DEFAULT_QUICK_ADD_RESPONSE = {
|
|
48
52
|
id: DEFAULT_TASK_ID,
|
|
@@ -58,6 +62,7 @@ exports.DEFAULT_QUICK_ADD_RESPONSE = {
|
|
|
58
62
|
checked: false,
|
|
59
63
|
addedAt: DEFAULT_DATE,
|
|
60
64
|
addedByUid: DEFAULT_CREATOR,
|
|
65
|
+
duration: exports.DEFAULT_DURATION,
|
|
61
66
|
due: {
|
|
62
67
|
date: DEFAULT_DATE,
|
|
63
68
|
timezone: null,
|
|
@@ -83,9 +88,10 @@ exports.DEFAULT_TASK = {
|
|
|
83
88
|
due: exports.DEFAULT_DUE_DATE,
|
|
84
89
|
assigneeId: DEFAULT_ASSIGNEE,
|
|
85
90
|
creatorId: DEFAULT_CREATOR,
|
|
91
|
+
duration: exports.DEFAULT_DURATION,
|
|
86
92
|
};
|
|
87
93
|
exports.INVALID_TASK = __assign(__assign({}, exports.DEFAULT_TASK), { due: exports.INVALID_DUE_DATE });
|
|
88
|
-
exports.TASK_WITH_OPTIONALS_AS_NULL = __assign(__assign({}, exports.DEFAULT_TASK), { due: null, assigneeId: null, assignerId: null, parentId: null, sectionId: null });
|
|
94
|
+
exports.TASK_WITH_OPTIONALS_AS_NULL = __assign(__assign({}, exports.DEFAULT_TASK), { due: null, assigneeId: null, assignerId: null, parentId: null, sectionId: null, duration: null });
|
|
89
95
|
exports.DEFAULT_PROJECT = {
|
|
90
96
|
id: DEFAULT_PROJECT_ID,
|
|
91
97
|
name: DEFAULT_PROJECT_NAME,
|
package/dist/types/entities.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Boolean, Number as NumberRunType, String, Array, Record, Static, Partial, Literal, Union } from 'runtypes';
|
|
2
2
|
export declare const Int: import("runtypes").Constraint<NumberRunType, number, unknown>;
|
|
3
|
-
export
|
|
3
|
+
export type TodoistEntity = {
|
|
4
4
|
id: string;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type OrderedEntity = TodoistEntity & {
|
|
7
7
|
order: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type EntityInHierarchy = OrderedEntity & {
|
|
10
10
|
parentId?: string | null;
|
|
11
11
|
};
|
|
12
12
|
export declare const DueDate: import("runtypes").Intersect<[Record<{
|
|
@@ -17,7 +17,12 @@ export declare const DueDate: import("runtypes").Intersect<[Record<{
|
|
|
17
17
|
datetime: Union<[String, Literal<null>]>;
|
|
18
18
|
timezone: Union<[String, Literal<null>]>;
|
|
19
19
|
}, false>]>;
|
|
20
|
-
export
|
|
20
|
+
export type DueDate = Static<typeof DueDate>;
|
|
21
|
+
export declare const Duration: Record<{
|
|
22
|
+
amount: import("runtypes").Constraint<NumberRunType, number, unknown>;
|
|
23
|
+
unit: Union<[Literal<"minute">, Literal<"day">]>;
|
|
24
|
+
}, false>;
|
|
25
|
+
export type Duration = Static<typeof Duration>;
|
|
21
26
|
export declare const Task: import("runtypes").Intersect<[Record<{
|
|
22
27
|
id: String;
|
|
23
28
|
order: import("runtypes").Constraint<NumberRunType, number, unknown>;
|
|
@@ -31,6 +36,10 @@ export declare const Task: import("runtypes").Intersect<[Record<{
|
|
|
31
36
|
createdAt: String;
|
|
32
37
|
url: String;
|
|
33
38
|
creatorId: String;
|
|
39
|
+
duration: Union<[Record<{
|
|
40
|
+
amount: import("runtypes").Constraint<NumberRunType, number, unknown>;
|
|
41
|
+
unit: Union<[Literal<"minute">, Literal<"day">]>;
|
|
42
|
+
}, false>, Literal<null>]>;
|
|
34
43
|
}, false>, Partial<{
|
|
35
44
|
due: Union<[import("runtypes").Intersect<[Record<{
|
|
36
45
|
isRecurring: Boolean;
|
|
@@ -45,7 +54,7 @@ export declare const Task: import("runtypes").Intersect<[Record<{
|
|
|
45
54
|
parentId: Union<[String, Literal<null>]>;
|
|
46
55
|
sectionId: Union<[String, Literal<null>]>;
|
|
47
56
|
}, false>]>;
|
|
48
|
-
export
|
|
57
|
+
export type Task = Static<typeof Task>;
|
|
49
58
|
export declare const Project: import("runtypes").Intersect<[Record<{
|
|
50
59
|
id: String;
|
|
51
60
|
name: String;
|
|
@@ -61,14 +70,14 @@ export declare const Project: import("runtypes").Intersect<[Record<{
|
|
|
61
70
|
}, false>, Partial<{
|
|
62
71
|
parentId: Union<[String, Literal<null>]>;
|
|
63
72
|
}, false>]>;
|
|
64
|
-
export
|
|
73
|
+
export type Project = Static<typeof Project>;
|
|
65
74
|
export declare const Section: Record<{
|
|
66
75
|
id: String;
|
|
67
76
|
order: import("runtypes").Constraint<NumberRunType, number, unknown>;
|
|
68
77
|
name: String;
|
|
69
78
|
projectId: String;
|
|
70
79
|
}, false>;
|
|
71
|
-
export
|
|
80
|
+
export type Section = Static<typeof Section>;
|
|
72
81
|
export declare const Label: Record<{
|
|
73
82
|
id: String;
|
|
74
83
|
order: import("runtypes").Constraint<NumberRunType, number, unknown>;
|
|
@@ -76,7 +85,7 @@ export declare const Label: Record<{
|
|
|
76
85
|
color: String;
|
|
77
86
|
isFavorite: Boolean;
|
|
78
87
|
}, false>;
|
|
79
|
-
export
|
|
88
|
+
export type Label = Static<typeof Label>;
|
|
80
89
|
export declare const Attachment: import("runtypes").Intersect<[Record<{
|
|
81
90
|
resourceType: String;
|
|
82
91
|
}, false>, Partial<{
|
|
@@ -92,7 +101,7 @@ export declare const Attachment: import("runtypes").Intersect<[Record<{
|
|
|
92
101
|
url: Union<[String, Literal<null>]>;
|
|
93
102
|
title: Union<[String, Literal<null>]>;
|
|
94
103
|
}, false>]>;
|
|
95
|
-
export
|
|
104
|
+
export type Attachment = Static<typeof Attachment>;
|
|
96
105
|
export declare const Comment: import("runtypes").Intersect<[Record<{
|
|
97
106
|
id: String;
|
|
98
107
|
content: String;
|
|
@@ -116,14 +125,14 @@ export declare const Comment: import("runtypes").Intersect<[Record<{
|
|
|
116
125
|
title: Union<[String, Literal<null>]>;
|
|
117
126
|
}, false>]>, Literal<null>]>;
|
|
118
127
|
}, false>]>;
|
|
119
|
-
export
|
|
128
|
+
export type Comment = Static<typeof Comment>;
|
|
120
129
|
export declare const User: Record<{
|
|
121
130
|
id: String;
|
|
122
131
|
name: String;
|
|
123
132
|
email: String;
|
|
124
133
|
}, false>;
|
|
125
|
-
export
|
|
126
|
-
export
|
|
134
|
+
export type User = Static<typeof User>;
|
|
135
|
+
export type Color = {
|
|
127
136
|
/**
|
|
128
137
|
* @deprecated No longer used
|
|
129
138
|
*/
|
|
@@ -149,7 +158,7 @@ export declare type Color = {
|
|
|
149
158
|
*/
|
|
150
159
|
value: string;
|
|
151
160
|
};
|
|
152
|
-
export
|
|
161
|
+
export type QuickAddTaskResponse = {
|
|
153
162
|
id: string;
|
|
154
163
|
projectId: string;
|
|
155
164
|
content: string;
|
|
@@ -163,6 +172,7 @@ export declare type QuickAddTaskResponse = {
|
|
|
163
172
|
checked: boolean;
|
|
164
173
|
addedAt: string;
|
|
165
174
|
addedByUid: string | null;
|
|
175
|
+
duration: Duration | null;
|
|
166
176
|
due: {
|
|
167
177
|
date: string;
|
|
168
178
|
timezone: string | null;
|
package/dist/types/entities.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.User = exports.Comment = exports.Attachment = exports.Label = exports.Section = exports.Project = exports.Task = exports.DueDate = exports.Int = void 0;
|
|
3
|
+
exports.User = exports.Comment = exports.Attachment = exports.Label = exports.Section = exports.Project = exports.Task = exports.Duration = exports.DueDate = exports.Int = void 0;
|
|
4
4
|
var runtypes_1 = require("runtypes");
|
|
5
5
|
exports.Int = runtypes_1.Number.withConstraint(function (n) { return Number.isInteger(n) || "".concat(n, " is not a valid entity id. Should be a string"); });
|
|
6
6
|
exports.DueDate = (0, runtypes_1.Record)({
|
|
@@ -11,6 +11,10 @@ exports.DueDate = (0, runtypes_1.Record)({
|
|
|
11
11
|
datetime: runtypes_1.String.Or(runtypes_1.Null),
|
|
12
12
|
timezone: runtypes_1.String.Or(runtypes_1.Null),
|
|
13
13
|
}));
|
|
14
|
+
exports.Duration = (0, runtypes_1.Record)({
|
|
15
|
+
amount: runtypes_1.Number.withConstraint(function (n) { return n > 0 || 'Value should be greater than zero'; }),
|
|
16
|
+
unit: (0, runtypes_1.Union)((0, runtypes_1.Literal)('minute'), (0, runtypes_1.Literal)('day')),
|
|
17
|
+
});
|
|
14
18
|
exports.Task = (0, runtypes_1.Record)({
|
|
15
19
|
id: runtypes_1.String,
|
|
16
20
|
order: exports.Int,
|
|
@@ -24,6 +28,7 @@ exports.Task = (0, runtypes_1.Record)({
|
|
|
24
28
|
createdAt: runtypes_1.String,
|
|
25
29
|
url: runtypes_1.String,
|
|
26
30
|
creatorId: runtypes_1.String,
|
|
31
|
+
duration: exports.Duration.Or(runtypes_1.Null),
|
|
27
32
|
}).And((0, runtypes_1.Partial)({
|
|
28
33
|
due: exports.DueDate.Or(runtypes_1.Null),
|
|
29
34
|
assigneeId: runtypes_1.String.Or(runtypes_1.Null),
|
package/dist/types/http.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type HttpMethod = 'POST' | 'GET' | 'DELETE';
|
package/dist/types/requests.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import type { RequireAllOrNone } from 'type-fest';
|
|
2
|
+
import type { Duration } from './entities';
|
|
3
|
+
export type AddTaskArgs = {
|
|
2
4
|
content: string;
|
|
3
5
|
description?: string;
|
|
4
6
|
projectId?: string;
|
|
@@ -12,14 +14,17 @@ export declare type AddTaskArgs = {
|
|
|
12
14
|
dueDate?: string;
|
|
13
15
|
dueDatetime?: string;
|
|
14
16
|
assigneeId?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
+
} & RequireAllOrNone<{
|
|
18
|
+
duration?: Duration['amount'];
|
|
19
|
+
durationUnit?: Duration['unit'];
|
|
20
|
+
}>;
|
|
21
|
+
export type QuickAddTaskArgs = {
|
|
17
22
|
text: string;
|
|
18
23
|
note?: string;
|
|
19
24
|
reminder?: string;
|
|
20
25
|
autoReminder?: boolean;
|
|
21
26
|
};
|
|
22
|
-
export
|
|
27
|
+
export type GetTasksArgs = {
|
|
23
28
|
projectId?: string;
|
|
24
29
|
sectionId?: string;
|
|
25
30
|
label?: string;
|
|
@@ -27,7 +32,7 @@ export declare type GetTasksArgs = {
|
|
|
27
32
|
lang?: string;
|
|
28
33
|
ids?: string[];
|
|
29
34
|
};
|
|
30
|
-
export
|
|
35
|
+
export type UpdateTaskArgs = {
|
|
31
36
|
content?: string;
|
|
32
37
|
description?: string;
|
|
33
38
|
labels?: string[];
|
|
@@ -37,50 +42,53 @@ export declare type UpdateTaskArgs = {
|
|
|
37
42
|
dueDate?: string | null;
|
|
38
43
|
dueDatetime?: string | null;
|
|
39
44
|
assigneeId?: string | null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
} & RequireAllOrNone<{
|
|
46
|
+
duration?: Duration['amount'];
|
|
47
|
+
durationUnit?: Duration['unit'];
|
|
48
|
+
}>;
|
|
49
|
+
export type ProjectViewStyle = 'list' | 'board';
|
|
50
|
+
export type AddProjectArgs = {
|
|
43
51
|
name: string;
|
|
44
52
|
parentId?: string;
|
|
45
53
|
color?: string;
|
|
46
54
|
isFavorite?: boolean;
|
|
47
55
|
viewStyle?: ProjectViewStyle;
|
|
48
56
|
};
|
|
49
|
-
export
|
|
57
|
+
export type UpdateProjectArgs = {
|
|
50
58
|
name?: string;
|
|
51
59
|
color?: string;
|
|
52
60
|
isFavorite?: boolean;
|
|
53
61
|
viewStyle?: ProjectViewStyle;
|
|
54
62
|
};
|
|
55
|
-
export
|
|
63
|
+
export type AddSectionArgs = {
|
|
56
64
|
name: string;
|
|
57
65
|
projectId: string;
|
|
58
66
|
order?: number;
|
|
59
67
|
};
|
|
60
|
-
export
|
|
68
|
+
export type UpdateSectionArgs = {
|
|
61
69
|
name: string;
|
|
62
70
|
};
|
|
63
|
-
export
|
|
71
|
+
export type AddLabelArgs = {
|
|
64
72
|
name: string;
|
|
65
73
|
order?: number;
|
|
66
74
|
color?: string;
|
|
67
75
|
isFavorite?: boolean;
|
|
68
76
|
};
|
|
69
|
-
export
|
|
77
|
+
export type UpdateLabelArgs = {
|
|
70
78
|
name?: string;
|
|
71
79
|
order?: number;
|
|
72
80
|
color?: string;
|
|
73
81
|
isFavorite?: boolean;
|
|
74
82
|
};
|
|
75
|
-
export
|
|
83
|
+
export type GetTaskCommentsArgs = {
|
|
76
84
|
taskId: string;
|
|
77
85
|
projectId?: never;
|
|
78
86
|
};
|
|
79
|
-
export
|
|
87
|
+
export type GetProjectCommentsArgs = {
|
|
80
88
|
projectId: string;
|
|
81
89
|
taskId?: never;
|
|
82
90
|
};
|
|
83
|
-
|
|
91
|
+
type AddCommentArgs = {
|
|
84
92
|
content: string;
|
|
85
93
|
attachment?: {
|
|
86
94
|
fileName?: string;
|
|
@@ -89,22 +97,22 @@ declare type AddCommentArgs = {
|
|
|
89
97
|
resourceType?: string;
|
|
90
98
|
};
|
|
91
99
|
};
|
|
92
|
-
export
|
|
100
|
+
export type AddTaskCommentArgs = AddCommentArgs & {
|
|
93
101
|
taskId: string;
|
|
94
102
|
projectId?: never;
|
|
95
103
|
};
|
|
96
|
-
export
|
|
104
|
+
export type AddProjectCommentArgs = AddCommentArgs & {
|
|
97
105
|
projectId: string;
|
|
98
106
|
taskId?: never;
|
|
99
107
|
};
|
|
100
|
-
export
|
|
108
|
+
export type UpdateCommentArgs = {
|
|
101
109
|
content: string;
|
|
102
110
|
};
|
|
103
|
-
export
|
|
111
|
+
export type RenameSharedLabelArgs = {
|
|
104
112
|
name: string;
|
|
105
113
|
newName: string;
|
|
106
114
|
};
|
|
107
|
-
export
|
|
115
|
+
export type RemoveSharedLabelArgs = {
|
|
108
116
|
name: string;
|
|
109
117
|
};
|
|
110
118
|
export {};
|
|
@@ -20,9 +20,9 @@ function getTaskFromQuickAddResponse(responseData) {
|
|
|
20
20
|
var _a;
|
|
21
21
|
var due = responseData.due
|
|
22
22
|
? __assign(__assign({ isRecurring: responseData.due.isRecurring, string: responseData.due.string, date: responseData.due.date }, (responseData.due.timezone !== null && { datetime: responseData.due.date })), (responseData.due.timezone !== null && { timezone: responseData.due.timezone })) : undefined;
|
|
23
|
-
var task = __assign(__assign(__assign({ id: responseData.id, order: responseData.childOrder, content: responseData.content, description: responseData.description, projectId: responseData.projectId, sectionId: responseData.sectionId ? responseData.sectionId : undefined, isCompleted: responseData.checked, labels: responseData.labels, priority: responseData.priority, commentCount: 0, createdAt: responseData.addedAt, url: getTaskUrlFromQuickAddResponse(responseData), creatorId: (_a = responseData.addedByUid) !== null && _a !== void 0 ? _a : '' }, (due !== undefined && { due: due })), (responseData.parentId !== null && { parentId: responseData.parentId })), (responseData.responsibleUid !== null && {
|
|
23
|
+
var task = __assign(__assign(__assign(__assign({ id: responseData.id, order: responseData.childOrder, content: responseData.content, description: responseData.description, projectId: responseData.projectId, sectionId: responseData.sectionId ? responseData.sectionId : undefined, isCompleted: responseData.checked, labels: responseData.labels, priority: responseData.priority, commentCount: 0, createdAt: responseData.addedAt, url: getTaskUrlFromQuickAddResponse(responseData), creatorId: (_a = responseData.addedByUid) !== null && _a !== void 0 ? _a : '' }, (due !== undefined && { due: due })), (responseData.parentId !== null && { parentId: responseData.parentId })), (responseData.responsibleUid !== null && {
|
|
24
24
|
assigneeId: responseData.responsibleUid,
|
|
25
|
-
}));
|
|
25
|
+
})), { duration: responseData.duration });
|
|
26
26
|
return task;
|
|
27
27
|
}
|
|
28
28
|
exports.getTaskFromQuickAddResponse = getTaskFromQuickAddResponse;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-api-typescript",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
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",
|
|
@@ -32,27 +32,28 @@
|
|
|
32
32
|
"uuid": "^9.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@doist/eslint-config": "8.
|
|
35
|
+
"@doist/eslint-config": "8.1.3",
|
|
36
36
|
"@doist/prettier-config": "3.0.5",
|
|
37
37
|
"@types/axios": "0.14.0",
|
|
38
|
-
"@types/jest": "
|
|
38
|
+
"@types/jest": "29.4.0",
|
|
39
39
|
"@types/uuid": "8.3.4",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
41
|
-
"@typescript-eslint/parser": "5.
|
|
42
|
-
"eslint": "8.
|
|
43
|
-
"eslint-config-prettier": "8.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "5.54.1",
|
|
41
|
+
"@typescript-eslint/parser": "5.54.1",
|
|
42
|
+
"eslint": "8.35.0",
|
|
43
|
+
"eslint-config-prettier": "8.7.0",
|
|
44
44
|
"eslint-import-resolver-webpack": "0.13.2",
|
|
45
|
-
"eslint-plugin-import": "2.
|
|
45
|
+
"eslint-plugin-import": "2.27.5",
|
|
46
46
|
"eslint-plugin-prettier": "4.2.1",
|
|
47
|
-
"husky": "8.0.
|
|
48
|
-
"jest": "
|
|
49
|
-
"lint-staged": "13.
|
|
47
|
+
"husky": "8.0.3",
|
|
48
|
+
"jest": "29.5.0",
|
|
49
|
+
"lint-staged": "13.1.4",
|
|
50
50
|
"npm-run-all": "4.1.5",
|
|
51
|
-
"prettier": "2.
|
|
51
|
+
"prettier": "2.8.4",
|
|
52
52
|
"rimraf": "3.0.2",
|
|
53
|
-
"ts-jest": "
|
|
53
|
+
"ts-jest": "29.0.5",
|
|
54
54
|
"ts-node": "10.9.1",
|
|
55
|
-
"
|
|
55
|
+
"type-fest": "^4.5.0",
|
|
56
|
+
"typescript": "4.9.5"
|
|
56
57
|
},
|
|
57
58
|
"prettier": "@doist/prettier-config",
|
|
58
59
|
"husky": {
|