testit-js-commons 3.2.3-TMS-CLOUD → 3.2.4-TMS-CLOUD

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.
@@ -40,7 +40,18 @@ class BaseConverter {
40
40
  }
41
41
  toOriginStep(step) {
42
42
  var _a;
43
- return Object.assign(Object.assign({}, step), { outcome: step.outcome ? this.toOriginOutcome(step.outcome) : undefined, stepResults: (_a = step.steps) === null || _a === void 0 ? void 0 : _a.map((step) => this.toOriginStep(step)) });
43
+ const model = {
44
+ title: step.title,
45
+ description: step.description,
46
+ parameters: step.parameters,
47
+ attachments: step.attachments,
48
+ outcome: step.outcome ? this.toOriginOutcome(step.outcome) : undefined,
49
+ stepResults: (_a = step.steps) === null || _a === void 0 ? void 0 : _a.map((step) => this.toOriginStep(step)),
50
+ };
51
+ if (step.duration !== undefined) {
52
+ model.duration = step.duration;
53
+ }
54
+ return model;
44
55
  }
45
56
  }
46
57
  exports.BaseConverter = BaseConverter;
@@ -1,3 +1,4 @@
1
1
  export * from "./types";
2
2
  export * from "./utils";
3
3
  export * from "./base.converter";
4
+ export * from "./base.service";
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types"), exports);
18
18
  __exportStar(require("./utils"), exports);
19
19
  __exportStar(require("./base.converter"), exports);
20
+ __exportStar(require("./base.service"), exports);
@@ -1,6 +1,5 @@
1
1
  import { AttachmentsApi } from "testit-api-client";
2
- import { AdapterConfig, Attachment } from "../../common";
3
- import { BaseService } from "../base.service";
2
+ import { BaseService, AdapterConfig, Attachment } from "../../common";
4
3
  import { IAttachmentsService } from "./attachments.type";
5
4
  import { Buffer } from "buffer";
6
5
  export declare class AttachmentsService extends BaseService implements IAttachmentsService {
@@ -12,10 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AttachmentsService = void 0;
13
13
  const testit_api_client_1 = require("testit-api-client");
14
14
  const common_1 = require("../../common");
15
- const base_service_1 = require("../base.service");
16
15
  const buffer_1 = require("buffer");
17
16
  const apiKey = testit_api_client_1.AttachmentsApiApiKeys["Bearer or PrivateToken"];
18
- class AttachmentsService extends base_service_1.BaseService {
17
+ class AttachmentsService extends common_1.BaseService {
19
18
  constructor(config) {
20
19
  super(config);
21
20
  this.config = config;
@@ -1,6 +1,5 @@
1
1
  import { AutoTestsApi, WorkItemIdentifierModel } from "testit-api-client";
2
- import { AdapterConfig } from "../../common";
3
- import { BaseService } from "../base.service";
2
+ import { BaseService, AdapterConfig } from "../../common";
4
3
  import { AutotestGet, AutotestPost, type IAutotestService } from "./autotests.type";
5
4
  import { type IAutotestConverter } from "./autotests.converter";
6
5
  export declare class AutotestsService extends BaseService implements IAutotestService {
@@ -11,11 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AutotestsService = void 0;
13
13
  const testit_api_client_1 = require("testit-api-client");
14
- const base_service_1 = require("../base.service");
14
+ const common_1 = require("../../common");
15
15
  const autotests_converter_1 = require("./autotests.converter");
16
16
  const autotests_handler_1 = require("./autotests.handler");
17
17
  const autotestApiKey = testit_api_client_1.AutoTestsApiApiKeys["Bearer or PrivateToken"];
18
- class AutotestsService extends base_service_1.BaseService {
18
+ class AutotestsService extends common_1.BaseService {
19
19
  constructor(config) {
20
20
  super(config);
21
21
  this.config = config;
@@ -17,7 +17,30 @@ class TestRunConverter extends common_1.BaseConverter {
17
17
  }
18
18
  toOriginAutotestResult(autotest) {
19
19
  var _a, _b, _c, _d;
20
- return Object.assign(Object.assign({}, autotest), { configurationId: this.config.configurationId, autoTestExternalId: autotest.autoTestExternalId, links: (_a = autotest.links) === null || _a === void 0 ? void 0 : _a.map((link) => this.toOriginLink(link)), outcome: this.toOriginOutcome(autotest.outcome), stepResults: (_b = autotest.stepResults) === null || _b === void 0 ? void 0 : _b.map((step) => this.toOriginStep(step)), setupResults: (_c = autotest.setupResults) === null || _c === void 0 ? void 0 : _c.map((step) => this.toOriginStep(step)), teardownResults: (_d = autotest.teardownResults) === null || _d === void 0 ? void 0 : _d.map((step) => this.toOriginStep(step)) });
20
+ const model = {
21
+ configurationId: this.config.configurationId,
22
+ autoTestExternalId: autotest.autoTestExternalId,
23
+ links: (_a = autotest.links) === null || _a === void 0 ? void 0 : _a.map((link) => this.toOriginLink(link)),
24
+ outcome: this.toOriginOutcome(autotest.outcome),
25
+ stepResults: (_b = autotest.stepResults) === null || _b === void 0 ? void 0 : _b.map((step) => this.toOriginStep(step)),
26
+ setupResults: (_c = autotest.setupResults) === null || _c === void 0 ? void 0 : _c.map((step) => this.toOriginStep(step)),
27
+ teardownResults: (_d = autotest.teardownResults) === null || _d === void 0 ? void 0 : _d.map((step) => this.toOriginStep(step)),
28
+ attachments: autotest.attachments,
29
+ message: autotest.message,
30
+ traces: autotest.traces,
31
+ parameters: autotest.parameters,
32
+ properties: autotest.properties,
33
+ };
34
+ if (autotest.duration !== undefined) {
35
+ model.duration = autotest.duration;
36
+ }
37
+ if (autotest.startedOn !== undefined) {
38
+ model.startedOn = autotest.startedOn;
39
+ }
40
+ if (autotest.completedOn !== undefined) {
41
+ model.completedOn = autotest.completedOn;
42
+ }
43
+ return model;
21
44
  }
22
45
  toLocalAutotestResult(test) {
23
46
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -1,6 +1,5 @@
1
1
  import { TestRunsApi } from "testit-api-client";
2
- import { AdapterConfig } from "../../common";
3
- import { BaseService } from "../base.service";
2
+ import { BaseService, AdapterConfig } from "../../common";
4
3
  import { type ITestRunsService, TestRunId, AutotestResult, TestRunGet, AutotestResultGet } from "./testruns.type";
5
4
  import { type ITestRunConverter } from "./testruns.converter";
6
5
  export declare class TestRunsService extends BaseService implements ITestRunsService {
@@ -11,11 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.TestRunsService = void 0;
13
13
  const testit_api_client_1 = require("testit-api-client");
14
- const base_service_1 = require("../base.service");
14
+ const common_1 = require("../../common");
15
15
  const testruns_converter_1 = require("./testruns.converter");
16
16
  const testruns_handler_1 = require("./testruns.handler");
17
17
  const testRunsApiKey = testit_api_client_1.TestRunsApiApiKeys["Bearer or PrivateToken"];
18
- class TestRunsService extends base_service_1.BaseService {
18
+ class TestRunsService extends common_1.BaseService {
19
19
  constructor(config) {
20
20
  super(config);
21
21
  this.config = config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-js-commons",
3
- "version": "3.2.3-TMS-CLOUD",
3
+ "version": "3.2.4-TMS-CLOUD",
4
4
  "description": "JavaScript commons for Test IT",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
File without changes
File without changes