@getjones/test-infra 1.2.11 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getjones/test-infra",
3
- "version": "1.2.11",
3
+ "version": "1.3.0",
4
4
  "description": "Providing internal and openapi interface",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -12,7 +12,7 @@ const Endpoints = {
12
12
 
13
13
  const audit = async (contractorId, auditRequestModel, context) => {
14
14
  await requests.getRequestHandler(Endpoints.preAudit(contractorId), {}, context);
15
- return requests.postRequestHandler(Endpoints.audit, auditRequestModel, context);
15
+ return requests.postRequestHandler(Endpoints.audit, auditRequestModel, context).then(res => res.data);
16
16
  };
17
17
 
18
18
  const isReaudit = (contractorId, context) => {
@@ -20,15 +20,15 @@ const isReaudit = (contractorId, context) => {
20
20
  };
21
21
 
22
22
  const getAuditorContractorList = (page, accountId, context) => {
23
- return requests.getRequestHandler(Endpoints.auditorContractorList, { page, accountId }, context);
23
+ return requests.getRequestHandler(Endpoints.auditorContractorList, { page, accountId }, context).then(res => res.data);
24
24
  };
25
25
 
26
26
  const getContractorDetailsForAudit = (contractorId, context) => {
27
- return requests.getRequestHandler(Endpoints.contractorDetailsForAudit(contractorId), {}, context);
27
+ return requests.getRequestHandler(Endpoints.contractorDetailsForAudit(contractorId), {}, context).then(res => res.data);
28
28
  };
29
29
 
30
30
  const getRequirementDetailsForAudit = (contractorId, context) => {
31
- return requests.getRequestHandler(Endpoints.requirementDetailsForAudit(contractorId), {}, context);
31
+ return requests.getRequestHandler(Endpoints.requirementDetailsForAudit(contractorId), {}, context).then(res => res.data);
32
32
  };
33
33
 
34
34
  module.exports = {
@@ -13,7 +13,7 @@ const Endpoints = {
13
13
  assignMptToProperties: (accountId, tenantId) => `${backendUrl}/saas/account/${accountId}/multi-properties/${tenantId}`
14
14
  };
15
15
 
16
- const createContractors = async (createContractorModel, context) => {
16
+ const createContractor = async (createContractorModel, context) => {
17
17
  return requests.postRequestHandler(Endpoints.create, createContractorModel, context).then(res => res.data || res);
18
18
  };
19
19
 
@@ -66,7 +66,7 @@ const getContractorsByTabId = async (tabId, context, activityStatus) => {
66
66
  };
67
67
 
68
68
  module.exports = {
69
- createContractors,
69
+ createContractor,
70
70
  getContractorsByAccountId,
71
71
  getContractorById,
72
72
  deleteByContractorId,
@@ -3,9 +3,9 @@ const { CreateContractorModel } = require('../models/create.contractor.model');
3
3
  const { ContractorModel, MptModel } = require('../models/edit.contractor.model');
4
4
  const { validateType } = require('../../../../common/validations/typeValidations');
5
5
 
6
- const createContractors = async (createContractorsModel, context) => {
7
- validateType(createContractorsModel, CreateContractorModel);
8
- return contractorsAPI.createContractors(createContractorsModel, context);
6
+ const createContractor = async (createContractorModel, context) => {
7
+ validateType(createContractorModel, CreateContractorModel);
8
+ return contractorsAPI.createContractor(createContractorModel, context);
9
9
  };
10
10
 
11
11
  const getContractorsByAccountId = async (accountId, context, activationStatus = null) => {
@@ -51,7 +51,7 @@ const assignMptToProperties = (assignToMptModel, context) => {
51
51
  };
52
52
 
53
53
  module.exports = {
54
- createContractors,
54
+ createContractor,
55
55
  getContractorsByAccountId,
56
56
  getContractorById,
57
57
  deleteByContractorId,
@@ -1,15 +1,14 @@
1
1
  const { validateType } = require('../../../../common/validations/typeValidations');
2
2
 
3
- function CreateContractorModel(requirementId, inviterEmail, vendorsInfo, { tabId = null, disableMail = true, sendCovid19Form = false } = {}) {
3
+ function CreateContractorModel(requirementId, inviterEmail, vendorInfo, { tabId = null, disableMail = true, sendCovid19Form = false } = {}) {
4
4
  this.reqId = requirementId;
5
5
  this.inviterEmail = inviterEmail;
6
- this.vendorInfo = vendorsInfo;
6
+ this.vendorInfo = vendorInfo;
7
7
  this.disableMail = disableMail;
8
8
  this.sendCovid19Form = sendCovid19Form;
9
9
  this.tabId = tabId;
10
10
 
11
- validateType(vendorsInfo, Array);
12
- vendorsInfo && validateType(vendorsInfo[0], ContractorInfo);
11
+ vendorInfo && validateType(vendorInfo, ContractorInfo);
13
12
  }
14
13
 
15
14
  function ContractorInfo(email, companyName, additionalEmails) {
@@ -9,7 +9,8 @@ const Endpoints = {
9
9
  getAllGlobalRecords: (pageNumber, itemsInPage) => `${nodeBackendUrl}/global-record/all-global-records/${pageNumber}/items/${itemsInPage}`,
10
10
  getGlobalRecordServiceArea: `${backendUrl}/saas/global-record/service-areas`,
11
11
  deleteGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`,
12
- updateGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`
12
+ updateGlobalRecord: id => `${nodeBackendUrl}/global-record/id/${id}`,
13
+ getRecordProfileDetails: id => `${nodeBackendUrl}/global-record/record-profile/id/${id}`
13
14
  };
14
15
 
15
16
  const getGlobalRecord = async (id, nodeBackendSecret) => {
@@ -36,11 +37,16 @@ const getGlobalRecordServiceArea = async context => {
36
37
  return cookieAuthRequests.getRequestHandler(Endpoints.getGlobalRecordServiceArea, {}, context);
37
38
  };
38
39
 
40
+ const getRecordProfileDetails = async (id, context) => {
41
+ return cookieAuthRequests.getRequestHandler(Endpoints.getRecordProfileDetails(id), {}, context);
42
+ };
43
+
39
44
  module.exports = {
40
45
  createGlobalRecord,
41
46
  getGlobalRecord,
42
47
  getAllGlobalRecords,
43
48
  getGlobalRecordServiceArea,
44
49
  deleteGlobalRecord,
45
- updateGlobalRecord
50
+ updateGlobalRecord,
51
+ getRecordProfileDetails
46
52
  };
@@ -44,6 +44,10 @@ const updateGlobalRecord = async (id, updatedGlobalRecordModel) => {
44
44
  return globalRecordAPI.updateGlobalRecord(id, nodeBackendSecret, updatedGlobalRecordModel);
45
45
  };
46
46
 
47
+ const getRecordProfileDetails = async (id, context) => {
48
+ return globalRecordAPI.getRecordProfileDetails(id, context);
49
+ };
50
+
47
51
  module.exports = {
48
52
  createGlobalRecord,
49
53
  getGlobalRecordById,
@@ -53,5 +57,6 @@ module.exports = {
53
57
  getAllGlobalRecordsInPageByCombinedSearch,
54
58
  getGlobalRecordServiceArea,
55
59
  deleteGlobalRecord,
56
- updateGlobalRecord
60
+ updateGlobalRecord,
61
+ getRecordProfileDetails
57
62
  };
@@ -3,34 +3,32 @@ class CreateGlobalRecordModel {
3
3
  header,
4
4
  expirationDate,
5
5
  glPolicyNumber,
6
- numberOfRequestsAssociated,
6
+ numberOfAssociatedRequests,
7
7
  numberOfFilledMandatory,
8
8
  {
9
9
  recordName,
10
- additionalEmail,
11
- brokerEmail,
10
+ additionalContacts,
11
+ brokerEmails,
12
12
  publishDate,
13
- dismissDate,
14
13
  serviceArea,
15
14
  primaryEmail,
16
15
  dba,
17
- publishUserName
16
+ lastPublishUserName
18
17
  } = {}
19
18
  ) {
20
19
  this.header = header;
21
20
  this.recordName = recordName;
22
- this.additionalEmail = additionalEmail;
21
+ this.additionalContacts = additionalContacts;
23
22
  this.expirationDate = expirationDate;
24
23
  this.publishDate = publishDate;
25
- this.dismissDate = dismissDate;
26
24
  this.glPolicyNumber = glPolicyNumber;
27
- this.numberOfRequestsAssociated = numberOfRequestsAssociated;
28
- this.brokerEmail = brokerEmail;
25
+ this.numberOfAssociatedRequests = numberOfAssociatedRequests;
26
+ this.brokerEmails = brokerEmails;
29
27
  this.numberOfFilledMandatory = numberOfFilledMandatory;
30
28
  this.serviceArea = serviceArea;
31
29
  this.primaryEmail = primaryEmail;
32
30
  this.dba = dba;
33
- this.publishUserName = publishUserName;
31
+ this.lastPublishUserName = lastPublishUserName;
34
32
  }
35
33
  }
36
34