@wellesley/auth 1.0.516 → 1.0.517
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/index.mjs +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{api as mi,handleBasicResponse as Rt,useGetApiV1SearchQuery as hA,usePutApiV1AccountsResendEmailByHashMutation as _A,usePostApiV1AccountsAddReasonMutation as yA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.
|
|
1
|
+
import{api as mi,handleBasicResponse as Rt,useGetApiV1SearchQuery as hA,usePutApiV1AccountsResendEmailByHashMutation as _A,usePostApiV1AccountsAddReasonMutation as yA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.461";import{createSlice as ki,createAction as Hv,createSelector as La}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{toast as Yv}from"https://cdn.jsdelivr.net/npm/react-toastify@10.0.5/+esm";import{getErrorMsg as rh,getServerApiErrorCode as En}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.312";import*as hl from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import gA,{forwardRef as wi,createElement as Ep,useCallback as vr,useMemo as jp,useEffect as We,useState as Xt,useRef as er}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{useDispatch as Lt,useSelector as Le}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{Button as bi,cn as Oe,HoverCard as mA,HoverCardTrigger as kA,HoverCardContent as wA,Switch as bA,Tooltip as Dg,TooltipTrigger as Lg,TooltipContent as Mg,Avatar as vA,AvatarImage as xA,Textarea as zA,getTextareaClassName as SA,FormLabel as EA,useFormField as Vv,FormField as jA,FormItem as TA,FormControl as Do,Input as _l,FormMessage as RA,Form as jn,ButtonLoader as Ma,useIsMobile as ah}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.423";import{useAppsNavigate as jr,AppsLink as Ia}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.389";import{get as Tp,set as yl,appendErrors as AA,useForm as Tn}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as si,rootReducer as CA}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.460";import{EmojiPicker as IA,EmojiStyle as NA}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.312";import{useSearchParams as qA}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const nh="auth_token",Zv=()=>localStorage.getItem(nh)||void 0,OA=e=>localStorage.setItem(nh,e),PA=()=>localStorage.removeItem(nh),DA=()=>!!Zv(),vi={getToken:Zv,setToken:OA,removeToken:PA,hasToken:DA},Ug={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!vi.getToken(),isAuthenticated:!1},je=ki({name:"auth",initialState:Ug,reducers:{login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload||null,e.isPending=!1},logout:()=>({...Ug,isPending:!1}),setNewEmail:(e,t)=>{e.newEmail=t.payload},setForgotPasswordStep:(e,t)=>{e.forgotPasswordStep=t.payload},updateForgotPasswordFields:(e,t)=>{e.forgotPasswordFields={...e.forgotPasswordFields,...t.payload}},resetForgotPasswordFields:e=>{e.forgotPasswordFields=null},setSignupStep:(e,t)=>{e.signupStep=t.payload},updateSignupFields:(e,t)=>{e.signupFields={...e.signupFields,...t.payload}},resetSignupFields:e=>{e.signupFields=null},setPending:(e,t)=>{e.isPending=t.payload}},selectors:{selectToken:e=>e.token,selectNewEmail:e=>e.newEmail,selectForgotPasswordStep:e=>e.forgotPasswordStep,selectForgotPasswordFields:e=>e.forgotPasswordFields,selectSignupStep:e=>e.signupStep,selectSignupFields:e=>e.signupFields,selectPending:e=>e.isPending,selectIsAuthenticated:e=>e.isAuthenticated}}),LA=e=>{if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)},MA=e=>LA(e)&&"type"in e&&"string"==typeof e.type,xe=e=>{const t=t=>({type:e,payload:t});return t.toString=()=>`${e}`,t.type=e,t.match=t=>MA(t)&&t.type===e,t};xe("remoteReady"),xe("reselectUser");const UA=xe("requestLogin");xe("requestLogout"),xe("setConfirmLeavePage"),xe("requestChangePath"),xe("wsSubscribe"),xe("wsUnSubscribe"),xe("hostStoreConnect");const BA=xe("remoteLogin"),Kv=xe("remoteLogout");xe("wsOnMessage"),xe("setRouterPath"),xe("setDeviceType");const $A=xe("setUserError"),GA=xe("setUserIsError"),FA=xe("setUserPending"),WA=xe("setUserSuccess"),HA=xe("setUserData"),Jv=xe("updateAccountData"),YA=xe("updateUser");xe("addNotification"),xe("markNotification"),xe("setNotificationsError"),xe("setNotificationsList"),xe("setNotificationsPending"),xe("setNotificationsTotalCount"),xe("setNotificationsUnreadCount"),xe("resetNotificationsState"),xe("undoNotification"),xe("setInstanceInfo"),xe("setInstanceInfoPending"),xe("setInstanceInfoError");const VA=xe("setPlatformSettings");xe("setProfileSettings"),xe("setGroupData"),xe("setGroupLoading"),xe("showGroupBasicInfo"),Hv("requestMicroFrontendFetch"),Hv("sendMicroFrontendFetchResponse");const gl=async(e,t,r)=>{try{e(je.actions.setPending(!0));const{data:a}=await t,n="sessionKey"in a?a.sessionKey:a.token.sessionKey;return e(UA(n)),null==r||r(),t}catch(t){e(je.actions.setPending(!1)),Yv.error(rh(t))}},ZA=mi.enhanceEndpoints({endpoints:{getApiV1Rules:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsPasswordRecover:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsPasswordRecoverCheckCode:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsPasswordRecoverChange:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsPasswordChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},putApiV1AccountsPasswordChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsPasswordChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},putApiV1AccountsEmailChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},putApiV1AccountsResendEmailByHash:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsEmailChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsEmailChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsConfirmEmail:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsCheckCaptcha:{async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}},postApiV1AccountsFinishCreating:{async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){await gl(t,r,(()=>{Yv.success("User registered successfully")}))}},postApiV1AccountsAuthenticateEmail:{invalidatesTags:["Secure"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){await gl(t,r)}},postApiV1AccountsSignup:{invalidatesTags:["Secure"]},postApiV1AccountsUserReselectUser:{async onQueryStarted({userId:e},{dispatch:t,queryFulfilled:r}){await gl(t,r),e&&t(Jv({selectedUserId:e}))}},getApiV1RbacActorsByActorIdPermissions:{providesTags:["RBAC"],async onQueryStarted(e,{queryFulfilled:t}){await Rt(t)}}}}),{useGetApiV1RulesQuery:KA,usePostApiV1AccountsPasswordRecoverMutation:Xv,usePostApiV1AccountsPasswordRecoverCheckCodeMutation:sh,usePostApiV1AccountsPasswordRecoverChangeMutation:JA,usePostApiV1AccountsPasswordChangeConfirmMutation:Qv,usePostApiV1AccountsPasswordChangeRequestMutation:XA,usePutApiV1AccountsPasswordChangeResendCodeMutation:QA,usePostApiV1AccountsAuthenticateEmailMutation:e0,usePostApiV1AccountsEmailChangeRequestMutation:eC,usePostApiV1AccountsEmailChangeConfirmMutation:t0,usePostApiV1AccountsSignupMutation:oh,usePutApiV1AccountsResendEmailByHashMutation:Xle,usePutApiV1AccountsEmailChangeResendCodeMutation:tC,usePostApiV1AccountsConfirmEmailMutation:r0,usePostApiV1AccountsFinishCreatingMutation:rC,usePostApiV1AccountsUserReselectUserMutation:Qle,usePostApiV1AccountsCheckCaptchaMutation:aC,useGetApiV1RbacActorsByActorIdPermissionsQuery:nC}=ZA;var ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bg,$g,ml={exports:{}},ns={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|