@aerogel/plugin-solid 0.0.1-next.2fb667e321e0740b4db1a21bc948232a9bf219d6

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 e=require("@inrupt/solid-client-authn-browser");Object.defineProperty(exports,"fetch",{enumerable:!0,get:function(){return e.fetch}}),Object.defineProperty(exports,"handleIncomingRedirect",{enumerable:!0,get:function(){return e.handleIncomingRedirect}}),Object.defineProperty(exports,"login",{enumerable:!0,get:function(){return e.login}}),Object.defineProperty(exports,"logout",{enumerable:!0,get:function(){return e.logout}});
2
+ //# sourceMappingURL=InruptAuthenticator.lazy.hash.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InruptAuthenticator.lazy.hash.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export{fetch,handleIncomingRedirect,login,logout}from"@inrupt/solid-client-authn-browser";
2
+ //# sourceMappingURL=InruptAuthenticator.lazy.hash.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InruptAuthenticator.lazy.hash.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@aerogel/core"),t=require("soukai-solid");require("core-js/modules/esnext.async-iterator.find.js"),require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.find.js");var i=require("@noeldemartin/utils"),r=require("@noeldemartin/solid-utils"),s=require("soukai");require("core-js/modules/esnext.async-iterator.for-each.js"),require("core-js/modules/esnext.iterator.for-each.js");var o=require("@babel/runtime/helpers/defineProperty");require("core-js/modules/esnext.async-iterator.map.js"),require("core-js/modules/esnext.iterator.map.js"),require("core-js/modules/esnext.async-iterator.constructor.js"),require("core-js/modules/esnext.async-iterator.to-array.js"),require("core-js/modules/esnext.iterator.to-array.js");var n=require("virtual:aerogel-solid"),a=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(o),c=l(n);class AuthenticationCancelledError extends i.JSError{}class d extends i.JSError{constructor(e,t){super(`Container at ${e.url} is already in use`,t)}}class h{constructor(){u.default(this,"name",void 0),u.default(this,"authenticatedFetch",void 0),u.default(this,"booted",void 0),u.default(this,"listeners",i.arr([])),u.default(this,"_engine",void 0)}get engine(){return this._engine=this._engine??new t.SolidEngine(this.requireAuthenticatedFetch()),this._engine}getAuthenticatedFetch(){return this.authenticatedFetch??null}requireAuthenticatedFetch(){return this.authenticatedFetch??i.fail("Authenticated fetch is not ready")}addListener(e){return this.listeners.includes(e)||this.listeners.push(e),()=>{this.removeListener(e)}}removeListener(e){this.listeners.includes(e)&&this.listeners.remove(e)}async boot(){if(this.booted)return this.booted;this.booted=new i.PromisedValue,await this.restoreSession(),this.booted.resolve()}async initAuthenticatedFetch(e){this.authenticatedFetch=e,await this.notifyListeners("onAuthenticatedFetchReady",e)}async startSession(e){const t={authenticator:this,...e};return await this.notifyListeners("onSessionStarted",t),t}async failSession(e,t){await this.notifyListeners("onSessionFailed",e,t)}async endSession(){await this.notifyListeners("onSessionEnded")}async notifyListeners(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];await Promise.all(this.listeners.toArray().map((async t=>{const r=t[e];await(r?.(...i))})))}}const g="inrupt-authenticator";const f={},p={inrupt:new class extends h{constructor(){super(...arguments),u.default(this,"_fetch",void 0),u.default(this,"_login",void 0),u.default(this,"_logout",void 0),u.default(this,"_handleIncomingRedirect",void 0)}async login(e){i.Storage.set(g,!0);const t={oidcIssuer:e};return c.default.clientID&&(t.clientId=c.default.clientID.client_id,t.clientName=c.default.clientID.client_name,t.redirectUrl=c.default.clientID.redirect_uris[0]),await this._login(t),await i.after({seconds:60}),i.fail("Browser should have redirected, but it didn't")}async logout(){await this._logout(),await this.endSession()}async restoreSession(){const{fetch:e,handleIncomingRedirect:t,login:i,logout:r}=await Promise.resolve().then((function(){return require("./InruptAuthenticator.lazy.hash.cjs.js")}));this._fetch=e,this._login=i,this._logout=r,this._handleIncomingRedirect=t,await this.loginFromRedirect()}async loginFromRedirect(){if(!i.Storage.has(g))return;const e=await this._handleIncomingRedirect(window.location.href);i.Storage.remove(g),e?.isLoggedIn&&e.webId&&await this.initSession(e.webId)}async initSession(e){await this.initAuthenticatedFetch(this._fetch);try{const{default:t}=await Promise.resolve().then((function(){return b})),i=await t.requireUserProfile(e);await this.startSession({user:i,loginUrl:e})}catch(t){await this.failSession(e,t)}}}};function S(e){f.default=e}function y(e){return f[e]}function m(e){Object.entries(e).forEach((e=>{let[t,i]=e;return v(t,i)}))}function v(e,t){f[e]=t,t.name=t.name??e}var w=e.defineServiceState({name:"solid",persist:["autoReconnect","dismissed","previousSession","profiles","staleProfiles"],initialState:{autoReconnect:!1,dismissed:!1,ignorePreviousSessionError:!1,loginStartupError:null,loginOngoing:!1,preferredAuthenticator:null,previousSession:null,profiles:{},session:null,loginStale:!1,staleProfiles:[]},serialize:e=>(e.previousSession?.error instanceof Error&&(e.previousSession.error=e.previousSession.error.message),e),computed:{user:e=>e.session?.user??e.previousSession?.profile??null,authenticator:e=>e.session?.authenticator??null,fetch(){return this.authenticator?.getAuthenticatedFetch()??globalThis.fetch.bind(globalThis)},error:e=>e.loginStartupError?e.loginStartupError??null:e.ignorePreviousSessionError?null:e.previousSession?.error??null}});class x extends w{isLoggedIn(){return!!this.session}wasLoggedIn(){return!!this.previousSession}hasLoggedIn(){return!(!this.session&&!this.previousSession)}requireAuthenticator(){return this.authenticator??i.fail("Could not get authenticator")}requireUser(){return this.user??i.fail("Could not get user profile (are you logged in?)")}requireUserProfile(e){return this.getUserProfile(e,!0)}async getUserProfile(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.profiles[e]??i.tap(await r.fetchLoginUserProfile(e,{fetch:this.fetch,required:t}),(e=>e&&this.rememberProfile(e)))}async refreshUserProfile(){if(!this.isLoggedIn())return;this.setState({profiles:i.objectWithout(this.profiles,[this.user.webId])});const e=await this.requireUserProfile(this.user.webId);this.setState({session:{...this.session,user:e}})}async login(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=r.authenticator??this.preferredAuthenticator??"default",o=r.onError??(t=>e.App.isMounted()?e.Errors.report(t):this.setState({loginStartupError:t}));if(e.App.development&&"devserver"===t&&(t="http://localhost:3000"),/^https?:\/\//.test(t)||(r.fallbackUrl??=`http://${t}`,t=`https://${t}`),this.isLoggedIn())return!0;if(this.loginOngoing)throw new Error("Authentication already in progress");const n=setTimeout((()=>this.loginStale=!0),1e4),a={dismissed:this.dismissed,ignorePreviousSessionError:this.ignorePreviousSessionError,previousSession:this.previousSession};this.loginOngoing=!0;try{const r=await this.getUserProfile(t),o=r?.oidcIssuerUrl??i.urlRoot(r?.webId??t),n=await this.bootAuthenticator(s),{domain:a}=i.requireUrlParse(t);return this.setState({dismissed:!1,ignorePreviousSessionError:!0,previousSession:i.objectWithoutEmpty({profile:r,loginUrl:t,authenticator:s,error:e.translateWithDefault("auth.stuckConnecting",`We didn't hear back from the identity provider at \`${a}\`, maybe try reconnecting?`)})}),await e.Events.emit("auth:before-login"),await n.login(o),!0}catch(e){return this.setState(a),e instanceof AuthenticationCancelledError?!1:r.fallbackUrl?i.after().then((()=>this.login(r.fallbackUrl??"",i.objectWithout(r,"fallbackUrl")))):(o(e),!1)}finally{clearTimeout(n),this.setState({loginOngoing:!1,loginStale:!1})}}async reconnect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{force:t,...i}=e;this.isLoggedIn()||!this.previousSession||null!==this.previousSession.error&&!t||await this.login(this.previousSession.loginUrl,{authenticator:this.previousSession.authenticator,...i})}async logout(){(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||await e.UI.confirm(e.translateWithDefault("solid.logoutConfirm","Are you sure you want to log out?")))&&this.previousSession&&(this.setState({previousSession:null}),this.isLoggedIn()&&await this.authenticator.logout(),await e.Events.emit("auth:logout"))}async whenLoggedIn(t){return this.isLoggedIn()?t(this.session):new Promise((i=>{e.Events.once("auth:login",(e=>i(t(e))))}))}dismiss(){this.setState({dismissed:!0})}async findOrCreatePrivateTypeIndex(){return await this.findPrivateTypeIndex()??await this.createPrivateTypeIndex()}async findPrivateTypeIndex(){const e=this.requireUser(),r=this.requireAuthenticator().engine;return i.asyncMemo(`${e.webId}-privateTypeIndex`,(()=>t.SolidTypeIndex.withEngine(r).find(e.privateTypeIndexUrl)))}async findOrCreatePublicTypeIndex(){return await this.findPublicTypeIndex()??await this.createPublicTypeIndex()}async findPublicTypeIndex(){const e=this.requireUser(),r=this.requireAuthenticator().engine;return i.asyncMemo(`${e.webId}-publicTypeIndex`,(()=>t.SolidTypeIndex.withEngine(r).find(e.publicTypeIndexUrl)))}async createPrivateContainer(e){const i=this.requireAuthenticator().engine;return t.SolidContainer.withEngine(i,(async()=>{const i=await t.SolidContainer.find(e.url);if(i&&!e.reuseExisting)throw new d(i);const r=i??new t.SolidContainer({url:e.url,name:e.name});if(await r.save(),e.registerFor){const t=await this.findOrCreatePrivateTypeIndex();await r.register(t,e.registerFor)}return r}))}async boot(){await e.Errors.booted,i.hasLocationQueryParameter("authenticator")&&this.setState({preferredAuthenticator:i.getLocationQueryParameter("authenticator")}),i.hasLocationQueryParameter("refreshProfile")&&this.setState({staleProfiles:i.arrayUnique(this.staleProfiles.concat(i.arrayFilter([this.session?.user.webId,this.previousSession?.loginUrl])))}),await this.restorePreviousSession(),await this.startupReconnect()}async createPrivateTypeIndex(){const e=this.requireUser(),r=this.requireAuthenticator(),s=await t.SolidTypeIndex.withEngine(r.engine).createPrivate(e);return i.tap(s,(()=>{e.privateTypeIndexUrl=s.url,i.setAsyncMemo(`${e.webId}-privateTypeIndex`,s),this.rememberProfile(e)}))}async createPublicTypeIndex(){const e=this.requireUser(),r=this.requireAuthenticator(),s=await t.SolidTypeIndex.withEngine(r.engine).createPublic(e);return i.tap(s,(()=>{e.privateTypeIndexUrl=s.url,i.setAsyncMemo(`${e.webId}-publicTypeIndex`,s),this.rememberProfile(e)}))}async restorePreviousSession(){this.previousSession&&await this.bootAuthenticator(this.previousSession.authenticator)}async startupReconnect(){this.reconnectOnStartup()&&await this.reconnect()}reconnectOnStartup(){return i.hasLocationQueryParameter("autoReconnect")?i.parseBoolean(i.getLocationQueryParameter("autoReconnect")):this.autoReconnect}async bootAuthenticator(i){const r=y(i);return r.addListener({onSessionStarted:async i=>{this.setState({session:i,previousSession:{authenticator:r.name,loginUrl:i.loginUrl,profile:i.user,error:null}}),(i.user.cloaked||!i.user.writableProfileUrl||this.staleProfiles.includes(i.user.webId))&&await this.refreshUserProfile(),e.App.plugin("@aerogel/offline-first")||s.setEngine(i.authenticator.engine),t.SolidACLAuthorization.setEngine(i.authenticator.engine),t.SolidTypeIndex.setEngine(i.authenticator.engine),t.SolidDocument.setEngine(i.authenticator.engine),await e.Events.emit("auth:login",i)},onSessionFailed:async(e,t)=>{this.setState({session:null,previousSession:{authenticator:r.name,loginUrl:e,error:t}})},onSessionEnded:()=>this.setState({session:null}),onAuthenticatedFetchReady:t=>e.Events.emit("auth:fetch-ready",t)}),await r.boot(),r}rememberProfile(e){this.setState({profiles:{...this.profiles,[e.webId]:e},staleProfiles:i.arrayWithout(this.staleProfiles,e.webId)})}}var I=i.facade(x),b=Object.freeze({__proto__:null,SolidService:x,default:I});const A={class:"flex flex-col gap-3"},P={class:"flex flex-col"};var E=a.defineComponent({__name:"AGSolidStatus",setup(t){const i=e.useForm({url:e.requiredStringInput()});return(t,r)=>(a.openBlock(),a.createElementBlock("div",null,[t.$solid.loginStale?a.renderSlot(t.$slots,"login-stale",{key:0},(()=>[a.createVNode(a.unref(e.AGMarkdown),{text:t.$td("solid.loginStale","This is taking too long...")},null,8,["text"])])):a.createCommentVNode("v-if",!0),t.$solid.loginOngoing?a.renderSlot(t.$slots,"login-ongoing",{key:1},(()=>[a.createVNode(a.unref(e.AGMarkdown),{text:t.$td("ui.loading","Loading...")},null,8,["text"])])):t.$solid.isLoggedIn()?a.renderSlot(t.$slots,"logged-in",{key:2,session:t.$solid.session},(()=>[a.createElementVNode("div",A,[a.createVNode(a.unref(e.AGMarkdown),{text:t.$td("solid.loggedIn",{userName:t.$solid.user.name??t.$solid.user.webId,userWebId:t.$solid.user.webId},"You are logged in as [{userName}]({userWebId})")},null,8,["text"]),a.createVNode(a.unref(e.AGButton),{onClick:r[0]||(r[0]=e=>t.$solid.logout())},{default:a.withCtx((()=>[a.createTextVNode(a.toDisplayString(t.$td("solid.logout","Logout")),1)])),_:1})])])):a.renderSlot(t.$slots,"logged-out",{key:3},(()=>[a.createElementVNode("div",P,[a.createVNode(a.unref(e.AGForm),{form:a.unref(i),class:"flex",onSubmit:r[1]||(r[1]=e=>t.$solid.login(a.unref(i).url))},{default:a.withCtx((()=>[a.createVNode(a.unref(e.AGInput),{name:"url","aria-label":t.$td("solid.url","Login url"),placeholder:t.$td("solid.placeholder","https://...")},null,8,["aria-label","placeholder"]),a.createVNode(a.unref(e.AGButton),{submit:""},{default:a.withCtx((()=>[a.createTextVNode(a.toDisplayString(t.$td("solid.login","Login")),1)])),_:1})])),_:1},8,["form"]),t.$solid.wasLoggedIn()?(a.openBlock(),a.createBlock(a.unref(e.AGButton),{key:0,class:"mt-3",onClick:r[2]||(r[2]=e=>t.$solid.reconnect({force:!0}))},{default:a.withCtx((()=>[a.createTextVNode(a.toDisplayString(t.$td("solid.reconnect","Reconnect")),1)])),_:1})):a.createCommentVNode("v-if",!0),t.$solid.previousSession?.error?(a.openBlock(),a.createBlock(a.unref(e.AGMarkdown),{key:1,class:"mt-1 self-center text-sm text-red-800",text:t.$td("solid.previousLoginError","Previous login attempt failed")},null,8,["text"])):a.createCommentVNode("v-if",!0)])]))]))}});E.__file="src/components/AGSolidStatus.vue";class q extends x{constructor(){super(),u.default(this,"server",new i.FakeServer);const e=new t.SolidEngine(this.server.fetch);this.setState("session",{user:i.mock({privateTypeIndexUrl:r.fakeDocumentUrl(),storageUrls:[r.fakeContainerUrl()]}),authenticator:i.mock({engine:e,requireAuthenticatedFetch:()=>this.server.fetch})}),t.SolidACLAuthorization.setEngine(e),t.SolidTypeIndex.setEngine(e),t.SolidDocument.setEngine(e),this.booted.resolve()}}var U=i.facade(q);const k={$solid:I};exports.AGSolidStatus=E,exports.AuthenticationCancelledError=AuthenticationCancelledError,exports.ContainerAlreadyInUse=d,exports.Solid=I,exports.SolidMock=U,exports.SolidMockService=q,exports.SolidService=x,exports.authenticators=p,exports.default=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{async install(r){t.bootSolidModels(),m({...p,...i.authenticators??{}}),S(y(i.defaultAuthenticator??"inrupt")),I.hasPersistedState()||(I.autoReconnect=i.autoReconnect??I.autoReconnect),await e.bootServices(r,k)}}},exports.getAuthenticator=y,exports.registerAuthenticator=v,exports.registerAuthenticators=m,exports.setDefaultAuthenticator=S;
2
+ //# sourceMappingURL=aerogel-plugin-solid.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aerogel-plugin-solid.cjs.js","sources":["../src/errors/AuthenticationCancelledError.ts","../src/errors/ContainerAlreadyInUse.ts","../src/auth/Authenticator.ts","../src/auth/authenticators/InruptAuthenticator.ts","../src/auth/index.ts","../src/services/Solid.state.ts","../src/services/Solid.ts","../src/components/AGSolidStatus.vue","../src/services/Solid.mock.ts","../src/main.ts"],"sourcesContent":["import { JSError } from '@noeldemartin/utils';\n\nexport default class AuthenticationCancelledError extends JSError {}\n","import { JSError } from '@noeldemartin/utils';\nimport type { JSErrorOptions } from '@noeldemartin/utils';\nimport type { SolidContainer } from 'soukai-solid';\n\nexport default class ContainerAlreadyInUse extends JSError {\n\n constructor(container: SolidContainer, options?: JSErrorOptions) {\n super(`Container at ${container.url} is already in use`, options);\n }\n\n}\n","import { PromisedValue, arr, fail } from '@noeldemartin/utils';\nimport { SolidEngine } from 'soukai-solid';\nimport type { Closure, FluentArray, GetClosureArgs } from '@noeldemartin/utils';\nimport type { Engine } from 'soukai';\nimport type { Fetch } from 'soukai-solid';\nimport type { SolidUserProfile } from '@noeldemartin/solid-utils';\nimport type { ErrorSource } from '@aerogel/core';\n\nimport type { AuthenticatorName } from '@/auth';\n\ntype ListenerEvent = keyof AuthenticatorListener;\ntype ListenerEventPayload<\n Event extends ListenerEvent,\n Callback = AuthenticatorListener[Event]\n> = Callback extends Closure ? GetClosureArgs<Callback> : never;\n\nexport interface AuthSession {\n user: SolidUserProfile;\n loginUrl: string;\n authenticator: Authenticator;\n}\n\nexport interface AuthenticatorListener {\n onSessionStarted?: (session: AuthSession) => Promise<void> | void;\n onSessionFailed?: (loginUrl: string, error: ErrorSource) => Promise<void> | void;\n onSessionEnded?: () => Promise<void> | void;\n onAuthenticatedFetchReady?: (fetch: Fetch) => Promise<void> | void;\n}\n\nexport default abstract class Authenticator {\n\n public name!: AuthenticatorName;\n\n private authenticatedFetch?: Fetch;\n private booted?: PromisedValue<void>;\n private listeners: FluentArray<AuthenticatorListener> = arr<AuthenticatorListener>([]);\n private _engine?: SolidEngine;\n\n public abstract login(loginUrl: string, user?: SolidUserProfile): Promise<AuthSession>;\n\n public abstract logout(): Promise<void>;\n\n public get engine(): Engine {\n this._engine = this._engine ?? new SolidEngine(this.requireAuthenticatedFetch());\n\n return this._engine;\n }\n\n public getAuthenticatedFetch(): Fetch | null {\n return this.authenticatedFetch ?? null;\n }\n\n public requireAuthenticatedFetch(): Fetch {\n return this.authenticatedFetch ?? fail('Authenticated fetch is not ready');\n }\n\n public addListener(listener: AuthenticatorListener): () => void {\n if (!this.listeners.includes(listener)) this.listeners.push(listener);\n\n return () => {\n this.removeListener(listener);\n };\n }\n\n public removeListener(listener: AuthenticatorListener): void {\n if (!this.listeners.includes(listener)) return;\n\n this.listeners.remove(listener);\n }\n\n public async boot(): Promise<void> {\n if (this.booted) {\n return this.booted;\n }\n\n this.booted = new PromisedValue();\n\n await this.restoreSession();\n\n this.booted.resolve();\n }\n\n protected abstract restoreSession(): Promise<void>;\n\n protected async initAuthenticatedFetch(fetch: Fetch): Promise<void> {\n this.authenticatedFetch = fetch;\n\n await this.notifyListeners('onAuthenticatedFetchReady', fetch);\n }\n\n protected async startSession(sessionData: Omit<AuthSession, 'authenticator'>): Promise<AuthSession> {\n const session: AuthSession = {\n authenticator: this,\n ...sessionData,\n };\n\n await this.notifyListeners('onSessionStarted', session);\n\n return session;\n }\n\n protected async failSession(loginUrl: string, error: ErrorSource): Promise<void> {\n await this.notifyListeners('onSessionFailed', loginUrl, error);\n }\n\n protected async endSession(): Promise<void> {\n await this.notifyListeners('onSessionEnded');\n }\n\n protected async notifyListeners<Event extends ListenerEvent>(\n event: Event,\n ...payload: ListenerEventPayload<Event>\n ): Promise<void> {\n await Promise.all(\n this.listeners.toArray().map(async (listener) => {\n const callback = listener[event] as Closure | undefined;\n\n await callback?.(...payload);\n }),\n );\n }\n\n}\n","import { Storage, after, fail } from '@noeldemartin/utils';\nimport type { Fetch } from 'soukai-solid';\nimport type { ILoginInputOptions, handleIncomingRedirect, login, logout } from '@inrupt/solid-client-authn-browser';\n\nimport Authenticator from '@/auth/Authenticator';\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport AerogelSolid from 'virtual:aerogel-solid';\n\nconst STORAGE_KEY = 'inrupt-authenticator';\n\nexport default class InruptAuthenticator extends Authenticator {\n\n private _fetch!: Fetch;\n private _login!: typeof login;\n private _logout!: typeof logout;\n private _handleIncomingRedirect!: typeof handleIncomingRedirect;\n\n public async login(loginUrl: string): Promise<AuthSession> {\n Storage.set<boolean>(STORAGE_KEY, true);\n\n const options: ILoginInputOptions = {\n oidcIssuer: loginUrl,\n };\n\n if (AerogelSolid.clientID) {\n options.clientId = AerogelSolid.clientID.client_id;\n options.clientName = AerogelSolid.clientID.client_name;\n options.redirectUrl = AerogelSolid.clientID.redirect_uris[0];\n }\n\n await this._login(options);\n\n // Browser should redirect, so just make it wait for a while.\n await after({ seconds: 60 });\n\n return fail('Browser should have redirected, but it didn\\'t');\n }\n\n public async logout(): Promise<void> {\n await this._logout();\n await this.endSession();\n }\n\n protected async restoreSession(): Promise<void> {\n const { fetch, handleIncomingRedirect, login, logout } = await import('./InruptAuthenticator.lazy');\n\n this._fetch = fetch;\n this._login = login;\n this._logout = logout;\n this._handleIncomingRedirect = handleIncomingRedirect;\n\n await this.loginFromRedirect();\n }\n\n protected async loginFromRedirect(): Promise<void> {\n if (!Storage.has(STORAGE_KEY)) {\n return;\n }\n\n const session = await this._handleIncomingRedirect(window.location.href);\n\n Storage.remove(STORAGE_KEY);\n\n if (session?.isLoggedIn && session.webId) {\n await this.initSession(session.webId);\n }\n }\n\n protected async initSession(webId: string): Promise<void> {\n await this.initAuthenticatedFetch(this._fetch);\n\n try {\n const { default: Solid } = await import('@/services/Solid');\n const user = await Solid.requireUserProfile(webId);\n\n await this.startSession({ user, loginUrl: webId });\n } catch (error) {\n await this.failSession(webId, error);\n }\n }\n\n}\n","import InruptAuthenticator from './authenticators/InruptAuthenticator';\nimport type Authenticator from './Authenticator';\n\nconst _authenticators = {} as Authenticators;\n\ntype BaseAuthenticators = typeof authenticators;\n\nexport * from './Authenticator';\nexport { Authenticator };\n\nexport const authenticators = {\n inrupt: new InruptAuthenticator(),\n};\n\nexport function setDefaultAuthenticator(authenticator: Authenticator): void {\n _authenticators.default = authenticator;\n}\n\nexport function getAuthenticator<T extends AuthenticatorName>(name: T): Authenticators[T] {\n return _authenticators[name];\n}\n\nexport function registerAuthenticators(customAuthenticators: Record<string, Authenticator>): void {\n Object.entries(customAuthenticators).forEach(([name, authenticator]) =>\n registerAuthenticator(name as AuthenticatorName, authenticator));\n}\n\nexport function registerAuthenticator<T extends AuthenticatorName>(name: T, authenticator: Authenticators[T]): void {\n _authenticators[name] = authenticator;\n\n authenticator.name = authenticator.name ?? name;\n}\n\nexport type AuthenticatorName = keyof Authenticators;\n\nexport interface Authenticators extends BaseAuthenticators {\n default: Authenticator;\n}\n","import { defineServiceState } from '@aerogel/core';\nimport type { ErrorSource } from '@aerogel/core';\nimport type { Fetch, SolidUserProfile } from '@noeldemartin/solid-utils';\n\nimport type { AuthSession } from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\n\nexport default defineServiceState({\n name: 'solid',\n persist: ['autoReconnect', 'dismissed', 'previousSession', 'profiles', 'staleProfiles'],\n initialState: {\n autoReconnect: false,\n dismissed: false,\n ignorePreviousSessionError: false,\n loginStartupError: null as ErrorSource | null,\n loginOngoing: false,\n preferredAuthenticator: null as AuthenticatorName | null,\n previousSession: null as {\n profile?: SolidUserProfile;\n authenticator: AuthenticatorName;\n loginUrl: string;\n error: ErrorSource | null;\n } | null,\n profiles: {} as Record<string, SolidUserProfile>,\n session: null as AuthSession | null,\n loginStale: false,\n staleProfiles: [] as string[],\n },\n serialize(state) {\n if (state.previousSession?.error instanceof Error) {\n state.previousSession.error = state.previousSession.error.message;\n }\n\n return state;\n },\n computed: {\n user: (state) => state.session?.user ?? state.previousSession?.profile ?? null,\n authenticator: (state) => state.session?.authenticator ?? null,\n fetch(): Fetch {\n return this.authenticator?.getAuthenticatedFetch() ?? globalThis.fetch.bind(globalThis);\n },\n error(state): ErrorSource | null {\n if (state.loginStartupError) {\n return state.loginStartupError ?? null;\n }\n\n if (state.ignorePreviousSessionError) {\n return null;\n }\n\n return state.previousSession?.error ?? null;\n },\n },\n});\n","import {\n after,\n arrayFilter,\n arrayUnique,\n arrayWithout,\n asyncMemo,\n facade,\n fail,\n getLocationQueryParameter,\n hasLocationQueryParameter,\n objectWithout,\n objectWithoutEmpty,\n parseBoolean,\n requireUrlParse,\n setAsyncMemo,\n tap,\n urlRoot,\n} from '@noeldemartin/utils';\nimport { App, Errors, Events, UI, translateWithDefault } from '@aerogel/core';\nimport { fetchLoginUserProfile } from '@noeldemartin/solid-utils';\nimport { setEngine } from 'soukai';\nimport { SolidACLAuthorization, SolidContainer, SolidDocument, SolidTypeIndex } from 'soukai-solid';\nimport type { ErrorSource } from '@aerogel/core';\nimport type { Fetch, SolidModelConstructor } from 'soukai-solid';\nimport type { SolidUserProfile } from '@noeldemartin/solid-utils';\n\nimport AuthenticationCancelledError from '@/errors/AuthenticationCancelledError';\nimport { ContainerAlreadyInUse } from '@/errors';\nimport { getAuthenticator } from '@/auth';\nimport type Authenticator from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport Service from './Solid.state';\n\nexport type LoginOptions = {\n authenticator?: AuthenticatorName;\n onError?(error: ErrorSource): unknown;\n fallbackUrl?: string;\n};\n\nexport type ReconnectOptions = Omit<LoginOptions, 'authenticator'> & {\n force?: boolean;\n};\n\nexport class SolidService extends Service {\n\n public isLoggedIn(): this is { session: AuthSession; user: SolidUserProfile; authenticator: Authenticator } {\n return !!this.session;\n }\n\n public wasLoggedIn(): this is { user: SolidUserProfile } {\n return !!this.previousSession;\n }\n\n public hasLoggedIn(): this is { user: SolidUserProfile } {\n return !!(this.session || this.previousSession);\n }\n\n public requireAuthenticator(): Authenticator {\n return this.authenticator ?? fail('Could not get authenticator');\n }\n\n public requireUser(): SolidUserProfile {\n return this.user ?? fail('Could not get user profile (are you logged in?)');\n }\n\n public requireUserProfile(url: string): Promise<SolidUserProfile> {\n return this.getUserProfile(url, true);\n }\n\n public async getUserProfile(url: string, required: true): Promise<SolidUserProfile>;\n public async getUserProfile(url: string, required?: false): Promise<SolidUserProfile | null>;\n public async getUserProfile(url: string, required: boolean = false): Promise<SolidUserProfile | null> {\n return (\n this.profiles[url] ??\n tap(\n await fetchLoginUserProfile(url, {\n fetch: this.fetch,\n required,\n }),\n (profile) => profile && this.rememberProfile(profile),\n )\n );\n }\n\n public async refreshUserProfile(): Promise<void> {\n if (!this.isLoggedIn()) {\n return;\n }\n\n this.setState({ profiles: objectWithout(this.profiles, [this.user.webId]) });\n\n const user = await this.requireUserProfile(this.user.webId);\n\n this.setState({\n session: {\n ...this.session,\n user,\n },\n });\n }\n\n public async login(loginUrl: string, options: LoginOptions = {}): Promise<boolean> {\n const authenticatorName = options.authenticator ?? this.preferredAuthenticator ?? 'default';\n const handleLoginError =\n options.onError ??\n ((error: ErrorSource) =>\n App.isMounted() ? Errors.report(error) : this.setState({ loginStartupError: error }));\n\n if (App.development && loginUrl === 'devserver') {\n loginUrl = 'http://localhost:3000';\n }\n\n if (!/^https?:\\/\\//.test(loginUrl)) {\n options.fallbackUrl ??= `http://${loginUrl}`;\n loginUrl = `https://${loginUrl}`;\n }\n\n if (this.isLoggedIn()) {\n return true;\n }\n\n if (this.loginOngoing) {\n throw new Error('Authentication already in progress');\n }\n\n const staleTimeout = setTimeout(() => (this.loginStale = true), 10000);\n const initialState = {\n dismissed: this.dismissed,\n ignorePreviousSessionError: this.ignorePreviousSessionError,\n previousSession: this.previousSession,\n };\n this.loginOngoing = true;\n\n try {\n const profile = await this.getUserProfile(loginUrl);\n const oidcIssuerUrl = profile?.oidcIssuerUrl ?? urlRoot(profile?.webId ?? loginUrl);\n const authenticator = await this.bootAuthenticator(authenticatorName);\n const { domain: loginDomain } = requireUrlParse(loginUrl);\n\n this.setState({\n dismissed: false,\n ignorePreviousSessionError: true,\n previousSession: objectWithoutEmpty({\n profile,\n loginUrl,\n authenticator: authenticatorName,\n error: translateWithDefault(\n 'auth.stuckConnecting',\n `We didn't hear back from the identity provider at \\`${loginDomain}\\`, maybe try reconnecting?`,\n ),\n }),\n });\n\n await Events.emit('auth:before-login');\n\n // This should redirect away from the app, so in most cases\n // the rest of the code won't be reached.\n await authenticator.login(oidcIssuerUrl);\n\n return true;\n } catch (error) {\n this.setState(initialState);\n\n if (error instanceof AuthenticationCancelledError) {\n return false;\n }\n\n if (options.fallbackUrl) {\n return after().then(() => this.login(options.fallbackUrl ?? '', objectWithout(options, 'fallbackUrl')));\n }\n\n handleLoginError(error);\n\n return false;\n } finally {\n clearTimeout(staleTimeout);\n\n this.setState({\n loginOngoing: false,\n loginStale: false,\n });\n }\n }\n\n public async reconnect(options: ReconnectOptions = {}): Promise<void> {\n const { force, ...loginOptions } = options;\n if (this.isLoggedIn() || !this.previousSession || (this.previousSession.error !== null && !force)) {\n return;\n }\n\n await this.login(this.previousSession.loginUrl, {\n authenticator: this.previousSession.authenticator,\n ...loginOptions,\n });\n }\n\n public async logout(force: boolean = false): Promise<void> {\n const confirmLogout =\n force ||\n (await UI.confirm(translateWithDefault('solid.logoutConfirm', 'Are you sure you want to log out?')));\n\n if (!confirmLogout) {\n return;\n }\n\n if (!this.previousSession) {\n return;\n }\n\n this.setState({ previousSession: null });\n this.isLoggedIn() && (await this.authenticator.logout());\n\n await Events.emit('auth:logout');\n }\n\n public async whenLoggedIn<T>(callback: (session: AuthSession) => T): Promise<T> {\n if (this.isLoggedIn()) {\n return callback(this.session);\n }\n\n return new Promise((resolve) => {\n const onLogin = (session: AuthSession) => resolve(callback(session));\n\n Events.once('auth:login', onLogin);\n });\n }\n\n public dismiss(): void {\n this.setState({ dismissed: true });\n }\n\n public async findOrCreatePrivateTypeIndex(): Promise<SolidTypeIndex> {\n return (await this.findPrivateTypeIndex()) ?? (await this.createPrivateTypeIndex());\n }\n\n public async findPrivateTypeIndex(): Promise<SolidTypeIndex | null> {\n const user = this.requireUser();\n const engine = this.requireAuthenticator().engine;\n\n return asyncMemo(`${user.webId}-privateTypeIndex`, () =>\n SolidTypeIndex.withEngine(engine).find(user.privateTypeIndexUrl));\n }\n\n public async findOrCreatePublicTypeIndex(): Promise<SolidTypeIndex> {\n return (await this.findPublicTypeIndex()) ?? (await this.createPublicTypeIndex());\n }\n\n protected async findPublicTypeIndex(): Promise<SolidTypeIndex | null> {\n const user = this.requireUser();\n const engine = this.requireAuthenticator().engine;\n\n return asyncMemo(`${user.webId}-publicTypeIndex`, () =>\n SolidTypeIndex.withEngine(engine).find(user.publicTypeIndexUrl));\n }\n\n public async createPrivateContainer(options: {\n url: string;\n name?: string;\n registerFor?: SolidModelConstructor;\n reuseExisting?: boolean;\n }): Promise<SolidContainer> {\n const engine = this.requireAuthenticator().engine;\n\n return SolidContainer.withEngine(engine, async () => {\n const existingContainer = await SolidContainer.find(options.url);\n\n if (existingContainer && !options.reuseExisting) {\n throw new ContainerAlreadyInUse(existingContainer);\n }\n\n const container = existingContainer ?? new SolidContainer({ url: options.url, name: options.name });\n\n await container.save();\n\n if (options.registerFor) {\n const typeIndex = await this.findOrCreatePrivateTypeIndex();\n\n await container.register(typeIndex, options.registerFor);\n }\n\n return container;\n });\n }\n\n protected async boot(): Promise<void> {\n await Errors.booted;\n\n if (hasLocationQueryParameter('authenticator')) {\n this.setState({\n preferredAuthenticator: getLocationQueryParameter('authenticator') as AuthenticatorName,\n });\n }\n\n if (hasLocationQueryParameter('refreshProfile')) {\n this.setState({\n staleProfiles: arrayUnique(\n this.staleProfiles.concat(arrayFilter([this.session?.user.webId, this.previousSession?.loginUrl])),\n ),\n });\n }\n\n await this.restorePreviousSession();\n await this.startupReconnect();\n }\n\n protected async createPrivateTypeIndex(): Promise<SolidTypeIndex> {\n const user = this.requireUser();\n const authenticator = this.requireAuthenticator();\n const typeIndex = await SolidTypeIndex.withEngine(authenticator.engine).createPrivate(user);\n\n return tap(typeIndex, () => {\n user.privateTypeIndexUrl = typeIndex.url;\n\n setAsyncMemo(`${user.webId}-privateTypeIndex`, typeIndex);\n\n this.rememberProfile(user);\n });\n }\n\n public async createPublicTypeIndex(): Promise<SolidTypeIndex> {\n const user = this.requireUser();\n const authenticator = this.requireAuthenticator();\n const typeIndex = await SolidTypeIndex.withEngine(authenticator.engine).createPublic(user);\n\n return tap(typeIndex, () => {\n user.privateTypeIndexUrl = typeIndex.url;\n\n setAsyncMemo(`${user.webId}-publicTypeIndex`, typeIndex);\n\n this.rememberProfile(user);\n });\n }\n\n private async restorePreviousSession(): Promise<void> {\n if (!this.previousSession) {\n return;\n }\n\n await this.bootAuthenticator(this.previousSession.authenticator);\n }\n\n private async startupReconnect(): Promise<void> {\n if (!this.reconnectOnStartup()) {\n return;\n }\n\n await this.reconnect();\n }\n\n private reconnectOnStartup(): boolean {\n if (hasLocationQueryParameter('autoReconnect')) {\n return parseBoolean(getLocationQueryParameter('autoReconnect'));\n }\n\n return this.autoReconnect;\n }\n\n private async bootAuthenticator(name: AuthenticatorName): Promise<Authenticator> {\n const authenticator = getAuthenticator(name);\n\n authenticator.addListener({\n onSessionStarted: async (session) => {\n this.setState({\n session,\n previousSession: {\n authenticator: authenticator.name,\n loginUrl: session.loginUrl,\n profile: session.user,\n error: null,\n },\n });\n\n if (\n session.user.cloaked ||\n !session.user.writableProfileUrl ||\n this.staleProfiles.includes(session.user.webId)\n ) {\n await this.refreshUserProfile();\n }\n\n App.plugin('@aerogel/offline-first') || setEngine(session.authenticator.engine);\n\n SolidACLAuthorization.setEngine(session.authenticator.engine);\n SolidTypeIndex.setEngine(session.authenticator.engine);\n SolidDocument.setEngine(session.authenticator.engine);\n\n await Events.emit('auth:login', session);\n },\n onSessionFailed: async (loginUrl, error) => {\n this.setState({\n session: null,\n previousSession: {\n authenticator: authenticator.name,\n loginUrl,\n error,\n },\n });\n },\n onSessionEnded: () => this.setState({ session: null }),\n onAuthenticatedFetchReady: (fetch) => Events.emit('auth:fetch-ready', fetch),\n });\n\n await authenticator.boot();\n\n return authenticator;\n }\n\n private rememberProfile(profile: SolidUserProfile): void {\n this.setState({\n profiles: {\n ...this.profiles,\n [profile.webId]: profile,\n },\n staleProfiles: arrayWithout(this.staleProfiles, profile.webId),\n });\n }\n\n}\n\nexport default facade(SolidService);\n\ndeclare module '@aerogel/core' {\n export interface EventsPayload {\n 'auth:fetch-ready': Fetch;\n 'auth:before-login': void;\n 'auth:login': AuthSession;\n 'auth:logout': void;\n }\n}\n","<template>\n <div>\n <slot v-if=\"$solid.loginStale\" name=\"login-stale\">\n <AGMarkdown :text=\"$td('solid.loginStale', 'This is taking too long...')\" />\n </slot>\n\n <slot v-if=\"$solid.loginOngoing\" name=\"login-ongoing\">\n <AGMarkdown :text=\"$td('ui.loading', 'Loading...')\" />\n </slot>\n\n <slot v-else-if=\"$solid.isLoggedIn()\" name=\"logged-in\" :session=\"$solid.session\">\n <div class=\"flex flex-col gap-3\">\n <AGMarkdown\n :text=\"\n $td(\n 'solid.loggedIn',\n {\n userName: $solid.user.name ?? $solid.user.webId,\n userWebId: $solid.user.webId,\n },\n 'You are logged in as [{userName}]({userWebId})'\n )\n \"\n />\n <AGButton @click=\"$solid.logout()\">\n {{ $td('solid.logout', 'Logout') }}\n </AGButton>\n </div>\n </slot>\n\n <slot v-else name=\"logged-out\">\n <div class=\"flex flex-col\">\n <AGForm :form=\"form\" class=\"flex\" @submit=\"$solid.login(form.url)\">\n <AGInput\n name=\"url\"\n :aria-label=\"$td('solid.url', 'Login url')\"\n :placeholder=\"$td('solid.placeholder', 'https://...')\"\n />\n <AGButton submit>\n {{ $td('solid.login', 'Login') }}\n </AGButton>\n </AGForm>\n <AGButton v-if=\"$solid.wasLoggedIn()\" class=\"mt-3\" @click=\"$solid.reconnect({ force: true })\">\n {{ $td('solid.reconnect', 'Reconnect') }}\n </AGButton>\n <AGMarkdown\n v-if=\"$solid.previousSession?.error\"\n class=\"mt-1 self-center text-sm text-red-800\"\n :text=\"$td('solid.previousLoginError', 'Previous login attempt failed')\"\n />\n </div>\n </slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { AGButton, AGForm, AGInput, AGMarkdown, requiredStringInput, useForm } from '@aerogel/core';\n\nconst form = useForm({ url: requiredStringInput() });\n</script>\n","import { fakeContainerUrl, fakeDocumentUrl } from '@noeldemartin/solid-utils';\nimport { FakeServer, facade, mock } from '@noeldemartin/utils';\nimport { SolidACLAuthorization, SolidDocument, SolidEngine, SolidTypeIndex } from 'soukai-solid';\n\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport { SolidService } from './Solid';\n\nexport class SolidMockService extends SolidService {\n\n public readonly server: FakeServer = new FakeServer();\n\n constructor() {\n super();\n\n const engine = new SolidEngine(this.server.fetch);\n\n this.setState('session', {\n user: mock({\n privateTypeIndexUrl: fakeDocumentUrl(),\n storageUrls: [fakeContainerUrl()],\n }),\n authenticator: mock({\n engine,\n requireAuthenticatedFetch: () => this.server.fetch,\n }),\n } as unknown as AuthSession);\n\n SolidACLAuthorization.setEngine(engine);\n SolidTypeIndex.setEngine(engine);\n SolidDocument.setEngine(engine);\n\n this.booted.resolve();\n }\n\n}\n\nexport default facade(SolidMockService);\n","import { bootServices } from '@aerogel/core';\nimport { bootSolidModels } from 'soukai-solid';\nimport type { Plugin } from '@aerogel/core';\n\nimport Solid from '@/services/Solid';\nimport {\n authenticators as baseAuthenticators,\n getAuthenticator,\n registerAuthenticators,\n setDefaultAuthenticator,\n} from '@/auth';\nimport type Authenticator from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\n\nconst services = { $solid: Solid };\n\nexport * from './auth';\nexport * from './components';\nexport * from './errors';\nexport * from './services/Solid';\nexport * from './services/Solid.mock';\nexport { Solid };\nexport { default as SolidMock } from './services/Solid.mock';\n\nexport interface Options {\n autoReconnect?: boolean;\n authenticators?: Record<string, Authenticator>;\n defaultAuthenticator?: AuthenticatorName;\n}\n\nexport type SolidServices = typeof services;\n\nexport default function solid(options: Options = {}): Plugin {\n return {\n async install(app) {\n bootSolidModels();\n registerAuthenticators({ ...baseAuthenticators, ...(options.authenticators ?? {}) });\n setDefaultAuthenticator(getAuthenticator(options.defaultAuthenticator ?? 'inrupt'));\n\n if (!Solid.hasPersistedState()) {\n Solid.autoReconnect = options.autoReconnect ?? Solid.autoReconnect;\n }\n\n await bootServices(app, services);\n },\n };\n}\n\ndeclare module '@vue/runtime-core' {\n interface ComponentCustomProperties extends SolidServices {}\n}\n"],"names":["AuthenticationCancelledError","JSError","ContainerAlreadyInUse","constructor","container","options","super","url","Authenticator","_defineProperty","this","arr","engine","_engine","SolidEngine","requireAuthenticatedFetch","getAuthenticatedFetch","authenticatedFetch","fail","addListener","listener","listeners","includes","push","removeListener","remove","boot","booted","PromisedValue","restoreSession","resolve","initAuthenticatedFetch","fetch","notifyListeners","startSession","sessionData","session","authenticator","failSession","loginUrl","error","endSession","event","_len","arguments","length","payload","Array","_key","Promise","all","toArray","map","async","callback","STORAGE_KEY","_authenticators","authenticators","inrupt","login","Storage","set","oidcIssuer","AerogelSolid","clientID","clientId","client_id","clientName","client_name","redirectUrl","redirect_uris","_login","after","seconds","logout","_logout","handleIncomingRedirect","then","require","_fetch","_handleIncomingRedirect","loginFromRedirect","has","window","location","href","isLoggedIn","webId","initSession","default","Solid","Solid$1","user","requireUserProfile","setDefaultAuthenticator","getAuthenticator","name","registerAuthenticators","customAuthenticators","Object","entries","forEach","_ref","registerAuthenticator","Service","defineServiceState","persist","initialState","autoReconnect","dismissed","ignorePreviousSessionError","loginStartupError","loginOngoing","preferredAuthenticator","previousSession","profiles","loginStale","staleProfiles","serialize","state","Error","message","computed","profile","globalThis","bind","SolidService","wasLoggedIn","hasLoggedIn","requireAuthenticator","requireUser","getUserProfile","required","tap","fetchLoginUserProfile","rememberProfile","refreshUserProfile","setState","objectWithout","authenticatorName","handleLoginError","onError","App","isMounted","Errors","report","development","test","fallbackUrl","staleTimeout","setTimeout","oidcIssuerUrl","urlRoot","bootAuthenticator","domain","loginDomain","requireUrlParse","objectWithoutEmpty","translateWithDefault","Events","emit","clearTimeout","reconnect","undefined","force","loginOptions","UI","confirm","whenLoggedIn","once","dismiss","findOrCreatePrivateTypeIndex","findPrivateTypeIndex","createPrivateTypeIndex","asyncMemo","SolidTypeIndex","withEngine","find","privateTypeIndexUrl","findOrCreatePublicTypeIndex","findPublicTypeIndex","createPublicTypeIndex","publicTypeIndexUrl","createPrivateContainer","SolidContainer","existingContainer","reuseExisting","save","registerFor","typeIndex","register","hasLocationQueryParameter","getLocationQueryParameter","arrayUnique","concat","arrayFilter","restorePreviousSession","startupReconnect","createPrivate","setAsyncMemo","createPublic","reconnectOnStartup","parseBoolean","onSessionStarted","cloaked","writableProfileUrl","plugin","setEngine","SolidACLAuthorization","SolidDocument","onSessionFailed","onSessionEnded","onAuthenticatedFetchReady","arrayWithout","facade","form","useForm","requiredStringInput","SolidMockService","FakeServer","server","mock","fakeDocumentUrl","storageUrls","fakeContainerUrl","services","$solid","install","app","bootSolidModels","baseAuthenticators","defaultAuthenticator","hasPersistedState","bootServices"],"mappings":"89BAEqB,MAAAA,qCAAqCC,EAAAA,SCErC,MAAAC,UAA8BD,EAAAA,QAE/CE,WAAAA,CAAYC,EAA2BC,GACnCC,sBAAsBF,EAAUG,wBAAyBF,EAC7D,ECqBU,MAAgBG,EAAaL,WAAAA,GAAAM,EAAAA,QAAAC,KAAA,YAAA,GAAAD,EAAAA,QAAAC,KAAA,0BAAA,GAAAD,EAAAA,QAAAC,KAAA,cAAA,GAAAD,EAAAA,QAMiBE,KAAAA,YAAAA,EAAAA,IAA2B,KAAGF,EAAAA,QAAAC,KAAA,eAAA,EAAA,CAOtF,UAAWE,GAGP,OAFAF,KAAKG,QAAUH,KAAKG,SAAW,IAAIC,EAAAA,YAAYJ,KAAKK,6BAE7CL,KAAKG,OAChB,CAEOG,qBAAAA,GACH,OAAON,KAAKO,oBAAsB,IACtC,CAEOF,yBAAAA,GACH,OAAOL,KAAKO,oBAAsBC,EAAIA,KAAC,mCAC3C,CAEOC,WAAAA,CAAYC,GAGf,OAFKV,KAAKW,UAAUC,SAASF,IAAWV,KAAKW,UAAUE,KAAKH,GAErD,KACHV,KAAKc,eAAeJ,EAAS,CAErC,CAEOI,cAAAA,CAAeJ,GACbV,KAAKW,UAAUC,SAASF,IAE7BV,KAAKW,UAAUI,OAAOL,EAC1B,CAEO,UAAMM,GACT,GAAIhB,KAAKiB,OACL,OAAOjB,KAAKiB,OAGhBjB,KAAKiB,OAAS,IAAIC,EAAAA,oBAEZlB,KAAKmB,iBAEXnB,KAAKiB,OAAOG,SAChB,CAIU,4BAAMC,CAAuBC,GACnCtB,KAAKO,mBAAqBe,QAEpBtB,KAAKuB,gBAAgB,4BAA6BD,EAC5D,CAEU,kBAAME,CAAaC,GACzB,MAAMC,EAAuB,CACzBC,cAAe3B,QACZyB,GAKP,aAFMzB,K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wBjO,EAAQoD,gBAAkB,KAC9EqC,EAAwBC,EAAiB1F,EAAQkO,sBAAwB,WAEpE7I,EAAM8I,sBACP9I,EAAMkB,cAAgBvG,EAAQuG,eAAiBlB,EAAMkB,qBAGnD6H,EAAYA,aAACL,EAAKH,EAC5B,EAER"}
@@ -0,0 +1,266 @@
1
+ import type { Closure } from '@noeldemartin/utils';
2
+ import { ComponentOptionsMixin } from 'vue';
3
+ import { Constructor } from '@noeldemartin/utils';
4
+ import { DefineComponent } from 'vue';
5
+ import type { Engine } from 'soukai';
6
+ import type { ErrorSource } from '@aerogel/core';
7
+ import { ExtractPropTypes } from 'vue';
8
+ import { Facade } from '@noeldemartin/utils';
9
+ import { FakeServer } from '@noeldemartin/utils';
10
+ import type { Fetch } from 'soukai-solid';
11
+ import type { Fetch as Fetch_2 } from '@noeldemartin/solid-utils';
12
+ import type { GetClosureArgs } from '@noeldemartin/utils';
13
+ import { JSError } from '@noeldemartin/utils';
14
+ import type { JSErrorOptions } from '@noeldemartin/utils';
15
+ import type { Plugin as Plugin_2 } from '@aerogel/core';
16
+ import { PublicProps } from 'vue';
17
+ import { RendererElement } from 'vue';
18
+ import { RendererNode } from 'vue';
19
+ import { Service } from '@aerogel/core';
20
+ import { SolidContainer } from 'soukai-solid';
21
+ import type { SolidModelConstructor } from 'soukai-solid';
22
+ import { SolidTypeIndex } from 'soukai-solid';
23
+ import type { SolidUserProfile } from '@noeldemartin/solid-utils';
24
+ import { UnrefServiceState } from '@aerogel/core';
25
+ import { VNode } from 'vue';
26
+
27
+ export declare const AGSolidStatus: DefineComponent< {}, (_ctx: any, _cache: any) => VNode<RendererNode, RendererElement, {
28
+ [key: string]: any;
29
+ }>, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ExtractPropTypes< {}>>, {}, {}>;
30
+
31
+ export declare class AuthenticationCancelledError extends JSError {
32
+ }
33
+
34
+ export declare abstract class Authenticator {
35
+ name: AuthenticatorName;
36
+ private authenticatedFetch?;
37
+ private booted?;
38
+ private listeners;
39
+ private _engine?;
40
+ abstract login(loginUrl: string, user?: SolidUserProfile): Promise<AuthSession>;
41
+ abstract logout(): Promise<void>;
42
+ get engine(): Engine;
43
+ getAuthenticatedFetch(): Fetch | null;
44
+ requireAuthenticatedFetch(): Fetch;
45
+ addListener(listener: AuthenticatorListener): () => void;
46
+ removeListener(listener: AuthenticatorListener): void;
47
+ boot(): Promise<void>;
48
+ protected abstract restoreSession(): Promise<void>;
49
+ protected initAuthenticatedFetch(fetch: Fetch): Promise<void>;
50
+ protected startSession(sessionData: Omit<AuthSession, 'authenticator'>): Promise<AuthSession>;
51
+ protected failSession(loginUrl: string, error: ErrorSource): Promise<void>;
52
+ protected endSession(): Promise<void>;
53
+ protected notifyListeners<Event extends ListenerEvent>(event: Event, ...payload: ListenerEventPayload<Event>): Promise<void>;
54
+ }
55
+
56
+ export declare interface AuthenticatorListener {
57
+ onSessionStarted?: (session: AuthSession) => Promise<void> | void;
58
+ onSessionFailed?: (loginUrl: string, error: ErrorSource) => Promise<void> | void;
59
+ onSessionEnded?: () => Promise<void> | void;
60
+ onAuthenticatedFetchReady?: (fetch: Fetch) => Promise<void> | void;
61
+ }
62
+
63
+ export declare type AuthenticatorName = keyof Authenticators;
64
+
65
+ export declare interface Authenticators extends BaseAuthenticators {
66
+ default: Authenticator;
67
+ }
68
+
69
+ export declare const authenticators: {
70
+ inrupt: InruptAuthenticator;
71
+ };
72
+
73
+ export declare interface AuthSession {
74
+ user: SolidUserProfile;
75
+ loginUrl: string;
76
+ authenticator: Authenticator;
77
+ }
78
+
79
+ declare type BaseAuthenticators = typeof authenticators;
80
+
81
+ export declare class ContainerAlreadyInUse extends JSError {
82
+ constructor(container: SolidContainer, options?: JSErrorOptions);
83
+ }
84
+
85
+ declare const _default: Constructor<UnrefServiceState< {
86
+ autoReconnect: boolean;
87
+ dismissed: boolean;
88
+ ignorePreviousSessionError: boolean;
89
+ loginStartupError: unknown;
90
+ loginOngoing: boolean;
91
+ preferredAuthenticator: keyof Authenticators | null;
92
+ previousSession: {
93
+ profile?: SolidUserProfile | undefined;
94
+ authenticator: AuthenticatorName;
95
+ loginUrl: string;
96
+ error: ErrorSource | null;
97
+ } | null;
98
+ profiles: Record<string, SolidUserProfile>;
99
+ session: AuthSession | null;
100
+ loginStale: boolean;
101
+ staleProfiles: string[];
102
+ }>> & Constructor< {
103
+ user: SolidUserProfile | null;
104
+ authenticator: Authenticator | null;
105
+ fetch: Fetch_2;
106
+ error: unknown;
107
+ }> & Constructor<Service<UnrefServiceState< {
108
+ autoReconnect: boolean;
109
+ dismissed: boolean;
110
+ ignorePreviousSessionError: boolean;
111
+ loginStartupError: unknown;
112
+ loginOngoing: boolean;
113
+ preferredAuthenticator: keyof Authenticators | null;
114
+ previousSession: {
115
+ profile?: SolidUserProfile | undefined;
116
+ authenticator: AuthenticatorName;
117
+ loginUrl: string;
118
+ error: ErrorSource | null;
119
+ } | null;
120
+ profiles: Record<string, SolidUserProfile>;
121
+ session: AuthSession | null;
122
+ loginStale: boolean;
123
+ staleProfiles: string[];
124
+ }>, {
125
+ user: SolidUserProfile | null;
126
+ authenticator: Authenticator | null;
127
+ fetch: Fetch_2;
128
+ error: unknown;
129
+ }, Partial<UnrefServiceState< {
130
+ autoReconnect: boolean;
131
+ dismissed: boolean;
132
+ ignorePreviousSessionError: boolean;
133
+ loginStartupError: unknown;
134
+ loginOngoing: boolean;
135
+ preferredAuthenticator: keyof Authenticators | null;
136
+ previousSession: {
137
+ profile?: SolidUserProfile | undefined;
138
+ authenticator: AuthenticatorName;
139
+ loginUrl: string;
140
+ error: ErrorSource | null;
141
+ } | null;
142
+ profiles: Record<string, SolidUserProfile>;
143
+ session: AuthSession | null;
144
+ loginStale: boolean;
145
+ staleProfiles: string[];
146
+ }>>>>;
147
+
148
+ export declare function getAuthenticator<T extends AuthenticatorName>(name: T): Authenticators[T];
149
+
150
+ export declare interface IAGSolidStatusLoggedInSlotProps {
151
+ session: AuthSession;
152
+ }
153
+
154
+ declare class InruptAuthenticator extends Authenticator {
155
+ private _fetch;
156
+ private _login;
157
+ private _logout;
158
+ private _handleIncomingRedirect;
159
+ login(loginUrl: string): Promise<AuthSession>;
160
+ logout(): Promise<void>;
161
+ protected restoreSession(): Promise<void>;
162
+ protected loginFromRedirect(): Promise<void>;
163
+ protected initSession(webId: string): Promise<void>;
164
+ }
165
+
166
+ declare type ListenerEvent = keyof AuthenticatorListener;
167
+
168
+ declare type ListenerEventPayload<Event extends ListenerEvent, Callback = AuthenticatorListener[Event]> = Callback extends Closure ? GetClosureArgs<Callback> : never;
169
+
170
+ export declare type LoginOptions = {
171
+ authenticator?: AuthenticatorName;
172
+ onError?(error: ErrorSource): unknown;
173
+ fallbackUrl?: string;
174
+ };
175
+
176
+ export declare interface Options {
177
+ autoReconnect?: boolean;
178
+ authenticators?: Record<string, Authenticator>;
179
+ defaultAuthenticator?: AuthenticatorName;
180
+ }
181
+
182
+ export declare type ReconnectOptions = Omit<LoginOptions, 'authenticator'> & {
183
+ force?: boolean;
184
+ };
185
+
186
+ export declare function registerAuthenticator<T extends AuthenticatorName>(name: T, authenticator: Authenticators[T]): void;
187
+
188
+ export declare function registerAuthenticators(customAuthenticators: Record<string, Authenticator>): void;
189
+
190
+ declare const services: {
191
+ $solid: Facade<SolidService, SolidService>;
192
+ };
193
+
194
+ export declare function setDefaultAuthenticator(authenticator: Authenticator): void;
195
+
196
+ export declare const Solid: Facade<SolidService, SolidService>;
197
+
198
+ declare function solid(options?: Options): Plugin_2;
199
+ export default solid;
200
+
201
+ export declare const SolidMock: Facade<SolidMockService, SolidMockService>;
202
+
203
+ export declare class SolidMockService extends SolidService {
204
+ readonly server: FakeServer;
205
+ constructor();
206
+ }
207
+
208
+ export declare class SolidService extends _default {
209
+ isLoggedIn(): this is {
210
+ session: AuthSession;
211
+ user: SolidUserProfile;
212
+ authenticator: Authenticator;
213
+ };
214
+ wasLoggedIn(): this is {
215
+ user: SolidUserProfile;
216
+ };
217
+ hasLoggedIn(): this is {
218
+ user: SolidUserProfile;
219
+ };
220
+ requireAuthenticator(): Authenticator;
221
+ requireUser(): SolidUserProfile;
222
+ requireUserProfile(url: string): Promise<SolidUserProfile>;
223
+ getUserProfile(url: string, required: true): Promise<SolidUserProfile>;
224
+ getUserProfile(url: string, required?: false): Promise<SolidUserProfile | null>;
225
+ refreshUserProfile(): Promise<void>;
226
+ login(loginUrl: string, options?: LoginOptions): Promise<boolean>;
227
+ reconnect(options?: ReconnectOptions): Promise<void>;
228
+ logout(force?: boolean): Promise<void>;
229
+ whenLoggedIn<T>(callback: (session: AuthSession) => T): Promise<T>;
230
+ dismiss(): void;
231
+ findOrCreatePrivateTypeIndex(): Promise<SolidTypeIndex>;
232
+ findPrivateTypeIndex(): Promise<SolidTypeIndex | null>;
233
+ findOrCreatePublicTypeIndex(): Promise<SolidTypeIndex>;
234
+ protected findPublicTypeIndex(): Promise<SolidTypeIndex | null>;
235
+ createPrivateContainer(options: {
236
+ url: string;
237
+ name?: string;
238
+ registerFor?: SolidModelConstructor;
239
+ reuseExisting?: boolean;
240
+ }): Promise<SolidContainer>;
241
+ protected boot(): Promise<void>;
242
+ protected createPrivateTypeIndex(): Promise<SolidTypeIndex>;
243
+ createPublicTypeIndex(): Promise<SolidTypeIndex>;
244
+ private restorePreviousSession;
245
+ private startupReconnect;
246
+ private reconnectOnStartup;
247
+ private bootAuthenticator;
248
+ private rememberProfile;
249
+ }
250
+
251
+ export declare type SolidServices = typeof services;
252
+
253
+ export { }
254
+
255
+ declare module '@vue/runtime-core' {
256
+ interface ComponentCustomProperties extends SolidServices {}
257
+ }
258
+
259
+ declare module '@aerogel/core' {
260
+ export interface EventsPayload {
261
+ 'auth:fetch-ready': Fetch;
262
+ 'auth:before-login': void;
263
+ 'auth:login': AuthSession;
264
+ 'auth:logout': void;
265
+ }
266
+ }
@@ -0,0 +1,2 @@
1
+ import{defineServiceState as e,App as t,Errors as i,translateWithDefault as s,Events as r,UI as n,useForm as o,requiredStringInput as a,AGMarkdown as l,AGButton as u,AGForm as c,AGInput as h,bootServices as d}from"@aerogel/core";import{SolidEngine as g,SolidTypeIndex as f,SolidContainer as p,SolidACLAuthorization as m,SolidDocument as v,bootSolidModels as y}from"soukai-solid";import"core-js/modules/esnext.async-iterator.find.js";import"core-js/modules/esnext.iterator.constructor.js";import"core-js/modules/esnext.iterator.find.js";import{JSError as w,arr as S,fail as b,PromisedValue as I,Storage as x,after as P,facade as A,tap as $,objectWithout as U,urlRoot as E,requireUrlParse as _,objectWithoutEmpty as L,asyncMemo as T,hasLocationQueryParameter as j,getLocationQueryParameter as k,arrayUnique as F,arrayFilter as R,setAsyncMemo as q,parseBoolean as C,arrayWithout as O,FakeServer as D,mock as z}from"@noeldemartin/utils";import{fetchLoginUserProfile as G,fakeDocumentUrl as N,fakeContainerUrl as W}from"@noeldemartin/solid-utils";import{setEngine as M}from"soukai";import"core-js/modules/esnext.async-iterator.for-each.js";import"core-js/modules/esnext.iterator.for-each.js";import B from"@babel/runtime/helpers/esm/defineProperty";import"core-js/modules/esnext.async-iterator.map.js";import"core-js/modules/esnext.iterator.map.js";import"core-js/modules/esnext.async-iterator.constructor.js";import"core-js/modules/esnext.async-iterator.to-array.js";import"core-js/modules/esnext.iterator.to-array.js";import Y from"virtual:aerogel-solid";import{defineComponent as H,openBlock as J,createElementBlock as K,renderSlot as Q,createVNode as V,unref as X,createCommentVNode as Z,createElementVNode as ee,withCtx as te,createTextVNode as ie,toDisplayString as se,createBlock as re}from"vue";class AuthenticationCancelledError extends w{}class ne extends w{constructor(e,t){super(`Container at ${e.url} is already in use`,t)}}class oe{constructor(){B(this,"name",void 0),B(this,"authenticatedFetch",void 0),B(this,"booted",void 0),B(this,"listeners",S([])),B(this,"_engine",void 0)}get engine(){return this._engine=this._engine??new g(this.requireAuthenticatedFetch()),this._engine}getAuthenticatedFetch(){return this.authenticatedFetch??null}requireAuthenticatedFetch(){return this.authenticatedFetch??b("Authenticated fetch is not ready")}addListener(e){return this.listeners.includes(e)||this.listeners.push(e),()=>{this.removeListener(e)}}removeListener(e){this.listeners.includes(e)&&this.listeners.remove(e)}async boot(){if(this.booted)return this.booted;this.booted=new I,await this.restoreSession(),this.booted.resolve()}async initAuthenticatedFetch(e){this.authenticatedFetch=e,await this.notifyListeners("onAuthenticatedFetchReady",e)}async startSession(e){const t={authenticator:this,...e};return await this.notifyListeners("onSessionStarted",t),t}async failSession(e,t){await this.notifyListeners("onSessionFailed",e,t)}async endSession(){await this.notifyListeners("onSessionEnded")}async notifyListeners(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];await Promise.all(this.listeners.toArray().map((async t=>{const s=t[e];await(s?.(...i))})))}}const ae="inrupt-authenticator";const le={},ue={inrupt:new class extends oe{constructor(){super(...arguments),B(this,"_fetch",void 0),B(this,"_login",void 0),B(this,"_logout",void 0),B(this,"_handleIncomingRedirect",void 0)}async login(e){x.set(ae,!0);const t={oidcIssuer:e};return Y.clientID&&(t.clientId=Y.clientID.client_id,t.clientName=Y.clientID.client_name,t.redirectUrl=Y.clientID.redirect_uris[0]),await this._login(t),await P({seconds:60}),b("Browser should have redirected, but it didn't")}async logout(){await this._logout(),await this.endSession()}async restoreSession(){const{fetch:e,handleIncomingRedirect:t,login:i,logout:s}=await import("./InruptAuthenticator.lazy.hash.esm.js");this._fetch=e,this._login=i,this._logout=s,this._handleIncomingRedirect=t,await this.loginFromRedirect()}async loginFromRedirect(){if(!x.has(ae))return;const e=await this._handleIncomingRedirect(window.location.href);x.remove(ae),e?.isLoggedIn&&e.webId&&await this.initSession(e.webId)}async initSession(e){await this.initAuthenticatedFetch(this._fetch);try{const{default:t}=await Promise.resolve().then((function(){return ve})),i=await t.requireUserProfile(e);await this.startSession({user:i,loginUrl:e})}catch(t){await this.failSession(e,t)}}}};function ce(e){le.default=e}function he(e){return le[e]}function de(e){Object.entries(e).forEach((e=>{let[t,i]=e;return ge(t,i)}))}function ge(e,t){le[e]=t,t.name=t.name??e}var fe=e({name:"solid",persist:["autoReconnect","dismissed","previousSession","profiles","staleProfiles"],initialState:{autoReconnect:!1,dismissed:!1,ignorePreviousSessionError:!1,loginStartupError:null,loginOngoing:!1,preferredAuthenticator:null,previousSession:null,profiles:{},session:null,loginStale:!1,staleProfiles:[]},serialize:e=>(e.previousSession?.error instanceof Error&&(e.previousSession.error=e.previousSession.error.message),e),computed:{user:e=>e.session?.user??e.previousSession?.profile??null,authenticator:e=>e.session?.authenticator??null,fetch(){return this.authenticator?.getAuthenticatedFetch()??globalThis.fetch.bind(globalThis)},error:e=>e.loginStartupError?e.loginStartupError??null:e.ignorePreviousSessionError?null:e.previousSession?.error??null}});class pe extends fe{isLoggedIn(){return!!this.session}wasLoggedIn(){return!!this.previousSession}hasLoggedIn(){return!(!this.session&&!this.previousSession)}requireAuthenticator(){return this.authenticator??b("Could not get authenticator")}requireUser(){return this.user??b("Could not get user profile (are you logged in?)")}requireUserProfile(e){return this.getUserProfile(e,!0)}async getUserProfile(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.profiles[e]??$(await G(e,{fetch:this.fetch,required:t}),(e=>e&&this.rememberProfile(e)))}async refreshUserProfile(){if(!this.isLoggedIn())return;this.setState({profiles:U(this.profiles,[this.user.webId])});const e=await this.requireUserProfile(this.user.webId);this.setState({session:{...this.session,user:e}})}async login(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=n.authenticator??this.preferredAuthenticator??"default",a=n.onError??(e=>t.isMounted()?i.report(e):this.setState({loginStartupError:e}));if(t.development&&"devserver"===e&&(e="http://localhost:3000"),/^https?:\/\//.test(e)||(n.fallbackUrl??=`http://${e}`,e=`https://${e}`),this.isLoggedIn())return!0;if(this.loginOngoing)throw new Error("Authentication already in progress");const l=setTimeout((()=>this.loginStale=!0),1e4),u={dismissed:this.dismissed,ignorePreviousSessionError:this.ignorePreviousSessionError,previousSession:this.previousSession};this.loginOngoing=!0;try{const t=await this.getUserProfile(e),i=t?.oidcIssuerUrl??E(t?.webId??e),n=await this.bootAuthenticator(o),{domain:a}=_(e);return this.setState({dismissed:!1,ignorePreviousSessionError:!0,previousSession:L({profile:t,loginUrl:e,authenticator:o,error:s("auth.stuckConnecting",`We didn't hear back from the identity provider at \`${a}\`, maybe try reconnecting?`)})}),await r.emit("auth:before-login"),await n.login(i),!0}catch(e){return this.setState(u),e instanceof AuthenticationCancelledError?!1:n.fallbackUrl?P().then((()=>this.login(n.fallbackUrl??"",U(n,"fallbackUrl")))):(a(e),!1)}finally{clearTimeout(l),this.setState({loginOngoing:!1,loginStale:!1})}}async reconnect(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{force:t,...i}=e;this.isLoggedIn()||!this.previousSession||null!==this.previousSession.error&&!t||await this.login(this.previousSession.loginUrl,{authenticator:this.previousSession.authenticator,...i})}async logout(){(arguments.length>0&&void 0!==arguments[0]&&arguments[0]||await n.confirm(s("solid.logoutConfirm","Are you sure you want to log out?")))&&this.previousSession&&(this.setState({previousSession:null}),this.isLoggedIn()&&await this.authenticator.logout(),await r.emit("auth:logout"))}async whenLoggedIn(e){return this.isLoggedIn()?e(this.session):new Promise((t=>{r.once("auth:login",(i=>t(e(i))))}))}dismiss(){this.setState({dismissed:!0})}async findOrCreatePrivateTypeIndex(){return await this.findPrivateTypeIndex()??await this.createPrivateTypeIndex()}async findPrivateTypeIndex(){const e=this.requireUser(),t=this.requireAuthenticator().engine;return T(`${e.webId}-privateTypeIndex`,(()=>f.withEngine(t).find(e.privateTypeIndexUrl)))}async findOrCreatePublicTypeIndex(){return await this.findPublicTypeIndex()??await this.createPublicTypeIndex()}async findPublicTypeIndex(){const e=this.requireUser(),t=this.requireAuthenticator().engine;return T(`${e.webId}-publicTypeIndex`,(()=>f.withEngine(t).find(e.publicTypeIndexUrl)))}async createPrivateContainer(e){const t=this.requireAuthenticator().engine;return p.withEngine(t,(async()=>{const t=await p.find(e.url);if(t&&!e.reuseExisting)throw new ne(t);const i=t??new p({url:e.url,name:e.name});if(await i.save(),e.registerFor){const t=await this.findOrCreatePrivateTypeIndex();await i.register(t,e.registerFor)}return i}))}async boot(){await i.booted,j("authenticator")&&this.setState({preferredAuthenticator:k("authenticator")}),j("refreshProfile")&&this.setState({staleProfiles:F(this.staleProfiles.concat(R([this.session?.user.webId,this.previousSession?.loginUrl])))}),await this.restorePreviousSession(),await this.startupReconnect()}async createPrivateTypeIndex(){const e=this.requireUser(),t=this.requireAuthenticator(),i=await f.withEngine(t.engine).createPrivate(e);return $(i,(()=>{e.privateTypeIndexUrl=i.url,q(`${e.webId}-privateTypeIndex`,i),this.rememberProfile(e)}))}async createPublicTypeIndex(){const e=this.requireUser(),t=this.requireAuthenticator(),i=await f.withEngine(t.engine).createPublic(e);return $(i,(()=>{e.privateTypeIndexUrl=i.url,q(`${e.webId}-publicTypeIndex`,i),this.rememberProfile(e)}))}async restorePreviousSession(){this.previousSession&&await this.bootAuthenticator(this.previousSession.authenticator)}async startupReconnect(){this.reconnectOnStartup()&&await this.reconnect()}reconnectOnStartup(){return j("autoReconnect")?C(k("autoReconnect")):this.autoReconnect}async bootAuthenticator(e){const i=he(e);return i.addListener({onSessionStarted:async e=>{this.setState({session:e,previousSession:{authenticator:i.name,loginUrl:e.loginUrl,profile:e.user,error:null}}),(e.user.cloaked||!e.user.writableProfileUrl||this.staleProfiles.includes(e.user.webId))&&await this.refreshUserProfile(),t.plugin("@aerogel/offline-first")||M(e.authenticator.engine),m.setEngine(e.authenticator.engine),f.setEngine(e.authenticator.engine),v.setEngine(e.authenticator.engine),await r.emit("auth:login",e)},onSessionFailed:async(e,t)=>{this.setState({session:null,previousSession:{authenticator:i.name,loginUrl:e,error:t}})},onSessionEnded:()=>this.setState({session:null}),onAuthenticatedFetchReady:e=>r.emit("auth:fetch-ready",e)}),await i.boot(),i}rememberProfile(e){this.setState({profiles:{...this.profiles,[e.webId]:e},staleProfiles:O(this.staleProfiles,e.webId)})}}var me=A(pe),ve=Object.freeze({__proto__:null,SolidService:pe,default:me});const ye={class:"flex flex-col gap-3"},we={class:"flex flex-col"};var Se=H({__name:"AGSolidStatus",setup(e){const t=o({url:a()});return(e,i)=>(J(),K("div",null,[e.$solid.loginStale?Q(e.$slots,"login-stale",{key:0},(()=>[V(X(l),{text:e.$td("solid.loginStale","This is taking too long...")},null,8,["text"])])):Z("v-if",!0),e.$solid.loginOngoing?Q(e.$slots,"login-ongoing",{key:1},(()=>[V(X(l),{text:e.$td("ui.loading","Loading...")},null,8,["text"])])):e.$solid.isLoggedIn()?Q(e.$slots,"logged-in",{key:2,session:e.$solid.session},(()=>[ee("div",ye,[V(X(l),{text:e.$td("solid.loggedIn",{userName:e.$solid.user.name??e.$solid.user.webId,userWebId:e.$solid.user.webId},"You are logged in as [{userName}]({userWebId})")},null,8,["text"]),V(X(u),{onClick:i[0]||(i[0]=t=>e.$solid.logout())},{default:te((()=>[ie(se(e.$td("solid.logout","Logout")),1)])),_:1})])])):Q(e.$slots,"logged-out",{key:3},(()=>[ee("div",we,[V(X(c),{form:X(t),class:"flex",onSubmit:i[1]||(i[1]=i=>e.$solid.login(X(t).url))},{default:te((()=>[V(X(h),{name:"url","aria-label":e.$td("solid.url","Login url"),placeholder:e.$td("solid.placeholder","https://...")},null,8,["aria-label","placeholder"]),V(X(u),{submit:""},{default:te((()=>[ie(se(e.$td("solid.login","Login")),1)])),_:1})])),_:1},8,["form"]),e.$solid.wasLoggedIn()?(J(),re(X(u),{key:0,class:"mt-3",onClick:i[2]||(i[2]=t=>e.$solid.reconnect({force:!0}))},{default:te((()=>[ie(se(e.$td("solid.reconnect","Reconnect")),1)])),_:1})):Z("v-if",!0),e.$solid.previousSession?.error?(J(),re(X(l),{key:1,class:"mt-1 self-center text-sm text-red-800",text:e.$td("solid.previousLoginError","Previous login attempt failed")},null,8,["text"])):Z("v-if",!0)])]))]))}});Se.__file="src/components/AGSolidStatus.vue";class be extends pe{constructor(){super(),B(this,"server",new D);const e=new g(this.server.fetch);this.setState("session",{user:z({privateTypeIndexUrl:N(),storageUrls:[W()]}),authenticator:z({engine:e,requireAuthenticatedFetch:()=>this.server.fetch})}),m.setEngine(e),f.setEngine(e),v.setEngine(e),this.booted.resolve()}}var Ie=A(be);const xe={$solid:me};function Pe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{async install(t){y(),de({...ue,...e.authenticators??{}}),ce(he(e.defaultAuthenticator??"inrupt")),me.hasPersistedState()||(me.autoReconnect=e.autoReconnect??me.autoReconnect),await d(t,xe)}}}export{Se as AGSolidStatus,AuthenticationCancelledError,ne as ContainerAlreadyInUse,me as Solid,Ie as SolidMock,be as SolidMockService,pe as SolidService,ue as authenticators,Pe as default,he as getAuthenticator,ge as registerAuthenticator,de as registerAuthenticators,ce as setDefaultAuthenticator};
2
+ //# sourceMappingURL=aerogel-plugin-solid.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aerogel-plugin-solid.esm.js","sources":["../src/errors/AuthenticationCancelledError.ts","../src/errors/ContainerAlreadyInUse.ts","../src/auth/Authenticator.ts","../src/auth/authenticators/InruptAuthenticator.ts","../src/auth/index.ts","../src/services/Solid.state.ts","../src/services/Solid.ts","../src/components/AGSolidStatus.vue","../src/services/Solid.mock.ts","../src/main.ts"],"sourcesContent":["import { JSError } from '@noeldemartin/utils';\n\nexport default class AuthenticationCancelledError extends JSError {}\n","import { JSError } from '@noeldemartin/utils';\nimport type { JSErrorOptions } from '@noeldemartin/utils';\nimport type { SolidContainer } from 'soukai-solid';\n\nexport default class ContainerAlreadyInUse extends JSError {\n\n constructor(container: SolidContainer, options?: JSErrorOptions) {\n super(`Container at ${container.url} is already in use`, options);\n }\n\n}\n","import { PromisedValue, arr, fail } from '@noeldemartin/utils';\nimport { SolidEngine } from 'soukai-solid';\nimport type { Closure, FluentArray, GetClosureArgs } from '@noeldemartin/utils';\nimport type { Engine } from 'soukai';\nimport type { Fetch } from 'soukai-solid';\nimport type { SolidUserProfile } from '@noeldemartin/solid-utils';\nimport type { ErrorSource } from '@aerogel/core';\n\nimport type { AuthenticatorName } from '@/auth';\n\ntype ListenerEvent = keyof AuthenticatorListener;\ntype ListenerEventPayload<\n Event extends ListenerEvent,\n Callback = AuthenticatorListener[Event]\n> = Callback extends Closure ? GetClosureArgs<Callback> : never;\n\nexport interface AuthSession {\n user: SolidUserProfile;\n loginUrl: string;\n authenticator: Authenticator;\n}\n\nexport interface AuthenticatorListener {\n onSessionStarted?: (session: AuthSession) => Promise<void> | void;\n onSessionFailed?: (loginUrl: string, error: ErrorSource) => Promise<void> | void;\n onSessionEnded?: () => Promise<void> | void;\n onAuthenticatedFetchReady?: (fetch: Fetch) => Promise<void> | void;\n}\n\nexport default abstract class Authenticator {\n\n public name!: AuthenticatorName;\n\n private authenticatedFetch?: Fetch;\n private booted?: PromisedValue<void>;\n private listeners: FluentArray<AuthenticatorListener> = arr<AuthenticatorListener>([]);\n private _engine?: SolidEngine;\n\n public abstract login(loginUrl: string, user?: SolidUserProfile): Promise<AuthSession>;\n\n public abstract logout(): Promise<void>;\n\n public get engine(): Engine {\n this._engine = this._engine ?? new SolidEngine(this.requireAuthenticatedFetch());\n\n return this._engine;\n }\n\n public getAuthenticatedFetch(): Fetch | null {\n return this.authenticatedFetch ?? null;\n }\n\n public requireAuthenticatedFetch(): Fetch {\n return this.authenticatedFetch ?? fail('Authenticated fetch is not ready');\n }\n\n public addListener(listener: AuthenticatorListener): () => void {\n if (!this.listeners.includes(listener)) this.listeners.push(listener);\n\n return () => {\n this.removeListener(listener);\n };\n }\n\n public removeListener(listener: AuthenticatorListener): void {\n if (!this.listeners.includes(listener)) return;\n\n this.listeners.remove(listener);\n }\n\n public async boot(): Promise<void> {\n if (this.booted) {\n return this.booted;\n }\n\n this.booted = new PromisedValue();\n\n await this.restoreSession();\n\n this.booted.resolve();\n }\n\n protected abstract restoreSession(): Promise<void>;\n\n protected async initAuthenticatedFetch(fetch: Fetch): Promise<void> {\n this.authenticatedFetch = fetch;\n\n await this.notifyListeners('onAuthenticatedFetchReady', fetch);\n }\n\n protected async startSession(sessionData: Omit<AuthSession, 'authenticator'>): Promise<AuthSession> {\n const session: AuthSession = {\n authenticator: this,\n ...sessionData,\n };\n\n await this.notifyListeners('onSessionStarted', session);\n\n return session;\n }\n\n protected async failSession(loginUrl: string, error: ErrorSource): Promise<void> {\n await this.notifyListeners('onSessionFailed', loginUrl, error);\n }\n\n protected async endSession(): Promise<void> {\n await this.notifyListeners('onSessionEnded');\n }\n\n protected async notifyListeners<Event extends ListenerEvent>(\n event: Event,\n ...payload: ListenerEventPayload<Event>\n ): Promise<void> {\n await Promise.all(\n this.listeners.toArray().map(async (listener) => {\n const callback = listener[event] as Closure | undefined;\n\n await callback?.(...payload);\n }),\n );\n }\n\n}\n","import { Storage, after, fail } from '@noeldemartin/utils';\nimport type { Fetch } from 'soukai-solid';\nimport type { ILoginInputOptions, handleIncomingRedirect, login, logout } from '@inrupt/solid-client-authn-browser';\n\nimport Authenticator from '@/auth/Authenticator';\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport AerogelSolid from 'virtual:aerogel-solid';\n\nconst STORAGE_KEY = 'inrupt-authenticator';\n\nexport default class InruptAuthenticator extends Authenticator {\n\n private _fetch!: Fetch;\n private _login!: typeof login;\n private _logout!: typeof logout;\n private _handleIncomingRedirect!: typeof handleIncomingRedirect;\n\n public async login(loginUrl: string): Promise<AuthSession> {\n Storage.set<boolean>(STORAGE_KEY, true);\n\n const options: ILoginInputOptions = {\n oidcIssuer: loginUrl,\n };\n\n if (AerogelSolid.clientID) {\n options.clientId = AerogelSolid.clientID.client_id;\n options.clientName = AerogelSolid.clientID.client_name;\n options.redirectUrl = AerogelSolid.clientID.redirect_uris[0];\n }\n\n await this._login(options);\n\n // Browser should redirect, so just make it wait for a while.\n await after({ seconds: 60 });\n\n return fail('Browser should have redirected, but it didn\\'t');\n }\n\n public async logout(): Promise<void> {\n await this._logout();\n await this.endSession();\n }\n\n protected async restoreSession(): Promise<void> {\n const { fetch, handleIncomingRedirect, login, logout } = await import('./InruptAuthenticator.lazy');\n\n this._fetch = fetch;\n this._login = login;\n this._logout = logout;\n this._handleIncomingRedirect = handleIncomingRedirect;\n\n await this.loginFromRedirect();\n }\n\n protected async loginFromRedirect(): Promise<void> {\n if (!Storage.has(STORAGE_KEY)) {\n return;\n }\n\n const session = await this._handleIncomingRedirect(window.location.href);\n\n Storage.remove(STORAGE_KEY);\n\n if (session?.isLoggedIn && session.webId) {\n await this.initSession(session.webId);\n }\n }\n\n protected async initSession(webId: string): Promise<void> {\n await this.initAuthenticatedFetch(this._fetch);\n\n try {\n const { default: Solid } = await import('@/services/Solid');\n const user = await Solid.requireUserProfile(webId);\n\n await this.startSession({ user, loginUrl: webId });\n } catch (error) {\n await this.failSession(webId, error);\n }\n }\n\n}\n","import InruptAuthenticator from './authenticators/InruptAuthenticator';\nimport type Authenticator from './Authenticator';\n\nconst _authenticators = {} as Authenticators;\n\ntype BaseAuthenticators = typeof authenticators;\n\nexport * from './Authenticator';\nexport { Authenticator };\n\nexport const authenticators = {\n inrupt: new InruptAuthenticator(),\n};\n\nexport function setDefaultAuthenticator(authenticator: Authenticator): void {\n _authenticators.default = authenticator;\n}\n\nexport function getAuthenticator<T extends AuthenticatorName>(name: T): Authenticators[T] {\n return _authenticators[name];\n}\n\nexport function registerAuthenticators(customAuthenticators: Record<string, Authenticator>): void {\n Object.entries(customAuthenticators).forEach(([name, authenticator]) =>\n registerAuthenticator(name as AuthenticatorName, authenticator));\n}\n\nexport function registerAuthenticator<T extends AuthenticatorName>(name: T, authenticator: Authenticators[T]): void {\n _authenticators[name] = authenticator;\n\n authenticator.name = authenticator.name ?? name;\n}\n\nexport type AuthenticatorName = keyof Authenticators;\n\nexport interface Authenticators extends BaseAuthenticators {\n default: Authenticator;\n}\n","import { defineServiceState } from '@aerogel/core';\nimport type { ErrorSource } from '@aerogel/core';\nimport type { Fetch, SolidUserProfile } from '@noeldemartin/solid-utils';\n\nimport type { AuthSession } from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\n\nexport default defineServiceState({\n name: 'solid',\n persist: ['autoReconnect', 'dismissed', 'previousSession', 'profiles', 'staleProfiles'],\n initialState: {\n autoReconnect: false,\n dismissed: false,\n ignorePreviousSessionError: false,\n loginStartupError: null as ErrorSource | null,\n loginOngoing: false,\n preferredAuthenticator: null as AuthenticatorName | null,\n previousSession: null as {\n profile?: SolidUserProfile;\n authenticator: AuthenticatorName;\n loginUrl: string;\n error: ErrorSource | null;\n } | null,\n profiles: {} as Record<string, SolidUserProfile>,\n session: null as AuthSession | null,\n loginStale: false,\n staleProfiles: [] as string[],\n },\n serialize(state) {\n if (state.previousSession?.error instanceof Error) {\n state.previousSession.error = state.previousSession.error.message;\n }\n\n return state;\n },\n computed: {\n user: (state) => state.session?.user ?? state.previousSession?.profile ?? null,\n authenticator: (state) => state.session?.authenticator ?? null,\n fetch(): Fetch {\n return this.authenticator?.getAuthenticatedFetch() ?? globalThis.fetch.bind(globalThis);\n },\n error(state): ErrorSource | null {\n if (state.loginStartupError) {\n return state.loginStartupError ?? null;\n }\n\n if (state.ignorePreviousSessionError) {\n return null;\n }\n\n return state.previousSession?.error ?? null;\n },\n },\n});\n","import {\n after,\n arrayFilter,\n arrayUnique,\n arrayWithout,\n asyncMemo,\n facade,\n fail,\n getLocationQueryParameter,\n hasLocationQueryParameter,\n objectWithout,\n objectWithoutEmpty,\n parseBoolean,\n requireUrlParse,\n setAsyncMemo,\n tap,\n urlRoot,\n} from '@noeldemartin/utils';\nimport { App, Errors, Events, UI, translateWithDefault } from '@aerogel/core';\nimport { fetchLoginUserProfile } from '@noeldemartin/solid-utils';\nimport { setEngine } from 'soukai';\nimport { SolidACLAuthorization, SolidContainer, SolidDocument, SolidTypeIndex } from 'soukai-solid';\nimport type { ErrorSource } from '@aerogel/core';\nimport type { Fetch, SolidModelConstructor } from 'soukai-solid';\nimport type { SolidUserProfile } from '@noeldemartin/solid-utils';\n\nimport AuthenticationCancelledError from '@/errors/AuthenticationCancelledError';\nimport { ContainerAlreadyInUse } from '@/errors';\nimport { getAuthenticator } from '@/auth';\nimport type Authenticator from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport Service from './Solid.state';\n\nexport type LoginOptions = {\n authenticator?: AuthenticatorName;\n onError?(error: ErrorSource): unknown;\n fallbackUrl?: string;\n};\n\nexport type ReconnectOptions = Omit<LoginOptions, 'authenticator'> & {\n force?: boolean;\n};\n\nexport class SolidService extends Service {\n\n public isLoggedIn(): this is { session: AuthSession; user: SolidUserProfile; authenticator: Authenticator } {\n return !!this.session;\n }\n\n public wasLoggedIn(): this is { user: SolidUserProfile } {\n return !!this.previousSession;\n }\n\n public hasLoggedIn(): this is { user: SolidUserProfile } {\n return !!(this.session || this.previousSession);\n }\n\n public requireAuthenticator(): Authenticator {\n return this.authenticator ?? fail('Could not get authenticator');\n }\n\n public requireUser(): SolidUserProfile {\n return this.user ?? fail('Could not get user profile (are you logged in?)');\n }\n\n public requireUserProfile(url: string): Promise<SolidUserProfile> {\n return this.getUserProfile(url, true);\n }\n\n public async getUserProfile(url: string, required: true): Promise<SolidUserProfile>;\n public async getUserProfile(url: string, required?: false): Promise<SolidUserProfile | null>;\n public async getUserProfile(url: string, required: boolean = false): Promise<SolidUserProfile | null> {\n return (\n this.profiles[url] ??\n tap(\n await fetchLoginUserProfile(url, {\n fetch: this.fetch,\n required,\n }),\n (profile) => profile && this.rememberProfile(profile),\n )\n );\n }\n\n public async refreshUserProfile(): Promise<void> {\n if (!this.isLoggedIn()) {\n return;\n }\n\n this.setState({ profiles: objectWithout(this.profiles, [this.user.webId]) });\n\n const user = await this.requireUserProfile(this.user.webId);\n\n this.setState({\n session: {\n ...this.session,\n user,\n },\n });\n }\n\n public async login(loginUrl: string, options: LoginOptions = {}): Promise<boolean> {\n const authenticatorName = options.authenticator ?? this.preferredAuthenticator ?? 'default';\n const handleLoginError =\n options.onError ??\n ((error: ErrorSource) =>\n App.isMounted() ? Errors.report(error) : this.setState({ loginStartupError: error }));\n\n if (App.development && loginUrl === 'devserver') {\n loginUrl = 'http://localhost:3000';\n }\n\n if (!/^https?:\\/\\//.test(loginUrl)) {\n options.fallbackUrl ??= `http://${loginUrl}`;\n loginUrl = `https://${loginUrl}`;\n }\n\n if (this.isLoggedIn()) {\n return true;\n }\n\n if (this.loginOngoing) {\n throw new Error('Authentication already in progress');\n }\n\n const staleTimeout = setTimeout(() => (this.loginStale = true), 10000);\n const initialState = {\n dismissed: this.dismissed,\n ignorePreviousSessionError: this.ignorePreviousSessionError,\n previousSession: this.previousSession,\n };\n this.loginOngoing = true;\n\n try {\n const profile = await this.getUserProfile(loginUrl);\n const oidcIssuerUrl = profile?.oidcIssuerUrl ?? urlRoot(profile?.webId ?? loginUrl);\n const authenticator = await this.bootAuthenticator(authenticatorName);\n const { domain: loginDomain } = requireUrlParse(loginUrl);\n\n this.setState({\n dismissed: false,\n ignorePreviousSessionError: true,\n previousSession: objectWithoutEmpty({\n profile,\n loginUrl,\n authenticator: authenticatorName,\n error: translateWithDefault(\n 'auth.stuckConnecting',\n `We didn't hear back from the identity provider at \\`${loginDomain}\\`, maybe try reconnecting?`,\n ),\n }),\n });\n\n await Events.emit('auth:before-login');\n\n // This should redirect away from the app, so in most cases\n // the rest of the code won't be reached.\n await authenticator.login(oidcIssuerUrl);\n\n return true;\n } catch (error) {\n this.setState(initialState);\n\n if (error instanceof AuthenticationCancelledError) {\n return false;\n }\n\n if (options.fallbackUrl) {\n return after().then(() => this.login(options.fallbackUrl ?? '', objectWithout(options, 'fallbackUrl')));\n }\n\n handleLoginError(error);\n\n return false;\n } finally {\n clearTimeout(staleTimeout);\n\n this.setState({\n loginOngoing: false,\n loginStale: false,\n });\n }\n }\n\n public async reconnect(options: ReconnectOptions = {}): Promise<void> {\n const { force, ...loginOptions } = options;\n if (this.isLoggedIn() || !this.previousSession || (this.previousSession.error !== null && !force)) {\n return;\n }\n\n await this.login(this.previousSession.loginUrl, {\n authenticator: this.previousSession.authenticator,\n ...loginOptions,\n });\n }\n\n public async logout(force: boolean = false): Promise<void> {\n const confirmLogout =\n force ||\n (await UI.confirm(translateWithDefault('solid.logoutConfirm', 'Are you sure you want to log out?')));\n\n if (!confirmLogout) {\n return;\n }\n\n if (!this.previousSession) {\n return;\n }\n\n this.setState({ previousSession: null });\n this.isLoggedIn() && (await this.authenticator.logout());\n\n await Events.emit('auth:logout');\n }\n\n public async whenLoggedIn<T>(callback: (session: AuthSession) => T): Promise<T> {\n if (this.isLoggedIn()) {\n return callback(this.session);\n }\n\n return new Promise((resolve) => {\n const onLogin = (session: AuthSession) => resolve(callback(session));\n\n Events.once('auth:login', onLogin);\n });\n }\n\n public dismiss(): void {\n this.setState({ dismissed: true });\n }\n\n public async findOrCreatePrivateTypeIndex(): Promise<SolidTypeIndex> {\n return (await this.findPrivateTypeIndex()) ?? (await this.createPrivateTypeIndex());\n }\n\n public async findPrivateTypeIndex(): Promise<SolidTypeIndex | null> {\n const user = this.requireUser();\n const engine = this.requireAuthenticator().engine;\n\n return asyncMemo(`${user.webId}-privateTypeIndex`, () =>\n SolidTypeIndex.withEngine(engine).find(user.privateTypeIndexUrl));\n }\n\n public async findOrCreatePublicTypeIndex(): Promise<SolidTypeIndex> {\n return (await this.findPublicTypeIndex()) ?? (await this.createPublicTypeIndex());\n }\n\n protected async findPublicTypeIndex(): Promise<SolidTypeIndex | null> {\n const user = this.requireUser();\n const engine = this.requireAuthenticator().engine;\n\n return asyncMemo(`${user.webId}-publicTypeIndex`, () =>\n SolidTypeIndex.withEngine(engine).find(user.publicTypeIndexUrl));\n }\n\n public async createPrivateContainer(options: {\n url: string;\n name?: string;\n registerFor?: SolidModelConstructor;\n reuseExisting?: boolean;\n }): Promise<SolidContainer> {\n const engine = this.requireAuthenticator().engine;\n\n return SolidContainer.withEngine(engine, async () => {\n const existingContainer = await SolidContainer.find(options.url);\n\n if (existingContainer && !options.reuseExisting) {\n throw new ContainerAlreadyInUse(existingContainer);\n }\n\n const container = existingContainer ?? new SolidContainer({ url: options.url, name: options.name });\n\n await container.save();\n\n if (options.registerFor) {\n const typeIndex = await this.findOrCreatePrivateTypeIndex();\n\n await container.register(typeIndex, options.registerFor);\n }\n\n return container;\n });\n }\n\n protected async boot(): Promise<void> {\n await Errors.booted;\n\n if (hasLocationQueryParameter('authenticator')) {\n this.setState({\n preferredAuthenticator: getLocationQueryParameter('authenticator') as AuthenticatorName,\n });\n }\n\n if (hasLocationQueryParameter('refreshProfile')) {\n this.setState({\n staleProfiles: arrayUnique(\n this.staleProfiles.concat(arrayFilter([this.session?.user.webId, this.previousSession?.loginUrl])),\n ),\n });\n }\n\n await this.restorePreviousSession();\n await this.startupReconnect();\n }\n\n protected async createPrivateTypeIndex(): Promise<SolidTypeIndex> {\n const user = this.requireUser();\n const authenticator = this.requireAuthenticator();\n const typeIndex = await SolidTypeIndex.withEngine(authenticator.engine).createPrivate(user);\n\n return tap(typeIndex, () => {\n user.privateTypeIndexUrl = typeIndex.url;\n\n setAsyncMemo(`${user.webId}-privateTypeIndex`, typeIndex);\n\n this.rememberProfile(user);\n });\n }\n\n public async createPublicTypeIndex(): Promise<SolidTypeIndex> {\n const user = this.requireUser();\n const authenticator = this.requireAuthenticator();\n const typeIndex = await SolidTypeIndex.withEngine(authenticator.engine).createPublic(user);\n\n return tap(typeIndex, () => {\n user.privateTypeIndexUrl = typeIndex.url;\n\n setAsyncMemo(`${user.webId}-publicTypeIndex`, typeIndex);\n\n this.rememberProfile(user);\n });\n }\n\n private async restorePreviousSession(): Promise<void> {\n if (!this.previousSession) {\n return;\n }\n\n await this.bootAuthenticator(this.previousSession.authenticator);\n }\n\n private async startupReconnect(): Promise<void> {\n if (!this.reconnectOnStartup()) {\n return;\n }\n\n await this.reconnect();\n }\n\n private reconnectOnStartup(): boolean {\n if (hasLocationQueryParameter('autoReconnect')) {\n return parseBoolean(getLocationQueryParameter('autoReconnect'));\n }\n\n return this.autoReconnect;\n }\n\n private async bootAuthenticator(name: AuthenticatorName): Promise<Authenticator> {\n const authenticator = getAuthenticator(name);\n\n authenticator.addListener({\n onSessionStarted: async (session) => {\n this.setState({\n session,\n previousSession: {\n authenticator: authenticator.name,\n loginUrl: session.loginUrl,\n profile: session.user,\n error: null,\n },\n });\n\n if (\n session.user.cloaked ||\n !session.user.writableProfileUrl ||\n this.staleProfiles.includes(session.user.webId)\n ) {\n await this.refreshUserProfile();\n }\n\n App.plugin('@aerogel/offline-first') || setEngine(session.authenticator.engine);\n\n SolidACLAuthorization.setEngine(session.authenticator.engine);\n SolidTypeIndex.setEngine(session.authenticator.engine);\n SolidDocument.setEngine(session.authenticator.engine);\n\n await Events.emit('auth:login', session);\n },\n onSessionFailed: async (loginUrl, error) => {\n this.setState({\n session: null,\n previousSession: {\n authenticator: authenticator.name,\n loginUrl,\n error,\n },\n });\n },\n onSessionEnded: () => this.setState({ session: null }),\n onAuthenticatedFetchReady: (fetch) => Events.emit('auth:fetch-ready', fetch),\n });\n\n await authenticator.boot();\n\n return authenticator;\n }\n\n private rememberProfile(profile: SolidUserProfile): void {\n this.setState({\n profiles: {\n ...this.profiles,\n [profile.webId]: profile,\n },\n staleProfiles: arrayWithout(this.staleProfiles, profile.webId),\n });\n }\n\n}\n\nexport default facade(SolidService);\n\ndeclare module '@aerogel/core' {\n export interface EventsPayload {\n 'auth:fetch-ready': Fetch;\n 'auth:before-login': void;\n 'auth:login': AuthSession;\n 'auth:logout': void;\n }\n}\n","<template>\n <div>\n <slot v-if=\"$solid.loginStale\" name=\"login-stale\">\n <AGMarkdown :text=\"$td('solid.loginStale', 'This is taking too long...')\" />\n </slot>\n\n <slot v-if=\"$solid.loginOngoing\" name=\"login-ongoing\">\n <AGMarkdown :text=\"$td('ui.loading', 'Loading...')\" />\n </slot>\n\n <slot v-else-if=\"$solid.isLoggedIn()\" name=\"logged-in\" :session=\"$solid.session\">\n <div class=\"flex flex-col gap-3\">\n <AGMarkdown\n :text=\"\n $td(\n 'solid.loggedIn',\n {\n userName: $solid.user.name ?? $solid.user.webId,\n userWebId: $solid.user.webId,\n },\n 'You are logged in as [{userName}]({userWebId})'\n )\n \"\n />\n <AGButton @click=\"$solid.logout()\">\n {{ $td('solid.logout', 'Logout') }}\n </AGButton>\n </div>\n </slot>\n\n <slot v-else name=\"logged-out\">\n <div class=\"flex flex-col\">\n <AGForm :form=\"form\" class=\"flex\" @submit=\"$solid.login(form.url)\">\n <AGInput\n name=\"url\"\n :aria-label=\"$td('solid.url', 'Login url')\"\n :placeholder=\"$td('solid.placeholder', 'https://...')\"\n />\n <AGButton submit>\n {{ $td('solid.login', 'Login') }}\n </AGButton>\n </AGForm>\n <AGButton v-if=\"$solid.wasLoggedIn()\" class=\"mt-3\" @click=\"$solid.reconnect({ force: true })\">\n {{ $td('solid.reconnect', 'Reconnect') }}\n </AGButton>\n <AGMarkdown\n v-if=\"$solid.previousSession?.error\"\n class=\"mt-1 self-center text-sm text-red-800\"\n :text=\"$td('solid.previousLoginError', 'Previous login attempt failed')\"\n />\n </div>\n </slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { AGButton, AGForm, AGInput, AGMarkdown, requiredStringInput, useForm } from '@aerogel/core';\n\nconst form = useForm({ url: requiredStringInput() });\n</script>\n","import { fakeContainerUrl, fakeDocumentUrl } from '@noeldemartin/solid-utils';\nimport { FakeServer, facade, mock } from '@noeldemartin/utils';\nimport { SolidACLAuthorization, SolidDocument, SolidEngine, SolidTypeIndex } from 'soukai-solid';\n\nimport type { AuthSession } from '@/auth/Authenticator';\n\nimport { SolidService } from './Solid';\n\nexport class SolidMockService extends SolidService {\n\n public readonly server: FakeServer = new FakeServer();\n\n constructor() {\n super();\n\n const engine = new SolidEngine(this.server.fetch);\n\n this.setState('session', {\n user: mock({\n privateTypeIndexUrl: fakeDocumentUrl(),\n storageUrls: [fakeContainerUrl()],\n }),\n authenticator: mock({\n engine,\n requireAuthenticatedFetch: () => this.server.fetch,\n }),\n } as unknown as AuthSession);\n\n SolidACLAuthorization.setEngine(engine);\n SolidTypeIndex.setEngine(engine);\n SolidDocument.setEngine(engine);\n\n this.booted.resolve();\n }\n\n}\n\nexport default facade(SolidMockService);\n","import { bootServices } from '@aerogel/core';\nimport { bootSolidModels } from 'soukai-solid';\nimport type { Plugin } from '@aerogel/core';\n\nimport Solid from '@/services/Solid';\nimport {\n authenticators as baseAuthenticators,\n getAuthenticator,\n registerAuthenticators,\n setDefaultAuthenticator,\n} from '@/auth';\nimport type Authenticator from '@/auth/Authenticator';\nimport type { AuthenticatorName } from '@/auth';\n\nconst services = { $solid: Solid };\n\nexport * from './auth';\nexport * from './components';\nexport * from './errors';\nexport * from './services/Solid';\nexport * from './services/Solid.mock';\nexport { Solid };\nexport { default as SolidMock } from './services/Solid.mock';\n\nexport interface Options {\n autoReconnect?: boolean;\n authenticators?: Record<string, Authenticator>;\n defaultAuthenticator?: AuthenticatorName;\n}\n\nexport type SolidServices = typeof services;\n\nexport default function solid(options: Options = {}): Plugin {\n return {\n async install(app) {\n bootSolidModels();\n registerAuthenticators({ ...baseAuthenticators, ...(options.authenticators ?? {}) });\n setDefaultAuthenticator(getAuthenticator(options.defaultAuthenticator ?? 'inrupt'));\n\n if (!Solid.hasPersistedState()) {\n Solid.autoReconnect = options.autoReconnect ?? Solid.autoReconnect;\n }\n\n await bootServices(app, services);\n },\n };\n}\n\ndeclare module '@vue/runtime-core' {\n interface ComponentCustomProperties extends SolidServices {}\n}\n"],"names":["AuthenticationCancelledError","JSError","ContainerAlreadyInUse","constructor","container","options","super","url","Authenticator","_defineProperty","this","arr","engine","_engine","SolidEngine","requireAuthenticatedFetch","getAuthenticatedFetch","authenticatedFetch","fail","addListener","listener","listeners","includes","push","removeListener","remove","boot","booted","PromisedValue","restoreSession","resolve","initAuthenticatedFetch","fetch","notifyListeners","startSession","sessionData","session","authenticator","failSession","loginUrl","error","endSession","event","_len","arguments","length","payload","Array","_key","Promise","all","toArray","map","async","callback","STORAGE_KEY","_authenticators","authenticators","inrupt","login","Storage","set","oidcIssuer","AerogelSolid","clientID","clientId","client_id","clientName","client_name","redirectUrl","redirect_uris","_login","after","seconds","logout","_logout","handleIncomingRedirect","import","_fetch","_handleIncomingRedirect","loginFromRedirect","has","window","location","href","isLoggedIn","webId","initSession","default","Solid","then","Solid$1","user","requireUserProfile","setDefaultAuthenticator","getAuthenticator","name","registerAuthenticators","customAuthenticators","Object","entries","forEach","_ref","registerAuthenticator","Service","defineServiceState","persist","initialState","autoReconnect","dismissed","ignorePreviousSessionError","loginStartupError","loginOngoing","preferredAuthenticator","previousSession","profiles","loginStale","staleProfiles","serialize","state","Error","message","computed","profile","globalThis","bind","SolidService","wasLoggedIn","hasLoggedIn","requireAuthenticator","requireUser","getUserProfile","required","tap","fetchLoginUserProfile","rememberProfile","refreshUserProfile","setState","objectWithout","authenticatorName","handleLoginError","onError","App","isMounted","Errors","report","development","test","fallbackUrl","staleTimeout","setTimeout","oidcIssuerUrl","urlRoot","bootAuthenticator","domain","loginDomain","requireUrlParse","objectWithoutEmpty","translateWithDefault","Events","emit","clearTimeout","reconnect","undefined","force","loginOptions","UI","confirm","whenLoggedIn","once","dismiss","findOrCreatePrivateTypeIndex","findPrivateTypeIndex","createPrivateTypeIndex","asyncMemo","SolidTypeIndex","withEngine","find","privateTypeIndexUrl","findOrCreatePublicTypeIndex","findPublicTypeIndex","createPublicTypeIndex","publicTypeIndexUrl","createPrivateContainer","SolidContainer","existingContainer","reuseExisting","save","registerFor","typeIndex","register","hasLocationQueryParameter","getLocationQueryParameter","arrayUnique","concat","arrayFilter","restorePreviousSession","startupReconnect","createPrivate","setAsyncMemo","createPublic","reconnectOnStartup","parseBoolean","onSessionStarted","cloaked","writableProfileUrl","plugin","setEngine","SolidACLAuthorization","SolidDocument","onSessionFailed","onSessionEnded","onAuthenticatedFetchReady","arrayWithout","facade","form","useForm","requiredStringInput","SolidMockService","FakeServer","server","mock","fakeDocumentUrl","storageUrls","fakeContainerUrl","services","$solid","solid","install","app","bootSolidModels","baseAuthenticators","def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