sysone-api-mapper 1.0.9 → 1.0.11

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": "sysone-api-mapper",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  import { getClaims_CNP } from "./modules/claim";
2
- import { getEndorsements_CNP, getInsureds_CNP, getInsureds_CNP_Request, getPolicies_CNP, getPolicyCollectiveDetail_CNP, getPolicyDetail_CNP, postInsureds_CNP } from "./modules/policy";
2
+ import { getEndorsements_CNP, getInsureds_CNP, getInsureds_CNP_Request, getPolicies_CNP, getPolicies_CNP_Request, getPolicyCollectiveDetail_CNP, getPolicyDetail_CNP, postInsureds_CNP } from "./modules/policy";
3
3
  import { getQuotationByCode, getQuotationsList } from "./modules/quotation";
4
4
 
5
5
  export const methods = {
@@ -32,7 +32,7 @@ export const tenantsConfig = {
32
32
  url: 'policy/v1/policies/{0}/endorsements',
33
33
  method: methods.GET,
34
34
  source: 'https://apidoc.sysone.com/policy/v1/open-api.html#/paths/~1v1~1policies~1%7Bcode%7D~1endorsements/get',
35
- requestMapper: null,
35
+ requestMapper: request => ({ mappedParams: request }),
36
36
  responseMapper: (response) => response,
37
37
  },
38
38
  cnp: {
@@ -45,17 +45,17 @@ export const tenantsConfig = {
45
45
  },
46
46
  GET_POLICIES: {
47
47
  default: {
48
- url: 'policy/v1/policies?processCode=ACTIVE&commercialStructuresCodes[]=EC-1&commercialStructuresCodes[]=EC-12&pageSize=1&page=1&sort=MODIFIED_DATE_DESC',
48
+ url: 'policy/v1/policies',
49
49
  method: methods.GET,
50
50
  source: 'https://apidoc.sysone.com/policy/v1/open-api.html#/paths/~1v1~1policies/get',
51
51
  requestMapper: (request) => ({ mappedParams: request }),
52
52
  responseMapper: (response) => response,
53
53
  },
54
54
  cnp: {
55
- url: 'policy/v1/policy?pageNumber=1&sort=TomadorCodigo&orderType=desc&pageSize=25&allPolicies',
55
+ url: 'policy/v1/policy',
56
56
  method: methods.GET,
57
57
  source: "https://developers-test.cnp.com.ar/api-details#api=policy-api&operation=get-v1-policy-pagenumber-pagenumber-sort-sort-ordertype-ordertype-pagesize-p",
58
- requestMapper: null,
58
+ requestMapper: request => ({ mappedParams: getPolicies_CNP_Request(request) }),
59
59
  responseMapper: (response) => getPolicies_CNP(response),
60
60
  },
61
61
  },
@@ -114,7 +114,7 @@ export const tenantsConfig = {
114
114
 
115
115
  GET_QUOTATIONS: {
116
116
  default: {
117
- url: 'quotation/v1/quotations?page=1&pageSize=3',
117
+ url: 'quotation/v1/quotations',
118
118
  method: methods.GET,
119
119
  source: 'https://apidoc.sysone.com/quotation/v1/open-api.html#/paths/~1v1~1quotations/get',
120
120
  requestMapper: (request) => ({ mappedParams: request }),
@@ -30,10 +30,7 @@ export const apiMapper = async (endpointCode, tenant, routeParams, params = null
30
30
  const configData = tenantsConfig[endpointCode];
31
31
  const endpointData = configData[tenant] ?? configData.default;
32
32
  const config = configs[tenant] ?? configs.default;
33
- console.log("config", config)
34
- console.log("config", configData)
35
-
36
-
33
+
37
34
  const url = getUrl(endpointData.url, routeParams);
38
35
  let response;
39
36
  let request;