@orbe-agro/client-core 5.3.89 → 5.3.90
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,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @desc Endereço atual da API.
|
|
3
3
|
**/
|
|
4
|
-
export declare const API_URL:
|
|
4
|
+
export declare const API_URL: string;
|
|
5
5
|
export declare const GOOGLE_MAP_API_KEY: any;
|
|
6
6
|
export declare const GOOGLE_MAP_MAP_ID: any;
|
|
7
7
|
declare const apiConfig: {
|
|
8
|
-
API_URL:
|
|
8
|
+
API_URL: string;
|
|
9
9
|
GOOGLE_MAP_API_KEY: any;
|
|
10
10
|
GOOGLE_MAP_MAP_ID: any;
|
|
11
11
|
NODE_ENV: string;
|
|
12
12
|
DEV_API_URL: string;
|
|
13
|
-
BUILD_API_URL:
|
|
13
|
+
BUILD_API_URL: string;
|
|
14
14
|
};
|
|
15
15
|
export default apiConfig;
|
|
16
16
|
//# sourceMappingURL=api.config.d.ts.map
|
|
@@ -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":"AA+CA;;IAEI;AACJ,eAAO,MAAM,OAAO,QAC0D,CAAA;AAE9E,eAAO,MAAM,kBAAkB,KAA8C,CAAA;AAC7E,eAAO,MAAM,iBAAiB,KAA6C,CAAA;AAE3E,QAAA,MAAM,SAAS;;;;;;;CAOd,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
const t = "production", e = "http://localhost:8081", c = await fetch(
|
|
2
|
-
|
|
1
|
+
const t = "production", e = "http://localhost:8081", c = await fetch(window.location.href, { cache: "no-store" }).then((_) => {
|
|
2
|
+
const n = _.headers.get("x-url-backend");
|
|
3
|
+
if (!n) throw new Error("Header x-url-backend não encontrado");
|
|
4
|
+
return n;
|
|
5
|
+
}), o = c ?? "http://172.16.14.30:30001";
|
|
6
|
+
console.log("VARIAVEL URL_BACKEND: " + c);
|
|
3
7
|
console.log("VARIAVEL BUILD_API_URL: " + o);
|
|
4
|
-
const
|
|
5
|
-
API_URL:
|
|
6
|
-
GOOGLE_MAP_API_KEY:
|
|
7
|
-
GOOGLE_MAP_MAP_ID:
|
|
8
|
+
const r = t === "development" || !o ? e : o, s = void 0, A = void 0, a = {
|
|
9
|
+
API_URL: r,
|
|
10
|
+
GOOGLE_MAP_API_KEY: s,
|
|
11
|
+
GOOGLE_MAP_MAP_ID: A,
|
|
8
12
|
NODE_ENV: t,
|
|
9
13
|
DEV_API_URL: e,
|
|
10
14
|
BUILD_API_URL: o
|
|
11
15
|
};
|
|
12
16
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
r as API_URL,
|
|
18
|
+
s as GOOGLE_MAP_API_KEY,
|
|
19
|
+
A as GOOGLE_MAP_MAP_ID,
|
|
20
|
+
a as default
|
|
17
21
|
};
|
|
18
22
|
//# 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 **/\n\n\nconst
|
|
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 **/\n\n\nconst URL_BACKEND = await fetch(window.location.href, { cache: 'no-store' })\n .then(res => {\n const v = res.headers.get('x-url-backend');\n if (!v) throw new Error('Header x-url-backend não encontrado');\n return v;\n });\n\nconst BUILD_API_URL = URL_BACKEND ?? import.meta.env.VITE_APP_API_URL\n\n\nconsole.log('VARIAVEL URL_BACKEND: ' + URL_BACKEND);\nconsole.log('VARIAVEL BUILD_API_URL: ' + BUILD_API_URL);\n\n\n/**\n * @desc Endereço atual da API.\n **/\nexport const API_URL =\n NODE_ENV === 'development' || !BUILD_API_URL ? DEV_API_URL : BUILD_API_URL\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","URL_BACKEND","res","v","BUILD_API_URL","API_URL","GOOGLE_MAP_API_KEY","GOOGLE_MAP_MAP_ID","apiConfig"],"mappings":"AAOA,MAAMA,IAAW,cAWXC,IAAc,yBAedC,IAAc,MAAM,MAAM,OAAO,SAAS,MAAM,EAAE,OAAO,WAAA,CAAY,EACxE,KAAK,CAAAC,MAAO;AACX,QAAMC,IAAID,EAAI,QAAQ,IAAI,eAAe;AACzC,MAAI,CAACC,EAAG,OAAM,IAAI,MAAM,qCAAqC;AAC7D,SAAOA;AACT,CAAC,GAEGC,IAAgBH,KAAe;AAGrC,QAAQ,IAAI,2BAA2BA,CAAW;AAClD,QAAQ,IAAI,6BAA6BG,CAAa;AAM/C,MAAMC,IACTN,MAAa,iBAAiB,CAACK,IAAgBJ,IAAcI,GAEpDE,IAAqB,QACrBC,IAAoB,QAE3BC,IAAY;AAAA,EACd,SAAAH;AAAA,EACA,oBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAR;AAAA,EACA,aAAAC;AAAA,EACA,eAAAI;AACJ;"}
|
|
@@ -31,9 +31,12 @@ const DEV_API_URL = 'http://localhost:8081'
|
|
|
31
31
|
**/
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const URL_BACKEND = await fetch(window.location.href, { cache: 'no-store' })
|
|
35
|
+
.then(res => {
|
|
36
|
+
const v = res.headers.get('x-url-backend');
|
|
37
|
+
if (!v) throw new Error('Header x-url-backend não encontrado');
|
|
38
|
+
return v;
|
|
39
|
+
});
|
|
37
40
|
|
|
38
41
|
const BUILD_API_URL = URL_BACKEND ?? import.meta.env.VITE_APP_API_URL
|
|
39
42
|
|