@adobe/helix-google-support 2.1.0 → 2.2.0

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
@@ -1,3 +1,17 @@
1
+ # [2.2.0](https://github.com/adobe/helix-google-support/compare/v2.1.1...v2.2.0) (2023-06-19)
2
+
3
+
4
+ ### Features
5
+
6
+ * Initialise Google Client with access token ([#208](https://github.com/adobe/helix-google-support/issues/208)) ([d539816](https://github.com/adobe/helix-google-support/commit/d5398161e9020aa6e9df17609d31800df1e2b425))
7
+
8
+ ## [2.1.1](https://github.com/adobe/helix-google-support/compare/v2.1.0...v2.1.1) (2023-06-18)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/helix-onedrive-support to v10.1.1 ([0b5e077](https://github.com/adobe/helix-google-support/commit/0b5e0770e7873fc2084c3a78392b7db19c379df6))
14
+
1
15
  # [2.1.0](https://github.com/adobe/helix-google-support/compare/v2.0.90...v2.1.0) (2023-06-07)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-google-support",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Helix Google Support",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -30,17 +30,17 @@
30
30
  "reporter-options": "configFile=.mocha-multi.json"
31
31
  },
32
32
  "dependencies": {
33
- "@adobe/helix-onedrive-support": "10.1.0",
33
+ "@adobe/helix-onedrive-support": "10.1.1",
34
34
  "googleapis": "118.0.0",
35
- "lru-cache": "9.1.2"
35
+ "lru-cache": "10.0.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@adobe/helix-shared-tokencache": "1.2.5",
38
+ "@adobe/helix-shared-tokencache": "1.2.6",
39
39
  "@adobe/eslint-config-helix": "2.0.2",
40
40
  "@semantic-release/changelog": "6.0.3",
41
41
  "@semantic-release/git": "10.0.1",
42
- "c8": "7.14.0",
43
- "eslint": "8.42.0",
42
+ "c8": "8.0.0",
43
+ "eslint": "8.43.0",
44
44
  "eslint-plugin-header": "3.1.1",
45
45
  "eslint-plugin-import": "2.27.5",
46
46
  "husky": "8.0.3",
@@ -49,7 +49,7 @@
49
49
  "mocha": "10.2.0",
50
50
  "mocha-multi-reporters": "1.5.1",
51
51
  "nock": "13.3.1",
52
- "semantic-release": "21.0.3"
52
+ "semantic-release": "21.0.5"
53
53
  },
54
54
  "lint-staged": {
55
55
  "*.js": "eslint",
@@ -95,13 +95,20 @@ export class GoogleClient {
95
95
  * @param {ICachePlugin} plugin
96
96
  */
97
97
  constructor(opts) {
98
- Object.assign(this, {
99
- log: opts.log,
100
- auth: new google.auth.OAuth2(
98
+ let auth;
99
+ if (opts.token) {
100
+ auth = new google.auth.OAuth2();
101
+ auth.setCredentials({ access_token: `${opts.token}` });
102
+ } else {
103
+ auth = new google.auth.OAuth2(
101
104
  opts.clientId,
102
105
  opts.clientSecret,
103
106
  opts.redirectUri,
104
- ),
107
+ );
108
+ }
109
+ Object.assign(this, {
110
+ log: opts.log,
111
+ auth,
105
112
  });
106
113
 
107
114
  if (opts.cachePlugin) {