attlaz-client 1.9.39 → 1.9.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Client.d.ts +2 -2
- package/dist/Client.js +5 -3
- package/dist/Model/Deployment/{CodeDeployStrategy.d.ts → CodeSourceBuildStrategy.d.ts} +2 -2
- package/dist/Model/Deployment/{CodeDeployStrategy.js → CodeSourceBuildStrategy.js} +4 -4
- package/dist/Model/Flow/FlowRunHistory.d.ts +1 -1
- package/dist/Model/Flow/FlowRunHistory.js +5 -4
- package/dist/Model/Flow/FlowRunStats.d.ts +1 -0
- package/dist/Model/Flow/FlowRunStats.js +15 -0
- package/dist/Model/Flow/FlowRunSummary.d.ts +1 -1
- package/dist/Model/Flow/FlowRunSummary.js +6 -6
- package/dist/Model/HealthAlert/HealthAlert.js +2 -1
- package/dist/Model/Log/Log.js +2 -1
- package/dist/Model/Messaging/ChannelHistory.d.ts +3 -3
- package/dist/Model/Messaging/ChannelHistory.js +8 -8
- package/dist/Model/Notification.d.ts +1 -0
- package/dist/Model/Notification.js +12 -0
- package/dist/Model/Project/ProjectDeploy.js +5 -4
- package/dist/Model/Storage/StorageItem.js +2 -1
- package/dist/Model/Storage/StorageItemInformation.js +2 -1
- package/dist/Model/Trigger/Trigger.js +0 -1
- package/dist/Service/CodeSourceBuildStrategyEndpoint.d.ts +6 -0
- package/dist/Service/CodeSourceBuildStrategyEndpoint.js +14 -0
- package/dist/Service/FlowRunStatsEndpoint.js +1 -4
- package/dist/Service/NotificationsEndpoint.js +2 -16
- package/dist/Service/UserEndpoint.js +2 -1
- package/dist/Service/WorkspaceMemberEndpoint.js +1 -1
- package/package.json +1 -1
- package/dist/Service/CodeSourceDeployStrategyEndpoint.d.ts +0 -6
- package/dist/Service/CodeSourceDeployStrategyEndpoint.js +0 -14
package/dist/Client.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { LogEndpoint } from './Service/LogEndpoint';
|
|
|
25
25
|
import { TriggerEndpoint } from './Service/TriggerEndpoint';
|
|
26
26
|
import { PlatformEndpoint } from './Service/PlatformEndpoint';
|
|
27
27
|
import { FlowRunStatsEndpoint } from './Service/FlowRunStatsEndpoint';
|
|
28
|
-
import {
|
|
28
|
+
import { CodeSourceBuildStrategyEndpoint } from './Service/CodeSourceBuildStrategyEndpoint';
|
|
29
29
|
export declare class Client {
|
|
30
30
|
private readonly apiEndpoint;
|
|
31
31
|
private readonly clientId;
|
|
@@ -70,6 +70,6 @@ export declare class Client {
|
|
|
70
70
|
getWorkerConfigEndpoint(): WorkerConfigEndpoint;
|
|
71
71
|
getQueueEndpoint(): QueueEndpoint;
|
|
72
72
|
getHealthAlertEndpoint(): HealthAlertEndpoint;
|
|
73
|
-
|
|
73
|
+
getCodeSourceBuildStrategyEndpoint(): CodeSourceBuildStrategyEndpoint;
|
|
74
74
|
private getEndpoint;
|
|
75
75
|
}
|
package/dist/Client.js
CHANGED
|
@@ -29,6 +29,7 @@ const TriggerEndpoint_1 = require("./Service/TriggerEndpoint");
|
|
|
29
29
|
const PlatformEndpoint_1 = require("./Service/PlatformEndpoint");
|
|
30
30
|
const FlowRunStatsEndpoint_1 = require("./Service/FlowRunStatsEndpoint");
|
|
31
31
|
const version_1 = require("./version");
|
|
32
|
+
const CodeSourceBuildStrategyEndpoint_1 = require("./Service/CodeSourceBuildStrategyEndpoint");
|
|
32
33
|
class Client {
|
|
33
34
|
constructor(apiEndpoint, clientId, clientSecret) {
|
|
34
35
|
this.apiEndpoint = apiEndpoint;
|
|
@@ -59,7 +60,8 @@ class Client {
|
|
|
59
60
|
WorkerConfigEndpoint: WorkerConfigEndpoint_1.WorkerConfigEndpoint,
|
|
60
61
|
HealthAlertEndpoint: HealthAlertEndpoint_1.HealthAlertEndpoint,
|
|
61
62
|
PlatformEndpoint: PlatformEndpoint_1.PlatformEndpoint,
|
|
62
|
-
FlowRunStatsEndpoint: FlowRunStatsEndpoint_1.FlowRunStatsEndpoint
|
|
63
|
+
FlowRunStatsEndpoint: FlowRunStatsEndpoint_1.FlowRunStatsEndpoint,
|
|
64
|
+
CodeSourceBuildStrategyEndpoint: CodeSourceBuildStrategyEndpoint_1.CodeSourceBuildStrategyEndpoint
|
|
63
65
|
};
|
|
64
66
|
const options = new OAuthClientOptions_1.OAuthClientOptions(apiEndpoint, clientId, clientSecret, this.getHeaders());
|
|
65
67
|
this.httpClient = new OAuthClient_1.OAuthClient(options);
|
|
@@ -194,8 +196,8 @@ class Client {
|
|
|
194
196
|
getHealthAlertEndpoint() {
|
|
195
197
|
return this.getEndpoint('healt-alert', this.Store.HealthAlertEndpoint);
|
|
196
198
|
}
|
|
197
|
-
|
|
198
|
-
return this.getEndpoint('code-source-deploy-strategy', this.Store.
|
|
199
|
+
getCodeSourceBuildStrategyEndpoint() {
|
|
200
|
+
return this.getEndpoint('code-source-deploy-strategy', this.Store.CodeSourceBuildStrategyEndpoint);
|
|
199
201
|
}
|
|
200
202
|
getEndpoint(key, className) {
|
|
201
203
|
//const classNameString: string = className.name;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StateAware } from '../StateAware';
|
|
2
2
|
import { State } from '../State';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class CodeSourceBuildStrategy implements StateAware {
|
|
4
4
|
id: string;
|
|
5
5
|
name: string;
|
|
6
6
|
description: string;
|
|
7
7
|
state: State;
|
|
8
|
-
static parse(raw: any):
|
|
8
|
+
static parse(raw: any): CodeSourceBuildStrategy;
|
|
9
9
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CodeSourceBuildStrategy = void 0;
|
|
4
4
|
const State_1 = require("../State");
|
|
5
|
-
class
|
|
5
|
+
class CodeSourceBuildStrategy {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.state = State_1.State.Active;
|
|
8
8
|
}
|
|
9
9
|
static parse(raw) {
|
|
10
|
-
let codeDeployStrategy = new
|
|
10
|
+
let codeDeployStrategy = new CodeSourceBuildStrategy();
|
|
11
11
|
codeDeployStrategy.id = raw.id;
|
|
12
12
|
codeDeployStrategy.name = raw.name;
|
|
13
13
|
codeDeployStrategy.description = raw.description;
|
|
@@ -15,4 +15,4 @@ class CodeDeployStrategy {
|
|
|
15
15
|
return codeDeployStrategy;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
exports.
|
|
18
|
+
exports.CodeSourceBuildStrategy = CodeSourceBuildStrategy;
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowRunHistory = void 0;
|
|
4
4
|
const FlowRunStatus_1 = require("./FlowRunStatus");
|
|
5
|
+
const Utils_1 = require("../../Utils");
|
|
5
6
|
class FlowRunHistory {
|
|
6
|
-
static parse(
|
|
7
|
+
static parse(rawFlowRunHistory) {
|
|
7
8
|
let taskExecutionHistory = new FlowRunHistory();
|
|
8
|
-
taskExecutionHistory.id =
|
|
9
|
-
taskExecutionHistory.time =
|
|
10
|
-
taskExecutionHistory.status = FlowRunStatus_1.FlowRunStatus.fromString(
|
|
9
|
+
taskExecutionHistory.id = rawFlowRunHistory.id;
|
|
10
|
+
taskExecutionHistory.time = Utils_1.Utils.parseRawDate(rawFlowRunHistory.time);
|
|
11
|
+
taskExecutionHistory.status = FlowRunStatus_1.FlowRunStatus.fromString(rawFlowRunHistory.status);
|
|
11
12
|
return taskExecutionHistory;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowRunStats = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
4
5
|
class FlowRunStats {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.memory = null;
|
|
@@ -12,5 +13,19 @@ class FlowRunStats {
|
|
|
12
13
|
this.fileRead = null;
|
|
13
14
|
this.fileWrite = null;
|
|
14
15
|
}
|
|
16
|
+
static parse(raw) {
|
|
17
|
+
const flowRunStats = new FlowRunStats();
|
|
18
|
+
flowRunStats.flowRunId = raw.flow_run;
|
|
19
|
+
flowRunStats.time = Utils_1.Utils.parseRawDate(raw.time);
|
|
20
|
+
flowRunStats.memory = raw.memory;
|
|
21
|
+
flowRunStats.memoryLimit = raw.memory_limit;
|
|
22
|
+
flowRunStats.cpu = raw.cpu;
|
|
23
|
+
flowRunStats.cpuLimit = raw.cpu_limit;
|
|
24
|
+
flowRunStats.networkOutbound = raw.network_outbound;
|
|
25
|
+
flowRunStats.networkInbound = raw.network_inbound;
|
|
26
|
+
flowRunStats.fileRead = raw.file_read;
|
|
27
|
+
flowRunStats.fileWrite = raw.file_write;
|
|
28
|
+
return flowRunStats;
|
|
29
|
+
}
|
|
15
30
|
}
|
|
16
31
|
exports.FlowRunStats = FlowRunStats;
|
|
@@ -9,12 +9,12 @@ class FlowRunSummary extends FlowRun_1.FlowRun {
|
|
|
9
9
|
super(...arguments);
|
|
10
10
|
this.status = FlowRunStatus_1.FlowRunStatus.Unknown;
|
|
11
11
|
}
|
|
12
|
-
static parse(
|
|
13
|
-
let taskExecutionSummary = FlowRun_1.FlowRun.parse(
|
|
14
|
-
taskExecutionSummary.time = Utils_1.Utils.parseRawDate(
|
|
15
|
-
taskExecutionSummary.runDuration =
|
|
16
|
-
taskExecutionSummary.pendingDuration =
|
|
17
|
-
taskExecutionSummary.status = FlowRunStatus_1.FlowRunStatus.fromString(
|
|
12
|
+
static parse(rawFlowRunSummary) {
|
|
13
|
+
let taskExecutionSummary = FlowRun_1.FlowRun.parse(rawFlowRunSummary);
|
|
14
|
+
taskExecutionSummary.time = Utils_1.Utils.parseRawDate(rawFlowRunSummary.time);
|
|
15
|
+
taskExecutionSummary.runDuration = rawFlowRunSummary.run_duration;
|
|
16
|
+
taskExecutionSummary.pendingDuration = rawFlowRunSummary.pending_duration;
|
|
17
|
+
taskExecutionSummary.status = FlowRunStatus_1.FlowRunStatus.fromString(rawFlowRunSummary.status);
|
|
18
18
|
return taskExecutionSummary;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.HealthAlert = void 0;
|
|
4
4
|
const HealthTestType_1 = require("./HealthTestType");
|
|
5
5
|
const HealthAlertStatus_1 = require("./HealthAlertStatus");
|
|
6
|
+
const Utils_1 = require("../../Utils");
|
|
6
7
|
class HealthAlert {
|
|
7
8
|
constructor(healthTestType, status) {
|
|
8
9
|
this.data = [];
|
|
@@ -14,7 +15,7 @@ class HealthAlert {
|
|
|
14
15
|
static parse(raw) {
|
|
15
16
|
let healthAlert = new HealthAlert(HealthTestType_1.HealthTestType.fromString(raw.health_test_type), HealthAlertStatus_1.HealthAlertStatus.fromString(raw.status));
|
|
16
17
|
healthAlert.id = raw.id;
|
|
17
|
-
healthAlert.date =
|
|
18
|
+
healthAlert.date = Utils_1.Utils.parseRawDate(raw.date);
|
|
18
19
|
healthAlert.data = raw.data;
|
|
19
20
|
return healthAlert;
|
|
20
21
|
}
|
package/dist/Model/Log/Log.js
CHANGED
|
@@ -5,6 +5,7 @@ const LogLevel_1 = require("./LogLevel");
|
|
|
5
5
|
const LogStreamId_1 = require("./LogStreamId");
|
|
6
6
|
const LogStatus_1 = require("./LogStatus");
|
|
7
7
|
const DataValueCollection_1 = require("../DataValueCollection");
|
|
8
|
+
const Utils_1 = require("../../Utils");
|
|
8
9
|
class Log {
|
|
9
10
|
constructor(logStream, message, level, date) {
|
|
10
11
|
this.id = null;
|
|
@@ -16,7 +17,7 @@ class Log {
|
|
|
16
17
|
this.tags = new DataValueCollection_1.DataValueCollection();
|
|
17
18
|
}
|
|
18
19
|
static parse(rawLog) {
|
|
19
|
-
const date =
|
|
20
|
+
const date = Utils_1.Utils.parseRawDate(rawLog.date);
|
|
20
21
|
const level = LogLevel_1.LogLevel.fromString(rawLog.level);
|
|
21
22
|
const logStream = new LogStreamId_1.LogStreamId(rawLog.log_stream.id);
|
|
22
23
|
let log = new Log(logStream, rawLog.message, level, date);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare class ChannelHistory {
|
|
2
2
|
id: number;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
subscriberId: string;
|
|
4
|
+
channelId: number;
|
|
5
5
|
time: Date;
|
|
6
6
|
message: any;
|
|
7
7
|
success: boolean;
|
|
8
8
|
result: string;
|
|
9
|
-
static parse(
|
|
9
|
+
static parse(rawChannelHistory: any): ChannelHistory;
|
|
10
10
|
}
|
|
@@ -13,15 +13,15 @@ class ChannelHistory {
|
|
|
13
13
|
// this.result = result;
|
|
14
14
|
//
|
|
15
15
|
// }
|
|
16
|
-
static parse(
|
|
16
|
+
static parse(rawChannelHistory) {
|
|
17
17
|
let log = new ChannelHistory();
|
|
18
|
-
log.id =
|
|
19
|
-
log.
|
|
20
|
-
log.
|
|
21
|
-
log.time =
|
|
22
|
-
log.message =
|
|
23
|
-
log.success = Utils_1.Utils.isTrue(
|
|
24
|
-
log.result =
|
|
18
|
+
log.id = rawChannelHistory.id;
|
|
19
|
+
log.subscriberId = rawChannelHistory.subscriber;
|
|
20
|
+
log.channelId = rawChannelHistory.channel;
|
|
21
|
+
log.time = Utils_1.Utils.parseRawDate(rawChannelHistory.time);
|
|
22
|
+
log.message = rawChannelHistory.message;
|
|
23
|
+
log.success = Utils_1.Utils.isTrue(rawChannelHistory.success);
|
|
24
|
+
log.result = rawChannelHistory.result;
|
|
25
25
|
return log;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Notification = void 0;
|
|
4
|
+
const Utils_1 = require("../Utils");
|
|
4
5
|
class Notification {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.acknowledged = false;
|
|
7
8
|
}
|
|
9
|
+
static parse(rawNotification) {
|
|
10
|
+
let notification = new Notification();
|
|
11
|
+
notification.id = rawNotification.id;
|
|
12
|
+
notification.userId = rawNotification.user;
|
|
13
|
+
notification.type = rawNotification.type;
|
|
14
|
+
notification.subject = rawNotification.subject;
|
|
15
|
+
notification.body = rawNotification.body;
|
|
16
|
+
notification.time = Utils_1.Utils.parseRawDate(rawNotification.time);
|
|
17
|
+
notification.acknowledged = rawNotification.acknowledged === 1;
|
|
18
|
+
return notification;
|
|
19
|
+
}
|
|
8
20
|
}
|
|
9
21
|
exports.Notification = Notification;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ProjectDeploy = void 0;
|
|
4
4
|
const ProjectDeployStatus_1 = require("./ProjectDeployStatus");
|
|
5
5
|
const ProjectDeployCommit_1 = require("./ProjectDeployCommit");
|
|
6
|
+
const Utils_1 = require("../../Utils");
|
|
6
7
|
class ProjectDeploy {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.status = ProjectDeployStatus_1.ProjectDeployStatus.Unknown;
|
|
@@ -15,9 +16,9 @@ class ProjectDeploy {
|
|
|
15
16
|
projectDeploy.platformId = rawProjectDeploy.platform;
|
|
16
17
|
projectDeploy.buildStrategyId = rawProjectDeploy.build_strategy;
|
|
17
18
|
projectDeploy.userId = rawProjectDeploy.user;
|
|
18
|
-
projectDeploy.requested =
|
|
19
|
-
projectDeploy.started =
|
|
20
|
-
projectDeploy.finished =
|
|
19
|
+
projectDeploy.requested = Utils_1.Utils.parseRawDate(rawProjectDeploy.requested);
|
|
20
|
+
projectDeploy.started = Utils_1.Utils.parseRawDate(rawProjectDeploy.started);
|
|
21
|
+
projectDeploy.finished = Utils_1.Utils.parseRawDate(rawProjectDeploy.finished);
|
|
21
22
|
projectDeploy.status = ProjectDeployStatus_1.ProjectDeployStatus.fromString(rawProjectDeploy.status);
|
|
22
23
|
projectDeploy.bytes = parseInt(rawProjectDeploy.bytes);
|
|
23
24
|
projectDeploy.path = rawProjectDeploy.path;
|
|
@@ -26,7 +27,7 @@ class ProjectDeploy {
|
|
|
26
27
|
for (let rawProjectDeployCommit of rawProjectDeployCommits) {
|
|
27
28
|
let projectDeployCommit = new ProjectDeployCommit_1.ProjectDeployCommit();
|
|
28
29
|
projectDeployCommit.hash = rawProjectDeployCommit.commit_hash;
|
|
29
|
-
projectDeployCommit.date =
|
|
30
|
+
projectDeployCommit.date = Utils_1.Utils.parseRawDate(rawProjectDeployCommit.commit_date);
|
|
30
31
|
projectDeployCommit.message = rawProjectDeployCommit.commit_message;
|
|
31
32
|
projectDeployCommit.authorName = rawProjectDeployCommit.commit_author_name;
|
|
32
33
|
projectDeployCommit.authorEmail = rawProjectDeployCommit.commit_author_email;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StorageItem = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
4
5
|
class StorageItem {
|
|
5
6
|
static parse(raw) {
|
|
6
7
|
let storageItem = new StorageItem();
|
|
7
8
|
storageItem.key = raw.key;
|
|
8
9
|
storageItem.bytes = raw.bytes;
|
|
9
10
|
storageItem.value = raw.value;
|
|
10
|
-
storageItem.expiration = raw.expiration === null ? null :
|
|
11
|
+
storageItem.expiration = raw.expiration === null ? null : Utils_1.Utils.parseRawDate(raw.expiration);
|
|
11
12
|
return storageItem;
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StorageItemInformation = void 0;
|
|
4
|
+
const Utils_1 = require("../../Utils");
|
|
4
5
|
class StorageItemInformation {
|
|
5
6
|
static parse(raw) {
|
|
6
7
|
let storageItemInformation = new StorageItemInformation();
|
|
7
8
|
storageItemInformation.key = raw.key;
|
|
8
9
|
storageItemInformation.bytes = raw.bytes;
|
|
9
|
-
storageItemInformation.expiration = raw.expiration === null ? null :
|
|
10
|
+
storageItemInformation.expiration = raw.expiration === null ? null : Utils_1.Utils.parseRawDate(raw.expiration);
|
|
10
11
|
return storageItemInformation;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -20,7 +20,6 @@ class Trigger extends MetaDataAware_1.MetaDataAware {
|
|
|
20
20
|
this.arguments = {};
|
|
21
21
|
}
|
|
22
22
|
static parse(rawTrigger) {
|
|
23
|
-
console.log(rawTrigger);
|
|
24
23
|
const type = TriggerType_1.TriggerType.fromString(rawTrigger.type);
|
|
25
24
|
const data = rawTrigger.data;
|
|
26
25
|
const flowId = rawTrigger.flow;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Endpoint } from './Endpoint';
|
|
2
|
+
import { CollectionResult } from '../Model/Result/CollectionResult';
|
|
3
|
+
import { CodeSourceBuildStrategy } from '../Model/Deployment/CodeSourceBuildStrategy';
|
|
4
|
+
export declare class CodeSourceBuildStrategyEndpoint extends Endpoint {
|
|
5
|
+
getAll(workspaceId: string): Promise<CollectionResult<CodeSourceBuildStrategy>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CodeSourceBuildStrategyEndpoint = void 0;
|
|
4
|
+
const Endpoint_1 = require("./Endpoint");
|
|
5
|
+
const CodeSourceBuildStrategy_1 = require("../Model/Deployment/CodeSourceBuildStrategy");
|
|
6
|
+
class CodeSourceBuildStrategyEndpoint extends Endpoint_1.Endpoint {
|
|
7
|
+
async getAll(workspaceId) {
|
|
8
|
+
let cmd = '/workspaces/' + workspaceId + '/codesourcedeploystrategies';
|
|
9
|
+
const result = await this.requestCollection(cmd, null, CodeSourceBuildStrategy_1.CodeSourceBuildStrategy.parse);
|
|
10
|
+
return result;
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.CodeSourceBuildStrategyEndpoint = CodeSourceBuildStrategyEndpoint;
|
|
@@ -7,10 +7,7 @@ class FlowRunStatsEndpoint extends Endpoint_1.Endpoint {
|
|
|
7
7
|
async create(flowRunStats) {
|
|
8
8
|
let url = '/flowruns/' + flowRunStats.flowRunId + '/stats';
|
|
9
9
|
try {
|
|
10
|
-
const
|
|
11
|
-
return new FlowRunStats_1.FlowRunStats();
|
|
12
|
-
};
|
|
13
|
-
const result = await this.requestObject(url, flowRunStats, parser, 'POST');
|
|
10
|
+
const result = await this.requestObject(url, flowRunStats, FlowRunStats_1.FlowRunStats.parse, 'POST');
|
|
14
11
|
const createdFlowRunStat = result.getData();
|
|
15
12
|
if (createdFlowRunStat === null) {
|
|
16
13
|
throw new Error('Unable to create stats: wrong response from API');
|
|
@@ -5,25 +5,11 @@ const Endpoint_1 = require("./Endpoint");
|
|
|
5
5
|
const Notification_1 = require("../Model/Notification");
|
|
6
6
|
class NotificationsEndpoint extends Endpoint_1.Endpoint {
|
|
7
7
|
async getAll(unacknowledgedOnly = false) {
|
|
8
|
-
const
|
|
9
|
-
let notification = new Notification_1.Notification();
|
|
10
|
-
notification.id = rawNotification.id;
|
|
11
|
-
notification.userId = rawNotification.user;
|
|
12
|
-
notification.type = rawNotification.type;
|
|
13
|
-
notification.subject = rawNotification.subject;
|
|
14
|
-
notification.body = rawNotification.body;
|
|
15
|
-
notification.time = rawNotification.time;
|
|
16
|
-
notification.acknowledged = rawNotification.acknowledged === 1;
|
|
17
|
-
return notification;
|
|
18
|
-
};
|
|
19
|
-
const result = await this.requestCollection('/notifications?unacknowledgedOnly=' + unacknowledgedOnly, null, parser);
|
|
8
|
+
const result = await this.requestCollection('/notifications?unacknowledgedOnly=' + unacknowledgedOnly, null, Notification_1.Notification.parse);
|
|
20
9
|
return result;
|
|
21
10
|
}
|
|
22
11
|
async save(notification) {
|
|
23
|
-
const
|
|
24
|
-
return raw;
|
|
25
|
-
};
|
|
26
|
-
const result = await this.requestObject('/notifications', notification, parser, 'POST');
|
|
12
|
+
const result = await this.requestObject('/notifications', notification, Notification_1.Notification.parse, 'POST');
|
|
27
13
|
const savedNotification = result.getData();
|
|
28
14
|
if (savedNotification === null) {
|
|
29
15
|
throw new Error('Unable to save notification: wrong response from API');
|
|
@@ -4,6 +4,7 @@ exports.UserEndpoint = void 0;
|
|
|
4
4
|
const UserAuthProvider_1 = require("../Model/User/UserAuthProvider");
|
|
5
5
|
const Endpoint_1 = require("./Endpoint");
|
|
6
6
|
const User_1 = require("../Model/User");
|
|
7
|
+
const Utils_1 = require("../Utils");
|
|
7
8
|
class UserEndpoint extends Endpoint_1.Endpoint {
|
|
8
9
|
async getUser() {
|
|
9
10
|
let cmd = '/users';
|
|
@@ -15,7 +16,7 @@ class UserEndpoint extends Endpoint_1.Endpoint {
|
|
|
15
16
|
const parser = (raw) => {
|
|
16
17
|
// TODO: should we validate this more?
|
|
17
18
|
const token = raw;
|
|
18
|
-
token.expires =
|
|
19
|
+
token.expires = Utils_1.Utils.parseRawDate(raw.expires);
|
|
19
20
|
return token;
|
|
20
21
|
};
|
|
21
22
|
const result = await this.requestObject('/auth/providers/' + providerType, data, parser, 'POST', false);
|
|
@@ -94,7 +94,7 @@ class WorkspaceMemberEndpoint extends Endpoint_1.Endpoint {
|
|
|
94
94
|
userAction.resourceType = rawUserEvent.resource_type;
|
|
95
95
|
userAction.description = rawUserEvent.description;
|
|
96
96
|
userAction.ip = rawUserEvent.ip;
|
|
97
|
-
userAction.time =
|
|
97
|
+
userAction.time = Utils_1.Utils.parseRawDate(rawUserEvent.time);
|
|
98
98
|
userAction.result = rawUserEvent.result;
|
|
99
99
|
userAction.data = DataValueCollection_1.DataValueCollection.fromObject(rawUserEvent.data);
|
|
100
100
|
return userAction;
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Endpoint } from './Endpoint';
|
|
2
|
-
import { CollectionResult } from '../Model/Result/CollectionResult';
|
|
3
|
-
import { CodeDeployStrategy } from '../Model/Deployment/CodeDeployStrategy';
|
|
4
|
-
export declare class CodeSourceDeployStrategyEndpoint extends Endpoint {
|
|
5
|
-
getAll(workspaceId: string): Promise<CollectionResult<CodeDeployStrategy>>;
|
|
6
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CodeSourceDeployStrategyEndpoint = void 0;
|
|
4
|
-
const Endpoint_1 = require("./Endpoint");
|
|
5
|
-
const CodeDeployStrategy_1 = require("../Model/Deployment/CodeDeployStrategy");
|
|
6
|
-
class CodeSourceDeployStrategyEndpoint extends Endpoint_1.Endpoint {
|
|
7
|
-
async getAll(workspaceId) {
|
|
8
|
-
let cmd = '/workspaces/' + workspaceId + '/codedeploystrategies';
|
|
9
|
-
const result = await this.requestCollection(cmd, null, CodeDeployStrategy_1.CodeDeployStrategy.parse);
|
|
10
|
-
return result;
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.CodeSourceDeployStrategyEndpoint = CodeSourceDeployStrategyEndpoint;
|