@fctc/interface-logic 2.2.2 → 2.2.3

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
@@ -3015,15 +3015,21 @@ function useActionService() {
3015
3015
  const loadAction = useCallback2(
3016
3016
  async ({
3017
3017
  idAction,
3018
- context
3018
+ context,
3019
+ service
3019
3020
  }) => {
3020
3021
  const jsonData = {
3021
3022
  action_id: idAction,
3022
3023
  with_context: { ...context }
3023
3024
  };
3024
- return env.requests.post("/load_action" /* LOAD_ACTION */, jsonData, {
3025
- headers: { "Content-Type": "application/json" }
3026
- });
3025
+ return env.requests.post(
3026
+ "/load_action" /* LOAD_ACTION */,
3027
+ jsonData,
3028
+ {
3029
+ headers: { "Content-Type": "application/json" }
3030
+ },
3031
+ service
3032
+ );
3027
3033
  },
3028
3034
  [env]
3029
3035
  );
@@ -3032,7 +3038,8 @@ function useActionService() {
3032
3038
  model,
3033
3039
  ids = [],
3034
3040
  context,
3035
- method
3041
+ method,
3042
+ service
3036
3043
  }) => {
3037
3044
  try {
3038
3045
  const jsonData = {
@@ -3041,9 +3048,14 @@ function useActionService() {
3041
3048
  ids,
3042
3049
  with_context: context
3043
3050
  };
3044
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3045
- headers: { "Content-Type": "application/json" }
3046
- });
3051
+ return env.requests.post(
3052
+ "/call" /* CALL_PATH */,
3053
+ jsonData,
3054
+ {
3055
+ headers: { "Content-Type": "application/json" }
3056
+ },
3057
+ service
3058
+ );
3047
3059
  } catch (error) {
3048
3060
  console.error("Error when calling button action:", error);
3049
3061
  throw error;
@@ -3055,7 +3067,8 @@ function useActionService() {
3055
3067
  async ({
3056
3068
  model,
3057
3069
  ids,
3058
- context
3070
+ context,
3071
+ service
3059
3072
  }) => {
3060
3073
  const jsonData = {
3061
3074
  model,
@@ -3063,9 +3076,14 @@ function useActionService() {
3063
3076
  ids,
3064
3077
  with_context: context
3065
3078
  };
3066
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3067
- headers: { "Content-Type": "application/json" }
3068
- });
3079
+ return env.requests.post(
3080
+ "/call" /* CALL_PATH */,
3081
+ jsonData,
3082
+ {
3083
+ headers: { "Content-Type": "application/json" }
3084
+ },
3085
+ service
3086
+ );
3069
3087
  },
3070
3088
  [env]
3071
3089
  );
@@ -3073,7 +3091,8 @@ function useActionService() {
3073
3091
  async ({
3074
3092
  model,
3075
3093
  id,
3076
- context
3094
+ context,
3095
+ service
3077
3096
  }) => {
3078
3097
  const jsonData = {
3079
3098
  model,
@@ -3081,9 +3100,14 @@ function useActionService() {
3081
3100
  ids: id,
3082
3101
  with_context: context
3083
3102
  };
3084
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3085
- headers: { "Content-Type": "application/json" }
3086
- });
3103
+ return env.requests.post(
3104
+ "/call" /* CALL_PATH */,
3105
+ jsonData,
3106
+ {
3107
+ headers: { "Content-Type": "application/json" }
3108
+ },
3109
+ service
3110
+ );
3087
3111
  },
3088
3112
  [env]
3089
3113
  );
