@wellesley/auth 1.0.450 → 1.0.452
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 Tt,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 Tt,useGetApiV1SearchQuery as hA,usePutApiV1AccountsResendEmailByHashMutation as _A,usePostApiV1AccountsAddReasonMutation as yA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.396";import{createSlice as ki,createAction as Hv,createSelector as Pa}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 Sn}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.247";import*as hl from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import gA,{forwardRef as wi,createElement as Ep,useCallback as Br,useEffect as Fe,useState as Vt,useRef as Kt,useMemo as Og}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{useDispatch as Ot,useSelector as De}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{Button as bi,cn as Ne,HoverCard as mA,HoverCardTrigger as kA,HoverCardContent as wA,Switch as bA,Tooltip as Pg,TooltipTrigger as Dg,TooltipContent as Lg,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 Lo,Input as _l,FormMessage as RA,Form as En,ButtonLoader as Da,useIsMobile as rh}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.358";import{useAppsNavigate as Sr,AppsLink as Aa}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.324";import{get as jp,set as yl,appendErrors as AA,useForm as jn}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as oi,rootReducer as CA}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.395";import{EmojiPicker as IA,EmojiStyle as NA}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.247";import{useSearchParams as qA}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const ah="auth_token",Zv=()=>localStorage.getItem(ah)||void 0,OA=e=>localStorage.setItem(ah,e),PA=()=>localStorage.removeItem(ah),DA=()=>!!Zv(),Os={getToken:Zv,setToken:OA,removeToken:PA,hasToken:DA},Mg={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isPending:!!Os.getToken(),isAuthenticated:!1},Re=ki({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}}),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,ze=e=>{const t=t=>({type:e,payload:t});return t.toString=()=>`${e}`,t.type=e,t.match=t=>MA(t)&&t.type===e,t};ze("remoteReady"),ze("reselectUser");const UA=ze("requestLogin");ze("requestLogout"),ze("setConfirmLeavePage"),ze("requestChangePath"),ze("wsSubscribe"),ze("wsUnSubscribe"),ze("hostStoreConnect");const BA=ze("remoteLogin"),Kv=ze("remoteLogout");ze("wsOnMessage"),ze("setRouterPath"),ze("setDeviceType");const $A=ze("setUserError"),GA=ze("setUserIsError"),FA=ze("setUserPending"),WA=ze("setUserSuccess"),HA=ze("setUserData"),Jv=ze("updateAccountData"),YA=ze("updateUser");ze("addNotification"),ze("markNotification"),ze("setNotificationsError"),ze("setNotificationsList"),ze("setNotificationsPending"),ze("setNotificationsTotalCount"),ze("setNotificationsUnreadCount"),ze("resetNotificationsState"),ze("undoNotification"),ze("setInstanceInfo"),ze("setInstanceInfoPending"),ze("setInstanceInfoError");const VA=ze("setPlatformSettings");ze("setProfileSettings"),ze("setGroupData"),ze("setGroupLoading"),ze("showGroupBasicInfo"),Hv("requestMicroFrontendFetch"),Hv("sendMicroFrontendFetchResponse");const gl=async(e,t,r)=>{try{e(Re.actions.setPending(!0));const{data:a}=await t,n="sessionKey"in a?a.sessionKey:a.token.sessionKey;return Os.setToken(n),e(UA(n)),null==r||r(),t}catch(t){e(Re.actions.setPending(!1)),Yv.error(th(t))}},ZA=mi.enhanceEndpoints({endpoints:{getApiV1Rules:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsPasswordRecover:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsPasswordRecoverCheckCode:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsPasswordRecoverChange:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsPasswordChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},putApiV1AccountsPasswordChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsPasswordChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},putApiV1AccountsEmailChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},putApiV1AccountsResendEmailByHash:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsEmailChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsEmailChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsConfirmEmail:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(t)}},postApiV1AccountsCheckCaptcha:{async onQueryStarted(e,{queryFulfilled:t}){await Tt(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 Tt(t)}}}}),{useGetApiV1RulesQuery:KA,usePostApiV1AccountsPasswordRecoverMutation:Xv,usePostApiV1AccountsPasswordRecoverCheckCodeMutation:nh,usePostApiV1AccountsPasswordRecoverChangeMutation:JA,usePostApiV1AccountsPasswordChangeConfirmMutation:Qv,usePostApiV1AccountsPasswordChangeRequestMutation:XA,usePutApiV1AccountsPasswordChangeResendCodeMutation:QA,usePostApiV1AccountsAuthenticateEmailMutation:e0,usePostApiV1AccountsEmailChangeRequestMutation:eC,usePostApiV1AccountsEmailChangeConfirmMutation:t0,usePostApiV1AccountsSignupMutation:sh,usePutApiV1AccountsResendEmailByHashMutation:Xle,usePutApiV1AccountsEmailChangeResendCodeMutation:tC,usePostApiV1AccountsConfirmEmailMutation:r0,usePostApiV1AccountsFinishCreatingMutation:rC,usePostApiV1AccountsUserReselectUserMutation:Qle,usePostApiV1AccountsCheckCaptchaMutation:aC,useGetApiV1RbacActorsByActorIdPermissionsQuery:nC}=ZA;var sa=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
|