0.0.20240504 • Published 3 days ago

@maxim_mazurok/gapi.client.tasks-v1 v0.0.20240504

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

TypeScript typings for Google Tasks API v1

The Google Tasks API lets you manage your tasks and task lists. For detailed description please check documentation.

Installing

Install typings for Google Tasks API:

npm install @types/gapi.client.tasks-v1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load(
  'https://tasks.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.tasks
  }
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('tasks', 'v1', () => {
  // now we can use:
  // gapi.client.tasks
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [
    // Create, edit, organize, and delete all your tasks
    'https://www.googleapis.com/auth/tasks',

    // View your tasks
    'https://www.googleapis.com/auth/tasks.readonly',
  ],
  immediate = true;
// ...

gapi.auth.authorize(
  {client_id: client_id, scope: scope, immediate: immediate},
  authResult => {
    if (authResult && !authResult.error) {
      /* handle successful authorization */
    } else {
      /* handle authorization error */
    }
  }
);

After that you can use Google Tasks API resources:

/*
Deletes the authenticated user's specified task list.
*/
await gapi.client.tasks.tasklists.delete({tasklist: 'tasklist'});

/*
Returns the authenticated user's specified task list.
*/
await gapi.client.tasks.tasklists.get({tasklist: 'tasklist'});

/*
Creates a new task list and adds it to the authenticated user's task lists. A user can have up to 2000 lists at a time.
*/
await gapi.client.tasks.tasklists.insert({});

/*
Returns all the authenticated user's task lists. A user can have up to 2000 lists at a time.
*/
await gapi.client.tasks.tasklists.list({});

/*
Updates the authenticated user's specified task list. This method supports patch semantics.
*/
await gapi.client.tasks.tasklists.patch({tasklist: 'tasklist'});

/*
Updates the authenticated user's specified task list.
*/
await gapi.client.tasks.tasklists.update({tasklist: 'tasklist'});

/*
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.
*/
await gapi.client.tasks.tasks.clear({tasklist: 'tasklist'});

/*
Deletes the specified task from the task list.
*/
await gapi.client.tasks.tasks.delete({task: 'task', tasklist: 'tasklist'});

/*
Returns the specified task.
*/
await gapi.client.tasks.tasks.get({task: 'task', tasklist: 'tasklist'});

/*
Creates a new task on the specified task list. A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time.
*/
await gapi.client.tasks.tasks.insert({tasklist: 'tasklist'});

/*
Returns all tasks in the specified task list. A user can have up to 20,000 non-hidden tasks per list and up to 100,000 tasks in total at a time.
*/
await gapi.client.tasks.tasks.list({tasklist: 'tasklist'});

/*
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. A user can have up to 2,000 subtasks per task.
*/
await gapi.client.tasks.tasks.move({task: 'task', tasklist: 'tasklist'});

/*
Updates the specified task. This method supports patch semantics.
*/
await gapi.client.tasks.tasks.patch({task: 'task', tasklist: 'tasklist'});

/*
Updates the specified task.
*/
await gapi.client.tasks.tasks.update({task: 'task', tasklist: 'tasklist'});
0.0.20240504

3 days ago

0.0.20240430

8 days ago

0.0.20240428

10 days ago

0.0.20240423

15 days ago

0.0.20240421

17 days ago

0.0.20240416

22 days ago

0.0.20240414

24 days ago

0.0.20240409

29 days ago

0.0.20240407

1 month ago

0.0.20240331

1 month ago

0.0.20240402

1 month ago

0.0.20240326

1 month ago

0.0.20240324

2 months ago

0.0.20240319

2 months ago

0.0.20240317

2 months ago

0.0.20240310

2 months ago

0.0.20240312

2 months ago

0.0.20240305

2 months ago

0.0.20240303

2 months ago

0.0.20240227

2 months ago

0.0.20240225

2 months ago

0.0.20240220

3 months ago

0.0.20240218

3 months ago

0.0.20240211

3 months ago

0.0.20240206

3 months ago

0.0.20240204

3 months ago

0.0.20240130

3 months ago

0.0.20240128

3 months ago

0.0.20240123

4 months ago

0.0.20240121

4 months ago

0.0.20240116

4 months ago

0.0.20240113

4 months ago

0.0.20240109

4 months ago

0.0.20240107

4 months ago

0.0.20240102

4 months ago

0.0.20231218

5 months ago

0.0.20231217

5 months ago

0.0.20231212

5 months ago

0.0.20231210

5 months ago

0.0.20231205

5 months ago

0.0.20231203

5 months ago

0.0.20231105

6 months ago

0.0.20231107

6 months ago

0.0.20230815

9 months ago

0.0.20230812

9 months ago

0.0.20231112

6 months ago

0.0.20231114

6 months ago

0.0.20230808

9 months ago

0.0.20230926

8 months ago

0.0.20230806

9 months ago

0.0.20230801

9 months ago

0.0.20230923

8 months ago

0.0.20230718

10 months ago

0.0.20231128

5 months ago

0.0.20230711

10 months ago

0.0.20231008

7 months ago

0.0.20230716

10 months ago

0.0.20231015

7 months ago

0.0.20230829

8 months ago

0.0.20230708

10 months ago

0.0.20230827

9 months ago

0.0.20230822

9 months ago

0.0.20230701

10 months ago

0.0.20231119

6 months ago

0.0.20230820

9 months ago

0.0.20230704

10 months ago

0.0.20231001

7 months ago

0.0.20231121

6 months ago

0.0.20231003

7 months ago

0.0.20231029

6 months ago

0.0.20231031

6 months ago

0.0.20230729

9 months ago

0.0.20231017

7 months ago

0.0.20230721

10 months ago

0.0.20230725

10 months ago

0.0.20231021

7 months ago

0.0.20231024

7 months ago

0.0.20230917

8 months ago

0.0.20230910

8 months ago

0.0.20230912

8 months ago

0.0.20230905

8 months ago

0.0.20230903

8 months ago

0.0.20230627

11 months ago

0.0.20230625

11 months ago

0.0.20230618

11 months ago

0.0.20230613

11 months ago

0.0.20230611

11 months ago

0.0.20230620

11 months ago

0.0.20230606

11 months ago

0.0.20230603

11 months ago

0.0.20230527

12 months ago

0.0.20230530

11 months ago

0.0.20230514

12 months ago

0.0.20230516

12 months ago

0.0.20230521

12 months ago

0.0.20230502

1 year ago

0.0.20230429

1 year ago

0.0.20230507

1 year ago

0.0.20230415

1 year ago

0.0.20230418

1 year ago

0.0.20230326

1 year ago

0.0.20230404

1 year ago

0.0.20230401

1 year ago

0.0.20230408

1 year ago

0.0.20230328

1 year ago

0.0.20230411

1 year ago

0.0.20230314

1 year ago

0.0.20230318

1 year ago

0.0.20230321

1 year ago

0.0.20230425

1 year ago

0.0.20230304

1 year ago

0.0.20230228

1 year ago

0.0.20230226

1 year ago

0.0.20230307

1 year ago

0.0.20230312

1 year ago

0.0.20230214

1 year ago

0.0.20230219

1 year ago

0.0.20230221

1 year ago

0.0.20230205

1 year ago

0.0.20230129

1 year ago

0.0.20230207

1 year ago

0.0.20230131

1 year ago

0.0.20230212

1 year ago

0.0.20230117

1 year ago

0.0.20230115

1 year ago

0.0.20221114

1 year ago

0.0.20221112

1 year ago

0.0.20221210

1 year ago

0.0.20230124

1 year ago

0.0.20230103

1 year ago

0.0.20221108

1 year ago

0.0.20230122

1 year ago

0.0.20221206

1 year ago

0.0.20221129

1 year ago

0.0.20221106

2 years ago

0.0.20230107

1 year ago

0.0.20221203

1 year ago

0.0.20221122

1 year ago

0.0.20221220

1 year ago

0.0.20221120

1 year ago

0.0.20230110

1 year ago

0.0.20221218

1 year ago

0.0.20221015

2 years ago

0.0.20221008

2 years ago

0.0.20221029

2 years ago

0.0.20221004

2 years ago

0.0.20221025

2 years ago

0.0.20221101

2 years ago

0.0.20221023

2 years ago

0.0.20221001

2 years ago

0.0.20220927

2 years ago

0.0.20221018

2 years ago

0.0.20220916

2 years ago

0.0.20220906

2 years ago

0.0.20220829

2 years ago

0.0.20220819

2 years ago

0.0.20220920

2 years ago

0.0.20220910

2 years ago

0.0.20220823

2 years ago

0.0.20220912

2 years ago

0.0.20220925

2 years ago

0.0.20220826

2 years ago

0.0.20220904

2 years ago

0.0.20220816

2 years ago

0.0.20220812

2 years ago

0.0.20220808

2 years ago