@getjones/test-infra 2.8.3 → 2.8.5

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 (171) hide show
  1. package/package.json +29 -29
  2. package/src/common/commonFlows/auth/auth.js +40 -40
  3. package/src/common/commonFlows/index.js +4 -4
  4. package/src/common/commonFlows/records/records.js +72 -72
  5. package/src/common/consts/dashboardCharts.js +17 -17
  6. package/src/common/consts/recordTypes.js +5 -5
  7. package/src/common/consts/userTypes.js +5 -5
  8. package/src/common/httpResponseStatusCodes.json +11 -11
  9. package/src/common/requests/apiKeyAuth/requests.js +44 -44
  10. package/src/common/requests/cookieAuth/requests.js +40 -40
  11. package/src/common/requests/requestHandlers.js +78 -78
  12. package/src/common/utils/complianceUtil.js +56 -56
  13. package/src/common/utils/dataTypeUtils.js +41 -41
  14. package/src/common/utils/numberUtils.js +22 -22
  15. package/src/common/utils/objectUtils.js +7 -7
  16. package/src/common/utils/timeUtils.js +175 -175
  17. package/src/common/validations/errorValidation.js +16 -16
  18. package/src/common/validations/typeValidations.js +36 -36
  19. package/src/defaults/configs/auditConfigs.js +91 -91
  20. package/src/defaults/configs/coverage.js +227 -227
  21. package/src/defaults/configs/polices.js +49 -49
  22. package/src/defaults/configs/requirement.js +32 -32
  23. package/src/defaults/index.js +6 -6
  24. package/src/env.js +57 -57
  25. package/src/factory/index.js +7 -7
  26. package/src/factory/records/records.js +141 -143
  27. package/src/factory/users/users.js +79 -79
  28. package/src/index.js +81 -81
  29. package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +28 -28
  30. package/src/saas/internal-api/accounts/api/core/accounts.core.service.js +77 -77
  31. package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.api.js +48 -48
  32. package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.service.js +74 -74
  33. package/src/saas/internal-api/accounts/api/settings/settings.api.js +21 -21
  34. package/src/saas/internal-api/accounts/api/settings/settings.service.js +41 -41
  35. package/src/saas/internal-api/accounts/consts/consts.js +6 -6
  36. package/src/saas/internal-api/accounts/index.js +21 -21
  37. package/src/saas/internal-api/accounts/models/core/create.account.model.js +16 -16
  38. package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +38 -38
  39. package/src/saas/internal-api/accounts/utils/utils.js +66 -66
  40. package/src/saas/internal-api/auditNotes/api/audit.notes.api.js +40 -40
  41. package/src/saas/internal-api/auditNotes/api/audit.notes.service.js +115 -115
  42. package/src/saas/internal-api/auditNotes/index.js +4 -4
  43. package/src/saas/internal-api/auditNotes/models/audit.note.model.js +30 -30
  44. package/src/saas/internal-api/auth/api/auth.api.js +27 -27
  45. package/src/saas/internal-api/auth/api/auth.service.js +90 -90
  46. package/src/saas/internal-api/auth/index.js +3 -3
  47. package/src/saas/internal-api/coi/api/coi.api.js +34 -34
  48. package/src/saas/internal-api/coi/api/coi.service.js +22 -22
  49. package/src/saas/internal-api/coi/consts/uploaderTypes.js +5 -5
  50. package/src/saas/internal-api/coi/index.js +13 -13
  51. package/src/saas/internal-api/coi/models/submit.coi.model.js +9 -9
  52. package/src/saas/internal-api/coi/utils/utils.js +48 -48
  53. package/src/saas/internal-api/compliance/api/audit/audit.api.js +46 -46
  54. package/src/saas/internal-api/compliance/api/audit/audit.service.js +143 -143
  55. package/src/saas/internal-api/compliance/api/convert/convert.api.js +17 -17
  56. package/src/saas/internal-api/compliance/api/convert/convert.service.js +11 -11
  57. package/src/saas/internal-api/compliance/api/coverage/coverage.api.js +33 -33
  58. package/src/saas/internal-api/compliance/api/coverage/coverage.service.js +48 -48
  59. package/src/saas/internal-api/compliance/api/overrideGap/override.gap.api.js +33 -33
  60. package/src/saas/internal-api/compliance/api/overrideGap/override.gap.service.js +127 -127
  61. package/src/saas/internal-api/compliance/consts/audit.js +71 -71
  62. package/src/saas/internal-api/compliance/index.js +33 -33
  63. package/src/saas/internal-api/compliance/models/audit/audit.model.js +84 -84
  64. package/src/saas/internal-api/compliance/models/waive/waive.model.js +49 -49
  65. package/src/saas/internal-api/compliance/utils/auditUtil.js +222 -222
  66. package/src/saas/internal-api/compliance/utils/coverageUtil.js +40 -40
  67. package/src/saas/internal-api/contractors/api/contractors.api.js +153 -153
  68. package/src/saas/internal-api/contractors/api/contractors.service.js +181 -169
  69. package/src/saas/internal-api/contractors/consts/consts.js +6 -6
  70. package/src/saas/internal-api/contractors/index.js +9 -9
  71. package/src/saas/internal-api/contractors/models/assign.requirement.model.js +10 -10
  72. package/src/saas/internal-api/contractors/models/create.contractor.model.js +22 -22
  73. package/src/saas/internal-api/contractors/models/edit.contractor.model.js +60 -60
  74. package/src/saas/internal-api/contractors/models/verification.contractor.model.js +27 -27
  75. package/src/saas/internal-api/dashboard/api/recordList.api.js +38 -38
  76. package/src/saas/internal-api/dashboard/api/recordList.service.js +60 -60
  77. package/src/saas/internal-api/dashboard/index.js +5 -5
  78. package/src/saas/internal-api/dashboard/models/dashboard.filter.criteria.model.js +38 -38
  79. package/src/saas/internal-api/dbEmails/api/db.emails.api.js +25 -25
  80. package/src/saas/internal-api/dbEmails/api/db.emails.service.js +127 -127
  81. package/src/saas/internal-api/dbEmails/consts/consts.js +37 -37
  82. package/src/saas/internal-api/dbEmails/index.js +5 -5
  83. package/src/saas/internal-api/dbEmails/models/db.emails.model.js +21 -21
  84. package/src/saas/internal-api/dbEmails/utils/util.js +68 -68
  85. package/src/saas/internal-api/globalRecord/api/global.record.api.js +82 -82
  86. package/src/saas/internal-api/globalRecord/api/global.record.service.js +95 -95
  87. package/src/saas/internal-api/globalRecord/consts.js +20 -20
  88. package/src/saas/internal-api/globalRecord/index.js +6 -6
  89. package/src/saas/internal-api/globalRecord/models/global.record.model.js +43 -43
  90. package/src/saas/internal-api/globalRecord/utils/util.js +148 -148
  91. package/src/saas/internal-api/homepageCharts/api/charts.api.js +12 -12
  92. package/src/saas/internal-api/homepageCharts/api/charts.service.js +7 -7
  93. package/src/saas/internal-api/homepageCharts/index.js +3 -3
  94. package/src/saas/internal-api/projects/api/core/projects.api.js +39 -39
  95. package/src/saas/internal-api/projects/api/core/projects.service.js +65 -65
  96. package/src/saas/internal-api/projects/api/settings/project.settings.api.js +18 -18
  97. package/src/saas/internal-api/projects/api/settings/project.settings.service.js +35 -35
  98. package/src/saas/internal-api/projects/consts/defaultProject.js +3 -3
  99. package/src/saas/internal-api/projects/index.js +24 -24
  100. package/src/saas/internal-api/projects/models/core/create.project.model.js +41 -41
  101. package/src/saas/internal-api/projects/models/core/update.project.model.js +47 -47
  102. package/src/saas/internal-api/projects/models/settings/update.project.settings.model.js +41 -41
  103. package/src/saas/internal-api/projects/utils/utils.js +156 -156
  104. package/src/saas/internal-api/recordNotes/api/record.notes.api.js +38 -38
  105. package/src/saas/internal-api/recordNotes/api/record.notes.service.js +29 -29
  106. package/src/saas/internal-api/recordNotes/index.js +3 -3
  107. package/src/saas/internal-api/reports/api/reports.api.js +39 -39
  108. package/src/saas/internal-api/reports/api/reports.service.js +34 -34
  109. package/src/saas/internal-api/reports/consts/consts.js +63 -63
  110. package/src/saas/internal-api/reports/index.js +15 -15
  111. package/src/saas/internal-api/reports/models/report.model.js +27 -27
  112. package/src/saas/internal-api/requests/api/requests.api.js +72 -72
  113. package/src/saas/internal-api/requests/api/requests.service.js +114 -114
  114. package/src/saas/internal-api/requests/index.js +14 -14
  115. package/src/saas/internal-api/requests/models/create.request.model.js +33 -33
  116. package/src/saas/internal-api/requests/models/edit.request.model.js +31 -31
  117. package/src/saas/internal-api/requests/models/tenant.request.model.js +9 -9
  118. package/src/saas/internal-api/requests/utils.js +8 -8
  119. package/src/saas/internal-api/requestsTable/api/requests.table.api.js +20 -20
  120. package/src/saas/internal-api/requestsTable/api/requests.table.service.js +14 -14
  121. package/src/saas/internal-api/requestsTable/index.js +3 -3
  122. package/src/saas/internal-api/requirements/api/requirements.api.js +45 -45
  123. package/src/saas/internal-api/requirements/api/requirements.service.js +134 -134
  124. package/src/saas/internal-api/requirements/consts/attributeTypes.json +5 -5
  125. package/src/saas/internal-api/requirements/consts/consts.js +6 -6
  126. package/src/saas/internal-api/requirements/index.js +9 -9
  127. package/src/saas/internal-api/requirements/models/create.requirement.model.js +17 -17
  128. package/src/saas/internal-api/requirements/models/policy.model.js +32 -32
  129. package/src/saas/internal-api/requirements/models/update.requirement.model.js +19 -19
  130. package/src/saas/internal-api/requirements/utils/utils.js +102 -102
  131. package/src/saas/internal-api/serviceArea/api/coordinates.api.js +12 -12
  132. package/src/saas/internal-api/serviceArea/api/coordinates.service.js +7 -7
  133. package/src/saas/internal-api/serviceArea/index.js +4 -4
  134. package/src/saas/internal-api/serviceArea/utils/utils.js +8 -8
  135. package/src/saas/internal-api/tabs/api/tabs.api.js +32 -32
  136. package/src/saas/internal-api/tabs/api/tabs.service.js +54 -54
  137. package/src/saas/internal-api/tabs/index.js +3 -3
  138. package/src/saas/internal-api/tabs/models/tabs.model.js +18 -18
  139. package/src/saas/internal-api/thread-scheduler/runner.js +39 -39
  140. package/src/saas/internal-api/users/api/tenantApp/tenant.app.api.js +32 -32
  141. package/src/saas/internal-api/users/api/tenantApp/tenant.app.service.js +78 -78
  142. package/src/saas/internal-api/users/api/users.api.js +77 -77
  143. package/src/saas/internal-api/users/api/users.service.js +101 -101
  144. package/src/saas/internal-api/users/index.js +11 -11
  145. package/src/saas/internal-api/users/models/tenent.user.model.js +11 -11
  146. package/src/saas/internal-api/users/models/users.model.js +31 -31
  147. package/src/saas/internal-api/users/utils/util.js +20 -20
  148. package/src/saas/internal-api/vendorProfile/api/vendor.profile.api.js +20 -20
  149. package/src/saas/internal-api/vendorProfile/api/vendor.profile.service.js +14 -14
  150. package/src/saas/internal-api/vendorProfile/index.js +3 -3
  151. package/src/saas/openapi/accounts/accounts.api.js +17 -17
  152. package/src/saas/openapi/accounts/accounts.service.js +11 -11
  153. package/src/saas/openapi/coi/coi.api.js +20 -20
  154. package/src/saas/openapi/coi/coi.service.js +13 -13
  155. package/src/saas/openapi/projects/projects.api.js +59 -59
  156. package/src/saas/openapi/projects/projects.service.js +44 -44
  157. package/src/saas/openapi/requests/index.js +7 -7
  158. package/src/saas/openapi/requests/models/invite.request.model.js +37 -37
  159. package/src/saas/openapi/requests/models/update.request.model.js +35 -35
  160. package/src/saas/openapi/requests/requests.api.js +76 -76
  161. package/src/saas/openapi/requests/requests.service.js +65 -65
  162. package/src/saas/openapi/requirements/index.js +6 -6
  163. package/src/saas/openapi/requirements/models/copy.requirement.model.js +10 -10
  164. package/src/saas/openapi/requirements/requirements.api.js +26 -26
  165. package/src/saas/openapi/requirements/requirements.service.js +32 -32
  166. package/src/saas/openapi/tabs/index.js +6 -6
  167. package/src/saas/openapi/tabs/models/create.tab.model.js +6 -6
  168. package/src/saas/openapi/tabs/tabs.api.js +18 -18
  169. package/src/saas/openapi/tabs/tabs.service.js +11 -11
  170. package/tests/env.test.js +40 -40
  171. package/tests/validation.test.js +83 -83
