attlaz-client 1.8.30 → 1.9.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/dist/Client.d.ts +17 -16
- package/dist/Client.js +40 -29
- package/dist/Http/OAuthClient.d.ts +1 -1
- package/dist/Http/OAuthClient.js +9 -9
- package/dist/Http/OAuthClient.spec.js +1 -1
- package/dist/Http/OAuthClientOptions.d.ts +6 -1
- package/dist/Http/OAuthClientOptions.js +2 -1
- package/dist/Model/Adapter/Adapter.js +1 -1
- package/dist/Model/Config.d.ts +3 -3
- package/dist/Model/Config.js +3 -3
- package/dist/Model/DataValue.d.ts +1 -1
- package/dist/Model/{Task.d.ts → Flow/Flow.d.ts} +4 -4
- package/dist/Model/Flow/Flow.js +26 -0
- package/dist/Model/Flow/FlowRun.d.ts +15 -0
- package/dist/Model/Flow/FlowRun.js +28 -0
- package/dist/Model/Flow/FlowRunHistory.d.ts +7 -0
- package/dist/Model/Flow/FlowRunHistory.js +14 -0
- package/dist/Model/Flow/FlowRunPriority.d.ts +9 -0
- package/dist/Model/Flow/FlowRunPriority.js +21 -0
- package/dist/Model/Flow/FlowRunResponse.d.ts +6 -0
- package/dist/Model/Flow/FlowRunResponse.js +6 -0
- package/dist/Model/{TaskExecution/TaskExecutionStats.d.ts → Flow/FlowRunStats.d.ts} +2 -2
- package/dist/Model/{TaskExecution/TaskExecutionStats.js → Flow/FlowRunStats.js} +3 -3
- package/dist/Model/Flow/FlowRunStatus.d.ts +12 -0
- package/dist/Model/Flow/FlowRunStatus.js +24 -0
- package/dist/Model/Flow/FlowRunSummary.d.ts +9 -0
- package/dist/Model/Flow/FlowRunSummary.js +24 -0
- package/dist/Model/Flow/FlowSummary.d.ts +10 -0
- package/dist/Model/Flow/FlowSummary.js +26 -0
- package/dist/Model/Notification.d.ts +1 -1
- package/dist/Model/Result/CollectionResult.d.ts +7 -0
- package/dist/Model/Result/CollectionResult.js +29 -0
- package/dist/Model/Result/DataResult.d.ts +4 -1
- package/dist/Model/Result/DataResult.js +19 -10
- package/dist/Model/Result/ObjectResult.d.ts +6 -0
- package/dist/Model/Result/{DataResultCollection.js → ObjectResult.js} +3 -4
- package/dist/Model/Trigger/Trigger.d.ts +3 -3
- package/dist/Model/Trigger/Trigger.js +5 -5
- package/dist/Model/{Team/Team.d.ts → Workspace/Workspace.d.ts} +2 -2
- package/dist/Model/{Team/Team.js → Workspace/Workspace.js} +4 -4
- package/dist/Model/Workspace/WorkspaceMember.d.ts +12 -0
- package/dist/Model/{Team/TeamMember.js → Workspace/WorkspaceMember.js} +3 -3
- package/dist/Model/Workspace/WorkspaceMemberInvite.d.ts +14 -0
- package/dist/Model/Workspace/WorkspaceMemberInvite.js +10 -0
- package/dist/Model/Workspace/WorkspaceMemberInvite2.d.ts +10 -0
- package/dist/Model/Workspace/WorkspaceMemberInvite2.js +17 -0
- package/dist/Model/Workspace/WorkspaceMemberInviteState.d.ts +11 -0
- package/dist/Model/Workspace/WorkspaceMemberInviteState.js +23 -0
- package/dist/Model/Workspace/WorkspaceMemberRole.d.ts +11 -0
- package/dist/Model/Workspace/WorkspaceMemberRole.js +23 -0
- package/dist/Service/AdapterEndpoint.d.ts +8 -7
- package/dist/Service/AdapterEndpoint.js +10 -16
- package/dist/Service/ChannelEndpoint.d.ts +7 -7
- package/dist/Service/ChannelEndpoint.js +32 -36
- package/dist/Service/ConfigEndpoint.d.ts +4 -3
- package/dist/Service/ConfigEndpoint.js +33 -45
- package/dist/Service/Endpoint.d.ts +4 -0
- package/dist/Service/Endpoint.js +48 -0
- package/dist/Service/FlowEndpoint.d.ts +11 -0
- package/dist/Service/FlowEndpoint.js +92 -0
- package/dist/Service/FlowRunEndpoint.d.ts +13 -0
- package/dist/Service/FlowRunEndpoint.js +92 -0
- package/dist/Service/FlowRunRequestEndpoint.d.ts +5 -0
- package/dist/Service/{TaskExecutionRequestEndpoint.js → FlowRunRequestEndpoint.js} +4 -4
- package/dist/Service/FlowRunStatsEndpoint.d.ts +5 -0
- package/dist/Service/FlowRunStatsEndpoint.js +28 -0
- package/dist/Service/LogEndpoint.d.ts +2 -2
- package/dist/Service/LogEndpoint.js +27 -41
- package/dist/Service/NotificationsEndpoint.d.ts +2 -1
- package/dist/Service/NotificationsEndpoint.js +20 -37
- package/dist/Service/PlatformEndpoint.d.ts +3 -3
- package/dist/Service/PlatformEndpoint.js +2 -4
- package/dist/Service/PlatformLanguageEndpoint.d.ts +2 -2
- package/dist/Service/PlatformLanguageEndpoint.js +1 -3
- package/dist/Service/ProjectDeployEndpoint.d.ts +2 -1
- package/dist/Service/ProjectDeployEndpoint.js +7 -25
- package/dist/Service/ProjectEndpoint.d.ts +3 -2
- package/dist/Service/ProjectEndpoint.js +20 -17
- package/dist/Service/ProjectEnvironmentEndpoint.d.ts +2 -1
- package/dist/Service/ProjectEnvironmentEndpoint.js +10 -13
- package/dist/Service/QueueEndpoint.d.ts +1 -2
- package/dist/Service/QueueEndpoint.js +2 -9
- package/dist/Service/SourcesAccountEndpoint.d.ts +4 -3
- package/dist/Service/SourcesAccountEndpoint.js +12 -23
- package/dist/Service/SubscriberEndpoint.d.ts +4 -3
- package/dist/Service/SubscriberEndpoint.js +18 -46
- package/dist/Service/TriggerEndpoint.d.ts +3 -2
- package/dist/Service/TriggerEndpoint.js +12 -15
- package/dist/Service/UserEndpoint.d.ts +4 -6
- package/dist/Service/UserEndpoint.js +22 -20
- package/dist/Service/WorkerConfigEndpoint.d.ts +2 -1
- package/dist/Service/WorkerConfigEndpoint.js +8 -17
- package/dist/Service/WorkerEndpoint.d.ts +2 -3
- package/dist/Service/WorkerEndpoint.js +11 -8
- package/dist/Service/WorkspaceEndpoint.d.ts +6 -0
- package/dist/Service/WorkspaceEndpoint.js +20 -0
- package/dist/Service/WorkspaceMemberEndpoint.d.ts +14 -0
- package/dist/Service/{TeamMemberEndpoint.js → WorkspaceMemberEndpoint.js} +22 -31
- package/dist/Utils.spec.js +2 -2
- package/dist/auth.spec.js +14 -2
- package/dist/data.spec.js +5 -2
- package/dist/index.d.ts +22 -21
- package/dist/index.js +44 -43
- package/dist/test.js +3 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/Model/Result/DataResultCollection.d.ts +0 -6
- package/dist/Model/Task.js +0 -39
- package/dist/Model/TaskExecution.d.ts +0 -14
- package/dist/Model/TaskExecution.js +0 -39
- package/dist/Model/TaskExecutionHistory.d.ts +0 -7
- package/dist/Model/TaskExecutionHistory.js +0 -14
- package/dist/Model/TaskExecutionResponse.d.ts +0 -6
- package/dist/Model/TaskExecutionResponse.js +0 -6
- package/dist/Model/TaskExecutionStatus.d.ts +0 -12
- package/dist/Model/TaskExecutionStatus.js +0 -24
- package/dist/Model/TaskExecutionSummary.d.ts +0 -8
- package/dist/Model/TaskExecutionSummary.js +0 -23
- package/dist/Model/TaskSummary.d.ts +0 -9
- package/dist/Model/TaskSummary.js +0 -26
- package/dist/Model/Team/TeamMember.d.ts +0 -12
- package/dist/Model/Team/TeamMemberInvite.d.ts +0 -14
- package/dist/Model/Team/TeamMemberInvite.js +0 -10
- package/dist/Model/Team/TeamMemberInvite2.d.ts +0 -9
- package/dist/Model/Team/TeamMemberInvite2.js +0 -6
- package/dist/Model/Team/TeamMemberInviteState.d.ts +0 -11
- package/dist/Model/Team/TeamMemberInviteState.js +0 -23
- package/dist/Model/Team/TeamMemberRole.d.ts +0 -10
- package/dist/Model/Team/TeamMemberRole.js +0 -22
- package/dist/Service/TaskEndpoint.d.ts +0 -10
- package/dist/Service/TaskEndpoint.js +0 -97
- package/dist/Service/TaskExecutionEndpoint.d.ts +0 -12
- package/dist/Service/TaskExecutionEndpoint.js +0 -121
- package/dist/Service/TaskExecutionRequestEndpoint.d.ts +0 -5
- package/dist/Service/TaskExecutionStatsEndpoint.d.ts +0 -6
- package/dist/Service/TaskExecutionStatsEndpoint.js +0 -21
- package/dist/Service/TeamMemberEndpoint.d.ts +0 -13
- package/dist/Service/TeamsEndpoint.d.ts +0 -5
- package/dist/Service/TeamsEndpoint.js +0 -21
package/dist/Client.d.ts
CHANGED
|
@@ -3,15 +3,15 @@ import { WorkerEndpoint } from './Service/WorkerEndpoint';
|
|
|
3
3
|
import { AdapterEndpoint } from './Service/AdapterEndpoint';
|
|
4
4
|
import { ProjectEnvironmentEndpoint } from './Service/ProjectEnvironmentEndpoint';
|
|
5
5
|
import { ProjectEndpoint } from './Service/ProjectEndpoint';
|
|
6
|
-
import {
|
|
6
|
+
import { FlowRunRequestEndpoint } from './Service/FlowRunRequestEndpoint';
|
|
7
7
|
import { OAuthClient } from './Http/OAuthClient';
|
|
8
8
|
import { WorkerConfigEndpoint } from './Service/WorkerConfigEndpoint';
|
|
9
|
-
import {
|
|
9
|
+
import { WorkspaceEndpoint } from './Service/WorkspaceEndpoint';
|
|
10
10
|
import { UserEndpoint } from './Service/UserEndpoint';
|
|
11
11
|
import { ConfigEndpoint } from './Service/ConfigEndpoint';
|
|
12
12
|
import { SubscriberEndpoint } from './Service/SubscriberEndpoint';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { FlowEndpoint } from './Service/FlowEndpoint';
|
|
14
|
+
import { WorkspaceMemberEndpoint } from './Service/WorkspaceMemberEndpoint';
|
|
15
15
|
import { StorageEndpoint } from './Service/StorageEndpoint';
|
|
16
16
|
import { QueueEndpoint } from './Service/QueueEndpoint';
|
|
17
17
|
import { NotificationsEndpoint } from './Service/NotificationsEndpoint';
|
|
@@ -20,19 +20,20 @@ import { SourcesAccountEndpoint } from './Service/SourcesAccountEndpoint';
|
|
|
20
20
|
import { PlatformLanguageEndpoint } from './Service/PlatformLanguageEndpoint';
|
|
21
21
|
import { ChannelEndpoint } from './Service/ChannelEndpoint';
|
|
22
22
|
import { HealthAlertEndpoint } from './Service/HealthAlertEndpoint';
|
|
23
|
-
import {
|
|
23
|
+
import { FlowRunEndpoint } from './Service/FlowRunEndpoint';
|
|
24
24
|
import { LogEndpoint } from './Service/LogEndpoint';
|
|
25
25
|
import { TriggerEndpoint } from './Service/TriggerEndpoint';
|
|
26
26
|
import { PlatformEndpoint } from './Service/PlatformEndpoint';
|
|
27
|
-
import {
|
|
27
|
+
import { FlowRunStatsEndpoint } from './Service/FlowRunStatsEndpoint';
|
|
28
28
|
export declare class Client {
|
|
29
|
-
private apiEndpoint;
|
|
30
|
-
private clientId;
|
|
31
|
-
private clientSecret;
|
|
29
|
+
private readonly apiEndpoint;
|
|
30
|
+
private readonly clientId;
|
|
31
|
+
private readonly clientSecret;
|
|
32
32
|
private endpoints;
|
|
33
|
+
private readonly httpClient;
|
|
33
34
|
private Store;
|
|
34
|
-
private httpClient;
|
|
35
35
|
constructor(apiEndpoint: string, clientId: string, clientSecret: string);
|
|
36
|
+
private getHeaders;
|
|
36
37
|
getHttpClient(): OAuthClient;
|
|
37
38
|
authenticate(): Promise<boolean>;
|
|
38
39
|
authenticate(username: string, password: string): Promise<boolean>;
|
|
@@ -53,14 +54,14 @@ export declare class Client {
|
|
|
53
54
|
getPlatformEndpoint(): PlatformEndpoint;
|
|
54
55
|
getSubscriberEndpoint(): SubscriberEndpoint;
|
|
55
56
|
getLogEndPoint(): LogEndpoint;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
getTaskExecutionStatsEndpoint():
|
|
60
|
-
|
|
57
|
+
getFlowEndpoint(): FlowEndpoint;
|
|
58
|
+
getFlowRunEndpoint(): FlowRunEndpoint;
|
|
59
|
+
getFlowRunRequestEndpoint(): FlowRunRequestEndpoint;
|
|
60
|
+
getTaskExecutionStatsEndpoint(): FlowRunStatsEndpoint;
|
|
61
|
+
getWorkspaceEndpoint(): WorkspaceEndpoint;
|
|
61
62
|
getTriggerEndpoint(): TriggerEndpoint;
|
|
62
63
|
getUserEndpoint(): UserEndpoint;
|
|
63
|
-
|
|
64
|
+
getWorkspaceMemberEndpoint(): WorkspaceMemberEndpoint;
|
|
64
65
|
getWorkerEndpoint(): WorkerEndpoint;
|
|
65
66
|
getSourcesAccountEndpoint(): SourcesAccountEndpoint;
|
|
66
67
|
getLanguageEndpoint(): PlatformLanguageEndpoint;
|
package/dist/Client.js
CHANGED
|
@@ -5,15 +5,15 @@ const WorkerEndpoint_1 = require("./Service/WorkerEndpoint");
|
|
|
5
5
|
const AdapterEndpoint_1 = require("./Service/AdapterEndpoint");
|
|
6
6
|
const ProjectEnvironmentEndpoint_1 = require("./Service/ProjectEnvironmentEndpoint");
|
|
7
7
|
const ProjectEndpoint_1 = require("./Service/ProjectEndpoint");
|
|
8
|
-
const
|
|
8
|
+
const FlowRunRequestEndpoint_1 = require("./Service/FlowRunRequestEndpoint");
|
|
9
9
|
const OAuthClient_1 = require("./Http/OAuthClient");
|
|
10
10
|
const WorkerConfigEndpoint_1 = require("./Service/WorkerConfigEndpoint");
|
|
11
|
-
const
|
|
11
|
+
const WorkspaceEndpoint_1 = require("./Service/WorkspaceEndpoint");
|
|
12
12
|
const UserEndpoint_1 = require("./Service/UserEndpoint");
|
|
13
13
|
const ConfigEndpoint_1 = require("./Service/ConfigEndpoint");
|
|
14
14
|
const SubscriberEndpoint_1 = require("./Service/SubscriberEndpoint");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
15
|
+
const FlowEndpoint_1 = require("./Service/FlowEndpoint");
|
|
16
|
+
const WorkspaceMemberEndpoint_1 = require("./Service/WorkspaceMemberEndpoint");
|
|
17
17
|
const StorageEndpoint_1 = require("./Service/StorageEndpoint");
|
|
18
18
|
const QueueEndpoint_1 = require("./Service/QueueEndpoint");
|
|
19
19
|
const NotificationsEndpoint_1 = require("./Service/NotificationsEndpoint");
|
|
@@ -23,14 +23,13 @@ const OAuthClientOptions_1 = require("./Http/OAuthClientOptions");
|
|
|
23
23
|
const PlatformLanguageEndpoint_1 = require("./Service/PlatformLanguageEndpoint");
|
|
24
24
|
const ChannelEndpoint_1 = require("./Service/ChannelEndpoint");
|
|
25
25
|
const HealthAlertEndpoint_1 = require("./Service/HealthAlertEndpoint");
|
|
26
|
-
const
|
|
26
|
+
const FlowRunEndpoint_1 = require("./Service/FlowRunEndpoint");
|
|
27
27
|
const LogEndpoint_1 = require("./Service/LogEndpoint");
|
|
28
28
|
const TriggerEndpoint_1 = require("./Service/TriggerEndpoint");
|
|
29
29
|
const PlatformEndpoint_1 = require("./Service/PlatformEndpoint");
|
|
30
|
-
const
|
|
30
|
+
const FlowRunStatsEndpoint_1 = require("./Service/FlowRunStatsEndpoint");
|
|
31
|
+
const version_1 = require("./version");
|
|
31
32
|
class Client {
|
|
32
|
-
// private test: Map<string, any>;
|
|
33
|
-
// private socketService;
|
|
34
33
|
constructor(apiEndpoint, clientId, clientSecret) {
|
|
35
34
|
this.apiEndpoint = apiEndpoint;
|
|
36
35
|
this.clientId = clientId;
|
|
@@ -47,22 +46,22 @@ class Client {
|
|
|
47
46
|
NotificationsEndpoint: NotificationsEndpoint_1.NotificationsEndpoint,
|
|
48
47
|
SubscriberEndpoint: SubscriberEndpoint_1.SubscriberEndpoint,
|
|
49
48
|
LogEndpoint: LogEndpoint_1.LogEndpoint,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
FlowEndpoint: FlowEndpoint_1.FlowEndpoint,
|
|
50
|
+
FlowRunEndpoint: FlowRunEndpoint_1.FlowRunEndpoint,
|
|
51
|
+
FlowRunRequestEndpoint: FlowRunRequestEndpoint_1.FlowRunRequestEndpoint,
|
|
52
|
+
WorkspaceEndpoint: WorkspaceEndpoint_1.WorkspaceEndpoint,
|
|
54
53
|
TriggerEndpoint: TriggerEndpoint_1.TriggerEndpoint,
|
|
55
54
|
UserEndpoint: UserEndpoint_1.UserEndpoint,
|
|
56
|
-
|
|
55
|
+
WorkspaceMemberEndpoint: WorkspaceMemberEndpoint_1.WorkspaceMemberEndpoint,
|
|
57
56
|
SourcesAccountEndpoint: SourcesAccountEndpoint_1.SourcesAccountEndpoint,
|
|
58
|
-
|
|
57
|
+
PlatformLanguageEndpoint: PlatformLanguageEndpoint_1.PlatformLanguageEndpoint,
|
|
59
58
|
StorageEndpoint: StorageEndpoint_1.StorageEndpoint,
|
|
60
59
|
WorkerConfigEndpoint: WorkerConfigEndpoint_1.WorkerConfigEndpoint,
|
|
61
60
|
HealthAlertEndpoint: HealthAlertEndpoint_1.HealthAlertEndpoint,
|
|
62
61
|
PlatformEndpoint: PlatformEndpoint_1.PlatformEndpoint,
|
|
63
|
-
|
|
62
|
+
FlowRunStatsEndpoint: FlowRunStatsEndpoint_1.FlowRunStatsEndpoint
|
|
64
63
|
};
|
|
65
|
-
const options = new OAuthClientOptions_1.OAuthClientOptions(apiEndpoint, clientId, clientSecret);
|
|
64
|
+
const options = new OAuthClientOptions_1.OAuthClientOptions(apiEndpoint, clientId, clientSecret, this.getHeaders());
|
|
66
65
|
this.httpClient = new OAuthClient_1.OAuthClient(options);
|
|
67
66
|
this.endpoints = new Map();
|
|
68
67
|
// this.test = new Map<string, any>();
|
|
@@ -74,6 +73,18 @@ class Client {
|
|
|
74
73
|
// console.log('Incoming:', data);
|
|
75
74
|
// });
|
|
76
75
|
}
|
|
76
|
+
getHeaders() {
|
|
77
|
+
const userAgentInfo = {
|
|
78
|
+
version: version_1.VERSION,
|
|
79
|
+
language: 'Javascript',
|
|
80
|
+
language_version: '',
|
|
81
|
+
publisher: 'Attlaz'
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
'User-Agent': 'Attlaz Javascript Client/' + version_1.VERSION,
|
|
85
|
+
'X-Attlaz-Client-User-Agent': JSON.stringify(userAgentInfo)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
77
88
|
getHttpClient() {
|
|
78
89
|
return this.httpClient;
|
|
79
90
|
}
|
|
@@ -127,7 +138,7 @@ class Client {
|
|
|
127
138
|
return this.getEndpoint('config', this.Store.ConfigEndpoint);
|
|
128
139
|
}
|
|
129
140
|
getNotificationsEndpoint() {
|
|
130
|
-
return this.getEndpoint('
|
|
141
|
+
return this.getEndpoint('notification', this.Store.NotificationsEndpoint);
|
|
131
142
|
}
|
|
132
143
|
getPlatformEndpoint() {
|
|
133
144
|
return this.getEndpoint('platform', this.Store.PlatformEndpoint);
|
|
@@ -138,20 +149,20 @@ class Client {
|
|
|
138
149
|
getLogEndPoint() {
|
|
139
150
|
return this.getEndpoint('log', this.Store.LogEndpoint);
|
|
140
151
|
}
|
|
141
|
-
|
|
142
|
-
return this.getEndpoint('task', this.Store.
|
|
152
|
+
getFlowEndpoint() {
|
|
153
|
+
return this.getEndpoint('task', this.Store.FlowEndpoint);
|
|
143
154
|
}
|
|
144
|
-
|
|
145
|
-
return this.getEndpoint('
|
|
155
|
+
getFlowRunEndpoint() {
|
|
156
|
+
return this.getEndpoint('flowrun', this.Store.FlowRunEndpoint);
|
|
146
157
|
}
|
|
147
|
-
|
|
148
|
-
return this.getEndpoint('
|
|
158
|
+
getFlowRunRequestEndpoint() {
|
|
159
|
+
return this.getEndpoint('flowrunrequest', this.Store.FlowRunRequestEndpoint);
|
|
149
160
|
}
|
|
150
161
|
getTaskExecutionStatsEndpoint() {
|
|
151
|
-
return this.getEndpoint('
|
|
162
|
+
return this.getEndpoint('flowrunstats', this.Store.FlowRunStatsEndpoint);
|
|
152
163
|
}
|
|
153
|
-
|
|
154
|
-
return this.getEndpoint('
|
|
164
|
+
getWorkspaceEndpoint() {
|
|
165
|
+
return this.getEndpoint('workspaces', this.Store.WorkspaceEndpoint);
|
|
155
166
|
}
|
|
156
167
|
getTriggerEndpoint() {
|
|
157
168
|
return this.getEndpoint('trigger', this.Store.TriggerEndpoint);
|
|
@@ -159,8 +170,8 @@ class Client {
|
|
|
159
170
|
getUserEndpoint() {
|
|
160
171
|
return this.getEndpoint('user', this.Store.UserEndpoint);
|
|
161
172
|
}
|
|
162
|
-
|
|
163
|
-
return this.getEndpoint('member', this.Store.
|
|
173
|
+
getWorkspaceMemberEndpoint() {
|
|
174
|
+
return this.getEndpoint('member', this.Store.WorkspaceMemberEndpoint);
|
|
164
175
|
}
|
|
165
176
|
getWorkerEndpoint() {
|
|
166
177
|
return this.getEndpoint('worker', this.Store.WorkerEndpoint);
|
|
@@ -169,7 +180,7 @@ class Client {
|
|
|
169
180
|
return this.getEndpoint('sourcesaccount', this.Store.SourcesAccountEndpoint);
|
|
170
181
|
}
|
|
171
182
|
getLanguageEndpoint() {
|
|
172
|
-
return this.getEndpoint('language', this.Store.
|
|
183
|
+
return this.getEndpoint('language', this.Store.PlatformLanguageEndpoint);
|
|
173
184
|
}
|
|
174
185
|
getStorageEndpoint() {
|
|
175
186
|
return this.getEndpoint('storage', this.Store.StorageEndpoint);
|
package/dist/Http/OAuthClient.js
CHANGED
|
@@ -12,20 +12,20 @@ const client_oauth2_1 = __importDefault(require("client-oauth2"));
|
|
|
12
12
|
const JsonSerializable_1 = require("../Model/JsonSerializable");
|
|
13
13
|
class OAuthClient {
|
|
14
14
|
constructor(options) {
|
|
15
|
+
this.options = options;
|
|
15
16
|
this.debug = false;
|
|
16
17
|
this.oauthToken = null;
|
|
17
18
|
this.oathClientToken = null;
|
|
18
19
|
this.refreshTokenPromise = null;
|
|
19
|
-
this.options = options;
|
|
20
|
-
//
|
|
21
20
|
this.oauthClient = new client_oauth2_1.default({
|
|
22
|
-
clientId:
|
|
23
|
-
clientSecret:
|
|
24
|
-
accessTokenUri: this.getUri(
|
|
25
|
-
authorizationUri: this.getUri(
|
|
26
|
-
redirectUri:
|
|
27
|
-
scopes:
|
|
28
|
-
state:
|
|
21
|
+
clientId: options.clientId,
|
|
22
|
+
clientSecret: options.clientSecret,
|
|
23
|
+
accessTokenUri: this.getUri(options.accessTokenUri),
|
|
24
|
+
authorizationUri: this.getUri(options.authorizationUri),
|
|
25
|
+
redirectUri: options.redirectUri,
|
|
26
|
+
scopes: options.scopes,
|
|
27
|
+
state: options.state,
|
|
28
|
+
headers: options.headers
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
async authenticate(username = null, password = null) {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const OAuthClient_1 = require("./OAuthClient");
|
|
4
4
|
const OAuthClientOptions_1 = require("./OAuthClientOptions");
|
|
5
5
|
test('Test enum parsing', async () => {
|
|
6
|
-
const options = new OAuthClientOptions_1.OAuthClientOptions('https://github.com/login', '3b938da6f58d6bef7d59', 'da05698a6bd449de9437e11ff0b99003f511e40f');
|
|
6
|
+
const options = new OAuthClientOptions_1.OAuthClientOptions('https://github.com/login', '3b938da6f58d6bef7d59', 'da05698a6bd449de9437e11ff0b99003f511e40f', { 'User-Agent': 'Attlaz Javascript Client/testing' });
|
|
7
7
|
const client = new OAuthClient_1.OAuthClient(options);
|
|
8
8
|
// client.getClient().cod.getToken()
|
|
9
9
|
// const x: any = await client.authenticate();
|
|
@@ -7,5 +7,10 @@ export declare class OAuthClientOptions {
|
|
|
7
7
|
redirectUri: string;
|
|
8
8
|
scopes: string[];
|
|
9
9
|
state: string;
|
|
10
|
-
|
|
10
|
+
headers: {
|
|
11
|
+
[key: string]: string | string[];
|
|
12
|
+
};
|
|
13
|
+
constructor(apiEndpoint: string, clientId: string, clientSecret: string, headers: {
|
|
14
|
+
[key: string]: string | string[];
|
|
15
|
+
});
|
|
11
16
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OAuthClientOptions = void 0;
|
|
4
4
|
class OAuthClientOptions {
|
|
5
|
-
constructor(apiEndpoint, clientId, clientSecret) {
|
|
5
|
+
constructor(apiEndpoint, clientId, clientSecret, headers) {
|
|
6
6
|
this.accessTokenUri = 'oauth/token';
|
|
7
7
|
this.authorizationUri = 'oauth/authorize';
|
|
8
8
|
this.redirectUri = 'https://example.com/auth/github/callback';
|
|
@@ -11,6 +11,7 @@ class OAuthClientOptions {
|
|
|
11
11
|
this.apiEndpoint = apiEndpoint;
|
|
12
12
|
this.clientId = clientId;
|
|
13
13
|
this.clientSecret = clientSecret;
|
|
14
|
+
this.headers = headers;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
exports.OAuthClientOptions = OAuthClientOptions;
|
|
@@ -11,7 +11,7 @@ class Adapter {
|
|
|
11
11
|
adapter.icon = rawAdapter.icon;
|
|
12
12
|
adapter.logo = rawAdapter.logo;
|
|
13
13
|
adapter.type = rawAdapter.type;
|
|
14
|
-
adapter.categoryIds = rawAdapter.
|
|
14
|
+
adapter.categoryIds = rawAdapter.category_ids;
|
|
15
15
|
adapter.docs = rawAdapter.docs;
|
|
16
16
|
adapter.website = rawAdapter.website;
|
|
17
17
|
return adapter;
|
package/dist/Model/Config.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { State } from './State';
|
|
2
2
|
export declare class Config {
|
|
3
3
|
id: number;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
projectId: string;
|
|
5
|
+
projectEnvironmentId: string;
|
|
6
|
+
flowId: string;
|
|
7
7
|
scope: string;
|
|
8
8
|
key: string;
|
|
9
9
|
value: string;
|
package/dist/Model/Config.js
CHANGED
|
@@ -12,9 +12,9 @@ class Config {
|
|
|
12
12
|
static parse(rawConfig) {
|
|
13
13
|
let config = new Config();
|
|
14
14
|
config.id = rawConfig.id;
|
|
15
|
-
config.
|
|
16
|
-
config.
|
|
17
|
-
config.
|
|
15
|
+
config.projectId = rawConfig.project;
|
|
16
|
+
config.projectEnvironmentId = rawConfig.project_environment;
|
|
17
|
+
config.flowId = rawConfig.flow;
|
|
18
18
|
config.scope = rawConfig.scope;
|
|
19
19
|
config.key = rawConfig.key;
|
|
20
20
|
config.value = rawConfig.value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { State } from '
|
|
2
|
-
import { StateAware } from '
|
|
3
|
-
export declare class
|
|
1
|
+
import { State } from '../State';
|
|
2
|
+
import { StateAware } from '../StateAware';
|
|
3
|
+
export declare class Flow implements StateAware {
|
|
4
4
|
id: string;
|
|
5
5
|
key: string;
|
|
6
6
|
name: string;
|
|
@@ -10,5 +10,5 @@ export declare class Task implements StateAware {
|
|
|
10
10
|
state: State;
|
|
11
11
|
/** The maximum number of tasks to run at any time (0 = no limit) **/
|
|
12
12
|
parallelLimit: number;
|
|
13
|
-
static parse(rawTask: any):
|
|
13
|
+
static parse(rawTask: any): Flow;
|
|
14
14
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Flow = void 0;
|
|
4
|
+
const State_1 = require("../State");
|
|
5
|
+
const Utils_1 = require("../../Utils");
|
|
6
|
+
class Flow {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.isDirect = false;
|
|
9
|
+
this.state = State_1.State.Active;
|
|
10
|
+
/** The maximum number of tasks to run at any time (0 = no limit) **/
|
|
11
|
+
this.parallelLimit = 0;
|
|
12
|
+
}
|
|
13
|
+
static parse(rawTask) {
|
|
14
|
+
const task = new Flow();
|
|
15
|
+
task.id = rawTask.id;
|
|
16
|
+
task.key = rawTask.key;
|
|
17
|
+
task.projectId = rawTask.project;
|
|
18
|
+
task.name = rawTask.name;
|
|
19
|
+
task.description = rawTask.description;
|
|
20
|
+
task.isDirect = Utils_1.Utils.isTrue(rawTask.is_direct);
|
|
21
|
+
task.state = State_1.State.fromString(rawTask.state);
|
|
22
|
+
task.parallelLimit = Utils_1.Utils.parseInt(rawTask.parallel_limit);
|
|
23
|
+
return task;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.Flow = Flow;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LogLevel } from '../Log/LogLevel';
|
|
2
|
+
import { FlowRunPriority } from './FlowRunPriority';
|
|
3
|
+
export declare class FlowRun {
|
|
4
|
+
id: string;
|
|
5
|
+
flowId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
arguments: any;
|
|
8
|
+
projectEnvironmentId: string;
|
|
9
|
+
triggerId: string;
|
|
10
|
+
priority: FlowRunPriority;
|
|
11
|
+
deployId: string;
|
|
12
|
+
logLevelCount: Map<LogLevel, number>;
|
|
13
|
+
logsPurged: boolean;
|
|
14
|
+
static parse(rawTaskExecution: any): FlowRun;
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowRun = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
5
|
+
const FlowRunPriority_1 = require("./FlowRunPriority");
|
|
6
|
+
class FlowRun {
|
|
7
|
+
constructor() {
|
|
8
|
+
// TODO: implement priority object
|
|
9
|
+
this.priority = FlowRunPriority_1.FlowRunPriority.None;
|
|
10
|
+
this.logsPurged = false;
|
|
11
|
+
}
|
|
12
|
+
static parse(rawTaskExecution) {
|
|
13
|
+
let taskExecution = new FlowRun();
|
|
14
|
+
taskExecution.id = rawTaskExecution.id;
|
|
15
|
+
// taskExecution.code = rawTaskExecution.code;
|
|
16
|
+
taskExecution.name = rawTaskExecution.name;
|
|
17
|
+
taskExecution.flowId = rawTaskExecution.flow;
|
|
18
|
+
taskExecution.arguments = rawTaskExecution.arguments;
|
|
19
|
+
taskExecution.projectEnvironmentId = rawTaskExecution.project_environment;
|
|
20
|
+
taskExecution.priority = FlowRunPriority_1.FlowRunPriority.fromString(rawTaskExecution.priority);
|
|
21
|
+
taskExecution.triggerId = rawTaskExecution.trigger;
|
|
22
|
+
taskExecution.deployId = rawTaskExecution.deploy;
|
|
23
|
+
taskExecution.logLevelCount = rawTaskExecution.log_level_count;
|
|
24
|
+
taskExecution.logsPurged = Utils_1.Utils.isTrue(rawTaskExecution.logs_purged);
|
|
25
|
+
return taskExecution;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.FlowRun = FlowRun;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowRunHistory = void 0;
|
|
4
|
+
const FlowRunStatus_1 = require("./FlowRunStatus");
|
|
5
|
+
class FlowRunHistory {
|
|
6
|
+
static parse(rawTaskExecutionHistory) {
|
|
7
|
+
let taskExecutionHistory = new FlowRunHistory();
|
|
8
|
+
taskExecutionHistory.id = rawTaskExecutionHistory.id;
|
|
9
|
+
taskExecutionHistory.time = new Date(rawTaskExecutionHistory.time);
|
|
10
|
+
taskExecutionHistory.status = FlowRunStatus_1.FlowRunStatus.fromString(rawTaskExecutionHistory.status);
|
|
11
|
+
return taskExecutionHistory;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.FlowRunHistory = FlowRunHistory;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowRunPriority = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
5
|
+
var FlowRunPriority;
|
|
6
|
+
(function (FlowRunPriority) {
|
|
7
|
+
FlowRunPriority[FlowRunPriority["None"] = 0] = "None";
|
|
8
|
+
FlowRunPriority[FlowRunPriority["Low"] = 1] = "Low";
|
|
9
|
+
FlowRunPriority[FlowRunPriority["Medium"] = 2] = "Medium";
|
|
10
|
+
FlowRunPriority[FlowRunPriority["High"] = 3] = "High";
|
|
11
|
+
})(FlowRunPriority = exports.FlowRunPriority || (exports.FlowRunPriority = {}));
|
|
12
|
+
(function (FlowRunPriority) {
|
|
13
|
+
function fromString(input) {
|
|
14
|
+
const result = Utils_1.Utils.parseEnum(input, FlowRunPriority);
|
|
15
|
+
if (result === null) {
|
|
16
|
+
throw new Error('Unable to parse FlowRunPriority from string: Unknown FlowRunPriority "' + input + '"');
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
FlowRunPriority.fromString = fromString;
|
|
21
|
+
})(FlowRunPriority = exports.FlowRunPriority || (exports.FlowRunPriority = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
class
|
|
3
|
+
exports.FlowRunStats = void 0;
|
|
4
|
+
class FlowRunStats {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.memory = null;
|
|
7
7
|
this.memoryLimit = null;
|
|
@@ -13,4 +13,4 @@ class TaskExecutionStats {
|
|
|
13
13
|
this.fileWrite = null;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
exports.
|
|
16
|
+
exports.FlowRunStats = FlowRunStats;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowRunStatus = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
5
|
+
var FlowRunStatus;
|
|
6
|
+
(function (FlowRunStatus) {
|
|
7
|
+
FlowRunStatus[FlowRunStatus["Unknown"] = "unknown"] = "Unknown";
|
|
8
|
+
FlowRunStatus[FlowRunStatus["Pending"] = "pending"] = "Pending";
|
|
9
|
+
FlowRunStatus[FlowRunStatus["Canceled"] = "canceled"] = "Canceled";
|
|
10
|
+
FlowRunStatus[FlowRunStatus["Running"] = "running"] = "Running";
|
|
11
|
+
FlowRunStatus[FlowRunStatus["Failed"] = "failed"] = "Failed";
|
|
12
|
+
FlowRunStatus[FlowRunStatus["Stopped"] = "stopped"] = "Stopped";
|
|
13
|
+
FlowRunStatus[FlowRunStatus["Complete"] = "complete"] = "Complete";
|
|
14
|
+
})(FlowRunStatus = exports.FlowRunStatus || (exports.FlowRunStatus = {}));
|
|
15
|
+
(function (FlowRunStatus) {
|
|
16
|
+
function fromString(input) {
|
|
17
|
+
const result = Utils_1.Utils.parseEnum(input, FlowRunStatus);
|
|
18
|
+
if (result === null) {
|
|
19
|
+
throw new Error('Unable to parse FlowRunStatus from string: Unknown FlowRunStatus "' + input + '"');
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
FlowRunStatus.fromString = fromString;
|
|
24
|
+
})(FlowRunStatus = exports.FlowRunStatus || (exports.FlowRunStatus = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FlowRunStatus } from "./FlowRunStatus";
|
|
2
|
+
import { FlowRun } from './FlowRun';
|
|
3
|
+
export declare class FlowRunSummary extends FlowRun {
|
|
4
|
+
time: Date;
|
|
5
|
+
runDuration: number;
|
|
6
|
+
pendingDuration: number;
|
|
7
|
+
status: FlowRunStatus;
|
|
8
|
+
static parse(rawTaskExecutionSummary: any): FlowRunSummary;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowRunSummary = void 0;
|
|
4
|
+
const FlowRunStatus_1 = require("./FlowRunStatus");
|
|
5
|
+
const FlowRun_1 = require("./FlowRun");
|
|
6
|
+
const Utils_1 = require("../../Utils");
|
|
7
|
+
class FlowRunSummary extends FlowRun_1.FlowRun {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.status = FlowRunStatus_1.FlowRunStatus.Unknown;
|
|
11
|
+
}
|
|
12
|
+
static parse(rawTaskExecutionSummary) {
|
|
13
|
+
let taskExecutionSummary = FlowRun_1.FlowRun.parse(rawTaskExecutionSummary);
|
|
14
|
+
if (rawTaskExecutionSummary.time === null || rawTaskExecutionSummary.time === undefined) {
|
|
15
|
+
throw new Error('Task execution time cannot be empty');
|
|
16
|
+
}
|
|
17
|
+
taskExecutionSummary.time = Utils_1.Utils.parseRawDate(rawTaskExecutionSummary.time);
|
|
18
|
+
taskExecutionSummary.runDuration = rawTaskExecutionSummary.run_duration;
|
|
19
|
+
taskExecutionSummary.pendingDuration = rawTaskExecutionSummary.pending_duration;
|
|
20
|
+
taskExecutionSummary.status = FlowRunStatus_1.FlowRunStatus.fromString(rawTaskExecutionSummary.status);
|
|
21
|
+
return taskExecutionSummary;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.FlowRunSummary = FlowRunSummary;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlowRunStatus } from "./FlowRunStatus";
|
|
2
|
+
import { Flow } from './Flow';
|
|
3
|
+
export declare class FlowSummary extends Flow {
|
|
4
|
+
status: FlowRunStatus;
|
|
5
|
+
latestRun: Date | null;
|
|
6
|
+
averageRunDuration: number | null;
|
|
7
|
+
averagePendingDuration: number | null;
|
|
8
|
+
runCount: number;
|
|
9
|
+
static parse(rawTask: any): FlowSummary;
|
|
10
|
+
}
|