@getjones/test-infra 3.0.2 → 3.0.3
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/auth/auth.js +40 -40
- package/src/common/commonFlows/index.js +4 -4
- package/src/common/commonFlows/records/records.js +146 -123
- package/src/common/consts/accountSettings.js +10 -0
- package/src/common/consts/activationStatuses.js +6 -6
- package/src/common/consts/constantsForRecordsSortingAndFilters.js +40 -40
- package/src/common/consts/dashboardCharts.js +18 -18
- package/src/common/consts/ocrStatuses.js +6 -0
- package/src/common/consts/projectSettings.js +6 -6
- package/src/common/consts/recordTypes.js +5 -5
- package/src/common/consts/s3FileTypes.js +12 -12
- package/src/common/consts/userTypes.js +8 -8
- package/src/common/errorCodes.js +3 -3
- package/src/common/httpResponseStatusCodes.json +11 -11
- package/src/common/requests/apiKeyAuth/requests.js +44 -44
- package/src/common/requests/cookieAuth/requests.js +40 -40
- package/src/common/requests/internalAuth/requests.js +48 -48
- package/src/common/requests/requestHandlers.js +78 -78
- package/src/common/utils/complianceUtil.js +83 -83
- package/src/common/utils/configsUtil.js +22 -22
- package/src/common/utils/dataTypeUtils.js +41 -41
- package/src/common/utils/numberUtils.js +22 -22
- package/src/common/utils/objectUtils.js +7 -7
- package/src/common/utils/timeUtils.js +177 -177
- package/src/common/validations/errorValidation.js +16 -16
- package/src/common/validations/typeValidations.js +36 -36
- package/src/defaults/configs/auditConfigs.js +91 -91
- package/src/defaults/configs/coverage.js +227 -227
- package/src/defaults/configs/polices.js +67 -64
- package/src/defaults/configs/requirement.js +32 -32
- package/src/defaults/index.js +6 -6
- package/src/env.js +57 -57
- package/src/factory/globalRecord/globalRecord.js +70 -70
- package/src/factory/index.js +8 -8
- package/src/factory/records/records.js +169 -169
- package/src/factory/users/users.js +77 -77
- package/src/index.js +91 -91
- package/src/saas/internal-api/accounts/api/core/accounts.core.api.js +35 -35
- package/src/saas/internal-api/accounts/api/core/accounts.core.service.js +93 -93
- package/src/saas/internal-api/accounts/api/emailCustomization/accounts.email.customizations.api.js +29 -29
- package/src/saas/internal-api/accounts/api/emailCustomization/accounts.email.customizations.service.js +61 -61
- 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 +41 -41
- package/src/saas/internal-api/accounts/consts/consts.js +6 -6
- package/src/saas/internal-api/accounts/index.js +22 -22
- 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 +38 -38
- package/src/saas/internal-api/accounts/utils/utils.js +58 -58
- package/src/saas/internal-api/agreement/api/agreement.api.js +35 -35
- package/src/saas/internal-api/agreement/api/agreement.service.js +81 -81
- package/src/saas/internal-api/agreement/consts/consts.js +8 -8
- package/src/saas/internal-api/agreement/index.js +11 -11
- package/src/saas/internal-api/agreement/models/create.agreement.model.js +12 -12
- package/src/saas/internal-api/auditCustomerRules/api/customer.rules.api.js +43 -43
- package/src/saas/internal-api/auditCustomerRules/api/customer.rules.service.js +105 -105
- package/src/saas/internal-api/auditCustomerRules/consts/customer.rule.js +11 -11
- package/src/saas/internal-api/auditCustomerRules/index.js +6 -6
- package/src/saas/internal-api/auditCustomerRules/models/customer.rule.model.js +46 -46
- package/src/saas/internal-api/auditCustomerRules/utils/customer.rule.util.js +19 -19
- package/src/saas/internal-api/auditNotes/api/audit.notes.api.js +40 -40
- package/src/saas/internal-api/auditNotes/api/audit.notes.service.js +115 -115
- package/src/saas/internal-api/auditNotes/index.js +4 -4
- package/src/saas/internal-api/auditNotes/models/audit.note.model.js +30 -30
- package/src/saas/internal-api/auth/api/auth.api.js +27 -27
- package/src/saas/internal-api/auth/api/auth.service.js +90 -90
- package/src/saas/internal-api/auth/index.js +3 -3
- package/src/saas/internal-api/coi/api/coi.api.js +40 -40
- package/src/saas/internal-api/coi/api/coi.service.js +26 -26
- package/src/saas/internal-api/coi/consts/hashes.js +4 -4
- package/src/saas/internal-api/coi/consts/uploaderTypes.js +5 -5
- package/src/saas/internal-api/coi/index.js +14 -14
- package/src/saas/internal-api/coi/models/submit.coi.model.js +19 -9
- package/src/saas/internal-api/coi/utils/utils.js +70 -48
- package/src/saas/internal-api/compliance/api/audit/audit.api.js +100 -100
- package/src/saas/internal-api/compliance/api/audit/audit.service.js +242 -242
- 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 +48 -48
- package/src/saas/internal-api/compliance/api/overrideGap/override.gap.api.js +33 -33
- package/src/saas/internal-api/compliance/api/overrideGap/override.gap.service.js +141 -141
- package/src/saas/internal-api/compliance/consts/audit.js +103 -103
- package/src/saas/internal-api/compliance/index.js +33 -33
- package/src/saas/internal-api/compliance/models/audit/audit.model.js +94 -94
- package/src/saas/internal-api/compliance/models/waive/waive.model.js +49 -49
- package/src/saas/internal-api/compliance/utils/auditUtil.js +222 -222
- package/src/saas/internal-api/compliance/utils/coverageUtil.js +40 -40
- package/src/saas/internal-api/contractors/api/contractors.api.js +203 -185
- package/src/saas/internal-api/contractors/api/contractors.service.js +318 -259
- package/src/saas/internal-api/contractors/consts/consts.js +6 -6
- package/src/saas/internal-api/contractors/index.js +8 -8
- package/src/saas/internal-api/contractors/models/assign.requirement.model.js +10 -10
- package/src/saas/internal-api/contractors/models/edit.contractor.model.js +62 -62
- package/src/saas/internal-api/contractors/models/link.request.model.js +10 -10
- package/src/saas/internal-api/contractors/models/subscription.contractor.model.js +13 -0
- package/src/saas/internal-api/contractors/models/verification.contractor.model.js +27 -27
- package/src/saas/internal-api/contractors/utils.js +25 -25
- package/src/saas/internal-api/dashboard/api/recordList.api.js +38 -38
- package/src/saas/internal-api/dashboard/api/recordList.service.js +60 -60
- package/src/saas/internal-api/dashboard/index.js +5 -5
- package/src/saas/internal-api/dashboard/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 +156 -147
- package/src/saas/internal-api/dbEmails/consts/consts.js +54 -54
- package/src/saas/internal-api/dbEmails/index.js +6 -6
- package/src/saas/internal-api/dbEmails/models/db.emails.model.js +22 -22
- package/src/saas/internal-api/dbEmails/utils/util.js +87 -82
- package/src/saas/internal-api/emailCustomization/api/email.customization.api.js +26 -26
- package/src/saas/internal-api/emailCustomization/api/email.customization.service.js +50 -50
- package/src/saas/internal-api/emailCustomization/index.js +3 -3
- package/src/saas/internal-api/globalRecord/api/global.record.api.js +95 -95
- package/src/saas/internal-api/globalRecord/api/global.record.service.js +105 -105
- 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 +60 -60
- package/src/saas/internal-api/globalRecord/utils/util.js +161 -161
- 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 +35 -35
- 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 +41 -41
- package/src/saas/internal-api/projects/utils/utils.js +156 -156
- package/src/saas/internal-api/recordNotes/api/record.notes.api.js +38 -38
- package/src/saas/internal-api/recordNotes/api/record.notes.service.js +47 -47
- package/src/saas/internal-api/recordNotes/api/record.notes.utils.js +12 -12
- 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 +65 -65
- 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 +120 -120
- package/src/saas/internal-api/requests/api/requests.service.js +272 -272
- package/src/saas/internal-api/requests/index.js +20 -20
- package/src/saas/internal-api/requests/models/create.request.model.js +33 -33
- package/src/saas/internal-api/requests/models/draft.request.criteria.model.js +18 -18
- package/src/saas/internal-api/requests/models/draft.request.report.model.js +14 -14
- package/src/saas/internal-api/requests/models/edit.request.model.js +31 -31
- package/src/saas/internal-api/requests/models/requestListCriteriaModel.js +17 -17
- 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/requestsTable/api/requests.table.api.js +20 -20
- package/src/saas/internal-api/requestsTable/api/requests.table.service.js +14 -14
- package/src/saas/internal-api/requestsTable/index.js +3 -3
- package/src/saas/internal-api/requirements/api/requirements.api.js +51 -51
- package/src/saas/internal-api/requirements/api/requirements.service.js +153 -153
- package/src/saas/internal-api/requirements/consts/attributeTypes.json +6 -6
- package/src/saas/internal-api/requirements/consts/consts.js +6 -6
- package/src/saas/internal-api/requirements/index.js +10 -10
- package/src/saas/internal-api/requirements/models/create.requirement.model.js +17 -17
- package/src/saas/internal-api/requirements/models/policy.model.js +33 -33
- package/src/saas/internal-api/requirements/models/update.requirement.model.js +19 -19
- package/src/saas/internal-api/requirements/utils/utils.js +116 -116
- 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 +19 -19
- package/src/saas/internal-api/thread-scheduler/runner.js +39 -39
- package/src/saas/internal-api/uploadFiles/api/upload.file.api.js +31 -31
- package/src/saas/internal-api/uploadFiles/api/upload.file.service.js +42 -42
- package/src/saas/internal-api/uploadFiles/consts.js +12 -12
- package/src/saas/internal-api/uploadFiles/index.js +3 -3
- package/src/saas/internal-api/users/api/tenantApp/tenant.app.api.js +32 -32
- package/src/saas/internal-api/users/api/tenantApp/tenant.app.service.js +97 -97
- package/src/saas/internal-api/users/api/users.api.js +115 -115
- package/src/saas/internal-api/users/api/users.service.js +203 -203
- package/src/saas/internal-api/users/index.js +16 -16
- package/src/saas/internal-api/users/models/create.inner.system.user.model.js +18 -18
- package/src/saas/internal-api/users/models/notification.settings.model.js +12 -12
- package/src/saas/internal-api/users/models/tenent.user.model.js +11 -11
- package/src/saas/internal-api/users/models/users.model.js +41 -41
- package/src/saas/internal-api/users/utils/util.js +39 -39
- 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/coi/coi.api.js +20 -20
- package/src/saas/openapi/coi/coi.service.js +13 -13
- package/src/saas/openapi/projects/projects.api.js +83 -83
- package/src/saas/openapi/projects/projects.service.js +64 -64
- package/src/saas/openapi/requests/index.js +7 -7
- package/src/saas/openapi/requests/models/invite.request.model.js +37 -37
- package/src/saas/openapi/requests/models/update.request.model.js +35 -35
- package/src/saas/openapi/requests/requests.api.js +82 -82
- package/src/saas/openapi/requests/requests.service.js +70 -70
- 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 +32 -32
- package/src/saas/openapi/requirements/requirements.service.js +37 -37
- package/src/saas/openapi/tabs/index.js +6 -6
- package/src/saas/openapi/tabs/models/create.tab.model.js +6 -6
- package/src/saas/openapi/tabs/tabs.api.js +27 -27
- package/src/saas/openapi/tabs/tabs.service.js +19 -19
- package/src/saas/openapi/users/user.model.js +10 -10
- package/src/saas/openapi/users/users.api.js +33 -33
- package/src/saas/openapi/users/users.service.js +41 -41
- package/tests/env.test.js +40 -40
- package/tests/validation.test.js +83 -83
- package/src/resources/virusFile.pdf +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const userModels = require('./models/users.model');
|
|
2
|
-
const { NotificationSettingsModel } = require('./models/notification.settings.model');
|
|
3
|
-
const CreateInnerSystemUserModel = require('./models/create.inner.system.user.model');
|
|
4
|
-
|
|
5
|
-
const services = require('./api/users.service');
|
|
6
|
-
const util = require('./utils/util');
|
|
7
|
-
|
|
8
|
-
const tenantUserService = require('./api/tenantApp/tenant.app.service');
|
|
9
|
-
|
|
10
|
-
const tenants = {
|
|
11
|
-
services: tenantUserService
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const models = { ... userModels, NotificationSettingsModel, CreateInnerSystemUserModel };
|
|
15
|
-
|
|
16
|
-
module.exports = { services, models, util, tenants };
|
|
1
|
+
const userModels = require('./models/users.model');
|
|
2
|
+
const { NotificationSettingsModel } = require('./models/notification.settings.model');
|
|
3
|
+
const CreateInnerSystemUserModel = require('./models/create.inner.system.user.model');
|
|
4
|
+
|
|
5
|
+
const services = require('./api/users.service');
|
|
6
|
+
const util = require('./utils/util');
|
|
7
|
+
|
|
8
|
+
const tenantUserService = require('./api/tenantApp/tenant.app.service');
|
|
9
|
+
|
|
10
|
+
const tenants = {
|
|
11
|
+
services: tenantUserService
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const models = { ... userModels, NotificationSettingsModel, CreateInnerSystemUserModel };
|
|
15
|
+
|
|
16
|
+
module.exports = { services, models, util, tenants };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const env = require('../../../../env');
|
|
2
|
-
const { credentials } = env.getEnv();
|
|
3
|
-
|
|
4
|
-
class CreateInnerSystemUserModel {
|
|
5
|
-
constructor({
|
|
6
|
-
fullName = '',
|
|
7
|
-
email = '',
|
|
8
|
-
password = credentials.strongPassword,
|
|
9
|
-
userRole
|
|
10
|
-
}) {
|
|
11
|
-
this.fullName = fullName;
|
|
12
|
-
this.email = email;
|
|
13
|
-
this.password = password;
|
|
14
|
-
this.role = userRole;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
module.exports = CreateInnerSystemUserModel;
|
|
1
|
+
const env = require('../../../../env');
|
|
2
|
+
const { credentials } = env.getEnv();
|
|
3
|
+
|
|
4
|
+
class CreateInnerSystemUserModel {
|
|
5
|
+
constructor({
|
|
6
|
+
fullName = '',
|
|
7
|
+
email = '',
|
|
8
|
+
password = credentials.strongPassword,
|
|
9
|
+
userRole
|
|
10
|
+
}) {
|
|
11
|
+
this.fullName = fullName;
|
|
12
|
+
this.email = email;
|
|
13
|
+
this.password = password;
|
|
14
|
+
this.role = userRole;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = CreateInnerSystemUserModel;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
class NotificationSettingsModel {
|
|
2
|
-
constructor({ aboutToExpire = true, auditCompliant = true, auditNotCompliant = true, missingCoi = true } = {}) {
|
|
3
|
-
this.aboutToExpire = aboutToExpire;
|
|
4
|
-
this.auditCompliant = auditCompliant;
|
|
5
|
-
this.auditNotCompliant = auditNotCompliant;
|
|
6
|
-
this.missingCoi = missingCoi;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
NotificationSettingsModel
|
|
12
|
-
};
|
|
1
|
+
class NotificationSettingsModel {
|
|
2
|
+
constructor({ aboutToExpire = true, auditCompliant = true, auditNotCompliant = true, missingCoi = true } = {}) {
|
|
3
|
+
this.aboutToExpire = aboutToExpire;
|
|
4
|
+
this.auditCompliant = auditCompliant;
|
|
5
|
+
this.auditNotCompliant = auditNotCompliant;
|
|
6
|
+
this.missingCoi = missingCoi;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
NotificationSettingsModel
|
|
12
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
class InviteTenantUserModel {
|
|
2
|
-
constructor(email, companyName, requestId) {
|
|
3
|
-
this.email = email;
|
|
4
|
-
this.companyName = companyName;
|
|
5
|
-
this.id = requestId;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
InviteTenantUserModel
|
|
11
|
-
};
|
|
1
|
+
class InviteTenantUserModel {
|
|
2
|
+
constructor(email, companyName, requestId) {
|
|
3
|
+
this.email = email;
|
|
4
|
+
this.companyName = companyName;
|
|
5
|
+
this.id = requestId;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
InviteTenantUserModel
|
|
11
|
+
};
|
|
@@ -1,41 +1,41 @@
|
|
|
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
|
-
class EditUserProfileModel {
|
|
28
|
-
constructor(subUserId, email, role, fullName) {
|
|
29
|
-
this.subUserId = subUserId;
|
|
30
|
-
this.email = email;
|
|
31
|
-
this.role = role;
|
|
32
|
-
this.fullName = fullName;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = {
|
|
37
|
-
InviteUserModel,
|
|
38
|
-
SignupUserModel,
|
|
39
|
-
EditUserModel,
|
|
40
|
-
EditUserProfileModel
|
|
41
|
-
};
|
|
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
|
+
class EditUserProfileModel {
|
|
28
|
+
constructor(subUserId, email, role, fullName) {
|
|
29
|
+
this.subUserId = subUserId;
|
|
30
|
+
this.email = email;
|
|
31
|
+
this.role = role;
|
|
32
|
+
this.fullName = fullName;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = {
|
|
37
|
+
InviteUserModel,
|
|
38
|
+
SignupUserModel,
|
|
39
|
+
EditUserModel,
|
|
40
|
+
EditUserProfileModel
|
|
41
|
+
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
const { SignupUserModel } = require('../models/users.model');
|
|
2
|
-
const { NotificationSettingsModel } = require('../models/notification.settings.model');
|
|
3
|
-
const usersApi = require('../api/users.api');
|
|
4
|
-
const httpResponseStatusCodes = require('../../../../common/httpResponseStatusCodes.json');
|
|
5
|
-
const objectUtils = require('../../../../common/utils/configsUtil');
|
|
6
|
-
|
|
7
|
-
const attributesConvertor = {
|
|
8
|
-
'COI is not compliant.': 'auditNotCompliant',
|
|
9
|
-
'Policy is about to expire.': 'aboutToExpire',
|
|
10
|
-
'COI is compliant.': 'auditCompliant',
|
|
11
|
-
'Unresponsive contact.': 'missingCoi'
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const getUserEncryptedData = async (email, role, context) => {
|
|
15
|
-
const response = await usersApi.getUserEncryptedData(email, role, context);
|
|
16
|
-
|
|
17
|
-
if (response.status !== httpResponseStatusCodes.OK) {
|
|
18
|
-
throw new Error(`Failed to retrieve user: ${email} encrypted data\n${response}`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return response.data;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getSignupUserModel = async (email, role, fullName, password, context) => {
|
|
25
|
-
const userEncryptedData = await getUserEncryptedData(email, role, context);
|
|
26
|
-
return new SignupUserModel(fullName, role, password, userEncryptedData);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const getSettingsModel = settings => {
|
|
30
|
-
const isUIConfig = objectUtils.isUIConfig(settings, attributesConvertor);
|
|
31
|
-
|
|
32
|
-
const settingConfig = isUIConfig ?
|
|
33
|
-
objectUtils.objectConvertor(settings, attributesConvertor) :
|
|
34
|
-
settings;
|
|
35
|
-
|
|
36
|
-
return new NotificationSettingsModel(settingConfig);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
module.exports = { getSignupUserModel, getSettingsModel };
|
|
1
|
+
const { SignupUserModel } = require('../models/users.model');
|
|
2
|
+
const { NotificationSettingsModel } = require('../models/notification.settings.model');
|
|
3
|
+
const usersApi = require('../api/users.api');
|
|
4
|
+
const httpResponseStatusCodes = require('../../../../common/httpResponseStatusCodes.json');
|
|
5
|
+
const objectUtils = require('../../../../common/utils/configsUtil');
|
|
6
|
+
|
|
7
|
+
const attributesConvertor = {
|
|
8
|
+
'COI is not compliant.': 'auditNotCompliant',
|
|
9
|
+
'Policy is about to expire.': 'aboutToExpire',
|
|
10
|
+
'COI is compliant.': 'auditCompliant',
|
|
11
|
+
'Unresponsive contact.': 'missingCoi'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const getUserEncryptedData = async (email, role, context) => {
|
|
15
|
+
const response = await usersApi.getUserEncryptedData(email, role, context);
|
|
16
|
+
|
|
17
|
+
if (response.status !== httpResponseStatusCodes.OK) {
|
|
18
|
+
throw new Error(`Failed to retrieve user: ${email} encrypted data\n${response}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return response.data;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getSignupUserModel = async (email, role, fullName, password, context) => {
|
|
25
|
+
const userEncryptedData = await getUserEncryptedData(email, role, context);
|
|
26
|
+
return new SignupUserModel(fullName, role, password, userEncryptedData);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const getSettingsModel = settings => {
|
|
30
|
+
const isUIConfig = objectUtils.isUIConfig(settings, attributesConvertor);
|
|
31
|
+
|
|
32
|
+
const settingConfig = isUIConfig ?
|
|
33
|
+
objectUtils.objectConvertor(settings, attributesConvertor) :
|
|
34
|
+
settings;
|
|
35
|
+
|
|
36
|
+
return new NotificationSettingsModel(settingConfig);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
module.exports = { getSignupUserModel, getSettingsModel };
|
|
@@ -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,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,83 +1,83 @@
|
|
|
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
|
-
archiveProject: projectId => `${openapiUrl}/properties/${projectId}/archive`,
|
|
14
|
-
restoreProject: projectId => `${openapiUrl}/properties/${projectId}/restore`,
|
|
15
|
-
addUserToProject: (projectId, userId) => `${openapiUrl}/properties/${projectId}/users/${userId}`,
|
|
16
|
-
removeUserFromProject: (projectId, userId) => `${openapiUrl}/properties/${projectId}/users/${userId}`
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const getProjectsByName = (apiKey, params) => {
|
|
20
|
-
return requests.getRequestHandler(Endpoints.getProjectsByName, apiKey, params).then(res => res.data);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const getAllProjects = (apiKey, params) => {
|
|
24
|
-
return requests.getRequestHandler(Endpoints.getAllProjects, apiKey, params).then(res => res);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const getModifiedProjects = (apiKey, params) => {
|
|
28
|
-
return requests.getRequestHandler(Endpoints.getModifiedProjects, apiKey, params).then(res => res.data);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const createProject = (apiKey, project) => {
|
|
32
|
-
return requests.postRequestHandler(Endpoints.createProject, apiKey, project).then(res => res.data);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const updateProject = (apiKey, projectId, projectData) => {
|
|
36
|
-
return requests.patchRequestHandler(Endpoints.updateProject(projectId), apiKey, projectData).then(res => res);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const updateProjectSettings = (apiKey, projectId, projectSettings) => {
|
|
40
|
-
return requests.patchRequestHandler(Endpoints.updateProjectSettings(projectId),
|
|
41
|
-
apiKey,
|
|
42
|
-
projectSettings).then(res => res);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const getProjectSettings = (apiKey, projectId) => {
|
|
46
|
-
return requests.getRequestHandler(Endpoints.getProjectSettings(projectId),
|
|
47
|
-
apiKey).then(res => res.data);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const getProjectServiceArea = (apiKey, city, state) => {
|
|
51
|
-
return requests.getRequestHandler(Endpoints.getProjectServiceArea(city, state), apiKey);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const archiveProject = (apiKey, projectId) => {
|
|
55
|
-
return requests.postRequestHandler(Endpoints.archiveProject(projectId), apiKey);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const restoreProject = (apiKey, projectId) => {
|
|
59
|
-
return requests.postRequestHandler(Endpoints.restoreProject(projectId), apiKey);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const addUserToProject = (apiKey, projectId, userId) => {
|
|
63
|
-
return requests.patchRequestHandler(Endpoints.addUserToProject(projectId, userId), apiKey);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const removeUserFromProject = (apiKey, projectId, userId) => {
|
|
67
|
-
return requests.deleteRequestHandler(Endpoints.removeUserFromProject(projectId, userId), apiKey);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
module.exports = {
|
|
71
|
-
getProjectsByName,
|
|
72
|
-
getAllProjects,
|
|
73
|
-
getModifiedProjects,
|
|
74
|
-
createProject,
|
|
75
|
-
updateProject,
|
|
76
|
-
updateProjectSettings,
|
|
77
|
-
getProjectSettings,
|
|
78
|
-
getProjectServiceArea,
|
|
79
|
-
archiveProject,
|
|
80
|
-
restoreProject,
|
|
81
|
-
addUserToProject,
|
|
82
|
-
removeUserFromProject
|
|
83
|
-
};
|
|
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
|
+
archiveProject: projectId => `${openapiUrl}/properties/${projectId}/archive`,
|
|
14
|
+
restoreProject: projectId => `${openapiUrl}/properties/${projectId}/restore`,
|
|
15
|
+
addUserToProject: (projectId, userId) => `${openapiUrl}/properties/${projectId}/users/${userId}`,
|
|
16
|
+
removeUserFromProject: (projectId, userId) => `${openapiUrl}/properties/${projectId}/users/${userId}`
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const getProjectsByName = (apiKey, params) => {
|
|
20
|
+
return requests.getRequestHandler(Endpoints.getProjectsByName, apiKey, params).then(res => res.data);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const getAllProjects = (apiKey, params) => {
|
|
24
|
+
return requests.getRequestHandler(Endpoints.getAllProjects, apiKey, params).then(res => res);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const getModifiedProjects = (apiKey, params) => {
|
|
28
|
+
return requests.getRequestHandler(Endpoints.getModifiedProjects, apiKey, params).then(res => res.data);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const createProject = (apiKey, project) => {
|
|
32
|
+
return requests.postRequestHandler(Endpoints.createProject, apiKey, project).then(res => res.data);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const updateProject = (apiKey, projectId, projectData) => {
|
|
36
|
+
return requests.patchRequestHandler(Endpoints.updateProject(projectId), apiKey, projectData).then(res => res);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const updateProjectSettings = (apiKey, projectId, projectSettings) => {
|
|
40
|
+
return requests.patchRequestHandler(Endpoints.updateProjectSettings(projectId),
|
|
41
|
+
apiKey,
|
|
42
|
+
projectSettings).then(res => res);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const getProjectSettings = (apiKey, projectId) => {
|
|
46
|
+
return requests.getRequestHandler(Endpoints.getProjectSettings(projectId),
|
|
47
|
+
apiKey).then(res => res.data);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const getProjectServiceArea = (apiKey, city, state) => {
|
|
51
|
+
return requests.getRequestHandler(Endpoints.getProjectServiceArea(city, state), apiKey);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const archiveProject = (apiKey, projectId) => {
|
|
55
|
+
return requests.postRequestHandler(Endpoints.archiveProject(projectId), apiKey);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const restoreProject = (apiKey, projectId) => {
|
|
59
|
+
return requests.postRequestHandler(Endpoints.restoreProject(projectId), apiKey);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const addUserToProject = (apiKey, projectId, userId) => {
|
|
63
|
+
return requests.patchRequestHandler(Endpoints.addUserToProject(projectId, userId), apiKey);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const removeUserFromProject = (apiKey, projectId, userId) => {
|
|
67
|
+
return requests.deleteRequestHandler(Endpoints.removeUserFromProject(projectId, userId), apiKey);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
module.exports = {
|
|
71
|
+
getProjectsByName,
|
|
72
|
+
getAllProjects,
|
|
73
|
+
getModifiedProjects,
|
|
74
|
+
createProject,
|
|
75
|
+
updateProject,
|
|
76
|
+
updateProjectSettings,
|
|
77
|
+
getProjectSettings,
|
|
78
|
+
getProjectServiceArea,
|
|
79
|
+
archiveProject,
|
|
80
|
+
restoreProject,
|
|
81
|
+
addUserToProject,
|
|
82
|
+
removeUserFromProject
|
|
83
|
+
};
|