attlaz-client 1.18.0 → 1.18.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.
@@ -155,15 +155,15 @@ export class OAuthClient {
155
155
  return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
156
156
  }
157
157
  tokenToOauthClientToken(oauthToken) {
158
- // console.log('Auth token', oauthToken);
159
- // let scopes: string = '';
160
- // if (Object.prototype.hasOwnProperty.call(oauthToken.data, 'scopes')) {
161
- // scopes = oauthToken.data.scopes;
162
- // } else if (Object.prototype.hasOwnProperty.call(oauthToken.data, 'scope')) {
163
- // scopes = oauthToken.data.scope;
164
- // }
158
+ let scopes = '';
159
+ if (Object.prototype.hasOwnProperty.call(oauthToken, 'scopes') && oauthToken.scopes !== undefined) {
160
+ scopes = oauthToken.scopes;
161
+ }
162
+ else if (Object.prototype.hasOwnProperty.call(oauthToken, 'scope') && oauthToken.scope !== undefined) {
163
+ scopes = oauthToken.scope;
164
+ }
165
165
  const refreshToken = oauthToken.refresh_token === undefined || oauthToken.refresh_token === null ? null : oauthToken.refresh_token;
166
- const token = new OAuthClientToken(oauthToken.access_token, oauthToken.token_type, refreshToken, oauthToken.scope);
166
+ const token = new OAuthClientToken(oauthToken.access_token, oauthToken.token_type, refreshToken, scopes);
167
167
  const t = new Date();
168
168
  t.setSeconds(t.getSeconds() + oauthToken.expires_in);
169
169
  token.expires = t;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -47,15 +47,16 @@
47
47
  "devDependencies": {
48
48
  "@types/jest": "^29.5.2",
49
49
  "@types/node": "^22.1.0",
50
- "@typescript-eslint/eslint-plugin": "^8.12.2",
51
- "@typescript-eslint/parser": "^8.12.2",
52
50
  "dotenv": "^16.3.1",
53
- "eslint": "^8.42.0",
54
- "eslint-config-airbnb-base": "^15.0.0",
51
+ "eslint-config-attlaz-base": "^1.0.17",
52
+ "eslint": "^9.14.0",
53
+ "eslint-import-resolver-typescript": "^3.6.1",
55
54
  "eslint-plugin-import": "^2.27.5",
56
- "eslint-plugin-jsdoc": "^50.4.3",
55
+ "eslint-plugin-jsdoc": "^50.1.0",
57
56
  "eslint-plugin-prefer-arrow": "^1.2.3",
58
- "eslint-plugin-promise": "^7.0.0",
57
+ "eslint-plugin-promise": "^7.1.0",
58
+ "@typescript-eslint/eslint-plugin": "^8.1.0",
59
+ "@typescript-eslint/parser": "^8.1.0",
59
60
  "jest": "^29.5.0",
60
61
  "rimraf": "^6.0.1",
61
62
  "rollup-plugin-commonjs": "^10.1.0",