@navservice/core 1.74.0 → 1.76.0
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/build/es/index.js +5 -6
- package/build/lib/index.cjs +9 -10
- package/package.json +1 -1
package/build/es/index.js
CHANGED
|
@@ -155,7 +155,7 @@ const _environment = class {
|
|
|
155
155
|
window.sessionStorage.setItem("ENVIRONMENT", props);
|
|
156
156
|
}
|
|
157
157
|
static get get() {
|
|
158
|
-
return window.sessionStorage.
|
|
158
|
+
return window.sessionStorage.getItem("ENVIRONMENT");
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
161
|
const utils_environment = _environment;
|
|
@@ -171,16 +171,15 @@ const _api_api = class _api {
|
|
|
171
171
|
if ("undefined" == typeof window) throw new Error("resolveApiBaseURL must run in browser");
|
|
172
172
|
const { hostname } = window.location;
|
|
173
173
|
const apiOverride = utils_environment.get;
|
|
174
|
-
if ("SANDBOX" === apiOverride) return "https://api-sandbox.navsoftware.com.br";
|
|
175
|
-
if ("PRODUCAO" === apiOverride) return "https://api.navsoftware.com.br";
|
|
176
|
-
if ("LOCALHOST" === apiOverride) return "http://localhost:8787";
|
|
177
|
-
if ("localhost" === hostname || hostname.startsWith("localhost")) return "http://localhost:8787";
|
|
178
174
|
const isNavSoftware = hostname.includes("navsoftware");
|
|
179
175
|
const isSandbox = hostname.includes("sandbox");
|
|
180
176
|
if (isNavSoftware && isSandbox) return "https://api-sandbox.navsoftware.com.br";
|
|
181
177
|
if (isNavSoftware) return "https://api.navsoftware.com.br";
|
|
178
|
+
if ("SANDBOX" === apiOverride) return "https://api-sandbox.navsoftware.com.br";
|
|
179
|
+
if ("PRODUCAO" === apiOverride) return "https://api.navsoftware.com.br";
|
|
180
|
+
if ("LOCALHOST" === apiOverride) return "http://localhost:8787";
|
|
181
|
+
if ("localhost" === hostname || hostname.startsWith("localhost")) return "http://localhost:8787";
|
|
182
182
|
} catch (error) {
|
|
183
|
-
console.log(error, 'errr 1');
|
|
184
183
|
throw new Error(`Ambiente não reconhecido: ${error}`);
|
|
185
184
|
}
|
|
186
185
|
}
|
package/build/lib/index.cjs
CHANGED
|
@@ -235,7 +235,7 @@ const _environment = class _environment {
|
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
static get get() {
|
|
238
|
-
return window.sessionStorage.
|
|
238
|
+
return window.sessionStorage.getItem("ENVIRONMENT");
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
/* export default */ const utils_environment = (_environment);
|
|
@@ -258,6 +258,14 @@ const _api_api = class _api {
|
|
|
258
258
|
}
|
|
259
259
|
const { hostname } = window.location;
|
|
260
260
|
const apiOverride = utils_environment.get;
|
|
261
|
+
const isNavSoftware = hostname.includes("navsoftware");
|
|
262
|
+
const isSandbox = hostname.includes("sandbox");
|
|
263
|
+
if (isNavSoftware && isSandbox) {
|
|
264
|
+
return "https://api-sandbox.navsoftware.com.br";
|
|
265
|
+
}
|
|
266
|
+
if (isNavSoftware) {
|
|
267
|
+
return "https://api.navsoftware.com.br";
|
|
268
|
+
}
|
|
261
269
|
if (apiOverride === "SANDBOX") {
|
|
262
270
|
return "https://api-sandbox.navsoftware.com.br";
|
|
263
271
|
}
|
|
@@ -270,16 +278,7 @@ const _api_api = class _api {
|
|
|
270
278
|
if (hostname === "localhost" || hostname.startsWith("localhost")) {
|
|
271
279
|
return "http://localhost:8787";
|
|
272
280
|
}
|
|
273
|
-
const isNavSoftware = hostname.includes("navsoftware");
|
|
274
|
-
const isSandbox = hostname.includes("sandbox");
|
|
275
|
-
if (isNavSoftware && isSandbox) {
|
|
276
|
-
return "https://api-sandbox.navsoftware.com.br";
|
|
277
|
-
}
|
|
278
|
-
if (isNavSoftware) {
|
|
279
|
-
return "https://api.navsoftware.com.br";
|
|
280
|
-
}
|
|
281
281
|
} catch (error) {
|
|
282
|
-
console.log(error, 'errr 1');
|
|
283
282
|
throw new Error(`Ambiente não reconhecido: ${error}`);
|
|
284
283
|
}
|
|
285
284
|
}
|