solid-logic 6.0.0 → 6.0.1-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.
Files changed (164) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs.js +1 -1
  2. package/dist/acl/accessControlSubjects.cjs.js +2 -0
  3. package/dist/acl/accessControlSubjects.cjs.js.map +1 -0
  4. package/dist/acl/accessControlSubjects.d.ts +8 -0
  5. package/dist/acl/accessControlSubjects.d.ts.map +1 -0
  6. package/dist/acl/accessControlSubjects.esm.js +75 -0
  7. package/dist/acl/accessControlSubjects.esm.js.map +1 -0
  8. package/dist/acl/aclLogic.cjs.js +1 -1
  9. package/dist/acl/aclLogic.cjs.js.map +1 -1
  10. package/dist/acl/aclLogic.d.ts +7 -0
  11. package/dist/acl/aclLogic.d.ts.map +1 -0
  12. package/dist/acl/aclLogic.esm.js +111 -27
  13. package/dist/acl/aclLogic.esm.js.map +1 -1
  14. package/dist/authSession/authSession.cjs.js.map +1 -1
  15. package/dist/authSession/authSession.d.ts +42 -0
  16. package/dist/authSession/authSession.d.ts.map +1 -0
  17. package/dist/authSession/authSession.esm.js.map +1 -1
  18. package/dist/authSession/events.cjs.js.map +1 -1
  19. package/dist/authSession/events.d.ts +25 -0
  20. package/dist/authSession/events.d.ts.map +1 -0
  21. package/dist/authSession/events.esm.js.map +1 -1
  22. package/dist/authSession/flagAuthorizationOnTransitions.cjs.js +1 -1
  23. package/dist/authSession/flagAuthorizationOnTransitions.cjs.js.map +1 -1
  24. package/dist/authSession/flagAuthorizationOnTransitions.d.ts +76 -0
  25. package/dist/authSession/flagAuthorizationOnTransitions.d.ts.map +1 -0
  26. package/dist/authSession/flagAuthorizationOnTransitions.esm.js +1 -1
  27. package/dist/authSession/flagAuthorizationOnTransitions.esm.js.map +1 -1
  28. package/dist/authSession/identityState.cjs.js +1 -1
  29. package/dist/authSession/identityState.cjs.js.map +1 -1
  30. package/dist/authSession/identityState.d.ts +199 -0
  31. package/dist/authSession/identityState.d.ts.map +1 -0
  32. package/dist/authSession/identityState.esm.js +1 -1
  33. package/dist/authSession/identityState.esm.js.map +1 -1
  34. package/dist/authSession/issuer.d.ts +8 -0
  35. package/dist/authSession/issuer.d.ts.map +1 -0
  36. package/dist/authSession/session.cjs.js +1 -1
  37. package/dist/authSession/session.cjs.js.map +1 -1
  38. package/dist/authSession/session.d.ts +45 -0
  39. package/dist/authSession/session.d.ts.map +1 -0
  40. package/dist/authSession/session.esm.js +1 -1
  41. package/dist/authSession/session.esm.js.map +1 -1
  42. package/dist/authn/SolidAuthnLogic.cjs.js.map +1 -1
  43. package/dist/authn/SolidAuthnLogic.d.ts +61 -0
  44. package/dist/authn/SolidAuthnLogic.d.ts.map +1 -0
  45. package/dist/authn/SolidAuthnLogic.esm.js.map +1 -1
  46. package/dist/authn/authUtil.cjs.js.map +1 -1
  47. package/dist/authn/authUtil.d.ts +17 -0
  48. package/dist/authn/authUtil.d.ts.map +1 -0
  49. package/dist/authn/serverLogout.d.ts +6 -0
  50. package/dist/authn/serverLogout.d.ts.map +1 -0
  51. package/dist/chat/chatLogic.cjs.js +1 -1
  52. package/dist/chat/chatLogic.cjs.js.map +1 -1
  53. package/dist/chat/chatLogic.d.ts +3 -0
  54. package/dist/chat/chatLogic.d.ts.map +1 -0
  55. package/dist/chat/chatLogic.esm.js +5 -5
  56. package/dist/chat/chatLogic.esm.js.map +1 -1
  57. package/dist/directory/catalogDirectory.cjs.js +2 -0
  58. package/dist/directory/catalogDirectory.cjs.js.map +1 -0
  59. package/dist/directory/catalogDirectory.d.ts +5 -0
  60. package/dist/directory/catalogDirectory.d.ts.map +1 -0
  61. package/dist/directory/catalogDirectory.esm.js +54 -0
  62. package/dist/directory/catalogDirectory.esm.js.map +1 -0
  63. package/dist/directory/contactsDirectory.cjs.js +2 -0
  64. package/dist/directory/contactsDirectory.cjs.js.map +1 -0
  65. package/dist/directory/contactsDirectory.d.ts +7 -0
  66. package/dist/directory/contactsDirectory.d.ts.map +1 -0
  67. package/dist/directory/contactsDirectory.esm.js +91 -0
  68. package/dist/directory/contactsDirectory.esm.js.map +1 -0
  69. package/dist/directory/directoryHelpers.cjs.js +2 -0
  70. package/dist/directory/directoryHelpers.cjs.js.map +1 -0
  71. package/dist/directory/directoryHelpers.d.ts +18 -0
  72. package/dist/directory/directoryHelpers.d.ts.map +1 -0
  73. package/dist/directory/directoryHelpers.esm.js +89 -0
  74. package/dist/directory/directoryHelpers.esm.js.map +1 -0
  75. package/dist/directory/directoryLogic.cjs.js +2 -0
  76. package/dist/directory/directoryLogic.cjs.js.map +1 -0
  77. package/dist/directory/directoryLogic.d.ts +6 -0
  78. package/dist/directory/directoryLogic.d.ts.map +1 -0
  79. package/dist/directory/directoryLogic.esm.js +41 -0
  80. package/dist/directory/directoryLogic.esm.js.map +1 -0
  81. package/dist/directory/friendsDirectory.cjs.js +2 -0
  82. package/dist/directory/friendsDirectory.cjs.js.map +1 -0
  83. package/dist/directory/friendsDirectory.d.ts +6 -0
  84. package/dist/directory/friendsDirectory.d.ts.map +1 -0
  85. package/dist/directory/friendsDirectory.esm.js +58 -0
  86. package/dist/directory/friendsDirectory.esm.js.map +1 -0
  87. package/dist/inbox/inboxLogic.d.ts +3 -0
  88. package/dist/inbox/inboxLogic.d.ts.map +1 -0
  89. package/dist/index.cjs.js +1 -1
  90. package/dist/index.cjs.js.map +1 -1
  91. package/dist/index.d.ts +19 -0
  92. package/dist/index.d.ts.map +1 -0
  93. package/dist/index.esm.js +10 -9
  94. package/dist/index.esm.js.map +1 -1
  95. package/dist/issuer/issuerLogic.d.ts +8 -0
  96. package/dist/issuer/issuerLogic.d.ts.map +1 -0
  97. package/dist/logic/CustomError.cjs.js.map +1 -1
  98. package/dist/logic/CustomError.d.ts +21 -0
  99. package/dist/logic/CustomError.d.ts.map +1 -0
  100. package/dist/logic/CustomError.esm.js.map +1 -1
  101. package/dist/logic/solidLogic.cjs.js +1 -1
  102. package/dist/logic/solidLogic.cjs.js.map +1 -1
  103. package/dist/logic/solidLogic.d.ts +6 -0
  104. package/dist/logic/solidLogic.d.ts.map +1 -0
  105. package/dist/logic/solidLogic.esm.js +29 -27
  106. package/dist/logic/solidLogic.esm.js.map +1 -1
  107. package/dist/logic/solidLogicSingleton.cjs.js +1 -1
  108. package/dist/logic/solidLogicSingleton.cjs.js.map +1 -1
  109. package/dist/logic/solidLogicSingleton.d.ts +4 -0
  110. package/dist/logic/solidLogicSingleton.d.ts.map +1 -0
  111. package/dist/logic/solidLogicSingleton.esm.js +2 -1
  112. package/dist/logic/solidLogicSingleton.esm.js.map +1 -1
  113. package/dist/profile/profileAclDocuments.d.ts +2 -0
  114. package/dist/profile/profileAclDocuments.d.ts.map +1 -0
  115. package/dist/profile/profileDocuments.d.ts +2 -0
  116. package/dist/profile/profileDocuments.d.ts.map +1 -0
  117. package/dist/profile/profileLogic.cjs.js.map +1 -1
  118. package/dist/profile/profileLogic.d.ts +3 -0
  119. package/dist/profile/profileLogic.d.ts.map +1 -0
  120. package/dist/profile/profileLogic.esm.js +2 -1
  121. package/dist/profile/profileLogic.esm.js.map +1 -1
  122. package/dist/resource/resourceHttp.d.ts +5 -0
  123. package/dist/resource/resourceHttp.d.ts.map +1 -0
  124. package/dist/resource/resourceLogic.cjs.js +1 -1
  125. package/dist/resource/resourceLogic.cjs.js.map +1 -1
  126. package/dist/resource/resourceLogic.d.ts +4 -0
  127. package/dist/resource/resourceLogic.d.ts.map +1 -0
  128. package/dist/resource/resourceLogic.esm.js +36 -26
  129. package/dist/resource/resourceLogic.esm.js.map +1 -1
  130. package/dist/resource/resourceMetadata.d.ts +5 -0
  131. package/dist/resource/resourceMetadata.d.ts.map +1 -0
  132. package/dist/typeIndex/typeIndexAclDocuments.d.ts +2 -0
  133. package/dist/typeIndex/typeIndexAclDocuments.d.ts.map +1 -0
  134. package/dist/typeIndex/typeIndexDocuments.d.ts +3 -0
  135. package/dist/typeIndex/typeIndexDocuments.d.ts.map +1 -0
  136. package/dist/typeIndex/typeIndexLogic.cjs.js.map +1 -1
  137. package/dist/typeIndex/typeIndexLogic.d.ts +3 -0
  138. package/dist/typeIndex/typeIndexLogic.d.ts.map +1 -0
  139. package/dist/typeIndex/typeIndexLogic.esm.js +10 -5
  140. package/dist/typeIndex/typeIndexLogic.esm.js.map +1 -1
  141. package/dist/types.d.ts +187 -0
  142. package/dist/types.d.ts.map +1 -0
  143. package/dist/util/containerLogic.cjs.js.map +1 -1
  144. package/dist/util/containerLogic.d.ts +12 -0
  145. package/dist/util/containerLogic.d.ts.map +1 -0
  146. package/dist/util/containerLogic.esm.js.map +1 -1
  147. package/dist/util/debug.d.ts +5 -0
  148. package/dist/util/debug.d.ts.map +1 -0
  149. package/dist/util/ns.cjs.js.map +1 -1
  150. package/dist/util/ns.d.ts +2 -0
  151. package/dist/util/ns.d.ts.map +1 -0
  152. package/dist/util/utilityLogic.cjs.js +1 -1
  153. package/dist/util/utilityLogic.cjs.js.map +1 -1
  154. package/dist/util/utilityLogic.d.ts +16 -0
  155. package/dist/util/utilityLogic.d.ts.map +1 -0
  156. package/dist/util/utilityLogic.esm.js +6 -2
  157. package/dist/util/utilityLogic.esm.js.map +1 -1
  158. package/dist/util/utils.cjs.js +1 -1
  159. package/dist/util/utils.cjs.js.map +1 -1
  160. package/dist/util/utils.d.ts +8 -0
  161. package/dist/util/utils.d.ts.map +1 -0
  162. package/dist/util/utils.esm.js +5 -3
  163. package/dist/util/utils.esm.js.map +1 -1
  164. package/package.json +6 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directoryHelpers.esm.js","names":[],"sources":["../../src/directory/directoryHelpers.ts"],"sourcesContent":["import type { LiveStore, NamedNode } from 'rdflib'\nimport type { DirectoryEntry, DirectoryRelationshipLabel, DirectorySource } from '../types'\nimport { ns } from '../util/ns'\n\nconst DIRECTORY_SOURCE_PRIORITY: DirectorySource[] = ['contacts', 'groups', 'friends', 'catalog']\n\nexport function tokenizeQuery (query: string): string[] {\n return query\n .toLowerCase()\n .trim()\n .split(/\\s+/)\n .filter(Boolean)\n}\n\nexport function matchesQuery (label: string, query: string): boolean {\n return matchesAnyLabel([label], query)\n}\n\nexport function matchesAnyLabel (labels: string[], query: string): boolean {\n const queryWords = tokenizeQuery(query)\n if (queryWords.length === 0) return true\n\n const labelWords = labels.flatMap(label => tokenizeQuery(label))\n const fallbackHaystack = labels.join(' ').toLowerCase()\n return queryWords.every(word =>\n labelWords.some(labelWord => labelWord.includes(word)) || fallbackHaystack.includes(word)\n )\n}\n\nexport function sortEntries (entries: Iterable<DirectoryEntry>): DirectoryEntry[] {\n return Array.from(entries)\n .sort((left, right) => left.label.localeCompare(right.label, undefined, { sensitivity: 'base' }))\n}\n\nexport function mergeDirectoryEntry (\n discoveredEntries: Map<string, DirectoryEntry>,\n entry: DirectoryEntry\n): DirectoryEntry {\n const key = directoryEntryKey(entry)\n const existing = discoveredEntries.get(key)\n if (existing) {\n const preferred = preferredDirectoryEntry(existing, entry)\n const labels = canonicalizeSearchableLabels(\n preferred.label,\n [...(existing.searchableLabels ?? [existing.label]), ...(entry.searchableLabels ?? [entry.label])]\n )\n const merged = {\n ...existing,\n label: preferred.label,\n relationshipLabel: bestRelationshipLabel(existing.relationshipLabel, entry.relationshipLabel),\n sources: canonicalizeDirectorySources([...existing.sources, ...entry.sources]),\n searchableLabels: labels\n }\n discoveredEntries.set(key, merged)\n return merged\n }\n\n const normalized = {\n ...entry,\n sources: canonicalizeDirectorySources(entry.sources),\n searchableLabels: entry.searchableLabels ?? [entry.label]\n }\n discoveredEntries.set(key, normalized)\n return normalized\n}\n\nfunction preferredDirectoryEntry (current: DirectoryEntry, incoming: DirectoryEntry): DirectoryEntry {\n return directoryEntrySourcePriority(incoming) < directoryEntrySourcePriority(current) ? incoming : current\n}\n\nfunction directoryEntrySourcePriority (entry: DirectoryEntry): number {\n const priorities = entry.sources.map(source => DIRECTORY_SOURCE_PRIORITY.indexOf(source))\n return priorities.length ? Math.min(...priorities) : DIRECTORY_SOURCE_PRIORITY.length\n}\n\nexport function canonicalizeDirectorySources (sources: DirectorySource[]): DirectorySource[] {\n return DIRECTORY_SOURCE_PRIORITY.filter(source => sources.includes(source))\n}\n\nfunction canonicalizeSearchableLabels (preferredLabel: string, labels: string[]): string[] {\n return uniqueStrings(labels).sort((left, right) => {\n if (left === preferredLabel) return -1\n if (right === preferredLabel) return 1\n return left.localeCompare(right, undefined, { sensitivity: 'base' })\n })\n}\n\nexport function bestRelationshipLabel (\n current: DirectoryRelationshipLabel | undefined,\n incoming: DirectoryRelationshipLabel\n): DirectoryRelationshipLabel {\n if (current === 'Contact' || incoming === 'Contact') return 'Contact'\n if (current === 'Friend' || incoming === 'Friend') return 'Friend'\n if (current === 'Group' || incoming === 'Group') return 'Group'\n return 'People'\n}\n\nexport function directoryEntryKey (entry: DirectoryEntry): string {\n return `${entry.kind}:${entry.uri}`\n}\n\nexport function uniqueNamedNodes (nodes: NamedNode[]): NamedNode[] {\n const seen = new Set<string>()\n return nodes.filter(node => {\n if (seen.has(node.value)) return false\n seen.add(node.value)\n return true\n })\n}\n\nexport function uniqueStrings<T extends string> (values: T[]): T[] {\n return [...new Set(values)]\n}\n\nexport function isHttpUri (value: string | null | undefined): boolean {\n return !!value && (value.startsWith('https://') || value.startsWith('http://'))\n}\n\nexport function fallbackLabel (uri: string): string {\n const withoutFragment = uri.split('#')[0]\n const fragment = uri.includes('#') ? uri.slice(uri.indexOf('#') + 1) : ''\n const base = fragment && fragment !== 'this' && fragment !== 'me'\n ? fragment\n : withoutFragment.slice(withoutFragment.lastIndexOf('/') + 1)\n return decodeURIComponent(base || uri).replace(/[_-]+/g, ' ')\n}\n\nexport function storedLabelForNode (store: LiveStore, node: NamedNode): string | null {\n return store.anyValue(node, ns.vcard('fn')) ||\n store.anyValue(node, ns.foaf('name')) ||\n store.anyValue(node, ns.schema('name')) ||\n store.anyValue(node, ns.rdfs('label')) ||\n null\n}\n\nexport function labelForNode (store: LiveStore, node: NamedNode): string {\n return storedLabelForNode(store, node) || fallbackLabel(node.value)\n}\n\nexport async function loadDocumentSilently (store: LiveStore, node: NamedNode): Promise<boolean> {\n try {\n await store.fetcher.load(node.doc())\n return true\n } catch (_error) {\n return false\n }\n}\n"],"mappings":";;AAIA,IAAM,IAA+C;CAAC;CAAY;CAAU;CAAW;AAAS;AAEhG,SAAgB,EAAe,GAAyB;CACtD,OAAO,EACJ,YAAY,CAAC,CACb,KAAK,CAAC,CACN,MAAM,KAAK,CAAC,CACZ,OAAO,OAAO;AACnB;AAMA,SAAgB,EAAiB,GAAkB,GAAwB;CACzE,IAAM,IAAa,EAAc,CAAK;CACtC,IAAI,EAAW,WAAW,GAAG,OAAO;CAEpC,IAAM,IAAa,EAAO,SAAQ,MAAS,EAAc,CAAK,CAAC,GACzD,IAAmB,EAAO,KAAK,GAAG,CAAC,CAAC,YAAY;CACtD,OAAO,EAAW,OAAM,MACtB,EAAW,MAAK,MAAa,EAAU,SAAS,CAAI,CAAC,KAAK,EAAiB,SAAS,CAAI,CAC1F;AACF;AAEA,SAAgB,EAAa,GAAqD;CAChF,OAAO,MAAM,KAAK,CAAO,CAAC,CACvB,MAAM,GAAM,MAAU,EAAK,MAAM,cAAc,EAAM,OAAO,KAAA,GAAW,EAAE,aAAa,OAAO,CAAC,CAAC;AACpG;AAEA,SAAgB,EACd,GACA,GACgB;CAChB,IAAM,IAAM,EAAkB,CAAK,GAC7B,IAAW,EAAkB,IAAI,CAAG;CAC1C,IAAI,GAAU;EACZ,IAAM,IAAY,EAAwB,GAAU,CAAK,GACnD,IAAS,EACb,EAAU,OACV,CAAC,GAAI,EAAS,oBAAoB,CAAC,EAAS,KAAK,GAAI,GAAI,EAAM,oBAAoB,CAAC,EAAM,KAAK,CAAE,CACnG,GACM,IAAS;GACb,GAAG;GACH,OAAO,EAAU;GACjB,mBAAmB,EAAsB,EAAS,mBAAmB,EAAM,iBAAiB;GAC5F,SAAS,EAA6B,CAAC,GAAG,EAAS,SAAS,GAAG,EAAM,OAAO,CAAC;GAC7E,kBAAkB;EACpB;EAEA,OADA,EAAkB,IAAI,GAAK,CAAM,GAC1B;CACT;CAEA,IAAM,IAAa;EACjB,GAAG;EACH,SAAS,EAA6B,EAAM,OAAO;EACnD,kBAAkB,EAAM,oBAAoB,CAAC,EAAM,KAAK;CAC1D;CAEA,OADA,EAAkB,IAAI,GAAK,CAAU,GAC9B;AACT;AAEA,SAAS,EAAyB,GAAyB,GAA0C;CACnG,OAAO,EAA6B,CAAQ,IAAI,EAA6B,CAAO,IAAI,IAAW;AACrG;AAEA,SAAS,EAA8B,GAA+B;CACpE,IAAM,IAAa,EAAM,QAAQ,KAAI,MAAU,EAA0B,QAAQ,CAAM,CAAC;CACxF,OAAO,EAAW,SAAS,KAAK,IAAI,GAAG,CAAU,IAAI,EAA0B;AACjF;AAEA,SAAgB,EAA8B,GAA+C;CAC3F,OAAO,EAA0B,QAAO,MAAU,EAAQ,SAAS,CAAM,CAAC;AAC5E;AAEA,SAAS,EAA8B,GAAwB,GAA4B;CACzF,OAAO,EAAc,CAAM,CAAC,CAAC,MAAM,GAAM,MACnC,MAAS,IAAuB,KAChC,MAAU,IAAuB,IAC9B,EAAK,cAAc,GAAO,KAAA,GAAW,EAAE,aAAa,OAAO,CAAC,CACpE;AACH;AAEA,SAAgB,EACd,GACA,GAC4B;CAI5B,OAHI,MAAY,aAAa,MAAa,YAAkB,YACxD,MAAY,YAAY,MAAa,WAAiB,WACtD,MAAY,WAAW,MAAa,UAAgB,UACjD;AACT;AAEA,SAAgB,EAAmB,GAA+B;CAChE,OAAO,GAAG,EAAM,KAAK,GAAG,EAAM;AAChC;AAEA,SAAgB,EAAkB,GAAiC;CACjE,IAAM,oBAAO,IAAI,IAAY;CAC7B,OAAO,EAAM,QAAO,MAClB,CAAI,EAAK,IAAI,EAAK,KAAK,MACvB,EAAK,IAAI,EAAK,KAAK,GACZ,GACR;AACH;AAEA,SAAgB,EAAiC,GAAkB;CACjE,OAAO,CAAC,GAAG,IAAI,IAAI,CAAM,CAAC;AAC5B;AAEA,SAAgB,EAAW,GAA2C;CACpE,OAAO,CAAC,CAAC,MAAU,EAAM,WAAW,UAAU,KAAK,EAAM,WAAW,SAAS;AAC/E;AAEA,SAAgB,EAAe,GAAqB;CAClD,IAAM,IAAkB,EAAI,MAAM,GAAG,CAAC,CAAC,IACjC,IAAW,EAAI,SAAS,GAAG,IAAI,EAAI,MAAM,EAAI,QAAQ,GAAG,IAAI,CAAC,IAAI,IACjE,IAAO,KAAY,MAAa,UAAU,MAAa,OACzD,IACA,EAAgB,MAAM,EAAgB,YAAY,GAAG,IAAI,CAAC;CAC9D,OAAO,mBAAmB,KAAQ,CAAG,CAAC,CAAC,QAAQ,UAAU,GAAG;AAC9D;AAEA,SAAgB,EAAoB,GAAkB,GAAgC;CACpF,OAAO,EAAM,SAAS,GAAM,EAAG,MAAM,IAAI,CAAC,KACxC,EAAM,SAAS,GAAM,EAAG,KAAK,MAAM,CAAC,KACpC,EAAM,SAAS,GAAM,EAAG,OAAO,MAAM,CAAC,KACtC,EAAM,SAAS,GAAM,EAAG,KAAK,OAAO,CAAC,KACrC;AACJ;AAEA,SAAgB,EAAc,GAAkB,GAAyB;CACvE,OAAO,EAAmB,GAAO,CAAI,KAAK,EAAc,EAAK,KAAK;AACpE;AAEA,eAAsB,EAAsB,GAAkB,GAAmC;CAC/F,IAAI;EAEF,OADA,MAAM,EAAM,QAAQ,KAAK,EAAK,IAAI,CAAC,GAC5B;CACT,QAAiB;EACf,OAAO;CACT;AACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("./directoryHelpers.cjs.js"),t=require("./contactsDirectory.cjs.js"),n=require("./friendsDirectory.cjs.js"),r=require("./catalogDirectory.cjs.js");var i=3,a=`https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl`,o=[`contacts`,`friends`,`catalog`,`groups`];function s(a,s,c){let l=t.createContactsDirectoryDiscovery(a,c),u=n.createFriendsDirectoryDiscovery(a),d=r.createCatalogDirectoryDiscovery();async function f(t){let n=new Map,r=[],i=t=>{e.mergeDirectoryEntry(n,t)};if(t.sources.includes(`catalog`)&&r.push(d.discoverCatalogEntries(t.catalogUrl,i)),t.user&&(t.sources.includes(`contacts`)&&r.push(l.discoverAddressBookContacts(t.user,i)),t.sources.includes(`groups`)&&r.push(l.discoverAddressBookGroups(t.user,i)),t.sources.includes(`friends`)&&r.push(u.discoverFoafPeople(t.user,t.maxFoafDistance,i))),!r.length)return[];if((await Promise.allSettled(r)).every(e=>e.status===`rejected`))throw Error(`Unable to load directory entries.`);return e.sortEntries(n.values())}async function p(t={}){let n=m(t);return(await f(n)).filter(t=>e.matchesAnyLabel([t.label,...t.searchableLabels??[]],n.query))}return{search:p};function m(e={}){let t=e.sources===void 0?[...o]:[...e.sources];return{query:e.query??``,sources:t,catalogUrl:e.catalogUrl??`https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl`,user:e.user??s.currentUser(),maxFoafDistance:e.maxFoafDistance??i}}}exports.DEFAULT_DIRECTORY_CATALOG_URL=a,exports.DEFAULT_DIRECTORY_SOURCES=o,exports.createDirectoryLogic=s;
