@opentap/runner-client 2.11.0 → 2.12.0-alpha.1.1
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/lib/DTOs.d.ts +16 -0
- package/lib/DTOs.js +32 -0
- package/lib/RunnerClient.d.ts +6 -1
- package/lib/RunnerClient.js +11 -1
- package/package.json +1 -1
package/lib/DTOs.d.ts
CHANGED
|
@@ -73,6 +73,22 @@ export interface ISession {
|
|
|
73
73
|
subject?: string | undefined;
|
|
74
74
|
id?: string;
|
|
75
75
|
}
|
|
76
|
+
export declare class SessionDetails extends Session implements ISessionDetails {
|
|
77
|
+
imageId?: string | undefined;
|
|
78
|
+
executionState?: ExecutionState;
|
|
79
|
+
testPlanRunId?: string | undefined;
|
|
80
|
+
startedBy?: string | undefined;
|
|
81
|
+
constructor(data?: ISessionDetails);
|
|
82
|
+
init(_data?: any): void;
|
|
83
|
+
static fromJS(data: any): SessionDetails;
|
|
84
|
+
toJSON(data?: any): any;
|
|
85
|
+
}
|
|
86
|
+
export interface ISessionDetails extends ISession {
|
|
87
|
+
imageId?: string | undefined;
|
|
88
|
+
executionState?: ExecutionState;
|
|
89
|
+
testPlanRunId?: string | undefined;
|
|
90
|
+
startedBy?: string | undefined;
|
|
91
|
+
}
|
|
76
92
|
export declare class Links implements ILinks {
|
|
77
93
|
editor?: string | undefined;
|
|
78
94
|
constructor(data?: ILinks);
|
package/lib/DTOs.js
CHANGED
|
@@ -199,6 +199,38 @@ var Session = /** @class */ (function () {
|
|
|
199
199
|
return Session;
|
|
200
200
|
}());
|
|
201
201
|
export { Session };
|
|
202
|
+
var SessionDetails = /** @class */ (function (_super) {
|
|
203
|
+
__extends(SessionDetails, _super);
|
|
204
|
+
function SessionDetails(data) {
|
|
205
|
+
return _super.call(this, data) || this;
|
|
206
|
+
}
|
|
207
|
+
SessionDetails.prototype.init = function (_data) {
|
|
208
|
+
_super.prototype.init.call(this, _data);
|
|
209
|
+
if (_data) {
|
|
210
|
+
this.imageId = _data['ImageId'] ? RunStatus.fromJS(_data['ImageId']) : undefined;
|
|
211
|
+
this.executionState = _data['ExecutionState'] ? RunStatus.fromJS(_data['ExecutionState']) : undefined;
|
|
212
|
+
this.testPlanRunId = _data['TestPlanRunId'] ? RunStatus.fromJS(_data['TestPlanRunId']) : undefined;
|
|
213
|
+
this.startedBy = _data['StartedBy'] ? RunStatus.fromJS(_data['StartedBy']) : undefined;
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
SessionDetails.fromJS = function (data) {
|
|
217
|
+
data = typeof data === 'object' ? data : {};
|
|
218
|
+
var result = new SessionDetails();
|
|
219
|
+
result.init(data);
|
|
220
|
+
return result;
|
|
221
|
+
};
|
|
222
|
+
SessionDetails.prototype.toJSON = function (data) {
|
|
223
|
+
data = typeof data === 'object' ? data : {};
|
|
224
|
+
data['ImageId'] = this.imageId;
|
|
225
|
+
data['ExecutionState'] = this.executionState;
|
|
226
|
+
data['TestPlanRunId'] = this.testPlanRunId;
|
|
227
|
+
data['StartedBy'] = this.startedBy;
|
|
228
|
+
_super.prototype.toJSON.call(this, data);
|
|
229
|
+
return data;
|
|
230
|
+
};
|
|
231
|
+
return SessionDetails;
|
|
232
|
+
}(Session));
|
|
233
|
+
export { SessionDetails };
|
|
202
234
|
var Links = /** @class */ (function () {
|
|
203
235
|
function Links(data) {
|
|
204
236
|
if (data) {
|
package/lib/RunnerClient.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Image, Session } from './DTOs';
|
|
1
|
+
import { Image, Session, SessionDetails } from './DTOs';
|
|
2
2
|
import { BaseClient } from './BaseClient';
|
|
3
3
|
import { ConnectionOptions } from 'nats.ws';
|
|
4
4
|
export declare class RunnerClient extends BaseClient {
|
|
@@ -14,6 +14,11 @@ export declare class RunnerClient extends BaseClient {
|
|
|
14
14
|
* @returns {{Promise<Image[]>}}
|
|
15
15
|
*/
|
|
16
16
|
getImages(): Promise<Image[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Get all sessions
|
|
19
|
+
* @returns {{Promise<SessionDetails[]>}}
|
|
20
|
+
*/
|
|
21
|
+
getSessions(): Promise<SessionDetails[]>;
|
|
17
22
|
/**
|
|
18
23
|
* Create a OpenTAP package configuration image from a list image inputs consisting of user specified packages and repositories.
|
|
19
24
|
* @param {Image[]} images List of images
|
package/lib/RunnerClient.js
CHANGED
|
@@ -13,7 +13,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
-
import { Image, Session } from './DTOs';
|
|
16
|
+
import { Image, Session, SessionDetails } from './DTOs';
|
|
17
17
|
import { BaseClient } from './BaseClient';
|
|
18
18
|
var RunnerClient = /** @class */ (function (_super) {
|
|
19
19
|
__extends(RunnerClient, _super);
|
|
@@ -43,6 +43,16 @@ var RunnerClient = /** @class */ (function (_super) {
|
|
|
43
43
|
.then(this.success())
|
|
44
44
|
.catch(this.error());
|
|
45
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Get all sessions
|
|
48
|
+
* @returns {{Promise<SessionDetails[]>}}
|
|
49
|
+
*/
|
|
50
|
+
RunnerClient.prototype.getSessions = function () {
|
|
51
|
+
return this.request('GetSessions')
|
|
52
|
+
.then(function (sessionDetailsArrayJs) { return sessionDetailsArrayJs.map(function (sessionDetailsJs) { return SessionDetails.fromJS(sessionDetailsJs); }); })
|
|
53
|
+
.then(this.success())
|
|
54
|
+
.catch(this.error());
|
|
55
|
+
};
|
|
46
56
|
/**
|
|
47
57
|
* Create a OpenTAP package configuration image from a list image inputs consisting of user specified packages and repositories.
|
|
48
58
|
* @param {Image[]} images List of images
|