@wellesley/auth 1.0.504 → 1.0.506

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.
Files changed (2) hide show
  1. package/index.mjs +1 -1
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{api as gi,handleBasicResponse as Tt,useGetApiV1SearchQuery as _A,usePutApiV1AccountsResendEmailByHashMutation as yA,usePostApiV1AccountsAddReasonMutation as gA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.448";import{createSlice as mi,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.299";import*as hl from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import mA,{forwardRef as ki,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 wi,cn as Ne,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 En,ButtonLoader as Da,useIsMobile as rh}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.410";import{useAppsNavigate as Sr,AppsLink as Aa}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.376";import{get as jp,set as yl,appendErrors as CA,useForm as jn}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.447";import{EmojiPicker as NA,EmojiStyle as qA}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.299";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},Re=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,ze=e=>{const t=t=>({type:e,payload:t});return t.toString=()=>`${e}`,t.type=e,t.match=t=>UA(t)&&t.type===e,t};ze("remoteReady"),ze("reselectUser");const BA=ze("requestLogin");ze("requestLogout"),ze("setConfirmLeavePage"),ze("requestChangePath"),ze("wsSubscribe"),ze("wsUnSubscribe"),ze("hostStoreConnect");const $A=ze("remoteLogin"),Kv=ze("remoteLogout");ze("wsOnMessage"),ze("setRouterPath"),ze("setDeviceType");const GA=ze("setUserError"),FA=ze("setUserIsError"),WA=ze("setUserPending"),HA=ze("setUserSuccess"),YA=ze("setUserData"),Jv=ze("updateAccountData"),VA=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 ZA=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 e(BA(n)),null==r||r(),t}catch(t){e(Re.actions.setPending(!1)),Yv.error(th(t))}},KA=gi.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: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 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={};
1
+ import{api as gi,handleBasicResponse as Tt,useGetApiV1SearchQuery as _A,usePutApiV1AccountsResendEmailByHashMutation as yA,usePostApiV1AccountsAddReasonMutation as gA}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.450";import{createSlice as mi,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.301";import*as hl from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import mA,{forwardRef as ki,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 wi,cn as Ne,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 En,ButtonLoader as Da,useIsMobile as rh}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.412";import{useAppsNavigate as Sr,AppsLink as Aa}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.378";import{get as jp,set as yl,appendErrors as CA,useForm as jn}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.449";import{EmojiPicker as NA,EmojiStyle as qA}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.301";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},Re=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,ze=e=>{const t=t=>({type:e,payload:t});return t.toString=()=>`${e}`,t.type=e,t.match=t=>UA(t)&&t.type===e,t};ze("remoteReady"),ze("reselectUser");const BA=ze("requestLogin");ze("requestLogout"),ze("setConfirmLeavePage"),ze("requestChangePath"),ze("wsSubscribe"),ze("wsUnSubscribe"),ze("hostStoreConnect");const $A=ze("remoteLogin"),Kv=ze("remoteLogout");ze("wsOnMessage"),ze("setRouterPath"),ze("setDeviceType");const GA=ze("setUserError"),FA=ze("setUserIsError"),WA=ze("setUserPending"),HA=ze("setUserSuccess"),YA=ze("setUserData"),Jv=ze("updateAccountData"),VA=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 ZA=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 e(BA(n)),null==r||r(),t}catch(t){e(Re.actions.setPending(!1)),Yv.error(th(t))}},KA=gi.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: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 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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wellesley/auth",
3
- "version": "1.0.504",
3
+ "version": "1.0.506",
4
4
  "license": "UNLICENSED",
5
5
  "main": "index.mjs",
6
6
  "files": [