solid-logic 4.0.8-3 → 5.0.0
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.
- package/README.md +4 -3
- package/dist/2729812e0bfc062ee77a.js +1 -0
- package/dist/a9c30b64ceaae48b72f0.js +2045 -0
- package/dist/acl/aclLogic.d.ts +5 -0
- package/dist/acl/aclLogic.d.ts.map +1 -0
- package/dist/authSession/authSession.d.ts +42 -0
- package/dist/authSession/authSession.d.ts.map +1 -0
- package/dist/authSession/events.d.ts +24 -0
- package/dist/authSession/events.d.ts.map +1 -0
- package/dist/authSession/issuer.d.ts +8 -0
- package/dist/authSession/issuer.d.ts.map +1 -0
- package/dist/authSession/session.d.ts +45 -0
- package/dist/authSession/session.d.ts.map +1 -0
- package/dist/authn/SolidAuthnLogic.d.ts +42 -0
- package/dist/authn/SolidAuthnLogic.d.ts.map +1 -0
- package/dist/authn/authUtil.d.ts +17 -0
- package/dist/authn/authUtil.d.ts.map +1 -0
- package/dist/authn/serverLogout.d.ts +6 -0
- package/dist/authn/serverLogout.d.ts.map +1 -0
- package/dist/chat/chatLogic.d.ts +3 -0
- package/dist/chat/chatLogic.d.ts.map +1 -0
- package/dist/inbox/inboxLogic.d.ts +3 -0
- package/dist/inbox/inboxLogic.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/issuer/issuerLogic.d.ts +8 -0
- package/dist/issuer/issuerLogic.d.ts.map +1 -0
- package/dist/logic/CustomError.d.ts +21 -0
- package/dist/logic/CustomError.d.ts.map +1 -0
- package/dist/logic/solidLogic.d.ts +6 -0
- package/dist/logic/solidLogic.d.ts.map +1 -0
- package/dist/logic/solidLogicSingleton.d.ts +4 -0
- package/dist/logic/solidLogicSingleton.d.ts.map +1 -0
- package/dist/profile/profileAclDocuments.d.ts +2 -0
- package/dist/profile/profileAclDocuments.d.ts.map +1 -0
- package/dist/profile/profileDocuments.d.ts +2 -0
- package/dist/profile/profileDocuments.d.ts.map +1 -0
- package/dist/profile/profileLogic.d.ts +3 -0
- package/dist/profile/profileLogic.d.ts.map +1 -0
- package/dist/solid-logic.esm.js +2358 -0
- package/dist/solid-logic.esm.js.map +1 -0
- package/dist/solid-logic.esm.min.js +2 -0
- package/dist/solid-logic.esm.min.js.map +1 -0
- package/dist/solid-logic.js +7548 -0
- package/dist/solid-logic.js.map +1 -0
- package/dist/solid-logic.min.js +2 -0
- package/dist/solid-logic.min.js.map +1 -0
- package/dist/typeIndex/typeIndexAclDocuments.d.ts +2 -0
- package/dist/typeIndex/typeIndexAclDocuments.d.ts.map +1 -0
- package/dist/typeIndex/typeIndexDocuments.d.ts +3 -0
- package/dist/typeIndex/typeIndexDocuments.d.ts.map +1 -0
- package/dist/typeIndex/typeIndexLogic.d.ts +3 -0
- package/dist/typeIndex/typeIndexLogic.d.ts.map +1 -0
- package/dist/types.d.ts +113 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/util/containerLogic.d.ts +11 -0
- package/dist/util/containerLogic.d.ts.map +1 -0
- package/dist/util/debug.d.ts +5 -0
- package/dist/util/debug.d.ts.map +1 -0
- package/dist/util/ns.d.ts +2 -0
- package/dist/util/ns.d.ts.map +1 -0
- package/dist/util/utilityLogic.d.ts +17 -0
- package/dist/util/utilityLogic.d.ts.map +1 -0
- package/dist/util/utils.d.ts +8 -0
- package/dist/util/utils.d.ts.map +1 -0
- package/package.json +33 -27
- package/dist/_virtual/_rolldown/runtime.cjs.js +0 -1
- package/dist/acl/aclLogic.cjs.js +0 -2
- package/dist/acl/aclLogic.cjs.js.map +0 -1
- package/dist/acl/aclLogic.esm.js +0 -56
- package/dist/acl/aclLogic.esm.js.map +0 -1
- package/dist/authSession/authSession.cjs.js +0 -2
- package/dist/authSession/authSession.cjs.js.map +0 -1
- package/dist/authSession/authSession.esm.js +0 -22
- package/dist/authSession/authSession.esm.js.map +0 -1
- package/dist/authSession/events.cjs.js +0 -2
- package/dist/authSession/events.cjs.js.map +0 -1
- package/dist/authSession/events.esm.js +0 -19
- package/dist/authSession/events.esm.js.map +0 -1
- package/dist/authSession/issuer.cjs.js +0 -2
- package/dist/authSession/issuer.cjs.js.map +0 -1
- package/dist/authSession/issuer.esm.js +0 -18
- package/dist/authSession/issuer.esm.js.map +0 -1
- package/dist/authSession/session.cjs.js +0 -2
- package/dist/authSession/session.cjs.js.map +0 -1
- package/dist/authSession/session.esm.js +0 -102
- package/dist/authSession/session.esm.js.map +0 -1
- package/dist/authn/SolidAuthnLogic.cjs.js +0 -2
- package/dist/authn/SolidAuthnLogic.cjs.js.map +0 -1
- package/dist/authn/SolidAuthnLogic.esm.js +0 -116
- package/dist/authn/SolidAuthnLogic.esm.js.map +0 -1
- package/dist/authn/authUtil.cjs.js +0 -2
- package/dist/authn/authUtil.cjs.js.map +0 -1
- package/dist/authn/authUtil.esm.js +0 -33
- package/dist/authn/authUtil.esm.js.map +0 -1
- package/dist/authn/serverLogout.cjs.js +0 -2
- package/dist/authn/serverLogout.cjs.js.map +0 -1
- package/dist/authn/serverLogout.esm.js +0 -25
- package/dist/authn/serverLogout.esm.js.map +0 -1
- package/dist/chat/chatLogic.cjs.js +0 -21
- package/dist/chat/chatLogic.cjs.js.map +0 -1
- package/dist/chat/chatLogic.esm.js +0 -116
- package/dist/chat/chatLogic.esm.js.map +0 -1
- package/dist/inbox/inboxLogic.cjs.js +0 -2
- package/dist/inbox/inboxLogic.cjs.js.map +0 -1
- package/dist/inbox/inboxLogic.esm.js +0 -37
- package/dist/inbox/inboxLogic.esm.js.map +0 -1
- package/dist/index.cjs.js +0 -2
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.js +0 -13
- package/dist/index.esm.js.map +0 -1
- package/dist/issuer/issuerLogic.cjs.js +0 -2
- package/dist/issuer/issuerLogic.cjs.js.map +0 -1
- package/dist/issuer/issuerLogic.esm.js +0 -30
- package/dist/issuer/issuerLogic.esm.js.map +0 -1
- package/dist/logic/CustomError.cjs.js +0 -2
- package/dist/logic/CustomError.cjs.js.map +0 -1
- package/dist/logic/CustomError.esm.js +0 -14
- package/dist/logic/CustomError.esm.js.map +0 -1
- package/dist/logic/solidLogic.cjs.js +0 -2
- package/dist/logic/solidLogic.cjs.js.map +0 -1
- package/dist/logic/solidLogic.esm.js +0 -47
- package/dist/logic/solidLogic.esm.js.map +0 -1
- package/dist/logic/solidLogicSingleton.cjs.js +0 -2
- package/dist/logic/solidLogicSingleton.cjs.js.map +0 -1
- package/dist/logic/solidLogicSingleton.esm.js +0 -19
- package/dist/logic/solidLogicSingleton.esm.js.map +0 -1
- package/dist/profile/profileAclDocuments.cjs.js +0 -3
- package/dist/profile/profileAclDocuments.cjs.js.map +0 -1
- package/dist/profile/profileAclDocuments.esm.js +0 -17
- package/dist/profile/profileAclDocuments.esm.js.map +0 -1
- package/dist/profile/profileDocuments.cjs.js +0 -3
- package/dist/profile/profileDocuments.cjs.js.map +0 -1
- package/dist/profile/profileDocuments.esm.js +0 -15
- package/dist/profile/profileDocuments.esm.js.map +0 -1
- package/dist/profile/profileLogic.cjs.js +0 -2
- package/dist/profile/profileLogic.cjs.js.map +0 -1
- package/dist/profile/profileLogic.esm.js +0 -184
- package/dist/profile/profileLogic.esm.js.map +0 -1
- package/dist/typeIndex/typeIndexAclDocuments.cjs.js +0 -3
- package/dist/typeIndex/typeIndexAclDocuments.cjs.js.map +0 -1
- package/dist/typeIndex/typeIndexAclDocuments.esm.js +0 -35
- package/dist/typeIndex/typeIndexAclDocuments.esm.js.map +0 -1
- package/dist/typeIndex/typeIndexDocuments.cjs.js +0 -4
- package/dist/typeIndex/typeIndexDocuments.cjs.js.map +0 -1
- package/dist/typeIndex/typeIndexDocuments.esm.js +0 -21
- package/dist/typeIndex/typeIndexDocuments.esm.js.map +0 -1
- package/dist/typeIndex/typeIndexLogic.cjs.js +0 -2
- package/dist/typeIndex/typeIndexLogic.cjs.js.map +0 -1
- package/dist/typeIndex/typeIndexLogic.esm.js +0 -185
- package/dist/typeIndex/typeIndexLogic.esm.js.map +0 -1
- package/dist/util/containerLogic.cjs.js +0 -2
- package/dist/util/containerLogic.cjs.js.map +0 -1
- package/dist/util/containerLogic.esm.js +0 -37
- package/dist/util/containerLogic.esm.js.map +0 -1
- package/dist/util/debug.cjs.js +0 -2
- package/dist/util/debug.cjs.js.map +0 -1
- package/dist/util/debug.esm.js +0 -11
- package/dist/util/debug.esm.js.map +0 -1
- package/dist/util/ns.cjs.js +0 -2
- package/dist/util/ns.cjs.js.map +0 -1
- package/dist/util/ns.esm.js +0 -8
- package/dist/util/ns.esm.js.map +0 -1
- package/dist/util/utilityLogic.cjs.js +0 -6
- package/dist/util/utilityLogic.cjs.js.map +0 -1
- package/dist/util/utilityLogic.esm.js +0 -149
- package/dist/util/utilityLogic.esm.js.map +0 -1
- package/dist/util/utils.cjs.js +0 -2
- package/dist/util/utils.cjs.js.map +0 -1
- package/dist/util/utils.esm.js +0 -22
- package/dist/util/utils.esm.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solid-logic.esm.min.js","mappings":"0JAeA,MAAAA,EAAA,CACAC,IAAA,iCACAC,IAAA,gCACAC,GAAA,yCACAC,SAAA,sCACAC,IAAA,sCACAC,IAAA,0DACAC,KAAA,kCACAC,QAAA,8CACAC,GAAA,mCACAC,IAAA,4BACAC,KAAA,gCACAC,KAAA,6BACAC,IAAA,2CACAC,IAAA,gCACAC,GAAA,oCACAC,KAAA,mCACAC,MAAA,oCACAC,OAAA,yCACAC,IAAA,4BACAC,KAAA,mCACAC,IAAA,sCACAC,QAAA,oCACAC,GAAA,+BACAC,IAAA,4BACAC,IAAA,iCACAC,IAAA,gCACAC,MAAA,kCACAC,KAAA,6BACAC,IAAA,qCACAC,GAAA,0CACAC,KAAA,iCACAC,IAAA,8CACAC,KAAA,wCACAC,IAAA,2BACAC,MAAA,qCACAC,OAAA,qBACAC,KAAA,2BACAC,KAAA,uCACAC,MAAA,oCACAC,MAAA,kCACAC,KAAA,mCACAC,IAAA,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/./node_modules/solid-namespace/index.js","webpack://solid-logic/webpack/bootstrap","webpack://solid-logic/./src/util/debug.ts","webpack://solid-logic/webpack/runtime/compat get default export","webpack://solid-logic/webpack/runtime/define property getters","webpack://solid-logic/webpack/runtime/global","webpack://solid-logic/webpack/runtime/hasOwnProperty shorthand","webpack://solid-logic/external module \"@uvdsl/solid-oidc-client-browser/core\"","webpack://solid-logic/./src/authSession/session.ts","webpack://solid-logic/./src/authSession/issuer.ts","webpack://solid-logic/./src/authSession/authSession.ts","webpack://solid-logic/./src/authSession/events.ts","webpack://solid-logic/external module \"rdflib\"","webpack://solid-logic/./src/util/ns.ts","webpack://solid-logic/./src/acl/aclLogic.ts","webpack://solid-logic/./src/authn/authUtil.ts","webpack://solid-logic/./src/authn/SolidAuthnLogic.ts","webpack://solid-logic/./src/util/utils.ts","webpack://solid-logic/./src/chat/chatLogic.ts","webpack://solid-logic/./src/inbox/inboxLogic.ts","webpack://solid-logic/./src/logic/CustomError.ts","webpack://solid-logic/./src/typeIndex/typeIndexDocuments.ts","webpack://solid-logic/./src/typeIndex/typeIndexAclDocuments.ts","webpack://solid-logic/./src/util/containerLogic.ts","webpack://solid-logic/./src/profile/profileLogic.ts","webpack://solid-logic/./src/profile/profileAclDocuments.ts","webpack://solid-logic/./src/profile/profileDocuments.ts","webpack://solid-logic/./src/typeIndex/typeIndexLogic.ts","webpack://solid-logic/./src/logic/solidLogic.ts","webpack://solid-logic/./src/util/utilityLogic.ts","webpack://solid-logic/./src/logic/solidLogicSingleton.ts","webpack://solid-logic/./src/authn/serverLogout.ts","webpack://solid-logic/./src/issuer/issuerLogic.ts","webpack://solid-logic/./src/index.ts"],"sourcesContent":["/**\n * Provides a way to access commonly used namespaces\n *\n * Usage:\n *\n * ```\n * const $rdf = require('rdflib'); //or any other RDF/JS-compatible library\n * const ns = require('solid-namespace')($rdf);\n * const store = $rdf.graph();\n *\n * let me = ...;\n * let name = store.any(me, ns.vcard(‘fn’)) || store.any(me, ns.foaf(‘name’));\n * ```\n * @module vocab\n */\nconst aliases = {\n acl: 'http://www.w3.org/ns/auth/acl#',\n arg: 'http://www.w3.org/ns/pim/arg#',\n as: 'https://www.w3.org/ns/activitystreams#',\n bookmark: 'http://www.w3.org/2002/01/bookmark#',\n cal: 'http://www.w3.org/2002/12/cal/ical#',\n cco: 'http://www.ontologyrepository.com/CommonCoreOntologies/',\n cert: 'http://www.w3.org/ns/auth/cert#',\n contact: 'http://www.w3.org/2000/10/swap/pim/contact#',\n dc: 'http://purl.org/dc/elements/1.1/',\n dct: 'http://purl.org/dc/terms/',\n doap: 'http://usefulinc.com/ns/doap#',\n foaf: 'http://xmlns.com/foaf/0.1/',\n geo: 'http://www.w3.org/2003/01/geo/wgs84_pos#',\n gpx: 'http://www.w3.org/ns/pim/gpx#',\n gr: 'http://purl.org/goodrelations/v1#',\n http: 'http://www.w3.org/2007/ont/http#',\n httph: 'http://www.w3.org/2007/ont/httph#',\n icalTZ: 'http://www.w3.org/2002/12/cal/icaltzd#', // Beware: not cal:\n ldp: 'http://www.w3.org/ns/ldp#',\n link: 'http://www.w3.org/2007/ont/link#',\n log: 'http://www.w3.org/2000/10/swap/log#',\n meeting: 'http://www.w3.org/ns/pim/meeting#',\n mo: 'http://purl.org/ontology/mo/',\n org: 'http://www.w3.org/ns/org#',\n owl: 'http://www.w3.org/2002/07/owl#',\n pad: 'http://www.w3.org/ns/pim/pad#',\n patch: 'http://www.w3.org/ns/pim/patch#',\n prov: 'http://www.w3.org/ns/prov#',\n pto: 'http://www.productontology.org/id/',\n qu: 'http://www.w3.org/2000/10/swap/pim/qif#',\n trip: 'http://www.w3.org/ns/pim/trip#',\n rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n rdfs: 'http://www.w3.org/2000/01/rdf-schema#',\n rss: 'http://purl.org/rss/1.0/',\n sched: 'http://www.w3.org/ns/pim/schedule#',\n schema: 'http://schema.org/', // @@ beware confusion with documents no 303\n sioc: 'http://rdfs.org/sioc/ns#',\n skos: 'http://www.w3.org/2004/02/skos/core#',\n solid: 'http://www.w3.org/ns/solid/terms#',\n space: 'http://www.w3.org/ns/pim/space#',\n stat: 'http://www.w3.org/ns/posix/stat#',\n tab: 'http://www.w3.org/2007/ont/link#',\n tabont: 'http://www.w3.org/2007/ont/link#',\n ui: 'http://www.w3.org/ns/ui#',\n vann: 'http://purl.org/vocab/vann/',\n vcard: 'http://www.w3.org/2006/vcard/ns#',\n wf: 'http://www.w3.org/2005/01/wf/flow#',\n xsd: 'http://www.w3.org/2001/XMLSchema#',\n}\n\n/**\n * @param [rdflib] {RDF} Optional RDF Library (such as rdflib.js or rdf-ext) to inject\n */\nfunction vocab (rdf = { namedNode: u => u }) {\n const namespaces = {}\n for (const alias in aliases) {\n const expansion = aliases[alias]\n namespaces[alias] = function (localName = '') {\n return rdf.namedNode(expansion + localName)\n }\n };\n\n return namespaces\n};\n\nmodule.exports = vocab\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nexport function log(...args: any[]): void {\n console.log(...args)\n}\n\nexport function warn(...args: any[]): void {\n console.warn(...args)\n}\n\nexport function error(...args: any[]): void {\n console.error(...args)\n}\n\nexport function trace(...args: any[]): void {\n console.trace(...args)\n}\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_MODULE__uvdsl_solid_oidc_client_browser_core_9566af4e__;","/**\n * OIDC session factory.\n *\n * Everything needed to create and configure the underlying auth session:\n * - Session database backends (in-memory and IndexedDB)\n * - Session instantiation (WebSession or SessionCore, with local-dev\n * fallbacks for environments where the service worker can't load)\n * - Login compatibility shim that normalises legacy call-site signatures\n * and resolves the canonical issuer through /.well-known discovery\n *\n * The raw session instance (_session) is consumed by authSession.ts where\n * the legacy event layer and logout listener are attached.\n *\n * DO NOT import _session directly — always go through authSession.ts so\n * the event wiring is guaranteed to run.\n */\n\nimport {\n Session as WebSession,\n} from '@uvdsl/solid-oidc-client-browser'\nimport * as OidcCore from '@uvdsl/solid-oidc-client-browser/core'\nimport type { Session as OidcSession, SessionDatabase } from '@uvdsl/solid-oidc-client-browser/core'\n\n// ---------------------------------------------------------------------------\n// Session databases\n// ---------------------------------------------------------------------------\n\nexport class MemorySessionDatabase implements SessionDatabase {\n private readonly map = new Map<string, any>()\n\n private shouldPreserveExistingRefreshToken(id: string, value: any): boolean {\n return id === 'refresh_token' && (value == null || value === '') && this.map.has(id)\n }\n\n async init (): Promise<SessionDatabase> {\n return this\n }\n\n async setItem (id: string, value: any): Promise<void> {\n // Some Solid IdPs do not include refresh_token on refresh responses.\n // Keep the previous token instead of overwriting it with null/undefined.\n if (this.shouldPreserveExistingRefreshToken(id, value)) {\n return\n }\n this.map.set(id, value)\n }\n\n async getItem (id: string): Promise<any> {\n return this.map.has(id) ? this.map.get(id) : null\n }\n\n async deleteItem (id: string): Promise<void> {\n this.map.delete(id)\n }\n\n async clear (): Promise<void> {\n this.map.clear()\n }\n\n close (): void {\n // No-op for in-memory database\n }\n}\n\nexport class IndexedDbSessionDatabase implements SessionDatabase {\n private db: IDBDatabase | null = null\n private readonly dbName = 'soidc'\n private readonly storeName = 'session'\n private readonly dbVersion = 1\n\n private async shouldPreserveExistingRefreshToken(id: string, value: any): Promise<boolean> {\n if (id !== 'refresh_token' || !(value == null || value === '')) {\n return false\n }\n const existing = await this.getItem(id)\n return existing != null && existing !== ''\n }\n\n async init (): Promise<SessionDatabase> {\n if (this.db) return this\n if (typeof indexedDB === 'undefined') {\n throw new Error('IndexedDB is not available in this environment')\n }\n\n await new Promise<void>((resolve, reject) => {\n const request = indexedDB.open(this.dbName, this.dbVersion)\n\n request.onerror = () => reject(request.error)\n request.onsuccess = () => {\n this.db = request.result\n resolve()\n }\n request.onupgradeneeded = () => {\n const db = request.result\n if (!db.objectStoreNames.contains(this.storeName)) {\n db.createObjectStore(this.storeName)\n }\n }\n })\n\n return this\n }\n\n async setItem (id: string, value: any): Promise<void> {\n await this.init()\n // Some Solid IdPs do not include refresh_token on refresh responses.\n // Keep the previous token instead of overwriting it with null/undefined.\n if (await this.shouldPreserveExistingRefreshToken(id, value)) {\n return\n }\n await this.withStore('readwrite', store => store.put(value, id))\n }\n\n async getItem (id: string): Promise<any> {\n await this.init()\n return this.withStore('readonly', store => store.get(id))\n }\n\n async deleteItem (id: string): Promise<void> {\n await this.init()\n await this.withStore('readwrite', store => store.delete(id))\n }\n\n async clear (): Promise<void> {\n await this.init()\n await this.withStore('readwrite', store => store.clear())\n }\n\n close (): void {\n if (this.db) {\n this.db.close()\n this.db = null\n }\n }\n\n private withStore(mode: IDBTransactionMode, op: (store: IDBObjectStore) => IDBRequest<any>): Promise<any> {\n return new Promise<any>((resolve, reject) => {\n if (!this.db) {\n reject(new Error('Session database not initialized'))\n return\n }\n\n const tx = this.db.transaction(this.storeName, mode)\n const store = tx.objectStore(this.storeName)\n const request = op(store)\n let result: any = null\n\n tx.onerror = () => reject(tx.error ?? request.error)\n tx.onabort = () => reject(tx.error ?? request.error ?? new Error('IndexedDB transaction aborted'))\n tx.oncomplete = () => resolve(result)\n\n request.onerror = () => reject(request.error)\n request.onsuccess = () => {\n result = request.result ?? null\n }\n })\n }\n}\n\n// ---------------------------------------------------------------------------\n// Session instantiation\n// ---------------------------------------------------------------------------\n\nfunction getSessionCoreCtor (): (new (...args: any[]) => OidcSession) | null {\n const coreAny = OidcCore as any\n const candidate = coreAny.SessionCore ?? coreAny.default?.SessionCore ?? coreAny.default\n\n if (typeof candidate !== 'function') {\n return null\n }\n\n return candidate as new (...args: any[]) => OidcSession\n}\n\nconst SessionCoreCtor = getSessionCoreCtor()\n\nfunction createSession (): OidcSession {\n const shouldSkipWorkerInLocalDev = typeof window !== 'undefined' && (() => {\n const host = window.location.hostname\n // In local NSS setups (including subdomain mode like alice.localhost),\n // worker-based session storage can be brittle and lose state on reload.\n // Prefer SessionCore + IndexedDB for deterministic persistence.\n return host === 'localhost' || host === '127.0.0.1' || host.endsWith('.localhost')\n })()\n\n if (shouldSkipWorkerInLocalDev) {\n if (SessionCoreCtor) {\n return new SessionCoreCtor(undefined, { database: new IndexedDbSessionDatabase() })\n }\n return new WebSession()\n }\n\n try {\n return new WebSession()\n } catch (error) {\n // In some deployments, worker URL resolution can become file:// and fail cross-origin.\n // Fall back to SessionCore so auth still works without background refresh worker.\n // Use IndexedDB to keep refresh-token persistence across page reloads.\n console.warn('solid-logic: falling back to non-worker auth session:', error)\n try {\n if (SessionCoreCtor) {\n return new SessionCoreCtor(undefined, { database: new IndexedDbSessionDatabase() })\n }\n return new WebSession()\n } catch (dbError) {\n console.warn('solid-logic: IndexedDB unavailable, using in-memory session database:', dbError)\n if (SessionCoreCtor) {\n return new SessionCoreCtor(undefined, { database: new MemorySessionDatabase() })\n }\n return new WebSession()\n }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Singleton session\n// ---------------------------------------------------------------------------\n\nconst _session = createSession()\n\nexport { _session }\n","/**\n * Issuer discovery utilities.\n *\n * Resolves OIDC issuer endpoints from /.well-known/openid-configuration\n * so that login can use the canonical issuer host.\n */\n\nasync function discoverIssuerFromWellKnown (issuer: string): Promise<string | null> {\n try {\n const issuerUrl = new URL(issuer)\n const wellKnownUrl = new URL('/.well-known/openid-configuration', issuerUrl.origin)\n const wellKnownResponse = await fetch(wellKnownUrl.toString(), { credentials: 'include' })\n if (!wellKnownResponse.ok) {\n return null\n }\n\n const wellKnownPayload = await wellKnownResponse.json()\n if (typeof wellKnownPayload?.issuer !== 'string' || !wellKnownPayload.issuer) {\n return null\n }\n\n return wellKnownPayload.issuer.replace(/\\/$/, '')\n } catch (_err) {\n return null\n }\n}\n\nexport async function resolveIssuerForLogin (issuer: string): Promise<string> {\n // Prefer the issuer advertised by discovery; if app and issuer hosts still differ,\n // redirecting to the canonical issuer host is cleaner than rewriting the issuer here.\n const discoveredIssuer = await discoverIssuerFromWellKnown(issuer)\n if (discoveredIssuer) {\n return discoveredIssuer\n }\n return issuer\n}\n","/**\n * Auth session wiring.\n *\n * Takes the raw OIDC session from session.ts and layers on:\n * - Login compatibility shim (normalises legacy call-site signatures\n * and resolves the canonical issuer)\n * - SessionEvents shim (legacy EventEmitter-style API)\n * - Logout listener (emits 'logout' on session deactivation)\n *\n * Exports the fully assembled authSession.\n */\n\nimport type { Session as OidcSession } from '@uvdsl/solid-oidc-client-browser/core'\nimport { _session } from './session'\nimport { resolveIssuerForLogin } from './issuer'\nimport { SessionEvents } from './events'\n\ntype SessionCompatibilityShape = {\n webId?: string\n isActive?: boolean\n info?: {\n webId?: string\n isLoggedIn?: boolean\n }\n fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>\n authFetch?: (input: string | URL | Request, init?: RequestInit, dpopPayload?: any) => Promise<Response>\n}\n\ntype LoginOptionsLegacy = {\n oidcIssuer?: string\n idp?: string\n issuer?: string\n redirectUrl?: string\n redirect_uri?: string\n redirectUri?: string\n}\n\ntype LoginCompat = {\n (issuer: string, redirectUrl: string): Promise<unknown>\n (options: LoginOptionsLegacy): Promise<unknown>\n}\n\nexport type SessionWithLegacyEvents = Omit<OidcSession, 'login'> & SessionCompatibilityShape & {\n login: LoginCompat\n events: SessionEvents\n}\n\n// ---------------------------------------------------------------------------\n// Login compatibility shim\n// ---------------------------------------------------------------------------\n// Wraps _session.login() so that call sites with different calling\n// conventions all work. The underlying session expects:\n// login(issuer: string, redirectUrl: string)\n//\n// idpOrOptions can be:\n// - a string (issuer URL) — passed through with less resolution\n// - an options object with any of these field-name variants:\n// issuer: oidcIssuer | idp | issuer\n// redirect: redirectUrl | redirect_uri | redirectUri\n// (all redirect field names map to the same value: the URL the IdP\n// should send the browser back to after authentication)\n// - anything else — passed through to the underlying session as-is\n//\n// In all cases the issuer is resolved through\n// /.well-known/openid-configuration before redirect so the canonical\n// issuer host is used.\n\nconst sessionAny = _session as any\nconst originalLogin = typeof sessionAny.login === 'function'\n ? sessionAny.login.bind(_session)\n : undefined\n\nif (originalLogin) {\n const compatLogin = async (idpOrOptions: any, redirectUri?: string): Promise<unknown> => {\n if (idpOrOptions && typeof idpOrOptions === 'object' && !Array.isArray(idpOrOptions)) {\n const oidcIssuer = idpOrOptions.oidcIssuer ?? idpOrOptions.idp ?? idpOrOptions.issuer\n const redirectUrl = idpOrOptions.redirectUrl ?? idpOrOptions.redirect_uri ?? idpOrOptions.redirectUri\n if (typeof oidcIssuer === 'string' && typeof redirectUrl === 'string') {\n return originalLogin(await resolveIssuerForLogin(oidcIssuer), redirectUrl)\n }\n }\n if (typeof idpOrOptions === 'string') {\n return originalLogin(await resolveIssuerForLogin(idpOrOptions), redirectUri)\n }\n return originalLogin(idpOrOptions, redirectUri)\n }\n sessionAny.login = compatLogin as LoginCompat\n}\n\n// ---------------------------------------------------------------------------\n// Legacy event layer\n// ---------------------------------------------------------------------------\n\nconst events = new SessionEvents()\n\n// Emit the legacy 'logout' event when the session transitions from active to inactive.\n// 'login' and 'sessionRestore' are emitted in SolidAuthnLogic.checkUser()\n// because only that call site knows which path activated the session.\nlet _wasActive = (_session as any).isActive ?? Boolean((_session as any).webId)\nif (typeof (_session as unknown as EventTarget).addEventListener === 'function') {\n ;(_session as unknown as EventTarget).addEventListener('sessionStateChange', () => {\n const isNowActive = (_session as any).isActive ?? Boolean((_session as any).webId)\n if (_wasActive && !isNowActive) {\n events.emit('logout')\n }\n _wasActive = isNowActive\n })\n}\n\nexport const authSession: SessionWithLegacyEvents = Object.assign(\n _session as Omit<OidcSession, 'login'> & { login: LoginCompat },\n { events }\n)\n\n// Legacy `info` compatibility shape.\n// The uvdsl session stores state on `webId_`/`isActive_` and exposes them via\n// `webId`/`isActive` getters, but legacy consumers (e.g. solid-ui's\n// `loginStatusBox` widget, `SolidAuthnLogic.currentUser()`'s fallback path)\n// read `authSession.info.webId` / `authSession.info.isLoggedIn`. Expose those\n// as a derived getter so legacy login/logout UI renders the correct state\n// (logout button instead of a mislabelled login button).\nObject.defineProperty(authSession, 'info', {\n enumerable: true,\n configurable: true,\n get (): { webId?: string; isLoggedIn?: boolean } {\n const sessionAny = _session as any\n const isActive = sessionAny.isActive === true || Boolean(sessionAny.webId)\n return {\n webId: sessionAny.webId,\n isLoggedIn: isActive\n }\n }\n})\n ","/**\n * Legacy event compatibility layer.\n *\n * Pure EventEmitter-style shim — no side effects, no uvdsl dependencies.\n * Wired into the auth session by authSession.ts.\n */\n\ntype LegacyEventName = 'login' | 'logout' | 'sessionRestore'\ntype LegacyEventHandler = (...args: unknown[]) => void\n\n/**\n * Minimal EventEmitter-style shim so that existing consumers using\n * `authSession.events.on('login' | 'logout' | 'sessionRestore', handler)`\n * continue working without modification.\n *\n * Events are emitted by SolidAuthnLogic.checkUser() (login/sessionRestore)\n * and by the sessionStateChange listener in authSession.ts (logout).\n */\nexport class SessionEvents {\n private readonly listeners: Map<string, Set<LegacyEventHandler>> = new Map()\n\n on (event: LegacyEventName, handler: LegacyEventHandler): void {\n if (!this.listeners.has(event)) this.listeners.set(event, new Set())\n this.listeners.get(event)!.add(handler)\n }\n\n off (event: LegacyEventName, handler: LegacyEventHandler): void {\n this.listeners.get(event)?.delete(handler)\n }\n\n emit (event: LegacyEventName, ...args: unknown[]): void {\n this.listeners.get(event)?.forEach(h => h(...args))\n }\n}\n\n","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_MODULE_rdflib__;","// Namespaces we commonly use and have common prefixes for around Solid\nimport solidNamespace from 'solid-namespace' // Delegate to this which takes RDFlib as param.\nimport * as $rdf from 'rdflib'\n\nexport const ns = solidNamespace($rdf)","import { graph, NamedNode, Namespace, serialize, sym } from 'rdflib'\nimport { AclLogic } from '../types'\nimport { ns as namespace } from '../util/ns'\n\n\nexport const ACL_LINK = sym(\n 'http://www.iana.org/assignments/link-relations/acl'\n)\n\nexport function createAclLogic(store): AclLogic {\n\n const ns = namespace\n \n async function findAclDocUrl(url: NamedNode) {\n await store.fetcher.load(url)\n const docNode = store.any(url, ACL_LINK)\n if (!docNode) {\n throw new Error(`No ACL link discovered for ${url}`)\n }\n return docNode.value\n }\n /**\n * Simple Access Control\n *\n * This function sets up a simple default ACL for a resource, with\n * RWC for the owner, and a specified access (default none) for the public.\n * In all cases owner has read write control.\n * Parameter lists modes allowed to public\n *\n * @param options\n * @param options.public eg ['Read', 'Write']\n *\n * @returns Resolves with aclDoc uri on successful write\n */\n function setACLUserPublic ( \n docURI: string,\n me: NamedNode,\n options: {\n defaultForNew?: boolean,\n public?: []\n }\n ): Promise<NamedNode> {\n const aclDoc = store.any(\n store.sym(docURI),\n ACL_LINK\n )\n\n return Promise.resolve()\n .then(() => {\n if (aclDoc) {\n return aclDoc as NamedNode\n }\n\n return fetchACLRel(docURI).catch(err => {\n throw new Error(`Error fetching rel=ACL header for ${docURI}: ${err}`)\n })\n })\n .then(aclDoc => {\n const aclText = genACLText(docURI, me, aclDoc.uri, options)\n if (!store.fetcher) {\n throw new Error('Cannot PUT this, store has no fetcher')\n }\n return store.fetcher\n .webOperation('PUT', aclDoc.uri, {\n data: aclText,\n contentType: 'text/turtle'\n })\n .then(result => {\n if (!result.ok) {\n throw new Error('Error writing ACL text: ' + result.error)\n }\n\n return aclDoc\n })\n })\n }\n\n /**\n * @param docURI\n * @returns\n */\n function fetchACLRel (docURI: string): Promise<NamedNode> {\n const fetcher = store.fetcher\n if (!fetcher) {\n throw new Error('Cannot fetch ACL rel, store has no fetcher')\n }\n\n return fetcher.load(docURI).then(result => {\n if (!result.ok) {\n throw new Error('fetchACLRel: While loading:' + (result as any).error)\n }\n\n const aclDoc = store.any(\n store.sym(docURI),\n ACL_LINK\n )\n\n if (!aclDoc) {\n throw new Error('fetchACLRel: No Link rel=ACL header for ' + docURI)\n }\n\n return aclDoc as NamedNode\n })\n }\n\n /**\n * @param docURI\n * @param me\n * @param aclURI\n * @param options\n *\n * @returns Serialized ACL\n */\n function genACLText (\n docURI: string,\n me: NamedNode,\n aclURI: string,\n options: {\n defaultForNew?: boolean,\n public?: []\n } = {}\n ): string | undefined {\n const optPublic = options.public || []\n const g = graph()\n const auth = Namespace('http://www.w3.org/ns/auth/acl#')\n let a = g.sym(`${aclURI}#a1`)\n const acl = g.sym(aclURI)\n const doc = g.sym(docURI)\n g.add(a, ns.rdf('type'), auth('Authorization'), acl)\n g.add(a, auth('accessTo'), doc, acl)\n if (options.defaultForNew) {\n g.add(a, auth('default'), doc, acl)\n }\n g.add(a, auth('agent'), me, acl)\n g.add(a, auth('mode'), auth('Read'), acl)\n g.add(a, auth('mode'), auth('Write'), acl)\n g.add(a, auth('mode'), auth('Control'), acl)\n\n if (optPublic.length) {\n a = g.sym(`${aclURI}#a2`)\n g.add(a, ns.rdf('type'), auth('Authorization'), acl)\n g.add(a, auth('accessTo'), doc, acl)\n g.add(a, auth('agentClass'), ns.foaf('Agent'), acl)\n for (let p = 0; p < optPublic.length; p++) {\n g.add(a, auth('mode'), auth(optPublic[p]), acl) // Like 'Read' etc\n }\n }\n return serialize(acl, g, aclURI)\n }\n return {\n findAclDocUrl,\n setACLUserPublic,\n genACLText\n }\n}","import { NamedNode, sym } from 'rdflib'\nimport * as debug from '../util/debug'\n\n/**\n * find a user or app's context as set in window.SolidAppContext\n * this is a const, not a function, because we have problems to jest mock it otherwise\n * see: https://github.com/facebook/jest/issues/936#issuecomment-545080082 for more\n * @return {any} - an appContext object\n */\nexport const appContext = ():any => {\n let { SolidAppContext }: any = window\n SolidAppContext ||= {}\n SolidAppContext.viewingNoAuthPage = false\n if (SolidAppContext.noAuth && window.document) {\n const currentPage = window.document.location.href\n if (currentPage.startsWith(SolidAppContext.noAuth)) {\n SolidAppContext.viewingNoAuthPage = true\n const params = new URLSearchParams(window.document.location.search)\n if (params) {\n let viewedPage = SolidAppContext.viewedPage = params.get('uri') || null\n if (viewedPage) {\n viewedPage = decodeURI(viewedPage)\n if (!viewedPage.startsWith(SolidAppContext.noAuth)) {\n const ary = viewedPage.split(/\\//)\n SolidAppContext.idp = ary[0] + '//' + ary[2]\n SolidAppContext.viewingNoAuthPage = false\n }\n }\n }\n }\n }\n return SolidAppContext\n}\n\n/**\n * Returns `sym($SolidTestEnvironment.username)` if\n * `$SolidTestEnvironment.username` is defined as a global\n * or \n * returns testID defined in the HTML page\n * @returns {NamedNode|null}\n */\nexport function offlineTestID (): NamedNode | null {\n const { $SolidTestEnvironment }: any = window\n if (\n typeof $SolidTestEnvironment !== 'undefined' &&\n $SolidTestEnvironment.username\n ) {\n // Test setup\n debug.log('Assuming the user is ' + $SolidTestEnvironment.username)\n return sym($SolidTestEnvironment.username)\n }\n // hack that makes SolidOS work in offline mode by adding the webId directly in html\n // example usage: https://github.com/solidos/mashlib/blob/29b8b53c46bf02e0e219f0bacd51b0e9951001dd/test/contact/local.html#L37\n if (\n typeof document !== 'undefined' &&\n document.location &&\n ('' + document.location).slice(0, 16) === 'http://localhost'\n ) {\n const div = document.getElementById('appTarget')\n if (!div) return null\n const id = div.getAttribute('testID')\n if (!id) return null\n debug.log('Assuming user is ' + id)\n return sym(id)\n }\n return null\n}\n","import { namedNode, NamedNode, sym } from 'rdflib'\nimport { appContext, offlineTestID } from './authUtil'\nimport * as debug from '../util/debug'\nimport type { SessionWithLegacyEvents } from '../authSession/authSession'\nimport type { AuthenticationContext, AuthnLogic } from '../types'\n\nexport class SolidAuthnLogic implements AuthnLogic {\n private session: SessionWithLegacyEvents\n private checkUserInFlight: Promise<NamedNode | null> | null = null\n private sessionRestoreHookAttached = false\n private fallbackWebId: string | null = null\n\n constructor(solidAuthSession: SessionWithLegacyEvents) {\n this.session = solidAuthSession\n }\n\n // we created authSession getter because we want to access it as authn.authSession externally\n get authSession(): SessionWithLegacyEvents { return this.session }\n\n currentUser(): NamedNode | null {\n const app = appContext()\n if (app.viewingNoAuthPage) {\n return sym(app.webId)\n }\n const sessionAny = this.session as any\n const infoWebId = sessionAny?.info?.webId\n const sessionWebId = sessionAny?.webId\n const webId = infoWebId || sessionWebId || this.fallbackWebId\n const infoLoggedIn = sessionAny?.info?.isLoggedIn\n const sessionActive = sessionAny?.isActive\n const isLoggedIn = infoLoggedIn === true || sessionActive === true ||\n ((infoLoggedIn == null && sessionActive == null) ? Boolean(webId) : false) ||\n Boolean(this.fallbackWebId)\n if (this && this.session && webId && isLoggedIn) {\n return sym(webId)\n }\n return offlineTestID() // null unless testing\n }\n\n /**\n * Retrieves currently logged in webId from either\n * defaultTestUser or SolidAuth\n * Also activates a session after login\n * @param [setUserCallback] Optional callback\n * @returns Resolves with webId uri, if no callback provided\n */\n async checkUser<T> (\n setUserCallback?: (me: NamedNode | null) => T\n ): Promise<NamedNode | T | null> {\n // Save hash for \"restorePreviousSession\"\n const preLoginRedirectHash = new URL(window.location.href).hash\n if (preLoginRedirectHash) {\n window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash)\n }\n const sessionAny = this.session as any\n if (!this.sessionRestoreHookAttached && typeof sessionAny?.events?.on === 'function') {\n // Backward-compatible hook for auth clients exposing an EventEmitter-style API.\n sessionAny.events.on('sessionRestore', (url: string) => {\n debug.log(`Session restored to ${url}`)\n if (document.location.toString() !== url) history.replaceState(null, '', url)\n })\n this.sessionRestoreHookAttached = true\n }\n\n if (!this.checkUserInFlight) {\n this.checkUserInFlight = this.resolveCurrentUser()\n }\n\n const inFlight = this.checkUserInFlight\n let me: NamedNode | null\n try {\n me = await inFlight\n } finally {\n if (this.checkUserInFlight === inFlight) {\n this.checkUserInFlight = null\n }\n }\n\n return Promise.resolve(setUserCallback ? setUserCallback(me) : me)\n }\n\n private async resolveCurrentUser (): Promise<NamedNode | null> {\n const sessionAny = this.session as any\n\n /**\n * Handle a successful authentication redirect\n */\n const redirectUrl = new URL(window.location.href)\n redirectUrl.hash = ''\n if (typeof sessionAny?.handleIncomingRedirect === 'function') {\n await sessionAny.handleIncomingRedirect({\n restorePreviousSession: true,\n url: redirectUrl.href\n })\n } else {\n if (typeof sessionAny?.restore === 'function') {\n const wasActive = sessionAny?.isActive ?? Boolean(sessionAny?.webId)\n try {\n await sessionAny.restore()\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n if (!/no session to restore/i.test(message)) {\n throw error\n }\n debug.log('No previous session to restore')\n }\n const isNowActive = sessionAny?.isActive ?? Boolean(sessionAny?.webId)\n if (!wasActive && isNowActive) {\n sessionAny.events?.emit('sessionRestore', window.location.href)\n }\n }\n if (typeof sessionAny?.handleRedirectFromLogin === 'function') {\n const wasActive = sessionAny?.isActive ?? Boolean(sessionAny?.webId)\n await sessionAny.handleRedirectFromLogin()\n const isNowActive = sessionAny?.isActive ?? Boolean(sessionAny?.webId)\n if (!wasActive && isNowActive) {\n sessionAny.events?.emit('login')\n }\n }\n }\n\n // Check to see if a hash was stored in local storage\n const postLoginRedirectHash = window.localStorage.getItem('preLoginRedirectHash')\n if (postLoginRedirectHash) {\n const curUrl = new URL(window.location.href)\n if (curUrl.hash !== postLoginRedirectHash) {\n if (history.pushState) {\n // debug.log('Setting window.location.has using pushState')\n history.pushState(null, document.title, postLoginRedirectHash)\n } else {\n // debug.warn('Setting window.location.has using location.hash')\n location.hash = postLoginRedirectHash\n }\n curUrl.hash = postLoginRedirectHash\n }\n // See https://stackoverflow.com/questions/3870057/how-can-i-update-window-location-hash-without-jumping-the-document\n // window.location.href = curUrl.toString()// @@ See https://developer.mozilla.org/en-US/docs/Web/API/Window/location\n window.localStorage.setItem('preLoginRedirectHash', '')\n }\n\n // Check to see if already logged in / have the WebID\n let me = offlineTestID()\n if (me) {\n return me\n }\n\n let webId = this.webIdFromSession(sessionAny?.info, sessionAny)\n if (!webId) {\n // NSS-specific fallback: recover WebID from NSS cookie session when client restore is empty.\n webId = await this.probeNssCookieBackedWebId()\n }\n\n if (webId) {\n this.fallbackWebId = webId\n } else {\n this.fallbackWebId = null\n }\n\n if (webId) {\n me = this.saveUser(webId)\n }\n\n if (me) {\n debug.log(`(Logged in as ${me} by authentication)`)\n }\n\n return me\n }\n\n private async probeNssCookieBackedWebId (): Promise<string | null> {\n if (typeof window === 'undefined') {\n return null\n }\n\n const { hostname, port, protocol } = window.location\n const localhostSuffix = '.localhost'\n // NSS local pods use subdomains like alice.localhost.\n if (!hostname.endsWith(localhostSuffix)) {\n return null\n }\n\n const podName = hostname.slice(0, -localhostSuffix.length)\n if (!podName || podName === 'localhost' || podName.includes('.')) {\n return null\n }\n\n try {\n // NSS returns 403 on this account page when the cookie session is valid.\n const probeResponse = await fetch('/account/password/change', {\n credentials: 'include',\n redirect: 'manual',\n cache: 'no-store'\n })\n if (probeResponse.status !== 403) {\n return null\n }\n const origin = `${protocol}//${hostname}${port ? `:${port}` : ''}`\n return `${origin}/profile/card#me`\n } catch (_error) {\n return null\n }\n }\n\n /**\n * Saves `webId` in `context.me`\n * @param webId\n * @param context\n *\n * @returns Returns the WebID, after setting it\n */\n saveUser (\n webId: NamedNode | string | null,\n context?: AuthenticationContext\n ): NamedNode | null {\n let webIdUri: string\n if (webId) {\n webIdUri = (typeof webId === 'string') ? webId : webId.uri\n const me = namedNode(webIdUri)\n if (context) {\n context.me = me\n }\n return me\n }\n return null\n }\n\n /**\n * @returns {Promise<string|null>} Resolves with WebID URI or null\n */\n webIdFromSession (\n sessionInfo?: { webId?: string, isLoggedIn?: boolean },\n sessionRoot?: { webId?: string, isLoggedIn?: boolean, isActive?: boolean }\n ): string | null {\n const webId = sessionInfo?.webId || sessionRoot?.webId\n if (!webId) {\n return null\n }\n const infoLoggedIn = sessionInfo?.isLoggedIn\n const rootLoggedIn = sessionRoot?.isLoggedIn\n const rootActive = sessionRoot?.isActive\n if (infoLoggedIn === true || rootLoggedIn === true || rootActive === true) {\n return webId\n }\n if (infoLoggedIn === false && rootLoggedIn === false && rootActive === false) {\n return null\n }\n return webId\n }\n\n}\n","import { NamedNode, sym } from 'rdflib'\n\nexport function newThing(doc: NamedNode): NamedNode {\n return sym(doc.uri + '#' + 'id' + ('' + Date.now()))\n}\n\nexport function uniqueNodes (arr: NamedNode[]): NamedNode[] {\n const uris = arr.map(x => x.uri)\n const set = new Set(uris)\n const uris2 = Array.from(set)\n const arr2 = uris2.map(u => new NamedNode(u))\n return arr2 // Array.from(new Set(arr.map(x => x.uri))).map(u => sym(u))\n}\n\nexport function getArchiveUrl(baseUrl: string, date: Date) {\n const year = date.getUTCFullYear()\n const month = ('0' + (date.getUTCMonth()+1)).slice(-2)\n const day = ('0' + (date.getUTCDate())).slice(-2)\n const parts = baseUrl.split('/')\n const filename = parts[parts.length -1 ]\n return new URL(`./archive/${year}/${month}/${day}/${filename}`, baseUrl).toString()\n}\n\nexport function differentOrigin(doc): boolean {\n if (!doc) {\n return true\n }\n return (\n `${window.location.origin}/` !== new URL(doc.value).origin\n )\n}\n\nexport function suggestPreferencesFile (me:NamedNode) {\n const stripped = me.uri.replace('/profile/', '/').replace('/public/', '/')\n // const stripped = me.uri.replace(\\/[p|P]rofile/\\g, '/').replace(\\/[p|P]ublic/\\g, '/')\n const folderURI = stripped.split('/').slice(0,-1).join('/') + '/settings/'\n const fileURI = folderURI + 'prefs.ttl'\n return sym(fileURI)\n}\n\nexport function determineChatContainer(\n invitee: NamedNode,\n podRoot: NamedNode\n): NamedNode {\n // Create chat\n // See https://gitter.im/solid/chat-app?at=5f3c800f855be416a23ae74a\n const chatContainerStr = new URL(\n `IndividualChats/${new URL(invitee.value).host}/`,\n podRoot.value\n ).toString()\n return new NamedNode(chatContainerStr)\n}\n","import { NamedNode, Node, st, term } from 'rdflib'\nimport { ChatLogic, CreatedPaneOptions, NewPaneOptions, Chat } from '../types'\nimport { ns as namespace } from '../util/ns'\nimport { determineChatContainer, newThing } from '../util/utils'\n\nconst CHAT_LOCATION_IN_CONTAINER = 'index.ttl#this'\n\nexport function createChatLogic(store, profileLogic): ChatLogic {\n const ns = namespace\n\n async function setAcl(\n chatContainer: NamedNode,\n me: NamedNode,\n invitee: NamedNode\n ): Promise<void> {\n // Some servers don't present a Link http response header\n // if the container doesn't exist yet, so refetch the container\n // now that it has been created:\n await store.fetcher.load(chatContainer)\n\n // FIXME: check the Why value on this quad:\n const chatAclDoc = store.any(\n chatContainer,\n new NamedNode('http://www.iana.org/assignments/link-relations/acl')\n )\n if (!chatAclDoc) {\n throw new Error('Chat ACL doc not found!')\n }\n\n const aclBody = `\n @prefix acl: <http://www.w3.org/ns/auth/acl#>.\n <#owner>\n a acl:Authorization;\n acl:agent <${me.value}>;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Write, acl:Control.\n <#invitee>\n a acl:Authorization;\n acl:agent <${invitee.value}>;\n acl:accessTo <.>;\n acl:default <.>;\n acl:mode\n acl:Read, acl:Append.\n `\n await store.fetcher.webOperation('PUT', chatAclDoc.value, {\n data: aclBody,\n contentType: 'text/turtle',\n })\n }\n\n async function addToPrivateTypeIndex(chatThing, me) {\n // Add to private type index\n const privateTypeIndex = store.any(\n me,\n ns.solid('privateTypeIndex')\n ) as NamedNode | null\n if (!privateTypeIndex) {\n throw new Error('Private type index not found!')\n }\n await store.fetcher.load(privateTypeIndex)\n const reg = newThing(privateTypeIndex)\n const ins = [\n st(\n reg,\n ns.rdf('type'),\n ns.solid('TypeRegistration'),\n privateTypeIndex.doc()\n ),\n st(\n reg,\n ns.solid('forClass'),\n ns.meeting('LongChat'),\n privateTypeIndex.doc()\n ),\n st(reg, ns.solid('instance'), chatThing, privateTypeIndex.doc()),\n ]\n await new Promise((resolve, reject) => {\n store.updater.update([], ins, function (_uri, ok, errm) {\n if (!ok) {\n reject(new Error(errm))\n } else {\n resolve(null)\n }\n })\n })\n }\n\n async function findChat(invitee: NamedNode): Promise<Chat> {\n const me = await profileLogic.loadMe()\n const podRoot = await profileLogic.getPodRoot(me)\n const chatContainer = determineChatContainer(invitee, podRoot)\n let exists = true\n try {\n await store.fetcher.load(\n new NamedNode(chatContainer.value + 'index.ttl#this')\n )\n } catch (e) {\n exists = false\n }\n return { me, chatContainer, exists }\n }\n\n async function createChatThing(\n chatContainer: NamedNode,\n me: NamedNode\n ): Promise<NamedNode> {\n const created = await mintNew({\n me,\n newBase: chatContainer.value,\n })\n return created.newInstance\n }\n\n function mintNew(newPaneOptions: NewPaneOptions): Promise<CreatedPaneOptions> {\n const kb = store\n const updater = kb.updater\n if (newPaneOptions.me && !newPaneOptions.me.uri) {\n throw new Error('chat mintNew: Invalid userid ' + newPaneOptions.me)\n }\n\n const newInstance = (newPaneOptions.newInstance =\n newPaneOptions.newInstance ||\n kb.sym(newPaneOptions.newBase + CHAT_LOCATION_IN_CONTAINER))\n const newChatDoc = newInstance.doc()\n\n kb.add(\n newInstance,\n ns.rdf('type'),\n ns.meeting('LongChat'),\n newChatDoc\n )\n kb.add(newInstance, ns.dc('title'), 'Chat channel', newChatDoc)\n kb.add(\n newInstance,\n ns.dc('created'),\n term<Node>(new Date(Date.now())),\n newChatDoc\n )\n if (newPaneOptions.me) {\n kb.add(newInstance, ns.dc('author'), newPaneOptions.me, newChatDoc)\n }\n\n return new Promise(function (resolve, reject) {\n updater?.put(\n newChatDoc,\n kb.statementsMatching(undefined, undefined, undefined, newChatDoc),\n 'text/turtle',\n function (uri2, ok, message) {\n if (ok) {\n resolve({\n ...newPaneOptions,\n newInstance,\n })\n } else {\n reject(\n new Error(\n 'FAILED to save new chat channel at: ' + uri2 + ' : ' + message\n )\n )\n }\n }\n )\n })\n }\n\n /**\n * Find (and optionally create) an individual chat between the current user and the given invitee\n * @param invitee - The person to chat with\n * @param createIfMissing - Whether the chat should be created, if missing\n * @returns null if missing, or a node referring to an already existing chat, or the newly created chat\n */\n async function getChat(\n invitee: NamedNode,\n createIfMissing = true\n ): Promise<NamedNode | null> {\n const { me, chatContainer, exists } = await findChat(invitee)\n if (exists) {\n return new NamedNode(chatContainer.value + CHAT_LOCATION_IN_CONTAINER)\n }\n\n if (createIfMissing) {\n const chatThing = await createChatThing(chatContainer, me)\n await sendInvite(invitee, chatThing)\n await setAcl(chatContainer, me, invitee)\n await addToPrivateTypeIndex(chatThing, me)\n return chatThing\n }\n return null\n }\n\n async function sendInvite(invitee: NamedNode, chatThing: NamedNode) {\n await store.fetcher.load(invitee.doc())\n const inviteeInbox = store.any(\n invitee,\n ns.ldp('inbox'),\n undefined,\n invitee.doc()\n )\n if (!inviteeInbox) {\n throw new Error(`Invitee inbox not found! ${invitee.value}`)\n }\n const inviteBody = `\n <> a <http://www.w3.org/ns/pim/meeting#LongChatInvite> ;\n ${ns.rdf('seeAlso')} <${chatThing.value}> .\n `\n\n const inviteResponse = await store.fetcher?.webOperation(\n 'POST',\n inviteeInbox.value,\n {\n data: inviteBody,\n contentType: 'text/turtle',\n }\n )\n const locationStr = inviteResponse?.headers.get('location')\n if (!locationStr) {\n throw new Error(`Invite sending returned a ${inviteResponse?.status}`)\n }\n }\n return {\n setAcl, addToPrivateTypeIndex, findChat, createChatThing, getChat, sendInvite, mintNew\n }\n}\n","import { NamedNode } from 'rdflib'\nimport { InboxLogic } from '../types'\nimport { getArchiveUrl } from '../util/utils'\n\nexport function createInboxLogic(store, profileLogic, utilityLogic, containerLogic, aclLogic): InboxLogic {\n\n async function createInboxFor(peerWebId: string, nick: string) {\n const myWebId: NamedNode = await profileLogic.loadMe()\n const podRoot: NamedNode = await profileLogic.getPodRoot(myWebId)\n const ourInbox = `${podRoot.value}p2p-inboxes/${encodeURIComponent(nick)}/`\n await containerLogic.createContainer(ourInbox)\n // const aclDocUrl = await aclLogic.findAclDocUrl(ourInbox);\n await utilityLogic.setSinglePeerAccess({\n ownerWebId: myWebId.value,\n peerWebId,\n accessToModes: 'acl:Append',\n target: ourInbox\n })\n return ourInbox\n }\n\n async function getNewMessages(\n user?: NamedNode\n ): Promise<NamedNode[]> {\n if (!user) {\n user = await profileLogic.loadMe()\n }\n const inbox = await profileLogic.getMainInbox(user)\n const urls = await containerLogic.getContainerMembers(inbox)\n return urls.filter(url => !containerLogic.isContainer(url))\n }\n\n async function markAsRead(url: string, date: Date) {\n const downloaded = await store.fetcher._fetch(url)\n if (downloaded.status !== 200) {\n throw new Error(`Not OK! ${url}`)\n }\n const archiveUrl = getArchiveUrl(url, date)\n const options = {\n method: 'PUT',\n body: await downloaded.text(),\n headers: [\n ['Content-Type', downloaded.headers.get('Content-Type') || 'application/octet-stream']\n ]\n }\n const uploaded = await store.fetcher._fetch(archiveUrl, options)\n if (uploaded.status.toString()[0] === '2') {\n await store.fetcher._fetch(url, {\n method: 'DELETE'\n })\n }\n }\n return {\n createInboxFor,\n getNewMessages,\n markAsRead\n }\n}\n","class CustomError extends Error {\n constructor(message?: string) {\n super(message)\n // see: typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html\n Object.setPrototypeOf(this, new.target.prototype) // restore prototype chain\n this.name = new.target.name // stack traces display correctly now\n }\n}\n\nexport class UnauthorizedError extends CustomError {}\n\nexport class CrossOriginForbiddenError extends CustomError {}\n\nexport class SameOriginForbiddenError extends CustomError {}\n\nexport class NotFoundError extends CustomError {}\n\nexport class NotEditableError extends CustomError { }\n\nexport class WebOperationError extends CustomError {}\n\nexport class FetchError extends CustomError {\n status: number\n\n constructor(status: number, message?: string) {\n super(message)\n this.status = status\n }\n}","export function publicTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:ListedDocument.'\n ].join('\\n')\n}\n\nexport function privateTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:UnlistedDocument.'\n ].join('\\n')\n}","export function publicTypeIndexAclDocument(webId: string, publicTypeIndexUri: string): string {\n const fileName = new URL(publicTypeIndexUri).pathname.split('/').pop() || 'publicTypeIndex.ttl'\n return [\n '# ACL resource for the Public Type Index',\n '',\n '@prefix acl: <http://www.w3.org/ns/auth/acl#>.',\n '@prefix foaf: <http://xmlns.com/foaf/0.1/>.',\n '',\n '<#owner>',\n ' a acl:Authorization;',\n '',\n ' acl:agent',\n ` <${webId}>;`,\n '',\n ` acl:accessTo <./${fileName}>;`,\n '',\n ' acl:mode',\n ' acl:Read, acl:Write, acl:Control.',\n '',\n '# Public-readable',\n '<#public>',\n ' a acl:Authorization;',\n '',\n ' acl:agentClass foaf:Agent;',\n '',\n ` acl:accessTo <./${fileName}>;`,\n '',\n ' acl:mode acl:Read.'\n ].join('\\n')\n}\n","import { NamedNode, Statement, sym } from 'rdflib'\n\n/**\n * Container-related class\n */\nexport function createContainerLogic(store) {\n\n function getContainerElements(containerNode: NamedNode): NamedNode[] {\n return store\n .statementsMatching(\n containerNode,\n sym('http://www.w3.org/ns/ldp#contains'),\n undefined\n )\n .map((st: Statement) => st.object as NamedNode)\n }\n\n function isContainer(url: NamedNode) {\n const nodeToString = url.value\n return nodeToString.charAt(nodeToString.length - 1) === '/'\n }\n\n async function createContainer(url: string) {\n const stringToNode = sym(url)\n if (!isContainer(stringToNode)) {\n throw new Error(`Not a container URL ${url}`)\n }\n // Copied from https://github.com/solidos/solid-crud-tests/blob/v3.1.0/test/surface/create-container.test.ts#L56-L64\n const result = await store.fetcher._fetch(url, {\n method: 'PUT',\n headers: {\n 'Content-Type': 'text/turtle',\n 'If-None-Match': '*',\n Link: '<http://www.w3.org/ns/ldp#BasicContainer>; rel=\"type\"', // See https://github.com/solidos/node-solid-server/issues/1465\n },\n body: ' ', // work around https://github.com/michielbdejong/community-server/issues/4#issuecomment-776222863\n })\n // Treat 409 as idempotent success: another process/request already created the container.\n if (result.status === 409) {\n return\n }\n if (result.status.toString()[0] !== '2') {\n throw new Error(`Not OK: got ${result.status} response while creating container at ${url}`)\n }\n }\n\n async function getContainerMembers(containerUrl: NamedNode): Promise<NamedNode[]> {\n await store.fetcher.load(containerUrl)\n return getContainerElements(containerUrl)\n }\n return {\n isContainer,\n createContainer,\n getContainerElements,\n getContainerMembers\n }\n}","import { literal, NamedNode, st, sym } from 'rdflib'\nimport { ACL_LINK } from '../acl/aclLogic'\nimport { CrossOriginForbiddenError, FetchError, NotEditableError, SameOriginForbiddenError, UnauthorizedError, WebOperationError } from '../logic/CustomError'\nimport * as debug from '../util/debug'\nimport { ns as namespace } from '../util/ns'\nimport { privateTypeIndexDocument, publicTypeIndexDocument } from '../typeIndex/typeIndexDocuments'\nimport { publicTypeIndexAclDocument } from '../typeIndex/typeIndexAclDocuments'\nimport { preferencesFileDocument } from './profileDocuments'\nimport { ownerOnlyContainerAclDocument } from './profileAclDocuments'\nimport { createContainerLogic } from '../util/containerLogic'\nimport { differentOrigin, suggestPreferencesFile } from '../util/utils'\nimport { ProfileLogic } from '../types'\n\nexport function createProfileLogic(store, authn, utilityLogic): ProfileLogic {\n const ns = namespace\n const containerLogic = createContainerLogic(store)\n const loadPreferencesInFlight = new Map<string, Promise<NamedNode>>()\n const cachedPreferencesFileByWebId = new Map<string, NamedNode>()\n\n function isAbsoluteHttpUri(uri: string | null | undefined): boolean {\n return !!uri && (uri.startsWith('https://') || uri.startsWith('http://'))\n }\n\n function docDirUri(node: NamedNode): string | null {\n const doc = node.doc()\n const dir = doc.dir()\n if (dir?.uri && isAbsoluteHttpUri(dir.uri)) return dir.uri\n const docUri = doc.uri\n if (!docUri || !isAbsoluteHttpUri(docUri)) return null\n const withoutFragment = docUri.split('#')[0]\n const lastSlash = withoutFragment.lastIndexOf('/')\n if (lastSlash === -1) return null\n return withoutFragment.slice(0, lastSlash + 1)\n }\n\n function suggestTypeIndexInPreferences(preferencesFile: NamedNode, filename: string): NamedNode {\n const dirUri = docDirUri(preferencesFile)\n if (!dirUri) throw new Error(`Cannot derive directory for preferences file ${preferencesFile.uri}`)\n return sym(dirUri + filename)\n }\n\n function isNotFoundError(err: any): boolean {\n if (err?.response?.status === 404) return true\n const text = `${err?.message || err || ''}`\n return text.includes('404') || text.includes('Not Found')\n }\n\n async function ensureContainerExists(containerUri: string): Promise<void> {\n const containerNode = sym(containerUri)\n try {\n await store.fetcher.load(containerNode)\n return\n } catch (err) {\n if (!isNotFoundError(err)) throw err\n }\n await containerLogic.createContainer(containerUri)\n }\n\n async function ensureOwnerOnlyAclForSettings(user: NamedNode, preferencesFile: NamedNode): Promise<void> {\n const dirUri = docDirUri(preferencesFile)\n if (!dirUri) throw new Error(`Cannot derive settings directory from ${preferencesFile.uri}`)\n await ensureContainerExists(dirUri)\n\n const containerNode = sym(dirUri)\n let aclDocUri: string | undefined\n try {\n await store.fetcher.load(containerNode)\n aclDocUri = store.any(containerNode, ACL_LINK)?.value\n } catch (err) {\n if (!isNotFoundError(err)) throw err\n }\n if (!aclDocUri) {\n // Fallback for servers/tests where rel=acl is not exposed in mocked headers.\n aclDocUri = `${dirUri}.acl`\n }\n const aclDoc = sym(aclDocUri)\n try {\n await store.fetcher.load(aclDoc)\n return\n } catch (err) {\n if (!isNotFoundError(err)) throw err\n }\n\n await store.fetcher.webOperation('PUT', aclDoc.uri, {\n data: ownerOnlyContainerAclDocument(user.uri),\n contentType: 'text/turtle'\n })\n }\n\n async function ensurePublicTypeIndexAclOnCreate(user: NamedNode, publicTypeIndex: NamedNode, ensureAcl = false): Promise<void> {\n const created = await utilityLogic.loadOrCreateWithContentOnCreate(publicTypeIndex, publicTypeIndexDocument())\n if (!created && !ensureAcl) return\n\n let aclDocUri: string | undefined\n try {\n await store.fetcher.load(publicTypeIndex)\n aclDocUri = store.any(publicTypeIndex, ACL_LINK)?.value\n } catch (err) {\n if (!isNotFoundError(err)) throw err\n }\n if (!aclDocUri) {\n aclDocUri = `${publicTypeIndex.uri}.acl`\n }\n\n const aclDoc = sym(aclDocUri)\n try {\n await store.fetcher.webOperation('PUT', aclDoc.uri, {\n data: publicTypeIndexAclDocument(user.uri, publicTypeIndex.uri),\n contentType: 'text/turtle',\n headers: { 'If-None-Match': '*' }\n })\n } catch (err: any) {\n const status = err?.response?.status ?? err?.status\n if (status !== 412) throw err\n }\n }\n\n async function ensurePrivateTypeIndexOnCreate(privateTypeIndex: NamedNode): Promise<void> {\n await utilityLogic.loadOrCreateWithContentOnCreate(privateTypeIndex, privateTypeIndexDocument())\n }\n\n async function initializePreferencesDefaults(user: NamedNode, preferencesFile: NamedNode): Promise<void> {\n const preferencesDoc = preferencesFile.doc() as NamedNode\n const profileDoc = user.doc() as NamedNode\n await store.fetcher.load(preferencesDoc)\n\n const profilePublicTypeIndex =\n (store.any(user, ns.solid('publicTypeIndex'), null, profileDoc) as NamedNode | null)\n const preferencesPublicTypeIndex =\n (store.any(user, ns.solid('publicTypeIndex'), null, preferencesDoc) as NamedNode | null)\n const publicTypeIndex =\n profilePublicTypeIndex ||\n preferencesPublicTypeIndex ||\n suggestTypeIndexInPreferences(preferencesFile, 'publicTypeIndex.ttl')\n const privateTypeIndex =\n (store.any(user, ns.solid('privateTypeIndex'), null, preferencesDoc) as NamedNode | null) ||\n suggestTypeIndexInPreferences(preferencesFile, 'privateTypeIndex.ttl')\n\n // Keep discovery consistent with typeIndexLogic, which resolves publicTypeIndex from the profile doc.\n const createdProfilePublicTypeIndexLink = !profilePublicTypeIndex\n if (createdProfilePublicTypeIndexLink) {\n await utilityLogic.followOrCreateLinkWithContentOnCreate(\n user,\n ns.solid('publicTypeIndex') as NamedNode,\n publicTypeIndex,\n profileDoc,\n publicTypeIndexDocument()\n )\n }\n\n const toInsert: any[] = []\n if (!store.holds(preferencesDoc, ns.rdf('type'), ns.space('ConfigurationFile'), preferencesDoc)) {\n toInsert.push(st(preferencesDoc, ns.rdf('type'), ns.space('ConfigurationFile'), preferencesDoc))\n }\n if (!store.holds(preferencesDoc, ns.dct('title'), undefined, preferencesDoc)) {\n toInsert.push(st(preferencesDoc, ns.dct('title'), literal('Preferences file'), preferencesDoc))\n }\n if (!store.holds(user, ns.solid('publicTypeIndex'), publicTypeIndex, preferencesDoc)) {\n toInsert.push(st(user, ns.solid('publicTypeIndex'), publicTypeIndex, preferencesDoc))\n }\n if (!store.holds(user, ns.solid('privateTypeIndex'), privateTypeIndex, preferencesDoc)) {\n toInsert.push(st(user, ns.solid('privateTypeIndex'), privateTypeIndex, preferencesDoc))\n }\n\n if (toInsert.length > 0) {\n await store.updater.update([], toInsert)\n await store.fetcher.load(preferencesDoc)\n }\n\n await ensurePublicTypeIndexAclOnCreate(user, publicTypeIndex, createdProfilePublicTypeIndexLink)\n await ensurePrivateTypeIndexOnCreate(privateTypeIndex)\n }\n\n async function ensurePreferencesDocExists(preferencesFile: NamedNode): Promise<boolean> {\n try {\n const created = await utilityLogic.loadOrCreateWithContentOnCreate(preferencesFile, preferencesFileDocument())\n if (created) {\n return true\n }\n return false\n } catch (err) {\n if (err.response?.status === 401) {\n throw new UnauthorizedError()\n }\n if (err.response?.status === 403) {\n if (differentOrigin(preferencesFile)) {\n throw new CrossOriginForbiddenError()\n }\n throw new SameOriginForbiddenError()\n }\n throw err\n }\n }\n\n /**\n * loads the preference without throwing errors - if it can create it it does so.\n * remark: it still throws error if it cannot load profile.\n * @param user\n * @returns undefined if preferenceFile cannot be returned or NamedNode if it can find it or create it\n */\n async function silencedLoadPreferences(user: NamedNode): Promise <NamedNode | undefined> {\n try {\n return await loadPreferences(user)\n } catch (err) {\n return undefined\n }\n }\n\n /**\n * loads the preference without returning different errors if it cannot create or load it.\n * remark: it also throws error if it cannot load profile.\n * @param user\n * @returns undefined if preferenceFile cannot be an Error or NamedNode if it can find it or create it\n */\n async function loadPreferences (user: NamedNode): Promise <NamedNode> {\n const cachedPreferencesFile = cachedPreferencesFileByWebId.get(user.uri)\n if (cachedPreferencesFile) {\n return cachedPreferencesFile\n }\n\n const inFlight = loadPreferencesInFlight.get(user.uri)\n if (inFlight) {\n return inFlight\n }\n\n const run = (async (): Promise<NamedNode> => {\n await loadProfile(user)\n\n const possiblePreferencesFile = suggestPreferencesFile(user)\n let preferencesFile\n try {\n const existingPreferencesFile = store.any(user, ns.space('preferencesFile'), null, user.doc()) as NamedNode | null\n if (existingPreferencesFile) {\n preferencesFile = existingPreferencesFile\n } else {\n preferencesFile = await utilityLogic.followOrCreateLink(user, ns.space('preferencesFile') as NamedNode, possiblePreferencesFile, user.doc())\n }\n\n await ensureOwnerOnlyAclForSettings(user, preferencesFile as NamedNode)\n await ensurePreferencesDocExists(preferencesFile as NamedNode)\n await initializePreferencesDefaults(user, preferencesFile as NamedNode)\n } catch (err) {\n const message = `User ${user} has no pointer in profile to preferences file.`\n debug.warn(message)\n // we are listing the possible errors\n if (err instanceof NotEditableError) { throw err }\n if (err instanceof WebOperationError) { throw err }\n if (err instanceof UnauthorizedError) { throw err }\n if (err instanceof CrossOriginForbiddenError) { throw err }\n if (err instanceof SameOriginForbiddenError) { throw err }\n if (err instanceof FetchError) { throw err }\n throw err\n }\n\n try {\n await store.fetcher.load(preferencesFile as NamedNode)\n } catch (err) { // Maybe a permission problem or origin problem\n const msg = `Unable to load preference of user ${user}: ${err}`\n if (err.response?.status === 404) {\n // Self-heal when a stale profile pointer references a missing preferences file.\n await ensureOwnerOnlyAclForSettings(user, preferencesFile as NamedNode)\n await ensurePreferencesDocExists(preferencesFile as NamedNode)\n await initializePreferencesDefaults(user, preferencesFile as NamedNode)\n await store.fetcher.load(preferencesFile as NamedNode)\n return preferencesFile as NamedNode\n }\n debug.warn(msg)\n if (err.response.status === 401) {\n throw new UnauthorizedError()\n }\n if (err.response.status === 403) {\n if (differentOrigin(preferencesFile)) {\n throw new CrossOriginForbiddenError()\n }\n throw new SameOriginForbiddenError()\n }\n /*if (err.response.status === 404) {\n throw new NotFoundError();\n }*/\n throw new Error(msg)\n }\n cachedPreferencesFileByWebId.set(user.uri, preferencesFile as NamedNode)\n return preferencesFile as NamedNode\n })()\n\n loadPreferencesInFlight.set(user.uri, run)\n try {\n return await run\n } finally {\n if (loadPreferencesInFlight.get(user.uri) === run) {\n loadPreferencesInFlight.delete(user.uri)\n }\n }\n }\n\n async function loadProfile (user: NamedNode):Promise <NamedNode> {\n if (!user) {\n throw new Error('loadProfile: no user given.')\n }\n try {\n await store.fetcher.load(user.doc())\n } catch (err) {\n throw new Error(`Unable to load profile of user ${user}: ${err}`)\n }\n return user.doc()\n }\n\n async function loadMe(): Promise<NamedNode> {\n const me = authn.currentUser()\n if (me === null) {\n throw new Error('Current user not found! Not logged in?')\n }\n await store.fetcher.load(me.doc())\n return me\n }\n\n function getPodRoot(user: NamedNode): NamedNode {\n const podRoot = findStorage(user)\n if (!podRoot) {\n throw new Error('User pod root not found!')\n }\n return podRoot as NamedNode\n }\n\n async function getMainInbox(user: NamedNode): Promise<NamedNode> {\n await store.fetcher.load(user)\n const mainInbox = store.any(user, ns.ldp('inbox'), undefined, user.doc())\n if (!mainInbox) {\n throw new Error('User main inbox not found!')\n }\n return mainInbox as NamedNode\n }\n\n function findStorage(me: NamedNode) {\n return store.any(me, ns.space('storage'), undefined, me.doc())\n }\n\n return {\n loadMe,\n getPodRoot,\n getMainInbox,\n findStorage,\n loadPreferences,\n loadProfile,\n silencedLoadPreferences\n }\n}\n","export function ownerOnlyContainerAclDocument(webId: string): string {\n return [\n '@prefix acl: <http://www.w3.org/ns/auth/acl#>.',\n '',\n '<#owner>',\n 'a acl:Authorization;',\n `acl:agent <${webId}>;`,\n 'acl:accessTo <./>;',\n 'acl:default <./>;',\n 'acl:mode acl:Read, acl:Write, acl:Control.'\n ].join('\\n')\n}\n","export function preferencesFileDocument(): string {\n return [\n '@prefix dct: <http://purl.org/dc/terms/>.',\n '@prefix pim: <http://www.w3.org/ns/pim/space#>.',\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a pim:ConfigurationFile ;',\n ' dct:title \"Preferences file\".'\n ].join('\\n')\n}\n","import { NamedNode, st, sym } from 'rdflib'\nimport { ScopedApp, TypeIndexLogic, TypeIndexScope } from '../types'\nimport * as debug from '../util/debug'\nimport { ns as namespace } from '../util/ns'\nimport { newThing } from '../util/utils'\nimport { privateTypeIndexDocument, publicTypeIndexDocument } from './typeIndexDocuments'\n\nexport function createTypeIndexLogic(store, authn, profileLogic, utilityLogic): TypeIndexLogic {\n const ns = namespace\n\n function isAbsoluteHttpUri(uri: string | null | undefined): boolean {\n return !!uri && (uri.startsWith('https://') || uri.startsWith('http://'))\n }\n\n function getRegistrations(instance, theClass) {\n return store\n .each(undefined, ns.solid('instance'), instance)\n .filter((r) => {\n return store.holds(r, ns.solid('forClass'), theClass)\n })\n }\n\n async function loadTypeIndexesFor(user: NamedNode): Promise<Array<TypeIndexScope>> {\n if (!user) throw new Error('loadTypeIndexesFor: No user given')\n const profile = await profileLogic.loadProfile(user)\n\n let suggestion: NamedNode | null = null\n try {\n suggestion = suggestPublicTypeIndex(user)\n } catch (err) {\n const message = `User ${user} has no usable profile document directory for publicTypeIndex.`\n debug.warn(message)\n }\n let publicTypeIndex\n try {\n const existingPublicTypeIndex = store.any(user, ns.solid('publicTypeIndex'), undefined, profile)\n if (existingPublicTypeIndex) {\n publicTypeIndex = existingPublicTypeIndex\n } else if (suggestion) {\n publicTypeIndex = await utilityLogic.followOrCreateLinkWithContentOnCreate(\n user,\n ns.solid('publicTypeIndex') as NamedNode,\n suggestion,\n profile,\n publicTypeIndexDocument()\n )\n } else {\n publicTypeIndex = null\n }\n } catch (err) {\n const message = `User ${user} has no pointer in profile to publicTypeIndex file: ${err}`\n debug.warn(message)\n }\n const publicScopes = publicTypeIndex ? [{ label: 'public', index: publicTypeIndex as NamedNode, agent: user }] : []\n\n let preferencesFile\n try {\n preferencesFile = await profileLogic.silencedLoadPreferences(user)\n } catch (err) {\n preferencesFile = null\n }\n\n let privateScopes\n if (preferencesFile) { // watch out - can be in either as spec was not clear. Legacy is profile.\n // If there is a legacy one linked from the profile, use that.\n // Otherwiae use or make one linked from Preferences\n let suggestedPrivateTypeIndex: NamedNode | null = null\n try {\n suggestedPrivateTypeIndex = suggestPrivateTypeIndex(preferencesFile)\n } catch (err) {\n const message = `User ${user} has no usable preferences document directory for privateTypeIndex.`\n debug.warn(message)\n }\n let privateTypeIndex\n try {\n const existingPrivateTypeIndex = store.any(user, ns.solid('privateTypeIndex'), undefined, profile)\n if (existingPrivateTypeIndex) {\n privateTypeIndex = existingPrivateTypeIndex\n } else if (suggestedPrivateTypeIndex) {\n privateTypeIndex = await utilityLogic.followOrCreateLinkWithContentOnCreate(\n user,\n ns.solid('privateTypeIndex') as NamedNode,\n suggestedPrivateTypeIndex,\n preferencesFile,\n privateTypeIndexDocument()\n )\n } else {\n privateTypeIndex = null\n }\n } catch (err) {\n const message = `User ${user} has no pointer in preference file to privateTypeIndex file: ${err}`\n debug.warn(message)\n }\n privateScopes = privateTypeIndex ? [{ label: 'private', index: privateTypeIndex as NamedNode, agent: user }] : []\n } else {\n privateScopes = []\n }\n const scopes = publicScopes.concat(privateScopes)\n if (scopes.length === 0) return scopes\n const files = scopes.map(scope => scope.index)\n try {\n await store.fetcher.load(files)\n } catch (err) {\n debug.warn('Problems loading type index: ', err)\n }\n return scopes\n }\n\n async function loadCommunityTypeIndexes(user: NamedNode): Promise<TypeIndexScope[]> {\n let preferencesFile\n try {\n preferencesFile = await profileLogic.silencedLoadPreferences(user)\n } catch (err) {\n const message = `User ${user} has no pointer in profile to preferences file.`\n debug.warn(message)\n }\n if (preferencesFile) { // For now, pick up communities as simple links from the preferences file.\n const communities = store.each(user, ns.solid('community'), undefined, preferencesFile as NamedNode).concat(\n store.each(user, ns.solid('community'), undefined, user.doc() as NamedNode)\n )\n let result = []\n for (const org of communities) {\n if (org.termType !== 'NamedNode' || !isAbsoluteHttpUri((org as NamedNode).uri)) {\n debug.warn(`Skipping malformed community node for ${user}: ${org}`)\n continue\n }\n try {\n result = result.concat(await loadTypeIndexesFor(org as NamedNode) as any)\n } catch (err) {\n debug.warn(`Skipping community type indexes for ${(org as NamedNode).uri}: ${err}`)\n }\n }\n return result\n }\n return [] // No communities\n }\n\n async function loadAllTypeIndexes(user: NamedNode) {\n return (await loadTypeIndexesFor(user)).concat(await loadCommunityTypeIndexes(user))\n }\n\n async function getScopedAppInstances(klass: NamedNode, user: NamedNode): Promise<ScopedApp[]> {\n const scopes = await loadAllTypeIndexes(user)\n let scopedApps = []\n for (const scope of scopes) {\n const scopedApps0 = await getScopedAppsFromIndex(scope, klass) as any\n scopedApps = scopedApps.concat(scopedApps0)\n }\n return scopedApps\n }\n\n // This is the function signature which used to be in solid-ui/logic\n // Recommended to use getScopedAppInstances instead as it provides more information.\n //\n async function getAppInstances(klass: NamedNode): Promise<NamedNode[]> {\n const user = authn.currentUser()\n if (!user) throw new Error('getAppInstances: Must be logged in to find apps.')\n const scopedAppInstances = await getScopedAppInstances(klass, user)\n return scopedAppInstances.map(scoped => scoped.instance)\n }\n\n function docDirUri(node: NamedNode): string | null {\n const doc = node.doc()\n const dir = doc.dir()\n if (dir?.uri && isAbsoluteHttpUri(dir.uri)) return dir.uri\n const docUri = doc.uri\n if (!docUri || !isAbsoluteHttpUri(docUri)) {\n debug.log(`docDirUri: missing or non-http(s) doc uri for ${node?.uri}`)\n return null\n }\n const withoutFragment = docUri.split('#')[0]\n const lastSlash = withoutFragment.lastIndexOf('/')\n if (lastSlash === -1) {\n debug.log(`docDirUri: no slash in doc uri ${docUri}`)\n return null\n }\n return withoutFragment.slice(0, lastSlash + 1)\n }\n\n function suggestPublicTypeIndex(me: NamedNode) {\n const dirUri = docDirUri(me)\n if (!dirUri) throw new Error(`suggestPublicTypeIndex: Cannot derive directory for ${me.uri}`)\n return sym(dirUri + 'publicTypeIndex.ttl')\n }\n // Note this one is based off the pref file not the profile\n\n function suggestPrivateTypeIndex(preferencesFile: NamedNode) {\n const dirUri = docDirUri(preferencesFile)\n if (!dirUri) throw new Error(`suggestPrivateTypeIndex: Cannot derive directory for ${preferencesFile.uri}`)\n return sym(dirUri + 'privateTypeIndex.ttl')\n }\n\n /*\n * Register a new app in a type index\n * used in chat in bookmark.js (solid-ui)\n * Returns the registration object if successful else null\n */\n async function registerInTypeIndex(\n instance: NamedNode,\n index: NamedNode,\n theClass: NamedNode,\n // agent: NamedNode\n ): Promise<NamedNode | null> {\n const registration = newThing(index)\n const ins = [\n // See https://github.com/solid/solid/blob/main/proposals/data-discovery.md\n st(registration, ns.rdf('type'), ns.solid('TypeRegistration'), index),\n st(registration, ns.solid('forClass'), theClass, index),\n st(registration, ns.solid('instance'), instance, index)\n ]\n try {\n await store.updater.update([], ins)\n } catch (err) {\n const msg = `Unable to register ${instance} in index ${index}: ${err}`\n console.warn(msg)\n return null\n }\n return registration\n }\n\n async function deleteTypeIndexRegistration(item) {\n const reg = store.the(null, ns.solid('instance'), item.instance, item.scope.index) as NamedNode\n if (!reg) throw new Error(`deleteTypeIndexRegistration: No registration found for ${item.instance}`)\n const statements = store.statementsMatching(reg, null, null, item.scope.index)\n await store.updater.update(statements, [])\n }\n\n async function getScopedAppsFromIndex(scope: TypeIndexScope, theClass: NamedNode | null): Promise<ScopedApp[]> {\n const index = scope.index\n const results: ScopedApp[] = []\n const registrations = store.statementsMatching(null, ns.solid('instance'), null, index)\n .concat(store.statementsMatching(null, ns.solid('instanceContainer'), null, index))\n .map(st => st.subject)\n for (const reg of registrations) {\n const klass = store.any(reg, ns.solid('forClass'), null, index)\n if (!theClass || klass.sameTerm(theClass)) {\n const instances = store.each(reg, ns.solid('instance'), null, index)\n for (const instance of instances) {\n results.push({ instance, type: klass, scope })\n }\n const containers = store.each(reg, ns.solid('instanceContainer'), null, index)\n for (const instance of containers) {\n await store.fetcher.load(instance)\n results.push({ instance: sym(instance.value), type: klass, scope })\n }\n }\n }\n return results\n }\n\n return {\n registerInTypeIndex,\n getRegistrations,\n loadTypeIndexesFor,\n loadCommunityTypeIndexes,\n loadAllTypeIndexes,\n getScopedAppInstances,\n getAppInstances,\n suggestPublicTypeIndex,\n suggestPrivateTypeIndex,\n deleteTypeIndexRegistration,\n getScopedAppsFromIndex\n }\n}\n","import * as rdf from 'rdflib'\nimport { LiveStore, NamedNode, Statement } from 'rdflib'\nimport { createAclLogic } from '../acl/aclLogic'\nimport { SolidAuthnLogic } from '../authn/SolidAuthnLogic'\nimport type { SessionWithLegacyEvents } from '../authSession/authSession'\nimport { createChatLogic } from '../chat/chatLogic'\nimport { createInboxLogic } from '../inbox/inboxLogic'\nimport { createProfileLogic } from '../profile/profileLogic'\nimport { createTypeIndexLogic } from '../typeIndex/typeIndexLogic'\nimport { createContainerLogic } from '../util/containerLogic'\nimport { createUtilityLogic } from '../util/utilityLogic'\nimport type { AuthnLogic, SolidLogic } from '../types'\nimport * as debug from '../util/debug'\n/*\n** It is important to distinquish `fetch`, a function provided by the browser\n** and `Fetcher`, a helper object for the rdflib Store which turns it\n** into a `ConnectedStore` or a `LiveStore`. A Fetcher object is\n** available at store.fetcher, and `fetch` function at `store.fetcher._fetch`,\n*/\nexport function createSolidLogic(specialFetch: { fetch: (url: any, requestInit: any) => any }, session: SessionWithLegacyEvents): SolidLogic {\n\n debug.log('SolidLogic: Unique instance created. There should only be one of these.')\n const store: LiveStore = rdf.graph() as LiveStore\n rdf.fetcher(store, {fetch: specialFetch.fetch}) // Attach a web I/O module, store.fetcher\n store.updater = new rdf.UpdateManager(store) // Add real-time live updates store.updater\n store.features = [] // disable automatic node merging on store load\n\n const authn: AuthnLogic = new SolidAuthnLogic(session)\n \n const acl = createAclLogic(store)\n const containerLogic = createContainerLogic(store)\n const utilityLogic = createUtilityLogic(store, acl, containerLogic)\n const profile = createProfileLogic(store, authn, utilityLogic)\n const chat = createChatLogic(store, profile)\n const inbox = createInboxLogic(store, profile, utilityLogic, containerLogic, acl)\n const typeIndex = createTypeIndexLogic(store, authn, profile, utilityLogic)\n debug.log('SolidAuthnLogic initialized')\n\n function load(doc: NamedNode | NamedNode[] | string) {\n return store.fetcher.load(doc)\n }\n\n // @@@@ use the one in rdflib.js when it is available and delete this\n function updatePromise(\n del: Array<Statement>,\n ins: Array<Statement> = []\n ): Promise<void> {\n return new Promise((resolve, reject) => {\n store.updater.update(del, ins, function (_uri, ok, errorBody) {\n if (!ok) {\n reject(new Error(errorBody))\n } else {\n resolve()\n }\n }) // callback\n }) // promise\n }\n\n function clearStore() {\n store.statements.slice().forEach(store.remove.bind(store))\n }\n\n return {\n store,\n authn,\n acl,\n inbox,\n chat,\n profile,\n typeIndex,\n load,\n updatePromise,\n clearStore\n }\n}\n","import { NamedNode, st, sym } from 'rdflib'\nimport {\n CrossOriginForbiddenError,\n FetchError,\n NotEditableError,\n SameOriginForbiddenError,\n UnauthorizedError,\n WebOperationError\n} from '../logic/CustomError'\nimport * as debug from '../util/debug'\nimport { differentOrigin } from './utils'\n\nexport function createUtilityLogic(store, aclLogic, containerLogic) {\n async function recursiveDelete(containerNode: NamedNode) {\n try {\n if (containerLogic.isContainer(containerNode)) {\n const aclDocUrl = await aclLogic.findAclDocUrl(containerNode)\n await store.fetcher._fetch(aclDocUrl, { method: 'DELETE' })\n const containerMembers = await containerLogic.getContainerMembers(containerNode)\n await Promise.all(containerMembers.map((url) => recursiveDelete(url)))\n }\n return store.fetcher._fetch(containerNode.value, { method: 'DELETE' })\n } catch (e) {\n debug.log(`Please manually remove ${containerNode.value} from your system.`, e)\n }\n }\n\n /**\n * Create a resource if it really does not exist.\n * Be absolutely sure something does not exist before creating a new empty file,\n * as otherwise existing content could be deleted.\n */\n async function loadOrCreateIfNotExists(doc: NamedNode) {\n try {\n return await store.fetcher.load(doc)\n } catch (err: any) {\n if (err?.response?.status === 404) {\n try {\n await store.fetcher.webOperation('PUT', doc.uri, {\n data: '',\n contentType: 'text/turtle',\n headers: { 'If-None-Match': '*' }\n })\n } catch (putErr: any) {\n const status = putErr?.response?.status ?? putErr?.status\n if (status !== 412) {\n const msg = `createIfNotExists: PUT FAILED: ${doc}: ${putErr}`\n throw new WebOperationError(msg)\n }\n }\n return await store.fetcher.load(doc)\n }\n if (err?.response?.status === 401) {\n throw new UnauthorizedError()\n }\n if (err?.response?.status === 403) {\n if (differentOrigin(doc)) {\n throw new CrossOriginForbiddenError()\n }\n throw new SameOriginForbiddenError()\n }\n const msg = `createIfNotExists doc load error: ${doc}: ${err}`\n throw new FetchError(err?.status, `${err?.message || ''}${msg}`)\n }\n }\n\n async function loadOrCreateWithContentOnCreate(doc: NamedNode, data: string): Promise<boolean> {\n try {\n await store.fetcher.load(doc)\n return false\n } catch (err: any) {\n const status = err?.response?.status ?? err?.status\n if (status !== 404) {\n throw err\n }\n }\n\n try {\n await store.fetcher.webOperation('PUT', doc.uri, {\n data,\n contentType: 'text/turtle',\n headers: { 'If-None-Match': '*' }\n })\n return true\n } catch (err: any) {\n const status = err?.response?.status ?? err?.status\n if (status === 412) {\n // Another client created the resource between our 404 check and PUT.\n return false\n }\n throw err\n }\n }\n\n /*\n * Follow link from this doc to another thing, or else make a new link.\n * Returns existing object, or creates it if non-existent.\n */\n async function followOrCreateLink(\n subject: NamedNode,\n predicate: NamedNode,\n object: NamedNode,\n doc: NamedNode\n ): Promise<NamedNode | null> {\n await store.fetcher.load(doc)\n const result = store.any(subject, predicate, null, doc)\n\n if (result) return result as NamedNode\n if (!store.updater.editable(doc)) {\n const msg = `followOrCreateLink: cannot edit ${doc.value}`\n debug.warn(msg)\n throw new NotEditableError(msg)\n }\n\n try {\n await store.updater.update([], [st(subject, predicate, object, doc)])\n } catch (err) {\n const msg = `followOrCreateLink: Error making link in ${doc} to ${object}: ${err}`\n debug.warn(msg)\n throw new WebOperationError(err)\n }\n\n try {\n await loadOrCreateIfNotExists(object)\n } catch (err) {\n debug.warn(`followOrCreateLink: Error loading or saving new linked document: ${object}: ${err}`)\n throw err\n }\n return object\n }\n\n async function followOrCreateLinkWithContentOnCreate(\n subject: NamedNode,\n predicate: NamedNode,\n object: NamedNode,\n doc: NamedNode,\n data: string\n ): Promise<NamedNode | null> {\n await store.fetcher.load(doc)\n const result = store.any(subject, predicate, null, doc)\n\n if (result) return result as NamedNode\n if (!store.updater.editable(doc)) {\n const msg = `followOrCreateLinkWithContentOnCreate: cannot edit ${doc.value}`\n debug.warn(msg)\n throw new NotEditableError(msg)\n }\n\n try {\n await store.updater.update([], [st(subject, predicate, object, doc)])\n } catch (err) {\n const msg = `followOrCreateLinkWithContentOnCreate: Error making link in ${doc} to ${object}: ${err}`\n debug.warn(msg)\n throw new WebOperationError(msg)\n }\n\n try {\n await loadOrCreateWithContentOnCreate(object, data)\n } catch (err) {\n debug.warn(`followOrCreateLinkWithContentOnCreate: Error loading or saving new linked document: ${object}: ${err}`)\n throw err\n }\n return object\n }\n\n // Copied from\n // https://github.com/solidos/web-access-control-tests/blob/v3.0.0/test/surface/delete.test.ts#L5\n async function setSinglePeerAccess(options: {\n ownerWebId: string,\n peerWebId: string,\n accessToModes?: string,\n defaultModes?: string,\n target: string\n }) {\n let str = [\n '@prefix acl: <http://www.w3.org/ns/auth/acl#>.',\n '',\n '<#alice> a acl:Authorization;\\n acl:agent <' + options.ownerWebId + '>;',\n ` acl:accessTo <${options.target}>;`,\n ` acl:default <${options.target}>;`,\n ' acl:mode acl:Read, acl:Write, acl:Control.',\n ''\n ].join('\\n')\n\n if (options.accessToModes) {\n str += [\n '<#bobAccessTo> a acl:Authorization;',\n ` acl:agent <${options.peerWebId}>;`,\n ` acl:accessTo <${options.target}>;`,\n ` acl:mode ${options.accessToModes}.`,\n ''\n ].join('\\n')\n }\n\n if (options.defaultModes) {\n str += [\n '<#bobDefault> a acl:Authorization;',\n ` acl:agent <${options.peerWebId}>;`,\n ` acl:default <${options.target}>;`,\n ` acl:mode ${options.defaultModes}.`,\n ''\n ].join('\\n')\n }\n\n const aclDocUrl = await aclLogic.findAclDocUrl(sym(options.target))\n return store.fetcher._fetch(aclDocUrl, {\n method: 'PUT',\n body: str,\n headers: [['Content-Type', 'text/turtle']]\n })\n }\n\n async function createEmptyRdfDoc(doc: NamedNode, comment: string) {\n await store.fetcher.webOperation('PUT', doc.uri, {\n data: `# ${new Date()} ${comment}\\n`,\n contentType: 'text/turtle'\n })\n }\n\n return {\n recursiveDelete,\n setSinglePeerAccess,\n createEmptyRdfDoc,\n followOrCreateLink,\n followOrCreateLinkWithContentOnCreate,\n loadOrCreateIfNotExists,\n loadOrCreateWithContentOnCreate\n }\n}\n","import * as debug from '../util/debug'\nimport { authSession } from '../authSession/authSession'\nimport { createSolidLogic } from './solidLogic'\nimport { SolidLogic } from '../types'\n\nconst _fetch = async (url, requestInit) => {\n const omitCreds = requestInit && requestInit.credentials && requestInit.credentials == 'omit'\n const sessionAny = authSession as any\n const sessionWebId = sessionAny?.info?.webId || sessionAny?.webId\n if (sessionWebId && !omitCreds) { // see https://github.com/solidos/solidos/issues/114\n // In fact fetch should respect credentials omit itself\n const authenticatedFetch = (typeof sessionAny.fetch === 'function')\n ? sessionAny.fetch.bind(sessionAny)\n : (typeof sessionAny.authFetch === 'function' ? sessionAny.authFetch.bind(sessionAny) : null)\n if (authenticatedFetch) {\n return authenticatedFetch(url, requestInit)\n }\n return window.fetch(url, requestInit)\n } else {\n return window.fetch(url, requestInit)\n }\n}\n\n// Global singleton pattern to ensure unique store across library versions\nconst SINGLETON_SYMBOL = Symbol.for('solid-logic-singleton')\n\n// Type the global object properly with the singleton\ninterface GlobalWithSingleton {\n [SINGLETON_SYMBOL]?: SolidLogic\n}\n\nconst globalTarget = (typeof window !== 'undefined' ? window : global) as GlobalWithSingleton\n\nfunction getOrCreateSingleton(): SolidLogic {\n if (!globalTarget[SINGLETON_SYMBOL]) {\n debug.log('SolidLogic: Creating new global singleton instance.')\n globalTarget[SINGLETON_SYMBOL] = createSolidLogic({ fetch: _fetch }, authSession)\n debug.log('Unique quadstore initialized.')\n } else {\n debug.log('SolidLogic: Using existing global singleton instance.')\n }\n return globalTarget[SINGLETON_SYMBOL]!\n}\n//this const makes solidLogicSingleton global accessible in mashlib\nconst solidLogicSingleton = getOrCreateSingleton()\n\nexport { solidLogicSingleton }","export type ServerLogoutOptions = {\n issuer?: string\n postLogoutRedirectPath?: string\n}\n\nexport async function performServerSideLogout (options: ServerLogoutOptions = {}): Promise<boolean> {\n if (typeof window === 'undefined') {\n return false\n }\n const issuer = options.issuer || ''\n const postLogoutRedirectPath = options.postLogoutRedirectPath || '/'\n\n // Provider-specific logout endpoint discovery (OIDC end_session_endpoint).\n try {\n if (issuer) {\n const wellKnownUri = new URL(issuer)\n wellKnownUri.pathname = '/.well-known/openid-configuration'\n const wellKnownResult = await fetch(wellKnownUri.toString(), { credentials: 'include' })\n\n if (wellKnownResult.status === 200) {\n const openidConfiguration = await wellKnownResult.json()\n if (openidConfiguration && openidConfiguration.end_session_endpoint) {\n await fetch(openidConfiguration.end_session_endpoint, { credentials: 'include' })\n }\n }\n }\n } catch (_err) {\n // Continue with local logout even if provider logout is unavailable.\n }\n\n // NSS well-known logout endpoint clears cookie-backed server sessions.\n try {\n const logoutResponse = await fetch('/.well-known/solid/logout', { credentials: 'include' })\n if (logoutResponse.ok || logoutResponse.redirected) {\n window.location.assign(postLogoutRedirectPath)\n return true\n }\n } catch (_err) {\n // Not all deployments expose this endpoint.\n }\n\n return false\n}","const DEFAULT_ISSUERS = [\n {\n name: 'Solid Community',\n uri: 'https://solidcommunity.net'\n },\n {\n name: 'Solid Web',\n uri: 'https://solidweb.org'\n },\n {\n name: 'Solid Web ME',\n uri: 'https://solidweb.me'\n },\n {\n name: 'Inrupt.com',\n uri: 'https://login.inrupt.com'\n }\n]\n\n/**\n * @returns - A list of suggested OIDC issuers\n */\nexport function getSuggestedIssuers (): { name: string, uri: string }[] {\n // Suggest a default list of OIDC issuers\n const issuers = [...DEFAULT_ISSUERS]\n \n // Suggest the current host if not already included\n const { host, origin } = new URL(location.href)\n const hosts = issuers.map(({ uri }) => new URL(uri).host)\n if (!hosts.includes(host)) {\n issuers.unshift({ name: host, uri: origin })\n }\n \n return issuers\n }","// Make these variables directly accessible as it is what you need most of the time\n// This also makes these variable globaly accesible in mashlib\nimport { solidLogicSingleton } from './logic/solidLogicSingleton'\n\nconst authn = solidLogicSingleton.authn\nconst authSession = solidLogicSingleton.authn.authSession\nconst store = solidLogicSingleton.store\n\nexport { ACL_LINK } from './acl/aclLogic'\nexport { offlineTestID, appContext } from './authn/authUtil'\nexport { performServerSideLogout } from './authn/serverLogout'\nexport { getSuggestedIssuers } from './issuer/issuerLogic'\nexport { createTypeIndexLogic } from './typeIndex/typeIndexLogic'\nexport type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ChatLogic } from './types'\nexport { UnauthorizedError, CrossOriginForbiddenError, SameOriginForbiddenError, NotFoundError, FetchError, NotEditableError, WebOperationError } from './logic/CustomError'\n\nexport {\n solidLogicSingleton, // solidLogicSingleton is exported entirely because it is used in solid-panes\n store,\n authn,\n authSession\n}\n\n"],"names":["aliases","acl","arg","as","bookmark","cal","cco","cert","contact","dc","dct","doap","foaf","geo","gpx","gr","http","httph","icalTZ","ldp","link","log","meeting","mo","org","owl","pad","patch","prov","pto","qu","trip","rdf","rdfs","rss","sched","schema","sioc","skos","solid","space","stat","tab","tabont","ui","vann","vcard","wf","xsd","module","exports","namedNode","u","namespaces","alias","expansion","localName","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","args","console","warn","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","g","globalThis","this","Function","e","window","obj","prop","prototype","hasOwnProperty","call","core_namespaceObject","__WEBPACK_EXTERNAL_MODULE__uvdsl_solid_oidc_client_browser_core_9566af4e__","MemorySessionDatabase","constructor","map","Map","shouldPreserveExistingRefreshToken","id","value","has","init","setItem","set","getItem","deleteItem","delete","clear","close","IndexedDbSessionDatabase","db","dbName","storeName","dbVersion","existing","indexedDB","Error","Promise","resolve","reject","request","open","onerror","error","onsuccess","result","onupgradeneeded","objectStoreNames","contains","createObjectStore","withStore","store","put","mode","op","tx","transaction","objectStore","_a","onabort","_b","oncomplete","SessionCoreCtor","coreAny","candidate","_c","SessionCore","default","getSessionCoreCtor","_session","host","location","hostname","endsWith","database","__WEBPACK_EXTERNAL_MODULE__uvdsl_solid_oidc_client_browser_144ab6cc_Session__","dbError","createSession","async","resolveIssuerForLogin","issuer","discoveredIssuer","issuerUrl","URL","wellKnownUrl","origin","wellKnownResponse","fetch","toString","credentials","ok","wellKnownPayload","json","replace","_err","discoverIssuerFromWellKnown","sessionAny","originalLogin","login","bind","compatLogin","idpOrOptions","redirectUri","Array","isArray","oidcIssuer","idp","redirectUrl","_d","redirect_uri","events","listeners","on","event","handler","Set","add","off","emit","forEach","h","_wasActive","isActive","Boolean","webId","addEventListener","isNowActive","authSession","assign","configurable","isLoggedIn","external_rdflib_namespaceObject","__WEBPACK_EXTERNAL_MODULE_rdflib__","ns_ns","solid_namespace_default","ACL_LINK","sym","createAclLogic","ns","genACLText","docURI","me","aclURI","options","optPublic","public","graph","auth","Namespace","doc","defaultForNew","length","p","serialize","findAclDocUrl","url","fetcher","load","docNode","any","setACLUserPublic","aclDoc","then","fetchACLRel","catch","err","aclText","uri","webOperation","data","contentType","appContext","SolidAppContext","viewingNoAuthPage","noAuth","document","href","startsWith","params","URLSearchParams","search","viewedPage","decodeURI","ary","split","offlineTestID","$SolidTestEnvironment","username","slice","div","getElementById","getAttribute","SolidAuthnLogic","solidAuthSession","checkUserInFlight","sessionRestoreHookAttached","fallbackWebId","session","currentUser","app","infoWebId","info","sessionWebId","infoLoggedIn","sessionActive","checkUser","setUserCallback","preLoginRedirectHash","hash","localStorage","history","replaceState","resolveCurrentUser","inFlight","handleIncomingRedirect","restorePreviousSession","restore","wasActive","message","String","test","handleRedirectFromLogin","_e","_f","postLoginRedirectHash","curUrl","pushState","title","webIdFromSession","probeNssCookieBackedWebId","saveUser","port","protocol","localhostSuffix","podName","includes","redirect","cache","status","_error","context","webIdUri","sessionInfo","sessionRoot","rootLoggedIn","rootActive","newThing","Date","now","differentOrigin","CHAT_LOCATION_IN_CONTAINER","createChatLogic","profileLogic","setAcl","chatContainer","invitee","chatAclDoc","NamedNode","aclBody","addToPrivateTypeIndex","chatThing","privateTypeIndex","reg","ins","st","updater","update","_uri","errm","findChat","loadMe","podRoot","chatContainerStr","determineChatContainer","getPodRoot","exists","createChatThing","mintNew","newBase","newInstance","newPaneOptions","kb","newChatDoc","term","statementsMatching","uri2","sendInvite","inviteeInbox","inviteBody","inviteResponse","headers","getChat","createIfMissing","createInboxLogic","utilityLogic","containerLogic","aclLogic","createInboxFor","peerWebId","nick","myWebId","ourInbox","encodeURIComponent","createContainer","setSinglePeerAccess","ownerWebId","accessToModes","target","getNewMessages","user","inbox","getMainInbox","getContainerMembers","filter","isContainer","markAsRead","date","downloaded","_fetch","archiveUrl","baseUrl","year","getUTCFullYear","month","getUTCMonth","day","getUTCDate","parts","filename","getArchiveUrl","method","body","text","CustomError","super","setPrototypeOf","name","UnauthorizedError","CrossOriginForbiddenError","SameOriginForbiddenError","NotFoundError","NotEditableError","WebOperationError","FetchError","publicTypeIndexDocument","join","privateTypeIndexDocument","publicTypeIndexAclDocument","publicTypeIndexUri","fileName","pathname","pop","createContainerLogic","getContainerElements","containerNode","object","nodeToString","charAt","Link","containerUrl","createProfileLogic","authn","loadPreferencesInFlight","cachedPreferencesFileByWebId","isAbsoluteHttpUri","docDirUri","node","dir","docUri","withoutFragment","lastSlash","lastIndexOf","suggestTypeIndexInPreferences","preferencesFile","dirUri","isNotFoundError","response","ensureOwnerOnlyAclForSettings","containerUri","ensureContainerExists","aclDocUri","initializePreferencesDefaults","preferencesDoc","profileDoc","profilePublicTypeIndex","preferencesPublicTypeIndex","publicTypeIndex","createdProfilePublicTypeIndexLink","followOrCreateLinkWithContentOnCreate","toInsert","holds","push","literal","ensureAcl","loadOrCreateWithContentOnCreate","ensurePublicTypeIndexAclOnCreate","ensurePrivateTypeIndexOnCreate","ensurePreferencesDocExists","loadPreferences","cachedPreferencesFile","run","loadProfile","possiblePreferencesFile","fileURI","folderURI","suggestPreferencesFile","existingPreferencesFile","followOrCreateLink","msg","findStorage","mainInbox","silencedLoadPreferences","createTypeIndexLogic","loadTypeIndexesFor","profile","suggestion","suggestPublicTypeIndex","existingPublicTypeIndex","publicScopes","label","index","agent","privateScopes","suggestedPrivateTypeIndex","suggestPrivateTypeIndex","existingPrivateTypeIndex","scopes","concat","files","scope","loadCommunityTypeIndexes","communities","each","termType","loadAllTypeIndexes","getScopedAppInstances","klass","scopedApps","scopedApps0","getScopedAppsFromIndex","theClass","results","registrations","subject","sameTerm","instances","instance","type","containers","registerInTypeIndex","registration","getRegistrations","r","getAppInstances","scoped","deleteTypeIndexRegistration","item","the","statements","createSolidLogic","specialFetch","UpdateManager","features","loadOrCreateIfNotExists","putErr","recursiveDelete","aclDocUrl","containerMembers","all","str","defaultModes","createEmptyRdfDoc","comment","predicate","editable","createUtilityLogic","chat","typeIndex","updatePromise","del","errorBody","clearStore","remove","requestInit","omitCreds","authenticatedFetch","authFetch","SINGLETON_SYMBOL","Symbol","for","globalTarget","solidLogicSingleton","performServerSideLogout","postLogoutRedirectPath","wellKnownUri","wellKnownResult","openidConfiguration","end_session_endpoint","logoutResponse","redirected","DEFAULT_ISSUERS","getSuggestedIssuers","issuers","unshift","src_authSession"],"sourceRoot":""}
|