@fctc/interface-logic 2.1.4 → 2.2.0

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/services.mjs CHANGED
@@ -3014,15 +3014,21 @@ function useActionService() {
3014
3014
  const loadAction = useCallback2(
3015
3015
  async ({
3016
3016
  idAction,
3017
- context
3017
+ context,
3018
+ service
3018
3019
  }) => {
3019
3020
  const jsonData = {
3020
3021
  action_id: idAction,
3021
3022
  with_context: { ...context }
3022
3023
  };
3023
- return env.requests.post("/load_action" /* LOAD_ACTION */, jsonData, {
3024
- headers: { "Content-Type": "application/json" }
3025
- });
3024
+ return env.requests.post(
3025
+ "/load_action" /* LOAD_ACTION */,
3026
+ jsonData,
3027
+ {
3028
+ headers: { "Content-Type": "application/json" }
3029
+ },
3030
+ service
3031
+ );
3026
3032
  },
3027
3033
  [env]
3028
3034
  );
@@ -3031,7 +3037,8 @@ function useActionService() {
3031
3037
  model,
3032
3038
  ids = [],
3033
3039
  context,
3034
- method
3040
+ method,
3041
+ service
3035
3042
  }) => {
3036
3043
  try {
3037
3044
  const jsonData = {
@@ -3040,9 +3047,14 @@ function useActionService() {
3040
3047
  ids,
3041
3048
  with_context: context
3042
3049
  };
3043
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3044
- headers: { "Content-Type": "application/json" }
3045
- });
3050
+ return env.requests.post(
3051
+ "/call" /* CALL_PATH */,
3052
+ jsonData,
3053
+ {
3054
+ headers: { "Content-Type": "application/json" }
3055
+ },
3056
+ service
3057
+ );
3046
3058
  } catch (error) {
3047
3059
  console.error("Error when calling button action:", error);
3048
3060
  throw error;
@@ -3054,7 +3066,8 @@ function useActionService() {
3054
3066
  async ({
3055
3067
  model,
3056
3068
  ids,
3057
- context
3069
+ context,
3070
+ service
3058
3071
  }) => {
3059
3072
  const jsonData = {
3060
3073
  model,
@@ -3062,9 +3075,14 @@ function useActionService() {
3062
3075
  ids,
3063
3076
  with_context: context
3064
3077
  };
3065
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3066
- headers: { "Content-Type": "application/json" }
3067
- });
3078
+ return env.requests.post(
3079
+ "/call" /* CALL_PATH */,
3080
+ jsonData,
3081
+ {
3082
+ headers: { "Content-Type": "application/json" }
3083
+ },
3084
+ service
3085
+ );
3068
3086
  },
3069
3087
  [env]
3070
3088
  );
@@ -3072,7 +3090,8 @@ function useActionService() {
3072
3090
  async ({
3073
3091
  model,
3074
3092
  id,
3075
- context
3093
+ context,
3094
+ service
3076
3095
  }) => {
3077
3096
  const jsonData = {
3078
3097
  model,
@@ -3080,9 +3099,14 @@ function useActionService() {
3080
3099
  ids: id,
3081
3100
  with_context: context
3082
3101
  };
3083
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3084
- headers: { "Content-Type": "application/json" }
3085
- });
3102
+ return env.requests.post(
3103
+ "/call" /* CALL_PATH */,
3104
+ jsonData,
3105
+ {
3106
+ headers: { "Content-Type": "application/json" }
3107
+ },
3108
+ service
3109
+ );
3086
3110
  },
3087
3111
  [env]
3088
3112
  );
@@ -3125,15 +3149,21 @@ function useActionService() {
3125
3149
  const runAction = useCallback2(
3126
3150
  async ({
3127
3151
  idAction,
3128
- context
3152
+ context,
3153
+ service
3129
3154
  }) => {
3130
3155
  const jsonData = {
3131
3156
  action_id: idAction,
3132
3157
  with_context: { ...context }
3133
3158
  };
3134
- return env.requests.post("/run_action" /* RUN_ACTION_PATH */, jsonData, {
3135
- headers: { "Content-Type": "application/json" }
3136
- });
3159
+ return env.requests.post(
3160
+ "/run_action" /* RUN_ACTION_PATH */,
3161
+ jsonData,
3162
+ {
3163
+ headers: { "Content-Type": "application/json" }
3164
+ },
3165
+ service
3166
+ );
3137
3167
  },
3138
3168
  [env]
3139
3169
  );
@@ -3848,7 +3878,7 @@ function useModelService() {
3848
3878
  });
