attlaz-client 1.12.2 → 1.12.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/dist/{Model/Error → Http}/ClientError.js +16 -13
- package/dist/Http/HttpClient.js +1 -1
- package/dist/Http/OAuthClient.js +1 -1
- package/dist/Service/FlowRunEndpoint.js +0 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- /package/dist/{Model/Error → Http}/ClientError.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpClient } from '
|
|
1
|
+
import { HttpClient } from './HttpClient.js';
|
|
2
2
|
export class ClientError {
|
|
3
3
|
code;
|
|
4
4
|
name;
|
|
@@ -12,7 +12,6 @@ export class ClientError {
|
|
|
12
12
|
this.code = code;
|
|
13
13
|
}
|
|
14
14
|
static fromError(error) {
|
|
15
|
-
console.log(error);
|
|
16
15
|
if (error.body !== undefined && error.body !== null && error.body.error !== undefined && error.body.error !== null) {
|
|
17
16
|
error = error.body.error;
|
|
18
17
|
}
|
|
@@ -31,17 +30,21 @@ export class ClientError {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
else if (error.code !== null && error.code !== undefined) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
switch (error.code) {
|
|
34
|
+
case 'EUNAVAILABLE':
|
|
35
|
+
clientError.code = HttpClient.HTTP_UNAVAILABLE;
|
|
36
|
+
break;
|
|
37
|
+
case 'EAUTH':
|
|
38
|
+
clientError.code = HttpClient.HTTP_UNAUTHORIZED;
|
|
39
|
+
break;
|
|
40
|
+
case 'ESTATUS':
|
|
41
|
+
if (error.message === 'HTTP status 503') {
|
|
42
|
+
clientError.code = HttpClient.HTTP_UNAVAILABLE;
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
console.warn('[Client error] Error code `' + error.code + '` not recognised');
|
|
47
|
+
clientError.code = error.code;
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
clientError.name = error.name;
|
package/dist/Http/HttpClient.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fetch } from 'popsicle';
|
|
2
2
|
import { HttpClientResponse } from './HttpClientResponse.js';
|
|
3
|
-
import { ClientError } from '../Model/Error/ClientError.js';
|
|
4
3
|
import { VERSION } from '../version.js';
|
|
4
|
+
import { ClientError } from './ClientError.js';
|
|
5
5
|
export class HttpClient {
|
|
6
6
|
static HTTP_BAD_REQUEST = 400;
|
|
7
7
|
static HTTP_UNAUTHORIZED = 401;
|
package/dist/Http/OAuthClient.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ClientOAuth2 from 'client-oauth2';
|
|
2
|
-
import { ClientError } from '
|
|
2
|
+
import { ClientError } from './ClientError.js';
|
|
3
3
|
import { HttpClient } from './HttpClient.js';
|
|
4
4
|
import { HttpClientRequest } from './HttpClientRequest.js';
|
|
5
5
|
import { OAuthClientToken } from './OAuthClientToken.js';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Endpoint } from './Endpoint.js';
|
|
2
|
-
import { ClientError } from '../Model/Error/ClientError.js';
|
|
3
|
-
import { HttpClient } from '../Http/HttpClient.js';
|
|
4
2
|
import { FlowRun } from '../Model/Flow/FlowRun.js';
|
|
5
3
|
import { FlowRunSummary } from '../Model/Flow/FlowRunSummary.js';
|
|
6
4
|
import { FlowRunHistory } from '../Model/Flow/FlowRunHistory.js';
|
|
@@ -54,9 +52,6 @@ export class FlowRunEndpoint extends Endpoint {
|
|
|
54
52
|
return result.getData();
|
|
55
53
|
}
|
|
56
54
|
catch (error) {
|
|
57
|
-
if (error instanceof ClientError && error.code === HttpClient.HTTP_NOTFOUND) {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
55
|
if (this.httpClient.isDebugEnabled()) {
|
|
61
56
|
console.error('Failed to load flow runs: ' + error);
|
|
62
57
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ export { HttpClientResponse } from './Http/HttpClientResponse.js';
|
|
|
7
7
|
export { OAuthClient } from './Http/OAuthClient.js';
|
|
8
8
|
export { OAuthClientOptions } from './Http/OAuthClientOptions.js';
|
|
9
9
|
export { OAuthClientToken } from './Http/OAuthClientToken.js';
|
|
10
|
+
export { ClientError } from './Http/ClientError.js';
|
|
10
11
|
/**
|
|
11
12
|
* Models
|
|
12
13
|
*/
|
|
13
14
|
export { Adapter } from './Model/Adapter/Adapter.js';
|
|
14
15
|
export { AdapterConfiguration } from './Model/Adapter/AdapterConfiguration.js';
|
|
15
16
|
export { AdapterConnection } from './Model/Adapter/AdapterConnection.js';
|
|
16
|
-
export { ClientError } from './Model/Error/ClientError.js';
|
|
17
17
|
export { EventType } from './Model/Event/EventType.js';
|
|
18
18
|
export { HealthAlert } from './Model/HealthAlert/HealthAlert.js';
|
|
19
19
|
export { HealthAlertStatus } from './Model/HealthAlert/HealthAlertStatus.js';
|
package/dist/index.js
CHANGED
|
@@ -7,13 +7,13 @@ export { HttpClientResponse } from './Http/HttpClientResponse.js';
|
|
|
7
7
|
export { OAuthClient } from './Http/OAuthClient.js';
|
|
8
8
|
export { OAuthClientOptions } from './Http/OAuthClientOptions.js';
|
|
9
9
|
export { OAuthClientToken } from './Http/OAuthClientToken.js';
|
|
10
|
+
export { ClientError } from './Http/ClientError.js';
|
|
10
11
|
/**
|
|
11
12
|
* Models
|
|
12
13
|
*/
|
|
13
14
|
export { Adapter } from './Model/Adapter/Adapter.js';
|
|
14
15
|
export { AdapterConfiguration } from './Model/Adapter/AdapterConfiguration.js';
|
|
15
16
|
export { AdapterConnection } from './Model/Adapter/AdapterConnection.js';
|
|
16
|
-
export { ClientError } from './Model/Error/ClientError.js';
|
|
17
17
|
export { EventType } from './Model/Event/EventType.js';
|
|
18
18
|
export { HealthAlert } from './Model/HealthAlert/HealthAlert.js';
|
|
19
19
|
export { HealthAlertStatus } from './Model/HealthAlert/HealthAlertStatus.js';
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.12.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "1.
|
|
1
|
+
export const VERSION = "1.12.2";
|
package/package.json
CHANGED
|
File without changes
|