@fctc/interface-logic 1.10.4 → 1.10.6

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/provider.mjs CHANGED
@@ -3249,11 +3249,22 @@ var axiosClient = {
3249
3249
  }
3250
3250
  };
3251
3251
 
3252
+ // src/hooks/auth/use-forgotpassword-sso.ts
3253
+ import { useMutation as useMutation2 } from "@tanstack/react-query";
3254
+
3255
+ // src/hooks/auth/use-get-provider.ts
3256
+ import { useMutation as useMutation3 } from "@tanstack/react-query";
3257
+
3258
+ // src/hooks/auth/use-isvalid-token.ts
3259
+ import { useMutation as useMutation4 } from "@tanstack/react-query";
3260
+
3261
+ // src/hooks/auth/use-login-credential.tsx
3262
+ import { useMutation as useMutation5 } from "@tanstack/react-query";
3263
+
3252
3264
  // src/services/auth-service/backup.ts
3253
3265
  import { useCallback as useCallback2 } from "react";
3254
3266
  function useAuthService() {
3255
3267
  const { env } = useEnv();
3256
- console.log("auth env", env);
3257
3268
  const login = useCallback2(
3258
3269
  async (body) => {
3259
3270
  const payload = Object.fromEntries(
@@ -3469,18 +3480,6 @@ function useAuthService() {
3469
3480
  };
3470
3481
  }
3471
3482
 
3472
- // src/hooks/auth/use-forgotpassword-sso.ts
3473
- import { useMutation as useMutation2 } from "@tanstack/react-query";
3474
-
3475
- // src/hooks/auth/use-get-provider.ts
3476
- import { useMutation as useMutation3 } from "@tanstack/react-query";
3477
-
3478
- // src/hooks/auth/use-isvalid-token.ts
3479
- import { useMutation as useMutation4 } from "@tanstack/react-query";
3480
-
3481
- // src/hooks/auth/use-login-credential.tsx
3482
- import { useMutation as useMutation5 } from "@tanstack/react-query";
3483
-
3484
3483
  // src/provider/env-provider.tsx
3485
3484
  import { createContext, useContext, useState as useState2, useCallback as useCallback3 } from "react";
3486
3485
  import { jsx as jsx4 } from "react/jsx-runtime";
@@ -3602,9 +3601,8 @@ function EnvProvider({
3602
3601
  }
3603
3602
  function useEnv() {
3604
3603
  const context = useContext(EnvContext);
3605
- console.log("useEnv context:", context, new Error().stack);
3606
3604
  if (!context) {
3607
- return initialEnvState;
3605
+ throw new Error("useEnv must be used within an EnvProvider");
3608
3606
  }
3609
3607
  return context;
3610
3608
  }
@@ -3822,19 +3820,6 @@ var VersionGate = ({ children }) => {
3822
3820
  };
3823
3821
  const validateVersion = async () => {
3824
3822
  const serverVersion = await getVersion();
3825
- console.log("serverVersion", serverVersion);
3826
- login.mutate(
3827
- {
3828
- email: "admin",
3829
- password: "admin",
3830
- path: "/authentication/oauth2/token"
3831
- },
3832
- {
3833
- onSuccess: (res) => {
3834
- console.log("res login", res);
3835
- }
3836
- }
3837
- );
3838
3823
  const cached = localStorage.getItem("__api_version__");
3839
3824
  if (cached !== serverVersion?.api_version) {
3840
3825
  clearVersion();
@@ -3857,30 +3842,10 @@ var VersionGate = ({ children }) => {
3857
3842
  }, [queryClient]);
3858
3843
  return ready ? /* @__PURE__ */ jsx5(Fragment, { children }) : null;
3859
3844
  };
3860
-
3861
- // src/provider/env-share.tsx
3862
- import { createContext as createContext2, useContext as useContext2 } from "react";
3863
- import { jsx as jsx6 } from "react/jsx-runtime";
3864
- var EnvShareContext = createContext2(null);
3865
- function EnvShareProvider({
3866
- children,
3867
- env
3868
- }) {
3869
- return /* @__PURE__ */ jsx6(EnvShareContext.Provider, { value: env, children });
3870
- }
3871
- function useSharedEnv() {
3872
- const env = useContext2(EnvShareContext);
3873
- if (!env) {
3874
- throw new Error("useSharedEnv must be used within an EnvShareProvider");
3875
- }
3876
- return env;
3877
- }
3878
3845
  export {
3879
3846
  EnvProvider,
3880
- EnvShareProvider,
3881
3847
  MainProvider,
3882
3848
  ReactQueryProvider,
3883
3849
  VersionGate,
3884
- useEnv,
3885
- useSharedEnv
3850
+ useEnv
3886
3851
  };
@@ -253,31 +253,4 @@ declare const ViewService: {
253
253
  }): Promise<any>;
254
254
  };
255
255
 
256
- declare function useAuthService(): {
257
- login: (body: LoginCredentialBody) => Promise<any>;
258
- forgotPassword: (email: string) => Promise<any>;
259
- forgotPasswordSSO: ({ email, with_context, method, }: {
260
- email: string;
261
- with_context: any;
262
- method: string;
263
- }) => Promise<any>;
264
- resetPassword: (data: ResetPasswordRequest, token: string | null) => Promise<any>;
265
- resetPasswordSSO: ({ method, password, with_context, }: {
266
- method: any;
267
- password: string;
268
- with_context: any;
269
- }) => Promise<any>;
270
- updatePassword: (data: UpdatePasswordRequest, token: string | null) => Promise<any>;
271
- isValidToken: (token: string | null) => Promise<any>;
272
- isValidActionToken: (actionToken: string | null, path: string) => Promise<any>;
273
- loginSocial: ({ db, state, access_token, }: {
274
- db: string;
275
- state: object;
276
- access_token: string;
277
- }) => Promise<any>;
278
- getProviders: (db?: string) => Promise<any>;
279
- getAccessByCode: (code: string) => Promise<any>;
280
- logout: (data: string) => Promise<any>;
281
- };
282
-
283
- export { ActionService, AuthService, CompanyService, ExcelService, FormService, KanbanServices as KanbanService, ModelService, UserService, ViewService, useAuthService };
256
+ export { ActionService, AuthService, CompanyService, ExcelService, FormService, KanbanServices as KanbanService, ModelService, UserService, ViewService };
@@ -253,31 +253,4 @@ declare const ViewService: {
253
253
  }): Promise<any>;
254
254
  };
