@adobe/helix-google-support 2.1.1 → 2.2.1

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.1](https://github.com/adobe/helix-google-support/compare/v2.2.0...v2.2.1) (2023-06-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update adobe fixes ([09617f7](https://github.com/adobe/helix-google-support/commit/09617f7c78027ba3608769432a5cf613198e6340))
7
+
8
+ # [2.2.0](https://github.com/adobe/helix-google-support/compare/v2.1.1...v2.2.0) (2023-06-19)
9
+
10
+
11
+ ### Features
12
+
13
+ * 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))
14
+
1
15
  ## [2.1.1](https://github.com/adobe/helix-google-support/compare/v2.1.0...v2.1.1) (2023-06-18)
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.1",
3
+ "version": "2.2.1",
4
4
  "description": "Helix Google Support",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -30,16 +30,16 @@
30
30
  "reporter-options": "configFile=.mocha-multi.json"
31
31
  },
32
32
  "dependencies": {
33
- "@adobe/helix-onedrive-support": "10.1.1",
33
+ "@adobe/helix-onedrive-support": "10.1.2",
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.6",
38
+ "@adobe/helix-shared-tokencache": "1.2.7",
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",
42
+ "c8": "8.0.0",
43
43
  "eslint": "8.43.0",
44
44
  "eslint-plugin-header": "3.1.1",
45
45
  "eslint-plugin-import": "2.27.5",
@@ -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) {