sysone-api-mapper 1.0.34 → 1.0.35

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.34",
3
+ "version": "1.0.35",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -51,7 +51,8 @@ export const apiMapper = async (
51
51
  endpointCode,
52
52
  tenant,
53
53
  routeParams,
54
- params = null
54
+ params = null,
55
+ additionalHeaders = {}
55
56
  ) => {
56
57
  try {
57
58
  const configData = tenantsConfig[endpointCode];
@@ -67,7 +68,13 @@ export const apiMapper = async (
67
68
  }
68
69
 
69
70
  if (tenant === "cnp") {
70
- config = configs.cnp;
71
+ config = {
72
+ ...configs.cnp,
73
+ headers: {
74
+ ...configs.cnp.hdeaders,
75
+ ...additionalHeaders,
76
+ }
77
+ }
71
78
  } else {
72
79
  // Para cualquier otro tenant, usar config default pero sobreescribir X-Tenant y X-User
73
80
  config = {
@@ -76,6 +83,7 @@ export const apiMapper = async (
76
83
  ...configs.default.headers,
77
84
  ["X-Tenant"]: tenant,
78
85
  ["X-User"]: tenant,
86
+ ...additionalHeaders
79
87
  },
80
88
  };
81
89
  }