@fctc/interface-logic 4.7.8 → 4.7.9
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/hooks.d.mts +18 -1
- package/dist/hooks.d.ts +18 -1
- package/dist/hooks.js +63 -3
- package/dist/hooks.mjs +62 -3
- package/dist/provider.d.mts +2 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.js +84 -25
- package/dist/provider.mjs +73 -14
- package/dist/services.d.mts +17 -0
- package/dist/services.d.ts +17 -0
- package/dist/services.js +148 -97
- package/dist/services.mjs +145 -94
- package/package.json +1 -1
package/dist/services.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/services/action-service/index.ts
|
|
2
|
-
import { useCallback as
|
|
2
|
+
import { useCallback as useCallback48 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/constants/api/uri-constant.ts
|
|
5
5
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -4818,6 +4818,53 @@ var addCategorySupabaseService = () => {
|
|
|
4818
4818
|
};
|
|
4819
4819
|
};
|
|
4820
4820
|
|
|
4821
|
+
// src/services/pos-service/supabase/add-product.ts
|
|
4822
|
+
import { useCallback as useCallback47 } from "react";
|
|
4823
|
+
var addProductSupabaseService = () => {
|
|
4824
|
+
const supabase = useSupabaseOptional();
|
|
4825
|
+
const addProductSupabase = useCallback47(
|
|
4826
|
+
async (values) => {
|
|
4827
|
+
if (!supabase) {
|
|
4828
|
+
console.error("Supabase client not initialized");
|
|
4829
|
+
return null;
|
|
4830
|
+
}
|
|
4831
|
+
const insertData = Object.fromEntries(
|
|
4832
|
+
Object.entries({
|
|
4833
|
+
name: values.name,
|
|
4834
|
+
product_tmpl_id: values.product_tmpl_id,
|
|
4835
|
+
product_template_variant_value_ids: values.product_template_variant_value_ids ?? [],
|
|
4836
|
+
combo_ids: values.combo_ids ?? [],
|
|
4837
|
+
categ_id: values.categ_id,
|
|
4838
|
+
pos_categ_ids: values.pos_categ_ids ?? [],
|
|
4839
|
+
display_name: values.display_name || values.name,
|
|
4840
|
+
default_code: values.default_code ?? "",
|
|
4841
|
+
description_sale: values.description_sale ?? "",
|
|
4842
|
+
lst_price: values.lst_price ?? 0,
|
|
4843
|
+
standard_price: values.standard_price ?? 0,
|
|
4844
|
+
barcode: values.barcode ?? "",
|
|
4845
|
+
image_url: values.image_url ?? "",
|
|
4846
|
+
active: values.active ?? true
|
|
4847
|
+
}).filter(([_, v]) => v !== void 0)
|
|
4848
|
+
);
|
|
4849
|
+
try {
|
|
4850
|
+
const { data, error } = await supabase.from("products" /* PRODUCTS */).insert(insertData).select("id, name").single();
|
|
4851
|
+
if (error) {
|
|
4852
|
+
console.error("Error adding product:", error);
|
|
4853
|
+
return null;
|
|
4854
|
+
}
|
|
4855
|
+
return [[data.id, data.name]];
|
|
4856
|
+
} catch (error) {
|
|
4857
|
+
console.error("Error adding product:", error);
|
|
4858
|
+
return null;
|
|
4859
|
+
}
|
|
4860
|
+
},
|
|
4861
|
+
[supabase]
|
|
4862
|
+
);
|
|
4863
|
+
return {
|
|
4864
|
+
addProductSupabase
|
|
4865
|
+
};
|
|
4866
|
+
};
|
|
4867
|
+
|
|
4821
4868
|
// src/services/pos-service/index.ts
|
|
4822
4869
|
var serviceFactories = [
|
|
4823
4870
|
addEntityService,
|
|
@@ -4863,7 +4910,8 @@ var serviceFactories = [
|
|
|
4863
4910
|
updateOrderLineSupabaseService,
|
|
4864
4911
|
updateOrderSupabaseService,
|
|
4865
4912
|
deleteOrderSupabaseService,
|
|
4866
|
-
deleteOrderLineSupabaseService
|
|
4913
|
+
deleteOrderLineSupabaseService,
|
|
4914
|
+
addProductSupabaseService
|
|
4867
4915
|
];
|
|
4868
4916
|
var usePosService = () => {
|
|
4869
4917
|
const { env } = useEnv();
|
|
@@ -5004,6 +5052,9 @@ import { useMutation as useMutation100 } from "@tanstack/react-query";
|
|
|
5004
5052
|
// src/hooks/pos/supabase/use-delete-order-line.ts
|
|
5005
5053
|
import { useMutation as useMutation101 } from "@tanstack/react-query";
|
|
5006
5054
|
|
|
5055
|
+
// src/hooks/pos/supabase/use-add-product.ts
|
|
5056
|
+
import { useMutation as useMutation102 } from "@tanstack/react-query";
|
|
5057
|
+
|
|
5007
5058
|
// src/provider/service-provider.tsx
|
|
5008
5059
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5009
5060
|
var ServiceContext = createContext3(null);
|
|
@@ -5015,7 +5066,7 @@ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
|
5015
5066
|
// src/services/action-service/index.ts
|
|
5016
5067
|
function useActionService() {
|
|
5017
5068
|
const { env } = useEnv();
|
|
5018
|
-
const loadAction =
|
|
5069
|
+
const loadAction = useCallback48(
|
|
5019
5070
|
async ({
|
|
5020
5071
|
idAction,
|
|
5021
5072
|
context,
|
|
@@ -5039,7 +5090,7 @@ function useActionService() {
|
|
|
5039
5090
|
},
|
|
5040
5091
|
[env]
|
|
5041
5092
|
);
|
|
5042
|
-
const callButton =
|
|
5093
|
+
const callButton = useCallback48(
|
|
5043
5094
|
async ({
|
|
5044
5095
|
model,
|
|
5045
5096
|
ids = [],
|
|
@@ -5073,7 +5124,7 @@ function useActionService() {
|
|
|
5073
5124
|
},
|
|
5074
5125
|
[env]
|
|
5075
5126
|
);
|
|
5076
|
-
const removeRows =
|
|
5127
|
+
const removeRows = useCallback48(
|
|
5077
5128
|
async ({
|
|
5078
5129
|
model,
|
|
5079
5130
|
ids,
|
|
@@ -5099,7 +5150,7 @@ function useActionService() {
|
|
|
5099
5150
|
},
|
|
5100
5151
|
[env]
|
|
5101
5152
|
);
|
|
5102
|
-
const duplicateRecord =
|
|
5153
|
+
const duplicateRecord = useCallback48(
|
|
5103
5154
|
async ({
|
|
5104
5155
|
model,
|
|
5105
5156
|
id,
|
|
@@ -5125,7 +5176,7 @@ function useActionService() {
|
|
|
5125
5176
|
},
|
|
5126
5177
|
[env]
|
|
5127
5178
|
);
|
|
5128
|
-
const getPrintReportName =
|
|
5179
|
+
const getPrintReportName = useCallback48(
|
|
5129
5180
|
async ({ id }) => {
|
|
5130
5181
|
const jsonData = {
|
|
5131
5182
|
model: "ir.actions.report",
|
|
@@ -5143,7 +5194,7 @@ function useActionService() {
|
|
|
5143
5194
|
},
|
|
5144
5195
|
[env]
|
|
5145
5196
|
);
|
|
5146
|
-
const print =
|
|
5197
|
+
const print = useCallback48(
|
|
5147
5198
|
async ({ id, report, db }) => {
|
|
5148
5199
|
const jsonData = {
|
|
5149
5200
|
report,
|
|
@@ -5161,7 +5212,7 @@ function useActionService() {
|
|
|
5161
5212
|
},
|
|
5162
5213
|
[env]
|
|
5163
5214
|
);
|
|
5164
|
-
const runAction =
|
|
5215
|
+
const runAction = useCallback48(
|
|
5165
5216
|
async ({
|
|
5166
5217
|
idAction,
|
|
5167
5218
|
context,
|
|
@@ -5188,7 +5239,7 @@ function useActionService() {
|
|
|
5188
5239
|
},
|
|
5189
5240
|
[env]
|
|
5190
5241
|
);
|
|
5191
|
-
const generateSerialNumber =
|
|
5242
|
+
const generateSerialNumber = useCallback48(
|
|
5192
5243
|
async ({
|
|
5193
5244
|
kwargs,
|
|
5194
5245
|
context,
|
|
@@ -5226,11 +5277,11 @@ function useActionService() {
|
|
|
5226
5277
|
}
|
|
5227
5278
|
|
|
5228
5279
|
// src/services/auth-service/index.ts
|
|
5229
|
-
import { useCallback as
|
|
5280
|
+
import { useCallback as useCallback49 } from "react";
|
|
5230
5281
|
function useAuthService() {
|
|
5231
5282
|
const { env } = useEnv();
|
|
5232
5283
|
const supabase = useSupabaseOptional();
|
|
5233
|
-
const login =
|
|
5284
|
+
const login = useCallback49(
|
|
5234
5285
|
async (body) => {
|
|
5235
5286
|
const payload = Object.fromEntries(
|
|
5236
5287
|
Object.entries({
|
|
@@ -5255,7 +5306,7 @@ function useAuthService() {
|
|
|
5255
5306
|
},
|
|
5256
5307
|
[env]
|
|
5257
5308
|
);
|
|
5258
|
-
const loginSupabase =
|
|
5309
|
+
const loginSupabase = useCallback49(
|
|
5259
5310
|
async (body) => {
|
|
5260
5311
|
if (!supabase) {
|
|
5261
5312
|
return {
|
|
@@ -5271,7 +5322,7 @@ function useAuthService() {
|
|
|
5271
5322
|
},
|
|
5272
5323
|
[supabase]
|
|
5273
5324
|
);
|
|
5274
|
-
const forgotPassword =
|
|
5325
|
+
const forgotPassword = useCallback49(
|
|
5275
5326
|
async (email) => {
|
|
5276
5327
|
const bodyData = {
|
|
5277
5328
|
login: email,
|
|
@@ -5285,7 +5336,7 @@ function useAuthService() {
|
|
|
5285
5336
|
},
|
|
5286
5337
|
[env]
|
|
5287
5338
|
);
|
|
5288
|
-
const forgotPasswordSSO =
|
|
5339
|
+
const forgotPasswordSSO = useCallback49(
|
|
5289
5340
|
async ({
|
|
5290
5341
|
email,
|
|
5291
5342
|
with_context,
|
|
@@ -5308,7 +5359,7 @@ function useAuthService() {
|
|
|
5308
5359
|
},
|
|
5309
5360
|
[env]
|
|
5310
5361
|
);
|
|
5311
|
-
const resetPassword =
|
|
5362
|
+
const resetPassword = useCallback49(
|
|
5312
5363
|
async (data, token) => {
|
|
5313
5364
|
const bodyData = {
|
|
5314
5365
|
token,
|
|
@@ -5323,7 +5374,7 @@ function useAuthService() {
|
|
|
5323
5374
|
},
|
|
5324
5375
|
[env]
|
|
5325
5376
|
);
|
|
5326
|
-
const resetPasswordSSO =
|
|
5377
|
+
const resetPasswordSSO = useCallback49(
|
|
5327
5378
|
async ({
|
|
5328
5379
|
method,
|
|
5329
5380
|
password,
|
|
@@ -5346,7 +5397,7 @@ function useAuthService() {
|
|
|
5346
5397
|
},
|
|
5347
5398
|
[env]
|
|
5348
5399
|
);
|
|
5349
|
-
const updatePassword =
|
|
5400
|
+
const updatePassword = useCallback49(
|
|
5350
5401
|
async (data, token) => {
|
|
5351
5402
|
const bodyData = {
|
|
5352
5403
|
token,
|
|
@@ -5361,7 +5412,7 @@ function useAuthService() {
|
|
|
5361
5412
|
},
|
|
5362
5413
|
[env]
|
|
5363
5414
|
);
|
|
5364
|
-
const isValidToken =
|
|
5415
|
+
const isValidToken = useCallback49(
|
|
5365
5416
|
async (token) => {
|
|
5366
5417
|
const bodyData = {
|
|
5367
5418
|
token
|
|
@@ -5374,7 +5425,7 @@ function useAuthService() {
|
|
|
5374
5425
|
},
|
|
5375
5426
|
[env]
|
|
5376
5427
|
);
|
|
5377
|
-
const isValidActionToken =
|
|
5428
|
+
const isValidActionToken = useCallback49(
|
|
5378
5429
|
async (actionToken) => {
|
|
5379
5430
|
const bodyData = {};
|
|
5380
5431
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5387,7 +5438,7 @@ function useAuthService() {
|
|
|
5387
5438
|
},
|
|
5388
5439
|
[env]
|
|
5389
5440
|
);
|
|
5390
|
-
const loginSocial =
|
|
5441
|
+
const loginSocial = useCallback49(
|
|
5391
5442
|
async ({
|
|
5392
5443
|
db,
|
|
5393
5444
|
state,
|
|
@@ -5405,13 +5456,13 @@ function useAuthService() {
|
|
|
5405
5456
|
},
|
|
5406
5457
|
[env]
|
|
5407
5458
|
);
|
|
5408
|
-
const getProviders =
|
|
5459
|
+
const getProviders = useCallback49(
|
|
5409
5460
|
async (db) => {
|
|
5410
5461
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5411
5462
|
},
|
|
5412
5463
|
[env]
|
|
5413
5464
|
);
|
|
5414
|
-
const getAccessByCode =
|
|
5465
|
+
const getAccessByCode = useCallback49(
|
|
5415
5466
|
async (code) => {
|
|
5416
5467
|
const data = new URLSearchParams();
|
|
5417
5468
|
data.append("code", code);
|
|
@@ -5431,7 +5482,7 @@ function useAuthService() {
|
|
|
5431
5482
|
},
|
|
5432
5483
|
[env]
|
|
5433
5484
|
);
|
|
5434
|
-
const logout =
|
|
5485
|
+
const logout = useCallback49(
|
|
5435
5486
|
async (service) => {
|
|
5436
5487
|
return env?.requests?.post(
|
|
5437
5488
|
"/logout" /* LOGOUT */,
|
|
@@ -5448,7 +5499,7 @@ function useAuthService() {
|
|
|
5448
5499
|
},
|
|
5449
5500
|
[env]
|
|
5450
5501
|
);
|
|
5451
|
-
const getTenantMapping =
|
|
5502
|
+
const getTenantMapping = useCallback49(
|
|
5452
5503
|
async ({ shortName, service }) => {
|
|
5453
5504
|
const bodyData = {
|
|
5454
5505
|
short_name: shortName
|
|
@@ -5466,7 +5517,7 @@ function useAuthService() {
|
|
|
5466
5517
|
},
|
|
5467
5518
|
[env]
|
|
5468
5519
|
);
|
|
5469
|
-
const getToken =
|
|
5520
|
+
const getToken = useCallback49(
|
|
5470
5521
|
async ({
|
|
5471
5522
|
phone,
|
|
5472
5523
|
name,
|
|
@@ -5511,10 +5562,10 @@ function useAuthService() {
|
|
|
5511
5562
|
}
|
|
5512
5563
|
|
|
5513
5564
|
// src/services/company-service/index.ts
|
|
5514
|
-
import { useCallback as
|
|
5565
|
+
import { useCallback as useCallback50 } from "react";
|
|
5515
5566
|
function useCompanyService() {
|
|
5516
5567
|
const { env } = useEnv();
|
|
5517
|
-
const getCurrentCompany =
|
|
5568
|
+
const getCurrentCompany = useCallback50(
|
|
5518
5569
|
async (service, extraHeaders) => {
|
|
5519
5570
|
return await env.requests.get(
|
|
5520
5571
|
"/company" /* COMPANY_PATH */,
|
|
@@ -5531,7 +5582,7 @@ function useCompanyService() {
|
|
|
5531
5582
|
},
|
|
5532
5583
|
[env]
|
|
5533
5584
|
);
|
|
5534
|
-
const getInfoCompany =
|
|
5585
|
+
const getInfoCompany = useCallback50(
|
|
5535
5586
|
async (id, service) => {
|
|
5536
5587
|
const jsonData = {
|
|
5537
5588
|
ids: [id],
|
|
@@ -5567,10 +5618,10 @@ function useCompanyService() {
|
|
|
5567
5618
|
}
|
|
5568
5619
|
|
|
5569
5620
|
// src/services/excel-service/index.ts
|
|
5570
|
-
import { useCallback as
|
|
5621
|
+
import { useCallback as useCallback51 } from "react";
|
|
5571
5622
|
function useExcelService() {
|
|
5572
5623
|
const { env } = useEnv();
|
|
5573
|
-
const uploadFileExcel =
|
|
5624
|
+
const uploadFileExcel = useCallback51(
|
|
5574
5625
|
async ({
|
|
5575
5626
|
formData,
|
|
5576
5627
|
service,
|
|
@@ -5587,7 +5638,7 @@ function useExcelService() {
|
|
|
5587
5638
|
},
|
|
5588
5639
|
[env]
|
|
5589
5640
|
);
|
|
5590
|
-
const uploadIdFile =
|
|
5641
|
+
const uploadIdFile = useCallback51(
|
|
5591
5642
|
async ({
|
|
5592
5643
|
formData,
|
|
5593
5644
|
service,
|
|
@@ -5604,7 +5655,7 @@ function useExcelService() {
|
|
|
5604
5655
|
},
|
|
5605
5656
|
[env]
|
|
5606
5657
|
);
|
|
5607
|
-
const parsePreview =
|
|
5658
|
+
const parsePreview = useCallback51(
|
|
5608
5659
|
async ({
|
|
5609
5660
|
id,
|
|
5610
5661
|
selectedSheet,
|
|
@@ -5653,7 +5704,7 @@ function useExcelService() {
|
|
|
5653
5704
|
},
|
|
5654
5705
|
[env]
|
|
5655
5706
|
);
|
|
5656
|
-
const executeImport =
|
|
5707
|
+
const executeImport = useCallback51(
|
|
5657
5708
|
async ({
|
|
5658
5709
|
columns,
|
|
5659
5710
|
fields,
|
|
@@ -5687,7 +5738,7 @@ function useExcelService() {
|
|
|
5687
5738
|
},
|
|
5688
5739
|
[env]
|
|
5689
5740
|
);
|
|
5690
|
-
const getFileExcel =
|
|
5741
|
+
const getFileExcel = useCallback51(
|
|
5691
5742
|
async ({
|
|
5692
5743
|
model,
|
|
5693
5744
|
service,
|
|
@@ -5711,7 +5762,7 @@ function useExcelService() {
|
|
|
5711
5762
|
},
|
|
5712
5763
|
[env]
|
|
5713
5764
|
);
|
|
5714
|
-
const getFieldExport =
|
|
5765
|
+
const getFieldExport = useCallback51(
|
|
5715
5766
|
async ({
|
|
5716
5767
|
ids,
|
|
5717
5768
|
model,
|
|
@@ -5751,7 +5802,7 @@ function useExcelService() {
|
|
|
5751
5802
|
},
|
|
5752
5803
|
[env]
|
|
5753
5804
|
);
|
|
5754
|
-
const exportExcel =
|
|
5805
|
+
const exportExcel = useCallback51(
|
|
5755
5806
|
async ({
|
|
5756
5807
|
model,
|
|
5757
5808
|
domain,
|
|
@@ -5799,10 +5850,10 @@ function useExcelService() {
|
|
|
5799
5850
|
}
|
|
5800
5851
|
|
|
5801
5852
|
// src/services/form-service/index.ts
|
|
5802
|
-
import { useCallback as
|
|
5853
|
+
import { useCallback as useCallback52 } from "react";
|
|
5803
5854
|
function useFormService() {
|
|
5804
5855
|
const { env } = useEnv();
|
|
5805
|
-
const getComment =
|
|
5856
|
+
const getComment = useCallback52(
|
|
5806
5857
|
async ({ data }) => {
|
|
5807
5858
|
const jsonData = {
|
|
5808
5859
|
thread_id: data.thread_id,
|
|
@@ -5820,7 +5871,7 @@ function useFormService() {
|
|
|
5820
5871
|
},
|
|
5821
5872
|
[env]
|
|
5822
5873
|
);
|
|
5823
|
-
const getThreadData =
|
|
5874
|
+
const getThreadData = useCallback52(
|
|
5824
5875
|
async ({
|
|
5825
5876
|
data,
|
|
5826
5877
|
xNode,
|
|
@@ -5847,7 +5898,7 @@ function useFormService() {
|
|
|
5847
5898
|
},
|
|
5848
5899
|
[env]
|
|
5849
5900
|
);
|
|
5850
|
-
const getThreadMessages =
|
|
5901
|
+
const getThreadMessages = useCallback52(
|
|
5851
5902
|
async ({
|
|
5852
5903
|
data,
|
|
5853
5904
|
xNode,
|
|
@@ -5873,7 +5924,7 @@ function useFormService() {
|
|
|
5873
5924
|
},
|
|
5874
5925
|
[env]
|
|
5875
5926
|
);
|
|
5876
|
-
const sentComment =
|
|
5927
|
+
const sentComment = useCallback52(
|
|
5877
5928
|
async ({ data }) => {
|
|
5878
5929
|
const jsonData = {
|
|
5879
5930
|
context: {
|
|
@@ -5901,7 +5952,7 @@ function useFormService() {
|
|
|
5901
5952
|
},
|
|
5902
5953
|
[env]
|
|
5903
5954
|
);
|
|
5904
|
-
const deleteComment =
|
|
5955
|
+
const deleteComment = useCallback52(
|
|
5905
5956
|
async ({ data }) => {
|
|
5906
5957
|
const jsonData = {
|
|
5907
5958
|
attachment_ids: [],
|
|
@@ -5917,7 +5968,7 @@ function useFormService() {
|
|
|
5917
5968
|
},
|
|
5918
5969
|
[env]
|
|
5919
5970
|
);
|
|
5920
|
-
const getImage =
|
|
5971
|
+
const getImage = useCallback52(
|
|
5921
5972
|
async ({ data }) => {
|
|
5922
5973
|
return env.requests.get(
|
|
5923
5974
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -5930,7 +5981,7 @@ function useFormService() {
|
|
|
5930
5981
|
},
|
|
5931
5982
|
[env]
|
|
5932
5983
|
);
|
|
5933
|
-
const uploadImage =
|
|
5984
|
+
const uploadImage = useCallback52(
|
|
5934
5985
|
async ({
|
|
5935
5986
|
formData,
|
|
5936
5987
|
service,
|
|
@@ -5949,7 +6000,7 @@ function useFormService() {
|
|
|
5949
6000
|
},
|
|
5950
6001
|
[env]
|
|
5951
6002
|
);
|
|
5952
|
-
const uploadFile =
|
|
6003
|
+
const uploadFile = useCallback52(
|
|
5953
6004
|
async ({
|
|
5954
6005
|
formData,
|
|
5955
6006
|
service,
|
|
@@ -5969,7 +6020,7 @@ function useFormService() {
|
|
|
5969
6020
|
},
|
|
5970
6021
|
[env]
|
|
5971
6022
|
);
|
|
5972
|
-
const getFormView =
|
|
6023
|
+
const getFormView = useCallback52(
|
|
5973
6024
|
async ({ data }) => {
|
|
5974
6025
|
const jsonData = {
|
|
5975
6026
|
model: data.model,
|
|
@@ -5985,7 +6036,7 @@ function useFormService() {
|
|
|
5985
6036
|
},
|
|
5986
6037
|
[env]
|
|
5987
6038
|
);
|
|
5988
|
-
const changeStatus =
|
|
6039
|
+
const changeStatus = useCallback52(
|
|
5989
6040
|
async ({ data }) => {
|
|
5990
6041
|
const vals = {
|
|
5991
6042
|
[data.name]: data.stage_id
|
|
@@ -6014,7 +6065,7 @@ function useFormService() {
|
|
|
6014
6065
|
},
|
|
6015
6066
|
[env]
|
|
6016
6067
|
);
|
|
6017
|
-
const getExternalTab =
|
|
6068
|
+
const getExternalTab = useCallback52(
|
|
6018
6069
|
async ({ method, context, service, xNode }) => {
|
|
6019
6070
|
return env?.requests?.post(
|
|
6020
6071
|
"/call" /* CALL_PATH */,
|
|
@@ -6049,10 +6100,10 @@ function useFormService() {
|
|
|
6049
6100
|
}
|
|
6050
6101
|
|
|
6051
6102
|
// src/services/kanban-service/index.ts
|
|
6052
|
-
import { useCallback as
|
|
6103
|
+
import { useCallback as useCallback53 } from "react";
|
|
6053
6104
|
function useKanbanService() {
|
|
6054
6105
|
const { env } = useEnv();
|
|
6055
|
-
const getGroups =
|
|
6106
|
+
const getGroups = useCallback53(
|
|
6056
6107
|
async ({ model, width_context }) => {
|
|
6057
6108
|
const jsonData = {
|
|
6058
6109
|
model,
|
|
@@ -6072,7 +6123,7 @@ function useKanbanService() {
|
|
|
6072
6123
|
},
|
|
6073
6124
|
[env]
|
|
6074
6125
|
);
|
|
6075
|
-
const getProgressBar =
|
|
6126
|
+
const getProgressBar = useCallback53(
|
|
6076
6127
|
async ({ field, color, model, width_context }) => {
|
|
6077
6128
|
const jsonData = {
|
|
6078
6129
|
model,
|
|
@@ -6102,10 +6153,10 @@ function useKanbanService() {
|
|
|
6102
6153
|
}
|
|
6103
6154
|
|
|
6104
6155
|
// src/services/model-service/index.ts
|
|
6105
|
-
import { useCallback as
|
|
6156
|
+
import { useCallback as useCallback54 } from "react";
|
|
6106
6157
|
function useModelService() {
|
|
6107
6158
|
const { env } = useEnv();
|
|
6108
|
-
const getListMyBankAccount =
|
|
6159
|
+
const getListMyBankAccount = useCallback54(
|
|
6109
6160
|
async ({
|
|
6110
6161
|
domain,
|
|
6111
6162
|
spectification,
|
|
@@ -6129,7 +6180,7 @@ function useModelService() {
|
|
|
6129
6180
|
},
|
|
6130
6181
|
[env]
|
|
6131
6182
|
);
|
|
6132
|
-
const getCurrency =
|
|
6183
|
+
const getCurrency = useCallback54(async () => {
|
|
6133
6184
|
const jsonData = {
|
|
6134
6185
|
model: "res.currency",
|
|
6135
6186
|
method: "web_search_read",
|
|
@@ -6149,7 +6200,7 @@ function useModelService() {
|
|
|
6149
6200
|
}
|
|
6150
6201
|
});
|
|
6151
6202
|
}, [env]);
|
|
6152
|
-
const getConversionRate =
|
|
6203
|
+
const getConversionRate = useCallback54(async () => {
|
|
6153
6204
|
const jsonData = {
|
|
6154
6205
|
model: "res.currency",
|
|
6155
6206
|
method: "web_search_read",
|
|
@@ -6175,7 +6226,7 @@ function useModelService() {
|
|
|
6175
6226
|
}
|
|
6176
6227
|
});
|
|
6177
6228
|
}, [env]);
|
|
6178
|
-
const getAll =
|
|
6229
|
+
const getAll = useCallback54(
|
|
6179
6230
|
async ({
|
|
6180
6231
|
data,
|
|
6181
6232
|
service,
|
|
@@ -6217,7 +6268,7 @@ function useModelService() {
|
|
|
6217
6268
|
},
|
|
6218
6269
|
[env]
|
|
6219
6270
|
);
|
|
6220
|
-
const getListCalendar =
|
|
6271
|
+
const getListCalendar = useCallback54(
|
|
6221
6272
|
async ({ data }) => {
|
|
6222
6273
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6223
6274
|
fields: data.fields,
|
|
@@ -6248,7 +6299,7 @@ function useModelService() {
|
|
|
6248
6299
|
},
|
|
6249
6300
|
[env]
|
|
6250
6301
|
);
|
|
6251
|
-
const getList =
|
|
6302
|
+
const getList = useCallback54(
|
|
6252
6303
|
async ({
|
|
6253
6304
|
model,
|
|
6254
6305
|
ids = [],
|
|
@@ -6280,7 +6331,7 @@ function useModelService() {
|
|
|
6280
6331
|
},
|
|
6281
6332
|
[env]
|
|
6282
6333
|
);
|
|
6283
|
-
const getDetail =
|
|
6334
|
+
const getDetail = useCallback54(
|
|
6284
6335
|
async ({
|
|
6285
6336
|
ids = [],
|
|
6286
6337
|
model,
|
|
@@ -6312,7 +6363,7 @@ function useModelService() {
|
|
|
6312
6363
|
},
|
|
6313
6364
|
[env]
|
|
6314
6365
|
);
|
|
6315
|
-
const save =
|
|
6366
|
+
const save = useCallback54(
|
|
6316
6367
|
async ({
|
|
6317
6368
|
model,
|
|
6318
6369
|
ids = [],
|
|
@@ -6347,7 +6398,7 @@ function useModelService() {
|
|
|
6347
6398
|
},
|
|
6348
6399
|
[env]
|
|
6349
6400
|
);
|
|
6350
|
-
const deleteApi =
|
|
6401
|
+
const deleteApi = useCallback54(
|
|
6351
6402
|
async ({ ids = [], model, service }) => {
|
|
6352
6403
|
const jsonData = {
|
|
6353
6404
|
model,
|
|
@@ -6367,7 +6418,7 @@ function useModelService() {
|
|
|
6367
6418
|
},
|
|
6368
6419
|
[env]
|
|
6369
6420
|
);
|
|
6370
|
-
const onChange =
|
|
6421
|
+
const onChange = useCallback54(
|
|
6371
6422
|
async ({
|
|
6372
6423
|
ids = [],
|
|
6373
6424
|
model,
|
|
@@ -6403,7 +6454,7 @@ function useModelService() {
|
|
|
6403
6454
|
},
|
|
6404
6455
|
[env]
|
|
6405
6456
|
);
|
|
6406
|
-
const getListFieldsOnchange =
|
|
6457
|
+
const getListFieldsOnchange = useCallback54(
|
|
6407
6458
|
async ({
|
|
6408
6459
|
model,
|
|
6409
6460
|
service,
|
|
@@ -6427,7 +6478,7 @@ function useModelService() {
|
|
|
6427
6478
|
},
|
|
6428
6479
|
[env]
|
|
6429
6480
|
);
|
|
6430
|
-
const parseORMOdoo =
|
|
6481
|
+
const parseORMOdoo = useCallback54((data) => {
|
|
6431
6482
|
for (const key in data) {
|
|
6432
6483
|
if (key === "display_name") {
|
|
6433
6484
|
delete data[key];
|
|
@@ -6438,7 +6489,7 @@ function useModelService() {
|
|
|
6438
6489
|
}
|
|
6439
6490
|
return { ...data };
|
|
6440
6491
|
}, []);
|
|
6441
|
-
const toDataJS =
|
|
6492
|
+
const toDataJS = useCallback54(
|
|
6442
6493
|
(data, viewData, model) => {
|
|
6443
6494
|
for (const key in data) {
|
|
6444
6495
|
if (data[key] === false) {
|
|
@@ -6496,10 +6547,10 @@ function useModelService() {
|
|
|
6496
6547
|
}
|
|
6497
6548
|
|
|
6498
6549
|
// src/services/user-service/index.ts
|
|
6499
|
-
import { useCallback as
|
|
6550
|
+
import { useCallback as useCallback55 } from "react";
|
|
6500
6551
|
function useUserService() {
|
|
6501
6552
|
const { env } = useEnv();
|
|
6502
|
-
const getProfile =
|
|
6553
|
+
const getProfile = useCallback55(
|
|
6503
6554
|
async (service, path, extraHeaders) => {
|
|
6504
6555
|
return env?.requests?.get(
|
|
6505
6556
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -6516,7 +6567,7 @@ function useUserService() {
|
|
|
6516
6567
|
},
|
|
6517
6568
|
[env]
|
|
6518
6569
|
);
|
|
6519
|
-
const getUser =
|
|
6570
|
+
const getUser = useCallback55(
|
|
6520
6571
|
async ({ context, id }) => {
|
|
6521
6572
|
const jsonData = {
|
|
6522
6573
|
model: "res.users",
|
|
@@ -6554,7 +6605,7 @@ function useUserService() {
|
|
|
6554
6605
|
},
|
|
6555
6606
|
[env]
|
|
6556
6607
|
);
|
|
6557
|
-
const switchUserLocale =
|
|
6608
|
+
const switchUserLocale = useCallback55(
|
|
6558
6609
|
async ({ id, values, service }) => {
|
|
6559
6610
|
const jsonData = {
|
|
6560
6611
|
model: "res.users",
|
|
@@ -6582,10 +6633,10 @@ function useUserService() {
|
|
|
6582
6633
|
}
|
|
6583
6634
|
|
|
6584
6635
|
// src/services/view-service/index.ts
|
|
6585
|
-
import { useCallback as
|
|
6636
|
+
import { useCallback as useCallback56 } from "react";
|
|
6586
6637
|
function useViewService() {
|
|
6587
6638
|
const { env } = useEnv();
|
|
6588
|
-
const getView =
|
|
6639
|
+
const getView = useCallback56(
|
|
6589
6640
|
async ({
|
|
6590
6641
|
model,
|
|
6591
6642
|
views,
|
|
@@ -6625,7 +6676,7 @@ function useViewService() {
|
|
|
6625
6676
|
},
|
|
6626
6677
|
[env]
|
|
6627
6678
|
);
|
|
6628
|
-
const getMenu =
|
|
6679
|
+
const getMenu = useCallback56(
|
|
6629
6680
|
async (context, specification, domain, service) => {
|
|
6630
6681
|
const jsonData = {
|
|
6631
6682
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -6656,7 +6707,7 @@ function useViewService() {
|
|
|
6656
6707
|
},
|
|
6657
6708
|
[env]
|
|
6658
6709
|
);
|
|
6659
|
-
const getActionDetail =
|
|
6710
|
+
const getActionDetail = useCallback56(
|
|
6660
6711
|
async (aid, context) => {
|
|
6661
6712
|
const jsonData = {
|
|
6662
6713
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -6686,7 +6737,7 @@ function useViewService() {
|
|
|
6686
6737
|
},
|
|
6687
6738
|
[env]
|
|
6688
6739
|
);
|
|
6689
|
-
const getResequence =
|
|
6740
|
+
const getResequence = useCallback56(
|
|
6690
6741
|
async ({
|
|
6691
6742
|
model,
|
|
6692
6743
|
ids,
|
|
@@ -6716,7 +6767,7 @@ function useViewService() {
|
|
|
6716
6767
|
},
|
|
6717
6768
|
[env]
|
|
6718
6769
|
);
|
|
6719
|
-
const getSelectionItem =
|
|
6770
|
+
const getSelectionItem = useCallback56(
|
|
6720
6771
|
async ({
|
|
6721
6772
|
data,
|
|
6722
6773
|
service,
|
|
@@ -6753,7 +6804,7 @@ function useViewService() {
|
|
|
6753
6804
|
},
|
|
6754
6805
|
[env]
|
|
6755
6806
|
);
|
|
6756
|
-
const loadMessages =
|
|
6807
|
+
const loadMessages = useCallback56(async () => {
|
|
6757
6808
|
return env.requests.post(
|
|
6758
6809
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
6759
6810
|
{},
|
|
@@ -6764,14 +6815,14 @@ function useViewService() {
|
|
|
6764
6815
|
}
|
|
6765
6816
|
);
|
|
6766
6817
|
}, [env]);
|
|
6767
|
-
const getVersion =
|
|
6818
|
+
const getVersion = useCallback56(async () => {
|
|
6768
6819
|
return env?.requests?.get("", {
|
|
6769
6820
|
headers: {
|
|
6770
6821
|
"Content-Type": "application/json"
|
|
6771
6822
|
}
|
|
6772
6823
|
});
|
|
6773
6824
|
}, [env]);
|
|
6774
|
-
const grantAccess =
|
|
6825
|
+
const grantAccess = useCallback56(
|
|
6775
6826
|
async ({
|
|
6776
6827
|
redirect_uri,
|
|
6777
6828
|
state,
|
|
@@ -6798,7 +6849,7 @@ function useViewService() {
|
|
|
6798
6849
|
},
|
|
6799
6850
|
[env]
|
|
6800
6851
|
);
|
|
6801
|
-
const removeTotpSetUp =
|
|
6852
|
+
const removeTotpSetUp = useCallback56(
|
|
6802
6853
|
async ({ method, token }) => {
|
|
6803
6854
|
const jsonData = {
|
|
6804
6855
|
method,
|
|
@@ -6819,7 +6870,7 @@ function useViewService() {
|
|
|
6819
6870
|
},
|
|
6820
6871
|
[env]
|
|
6821
6872
|
);
|
|
6822
|
-
const requestSetupTotp =
|
|
6873
|
+
const requestSetupTotp = useCallback56(
|
|
6823
6874
|
async ({ method, token }) => {
|
|
6824
6875
|
const jsonData = {
|
|
6825
6876
|
method,
|
|
@@ -6838,7 +6889,7 @@ function useViewService() {
|
|
|
6838
6889
|
},
|
|
6839
6890
|
[env]
|
|
6840
6891
|
);
|
|
6841
|
-
const settingsWebRead2fa =
|
|
6892
|
+
const settingsWebRead2fa = useCallback56(
|
|
6842
6893
|
async ({
|
|
6843
6894
|
method,
|
|
6844
6895
|
model,
|
|
@@ -6866,7 +6917,7 @@ function useViewService() {
|
|
|
6866
6917
|
},
|
|
6867
6918
|
[env]
|
|
6868
6919
|
);
|
|
6869
|
-
const signInSSO =
|
|
6920
|
+
const signInSSO = useCallback56(
|
|
6870
6921
|
async ({
|
|
6871
6922
|
redirect_uri,
|
|
6872
6923
|
state,
|
|
@@ -6898,7 +6949,7 @@ function useViewService() {
|
|
|
6898
6949
|
},
|
|
6899
6950
|
[env]
|
|
6900
6951
|
);
|
|
6901
|
-
const verify2FA =
|
|
6952
|
+
const verify2FA = useCallback56(
|
|
6902
6953
|
({
|
|
6903
6954
|
method,
|
|
6904
6955
|
with_context,
|
|
@@ -6931,7 +6982,7 @@ function useViewService() {
|
|
|
6931
6982
|
},
|
|
6932
6983
|
[env]
|
|
6933
6984
|
);
|
|
6934
|
-
const get2FAMethods =
|
|
6985
|
+
const get2FAMethods = useCallback56(
|
|
6935
6986
|
({ method, with_context }) => {
|
|
6936
6987
|
const jsonData = {
|
|
6937
6988
|
method,
|
|
@@ -6950,7 +7001,7 @@ function useViewService() {
|
|
|
6950
7001
|
},
|
|
6951
7002
|
[env]
|
|
6952
7003
|
);
|
|
6953
|
-
const verifyTotp =
|
|
7004
|
+
const verifyTotp = useCallback56(
|
|
6954
7005
|
({
|
|
6955
7006
|
method,
|
|
6956
7007
|
action_token,
|
|
@@ -6975,7 +7026,7 @@ function useViewService() {
|
|
|
6975
7026
|
},
|
|
6976
7027
|
[env]
|
|
6977
7028
|
);
|
|
6978
|
-
const getNotifications =
|
|
7029
|
+
const getNotifications = useCallback56(
|
|
6979
7030
|
async ({
|
|
6980
7031
|
service,
|
|
6981
7032
|
xNode,
|
|
@@ -6995,7 +7046,7 @@ function useViewService() {
|
|
|
6995
7046
|
},
|
|
6996
7047
|
[env]
|
|
6997
7048
|
);
|
|
6998
|
-
const getCountry =
|
|
7049
|
+
const getCountry = useCallback56(
|
|
6999
7050
|
async ({
|
|
7000
7051
|
service,
|
|
7001
7052
|
xNode,
|
|
@@ -7022,7 +7073,7 @@ function useViewService() {
|
|
|
7022
7073
|
},
|
|
7023
7074
|
[env]
|
|
7024
7075
|
);
|
|
7025
|
-
const getCity =
|
|
7076
|
+
const getCity = useCallback56(
|
|
7026
7077
|
async ({
|
|
7027
7078
|
service,
|
|
7028
7079
|
xNode,
|
|
@@ -7049,7 +7100,7 @@ function useViewService() {
|
|
|
7049
7100
|
},
|
|
7050
7101
|
[env]
|
|
7051
7102
|
);
|
|
7052
|
-
const getWard =
|
|
7103
|
+
const getWard = useCallback56(
|
|
7053
7104
|
async ({
|
|
7054
7105
|
service,
|
|
7055
7106
|
xNode,
|
|
@@ -7074,7 +7125,7 @@ function useViewService() {
|
|
|
7074
7125
|
},
|
|
7075
7126
|
[env]
|
|
7076
7127
|
);
|
|
7077
|
-
const getPartnerTitle =
|
|
7128
|
+
const getPartnerTitle = useCallback56(
|
|
7078
7129
|
async ({
|
|
7079
7130
|
service,
|
|
7080
7131
|
xNode,
|
|
@@ -7126,10 +7177,10 @@ function useViewService() {
|
|
|
7126
7177
|
}
|
|
7127
7178
|
|
|
7128
7179
|
// src/services/dashboard-service/index.ts
|
|
7129
|
-
import { useCallback as
|
|
7180
|
+
import { useCallback as useCallback57 } from "react";
|
|
7130
7181
|
function useDashboardService() {
|
|
7131
7182
|
const { env } = useEnv();
|
|
7132
|
-
const readGroup =
|
|
7183
|
+
const readGroup = useCallback57(
|
|
7133
7184
|
async ({
|
|
7134
7185
|
service,
|
|
7135
7186
|
xNode,
|
|
@@ -7146,7 +7197,7 @@ function useDashboardService() {
|
|
|
7146
7197
|
},
|
|
7147
7198
|
[env]
|
|
7148
7199
|
);
|
|
7149
|
-
const getDataChart =
|
|
7200
|
+
const getDataChart = useCallback57(
|
|
7150
7201
|
async ({
|
|
7151
7202
|
service,
|
|
7152
7203
|
xNode,
|