@fctc/interface-logic 1.5.2 → 1.5.3

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,10 +1,28 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
9
  var __getProtoOf = Object.getPrototypeOf;
7
10
  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));
8
26
  var __export = (target, all) => {
9
27
  for (var name in all)
10
28
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -26,6 +44,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
44
  mod
27
45
  ));
28
46
  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
+ };
29
67
 
30
68
  // src/provider.ts
31
69
  var provider_exports = {};
@@ -247,7 +285,7 @@ var headerSlice = (0, import_toolkit5.createSlice)({
247
285
  },
248
286
  reducers: {
249
287
  setHeader: (state, action) => {
250
- state.value = { ...state.value, ...action.payload };
288
+ state.value = __spreadValues(__spreadValues({}, state.value), action.payload);
251
289
  },
252
290
  setAllowedCompanyIds: (state, action) => {
253
291
  state.value.allowedCompanyIds = action.payload;
@@ -1771,22 +1809,6 @@ var PyRelativeDelta = class _PyRelativeDelta {
1771
1809
  this.microsecond = params.microsecond;
1772
1810
  this.weekday = params.weekday;
1773
1811
  }
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;
1790
1812
  negate() {
1791
1813
  return new _PyRelativeDelta(this, -1);
1792
1814
  }
@@ -1901,7 +1923,7 @@ function execOnIterable(iterable, func) {
1901
1923
  if (typeof iterable === "object" && !Array.isArray(iterable) && !(iterable instanceof Set)) {
1902
1924
  iterable = Object.keys(iterable);
1903
1925
  }
1904
- if (typeof iterable?.[Symbol.iterator] !== "function") {
1926
+ if (typeof (iterable == null ? void 0 : iterable[Symbol.iterator]) !== "function") {
1905
1927
  throw new EvaluationError("value not iterable");
1906
1928
  }
1907
1929
  return func(iterable);
@@ -2224,7 +2246,7 @@ function applyBinaryOp(ast, context) {
2224
2246
  }
2225
2247
  return Math.floor(left / right);
2226
2248
  case "**":
2227
- return left ** right;
2249
+ return __pow(left, right);
2228
2250
  case "==":
2229
2251
  return isEqual(left, right);
2230
2252
  case "<>":
@@ -2346,7 +2368,7 @@ function evaluate(ast, context = {}) {
2346
2368
  const dicts = /* @__PURE__ */ new Set();
2347
2369
  let pyContext;
2348
2370
  const evalContext = Object.create(context);
2349
- if (!evalContext?.context) {
2371
+ if (!(evalContext == null ? void 0 : evalContext.context)) {
2350
2372
  Object.defineProperty(evalContext, "context", {
2351
2373
  get() {
2352
2374
  if (!pyContext) {
@@ -2357,17 +2379,18 @@ function evaluate(ast, context = {}) {
2357
2379
  });
2358
2380
  }
2359
2381
  function _innerEvaluate(ast2) {
2360
- switch (ast2?.type) {
2382
+ var _a, _b, _c;
2383
+ switch (ast2 == null ? void 0 : ast2.type) {
2361
2384
  case 0:
2362
2385
  // Number
2363
2386
  case 1:
2364
2387
  return ast2.value;
2365
2388
  case 5:
2366
2389
  if (ast2.value in evalContext) {
2367
- if (typeof evalContext[ast2.value] === "object" && evalContext[ast2.value]?.id) {
2368
- return evalContext[ast2.value]?.id;
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;
2369
2392
  }
2370
- return evalContext[ast2.value] ?? false;
2393
+ return (_c = evalContext[ast2.value]) != null ? _c : false;
2371
2394
  } else if (ast2.value in BUILTINS) {
2372
2395
  return BUILTINS[ast2.value];
2373
2396
  } else {
@@ -2404,7 +2427,7 @@ function evaluate(ast, context = {}) {
2404
2427
  const args = ast2.args.map(_evaluate);
2405
2428
  const kwargs = {};
2406
2429
  for (const kwarg in ast2.kwargs) {
2407
- kwargs[kwarg] = _evaluate(ast2?.kwargs[kwarg]);
2430
+ kwargs[kwarg] = _evaluate(ast2 == null ? void 0 : ast2.kwargs[kwarg]);
2408
2431
  }
2409
2432
  if (fnValue === PyDate || fnValue === PyDateTime || fnValue === PyTime || fnValue === PyRelativeDelta || fnValue === PyTimeDelta) {
2410
2433
  return fnValue.create(...args, kwargs);
@@ -2483,9 +2506,25 @@ function escapeRegExp(str) {
2483
2506
  var InvalidDomainError = class extends Error {
2484
2507
  };
2485
2508
  var Domain = class _Domain {
2486
- ast = { type: -1, value: null };
2487
- static TRUE;
2488
- static FALSE;
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
+ }
2489
2528
  static combine(domains, operator) {
2490
2529
  if (domains.length === 0) {
2491
2530
  return new _Domain([]);
@@ -2564,24 +2603,6 @@ var Domain = class _Domain {
2564
2603
  processLeaf(d.ast.value, 0, "&", newDomain);
2565
2604
  return newDomain;
2566
2605
  }
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
- }
2585
2606
  contains(record) {
2586
2607
  const expr = evaluate(this.ast, record);
2587
2608
  return matchDomain(record, expr);
@@ -2600,7 +2621,7 @@ var Domain = class _Domain {
2600
2621
  return evaluatedAsList;
2601
2622
  }
2602
2623
  return this.toString();
2603
- } catch {
2624
+ } catch (e) {
2604
2625
  return this.toString();
2605
2626
  }
2606
2627
  }
@@ -2823,22 +2844,22 @@ var updateTokenParamInOriginalRequest = (originalRequest, newAccessToken) => {
2823
2844
 
2824
2845
  // src/utils/storage/local-storage.ts
2825
2846
  var localStorageUtils = () => {
2826
- const setToken = async (access_token) => {
2847
+ const setToken = (access_token) => __async(null, null, function* () {
2827
2848
  localStorage.setItem("accessToken", access_token);
2828
- };
2829
- const setRefreshToken = async (refresh_token) => {
2849
+ });
2850
+ const setRefreshToken = (refresh_token) => __async(null, null, function* () {
2830
2851
  localStorage.setItem("refreshToken", refresh_token);
2831
- };
2832
- const getAccessToken = async () => {
2852
+ });
2853
+ const getAccessToken = () => __async(null, null, function* () {
2833
2854
  return localStorage.getItem("accessToken");
2834
- };
2835
- const getRefreshToken = async () => {
2855
+ });
2856
+ const getRefreshToken = () => __async(null, null, function* () {
2836
2857
  return localStorage.getItem("refreshToken");
2837
- };
2838
- const clearToken = async () => {
2858
+ });
2859
+ const clearToken = () => __async(null, null, function* () {
2839
2860
  localStorage.removeItem("accessToken");
2840
2861
  localStorage.removeItem("refreshToken");
2841
- };
2862
+ });
2842
2863
  return {
2843
2864
  setToken,
2844
2865
  setRefreshToken,
@@ -2850,9 +2871,9 @@ var localStorageUtils = () => {
2850
2871
 
2851
2872
  // src/utils/storage/session-storage.ts
2852
2873
  var sessionStorageUtils = () => {
2853
- const getBrowserSession = async () => {
2874
+ const getBrowserSession = () => __async(null, null, function* () {
2854
2875
  return sessionStorage.getItem("browserSession");
2855
- };
2876
+ });
2856
2877
  return {
2857
2878
  getBrowserSession
2858
2879
  };
@@ -2861,13 +2882,14 @@ var sessionStorageUtils = () => {
2861
2882
  // src/configs/axios-client.ts
2862
2883
  var axiosClient = {
2863
2884
  init(config) {
2864
- const localStorage2 = config.localStorageUtils ?? localStorageUtils();
2865
- const sessionStorage2 = config.sessionStorageUtils ?? sessionStorageUtils();
2885
+ var _a, _b;
2886
+ const localStorage2 = (_a = config.localStorageUtils) != null ? _a : localStorageUtils();
2887
+ const sessionStorage2 = (_b = config.sessionStorageUtils) != null ? _b : sessionStorageUtils();
2866
2888
  const db = config.db;
2867
2889
  let isRefreshing = false;
2868
2890
  let failedQueue = [];
2869
2891
  const processQueue = (error, token = null) => {
2870
- failedQueue?.forEach((prom) => {
2892
+ failedQueue == null ? void 0 : failedQueue.forEach((prom) => {
2871
2893
  if (error) {
2872
2894
  prom.reject(error);
2873
2895
  } else {
@@ -2883,14 +2905,14 @@ var axiosClient = {
2883
2905
  paramsSerializer: (params) => new URLSearchParams(params).toString()
2884
2906
  });
2885
2907
  instance.interceptors.request.use(
2886
- async (config2) => {
2908
+ (config2) => __async(null, null, function* () {
2887
2909
  const useRefreshToken = config2.useRefreshToken;
2888
- const token = useRefreshToken ? await localStorage2.getRefreshToken() : await localStorage2.getAccessToken();
2910
+ const token = useRefreshToken ? yield localStorage2.getRefreshToken() : yield localStorage2.getAccessToken();
2889
2911
  if (token) {
2890
2912
  config2.headers["Authorization"] = "Bearer " + token;
2891
2913
  }
2892
2914
  return config2;
2893
- },
2915
+ }),
2894
2916
  (error) => {
2895
2917
  Promise.reject(error);
2896
2918
  }
@@ -2899,19 +2921,21 @@ var axiosClient = {
2899
2921
  (response) => {
2900
2922
  return handleResponse(response);
2901
2923
  },
2902
- async (error) => {
2903
- const handleError3 = async (error2) => {
2924
+ (error) => __async(null, null, function* () {
2925
+ var _a2, _b2, _c;
2926
+ const handleError3 = (error2) => __async(null, null, function* () {
2927
+ var _a3;
2904
2928
  if (!error2.response) {
2905
2929
  return error2;
2906
2930
  }
2907
2931
  const { data } = error2.response;
2908
- if (data && data.code === 400 && ["invalid_grant"].includes(data.data?.error)) {
2909
- await clearAuthToken();
2932
+ if (data && data.code === 400 && ["invalid_grant"].includes((_a3 = data.data) == null ? void 0 : _a3.error)) {
2933
+ yield clearAuthToken();
2910
2934
  }
2911
2935
  return data;
2912
- };
2936
+ });
2913
2937
  const originalRequest = error.config;
2914
- if ((error.response?.status === 403 || error.response?.status === 401 || error.response?.status === 404) && ["TOKEN_EXPIRED", "AUTHEN_FAIL", 401, "ERR_2FA_006"].includes(
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(
2915
2939
  error.response.data.code
2916
2940
  )) {
2917
2941
  if (isRefreshing) {
@@ -2924,18 +2948,19 @@ var axiosClient = {
2924
2948
  token
2925
2949
  );
2926
2950
  return instance.request(originalRequest);
2927
- }).catch(async (err) => {
2928
- if ((err.response?.status === 400 || err.response?.status === 401) && ["invalid_grant"].includes(err.response.data.error)) {
2929
- await clearAuthToken();
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();
2930
2955
  }
2931
- });
2956
+ }));
2932
2957
  }
2933
- const browserSession = await sessionStorage2.getBrowserSession();
2934
- const refreshToken = await localStorage2.getRefreshToken();
2935
- const accessTokenExp = await localStorage2.getAccessToken();
2958
+ const browserSession = yield sessionStorage2.getBrowserSession();
2959
+ const refreshToken = yield localStorage2.getRefreshToken();
2960
+ const accessTokenExp = yield localStorage2.getAccessToken();
2936
2961
  isRefreshing = true;
2937
2962
  if (!refreshToken && (!browserSession || browserSession == "unActive")) {
2938
- await clearAuthToken();
2963
+ yield clearAuthToken();
2939
2964
  } else {
2940
2965
  const payload = Object.fromEntries(
2941
2966
  Object.entries({
@@ -2946,8 +2971,9 @@ var axiosClient = {
2946
2971
  }).filter(([_, value]) => !!value)
2947
2972
  );
2948
2973
  return new Promise(function(resolve) {
2974
+ var _a3;
2949
2975
  import_axios.default.post(
2950
- `${config.baseUrl}${config.refreshTokenEndpoint ?? "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2976
+ `${config.baseUrl}${(_a3 = config.refreshTokenEndpoint) != null ? _a3 : "/authentication/oauth2/token" /* AUTH_TOKEN_PATH */}`,
2951
2977
  payload,
2952
2978
  {
2953
2979
  headers: {
@@ -2955,10 +2981,10 @@ var axiosClient = {
2955
2981
  Authorization: `Bearer ${accessTokenExp}`
2956
2982
  }
2957
2983
  }
2958
- ).then(async (res) => {
2984
+ ).then((res) => __async(null, null, function* () {
2959
2985
  const data = res.data;
2960
- await localStorage2.setToken(data.access_token);
2961
- await localStorage2.setRefreshToken(data.refresh_token);
2986
+ yield localStorage2.setToken(data.access_token);
2987
+ yield localStorage2.setRefreshToken(data.refresh_token);
2962
2988
  import_axios.default.defaults.headers.common["Authorization"] = "Bearer " + data.access_token;
2963
2989
  originalRequest.headers["Authorization"] = "Bearer " + data.access_token;
2964
2990
  originalRequest.data = updateTokenParamInOriginalRequest(
@@ -2967,25 +2993,26 @@ var axiosClient = {
2967
2993
  );
2968
2994
  processQueue(null, data.access_token);
2969
2995
  resolve(instance.request(originalRequest));
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();
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();
2973
3000
  }
2974
3001
  if (err && err.response) {
2975
- const { error_code } = err.response?.data || {};
3002
+ const { error_code } = ((_a4 = err.response) == null ? void 0 : _a4.data) || {};
2976
3003
  if (error_code === "AUTHEN_FAIL") {
2977
- await clearAuthToken();
3004
+ yield clearAuthToken();
2978
3005
  }
2979
3006
  }
2980
3007
  processQueue(err, null);
2981
- }).finally(() => {
3008
+ })).finally(() => {
2982
3009
  isRefreshing = false;
2983
3010
  });
2984
3011
  });
2985
3012
  }
2986
3013
  }
2987
- return Promise.reject(await handleError3(error));
2988
- }
3014
+ return Promise.reject(yield handleError3(error));
3015
+ })
2989
3016
  );
2990
3017
  const handleResponse = (res) => {
2991
3018
  if (res && res.data) {
@@ -2994,6 +3021,7 @@ var axiosClient = {
2994
3021
  return res;
2995
3022
  };
2996
3023
  const handleError2 = (error) => {
3024
+ var _a2, _b2, _c;
2997
3025
  if (error.isAxiosError && error.code === "ECONNABORTED") {
2998
3026
  console.error("Request Timeout Error:", error);
2999
3027
  return "Request Timeout Error";
@@ -3001,17 +3029,17 @@ var axiosClient = {
3001
3029
  console.error("Network Error:", error);
3002
3030
  return "Network Error";
3003
3031
  } else {
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 };
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 };
3007
3035
  }
3008
3036
  };
3009
- const clearAuthToken = async () => {
3010
- await localStorage2.clearToken();
3037
+ const clearAuthToken = () => __async(null, null, function* () {
3038
+ yield localStorage2.clearToken();
3011
3039
  if (typeof window !== "undefined") {
3012
3040
  window.location.href = `/login`;
3013
3041
  }
3014
- };
3042
+ });
3015
3043
  function formatUrl(url, db2) {
3016
3044
  return url + (db2 ? "?db=" + db2 : "");
3017
3045
  }
@@ -3036,18 +3064,6 @@ var axiosClient = {
3036
3064
 
3037
3065
  // src/environment/EnvStore.ts
3038
3066
  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;
3051
3067
  constructor(envStore2, localStorageUtils2, sessionStorageUtils2) {
3052
3068
  this.envStore = envStore2;
3053
3069
  this.localStorageUtils = localStorageUtils2;
@@ -3056,25 +3072,24 @@ var EnvStore = class {
3056
3072
  }
3057
3073
  setup() {
3058
3074
  const env2 = this.envStore.getState().env;
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;
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;
3068
3084
  }
3069
3085
  setupEnv(envConfig) {
3070
3086
  const dispatch = this.envStore.dispatch;
3071
- const env2 = {
3072
- ...envConfig,
3087
+ const env2 = __spreadProps(__spreadValues({}, envConfig), {
3073
3088
  localStorageUtils: this.localStorageUtils,
3074
3089
  sessionStorageUtils: this.sessionStorageUtils
3075
- };
3090
+ });
3076
3091
  const requests = axiosClient.init(env2);
3077
- dispatch(setEnv({ ...env2, requests }));
3092
+ dispatch(setEnv(__spreadProps(__spreadValues({}, env2), { requests })));
3078
3093
  this.setup();
3079
3094
  }
3080
3095
  setUid(uid) {
@@ -3117,445 +3132,482 @@ function getEnv() {
3117
3132
 
3118
3133
  // src/services/view-service/index.ts
3119
3134
  var ViewService = {
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 = {
3135
+ getView(_0) {
3136
+ return __async(this, arguments, function* ({
3134
3137
  model,
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
- }
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
+ });
3146
3164
  });
3147
3165
  },
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: {}
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
+ }
3176
3189
  },
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
- }
3190
+ url_icon: {},
3191
+ web_icon: {},
3192
+ web_icon_data: {},
3193
+ groups_id: {
3194
+ fields: {
3195
+ full_name: {}
3195
3196
  },
3196
- url_icon: {},
3197
- web_icon: {},
3198
- web_icon_data: {},
3199
- groups_id: {
3200
- fields: {
3201
- full_name: {}
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
+ }
3202
3215
  },
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
- }
3216
+ url_icon: {},
3217
+ web_icon: {},
3218
+ web_icon_data: {},
3219
+ groups_id: {
3220
+ fields: {
3221
+ full_name: {}
3221
3222
  },
3222
- url_icon: {},
3223
- web_icon: {},
3224
- web_icon_data: {},
3225
- groups_id: {
3226
- fields: {
3227
- full_name: {}
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
+ }
3228
3241
  },
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
- }
3242
+ url_icon: {},
3243
+ web_icon: {},
3244
+ web_icon_data: {},
3245
+ groups_id: {
3246
+ fields: {
3247
+ full_name: {}
3247
3248
  },
3248
- url_icon: {},
3249
- web_icon: {},
3250
- web_icon_data: {},
3251
- groups_id: {
3252
- fields: {
3253
- full_name: {}
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: ""
3254
3277
  },
3255
- limit: 40,
3256
- order: ""
3278
+ display_name: {},
3279
+ child_id: {
3280
+ fields: {},
3281
+ limit: 40,
3282
+ order: ""
3283
+ }
3257
3284
  },
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
- }
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
+ });
3290
3311
  });
3291
3312
  },
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: {}
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
+ }
3311
3335
  }
3312
- }
3313
- };
3314
- return env2?.requests?.post("/call" /* CALL_PATH */, jsonData, {
3315
- headers: {
3316
- "Content-Type": "application/json"
3317
- }
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
+ });
3318
3342
  });
3319
3343
  },
3320
- async getResequence({
3321
- model,
3322
- ids,
3323
- context,
3324
- offset
3325
- }) {
3326
- const env2 = getEnv();
3327
- const jsonData = {
3344
+ getResequence(_0) {
3345
+ return __async(this, arguments, function* ({
3328
3346
  model,
3329
- with_context: context,
3330
3347
  ids,
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
- }
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
+ });
3338
3363
  });
3339
3364
  },
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: {}
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
+ }
3356
3384
  }
3357
- }
3358
- };
3359
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3360
- headers: {
3361
- "Content-Type": "application/json"
3362
- }
3385
+ };
3386
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3387
+ headers: {
3388
+ "Content-Type": "application/json"
3389
+ }
3390
+ });
3363
3391
  });
3364
3392
  },
3365
- async loadMessages() {
3366
- const env2 = getEnv();
3367
- return env2.requests.post(
3368
- "/load_message_failures" /* LOAD_MESSAGE */,
3369
- {},
3370
- {
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
+ }
3403
+ }
3404
+ );
3405
+ });
3406
+ },
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("", {
3371
3413
  headers: {
3372
3414
  "Content-Type": "application/json"
3373
3415
  }
3374
- }
3375
- );
3376
- },
3377
- async getVersion() {
3378
- const env2 = getEnv();
3379
- return env2?.requests.get("", {
3380
- headers: {
3381
- "Content-Type": "application/json"
3382
- }
3416
+ });
3383
3417
  });
3384
3418
  },
3385
- async get2FAMethods({
3386
- method,
3387
- with_context
3388
- }) {
3389
- const env2 = getEnv();
3390
- const jsonData = {
3419
+ get2FAMethods(_0) {
3420
+ return __async(this, arguments, function* ({
3391
3421
  method,
3392
3422
  with_context
3393
- };
3394
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3395
- headers: {
3396
- "Content-Type": "application/json"
3397
- }
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
+ });
3398
3434
  });
3399
3435
  },
3400
- async verify2FA({
3401
- method,
3402
- with_context,
3403
- code,
3404
- device,
3405
- location
3406
- }) {
3407
- const env2 = getEnv();
3408
- const jsonData = {
3436
+ verify2FA(_0) {
3437
+ return __async(this, arguments, function* ({
3409
3438
  method,
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
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
+ });
3424
3462
  });
3425
3463
  },
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({
3435
- response_type,
3436
- client_id,
3464
+ signInSSO(_0) {
3465
+ return __async(this, arguments, function* ({
3437
3466
  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
3467
+ state,
3468
+ client_id,
3469
+ 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
+ });
3446
3486
  });
3447
3487
  },
3448
- async grantAccess({
3449
- redirect_uri,
3450
- state,
3451
- client_id,
3452
- scopes
3453
- }) {
3454
- const env2 = getEnv();
3455
- const jsonData = {
3488
+ grantAccess(_0) {
3489
+ return __async(this, arguments, function* ({
3456
3490
  redirect_uri,
3457
3491
  state,
3458
3492
  client_id,
3459
3493
  scopes
3460
- };
3461
- return env2?.requests.post("/grant-access" /* GRANT_ACCESS */, jsonData, {
3462
- headers: {
3463
- "Content-Type": "application/json"
3464
- },
3465
- withCredentials: true
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
+ });
3466
3508
  });
3467
3509
  },
3468
- async getFieldsViewSecurity({
3469
- method,
3470
- token,
3471
- views
3472
- }) {
3473
- const env2 = getEnv();
3474
- const jsonData = {
3510
+ getFieldsViewSecurity(_0) {
3511
+ return __async(this, arguments, function* ({
3475
3512
  method,
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
- }
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
+ });
3487
3531
  });
3488
3532
  },
3489
- async settingsWebRead2fa({
3490
- method,
3491
- model,
3492
- kwargs,
3493
- token
3494
- }) {
3495
- const env2 = getEnv();
3496
- const jsonData = {
3533
+ settingsWebRead2fa(_0) {
3534
+ return __async(this, arguments, function* ({
3497
3535
  method,
3498
3536
  model,
3499
3537
  kwargs,
3500
- with_context: {
3501
- token
3502
- }
3503
- };
3504
- return env2?.requests.post("/call" /* CALL_PATH */, jsonData, {
3505
- headers: {
3506
- "Content-Type": "application/json"
3507
- }
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
+ });
3508
3554
  });
3509
3555
  },
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
- }
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
+ });
3522
3570
  });
3523
3571
  },
3524
- async verifyTotp({
3525
- method,
3526
- action_token,
3527
- code
3528
- }) {
3529
- const env2 = getEnv();
3530
- const jsonData = {
3572
+ verifyTotp(_0) {
3573
+ return __async(this, arguments, function* ({
3531
3574
  method,
3532
- kwargs: {
3533
- vals: {
3534
- code
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
3535
3588
  }
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
- }
3589
+ };
3590
+ return env2 == null ? void 0 : env2.requests.post("/call" /* CALL_PATH */, jsonData, {
3591
+ headers: {
3592
+ "Content-Type": "application/json"
3593
+ }
3594
+ });
3545
3595
  });
3546
3596
  },
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
- }
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
+ });
3559
3611
  });
3560
3612
  }
3561
3613
  };
@@ -3571,17 +3623,18 @@ var VersionGate = ({ children }) => {
3571
3623
  queryClient.clear();
3572
3624
  localStorage.removeItem("__api_version__");
3573
3625
  };
3574
- const validateVersion = async () => {
3575
- const serverVersion = await view_service_default.getVersion();
3626
+ const validateVersion = () => __async(null, null, function* () {
3627
+ const serverVersion = yield view_service_default.getVersion();
3628
+ console.log("serverVersion", serverVersion);
3576
3629
  const cached = localStorage.getItem("__api_version__");
3577
- if (cached !== serverVersion?.api_version) {
3630
+ if (cached !== (serverVersion == null ? void 0 : serverVersion.api_version)) {
3578
3631
  clearVersion();
3579
- localStorage.setItem("__api_version__", serverVersion?.api_version);
3632
+ localStorage.setItem("__api_version__", serverVersion == null ? void 0 : serverVersion.api_version);
3580
3633
  } else {
3581
- console.log("Api version:", serverVersion?.api_version);
3634
+ console.log("Api version:", serverVersion == null ? void 0 : serverVersion.api_version);
3582
3635
  }
3583
3636
  setReady(true);
3584
- };
3637
+ });
3585
3638
  validateVersion();
3586
3639
  if (typeof window !== "undefined") {
3587
3640
  const onKey = (e) => {