@anmiles/google-api-wrapper 17.0.2 → 17.0.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [17.0.3](../../tags/v17.0.3) - 2024-01-16
9
+ ### Changed
10
+ - Fix README.md
11
+
8
12
  ## [17.0.2](../../tags/v17.0.2) - 2024-01-16
9
13
  ### Changed
10
14
  - Speed-up tests by isolating modules
package/README.md CHANGED
@@ -10,11 +10,6 @@ Provides quick interface for getting google API data. Support all google APIs as
10
10
 
11
11
  ## Usage
12
12
 
13
- ``` bash
14
- > $ node ./auth.js
15
- > $ node ./videos.js
16
- ```
17
-
18
13
  ### Authorization
19
14
  ``` js
20
15
  /* auth.js */
@@ -22,7 +17,9 @@ Provides quick interface for getting google API data. Support all google APIs as
22
17
  import { createProfile, login } from '@anmiles/google-api-wrapper';
23
18
 
24
19
  createProfile("username");
20
+
25
21
  // Persistent credentials will be generated and stored to credentials file.
22
+ // Next `login` call will re-use persistent credentials without showing oauth window
26
23
  login("username");
27
24
 
28
25
  ```
@@ -38,6 +35,7 @@ require('./auth');
38
35
 
39
36
  getProfiles().map(async (profile) => {
40
37
  // Persistent credentials will be generated and stored to credentials file.
38
+ // Next `getAPI` call will re-use persistent credentials without showing oauth window
41
39
  const calendarAPI = getAPI((auth) => calendar({ version : 'v3', auth }), profile);
42
40
  const events = await calendarAPI.getItems((api) => api.events, { timeMax: new Date().toISOString() });
43
41
  events.forEach((event) => console.log(`Event: ${event.summary}`));
@@ -54,6 +52,7 @@ import { getProfiles, getAPI } from '@anmiles/google-api-wrapper';
54
52
 
55
53
  getProfiles().map(async (profile) => {
56
54
  // Temporary credentials will be generated and not stored to credentials file
55
+ // Next `getAPI` will start authorization again with showing oauth window
57
56
  const youtubeAPI = getAPI((auth) => youtube({ version : 'v3', auth }), profile, { temporary: true });
58
57
  const videos = await youtubeAPI.getItems((api) => api.playlistItems, { playlistId : 'LL', part : [ 'snippet' ], maxResults : 50 });
59
58
  videos.forEach((video) => console.log(`Downloaded: ${video.snippet?.title}`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anmiles/google-api-wrapper",
3
- "version": "17.0.2",
3
+ "version": "17.0.3",
4
4
  "description": "Provides quick interface for getting google API data",
5
5
  "keywords": [
6
6
  "google",