2
+ //# sourceMappingURL=directoryLogic.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directoryLogic.cjs.js","names":[],"sources":["../../src/directory/directoryLogic.ts"],"sourcesContent":["import { type AuthnLogic, type DirectoryEntry, type DirectoryLogic, type DirectorySearchOptions, type DirectorySource, type TypeIndexLogic } from '../types'\nimport { type LiveStore } from 'rdflib'\nimport { createContactsDirectoryDiscovery } from './contactsDirectory'\nimport { createFriendsDirectoryDiscovery } from './friendsDirectory'\nimport { createCatalogDirectoryDiscovery } from './catalogDirectory'\nimport { matchesAnyLabel, mergeDirectoryEntry, sortEntries } from './directoryHelpers'\n\nconst DEFAULT_FOAF_DISTANCE = 3\n\nexport const DEFAULT_DIRECTORY_CATALOG_URL = 'https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl'\nexport const DEFAULT_DIRECTORY_SOURCES: DirectorySource[] = ['contacts', 'friends', 'catalog', 'groups']\n\nexport function createDirectoryLogic (\n store: LiveStore,\n authn: AuthnLogic,\n typeIndexLogic: TypeIndexLogic\n): DirectoryLogic {\n const contactsDiscovery = createContactsDirectoryDiscovery(store, typeIndexLogic)\n const friendsDiscovery = createFriendsDirectoryDiscovery(store)\n const catalogDiscovery = createCatalogDirectoryDiscovery()\n\n async function discoverWithNormalizedOptions (\n normalized: ReturnType<typeof normalizeOptions>\n ): Promise<DirectoryEntry[]> {\n const discoveredEntries = new Map<string, DirectoryEntry>()\n const discoveryTasks: Promise<void>[] = []\n\n const mergeEntry = (entry: DirectoryEntry): void => {\n mergeDirectoryEntry(discoveredEntries, entry)\n }\n\n if (normalized.sources.includes('catalog')) {\n discoveryTasks.push(catalogDiscovery.discoverCatalogEntries(normalized.catalogUrl, mergeEntry))\n }\n\n if (normalized.user) {\n if (normalized.sources.includes('contacts')) {\n discoveryTasks.push(contactsDiscovery.discoverAddressBookContacts(normalized.user, mergeEntry))\n }\n\n if (normalized.sources.includes('groups')) {\n discoveryTasks.push(contactsDiscovery.discoverAddressBookGroups(normalized.user, mergeEntry))\n }\n\n if (normalized.sources.includes('friends')) {\n discoveryTasks.push(friendsDiscovery.discoverFoafPeople(normalized.user, normalized.maxFoafDistance, mergeEntry))\n }\n }\n\n if (!discoveryTasks.length) {\n return []\n }\n\n const results = await Promise.allSettled(discoveryTasks)\n if (results.every(result => result.status === 'rejected')) {\n throw new Error('Unable to load directory entries.')\n }\n\n return sortEntries(discoveredEntries.values())\n }\n\n async function search (options: DirectorySearchOptions = {}): Promise<DirectoryEntry[]> {\n const normalized = normalizeOptions(options)\n const entries = await discoverWithNormalizedOptions(normalized)\n return entries.filter(entry => matchesAnyLabel([entry.label, ...(entry.searchableLabels ?? [])], normalized.query))\n }\n\n return {\n search\n }\n\n function normalizeOptions (options: DirectorySearchOptions = {}) {\n const sources = options.sources === undefined ? [...DEFAULT_DIRECTORY_SOURCES] : [...options.sources]\n return {\n query: options.query ?? '',\n sources,\n catalogUrl: options.catalogUrl ?? DEFAULT_DIRECTORY_CATALOG_URL,\n user: options.user ?? authn.currentUser(),\n maxFoafDistance: options.maxFoafDistance ?? DEFAULT_FOAF_DISTANCE\n }\n }\n}\n"],"mappings":"mKAOA,IAAM,EAAwB,EAEjB,EAAgC,mFAChC,EAA+C,CAAC,WAAY,UAAW,UAAW,QAAQ,EAEvG,SAAgB,EACd,EACA,EACA,EACgB,CAChB,IAAM,EAAoB,EAAA,iCAAiC,EAAO,CAAc,EAC1E,EAAmB,EAAA,gCAAgC,CAAK,EACxD,EAAmB,EAAA,gCAAgC,EAEzD,eAAe,EACb,EAC2B,CAC3B,IAAM,EAAoB,IAAI,IACxB,EAAkC,CAAC,EAEnC,EAAc,GAAgC,CAClD,EAAA,oBAAoB,EAAmB,CAAK,CAC9C,EAoBA,GAlBI,EAAW,QAAQ,SAAS,SAAS,GACvC,EAAe,KAAK,EAAiB,uBAAuB,EAAW,WAAY,CAAU,CAAC,EAG5F,EAAW,OACT,EAAW,QAAQ,SAAS,UAAU,GACxC,EAAe,KAAK,EAAkB,4BAA4B,EAAW,KAAM,CAAU,CAAC,EAG5F,EAAW,QAAQ,SAAS,QAAQ,GACtC,EAAe,KAAK,EAAkB,0BAA0B,EAAW,KAAM,CAAU,CAAC,EAG1F,EAAW,QAAQ,SAAS,SAAS,GACvC,EAAe,KAAK,EAAiB,mBAAmB,EAAW,KAAM,EAAW,gBAAiB,CAAU,CAAC,GAIhH,CAAC,EAAe,OAClB,MAAO,CAAC,EAIV,IAAI,MADkB,QAAQ,WAAW,CAAc,EAAA,CAC3C,MAAM,GAAU,EAAO,SAAW,UAAU,EACtD,MAAU,MAAM,mCAAmC,EAGrD,OAAO,EAAA,YAAY,EAAkB,OAAO,CAAC,CAC/C,CAEA,eAAe,EAAQ,EAAkC,CAAC,EAA8B,CACtF,IAAM,EAAa,EAAiB,CAAO,EAE3C,OAAO,MADe,EAA8B,CAAU,EAAA,CAC/C,OAAO,GAAS,EAAA,gBAAgB,CAAC,EAAM,MAAO,GAAI,EAAM,kBAAoB,CAAC,CAAE,EAAG,EAAW,KAAK,CAAC,CACpH,CAEA,MAAO,CACL,QACF,EAEA,SAAS,EAAkB,EAAkC,CAAC,EAAG,CAC/D,IAAM,EAAU,EAAQ,UAAY,IAAA,GAAY,CAAC,GAAG,CAAyB,EAAI,CAAC,GAAG,EAAQ,OAAO,EACpG,MAAO,CACL,MAAO,EAAQ,OAAS,GACxB,UACA,WAAY,EAAQ,YAAA,mFACpB,KAAM,EAAQ,MAAQ,EAAM,YAAY,EACxC,gBAAiB,EAAQ,iBAAmB,CAC9C,CACF,CACF"}
@@ -0,0 +1,6 @@
1
+ import { type AuthnLogic, type DirectoryLogic, type DirectorySource, type TypeIndexLogic } from '../types';
2
+ import { type LiveStore } from 'rdflib';
3
+ export declare const DEFAULT_DIRECTORY_CATALOG_URL = "https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl";
4
+ export declare const DEFAULT_DIRECTORY_SOURCES: DirectorySource[];
5
+ export declare function createDirectoryLogic(store: LiveStore, authn: AuthnLogic, typeIndexLogic: TypeIndexLogic): DirectoryLogic;
6
+ //# sourceMappingURL=directoryLogic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directoryLogic.d.ts","sourceRoot":"","sources":["../../src/directory/directoryLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAuB,KAAK,cAAc,EAA+B,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC5J,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAQvC,eAAO,MAAM,6BAA6B,qFAAqF,CAAA;AAC/H,eAAO,MAAM,yBAAyB,EAAE,eAAe,EAAiD,CAAA;AAExG,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,UAAU,EACjB,cAAc,EAAE,cAAc,GAC7B,cAAc,CAiEhB"}
@@ -0,0 +1,41 @@
1
+ import { matchesAnyLabel as e, mergeDirectoryEntry as t, sortEntries as n } from "./directoryHelpers.esm.js";
2
+ import { createContactsDirectoryDiscovery as r } from "./contactsDirectory.esm.js";
3
+ import { createFriendsDirectoryDiscovery as i } from "./friendsDirectory.esm.js";
4
+ import { createCatalogDirectoryDiscovery as a } from "./catalogDirectory.esm.js";
5
+ //#region src/directory/directoryLogic.ts
6
+ var o = 3, s = "https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl", c = [
7
+ "contacts",
8
+ "friends",
9
+ "catalog",
10
+ "groups"
11
+ ];
12
+ function l(s, l, u) {
13
+ let d = r(s, u), f = i(s), p = a();
14
+ async function m(e) {
15
+ let r = /* @__PURE__ */ new Map(), i = [], a = (e) => {
16
+ t(r, e);
17
+ };
18
+ if (e.sources.includes("catalog") && i.push(p.discoverCatalogEntries(e.catalogUrl, a)), e.user && (e.sources.includes("contacts") && i.push(d.discoverAddressBookContacts(e.user, a)), e.sources.includes("groups") && i.push(d.discoverAddressBookGroups(e.user, a)), e.sources.includes("friends") && i.push(f.discoverFoafPeople(e.user, e.maxFoafDistance, a))), !i.length) return [];
19
+ if ((await Promise.allSettled(i)).every((e) => e.status === "rejected")) throw Error("Unable to load directory entries.");
20
+ return n(r.values());
21
+ }
22
+ async function h(t = {}) {
23
+ let n = g(t);
24
+ return (await m(n)).filter((t) => e([t.label, ...t.searchableLabels ?? []], n.query));
25
+ }
26
+ return { search: h };
27
+ function g(e = {}) {
28
+ let t = e.sources === void 0 ? [...c] : [...e.sources];
29
+ return {
30
+ query: e.query ?? "",
31
+ sources: t,
32
+ catalogUrl: e.catalogUrl ?? "https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl",
33
+ user: e.user ?? l.currentUser(),
34
+ maxFoafDistance: e.maxFoafDistance ?? o
35
+ };
36
+ }
37
+ }
38
+ //#endregion
39
+ export { s as DEFAULT_DIRECTORY_CATALOG_URL, c as DEFAULT_DIRECTORY_SOURCES, l as createDirectoryLogic };
40
+
41
+ //# sourceMappingURL=directoryLogic.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directoryLogic.esm.js","names":[],"sources":["../../src/directory/directoryLogic.ts"],"sourcesContent":["import { type AuthnLogic, type DirectoryEntry, type DirectoryLogic, type DirectorySearchOptions, type DirectorySource, type TypeIndexLogic } from '../types'\nimport { type LiveStore } from 'rdflib'\nimport { createContactsDirectoryDiscovery } from './contactsDirectory'\nimport { createFriendsDirectoryDiscovery } from './friendsDirectory'\nimport { createCatalogDirectoryDiscovery } from './catalogDirectory'\nimport { matchesAnyLabel, mergeDirectoryEntry, sortEntries } from './directoryHelpers'\n\nconst DEFAULT_FOAF_DISTANCE = 3\n\nexport const DEFAULT_DIRECTORY_CATALOG_URL = 'https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl'\nexport const DEFAULT_DIRECTORY_SOURCES: DirectorySource[] = ['contacts', 'friends', 'catalog', 'groups']\n\nexport function createDirectoryLogic (\n store: LiveStore,\n authn: AuthnLogic,\n typeIndexLogic: TypeIndexLogic\n): DirectoryLogic {\n const contactsDiscovery = createContactsDirectoryDiscovery(store, typeIndexLogic)\n const friendsDiscovery = createFriendsDirectoryDiscovery(store)\n const catalogDiscovery = createCatalogDirectoryDiscovery()\n\n async function discoverWithNormalizedOptions (\n normalized: ReturnType<typeof normalizeOptions>\n ): Promise<DirectoryEntry[]> {\n const discoveredEntries = new Map<string, DirectoryEntry>()\n const discoveryTasks: Promise<void>[] = []\n\n const mergeEntry = (entry: DirectoryEntry): void => {\n mergeDirectoryEntry(discoveredEntries, entry)\n }\n\n if (normalized.sources.includes('catalog')) {\n discoveryTasks.push(catalogDiscovery.discoverCatalogEntries(normalized.catalogUrl, mergeEntry))\n }\n\n if (normalized.user) {\n if (normalized.sources.includes('contacts')) {\n discoveryTasks.push(contactsDiscovery.discoverAddressBookContacts(normalized.user, mergeEntry))\n }\n\n if (normalized.sources.includes('groups')) {\n discoveryTasks.push(contactsDiscovery.discoverAddressBookGroups(normalized.user, mergeEntry))\n }\n\n if (normalized.sources.includes('friends')) {\n discoveryTasks.push(friendsDiscovery.discoverFoafPeople(normalized.user, normalized.maxFoafDistance, mergeEntry))\n }\n }\n\n if (!discoveryTasks.length) {\n return []\n }\n\n const results = await Promise.allSettled(discoveryTasks)\n if (results.every(result => result.status === 'rejected')) {\n throw new Error('Unable to load directory entries.')\n }\n\n return sortEntries(discoveredEntries.values())\n }\n\n async function search (options: DirectorySearchOptions = {}): Promise<DirectoryEntry[]> {\n const normalized = normalizeOptions(options)\n const entries = await discoverWithNormalizedOptions(normalized)\n return entries.filter(entry => matchesAnyLabel([entry.label, ...(entry.searchableLabels ?? [])], normalized.query))\n }\n\n return {\n search\n }\n\n function normalizeOptions (options: DirectorySearchOptions = {}) {\n const sources = options.sources === undefined ? [...DEFAULT_DIRECTORY_SOURCES] : [...options.sources]\n return {\n query: options.query ?? '',\n sources,\n catalogUrl: options.catalogUrl ?? DEFAULT_DIRECTORY_CATALOG_URL,\n user: options.user ?? authn.currentUser(),\n maxFoafDistance: options.maxFoafDistance ?? DEFAULT_FOAF_DISTANCE\n }\n }\n}\n"],"mappings":";;;;;AAOA,IAAM,IAAwB,GAEjB,IAAgC,oFAChC,IAA+C;CAAC;CAAY;CAAW;CAAW;AAAQ;AAEvG,SAAgB,EACd,GACA,GACA,GACgB;CAChB,IAAM,IAAoB,EAAiC,GAAO,CAAc,GAC1E,IAAmB,EAAgC,CAAK,GACxD,IAAmB,EAAgC;CAEzD,eAAe,EACb,GAC2B;EAC3B,IAAM,oBAAoB,IAAI,IAA4B,GACpD,IAAkC,CAAC,GAEnC,KAAc,MAAgC;GAClD,EAAoB,GAAmB,CAAK;EAC9C;EAoBA,IAlBI,EAAW,QAAQ,SAAS,SAAS,KACvC,EAAe,KAAK,EAAiB,uBAAuB,EAAW,YAAY,CAAU,CAAC,GAG5F,EAAW,SACT,EAAW,QAAQ,SAAS,UAAU,KACxC,EAAe,KAAK,EAAkB,4BAA4B,EAAW,MAAM,CAAU,CAAC,GAG5F,EAAW,QAAQ,SAAS,QAAQ,KACtC,EAAe,KAAK,EAAkB,0BAA0B,EAAW,MAAM,CAAU,CAAC,GAG1F,EAAW,QAAQ,SAAS,SAAS,KACvC,EAAe,KAAK,EAAiB,mBAAmB,EAAW,MAAM,EAAW,iBAAiB,CAAU,CAAC,IAIhH,CAAC,EAAe,QAClB,OAAO,CAAC;EAIV,KAAI,MADkB,QAAQ,WAAW,CAAc,EAAA,CAC3C,OAAM,MAAU,EAAO,WAAW,UAAU,GACtD,MAAU,MAAM,mCAAmC;EAGrD,OAAO,EAAY,EAAkB,OAAO,CAAC;CAC/C;CAEA,eAAe,EAAQ,IAAkC,CAAC,GAA8B;EACtF,IAAM,IAAa,EAAiB,CAAO;EAE3C,QAAO,MADe,EAA8B,CAAU,EAAA,CAC/C,QAAO,MAAS,EAAgB,CAAC,EAAM,OAAO,GAAI,EAAM,oBAAoB,CAAC,CAAE,GAAG,EAAW,KAAK,CAAC;CACpH;CAEA,OAAO,EACL,UACF;CAEA,SAAS,EAAkB,IAAkC,CAAC,GAAG;EAC/D,IAAM,IAAU,EAAQ,YAAY,KAAA,IAAY,CAAC,GAAG,CAAyB,IAAI,CAAC,GAAG,EAAQ,OAAO;EACpG,OAAO;GACL,OAAO,EAAQ,SAAS;GACxB;GACA,YAAY,EAAQ,cAAA;GACpB,MAAM,EAAQ,QAAQ,EAAM,YAAY;GACxC,iBAAiB,EAAQ,mBAAmB;EAC9C;CACF;AACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("../util/ns.cjs.js"),t=require("./directoryHelpers.cjs.js");var n=6;function r(r){function i(e){return e===1?`Friend`:`People`}async function a(e,n,a){let o=t.storedLabelForNode(r,e);o&&await a({kind:`person`,uri:e.value,label:o,subjectType:`agent`,relationshipLabel:i(n),sources:[`friends`]})}async function o(i,o,s){let c=new Set([i.value]),l=new Set,u=new Set,d=[{person:i,depth:0}],f=async n=>{let{person:d,depth:f}=n,p=d.doc().value;if(u.has(p)||(u.add(p),await t.loadDocumentSilently(r,d)),d.value!==i.value&&(l.has(d.value)||(l.add(d.value),await a(d,f,s))),f>=o)return[];let m=[],h=r.each(d,e.ns.foaf(`knows`));for(let e of h)if(e.termType===`NamedNode`){let n=t.storedLabelForNode(r,e);e.value!==i.value&&n&&!l.has(e.value)&&(l.add(e.value),await s({kind:`person`,uri:e.value,label:n,subjectType:`agent`,relationshipLabel:f===0?`Friend`:`People`,sources:[`friends`]})),c.has(e.value)||(c.add(e.value),m.push({person:e,depth:f+1}))}return m};for(;d.length>0;){let e=[];for(let t=0;t<d.length;t+=n){let r=d.slice(t,t+n);(await Promise.all(r.map(f))).forEach(t=>e.push(...t))}d=e}}return{discoverFoafPeople:o}}exports.createFriendsDirectoryDiscovery=r;
2
+ //# sourceMappingURL=friendsDirectory.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"friendsDirectory.cjs.js","names":[],"sources":["../../src/directory/friendsDirectory.ts"],"sourcesContent":["import { type DirectoryEntry } from '../types'\nimport { type LiveStore, NamedNode } from 'rdflib'\nimport { ns } from '../util/ns'\nimport { loadDocumentSilently, storedLabelForNode } from './directoryHelpers'\n\nconst PEOPLE_SEARCH_CONCURRENCY = 6\n\nexport function createFriendsDirectoryDiscovery (store: LiveStore) {\n function relationshipLabelForDepth (depth: number) {\n return depth === 1 ? 'Friend' : 'People'\n }\n\n async function emitPersonEntry (\n person: NamedNode,\n depth: number,\n onEntry: (entry: DirectoryEntry) => void | Promise<void>\n ): Promise<void> {\n const personName = storedLabelForNode(store, person)\n if (!personName) return\n\n await onEntry({\n kind: 'person',\n uri: person.value,\n label: personName,\n subjectType: 'agent',\n relationshipLabel: relationshipLabelForDepth(depth),\n sources: ['friends']\n })\n }\n\n async function discoverFoafPeople (\n user: NamedNode,\n maxFoafDistance: number,\n onEntry: (entry: DirectoryEntry) => void | Promise<void>\n ): Promise<void> {\n const visited = new Set<string>([user.value])\n const emitted = new Set<string>()\n const loadedDocs = new Set<string>()\n let queue: Array<{ person: NamedNode, depth: number }> = [{ person: user, depth: 0 }]\n\n const processPerson = async (currentEntry: { person: NamedNode, depth: number }) => {\n const { person: current, depth } = currentEntry\n const currentDoc = current.doc().value\n if (!loadedDocs.has(currentDoc)) {\n loadedDocs.add(currentDoc)\n await loadDocumentSilently(store, current)\n }\n\n if (current.value !== user.value) {\n if (!emitted.has(current.value)) {\n emitted.add(current.value)\n await emitPersonEntry(current, depth, onEntry)\n }\n }\n\n if (depth >= maxFoafDistance) {\n return [] as Array<{ person: NamedNode, depth: number }>\n }\n\n const nextPeople: Array<{ person: NamedNode, depth: number }> = []\n const contacts = store.each(current, ns.foaf('knows')) as NamedNode[]\n for (const contact of contacts) {\n if (contact.termType === 'NamedNode') {\n const contactName = storedLabelForNode(store, contact)\n if (contact.value !== user.value && contactName && !emitted.has(contact.value)) {\n emitted.add(contact.value)\n await onEntry({\n kind: 'person',\n uri: contact.value,\n label: contactName,\n subjectType: 'agent',\n relationshipLabel: depth === 0 ? 'Friend' : 'People',\n sources: ['friends']\n })\n }\n\n if (!visited.has(contact.value)) {\n visited.add(contact.value)\n nextPeople.push({ person: contact, depth: depth + 1 })\n }\n }\n }\n\n return nextPeople\n }\n\n while (queue.length > 0) {\n const nextQueue: Array<{ person: NamedNode, depth: number }> = []\n\n for (let index = 0; index < queue.length; index += PEOPLE_SEARCH_CONCURRENCY) {\n const batch = queue.slice(index, index + PEOPLE_SEARCH_CONCURRENCY)\n const nested = await Promise.all(batch.map(processPerson))\n nested.forEach(entries => nextQueue.push(...entries))\n }\n\n queue = nextQueue\n }\n }\n\n return {\n discoverFoafPeople\n }\n}\n"],"mappings":"4EAKA,IAAM,EAA4B,EAElC,SAAgB,EAAiC,EAAkB,CACjE,SAAS,EAA2B,EAAe,CACjD,OAAO,IAAU,EAAI,SAAW,QAClC,CAEA,eAAe,EACb,EACA,EACA,EACe,CACf,IAAM,EAAa,EAAA,mBAAmB,EAAO,CAAM,EAC9C,GAEL,MAAM,EAAQ,CACZ,KAAM,SACN,IAAK,EAAO,MACZ,MAAO,EACP,YAAa,QACb,kBAAmB,EAA0B,CAAK,EAClD,QAAS,CAAC,SAAS,CACrB,CAAC,CACH,CAEA,eAAe,EACb,EACA,EACA,EACe,CACf,IAAM,EAAU,IAAI,IAAY,CAAC,EAAK,KAAK,CAAC,EACtC,EAAU,IAAI,IACd,EAAa,IAAI,IACnB,EAAqD,CAAC,CAAE,OAAQ,EAAM,MAAO,CAAE,CAAC,EAE9E,EAAgB,KAAO,IAAuD,CAClF,GAAM,CAAE,OAAQ,EAAS,SAAU,EAC7B,EAAa,EAAQ,IAAI,CAAC,CAAC,MAajC,GAZK,EAAW,IAAI,CAAU,IAC5B,EAAW,IAAI,CAAU,EACzB,MAAM,EAAA,qBAAqB,EAAO,CAAO,GAGvC,EAAQ,QAAU,EAAK,QACpB,EAAQ,IAAI,EAAQ,KAAK,IAC5B,EAAQ,IAAI,EAAQ,KAAK,EACzB,MAAM,EAAgB,EAAS,EAAO,CAAO,IAI7C,GAAS,EACX,MAAO,CAAC,EAGV,IAAM,EAA0D,CAAC,EAC3D,EAAW,EAAM,KAAK,EAAS,EAAA,GAAG,KAAK,OAAO,CAAC,EACrD,IAAK,IAAM,KAAW,EACpB,GAAI,EAAQ,WAAa,YAAa,CACpC,IAAM,EAAc,EAAA,mBAAmB,EAAO,CAAO,EACjD,EAAQ,QAAU,EAAK,OAAS,GAAe,CAAC,EAAQ,IAAI,EAAQ,KAAK,IAC3E,EAAQ,IAAI,EAAQ,KAAK,EACzB,MAAM,EAAQ,CACZ,KAAM,SACN,IAAK,EAAQ,MACb,MAAO,EACP,YAAa,QACb,kBAAmB,IAAU,EAAI,SAAW,SAC5C,QAAS,CAAC,SAAS,CACrB,CAAC,GAGE,EAAQ,IAAI,EAAQ,KAAK,IAC5B,EAAQ,IAAI,EAAQ,KAAK,EACzB,EAAW,KAAK,CAAE,OAAQ,EAAS,MAAO,EAAQ,CAAE,CAAC,EAEzD,CAGF,OAAO,CACT,EAEA,KAAO,EAAM,OAAS,GAAG,CACvB,IAAM,EAAyD,CAAC,EAEhE,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAM,OAAQ,GAAS,EAA2B,CAC5E,IAAM,EAAQ,EAAM,MAAM,EAAO,EAAQ,CAAyB,GAElE,MADqB,QAAQ,IAAI,EAAM,IAAI,CAAa,CAAC,EAAA,CAClD,QAAQ,GAAW,EAAU,KAAK,GAAG,CAAO,CAAC,CACtD,CAEA,EAAQ,CACV,CACF,CAEA,MAAO,CACL,oBACF,CACF"}
@@ -0,0 +1,6 @@
1
+ import { type DirectoryEntry } from '../types';
2
+ import { type LiveStore, NamedNode } from 'rdflib';
3
+ export declare function createFriendsDirectoryDiscovery(store: LiveStore): {
4
+ discoverFoafPeople: (user: NamedNode, maxFoafDistance: number, onEntry: (entry: DirectoryEntry) => void | Promise<void>) => Promise<void>;
5
+ };
6
+ //# sourceMappingURL=friendsDirectory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"friendsDirectory.d.ts","sourceRoot":"","sources":["../../src/directory/friendsDirectory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAMlD,wBAAgB,+BAA+B,CAAE,KAAK,EAAE,SAAS;+BAwBvD,SAAS,mBACE,MAAM,WACd,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KACvD,OAAO,CAAC,IAAI,CAAC;EAoEjB"}
@@ -0,0 +1,58 @@
1
+ import { ns as e } from "../util/ns.esm.js";
2
+ import { loadDocumentSilently as t, storedLabelForNode as n } from "./directoryHelpers.esm.js";
3
+ //#region src/directory/friendsDirectory.ts
4
+ var r = 6;
5
+ function i(i) {
6
+ function a(e) {
7
+ return e === 1 ? "Friend" : "People";
8
+ }
9
+ async function o(e, t, r) {
10
+ let o = n(i, e);
11
+ o && await r({
12
+ kind: "person",
13
+ uri: e.value,
14
+ label: o,
15
+ subjectType: "agent",
16
+ relationshipLabel: a(t),
17
+ sources: ["friends"]
18
+ });
19
+ }
20
+ async function s(a, s, c) {
21
+ let l = /* @__PURE__ */ new Set([a.value]), u = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set(), f = [{
22
+ person: a,
23
+ depth: 0
24
+ }], p = async (r) => {
25
+ let { person: f, depth: p } = r, m = f.doc().value;
26
+ if (d.has(m) || (d.add(m), await t(i, f)), f.value !== a.value && (u.has(f.value) || (u.add(f.value), await o(f, p, c))), p >= s) return [];
27
+ let h = [], g = i.each(f, e.foaf("knows"));
28
+ for (let e of g) if (e.termType === "NamedNode") {
29
+ let t = n(i, e);
30
+ e.value !== a.value && t && !u.has(e.value) && (u.add(e.value), await c({
31
+ kind: "person",
32
+ uri: e.value,
33
+ label: t,
34
+ subjectType: "agent",
35
+ relationshipLabel: p === 0 ? "Friend" : "People",
36
+ sources: ["friends"]
37
+ })), l.has(e.value) || (l.add(e.value), h.push({
38
+ person: e,
39
+ depth: p + 1
40
+ }));
41
+ }
42
+ return h;
43
+ };
44
+ for (; f.length > 0;) {
45
+ let e = [];
46
+ for (let t = 0; t < f.length; t += r) {
47
+ let n = f.slice(t, t + r);
48
+ (await Promise.all(n.map(p))).forEach((t) => e.push(...t));
49
+ }
50
+ f = e;
51
+ }
52
+ }
53
+ return { discoverFoafPeople: s };
54
+ }
55
+ //#endregion
56
+ export { i as createFriendsDirectoryDiscovery };
57
+
58
+ //# sourceMappingURL=friendsDirectory.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"friendsDirectory.esm.js","names":[],"sources":["../../src/directory/friendsDirectory.ts"],"sourcesContent":["import { type DirectoryEntry } from '../types'\nimport { type LiveStore, NamedNode } from 'rdflib'\nimport { ns } from '../util/ns'\nimport { loadDocumentSilently, storedLabelForNode } from './directoryHelpers'\n\nconst PEOPLE_SEARCH_CONCURRENCY = 6\n\nexport function createFriendsDirectoryDiscovery (store: LiveStore) {\n function relationshipLabelForDepth (depth: number) {\n return depth === 1 ? 'Friend' : 'People'\n }\n\n async function emitPersonEntry (\n person: NamedNode,\n depth: number,\n onEntry: (entry: DirectoryEntry) => void | Promise<void>\n ): Promise<void> {\n const personName = storedLabelForNode(store, person)\n if (!personName) return\n\n await onEntry({\n kind: 'person',\n uri: person.value,\n label: personName,\n subjectType: 'agent',\n relationshipLabel: relationshipLabelForDepth(depth),\n sources: ['friends']\n })\n }\n\n async function discoverFoafPeople (\n user: NamedNode,\n maxFoafDistance: number,\n onEntry: (entry: DirectoryEntry) => void | Promise<void>\n ): Promise<void> {\n const visited = new Set<string>([user.value])\n const emitted = new Set<string>()\n const loadedDocs = new Set<string>()\n let queue: Array<{ person: NamedNode, depth: number }> = [{ person: user, depth: 0 }]\n\n const processPerson = async (currentEntry: { person: NamedNode, depth: number }) => {\n const { person: current, depth } = currentEntry\n const currentDoc = current.doc().value\n if (!loadedDocs.has(currentDoc)) {\n loadedDocs.add(currentDoc)\n await loadDocumentSilently(store, current)\n }\n\n if (current.value !== user.value) {\n if (!emitted.has(current.value)) {\n emitted.add(current.value)\n await emitPersonEntry(current, depth, onEntry)\n }\n }\n\n if (depth >= maxFoafDistance) {\n return [] as Array<{ person: NamedNode, depth: number }>\n }\n\n const nextPeople: Array<{ person: NamedNode, depth: number }> = []\n const contacts = store.each(current, ns.foaf('knows')) as NamedNode[]\n for (const contact of contacts) {\n if (contact.termType === 'NamedNode') {\n const contactName = storedLabelForNode(store, contact)\n if (contact.value !== user.value && contactName && !emitted.has(contact.value)) {\n emitted.add(contact.value)\n await onEntry({\n kind: 'person',\n uri: contact.value,\n label: contactName,\n subjectType: 'agent',\n relationshipLabel: depth === 0 ? 'Friend' : 'People',\n sources: ['friends']\n })\n }\n\n if (!visited.has(contact.value)) {\n visited.add(contact.value)\n nextPeople.push({ person: contact, depth: depth + 1 })\n }\n }\n }\n\n return nextPeople\n }\n\n while (queue.length > 0) {\n const nextQueue: Array<{ person: NamedNode, depth: number }> = []\n\n for (let index = 0; index < queue.length; index += PEOPLE_SEARCH_CONCURRENCY) {\n const batch = queue.slice(index, index + PEOPLE_SEARCH_CONCURRENCY)\n const nested = await Promise.all(batch.map(processPerson))\n nested.forEach(entries => nextQueue.push(...entries))\n }\n\n queue = nextQueue\n }\n }\n\n return {\n discoverFoafPeople\n }\n}\n"],"mappings":";;;AAKA,IAAM,IAA4B;AAElC,SAAgB,EAAiC,GAAkB;CACjE,SAAS,EAA2B,GAAe;EACjD,OAAO,MAAU,IAAI,WAAW;CAClC;CAEA,eAAe,EACb,GACA,GACA,GACe;EACf,IAAM,IAAa,EAAmB,GAAO,CAAM;EACnD,AAAK,KAEL,MAAM,EAAQ;GACZ,MAAM;GACN,KAAK,EAAO;GACZ,OAAO;GACP,aAAa;GACb,mBAAmB,EAA0B,CAAK;GAClD,SAAS,CAAC,SAAS;EACrB,CAAC;CACH;CAEA,eAAe,EACb,GACA,GACA,GACe;EACf,IAAM,oBAAU,IAAI,IAAY,CAAC,EAAK,KAAK,CAAC,GACtC,oBAAU,IAAI,IAAY,GAC1B,oBAAa,IAAI,IAAY,GAC/B,IAAqD,CAAC;GAAE,QAAQ;GAAM,OAAO;EAAE,CAAC,GAE9E,IAAgB,OAAO,MAAuD;GAClF,IAAM,EAAE,QAAQ,GAAS,aAAU,GAC7B,IAAa,EAAQ,IAAI,CAAC,CAAC;GAajC,IAZK,EAAW,IAAI,CAAU,MAC5B,EAAW,IAAI,CAAU,GACzB,MAAM,EAAqB,GAAO,CAAO,IAGvC,EAAQ,UAAU,EAAK,UACpB,EAAQ,IAAI,EAAQ,KAAK,MAC5B,EAAQ,IAAI,EAAQ,KAAK,GACzB,MAAM,EAAgB,GAAS,GAAO,CAAO,KAI7C,KAAS,GACX,OAAO,CAAC;GAGV,IAAM,IAA0D,CAAC,GAC3D,IAAW,EAAM,KAAK,GAAS,EAAG,KAAK,OAAO,CAAC;GACrD,KAAK,IAAM,KAAW,GACpB,IAAI,EAAQ,aAAa,aAAa;IACpC,IAAM,IAAc,EAAmB,GAAO,CAAO;IAarD,AAZI,EAAQ,UAAU,EAAK,SAAS,KAAe,CAAC,EAAQ,IAAI,EAAQ,KAAK,MAC3E,EAAQ,IAAI,EAAQ,KAAK,GACzB,MAAM,EAAQ;KACZ,MAAM;KACN,KAAK,EAAQ;KACb,OAAO;KACP,aAAa;KACb,mBAAmB,MAAU,IAAI,WAAW;KAC5C,SAAS,CAAC,SAAS;IACrB,CAAC,IAGE,EAAQ,IAAI,EAAQ,KAAK,MAC5B,EAAQ,IAAI,EAAQ,KAAK,GACzB,EAAW,KAAK;KAAE,QAAQ;KAAS,OAAO,IAAQ;IAAE,CAAC;GAEzD;GAGF,OAAO;EACT;EAEA,OAAO,EAAM,SAAS,IAAG;GACvB,IAAM,IAAyD,CAAC;GAEhE,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAM,QAAQ,KAAS,GAA2B;IAC5E,IAAM,IAAQ,EAAM,MAAM,GAAO,IAAQ,CAAyB;IAElE,CAAA,MADqB,QAAQ,IAAI,EAAM,IAAI,CAAa,CAAC,EAAA,CAClD,SAAQ,MAAW,EAAU,KAAK,GAAG,CAAO,CAAC;GACtD;GAEA,IAAQ;EACV;CACF;CAEA,OAAO,EACL,sBACF;AACF"}
@@ -0,0 +1,3 @@
1
+ import { InboxLogic } from '../types';
2
+ export declare function createInboxLogic(store: any, profileLogic: any, utilityLogic: any, containerLogic: any, aclLogic: any): InboxLogic;
3
+ //# sourceMappingURL=inboxLogic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inboxLogic.d.ts","sourceRoot":"","sources":["../../src/inbox/inboxLogic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAGrC,wBAAgB,gBAAgB,CAAC,KAAK,KAAA,EAAE,YAAY,KAAA,EAAE,YAAY,KAAA,EAAE,cAAc,KAAA,EAAE,QAAQ,KAAA,GAAG,UAAU,CAqDxG"}
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./authSession/identityState.cjs.js"),t=require("./acl/aclLogic.cjs.js"),n=require("./authn/authUtil.cjs.js"),r=require("./logic/CustomError.cjs.js"),i=require("./typeIndex/typeIndexLogic.cjs.js"),a=require("./logic/solidLogicSingleton.cjs.js"),o=require("./authn/serverLogout.cjs.js"),s=require("./issuer/issuerLogic.cjs.js");var c=a.solidLogicSingleton.authn,l=a.solidLogicSingleton.authn.authSession,u=a.solidLogicSingleton.store;exports.ACL_LINK=t.ACL_LINK,exports.CrossOriginForbiddenError=r.CrossOriginForbiddenError,exports.FetchError=r.FetchError,exports.NotEditableError=r.NotEditableError,exports.NotFoundError=r.NotFoundError,exports.SameOriginForbiddenError=r.SameOriginForbiddenError,exports.UnauthorizedError=r.UnauthorizedError,exports.WebOperationError=r.WebOperationError,exports.appContext=n.appContext,exports.authSession=l,exports.authn=c,exports.createTypeIndexLogic=i.createTypeIndexLogic,exports.getSuggestedIssuers=s.getSuggestedIssuers,exports.offlineTestID=n.offlineTestID,exports.performServerSideLogout=o.performServerSideLogout,exports.reloadOnIdentityReplaced=e.reloadOnIdentityReplaced,exports.solidLogicSingleton=a.solidLogicSingleton,exports.store=u;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./authSession/identityState.cjs.js"),t=require("./acl/aclLogic.cjs.js"),n=require("./authn/authUtil.cjs.js"),r=require("./logic/CustomError.cjs.js"),i=require("./typeIndex/typeIndexLogic.cjs.js"),a=require("./directory/directoryLogic.cjs.js"),o=require("./logic/solidLogicSingleton.cjs.js"),s=require("./authn/serverLogout.cjs.js"),c=require("./issuer/issuerLogic.cjs.js");var l=o.solidLogicSingleton.authn,u=o.solidLogicSingleton.authn.authSession,d=o.solidLogicSingleton.store;exports.ACCESS_ROLES=t.ACCESS_ROLES,exports.ACL_LINK=t.ACL_LINK,exports.CrossOriginForbiddenError=r.CrossOriginForbiddenError,exports.DEFAULT_DIRECTORY_CATALOG_URL=a.DEFAULT_DIRECTORY_CATALOG_URL,exports.DEFAULT_DIRECTORY_SOURCES=a.DEFAULT_DIRECTORY_SOURCES,exports.FetchError=r.FetchError,exports.NotEditableError=r.NotEditableError,exports.NotFoundError=r.NotFoundError,exports.SameOriginForbiddenError=r.SameOriginForbiddenError,exports.UnauthorizedError=r.UnauthorizedError,exports.WebOperationError=r.WebOperationError,exports.appContext=n.appContext,exports.authSession=u,exports.authn=l,exports.createDirectoryLogic=a.createDirectoryLogic,exports.createTypeIndexLogic=i.createTypeIndexLogic,exports.getSuggestedIssuers=c.getSuggestedIssuers,exports.offlineTestID=n.offlineTestID,exports.performServerSideLogout=s.performServerSideLogout,exports.reloadOnIdentityReplaced=e.reloadOnIdentityReplaced,exports.solidLogicSingleton=o.solidLogicSingleton,exports.store=d;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// 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 { reloadOnIdentityReplaced } from './authSession/identityState'\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"],"mappings":"0ZAIA,IAAM,EAAQ,EAAA,oBAAoB,MAC5B,EAAc,EAAA,oBAAoB,MAAM,YACxC,EAAQ,EAAA,oBAAoB"}
1
+ {"version":3,"file":"index.cjs.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// 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, ACCESS_ROLES } from './acl/aclLogic'\nexport type { AccessRole } from './acl/aclLogic'\nexport { offlineTestID, appContext } from './authn/authUtil'\nexport { performServerSideLogout } from './authn/serverLogout'\nexport { reloadOnIdentityReplaced } from './authSession/identityState'\nexport { getSuggestedIssuers } from './issuer/issuerLogic'\nexport { createTypeIndexLogic } from './typeIndex/typeIndexLogic'\nexport { createDirectoryLogic, DEFAULT_DIRECTORY_CATALOG_URL, DEFAULT_DIRECTORY_SOURCES } from './directory/directoryLogic'\nexport type { AccessControlSubjectKind, AccessControlSubject } from './acl/accessControlSubjects'\nexport type { ACLContext, AccessMode, AccessSubject, Authorization, PatchPlan } from './types'\nexport type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ChatLogic, DirectoryLogic, DirectoryEntry, DirectorySearchOptions, DirectoryRelationshipLabel, DirectorySource } 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"],"mappings":"ycAIA,IAAM,EAAQ,EAAA,oBAAoB,MAC5B,EAAc,EAAA,oBAAoB,MAAM,YACxC,EAAQ,EAAA,oBAAoB"}
@@ -0,0 +1,19 @@
1
+ import { solidLogicSingleton } from './logic/solidLogicSingleton';
2
+ declare const authn: import("./types").AuthnLogic;
3
+ declare const authSession: import("./authSession/authSession").SessionWithLegacyEvents;
4
+ declare const store: import("rdflib").LiveStore;
5
+ export { ACL_LINK, ACCESS_ROLES } from './acl/aclLogic';
6
+ export type { AccessRole } from './acl/aclLogic';
7
+ export { offlineTestID, appContext } from './authn/authUtil';
8
+ export { performServerSideLogout } from './authn/serverLogout';
9
+ export { reloadOnIdentityReplaced } from './authSession/identityState';
10
+ export { getSuggestedIssuers } from './issuer/issuerLogic';
11
+ export { createTypeIndexLogic } from './typeIndex/typeIndexLogic';
12
+ export { createDirectoryLogic, DEFAULT_DIRECTORY_CATALOG_URL, DEFAULT_DIRECTORY_SOURCES } from './directory/directoryLogic';
13
+ export type { AccessControlSubjectKind, AccessControlSubject } from './acl/accessControlSubjects';
14
+ export type { ACLContext, AccessMode, AccessSubject, Authorization, PatchPlan } from './types';
15
+ export type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ChatLogic, DirectoryLogic, DirectoryEntry, DirectorySearchOptions, DirectoryRelationshipLabel, DirectorySource } from './types';
16
+ export { UnauthorizedError, CrossOriginForbiddenError, SameOriginForbiddenError, NotFoundError, FetchError, NotEditableError, WebOperationError } from './logic/CustomError';
17
+ export { solidLogicSingleton, // solidLogicSingleton is exported entirely because it is used in solid-panes
18
+ store, authn, authSession };
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,QAAA,MAAM,KAAK,8BAA4B,CAAA;AACvC,QAAA,MAAM,WAAW,6DAAwC,CAAA;AACzD,QAAA,MAAM,KAAK,4BAA4B,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACvD,YAAY,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAC3H,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACjG,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAC9F,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC5M,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5K,OAAO,EACL,mBAAmB,EAAE,6EAA6E;AAClG,KAAK,EACL,KAAK,EACL,WAAW,EACZ,CAAA"}
package/dist/index.esm.js CHANGED
@@ -1,14 +1,15 @@
1
1
  import { reloadOnIdentityReplaced as e } from "./authSession/identityState.esm.js";
