@fctc/interface-logic 2.0.5 → 2.0.7
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.d.mts +6 -6
- package/dist/configs.d.ts +6 -6
- package/dist/configs.js +40 -15
- package/dist/configs.mjs +40 -15
- package/dist/environment.js +40 -15
- package/dist/environment.mjs +40 -15
- package/dist/hooks.d.mts +13 -3
- package/dist/hooks.d.ts +13 -3
- package/dist/hooks.js +173 -83
- package/dist/hooks.mjs +173 -83
- package/dist/provider.d.mts +2 -1
- package/dist/provider.d.ts +2 -1
- package/dist/provider.js +213 -98
- package/dist/provider.mjs +213 -98
- package/dist/services.d.mts +20 -13
- package/dist/services.d.ts +20 -13
- package/dist/services.js +136 -62
- package/dist/services.mjs +136 -62
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{view-type-BGJfDe73.d.mts → view-type-p4JdAOsz.d.mts} +5 -0
- package/dist/{view-type-BGJfDe73.d.ts → view-type-p4JdAOsz.d.ts} +5 -0
- package/package.json +1 -1
package/dist/services.d.ts
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, a as GetDetailParams, S as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, f as GetViewParams, c as GetSelectionType } from './view-type-
|
|
1
|
+
import { C as ContextApi, L as LoginCredentialBody, R as ResetPasswordRequest, U as UpdatePasswordRequest, b as GetListParams, a as GetDetailParams, S as SaveParams, D as DeleteParams, O as OnChangeParams, V as ViewData, f as GetViewParams, c as GetSelectionType } from './view-type-p4JdAOsz.js';
|
|
2
2
|
|
|
3
3
|
declare function useActionService(): {
|
|
4
|
-
loadAction: ({ idAction, context, }: {
|
|
4
|
+
loadAction: ({ idAction, context, service, }: {
|
|
5
5
|
idAction: number;
|
|
6
6
|
context: ContextApi;
|
|
7
|
+
service?: string;
|
|
7
8
|
}) => Promise<any>;
|
|
8
|
-
callButton: ({ model, ids, context, method, }: {
|
|
9
|
+
callButton: ({ model, ids, context, method, service, }: {
|
|
9
10
|
model: string;
|
|
10
11
|
ids: Record<string, any>[] | any;
|
|
11
12
|
context: ContextApi;
|
|
12
13
|
method: any;
|
|
14
|
+
service?: string;
|
|
13
15
|
}) => Promise<any>;
|
|
14
|
-
removeRows: ({ model, ids, context, }: {
|
|
16
|
+
removeRows: ({ model, ids, context, service, }: {
|
|
15
17
|
model: string;
|
|
16
18
|
ids: Record<string, any>[] | any;
|
|
17
19
|
context: ContextApi;
|
|
20
|
+
service?: string;
|
|
18
21
|
}) => Promise<any>;
|
|
19
|
-
duplicateRecord: ({ model, id, context, }: {
|
|
22
|
+
duplicateRecord: ({ model, id, context, service, }: {
|
|
20
23
|
model: string;
|
|
21
24
|
id: any;
|
|
22
25
|
context: ContextApi;
|
|
26
|
+
service?: string;
|
|
23
27
|
}) => Promise<any>;
|
|
24
28
|
getPrintReportName: ({ id }: {
|
|
25
29
|
id: number;
|
|
@@ -29,9 +33,10 @@ declare function useActionService(): {
|
|
|
29
33
|
report: any;
|
|
30
34
|
db: any;
|
|
31
35
|
}) => Promise<any>;
|
|
32
|
-
runAction: ({ idAction, context, }: {
|
|
36
|
+
runAction: ({ idAction, context, service, }: {
|
|
33
37
|
idAction: number;
|
|
34
38
|
context: ContextApi;
|
|
39
|
+
service?: string;
|
|
35
40
|
}) => Promise<any>;
|
|
36
41
|
};
|
|
37
42
|
|
|
@@ -163,17 +168,18 @@ declare function useModelService(): {
|
|
|
163
168
|
}) => Promise<any>;
|
|
164
169
|
getCurrency: () => Promise<any>;
|
|
165
170
|
getConversionRate: () => Promise<any>;
|
|
166
|
-
getAll: ({ data }: {
|
|
171
|
+
getAll: ({ data, service }: {
|
|
167
172
|
data: any;
|
|
173
|
+
service?: string;
|
|
168
174
|
}) => Promise<any>;
|
|
169
175
|
getListCalendar: ({ data }: {
|
|
170
176
|
data: any;
|
|
171
177
|
}) => Promise<any>;
|
|
172
178
|
getList: ({ model, ids, specification, domain, offset, order, context, limit, }: GetListParams) => Promise<any>;
|
|
173
|
-
getDetail: ({ ids, model, specification, context }: GetDetailParams) => Promise<any>;
|
|
174
|
-
save: ({ model, ids, data, specification, context, path, }: SaveParams) => Promise<any>;
|
|
175
|
-
deleteApi: ({ ids, model }: DeleteParams) => Promise<any>;
|
|
176
|
-
onChange: ({ ids, model, object, specification, context, fieldChange, }: OnChangeParams) => Promise<any>;
|
|
179
|
+
getDetail: ({ ids, model, specification, context, service, }: GetDetailParams) => Promise<any>;
|
|
180
|
+
save: ({ model, ids, data, specification, context, path, service, }: SaveParams) => Promise<any>;
|
|
181
|
+
deleteApi: ({ ids, model, service }: DeleteParams) => Promise<any>;
|
|
182
|
+
onChange: ({ ids, model, object, specification, context, fieldChange, service, }: OnChangeParams) => Promise<any>;
|
|
177
183
|
getListFieldsOnchange: ({ model }: {
|
|
178
184
|
model: string;
|
|
179
185
|
}) => Promise<any>;
|
|
@@ -195,7 +201,7 @@ declare function useUserService(): {
|
|
|
195
201
|
};
|
|
196
202
|
|
|
197
203
|
declare function useViewService(): {
|
|
198
|
-
getView: ({ model, views, context, options, aid, }: GetViewParams) => Promise<any>;
|
|
204
|
+
getView: ({ model, views, context, options, aid, service, }: GetViewParams) => Promise<any>;
|
|
199
205
|
getMenu: (context: any, specification: any) => Promise<any>;
|
|
200
206
|
getActionDetail: (aid: number, context: any) => Promise<any>;
|
|
201
207
|
getResequence: ({ model, ids, context, offset, }: {
|
|
@@ -204,8 +210,9 @@ declare function useViewService(): {
|
|
|
204
210
|
context: any;
|
|
205
211
|
offset: any;
|
|
206
212
|
}) => Promise<any>;
|
|
207
|
-
getSelectionItem: ({ data }: {
|
|
213
|
+
getSelectionItem: ({ data, service }: {
|
|
208
214
|
data: GetSelectionType;
|
|
215
|
+
service?: string;
|
|
209
216
|
}) => Promise<any>;
|
|
210
217
|
loadMessages: () => Promise<any>;
|
|
211
218
|
getVersion: () => Promise<any>;
|
package/dist/services.js
CHANGED
|
@@ -3058,15 +3058,21 @@ function useActionService() {
|
|
|
3058
3058
|
const loadAction = (0, import_react6.useCallback)(
|
|
3059
3059
|
async ({
|
|
3060
3060
|
idAction,
|
|
3061
|
-
context
|
|
3061
|
+
context,
|
|
3062
|
+
service
|
|
3062
3063
|
}) => {
|
|
3063
3064
|
const jsonData = {
|
|
3064
3065
|
action_id: idAction,
|
|
3065
3066
|
with_context: { ...context }
|
|
3066
3067
|
};
|
|
3067
|
-
return env.requests.post(
|
|
3068
|
-
|
|
3069
|
-
|
|
3068
|
+
return env.requests.post(
|
|
3069
|
+
"/load_action" /* LOAD_ACTION */,
|
|
3070
|
+
jsonData,
|
|
3071
|
+
{
|
|
3072
|
+
headers: { "Content-Type": "application/json" }
|
|
3073
|
+
},
|
|
3074
|
+
service
|
|
3075
|
+
);
|
|
3070
3076
|
},
|
|
3071
3077
|
[env]
|
|
3072
3078
|
);
|
|
@@ -3075,7 +3081,8 @@ function useActionService() {
|
|
|
3075
3081
|
model,
|
|
3076
3082
|
ids = [],
|
|
3077
3083
|
context,
|
|
3078
|
-
method
|
|
3084
|
+
method,
|
|
3085
|
+
service
|
|
3079
3086
|
}) => {
|
|
3080
3087
|
try {
|
|
3081
3088
|
const jsonData = {
|
|
@@ -3084,9 +3091,14 @@ function useActionService() {
|
|
|
3084
3091
|
ids,
|
|
3085
3092
|
with_context: context
|
|
3086
3093
|
};
|
|
3087
|
-
return env.requests.post(
|
|
3088
|
-
|
|
3089
|
-
|
|
3094
|
+
return env.requests.post(
|
|
3095
|
+
"/call" /* CALL_PATH */,
|
|
3096
|
+
jsonData,
|
|
3097
|
+
{
|
|
3098
|
+
headers: { "Content-Type": "application/json" }
|
|
3099
|
+
},
|
|
3100
|
+
service
|
|
3101
|
+
);
|
|
3090
3102
|
} catch (error) {
|
|
3091
3103
|
console.error("Error when calling button action:", error);
|
|
3092
3104
|
throw error;
|
|
@@ -3098,7 +3110,8 @@ function useActionService() {
|
|
|
3098
3110
|
async ({
|
|
3099
3111
|
model,
|
|
3100
3112
|
ids,
|
|
3101
|
-
context
|
|
3113
|
+
context,
|
|
3114
|
+
service
|
|
3102
3115
|
}) => {
|
|
3103
3116
|
const jsonData = {
|
|
3104
3117
|
model,
|
|
@@ -3106,9 +3119,14 @@ function useActionService() {
|
|
|
3106
3119
|
ids,
|
|
3107
3120
|
with_context: context
|
|
3108
3121
|
};
|
|
3109
|
-
return env.requests.post(
|
|
3110
|
-
|
|
3111
|
-
|
|
3122
|
+
return env.requests.post(
|
|
3123
|
+
"/call" /* CALL_PATH */,
|
|
3124
|
+
jsonData,
|
|
3125
|
+
{
|
|
3126
|
+
headers: { "Content-Type": "application/json" }
|
|
3127
|
+
},
|
|
3128
|
+
service
|
|
3129
|
+
);
|
|
3112
3130
|
},
|
|
3113
3131
|
[env]
|
|
3114
3132
|
);
|
|
@@ -3116,7 +3134,8 @@ function useActionService() {
|
|
|
3116
3134
|
async ({
|
|
3117
3135
|
model,
|
|
3118
3136
|
id,
|
|
3119
|
-
context
|
|
3137
|
+
context,
|
|
3138
|
+
service
|
|
3120
3139
|
}) => {
|
|
3121
3140
|
const jsonData = {
|
|
3122
3141
|
model,
|
|
@@ -3124,9 +3143,14 @@ function useActionService() {
|
|
|
3124
3143
|
ids: id,
|
|
3125
3144
|
with_context: context
|
|
3126
3145
|
};
|
|
3127
|
-
return env.requests.post(
|
|
3128
|
-
|
|
3129
|
-
|
|
3146
|
+
return env.requests.post(
|
|
3147
|
+
"/call" /* CALL_PATH */,
|
|
3148
|
+
jsonData,
|
|
3149
|
+
{
|
|
3150
|
+
headers: { "Content-Type": "application/json" }
|
|
3151
|
+
},
|
|
3152
|
+
service
|
|
3153
|
+
);
|
|
3130
3154
|
},
|
|
3131
3155
|
[env]
|
|
3132
3156
|
);
|
|
@@ -3169,15 +3193,21 @@ function useActionService() {
|
|
|
3169
3193
|
const runAction = (0, import_react6.useCallback)(
|
|
3170
3194
|
async ({
|
|
3171
3195
|
idAction,
|
|
3172
|
-
context
|
|
3196
|
+
context,
|
|
3197
|
+
service
|
|
3173
3198
|
}) => {
|
|
3174
3199
|
const jsonData = {
|
|
3175
3200
|
action_id: idAction,
|
|
3176
3201
|
with_context: { ...context }
|
|
3177
3202
|
};
|
|
3178
|
-
return env.requests.post(
|
|
3179
|
-
|
|
3180
|
-
|
|
3203
|
+
return env.requests.post(
|
|
3204
|
+
"/run_action" /* RUN_ACTION_PATH */,
|
|
3205
|
+
jsonData,
|
|
3206
|
+
{
|
|
3207
|
+
headers: { "Content-Type": "application/json" }
|
|
3208
|
+
},
|
|
3209
|
+
service
|
|
3210
|
+
);
|
|
3181
3211
|
},
|
|
3182
3212
|
[env]
|
|
3183
3213
|
);
|
|
@@ -3892,7 +3922,7 @@ function useModelService() {
|
|
|
3892
3922
|
});
|
|
3893
3923
|
}, [env]);
|
|
3894
3924
|
const getAll = (0, import_react12.useCallback)(
|
|
3895
|
-
async ({ data }) => {
|
|
3925
|
+
async ({ data, service }) => {
|
|
3896
3926
|
const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
|
|
3897
3927
|
fields: data.fields,
|
|
3898
3928
|
groupby: data.groupby
|
|
@@ -3913,11 +3943,16 @@ function useModelService() {
|
|
|
3913
3943
|
...jsonReadGroup
|
|
3914
3944
|
}
|
|
3915
3945
|
};
|
|
3916
|
-
return env.requests.post(
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3946
|
+
return env.requests.post(
|
|
3947
|
+
"/call" /* CALL_PATH */,
|
|
3948
|
+
jsonData,
|
|
3949
|
+
{
|
|
3950
|
+
headers: {
|
|
3951
|
+
"Content-Type": "application/json"
|
|
3952
|
+
}
|
|
3953
|
+
},
|
|
3954
|
+
service
|
|
3955
|
+
);
|
|
3921
3956
|
},
|
|
3922
3957
|
[env]
|
|
3923
3958
|
);
|
|
@@ -3985,7 +4020,13 @@ function useModelService() {
|
|
|
3985
4020
|
[env]
|
|
3986
4021
|
);
|
|
3987
4022
|
const getDetail = (0, import_react12.useCallback)(
|
|
3988
|
-
async ({
|
|
4023
|
+
async ({
|
|
4024
|
+
ids = [],
|
|
4025
|
+
model,
|
|
4026
|
+
specification,
|
|
4027
|
+
context,
|
|
4028
|
+
service
|
|
4029
|
+
}) => {
|
|
3989
4030
|
const jsonData = {
|
|
3990
4031
|
model,
|
|
3991
4032
|
method: "web_read" /* WEB_READ */,
|
|
@@ -3995,11 +4036,16 @@ function useModelService() {
|
|
|
3995
4036
|
specification
|
|
3996
4037
|
}
|
|
3997
4038
|
};
|
|
3998
|
-
return env.requests.post(
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4039
|
+
return env.requests.post(
|
|
4040
|
+
"/call" /* CALL_PATH */,
|
|
4041
|
+
jsonData,
|
|
4042
|
+
{
|
|
4043
|
+
headers: {
|
|
4044
|
+
"Content-Type": "application/json"
|
|
4045
|
+
}
|
|
4046
|
+
},
|
|
4047
|
+
service
|
|
4048
|
+
);
|
|
4003
4049
|
},
|
|
4004
4050
|
[env]
|
|
4005
4051
|
);
|
|
@@ -4010,7 +4056,8 @@ function useModelService() {
|
|
|
4010
4056
|
data = {},
|
|
4011
4057
|
specification = {},
|
|
4012
4058
|
context = {},
|
|
4013
|
-
path
|
|
4059
|
+
path,
|
|
4060
|
+
service
|
|
4014
4061
|
}) => {
|
|
4015
4062
|
const jsonData = {
|
|
4016
4063
|
model,
|
|
@@ -4022,26 +4069,36 @@ function useModelService() {
|
|
|
4022
4069
|
specification
|
|
4023
4070
|
}
|
|
4024
4071
|
};
|
|
4025
|
-
return env.requests.post(
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4072
|
+
return env.requests.post(
|
|
4073
|
+
path ?? "/call" /* CALL_PATH */,
|
|
4074
|
+
jsonData,
|
|
4075
|
+
{
|
|
4076
|
+
headers: {
|
|
4077
|
+
"Content-Type": "application/json"
|
|
4078
|
+
}
|
|
4079
|
+
},
|
|
4080
|
+
service
|
|
4081
|
+
);
|
|
4030
4082
|
},
|
|
4031
4083
|
[env]
|
|
4032
4084
|
);
|
|
4033
4085
|
const deleteApi = (0, import_react12.useCallback)(
|
|
4034
|
-
async ({ ids = [], model }) => {
|
|
4086
|
+
async ({ ids = [], model, service }) => {
|
|
4035
4087
|
const jsonData = {
|
|
4036
4088
|
model,
|
|
4037
4089
|
method: "unlink" /* UNLINK */,
|
|
4038
4090
|
ids
|
|
4039
4091
|
};
|
|
4040
|
-
return env.requests.post(
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4092
|
+
return env.requests.post(
|
|
4093
|
+
"/call" /* CALL_PATH */,
|
|
4094
|
+
jsonData,
|
|
4095
|
+
{
|
|
4096
|
+
headers: {
|
|
4097
|
+
"Content-Type": "application/json"
|
|
4098
|
+
}
|
|
4099
|
+
},
|
|
4100
|
+
service
|
|
4101
|
+
);
|
|
4045
4102
|
},
|
|
4046
4103
|
[env]
|
|
4047
4104
|
);
|
|
@@ -4052,7 +4109,8 @@ function useModelService() {
|
|
|
4052
4109
|
object,
|
|
4053
4110
|
specification,
|
|
4054
4111
|
context,
|
|
4055
|
-
fieldChange
|
|
4112
|
+
fieldChange,
|
|
4113
|
+
service
|
|
4056
4114
|
}) => {
|
|
4057
4115
|
const jsonData = {
|
|
4058
4116
|
model,
|
|
@@ -4065,11 +4123,16 @@ function useModelService() {
|
|
|
4065
4123
|
specification
|
|
4066
4124
|
]
|
|
4067
4125
|
};
|
|
4068
|
-
return env.requests.post(
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4126
|
+
return env.requests.post(
|
|
4127
|
+
"/call" /* CALL_PATH */,
|
|
4128
|
+
jsonData,
|
|
4129
|
+
{
|
|
4130
|
+
headers: {
|
|
4131
|
+
"Content-Type": "application/json"
|
|
4132
|
+
}
|
|
4133
|
+
},
|
|
4134
|
+
service
|
|
4135
|
+
);
|
|
4073
4136
|
},
|
|
4074
4137
|
[env]
|
|
4075
4138
|
);
|
|
@@ -4243,7 +4306,8 @@ function useViewService() {
|
|
|
4243
4306
|
views,
|
|
4244
4307
|
context = {},
|
|
4245
4308
|
options = {},
|
|
4246
|
-
aid
|
|
4309
|
+
aid,
|
|
4310
|
+
service
|
|
4247
4311
|
}) => {
|
|
4248
4312
|
const defaultOptions = {
|
|
4249
4313
|
load_filters: true,
|
|
@@ -4259,11 +4323,16 @@ function useViewService() {
|
|
|
4259
4323
|
},
|
|
4260
4324
|
with_context: context
|
|
4261
4325
|
};
|
|
4262
|
-
return env?.requests?.post(
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4326
|
+
return env?.requests?.post(
|
|
4327
|
+
"/call" /* CALL_PATH */,
|
|
4328
|
+
jsonDataView,
|
|
4329
|
+
{
|
|
4330
|
+
headers: {
|
|
4331
|
+
"Content-Type": "application/json"
|
|
4332
|
+
}
|
|
4333
|
+
},
|
|
4334
|
+
service
|
|
4335
|
+
);
|
|
4267
4336
|
},
|
|
4268
4337
|
[env]
|
|
4269
4338
|
);
|
|
@@ -4346,7 +4415,7 @@ function useViewService() {
|
|
|
4346
4415
|
[env]
|
|
4347
4416
|
);
|
|
4348
4417
|
const getSelectionItem = (0, import_react14.useCallback)(
|
|
4349
|
-
async ({ data }) => {
|
|
4418
|
+
async ({ data, service }) => {
|
|
4350
4419
|
const jsonData = {
|
|
4351
4420
|
model: data.model,
|
|
4352
4421
|
ids: [],
|
|
@@ -4364,11 +4433,16 @@ function useViewService() {
|
|
|
4364
4433
|
}
|
|
4365
4434
|
}
|
|
4366
4435
|
};
|
|
4367
|
-
return env?.requests.post(
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4436
|
+
return env?.requests.post(
|
|
4437
|
+
"/call" /* CALL_PATH */,
|
|
4438
|
+
jsonData,
|
|
4439
|
+
{
|
|
4440
|
+
headers: {
|
|
4441
|
+
"Content-Type": "application/json"
|
|
4442
|
+
}
|
|
4443
|
+
},
|
|
4444
|
+
service
|
|
4445
|
+
);
|
|
4372
4446
|
},
|
|
4373
4447
|
[env]
|
|
4374
4448
|
);
|