@fctc/interface-logic 2.2.2 → 2.2.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/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
  );
@@ -3321,13 +3351,14 @@ function useAuthService() {
3321
3351
  data.append("client_id", env?.config?.clientId || "");
3322
3352
  data.append("redirect_uri", env?.config?.redirectUri || "");
3323
3353
  return env?.requests?.post(
3324
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3354
+ "/token" /* TOKEN_BY_CODE */,
3325
3355
  data,
3326
3356
  {
3327
3357
  headers: {
3328
3358
  "Content-Type": "application/x-www-form-urlencoded"
3329
3359
  }
3330
- }
3360
+ },
3361
+ "id"
3331
3362
  );
3332
3363
  },
3333
3364
  [env]
@@ -3846,7 +3877,7 @@ function useModelService() {
3846
3877
  });
3847
3878
  }, [env]);
3848
3879
  const getAll = useCallback8(
3849
- async ({ data }) => {
3880
+ async ({ data, service }) => {
3850
3881
  const jsonReadGroup = data.type == "calendar" ? { fields: data?.fields } : data.fields && data.fields.length > 0 && data.groupby && data.groupby.length > 0 && data.groupby[0] ? {
3851
3882
  fields: data.fields,
3852
3883
  groupby: data.groupby
@@ -3867,11 +3898,16 @@ function useModelService() {
3867
3898
  ...jsonReadGroup
3868
3899
  }
3869
3900
  };
3870
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3871
- headers: {
3872
- "Content-Type": "application/json"
3873
- }
3874
- });
3901
+ return env.requests.post(
3902
+ "/call" /* CALL_PATH */,
3903
+ jsonData,
3904
+ {
3905
+ headers: {
3906
+ "Content-Type": "application/json"
3907
+ }
3908
+ },
3909
+ service
3910
+ );
3875
3911
  },
3876
3912
  [env]
3877
3913
  );
@@ -3939,7 +3975,13 @@ function useModelService() {
3939
3975
  [env]
3940
3976
  );
3941
3977
  const getDetail = useCallback8(
3942
- async ({ ids = [], model, specification, context }) => {
3978
+ async ({
3979
+ ids = [],
3980
+ model,
3981
+ specification,
3982
+ context,
3983
+ service
3984
+ }) => {
3943
3985
  const jsonData = {
3944
3986
  model,
3945
3987
  method: "web_read" /* WEB_READ */,
@@ -3949,11 +3991,16 @@ function useModelService() {
3949
3991
  specification
3950
3992
  }
3951
3993
  };
3952
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3953
- headers: {
3954
- "Content-Type": "application/json"
3955
- }
3956
- });
3994
+ return env.requests.post(
3995
+ "/call" /* CALL_PATH */,
3996
+ jsonData,
3997
+ {
3998
+ headers: {
3999
+ "Content-Type": "application/json"
4000
+ }
4001
+ },
4002
+ service
4003
+ );
3957
4004
  },
3958
4005
  [env]
3959
4006
  );
@@ -3964,7 +4011,8 @@ function useModelService() {
3964
4011
  data = {},
3965
4012
  specification = {},
3966
4013
  context = {},
3967
- path
4014
+ path,
4015
+ service
3968
4016
  }) => {
3969
4017
  const jsonData = {
3970
4018
  model,
@@ -3976,26 +4024,36 @@ function useModelService() {
3976
4024
  specification
3977
4025
  }
3978
4026
  };
3979
- return env.requests.post(path ?? "/call" /* CALL_PATH */, jsonData, {
3980
- headers: {
3981
- "Content-Type": "application/json"
3982
- }
3983
- });
4027
+ return env.requests.post(
4028
+ path ?? "/call" /* CALL_PATH */,
4029
+ jsonData,
4030
+ {
4031
+ headers: {
4032
+ "Content-Type": "application/json"
4033
+ }
4034
+ },
4035
+ service
4036
+ );
3984
4037
  },
3985
4038
  [env]
3986
4039
  );
