@fctc/interface-logic 5.0.4 → 5.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks.d.mts +35 -1
- package/dist/hooks.d.ts +35 -1
- package/dist/hooks.js +174 -3
- package/dist/hooks.mjs +170 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +178 -3
- package/dist/index.mjs +174 -3
- package/dist/provider.d.mts +5 -1
- package/dist/provider.d.ts +5 -1
- package/dist/provider.js +191 -24
- package/dist/provider.mjs +180 -13
- package/dist/services.d.mts +34 -0
- package/dist/services.d.ts +34 -0
- package/dist/services.js +233 -98
- package/dist/services.mjs +230 -95
- 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 useCallback67 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/constants/api/uri-constant.ts
|
|
5
5
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -5316,6 +5316,125 @@ var getSupaCurrentUser = (env) => {
|
|
|
5316
5316
|
};
|
|
5317
5317
|
};
|
|
5318
5318
|
|
|
5319
|
+
// src/services/pos-service/supabase/update-category.ts
|
|
5320
|
+
import { useCallback as useCallback63 } from "react";
|
|
5321
|
+
var updateCategorySupabaseService = () => {
|
|
5322
|
+
const supabase = useSupabaseOptional();
|
|
5323
|
+
const updateCategorySupabase = useCallback63(
|
|
5324
|
+
async (values) => {
|
|
5325
|
+
if (!supabase) {
|
|
5326
|
+
console.error("Supabase client not initialized");
|
|
5327
|
+
return null;
|
|
5328
|
+
}
|
|
5329
|
+
try {
|
|
5330
|
+
const { category_id, ...rest } = values;
|
|
5331
|
+
const { data, error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).update(rest).eq("id", category_id).select("id").single();
|
|
5332
|
+
if (error) {
|
|
5333
|
+
console.error("Error updating category:", error);
|
|
5334
|
+
return null;
|
|
5335
|
+
}
|
|
5336
|
+
return [data.id];
|
|
5337
|
+
} catch (error) {
|
|
5338
|
+
console.error("Error updating category:", error);
|
|
5339
|
+
return null;
|
|
5340
|
+
}
|
|
5341
|
+
},
|
|
5342
|
+
[supabase]
|
|
5343
|
+
);
|
|
5344
|
+
return {
|
|
5345
|
+
updateCategorySupabase
|
|
5346
|
+
};
|
|
5347
|
+
};
|
|
5348
|
+
|
|
5349
|
+
// src/services/pos-service/supabase/delete-category.ts
|
|
5350
|
+
import { useCallback as useCallback64 } from "react";
|
|
5351
|
+
var deleteCategorySupabaseService = () => {
|
|
5352
|
+
const supabase = useSupabaseOptional();
|
|
5353
|
+
const deleteCategorySupabase = useCallback64(
|
|
5354
|
+
async (values) => {
|
|
5355
|
+
if (!supabase) {
|
|
5356
|
+
console.error("Supabase client not initialized");
|
|
5357
|
+
return null;
|
|
5358
|
+
}
|
|
5359
|
+
try {
|
|
5360
|
+
const { error } = await supabase.from("pos_categories" /* POS_CATEGORIES */).delete().eq("id", values.category_id);
|
|
5361
|
+
if (error) {
|
|
5362
|
+
console.error("Error deleting category:", error);
|
|
5363
|
+
return null;
|
|
5364
|
+
}
|
|
5365
|
+
return [values.category_id];
|
|
5366
|
+
} catch (error) {
|
|
5367
|
+
console.error("Error deleting category:", error);
|
|
5368
|
+
return null;
|
|
5369
|
+
}
|
|
5370
|
+
},
|
|
5371
|
+
[supabase]
|
|
5372
|
+
);
|
|
5373
|
+
return {
|
|
5374
|
+
deleteCategorySupabase
|
|
5375
|
+
};
|
|
5376
|
+
};
|
|
5377
|
+
|
|
5378
|
+
// src/services/pos-service/supabase/update-product.ts
|
|
5379
|
+
import { useCallback as useCallback65 } from "react";
|
|
5380
|
+
var updateProductSupabaseService = () => {
|
|
5381
|
+
const supabase = useSupabaseOptional();
|
|
5382
|
+
const updateProductSupabase = useCallback65(
|
|
5383
|
+
async (values) => {
|
|
5384
|
+
if (!supabase) {
|
|
5385
|
+
console.error("Supabase client not initialized");
|
|
5386
|
+
return null;
|
|
5387
|
+
}
|
|
5388
|
+
try {
|
|
5389
|
+
const { product_id, ...rest } = values;
|
|
5390
|
+
const updateData = cleanObject(rest);
|
|
5391
|
+
const { data, error } = await supabase.from("products" /* PRODUCTS */).update(updateData).eq("id", product_id).select("id").single();
|
|
5392
|
+
if (error) {
|
|
5393
|
+
console.error("Error updating product:", error);
|
|
5394
|
+
return null;
|
|
5395
|
+
}
|
|
5396
|
+
return [data.id];
|
|
5397
|
+
} catch (error) {
|
|
5398
|
+
console.error("Error updating product:", error);
|
|
5399
|
+
return null;
|
|
5400
|
+
}
|
|
5401
|
+
},
|
|
5402
|
+
[supabase]
|
|
5403
|
+
);
|
|
5404
|
+
return {
|
|
5405
|
+
updateProductSupabase
|
|
5406
|
+
};
|
|
5407
|
+
};
|
|
5408
|
+
|
|
5409
|
+
// src/services/pos-service/supabase/delete-product.ts
|
|
5410
|
+
import { useCallback as useCallback66 } from "react";
|
|
5411
|
+
var deleteProductSupabaseService = () => {
|
|
5412
|
+
const supabase = useSupabaseOptional();
|
|
5413
|
+
const deleteProductSupabase = useCallback66(
|
|
5414
|
+
async (values) => {
|
|
5415
|
+
if (!supabase) {
|
|
5416
|
+
console.error("Supabase client not initialized");
|
|
5417
|
+
return null;
|
|
5418
|
+
}
|
|
5419
|
+
try {
|
|
5420
|
+
const { error } = await supabase.from("products" /* PRODUCTS */).delete().eq("id", values.product_id);
|
|
5421
|
+
if (error) {
|
|
5422
|
+
console.error("Error deleting product:", error);
|
|
5423
|
+
return null;
|
|
5424
|
+
}
|
|
5425
|
+
return [values.product_id];
|
|
5426
|
+
} catch (error) {
|
|
5427
|
+
console.error("Error deleting product:", error);
|
|
5428
|
+
return null;
|
|
5429
|
+
}
|
|
5430
|
+
},
|
|
5431
|
+
[supabase]
|
|
5432
|
+
);
|
|
5433
|
+
return {
|
|
5434
|
+
deleteProductSupabase
|
|
5435
|
+
};
|
|
5436
|
+
};
|
|
5437
|
+
|
|
5319
5438
|
// src/services/pos-service/index.ts
|
|
5320
5439
|
var serviceFactories = [
|
|
5321
5440
|
addEntityService,
|
|
@@ -5377,7 +5496,11 @@ var serviceFactories = [
|
|
|
5377
5496
|
getStatesSupabaseService,
|
|
5378
5497
|
getWardsSupabaseService,
|
|
5379
5498
|
getPartnerTitlesSupabaseService,
|
|
5380
|
-
getSupaCurrentUser
|
|
5499
|
+
getSupaCurrentUser,
|
|
5500
|
+
updateCategorySupabaseService,
|
|
5501
|
+
deleteCategorySupabaseService,
|
|
5502
|
+
updateProductSupabaseService,
|
|
5503
|
+
deleteProductSupabaseService
|
|
5381
5504
|
];
|
|
5382
5505
|
var usePosService = () => {
|
|
5383
5506
|
const { env } = useEnv();
|
|
@@ -5578,6 +5701,18 @@ import { useMutation as useMutation114 } from "@tanstack/react-query";
|
|
|
5578
5701
|
// src/hooks/pos/supabase/use-get-supa-current-user.ts
|
|
5579
5702
|
import { useMutation as useMutation115 } from "@tanstack/react-query";
|
|
5580
5703
|
|
|
5704
|
+
// src/hooks/pos/supabase/use-update-category.ts
|
|
5705
|
+
import { useMutation as useMutation116 } from "@tanstack/react-query";
|
|
5706
|
+
|
|
5707
|
+
// src/hooks/pos/supabase/use-delete-category.ts
|
|
5708
|
+
import { useMutation as useMutation117 } from "@tanstack/react-query";
|
|
5709
|
+
|
|
5710
|
+
// src/hooks/pos/supabase/use-update-product.ts
|
|
5711
|
+
import { useMutation as useMutation118 } from "@tanstack/react-query";
|
|
5712
|
+
|
|
5713
|
+
// src/hooks/pos/supabase/use-delete-product.ts
|
|
5714
|
+
import { useMutation as useMutation119 } from "@tanstack/react-query";
|
|
5715
|
+
|
|
5581
5716
|
// src/provider/service-provider.tsx
|
|
5582
5717
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5583
5718
|
var ServiceContext = createContext3(null);
|
|
@@ -5589,7 +5724,7 @@ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
|
5589
5724
|
// src/services/action-service/index.ts
|
|
5590
5725
|
function useActionService() {
|
|
5591
5726
|
const { env } = useEnv();
|
|
5592
|
-
const loadAction =
|
|
5727
|
+
const loadAction = useCallback67(
|
|
5593
5728
|
async ({
|
|
5594
5729
|
idAction,
|
|
5595
5730
|
context,
|
|
@@ -5613,7 +5748,7 @@ function useActionService() {
|
|
|
5613
5748
|
},
|
|
5614
5749
|
[env]
|
|
5615
5750
|
);
|
|
5616
|
-
const callButton =
|
|
5751
|
+
const callButton = useCallback67(
|
|
5617
5752
|
async ({
|
|
5618
5753
|
model,
|
|
5619
5754
|
ids = [],
|
|
@@ -5647,7 +5782,7 @@ function useActionService() {
|
|
|
5647
5782
|
},
|
|
5648
5783
|
[env]
|
|
5649
5784
|
);
|
|
5650
|
-
const removeRows =
|
|
5785
|
+
const removeRows = useCallback67(
|
|
5651
5786
|
async ({
|
|
5652
5787
|
model,
|
|
5653
5788
|
ids,
|
|
@@ -5673,7 +5808,7 @@ function useActionService() {
|
|
|
5673
5808
|
},
|
|
5674
5809
|
[env]
|
|
5675
5810
|
);
|
|
5676
|
-
const duplicateRecord =
|
|
5811
|
+
const duplicateRecord = useCallback67(
|
|
5677
5812
|
async ({
|
|
5678
5813
|
model,
|
|
5679
5814
|
id,
|
|
@@ -5699,7 +5834,7 @@ function useActionService() {
|
|
|
5699
5834
|
},
|
|
5700
5835
|
[env]
|
|
5701
5836
|
);
|
|
5702
|
-
const getPrintReportName =
|
|
5837
|
+
const getPrintReportName = useCallback67(
|
|
5703
5838
|
async ({ id }) => {
|
|
5704
5839
|
const jsonData = {
|
|
5705
5840
|
model: "ir.actions.report",
|
|
@@ -5717,7 +5852,7 @@ function useActionService() {
|
|
|
5717
5852
|
},
|
|
5718
5853
|
[env]
|
|
5719
5854
|
);
|
|
5720
|
-
const print =
|
|
5855
|
+
const print = useCallback67(
|
|
5721
5856
|
async ({ id, report, db }) => {
|
|
5722
5857
|
const jsonData = {
|
|
5723
5858
|
report,
|
|
@@ -5735,7 +5870,7 @@ function useActionService() {
|
|
|
5735
5870
|
},
|
|
5736
5871
|
[env]
|
|
5737
5872
|
);
|
|
5738
|
-
const runAction =
|
|
5873
|
+
const runAction = useCallback67(
|
|
5739
5874
|
async ({
|
|
5740
5875
|
idAction,
|
|
5741
5876
|
context,
|
|
@@ -5762,7 +5897,7 @@ function useActionService() {
|
|
|
5762
5897
|
},
|
|
5763
5898
|
[env]
|
|
5764
5899
|
);
|
|
5765
|
-
const generateSerialNumber =
|
|
5900
|
+
const generateSerialNumber = useCallback67(
|
|
5766
5901
|
async ({
|
|
5767
5902
|
kwargs,
|
|
5768
5903
|
context,
|
|
@@ -5787,7 +5922,7 @@ function useActionService() {
|
|
|
5787
5922
|
},
|
|
5788
5923
|
[env]
|
|
5789
5924
|
);
|
|
5790
|
-
const actionServerHome =
|
|
5925
|
+
const actionServerHome = useCallback67(async () => {
|
|
5791
5926
|
return env?.requests?.get("/action_server_home" /* ACTION_SERVER_HOME */);
|
|
5792
5927
|
}, [env]);
|
|
5793
5928
|
return {
|
|
@@ -5804,11 +5939,11 @@ function useActionService() {
|
|
|
5804
5939
|
}
|
|
5805
5940
|
|
|
5806
5941
|
// src/services/auth-service/index.ts
|
|
5807
|
-
import { useCallback as
|
|
5942
|
+
import { useCallback as useCallback68 } from "react";
|
|
5808
5943
|
function useAuthService() {
|
|
5809
5944
|
const { env } = useEnv();
|
|
5810
5945
|
const supabase = useSupabaseOptional();
|
|
5811
|
-
const login =
|
|
5946
|
+
const login = useCallback68(
|
|
5812
5947
|
async (body) => {
|
|
5813
5948
|
const payload = Object.fromEntries(
|
|
5814
5949
|
Object.entries({
|
|
@@ -5833,7 +5968,7 @@ function useAuthService() {
|
|
|
5833
5968
|
},
|
|
5834
5969
|
[env]
|
|
5835
5970
|
);
|
|
5836
|
-
const loginTenantUser =
|
|
5971
|
+
const loginTenantUser = useCallback68(
|
|
5837
5972
|
async (body) => {
|
|
5838
5973
|
const payload = {
|
|
5839
5974
|
email: body.email,
|
|
@@ -5848,7 +5983,7 @@ function useAuthService() {
|
|
|
5848
5983
|
},
|
|
5849
5984
|
[env]
|
|
5850
5985
|
);
|
|
5851
|
-
const forgotPassword =
|
|
5986
|
+
const forgotPassword = useCallback68(
|
|
5852
5987
|
async (email) => {
|
|
5853
5988
|
const bodyData = {
|
|
5854
5989
|
login: email,
|
|
@@ -5862,7 +5997,7 @@ function useAuthService() {
|
|
|
5862
5997
|
},
|
|
5863
5998
|
[env]
|
|
5864
5999
|
);
|
|
5865
|
-
const forgotPasswordSSO =
|
|
6000
|
+
const forgotPasswordSSO = useCallback68(
|
|
5866
6001
|
async ({
|
|
5867
6002
|
email,
|
|
5868
6003
|
with_context,
|
|
@@ -5885,7 +6020,7 @@ function useAuthService() {
|
|
|
5885
6020
|
},
|
|
5886
6021
|
[env]
|
|
5887
6022
|
);
|
|
5888
|
-
const resetPassword =
|
|
6023
|
+
const resetPassword = useCallback68(
|
|
5889
6024
|
async (data, token) => {
|
|
5890
6025
|
const bodyData = {
|
|
5891
6026
|
token,
|
|
@@ -5900,7 +6035,7 @@ function useAuthService() {
|
|
|
5900
6035
|
},
|
|
5901
6036
|
[env]
|
|
5902
6037
|
);
|
|
5903
|
-
const resetPasswordSSO =
|
|
6038
|
+
const resetPasswordSSO = useCallback68(
|
|
5904
6039
|
async ({
|
|
5905
6040
|
method,
|
|
5906
6041
|
password,
|
|
@@ -5923,7 +6058,7 @@ function useAuthService() {
|
|
|
5923
6058
|
},
|
|
5924
6059
|
[env]
|
|
5925
6060
|
);
|
|
5926
|
-
const updatePassword =
|
|
6061
|
+
const updatePassword = useCallback68(
|
|
5927
6062
|
async (data, token) => {
|
|
5928
6063
|
const bodyData = {
|
|
5929
6064
|
token,
|
|
@@ -5938,7 +6073,7 @@ function useAuthService() {
|
|
|
5938
6073
|
},
|
|
5939
6074
|
[env]
|
|
5940
6075
|
);
|
|
5941
|
-
const isValidToken =
|
|
6076
|
+
const isValidToken = useCallback68(
|
|
5942
6077
|
async (token) => {
|
|
5943
6078
|
const bodyData = {
|
|
5944
6079
|
token
|
|
@@ -5951,7 +6086,7 @@ function useAuthService() {
|
|
|
5951
6086
|
},
|
|
5952
6087
|
[env]
|
|
5953
6088
|
);
|
|
5954
|
-
const isValidActionToken =
|
|
6089
|
+
const isValidActionToken = useCallback68(
|
|
5955
6090
|
async (actionToken) => {
|
|
5956
6091
|
const bodyData = {};
|
|
5957
6092
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5964,7 +6099,7 @@ function useAuthService() {
|
|
|
5964
6099
|
},
|
|
5965
6100
|
[env]
|
|
5966
6101
|
);
|
|
5967
|
-
const loginSocial =
|
|
6102
|
+
const loginSocial = useCallback68(
|
|
5968
6103
|
async ({
|
|
5969
6104
|
db,
|
|
5970
6105
|
state,
|
|
@@ -5982,13 +6117,13 @@ function useAuthService() {
|
|
|
5982
6117
|
},
|
|
5983
6118
|
[env]
|
|
5984
6119
|
);
|
|
5985
|
-
const getProviders =
|
|
6120
|
+
const getProviders = useCallback68(
|
|
5986
6121
|
async (db) => {
|
|
5987
6122
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5988
6123
|
},
|
|
5989
6124
|
[env]
|
|
5990
6125
|
);
|
|
5991
|
-
const getAccessByCode =
|
|
6126
|
+
const getAccessByCode = useCallback68(
|
|
5992
6127
|
async (code) => {
|
|
5993
6128
|
const data = new URLSearchParams();
|
|
5994
6129
|
data.append("code", code);
|
|
@@ -6008,7 +6143,7 @@ function useAuthService() {
|
|
|
6008
6143
|
},
|
|
6009
6144
|
[env]
|
|
6010
6145
|
);
|
|
6011
|
-
const logout =
|
|
6146
|
+
const logout = useCallback68(
|
|
6012
6147
|
async (service) => {
|
|
6013
6148
|
return env?.requests?.post(
|
|
6014
6149
|
"/logout" /* LOGOUT */,
|
|
@@ -6025,7 +6160,7 @@ function useAuthService() {
|
|
|
6025
6160
|
},
|
|
6026
6161
|
[env]
|
|
6027
6162
|
);
|
|
6028
|
-
const getTenantMapping =
|
|
6163
|
+
const getTenantMapping = useCallback68(
|
|
6029
6164
|
async ({ shortName, service }) => {
|
|
6030
6165
|
const bodyData = {
|
|
6031
6166
|
short_name: shortName
|
|
@@ -6043,7 +6178,7 @@ function useAuthService() {
|
|
|
6043
6178
|
},
|
|
6044
6179
|
[env]
|
|
6045
6180
|
);
|
|
6046
|
-
const getToken =
|
|
6181
|
+
const getToken = useCallback68(
|
|
6047
6182
|
async ({
|
|
6048
6183
|
phone,
|
|
6049
6184
|
name,
|
|
@@ -6088,10 +6223,10 @@ function useAuthService() {
|
|
|
6088
6223
|
}
|
|
6089
6224
|
|
|
6090
6225
|
// src/services/company-service/index.ts
|
|
6091
|
-
import { useCallback as
|
|
6226
|
+
import { useCallback as useCallback69 } from "react";
|
|
6092
6227
|
function useCompanyService() {
|
|
6093
6228
|
const { env } = useEnv();
|
|
6094
|
-
const getCurrentCompany =
|
|
6229
|
+
const getCurrentCompany = useCallback69(
|
|
6095
6230
|
async (service, extraHeaders) => {
|
|
6096
6231
|
return await env.requests.get(
|
|
6097
6232
|
"/company" /* COMPANY_PATH */,
|
|
@@ -6108,7 +6243,7 @@ function useCompanyService() {
|
|
|
6108
6243
|
},
|
|
6109
6244
|
[env]
|
|
6110
6245
|
);
|
|
6111
|
-
const getInfoCompany =
|
|
6246
|
+
const getInfoCompany = useCallback69(
|
|
6112
6247
|
async (id, service) => {
|
|
6113
6248
|
const jsonData = {
|
|
6114
6249
|
ids: [id],
|
|
@@ -6144,10 +6279,10 @@ function useCompanyService() {
|
|
|
6144
6279
|
}
|
|
6145
6280
|
|
|
6146
6281
|
// src/services/excel-service/index.ts
|
|
6147
|
-
import { useCallback as
|
|
6282
|
+
import { useCallback as useCallback70 } from "react";
|
|
6148
6283
|
function useExcelService() {
|
|
6149
6284
|
const { env } = useEnv();
|
|
6150
|
-
const uploadFileExcel =
|
|
6285
|
+
const uploadFileExcel = useCallback70(
|
|
6151
6286
|
async ({
|
|
6152
6287
|
formData,
|
|
6153
6288
|
service,
|
|
@@ -6164,7 +6299,7 @@ function useExcelService() {
|
|
|
6164
6299
|
},
|
|
6165
6300
|
[env]
|
|
6166
6301
|
);
|
|
6167
|
-
const uploadIdFile =
|
|
6302
|
+
const uploadIdFile = useCallback70(
|
|
6168
6303
|
async ({
|
|
6169
6304
|
formData,
|
|
6170
6305
|
service,
|
|
@@ -6181,7 +6316,7 @@ function useExcelService() {
|
|
|
6181
6316
|
},
|
|
6182
6317
|
[env]
|
|
6183
6318
|
);
|
|
6184
|
-
const parsePreview =
|
|
6319
|
+
const parsePreview = useCallback70(
|
|
6185
6320
|
async ({
|
|
6186
6321
|
id,
|
|
6187
6322
|
selectedSheet,
|
|
@@ -6230,7 +6365,7 @@ function useExcelService() {
|
|
|
6230
6365
|
},
|
|
6231
6366
|
[env]
|
|
6232
6367
|
);
|
|
6233
|
-
const executeImport =
|
|
6368
|
+
const executeImport = useCallback70(
|
|
6234
6369
|
async ({
|
|
6235
6370
|
columns,
|
|
6236
6371
|
fields,
|
|
@@ -6264,7 +6399,7 @@ function useExcelService() {
|
|
|
6264
6399
|
},
|
|
6265
6400
|
[env]
|
|
6266
6401
|
);
|
|
6267
|
-
const getFileExcel =
|
|
6402
|
+
const getFileExcel = useCallback70(
|
|
6268
6403
|
async ({
|
|
6269
6404
|
model,
|
|
6270
6405
|
service,
|
|
@@ -6288,7 +6423,7 @@ function useExcelService() {
|
|
|
6288
6423
|
},
|
|
6289
6424
|
[env]
|
|
6290
6425
|
);
|
|
6291
|
-
const getFieldExport =
|
|
6426
|
+
const getFieldExport = useCallback70(
|
|
6292
6427
|
async ({
|
|
6293
6428
|
ids,
|
|
6294
6429
|
model,
|
|
@@ -6328,7 +6463,7 @@ function useExcelService() {
|
|
|
6328
6463
|
},
|
|
6329
6464
|
[env]
|
|
6330
6465
|
);
|
|
6331
|
-
const exportExcel =
|
|
6466
|
+
const exportExcel = useCallback70(
|
|
6332
6467
|
async ({
|
|
6333
6468
|
model,
|
|
6334
6469
|
domain,
|
|
@@ -6376,10 +6511,10 @@ function useExcelService() {
|
|
|
6376
6511
|
}
|
|
6377
6512
|
|
|
6378
6513
|
// src/services/form-service/index.ts
|
|
6379
|
-
import { useCallback as
|
|
6514
|
+
import { useCallback as useCallback71 } from "react";
|
|
6380
6515
|
function useFormService() {
|
|
6381
6516
|
const { env } = useEnv();
|
|
6382
|
-
const getComment =
|
|
6517
|
+
const getComment = useCallback71(
|
|
6383
6518
|
async ({ data }) => {
|
|
6384
6519
|
const jsonData = {
|
|
6385
6520
|
thread_id: data.thread_id,
|
|
@@ -6397,7 +6532,7 @@ function useFormService() {
|
|
|
6397
6532
|
},
|
|
6398
6533
|
[env]
|
|
6399
6534
|
);
|
|
6400
|
-
const getThreadData =
|
|
6535
|
+
const getThreadData = useCallback71(
|
|
6401
6536
|
async ({
|
|
6402
6537
|
data,
|
|
6403
6538
|
xNode,
|
|
@@ -6424,7 +6559,7 @@ function useFormService() {
|
|
|
6424
6559
|
},
|
|
6425
6560
|
[env]
|
|
6426
6561
|
);
|
|
6427
|
-
const getThreadMessages =
|
|
6562
|
+
const getThreadMessages = useCallback71(
|
|
6428
6563
|
async ({
|
|
6429
6564
|
data,
|
|
6430
6565
|
xNode,
|
|
@@ -6450,7 +6585,7 @@ function useFormService() {
|
|
|
6450
6585
|
},
|
|
6451
6586
|
[env]
|
|
6452
6587
|
);
|
|
6453
|
-
const sentComment =
|
|
6588
|
+
const sentComment = useCallback71(
|
|
6454
6589
|
async ({ data }) => {
|
|
6455
6590
|
const jsonData = {
|
|
6456
6591
|
context: {
|
|
@@ -6478,7 +6613,7 @@ function useFormService() {
|
|
|
6478
6613
|
},
|
|
6479
6614
|
[env]
|
|
6480
6615
|
);
|
|
6481
|
-
const deleteComment =
|
|
6616
|
+
const deleteComment = useCallback71(
|
|
6482
6617
|
async ({ data }) => {
|
|
6483
6618
|
const jsonData = {
|
|
6484
6619
|
attachment_ids: [],
|
|
@@ -6494,7 +6629,7 @@ function useFormService() {
|
|
|
6494
6629
|
},
|
|
6495
6630
|
[env]
|
|
6496
6631
|
);
|
|
6497
|
-
const getImage =
|
|
6632
|
+
const getImage = useCallback71(
|
|
6498
6633
|
async ({ data }) => {
|
|
6499
6634
|
return env.requests.get(
|
|
6500
6635
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -6507,7 +6642,7 @@ function useFormService() {
|
|
|
6507
6642
|
},
|
|
6508
6643
|
[env]
|
|
6509
6644
|
);
|
|
6510
|
-
const uploadImage =
|
|
6645
|
+
const uploadImage = useCallback71(
|
|
6511
6646
|
async ({
|
|
6512
6647
|
formData,
|
|
6513
6648
|
service,
|
|
@@ -6526,7 +6661,7 @@ function useFormService() {
|
|
|
6526
6661
|
},
|
|
6527
6662
|
[env]
|
|
6528
6663
|
);
|
|
6529
|
-
const uploadFile =
|
|
6664
|
+
const uploadFile = useCallback71(
|
|
6530
6665
|
async ({
|
|
6531
6666
|
formData,
|
|
6532
6667
|
service,
|
|
@@ -6546,7 +6681,7 @@ function useFormService() {
|
|
|
6546
6681
|
},
|
|
6547
6682
|
[env]
|
|
6548
6683
|
);
|
|
6549
|
-
const getFormView =
|
|
6684
|
+
const getFormView = useCallback71(
|
|
6550
6685
|
async ({ data }) => {
|
|
6551
6686
|
const jsonData = {
|
|
6552
6687
|
model: data.model,
|
|
@@ -6562,7 +6697,7 @@ function useFormService() {
|
|
|
6562
6697
|
},
|
|
6563
6698
|
[env]
|
|
6564
6699
|
);
|
|
6565
|
-
const changeStatus =
|
|
6700
|
+
const changeStatus = useCallback71(
|
|
6566
6701
|
async ({ data }) => {
|
|
6567
6702
|
const vals = {
|
|
6568
6703
|
[data.name]: data.stage_id
|
|
@@ -6591,7 +6726,7 @@ function useFormService() {
|
|
|
6591
6726
|
},
|
|
6592
6727
|
[env]
|
|
6593
6728
|
);
|
|
6594
|
-
const getExternalTab =
|
|
6729
|
+
const getExternalTab = useCallback71(
|
|
6595
6730
|
async ({ method, context, service, xNode }) => {
|
|
6596
6731
|
return env?.requests?.post(
|
|
6597
6732
|
"/call" /* CALL_PATH */,
|
|
@@ -6626,10 +6761,10 @@ function useFormService() {
|
|
|
6626
6761
|
}
|
|
6627
6762
|
|
|
6628
6763
|
// src/services/kanban-service/index.ts
|
|
6629
|
-
import { useCallback as
|
|
6764
|
+
import { useCallback as useCallback72 } from "react";
|
|
6630
6765
|
function useKanbanService() {
|
|
6631
6766
|
const { env } = useEnv();
|
|
6632
|
-
const getGroups =
|
|
6767
|
+
const getGroups = useCallback72(
|
|
6633
6768
|
async ({ model, width_context }) => {
|
|
6634
6769
|
const jsonData = {
|
|
6635
6770
|
model,
|
|
@@ -6649,7 +6784,7 @@ function useKanbanService() {
|
|
|
6649
6784
|
},
|
|
6650
6785
|
[env]
|
|
6651
6786
|
);
|
|
6652
|
-
const getProgressBar =
|
|
6787
|
+
const getProgressBar = useCallback72(
|
|
6653
6788
|
async ({ field, color, model, width_context }) => {
|
|
6654
6789
|
const jsonData = {
|
|
6655
6790
|
model,
|
|
@@ -6679,10 +6814,10 @@ function useKanbanService() {
|
|
|
6679
6814
|
}
|
|
6680
6815
|
|
|
6681
6816
|
// src/services/model-service/index.ts
|
|
6682
|
-
import { useCallback as
|
|
6817
|
+
import { useCallback as useCallback73 } from "react";
|
|
6683
6818
|
function useModelService() {
|
|
6684
6819
|
const { env } = useEnv();
|
|
6685
|
-
const getListMyBankAccount =
|
|
6820
|
+
const getListMyBankAccount = useCallback73(
|
|
6686
6821
|
async ({
|
|
6687
6822
|
domain,
|
|
6688
6823
|
spectification,
|
|
@@ -6706,7 +6841,7 @@ function useModelService() {
|
|
|
6706
6841
|
},
|
|
6707
6842
|
[env]
|
|
6708
6843
|
);
|
|
6709
|
-
const getCurrency =
|
|
6844
|
+
const getCurrency = useCallback73(async () => {
|
|
6710
6845
|
const jsonData = {
|
|
6711
6846
|
model: "res.currency",
|
|
6712
6847
|
method: "web_search_read",
|
|
@@ -6726,7 +6861,7 @@ function useModelService() {
|
|
|
6726
6861
|
}
|
|
6727
6862
|
});
|
|
6728
6863
|
}, [env]);
|
|
6729
|
-
const getConversionRate =
|
|
6864
|
+
const getConversionRate = useCallback73(async () => {
|
|
6730
6865
|
const jsonData = {
|
|
6731
6866
|
model: "res.currency",
|
|
6732
6867
|
method: "web_search_read",
|
|
@@ -6752,7 +6887,7 @@ function useModelService() {
|
|
|
6752
6887
|
}
|
|
6753
6888
|
});
|
|
6754
6889
|
}, [env]);
|
|
6755
|
-
const getAll =
|
|
6890
|
+
const getAll = useCallback73(
|
|
6756
6891
|
async ({
|
|
6757
6892
|
data,
|
|
6758
6893
|
service,
|
|
@@ -6794,7 +6929,7 @@ function useModelService() {
|
|
|
6794
6929
|
},
|
|
6795
6930
|
[env]
|
|
6796
6931
|
);
|
|
6797
|
-
const getListCalendar =
|
|
6932
|
+
const getListCalendar = useCallback73(
|
|
6798
6933
|
async ({ data }) => {
|
|
6799
6934
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6800
6935
|
fields: data.fields,
|
|
@@ -6825,7 +6960,7 @@ function useModelService() {
|
|
|
6825
6960
|
},
|
|
6826
6961
|
[env]
|
|
6827
6962
|
);
|
|
6828
|
-
const getList =
|
|
6963
|
+
const getList = useCallback73(
|
|
6829
6964
|
async ({
|
|
6830
6965
|
model,
|
|
6831
6966
|
ids = [],
|
|
@@ -6857,7 +6992,7 @@ function useModelService() {
|
|
|
6857
6992
|
},
|
|
6858
6993
|
[env]
|
|
6859
6994
|
);
|
|
6860
|
-
const getDetail =
|
|
6995
|
+
const getDetail = useCallback73(
|
|
6861
6996
|
async ({
|
|
6862
6997
|
ids = [],
|
|
6863
6998
|
model,
|
|
@@ -6889,7 +7024,7 @@ function useModelService() {
|
|
|
6889
7024
|
},
|
|
6890
7025
|
[env]
|
|
6891
7026
|
);
|
|
6892
|
-
const save =
|
|
7027
|
+
const save = useCallback73(
|
|
6893
7028
|
async ({
|
|
6894
7029
|
model,
|
|
6895
7030
|
ids = [],
|
|
@@ -6924,7 +7059,7 @@ function useModelService() {
|
|
|
6924
7059
|
},
|
|
6925
7060
|
[env]
|
|
6926
7061
|
);
|
|
6927
|
-
const deleteApi =
|
|
7062
|
+
const deleteApi = useCallback73(
|
|
6928
7063
|
async ({ ids = [], model, service }) => {
|
|
6929
7064
|
const jsonData = {
|
|
6930
7065
|
model,
|
|
@@ -6944,7 +7079,7 @@ function useModelService() {
|
|
|
6944
7079
|
},
|
|
6945
7080
|
[env]
|
|
6946
7081
|
);
|
|
6947
|
-
const onChange =
|
|
7082
|
+
const onChange = useCallback73(
|
|
6948
7083
|
async ({
|
|
6949
7084
|
ids = [],
|
|
6950
7085
|
model,
|
|
@@ -6980,7 +7115,7 @@ function useModelService() {
|
|
|
6980
7115
|
},
|
|
6981
7116
|
[env]
|
|
6982
7117
|
);
|
|
6983
|
-
const getListFieldsOnchange =
|
|
7118
|
+
const getListFieldsOnchange = useCallback73(
|
|
6984
7119
|
async ({
|
|
6985
7120
|
model,
|
|
6986
7121
|
service,
|
|
@@ -7004,7 +7139,7 @@ function useModelService() {
|
|
|
7004
7139
|
},
|
|
7005
7140
|
[env]
|
|
7006
7141
|
);
|
|
7007
|
-
const parseORMOdoo =
|
|
7142
|
+
const parseORMOdoo = useCallback73((data) => {
|
|
7008
7143
|
for (const key in data) {
|
|
7009
7144
|
if (key === "display_name") {
|
|
7010
7145
|
delete data[key];
|
|
@@ -7015,7 +7150,7 @@ function useModelService() {
|
|
|
7015
7150
|
}
|
|
7016
7151
|
return { ...data };
|
|
7017
7152
|
}, []);
|
|
7018
|
-
const toDataJS =
|
|
7153
|
+
const toDataJS = useCallback73(
|
|
7019
7154
|
(data, viewData, model) => {
|
|
7020
7155
|
for (const key in data) {
|
|
7021
7156
|
if (data[key] === false) {
|
|
@@ -7073,10 +7208,10 @@ function useModelService() {
|
|
|
7073
7208
|
}
|
|
7074
7209
|
|
|
7075
7210
|
// src/services/user-service/index.ts
|
|
7076
|
-
import { useCallback as
|
|
7211
|
+
import { useCallback as useCallback74 } from "react";
|
|
7077
7212
|
function useUserService() {
|
|
7078
7213
|
const { env } = useEnv();
|
|
7079
|
-
const getProfile =
|
|
7214
|
+
const getProfile = useCallback74(
|
|
7080
7215
|
async (service, path, extraHeaders) => {
|
|
7081
7216
|
return env?.requests?.get(
|
|
7082
7217
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -7093,7 +7228,7 @@ function useUserService() {
|
|
|
7093
7228
|
},
|
|
7094
7229
|
[env]
|
|
7095
7230
|
);
|
|
7096
|
-
const getUser =
|
|
7231
|
+
const getUser = useCallback74(
|
|
7097
7232
|
async ({ context, id }) => {
|
|
7098
7233
|
const jsonData = {
|
|
7099
7234
|
model: "res.users",
|
|
@@ -7131,7 +7266,7 @@ function useUserService() {
|
|
|
7131
7266
|
},
|
|
7132
7267
|
[env]
|
|
7133
7268
|
);
|
|
7134
|
-
const switchUserLocale =
|
|
7269
|
+
const switchUserLocale = useCallback74(
|
|
7135
7270
|
async ({ id, values, service }) => {
|
|
7136
7271
|
const jsonData = {
|
|
7137
7272
|
model: "res.users",
|
|
@@ -7159,10 +7294,10 @@ function useUserService() {
|
|
|
7159
7294
|
}
|
|
7160
7295
|
|
|
7161
7296
|
// src/services/view-service/index.ts
|
|
7162
|
-
import { useCallback as
|
|
7297
|
+
import { useCallback as useCallback75 } from "react";
|
|
7163
7298
|
function useViewService() {
|
|
7164
7299
|
const { env } = useEnv();
|
|
7165
|
-
const getView =
|
|
7300
|
+
const getView = useCallback75(
|
|
7166
7301
|
async ({
|
|
7167
7302
|
model,
|
|
7168
7303
|
views,
|
|
@@ -7202,7 +7337,7 @@ function useViewService() {
|
|
|
7202
7337
|
},
|
|
7203
7338
|
[env]
|
|
7204
7339
|
);
|
|
7205
|
-
const getMenu =
|
|
7340
|
+
const getMenu = useCallback75(
|
|
7206
7341
|
async (context, specification, domain, service) => {
|
|
7207
7342
|
const jsonData = {
|
|
7208
7343
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -7233,7 +7368,7 @@ function useViewService() {
|
|
|
7233
7368
|
},
|
|
7234
7369
|
[env]
|
|
7235
7370
|
);
|
|
7236
|
-
const getActionDetail =
|
|
7371
|
+
const getActionDetail = useCallback75(
|
|
7237
7372
|
async (aid, context) => {
|
|
7238
7373
|
const jsonData = {
|
|
7239
7374
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -7263,7 +7398,7 @@ function useViewService() {
|
|
|
7263
7398
|
},
|
|
7264
7399
|
[env]
|
|
7265
7400
|
);
|
|
7266
|
-
const getResequence =
|
|
7401
|
+
const getResequence = useCallback75(
|
|
7267
7402
|
async ({
|
|
7268
7403
|
model,
|
|
7269
7404
|
ids,
|
|
@@ -7293,7 +7428,7 @@ function useViewService() {
|
|
|
7293
7428
|
},
|
|
7294
7429
|
[env]
|
|
7295
7430
|
);
|
|
7296
|
-
const getSelectionItem =
|
|
7431
|
+
const getSelectionItem = useCallback75(
|
|
7297
7432
|
async ({
|
|
7298
7433
|
data,
|
|
7299
7434
|
service,
|
|
@@ -7330,7 +7465,7 @@ function useViewService() {
|
|
|
7330
7465
|
},
|
|
7331
7466
|
[env]
|
|
7332
7467
|
);
|
|
7333
|
-
const loadMessages =
|
|
7468
|
+
const loadMessages = useCallback75(async () => {
|
|
7334
7469
|
return env.requests.post(
|
|
7335
7470
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
7336
7471
|
{},
|
|
@@ -7341,14 +7476,14 @@ function useViewService() {
|
|
|
7341
7476
|
}
|
|
7342
7477
|
);
|
|
7343
7478
|
}, [env]);
|
|
7344
|
-
const getVersion =
|
|
7479
|
+
const getVersion = useCallback75(async () => {
|
|
7345
7480
|
return env?.requests?.get("", {
|
|
7346
7481
|
headers: {
|
|
7347
7482
|
"Content-Type": "application/json"
|
|
7348
7483
|
}
|
|
7349
7484
|
});
|
|
7350
7485
|
}, [env]);
|
|
7351
|
-
const grantAccess =
|
|
7486
|
+
const grantAccess = useCallback75(
|
|
7352
7487
|
async ({
|
|
7353
7488
|
redirect_uri,
|
|
7354
7489
|
state,
|
|
@@ -7375,7 +7510,7 @@ function useViewService() {
|
|
|
7375
7510
|
},
|
|
7376
7511
|
[env]
|
|
7377
7512
|
);
|
|
7378
|
-
const removeTotpSetUp =
|
|
7513
|
+
const removeTotpSetUp = useCallback75(
|
|
7379
7514
|
async ({ method, token }) => {
|
|
7380
7515
|
const jsonData = {
|
|
7381
7516
|
method,
|
|
@@ -7396,7 +7531,7 @@ function useViewService() {
|
|
|
7396
7531
|
},
|
|
7397
7532
|
[env]
|
|
7398
7533
|
);
|
|
7399
|
-
const requestSetupTotp =
|
|
7534
|
+
const requestSetupTotp = useCallback75(
|
|
7400
7535
|
async ({ method, token }) => {
|
|
7401
7536
|
const jsonData = {
|
|
7402
7537
|
method,
|
|
@@ -7415,7 +7550,7 @@ function useViewService() {
|
|
|
7415
7550
|
},
|
|
7416
7551
|
[env]
|
|
7417
7552
|
);
|
|
7418
|
-
const settingsWebRead2fa =
|
|
7553
|
+
const settingsWebRead2fa = useCallback75(
|
|
7419
7554
|
async ({
|
|
7420
7555
|
method,
|
|
7421
7556
|
model,
|
|
@@ -7443,7 +7578,7 @@ function useViewService() {
|
|
|
7443
7578
|
},
|
|
7444
7579
|
[env]
|
|
7445
7580
|
);
|
|
7446
|
-
const signInSSO =
|
|
7581
|
+
const signInSSO = useCallback75(
|
|
7447
7582
|
async ({
|
|
7448
7583
|
redirect_uri,
|
|
7449
7584
|
state,
|
|
@@ -7475,7 +7610,7 @@ function useViewService() {
|
|
|
7475
7610
|
},
|
|
7476
7611
|
[env]
|
|
7477
7612
|
);
|
|
7478
|
-
const verify2FA =
|
|
7613
|
+
const verify2FA = useCallback75(
|
|
7479
7614
|
({
|
|
7480
7615
|
method,
|
|
7481
7616
|
with_context,
|
|
@@ -7508,7 +7643,7 @@ function useViewService() {
|
|
|
7508
7643
|
},
|
|
7509
7644
|
[env]
|
|
7510
7645
|
);
|
|
7511
|
-
const get2FAMethods =
|
|
7646
|
+
const get2FAMethods = useCallback75(
|
|
7512
7647
|
({ method, with_context }) => {
|
|
7513
7648
|
const jsonData = {
|
|
7514
7649
|
method,
|
|
@@ -7527,7 +7662,7 @@ function useViewService() {
|
|
|
7527
7662
|
},
|
|
7528
7663
|
[env]
|
|
7529
7664
|
);
|
|
7530
|
-
const verifyTotp =
|
|
7665
|
+
const verifyTotp = useCallback75(
|
|
7531
7666
|
({
|
|
7532
7667
|
method,
|
|
7533
7668
|
action_token,
|
|
@@ -7552,7 +7687,7 @@ function useViewService() {
|
|
|
7552
7687
|
},
|
|
7553
7688
|
[env]
|
|
7554
7689
|
);
|
|
7555
|
-
const getNotifications =
|
|
7690
|
+
const getNotifications = useCallback75(
|
|
7556
7691
|
async ({
|
|
7557
7692
|
service,
|
|
7558
7693
|
xNode,
|
|
@@ -7572,7 +7707,7 @@ function useViewService() {
|
|
|
7572
7707
|
},
|
|
7573
7708
|
[env]
|
|
7574
7709
|
);
|
|
7575
|
-
const getCountry =
|
|
7710
|
+
const getCountry = useCallback75(
|
|
7576
7711
|
async ({
|
|
7577
7712
|
service,
|
|
7578
7713
|
xNode,
|
|
@@ -7599,7 +7734,7 @@ function useViewService() {
|
|
|
7599
7734
|
},
|
|
7600
7735
|
[env]
|
|
7601
7736
|
);
|
|
7602
|
-
const getCity =
|
|
7737
|
+
const getCity = useCallback75(
|
|
7603
7738
|
async ({
|
|
7604
7739
|
service,
|
|
7605
7740
|
xNode,
|
|
@@ -7626,7 +7761,7 @@ function useViewService() {
|
|
|
7626
7761
|
},
|
|
7627
7762
|
[env]
|
|
7628
7763
|
);
|
|
7629
|
-
const getWard =
|
|
7764
|
+
const getWard = useCallback75(
|
|
7630
7765
|
async ({
|
|
7631
7766
|
service,
|
|
7632
7767
|
xNode,
|
|
@@ -7651,7 +7786,7 @@ function useViewService() {
|
|
|
7651
7786
|
},
|
|
7652
7787
|
[env]
|
|
7653
7788
|
);
|
|
7654
|
-
const getPartnerTitle =
|
|
7789
|
+
const getPartnerTitle = useCallback75(
|
|
7655
7790
|
async ({
|
|
7656
7791
|
service,
|
|
7657
7792
|
xNode,
|
|
@@ -7703,10 +7838,10 @@ function useViewService() {
|
|
|
7703
7838
|
}
|
|
7704
7839
|
|
|
7705
7840
|
// src/services/dashboard-service/index.ts
|
|
7706
|
-
import { useCallback as
|
|
7841
|
+
import { useCallback as useCallback76 } from "react";
|
|
7707
7842
|
function useDashboardService() {
|
|
7708
7843
|
const { env } = useEnv();
|
|
7709
|
-
const readGroup =
|
|
7844
|
+
const readGroup = useCallback76(
|
|
7710
7845
|
async ({
|
|
7711
7846
|
service,
|
|
7712
7847
|
xNode,
|
|
@@ -7723,7 +7858,7 @@ function useDashboardService() {
|
|
|
7723
7858
|
},
|
|
7724
7859
|
[env]
|
|
7725
7860
|
);
|
|
7726
|
-
const getDataChart =
|
|
7861
|
+
const getDataChart = useCallback76(
|
|
7727
7862
|
async ({
|
|
7728
7863
|
service,
|
|
7729
7864
|
xNode,
|