@fctc/interface-logic 2.2.1 → 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/configs.js CHANGED
@@ -2232,14 +2232,19 @@ var axiosClient = {
2232
2232
  });
2233
2233
  instance.interceptors.request.use(async (config2) => {
2234
2234
  const { useRefreshToken, useActionToken, actionToken } = config2;
2235
+ let token = null;
2235
2236
  if (useActionToken && actionToken) {
2236
- config2.headers["Action-Token"] = actionToken;
2237
+ token = actionToken;
2238
+ } else {
2239
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2240
+ token = await getToken?.();
2241
+ }
2242
+ if (token) {
2243
+ config2.headers["Authorization"] = `Bearer ${token}`;
2237
2244
  }
2238
2245
  if (database) {
2239
2246
  config2.headers["DATABASE"] = database;
2240
2247
  }
2241
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2242
- const token = await getToken?.();
2243
2248
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2244
2249
  return config2;
2245
2250
  }, Promise.reject);
package/dist/configs.mjs CHANGED
@@ -2196,14 +2196,19 @@ var axiosClient = {
2196
2196
  });
2197
2197
  instance.interceptors.request.use(async (config2) => {
2198
2198
  const { useRefreshToken, useActionToken, actionToken } = config2;
2199
+ let token = null;
2199
2200
  if (useActionToken && actionToken) {
2200
- config2.headers["Action-Token"] = actionToken;
2201
+ token = actionToken;
2202
+ } else {
2203
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2204
+ token = await getToken?.();
2205
+ }
2206
+ if (token) {
2207
+ config2.headers["Authorization"] = `Bearer ${token}`;
2201
2208
  }
2202
2209
  if (database) {
2203
2210
  config2.headers["DATABASE"] = database;
2204
2211
  }
2205
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2206
- const token = await getToken?.();
2207
2212
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2208
2213
  return config2;
2209
2214
  }, Promise.reject);
@@ -43,6 +43,7 @@ declare enum UriConstants {
43
43
  IMAGE_PATH = "/web/image",
44
44
  LOAD_MESSAGE = "/load_message_failures",
45
45
  TOKEN = "/check_token",
46
+ VALIDATE_ACTION_TOKEN = "/action-token/validate",
46
47
  CREATE_UPDATE_PATH = "/create_update",
47
48
  TWOFA_METHOD_PATH = "/id/api/v2/call",
48
49
  SIGNIN_SSO = "/signin-sso/oauth",
@@ -43,6 +43,7 @@ declare enum UriConstants {
43
43
  IMAGE_PATH = "/web/image",
44
44
  LOAD_MESSAGE = "/load_message_failures",
45
45
  TOKEN = "/check_token",
46
+ VALIDATE_ACTION_TOKEN = "/action-token/validate",
46
47
  CREATE_UPDATE_PATH = "/create_update",
47
48
  TWOFA_METHOD_PATH = "/id/api/v2/call",
48
49
  SIGNIN_SSO = "/signin-sso/oauth",
package/dist/constants.js CHANGED
@@ -86,6 +86,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
86
86
  UriConstants2["IMAGE_PATH"] = `/web/image`;
87
87
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
88
88
  UriConstants2["TOKEN"] = `/check_token`;
89
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
89
90
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
90
91
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
91
92
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -48,6 +48,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
48
48
  UriConstants2["IMAGE_PATH"] = `/web/image`;
49
49
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
50
50
  UriConstants2["TOKEN"] = `/check_token`;
51
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
51
52
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
52
53
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
53
54
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -2234,14 +2234,19 @@ var axiosClient = {
2234
2234
  });
2235
2235
  instance.interceptors.request.use(async (config2) => {
2236
2236
  const { useRefreshToken, useActionToken, actionToken } = config2;
2237
+ let token = null;
2237
2238
  if (useActionToken && actionToken) {
2238
- config2.headers["Action-Token"] = actionToken;
2239
+ token = actionToken;
2240
+ } else {
2241
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2242
+ token = await getToken?.();
2243
+ }
2244
+ if (token) {
2245
+ config2.headers["Authorization"] = `Bearer ${token}`;
2239
2246
  }
2240
2247
  if (database) {
2241
2248
  config2.headers["DATABASE"] = database;
2242
2249
  }
2243
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2244
- const token = await getToken?.();
2245
2250
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2246
2251
  return config2;
2247
2252
  }, Promise.reject);
@@ -2196,14 +2196,19 @@ var axiosClient = {
2196
2196
  });
