attlaz-client 1.6.11 → 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.
Files changed (125) hide show
  1. package/dist/Client.js +55 -59
  2. package/dist/Http/HttpClient.d.ts +3 -1
  3. package/dist/Http/HttpClient.js +63 -59
  4. package/dist/Http/HttpClientRequest.js +5 -9
  5. package/dist/Http/HttpClientRequest.spec.js +3 -5
  6. package/dist/Http/HttpClientResponse.js +1 -5
  7. package/dist/Http/OAuthClient.js +19 -23
  8. package/dist/Http/OAuthClient.spec.js +4 -6
  9. package/dist/Http/OAuthClientOptions.js +1 -5
  10. package/dist/Http/OAuthClientToken.js +1 -5
  11. package/dist/Model/Adapter/Adapter.js +1 -5
  12. package/dist/Model/Adapter/AdapterConfiguration.js +1 -5
  13. package/dist/Model/Adapter/AdapterConnection.js +4 -8
  14. package/dist/Model/Config.js +7 -11
  15. package/dist/Model/DataValue.js +1 -5
  16. package/dist/Model/DataValueCollection.js +6 -10
  17. package/dist/Model/Error/ClientError.d.ts +1 -0
  18. package/dist/Model/Error/ClientError.js +16 -16
  19. package/dist/Model/Event/EventType.js +2 -5
  20. package/dist/Model/HealthAlert/HealthAlert.js +4 -8
  21. package/dist/Model/HealthAlert/HealthAlertStatus.js +5 -8
  22. package/dist/Model/HealthAlert/HealthTestType.js +5 -8
  23. package/dist/Model/JsonSerializable.js +1 -5
  24. package/dist/Model/Log/Log.js +11 -15
  25. package/dist/Model/Log/LogLevel.js +5 -8
  26. package/dist/Model/Log/LogQuery.js +1 -5
  27. package/dist/Model/Log/LogStatus.js +5 -8
  28. package/dist/Model/Log/LogStreamId.js +1 -5
  29. package/dist/Model/Messaging/Channel/Channel.js +8 -12
  30. package/dist/Model/Messaging/Channel/ChannelData.js +1 -5
  31. package/dist/Model/Messaging/Channel/ChannelType.js +5 -8
  32. package/dist/Model/Messaging/Channel/EmailChannelData.js +4 -8
  33. package/dist/Model/Messaging/Channel/PushChannelData.js +4 -8
  34. package/dist/Model/Messaging/Channel/SlackChannelData.js +4 -8
  35. package/dist/Model/Messaging/Channel/SmsChannelData.js +4 -8
  36. package/dist/Model/Messaging/Channel/WebhookChannelData.js +4 -8
  37. package/dist/Model/Messaging/ChannelHistory.js +3 -7
  38. package/dist/Model/Messaging/Subscriber.js +6 -10
  39. package/dist/Model/Notification.js +1 -5
  40. package/dist/Model/PagedResult.js +1 -5
  41. package/dist/Model/Project/PlatformLanguage.js +4 -8
  42. package/dist/Model/Project/Project.js +4 -8
  43. package/dist/Model/Project/ProjectDeploy.js +8 -12
  44. package/dist/Model/Project/ProjectDeployCommit.js +1 -5
  45. package/dist/Model/Project/ProjectDeployStatus.js +5 -8
  46. package/dist/Model/Project/ProjectEnvironment.js +6 -10
  47. package/dist/Model/Queue/QueueStatus.js +1 -5
  48. package/dist/Model/Result/DataResult.js +1 -5
  49. package/dist/Model/Result/DataResult.spec.js +2 -4
  50. package/dist/Model/Result/DataResultCollection.js +1 -5
  51. package/dist/Model/Result/ResultError.js +1 -5
  52. package/dist/Model/SourcesAccount.js +1 -5
  53. package/dist/Model/SourcesAccountRepository.js +1 -5
  54. package/dist/Model/State.js +5 -8
  55. package/dist/Model/StateAware.js +1 -2
  56. package/dist/Model/Storage/StorageInformation.js +1 -5
  57. package/dist/Model/Storage/StorageType.js +5 -8
  58. package/dist/Model/Task.js +4 -8
  59. package/dist/Model/TaskExecution/TaskExecutionStats.js +1 -5
  60. package/dist/Model/TaskExecution.js +1 -5
  61. package/dist/Model/TaskExecutionHistory.js +3 -7
  62. package/dist/Model/TaskExecutionResponse.js +1 -5
  63. package/dist/Model/TaskExecutionStatus.js +5 -8
  64. package/dist/Model/TaskExecutionSummary.js +7 -11
  65. package/dist/Model/TaskSummary.js +8 -12
  66. package/dist/Model/Team/Team.js +1 -5
  67. package/dist/Model/Team/TeamMember.js +1 -5
  68. package/dist/Model/Team/TeamMemberInvite.js +3 -7
  69. package/dist/Model/Team/TeamMemberInvite2.js +1 -5
  70. package/dist/Model/Team/TeamMemberInviteState.js +5 -8
  71. package/dist/Model/Team/TeamMemberRole.js +5 -8
  72. package/dist/Model/Trigger/ApiTrigger.js +4 -8
  73. package/dist/Model/Trigger/ApiTriggerData.js +2 -6
  74. package/dist/Model/Trigger/ScheduleTrigger.js +4 -8
  75. package/dist/Model/Trigger/ScheduleTriggerData.js +2 -6
  76. package/dist/Model/Trigger/Trigger.js +15 -19
  77. package/dist/Model/Trigger/TriggerData.js +1 -5
  78. package/dist/Model/Trigger/TriggerType.js +5 -8
  79. package/dist/Model/Trigger/WebhookTrigger.js +4 -8
  80. package/dist/Model/Trigger/WebhookTriggerData.js +2 -6
  81. package/dist/Model/User/UserAuthProvider.js +6 -10
  82. package/dist/Model/User.js +6 -10
  83. package/dist/Model/Worker/Platform.js +8 -12
  84. package/dist/Model/Worker/PlatformImage.js +6 -10
  85. package/dist/Model/Worker/Worker.js +7 -11
  86. package/dist/Model/Worker/WorkerConfig.js +1 -5
  87. package/dist/Model/Worker/WorkerInstance.js +3 -7
  88. package/dist/Model/Worker/WorkerInstanceState.js +5 -8
  89. package/dist/Model/Worker/WorkerState.js +5 -8
  90. package/dist/Service/AdapterEndpoint.js +15 -21
  91. package/dist/Service/ChannelEndpoint.js +11 -15
  92. package/dist/Service/ConfigEndpoint.js +8 -12
  93. package/dist/Service/Endpoint.js +3 -7
  94. package/dist/Service/HealthAlertEndpoint.js +4 -8
  95. package/dist/Service/LogEndpoint.js +15 -19
  96. package/dist/Service/NotificationsEndpoint.js +4 -8
  97. package/dist/Service/PlatformEndpoint.js +6 -10
  98. package/dist/Service/PlatformLanguageEndpoint.js +4 -8
  99. package/dist/Service/ProjectDeployEndpoint.js +7 -11
  100. package/dist/Service/ProjectEndpoint.js +9 -13
  101. package/dist/Service/ProjectEnvironmentEndpoint.js +2 -6
  102. package/dist/Service/QueueEndpoint.js +6 -10
  103. package/dist/Service/SourcesAccountEndpoint.js +8 -12
  104. package/dist/Service/StorageEndpoint.js +2 -6
  105. package/dist/Service/SubscriberEndpoint.js +7 -11
  106. package/dist/Service/TaskEndpoint.js +14 -18
  107. package/dist/Service/TaskExecutionEndpoint.d.ts +1 -1
  108. package/dist/Service/TaskExecutionEndpoint.js +16 -20
  109. package/dist/Service/TaskExecutionRequestEndpoint.js +2 -6
  110. package/dist/Service/TaskExecutionStatsEndpoint.js +4 -8
  111. package/dist/Service/TeamMemberEndpoint.js +14 -18
  112. package/dist/Service/TeamsEndpoint.js +6 -10
  113. package/dist/Service/TriggerEndpoint.js +9 -13
  114. package/dist/Service/UserEndpoint.js +10 -14
  115. package/dist/Service/WorkerConfigEndpoint.js +7 -11
  116. package/dist/Service/WorkerEndpoint.js +7 -11
  117. package/dist/Utils.js +1 -5
  118. package/dist/Utils.spec.js +32 -34
  119. package/dist/auth.spec.js +22 -24
  120. package/dist/data.spec.js +3 -5
  121. package/dist/index.js +105 -215
  122. package/dist/test.js +11 -13
  123. package/dist/version.d.ts +1 -0
  124. package/dist/version.js +1 -0
  125. package/package.json +4 -2
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DataValueCollection = void 0;
4
- const DataValue_1 = require("./DataValue");
5
- const Utils_1 = require("../Utils");
6
- const JsonSerializable_1 = require("./JsonSerializable");
7
- class DataValueCollection extends JsonSerializable_1.JsonSerializable {
1
+ import { DataValue } from './DataValue';
2
+ import { Utils } from '../Utils';
3
+ import { JsonSerializable } from './JsonSerializable';
4
+ export class DataValueCollection extends JsonSerializable {
8
5
  constructor() {
9
6
  super(...arguments);
10
7
  this._values = [];
@@ -13,7 +10,7 @@ class DataValueCollection extends JsonSerializable_1.JsonSerializable {
13
10
  return this._values.length;
14
11
  }
15
12
  static fromObject(rawValues) {
16
- if (Utils_1.Utils.isNullOrUndefined(rawValues)) {
13
+ if (Utils.isNullOrUndefined(rawValues)) {
17
14
  return new DataValueCollection();
18
15
  }
19
16
  const result = new DataValueCollection();
@@ -30,7 +27,7 @@ class DataValueCollection extends JsonSerializable_1.JsonSerializable {
30
27
  if (existingIndex !== -1) {
31
28
  this._values.splice(existingIndex);
32
29
  }
33
- this._values.push(new DataValue_1.DataValue(key, value));
30
+ this._values.push(new DataValue(key, value));
34
31
  }
35
32
  get(key) {
36
33
  for (const tag of this._values) {
@@ -58,4 +55,3 @@ class DataValueCollection extends JsonSerializable_1.JsonSerializable {
58
55
  return this._values;
59
56
  }
60
57
  }
61
- exports.DataValueCollection = DataValueCollection;
@@ -3,6 +3,7 @@ export declare class ClientError implements Error {
3
3
  name: string;
4
4
  code: number | null;
5
5
  stack: string;
6
+ body: string | null;
6
7
  constructor(message: string, code?: number | null);
7
8
  static fromError(error: Error | any): ClientError;
8
9
  static byStatus(statusCode: number, statusText: string): ClientError | null;
@@ -1,9 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ClientError = void 0;
4
- const HttpClient_1 = require("../../Http/HttpClient");
5
- class ClientError {
1
+ import { HttpClient } from '../../Http/HttpClient';
2
+ export class ClientError {
6
3
  constructor(message, code = null) {
4
+ this.body = null;
7
5
  this.message = message;
8
6
  this.code = code;
9
7
  }
@@ -21,10 +19,10 @@ class ClientError {
21
19
  else {
22
20
  if (error.code !== null && error.code !== undefined) {
23
21
  if (error.code === 'EUNAVAILABLE') {
24
- clientError.code = HttpClient_1.HttpClient.HTTP_UNAVAILABLE;
22
+ clientError.code = HttpClient.HTTP_UNAVAILABLE;
25
23
  }
26
24
  if (error.code === 'EAUTH') {
27
- clientError.code = HttpClient_1.HttpClient.HTTP_UNAUTHORIZED;
25
+ clientError.code = HttpClient.HTTP_UNAUTHORIZED;
28
26
  }
29
27
  // if (error.code === 'ESTATUS' && error.message === 'HTTP status 503') {
30
28
  // clientError.code = HttpClient.HTTP_UNAVAILABLE;
@@ -46,28 +44,31 @@ class ClientError {
46
44
  return null;
47
45
  break;
48
46
  case 400:
49
- return new ClientError('Bad Request', HttpClient_1.HttpClient.HTTP_BAD_REQUEST);
47
+ return new ClientError('Bad Request', HttpClient.HTTP_BAD_REQUEST);
50
48
  break;
51
49
  case 401:
52
- return new ClientError('Unauthorized', HttpClient_1.HttpClient.HTTP_UNAUTHORIZED);
50
+ return new ClientError('Unauthorized', HttpClient.HTTP_UNAUTHORIZED);
53
51
  break;
54
52
  case 403:
55
- return new ClientError('Forbidden', HttpClient_1.HttpClient.HTTP_FORBIDDEN);
53
+ return new ClientError('Forbidden', HttpClient.HTTP_FORBIDDEN);
56
54
  break;
57
55
  case 404:
58
- return new ClientError('Not Found', HttpClient_1.HttpClient.HTTP_NOTFOUND);
56
+ return new ClientError('Not Found', HttpClient.HTTP_NOTFOUND);
59
57
  break;
60
58
  case 405:
61
- return new ClientError('Not allowed', HttpClient_1.HttpClient.HTTP_NOT_ALLOWED);
59
+ return new ClientError('Not allowed', HttpClient.HTTP_NOT_ALLOWED);
62
60
  break;
63
61
  case 422:
64
- return new ClientError('Unprocessable Entity', HttpClient_1.HttpClient.HTTP_UNPROCESSABLE_ENTITY);
62
+ return new ClientError('Unprocessable Entity', HttpClient.HTTP_UNPROCESSABLE_ENTITY);
65
63
  break;
66
64
  case 500:
67
- return new ClientError('Internal Server Error', HttpClient_1.HttpClient.HTTP_INTERNAL_SERVER_ERROR);
65
+ return new ClientError('Internal Server Error', HttpClient.HTTP_INTERNAL_SERVER_ERROR);
66
+ break;
67
+ case 502:
68
+ return new ClientError('Bad gateway', HttpClient.HTTP_BAD_GATEWAY);
68
69
  break;
69
70
  case 503:
70
- return new ClientError('Service not available', HttpClient_1.HttpClient.HTTP_UNAVAILABLE);
71
+ return new ClientError('Service not available', HttpClient.HTTP_UNAVAILABLE);
71
72
  break;
72
73
  default:
73
74
  console.error('Unknown status code "' + statusCode + '"', { code: statusCode, text: statusText });
@@ -76,4 +77,3 @@ class ClientError {
76
77
  return null;
77
78
  }
78
79
  }
79
- exports.ClientError = ClientError;
@@ -1,11 +1,8 @@
1
- "use strict";
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 = exports.EventType || (exports.EventType = {}));
8
+ })(EventType || (EventType = {}));
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HealthAlert = void 0;
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(HealthTestType_1.HealthTestType.fromString(raw.healthTestType), HealthAlertStatus_1.HealthAlertStatus.fromString(raw.status));
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 = exports.HealthAlertStatus || (exports.HealthAlertStatus = {}));
7
+ })(HealthAlertStatus || (HealthAlertStatus = {}));
11
8
  (function (HealthAlertStatus) {
12
9
  function fromString(input) {
13
- const result = Utils_1.Utils.parseEnum(input, HealthAlertStatus);
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 = exports.HealthAlertStatus || (exports.HealthAlertStatus = {}));
17
+ })(HealthAlertStatus || (HealthAlertStatus = {}));
@@ -1,21 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 = exports.HealthTestType || (exports.HealthTestType = {}));
8
+ })(HealthTestType || (HealthTestType = {}));
12
9
  (function (HealthTestType) {
13
10
  function fromString(input) {
14
- const result = Utils_1.Utils.parseEnum(input, HealthTestType);
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 = exports.HealthTestType || (exports.HealthTestType = {}));
18
+ })(HealthTestType || (HealthTestType = {}));
@@ -1,7 +1,4 @@
1
- "use strict";
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;
@@ -1,33 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Log = void 0;
4
- const LogLevel_1 = require("./LogLevel");
5
- const LogStreamId_1 = require("./LogStreamId");
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 = LogStatus_1.LogStatus.Normal;
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 DataValueCollection_1.DataValueCollection();
13
+ this.tags = new DataValueCollection();
17
14
  }
18
15
  static parse(rawLog) {
19
16
  const date = new Date(rawLog.date);
20
- const level = LogLevel_1.LogLevel.fromString(rawLog.level);
21
- const logStream = new LogStreamId_1.LogStreamId(rawLog.logStream.id);
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 = LogStatus_1.LogStatus.fromString(rawLog.status);
23
+ log.status = LogStatus.fromString(rawLog.status);
27
24
  }
28
- log.tags = DataValueCollection_1.DataValueCollection.fromObject(rawLog.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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 = exports.LogLevel || (exports.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 = Utils_1.Utils.parseEnum(input, LogLevel);
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 = exports.LogLevel || (exports.LogLevel = {}));
57
+ })(LogLevel || (LogLevel = {}));
@@ -1,7 +1,4 @@
1
- "use strict";
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 = exports.LogStatus || (exports.LogStatus = {}));
7
+ })(LogStatus || (LogStatus = {}));
11
8
  (function (LogStatus) {
12
9
  function fromString(input) {
13
- const result = __1.Utils.parseEnum(input, LogStatus);
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 = exports.LogStatus || (exports.LogStatus = {}));
17
+ })(LogStatus || (LogStatus = {}));
@@ -1,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogStreamId = void 0;
4
- class LogStreamId {
1
+ export class LogStreamId {
5
2
  constructor(id) {
6
3
  this.id = id;
7
4
  }
8
5
  }
9
- exports.LogStreamId = LogStreamId;
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Channel = void 0;
4
- const ChannelType_1 = require("./ChannelType");
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 = State_1.State.Active;
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 = ChannelType_1.ChannelType.fromString(rawChannel.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 = State_1.State.fromString(rawChannel.state);
21
- channel.private = Utils_1.Utils.isTrue(rawChannel.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
- "use strict";
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 = exports.ChannelType || (exports.ChannelType = {}));
9
+ })(ChannelType || (ChannelType = {}));
13
10
  (function (ChannelType) {
14
11
  function fromString(input) {
15
- const result = Utils_1.Utils.parseEnum(input, ChannelType);
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 = exports.ChannelType || (exports.ChannelType = {}));
19
+ })(ChannelType || (ChannelType = {}));
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EmailChannelData = void 0;
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(ChannelType_1.ChannelType.Email);
5
+ super(ChannelType.Email);
9
6
  this.email = email;
