@getjones/test-infra 2.5.0 → 2.6.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 +30 -30
- package/src/common/commonFlows/index.js +3 -3
- package/src/common/commonFlows/records/records.js +71 -71
- package/src/common/httpResponseStatusCodes.json +11 -11
- package/src/common/requests/apiKeyAuth/requests.js +38 -38
- package/src/common/requests/cookieAuth/requests.js +40 -40
- package/src/common/requests/requestHandlers.js +60 -60
- package/src/common/utils/dataTypeUtils.js +41 -41
- package/src/common/utils/numberUtils.js +22 -22
- package/src/common/utils/objectUtils.js +9 -9
- package/src/common/utils/timeUtils.js +171 -171
- package/src/common/validations/errorValidation.js +16 -16
- package/src/common/validations/typeValidations.js +36 -36
- package/src/defaults/configs/auditConfigs.js +85 -85
- package/src/defaults/configs/polices.js +47 -47
- package/src/defaults/configs/requirement.js +29 -29
- package/src/defaults/index.js +5 -5
- package/src/env.js +57 -57
- package/src/index.js +73 -73
- package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +28 -28
- package/src/saas/internal-api/accounts/api/core/accounts.core.service.js +77 -77
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.api.js +48 -48
- package/src/saas/internal-api/accounts/api/openapi/accounts.openapi.service.js +74 -74
- package/src/saas/internal-api/accounts/api/settings/settings.api.js +21 -21
- package/src/saas/internal-api/accounts/api/settings/settings.service.js +24 -24
- package/src/saas/internal-api/accounts/consts/consts.js +6 -6
- package/src/saas/internal-api/accounts/index.js +21 -21
- package/src/saas/internal-api/accounts/models/core/create.account.model.js +16 -16
- package/src/saas/internal-api/accounts/models/settings/update.settings.model.js +23 -23
- package/src/saas/internal-api/accounts/utils/utils.js +32 -32
- package/src/saas/internal-api/auth/api/auth.api.js +18 -18
- package/src/saas/internal-api/auth/api/auth.service.js +67 -67
- package/src/saas/internal-api/auth/index.js +3 -3
- package/src/saas/internal-api/coi/api/coi.api.js +34 -34
- package/src/saas/internal-api/coi/api/coi.service.js +22 -22
- package/src/saas/internal-api/coi/consts/uploaderTypes.js +7 -7
- package/src/saas/internal-api/coi/index.js +13 -13
- package/src/saas/internal-api/coi/models/submit.coi.model.js +9 -9
- package/src/saas/internal-api/coi/utils/utils.js +48 -48
- package/src/saas/internal-api/compliance/api/audit/audit.api.js +40 -40
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +151 -151
- package/src/saas/internal-api/compliance/api/convert/convert.api.js +17 -17
- package/src/saas/internal-api/compliance/api/convert/convert.service.js +11 -11
- package/src/saas/internal-api/compliance/api/coverage/coverage.api.js +33 -33
- package/src/saas/internal-api/compliance/api/coverage/coverage.service.js +24 -24
- package/src/saas/internal-api/compliance/api/waive/waive.api.js +21 -21
- package/src/saas/internal-api/compliance/api/waive/waive.service.js +15 -15
- package/src/saas/internal-api/compliance/consts/audit.js +81 -81
- package/src/saas/internal-api/compliance/index.js +28 -28
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +84 -84
- package/src/saas/internal-api/compliance/models/waive/waive.model.js +45 -45
- package/src/saas/internal-api/compliance/utils/util.js +175 -175
- package/src/saas/internal-api/contractors/api/contractors.api.js +141 -141
- package/src/saas/internal-api/contractors/api/contractors.service.js +147 -123
- package/src/saas/internal-api/contractors/index.js +8 -8
- package/src/saas/internal-api/contractors/models/create.contractor.model.js +22 -22
- package/src/saas/internal-api/contractors/models/edit.contractor.model.js +60 -60
- package/src/saas/internal-api/contractors/models/verification.contractor.model.js +27 -27
- package/src/saas/internal-api/dashboardInnerPage/api/recordList.api.js +12 -12
- package/src/saas/internal-api/dashboardInnerPage/api/recordList.service.js +7 -7
- package/src/saas/internal-api/dashboardInnerPage/index.js +5 -5
- package/src/saas/internal-api/dashboardInnerPage/models/dashboard.filter.criteria.model.js +38 -38
- package/src/saas/internal-api/dbEmails/api/db.emails.api.js +25 -25
- package/src/saas/internal-api/dbEmails/api/db.emails.service.js +127 -127
- package/src/saas/internal-api/dbEmails/consts/consts.js +3 -3
- package/src/saas/internal-api/dbEmails/index.js +4 -4
- package/src/saas/internal-api/dbEmails/models/db.emails.model.js +21 -21
- package/src/saas/internal-api/dbEmails/utils/util.js +59 -59
- package/src/saas/internal-api/globalRecord/api/global.record.api.js +76 -76
- package/src/saas/internal-api/globalRecord/api/global.record.service.js +83 -83
- package/src/saas/internal-api/globalRecord/consts.js +20 -20
- package/src/saas/internal-api/globalRecord/index.js +6 -6
- package/src/saas/internal-api/globalRecord/models/global.record.model.js +43 -43
- package/src/saas/internal-api/globalRecord/utils/util.js +148 -148
- package/src/saas/internal-api/homepageCharts/api/charts.api.js +12 -12
- package/src/saas/internal-api/homepageCharts/api/charts.service.js +7 -7
- package/src/saas/internal-api/homepageCharts/index.js +3 -3
- package/src/saas/internal-api/projects/api/core/projects.api.js +39 -39
- package/src/saas/internal-api/projects/api/core/projects.service.js +65 -65
- package/src/saas/internal-api/projects/api/settings/project.settings.api.js +18 -18
- package/src/saas/internal-api/projects/api/settings/project.settings.service.js +17 -17
- package/src/saas/internal-api/projects/consts/defaultProject.js +3 -3
- package/src/saas/internal-api/projects/index.js +24 -24
- package/src/saas/internal-api/projects/models/core/create.project.model.js +41 -41
- package/src/saas/internal-api/projects/models/core/update.project.model.js +47 -47
- package/src/saas/internal-api/projects/models/settings/update.project.settings.model.js +39 -39
- package/src/saas/internal-api/projects/utils/utils.js +82 -82
- package/src/saas/internal-api/recordNotes/api/record.notes.api.js +38 -38
- package/src/saas/internal-api/recordNotes/api/record.notes.service.js +29 -29
- package/src/saas/internal-api/recordNotes/index.js +3 -3
- package/src/saas/internal-api/reports/api/reports.api.js +39 -39
- package/src/saas/internal-api/reports/api/reports.service.js +34 -34
- package/src/saas/internal-api/reports/consts/consts.js +63 -63
- package/src/saas/internal-api/reports/index.js +15 -15
- package/src/saas/internal-api/reports/models/report.model.js +27 -27
- package/src/saas/internal-api/requests/api/requests.api.js +54 -54
- package/src/saas/internal-api/requests/api/requests.service.js +51 -51
- package/src/saas/internal-api/requests/index.js +14 -14
- package/src/saas/internal-api/requests/models/create.request.model.js +22 -22
- package/src/saas/internal-api/requests/models/edit.request.model.js +31 -31
- package/src/saas/internal-api/requests/models/tenant.request.model.js +9 -9
- package/src/saas/internal-api/requests/utils.js +8 -8
- package/src/saas/internal-api/requirements/api/requirements.api.js +45 -45
- package/src/saas/internal-api/requirements/api/requirements.service.js +94 -94
- package/src/saas/internal-api/requirements/consts/attributeTypes.json +5 -5
- package/src/saas/internal-api/requirements/consts/consts.js +6 -6
- package/src/saas/internal-api/requirements/index.js +8 -8
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +17 -17
- package/src/saas/internal-api/requirements/models/policy.model.js +32 -32
- package/src/saas/internal-api/requirements/models/update.requirement.model.js +21 -21
- package/src/saas/internal-api/requirements/utils/utils.js +101 -101
- package/src/saas/internal-api/serviceArea/api/coordinates.api.js +12 -12
- package/src/saas/internal-api/serviceArea/api/coordinates.service.js +7 -7
- package/src/saas/internal-api/serviceArea/index.js +4 -4
- package/src/saas/internal-api/serviceArea/utils/utils.js +8 -8
- package/src/saas/internal-api/tabs/api/tabs.api.js +32 -32
- package/src/saas/internal-api/tabs/api/tabs.service.js +54 -54
- package/src/saas/internal-api/tabs/index.js +3 -3
- package/src/saas/internal-api/tabs/models/tabs.model.js +18 -18
- package/src/saas/internal-api/thread-scheduler/runner.js +39 -13
- package/src/saas/internal-api/users/api/users.api.js +77 -77
- package/src/saas/internal-api/users/api/users.service.js +101 -101
- package/src/saas/internal-api/users/index.js +4 -4
- package/src/saas/internal-api/users/models/users.model.js +31 -31
- package/src/saas/internal-api/users/utils/util.js +14 -14
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.api.js +20 -20
- package/src/saas/internal-api/vendorProfile/api/vendor.profile.service.js +14 -14
- package/src/saas/internal-api/vendorProfile/index.js +3 -3
- package/src/saas/openapi/accounts/accounts.api.js +17 -17
- package/src/saas/openapi/accounts/accounts.service.js +11 -11
- package/src/saas/openapi/projects/projects.api.js +59 -59
- package/src/saas/openapi/projects/projects.service.js +44 -44
- package/src/saas/openapi/requests/index.js +6 -6
- package/src/saas/openapi/requests/models/invite.request.model.js +37 -37
- package/src/saas/openapi/requests/requests.api.js +20 -20
- package/src/saas/openapi/requests/requests.service.js +18 -18
- package/src/saas/openapi/requirements/index.js +6 -6
- package/src/saas/openapi/requirements/models/copy.requirement.model.js +10 -10
- package/src/saas/openapi/requirements/requirements.api.js +12 -12
- package/src/saas/openapi/requirements/requirements.service.js +20 -20
- package/src/saas/openapi/tabs/tabs.api.js +13 -13
- package/src/saas/openapi/tabs/tabs.service.js +7 -7
- package/tests/env.test.js +40 -40
- package/tests/validation.test.js +83 -83
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
class InviteUserModel {
|
|
2
|
-
constructor(email, role, projects = []) {
|
|
3
|
-
this.email = email;
|
|
4
|
-
this.role = role;
|
|
5
|
-
this.projects = projects;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
class SignupUserModel {
|
|
10
|
-
constructor(fullName, role, password, encryptedData) {
|
|
11
|
-
this.fullName = fullName;
|
|
12
|
-
this.role = role;
|
|
13
|
-
this.password = password;
|
|
14
|
-
this.encryptedData = encryptedData;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
class EditUserModel {
|
|
19
|
-
constructor(subUserId, email, role, projects = []) {
|
|
20
|
-
this.subUserId = subUserId;
|
|
21
|
-
this.email = email;
|
|
22
|
-
this.role = role;
|
|
23
|
-
this.projects = projects;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = {
|
|
28
|
-
InviteUserModel,
|
|
29
|
-
SignupUserModel,
|
|
30
|
-
EditUserModel
|
|
31
|
-
};
|
|
1
|
+
class InviteUserModel {
|
|
2
|
+
constructor(email, role, projects = []) {
|
|
3
|
+
this.email = email;
|
|
4
|
+
this.role = role;
|
|
5
|
+
this.projects = projects;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
class SignupUserModel {
|
|
10
|
+
constructor(fullName, role, password, encryptedData) {
|
|
11
|
+
this.fullName = fullName;
|
|
12
|
+
this.role = role;
|
|
13
|
+
this.password = password;
|
|
14
|
+
this.encryptedData = encryptedData;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class EditUserModel {
|
|
19
|
+
constructor(subUserId, email, role, projects = []) {
|
|
20
|
+
this.subUserId = subUserId;
|
|
21
|
+
this.email = email;
|
|
22
|
+
this.role = role;
|
|
23
|
+
this.projects = projects;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
InviteUserModel,
|
|
29
|
+
SignupUserModel,
|
|
30
|
+
EditUserModel
|
|
31
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const { SignupUserModel } = require('../models/users.model');
|
|
2
|
-
const usersApi = require('../api/users.api');
|
|
3
|
-
|
|
4
|
-
const getUserEncryptedData = async (email, role, context) => {
|
|
5
|
-
const response = await usersApi.getUserEncryptedData(email, role, context);
|
|
6
|
-
return response.data;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const getSignupUserModel = async (email, role, fullName, password, context) => {
|
|
10
|
-
const userEncryptedData = await getUserEncryptedData(email, role, context);
|
|
11
|
-
return new SignupUserModel(fullName, role, password, userEncryptedData);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
module.exports = { getSignupUserModel };
|
|
1
|
+
const { SignupUserModel } = require('../models/users.model');
|
|
2
|
+
const usersApi = require('../api/users.api');
|
|
3
|
+
|
|
4
|
+
const getUserEncryptedData = async (email, role, context) => {
|
|
5
|
+
const response = await usersApi.getUserEncryptedData(email, role, context);
|
|
6
|
+
return response.data;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const getSignupUserModel = async (email, role, fullName, password, context) => {
|
|
10
|
+
const userEncryptedData = await getUserEncryptedData(email, role, context);
|
|
11
|
+
return new SignupUserModel(fullName, role, password, userEncryptedData);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
module.exports = { getSignupUserModel };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
-
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
-
|
|
4
|
-
const Endpoints = {
|
|
5
|
-
getVendorProfileJson: (contractorId, requirementId) => `${backendUrl}/saas/vendorProfile/contractor/${contractorId}/requirement/${requirementId}/immediateComplianceReport`,
|
|
6
|
-
shouldShowRecordProfile: recordId => `${backendUrl}/saas/record-profile/record/${recordId}/should-show-record-profile`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const createVendorProfileReport = async (contractorId, requirementId, context) => {
|
|
10
|
-
return requests.getRequestHandler(Endpoints.getVendorProfileJson(contractorId, requirementId), {}, context);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const getShouldShowRecordProfile = async (recordId, context) => {
|
|
14
|
-
return requests.getRequestHandler(Endpoints.shouldShowRecordProfile(recordId), {}, context);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
getShouldShowRecordProfile,
|
|
19
|
-
createVendorProfileReport
|
|
20
|
-
};
|
|
1
|
+
const requests = require('../../../../common/requests/cookieAuth/requests');
|
|
2
|
+
const { backendUrl } = require('../../../../env').getEnv();
|
|
3
|
+
|
|
4
|
+
const Endpoints = {
|
|
5
|
+
getVendorProfileJson: (contractorId, requirementId) => `${backendUrl}/saas/vendorProfile/contractor/${contractorId}/requirement/${requirementId}/immediateComplianceReport`,
|
|
6
|
+
shouldShowRecordProfile: recordId => `${backendUrl}/saas/record-profile/record/${recordId}/should-show-record-profile`
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const createVendorProfileReport = async (contractorId, requirementId, context) => {
|
|
10
|
+
return requests.getRequestHandler(Endpoints.getVendorProfileJson(contractorId, requirementId), {}, context);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const getShouldShowRecordProfile = async (recordId, context) => {
|
|
14
|
+
return requests.getRequestHandler(Endpoints.shouldShowRecordProfile(recordId), {}, context);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
module.exports = {
|
|
18
|
+
getShouldShowRecordProfile,
|
|
19
|
+
createVendorProfileReport
|
|
20
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
const vendorProfileApi = require('./vendor.profile.api');
|
|
2
|
-
|
|
3
|
-
const createVendorProfileReport = async (contractorId, requirementId, context) => {
|
|
4
|
-
return vendorProfileApi.createVendorProfileReport(contractorId, requirementId, context);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const getShouldShowRecordProfile = async (recordId, context) => {
|
|
8
|
-
return vendorProfileApi.getShouldShowRecordProfile(recordId, context);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
module.exports = {
|
|
12
|
-
getShouldShowRecordProfile,
|
|
13
|
-
createVendorProfileReport
|
|
14
|
-
};
|
|
1
|
+
const vendorProfileApi = require('./vendor.profile.api');
|
|
2
|
+
|
|
3
|
+
const createVendorProfileReport = async (contractorId, requirementId, context) => {
|
|
4
|
+
return vendorProfileApi.createVendorProfileReport(contractorId, requirementId, context);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const getShouldShowRecordProfile = async (recordId, context) => {
|
|
8
|
+
return vendorProfileApi.getShouldShowRecordProfile(recordId, context);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
module.exports = {
|
|
12
|
+
getShouldShowRecordProfile,
|
|
13
|
+
createVendorProfileReport
|
|
14
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const services = require('./api/vendor.profile.service');
|
|
2
|
-
|
|
3
|
-
module.exports = { services };
|
|
1
|
+
const services = require('./api/vendor.profile.service');
|
|
2
|
+
|
|
3
|
+
module.exports = { services };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
const requests = require('../../../common/requests/apiKeyAuth/requests');
|
|
2
|
-
const { openapiUrl } = require('../../../env').getEnv();
|
|
3
|
-
|
|
4
|
-
const Endpoints = {
|
|
5
|
-
getAccountList: `${openapiUrl}/accounts`,
|
|
6
|
-
dynamicApiKey: accountId => `${openapiUrl}/accounts/${accountId}/dynamic-api-key`
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const getAccountList = async apiKey => {
|
|
10
|
-
return requests.getRequestHandler(Endpoints.getAccountList, apiKey).then(res => res.data);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const generateDynamicApiKey = async (accountId, masterApiKey) => {
|
|
14
|
-
return requests.getRequestHandler(Endpoints.dynamicApiKey(accountId), masterApiKey).then(res => res.data);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
module.exports = { getAccountList, generateDynamicApiKey };
|
|
1
|
+
const requests = require('../../../common/requests/apiKeyAuth/requests');
|
|
2
|
+
const { openapiUrl } = require('../../../env').getEnv();
|
|
3
|
+
|
|
4
|
+
const Endpoints = {
|
|
5
|
+
getAccountList: `${openapiUrl}/accounts`,
|
|
6
|
+
dynamicApiKey: accountId => `${openapiUrl}/accounts/${accountId}/dynamic-api-key`
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const getAccountList = async apiKey => {
|
|
10
|
+
return requests.getRequestHandler(Endpoints.getAccountList, apiKey).then(res => res.data);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const generateDynamicApiKey = async (accountId, masterApiKey) => {
|
|
14
|
+
return requests.getRequestHandler(Endpoints.dynamicApiKey(accountId), masterApiKey).then(res => res.data);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
module.exports = { getAccountList, generateDynamicApiKey };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const accountsApi = require('./accounts.api');
|
|
2
|
-
|
|
3
|
-
const getAccountList = async apiKey => {
|
|
4
|
-
return accountsApi.getAccountList(apiKey);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const generateDynamicApiKey = async (accountId, masterApiKey) => {
|
|
8
|
-
return accountsApi.generateDynamicApiKey(accountId, masterApiKey);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
module.exports = { getAccountList, generateDynamicApiKey };
|
|
1
|
+
const accountsApi = require('./accounts.api');
|
|
2
|
+
|
|
3
|
+
const getAccountList = async apiKey => {
|
|
4
|
+
return accountsApi.getAccountList(apiKey);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const generateDynamicApiKey = async (accountId, masterApiKey) => {
|
|
8
|
+
return accountsApi.generateDynamicApiKey(accountId, masterApiKey);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
module.exports = { getAccountList, generateDynamicApiKey };
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
const services = require('./requests.service');
|
|
2
|
-
|
|
3
|
-
const InviteRequestModel = require('./models/invite.request.model');
|
|
4
|
-
const models = { InviteRequestModel };
|
|
5
|
-
|
|
6
|
-
module.exports = { ... services, models };
|
|
1
|
+
const services = require('./requests.service');
|
|
2
|
+
|
|
3
|
+
const InviteRequestModel = require('./models/invite.request.model');
|
|
4
|
+
const models = { InviteRequestModel };
|
|
5
|
+
|
|
6
|
+
module.exports = { ... services, models };
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
class InviteRequestModel {
|
|
2
|
-
constructor(
|
|
3
|
-
email,
|
|
4
|
-
company,
|
|
5
|
-
{
|
|
6
|
-
requirementId,
|
|
7
|
-
firstName,
|
|
8
|
-
lastName,
|
|
9
|
-
dba,
|
|
10
|
-
address,
|
|
11
|
-
city,
|
|
12
|
-
state,
|
|
13
|
-
zipCode,
|
|
14
|
-
phoneNumber,
|
|
15
|
-
startDate,
|
|
16
|
-
endDate
|
|
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,
|
|
7
|
+
firstName,
|
|
8
|
+
lastName,
|
|
9
|
+
dba,
|
|
10
|
+
address,
|
|
11
|
+
city,
|
|
12
|
+
state,
|
|
13
|
+
zipCode,
|
|
14
|
+
phoneNumber,
|
|
15
|
+
startDate,
|
|
16
|
+
endDate
|
|
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,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
|
-
getAllRequests: `${openapiUrl}/${contractorUrl}/all`,
|
|
9
|
-
inviteRequest: tabId => `${openapiUrl}/tabs/${tabId}/${contractorUrl}`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const getAllRequests = async (apiKey, params) => {
|
|
13
|
-
return requests.getRequestHandler(Endpoints.getAllRequests, apiKey, params).then(res => res.data);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const inviteRequest = async (apiKey, tabId, params) => {
|
|
17
|
-
return requests.postRequestHandler(Endpoints.inviteRequest(tabId), apiKey, params).then(res => res.data);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
module.exports = { getAllRequests, inviteRequest };
|
|
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
|
+
getAllRequests: `${openapiUrl}/${contractorUrl}/all`,
|
|
9
|
+
inviteRequest: tabId => `${openapiUrl}/tabs/${tabId}/${contractorUrl}`
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const getAllRequests = async (apiKey, params) => {
|
|
13
|
+
return requests.getRequestHandler(Endpoints.getAllRequests, apiKey, params).then(res => res.data);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const inviteRequest = async (apiKey, tabId, params) => {
|
|
17
|
+
return requests.postRequestHandler(Endpoints.inviteRequest(tabId), apiKey, params).then(res => res.data);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
module.exports = { getAllRequests, inviteRequest };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const requestsApi = require('./requests.api');
|
|
2
|
-
const { InviteRequestModel } = require('./models/invite.request.model');
|
|
3
|
-
const { validateType } = require('../../../common/validations/typeValidations');
|
|
4
|
-
|
|
5
|
-
const getAllAccountRequests = async (apiKey, { projectId, type, activationStatuses } = {}) => {
|
|
6
|
-
if (activationStatuses) {
|
|
7
|
-
activationStatuses = activationStatuses.reduce((f, s) => `${f},${s}`);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return requestsApi.getAllRequests(apiKey, { propertyId: projectId, type, activationStatuses });
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const inviteRequest = async (apiKey, tabId, inviteRequestModel = {}) => {
|
|
14
|
-
validateType(inviteRequestModel, InviteRequestModel);
|
|
15
|
-
return requestsApi.inviteRequest(apiKey, tabId, inviteRequestModel);
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
module.exports = { getAllAccountRequests, inviteRequest };
|
|
1
|
+
const requestsApi = require('./requests.api');
|
|
2
|
+
const { InviteRequestModel } = require('./models/invite.request.model');
|
|
3
|
+
const { validateType } = require('../../../common/validations/typeValidations');
|
|
4
|
+
|
|
5
|
+
const getAllAccountRequests = async (apiKey, { projectId, type, activationStatuses } = {}) => {
|
|
6
|
+
if (activationStatuses) {
|
|
7
|
+
activationStatuses = activationStatuses.reduce((f, s) => `${f},${s}`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return requestsApi.getAllRequests(apiKey, { propertyId: projectId, type, activationStatuses });
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const inviteRequest = async (apiKey, tabId, inviteRequestModel = {}) => {
|
|
14
|
+
validateType(inviteRequestModel, InviteRequestModel);
|
|
15
|
+
return requestsApi.inviteRequest(apiKey, tabId, inviteRequestModel);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
module.exports = { getAllAccountRequests, inviteRequest };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const services = require('./requirements.service');
|
|
2
|
-
|
|
3
|
-
const CopyRequirementModel = require('./models/copy.requirement.model');
|
|
4
|
-
const models = { CopyRequirementModel };
|
|
5
|
-
|
|
6
|
-
module.exports = { ... services, models };
|
|
1
|
+
const services = require('./requirements.service');
|
|
2
|
+
|
|
3
|
+
const CopyRequirementModel = require('./models/copy.requirement.model');
|
|
4
|
+
const models = { CopyRequirementModel };
|
|
5
|
+
|
|
6
|
+
module.exports = { ... services, models };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function CopyRequirementModel(sourceRequirementId, destinationTabId = null,
|
|
2
|
-
newRequirementName = null, certificateHolder = null, additionalInsured = null) {
|
|
3
|
-
this.sourceRequirementId = sourceRequirementId;
|
|
4
|
-
this.destinationTabId = destinationTabId;
|
|
5
|
-
this.newRequirementName = newRequirementName;
|
|
6
|
-
this.certificateHolder = certificateHolder;
|
|
7
|
-
this.additionalInsured = additionalInsured;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
module.exports = CopyRequirementModel;
|
|
1
|
+
function CopyRequirementModel(sourceRequirementId, destinationTabId = null,
|
|
2
|
+
newRequirementName = null, certificateHolder = null, additionalInsured = null) {
|
|
3
|
+
this.sourceRequirementId = sourceRequirementId;
|
|
4
|
+
this.destinationTabId = destinationTabId;
|
|
5
|
+
this.newRequirementName = newRequirementName;
|
|
6
|
+
this.certificateHolder = certificateHolder;
|
|
7
|
+
this.additionalInsured = additionalInsured;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
module.exports = CopyRequirementModel;
|