2
- import { ACL_LINK as t } from "./acl/aclLogic.esm.js";
3
- import { appContext as n, offlineTestID as r } from "./authn/authUtil.esm.js";
4
- import { CrossOriginForbiddenError as i, FetchError as a, NotEditableError as o, NotFoundError as s, SameOriginForbiddenError as c, UnauthorizedError as l, WebOperationError as u } from "./logic/CustomError.esm.js";
5
- import { createTypeIndexLogic as d } from "./typeIndex/typeIndexLogic.esm.js";
6
- import { solidLogicSingleton as f } from "./logic/solidLogicSingleton.esm.js";
7
- import { performServerSideLogout as p } from "./authn/serverLogout.esm.js";
8
- import { getSuggestedIssuers as m } from "./issuer/issuerLogic.esm.js";
2
+ import { ACCESS_ROLES as t, ACL_LINK as n } from "./acl/aclLogic.esm.js";
3
+ import { appContext as r, offlineTestID as i } from "./authn/authUtil.esm.js";
4
+ import { CrossOriginForbiddenError as a, FetchError as o, NotEditableError as s, NotFoundError as c, SameOriginForbiddenError as l, UnauthorizedError as u, WebOperationError as d } from "./logic/CustomError.esm.js";
5
+ import { createTypeIndexLogic as f } from "./typeIndex/typeIndexLogic.esm.js";
6
+ import { DEFAULT_DIRECTORY_CATALOG_URL as p, DEFAULT_DIRECTORY_SOURCES as m, createDirectoryLogic as h } from "./directory/directoryLogic.esm.js";
7
+ import { solidLogicSingleton as g } from "./logic/solidLogicSingleton.esm.js";
8
+ import { performServerSideLogout as _ } from "./authn/serverLogout.esm.js";
9
+ import { getSuggestedIssuers as v } from "./issuer/issuerLogic.esm.js";
9
10
  //#region src/index.ts
