@getjones/test-infra 1.9.0 → 1.11.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.
Files changed (124) hide show
  1. package/package.json +29 -29
  2. package/src/common/factory/index.js +3 -0
  3. package/src/common/factory/records/records.js +45 -0
  4. package/src/common/httpResponseStatusCodes.json +11 -11
  5. package/src/common/requests/apiKeyAuth/requests.js +38 -38
  6. package/src/common/requests/cookieAuth/requests.js +40 -40
  7. package/src/common/requests/requestHandlers.js +60 -60
  8. package/src/common/utils/numberUtils.js +22 -22
  9. package/src/common/utils/timeUtils.js +147 -0
  10. package/src/common/validations/errorValidation.js +16 -16
  11. package/src/common/validations/typeValidations.js +36 -36
  12. package/src/env.js +45 -44
  13. package/src/index.js +67 -67
  14. package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +28 -28
  15. package/src/saas/internal-api/accounts/api/core/accounts.core.service.js +77 -77
  16. package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.api.js +48 -48
  17. package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.service.js +74 -74
  18. package/src/saas/internal-api/accounts/api/settings/settings.api.js +21 -21
  19. package/src/saas/internal-api/accounts/api/settings/settings.service.js +24 -24
  20. package/src/saas/internal-api/accounts/index.js +20 -20
  21. package/src/saas/internal-api/accounts/models/core/create.account.model.js +15 -15
  22. package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +19 -19
  23. package/src/saas/internal-api/accounts/utils/utils.js +32 -32
  24. package/src/saas/internal-api/auth/api/auth.api.js +12 -12
  25. package/src/saas/internal-api/auth/api/auth.service.js +47 -47
  26. package/src/saas/internal-api/auth/index.js +3 -3
  27. package/src/saas/internal-api/coi/api/coi.api.js +34 -34
  28. package/src/saas/internal-api/coi/api/coi.service.js +22 -22
  29. package/src/saas/internal-api/coi/consts/uploaderTypes.js +7 -7
  30. package/src/saas/internal-api/coi/index.js +13 -13
  31. package/src/saas/internal-api/coi/models/submit.coi.model.js +9 -9
  32. package/src/saas/internal-api/coi/utils/utils.js +48 -48
  33. package/src/saas/internal-api/compliance/api/audit/audit.api.js +40 -40
  34. package/src/saas/internal-api/compliance/api/audit/audit.service.js +33 -33
  35. package/src/saas/internal-api/compliance/api/convert/convert.api.js +17 -17
  36. package/src/saas/internal-api/compliance/api/convert/convert.service.js +11 -11
  37. package/src/saas/internal-api/compliance/api/coverage/coverage.api.js +33 -33
  38. package/src/saas/internal-api/compliance/api/coverage/coverage.service.js +24 -24
  39. package/src/saas/internal-api/compliance/api/waive/waive.api.js +21 -21
  40. package/src/saas/internal-api/compliance/api/waive/waive.service.js +15 -15
  41. package/src/saas/internal-api/compliance/index.js +22 -22
  42. package/src/saas/internal-api/compliance/models/audit/audit.model.js +110 -110
  43. package/src/saas/internal-api/compliance/models/waive/waive.model.js +45 -45
  44. package/src/saas/internal-api/contractors/api/contractors.api.js +159 -165
  45. package/src/saas/internal-api/contractors/api/contractors.service.js +136 -141
  46. package/src/saas/internal-api/contractors/index.js +8 -8
  47. package/src/saas/internal-api/contractors/models/create.contractor.model.js +22 -22
  48. package/src/saas/internal-api/contractors/models/edit.contractor.model.js +69 -91
  49. package/src/saas/internal-api/contractors/models/verification.contractor.model.js +27 -33
  50. package/src/saas/internal-api/dbEmails/api/db.emails.api.js +25 -0
  51. package/src/saas/internal-api/dbEmails/api/db.emails.service.js +19 -0
  52. package/src/saas/internal-api/dbEmails/index.js +3 -0
  53. package/src/saas/internal-api/dbEmails/models/db.emails.model.js +21 -0
  54. package/src/saas/internal-api/globalRecord/api/global.record.api.js +76 -76
  55. package/src/saas/internal-api/globalRecord/api/global.record.service.js +83 -83
  56. package/src/saas/internal-api/globalRecord/consts.js +20 -20
  57. package/src/saas/internal-api/globalRecord/index.js +6 -6
  58. package/src/saas/internal-api/globalRecord/models/global.record.model.js +43 -43
  59. package/src/saas/internal-api/globalRecord/utils/util.js +148 -148
  60. package/src/saas/internal-api/homepageCharts/api/charts.api.js +12 -12
  61. package/src/saas/internal-api/homepageCharts/api/charts.service.js +7 -7
  62. package/src/saas/internal-api/homepageCharts/index.js +3 -3
  63. package/src/saas/internal-api/projects/api/core/projects.api.js +39 -39
  64. package/src/saas/internal-api/projects/api/core/projects.service.js +65 -65
  65. package/src/saas/internal-api/projects/api/settings/project.settings.api.js +18 -18
  66. package/src/saas/internal-api/projects/api/settings/project.settings.service.js +17 -17
  67. package/src/saas/internal-api/projects/consts/defaultProject.js +3 -3
  68. package/src/saas/internal-api/projects/index.js +24 -24
  69. package/src/saas/internal-api/projects/models/core/create.project.model.js +41 -41
  70. package/src/saas/internal-api/projects/models/core/update.project.model.js +47 -47
  71. package/src/saas/internal-api/projects/models/settings/update.project.settings.model.js +39 -39
  72. package/src/saas/internal-api/projects/utils/utils.js +82 -82
  73. package/src/saas/internal-api/recordNotes/api/record.notes.api.js +38 -38
  74. package/src/saas/internal-api/recordNotes/api/record.notes.service.js +29 -29
  75. package/src/saas/internal-api/recordNotes/index.js +3 -3
  76. package/src/saas/internal-api/reports/api/reports.api.js +39 -39
  77. package/src/saas/internal-api/reports/api/reports.service.js +34 -34
  78. package/src/saas/internal-api/reports/consts/consts.js +63 -63
  79. package/src/saas/internal-api/reports/index.js +15 -15
  80. package/src/saas/internal-api/reports/models/report.model.js +27 -27
  81. package/src/saas/internal-api/requests/api/requests.api.js +28 -21
  82. package/src/saas/internal-api/requests/api/requests.service.js +19 -14
  83. package/src/saas/internal-api/requests/index.js +11 -3
  84. package/src/saas/internal-api/requests/models/edit.request.model.js +31 -0
  85. package/src/saas/internal-api/requests/models/tenant.request.model.js +9 -0
  86. package/src/saas/internal-api/requests/models/validation.models.js +8 -0
  87. package/src/saas/internal-api/requirements/api/requirements.api.js +27 -27
  88. package/src/saas/internal-api/requirements/api/requirements.service.js +23 -23
  89. package/src/saas/internal-api/requirements/index.js +6 -6
  90. package/src/saas/internal-api/requirements/models/create.requirement.model.js +45 -45
  91. package/src/saas/internal-api/serviceArea/api/coordinates.api.js +12 -12
  92. package/src/saas/internal-api/serviceArea/api/coordinates.service.js +7 -7
  93. package/src/saas/internal-api/serviceArea/index.js +4 -4
  94. package/src/saas/internal-api/serviceArea/utils/utils.js +8 -8
  95. package/src/saas/internal-api/tabs/api/tabs.api.js +32 -32
  96. package/src/saas/internal-api/tabs/api/tabs.service.js +54 -54
  97. package/src/saas/internal-api/tabs/index.js +3 -3
  98. package/src/saas/internal-api/tabs/models/tabs.model.js +18 -18
  99. package/src/saas/internal-api/thread-scheduler/runner.js +13 -13
  100. package/src/saas/internal-api/users/api/users.api.js +78 -78
  101. package/src/saas/internal-api/users/api/users.service.js +101 -101
  102. package/src/saas/internal-api/users/index.js +4 -4
  103. package/src/saas/internal-api/users/models/users.model.js +31 -31
  104. package/src/saas/internal-api/users/utils/util.js +14 -14
  105. package/src/saas/internal-api/vendorProfile/api/vendor.profile.api.js +20 -20
  106. package/src/saas/internal-api/vendorProfile/api/vendor.profile.service.js +14 -14
  107. package/src/saas/internal-api/vendorProfile/index.js +3 -3
  108. package/src/saas/openapi/accounts/accounts.api.js +17 -17
  109. package/src/saas/openapi/accounts/accounts.service.js +11 -11
  110. package/src/saas/openapi/contractors/contractors.api.js +20 -20
  111. package/src/saas/openapi/contractors/contractors.service.js +18 -18
  112. package/src/saas/openapi/contractors/index.js +6 -6
  113. package/src/saas/openapi/contractors/models/invite.contractor.model.js +37 -37
  114. package/src/saas/openapi/projects/projects.api.js +59 -59
  115. package/src/saas/openapi/projects/projects.service.js +44 -44
  116. package/src/saas/openapi/requirements/index.js +6 -6
  117. package/src/saas/openapi/requirements/models/copy.requirement.model.js +10 -10
  118. package/src/saas/openapi/requirements/requirements.api.js +12 -12
  119. package/src/saas/openapi/requirements/requirements.service.js +20 -20
  120. package/src/saas/openapi/tabs/tabs.api.js +13 -13
  121. package/src/saas/openapi/tabs/tabs.service.js +7 -7
  122. package/tests/env.test.js +40 -40
  123. package/tests/validation.test.js +83 -83
  124. package/src/common/utils/dateUtils.js +0 -6
