@opentap/runner-client 2.1.1 → 2.1.2-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/BaseClient.js +3 -2
- package/lib/RunnerClient.d.ts +3 -2
- package/lib/RunnerClient.js +4 -3
- package/package.json +1 -1
package/lib/BaseClient.js
CHANGED
|
@@ -112,7 +112,7 @@ var BaseClient = /** @class */ (function () {
|
|
|
112
112
|
*/
|
|
113
113
|
BaseClient.prototype.request = function (subject, payload, options, isFullSubject) {
|
|
114
114
|
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
-
var stringCodec, data, headers, opts;
|
|
115
|
+
var stringCodec, data, headers, timeout, opts;
|
|
116
116
|
var _this = this;
|
|
117
117
|
return __generator(this, function (_a) {
|
|
118
118
|
switch (_a.label) {
|
|
@@ -125,7 +125,8 @@ var BaseClient = /** @class */ (function () {
|
|
|
125
125
|
stringCodec = StringCodec();
|
|
126
126
|
data = payload ? stringCodec.encode(JSON.stringify(payload)) : Empty;
|
|
127
127
|
headers = this.buildHeaders();
|
|
128
|
-
|
|
128
|
+
timeout = (options === null || options === void 0 ? void 0 : options.timeout) || this.timeout;
|
|
129
|
+
opts = __assign(__assign({}, options), { timeout: timeout, headers: headers });
|
|
129
130
|
return [4 /*yield*/, this.connection
|
|
130
131
|
.request(subject, data, opts)
|
|
131
132
|
.then(function (message) {
|
package/lib/RunnerClient.d.ts
CHANGED
|
@@ -16,10 +16,11 @@ export declare class RunnerClient extends BaseClient {
|
|
|
16
16
|
getImages(): Promise<Image[]>;
|
|
17
17
|
/**
|
|
18
18
|
* Create a OpenTAP package configuration image from a list image inputs consisting of user specified packages and repositories.
|
|
19
|
-
* @param images List of images
|
|
19
|
+
* @param {Image[]} images List of images
|
|
20
|
+
* @param {number} timeout Optional timeout in milliseconds
|
|
20
21
|
* @returns {{Promise<Image>}}
|
|
21
22
|
*/
|
|
22
|
-
resolveImage(images: Image[]): Promise<Image>;
|
|
23
|
+
resolveImage(images: Image[], timeout?: number): Promise<Image>;
|
|
23
24
|
/**
|
|
24
25
|
* Shut down a session
|
|
25
26
|
* @param sessionId the ID of the session to shut down
|
package/lib/RunnerClient.js
CHANGED
|
@@ -45,12 +45,13 @@ var RunnerClient = /** @class */ (function (_super) {
|
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
47
47
|
* Create a OpenTAP package configuration image from a list image inputs consisting of user specified packages and repositories.
|
|
48
|
-
* @param images List of images
|
|
48
|
+
* @param {Image[]} images List of images
|
|
49
|
+
* @param {number} timeout Optional timeout in milliseconds
|
|
49
50
|
* @returns {{Promise<Image>}}
|
|
50
51
|
*/
|
|
51
|
-
RunnerClient.prototype.resolveImage = function (images) {
|
|
52
|
+
RunnerClient.prototype.resolveImage = function (images, timeout) {
|
|
52
53
|
return (images === null || images === void 0 ? void 0 : images.length) > 0
|
|
53
|
-
? this.request('ResolveImage', images)
|
|
54
|
+
? this.request('ResolveImage', images, { timeout: timeout || this.timeout })
|
|
54
55
|
.then(function (imageJs) { return Image.fromJS(imageJs); })
|
|
55
56
|
.then(this.success())
|
|
56
57
|
.catch(this.error())
|