ingeniuscliq-core 0.5.67 → 0.5.69

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":"axiosGlobal.d.ts","sourceRoot":"","sources":["../../src/helpers/axiosGlobal.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGzE,eAAO,IAAI,GAAG,EAAE,aAMd,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,IAsClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAWtE,CAAC;AAoBF,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"axiosGlobal.d.ts","sourceRoot":"","sources":["../../src/helpers/axiosGlobal.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAA8B,MAAM,OAAO,CAAC;AAGzE,eAAO,IAAI,GAAG,EAAE,aAMd,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,MAAM,KAAG,IAqClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,OAAO,CAYtE,CAAC;AAuBF,eAAe,GAAG,CAAC"}
@@ -12,8 +12,7 @@ const initAxiosConfigs = (baseURL) => {
12
12
  api.interceptors.request.use(
13
13
  async (config) => {
14
14
  config.baseURL = baseURL;
15
- config.headers["X-Forwarded-Host"] = window.location.host.split(":")[0];
16
- config.headers["X-Original-Host"] = window.location.host.split(":")[0];
15
+ config.headers["X-Tenant"] = window.location.host.split(":")[0];
17
16
  if (!config.url?.includes("sanctum/csrf-cookie")) {
18
17
  if (!document.cookie.includes("XSRF-TOKEN") && !config.url?.includes("sanctum/csrf-cookie")) {
19
18
  await ensureCsrfToken(baseURL);
@@ -40,6 +39,7 @@ const initAxiosConfigs = (baseURL) => {
40
39
  );
41
40
  };
42
41
  const ensureCsrfToken = async (baseURL) => {
42
+ console.log("Ensuring csrf token");
43
43
  if (!csrfTokenFetched) {
44
44
  try {
45
45
  await api.get(`${baseURL}/sanctum/csrf-cookie`);
@@ -52,10 +52,13 @@ const ensureCsrfToken = async (baseURL) => {
52
52
  return true;
53
53
  };
54
54
  const attachCsrfToken = (config) => {
55
+ console.log("Attaching");
56
+ console.log(document.cookie, "document cookie");
55
57
  const xsrfCookie = document.cookie.split("; ").find((cookie) => cookie.startsWith("XSRF-TOKEN="));
56
58
  if (xsrfCookie) {
57
59
  const token = xsrfCookie.split("=")[1];
58
60
  const decodedToken = decodeURIComponent(token);
61
+ console.log(config.headers, "config-headers");
59
62
  if (config.headers) {
60
63
  config.headers["X-XSRF-TOKEN"] = decodedToken;
61
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/helpers/image.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,UAU9C"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/helpers/image.ts"],"names":[],"mappings":"AAAA,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,UAc9C"}
@@ -2,6 +2,9 @@ function getImageUrlByTenant(url) {
2
2
  if (typeof window === "undefined") {
3
3
  return url;
4
4
  }
5
+ if (url.includes("tenant=")) {
6
+ return url;
7
+ }
5
8
  if (url.includes("?")) {
6
9
  return url + `&tenant=${window.location.host.split(":")[0]}`;
7
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CoreCustomizationBuilder.d.ts","sourceRoot":"","sources":["../../../../src/modules/CoreCustomization/classes/CoreCustomizationBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,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AE,IAAI,EAAE,GAAG,GAAG,MAAM;IA8G5C,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiBb"}
@@ -99,7 +99,8 @@ class CoreCustomizationBuilder extends CoreBaseBuilder {
99
99
  actions?.onSuccess?.(response);
100
100
  return response.data;
101
101
  } catch (error) {
102
- set({ loading: false, error });
102
+ const errorMessage = error?.response?.data?.message || error?.message || "An error occurred";
103
+ set({ loading: false, error: errorMessage });
103
104
  actions?.onError?.(error);
104
105
  throw error;
105
106
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.5.67",
3
+ "version": "0.5.69",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",