attlaz-client 1.10.0 → 1.10.2
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/README.md +27 -27
- package/dist/Client.js +4 -4
- package/dist/Http/Data/QueryString.js +1 -1
- package/dist/Http/HttpClient.js +4 -6
- package/dist/Http/HttpClientRequest.js +3 -3
- package/dist/Http/OAuthClient.js +7 -7
- package/dist/Model/Adapter/Adapter.js +1 -1
- package/dist/Model/Adapter/AdapterConfiguration.js +1 -1
- package/dist/Model/Adapter/AdapterConnection.js +1 -1
- package/dist/Model/Config.js +1 -1
- package/dist/Model/DataValue.d.ts +1 -1
- package/dist/Model/DataValueCollection.js +2 -6
- package/dist/Model/Deployment/CodeSource.js +1 -1
- package/dist/Model/Deployment/CodeSourceAccount.js +1 -1
- package/dist/Model/Deployment/CodeSourceBuildStrategy.js +1 -1
- package/dist/Model/Deployment/CodeSourceRunStrategy.js +1 -1
- package/dist/Model/Deployment/SourcesAccountRepository.js +1 -1
- package/dist/Model/Deployment/SourcesAccountRepositoryBranch.js +1 -1
- package/dist/Model/Error/ClientError.js +14 -27
- package/dist/Model/Event/EventType.d.ts +5 -5
- package/dist/Model/Event/EventType.js +15 -15
- package/dist/Model/Flow/Flow.d.ts +1 -1
- package/dist/Model/Flow/Flow.js +1 -1
- package/dist/Model/Flow/FlowRun.js +1 -1
- package/dist/Model/Flow/FlowRunHistory.js +1 -1
- package/dist/Model/Flow/FlowRunStatus.js +7 -7
- package/dist/Model/Flow/FlowRunSummary.d.ts +1 -1
- package/dist/Model/Flow/FlowRunSummary.js +2 -2
- package/dist/Model/Flow/FlowSummary.d.ts +1 -1
- package/dist/Model/Flow/FlowSummary.js +2 -2
- package/dist/Model/HealthAlert/HealthAlert.js +1 -1
- package/dist/Model/HealthAlert/HealthTestType.d.ts +1 -1
- package/dist/Model/HealthAlert/HealthTestType.js +1 -1
- package/dist/Model/Log/Log.d.ts +1 -1
- package/dist/Model/Log/Log.js +2 -2
- package/dist/Model/Log/LogLevel.js +2 -2
- package/dist/Model/Messaging/Channel/EmailChannelData.d.ts +1 -1
- package/dist/Model/Messaging/Channel/EmailChannelData.js +1 -1
- package/dist/Model/Messaging/ChannelHistory.js +1 -1
- package/dist/Model/Messaging/Subscriber.js +1 -1
- package/dist/Model/Notification.js +1 -1
- package/dist/Model/Project/CodeDeploy.js +3 -3
- package/dist/Model/Project/PlatformLanguage.js +1 -1
- package/dist/Model/Project/Project.js +1 -1
- package/dist/Model/Result/DataResult.d.ts +1 -1
- package/dist/Model/Result/DataResult.js +2 -2
- package/dist/Model/Result/ObjectResult.d.ts +0 -1
- package/dist/Model/Result/ObjectResult.js +0 -2
- package/dist/Model/Storage/StorageItem.js +1 -1
- package/dist/Model/Storage/StorageItemInformation.js +1 -1
- package/dist/Model/Trigger/Trigger.d.ts +1 -1
- package/dist/Model/Trigger/Trigger.js +2 -2
- package/dist/Model/User.js +1 -1
- package/dist/Model/Worker/Worker.js +1 -1
- package/dist/Model/Workspace/WorkspaceMemberInvite2.js +1 -1
- package/dist/Service/AdapterEndpoint.js +9 -12
- package/dist/Service/ChannelEndpoint.js +3 -5
- package/dist/Service/CodeSourceStrategiesEndpoint.js +4 -8
- package/dist/Service/ConfigEndpoint.js +1 -1
- package/dist/Service/Endpoint.js +3 -4
- package/dist/Service/FirewallEndpoint.js +5 -9
- package/dist/Service/FlowEndpoint.js +2 -2
- package/dist/Service/FlowRunEndpoint.js +2 -2
- package/dist/Service/FlowRunRequestEndpoint.js +2 -2
- package/dist/Service/FlowRunStatsEndpoint.js +1 -1
- package/dist/Service/HealthAlertEndpoint.js +1 -1
- package/dist/Service/LogEndpoint.js +12 -18
- package/dist/Service/PlatformEndpoint.js +2 -2
- package/dist/Service/ProjectEndpoint.js +1 -1
- package/dist/Service/QueueEndpoint.js +1 -1
- package/dist/Service/SearchEndpoint.js +1 -1
- package/dist/Service/SourcesAccountEndpoint.js +1 -1
- package/dist/Service/StorageEndpoint.js +9 -13
- package/dist/Service/SubscriberEndpoint.js +1 -1
- package/dist/Service/TriggerEndpoint.js +1 -1
- package/dist/Service/UserEndpoint.js +16 -26
- package/dist/Service/WorkerConfigEndpoint.js +2 -2
- package/dist/Service/WorkerEndpoint.js +3 -5
- package/dist/Service/WorkspaceMemberEndpoint.js +5 -7
- package/dist/Utils.js +2 -2
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/version.js +1 -1
- package/package.json +69 -69
package/README.md
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
Attlaz Javascript/Node client
|
|
2
|
-
==========
|
|
3
|
-
|
|
4
|
-
[Attlaz](https://attlaz.com) is a cloud-based iPaas (Integration Platform as a Service), automation and data management platform.
|
|
5
|
-
|
|
6
|
-
Getting Started
|
|
7
|
-
---------------
|
|
8
|
-
|
|
9
|
-
Install Attlaz using `yarn`:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
yarn add attlaz-client
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Or npm, if you wish:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install attlaz-client
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Getting Help
|
|
22
|
-
------------
|
|
23
|
-
|
|
24
|
-
* [Issue Tracker](https://github.com/Attlaz-Platform) for questions, feature requests, bug reports and
|
|
25
|
-
general discussion related to these packages. Try searching before you create a new issue.
|
|
26
|
-
* Check the [Attlaz Documentation](https://docs.attlaz.com).
|
|
27
|
-
* [Email us](developers@attlaz.com) in Attlaz developer support: `developers@attlaz.com`
|
|
1
|
+
Attlaz Javascript/Node client
|
|
2
|
+
==========
|
|
3
|
+
|
|
4
|
+
[Attlaz](https://attlaz.com) is a cloud-based iPaas (Integration Platform as a Service), automation and data management platform.
|
|
5
|
+
|
|
6
|
+
Getting Started
|
|
7
|
+
---------------
|
|
8
|
+
|
|
9
|
+
Install Attlaz using `yarn`:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
yarn add attlaz-client
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or npm, if you wish:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install attlaz-client
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Getting Help
|
|
22
|
+
------------
|
|
23
|
+
|
|
24
|
+
* [Issue Tracker](https://github.com/Attlaz-Platform) for questions, feature requests, bug reports and
|
|
25
|
+
general discussion related to these packages. Try searching before you create a new issue.
|
|
26
|
+
* Check the [Attlaz Documentation](https://docs.attlaz.com).
|
|
27
|
+
* [Email us](developers@attlaz.com) in Attlaz developer support: `developers@attlaz.com`
|
package/dist/Client.js
CHANGED
|
@@ -63,7 +63,7 @@ export class Client {
|
|
|
63
63
|
FlowRunStatsEndpoint,
|
|
64
64
|
CodeSourceStrategiesEndpoint,
|
|
65
65
|
FirewallEndpoint,
|
|
66
|
-
SearchEndpoint
|
|
66
|
+
SearchEndpoint,
|
|
67
67
|
};
|
|
68
68
|
constructor(apiEndpoint, clientId, clientSecret) {
|
|
69
69
|
this.apiEndpoint = apiEndpoint;
|
|
@@ -86,11 +86,11 @@ export class Client {
|
|
|
86
86
|
version: VERSION,
|
|
87
87
|
language: 'Javascript',
|
|
88
88
|
language_version: '',
|
|
89
|
-
publisher: 'Attlaz'
|
|
89
|
+
publisher: 'Attlaz',
|
|
90
90
|
};
|
|
91
91
|
return {
|
|
92
92
|
'User-Agent': 'Attlaz Javascript Client/' + VERSION,
|
|
93
|
-
'X-Attlaz-Client-User-Agent': JSON.stringify(userAgentInfo)
|
|
93
|
+
'X-Attlaz-Client-User-Agent': JSON.stringify(userAgentInfo),
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
getHttpClient() {
|
|
@@ -213,7 +213,7 @@ export class Client {
|
|
|
213
213
|
return this.getEndpoint('firewall', this.Store.FirewallEndpoint);
|
|
214
214
|
}
|
|
215
215
|
getEndpoint(key, className) {
|
|
216
|
-
//const classNameString: string = className.name;
|
|
216
|
+
// const classNameString: string = className.name;
|
|
217
217
|
if (!this.endpoints.has(key)) {
|
|
218
218
|
// if (this.Store[classNameString] === undefined || this.Store[classNameString] === null) {
|
|
219
219
|
// throw new Error(`Class type of \'${classNameString}\' is not in the store`);
|
package/dist/Http/HttpClient.js
CHANGED
|
@@ -38,11 +38,11 @@ export class HttpClient {
|
|
|
38
38
|
method: request.method,
|
|
39
39
|
headers: request.headers,
|
|
40
40
|
omitDefaultHeaders: true,
|
|
41
|
-
body: request.body
|
|
41
|
+
body: request.body,
|
|
42
42
|
};
|
|
43
43
|
const response = await fetch(request.getFullUrl(), rawRequest);
|
|
44
44
|
const httpResponse = new HttpClientResponse(response.status, response.statusText);
|
|
45
|
-
|
|
45
|
+
const contentType = this.getContentType(response);
|
|
46
46
|
const rawData = await response.text();
|
|
47
47
|
if (contentType.type === 'application/json') {
|
|
48
48
|
let jsonData = null;
|
|
@@ -51,9 +51,7 @@ export class HttpClient {
|
|
|
51
51
|
jsonData = JSON.parse(rawData);
|
|
52
52
|
}
|
|
53
53
|
catch (e) {
|
|
54
|
-
console.error('Unable to parse response data to JSON', {
|
|
55
|
-
statusText: httpResponse.statusText, error: e
|
|
56
|
-
});
|
|
54
|
+
console.error('Unable to parse response data to JSON', { statusText: httpResponse.statusText, error: e });
|
|
57
55
|
}
|
|
58
56
|
}
|
|
59
57
|
httpResponse.body = jsonData;
|
|
@@ -82,7 +80,7 @@ export class HttpClient {
|
|
|
82
80
|
if (d.length === 1) {
|
|
83
81
|
return { type: d[0], options: null };
|
|
84
82
|
}
|
|
85
|
-
|
|
83
|
+
if (d.length === 2) {
|
|
86
84
|
return { type: d[0], options: d[1].trim() };
|
|
87
85
|
}
|
|
88
86
|
console.error('Unable to parse content type "' + input + '"');
|
|
@@ -30,9 +30,9 @@ export class HttpClientRequest {
|
|
|
30
30
|
}
|
|
31
31
|
getFullUrl() {
|
|
32
32
|
let result = this.urlObj.href;
|
|
33
|
-
//Remove trailing slash
|
|
34
|
-
result = result.replace(/\/$/,
|
|
35
|
-
//Remove slash in query
|
|
33
|
+
// Remove trailing slash
|
|
34
|
+
result = result.replace(/\/$/, '');
|
|
35
|
+
// Remove slash in query
|
|
36
36
|
result = result.replace('/?', '?');
|
|
37
37
|
return result;
|
|
38
38
|
}
|
package/dist/Http/OAuthClient.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import ClientOAuth2 from 'client-oauth2';
|
|
1
2
|
import { ClientError } from '../Model/Error/ClientError.js';
|
|
2
3
|
import { HttpClient } from './HttpClient.js';
|
|
3
4
|
import { HttpClientRequest } from './HttpClientRequest.js';
|
|
4
5
|
import { OAuthClientToken } from './OAuthClientToken.js';
|
|
5
|
-
import ClientOAuth2 from 'client-oauth2';
|
|
6
6
|
import { JsonSerializable } from '../Model/JsonSerializable.js';
|
|
7
7
|
export class OAuthClient {
|
|
8
8
|
options;
|
|
@@ -20,11 +20,11 @@ export class OAuthClient {
|
|
|
20
20
|
redirectUri: options.redirectUri,
|
|
21
21
|
scopes: options.scopes,
|
|
22
22
|
state: options.state,
|
|
23
|
-
headers: options.headers
|
|
23
|
+
headers: options.headers,
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
async authenticate(username = null, password = null) {
|
|
27
|
-
//TODO: should we encrypt the password in the client (or is https save enough)?
|
|
27
|
+
// TODO: should we encrypt the password in the client (or is https save enough)?
|
|
28
28
|
try {
|
|
29
29
|
let accessToken;
|
|
30
30
|
if (username !== null && username !== undefined && password !== null && password !== undefined) {
|
|
@@ -114,7 +114,7 @@ export class OAuthClient {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
isAuthenticated() {
|
|
117
|
-
//TODO: other ways to determine if the client is authenticated?
|
|
117
|
+
// TODO: other ways to determine if the client is authenticated?
|
|
118
118
|
return this.oathClientToken !== null && this.oathClientToken !== undefined;
|
|
119
119
|
}
|
|
120
120
|
getToken() {
|
|
@@ -131,7 +131,7 @@ export class OAuthClient {
|
|
|
131
131
|
access_token: token.access_token,
|
|
132
132
|
token_type: token.token_type,
|
|
133
133
|
refresh_token: token.refresh_token,
|
|
134
|
-
scope: token.scope
|
|
134
|
+
scope: token.scope,
|
|
135
135
|
};
|
|
136
136
|
const oauthToken = this.oauthClient.createToken(data);
|
|
137
137
|
if (token.expires !== null && token.expires !== undefined) {
|
|
@@ -165,10 +165,10 @@ export class OAuthClient {
|
|
|
165
165
|
return token;
|
|
166
166
|
}
|
|
167
167
|
getUri(uri) {
|
|
168
|
-
if (uri.indexOf(
|
|
168
|
+
if (uri.indexOf('http://') === 0 || uri.indexOf('https://') === 0) {
|
|
169
169
|
return uri;
|
|
170
170
|
}
|
|
171
|
-
return this.options.apiEndpoint.replace(/\/+$/,
|
|
171
|
+
return this.options.apiEndpoint.replace(/\/+$/, '') + '/' + uri.replace(/^\/+/g, '');
|
|
172
172
|
}
|
|
173
173
|
createRequestData(action, parameters = null, method = 'GET', signWithOauthToken = true) {
|
|
174
174
|
const url = this.getUri(action);
|
|
@@ -6,7 +6,7 @@ export class AdapterConfiguration {
|
|
|
6
6
|
name;
|
|
7
7
|
description;
|
|
8
8
|
static parse(rawAdapter) {
|
|
9
|
-
|
|
9
|
+
const configuration = new AdapterConfiguration();
|
|
10
10
|
configuration.id = rawAdapter.id;
|
|
11
11
|
configuration.key = rawAdapter.key;
|
|
12
12
|
configuration.type = rawAdapter.type;
|
|
@@ -9,7 +9,7 @@ export class AdapterConnection {
|
|
|
9
9
|
this.configuration = new DataValueCollection();
|
|
10
10
|
}
|
|
11
11
|
static parse(rawAdapterConnection) {
|
|
12
|
-
|
|
12
|
+
const adapterConnection = new AdapterConnection();
|
|
13
13
|
adapterConnection.id = rawAdapterConnection.id;
|
|
14
14
|
adapterConnection.key = rawAdapterConnection.key;
|
|
15
15
|
adapterConnection.adapter = rawAdapterConnection.adapter;
|
package/dist/Model/Config.js
CHANGED
|
@@ -12,7 +12,7 @@ export class Config {
|
|
|
12
12
|
sensitive = true;
|
|
13
13
|
state = State.Active;
|
|
14
14
|
static parse(rawConfig) {
|
|
15
|
-
|
|
15
|
+
const config = new Config();
|
|
16
16
|
config.id = rawConfig.id;
|
|
17
17
|
config.projectId = rawConfig.project;
|
|
18
18
|
config.projectEnvironmentId = rawConfig.project_environment;
|
|
@@ -18,9 +18,7 @@ export class DataValueCollection extends JsonSerializable {
|
|
|
18
18
|
return result;
|
|
19
19
|
}
|
|
20
20
|
set(key, value) {
|
|
21
|
-
const existingIndex = this._values.findIndex((tag) =>
|
|
22
|
-
return tag.key === key;
|
|
23
|
-
});
|
|
21
|
+
const existingIndex = this._values.findIndex((tag) => tag.key === key);
|
|
24
22
|
if (existingIndex !== -1) {
|
|
25
23
|
this._values.splice(existingIndex);
|
|
26
24
|
}
|
|
@@ -35,9 +33,7 @@ export class DataValueCollection extends JsonSerializable {
|
|
|
35
33
|
return null;
|
|
36
34
|
}
|
|
37
35
|
unset(key) {
|
|
38
|
-
this._values = this._values.filter((tag) =>
|
|
39
|
-
return tag.key !== key;
|
|
40
|
-
});
|
|
36
|
+
this._values = this._values.filter((tag) => tag.key !== key);
|
|
41
37
|
}
|
|
42
38
|
serialize() {
|
|
43
39
|
if (this._values.length === 0) {
|
|
@@ -10,7 +10,7 @@ export class CodeSource {
|
|
|
10
10
|
description;
|
|
11
11
|
state = State.Active;
|
|
12
12
|
static parse(rawCodeSource) {
|
|
13
|
-
|
|
13
|
+
const codeSource = new CodeSource();
|
|
14
14
|
codeSource.id = rawCodeSource.id;
|
|
15
15
|
codeSource.codeSourceAccountId = rawCodeSource.code_source_account;
|
|
16
16
|
codeSource.repository = rawCodeSource.repository;
|
|
@@ -9,7 +9,7 @@ export class CodeSourceAccount {
|
|
|
9
9
|
// public refresh_token: string;
|
|
10
10
|
// public scopes: string;
|
|
11
11
|
static parse(rawSourcesAccount) {
|
|
12
|
-
|
|
12
|
+
const sourcesAccount = new CodeSourceAccount();
|
|
13
13
|
sourcesAccount.id = rawSourcesAccount.id;
|
|
14
14
|
sourcesAccount.key = rawSourcesAccount.key;
|
|
15
15
|
sourcesAccount.name = rawSourcesAccount.name;
|
|
@@ -5,7 +5,7 @@ export class CodeSourceBuildStrategy {
|
|
|
5
5
|
description;
|
|
6
6
|
state = State.Active;
|
|
7
7
|
static parse(raw) {
|
|
8
|
-
|
|
8
|
+
const codeDeployStrategy = new CodeSourceBuildStrategy();
|
|
9
9
|
codeDeployStrategy.id = raw.id;
|
|
10
10
|
codeDeployStrategy.name = raw.name;
|
|
11
11
|
codeDeployStrategy.description = raw.description;
|
|
@@ -5,7 +5,7 @@ export class CodeSourceRunStrategy {
|
|
|
5
5
|
description;
|
|
6
6
|
state = State.Active;
|
|
7
7
|
static parse(raw) {
|
|
8
|
-
|
|
8
|
+
const codeDeployStrategy = new CodeSourceRunStrategy();
|
|
9
9
|
codeDeployStrategy.id = raw.id;
|
|
10
10
|
codeDeployStrategy.name = raw.name;
|
|
11
11
|
codeDeployStrategy.description = raw.description;
|
|
@@ -2,7 +2,7 @@ export class SourcesAccountRepository {
|
|
|
2
2
|
key;
|
|
3
3
|
name;
|
|
4
4
|
static parse(rawSourcesAccountRepository) {
|
|
5
|
-
|
|
5
|
+
const sourcesAccountRepository = new SourcesAccountRepository();
|
|
6
6
|
sourcesAccountRepository.key = rawSourcesAccountRepository.key;
|
|
7
7
|
sourcesAccountRepository.name = rawSourcesAccountRepository.name;
|
|
8
8
|
return sourcesAccountRepository;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export class SourcesAccountRepositoryBranch {
|
|
2
2
|
key;
|
|
3
3
|
static parse(raw) {
|
|
4
|
-
|
|
4
|
+
const sourcesAccountRepositoryBranch = new SourcesAccountRepositoryBranch();
|
|
5
5
|
sourcesAccountRepositoryBranch.key = raw.key;
|
|
6
6
|
return sourcesAccountRepositoryBranch;
|
|
7
7
|
}
|
|
@@ -18,29 +18,27 @@ export class ClientError {
|
|
|
18
18
|
message = error.message;
|
|
19
19
|
}
|
|
20
20
|
let clientError = new ClientError(message);
|
|
21
|
-
//console.error(error);
|
|
21
|
+
// console.error(error);
|
|
22
22
|
if (error.status !== null && error.status !== undefined) {
|
|
23
23
|
const statusCode = error.status;
|
|
24
|
-
const body = error
|
|
24
|
+
const { body } = error;
|
|
25
25
|
const clientErrorByStatus = this.byStatus(statusCode, body);
|
|
26
26
|
if (clientErrorByStatus !== null) {
|
|
27
27
|
clientError = clientErrorByStatus;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
else {
|
|
31
|
-
if (error.code
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
clientError.code = error.code;
|
|
43
|
-
}
|
|
30
|
+
else if (error.code !== null && error.code !== undefined) {
|
|
31
|
+
if (error.code === 'EUNAVAILABLE') {
|
|
32
|
+
clientError.code = HttpClient.HTTP_UNAVAILABLE;
|
|
33
|
+
}
|
|
34
|
+
if (error.code === 'EAUTH') {
|
|
35
|
+
clientError.code = HttpClient.HTTP_UNAUTHORIZED;
|
|
36
|
+
}
|
|
37
|
+
// if (error.code === 'ESTATUS' && error.message === 'HTTP status 503') {
|
|
38
|
+
// clientError.code = HttpClient.HTTP_UNAVAILABLE;
|
|
39
|
+
// }
|
|
40
|
+
else {
|
|
41
|
+
clientError.code = error.code;
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
clientError.name = error.name;
|
|
@@ -53,37 +51,26 @@ export class ClientError {
|
|
|
53
51
|
case 201:
|
|
54
52
|
case 202:
|
|
55
53
|
return null;
|
|
56
|
-
break;
|
|
57
54
|
case 400:
|
|
58
55
|
return new ClientError('Bad Request', HttpClient.HTTP_BAD_REQUEST);
|
|
59
|
-
break;
|
|
60
56
|
case 401:
|
|
61
57
|
return new ClientError('Unauthorized', HttpClient.HTTP_UNAUTHORIZED);
|
|
62
|
-
break;
|
|
63
58
|
case 403:
|
|
64
59
|
return new ClientError('Forbidden', HttpClient.HTTP_FORBIDDEN);
|
|
65
|
-
break;
|
|
66
60
|
case 404:
|
|
67
61
|
return new ClientError('Not Found', HttpClient.HTTP_NOTFOUND);
|
|
68
|
-
break;
|
|
69
62
|
case 405:
|
|
70
63
|
return new ClientError('Not allowed', HttpClient.HTTP_NOT_ALLOWED);
|
|
71
|
-
break;
|
|
72
64
|
case 422:
|
|
73
65
|
return new ClientError('Unprocessable Entity', HttpClient.HTTP_UNPROCESSABLE_ENTITY);
|
|
74
|
-
break;
|
|
75
66
|
case 500:
|
|
76
67
|
return new ClientError('Internal Server Error', HttpClient.HTTP_INTERNAL_SERVER_ERROR);
|
|
77
|
-
break;
|
|
78
68
|
case 502:
|
|
79
69
|
return new ClientError('Bad gateway', HttpClient.HTTP_BAD_GATEWAY);
|
|
80
|
-
break;
|
|
81
70
|
case 503:
|
|
82
71
|
return new ClientError('Service not available', HttpClient.HTTP_UNAVAILABLE);
|
|
83
|
-
break;
|
|
84
72
|
case 504:
|
|
85
73
|
return new ClientError('Gateway Time-out', HttpClient.HTTP_TIMEOUT);
|
|
86
|
-
break;
|
|
87
74
|
default:
|
|
88
75
|
console.error('Unknown status code "' + statusCode + '"', { code: statusCode, text: statusText });
|
|
89
76
|
return new ClientError('Status code ' + statusCode + ': ' + statusText, statusCode);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export declare enum EventType {
|
|
2
|
-
/** @deprecated
|
|
2
|
+
/** @deprecated * */
|
|
3
3
|
TaskExecutionRequested,
|
|
4
|
-
/** @deprecated
|
|
4
|
+
/** @deprecated * */
|
|
5
5
|
TaskExecutionStarted,
|
|
6
|
-
/** @deprecated
|
|
6
|
+
/** @deprecated * */
|
|
7
7
|
TaskExecutionFailed,
|
|
8
|
-
/** @deprecated
|
|
8
|
+
/** @deprecated * */
|
|
9
9
|
TaskExecutionComplete,
|
|
10
|
-
/** @deprecated
|
|
10
|
+
/** @deprecated * */
|
|
11
11
|
TaskExecutionRetry,
|
|
12
12
|
FlowRunRequested,
|
|
13
13
|
FlowRunStarted,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export var EventType;
|
|
2
2
|
(function (EventType) {
|
|
3
|
-
/** @deprecated
|
|
4
|
-
EventType[EventType["TaskExecutionRequested"] =
|
|
5
|
-
/** @deprecated
|
|
6
|
-
EventType[EventType["TaskExecutionStarted"] =
|
|
7
|
-
/** @deprecated
|
|
8
|
-
EventType[EventType["TaskExecutionFailed"] =
|
|
9
|
-
/** @deprecated
|
|
10
|
-
EventType[EventType["TaskExecutionComplete"] =
|
|
11
|
-
/** @deprecated
|
|
12
|
-
EventType[EventType["TaskExecutionRetry"] =
|
|
13
|
-
EventType[EventType["FlowRunRequested"] =
|
|
14
|
-
EventType[EventType["FlowRunStarted"] =
|
|
15
|
-
EventType[EventType["FlowRunFailed"] =
|
|
16
|
-
EventType[EventType["FlowRunComplete"] =
|
|
17
|
-
EventType[EventType["FlowRunRetry"] =
|
|
3
|
+
/** @deprecated * */
|
|
4
|
+
EventType[EventType["TaskExecutionRequested"] = 'TaskExecutionRequested'] = "TaskExecutionRequested";
|
|
5
|
+
/** @deprecated * */
|
|
6
|
+
EventType[EventType["TaskExecutionStarted"] = 'TaskExecutionStarted'] = "TaskExecutionStarted";
|
|
7
|
+
/** @deprecated * */
|
|
8
|
+
EventType[EventType["TaskExecutionFailed"] = 'TaskExecutionFailed'] = "TaskExecutionFailed";
|
|
9
|
+
/** @deprecated * */
|
|
10
|
+
EventType[EventType["TaskExecutionComplete"] = 'TaskExecutionComplete'] = "TaskExecutionComplete";
|
|
11
|
+
/** @deprecated * */
|
|
12
|
+
EventType[EventType["TaskExecutionRetry"] = 'TaskExecutionRetry'] = "TaskExecutionRetry";
|
|
13
|
+
EventType[EventType["FlowRunRequested"] = 'FlowRunRequested'] = "FlowRunRequested";
|
|
14
|
+
EventType[EventType["FlowRunStarted"] = 'FlowRunStarted'] = "FlowRunStarted";
|
|
15
|
+
EventType[EventType["FlowRunFailed"] = 'FlowRunFailed'] = "FlowRunFailed";
|
|
16
|
+
EventType[EventType["FlowRunComplete"] = 'FlowRunComplete'] = "FlowRunComplete";
|
|
17
|
+
EventType[EventType["FlowRunRetry"] = 'FlowRunRetry'] = "FlowRunRetry";
|
|
18
18
|
})(EventType || (EventType = {}));
|
|
@@ -9,7 +9,7 @@ export declare class Flow extends MetaDataAware implements StateAware {
|
|
|
9
9
|
projectId: string;
|
|
10
10
|
isDirect: boolean;
|
|
11
11
|
state: State;
|
|
12
|
-
/** The maximum number of flows to run at any time (0 = no limit)
|
|
12
|
+
/** The maximum number of flows to run at any time (0 = no limit) * */
|
|
13
13
|
parallelLimit: number;
|
|
14
14
|
codeSource: string | null;
|
|
15
15
|
static parse(rawFlow: any): Flow;
|
package/dist/Model/Flow/Flow.js
CHANGED
|
@@ -10,7 +10,7 @@ export class Flow extends MetaDataAware {
|
|
|
10
10
|
projectId;
|
|
11
11
|
isDirect = false;
|
|
12
12
|
state = State.Active;
|
|
13
|
-
/** The maximum number of flows to run at any time (0 = no limit)
|
|
13
|
+
/** The maximum number of flows to run at any time (0 = no limit) * */
|
|
14
14
|
parallelLimit = 0;
|
|
15
15
|
codeSource = null;
|
|
16
16
|
static parse(rawFlow) {
|
|
@@ -16,7 +16,7 @@ export class FlowRun extends MetaDataAware {
|
|
|
16
16
|
logLevelCount;
|
|
17
17
|
logsPurged = false;
|
|
18
18
|
static parse(rawFlowRun) {
|
|
19
|
-
|
|
19
|
+
const flowRun = new FlowRun();
|
|
20
20
|
flowRun.id = rawFlowRun.id;
|
|
21
21
|
flowRun.flowId = rawFlowRun.flow;
|
|
22
22
|
flowRun.arguments = rawFlowRun.arguments;
|
|
@@ -5,7 +5,7 @@ export class FlowRunHistory {
|
|
|
5
5
|
time;
|
|
6
6
|
status;
|
|
7
7
|
static parse(rawFlowRunHistory) {
|
|
8
|
-
|
|
8
|
+
const flowRunHistory = new FlowRunHistory();
|
|
9
9
|
flowRunHistory.id = rawFlowRunHistory.id;
|
|
10
10
|
flowRunHistory.time = Utils.parseRawDate(rawFlowRunHistory.time);
|
|
11
11
|
flowRunHistory.status = FlowRunStatus.fromString(rawFlowRunHistory.status);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Utils } from '../../Utils.js';
|
|
2
2
|
export var FlowRunStatus;
|
|
3
3
|
(function (FlowRunStatus) {
|
|
4
|
-
FlowRunStatus[FlowRunStatus["Unknown"] =
|
|
5
|
-
FlowRunStatus[FlowRunStatus["Pending"] =
|
|
6
|
-
FlowRunStatus[FlowRunStatus["Canceled"] =
|
|
7
|
-
FlowRunStatus[FlowRunStatus["Running"] =
|
|
8
|
-
FlowRunStatus[FlowRunStatus["Failed"] =
|
|
9
|
-
FlowRunStatus[FlowRunStatus["Stopped"] =
|
|
10
|
-
FlowRunStatus[FlowRunStatus["Complete"] =
|
|
4
|
+
FlowRunStatus[FlowRunStatus["Unknown"] = 'unknown'] = "Unknown";
|
|
5
|
+
FlowRunStatus[FlowRunStatus["Pending"] = 'pending'] = "Pending";
|
|
6
|
+
FlowRunStatus[FlowRunStatus["Canceled"] = 'canceled'] = "Canceled";
|
|
7
|
+
FlowRunStatus[FlowRunStatus["Running"] = 'running'] = "Running";
|
|
8
|
+
FlowRunStatus[FlowRunStatus["Failed"] = 'failed'] = "Failed";
|
|
9
|
+
FlowRunStatus[FlowRunStatus["Stopped"] = 'stopped'] = "Stopped";
|
|
10
|
+
FlowRunStatus[FlowRunStatus["Complete"] = 'complete'] = "Complete";
|
|
11
11
|
})(FlowRunStatus || (FlowRunStatus = {}));
|
|
12
12
|
(function (FlowRunStatus) {
|
|
13
13
|
function fromString(input) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlowRunStatus } from
|
|
1
|
+
import { FlowRunStatus } from './FlowRunStatus.js';
|
|
2
2
|
import { FlowRun } from './FlowRun.js';
|
|
3
3
|
import { Utils } from '../../Utils.js';
|
|
4
4
|
export class FlowRunSummary extends FlowRun {
|
|
@@ -7,7 +7,7 @@ export class FlowRunSummary extends FlowRun {
|
|
|
7
7
|
pendingDuration;
|
|
8
8
|
status = FlowRunStatus.Unknown;
|
|
9
9
|
static parse(rawFlowRunSummary) {
|
|
10
|
-
|
|
10
|
+
const flowRunSummary = FlowRun.parse(rawFlowRunSummary);
|
|
11
11
|
flowRunSummary.time = Utils.parseRawDate(rawFlowRunSummary.time);
|
|
12
12
|
flowRunSummary.runDuration = rawFlowRunSummary.run_duration;
|
|
13
13
|
flowRunSummary.pendingDuration = rawFlowRunSummary.pending_duration;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlowRunStatus } from
|
|
1
|
+
import { FlowRunStatus } from './FlowRunStatus.js';
|
|
2
2
|
import { Flow } from './Flow.js';
|
|
3
3
|
import { Utils } from '../../Utils.js';
|
|
4
4
|
export class FlowSummary extends Flow {
|
|
@@ -8,7 +8,7 @@ export class FlowSummary extends Flow {
|
|
|
8
8
|
averagePendingDuration = null;
|
|
9
9
|
runCount = 0;
|
|
10
10
|
static parse(rawFlowSummary) {
|
|
11
|
-
|
|
11
|
+
const flowSummary = Flow.parse(rawFlowSummary);
|
|
12
12
|
flowSummary.status = FlowRunStatus.fromString(rawFlowSummary.status);
|
|
13
13
|
flowSummary.latestRun = rawFlowSummary.latest_run === null ? null : Utils.parseRawDate(rawFlowSummary.latest_run);
|
|
14
14
|
flowSummary.averageRunDuration = rawFlowSummary.average_run_duration;
|
|
@@ -14,7 +14,7 @@ export class HealthAlert {
|
|
|
14
14
|
this.data = [];
|
|
15
15
|
}
|
|
16
16
|
static parse(raw) {
|
|
17
|
-
|
|
17
|
+
const healthAlert = new HealthAlert(HealthTestType.fromString(raw.health_test_type), HealthAlertStatus.fromString(raw.status));
|
|
18
18
|
healthAlert.id = raw.id;
|
|
19
19
|
healthAlert.date = Utils.parseRawDate(raw.date);
|
|
20
20
|
healthAlert.data = raw.data;
|
|
@@ -2,7 +2,7 @@ export declare enum HealthTestType {
|
|
|
2
2
|
PROJECT_ENVIRONMENT_HAS_WORKERS = "project_environment_has_workers",
|
|
3
3
|
QUEUE_FLOW_IS_HEALTHY = "queue_flow_is_healthy",
|
|
4
4
|
WORKER_IS_UP_TO_DATE = "worker_is_up_to_date",
|
|
5
|
-
/** @deprecated
|
|
5
|
+
/** @deprecated * */
|
|
6
6
|
TASK_EXECUTIONS_ARE_SUCCESSFUL = "task_executions_are_successful",
|
|
7
7
|
FLOW_RUNS_ARE_SUCCESSFUL = "flow_runs_are_successful"
|
|
8
8
|
}
|
|
@@ -4,7 +4,7 @@ export var HealthTestType;
|
|
|
4
4
|
HealthTestType["PROJECT_ENVIRONMENT_HAS_WORKERS"] = "project_environment_has_workers";
|
|
5
5
|
HealthTestType["QUEUE_FLOW_IS_HEALTHY"] = "queue_flow_is_healthy";
|
|
6
6
|
HealthTestType["WORKER_IS_UP_TO_DATE"] = "worker_is_up_to_date";
|
|
7
|
-
/** @deprecated
|
|
7
|
+
/** @deprecated * */
|
|
8
8
|
HealthTestType["TASK_EXECUTIONS_ARE_SUCCESSFUL"] = "task_executions_are_successful";
|
|
9
9
|
HealthTestType["FLOW_RUNS_ARE_SUCCESSFUL"] = "flow_runs_are_successful";
|
|
10
10
|
})(HealthTestType || (HealthTestType = {}));
|
package/dist/Model/Log/Log.d.ts
CHANGED
package/dist/Model/Log/Log.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LogLevel } from
|
|
1
|
+
import { LogLevel } from './LogLevel.js';
|
|
2
2
|
import { LogStreamId } from './LogStreamId.js';
|
|
3
3
|
import { LogStatus } from './LogStatus.js';
|
|
4
4
|
import { DataValueCollection } from '../DataValueCollection.js';
|
|
@@ -24,7 +24,7 @@ export class Log {
|
|
|
24
24
|
const date = Utils.parseRawDate(rawLog.date);
|
|
25
25
|
const level = LogLevel.fromString(rawLog.level);
|
|
26
26
|
const logStream = new LogStreamId(rawLog.log_stream.id);
|
|
27
|
-
|
|
27
|
+
const log = new Log(logStream, rawLog.message, level, date);
|
|
28
28
|
log.id = rawLog.id;
|
|
29
29
|
log.context = rawLog.context;
|
|
30
30
|
if (rawLog.status !== null && rawLog.status !== undefined && rawLog.status !== '') {
|