3849
3879
  }, [env]);
3850
3880
  const getAll = useCallback8(
3851
- async ({ data }) => {
3881
+ async ({ data, service }) => {
3852
3882
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3853
3883
  fields: data.fields,
3854
3884
  groupby: data.groupby
@@ -3869,11 +3899,16 @@ function useModelService() {
3869
3899
  ...jsonReadGroup
3870
3900
  }
3871
3901
  };
3872
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3873
- headers: {
3874
- "Content-Type": "application/json"
3875
- }
3876
- });
3902
+ return env.requests.post(
3903
+ "/call" /* CALL_PATH */,
3904
+ jsonData,
3905
+ {
3906
+ headers: {
3907
+ "Content-Type": "application/json"
3908
+ }
3909
+ },
3910
+ service
3911
+ );
3877
3912
  },
3878
3913
  [env]
3879
3914
  );
@@ -3941,7 +3976,13 @@ function useModelService() {
3941
3976
  [env]
3942
3977
  );
3943
3978
  const getDetail = useCallback8(
3944
- async ({ ids = [], model, specification, context }) => {
3979
+ async ({
3980
+ ids = [],
3981
+ model,
3982
+ specification,
3983
+ context,
3984
+ service
3985
+ }) => {
3945
3986
  const jsonData = {
3946
3987
  model,
3947
3988
  method: "web_read" /* WEB_READ */,
@@ -3951,11 +3992,16 @@ function useModelService() {
3951
3992
  specification
3952
3993
  }
3953
3994
  };
3954
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3955
- headers: {
3956
- "Content-Type": "application/json"
3957
- }
3958
- });
3995
+ return env.requests.post(
3996
+ "/call" /* CALL_PATH */,
3997
+ jsonData,
3998
+ {
3999
+ headers: {
4000
+ "Content-Type": "application/json"
4001
+ }
4002
+ },
4003
+ service
4004
+ );
3959
4005
  },
3960
4006
  [env]
3961
4007
  );
@@ -3966,7 +4012,8 @@ function useModelService() {
3966
4012
  data = {},
3967
4013
  specification = {},
3968
4014
  context = {},
3969
- path
4015
+ path,
4016
+ service
3970
4017
  }) => {
3971
4018
  const jsonData = {
3972
4019
  model,
@@ -3978,26 +4025,36 @@ function useModelService() {
3978
4025
  specification
3979
4026
  }
3980
4027
  };
3981
- return env.requests.post(path ?? "/call" /* CALL_PATH */, jsonData, {
3982
- headers: {
3983
- "Content-Type": "application/json"
3984
- }
3985
- });
4028
+ return env.requests.post(
4029
+ path ?? "/call" /* CALL_PATH */,
4030
+ jsonData,
4031
+ {
4032
+ headers: {
4033
+ "Content-Type": "application/json"
4034
+ }
4035
+ },
4036
+ service
4037
+ );
3986
4038
  },
3987
4039
  [env]
3988
4040
  );
3989
4041
  const deleteApi = useCallback8(
3990
- async ({ ids = [], model }) => {
4042
+ async ({ ids = [], model, service }) => {
3991
4043
  const jsonData = {
3992
4044
  model,
3993
4045
  method: "unlink" /* UNLINK */,
3994
4046
  ids
3995
4047
  };
3996
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3997
- headers: {
3998
- "Content-Type": "application/json"
3999
- }
4000
- });
4048
+ return env.requests.post(
4049
+ "/call" /* CALL_PATH */,
4050
+ jsonData,
4051
+ {
4052
+ headers: {
4053
+ "Content-Type": "application/json"
4054
+ }
4055
+ },
4056
+ service
4057
+ );
4001
4058
  },
4002
4059
  [env]
4003
4060
  );
