testit-js-commons 2.1.7 → 2.2.0

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,4 +1,4 @@
1
- import { AutoTestModelV2GetModel, AutoTestPostModel, CreateAutoTestRequest } from "testit-api-client";
1
+ import { AutoTestModelV2GetModel, AutoTestPostModel } from "testit-api-client";
2
2
  import { BaseConverter, AdapterConfig } from "../../common";
3
3
  import { AutotestGet, AutotestPost } from "./autotests.type";
4
4
  export interface IAutotestConverter {
@@ -7,6 +7,6 @@ export interface IAutotestConverter {
7
7
  }
8
8
  export declare class AutotestConverter extends BaseConverter implements IAutotestConverter {
9
9
  constructor(config: AdapterConfig);
10
- toOriginAutotest(autotest: AutotestPost): CreateAutoTestRequest;
10
+ toOriginAutotest(autotest: AutotestPost): AutoTestPostModel;
11
11
  toLocalAutotest(autotest: AutoTestModelV2GetModel): AutotestGet;
12
12
  }
@@ -13,6 +13,6 @@ export declare class AutotestsService extends BaseService implements IAutotestSe
13
13
  private loadPassedAutotest;
14
14
  private loadFailedAutotest;
15
15
  loadAutotest(autotest: AutotestPost, isPassed: boolean): Promise<void>;
16
- linkToWorkItems(externalId: string, workItemsIds: Array<string>): Promise<void>;
16
+ linkToWorkItems(externalId: string, workItemIds: Array<string>): Promise<void>;
17
17
  getAutotestByExternalId(externalId: string): Promise<AutotestGet | null>;
18
18
  }
@@ -61,13 +61,13 @@ class AutotestsService extends base_service_1.BaseService {
61
61
  isPassed ? yield this.loadPassedAutotest(autotest) : yield this.loadFailedAutotest(autotest);
62
62
  });
63
63
  }
64
- linkToWorkItems(externalId, workItemsIds) {
64
+ linkToWorkItems(externalId, workItemIds) {
65
65
  return __awaiter(this, void 0, void 0, function* () {
66
66
  const internalId = yield this.getAutotestByExternalId(externalId).then((test) => test === null || test === void 0 ? void 0 : test.id);
67
67
  if (internalId === undefined) {
68
68
  throw new Error(`Autotest with external id ${externalId} not found`);
69
69
  }
70
- const promises = workItemsIds.map((workItemId) => this._client.linkAutoTestToWorkItem(internalId, { id: workItemId }));
70
+ const promises = workItemIds.map((workItemId) => this._client.linkAutoTestToWorkItem(internalId, { id: workItemId }));
71
71
  yield Promise.all(promises).catch((err) => (0, autotests_handler_1.handleHttpError)(err, "Failed link work item"));
72
72
  });
73
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "testit-js-commons",
3
- "version": "2.1.7",
3
+ "version": "2.2.0",
4
4
  "description": "JavaScript commons for Test IT",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "dotenv": "^16.0.3",
28
- "testit-api-client": "~4.1.0"
28
+ "testit-api-client": "~5.0.0"
29
29
  },
30
30
  "files": [
31
31
  "lib"