@fctc/interface-logic 4.8.7 → 4.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks.d.mts +9 -1
- package/dist/hooks.d.ts +9 -1
- package/dist/hooks.js +57 -4
- package/dist/hooks.mjs +56 -4
- package/dist/provider.d.mts +3 -2
- package/dist/provider.d.ts +3 -2
- package/dist/provider.js +79 -27
- package/dist/provider.mjs +68 -16
- package/dist/services.d.mts +5 -0
- package/dist/services.d.ts +5 -0
- package/dist/services.js +142 -98
- package/dist/services.mjs +139 -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 useCallback56 } from "react";
|
|
3
3
|
|
|
4
4
|
// src/constants/api/uri-constant.ts
|
|
5
5
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -4588,7 +4588,7 @@ var createOrderSupabaseService = () => {
|
|
|
4588
4588
|
amount_paid: values.amount_paid,
|
|
4589
4589
|
amount_return: values.amount_return,
|
|
4590
4590
|
table_id: values.table_id,
|
|
4591
|
-
partner_id: values.partner_id
|
|
4591
|
+
partner_id: values.partner_id || null
|
|
4592
4592
|
}).select("id, pos_reference").single();
|
|
4593
4593
|
if (error) {
|
|
4594
4594
|
console.error("Error creating order:", error);
|
|
@@ -4730,6 +4730,9 @@ var updateOrderSupabaseService = () => {
|
|
|
4730
4730
|
...rest,
|
|
4731
4731
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4732
4732
|
});
|
|
4733
|
+
if (rest.partner_id === 0) {
|
|
4734
|
+
Object.assign(updateData, { partner_id: null });
|
|
4735
|
+
}
|
|
4733
4736
|
try {
|
|
4734
4737
|
const { error, data } = await supabase.from("orders" /* ORDERS */).update(updateData).eq("id", order_id).select("id").single();
|
|
4735
4738
|
if (error) {
|
|
@@ -5097,6 +5100,43 @@ var deleteCustomerSupabaseService = () => {
|
|
|
5097
5100
|
};
|
|
5098
5101
|
};
|
|
5099
5102
|
|
|
5103
|
+
// src/services/pos-service/supabase/upload-image.ts
|
|
5104
|
+
import { useCallback as useCallback55 } from "react";
|
|
5105
|
+
var uploadImageSupabaseService = () => {
|
|
5106
|
+
const supabase = useSupabaseOptional();
|
|
5107
|
+
const uploadImageSupabase = useCallback55(
|
|
5108
|
+
async (file, tenantId) => {
|
|
5109
|
+
if (!supabase) {
|
|
5110
|
+
console.error("Supabase client not initialized");
|
|
5111
|
+
return { url: null, error: "Supabase client not initialized" };
|
|
5112
|
+
}
|
|
5113
|
+
const bucketName = `tenant-${tenantId}`;
|
|
5114
|
+
try {
|
|
5115
|
+
const fileExt = file.name.split(".").pop();
|
|
5116
|
+
const fileName = `uploads/${Date.now()}_${Math.random().toString(36).substring(7)}.${fileExt}`;
|
|
5117
|
+
const { error: uploadError } = await supabase.storage.from(bucketName).upload(fileName, file, {
|
|
5118
|
+
cacheControl: "3600",
|
|
5119
|
+
upsert: false,
|
|
5120
|
+
contentType: file.type
|
|
5121
|
+
});
|
|
5122
|
+
if (uploadError) {
|
|
5123
|
+
console.error("Error uploading image:", uploadError);
|
|
5124
|
+
return { url: null, error: uploadError };
|
|
5125
|
+
}
|
|
5126
|
+
const { data: urlData } = supabase.storage.from(bucketName).getPublicUrl(fileName);
|
|
5127
|
+
return { url: urlData.publicUrl, error: null };
|
|
5128
|
+
} catch (error) {
|
|
5129
|
+
console.error("Error uploading image:", error);
|
|
5130
|
+
return { url: null, error };
|
|
5131
|
+
}
|
|
5132
|
+
},
|
|
5133
|
+
[supabase]
|
|
5134
|
+
);
|
|
5135
|
+
return {
|
|
5136
|
+
uploadImageSupabase
|
|
5137
|
+
};
|
|
5138
|
+
};
|
|
5139
|
+
|
|
5100
5140
|
// src/services/pos-service/index.ts
|
|
5101
5141
|
var serviceFactories = [
|
|
5102
5142
|
addEntityService,
|
|
@@ -5150,7 +5190,8 @@ var serviceFactories = [
|
|
|
5150
5190
|
createPaymentSupabaseService,
|
|
5151
5191
|
createCustomerSupabaseService,
|
|
5152
5192
|
updateCustomerSupabaseService,
|
|
5153
|
-
deleteCustomerSupabaseService
|
|
5193
|
+
deleteCustomerSupabaseService,
|
|
5194
|
+
uploadImageSupabaseService
|
|
5154
5195
|
];
|
|
5155
5196
|
var usePosService = () => {
|
|
5156
5197
|
const { env } = useEnv();
|
|
@@ -5315,6 +5356,9 @@ import { useMutation as useMutation108 } from "@tanstack/react-query";
|
|
|
5315
5356
|
// src/hooks/pos/supabase/use-delete-customer.ts
|
|
5316
5357
|
import { useMutation as useMutation109 } from "@tanstack/react-query";
|
|
5317
5358
|
|
|
5359
|
+
// src/hooks/pos/supabase/use-supa-upload-image.ts
|
|
5360
|
+
import { useMutation as useMutation110 } from "@tanstack/react-query";
|
|
5361
|
+
|
|
5318
5362
|
// src/provider/service-provider.tsx
|
|
5319
5363
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
5320
5364
|
var ServiceContext = createContext3(null);
|
|
@@ -5326,7 +5370,7 @@ import { Fragment as Fragment2, jsx as jsx8 } from "react/jsx-runtime";
|
|
|
5326
5370
|
// src/services/action-service/index.ts
|
|
5327
5371
|
function useActionService() {
|
|
5328
5372
|
const { env } = useEnv();
|
|
5329
|
-
const loadAction =
|
|
5373
|
+
const loadAction = useCallback56(
|
|
5330
5374
|
async ({
|
|
5331
5375
|
idAction,
|
|
5332
5376
|
context,
|
|
@@ -5350,7 +5394,7 @@ function useActionService() {
|
|
|
5350
5394
|
},
|
|
5351
5395
|
[env]
|
|
5352
5396
|
);
|
|
5353
|
-
const callButton =
|
|
5397
|
+
const callButton = useCallback56(
|
|
5354
5398
|
async ({
|
|
5355
5399
|
model,
|
|
5356
5400
|
ids = [],
|
|
@@ -5384,7 +5428,7 @@ function useActionService() {
|
|
|
5384
5428
|
},
|
|
5385
5429
|
[env]
|
|
5386
5430
|
);
|
|
5387
|
-
const removeRows =
|
|
5431
|
+
const removeRows = useCallback56(
|
|
5388
5432
|
async ({
|
|
5389
5433
|
model,
|
|
5390
5434
|
ids,
|
|
@@ -5410,7 +5454,7 @@ function useActionService() {
|
|
|
5410
5454
|
},
|
|
5411
5455
|
[env]
|
|
5412
5456
|
);
|
|
5413
|
-
const duplicateRecord =
|
|
5457
|
+
const duplicateRecord = useCallback56(
|
|
5414
5458
|
async ({
|
|
5415
5459
|
model,
|
|
5416
5460
|
id,
|
|
@@ -5436,7 +5480,7 @@ function useActionService() {
|
|
|
5436
5480
|
},
|
|
5437
5481
|
[env]
|
|
5438
5482
|
);
|
|
5439
|
-
const getPrintReportName =
|
|
5483
|
+
const getPrintReportName = useCallback56(
|
|
5440
5484
|
async ({ id }) => {
|
|
5441
5485
|
const jsonData = {
|
|
5442
5486
|
model: "ir.actions.report",
|
|
@@ -5454,7 +5498,7 @@ function useActionService() {
|
|
|
5454
5498
|
},
|
|
5455
5499
|
[env]
|
|
5456
5500
|
);
|
|
5457
|
-
const print =
|
|
5501
|
+
const print = useCallback56(
|
|
5458
5502
|
async ({ id, report, db }) => {
|
|
5459
5503
|
const jsonData = {
|
|
5460
5504
|
report,
|
|
@@ -5472,7 +5516,7 @@ function useActionService() {
|
|
|
5472
5516
|
},
|
|
5473
5517
|
[env]
|
|
5474
5518
|
);
|
|
5475
|
-
const runAction =
|
|
5519
|
+
const runAction = useCallback56(
|
|
5476
5520
|
async ({
|
|
5477
5521
|
idAction,
|
|
5478
5522
|
context,
|
|
@@ -5499,7 +5543,7 @@ function useActionService() {
|
|
|
5499
5543
|
},
|
|
5500
5544
|
[env]
|
|
5501
5545
|
);
|
|
5502
|
-
const generateSerialNumber =
|
|
5546
|
+
const generateSerialNumber = useCallback56(
|
|
5503
5547
|
async ({
|
|
5504
5548
|
kwargs,
|
|
5505
5549
|
context,
|
|
@@ -5537,11 +5581,11 @@ function useActionService() {
|
|
|
5537
5581
|
}
|
|
5538
5582
|
|
|
5539
5583
|
// src/services/auth-service/index.ts
|
|
5540
|
-
import { useCallback as
|
|
5584
|
+
import { useCallback as useCallback57 } from "react";
|
|
5541
5585
|
function useAuthService() {
|
|
5542
5586
|
const { env } = useEnv();
|
|
5543
5587
|
const supabase = useSupabaseOptional();
|
|
5544
|
-
const login =
|
|
5588
|
+
const login = useCallback57(
|
|
5545
5589
|
async (body) => {
|
|
5546
5590
|
const payload = Object.fromEntries(
|
|
5547
5591
|
Object.entries({
|
|
@@ -5566,7 +5610,7 @@ function useAuthService() {
|
|
|
5566
5610
|
},
|
|
5567
5611
|
[env]
|
|
5568
5612
|
);
|
|
5569
|
-
const loginSupabase =
|
|
5613
|
+
const loginSupabase = useCallback57(
|
|
5570
5614
|
async (body) => {
|
|
5571
5615
|
if (!supabase) {
|
|
5572
5616
|
return {
|
|
@@ -5582,7 +5626,7 @@ function useAuthService() {
|
|
|
5582
5626
|
},
|
|
5583
5627
|
[supabase]
|
|
5584
5628
|
);
|
|
5585
|
-
const forgotPassword =
|
|
5629
|
+
const forgotPassword = useCallback57(
|
|
5586
5630
|
async (email) => {
|
|
5587
5631
|
const bodyData = {
|
|
5588
5632
|
login: email,
|
|
@@ -5596,7 +5640,7 @@ function useAuthService() {
|
|
|
5596
5640
|
},
|
|
5597
5641
|
[env]
|
|
5598
5642
|
);
|
|
5599
|
-
const forgotPasswordSSO =
|
|
5643
|
+
const forgotPasswordSSO = useCallback57(
|
|
5600
5644
|
async ({
|
|
5601
5645
|
email,
|
|
5602
5646
|
with_context,
|
|
@@ -5619,7 +5663,7 @@ function useAuthService() {
|
|
|
5619
5663
|
},
|
|
5620
5664
|
[env]
|
|
5621
5665
|
);
|
|
5622
|
-
const resetPassword =
|
|
5666
|
+
const resetPassword = useCallback57(
|
|
5623
5667
|
async (data, token) => {
|
|
5624
5668
|
const bodyData = {
|
|
5625
5669
|
token,
|
|
@@ -5634,7 +5678,7 @@ function useAuthService() {
|
|
|
5634
5678
|
},
|
|
5635
5679
|
[env]
|
|
5636
5680
|
);
|
|
5637
|
-
const resetPasswordSSO =
|
|
5681
|
+
const resetPasswordSSO = useCallback57(
|
|
5638
5682
|
async ({
|
|
5639
5683
|
method,
|
|
5640
5684
|
password,
|
|
@@ -5657,7 +5701,7 @@ function useAuthService() {
|
|
|
5657
5701
|
},
|
|
5658
5702
|
[env]
|
|
5659
5703
|
);
|
|
5660
|
-
const updatePassword =
|
|
5704
|
+
const updatePassword = useCallback57(
|
|
5661
5705
|
async (data, token) => {
|
|
5662
5706
|
const bodyData = {
|
|
5663
5707
|
token,
|
|
@@ -5672,7 +5716,7 @@ function useAuthService() {
|
|
|
5672
5716
|
},
|
|
5673
5717
|
[env]
|
|
5674
5718
|
);
|
|
5675
|
-
const isValidToken =
|
|
5719
|
+
const isValidToken = useCallback57(
|
|
5676
5720
|
async (token) => {
|
|
5677
5721
|
const bodyData = {
|
|
5678
5722
|
token
|
|
@@ -5685,7 +5729,7 @@ function useAuthService() {
|
|
|
5685
5729
|
},
|
|
5686
5730
|
[env]
|
|
5687
5731
|
);
|
|
5688
|
-
const isValidActionToken =
|
|
5732
|
+
const isValidActionToken = useCallback57(
|
|
5689
5733
|
async (actionToken) => {
|
|
5690
5734
|
const bodyData = {};
|
|
5691
5735
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5698,7 +5742,7 @@ function useAuthService() {
|
|
|
5698
5742
|
},
|
|
5699
5743
|
[env]
|
|
5700
5744
|
);
|
|
5701
|
-
const loginSocial =
|
|
5745
|
+
const loginSocial = useCallback57(
|
|
5702
5746
|
async ({
|
|
5703
5747
|
db,
|
|
5704
5748
|
state,
|
|
@@ -5716,13 +5760,13 @@ function useAuthService() {
|
|
|
5716
5760
|
},
|
|
5717
5761
|
[env]
|
|
5718
5762
|
);
|
|
5719
|
-
const getProviders =
|
|
5763
|
+
const getProviders = useCallback57(
|
|
5720
5764
|
async (db) => {
|
|
5721
5765
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5722
5766
|
},
|
|
5723
5767
|
[env]
|
|
5724
5768
|
);
|
|
5725
|
-
const getAccessByCode =
|
|
5769
|
+
const getAccessByCode = useCallback57(
|
|
5726
5770
|
async (code) => {
|
|
5727
5771
|
const data = new URLSearchParams();
|
|
5728
5772
|
data.append("code", code);
|
|
@@ -5742,7 +5786,7 @@ function useAuthService() {
|
|
|
5742
5786
|
},
|
|
5743
5787
|
[env]
|
|
5744
5788
|
);
|
|
5745
|
-
const logout =
|
|
5789
|
+
const logout = useCallback57(
|
|
5746
5790
|
async (service) => {
|
|
5747
5791
|
return env?.requests?.post(
|
|
5748
5792
|
"/logout" /* LOGOUT */,
|
|
@@ -5759,7 +5803,7 @@ function useAuthService() {
|
|
|
5759
5803
|
},
|
|
5760
5804
|
[env]
|
|
5761
5805
|
);
|
|
5762
|
-
const getTenantMapping =
|
|
5806
|
+
const getTenantMapping = useCallback57(
|
|
5763
5807
|
async ({ shortName, service }) => {
|
|
5764
5808
|
const bodyData = {
|
|
5765
5809
|
short_name: shortName
|
|
@@ -5777,7 +5821,7 @@ function useAuthService() {
|
|
|
5777
5821
|
},
|
|
5778
5822
|
[env]
|
|
5779
5823
|
);
|
|
5780
|
-
const getToken =
|
|
5824
|
+
const getToken = useCallback57(
|
|
5781
5825
|
async ({
|
|
5782
5826
|
phone,
|
|
5783
5827
|
name,
|
|
@@ -5822,10 +5866,10 @@ function useAuthService() {
|
|
|
5822
5866
|
}
|
|
5823
5867
|
|
|
5824
5868
|
// src/services/company-service/index.ts
|
|
5825
|
-
import { useCallback as
|
|
5869
|
+
import { useCallback as useCallback58 } from "react";
|
|
5826
5870
|
function useCompanyService() {
|
|
5827
5871
|
const { env } = useEnv();
|
|
5828
|
-
const getCurrentCompany =
|
|
5872
|
+
const getCurrentCompany = useCallback58(
|
|
5829
5873
|
async (service, extraHeaders) => {
|
|
5830
5874
|
return await env.requests.get(
|
|
5831
5875
|
"/company" /* COMPANY_PATH */,
|
|
@@ -5842,7 +5886,7 @@ function useCompanyService() {
|
|
|
5842
5886
|
},
|
|
5843
5887
|
[env]
|
|
5844
5888
|
);
|
|
5845
|
-
const getInfoCompany =
|
|
5889
|
+
const getInfoCompany = useCallback58(
|
|
5846
5890
|
async (id, service) => {
|
|
5847
5891
|
const jsonData = {
|
|
5848
5892
|
ids: [id],
|
|
@@ -5878,10 +5922,10 @@ function useCompanyService() {
|
|
|
5878
5922
|
}
|
|
5879
5923
|
|
|
5880
5924
|
// src/services/excel-service/index.ts
|
|
5881
|
-
import { useCallback as
|
|
5925
|
+
import { useCallback as useCallback59 } from "react";
|
|
5882
5926
|
function useExcelService() {
|
|
5883
5927
|
const { env } = useEnv();
|
|
5884
|
-
const uploadFileExcel =
|
|
5928
|
+
const uploadFileExcel = useCallback59(
|
|
5885
5929
|
async ({
|
|
5886
5930
|
formData,
|
|
5887
5931
|
service,
|
|
@@ -5898,7 +5942,7 @@ function useExcelService() {
|
|
|
5898
5942
|
},
|
|
5899
5943
|
[env]
|
|
5900
5944
|
);
|
|
5901
|
-
const uploadIdFile =
|
|
5945
|
+
const uploadIdFile = useCallback59(
|
|
5902
5946
|
async ({
|
|
5903
5947
|
formData,
|
|
5904
5948
|
service,
|
|
@@ -5915,7 +5959,7 @@ function useExcelService() {
|
|
|
5915
5959
|
},
|
|
5916
5960
|
[env]
|
|
5917
5961
|
);
|
|
5918
|
-
const parsePreview =
|
|
5962
|
+
const parsePreview = useCallback59(
|
|
5919
5963
|
async ({
|
|
5920
5964
|
id,
|
|
5921
5965
|
selectedSheet,
|
|
@@ -5964,7 +6008,7 @@ function useExcelService() {
|
|
|
5964
6008
|
},
|
|
5965
6009
|
[env]
|
|
5966
6010
|
);
|
|
5967
|
-
const executeImport =
|
|
6011
|
+
const executeImport = useCallback59(
|
|
5968
6012
|
async ({
|
|
5969
6013
|
columns,
|
|
5970
6014
|
fields,
|
|
@@ -5998,7 +6042,7 @@ function useExcelService() {
|
|
|
5998
6042
|
},
|
|
5999
6043
|
[env]
|
|
6000
6044
|
);
|
|
6001
|
-
const getFileExcel =
|
|
6045
|
+
const getFileExcel = useCallback59(
|
|
6002
6046
|
async ({
|
|
6003
6047
|
model,
|
|
6004
6048
|
service,
|
|
@@ -6022,7 +6066,7 @@ function useExcelService() {
|
|
|
6022
6066
|
},
|
|
6023
6067
|
[env]
|
|
6024
6068
|
);
|
|
6025
|
-
const getFieldExport =
|
|
6069
|
+
const getFieldExport = useCallback59(
|
|
6026
6070
|
async ({
|
|
6027
6071
|
ids,
|
|
6028
6072
|
model,
|
|
@@ -6062,7 +6106,7 @@ function useExcelService() {
|
|
|
6062
6106
|
},
|
|
6063
6107
|
[env]
|
|
6064
6108
|
);
|
|
6065
|
-
const exportExcel =
|
|
6109
|
+
const exportExcel = useCallback59(
|
|
6066
6110
|
async ({
|
|
6067
6111
|
model,
|
|
6068
6112
|
domain,
|
|
@@ -6110,10 +6154,10 @@ function useExcelService() {
|
|
|
6110
6154
|
}
|
|
6111
6155
|
|
|
6112
6156
|
// src/services/form-service/index.ts
|
|
6113
|
-
import { useCallback as
|
|
6157
|
+
import { useCallback as useCallback60 } from "react";
|
|
6114
6158
|
function useFormService() {
|
|
6115
6159
|
const { env } = useEnv();
|
|
6116
|
-
const getComment =
|
|
6160
|
+
const getComment = useCallback60(
|
|
6117
6161
|
async ({ data }) => {
|
|
6118
6162
|
const jsonData = {
|
|
6119
6163
|
thread_id: data.thread_id,
|
|
@@ -6131,7 +6175,7 @@ function useFormService() {
|
|
|
6131
6175
|
},
|
|
6132
6176
|
[env]
|
|
6133
6177
|
);
|
|
6134
|
-
const getThreadData =
|
|
6178
|
+
const getThreadData = useCallback60(
|
|
6135
6179
|
async ({
|
|
6136
6180
|
data,
|
|
6137
6181
|
xNode,
|
|
@@ -6158,7 +6202,7 @@ function useFormService() {
|
|
|
6158
6202
|
},
|
|
6159
6203
|
[env]
|
|
6160
6204
|
);
|
|
6161
|
-
const getThreadMessages =
|
|
6205
|
+
const getThreadMessages = useCallback60(
|
|
6162
6206
|
async ({
|
|
6163
6207
|
data,
|
|
6164
6208
|
xNode,
|
|
@@ -6184,7 +6228,7 @@ function useFormService() {
|
|
|
6184
6228
|
},
|
|
6185
6229
|
[env]
|
|
6186
6230
|
);
|
|
6187
|
-
const sentComment =
|
|
6231
|
+
const sentComment = useCallback60(
|
|
6188
6232
|
async ({ data }) => {
|
|
6189
6233
|
const jsonData = {
|
|
6190
6234
|
context: {
|
|
@@ -6212,7 +6256,7 @@ function useFormService() {
|
|
|
6212
6256
|
},
|
|
6213
6257
|
[env]
|
|
6214
6258
|
);
|
|
6215
|
-
const deleteComment =
|
|
6259
|
+
const deleteComment = useCallback60(
|
|
6216
6260
|
async ({ data }) => {
|
|
6217
6261
|
const jsonData = {
|
|
6218
6262
|
attachment_ids: [],
|
|
@@ -6228,7 +6272,7 @@ function useFormService() {
|
|
|
6228
6272
|
},
|
|
6229
6273
|
[env]
|
|
6230
6274
|
);
|
|
6231
|
-
const getImage =
|
|
6275
|
+
const getImage = useCallback60(
|
|
6232
6276
|
async ({ data }) => {
|
|
6233
6277
|
return env.requests.get(
|
|
6234
6278
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -6241,7 +6285,7 @@ function useFormService() {
|
|
|
6241
6285
|
},
|
|
6242
6286
|
[env]
|
|
6243
6287
|
);
|
|
6244
|
-
const uploadImage =
|
|
6288
|
+
const uploadImage = useCallback60(
|
|
6245
6289
|
async ({
|
|
6246
6290
|
formData,
|
|
6247
6291
|
service,
|
|
@@ -6260,7 +6304,7 @@ function useFormService() {
|
|
|
6260
6304
|
},
|
|
6261
6305
|
[env]
|
|
6262
6306
|
);
|
|
6263
|
-
const uploadFile =
|
|
6307
|
+
const uploadFile = useCallback60(
|
|
6264
6308
|
async ({
|
|
6265
6309
|
formData,
|
|
6266
6310
|
service,
|
|
@@ -6280,7 +6324,7 @@ function useFormService() {
|
|
|
6280
6324
|
},
|
|
6281
6325
|
[env]
|
|
6282
6326
|
);
|
|
6283
|
-
const getFormView =
|
|
6327
|
+
const getFormView = useCallback60(
|
|
6284
6328
|
async ({ data }) => {
|
|
6285
6329
|
const jsonData = {
|
|
6286
6330
|
model: data.model,
|
|
@@ -6296,7 +6340,7 @@ function useFormService() {
|
|
|
6296
6340
|
},
|
|
6297
6341
|
[env]
|
|
6298
6342
|
);
|
|
6299
|
-
const changeStatus =
|
|
6343
|
+
const changeStatus = useCallback60(
|
|
6300
6344
|
async ({ data }) => {
|
|
6301
6345
|
const vals = {
|
|
6302
6346
|
[data.name]: data.stage_id
|
|
@@ -6325,7 +6369,7 @@ function useFormService() {
|
|
|
6325
6369
|
},
|
|
6326
6370
|
[env]
|
|
6327
6371
|
);
|
|
6328
|
-
const getExternalTab =
|
|
6372
|
+
const getExternalTab = useCallback60(
|
|
6329
6373
|
async ({ method, context, service, xNode }) => {
|
|
6330
6374
|
return env?.requests?.post(
|
|
6331
6375
|
"/call" /* CALL_PATH */,
|
|
@@ -6360,10 +6404,10 @@ function useFormService() {
|
|
|
6360
6404
|
}
|
|
6361
6405
|
|
|
6362
6406
|
// src/services/kanban-service/index.ts
|
|
6363
|
-
import { useCallback as
|
|
6407
|
+
import { useCallback as useCallback61 } from "react";
|
|
6364
6408
|
function useKanbanService() {
|
|
6365
6409
|
const { env } = useEnv();
|
|
6366
|
-
const getGroups =
|
|
6410
|
+
const getGroups = useCallback61(
|
|
6367
6411
|
async ({ model, width_context }) => {
|
|
6368
6412
|
const jsonData = {
|
|
6369
6413
|
model,
|
|
@@ -6383,7 +6427,7 @@ function useKanbanService() {
|
|
|
6383
6427
|
},
|
|
6384
6428
|
[env]
|
|
6385
6429
|
);
|
|
6386
|
-
const getProgressBar =
|
|
6430
|
+
const getProgressBar = useCallback61(
|
|
6387
6431
|
async ({ field, color, model, width_context }) => {
|
|
6388
6432
|
const jsonData = {
|
|
6389
6433
|
model,
|
|
@@ -6413,10 +6457,10 @@ function useKanbanService() {
|
|
|
6413
6457
|
}
|
|
6414
6458
|
|
|
6415
6459
|
// src/services/model-service/index.ts
|
|
6416
|
-
import { useCallback as
|
|
6460
|
+
import { useCallback as useCallback62 } from "react";
|
|
6417
6461
|
function useModelService() {
|
|
6418
6462
|
const { env } = useEnv();
|
|
6419
|
-
const getListMyBankAccount =
|
|
6463
|
+
const getListMyBankAccount = useCallback62(
|
|
6420
6464
|
async ({
|
|
6421
6465
|
domain,
|
|
6422
6466
|
spectification,
|
|
@@ -6440,7 +6484,7 @@ function useModelService() {
|
|
|
6440
6484
|
},
|
|
6441
6485
|
[env]
|
|
6442
6486
|
);
|
|
6443
|
-
const getCurrency =
|
|
6487
|
+
const getCurrency = useCallback62(async () => {
|
|
6444
6488
|
const jsonData = {
|
|
6445
6489
|
model: "res.currency",
|
|
6446
6490
|
method: "web_search_read",
|
|
@@ -6460,7 +6504,7 @@ function useModelService() {
|
|
|
6460
6504
|
}
|
|
6461
6505
|
});
|
|
6462
6506
|
}, [env]);
|
|
6463
|
-
const getConversionRate =
|
|
6507
|
+
const getConversionRate = useCallback62(async () => {
|
|
6464
6508
|
const jsonData = {
|
|
6465
6509
|
model: "res.currency",
|
|
6466
6510
|
method: "web_search_read",
|
|
@@ -6486,7 +6530,7 @@ function useModelService() {
|
|
|
6486
6530
|
}
|
|
6487
6531
|
});
|
|
6488
6532
|
}, [env]);
|
|
6489
|
-
const getAll =
|
|
6533
|
+
const getAll = useCallback62(
|
|
6490
6534
|
async ({
|
|
6491
6535
|
data,
|
|
6492
6536
|
service,
|
|
@@ -6528,7 +6572,7 @@ function useModelService() {
|
|
|
6528
6572
|
},
|
|
6529
6573
|
[env]
|
|
6530
6574
|
);
|
|
6531
|
-
const getListCalendar =
|
|
6575
|
+
const getListCalendar = useCallback62(
|
|
6532
6576
|
async ({ data }) => {
|
|
6533
6577
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6534
6578
|
fields: data.fields,
|
|
@@ -6559,7 +6603,7 @@ function useModelService() {
|
|
|
6559
6603
|
},
|
|
6560
6604
|
[env]
|
|
6561
6605
|
);
|
|
6562
|
-
const getList =
|
|
6606
|
+
const getList = useCallback62(
|
|
6563
6607
|
async ({
|
|
6564
6608
|
model,
|
|
6565
6609
|
ids = [],
|
|
@@ -6591,7 +6635,7 @@ function useModelService() {
|
|
|
6591
6635
|
},
|
|
6592
6636
|
[env]
|
|
6593
6637
|
);
|
|
6594
|
-
const getDetail =
|
|
6638
|
+
const getDetail = useCallback62(
|
|
6595
6639
|
async ({
|
|
6596
6640
|
ids = [],
|
|
6597
6641
|
model,
|
|
@@ -6623,7 +6667,7 @@ function useModelService() {
|
|
|
6623
6667
|
},
|
|
6624
6668
|
[env]
|
|
6625
6669
|
);
|
|
6626
|
-
const save =
|
|
6670
|
+
const save = useCallback62(
|
|
6627
6671
|
async ({
|
|
6628
6672
|
model,
|
|
6629
6673
|
ids = [],
|
|
@@ -6658,7 +6702,7 @@ function useModelService() {
|
|
|
6658
6702
|
},
|
|
6659
6703
|
[env]
|
|
6660
6704
|
);
|
|
6661
|
-
const deleteApi =
|
|
6705
|
+
const deleteApi = useCallback62(
|
|
6662
6706
|
async ({ ids = [], model, service }) => {
|
|
6663
6707
|
const jsonData = {
|
|
6664
6708
|
model,
|
|
@@ -6678,7 +6722,7 @@ function useModelService() {
|
|
|
6678
6722
|
},
|
|
6679
6723
|
[env]
|
|
6680
6724
|
);
|
|
6681
|
-
const onChange =
|
|
6725
|
+
const onChange = useCallback62(
|
|
6682
6726
|
async ({
|
|
6683
6727
|
ids = [],
|
|
6684
6728
|
model,
|
|
@@ -6714,7 +6758,7 @@ function useModelService() {
|
|
|
6714
6758
|
},
|
|
6715
6759
|
[env]
|
|
6716
6760
|
);
|
|
6717
|
-
const getListFieldsOnchange =
|
|
6761
|
+
const getListFieldsOnchange = useCallback62(
|
|
6718
6762
|
async ({
|
|
6719
6763
|
model,
|
|
6720
6764
|
service,
|
|
@@ -6738,7 +6782,7 @@ function useModelService() {
|
|
|
6738
6782
|
},
|
|
6739
6783
|
[env]
|
|
6740
6784
|
);
|
|
6741
|
-
const parseORMOdoo =
|
|
6785
|
+
const parseORMOdoo = useCallback62((data) => {
|
|
6742
6786
|
for (const key in data) {
|
|
6743
6787
|
if (key === "display_name") {
|
|
6744
6788
|
delete data[key];
|
|
@@ -6749,7 +6793,7 @@ function useModelService() {
|
|
|
6749
6793
|
}
|
|
6750
6794
|
return { ...data };
|
|
6751
6795
|
}, []);
|
|
6752
|
-
const toDataJS =
|
|
6796
|
+
const toDataJS = useCallback62(
|
|
6753
6797
|
(data, viewData, model) => {
|
|
6754
6798
|
for (const key in data) {
|
|
6755
6799
|
if (data[key] === false) {
|
|
@@ -6807,10 +6851,10 @@ function useModelService() {
|
|
|
6807
6851
|
}
|
|
6808
6852
|
|
|
6809
6853
|
// src/services/user-service/index.ts
|
|
6810
|
-
import { useCallback as
|
|
6854
|
+
import { useCallback as useCallback63 } from "react";
|
|
6811
6855
|
function useUserService() {
|
|
6812
6856
|
const { env } = useEnv();
|
|
6813
|
-
const getProfile =
|
|
6857
|
+
const getProfile = useCallback63(
|
|
6814
6858
|
async (service, path, extraHeaders) => {
|
|
6815
6859
|
return env?.requests?.get(
|
|
6816
6860
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -6827,7 +6871,7 @@ function useUserService() {
|
|
|
6827
6871
|
},
|
|
6828
6872
|
[env]
|
|
6829
6873
|
);
|
|
6830
|
-
const getUser =
|
|
6874
|
+
const getUser = useCallback63(
|
|
6831
6875
|
async ({ context, id }) => {
|
|
6832
6876
|
const jsonData = {
|
|
6833
6877
|
model: "res.users",
|
|
@@ -6865,7 +6909,7 @@ function useUserService() {
|
|
|
6865
6909
|
},
|
|
6866
6910
|
[env]
|
|
6867
6911
|
);
|
|
6868
|
-
const switchUserLocale =
|
|
6912
|
+
const switchUserLocale = useCallback63(
|
|
6869
6913
|
async ({ id, values, service }) => {
|
|
6870
6914
|
const jsonData = {
|
|
6871
6915
|
model: "res.users",
|
|
@@ -6893,10 +6937,10 @@ function useUserService() {
|
|
|
6893
6937
|
}
|
|
6894
6938
|
|
|
6895
6939
|
// src/services/view-service/index.ts
|
|
6896
|
-
import { useCallback as
|
|
6940
|
+
import { useCallback as useCallback64 } from "react";
|
|
6897
6941
|
function useViewService() {
|
|
6898
6942
|
const { env } = useEnv();
|
|
6899
|
-
const getView =
|
|
6943
|
+
const getView = useCallback64(
|
|
6900
6944
|
async ({
|
|
6901
6945
|
model,
|
|
6902
6946
|
views,
|
|
@@ -6936,7 +6980,7 @@ function useViewService() {
|
|
|
6936
6980
|
},
|
|
6937
6981
|
[env]
|
|
6938
6982
|
);
|
|
6939
|
-
const getMenu =
|
|
6983
|
+
const getMenu = useCallback64(
|
|
6940
6984
|
async (context, specification, domain, service) => {
|
|
6941
6985
|
const jsonData = {
|
|
6942
6986
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -6967,7 +7011,7 @@ function useViewService() {
|
|
|
6967
7011
|
},
|
|
6968
7012
|
[env]
|
|
6969
7013
|
);
|
|
6970
|
-
const getActionDetail =
|
|
7014
|
+
const getActionDetail = useCallback64(
|
|
6971
7015
|
async (aid, context) => {
|
|
6972
7016
|
const jsonData = {
|
|
6973
7017
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -6997,7 +7041,7 @@ function useViewService() {
|
|
|
6997
7041
|
},
|
|
6998
7042
|
[env]
|
|
6999
7043
|
);
|
|
7000
|
-
const getResequence =
|
|
7044
|
+
const getResequence = useCallback64(
|
|
7001
7045
|
async ({
|
|
7002
7046
|
model,
|
|
7003
7047
|
ids,
|
|
@@ -7027,7 +7071,7 @@ function useViewService() {
|
|
|
7027
7071
|
},
|
|
7028
7072
|
[env]
|
|
7029
7073
|
);
|
|
7030
|
-
const getSelectionItem =
|
|
7074
|
+
const getSelectionItem = useCallback64(
|
|
7031
7075
|
async ({
|
|
7032
7076
|
data,
|
|
7033
7077
|
service,
|
|
@@ -7064,7 +7108,7 @@ function useViewService() {
|
|
|
7064
7108
|
},
|
|
7065
7109
|
[env]
|
|
7066
7110
|
);
|
|
7067
|
-
const loadMessages =
|
|
7111
|
+
const loadMessages = useCallback64(async () => {
|
|
7068
7112
|
return env.requests.post(
|
|
7069
7113
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
7070
7114
|
{},
|
|
@@ -7075,14 +7119,14 @@ function useViewService() {
|
|
|
7075
7119
|
}
|
|
7076
7120
|
);
|
|
7077
7121
|
}, [env]);
|
|
7078
|
-
const getVersion =
|
|
7122
|
+
const getVersion = useCallback64(async () => {
|
|
7079
7123
|
return env?.requests?.get("", {
|
|
7080
7124
|
headers: {
|
|
7081
7125
|
"Content-Type": "application/json"
|
|
7082
7126
|
}
|
|
7083
7127
|
});
|
|
7084
7128
|
}, [env]);
|
|
7085
|
-
const grantAccess =
|
|
7129
|
+
const grantAccess = useCallback64(
|
|
7086
7130
|
async ({
|
|
7087
7131
|
redirect_uri,
|
|
7088
7132
|
state,
|
|
@@ -7109,7 +7153,7 @@ function useViewService() {
|
|
|
7109
7153
|
},
|
|
7110
7154
|
[env]
|
|
7111
7155
|
);
|
|
7112
|
-
const removeTotpSetUp =
|
|
7156
|
+
const removeTotpSetUp = useCallback64(
|
|
7113
7157
|
async ({ method, token }) => {
|
|
7114
7158
|
const jsonData = {
|
|
7115
7159
|
method,
|
|
@@ -7130,7 +7174,7 @@ function useViewService() {
|
|
|
7130
7174
|
},
|
|
7131
7175
|
[env]
|
|
7132
7176
|
);
|
|
7133
|
-
const requestSetupTotp =
|
|
7177
|
+
const requestSetupTotp = useCallback64(
|
|
7134
7178
|
async ({ method, token }) => {
|
|
7135
7179
|
const jsonData = {
|
|
7136
7180
|
method,
|
|
@@ -7149,7 +7193,7 @@ function useViewService() {
|
|
|
7149
7193
|
},
|
|
7150
7194
|
[env]
|
|
7151
7195
|
);
|
|
7152
|
-
const settingsWebRead2fa =
|
|
7196
|
+
const settingsWebRead2fa = useCallback64(
|
|
7153
7197
|
async ({
|
|
7154
7198
|
method,
|
|
7155
7199
|
model,
|
|
@@ -7177,7 +7221,7 @@ function useViewService() {
|
|
|
7177
7221
|
},
|
|
7178
7222
|
[env]
|
|
7179
7223
|
);
|
|
7180
|
-
const signInSSO =
|
|
7224
|
+
const signInSSO = useCallback64(
|
|
7181
7225
|
async ({
|
|
7182
7226
|
redirect_uri,
|
|
7183
7227
|
state,
|
|
@@ -7209,7 +7253,7 @@ function useViewService() {
|
|
|
7209
7253
|
},
|
|
7210
7254
|
[env]
|
|
7211
7255
|
);
|
|
7212
|
-
const verify2FA =
|
|
7256
|
+
const verify2FA = useCallback64(
|
|
7213
7257
|
({
|
|
7214
7258
|
method,
|
|
7215
7259
|
with_context,
|
|
@@ -7242,7 +7286,7 @@ function useViewService() {
|
|
|
7242
7286
|
},
|
|
7243
7287
|
[env]
|
|
7244
7288
|
);
|
|
7245
|
-
const get2FAMethods =
|
|
7289
|
+
const get2FAMethods = useCallback64(
|
|
7246
7290
|
({ method, with_context }) => {
|
|
7247
7291
|
const jsonData = {
|
|
7248
7292
|
method,
|
|
@@ -7261,7 +7305,7 @@ function useViewService() {
|
|
|
7261
7305
|
},
|
|
7262
7306
|
[env]
|
|
7263
7307
|
);
|
|
7264
|
-
const verifyTotp =
|
|
7308
|
+
const verifyTotp = useCallback64(
|
|
7265
7309
|
({
|
|
7266
7310
|
method,
|
|
7267
7311
|
action_token,
|
|
@@ -7286,7 +7330,7 @@ function useViewService() {
|
|
|
7286
7330
|
},
|
|
7287
7331
|
[env]
|
|
7288
7332
|
);
|
|
7289
|
-
const getNotifications =
|
|
7333
|
+
const getNotifications = useCallback64(
|
|
7290
7334
|
async ({
|
|
7291
7335
|
service,
|
|
7292
7336
|
xNode,
|
|
@@ -7306,7 +7350,7 @@ function useViewService() {
|
|
|
7306
7350
|
},
|
|
7307
7351
|
[env]
|
|
7308
7352
|
);
|
|
7309
|
-
const getCountry =
|
|
7353
|
+
const getCountry = useCallback64(
|
|
7310
7354
|
async ({
|
|
7311
7355
|
service,
|
|
7312
7356
|
xNode,
|
|
@@ -7333,7 +7377,7 @@ function useViewService() {
|
|
|
7333
7377
|
},
|
|
7334
7378
|
[env]
|
|
7335
7379
|
);
|
|
7336
|
-
const getCity =
|
|
7380
|
+
const getCity = useCallback64(
|
|
7337
7381
|
async ({
|
|
7338
7382
|
service,
|
|
7339
7383
|
xNode,
|
|
@@ -7360,7 +7404,7 @@ function useViewService() {
|
|
|
7360
7404
|
},
|
|
7361
7405
|
[env]
|
|
7362
7406
|
);
|
|
7363
|
-
const getWard =
|
|
7407
|
+
const getWard = useCallback64(
|
|
7364
7408
|
async ({
|
|
7365
7409
|
service,
|
|
7366
7410
|
xNode,
|
|
@@ -7385,7 +7429,7 @@ function useViewService() {
|
|
|
7385
7429
|
},
|
|
7386
7430
|
[env]
|
|
7387
7431
|
);
|
|
7388
|
-
const getPartnerTitle =
|
|
7432
|
+
const getPartnerTitle = useCallback64(
|
|
7389
7433
|
async ({
|
|
7390
7434
|
service,
|
|
7391
7435
|
xNode,
|
|
@@ -7437,10 +7481,10 @@ function useViewService() {
|
|
|
7437
7481
|
}
|
|
7438
7482
|
|
|
7439
7483
|
// src/services/dashboard-service/index.ts
|
|
7440
|
-
import { useCallback as
|
|
7484
|
+
import { useCallback as useCallback65 } from "react";
|
|
7441
7485
|
function useDashboardService() {
|
|
7442
7486
|
const { env } = useEnv();
|
|
7443
|
-
const readGroup =
|
|
7487
|
+
const readGroup = useCallback65(
|
|
7444
7488
|
async ({
|
|
7445
7489
|
service,
|
|
7446
7490
|
xNode,
|
|
@@ -7457,7 +7501,7 @@ function useDashboardService() {
|
|
|
7457
7501
|
},
|
|
7458
7502
|
[env]
|
|
7459
7503
|
);
|
|
7460
|
-
const getDataChart =
|
|
7504
|
+
const getDataChart = useCallback65(
|
|
7461
7505
|
async ({
|
|
7462
7506
|
service,
|
|
7463
7507
|
xNode,
|