@opentap/runner-client 1.0.0-beta.67 → 1.0.0-beta.69
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.d.ts +2 -2
- package/lib/BaseClient.js +2 -1
- package/lib/SessionClient.d.ts +1 -10
- package/lib/SessionClient.js +2 -124
- package/lib/requestDTOs.d.ts +3 -3
- package/package.json +1 -1
package/lib/BaseClient.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConnectionOptions, RequestOptions } from 'nats.ws';
|
|
1
|
+
import { ConnectionOptions, RequestOptions } from 'nats.ws/cjs/nats.js';
|
|
2
2
|
import { ComponentSettingsBase, ComponentSettingsIdentifier, ComponentSettingsListItem, DataGridControl, ErrorResponse, FileParameter, FileResponse, ListItemType, ProfileGroup, RepositoryPackageReference, RepositorySettingsPackageDefinition, SettingsTapPackage } from './DTOs';
|
|
3
3
|
export declare class BaseClient {
|
|
4
4
|
private _accessToken;
|
|
@@ -35,7 +35,7 @@ export declare class BaseClient {
|
|
|
35
35
|
/**
|
|
36
36
|
* Close the connection.
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
close(): Promise<void>;
|
|
39
39
|
/**
|
|
40
40
|
* Add a domain specific access token to the dictionary.
|
|
41
41
|
* @param domain
|
package/lib/BaseClient.js
CHANGED
|
@@ -34,7 +34,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import { connect, Empty, JSONCodec, StringCodec } from 'nats.ws'
|
|
37
|
+
// ! import { connect, ConnectionOptions, Empty, JSONCodec, NatsConnection, RequestOptions, StringCodec } from 'nats.ws' if consuming this library in angular >= 13.
|
|
38
|
+
import { connect, Empty, JSONCodec, StringCodec } from 'nats.ws/cjs/nats.js';
|
|
38
39
|
var BaseClient = /** @class */ (function () {
|
|
39
40
|
function BaseClient(baseSubject, options) {
|
|
40
41
|
this.domainAccess = new Map();
|
package/lib/SessionClient.d.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction,
|
|
1
|
+
import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, ListItemType, LogList, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, RunStatus, Setting, TestPlan, TestStepType, TestStepValidationError, WatchDog } from './DTOs';
|
|
2
2
|
import { BaseClient } from './BaseClient';
|
|
3
3
|
import { ConnectionOptions } from 'nats.ws';
|
|
4
4
|
export declare class SessionClient extends BaseClient {
|
|
5
|
-
private http;
|
|
6
|
-
private baseUrl;
|
|
7
|
-
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
|
|
8
5
|
constructor(baseSubject: string, options: ConnectionOptions);
|
|
9
6
|
/**
|
|
10
7
|
* Retrieve session logs
|
|
@@ -251,14 +248,8 @@ export declare class SessionClient extends BaseClient {
|
|
|
251
248
|
* @param {WatchDog} watchDog
|
|
252
249
|
*/
|
|
253
250
|
setWatchDog(watchDog: WatchDog): Promise<WatchDog>;
|
|
254
|
-
/**
|
|
255
|
-
* Links to other applications or services
|
|
256
|
-
*/
|
|
257
|
-
getLinks(): Promise<Links>;
|
|
258
|
-
protected processGetLinks(response: Response): Promise<Links>;
|
|
259
251
|
/**
|
|
260
252
|
* Retrieve settings types used in creating a Settings TapPackage
|
|
261
253
|
*/
|
|
262
254
|
getSettingsTypes(): Promise<string[]>;
|
|
263
|
-
protected processGetSettingsTypes(response: Response): Promise<string[]>;
|
|
264
255
|
}
|
package/lib/SessionClient.js
CHANGED
|
@@ -13,14 +13,11 @@ 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 { ApiException, ErrorResponse, Links, MissingLicenseResponse, } from './DTOs';
|
|
17
16
|
import { BaseClient } from './BaseClient';
|
|
18
17
|
var SessionClient = /** @class */ (function (_super) {
|
|
19
18
|
__extends(SessionClient, _super);
|
|
20
19
|
function SessionClient(baseSubject, options) {
|
|
21
|
-
|
|
22
|
-
_this.jsonParseReviver = undefined;
|
|
23
|
-
return _this;
|
|
20
|
+
return _super.call(this, baseSubject, options) || this;
|
|
24
21
|
}
|
|
25
22
|
/**
|
|
26
23
|
* Retrieve session logs
|
|
@@ -378,131 +375,12 @@ var SessionClient = /** @class */ (function (_super) {
|
|
|
378
375
|
SessionClient.prototype.setWatchDog = function (watchDog) {
|
|
379
376
|
return this.request('SetWatchDog', watchDog).then(this.success()).catch(this.error());
|
|
380
377
|
};
|
|
381
|
-
/**
|
|
382
|
-
* Links to other applications or services
|
|
383
|
-
*/
|
|
384
|
-
SessionClient.prototype.getLinks = function () {
|
|
385
|
-
var _this = this;
|
|
386
|
-
var url_ = this.baseUrl + '/links';
|
|
387
|
-
url_ = url_.replace(/[?&]$/, '');
|
|
388
|
-
var options_ = {
|
|
389
|
-
method: 'GET',
|
|
390
|
-
headers: {
|
|
391
|
-
Accept: 'application/json',
|
|
392
|
-
},
|
|
393
|
-
};
|
|
394
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
395
|
-
return _this.processGetLinks(_response);
|
|
396
|
-
});
|
|
397
|
-
};
|
|
398
|
-
SessionClient.prototype.processGetLinks = function (response) {
|
|
399
|
-
var _this = this;
|
|
400
|
-
var status = response.status;
|
|
401
|
-
var _headers = {};
|
|
402
|
-
if (response.headers && response.headers.forEach) {
|
|
403
|
-
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
|
|
404
|
-
}
|
|
405
|
-
if (status === 200) {
|
|
406
|
-
return response.text().then(function (_responseText) {
|
|
407
|
-
var result200 = null;
|
|
408
|
-
var resultData200 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
409
|
-
result200 = Links.fromJS(resultData200);
|
|
410
|
-
return result200;
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
else if (status === 400) {
|
|
414
|
-
return response.text().then(function (_responseText) {
|
|
415
|
-
var result400 = null;
|
|
416
|
-
var resultData400 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
417
|
-
result400 = ErrorResponse.fromJS(resultData400);
|
|
418
|
-
return throwException('A server side error occurred.', status, _responseText, _headers, result400);
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
else if (status === 401) {
|
|
422
|
-
return response.text().then(function (_responseText) {
|
|
423
|
-
var result401 = null;
|
|
424
|
-
var resultData401 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
425
|
-
result401 = MissingLicenseResponse.fromJS(resultData401);
|
|
426
|
-
return throwException('License check failed', status, _responseText, _headers, result401);
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
else if (status !== 200 && status !== 204) {
|
|
430
|
-
return response.text().then(function (_responseText) {
|
|
431
|
-
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
return Promise.resolve(null);
|
|
435
|
-
};
|
|
436
378
|
/**
|
|
437
379
|
* Retrieve settings types used in creating a Settings TapPackage
|
|
438
380
|
*/
|
|
439
381
|
SessionClient.prototype.getSettingsTypes = function () {
|
|
440
|
-
|
|
441
|
-
var url_ = this.baseUrl + '/componentsettings/types';
|
|
442
|
-
url_ = url_.replace(/[?&]$/, '');
|
|
443
|
-
var options_ = {
|
|
444
|
-
method: 'GET',
|
|
445
|
-
headers: {
|
|
446
|
-
Accept: 'application/json',
|
|
447
|
-
},
|
|
448
|
-
};
|
|
449
|
-
return this.http.fetch(url_, options_).then(function (_response) {
|
|
450
|
-
return _this.processGetSettingsTypes(_response);
|
|
451
|
-
});
|
|
452
|
-
};
|
|
453
|
-
SessionClient.prototype.processGetSettingsTypes = function (response) {
|
|
454
|
-
var _this = this;
|
|
455
|
-
var status = response.status;
|
|
456
|
-
var _headers = {};
|
|
457
|
-
if (response.headers && response.headers.forEach) {
|
|
458
|
-
response.headers.forEach(function (v, k) { return (_headers[k] = v); });
|
|
459
|
-
}
|
|
460
|
-
if (status === 200) {
|
|
461
|
-
return response.text().then(function (_responseText) {
|
|
462
|
-
var result200 = null;
|
|
463
|
-
var resultData200 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
464
|
-
if (Array.isArray(resultData200)) {
|
|
465
|
-
result200 = [];
|
|
466
|
-
for (var _i = 0, resultData200_1 = resultData200; _i < resultData200_1.length; _i++) {
|
|
467
|
-
var item = resultData200_1[_i];
|
|
468
|
-
result200 === null || result200 === void 0 ? void 0 : result200.push(item);
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
else {
|
|
472
|
-
result200 = null;
|
|
473
|
-
}
|
|
474
|
-
return result200;
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
else if (status === 400) {
|
|
478
|
-
return response.text().then(function (_responseText) {
|
|
479
|
-
var result400 = null;
|
|
480
|
-
var resultData400 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
481
|
-
result400 = ErrorResponse.fromJS(resultData400);
|
|
482
|
-
return throwException('A server side error occurred.', status, _responseText, _headers, result400);
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
else if (status === 401) {
|
|
486
|
-
return response.text().then(function (_responseText) {
|
|
487
|
-
var result401 = null;
|
|
488
|
-
var resultData401 = _responseText === '' ? null : JSON.parse(_responseText, _this.jsonParseReviver);
|
|
489
|
-
result401 = MissingLicenseResponse.fromJS(resultData401);
|
|
490
|
-
return throwException('License check failed', status, _responseText, _headers, result401);
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
else if (status !== 200 && status !== 204) {
|
|
494
|
-
return response.text().then(function (_responseText) {
|
|
495
|
-
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
return Promise.resolve(null);
|
|
382
|
+
return this.request('GetSettingsTypes').then(this.success()).catch(this.error());
|
|
499
383
|
};
|
|
500
384
|
return SessionClient;
|
|
501
385
|
}(BaseClient));
|
|
502
386
|
export { SessionClient };
|
|
503
|
-
function throwException(message, status, response, headers, result) {
|
|
504
|
-
if (result !== null && result !== undefined)
|
|
505
|
-
throw result;
|
|
506
|
-
else
|
|
507
|
-
throw new ApiException(message, status, response, headers, null);
|
|
508
|
-
}
|
package/lib/requestDTOs.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ export interface SetContextMenuRequest {
|
|
|
13
13
|
contextMenu: Setting[];
|
|
14
14
|
}
|
|
15
15
|
export interface SetDataGridRequest {
|
|
16
|
-
contextId
|
|
17
|
-
propertyName
|
|
18
|
-
dataGridControl
|
|
16
|
+
contextId: string;
|
|
17
|
+
propertyName: string;
|
|
18
|
+
dataGridControl: DataGridControl;
|
|
19
19
|
}
|
|
20
20
|
export interface AddDataGridItemTypeRequest {
|
|
21
21
|
contextId: string;
|