@wellesley/auth 1.0.419 → 1.0.421
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 It,useGetApiV1SearchQuery as dA,usePutApiV1AccountsResendEmailByHashMutation as pA,usePostApiV1AccountsAddReasonMutation as hA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@
|
|
1
|
+
import{api as mi,handleBasicResponse as It,useGetApiV1SearchQuery as dA,usePutApiV1AccountsResendEmailByHashMutation as pA,usePostApiV1AccountsAddReasonMutation as hA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.365";import{createSlice as ki,createAction as Wv,createSelector as Oa}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{toast as Hv}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.216";import*as hl from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import _A,{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 Ue}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{Button as bi,cn as Ne,HoverCard as yA,HoverCardTrigger as gA,HoverCardContent as mA,Switch as kA,Tooltip as Pg,TooltipTrigger as Dg,TooltipContent as Lg,Avatar as wA,AvatarImage as bA,Textarea as vA,getTextareaClassName as xA,FormLabel as zA,useFormField as Yv,FormField as SA,FormItem as EA,FormControl as Lo,Input as _l,FormMessage as jA,Form as En,ButtonLoader as Pa,useIsMobile as rh}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.327";import{useAppsNavigate as Sr,AppsLink as Aa}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.293";import{get as jp,set as yl,appendErrors as TA,useForm as jn}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as oi,rootReducer as RA}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.364";import{EmojiPicker as AA,EmojiStyle as CA}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.216";import{useSearchParams as IA}from"https://cdn.jsdelivr.net/npm/react-router-dom@6.22.2/+esm";const ah="auth_token",Vv=()=>localStorage.getItem(ah)||void 0,NA=e=>localStorage.setItem(ah,e),qA=()=>localStorage.removeItem(ah),OA=()=>!!Vv(),Os={getToken:Vv,setToken:NA,removeToken:qA,hasToken:OA},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}}),PA=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)},DA=e=>PA(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=>DA(t)&&t.type===e,t};ze("remoteReady"),ze("reselectUser");const LA=ze("requestLogin");ze("requestLogout"),ze("setConfirmLeavePage"),ze("requestChangePath"),ze("wsSubscribe"),ze("wsUnSubscribe"),ze("hostStoreConnect");const MA=ze("remoteLogin"),Zv=ze("remoteLogout");ze("wsOnMessage"),ze("setRouterPath"),ze("setDeviceType");const UA=ze("setUserError"),BA=ze("setUserIsError"),$A=ze("setUserPending"),GA=ze("setUserSuccess"),FA=ze("setUserData"),Kv=ze("updateAccountData"),WA=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 HA=ze("setPlatformSettings");ze("setProfileSettings"),ze("setGroupData"),ze("setGroupLoading"),ze("showGroupBasicInfo"),Wv("requestMicroFrontendFetch"),Wv("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(LA(n)),null==r||r(),t}catch(t){e(Re.actions.setPending(!1)),Hv.error(th(t))}},YA=mi.enhanceEndpoints({endpoints:{getApiV1Rules:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsPasswordRecover:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsPasswordRecoverCheckCode:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsPasswordRecoverChange:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsPasswordChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},putApiV1AccountsPasswordChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsPasswordChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},putApiV1AccountsEmailChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},putApiV1AccountsResendEmailByHash:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsEmailChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsEmailChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsConfirmEmail:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsCheckCaptcha:{async onQueryStarted(e,{queryFulfilled:t}){await It(t)}},postApiV1AccountsFinishCreating:{async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){await gl(t,r,(()=>{Hv.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(Kv({selectedUserId:e}))}}}}),{useGetApiV1RulesQuery:VA,usePostApiV1AccountsPasswordRecoverMutation:Jv,usePostApiV1AccountsPasswordRecoverCheckCodeMutation:nh,usePostApiV1AccountsPasswordRecoverChangeMutation:ZA,usePostApiV1AccountsPasswordChangeConfirmMutation:Xv,usePostApiV1AccountsPasswordChangeRequestMutation:KA,usePutApiV1AccountsPasswordChangeResendCodeMutation:JA,usePostApiV1AccountsAuthenticateEmailMutation:Qv,usePostApiV1AccountsEmailChangeRequestMutation:XA,usePostApiV1AccountsEmailChangeConfirmMutation:e0,usePostApiV1AccountsSignupMutation:sh,usePutApiV1AccountsResendEmailByHashMutation:Fle,usePutApiV1AccountsEmailChangeResendCodeMutation:QA,usePostApiV1AccountsConfirmEmailMutation:t0,usePostApiV1AccountsFinishCreatingMutation:eC,usePostApiV1AccountsUserReselectUserMutation:Wle,usePostApiV1AccountsCheckCaptchaMutation:tC}=YA;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
|