@getjones/test-infra 1.4.4 → 1.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjones/test-infra",
3
- "version": "1.4.4",
3
+ "version": "1.6.0",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -61,9 +61,15 @@ const assignMptToProperties = (assignToMptModel, context) => {
61
61
  );
62
62
  };
63
63
 
64
- const getContractorsByTabId = (tabId, context, activityStatus) => {
64
+ const getContractorsByTabId = async (tabId, context, activityStatus) => {
65
65
  const body = { tabId, activityStatus };
66
- return requests.postRequestHandler(Endpoints.get, body, context);
66
+ const response = await requests.postRequestHandler(Endpoints.get, body, context);
67
+ const records = {
68
+ ... response,
69
+ data: response.data.map(({ record }) => record)
70
+ };
71
+
72
+ return records;
67
73
  };
68
74
 
69
75
  const searchInAutocomplete = ({ tabId, searchWord }, context) => {
@@ -13,7 +13,8 @@ const Endpoints = {
13
13
  getRecordProfileDetails: id => `${nodeBackendUrl}/global-record/record-profile/id/${id}`,
14
14
  getGlobalRecordByPolicyNumber: policyNumber => `${nodeBackendUrl}/global-record/policyNumber/${policyNumber}`,
15
15
  publishGlobalRecord: `${backendUrl}/saas/global-record/publish`,
16
- getGlobalRecordLinkedRequests: id => `${backendUrl}/saas/global-record/${id}/linked-requests`
16
+ getGlobalRecordLinkedRequests: id => `${backendUrl}/saas/global-record/${id}/linked-requests`,
17
+ splitToNewGlobalRecord: `${backendUrl}/saas/global-record/split-to-new`
17
18
  };
18
19
 
19
20
  const getGlobalRecord = async (id, nodeBackendSecret) => {
@@ -56,6 +57,10 @@ const getGlobalRecordLinkedRequests = async (id, context) => {
56
57
  return cookieAuthRequests.getRequestHandler(Endpoints.getGlobalRecordLinkedRequests(id), {}, context);
57
58
  };
58
59
 
60
+ const splitToNewGlobalRecord = ({ recordId, glPolicyNumber }, context) => {
61
+ return cookieAuthRequests.postRequestHandler(Endpoints.splitToNewGlobalRecord, { recordId, glPolicyNumber }, context);
62
+ };
63
+
59
64
  module.exports = {
60
65
  createGlobalRecord,
61
66
  getGlobalRecord,
@@ -66,5 +71,6 @@ module.exports = {
66
71
  getRecordProfileDetails,
67
72
  getGlobalRecordByPolicyNumber,
68
73
  publishGlobalRecord,
69
- getGlobalRecordLinkedRequests
74
+ getGlobalRecordLinkedRequests,
75
+ splitToNewGlobalRecord
70
76
  };
@@ -60,6 +60,11 @@ const getGlobalRecordLinkedRequests = async (id, context) => {
60
60
  return globalRecordAPI.getGlobalRecordLinkedRequests(id, context);
61
61
  };
62
62
 
63
+ const splitToNewGlobalRecord = async (recordId, glPolicyNumber, context) => {
64
+ const requestData = { recordId, glPolicyNumber };
65
+ return globalRecordAPI.splitToNewGlobalRecord(requestData, context);
66
+ };
67
+
63
68
  module.exports = {
64
69
  createGlobalRecord,
65
70
  getGlobalRecordById,
@@ -73,5 +78,6 @@ module.exports = {
73
78
  getRecordProfileDetails,
74
79
  getGlobalRecordByPolicyNumber,
75
80
  publishGlobalRecord,
76
- getGlobalRecordLinkedRequests
81
+ getGlobalRecordLinkedRequests,
82
+ splitToNewGlobalRecord
77
83
  };
@@ -3,11 +3,16 @@ const { backendUrl } = require('../../../../env').getEnv();
3
3
 
4
4
  const Endpoints = {
5
5
  getTabsByProjectId: `${backendUrl}/saas/vendortab`,
6
+ getTabsByTabId: `${backendUrl}/saas/vendortab`,
6
7
  create: `${backendUrl}/saas/vendortab`,
7
8
  update: `${backendUrl}/saas/vendortab`,
8
9
  delete: `${backendUrl}/saas/vendortab`
9
10
  };
10
11
 
12
+ const getTabByTabId = (tabId, context) => {
13
+ return requests.getRequestHandler(Endpoints.getTabsByTabId, { tabId }, context);
14
+ };
15
+
11
16
  const getTabsByProjectId = (projectId, context) => {
12
17
  return requests.getRequestHandler(Endpoints.getTabsByProjectId, { projectId }, context);
13
18
  };
@@ -24,4 +29,4 @@ const deleteTab = (tabId, context) => {
24
29
  return requests.deleteRequestHandler(Endpoints.delete, context, {}, { tabId });
25
30
  };
26
31
 
27
- module.exports = { getTabsByProjectId, createTab, updateTab, deleteTab };
32
+ module.exports = { getTabByTabId, getTabsByProjectId, createTab, updateTab, deleteTab };
@@ -22,6 +22,10 @@ const getTabsByName = async (projectId, tabName, context, { tabType } = {}) => {
22
22
  return requestedTab;
23
23
  };
24
24
 
25
+ const getTabById = async (tabId, context) => {
26
+ return tabsAPI.getTabByTabId(tabId, context);
27
+ };
28
+
25
29
  const deleteTabById = async (tabId, context) => {
26
30
  return tabsAPI.deleteTab(tabId, context);
27
31
  };
@@ -39,6 +43,7 @@ const getOrCreateTab = async (projectId, tabName, tabType, context) => {
39
43
  };
40
44
 
41
45
  module.exports = {
46
+ getTabById,
42
47
  getTabsByProjectId,
43
48
  createTab,
44
49
  updateTab,