255
255
 
256
- declare function useAuthService(): {
257
- login: (body: LoginCredentialBody) => Promise<any>;
258
- forgotPassword: (email: string) => Promise<any>;
259
- forgotPasswordSSO: ({ email, with_context, method, }: {
260
- email: string;
261
- with_context: any;
262
- method: string;
263
- }) => Promise<any>;
264
- resetPassword: (data: ResetPasswordRequest, token: string | null) => Promise<any>;
265
- resetPasswordSSO: ({ method, password, with_context, }: {
266
- method: any;
267
- password: string;
268
- with_context: any;
269
- }) => Promise<any>;
270
- updatePassword: (data: UpdatePasswordRequest, token: string | null) => Promise<any>;
271
- isValidToken: (token: string | null) => Promise<any>;
272
- isValidActionToken: (actionToken: string | null, path: string) => Promise<any>;
273
- loginSocial: ({ db, state, access_token, }: {
274
- db: string;
275
- state: object;
276
- access_token: string;
277
- }) => Promise<any>;
278
- getProviders: (db?: string) => Promise<any>;
279
- getAccessByCode: (code: string) => Promise<any>;
280
- logout: (data: string) => Promise<any>;
281
- };
282
-
283
- export { ActionService, AuthService, CompanyService, ExcelService, FormService, KanbanServices as KanbanService, ModelService, UserService, ViewService, useAuthService };
256
+ export { ActionService, AuthService, CompanyService, ExcelService, FormService, KanbanServices as KanbanService, ModelService, UserService, ViewService };