attlaz-client 1.7.3 → 1.7.7
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.js +59 -55
- package/dist/Http/HttpClient.js +13 -9
- package/dist/Http/HttpClientRequest.js +9 -5
- package/dist/Http/HttpClientRequest.spec.js +5 -3
- package/dist/Http/HttpClientResponse.js +5 -1
- package/dist/Http/OAuthClient.js +26 -19
- package/dist/Http/OAuthClient.spec.js +6 -4
- package/dist/Http/OAuthClientOptions.js +5 -1
- package/dist/Http/OAuthClientToken.js +5 -1
- package/dist/Model/Adapter/Adapter.js +5 -1
- package/dist/Model/Adapter/AdapterConfiguration.js +5 -1
- package/dist/Model/Adapter/AdapterConnection.js +8 -4
- package/dist/Model/Config.js +11 -7
- package/dist/Model/DataValue.js +5 -1
- package/dist/Model/DataValueCollection.js +10 -6
- package/dist/Model/Error/ClientError.js +17 -13
- package/dist/Model/Event/EventType.js +5 -2
- package/dist/Model/HealthAlert/HealthAlert.js +8 -4
- package/dist/Model/HealthAlert/HealthAlertStatus.js +8 -5
- package/dist/Model/HealthAlert/HealthTestType.js +8 -5
- package/dist/Model/JsonSerializable.js +5 -1
- package/dist/Model/Log/Log.js +15 -11
- package/dist/Model/Log/LogLevel.js +8 -5
- package/dist/Model/Log/LogQuery.js +5 -1
- package/dist/Model/Log/LogStatus.js +8 -5
- package/dist/Model/Log/LogStreamId.js +5 -1
- package/dist/Model/Messaging/Channel/Channel.js +12 -8
- package/dist/Model/Messaging/Channel/ChannelData.js +5 -1
- package/dist/Model/Messaging/Channel/ChannelType.js +8 -5
- package/dist/Model/Messaging/Channel/EmailChannelData.js +8 -4
- package/dist/Model/Messaging/Channel/PushChannelData.js +8 -4
- package/dist/Model/Messaging/Channel/SlackChannelData.js +8 -4
- package/dist/Model/Messaging/Channel/SmsChannelData.js +8 -4
- package/dist/Model/Messaging/Channel/WebhookChannelData.js +8 -4
- package/dist/Model/Messaging/ChannelHistory.js +7 -3
- package/dist/Model/Messaging/Subscriber.js +10 -6
- package/dist/Model/Notification.js +5 -1
- package/dist/Model/PagedResult.js +5 -1
- package/dist/Model/Project/PlatformLanguage.js +8 -4
- package/dist/Model/Project/Project.js +8 -4
- package/dist/Model/Project/ProjectDeploy.js +12 -8
- package/dist/Model/Project/ProjectDeployCommit.js +5 -1
- package/dist/Model/Project/ProjectDeployStatus.js +8 -5
- package/dist/Model/Project/ProjectEnvironment.js +10 -6
- package/dist/Model/Queue/QueueStatus.js +5 -1
- package/dist/Model/Result/DataResult.js +5 -1
- package/dist/Model/Result/DataResult.spec.js +4 -2
- package/dist/Model/Result/DataResultCollection.js +5 -1
- package/dist/Model/Result/ResultError.js +5 -1
- package/dist/Model/SourcesAccount.js +5 -1
- package/dist/Model/SourcesAccountRepository.js +5 -1
- package/dist/Model/State.js +8 -5
- package/dist/Model/StateAware.js +2 -1
- package/dist/Model/Storage/StorageInformation.js +5 -1
- package/dist/Model/Storage/StorageType.js +8 -5
- package/dist/Model/Task.js +8 -4
- package/dist/Model/TaskExecution/TaskExecutionStats.js +5 -1
- package/dist/Model/TaskExecution.js +5 -1
- package/dist/Model/TaskExecutionHistory.js +7 -3
- package/dist/Model/TaskExecutionResponse.js +5 -1
- package/dist/Model/TaskExecutionStatus.js +8 -5
- package/dist/Model/TaskExecutionSummary.js +11 -7
- package/dist/Model/TaskSummary.js +12 -8
- package/dist/Model/Team/Team.js +5 -1
- package/dist/Model/Team/TeamMember.js +5 -1
- package/dist/Model/Team/TeamMemberInvite.js +7 -3
- package/dist/Model/Team/TeamMemberInvite2.js +5 -1
- package/dist/Model/Team/TeamMemberInviteState.js +8 -5
- package/dist/Model/Team/TeamMemberRole.js +8 -5
- package/dist/Model/Trigger/ApiTrigger.js +8 -4
- package/dist/Model/Trigger/ApiTriggerData.js +6 -2
- package/dist/Model/Trigger/ScheduleTrigger.js +8 -4
- package/dist/Model/Trigger/ScheduleTriggerData.js +6 -2
- package/dist/Model/Trigger/Trigger.js +19 -15
- package/dist/Model/Trigger/TriggerData.js +5 -1
- package/dist/Model/Trigger/TriggerType.js +8 -5
- package/dist/Model/Trigger/WebhookTrigger.js +8 -4
- package/dist/Model/Trigger/WebhookTriggerData.js +6 -2
- package/dist/Model/User/UserAuthProvider.js +10 -6
- package/dist/Model/User.js +10 -6
- package/dist/Model/Worker/Platform.js +12 -8
- package/dist/Model/Worker/PlatformImage.js +10 -6
- package/dist/Model/Worker/Worker.js +11 -7
- package/dist/Model/Worker/WorkerConfig.js +5 -1
- package/dist/Model/Worker/WorkerInstance.js +7 -3
- package/dist/Model/Worker/WorkerInstanceState.js +8 -5
- package/dist/Model/Worker/WorkerState.js +8 -5
- package/dist/Service/AdapterEndpoint.js +15 -11
- package/dist/Service/ChannelEndpoint.js +15 -11
- package/dist/Service/ConfigEndpoint.js +12 -8
- package/dist/Service/Endpoint.js +7 -3
- package/dist/Service/HealthAlertEndpoint.js +8 -4
- package/dist/Service/LogEndpoint.js +19 -15
- package/dist/Service/NotificationsEndpoint.js +8 -4
- package/dist/Service/PlatformEndpoint.js +10 -6
- package/dist/Service/PlatformLanguageEndpoint.js +8 -4
- package/dist/Service/ProjectDeployEndpoint.js +11 -7
- package/dist/Service/ProjectEndpoint.js +13 -9
- package/dist/Service/ProjectEnvironmentEndpoint.js +6 -2
- package/dist/Service/QueueEndpoint.js +10 -6
- package/dist/Service/SourcesAccountEndpoint.js +12 -8
- package/dist/Service/StorageEndpoint.js +6 -2
- package/dist/Service/SubscriberEndpoint.js +11 -7
- package/dist/Service/TaskEndpoint.js +18 -14
- package/dist/Service/TaskExecutionEndpoint.js +18 -14
- package/dist/Service/TaskExecutionRequestEndpoint.js +6 -2
- package/dist/Service/TaskExecutionStatsEndpoint.js +8 -4
- package/dist/Service/TeamMemberEndpoint.js +18 -14
- package/dist/Service/TeamsEndpoint.js +10 -6
- package/dist/Service/TriggerEndpoint.js +13 -9
- package/dist/Service/UserEndpoint.js +14 -10
- package/dist/Service/WorkerConfigEndpoint.js +11 -7
- package/dist/Service/WorkerEndpoint.js +11 -7
- package/dist/Utils.js +5 -1
- package/dist/Utils.spec.js +34 -32
- package/dist/auth.spec.js +27 -25
- package/dist/data.spec.js +5 -3
- package/dist/index.js +217 -106
- package/dist/test.js +13 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +4 -1
- package/package.json +2 -2
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationsEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const Notification_1 = require("../Model/Notification");
|
|
6
|
+
class NotificationsEndpoint extends Endpoint_1.Endpoint {
|
|
4
7
|
getAll(unacknowledgedOnly = false) {
|
|
5
8
|
return new Promise((resolve, reject) => {
|
|
6
9
|
this.httpClient.request('/notifications?unacknowledgedOnly=' + unacknowledgedOnly).then((rawNotifications) => {
|
|
@@ -8,7 +11,7 @@ export class NotificationsEndpoint extends Endpoint {
|
|
|
8
11
|
for (let rawNotification of rawNotifications) {
|
|
9
12
|
//TODO: parse to objects
|
|
10
13
|
// subscribers.push(rawSubscriber);
|
|
11
|
-
let notification = new Notification();
|
|
14
|
+
let notification = new Notification_1.Notification();
|
|
12
15
|
notification.id = rawNotification.id;
|
|
13
16
|
notification.user = rawNotification.user;
|
|
14
17
|
notification.type = rawNotification.type;
|
|
@@ -41,3 +44,4 @@ export class NotificationsEndpoint extends Endpoint {
|
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
}
|
|
47
|
+
exports.NotificationsEndpoint = NotificationsEndpoint;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlatformEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const Platform_1 = require("../Model/Worker/Platform");
|
|
6
|
+
const PlatformImage_1 = require("../Model/Worker/PlatformImage");
|
|
7
|
+
class PlatformEndpoint extends Endpoint_1.Endpoint {
|
|
5
8
|
async getAll() {
|
|
6
9
|
let cmd = '/platforms';
|
|
7
10
|
const result = await this.request(cmd);
|
|
8
|
-
result.setData(this.parseCollection(result, Platform.parse));
|
|
11
|
+
result.setData(this.parseCollection(result, Platform_1.Platform.parse));
|
|
9
12
|
return result;
|
|
10
13
|
}
|
|
11
14
|
async getPlatformImages(platformId) {
|
|
12
15
|
let cmd = '/platforms/' + platformId + '/images';
|
|
13
16
|
const result = await this.request(cmd);
|
|
14
|
-
result.setData(this.parseCollection(result, PlatformImage.parse));
|
|
17
|
+
result.setData(this.parseCollection(result, PlatformImage_1.PlatformImage.parse));
|
|
15
18
|
return result;
|
|
16
19
|
}
|
|
17
20
|
}
|
|
21
|
+
exports.PlatformEndpoint = PlatformEndpoint;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlatformLanguageEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const PlatformLanguage_1 = require("../Model/Project/PlatformLanguage");
|
|
6
|
+
class PlatformLanguageEndpoint extends Endpoint_1.Endpoint {
|
|
4
7
|
async getAll() {
|
|
5
8
|
let cmd = '/platformlanguages';
|
|
6
9
|
const result = await this.request(cmd);
|
|
7
|
-
result.setData(this.parseCollection(result, PlatformLanguage.parse));
|
|
10
|
+
result.setData(this.parseCollection(result, PlatformLanguage_1.PlatformLanguage.parse));
|
|
8
11
|
return result;
|
|
9
12
|
}
|
|
10
13
|
}
|
|
14
|
+
exports.PlatformLanguageEndpoint = PlatformLanguageEndpoint;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectDeployEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const ProjectDeploy_1 = require("../Model/Project/ProjectDeploy");
|
|
6
|
+
const Utils_1 = require("../Utils");
|
|
7
|
+
class ProjectDeployEndpoint extends Endpoint_1.Endpoint {
|
|
5
8
|
async getById(deployId) {
|
|
6
9
|
try {
|
|
7
10
|
const rawProjectDeploy = await this.httpClient.request('/deploys/' + deployId);
|
|
8
|
-
if (Utils.isNullOrUndefined(rawProjectDeploy)) {
|
|
11
|
+
if (Utils_1.Utils.isNullOrUndefined(rawProjectDeploy)) {
|
|
9
12
|
throw new Error('Unable to get deploy');
|
|
10
13
|
}
|
|
11
|
-
return ProjectDeploy.parse(rawProjectDeploy);
|
|
14
|
+
return ProjectDeploy_1.ProjectDeploy.parse(rawProjectDeploy);
|
|
12
15
|
}
|
|
13
16
|
catch (error) {
|
|
14
17
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -22,7 +25,7 @@ export class ProjectDeployEndpoint extends Endpoint {
|
|
|
22
25
|
const rawProjectDeploys = await this.httpClient.request('/projectenvironments/' + projectEnvironmentId + '/deploys');
|
|
23
26
|
let projectDeploys = [];
|
|
24
27
|
for (let rawProjectDeploy of rawProjectDeploys) {
|
|
25
|
-
projectDeploys.push(ProjectDeploy.parse(rawProjectDeploy));
|
|
28
|
+
projectDeploys.push(ProjectDeploy_1.ProjectDeploy.parse(rawProjectDeploy));
|
|
26
29
|
}
|
|
27
30
|
return projectDeploys;
|
|
28
31
|
}
|
|
@@ -48,3 +51,4 @@ export class ProjectDeployEndpoint extends Endpoint {
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
54
|
+
exports.ProjectDeployEndpoint = ProjectDeployEndpoint;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const Project_1 = require("../Model/Project/Project");
|
|
6
|
+
const Utils_1 = require("../Utils");
|
|
7
|
+
class ProjectEndpoint extends Endpoint_1.Endpoint {
|
|
5
8
|
getAll() {
|
|
6
9
|
return new Promise((resolve, reject) => {
|
|
7
10
|
this.httpClient.request('projects').then((rawProjects) => {
|
|
8
11
|
let projects = [];
|
|
9
12
|
for (let rawProject of rawProjects) {
|
|
10
|
-
projects.push(Project.parse(rawProject));
|
|
13
|
+
projects.push(Project_1.Project.parse(rawProject));
|
|
11
14
|
}
|
|
12
15
|
resolve(projects);
|
|
13
16
|
}).catch((reason) => {
|
|
@@ -23,7 +26,7 @@ export class ProjectEndpoint extends Endpoint {
|
|
|
23
26
|
this.httpClient.request('teams/' + teamId + '/projects').then((rawProjects) => {
|
|
24
27
|
let projects = [];
|
|
25
28
|
for (let rawProject of rawProjects) {
|
|
26
|
-
projects.push(Project.parse(rawProject));
|
|
29
|
+
projects.push(Project_1.Project.parse(rawProject));
|
|
27
30
|
}
|
|
28
31
|
resolve(projects);
|
|
29
32
|
}).catch((reason) => {
|
|
@@ -37,10 +40,10 @@ export class ProjectEndpoint extends Endpoint {
|
|
|
37
40
|
async getById(projectId) {
|
|
38
41
|
try {
|
|
39
42
|
const rawProject = await this.httpClient.request('projects/' + projectId + '');
|
|
40
|
-
if (Utils.isNullOrUndefined(rawProject)) {
|
|
43
|
+
if (Utils_1.Utils.isNullOrUndefined(rawProject)) {
|
|
41
44
|
throw new Error('Unable to get project');
|
|
42
45
|
}
|
|
43
|
-
return Project.parse(rawProject);
|
|
46
|
+
return Project_1.Project.parse(rawProject);
|
|
44
47
|
}
|
|
45
48
|
catch (e) {
|
|
46
49
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -52,7 +55,7 @@ export class ProjectEndpoint extends Endpoint {
|
|
|
52
55
|
save(project) {
|
|
53
56
|
return new Promise((resolve, reject) => {
|
|
54
57
|
this.httpClient.request('projects/', project, 'POST').then((rawProject) => {
|
|
55
|
-
resolve(Project.parse(rawProject));
|
|
58
|
+
resolve(Project_1.Project.parse(rawProject));
|
|
56
59
|
}).catch((reason) => {
|
|
57
60
|
if (this.httpClient.isDebugEnabled()) {
|
|
58
61
|
console.error('Failed to save project: ', reason);
|
|
@@ -62,3 +65,4 @@ export class ProjectEndpoint extends Endpoint {
|
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
67
|
}
|
|
68
|
+
exports.ProjectEndpoint = ProjectEndpoint;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectEnvironmentEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
class ProjectEnvironmentEndpoint extends Endpoint_1.Endpoint {
|
|
3
6
|
async getByProject(id) {
|
|
4
7
|
try {
|
|
5
8
|
const rawProjectEnvironments = await this.httpClient.request('/projects/' + id + '/environments');
|
|
@@ -45,3 +48,4 @@ export class ProjectEnvironmentEndpoint extends Endpoint {
|
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
}
|
|
51
|
+
exports.ProjectEnvironmentEndpoint = ProjectEnvironmentEndpoint;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueueEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const Utils_1 = require("../Utils");
|
|
6
|
+
const QueueStatus_1 = require("../Model/Queue/QueueStatus");
|
|
7
|
+
class QueueEndpoint extends Endpoint_1.Endpoint {
|
|
5
8
|
async getByProjectEnvironment(projectEnvironmentId) {
|
|
6
9
|
try {
|
|
7
10
|
let url = '/projectenvironments/' + projectEnvironmentId + '/queues';
|
|
8
11
|
const result = await this.request(url);
|
|
9
|
-
if (Utils.isNullOrUndefined(result)) {
|
|
12
|
+
if (Utils_1.Utils.isNullOrUndefined(result)) {
|
|
10
13
|
// return null;
|
|
11
14
|
}
|
|
12
15
|
else {
|
|
13
|
-
result.setData(QueueStatus.parse(result.getData()));
|
|
16
|
+
result.setData(QueueStatus_1.QueueStatus.parse(result.getData()));
|
|
14
17
|
}
|
|
15
18
|
return result;
|
|
16
19
|
}
|
|
@@ -22,3 +25,4 @@ export class QueueEndpoint extends Endpoint {
|
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
}
|
|
28
|
+
exports.QueueEndpoint = QueueEndpoint;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourcesAccountEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const SourcesAccount_1 = require("../Model/SourcesAccount");
|
|
6
|
+
const SourcesAccountRepository_1 = require("../Model/SourcesAccountRepository");
|
|
7
|
+
const Utils_1 = require("../Utils");
|
|
8
|
+
class SourcesAccountEndpoint extends Endpoint_1.Endpoint {
|
|
6
9
|
async getAll() {
|
|
7
10
|
const rawSourcesAccounts = await this.httpClient.request('sourcesaccounts');
|
|
8
11
|
let sourcesAccounts = [];
|
|
9
12
|
for (let rawSourcesAccount of rawSourcesAccounts) {
|
|
10
|
-
sourcesAccounts.push(SourcesAccount.parse(rawSourcesAccount));
|
|
13
|
+
sourcesAccounts.push(SourcesAccount_1.SourcesAccount.parse(rawSourcesAccount));
|
|
11
14
|
}
|
|
12
15
|
return sourcesAccounts;
|
|
13
16
|
}
|
|
@@ -15,13 +18,14 @@ export class SourcesAccountEndpoint extends Endpoint {
|
|
|
15
18
|
const rawSourcesAccountRepositories = await this.httpClient.request('sourcesaccounts/' + sourcesAccountId + '/repositories');
|
|
16
19
|
let sourcesAccountRepositories = [];
|
|
17
20
|
for (let rawSourcesAccountRepository of rawSourcesAccountRepositories) {
|
|
18
|
-
sourcesAccountRepositories.push(SourcesAccountRepository.parse(rawSourcesAccountRepository));
|
|
21
|
+
sourcesAccountRepositories.push(SourcesAccountRepository_1.SourcesAccountRepository.parse(rawSourcesAccountRepository));
|
|
19
22
|
}
|
|
20
23
|
return sourcesAccountRepositories;
|
|
21
24
|
}
|
|
22
25
|
async getRepositoryBranches(sourcesAccountId, repositoryKey) {
|
|
23
|
-
repositoryKey = Utils.base64encode(repositoryKey);
|
|
26
|
+
repositoryKey = Utils_1.Utils.base64encode(repositoryKey);
|
|
24
27
|
const rawBranches = await this.httpClient.request('sourcesaccounts/' + sourcesAccountId + '/repositories/' + repositoryKey + '/branches');
|
|
25
28
|
return rawBranches;
|
|
26
29
|
}
|
|
27
30
|
}
|
|
31
|
+
exports.SourcesAccountEndpoint = SourcesAccountEndpoint;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StorageEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
class StorageEndpoint extends Endpoint_1.Endpoint {
|
|
3
6
|
async getInformation(projectEnvironmentId, storageType) {
|
|
4
7
|
let cmd = '/projectenvironments/' + projectEnvironmentId + '/storage/' + storageType;
|
|
5
8
|
try {
|
|
@@ -33,3 +36,4 @@ export class StorageEndpoint extends Endpoint {
|
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
38
|
}
|
|
39
|
+
exports.StorageEndpoint = StorageEndpoint;
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscriberEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const Subscriber_1 = require("../Model/Messaging/Subscriber");
|
|
6
|
+
const Utils_1 = require("../Utils");
|
|
7
|
+
class SubscriberEndpoint extends Endpoint_1.Endpoint {
|
|
5
8
|
getSubscribersByTask(taskId, projectEnvironmentId = null) {
|
|
6
9
|
return new Promise((resolve, reject) => {
|
|
7
10
|
let parameters = null;
|
|
8
|
-
if (!Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
11
|
+
if (!Utils_1.Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
9
12
|
parameters = { environment: projectEnvironmentId };
|
|
10
13
|
}
|
|
11
14
|
this.httpClient.request('/tasks/' + taskId + '/subscribers', parameters).then((rawSubscribers) => {
|
|
12
15
|
let subscribers = [];
|
|
13
16
|
for (let rawSubscriber of rawSubscribers) {
|
|
14
|
-
subscribers.push(Subscriber.parseRaw(rawSubscriber));
|
|
17
|
+
subscribers.push(Subscriber_1.Subscriber.parseRaw(rawSubscriber));
|
|
15
18
|
}
|
|
16
19
|
resolve(subscribers);
|
|
17
20
|
}).catch((reason) => {
|
|
@@ -27,7 +30,7 @@ export class SubscriberEndpoint extends Endpoint {
|
|
|
27
30
|
this.httpClient.request('/channels/' + channelId + '/subscribers').then((rawSubscribers) => {
|
|
28
31
|
let subscribers = [];
|
|
29
32
|
for (let rawSubscriber of rawSubscribers) {
|
|
30
|
-
subscribers.push(Subscriber.parseRaw(rawSubscriber));
|
|
33
|
+
subscribers.push(Subscriber_1.Subscriber.parseRaw(rawSubscriber));
|
|
31
34
|
}
|
|
32
35
|
resolve(subscribers);
|
|
33
36
|
}).catch((reason) => {
|
|
@@ -52,3 +55,4 @@ export class SubscriberEndpoint extends Endpoint {
|
|
|
52
55
|
});
|
|
53
56
|
}
|
|
54
57
|
}
|
|
58
|
+
exports.SubscriberEndpoint = SubscriberEndpoint;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const Task_1 = require("../Model/Task");
|
|
6
|
+
const Utils_1 = require("../Utils");
|
|
7
|
+
const TaskSummary_1 = require("../Model/TaskSummary");
|
|
8
|
+
class TaskEndpoint extends Endpoint_1.Endpoint {
|
|
6
9
|
getTasks(projectId) {
|
|
7
10
|
return new Promise((resolve, reject) => {
|
|
8
11
|
this.httpClient.request('projects/' + projectId + '/tasks').then((rawTasks) => {
|
|
9
12
|
let tasks = [];
|
|
10
13
|
for (let rawTask of rawTasks) {
|
|
11
|
-
tasks.push(Task.parse(rawTask));
|
|
14
|
+
tasks.push(Task_1.Task.parse(rawTask));
|
|
12
15
|
}
|
|
13
16
|
resolve(tasks);
|
|
14
17
|
}).catch((reason) => {
|
|
@@ -22,10 +25,10 @@ export class TaskEndpoint extends Endpoint {
|
|
|
22
25
|
async getTask(taskId) {
|
|
23
26
|
try {
|
|
24
27
|
const rawTask = await this.httpClient.request('/tasks/' + taskId);
|
|
25
|
-
if (Utils.isNullOrUndefined(rawTask)) {
|
|
28
|
+
if (Utils_1.Utils.isNullOrUndefined(rawTask)) {
|
|
26
29
|
throw new Error('Task not found');
|
|
27
30
|
}
|
|
28
|
-
return Task.parse(rawTask);
|
|
31
|
+
return Task_1.Task.parse(rawTask);
|
|
29
32
|
}
|
|
30
33
|
catch (e) {
|
|
31
34
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -37,13 +40,13 @@ export class TaskEndpoint extends Endpoint {
|
|
|
37
40
|
getTaskSummaries(projectId, projectEnvironmentId = null) {
|
|
38
41
|
return new Promise((resolve, reject) => {
|
|
39
42
|
let parameters = null;
|
|
40
|
-
if (!Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
43
|
+
if (!Utils_1.Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
41
44
|
parameters = { environment: projectEnvironmentId };
|
|
42
45
|
}
|
|
43
46
|
this.httpClient.request('projects/' + projectId + '/tasksummaries', parameters).then((rawTaskSummaries) => {
|
|
44
47
|
let tasks = [];
|
|
45
48
|
for (let rawTaskSummary of rawTaskSummaries) {
|
|
46
|
-
tasks.push(TaskSummary.parse(rawTaskSummary));
|
|
49
|
+
tasks.push(TaskSummary_1.TaskSummary.parse(rawTaskSummary));
|
|
47
50
|
}
|
|
48
51
|
resolve(tasks);
|
|
49
52
|
}).catch((reason) => {
|
|
@@ -56,15 +59,15 @@ export class TaskEndpoint extends Endpoint {
|
|
|
56
59
|
}
|
|
57
60
|
async getTaskSummary(taskId, projectEnvironmentId = null) {
|
|
58
61
|
let parameters = null;
|
|
59
|
-
if (!Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
62
|
+
if (!Utils_1.Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
60
63
|
parameters = { environment: projectEnvironmentId };
|
|
61
64
|
}
|
|
62
65
|
try {
|
|
63
66
|
const rawTaskSummary = await this.httpClient.request('tasks/' + taskId + '/summaries', parameters);
|
|
64
|
-
if (Utils.isNullOrUndefined(rawTaskSummary)) {
|
|
67
|
+
if (Utils_1.Utils.isNullOrUndefined(rawTaskSummary)) {
|
|
65
68
|
throw new Error('Task not found');
|
|
66
69
|
}
|
|
67
|
-
return TaskSummary.parse(rawTaskSummary);
|
|
70
|
+
return TaskSummary_1.TaskSummary.parse(rawTaskSummary);
|
|
68
71
|
}
|
|
69
72
|
catch (e) {
|
|
70
73
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -77,7 +80,7 @@ export class TaskEndpoint extends Endpoint {
|
|
|
77
80
|
return new Promise((resolve, reject) => {
|
|
78
81
|
let url = '/projects/' + task.project + '/tasks';
|
|
79
82
|
this.httpClient.request(url, task, 'POST').then((result) => {
|
|
80
|
-
resolve(Task.parse(result));
|
|
83
|
+
resolve(Task_1.Task.parse(result));
|
|
81
84
|
}).catch((reason) => {
|
|
82
85
|
if (this.httpClient.isDebugEnabled()) {
|
|
83
86
|
console.error('Failed to save task: ', reason);
|
|
@@ -87,3 +90,4 @@ export class TaskEndpoint extends Endpoint {
|
|
|
87
90
|
});
|
|
88
91
|
}
|
|
89
92
|
}
|
|
93
|
+
exports.TaskEndpoint = TaskEndpoint;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskExecutionEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const TaskExecution_1 = require("../Model/TaskExecution");
|
|
6
|
+
const Utils_1 = require("../Utils");
|
|
7
|
+
const TaskExecutionSummary_1 = require("../Model/TaskExecutionSummary");
|
|
8
|
+
const TaskExecutionHistory_1 = require("../Model/TaskExecutionHistory");
|
|
9
|
+
class TaskExecutionEndpoint extends Endpoint_1.Endpoint {
|
|
7
10
|
getTaskExecutions(taskId) {
|
|
8
11
|
return new Promise((resolve, reject) => {
|
|
9
12
|
this.httpClient.request('/tasks/' + taskId + '/executions').then((rawTaskExecutions) => {
|
|
10
13
|
let taskExecutions = [];
|
|
11
14
|
for (let rawTaskExecution of rawTaskExecutions) {
|
|
12
|
-
taskExecutions.push(TaskExecution.parse(rawTaskExecution));
|
|
15
|
+
taskExecutions.push(TaskExecution_1.TaskExecution.parse(rawTaskExecution));
|
|
13
16
|
}
|
|
14
17
|
resolve(taskExecutions);
|
|
15
18
|
}).catch((reason) => {
|
|
@@ -35,7 +38,7 @@ export class TaskExecutionEndpoint extends Endpoint {
|
|
|
35
38
|
}
|
|
36
39
|
params.to = to.toISOString();
|
|
37
40
|
}
|
|
38
|
-
if (!Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
41
|
+
if (!Utils_1.Utils.isNullOrUndefined(projectEnvironmentId)) {
|
|
39
42
|
if (params === null || params === undefined) {
|
|
40
43
|
params = {};
|
|
41
44
|
}
|
|
@@ -44,7 +47,7 @@ export class TaskExecutionEndpoint extends Endpoint {
|
|
|
44
47
|
const rawTaskExecutions = await this.httpClient.request('/tasks/' + taskId + '/executionsummaries', params);
|
|
45
48
|
let taskExecutions = [];
|
|
46
49
|
for (let rawTaskExecution of rawTaskExecutions) {
|
|
47
|
-
taskExecutions.push(TaskExecutionSummary.parse(rawTaskExecution));
|
|
50
|
+
taskExecutions.push(TaskExecutionSummary_1.TaskExecutionSummary.parse(rawTaskExecution));
|
|
48
51
|
}
|
|
49
52
|
return taskExecutions;
|
|
50
53
|
}
|
|
@@ -61,7 +64,7 @@ export class TaskExecutionEndpoint extends Endpoint {
|
|
|
61
64
|
if (rawTaskExecution === null || rawTaskExecution === undefined) {
|
|
62
65
|
return null;
|
|
63
66
|
}
|
|
64
|
-
return TaskExecutionSummary.parse(rawTaskExecution);
|
|
67
|
+
return TaskExecutionSummary_1.TaskExecutionSummary.parse(rawTaskExecution);
|
|
65
68
|
}
|
|
66
69
|
catch (e) {
|
|
67
70
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -78,7 +81,7 @@ export class TaskExecutionEndpoint extends Endpoint {
|
|
|
78
81
|
this.httpClient.request('/taskexecutions/' + taskExecutionId + '/history').then((rawTaskExecutionHistories) => {
|
|
79
82
|
let taskExecutionHistories = [];
|
|
80
83
|
for (let rawTaskExecutionHistory of rawTaskExecutionHistories) {
|
|
81
|
-
taskExecutionHistories.push(TaskExecutionHistory.parse(rawTaskExecutionHistory));
|
|
84
|
+
taskExecutionHistories.push(TaskExecutionHistory_1.TaskExecutionHistory.parse(rawTaskExecutionHistory));
|
|
82
85
|
}
|
|
83
86
|
resolve(taskExecutionHistories);
|
|
84
87
|
}).catch((reason) => {
|
|
@@ -94,13 +97,14 @@ export class TaskExecutionEndpoint extends Endpoint {
|
|
|
94
97
|
throw new Error('Task execution id cannot be empty');
|
|
95
98
|
}
|
|
96
99
|
let params = {};
|
|
97
|
-
if (!Utils.isNullOrUndefined(status)) {
|
|
100
|
+
if (!Utils_1.Utils.isNullOrUndefined(status)) {
|
|
98
101
|
params.status = status;
|
|
99
102
|
}
|
|
100
|
-
if (!Utils.isNullOrUndefined(time)) {
|
|
103
|
+
if (!Utils_1.Utils.isNullOrUndefined(time)) {
|
|
101
104
|
params.time = time;
|
|
102
105
|
}
|
|
103
106
|
const rawTaskExecution = await this.httpClient.request('/taskexecutions/' + taskExecutionId + '', params, 'POST');
|
|
104
|
-
return TaskExecution.parse(rawTaskExecution);
|
|
107
|
+
return TaskExecution_1.TaskExecution.parse(rawTaskExecution);
|
|
105
108
|
}
|
|
106
109
|
}
|
|
110
|
+
exports.TaskExecutionEndpoint = TaskExecutionEndpoint;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskExecutionRequestEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
class TaskExecutionRequestEndpoint extends Endpoint_1.Endpoint {
|
|
3
6
|
async postTaskExecutionRequest(taskId, params, wait = false) {
|
|
4
7
|
let url = '/tasks/' + taskId + '/taskexecutionrequests';
|
|
5
8
|
if (wait) {
|
|
@@ -19,3 +22,4 @@ export class TaskExecutionRequestEndpoint extends Endpoint {
|
|
|
19
22
|
}
|
|
20
23
|
}
|
|
21
24
|
}
|
|
25
|
+
exports.TaskExecutionRequestEndpoint = TaskExecutionRequestEndpoint;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskExecutionStatsEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const DataResult_1 = require("../Model/Result/DataResult");
|
|
6
|
+
class TaskExecutionStatsEndpoint extends Endpoint_1.Endpoint {
|
|
4
7
|
async create(taskExecutionStats) {
|
|
5
8
|
let url = '/taskexecutions/' + taskExecutionStats.taskExecution + '/stats';
|
|
6
9
|
try {
|
|
7
10
|
const result = await this.request(url, taskExecutionStats, 'POST');
|
|
8
|
-
return new DataResult(taskExecutionStats);
|
|
11
|
+
return new DataResult_1.DataResult(taskExecutionStats);
|
|
9
12
|
}
|
|
10
13
|
catch (ex) {
|
|
11
14
|
if (this.httpClient.isDebugEnabled()) {
|
|
@@ -15,3 +18,4 @@ export class TaskExecutionStatsEndpoint extends Endpoint {
|
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
}
|
|
21
|
+
exports.TaskExecutionStatsEndpoint = TaskExecutionStatsEndpoint;
|
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamMemberEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const TeamMember_1 = require("../Model/Team/TeamMember");
|
|
6
|
+
const Utils_1 = require("../Utils");
|
|
7
|
+
const TeamMemberRole_1 = require("../Model/Team/TeamMemberRole");
|
|
8
|
+
const TeamMemberInviteState_1 = require("../Model/Team/TeamMemberInviteState");
|
|
9
|
+
const State_1 = require("../Model/State");
|
|
10
|
+
class TeamMemberEndpoint extends Endpoint_1.Endpoint {
|
|
8
11
|
async getByTeam(teamId) {
|
|
9
12
|
let cmd = '/teams/' + teamId + '/members';
|
|
10
13
|
const rawMembers = await this.httpClient.request(cmd);
|
|
11
14
|
const result = [];
|
|
12
15
|
for (let rawMember of rawMembers) {
|
|
13
|
-
const member = new TeamMember();
|
|
16
|
+
const member = new TeamMember_1.TeamMember();
|
|
14
17
|
member.id = rawMember.id;
|
|
15
18
|
member.email = rawMember.email;
|
|
16
|
-
member.invite = Utils.isTrue(rawMember.invite);
|
|
19
|
+
member.invite = Utils_1.Utils.isTrue(rawMember.invite);
|
|
17
20
|
if (rawMember.last_login !== null && rawMember.last_login !== undefined) {
|
|
18
|
-
member.last_login = Utils.parseRawDate(rawMember.last_login);
|
|
21
|
+
member.last_login = Utils_1.Utils.parseRawDate(rawMember.last_login);
|
|
19
22
|
}
|
|
20
23
|
member.name = rawMember.name;
|
|
21
|
-
member.role = TeamMemberRole.fromString(rawMember.role);
|
|
24
|
+
member.role = TeamMemberRole_1.TeamMemberRole.fromString(rawMember.role);
|
|
22
25
|
if (member.invite) {
|
|
23
|
-
member.state = TeamMemberInviteState.fromString(rawMember.state);
|
|
26
|
+
member.state = TeamMemberInviteState_1.TeamMemberInviteState.fromString(rawMember.state);
|
|
24
27
|
}
|
|
25
28
|
else {
|
|
26
|
-
member.state = State.fromString(rawMember.state);
|
|
29
|
+
member.state = State_1.State.fromString(rawMember.state);
|
|
27
30
|
}
|
|
28
31
|
result.push(member);
|
|
29
32
|
}
|
|
@@ -59,10 +62,11 @@ export class TeamMemberEndpoint extends Endpoint {
|
|
|
59
62
|
inviter_name: rawInvite.inviter_name,
|
|
60
63
|
inviter_email: rawInvite.inviter_email,
|
|
61
64
|
team_name: rawInvite.team_name,
|
|
62
|
-
state: TeamMemberInviteState.fromString(rawInvite.state)
|
|
65
|
+
state: TeamMemberInviteState_1.TeamMemberInviteState.fromString(rawInvite.state)
|
|
63
66
|
};
|
|
64
67
|
return teamMemberInvite;
|
|
65
68
|
}
|
|
66
69
|
return null;
|
|
67
70
|
}
|
|
68
71
|
}
|
|
72
|
+
exports.TeamMemberEndpoint = TeamMemberEndpoint;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TeamsEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const Team_1 = require("../Model/Team/Team");
|
|
6
|
+
const State_1 = require("../Model/State");
|
|
7
|
+
class TeamsEndpoint extends Endpoint_1.Endpoint {
|
|
5
8
|
async getAll() {
|
|
6
9
|
try {
|
|
7
10
|
const rawTeams = await this.httpClient.request('/teams');
|
|
8
11
|
let teams = [];
|
|
9
12
|
for (let rawTeam of rawTeams) {
|
|
10
|
-
let team = new Team();
|
|
13
|
+
let team = new Team_1.Team();
|
|
11
14
|
team.id = rawTeam.id;
|
|
12
15
|
team.name = rawTeam.name;
|
|
13
|
-
team.state = State.fromString(rawTeam.state);
|
|
16
|
+
team.state = State_1.State.fromString(rawTeam.state);
|
|
14
17
|
teams.push(team);
|
|
15
18
|
}
|
|
16
19
|
return teams;
|
|
@@ -23,3 +26,4 @@ export class TeamsEndpoint extends Endpoint {
|
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
28
|
}
|
|
29
|
+
exports.TeamsEndpoint = TeamsEndpoint;
|