@@ -1,45 +1,45 @@
1
- const Enum = require('enum');
2
- const { validateType } = require('../../../../common/validations/typeValidations');
3
-
4
- const DEFAULT_REQUIREMENT_TYPE = 'REQUIREMENT';
5
-
6
- function CreateRequirementModel(accountId, projectId, tabId, name, policies) {
7
- this.userId = accountId;
8
- this.projectId = projectId;
9
- this.tabId = tabId;
10
- this.name = name;
11
- this.policies = policies;
12
- this.requirementType = DEFAULT_REQUIREMENT_TYPE;
13
-
14
- validateType(policies, Array);
15
- policies && validateType(policies[0], Policy);
16
- }
17
-
18
- function Policy(name, attributes) {
19
- this.policyName = name;
20
- this.attributes = attributes;
21
-
22
- validateType(attributes, Array);
23
- attributes && validateType(attributes[0], Attribute);
24
- }
25
-
26
- function Attribute(name, type, values) {
27
- this.attributeName = name;
28
- this.type = type.value;
29
- this.values = values.map(function(value) {
30
- return { value };
31
- });
32
-
33
- if (!AttributeTypes.get(type) || !AttributeTypes.get(type.key)) {
34
- throw TypeError(`Expected type to be instance of: ${AttributeTypes.name}`);
35
- }
36
- }
37
-
38
- const AttributeTypes = new Enum({
39
- 'ENDORSMENT': 'endorsment',
40
- 'LIMIT': 'limit',
41
- 'BOOLEAN': 'boolean',
42
- 'MULTIPLE': 'multiple'
43
- }, { name: 'AttributeTypes' });
44
-
45
- module.exports = { CreateRequirementModel, Policy, Attribute, AttributeTypes };
1
+ const Enum = require('enum');
2
+ const { validateType } = require('../../../../common/validations/typeValidations');
3
+
4
+ const DEFAULT_REQUIREMENT_TYPE = 'REQUIREMENT';
5
+
6
+ function CreateRequirementModel(accountId, projectId, tabId, name, policies) {
7
+ this.userId = accountId;
8
+ this.projectId = projectId;
9
+ this.tabId = tabId;
10
+ this.name = name;
11
+ this.policies = policies;
12
+ this.requirementType = DEFAULT_REQUIREMENT_TYPE;
13
+
14
+ validateType(policies, Array);
15
+ policies && validateType(policies[0], Policy);
16
+ }
17
+
18
+ function Policy(name, attributes) {
19
+ this.policyName = name;
20
+ this.attributes = attributes;
21
+
22
+ validateType(attributes, Array);
23
+ attributes && validateType(attributes[0], Attribute);
24
+ }
25
+
26
+ function Attribute(name, type, values) {
27
+ this.attributeName = name;
28
+ this.type = type.value;
29
+ this.values = values.map(function(value) {
30
+ return { value };
31
+ });
32
+
33
+ if (!AttributeTypes.get(type) || !AttributeTypes.get(type.key)) {
34
+ throw TypeError(`Expected type to be instance of: ${AttributeTypes.name}`);
35
+ }
36
+ }
37
+
38
+ const AttributeTypes = new Enum({
39
+ 'ENDORSMENT': 'endorsment',
40
+ 'LIMIT': 'limit',
41
+ 'BOOLEAN': 'boolean',
42
+ 'MULTIPLE': 'multiple'
43
+ }, { name: 'AttributeTypes' });
44
+
45
+ module.exports = { CreateRequirementModel, Policy, Attribute, AttributeTypes };
@@ -1,12 +1,12 @@
1
- const requests = require('../../../../common/requests/cookieAuth/requests');
2
- const { backendUrl } = require('../../../../env').getEnv();
3
-
4
- const Endpoints = {
5
- coordinates: (city, state) => `${backendUrl}/saas/coordinates?city=${city}&state=${state}`
6
- };
7
-
8
- const getCoordinatesByAddress = (city, state, context) => {
9
- return requests.getRequestHandler(Endpoints.coordinates(city, state), {}, context);
10
- };
11
-
12
- module.exports = { getCoordinatesByAddress };
1
+ const requests = require('../../../../common/requests/cookieAuth/requests');
2
+ const { backendUrl } = require('../../../../env').getEnv();
3
+
4
+ const Endpoints = {
5
+ coordinates: (city, state) => `${backendUrl}/saas/coordinates?city=${city}&state=${state}`
6
+ };
7
+
8
+ const getCoordinatesByAddress = (city, state, context) => {
9
+ return requests.getRequestHandler(Endpoints.coordinates(city, state), {}, context);
10
+ };
11
+
12
+ module.exports = { getCoordinatesByAddress };
@@ -1,7 +1,7 @@
1
- const coordinates = require('./coordinates.api');
2
-
3
- const getCoordinatesByAddress = (city, state, context) => {
4
- return coordinates.getCoordinatesByAddress(city, state, context);
5
- };
6
-
7
- module.exports = { getCoordinatesByAddress };
1
+ const coordinates = require('./coordinates.api');
2
+
3
+ const getCoordinatesByAddress = (city, state, context) => {
4
+ return coordinates.getCoordinatesByAddress(city, state, context);
5
+ };
6
+
7
+ module.exports = { getCoordinatesByAddress };
@@ -1,4 +1,4 @@
1
- const services = require('./api/coordinates.service');
2
- const utils = require('./utils/utils');
3
-
4
- module.exports = { services, utils };
1
+ const services = require('./api/coordinates.service');
2
+ const utils = require('./utils/utils');
3
+
4
+ module.exports = { services, utils };
@@ -1,8 +1,8 @@
1
- const service = require('../api/coordinates.service');
2
-
3
- const getCoordinatesByAddress = async (city, state, context) => {
4
- const response = await service.getCoordinatesByAddress(city, state, context);
5
- return response.data;
6
- };
7
-
8
- module.exports = { getCoordinatesByAddress };
1
+ const service = require('../api/coordinates.service');
2
+
3
+ const getCoordinatesByAddress = async (city, state, context) => {
4
+ const response = await service.getCoordinatesByAddress(city, state, context);
5
+ return response.data;
6
+ };
7
+
8
+ module.exports = { getCoordinatesByAddress };
@@ -1,32 +1,32 @@
1
- const requests = require('../../../../common/requests/cookieAuth/requests');
2
- const { backendUrl } = require('../../../../env').getEnv();
3
-
4
- const Endpoints = {
5
- getTabsByProjectId: `${backendUrl}/saas/vendortab`,
6
- getTabsByTabId: `${backendUrl}/saas/vendortab`,
7
- create: `${backendUrl}/saas/vendortab`,
8
- update: `${backendUrl}/saas/vendortab`,
9
- delete: `${backendUrl}/saas/vendortab`
10
- };
11
-
12
- const getTabByTabId = (tabId, context) => {
13
- return requests.getRequestHandler(Endpoints.getTabsByTabId, { tabId }, context);
14
- };
15
-
16
- const getTabsByProjectId = (projectId, context) => {
17
- return requests.getRequestHandler(Endpoints.getTabsByProjectId, { projectId }, context);
18
- };
19
-
20
- const createTab = (tabModel, context) => {
21
- return requests.postRequestHandler(Endpoints.create, tabModel, context);
22
- };
23
-
24
- const updateTab = (tabModel, context) => {
25
- return requests.putRequestHandler(Endpoints.update, tabModel, context);
26
- };
27
-
28
- const deleteTab = (tabId, context) => {
29
- return requests.deleteRequestHandler(Endpoints.delete, context, {}, { tabId });
30
- };
31
-
32
- module.exports = { getTabByTabId, getTabsByProjectId, createTab, updateTab, deleteTab };
1
+ const requests = require('../../../../common/requests/cookieAuth/requests');
2
+ const { backendUrl } = require('../../../../env').getEnv();
3
+
4
+ const Endpoints = {
5
+ getTabsByProjectId: `${backendUrl}/saas/vendortab`,
6
+ getTabsByTabId: `${backendUrl}/saas/vendortab`,
7
+ create: `${backendUrl}/saas/vendortab`,
8
+ update: `${backendUrl}/saas/vendortab`,
9
+ delete: `${backendUrl}/saas/vendortab`
10
+ };
11
+
12
+ const getTabByTabId = (tabId, context) => {
13
+ return requests.getRequestHandler(Endpoints.getTabsByTabId, { tabId }, context);
14
+ };
15
+
16
+ const getTabsByProjectId = (projectId, context) => {
17
+ return requests.getRequestHandler(Endpoints.getTabsByProjectId, { projectId }, context);
18
+ };
19
+
20
+ const createTab = (tabModel, context) => {
21
+ return requests.postRequestHandler(Endpoints.create, tabModel, context);
22
+ };
23
+
24
+ const updateTab = (tabModel, context) => {
25
+ return requests.putRequestHandler(Endpoints.update, tabModel, context);
26
+ };
27
+
28
+ const deleteTab = (tabId, context) => {
29
+ return requests.deleteRequestHandler(Endpoints.delete, context, {}, { tabId });
30
+ };
31
+
32
+ module.exports = { getTabByTabId, getTabsByProjectId, createTab, updateTab, deleteTab };
@@ -1,54 +1,54 @@
1
- const tabsAPI = require('./tabs.api');
2
- const { CreateTabModel, UpdateTabModel } = require('../models/tabs.model');
3
-
4
- const createTab = async (projectId, tabName, tabType, context) => {
5
- const tabModel = new CreateTabModel(projectId, tabName, tabType);
6
- return tabsAPI.createTab(tabModel, context);
7
- };
8
-
9
- const getTabById = async (tabId, context) => {
10
- return tabsAPI.getTabByTabId(tabId, context);
11
- };
12
-
13
- const getTabsByProjectId = async (projectId, context) => {
14
- return tabsAPI.getTabsByProjectId(projectId, context);
15
- };
16
-
17
- const getTabsByName = async (projectId, tabName, context, { tabType } = {}) => {
18
- const { data: tabs } = await getTabsByProjectId(projectId, context);
19
- const requestedTab = tabType ?
20
- tabs.find(tab => tab.tabName === tabName && tab.type === tabType) :
21
- tabs.find(tab => tab.tabName === tabName);
22
- return requestedTab;
23
- };
24
-
25
- const getOrCreateTab = async (projectId, tabName, tabType, context) => {
26
- const { data: tabs } = await getTabsByProjectId(projectId, context);
27
- const existingTab = tabs.find(tab => tab.tabName === tabName && tab.type === tabType);
28
-
29
- if (existingTab) {
30
- return existingTab;
31
- }
32
-
33
- const createResponse = await createTab(projectId, tabName, tabType, context);
34
- return createResponse.data;
35
- };
36
-
37
- const updateTab = async (projectId, tabName, tabType, tabId, context) => {
38
- const tabModel = new UpdateTabModel(projectId, tabName, tabType, tabId);
39
- return tabsAPI.updateTab(tabModel, context);
40
- };
41
-
42
- const deleteTabById = async (tabId, context) => {
43
- return tabsAPI.deleteTab(tabId, context);
44
- };
45
-
46
- module.exports = {
47
- createTab,
48
- getTabById,
49
- getTabsByProjectId,
50
- getTabsByName,
51
- getOrCreateTab,
52
- updateTab,
53
- deleteTabById
54
- };
1
+ const tabsAPI = require('./tabs.api');
2
+ const { CreateTabModel, UpdateTabModel } = require('../models/tabs.model');
3
+
4
+ const createTab = async (projectId, tabName, tabType, context) => {
5
+ const tabModel = new CreateTabModel(projectId, tabName, tabType);
6
+ return tabsAPI.createTab(tabModel, context);
7
+ };
8
+
9
+ const getTabById = async (tabId, context) => {
10
+ return tabsAPI.getTabByTabId(tabId, context);
11
+ };
12
+
13
+ const getTabsByProjectId = async (projectId, context) => {
14
+ return tabsAPI.getTabsByProjectId(projectId, context);
15
+ };
16
+
17
+ const getTabsByName = async (projectId, tabName, context, { tabType } = {}) => {
18
+ const { data: tabs } = await getTabsByProjectId(projectId, context);
19
+ const requestedTab = tabType ?
20
+ tabs.find(tab => tab.tabName === tabName && tab.type === tabType) :
21
+ tabs.find(tab => tab.tabName === tabName);
22
+ return requestedTab;
23
+ };
24
+
25
+ const getOrCreateTab = async (projectId, tabName, tabType, context) => {
26
+ const { data: tabs } = await getTabsByProjectId(projectId, context);
27
+ const existingTab = tabs.find(tab => tab.tabName === tabName && tab.type === tabType);
28
+
29
+ if (existingTab) {
30
+ return existingTab;
31
+ }
32
+
33
+ const createResponse = await createTab(projectId, tabName, tabType, context);
34
+ return createResponse.data;
35
+ };
36
+
37
+ const updateTab = async (projectId, tabName, tabType, tabId, context) => {
38
+ const tabModel = new UpdateTabModel(projectId, tabName, tabType, tabId);
39
+ return tabsAPI.updateTab(tabModel, context);
40
+ };
41
+
42
+ const deleteTabById = async (tabId, context) => {
43
+ return tabsAPI.deleteTab(tabId, context);
44
+ };
45
+
46
+ module.exports = {
47
+ createTab,
48
+ getTabById,
49
+ getTabsByProjectId,
50
+ getTabsByName,
51
+ getOrCreateTab,
52
+ updateTab,
53
+ deleteTabById
54
+ };
@@ -1,3 +1,3 @@
1
- const services = require('./api/tabs.service');
2
-
3
- module.exports = { services };
1
+ const services = require('./api/tabs.service');
2
+
3
+ module.exports = { services };
@@ -1,18 +1,18 @@
1
- class CreateTabModel {
2
- constructor(projectId, tabName, tabType) {
3
- this.projectId = projectId;
4
- this.tabName = tabName;
5
- this.type = tabType;
6
- }
7
- }
8
-
9
- class UpdateTabModel {
10
- constructor(projectId, tabName, tabType, tabId) {
11
- this.projectId = projectId;
12
- this.tabName = tabName;
13
- this.type = tabType;
14
- this.tabId = tabId;
15
- }
16
- }
17
-
18
- module.exports = { CreateTabModel, UpdateTabModel };
1
+ class CreateTabModel {
2
+ constructor(projectId, tabName, tabType) {
3
+ this.projectId = projectId;
4
+ this.tabName = tabName;
5
+ this.type = tabType;
6
+ }
7
+ }
8
+
9
+ class UpdateTabModel {
10
+ constructor(projectId, tabName, tabType, tabId) {
11
+ this.projectId = projectId;
12
+ this.tabName = tabName;
13
+ this.type = tabType;
14
+ this.tabId = tabId;
15
+ }
16
+ }
17
+
18
+ module.exports = { CreateTabModel, UpdateTabModel };
@@ -1,13 +1,13 @@
1
- const requests = require('../../internal-api/../../common/requests/cookieAuth/requests');
2
- const { backendUrl, threadSchedulerSecret } = require('../../../env').getEnv();
3
-
4
- const Endpoints = {
5
- run: `${backendUrl}/threadSchedular/${threadSchedulerSecret}`
6
- };
7
-
8
- const runThreadScheduler = ({ contractorIds = [], scheduledReportsIds = [] } = {}) => {
9
- const params = { contractorIdsList: contractorIds.toString(), scheduledReportsIds: scheduledReportsIds.toString() };
10
- return requests.getRequestHandler(Endpoints.run, params);
11
- };
12
-
13
- module.exports = { runThreadScheduler };
1
+ const requests = require('../../internal-api/../../common/requests/cookieAuth/requests');
2
+ const { backendUrl, threadSchedulerSecret } = require('../../../env').getEnv();
3
+
4
+ const Endpoints = {
5
+ run: `${backendUrl}/threadSchedular/${threadSchedulerSecret}`
6
+ };
7
+
8
+ const runThreadScheduler = ({ contractorIds = [], scheduledReportsIds = [] } = {}) => {
9
+ const params = { contractorIdsList: contractorIds.toString(), scheduledReportsIds: scheduledReportsIds.toString() };
10
+ return requests.getRequestHandler(Endpoints.run, params);
11
+ };
12
+
13
+ module.exports = { runThreadScheduler };
@@ -1,78 +1,78 @@
1
- const requests = require('../../../../common/requests/cookieAuth/requests');
2
- const { backendUrl } = require('../../../../env').getEnv();
3
-
4
- const Endpoints = {
5
- invite: `${backendUrl}/saas/project/team-member`,
6
- editUserProjects: `${backendUrl}/saas/project/team-member`,
7
- editUserRole: userId => `${backendUrl}/secured/users/${userId}/change-role`,
8
- getByProjectId: projectId =>
9
- `${backendUrl}/saas/project/${projectId}/team-members`,
10
- getByEmail: email => `${backendUrl}/saas/team-member/by-email/${email}`,
11
- delete: userId => `${backendUrl}/saas/users/${userId}`,
12
- deleteSingleProject: (userId, projectId) => `${backendUrl}/saas/project/${projectId}/sub-account/${userId}`,
13
- reinvite: `${backendUrl}/saas/project/team-member/reinvite`,
14
- getUserEncryptedData: (email, userRole) => `${backendUrl}/saas/team-member/email/${email}/role/${userRole}/signup-data`,
15
- signupUser: `${backendUrl}/_saas/guests/signup`,
16
- removeAllUserTraceFromDb: userId => `${backendUrl}/saas/user/automation/${userId}`
17
- };
18
-
19
- const invite = (invitedUser, context) => {
20
- const params = { disableSendMail: true };
21
- return requests.putRequestHandler(Endpoints.invite, invitedUser, context, {}, params);
22
- };
23
-
24
- const signupUser = (signupUserModel, context) => {
25
- return requests.postRequestHandler(Endpoints.signupUser, signupUserModel, context, {}, {});
26
- };
27
-
28
- const editUserRole = (userId, data, context) => {
29
- return requests.patchRequestHandler(Endpoints.editUserRole(userId), context, data);
30
- };
31
-
32
- const editUserProjects = (data, context) => {
33
- const params = { disableSendMail: true };
34
- return requests.putRequestHandler(Endpoints.editUserProjects, data, context, {}, params);
35
- };
36
-
37
- const getUsersByProjectId = (projectId, context) => {
38
- return requests.getRequestHandler(Endpoints.getByProjectId(projectId), null, context);
39
- };
40
-
41
- const getUserByEmail = (email, context) => {
42
- return requests.getRequestHandler(Endpoints.getByEmail(email), null, context);
43
- };
44
-
45
- const getUserEncryptedData = (email, role, context) => {
46
- return requests.getRequestHandler(Endpoints.getUserEncryptedData(email, role), null, context);
47
- };
48
-
49
- const deleteUser = (userId, context) => {
50
- return requests.deleteRequestHandler(Endpoints.delete(userId), context);
51
- };
52
-
53
- const deleteUserFromSingleProject = (userId, projectId, context) => {
54
- return requests.deleteRequestHandler(Endpoints.deleteSingleProject(userId, projectId), context);
55
- };
56
-
57
- const removeAllUserTraceFromDb = (userId, context) => {
58
- return requests.deleteRequestHandler(Endpoints.removeAllUserTraceFromDb(userId), context);
59
- };
60
-
61
- const reinviteUser = (userId, context) => {
62
- const params = { id: userId };
63
- return requests.postRequestHandler(Endpoints.reinvite, {}, context, {}, params);
64
- };
65
-
66
- module.exports = {
67
- invite,
68
- signupUser,
69
- getUsersByProjectId,
70
- getUserByEmail,
71
- getUserEncryptedData,
72
- deleteUser,
73
- deleteUserFromSingleProject,
74
- removeAllUserTraceFromDb,
75
- editUserRole,
76
- editUserProjects,
77
- reinviteUser
78
- };
1
+ const requests = require('../../../../common/requests/cookieAuth/requests');
2
+ const { backendUrl } = require('../../../../env').getEnv();
3
+
4
+ const Endpoints = {
5
+ invite: `${backendUrl}/saas/project/team-member`,
6
+ editUserProjects: `${backendUrl}/saas/project/team-member`,
7
+ editUserRole: userId => `${backendUrl}/secured/users/${userId}/change-role`,
8
+ getByProjectId: projectId =>
9
+ `${backendUrl}/saas/project/${projectId}/team-members`,
10
+ getByEmail: email => `${backendUrl}/saas/team-member/by-email/${email}`,
11
+ delete: userId => `${backendUrl}/saas/users/${userId}`,
12
+ deleteSingleProject: (userId, projectId) => `${backendUrl}/saas/project/${projectId}/sub-account/${userId}`,
13
+ reinvite: `${backendUrl}/saas/project/team-member/reinvite`,
14
+ getUserEncryptedData: (email, userRole) => `${backendUrl}/saas/team-member/email/${email}/role/${userRole}/signup-data`,
15
+ signupUser: `${backendUrl}/_saas/guests/signup`,
16
+ removeAllUserTraceFromDb: userId => `${backendUrl}/saas/user/automation/${userId}`
17
+ };
18
+
19
+ const invite = (invitedUser, context) => {
20
+ const params = { disableSendMail: true };
21
+ return requests.putRequestHandler(Endpoints.invite, invitedUser, context, {}, params);
22
+ };
23
+
24
+ const signupUser = (signupUserModel, context) => {
25
+ return requests.postRequestHandler(Endpoints.signupUser, signupUserModel, context, {}, {});
26
+ };
27
+
28
+ const editUserRole = (userId, data, context) => {
29
+ return requests.patchRequestHandler(Endpoints.editUserRole(userId), context, data);
30
+ };
31
+
32
+ const editUserProjects = (data, context) => {
33
+ const params = { disableSendMail: true };
34
+ return requests.putRequestHandler(Endpoints.editUserProjects, data, context, {}, params);
35
+ };
36
+
37
+ const getUsersByProjectId = (projectId, context) => {
38
+ return requests.getRequestHandler(Endpoints.getByProjectId(projectId), null, context);
39
+ };
40
+
41
+ const getUserByEmail = (email, context) => {
42
+ return requests.getRequestHandler(Endpoints.getByEmail(email), null, context);
43
+ };
44
+
45
+ const getUserEncryptedData = (email, role, context) => {
46
+ return requests.getRequestHandler(Endpoints.getUserEncryptedData(email, role), null, context);
47
+ };
48
+
49
+ const deleteUser = (userId, context) => {
50
+ return requests.deleteRequestHandler(Endpoints.delete(userId), context);
51
+ };
52
+
53
+ const deleteUserFromSingleProject = (userId, projectId, context) => {
54
+ return requests.deleteRequestHandler(Endpoints.deleteSingleProject(userId, projectId), context);
55
+ };
56
+
57
+ const removeAllUserTraceFromDb = (userId, context) => {
58
+ return requests.deleteRequestHandler(Endpoints.removeAllUserTraceFromDb(userId), context);
59
+ };
60
+
61
+ const reinviteUser = (userId, context) => {
62
+ const params = { id: userId };
63
+ return requests.postRequestHandler(Endpoints.reinvite, {}, context, {}, params);
64
+ };
65
+
66
+ module.exports = {
67
+ invite,
68
+ signupUser,
69
+ getUsersByProjectId,
70
+ getUserByEmail,
71
+ getUserEncryptedData,
72
+ deleteUser,
73
+ deleteUserFromSingleProject,
74
+ removeAllUserTraceFromDb,
75
+ editUserRole,
76
+ editUserProjects,
77
+ reinviteUser
78
+ };