@maxim_mazurok/gapi.client.tasks-v1 0.0.20220808
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/index.d.ts +726 -0
- package/package.json +20 -0
- package/readme.md +141 -0
- package/tests.ts +200 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,726 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Tasks API v1 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/tasks/
|
|
3
|
+
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
|
4
|
+
// Nick Amoscato <https://github.com/namoscato>
|
|
5
|
+
// Declan Vong <https://github.com/declanvong>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 2.8
|
|
8
|
+
|
|
9
|
+
// IMPORTANT
|
|
10
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
11
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
12
|
+
// Generated from: https://tasks.googleapis.com/$discovery/rest?version=v1
|
|
13
|
+
// Revision: 20220808
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Tasks API v1 */
|
|
19
|
+
function load(urlOrObject: "https://tasks.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "tasks", version: "v1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "tasks", version: "v1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace tasks {
|
|
26
|
+
interface Task {
|
|
27
|
+
/** Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed. */
|
|
28
|
+
completed?: string;
|
|
29
|
+
/** Flag indicating whether the task has been deleted. The default is False. */
|
|
30
|
+
deleted?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Due date of the task (as a RFC 3339 timestamp). Optional. The due date only records date information; the time portion of the timestamp is discarded when setting the due date. It
|
|
33
|
+
* isn't possible to read or write the time that a task is due via the API.
|
|
34
|
+
*/
|
|
35
|
+
due?: string;
|
|
36
|
+
/** ETag of the resource. */
|
|
37
|
+
etag?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Flag indicating whether the task is hidden. This is the case if the task had been marked completed when the task list was last cleared. The default is False. This field is
|
|
40
|
+
* read-only.
|
|
41
|
+
*/
|
|
42
|
+
hidden?: boolean;
|
|
43
|
+
/** Task identifier. */
|
|
44
|
+
id?: string;
|
|
45
|
+
/** Type of the resource. This is always "tasks#task". */
|
|
46
|
+
kind?: string;
|
|
47
|
+
/** Collection of links. This collection is read-only. */
|
|
48
|
+
links?: Array<{
|
|
49
|
+
/** The description. In HTML speak: Everything between <a> and </a>. */
|
|
50
|
+
description?: string;
|
|
51
|
+
/** The URL. */
|
|
52
|
+
link?: string;
|
|
53
|
+
/** Type of the link, e.g. "email". */
|
|
54
|
+
type?: string;
|
|
55
|
+
}>;
|
|
56
|
+
/** Notes describing the task. Optional. */
|
|
57
|
+
notes?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Parent task identifier. This field is omitted if it is a top-level task. This field is read-only. Use the "move" method to move the task under a different parent or to the top
|
|
60
|
+
* level.
|
|
61
|
+
*/
|
|
62
|
+
parent?: string;
|
|
63
|
+
/**
|
|
64
|
+
* String indicating the position of the task among its sibling tasks under the same parent task or at the top level. If this string is greater than another task's corresponding
|
|
65
|
+
* position string according to lexicographical ordering, the task is positioned after the other task under the same parent task (or at the top level). This field is read-only. Use the
|
|
66
|
+
* "move" method to move the task to another position.
|
|
67
|
+
*/
|
|
68
|
+
position?: string;
|
|
69
|
+
/** URL pointing to this task. Used to retrieve, update, or delete this task. */
|
|
70
|
+
selfLink?: string;
|
|
71
|
+
/** Status of the task. This is either "needsAction" or "completed". */
|
|
72
|
+
status?: string;
|
|
73
|
+
/** Title of the task. */
|
|
74
|
+
title?: string;
|
|
75
|
+
/** Last modification time of the task (as a RFC 3339 timestamp). */
|
|
76
|
+
updated?: string;
|
|
77
|
+
}
|
|
78
|
+
interface TaskList {
|
|
79
|
+
/** ETag of the resource. */
|
|
80
|
+
etag?: string;
|
|
81
|
+
/** Task list identifier. */
|
|
82
|
+
id?: string;
|
|
83
|
+
/** Type of the resource. This is always "tasks#taskList". */
|
|
84
|
+
kind?: string;
|
|
85
|
+
/** URL pointing to this task list. Used to retrieve, update, or delete this task list. */
|
|
86
|
+
selfLink?: string;
|
|
87
|
+
/** Title of the task list. */
|
|
88
|
+
title?: string;
|
|
89
|
+
/** Last modification time of the task list (as a RFC 3339 timestamp). */
|
|
90
|
+
updated?: string;
|
|
91
|
+
}
|
|
92
|
+
interface TaskLists {
|
|
93
|
+
/** ETag of the resource. */
|
|
94
|
+
etag?: string;
|
|
95
|
+
/** Collection of task lists. */
|
|
96
|
+
items?: TaskList[];
|
|
97
|
+
/** Type of the resource. This is always "tasks#taskLists". */
|
|
98
|
+
kind?: string;
|
|
99
|
+
/** Token that can be used to request the next page of this result. */
|
|
100
|
+
nextPageToken?: string;
|
|
101
|
+
}
|
|
102
|
+
interface Tasks {
|
|
103
|
+
/** ETag of the resource. */
|
|
104
|
+
etag?: string;
|
|
105
|
+
/** Collection of tasks. */
|
|
106
|
+
items?: Task[];
|
|
107
|
+
/** Type of the resource. This is always "tasks#tasks". */
|
|
108
|
+
kind?: string;
|
|
109
|
+
/** Token used to access the next page of this result. */
|
|
110
|
+
nextPageToken?: string;
|
|
111
|
+
}
|
|
112
|
+
interface TasklistsResource {
|
|
113
|
+
/** Deletes the authenticated user's specified task list. */
|
|
114
|
+
delete(request?: {
|
|
115
|
+
/** V1 error format. */
|
|
116
|
+
"$.xgafv"?: string;
|
|
117
|
+
/** OAuth access token. */
|
|
118
|
+
access_token?: string;
|
|
119
|
+
/** Data format for response. */
|
|
120
|
+
alt?: string;
|
|
121
|
+
/** JSONP */
|
|
122
|
+
callback?: string;
|
|
123
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
124
|
+
fields?: string;
|
|
125
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
126
|
+
key?: string;
|
|
127
|
+
/** OAuth 2.0 token for the current user. */
|
|
128
|
+
oauth_token?: string;
|
|
129
|
+
/** Returns response with indentations and line breaks. */
|
|
130
|
+
prettyPrint?: boolean;
|
|
131
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
132
|
+
quotaUser?: string;
|
|
133
|
+
/** Task list identifier. */
|
|
134
|
+
tasklist: string;
|
|
135
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
136
|
+
upload_protocol?: string;
|
|
137
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
138
|
+
uploadType?: string;
|
|
139
|
+
}): Request<void>;
|
|
140
|
+
/** Returns the authenticated user's specified task list. */
|
|
141
|
+
get(request?: {
|
|
142
|
+
/** V1 error format. */
|
|
143
|
+
"$.xgafv"?: string;
|
|
144
|
+
/** OAuth access token. */
|
|
145
|
+
access_token?: string;
|
|
146
|
+
/** Data format for response. */
|
|
147
|
+
alt?: string;
|
|
148
|
+
/** JSONP */
|
|
149
|
+
callback?: string;
|
|
150
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
151
|
+
fields?: string;
|
|
152
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
153
|
+
key?: string;
|
|
154
|
+
/** OAuth 2.0 token for the current user. */
|
|
155
|
+
oauth_token?: string;
|
|
156
|
+
/** Returns response with indentations and line breaks. */
|
|
157
|
+
prettyPrint?: boolean;
|
|
158
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
159
|
+
quotaUser?: string;
|
|
160
|
+
/** Task list identifier. */
|
|
161
|
+
tasklist: string;
|
|
162
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
163
|
+
upload_protocol?: string;
|
|
164
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
165
|
+
uploadType?: string;
|
|
166
|
+
}): Request<TaskList>;
|
|
167
|
+
/** Creates a new task list and adds it to the authenticated user's task lists. */
|
|
168
|
+
insert(request: {
|
|
169
|
+
/** V1 error format. */
|
|
170
|
+
"$.xgafv"?: string;
|
|
171
|
+
/** OAuth access token. */
|
|
172
|
+
access_token?: string;
|
|
173
|
+
/** Data format for response. */
|
|
174
|
+
alt?: string;
|
|
175
|
+
/** JSONP */
|
|
176
|
+
callback?: string;
|
|
177
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
178
|
+
fields?: string;
|
|
179
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
180
|
+
key?: string;
|
|
181
|
+
/** OAuth 2.0 token for the current user. */
|
|
182
|
+
oauth_token?: string;
|
|
183
|
+
/** Returns response with indentations and line breaks. */
|
|
184
|
+
prettyPrint?: boolean;
|
|
185
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
186
|
+
quotaUser?: string;
|
|
187
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
188
|
+
upload_protocol?: string;
|
|
189
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
190
|
+
uploadType?: string;
|
|
191
|
+
/** Request body */
|
|
192
|
+
resource: TaskList;
|
|
193
|
+
}): Request<TaskList>;
|
|
194
|
+
insert(request: {
|
|
195
|
+
/** V1 error format. */
|
|
196
|
+
"$.xgafv"?: string;
|
|
197
|
+
/** OAuth access token. */
|
|
198
|
+
access_token?: string;
|
|
199
|
+
/** Data format for response. */
|
|
200
|
+
alt?: string;
|
|
201
|
+
/** JSONP */
|
|
202
|
+
callback?: string;
|
|
203
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
204
|
+
fields?: string;
|
|
205
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
206
|
+
key?: string;
|
|
207
|
+
/** OAuth 2.0 token for the current user. */
|
|
208
|
+
oauth_token?: string;
|
|
209
|
+
/** Returns response with indentations and line breaks. */
|
|
210
|
+
prettyPrint?: boolean;
|
|
211
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
212
|
+
quotaUser?: string;
|
|
213
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
214
|
+
upload_protocol?: string;
|
|
215
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
216
|
+
uploadType?: string;
|
|
217
|
+
},
|
|
218
|
+
body: TaskList): Request<TaskList>;
|
|
219
|
+
/** Returns all the authenticated user's task lists. */
|
|
220
|
+
list(request?: {
|
|
221
|
+
/** V1 error format. */
|
|
222
|
+
"$.xgafv"?: string;
|
|
223
|
+
/** OAuth access token. */
|
|
224
|
+
access_token?: string;
|
|
225
|
+
/** Data format for response. */
|
|
226
|
+
alt?: string;
|
|
227
|
+
/** JSONP */
|
|
228
|
+
callback?: string;
|
|
229
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
230
|
+
fields?: string;
|
|
231
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
232
|
+
key?: string;
|
|
233
|
+
/** Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100). */
|
|
234
|
+
maxResults?: number;
|
|
235
|
+
/** OAuth 2.0 token for the current user. */
|
|
236
|
+
oauth_token?: string;
|
|
237
|
+
/** Token specifying the result page to return. Optional. */
|
|
238
|
+
pageToken?: string;
|
|
239
|
+
/** Returns response with indentations and line breaks. */
|
|
240
|
+
prettyPrint?: boolean;
|
|
241
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
242
|
+
quotaUser?: string;
|
|
243
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
244
|
+
upload_protocol?: string;
|
|
245
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
246
|
+
uploadType?: string;
|
|
247
|
+
}): Request<TaskLists>;
|
|
248
|
+
/** Updates the authenticated user's specified task list. This method supports patch semantics. */
|
|
249
|
+
patch(request: {
|
|
250
|
+
/** V1 error format. */
|
|
251
|
+
"$.xgafv"?: string;
|
|
252
|
+
/** OAuth access token. */
|
|
253
|
+
access_token?: string;
|
|
254
|
+
/** Data format for response. */
|
|
255
|
+
alt?: string;
|
|
256
|
+
/** JSONP */
|
|
257
|
+
callback?: string;
|
|
258
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
259
|
+
fields?: string;
|
|
260
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
261
|
+
key?: string;
|
|
262
|
+
/** OAuth 2.0 token for the current user. */
|
|
263
|
+
oauth_token?: string;
|
|
264
|
+
/** Returns response with indentations and line breaks. */
|
|
265
|
+
prettyPrint?: boolean;
|
|
266
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
267
|
+
quotaUser?: string;
|
|
268
|
+
/** Task list identifier. */
|
|
269
|
+
tasklist: string;
|
|
270
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
271
|
+
upload_protocol?: string;
|
|
272
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
273
|
+
uploadType?: string;
|
|
274
|
+
/** Request body */
|
|
275
|
+
resource: TaskList;
|
|
276
|
+
}): Request<TaskList>;
|
|
277
|
+
patch(request: {
|
|
278
|
+
/** V1 error format. */
|
|
279
|
+
"$.xgafv"?: string;
|
|
280
|
+
/** OAuth access token. */
|
|
281
|
+
access_token?: string;
|
|
282
|
+
/** Data format for response. */
|
|
283
|
+
alt?: string;
|
|
284
|
+
/** JSONP */
|
|
285
|
+
callback?: string;
|
|
286
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
287
|
+
fields?: string;
|
|
288
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
289
|
+
key?: string;
|
|
290
|
+
/** OAuth 2.0 token for the current user. */
|
|
291
|
+
oauth_token?: string;
|
|
292
|
+
/** Returns response with indentations and line breaks. */
|
|
293
|
+
prettyPrint?: boolean;
|
|
294
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
295
|
+
quotaUser?: string;
|
|
296
|
+
/** Task list identifier. */
|
|
297
|
+
tasklist: string;
|
|
298
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
299
|
+
upload_protocol?: string;
|
|
300
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
301
|
+
uploadType?: string;
|
|
302
|
+
},
|
|
303
|
+
body: TaskList): Request<TaskList>;
|
|
304
|
+
/** Updates the authenticated user's specified task list. */
|
|
305
|
+
update(request: {
|
|
306
|
+
/** V1 error format. */
|
|
307
|
+
"$.xgafv"?: string;
|
|
308
|
+
/** OAuth access token. */
|
|
309
|
+
access_token?: string;
|
|
310
|
+
/** Data format for response. */
|
|
311
|
+
alt?: string;
|
|
312
|
+
/** JSONP */
|
|
313
|
+
callback?: string;
|
|
314
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
315
|
+
fields?: string;
|
|
316
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
317
|
+
key?: string;
|
|
318
|
+
/** OAuth 2.0 token for the current user. */
|
|
319
|
+
oauth_token?: string;
|
|
320
|
+
/** Returns response with indentations and line breaks. */
|
|
321
|
+
prettyPrint?: boolean;
|
|
322
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
323
|
+
quotaUser?: string;
|
|
324
|
+
/** Task list identifier. */
|
|
325
|
+
tasklist: string;
|
|
326
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
327
|
+
upload_protocol?: string;
|
|
328
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
329
|
+
uploadType?: string;
|
|
330
|
+
/** Request body */
|
|
331
|
+
resource: TaskList;
|
|
332
|
+
}): Request<TaskList>;
|
|
333
|
+
update(request: {
|
|
334
|
+
/** V1 error format. */
|
|
335
|
+
"$.xgafv"?: string;
|
|
336
|
+
/** OAuth access token. */
|
|
337
|
+
access_token?: string;
|
|
338
|
+
/** Data format for response. */
|
|
339
|
+
alt?: string;
|
|
340
|
+
/** JSONP */
|
|
341
|
+
callback?: string;
|
|
342
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
343
|
+
fields?: string;
|
|
344
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
345
|
+
key?: string;
|
|
346
|
+
/** OAuth 2.0 token for the current user. */
|
|
347
|
+
oauth_token?: string;
|
|
348
|
+
/** Returns response with indentations and line breaks. */
|
|
349
|
+
prettyPrint?: boolean;
|
|
350
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
351
|
+
quotaUser?: string;
|
|
352
|
+
/** Task list identifier. */
|
|
353
|
+
tasklist: string;
|
|
354
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
355
|
+
upload_protocol?: string;
|
|
356
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
357
|
+
uploadType?: string;
|
|
358
|
+
},
|
|
359
|
+
body: TaskList): Request<TaskList>;
|
|
360
|
+
}
|
|
361
|
+
interface TasksResource {
|
|
362
|
+
/**
|
|
363
|
+
* Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task
|
|
364
|
+
* list.
|
|
365
|
+
*/
|
|
366
|
+
clear(request?: {
|
|
367
|
+
/** V1 error format. */
|
|
368
|
+
"$.xgafv"?: string;
|
|
369
|
+
/** OAuth access token. */
|
|
370
|
+
access_token?: string;
|
|
371
|
+
/** Data format for response. */
|
|
372
|
+
alt?: string;
|
|
373
|
+
/** JSONP */
|
|
374
|
+
callback?: string;
|
|
375
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
376
|
+
fields?: string;
|
|
377
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
378
|
+
key?: string;
|
|
379
|
+
/** OAuth 2.0 token for the current user. */
|
|
380
|
+
oauth_token?: string;
|
|
381
|
+
/** Returns response with indentations and line breaks. */
|
|
382
|
+
prettyPrint?: boolean;
|
|
383
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
384
|
+
quotaUser?: string;
|
|
385
|
+
/** Task list identifier. */
|
|
386
|
+
tasklist: string;
|
|
387
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
388
|
+
upload_protocol?: string;
|
|
389
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
390
|
+
uploadType?: string;
|
|
391
|
+
}): Request<void>;
|
|
392
|
+
/** Deletes the specified task from the task list. */
|
|
393
|
+
delete(request?: {
|
|
394
|
+
/** V1 error format. */
|
|
395
|
+
"$.xgafv"?: string;
|
|
396
|
+
/** OAuth access token. */
|
|
397
|
+
access_token?: string;
|
|
398
|
+
/** Data format for response. */
|
|
399
|
+
alt?: string;
|
|
400
|
+
/** JSONP */
|
|
401
|
+
callback?: string;
|
|
402
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
403
|
+
fields?: string;
|
|
404
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
405
|
+
key?: string;
|
|
406
|
+
/** OAuth 2.0 token for the current user. */
|
|
407
|
+
oauth_token?: string;
|
|
408
|
+
/** Returns response with indentations and line breaks. */
|
|
409
|
+
prettyPrint?: boolean;
|
|
410
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
411
|
+
quotaUser?: string;
|
|
412
|
+
/** Task identifier. */
|
|
413
|
+
task: string;
|
|
414
|
+
/** Task list identifier. */
|
|
415
|
+
tasklist: string;
|
|
416
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
417
|
+
upload_protocol?: string;
|
|
418
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
419
|
+
uploadType?: string;
|
|
420
|
+
}): Request<void>;
|
|
421
|
+
/** Returns the specified task. */
|
|
422
|
+
get(request?: {
|
|
423
|
+
/** V1 error format. */
|
|
424
|
+
"$.xgafv"?: string;
|
|
425
|
+
/** OAuth access token. */
|
|
426
|
+
access_token?: string;
|
|
427
|
+
/** Data format for response. */
|
|
428
|
+
alt?: string;
|
|
429
|
+
/** JSONP */
|
|
430
|
+
callback?: string;
|
|
431
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
432
|
+
fields?: string;
|
|
433
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
434
|
+
key?: string;
|
|
435
|
+
/** OAuth 2.0 token for the current user. */
|
|
436
|
+
oauth_token?: string;
|
|
437
|
+
/** Returns response with indentations and line breaks. */
|
|
438
|
+
prettyPrint?: boolean;
|
|
439
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
440
|
+
quotaUser?: string;
|
|
441
|
+
/** Task identifier. */
|
|
442
|
+
task: string;
|
|
443
|
+
/** Task list identifier. */
|
|
444
|
+
tasklist: string;
|
|
445
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
446
|
+
upload_protocol?: string;
|
|
447
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
448
|
+
uploadType?: string;
|
|
449
|
+
}): Request<Task>;
|
|
450
|
+
/** Creates a new task on the specified task list. */
|
|
451
|
+
insert(request: {
|
|
452
|
+
/** V1 error format. */
|
|
453
|
+
"$.xgafv"?: string;
|
|
454
|
+
/** OAuth access token. */
|
|
455
|
+
access_token?: string;
|
|
456
|
+
/** Data format for response. */
|
|
457
|
+
alt?: string;
|
|
458
|
+
/** JSONP */
|
|
459
|
+
callback?: string;
|
|
460
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
461
|
+
fields?: string;
|
|
462
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
463
|
+
key?: string;
|
|
464
|
+
/** OAuth 2.0 token for the current user. */
|
|
465
|
+
oauth_token?: string;
|
|
466
|
+
/** Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional. */
|
|
467
|
+
parent?: string;
|
|
468
|
+
/** Returns response with indentations and line breaks. */
|
|
469
|
+
prettyPrint?: boolean;
|
|
470
|
+
/** Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional. */
|
|
471
|
+
previous?: string;
|
|
472
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
473
|
+
quotaUser?: string;
|
|
474
|
+
/** Task list identifier. */
|
|
475
|
+
tasklist: string;
|
|
476
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
477
|
+
upload_protocol?: string;
|
|
478
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
479
|
+
uploadType?: string;
|
|
480
|
+
/** Request body */
|
|
481
|
+
resource: Task;
|
|
482
|
+
}): Request<Task>;
|
|
483
|
+
insert(request: {
|
|
484
|
+
/** V1 error format. */
|
|
485
|
+
"$.xgafv"?: string;
|
|
486
|
+
/** OAuth access token. */
|
|
487
|
+
access_token?: string;
|
|
488
|
+
/** Data format for response. */
|
|
489
|
+
alt?: string;
|
|
490
|
+
/** JSONP */
|
|
491
|
+
callback?: string;
|
|
492
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
493
|
+
fields?: string;
|
|
494
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
495
|
+
key?: string;
|
|
496
|
+
/** OAuth 2.0 token for the current user. */
|
|
497
|
+
oauth_token?: string;
|
|
498
|
+
/** Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional. */
|
|
499
|
+
parent?: string;
|
|
500
|
+
/** Returns response with indentations and line breaks. */
|
|
501
|
+
prettyPrint?: boolean;
|
|
502
|
+
/** Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional. */
|
|
503
|
+
previous?: string;
|
|
504
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
505
|
+
quotaUser?: string;
|
|
506
|
+
/** Task list identifier. */
|
|
507
|
+
tasklist: string;
|
|
508
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
509
|
+
upload_protocol?: string;
|
|
510
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
511
|
+
uploadType?: string;
|
|
512
|
+
},
|
|
513
|
+
body: Task): Request<Task>;
|
|
514
|
+
/** Returns all tasks in the specified task list. */
|
|
515
|
+
list(request?: {
|
|
516
|
+
/** V1 error format. */
|
|
517
|
+
"$.xgafv"?: string;
|
|
518
|
+
/** OAuth access token. */
|
|
519
|
+
access_token?: string;
|
|
520
|
+
/** Data format for response. */
|
|
521
|
+
alt?: string;
|
|
522
|
+
/** JSONP */
|
|
523
|
+
callback?: string;
|
|
524
|
+
/** Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. */
|
|
525
|
+
completedMax?: string;
|
|
526
|
+
/** Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. */
|
|
527
|
+
completedMin?: string;
|
|
528
|
+
/** Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. */
|
|
529
|
+
dueMax?: string;
|
|
530
|
+
/** Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. */
|
|
531
|
+
dueMin?: string;
|
|
532
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
533
|
+
fields?: string;
|
|
534
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
535
|
+
key?: string;
|
|
536
|
+
/** Maximum number of task lists returned on one page. Optional. The default is 20 (max allowed: 100). */
|
|
537
|
+
maxResults?: number;
|
|
538
|
+
/** OAuth 2.0 token for the current user. */
|
|
539
|
+
oauth_token?: string;
|
|
540
|
+
/** Token specifying the result page to return. Optional. */
|
|
541
|
+
pageToken?: string;
|
|
542
|
+
/** Returns response with indentations and line breaks. */
|
|
543
|
+
prettyPrint?: boolean;
|
|
544
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
545
|
+
quotaUser?: string;
|
|
546
|
+
/**
|
|
547
|
+
* Flag indicating whether completed tasks are returned in the result. Optional. The default is True. Note that showHidden must also be True to show tasks completed in first party
|
|
548
|
+
* clients, such as the web UI and Google's mobile apps.
|
|
549
|
+
*/
|
|
550
|
+
showCompleted?: boolean;
|
|
551
|
+
/** Flag indicating whether deleted tasks are returned in the result. Optional. The default is False. */
|
|
552
|
+
showDeleted?: boolean;
|
|
553
|
+
/** Flag indicating whether hidden tasks are returned in the result. Optional. The default is False. */
|
|
554
|
+
showHidden?: boolean;
|
|
555
|
+
/** Task list identifier. */
|
|
556
|
+
tasklist: string;
|
|
557
|
+
/** Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time. */
|
|
558
|
+
updatedMin?: string;
|
|
559
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
560
|
+
upload_protocol?: string;
|
|
561
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
562
|
+
uploadType?: string;
|
|
563
|
+
}): Request<Tasks>;
|
|
564
|
+
/**
|
|
565
|
+
* Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its
|
|
566
|
+
* sibling tasks.
|
|
567
|
+
*/
|
|
568
|
+
move(request?: {
|
|
569
|
+
/** V1 error format. */
|
|
570
|
+
"$.xgafv"?: string;
|
|
571
|
+
/** OAuth access token. */
|
|
572
|
+
access_token?: string;
|
|
573
|
+
/** Data format for response. */
|
|
574
|
+
alt?: string;
|
|
575
|
+
/** JSONP */
|
|
576
|
+
callback?: string;
|
|
577
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
578
|
+
fields?: string;
|
|
579
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
580
|
+
key?: string;
|
|
581
|
+
/** OAuth 2.0 token for the current user. */
|
|
582
|
+
oauth_token?: string;
|
|
583
|
+
/** New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional. */
|
|
584
|
+
parent?: string;
|
|
585
|
+
/** Returns response with indentations and line breaks. */
|
|
586
|
+
prettyPrint?: boolean;
|
|
587
|
+
/** New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional. */
|
|
588
|
+
previous?: string;
|
|
589
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
590
|
+
quotaUser?: string;
|
|
591
|
+
/** Task identifier. */
|
|
592
|
+
task: string;
|
|
593
|
+
/** Task list identifier. */
|
|
594
|
+
tasklist: string;
|
|
595
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
596
|
+
upload_protocol?: string;
|
|
597
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
598
|
+
uploadType?: string;
|
|
599
|
+
}): Request<Task>;
|
|
600
|
+
/** Updates the specified task. This method supports patch semantics. */
|
|
601
|
+
patch(request: {
|
|
602
|
+
/** V1 error format. */
|
|
603
|
+
"$.xgafv"?: string;
|
|
604
|
+
/** OAuth access token. */
|
|
605
|
+
access_token?: string;
|
|
606
|
+
/** Data format for response. */
|
|
607
|
+
alt?: string;
|
|
608
|
+
/** JSONP */
|
|
609
|
+
callback?: string;
|
|
610
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
611
|
+
fields?: string;
|
|
612
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
613
|
+
key?: string;
|
|
614
|
+
/** OAuth 2.0 token for the current user. */
|
|
615
|
+
oauth_token?: string;
|
|
616
|
+
/** Returns response with indentations and line breaks. */
|
|
617
|
+
prettyPrint?: boolean;
|
|
618
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
619
|
+
quotaUser?: string;
|
|
620
|
+
/** Task identifier. */
|
|
621
|
+
task: string;
|
|
622
|
+
/** Task list identifier. */
|
|
623
|
+
tasklist: string;
|
|
624
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
625
|
+
upload_protocol?: string;
|
|
626
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
627
|
+
uploadType?: string;
|
|
628
|
+
/** Request body */
|
|
629
|
+
resource: Task;
|
|
630
|
+
}): Request<Task>;
|
|
631
|
+
patch(request: {
|
|
632
|
+
/** V1 error format. */
|
|
633
|
+
"$.xgafv"?: string;
|
|
634
|
+
/** OAuth access token. */
|
|
635
|
+
access_token?: string;
|
|
636
|
+
/** Data format for response. */
|
|
637
|
+
alt?: string;
|
|
638
|
+
/** JSONP */
|
|
639
|
+
callback?: string;
|
|
640
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
641
|
+
fields?: string;
|
|
642
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
643
|
+
key?: string;
|
|
644
|
+
/** OAuth 2.0 token for the current user. */
|
|
645
|
+
oauth_token?: string;
|
|
646
|
+
/** Returns response with indentations and line breaks. */
|
|
647
|
+
prettyPrint?: boolean;
|
|
648
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
649
|
+
quotaUser?: string;
|
|
650
|
+
/** Task identifier. */
|
|
651
|
+
task: string;
|
|
652
|
+
/** Task list identifier. */
|
|
653
|
+
tasklist: string;
|
|
654
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
655
|
+
upload_protocol?: string;
|
|
656
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
657
|
+
uploadType?: string;
|
|
658
|
+
},
|
|
659
|
+
body: Task): Request<Task>;
|
|
660
|
+
/** Updates the specified task. */
|
|
661
|
+
update(request: {
|
|
662
|
+
/** V1 error format. */
|
|
663
|
+
"$.xgafv"?: string;
|
|
664
|
+
/** OAuth access token. */
|
|
665
|
+
access_token?: string;
|
|
666
|
+
/** Data format for response. */
|
|
667
|
+
alt?: string;
|
|
668
|
+
/** JSONP */
|
|
669
|
+
callback?: string;
|
|
670
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
671
|
+
fields?: string;
|
|
672
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
673
|
+
key?: string;
|
|
674
|
+
/** OAuth 2.0 token for the current user. */
|
|
675
|
+
oauth_token?: string;
|
|
676
|
+
/** Returns response with indentations and line breaks. */
|
|
677
|
+
prettyPrint?: boolean;
|
|
678
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
679
|
+
quotaUser?: string;
|
|
680
|
+
/** Task identifier. */
|
|
681
|
+
task: string;
|
|
682
|
+
/** Task list identifier. */
|
|
683
|
+
tasklist: string;
|
|
684
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
685
|
+
upload_protocol?: string;
|
|
686
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
687
|
+
uploadType?: string;
|
|
688
|
+
/** Request body */
|
|
689
|
+
resource: Task;
|
|
690
|
+
}): Request<Task>;
|
|
691
|
+
update(request: {
|
|
692
|
+
/** V1 error format. */
|
|
693
|
+
"$.xgafv"?: string;
|
|
694
|
+
/** OAuth access token. */
|
|
695
|
+
access_token?: string;
|
|
696
|
+
/** Data format for response. */
|
|
697
|
+
alt?: string;
|
|
698
|
+
/** JSONP */
|
|
699
|
+
callback?: string;
|
|
700
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
701
|
+
fields?: string;
|
|
702
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
703
|
+
key?: string;
|
|
704
|
+
/** OAuth 2.0 token for the current user. */
|
|
705
|
+
oauth_token?: string;
|
|
706
|
+
/** Returns response with indentations and line breaks. */
|
|
707
|
+
prettyPrint?: boolean;
|
|
708
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
709
|
+
quotaUser?: string;
|
|
710
|
+
/** Task identifier. */
|
|
711
|
+
task: string;
|
|
712
|
+
/** Task list identifier. */
|
|
713
|
+
tasklist: string;
|
|
714
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
715
|
+
upload_protocol?: string;
|
|
716
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
717
|
+
uploadType?: string;
|
|
718
|
+
},
|
|
719
|
+
body: Task): Request<Task>;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
const tasklists: TasklistsResource;
|
|
723
|
+
|
|
724
|
+
const tasks: TasksResource;
|
|
725
|
+
}
|
|
726
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.tasks-v1",
|
|
3
|
+
"version": "0.0.20220808",
|
|
4
|
+
"description": "TypeScript typings for Tasks API v1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# TypeScript typings for Tasks API v1
|
|
2
|
+
|
|
3
|
+
The Google Tasks API lets you manage your tasks and task lists.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/tasks/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Tasks API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.tasks-v1 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://tasks.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.tasks
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('tasks', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.tasks
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// Create, edit, organize, and delete all your tasks
|
|
49
|
+
'https://www.googleapis.com/auth/tasks',
|
|
50
|
+
|
|
51
|
+
// View your tasks
|
|
52
|
+
'https://www.googleapis.com/auth/tasks.readonly',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
55
|
+
// ...
|
|
56
|
+
|
|
57
|
+
gapi.auth.authorize(
|
|
58
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
59
|
+
authResult => {
|
|
60
|
+
if (authResult && !authResult.error) {
|
|
61
|
+
/* handle successful authorization */
|
|
62
|
+
} else {
|
|
63
|
+
/* handle authorization error */
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
After that you can use Tasks API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
Deletes the authenticated user's specified task list.
|
|
74
|
+
*/
|
|
75
|
+
await gapi.client.tasks.tasklists.delete({ tasklist: "tasklist", });
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
Returns the authenticated user's specified task list.
|
|
79
|
+
*/
|
|
80
|
+
await gapi.client.tasks.tasklists.get({ tasklist: "tasklist", });
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
Creates a new task list and adds it to the authenticated user's task lists.
|
|
84
|
+
*/
|
|
85
|
+
await gapi.client.tasks.tasklists.insert({ });
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
Returns all the authenticated user's task lists.
|
|
89
|
+
*/
|
|
90
|
+
await gapi.client.tasks.tasklists.list({ });
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
Updates the authenticated user's specified task list. This method supports patch semantics.
|
|
94
|
+
*/
|
|
95
|
+
await gapi.client.tasks.tasklists.patch({ tasklist: "tasklist", });
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
Updates the authenticated user's specified task list.
|
|
99
|
+
*/
|
|
100
|
+
await gapi.client.tasks.tasklists.update({ tasklist: "tasklist", });
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list.
|
|
104
|
+
*/
|
|
105
|
+
await gapi.client.tasks.tasks.clear({ tasklist: "tasklist", });
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
Deletes the specified task from the task list.
|
|
109
|
+
*/
|
|
110
|
+
await gapi.client.tasks.tasks.delete({ task: "task", tasklist: "tasklist", });
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
Returns the specified task.
|
|
114
|
+
*/
|
|
115
|
+
await gapi.client.tasks.tasks.get({ task: "task", tasklist: "tasklist", });
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
Creates a new task on the specified task list.
|
|
119
|
+
*/
|
|
120
|
+
await gapi.client.tasks.tasks.insert({ tasklist: "tasklist", });
|
|
121
|
+
|
|
122
|
+
/*
|
|
123
|
+
Returns all tasks in the specified task list.
|
|
124
|
+
*/
|
|
125
|
+
await gapi.client.tasks.tasks.list({ tasklist: "tasklist", });
|
|
126
|
+
|
|
127
|
+
/*
|
|
128
|
+
Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling tasks.
|
|
129
|
+
*/
|
|
130
|
+
await gapi.client.tasks.tasks.move({ task: "task", tasklist: "tasklist", });
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
Updates the specified task. This method supports patch semantics.
|
|
134
|
+
*/
|
|
135
|
+
await gapi.client.tasks.tasks.patch({ task: "task", tasklist: "tasklist", });
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
Updates the specified task.
|
|
139
|
+
*/
|
|
140
|
+
await gapi.client.tasks.tasks.update({ task: "task", tasklist: "tasklist", });
|
|
141
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.tasks-v1 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220808
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://tasks.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.tasks */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** Create, edit, organize, and delete all your tasks */
|
|
19
|
+
'https://www.googleapis.com/auth/tasks',
|
|
20
|
+
/** View your tasks */
|
|
21
|
+
'https://www.googleapis.com/auth/tasks.readonly',
|
|
22
|
+
];
|
|
23
|
+
const immediate = false;
|
|
24
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
25
|
+
if (authResult && !authResult.error) {
|
|
26
|
+
/** handle successful authorization */
|
|
27
|
+
run();
|
|
28
|
+
} else {
|
|
29
|
+
/** handle authorization error */
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
async function run() {
|
|
34
|
+
/** Deletes the authenticated user's specified task list. */
|
|
35
|
+
await gapi.client.tasks.tasklists.delete({
|
|
36
|
+
tasklist: "Test string",
|
|
37
|
+
});
|
|
38
|
+
/** Returns the authenticated user's specified task list. */
|
|
39
|
+
await gapi.client.tasks.tasklists.get({
|
|
40
|
+
tasklist: "Test string",
|
|
41
|
+
});
|
|
42
|
+
/** Creates a new task list and adds it to the authenticated user's task lists. */
|
|
43
|
+
await gapi.client.tasks.tasklists.insert({
|
|
44
|
+
}, {
|
|
45
|
+
etag: "Test string",
|
|
46
|
+
id: "Test string",
|
|
47
|
+
kind: "Test string",
|
|
48
|
+
selfLink: "Test string",
|
|
49
|
+
title: "Test string",
|
|
50
|
+
updated: "Test string",
|
|
51
|
+
});
|
|
52
|
+
/** Returns all the authenticated user's task lists. */
|
|
53
|
+
await gapi.client.tasks.tasklists.list({
|
|
54
|
+
maxResults: 42,
|
|
55
|
+
pageToken: "Test string",
|
|
56
|
+
});
|
|
57
|
+
/** Updates the authenticated user's specified task list. This method supports patch semantics. */
|
|
58
|
+
await gapi.client.tasks.tasklists.patch({
|
|
59
|
+
tasklist: "Test string",
|
|
60
|
+
}, {
|
|
61
|
+
etag: "Test string",
|
|
62
|
+
id: "Test string",
|
|
63
|
+
kind: "Test string",
|
|
64
|
+
selfLink: "Test string",
|
|
65
|
+
title: "Test string",
|
|
66
|
+
updated: "Test string",
|
|
67
|
+
});
|
|
68
|
+
/** Updates the authenticated user's specified task list. */
|
|
69
|
+
await gapi.client.tasks.tasklists.update({
|
|
70
|
+
tasklist: "Test string",
|
|
71
|
+
}, {
|
|
72
|
+
etag: "Test string",
|
|
73
|
+
id: "Test string",
|
|
74
|
+
kind: "Test string",
|
|
75
|
+
selfLink: "Test string",
|
|
76
|
+
title: "Test string",
|
|
77
|
+
updated: "Test string",
|
|
78
|
+
});
|
|
79
|
+
/** Clears all completed tasks from the specified task list. The affected tasks will be marked as 'hidden' and no longer be returned by default when retrieving all tasks for a task list. */
|
|
80
|
+
await gapi.client.tasks.tasks.clear({
|
|
81
|
+
tasklist: "Test string",
|
|
82
|
+
});
|
|
83
|
+
/** Deletes the specified task from the task list. */
|
|
84
|
+
await gapi.client.tasks.tasks.delete({
|
|
85
|
+
task: "Test string",
|
|
86
|
+
tasklist: "Test string",
|
|
87
|
+
});
|
|
88
|
+
/** Returns the specified task. */
|
|
89
|
+
await gapi.client.tasks.tasks.get({
|
|
90
|
+
task: "Test string",
|
|
91
|
+
tasklist: "Test string",
|
|
92
|
+
});
|
|
93
|
+
/** Creates a new task on the specified task list. */
|
|
94
|
+
await gapi.client.tasks.tasks.insert({
|
|
95
|
+
parent: "Test string",
|
|
96
|
+
previous: "Test string",
|
|
97
|
+
tasklist: "Test string",
|
|
98
|
+
}, {
|
|
99
|
+
completed: "Test string",
|
|
100
|
+
deleted: true,
|
|
101
|
+
due: "Test string",
|
|
102
|
+
etag: "Test string",
|
|
103
|
+
hidden: true,
|
|
104
|
+
id: "Test string",
|
|
105
|
+
kind: "Test string",
|
|
106
|
+
links: [
|
|
107
|
+
{
|
|
108
|
+
description: "Test string",
|
|
109
|
+
link: "Test string",
|
|
110
|
+
type: "Test string",
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
notes: "Test string",
|
|
114
|
+
parent: "Test string",
|
|
115
|
+
position: "Test string",
|
|
116
|
+
selfLink: "Test string",
|
|
117
|
+
status: "Test string",
|
|
118
|
+
title: "Test string",
|
|
119
|
+
updated: "Test string",
|
|
120
|
+
});
|
|
121
|
+
/** Returns all tasks in the specified task list. */
|
|
122
|
+
await gapi.client.tasks.tasks.list({
|
|
123
|
+
completedMax: "Test string",
|
|
124
|
+
completedMin: "Test string",
|
|
125
|
+
dueMax: "Test string",
|
|
126
|
+
dueMin: "Test string",
|
|
127
|
+
maxResults: 42,
|
|
128
|
+
pageToken: "Test string",
|
|
129
|
+
showCompleted: true,
|
|
130
|
+
showDeleted: true,
|
|
131
|
+
showHidden: true,
|
|
132
|
+
tasklist: "Test string",
|
|
133
|
+
updatedMin: "Test string",
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Moves the specified task to another position in the task list. This can include putting it as a child task under a new parent and/or move it to a different position among its sibling
|
|
137
|
+
* tasks.
|
|
138
|
+
*/
|
|
139
|
+
await gapi.client.tasks.tasks.move({
|
|
140
|
+
parent: "Test string",
|
|
141
|
+
previous: "Test string",
|
|
142
|
+
task: "Test string",
|
|
143
|
+
tasklist: "Test string",
|
|
144
|
+
});
|
|
145
|
+
/** Updates the specified task. This method supports patch semantics. */
|
|
146
|
+
await gapi.client.tasks.tasks.patch({
|
|
147
|
+
task: "Test string",
|
|
148
|
+
tasklist: "Test string",
|
|
149
|
+
}, {
|
|
150
|
+
completed: "Test string",
|
|
151
|
+
deleted: true,
|
|
152
|
+
due: "Test string",
|
|
153
|
+
etag: "Test string",
|
|
154
|
+
hidden: true,
|
|
155
|
+
id: "Test string",
|
|
156
|
+
kind: "Test string",
|
|
157
|
+
links: [
|
|
158
|
+
{
|
|
159
|
+
description: "Test string",
|
|
160
|
+
link: "Test string",
|
|
161
|
+
type: "Test string",
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
notes: "Test string",
|
|
165
|
+
parent: "Test string",
|
|
166
|
+
position: "Test string",
|
|
167
|
+
selfLink: "Test string",
|
|
168
|
+
status: "Test string",
|
|
169
|
+
title: "Test string",
|
|
170
|
+
updated: "Test string",
|
|
171
|
+
});
|
|
172
|
+
/** Updates the specified task. */
|
|
173
|
+
await gapi.client.tasks.tasks.update({
|
|
174
|
+
task: "Test string",
|
|
175
|
+
tasklist: "Test string",
|
|
176
|
+
}, {
|
|
177
|
+
completed: "Test string",
|
|
178
|
+
deleted: true,
|
|
179
|
+
due: "Test string",
|
|
180
|
+
etag: "Test string",
|
|
181
|
+
hidden: true,
|
|
182
|
+
id: "Test string",
|
|
183
|
+
kind: "Test string",
|
|
184
|
+
links: [
|
|
185
|
+
{
|
|
186
|
+
description: "Test string",
|
|
187
|
+
link: "Test string",
|
|
188
|
+
type: "Test string",
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
notes: "Test string",
|
|
192
|
+
parent: "Test string",
|
|
193
|
+
position: "Test string",
|
|
194
|
+
selfLink: "Test string",
|
|
195
|
+
status: "Test string",
|
|
196
|
+
title: "Test string",
|
|
197
|
+
updated: "Test string",
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": ["es6", "dom"],
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"baseUrl": "../",
|
|
9
|
+
"typeRoots": [
|
|
10
|
+
"../"
|
|
11
|
+
],
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"strictFunctionTypes": true
|
|
16
|
+
},
|
|
17
|
+
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
+
}
|