3987
4040
  const deleteApi = useCallback8(
3988
- async ({ ids = [], model }) => {
4041
+ async ({ ids = [], model, service }) => {
3989
4042
  const jsonData = {
3990
4043
  model,
3991
4044
  method: "unlink" /* UNLINK */,
3992
4045
  ids
3993
4046
  };
3994
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
3995
- headers: {
3996
- "Content-Type": "application/json"
3997
- }
3998
- });
4047
+ return env.requests.post(
4048
+ "/call" /* CALL_PATH */,
4049
+ jsonData,
4050
+ {
4051
+ headers: {
4052
+ "Content-Type": "application/json"
4053
+ }
4054
+ },
4055
+ service
4056
+ );
3999
4057
  },
4000
4058
  [env]
4001
4059
  );
@@ -4006,7 +4064,8 @@ function useModelService() {
4006
4064
  object,
4007
4065
  specification,
4008
4066
  context,
4009
- fieldChange
4067
+ fieldChange,
4068
+ service
4010
4069
  }) => {
4011
4070
  const jsonData = {
4012
4071
  model,
@@ -4019,25 +4078,35 @@ function useModelService() {
4019
4078
  specification
4020
4079
  ]
4021
4080
  };
4022
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
4023
- headers: {
4024
- "Content-Type": "application/json"
4025
- }
4026
- });
4081
+ return env.requests.post(
4082
+ "/call" /* CALL_PATH */,
4083
+ jsonData,
4084
+ {
4085
+ headers: {
4086
+ "Content-Type": "application/json"
4087
+ }
4088
+ },
4089
+ service
4090
+ );
4027
4091
  },
4028
4092
  [env]
4029
4093
  );
4030
4094
  const getListFieldsOnchange = useCallback8(
4031
- async ({ model }) => {
4095
+ async ({ model, service }) => {
4032
4096
  const jsonData = {
4033
4097
  model,
4034
4098
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
4035
4099
  };
4036
- return env.requests.post("/call" /* CALL_PATH */, jsonData, {
4037
- headers: {
4038
- "Content-Type": "application/json"
4039
- }
4040
- });
4100
+ return env.requests.post(
4101
+ "/call" /* CALL_PATH */,
4102
+ jsonData,
4103
+ {
4104
+ headers: {
4105
+ "Content-Type": "application/json"
4106
+ }
4107
+ },
4108
+ service
4109
+ );
4041
4110
  },
4042
4111
  [env]
4043
4112
  );
@@ -4197,7 +4266,8 @@ function useViewService() {
4197
4266
  views,
4198
4267
  context = {},
4199
4268
  options = {},
4200
- aid
4269
+ aid,
4270
+ service
4201
4271
  }) => {
4202
4272
  const defaultOptions = {
4203
4273
  load_filters: true,
@@ -4213,11 +4283,16 @@ function useViewService() {
4213
4283
  },
4214
4284
  with_context: context
4215
4285
  };
4216
- return env?.requests?.post("/call" /* CALL_PATH */, jsonDataView, {
4217
- headers: {
4218
- "Content-Type": "application/json"
4219
- }
4220
- });
4286
+ return env?.requests?.post(
4287
+ "/call" /* CALL_PATH */,
4288
+ jsonDataView,
4289
+ {
4290
+ headers: {
4291
+ "Content-Type": "application/json"
4292
+ }
4293
+ },
4294
+ service
4295
+ );
4221
4296
  },
4222
4297
  [env]
4223
4298
  );
@@ -4300,7 +4375,7 @@ function useViewService() {
4300
4375
  [env]
4301
4376
  );
4302
4377
  const getSelectionItem = useCallback10(
4303
- async ({ data }) => {
4378
+ async ({ data, service }) => {
4304
4379
  const jsonData = {
4305
4380
  model: data.model,
4306
4381
  ids: [],
@@ -4318,11 +4393,16 @@ function useViewService() {
4318
4393
  }
4319
4394
  }
4320
4395
  };
4321
- return env?.requests.post("/call" /* CALL_PATH */, jsonData, {
4322
- headers: {
4323
- "Content-Type": "application/json"
4324
- }
4325
- });
4396
+ return env?.requests.post(
4397
+ "/call" /* CALL_PATH */,
4398
+ jsonData,
4399
+ {
4400
+ headers: {
4401
+ "Content-Type": "application/json"
4402
+ }
4403
+ },
4404
+ service
4405
+ );
4326
4406
  },
4327
4407
  [env]
4328
4408
  );
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/interface-logic",
3
- "version": "2.2.2",
3
+ "version": "2.2.4",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",