@@ -3126,15 +3150,21 @@ function useActionService() {
3126
3150
  const runAction = useCallback2(
3127
3151
  async ({
3128
3152
  idAction,
3129
- context
3153
+ context,
3154
+ service
3130
3155
  }) => {
3131
3156
  const jsonData = {
3132
3157
  action_id: idAction,
3133
3158
  with_context: { ...context }
3134
3159
  };
3135
- return env.requests.post("/run_action" /* RUN_ACTION_PATH */, jsonData, {
3136
- headers: { "Content-Type": "application/json" }
3137
- });
3160
+ return env.requests.post(
3161
+ "/run_action" /* RUN_ACTION_PATH */,
3162
+ jsonData,
3163
+ {
3164
+ headers: { "Content-Type": "application/json" }
3165
+ },
3166
+ service
3167
+ );
3138
3168
  },
3139
3169
  [env]
3140
3170
  );
@@ -3320,15 +3350,11 @@ function useAuthService() {
3320
3350
  data.append("grant_type", "authorization_code");
3321
3351
  data.append("client_id", env?.config?.clientId || "");
3322
3352
  data.append("redirect_uri", env?.config?.redirectUri || "");
3323
- return env?.requests?.post(
3324
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3325
- data,
3326
- {
3327
- headers: {
3328
- "Content-Type": "application/x-www-form-urlencoded"
3329
- }
3353
+ return env?.requests?.post("/token" /* TOKEN_BY_CODE */, data, {
3354
+ headers: {
3355
+ "Content-Type": "application/x-www-form-urlencoded"
3330
3356
  }
3331
- );
3357
+ });
3332
3358
  },
3333
3359
  [env]
3334
3360
  );
@@ -3846,7 +3872,7 @@ function useModelService() {
3846
3872
  });
3847
3873
  }, [env]);
3848
3874
  const getAll = useCallback8(
3849
- async ({ data }) => {
3875
+ async ({ data, service }) => {
3850
3876
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3851
3877
  fields: data.fields,
3852
3878
  groupby: data.groupby
@@ -3867,11 +3893,16 @@ function useModelService() {
3867
3893
  ...jsonReadGroup
3868
3894
  }
3869
3895
  };
3870
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3871
- headers: {
3872
- "Content-Type": "application/json"
3873
- }
3874
- });
3896
+ return env.requests.post(
3897
+ "/call" /* CALL_PATH */,
3898
+ jsonData,
3899
+ {
3900
+ headers: {
3901
+ "Content-Type": "application/json"
3902
+ }
3903
+ },
3904
+ service
3905
+ );
3875
3906
  },
3876
3907
  [env]
3877
3908
  );
@@ -3939,7 +3970,13 @@ function useModelService() {
3939
3970
  [env]
3940
3971
  );
3941
3972
  const getDetail = useCallback8(
3942
- async ({ ids = [], model, specification, context }) => {
3973
+ async ({
3974
+ ids = [],
3975
+ model,
3976
+ specification,
3977
+ context,
3978
+ service
3979
+ }) => {
3943
3980
  const jsonData = {
3944
3981
  model,
3945
3982
  method: "web_read" /* WEB_READ */,
@@ -3949,11 +3986,16 @@ function useModelService() {
3949
3986
  specification
3950
3987
  }
3951
3988
  };
3952
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3953
- headers: {
3954
- "Content-Type": "application/json"
3955
- }
3956
- });
3989
+ return env.requests.post(
3990
+ "/call" /* CALL_PATH */,
3991
+ jsonData,
3992
+ {
3993
+ headers: {
3994
+ "Content-Type": "application/json"
3995
+ }
3996
+ },
3997
+ service
3998
+ );
3957
3999
  },
3958
4000
  [env]
3959
4001
  );
@@ -3964,7 +4006,8 @@ function useModelService() {
3964
4006
  data = {},
3965
4007
  specification = {},
3966
4008
  context = {},
3967
- path
4009
+ path,
4010
+ service
3968
4011
  }) => {
3969
4012
  const jsonData = {
3970
4013
  model,
@@ -3976,26 +4019,36 @@ function useModelService() {
3976
4019
  specification
3977
4020
  }
3978
4021
  };
3979
- return env.requests.post(path ?? "/call" /* CALL_PATH */, jsonData, {
3980
- headers: {
3981
- "Content-Type": "application/json"
3982
- }
3983
- });
4022
+ return env.requests.post(
4023
+ path ?? "/call" /* CALL_PATH */,
4024
+ jsonData,
4025
+ {
4026
+ headers: {
4027
+ "Content-Type": "application/json"
4028
+ }
4029
+ },
4030
+ service
4031
+ );
3984
4032
  },
3985
4033
  [env]
3986
4034
  );
