@fctc/interface-logic 5.0.2 → 5.0.4
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 +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +1 -0
- package/dist/constants.mjs +1 -0
- package/dist/hooks.d.mts +5 -1
- package/dist/hooks.d.ts +5 -1
- package/dist/hooks.js +71 -7
- package/dist/hooks.mjs +70 -7
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +72 -7
- package/dist/index.mjs +71 -7
- package/dist/provider.d.mts +2 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.js +91 -28
- package/dist/provider.mjs +80 -17
- package/dist/services.d.mts +4 -0
- package/dist/services.d.ts +4 -0
- package/dist/services.js +157 -102
- package/dist/services.mjs +154 -99
- 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 useCallback63 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/constants/api/uri-constant.ts
|
|
5
5
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -34,6 +34,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
|
34
34
|
UriConstants2["TOKEN_BY_CODE"] = "/token";
|
|
35
35
|
UriConstants2["LOGOUT"] = "/logout";
|
|
36
36
|
UriConstants2["SUPABASE_LOGIN_PATH"] = "/api/v2/auth/login";
|
|
37
|
+
UriConstants2["SUPABASE_CURRENT_USER"] = "/api/v2/auth/me";
|
|
37
38
|
UriConstants2["CREATE_UPDATE"] = "/create_update";
|
|
38
39
|
UriConstants2["SEARCH_READ"] = "/search_read";
|
|
39
40
|
UriConstants2["CREATE_PATH"] = "/create";
|
|
@@ -4008,10 +4009,41 @@ var loadDataPosSessionService = (env) => {
|
|
|
4008
4009
|
return createModelResult(modelName, data || []);
|
|
4009
4010
|
})
|
|
4010
4011
|
);
|
|
4011
|
-
|
|
4012
|
-
acc
|
|
4013
|
-
|
|
4014
|
-
|
|
4012
|
+
const response = results.reduce(
|
|
4013
|
+
(acc, { modelName, ...rest }) => {
|
|
4014
|
+
acc[modelName] = rest;
|
|
4015
|
+
return acc;
|
|
4016
|
+
},
|
|
4017
|
+
{}
|
|
4018
|
+
);
|
|
4019
|
+
const ordersModel = response["pos.order" /* POS_ORDER */];
|
|
4020
|
+
const paymentsModel = response["pos.payment" /* POS_PAYMENT */];
|
|
4021
|
+
const paymentMethodsModel = response["pos.payment.method" /* POS_PAYMENT_METHOD */];
|
|
4022
|
+
if (ordersModel?.data && paymentsModel?.data && paymentMethodsModel?.data) {
|
|
4023
|
+
const paymentMethodsMap = new Map(
|
|
4024
|
+
paymentMethodsModel.data.map((pm) => [pm.id, pm])
|
|
4025
|
+
);
|
|
4026
|
+
const paymentsByOrder = /* @__PURE__ */ new Map();
|
|
4027
|
+
for (const payment of paymentsModel.data) {
|
|
4028
|
+
const orderId = payment.pos_order_id;
|
|
4029
|
+
if (!paymentsByOrder.has(orderId)) {
|
|
4030
|
+
paymentsByOrder.set(orderId, []);
|
|
4031
|
+
}
|
|
4032
|
+
const paymentMethod = paymentMethodsMap.get(payment.payment_method_id);
|
|
4033
|
+
paymentsByOrder.get(orderId).push({
|
|
4034
|
+
...payment,
|
|
4035
|
+
payment_method_id: paymentMethod ? {
|
|
4036
|
+
id: paymentMethod.id,
|
|
4037
|
+
display_name: paymentMethod.display_name || paymentMethod.name
|
|
4038
|
+
} : null
|
|
4039
|
+
});
|
|
4040
|
+
}
|
|
4041
|
+
ordersModel.data = ordersModel.data.map((order) => ({
|
|
4042
|
+
...order,
|
|
4043
|
+
payment_ids: paymentsByOrder.get(order.id) || []
|
|
4044
|
+
}));
|
|
4045
|
+
}
|
|
4046
|
+
return response;
|
|
4015
4047
|
} catch (error) {
|
|
4016
4048
|
console.error("Error loading data from Supabase:", error);
|
|
4017
4049
|
return {};
|
|
@@ -5265,6 +5297,25 @@ var getPartnerTitlesSupabaseService = () => {
|
|
|
5265
5297
|
};
|
|
5266
5298
|
};
|
|
5267
5299
|
|
|
5300
|
+
// src/services/pos-service/supabase/get-supa-current-user.ts
|
|
5301
|
+
import { useCallback as useCallback62 } from "react";
|
|
5302
|
+
var getSupaCurrentUser = (env) => {
|
|
5303
|
+
const getSupaCurrentUser2 = useCallback62(
|
|
5304
|
+
({ tenantId }) => {
|
|
5305
|
+
return env?.requests.get("/api/v2/auth/me" /* SUPABASE_CURRENT_USER */, {
|
|
5306
|
+
headers: {
|
|
5307
|
+
"Content-Type": "application/json",
|
|
5308
|
+
"x-tenant-id": tenantId
|
|
5309
|
+
}
|
|
5310
|
+
});
|
|
5311
|
+
},
|
|
5312
|
+
[env]
|
|
5313
|
+
);
|
|
5314
|
+
return {
|
|
5315
|
+
getSupaCurrentUser: getSupaCurrentUser2
|
|
5316
|
+
};
|
|
5317
|
+
};
|
|
5318
|
+
|
|
5268
5319
|
// src/services/pos-service/index.ts
|
|
5269
5320
|
var serviceFactories = [
|
|
5270
5321
|
addEntityService,
|
|
@@ -5325,7 +5376,8 @@ var serviceFactories = [
|
|
|
5325
5376
|
assignRoleService,
|
|
5326
5377
|
getStatesSupabaseService,
|
|
5327
5378
|
getWardsSupabaseService,
|
|
5328
|
-
getPartnerTitlesSupabaseService
|
|
5379
|
+
getPartnerTitlesSupabaseService,
|
|
5380
|
+
getSupaCurrentUser
|
|
5329
5381
|
];
|
|
5330
5382
|
var usePosService = () => {
|
|
5331
5383
|
const { env } = useEnv();
|
|
@@ -5523,6 +5575,9 @@ import { useMutation as useMutation113 } from "@tanstack/react-query";
|
|
|
5523
5575
|
// src/hooks/pos/supabase/use-assign-role.ts
|
|
5524
5576
|
import { useMutation as useMutation114 } from "@tanstack/react-query";
|
|
5525
5577
|
|
|
5578
|
+
// src/hooks/pos/supabase/use-get-supa-current-user.ts
|
|
5579
|
+
import { useMutation as useMutation115 } from "@tanstack/react-query";
|
|
5580
|
+
|
|
5526
5581
|
// src/provider/service-provider.tsx
|
|
5527
5582
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5528
5583
|
var ServiceContext = createContext3(null);
|
|
@@ -5534,7 +5589,7 @@ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
|
5534
5589
|
// src/services/action-service/index.ts
|
|
5535
5590
|
function useActionService() {
|
|
5536
5591
|
const { env } = useEnv();
|
|
5537
|
-
const loadAction =
|
|
5592
|
+
const loadAction = useCallback63(
|
|
5538
5593
|
async ({
|
|
5539
5594
|
idAction,
|
|
5540
5595
|
context,
|
|
@@ -5558,7 +5613,7 @@ function useActionService() {
|
|
|
5558
5613
|
},
|
|
5559
5614
|
[env]
|
|
5560
5615
|
);
|
|
5561
|
-
const callButton =
|
|
5616
|
+
const callButton = useCallback63(
|
|
5562
5617
|
async ({
|
|
5563
5618
|
model,
|
|
5564
5619
|
ids = [],
|
|
@@ -5592,7 +5647,7 @@ function useActionService() {
|
|
|
5592
5647
|
},
|
|
5593
5648
|
[env]
|
|
5594
5649
|
);
|
|
5595
|
-
const removeRows =
|
|
5650
|
+
const removeRows = useCallback63(
|
|
5596
5651
|
async ({
|
|
5597
5652
|
model,
|
|
5598
5653
|
ids,
|
|
@@ -5618,7 +5673,7 @@ function useActionService() {
|
|
|
5618
5673
|
},
|
|
5619
5674
|
[env]
|
|
5620
5675
|
);
|
|
5621
|
-
const duplicateRecord =
|
|
5676
|
+
const duplicateRecord = useCallback63(
|
|
5622
5677
|
async ({
|
|
5623
5678
|
model,
|
|
5624
5679
|
id,
|
|
@@ -5644,7 +5699,7 @@ function useActionService() {
|
|
|
5644
5699
|
},
|
|
5645
5700
|
[env]
|
|
5646
5701
|
);
|
|
5647
|
-
const getPrintReportName =
|
|
5702
|
+
const getPrintReportName = useCallback63(
|
|
5648
5703
|
async ({ id }) => {
|
|
5649
5704
|
const jsonData = {
|
|
5650
5705
|
model: "ir.actions.report",
|
|
@@ -5662,7 +5717,7 @@ function useActionService() {
|
|
|
5662
5717
|
},
|
|
5663
5718
|
[env]
|
|
5664
5719
|
);
|
|
5665
|
-
const print =
|
|
5720
|
+
const print = useCallback63(
|
|
5666
5721
|
async ({ id, report, db }) => {
|
|
5667
5722
|
const jsonData = {
|
|
5668
5723
|
report,
|
|
@@ -5680,7 +5735,7 @@ function useActionService() {
|
|
|
5680
5735
|
},
|
|
5681
5736
|
[env]
|
|
5682
5737
|
);
|
|
5683
|
-
const runAction =
|
|
5738
|
+
const runAction = useCallback63(
|
|
5684
5739
|
async ({
|
|
5685
5740
|
idAction,
|
|
5686
5741
|
context,
|
|
@@ -5707,7 +5762,7 @@ function useActionService() {
|
|
|
5707
5762
|
},
|
|
5708
5763
|
[env]
|
|
5709
5764
|
);
|
|
5710
|
-
const generateSerialNumber =
|
|
5765
|
+
const generateSerialNumber = useCallback63(
|
|
5711
5766
|
async ({
|
|
5712
5767
|
kwargs,
|
|
5713
5768
|
context,
|
|
@@ -5732,7 +5787,7 @@ function useActionService() {
|
|
|
5732
5787
|
},
|
|
5733
5788
|
[env]
|
|
5734
5789
|
);
|
|
5735
|
-
const actionServerHome =
|
|
5790
|
+
const actionServerHome = useCallback63(async () => {
|
|
5736
5791
|
return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
|
|
5737
5792
|
}, [env]);
|
|
5738
5793
|
return {
|
|
@@ -5749,11 +5804,11 @@ function useActionService() {
|
|
|
5749
5804
|
}
|
|
5750
5805
|
|
|
5751
5806
|
// src/services/auth-service/index.ts
|
|
5752
|
-
import { useCallback as
|
|
5807
|
+
import { useCallback as useCallback64 } from "react";
|
|
5753
5808
|
function useAuthService() {
|
|
5754
5809
|
const { env } = useEnv();
|
|
5755
5810
|
const supabase = useSupabaseOptional();
|
|
5756
|
-
const login =
|
|
5811
|
+
const login = useCallback64(
|
|
5757
5812
|
async (body) => {
|
|
5758
5813
|
const payload = Object.fromEntries(
|
|
5759
5814
|
Object.entries({
|
|
@@ -5778,7 +5833,7 @@ function useAuthService() {
|
|
|
5778
5833
|
},
|
|
5779
5834
|
[env]
|
|
5780
5835
|
);
|
|
5781
|
-
const loginTenantUser =
|
|
5836
|
+
const loginTenantUser = useCallback64(
|
|
5782
5837
|
async (body) => {
|
|
5783
5838
|
const payload = {
|
|
5784
5839
|
email: body.email,
|
|
@@ -5793,7 +5848,7 @@ function useAuthService() {
|
|
|
5793
5848
|
},
|
|
5794
5849
|
[env]
|
|
5795
5850
|
);
|
|
5796
|
-
const forgotPassword =
|
|
5851
|
+
const forgotPassword = useCallback64(
|
|
5797
5852
|
async (email) => {
|
|
5798
5853
|
const bodyData = {
|
|
5799
5854
|
login: email,
|
|
@@ -5807,7 +5862,7 @@ function useAuthService() {
|
|
|
5807
5862
|
},
|
|
5808
5863
|
[env]
|
|
5809
5864
|
);
|
|
5810
|
-
const forgotPasswordSSO =
|
|
5865
|
+
const forgotPasswordSSO = useCallback64(
|
|
5811
5866
|
async ({
|
|
5812
5867
|
email,
|
|
5813
5868
|
with_context,
|
|
@@ -5830,7 +5885,7 @@ function useAuthService() {
|
|
|
5830
5885
|
},
|
|
5831
5886
|
[env]
|
|
5832
5887
|
);
|
|
5833
|
-
const resetPassword =
|
|
5888
|
+
const resetPassword = useCallback64(
|
|
5834
5889
|
async (data, token) => {
|
|
5835
5890
|
const bodyData = {
|
|
5836
5891
|
token,
|
|
@@ -5845,7 +5900,7 @@ function useAuthService() {
|
|
|
5845
5900
|
},
|
|
5846
5901
|
[env]
|
|
5847
5902
|
);
|
|
5848
|
-
const resetPasswordSSO =
|
|
5903
|
+
const resetPasswordSSO = useCallback64(
|
|
5849
5904
|
async ({
|
|
5850
5905
|
method,
|
|
5851
5906
|
password,
|
|
@@ -5868,7 +5923,7 @@ function useAuthService() {
|
|
|
5868
5923
|
},
|
|
5869
5924
|
[env]
|
|
5870
5925
|
);
|
|
5871
|
-
const updatePassword =
|
|
5926
|
+
const updatePassword = useCallback64(
|
|
5872
5927
|
async (data, token) => {
|
|
5873
5928
|
const bodyData = {
|
|
5874
5929
|
token,
|
|
@@ -5883,7 +5938,7 @@ function useAuthService() {
|
|
|
5883
5938
|
},
|
|
5884
5939
|
[env]
|
|
5885
5940
|
);
|
|
5886
|
-
const isValidToken =
|
|
5941
|
+
const isValidToken = useCallback64(
|
|
5887
5942
|
async (token) => {
|
|
5888
5943
|
const bodyData = {
|
|
5889
5944
|
token
|
|
@@ -5896,7 +5951,7 @@ function useAuthService() {
|
|
|
5896
5951
|
},
|
|
5897
5952
|
[env]
|
|
5898
5953
|
);
|
|
5899
|
-
const isValidActionToken =
|
|
5954
|
+
const isValidActionToken = useCallback64(
|
|
5900
5955
|
async (actionToken) => {
|
|
5901
5956
|
const bodyData = {};
|
|
5902
5957
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5909,7 +5964,7 @@ function useAuthService() {
|
|
|
5909
5964
|
},
|
|
5910
5965
|
[env]
|
|
5911
5966
|
);
|
|
5912
|
-
const loginSocial =
|
|
5967
|
+
const loginSocial = useCallback64(
|
|
5913
5968
|
async ({
|
|
5914
5969
|
db,
|
|
5915
5970
|
state,
|
|
@@ -5927,13 +5982,13 @@ function useAuthService() {
|
|
|
5927
5982
|
},
|
|
5928
5983
|
[env]
|
|
5929
5984
|
);
|
|
5930
|
-
const getProviders =
|
|
5985
|
+
const getProviders = useCallback64(
|
|
5931
5986
|
async (db) => {
|
|
5932
5987
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5933
5988
|
},
|
|
5934
5989
|
[env]
|
|
5935
5990
|
);
|
|
5936
|
-
const getAccessByCode =
|
|
5991
|
+
const getAccessByCode = useCallback64(
|
|
5937
5992
|
async (code) => {
|
|
5938
5993
|
const data = new URLSearchParams();
|
|
5939
5994
|
data.append("code", code);
|
|
@@ -5953,7 +6008,7 @@ function useAuthService() {
|
|
|
5953
6008
|
},
|
|
5954
6009
|
[env]
|
|
5955
6010
|
);
|
|
5956
|
-
const logout =
|
|
6011
|
+
const logout = useCallback64(
|
|
5957
6012
|
async (service) => {
|
|
5958
6013
|
return env?.requests?.post(
|
|
5959
6014
|
"/logout" /* LOGOUT */,
|
|
@@ -5970,7 +6025,7 @@ function useAuthService() {
|
|
|
5970
6025
|
},
|
|
5971
6026
|
[env]
|
|
5972
6027
|
);
|
|
5973
|
-
const getTenantMapping =
|
|
6028
|
+
const getTenantMapping = useCallback64(
|
|
5974
6029
|
async ({ shortName, service }) => {
|
|
5975
6030
|
const bodyData = {
|
|
5976
6031
|
short_name: shortName
|
|
@@ -5988,7 +6043,7 @@ function useAuthService() {
|
|
|
5988
6043
|
},
|
|
5989
6044
|
[env]
|
|
5990
6045
|
);
|
|
5991
|
-
const getToken =
|
|
6046
|
+
const getToken = useCallback64(
|
|
5992
6047
|
async ({
|
|
5993
6048
|
phone,
|
|
5994
6049
|
name,
|
|
@@ -6033,10 +6088,10 @@ function useAuthService() {
|
|
|
6033
6088
|
}
|
|
6034
6089
|
|
|
6035
6090
|
// src/services/company-service/index.ts
|
|
6036
|
-
import { useCallback as
|
|
6091
|
+
import { useCallback as useCallback65 } from "react";
|
|
6037
6092
|
function useCompanyService() {
|
|
6038
6093
|
const { env } = useEnv();
|
|
6039
|
-
const getCurrentCompany =
|
|
6094
|
+
const getCurrentCompany = useCallback65(
|
|
6040
6095
|
async (service, extraHeaders) => {
|
|
6041
6096
|
return await env.requests.get(
|
|
6042
6097
|
"/company" /* COMPANY_PATH */,
|
|
@@ -6053,7 +6108,7 @@ function useCompanyService() {
|
|
|
6053
6108
|
},
|
|
6054
6109
|
[env]
|
|
6055
6110
|
);
|
|
6056
|
-
const getInfoCompany =
|
|
6111
|
+
const getInfoCompany = useCallback65(
|
|
6057
6112
|
async (id, service) => {
|
|
6058
6113
|
const jsonData = {
|
|
6059
6114
|
ids: [id],
|
|
@@ -6089,10 +6144,10 @@ function useCompanyService() {
|
|
|
6089
6144
|
}
|
|
6090
6145
|
|
|
6091
6146
|
// src/services/excel-service/index.ts
|
|
6092
|
-
import { useCallback as
|
|
6147
|
+
import { useCallback as useCallback66 } from "react";
|
|
6093
6148
|
function useExcelService() {
|
|
6094
6149
|
const { env } = useEnv();
|
|
6095
|
-
const uploadFileExcel =
|
|
6150
|
+
const uploadFileExcel = useCallback66(
|
|
6096
6151
|
async ({
|
|
6097
6152
|
formData,
|
|
6098
6153
|
service,
|
|
@@ -6109,7 +6164,7 @@ function useExcelService() {
|
|
|
6109
6164
|
},
|
|
6110
6165
|
[env]
|
|
6111
6166
|
);
|
|
6112
|
-
const uploadIdFile =
|
|
6167
|
+
const uploadIdFile = useCallback66(
|
|
6113
6168
|
async ({
|
|
6114
6169
|
formData,
|
|
6115
6170
|
service,
|
|
@@ -6126,7 +6181,7 @@ function useExcelService() {
|
|
|
6126
6181
|
},
|
|
6127
6182
|
[env]
|
|
6128
6183
|
);
|
|
6129
|
-
const parsePreview =
|
|
6184
|
+
const parsePreview = useCallback66(
|
|
6130
6185
|
async ({
|
|
6131
6186
|
id,
|
|
6132
6187
|
selectedSheet,
|
|
@@ -6175,7 +6230,7 @@ function useExcelService() {
|
|
|
6175
6230
|
},
|
|
6176
6231
|
[env]
|
|
6177
6232
|
);
|
|
6178
|
-
const executeImport =
|
|
6233
|
+
const executeImport = useCallback66(
|
|
6179
6234
|
async ({
|
|
6180
6235
|
columns,
|
|
6181
6236
|
fields,
|
|
@@ -6209,7 +6264,7 @@ function useExcelService() {
|
|
|
6209
6264
|
},
|
|
6210
6265
|
[env]
|
|
6211
6266
|
);
|
|
6212
|
-
const getFileExcel =
|
|
6267
|
+
const getFileExcel = useCallback66(
|
|
6213
6268
|
async ({
|
|
6214
6269
|
model,
|
|
6215
6270
|
service,
|
|
@@ -6233,7 +6288,7 @@ function useExcelService() {
|
|
|
6233
6288
|
},
|
|
6234
6289
|
[env]
|
|
6235
6290
|
);
|
|
6236
|
-
const getFieldExport =
|
|
6291
|
+
const getFieldExport = useCallback66(
|
|
6237
6292
|
async ({
|
|
6238
6293
|
ids,
|
|
6239
6294
|
model,
|
|
@@ -6273,7 +6328,7 @@ function useExcelService() {
|
|
|
6273
6328
|
},
|
|
6274
6329
|
[env]
|
|
6275
6330
|
);
|
|
6276
|
-
const exportExcel =
|
|
6331
|
+
const exportExcel = useCallback66(
|
|
6277
6332
|
async ({
|
|
6278
6333
|
model,
|
|
6279
6334
|
domain,
|
|
@@ -6321,10 +6376,10 @@ function useExcelService() {
|
|
|
6321
6376
|
}
|
|
6322
6377
|
|
|
6323
6378
|
// src/services/form-service/index.ts
|
|
6324
|
-
import { useCallback as
|
|
6379
|
+
import { useCallback as useCallback67 } from "react";
|
|
6325
6380
|
function useFormService() {
|
|
6326
6381
|
const { env } = useEnv();
|
|
6327
|
-
const getComment =
|
|
6382
|
+
const getComment = useCallback67(
|
|
6328
6383
|
async ({ data }) => {
|
|
6329
6384
|
const jsonData = {
|
|
6330
6385
|
thread_id: data.thread_id,
|
|
@@ -6342,7 +6397,7 @@ function useFormService() {
|
|
|
6342
6397
|
},
|
|
6343
6398
|
[env]
|
|
6344
6399
|
);
|
|
6345
|
-
const getThreadData =
|
|
6400
|
+
const getThreadData = useCallback67(
|
|
6346
6401
|
async ({
|
|
6347
6402
|
data,
|
|
6348
6403
|
xNode,
|
|
@@ -6369,7 +6424,7 @@ function useFormService() {
|
|
|
6369
6424
|
},
|
|
6370
6425
|
[env]
|
|
6371
6426
|
);
|
|
6372
|
-
const getThreadMessages =
|
|
6427
|
+
const getThreadMessages = useCallback67(
|
|
6373
6428
|
async ({
|
|
6374
6429
|
data,
|
|
6375
6430
|
xNode,
|
|
@@ -6395,7 +6450,7 @@ function useFormService() {
|
|
|
6395
6450
|
},
|
|
6396
6451
|
[env]
|
|
6397
6452
|
);
|
|
6398
|
-
const sentComment =
|
|
6453
|
+
const sentComment = useCallback67(
|
|
6399
6454
|
async ({ data }) => {
|
|
6400
6455
|
const jsonData = {
|
|
6401
6456
|
context: {
|
|
@@ -6423,7 +6478,7 @@ function useFormService() {
|
|
|
6423
6478
|
},
|
|
6424
6479
|
[env]
|
|
6425
6480
|
);
|
|
6426
|
-
const deleteComment =
|
|
6481
|
+
const deleteComment = useCallback67(
|
|
6427
6482
|
async ({ data }) => {
|
|
6428
6483
|
const jsonData = {
|
|
6429
6484
|
attachment_ids: [],
|
|
@@ -6439,7 +6494,7 @@ function useFormService() {
|
|
|
6439
6494
|
},
|
|
6440
6495
|
[env]
|
|
6441
6496
|
);
|
|
6442
|
-
const getImage =
|
|
6497
|
+
const getImage = useCallback67(
|
|
6443
6498
|
async ({ data }) => {
|
|
6444
6499
|
return env.requests.get(
|
|
6445
6500
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -6452,7 +6507,7 @@ function useFormService() {
|
|
|
6452
6507
|
},
|
|
6453
6508
|
[env]
|
|
6454
6509
|
);
|
|
6455
|
-
const uploadImage =
|
|
6510
|
+
const uploadImage = useCallback67(
|
|
6456
6511
|
async ({
|
|
6457
6512
|
formData,
|
|
6458
6513
|
service,
|
|
@@ -6471,7 +6526,7 @@ function useFormService() {
|
|
|
6471
6526
|
},
|
|
6472
6527
|
[env]
|
|
6473
6528
|
);
|
|
6474
|
-
const uploadFile =
|
|
6529
|
+
const uploadFile = useCallback67(
|
|
6475
6530
|
async ({
|
|
6476
6531
|
formData,
|
|
6477
6532
|
service,
|
|
@@ -6491,7 +6546,7 @@ function useFormService() {
|
|
|
6491
6546
|
},
|
|
6492
6547
|
[env]
|
|
6493
6548
|
);
|
|
6494
|
-
const getFormView =
|
|
6549
|
+
const getFormView = useCallback67(
|
|
6495
6550
|
async ({ data }) => {
|
|
6496
6551
|
const jsonData = {
|
|
6497
6552
|
model: data.model,
|
|
@@ -6507,7 +6562,7 @@ function useFormService() {
|
|
|
6507
6562
|
},
|
|
6508
6563
|
[env]
|
|
6509
6564
|
);
|
|
6510
|
-
const changeStatus =
|
|
6565
|
+
const changeStatus = useCallback67(
|
|
6511
6566
|
async ({ data }) => {
|
|
6512
6567
|
const vals = {
|
|
6513
6568
|
[data.name]: data.stage_id
|
|
@@ -6536,7 +6591,7 @@ function useFormService() {
|
|
|
6536
6591
|
},
|
|
6537
6592
|
[env]
|
|
6538
6593
|
);
|
|
6539
|
-
const getExternalTab =
|
|
6594
|
+
const getExternalTab = useCallback67(
|
|
6540
6595
|
async ({ method, context, service, xNode }) => {
|
|
6541
6596
|
return env?.requests?.post(
|
|
6542
6597
|
"/call" /* CALL_PATH */,
|
|
@@ -6571,10 +6626,10 @@ function useFormService() {
|
|
|
6571
6626
|
}
|
|
6572
6627
|
|
|
6573
6628
|
// src/services/kanban-service/index.ts
|
|
6574
|
-
import { useCallback as
|
|
6629
|
+
import { useCallback as useCallback68 } from "react";
|
|
6575
6630
|
function useKanbanService() {
|
|
6576
6631
|
const { env } = useEnv();
|
|
6577
|
-
const getGroups =
|
|
6632
|
+
const getGroups = useCallback68(
|
|
6578
6633
|
async ({ model, width_context }) => {
|
|
6579
6634
|
const jsonData = {
|
|
6580
6635
|
model,
|
|
@@ -6594,7 +6649,7 @@ function useKanbanService() {
|
|
|
6594
6649
|
},
|
|
6595
6650
|
[env]
|
|
6596
6651
|
);
|
|
6597
|
-
const getProgressBar =
|
|
6652
|
+
const getProgressBar = useCallback68(
|
|
6598
6653
|
async ({ field, color, model, width_context }) => {
|
|
6599
6654
|
const jsonData = {
|
|
6600
6655
|
model,
|
|
@@ -6624,10 +6679,10 @@ function useKanbanService() {
|
|
|
6624
6679
|
}
|
|
6625
6680
|
|
|
6626
6681
|
// src/services/model-service/index.ts
|
|
6627
|
-
import { useCallback as
|
|
6682
|
+
import { useCallback as useCallback69 } from "react";
|
|
6628
6683
|
function useModelService() {
|
|
6629
6684
|
const { env } = useEnv();
|
|
6630
|
-
const getListMyBankAccount =
|
|
6685
|
+
const getListMyBankAccount = useCallback69(
|
|
6631
6686
|
async ({
|
|
6632
6687
|
domain,
|
|
6633
6688
|
spectification,
|
|
@@ -6651,7 +6706,7 @@ function useModelService() {
|
|
|
6651
6706
|
},
|
|
6652
6707
|
[env]
|
|
6653
6708
|
);
|
|
6654
|
-
const getCurrency =
|
|
6709
|
+
const getCurrency = useCallback69(async () => {
|
|
6655
6710
|
const jsonData = {
|
|
6656
6711
|
model: "res.currency",
|
|
6657
6712
|
method: "web_search_read",
|
|
@@ -6671,7 +6726,7 @@ function useModelService() {
|
|
|
6671
6726
|
}
|
|
6672
6727
|
});
|
|
6673
6728
|
}, [env]);
|
|
6674
|
-
const getConversionRate =
|
|
6729
|
+
const getConversionRate = useCallback69(async () => {
|
|
6675
6730
|
const jsonData = {
|
|
6676
6731
|
model: "res.currency",
|
|
6677
6732
|
method: "web_search_read",
|
|
@@ -6697,7 +6752,7 @@ function useModelService() {
|
|
|
6697
6752
|
}
|
|
6698
6753
|
});
|
|
6699
6754
|
}, [env]);
|
|
6700
|
-
const getAll =
|
|
6755
|
+
const getAll = useCallback69(
|
|
6701
6756
|
async ({
|
|
6702
6757
|
data,
|
|
6703
6758
|
service,
|
|
@@ -6739,7 +6794,7 @@ function useModelService() {
|
|
|
6739
6794
|
},
|
|
6740
6795
|
[env]
|
|
6741
6796
|
);
|
|
6742
|
-
const getListCalendar =
|
|
6797
|
+
const getListCalendar = useCallback69(
|
|
6743
6798
|
async ({ data }) => {
|
|
6744
6799
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6745
6800
|
fields: data.fields,
|
|
@@ -6770,7 +6825,7 @@ function useModelService() {
|
|
|
6770
6825
|
},
|
|
6771
6826
|
[env]
|
|
6772
6827
|
);
|
|
6773
|
-
const getList =
|
|
6828
|
+
const getList = useCallback69(
|
|
6774
6829
|
async ({
|
|
6775
6830
|
model,
|
|
6776
6831
|
ids = [],
|
|
@@ -6802,7 +6857,7 @@ function useModelService() {
|
|
|
6802
6857
|
},
|
|
6803
6858
|
[env]
|
|
6804
6859
|
);
|
|
6805
|
-
const getDetail =
|
|
6860
|
+
const getDetail = useCallback69(
|
|
6806
6861
|
async ({
|
|
6807
6862
|
ids = [],
|
|
6808
6863
|
model,
|
|
@@ -6834,7 +6889,7 @@ function useModelService() {
|
|
|
6834
6889
|
},
|
|
6835
6890
|
[env]
|
|
6836
6891
|
);
|
|
6837
|
-
const save =
|
|
6892
|
+
const save = useCallback69(
|
|
6838
6893
|
async ({
|
|
6839
6894
|
model,
|
|
6840
6895
|
ids = [],
|
|
@@ -6869,7 +6924,7 @@ function useModelService() {
|
|
|
6869
6924
|
},
|
|
6870
6925
|
[env]
|
|
6871
6926
|
);
|
|
6872
|
-
const deleteApi =
|
|
6927
|
+
const deleteApi = useCallback69(
|
|
6873
6928
|
async ({ ids = [], model, service }) => {
|
|
6874
6929
|
const jsonData = {
|
|
6875
6930
|
model,
|
|
@@ -6889,7 +6944,7 @@ function useModelService() {
|
|
|
6889
6944
|
},
|
|
6890
6945
|
[env]
|
|
6891
6946
|
);
|
|
6892
|
-
const onChange =
|
|
6947
|
+
const onChange = useCallback69(
|
|
6893
6948
|
async ({
|
|
6894
6949
|
ids = [],
|
|
6895
6950
|
model,
|
|
@@ -6925,7 +6980,7 @@ function useModelService() {
|
|
|
6925
6980
|
},
|
|
6926
6981
|
[env]
|
|
6927
6982
|
);
|
|
6928
|
-
const getListFieldsOnchange =
|
|
6983
|
+
const getListFieldsOnchange = useCallback69(
|
|
6929
6984
|
async ({
|
|
6930
6985
|
model,
|
|
6931
6986
|
service,
|
|
@@ -6949,7 +7004,7 @@ function useModelService() {
|
|
|
6949
7004
|
},
|
|
6950
7005
|
[env]
|
|
6951
7006
|
);
|
|
6952
|
-
const parseORMOdoo =
|
|
7007
|
+
const parseORMOdoo = useCallback69((data) => {
|
|
6953
7008
|
for (const key in data) {
|
|
6954
7009
|
if (key === "display_name") {
|
|
6955
7010
|
delete data[key];
|
|
@@ -6960,7 +7015,7 @@ function useModelService() {
|
|
|
6960
7015
|
}
|
|
6961
7016
|
return { ...data };
|
|
6962
7017
|
}, []);
|
|
6963
|
-
const toDataJS =
|
|
7018
|
+
const toDataJS = useCallback69(
|
|
6964
7019
|
(data, viewData, model) => {
|
|
6965
7020
|
for (const key in data) {
|
|
6966
7021
|
if (data[key] === false) {
|
|
@@ -7018,10 +7073,10 @@ function useModelService() {
|
|
|
7018
7073
|
}
|
|
7019
7074
|
|
|
7020
7075
|
// src/services/user-service/index.ts
|
|
7021
|
-
import { useCallback as
|
|
7076
|
+
import { useCallback as useCallback70 } from "react";
|
|
7022
7077
|
function useUserService() {
|
|
7023
7078
|
const { env } = useEnv();
|
|
7024
|
-
const getProfile =
|
|
7079
|
+
const getProfile = useCallback70(
|
|
7025
7080
|
async (service, path, extraHeaders) => {
|
|
7026
7081
|
return env?.requests?.get(
|
|
7027
7082
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -7038,7 +7093,7 @@ function useUserService() {
|
|
|
7038
7093
|
},
|
|
7039
7094
|
[env]
|
|
7040
7095
|
);
|
|
7041
|
-
const getUser =
|
|
7096
|
+
const getUser = useCallback70(
|
|
7042
7097
|
async ({ context, id }) => {
|
|
7043
7098
|
const jsonData = {
|
|
7044
7099
|
model: "res.users",
|
|
@@ -7076,7 +7131,7 @@ function useUserService() {
|
|
|
7076
7131
|
},
|
|
7077
7132
|
[env]
|
|
7078
7133
|
);
|
|
7079
|
-
const switchUserLocale =
|
|
7134
|
+
const switchUserLocale = useCallback70(
|
|
7080
7135
|
async ({ id, values, service }) => {
|
|
7081
7136
|
const jsonData = {
|
|
7082
7137
|
model: "res.users",
|
|
@@ -7104,10 +7159,10 @@ function useUserService() {
|
|
|
7104
7159
|
}
|
|
7105
7160
|
|
|
7106
7161
|
// src/services/view-service/index.ts
|
|
7107
|
-
import { useCallback as
|
|
7162
|
+
import { useCallback as useCallback71 } from "react";
|
|
7108
7163
|
function useViewService() {
|
|
7109
7164
|
const { env } = useEnv();
|
|
7110
|
-
const getView =
|
|
7165
|
+
const getView = useCallback71(
|
|
7111
7166
|
async ({
|
|
7112
7167
|
model,
|
|
7113
7168
|
views,
|
|
@@ -7147,7 +7202,7 @@ function useViewService() {
|
|
|
7147
7202
|
},
|
|
7148
7203
|
[env]
|
|
7149
7204
|
);
|
|
7150
|
-
const getMenu =
|
|
7205
|
+
const getMenu = useCallback71(
|
|
7151
7206
|
async (context, specification, domain, service) => {
|
|
7152
7207
|
const jsonData = {
|
|
7153
7208
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -7178,7 +7233,7 @@ function useViewService() {
|
|
|
7178
7233
|
},
|
|
7179
7234
|
[env]
|
|
7180
7235
|
);
|
|
7181
|
-
const getActionDetail =
|
|
7236
|
+
const getActionDetail = useCallback71(
|
|
7182
7237
|
async (aid, context) => {
|
|
7183
7238
|
const jsonData = {
|
|
7184
7239
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -7208,7 +7263,7 @@ function useViewService() {
|
|
|
7208
7263
|
},
|
|
7209
7264
|
[env]
|
|
7210
7265
|
);
|
|
7211
|
-
const getResequence =
|
|
7266
|
+
const getResequence = useCallback71(
|
|
7212
7267
|
async ({
|
|
7213
7268
|
model,
|
|
7214
7269
|
ids,
|
|
@@ -7238,7 +7293,7 @@ function useViewService() {
|
|
|
7238
7293
|
},
|
|
7239
7294
|
[env]
|
|
7240
7295
|
);
|
|
7241
|
-
const getSelectionItem =
|
|
7296
|
+
const getSelectionItem = useCallback71(
|
|
7242
7297
|
async ({
|
|
7243
7298
|
data,
|
|
7244
7299
|
service,
|
|
@@ -7275,7 +7330,7 @@ function useViewService() {
|
|
|
7275
7330
|
},
|
|
7276
7331
|
[env]
|
|
7277
7332
|
);
|
|
7278
|
-
const loadMessages =
|
|
7333
|
+
const loadMessages = useCallback71(async () => {
|
|
7279
7334
|
return env.requests.post(
|
|
7280
7335
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
7281
7336
|
{},
|
|
@@ -7286,14 +7341,14 @@ function useViewService() {
|
|
|
7286
7341
|
}
|
|
7287
7342
|
);
|
|
7288
7343
|
}, [env]);
|
|
7289
|
-
const getVersion =
|
|
7344
|
+
const getVersion = useCallback71(async () => {
|
|
7290
7345
|
return env?.requests?.get("", {
|
|
7291
7346
|
headers: {
|
|
7292
7347
|
"Content-Type": "application/json"
|
|
7293
7348
|
}
|
|
7294
7349
|
});
|
|
7295
7350
|
}, [env]);
|
|
7296
|
-
const grantAccess =
|
|
7351
|
+
const grantAccess = useCallback71(
|
|
7297
7352
|
async ({
|
|
7298
7353
|
redirect_uri,
|
|
7299
7354
|
state,
|
|
@@ -7320,7 +7375,7 @@ function useViewService() {
|
|
|
7320
7375
|
},
|
|
7321
7376
|
[env]
|
|
7322
7377
|
);
|
|
7323
|
-
const removeTotpSetUp =
|
|
7378
|
+
const removeTotpSetUp = useCallback71(
|
|
7324
7379
|
async ({ method, token }) => {
|
|
7325
7380
|
const jsonData = {
|
|
7326
7381
|
method,
|
|
@@ -7341,7 +7396,7 @@ function useViewService() {
|
|
|
7341
7396
|
},
|
|
7342
7397
|
[env]
|
|
7343
7398
|
);
|
|
7344
|
-
const requestSetupTotp =
|
|
7399
|
+
const requestSetupTotp = useCallback71(
|
|
7345
7400
|
async ({ method, token }) => {
|
|
7346
7401
|
const jsonData = {
|
|
7347
7402
|
method,
|
|
@@ -7360,7 +7415,7 @@ function useViewService() {
|
|
|
7360
7415
|
},
|
|
7361
7416
|
[env]
|
|
7362
7417
|
);
|
|
7363
|
-
const settingsWebRead2fa =
|
|
7418
|
+
const settingsWebRead2fa = useCallback71(
|
|
7364
7419
|
async ({
|
|
7365
7420
|
method,
|
|
7366
7421
|
model,
|
|
@@ -7388,7 +7443,7 @@ function useViewService() {
|
|
|
7388
7443
|
},
|
|
7389
7444
|
[env]
|
|
7390
7445
|
);
|
|
7391
|
-
const signInSSO =
|
|
7446
|
+
const signInSSO = useCallback71(
|
|
7392
7447
|
async ({
|
|
7393
7448
|
redirect_uri,
|
|
7394
7449
|
state,
|
|
@@ -7420,7 +7475,7 @@ function useViewService() {
|
|
|
7420
7475
|
},
|
|
7421
7476
|
[env]
|
|
7422
7477
|
);
|
|
7423
|
-
const verify2FA =
|
|
7478
|
+
const verify2FA = useCallback71(
|
|
7424
7479
|
({
|
|
7425
7480
|
method,
|
|
7426
7481
|
with_context,
|
|
@@ -7453,7 +7508,7 @@ function useViewService() {
|
|
|
7453
7508
|
},
|
|
7454
7509
|
[env]
|
|
7455
7510
|
);
|
|
7456
|
-
const get2FAMethods =
|
|
7511
|
+
const get2FAMethods = useCallback71(
|
|
7457
7512
|
({ method, with_context }) => {
|
|
7458
7513
|
const jsonData = {
|
|
7459
7514
|
method,
|
|
@@ -7472,7 +7527,7 @@ function useViewService() {
|
|
|
7472
7527
|
},
|
|
7473
7528
|
[env]
|
|
7474
7529
|
);
|
|
7475
|
-
const verifyTotp =
|
|
7530
|
+
const verifyTotp = useCallback71(
|
|
7476
7531
|
({
|
|
7477
7532
|
method,
|
|
7478
7533
|
action_token,
|
|
@@ -7497,7 +7552,7 @@ function useViewService() {
|
|
|
7497
7552
|
},
|
|
7498
7553
|
[env]
|
|
7499
7554
|
);
|
|
7500
|
-
const getNotifications =
|
|
7555
|
+
const getNotifications = useCallback71(
|
|
7501
7556
|
async ({
|
|
7502
7557
|
service,
|
|
7503
7558
|
xNode,
|
|
@@ -7517,7 +7572,7 @@ function useViewService() {
|
|
|
7517
7572
|
},
|
|
7518
7573
|
[env]
|
|
7519
7574
|
);
|
|
7520
|
-
const getCountry =
|
|
7575
|
+
const getCountry = useCallback71(
|
|
7521
7576
|
async ({
|
|
7522
7577
|
service,
|
|
7523
7578
|
xNode,
|
|
@@ -7544,7 +7599,7 @@ function useViewService() {
|
|
|
7544
7599
|
},
|
|
7545
7600
|
[env]
|
|
7546
7601
|
);
|
|
7547
|
-
const getCity =
|
|
7602
|
+
const getCity = useCallback71(
|
|
7548
7603
|
async ({
|
|
7549
7604
|
service,
|
|
7550
7605
|
xNode,
|
|
@@ -7571,7 +7626,7 @@ function useViewService() {
|
|
|
7571
7626
|
},
|
|
7572
7627
|
[env]
|
|
7573
7628
|
);
|
|
7574
|
-
const getWard =
|
|
7629
|
+
const getWard = useCallback71(
|
|
7575
7630
|
async ({
|
|
7576
7631
|
service,
|
|
7577
7632
|
xNode,
|
|
@@ -7596,7 +7651,7 @@ function useViewService() {
|
|
|
7596
7651
|
},
|
|
7597
7652
|
[env]
|
|
7598
7653
|
);
|
|
7599
|
-
const getPartnerTitle =
|
|
7654
|
+
const getPartnerTitle = useCallback71(
|
|
7600
7655
|
async ({
|
|
7601
7656
|
service,
|
|
7602
7657
|
xNode,
|
|
@@ -7648,10 +7703,10 @@ function useViewService() {
|
|
|
7648
7703
|
}
|
|
7649
7704
|
|
|
7650
7705
|
// src/services/dashboard-service/index.ts
|
|
7651
|
-
import { useCallback as
|
|
7706
|
+
import { useCallback as useCallback72 } from "react";
|
|
7652
7707
|
function useDashboardService() {
|
|
7653
7708
|
const { env } = useEnv();
|
|
7654
|
-
const readGroup =
|
|
7709
|
+
const readGroup = useCallback72(
|
|
7655
7710
|
async ({
|
|
7656
7711
|
service,
|
|
7657
7712
|
xNode,
|
|
@@ -7668,7 +7723,7 @@ function useDashboardService() {
|
|
|
7668
7723
|
},
|
|
7669
7724
|
[env]
|
|
7670
7725
|
);
|
|
7671
|
-
const getDataChart =
|
|
7726
|
+
const getDataChart = useCallback72(
|
|
7672
7727
|
async ({
|
|
7673
7728
|
service,
|
|
7674
7729
|
xNode,
|