@doist/todoist-api-typescript 2.0.7 → 2.1.1

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.
@@ -19,7 +19,7 @@ export declare class TodoistApi {
19
19
  updateProject(id: string, args: UpdateProjectArgs, requestId?: string): Promise<Project>;
20
20
  deleteProject(id: string, requestId?: string): Promise<boolean>;
21
21
  getProjectCollaborators(projectId: string): Promise<User[]>;
22
- getSections(projectId?: number): Promise<Section[]>;
22
+ getSections(projectId?: string): Promise<Section[]>;
23
23
  getSection(id: string): Promise<Section>;
24
24
  addSection(args: AddSectionArgs, requestId?: string): Promise<Section>;
25
25
  updateSection(id: string, args: UpdateSectionArgs, requestId?: string): Promise<Section>;
@@ -55,7 +55,7 @@ exports.DEFAULT_QUICK_ADD_RESPONSE = {
55
55
  childOrder: DEFAULT_ORDER,
56
56
  labels: DEFAULT_LABELS,
57
57
  responsibleUid: DEFAULT_ASSIGNEE,
58
- checked: 0,
58
+ checked: false,
59
59
  addedAt: DEFAULT_DATE,
60
60
  addedByUid: DEFAULT_CREATOR,
61
61
  due: {
@@ -124,8 +124,29 @@ export declare const User: Record<{
124
124
  }, false>;
125
125
  export declare type User = Static<typeof User>;
126
126
  export declare type Color = {
127
+ /**
128
+ * @deprecated No longer used
129
+ */
127
130
  id: number;
131
+ /**
132
+ * The key of the color (i.e. 'berry_red')
133
+ */
134
+ key: string;
135
+ /**
136
+ * The display name of the color (i.e. 'Berry Red')
137
+ */
138
+ displayName: string;
139
+ /**
140
+ * @deprecated Use {@link Color.displayName} instead
141
+ */
128
142
  name: string;
143
+ /**
144
+ * The hex value of the color (i.e. '#b8255f')
145
+ */
146
+ hexValue: string;
147
+ /**
148
+ * @deprecated Use {@link Color.hexValue} instead
149
+ */
129
150
  value: string;
130
151
  };
131
152
  export declare type QuickAddTaskResponse = {
@@ -139,7 +160,7 @@ export declare type QuickAddTaskResponse = {
139
160
  childOrder: number;
140
161
  labels: string[];
141
162
  responsibleUid: string | null;
142
- checked: number;
163
+ checked: boolean;
143
164
  addedAt: string;
144
165
  addedByUid: string | null;
145
166
  due: {
@@ -42,13 +42,13 @@ export declare type ProjectViewStyle = 'list' | 'board';
42
42
  export declare type AddProjectArgs = {
43
43
  name: string;
44
44
  parentId?: string;
45
- color?: number;
45
+ color?: string;
46
46
  isFavorite?: boolean;
47
47
  viewStyle?: ProjectViewStyle;
48
48
  };
49
49
  export declare type UpdateProjectArgs = {
50
50
  name?: string;
51
- color?: number;
51
+ color?: string;
52
52
  isFavorite?: boolean;
53
53
  viewStyle?: ProjectViewStyle;
54
54
  };
@@ -63,13 +63,13 @@ export declare type UpdateSectionArgs = {
63
63
  export declare type AddLabelArgs = {
64
64
  name: string;
65
65
  order?: number;
66
- color?: number;
66
+ color?: string;
67
67
  isFavorite?: boolean;
68
68
  };
69
69
  export declare type UpdateLabelArgs = {
70
70
  name?: string;
71
71
  order?: number;
72
- color?: number;
72
+ color?: string;
73
73
  isFavorite?: boolean;
74
74
  };
75
75
  export declare type GetTaskCommentsArgs = {
@@ -19,6 +19,14 @@ export declare const salmon: Color;
19
19
  export declare const charcoal: Color;
20
20
  export declare const gray: Color;
21
21
  export declare const taupe: Color;
22
- export declare const colors: Color[];
22
+ export declare const colors: readonly [Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color, Color];
23
+ export declare const defaultColor: Color;
24
+ /**
25
+ * @deprecated Use {@link getColorByKey} instead
26
+ */
23
27
  export declare function getColorById(colorId: number): Color;
28
+ /**
29
+ * @deprecated Use {@link getColorByKey} instead
30
+ */
24
31
  export declare function getColorByName(colorName: string): Color;
32
+ export declare function getColorByKey(colorKey: string): Color;
@@ -1,26 +1,166 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getColorByName = exports.getColorById = exports.colors = exports.taupe = exports.gray = exports.charcoal = exports.salmon = exports.magenta = exports.lavender = exports.violet = exports.grape = exports.blue = exports.lightBlue = exports.skyBlue = exports.turquoise = exports.mintGreen = exports.green = exports.limeGreen = exports.oliveGreen = exports.yellow = exports.orange = exports.red = exports.berryRed = void 0;
4
- exports.berryRed = { name: 'Berry Red', id: 30, value: '#b8255f' };
5
- exports.red = { name: 'Red', id: 31, value: '#db4035' };
6
- exports.orange = { name: 'Orange', id: 32, value: '#ff9933' };
7
- exports.yellow = { name: 'Yellow', id: 33, value: '#fad000' };
8
- exports.oliveGreen = { name: 'Olive Green', id: 34, value: '#afb83b' };
9
- exports.limeGreen = { name: 'Lime Green', id: 35, value: '#7ecc49' };
10
- exports.green = { name: 'Green', id: 36, value: '#299438' };
11
- exports.mintGreen = { name: 'Mint Green', id: 37, value: '#6accbc' };
12
- exports.turquoise = { name: 'Turquoise', id: 38, value: '#158fad' };
13
- exports.skyBlue = { name: 'Sky Blue', id: 39, value: '#14aaf5' };
14
- exports.lightBlue = { name: 'Light Blue', id: 40, value: '#96c3eb' };
15
- exports.blue = { name: 'Blue', id: 41, value: '#4073ff' };
16
- exports.grape = { name: 'Grape', id: 42, value: '#884dff' };
17
- exports.violet = { name: 'Violet', id: 43, value: '#af38eb' };
18
- exports.lavender = { name: 'Lavender', id: 44, value: '#eb96eb' };
19
- exports.magenta = { name: 'Magenta', id: 45, value: '#e05194' };
20
- exports.salmon = { name: 'Salmon', id: 46, value: '#ff8d85' };
21
- exports.charcoal = { name: 'Charcoal', id: 47, value: '#808080' };
22
- exports.gray = { name: 'Gray', id: 48, value: '#b8b8b8' };
23
- exports.taupe = { name: 'Taupe', id: 49, value: '#ccac93' };
3
+ exports.getColorByKey = exports.getColorByName = exports.getColorById = exports.defaultColor = exports.colors = exports.taupe = exports.gray = exports.charcoal = exports.salmon = exports.magenta = exports.lavender = exports.violet = exports.grape = exports.blue = exports.lightBlue = exports.skyBlue = exports.turquoise = exports.mintGreen = exports.green = exports.limeGreen = exports.oliveGreen = exports.yellow = exports.orange = exports.red = exports.berryRed = void 0;
4
+ exports.berryRed = {
5
+ id: 30,
6
+ key: 'berry_red',
7
+ displayName: 'Berry Red',
8
+ name: 'Berry Red',
9
+ hexValue: '#b8255f',
10
+ value: '#b8255f',
11
+ };
12
+ exports.red = {
13
+ id: 31,
14
+ key: 'red',
15
+ displayName: 'Red',
16
+ name: 'Red',
17
+ hexValue: '#db4035',
18
+ value: '#db4035',
19
+ };
20
+ exports.orange = {
21
+ id: 32,
22
+ key: 'orange',
23
+ displayName: 'Orange',
24
+ name: 'Orange',
25
+ hexValue: '#ff9933',
26
+ value: '#ff9933',
27
+ };
28
+ exports.yellow = {
29
+ id: 33,
30
+ key: 'yellow',
31
+ displayName: 'Yellow',
32
+ name: 'Yellow',
33
+ hexValue: '#fad000',
34
+ value: '#fad000',
35
+ };
36
+ exports.oliveGreen = {
37
+ id: 34,
38
+ key: 'olive_green',
39
+ displayName: 'Olive Green',
40
+ name: 'Olive Green',
41
+ hexValue: '#afb83b',
42
+ value: '#afb83b',
43
+ };
44
+ exports.limeGreen = {
45
+ id: 35,
46
+ key: 'lime_green',
47
+ displayName: 'Lime Green',
48
+ name: 'Lime Green',
49
+ hexValue: '#7ecc49',
50
+ value: '#7ecc49',
51
+ };
52
+ exports.green = {
53
+ id: 36,
54
+ key: 'green',
55
+ displayName: 'Green',
56
+ name: 'Green',
57
+ hexValue: '#299438',
58
+ value: '#299438',
59
+ };
60
+ exports.mintGreen = {
61
+ id: 37,
62
+ key: 'mint_green',
63
+ displayName: 'Mint Green',
64
+ name: 'Mint Green',
65
+ hexValue: '#6accbc',
66
+ value: '#6accbc',
67
+ };
68
+ exports.turquoise = {
69
+ id: 38,
70
+ key: 'turquoise',
71
+ displayName: 'Turquoise',
72
+ name: 'Turquoise',
73
+ hexValue: '#158fad',
74
+ value: '#158fad',
75
+ };
76
+ exports.skyBlue = {
77
+ id: 39,
78
+ key: 'sky_blue',
79
+ displayName: 'Sky Blue',
80
+ name: 'Sky Blue',
81
+ hexValue: '#14aaf5',
82
+ value: '#14aaf5',
83
+ };
84
+ exports.lightBlue = {
85
+ id: 40,
86
+ key: 'light_blue',
87
+ displayName: 'Light Blue',
88
+ name: 'Light Blue',
89
+ hexValue: '#96c3eb',
90
+ value: '#96c3eb',
91
+ };
92
+ exports.blue = {
93
+ id: 41,
94
+ key: 'blue',
95
+ displayName: 'Blue',
96
+ name: 'Blue',
97
+ hexValue: '#4073ff',
98
+ value: '#4073ff',
99
+ };
100
+ exports.grape = {
101
+ id: 42,
102
+ key: 'grape',
103
+ displayName: 'Grape',
104
+ name: 'Grape',
105
+ hexValue: '#884dff',
106
+ value: '#884dff',
107
+ };
108
+ exports.violet = {
109
+ id: 43,
110
+ key: 'violet',
111
+ displayName: 'Violet',
112
+ name: 'Violet',
113
+ hexValue: '#af38eb',
114
+ value: '#af38eb',
115
+ };
116
+ exports.lavender = {
117
+ id: 44,
118
+ key: 'lavender',
119
+ displayName: 'Lavender',
120
+ name: 'Lavender',
121
+ hexValue: '#eb96eb',
122
+ value: '#eb96eb',
123
+ };
124
+ exports.magenta = {
125
+ id: 45,
126
+ key: 'magenta',
127
+ displayName: 'Magenta',
128
+ name: 'Magenta',
129
+ hexValue: '#e05194',
130
+ value: '#e05194',
131
+ };
132
+ exports.salmon = {
133
+ id: 46,
134
+ key: 'salmon',
135
+ displayName: 'Salmon',
136
+ name: 'Salmon',
137
+ hexValue: '#ff8d85',
138
+ value: '#ff8d85',
139
+ };
140
+ exports.charcoal = {
141
+ id: 47,
142
+ key: 'charcoal',
143
+ displayName: 'Charcoal',
144
+ name: 'Charcoal',
145
+ hexValue: '#808080',
146
+ value: '#808080',
147
+ };
148
+ exports.gray = {
149
+ id: 48,
150
+ key: 'gray',
151
+ displayName: 'Gray',
152
+ name: 'Gray',
153
+ hexValue: '#b8b8b8',
154
+ value: '#b8b8b8',
155
+ };
156
+ exports.taupe = {
157
+ id: 49,
158
+ key: 'taupe',
159
+ displayName: 'Taupe',
160
+ name: 'Taupe',
161
+ hexValue: '#ccac93',
162
+ value: '#ccac93',
163
+ };
24
164
  exports.colors = [
25
165
  exports.berryRed,
26
166
  exports.red,
@@ -43,13 +183,25 @@ exports.colors = [
43
183
  exports.gray,
44
184
  exports.taupe,
45
185
  ];
186
+ exports.defaultColor = exports.charcoal;
187
+ /**
188
+ * @deprecated Use {@link getColorByKey} instead
189
+ */
46
190
  function getColorById(colorId) {
47
191
  var color = exports.colors.find(function (color) { return color.id === colorId; });
48
- return color !== null && color !== void 0 ? color : exports.charcoal;
192
+ return color !== null && color !== void 0 ? color : exports.defaultColor;
49
193
  }
50
194
  exports.getColorById = getColorById;
195
+ /**
196
+ * @deprecated Use {@link getColorByKey} instead
197
+ */
51
198
  function getColorByName(colorName) {
52
199
  var color = exports.colors.find(function (color) { return color.name === colorName; });
53
- return color !== null && color !== void 0 ? color : exports.charcoal;
200
+ return color !== null && color !== void 0 ? color : exports.defaultColor;
54
201
  }
55
202
  exports.getColorByName = getColorByName;
203
+ function getColorByKey(colorKey) {
204
+ var color = exports.colors.find(function (color) { return color.key === colorKey; });
205
+ return color !== null && color !== void 0 ? color : exports.defaultColor;
206
+ }
207
+ exports.getColorByKey = getColorByKey;
@@ -20,7 +20,7 @@ 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 === 1, 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({ 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
  }));
26
26
  return task;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/todoist-api-typescript",
3
- "version": "2.0.7",
3
+ "version": "2.1.1",
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",
@@ -25,21 +25,21 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "axios": "^0.27.0",
28
- "axios-case-converter": "^0.9.0",
28
+ "axios-case-converter": "^0.11.0",
29
29
  "axios-retry": "^3.1.9",
30
30
  "runtypes": "^6.5.0",
31
31
  "ts-custom-error": "^3.2.0",
32
32
  "uuid": "^9.0.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@doist/eslint-config": "7.5.0",
35
+ "@doist/eslint-config": "8.0.1",
36
36
  "@doist/prettier-config": "3.0.5",
37
37
  "@types/axios": "0.14.0",
38
38
  "@types/jest": "27.5.2",
39
39
  "@types/uuid": "8.3.4",
40
- "@typescript-eslint/eslint-plugin": "5.39.0",
41
- "@typescript-eslint/parser": "5.39.0",
42
- "eslint": "8.24.0",
40
+ "@typescript-eslint/eslint-plugin": "5.42.0",
41
+ "@typescript-eslint/parser": "5.42.0",
42
+ "eslint": "8.26.0",
43
43
  "eslint-config-prettier": "8.5.0",
44
44
  "eslint-import-resolver-webpack": "0.13.2",
45
45
  "eslint-plugin-import": "2.26.0",