@donotdev/auth 0.0.8 → 0.0.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AuthStore.d.ts","sourceRoot":"","sources":["../src/AuthStore.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AA0BxB,eAAO,MAAM,YAAY,iIAyLvB,CAAC"}
1
+ {"version":3,"file":"AuthStore.d.ts","sourceRoot":"","sources":["../src/AuthStore.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,WAAW,EAEjB,MAAM,gBAAgB,CAAC;AA0BxB,eAAO,MAAM,YAAY,iIA6LvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FirebaseAccountLinking.d.ts","sourceRoot":"","sources":["../src/FirebaseAccountLinking.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EAEd,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7D,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7D,MAAM,WAAW,0BAA0B;IACzC,GAAG,EAAE,mBAAmB,CAAC;IACzB,wBAAwB,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,GAAG,CAAC;IAC5D,gBAAgB,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,OAAO,KAAK,UAAU,CAAC;IAC1E,mBAAmB,EAAE,CACnB,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,GAAG,EACV,KAAK,EAAE,MAAM,KACV,O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wB;IAyChC;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAsBzB;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;;;;;;;;OASG;IACH,OAAO,CAAC,8BAA8B;IAgDtC;;;;;;;OAOG;IACH,KAAK,IAAI,IAAI;CAUd;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,eAAe,oBAA4C,CAAC"}
@@ -1 +1 @@
1
- import{toast as l}from"@donotdev/components";import{createSingleton as A,safeSessionStorage as d,handleError as a,isDev as m,isClient as p,ClaimsCache as R,getAuthPartnerIdByFirebaseId as S,getRoleFromClaims as v}from"@donotdev/core";import{AUTH_PARTNERS as k,SUBSCRIPTION_TIERS as P,USER_ROLES as b,createDefaultUserProfile as T}from"@donotdev/core";import{getFirebaseSDK as C,GoogleAuthProvider as L,GithubAuthProvider as N,FacebookAuthProvider as F,TwitterAuthProvider as D,OAuthProvider as w,EmailAuthProvider as U}from"@donotdev/firebase";import{getAuthMethod as y}from"./constants";import{PARTNER_STATE as o,EMAIL_VERIFICATION_STATUS as E}from"./constants";import{handleOAuthLinking as M,clearAccountLinkingState as W}from"./FirebaseAccountLinking";import{handleSmartRecovery as f}from"./FirebaseSmartRecovery";async function z(I,t,e){const i=w.credentialFromError(t),r=t.customData?._tokenResponse?.verifiedProvider?.[0]||i?.providerId||t.customData?.providerId;return r?S(r):null}class O{sdk;initialized=!1;store=null;popupTimeout=null;claimsCache=null;constructor(){this.sdk=C()}setStore(t){this.store=t}get storeState(){if(!this.store)throw new Error("[FirebaseAuth] Store not set. Call setStore() first.");return this.store}async initialize(){if(!this.initialized)try{await this.sdk.initialize();try{await this.processRedirectResult(!0)}catch(t){a(t,{userMessage:"Redirect processing failed",context:{operation:"processRedirectResult"},severity:"warning",showNotification:!1})}this.initialized=!0}catch(t){throw a(t,{userMessage:"Failed to initialize authentication",showNotification:!1})}}async processRedirectResult(t=!1){this.store&&this.store.setLoading(!0);try{const e=new Promise((r,s)=>setTimeout(()=>s(new Error("Redirect check timeout")),1e4)),i=await Promise.race([this.sdk.getRedirectResult(),e]).catch(r=>{if(r.message==="Redirect check timeout")return null;throw r});i?.user&&(await this.handleAuthStateChange(i.user),await this.checkPendingLinking(),d.removeItem("pendingAuthPartnerId"),l("success","Signed in successfully!"))}catch(e){if(e.code==="auth/account-exists-with-different-credential"){const i=w.credentialFromError(e)?.providerId||e.customData?._tokenResponse?.providerId,r=i?S(i):d.getItem("pendingAuthPartnerId");if(r)try{await f(e,()=>Promise.resolve(),{partnerId:r,method:"redirect"},this.getSmartRecoveryDeps());return}catch(s){a(s,{userMessage:"Failed to link accounts. Please try again.",showNotification:!t})}}if(a(e,{userMessage:"Authentication failed. Please try again.",showNotification:!t,context:{operation:"processRedirectResult"}}),e.code!=="auth/account-exists-with-different-credential")try{this.clearAccountLinkingState(),d.removeItem("pendingAuthPartnerId")}catch(i){a(i)}}finally{this.store&&this.store.setLoading(!1)}}ensureInitialized(){if(!this.initialized)throw new Error("FirebaseAuth not initialized. Call initialize() first.")}getAppConfig(){if(typeof globalThis<"u"){const t=globalThis._DNDEV_APP_CONFIG_;if(t)return t}return null}initializeClaimsCache(){if(this.claimsCache)return;const e=this.getAppConfig()?.features?.offlineTrustEnabled??!1;this.claimsCache=new R({offlineTrustEnabled:e,userId:this.storeState?.userId??null})}onAuthStateChanged(t){return this.sdk.onAuthStateChanged(async e=>{e?await this.handleAuthStateChange(e):this.handleSignOut(),e&&await this.checkPendingLinking();const i=e?this.convertToAuthUser(e):null;t(i)})}async handleAuthStateChange(t){if(!this.store)return;const e=this.convertToAuthUser(t);this.initializeClaimsCache(),this.claimsCache&&this.claimsCache.setUserId(e.id),this.storeState.clearAllPartnerStates();let i={userId:e.id,tier:P.FREE,status:"active",isActive:!0,features:[],subscriptionId:null,customerId:e.id,subscriptionEnd:null,cancelAtPeriodEnd:!1,updatedAt:new Date().toISOString()},r=b.USER;try{const u=(await this.sdk.getIdTokenResult(t,!0))?.claims||{};if(m(),u.subscription){const c=u.subscription;i={userId:e.id,tier:c.tier||P.FREE,status:c.status||"active",isActive:c.status==="active",features:c.features||[],subscriptionId:c.subscriptionId||null,customerId:c.customerId||e.id,subscriptionEnd:c.subscriptionEnd||null,cancelAtPeriodEnd:!!c.cancelAtPeriodEnd,updatedAt:c.updatedAt||new Date().toISOString()}}r=v(u),m()}catch(n){n?.code==="auth/network-request-failed"||n?.originalCode==="auth/network-request-failed"||n?.message?.includes("network")||a(n,{userMessage:"Failed to get custom claims",context:{operation:"getCustomClaims"},severity:"warning"})}e.role=r,m();const s={...T(e.id),role:r};m(),this.storeState.setAuthenticated(e,i,s)}handleSignOut(){this.store&&(this.claimsCache&&this.claimsCache.setUserId(null),this.storeState.clearAllPartnerStates(),this.storeState.setUnauthenticated())}async signInWithEmail(t,e){this.ensureInitialized(),this.storeState.setPartnerState("password",o.LOADING);try{const i=await this.sdk.signInWithEmail(t,e);return l("success","Signed in successfully!"),this.storeState.setPartnerState("password",o.IDLE),this.createAuthResult(i.user)}catch(i){try{return await f(i,()=>this.sdk.signInWithEmail(t,e),{email:t,partnerId:"password"},this.getSmartRecoveryDeps())}catch(r){throw this.storeState.setPartnerState("password",o.ERROR),r}}}async createUserWithEmail(t,e){this.ensureInitialized(),this.storeState.setPartnerState("password",o.LOADING);try{const i=await this.sdk.createUserWithEmail(t,e);return l("success","Account created successfully!"),this.storeState.setPartnerState("password",o.IDLE),this.createAuthResult(i.user,!0)}catch(i){try{const r=await f(i,()=>this.sdk.createUserWithEmail(t,e),{email:t,partnerId:"password"},this.getSmartRecoveryDeps());if(!r)throw new Error("Account creation failed");return r}catch(r){throw this.storeState.setPartnerState("password",o.ERROR),r}}}async signInWithEmailAndPassword(t,e){const i=await this.signInWithEmail(t,e);if(!i)throw new Error("Sign in did not return a result");return i.user}async createUserWithEmailAndPassword(t,e){return(await this.createUserWithEmail(t,e)).user}async updateUserProfile(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)return;const i={};t.displayName!==void 0&&(i.displayName=t.displayName),t.photoURL!==void 0&&(i.photoURL=t.photoURL),Object.keys(i).length!==0&&await this.sdk.updateProfile(e,i)}async getAccessToken(){const t=await this.sdk.getCurrentUser();if(!t)return null;try{return await this.sdk.getIdToken(t,!1)}catch{return null}}async refreshToken(){const t=await this.sdk.getCurrentUser();if(!t)return null;try{return await this.sdk.getIdToken(t,!0)}catch{return null}}async signInWithPartner(t,e){const i=y(e);this.ensureInitialized(),this.storeState.setPartnerState(t,o.LOADING);try{const r=this.createProviderFromConfig(t);let s;return i==="popup"?(s=await this.handlePopupAuth(t,async()=>await this.sdk.signInWithPopup(r)),s===null?(this.storeState.setPartnerState(t,o.IDLE),null):(l("success","Signed in successfully!"),this.storeState.setPartnerState(t,o.IDLE),this.createAuthResult(s.user))):(d.setItem("pendingAuthPartnerId",t),await this.sdk.signInWithRedirect(r),null)}catch(r){try{const s=await f(r,()=>{const n=this.createProviderFromConfig(t);return i==="popup"?this.sdk.signInWithPopup(n):this.sdk.signInWithRedirect(n)},{partnerId:t,method:i},this.getSmartRecoveryDeps());return s===null?(this.storeState.setPartnerState(t,o.IDLE),null):s}catch(s){throw this.storeState.setPartnerState(t,o.ERROR),s}}}async linkWithPartner(t,e){const i=y(e);this.ensureInitialized();const r=await this.sdk.getCurrentUser();if(!r)throw a(new Error("No authenticated user"),{userMessage:"You must be signed in to link accounts",context:{operation:"linkWithPartner",partnerId:t},showNotification:!0});this.storeState.setPartnerState(t,o.LOADING);try{const s=this.createProviderFromConfig(t);if(i==="popup"){const n=await this.sdk.linkWithPopup(r,s);return l("success",`Successfully linked ${t} account!`),this.storeState.setPartnerState(t,o.IDLE),this.createAuthResult(n.user)}else return await this.sdk.linkWithRedirect(r,s),null}catch(s){const n=s;let u="Failed to link account",c={operation:"linkWithPartner",partnerId:t,errorCode:n.code};switch(n.code){case"auth/operation-not-allowed":u="Account linking is disabled. Contact support for assistance.";break;case"auth/provider-already-linked":u="This account is already linked to your profile.";break;case"auth/credential-already-in-use":u="This account is already linked to another profile.";break;case"auth/requires-recent-login":u="Please sign out and sign back in, then try linking again.";break;default:u=`Failed to link ${t} account. Please try again.`}throw this.storeState.setPartnerState(t,o.ERROR),a(s,{userMessage:u,context:c,showNotification:!0})}}async handlePopupAuth(t,e){this.clearPopupMonitoring(),this.popupTimeout=setTimeout(()=>{this.storeState.setPartnerState(t,o.IDLE),this.clearPopupMonitoring()},3e4);try{const i=await e();return this.clearPopupMonitoring(),i}catch(i){if(this.clearPopupMonitoring(),i.code==="auth/popup-closed-by-user"||i.code==="auth/cancelled-popup-request")return null;throw i}}clearPopupMonitoring(){this.popupTimeout&&(clearTimeout(this.popupTimeout),this.popupTimeout=null)}async signInWithGoogleCredential(t){this.ensureInitialized(),this.storeState.setPartnerState("google",o.LOADING);try{const e=await this.sdk.signInWithGoogleCredential(t);return l("success","Signed in with Google!"),this.storeState.setPartnerState("google",o.IDLE),this.createAuthResult(e.user)}catch(e){try{return await f(e,()=>this.sdk.signInWithGoogleCredential(t),{partnerId:"google",method:"redirect"},this.getSmartRecoveryDeps())}catch(i){throw this.storeState.setPartnerState("google",o.ERROR),i}}}async getRedirectResult(){this.ensureInitialized();try{const t=await this.sdk.getRedirectResult();return t?.user?(l("success","Signed in successfully!"),this.createAuthResult(t.user)):null}catch(t){try{return await f(t,()=>this.sdk.getRedirectResult(),{method:"redirect"},this.getSmartRecoveryDeps())}catch(e){throw e}}}async checkPendingLinking(){const t=d.getItem("accountLinkingInfo"),e=d.getItem("originalCredential");if(!(!t||!e))try{const i=JSON.parse(t),r=JSON.parse(e),s=await this.sdk.getCurrentUser();if(!s)return;const n=this.convertToAuthUser(s),u=k[i.newProvider];if(!u)return;if(n.providerData?.some(g=>g.providerId===u.firebaseProviderId)||!1){this.clearAccountLinkingState();return}const h=this.createCredentialFromStoredData(r);if(!h){this.clearAccountLinkingState();return}await this.sdk.linkWithCredential(s,h),this.clearAccountLinkingState(),l("success","Accounts linked successfully!")}catch(i){throw this.clearAccountLinkingState(),a(i,{userMessage:"Account linking failed",showNotification:!0})}}async sendSignInLinkToEmail(t,e){this.ensureInitialized();try{await this.sdk.sendSignInLinkToEmail(t,e||{url:"",handleCodeInApp:!1}),l("success","Sign-in link sent to your email!")}catch(i){throw a(i,{userMessage:"Failed to send sign-in link",showNotification:!0})}}async signInWithEmailLink(t,e){this.ensureInitialized(),this.storeState.setPartnerState("emailLink",o.LOADING);try{const i=await this.sdk.signInWithEmailLink(t,e);return l("success","Signed in successfully!"),this.storeState.setPartnerState("emailLink",o.IDLE),this.createAuthResult(i.user)}catch(i){try{return await f(i,()=>this.sdk.signInWithEmailLink(t,e),{email:t,partnerId:"emailLink"},this.getSmartRecoveryDeps())}catch(r){throw this.storeState.setPartnerState("emailLink",o.ERROR),r}}}isSignInWithEmailLink(t){if(!t&&!p())return!1;const e=t||(p()?window.location.href:"");return this.sdk.isSignInWithEmailLink(e)}async sendPasswordResetEmail(t){this.ensureInitialized();try{await this.sdk.sendPasswordResetEmail(t),l("success","Password reset email sent!")}catch(e){throw a(e,{userMessage:"Failed to send password reset email",showNotification:!0})}}async updatePassword(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)throw a(new Error("No authenticated user"),{userMessage:"You must be signed in to update your password",showNotification:!0});try{await this.sdk.updatePassword(e,t),l("success","Password updated successfully!")}catch(i){throw a(i,{userMessage:"Failed to update password",showNotification:!0})}}async sendEmailVerification(){this.ensureInitialized();const t=await this.sdk.getCurrentUser();if(!t)throw a(new Error("No authenticated user"),{userMessage:"You must be signed in to verify your email",showNotification:!0});try{this.storeState.setEmailVerificationStatus(E.PENDING),await this.sdk.sendEmailVerification(t),l("success","Verification email sent!")}catch(e){throw this.storeState.setEmailVerificationStatus(E.PENDING),a(e,{userMessage:"Failed to send verification email",showNotification:!0})}}async getEmailVerificationStatus(){this.ensureInitialized();const t=await this.sdk.getCurrentUser();return t?{status:t.emailVerified?"verified":"pending"}:{status:"pending",error:"No authenticated user"}}async isEmailVerificationEnabled(){return!0}async getIdTokenResult(t=!1){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)return null;try{return await this.sdk.getIdTokenResult(e,t)}catch(i){throw a(i,{userMessage:"Failed to get authentication token"})}}async getCustomClaims(){this.ensureInitialized(),this.initializeClaimsCache();const t=await this.sdk.getCurrentUser();if(!t)return{};if(!this.claimsCache)try{return(await this.sdk.getIdTokenResult(t,!0))?.claims||{}}catch(e){throw a(e,{userMessage:"Failed to get user permissions"})}return this.claimsCache.getClaims(async()=>(await this.sdk.getIdTokenResult(t,!0))?.claims||{})}async getCustomClaim(t){this.ensureInitialized();try{return(await this.getCustomClaims())[t]??null}catch(e){throw a(e,{userMessage:"Failed to get user permission"})}}async hasRole(t){this.ensureInitialized();try{const e=await this.getCustomClaim("role");if(this.store&&e){const i=this.storeState.userProfile;i&&this.storeState.setAuthenticated(this.storeState.user,this.storeState.userSubscription,{...i,role:e})}return e===t}catch(e){throw a(e,{userMessage:"Failed to verify user role"})}}async hasTier(t){this.ensureInitialized(),this.initializeClaimsCache();try{const i=(await this.getCustomClaims()).subscription?.tier;if(this.store&&i){const r=this.storeState.userSubscription;r&&this.storeState.setAuthenticated(this.storeState.user,{...r,tier:i},this.storeState.userProfile)}return i===t}catch(e){const r=this.getAppConfig()?.features?.offlineTrustEnabled??!1,s=p()?navigator.onLine:!1;if(!r&&!s)throw a(e,{userMessage:"Failed to verify subscription tier"});return!1}}async hasFeature(t){this.ensureInitialized(),this.initializeClaimsCache();const i=this.storeState.getCustomClaimsLocal()?.features||[],r=Array.isArray(i)&&i.includes(t);if(!this.claimsCache)try{const h=(await this.getCustomClaims()).features||[];return Array.isArray(h)&&h.includes(t)}catch(c){throw a(c,{userMessage:"Failed to verify feature access"})}const s=p()?navigator.onLine:!1,u=this.getAppConfig()?.features?.offlineTrustEnabled??!1;if(s)try{const h=(await this.getCustomClaims()).features||[],g=Array.isArray(h)&&h.includes(t);return g}catch{return r}else return u?r:!1}async getCurrentUser(){const t=await this.sdk.getCurrentUser();return t?this.convertToAuthUser(t):null}async signOut(){this.ensureInitialized(),this.clearPopupMonitoring();try{d.removeItem("accountLinkingInfo"),await this.clearCachedClaims(),await this.sdk.signOut(),l("info","Signed out successfully")}catch(t){throw a(t,{userMessage:"Failed to sign out",showNotification:!0})}}async reauthenticateWithPassword(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e||!e.email)throw new Error("No authenticated user");try{const i=U.credential(e.email,t);await this.sdk.reauthenticateWithCredential(e,i)}catch(i){throw a(i,{userMessage:"Re-authentication failed. Please check your password.",showNotification:!0})}}async reauthenticateWithProvider(t,e){this.ensureInitialized();const i=await this.sdk.getCurrentUser();if(!i)throw new Error("No authenticated user");const r=y(e);try{const s=this.createProviderFromConfig(t);if(r==="popup")await this.sdk.reauthenticateWithPopup(i,s);else{await this.sdk.reauthenticateWithRedirect(i,s);return}}catch(s){throw s.code==="auth/popup-closed-by-user"||s.code==="auth/cancelled-popup-request"||s.code==="auth/popup-blocked"?new Error("REAUTH_CANCELLED"):a(s,{userMessage:"Re-authentication failed. Please try again.",showNotification:!0})}}getPrimaryProvider(t){if(!t.providerData||t.providerData.length===0)return null;const e=t.providerData[0]?.providerId;return e?e==="password"||e==="emailLink"?"password":e.startsWith("google.com")?"google":e.startsWith("github.com")?"github":e.startsWith("microsoft.com")?"microsoft":e.startsWith("apple.com")?"apple":e.startsWith("facebook.com")?"facebook":e.startsWith("twitter.com")?"twitter":null:null}async deleteAccount(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)throw new Error("No authenticated user");const i=async()=>{const r=this.getAppConfig()?.auth,s=r&&typeof r=="object"?r.deleteUserFunction:void 0;if(s)try{await s(e.uid)}catch{m()}await this.sdk.deleteUser(e),l("success","Account deleted successfully")};try{await i()}catch(r){if(r.code==="auth/requires-recent-login"){const s=this.getPrimaryProvider(e);if(!s)throw a(r,{userMessage:"Unable to determine authentication provider",showNotification:!0});if(s!=="password")try{await this.reauthenticateWithProvider(s),await i();return}catch(n){throw n.message==="REAUTH_CANCELLED"?new Error("REAUTH_CANCELLED"):a(n,{userMessage:"Re-authentication failed. Please try again.",showNotification:!0})}if(!t)throw new Error("REQUIRES_PASSWORD");try{await this.reauthenticateWithPassword(t),await i();return}catch(n){throw a(n,{userMessage:"Re-authentication failed. Please check your password.",showNotification:!0})}}throw a(r,{userMessage:"Failed to delete account",showNotification:!0})}}async clearCachedClaims(){this.claimsCache&&await this.claimsCache.clearClaims()}async setCachedClaims(t){this.initializeClaimsCache(),this.claimsCache&&await this.claimsCache.setClaims(t)}clearAccountLinkingState(){W()}resetAuthState(){this.store&&(Object.keys(k).forEach(t=>{this.storeState.setPartnerState(t,o.IDLE)}),this.storeState.clearAuthError())}async fetchSignInMethodsForEmail(t){this.ensureInitialized();try{return await this.sdk.fetchSignInMethodsForEmail(t)}catch(e){throw a(e,{userMessage:"Failed to check sign-in methods"})}}getSmartRecoveryDeps(){return{sdk:this.sdk,handleAccountLinking:this.handleAccountLinking.bind(this),createAuthResult:this.createAuthResult.bind(this)}}getAccountLinkingDeps(){return{sdk:this.sdk,createProviderFromConfig:this.createProviderFromConfig.bind(this),createAuthResult:this.createAuthResult.bind(this),getExistingProvider:z}}async handleAccountLinking(t,e,i){return await M(t,e,i,this.getAccountLinkingDeps())}createProviderFromConfig(t){const e=k[t];if(!e||!e.firebaseProviderId)throw new Error(`Unsupported partner: ${t}`);let i;switch(t){case"google":i=this.sdk.createGoogleProvider();break;case"github":i=this.sdk.createGithubProvider();break;case"facebook":i=this.sdk.createFacebookProvider();break;case"twitter":i=this.sdk.createTwitterProvider();break;case"microsoft":i=this.sdk.createMicrosoftProvider();break;case"apple":i=this.sdk.createAppleProvider();break;default:i=this.sdk.createOAuthProvider(e.firebaseProviderId)}return e.customParameters&&i.setCustomParameters(e.customParameters),e.scopes&&e.scopes.length>0&&e.scopes.forEach(r=>i.addScope(r)),i}convertToAuthUser(t){return{id:t.uid,email:t.email||null,displayName:t.displayName||null,photoURL:t.photoURL||null,emailVerified:t.emailVerified||!1,lastLoginAt:t.metadata.lastSignInTime||new Date().toISOString(),providerData:t.providerData.map(e=>({providerId:e.providerId,uid:e.uid,displayName:e.displayName,email:e.email,photoURL:e.photoURL,phoneNumber:e.phoneNumber}))}}createAuthResult(t,e=!1){return{user:this.convertToAuthUser(t),success:!0,isNewUser:e}}createCredentialFromStoredData(t){try{if(!t||!t.providerId)return null;switch(t.providerId){case"google.com":return L.credential(t.idToken||null,t.accessToken||null);case"github.com":return N.credential(t.accessToken);case"facebook.com":return F.credential(t.accessToken);case"twitter.com":return D.credential(t.accessToken,t.secret||t.oauthTokenSecret);default:return t.idToken?new w(t.providerId).credential({idToken:t.idToken,accessToken:t.accessToken}):t.accessToken?new w(t.providerId).credential({accessToken:t.accessToken}):null}}catch(e){return a(e,{showNotification:!1,severity:"warning",context:{operation:"_getCredentialFromData"}}),null}}reset(){this.initialized=!1,this.sdk=C(),this.store=null,this.claimsCache=null,this.popupTimeout&&(clearTimeout(this.popupTimeout),this.popupTimeout=null)}}const $=A(()=>new O);export{O as FirebaseAuth,$ as getFirebaseAuth};
1
+ import{toast as l}from"@donotdev/components";import{createSingleton as A,safeSessionStorage as d,handleError as a,isDev as m,isClient as p,ClaimsCache as R,getAuthPartnerIdByFirebaseId as S,getRoleFromClaims as v}from"@donotdev/core";import{AUTH_PARTNERS as k,SUBSCRIPTION_TIERS as P,USER_ROLES as T,createDefaultUserProfile as b}from"@donotdev/core";import{getFirebaseSDK as C,GoogleAuthProvider as L,GithubAuthProvider as N,FacebookAuthProvider as F,TwitterAuthProvider as D,OAuthProvider as w,EmailAuthProvider as U}from"@donotdev/firebase";import{getAuthMethod as y}from"./constants";import{PARTNER_STATE as o,EMAIL_VERIFICATION_STATUS as E}from"./constants";import{handleOAuthLinking as M,clearAccountLinkingState as W}from"./FirebaseAccountLinking";import{handleSmartRecovery as f}from"./FirebaseSmartRecovery";async function z(I,t,e){const i=w.credentialFromError(t),r=t.customData?._tokenResponse?.verifiedProvider?.[0]||i?.providerId||t.customData?.providerId;return r?S(r):null}class O{sdk;initialized=!1;store=null;popupTimeout=null;claimsCache=null;constructor(){this.sdk=C()}setStore(t){this.store=t}get storeState(){if(!this.store)throw new Error("[FirebaseAuth] Store not set. Call setStore() first.");return this.store}async initialize(){if(!this.initialized)try{await this.sdk.initialize();try{await this.processRedirectResult(!0)}catch(t){a(t,{userMessage:"Redirect processing failed",context:{operation:"processRedirectResult"},severity:"warning",showNotification:!1})}this.initialized=!0}catch(t){throw a(t,{userMessage:"Failed to initialize authentication",showNotification:!1})}}async processRedirectResult(t=!1){this.store&&this.store.setLoading(!0);try{const e=new Promise((r,s)=>setTimeout(()=>s(new Error("Redirect check timeout")),1e4)),i=await Promise.race([this.sdk.getRedirectResult(),e]).catch(r=>{if(r.message==="Redirect check timeout")return null;throw r});i?.user&&(await this.handleAuthStateChange(i.user),await this.checkPendingLinking(),d.removeItem("pendingAuthPartnerId"),l("success","Signed in successfully!"))}catch(e){if(e.code==="auth/account-exists-with-different-credential"){const i=w.credentialFromError(e)?.providerId||e.customData?._tokenResponse?.providerId,r=i?S(i):d.getItem("pendingAuthPartnerId");if(r)try{await f(e,()=>Promise.resolve(),{partnerId:r,method:"redirect"},this.getSmartRecoveryDeps());return}catch(s){a(s,{userMessage:"Failed to link accounts. Please try again.",showNotification:!t})}}if(a(e,{userMessage:"Authentication failed. Please try again.",showNotification:!t,context:{operation:"processRedirectResult"}}),e.code!=="auth/account-exists-with-different-credential")try{this.clearAccountLinkingState(),d.removeItem("pendingAuthPartnerId")}catch(i){a(i)}}finally{this.store&&this.store.setLoading(!1)}}ensureInitialized(){if(!this.initialized)throw new Error("FirebaseAuth not initialized. Call initialize() first.")}getAppConfig(){if(typeof globalThis<"u"){const t=globalThis._DNDEV_APP_CONFIG_;if(t)return t}return null}initializeClaimsCache(){if(this.claimsCache)return;const e=this.getAppConfig()?.features?.offlineTrustEnabled??!1;this.claimsCache=new R({offlineTrustEnabled:e,userId:this.storeState?.userId??null})}onAuthStateChanged(t){return this.sdk.onAuthStateChanged(async e=>{e?await this.handleAuthStateChange(e):this.handleSignOut(),e&&await this.checkPendingLinking();const i=e?this.convertToAuthUser(e):null;t(i)})}async handleAuthStateChange(t){if(!this.store)return;const e=this.convertToAuthUser(t);this.initializeClaimsCache(),this.claimsCache&&this.claimsCache.setUserId(e.id),this.storeState.clearAllPartnerStates();let i={userId:e.id,tier:P.FREE,status:"active",isActive:!0,features:[],subscriptionId:null,customerId:e.id,subscriptionEnd:null,cancelAtPeriodEnd:!1,updatedAt:new Date().toISOString()},r=T.USER;try{const u=(await this.sdk.getIdTokenResult(t,!0))?.claims||{};if(m(),u.subscription){const c=u.subscription;i={userId:e.id,tier:c.tier||P.FREE,status:c.status||"active",isActive:c.status==="active",features:c.features||[],subscriptionId:c.subscriptionId||null,customerId:c.customerId||e.id,subscriptionEnd:c.subscriptionEnd||null,cancelAtPeriodEnd:!!c.cancelAtPeriodEnd,updatedAt:c.updatedAt||new Date().toISOString()}}r=v(u),m()}catch(n){n?.code==="auth/network-request-failed"||n?.originalCode==="auth/network-request-failed"||n?.message?.includes("network")||a(n,{userMessage:"Failed to get custom claims",context:{operation:"getCustomClaims"},severity:"warning"})}e.role=r,m();const s={...b(e.id),role:r};m(),this.storeState.setAuthenticated(e,i,s)}handleSignOut(){this.store&&(this.claimsCache&&this.claimsCache.setUserId(null),this.storeState.clearAllPartnerStates(),this.storeState.setUnauthenticated())}async signInWithEmail(t,e){this.ensureInitialized(),this.storeState.setPartnerState("password",o.LOADING);try{const i=await this.sdk.signInWithEmail(t,e);return l("success","Signed in successfully!"),this.storeState.setPartnerState("password",o.IDLE),this.createAuthResult(i.user)}catch(i){try{return await f(i,()=>this.sdk.signInWithEmail(t,e),{email:t,partnerId:"password"},this.getSmartRecoveryDeps())}catch(r){throw this.storeState.setPartnerState("password",o.ERROR),r}}}async createUserWithEmail(t,e){this.ensureInitialized(),this.storeState.setPartnerState("password",o.LOADING);try{const i=await this.sdk.createUserWithEmail(t,e);return l("success","Account created successfully!"),this.storeState.setPartnerState("password",o.IDLE),this.createAuthResult(i.user,!0)}catch(i){try{const r=await f(i,()=>this.sdk.createUserWithEmail(t,e),{email:t,partnerId:"password"},this.getSmartRecoveryDeps());if(!r)throw new Error("Account creation failed");return r}catch(r){throw this.storeState.setPartnerState("password",o.ERROR),r}}}async signInWithEmailAndPassword(t,e){const i=await this.signInWithEmail(t,e);if(!i)throw new Error("Sign in did not return a result");return i.user}async createUserWithEmailAndPassword(t,e){return(await this.createUserWithEmail(t,e)).user}async updateUserProfile(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)return;const i={};t.displayName!==void 0&&(i.displayName=t.displayName),t.photoURL!==void 0&&(i.photoURL=t.photoURL),Object.keys(i).length!==0&&await this.sdk.updateProfile(e,i)}async getAccessToken(){const t=await this.sdk.getCurrentUser();if(!t)return null;try{return await this.sdk.getIdToken(t,!1)}catch{return null}}async refreshToken(){const t=await this.sdk.getCurrentUser();if(!t)return null;try{return await this.sdk.getIdToken(t,!0)}catch{return null}}async signInWithPartner(t,e){const i=y(e);this.ensureInitialized(),this.storeState.setPartnerState(t,o.LOADING);try{const r=this.createProviderFromConfig(t);let s;return i==="popup"?(s=await this.handlePopupAuth(t,async()=>await this.sdk.signInWithPopup(r)),s===null?(this.storeState.setPartnerState(t,o.IDLE),null):(l("success","Signed in successfully!"),this.storeState.setPartnerState(t,o.IDLE),this.createAuthResult(s.user))):(d.setItem("pendingAuthPartnerId",t),await this.sdk.signInWithRedirect(r),null)}catch(r){try{const s=await f(r,()=>{const n=this.createProviderFromConfig(t);return i==="popup"?this.sdk.signInWithPopup(n):this.sdk.signInWithRedirect(n)},{partnerId:t,method:i},this.getSmartRecoveryDeps());return s===null?(this.storeState.setPartnerState(t,o.IDLE),null):s}catch(s){throw this.storeState.setPartnerState(t,o.ERROR),s}}}async linkWithPartner(t,e){const i=y(e);this.ensureInitialized();const r=await this.sdk.getCurrentUser();if(!r)throw a(new Error("No authenticated user"),{userMessage:"You must be signed in to link accounts",context:{operation:"linkWithPartner",partnerId:t},showNotification:!0});this.storeState.setPartnerState(t,o.LOADING);try{const s=this.createProviderFromConfig(t);if(i==="popup"){const n=await this.sdk.linkWithPopup(r,s);return l("success",`Successfully linked ${t} account!`),this.storeState.setPartnerState(t,o.IDLE),this.createAuthResult(n.user)}else return await this.sdk.linkWithRedirect(r,s),null}catch(s){const n=s;let u="Failed to link account",c={operation:"linkWithPartner",partnerId:t,errorCode:n.code};switch(n.code){case"auth/operation-not-allowed":u="Account linking is disabled. Contact support for assistance.";break;case"auth/provider-already-linked":u="This account is already linked to your profile.";break;case"auth/credential-already-in-use":u="This account is already linked to another profile.";break;case"auth/requires-recent-login":u="Please sign out and sign back in, then try linking again.";break;default:u=`Failed to link ${t} account. Please try again.`}throw this.storeState.setPartnerState(t,o.ERROR),a(s,{userMessage:u,context:c,showNotification:!0})}}async handlePopupAuth(t,e){this.clearPopupMonitoring(),this.popupTimeout=setTimeout(()=>{this.storeState.setPartnerState(t,o.IDLE),this.clearPopupMonitoring()},3e4);try{const i=await e();return this.clearPopupMonitoring(),i}catch(i){if(this.clearPopupMonitoring(),i.code==="auth/popup-closed-by-user"||i.code==="auth/cancelled-popup-request")return null;throw i}}clearPopupMonitoring(){this.popupTimeout&&(clearTimeout(this.popupTimeout),this.popupTimeout=null)}async signInWithGoogleCredential(t){this.ensureInitialized(),this.storeState.setPartnerState("google",o.LOADING);try{const e=await this.sdk.signInWithGoogleCredential(t);return l("success","Signed in with Google!"),this.storeState.setPartnerState("google",o.IDLE),this.createAuthResult(e.user)}catch(e){try{return await f(e,()=>this.sdk.signInWithGoogleCredential(t),{partnerId:"google",method:"redirect"},this.getSmartRecoveryDeps())}catch(i){throw this.storeState.setPartnerState("google",o.ERROR),i}}}async getRedirectResult(){this.ensureInitialized();try{const t=await this.sdk.getRedirectResult();return t?.user?(l("success","Signed in successfully!"),this.createAuthResult(t.user)):null}catch(t){try{return await f(t,()=>this.sdk.getRedirectResult(),{method:"redirect"},this.getSmartRecoveryDeps())}catch(e){throw e}}}async checkPendingLinking(){const t=d.getItem("accountLinkingInfo"),e=d.getItem("originalCredential");if(!(!t||!e))try{const i=JSON.parse(t),r=JSON.parse(e),s=await this.sdk.getCurrentUser();if(!s)return;const n=this.convertToAuthUser(s),u=k[i.newProvider];if(!u)return;if(n.providerData?.some(g=>g.providerId===u.firebaseProviderId)||!1){this.clearAccountLinkingState();return}const h=this.createCredentialFromStoredData(r);if(!h){this.clearAccountLinkingState();return}await this.sdk.linkWithCredential(s,h),this.clearAccountLinkingState(),l("success","Accounts linked successfully!")}catch(i){throw this.clearAccountLinkingState(),a(i,{userMessage:"Account linking failed",showNotification:!0})}}async sendSignInLinkToEmail(t,e){this.ensureInitialized();try{if(!e?.url)throw new Error('sendSignInLinkToEmail requires actionCodeSettings with a non-empty "url". Pass { url: "https://yourapp.com/finishSignIn", handleCodeInApp: true }.');await this.sdk.sendSignInLinkToEmail(t,e),l("success","Sign-in link sent to your email!")}catch(i){throw a(i,{userMessage:"Failed to send sign-in link",showNotification:!0})}}async signInWithEmailLink(t,e){this.ensureInitialized(),this.storeState.setPartnerState("emailLink",o.LOADING);try{const i=await this.sdk.signInWithEmailLink(t,e);return l("success","Signed in successfully!"),this.storeState.setPartnerState("emailLink",o.IDLE),this.createAuthResult(i.user)}catch(i){try{return await f(i,()=>this.sdk.signInWithEmailLink(t,e),{email:t,partnerId:"emailLink"},this.getSmartRecoveryDeps())}catch(r){throw this.storeState.setPartnerState("emailLink",o.ERROR),r}}}isSignInWithEmailLink(t){if(!t&&!p())return!1;const e=t||(p()?window.location.href:"");return this.sdk.isSignInWithEmailLink(e)}async sendPasswordResetEmail(t){this.ensureInitialized();try{await this.sdk.sendPasswordResetEmail(t),l("success","Password reset email sent!")}catch(e){throw a(e,{userMessage:"Failed to send password reset email",showNotification:!0})}}async updatePassword(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)throw a(new Error("No authenticated user"),{userMessage:"You must be signed in to update your password",showNotification:!0});try{await this.sdk.updatePassword(e,t),l("success","Password updated successfully!")}catch(i){throw a(i,{userMessage:"Failed to update password",showNotification:!0})}}async sendEmailVerification(){this.ensureInitialized();const t=await this.sdk.getCurrentUser();if(!t)throw a(new Error("No authenticated user"),{userMessage:"You must be signed in to verify your email",showNotification:!0});try{this.storeState.setEmailVerificationStatus(E.PENDING),await this.sdk.sendEmailVerification(t),l("success","Verification email sent!")}catch(e){throw this.storeState.setEmailVerificationStatus(E.PENDING),a(e,{userMessage:"Failed to send verification email",showNotification:!0})}}async getEmailVerificationStatus(){this.ensureInitialized();const t=await this.sdk.getCurrentUser();return t?{status:t.emailVerified?"verified":"pending"}:{status:"pending",error:"No authenticated user"}}async isEmailVerificationEnabled(){return!0}async getIdTokenResult(t=!1){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)return null;try{return await this.sdk.getIdTokenResult(e,t)}catch(i){throw a(i,{userMessage:"Failed to get authentication token"})}}async getCustomClaims(){this.ensureInitialized(),this.initializeClaimsCache();const t=await this.sdk.getCurrentUser();if(!t)return{};if(!this.claimsCache)try{return(await this.sdk.getIdTokenResult(t,!0))?.claims||{}}catch(e){throw a(e,{userMessage:"Failed to get user permissions"})}return this.claimsCache.getClaims(async()=>(await this.sdk.getIdTokenResult(t,!0))?.claims||{})}async getCustomClaim(t){this.ensureInitialized();try{return(await this.getCustomClaims())[t]??null}catch(e){throw a(e,{userMessage:"Failed to get user permission"})}}async hasRole(t){this.ensureInitialized();try{const e=await this.getCustomClaim("role");if(this.store&&e){const i=this.storeState.userProfile;i&&this.storeState.setAuthenticated(this.storeState.user,this.storeState.userSubscription,{...i,role:e})}return e===t}catch(e){throw a(e,{userMessage:"Failed to verify user role"})}}async hasTier(t){this.ensureInitialized(),this.initializeClaimsCache();try{const i=(await this.getCustomClaims()).subscription?.tier;if(this.store&&i){const r=this.storeState.userSubscription;r&&this.storeState.setAuthenticated(this.storeState.user,{...r,tier:i},this.storeState.userProfile)}return i===t}catch(e){const r=this.getAppConfig()?.features?.offlineTrustEnabled??!1,s=p()?navigator.onLine:!1;if(!r&&!s)throw a(e,{userMessage:"Failed to verify subscription tier"});return!1}}async hasFeature(t){this.ensureInitialized(),this.initializeClaimsCache();const i=this.storeState.getCustomClaimsLocal()?.features||[],r=Array.isArray(i)&&i.includes(t);if(!this.claimsCache)try{const h=(await this.getCustomClaims()).features||[];return Array.isArray(h)&&h.includes(t)}catch(c){throw a(c,{userMessage:"Failed to verify feature access"})}const s=p()?navigator.onLine:!1,u=this.getAppConfig()?.features?.offlineTrustEnabled??!1;if(s)try{const h=(await this.getCustomClaims()).features||[],g=Array.isArray(h)&&h.includes(t);return g}catch{return r}else return u?r:!1}async getCurrentUser(){const t=await this.sdk.getCurrentUser();return t?this.convertToAuthUser(t):null}async signOut(){this.ensureInitialized(),this.clearPopupMonitoring();try{d.removeItem("accountLinkingInfo"),await this.clearCachedClaims(),await this.sdk.signOut(),l("info","Signed out successfully")}catch(t){throw a(t,{userMessage:"Failed to sign out",showNotification:!0})}}async reauthenticateWithPassword(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e||!e.email)throw new Error("No authenticated user");try{const i=U.credential(e.email,t);await this.sdk.reauthenticateWithCredential(e,i)}catch(i){throw a(i,{userMessage:"Re-authentication failed. Please check your password.",showNotification:!0})}}async reauthenticateWithProvider(t,e){this.ensureInitialized();const i=await this.sdk.getCurrentUser();if(!i)throw new Error("No authenticated user");const r=y(e);try{const s=this.createProviderFromConfig(t);if(r==="popup")await this.sdk.reauthenticateWithPopup(i,s);else{await this.sdk.reauthenticateWithRedirect(i,s);return}}catch(s){throw s.code==="auth/popup-closed-by-user"||s.code==="auth/cancelled-popup-request"||s.code==="auth/popup-blocked"?new Error("REAUTH_CANCELLED"):a(s,{userMessage:"Re-authentication failed. Please try again.",showNotification:!0})}}getPrimaryProvider(t){if(!t.providerData||t.providerData.length===0)return null;const e=t.providerData[0]?.providerId;return e?e==="password"||e==="emailLink"?"password":e.startsWith("google.com")?"google":e.startsWith("github.com")?"github":e.startsWith("microsoft.com")?"microsoft":e.startsWith("apple.com")?"apple":e.startsWith("facebook.com")?"facebook":e.startsWith("twitter.com")?"twitter":null:null}async deleteAccount(t){this.ensureInitialized();const e=await this.sdk.getCurrentUser();if(!e)throw new Error("No authenticated user");const i=async()=>{const r=this.getAppConfig()?.auth,s=r&&typeof r=="object"?r.deleteUserFunction:void 0;if(s)try{await s(e.uid)}catch{m()}await this.sdk.deleteUser(e),l("success","Account deleted successfully")};try{await i()}catch(r){if(r.code==="auth/requires-recent-login"){const s=this.getPrimaryProvider(e);if(!s)throw a(r,{userMessage:"Unable to determine authentication provider",showNotification:!0});if(s!=="password")try{await this.reauthenticateWithProvider(s),await i();return}catch(n){throw n.message==="REAUTH_CANCELLED"?new Error("REAUTH_CANCELLED"):a(n,{userMessage:"Re-authentication failed. Please try again.",showNotification:!0})}if(!t)throw new Error("REQUIRES_PASSWORD");try{await this.reauthenticateWithPassword(t),await i();return}catch(n){throw a(n,{userMessage:"Re-authentication failed. Please check your password.",showNotification:!0})}}throw a(r,{userMessage:"Failed to delete account",showNotification:!0})}}async clearCachedClaims(){this.claimsCache&&await this.claimsCache.clearClaims()}async setCachedClaims(t){this.initializeClaimsCache(),this.claimsCache&&await this.claimsCache.setClaims(t)}clearAccountLinkingState(){W()}resetAuthState(){this.store&&(Object.keys(k).forEach(t=>{this.storeState.setPartnerState(t,o.IDLE)}),this.storeState.clearAuthError())}async fetchSignInMethodsForEmail(t){this.ensureInitialized();try{return await this.sdk.fetchSignInMethodsForEmail(t)}catch(e){throw a(e,{userMessage:"Failed to check sign-in methods"})}}getSmartRecoveryDeps(){return{sdk:this.sdk,handleAccountLinking:this.handleAccountLinking.bind(this),createAuthResult:this.createAuthResult.bind(this)}}getAccountLinkingDeps(){return{sdk:this.sdk,createProviderFromConfig:this.createProviderFromConfig.bind(this),createAuthResult:this.createAuthResult.bind(this),getExistingProvider:z}}async handleAccountLinking(t,e,i){return await M(t,e,i,this.getAccountLinkingDeps())}createProviderFromConfig(t){const e=k[t];if(!e||!e.firebaseProviderId)throw new Error(`Unsupported partner: ${t}`);let i;switch(t){case"google":i=this.sdk.createGoogleProvider();break;case"github":i=this.sdk.createGithubProvider();break;case"facebook":i=this.sdk.createFacebookProvider();break;case"twitter":i=this.sdk.createTwitterProvider();break;case"microsoft":i=this.sdk.createMicrosoftProvider();break;case"apple":i=this.sdk.createAppleProvider();break;default:i=this.sdk.createOAuthProvider(e.firebaseProviderId)}return e.customParameters&&i.setCustomParameters(e.customParameters),e.scopes&&e.scopes.length>0&&e.scopes.forEach(r=>i.addScope(r)),i}convertToAuthUser(t){return{id:t.uid,email:t.email||null,displayName:t.displayName||null,photoURL:t.photoURL||null,emailVerified:t.emailVerified||!1,lastLoginAt:t.metadata.lastSignInTime||new Date().toISOString(),providerData:t.providerData.map(e=>({providerId:e.providerId,uid:e.uid,displayName:e.displayName,email:e.email,photoURL:e.photoURL,phoneNumber:e.phoneNumber}))}}createAuthResult(t,e=!1){return{user:this.convertToAuthUser(t),success:!0,isNewUser:e}}createCredentialFromStoredData(t){try{if(!t||!t.providerId)return null;switch(t.providerId){case"google.com":return L.credential(t.idToken||null,t.accessToken||null);case"github.com":return N.credential(t.accessToken);case"facebook.com":return F.credential(t.accessToken);case"twitter.com":return D.credential(t.accessToken,t.secret||t.oauthTokenSecret);default:return t.idToken?new w(t.providerId).credential({idToken:t.idToken,accessToken:t.accessToken}):t.accessToken?new w(t.providerId).credential({accessToken:t.accessToken}):null}}catch(e){return a(e,{showNotification:!1,severity:"warning",context:{operation:"_getCredentialFromData"}}),null}}reset(){this.initialized=!1,this.sdk=C(),this.store=null,this.claimsCache=null,this.popupTimeout&&(clearTimeout(this.popupTimeout),this.popupTimeout=null)}}const $=A(()=>new O);export{O as FirebaseAuth,$ as getFirebaseAuth};
@@ -1 +1 @@
1
- {"version":3,"file":"Feature.d.ts","sourceRoot":"","sources":["../../src/components/Feature.tsx"],"names":[],"mappings":"AAgBA,OAAO,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H,eAAO,MAAM,OAAO,qGAuBnB,CAAC;AAgCF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,uHAKrB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,uHAKzB,CAAC"}
@@ -1 +1 @@
1
- "use client";import{Fragment as u,jsx as t}from"react/jsx-runtime";import{useImperativeHandle as l,forwardRef as s}from"react";import{useAuth as m}from"../useAuth";const h=s(({featureId:e,fallback:r=null,children:i},o)=>{const n=m("userSubscription")?.features?.includes(e)||!1;return l(o,()=>({enabled:n}),[n]),n?t(u,{children:i}):r?t(u,{children:r}):null}),a=s(({tier:e,fallback:r=null,children:i},o)=>{const p=m("userSubscription"),n=e||"pro",c=p?.tier===n;return l(o,()=>({enabled:c}),[c]),c?t(u,{children:i}):r?t(u,{children:r}):null}),x=s((e,r)=>t(a,{ref:r,tier:"pro",...e})),S=s((e,r)=>t(a,{ref:r,tier:"premium",...e}));export{h as Feature,S as PremiumFeature,x as ProFeature};
1
+ "use client";import{Fragment as s,jsx as t}from"react/jsx-runtime";import{useImperativeHandle as m,forwardRef as u}from"react";import{hasTierAccess as f}from"@donotdev/core";import{useAuth as l}from"../useAuth";const S=u(({featureId:e,fallback:r=null,children:i},o)=>{const n=l("userSubscription")?.features?.includes(e)||!1;return m(o,()=>({enabled:n}),[n]),n?t(s,{children:i}):r?t(s,{children:r}):null}),a=u(({tier:e,fallback:r=null,children:i},o)=>{const p=l("userSubscription"),n=e||"pro",c=f(p?.tier,n);return m(o,()=>({enabled:c}),[c]),c?t(s,{children:i}):r?t(s,{children:r}):null}),g=u((e,r)=>t(a,{ref:r,tier:"pro",...e})),T=u((e,r)=>t(a,{ref:r,tier:"premium",...e}));export{S as Feature,T as PremiumFeature,g as ProFeature};
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureGuard.d.ts","sourceRoot":"","sources":["../../src/components/FeatureGuard.tsx"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EA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G;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,QAAQ,EAAE,cAAc,EACxB,OAAO,EACP,iBAAwB,EACxB,eAAsB,GACvB,EAAE,iBAAiB,kDAwGnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE;IAC1C,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;IAC7B,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,gBAAgB,KAAK,OAAO,CAAC;CAChE,GAAG,OAAO,CA6CV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAC/C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,WAEV,CAAC,6CAOnC;AAGD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as o,Fragment as x}from"react/jsx-runtime";import{Stack as p}from"@donotdev/components";import{hasTierAccess as g}from"@donotdev/core";import{useAuth as n}from"../useAuth";import{AuthFallback as z}from"./AuthFallback";function R({requiredTier:e,userTier:i}){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:o(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u{1F512}"}),o("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:e==="pro"?"Pro Feature":"Premium Feature"}),o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["Upgrade to ",e," to access this feature",i&&` (current: ${i})`]})]})]})})}function v({requiredRole:e,userRole:i}){const s=Array.isArray(e)?e.join(" or "):e;return r("div",{className:"dndev-surface","data-variant":"destructive","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--destructive)",backgroundColor:"var(--muted)"},children:o(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--destructive)"},children:"\u{1F6AB}"}),o("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--destructive-foreground)"},children:"Access Denied"}),o("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["This feature requires ",s," role",i&&` (current: ${i})`]})]})]})})}function b(){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:o(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u23F0"}),o("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:"Subscription Required"}),r("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:"This feature requires an active subscription"})]})]})})}function T({children:e,role:i,tier:s,subscription:a,validate:d,fallback:t,message:h,showUpgradePrompt:m=!0,showLoginPrompt:l=!0}){const y=n("user"),A=n("loading"),S=n("userProfile"),f=n("userSubscription"),D=n("hasRole"),P=n("hasTier"),u=S?.role,c=f?.tier;return A?r("div",{style:{height:"2rem",borderRadius:"var(--radius)",backgroundColor:"var(--muted)",animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}):!y&&(i||s||a)?l?r(z,{message:h||"Please sign in to access this feature"}):null:i&&!(Array.isArray(i)?i:[i]).some(q=>u===q)?t?r(t,{requiredRole:i,userRole:u||void 0}):r(v,{requiredRole:i,userRole:u||void 0}):s&&!g(c,s)?t?r(t,{requiredTier:s,userTier:c||"free"}):m?r(R,{requiredTier:s,userTier:c||"free"}):null:a&&!f?.isActive?t?r(t,{requiresSubscription:!0,hasSubscription:f?.isActive||!1}):r(b,{}):d&&u&&c&&!d(u,c)?t?r(t,{userRole:u,userTier:c}):r(v,{userRole:u}):r(x,{children:e})}function G(e){const i=n("user"),s=n("userProfile"),a=n("userSubscription"),d=s?.role,t=a?.tier;return!(!i&&(e.role||e.tier||e.subscription)||e.role&&!(Array.isArray(e.role)?e.role:[e.role]).some(l=>d===l)||e.tier&&!g(t,e.tier)||e.subscription&&!a?.isActive||e.validate&&d&&t&&!e.validate(d,t))}function U(e,i){return a=>r(T,{...i,children:r(e,{...a})})}export{v as AccessDenied,T as FeatureGuard,b as SubscriptionExpired,R as UpgradePrompt,G as useCanAccessFeature,U as withFeatureGuard};
1
+ "use client";import{jsx as r,jsxs as n,Fragment as z}from"react/jsx-runtime";import{Stack as p}from"@donotdev/components";import{hasRoleAccess as g,hasTierAccess as b}from"@donotdev/core";import{useAuth as u}from"../useAuth";import{AuthFallback as D}from"./AuthFallback";function R({requiredTier:e,userTier:i}){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:n(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u{1F512}"}),n("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:e==="pro"?"Pro Feature":"Premium Feature"}),n("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["Upgrade to ",e," to access this feature",i&&` (current: ${i})`]})]})]})})}function v({requiredRole:e,userRole:i}){const s=Array.isArray(e)?e.join(" or "):e;return r("div",{className:"dndev-surface","data-variant":"destructive","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--destructive)",backgroundColor:"var(--muted)"},children:n(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--destructive)"},children:"\u{1F6AB}"}),n("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--destructive-foreground)"},children:"Access Denied"}),n("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:["This feature requires ",s," role",i&&` (current: ${i})`]})]})]})})}function y(){return r("div",{className:"dndev-surface","data-variant":"default","data-shadow":"sm","data-radius":"lg",style:{padding:"var(--gap-md)",border:"1px solid var(--border)",backgroundColor:"var(--muted)"},children:n(p,{direction:"row",align:"center",children:[r("span",{style:{color:"var(--accent)"},children:"\u23F0"}),n("div",{children:[r("p",{style:{fontWeight:500,fontSize:"var(--font-size-base)",color:"var(--foreground)"},children:"Subscription Required"}),r("p",{style:{fontSize:"var(--font-size-sm)",color:"var(--muted-foreground)"},children:"This feature requires an active subscription"})]})]})})}function T({children:e,role:i,tier:s,subscription:o,validate:d,fallback:t,message:h,showUpgradePrompt:m=!0,showLoginPrompt:l=!0}){const A=u("user"),S=u("loading"),q=u("userProfile"),f=u("userSubscription"),a=q?.role,c=f?.tier;return S?r("div",{style:{height:"2rem",borderRadius:"var(--radius)",backgroundColor:"var(--muted)",animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}}):!A&&(i||s||o)?l?r(D,{message:h||"Please sign in to access this feature"}):null:i&&!(Array.isArray(i)?i:[i]).some(x=>g(a,x))?t?r(t,{requiredRole:i,userRole:a||void 0}):r(v,{requiredRole:i,userRole:a||void 0}):s&&!b(c,s)?t?r(t,{requiredTier:s,userTier:c||"free"}):m?r(R,{requiredTier:s,userTier:c||"free"}):null:o&&!f?.isActive?t?r(t,{requiresSubscription:!0,hasSubscription:f?.isActive||!1}):r(y,{}):d&&a&&c&&!d(a,c)?t?r(t,{userRole:a,userTier:c}):r(v,{userRole:a}):r(z,{children:e})}function F(e){const i=u("user"),s=u("userProfile"),o=u("userSubscription"),d=s?.role,t=o?.tier;return!(!i&&(e.role||e.tier||e.subscription)||e.role&&!(Array.isArray(e.role)?e.role:[e.role]).some(l=>g(d,l))||e.tier&&!b(t,e.tier)||e.subscription&&!o?.isActive||e.validate&&d&&t&&!e.validate(d,t))}function G(e,i){return o=>r(T,{...i,children:r(e,{...o})})}export{v as AccessDenied,T as FeatureGuard,y as SubscriptionExpired,R as UpgradePrompt,F as useCanAccessFeature,G as withFeatureGuard};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{describe as b,it as i,expect as u,vi as r,beforeEach as m}from"vitest";import{render as n,screen as c,fireEvent as h}from"@testing-library/react";import l from"../MultipleAuthProviders";const d=r.fn();r.mock("../../hooks/useAuth",()=>({useAuth:()=>({signInWithProvider:d})})),r.mock("@donotdev/components",()=>({Button:({children:e,onClick:o,...s})=>t("button",{onClick:o,...s,children:e}),Stack:({children:e,...o})=>t("div",{...o,children:e})})),b("MultipleAuthProviders",()=>{const e=["google","github"];m(()=>{r.clearAllMocks()}),i("renders all provided auth providers",()=>{n(t(l,{providers:e})),u(c.getByRole("button")).toBeDefined()}),i("calls signInWithProvider when provider button clicked",()=>{n(t(l,{providers:e}));const s=c.getAllByRole("button")[0];s&&(h.click(s),u(d).toHaveBeenCalled())}),i("calls onSuccess callback after successful auth",async()=>{const o=r.fn();d.mockResolvedValue({user:{id:"123"}}),n(t(l,{providers:e,onSuccess:o}));const a=c.getAllByRole("button")[0];a&&(h.click(a),await new Promise(v=>setTimeout(v,100)))}),i("shows labels when showLabels is true",()=>{n(t(l,{providers:e,showLabels:!0})),u(c.getAllByRole("button").length).toBeGreaterThan(0)})});
1
+ import{jsx as s}from"react/jsx-runtime";import{describe as v,it as l,expect as a,vi as t,beforeEach as m}from"vitest";import{render as n,screen as i,fireEvent as u}from"@testing-library/react";import c from"../MultipleAuthProviders";const d=t.fn();t.mock("../../hooks/useAuth",()=>({useAuth:()=>({signInWithProvider:d})})),t.mock("@donotdev/components",()=>({Button:({children:e,onClick:o,...r})=>s("button",{onClick:o,...r,children:e}),Stack:({children:e,...o})=>s("div",{...o,children:e})})),v("MultipleAuthProviders",()=>{const e=["google","github"];m(()=>{t.clearAllMocks()}),l("renders all provided auth providers",()=>{n(s(c,{providers:e})),a(i.getByRole("button")).toBeDefined()}),l("calls signInWithProvider when provider button clicked",()=>{n(s(c,{providers:e}));const o=i.getAllByRole("button")[0];o&&(u.click(o),a(d).toHaveBeenCalled())}),l("calls onSuccess callback after successful auth",async()=>{const o=t.fn();d.mockResolvedValue({user:{id:"123"}}),n(s(c,{providers:e,onSuccess:o}));const r=i.getAllByRole("button")[0];r&&(u.click(r),await new Promise(h=>setTimeout(h,100)))}),l("shows labels when showLabels is true",()=>{n(s(c,{providers:e,showLabels:!0})),a(i.getAllByRole("button").length).toBeGreaterThan(0)})});
package/dist/index.d.ts CHANGED
@@ -16,7 +16,8 @@ AuthUser as User, // Rename AuthUser to User for public API simplicity
16
16
  UserRole, SubscriptionTier, } from '@donotdev/core';
17
17
  export { getAuthMethod } from './constants';
18
18
  export type { AuthMethod } from './constants';
19
- export type { AuthPartnerButtonProps, GoogleOneTapProps, LoginModalProps, MultipleAuthProvidersProps, } from './constants';
19
+ export type { AuthPartnerButtonProps, GoogleOneTapProps, LoginModalProps, } from './constants';
20
+ export type { MultipleAuthProvidersProps } from './components/MultipleAuthProviders';
20
21
  export type { FeatureGuardProps } from './components/FeatureGuard';
21
22
  export type { ConfirmDeleteDialogProps, ReauthDialogProps, } from './components/DeleteAccountDialogs';
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAGnE,OAAO,EAAE,YAAY,EAA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