@getjones/test-infra 2.0.0 → 2.1.1

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.0.0",
3
+ "version": "2.1.1",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -51,7 +51,7 @@ const updateInviteDate = (contractorId, inviteDate, context) => {
51
51
  return contractorsAPI.updateInviteDate(contractorId, inviteDate, context);
52
52
  };
53
53
 
54
- const getContractorsByTabId = (tabId, context, activityStatus = 'ACTIVE') => {
54
+ const getContractorsByTabId = (tabId, context, activityStatus = 'Active') => {
55
55
  return contractorsAPI.getContractorsByTabId(tabId, context, activityStatus);
56
56
  };
57
57
 
@@ -3,6 +3,7 @@ const { backendUrl } = require('../../../../env').getEnv();
3
3
 
4
4
  const Endpoints = {
5
5
  getById: requestId => `${backendUrl}/saas/request/${requestId}`,
6
+ getAccountRequests: accountId => `${backendUrl}/saas/requests/${accountId}`,
6
7
  getByTabId: `${backendUrl}/saas/contractors`,
7
8
  requestsGlobalSearch: (projectId, searchWord) =>
8
9
  `${backendUrl}/saas/contractors/search?&projectId=${projectId}&searchWord=${searchWord}`
@@ -12,6 +13,10 @@ const getReqeustById = (requestId, context) => {
12
13
  return requests.getRequestHandler(Endpoints.getById(requestId), {}, context);
13
14
  };
14
15
 
16
+ const getRequestsByAccountId = (accountId, context, params) => {
17
+ return requests.getRequestHandler(Endpoints.getAccountRequests(accountId), params, context);
18
+ };
19
+
15
20
  const getRequestsByTabId = (tabId, context, activityStatus) => {
16
21
  const body = { tabId, activityStatus };
17
22
  return requests.postRequestHandler(Endpoints.getByTabId, body, context);
@@ -23,6 +28,7 @@ const requestsGlobalSearch = (projectId, searchWord, context) => {
23
28
 
24
29
  module.exports = {
25
30
  getReqeustById,
31
+ getRequestsByAccountId,
26
32
  getRequestsByTabId,
27
33
  requestsGlobalSearch
28
34
  };
@@ -1,6 +1,6 @@
1
1
  const requestsAPI = require('./requests.api');
2
2
 
3
- const getRequestsByTabId = (tabId, context, activityStatus = 'ACTIVE') => {
3
+ const getRequestsByTabId = (tabId, context, activityStatus = 'Active') => {
4
4
  return requestsAPI.getRequestsByTabId(tabId, context, activityStatus);
5
5
  };
6
6
 
@@ -8,6 +8,16 @@ const getReqeustById = (requestId, context) => {
8
8
  return requestsAPI.getReqeustById(requestId, context);
9
9
  };
10
10
 
11
+ const getRequestsByAccountId = (accountId, context, activationStatus) => {
12
+ if (activationStatus) {
13
+ activationStatus = activationStatus.reduce((f, s) => `${f},${s}`);
14
+ }
15
+
16
+ const params = { activationStatus };
17
+
18
+ return requestsAPI.getRequestsByAccountId(accountId, context, params);
19
+ };
20
+
11
21
  const requestsGlobalSearch = (projectId, searchWord, context) => {
12
22
  return requestsAPI.requestsGlobalSearch(projectId, searchWord, context);
13
23
  };
@@ -15,5 +25,6 @@ const requestsGlobalSearch = (projectId, searchWord, context) => {
15
25
  module.exports = {
16
26
  getRequestsByTabId,
17
27
  getReqeustById,
28
+ getRequestsByAccountId,
18
29
  requestsGlobalSearch
19
30
  };
File without changes