@@ -4008,7 +4065,8 @@ function useModelService() {
4008
4065
  object,
4009
4066
  specification,
4010
4067
  context,
4011
- fieldChange
4068
+ fieldChange,
4069
+ service
4012
4070
  }) => {
4013
4071
  const jsonData = {
4014
4072
  model,
@@ -4021,25 +4079,36 @@ function useModelService() {
4021
4079
  specification
4022
4080
  ]
4023
4081
  };
4024
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
4025
- headers: {
4026
- "Content-Type": "application/json"
4027
- }
4028
- });
4082
+ return env.requests.post(
4083
+ "/call" /* CALL_PATH */,
4084
+ jsonData,
4085
+ {
4086
+ headers: {
4087
+ "Content-Type": "application/json"
4088
+ }
4089
+ },
4090
+ service
4091
+ );
4029
4092
  },
4030
4093
  [env]
4031
4094
  );
4032
4095
  const getListFieldsOnchange = useCallback8(
4033
- async ({ model }) => {
4096
+ async ({ model, service }) => {
4097
+ console.log("service", service);
4034
4098
  const jsonData = {
4035
4099
  model,
4036
4100
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4037
4101
  };
4038
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
4039
- headers: {
4040
- "Content-Type": "application/json"
4041
- }
4042
- });
4102
+ return env.requests.post(
4103
+ "/call" /* CALL_PATH */,
4104
+ jsonData,
4105
+ {
4106
+ headers: {
4107
+ "Content-Type": "application/json"
4108
+ }
4109
+ },
4110
+ service
4111
+ );
4043
4112
  },
4044
4113
  [env]
4045
4114
  );
@@ -4199,7 +4268,8 @@ function useViewService() {
4199
4268
  views,
4200
4269
  context = {},
4201
4270
  options = {},
4202
- aid
4271
+ aid,
4272
+ service
4203
4273
  }) => {
4204
4274
  const defaultOptions = {
4205
4275
  load_filters: true,
@@ -4215,11 +4285,16 @@ function useViewService() {
4215
4285
  },
4216
4286
  with_context: context
4217
4287
  };
4218
- return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4219
- headers: {
4220
- "Content-Type": "application/json"
4221
- }
4222
- });
4288
+ return env?.requests?.post(
4289
+ "/call" /* CALL_PATH */,
4290
+ jsonDataView,
4291
+ {
4292
+ headers: {
4293
+ "Content-Type": "application/json"
4294
+ }
4295
+ },
4296
+ service
4297
+ );
4223
4298
  },
4224
4299
  [env]
4225
4300
  );
@@ -4302,7 +4377,7 @@ function useViewService() {
4302
4377
  [env]
4303
4378
  );
4304
4379
  const getSelectionItem = useCallback10(
4305
- async ({ data }) => {
4380
+ async ({ data, service }) => {
4306
4381
  const jsonData = {
4307
4382
  model: data.model,
4308
4383
  ids: [],
@@ -4320,11 +4395,16 @@ function useViewService() {
4320
4395
  }
4321
4396
  }
4322
4397
  };
4323
- return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4324
- headers: {
4325
- "Content-Type": "application/json"
4326
- }
4327
- });
4398
+ return env?.requests.post(
4399
+ "/call" /* CALL_PATH */,
4400
+ jsonData,
4401
+ {
4402
+ headers: {
4403
+ "Content-Type": "application/json"
4404
+ }
4405
+ },
4406
+ service
4407
+ );
4328
4408
  },
4329
4409
  [env]
4330
4410
  );
package/dist/types.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-BGJfDe73.mjs';
1
+ export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-p4JdAOsz.mjs';
2
2
 
