@fctc/interface-logic 1.10.4 → 1.10.5
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 +66 -71
- package/dist/hooks.mjs +50 -55
- package/dist/provider.d.mts +1 -7
- package/dist/provider.d.ts +1 -7
- package/dist/provider.js +14 -51
- package/dist/provider.mjs +13 -48
- 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");
|
|
@@ -4843,23 +4893,16 @@ var initialEnvState = {
|
|
|
4843
4893
|
var EnvContext = (0, import_react4.createContext)(null);
|
|
4844
4894
|
function useEnv() {
|
|
4845
4895
|
const context = (0, import_react4.useContext)(EnvContext);
|
|
4846
|
-
console.log("useEnv context:", context, new Error().stack);
|
|
4847
4896
|
if (!context) {
|
|
4848
4897
|
return initialEnvState;
|
|
4849
4898
|
}
|
|
4850
4899
|
return context;
|
|
4851
4900
|
}
|
|
4852
4901
|
|
|
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
4902
|
// src/services/auth-service/backup.ts
|
|
4859
4903
|
function useAuthService() {
|
|
4860
4904
|
const { env: env2 } = useEnv();
|
|
4861
|
-
|
|
4862
|
-
const login = (0, import_react6.useCallback)(
|
|
4905
|
+
const login = (0, import_react5.useCallback)(
|
|
4863
4906
|
async (body) => {
|
|
4864
4907
|
const payload = Object.fromEntries(
|
|
4865
4908
|
Object.entries({
|
|
@@ -4879,7 +4922,7 @@ function useAuthService() {
|
|
|
4879
4922
|
},
|
|
4880
4923
|
[env2]
|
|
4881
4924
|
);
|
|
4882
|
-
const forgotPassword = (0,
|
|
4925
|
+
const forgotPassword = (0, import_react5.useCallback)(
|
|
4883
4926
|
async (email) => {
|
|
4884
4927
|
const bodyData = {
|
|
4885
4928
|
login: email,
|
|
@@ -4893,7 +4936,7 @@ function useAuthService() {
|
|
|
4893
4936
|
},
|
|
4894
4937
|
[env2]
|
|
4895
4938
|
);
|
|
4896
|
-
const forgotPasswordSSO = (0,
|
|
4939
|
+
const forgotPasswordSSO = (0, import_react5.useCallback)(
|
|
4897
4940
|
async ({
|
|
4898
4941
|
email,
|
|
4899
4942
|
with_context,
|
|
@@ -4916,7 +4959,7 @@ function useAuthService() {
|
|
|
4916
4959
|
},
|
|
4917
4960
|
[env2]
|
|
4918
4961
|
);
|
|
4919
|
-
const resetPassword = (0,
|
|
4962
|
+
const resetPassword = (0, import_react5.useCallback)(
|
|
4920
4963
|
async (data, token) => {
|
|
4921
4964
|
const bodyData = {
|
|
4922
4965
|
token,
|
|
@@ -4931,7 +4974,7 @@ function useAuthService() {
|
|
|
4931
4974
|
},
|
|
4932
4975
|
[env2]
|
|
4933
4976
|
);
|
|
4934
|
-
const resetPasswordSSO = (0,
|
|
4977
|
+
const resetPasswordSSO = (0, import_react5.useCallback)(
|
|
4935
4978
|
async ({
|
|
4936
4979
|
method,
|
|
4937
4980
|
password,
|
|
@@ -4954,7 +4997,7 @@ function useAuthService() {
|
|
|
4954
4997
|
},
|
|
4955
4998
|
[env2]
|
|
4956
4999
|
);
|
|
4957
|
-
const updatePassword = (0,
|
|
5000
|
+
const updatePassword = (0, import_react5.useCallback)(
|
|
4958
5001
|
async (data, token) => {
|
|
4959
5002
|
const bodyData = {
|
|
4960
5003
|
token,
|
|
@@ -4969,7 +5012,7 @@ function useAuthService() {
|
|
|
4969
5012
|
},
|
|
4970
5013
|
[env2]
|
|
4971
5014
|
);
|
|
4972
|
-
const isValidToken = (0,
|
|
5015
|
+
const isValidToken = (0, import_react5.useCallback)(
|
|
4973
5016
|
async (token) => {
|
|
4974
5017
|
const bodyData = {
|
|
4975
5018
|
token
|
|
@@ -4982,7 +5025,7 @@ function useAuthService() {
|
|
|
4982
5025
|
},
|
|
4983
5026
|
[env2]
|
|
4984
5027
|
);
|
|
4985
|
-
const isValidActionToken = (0,
|
|
5028
|
+
const isValidActionToken = (0, import_react5.useCallback)(
|
|
4986
5029
|
async (actionToken, path) => {
|
|
4987
5030
|
return env2?.requests?.post(
|
|
4988
5031
|
path,
|
|
@@ -4998,7 +5041,7 @@ function useAuthService() {
|
|
|
4998
5041
|
},
|
|
4999
5042
|
[env2]
|
|
5000
5043
|
);
|
|
5001
|
-
const loginSocial = (0,
|
|
5044
|
+
const loginSocial = (0, import_react5.useCallback)(
|
|
5002
5045
|
async ({
|
|
5003
5046
|
db,
|
|
5004
5047
|
state,
|
|
@@ -5016,13 +5059,13 @@ function useAuthService() {
|
|
|
5016
5059
|
},
|
|
5017
5060
|
[env2]
|
|
5018
5061
|
);
|
|
5019
|
-
const getProviders = (0,
|
|
5062
|
+
const getProviders = (0, import_react5.useCallback)(
|
|
5020
5063
|
async (db) => {
|
|
5021
5064
|
return env2?.requests?.get("/oauth/providers", { params: { db } });
|
|
5022
5065
|
},
|
|
5023
5066
|
[env2]
|
|
5024
5067
|
);
|
|
5025
|
-
const getAccessByCode = (0,
|
|
5068
|
+
const getAccessByCode = (0, import_react5.useCallback)(
|
|
5026
5069
|
async (code) => {
|
|
5027
5070
|
const data = new URLSearchParams();
|
|
5028
5071
|
data.append("code", code);
|
|
@@ -5041,7 +5084,7 @@ function useAuthService() {
|
|
|
5041
5084
|
},
|
|
5042
5085
|
[env2]
|
|
5043
5086
|
);
|
|
5044
|
-
const logout = (0,
|
|
5087
|
+
const logout = (0, import_react5.useCallback)(
|
|
5045
5088
|
async (data) => {
|
|
5046
5089
|
console.log(data);
|
|
5047
5090
|
return env2?.requests?.post(
|
|
@@ -5074,55 +5117,7 @@ function useAuthService() {
|
|
|
5074
5117
|
};
|
|
5075
5118
|
}
|
|
5076
5119
|
|
|
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
5120
|
// src/hooks/auth/use-login-credential.tsx
|
|
5125
|
-
var import_react_query7 = require("@tanstack/react-query");
|
|
5126
5121
|
var useLoginCredential = () => {
|
|
5127
5122
|
const { env: env2 } = useEnv();
|
|
5128
5123
|
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
|
|
|
@@ -4739,22 +4789,15 @@ var initialEnvState = {
|
|
|
4739
4789
|
var EnvContext = createContext(null);
|
|
4740
4790
|
function useEnv() {
|
|
4741
4791
|
const context = useContext(EnvContext);
|
|
4742
|
-
console.log("useEnv context:", context, new Error().stack);
|
|
4743
4792
|
if (!context) {
|
|
4744
4793
|
return initialEnvState;
|
|
4745
4794
|
}
|
|
4746
4795
|
return context;
|
|
4747
4796
|
}
|
|
4748
4797
|
|
|
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
4798
|
// src/services/auth-service/backup.ts
|
|
4755
4799
|
function useAuthService() {
|
|
4756
4800
|
const { env: env2 } = useEnv();
|
|
4757
|
-
console.log("auth env", env2);
|
|
4758
4801
|
const login = useCallback3(
|
|
4759
4802
|
async (body) => {
|
|
4760
4803
|
const payload = Object.fromEntries(
|
|
@@ -4970,55 +5013,7 @@ function useAuthService() {
|
|
|
4970
5013
|
};
|
|
4971
5014
|
}
|
|
4972
5015
|
|
|
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
5016
|
// src/hooks/auth/use-login-credential.tsx
|
|
5021
|
-
import { useMutation as useMutation5 } from "@tanstack/react-query";
|
|
5022
5017
|
var useLoginCredential = () => {
|
|
5023
5018
|
const { env: env2 } = useEnv();
|
|
5024
5019
|
console.log("useLoginCredential called", env2, new Error().stack);
|
package/dist/provider.d.mts
CHANGED
|
@@ -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
|
@@ -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,7 +3641,6 @@ 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
|
return initialEnvState;
|
|
3650
3646
|
}
|
|
@@ -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
|
});
|
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,7 +3601,6 @@ 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
3605
|
return initialEnvState;
|
|
3608
3606
|
}
|
|
@@ -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
|
};
|
package/dist/services.d.mts
CHANGED
|
@@ -253,31 +253,4 @@ declare const ViewService: {
|
|
|
253
253
|
}): Promise<any>;
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
-
|
|
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 };
|