@@ -1,20 +1,20 @@
1
- const requests = require('../../../common/requests/apiKeyAuth/requests');
2
- const { openapiUrl } = require('../../../env').getEnv();
3
- const { isLocalhost } = require('../../../env');
4
-
5
- const contractorUrl = isLocalhost() ? 'contractors' : 'records';
6
-
7
- const Endpoints = {
8
- uploadCoi: requestId => `${openapiUrl}/${contractorUrl}/${requestId}/coi`,
9
- downloadCoi: requestId => `${openapiUrl}/${contractorUrl}/${requestId}/coi-link`
10
- };
11
-
12
- const uploadCoi = (apiKey, requestId, fileData) => {
13
- return requests.putFileRequestHandler(Endpoints.uploadCoi(requestId), apiKey, fileData);
14
- };
15
-
16
- const downloadCoi = (apiKey, requestId) => {
17
- return requests.getRequestHandler(Endpoints.downloadCoi(requestId), apiKey);
18
- };
19
-
20
- module.exports = { uploadCoi, downloadCoi };
1
+ const requests = require('../../../common/requests/apiKeyAuth/requests');
2
+ const { openapiUrl } = require('../../../env').getEnv();
3
+ const { isLocalhost } = require('../../../env');
4
+
5
+ const contractorUrl = isLocalhost() ? 'contractors' : 'records';
6
+
7
+ const Endpoints = {
8
+ uploadCoi: requestId => `${openapiUrl}/${contractorUrl}/${requestId}/coi`,
9
+ downloadCoi: requestId => `${openapiUrl}/${contractorUrl}/${requestId}/coi-link`
10
+ };
11
+
12
+ const uploadCoi = (apiKey, requestId, fileData) => {
13
+ return requests.putFileRequestHandler(Endpoints.uploadCoi(requestId), apiKey, fileData);
14
+ };
15
+
16
+ const downloadCoi = (apiKey, requestId) => {
17
+ return requests.getRequestHandler(Endpoints.downloadCoi(requestId), apiKey);
18
+ };
19
+
20
+ module.exports = { uploadCoi, downloadCoi };
@@ -1,13 +1,13 @@
1
- const fs = require('fs');
2
-
3
- const coiApis = require('./coi.api');
4
-
5
- const uploadCoi = (apiKey, requestId, filePath) => {
6
- const fileData = fs.createReadStream(filePath);
7
- return coiApis.uploadCoi(apiKey, requestId, fileData);
8
- };
9
-
10
- const downloadCoi = (apiKey, requestId) => {
11
- return coiApis.downloadCoi(apiKey, requestId);
12
- };
13
- module.exports = { uploadCoi, downloadCoi };
1
+ const fs = require('fs');
2
+
3
+ const coiApis = require('./coi.api');
4
+
5
+ const uploadCoi = (apiKey, requestId, filePath) => {
6
+ const fileData = fs.createReadStream(filePath);
7
+ return coiApis.uploadCoi(apiKey, requestId, fileData);
8
+ };
9
+
10
+ const downloadCoi = (apiKey, requestId) => {
11
+ return coiApis.downloadCoi(apiKey, requestId);
12
+ };
13
+ module.exports = { uploadCoi, downloadCoi };
@@ -1,59 +1,59 @@
1
- const requests = require('../../../common/requests/apiKeyAuth/requests');
2
- const { openapiUrl } = require('../../../env').getEnv();
3
-
4
- const Endpoints = {
5
- getProjectsByName: `${openapiUrl}/properties`,
6
- getAllProjects: `${openapiUrl}/properties/all`,
7
- getModifiedProjects: `${openapiUrl}/properties/modified`,
8
- createProject: `${openapiUrl}/properties`,
9
- updateProject: projectId => `${openapiUrl}/properties/${projectId}`,
10
- getProjectSettings: projectId => `${openapiUrl}/properties/${projectId}/settings`,
11
- updateProjectSettings: projectId => `${openapiUrl}/properties/${projectId}/settings`,
12
- getProjectServiceArea: (city, state) => `${openapiUrl}/properties/service-area?city=${city}&state=${state}`
13
- };
14
-
15
- const getProjectsByName = async (apiKey, params) => {
16
- return requests.getRequestHandler(Endpoints.getProjectsByName, apiKey, params).then(res => res.data);
17
- };
18
-
19
- const getAllProjects = async apiKey => {
20
- return requests.getRequestHandler(Endpoints.getAllProjects, apiKey).then(res => res.data);
21
- };
22
-
23
- const getModifiedProjects = async (apiKey, params) => {
24
- return requests.getRequestHandler(Endpoints.getModifiedProjects, apiKey, params).then(res => res.data);
25
- };
26
-
27
- const createProject = async (apiKey, project) => {
28
- return requests.postRequestHandler(Endpoints.createProject, apiKey, project).then(res => res.data);
29
- };
30
-
31
- const updateProject = async (apiKey, projectId, projectData) => {
32
- return requests.patchRequestHandler(Endpoints.updateProject(projectId), apiKey, projectData).then(res => res.data);
33
- };
34
-
35
- const updateProjectSettings = async (apiKey, projectId, projectSettings) => {
36
- return requests.patchRequestHandler(Endpoints.updateProjectSettings(projectId),
37
- apiKey,
38
- projectSettings).then(res => res.data);
39
- };
40
-
41
- const getProjectSettings = async (apiKey, projectId) => {
42
- return requests.getRequestHandler(Endpoints.getProjectSettings(projectId),
43
- apiKey).then(res => res.data);
44
- };
45
-
46
- const getProjectServiceArea = async (apiKey, city, state) => {
47
- return requests.getRequestHandler(Endpoints.getProjectServiceArea(city, state), apiKey);
48
- };
49
-
50
- module.exports = {
51
- getProjectsByName,
52
- getAllProjects,
53
- getModifiedProjects,
54
- createProject,
55
- updateProject,
56
- updateProjectSettings,
57
- getProjectSettings,
58
- getProjectServiceArea
59
- };
1
+ const requests = require('../../../common/requests/apiKeyAuth/requests');
2
+ const { openapiUrl } = require('../../../env').getEnv();
3
+
4
+ const Endpoints = {
5
+ getProjectsByName: `${openapiUrl}/properties`,
6
+ getAllProjects: `${openapiUrl}/properties/all`,
7
+ getModifiedProjects: `${openapiUrl}/properties/modified`,
8
+ createProject: `${openapiUrl}/properties`,
9
+ updateProject: projectId => `${openapiUrl}/properties/${projectId}`,
10
+ getProjectSettings: projectId => `${openapiUrl}/properties/${projectId}/settings`,
11
+ updateProjectSettings: projectId => `${openapiUrl}/properties/${projectId}/settings`,
12
+ getProjectServiceArea: (city, state) => `${openapiUrl}/properties/service-area?city=${city}&state=${state}`
13
+ };
14
+
15
+ const getProjectsByName = async (apiKey, params) => {
16
+ return requests.getRequestHandler(Endpoints.getProjectsByName, apiKey, params).then(res => res.data);
17
+ };
18
+
19
+ const getAllProjects = async apiKey => {
20
+ return requests.getRequestHandler(Endpoints.getAllProjects, apiKey).then(res => res.data);
21
+ };
22
+
23
+ const getModifiedProjects = async (apiKey, params) => {
24
+ return requests.getRequestHandler(Endpoints.getModifiedProjects, apiKey, params).then(res => res.data);
25
+ };
26
+
27
+ const createProject = async (apiKey, project) => {
28
+ return requests.postRequestHandler(Endpoints.createProject, apiKey, project).then(res => res.data);
29
+ };
30
+
31
+ const updateProject = async (apiKey, projectId, projectData) => {
32
+ return requests.patchRequestHandler(Endpoints.updateProject(projectId), apiKey, projectData).then(res => res.data);
33
+ };
34
+
35
+ const updateProjectSettings = async (apiKey, projectId, projectSettings) => {
36
+ return requests.patchRequestHandler(Endpoints.updateProjectSettings(projectId),
37
+ apiKey,
38
+ projectSettings).then(res => res.data);
39
+ };
40
+
41
+ const getProjectSettings = async (apiKey, projectId) => {
42
+ return requests.getRequestHandler(Endpoints.getProjectSettings(projectId),
43
+ apiKey).then(res => res.data);
44
+ };
45
+
46
+ const getProjectServiceArea = async (apiKey, city, state) => {
47
+ return requests.getRequestHandler(Endpoints.getProjectServiceArea(city, state), apiKey);
48
+ };
49
+
50
+ module.exports = {
51
+ getProjectsByName,
52
+ getAllProjects,
53
+ getModifiedProjects,
54
+ createProject,
55
+ updateProject,
56
+ updateProjectSettings,
57
+ getProjectSettings,
58
+ getProjectServiceArea
59
+ };
@@ -1,44 +1,44 @@
1
- const projectsApi = require('./projects.api');
2
-
3
- const getProjectsByName = async (apiKey, name) => {
4
- return projectsApi.getProjectsByName(apiKey, { name });
5
- };
6
-
7
- const createProject = async (apiKey, project) => {
8
- return projectsApi.createProject(apiKey, project);
9
- };
10
-
11
- const updateProject = async (apiKey, projectId, projectData) => {
12
- return projectsApi.updateProject(apiKey, projectId, projectData);
13
- };
14
-
15
- const getAllProjects = async apiKey => {
16
- return projectsApi.getAllProjects(apiKey);
17
- };
18
-
19
- const getModifiedProjects = async (apiKey, timestamp) => {
20
- return projectsApi.getModifiedProjects(apiKey, { timestamp });
21
- };
22
-
23
- const updateProjectSettings = async (apiKey, projectId, projectSettings) => {
24
- return projectsApi.updateProjectSettings(apiKey, projectId, projectSettings);
25
- };
26
-
27
- const getProjectSettings = async (apiKey, projectId) => {
28
- return projectsApi.getProjectSettings(apiKey, projectId);
29
- };
30
-
31
- const getProjectServiceArea = async (apiKey, city, state) => {
32
- return projectsApi.getProjectServiceArea(apiKey, city, state);
33
- };
34
-
35
- module.exports = {
36
- getProjectsByName,
37
- createProject,
38
- updateProject,
39
- getAllProjects,
40
- getModifiedProjects,
41
- updateProjectSettings,
42
- getProjectSettings,
43
- getProjectServiceArea
44
- };
1
+ const projectsApi = require('./projects.api');
2
+
3
+ const getProjectsByName = async (apiKey, name) => {
4
+ return projectsApi.getProjectsByName(apiKey, { name });
5
+ };
6
+
7
+ const createProject = async (apiKey, project) => {
8
+ return projectsApi.createProject(apiKey, project);
9
+ };
10
+
11
+ const updateProject = async (apiKey, projectId, projectData) => {
12
+ return projectsApi.updateProject(apiKey, projectId, projectData);
13
+ };
14
+
15
+ const getAllProjects = async apiKey => {
16
+ return projectsApi.getAllProjects(apiKey);
17
+ };
18
+
19
+ const getModifiedProjects = async (apiKey, timestamp) => {
20
+ return projectsApi.getModifiedProjects(apiKey, { timestamp });
21
+ };
22
+
23
+ const updateProjectSettings = async (apiKey, projectId, projectSettings) => {
24
+ return projectsApi.updateProjectSettings(apiKey, projectId, projectSettings);
25
+ };
26
+
27
+ const getProjectSettings = async (apiKey, projectId) => {
28
+ return projectsApi.getProjectSettings(apiKey, projectId);
29
+ };
30
+
31
+ const getProjectServiceArea = async (apiKey, city, state) => {
32
+ return projectsApi.getProjectServiceArea(apiKey, city, state);
33
+ };
34
+
35
+ module.exports = {
36
+ getProjectsByName,
37
+ createProject,
38
+ updateProject,
39
+ getAllProjects,
40
+ getModifiedProjects,
41
+ updateProjectSettings,
42
+ getProjectSettings,
43
+ getProjectServiceArea
44
+ };
@@ -1,7 +1,7 @@
1
- const services = require('./requests.service');
2
-
3
- const InviteRequestModel = require('./models/invite.request.model');
4
- const UpdateRequestModel = require('./models/update.request.model');
5
- const models = { InviteRequestModel, UpdateRequestModel };
6
-
7
- module.exports = { ... services, models };
1
+ const services = require('./requests.service');
2
+
3
+ const InviteRequestModel = require('./models/invite.request.model');
4
+ const UpdateRequestModel = require('./models/update.request.model');
5
+ const models = { InviteRequestModel, UpdateRequestModel };
6
+
7
+ module.exports = { ... services, models };
@@ -1,37 +1,37 @@
1
- class InviteRequestModel {
2
- constructor(
3
- email,
4
- company,
5
- {
6
- requirementId = null,
7
- firstName = null,
8
- lastName = null,
9
- dba = null,
10
- address = null,
11
- city = null,
12
- state = null,
13
- zipCode = null,
14
- phoneNumber = null,
15
- startDate = null,
16
- endDate = null
17
- } = {}
18
- ) {
19
- this.email = email;
20
- this.company = company;
21
- this.requirementId = requirementId;
22
- this.firstName = firstName;
23
- this.lastName = lastName;
24
- this.dba = dba;
25
- this.address = address;
26
- this.city = city;
27
- this.state = state;
28
- this.zipCode = zipCode;
29
- this.phoneNumber = phoneNumber;
30
- this.startDate = startDate;
31
- this.endDate = endDate;
32
- }
33
- }
34
-
35
- module.exports = {
36
- InviteRequestModel
37
- };
1
+ class InviteRequestModel {
2
+ constructor(
3
+ email,
4
+ company,
5
+ {
6
+ requirementId = null,
7
+ firstName = null,
8
+ lastName = null,
9
+ dba = null,
10
+ address = null,
11
+ city = null,
12
+ state = null,
13
+ zipCode = null,
14
+ phoneNumber = null,
15
+ startDate = null,
16
+ endDate = null
17
+ } = {}
18
+ ) {
19
+ this.email = email;
20
+ this.company = company;
21
+ this.requirementId = requirementId;
22
+ this.firstName = firstName;
23
+ this.lastName = lastName;
24
+ this.dba = dba;
25
+ this.address = address;
26
+ this.city = city;
27
+ this.state = state;
28
+ this.zipCode = zipCode;
29
+ this.phoneNumber = phoneNumber;
30
+ this.startDate = startDate;
31
+ this.endDate = endDate;
32
+ }
33
+ }
34
+
35
+ module.exports = {
36
+ InviteRequestModel
37
+ };
@@ -1,35 +1,35 @@
1
- class UpdateRequestModel {
2
- constructor(
3
- email,
4
- company,
5
- {
6
- firstName = null,
7
- lastName = null,
8
- dba = null,
9
- address = null,
10
- city = null,
11
- state = null,
12
- zipCode = null,
13
- phoneNumber = null,
14
- startDate = null,
15
- endDate = null
16
- } = {}
17
- ) {
18
- this.email = email;
19
- this.company = company;
20
- this.firstName = firstName;
21
- this.lastName = lastName;
22
- this.dba = dba;
23
- this.address = address;
24
- this.city = city;
25
- this.state = state;
26
- this.zipCode = zipCode;
27
- this.phoneNumber = phoneNumber;
28
- this.startDate = startDate;
29
- this.endDate = endDate;
30
- }
31
- }
32
-
33
- module.exports = {
34
- UpdateRequestModel
35
- };
1
+ class UpdateRequestModel {
2
+ constructor(
3
+ email,
4
+ company,
5
+ {
6
+ firstName = null,
7
+ lastName = null,
8
+ dba = null,
9
+ address = null,
10
+ city = null,
11
+ state = null,
12
+ zipCode = null,
13
+ phoneNumber = null,
14
+ startDate = null,
15
+ endDate = null
16
+ } = {}
17
+ ) {
18
+ this.email = email;
19
+ this.company = company;
20
+ this.firstName = firstName;
21
+ this.lastName = lastName;
22
+ this.dba = dba;
23
+ this.address = address;
24
+ this.city = city;
25
+ this.state = state;
26
+ this.zipCode = zipCode;
27
+ this.phoneNumber = phoneNumber;
28
+ this.startDate = startDate;
29
+ this.endDate = endDate;
30
+ }
31
+ }
32
+
33
+ module.exports = {
34
+ UpdateRequestModel
35
+ };
@@ -1,76 +1,76 @@
1
- const requests = require('../../../common/requests/apiKeyAuth/requests');
2
- const { openapiUrl } = require('../../../env').getEnv();
3
- const { isLocalhost } = require('../../../env');
4
-
5
- const recordsUrl = isLocalhost() ? 'contractors' : 'records';
6
-
7
- const Endpoints = {
8
- inviteRequest: tabId => `${openapiUrl}/tabs/${tabId}/${recordsUrl}`,
9
- requestById: requestId => `${openapiUrl}/${recordsUrl}/${requestId}`,
10
- getAllRequests: `${openapiUrl}/${recordsUrl}/all`,
11
- getRequestsByEmail: `${openapiUrl}/${recordsUrl}`,
12
- getModifiedRequests: `${openapiUrl}/${recordsUrl}/modified`,
13
- getPolicies: requestId => `${openapiUrl}/${recordsUrl}/${requestId}/compliance-report`,
14
- changeRequirement: (requestId, requirementId) =>
15
- `${openapiUrl}/${recordsUrl}/${requestId}/requirement/${requirementId}`,
16
- archive: requestId => `${openapiUrl}/${recordsUrl}/${requestId}/archive`,
17
- restore: requestId => `${openapiUrl}/${recordsUrl}/${requestId}/restore`
18
- };
19
-
20
- const inviteRequest = (apiKey, tabId, params) => {
21
- return requests.postRequestHandler(Endpoints.inviteRequest(tabId), apiKey, params);
22
- };
23
-
24
- const getAllRequests = (apiKey, params) => {
25
- return requests.getRequestHandler(Endpoints.getAllRequests, apiKey, params);
26
- };
27
-
28
- const getRequestsByEmail = (apiKey, email) => {
29
- const params = { email };
30
- return requests.getRequestHandler(Endpoints.getRequestsByEmail, apiKey, params);
31
- };
32
-
33
- const getRequestById = (apiKey, id) => {
34
- return requests.getRequestHandler(Endpoints.requestById(id), apiKey);
35
- };
36
-
37
- const getRequestsByModifiedDate = (apiKey, timestamp) => {
38
- const params = { timestamp };
39
- return requests.getRequestHandler(Endpoints.getModifiedRequests, apiKey, params);
40
- };
41
-
42
- const getRequestPolicies = (apiKey, id) => {
43
- return requests.getRequestHandler(Endpoints.getPolicies(id), apiKey);
44
- };
45
-
46
- const updateRequest = (apiKey, id, updateRequestModel) => {
47
- return requests.patchRequestHandler(Endpoints.requestById(id), apiKey, updateRequestModel);
48
- };
49
-
50
- const changeRequirement = (apiKey, requestId, requirementId) => {
51
- const endpoint = Endpoints.changeRequirement(requestId, requirementId);
52
- return requests.putRequestHandler(endpoint, apiKey);
53
- };
54
-
55
- const archiveRequest = (apiKey, requestId) => {
56
- const endpoint = Endpoints.archive(requestId);
57
- return requests.putRequestHandler(endpoint, apiKey);
58
- };
59
-
60
- const restoreRequest = (apiKey, requestId) => {
61
- const endpoint = Endpoints.restore(requestId);
62
- return requests.putRequestHandler(endpoint, apiKey);
63
- };
64
-
65
- module.exports = {
66
- inviteRequest,
67
- getAllRequests,
68
- getRequestById,
69
- getRequestsByEmail,
70
- getRequestsByModifiedDate,
71
- getRequestPolicies,
72
- updateRequest,
73
- archiveRequest,
74
- restoreRequest,
75
- changeRequirement
76
- };
1
+ const requests = require('../../../common/requests/apiKeyAuth/requests');
2
+ const { openapiUrl } = require('../../../env').getEnv();
3
+ const { isLocalhost } = require('../../../env');
4
+
5
+ const recordsUrl = isLocalhost() ? 'contractors' : 'records';
6
+
7
+ const Endpoints = {
8
+ inviteRequest: tabId => `${openapiUrl}/tabs/${tabId}/${recordsUrl}`,
9
+ requestById: requestId => `${openapiUrl}/${recordsUrl}/${requestId}`,
10
+ getAllRequests: `${openapiUrl}/${recordsUrl}/all`,
11
+ getRequestsByEmail: `${openapiUrl}/${recordsUrl}`,
12
+ getModifiedRequests: `${openapiUrl}/${recordsUrl}/modified`,
13
+ getPolicies: requestId => `${openapiUrl}/${recordsUrl}/${requestId}/compliance-report`,
14
+ changeRequirement: (requestId, requirementId) =>
15
+ `${openapiUrl}/${recordsUrl}/${requestId}/requirement/${requirementId}`,
16
+ archive: requestId => `${openapiUrl}/${recordsUrl}/${requestId}/archive`,
17
+ restore: requestId => `${openapiUrl}/${recordsUrl}/${requestId}/restore`
18
+ };
19
+
20
+ const inviteRequest = (apiKey, tabId, params) => {
21
+ return requests.postRequestHandler(Endpoints.inviteRequest(tabId), apiKey, params);
22
+ };
23
+
24
+ const getAllRequests = (apiKey, params) => {
25
+ return requests.getRequestHandler(Endpoints.getAllRequests, apiKey, params);
26
+ };
27
+
28
+ const getRequestsByEmail = (apiKey, email) => {
29
+ const params = { email };
30
+ return requests.getRequestHandler(Endpoints.getRequestsByEmail, apiKey, params);
31
+ };
32
+
33
+ const getRequestById = (apiKey, id) => {
34
+ return requests.getRequestHandler(Endpoints.requestById(id), apiKey);
35
+ };
36
+
37
+ const getRequestsByModifiedDate = (apiKey, timestamp) => {
38
+ const params = { timestamp };
39
+ return requests.getRequestHandler(Endpoints.getModifiedRequests, apiKey, params);
40
+ };
41
+
42
+ const getRequestPolicies = (apiKey, id) => {
43
+ return requests.getRequestHandler(Endpoints.getPolicies(id), apiKey);
44
+ };
45
+
46
+ const updateRequest = (apiKey, id, updateRequestModel) => {
47
+ return requests.patchRequestHandler(Endpoints.requestById(id), apiKey, updateRequestModel);
48
+ };
49
+
50
+ const changeRequirement = (apiKey, requestId, requirementId) => {
51
+ const endpoint = Endpoints.changeRequirement(requestId, requirementId);
52
+ return requests.putRequestHandler(endpoint, apiKey);
53
+ };
54
+
55
+ const archiveRequest = (apiKey, requestId) => {
56
+ const endpoint = Endpoints.archive(requestId);
57
+ return requests.putRequestHandler(endpoint, apiKey);
58
+ };
59
+
60
+ const restoreRequest = (apiKey, requestId) => {
61
+ const endpoint = Endpoints.restore(requestId);
62
+ return requests.putRequestHandler(endpoint, apiKey);
63
+ };
64
+
65
+ module.exports = {
66
+ inviteRequest,
67
+ getAllRequests,
68
+ getRequestById,
69
+ getRequestsByEmail,
70
+ getRequestsByModifiedDate,
71
+ getRequestPolicies,
72
+ updateRequest,
73
+ archiveRequest,
74
+ restoreRequest,
75
+ changeRequirement
76
+ };