10
7
  }
11
8
  }
12
- exports.EmailChannelData = EmailChannelData;
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PushChannelData = void 0;
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(ChannelType_1.ChannelType.Push);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlackChannelData = void 0;
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(ChannelType_1.ChannelType.Slack);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SmsChannelData = void 0;
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(ChannelType_1.ChannelType.SMS);
5
+ super(ChannelType.SMS);
9
6
  this.phonenumber = phonenumber;
10
7
  }
11
8
  }
12
- exports.SmsChannelData = SmsChannelData;
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebhookChannelData = void 0;
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(ChannelType_1.ChannelType.Webhook);
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 = Utils_1.Utils.isTrue(rawLog.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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Subscriber = void 0;
4
- const State_1 = require("../State");
5
- const LogLevel_1 = require("../Log/LogLevel");
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 = State_1.State.fromString(rawSubscriber.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,9 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Notification = void 0;
4
- class Notification {
1
+ export class Notification {
5
2
  constructor() {
6
3
  this.acknowledged = false;
7
4
  }
8
5
  }
9
- exports.Notification = Notification;
@@ -1,7 +1,4 @@
1
- "use strict";
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
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 = State_1.State.Active;
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 = State_1.State.fromString(rawLanguage.state);
12
+ language.state = State.fromString(rawLanguage.state);
16
13
  return language;
17
14
  }
18
15
  }
19
- exports.PlatformLanguage = PlatformLanguage;