10
- var h = f.authn, g = f.authn.authSession, _ = f.store;
11
+ var y = g.authn, b = g.authn.authSession, x = g.store;
11
12
  //#endregion
12
- export { t as ACL_LINK, i as CrossOriginForbiddenError, a as FetchError, o as NotEditableError, s as NotFoundError, c as SameOriginForbiddenError, l as UnauthorizedError, u as WebOperationError, n as appContext, g as authSession, h as authn, d as createTypeIndexLogic, m as getSuggestedIssuers, r as offlineTestID, p as performServerSideLogout, e as reloadOnIdentityReplaced, f as solidLogicSingleton, _ as store };
13
+ export { t as ACCESS_ROLES, n as ACL_LINK, a as CrossOriginForbiddenError, p as DEFAULT_DIRECTORY_CATALOG_URL, m as DEFAULT_DIRECTORY_SOURCES, o as FetchError, s as NotEditableError, c as NotFoundError, l as SameOriginForbiddenError, u as UnauthorizedError, d as WebOperationError, r as appContext, b as authSession, y as authn, h as createDirectoryLogic, f as createTypeIndexLogic, v as getSuggestedIssuers, i as offlineTestID, _ as performServerSideLogout, e as reloadOnIdentityReplaced, g as solidLogicSingleton, x as store };
13
14
 
