1.0.20220810 • Published 2 years ago

@maxim_mazurok/gapi.client.books v1.0.20220810

Weekly downloads
97
License
MIT
Repository
github
Last release
2 years ago

TypeScript typings for Books API v1

The Google Books API allows clients to access the Google Books repository. For detailed description please check documentation.

Installing

Install typings for Books API:

npm install @types/gapi.client.books@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('books', 'v1', () => {
  // now we can use gapi.client.books
  // ...
});

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 = [ 
      // Manage your books
      'https://www.googleapis.com/auth/books',
    ],
    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 Books API resources:

/*
Retrieves metadata for a specific bookshelf for the specified user.
*/
await gapi.client.books.bookshelves.get({ shelf: "shelf", userId: "userId",  });

/*
Retrieves a list of public bookshelves for the specified user.
*/
await gapi.client.books.bookshelves.list({ userId: "userId",  });

/*
Add a user-upload volume and triggers processing.
*/
await gapi.client.books.cloudloading.addBook({  });

/*
Remove the book and its contents
*/
await gapi.client.books.cloudloading.deleteBook({ volumeId: "volumeId",  });

/*
Updates a user-upload volume.
*/
await gapi.client.books.cloudloading.updateBook({  });

/*
Returns a list of offline dictionary metadata available
*/
await gapi.client.books.dictionary.listOfflineMetadata({ cpksver: "cpksver",  });

/*
Gets information regarding the family that the user is part of.
*/
await gapi.client.books.familysharing.getFamilyInfo({  });

/*
Initiates sharing of the content with the user's family. Empty response indicates success.
*/
await gapi.client.books.familysharing.share({  });

/*
Initiates revoking content that has already been shared with the user's family. Empty response indicates success.
*/
await gapi.client.books.familysharing.unshare({  });

/*
Gets the layer summary for a volume.
*/
await gapi.client.books.layers.get({ summaryId: "summaryId", volumeId: "volumeId",  });

/*
List the layer summaries for a volume.
*/
await gapi.client.books.layers.list({ volumeId: "volumeId",  });

/*
Gets the current settings for the user.
*/
await gapi.client.books.myconfig.getUserSettings({  });

/*
Release downloaded content access restriction.
*/
await gapi.client.books.myconfig.releaseDownloadAccess({ cpksver: "cpksver", volumeIds: "volumeIds",  });

/*
Request concurrent and download access restrictions.
*/
await gapi.client.books.myconfig.requestAccess({ cpksver: "cpksver", nonce: "nonce", source: "source", volumeId: "volumeId",  });

/*
Request downloaded content access for specified volumes on the My eBooks shelf.
*/
await gapi.client.books.myconfig.syncVolumeLicenses({ cpksver: "cpksver", nonce: "nonce", source: "source",  });

/*
Sets the settings for the user. If a sub-object is specified, it will overwrite the existing sub-object stored in the server. Unspecified sub-objects will retain the existing value.
*/
await gapi.client.books.myconfig.updateUserSettings({  });

/*
Returns notification details for a given notification id.
*/
await gapi.client.books.notification.get({ notification_id: "notification_id",  });

/*
List categories for onboarding experience.
*/
await gapi.client.books.onboarding.listCategories({  });

/*
List available volumes under categories for onboarding experience.
*/
await gapi.client.books.onboarding.listCategoryVolumes({  });

/*
Returns a stream of personalized book clusters
*/
await gapi.client.books.personalizedstream.get({  });

/*
Accepts the promo offer.
*/
await gapi.client.books.promooffer.accept({  });

/*
Marks the promo offer as dismissed.
*/
await gapi.client.books.promooffer.dismiss({  });

/*
Returns a list of promo offers available to the user
*/
await gapi.client.books.promooffer.get({  });

/*
Returns Series metadata for the given series ids.
*/
await gapi.client.books.series.get({ series_id: "series_id",  });

/*
Gets volume information for a single volume.
*/
await gapi.client.books.volumes.get({ volumeId: "volumeId",  });

/*
Performs a book search.
*/
await gapi.client.books.volumes.list({ q: "q",  });
1.0.20220617

2 years ago

1.0.20220615

2 years ago

1.0.20220624

2 years ago

1.0.20220805

2 years ago

1.0.20220803

2 years ago

1.0.20220810

2 years ago

1.0.20220721

2 years ago

1.0.20220729

2 years ago

1.0.20220726

2 years ago

1.0.20220722

2 years ago

1.0.20220610

