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