14
15
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// 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 { reloadOnIdentityReplaced } from './authSession/identityState'\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"],"mappings":";;;;;;;;;AAIA,IAAM,IAAQ,EAAoB,OAC5B,IAAc,EAAoB,MAAM,aACxC,IAAQ,EAAoB"}
1
+ {"version":3,"file":"index.esm.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// 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, ACCESS_ROLES } from './acl/aclLogic'\nexport type { AccessRole } from './acl/aclLogic'\nexport { offlineTestID, appContext } from './authn/authUtil'\nexport { performServerSideLogout } from './authn/serverLogout'\nexport { reloadOnIdentityReplaced } from './authSession/identityState'\nexport { getSuggestedIssuers } from './issuer/issuerLogic'\nexport { createTypeIndexLogic } from './typeIndex/typeIndexLogic'\nexport { createDirectoryLogic, DEFAULT_DIRECTORY_CATALOG_URL, DEFAULT_DIRECTORY_SOURCES } from './directory/directoryLogic'\nexport type { AccessControlSubjectKind, AccessControlSubject } from './acl/accessControlSubjects'\nexport type { ACLContext, AccessMode, AccessSubject, Authorization, PatchPlan } from './types'\nexport type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ChatLogic, DirectoryLogic, DirectoryEntry, DirectorySearchOptions, DirectoryRelationshipLabel, DirectorySource } 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"],"mappings":";;;;;;;;;;AAIA,IAAM,IAAQ,EAAoB,OAC5B,IAAc,EAAoB,MAAM,aACxC,IAAQ,EAAoB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @returns - A list of suggested OIDC issuers
3
+ */
4
+ export declare function getSuggestedIssuers(): {
5
+ name: string;
6
+ uri: string;
7
+ }[];
8
+ //# sourceMappingURL=issuerLogic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issuerLogic.d.ts","sourceRoot":"","sources":["../../src/issuer/issuerLogic.ts"],"names":[],"mappings":"AAmBA;;GAEG;AACH,wBAAgB,mBAAmB,IAAK;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,CAYpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomError.cjs.js","names":[],"sources":["../../src/logic/CustomError.ts"],"sourcesContent":["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}"],"mappings":"AAAA,IAAM,EAAN,cAA0B,KAAM,CAC5B,YAAY,EAAkB,CAC1B,MAAM,CAAO,EAEb,OAAO,eAAe,KAAM,IAAI,OAAO,SAAS,EAChD,KAAK,KAAO,IAAI,OAAO,IAC3B,CACJ,EAEa,EAAb,cAAuC,CAAY,CAAC,EAEvC,EAAb,cAA+C,CAAY,CAAC,EAE/C,EAAb,cAA8C,CAAY,CAAC,EAE9C,EAAb,cAAmC,CAAY,CAAC,EAEnC,EAAb,cAAsC,CAAY,CAAE,EAEvC,EAAb,cAAuC,CAAY,CAAC,EAEvC,EAAb,cAAgC,CAAY,CAGxC,YAAY,EAAgB,EAAkB,CAC1C,MAAM,CAAO,EACb,KAAK,OAAS,CAClB,CACJ"}
1
+ {"version":3,"file":"CustomError.cjs.js","names":[],"sources":["../../src/logic/CustomError.ts"],"sourcesContent":["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}"],"mappings":"AAAA,IAAM,EAAN,cAA0B,KAAM,CAC5B,YAAY,EAAkB,CAC1B,MAAM,CAAO,EAEb,OAAO,eAAe,KAAM,WAAW,SAAS,EAChD,KAAK,KAAO,WAAW,IAC3B,CACJ,EAEa,EAAb,cAAuC,CAAY,CAAC,EAEvC,EAAb,cAA+C,CAAY,CAAC,EAE/C,EAAb,cAA8C,CAAY,CAAC,EAE9C,EAAb,cAAmC,CAAY,CAAC,EAEnC,EAAb,cAAsC,CAAY,CAAE,EAEvC,EAAb,cAAuC,CAAY,CAAC,EAEvC,EAAb,cAAgC,CAAY,CAGxC,YAAY,EAAgB,EAAkB,CAC1C,MAAM,CAAO,EACb,KAAK,OAAS,CAClB,CACJ"}
@@ -0,0 +1,21 @@
1
+ declare class CustomError extends Error {
2
+ constructor(message?: string);
3
+ }
4
+ export declare class UnauthorizedError extends CustomError {
5
+ }
6
+ export declare class CrossOriginForbiddenError extends CustomError {
7
+ }
8
+ export declare class SameOriginForbiddenError extends CustomError {
9
+ }
10
+ export declare class NotFoundError extends CustomError {
11
+ }
12
+ export declare class NotEditableError extends CustomError {
13
+ }
14
+ export declare class WebOperationError extends CustomError {
15
+ }
16
+ export declare class FetchError extends CustomError {
17
+ status: number;
18
+ constructor(status: number, message?: string);
19
+ }
20
+ export {};
21
+ //# sourceMappingURL=CustomError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomError.d.ts","sourceRoot":"","sources":["../../src/logic/CustomError.ts"],"names":[],"mappings":"AAAA,cAAM,WAAY,SAAQ,KAAK;gBACf,OAAO,CAAC,EAAE,MAAM;CAM/B;AAED,qBAAa,iBAAkB,SAAQ,WAAW;CAAG;AAErD,qBAAa,yBAA0B,SAAQ,WAAW;CAAG;AAE7D,qBAAa,wBAAyB,SAAQ,WAAW;CAAG;AAE5D,qBAAa,aAAc,SAAQ,WAAW;CAAG;AAEjD,qBAAa,gBAAiB,SAAQ,WAAW;CAAI;AAErD,qBAAa,iBAAkB,SAAQ,WAAW;CAAG;AAErD,qBAAa,UAAW,SAAQ,WAAW;IACvC,MAAM,EAAE,MAAM,CAAA;gBAEF,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAI/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomError.esm.js","names":[],"sources":["../../src/logic/CustomError.ts"],"sourcesContent":["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}"],"mappings":";AAAA,IAAM,IAAN,cAA0B,MAAM;CAC5B,YAAY,GAAkB;EAI1B,AAHA,MAAM,CAAO,GAEb,OAAO,eAAe,MAAM,IAAI,OAAO,SAAS,GAChD,KAAK,OAAO,IAAI,OAAO;CAC3B;AACJ,GAEa,IAAb,cAAuC,EAAY,CAAC,GAEvC,IAAb,cAA+C,EAAY,CAAC,GAE/C,IAAb,cAA8C,EAAY,CAAC,GAE9C,IAAb,cAAmC,EAAY,CAAC,GAEnC,IAAb,cAAsC,EAAY,CAAE,GAEvC,IAAb,cAAuC,EAAY,CAAC,GAEvC,IAAb,cAAgC,EAAY;CAGxC,YAAY,GAAgB,GAAkB;EAE1C,AADA,MAAM,CAAO,GACb,KAAK,SAAS;CAClB;AACJ"}
1
+ {"version":3,"file":"CustomError.esm.js","names":[],"sources":["../../src/logic/CustomError.ts"],"sourcesContent":["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}"],"mappings":";AAAA,IAAM,IAAN,cAA0B,MAAM;CAC5B,YAAY,GAAkB;EAI1B,AAHA,MAAM,CAAO,GAEb,OAAO,eAAe,MAAM,WAAW,SAAS,GAChD,KAAK,OAAO,WAAW;CAC3B;AACJ,GAEa,IAAb,cAAuC,EAAY,CAAC,GAEvC,IAAb,cAA+C,EAAY,CAAC,GAE/C,IAAb,cAA8C,EAAY,CAAC,GAE9C,IAAb,cAAmC,EAAY,CAAC,GAEnC,IAAb,cAAsC,EAAY,CAAE,GAEvC,IAAb,cAAuC,EAAY,CAAC,GAEvC,IAAb,cAAgC,EAAY;CAGxC,YAAY,GAAgB,GAAkB;EAE1C,AADA,MAAM,CAAO,GACb,KAAK,SAAS;CAClB;AACJ"}
@@ -1,2 +1,2 @@
1
- const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("../util/debug.cjs.js"),n=require("../acl/aclLogic.cjs.js"),r=require("../authn/SolidAuthnLogic.cjs.js"),i=require("../authSession/flagAuthorizationOnTransitions.cjs.js"),a=require("../chat/chatLogic.cjs.js"),o=require("../inbox/inboxLogic.cjs.js"),s=require("../resource/resourceLogic.cjs.js"),c=require("../util/containerLogic.cjs.js"),l=require("../profile/profileLogic.cjs.js"),u=require("../typeIndex/typeIndexLogic.cjs.js"),d=require("../util/utilityLogic.cjs.js");let f=require("rdflib");f=e.__toESM(f);function p(e,p){t.log(`SolidLogic: Unique instance created. There should only be one of these.`);let m=f.graph();f.fetcher(m,{fetch:e.fetch}),m.updater=new f.UpdateManager(m),m.features=[];let h=i.flagAuthorizationOnSessionTransitions(m,p),g=new r.SolidAuthnLogic(p),_=g.dispose?.bind(g);g.dispose=()=>{h(),_?.()};let v=n.createAclLogic(m),y=c.createContainerLogic(m),b=d.createUtilityLogic(m,v,y),x=l.createProfileLogic(m,g,b),S=a.createChatLogic(m,x),C=o.createInboxLogic(m,x,b,y,v),w=u.createTypeIndexLogic(m,g,x,b),T=s.createResourceLogic(m,v,y,w);t.log(`SolidAuthnLogic initialized`);function E(e){return m.fetcher.load(e)}function D(e,t=[]){return new Promise((n,r)=>{m.updater.update(e,t,function(e,t,i){t?n():r(Error(i))})})}function O(){m.statements.slice().forEach(m.remove.bind(m))}return{store:m,authn:g,acl:v,resource:T,inbox:C,chat:S,profile:x,typeIndex:w,load:E,updatePromise:D,clearStore:O}}exports.createSolidLogic=p;
1
+ const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("../util/debug.cjs.js"),n=require("../acl/aclLogic.cjs.js"),r=require("../authn/SolidAuthnLogic.cjs.js"),i=require("../authSession/flagAuthorizationOnTransitions.cjs.js"),a=require("../chat/chatLogic.cjs.js"),o=require("../inbox/inboxLogic.cjs.js"),s=require("../resource/resourceLogic.cjs.js"),c=require("../util/containerLogic.cjs.js"),l=require("../profile/profileLogic.cjs.js"),u=require("../typeIndex/typeIndexLogic.cjs.js"),d=require("../directory/directoryLogic.cjs.js"),f=require("../util/utilityLogic.cjs.js");let p=require("rdflib");p=e.__toESM(p);function m(e,m){t.log(`SolidLogic: Unique instance created. There should only be one of these.`);let h=p.graph();p.fetcher(h,{fetch:e.fetch}),h.updater=new p.UpdateManager(h),h.features=[];let g=i.flagAuthorizationOnSessionTransitions(h,m),_=new r.SolidAuthnLogic(m),v=_.dispose?.bind(_);_.dispose=()=>{g(),v?.()};let y=n.createAclLogic(h),b=c.createContainerLogic(h),x=f.createUtilityLogic(h,y,b),S=l.createProfileLogic(h,_,x),C=a.createChatLogic(h,S),w=o.createInboxLogic(h,S,x,b,y),T=u.createTypeIndexLogic(h,_,S,x),E=d.createDirectoryLogic(h,_,T),D=s.createResourceLogic(h,y,b,T);t.log(`SolidAuthnLogic initialized`);function O(e){return h.fetcher.load(e)}function k(e,t=[]){return new Promise((n,r)=>{h.updater.update(e,t,function(e,t,i){t?n():r(Error(i))})})}function A(){h.statements.slice().forEach(h.remove.bind(h))}return{store:h,authn:_,acl:y,resource:D,inbox:w,chat:C,profile:S,typeIndex:T,directory:E,load:O,updatePromise:k,clearStore:A}}exports.createSolidLogic=m;
2
2
  //# sourceMappingURL=solidLogic.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solidLogic.cjs.js","names":[],"sources":["../../src/logic/solidLogic.ts"],"sourcesContent":["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 { flagAuthorizationOnSessionTransitions } from '../authSession/flagAuthorizationOnTransitions'\nimport { createChatLogic } from '../chat/chatLogic'\nimport { createInboxLogic } from '../inbox/inboxLogic'\nimport { createResourceLogic } from '../resource/resourceLogic'\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 // Whose credentials a request would carry changed: mark every recorded\n // response out-of-date so editability answers \"unknown\" instead of the\n // previous identity's access. Decision points repair with\n // ensureDocumentAuthorization() (see flagAuthorizationOnTransitions.ts).\n const unsubscribeAuthorization = flagAuthorizationOnSessionTransitions(store, session)\n\n const authn: AuthnLogic = new SolidAuthnLogic(session)\n\n // The subscription is released with the auth logic: both belong to this\n // instance's lifetime, so replacing a SolidLogic instance does not leave\n // the old store subscribed to the session.\n const disposeAuthn = authn.dispose?.bind(authn)\n authn.dispose = (): void => {\n unsubscribeAuthorization()\n disposeAuthn?.()\n }\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 const resource = createResourceLogic(store, acl, containerLogic, typeIndex)\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 resource,\n inbox,\n chat,\n profile,\n typeIndex,\n load,\n updatePromise,\n clearStore\n }\n}\n"],"mappings":"gkBAqBA,SAAgB,EAAiB,EAA8D,EAA8C,CAEzI,EAAA,IAAU,0EAA0E,EACpF,IAAM,EAAmB,EAAI,MAAM,EACnC,EAAI,QAAQ,EAAO,CAAC,MAAO,EAAa,KAAK,CAAC,EAC9C,EAAM,QAAU,IAAI,EAAI,cAAc,CAAK,EAC3C,EAAM,SAAW,CAAC,EAKlB,IAAM,EAA2B,EAAA,sCAAsC,EAAO,CAAO,EAE/E,EAAoB,IAAI,EAAA,gBAAgB,CAAO,EAK/C,EAAe,EAAM,SAAS,KAAK,CAAK,EAC9C,EAAM,YAAsB,CAC1B,EAAyB,EACzB,IAAe,CACjB,EAEA,IAAM,EAAM,EAAA,eAAe,CAAK,EAC1B,EAAiB,EAAA,qBAAqB,CAAK,EAC3C,EAAe,EAAA,mBAAmB,EAAO,EAAK,CAAc,EAC5D,EAAU,EAAA,mBAAmB,EAAO,EAAO,CAAY,EACvD,EAAO,EAAA,gBAAgB,EAAO,CAAO,EACrC,EAAQ,EAAA,iBAAiB,EAAO,EAAS,EAAc,EAAgB,CAAG,EAC1E,EAAY,EAAA,qBAAqB,EAAO,EAAO,EAAS,CAAY,EACpE,EAAW,EAAA,oBAAoB,EAAO,EAAK,EAAgB,CAAS,EAC1E,EAAA,IAAU,6BAA6B,EAEvC,SAAS,EAAK,EAAuC,CACjD,OAAO,EAAM,QAAQ,KAAK,CAAG,CACjC,CAGA,SAAS,EACL,EACA,EAAwB,CAAC,EACZ,CACb,OAAO,IAAI,SAAS,EAAS,IAAW,CACxC,EAAM,QAAQ,OAAO,EAAK,EAAK,SAAU,EAAM,EAAI,EAAW,CACrD,EAGL,EAAQ,EAFR,EAAW,MAAM,CAAS,CAAC,CAI/B,CAAC,CACD,CAAC,CACL,CAEA,SAAS,GAAa,CAClB,EAAM,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAM,OAAO,KAAK,CAAK,CAAC,CAC7D,CAEA,MAAO,CACH,QACA,QACA,MACA,WACA,QACA,OACA,UACA,YACA,OACA,gBACA,YACJ,CACJ"}
