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,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventType = void 0;
|
|
4
|
-
var EventType;
|
|
1
|
+
export var EventType;
|
|
5
2
|
(function (EventType) {
|
|
6
3
|
EventType[EventType["TaskExecutionRequested"] = "TaskExecutionRequested"] = "TaskExecutionRequested";
|
|
7
4
|
EventType[EventType["TaskExecutionStarted"] = "TaskExecutionStarted"] = "TaskExecutionStarted";
|
|
8
5
|
EventType[EventType["TaskExecutionFailed"] = "TaskExecutionFailed"] = "TaskExecutionFailed";
|
|
9
6
|
EventType[EventType["TaskExecutionComplete"] = "TaskExecutionComplete"] = "TaskExecutionComplete";
|
|
10
7
|
EventType[EventType["TaskExecutionRetry"] = "TaskExecutionRetry"] = "TaskExecutionRetry";
|
|
11
|
-
})(EventType
|
|
8
|
+
})(EventType || (EventType = {}));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const HealthTestType_1 = require("./HealthTestType");
|
|
5
|
-
const HealthAlertStatus_1 = require("./HealthAlertStatus");
|
|
6
|
-
class HealthAlert {
|
|
1
|
+
import { HealthTestType } from './HealthTestType';
|
|
2
|
+
import { HealthAlertStatus } from './HealthAlertStatus';
|
|
3
|
+
export class HealthAlert {
|
|
7
4
|
constructor(healthTestType, status) {
|
|
8
5
|
this.data = [];
|
|
9
6
|
this.healthTestType = healthTestType;
|
|
@@ -12,7 +9,7 @@ class HealthAlert {
|
|
|
12
9
|
this.data = [];
|
|
13
10
|
}
|
|
14
11
|
static parse(raw) {
|
|
15
|
-
let healthAlert = new HealthAlert(
|
|
12
|
+
let healthAlert = new HealthAlert(HealthTestType.fromString(raw.healthTestType), HealthAlertStatus.fromString(raw.status));
|
|
16
13
|
healthAlert.id = raw.id;
|
|
17
14
|
healthAlert.date = new Date(raw.date);
|
|
18
15
|
healthAlert.data = raw.data;
|
|
@@ -27,4 +24,3 @@ class HealthAlert {
|
|
|
27
24
|
return null;
|
|
28
25
|
}
|
|
29
26
|
}
|
|
30
|
-
exports.HealthAlert = HealthAlert;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.HealthAlertStatus = void 0;
|
|
4
|
-
const Utils_1 = require("../../Utils");
|
|
5
|
-
var HealthAlertStatus;
|
|
1
|
+
import { Utils } from '../../Utils';
|
|
2
|
+
export var HealthAlertStatus;
|
|
6
3
|
(function (HealthAlertStatus) {
|
|
7
4
|
HealthAlertStatus["PASSED"] = "pass";
|
|
8
5
|
HealthAlertStatus["SKIPPED"] = "skip";
|
|
9
6
|
HealthAlertStatus["FAILED"] = "fail";
|
|
10
|
-
})(HealthAlertStatus
|
|
7
|
+
})(HealthAlertStatus || (HealthAlertStatus = {}));
|
|
11
8
|
(function (HealthAlertStatus) {
|
|
12
9
|
function fromString(input) {
|
|
13
|
-
const result =
|
|
10
|
+
const result = Utils.parseEnum(input, HealthAlertStatus);
|
|
14
11
|
if (result === null) {
|
|
15
12
|
throw new Error('Unable to parse HealthAlertStatus from string: Unknown HealthAlertStatus "' + input + '"');
|
|
16
13
|
}
|
|
17
14
|
return result;
|
|
18
15
|
}
|
|
19
16
|
HealthAlertStatus.fromString = fromString;
|
|
20
|
-
})(HealthAlertStatus
|
|
17
|
+
})(HealthAlertStatus || (HealthAlertStatus = {}));
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.HealthTestType = void 0;
|
|
4
|
-
const Utils_1 = require("../../Utils");
|
|
5
|
-
var HealthTestType;
|
|
1
|
+
import { Utils } from '../../Utils';
|
|
2
|
+
export var HealthTestType;
|
|
6
3
|
(function (HealthTestType) {
|
|
7
4
|
HealthTestType["PROJECT_ENVIRONMENT_HAS_WORKERS"] = "project_environment_has_workers";
|
|
8
5
|
HealthTestType["QUEUE_FLOW_IS_HEALTHY"] = "queue_flow_is_healthy";
|
|
9
6
|
HealthTestType["WORKER_IS_UP_TO_DATE"] = "worker_is_up_to_date";
|
|
10
7
|
HealthTestType["TASK_EXECUTIONS_ARE_SUCCESSFUL"] = "task_executions_are_successful";
|
|
11
|
-
})(HealthTestType
|
|
8
|
+
})(HealthTestType || (HealthTestType = {}));
|
|
12
9
|
(function (HealthTestType) {
|
|
13
10
|
function fromString(input) {
|
|
14
|
-
const result =
|
|
11
|
+
const result = Utils.parseEnum(input, HealthTestType);
|
|
15
12
|
if (result === null) {
|
|
16
13
|
throw new Error('Unable to parse HealthTestType from string: Unknown HealthTestType "' + input + '"');
|
|
17
14
|
}
|
|
18
15
|
return result;
|
|
19
16
|
}
|
|
20
17
|
HealthTestType.fromString = fromString;
|
|
21
|
-
})(HealthTestType
|
|
18
|
+
})(HealthTestType || (HealthTestType = {}));
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsonSerializable = void 0;
|
|
4
|
-
class JsonSerializable {
|
|
1
|
+
export class JsonSerializable {
|
|
5
2
|
static stringify(object) {
|
|
6
3
|
const replacer = (key, value) => {
|
|
7
4
|
// Filtering out properties
|
|
@@ -13,4 +10,3 @@ class JsonSerializable {
|
|
|
13
10
|
return JSON.stringify(object, replacer);
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
|
-
exports.JsonSerializable = JsonSerializable;
|
package/dist/Model/Log/Log.js
CHANGED
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const LogStatus_1 = require("./LogStatus");
|
|
7
|
-
const DataValueCollection_1 = require("../DataValueCollection");
|
|
8
|
-
class Log {
|
|
1
|
+
import { LogLevel } from "./LogLevel";
|
|
2
|
+
import { LogStreamId } from './LogStreamId';
|
|
3
|
+
import { LogStatus } from './LogStatus';
|
|
4
|
+
import { DataValueCollection } from '../DataValueCollection';
|
|
5
|
+
export class Log {
|
|
9
6
|
constructor(logStream, message, level, date) {
|
|
10
7
|
this.id = null;
|
|
11
|
-
this.status =
|
|
8
|
+
this.status = LogStatus.Normal;
|
|
12
9
|
this.logStream = logStream;
|
|
13
10
|
this.message = message;
|
|
14
11
|
this.level = level;
|
|
15
12
|
this.date = date;
|
|
16
|
-
this.tags = new
|
|
13
|
+
this.tags = new DataValueCollection();
|
|
17
14
|
}
|
|
18
15
|
static parse(rawLog) {
|
|
19
16
|
const date = new Date(rawLog.date);
|
|
20
|
-
const level =
|
|
21
|
-
const logStream = new
|
|
17
|
+
const level = LogLevel.fromString(rawLog.level);
|
|
18
|
+
const logStream = new LogStreamId(rawLog.logStream.id);
|
|
22
19
|
let log = new Log(logStream, rawLog.message, level, date);
|
|
23
20
|
log.id = rawLog.id;
|
|
24
21
|
log.context = rawLog.context;
|
|
25
22
|
if (rawLog.status !== null && rawLog.status !== undefined && rawLog.status !== '') {
|
|
26
|
-
log.status =
|
|
23
|
+
log.status = LogStatus.fromString(rawLog.status);
|
|
27
24
|
}
|
|
28
|
-
log.tags =
|
|
25
|
+
log.tags = DataValueCollection.fromObject(rawLog.tags);
|
|
29
26
|
log._version = rawLog._version;
|
|
30
27
|
return log;
|
|
31
28
|
}
|
|
32
29
|
}
|
|
33
|
-
exports.Log = Log;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.LogLevel = void 0;
|
|
4
|
-
const Utils_1 = require("../../Utils");
|
|
5
|
-
var LogLevel;
|
|
1
|
+
import { Utils } from '../../Utils';
|
|
2
|
+
export var LogLevel;
|
|
6
3
|
(function (LogLevel) {
|
|
7
4
|
LogLevel["Debug"] = "debug";
|
|
8
5
|
LogLevel["Info"] = "info";
|
|
@@ -12,7 +9,7 @@ var LogLevel;
|
|
|
12
9
|
LogLevel["Critical"] = "critical";
|
|
13
10
|
LogLevel["Alert"] = "alert";
|
|
14
11
|
LogLevel["Emergency"] = "emergency";
|
|
15
|
-
})(LogLevel
|
|
12
|
+
})(LogLevel || (LogLevel = {}));
|
|
16
13
|
(function (LogLevel) {
|
|
17
14
|
function compare(logLevelA, logLevelB) {
|
|
18
15
|
let logLevelANumeric = LogLevel.toNumeric(logLevelA);
|
|
@@ -50,11 +47,11 @@ var LogLevel;
|
|
|
50
47
|
}
|
|
51
48
|
LogLevel.toNumeric = toNumeric;
|
|
52
49
|
function fromString(input) {
|
|
53
|
-
const result =
|
|
50
|
+
const result = Utils.parseEnum(input, LogLevel);
|
|
54
51
|
if (result === null) {
|
|
55
52
|
throw new Error('Unable to parse LogLevel from string: Unknown LogLevel "' + input + '"');
|
|
56
53
|
}
|
|
57
54
|
return result;
|
|
58
55
|
}
|
|
59
56
|
LogLevel.fromString = fromString;
|
|
60
|
-
})(LogLevel
|
|
57
|
+
})(LogLevel || (LogLevel = {}));
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LogQuery = void 0;
|
|
4
|
-
class LogQuery {
|
|
1
|
+
export class LogQuery {
|
|
5
2
|
constructor(logStreamId) {
|
|
6
3
|
this.message = null;
|
|
7
4
|
this.hidden = null;
|
|
@@ -10,4 +7,3 @@ class LogQuery {
|
|
|
10
7
|
this.logStreamId = logStreamId;
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.LogQuery = LogQuery;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.LogStatus = void 0;
|
|
4
|
-
const __1 = require("../..");
|
|
5
|
-
var LogStatus;
|
|
1
|
+
import { Utils } from '../..';
|
|
2
|
+
export var LogStatus;
|
|
6
3
|
(function (LogStatus) {
|
|
7
4
|
LogStatus["Normal"] = "normal";
|
|
8
5
|
LogStatus["Ignored"] = "ignored";
|
|
9
6
|
LogStatus["Resolved"] = "resolved";
|
|
10
|
-
})(LogStatus
|
|
7
|
+
})(LogStatus || (LogStatus = {}));
|
|
11
8
|
(function (LogStatus) {
|
|
12
9
|
function fromString(input) {
|
|
13
|
-
const result =
|
|
10
|
+
const result = Utils.parseEnum(input, LogStatus);
|
|
14
11
|
if (result === null) {
|
|
15
12
|
throw new Error('Unable to parse LogStatus from string: Unknown LogStatus "' + input + '"');
|
|
16
13
|
}
|
|
17
14
|
return result;
|
|
18
15
|
}
|
|
19
16
|
LogStatus.fromString = fromString;
|
|
20
|
-
})(LogStatus
|
|
17
|
+
})(LogStatus || (LogStatus = {}));
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const State_1 = require("../../State");
|
|
6
|
-
const Utils_1 = require("../../../Utils");
|
|
7
|
-
class Channel {
|
|
1
|
+
import { ChannelType } from './ChannelType';
|
|
2
|
+
import { State } from '../../State';
|
|
3
|
+
import { Utils } from '../../../Utils';
|
|
4
|
+
export class Channel {
|
|
8
5
|
constructor(id, owner, label, type, data) {
|
|
9
|
-
this.state =
|
|
6
|
+
this.state = State.Active;
|
|
10
7
|
this.private = false;
|
|
11
8
|
this.id = id;
|
|
12
9
|
this.owner = owner;
|
|
@@ -15,11 +12,10 @@ class Channel {
|
|
|
15
12
|
this.data = data;
|
|
16
13
|
}
|
|
17
14
|
static parse(rawChannel) {
|
|
18
|
-
const type =
|
|
15
|
+
const type = ChannelType.fromString(rawChannel.type);
|
|
19
16
|
const channel = new Channel(rawChannel.id, rawChannel.owner, rawChannel.label, type, rawChannel.data);
|
|
20
|
-
channel.state =
|
|
21
|
-
channel.private =
|
|
17
|
+
channel.state = State.fromString(rawChannel.state);
|
|
18
|
+
channel.private = Utils.isTrue(rawChannel.private);
|
|
22
19
|
return channel;
|
|
23
20
|
}
|
|
24
21
|
}
|
|
25
|
-
exports.Channel = Channel;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChannelData = void 0;
|
|
4
|
-
class ChannelData {
|
|
1
|
+
export class ChannelData {
|
|
5
2
|
constructor(type) {
|
|
6
3
|
this.type = type;
|
|
7
4
|
}
|
|
@@ -9,4 +6,3 @@ class ChannelData {
|
|
|
9
6
|
return JSON.stringify(this);
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.ChannelData = ChannelData;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ChannelType = void 0;
|
|
4
|
-
const Utils_1 = require("../../../Utils");
|
|
5
|
-
var ChannelType;
|
|
1
|
+
import { Utils } from '../../../Utils';
|
|
2
|
+
export var ChannelType;
|
|
6
3
|
(function (ChannelType) {
|
|
7
4
|
ChannelType["Email"] = "email";
|
|
8
5
|
ChannelType["Push"] = "push";
|
|
9
6
|
ChannelType["Slack"] = "slack";
|
|
10
7
|
ChannelType["SMS"] = "sms";
|
|
11
8
|
ChannelType["Webhook"] = "webhook";
|
|
12
|
-
})(ChannelType
|
|
9
|
+
})(ChannelType || (ChannelType = {}));
|
|
13
10
|
(function (ChannelType) {
|
|
14
11
|
function fromString(input) {
|
|
15
|
-
const result =
|
|
12
|
+
const result = Utils.parseEnum(input, ChannelType);
|
|
16
13
|
if (result === null) {
|
|
17
14
|
throw new Error('Unable to parse ChannelType from string: Unknown ChannelType "' + input + '"');
|
|
18
15
|
}
|
|
19
16
|
return result;
|
|
20
17
|
}
|
|
21
18
|
ChannelType.fromString = fromString;
|
|
22
|
-
})(ChannelType
|
|
19
|
+
})(ChannelType || (ChannelType = {}));
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ChannelData_1 = require("./ChannelData");
|
|
5
|
-
const ChannelType_1 = require("./ChannelType");
|
|
6
|
-
class EmailChannelData extends ChannelData_1.ChannelData {
|
|
1
|
+
import { ChannelData } from "./ChannelData";
|
|
2
|
+
import { ChannelType } from './ChannelType';
|
|
3
|
+
export class EmailChannelData extends ChannelData {
|
|
7
4
|
constructor(email) {
|
|
8
|
-
super(
|
|
5
|
+
super(ChannelType.Email);
|
|
9
6
|
this.email = email;
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.EmailChannelData = EmailChannelData;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ChannelData_1 = require("./ChannelData");
|
|
5
|
-
const ChannelType_1 = require("./ChannelType");
|
|
6
|
-
class PushChannelData extends ChannelData_1.ChannelData {
|
|
1
|
+
import { ChannelData } from './ChannelData';
|
|
2
|
+
import { ChannelType } from './ChannelType';
|
|
3
|
+
export class PushChannelData extends ChannelData {
|
|
7
4
|
constructor(endpoint, keys) {
|
|
8
|
-
super(
|
|
5
|
+
super(ChannelType.Push);
|
|
9
6
|
this.endpoint = endpoint;
|
|
10
7
|
this.keys = keys;
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.PushChannelData = PushChannelData;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ChannelData_1 = require("./ChannelData");
|
|
5
|
-
const ChannelType_1 = require("./ChannelType");
|
|
6
|
-
class SlackChannelData extends ChannelData_1.ChannelData {
|
|
1
|
+
import { ChannelData } from './ChannelData';
|
|
2
|
+
import { ChannelType } from './ChannelType';
|
|
3
|
+
export class SlackChannelData extends ChannelData {
|
|
7
4
|
constructor(access_token, webhook, channel_id, channel_name, team_id, team_name) {
|
|
8
|
-
super(
|
|
5
|
+
super(ChannelType.Slack);
|
|
9
6
|
this.access_token = access_token;
|
|
10
7
|
this.webhook = webhook;
|
|
11
8
|
this.channel_id = channel_id;
|
|
@@ -14,4 +11,3 @@ class SlackChannelData extends ChannelData_1.ChannelData {
|
|
|
14
11
|
this.team_name = team_name;
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
|
-
exports.SlackChannelData = SlackChannelData;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ChannelData_1 = require("./ChannelData");
|
|
5
|
-
const ChannelType_1 = require("./ChannelType");
|
|
6
|
-
class SmsChannelData extends ChannelData_1.ChannelData {
|
|
1
|
+
import { ChannelData } from './ChannelData';
|
|
2
|
+
import { ChannelType } from './ChannelType';
|
|
3
|
+
export class SmsChannelData extends ChannelData {
|
|
7
4
|
constructor(phonenumber) {
|
|
8
|
-
super(
|
|
5
|
+
super(ChannelType.SMS);
|
|
9
6
|
this.phonenumber = phonenumber;
|
|
10
7
|
}
|
|
11
8
|
}
|
|
12
|
-
exports.SmsChannelData = SmsChannelData;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const ChannelData_1 = require("./ChannelData");
|
|
5
|
-
const ChannelType_1 = require("./ChannelType");
|
|
6
|
-
class WebhookChannelData extends ChannelData_1.ChannelData {
|
|
1
|
+
import { ChannelData } from './ChannelData';
|
|
2
|
+
import { ChannelType } from './ChannelType';
|
|
3
|
+
export class WebhookChannelData extends ChannelData {
|
|
7
4
|
constructor(url, method = 'GET') {
|
|
8
|
-
super(
|
|
5
|
+
super(ChannelType.Webhook);
|
|
9
6
|
this.url = url;
|
|
10
7
|
this.method = method;
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
|
-
exports.WebhookChannelData = WebhookChannelData;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ChannelHistory = void 0;
|
|
4
|
-
const Utils_1 = require("../../Utils");
|
|
5
|
-
class ChannelHistory {
|
|
1
|
+
import { Utils } from '../../Utils';
|
|
2
|
+
export class ChannelHistory {
|
|
6
3
|
// public constructor(id: number, subscriber: string, channel: number, time: Date, message: string = '', success: boolean = true, result: string = '') {
|
|
7
4
|
// this.id = id;
|
|
8
5
|
// this.subscriber = subscriber;
|
|
@@ -20,9 +17,8 @@ class ChannelHistory {
|
|
|
20
17
|
log.channel = rawLog.channel;
|
|
21
18
|
log.time = new Date(rawLog.time);
|
|
22
19
|
log.message = rawLog.message;
|
|
23
|
-
log.success =
|
|
20
|
+
log.success = Utils.isTrue(rawLog.success);
|
|
24
21
|
log.result = rawLog.result;
|
|
25
22
|
return log;
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
|
-
exports.ChannelHistory = ChannelHistory;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Subscriber {
|
|
7
|
-
constructor(id, eventTypes, projectEnvironment, task, taskExecution, channels, logLevelThreshold = LogLevel_1.LogLevel.Debug) {
|
|
8
|
-
this.state = State_1.State.Active;
|
|
1
|
+
import { State } from '../State';
|
|
2
|
+
import { LogLevel } from '../Log/LogLevel';
|
|
3
|
+
export class Subscriber {
|
|
4
|
+
constructor(id, eventTypes, projectEnvironment, task, taskExecution, channels, logLevelThreshold = LogLevel.Debug) {
|
|
5
|
+
this.state = State.Active;
|
|
9
6
|
this.id = id;
|
|
10
7
|
this.eventTypes = eventTypes;
|
|
11
8
|
this.projectEnvironment = projectEnvironment;
|
|
@@ -16,7 +13,7 @@ class Subscriber {
|
|
|
16
13
|
}
|
|
17
14
|
static parseRaw(rawSubscriber) {
|
|
18
15
|
let subscriber = new Subscriber(rawSubscriber.id, rawSubscriber.eventTypes, rawSubscriber.projectEnvironment, rawSubscriber.task, rawSubscriber.task_execution, rawSubscriber.channels, rawSubscriber.logLevelThreshold);
|
|
19
|
-
subscriber.state =
|
|
16
|
+
subscriber.state = State.fromString(rawSubscriber.state);
|
|
20
17
|
return subscriber;
|
|
21
18
|
}
|
|
22
19
|
getLogLevelThreshold() {
|
|
@@ -26,4 +23,3 @@ class Subscriber {
|
|
|
26
23
|
return this.logLevelThreshold !== null;
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
|
-
exports.Subscriber = Subscriber;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PagedResult = void 0;
|
|
4
|
-
class PagedResult {
|
|
1
|
+
export class PagedResult {
|
|
5
2
|
constructor(data, pageSize = null, totalCount = null) {
|
|
6
3
|
this.data = data;
|
|
7
4
|
if (pageSize === null) {
|
|
@@ -14,4 +11,3 @@ class PagedResult {
|
|
|
14
11
|
this.totalCount = totalCount;
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
|
-
exports.PagedResult = PagedResult;
|
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.PlatformLanguage = void 0;
|
|
4
|
-
const State_1 = require("../State");
|
|
5
|
-
class PlatformLanguage {
|
|
1
|
+
import { State } from '../State';
|
|
2
|
+
export class PlatformLanguage {
|
|
6
3
|
constructor(id, name) {
|
|
7
4
|
this.description = '';
|
|
8
|
-
this.state =
|
|
5
|
+
this.state = State.Active;
|
|
9
6
|
this.id = id;
|
|
10
7
|
this.name = name;
|
|
11
8
|
}
|
|
12
9
|
static parse(rawLanguage) {
|
|
13
10
|
let language = new PlatformLanguage(rawLanguage.id, rawLanguage.name);
|
|
14
11
|
language.description = rawLanguage.description;
|
|
15
|
-
language.state =
|
|
12
|
+
language.state = State.fromString(rawLanguage.state);
|
|
16
13
|
return language;
|
|
17
14
|
}
|
|
18
15
|
}
|
|
19
|
-
exports.PlatformLanguage = PlatformLanguage;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.Project = void 0;
|
|
4
|
-
const State_1 = require("../State");
|
|
5
|
-
class Project {
|
|
1
|
+
import { State } from '../State';
|
|
2
|
+
export class Project {
|
|
6
3
|
constructor(id, key, name) {
|
|
7
4
|
this.default = false;
|
|
8
|
-
this.state =
|
|
5
|
+
this.state = State.Active;
|
|
9
6
|
this.id = id;
|
|
10
7
|
this.key = key;
|
|
11
8
|
this.name = name;
|
|
@@ -20,8 +17,7 @@ class Project {
|
|
|
20
17
|
project.source_account = rawProject.source_account;
|
|
21
18
|
project.source_repository = rawProject.source_repository;
|
|
22
19
|
project.language = rawProject.language;
|
|
23
|
-
project.state =
|
|
20
|
+
project.state = State.fromString(rawProject.state);
|
|
24
21
|
return project;
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
exports.Project = Project;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const ProjectDeployCommit_1 = require("./ProjectDeployCommit");
|
|
6
|
-
const Utils_1 = require("../../Utils");
|
|
7
|
-
class ProjectDeploy {
|
|
1
|
+
import { ProjectDeployStatus } from './ProjectDeployStatus';
|
|
2
|
+
import { ProjectDeployCommit } from './ProjectDeployCommit';
|
|
3
|
+
import { Utils } from '../../Utils';
|
|
4
|
+
export class ProjectDeploy {
|
|
8
5
|
constructor() {
|
|
9
|
-
this.status =
|
|
6
|
+
this.status = ProjectDeployStatus.Unknown;
|
|
10
7
|
this.commits = [];
|
|
11
8
|
}
|
|
12
9
|
static parse(rawProjectDeploy) {
|
|
@@ -17,14 +14,14 @@ class ProjectDeploy {
|
|
|
17
14
|
projectDeploy.requested = new Date(rawProjectDeploy.requested);
|
|
18
15
|
projectDeploy.started = new Date(rawProjectDeploy.started);
|
|
19
16
|
projectDeploy.finished = new Date(rawProjectDeploy.finished);
|
|
20
|
-
projectDeploy.status =
|
|
21
|
-
if (!
|
|
17
|
+
projectDeploy.status = ProjectDeployStatus.fromString(rawProjectDeploy.status);
|
|
18
|
+
if (!Utils.isNullOrUndefined(rawProjectDeploy.bytes)) {
|
|
22
19
|
projectDeploy.bytes = parseInt(rawProjectDeploy.bytes);
|
|
23
20
|
}
|
|
24
21
|
projectDeploy.commit_hash = rawProjectDeploy.commit_hash;
|
|
25
22
|
const rawProjectDeployCommits = rawProjectDeploy.commits;
|
|
26
23
|
for (let rawProjectDeployCommit of rawProjectDeployCommits) {
|
|
27
|
-
let projectDeployCommit = new
|
|
24
|
+
let projectDeployCommit = new ProjectDeployCommit();
|
|
28
25
|
projectDeployCommit.commit_hash = rawProjectDeployCommit.commit_hash;
|
|
29
26
|
projectDeployCommit.commit_date = new Date(rawProjectDeployCommit.commit_date);
|
|
30
27
|
projectDeployCommit.commit_message = rawProjectDeployCommit.commit_message;
|
|
@@ -35,4 +32,3 @@ class ProjectDeploy {
|
|
|
35
32
|
return projectDeploy;
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
|
-
exports.ProjectDeploy = ProjectDeploy;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ProjectDeployStatus = void 0;
|
|
4
|
-
const Utils_1 = require("../../Utils");
|
|
5
|
-
var ProjectDeployStatus;
|
|
1
|
+
import { Utils } from '../../Utils';
|
|
2
|
+
export var ProjectDeployStatus;
|
|
6
3
|
(function (ProjectDeployStatus) {
|
|
7
4
|
ProjectDeployStatus["Unknown"] = "unknown";
|
|
8
5
|
ProjectDeployStatus["Pending"] = "pending";
|
|
@@ -11,14 +8,14 @@ var ProjectDeployStatus;
|
|
|
11
8
|
ProjectDeployStatus["Failed"] = "failed";
|
|
12
9
|
ProjectDeployStatus["Stopped"] = "stopped";
|
|
13
10
|
ProjectDeployStatus["Complete"] = "complete";
|
|
14
|
-
})(ProjectDeployStatus
|
|
11
|
+
})(ProjectDeployStatus || (ProjectDeployStatus = {}));
|
|
15
12
|
(function (ProjectDeployStatus) {
|
|
16
13
|
function fromString(input) {
|
|
17
|
-
const result =
|
|
14
|
+
const result = Utils.parseEnum(input, ProjectDeployStatus);
|
|
18
15
|
if (result === null) {
|
|
19
16
|
throw new Error('Unable to parse ProjectDeployStatus from string: Unknown ProjectDeployStatus "' + input + '"');
|
|
20
17
|
}
|
|
21
18
|
return result;
|
|
22
19
|
}
|
|
23
20
|
ProjectDeployStatus.fromString = fromString;
|
|
24
|
-
})(ProjectDeployStatus
|
|
21
|
+
})(ProjectDeployStatus || (ProjectDeployStatus = {}));
|