3
3
  interface Config {
4
4
  baseUrl: string;
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-BGJfDe73.js';
1
+ export { C as ContextApi, D as DeleteParams, F as ForgotPasswordBody, G as GetAllParams, a as GetDetailParams, b as GetListParams, c as GetSelectionType, f as GetViewParams, L as LoginCredentialBody, O as OnChangeParams, R as ResetPasswordRequest, S as SaveParams, d as SocialTokenBody, e as Specification, U as UpdatePasswordRequest, g as View, V as ViewData, u as updatePasswordBody } from './view-type-p4JdAOsz.js';
2
2
 
3
3
  interface Config {
4
4
  baseUrl: string;
@@ -58,6 +58,7 @@ interface GetDetailParams {
58
58
  model?: string;
59
59
  specification?: Specification;
60
60
  context?: ContextApi;
61
+ service?: string;
61
62
  }
62
63
  interface SaveParams {
63
64
  model: string;
@@ -66,10 +67,12 @@ interface SaveParams {
66
67
  specification?: Specification;
67
68
  context?: ContextApi;
68
69
  path?: string;
70
+ service?: string;
69
71
  }
70
72
  interface DeleteParams {
71
73
  ids?: number[];
72
74
  model: string;
75
+ service?: string;
73
76
  }
74
77
  interface OnChangeParams {
75
78
  ids?: number[];
@@ -78,6 +81,7 @@ interface OnChangeParams {
78
81
  specification: Specification;
79
82
  context?: ContextApi;
80
83
  fieldChange?: string[];
84
+ service?: string;
81
85
  }
82
86
  interface ViewData {
83
87
  models?: {
@@ -108,6 +112,7 @@ interface GetViewParams {
108
112
  context?: Record<string, any>;
109
113
  options?: Option;
110
114
  aid?: number | string | null | boolean;
115
+ service?: string;
111
116
  }
112
117
 
113
118
  export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetAllParams as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SaveParams as S, UpdatePasswordRequest as U, ViewData as V, GetDetailParams as a, GetListParams as b, GetSelectionType as c, SocialTokenBody as d, Specification as e, GetViewParams as f, View as g, updatePasswordBody as u };
@@ -58,6 +58,7 @@ interface GetDetailParams {
58
58
  model?: string;
59
59
  specification?: Specification;
60
60
  context?: ContextApi;
61
+ service?: string;
61
62
  }
62
63
  interface SaveParams {
63
64
  model: string;
@@ -66,10 +67,12 @@ interface SaveParams {
66
67
  specification?: Specification;
67
68
  context?: ContextApi;
68
69
  path?: string;
70
+ service?: string;
69
71
  }
70
72
  interface DeleteParams {
71
73
  ids?: number[];
72
74
  model: string;
75
+ service?: string;
73
76
  }
74
77
  interface OnChangeParams {
75
78
  ids?: number[];
@@ -78,6 +81,7 @@ interface OnChangeParams {
78
81
  specification: Specification;
79
82
  context?: ContextApi;
80
83
  fieldChange?: string[];
84
+ service?: string;
81
85
  }
82
86
  interface ViewData {
83
87
  models?: {
@@ -108,6 +112,7 @@ interface GetViewParams {
108
112
  context?: Record<string, any>;
109
113
  options?: Option;
110
114
  aid?: number | string | null | boolean;
115
+ service?: string;
111
116
  }
112
117
 
113
118
  export type { ContextApi as C, DeleteParams as D, ForgotPasswordBody as F, GetAllParams as G, LoginCredentialBody as L, OnChangeParams as O, ResetPasswordRequest as R, SaveParams as S, UpdatePasswordRequest as U, ViewData as V, GetDetailParams as a, GetListParams as b, GetSelectionType as c, SocialTokenBody as d, Specification as e, GetViewParams as f, View as g, updatePasswordBody as u };
package/package.json CHANGED
@@ -1,85 +1,85 @@
1
- {
2
- "name": "@fctc/interface-logic",
3
- "version": "2.1.4",
4
- "types": "dist/index.d.ts",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.mjs",
7
- "exports": {
8
- ".": {
9
- "types": "./dist/index.d.ts",
10
- "import": "./dist/index.mjs",
11
- "require": "./dist/index.cjs"
12
- },
13
- "./configs": {
14
- "types": "./dist/configs.d.ts",
15
- "import": "./dist/configs.mjs",
16
- "require": "./dist/configs.cjs"
17
- },
18
- "./constants": {
19
- "types": "./dist/constants.d.ts",
20
- "import": "./dist/constants.mjs",
21
- "require": "./dist/constants.cjs"
22
- },
23
- "./environment": {
24
- "types": "./dist/environment.d.ts",
25
- "import": "./dist/environment.mjs",
26
- "require": "./dist/environment.cjs"
27
- },
28
- "./hooks": {
29
- "types": "./dist/hooks.d.ts",
30
- "import": "./dist/hooks.mjs",
31
- "require": "./dist/hooks.cjs"
32
- },
33
- "./provider": {
34
- "types": "./dist/provider.d.ts",
35
- "import": "./dist/provider.mjs",
36
- "require": "./dist/provider.cjs"
37
- },
38
- "./services": {
39
- "types": "./dist/services.d.ts",
40
- "import": "./dist/services.mjs",
41
- "require": "./dist/services.cjs"
42
- },
43
- "./store": {
44
- "types": "./dist/store.d.ts",
45
- "import": "./dist/store.mjs",
46
- "require": "./dist/store.cjs"
47
- },
48
- "./utils": {
49
- "types": "./dist/utils.d.ts",
50
- "import": "./dist/utils.mjs",
51
- "require": "./dist/utils.cjs"
52
- },
53
- "./types": {
54
- "types": "./dist/types.d.ts",
55
- "import": "./dist/types.mjs",
56
- "require": "./dist/types.cjs"
57
- }
58
- },
59
- "files": [
60
- "dist"
61
- ],
62
- "scripts": {
63
- "build": "tsup",
64
- "test": "jest"
65
- },
66
- "peerDependencies": {
67
- "react": "18.0.0",
68
- "@tanstack/react-query": "^5.83.0"
69
- },
70
- "dependencies": {
71
- "@reduxjs/toolkit": "^2.8.2",
72
- "@tanstack/react-query": "^5.83.0",
73
- "axios": "^1.11.0",
74
- "moment": "^2.30.1",
75
- "react-redux": "^9.2.0"
76
- },
77
- "devDependencies": {
78
- "@types/react": "^18.3.1",
79
- "react": "18.0.0",
80
- "jest": "^29.7.0",
81
- "tsup": "^8.0.0",
82
- "typescript": "^5.8.2"
83
- },
84
- "packageManager": "yarn@1.22.0"
85
- }
1
+ {
2
+ "name": "@fctc/interface-logic",
3
+ "version": "2.2.0",
4
+ "types": "dist/index.d.ts",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.mjs",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.mjs",
11
+ "require": "./dist/index.cjs"
12
+ },
13
+ "./configs": {
14
+ "types": "./dist/configs.d.ts",
15
+ "import": "./dist/configs.mjs",
16
+ "require": "./dist/configs.cjs"
17
+ },
18
+ "./constants": {
19
+ "types": "./dist/constants.d.ts",
20
+ "import": "./dist/constants.mjs",
21
+ "require": "./dist/constants.cjs"
22
+ },
23
+ "./environment": {
24
+ "types": "./dist/environment.d.ts",
25
+ "import": "./dist/environment.mjs",
26
+ "require": "./dist/environment.cjs"
27
+ },
28
+ "./hooks": {
29
+ "types": "./dist/hooks.d.ts",
30
+ "import": "./dist/hooks.mjs",
31
+ "require": "./dist/hooks.cjs"
32
+ },
33
+ "./provider": {
34
+ "types": "./dist/provider.d.ts",
35
+ "import": "./dist/provider.mjs",
36
+ "require": "./dist/provider.cjs"
37
+ },
38
+ "./services": {
39
+ "types": "./dist/services.d.ts",
40
+ "import": "./dist/services.mjs",
41
+ "require": "./dist/services.cjs"
42
+ },
43
+ "./store": {
44
+ "types": "./dist/store.d.ts",
45
+ "import": "./dist/store.mjs",
46
+ "require": "./dist/store.cjs"
47
+ },
48
+ "./utils": {
49
+ "types": "./dist/utils.d.ts",
50
+ "import": "./dist/utils.mjs",
51
+ "require": "./dist/utils.cjs"
52
+ },
53
+ "./types": {
54
+ "types": "./dist/types.d.ts",
55
+ "import": "./dist/types.mjs",
56
+ "require": "./dist/types.cjs"
57
+ }
58
+ },
59
+ "files": [
60
+ "dist"
61
+ ],
62
+ "scripts": {
63
+ "build": "tsup",
64
+ "test": "jest"
65
+ },
66
+ "peerDependencies": {
67
+ "react": "18.0.0",
68
+ "@tanstack/react-query": "^5.83.0"
69
+ },
70
+ "dependencies": {
71
+ "@reduxjs/toolkit": "^2.8.2",
72
+ "@tanstack/react-query": "^5.83.0",
73
+ "axios": "^1.11.0",
74
+ "moment": "^2.30.1",
75
+ "react-redux": "^9.2.0"
76
+ },
77
+ "devDependencies": {
78
+ "@types/react": "^18.3.1",
79
+ "react": "18.0.0",
80
+ "jest": "^29.7.0",
81
+ "tsup": "^8.0.0",
82
+ "typescript": "^5.8.2"
83
+ },
84
+ "packageManager": "yarn@1.22.0"
85
+ }