@fctc/interface-logic 4.8.8 → 4.8.10
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 +2 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.js +1 -0
- package/dist/constants.mjs +1 -0
- package/dist/hooks.d.mts +9 -1
- package/dist/hooks.d.ts +9 -1
- package/dist/hooks.js +59 -4
- package/dist/hooks.mjs +58 -4
- package/dist/provider.d.mts +3 -2
- package/dist/provider.d.ts +3 -2
- package/dist/provider.js +81 -27
- package/dist/provider.mjs +70 -16
- package/dist/services.d.mts +6 -0
- package/dist/services.d.ts +6 -0
- package/dist/services.js +144 -98
- package/dist/services.mjs +141 -95
- package/package.json +92 -92
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 useCallback56 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/constants/api/uri-constant.ts
|
|
5
5
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -45,6 +45,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
45
45
|
UriConstants2["GET_NOTIFICATION"] = "/mail/data";
|
|
46
46
|
UriConstants2["PUBLIC_USER_INFO"] = "/public/user/info";
|
|
47
47
|
UriConstants2["FUNCTIONAL_MODULES"] = "/functional-modules";
|
|
48
|
+
UriConstants2["ACTION_SERVER_HOME"] = "/action_server_home";
|
|
48
49
|
return UriConstants2;
|
|
49
50
|
})(UriConstants || {});
|
|
50
51
|
|
|
@@ -5100,6 +5101,43 @@ var deleteCustomerSupabaseService = () => {
|
|
|
5100
5101
|
};
|
|
5101
5102
|
};
|
|
5102
5103
|
|
|
5104
|
+
// src/services/pos-service/supabase/upload-image.ts
|
|
5105
|
+
import { useCallback as useCallback55 } from "react";
|
|
5106
|
+
var uploadImageSupabaseService = () => {
|
|
5107
|
+
const supabase = useSupabaseOptional();
|
|
5108
|
+
const uploadImageSupabase = useCallback55(
|
|
5109
|
+
async (file, tenantId) => {
|
|
5110
|
+
if (!supabase) {
|
|
5111
|
+
console.error("Supabase client not initialized");
|
|
5112
|
+
return { url: null, error: "Supabase client not initialized" };
|
|
5113
|
+
}
|
|
5114
|
+
const bucketName = `tenant-${tenantId}`;
|
|
5115
|
+
try {
|
|
5116
|
+
const fileExt = file.name.split(".").pop();
|
|
5117
|
+
const fileName = `uploads/${Date.now()}_${Math.random().toString(36).substring(7)}.${fileExt}`;
|
|
5118
|
+
const { error: uploadError } = await supabase.storage.from(bucketName).upload(fileName, file, {
|
|
5119
|
+
cacheControl: "3600",
|
|
5120
|
+
upsert: false,
|
|
5121
|
+
contentType: file.type
|
|
5122
|
+
});
|
|
5123
|
+
if (uploadError) {
|
|
5124
|
+
console.error("Error uploading image:", uploadError);
|
|
5125
|
+
return { url: null, error: uploadError };
|
|
5126
|
+
}
|
|
5127
|
+
const { data: urlData } = supabase.storage.from(bucketName).getPublicUrl(fileName);
|
|
5128
|
+
return { url: urlData.publicUrl, error: null };
|
|
5129
|
+
} catch (error) {
|
|
5130
|
+
console.error("Error uploading image:", error);
|
|
5131
|
+
return { url: null, error };
|
|
5132
|
+
}
|
|
5133
|
+
},
|
|
5134
|
+
[supabase]
|
|
5135
|
+
);
|
|
5136
|
+
return {
|
|
5137
|
+
uploadImageSupabase
|
|
5138
|
+
};
|
|
5139
|
+
};
|
|
5140
|
+
|
|
5103
5141
|
// src/services/pos-service/index.ts
|
|
5104
5142
|
var serviceFactories = [
|
|
5105
5143
|
addEntityService,
|
|
@@ -5153,7 +5191,8 @@ var serviceFactories = [
|
|
|
5153
5191
|
createPaymentSupabaseService,
|
|
5154
5192
|
createCustomerSupabaseService,
|
|
5155
5193
|
updateCustomerSupabaseService,
|
|
5156
|
-
deleteCustomerSupabaseService
|
|
5194
|
+
deleteCustomerSupabaseService,
|
|
5195
|
+
uploadImageSupabaseService
|
|
5157
5196
|
];
|
|
5158
5197
|
var usePosService = () => {
|
|
5159
5198
|
const { env } = useEnv();
|
|
@@ -5318,6 +5357,9 @@ import { useMutation as useMutation108 } from "@tanstack/react-query";
|
|
|
5318
5357
|
// src/hooks/pos/supabase/use-delete-customer.ts
|
|
5319
5358
|
import { useMutation as useMutation109 } from "@tanstack/react-query";
|
|
5320
5359
|
|
|
5360
|
+
// src/hooks/pos/supabase/use-supa-upload-image.ts
|
|
5361
|
+
import { useMutation as useMutation110 } from "@tanstack/react-query";
|
|
5362
|
+
|
|
5321
5363
|
// src/provider/service-provider.tsx
|
|
5322
5364
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5323
5365
|
var ServiceContext = createContext3(null);
|
|
@@ -5329,7 +5371,7 @@ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
|
5329
5371
|
// src/services/action-service/index.ts
|
|
5330
5372
|
function useActionService() {
|
|
5331
5373
|
const { env } = useEnv();
|
|
5332
|
-
const loadAction =
|
|
5374
|
+
const loadAction = useCallback56(
|
|
5333
5375
|
async ({
|
|
5334
5376
|
idAction,
|
|
5335
5377
|
context,
|
|
@@ -5353,7 +5395,7 @@ function useActionService() {
|
|
|
5353
5395
|
},
|
|
5354
5396
|
[env]
|
|
5355
5397
|
);
|
|
5356
|
-
const callButton =
|
|
5398
|
+
const callButton = useCallback56(
|
|
5357
5399
|
async ({
|
|
5358
5400
|
model,
|
|
5359
5401
|
ids = [],
|
|
@@ -5387,7 +5429,7 @@ function useActionService() {
|
|
|
5387
5429
|
},
|
|
5388
5430
|
[env]
|
|
5389
5431
|
);
|
|
5390
|
-
const removeRows =
|
|
5432
|
+
const removeRows = useCallback56(
|
|
5391
5433
|
async ({
|
|
5392
5434
|
model,
|
|
5393
5435
|
ids,
|
|
@@ -5413,7 +5455,7 @@ function useActionService() {
|
|
|
5413
5455
|
},
|
|
5414
5456
|
[env]
|
|
5415
5457
|
);
|
|
5416
|
-
const duplicateRecord =
|
|
5458
|
+
const duplicateRecord = useCallback56(
|
|
5417
5459
|
async ({
|
|
5418
5460
|
model,
|
|
5419
5461
|
id,
|
|
@@ -5439,7 +5481,7 @@ function useActionService() {
|
|
|
5439
5481
|
},
|
|
5440
5482
|
[env]
|
|
5441
5483
|
);
|
|
5442
|
-
const getPrintReportName =
|
|
5484
|
+
const getPrintReportName = useCallback56(
|
|
5443
5485
|
async ({ id }) => {
|
|
5444
5486
|
const jsonData = {
|
|
5445
5487
|
model: "ir.actions.report",
|
|
@@ -5457,7 +5499,7 @@ function useActionService() {
|
|
|
5457
5499
|
},
|
|
5458
5500
|
[env]
|
|
5459
5501
|
);
|
|
5460
|
-
const print =
|
|
5502
|
+
const print = useCallback56(
|
|
5461
5503
|
async ({ id, report, db }) => {
|
|
5462
5504
|
const jsonData = {
|
|
5463
5505
|
report,
|
|
@@ -5475,7 +5517,7 @@ function useActionService() {
|
|
|
5475
5517
|
},
|
|
5476
5518
|
[env]
|
|
5477
5519
|
);
|
|
5478
|
-
const runAction =
|
|
5520
|
+
const runAction = useCallback56(
|
|
5479
5521
|
async ({
|
|
5480
5522
|
idAction,
|
|
5481
5523
|
context,
|
|
@@ -5502,7 +5544,7 @@ function useActionService() {
|
|
|
5502
5544
|
},
|
|
5503
5545
|
[env]
|
|
5504
5546
|
);
|
|
5505
|
-
const generateSerialNumber =
|
|
5547
|
+
const generateSerialNumber = useCallback56(
|
|
5506
5548
|
async ({
|
|
5507
5549
|
kwargs,
|
|
5508
5550
|
context,
|
|
@@ -5527,6 +5569,9 @@ function useActionService() {
|
|
|
5527
5569
|
},
|
|
5528
5570
|
[env]
|
|
5529
5571
|
);
|
|
5572
|
+
const actionServerHome = useCallback56(async () => {
|
|
5573
|
+
return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
|
|
5574
|
+
}, [env]);
|
|
5530
5575
|
return {
|
|
5531
5576
|
loadAction,
|
|
5532
5577
|
callButton,
|
|
@@ -5535,16 +5580,17 @@ function useActionService() {
|
|
|
5535
5580
|
getPrintReportName,
|
|
5536
5581
|
print,
|
|
5537
5582
|
runAction,
|
|
5538
|
-
generateSerialNumber
|
|
5583
|
+
generateSerialNumber,
|
|
5584
|
+
actionServerHome
|
|
5539
5585
|
};
|
|
5540
5586
|
}
|
|
5541
5587
|
|
|
5542
5588
|
// src/services/auth-service/index.ts
|
|
5543
|
-
import { useCallback as
|
|
5589
|
+
import { useCallback as useCallback57 } from "react";
|
|
5544
5590
|
function useAuthService() {
|
|
5545
5591
|
const { env } = useEnv();
|
|
5546
5592
|
const supabase = useSupabaseOptional();
|
|
5547
|
-
const login =
|
|
5593
|
+
const login = useCallback57(
|
|
5548
5594
|
async (body) => {
|
|
5549
5595
|
const payload = Object.fromEntries(
|
|
5550
5596
|
Object.entries({
|
|
@@ -5569,7 +5615,7 @@ function useAuthService() {
|
|
|
5569
5615
|
},
|
|
5570
5616
|
[env]
|
|
5571
5617
|
);
|
|
5572
|
-
const loginSupabase =
|
|
5618
|
+
const loginSupabase = useCallback57(
|
|
5573
5619
|
async (body) => {
|
|
5574
5620
|
if (!supabase) {
|
|
5575
5621
|
return {
|
|
@@ -5585,7 +5631,7 @@ function useAuthService() {
|
|
|
5585
5631
|
},
|
|
5586
5632
|
[supabase]
|
|
5587
5633
|
);
|
|
5588
|
-
const forgotPassword =
|
|
5634
|
+
const forgotPassword = useCallback57(
|
|
5589
5635
|
async (email) => {
|
|
5590
5636
|
const bodyData = {
|
|
5591
5637
|
login: email,
|
|
@@ -5599,7 +5645,7 @@ function useAuthService() {
|
|
|
5599
5645
|
},
|
|
5600
5646
|
[env]
|
|
5601
5647
|
);
|
|
5602
|
-
const forgotPasswordSSO =
|
|
5648
|
+
const forgotPasswordSSO = useCallback57(
|
|
5603
5649
|
async ({
|
|
5604
5650
|
email,
|
|
5605
5651
|
with_context,
|
|
@@ -5622,7 +5668,7 @@ function useAuthService() {
|
|
|
5622
5668
|
},
|
|
5623
5669
|
[env]
|
|
5624
5670
|
);
|
|
5625
|
-
const resetPassword =
|
|
5671
|
+
const resetPassword = useCallback57(
|
|
5626
5672
|
async (data, token) => {
|
|
5627
5673
|
const bodyData = {
|
|
5628
5674
|
token,
|
|
@@ -5637,7 +5683,7 @@ function useAuthService() {
|
|
|
5637
5683
|
},
|
|
5638
5684
|
[env]
|
|
5639
5685
|
);
|
|
5640
|
-
const resetPasswordSSO =
|
|
5686
|
+
const resetPasswordSSO = useCallback57(
|
|
5641
5687
|
async ({
|
|
5642
5688
|
method,
|
|
5643
5689
|
password,
|
|
@@ -5660,7 +5706,7 @@ function useAuthService() {
|
|
|
5660
5706
|
},
|
|
5661
5707
|
[env]
|
|
5662
5708
|
);
|
|
5663
|
-
const updatePassword =
|
|
5709
|
+
const updatePassword = useCallback57(
|
|
5664
5710
|
async (data, token) => {
|
|
5665
5711
|
const bodyData = {
|
|
5666
5712
|
token,
|
|
@@ -5675,7 +5721,7 @@ function useAuthService() {
|
|
|
5675
5721
|
},
|
|
5676
5722
|
[env]
|
|
5677
5723
|
);
|
|
5678
|
-
const isValidToken =
|
|
5724
|
+
const isValidToken = useCallback57(
|
|
5679
5725
|
async (token) => {
|
|
5680
5726
|
const bodyData = {
|
|
5681
5727
|
token
|
|
@@ -5688,7 +5734,7 @@ function useAuthService() {
|
|
|
5688
5734
|
},
|
|
5689
5735
|
[env]
|
|
5690
5736
|
);
|
|
5691
|
-
const isValidActionToken =
|
|
5737
|
+
const isValidActionToken = useCallback57(
|
|
5692
5738
|
async (actionToken) => {
|
|
5693
5739
|
const bodyData = {};
|
|
5694
5740
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5701,7 +5747,7 @@ function useAuthService() {
|
|
|
5701
5747
|
},
|
|
5702
5748
|
[env]
|
|
5703
5749
|
);
|
|
5704
|
-
const loginSocial =
|
|
5750
|
+
const loginSocial = useCallback57(
|
|
5705
5751
|
async ({
|
|
5706
5752
|
db,
|
|
5707
5753
|
state,
|
|
@@ -5719,13 +5765,13 @@ function useAuthService() {
|
|
|
5719
5765
|
},
|
|
5720
5766
|
[env]
|
|
5721
5767
|
);
|
|
5722
|
-
const getProviders =
|
|
5768
|
+
const getProviders = useCallback57(
|
|
5723
5769
|
async (db) => {
|
|
5724
5770
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5725
5771
|
},
|
|
5726
5772
|
[env]
|
|
5727
5773
|
);
|
|
5728
|
-
const getAccessByCode =
|
|
5774
|
+
const getAccessByCode = useCallback57(
|
|
5729
5775
|
async (code) => {
|
|
5730
5776
|
const data = new URLSearchParams();
|
|
5731
5777
|
data.append("code", code);
|
|
@@ -5745,7 +5791,7 @@ function useAuthService() {
|
|
|
5745
5791
|
},
|
|
5746
5792
|
[env]
|
|
5747
5793
|
);
|
|
5748
|
-
const logout =
|
|
5794
|
+
const logout = useCallback57(
|
|
5749
5795
|
async (service) => {
|
|
5750
5796
|
return env?.requests?.post(
|
|
5751
5797
|
"/logout" /* LOGOUT */,
|
|
@@ -5762,7 +5808,7 @@ function useAuthService() {
|
|
|
5762
5808
|
},
|
|
5763
5809
|
[env]
|
|
5764
5810
|
);
|
|
5765
|
-
const getTenantMapping =
|
|
5811
|
+
const getTenantMapping = useCallback57(
|
|
5766
5812
|
async ({ shortName, service }) => {
|
|
5767
5813
|
const bodyData = {
|
|
5768
5814
|
short_name: shortName
|
|
@@ -5780,7 +5826,7 @@ function useAuthService() {
|
|
|
5780
5826
|
},
|
|
5781
5827
|
[env]
|
|
5782
5828
|
);
|
|
5783
|
-
const getToken =
|
|
5829
|
+
const getToken = useCallback57(
|
|
5784
5830
|
async ({
|
|
5785
5831
|
phone,
|
|
5786
5832
|
name,
|
|
@@ -5825,10 +5871,10 @@ function useAuthService() {
|
|
|
5825
5871
|
}
|
|
5826
5872
|
|
|
5827
5873
|
// src/services/company-service/index.ts
|
|
5828
|
-
import { useCallback as
|
|
5874
|
+
import { useCallback as useCallback58 } from "react";
|
|
5829
5875
|
function useCompanyService() {
|
|
5830
5876
|
const { env } = useEnv();
|
|
5831
|
-
const getCurrentCompany =
|
|
5877
|
+
const getCurrentCompany = useCallback58(
|
|
5832
5878
|
async (service, extraHeaders) => {
|
|
5833
5879
|
return await env.requests.get(
|
|
5834
5880
|
"/company" /* COMPANY_PATH */,
|
|
@@ -5845,7 +5891,7 @@ function useCompanyService() {
|
|
|
5845
5891
|
},
|
|
5846
5892
|
[env]
|
|
5847
5893
|
);
|
|
5848
|
-
const getInfoCompany =
|
|
5894
|
+
const getInfoCompany = useCallback58(
|
|
5849
5895
|
async (id, service) => {
|
|
5850
5896
|
const jsonData = {
|
|
5851
5897
|
ids: [id],
|
|
@@ -5881,10 +5927,10 @@ function useCompanyService() {
|
|
|
5881
5927
|
}
|
|
5882
5928
|
|
|
5883
5929
|
// src/services/excel-service/index.ts
|
|
5884
|
-
import { useCallback as
|
|
5930
|
+
import { useCallback as useCallback59 } from "react";
|
|
5885
5931
|
function useExcelService() {
|
|
5886
5932
|
const { env } = useEnv();
|
|
5887
|
-
const uploadFileExcel =
|
|
5933
|
+
const uploadFileExcel = useCallback59(
|
|
5888
5934
|
async ({
|
|
5889
5935
|
formData,
|
|
5890
5936
|
service,
|
|
@@ -5901,7 +5947,7 @@ function useExcelService() {
|
|
|
5901
5947
|
},
|
|
5902
5948
|
[env]
|
|
5903
5949
|
);
|
|
5904
|
-
const uploadIdFile =
|
|
5950
|
+
const uploadIdFile = useCallback59(
|
|
5905
5951
|
async ({
|
|
5906
5952
|
formData,
|
|
5907
5953
|
service,
|
|
@@ -5918,7 +5964,7 @@ function useExcelService() {
|
|
|
5918
5964
|
},
|
|
5919
5965
|
[env]
|
|
5920
5966
|
);
|
|
5921
|
-
const parsePreview =
|
|
5967
|
+
const parsePreview = useCallback59(
|
|
5922
5968
|
async ({
|
|
5923
5969
|
id,
|
|
5924
5970
|
selectedSheet,
|
|
@@ -5967,7 +6013,7 @@ function useExcelService() {
|
|
|
5967
6013
|
},
|
|
5968
6014
|
[env]
|
|
5969
6015
|
);
|
|
5970
|
-
const executeImport =
|
|
6016
|
+
const executeImport = useCallback59(
|
|
5971
6017
|
async ({
|
|
5972
6018
|
columns,
|
|
5973
6019
|
fields,
|
|
@@ -6001,7 +6047,7 @@ function useExcelService() {
|
|
|
6001
6047
|
},
|
|
6002
6048
|
[env]
|
|
6003
6049
|
);
|
|
6004
|
-
const getFileExcel =
|
|
6050
|
+
const getFileExcel = useCallback59(
|
|
6005
6051
|
async ({
|
|
6006
6052
|
model,
|
|
6007
6053
|
service,
|
|
@@ -6025,7 +6071,7 @@ function useExcelService() {
|
|
|
6025
6071
|
},
|
|
6026
6072
|
[env]
|
|
6027
6073
|
);
|
|
6028
|
-
const getFieldExport =
|
|
6074
|
+
const getFieldExport = useCallback59(
|
|
6029
6075
|
async ({
|
|
6030
6076
|
ids,
|
|
6031
6077
|
model,
|
|
@@ -6065,7 +6111,7 @@ function useExcelService() {
|
|
|
6065
6111
|
},
|
|
6066
6112
|
[env]
|
|
6067
6113
|
);
|
|
6068
|
-
const exportExcel =
|
|
6114
|
+
const exportExcel = useCallback59(
|
|
6069
6115
|
async ({
|
|
6070
6116
|
model,
|
|
6071
6117
|
domain,
|
|
@@ -6113,10 +6159,10 @@ function useExcelService() {
|
|
|
6113
6159
|
}
|
|
6114
6160
|
|
|
6115
6161
|
// src/services/form-service/index.ts
|
|
6116
|
-
import { useCallback as
|
|
6162
|
+
import { useCallback as useCallback60 } from "react";
|
|
6117
6163
|
function useFormService() {
|
|
6118
6164
|
const { env } = useEnv();
|
|
6119
|
-
const getComment =
|
|
6165
|
+
const getComment = useCallback60(
|
|
6120
6166
|
async ({ data }) => {
|
|
6121
6167
|
const jsonData = {
|
|
6122
6168
|
thread_id: data.thread_id,
|
|
@@ -6134,7 +6180,7 @@ function useFormService() {
|
|
|
6134
6180
|
},
|
|
6135
6181
|
[env]
|
|
6136
6182
|
);
|
|
6137
|
-
const getThreadData =
|
|
6183
|
+
const getThreadData = useCallback60(
|
|
6138
6184
|
async ({
|
|
6139
6185
|
data,
|
|
6140
6186
|
xNode,
|
|
@@ -6161,7 +6207,7 @@ function useFormService() {
|
|
|
6161
6207
|
},
|
|
6162
6208
|
[env]
|
|
6163
6209
|
);
|
|
6164
|
-
const getThreadMessages =
|
|
6210
|
+
const getThreadMessages = useCallback60(
|
|
6165
6211
|
async ({
|
|
6166
6212
|
data,
|
|
6167
6213
|
xNode,
|
|
@@ -6187,7 +6233,7 @@ function useFormService() {
|
|
|
6187
6233
|
},
|
|
6188
6234
|
[env]
|
|
6189
6235
|
);
|
|
6190
|
-
const sentComment =
|
|
6236
|
+
const sentComment = useCallback60(
|
|
6191
6237
|
async ({ data }) => {
|
|
6192
6238
|
const jsonData = {
|
|
6193
6239
|
context: {
|
|
@@ -6215,7 +6261,7 @@ function useFormService() {
|
|
|
6215
6261
|
},
|
|
6216
6262
|
[env]
|
|
6217
6263
|
);
|
|
6218
|
-
const deleteComment =
|
|
6264
|
+
const deleteComment = useCallback60(
|
|
6219
6265
|
async ({ data }) => {
|
|
6220
6266
|
const jsonData = {
|
|
6221
6267
|
attachment_ids: [],
|
|
@@ -6231,7 +6277,7 @@ function useFormService() {
|
|
|
6231
6277
|
},
|
|
6232
6278
|
[env]
|
|
6233
6279
|
);
|
|
6234
|
-
const getImage =
|
|
6280
|
+
const getImage = useCallback60(
|
|
6235
6281
|
async ({ data }) => {
|
|
6236
6282
|
return env.requests.get(
|
|
6237
6283
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -6244,7 +6290,7 @@ function useFormService() {
|
|
|
6244
6290
|
},
|
|
6245
6291
|
[env]
|
|
6246
6292
|
);
|
|
6247
|
-
const uploadImage =
|
|
6293
|
+
const uploadImage = useCallback60(
|
|
6248
6294
|
async ({
|
|
6249
6295
|
formData,
|
|
6250
6296
|
service,
|
|
@@ -6263,7 +6309,7 @@ function useFormService() {
|
|
|
6263
6309
|
},
|
|
6264
6310
|
[env]
|
|
6265
6311
|
);
|
|
6266
|
-
const uploadFile =
|
|
6312
|
+
const uploadFile = useCallback60(
|
|
6267
6313
|
async ({
|
|
6268
6314
|
formData,
|
|
6269
6315
|
service,
|
|
@@ -6283,7 +6329,7 @@ function useFormService() {
|
|
|
6283
6329
|
},
|
|
6284
6330
|
[env]
|
|
6285
6331
|
);
|
|
6286
|
-
const getFormView =
|
|
6332
|
+
const getFormView = useCallback60(
|
|
6287
6333
|
async ({ data }) => {
|
|
6288
6334
|
const jsonData = {
|
|
6289
6335
|
model: data.model,
|
|
@@ -6299,7 +6345,7 @@ function useFormService() {
|
|
|
6299
6345
|
},
|
|
6300
6346
|
[env]
|
|
6301
6347
|
);
|
|
6302
|
-
const changeStatus =
|
|
6348
|
+
const changeStatus = useCallback60(
|
|
6303
6349
|
async ({ data }) => {
|
|
6304
6350
|
const vals = {
|
|
6305
6351
|
[data.name]: data.stage_id
|
|
@@ -6328,7 +6374,7 @@ function useFormService() {
|
|
|
6328
6374
|
},
|
|
6329
6375
|
[env]
|
|
6330
6376
|
);
|
|
6331
|
-
const getExternalTab =
|
|
6377
|
+
const getExternalTab = useCallback60(
|
|
6332
6378
|
async ({ method, context, service, xNode }) => {
|
|
6333
6379
|
return env?.requests?.post(
|
|
6334
6380
|
"/call" /* CALL_PATH */,
|
|
@@ -6363,10 +6409,10 @@ function useFormService() {
|
|
|
6363
6409
|
}
|
|
6364
6410
|
|
|
6365
6411
|
// src/services/kanban-service/index.ts
|
|
6366
|
-
import { useCallback as
|
|
6412
|
+
import { useCallback as useCallback61 } from "react";
|
|
6367
6413
|
function useKanbanService() {
|
|
6368
6414
|
const { env } = useEnv();
|
|
6369
|
-
const getGroups =
|
|
6415
|
+
const getGroups = useCallback61(
|
|
6370
6416
|
async ({ model, width_context }) => {
|
|
6371
6417
|
const jsonData = {
|
|
6372
6418
|
model,
|
|
@@ -6386,7 +6432,7 @@ function useKanbanService() {
|
|
|
6386
6432
|
},
|
|
6387
6433
|
[env]
|
|
6388
6434
|
);
|
|
6389
|
-
const getProgressBar =
|
|
6435
|
+
const getProgressBar = useCallback61(
|
|
6390
6436
|
async ({ field, color, model, width_context }) => {
|
|
6391
6437
|
const jsonData = {
|
|
6392
6438
|
model,
|
|
@@ -6416,10 +6462,10 @@ function useKanbanService() {
|
|
|
6416
6462
|
}
|
|
6417
6463
|
|
|
6418
6464
|
// src/services/model-service/index.ts
|
|
6419
|
-
import { useCallback as
|
|
6465
|
+
import { useCallback as useCallback62 } from "react";
|
|
6420
6466
|
function useModelService() {
|
|
6421
6467
|
const { env } = useEnv();
|
|
6422
|
-
const getListMyBankAccount =
|
|
6468
|
+
const getListMyBankAccount = useCallback62(
|
|
6423
6469
|
async ({
|
|
6424
6470
|
domain,
|
|
6425
6471
|
spectification,
|
|
@@ -6443,7 +6489,7 @@ function useModelService() {
|
|
|
6443
6489
|
},
|
|
6444
6490
|
[env]
|
|
6445
6491
|
);
|
|
6446
|
-
const getCurrency =
|
|
6492
|
+
const getCurrency = useCallback62(async () => {
|
|
6447
6493
|
const jsonData = {
|
|
6448
6494
|
model: "res.currency",
|
|
6449
6495
|
method: "web_search_read",
|
|
@@ -6463,7 +6509,7 @@ function useModelService() {
|
|
|
6463
6509
|
}
|
|
6464
6510
|
});
|
|
6465
6511
|
}, [env]);
|
|
6466
|
-
const getConversionRate =
|
|
6512
|
+
const getConversionRate = useCallback62(async () => {
|
|
6467
6513
|
const jsonData = {
|
|
6468
6514
|
model: "res.currency",
|
|
6469
6515
|
method: "web_search_read",
|
|
@@ -6489,7 +6535,7 @@ function useModelService() {
|
|
|
6489
6535
|
}
|
|
6490
6536
|
});
|
|
6491
6537
|
}, [env]);
|
|
6492
|
-
const getAll =
|
|
6538
|
+
const getAll = useCallback62(
|
|
6493
6539
|
async ({
|
|
6494
6540
|
data,
|
|
6495
6541
|
service,
|
|
@@ -6531,7 +6577,7 @@ function useModelService() {
|
|
|
6531
6577
|
},
|
|
6532
6578
|
[env]
|
|
6533
6579
|
);
|
|
6534
|
-
const getListCalendar =
|
|
6580
|
+
const getListCalendar = useCallback62(
|
|
6535
6581
|
async ({ data }) => {
|
|
6536
6582
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6537
6583
|
fields: data.fields,
|
|
@@ -6562,7 +6608,7 @@ function useModelService() {
|
|
|
6562
6608
|
},
|
|
6563
6609
|
[env]
|
|
6564
6610
|
);
|
|
6565
|
-
const getList =
|
|
6611
|
+
const getList = useCallback62(
|
|
6566
6612
|
async ({
|
|
6567
6613
|
model,
|
|
6568
6614
|
ids = [],
|
|
@@ -6594,7 +6640,7 @@ function useModelService() {
|
|
|
6594
6640
|
},
|
|
6595
6641
|
[env]
|
|
6596
6642
|
);
|
|
6597
|
-
const getDetail =
|
|
6643
|
+
const getDetail = useCallback62(
|
|
6598
6644
|
async ({
|
|
6599
6645
|
ids = [],
|
|
6600
6646
|
model,
|
|
@@ -6626,7 +6672,7 @@ function useModelService() {
|
|
|
6626
6672
|
},
|
|
6627
6673
|
[env]
|
|
6628
6674
|
);
|
|
6629
|
-
const save =
|
|
6675
|
+
const save = useCallback62(
|
|
6630
6676
|
async ({
|
|
6631
6677
|
model,
|
|
6632
6678
|
ids = [],
|
|
@@ -6661,7 +6707,7 @@ function useModelService() {
|
|
|
6661
6707
|
},
|
|
6662
6708
|
[env]
|
|
6663
6709
|
);
|
|
6664
|
-
const deleteApi =
|
|
6710
|
+
const deleteApi = useCallback62(
|
|
6665
6711
|
async ({ ids = [], model, service }) => {
|
|
6666
6712
|
const jsonData = {
|
|
6667
6713
|
model,
|
|
@@ -6681,7 +6727,7 @@ function useModelService() {
|
|
|
6681
6727
|
},
|
|
6682
6728
|
[env]
|
|
6683
6729
|
);
|
|
6684
|
-
const onChange =
|
|
6730
|
+
const onChange = useCallback62(
|
|
6685
6731
|
async ({
|
|
6686
6732
|
ids = [],
|
|
6687
6733
|
model,
|
|
@@ -6717,7 +6763,7 @@ function useModelService() {
|
|
|
6717
6763
|
},
|
|
6718
6764
|
[env]
|
|
6719
6765
|
);
|
|
6720
|
-
const getListFieldsOnchange =
|
|
6766
|
+
const getListFieldsOnchange = useCallback62(
|
|
6721
6767
|
async ({
|
|
6722
6768
|
model,
|
|
6723
6769
|
service,
|
|
@@ -6741,7 +6787,7 @@ function useModelService() {
|
|
|
6741
6787
|
},
|
|
6742
6788
|
[env]
|
|
6743
6789
|
);
|
|
6744
|
-
const parseORMOdoo =
|
|
6790
|
+
const parseORMOdoo = useCallback62((data) => {
|
|
6745
6791
|
for (const key in data) {
|
|
6746
6792
|
if (key === "display_name") {
|
|
6747
6793
|
delete data[key];
|
|
@@ -6752,7 +6798,7 @@ function useModelService() {
|
|
|
6752
6798
|
}
|
|
6753
6799
|
return { ...data };
|
|
6754
6800
|
}, []);
|
|
6755
|
-
const toDataJS =
|
|
6801
|
+
const toDataJS = useCallback62(
|
|
6756
6802
|
(data, viewData, model) => {
|
|
6757
6803
|
for (const key in data) {
|
|
6758
6804
|
if (data[key] === false) {
|
|
@@ -6810,10 +6856,10 @@ function useModelService() {
|
|
|
6810
6856
|
}
|
|
6811
6857
|
|
|
6812
6858
|
// src/services/user-service/index.ts
|
|
6813
|
-
import { useCallback as
|
|
6859
|
+
import { useCallback as useCallback63 } from "react";
|
|
6814
6860
|
function useUserService() {
|
|
6815
6861
|
const { env } = useEnv();
|
|
6816
|
-
const getProfile =
|
|
6862
|
+
const getProfile = useCallback63(
|
|
6817
6863
|
async (service, path, extraHeaders) => {
|
|
6818
6864
|
return env?.requests?.get(
|
|
6819
6865
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -6830,7 +6876,7 @@ function useUserService() {
|
|
|
6830
6876
|
},
|
|
6831
6877
|
[env]
|
|
6832
6878
|
);
|
|
6833
|
-
const getUser =
|
|
6879
|
+
const getUser = useCallback63(
|
|
6834
6880
|
async ({ context, id }) => {
|
|
6835
6881
|
const jsonData = {
|
|
6836
6882
|
model: "res.users",
|
|
@@ -6868,7 +6914,7 @@ function useUserService() {
|
|
|
6868
6914
|
},
|
|
6869
6915
|
[env]
|
|
6870
6916
|
);
|
|
6871
|
-
const switchUserLocale =
|
|
6917
|
+
const switchUserLocale = useCallback63(
|
|
6872
6918
|
async ({ id, values, service }) => {
|
|
6873
6919
|
const jsonData = {
|
|
6874
6920
|
model: "res.users",
|
|
@@ -6896,10 +6942,10 @@ function useUserService() {
|
|
|
6896
6942
|
}
|
|
6897
6943
|
|
|
6898
6944
|
// src/services/view-service/index.ts
|
|
6899
|
-
import { useCallback as
|
|
6945
|
+
import { useCallback as useCallback64 } from "react";
|
|
6900
6946
|
function useViewService() {
|
|
6901
6947
|
const { env } = useEnv();
|
|
6902
|
-
const getView =
|
|
6948
|
+
const getView = useCallback64(
|
|
6903
6949
|
async ({
|
|
6904
6950
|
model,
|
|
6905
6951
|
views,
|
|
@@ -6939,7 +6985,7 @@ function useViewService() {
|
|
|
6939
6985
|
},
|
|
6940
6986
|
[env]
|
|
6941
6987
|
);
|
|
6942
|
-
const getMenu =
|
|
6988
|
+
const getMenu = useCallback64(
|
|
6943
6989
|
async (context, specification, domain, service) => {
|
|
6944
6990
|
const jsonData = {
|
|
6945
6991
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -6970,7 +7016,7 @@ function useViewService() {
|
|
|
6970
7016
|
},
|
|
6971
7017
|
[env]
|
|
6972
7018
|
);
|
|
6973
|
-
const getActionDetail =
|
|
7019
|
+
const getActionDetail = useCallback64(
|
|
6974
7020
|
async (aid, context) => {
|
|
6975
7021
|
const jsonData = {
|
|
6976
7022
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -7000,7 +7046,7 @@ function useViewService() {
|
|
|
7000
7046
|
},
|
|
7001
7047
|
[env]
|
|
7002
7048
|
);
|
|
7003
|
-
const getResequence =
|
|
7049
|
+
const getResequence = useCallback64(
|
|
7004
7050
|
async ({
|
|
7005
7051
|
model,
|
|
7006
7052
|
ids,
|
|
@@ -7030,7 +7076,7 @@ function useViewService() {
|
|
|
7030
7076
|
},
|
|
7031
7077
|
[env]
|
|
7032
7078
|
);
|
|
7033
|
-
const getSelectionItem =
|
|
7079
|
+
const getSelectionItem = useCallback64(
|
|
7034
7080
|
async ({
|
|
7035
7081
|
data,
|
|
7036
7082
|
service,
|
|
@@ -7067,7 +7113,7 @@ function useViewService() {
|
|
|
7067
7113
|
},
|
|
7068
7114
|
[env]
|
|
7069
7115
|
);
|
|
7070
|
-
const loadMessages =
|
|
7116
|
+
const loadMessages = useCallback64(async () => {
|
|
7071
7117
|
return env.requests.post(
|
|
7072
7118
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
7073
7119
|
{},
|
|
@@ -7078,14 +7124,14 @@ function useViewService() {
|
|
|
7078
7124
|
}
|
|
7079
7125
|
);
|
|
7080
7126
|
}, [env]);
|
|
7081
|
-
const getVersion =
|
|
7127
|
+
const getVersion = useCallback64(async () => {
|
|
7082
7128
|
return env?.requests?.get("", {
|
|
7083
7129
|
headers: {
|
|
7084
7130
|
"Content-Type": "application/json"
|
|
7085
7131
|
}
|
|
7086
7132
|
});
|
|
7087
7133
|
}, [env]);
|
|
7088
|
-
const grantAccess =
|
|
7134
|
+
const grantAccess = useCallback64(
|
|
7089
7135
|
async ({
|
|
7090
7136
|
redirect_uri,
|
|
7091
7137
|
state,
|
|
@@ -7112,7 +7158,7 @@ function useViewService() {
|
|
|
7112
7158
|
},
|
|
7113
7159
|
[env]
|
|
7114
7160
|
);
|
|
7115
|
-
const removeTotpSetUp =
|
|
7161
|
+
const removeTotpSetUp = useCallback64(
|
|
7116
7162
|
async ({ method, token }) => {
|
|
7117
7163
|
const jsonData = {
|
|
7118
7164
|
method,
|
|
@@ -7133,7 +7179,7 @@ function useViewService() {
|
|
|
7133
7179
|
},
|
|
7134
7180
|
[env]
|
|
7135
7181
|
);
|
|
7136
|
-
const requestSetupTotp =
|
|
7182
|
+
const requestSetupTotp = useCallback64(
|
|
7137
7183
|
async ({ method, token }) => {
|
|
7138
7184
|
const jsonData = {
|
|
7139
7185
|
method,
|
|
@@ -7152,7 +7198,7 @@ function useViewService() {
|
|
|
7152
7198
|
},
|
|
7153
7199
|
[env]
|
|
7154
7200
|
);
|
|
7155
|
-
const settingsWebRead2fa =
|
|
7201
|
+
const settingsWebRead2fa = useCallback64(
|
|
7156
7202
|
async ({
|
|
7157
7203
|
method,
|
|
7158
7204
|
model,
|
|
@@ -7180,7 +7226,7 @@ function useViewService() {
|
|
|
7180
7226
|
},
|
|
7181
7227
|
[env]
|
|
7182
7228
|
);
|
|
7183
|
-
const signInSSO =
|
|
7229
|
+
const signInSSO = useCallback64(
|
|
7184
7230
|
async ({
|
|
7185
7231
|
redirect_uri,
|
|
7186
7232
|
state,
|
|
@@ -7212,7 +7258,7 @@ function useViewService() {
|
|
|
7212
7258
|
},
|
|
7213
7259
|
[env]
|
|
7214
7260
|
);
|
|
7215
|
-
const verify2FA =
|
|
7261
|
+
const verify2FA = useCallback64(
|
|
7216
7262
|
({
|
|
7217
7263
|
method,
|
|
7218
7264
|
with_context,
|
|
@@ -7245,7 +7291,7 @@ function useViewService() {
|
|
|
7245
7291
|
},
|
|
7246
7292
|
[env]
|
|
7247
7293
|
);
|
|
7248
|
-
const get2FAMethods =
|
|
7294
|
+
const get2FAMethods = useCallback64(
|
|
7249
7295
|
({ method, with_context }) => {
|
|
7250
7296
|
const jsonData = {
|
|
7251
7297
|
method,
|
|
@@ -7264,7 +7310,7 @@ function useViewService() {
|
|
|
7264
7310
|
},
|
|
7265
7311
|
[env]
|
|
7266
7312
|
);
|
|
7267
|
-
const verifyTotp =
|
|
7313
|
+
const verifyTotp = useCallback64(
|
|
7268
7314
|
({
|
|
7269
7315
|
method,
|
|
7270
7316
|
action_token,
|
|
@@ -7289,7 +7335,7 @@ function useViewService() {
|
|
|
7289
7335
|
},
|
|
7290
7336
|
[env]
|
|
7291
7337
|
);
|
|
7292
|
-
const getNotifications =
|
|
7338
|
+
const getNotifications = useCallback64(
|
|
7293
7339
|
async ({
|
|
7294
7340
|
service,
|
|
7295
7341
|
xNode,
|
|
@@ -7309,7 +7355,7 @@ function useViewService() {
|
|
|
7309
7355
|
},
|
|
7310
7356
|
[env]
|
|
7311
7357
|
);
|
|
7312
|
-
const getCountry =
|
|
7358
|
+
const getCountry = useCallback64(
|
|
7313
7359
|
async ({
|
|
7314
7360
|
service,
|
|
7315
7361
|
xNode,
|
|
@@ -7336,7 +7382,7 @@ function useViewService() {
|
|
|
7336
7382
|
},
|
|
7337
7383
|
[env]
|
|
7338
7384
|
);
|
|
7339
|
-
const getCity =
|
|
7385
|
+
const getCity = useCallback64(
|
|
7340
7386
|
async ({
|
|
7341
7387
|
service,
|
|
7342
7388
|
xNode,
|
|
@@ -7363,7 +7409,7 @@ function useViewService() {
|
|
|
7363
7409
|
},
|
|
7364
7410
|
[env]
|
|
7365
7411
|
);
|
|
7366
|
-
const getWard =
|
|
7412
|
+
const getWard = useCallback64(
|
|
7367
7413
|
async ({
|
|
7368
7414
|
service,
|
|
7369
7415
|
xNode,
|
|
@@ -7388,7 +7434,7 @@ function useViewService() {
|
|
|
7388
7434
|
},
|
|
7389
7435
|
[env]
|
|
7390
7436
|
);
|
|
7391
|
-
const getPartnerTitle =
|
|
7437
|
+
const getPartnerTitle = useCallback64(
|
|
7392
7438
|
async ({
|
|
7393
7439
|
service,
|
|
7394
7440
|
xNode,
|
|
@@ -7440,10 +7486,10 @@ function useViewService() {
|
|
|
7440
7486
|
}
|
|
7441
7487
|
|
|
7442
7488
|
// src/services/dashboard-service/index.ts
|
|
7443
|
-
import { useCallback as
|
|
7489
|
+
import { useCallback as useCallback65 } from "react";
|
|
7444
7490
|
function useDashboardService() {
|
|
7445
7491
|
const { env } = useEnv();
|
|
7446
|
-
const readGroup =
|
|
7492
|
+
const readGroup = useCallback65(
|
|
7447
7493
|
async ({
|
|
7448
7494
|
service,
|
|
7449
7495
|
xNode,
|
|
@@ -7460,7 +7506,7 @@ function useDashboardService() {
|
|
|
7460
7506
|
},
|
|
7461
7507
|
[env]
|
|
7462
7508
|
);
|
|
7463
|
-
const getDataChart =
|
|
7509
|
+
const getDataChart = useCallback65(
|
|
7464
7510
|
async ({
|
|
7465
7511
|
service,
|
|
7466
7512
|
xNode,
|