attlaz-client 1.8.13 → 1.8.14

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.
@@ -43,8 +43,7 @@ class HttpClient {
43
43
  jsonData = JSON.parse(rawData);
44
44
  }
45
45
  catch (e) {
46
- console.log(httpResponse.statusText);
47
- console.error('Unable to parse response data to JSON');
46
+ console.error('Unable to parse response data to JSON', { statusText: httpResponse.statusText, error: e });
48
47
  }
49
48
  httpResponse.body = jsonData;
50
49
  }
@@ -30,7 +30,6 @@ class OAuthClient {
30
30
  }
31
31
  async authenticate(username = null, password = null) {
32
32
  //TODO: should we encrypt the password in the client (or is https save enough)?
33
- console.log('Authenticate');
34
33
  try {
35
34
  let accessToken;
36
35
  if (username !== null && username !== undefined && password !== null && password !== undefined) {
@@ -53,7 +52,9 @@ class OAuthClient {
53
52
  }
54
53
  }
55
54
  async refreshToken() {
56
- console.log('Get refresh token');
55
+ if (this.debug) {
56
+ console.debug('[OAuthClient] refresh token');
57
+ }
57
58
  if (this.oauthToken === null) {
58
59
  throw new Error('unable to refresh token, auth token not set');
59
60
  }
@@ -63,7 +64,6 @@ class OAuthClient {
63
64
  this.oathClientToken = this.tokenToOauthClientToken(this.oauthToken);
64
65
  }
65
66
  catch (e) {
66
- console.log('Error during refresh token', e);
67
67
  throw ClientError_1.ClientError.fromError(e);
68
68
  }
69
69
  }
@@ -90,21 +90,16 @@ class OAuthClient {
90
90
  if (this.refreshTokenPromise === null) {
91
91
  this.refreshTokenPromise = this.refreshToken();
92
92
  await this.refreshTokenPromise;
93
- // this.refreshTokenPromise.then(() => {
94
93
  this.refreshTokenPromise = null;
95
- console.log('Refresh token done');
96
- // });
97
94
  }
98
95
  else {
99
- console.log('Waiting for refresh token promise');
100
96
  await this.refreshTokenPromise;
101
- console.log('Refresh token promise resolved');
102
97
  }
103
98
  }
104
99
  }
105
100
  const requestData = this.createRequestData(action, parameters, method, signWithOauthToken);
106
101
  if (this.debug) {
107
- console.debug('[Client] REQ: ' + requestData.method.toUpperCase() + ' ' + requestData.getFullUrl());
102
+ console.debug('[OAuthClient] Request: ' + requestData.method.toUpperCase() + ' ' + requestData.getFullUrl());
108
103
  }
109
104
  try {
110
105
  const response = await HttpClient_1.HttpClient.request2(requestData);
@@ -9,7 +9,6 @@ class ClientError {
9
9
  this.code = code;
10
10
  }
11
11
  static fromError(error) {
12
- console.log('Incoming error', error);
13
12
  if (error.body !== undefined && error.body !== null && error.body.error !== undefined && error.body.error !== null) {
14
13
  error = error.body.error;
15
14
  }
@@ -40,7 +40,6 @@ class ProjectDeployEndpoint extends Endpoint_1.Endpoint {
40
40
  try {
41
41
  const projectDeploy = await this.httpClient.request('/projectenvironments/' + projectEnvironmentId + '/deploys', {}, 'POST');
42
42
  // TODO: parse deploy
43
- console.log('Parse deploy', projectDeploy);
44
43
  return projectDeploy;
45
44
  }
46
45
  catch (error) {
@@ -11,7 +11,7 @@ class TaskExecutionRequestEndpoint extends Endpoint_1.Endpoint {
11
11
  try {
12
12
  // TODO: parse
13
13
  const result = await this.httpClient.request(url, params, 'POST');
14
- console.log('TODO: parse postTaskExecutionRequest result', result);
14
+ // console.log('TODO: parse postTaskExecutionRequest result', result);
15
15
  return result;
16
16
  }
17
17
  catch (ex) {
@@ -33,7 +33,7 @@ class WorkerConfigEndpoint extends Endpoint_1.Endpoint {
33
33
  try {
34
34
  let url = '/projectenvironments/' + workerConfig.projectEnvironment + '/workerconfiguration';
35
35
  const result = await this.request(url, workerConfig, 'POST');
36
- console.log(result);
36
+ // console.log(result);
37
37
  return WorkerConfig_1.WorkerConfig.parse(result);
38
38
  }
39
39
  catch (error) {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.8.13";
1
+ export declare const VERSION = "1.8.14";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "1.8.13";
4
+ exports.VERSION = "1.8.14";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attlaz-client",
3
- "version": "1.8.13",
3
+ "version": "1.8.14",
4
4
  "description": "Javascript Client to access Attlaz API",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -30,16 +30,16 @@
30
30
  "popsicle": "^12.1.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/jest": "^27.4.1",
34
- "@types/node": "^17.0.21",
35
- "jest": "^27.5.1",
33
+ "@types/jest": "^28.1.6",
34
+ "@types/node": "^18.7.2",
35
+ "jest": "^28.1.3",
36
36
  "rimraf": "^3.0.2",
37
37
  "rollup-plugin-commonjs": "^10.1.0",
38
38
  "rollup-plugin-node-resolve": "^5.2.0",
39
39
  "rollup-plugin-typescript": "^1.0.1",
40
- "ts-jest": "^27.1.3",
41
- "typescript": "^4.6.2",
42
- "dotenv": "^16.0.0"
40
+ "ts-jest": "^28.0.7",
41
+ "typescript": "^4.7.4",
42
+ "dotenv": "^16.0.1"
43
43
  },
44
44
  "directories": {
45
45
  "test": "test"