@fctc/interface-logic 1.5.3 → 1.5.5

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/provider.js CHANGED
@@ -1,28 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __pow = Math.pow;
13
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
- var __spreadValues = (a, b) => {
15
- for (var prop in b || (b = {}))
16
- if (__hasOwnProp.call(b, prop))
17
- __defNormalProp(a, prop, b[prop]);
18
- if (__getOwnPropSymbols)
19
- for (var prop of __getOwnPropSymbols(b)) {
20
- if (__propIsEnum.call(b, prop))
21
- __defNormalProp(a, prop, b[prop]);
22
- }
23
- return a;
24
- };
25
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
8
  var __export = (target, all) => {
27
9
  for (var name in all)
28
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -44,26 +26,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
44
26
  mod
45
27
  ));
46
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47
- var __async = (__this, __arguments, generator) => {
48
- return new Promise((resolve, reject) => {
49
- var fulfilled = (value) => {
50
- try {
51
- step(generator.next(value));
52
- } catch (e) {
53
- reject(e);
54
- }
55
- };
56
- var rejected = (value) => {
57
- try {
58
- step(generator.throw(value));
59
- } catch (e) {
60
- reject(e);
61
- }
62
- };
63
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
64
- step((generator = generator.apply(__this, __arguments)).next());
65
- });
66
- };
67
29
 
68
30
  // src/provider.ts
69
31
  var provider_exports = {};
