sysone-api-mapper 1.0.29 → 1.0.30

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.29",
3
+ "version": "1.0.30",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -5,11 +5,23 @@ import dotenv from "dotenv";
5
5
  // Cargar variables de entorno
6
6
  dotenv.config();
7
7
 
8
- // Obtener y parsear la configuración del archivo .env
9
- const API_MAPPER = process.env.API_MAPPER || {};
10
- // Acceder específicamente a la configuración de api-mapper
8
+ const getApiMapperConfig = () => {
9
+ // 1. Intentar desde variables de entorno compiladas
10
+ if (process.env.API_MAPPER && Object.keys(process.env.API_MAPPER).length > 0) {
11
+ console.log("Usando API_MAPPER de process.env");
12
+ return process.env.API_MAPPER;
13
+ }
14
+
15
+ // 2. Intentar desde variable global inyectada
16
+ if (window.__API_MAPPER__ && Object.keys(window.__API_MAPPER__).length > 0) {
17
+ console.log("Usando API_MAPPER de window");
18
+ return window.__API_MAPPER__;
19
+ }
20
+
21
+ };
11
22
 
12
- console.log("variable API_MAPPER desde Paquete de sysone", API_MAPPER);
23
+ const API_MAPPER = getApiMapperConfig();
24
+ console.log("Configuración API_MAPPER cargada:", API_MAPPER);
13
25
 
14
26
  const configs = {
15
27
  default: {