@wellesley/auth 1.0.209 → 1.0.210

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 Ph,handleBasicResponse as cn,useGetApiV1SearchQuery as sR,usePutApiV1AccountsResendEmailByHashMutation as oR,usePostApiV1AccountsAddReasonMutation as iR}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.153";import{createSlice as w2}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as Sw,getServerApiErrorCode as Sl}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.7";import{toast as b2}from"https://cdn.jsdelivr.net/npm/react-toastify@10.0.5/+esm";import{userSlice as Ao,UserAvatar as cR}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.168";import*as Nt from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import Ew,{forwardRef as x2,createElement as Vv,useCallback as ns,useEffect as Vt,useState as aa,useRef as Os,useMemo as ob}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{useSelector as mt,useDispatch as Wa}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{Button as Tw,cn as rr,HoverCard as lR,HoverCardTrigger as uR,HoverCardContent as fR,Switch as dR,Tooltip as ib,TooltipTrigger as cb,TooltipContent as lb,Textarea as pR,FormField as hR,FormItem as _R,FormLabel as yR,FormControl as gR,Input as ub,FormMessage as mR,Form as El,ButtonLoader as Bi}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.115";import{useAppsNavigate as Ls,AppsLink as qi}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.82";import{logErrorToSentry as kR}from"https://cdn.jsdelivr.net/npm/@wellesley/sentry@1.0.19";import{get as Yv,set as Iy,appendErrors as vR,useForm as Tl}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as wR,rootReducer as bR}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.152";import{EmojiPicker as xR,EmojiStyle as zR}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.7";import{instanceInfoSlice as Zv}from"https://cdn.jsdelivr.net/npm/@wellesley/instanceinfo@1.0.26";const Hh=()=>"object"!=typeof window,z2=()=>T2()?location.hostname:location.hostname.replace(/\w\w\w\.|^/,"."),S2=e=>{const t=new Date;return t.setTime(t.getTime()+24*e*60*60*1e3),t.toUTCString()},E2=e=>Object.keys(e).reduce(((t,r)=>`${t}${r}${!0===e[r]?"":`=${e[r]}`};`),""),SR=(e,t)=>{const r=Hh()?"":document.cookie,a=`; ${t||r}`.split(`; ${e}=`);if(2===a.length)return(a.pop()||"").replace("=","").split(";").shift()},ER=(e,t)=>{Hh()||(document.cookie=E2({[e]:"",path:"/",domain:t||z2(),expires:"Thu, 01 Jan 1970 00:00:01 GMT"}))},TR=["localhost","127.0.0.1","dev.localtest.me","wellesleydev.localtest.me"],T2=()=>TR.includes(location.hostname),jR=(e,t="",r=10,a)=>{Hh()||(document.cookie=E2({[e]:t,path:"/",domain:a||z2(),expires:S2(r),...!T2()&&{SameSite:"None",Secure:!0}}))},Vh={set:jR,remove:ER,get:SR,getExpireDate:S2},Yh="auth_token",fb={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isAuthBlockVisible:!0,isPending:!1,isAuthenticated:!1},st=w2({name:"auth",initialState:fb,reducers:{logout:()=>fb,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},showAuthBlock:(e,t)=>{e.isAuthBlockVisible=t.payload},login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload,e.isPending=!1}},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,selectAuthBlockVisible:e=>e.isAuthBlockVisible,selectIsAuthenticated:e=>e.isAuthenticated}}),Py=async(e,t,r)=>{try{e(st.actions.setPending(!0));const{data:a}=await t;return Vh.set(Yh,a.token.sessionKey),null==r||r(),t}catch(t){e(st.actions.setPending(!1)),b2.error(Sw(t))}},CR=Ph.enhanceEndpoints({endpoints:{postApiV1AccountsPasswordRecover:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordRecoverCheckCode:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordRecoverChange:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},putApiV1AccountsPasswordChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},putApiV1AccountsEmailChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},putApiV1AccountsResendEmailByHash:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsEmailChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsEmailChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsConfirmEmail:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsCheckCaptcha:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsFinishCreating:{async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){await Py(t,r,(()=>{b2.success("User registered successfully")}))}},postApiV1AccountsAuthenticate:{invalidatesTags:["Secure"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){await Py(t,r)}},postApiV1AccountsSignup:{invalidatesTags:["Secure"]},postApiV1AccountsReselectUser:{async onQueryStarted({userId:e},{dispatch:t,queryFulfilled:r}){await Py(t,r),e&&t(Ao.actions.updateData({selectedUserId:e}))}}}}),{usePostApiV1AccountsPasswordRecoverMutation:j2,usePostApiV1AccountsPasswordRecoverCheckCodeMutation:jw,usePostApiV1AccountsPasswordRecoverChangeMutation:RR,usePostApiV1AccountsPasswordChangeConfirmMutation:C2,usePostApiV1AccountsPasswordChangeRequestMutation:AR,usePutApiV1AccountsPasswordChangeResendCodeMutation:NR,usePostApiV1AccountsAuthenticateMutation:R2,usePostApiV1AccountsEmailChangeRequestMutation:IR,usePostApiV1AccountsEmailChangeConfirmMutation:A2,usePostApiV1AccountsSignupMutation:Cw,usePutApiV1AccountsResendEmailByHashMutation:Xce,usePutApiV1AccountsEmailChangeResendCodeMutation:PR,usePostApiV1AccountsConfirmEmailMutation:N2,usePostApiV1AccountsFinishCreatingMutation:OR,usePostApiV1AccountsReselectUserMutation:ele,usePostApiV1AccountsCheckCaptchaMutation:qR}=CR;var Ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ed(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var db,pb,Oy={exports:{}},Ef={};
1
+ import{api as Ph,handleBasicResponse as cn,useGetApiV1SearchQuery as sR,usePutApiV1AccountsResendEmailByHashMutation as oR,usePostApiV1AccountsAddReasonMutation as iR}from"https://cdn.jsdelivr.net/npm/@wellesley/openapi@1.0.154";import{createSlice as w2}from"https://cdn.jsdelivr.net/npm/@reduxjs/toolkit@2.2.1/+esm";import{getErrorMsg as Sw,getServerApiErrorCode as Sl}from"https://cdn.jsdelivr.net/npm/@wellesley/error-kit@1.0.7";import{toast as b2}from"https://cdn.jsdelivr.net/npm/react-toastify@10.0.5/+esm";import{userSlice as Ao,UserAvatar as cR}from"https://cdn.jsdelivr.net/npm/@wellesley/user@1.0.169";import*as Nt from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import Ew,{forwardRef as x2,createElement as Vv,useCallback as ns,useEffect as Vt,useState as aa,useRef as Os,useMemo as ob}from"https://cdn.jsdelivr.net/npm/react@18.2.0/+esm";import{useSelector as mt,useDispatch as Wa}from"https://cdn.jsdelivr.net/npm/react-redux@9.1.0/+esm";import{Button as Tw,cn as rr,HoverCard as lR,HoverCardTrigger as uR,HoverCardContent as fR,Switch as dR,Tooltip as ib,TooltipTrigger as cb,TooltipContent as lb,Textarea as pR,FormField as hR,FormItem as _R,FormLabel as yR,FormControl as gR,Input as ub,FormMessage as mR,Form as El,ButtonLoader as Bi}from"https://cdn.jsdelivr.net/npm/@wellesley/ui@1.0.116";import{useAppsNavigate as Ls,AppsLink as qi}from"https://cdn.jsdelivr.net/npm/@wellesley/router@1.0.83";import{logErrorToSentry as kR}from"https://cdn.jsdelivr.net/npm/@wellesley/sentry@1.0.20";import{get as Yv,set as Iy,appendErrors as vR,useForm as Tl}from"https://cdn.jsdelivr.net/npm/react-hook-form@7.51.0/+esm";import{getStore as wR,rootReducer as bR}from"https://cdn.jsdelivr.net/npm/@wellesley/store@1.0.153";import{EmojiPicker as xR,EmojiStyle as zR}from"https://cdn.jsdelivr.net/npm/@wellesley/emoji-picker@1.0.7";import{instanceInfoSlice as Zv}from"https://cdn.jsdelivr.net/npm/@wellesley/instanceinfo@1.0.27";const Hh=()=>"object"!=typeof window,z2=()=>T2()?location.hostname:location.hostname.replace(/\w\w\w\.|^/,"."),S2=e=>{const t=new Date;return t.setTime(t.getTime()+24*e*60*60*1e3),t.toUTCString()},E2=e=>Object.keys(e).reduce(((t,r)=>`${t}${r}${!0===e[r]?"":`=${e[r]}`};`),""),SR=(e,t)=>{const r=Hh()?"":document.cookie,a=`; ${t||r}`.split(`; ${e}=`);if(2===a.length)return(a.pop()||"").replace("=","").split(";").shift()},ER=(e,t)=>{Hh()||(document.cookie=E2({[e]:"",path:"/",domain:t||z2(),expires:"Thu, 01 Jan 1970 00:00:01 GMT"}))},TR=["localhost","127.0.0.1","dev.localtest.me","wellesleydev.localtest.me"],T2=()=>TR.includes(location.hostname),jR=(e,t="",r=10,a)=>{Hh()||(document.cookie=E2({[e]:t,path:"/",domain:a||z2(),expires:S2(r),...!T2()&&{SameSite:"None",Secure:!0}}))},Vh={set:jR,remove:ER,get:SR,getExpireDate:S2},Yh="auth_token",fb={forgotPasswordStep:"request",forgotPasswordFields:null,signupStep:"rules",signupFields:null,token:null,newEmail:null,isAuthBlockVisible:!0,isPending:!1,isAuthenticated:!1},st=w2({name:"auth",initialState:fb,reducers:{logout:()=>fb,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},showAuthBlock:(e,t)=>{e.isAuthBlockVisible=t.payload},login:(e,t)=>{e.isAuthenticated=!0,e.token=t.payload,e.isPending=!1}},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,selectAuthBlockVisible:e=>e.isAuthBlockVisible,selectIsAuthenticated:e=>e.isAuthenticated}}),Py=async(e,t,r)=>{try{e(st.actions.setPending(!0));const{data:a}=await t;return Vh.set(Yh,a.token.sessionKey),null==r||r(),t}catch(t){e(st.actions.setPending(!1)),b2.error(Sw(t))}},CR=Ph.enhanceEndpoints({endpoints:{postApiV1AccountsPasswordRecover:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordRecoverCheckCode:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordRecoverChange:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},putApiV1AccountsPasswordChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsPasswordChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},putApiV1AccountsEmailChangeResendCode:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},putApiV1AccountsResendEmailByHash:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsEmailChangeRequest:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsEmailChangeConfirm:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsConfirmEmail:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsCheckCaptcha:{async onQueryStarted(e,{queryFulfilled:t}){await cn(t)}},postApiV1AccountsFinishCreating:{async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){await Py(t,r,(()=>{b2.success("User registered successfully")}))}},postApiV1AccountsAuthenticate:{invalidatesTags:["Secure"],async onQueryStarted(e,{dispatch:t,queryFulfilled:r}){await Py(t,r)}},postApiV1AccountsSignup:{invalidatesTags:["Secure"]},postApiV1AccountsReselectUser:{async onQueryStarted({userId:e},{dispatch:t,queryFulfilled:r}){await Py(t,r),e&&t(Ao.actions.updateData({selectedUserId:e}))}}}}),{usePostApiV1AccountsPasswordRecoverMutation:j2,usePostApiV1AccountsPasswordRecoverCheckCodeMutation:jw,usePostApiV1AccountsPasswordRecoverChangeMutation:RR,usePostApiV1AccountsPasswordChangeConfirmMutation:C2,usePostApiV1AccountsPasswordChangeRequestMutation:AR,usePutApiV1AccountsPasswordChangeResendCodeMutation:NR,usePostApiV1AccountsAuthenticateMutation:R2,usePostApiV1AccountsEmailChangeRequestMutation:IR,usePostApiV1AccountsEmailChangeConfirmMutation:A2,usePostApiV1AccountsSignupMutation:Cw,usePutApiV1AccountsResendEmailByHashMutation:Xce,usePutApiV1AccountsEmailChangeResendCodeMutation:PR,usePostApiV1AccountsConfirmEmailMutation:N2,usePostApiV1AccountsFinishCreatingMutation:OR,usePostApiV1AccountsReselectUserMutation:ele,usePostApiV1AccountsCheckCaptchaMutation:qR}=CR;var Ro=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ed(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var db,pb,Oy={exports:{}},Ef={};
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.209",
3
+ "version": "1.0.210",
4
4
  "license": "UNLICENSED",
5
5
  "main": "index.mjs",
6
6
  "files": [