1
+ {"version":3,"file":"solidLogic.cjs.js","names":[],"sources":["../../src/logic/solidLogic.ts"],"sourcesContent":["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 { flagAuthorizationOnSessionTransitions } from '../authSession/flagAuthorizationOnTransitions'\nimport { createChatLogic } from '../chat/chatLogic'\nimport { createInboxLogic } from '../inbox/inboxLogic'\nimport { createResourceLogic } from '../resource/resourceLogic'\nimport { createProfileLogic } from '../profile/profileLogic'\nimport { createTypeIndexLogic } from '../typeIndex/typeIndexLogic'\nimport { createDirectoryLogic } from '../directory/directoryLogic'\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 // Whose credentials a request would carry changed: mark every recorded\n // response out-of-date so editability answers \"unknown\" instead of the\n // previous identity's access. Decision points repair with\n // ensureDocumentAuthorization() (see flagAuthorizationOnTransitions.ts).\n const unsubscribeAuthorization = flagAuthorizationOnSessionTransitions(store, session)\n\n const authn: AuthnLogic = new SolidAuthnLogic(session)\n\n // The subscription is released with the auth logic: both belong to this\n // instance's lifetime, so replacing a SolidLogic instance does not leave\n // the old store subscribed to the session.\n const disposeAuthn = authn.dispose?.bind(authn)\n authn.dispose = (): void => {\n unsubscribeAuthorization()\n disposeAuthn?.()\n }\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 const directory = createDirectoryLogic(store, authn, typeIndex)\n const resource = createResourceLogic(store, acl, containerLogic, typeIndex)\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 resource,\n inbox,\n chat,\n profile,\n typeIndex,\n directory,\n load,\n updatePromise,\n clearStore\n }\n}\n"],"mappings":"gnBAsBA,SAAgB,EAAiB,EAA8D,EAA8C,CAEzI,EAAA,IAAU,0EAA0E,EACpF,IAAM,EAAmB,EAAI,MAAM,EACnC,EAAI,QAAQ,EAAO,CAAC,MAAO,EAAa,KAAK,CAAC,EAC9C,EAAM,QAAU,IAAI,EAAI,cAAc,CAAK,EAC3C,EAAM,SAAW,CAAC,EAKlB,IAAM,EAA2B,EAAA,sCAAsC,EAAO,CAAO,EAE/E,EAAoB,IAAI,EAAA,gBAAgB,CAAO,EAK/C,EAAe,EAAM,SAAS,KAAK,CAAK,EAC9C,EAAM,YAAsB,CAC1B,EAAyB,EACzB,IAAe,CACjB,EAEA,IAAM,EAAM,EAAA,eAAe,CAAK,EAC1B,EAAiB,EAAA,qBAAqB,CAAK,EAC3C,EAAe,EAAA,mBAAmB,EAAO,EAAK,CAAc,EAC5D,EAAU,EAAA,mBAAmB,EAAO,EAAO,CAAY,EACvD,EAAO,EAAA,gBAAgB,EAAO,CAAO,EACrC,EAAQ,EAAA,iBAAiB,EAAO,EAAS,EAAc,EAAgB,CAAG,EAC1E,EAAY,EAAA,qBAAqB,EAAO,EAAO,EAAS,CAAY,EACpE,EAAY,EAAA,qBAAqB,EAAO,EAAO,CAAS,EACxD,EAAW,EAAA,oBAAoB,EAAO,EAAK,EAAgB,CAAS,EAC1E,EAAA,IAAU,6BAA6B,EAEvC,SAAS,EAAK,EAAuC,CACjD,OAAO,EAAM,QAAQ,KAAK,CAAG,CACjC,CAGA,SAAS,EACL,EACA,EAAwB,CAAC,EACZ,CACb,OAAO,IAAI,SAAS,EAAS,IAAW,CACxC,EAAM,QAAQ,OAAO,EAAK,EAAK,SAAU,EAAM,EAAI,EAAW,CACrD,EAGL,EAAQ,EAFR,EAAW,MAAM,CAAS,CAAC,CAI/B,CAAC,CACD,CAAC,CACL,CAEA,SAAS,GAAa,CAClB,EAAM,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAM,OAAO,KAAK,CAAK,CAAC,CAC7D,CAEA,MAAO,CACH,QACA,QACA,MACA,WACA,QACA,OACA,UACA,YACA,YACA,OACA,gBACA,YACJ,CACJ"}
@@ -0,0 +1,6 @@
1
+ import type { SessionWithLegacyEvents } from '../authSession/authSession';
2
+ import type { SolidLogic } from '../types';
3
+ export declare function createSolidLogic(specialFetch: {
4
+ fetch: (url: any, requestInit: any) => any;
5
+ }, session: SessionWithLegacyEvents): SolidLogic;
6
+ //# sourceMappingURL=solidLogic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solidLogic.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogic.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAUzE,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,UAAU,CAAA;AAQtD,wBAAgB,gBAAgB,CAAC,YAAY,EAAE;IAAE,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE,EAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CAyE3I"}
@@ -8,47 +8,49 @@ import { createResourceLogic as o } from "../resource/resourceLogic.esm.js";
8
8
  import { createContainerLogic as s } from "../util/containerLogic.esm.js";
