@fctc/interface-logic 1.0.5 → 1.0.6

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/utils.mjs CHANGED
@@ -2807,6 +2807,25 @@ var copyTextToClipboard = async (text) => {
2807
2807
  }
2808
2808
  }
2809
2809
  };
2810
+ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2811
+ if (!originalRequest.data) return originalRequest.data;
2812
+ if (typeof originalRequest.data === "string") {
2813
+ try {
2814
+ const parsedData = JSON.parse(originalRequest.data);
2815
+ if (parsedData.with_context && typeof parsedData.with_context === "object") {
2816
+ parsedData.with_context.token = newAccessToken;
2817
+ }
2818
+ return JSON.stringify(parsedData);
2819
+ } catch (e) {
2820
+ console.warn("Failed to parse originalRequest.data", e);
2821
+ return originalRequest.data;
2822
+ }
2823
+ }
2824
+ if (typeof originalRequest.data === "object" && originalRequest.data.with_context) {
2825
+ originalRequest.data.with_context.token = newAccessToken;
2826
+ }
2827
+ return originalRequest.data;
2828
+ };
2810
2829
  var isObjectEmpty = (obj) => {
2811
2830
  return Object.keys(obj).length === 0;
2812
2831
  };
@@ -2876,6 +2895,7 @@ export {
2876
2895
  sessionStorageUtils,
2877
2896
  stringToColor,
2878
2897
  toQueryString,
2898
+ updateTokenParamInOriginalRequest,
2879
2899
  useTabModel,
2880
2900
  validateAndParseDate
2881
2901
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/interface-logic",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -73,16 +73,13 @@
73
73
  "@reduxjs/toolkit": "^2.8.2",
74
74
  "@tanstack/react-query": "^5.83.0",
75
75
  "axios": "^1.11.0",
76
- "i18next": "^25.3.2",
77
- "i18next-browser-languagedetector": "^8.2.0",
78
76
  "moment": "^2.30.1",
79
- "react-i18next": "^15.6.1",
80
77
  "react-redux": "^9.2.0"
81
78
  },
82
79
  "devDependencies": {
83
80
  "@types/react": "^18.3.1",
84
- "jest": "^29.7.0",
85
81
  "react": "18.0.0",
82
+ "jest": "^29.7.0",
86
83
  "tsup": "^8.0.0",
87
84
  "typescript": "^5.8.2"
88
85
  },