teraprox-core-sdk 0.3.9 → 0.3.11

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/dist/index.js CHANGED
@@ -382,14 +382,17 @@ var CoreServiceBuilder = class {
382
382
  if (this._fallbackControllers[context]) {
383
383
  return this._fallbackControllers[context];
384
384
  }
385
- const endpoint = baseEndPoint != null ? baseEndPoint : this._httpEndpoint ? `${this._httpEndpoint}/${context}` : null;
385
+ const endpointStr = this._httpEndpoint ? context ? `${this._httpEndpoint}/${context}` : this._httpEndpoint : null;
386
+ const endpoint = baseEndPoint != null ? baseEndPoint : endpointStr;
386
387
  if (!endpoint) {
387
388
  console.warn(`[CoreServiceBuilder] HttpEndpoint nulo para "${context}". Usando NullHttpController.`);
388
389
  const controller = new NullHttpController();
389
390
  controller.context = context;
390
391
  return controller;
391
392
  }
392
- const envHost = typeof process !== "undefined" && process.env ? process.env.REACT_APP_TERAPROX_GATEWAY_HOST || process.env.VITE_TERAPROX_GATEWAY_HOST : void 0;
393
+ const _globalObject = typeof window !== "undefined" ? window : globalThis;
394
+ const globalProcess = _globalObject.process || { env: {} };
395
+ const envHost = globalProcess.env ? globalProcess.env.REACT_APP_TERAPROX_GATEWAY_HOST || globalProcess.env.VITE_TERAPROX_GATEWAY_HOST : void 0;
393
396
  const hostHeader = this._gatewayHost || envHost || context;
394
397
  const extraHeaders = { "x-teraprox-host": hostHeader };
395
398
  return this._tracing ? new TracingHttpAdapter(endpoint, extraHeaders) : new FetchHttpAdapter(endpoint, extraHeaders);
@@ -1463,7 +1466,7 @@ var RecursoDisplayer = ({
1463
1466
  onSaveRecurso,
1464
1467
  singleReturn = false
1465
1468
  }) => {
1466
- const arvoreEstruturalController = useHttpController("arvoreEstrutural");
1469
+ const arvoreEstruturalController = useHttpController("");
1467
1470
  const branchLevelController = useHttpController("branchLevel");
1468
1471
  const [branches, setBranches] = (0, import_react17.useState)([]);
1469
1472
  const dispatch = (0, import_react_redux3.useDispatch)();
package/dist/index.mjs CHANGED
@@ -277,14 +277,17 @@ var CoreServiceBuilder = class {
277
277
  if (this._fallbackControllers[context]) {
278
278
  return this._fallbackControllers[context];
279
279
  }
280
- const endpoint = baseEndPoint != null ? baseEndPoint : this._httpEndpoint ? `${this._httpEndpoint}/${context}` : null;
280
+ const endpointStr = this._httpEndpoint ? context ? `${this._httpEndpoint}/${context}` : this._httpEndpoint : null;
281
+ const endpoint = baseEndPoint != null ? baseEndPoint : endpointStr;
281
282
  if (!endpoint) {
282
283
  console.warn(`[CoreServiceBuilder] HttpEndpoint nulo para "${context}". Usando NullHttpController.`);
283
284
  const controller = new NullHttpController();
284
285
  controller.context = context;
285
286
  return controller;
286
287
  }
287
- const envHost = typeof process !== "undefined" && process.env ? process.env.REACT_APP_TERAPROX_GATEWAY_HOST || process.env.VITE_TERAPROX_GATEWAY_HOST : void 0;
288
+ const _globalObject = typeof window !== "undefined" ? window : globalThis;
289
+ const globalProcess = _globalObject.process || { env: {} };
290
+ const envHost = globalProcess.env ? globalProcess.env.REACT_APP_TERAPROX_GATEWAY_HOST || globalProcess.env.VITE_TERAPROX_GATEWAY_HOST : void 0;
288
291
  const hostHeader = this._gatewayHost || envHost || context;
289
292
  const extraHeaders = { "x-teraprox-host": hostHeader };
290
293
  return this._tracing ? new TracingHttpAdapter(endpoint, extraHeaders) : new FetchHttpAdapter(endpoint, extraHeaders);
@@ -1358,7 +1361,7 @@ var RecursoDisplayer = ({
1358
1361
  onSaveRecurso,
1359
1362
  singleReturn = false
1360
1363
  }) => {
1361
- const arvoreEstruturalController = useHttpController("arvoreEstrutural");
1364
+ const arvoreEstruturalController = useHttpController("");
1362
1365
  const branchLevelController = useHttpController("branchLevel");
1363
1366
  const [branches, setBranches] = useState12([]);
1364
1367
  const dispatch = useDispatch2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teraprox-core-sdk",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "description": "Contrato tipado Core ↔ Federados — interfaces, context, hooks e componentes compartilhados",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",