@fctc/interface-logic 4.8.5 → 4.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.mts +5 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.js +5 -0
- package/dist/constants.mjs +5 -0
- package/dist/hooks.js +119 -3
- package/dist/hooks.mjs +119 -3
- package/dist/provider.js +140 -24
- package/dist/provider.mjs +129 -13
- package/dist/services.d.mts +31 -0
- package/dist/services.d.ts +31 -0
- package/dist/services.js +213 -97
- package/dist/services.mjs +210 -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 useCallback55 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/constants/api/uri-constant.ts
|
|
5
5
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -4993,6 +4993,110 @@ var createPaymentSupabaseService = () => {
|
|
|
4993
4993
|
};
|
|
4994
4994
|
};
|
|
4995
4995
|
|
|
4996
|
+
// src/services/pos-service/supabase/create-customer.ts
|
|
4997
|
+
import { useCallback as useCallback52 } from "react";
|
|
4998
|
+
var createCustomerSupabaseService = () => {
|
|
4999
|
+
const supabase = useSupabaseOptional();
|
|
5000
|
+
const createCustomerSupabase = useCallback52(
|
|
5001
|
+
async (values) => {
|
|
5002
|
+
if (!supabase) {
|
|
5003
|
+
console.error("Supabase client not initialized");
|
|
5004
|
+
return null;
|
|
5005
|
+
}
|
|
5006
|
+
try {
|
|
5007
|
+
const insertData = cleanObject({
|
|
5008
|
+
name: values.name,
|
|
5009
|
+
phone: values.phone,
|
|
5010
|
+
email: values.email,
|
|
5011
|
+
address: values.address,
|
|
5012
|
+
street2: values.street2,
|
|
5013
|
+
city: values.city,
|
|
5014
|
+
birth_date: values.birth_date,
|
|
5015
|
+
country_id: values.country_id,
|
|
5016
|
+
state_id: values.state_id,
|
|
5017
|
+
ward_id: values.ward_id
|
|
5018
|
+
});
|
|
5019
|
+
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).insert(insertData).select("id, name").single();
|
|
5020
|
+
if (error) {
|
|
5021
|
+
console.error("Error creating customer:", error);
|
|
5022
|
+
return null;
|
|
5023
|
+
}
|
|
5024
|
+
return [[data.id, data.name]];
|
|
5025
|
+
} catch (error) {
|
|
5026
|
+
console.error("Error creating customer:", error);
|
|
5027
|
+
return null;
|
|
5028
|
+
}
|
|
5029
|
+
},
|
|
5030
|
+
[supabase]
|
|
5031
|
+
);
|
|
5032
|
+
return {
|
|
5033
|
+
createCustomerSupabase
|
|
5034
|
+
};
|
|
5035
|
+
};
|
|
5036
|
+
|
|
5037
|
+
// src/services/pos-service/supabase/update-customer.ts
|
|
5038
|
+
import { useCallback as useCallback53 } from "react";
|
|
5039
|
+
var updateCustomerSupabaseService = () => {
|
|
5040
|
+
const supabase = useSupabaseOptional();
|
|
5041
|
+
const updateCustomerSupabase = useCallback53(
|
|
5042
|
+
async (values) => {
|
|
5043
|
+
if (!supabase) {
|
|
5044
|
+
console.error("Supabase client not initialized");
|
|
5045
|
+
return null;
|
|
5046
|
+
}
|
|
5047
|
+
try {
|
|
5048
|
+
const { customer_id, ...rest } = values;
|
|
5049
|
+
const updateData = cleanObject({
|
|
5050
|
+
...rest,
|
|
5051
|
+
write_date: (/* @__PURE__ */ new Date()).toISOString()
|
|
5052
|
+
});
|
|
5053
|
+
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).update(updateData).eq("id", customer_id).select("id").single();
|
|
5054
|
+
if (error) {
|
|
5055
|
+
console.error("Error updating customer:", error);
|
|
5056
|
+
return null;
|
|
5057
|
+
}
|
|
5058
|
+
return [data.id];
|
|
5059
|
+
} catch (error) {
|
|
5060
|
+
console.error("Error updating customer:", error);
|
|
5061
|
+
return null;
|
|
5062
|
+
}
|
|
5063
|
+
},
|
|
5064
|
+
[supabase]
|
|
5065
|
+
);
|
|
5066
|
+
return {
|
|
5067
|
+
updateCustomerSupabase
|
|
5068
|
+
};
|
|
5069
|
+
};
|
|
5070
|
+
|
|
5071
|
+
// src/services/pos-service/supabase/delete-customer.ts
|
|
5072
|
+
import { useCallback as useCallback54 } from "react";
|
|
5073
|
+
var deleteCustomerSupabaseService = () => {
|
|
5074
|
+
const supabase = useSupabaseOptional();
|
|
5075
|
+
const deleteCustomerSupabase = useCallback54(
|
|
5076
|
+
async (values) => {
|
|
5077
|
+
if (!supabase) {
|
|
5078
|
+
console.error("Supabase client not initialized");
|
|
5079
|
+
return null;
|
|
5080
|
+
}
|
|
5081
|
+
try {
|
|
5082
|
+
const { error } = await supabase.from("customers" /* CUSTOMERS */).delete().eq("id", values.customer_id);
|
|
5083
|
+
if (error) {
|
|
5084
|
+
console.error("Error deleting customer:", error);
|
|
5085
|
+
return null;
|
|
5086
|
+
}
|
|
5087
|
+
return [values.customer_id];
|
|
5088
|
+
} catch (error) {
|
|
5089
|
+
console.error("Error deleting customer:", error);
|
|
5090
|
+
return null;
|
|
5091
|
+
}
|
|
5092
|
+
},
|
|
5093
|
+
[supabase]
|
|
5094
|
+
);
|
|
5095
|
+
return {
|
|
5096
|
+
deleteCustomerSupabase
|
|
5097
|
+
};
|
|
5098
|
+
};
|
|
5099
|
+
|
|
4996
5100
|
// src/services/pos-service/index.ts
|
|
4997
5101
|
var serviceFactories = [
|
|
4998
5102
|
addEntityService,
|
|
@@ -5043,7 +5147,10 @@ var serviceFactories = [
|
|
|
5043
5147
|
getFunctionalModulesService,
|
|
5044
5148
|
addPaymentMethodSupabaseService,
|
|
5045
5149
|
updateSessionPaymentMethodsSupabaseService,
|
|
5046
|
-
createPaymentSupabaseService
|
|
5150
|
+
createPaymentSupabaseService,
|
|
5151
|
+
createCustomerSupabaseService,
|
|
5152
|
+
updateCustomerSupabaseService,
|
|
5153
|
+
deleteCustomerSupabaseService
|
|
5047
5154
|
];
|
|
5048
5155
|
var usePosService = () => {
|
|
5049
5156
|
const { env } = useEnv();
|
|
@@ -5199,6 +5306,15 @@ import { useMutation as useMutation105 } from "@tanstack/react-query";
|
|
|
5199
5306
|
// src/hooks/pos/supabase/use-create-payment.ts
|
|
5200
5307
|
import { useMutation as useMutation106 } from "@tanstack/react-query";
|
|
5201
5308
|
|
|
5309
|
+
// src/hooks/pos/supabase/use-create-customer.ts
|
|
5310
|
+
import { useMutation as useMutation107 } from "@tanstack/react-query";
|
|
5311
|
+
|
|
5312
|
+
// src/hooks/pos/supabase/use-update-customer.ts
|
|
5313
|
+
import { useMutation as useMutation108 } from "@tanstack/react-query";
|
|
5314
|
+
|
|
5315
|
+
// src/hooks/pos/supabase/use-delete-customer.ts
|
|
5316
|
+
import { useMutation as useMutation109 } from "@tanstack/react-query";
|
|
5317
|
+
|
|
5202
5318
|
// src/provider/service-provider.tsx
|
|
5203
5319
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5204
5320
|
var ServiceContext = createContext3(null);
|
|
@@ -5210,7 +5326,7 @@ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
|
5210
5326
|
// src/services/action-service/index.ts
|
|
5211
5327
|
function useActionService() {
|
|
5212
5328
|
const { env } = useEnv();
|
|
5213
|
-
const loadAction =
|
|
5329
|
+
const loadAction = useCallback55(
|
|
5214
5330
|
async ({
|
|
5215
5331
|
idAction,
|
|
5216
5332
|
context,
|
|
@@ -5234,7 +5350,7 @@ function useActionService() {
|
|
|
5234
5350
|
},
|
|
5235
5351
|
[env]
|
|
5236
5352
|
);
|
|
5237
|
-
const callButton =
|
|
5353
|
+
const callButton = useCallback55(
|
|
5238
5354
|
async ({
|
|
5239
5355
|
model,
|
|
5240
5356
|
ids = [],
|
|
@@ -5268,7 +5384,7 @@ function useActionService() {
|
|
|
5268
5384
|
},
|
|
5269
5385
|
[env]
|
|
5270
5386
|
);
|
|
5271
|
-
const removeRows =
|
|
5387
|
+
const removeRows = useCallback55(
|
|
5272
5388
|
async ({
|
|
5273
5389
|
model,
|
|
5274
5390
|
ids,
|
|
@@ -5294,7 +5410,7 @@ function useActionService() {
|
|
|
5294
5410
|
},
|
|
5295
5411
|
[env]
|
|
5296
5412
|
);
|
|
5297
|
-
const duplicateRecord =
|
|
5413
|
+
const duplicateRecord = useCallback55(
|
|
5298
5414
|
async ({
|
|
5299
5415
|
model,
|
|
5300
5416
|
id,
|
|
@@ -5320,7 +5436,7 @@ function useActionService() {
|
|
|
5320
5436
|
},
|
|
5321
5437
|
[env]
|
|
5322
5438
|
);
|
|
5323
|
-
const getPrintReportName =
|
|
5439
|
+
const getPrintReportName = useCallback55(
|
|
5324
5440
|
async ({ id }) => {
|
|
5325
5441
|
const jsonData = {
|
|
5326
5442
|
model: "ir.actions.report",
|
|
@@ -5338,7 +5454,7 @@ function useActionService() {
|
|
|
5338
5454
|
},
|
|
5339
5455
|
[env]
|
|
5340
5456
|
);
|
|
5341
|
-
const print =
|
|
5457
|
+
const print = useCallback55(
|
|
5342
5458
|
async ({ id, report, db }) => {
|
|
5343
5459
|
const jsonData = {
|
|
5344
5460
|
report,
|
|
@@ -5356,7 +5472,7 @@ function useActionService() {
|
|
|
5356
5472
|
},
|
|
5357
5473
|
[env]
|
|
5358
5474
|
);
|
|
5359
|
-
const runAction =
|
|
5475
|
+
const runAction = useCallback55(
|
|
5360
5476
|
async ({
|
|
5361
5477
|
idAction,
|
|
5362
5478
|
context,
|
|
@@ -5383,7 +5499,7 @@ function useActionService() {
|
|
|
5383
5499
|
},
|
|
5384
5500
|
[env]
|
|
5385
5501
|
);
|
|
5386
|
-
const generateSerialNumber =
|
|
5502
|
+
const generateSerialNumber = useCallback55(
|
|
5387
5503
|
async ({
|
|
5388
5504
|
kwargs,
|
|
5389
5505
|
context,
|
|
@@ -5421,11 +5537,11 @@ function useActionService() {
|
|
|
5421
5537
|
}
|
|
5422
5538
|
|
|
5423
5539
|
// src/services/auth-service/index.ts
|
|
5424
|
-
import { useCallback as
|
|
5540
|
+
import { useCallback as useCallback56 } from "react";
|
|
5425
5541
|
function useAuthService() {
|
|
5426
5542
|
const { env } = useEnv();
|
|
5427
5543
|
const supabase = useSupabaseOptional();
|
|
5428
|
-
const login =
|
|
5544
|
+
const login = useCallback56(
|
|
5429
5545
|
async (body) => {
|
|
5430
5546
|
const payload = Object.fromEntries(
|
|
5431
5547
|
Object.entries({
|
|
@@ -5450,7 +5566,7 @@ function useAuthService() {
|
|
|
5450
5566
|
},
|
|
5451
5567
|
[env]
|
|
5452
5568
|
);
|
|
5453
|
-
const loginSupabase =
|
|
5569
|
+
const loginSupabase = useCallback56(
|
|
5454
5570
|
async (body) => {
|
|
5455
5571
|
if (!supabase) {
|
|
5456
5572
|
return {
|
|
@@ -5466,7 +5582,7 @@ function useAuthService() {
|
|
|
5466
5582
|
},
|
|
5467
5583
|
[supabase]
|
|
5468
5584
|
);
|
|
5469
|
-
const forgotPassword =
|
|
5585
|
+
const forgotPassword = useCallback56(
|
|
5470
5586
|
async (email) => {
|
|
5471
5587
|
const bodyData = {
|
|
5472
5588
|
login: email,
|
|
@@ -5480,7 +5596,7 @@ function useAuthService() {
|
|
|
5480
5596
|
},
|
|
5481
5597
|
[env]
|
|
5482
5598
|
);
|
|
5483
|
-
const forgotPasswordSSO =
|
|
5599
|
+
const forgotPasswordSSO = useCallback56(
|
|
5484
5600
|
async ({
|
|
5485
5601
|
email,
|
|
5486
5602
|
with_context,
|
|
@@ -5503,7 +5619,7 @@ function useAuthService() {
|
|
|
5503
5619
|
},
|
|
5504
5620
|
[env]
|
|
5505
5621
|
);
|
|
5506
|
-
const resetPassword =
|
|
5622
|
+
const resetPassword = useCallback56(
|
|
5507
5623
|
async (data, token) => {
|
|
5508
5624
|
const bodyData = {
|
|
5509
5625
|
token,
|
|
@@ -5518,7 +5634,7 @@ function useAuthService() {
|
|
|
5518
5634
|
},
|
|
5519
5635
|
[env]
|
|
5520
5636
|
);
|
|
5521
|
-
const resetPasswordSSO =
|
|
5637
|
+
const resetPasswordSSO = useCallback56(
|
|
5522
5638
|
async ({
|
|
5523
5639
|
method,
|
|
5524
5640
|
password,
|
|
@@ -5541,7 +5657,7 @@ function useAuthService() {
|
|
|
5541
5657
|
},
|
|
5542
5658
|
[env]
|
|
5543
5659
|
);
|
|
5544
|
-
const updatePassword =
|
|
5660
|
+
const updatePassword = useCallback56(
|
|
5545
5661
|
async (data, token) => {
|
|
5546
5662
|
const bodyData = {
|
|
5547
5663
|
token,
|
|
@@ -5556,7 +5672,7 @@ function useAuthService() {
|
|
|
5556
5672
|
},
|
|
5557
5673
|
[env]
|
|
5558
5674
|
);
|
|
5559
|
-
const isValidToken =
|
|
5675
|
+
const isValidToken = useCallback56(
|
|
5560
5676
|
async (token) => {
|
|
5561
5677
|
const bodyData = {
|
|
5562
5678
|
token
|
|
@@ -5569,7 +5685,7 @@ function useAuthService() {
|
|
|
5569
5685
|
},
|
|
5570
5686
|
[env]
|
|
5571
5687
|
);
|
|
5572
|
-
const isValidActionToken =
|
|
5688
|
+
const isValidActionToken = useCallback56(
|
|
5573
5689
|
async (actionToken) => {
|
|
5574
5690
|
const bodyData = {};
|
|
5575
5691
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5582,7 +5698,7 @@ function useAuthService() {
|
|
|
5582
5698
|
},
|
|
5583
5699
|
[env]
|
|
5584
5700
|
);
|
|
5585
|
-
const loginSocial =
|
|
5701
|
+
const loginSocial = useCallback56(
|
|
5586
5702
|
async ({
|
|
5587
5703
|
db,
|
|
5588
5704
|
state,
|
|
@@ -5600,13 +5716,13 @@ function useAuthService() {
|
|
|
5600
5716
|
},
|
|
5601
5717
|
[env]
|
|
5602
5718
|
);
|
|
5603
|
-
const getProviders =
|
|
5719
|
+
const getProviders = useCallback56(
|
|
5604
5720
|
async (db) => {
|
|
5605
5721
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5606
5722
|
},
|
|
5607
5723
|
[env]
|
|
5608
5724
|
);
|
|
5609
|
-
const getAccessByCode =
|
|
5725
|
+
const getAccessByCode = useCallback56(
|
|
5610
5726
|
async (code) => {
|
|
5611
5727
|
const data = new URLSearchParams();
|
|
5612
5728
|
data.append("code", code);
|
|
@@ -5626,7 +5742,7 @@ function useAuthService() {
|
|
|
5626
5742
|
},
|
|
5627
5743
|
[env]
|
|
5628
5744
|
);
|
|
5629
|
-
const logout =
|
|
5745
|
+
const logout = useCallback56(
|
|
5630
5746
|
async (service) => {
|
|
5631
5747
|
return env?.requests?.post(
|
|
5632
5748
|
"/logout" /* LOGOUT */,
|
|
@@ -5643,7 +5759,7 @@ function useAuthService() {
|
|
|
5643
5759
|
},
|
|
5644
5760
|
[env]
|
|
5645
5761
|
);
|
|
5646
|
-
const getTenantMapping =
|
|
5762
|
+
const getTenantMapping = useCallback56(
|
|
5647
5763
|
async ({ shortName, service }) => {
|
|
5648
5764
|
const bodyData = {
|
|
5649
5765
|
short_name: shortName
|
|
@@ -5661,7 +5777,7 @@ function useAuthService() {
|
|
|
5661
5777
|
},
|
|
5662
5778
|
[env]
|
|
5663
5779
|
);
|
|
5664
|
-
const getToken =
|
|
5780
|
+
const getToken = useCallback56(
|
|
5665
5781
|
async ({
|
|
5666
5782
|
phone,
|
|
5667
5783
|
name,
|
|
@@ -5706,10 +5822,10 @@ function useAuthService() {
|
|
|
5706
5822
|
}
|
|
5707
5823
|
|
|
5708
5824
|
// src/services/company-service/index.ts
|
|
5709
|
-
import { useCallback as
|
|
5825
|
+
import { useCallback as useCallback57 } from "react";
|
|
5710
5826
|
function useCompanyService() {
|
|
5711
5827
|
const { env } = useEnv();
|
|
5712
|
-
const getCurrentCompany =
|
|
5828
|
+
const getCurrentCompany = useCallback57(
|
|
5713
5829
|
async (service, extraHeaders) => {
|
|
5714
5830
|
return await env.requests.get(
|
|
5715
5831
|
"/company" /* COMPANY_PATH */,
|
|
@@ -5726,7 +5842,7 @@ function useCompanyService() {
|
|
|
5726
5842
|
},
|
|
5727
5843
|
[env]
|
|
5728
5844
|
);
|
|
5729
|
-
const getInfoCompany =
|
|
5845
|
+
const getInfoCompany = useCallback57(
|
|
5730
5846
|
async (id, service) => {
|
|
5731
5847
|
const jsonData = {
|
|
5732
5848
|
ids: [id],
|
|
@@ -5762,10 +5878,10 @@ function useCompanyService() {
|
|
|
5762
5878
|
}
|
|
5763
5879
|
|
|
5764
5880
|
// src/services/excel-service/index.ts
|
|
5765
|
-
import { useCallback as
|
|
5881
|
+
import { useCallback as useCallback58 } from "react";
|
|
5766
5882
|
function useExcelService() {
|
|
5767
5883
|
const { env } = useEnv();
|
|
5768
|
-
const uploadFileExcel =
|
|
5884
|
+
const uploadFileExcel = useCallback58(
|
|
5769
5885
|
async ({
|
|
5770
5886
|
formData,
|
|
5771
5887
|
service,
|
|
@@ -5782,7 +5898,7 @@ function useExcelService() {
|
|
|
5782
5898
|
},
|
|
5783
5899
|
[env]
|
|
5784
5900
|
);
|
|
5785
|
-
const uploadIdFile =
|
|
5901
|
+
const uploadIdFile = useCallback58(
|
|
5786
5902
|
async ({
|
|
5787
5903
|
formData,
|
|
5788
5904
|
service,
|
|
@@ -5799,7 +5915,7 @@ function useExcelService() {
|
|
|
5799
5915
|
},
|
|
5800
5916
|
[env]
|
|
5801
5917
|
);
|
|
5802
|
-
const parsePreview =
|
|
5918
|
+
const parsePreview = useCallback58(
|
|
5803
5919
|
async ({
|
|
5804
5920
|
id,
|
|
5805
5921
|
selectedSheet,
|
|
@@ -5848,7 +5964,7 @@ function useExcelService() {
|
|
|
5848
5964
|
},
|
|
5849
5965
|
[env]
|
|
5850
5966
|
);
|
|
5851
|
-
const executeImport =
|
|
5967
|
+
const executeImport = useCallback58(
|
|
5852
5968
|
async ({
|
|
5853
5969
|
columns,
|
|
5854
5970
|
fields,
|
|
@@ -5882,7 +5998,7 @@ function useExcelService() {
|
|
|
5882
5998
|
},
|
|
5883
5999
|
[env]
|
|
5884
6000
|
);
|
|
5885
|
-
const getFileExcel =
|
|
6001
|
+
const getFileExcel = useCallback58(
|
|
5886
6002
|
async ({
|
|
5887
6003
|
model,
|
|
5888
6004
|
service,
|
|
@@ -5906,7 +6022,7 @@ function useExcelService() {
|
|
|
5906
6022
|
},
|
|
5907
6023
|
[env]
|
|
5908
6024
|
);
|
|
5909
|
-
const getFieldExport =
|
|
6025
|
+
const getFieldExport = useCallback58(
|
|
5910
6026
|
async ({
|
|
5911
6027
|
ids,
|
|
5912
6028
|
model,
|
|
@@ -5946,7 +6062,7 @@ function useExcelService() {
|
|
|
5946
6062
|
},
|
|
5947
6063
|
[env]
|
|
5948
6064
|
);
|
|
5949
|
-
const exportExcel =
|
|
6065
|
+
const exportExcel = useCallback58(
|
|
5950
6066
|
async ({
|
|
5951
6067
|
model,
|
|
5952
6068
|
domain,
|
|
@@ -5994,10 +6110,10 @@ function useExcelService() {
|
|
|
5994
6110
|
}
|
|
5995
6111
|
|
|
5996
6112
|
// src/services/form-service/index.ts
|
|
5997
|
-
import { useCallback as
|
|
6113
|
+
import { useCallback as useCallback59 } from "react";
|
|
5998
6114
|
function useFormService() {
|
|
5999
6115
|
const { env } = useEnv();
|
|
6000
|
-
const getComment =
|
|
6116
|
+
const getComment = useCallback59(
|
|
6001
6117
|
async ({ data }) => {
|
|
6002
6118
|
const jsonData = {
|
|
6003
6119
|
thread_id: data.thread_id,
|
|
@@ -6015,7 +6131,7 @@ function useFormService() {
|
|
|
6015
6131
|
},
|
|
6016
6132
|
[env]
|
|
6017
6133
|
);
|
|
6018
|
-
const getThreadData =
|
|
6134
|
+
const getThreadData = useCallback59(
|
|
6019
6135
|
async ({
|
|
6020
6136
|
data,
|
|
6021
6137
|
xNode,
|
|
@@ -6042,7 +6158,7 @@ function useFormService() {
|
|
|
6042
6158
|
},
|
|
6043
6159
|
[env]
|
|
6044
6160
|
);
|
|
6045
|
-
const getThreadMessages =
|
|
6161
|
+
const getThreadMessages = useCallback59(
|
|
6046
6162
|
async ({
|
|
6047
6163
|
data,
|
|
6048
6164
|
xNode,
|
|
@@ -6068,7 +6184,7 @@ function useFormService() {
|
|
|
6068
6184
|
},
|
|
6069
6185
|
[env]
|
|
6070
6186
|
);
|
|
6071
|
-
const sentComment =
|
|
6187
|
+
const sentComment = useCallback59(
|
|
6072
6188
|
async ({ data }) => {
|
|
6073
6189
|
const jsonData = {
|
|
6074
6190
|
context: {
|
|
@@ -6096,7 +6212,7 @@ function useFormService() {
|
|
|
6096
6212
|
},
|
|
6097
6213
|
[env]
|
|
6098
6214
|
);
|
|
6099
|
-
const deleteComment =
|
|
6215
|
+
const deleteComment = useCallback59(
|
|
6100
6216
|
async ({ data }) => {
|
|
6101
6217
|
const jsonData = {
|
|
6102
6218
|
attachment_ids: [],
|
|
@@ -6112,7 +6228,7 @@ function useFormService() {
|
|
|
6112
6228
|
},
|
|
6113
6229
|
[env]
|
|
6114
6230
|
);
|
|
6115
|
-
const getImage =
|
|
6231
|
+
const getImage = useCallback59(
|
|
6116
6232
|
async ({ data }) => {
|
|
6117
6233
|
return env.requests.get(
|
|
6118
6234
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -6125,7 +6241,7 @@ function useFormService() {
|
|
|
6125
6241
|
},
|
|
6126
6242
|
[env]
|
|
6127
6243
|
);
|
|
6128
|
-
const uploadImage =
|
|
6244
|
+
const uploadImage = useCallback59(
|
|
6129
6245
|
async ({
|
|
6130
6246
|
formData,
|
|
6131
6247
|
service,
|
|
@@ -6144,7 +6260,7 @@ function useFormService() {
|
|
|
6144
6260
|
},
|
|
6145
6261
|
[env]
|
|
6146
6262
|
);
|
|
6147
|
-
const uploadFile =
|
|
6263
|
+
const uploadFile = useCallback59(
|
|
6148
6264
|
async ({
|
|
6149
6265
|
formData,
|
|
6150
6266
|
service,
|
|
@@ -6164,7 +6280,7 @@ function useFormService() {
|
|
|
6164
6280
|
},
|
|
6165
6281
|
[env]
|
|
6166
6282
|
);
|
|
6167
|
-
const getFormView =
|
|
6283
|
+
const getFormView = useCallback59(
|
|
6168
6284
|
async ({ data }) => {
|
|
6169
6285
|
const jsonData = {
|
|
6170
6286
|
model: data.model,
|
|
@@ -6180,7 +6296,7 @@ function useFormService() {
|
|
|
6180
6296
|
},
|
|
6181
6297
|
[env]
|
|
6182
6298
|
);
|
|
6183
|
-
const changeStatus =
|
|
6299
|
+
const changeStatus = useCallback59(
|
|
6184
6300
|
async ({ data }) => {
|
|
6185
6301
|
const vals = {
|
|
6186
6302
|
[data.name]: data.stage_id
|
|
@@ -6209,7 +6325,7 @@ function useFormService() {
|
|
|
6209
6325
|
},
|
|
6210
6326
|
[env]
|
|
6211
6327
|
);
|
|
6212
|
-
const getExternalTab =
|
|
6328
|
+
const getExternalTab = useCallback59(
|
|
6213
6329
|
async ({ method, context, service, xNode }) => {
|
|
6214
6330
|
return env?.requests?.post(
|
|
6215
6331
|
"/call" /* CALL_PATH */,
|
|
@@ -6244,10 +6360,10 @@ function useFormService() {
|
|
|
6244
6360
|
}
|
|
6245
6361
|
|
|
6246
6362
|
// src/services/kanban-service/index.ts
|
|
6247
|
-
import { useCallback as
|
|
6363
|
+
import { useCallback as useCallback60 } from "react";
|
|
6248
6364
|
function useKanbanService() {
|
|
6249
6365
|
const { env } = useEnv();
|
|
6250
|
-
const getGroups =
|
|
6366
|
+
const getGroups = useCallback60(
|
|
6251
6367
|
async ({ model, width_context }) => {
|
|
6252
6368
|
const jsonData = {
|
|
6253
6369
|
model,
|
|
@@ -6267,7 +6383,7 @@ function useKanbanService() {
|
|
|
6267
6383
|
},
|
|
6268
6384
|
[env]
|
|
6269
6385
|
);
|
|
6270
|
-
const getProgressBar =
|
|
6386
|
+
const getProgressBar = useCallback60(
|
|
6271
6387
|
async ({ field, color, model, width_context }) => {
|
|
6272
6388
|
const jsonData = {
|
|
6273
6389
|
model,
|
|
@@ -6297,10 +6413,10 @@ function useKanbanService() {
|
|
|
6297
6413
|
}
|
|
6298
6414
|
|
|
6299
6415
|
// src/services/model-service/index.ts
|
|
6300
|
-
import { useCallback as
|
|
6416
|
+
import { useCallback as useCallback61 } from "react";
|
|
6301
6417
|
function useModelService() {
|
|
6302
6418
|
const { env } = useEnv();
|
|
6303
|
-
const getListMyBankAccount =
|
|
6419
|
+
const getListMyBankAccount = useCallback61(
|
|
6304
6420
|
async ({
|
|
6305
6421
|
domain,
|
|
6306
6422
|
spectification,
|
|
@@ -6324,7 +6440,7 @@ function useModelService() {
|
|
|
6324
6440
|
},
|
|
6325
6441
|
[env]
|
|
6326
6442
|
);
|
|
6327
|
-
const getCurrency =
|
|
6443
|
+
const getCurrency = useCallback61(async () => {
|
|
6328
6444
|
const jsonData = {
|
|
6329
6445
|
model: "res.currency",
|
|
6330
6446
|
method: "web_search_read",
|
|
@@ -6344,7 +6460,7 @@ function useModelService() {
|
|
|
6344
6460
|
}
|
|
6345
6461
|
});
|
|
6346
6462
|
}, [env]);
|
|
6347
|
-
const getConversionRate =
|
|
6463
|
+
const getConversionRate = useCallback61(async () => {
|
|
6348
6464
|
const jsonData = {
|
|
6349
6465
|
model: "res.currency",
|
|
6350
6466
|
method: "web_search_read",
|
|
@@ -6370,7 +6486,7 @@ function useModelService() {
|
|
|
6370
6486
|
}
|
|
6371
6487
|
});
|
|
6372
6488
|
}, [env]);
|
|
6373
|
-
const getAll =
|
|
6489
|
+
const getAll = useCallback61(
|
|
6374
6490
|
async ({
|
|
6375
6491
|
data,
|
|
6376
6492
|
service,
|
|
@@ -6412,7 +6528,7 @@ function useModelService() {
|
|
|
6412
6528
|
},
|
|
6413
6529
|
[env]
|
|
6414
6530
|
);
|
|
6415
|
-
const getListCalendar =
|
|
6531
|
+
const getListCalendar = useCallback61(
|
|
6416
6532
|
async ({ data }) => {
|
|
6417
6533
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6418
6534
|
fields: data.fields,
|
|
@@ -6443,7 +6559,7 @@ function useModelService() {
|
|
|
6443
6559
|
},
|
|
6444
6560
|
[env]
|
|
6445
6561
|
);
|
|
6446
|
-
const getList =
|
|
6562
|
+
const getList = useCallback61(
|
|
6447
6563
|
async ({
|
|
6448
6564
|
model,
|
|
6449
6565
|
ids = [],
|
|
@@ -6475,7 +6591,7 @@ function useModelService() {
|
|
|
6475
6591
|
},
|
|
6476
6592
|
[env]
|
|
6477
6593
|
);
|
|
6478
|
-
const getDetail =
|
|
6594
|
+
const getDetail = useCallback61(
|
|
6479
6595
|
async ({
|
|
6480
6596
|
ids = [],
|
|
6481
6597
|
model,
|
|
@@ -6507,7 +6623,7 @@ function useModelService() {
|
|
|
6507
6623
|
},
|
|
6508
6624
|
[env]
|
|
6509
6625
|
);
|
|
6510
|
-
const save =
|
|
6626
|
+
const save = useCallback61(
|
|
6511
6627
|
async ({
|
|
6512
6628
|
model,
|
|
6513
6629
|
ids = [],
|
|
@@ -6542,7 +6658,7 @@ function useModelService() {
|
|
|
6542
6658
|
},
|
|
6543
6659
|
[env]
|
|
6544
6660
|
);
|
|
6545
|
-
const deleteApi =
|
|
6661
|
+
const deleteApi = useCallback61(
|
|
6546
6662
|
async ({ ids = [], model, service }) => {
|
|
6547
6663
|
const jsonData = {
|
|
6548
6664
|
model,
|
|
@@ -6562,7 +6678,7 @@ function useModelService() {
|
|
|
6562
6678
|
},
|
|
6563
6679
|
[env]
|
|
6564
6680
|
);
|
|
6565
|
-
const onChange =
|
|
6681
|
+
const onChange = useCallback61(
|
|
6566
6682
|
async ({
|
|
6567
6683
|
ids = [],
|
|
6568
6684
|
model,
|
|
@@ -6598,7 +6714,7 @@ function useModelService() {
|
|
|
6598
6714
|
},
|
|
6599
6715
|
[env]
|
|
6600
6716
|
);
|
|
6601
|
-
const getListFieldsOnchange =
|
|
6717
|
+
const getListFieldsOnchange = useCallback61(
|
|
6602
6718
|
async ({
|
|
6603
6719
|
model,
|
|
6604
6720
|
service,
|
|
@@ -6622,7 +6738,7 @@ function useModelService() {
|
|
|
6622
6738
|
},
|
|
6623
6739
|
[env]
|
|
6624
6740
|
);
|
|
6625
|
-
const parseORMOdoo =
|
|
6741
|
+
const parseORMOdoo = useCallback61((data) => {
|
|
6626
6742
|
for (const key in data) {
|
|
6627
6743
|
if (key === "display_name") {
|
|
6628
6744
|
delete data[key];
|
|
@@ -6633,7 +6749,7 @@ function useModelService() {
|
|
|
6633
6749
|
}
|
|
6634
6750
|
return { ...data };
|
|
6635
6751
|
}, []);
|
|
6636
|
-
const toDataJS =
|
|
6752
|
+
const toDataJS = useCallback61(
|
|
6637
6753
|
(data, viewData, model) => {
|
|
6638
6754
|
for (const key in data) {
|
|
6639
6755
|
if (data[key] === false) {
|
|
@@ -6691,10 +6807,10 @@ function useModelService() {
|
|
|
6691
6807
|
}
|
|
6692
6808
|
|
|
6693
6809
|
// src/services/user-service/index.ts
|
|
6694
|
-
import { useCallback as
|
|
6810
|
+
import { useCallback as useCallback62 } from "react";
|
|
6695
6811
|
function useUserService() {
|
|
6696
6812
|
const { env } = useEnv();
|
|
6697
|
-
const getProfile =
|
|
6813
|
+
const getProfile = useCallback62(
|
|
6698
6814
|
async (service, path, extraHeaders) => {
|
|
6699
6815
|
return env?.requests?.get(
|
|
6700
6816
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -6711,7 +6827,7 @@ function useUserService() {
|
|
|
6711
6827
|
},
|
|
6712
6828
|
[env]
|
|
6713
6829
|
);
|
|
6714
|
-
const getUser =
|
|
6830
|
+
const getUser = useCallback62(
|
|
6715
6831
|
async ({ context, id }) => {
|
|
6716
6832
|
const jsonData = {
|
|
6717
6833
|
model: "res.users",
|
|
@@ -6749,7 +6865,7 @@ function useUserService() {
|
|
|
6749
6865
|
},
|
|
6750
6866
|
[env]
|
|
6751
6867
|
);
|
|
6752
|
-
const switchUserLocale =
|
|
6868
|
+
const switchUserLocale = useCallback62(
|
|
6753
6869
|
async ({ id, values, service }) => {
|
|
6754
6870
|
const jsonData = {
|
|
6755
6871
|
model: "res.users",
|
|
@@ -6777,10 +6893,10 @@ function useUserService() {
|
|
|
6777
6893
|
}
|
|
6778
6894
|
|
|
6779
6895
|
// src/services/view-service/index.ts
|
|
6780
|
-
import { useCallback as
|
|
6896
|
+
import { useCallback as useCallback63 } from "react";
|
|
6781
6897
|
function useViewService() {
|
|
6782
6898
|
const { env } = useEnv();
|
|
6783
|
-
const getView =
|
|
6899
|
+
const getView = useCallback63(
|
|
6784
6900
|
async ({
|
|
6785
6901
|
model,
|
|
6786
6902
|
views,
|
|
@@ -6820,7 +6936,7 @@ function useViewService() {
|
|
|
6820
6936
|
},
|
|
6821
6937
|
[env]
|
|
6822
6938
|
);
|
|
6823
|
-
const getMenu =
|
|
6939
|
+
const getMenu = useCallback63(
|
|
6824
6940
|
async (context, specification, domain, service) => {
|
|
6825
6941
|
const jsonData = {
|
|
6826
6942
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -6851,7 +6967,7 @@ function useViewService() {
|
|
|
6851
6967
|
},
|
|
6852
6968
|
[env]
|
|
6853
6969
|
);
|
|
6854
|
-
const getActionDetail =
|
|
6970
|
+
const getActionDetail = useCallback63(
|
|
6855
6971
|
async (aid, context) => {
|
|
6856
6972
|
const jsonData = {
|
|
6857
6973
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -6881,7 +6997,7 @@ function useViewService() {
|
|
|
6881
6997
|
},
|
|
6882
6998
|
[env]
|
|
6883
6999
|
);
|
|
6884
|
-
const getResequence =
|
|
7000
|
+
const getResequence = useCallback63(
|
|
6885
7001
|
async ({
|
|
6886
7002
|
model,
|
|
6887
7003
|
ids,
|
|
@@ -6911,7 +7027,7 @@ function useViewService() {
|
|
|
6911
7027
|
},
|
|
6912
7028
|
[env]
|
|
6913
7029
|
);
|
|
6914
|
-
const getSelectionItem =
|
|
7030
|
+
const getSelectionItem = useCallback63(
|
|
6915
7031
|
async ({
|
|
6916
7032
|
data,
|
|
6917
7033
|
service,
|
|
@@ -6948,7 +7064,7 @@ function useViewService() {
|
|
|
6948
7064
|
},
|
|
6949
7065
|
[env]
|
|
6950
7066
|
);
|
|
6951
|
-
const loadMessages =
|
|
7067
|
+
const loadMessages = useCallback63(async () => {
|
|
6952
7068
|
return env.requests.post(
|
|
6953
7069
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
6954
7070
|
{},
|
|
@@ -6959,14 +7075,14 @@ function useViewService() {
|
|
|
6959
7075
|
}
|
|
6960
7076
|
);
|
|
6961
7077
|
}, [env]);
|
|
6962
|
-
const getVersion =
|
|
7078
|
+
const getVersion = useCallback63(async () => {
|
|
6963
7079
|
return env?.requests?.get("", {
|
|
6964
7080
|
headers: {
|
|
6965
7081
|
"Content-Type": "application/json"
|
|
6966
7082
|
}
|
|
6967
7083
|
});
|
|
6968
7084
|
}, [env]);
|
|
6969
|
-
const grantAccess =
|
|
7085
|
+
const grantAccess = useCallback63(
|
|
6970
7086
|
async ({
|
|
6971
7087
|
redirect_uri,
|
|
6972
7088
|
state,
|
|
@@ -6993,7 +7109,7 @@ function useViewService() {
|
|
|
6993
7109
|
},
|
|
6994
7110
|
[env]
|
|
6995
7111
|
);
|
|
6996
|
-
const removeTotpSetUp =
|
|
7112
|
+
const removeTotpSetUp = useCallback63(
|
|
6997
7113
|
async ({ method, token }) => {
|
|
6998
7114
|
const jsonData = {
|
|
6999
7115
|
method,
|
|
@@ -7014,7 +7130,7 @@ function useViewService() {
|
|
|
7014
7130
|
},
|
|
7015
7131
|
[env]
|
|
7016
7132
|
);
|
|
7017
|
-
const requestSetupTotp =
|
|
7133
|
+
const requestSetupTotp = useCallback63(
|
|
7018
7134
|
async ({ method, token }) => {
|
|
7019
7135
|
const jsonData = {
|
|
7020
7136
|
method,
|
|
@@ -7033,7 +7149,7 @@ function useViewService() {
|
|
|
7033
7149
|
},
|
|
7034
7150
|
[env]
|
|
7035
7151
|
);
|
|
7036
|
-
const settingsWebRead2fa =
|
|
7152
|
+
const settingsWebRead2fa = useCallback63(
|
|
7037
7153
|
async ({
|
|
7038
7154
|
method,
|
|
7039
7155
|
model,
|
|
@@ -7061,7 +7177,7 @@ function useViewService() {
|
|
|
7061
7177
|
},
|
|
7062
7178
|
[env]
|
|
7063
7179
|
);
|
|
7064
|
-
const signInSSO =
|
|
7180
|
+
const signInSSO = useCallback63(
|
|
7065
7181
|
async ({
|
|
7066
7182
|
redirect_uri,
|
|
7067
7183
|
state,
|
|
@@ -7093,7 +7209,7 @@ function useViewService() {
|
|
|
7093
7209
|
},
|
|
7094
7210
|
[env]
|
|
7095
7211
|
);
|
|
7096
|
-
const verify2FA =
|
|
7212
|
+
const verify2FA = useCallback63(
|
|
7097
7213
|
({
|
|
7098
7214
|
method,
|
|
7099
7215
|
with_context,
|
|
@@ -7126,7 +7242,7 @@ function useViewService() {
|
|
|
7126
7242
|
},
|
|
7127
7243
|
[env]
|
|
7128
7244
|
);
|
|
7129
|
-
const get2FAMethods =
|
|
7245
|
+
const get2FAMethods = useCallback63(
|
|
7130
7246
|
({ method, with_context }) => {
|
|
7131
7247
|
const jsonData = {
|
|
7132
7248
|
method,
|
|
@@ -7145,7 +7261,7 @@ function useViewService() {
|
|
|
7145
7261
|
},
|
|
7146
7262
|
[env]
|
|
7147
7263
|
);
|
|
7148
|
-
const verifyTotp =
|
|
7264
|
+
const verifyTotp = useCallback63(
|
|
7149
7265
|
({
|
|
7150
7266
|
method,
|
|
7151
7267
|
action_token,
|
|
@@ -7170,7 +7286,7 @@ function useViewService() {
|
|
|
7170
7286
|
},
|
|
7171
7287
|
[env]
|
|
7172
7288
|
);
|
|
7173
|
-
const getNotifications =
|
|
7289
|
+
const getNotifications = useCallback63(
|
|
7174
7290
|
async ({
|
|
7175
7291
|
service,
|
|
7176
7292
|
xNode,
|
|
@@ -7190,7 +7306,7 @@ function useViewService() {
|
|
|
7190
7306
|
},
|
|
7191
7307
|
[env]
|
|
7192
7308
|
);
|
|
7193
|
-
const getCountry =
|
|
7309
|
+
const getCountry = useCallback63(
|
|
7194
7310
|
async ({
|
|
7195
7311
|
service,
|
|
7196
7312
|
xNode,
|
|
@@ -7217,7 +7333,7 @@ function useViewService() {
|
|
|
7217
7333
|
},
|
|
7218
7334
|
[env]
|
|
7219
7335
|
);
|
|
7220
|
-
const getCity =
|
|
7336
|
+
const getCity = useCallback63(
|
|
7221
7337
|
async ({
|
|
7222
7338
|
service,
|
|
7223
7339
|
xNode,
|
|
@@ -7244,7 +7360,7 @@ function useViewService() {
|
|
|
7244
7360
|
},
|
|
7245
7361
|
[env]
|
|
7246
7362
|
);
|
|
7247
|
-
const getWard =
|
|
7363
|
+
const getWard = useCallback63(
|
|
7248
7364
|
async ({
|
|
7249
7365
|
service,
|
|
7250
7366
|
xNode,
|
|
@@ -7269,7 +7385,7 @@ function useViewService() {
|
|
|
7269
7385
|
},
|
|
7270
7386
|
[env]
|
|
7271
7387
|
);
|
|
7272
|
-
const getPartnerTitle =
|
|
7388
|
+
const getPartnerTitle = useCallback63(
|
|
7273
7389
|
async ({
|
|
7274
7390
|
service,
|
|
7275
7391
|
xNode,
|
|
@@ -7321,10 +7437,10 @@ function useViewService() {
|
|
|
7321
7437
|
}
|
|
7322
7438
|
|
|
7323
7439
|
// src/services/dashboard-service/index.ts
|
|
7324
|
-
import { useCallback as
|
|
7440
|
+
import { useCallback as useCallback64 } from "react";
|
|
7325
7441
|
function useDashboardService() {
|
|
7326
7442
|
const { env } = useEnv();
|
|
7327
|
-
const readGroup =
|
|
7443
|
+
const readGroup = useCallback64(
|
|
7328
7444
|
async ({
|
|
7329
7445
|
service,
|
|
7330
7446
|
xNode,
|
|
@@ -7341,7 +7457,7 @@ function useDashboardService() {
|
|
|
7341
7457
|
},
|
|
7342
7458
|
[env]
|
|
7343
7459
|
);
|
|
7344
|
-
const getDataChart =
|
|
7460
|
+
const getDataChart = useCallback64(
|
|
7345
7461
|
async ({
|
|
7346
7462
|
service,
|
|
7347
7463
|
xNode,
|