foundation-sdk 0.2.3 → 0.2.5

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.
@@ -0,0 +1,2 @@
1
+ "use strict";var h=require("@auth0/auth0-spa-js");var p=new Map;function d(s,t){p.set(s,t)}d("none",async()=>({login:async()=>{},logout:async()=>{},getUser:async()=>{},getTokenSilently:async()=>"none",isAuthenticated:async()=>!0}));d("auth0",async s=>{let t=s.auth0;if(!t)throw new Error("Auth0 config required");let i=await(0,h.createAuth0Client)({domain:t.domain,clientId:t.clientId,authorizationParams:{audience:t.audience,scope:t.scope||"openid profile email",redirect_uri:window.location.origin},useRefreshTokens:!0,cacheLocation:"localstorage"}),a=t.domain,c=t.clientId;return{login:e=>i.loginWithRedirect(e),logout:e=>i.logout({logoutParams:{returnTo:window.location.origin},...e}),getUser:async()=>{let e=await i.getUser();if(e)return{id:e.sub||"",email:e.email||"",name:e.name,picture:e.picture}},getTokenSilently:e=>i.getTokenSilently(e),isAuthenticated:()=>i.isAuthenticated(),async signIn(e,r){let n=await fetch(`https://${a}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"password",client_id:c,username:e,password:r,audience:t.audience,scope:t.scope||"openid profile email"})});if(!n.ok){let o=await n.json().catch(()=>({}));throw new Error(o.error_description||o.message||"Sign in failed")}},async signUp(e,r,n){let o=await fetch(`https://${a}/dbconnections/signup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:c,email:e,password:r,connection:"Username-Password-Authentication",...n})});if(!o.ok){let u=await o.json().catch(()=>({}));throw new Error(u.description||u.message||"Sign up failed")}},async forgotPassword(e){let r=await fetch(`https://${a}/dbconnections/change_password`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:c,email:e,connection:"Username-Password-Authentication"})});if(!r.ok){let n=await r.json().catch(()=>({}));throw new Error(n.error_description||n.message||"Password reset request failed")}},async resetPassword(){throw new Error("Auth0 password reset is completed via the email link, not a code")}}});
2
+ //# sourceMappingURL=auth-auth0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/auth-auth0.ts","../src/auth.ts"],"sourcesContent":["import { createAuth0Client } from '@auth0/auth0-spa-js'\nimport { registerAuthProvider } from './auth'\nimport type { AuthClient } from './types'\n\nregisterAuthProvider('auth0', async (config): Promise<AuthClient> => {\n const auth0 = config.auth0 as { domain: string; clientId: string; audience?: string; scope?: string }\n if (!auth0) throw new Error('Auth0 config required')\n\n const client = await createAuth0Client({\n domain: auth0.domain,\n clientId: auth0.clientId,\n authorizationParams: {\n audience: auth0.audience,\n scope: auth0.scope || 'openid profile email',\n redirect_uri: window.location.origin\n },\n useRefreshTokens: true,\n cacheLocation: 'localstorage'\n })\n\n const domain = auth0.domain\n const clientId = auth0.clientId\n\n return {\n login: (options) => client.loginWithRedirect(options),\n logout: (options) => client.logout({ logoutParams: { returnTo: window.location.origin }, ...options }),\n getUser: async () => {\n const user = await client.getUser()\n if (!user) return undefined\n return { id: user.sub || '', email: user.email || '', name: user.name, picture: user.picture }\n },\n getTokenSilently: (options) => client.getTokenSilently(options),\n isAuthenticated: () => client.isAuthenticated(),\n\n async signIn(email: string, password: string) {\n const response = await fetch(`https://${domain}/oauth/token`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n grant_type: 'password',\n client_id: clientId,\n username: email,\n password,\n audience: auth0.audience,\n scope: auth0.scope || 'openid profile email'\n })\n })\n if (!response.ok) {\n const err = await response.json().catch(() => ({}))\n throw new Error(err.error_description || err.message || 'Sign in failed')\n }\n },\n\n async signUp(email: string, password: string, metadata?: Record<string, unknown>) {\n const response = await fetch(`https://${domain}/dbconnections/signup`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n client_id: clientId,\n email,\n password,\n connection: 'Username-Password-Authentication',\n ...metadata\n })\n })\n if (!response.ok) {\n const err = await response.json().catch(() => ({}))\n throw new Error(err.description || err.message || 'Sign up failed')\n }\n },\n\n async forgotPassword(email: string) {\n const response = await fetch(`https://${domain}/dbconnections/change_password`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n client_id: clientId,\n email,\n connection: 'Username-Password-Authentication'\n })\n })\n if (!response.ok) {\n const err = await response.json().catch(() => ({}))\n throw new Error(err.error_description || err.message || 'Password reset request failed')\n }\n },\n\n async resetPassword() {\n throw new Error('Auth0 password reset is completed via the email link, not a code')\n }\n }\n})\n","/**\n * Auth core — provider registry and AuthService wrapper.\n * Provider implementations live in auth-auth0.ts and auth-cognito.ts.\n */\nimport type { AuthClient, AuthService, User } from './types'\n\nconst MAX_LISTENERS = 100\n\n// --- Provider registry ---\n\nconst providers = new Map<string, (config: Record<string, unknown>) => Promise<AuthClient>>()\n\nexport function registerAuthProvider(name: string, factory: (config: Record<string, unknown>) => Promise<AuthClient>) {\n providers.set(name, factory)\n}\n\n// Built-in \"none\" provider\nregisterAuthProvider('none', async () => ({\n login: async () => {},\n logout: async () => {},\n getUser: async () => undefined,\n getTokenSilently: async () => 'none',\n isAuthenticated: async () => true\n}))\n\nexport interface AuthProviderConfig {\n provider: string\n [key: string]: unknown\n}\n\nexport async function createAuthClient(config: AuthProviderConfig): Promise<AuthClient> {\n const factory = providers.get(config.provider)\n if (!factory) {\n throw new Error(\n `Auth provider \"${config.provider}\" not registered. ` +\n `Import \"foundation-sdk/${config.provider}\" to register it.`\n )\n }\n return factory(config)\n}\n\n// --- AuthService wrapper ---\n\nexport function createAuthService(client: AuthClient): AuthService & { _initUser(): Promise<void> } {\n let user: User | null = null\n const listeners: Array<(user: User | null) => void> = []\n\n function notifyListeners() {\n listeners.forEach(fn => { try { fn(user) } catch { /* */ } })\n }\n\n async function refreshUser() {\n const authUser = await client.getUser()\n user = authUser ? { id: authUser.id, email: authUser.email, name: authUser.name, picture: authUser.picture } : null\n }\n\n return {\n get user() { return user },\n get isAuthenticated() { return !!user },\n\n async getToken() {\n return client.getTokenSilently()\n },\n\n async login(options) {\n await client.login(options)\n await refreshUser()\n notifyListeners()\n },\n\n async logout(options) {\n await client.logout(options)\n user = null\n notifyListeners()\n },\n\n async signIn(email, password) {\n if (!client.signIn) throw new Error('signIn not supported by this auth provider')\n await client.signIn(email, password)\n await refreshUser()\n notifyListeners()\n },\n\n async signUp(email, password, metadata) {\n if (!client.signUp) throw new Error('signUp not supported by this auth provider')\n await client.signUp(email, password, metadata)\n },\n\n async forgotPassword(email) {\n if (!client.forgotPassword) throw new Error('forgotPassword not supported by this auth provider')\n await client.forgotPassword(email)\n },\n\n async resetPassword(code, newPassword) {\n if (!client.resetPassword) throw new Error('resetPassword not supported by this auth provider')\n await client.resetPassword(code, newPassword)\n },\n\n onChange(callback) {\n if (listeners.length >= MAX_LISTENERS) {\n console.warn('[Foundation SDK] Auth listener limit reached.')\n return () => {}\n }\n listeners.push(callback)\n return () => {\n const idx = listeners.indexOf(callback)\n if (idx > -1) listeners.splice(idx, 1)\n }\n },\n\n async _initUser() {\n const authenticated = await client.isAuthenticated()\n if (authenticated) await refreshUser()\n }\n }\n}\n"],"mappings":"aAAA,IAAAA,EAAkC,+BCUlC,IAAMC,EAAY,IAAI,IAEf,SAASC,EAAqBC,EAAcC,EAAmE,CACpHH,EAAU,IAAIE,EAAMC,CAAO,CAC7B,CAGAF,EAAqB,OAAQ,UAAa,CACxC,MAAO,SAAY,CAAC,EACpB,OAAQ,SAAY,CAAC,EACrB,QAAS,SAAS,GAClB,iBAAkB,SAAY,OAC9B,gBAAiB,SAAY,EAC/B,EAAE,EDnBFG,EAAqB,QAAS,MAAOC,GAAgC,CACnE,IAAMC,EAAQD,EAAO,MACrB,GAAI,CAACC,EAAO,MAAM,IAAI,MAAM,uBAAuB,EAEnD,IAAMC,EAAS,QAAM,qBAAkB,CACrC,OAAQD,EAAM,OACd,SAAUA,EAAM,SAChB,oBAAqB,CACnB,SAAUA,EAAM,SAChB,MAAOA,EAAM,OAAS,uBACtB,aAAc,O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S,GAAI,CAChB,IAAMC,EAAM,MAAMD,EAAS,KAAK,EAAE,MAAM,KAAO,CAAC,EAAE,EAClD,MAAM,IAAI,MAAMC,EAAI,aAAeA,EAAI,SAAW,gBAAgB,CACpE,CACF,EAEA,MAAM,eAAeH,EAAe,CAClC,IAAME,EAAW,MAAM,MAAM,WAAWN,CAAM,iCAAkC,CAC9E,OAAQ,OACR,QAAS,CAAE,eAAgB,kBAAmB,EAC9C,KAAM,KAAK,UAAU,CACnB,UAAWC,EACX,MAAAG,EACA,WAAY,kCACd,CAAC,CACH,CAAC,EACD,GAAI,CAACE,EAAS,GAAI,CAChB,IAAMC,EAAM,MAAMD,EAAS,KAAK,EAAE,MAAM,KAAO,CAAC,EAAE,EAClD,MAAM,IAAI,MAAMC,EAAI,mBAAqBA,EAAI,SAAW,+BAA+B,CACzF,CACF,EAEA,MAAM,eAAgB,CACpB,MAAM,IAAI,MAAM,kEAAkE,CACpF,CACF,CACF,CAAC","names":["import_auth0_spa_js","providers","registerAuthProvider","name","factory","registerAuthProvider","config","auth0","client","domain","clientId","options","user","email","password","response","err","metadata"]}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+ import{createAuth0Client as p}from"@auth0/auth0-spa-js";var h=new Map;function d(s,t){h.set(s,t)}d("none",async()=>({login:async()=>{},logout:async()=>{},getUser:async()=>{},getTokenSilently:async()=>"none",isAuthenticated:async()=>!0}));d("auth0",async s=>{let t=s.auth0;if(!t)throw new Error("Auth0 config required");let i=await p({domain:t.domain,clientId:t.clientId,authorizationParams:{audience:t.audience,scope:t.scope||"openid profile email",redirect_uri:window.location.origin},useRefreshTokens:!0,cacheLocation:"localstorage"}),a=t.domain,c=t.clientId;return{login:e=>i.loginWithRedirect(e),logout:e=>i.logout({logoutParams:{returnTo:window.location.origin},...e}),getUser:async()=>{let e=await i.getUser();if(e)return{id:e.sub||"",email:e.email||"",name:e.name,picture:e.picture}},getTokenSilently:e=>i.getTokenSilently(e),isAuthenticated:()=>i.isAuthenticated(),async signIn(e,r){let n=await fetch(`https://${a}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"password",client_id:c,username:e,password:r,audience:t.audience,scope:t.scope||"openid profile email"})});if(!n.ok){let o=await n.json().catch(()=>({}));throw new Error(o.error_description||o.message||"Sign in failed")}},async signUp(e,r,n){let o=await fetch(`https://${a}/dbconnections/signup`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:c,email:e,password:r,connection:"Username-Password-Authentication",...n})});if(!o.ok){let u=await o.json().catch(()=>({}));throw new Error(u.description||u.message||"Sign up failed")}},async forgotPassword(e){let r=await fetch(`https://${a}/dbconnections/change_password`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:c,email:e,connection:"Username-Password-Authentication"})});if(!r.ok){let n=await r.json().catch(()=>({}));throw new Error(n.error_description||n.message||"Password reset request failed")}},async resetPassword(){throw new Error("Auth0 password reset is completed via the email link, not a code")}}});
2
+ //# sourceMappingURL=auth-auth0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/auth-auth0.ts","../src/auth.ts"],"sourcesContent":["import { createAuth0Client } from '@auth0/auth0-spa-js'\nimport { registerAuthProvider } from './auth'\nimport type { AuthClient } from './types'\n\nregisterAuthProvider('auth0', async (config): Promise<AuthClient> => {\n const auth0 = config.auth0 as { domain: string; clientId: string; audience?: string; scope?: string }\n if (!auth0) throw new Error('Auth0 config required')\n\n const client = await createAuth0Client({\n domain: auth0.domain,\n clientId: auth0.clientId,\n authorizationParams: {\n audience: auth0.audience,\n scope: auth0.scope || 'openid profile email',\n redirect_uri: window.location.origin\n },\n useRefreshTokens: true,\n cacheLocation: 'localstorage'\n })\n\n const domain = auth0.domain\n const clientId = auth0.clientId\n\n return {\n login: (options) => client.loginWithRedirect(options),\n logout: (options) => client.logout({ logoutParams: { returnTo: window.location.origin }, ...options }),\n getUser: async () => {\n const user = await client.getUser()\n if (!user) return undefined\n return { id: user.sub || '', email: user.email || '', name: user.name, picture: user.picture }\n },\n getTokenSilently: (options) => client.getTokenSilently(options),\n isAuthenticated: () => client.isAuthenticated(),\n\n async signIn(email: string, password: string) {\n const response = await fetch(`https://${domain}/oauth/token`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n grant_type: 'password',\n client_id: clientId,\n username: email,\n password,\n audience: auth0.audience,\n scope: auth0.scope || 'openid profile email'\n })\n })\n if (!response.ok) {\n const err = await response.json().catch(() => ({}))\n throw new Error(err.error_description || err.message || 'Sign in failed')\n }\n },\n\n async signUp(email: string, password: string, metadata?: Record<string, unknown>) {\n const response = await fetch(`https://${domain}/dbconnections/signup`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n client_id: clientId,\n email,\n password,\n connection: 'Username-Password-Authentication',\n ...metadata\n })\n })\n if (!response.ok) {\n const err = await response.json().catch(() => ({}))\n throw new Error(err.description || err.message || 'Sign up failed')\n }\n },\n\n async forgotPassword(email: string) {\n const response = await fetch(`https://${domain}/dbconnections/change_password`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n client_id: clientId,\n email,\n connection: 'Username-Password-Authentication'\n })\n })\n if (!response.ok) {\n const err = await response.json().catch(() => ({}))\n throw new Error(err.error_description || err.message || 'Password reset request failed')\n }\n },\n\n async resetPassword() {\n throw new Error('Auth0 password reset is completed via the email link, not a code')\n }\n }\n})\n","/**\n * Auth core — provider registry and AuthService wrapper.\n * Provider implementations live in auth-auth0.ts and auth-cognito.ts.\n */\nimport type { AuthClient, AuthService, User } from './types'\n\nconst MAX_LISTENERS = 100\n\n// --- Provider registry ---\n\nconst providers = new Map<string, (config: Record<string, unknown>) => Promise<AuthClient>>()\n\nexport function registerAuthProvider(name: string, factory: (config: Record<string, unknown>) => Promise<AuthClient>) {\n providers.set(name, factory)\n}\n\n// Built-in \"none\" provider\nregisterAuthProvider('none', async () => ({\n login: async () => {},\n logout: async () => {},\n getUser: async () => undefined,\n getTokenSilently: async () => 'none',\n isAuthenticated: async () => true\n}))\n\nexport interface AuthProviderConfig {\n provider: string\n [key: string]: unknown\n}\n\nexport async function createAuthClient(config: AuthProviderConfig): Promise<AuthClient> {\n const factory = providers.get(config.provider)\n if (!factory) {\n throw new Error(\n `Auth provider \"${config.provider}\" not registered. ` +\n `Import \"foundation-sdk/${config.provider}\" to register it.`\n )\n }\n return factory(config)\n}\n\n// --- AuthService wrapper ---\n\nexport function createAuthService(client: AuthClient): AuthService & { _initUser(): Promise<void> } {\n let user: User | null = null\n const listeners: Array<(user: User | null) => void> = []\n\n function notifyListeners() {\n listeners.forEach(fn => { try { fn(user) } catch { /* */ } })\n }\n\n async function refreshUser() {\n const authUser = await client.getUser()\n user = authUser ? { id: authUser.id, email: authUser.email, name: authUser.name, picture: authUser.picture } : null\n }\n\n return {\n get user() { return user },\n get isAuthenticated() { return !!user },\n\n async getToken() {\n return client.getTokenSilently()\n },\n\n async login(options) {\n await client.login(options)\n await refreshUser()\n notifyListeners()\n },\n\n async logout(options) {\n await client.logout(options)\n user = null\n notifyListeners()\n },\n\n async signIn(email, password) {\n if (!client.signIn) throw new Error('signIn not supported by this auth provider')\n await client.signIn(email, password)\n await refreshUser()\n notifyListeners()\n },\n\n async signUp(email, password, metadata) {\n if (!client.signUp) throw new Error('signUp not supported by this auth provider')\n await client.signUp(email, password, metadata)\n },\n\n async forgotPassword(email) {\n if (!client.forgotPassword) throw new Error('forgotPassword not supported by this auth provider')\n await client.forgotPassword(email)\n },\n\n async resetPassword(code, newPassword) {\n if (!client.resetPassword) throw new Error('resetPassword not supported by this auth provider')\n await client.resetPassword(code, newPassword)\n },\n\n onChange(callback) {\n if (listeners.length >= MAX_LISTENERS) {\n console.warn('[Foundation SDK] Auth listener limit reached.')\n return () => {}\n }\n listeners.push(callback)\n return () => {\n const idx = listeners.indexOf(callback)\n if (idx > -1) listeners.splice(idx, 1)\n }\n },\n\n async _initUser() {\n const authenticated = await client.isAuthenticated()\n if (authenticated) await refreshUser()\n }\n }\n}\n"],"mappings":"AAAA,OAAS,qBAAAA,MAAyB,sBCUlC,IAAMC,EAAY,IAAI,IAEf,SAASC,EAAqBC,EAAcC,EAAmE,CACpHH,EAAU,IAAIE,EAAMC,CAAO,CAC7B,CAGAF,EAAqB,OAAQ,UAAa,CACxC,MAAO,SAAY,CAAC,EACpB,OAAQ,SAAY,CAAC,EACrB,QAAS,SAAS,GAClB,iBAAkB,SAAY,OAC9B,gBAAiB,SAAY,EAC/B,EAAE,EDnBFG,EAAqB,QAAS,MAAOC,GAAgC,CACnE,IAAMC,EAAQD,EAAO,MACrB,GAAI,CAACC,EAAO,MAAM,IAAI,MAAM,uBAAuB,EAEnD,IAAMC,EAAS,MAAMC,EAAkB,CACrC,OAAQF,EAAM,OACd,SAAUA,EAAM,SAChB,oBAAqB,CACnB,SAAUA,EAAM,SAChB,MAAOA,EAAM,OAAS,uBACtB,aAAc,OAAO,SAAS,MAChC,EACA,iBAAkB,GAClB,cAAe,cACjB,CAAC,EAEKG,EAASH,EAAM,OACfI,EAAWJ,EAAM,SAEvB,MAAO,CACL,MAAQK,GAAYJ,EAAO,kBAAkBI,CAAO,EACpD,OAASA,GAAYJ,EAAO,OAAO,CAAE,aAAc,CAAE,SAAU,OAAO,SAAS,MAAO,EAAG,GAAGI,CAAQ,CAAC,EACrG,QAAS,SAAY,CACnB,IAAMC,EAAO,MAAML,EAAO,QAAQ,EAClC,GAAKK,EACL,MAAO,CAAE,GAAIA,EAAK,KAAO,GAAI,MAAOA,EAAK,OAAS,GAAI,KAAMA,EAAK,KAAM,QAASA,EAAK,OAAQ,CAC/F,EACA,iBAAmBD,GAAYJ,EAAO,iBAAiBI,CAAO,EAC9D,gBAAiB,IAAMJ,EAAO,gBAAgB,EAE9C,MAAM,OAAOM,EAAeC,EAAkB,CAC5C,IAAMC,EAAW,MAAM,MAAM,WAAWN,C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F,CAAC","names":["createAuth0Client","providers","registerAuthProvider","name","factory","registerAuthProvider","config","auth0","client","createAuth0Client","domain","clientId","options","user","email","password","response","err","metadata"]}
@@ -0,0 +1,2 @@
1
+ "use strict";var s=require("aws-amplify"),t=require("aws-amplify/auth");var u=new Map;function o(i,e){u.set(i,e)}o("none",async()=>({login:async()=>{},logout:async()=>{},getUser:async()=>{},getTokenSilently:async()=>"none",isAuthenticated:async()=>!0}));o("cognito",async i=>{let e=i.cognito;if(!e)throw new Error("Cognito config required");return s.Amplify.configure({Auth:{Cognito:{userPoolId:e.userPoolId,userPoolClientId:e.clientId,loginWith:{oauth:{domain:e.domain.replace("https://",""),scopes:(e.scope||"openid profile email").split(" "),redirectSignIn:[window.location.origin],redirectSignOut:[window.location.origin],responseType:"code"}}}}}),{login:async()=>{await(0,t.signInWithRedirect)()},logout:async()=>{await(0,t.signOut)()},getUser:async()=>{try{let r=await(0,t.getCurrentUser)();return{id:r.userId,email:r.signInDetails?.loginId||"",name:r.username}}catch{return}},getTokenSilently:async()=>{let n=(await(0,t.fetchAuthSession)()).tokens?.accessToken?.toString();if(!n)throw new Error("No token available");return n},isAuthenticated:async()=>{try{return await(0,t.getCurrentUser)(),!0}catch{return!1}},async signIn(r,n){await(0,t.signIn)({username:r,password:n})},async signUp(r,n,a){await(0,t.signUp)({username:r,password:n,options:{userAttributes:{email:r,...a}}})},async forgotPassword(r){await(0,t.resetPassword)({username:r})},async resetPassword(r,n){await(0,t.confirmResetPassword)({username:"",confirmationCode:r,newPassword:n})}}});
2
+ //# sourceMappingURL=auth-cognito.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/auth-cognito.ts","../src/auth.ts"],"sourcesContent":["import { Amplify } from 'aws-amplify'\nimport {\n fetchAuthSession,\n signInWithRedirect,\n signOut,\n getCurrentUser,\n signIn as cognitoSignIn,\n signUp as cognitoSignUp,\n resetPassword as cognitoResetPassword,\n confirmResetPassword\n} from 'aws-amplify/auth'\nimport { registerAuthProvider } from './auth'\nimport type { AuthClient } from './types'\n\nregisterAuthProvider('cognito', async (config): Promise<AuthClient> => {\n const cognito = config.cognito as { userPoolId: string; clientId: string; region: string; domain: string; scope?: string }\n if (!cognito) throw new Error('Cognito config required')\n\n Amplify.configure({\n Auth: {\n Cognito: {\n userPoolId: cognito.userPoolId,\n userPoolClientId: cognito.clientId,\n loginWith: {\n oauth: {\n domain: cognito.domain.replace('https://', ''),\n scopes: (cognito.scope || 'openid profile email').split(' '),\n redirectSignIn: [window.location.origin],\n redirectSignOut: [window.location.origin],\n responseType: 'code'\n }\n }\n }\n }\n })\n\n return {\n login: async () => { await signInWithRedirect() },\n logout: async () => { await signOut() },\n getUser: async () => {\n try {\n const user = await getCurrentUser()\n return { id: user.userId, email: user.signInDetails?.loginId || '', name: user.username }\n } catch { return undefined }\n },\n getTokenSilently: async () => {\n const session = await fetchAuthSession()\n const token = session.tokens?.accessToken?.toString()\n if (!token) throw new Error('No token available')\n return token\n },\n isAuthenticated: async () => {\n try {\n await getCurrentUser()\n return true\n } catch { return false }\n },\n\n async signIn(email: string, password: string) {\n await cognitoSignIn({ username: email, password })\n },\n\n async signUp(email: string, password: string, metadata?: Record<string, unknown>) {\n await cognitoSignUp({\n username: email,\n password,\n options: { userAttributes: { email, ...metadata } }\n })\n },\n\n async forgotPassword(email: string) {\n await cognitoResetPassword({ username: email })\n },\n\n async resetPassword(code: string, newPassword: string) {\n await confirmResetPassword({ username: '', confirmationCode: code, newPassword })\n }\n }\n})\n","/**\n * Auth core — provider registry and AuthService wrapper.\n * Provider implementations live in auth-auth0.ts and auth-cognito.ts.\n */\nimport type { AuthClient, AuthService, User } from './types'\n\nconst MAX_LISTENERS = 100\n\n// --- Provider registry ---\n\nconst providers = new Map<string, (config: Record<string, unknown>) => Promise<AuthClient>>()\n\nexport function registerAuthProvider(name: string, factory: (config: Record<string, unknown>) => Promise<AuthClient>) {\n providers.set(name, factory)\n}\n\n// Built-in \"none\" provider\nregisterAuthProvider('none', async () => ({\n login: async () => {},\n logout: async () => {},\n getUser: async () => undefined,\n getTokenSilently: async () => 'none',\n isAuthenticated: async () => true\n}))\n\nexport interface AuthProviderConfig {\n provider: string\n [key: string]: unknown\n}\n\nexport async function createAuthClient(config: AuthProviderConfig): Promise<AuthClient> {\n const factory = providers.get(config.provider)\n if (!factory) {\n throw new Error(\n `Auth provider \"${config.provider}\" not registered. ` +\n `Import \"foundation-sdk/${config.provider}\" to register it.`\n )\n }\n return factory(config)\n}\n\n// --- AuthService wrapper ---\n\nexport function createAuthService(client: AuthClient): AuthService & { _initUser(): Promise<void> } {\n let user: User | null = null\n const listeners: Array<(user: User | null) => void> = []\n\n function notifyListeners() {\n listeners.forEach(fn => { try { fn(user) } catch { /* */ } })\n }\n\n async function refreshUser() {\n const authUser = await client.getUser()\n user = authUser ? { id: authUser.id, email: authUser.email, name: authUser.name, picture: authUser.picture } : null\n }\n\n return {\n get user() { return user },\n get isAuthenticated() { return !!user },\n\n async getToken() {\n return client.getTokenSilently()\n },\n\n async login(options) {\n await client.login(options)\n await refreshUser()\n notifyListeners()\n },\n\n async logout(options) {\n await client.logout(options)\n user = null\n notifyListeners()\n },\n\n async signIn(email, password) {\n if (!client.signIn) throw new Error('signIn not supported by this auth provider')\n await client.signIn(email, password)\n await refreshUser()\n notifyListeners()\n },\n\n async signUp(email, password, metadata) {\n if (!client.signUp) throw new Error('signUp not supported by this auth provider')\n await client.signUp(email, password, metadata)\n },\n\n async forgotPassword(email) {\n if (!client.forgotPassword) throw new Error('forgotPassword not supported by this auth provider')\n await client.forgotPassword(email)\n },\n\n async resetPassword(code, newPassword) {\n if (!client.resetPassword) throw new Error('resetPassword not supported by this auth provider')\n await client.resetPassword(code, newPassword)\n },\n\n onChange(callback) {\n if (listeners.length >= MAX_LISTENERS) {\n console.warn('[Foundation SDK] Auth listener limit reached.')\n return () => {}\n }\n listeners.push(callback)\n return () => {\n const idx = listeners.indexOf(callback)\n if (idx > -1) listeners.splice(idx, 1)\n }\n },\n\n async _initUser() {\n const authenticated = await client.isAuthenticated()\n if (authenticated) await refreshUser()\n }\n }\n}\n"],"mappings":"aAAA,IAAAA,EAAwB,uBACxBC,EASO,4BCAP,IAAMC,EAAY,IAAI,IAEf,SAASC,EAAqBC,EAAcC,EAAmE,CACpHH,EAAU,IAAIE,EAAMC,CAAO,CAC7B,CAGAF,EAAqB,OAAQ,UAAa,CACxC,MAAO,SAAY,CAAC,EACpB,OAAQ,SAAY,CAAC,EACrB,QAAS,SAAS,GAClB,iBAAkB,SAAY,OAC9B,gBAAiB,SAAY,EAC/B,EAAE,EDTFG,EAAqB,UAAW,MAAOC,GAAgC,CACrE,IAAMC,EAAUD,EAAO,QACvB,GAAI,CAACC,EAAS,MAAM,IAAI,MAAM,yBAAyB,EAEvD,iBAAQ,UAAU,CAChB,KAAM,CACJ,QAAS,CACP,WAAYA,EAAQ,WACpB,iBAAkBA,EAAQ,SAC1B,UAAW,CACT,MAAO,CACL,OAAQA,EAAQ,OAAO,QAAQ,WAAY,EAAE,EAC7C,QAASA,EAAQ,OAAS,wBAAwB,MAAM,GAAG,EAC3D,eAAgB,CAAC,OAAO,SAAS,MAAM,EACvC,gBAAiB,CAAC,OAAO,SAAS,MAAM,EACxC,aAAc,MAChB,CACF,CACF,CACF,CACF,CAAC,EAEM,CACL,MAAO,SAAY,CAAE,QAAM,sBAAmB,CAAE,EAChD,OAAQ,SAAY,CAAE,QAAM,WAAQ,CAAE,EACtC,QAAS,SAAY,CACnB,GAAI,CACF,IAAMC,EAAO,QAAM,kBAAe,EAClC,MAAO,CAAE,GAAIA,EAAK,OAAQ,MAAOA,EAAK,eAAe,SAAW,GAAI,KAAMA,EAAK,QAAS,CAC1F,MAAQ,CAAE,MAAiB,CAC7B,EACA,iBAAkB,SAAY,CAE5B,IAAMC,GADU,QAAM,oBAAiB,GACjB,QAAQ,aAAa,SAAS,EACpD,GAAI,CAACA,EAAO,MAAM,IAAI,MAAM,oBAAoB,EAChD,OAAOA,CACT,EACA,gBAAiB,SAAY,CAC3B,GAAI,CACF,eAAM,kBAAe,EACd,EACT,MAAQ,CAAE,MAAO,EAAM,CACzB,EAEA,MAAM,OAAOC,EAAeC,EAAkB,CAC5C,QAAM,EAAAC,QAAc,CAAE,SAAUF,EAAO,SAAAC,CAAS,CAAC,CACnD,EAEA,MAAM,OAAOD,EAAeC,EAAkBE,EAAoC,CAChF,QAAM,EAAAC,QAAc,CAClB,SAAUJ,EACV,SAAAC,EACA,QAAS,CAAE,eAAgB,CAAE,MAAAD,EAAO,GAAGG,CAAS,CAAE,CACpD,CAAC,CACH,EAEA,MAAM,eAAeH,EAAe,CAClC,QAAM,EAAAK,eAAqB,CAAE,SAAUL,CAAM,CAAC,CAChD,EAEA,MAAM,cAAcM,EAAcC,EAAqB,CACrD,QAAM,wBAAqB,CAAE,SAAU,GAAI,iBAAkBD,EAAM,YAAAC,CAAY,CAAC,CAClF,CACF,CACF,CAAC","names":["import_aws_amplify","import_auth","providers","registerAuthProvider","name","factory","registerAuthProvider","config","cognito","user","token","email","password","cognitoSignIn","metadata","cognitoSignUp","cognitoResetPassword","code","newPassword"]}
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+ import{Amplify as u}from"aws-amplify";import{fetchAuthSession as g,signInWithRedirect as c,signOut as d,getCurrentUser as o,signIn as w,signUp as p,resetPassword as h,confirmResetPassword as l}from"aws-amplify/auth";var a=new Map;function i(e,n){a.set(e,n)}i("none",async()=>({login:async()=>{},logout:async()=>{},getUser:async()=>{},getTokenSilently:async()=>"none",isAuthenticated:async()=>!0}));i("cognito",async e=>{let n=e.cognito;if(!n)throw new Error("Cognito config required");return u.configure({Auth:{Cognito:{userPoolId:n.userPoolId,userPoolClientId:n.clientId,loginWith:{oauth:{domain:n.domain.replace("https://",""),scopes:(n.scope||"openid profile email").split(" "),redirectSignIn:[window.location.origin],redirectSignOut:[window.location.origin],responseType:"code"}}}}}),{login:async()=>{await c()},logout:async()=>{await d()},getUser:async()=>{try{let t=await o();return{id:t.userId,email:t.signInDetails?.loginId||"",name:t.username}}catch{return}},getTokenSilently:async()=>{let r=(await g()).tokens?.accessToken?.toString();if(!r)throw new Error("No token available");return r},isAuthenticated:async()=>{try{return await o(),!0}catch{return!1}},async signIn(t,r){await w({username:t,password:r})},async signUp(t,r,s){await p({username:t,password:r,options:{userAttributes:{email:t,...s}}})},async forgotPassword(t){await h({username:t})},async resetPassword(t,r){await l({username:"",confirmationCode:t,newPassword:r})}}});
2
+ //# sourceMappingURL=auth-cognito.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/auth-cognito.ts","../src/auth.ts"],"sourcesContent":["import { Amplify } from 'aws-amplify'\nimport {\n fetchAuthSession,\n signInWithRedirect,\n signOut,\n getCurrentUser,\n signIn as cognitoSignIn,\n signUp as cognitoSignUp,\n resetPassword as cognitoResetPassword,\n confirmResetPassword\n} from 'aws-amplify/auth'\nimport { registerAuthProvider } from './auth'\nimport type { AuthClient } from './types'\n\nregisterAuthProvider('cognito', async (config): Promise<AuthClient> => {\n const cognito = config.cognito as { userPoolId: string; clientId: string; region: string; domain: string; scope?: string }\n if (!cognito) throw new Error('Cognito config required')\n\n Amplify.configure({\n Auth: {\n Cognito: {\n userPoolId: cognito.userPoolId,\n userPoolClientId: cognito.clientId,\n loginWith: {\n oauth: {\n domain: cognito.domain.replace('https://', ''),\n scopes: (cognito.scope || 'openid profile email').split(' '),\n redirectSignIn: [window.location.origin],\n redirectSignOut: [window.location.origin],\n responseType: 'code'\n }\n }\n }\n }\n })\n\n return {\n login: async () => { await signInWithRedirect() },\n logout: async () => { await signOut() },\n getUser: async () => {\n try {\n const user = await getCurrentUser()\n return { id: user.userId, email: user.signInDetails?.loginId || '', name: user.username }\n } catch { return undefined }\n },\n getTokenSilently: async () => {\n const session = await fetchAuthSession()\n const token = session.tokens?.accessToken?.toString()\n if (!token) throw new Error('No token available')\n return token\n },\n isAuthenticated: async () => {\n try {\n await getCurrentUser()\n return true\n } catch { return false }\n },\n\n async signIn(email: string, password: string) {\n await cognitoSignIn({ username: email, password })\n },\n\n async signUp(email: string, password: string, metadata?: Record<string, unknown>) {\n await cognitoSignUp({\n username: email,\n password,\n options: { userAttributes: { email, ...metadata } }\n })\n },\n\n async forgotPassword(email: string) {\n await cognitoResetPassword({ username: email })\n },\n\n async resetPassword(code: string, newPassword: string) {\n await confirmResetPassword({ username: '', confirmationCode: code, newPassword })\n }\n }\n})\n","/**\n * Auth core — provider registry and AuthService wrapper.\n * Provider implementations live in auth-auth0.ts and auth-cognito.ts.\n */\nimport type { AuthClient, AuthService, User } from './types'\n\nconst MAX_LISTENERS = 100\n\n// --- Provider registry ---\n\nconst providers = new Map<string, (config: Record<string, unknown>) => Promise<AuthClient>>()\n\nexport function registerAuthProvider(name: string, factory: (config: Record<string, unknown>) => Promise<AuthClient>) {\n providers.set(name, factory)\n}\n\n// Built-in \"none\" provider\nregisterAuthProvider('none', async () => ({\n login: async () => {},\n logout: async () => {},\n getUser: async () => undefined,\n getTokenSilently: async () => 'none',\n isAuthenticated: async () => true\n}))\n\nexport interface AuthProviderConfig {\n provider: string\n [key: string]: unknown\n}\n\nexport async function createAuthClient(config: AuthProviderConfig): Promise<AuthClient> {\n const factory = providers.get(config.provider)\n if (!factory) {\n throw new Error(\n `Auth provider \"${config.provider}\" not registered. ` +\n `Import \"foundation-sdk/${config.provider}\" to register it.`\n )\n }\n return factory(config)\n}\n\n// --- AuthService wrapper ---\n\nexport function createAuthService(client: AuthClient): AuthService & { _initUser(): Promise<void> } {\n let user: User | null = null\n const listeners: Array<(user: User | null) => void> = []\n\n function notifyListeners() {\n listeners.forEach(fn => { try { fn(user) } catch { /* */ } })\n }\n\n async function refreshUser() {\n const authUser = await client.getUser()\n user = authUser ? { id: authUser.id, email: authUser.email, name: authUser.name, picture: authUser.picture } : null\n }\n\n return {\n get user() { return user },\n get isAuthenticated() { return !!user },\n\n async getToken() {\n return client.getTokenSilently()\n },\n\n async login(options) {\n await client.login(options)\n await refreshUser()\n notifyListeners()\n },\n\n async logout(options) {\n await client.logout(options)\n user = null\n notifyListeners()\n },\n\n async signIn(email, password) {\n if (!client.signIn) throw new Error('signIn not supported by this auth provider')\n await client.signIn(email, password)\n await refreshUser()\n notifyListeners()\n },\n\n async signUp(email, password, metadata) {\n if (!client.signUp) throw new Error('signUp not supported by this auth provider')\n await client.signUp(email, password, metadata)\n },\n\n async forgotPassword(email) {\n if (!client.forgotPassword) throw new Error('forgotPassword not supported by this auth provider')\n await client.forgotPassword(email)\n },\n\n async resetPassword(code, newPassword) {\n if (!client.resetPassword) throw new Error('resetPassword not supported by this auth provider')\n await client.resetPassword(code, newPassword)\n },\n\n onChange(callback) {\n if (listeners.length >= MAX_LISTENERS) {\n console.warn('[Foundation SDK] Auth listener limit reached.')\n return () => {}\n }\n listeners.push(callback)\n return () => {\n const idx = listeners.indexOf(callback)\n if (idx > -1) listeners.splice(idx, 1)\n }\n },\n\n async _initUser() {\n const authenticated = await client.isAuthenticated()\n if (authenticated) await refreshUser()\n }\n }\n}\n"],"mappings":"AAAA,OAAS,WAAAA,MAAe,cACxB,OACE,oBAAAC,EACA,sBAAAC,EACA,WAAAC,EACA,kBAAAC,EACA,UAAUC,EACV,UAAUC,EACV,iBAAiBC,EACjB,wBAAAC,MACK,mBCAP,IAAMC,EAAY,IAAI,IAEf,SAASC,EAAqBC,EAAcC,EAAmE,CACpHH,EAAU,IAAIE,EAAMC,CAAO,CAC7B,CAGAF,EAAqB,OAAQ,UAAa,CACxC,MAAO,SAAY,CAAC,EACpB,OAAQ,SAAY,CAAC,EACrB,QAAS,SAAS,GAClB,iBAAkB,SAAY,OAC9B,gBAAiB,SAAY,EAC/B,EAAE,EDTFG,EAAqB,UAAW,MAAOC,GAAgC,CACrE,IAAMC,EAAUD,EAAO,QACvB,GAAI,CAACC,EAAS,MAAM,IAAI,MAAM,yBAAyB,EAEvD,OAAAC,EAAQ,UAAU,CAChB,KAAM,CAC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,YAAAC,CAAY,CAAC,CAClF,CACF,CACF,CAAC","names":["Amplify","fetchAuthSession","signInWithRedirect","signOut","getCurrentUser","cognitoSignIn","cognitoSignUp","cognitoResetPassword","confirmResetPassword","providers","registerAuthProvider","name","factory","registerAuthProvider","config","cognito","Amplify","signInWithRedirect","signOut","user","getCurrentUser","token","fetchAuthSession","email","password","cognitoSignIn","metadata","cognitoSignUp","cognitoResetPassword","code","newPassword","confirmResetPassword"]}