@fctc/interface-logic 4.4.7 → 4.4.8

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/services.js CHANGED
@@ -45,7 +45,7 @@ __export(services_exports, {
45
45
  module.exports = __toCommonJS(services_exports);
46
46
 
47
47
  // src/services/action-service/index.ts
48
- var import_react39 = require("react");
48
+ var import_react41 = require("react");
49
49
 
50
50
  // src/constants/api/uri-constant.ts
51
51
  var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
@@ -148,6 +148,25 @@ var LoadDataModel = /* @__PURE__ */ ((LoadDataModel2) => {
148
148
  LoadDataModel2["POS_MAKE_PAYMENT"] = "pos.make.payment";
149
149
  return LoadDataModel2;
150
150
  })(LoadDataModel || {});
151
+ var MODEL_TO_TABLE = {
152
+ ["account.tax" /* ACCOUNT_TAX */]: "account_taxes" /* ACCOUNT_TAXES */,
153
+ ["res.company" /* RES_COMPANY */]: "companies" /* COMPANIES */,
154
+ ["res.partner" /* RES_PARTNER */]: "customers" /* CUSTOMERS */,
155
+ ["res.users" /* RES_USERS */]: "employees" /* EMPLOYEES */,
156
+ ["loyalty.program" /* LOYALTY_PROGRAM */]: "loyalty_programs" /* LOYALTY_PROGRAMS */,
157
+ ["loyalty.rule" /* LOYALTY_RULE */]: "loyalty_rules" /* LOYALTY_RULES */,
158
+ ["loyalty.reward" /* LOYALTY_REWARD */]: "loyalty_rewards" /* LOYALTY_REWARDS */,
159
+ ["pos.config" /* POS_CONFIG */]: "pos_configs" /* POS_CONFIGS */,
160
+ ["pos.session" /* POS_SESSION */]: "pos_sessions" /* POS_SESSIONS */,
161
+ ["pos.order.line" /* POS_ORDER_LINE */]: "order_lines" /* ORDER_LINES */,
162
+ ["pos.order" /* POS_ORDER */]: "orders" /* ORDERS */,
163
+ ["pos.payment.method" /* POS_PAYMENT_METHOD */]: "payment_methods" /* PAYMENT_METHODS */,
164
+ ["pos.payment" /* POS_PAYMENT */]: "payments" /* PAYMENTS */,
165
+ ["pos.category" /* POS_CATEGORY */]: "product_categories" /* PRODUCT_CATEGORIES */,
166
+ ["product.product" /* PRODUCT_PRODUCT */]: "products" /* PRODUCTS */,
167
+ ["restaurant.floor" /* RESTAURANT_FLOOR */]: "restaurant_floors" /* RESTAURANT_FLOORS */,
168
+ ["restaurant.table" /* RESTAURANT_TABLE */]: "restaurant_tables" /* RESTAURANT_TABLES */
169
+ };
151
170
 
152
171
  // src/utils/domain/py_tokenizer.ts
153
172
  var TokenizerError = class extends Error {
@@ -2936,7 +2955,7 @@ function useEnv() {
2936
2955
  }
2937
2956
 
2938
2957
  // src/provider/service-provider.tsx
2939
- var import_react37 = require("react");
2958
+ var import_react39 = require("react");
2940
2959
 
2941
2960
  // src/hooks/auth/use-forgot-password.ts
2942
2961
  var import_react_query3 = require("@tanstack/react-query");
@@ -3250,8 +3269,13 @@ var addEntityService = (env) => {
3250
3269
  values,
3251
3270
  xNode,
3252
3271
  service,
3253
- isCreateEndpoint = false
3272
+ isCreateEndpoint = false,
3273
+ isSupa = false,
3274
+ supaCallback
3254
3275
  }) => {
3276
+ if (isSupa && supaCallback) {
3277
+ return supaCallback(values);
3278
+ }
3255
3279
  const jsonData = {
3256
3280
  model,
3257
3281
  values
@@ -3973,25 +3997,12 @@ var useSupabaseOptional = () => {
3973
3997
  };
3974
3998
 
3975
3999
  // src/services/pos-service/load-data-pos-session.ts
3976
- var MODEL_TO_TABLE = {
3977
- ["account.tax" /* ACCOUNT_TAX */]: "account_taxes",
3978
- ["res.company" /* RES_COMPANY */]: "companies",
3979
- ["res.partner" /* RES_PARTNER */]: "customers",
3980
- ["res.users" /* RES_USERS */]: "employees",
3981
- ["loyalty.program" /* LOYALTY_PROGRAM */]: "loyalty_programs",
3982
- ["loyalty.rule" /* LOYALTY_RULE */]: "loyalty_rules",
3983
- ["loyalty.reward" /* LOYALTY_REWARD */]: "loyalty_rewards",
3984
- ["pos.config" /* POS_CONFIG */]: "pos_configs",
3985
- ["pos.session" /* POS_SESSION */]: "pos_sessions",
3986
- ["pos.order.line" /* POS_ORDER_LINE */]: "order_lines",
3987
- ["pos.order" /* POS_ORDER */]: "orders",
3988
- ["pos.payment.method" /* POS_PAYMENT_METHOD */]: "payment_methods",
3989
- ["pos.payment" /* POS_PAYMENT */]: "payments",
3990
- ["pos.category" /* POS_CATEGORY */]: "product_categories",
3991
- ["product.product" /* PRODUCT_PRODUCT */]: "products",
3992
- ["restaurant.floor" /* RESTAURANT_FLOOR */]: "restaurant_floors",
3993
- ["restaurant.table" /* RESTAURANT_TABLE */]: "restaurant_tables"
3994
- };
4000
+ var createModelResult = (modelName, data = []) => ({
4001
+ modelName,
4002
+ data,
4003
+ fields: {},
4004
+ relations: {}
4005
+ });
3995
4006
  var loadDataPosSessionService = (env) => {
3996
4007
  const supabase = useSupabaseOptional();
3997
4008
  const loadDataPosSession = (0, import_react27.useCallback)(
@@ -4033,56 +4044,25 @@ var loadDataPosSessionService = (env) => {
4033
4044
  [env]
4034
4045
  );
4035
4046
  const loadDataPosSessionSupabase = (0, import_react27.useCallback)(async () => {
4047
+ if (!supabase) return {};
4036
4048
  try {
4037
4049
  const allModels = Object.values(LoadDataModel);
4038
- const promises = allModels.map(async (modelName) => {
4039
- const tableName = MODEL_TO_TABLE[modelName];
4040
- if (!tableName) {
4041
- return {
4042
- modelName,
4043
- data: [],
4044
- fields: {},
4045
- relations: {}
4046
- };
4047
- }
4048
- if (!supabase) {
4049
- return {
4050
- modelName,
4051
- data: [],
4052
- fields: {},
4053
- relations: {}
4054
- };
4055
- }
4056
- const { data, error } = await supabase.from(tableName).select("*");
4057
- if (error) {
4058
- console.error(`Error loading ${modelName}:`, error);
4059
- return {
4060
- modelName,
4061
- data: [],
4062
- fields: {},
4063
- relations: {}
4064
- };
4065
- }
4066
- return {
4067
- modelName,
4068
- data: data || [],
4069
- fields: {},
4070
- relations: {}
4071
- };
4072
- });
4073
- const results = await Promise.all(promises);
4074
- const response = results.reduce(
4075
- (acc, { modelName, data, fields, relations }) => {
4076
- acc[modelName] = {
4077
- data,
4078
- fields,
4079
- relations
4080
- };
4081
- return acc;
4082
- },
4083
- {}
4050
+ const results = await Promise.all(
4051
+ allModels.map(async (modelName) => {
4052
+ const tableName = MODEL_TO_TABLE[modelName];
4053
+ if (!tableName) return createModelResult(modelName);
4054
+ const { data, error } = await supabase.from(tableName).select("*");
4055
+ if (error) {
4056
+ console.error(`Error loading ${modelName}:`, error);
4057
+ return createModelResult(modelName);
4058
+ }
4059
+ return createModelResult(modelName, data || []);
4060
+ })
4084
4061
  );
4085
- return response;
4062
+ return results.reduce((acc, { modelName, ...rest }) => {
4063
+ acc[modelName] = rest;
4064
+ return acc;
4065
+ }, {});
4086
4066
  } catch (error) {
4087
4067
  console.error("Error loading data from Supabase:", error);
4088
4068
  return {};
@@ -4551,18 +4531,30 @@ var import_react_query113 = require("@tanstack/react-query");
4551
4531
  // src/hooks/pos/use-complete-current-stage.ts
4552
4532
  var import_react_query114 = require("@tanstack/react-query");
4553
4533
 
4534
+ // src/hooks/pos/supabase/use-add-floor.ts
4535
+ var import_react_query115 = require("@tanstack/react-query");
4536
+
4537
+ // src/services/pos-service/supabase/add-floor.ts
4538
+ var import_react37 = require("react");
4539
+
4540
+ // src/services/pos-service/supabase/add-table.ts
4541
+ var import_react38 = require("react");
4542
+
4543
+ // src/hooks/pos/supabase/use-add-table.ts
4544
+ var import_react_query116 = require("@tanstack/react-query");
4545
+
4554
4546
  // src/provider/service-provider.tsx
4555
4547
  var import_jsx_runtime7 = require("react/jsx-runtime");
4556
- var ServiceContext = (0, import_react37.createContext)(null);
4548
+ var ServiceContext = (0, import_react39.createContext)(null);
4557
4549
 
4558
4550
  // src/provider/meta-provider.tsx
4559
- var import_react38 = require("react");
4551
+ var import_react40 = require("react");
4560
4552
  var import_jsx_runtime8 = require("react/jsx-runtime");
4561
4553
 
4562
4554
  // src/services/action-service/index.ts
4563
4555
  function useActionService() {
4564
4556
  const { env } = useEnv();
4565
- const loadAction = (0, import_react39.useCallback)(
4557
+ const loadAction = (0, import_react41.useCallback)(
4566
4558
  async ({
4567
4559
  idAction,
4568
4560
  context,
@@ -4586,7 +4578,7 @@ function useActionService() {
4586
4578
  },
4587
4579
  [env]
4588
4580
  );
4589
- const callButton = (0, import_react39.useCallback)(
4581
+ const callButton = (0, import_react41.useCallback)(
4590
4582
  async ({
4591
4583
  model,
4592
4584
  ids = [],
@@ -4620,7 +4612,7 @@ function useActionService() {
4620
4612
  },
4621
4613
  [env]
4622
4614
  );
4623
- const removeRows = (0, import_react39.useCallback)(
4615
+ const removeRows = (0, import_react41.useCallback)(
4624
4616
  async ({
4625
4617
  model,
4626
4618
  ids,
@@ -4646,7 +4638,7 @@ function useActionService() {
4646
4638
  },
4647
4639
  [env]
4648
4640
  );
4649
- const duplicateRecord = (0, import_react39.useCallback)(
4641
+ const duplicateRecord = (0, import_react41.useCallback)(
4650
4642
  async ({
4651
4643
  model,
4652
4644
  id,
@@ -4672,7 +4664,7 @@ function useActionService() {
4672
4664
  },
4673
4665
  [env]
4674
4666
  );
4675
- const getPrintReportName = (0, import_react39.useCallback)(
4667
+ const getPrintReportName = (0, import_react41.useCallback)(
4676
4668
  async ({ id }) => {
4677
4669
  const jsonData = {
4678
4670
  model: "ir.actions.report",
@@ -4690,7 +4682,7 @@ function useActionService() {
4690
4682
  },
4691
4683
  [env]
4692
4684
  );
4693
- const print = (0, import_react39.useCallback)(
4685
+ const print = (0, import_react41.useCallback)(
4694
4686
  async ({ id, report, db }) => {
4695
4687
  const jsonData = {
4696
4688
  report,
@@ -4708,7 +4700,7 @@ function useActionService() {
4708
4700
  },
4709
4701
  [env]
4710
4702
  );
4711
- const runAction = (0, import_react39.useCallback)(
4703
+ const runAction = (0, import_react41.useCallback)(
4712
4704
  async ({
4713
4705
  idAction,
4714
4706
  context,
@@ -4735,7 +4727,7 @@ function useActionService() {
4735
4727
  },
4736
4728
  [env]
4737
4729
  );
4738
- const generateSerialNumber = (0, import_react39.useCallback)(
4730
+ const generateSerialNumber = (0, import_react41.useCallback)(
4739
4731
  async ({
4740
4732
  kwargs,
4741
4733
  context,
@@ -4773,11 +4765,11 @@ function useActionService() {
4773
4765
  }
4774
4766
 
4775
4767
  // src/services/auth-service/index.ts
4776
- var import_react40 = require("react");
4768
+ var import_react42 = require("react");
4777
4769
  function useAuthService() {
4778
4770
  const { env } = useEnv();
4779
4771
  const supabase = useSupabaseOptional();
4780
- const login = (0, import_react40.useCallback)(
4772
+ const login = (0, import_react42.useCallback)(
4781
4773
  async (body) => {
4782
4774
  const payload = Object.fromEntries(
4783
4775
  Object.entries({
@@ -4802,7 +4794,7 @@ function useAuthService() {
4802
4794
  },
4803
4795
  [env]
4804
4796
  );
4805
- const loginSupabase = (0, import_react40.useCallback)(
4797
+ const loginSupabase = (0, import_react42.useCallback)(
4806
4798
  async (body) => {
4807
4799
  if (!supabase) {
4808
4800
  return {
@@ -4818,7 +4810,7 @@ function useAuthService() {
4818
4810
  },
4819
4811
  [supabase]
4820
4812
  );
4821
- const forgotPassword = (0, import_react40.useCallback)(
4813
+ const forgotPassword = (0, import_react42.useCallback)(
4822
4814
  async (email) => {
4823
4815
  const bodyData = {
4824
4816
  login: email,
@@ -4832,7 +4824,7 @@ function useAuthService() {
4832
4824
  },
4833
4825
  [env]
4834
4826
  );
4835
- const forgotPasswordSSO = (0, import_react40.useCallback)(
4827
+ const forgotPasswordSSO = (0, import_react42.useCallback)(
4836
4828
  async ({
4837
4829
  email,
4838
4830
  with_context,
@@ -4855,7 +4847,7 @@ function useAuthService() {
4855
4847
  },
4856
4848
  [env]
4857
4849
  );
4858
- const resetPassword = (0, import_react40.useCallback)(
4850
+ const resetPassword = (0, import_react42.useCallback)(
4859
4851
  async (data, token) => {
4860
4852
  const bodyData = {
4861
4853
  token,
@@ -4870,7 +4862,7 @@ function useAuthService() {
4870
4862
  },
4871
4863
  [env]
4872
4864
  );
4873
- const resetPasswordSSO = (0, import_react40.useCallback)(
4865
+ const resetPasswordSSO = (0, import_react42.useCallback)(
4874
4866
  async ({
4875
4867
  method,
4876
4868
  password,
@@ -4893,7 +4885,7 @@ function useAuthService() {
4893
4885
  },
4894
4886
  [env]
4895
4887
  );
4896
- const updatePassword = (0, import_react40.useCallback)(
4888
+ const updatePassword = (0, import_react42.useCallback)(
4897
4889
  async (data, token) => {
4898
4890
  const bodyData = {
4899
4891
  token,
@@ -4908,7 +4900,7 @@ function useAuthService() {
4908
4900
  },
4909
4901
  [env]
4910
4902
  );
4911
- const isValidToken = (0, import_react40.useCallback)(
4903
+ const isValidToken = (0, import_react42.useCallback)(
4912
4904
  async (token) => {
4913
4905
  const bodyData = {
4914
4906
  token
@@ -4921,7 +4913,7 @@ function useAuthService() {
4921
4913
  },
4922
4914
  [env]
4923
4915
  );
4924
- const isValidActionToken = (0, import_react40.useCallback)(
4916
+ const isValidActionToken = (0, import_react42.useCallback)(
4925
4917
  async (actionToken) => {
4926
4918
  const bodyData = {};
4927
4919
  return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
@@ -4934,7 +4926,7 @@ function useAuthService() {
4934
4926
  },
4935
4927
  [env]
4936
4928
  );
4937
- const loginSocial = (0, import_react40.useCallback)(
4929
+ const loginSocial = (0, import_react42.useCallback)(
4938
4930
  async ({
4939
4931
  db,
4940
4932
  state,
@@ -4952,13 +4944,13 @@ function useAuthService() {
4952
4944
  },
4953
4945
  [env]
4954
4946
  );
4955
- const getProviders = (0, import_react40.useCallback)(
4947
+ const getProviders = (0, import_react42.useCallback)(
4956
4948
  async (db) => {
4957
4949
  return env?.requests?.get("/oauth/providers", { params: { db } });
4958
4950
  },
4959
4951
  [env]
4960
4952
  );
4961
- const getAccessByCode = (0, import_react40.useCallback)(
4953
+ const getAccessByCode = (0, import_react42.useCallback)(
4962
4954
  async (code) => {
4963
4955
  const data = new URLSearchParams();
4964
4956
  data.append("code", code);
@@ -4978,7 +4970,7 @@ function useAuthService() {
4978
4970
  },
4979
4971
  [env]
4980
4972
  );
4981
- const logout = (0, import_react40.useCallback)(
4973
+ const logout = (0, import_react42.useCallback)(
4982
4974
  async (service) => {
4983
4975
  return env?.requests?.post(
4984
4976
  "/logout" /* LOGOUT */,
@@ -4995,7 +4987,7 @@ function useAuthService() {
4995
4987
  },
4996
4988
  [env]
4997
4989
  );
4998
- const getTenantMapping = (0, import_react40.useCallback)(
4990
+ const getTenantMapping = (0, import_react42.useCallback)(
4999
4991
  async ({ shortName, service }) => {
5000
4992
  const bodyData = {
5001
4993
  short_name: shortName
@@ -5013,7 +5005,7 @@ function useAuthService() {
5013
5005
  },
5014
5006
  [env]
5015
5007
  );
5016
- const getToken = (0, import_react40.useCallback)(
5008
+ const getToken = (0, import_react42.useCallback)(
5017
5009
  async ({
5018
5010
  phone,
5019
5011
  name,
@@ -5058,10 +5050,10 @@ function useAuthService() {
5058
5050
  }
5059
5051
 
5060
5052
  // src/services/company-service/index.ts
5061
- var import_react41 = require("react");
5053
+ var import_react43 = require("react");
5062
5054
  function useCompanyService() {
5063
5055
  const { env } = useEnv();
5064
- const getCurrentCompany = (0, import_react41.useCallback)(
5056
+ const getCurrentCompany = (0, import_react43.useCallback)(
5065
5057
  async (service, extraHeaders) => {
5066
5058
  return await env.requests.get(
5067
5059
  "/company" /* COMPANY_PATH */,
@@ -5078,7 +5070,7 @@ function useCompanyService() {
5078
5070
  },
5079
5071
  [env]
5080
5072
  );
5081
- const getInfoCompany = (0, import_react41.useCallback)(
5073
+ const getInfoCompany = (0, import_react43.useCallback)(
5082
5074
  async (id, service) => {
5083
5075
  const jsonData = {
5084
5076
  ids: [id],
@@ -5114,10 +5106,10 @@ function useCompanyService() {
5114
5106
  }
5115
5107
 
5116
5108
  // src/services/excel-service/index.ts
5117
- var import_react42 = require("react");
5109
+ var import_react44 = require("react");
5118
5110
  function useExcelService() {
5119
5111
  const { env } = useEnv();
5120
- const uploadFileExcel = (0, import_react42.useCallback)(
5112
+ const uploadFileExcel = (0, import_react44.useCallback)(
5121
5113
  async ({
5122
5114
  formData,
5123
5115
  service,
@@ -5134,7 +5126,7 @@ function useExcelService() {
5134
5126
  },
5135
5127
  [env]
5136
5128
  );
5137
- const uploadIdFile = (0, import_react42.useCallback)(
5129
+ const uploadIdFile = (0, import_react44.useCallback)(
5138
5130
  async ({
5139
5131
  formData,
5140
5132
  service,
@@ -5151,7 +5143,7 @@ function useExcelService() {
5151
5143
  },
5152
5144
  [env]
5153
5145
  );
5154
- const parsePreview = (0, import_react42.useCallback)(
5146
+ const parsePreview = (0, import_react44.useCallback)(
5155
5147
  async ({
5156
5148
  id,
5157
5149
  selectedSheet,
@@ -5200,7 +5192,7 @@ function useExcelService() {
5200
5192
  },
5201
5193
  [env]
5202
5194
  );
5203
- const executeImport = (0, import_react42.useCallback)(
5195
+ const executeImport = (0, import_react44.useCallback)(
5204
5196
  async ({
5205
5197
  columns,
5206
5198
  fields,
@@ -5234,7 +5226,7 @@ function useExcelService() {
5234
5226
  },
5235
5227
  [env]
5236
5228
  );
5237
- const getFileExcel = (0, import_react42.useCallback)(
5229
+ const getFileExcel = (0, import_react44.useCallback)(
5238
5230
  async ({
5239
5231
  model,
5240
5232
  service,
@@ -5258,7 +5250,7 @@ function useExcelService() {
5258
5250
  },
5259
5251
  [env]
5260
5252
  );
5261
- const getFieldExport = (0, import_react42.useCallback)(
5253
+ const getFieldExport = (0, import_react44.useCallback)(
5262
5254
  async ({
5263
5255
  ids,
5264
5256
  model,
@@ -5298,7 +5290,7 @@ function useExcelService() {
5298
5290
  },
5299
5291
  [env]
5300
5292
  );
5301
- const exportExcel = (0, import_react42.useCallback)(
5293
+ const exportExcel = (0, import_react44.useCallback)(
5302
5294
  async ({
5303
5295
  model,
5304
5296
  domain,
@@ -5346,10 +5338,10 @@ function useExcelService() {
5346
5338
  }
5347
5339
 
5348
5340
  // src/services/form-service/index.ts
5349
- var import_react43 = require("react");
5341
+ var import_react45 = require("react");
5350
5342
  function useFormService() {
5351
5343
  const { env } = useEnv();
5352
- const getComment = (0, import_react43.useCallback)(
5344
+ const getComment = (0, import_react45.useCallback)(
5353
5345
  async ({ data }) => {
5354
5346
  const jsonData = {
5355
5347
  thread_id: data.thread_id,
@@ -5367,7 +5359,7 @@ function useFormService() {
5367
5359
  },
5368
5360
  [env]
5369
5361
  );
5370
- const getThreadData = (0, import_react43.useCallback)(
5362
+ const getThreadData = (0, import_react45.useCallback)(
5371
5363
  async ({
5372
5364
  data,
5373
5365
  xNode,
@@ -5394,7 +5386,7 @@ function useFormService() {
5394
5386
  },
5395
5387
  [env]
5396
5388
  );
5397
- const getThreadMessages = (0, import_react43.useCallback)(
5389
+ const getThreadMessages = (0, import_react45.useCallback)(
5398
5390
  async ({
5399
5391
  data,
5400
5392
  xNode,
@@ -5420,7 +5412,7 @@ function useFormService() {
5420
5412
  },
5421
5413
  [env]
5422
5414
  );
5423
- const sentComment = (0, import_react43.useCallback)(
5415
+ const sentComment = (0, import_react45.useCallback)(
5424
5416
  async ({ data }) => {
5425
5417
  const jsonData = {
5426
5418
  context: {
@@ -5448,7 +5440,7 @@ function useFormService() {
5448
5440
  },
5449
5441
  [env]
5450
5442
  );
5451
- const deleteComment = (0, import_react43.useCallback)(
5443
+ const deleteComment = (0, import_react45.useCallback)(
5452
5444
  async ({ data }) => {
5453
5445
  const jsonData = {
5454
5446
  attachment_ids: [],
@@ -5464,7 +5456,7 @@ function useFormService() {
5464
5456
  },
5465
5457
  [env]
5466
5458
  );
5467
- const getImage = (0, import_react43.useCallback)(
5459
+ const getImage = (0, import_react45.useCallback)(
5468
5460
  async ({ data }) => {
5469
5461
  return env.requests.get(
5470
5462
  `${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
@@ -5477,7 +5469,7 @@ function useFormService() {
5477
5469
  },
5478
5470
  [env]
5479
5471
  );
5480
- const uploadImage = (0, import_react43.useCallback)(
5472
+ const uploadImage = (0, import_react45.useCallback)(
5481
5473
  async ({
5482
5474
  formData,
5483
5475
  service,
@@ -5496,7 +5488,7 @@ function useFormService() {
5496
5488
  },
5497
5489
  [env]
5498
5490
  );
5499
- const uploadFile = (0, import_react43.useCallback)(
5491
+ const uploadFile = (0, import_react45.useCallback)(
5500
5492
  async ({
5501
5493
  formData,
5502
5494
  service,
@@ -5516,7 +5508,7 @@ function useFormService() {
5516
5508
  },
5517
5509
  [env]
5518
5510
  );
5519
- const getFormView = (0, import_react43.useCallback)(
5511
+ const getFormView = (0, import_react45.useCallback)(
5520
5512
  async ({ data }) => {
5521
5513
  const jsonData = {
5522
5514
  model: data.model,
@@ -5532,7 +5524,7 @@ function useFormService() {
5532
5524
  },
5533
5525
  [env]
5534
5526
  );
5535
- const changeStatus = (0, import_react43.useCallback)(
5527
+ const changeStatus = (0, import_react45.useCallback)(
5536
5528
  async ({ data }) => {
5537
5529
  const vals = {
5538
5530
  [data.name]: data.stage_id
@@ -5561,7 +5553,7 @@ function useFormService() {
5561
5553
  },
5562
5554
  [env]
5563
5555
  );
5564
- const getExternalTab = (0, import_react43.useCallback)(
5556
+ const getExternalTab = (0, import_react45.useCallback)(
5565
5557
  async ({ method, context, service, xNode }) => {
5566
5558
  return env?.requests?.post(
5567
5559
  "/call" /* CALL_PATH */,
@@ -5596,10 +5588,10 @@ function useFormService() {
5596
5588
  }
5597
5589
 
5598
5590
  // src/services/kanban-service/index.ts
5599
- var import_react44 = require("react");
5591
+ var import_react46 = require("react");
5600
5592
  function useKanbanService() {
5601
5593
  const { env } = useEnv();
5602
- const getGroups = (0, import_react44.useCallback)(
5594
+ const getGroups = (0, import_react46.useCallback)(
5603
5595
  async ({ model, width_context }) => {
5604
5596
  const jsonData = {
5605
5597
  model,
@@ -5619,7 +5611,7 @@ function useKanbanService() {
5619
5611
  },
5620
5612
  [env]
5621
5613
  );
5622
- const getProgressBar = (0, import_react44.useCallback)(
5614
+ const getProgressBar = (0, import_react46.useCallback)(
5623
5615
  async ({ field, color, model, width_context }) => {
5624
5616
  const jsonData = {
5625
5617
  model,
@@ -5649,10 +5641,10 @@ function useKanbanService() {
5649
5641
  }
5650
5642
 
5651
5643
  // src/services/model-service/index.ts
5652
- var import_react45 = require("react");
5644
+ var import_react47 = require("react");
5653
5645
  function useModelService() {
5654
5646
  const { env } = useEnv();
5655
- const getListMyBankAccount = (0, import_react45.useCallback)(
5647
+ const getListMyBankAccount = (0, import_react47.useCallback)(
5656
5648
  async ({
5657
5649
  domain,
5658
5650
  spectification,
@@ -5676,7 +5668,7 @@ function useModelService() {
5676
5668
  },
5677
5669
  [env]
5678
5670
  );
5679
- const getCurrency = (0, import_react45.useCallback)(async () => {
5671
+ const getCurrency = (0, import_react47.useCallback)(async () => {
5680
5672
  const jsonData = {
5681
5673
  model: "res.currency",
5682
5674
  method: "web_search_read",
@@ -5696,7 +5688,7 @@ function useModelService() {
5696
5688
  }
5697
5689
  });
5698
5690
  }, [env]);
5699
- const getConversionRate = (0, import_react45.useCallback)(async () => {
5691
+ const getConversionRate = (0, import_react47.useCallback)(async () => {
5700
5692
  const jsonData = {
5701
5693
  model: "res.currency",
5702
5694
  method: "web_search_read",
@@ -5722,7 +5714,7 @@ function useModelService() {
5722
5714
  }
5723
5715
  });
5724
5716
  }, [env]);
5725
- const getAll = (0, import_react45.useCallback)(
5717
+ const getAll = (0, import_react47.useCallback)(
5726
5718
  async ({
5727
5719
  data,
5728
5720
  service,
@@ -5764,7 +5756,7 @@ function useModelService() {
5764
5756
  },
5765
5757
  [env]
5766
5758
  );
5767
- const getListCalendar = (0, import_react45.useCallback)(
5759
+ const getListCalendar = (0, import_react47.useCallback)(
5768
5760
  async ({ data }) => {
5769
5761
  const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
5770
5762
  fields: data.fields,
@@ -5795,7 +5787,7 @@ function useModelService() {
5795
5787
  },
5796
5788
  [env]
5797
5789
  );
5798
- const getList = (0, import_react45.useCallback)(
5790
+ const getList = (0, import_react47.useCallback)(
5799
5791
  async ({
5800
5792
  model,
5801
5793
  ids = [],
@@ -5827,7 +5819,7 @@ function useModelService() {
5827
5819
  },
5828
5820
  [env]
5829
5821
  );
5830
- const getDetail = (0, import_react45.useCallback)(
5822
+ const getDetail = (0, import_react47.useCallback)(
5831
5823
  async ({
5832
5824
  ids = [],
5833
5825
  model,
@@ -5859,7 +5851,7 @@ function useModelService() {
5859
5851
  },
5860
5852
  [env]
5861
5853
  );
5862
- const save = (0, import_react45.useCallback)(
5854
+ const save = (0, import_react47.useCallback)(
5863
5855
  async ({
5864
5856
  model,
5865
5857
  ids = [],
@@ -5894,7 +5886,7 @@ function useModelService() {
5894
5886
  },
5895
5887
  [env]
5896
5888
  );
5897
- const deleteApi = (0, import_react45.useCallback)(
5889
+ const deleteApi = (0, import_react47.useCallback)(
5898
5890
  async ({ ids = [], model, service }) => {
5899
5891
  const jsonData = {
5900
5892
  model,
@@ -5914,7 +5906,7 @@ function useModelService() {
5914
5906
  },
5915
5907
  [env]
5916
5908
  );
5917
- const onChange = (0, import_react45.useCallback)(
5909
+ const onChange = (0, import_react47.useCallback)(
5918
5910
  async ({
5919
5911
  ids = [],
5920
5912
  model,
@@ -5950,7 +5942,7 @@ function useModelService() {
5950
5942
  },
5951
5943
  [env]
5952
5944
  );
5953
- const getListFieldsOnchange = (0, import_react45.useCallback)(
5945
+ const getListFieldsOnchange = (0, import_react47.useCallback)(
5954
5946
  async ({
5955
5947
  model,
5956
5948
  service,
@@ -5974,7 +5966,7 @@ function useModelService() {
5974
5966
  },
5975
5967
  [env]
5976
5968
  );
5977
- const parseORMOdoo = (0, import_react45.useCallback)((data) => {
5969
+ const parseORMOdoo = (0, import_react47.useCallback)((data) => {
5978
5970
  for (const key in data) {
5979
5971
  if (key === "display_name") {
5980
5972
  delete data[key];
@@ -5985,7 +5977,7 @@ function useModelService() {
5985
5977
  }
5986
5978
  return { ...data };
5987
5979
  }, []);
5988
- const toDataJS = (0, import_react45.useCallback)(
5980
+ const toDataJS = (0, import_react47.useCallback)(
5989
5981
  (data, viewData, model) => {
5990
5982
  for (const key in data) {
5991
5983
  if (data[key] === false) {
@@ -6043,10 +6035,10 @@ function useModelService() {
6043
6035
  }
6044
6036
 
6045
6037
  // src/services/user-service/index.ts
6046
- var import_react46 = require("react");
6038
+ var import_react48 = require("react");
6047
6039
  function useUserService() {
6048
6040
  const { env } = useEnv();
6049
- const getProfile = (0, import_react46.useCallback)(
6041
+ const getProfile = (0, import_react48.useCallback)(
6050
6042
  async (service, path, extraHeaders) => {
6051
6043
  return env?.requests?.get(
6052
6044
  path || "/userinfo" /* PROFILE_PATH */,
@@ -6063,7 +6055,7 @@ function useUserService() {
6063
6055
  },
6064
6056
  [env]
6065
6057
  );
6066
- const getUser = (0, import_react46.useCallback)(
6058
+ const getUser = (0, import_react48.useCallback)(
6067
6059
  async ({ context, id }) => {
6068
6060
  const jsonData = {
6069
6061
  model: "res.users",
@@ -6101,7 +6093,7 @@ function useUserService() {
6101
6093
  },
6102
6094
  [env]
6103
6095
  );
6104
- const switchUserLocale = (0, import_react46.useCallback)(
6096
+ const switchUserLocale = (0, import_react48.useCallback)(
6105
6097
  async ({ id, values, service }) => {
6106
6098
  const jsonData = {
6107
6099
  model: "res.users",
@@ -6129,10 +6121,10 @@ function useUserService() {
6129
6121
  }
6130
6122
 
6131
6123
  // src/services/view-service/index.ts
6132
- var import_react47 = require("react");
6124
+ var import_react49 = require("react");
6133
6125
  function useViewService() {
6134
6126
  const { env } = useEnv();
6135
- const getView = (0, import_react47.useCallback)(
6127
+ const getView = (0, import_react49.useCallback)(
6136
6128
  async ({
6137
6129
  model,
6138
6130
  views,
@@ -6172,7 +6164,7 @@ function useViewService() {
6172
6164
  },
6173
6165
  [env]
6174
6166
  );
6175
- const getMenu = (0, import_react47.useCallback)(
6167
+ const getMenu = (0, import_react49.useCallback)(
6176
6168
  async (context, specification, domain, service) => {
6177
6169
  const jsonData = {
6178
6170
  model: "ir.ui.menu" /* MENU */,
@@ -6203,7 +6195,7 @@ function useViewService() {
6203
6195
  },
6204
6196
  [env]
6205
6197
  );
6206
- const getActionDetail = (0, import_react47.useCallback)(
6198
+ const getActionDetail = (0, import_react49.useCallback)(
6207
6199
  async (aid, context) => {
6208
6200
  const jsonData = {
6209
6201
  model: "ir.actions.act_window" /* WINDOW_ACTION */,
@@ -6233,7 +6225,7 @@ function useViewService() {
6233
6225
  },
6234
6226
  [env]
6235
6227
  );
6236
- const getResequence = (0, import_react47.useCallback)(
6228
+ const getResequence = (0, import_react49.useCallback)(
6237
6229
  async ({
6238
6230
  model,
6239
6231
  ids,
@@ -6263,7 +6255,7 @@ function useViewService() {
6263
6255
  },
6264
6256
  [env]
6265
6257
  );
6266
- const getSelectionItem = (0, import_react47.useCallback)(
6258
+ const getSelectionItem = (0, import_react49.useCallback)(
6267
6259
  async ({
6268
6260
  data,
6269
6261
  service,
@@ -6300,7 +6292,7 @@ function useViewService() {
6300
6292
  },
6301
6293
  [env]
6302
6294
  );
6303
- const loadMessages = (0, import_react47.useCallback)(async () => {
6295
+ const loadMessages = (0, import_react49.useCallback)(async () => {
6304
6296
  return env.requests.post(
6305
6297
  "/load_message_failures" /* LOAD_MESSAGE */,
6306
6298
  {},
@@ -6311,14 +6303,14 @@ function useViewService() {
6311
6303
  }
6312
6304
  );
6313
6305
  }, [env]);
6314
- const getVersion = (0, import_react47.useCallback)(async () => {
6306
+ const getVersion = (0, import_react49.useCallback)(async () => {
6315
6307
  return env?.requests?.get("", {
6316
6308
  headers: {
6317
6309
  "Content-Type": "application/json"
6318
6310
  }
6319
6311
  });
6320
6312
  }, [env]);
6321
- const grantAccess = (0, import_react47.useCallback)(
6313
+ const grantAccess = (0, import_react49.useCallback)(
6322
6314
  async ({
6323
6315
  redirect_uri,
6324
6316
  state,
@@ -6345,7 +6337,7 @@ function useViewService() {
6345
6337
  },
6346
6338
  [env]
6347
6339
  );
6348
- const removeTotpSetUp = (0, import_react47.useCallback)(
6340
+ const removeTotpSetUp = (0, import_react49.useCallback)(
6349
6341
  async ({ method, token }) => {
6350
6342
  const jsonData = {
6351
6343
  method,
@@ -6366,7 +6358,7 @@ function useViewService() {
6366
6358
  },
6367
6359
  [env]
6368
6360
  );
6369
- const requestSetupTotp = (0, import_react47.useCallback)(
6361
+ const requestSetupTotp = (0, import_react49.useCallback)(
6370
6362
  async ({ method, token }) => {
6371
6363
  const jsonData = {
6372
6364
  method,
@@ -6385,7 +6377,7 @@ function useViewService() {
6385
6377
  },
6386
6378
  [env]
6387
6379
  );
6388
- const settingsWebRead2fa = (0, import_react47.useCallback)(
6380
+ const settingsWebRead2fa = (0, import_react49.useCallback)(
6389
6381
  async ({
6390
6382
  method,
6391
6383
  model,
@@ -6413,7 +6405,7 @@ function useViewService() {
6413
6405
  },
6414
6406
  [env]
6415
6407
  );
6416
- const signInSSO = (0, import_react47.useCallback)(
6408
+ const signInSSO = (0, import_react49.useCallback)(
6417
6409
  async ({
6418
6410
  redirect_uri,
6419
6411
  state,
@@ -6445,7 +6437,7 @@ function useViewService() {
6445
6437
  },
6446
6438
  [env]
6447
6439
  );
6448
- const verify2FA = (0, import_react47.useCallback)(
6440
+ const verify2FA = (0, import_react49.useCallback)(
6449
6441
  ({
6450
6442
  method,
6451
6443
  with_context,
@@ -6478,7 +6470,7 @@ function useViewService() {
6478
6470
  },
6479
6471
  [env]
6480
6472
  );
6481
- const get2FAMethods = (0, import_react47.useCallback)(
6473
+ const get2FAMethods = (0, import_react49.useCallback)(
6482
6474
  ({ method, with_context }) => {
6483
6475
  const jsonData = {
6484
6476
  method,
@@ -6497,7 +6489,7 @@ function useViewService() {
6497
6489
  },
6498
6490
  [env]
6499
6491
  );
6500
- const verifyTotp = (0, import_react47.useCallback)(
6492
+ const verifyTotp = (0, import_react49.useCallback)(
6501
6493
  ({
6502
6494
  method,
6503
6495
  action_token,
@@ -6522,7 +6514,7 @@ function useViewService() {
6522
6514
  },
6523
6515
  [env]
6524
6516
  );
6525
- const getNotifications = (0, import_react47.useCallback)(
6517
+ const getNotifications = (0, import_react49.useCallback)(
6526
6518
  async ({
6527
6519
  service,
6528
6520
  xNode,
@@ -6542,7 +6534,7 @@ function useViewService() {
6542
6534
  },
6543
6535
  [env]
6544
6536
  );
6545
- const getCountry = (0, import_react47.useCallback)(
6537
+ const getCountry = (0, import_react49.useCallback)(
6546
6538
  async ({
6547
6539
  service,
6548
6540
  xNode,
@@ -6569,7 +6561,7 @@ function useViewService() {
6569
6561
  },
6570
6562
  [env]
6571
6563
  );
6572
- const getCity = (0, import_react47.useCallback)(
6564
+ const getCity = (0, import_react49.useCallback)(
6573
6565
  async ({
6574
6566
  service,
6575
6567
  xNode,
@@ -6596,7 +6588,7 @@ function useViewService() {
6596
6588
  },
6597
6589
  [env]
6598
6590
  );
6599
- const getWard = (0, import_react47.useCallback)(
6591
+ const getWard = (0, import_react49.useCallback)(
6600
6592
  async ({
6601
6593
  service,
6602
6594
  xNode,
@@ -6621,7 +6613,7 @@ function useViewService() {
6621
6613
  },
6622
6614
  [env]
6623
6615
  );
6624
- const getPartnerTitle = (0, import_react47.useCallback)(
6616
+ const getPartnerTitle = (0, import_react49.useCallback)(
6625
6617
  async ({
6626
6618
  service,
6627
6619
  xNode,
@@ -6673,10 +6665,10 @@ function useViewService() {
6673
6665
  }
6674
6666
 
6675
6667
  // src/services/dashboard-service/index.ts
6676
- var import_react48 = require("react");
6668
+ var import_react50 = require("react");
6677
6669
  function useDashboardService() {
6678
6670
  const { env } = useEnv();
6679
- const readGroup = (0, import_react48.useCallback)(
6671
+ const readGroup = (0, import_react50.useCallback)(
6680
6672
  async ({
6681
6673
  service,
6682
6674
  xNode,
@@ -6693,7 +6685,7 @@ function useDashboardService() {
6693
6685
  },
6694
6686
  [env]
6695
6687
  );
6696
- const getDataChart = (0, import_react48.useCallback)(
6688
+ const getDataChart = (0, import_react50.useCallback)(
6697
6689
  async ({
6698
6690
  service,
6699
6691
  xNode,