2197
2197
  instance.interceptors.request.use(async (config2) => {
2198
2198
  const { useRefreshToken, useActionToken, actionToken } = config2;
2199
+ let token = null;
2199
2200
  if (useActionToken && actionToken) {
2200
- config2.headers["Action-Token"] = actionToken;
2201
+ token = actionToken;
2202
+ } else {
2203
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2204
+ token = await getToken?.();
2205
+ }
2206
+ if (token) {
2207
+ config2.headers["Authorization"] = `Bearer ${token}`;
2201
2208
  }
2202
2209
  if (database) {
2203
2210
  config2.headers["DATABASE"] = database;
2204
2211
  }
2205
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
2206
- const token = await getToken?.();
2207
2212
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
2208
2213
  return config2;
2209
2214
  }, Promise.reject);
package/dist/hooks.d.mts CHANGED
@@ -38,7 +38,6 @@ declare const useGetAccessByCode: () => _tanstack_react_query.UseMutationResult<
38
38
 
39
39
  declare const useValidateActionToken: () => _tanstack_react_query.UseMutationResult<any, Error, {
40
40
  actionToken: string;
41
- path: string;
42
41
  }, unknown>;
43
42
 
44
43
  declare const useGetCompanyInfo: () => _tanstack_react_query.UseMutationResult<any, Error, number, unknown>;
package/dist/hooks.d.ts CHANGED
@@ -38,7 +38,6 @@ declare const useGetAccessByCode: () => _tanstack_react_query.UseMutationResult<
38
38
 
39
39
  declare const useValidateActionToken: () => _tanstack_react_query.UseMutationResult<any, Error, {
40
40
  actionToken: string;
41
- path: string;
42
41
  }, unknown>;
43
42
 
44
43
  declare const useGetCompanyInfo: () => _tanstack_react_query.UseMutationResult<any, Error, number, unknown>;
package/dist/hooks.js CHANGED
@@ -128,6 +128,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
128
128
  UriConstants2["IMAGE_PATH"] = `/web/image`;
129
129
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
130
130
  UriConstants2["TOKEN"] = `/check_token`;
131
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
131
132
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
132
133
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
133
134
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -3234,18 +3235,15 @@ function useAuthService() {
3234
3235
  [env]
3235
3236
  );
3236
3237
  const isValidActionToken = (0, import_react7.useCallback)(
3237
- async (actionToken, path) => {
3238
- return env?.requests?.post(
3239
- path,
3240
- {},
3241
- {
3242
- headers: {
3243
- "Content-Type": "application/json"
3244
- },
3245
- useActionToken: true,
3246
- actionToken
3247
- }
3248
- );
3238
+ async (actionToken) => {
3239
+ const bodyData = {};
3240
+ return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
3241
+ headers: {
3242
+ "Content-Type": "application/json"
3243
+ },
3244
+ useActionToken: true,
3245
+ actionToken
3246
+ });
3249
3247
  },
3250
3248
  [env]
3251
3249
  );
@@ -3280,15 +3278,11 @@ function useAuthService() {
3280
3278
  data.append("grant_type", "authorization_code");
3281
3279
  data.append("client_id", env?.config?.clientId || "");
3282
3280
  data.append("redirect_uri", env?.config?.redirectUri || "");
3283
- return env?.requests?.post(
3284
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3285
- data,
3286
- {
3287
- headers: {
3288
- "Content-Type": "application/x-www-form-urlencoded"
3289
- }
3281
+ return env?.requests?.post("/token" /* TOKEN_BY_CODE */, data, {
3282
+ headers: {
3283
+ "Content-Type": "application/x-www-form-urlencoded"
3290
3284
  }
3291
- );
3285
+ });
3292
3286
  },
3293
3287
  [env]
3294
3288
  );