@@ -285,7 +247,7 @@ var headerSlice = (0, import_toolkit5.createSlice)({
285
247
  },
286
248
  reducers: {
287
249
  setHeader: (state, action) => {
288
- state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
250
+ state.value = { ...state.value, ...action.payload };
289
251
  },
290
252
  setAllowedCompanyIds: (state, action) => {
291
253
  state.value.allowedCompanyIds = action.payload;
@@ -1809,6 +1771,22 @@ var PyRelativeDelta = class _PyRelativeDelta {
1809
1771
  this.microsecond = params.microsecond;
1810
1772
  this.weekday = params.weekday;
1811
1773
  }
1774
+ years;
1775
+ months;
1776
+ days;
1777
+ hours;
1778
+ minutes;
1779
+ seconds;
1780
+ microseconds;
1781
+ leapDays;
1782
+ year;
1783
+ month;
1784
+ day;
1785
+ hour;
1786
+ minute;
1787
+ second;
1788
+ microsecond;
1789
+ weekday;
1812
1790
  negate() {
1813
1791
  return new _PyRelativeDelta(this, -1);
1814
1792
  }
@@ -1923,7 +1901,7 @@ function execOnIterable(iterable, func) {
1923
1901
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1924
1902
  iterable = Object.keys(iterable);
1925
1903
  }
1926
- if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1904
+ if (typeof iterable?.[Symbol.iterator] !== "function") {
1927
1905
  throw new EvaluationError("value not iterable");
1928
1906
  }
1929
1907
  return func(iterable);
@@ -2246,7 +2224,7 @@ function applyBinaryOp(ast, context) {
2246
2224
  }
2247
2225
  return Math.floor(left / right);
2248
2226
  case "**":
2249
- return __pow(left, right);
2227
+ return left ** right;
2250
2228
  case "==":
2251
2229
  return isEqual(left, right);
2252
2230
  case "<>":
@@ -2368,7 +2346,7 @@ function evaluate(ast, context = {}) {
2368
2346
  const dicts = /* @__PURE__ */ new Set();
2369
2347
  let pyContext;
2370
2348
  const evalContext = Object.create(context);
2371
- if (!(evalContext == null ? void 0 : evalContext.context)) {
2349
+ if (!evalContext?.context) {
2372
2350
  Object.defineProperty(evalContext, "context", {
2373
2351
  get() {
2374
2352
  if (!pyContext) {
@@ -2379,18 +2357,17 @@ function evaluate(ast, context = {}) {
2379
2357
  });
2380
2358
  }
2381
2359
  function _innerEvaluate(ast2) {
2382
- var _a, _b, _c;
2383
- switch (ast2 == null ? void 0 : ast2.type) {
2360
+ switch (ast2?.type) {
2384
2361
  case 0:
2385
2362
  // Number
2386
2363
  case 1:
2387
2364
  return ast2.value;
2388
2365
  case 5:
2389
2366
  if (ast2.value in evalContext) {
2390
- if (typeof evalContext[ast2.value] === "object" && ((_a = evalContext[ast2.value]) == null ? void 0 : _a.id)) {
2391
- return (_b = evalContext[ast2.value]) == null ? void 0 : _b.id;
2367
+ if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
2368
+ return evalContext[ast2.value]?.id;
2392
2369
  }
2393
- return (_c = evalContext[ast2.value]) != null ? _c : false;
2370
+ return evalContext[ast2.value] ?? false;
2394
2371
  } else if (ast2.value in BUILTINS) {
2395
2372
  return BUILTINS[ast2.value];
2396
2373
  } else {
@@ -2427,7 +2404,7 @@ function evaluate(ast, context = {}) {
2427
2404
  const args = ast2.args.map(_evaluate);
2428
2405
  const kwargs = {};
2429
2406
  for (const kwarg in ast2.kwargs) {
2430
- kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
2407
+ kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
2431
2408
  }
2432
2409
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
2433
2410
  return fnValue.create(...args, kwargs);
@@ -2506,25 +2483,9 @@ function escapeRegExp(str) {
2506
2483
  var InvalidDomainError = class extends Error {
2507
2484
  };
2508
2485
  var Domain = class _Domain {
2509
- constructor(descr = []) {
2510
- this.ast = { type: -1, value: null };
2511
- if (descr instanceof _Domain) {
2512
- return new _Domain(descr.toString());
2513
- } else {
2514
- let rawAST;
2515
- try {
2516
- rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2517
- } catch (error) {
2518
- throw new InvalidDomainError(
2519
- `Invalid domain representation: ${descr}`,
2520
- {
2521
- cause: error
2522
- }
2523
- );
2524
- }
2525
- this.ast = normalizeDomainAST(rawAST);
2526
- }
2527
- }
2486
+ ast = { type: -1, value: null };
2487
+ static TRUE;
2488
+ static FALSE;
2528
2489
  static combine(domains, operator) {
2529
2490
  if (domains.length === 0) {
2530
2491
  return new _Domain([]);
@@ -2603,6 +2564,24 @@ var Domain = class _Domain {
2603
2564
  processLeaf(d.ast.value, 0, "&", newDomain);
2604
2565
  return newDomain;
2605
2566
  }
2567
+ constructor(descr = []) {
2568
+ if (descr instanceof _Domain) {
2569
+ return new _Domain(descr.toString());
2570
+ } else {
2571
+ let rawAST;
2572
+ try {
2573
+ rawAST = typeof descr === "string" ? parseExpr(descr) : toAST(descr);
2574
+ } catch (error) {
2575
+ throw new InvalidDomainError(
2576
+ `Invalid domain representation: ${descr}`,
2577
+ {
2578
+ cause: error
2579
+ }
2580
+ );
2581
+ }
2582
+ this.ast = normalizeDomainAST(rawAST);
2583
+ }
2584
+ }
2606
2585
  contains(record) {
2607
2586
  const expr = evaluate(this.ast, record);
2608
2587
  return matchDomain(record, expr);
@@ -2621,7 +2600,7 @@ var Domain = class _Domain {
2621
2600
  return evaluatedAsList;
2622
2601
  }
2623
2602
  return this.toString();
2624
- } catch (e) {
2603
+ } catch {
2625
2604
  return this.toString();
2626
2605
  }
2627
2606
  }
@@ -2844,22 +2823,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2844
2823
 
2845
2824
  // src/utils/storage/local-storage.ts
2846
2825
  var localStorageUtils = () => {
2847
- const setToken = (access_token) => __async(null, null, function* () {
2826
+ const setToken = async (access_token) => {
2848
2827
  localStorage.setItem("accessToken", access_token);
2849
- });
2850
- const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2828
+ };
2829
+ const setRefreshToken = async (refresh_token) => {
2851
2830
  localStorage.setItem("refreshToken", refresh_token);
2852
- });
2853
- const getAccessToken = () => __async(null, null, function* () {
2831
+ };
2832
+ const getAccessToken = async () => {
2854
2833
  return localStorage.getItem("accessToken");
2855
- });
2856
- const getRefreshToken = () => __async(null, null, function* () {
2834
+ };
2835
+ const getRefreshToken = async () => {
2857
2836
  return localStorage.getItem("refreshToken");
2858
- });
2859
- const clearToken = () => __async(null, null, function* () {
2837
+ };
2838
+ const clearToken = async () => {
2860
2839
  localStorage.removeItem("accessToken");
2861
2840
  localStorage.removeItem("refreshToken");
2862
- });
2841
+ };
2863
2842
  return {
2864
2843
  setToken,
2865
2844
  setRefreshToken,
@@ -2871,9 +2850,9 @@ var localStorageUtils = () => {
2871
2850
 
2872
2851
  // src/utils/storage/session-storage.ts
2873
2852
  var sessionStorageUtils = () => {
2874
- const getBrowserSession = () => __async(null, null, function* () {
2853
+ const getBrowserSession = async () => {
2875
2854
  return sessionStorage.getItem("browserSession");
2876
- });
2855
+ };
2877
2856
  return {
2878
2857
  getBrowserSession
2879
2858
  };
@@ -2882,14 +2861,13 @@ var sessionStorageUtils = () => {
2882
2861
  // src/configs/axios-client.ts
2883
2862
  var axiosClient = {
2884
2863
  init(config) {
2885
- var _a, _b;
2886
- const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2887
- const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2864
+ const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2865
+ const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2888
2866
  const db = config.db;
2889
2867
  let isRefreshing = false;
2890
2868
  let failedQueue = [];
2891
2869
  const processQueue = (error, token = null) => {
2892
- failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2870
+ failedQueue?.forEach((prom) => {
2893
2871
  if (error) {
2894
2872
  prom.reject(error);
2895
2873
  } else {
@@ -2905,14 +2883,14 @@ var axiosClient = {
2905
2883
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2906
2884
  });
2907
2885
  instance.interceptors.request.use(
2908
- (config2) => __async(null, null, function* () {
2886
+ async (config2) => {
2909
2887
  const useRefreshToken = config2.useRefreshToken;
2910
- const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2888
+ const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2911
2889
  if (token) {
2912
2890
  config2.headers["Authorization"] = "Bearer " + token;
2913
2891
  }
2914
2892
  return config2;
2915
- }),
2893
+ },
2916
2894
  (error) => {
2917
2895
  Promise.reject(error);
2918
2896
  }
@@ -2921,21 +2899,19 @@ var axiosClient = {
2921
2899
  (response) => {
2922
2900
  return handleResponse(response);
2923
2901
  },
2924
- (error) => __async(null, null, function* () {
2925
- var _a2, _b2, _c;
2926
- const handleError3 = (error2) => __async(null, null, function* () {
2927
- var _a3;
2902
+ async (error) => {
2903
+ const handleError3 = async (error2) => {
2928
2904
  if (!error2.response) {
2929
2905
  return error2;
2930
2906
  }
2931
2907
  const { data } = error2.response;
2932
- if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2933
- yield clearAuthToken();
2908
+ if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2909
+ await clearAuthToken();
2934
2910
  }
2935
2911
  return data;
2936
- });
2912
+ };
2937
2913
  const originalRequest = error.config;
2938
- if ((((_a2 = error.response) == null ? void 0 : _a2.status) === 403 || ((_b2 = error.response) == null ? void 0 : _b2.status) === 401 || ((_c = error.response) == null ? void 0 : _c.status) === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2914
+ if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
2939
2915
  error.response.data.code
2940
2916
  )) {
2941
2917
  if (isRefreshing) {
@@ -2948,19 +2924,18 @@ var axiosClient = {
2948
2924
  token
2949
2925
  );
2950
2926
  return instance.request(originalRequest);
2951
- }).catch((err) => __async(null, null, function* () {
2952
- var _a3, _b3;
2953
- if ((((_a3 = err.response) == null ? void 0 : _a3.status) === 400 || ((_b3 = err.response) == null ? void 0 : _b3.status) === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2954
- yield clearAuthToken();
2927
+ }).catch(async (err) => {
2928
+ if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2929
+ await clearAuthToken();
2955
2930
  }
2956
- }));
2931
+ });
2957
2932
  }
2958
- const browserSession = yield sessionStorage2.getBrowserSession();
2959
- const refreshToken = yield localStorage2.getRefreshToken();
2960
- const accessTokenExp = yield localStorage2.getAccessToken();
2933
+ const browserSession = await sessionStorage2.getBrowserSession();
2934
+ const refreshToken = await localStorage2.getRefreshToken();
2935
+ const accessTokenExp = await localStorage2.getAccessToken();
2961
2936
  isRefreshing = true;
2962
2937
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2963
- yield clearAuthToken();
2938
+ await clearAuthToken();
2964
2939
  } else {
2965
2940
  const payload = Object.fromEntries(
2966
2941
  Object.entries({
@@ -2971,9 +2946,8 @@ var axiosClient = {
2971
2946
  }).filter(([_, value]) => !!value)
2972
2947
  );
2973
2948
  return new Promise(function(resolve) {
2974
- var _a3;
2975
2949
  import_axios.default.post(
2976
- `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2950
+ `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2977
2951
  payload,
2978
2952
  {
2979
2953
  headers: {
@@ -2981,10 +2955,10 @@ var axiosClient = {
2981
2955
  Authorization: `Bearer ${accessTokenExp}`
2982
2956
  }
2983
2957
  }
2984
- ).then((res) => __async(null, null, function* () {
2958
+ ).then(async (res) => {
2985
2959
  const data = res.data;
2986
- yield localStorage2.setToken(data.access_token);
2987
- yield localStorage2.setRefreshToken(data.refresh_token);
2960
+ await localStorage2.setToken(data.access_token);
2961
+ await localStorage2.setRefreshToken(data.refresh_token);
2988
2962
  import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2989
2963
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2990
2964
  originalRequest.data = updateTokenParamInOriginalRequest(
@@ -2993,26 +2967,25 @@ var axiosClient = {
2993
2967
  );
2994
2968
  processQueue(null, data.access_token);
2995
2969
  resolve(instance.request(originalRequest));
2996
- })).catch((err) => __async(null, null, function* () {
2997
- var _a4;
2998
- if (err && ((err == null ? void 0 : err.error_code) === "AUTHEN_FAIL" || (err == null ? void 0 : err.error_code) === "TOKEN_EXPIRED" || (err == null ? void 0 : err.error_code) === "TOKEN_INCORRECT" || (err == null ? void 0 : err.code) === "ERR_BAD_REQUEST") || (err == null ? void 0 : err.error_code) === "ERR_2FA_006") {
2999
- yield clearAuthToken();
2970
+ }).catch(async (err) => {
2971
+ if (err && (err?.error_code === "AUTHEN_FAIL" || err?.error_code === "TOKEN_EXPIRED" || err?.error_code === "TOKEN_INCORRECT" || err?.code === "ERR_BAD_REQUEST") || err?.error_code === "ERR_2FA_006") {
2972
+ await clearAuthToken();
3000
2973
  }
3001
2974
  if (err && err.response) {
3002
- const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2975
+ const { error_code } = err.response?.data || {};
3003
2976
  if (error_code === "AUTHEN_FAIL") {
3004
- yield clearAuthToken();
2977
+ await clearAuthToken();
3005
2978
  }
3006
2979
  }
3007
2980
  processQueue(err, null);
3008
- })).finally(() => {
2981
+ }).finally(() => {
3009
2982
  isRefreshing = false;
3010
2983
  });
3011
2984
  });
3012
2985
  }
3013
2986
  }
3014
- return Promise.reject(yield handleError3(error));
3015
- })
2987
+ return Promise.reject(await handleError3(error));
2988
+ }
3016
2989
  );
3017
2990
  const handleResponse = (res) => {
3018
2991
  if (res && res.data) {
@@ -3021,7 +2994,6 @@ var axiosClient = {
3021
2994
  return res;
3022
2995
  };
3023
2996
  const handleError2 = (error) => {
3024
- var _a2, _b2, _c;
3025
2997
  if (error.isAxiosError && error.code === "ECONNABORTED") {
3026
2998
  console.error("Request Timeout Error:", error);
3027
2999
  return "Request Timeout Error";
@@ -3029,17 +3001,17 @@ var axiosClient = {
3029
3001
  console.error("Network Error:", error);
3030
3002
  return "Network Error";
3031
3003
  } else {
3032
- console.error("Other Error:", error == null ? void 0 : error.response);
3033
- const errorMessage = ((_b2 = (_a2 = error == null ? void 0 : error.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || "An error occurred";
3034
- return { message: errorMessage, status: (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.status };
3004
+ console.error("Other Error:", error?.response);
3005
+ const errorMessage = error?.response?.data?.message || "An error occurred";
3006
+ return { message: errorMessage, status: error?.response?.status };
3035
3007
  }
3036
3008
  };
3037
- const clearAuthToken = () => __async(null, null, function* () {
3038
- yield localStorage2.clearToken();
3009
+ const clearAuthToken = async () => {
3010
+ await localStorage2.clearToken();
3039
3011
  if (typeof window !== "undefined") {
3040
3012
  window.location.href = `/login`;
3041
3013
  }
3042
- });
3014
+ };
3043
3015
  function formatUrl(url, db2) {
3044
3016
  return url + (db2 ? "?db=" + db2 : "");
3045
3017
  }
@@ -3064,6 +3036,18 @@ var axiosClient = {
3064
3036
 
3065
3037
  // src/environment/EnvStore.ts
3066
3038
  var EnvStore = class {
3039
+ envStore;
3040
+ baseUrl;
3041
+ requests;
3042
+ context;
3043
+ defaultCompany;
3044
+ config;
3045
+ companies;
3046
+ user;
3047
+ db;
3048
+ localStorageUtils;
3049
+ sessionStorageUtils;
3050
+ refreshTokenEndpoint;
3067
3051
  constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3068
3052
  this.envStore = envStore2;
3069
3053
  this.localStorageUtils = localStorageUtils2;
@@ -3072,24 +3056,25 @@ var EnvStore = class {
3072
3056
  }
3073
3057
  setup() {
3074
3058
  const env2 = this.envStore.getState().env;
3075
- this.baseUrl = env2 == null ? void 0 : env2.baseUrl;
3076
- this.requests = env2 == null ? void 0 : env2.requests;
3077
- this.context = env2 == null ? void 0 : env2.context;
3078
- this.defaultCompany = env2 == null ? void 0 : env2.defaultCompany;
3079
- this.config = env2 == null ? void 0 : env2.config;
3080
- this.companies = (env2 == null ? void 0 : env2.companies) || [];
3081
- this.user = env2 == null ? void 0 : env2.user;
3082
- this.db = env2 == null ? void 0 : env2.db;
3083
- this.refreshTokenEndpoint = env2 == null ? void 0 : env2.refreshTokenEndpoint;
3059
+ this.baseUrl = env2?.baseUrl;
3060
+ this.requests = env2?.requests;
3061
+ this.context = env2?.context;
3062
+ this.defaultCompany = env2?.defaultCompany;
3063
+ this.config = env2?.config;
3064
+ this.companies = env2?.companies || [];
3065
+ this.user = env2?.user;
3066
+ this.db = env2?.db;
3067
+ this.refreshTokenEndpoint = env2?.refreshTokenEndpoint;
3084
3068
  }
3085
3069
  setupEnv(envConfig) {
3086
3070
  const dispatch = this.envStore.dispatch;
3087
- const env2 = __spreadProps(__spreadValues({}, envConfig), {
3071
+ const env2 = {
3072
+ ...envConfig,
3088
3073
  localStorageUtils: this.localStorageUtils,
3089
3074
  sessionStorageUtils: this.sessionStorageUtils
3090
- });
3075
+ };
3091
3076
  const requests = axiosClient.init(env2);
3092
- dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3077
+ dispatch(setEnv({ ...env2, requests }));
3093
3078
  this.setup();
3094
3079
  }
3095
3080
  setUid(uid) {
@@ -3132,482 +3117,445 @@ function getEnv() {
3132
3117
 
3133
3118
  // src/services/view-service/index.ts
3134
3119
  var ViewService = {
3135
- getView(_0) {
3136
- return __async(this, arguments, function* ({
3120
+ async getView({
3121
+ model,
3122
+ views,
3123
+ context = {},
3124
+ options = {},
3125
+ aid
3126
+ }) {
3127
+ const env2 = getEnv();
3128
+ const defaultOptions = {
3129
+ load_filters: true,
3130
+ toolbar: true,
3131
+ action_id: aid
3132
+ };
3133
+ const jsonDataView = {
3137
3134
  model,
3138
- views,
3139
- context = {},
3140
- options = {},
3141
- aid
3142
- }) {
3143
- var _a;
3144
- const env2 = getEnv();
3145
- const defaultOptions = {
3146
- load_filters: true,
3147
- toolbar: true,
3148
- action_id: aid
3149
- };
3150
- const jsonDataView = {
3151
- model,
3152
- method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3153
- kwargs: {
3154
- views,
3155
- options: __spreadValues(__spreadValues({}, options), defaultOptions)
3156
- },
3157
- with_context: context
3158
- };
3159
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonDataView, {
3160
- headers: {
3161
- "Content-Type": "application/json"
3162
- }
3163
- });
3135
+ method: "get_fields_view_v2" /* GET_FIELD_VIEW */,
3136
+ kwargs: {
3137
+ views,
3138
+ options: { ...options, ...defaultOptions }
3139
+ },
3140
+ with_context: context
3141
+ };
3142
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
3143
+ headers: {
3144
+ "Content-Type": "application/json"
3145
+ }
3164
3146
  });
3165
3147
  },
3166
- getMenu(context) {
3167
- return __async(this, null, function* () {
3168
- var _a;
3169
- const env2 = getEnv();
3170
- const jsonData = {
3171
- model: "ir.ui.menu" /* MENU */,
3172
- method: "web_search_read" /* WEB_SEARCH_READ */,
3173
- ids: [],
3174
- with_context: context,
3175
- kwargs: {
3176
- specification: {
3177
- active: {},
3178
- name: {},
3179
- is_display: {},
3180
- sequence: {},
3181
- complete_name: {},
3182
- action: {
3183
- fields: {
3184
- display_name: {},
3185
- type: {},
3186
- binding_view_types: {}
3187
- // res_model: {},
3188
- }
3148
+ async getMenu(context) {
3149
+ const env2 = getEnv();
3150
+ const jsonData = {
3151
+ model: "ir.ui.menu" /* MENU */,
3152
+ method: "web_search_read" /* WEB_SEARCH_READ */,
3153
+ ids: [],
3154
+ with_context: context,
3155
+ kwargs: {
3156
+ specification: {
3157
+ active: {},
3158
+ name: {},
3159
+ is_display: {},
3160
+ sequence: {},
3161
+ complete_name: {},
3162
+ action: {
3163
+ fields: {
3164
+ display_name: {},
3165
+ type: {},
3166
+ binding_view_types: {}
3167
+ // res_model: {},
3168
+ }
3169
+ },
3170
+ url_icon: {},
3171
+ web_icon: {},
3172
+ web_icon_data: {},
3173
+ groups_id: {
3174
+ fields: {
3175
+ full_name: {}
3189
3176
  },
3190
- url_icon: {},
3191
- web_icon: {},
3192
- web_icon_data: {},
3193
- groups_id: {
3194
- fields: {
3195
- full_name: {}
3177
+ limit: 40,
3178
+ order: ""
3179
+ },
3180
+ display_name: {},
3181
+ child_id: {
3182
+ fields: {
3183
+ active: {},
3184
+ name: {},
3185
+ is_display: {},
3186
+ sequence: {},
3187
+ complete_name: {},
3188
+ action: {
3189
+ fields: {
3190
+ display_name: {},
3191
+ type: {},
3192
+ binding_view_types: {}
3193
+ // res_model: {},
3194
+ }
3196
3195
  },
3197
- limit: 40,
3198
- order: ""
3199
- },
3200
- display_name: {},
3201
- child_id: {
3202
- fields: {
3203
- active: {},
3204
- name: {},
3205
- is_display: {},
3206
- sequence: {},
3207
- complete_name: {},
3208
- action: {
3209
- fields: {
3210
- display_name: {},
3211
- type: {},
3212
- binding_view_types: {}
3213
- // res_model: {},
3214
- }
3196
+ url_icon: {},
3197
+ web_icon: {},
3198
+ web_icon_data: {},
3199
+ groups_id: {
3200
+ fields: {
3201
+ full_name: {}
3215
3202
  },
3216
- url_icon: {},
3217
- web_icon: {},
3218
- web_icon_data: {},
3219
- groups_id: {
3220
- fields: {
3221
- full_name: {}
3203
+ limit: 40,
3204
+ order: ""
3205
+ },
3206
+ display_name: {},
3207
+ child_id: {
3208
+ fields: {
3209
+ active: {},
3210
+ name: {},
3211
+ is_display: {},
3212
+ sequence: {},
3213
+ complete_name: {},
3214
+ action: {
3215
+ fields: {
3216
+ display_name: {},
3217
+ type: {},
3218
+ binding_view_types: {}
3219
+ // res_model: {},
3220
+ }
3222
3221
  },
3223
- limit: 40,
3224
- order: ""
3225
- },
3226
- display_name: {},
3227
- child_id: {
3228
- fields: {
3229
- active: {},
3230
- name: {},
3231
- is_display: {},
3232
- sequence: {},
3233
- complete_name: {},
3234
- action: {
3235
- fields: {
3236
- display_name: {},
3237
- type: {},
3238
- binding_view_types: {}
3239
- // res_model: {},
3240
- }
3222
+ url_icon: {},
3223
+ web_icon: {},
3224
+ web_icon_data: {},
3225
+ groups_id: {
3226
+ fields: {
3227
+ full_name: {}
3241
3228
  },
3242
- url_icon: {},
3243
- web_icon: {},
3244
- web_icon_data: {},
3245
- groups_id: {
3246
- fields: {
3247
- full_name: {}
3229
+ limit: 40,
3230
+ order: ""
3231
+ },
3232
+ display_name: {},
3233
+ child_id: {
3234
+ fields: {
3235
+ active: {},
3236
+ name: {},
3237
+ is_display: {},
3238
+ sequence: {},
3239
+ complete_name: {},
3240
+ action: {
3241
+ fields: {
3242
+ display_name: {},
3243
+ type: {},
3244
+ binding_view_types: {}
3245
+ // res_model: {},
3246
+ }
3248
3247
  },
3249
- limit: 40,
3250
- order: ""
3251
- },
3252
- display_name: {},
3253
- child_id: {
3254
- fields: {
3255
- active: {},
3256
- name: {},
3257
- is_display: {},
3258
- sequence: {},
3259
- complete_name: {},
3260
- action: {
3261
- fields: {
3262
- display_name: {},
3263
- type: {},
3264
- binding_view_types: {}
3265
- // res_model: {},
3266
- }
3267
- },
3268
- url_icon: {},
3269
- web_icon: {},
3270
- web_icon_data: {},
3271
- groups_id: {
3272
- fields: {
3273
- full_name: {}
3274
- },
3275
- limit: 40,
3276
- order: ""
3248
+ url_icon: {},
3249
+ web_icon: {},
3250
+ web_icon_data: {},
3251
+ groups_id: {
3252
+ fields: {
3253
+ full_name: {}
3277
3254
  },
3278
- display_name: {},
3279
- child_id: {
3280
- fields: {},
3281
- limit: 40,
3282
- order: ""
3283
- }
3255
+ limit: 40,
3256
+ order: ""
3284
3257
  },
3285
- limit: 40,
3286
- order: ""
3287
- }
3288
- },
3289
- limit: 40,
3290
- order: ""
3291
- }
3292
- },
3293
- limit: 40,
3294
- order: ""
3295
- }
3296
- },
3297
- domain: [
3298
- "&",
3299
- ["is_display", "=", true],
3300
- "&",
3301
- ["active", "=", true],
3302
- ["parent_id", "=", false]
3303
- ]
3304
- }
3305
- };
3306
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3307
- headers: {
3308
- "Content-Type": "application/json"
3309
- }
3310
- });
3258
+ display_name: {},
3259
+ child_id: {
3260
+ fields: {},
3261
+ limit: 40,
3262
+ order: ""
3263
+ }
3264
+ },
3265
+ limit: 40,
3266
+ order: ""
3267
+ }
3268
+ },
3269
+ limit: 40,
3270
+ order: ""
3271
+ }
3272
+ },
3273
+ limit: 40,
3274
+ order: ""
3275
+ }
3276
+ },
3277
+ domain: [
3278
+ "&",
3279
+ ["is_display", "=", true],
3280
+ "&",
3281
+ ["active", "=", true],
3282
+ ["parent_id", "=", false]
3283
+ ]
3284
+ }
3285
+ };
3286
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3287
+ headers: {
3288
+ "Content-Type": "application/json"
3289
+ }
3311
3290
  });
3312
3291
  },
3313
- getActionDetail(aid, context) {
3314
- return __async(this, null, function* () {
3315
- var _a;
3316
- const env2 = getEnv();
3317
- const jsonData = {
3318
- model: "ir.actions.act_window" /* WINDOW_ACTION */,
3319
- method: "web_read" /* WEB_READ */,
3320
- ids: [aid],
3321
- with_context: context,
3322
- kwargs: {
3323
- specification: {
3324
- id: {},
3325
- name: {},
3326
- res_model: {},
3327
- views: {},
3328
- view_mode: {},
3329
- mobile_view_mode: {},
3330
- domain: {},
3331
- context: {},
3332
- groups_id: {},
3333
- search_view_id: {}
3334
- }
3292
+ async getActionDetail(aid, context) {
3293
+ const env2 = getEnv();
3294
+ const jsonData = {
3295
+ model: "ir.actions.act_window" /* WINDOW_ACTION */,
3296
+ method: "web_read" /* WEB_READ */,
3297
+ ids: [aid],
3298
+ with_context: context,
3299
+ kwargs: {
3300
+ specification: {
3301
+ id: {},
3302
+ name: {},
3303
+ res_model: {},
3304
+ views: {},
3305
+ view_mode: {},
3306
+ mobile_view_mode: {},
3307
+ domain: {},
3308
+ context: {},
3309
+ groups_id: {},
3310
+ search_view_id: {}
3335
3311
  }
3336
- };
3337
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.post("/call" /* CALL_PATH */, jsonData, {
3338
- headers: {
3339
- "Content-Type": "application/json"
3340
- }
3341
- });
3312
+ }
3313
+ };
3314
+ return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3315
+ headers: {
3316
+ "Content-Type": "application/json"
3317
+ }
3342
3318
  });
3343
3319
  },
3344
- getResequence(_0) {
3345
- return __async(this, arguments, function* ({
3320
+ async getResequence({
3321
+ model,
3322
+ ids,
3323
+ context,
3324
+ offset
3325
+ }) {
3326
+ const env2 = getEnv();
3327
+ const jsonData = {
3346
3328
  model,
3329
+ with_context: context,
3347
3330
  ids,
3348
- context,
3349
- offset
3350
- }) {
3351
- const env2 = getEnv();
3352
- const jsonData = __spreadValues({
3353
- model,
3354
- with_context: context,
3355
- ids,
3356
- field: "sequence"
3357
- }, offset > 0 ? { offset } : {});
3358
- return env2 == null ? void 0 : env2.requests.post("/web/dataset/resequence", jsonData, {
3359
- headers: {
3360
- "Content-Type": "application/json"
3361
- }
3362
- });
3363
- });
3364
- },
3365
- getSelectionItem(_0) {
3366
- return __async(this, arguments, function* ({ data }) {
3367
- var _a;
3368
- const env2 = getEnv();
3369
- const jsonData = {
3370
- model: data.model,
3371
- ids: [],
3372
- method: "get_data_select",
3373
- with_context: data.context,
3374
- kwargs: {
3375
- count_limit: 10001,
3376
- domain: data.domain ? data.domain : [],
3377
- offset: 0,
3378
- order: "",
3379
- specification: (_a = data == null ? void 0 : data.specification) != null ? _a : {
3380
- id: {},
3381
- name: {},
3382
- display_name: {}
3383
- }
3384
- }
3385
- };
3386
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3387
- headers: {
3388
- "Content-Type": "application/json"
3389
- }
3390
- });
3331
+ field: "sequence",
3332
+ ...offset > 0 ? { offset } : {}
3333
+ };
3334
+ return env2?.requests.post("/web/dataset/resequence", jsonData, {
3335
+ headers: {
3336
+ "Content-Type": "application/json"
3337
+ }
3391
3338
  });
3392
3339
  },
3393
- loadMessages() {
3394
- return __async(this, null, function* () {
3395
- const env2 = getEnv();
3396
- return env2.requests.post(
3397
- "/load_message_failures" /* LOAD_MESSAGE */,
3398
- {},
3399
- {
3400
- headers: {
3401
- "Content-Type": "application/json"
3402
- }
3340
+ async getSelectionItem({ data }) {
3341
+ const env2 = getEnv();
3342
+ const jsonData = {
3343
+ model: data.model,
3344
+ ids: [],
3345
+ method: "get_data_select",
3346
+ with_context: data.context,
3347
+ kwargs: {
3348
+ count_limit: 10001,
3349
+ domain: data.domain ? data.domain : [],
3350
+ offset: 0,
3351
+ order: "",
3352
+ specification: data?.specification ?? {
3353
+ id: {},
3354
+ name: {},
3355
+ display_name: {}
3403
3356
  }
3404
- );
3357
+ }
3358
+ };
3359
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3360
+ headers: {
3361
+ "Content-Type": "application/json"
3362
+ }
3405
3363
  });
3406
3364
  },
3407
- getVersion() {
3408
- return __async(this, null, function* () {
3409
- var _a;
3410
- const env2 = getEnv();
3411
- console.log("env?.requests", env2, env2 == null ? void 0 : env2.requests);
3412
- return (_a = env2 == null ? void 0 : env2.requests) == null ? void 0 : _a.get("", {
3365
+ async loadMessages() {
3366
+ const env2 = getEnv();
3367
+ return env2.requests.post(
3368
+ "/load_message_failures" /* LOAD_MESSAGE */,
3369
+ {},
3370
+ {
3413
3371
  headers: {
3414
3372
  "Content-Type": "application/json"
3415
3373
  }
3416
- });
3374
+ }
3375
+ );
3376
+ },
3377
+ async getVersion() {
3378
+ const env2 = getEnv();
3379
+ return env2?.requests.get("", {
3380
+ headers: {
3381
+ "Content-Type": "application/json"
3382
+ }
3417
3383
  });
3418
3384
  },
3419
- get2FAMethods(_0) {
3420
- return __async(this, arguments, function* ({
3385
+ async get2FAMethods({
3386
+ method,
3387
+ with_context
3388
+ }) {
3389
+ const env2 = getEnv();
3390
+ const jsonData = {
3421
3391
  method,
3422
3392
  with_context
3423
- }) {
3424
- const env2 = getEnv();
3425
- const jsonData = {
3426
- method,
3427
- with_context
3428
- };
3429
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3430
- headers: {
3431
- "Content-Type": "application/json"
3432
- }
3433
- });
3393
+ };
3394
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3395
+ headers: {
3396
+ "Content-Type": "application/json"
3397
+ }
3434
3398
  });
3435
3399
  },
3436
- verify2FA(_0) {
3437
- return __async(this, arguments, function* ({
3400
+ async verify2FA({
3401
+ method,
3402
+ with_context,
3403
+ code,
3404
+ device,
3405
+ location
3406
+ }) {
3407
+ const env2 = getEnv();
3408
+ const jsonData = {
3438
3409
  method,
3439
- with_context,
3440
- code,
3441
- device,
3442
- location
3443
- }) {
3444
- const env2 = getEnv();
3445
- const jsonData = {
3446
- method,
3447
- kwargs: {
3448
- vals: {
3449
- code,
3450
- device,
3451
- location
3452
- }
3453
- },
3454
- with_context
3455
- };
3456
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3457
- headers: {
3458
- "Content-Type": "application/json"
3459
- },
3460
- withCredentials: true
3461
- });
3410
+ kwargs: {
3411
+ vals: {
3412
+ code,
3413
+ device,
3414
+ location
3415
+ }
3416
+ },
3417
+ with_context
3418
+ };
3419
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3420
+ headers: {
3421
+ "Content-Type": "application/json"
3422
+ },
3423
+ withCredentials: true
3462
3424
  });
3463
3425
  },
3464
- signInSSO(_0) {
3465
- return __async(this, arguments, function* ({
3466
- redirect_uri,
3467
- state,
3468
- client_id,
3426
+ async signInSSO({
3427
+ redirect_uri,
3428
+ state,
3429
+ client_id,
3430
+ response_type,
3431
+ path
3432
+ }) {
3433
+ const env2 = getEnv();
3434
+ const params = new URLSearchParams({
3469
3435
  response_type,
3470
- path
3471
- }) {
3472
- const env2 = getEnv();
3473
- const params = new URLSearchParams({
3474
- response_type,
3475
- client_id,
3476
- redirect_uri,
3477
- state
3478
- });
3479
- const url = `${path}?${params.toString()}`;
3480
- return env2 == null ? void 0 : env2.requests.get(url, {
3481
- headers: {
3482
- "Content-Type": "application/json"
3483
- },
3484
- withCredentials: true
3485
- });
3436
+ client_id,
3437
+ redirect_uri,
3438
+ state
3439
+ });
3440
+ const url = `${path}?${params.toString()}`;
3441
+ return env2?.requests.get(url, {
3442
+ headers: {
3443
+ "Content-Type": "application/json"
3444
+ },
3445
+ withCredentials: true
3486
3446
  });
3487
3447
  },
3488
- grantAccess(_0) {
3489
- return __async(this, arguments, function* ({
3448
+ async grantAccess({
3449
+ redirect_uri,
3450
+ state,
3451
+ client_id,
3452
+ scopes
3453
+ }) {
3454
+ const env2 = getEnv();
3455
+ const jsonData = {
3490
3456
  redirect_uri,
3491
3457
  state,
3492
3458
  client_id,
3493
3459
  scopes
3494
- }) {
3495
- const env2 = getEnv();
3496
- const jsonData = {
3497
- redirect_uri,
3498
- state,
3499
- client_id,
3500
- scopes
3501
- };
3502
- return env2 == null ? void 0 : env2.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3503
- headers: {
3504
- "Content-Type": "application/json"
3505
- },
3506
- withCredentials: true
3507
- });
3460
+ };
3461
+ return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3462
+ headers: {
3463
+ "Content-Type": "application/json"
3464
+ },
3465
+ withCredentials: true
3508
3466
  });
3509
3467
  },
3510
- getFieldsViewSecurity(_0) {
3511
- return __async(this, arguments, function* ({
3468
+ async getFieldsViewSecurity({
3469
+ method,
3470
+ token,
3471
+ views
3472
+ }) {
3473
+ const env2 = getEnv();
3474
+ const jsonData = {
3512
3475
  method,
3513
- token,
3514
- views
3515
- }) {
3516
- const env2 = getEnv();
3517
- const jsonData = {
3518
- method,
3519
- kwargs: {
3520
- views
3521
- },
3522
- with_context: {
3523
- token
3524
- }
3525
- };
3526
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3527
- headers: {
3528
- "Content-Type": "application/json"
3529
- }
3530
- });
3476
+ kwargs: {
3477
+ views
3478
+ },
3479
+ with_context: {
3480
+ token
3481
+ }
3482
+ };
3483
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3484
+ headers: {
3485
+ "Content-Type": "application/json"
3486
+ }
3531
3487
  });
3532
3488
  },
3533
- settingsWebRead2fa(_0) {
3534
- return __async(this, arguments, function* ({
3489
+ async settingsWebRead2fa({
3490
+ method,
3491
+ model,
3492
+ kwargs,
3493
+ token
3494
+ }) {
3495
+ const env2 = getEnv();
3496
+ const jsonData = {
3535
3497
  method,
3536
3498
  model,
3537
3499
  kwargs,
3538
- token
3539
- }) {
3540
- const env2 = getEnv();
3541
- const jsonData = {
3542
- method,
3543
- model,
3544
- kwargs,
3545
- with_context: {
3546
- token
3547
- }
3548
- };
3549
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3550
- headers: {
3551
- "Content-Type": "application/json"
3552
- }
3553
- });
3500
+ with_context: {
3501
+ token
3502
+ }
3503
+ };
3504
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3505
+ headers: {
3506
+ "Content-Type": "application/json"
3507
+ }
3554
3508
  });
3555
3509
  },
3556
- requestSetupTotp(_0) {
3557
- return __async(this, arguments, function* ({ method, token }) {
3558
- const env2 = getEnv();
3559
- const jsonData = {
3560
- method,
3561
- with_context: {
3562
- token
3563
- }
3564
- };
3565
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3566
- headers: {
3567
- "Content-Type": "application/json"
3568
- }
3569
- });
3510
+ async requestSetupTotp({ method, token }) {
3511
+ const env2 = getEnv();
3512
+ const jsonData = {
3513
+ method,
3514
+ with_context: {
3515
+ token
3516
+ }
3517
+ };
3518
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3519
+ headers: {
3520
+ "Content-Type": "application/json"
3521
+ }
3570
3522
  });
3571
3523
  },
3572
- verifyTotp(_0) {
3573
- return __async(this, arguments, function* ({
3524
+ async verifyTotp({
3525
+ method,
3526
+ action_token,
3527
+ code
3528
+ }) {
3529
+ const env2 = getEnv();
3530
+ const jsonData = {
3574
3531
  method,
3575
- action_token,
3576
- code
3577
- }) {
3578
- const env2 = getEnv();
3579
- const jsonData = {
3580
- method,
3581
- kwargs: {
3582
- vals: {
3583
- code
3584
- }
3585
- },
3586
- with_context: {
3587
- action_token
3532
+ kwargs: {
3533
+ vals: {
3534
+ code
3588
3535
  }
3589
- };
3590
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3591
- headers: {
3592
- "Content-Type": "application/json"
3593
- }
3594
- });
3536
+ },
3537
+ with_context: {
3538
+ action_token
3539
+ }
3540
+ };
3541
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3542
+ headers: {
3543
+ "Content-Type": "application/json"
3544
+ }
3595
3545
  });
3596
3546
  },
3597
- removeTotpSetUp(_0) {
3598
- return __async(this, arguments, function* ({ method, token }) {
3599
- const env2 = getEnv();
3600
- const jsonData = {
3601
- method,
3602
- with_context: {
3603
- token
3604
- }
3605
- };
3606
- return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3607
- headers: {
3608
- "Content-Type": "application/json"
3609
- }
3610
- });
3547
+ async removeTotpSetUp({ method, token }) {
3548
+ const env2 = getEnv();
3549
+ const jsonData = {
3550
+ method,
3551
+ with_context: {
3552
+ token
3553
+ }
3554
+ };
3555
+ return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3556
+ headers: {
3557
+ "Content-Type": "application/json"
3558
+ }
3611
3559
  });
3612
3560
  }
3613
3561
  };
@@ -3623,18 +3571,17 @@ var VersionGate = ({ children }) => {
3623
3571
  queryClient.clear();
3624
3572
  localStorage.removeItem("__api_version__");
3625
3573
  };
3626
- const validateVersion = () => __async(null, null, function* () {
3627
- const serverVersion = yield view_service_default.getVersion();
3628
- console.log("serverVersion", serverVersion);
3574
+ const validateVersion = async () => {
3575
+ const serverVersion = await view_service_default.getVersion();
3629
3576
  const cached = localStorage.getItem("__api_version__");
3630
- if (cached !== (serverVersion == null ? void 0 : serverVersion.api_version)) {
3577
+ if (cached !== serverVersion?.api_version) {
3631
3578
  clearVersion();
3632
- localStorage.setItem("__api_version__", serverVersion == null ? void 0 : serverVersion.api_version);
3579
+ localStorage.setItem("__api_version__", serverVersion?.api_version);
3633
3580
  } else {
3634
- console.log("Api version:", serverVersion == null ? void 0 : serverVersion.api_version);
3581
+ console.log("Api version:", serverVersion?.api_version);
3635
3582
  }
3636
3583
  setReady(true);
3637
- });
3584
+ };
3638
3585
  validateVersion();
3639
3586
  if (typeof window !== "undefined") {
3640
3587
  const onKey = (e) => {