@orbe-agro/client-core 5.3.177 → 5.3.178
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.config.d.ts","sourceRoot":"","sources":["../../../../lib/base/configs/api.config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.config.d.ts","sourceRoot":"","sources":["../../../../lib/base/configs/api.config.ts"],"names":[],"mappings":"AA8DA,eAAO,MAAM,OAAO,QAAc,CAAA;AAElC,eAAO,MAAM,kBAAkB,KAA8C,CAAA;AAC7E,eAAO,MAAM,iBAAiB,KAA6C,CAAA;AAE3E,QAAA,MAAM,SAAS;;;;;;;CAOd,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
if (
|
|
3
|
-
return
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return console.log("✅ [API_CONFIG] modifiedOrigin:", r), console.log("✅ [API_CONFIG] Retornando:", r ?? n), r ?? n;
|
|
9
|
-
}
|
|
10
|
-
return o?.includes(".qas.") ? (console.log("✅ [API_CONFIG] Condição 3 atendida: origin contém .qas."), console.log("✅ [API_CONFIG] Retornando: https://gateway.apps.qas.orbeagro.com.br"), "https://gateway.apps.qas.orbeagro.com.br") : o?.includes(".prd.") ? (console.log("✅ [API_CONFIG] Condição 4 atendida: origin contém .prd."), console.log("✅ [API_CONFIG] Retornando: https://gateway.apps.prd.orbeagro.com.br"), "https://gateway.apps.prd.orbeagro.com.br") : (console.log("⚠️ [API_CONFIG] Nenhuma condição atendida, retornando BUILD_API_URL:", n), n);
|
|
11
|
-
}, l = i(), c = void 0, a = void 0, I = {
|
|
12
|
-
API_URL: l,
|
|
1
|
+
const n = "production", o = "http://localhost:8081", t = "http://172.16.14.27:30001", r = () => {
|
|
2
|
+
if (n === "development" || !t)
|
|
3
|
+
return o;
|
|
4
|
+
const e = globalThis?.location?.origin ?? document?.referrer;
|
|
5
|
+
return e && (e.includes(":5173") || e.includes(":31000")) ? e.replace(":5173", ":8081").replace(":31000", ":30001") ?? t : e?.includes(".qas.") ? "http://gateway-service.homolog.svc.cluster.local:8081" : e?.includes(".prd.") ? "https://gateway.apps.prd.orbeagro.com.br" : t;
|
|
6
|
+
}, i = r(), c = void 0, s = void 0, l = {
|
|
7
|
+
API_URL: i,
|
|
13
8
|
GOOGLE_MAP_API_KEY: c,
|
|
14
|
-
GOOGLE_MAP_MAP_ID:
|
|
15
|
-
NODE_ENV:
|
|
16
|
-
DEV_API_URL:
|
|
17
|
-
BUILD_API_URL:
|
|
9
|
+
GOOGLE_MAP_MAP_ID: s,
|
|
10
|
+
NODE_ENV: n,
|
|
11
|
+
DEV_API_URL: o,
|
|
12
|
+
BUILD_API_URL: t
|
|
18
13
|
};
|
|
19
14
|
export {
|
|
20
|
-
|
|
15
|
+
i as API_URL,
|
|
21
16
|
c as GOOGLE_MAP_API_KEY,
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
s as GOOGLE_MAP_MAP_ID,
|
|
18
|
+
l as default
|
|
24
19
|
};
|
|
25
20
|
//# sourceMappingURL=api.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.config.js","sources":["../../../lib/base/configs/api.config.ts"],"sourcesContent":["/**\n * @desc Ambiente atual.\n *\n * \"development\" -> iniciado com \"yarn start\".\n *\n * \"production\" -> versão gerado com \"yarn build\".\n **/\nconst NODE_ENV = import.meta.env.MODE\n\n/**\n * @desc Endereço da API usado em modo de desenvolvimento, quando rodando a aplicação com \"yarn start\".\n *\n * @see http://localhost:8080/api (LOCAL)\n *\n * @see http://172.16.14.27:30001/api (QAS)\n *\n * */\n\nconst DEV_API_URL = 'http://localhost:8081'\n\n/**\n * @desc Endereço da API usado em versão de produção.\n *\n * VITE_APP_API_URL é definido no arquivo \".env.development\" e \".env.production\".\n *\n * Ambiente \".env.development\" é usado com o comando \"yarn build:dev\".\n *\n * Ambiente \".env.production\" é usado com o comando \"yarn build:prod\".\n *\n * Os ambientes sobrescrevem qualquer outro ambiente e as variáveis carregadas neles.\n **/\nconst BUILD_API_URL = import.meta.env.VITE_APP_API_URL\n\n/**\n * @desc Endereço atual da API.\n **/\n\nconst getApiUrl = (): string => {\n
|
|
1
|
+
{"version":3,"file":"api.config.js","sources":["../../../lib/base/configs/api.config.ts"],"sourcesContent":["/**\n * @desc Ambiente atual.\n *\n * \"development\" -> iniciado com \"yarn start\".\n *\n * \"production\" -> versão gerado com \"yarn build\".\n **/\nconst NODE_ENV = import.meta.env.MODE\n\n/**\n * @desc Endereço da API usado em modo de desenvolvimento, quando rodando a aplicação com \"yarn start\".\n *\n * @see http://localhost:8080/api (LOCAL)\n *\n * @see http://172.16.14.27:30001/api (QAS)\n *\n * */\n\nconst DEV_API_URL = 'http://localhost:8081'\n\n/**\n * @desc Endereço da API usado em versão de produção.\n *\n * VITE_APP_API_URL é definido no arquivo \".env.development\" e \".env.production\".\n *\n * Ambiente \".env.development\" é usado com o comando \"yarn build:dev\".\n *\n * Ambiente \".env.production\" é usado com o comando \"yarn build:prod\".\n *\n * Os ambientes sobrescrevem qualquer outro ambiente e as variáveis carregadas neles.\n **/\nconst BUILD_API_URL = import.meta.env.VITE_APP_API_URL\n\n/**\n * @desc Endereço atual da API.\n **/\n\nconst getApiUrl = (): string => {\n if (NODE_ENV === 'development' || !BUILD_API_URL) {\n return DEV_API_URL\n }\n\n const origin = globalThis?.location?.origin ?? document?.referrer\n \n if (origin && (origin.includes(':5173') || origin.includes(':31000'))) {\n const modifiedOrigin = origin\n .replace(':5173', ':8081')\n .replace(':31000', ':30001')\n return modifiedOrigin ?? BUILD_API_URL\n }\n \n if (origin?.includes('.qas.')) {\n return 'http://gateway-service.homolog.svc.cluster.local:8081'\n }\n \n if (origin?.includes('.prd.')) {\n return 'https://gateway.apps.prd.orbeagro.com.br'\n }\n \n return BUILD_API_URL;\n}\n\nexport const API_URL = getApiUrl()\n\nexport const GOOGLE_MAP_API_KEY = import.meta.env.VITE_APP_GOOGLE_MAP_API_KEY\nexport const GOOGLE_MAP_MAP_ID = import.meta.env.VITE_APP_GOOGLE_MAP_MAP_ID\n\nconst apiConfig = {\n API_URL,\n GOOGLE_MAP_API_KEY,\n GOOGLE_MAP_MAP_ID,\n NODE_ENV,\n DEV_API_URL,\n BUILD_API_URL,\n}\n\nexport default apiConfig\n"],"names":["NODE_ENV","DEV_API_URL","BUILD_API_URL","getApiUrl","origin","API_URL","GOOGLE_MAP_API_KEY","GOOGLE_MAP_MAP_ID","apiConfig"],"mappings":"AAOA,MAAMA,IAAW,cAWXC,IAAc,yBAadC,IAAgB,6BAMhBC,IAAY,MAAc;AACxB,MAAAH,MAAa,iBAAiB,CAACE;AACxB,WAAAD;AAGX,QAAMG,IAAS,YAAY,UAAU,UAAU,UAAU;AAErD,SAAAA,MAAWA,EAAO,SAAS,OAAO,KAAKA,EAAO,SAAS,QAAQ,KACxCA,EAClB,QAAQ,SAAS,OAAO,EACxB,QAAQ,UAAU,QAAQ,KACNF,IAGzBE,GAAQ,SAAS,OAAO,IACjB,0DAGPA,GAAQ,SAAS,OAAO,IACjB,6CAGJF;AACX,GAEaG,IAAUF,EAAU,GAEpBG,IAAqB,QACrBC,IAAoB,QAE3BC,IAAY;AAAA,EACd,SAAAH;AAAA,EACA,oBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAP;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AACJ;"}
|
|
@@ -36,45 +36,27 @@ const BUILD_API_URL = import.meta.env.VITE_APP_API_URL
|
|
|
36
36
|
**/
|
|
37
37
|
|
|
38
38
|
const getApiUrl = (): string => {
|
|
39
|
-
console.log('🔍 [API_CONFIG] Iniciando getApiUrl()')
|
|
40
|
-
console.log('🔍 [API_CONFIG] NODE_ENV:', NODE_ENV)
|
|
41
|
-
console.log('🔍 [API_CONFIG] DEV_API_URL:', DEV_API_URL)
|
|
42
|
-
console.log('🔍 [API_CONFIG] BUILD_API_URL:', BUILD_API_URL)
|
|
43
|
-
|
|
44
39
|
if (NODE_ENV === 'development' || !BUILD_API_URL) {
|
|
45
|
-
console.log('✅ [API_CONFIG] Condição 1 atendida: NODE_ENV === development OU !BUILD_API_URL')
|
|
46
|
-
console.log('✅ [API_CONFIG] Retornando DEV_API_URL:', DEV_API_URL)
|
|
47
40
|
return DEV_API_URL
|
|
48
41
|
}
|
|
49
42
|
|
|
50
43
|
const origin = globalThis?.location?.origin ?? document?.referrer
|
|
51
|
-
console.log('🔍 [API_CONFIG] origin obtido:', origin)
|
|
52
|
-
console.log('🔍 [API_CONFIG] globalThis?.location?.origin:', globalThis?.location?.origin)
|
|
53
|
-
console.log('🔍 [API_CONFIG] document?.referrer:', document?.referrer)
|
|
54
44
|
|
|
55
45
|
if (origin && (origin.includes(':5173') || origin.includes(':31000'))) {
|
|
56
|
-
console.log('✅ [API_CONFIG] Condição 2 atendida: origin contém :5173 OU :31000')
|
|
57
46
|
const modifiedOrigin = origin
|
|
58
47
|
.replace(':5173', ':8081')
|
|
59
48
|
.replace(':31000', ':30001')
|
|
60
|
-
console.log('✅ [API_CONFIG] modifiedOrigin:', modifiedOrigin)
|
|
61
|
-
console.log('✅ [API_CONFIG] Retornando:', modifiedOrigin ?? BUILD_API_URL)
|
|
62
49
|
return modifiedOrigin ?? BUILD_API_URL
|
|
63
50
|
}
|
|
64
51
|
|
|
65
52
|
if (origin?.includes('.qas.')) {
|
|
66
|
-
|
|
67
|
-
console.log('✅ [API_CONFIG] Retornando: https://gateway.apps.qas.orbeagro.com.br')
|
|
68
|
-
return 'https://gateway.apps.qas.orbeagro.com.br'
|
|
53
|
+
return 'http://gateway-service.homolog.svc.cluster.local:8081'
|
|
69
54
|
}
|
|
70
55
|
|
|
71
56
|
if (origin?.includes('.prd.')) {
|
|
72
|
-
console.log('✅ [API_CONFIG] Condição 4 atendida: origin contém .prd.')
|
|
73
|
-
console.log('✅ [API_CONFIG] Retornando: https://gateway.apps.prd.orbeagro.com.br')
|
|
74
57
|
return 'https://gateway.apps.prd.orbeagro.com.br'
|
|
75
58
|
}
|
|
76
59
|
|
|
77
|
-
console.log('⚠️ [API_CONFIG] Nenhuma condição atendida, retornando BUILD_API_URL:', BUILD_API_URL)
|
|
78
60
|
return BUILD_API_URL;
|
|
79
61
|
}
|
|
80
62
|
|
package/package.json
CHANGED