2 years ago

1.0.20220506

2 years ago

1.0.20220504

2 years ago

1.0.20220510

2 years ago

1.0.20220518

2 years ago

1.0.20220527

2 years ago

1.0.20220525

2 years ago

1.0.20220429

2 years ago

1.0.20220607

2 years ago

1.0.20220603

2 years ago

1.0.20220601

2 years ago

1.0.20220408

2 years ago

1.0.20220405

2 years ago

1.0.20220412

2 years ago

1.0.20220418

2 years ago

1.0.20220419

2 years ago

1.0.20220422

2 years ago

1.0.20220426

2 years ago

1.0.20220318

2 years ago

1.0.20220323

2 years ago

1.0.20220328

2 years ago

1.0.20220330

2 years ago

1.0.20220228

2 years ago

1.0.20220301

2 years ago

1.0.20220309

2 years ago

1.0.20220307

2 years ago

1.0.20220305

2 years ago

1.0.20220311

2 years ago

1.0.20220315

2 years ago

1.0.20220103

2 years ago

1.0.20220222

2 years ago

1.0.20220109

2 years ago

1.0.20220107

2 years ago

1.0.20220111

2 years ago

1.0.20220117

2 years ago

1.0.20220126

2 years ago

1.0.20220124

2 years ago

1.0.20220131

2 years ago

1.0.20220202

2 years ago

1.0.20220209

2 years ago

1.0.20220207

2 years ago

1.0.20220214

2 years ago

1.0.20211110

3 years ago

1.0.20211118

3 years ago

1.0.20211112

3 years ago

1.0.20211206

2 years ago

1.0.20211201

2 years ago

1.0.20211124

2 years ago

1.0.20211208

2 years ago

1.0.20211105

3 years ago

1.0.20211101

3 years ago

1.0.20211025

3 years ago

1.0.20211006

3 years ago

1.0.20211008

3 years ago

1.0.20211015

3 years ago

1.0.20211004

3 years ago

1.0.20210928

3 years ago

1.0.20210920

3 years ago

1.0.20210912

3 years ago

1.0.20210908

3 years ago

1.0.20210830

3 years ago

1.0.20210825

3 years ago

1.0.20210818

3 years ago

1.0.20210811

3 years ago

1.0.20210809

3 years ago

1.0.20210805

3 years ago

1.0.20210802

3 years ago

1.0.20210728

3 years ago

1.0.20210723

3 years ago

1.0.20210721

3 years ago

1.0.20210716

3 years ago

1.0.20210709

3 years ago

1.0.20210707

3 years ago

1.0.20210625

3 years ago

1.0.20210623

3 years ago

1.0.20210621

3 years ago

1.0.20210616

3 years ago

1.0.20210611

3 years ago

1.0.20210606

3 years ago

1.0.20210601

3 years ago

1.0.20210521

3 years ago

1.0.20210519

3 years ago

1.0.20210513

3 years ago

1.0.20210512

3 years ago

1.0.20210507

3 years ago

1.0.20210505

3 years ago

1.0.20210430

3 years ago

1.0.20210428

3 years ago

1.0.20210426

3 years ago

1.0.20210421

3 years ago

1.0.20210417

3 years ago

1.0.20210414

3 years ago

1.0.20210409

3 years ago

1.0.20210407

3 years ago

1.0.20210406

3 years ago

1.0.20210330

3 years ago

1.0.20210326

3 years ago

1.0.20210323

3 years ago

1.0.20210319

3 years ago

1.0.20210317

3 years ago

1.0.20210311

3 years ago

1.0.20210309

3 years ago

1.0.20210308

3 years ago

1.0.20210305

3 years ago

1.0.20210303

3 years ago

1.0.20210226

3 years ago

1.0.20210224

3 years ago

1.0.20210220

3 years ago

1.0.20210216

3 years ago

1.0.20210210

3 years ago

1.0.20210206

3 years ago

1.0.20210203

3 years ago

1.0.20210131

3 years ago

1.0.20210127

3 years ago

1.0.20210122

3 years ago

1.0.20210120

3 years ago

1.0.20210113

3 years ago

1.0.20210111

3 years ago

1.0.20210105

3 years ago

1.0.20201209

3 years ago

1.0.20201211

3 years ago

1.0.20201207

3 years ago

1.0.20201202

3 years ago

1.0.20201130

3 years ago

1.0.20201119

3 years ago

1.0.20201116

4 years ago

1.0.20201110

4 years ago