@fctc/interface-logic 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs.js +13 -4
- package/dist/configs.mjs +13 -4
- package/dist/environment.d.mts +1 -0
- package/dist/environment.d.ts +1 -0
- package/dist/environment.js +13 -4
- package/dist/environment.mjs +13 -4
- package/dist/hooks.d.mts +3 -2
- package/dist/hooks.d.ts +3 -2
- package/dist/hooks.js +29 -110
- package/dist/hooks.mjs +29 -110
- package/dist/provider.d.mts +7 -6
- package/dist/provider.d.ts +7 -6
- package/dist/provider.js +42 -114
- package/dist/provider.mjs +42 -114
- package/dist/services.d.mts +6 -4
- package/dist/services.d.ts +6 -4
- package/dist/services.js +20 -100
- package/dist/services.mjs +20 -100
- package/dist/types.d.mts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +85 -85
package/dist/configs.js
CHANGED
|
@@ -2208,9 +2208,11 @@ var sessionStorageUtils = () => {
|
|
|
2208
2208
|
// src/configs/axios-client.ts
|
|
2209
2209
|
var axiosClient = {
|
|
2210
2210
|
init(config) {
|
|
2211
|
+
console.log("config", config);
|
|
2211
2212
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2212
2213
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2213
2214
|
const db = config?.db;
|
|
2215
|
+
const database = config?.config?.database;
|
|
2214
2216
|
let isRefreshing = false;
|
|
2215
2217
|
let failedQueue = [];
|
|
2216
2218
|
const processQueue = (error, token = null) => {
|
|
@@ -2231,12 +2233,19 @@ var axiosClient = {
|
|
|
2231
2233
|
});
|
|
2232
2234
|
instance.interceptors.request.use(async (config2) => {
|
|
2233
2235
|
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2236
|
+
let token = null;
|
|
2234
2237
|
if (useActionToken && actionToken) {
|
|
2235
|
-
|
|
2238
|
+
token = actionToken;
|
|
2239
|
+
} else {
|
|
2240
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2241
|
+
token = await getToken?.();
|
|
2242
|
+
}
|
|
2243
|
+
if (token) {
|
|
2244
|
+
config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2245
|
+
}
|
|
2246
|
+
if (database) {
|
|
2247
|
+
config2.headers["DATABASE"] = database;
|
|
2236
2248
|
}
|
|
2237
|
-
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2238
|
-
const token = await getToken?.();
|
|
2239
|
-
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2240
2249
|
return config2;
|
|
2241
2250
|
}, Promise.reject);
|
|
2242
2251
|
instance.interceptors.response.use(
|
package/dist/configs.mjs
CHANGED
|
@@ -2172,9 +2172,11 @@ var sessionStorageUtils = () => {
|
|
|
2172
2172
|
// src/configs/axios-client.ts
|
|
2173
2173
|
var axiosClient = {
|
|
2174
2174
|
init(config) {
|
|
2175
|
+
console.log("config", config);
|
|
2175
2176
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2176
2177
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2177
2178
|
const db = config?.db;
|
|
2179
|
+
const database = config?.config?.database;
|
|
2178
2180
|
let isRefreshing = false;
|
|
2179
2181
|
let failedQueue = [];
|
|
2180
2182
|
const processQueue = (error, token = null) => {
|
|
@@ -2195,12 +2197,19 @@ var axiosClient = {
|
|
|
2195
2197
|
});
|
|
2196
2198
|
instance.interceptors.request.use(async (config2) => {
|
|
2197
2199
|
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2200
|
+
let token = null;
|
|
2198
2201
|
if (useActionToken && actionToken) {
|
|
2199
|
-
|
|
2202
|
+
token = actionToken;
|
|
2203
|
+
} else {
|
|
2204
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2205
|
+
token = await getToken?.();
|
|
2206
|
+
}
|
|
2207
|
+
if (token) {
|
|
2208
|
+
config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2209
|
+
}
|
|
2210
|
+
if (database) {
|
|
2211
|
+
config2.headers["DATABASE"] = database;
|
|
2200
2212
|
}
|
|
2201
|
-
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2202
|
-
const token = await getToken?.();
|
|
2203
|
-
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2204
2213
|
return config2;
|
|
2205
2214
|
}, Promise.reject);
|
|
2206
2215
|
instance.interceptors.response.use(
|
package/dist/environment.d.mts
CHANGED
package/dist/environment.d.ts
CHANGED
package/dist/environment.js
CHANGED
|
@@ -2210,9 +2210,11 @@ var sessionStorageUtils = () => {
|
|
|
2210
2210
|
// src/configs/axios-client.ts
|
|
2211
2211
|
var axiosClient = {
|
|
2212
2212
|
init(config) {
|
|
2213
|
+
console.log("config", config);
|
|
2213
2214
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2214
2215
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2215
2216
|
const db = config?.db;
|
|
2217
|
+
const database = config?.config?.database;
|
|
2216
2218
|
let isRefreshing = false;
|
|
2217
2219
|
let failedQueue = [];
|
|
2218
2220
|
const processQueue = (error, token = null) => {
|
|
@@ -2233,12 +2235,19 @@ var axiosClient = {
|
|
|
2233
2235
|
});
|
|
2234
2236
|
instance.interceptors.request.use(async (config2) => {
|
|
2235
2237
|
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2238
|
+
let token = null;
|
|
2236
2239
|
if (useActionToken && actionToken) {
|
|
2237
|
-
|
|
2240
|
+
token = actionToken;
|
|
2241
|
+
} else {
|
|
2242
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2243
|
+
token = await getToken?.();
|
|
2244
|
+
}
|
|
2245
|
+
if (token) {
|
|
2246
|
+
config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2247
|
+
}
|
|
2248
|
+
if (database) {
|
|
2249
|
+
config2.headers["DATABASE"] = database;
|
|
2238
2250
|
}
|
|
2239
|
-
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2240
|
-
const token = await getToken?.();
|
|
2241
|
-
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2242
2251
|
return config2;
|
|
2243
2252
|
}, Promise.reject);
|
|
2244
2253
|
instance.interceptors.response.use(
|
package/dist/environment.mjs
CHANGED
|
@@ -2172,9 +2172,11 @@ var sessionStorageUtils = () => {
|
|
|
2172
2172
|
// src/configs/axios-client.ts
|
|
2173
2173
|
var axiosClient = {
|
|
2174
2174
|
init(config) {
|
|
2175
|
+
console.log("config", config);
|
|
2175
2176
|
const localStorage2 = config?.localStorageUtils ?? localStorageUtils();
|
|
2176
2177
|
const sessionStorage2 = config?.sessionStorageUtils ?? sessionStorageUtils();
|
|
2177
2178
|
const db = config?.db;
|
|
2179
|
+
const database = config?.config?.database;
|
|
2178
2180
|
let isRefreshing = false;
|
|
2179
2181
|
let failedQueue = [];
|
|
2180
2182
|
const processQueue = (error, token = null) => {
|
|
@@ -2195,12 +2197,19 @@ var axiosClient = {
|
|
|
2195
2197
|
});
|
|
2196
2198
|
instance.interceptors.request.use(async (config2) => {
|
|
2197
2199
|
const { useRefreshToken, useActionToken, actionToken } = config2;
|
|
2200
|
+
let token = null;
|
|
2198
2201
|
if (useActionToken && actionToken) {
|
|
2199
|
-
|
|
2202
|
+
token = actionToken;
|
|
2203
|
+
} else {
|
|
2204
|
+
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2205
|
+
token = await getToken?.();
|
|
2206
|
+
}
|
|
2207
|
+
if (token) {
|
|
2208
|
+
config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2209
|
+
}
|
|
2210
|
+
if (database) {
|
|
2211
|
+
config2.headers["DATABASE"] = database;
|
|
2200
2212
|
}
|
|
2201
|
-
const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
|
|
2202
|
-
const token = await getToken?.();
|
|
2203
|
-
if (token) config2.headers["Authorization"] = `Bearer ${token}`;
|
|
2204
2213
|
return config2;
|
|
2205
2214
|
}, Promise.reject);
|
|
2206
2215
|
instance.interceptors.response.use(
|
package/dist/hooks.d.mts
CHANGED
|
@@ -134,7 +134,7 @@ declare const useSendComment: () => _tanstack_react_query.UseMutationResult<any,
|
|
|
134
134
|
}, unknown>;
|
|
135
135
|
|
|
136
136
|
declare const useUploadImage: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
137
|
-
|
|
137
|
+
formData: any;
|
|
138
138
|
}, unknown>;
|
|
139
139
|
|
|
140
140
|
declare const useDelete: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
@@ -261,7 +261,7 @@ declare const useGetGroups: ({ model, width_context, }: {
|
|
|
261
261
|
|
|
262
262
|
declare const useGetListData: (listDataProps: any, queryKey?: any, enabled?: any) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
263
263
|
|
|
264
|
-
declare const useGetMenu: (context: any, enabled?: boolean) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
264
|
+
declare const useGetMenu: (context: any, specification: any, enabled?: boolean) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
265
265
|
|
|
266
266
|
declare const useGetPrintReport: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
267
267
|
id: number;
|
|
@@ -314,6 +314,7 @@ declare const useSignInSSO: () => _tanstack_react_query.UseMutationResult<any, E
|
|
|
314
314
|
client_id: string;
|
|
315
315
|
response_type: string;
|
|
316
316
|
path: string;
|
|
317
|
+
scope: string;
|
|
317
318
|
}, unknown>;
|
|
318
319
|
|
|
319
320
|
declare const useVerify2FA: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
|
package/dist/hooks.d.ts
CHANGED
|
@@ -134,7 +134,7 @@ declare const useSendComment: () => _tanstack_react_query.UseMutationResult<any,
|
|
|
134
134
|
}, unknown>;
|
|
135
135
|
|
|
136
136
|
declare const useUploadImage: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
137
|
-
|
|
137
|
+
formData: any;
|
|
138
138
|
}, unknown>;
|
|
139
139
|
|
|
140
140
|
declare const useDelete: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
@@ -261,7 +261,7 @@ declare const useGetGroups: ({ model, width_context, }: {
|
|
|
261
261
|
|
|
262
262
|
declare const useGetListData: (listDataProps: any, queryKey?: any, enabled?: any) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
263
263
|
|
|
264
|
-
declare const useGetMenu: (context: any, enabled?: boolean) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
264
|
+
declare const useGetMenu: (context: any, specification: any, enabled?: boolean) => _tanstack_react_query.UseQueryResult<any, Error>;
|
|
265
265
|
|
|
266
266
|
declare const useGetPrintReport: () => _tanstack_react_query.UseMutationResult<any, Error, {
|
|
267
267
|
id: number;
|
|
@@ -314,6 +314,7 @@ declare const useSignInSSO: () => _tanstack_react_query.UseMutationResult<any, E
|
|
|
314
314
|
client_id: string;
|
|
315
315
|
response_type: string;
|
|
316
316
|
path: string;
|
|
317
|
+
scope: string;
|
|
317
318
|
}, unknown>;
|
|
318
319
|
|
|
319
320
|
declare const useVerify2FA: () => _tanstack_react_query.UseMutationResult<unknown, Error, {
|
package/dist/hooks.js
CHANGED
|
@@ -3586,8 +3586,8 @@ function useFormService() {
|
|
|
3586
3586
|
[env]
|
|
3587
3587
|
);
|
|
3588
3588
|
const uploadImage = (0, import_react10.useCallback)(
|
|
3589
|
-
async ({
|
|
3590
|
-
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */,
|
|
3589
|
+
async ({ formData }) => {
|
|
3590
|
+
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
|
|
3591
3591
|
},
|
|
3592
3592
|
[env]
|
|
3593
3593
|
);
|
|
@@ -4152,101 +4152,14 @@ function useViewService() {
|
|
|
4152
4152
|
[env]
|
|
4153
4153
|
);
|
|
4154
4154
|
const getMenu = (0, import_react14.useCallback)(
|
|
4155
|
-
async (context) => {
|
|
4155
|
+
async (context, specification) => {
|
|
4156
4156
|
const jsonData = {
|
|
4157
4157
|
model: "ir.ui.menu" /* MENU */,
|
|
4158
4158
|
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4159
4159
|
ids: [],
|
|
4160
4160
|
with_context: context,
|
|
4161
4161
|
kwargs: {
|
|
4162
|
-
specification
|
|
4163
|
-
active: {},
|
|
4164
|
-
name: {},
|
|
4165
|
-
is_display: {},
|
|
4166
|
-
sequence: {},
|
|
4167
|
-
complete_name: {},
|
|
4168
|
-
action: {
|
|
4169
|
-
fields: {
|
|
4170
|
-
display_name: {},
|
|
4171
|
-
type: {},
|
|
4172
|
-
binding_view_types: {}
|
|
4173
|
-
}
|
|
4174
|
-
},
|
|
4175
|
-
url_icon: {},
|
|
4176
|
-
web_icon: {},
|
|
4177
|
-
web_icon_data: {},
|
|
4178
|
-
groups_id: {
|
|
4179
|
-
fields: {
|
|
4180
|
-
full_name: {}
|
|
4181
|
-
},
|
|
4182
|
-
limit: 40,
|
|
4183
|
-
order: ""
|
|
4184
|
-
},
|
|
4185
|
-
display_name: {},
|
|
4186
|
-
child_id: {
|
|
4187
|
-
fields: {
|
|
4188
|
-
active: {},
|
|
4189
|
-
name: {},
|
|
4190
|
-
is_display: {},
|
|
4191
|
-
sequence: {},
|
|
4192
|
-
complete_name: {},
|
|
4193
|
-
action: {
|
|
4194
|
-
fields: {
|
|
4195
|
-
display_name: {},
|
|
4196
|
-
type: {},
|
|
4197
|
-
binding_view_types: {}
|
|
4198
|
-
}
|
|
4199
|
-
},
|
|
4200
|
-
url_icon: {},
|
|
4201
|
-
web_icon: {},
|
|
4202
|
-
web_icon_data: {},
|
|
4203
|
-
groups_id: {
|
|
4204
|
-
fields: {
|
|
4205
|
-
full_name: {}
|
|
4206
|
-
},
|
|
4207
|
-
limit: 40,
|
|
4208
|
-
order: ""
|
|
4209
|
-
},
|
|
4210
|
-
display_name: {},
|
|
4211
|
-
child_id: {
|
|
4212
|
-
fields: {
|
|
4213
|
-
active: {},
|
|
4214
|
-
name: {},
|
|
4215
|
-
is_display: {},
|
|
4216
|
-
sequence: {},
|
|
4217
|
-
complete_name: {},
|
|
4218
|
-
action: {
|
|
4219
|
-
fields: {
|
|
4220
|
-
display_name: {},
|
|
4221
|
-
type: {},
|
|
4222
|
-
binding_view_types: {}
|
|
4223
|
-
}
|
|
4224
|
-
},
|
|
4225
|
-
url_icon: {},
|
|
4226
|
-
web_icon: {},
|
|
4227
|
-
web_icon_data: {},
|
|
4228
|
-
groups_id: {
|
|
4229
|
-
fields: {
|
|
4230
|
-
full_name: {}
|
|
4231
|
-
},
|
|
4232
|
-
limit: 40,
|
|
4233
|
-
order: ""
|
|
4234
|
-
},
|
|
4235
|
-
display_name: {},
|
|
4236
|
-
child_id: {
|
|
4237
|
-
fields: {},
|
|
4238
|
-
limit: 40,
|
|
4239
|
-
order: ""
|
|
4240
|
-
}
|
|
4241
|
-
},
|
|
4242
|
-
limit: 40,
|
|
4243
|
-
order: ""
|
|
4244
|
-
}
|
|
4245
|
-
},
|
|
4246
|
-
limit: 40,
|
|
4247
|
-
order: ""
|
|
4248
|
-
}
|
|
4249
|
-
},
|
|
4162
|
+
specification,
|
|
4250
4163
|
domain: [
|
|
4251
4164
|
"&",
|
|
4252
4165
|
["is_display", "=", true],
|
|
@@ -4441,18 +4354,25 @@ function useViewService() {
|
|
|
4441
4354
|
redirect_uri,
|
|
4442
4355
|
state,
|
|
4443
4356
|
client_id,
|
|
4444
|
-
response_type
|
|
4357
|
+
response_type,
|
|
4358
|
+
path,
|
|
4359
|
+
scope
|
|
4445
4360
|
}) => {
|
|
4446
|
-
const
|
|
4447
|
-
|
|
4448
|
-
state,
|
|
4361
|
+
const params = new URLSearchParams({
|
|
4362
|
+
response_type,
|
|
4449
4363
|
client_id,
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4364
|
+
redirect_uri,
|
|
4365
|
+
state
|
|
4366
|
+
});
|
|
4367
|
+
const queryString = `${params.toString()}&scope=${encodeURIComponent(
|
|
4368
|
+
scope
|
|
4369
|
+
)}`;
|
|
4370
|
+
const url = `${path}?${queryString}`;
|
|
4371
|
+
return env?.requests.get(url, {
|
|
4453
4372
|
headers: {
|
|
4454
|
-
|
|
4455
|
-
}
|
|
4373
|
+
"Content-Type": "application/json"
|
|
4374
|
+
},
|
|
4375
|
+
withCredentials: true
|
|
4456
4376
|
});
|
|
4457
4377
|
},
|
|
4458
4378
|
[env]
|
|
@@ -4991,8 +4911,8 @@ var import_react_query31 = require("@tanstack/react-query");
|
|
|
4991
4911
|
var useUploadImage = () => {
|
|
4992
4912
|
const { uploadImage } = useFormService();
|
|
4993
4913
|
return (0, import_react_query31.useMutation)({
|
|
4994
|
-
mutationFn: ({
|
|
4995
|
-
|
|
4914
|
+
mutationFn: ({ formData }) => uploadImage({
|
|
4915
|
+
formData
|
|
4996
4916
|
})
|
|
4997
4917
|
});
|
|
4998
4918
|
};
|
|
@@ -5386,7 +5306,6 @@ var useGetActionDetail = ({
|
|
|
5386
5306
|
model,
|
|
5387
5307
|
queryKey
|
|
5388
5308
|
}) => {
|
|
5389
|
-
const { getFormView } = useFormService();
|
|
5390
5309
|
const { getActionDetail } = useViewService();
|
|
5391
5310
|
const data = {
|
|
5392
5311
|
id,
|
|
@@ -5401,9 +5320,6 @@ var useGetActionDetail = ({
|
|
|
5401
5320
|
if (res && res.length > 0) {
|
|
5402
5321
|
return res[0];
|
|
5403
5322
|
}
|
|
5404
|
-
} else {
|
|
5405
|
-
const res = await getFormView({ data });
|
|
5406
|
-
return res;
|
|
5407
5323
|
}
|
|
5408
5324
|
},
|
|
5409
5325
|
enabled,
|
|
@@ -5476,11 +5392,11 @@ var use_get_list_data_default = useGetListData;
|
|
|
5476
5392
|
|
|
5477
5393
|
// src/hooks/view/use-get-menu.ts
|
|
5478
5394
|
var import_react_query50 = require("@tanstack/react-query");
|
|
5479
|
-
var useGetMenu = (context, enabled) => {
|
|
5395
|
+
var useGetMenu = (context, specification, enabled) => {
|
|
5480
5396
|
const { getMenu } = useViewService();
|
|
5481
5397
|
return (0, import_react_query50.useQuery)({
|
|
5482
5398
|
queryKey: ["menus" /* MENU */, context],
|
|
5483
|
-
queryFn: () => getMenu(context).then((res) => {
|
|
5399
|
+
queryFn: () => getMenu(context, specification).then((res) => {
|
|
5484
5400
|
if (res && res?.records && res?.records?.length > 0) {
|
|
5485
5401
|
return res?.records;
|
|
5486
5402
|
}
|
|
@@ -5669,13 +5585,16 @@ var useSignInSSO = () => {
|
|
|
5669
5585
|
state,
|
|
5670
5586
|
client_id,
|
|
5671
5587
|
response_type,
|
|
5672
|
-
path
|
|
5588
|
+
path,
|
|
5589
|
+
scope
|
|
5673
5590
|
}) => {
|
|
5674
5591
|
return signInSSO({
|
|
5675
5592
|
redirect_uri,
|
|
5676
5593
|
state,
|
|
5677
5594
|
client_id,
|
|
5678
|
-
response_type
|
|
5595
|
+
response_type,
|
|
5596
|
+
path,
|
|
5597
|
+
scope
|
|
5679
5598
|
});
|
|
5680
5599
|
}
|
|
5681
5600
|
});
|
package/dist/hooks.mjs
CHANGED
|
@@ -3483,8 +3483,8 @@ function useFormService() {
|
|
|
3483
3483
|
[env]
|
|
3484
3484
|
);
|
|
3485
3485
|
const uploadImage = useCallback6(
|
|
3486
|
-
async ({
|
|
3487
|
-
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */,
|
|
3486
|
+
async ({ formData }) => {
|
|
3487
|
+
return env.requests.post("/mail/attachment/upload" /* UPLOAD_IMAGE */, formData);
|
|
3488
3488
|
},
|
|
3489
3489
|
[env]
|
|
3490
3490
|
);
|
|
@@ -4049,101 +4049,14 @@ function useViewService() {
|
|
|
4049
4049
|
[env]
|
|
4050
4050
|
);
|
|
4051
4051
|
const getMenu = useCallback10(
|
|
4052
|
-
async (context) => {
|
|
4052
|
+
async (context, specification) => {
|
|
4053
4053
|
const jsonData = {
|
|
4054
4054
|
model: "ir.ui.menu" /* MENU */,
|
|
4055
4055
|
method: "web_search_read" /* WEB_SEARCH_READ */,
|
|
4056
4056
|
ids: [],
|
|
4057
4057
|
with_context: context,
|
|
4058
4058
|
kwargs: {
|
|
4059
|
-
specification
|
|
4060
|
-
active: {},
|
|
4061
|
-
name: {},
|
|
4062
|
-
is_display: {},
|
|
4063
|
-
sequence: {},
|
|
4064
|
-
complete_name: {},
|
|
4065
|
-
action: {
|
|
4066
|
-
fields: {
|
|
4067
|
-
display_name: {},
|
|
4068
|
-
type: {},
|
|
4069
|
-
binding_view_types: {}
|
|
4070
|
-
}
|
|
4071
|
-
},
|
|
4072
|
-
url_icon: {},
|
|
4073
|
-
web_icon: {},
|
|
4074
|
-
web_icon_data: {},
|
|
4075
|
-
groups_id: {
|
|
4076
|
-
fields: {
|
|
4077
|
-
full_name: {}
|
|
4078
|
-
},
|
|
4079
|
-
limit: 40,
|
|
4080
|
-
order: ""
|
|
4081
|
-
},
|
|
4082
|
-
display_name: {},
|
|
4083
|
-
child_id: {
|
|
4084
|
-
fields: {
|
|
4085
|
-
active: {},
|
|
4086
|
-
name: {},
|
|
4087
|
-
is_display: {},
|
|
4088
|
-
sequence: {},
|
|
4089
|
-
complete_name: {},
|
|
4090
|
-
action: {
|
|
4091
|
-
fields: {
|
|
4092
|
-
display_name: {},
|
|
4093
|
-
type: {},
|
|
4094
|
-
binding_view_types: {}
|
|
4095
|
-
}
|
|
4096
|
-
},
|
|
4097
|
-
url_icon: {},
|
|
4098
|
-
web_icon: {},
|
|
4099
|
-
web_icon_data: {},
|
|
4100
|
-
groups_id: {
|
|
4101
|
-
fields: {
|
|
4102
|
-
full_name: {}
|
|
4103
|
-
},
|
|
4104
|
-
limit: 40,
|
|
4105
|
-
order: ""
|
|
4106
|
-
},
|
|
4107
|
-
display_name: {},
|
|
4108
|
-
child_id: {
|
|
4109
|
-
fields: {
|
|
4110
|
-
active: {},
|
|
4111
|
-
name: {},
|
|
4112
|
-
is_display: {},
|
|
4113
|
-
sequence: {},
|
|
4114
|
-
complete_name: {},
|
|
4115
|
-
action: {
|
|
4116
|
-
fields: {
|
|
4117
|
-
display_name: {},
|
|
4118
|
-
type: {},
|
|
4119
|
-
binding_view_types: {}
|
|
4120
|
-
}
|
|
4121
|
-
},
|
|
4122
|
-
url_icon: {},
|
|
4123
|
-
web_icon: {},
|
|
4124
|
-
web_icon_data: {},
|
|
4125
|
-
groups_id: {
|
|
4126
|
-
fields: {
|
|
4127
|
-
full_name: {}
|
|
4128
|
-
},
|
|
4129
|
-
limit: 40,
|
|
4130
|
-
order: ""
|
|
4131
|
-
},
|
|
4132
|
-
display_name: {},
|
|
4133
|
-
child_id: {
|
|
4134
|
-
fields: {},
|
|
4135
|
-
limit: 40,
|
|
4136
|
-
order: ""
|
|
4137
|
-
}
|
|
4138
|
-
},
|
|
4139
|
-
limit: 40,
|
|
4140
|
-
order: ""
|
|
4141
|
-
}
|
|
4142
|
-
},
|
|
4143
|
-
limit: 40,
|
|
4144
|
-
order: ""
|
|
4145
|
-
}
|
|
4146
|
-
},
|
|
4059
|
+
specification,
|
|
4147
4060
|
domain: [
|
|
4148
4061
|
"&",
|
|
4149
4062
|
["is_display", "=", true],
|
|
@@ -4338,18 +4251,25 @@ function useViewService() {
|
|
|
4338
4251
|
redirect_uri,
|
|
4339
4252
|
state,
|
|
4340
4253
|
client_id,
|
|
4341
|
-
response_type
|
|
4254
|
+
response_type,
|
|
4255
|
+
path,
|
|
4256
|
+
scope
|
|
4342
4257
|
}) => {
|
|
4343
|
-
const
|
|
4344
|
-
|
|
4345
|
-
state,
|
|
4258
|
+
const params = new URLSearchParams({
|
|
4259
|
+
response_type,
|
|
4346
4260
|
client_id,
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4261
|
+
redirect_uri,
|
|
4262
|
+
state
|
|
4263
|
+
});
|
|
4264
|
+
const queryString = `${params.toString()}&scope=${encodeURIComponent(
|
|
4265
|
+
scope
|
|
4266
|
+
)}`;
|
|
4267
|
+
const url = `${path}?${queryString}`;
|
|
4268
|
+
return env?.requests.get(url, {
|
|
4350
4269
|
headers: {
|
|
4351
|
-
|
|
4352
|
-
}
|
|
4270
|
+
"Content-Type": "application/json"
|
|
4271
|
+
},
|
|
4272
|
+
withCredentials: true
|
|
4353
4273
|
});
|
|
4354
4274
|
},
|
|
4355
4275
|
[env]
|
|
@@ -4888,8 +4808,8 @@ import { useMutation as useMutation24 } from "@tanstack/react-query";
|
|
|
4888
4808
|
var useUploadImage = () => {
|
|
4889
4809
|
const { uploadImage } = useFormService();
|
|
4890
4810
|
return useMutation24({
|
|
4891
|
-
mutationFn: ({
|
|
4892
|
-
|
|
4811
|
+
mutationFn: ({ formData }) => uploadImage({
|
|
4812
|
+
formData
|
|
4893
4813
|
})
|
|
4894
4814
|
});
|
|
4895
4815
|
};
|
|
@@ -5283,7 +5203,6 @@ var useGetActionDetail = ({
|
|
|
5283
5203
|
model,
|
|
5284
5204
|
queryKey
|
|
5285
5205
|
}) => {
|
|
5286
|
-
const { getFormView } = useFormService();
|
|
5287
5206
|
const { getActionDetail } = useViewService();
|
|
5288
5207
|
const data = {
|
|
5289
5208
|
id,
|
|
@@ -5298,9 +5217,6 @@ var useGetActionDetail = ({
|
|
|
5298
5217
|
if (res && res.length > 0) {
|
|
5299
5218
|
return res[0];
|
|
5300
5219
|
}
|
|
5301
|
-
} else {
|
|
5302
|
-
const res = await getFormView({ data });
|
|
5303
|
-
return res;
|
|
5304
5220
|
}
|
|
5305
5221
|
},
|
|
5306
5222
|
enabled,
|
|
@@ -5373,11 +5289,11 @@ var use_get_list_data_default = useGetListData;
|
|
|
5373
5289
|
|
|
5374
5290
|
// src/hooks/view/use-get-menu.ts
|
|
5375
5291
|
import { useQuery as useQuery15 } from "@tanstack/react-query";
|
|
5376
|
-
var useGetMenu = (context, enabled) => {
|
|
5292
|
+
var useGetMenu = (context, specification, enabled) => {
|
|
5377
5293
|
const { getMenu } = useViewService();
|
|
5378
5294
|
return useQuery15({
|
|
5379
5295
|
queryKey: ["menus" /* MENU */, context],
|
|
5380
|
-
queryFn: () => getMenu(context).then((res) => {
|
|
5296
|
+
queryFn: () => getMenu(context, specification).then((res) => {
|
|
5381
5297
|
if (res && res?.records && res?.records?.length > 0) {
|
|
5382
5298
|
return res?.records;
|
|
5383
5299
|
}
|
|
@@ -5566,13 +5482,16 @@ var useSignInSSO = () => {
|
|
|
5566
5482
|
state,
|
|
5567
5483
|
client_id,
|
|
5568
5484
|
response_type,
|
|
5569
|
-
path
|
|
5485
|
+
path,
|
|
5486
|
+
scope
|
|
5570
5487
|
}) => {
|
|
5571
5488
|
return signInSSO({
|
|
5572
5489
|
redirect_uri,
|
|
5573
5490
|
state,
|
|
5574
5491
|
client_id,
|
|
5575
|
-
response_type
|
|
5492
|
+
response_type,
|
|
5493
|
+
path,
|
|
5494
|
+
scope
|
|
5576
5495
|
});
|
|
5577
5496
|
}
|
|
5578
5497
|
});
|
package/dist/provider.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { L as LocalStorageUtilsType, S as SessionStorageUtilsType } from './session-storage-ARp_lhTD.mjs';
|
|
3
4
|
import { useForgotPassword, useForgotPasswordSSO, useGetProvider, useIsValidToken, useLoginCredential, useLoginSocial, useResetPassword, useResetPasswordSSO, useUpdatePassword, useLogout, useGetAccessByCode, useValidateActionToken, useGetCompanyInfo, useGetCurrentCompany, useGetListCompany, useExecuteImport, useExportExcel, useGetFieldExport, useGetFileExcel, useParsePreview, useUploadFile, useUploadIdFile, useChangeStatus, useDeleteComment, useGetComment, useGetFormView, useGetImage, useSendComment, useUploadImage, useDelete, useGetAll, useGetConversionRate, useGetCurrency, useGetDetail, useGetFieldOnChange, useGetListMyBankAccount, useModel, useOdooDataTransform, useOnChangeForm, useSave, useGetProfile, useGetUser, useSwitchLocale, useButton, useDuplicateRecord, useGet2FAMethods, useGetActionDetail, useGetCalendar, useGetGroups, useGetListData, useGetMenu, useGetPrintReport, useGetProGressBar, useGetResequence, useGetSelection, useGetView, useLoadAction, useLoadMessage, usePrint, useRemoveRow, useRunAction, useSignInSSO, useVerify2FA, useGrantAccess, useRemoveTotpSetup, useRequestSetupTotp, useSettingsWebRead2fa, useVerifyTotp } from './hooks.mjs';
|
|
@@ -6,15 +7,15 @@ import './view-type-BGJfDe73.mjs';
|
|
|
6
7
|
|
|
7
8
|
declare const MainProvider: ({ children }: {
|
|
8
9
|
children: ReactNode;
|
|
9
|
-
}) => JSX.Element;
|
|
10
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
11
12
|
declare const ReactQueryProvider: ({ children }: {
|
|
12
13
|
children: ReactNode;
|
|
13
|
-
}) => JSX.Element;
|
|
14
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
14
15
|
|
|
15
16
|
declare const VersionGate: ({ children }: {
|
|
16
17
|
children: ReactNode;
|
|
17
|
-
}) => JSX.Element | null;
|
|
18
|
+
}) => react_jsx_runtime.JSX.Element | null;
|
|
18
19
|
|
|
19
20
|
interface EnvConfig {
|
|
20
21
|
env?: any;
|
|
@@ -45,7 +46,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
|
|
|
45
46
|
children: React.ReactNode;
|
|
46
47
|
localStorageUtils?: LocalStorageUtilsType;
|
|
47
48
|
sessionStorageUtils?: SessionStorageUtilsType;
|
|
48
|
-
}): JSX.Element;
|
|
49
|
+
}): react_jsx_runtime.JSX.Element;
|
|
49
50
|
declare function useEnv(): {
|
|
50
51
|
env: EnvConfig;
|
|
51
52
|
setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
|
|
@@ -131,12 +132,12 @@ interface ServiceContextType {
|
|
|
131
132
|
}
|
|
132
133
|
declare const ServiceProvider: ({ children, }: {
|
|
133
134
|
children: React.ReactNode;
|
|
134
|
-
}) => JSX.Element;
|
|
135
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
135
136
|
declare const useService: () => ServiceContextType;
|
|
136
137
|
|
|
137
138
|
type MetaProviderProps = {
|
|
138
139
|
children: ReactNode;
|
|
139
140
|
};
|
|
140
|
-
declare const MetaProvider: ({ children }: MetaProviderProps) => JSX.Element;
|
|
141
|
+
declare const MetaProvider: ({ children }: MetaProviderProps) => react_jsx_runtime.JSX.Element;
|
|
141
142
|
|
|
142
143
|
export { EnvProvider, MainProvider, MetaProvider, ReactQueryProvider, ServiceProvider, VersionGate, useEnv, useService };
|