@opentap/runner-client 1.0.0-beta.66 → 1.0.0-beta.68

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.
@@ -1,10 +1,7 @@
1
- import { BreakPoints, CommonContext, CommonSettings, DataGridControl, Image, Interaction, Links, ListItemType, LogList, Parameter, RepositoryPackageDefinition, RepositoryPackageReference, RunStatus, Setting, TestPlan, TestStepType, TestStepValidationError, WatchDog } from './DTOs';
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
  }
@@ -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
- var _this = _super.call(this, baseSubject, options) || this;
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
- var _this = this;
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
- }
@@ -13,9 +13,9 @@ export interface SetContextMenuRequest {
13
13
  contextMenu: Setting[];
14
14
  }
15
15
  export interface SetDataGridRequest {
16
- contextId?: string;
17
- propertyName?: string;
18
- dataGridControl?: DataGridControl;
16
+ contextId: string;
17
+ propertyName: string;
18
+ dataGridControl: DataGridControl;
19
19
  }
20
20
  export interface AddDataGridItemTypeRequest {
21
21
  contextId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentap/runner-client",
3
- "version": "1.0.0-beta.66",
3
+ "version": "1.0.0-beta.68",
4
4
  "description": "This is the TypeScript Client for the OpenTAP Runner Plugin.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",