@getjones/test-infra 1.0.11 → 1.0.12
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
package/src/index.js
CHANGED
|
@@ -8,7 +8,9 @@ const init = conf => {
|
|
|
8
8
|
const accountsCore = require('./internal-api/accounts/core/accounts.core.setup');
|
|
9
9
|
const accountsSettings = require('./internal-api/accounts/settings/settings.setup');
|
|
10
10
|
const accountsOpenAPI = require('./internal-api/accounts/openapi/accounts.openapi.setup');
|
|
11
|
+
|
|
11
12
|
const projects = require('./internal-api/projects/projects.setup');
|
|
13
|
+
const tabs = require('./internal-api/tabs/tabs.setup');
|
|
12
14
|
|
|
13
15
|
const accounts = {
|
|
14
16
|
core: accountsCore,
|
|
@@ -19,7 +21,7 @@ const init = conf => {
|
|
|
19
21
|
accountsOpenAPI
|
|
20
22
|
};
|
|
21
23
|
|
|
22
|
-
const internalAPI = { auth, accounts, projects };
|
|
24
|
+
const internalAPI = { auth, accounts, projects, tabs };
|
|
23
25
|
return { internalAPI };
|
|
24
26
|
};
|
|
25
27
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const requests = require('../common/requests');
|
|
2
|
+
const { backendUrl } = require('../../env').getEnv();
|
|
3
|
+
|
|
4
|
+
const Endpoints = {
|
|
5
|
+
getTabsByProjectId: `${backendUrl}/saas/vendortab`,
|
|
6
|
+
create: `${backendUrl}/saas/vendortab`,
|
|
7
|
+
delete: `${backendUrl}/saas/vendortab`,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const getTabsByProjectId = async (projectId, context) => {
|
|
11
|
+
return requests.getRequestHandler(Endpoints.getTabsByProjectId, { projectId }, context).then(res => res.data);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const createTab = async (tabModel, context) => {
|
|
15
|
+
return requests.postRequestHandler(Endpoints.create, tabModel, context);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const deleteTab = async (tabId, context) => {
|
|
19
|
+
return requests.deleteRequestHandler(Endpoints.delete, context, {}, { tabId });
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
module.exports = { getTabsByProjectId, createTab, deleteTab };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const tabsAPI = require('./tabs.api');
|
|
2
|
+
|
|
3
|
+
const createTab = async (projectId, tabName, tabType, context) => {
|
|
4
|
+
const tabModel = { projectId, tabName, type: tabType };
|
|
5
|
+
return tabsAPI.createTab(tabModel, context);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const getTabsByProjectId = async (projectId, context) => {
|
|
9
|
+
return tabsAPI.getTabsByProjectId(projectId, context);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const deleteTabById = async (tabId, context) => {
|
|
13
|
+
return tabsAPI.deleteTab(tabId, context);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
module.exports = { getTabsByProjectId, createTab, deleteTabById };
|