@@ -4022,7 +4016,6 @@ function useModelService() {
4022
4016
  );
4023
4017
  const getListFieldsOnchange = (0, import_react12.useCallback)(
4024
4018
  async ({ model, service }) => {
4025
- console.log("service", service);
4026
4019
  const jsonData = {
4027
4020
  model,
4028
4021
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4691,11 +4684,8 @@ var import_react_query14 = require("@tanstack/react-query");
4691
4684
  var useValidateActionToken = () => {
4692
4685
  const { isValidActionToken } = useAuthService();
4693
4686
  return (0, import_react_query14.useMutation)({
4694
- mutationFn: ({
4695
- actionToken,
4696
- path
4697
- }) => {
4698
- return isValidActionToken(actionToken, path);
4687
+ mutationFn: ({ actionToken }) => {
4688
+ return isValidActionToken(actionToken);
4699
4689
  }
4700
4690
  });
4701
4691
  };
@@ -5086,7 +5076,6 @@ var useGetFieldOnChange = ({
5086
5076
  service
5087
5077
  }) => {
5088
5078
  const { getListFieldsOnchange } = useModelService();
5089
- console.log("service", service);
5090
5079
  return (0, import_react_query37.useQuery)({
5091
5080
  queryKey: [`field-onchange-${model}`, model],
5092
5081
  queryFn: () => getListFieldsOnchange({
package/dist/hooks.mjs CHANGED
@@ -25,6 +25,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
25
25
  UriConstants2["IMAGE_PATH"] = `/web/image`;
26
26
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
27
27
  UriConstants2["TOKEN"] = `/check_token`;
28
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
28
29
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
29
30
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
30
31
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -3131,18 +3132,15 @@ function useAuthService() {
3131
3132
  [env]
3132
3133
  );
3133
3134
  const isValidActionToken = useCallback3(
3134
- async (actionToken, path) => {
3135
- return env?.requests?.post(
3136
- path,
3137
- {},
3138
- {
3139
- headers: {
3140
- "Content-Type": "application/json"
3141
- },
3142
- useActionToken: true,
3143
- actionToken
3144
- }
3145
- );
3135
+ async (actionToken) => {
3136
+ const bodyData = {};
3137
+ return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
3138
+ headers: {
3139
+ "Content-Type": "application/json"
3140
+ },
3141
+ useActionToken: true,
3142
+ actionToken
3143
+ });
3146
3144
  },
3147
3145
  [env]
3148
3146
  );
@@ -3177,15 +3175,11 @@ function useAuthService() {
3177
3175
  data.append("grant_type", "authorization_code");
3178
3176
  data.append("client_id", env?.config?.clientId || "");
3179
3177
  data.append("redirect_uri", env?.config?.redirectUri || "");
3180
- return env?.requests?.post(
3181
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3182
- data,
3183
- {
3184
- headers: {
3185
- "Content-Type": "application/x-www-form-urlencoded"
3186
- }
3178
+ return env?.requests?.post("/token" /* TOKEN_BY_CODE */, data, {
3179
+ headers: {
3180
+ "Content-Type": "application/x-www-form-urlencoded"
3187
3181
  }
3188
- );
3182
+ });
3189
3183
  },
3190
3184
  [env]
3191
3185
  );
@@ -3919,7 +3913,6 @@ function useModelService() {
3919
3913
  );
3920
3914
  const getListFieldsOnchange = useCallback8(
3921
3915
  async ({ model, service }) => {
3922
- console.log("service", service);
3923
3916
  const jsonData = {
3924
3917
  model,
3925
3918
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4588,11 +4581,8 @@ import { useMutation as useMutation12 } from "@tanstack/react-query";
4588
4581
  var useValidateActionToken = () => {
4589
4582
  const { isValidActionToken } = useAuthService();
4590
4583
  return useMutation12({
4591
- mutationFn: ({
4592
- actionToken,
4593
- path
4594
- }) => {
4595
- return isValidActionToken(actionToken, path);
4584
+ mutationFn: ({ actionToken }) => {
4585
+ return isValidActionToken(actionToken);
4596
4586
  }
4597
4587
  });
4598
4588
  };
@@ -4983,7 +4973,6 @@ var useGetFieldOnChange = ({
4983
4973
  service
4984
4974
  }) => {
4985
4975
  const { getListFieldsOnchange } = useModelService();
4986
- console.log("service", service);
4987
4976
  return useQuery9({
4988
4977
  queryKey: [`field-onchange-${model}`, model],
4989
4978
  queryFn: () => getListFieldsOnchange({
package/dist/provider.js CHANGED
@@ -718,6 +718,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
718
718
  UriConstants2["IMAGE_PATH"] = `/web/image`;
719
719
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
720
720
  UriConstants2["TOKEN"] = `/check_token`;
721
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
721
722
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
722
723
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
723
724
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -3183,18 +3184,15 @@ function useAuthService() {
3183
3184
  [env]
3184
3185
  );
3185
3186
  const isValidActionToken = (0, import_react3.useCallback)(
3186
- async (actionToken, path) => {
3187
- return env?.requests?.post(
3188
- path,
3189
- {},
3190
- {
3191
- headers: {
3192
- "Content-Type": "application/json"
3193
- },
3194
- useActionToken: true,
3195
- actionToken
3196
- }
3197
- );
3187
+ async (actionToken) => {
3188
+ const bodyData = {};
3189
+ return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
3190
+ headers: {
3191
+ "Content-Type": "application/json"
3192
+ },
3193
+ useActionToken: true,
3194
+ actionToken
3195
+ });
3198
3196
  },
3199
3197
  [env]
3200
3198
  );
@@ -3229,15 +3227,11 @@ function useAuthService() {
3229
3227
  data.append("grant_type", "authorization_code");
3230
3228
  data.append("client_id", env?.config?.clientId || "");
3231
3229
  data.append("redirect_uri", env?.config?.redirectUri || "");
3232
- return env?.requests?.post(
3233
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3234
- data,
3235
- {
3236
- headers: {
3237
- "Content-Type": "application/x-www-form-urlencoded"
3238
- }
3230
+ return env?.requests?.post("/token" /* TOKEN_BY_CODE */, data, {
3231
+ headers: {
3232
+ "Content-Type": "application/x-www-form-urlencoded"
3239
3233
  }
3240
- );
3234
+ });
3241
3235
  },
3242
3236
  [env]
3243
3237
  );
@@ -3971,7 +3965,6 @@ function useModelService() {
3971
3965
  );
3972
3966
  const getListFieldsOnchange = (0, import_react8.useCallback)(
3973
3967
  async ({ model, service }) => {
3974
- console.log("service", service);
3975
3968
  const jsonData = {
3976
3969
  model,
3977
3970
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4598,14 +4591,19 @@ var axiosClient = {
4598
4591
  });
4599
4592
  instance.interceptors.request.use(async (config2) => {
4600
4593
  const { useRefreshToken, useActionToken, actionToken } = config2;
4594
+ let token = null;
4601
4595
  if (useActionToken && actionToken) {
4602
- config2.headers["Action-Token"] = actionToken;
4596
+ token = actionToken;
4597
+ } else {
4598
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4599
+ token = await getToken?.();
4600
+ }
4601
+ if (token) {
4602
+ config2.headers["Authorization"] = `Bearer ${token}`;
4603
4603
  }
4604
4604
  if (database) {
4605
4605
  config2.headers["DATABASE"] = database;
4606
4606
  }
4607
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4608
- const token = await getToken?.();
4609
4607
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
4610
4608
  return config2;
4611
4609
  }, Promise.reject);
@@ -5053,11 +5051,8 @@ var import_react_query14 = require("@tanstack/react-query");
5053
5051
  var useValidateActionToken = () => {
5054
5052
  const { isValidActionToken } = useAuthService();
5055
5053
  return (0, import_react_query14.useMutation)({
5056
- mutationFn: ({
5057
- actionToken,
5058
- path
5059
- }) => {
5060
- return isValidActionToken(actionToken, path);
5054
+ mutationFn: ({ actionToken }) => {
5055
+ return isValidActionToken(actionToken);
5061
5056
  }
5062
5057
  });
5063
5058
  };
@@ -5448,7 +5443,6 @@ var useGetFieldOnChange = ({
5448
5443
  service
5449
5444
  }) => {
5450
5445
  const { getListFieldsOnchange } = useModelService();
5451
- console.log("service", service);
5452
5446
  return (0, import_react_query37.useQuery)({
5453
5447
  queryKey: [`field-onchange-${model}`, model],
5454
5448
  queryFn: () => getListFieldsOnchange({
package/dist/provider.mjs CHANGED
@@ -675,6 +675,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
675
675
  UriConstants2["IMAGE_PATH"] = `/web/image`;
676
676
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
677
677
  UriConstants2["TOKEN"] = `/check_token`;
678
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
678
679
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
679
680
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
680
681
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -3140,18 +3141,15 @@ function useAuthService() {
3140
3141
  [env]
3141
3142
  );
3142
3143
  const isValidActionToken = useCallback2(
3143
- async (actionToken, path) => {
3144
- return env?.requests?.post(
3145
- path,
3146
- {},
3147
- {
3148
- headers: {
3149
- "Content-Type": "application/json"
3150
- },
3151
- useActionToken: true,
3152
- actionToken
3153
- }
3154
- );
3144
+ async (actionToken) => {
3145
+ const bodyData = {};
3146
+ return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
3147
+ headers: {
3148
+ "Content-Type": "application/json"
3149
+ },
3150
+ useActionToken: true,
3151
+ actionToken
3152
+ });
3155
3153
  },
3156
3154
  [env]
3157
3155
  );
@@ -3186,15 +3184,11 @@ function useAuthService() {
3186
3184
  data.append("grant_type", "authorization_code");
3187
3185
  data.append("client_id", env?.config?.clientId || "");
3188
3186
  data.append("redirect_uri", env?.config?.redirectUri || "");
3189
- return env?.requests?.post(
3190
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3191
- data,
3192
- {
3193
- headers: {
3194
- "Content-Type": "application/x-www-form-urlencoded"
3195
- }
3187
+ return env?.requests?.post("/token" /* TOKEN_BY_CODE */, data, {
3188
+ headers: {
3189
+ "Content-Type": "application/x-www-form-urlencoded"
3196
3190
  }
3197
- );
3191
+ });
3198
3192
  },
3199
3193
  [env]
3200
3194
  );
@@ -3928,7 +3922,6 @@ function useModelService() {
3928
3922
  );
3929
3923
  const getListFieldsOnchange = useCallback7(
3930
3924
  async ({ model, service }) => {
3931
- console.log("service", service);
3932
3925
  const jsonData = {
3933
3926
  model,
3934
3927
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
@@ -4555,14 +4548,19 @@ var axiosClient = {
4555
4548
  });
4556
4549
  instance.interceptors.request.use(async (config2) => {
4557
4550
  const { useRefreshToken, useActionToken, actionToken } = config2;
4551
+ let token = null;
4558
4552
  if (useActionToken && actionToken) {
4559
- config2.headers["Action-Token"] = actionToken;
4553
+ token = actionToken;
4554
+ } else {
4555
+ const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4556
+ token = await getToken?.();
4557
+ }
4558
+ if (token) {
4559
+ config2.headers["Authorization"] = `Bearer ${token}`;
4560
4560
  }
4561
4561
  if (database) {
4562
4562
  config2.headers["DATABASE"] = database;
4563
4563
  }
4564
- const getToken = useRefreshToken ? localStorage2.getRefreshToken : localStorage2.getAccessToken;
4565
- const token = await getToken?.();
4566
4564
  if (token) config2.headers["Authorization"] = `Bearer ${token}`;
4567
4565
  return config2;
4568
4566
  }, Promise.reject);
@@ -5010,11 +5008,8 @@ import { useMutation as useMutation12 } from "@tanstack/react-query";
5010
5008
  var useValidateActionToken = () => {
5011
5009
  const { isValidActionToken } = useAuthService();
5012
5010
  return useMutation12({
5013
- mutationFn: ({
5014
- actionToken,
5015
- path
5016
- }) => {
5017
- return isValidActionToken(actionToken, path);
5011
+ mutationFn: ({ actionToken }) => {
5012
+ return isValidActionToken(actionToken);
5018
5013
  }
5019
5014
  });
5020
5015
  };
@@ -5405,7 +5400,6 @@ var useGetFieldOnChange = ({
5405
5400
  service
5406
5401
  }) => {
5407
5402
  const { getListFieldsOnchange } = useModelService();
5408
- console.log("service", service);
5409
5403
  return useQuery9({
5410
5404
  queryKey: [`field-onchange-${model}`, model],
5411
5405
  queryFn: () => getListFieldsOnchange({
@@ -56,7 +56,7 @@ declare function useAuthService(): {
56
56
  }) => Promise<any>;
57
57
  updatePassword: (data: UpdatePasswordRequest, token: string | null) => Promise<any>;
58
58
  isValidToken: (token: string | null) => Promise<any>;
59
- isValidActionToken: (actionToken: string | null, path: string) => Promise<any>;
59
+ isValidActionToken: (actionToken: string | null) => Promise<any>;
60
60
  loginSocial: ({ db, state, access_token, }: {
61
61
  db: string;
62
62
  state: object;
@@ -56,7 +56,7 @@ declare function useAuthService(): {
56
56
  }) => Promise<any>;
57
57
  updatePassword: (data: UpdatePasswordRequest, token: string | null) => Promise<any>;
58
58
  isValidToken: (token: string | null) => Promise<any>;
59
- isValidActionToken: (actionToken: string | null, path: string) => Promise<any>;
59
+ isValidActionToken: (actionToken: string | null) => Promise<any>;
60
60
  loginSocial: ({ db, state, access_token, }: {
61
61
  db: string;
62
62
  state: object;
package/dist/services.js CHANGED
@@ -66,6 +66,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
66
66
  UriConstants2["IMAGE_PATH"] = `/web/image`;
67
67
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
68
68
  UriConstants2["TOKEN"] = `/check_token`;
69
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
69
70
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
70
71
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
71
72
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -3350,18 +3351,15 @@ function useAuthService() {
3350
3351
  [env]
3351
3352
  );
3352
3353
  const isValidActionToken = (0, import_react7.useCallback)(
3353
- async (actionToken, path) => {
3354
- return env?.requests?.post(
3355
- path,
3356
- {},
3357
- {
3358
- headers: {
3359
- "Content-Type": "application/json"
3360
- },
3361
- useActionToken: true,
3362
- actionToken
3363
- }
3364
- );
3354
+ async (actionToken) => {
3355
+ const bodyData = {};
3356
+ return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
3357
+ headers: {
3358
+ "Content-Type": "application/json"
3359
+ },
3360
+ useActionToken: true,
3361
+ actionToken
3362
+ });
3365
3363
  },
3366
3364
  [env]
3367
3365
  );
@@ -3396,15 +3394,11 @@ function useAuthService() {
3396
3394
  data.append("grant_type", "authorization_code");
3397
3395
  data.append("client_id", env?.config?.clientId || "");
3398
3396
  data.append("redirect_uri", env?.config?.redirectUri || "");
3399
- return env?.requests?.post(
3400
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3401
- data,
3402
- {
3403
- headers: {
3404
- "Content-Type": "application/x-www-form-urlencoded"
3405
- }
3397
+ return env?.requests?.post("/token" /* TOKEN_BY_CODE */, data, {
3398
+ headers: {
3399
+ "Content-Type": "application/x-www-form-urlencoded"
3406
3400
  }
3407
- );
3401
+ });
3408
3402
  },
3409
3403
  [env]
3410
3404
  );
@@ -4138,7 +4132,6 @@ function useModelService() {
4138
4132
  );
4139
4133
  const getListFieldsOnchange = (0, import_react12.useCallback)(
4140
4134
  async ({ model, service }) => {
4141
- console.log("service", service);
4142
4135
  const jsonData = {
4143
4136
  model,
4144
4137
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
package/dist/services.mjs CHANGED
@@ -22,6 +22,7 @@ var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
22
22
  UriConstants2["IMAGE_PATH"] = `/web/image`;
23
23
  UriConstants2["LOAD_MESSAGE"] = `/load_message_failures`;
24
24
  UriConstants2["TOKEN"] = `/check_token`;
25
+ UriConstants2["VALIDATE_ACTION_TOKEN"] = `/action-token/validate`;
25
26
  UriConstants2["CREATE_UPDATE_PATH"] = `/create_update`;
26
27
  UriConstants2["TWOFA_METHOD_PATH"] = `/id/api/v2/call`;
27
28
  UriConstants2["SIGNIN_SSO"] = `/signin-sso/oauth`;
@@ -3306,18 +3307,15 @@ function useAuthService() {
3306
3307
  [env]
3307
3308
  );
3308
3309
  const isValidActionToken = useCallback3(
3309
- async (actionToken, path) => {
3310
- return env?.requests?.post(
3311
- path,
3312
- {},
3313
- {
3314
- headers: {
3315
- "Content-Type": "application/json"
3316
- },
3317
- useActionToken: true,
3318
- actionToken
3319
- }
3320
- );
3310
+ async (actionToken) => {
3311
+ const bodyData = {};
3312
+ return env?.requests?.post("/action-token/validate" /* VALIDATE_ACTION_TOKEN */, bodyData, {
3313
+ headers: {
3314
+ "Content-Type": "application/json"
3315
+ },
3316
+ useActionToken: true,
3317
+ actionToken
3318
+ });
3321
3319
  },
3322
3320
  [env]
3323
3321
  );
@@ -3352,15 +3350,11 @@ function useAuthService() {
3352
3350
  data.append("grant_type", "authorization_code");
3353
3351
  data.append("client_id", env?.config?.clientId || "");
3354
3352
  data.append("redirect_uri", env?.config?.redirectUri || "");
3355
- return env?.requests?.post(
3356
- `${env?.baseUrl?.replace("/mms/", "/id/")}/${"/token" /* TOKEN_BY_CODE */}`,
3357
- data,
3358
- {
3359
- headers: {
3360
- "Content-Type": "application/x-www-form-urlencoded"
3361
- }
3353
+ return env?.requests?.post("/token" /* TOKEN_BY_CODE */, data, {
3354
+ headers: {
3355
+ "Content-Type": "application/x-www-form-urlencoded"
3362
3356
  }
3363
- );
3357
+ });
3364
3358
  },
3365
3359
  [env]
3366
3360
  );
@@ -4094,7 +4088,6 @@ function useModelService() {
4094
4088
  );
4095
4089
  const getListFieldsOnchange = useCallback8(
4096
4090
  async ({ model, service }) => {
4097
- console.log("service", service);
4098
4091
  const jsonData = {
4099
4092
  model,
4100
4093
  method: "get_fields_onchange" /* GET_ONCHANGE_FIELDS */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/interface-logic",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",