@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/hooks.js +67 -93
- package/dist/hooks.mjs +51 -77
- package/dist/provider.d.mts +2 -8
- package/dist/provider.d.ts +2 -8
- package/dist/provider.js +15 -52
- package/dist/provider.mjs +14 -49
- package/dist/services.d.mts +1 -28
- package/dist/services.d.ts +1 -28
- package/dist/services.js +2 -1105
- package/dist/services.mjs +1 -1103
- package/package.json +1 -1
package/dist/hooks.js
CHANGED
|
@@ -103,7 +103,7 @@ __export(hooks_exports, {
|
|
|
103
103
|
module.exports = __toCommonJS(hooks_exports);
|
|
104
104
|
|
|
105
105
|
// src/hooks/auth/use-forgot-password.ts
|
|
106
|
-
var
|
|
106
|
+
var import_react_query = require("@tanstack/react-query");
|
|
107
107
|
|
|
108
108
|
// src/constants/api/uri-constant.ts
|
|
109
109
|
var UriConstants = /* @__PURE__ */ ((UriConstants2) => {
|
|
@@ -4174,11 +4174,61 @@ var ViewService = {
|
|
|
4174
4174
|
};
|
|
4175
4175
|
var view_service_default = ViewService;
|
|
4176
4176
|
|
|
4177
|
+
// src/hooks/auth/use-forgot-password.ts
|
|
4178
|
+
var useForgotPassword = () => {
|
|
4179
|
+
return (0, import_react_query.useMutation)({
|
|
4180
|
+
mutationFn: (email) => {
|
|
4181
|
+
return auth_service_default.forgotPassword(email);
|
|
4182
|
+
}
|
|
4183
|
+
});
|
|
4184
|
+
};
|
|
4185
|
+
var use_forgot_password_default = useForgotPassword;
|
|
4186
|
+
|
|
4187
|
+
// src/hooks/auth/use-forgotpassword-sso.ts
|
|
4188
|
+
var import_react_query2 = require("@tanstack/react-query");
|
|
4189
|
+
var useForgotPasswordSSO = () => {
|
|
4190
|
+
return (0, import_react_query2.useMutation)({
|
|
4191
|
+
mutationFn: ({
|
|
4192
|
+
email,
|
|
4193
|
+
with_context,
|
|
4194
|
+
method
|
|
4195
|
+
}) => {
|
|
4196
|
+
return auth_service_default.forgotPasswordSSO({ email, with_context, method });
|
|
4197
|
+
}
|
|
4198
|
+
});
|
|
4199
|
+
};
|
|
4200
|
+
var use_forgotpassword_sso_default = useForgotPasswordSSO;
|
|
4201
|
+
|
|
4202
|
+
// src/hooks/auth/use-get-provider.ts
|
|
4203
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
4204
|
+
var useGetProvider = () => {
|
|
4205
|
+
return (0, import_react_query3.useMutation)({
|
|
4206
|
+
mutationFn: (data) => {
|
|
4207
|
+
return auth_service_default.getProviders(data?.db);
|
|
4208
|
+
}
|
|
4209
|
+
});
|
|
4210
|
+
};
|
|
4211
|
+
var use_get_provider_default = useGetProvider;
|
|
4212
|
+
|
|
4213
|
+
// src/hooks/auth/use-isvalid-token.ts
|
|
4214
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
4215
|
+
var useIsValidToken = () => {
|
|
4216
|
+
return (0, import_react_query4.useMutation)({
|
|
4217
|
+
mutationFn: (token) => {
|
|
4218
|
+
return auth_service_default.isValidToken(token);
|
|
4219
|
+
}
|
|
4220
|
+
});
|
|
4221
|
+
};
|
|
4222
|
+
var use_isvalid_token_default = useIsValidToken;
|
|
4223
|
+
|
|
4224
|
+
// src/hooks/auth/use-login-credential.tsx
|
|
4225
|
+
var import_react_query7 = require("@tanstack/react-query");
|
|
4226
|
+
|
|
4177
4227
|
// src/services/auth-service/backup.ts
|
|
4178
|
-
var
|
|
4228
|
+
var import_react5 = require("react");
|
|
4179
4229
|
|
|
4180
4230
|
// src/provider/react-query-provider.tsx
|
|
4181
|
-
var
|
|
4231
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
4182
4232
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
4183
4233
|
|
|
4184
4234
|
// src/provider/redux-provider.tsx
|
|
@@ -4808,7 +4858,7 @@ var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
|
4808
4858
|
|
|
4809
4859
|
// src/provider/version-gate-provider.tsx
|
|
4810
4860
|
var import_react3 = require("react");
|
|
4811
|
-
var
|
|
4861
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
4812
4862
|
|
|
4813
4863
|
// src/services/view-service/backup.ts
|
|
4814
4864
|
var import_react2 = require("react");
|
|
@@ -4819,47 +4869,19 @@ var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
|
4819
4869
|
// src/provider/env-provider.tsx
|
|
4820
4870
|
var import_react4 = require("react");
|
|
4821
4871
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4822
|
-
var initialEnvState = {
|
|
4823
|
-
env: null,
|
|
4824
|
-
baseUrl: "",
|
|
4825
|
-
requests: null,
|
|
4826
|
-
companies: [],
|
|
4827
|
-
user: {},
|
|
4828
|
-
config: null,
|
|
4829
|
-
envFile: null,
|
|
4830
|
-
defaultCompany: {
|
|
4831
|
-
id: null,
|
|
4832
|
-
logo: "",
|
|
4833
|
-
secondary_color: "",
|
|
4834
|
-
primary_color: ""
|
|
4835
|
-
},
|
|
4836
|
-
context: {
|
|
4837
|
-
uid: null,
|
|
4838
|
-
allowed_company_ids: [],
|
|
4839
|
-
lang: "vi_VN",
|
|
4840
|
-
tz: "Asia/Saigon"
|
|
4841
|
-
}
|
|
4842
|
-
};
|
|
4843
4872
|
var EnvContext = (0, import_react4.createContext)(null);
|
|
4844
4873
|
function useEnv() {
|
|
4845
4874
|
const context = (0, import_react4.useContext)(EnvContext);
|
|
4846
|
-
console.log("useEnv context:", context, new Error().stack);
|
|
4847
4875
|
if (!context) {
|
|
4848
|
-
|
|
4876
|
+
throw new Error("useEnv must be used within an EnvProvider");
|
|
4849
4877
|
}
|
|
4850
4878
|
return context;
|
|
4851
4879
|
}
|
|
4852
4880
|
|
|
4853
|
-
// src/provider/env-share.tsx
|
|
4854
|
-
var import_react5 = require("react");
|
|
4855
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
4856
|
-
var EnvShareContext = (0, import_react5.createContext)(null);
|
|
4857
|
-
|
|
4858
4881
|
// src/services/auth-service/backup.ts
|
|
4859
4882
|
function useAuthService() {
|
|
4860
4883
|
const { env: env2 } = useEnv();
|
|
4861
|
-
|
|
4862
|
-
const login = (0, import_react6.useCallback)(
|
|
4884
|
+
const login = (0, import_react5.useCallback)(
|
|
4863
4885
|
async (body) => {
|
|
4864
4886
|
const payload = Object.fromEntries(
|
|
4865
4887
|
Object.entries({
|
|
@@ -4879,7 +4901,7 @@ function useAuthService() {
|
|
|
4879
4901
|
},
|
|
4880
4902
|
[env2]
|
|
4881
4903
|
);
|
|
4882
|
-
const forgotPassword = (0,
|
|
4904
|
+
const forgotPassword = (0, import_react5.useCallback)(
|
|
4883
4905
|
async (email) => {
|
|
4884
4906
|
const bodyData = {
|
|
4885
4907
|
login: email,
|
|
@@ -4893,7 +4915,7 @@ function useAuthService() {
|
|
|
4893
4915
|
},
|
|
4894
4916
|
[env2]
|
|
4895
4917
|
);
|
|
4896
|
-
const forgotPasswordSSO = (0,
|
|
4918
|
+
const forgotPasswordSSO = (0, import_react5.useCallback)(
|
|
4897
4919
|
async ({
|
|
4898
4920
|
email,
|
|
4899
4921
|
with_context,
|
|
@@ -4916,7 +4938,7 @@ function useAuthService() {
|
|
|
4916
4938
|
},
|
|
4917
4939
|
[env2]
|
|
4918
4940
|
);
|
|
4919
|
-
const resetPassword = (0,
|
|
4941
|
+
const resetPassword = (0, import_react5.useCallback)(
|
|
4920
4942
|
async (data, token) => {
|
|
4921
4943
|
const bodyData = {
|
|
4922
4944
|
token,
|
|
@@ -4931,7 +4953,7 @@ function useAuthService() {
|
|
|
4931
4953
|
},
|
|
4932
4954
|
[env2]
|
|
4933
4955
|
);
|
|
4934
|
-
const resetPasswordSSO = (0,
|
|
4956
|
+
const resetPasswordSSO = (0, import_react5.useCallback)(
|
|
4935
4957
|
async ({
|
|
4936
4958
|
method,
|
|
4937
4959
|
password,
|
|
@@ -4954,7 +4976,7 @@ function useAuthService() {
|
|
|
4954
4976
|
},
|
|
4955
4977
|
[env2]
|
|
4956
4978
|
);
|
|
4957
|
-
const updatePassword = (0,
|
|
4979
|
+
const updatePassword = (0, import_react5.useCallback)(
|
|
4958
4980
|
async (data, token) => {
|
|
4959
4981
|
const bodyData = {
|
|
4960
4982
|
token,
|
|
@@ -4969,7 +4991,7 @@ function useAuthService() {
|
|
|
4969
4991
|
},
|
|
4970
4992
|
[env2]
|
|
4971
4993
|
);
|
|
4972
|
-
const isValidToken = (0,
|
|
4994
|
+
const isValidToken = (0, import_react5.useCallback)(
|
|
4973
4995
|
async (token) => {
|
|
4974
4996
|
const bodyData = {
|
|
4975
4997
|
token
|
|
@@ -4982,7 +5004,7 @@ function useAuthService() {
|
|
|
4982
5004
|
},
|
|
4983
5005
|
[env2]
|
|
4984
5006
|
);
|
|
4985
|
-
const isValidActionToken = (0,
|
|
5007
|
+
const isValidActionToken = (0, import_react5.useCallback)(
|
|
4986
5008
|
async (actionToken, path) => {
|
|
4987
5009
|
return env2?.requests?.post(
|
|
4988
5010
|
path,
|
|
@@ -4998,7 +5020,7 @@ function useAuthService() {
|
|
|
4998
5020
|
},
|
|
4999
5021
|
[env2]
|
|
5000
5022
|
);
|
|
5001
|
-
const loginSocial = (0,
|
|
5023
|
+
const loginSocial = (0, import_react5.useCallback)(
|
|
5002
5024
|
async ({
|
|
5003
5025
|
db,
|
|
5004
5026
|
state,
|
|
@@ -5016,13 +5038,13 @@ function useAuthService() {
|
|
|
5016
5038
|
},
|
|
5017
5039
|
[env2]
|
|
5018
5040
|
);
|
|
5019
|
-
const getProviders = (0,
|
|
5041
|
+
const getProviders = (0, import_react5.useCallback)(
|
|
5020
5042
|
async (db) => {
|
|
5021
5043
|
return env2?.requests?.get("/oauth/providers", { params: { db } });
|
|
5022
5044
|
},
|
|
5023
5045
|
[env2]
|
|
5024
5046
|
);
|
|
5025
|
-
const getAccessByCode = (0,
|
|
5047
|
+
const getAccessByCode = (0, import_react5.useCallback)(
|
|
5026
5048
|
async (code) => {
|
|
5027
5049
|
const data = new URLSearchParams();
|
|
5028
5050
|
data.append("code", code);
|
|
@@ -5041,7 +5063,7 @@ function useAuthService() {
|
|
|
5041
5063
|
},
|
|
5042
5064
|
[env2]
|
|
5043
5065
|
);
|
|
5044
|
-
const logout = (0,
|
|
5066
|
+
const logout = (0, import_react5.useCallback)(
|
|
5045
5067
|
async (data) => {
|
|
5046
5068
|
console.log(data);
|
|
5047
5069
|
return env2?.requests?.post(
|
|
@@ -5074,55 +5096,7 @@ function useAuthService() {
|
|
|
5074
5096
|
};
|
|
5075
5097
|
}
|
|
5076
5098
|
|
|
5077
|
-
// src/hooks/auth/use-forgot-password.ts
|
|
5078
|
-
var useForgotPassword = () => {
|
|
5079
|
-
return (0, import_react_query3.useMutation)({
|
|
5080
|
-
mutationFn: (email) => {
|
|
5081
|
-
return auth_service_default.forgotPassword(email);
|
|
5082
|
-
}
|
|
5083
|
-
});
|
|
5084
|
-
};
|
|
5085
|
-
var use_forgot_password_default = useForgotPassword;
|
|
5086
|
-
|
|
5087
|
-
// src/hooks/auth/use-forgotpassword-sso.ts
|
|
5088
|
-
var import_react_query4 = require("@tanstack/react-query");
|
|
5089
|
-
var useForgotPasswordSSO = () => {
|
|
5090
|
-
return (0, import_react_query4.useMutation)({
|
|
5091
|
-
mutationFn: ({
|
|
5092
|
-
email,
|
|
5093
|
-
with_context,
|
|
5094
|
-
method
|
|
5095
|
-
}) => {
|
|
5096
|
-
return auth_service_default.forgotPasswordSSO({ email, with_context, method });
|
|
5097
|
-
}
|
|
5098
|
-
});
|
|
5099
|
-
};
|
|
5100
|
-
var use_forgotpassword_sso_default = useForgotPasswordSSO;
|
|
5101
|
-
|
|
5102
|
-
// src/hooks/auth/use-get-provider.ts
|
|
5103
|
-
var import_react_query5 = require("@tanstack/react-query");
|
|
5104
|
-
var useGetProvider = () => {
|
|
5105
|
-
return (0, import_react_query5.useMutation)({
|
|
5106
|
-
mutationFn: (data) => {
|
|
5107
|
-
return auth_service_default.getProviders(data?.db);
|
|
5108
|
-
}
|
|
5109
|
-
});
|
|
5110
|
-
};
|
|
5111
|
-
var use_get_provider_default = useGetProvider;
|
|
5112
|
-
|
|
5113
|
-
// src/hooks/auth/use-isvalid-token.ts
|
|
5114
|
-
var import_react_query6 = require("@tanstack/react-query");
|
|
5115
|
-
var useIsValidToken = () => {
|
|
5116
|
-
return (0, import_react_query6.useMutation)({
|
|
5117
|
-
mutationFn: (token) => {
|
|
5118
|
-
return auth_service_default.isValidToken(token);
|
|
5119
|
-
}
|
|
5120
|
-
});
|
|
5121
|
-
};
|
|
5122
|
-
var use_isvalid_token_default = useIsValidToken;
|
|
5123
|
-
|
|
5124
5099
|
// src/hooks/auth/use-login-credential.tsx
|
|
5125
|
-
var import_react_query7 = require("@tanstack/react-query");
|
|
5126
5100
|
var useLoginCredential = () => {
|
|
5127
5101
|
const { env: env2 } = useEnv();
|
|
5128
5102
|
console.log("useLoginCredential called", env2, new Error().stack);
|
package/dist/hooks.mjs
CHANGED
|
@@ -4070,6 +4070,56 @@ var ViewService = {
|
|
|
4070
4070
|
};
|
|
4071
4071
|
var view_service_default = ViewService;
|
|
4072
4072
|
|
|
4073
|
+
// src/hooks/auth/use-forgot-password.ts
|
|
4074
|
+
var useForgotPassword = () => {
|
|
4075
|
+
return useMutation({
|
|
4076
|
+
mutationFn: (email) => {
|
|
4077
|
+
return auth_service_default.forgotPassword(email);
|
|
4078
|
+
}
|
|
4079
|
+
});
|
|
4080
|
+
};
|
|
4081
|
+
var use_forgot_password_default = useForgotPassword;
|
|
4082
|
+
|
|
4083
|
+
// src/hooks/auth/use-forgotpassword-sso.ts
|
|
4084
|
+
import { useMutation as useMutation2 } from "@tanstack/react-query";
|
|
4085
|
+
var useForgotPasswordSSO = () => {
|
|
4086
|
+
return useMutation2({
|
|
4087
|
+
mutationFn: ({
|
|
4088
|
+
email,
|
|
4089
|
+
with_context,
|
|
4090
|
+
method
|
|
4091
|
+
}) => {
|
|
4092
|
+
return auth_service_default.forgotPasswordSSO({ email, with_context, method });
|
|
4093
|
+
}
|
|
4094
|
+
});
|
|
4095
|
+
};
|
|
4096
|
+
var use_forgotpassword_sso_default = useForgotPasswordSSO;
|
|
4097
|
+
|
|
4098
|
+
// src/hooks/auth/use-get-provider.ts
|
|
4099
|
+
import { useMutation as useMutation3 } from "@tanstack/react-query";
|
|
4100
|
+
var useGetProvider = () => {
|
|
4101
|
+
return useMutation3({
|
|
4102
|
+
mutationFn: (data) => {
|
|
4103
|
+
return auth_service_default.getProviders(data?.db);
|
|
4104
|
+
}
|
|
4105
|
+
});
|
|
4106
|
+
};
|
|
4107
|
+
var use_get_provider_default = useGetProvider;
|
|
4108
|
+
|
|
4109
|
+
// src/hooks/auth/use-isvalid-token.ts
|
|
4110
|
+
import { useMutation as useMutation4 } from "@tanstack/react-query";
|
|
4111
|
+
var useIsValidToken = () => {
|
|
4112
|
+
return useMutation4({
|
|
4113
|
+
mutationFn: (token) => {
|
|
4114
|
+
return auth_service_default.isValidToken(token);
|
|
4115
|
+
}
|
|
4116
|
+
});
|
|
4117
|
+
};
|
|
4118
|
+
var use_isvalid_token_default = useIsValidToken;
|
|
4119
|
+
|
|
4120
|
+
// src/hooks/auth/use-login-credential.tsx
|
|
4121
|
+
import { useMutation as useMutation5 } from "@tanstack/react-query";
|
|
4122
|
+
|
|
4073
4123
|
// src/services/auth-service/backup.ts
|
|
4074
4124
|
import { useCallback as useCallback3 } from "react";
|
|
4075
4125
|
|
|
@@ -4715,46 +4765,18 @@ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
|
|
|
4715
4765
|
// src/provider/env-provider.tsx
|
|
4716
4766
|
import { createContext, useContext, useState as useState3, useCallback as useCallback2 } from "react";
|
|
4717
4767
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
4718
|
-
var initialEnvState = {
|
|
4719
|
-
env: null,
|
|
4720
|
-
baseUrl: "",
|
|
4721
|
-
requests: null,
|
|
4722
|
-
companies: [],
|
|
4723
|
-
user: {},
|
|
4724
|
-
config: null,
|
|
4725
|
-
envFile: null,
|
|
4726
|
-
defaultCompany: {
|
|
4727
|
-
id: null,
|
|
4728
|
-
logo: "",
|
|
4729
|
-
secondary_color: "",
|
|
4730
|
-
primary_color: ""
|
|
4731
|
-
},
|
|
4732
|
-
context: {
|
|
4733
|
-
uid: null,
|
|
4734
|
-
allowed_company_ids: [],
|
|
4735
|
-
lang: "vi_VN",
|
|
4736
|
-
tz: "Asia/Saigon"
|
|
4737
|
-
}
|
|
4738
|
-
};
|
|
4739
4768
|
var EnvContext = createContext(null);
|
|
4740
4769
|
function useEnv() {
|
|
4741
4770
|
const context = useContext(EnvContext);
|
|
4742
|
-
console.log("useEnv context:", context, new Error().stack);
|
|
4743
4771
|
if (!context) {
|
|
4744
|
-
|
|
4772
|
+
throw new Error("useEnv must be used within an EnvProvider");
|
|
4745
4773
|
}
|
|
4746
4774
|
return context;
|
|
4747
4775
|
}
|
|
4748
4776
|
|
|
4749
|
-
// src/provider/env-share.tsx
|
|
4750
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
4751
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
4752
|
-
var EnvShareContext = createContext2(null);
|
|
4753
|
-
|
|
4754
4777
|
// src/services/auth-service/backup.ts
|
|
4755
4778
|
function useAuthService() {
|
|
4756
4779
|
const { env: env2 } = useEnv();
|
|
4757
|
-
console.log("auth env", env2);
|
|
4758
4780
|
const login = useCallback3(
|
|
4759
4781
|
async (body) => {
|
|
4760
4782
|
const payload = Object.fromEntries(
|
|
@@ -4970,55 +4992,7 @@ function useAuthService() {
|
|
|
4970
4992
|
};
|
|
4971
4993
|
}
|
|
4972
4994
|
|
|
4973
|
-
// src/hooks/auth/use-forgot-password.ts
|
|
4974
|
-
var useForgotPassword = () => {
|
|
4975
|
-
return useMutation({
|
|
4976
|
-
mutationFn: (email) => {
|
|
4977
|
-
return auth_service_default.forgotPassword(email);
|
|
4978
|
-
}
|
|
4979
|
-
});
|
|
4980
|
-
};
|
|
4981
|
-
var use_forgot_password_default = useForgotPassword;
|
|
4982
|
-
|
|
4983
|
-
// src/hooks/auth/use-forgotpassword-sso.ts
|
|
4984
|
-
import { useMutation as useMutation2 } from "@tanstack/react-query";
|
|
4985
|
-
var useForgotPasswordSSO = () => {
|
|
4986
|
-
return useMutation2({
|
|
4987
|
-
mutationFn: ({
|
|
4988
|
-
email,
|
|
4989
|
-
with_context,
|
|
4990
|
-
method
|
|
4991
|
-
}) => {
|
|
4992
|
-
return auth_service_default.forgotPasswordSSO({ email, with_context, method });
|
|
4993
|
-
}
|
|
4994
|
-
});
|
|
4995
|
-
};
|
|
4996
|
-
var use_forgotpassword_sso_default = useForgotPasswordSSO;
|
|
4997
|
-
|
|
4998
|
-
// src/hooks/auth/use-get-provider.ts
|
|
4999
|
-
import { useMutation as useMutation3 } from "@tanstack/react-query";
|
|
5000
|
-
var useGetProvider = () => {
|
|
5001
|
-
return useMutation3({
|
|
5002
|
-
mutationFn: (data) => {
|
|
5003
|
-
return auth_service_default.getProviders(data?.db);
|
|
5004
|
-
}
|
|
5005
|
-
});
|
|
5006
|
-
};
|
|
5007
|
-
var use_get_provider_default = useGetProvider;
|
|
5008
|
-
|
|
5009
|
-
// src/hooks/auth/use-isvalid-token.ts
|
|
5010
|
-
import { useMutation as useMutation4 } from "@tanstack/react-query";
|
|
5011
|
-
var useIsValidToken = () => {
|
|
5012
|
-
return useMutation4({
|
|
5013
|
-
mutationFn: (token) => {
|
|
5014
|
-
return auth_service_default.isValidToken(token);
|
|
5015
|
-
}
|
|
5016
|
-
});
|
|
5017
|
-
};
|
|
5018
|
-
var use_isvalid_token_default = useIsValidToken;
|
|
5019
|
-
|
|
5020
4995
|
// src/hooks/auth/use-login-credential.tsx
|
|
5021
|
-
import { useMutation as useMutation5 } from "@tanstack/react-query";
|
|
5022
4996
|
var useLoginCredential = () => {
|
|
5023
4997
|
const { env: env2 } = useEnv();
|
|
5024
4998
|
console.log("useLoginCredential called", env2, new Error().stack);
|
package/dist/provider.d.mts
CHANGED
|
@@ -44,7 +44,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
|
|
|
44
44
|
localStorageUtils?: LocalStorageUtilsType;
|
|
45
45
|
sessionStorageUtils?: SessionStorageUtilsType;
|
|
46
46
|
}): react_jsx_runtime.JSX.Element;
|
|
47
|
-
declare function useEnv():
|
|
47
|
+
declare function useEnv(): {
|
|
48
48
|
env: EnvConfig;
|
|
49
49
|
setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
|
|
50
50
|
setUid: (uid: number) => void;
|
|
@@ -57,10 +57,4 @@ declare function useEnv(): EnvConfig | {
|
|
|
57
57
|
setEnvFile: (envFile: any) => void;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
children: React.ReactNode;
|
|
62
|
-
env: EnvConfig;
|
|
63
|
-
}): react_jsx_runtime.JSX.Element;
|
|
64
|
-
declare function useSharedEnv(): EnvConfig;
|
|
65
|
-
|
|
66
|
-
export { EnvProvider, EnvShareProvider, MainProvider, ReactQueryProvider, VersionGate, useEnv, useSharedEnv };
|
|
60
|
+
export { EnvProvider, MainProvider, ReactQueryProvider, VersionGate, useEnv };
|
package/dist/provider.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ declare function EnvProvider({ children, localStorageUtils: localStorageUtil, se
|
|
|
44
44
|
localStorageUtils?: LocalStorageUtilsType;
|
|
45
45
|
sessionStorageUtils?: SessionStorageUtilsType;
|
|
46
46
|
}): react_jsx_runtime.JSX.Element;
|
|
47
|
-
declare function useEnv():
|
|
47
|
+
declare function useEnv(): {
|
|
48
48
|
env: EnvConfig;
|
|
49
49
|
setupEnv: (envConfig: Partial<EnvConfig>) => EnvConfig;
|
|
50
50
|
setUid: (uid: number) => void;
|
|
@@ -57,10 +57,4 @@ declare function useEnv(): EnvConfig | {
|
|
|
57
57
|
setEnvFile: (envFile: any) => void;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
children: React.ReactNode;
|
|
62
|
-
env: EnvConfig;
|
|
63
|
-
}): react_jsx_runtime.JSX.Element;
|
|
64
|
-
declare function useSharedEnv(): EnvConfig;
|
|
65
|
-
|
|
66
|
-
export { EnvProvider, EnvShareProvider, MainProvider, ReactQueryProvider, VersionGate, useEnv, useSharedEnv };
|
|
60
|
+
export { EnvProvider, MainProvider, ReactQueryProvider, VersionGate, useEnv };
|
package/dist/provider.js
CHANGED
|
@@ -31,12 +31,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var provider_exports = {};
|
|
32
32
|
__export(provider_exports, {
|
|
33
33
|
EnvProvider: () => EnvProvider,
|
|
34
|
-
EnvShareProvider: () => EnvShareProvider,
|
|
35
34
|
MainProvider: () => MainProvider,
|
|
36
35
|
ReactQueryProvider: () => ReactQueryProvider,
|
|
37
36
|
VersionGate: () => VersionGate,
|
|
38
|
-
useEnv: () => useEnv
|
|
39
|
-
useSharedEnv: () => useSharedEnv
|
|
37
|
+
useEnv: () => useEnv
|
|
40
38
|
});
|
|
41
39
|
module.exports = __toCommonJS(provider_exports);
|
|
42
40
|
|
|
@@ -3291,11 +3289,22 @@ var axiosClient = {
|
|
|
3291
3289
|
}
|
|
3292
3290
|
};
|
|
3293
3291
|
|
|
3292
|
+
// src/hooks/auth/use-forgotpassword-sso.ts
|
|
3293
|
+
var import_react_query3 = require("@tanstack/react-query");
|
|
3294
|
+
|
|
3295
|
+
// src/hooks/auth/use-get-provider.ts
|
|
3296
|
+
var import_react_query4 = require("@tanstack/react-query");
|
|
3297
|
+
|
|
3298
|
+
// src/hooks/auth/use-isvalid-token.ts
|
|
3299
|
+
var import_react_query5 = require("@tanstack/react-query");
|
|
3300
|
+
|
|
3301
|
+
// src/hooks/auth/use-login-credential.tsx
|
|
3302
|
+
var import_react_query6 = require("@tanstack/react-query");
|
|
3303
|
+
|
|
3294
3304
|
// src/services/auth-service/backup.ts
|
|
3295
3305
|
var import_react3 = require("react");
|
|
3296
3306
|
function useAuthService() {
|
|
3297
3307
|
const { env } = useEnv();
|
|
3298
|
-
console.log("auth env", env);
|
|
3299
3308
|
const login = (0, import_react3.useCallback)(
|
|
3300
3309
|
async (body) => {
|
|
3301
3310
|
const payload = Object.fromEntries(
|
|
@@ -3511,18 +3520,6 @@ function useAuthService() {
|
|
|
3511
3520
|
};
|
|
3512
3521
|
}
|
|
3513
3522
|
|
|
3514
|
-
// src/hooks/auth/use-forgotpassword-sso.ts
|
|
3515
|
-
var import_react_query3 = require("@tanstack/react-query");
|
|
3516
|
-
|
|
3517
|
-
// src/hooks/auth/use-get-provider.ts
|
|
3518
|
-
var import_react_query4 = require("@tanstack/react-query");
|
|
3519
|
-
|
|
3520
|
-
// src/hooks/auth/use-isvalid-token.ts
|
|
3521
|
-
var import_react_query5 = require("@tanstack/react-query");
|
|
3522
|
-
|
|
3523
|
-
// src/hooks/auth/use-login-credential.tsx
|
|
3524
|
-
var import_react_query6 = require("@tanstack/react-query");
|
|
3525
|
-
|
|
3526
3523
|
// src/provider/env-provider.tsx
|
|
3527
3524
|
var import_react4 = require("react");
|
|
3528
3525
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -3644,9 +3641,8 @@ function EnvProvider({
|
|
|
3644
3641
|
}
|
|
3645
3642
|
function useEnv() {
|
|
3646
3643
|
const context = (0, import_react4.useContext)(EnvContext);
|
|
3647
|
-
console.log("useEnv context:", context, new Error().stack);
|
|
3648
3644
|
if (!context) {
|
|
3649
|
-
|
|
3645
|
+
throw new Error("useEnv must be used within an EnvProvider");
|
|
3650
3646
|
}
|
|
3651
3647
|
return context;
|
|
3652
3648
|
}
|
|
@@ -3864,19 +3860,6 @@ var VersionGate = ({ children }) => {
|
|
|
3864
3860
|
};
|
|
3865
3861
|
const validateVersion = async () => {
|
|
3866
3862
|
const serverVersion = await getVersion();
|
|
3867
|
-
console.log("serverVersion", serverVersion);
|
|
3868
|
-
login.mutate(
|
|
3869
|
-
{
|
|
3870
|
-
email: "admin",
|
|
3871
|
-
password: "admin",
|
|
3872
|
-
path: "/authentication/oauth2/token"
|
|
3873
|
-
},
|
|
3874
|
-
{
|
|
3875
|
-
onSuccess: (res) => {
|
|
3876
|
-
console.log("res login", res);
|
|
3877
|
-
}
|
|
3878
|
-
}
|
|
3879
|
-
);
|
|
3880
3863
|
const cached = localStorage.getItem("__api_version__");
|
|
3881
3864
|
if (cached !== serverVersion?.api_version) {
|
|
3882
3865
|
clearVersion();
|
|
@@ -3899,31 +3882,11 @@ var VersionGate = ({ children }) => {
|
|
|
3899
3882
|
}, [queryClient]);
|
|
3900
3883
|
return ready ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children }) : null;
|
|
3901
3884
|
};
|
|
3902
|
-
|
|
3903
|
-
// src/provider/env-share.tsx
|
|
3904
|
-
var import_react6 = require("react");
|
|
3905
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3906
|
-
var EnvShareContext = (0, import_react6.createContext)(null);
|
|
3907
|
-
function EnvShareProvider({
|
|
3908
|
-
children,
|
|
3909
|
-
env
|
|
3910
|
-
}) {
|
|
3911
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(EnvShareContext.Provider, { value: env, children });
|
|
3912
|
-
}
|
|
3913
|
-
function useSharedEnv() {
|
|
3914
|
-
const env = (0, import_react6.useContext)(EnvShareContext);
|
|
3915
|
-
if (!env) {
|
|
3916
|
-
throw new Error("useSharedEnv must be used within an EnvShareProvider");
|
|
3917
|
-
}
|
|
3918
|
-
return env;
|
|
3919
|
-
}
|
|
3920
3885
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3921
3886
|
0 && (module.exports = {
|
|
3922
3887
|
EnvProvider,
|
|
3923
|
-
EnvShareProvider,
|
|
3924
3888
|
MainProvider,
|
|
3925
3889
|
ReactQueryProvider,
|
|
3926
3890
|
VersionGate,
|
|
3927
|
-
useEnv
|
|
3928
|
-
useSharedEnv
|
|
3891
|
+
useEnv
|
|
3929
3892
|
});
|