9
9
  import { createProfileLogic as c } from "../profile/profileLogic.esm.js";
10
10
  import { createTypeIndexLogic as l } from "../typeIndex/typeIndexLogic.esm.js";
11
- import { createUtilityLogic as u } from "../util/utilityLogic.esm.js";
12
- import * as d from "rdflib";
11
+ import { createDirectoryLogic as u } from "../directory/directoryLogic.esm.js";
12
+ import { createUtilityLogic as d } from "../util/utilityLogic.esm.js";
13
+ import * as f from "rdflib";
13
14
  //#region src/logic/solidLogic.ts
14
- function f(f, p) {
15
+ function p(p, m) {
15
16
  e("SolidLogic: Unique instance created. There should only be one of these.");
16
- let m = d.graph();
17
- d.fetcher(m, { fetch: f.fetch }), m.updater = new d.UpdateManager(m), m.features = [];
18
- let h = r(m, p), g = new n(p), _ = g.dispose?.bind(g);
19
- g.dispose = () => {
20
- h(), _?.();
17
+ let h = f.graph();
18
+ f.fetcher(h, { fetch: p.fetch }), h.updater = new f.UpdateManager(h), h.features = [];
19
+ let g = r(h, m), _ = new n(m), v = _.dispose?.bind(_);
20
+ _.dispose = () => {
21
+ g(), v?.();
21
22
  };
22
- let v = t(m), y = s(m), b = u(m, v, y), x = c(m, g, b), S = i(m, x), C = a(m, x, b, y, v), w = l(m, g, x, b), T = o(m, v, y, w);
23
+ let y = t(h), b = s(h), x = d(h, y, b), S = c(h, _, x), C = i(h, S), w = a(h, S, x, b, y), T = l(h, _, S, x), E = u(h, _, T), D = o(h, y, b, T);
23
24
  e("SolidAuthnLogic initialized");
24
- function E(e) {
25
- return m.fetcher.load(e);
25
+ function O(e) {
26
+ return h.fetcher.load(e);
26
27
  }
27
- function D(e, t = []) {
28
+ function k(e, t = []) {
28
29
  return new Promise((n, r) => {
29
- m.updater.update(e, t, function(e, t, i) {
30
+ h.updater.update(e, t, function(e, t, i) {
30
31
  t ? n() : r(Error(i));
31
32
  });
32
33
  });
33
34
  }
34
- function O() {
35
- m.statements.slice().forEach(m.remove.bind(m));
35
+ function A() {
36
+ h.statements.slice().forEach(h.remove.bind(h));
36
37
  }
37
38
  return {
38
- store: m,
39
- authn: g,
40
- acl: v,
41
- resource: T,
42
- inbox: C,
43
- chat: S,
44
- profile: x,
45
- typeIndex: w,
46
- load: E,
47
- updatePromise: D,
48
- clearStore: O
39
+ store: h,
40
+ authn: _,
41
+ acl: y,
42
+ resource: D,
43
+ inbox: w,
44
+ chat: C,
45
+ profile: S,
46
+ typeIndex: T,
47
+ directory: E,
48
+ load: O,
49
+ updatePromise: k,
50
+ clearStore: A
49
51
  };
50
52
  }
51
53
  //#endregion
52
- export { f as createSolidLogic };
54
+ export { p as createSolidLogic };
53
55
 
54
56
  //# sourceMappingURL=solidLogic.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solidLogic.esm.js","names":[],"sources":["../../src/logic/solidLogic.ts"],"sourcesContent":["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 { flagAuthorizationOnSessionTransitions } from '../authSession/flagAuthorizationOnTransitions'\nimport { createChatLogic } from '../chat/chatLogic'\nimport { createInboxLogic } from '../inbox/inboxLogic'\nimport { createResourceLogic } from '../resource/resourceLogic'\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 // Whose credentials a request would carry changed: mark every recorded\n // response out-of-date so editability answers \"unknown\" instead of the\n // previous identity's access. Decision points repair with\n // ensureDocumentAuthorization() (see flagAuthorizationOnTransitions.ts).\n const unsubscribeAuthorization = flagAuthorizationOnSessionTransitions(store, session)\n\n const authn: AuthnLogic = new SolidAuthnLogic(session)\n\n // The subscription is released with the auth logic: both belong to this\n // instance's lifetime, so replacing a SolidLogic instance does not leave\n // the old store subscribed to the session.\n const disposeAuthn = authn.dispose?.bind(authn)\n authn.dispose = (): void => {\n unsubscribeAuthorization()\n disposeAuthn?.()\n }\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 const resource = createResourceLogic(store, acl, containerLogic, typeIndex)\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 resource,\n inbox,\n chat,\n profile,\n typeIndex,\n load,\n updatePromise,\n clearStore\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,SAAgB,EAAiB,GAA8D,GAA8C;CAEzI,EAAU,0EAA0E;CACpF,IAAM,IAAmB,EAAI,MAAM;CAGnC,AAFA,EAAI,QAAQ,GAAO,EAAC,OAAO,EAAa,MAAK,CAAC,GAC9C,EAAM,UAAU,IAAI,EAAI,cAAc,CAAK,GAC3C,EAAM,WAAW,CAAC;CAKlB,IAAM,IAA2B,EAAsC,GAAO,CAAO,GAE/E,IAAoB,IAAI,EAAgB,CAAO,GAK/C,IAAe,EAAM,SAAS,KAAK,CAAK;CAC9C,EAAM,gBAAsB;EAE1B,AADA,EAAyB,GACzB,IAAe;CACjB;CAEA,IAAM,IAAM,EAAe,CAAK,GAC1B,IAAiB,EAAqB,CAAK,GAC3C,IAAe,EAAmB,GAAO,GAAK,CAAc,GAC5D,IAAU,EAAmB,GAAO,GAAO,CAAY,GACvD,IAAO,EAAgB,GAAO,CAAO,GACrC,IAAQ,EAAiB,GAAO,GAAS,GAAc,GAAgB,CAAG,GAC1E,IAAY,EAAqB,GAAO,GAAO,GAAS,CAAY,GACpE,IAAW,EAAoB,GAAO,GAAK,GAAgB,CAAS;CAC1E,EAAU,6BAA6B;CAEvC,SAAS,EAAK,GAAuC;EACjD,OAAO,EAAM,QAAQ,KAAK,CAAG;CACjC;CAGA,SAAS,EACL,GACA,IAAwB,CAAC,GACZ;EACb,OAAO,IAAI,SAAS,GAAS,MAAW;GACxC,EAAM,QAAQ,OAAO,GAAK,GAAK,SAAU,GAAM,GAAI,GAAW;IAC1D,AAAK,IAGL,EAAQ,IAFR,EAAW,MAAM,CAAS,CAAC;GAI/B,CAAC;EACD,CAAC;CACL;CAEA,SAAS,IAAa;EAClB,EAAM,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAM,OAAO,KAAK,CAAK,CAAC;CAC7D;CAEA,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ;AACJ"}
1
+ {"version":3,"file":"solidLogic.esm.js","names":[],"sources":["../../src/logic/solidLogic.ts"],"sourcesContent":["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 { flagAuthorizationOnSessionTransitions } from '../authSession/flagAuthorizationOnTransitions'\nimport { createChatLogic } from '../chat/chatLogic'\nimport { createInboxLogic } from '../inbox/inboxLogic'\nimport { createResourceLogic } from '../resource/resourceLogic'\nimport { createProfileLogic } from '../profile/profileLogic'\nimport { createTypeIndexLogic } from '../typeIndex/typeIndexLogic'\nimport { createDirectoryLogic } from '../directory/directoryLogic'\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 // Whose credentials a request would carry changed: mark every recorded\n // response out-of-date so editability answers \"unknown\" instead of the\n // previous identity's access. Decision points repair with\n // ensureDocumentAuthorization() (see flagAuthorizationOnTransitions.ts).\n const unsubscribeAuthorization = flagAuthorizationOnSessionTransitions(store, session)\n\n const authn: AuthnLogic = new SolidAuthnLogic(session)\n\n // The subscription is released with the auth logic: both belong to this\n // instance's lifetime, so replacing a SolidLogic instance does not leave\n // the old store subscribed to the session.\n const disposeAuthn = authn.dispose?.bind(authn)\n authn.dispose = (): void => {\n unsubscribeAuthorization()\n disposeAuthn?.()\n }\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 const directory = createDirectoryLogic(store, authn, typeIndex)\n const resource = createResourceLogic(store, acl, containerLogic, typeIndex)\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 resource,\n inbox,\n chat,\n profile,\n typeIndex,\n directory,\n load,\n updatePromise,\n clearStore\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,SAAgB,EAAiB,GAA8D,GAA8C;CAEzI,EAAU,0EAA0E;CACpF,IAAM,IAAmB,EAAI,MAAM;CAGnC,AAFA,EAAI,QAAQ,GAAO,EAAC,OAAO,EAAa,MAAK,CAAC,GAC9C,EAAM,UAAU,IAAI,EAAI,cAAc,CAAK,GAC3C,EAAM,WAAW,CAAC;CAKlB,IAAM,IAA2B,EAAsC,GAAO,CAAO,GAE/E,IAAoB,IAAI,EAAgB,CAAO,GAK/C,IAAe,EAAM,SAAS,KAAK,CAAK;CAC9C,EAAM,gBAAsB;EAE1B,AADA,EAAyB,GACzB,IAAe;CACjB;CAEA,IAAM,IAAM,EAAe,CAAK,GAC1B,IAAiB,EAAqB,CAAK,GAC3C,IAAe,EAAmB,GAAO,GAAK,CAAc,GAC5D,IAAU,EAAmB,GAAO,GAAO,CAAY,GACvD,IAAO,EAAgB,GAAO,CAAO,GACrC,IAAQ,EAAiB,GAAO,GAAS,GAAc,GAAgB,CAAG,GAC1E,IAAY,EAAqB,GAAO,GAAO,GAAS,CAAY,GACpE,IAAY,EAAqB,GAAO,GAAO,CAAS,GACxD,IAAW,EAAoB,GAAO,GAAK,GAAgB,CAAS;CAC1E,EAAU,6BAA6B;CAEvC,SAAS,EAAK,GAAuC;EACjD,OAAO,EAAM,QAAQ,KAAK,CAAG;CACjC;CAGA,SAAS,EACL,GACA,IAAwB,CAAC,GACZ;EACb,OAAO,IAAI,SAAS,GAAS,MAAW;GACxC,EAAM,QAAQ,OAAO,GAAK,GAAK,SAAU,GAAM,GAAI,GAAW;IAC1D,AAAK,IAGL,EAAQ,IAFR,EAAW,MAAM,CAAS,CAAC;GAI/B,CAAC;EACD,CAAC;CACL;CAEA,SAAS,IAAa;EAClB,EAAM,WAAW,MAAM,CAAC,CAAC,QAAQ,EAAM,OAAO,KAAK,CAAK,CAAC;CAC7D;CAEA,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ;AACJ"}
@@ -1,2 +1,2 @@
1
- const e=require("../util/debug.cjs.js"),t=require("../authSession/identityState.cjs.js"),n=require("../authSession/authSession.cjs.js"),r=require("./solidLogic.cjs.js");var i=async(e,r)=>{let i=r&&r.credentials&&r.credentials==`omit`,a=n.authSession;if(!t.sessionExplicitlyInactive(a)&&(a?.info?.webId||a?.webId)&&!i){let t=typeof a.fetch==`function`?a.fetch.bind(a):typeof a.authFetch==`function`?a.authFetch.bind(a):null;return t?t(e,r):window.fetch(e,r)}else return window.fetch(e,r)},a=Symbol.for(`solid-logic-singleton`),o=typeof window<`u`?window:global;function s(){return o[a]?e.log(`SolidLogic: Using existing global singleton instance.`):(e.log(`SolidLogic: Creating new global singleton instance.`),o[a]=r.createSolidLogic({fetch:i},n.authSession),e.log(`Unique quadstore initialized.`)),o[a]}var c=s();exports.solidLogicSingleton=c;
1
+ const e=require("../util/debug.cjs.js"),t=require("../authSession/identityState.cjs.js"),n=require("../authSession/authSession.cjs.js"),r=require("./solidLogic.cjs.js");var i=async(e,r)=>{let i=r&&r.credentials&&r.credentials==`omit`,a=n.authSession;if(!t.sessionExplicitlyInactive(a)&&(a?.info?.webId||a?.webId)&&!i){let t=typeof a.fetch==`function`?a.fetch.bind(a):typeof a.authFetch==`function`?a.authFetch.bind(a):null;return t?t(e,r):window.fetch(e,r)}return window.fetch(e,r)},a=Symbol.for(`solid-logic-singleton`),o=typeof window<`u`?window:global;function s(){return o[a]?e.log(`SolidLogic: Using existing global singleton instance.`):(e.log(`SolidLogic: Creating new global singleton instance.`),o[a]=r.createSolidLogic({fetch:i},n.authSession),e.log(`Unique quadstore initialized.`)),o[a]}var c=s();exports.solidLogicSingleton=c;
2
2
  //# sourceMappingURL=solidLogicSingleton.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solidLogicSingleton.cjs.js","names":[],"sources":["../../src/logic/solidLogicSingleton.ts"],"sourcesContent":["import * as debug from '../util/debug'\nimport { authSession } from '../authSession/authSession'\nimport { sessionExplicitlyInactive } from '../authSession/identityState'\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 // A session that explicitly reports itself inactive must not keep\n // identifying the last user: with a retained WebID, choosing the\n // authenticated fetch would send the previous identity's credentials.\n const sessionWebId = sessionExplicitlyInactive(sessionAny)\n ? undefined\n : (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 }"],"mappings":"yKAMA,IAAM,EAAS,MAAO,EAAK,IAAgB,CACvC,IAAM,EAAY,GAAe,EAAY,aAAe,EAAY,aAAe,OACjF,EAAa,EAAA,YAOnB,GAHqB,GAAA,0BAA0B,CAAU,IAElD,GAAY,MAAM,OAAS,GAAY,QAC1B,CAAC,EAAW,CAE5B,IAAM,EAAsB,OAAO,EAAW,OAAU,WAClD,EAAW,MAAM,KAAK,CAAU,EAC/B,OAAO,EAAW,WAAc,WAAa,EAAW,UAAU,KAAK,CAAU,EAAI,KAI5F,OAHI,EACO,EAAmB,EAAK,CAAW,EAEvC,OAAO,MAAM,EAAK,CAAW,CACxC,MACI,OAAO,OAAO,MAAM,EAAK,CAAW,CAE5C,EAGM,EAAmB,OAAO,IAAI,uBAAuB,EAOrD,EAAgB,OAAO,OAAW,IAAc,OAAS,OAE/D,SAAS,GAAmC,CAQxC,OAPK,EAAa,GAKd,EAAA,IAAU,uDAAuD,GAJjE,EAAA,IAAU,qDAAqD,EAC/D,EAAa,GAAoB,EAAA,iBAAiB,CAAE,MAAO,CAAO,EAAG,EAAA,WAAW,EAChF,EAAA,IAAU,+BAA+B,GAItC,EAAa,EACxB,CAEA,IAAM,EAAsB,EAAqB"}
1
+ {"version":3,"file":"solidLogicSingleton.cjs.js","names":[],"sources":["../../src/logic/solidLogicSingleton.ts"],"sourcesContent":["import * as debug from '../util/debug'\nimport { authSession } from '../authSession/authSession'\nimport { sessionExplicitlyInactive } from '../authSession/identityState'\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 // A session that explicitly reports itself inactive must not keep\n // identifying the last user: with a retained WebID, choosing the\n // authenticated fetch would send the previous identity's credentials.\n const sessionWebId = sessionExplicitlyInactive(sessionAny)\n ? undefined\n : (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 }"],"mappings":"yKAMA,IAAM,EAAS,MAAO,EAAK,IAAgB,CACvC,IAAM,EAAY,GAAe,EAAY,aAAe,EAAY,aAAe,OACjF,EAAa,EAAA,YAOnB,GAHqB,GAAA,0BAA0B,CAAU,IAElD,GAAY,MAAM,OAAS,GAAY,QAC1B,CAAC,EAAW,CAE5B,IAAM,EAAsB,OAAO,EAAW,OAAU,WAClD,EAAW,MAAM,KAAK,CAAU,EAC/B,OAAO,EAAW,WAAc,WAAa,EAAW,UAAU,KAAK,CAAU,EAAI,KAI5F,OAHI,EACO,EAAmB,EAAK,CAAW,EAEvC,OAAO,MAAM,EAAK,CAAW,CACxC,CACI,OAAO,OAAO,MAAM,EAAK,CAAW,CAE5C,EAGM,EAAmB,OAAO,IAAI,uBAAuB,EAOrD,EAAgB,OAAO,OAAW,IAAc,OAAS,OAE/D,SAAS,GAAmC,CAQxC,OAPK,EAAa,GAKd,EAAA,IAAU,uDAAuD,GAJjE,EAAA,IAAU,qDAAqD,EAC/D,EAAa,GAAoB,EAAA,iBAAiB,CAAE,MAAO,CAAO,EAAG,EAAA,WAAW,EAChF,EAAA,IAAU,+BAA+B,GAItC,EAAa,EACxB,CAEA,IAAM,EAAsB,EAAqB"}
@@ -0,0 +1,4 @@
1
+ import { SolidLogic } from '../types';
2
+ declare const solidLogicSingleton: SolidLogic;
3
+ export { solidLogicSingleton };
4
+ //# sourceMappingURL=solidLogicSingleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solidLogicSingleton.d.ts","sourceRoot":"","sources":["../../src/logic/solidLogicSingleton.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AA8CrC,QAAA,MAAM,mBAAmB,YAAyB,CAAA;AAElD,OAAO,EAAE,mBAAmB,EAAE,CAAA"}