@wellesley/auth 1.0.514 → 1.0.515
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 gi,handleBasicResponse as Rt,useGetApiV1SearchQuery as _A,usePutApiV1AccountsResendEmailByHashMutation as yA,usePostApiV1AccountsAddReasonMutation as gA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.
|
|
1
|
+
import{api as gi,handleBasicResponse as Rt,useGetApiV1SearchQuery as _A,usePutApiV1AccountsResendEmailByHashMutation as yA,usePostApiV1AccountsAddReasonMutation as gA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.459";import{createSlice as mi,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 th,getServerApiErrorCode as En}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.310";import*as hl from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import mA,{forwardRef as ki,createElement as Ep,useCallback as $r,useEffect as We,useState as Xt,useRef as er,useMemo as Og}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 wi,cn as Oe,HoverCard as kA,HoverCardTrigger as wA,HoverCardContent as bA,Switch as vA,Tooltip as Pg,TooltipTrigger as Dg,TooltipContent as Lg,Avatar as xA,AvatarImage as zA,Textarea as SA,getTextareaClassName as EA,FormLabel as jA,useFormField as Vv,FormField as TA,FormItem as RA,FormControl as Do,Input as _l,FormMessage as AA,Form as jn,ButtonLoader as Ma,useIsMobile as rh}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.421";import{useAppsNavigate as Er,AppsLink as Ia}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.387";import{get as jp,set as yl,appendErrors as CA,useForm as Tn}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as si,rootReducer as IA}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.458";import{EmojiPicker as NA,EmojiStyle as qA}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.310";import{useSearchParams as OA}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const ah="auth_token",Zv=()=>localStorage.getItem(ah)||void 0,PA=e=>localStorage.setItem(ah,e),DA=()=>localStorage.removeItem(ah),LA=()=>!!Zv(),bi={getToken:Zv,setToken:PA,removeToken:DA,hasToken:LA},Mg={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!bi.getToken(),isAuthenticated:!1},je=mi({name:"auth",initialState:Mg,reducers:{login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload||null,e.isPending=!1},logout:()=>({...Mg,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}}),MA=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)},UA=e=>MA(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=>UA(t)&&t.type===e,t};xe("remoteReady"),xe("reselectUser");const BA=xe("requestLogin");xe("requestLogout"),xe("setConfirmLeavePage"),xe("requestChangePath"),xe("wsSubscribe"),xe("wsUnSubscribe"),xe("hostStoreConnect");const $A=xe("remoteLogin"),Kv=xe("remoteLogout");xe("wsOnMessage"),xe("setRouterPath"),xe("setDeviceType");const GA=xe("setUserError"),FA=xe("setUserIsError"),WA=xe("setUserPending"),HA=xe("setUserSuccess"),YA=xe("setUserData"),Jv=xe("updateAccountData"),VA=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 ZA=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(BA(n)),null==r||r(),t}catch(t){e(je.actions.setPending(!1)),Yv.error(th(t))}},KA=gi.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:JA,usePostApiV1AccountsPasswordRecoverMutation:Xv,usePostApiV1AccountsPasswordRecoverCheckCodeMutation:nh,usePostApiV1AccountsPasswordRecoverChangeMutation:XA,usePostApiV1AccountsPasswordChangeConfirmMutation:Qv,usePostApiV1AccountsPasswordChangeRequestMutation:QA,usePutApiV1AccountsPasswordChangeResendCodeMutation:eC,usePostApiV1AccountsAuthenticateEmailMutation:e0,usePostApiV1AccountsEmailChangeRequestMutation:tC,usePostApiV1AccountsEmailChangeConfirmMutation:t0,usePostApiV1AccountsSignupMutation:sh,usePutApiV1AccountsResendEmailByHashMutation:Qle,usePutApiV1AccountsEmailChangeResendCodeMutation:rC,usePostApiV1AccountsConfirmEmailMutation:r0,usePostApiV1AccountsFinishCreatingMutation:aC,usePostApiV1AccountsUserReselectUserMutation:eue,usePostApiV1AccountsCheckCaptchaMutation:nC,useGetApiV1RbacActorsByActorIdPermissionsQuery:sC}=KA;var ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ug,Bg,ml={exports:{}},ns={};
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.min.js
|