@getjones/test-infra 2.11.3 → 2.11.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjones/test-infra",
3
- "version": "2.11.3",
3
+ "version": "2.11.4",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -49,8 +49,8 @@ const deleteByContractorId = (contractorId, context) => {
49
49
  return requests.deleteRequestHandler(Endpoints.delete(contractorId), context);
50
50
  };
51
51
 
52
- const archiveRecord = (recordVerificationModel, context) => {
53
- return requests.deleteRequestHandler(Endpoints.archive(recordVerificationModel.contractorId), context, {}, {}, recordVerificationModel);
52
+ const archiveByContractorId = (contractorId, context) => {
53
+ return requests.deleteRequestHandler(Endpoints.archive(contractorId), context);
54
54
  };
55
55
 
56
56
  const restoreRecord = (recordVerificationModel, context) => {
@@ -146,7 +146,7 @@ module.exports = {
146
146
  getContractorById,
147
147
  getRecordHistory,
148
148
  deleteByContractorId,
149
- archiveRecord,
149
+ archiveByContractorId,
150
150
  restoreRecord,
151
151
  editContractor,
152
152
  updateInviteDate,
@@ -28,9 +28,8 @@ const getRecordHistory = (contractorId, context) => {
28
28
  return contractorsAPI.getRecordHistory(contractorId, context);
29
29
  };
30
30
 
31
- const archiveRecord = (recordVerificationModel, context) => {
32
- validateType(recordVerificationModel, RecordModifyDateVerificationModel);
33
- return contractorsAPI.archiveRecord(recordVerificationModel, context);
31
+ const archiveByContractorId = (contractorId, context) => {
32
+ return contractorsAPI.archiveByContractorId(contractorId, context);
34
33
  };
35
34
 
36
35
  const restoreRecord = (recordVerificationModel, context) => {
@@ -163,17 +162,6 @@ const restoreByRecordId = async (recordId, context) => {
163
162
  return restoreResponse;
164
163
  };
165
164
 
166
- const archiveByRecordId = async (recordId, context) => {
167
- const recordModifyModel = await getRecordVerificationModel(recordId, context);
168
- const archiveResponse = await archiveRecord(recordModifyModel, context);
169
-
170
- if (archiveResponse.status !== httpResponseStatusCodes.OK) {
171
- throw new Error(`Failed to archive record "${recordId}"\n${archiveResponse.statusText}`);
172
- }
173
-
174
- return archiveResponse;
175
- };
176
-
177
165
  const getInviteLinkStatus = (encryptedData, context) => {
178
166
  return contractorsAPI.getInviteLinkStatus(encryptedData, context);
179
167
  };
@@ -184,7 +172,7 @@ module.exports = {
184
172
  getContractorsByAccountId,
185
173
  getContractorById,
186
174
  getRecordHistory,
187
- archiveRecord,
175
+ archiveByContractorId,
188
176
  restoreRecord,
189
177
  editContractor,
190
178
  updateInviteDate,
@@ -204,7 +192,6 @@ module.exports = {
204
192
  assignRequirement,
205
193
  getAssignRequirementModel,
206
194
  getLinkedProjectsCount,
207
- archiveByRecordId,
208
195
  restoreByRecordId,
209
196
  updateLastInviteActionDate,
210
197
  getInviteLinkStatus
@@ -34,8 +34,8 @@ const getOrCreateTab = async (projectId, tabName, tabType, context) => {
34
34
  return createResponse.data;
35
35
  };
36
36
 
37
- const updateTab = async (projectId, tabName, tabType, tabId, context) => {
38
- const tabModel = new UpdateTabModel(projectId, tabName, tabType, tabId);
37
+ const updateTab = async ({ id, projectId, name, type, context, dateModified }) => {
38
+ const tabModel = new UpdateTabModel({ id, projectId, name, type, dateModified });
39
39
  return tabsAPI.updateTab(tabModel, context);
40
40
  };
41
41
 
@@ -7,11 +7,12 @@ class CreateTabModel {
7
7
  }
8
8
 
9
9
  class UpdateTabModel {
10
- constructor(projectId, tabName, tabType, tabId) {
10
+ constructor({ projectId, name: tabName, type: tabType, id: tabId, dateModified } = {}) {
11
+ this.tabId = tabId;
11
12
  this.projectId = projectId;
12
13
  this.tabName = tabName;
13
14
  this.type = tabType;
14
- this.tabId = tabId;
15
+ this.dateModified = dateModified;
15
16
  }
16
17
  }
17
18