3987
4035
  const deleteApi = useCallback8(
3988
- async ({ ids = [], model }) => {
4036
+ async ({ ids = [], model, service }) => {
3989
4037
  const jsonData = {
3990
4038
  model,
3991
4039
  method: "unlink" /* UNLINK */,
3992
4040
  ids
3993
4041
  };
3994
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3995
- headers: {
3996
- "Content-Type": "application/json"
3997
- }
3998
- });
4042
+ return env.requests.post(
4043
+ "/call" /* CALL_PATH */,
4044
+ jsonData,
4045
+ {
4046
+ headers: {
4047
+ "Content-Type": "application/json"
4048
+ }
4049
+ },
4050
+ service
4051
+ );
3999
4052
  },
4000
4053
  [env]
4001
4054
  );
@@ -4006,7 +4059,8 @@ function useModelService() {
4006
4059
  object,
4007
4060
  specification,
4008
4061
  context,
4009
- fieldChange
4062
+ fieldChange,
4063
+ service
4010
4064
  }) => {
4011
4065
  const jsonData = {
4012
4066
  model,
@@ -4019,25 +4073,35 @@ function useModelService() {
4019
4073
  specification
4020
4074
  ]
4021
4075
  };
4022
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
4023
- headers: {
4024
- "Content-Type": "application/json"
4025
- }
4026
- });
4076
+ return env.requests.post(
4077
+ "/call" /* CALL_PATH */,
4078
+ jsonData,
4079
+ {
4080
+ headers: {
4081
+ "Content-Type": "application/json"
4082
+ }
4083
+ },
4084
+ service
4085
+ );
4027
4086
  },
4028
4087
  [env]
4029
4088
  );
4030
4089
  const getListFieldsOnchange = useCallback8(
4031
- async ({ model }) => {
4090
+ async ({ model, service }) => {
4032
4091
  const jsonData = {
4033
4092
  model,
4034
4093
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4035
4094
  };
4036
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
4037
- headers: {
4038
- "Content-Type": "application/json"
4039
- }
4040
- });
4095
+ return env.requests.post(
4096
+ "/call" /* CALL_PATH */,
4097
+ jsonData,
4098
+ {
4099
+ headers: {
4100
+ "Content-Type": "application/json"
4101
+ }
4102
+ },
4103
+ service
4104
+ );
4041
4105
  },
4042
4106
  [env]
4043
4107
  );
@@ -4197,7 +4261,8 @@ function useViewService() {
4197
4261
  views,
4198
4262
  context = {},
4199
4263
  options = {},
4200
- aid
4264
+ aid,
4265
+ service
4201
4266
  }) => {
4202
4267
  const defaultOptions = {
4203
4268
  load_filters: true,
@@ -4213,11 +4278,16 @@ function useViewService() {
4213
4278
  },
4214
4279
  with_context: context
4215
4280
  };
4216
- return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4217
- headers: {
4218
- "Content-Type": "application/json"
4219
- }
4220
- });
4281
+ return env?.requests?.post(
4282
+ "/call" /* CALL_PATH */,
4283
+ jsonDataView,
4284
+ {
4285
+ headers: {
4286
+ "Content-Type": "application/json"
4287
+ }
4288
+ },
4289
+ service
4290
+ );
4221
4291
  },
4222
4292
  [env]
4223
4293
  );
@@ -4300,7 +4370,7 @@ function useViewService() {
4300
4370
  [env]
4301
4371
  );
4302
4372
  const getSelectionItem = useCallback10(
4303
- async ({ data }) => {
4373
+ async ({ data, service }) => {
4304
4374
  const jsonData = {
4305
4375
  model: data.model,
4306
4376
  ids: [],
@@ -4318,11 +4388,16 @@ function useViewService() {
4318
4388
  }
4319
4389
  }
4320
4390
  };
4321
- return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4322
- headers: {
4323
- "Content-Type": "application/json"
4324
- }
4325
- });
4391
+ return env?.requests.post(
4392
+ "/call" /* CALL_PATH */,
4393
+ jsonData,
4394
+ {
4395
+ headers: {
4396
+ "Content-Type": "application/json"
4397
+ }
4398
+ },
4399
+ service
4400
+ );
4326
4401
  },
4327
4402
  [env]
4328
4403
  );
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.2.2",
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.3",
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
+ }