@fctc/interface-logic 4.8.5 → 4.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants.d.mts +5 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.js +5 -0
- package/dist/constants.mjs +5 -0
- package/dist/hooks.js +119 -3
- package/dist/hooks.mjs +119 -3
- package/dist/provider.js +140 -24
- package/dist/provider.mjs +129 -13
- package/dist/services.d.mts +31 -0
- package/dist/services.d.ts +31 -0
- package/dist/services.js +213 -97
- package/dist/services.mjs +210 -94
- package/package.json +1 -1
package/dist/services.js
CHANGED
|
@@ -45,7 +45,7 @@ __export(services_exports, {
|
|
|
45
45
|
module.exports = __toCommonJS(services_exports);
|
|
46
46
|
|
|
47
47
|
// src/services/action-service/index.ts
|
|
48
|
-
var
|
|
48
|
+
var import_react61 = require("react");
|
|
49
49
|
|
|
50
50
|
// src/constants/api/uri-constant.ts
|
|
51
51
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -2956,7 +2956,7 @@ function useEnv() {
|
|
|
2956
2956
|
}
|
|
2957
2957
|
|
|
2958
2958
|
// src/provider/service-provider.tsx
|
|
2959
|
-
var
|
|
2959
|
+
var import_react59 = require("react");
|
|
2960
2960
|
|
|
2961
2961
|
// src/hooks/auth/use-forgot-password.ts
|
|
2962
2962
|
var import_react_query3 = require("@tanstack/react-query");
|
|
@@ -5039,6 +5039,110 @@ var createPaymentSupabaseService = () => {
|
|
|
5039
5039
|
};
|
|
5040
5040
|
};
|
|
5041
5041
|
|
|
5042
|
+
// src/services/pos-service/supabase/create-customer.ts
|
|
5043
|
+
var import_react56 = require("react");
|
|
5044
|
+
var createCustomerSupabaseService = () => {
|
|
5045
|
+
const supabase = useSupabaseOptional();
|
|
5046
|
+
const createCustomerSupabase = (0, import_react56.useCallback)(
|
|
5047
|
+
async (values) => {
|
|
5048
|
+
if (!supabase) {
|
|
5049
|
+
console.error("Supabase client not initialized");
|
|
5050
|
+
return null;
|
|
5051
|
+
}
|
|
5052
|
+
try {
|
|
5053
|
+
const insertData = cleanObject({
|
|
5054
|
+
name: values.name,
|
|
5055
|
+
phone: values.phone,
|
|
5056
|
+
email: values.email,
|
|
5057
|
+
address: values.address,
|
|
5058
|
+
street2: values.street2,
|
|
5059
|
+
city: values.city,
|
|
5060
|
+
birth_date: values.birth_date,
|
|
5061
|
+
country_id: values.country_id,
|
|
5062
|
+
state_id: values.state_id,
|
|
5063
|
+
ward_id: values.ward_id
|
|
5064
|
+
});
|
|
5065
|
+
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).insert(insertData).select("id, name").single();
|
|
5066
|
+
if (error) {
|
|
5067
|
+
console.error("Error creating customer:", error);
|
|
5068
|
+
return null;
|
|
5069
|
+
}
|
|
5070
|
+
return [[data.id, data.name]];
|
|
5071
|
+
} catch (error) {
|
|
5072
|
+
console.error("Error creating customer:", error);
|
|
5073
|
+
return null;
|
|
5074
|
+
}
|
|
5075
|
+
},
|
|
5076
|
+
[supabase]
|
|
5077
|
+
);
|
|
5078
|
+
return {
|
|
5079
|
+
createCustomerSupabase
|
|
5080
|
+
};
|
|
5081
|
+
};
|
|
5082
|
+
|
|
5083
|
+
// src/services/pos-service/supabase/update-customer.ts
|
|
5084
|
+
var import_react57 = require("react");
|
|
5085
|
+
var updateCustomerSupabaseService = () => {
|
|
5086
|
+
const supabase = useSupabaseOptional();
|
|
5087
|
+
const updateCustomerSupabase = (0, import_react57.useCallback)(
|
|
5088
|
+
async (values) => {
|
|
5089
|
+
if (!supabase) {
|
|
5090
|
+
console.error("Supabase client not initialized");
|
|
5091
|
+
return null;
|
|
5092
|
+
}
|
|
5093
|
+
try {
|
|
5094
|
+
const { customer_id, ...rest } = values;
|
|
5095
|
+
const updateData = cleanObject({
|
|
5096
|
+
...rest,
|
|
5097
|
+
write_date: (/* @__PURE__ */ new Date()).toISOString()
|
|
5098
|
+
});
|
|
5099
|
+
const { data, error } = await supabase.from("customers" /* CUSTOMERS */).update(updateData).eq("id", customer_id).select("id").single();
|
|
5100
|
+
if (error) {
|
|
5101
|
+
console.error("Error updating customer:", error);
|
|
5102
|
+
return null;
|
|
5103
|
+
}
|
|
5104
|
+
return [data.id];
|
|
5105
|
+
} catch (error) {
|
|
5106
|
+
console.error("Error updating customer:", error);
|
|
5107
|
+
return null;
|
|
5108
|
+
}
|
|
5109
|
+
},
|
|
5110
|
+
[supabase]
|
|
5111
|
+
);
|
|
5112
|
+
return {
|
|
5113
|
+
updateCustomerSupabase
|
|
5114
|
+
};
|
|
5115
|
+
};
|
|
5116
|
+
|
|
5117
|
+
// src/services/pos-service/supabase/delete-customer.ts
|
|
5118
|
+
var import_react58 = require("react");
|
|
5119
|
+
var deleteCustomerSupabaseService = () => {
|
|
5120
|
+
const supabase = useSupabaseOptional();
|
|
5121
|
+
const deleteCustomerSupabase = (0, import_react58.useCallback)(
|
|
5122
|
+
async (values) => {
|
|
5123
|
+
if (!supabase) {
|
|
5124
|
+
console.error("Supabase client not initialized");
|
|
5125
|
+
return null;
|
|
5126
|
+
}
|
|
5127
|
+
try {
|
|
5128
|
+
const { error } = await supabase.from("customers" /* CUSTOMERS */).delete().eq("id", values.customer_id);
|
|
5129
|
+
if (error) {
|
|
5130
|
+
console.error("Error deleting customer:", error);
|
|
5131
|
+
return null;
|
|
5132
|
+
}
|
|
5133
|
+
return [values.customer_id];
|
|
5134
|
+
} catch (error) {
|
|
5135
|
+
console.error("Error deleting customer:", error);
|
|
5136
|
+
return null;
|
|
5137
|
+
}
|
|
5138
|
+
},
|
|
5139
|
+
[supabase]
|
|
5140
|
+
);
|
|
5141
|
+
return {
|
|
5142
|
+
deleteCustomerSupabase
|
|
5143
|
+
};
|
|
5144
|
+
};
|
|
5145
|
+
|
|
5042
5146
|
// src/services/pos-service/index.ts
|
|
5043
5147
|
var serviceFactories = [
|
|
5044
5148
|
addEntityService,
|
|
@@ -5089,7 +5193,10 @@ var serviceFactories = [
|
|
|
5089
5193
|
getFunctionalModulesService,
|
|
5090
5194
|
addPaymentMethodSupabaseService,
|
|
5091
5195
|
updateSessionPaymentMethodsSupabaseService,
|
|
5092
|
-
createPaymentSupabaseService
|
|
5196
|
+
createPaymentSupabaseService,
|
|
5197
|
+
createCustomerSupabaseService,
|
|
5198
|
+
updateCustomerSupabaseService,
|
|
5199
|
+
deleteCustomerSupabaseService
|
|
5093
5200
|
];
|
|
5094
5201
|
var usePosService = () => {
|
|
5095
5202
|
const { env } = useEnv();
|
|
@@ -5245,18 +5352,27 @@ var import_react_query132 = require("@tanstack/react-query");
|
|
|
5245
5352
|
// src/hooks/pos/supabase/use-create-payment.ts
|
|
5246
5353
|
var import_react_query133 = require("@tanstack/react-query");
|
|
5247
5354
|
|
|
5355
|
+
// src/hooks/pos/supabase/use-create-customer.ts
|
|
5356
|
+
var import_react_query134 = require("@tanstack/react-query");
|
|
5357
|
+
|
|
5358
|
+
// src/hooks/pos/supabase/use-update-customer.ts
|
|
5359
|
+
var import_react_query135 = require("@tanstack/react-query");
|
|
5360
|
+
|
|
5361
|
+
// src/hooks/pos/supabase/use-delete-customer.ts
|
|
5362
|
+
var import_react_query136 = require("@tanstack/react-query");
|
|
5363
|
+
|
|
5248
5364
|
// src/provider/service-provider.tsx
|
|
5249
5365
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
5250
|
-
var ServiceContext = (0,
|
|
5366
|
+
var ServiceContext = (0, import_react59.createContext)(null);
|
|
5251
5367
|
|
|
5252
5368
|
// src/provider/meta-provider.tsx
|
|
5253
|
-
var
|
|
5369
|
+
var import_react60 = require("react");
|
|
5254
5370
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
5255
5371
|
|
|
5256
5372
|
// src/services/action-service/index.ts
|
|
5257
5373
|
function useActionService() {
|
|
5258
5374
|
const { env } = useEnv();
|
|
5259
|
-
const loadAction = (0,
|
|
5375
|
+
const loadAction = (0, import_react61.useCallback)(
|
|
5260
5376
|
async ({
|
|
5261
5377
|
idAction,
|
|
5262
5378
|
context,
|
|
@@ -5280,7 +5396,7 @@ function useActionService() {
|
|
|
5280
5396
|
},
|
|
5281
5397
|
[env]
|
|
5282
5398
|
);
|
|
5283
|
-
const callButton = (0,
|
|
5399
|
+
const callButton = (0, import_react61.useCallback)(
|
|
5284
5400
|
async ({
|
|
5285
5401
|
model,
|
|
5286
5402
|
ids = [],
|
|
@@ -5314,7 +5430,7 @@ function useActionService() {
|
|
|
5314
5430
|
},
|
|
5315
5431
|
[env]
|
|
5316
5432
|
);
|
|
5317
|
-
const removeRows = (0,
|
|
5433
|
+
const removeRows = (0, import_react61.useCallback)(
|
|
5318
5434
|
async ({
|
|
5319
5435
|
model,
|
|
5320
5436
|
ids,
|
|
@@ -5340,7 +5456,7 @@ function useActionService() {
|
|
|
5340
5456
|
},
|
|
5341
5457
|
[env]
|
|
5342
5458
|
);
|
|
5343
|
-
const duplicateRecord = (0,
|
|
5459
|
+
const duplicateRecord = (0, import_react61.useCallback)(
|
|
5344
5460
|
async ({
|
|
5345
5461
|
model,
|
|
5346
5462
|
id,
|
|
@@ -5366,7 +5482,7 @@ function useActionService() {
|
|
|
5366
5482
|
},
|
|
5367
5483
|
[env]
|
|
5368
5484
|
);
|
|
5369
|
-
const getPrintReportName = (0,
|
|
5485
|
+
const getPrintReportName = (0, import_react61.useCallback)(
|
|
5370
5486
|
async ({ id }) => {
|
|
5371
5487
|
const jsonData = {
|
|
5372
5488
|
model: "ir.actions.report",
|
|
@@ -5384,7 +5500,7 @@ function useActionService() {
|
|
|
5384
5500
|
},
|
|
5385
5501
|
[env]
|
|
5386
5502
|
);
|
|
5387
|
-
const print = (0,
|
|
5503
|
+
const print = (0, import_react61.useCallback)(
|
|
5388
5504
|
async ({ id, report, db }) => {
|
|
5389
5505
|
const jsonData = {
|
|
5390
5506
|
report,
|
|
@@ -5402,7 +5518,7 @@ function useActionService() {
|
|
|
5402
5518
|
},
|
|
5403
5519
|
[env]
|
|
5404
5520
|
);
|
|
5405
|
-
const runAction = (0,
|
|
5521
|
+
const runAction = (0, import_react61.useCallback)(
|
|
5406
5522
|
async ({
|
|
5407
5523
|
idAction,
|
|
5408
5524
|
context,
|
|
@@ -5429,7 +5545,7 @@ function useActionService() {
|
|
|
5429
5545
|
},
|
|
5430
5546
|
[env]
|
|
5431
5547
|
);
|
|
5432
|
-
const generateSerialNumber = (0,
|
|
5548
|
+
const generateSerialNumber = (0, import_react61.useCallback)(
|
|
5433
5549
|
async ({
|
|
5434
5550
|
kwargs,
|
|
5435
5551
|
context,
|
|
@@ -5467,11 +5583,11 @@ function useActionService() {
|
|
|
5467
5583
|
}
|
|
5468
5584
|
|
|
5469
5585
|
// src/services/auth-service/index.ts
|
|
5470
|
-
var
|
|
5586
|
+
var import_react62 = require("react");
|
|
5471
5587
|
function useAuthService() {
|
|
5472
5588
|
const { env } = useEnv();
|
|
5473
5589
|
const supabase = useSupabaseOptional();
|
|
5474
|
-
const login = (0,
|
|
5590
|
+
const login = (0, import_react62.useCallback)(
|
|
5475
5591
|
async (body) => {
|
|
5476
5592
|
const payload = Object.fromEntries(
|
|
5477
5593
|
Object.entries({
|
|
@@ -5496,7 +5612,7 @@ function useAuthService() {
|
|
|
5496
5612
|
},
|
|
5497
5613
|
[env]
|
|
5498
5614
|
);
|
|
5499
|
-
const loginSupabase = (0,
|
|
5615
|
+
const loginSupabase = (0, import_react62.useCallback)(
|
|
5500
5616
|
async (body) => {
|
|
5501
5617
|
if (!supabase) {
|
|
5502
5618
|
return {
|
|
@@ -5512,7 +5628,7 @@ function useAuthService() {
|
|
|
5512
5628
|
},
|
|
5513
5629
|
[supabase]
|
|
5514
5630
|
);
|
|
5515
|
-
const forgotPassword = (0,
|
|
5631
|
+
const forgotPassword = (0, import_react62.useCallback)(
|
|
5516
5632
|
async (email) => {
|
|
5517
5633
|
const bodyData = {
|
|
5518
5634
|
login: email,
|
|
@@ -5526,7 +5642,7 @@ function useAuthService() {
|
|
|
5526
5642
|
},
|
|
5527
5643
|
[env]
|
|
5528
5644
|
);
|
|
5529
|
-
const forgotPasswordSSO = (0,
|
|
5645
|
+
const forgotPasswordSSO = (0, import_react62.useCallback)(
|
|
5530
5646
|
async ({
|
|
5531
5647
|
email,
|
|
5532
5648
|
with_context,
|
|
@@ -5549,7 +5665,7 @@ function useAuthService() {
|
|
|
5549
5665
|
},
|
|
5550
5666
|
[env]
|
|
5551
5667
|
);
|
|
5552
|
-
const resetPassword = (0,
|
|
5668
|
+
const resetPassword = (0, import_react62.useCallback)(
|
|
5553
5669
|
async (data, token) => {
|
|
5554
5670
|
const bodyData = {
|
|
5555
5671
|
token,
|
|
@@ -5564,7 +5680,7 @@ function useAuthService() {
|
|
|
5564
5680
|
},
|
|
5565
5681
|
[env]
|
|
5566
5682
|
);
|
|
5567
|
-
const resetPasswordSSO = (0,
|
|
5683
|
+
const resetPasswordSSO = (0, import_react62.useCallback)(
|
|
5568
5684
|
async ({
|
|
5569
5685
|
method,
|
|
5570
5686
|
password,
|
|
@@ -5587,7 +5703,7 @@ function useAuthService() {
|
|
|
5587
5703
|
},
|
|
5588
5704
|
[env]
|
|
5589
5705
|
);
|
|
5590
|
-
const updatePassword = (0,
|
|
5706
|
+
const updatePassword = (0, import_react62.useCallback)(
|
|
5591
5707
|
async (data, token) => {
|
|
5592
5708
|
const bodyData = {
|
|
5593
5709
|
token,
|
|
@@ -5602,7 +5718,7 @@ function useAuthService() {
|
|
|
5602
5718
|
},
|
|
5603
5719
|
[env]
|
|
5604
5720
|
);
|
|
5605
|
-
const isValidToken = (0,
|
|
5721
|
+
const isValidToken = (0, import_react62.useCallback)(
|
|
5606
5722
|
async (token) => {
|
|
5607
5723
|
const bodyData = {
|
|
5608
5724
|
token
|
|
@@ -5615,7 +5731,7 @@ function useAuthService() {
|
|
|
5615
5731
|
},
|
|
5616
5732
|
[env]
|
|
5617
5733
|
);
|
|
5618
|
-
const isValidActionToken = (0,
|
|
5734
|
+
const isValidActionToken = (0, import_react62.useCallback)(
|
|
5619
5735
|
async (actionToken) => {
|
|
5620
5736
|
const bodyData = {};
|
|
5621
5737
|
return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
|
|
@@ -5628,7 +5744,7 @@ function useAuthService() {
|
|
|
5628
5744
|
},
|
|
5629
5745
|
[env]
|
|
5630
5746
|
);
|
|
5631
|
-
const loginSocial = (0,
|
|
5747
|
+
const loginSocial = (0, import_react62.useCallback)(
|
|
5632
5748
|
async ({
|
|
5633
5749
|
db,
|
|
5634
5750
|
state,
|
|
@@ -5646,13 +5762,13 @@ function useAuthService() {
|
|
|
5646
5762
|
},
|
|
5647
5763
|
[env]
|
|
5648
5764
|
);
|
|
5649
|
-
const getProviders = (0,
|
|
5765
|
+
const getProviders = (0, import_react62.useCallback)(
|
|
5650
5766
|
async (db) => {
|
|
5651
5767
|
return env?.requests?.get("/oauth/providers", { params: { db } });
|
|
5652
5768
|
},
|
|
5653
5769
|
[env]
|
|
5654
5770
|
);
|
|
5655
|
-
const getAccessByCode = (0,
|
|
5771
|
+
const getAccessByCode = (0, import_react62.useCallback)(
|
|
5656
5772
|
async (code) => {
|
|
5657
5773
|
const data = new URLSearchParams();
|
|
5658
5774
|
data.append("code", code);
|
|
@@ -5672,7 +5788,7 @@ function useAuthService() {
|
|
|
5672
5788
|
},
|
|
5673
5789
|
[env]
|
|
5674
5790
|
);
|
|
5675
|
-
const logout = (0,
|
|
5791
|
+
const logout = (0, import_react62.useCallback)(
|
|
5676
5792
|
async (service) => {
|
|
5677
5793
|
return env?.requests?.post(
|
|
5678
5794
|
"/logout" /* LOGOUT */,
|
|
@@ -5689,7 +5805,7 @@ function useAuthService() {
|
|
|
5689
5805
|
},
|
|
5690
5806
|
[env]
|
|
5691
5807
|
);
|
|
5692
|
-
const getTenantMapping = (0,
|
|
5808
|
+
const getTenantMapping = (0, import_react62.useCallback)(
|
|
5693
5809
|
async ({ shortName, service }) => {
|
|
5694
5810
|
const bodyData = {
|
|
5695
5811
|
short_name: shortName
|
|
@@ -5707,7 +5823,7 @@ function useAuthService() {
|
|
|
5707
5823
|
},
|
|
5708
5824
|
[env]
|
|
5709
5825
|
);
|
|
5710
|
-
const getToken = (0,
|
|
5826
|
+
const getToken = (0, import_react62.useCallback)(
|
|
5711
5827
|
async ({
|
|
5712
5828
|
phone,
|
|
5713
5829
|
name,
|
|
@@ -5752,10 +5868,10 @@ function useAuthService() {
|
|
|
5752
5868
|
}
|
|
5753
5869
|
|
|
5754
5870
|
// src/services/company-service/index.ts
|
|
5755
|
-
var
|
|
5871
|
+
var import_react63 = require("react");
|
|
5756
5872
|
function useCompanyService() {
|
|
5757
5873
|
const { env } = useEnv();
|
|
5758
|
-
const getCurrentCompany = (0,
|
|
5874
|
+
const getCurrentCompany = (0, import_react63.useCallback)(
|
|
5759
5875
|
async (service, extraHeaders) => {
|
|
5760
5876
|
return await env.requests.get(
|
|
5761
5877
|
"/company" /* COMPANY_PATH */,
|
|
@@ -5772,7 +5888,7 @@ function useCompanyService() {
|
|
|
5772
5888
|
},
|
|
5773
5889
|
[env]
|
|
5774
5890
|
);
|
|
5775
|
-
const getInfoCompany = (0,
|
|
5891
|
+
const getInfoCompany = (0, import_react63.useCallback)(
|
|
5776
5892
|
async (id, service) => {
|
|
5777
5893
|
const jsonData = {
|
|
5778
5894
|
ids: [id],
|
|
@@ -5808,10 +5924,10 @@ function useCompanyService() {
|
|
|
5808
5924
|
}
|
|
5809
5925
|
|
|
5810
5926
|
// src/services/excel-service/index.ts
|
|
5811
|
-
var
|
|
5927
|
+
var import_react64 = require("react");
|
|
5812
5928
|
function useExcelService() {
|
|
5813
5929
|
const { env } = useEnv();
|
|
5814
|
-
const uploadFileExcel = (0,
|
|
5930
|
+
const uploadFileExcel = (0, import_react64.useCallback)(
|
|
5815
5931
|
async ({
|
|
5816
5932
|
formData,
|
|
5817
5933
|
service,
|
|
@@ -5828,7 +5944,7 @@ function useExcelService() {
|
|
|
5828
5944
|
},
|
|
5829
5945
|
[env]
|
|
5830
5946
|
);
|
|
5831
|
-
const uploadIdFile = (0,
|
|
5947
|
+
const uploadIdFile = (0, import_react64.useCallback)(
|
|
5832
5948
|
async ({
|
|
5833
5949
|
formData,
|
|
5834
5950
|
service,
|
|
@@ -5845,7 +5961,7 @@ function useExcelService() {
|
|
|
5845
5961
|
},
|
|
5846
5962
|
[env]
|
|
5847
5963
|
);
|
|
5848
|
-
const parsePreview = (0,
|
|
5964
|
+
const parsePreview = (0, import_react64.useCallback)(
|
|
5849
5965
|
async ({
|
|
5850
5966
|
id,
|
|
5851
5967
|
selectedSheet,
|
|
@@ -5894,7 +6010,7 @@ function useExcelService() {
|
|
|
5894
6010
|
},
|
|
5895
6011
|
[env]
|
|
5896
6012
|
);
|
|
5897
|
-
const executeImport = (0,
|
|
6013
|
+
const executeImport = (0, import_react64.useCallback)(
|
|
5898
6014
|
async ({
|
|
5899
6015
|
columns,
|
|
5900
6016
|
fields,
|
|
@@ -5928,7 +6044,7 @@ function useExcelService() {
|
|
|
5928
6044
|
},
|
|
5929
6045
|
[env]
|
|
5930
6046
|
);
|
|
5931
|
-
const getFileExcel = (0,
|
|
6047
|
+
const getFileExcel = (0, import_react64.useCallback)(
|
|
5932
6048
|
async ({
|
|
5933
6049
|
model,
|
|
5934
6050
|
service,
|
|
@@ -5952,7 +6068,7 @@ function useExcelService() {
|
|
|
5952
6068
|
},
|
|
5953
6069
|
[env]
|
|
5954
6070
|
);
|
|
5955
|
-
const getFieldExport = (0,
|
|
6071
|
+
const getFieldExport = (0, import_react64.useCallback)(
|
|
5956
6072
|
async ({
|
|
5957
6073
|
ids,
|
|
5958
6074
|
model,
|
|
@@ -5992,7 +6108,7 @@ function useExcelService() {
|
|
|
5992
6108
|
},
|
|
5993
6109
|
[env]
|
|
5994
6110
|
);
|
|
5995
|
-
const exportExcel = (0,
|
|
6111
|
+
const exportExcel = (0, import_react64.useCallback)(
|
|
5996
6112
|
async ({
|
|
5997
6113
|
model,
|
|
5998
6114
|
domain,
|
|
@@ -6040,10 +6156,10 @@ function useExcelService() {
|
|
|
6040
6156
|
}
|
|
6041
6157
|
|
|
6042
6158
|
// src/services/form-service/index.ts
|
|
6043
|
-
var
|
|
6159
|
+
var import_react65 = require("react");
|
|
6044
6160
|
function useFormService() {
|
|
6045
6161
|
const { env } = useEnv();
|
|
6046
|
-
const getComment = (0,
|
|
6162
|
+
const getComment = (0, import_react65.useCallback)(
|
|
6047
6163
|
async ({ data }) => {
|
|
6048
6164
|
const jsonData = {
|
|
6049
6165
|
thread_id: data.thread_id,
|
|
@@ -6061,7 +6177,7 @@ function useFormService() {
|
|
|
6061
6177
|
},
|
|
6062
6178
|
[env]
|
|
6063
6179
|
);
|
|
6064
|
-
const getThreadData = (0,
|
|
6180
|
+
const getThreadData = (0, import_react65.useCallback)(
|
|
6065
6181
|
async ({
|
|
6066
6182
|
data,
|
|
6067
6183
|
xNode,
|
|
@@ -6088,7 +6204,7 @@ function useFormService() {
|
|
|
6088
6204
|
},
|
|
6089
6205
|
[env]
|
|
6090
6206
|
);
|
|
6091
|
-
const getThreadMessages = (0,
|
|
6207
|
+
const getThreadMessages = (0, import_react65.useCallback)(
|
|
6092
6208
|
async ({
|
|
6093
6209
|
data,
|
|
6094
6210
|
xNode,
|
|
@@ -6114,7 +6230,7 @@ function useFormService() {
|
|
|
6114
6230
|
},
|
|
6115
6231
|
[env]
|
|
6116
6232
|
);
|
|
6117
|
-
const sentComment = (0,
|
|
6233
|
+
const sentComment = (0, import_react65.useCallback)(
|
|
6118
6234
|
async ({ data }) => {
|
|
6119
6235
|
const jsonData = {
|
|
6120
6236
|
context: {
|
|
@@ -6142,7 +6258,7 @@ function useFormService() {
|
|
|
6142
6258
|
},
|
|
6143
6259
|
[env]
|
|
6144
6260
|
);
|
|
6145
|
-
const deleteComment = (0,
|
|
6261
|
+
const deleteComment = (0, import_react65.useCallback)(
|
|
6146
6262
|
async ({ data }) => {
|
|
6147
6263
|
const jsonData = {
|
|
6148
6264
|
attachment_ids: [],
|
|
@@ -6158,7 +6274,7 @@ function useFormService() {
|
|
|
6158
6274
|
},
|
|
6159
6275
|
[env]
|
|
6160
6276
|
);
|
|
6161
|
-
const getImage = (0,
|
|
6277
|
+
const getImage = (0, import_react65.useCallback)(
|
|
6162
6278
|
async ({ data }) => {
|
|
6163
6279
|
return env.requests.get(
|
|
6164
6280
|
`${"/web/image" /* IMAGE_PATH */}?filename=${data.filename}&unique=${data.checksum}&width=1920&height=300`,
|
|
@@ -6171,7 +6287,7 @@ function useFormService() {
|
|
|
6171
6287
|
},
|
|
6172
6288
|
[env]
|
|
6173
6289
|
);
|
|
6174
|
-
const uploadImage = (0,
|
|
6290
|
+
const uploadImage = (0, import_react65.useCallback)(
|
|
6175
6291
|
async ({
|
|
6176
6292
|
formData,
|
|
6177
6293
|
service,
|
|
@@ -6190,7 +6306,7 @@ function useFormService() {
|
|
|
6190
6306
|
},
|
|
6191
6307
|
[env]
|
|
6192
6308
|
);
|
|
6193
|
-
const uploadFile = (0,
|
|
6309
|
+
const uploadFile = (0, import_react65.useCallback)(
|
|
6194
6310
|
async ({
|
|
6195
6311
|
formData,
|
|
6196
6312
|
service,
|
|
@@ -6210,7 +6326,7 @@ function useFormService() {
|
|
|
6210
6326
|
},
|
|
6211
6327
|
[env]
|
|
6212
6328
|
);
|
|
6213
|
-
const getFormView = (0,
|
|
6329
|
+
const getFormView = (0, import_react65.useCallback)(
|
|
6214
6330
|
async ({ data }) => {
|
|
6215
6331
|
const jsonData = {
|
|
6216
6332
|
model: data.model,
|
|
@@ -6226,7 +6342,7 @@ function useFormService() {
|
|
|
6226
6342
|
},
|
|
6227
6343
|
[env]
|
|
6228
6344
|
);
|
|
6229
|
-
const changeStatus = (0,
|
|
6345
|
+
const changeStatus = (0, import_react65.useCallback)(
|
|
6230
6346
|
async ({ data }) => {
|
|
6231
6347
|
const vals = {
|
|
6232
6348
|
[data.name]: data.stage_id
|
|
@@ -6255,7 +6371,7 @@ function useFormService() {
|
|
|
6255
6371
|
},
|
|
6256
6372
|
[env]
|
|
6257
6373
|
);
|
|
6258
|
-
const getExternalTab = (0,
|
|
6374
|
+
const getExternalTab = (0, import_react65.useCallback)(
|
|
6259
6375
|
async ({ method, context, service, xNode }) => {
|
|
6260
6376
|
return env?.requests?.post(
|
|
6261
6377
|
"/call" /* CALL_PATH */,
|
|
@@ -6290,10 +6406,10 @@ function useFormService() {
|
|
|
6290
6406
|
}
|
|
6291
6407
|
|
|
6292
6408
|
// src/services/kanban-service/index.ts
|
|
6293
|
-
var
|
|
6409
|
+
var import_react66 = require("react");
|
|
6294
6410
|
function useKanbanService() {
|
|
6295
6411
|
const { env } = useEnv();
|
|
6296
|
-
const getGroups = (0,
|
|
6412
|
+
const getGroups = (0, import_react66.useCallback)(
|
|
6297
6413
|
async ({ model, width_context }) => {
|
|
6298
6414
|
const jsonData = {
|
|
6299
6415
|
model,
|
|
@@ -6313,7 +6429,7 @@ function useKanbanService() {
|
|
|
6313
6429
|
},
|
|
6314
6430
|
[env]
|
|
6315
6431
|
);
|
|
6316
|
-
const getProgressBar = (0,
|
|
6432
|
+
const getProgressBar = (0, import_react66.useCallback)(
|
|
6317
6433
|
async ({ field, color, model, width_context }) => {
|
|
6318
6434
|
const jsonData = {
|
|
6319
6435
|
model,
|
|
@@ -6343,10 +6459,10 @@ function useKanbanService() {
|
|
|
6343
6459
|
}
|
|
6344
6460
|
|
|
6345
6461
|
// src/services/model-service/index.ts
|
|
6346
|
-
var
|
|
6462
|
+
var import_react67 = require("react");
|
|
6347
6463
|
function useModelService() {
|
|
6348
6464
|
const { env } = useEnv();
|
|
6349
|
-
const getListMyBankAccount = (0,
|
|
6465
|
+
const getListMyBankAccount = (0, import_react67.useCallback)(
|
|
6350
6466
|
async ({
|
|
6351
6467
|
domain,
|
|
6352
6468
|
spectification,
|
|
@@ -6370,7 +6486,7 @@ function useModelService() {
|
|
|
6370
6486
|
},
|
|
6371
6487
|
[env]
|
|
6372
6488
|
);
|
|
6373
|
-
const getCurrency = (0,
|
|
6489
|
+
const getCurrency = (0, import_react67.useCallback)(async () => {
|
|
6374
6490
|
const jsonData = {
|
|
6375
6491
|
model: "res.currency",
|
|
6376
6492
|
method: "web_search_read",
|
|
@@ -6390,7 +6506,7 @@ function useModelService() {
|
|
|
6390
6506
|
}
|
|
6391
6507
|
});
|
|
6392
6508
|
}, [env]);
|
|
6393
|
-
const getConversionRate = (0,
|
|
6509
|
+
const getConversionRate = (0, import_react67.useCallback)(async () => {
|
|
6394
6510
|
const jsonData = {
|
|
6395
6511
|
model: "res.currency",
|
|
6396
6512
|
method: "web_search_read",
|
|
@@ -6416,7 +6532,7 @@ function useModelService() {
|
|
|
6416
6532
|
}
|
|
6417
6533
|
});
|
|
6418
6534
|
}, [env]);
|
|
6419
|
-
const getAll = (0,
|
|
6535
|
+
const getAll = (0, import_react67.useCallback)(
|
|
6420
6536
|
async ({
|
|
6421
6537
|
data,
|
|
6422
6538
|
service,
|
|
@@ -6458,7 +6574,7 @@ function useModelService() {
|
|
|
6458
6574
|
},
|
|
6459
6575
|
[env]
|
|
6460
6576
|
);
|
|
6461
|
-
const getListCalendar = (0,
|
|
6577
|
+
const getListCalendar = (0, import_react67.useCallback)(
|
|
6462
6578
|
async ({ data }) => {
|
|
6463
6579
|
const jsonReadGroup = data.type == "calendar" ? data?.fields : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
6464
6580
|
fields: data.fields,
|
|
@@ -6489,7 +6605,7 @@ function useModelService() {
|
|
|
6489
6605
|
},
|
|
6490
6606
|
[env]
|
|
6491
6607
|
);
|
|
6492
|
-
const getList = (0,
|
|
6608
|
+
const getList = (0, import_react67.useCallback)(
|
|
6493
6609
|
async ({
|
|
6494
6610
|
model,
|
|
6495
6611
|
ids = [],
|
|
@@ -6521,7 +6637,7 @@ function useModelService() {
|
|
|
6521
6637
|
},
|
|
6522
6638
|
[env]
|
|
6523
6639
|
);
|
|
6524
|
-
const getDetail = (0,
|
|
6640
|
+
const getDetail = (0, import_react67.useCallback)(
|
|
6525
6641
|
async ({
|
|
6526
6642
|
ids = [],
|
|
6527
6643
|
model,
|
|
@@ -6553,7 +6669,7 @@ function useModelService() {
|
|
|
6553
6669
|
},
|
|
6554
6670
|
[env]
|
|
6555
6671
|
);
|
|
6556
|
-
const save = (0,
|
|
6672
|
+
const save = (0, import_react67.useCallback)(
|
|
6557
6673
|
async ({
|
|
6558
6674
|
model,
|
|
6559
6675
|
ids = [],
|
|
@@ -6588,7 +6704,7 @@ function useModelService() {
|
|
|
6588
6704
|
},
|
|
6589
6705
|
[env]
|
|
6590
6706
|
);
|
|
6591
|
-
const deleteApi = (0,
|
|
6707
|
+
const deleteApi = (0, import_react67.useCallback)(
|
|
6592
6708
|
async ({ ids = [], model, service }) => {
|
|
6593
6709
|
const jsonData = {
|
|
6594
6710
|
model,
|
|
@@ -6608,7 +6724,7 @@ function useModelService() {
|
|
|
6608
6724
|
},
|
|
6609
6725
|
[env]
|
|
6610
6726
|
);
|
|
6611
|
-
const onChange = (0,
|
|
6727
|
+
const onChange = (0, import_react67.useCallback)(
|
|
6612
6728
|
async ({
|
|
6613
6729
|
ids = [],
|
|
6614
6730
|
model,
|
|
@@ -6644,7 +6760,7 @@ function useModelService() {
|
|
|
6644
6760
|
},
|
|
6645
6761
|
[env]
|
|
6646
6762
|
);
|
|
6647
|
-
const getListFieldsOnchange = (0,
|
|
6763
|
+
const getListFieldsOnchange = (0, import_react67.useCallback)(
|
|
6648
6764
|
async ({
|
|
6649
6765
|
model,
|
|
6650
6766
|
service,
|
|
@@ -6668,7 +6784,7 @@ function useModelService() {
|
|
|
6668
6784
|
},
|
|
6669
6785
|
[env]
|
|
6670
6786
|
);
|
|
6671
|
-
const parseORMOdoo = (0,
|
|
6787
|
+
const parseORMOdoo = (0, import_react67.useCallback)((data) => {
|
|
6672
6788
|
for (const key in data) {
|
|
6673
6789
|
if (key === "display_name") {
|
|
6674
6790
|
delete data[key];
|
|
@@ -6679,7 +6795,7 @@ function useModelService() {
|
|
|
6679
6795
|
}
|
|
6680
6796
|
return { ...data };
|
|
6681
6797
|
}, []);
|
|
6682
|
-
const toDataJS = (0,
|
|
6798
|
+
const toDataJS = (0, import_react67.useCallback)(
|
|
6683
6799
|
(data, viewData, model) => {
|
|
6684
6800
|
for (const key in data) {
|
|
6685
6801
|
if (data[key] === false) {
|
|
@@ -6737,10 +6853,10 @@ function useModelService() {
|
|
|
6737
6853
|
}
|
|
6738
6854
|
|
|
6739
6855
|
// src/services/user-service/index.ts
|
|
6740
|
-
var
|
|
6856
|
+
var import_react68 = require("react");
|
|
6741
6857
|
function useUserService() {
|
|
6742
6858
|
const { env } = useEnv();
|
|
6743
|
-
const getProfile = (0,
|
|
6859
|
+
const getProfile = (0, import_react68.useCallback)(
|
|
6744
6860
|
async (service, path, extraHeaders) => {
|
|
6745
6861
|
return env?.requests?.get(
|
|
6746
6862
|
path || "/userinfo" /* PROFILE_PATH */,
|
|
@@ -6757,7 +6873,7 @@ function useUserService() {
|
|
|
6757
6873
|
},
|
|
6758
6874
|
[env]
|
|
6759
6875
|
);
|
|
6760
|
-
const getUser = (0,
|
|
6876
|
+
const getUser = (0, import_react68.useCallback)(
|
|
6761
6877
|
async ({ context, id }) => {
|
|
6762
6878
|
const jsonData = {
|
|
6763
6879
|
model: "res.users",
|
|
@@ -6795,7 +6911,7 @@ function useUserService() {
|
|
|
6795
6911
|
},
|
|
6796
6912
|
[env]
|
|
6797
6913
|
);
|
|
6798
|
-
const switchUserLocale = (0,
|
|
6914
|
+
const switchUserLocale = (0, import_react68.useCallback)(
|
|
6799
6915
|
async ({ id, values, service }) => {
|
|
6800
6916
|
const jsonData = {
|
|
6801
6917
|
model: "res.users",
|
|
@@ -6823,10 +6939,10 @@ function useUserService() {
|
|
|
6823
6939
|
}
|
|
6824
6940
|
|
|
6825
6941
|
// src/services/view-service/index.ts
|
|
6826
|
-
var
|
|
6942
|
+
var import_react69 = require("react");
|
|
6827
6943
|
function useViewService() {
|
|
6828
6944
|
const { env } = useEnv();
|
|
6829
|
-
const getView = (0,
|
|
6945
|
+
const getView = (0, import_react69.useCallback)(
|
|
6830
6946
|
async ({
|
|
6831
6947
|
model,
|
|
6832
6948
|
views,
|
|
@@ -6866,7 +6982,7 @@ function useViewService() {
|
|
|
6866
6982
|
},
|
|
6867
6983
|
[env]
|
|
6868
6984
|
);
|
|
6869
|
-
const getMenu = (0,
|
|
6985
|
+
const getMenu = (0, import_react69.useCallback)(
|
|
6870
6986
|
async (context, specification, domain, service) => {
|
|
6871
6987
|
const jsonData = {
|
|
6872
6988
|
model: "ir.ui.menu" /* MENU */,
|
|
@@ -6897,7 +7013,7 @@ function useViewService() {
|
|
|
6897
7013
|
},
|
|
6898
7014
|
[env]
|
|
6899
7015
|
);
|
|
6900
|
-
const getActionDetail = (0,
|
|
7016
|
+
const getActionDetail = (0, import_react69.useCallback)(
|
|
6901
7017
|
async (aid, context) => {
|
|
6902
7018
|
const jsonData = {
|
|
6903
7019
|
model: "ir.actions.act_window" /* WINDOW_ACTION */,
|
|
@@ -6927,7 +7043,7 @@ function useViewService() {
|
|
|
6927
7043
|
},
|
|
6928
7044
|
[env]
|
|
6929
7045
|
);
|
|
6930
|
-
const getResequence = (0,
|
|
7046
|
+
const getResequence = (0, import_react69.useCallback)(
|
|
6931
7047
|
async ({
|
|
6932
7048
|
model,
|
|
6933
7049
|
ids,
|
|
@@ -6957,7 +7073,7 @@ function useViewService() {
|
|
|
6957
7073
|
},
|
|
6958
7074
|
[env]
|
|
6959
7075
|
);
|
|
6960
|
-
const getSelectionItem = (0,
|
|
7076
|
+
const getSelectionItem = (0, import_react69.useCallback)(
|
|
6961
7077
|
async ({
|
|
6962
7078
|
data,
|
|
6963
7079
|
service,
|
|
@@ -6994,7 +7110,7 @@ function useViewService() {
|
|
|
6994
7110
|
},
|
|
6995
7111
|
[env]
|
|
6996
7112
|
);
|
|
6997
|
-
const loadMessages = (0,
|
|
7113
|
+
const loadMessages = (0, import_react69.useCallback)(async () => {
|
|
6998
7114
|
return env.requests.post(
|
|
6999
7115
|
"/load_message_failures" /* LOAD_MESSAGE */,
|
|
7000
7116
|
{},
|
|
@@ -7005,14 +7121,14 @@ function useViewService() {
|
|
|
7005
7121
|
}
|
|
7006
7122
|
);
|
|
7007
7123
|
}, [env]);
|
|
7008
|
-
const getVersion = (0,
|
|
7124
|
+
const getVersion = (0, import_react69.useCallback)(async () => {
|
|
7009
7125
|
return env?.requests?.get("", {
|
|
7010
7126
|
headers: {
|
|
7011
7127
|
"Content-Type": "application/json"
|
|
7012
7128
|
}
|
|
7013
7129
|
});
|
|
7014
7130
|
}, [env]);
|
|
7015
|
-
const grantAccess = (0,
|
|
7131
|
+
const grantAccess = (0, import_react69.useCallback)(
|
|
7016
7132
|
async ({
|
|
7017
7133
|
redirect_uri,
|
|
7018
7134
|
state,
|
|
@@ -7039,7 +7155,7 @@ function useViewService() {
|
|
|
7039
7155
|
},
|
|
7040
7156
|
[env]
|
|
7041
7157
|
);
|
|
7042
|
-
const removeTotpSetUp = (0,
|
|
7158
|
+
const removeTotpSetUp = (0, import_react69.useCallback)(
|
|
7043
7159
|
async ({ method, token }) => {
|
|
7044
7160
|
const jsonData = {
|
|
7045
7161
|
method,
|
|
@@ -7060,7 +7176,7 @@ function useViewService() {
|
|
|
7060
7176
|
},
|
|
7061
7177
|
[env]
|
|
7062
7178
|
);
|
|
7063
|
-
const requestSetupTotp = (0,
|
|
7179
|
+
const requestSetupTotp = (0, import_react69.useCallback)(
|
|
7064
7180
|
async ({ method, token }) => {
|
|
7065
7181
|
const jsonData = {
|
|
7066
7182
|
method,
|
|
@@ -7079,7 +7195,7 @@ function useViewService() {
|
|
|
7079
7195
|
},
|
|
7080
7196
|
[env]
|
|
7081
7197
|
);
|
|
7082
|
-
const settingsWebRead2fa = (0,
|
|
7198
|
+
const settingsWebRead2fa = (0, import_react69.useCallback)(
|
|
7083
7199
|
async ({
|
|
7084
7200
|
method,
|
|
7085
7201
|
model,
|
|
@@ -7107,7 +7223,7 @@ function useViewService() {
|
|
|
7107
7223
|
},
|
|
7108
7224
|
[env]
|
|
7109
7225
|
);
|
|
7110
|
-
const signInSSO = (0,
|
|
7226
|
+
const signInSSO = (0, import_react69.useCallback)(
|
|
7111
7227
|
async ({
|
|
7112
7228
|
redirect_uri,
|
|
7113
7229
|
state,
|
|
@@ -7139,7 +7255,7 @@ function useViewService() {
|
|
|
7139
7255
|
},
|
|
7140
7256
|
[env]
|
|
7141
7257
|
);
|
|
7142
|
-
const verify2FA = (0,
|
|
7258
|
+
const verify2FA = (0, import_react69.useCallback)(
|
|
7143
7259
|
({
|
|
7144
7260
|
method,
|
|
7145
7261
|
with_context,
|
|
@@ -7172,7 +7288,7 @@ function useViewService() {
|
|
|
7172
7288
|
},
|
|
7173
7289
|
[env]
|
|
7174
7290
|
);
|
|
7175
|
-
const get2FAMethods = (0,
|
|
7291
|
+
const get2FAMethods = (0, import_react69.useCallback)(
|
|
7176
7292
|
({ method, with_context }) => {
|
|
7177
7293
|
const jsonData = {
|
|
7178
7294
|
method,
|
|
@@ -7191,7 +7307,7 @@ function useViewService() {
|
|
|
7191
7307
|
},
|
|
7192
7308
|
[env]
|
|
7193
7309
|
);
|
|
7194
|
-
const verifyTotp = (0,
|
|
7310
|
+
const verifyTotp = (0, import_react69.useCallback)(
|
|
7195
7311
|
({
|
|
7196
7312
|
method,
|
|
7197
7313
|
action_token,
|
|
@@ -7216,7 +7332,7 @@ function useViewService() {
|
|
|
7216
7332
|
},
|
|
7217
7333
|
[env]
|
|
7218
7334
|
);
|
|
7219
|
-
const getNotifications = (0,
|
|
7335
|
+
const getNotifications = (0, import_react69.useCallback)(
|
|
7220
7336
|
async ({
|
|
7221
7337
|
service,
|
|
7222
7338
|
xNode,
|
|
@@ -7236,7 +7352,7 @@ function useViewService() {
|
|
|
7236
7352
|
},
|
|
7237
7353
|
[env]
|
|
7238
7354
|
);
|
|
7239
|
-
const getCountry = (0,
|
|
7355
|
+
const getCountry = (0, import_react69.useCallback)(
|
|
7240
7356
|
async ({
|
|
7241
7357
|
service,
|
|
7242
7358
|
xNode,
|
|
@@ -7263,7 +7379,7 @@ function useViewService() {
|
|
|
7263
7379
|
},
|
|
7264
7380
|
[env]
|
|
7265
7381
|
);
|
|
7266
|
-
const getCity = (0,
|
|
7382
|
+
const getCity = (0, import_react69.useCallback)(
|
|
7267
7383
|
async ({
|
|
7268
7384
|
service,
|
|
7269
7385
|
xNode,
|
|
@@ -7290,7 +7406,7 @@ function useViewService() {
|
|
|
7290
7406
|
},
|
|
7291
7407
|
[env]
|
|
7292
7408
|
);
|
|
7293
|
-
const getWard = (0,
|
|
7409
|
+
const getWard = (0, import_react69.useCallback)(
|
|
7294
7410
|
async ({
|
|
7295
7411
|
service,
|
|
7296
7412
|
xNode,
|
|
@@ -7315,7 +7431,7 @@ function useViewService() {
|
|
|
7315
7431
|
},
|
|
7316
7432
|
[env]
|
|
7317
7433
|
);
|
|
7318
|
-
const getPartnerTitle = (0,
|
|
7434
|
+
const getPartnerTitle = (0, import_react69.useCallback)(
|
|
7319
7435
|
async ({
|
|
7320
7436
|
service,
|
|
7321
7437
|
xNode,
|
|
@@ -7367,10 +7483,10 @@ function useViewService() {
|
|
|
7367
7483
|
}
|
|
7368
7484
|
|
|
7369
7485
|
// src/services/dashboard-service/index.ts
|
|
7370
|
-
var
|
|
7486
|
+
var import_react70 = require("react");
|
|
7371
7487
|
function useDashboardService() {
|
|
7372
7488
|
const { env } = useEnv();
|
|
7373
|
-
const readGroup = (0,
|
|
7489
|
+
const readGroup = (0, import_react70.useCallback)(
|
|
7374
7490
|
async ({
|
|
7375
7491
|
service,
|
|
7376
7492
|
xNode,
|
|
@@ -7387,7 +7503,7 @@ function useDashboardService() {
|
|
|
7387
7503
|
},
|
|
7388
7504
|
[env]
|
|
7389
7505
|
);
|
|
7390
|
-
const getDataChart = (0,
|
|
7506
|
+
const getDataChart = (0, import_react70.useCallback)(
|
|
7391
7507
|
async ({
|
|
7392
7508
|
service,
|
|
7393
7509
|
xNode,
|