solid-logic 6.0.1-5 → 6.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 (102) hide show
  1. package/dist/acl/accessControlSubjects.cjs.js +1 -1
  2. package/dist/acl/accessControlSubjects.cjs.js.map +1 -1
  3. package/dist/acl/accessControlSubjects.esm.js +16 -17
  4. package/dist/acl/aclLogic.cjs.js.map +1 -1
  5. package/dist/acl/aclLogic.esm.js +1 -2
  6. package/dist/authSession/authSession.cjs.js.map +1 -1
  7. package/dist/authSession/authSession.esm.js +1 -2
  8. package/dist/authSession/events.cjs.js.map +1 -1
  9. package/dist/authSession/events.esm.js +1 -2
  10. package/dist/authSession/flagAuthorizationOnTransitions.cjs.js.map +1 -1
  11. package/dist/authSession/flagAuthorizationOnTransitions.esm.js +1 -2
  12. package/dist/authSession/identityState.cjs.js.map +1 -1
  13. package/dist/authSession/identityState.esm.js +1 -2
  14. package/dist/authSession/issuer.cjs.js.map +1 -1
  15. package/dist/authSession/issuer.esm.js +1 -2
  16. package/dist/authSession/session.cjs.js +1 -1
  17. package/dist/authSession/session.cjs.js.map +1 -1
  18. package/dist/authSession/session.esm.js +2 -3
  19. package/dist/authSession/session.esm.js.map +1 -1
  20. package/dist/authn/SolidAuthnLogic.cjs.js +1 -1
  21. package/dist/authn/SolidAuthnLogic.cjs.js.map +1 -1
  22. package/dist/authn/SolidAuthnLogic.esm.js +41 -42
  23. package/dist/authn/authUtil.cjs.js.map +1 -1
  24. package/dist/authn/authUtil.esm.js +1 -2
  25. package/dist/authn/serverLogout.cjs.js.map +1 -1
  26. package/dist/authn/serverLogout.esm.js +1 -2
  27. package/dist/chat/chatLogic.cjs.js.map +1 -1
  28. package/dist/chat/chatLogic.esm.js +1 -2
  29. package/dist/directory/catalogDirectory.cjs.js +1 -1
  30. package/dist/directory/catalogDirectory.cjs.js.map +1 -1
  31. package/dist/directory/catalogDirectory.esm.js +15 -16
  32. package/dist/directory/contactsDirectory.cjs.js.map +1 -1
  33. package/dist/directory/contactsDirectory.esm.js +1 -2
  34. package/dist/directory/directoryHelpers.cjs.js.map +1 -1
  35. package/dist/directory/directoryHelpers.esm.js +1 -2
  36. package/dist/directory/directoryLogic.cjs.js +1 -1
  37. package/dist/directory/directoryLogic.cjs.js.map +1 -1
  38. package/dist/directory/directoryLogic.esm.js +14 -15
  39. package/dist/directory/friendsDirectory.cjs.js.map +1 -1
  40. package/dist/directory/friendsDirectory.esm.js +1 -2
  41. package/dist/inbox/inboxLogic.cjs.js.map +1 -1
  42. package/dist/inbox/inboxLogic.esm.js +1 -2
  43. package/dist/index.cjs.js +1 -1
  44. package/dist/index.cjs.js.map +1 -1
  45. package/dist/index.d.ts +2 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.esm.js +11 -11
  48. package/dist/index.esm.js.map +1 -1
  49. package/dist/issuer/issuerLogic.cjs.js.map +1 -1
  50. package/dist/issuer/issuerLogic.esm.js +1 -2
  51. package/dist/logic/CustomError.cjs.js.map +1 -1
  52. package/dist/logic/CustomError.esm.js +1 -2
  53. package/dist/logic/solidLogic.cjs.js +1 -1
  54. package/dist/logic/solidLogic.cjs.js.map +1 -1
  55. package/dist/logic/solidLogic.esm.js +17 -18
  56. package/dist/logic/solidLogicSingleton.cjs.js +1 -1
  57. package/dist/logic/solidLogicSingleton.cjs.js.map +1 -1
  58. package/dist/logic/solidLogicSingleton.esm.js +6 -7
  59. package/dist/profile/profileAclDocuments.cjs.js.map +1 -1
  60. package/dist/profile/profileAclDocuments.esm.js +1 -2
  61. package/dist/profile/profileDocuments.cjs.js +6 -2
  62. package/dist/profile/profileDocuments.cjs.js.map +1 -1
  63. package/dist/profile/profileDocuments.esm.js +2 -10
  64. package/dist/profile/profileDocuments.esm.js.map +1 -1
  65. package/dist/profile/profileLogic.cjs.js +1 -1
  66. package/dist/profile/profileLogic.cjs.js.map +1 -1
  67. package/dist/profile/profileLogic.esm.js +47 -48
  68. package/dist/resource/resourceHttp.cjs.js.map +1 -1
  69. package/dist/resource/resourceHttp.esm.js +1 -2
  70. package/dist/resource/resourceLogic.cjs.js +1 -1
  71. package/dist/resource/resourceLogic.cjs.js.map +1 -1
  72. package/dist/resource/resourceLogic.d.ts.map +1 -1
  73. package/dist/resource/resourceLogic.esm.js +179 -94
  74. package/dist/resource/resourceLogic.esm.js.map +1 -1
  75. package/dist/resource/resourceMetadata.cjs.js.map +1 -1
  76. package/dist/resource/resourceMetadata.esm.js +1 -2
  77. package/dist/typeIndex/typeIndexAclDocuments.cjs.js.map +1 -1
  78. package/dist/typeIndex/typeIndexAclDocuments.esm.js +1 -2
  79. package/dist/typeIndex/typeIndexDocuments.cjs.js +7 -3
  80. package/dist/typeIndex/typeIndexDocuments.cjs.js.map +1 -1
  81. package/dist/typeIndex/typeIndexDocuments.esm.js +3 -14
  82. package/dist/typeIndex/typeIndexDocuments.esm.js.map +1 -1
  83. package/dist/typeIndex/typeIndexLogic.cjs.js.map +1 -1
  84. package/dist/typeIndex/typeIndexLogic.esm.js +1 -2
  85. package/dist/types.cjs.js +2 -0
  86. package/dist/types.cjs.js.map +1 -0
  87. package/dist/types.d.ts +15 -0
  88. package/dist/types.d.ts.map +1 -1
  89. package/dist/types.esm.js +9 -0
  90. package/dist/types.esm.js.map +1 -0
  91. package/dist/util/containerLogic.cjs.js.map +1 -1
  92. package/dist/util/containerLogic.esm.js +1 -2
  93. package/dist/util/debug.cjs.js.map +1 -1
  94. package/dist/util/debug.esm.js +1 -2
  95. package/dist/util/ns.cjs.js.map +1 -1
  96. package/dist/util/ns.esm.js +1 -2
  97. package/dist/util/utilityLogic.cjs.js +1 -1
  98. package/dist/util/utilityLogic.cjs.js.map +1 -1
  99. package/dist/util/utilityLogic.esm.js +42 -43
  100. package/dist/util/utils.cjs.js.map +1 -1
  101. package/dist/util/utils.esm.js +1 -2
  102. package/package.json +11 -11
@@ -1,8 +1,8 @@
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
1
+ import { createContactsDirectoryDiscovery as e } from "./contactsDirectory.esm.js";
2
+ import { createFriendsDirectoryDiscovery as t } from "./friendsDirectory.esm.js";
3
+ import { createCatalogDirectoryDiscovery as n } from "./catalogDirectory.esm.js";
4
+ import { matchesAnyLabel as r, mergeDirectoryEntry as i, sortEntries as a } from "./directoryHelpers.esm.js";
5
+ // src/directory/directoryLogic.ts
6
6
  var o = 3, s = "https://raw.githubusercontent.com/solid/catalog/refs/heads/main/catalog-data.ttl", c = [
7
7
  "contacts",
8
8
  "friends",
@@ -10,18 +10,18 @@ var o = 3, s = "https://raw.githubusercontent.com/solid/catalog/refs/heads/main/
10
10
  "groups"
11
11
  ];
12
12
  function l(s, l, u) {
13
- let d = r(s, u), f = i(s), p = a();
13
+ let d = e(s, u), f = t(s), p = n();
14
14
  async function m(e) {
15
- let r = /* @__PURE__ */ new Map(), i = [], a = (e) => {
16
- t(r, e);
15
+ let t = /* @__PURE__ */ new Map(), n = [], r = (e) => {
16
+ i(t, e);
17
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());
18
+ if (e.sources.includes("catalog") && n.push(p.discoverCatalogEntries(e.catalogUrl, r)), e.user && (e.sources.includes("contacts") && n.push(d.discoverAddressBookContacts(e.user, r)), e.sources.includes("groups") && n.push(d.discoverAddressBookGroups(e.user, r)), e.sources.includes("friends") && n.push(f.discoverFoafPeople(e.user, e.maxFoafDistance, r))), !n.length) return [];
19
+ if ((await Promise.allSettled(n)).every((e) => e.status === "rejected")) throw Error("Unable to load directory entries.");
20
+ return a(t.values());
21
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));
22
+ async function h(e = {}) {
23
+ let t = g(e);
24
+ return (await m(t)).filter((e) => r([e.label, ...e.searchableLabels ?? []], t.query));
25
25
  }
26
26
  return { search: h };
27
27
  function g(e = {}) {
@@ -35,7 +35,6 @@ function l(s, l, u) {
35
35
  };
36
36
  }
37
37
  }
38
- //#endregion
39
38
  export { s as DEFAULT_DIRECTORY_CATALOG_URL, c as DEFAULT_DIRECTORY_SOURCES, l as createDirectoryLogic };
40
39
 
41
40
  //# sourceMappingURL=directoryLogic.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"friendsDirectory.cjs.js","names":["storedLabelForNode","loadDocumentSilently","ns","require_ns","require_directoryHelpers","PEOPLE_SEARCH_CONCURRENCY","createFriendsDirectoryDiscovery","relationshipLabelForDepth","depth","emitPersonEntry","personName","store","person","onEntry","discoverFoafPeople","visited","user","emitted","loadedDocs","queue","processPerson","current","currentEntry","currentDoc","maxFoafDistance","nextPeople","contacts","contact","contactName","nextQueue","index","batch","entries"],"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,IAAMK,EAA4B,EAElC,SAAgBC,EAAiC,EAAkB,CACjE,SAASC,EAA2B,EAAe,CACjD,OAAOC,IAAU,EAAI,SAAW,QAClC,CAEA,eAAeC,EACb,EACA,EACA,EACe,CACf,IAAMC,EAAaV,EAAAA,mBAAmBW,EAAOC,CAAM,EAC9CF,GAEL,MAAMG,EAAQ,CACZ,KAAM,SACN,IAAKD,EAAO,MACZ,MAAOF,EACP,YAAa,QACb,kBAAmBH,EAA0BC,CAAK,EAClD,QAAS,CAAC,SAAS,CACrB,CAAC,CACH,CAEA,eAAeM,EACb,EACA,EACA,EACe,CACf,IAAMC,EAAU,IAAI,IAAY,CAACC,EAAK,KAAK,CAAC,EACtCC,EAAU,IAAI,IACdC,EAAa,IAAI,IACnBC,EAAqD,CAAC,CAAE,OAAQH,EAAM,MAAO,CAAE,CAAC,EAE9EI,EAAgB,KAAO,IAAuD,CAClF,GAAM,CAAE,OAAQC,EAAS,SAAUC,EAC7BC,EAAaF,EAAQ,IAAI,CAAC,CAAC,MAajC,GAZKH,EAAW,IAAIK,CAAU,IAC5BL,EAAW,IAAIK,CAAU,EACzB,MAAMtB,EAAAA,qBAAqBU,EAAOU,CAAO,GAGvCA,EAAQ,QAAUL,EAAK,QACpBC,EAAQ,IAAII,EAAQ,KAAK,IAC5BJ,EAAQ,IAAII,EAAQ,KAAK,EACzB,MAAMZ,EAAgBY,EAASb,EAAOK,CAAO,IAI7CL,GAASgB,EACX,MAAO,CAAC,EAGV,IAAMC,EAA0D,CAAC,EAC3DC,EAAWf,EAAM,KAAKU,EAASnB,EAAAA,GAAG,KAAK,OAAO,CAAC,EACrD,IAAK,IAAMyB,KAAWD,EACpB,GAAIC,EAAQ,WAAa,YAAa,CACpC,IAAMC,EAAc5B,EAAAA,mBAAmBW,EAAOgB,CAAO,EACjDA,EAAQ,QAAUX,EAAK,OAASY,GAAe,CAACX,EAAQ,IAAIU,EAAQ,KAAK,IAC3EV,EAAQ,IAAIU,EAAQ,KAAK,EACzB,MAAMd,EAAQ,CACZ,KAAM,SACN,IAAKc,EAAQ,MACb,MAAOC,EACP,YAAa,QACb,kBAAmBpB,IAAU,EAAI,SAAW,SAC5C,QAAS,CAAC,SAAS,CACrB,CAAC,GAGEO,EAAQ,IAAIY,EAAQ,KAAK,IAC5BZ,EAAQ,IAAIY,EAAQ,KAAK,EACzBF,EAAW,KAAK,CAAE,OAAQE,EAAS,MAAOnB,EAAQ,CAAE,CAAC,EAEzD,CAGF,OAAOiB,CACT,EAEA,KAAON,EAAM,OAAS,GAAG,CACvB,IAAMU,EAAyD,CAAC,EAEhE,IAAK,IAAIC,EAAQ,EAAGA,EAAQX,EAAM,OAAQ,GAASd,EAA2B,CAC5E,IAAM0B,EAAQZ,EAAM,MAAMW,EAAOA,EAAQzB,CAAyB,GAElE,MADqB,QAAQ,IAAI0B,EAAM,IAAIX,CAAa,CAAC,EAAA,CAClD,QAAQ,GAAWS,EAAU,KAAK,GAAGG,CAAO,CAAC,CACtD,CAEA,EAAQH,CACV,CACF,CAEA,MAAO,CACL,oBACF,CACF"}
1
+ {"version":3,"file":"friendsDirectory.cjs.js","names":["storedLabelForNode","loadDocumentSilently","ns","require_ns","require_directoryHelpers","PEOPLE_SEARCH_CONCURRENCY","createFriendsDirectoryDiscovery","relationshipLabelForDepth","depth","emitPersonEntry","personName","store","person","onEntry","discoverFoafPeople","visited","user","emitted","loadedDocs","queue","processPerson","current","currentEntry","currentDoc","maxFoafDistance","nextPeople","contacts","contact","contactName","nextQueue","index","batch","entries"],"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":"A,4EAKA,IAAMK,EAA4B,EAElC,SAAgBC,EAAiC,EAAkB,CACjE,SAASC,EAA2B,EAAe,CACjD,OAAOC,IAAU,EAAI,SAAW,QAClC,CAEA,eAAeC,EACb,EACA,EACA,EACe,CACf,IAAMC,EAAaV,EAAAA,mBAAmBW,EAAOC,CAAM,EAC9CF,GAEL,MAAMG,EAAQ,CACZ,KAAM,SACN,IAAKD,EAAO,MACZ,MAAOF,EACP,YAAa,QACb,kBAAmBH,EAA0BC,CAAK,EAClD,QAAS,CAAC,SAAS,CACrB,CAAC,CACH,CAEA,eAAeM,EACb,EACA,EACA,EACe,CACf,IAAMC,EAAU,IAAI,IAAY,CAACC,EAAK,KAAK,CAAC,EACtCC,EAAU,IAAI,IACdC,EAAa,IAAI,IACnBC,EAAqD,CAAC,CAAE,OAAQH,EAAM,MAAO,CAAE,CAAC,EAE9EI,EAAgB,KAAO,IAAuD,CAClF,GAAM,CAAE,OAAQC,EAAS,SAAUC,EAC7BC,EAAaF,EAAQ,IAAI,CAAC,CAAC,MAajC,GAZKH,EAAW,IAAIK,CAAU,IAC5BL,EAAW,IAAIK,CAAU,EACzB,MAAMtB,EAAAA,qBAAqBU,EAAOU,CAAO,GAGvCA,EAAQ,QAAUL,EAAK,QACpBC,EAAQ,IAAII,EAAQ,KAAK,IAC5BJ,EAAQ,IAAII,EAAQ,KAAK,EACzB,MAAMZ,EAAgBY,EAASb,EAAOK,CAAO,IAI7CL,GAASgB,EACX,MAAO,CAAC,EAGV,IAAMC,EAA0D,CAAC,EAC3DC,EAAWf,EAAM,KAAKU,EAASnB,EAAAA,GAAG,KAAK,OAAO,CAAC,EACrD,IAAK,IAAMyB,KAAWD,EACpB,GAAIC,EAAQ,WAAa,YAAa,CACpC,IAAMC,EAAc5B,EAAAA,mBAAmBW,EAAOgB,CAAO,EACjDA,EAAQ,QAAUX,EAAK,OAASY,GAAe,CAACX,EAAQ,IAAIU,EAAQ,KAAK,IAC3EV,EAAQ,IAAIU,EAAQ,KAAK,EACzB,MAAMd,EAAQ,CACZ,KAAM,SACN,IAAKc,EAAQ,MACb,MAAOC,EACP,YAAa,QACb,kBAAmBpB,IAAU,EAAI,SAAW,SAC5C,QAAS,CAAC,SAAS,CACrB,CAAC,GAGEO,EAAQ,IAAIY,EAAQ,KAAK,IAC5BZ,EAAQ,IAAIY,EAAQ,KAAK,EACzBF,EAAW,KAAK,CAAE,OAAQE,EAAS,MAAOnB,EAAQ,CAAE,CAAC,EAEzD,CAGF,OAAOiB,CACT,EAEA,KAAON,EAAM,OAAS,GAAG,CACvB,IAAMU,EAAyD,CAAC,EAEhE,IAAK,IAAIC,EAAQ,EAAGA,EAAQX,EAAM,OAAQ,GAASd,EAA2B,CAC5E,IAAM0B,EAAQZ,EAAM,MAAMW,EAAOA,EAAQzB,CAAyB,GAElE,MADqB,QAAQ,IAAI0B,EAAM,IAAIX,CAAa,CAAC,EAAA,CAClD,QAAQ,GAAWS,EAAU,KAAK,GAAGG,CAAO,CAAC,CACtD,CAEA,EAAQH,CACV,CACF,CAEA,MAAO,CACL,oBACF,CACF,C"}
@@ -1,6 +1,6 @@
1
1
  import { ns as e } from "../util/ns.esm.js";
2
2
  import { loadDocumentSilently as t, storedLabelForNode as n } from "./directoryHelpers.esm.js";
3
- //#region src/directory/friendsDirectory.ts
3
+ // src/directory/friendsDirectory.ts
4
4
  var r = 6;
5
5
  function i(i) {
6
6
  function a(e) {
@@ -52,7 +52,6 @@ function i(i) {
52
52
  }
53
53
  return { discoverFoafPeople: s };
54
54
  }
55
- //#endregion
56
55
  export { i as createFriendsDirectoryDiscovery };
57
56
 
58
57
  //# sourceMappingURL=friendsDirectory.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inboxLogic.cjs.js","names":["getArchiveUrl","require_utils","createInboxLogic","createInboxFor","myWebId","profileLogic","ourInbox","nick","containerLogic","utilityLogic","getNewMessages","user","inbox","url","markAsRead","downloaded","store","archiveUrl","date","options"],"sources":["../../src/inbox/inboxLogic.ts"],"sourcesContent":["import { NamedNode } from 'rdflib'\nimport { InboxLogic } from '../types'\nimport { getArchiveUrl } from '../util/utils'\n\nexport function createInboxLogic(store, profileLogic, utilityLogic, containerLogic, aclLogic): InboxLogic {\n\n async function createInboxFor(peerWebId: string, nick: string) {\n const myWebId: NamedNode = await profileLogic.loadMe()\n const podRoot: NamedNode = await profileLogic.getPodRoot(myWebId)\n const ourInbox = `${podRoot.value}p2p-inboxes/${encodeURIComponent(nick)}/`\n await containerLogic.createContainer(ourInbox)\n // const aclDocUrl = await aclLogic.findAclDocUrl(ourInbox);\n await utilityLogic.setSinglePeerAccess({\n ownerWebId: myWebId.value,\n peerWebId,\n accessToModes: 'acl:Append',\n target: ourInbox\n })\n return ourInbox\n }\n\n async function getNewMessages(\n user?: NamedNode\n ): Promise<NamedNode[]> {\n if (!user) {\n user = await profileLogic.loadMe()\n }\n const inbox = await profileLogic.getMainInbox(user)\n const urls = await containerLogic.getContainerMembers(inbox)\n return urls.filter(url => !containerLogic.isContainer(url))\n }\n\n async function markAsRead(url: string, date: Date) {\n const downloaded = await store.fetcher._fetch(url)\n if (downloaded.status !== 200) {\n throw new Error(`Not OK! ${url}`)\n }\n const archiveUrl = getArchiveUrl(url, date)\n const options = {\n method: 'PUT',\n body: await downloaded.text(),\n headers: [\n ['Content-Type', downloaded.headers.get('Content-Type') || 'application/octet-stream']\n ]\n }\n const uploaded = await store.fetcher._fetch(archiveUrl, options)\n if (uploaded.status.toString()[0] === '2') {\n await store.fetcher._fetch(url, {\n method: 'DELETE'\n })\n }\n }\n return {\n createInboxFor,\n getNewMessages,\n markAsRead\n }\n}\n"],"mappings":"wCAIA,SAAgBE,EAAiB,EAAO,EAAc,EAAc,EAAgB,EAAsB,CAEtG,eAAeC,EAAe,EAAmB,EAAc,CAC7D,IAAMC,EAAqB,MAAMC,EAAa,OAAO,EAE/CC,EAAW,IAAG,MADaD,EAAa,WAAWD,CAAO,EAAA,CACpC,MAAM,cAAc,mBAAmBG,CAAI,EAAE,GASzE,OARA,MAAMC,EAAe,gBAAgBF,CAAQ,EAE7C,MAAMG,EAAa,oBAAoB,CACrC,WAAYL,EAAQ,MACpB,YACA,cAAe,aACf,OAAQE,CACV,CAAC,EACMA,CACX,CAEA,eAAeI,EACX,EACsB,CACtB,AACEC,IAAO,MAAMN,EAAa,OAAO,EAEnC,IAAMO,EAAQ,MAAMP,EAAa,aAAaM,CAAI,EAElD,OAAO,MADYH,EAAe,oBAAoBI,CAAK,EAAA,CAC/C,OAAO,GAAO,CAACJ,EAAe,YAAYK,CAAG,CAAC,CAC9D,CAEA,eAAeC,EAAW,EAAa,EAAY,CACjD,IAAMC,EAAa,MAAMC,EAAM,QAAQ,OAAOH,CAAG,EACjD,GAAIE,EAAW,SAAW,IACxB,MAAU,MAAM,WAAWF,GAAK,EAElC,IAAMI,EAAajB,EAAAA,cAAca,EAAKK,CAAI,EACpCC,EAAU,CACd,OAAQ,MACR,KAAM,MAAMJ,EAAW,KAAK,EAC5B,QAAS,CACP,CAAC,eAAgBA,EAAW,QAAQ,IAAI,cAAc,GAAK,0BAA0B,CACvF,CACF,GAEI,MADmBC,EAAM,QAAQ,OAAOC,EAAYE,CAAO,EAAA,CAClD,OAAO,SAAS,CAAC,CAAC,KAAO,KACpC,MAAMH,EAAM,QAAQ,OAAOH,EAAK,CAC9B,OAAQ,QACV,CAAC,CAEL,CACA,MAAO,CACL,iBACA,iBACA,YACF,CACF"}
1
+ {"version":3,"file":"inboxLogic.cjs.js","names":["getArchiveUrl","require_utils","createInboxLogic","createInboxFor","myWebId","profileLogic","ourInbox","nick","containerLogic","utilityLogic","getNewMessages","user","inbox","url","markAsRead","downloaded","store","archiveUrl","date","options"],"sources":["../../src/inbox/inboxLogic.ts"],"sourcesContent":["import { NamedNode } from 'rdflib'\nimport { InboxLogic } from '../types'\nimport { getArchiveUrl } from '../util/utils'\n\nexport function createInboxLogic(store, profileLogic, utilityLogic, containerLogic, aclLogic): InboxLogic {\n\n async function createInboxFor(peerWebId: string, nick: string) {\n const myWebId: NamedNode = await profileLogic.loadMe()\n const podRoot: NamedNode = await profileLogic.getPodRoot(myWebId)\n const ourInbox = `${podRoot.value}p2p-inboxes/${encodeURIComponent(nick)}/`\n await containerLogic.createContainer(ourInbox)\n // const aclDocUrl = await aclLogic.findAclDocUrl(ourInbox);\n await utilityLogic.setSinglePeerAccess({\n ownerWebId: myWebId.value,\n peerWebId,\n accessToModes: 'acl:Append',\n target: ourInbox\n })\n return ourInbox\n }\n\n async function getNewMessages(\n user?: NamedNode\n ): Promise<NamedNode[]> {\n if (!user) {\n user = await profileLogic.loadMe()\n }\n const inbox = await profileLogic.getMainInbox(user)\n const urls = await containerLogic.getContainerMembers(inbox)\n return urls.filter(url => !containerLogic.isContainer(url))\n }\n\n async function markAsRead(url: string, date: Date) {\n const downloaded = await store.fetcher._fetch(url)\n if (downloaded.status !== 200) {\n throw new Error(`Not OK! ${url}`)\n }\n const archiveUrl = getArchiveUrl(url, date)\n const options = {\n method: 'PUT',\n body: await downloaded.text(),\n headers: [\n ['Content-Type', downloaded.headers.get('Content-Type') || 'application/octet-stream']\n ]\n }\n const uploaded = await store.fetcher._fetch(archiveUrl, options)\n if (uploaded.status.toString()[0] === '2') {\n await store.fetcher._fetch(url, {\n method: 'DELETE'\n })\n }\n }\n return {\n createInboxFor,\n getNewMessages,\n markAsRead\n }\n}\n"],"mappings":"A,wCAIA,SAAgBE,EAAiB,EAAO,EAAc,EAAc,EAAgB,EAAsB,CAEtG,eAAeC,EAAe,EAAmB,EAAc,CAC7D,IAAMC,EAAqB,MAAMC,EAAa,OAAO,EAE/CC,EAAW,IAAG,MADaD,EAAa,WAAWD,CAAO,EAAA,CACpC,MAAM,cAAc,mBAAmBG,CAAI,EAAE,GASzE,OARA,MAAMC,EAAe,gBAAgBF,CAAQ,EAE7C,MAAMG,EAAa,oBAAoB,CACrC,WAAYL,EAAQ,MACpB,YACA,cAAe,aACf,OAAQE,CACV,CAAC,EACMA,CACX,CAEA,eAAeI,EACX,EACsB,CACtB,AACEC,IAAO,MAAMN,EAAa,OAAO,EAEnC,IAAMO,EAAQ,MAAMP,EAAa,aAAaM,CAAI,EAElD,OAAO,MADYH,EAAe,oBAAoBI,CAAK,EAAA,CAC/C,OAAO,GAAO,CAACJ,EAAe,YAAYK,CAAG,CAAC,CAC9D,CAEA,eAAeC,EAAW,EAAa,EAAY,CACjD,IAAMC,EAAa,MAAMC,EAAM,QAAQ,OAAOH,CAAG,EACjD,GAAIE,EAAW,SAAW,IACxB,MAAU,MAAM,WAAWF,GAAK,EAElC,IAAMI,EAAajB,EAAAA,cAAca,EAAKK,CAAI,EACpCC,EAAU,CACd,OAAQ,MACR,KAAM,MAAMJ,EAAW,KAAK,EAC5B,QAAS,CACP,CAAC,eAAgBA,EAAW,QAAQ,IAAI,cAAc,GAAK,0BAA0B,CACvF,CACF,GAEI,MADmBC,EAAM,QAAQ,OAAOC,EAAYE,CAAO,EAAA,CAClD,OAAO,SAAS,CAAC,CAAC,KAAO,KACpC,MAAMH,EAAM,QAAQ,OAAOH,EAAK,CAC9B,OAAQ,QACV,CAAC,CAEL,CACA,MAAO,CACL,iBACA,iBACA,YACF,CACF,C"}
@@ -1,5 +1,5 @@
1
1
  import { getArchiveUrl as e } from "../util/utils.esm.js";
2
- //#region src/inbox/inboxLogic.ts
2
+ // src/inbox/inboxLogic.ts
3
3
  function t(t, n, r, i, a) {
4
4
  async function o(e, t) {
5
5
  let a = await n.loadMe(), o = `${(await n.getPodRoot(a)).value}p2p-inboxes/${encodeURIComponent(t)}/`;
@@ -31,7 +31,6 @@ function t(t, n, r, i, a) {
31
31
  markAsRead: c
32
32
  };
33
33
  }
34
- //#endregion
35
34
  export { t as createInboxLogic };
36
35
 
37
36
  //# sourceMappingURL=inboxLogic.esm.js.map
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("./directory/directoryLogic.cjs.js"),o=require("./logic/solidLogicSingleton.cjs.js"),s=require("./authn/serverLogout.cjs.js"),c=require("./issuer/issuerLogic.cjs.js");let l=require("@dokieli/web-access-control");var u=o.solidLogicSingleton.authn,d=o.solidLogicSingleton.authn.authSession,f=o.solidLogicSingleton.store;exports.ACCESS_ROLES=t.ACCESS_ROLES,exports.ACL_LINK=t.ACL_LINK,Object.defineProperty(exports,"Authenticated",{enumerable:!0,get:function(){return l.Authenticated}}),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.PUBLIC_ACCESS_ROLES=t.PUBLIC_ACCESS_ROLES,Object.defineProperty(exports,"Public",{enumerable:!0,get:function(){return l.Public}}),exports.SameOriginForbiddenError=r.SameOriginForbiddenError,exports.UnauthorizedError=r.UnauthorizedError,exports.WRITE_LOCKED_OWNER_ROLE=t.WRITE_LOCKED_OWNER_ROLE,exports.WebOperationError=r.WebOperationError,exports.analyzeContainerAccessScope=t.analyzeContainerAccessScope,exports.appContext=n.appContext,exports.authSession=d,exports.authn=u,exports.classifyAuthorizationScope=t.classifyAuthorizationScope,exports.classifyContainerAccessScope=t.classifyContainerAccessScope,exports.createDirectoryLogic=a.createDirectoryLogic,exports.createTypeIndexLogic=i.createTypeIndexLogic,exports.filterAuthorizationsByContainerScope=t.filterAuthorizationsByContainerScope,exports.getSuggestedIssuers=c.getSuggestedIssuers,exports.offlineTestID=n.offlineTestID,exports.performServerSideLogout=s.performServerSideLogout,exports.reloadOnIdentityReplaced=e.reloadOnIdentityReplaced,exports.solidLogicSingleton=o.solidLogicSingleton,exports.store=f;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./logic/solidLogicSingleton.cjs.js"),t=require("./acl/aclLogic.cjs.js"),n=require("./authn/authUtil.cjs.js"),r=require("./authn/serverLogout.cjs.js"),i=require("./authSession/identityState.cjs.js"),a=require("./issuer/issuerLogic.cjs.js"),o=require("./typeIndex/typeIndexLogic.cjs.js"),s=require("./directory/directoryLogic.cjs.js"),c=require("./types.cjs.js"),l=require("./logic/CustomError.cjs.js");let u=require("@dokieli/web-access-control");var d=e.solidLogicSingleton.authn,f=e.solidLogicSingleton.authn.authSession,p=e.solidLogicSingleton.store;exports.ACCESS_ROLES=t.ACCESS_ROLES,exports.ACL_LINK=t.ACL_LINK,Object.defineProperty(exports,"Authenticated",{enumerable:!0,get:function(){return u.Authenticated}}),exports.CrossOriginForbiddenError=l.CrossOriginForbiddenError,exports.DEFAULT_DIRECTORY_CATALOG_URL=s.DEFAULT_DIRECTORY_CATALOG_URL,exports.DEFAULT_DIRECTORY_SOURCES=s.DEFAULT_DIRECTORY_SOURCES,exports.FetchError=l.FetchError,exports.NotEditableError=l.NotEditableError,exports.NotFoundError=l.NotFoundError,exports.PUBLIC_ACCESS_ROLES=t.PUBLIC_ACCESS_ROLES,Object.defineProperty(exports,"Public",{enumerable:!0,get:function(){return u.Public}}),exports.ResourceUploadError=c.ResourceUploadError,exports.SameOriginForbiddenError=l.SameOriginForbiddenError,exports.UnauthorizedError=l.UnauthorizedError,exports.WRITE_LOCKED_OWNER_ROLE=t.WRITE_LOCKED_OWNER_ROLE,exports.WebOperationError=l.WebOperationError,exports.analyzeContainerAccessScope=t.analyzeContainerAccessScope,exports.appContext=n.appContext,exports.authSession=f,exports.authn=d,exports.classifyAuthorizationScope=t.classifyAuthorizationScope,exports.classifyContainerAccessScope=t.classifyContainerAccessScope,exports.createDirectoryLogic=s.createDirectoryLogic,exports.createTypeIndexLogic=o.createTypeIndexLogic,exports.filterAuthorizationsByContainerScope=t.filterAuthorizationsByContainerScope,exports.getSuggestedIssuers=a.getSuggestedIssuers,exports.offlineTestID=n.offlineTestID,exports.performServerSideLogout=r.performServerSideLogout,exports.reloadOnIdentityReplaced=i.reloadOnIdentityReplaced,exports.solidLogicSingleton=e.solidLogicSingleton,exports.store=p;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","names":["solidLogicSingleton","require_identityState","require_aclLogic","require_authUtil","require_CustomError","require_typeIndexLogic","require_directoryLogic","require_solidLogicSingleton","require_serverLogout","require_issuerLogic","_dokieli_web_access_control","authn","authSession","store"],"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, PUBLIC_ACCESS_ROLES, WRITE_LOCKED_OWNER_ROLE, Authenticated, Public, classifyContainerAccessScope, analyzeContainerAccessScope, classifyAuthorizationScope, filterAuthorizationsByContainerScope } from './acl/aclLogic'\nexport type { AccessRole, ContainerAccessScope, ContainerAccessScopeResult, PublicAccessRole } 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, ResourceLogic, ResourceContent, ResourceMetadata, 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":"sfAIA,IAAMW,EAAQX,EAAAA,oBAAoB,MAC5BY,EAAcZ,EAAAA,oBAAoB,MAAM,YACxCa,EAAQb,EAAAA,oBAAoB"}
1
+ {"version":3,"file":"index.cjs.js","names":["solidLogicSingleton","require_solidLogicSingleton","require_aclLogic","require_authUtil","require_serverLogout","require_identityState","require_issuerLogic","require_typeIndexLogic","require_directoryLogic","require_types","require_CustomError","_dokieli_web_access_control","authn","authSession","store"],"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, PUBLIC_ACCESS_ROLES, WRITE_LOCKED_OWNER_ROLE, Authenticated, Public, classifyContainerAccessScope, analyzeContainerAccessScope, classifyAuthorizationScope, filterAuthorizationsByContainerScope } from './acl/aclLogic'\nexport type { AccessRole, ContainerAccessScope, ContainerAccessScopeResult, PublicAccessRole } 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 { ResourceUploadError } from './types'\nexport type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ResourceLogic, ResourceContent, ResourceMetadata, ResourceUploadResult, 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":"A,khBAIA,IAAMY,EAAQZ,EAAAA,oBAAoB,MAC5Ba,EAAcb,EAAAA,oBAAoB,MAAM,YACxCc,EAAQd,EAAAA,oBAAoB,M"}
package/dist/index.d.ts CHANGED
@@ -12,7 +12,8 @@ export { createTypeIndexLogic } from './typeIndex/typeIndexLogic';
12
12
  export { createDirectoryLogic, DEFAULT_DIRECTORY_CATALOG_URL, DEFAULT_DIRECTORY_SOURCES } from './directory/directoryLogic';
13
13
  export type { AccessControlSubjectKind, AccessControlSubject } from './acl/accessControlSubjects';
14
14
  export type { ACLContext, AccessMode, AccessSubject, Authorization, PatchPlan } from './types';
15
- export type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ResourceLogic, ResourceContent, ResourceMetadata, ChatLogic, DirectoryLogic, DirectoryEntry, DirectorySearchOptions, DirectoryRelationshipLabel, DirectorySource } from './types';
15
+ export { ResourceUploadError } from './types';
16
+ export type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ResourceLogic, ResourceContent, ResourceMetadata, ResourceUploadResult, ChatLogic, DirectoryLogic, DirectoryEntry, DirectorySearchOptions, DirectoryRelationshipLabel, DirectorySource } from './types';
16
17
  export { UnauthorizedError, CrossOriginForbiddenError, SameOriginForbiddenError, NotFoundError, FetchError, NotEditableError, WebOperationError } from './logic/CustomError';
17
18
  export { solidLogicSingleton, // solidLogicSingleton is exported entirely because it is used in solid-panes
18
19
  store, authn, authSession };
@@ -1 +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,mBAAmB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,oCAAoC,EAAE,MAAM,gBAAgB,CAAA;AACzP,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACpH,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,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9P,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"}
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,mBAAmB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,oCAAoC,EAAE,MAAM,gBAAgB,CAAA;AACzP,YAAY,EAAE,UAAU,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACpH,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,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAC7C,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACpR,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,15 +1,15 @@
1
- import { reloadOnIdentityReplaced as e } from "./authSession/identityState.esm.js";
1
+ import { solidLogicSingleton as e } from "./logic/solidLogicSingleton.esm.js";
2
2
  import { ACCESS_ROLES as t, ACL_LINK as n, Authenticated as r, PUBLIC_ACCESS_ROLES as i, Public as a, WRITE_LOCKED_OWNER_ROLE as o, analyzeContainerAccessScope as s, classifyAuthorizationScope as c, classifyContainerAccessScope as l, filterAuthorizationsByContainerScope as u } from "./acl/aclLogic.esm.js";
3
3
  import { appContext as d, offlineTestID as f } from "./authn/authUtil.esm.js";
4
- import { CrossOriginForbiddenError as p, FetchError as m, NotEditableError as h, NotFoundError as g, SameOriginForbiddenError as _, UnauthorizedError as v, WebOperationError as y } from "./logic/CustomError.esm.js";
5
- import { createTypeIndexLogic as b } from "./typeIndex/typeIndexLogic.esm.js";
6
- import { DEFAULT_DIRECTORY_CATALOG_URL as x, DEFAULT_DIRECTORY_SOURCES as S, createDirectoryLogic as C } from "./directory/directoryLogic.esm.js";
7
- import { solidLogicSingleton as w } from "./logic/solidLogicSingleton.esm.js";
8
- import { performServerSideLogout as T } from "./authn/serverLogout.esm.js";
9
- import { getSuggestedIssuers as E } from "./issuer/issuerLogic.esm.js";
10
- //#region src/index.ts
11
- var D = w.authn, O = w.authn.authSession, k = w.store;
12
- //#endregion
13
- export { t as ACCESS_ROLES, n as ACL_LINK, r as Authenticated, p as CrossOriginForbiddenError, x as DEFAULT_DIRECTORY_CATALOG_URL, S as DEFAULT_DIRECTORY_SOURCES, m as FetchError, h as NotEditableError, g as NotFoundError, i as PUBLIC_ACCESS_ROLES, a as Public, _ as SameOriginForbiddenError, v as UnauthorizedError, o as WRITE_LOCKED_OWNER_ROLE, y as WebOperationError, s as analyzeContainerAccessScope, d as appContext, O as authSession, D as authn, c as classifyAuthorizationScope, l as classifyContainerAccessScope, C as createDirectoryLogic, b as createTypeIndexLogic, u as filterAuthorizationsByContainerScope, E as getSuggestedIssuers, f as offlineTestID, T as performServerSideLogout, e as reloadOnIdentityReplaced, w as solidLogicSingleton, k as store };
4
+ import { performServerSideLogout as p } from "./authn/serverLogout.esm.js";
5
+ import { reloadOnIdentityReplaced as m } from "./authSession/identityState.esm.js";
6
+ import { getSuggestedIssuers as h } from "./issuer/issuerLogic.esm.js";
7
+ import { createTypeIndexLogic as g } from "./typeIndex/typeIndexLogic.esm.js";
8
+ import { DEFAULT_DIRECTORY_CATALOG_URL as _, DEFAULT_DIRECTORY_SOURCES as v, createDirectoryLogic as y } from "./directory/directoryLogic.esm.js";
9
+ import { ResourceUploadError as b } from "./types.esm.js";
10
+ import { CrossOriginForbiddenError as x, FetchError as S, NotEditableError as C, NotFoundError as w, SameOriginForbiddenError as T, UnauthorizedError as E, WebOperationError as D } from "./logic/CustomError.esm.js";
11
+ // src/index.ts
12
+ var O = e.authn, k = e.authn.authSession, A = e.store;
13
+ export { t as ACCESS_ROLES, n as ACL_LINK, r as Authenticated, x as CrossOriginForbiddenError, _ as DEFAULT_DIRECTORY_CATALOG_URL, v as DEFAULT_DIRECTORY_SOURCES, S as FetchError, C as NotEditableError, w as NotFoundError, i as PUBLIC_ACCESS_ROLES, a as Public, b as ResourceUploadError, T as SameOriginForbiddenError, E as UnauthorizedError, o as WRITE_LOCKED_OWNER_ROLE, D as WebOperationError, s as analyzeContainerAccessScope, d as appContext, k as authSession, O as authn, c as classifyAuthorizationScope, l as classifyContainerAccessScope, y as createDirectoryLogic, g as createTypeIndexLogic, u as filterAuthorizationsByContainerScope, h as getSuggestedIssuers, f as offlineTestID, p as performServerSideLogout, m as reloadOnIdentityReplaced, e as solidLogicSingleton, A as store };
14
14
 
15
15
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","names":["authn","solidLogicSingleton","authSession","store","ACCESS_ROLES","ACL_LINK","Authenticated","CrossOriginForbiddenError","DEFAULT_DIRECTORY_CATALOG_URL","DEFAULT_DIRECTORY_SOURCES","FetchError","NotEditableError","NotFoundError","PUBLIC_ACCESS_ROLES","Public","SameOriginForbiddenError","UnauthorizedError","WRITE_LOCKED_OWNER_ROLE","WebOperationError","analyzeContainerAccessScope","appContext","classifyAuthorizationScope","classifyContainerAccessScope","createDirectoryLogic","createTypeIndexLogic","filterAuthorizationsByContainerScope","getSuggestedIssuers","offlineTestID","performServerSideLogout","reloadOnIdentityReplaced"],"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, PUBLIC_ACCESS_ROLES, WRITE_LOCKED_OWNER_ROLE, Authenticated, Public, classifyContainerAccessScope, analyzeContainerAccessScope, classifyAuthorizationScope, filterAuthorizationsByContainerScope } from './acl/aclLogic'\nexport type { AccessRole, ContainerAccessScope, ContainerAccessScopeResult, PublicAccessRole } 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, ResourceLogic, ResourceContent, ResourceMetadata, 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,IAAMA,IAAQC,EAAoB,OAC5BC,IAAcD,EAAoB,MAAM,aACxCE,IAAQF,EAAoB"}
1
+ {"version":3,"file":"index.esm.js","names":["authn","solidLogicSingleton","authSession","store","ACCESS_ROLES","ACL_LINK","Authenticated","CrossOriginForbiddenError","DEFAULT_DIRECTORY_CATALOG_URL","DEFAULT_DIRECTORY_SOURCES","FetchError","NotEditableError","NotFoundError","PUBLIC_ACCESS_ROLES","Public","ResourceUploadError","SameOriginForbiddenError","UnauthorizedError","WRITE_LOCKED_OWNER_ROLE","WebOperationError","analyzeContainerAccessScope","appContext","classifyAuthorizationScope","classifyContainerAccessScope","createDirectoryLogic","createTypeIndexLogic","filterAuthorizationsByContainerScope","getSuggestedIssuers","offlineTestID","performServerSideLogout","reloadOnIdentityReplaced"],"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, PUBLIC_ACCESS_ROLES, WRITE_LOCKED_OWNER_ROLE, Authenticated, Public, classifyContainerAccessScope, analyzeContainerAccessScope, classifyAuthorizationScope, filterAuthorizationsByContainerScope } from './acl/aclLogic'\nexport type { AccessRole, ContainerAccessScope, ContainerAccessScopeResult, PublicAccessRole } 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 { ResourceUploadError } from './types'\nexport type { AppDetails, SolidNamespace, AuthenticationContext, SolidLogic, ResourceLogic, ResourceContent, ResourceMetadata, ResourceUploadResult, 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,IAAMA,IAAQC,EAAoB,OAC5BC,IAAcD,EAAoB,MAAM,aACxCE,IAAQF,EAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"issuerLogic.cjs.js","names":["DEFAULT_ISSUERS","getSuggestedIssuers","issuers","uri","host","origin"],"sources":["../../src/issuer/issuerLogic.ts"],"sourcesContent":["const DEFAULT_ISSUERS = [\n {\n name: 'Solid Community',\n uri: 'https://solidcommunity.net'\n },\n {\n name: 'Solid Web',\n uri: 'https://solidweb.org'\n },\n {\n name: 'Solid Web ME',\n uri: 'https://solidweb.me'\n },\n {\n name: 'Inrupt.com',\n uri: 'https://login.inrupt.com'\n }\n]\n\n/**\n * @returns - A list of suggested OIDC issuers\n */\nexport function getSuggestedIssuers (): { name: string, uri: string }[] {\n // Suggest a default list of OIDC issuers\n const issuers = [...DEFAULT_ISSUERS]\n \n // Suggest the current host if not already included\n const { host, origin } = new URL(location.href)\n const hosts = issuers.map(({ uri }) => new URL(uri).host)\n if (!hosts.includes(host)) {\n issuers.unshift({ name: host, uri: origin })\n }\n \n return issuers\n }"],"mappings":"AAAA,IAAMA,EAAkB,CACtB,CACE,KAAM,kBACN,IAAK,4BACP,EACA,CACE,KAAM,YACN,IAAK,sBACP,EACA,CACE,KAAM,eACN,IAAK,qBACP,EACA,CACE,KAAM,aACN,IAAK,0BACP,CACF,EAKA,SAAgBC,GAAwD,CAEpE,IAAMC,EAAU,CAAC,GAAGF,CAAe,EAG7B,CAAE,OAAM,UAAW,IAAI,IAAI,SAAS,IAAI,EAM9C,OALcE,EAAQ,KAAK,CAAE,SAAU,IAAI,IAAIC,CAAG,CAAC,CAAC,IAC/C,CAAA,CAAM,SAASC,CAAI,GACtBF,EAAQ,QAAQ,CAAE,KAAME,EAAM,IAAKC,CAAO,CAAC,EAGtCH,CACT"}
1
+ {"version":3,"file":"issuerLogic.cjs.js","names":["DEFAULT_ISSUERS","getSuggestedIssuers","issuers","uri","host","origin"],"sources":["../../src/issuer/issuerLogic.ts"],"sourcesContent":["const DEFAULT_ISSUERS = [\n {\n name: 'Solid Community',\n uri: 'https://solidcommunity.net'\n },\n {\n name: 'Solid Web',\n uri: 'https://solidweb.org'\n },\n {\n name: 'Solid Web ME',\n uri: 'https://solidweb.me'\n },\n {\n name: 'Inrupt.com',\n uri: 'https://login.inrupt.com'\n }\n]\n\n/**\n * @returns - A list of suggested OIDC issuers\n */\nexport function getSuggestedIssuers (): { name: string, uri: string }[] {\n // Suggest a default list of OIDC issuers\n const issuers = [...DEFAULT_ISSUERS]\n \n // Suggest the current host if not already included\n const { host, origin } = new URL(location.href)\n const hosts = issuers.map(({ uri }) => new URL(uri).host)\n if (!hosts.includes(host)) {\n issuers.unshift({ name: host, uri: origin })\n }\n \n return issuers\n }"],"mappings":"AAAA,IAAMA,EAAkB,CACtB,CACE,KAAM,kBACN,IAAK,4BACP,EACA,CACE,KAAM,YACN,IAAK,sBACP,EACA,CACE,KAAM,eACN,IAAK,qBACP,EACA,CACE,KAAM,aACN,IAAK,0BACP,CACF,EAKA,SAAgBC,GAAwD,CAEpE,IAAMC,EAAU,CAAC,GAAGF,CAAe,EAG7B,CAAE,OAAM,UAAW,IAAI,IAAI,SAAS,IAAI,EAM9C,OALcE,EAAQ,KAAK,CAAE,SAAU,IAAI,IAAIC,CAAG,CAAC,CAAC,IAC/C,CAAA,CAAM,SAASC,CAAI,GACtBF,EAAQ,QAAQ,CAAE,KAAME,EAAM,IAAKC,CAAO,CAAC,EAGtCH,CACT,C"}
@@ -1,4 +1,4 @@
1
- //#region src/issuer/issuerLogic.ts
1
+ // src/issuer/issuerLogic.ts
2
2
  var e = [
3
3
  {
4
4
  name: "Solid Community",
@@ -24,7 +24,6 @@ function t() {
24
24
  uri: r
25
25
  }), t;
26
26
  }
27
- //#endregion
28
27
  export { t as getSuggestedIssuers };
29
28
 
30
29
  //# sourceMappingURL=issuerLogic.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomError.cjs.js","names":["CustomError","message","UnauthorizedError","CrossOriginForbiddenError","SameOriginForbiddenError","NotFoundError","NotEditableError","WebOperationError","FetchError","status"],"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,IAAMA,EAAN,cAA0B,KAAM,CAC5B,YAAY,EAAkB,CAC1B,MAAMC,CAAO,EAEb,OAAO,eAAe,KAAM,WAAW,SAAS,EAChD,KAAK,KAAO,WAAW,IAC3B,CACJ,EAEaC,EAAb,cAAuCF,CAAY,CAAC,EAEvCG,EAAb,cAA+CH,CAAY,CAAC,EAE/CI,EAAb,cAA8CJ,CAAY,CAAC,EAE9CK,EAAb,cAAmCL,CAAY,CAAC,EAEnCM,EAAb,cAAsCN,CAAY,CAAE,EAEvCO,EAAb,cAAuCP,CAAY,CAAC,EAEvCQ,EAAb,cAAgCR,CAAY,CAGxC,YAAY,EAAgB,EAAkB,CAC1C,MAAMC,CAAO,EACb,KAAK,OAASQ,CAClB,CACJ"}
1
+ {"version":3,"file":"CustomError.cjs.js","names":["CustomError","message","UnauthorizedError","CrossOriginForbiddenError","SameOriginForbiddenError","NotFoundError","NotEditableError","WebOperationError","FetchError","status"],"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,IAAMA,EAAN,cAA0B,KAAM,CAC5B,YAAY,EAAkB,CAC1B,MAAMC,CAAO,EAEb,OAAO,eAAe,KAAM,WAAW,SAAS,EAChD,KAAK,KAAO,WAAW,IAC3B,CACJ,EAEaC,EAAb,cAAuCF,CAAY,CAAC,EAEvCG,EAAb,cAA+CH,CAAY,CAAC,EAE/CI,EAAb,cAA8CJ,CAAY,CAAC,EAE9CK,EAAb,cAAmCL,CAAY,CAAC,EAEnCM,EAAb,cAAsCN,CAAY,CAAE,EAEvCO,EAAb,cAAuCP,CAAY,CAAC,EAEvCQ,EAAb,cAAgCR,CAAY,CAGxC,YAAY,EAAgB,EAAkB,CAC1C,MAAMC,CAAO,EACb,KAAK,OAASQ,CAClB,CACJ,E"}
@@ -1,4 +1,4 @@
1
- //#region src/logic/CustomError.ts
1
+ // src/logic/CustomError.ts
2
2
  var e = class extends Error {
3
3
  constructor(e) {
4
4
  super(e), Object.setPrototypeOf(this, new.target.prototype), this.name = new.target.name;
@@ -8,7 +8,6 @@ var e = class extends Error {
8
8
  super(t), this.status = e;
9
9
  }
10
10
  };
11
- //#endregion
12
11
  export { n as CrossOriginForbiddenError, s as FetchError, a as NotEditableError, i as NotFoundError, r as SameOriginForbiddenError, t as UnauthorizedError, o as WebOperationError };
13
12
 
14
13
  //# sourceMappingURL=CustomError.esm.js.map
@@ -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("../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;
1
+ const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("../acl/aclLogic.cjs.js"),n=require("../authn/SolidAuthnLogic.cjs.js"),r=require("../authSession/flagAuthorizationOnTransitions.cjs.js"),i=require("../chat/chatLogic.cjs.js"),a=require("../inbox/inboxLogic.cjs.js"),o=require("../resource/resourceLogic.cjs.js"),s=require("../profile/profileLogic.cjs.js"),c=require("../typeIndex/typeIndexLogic.cjs.js"),l=require("../directory/directoryLogic.cjs.js"),u=require("../util/containerLogic.cjs.js"),d=require("../util/utilityLogic.cjs.js"),f=require("../util/debug.cjs.js");let p=require("rdflib");p=e.__toESM(p);function m(e,m){f.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=r.flagAuthorizationOnSessionTransitions(h,m),_=new n.SolidAuthnLogic(m),v=_.dispose?.bind(_);_.dispose=()=>{g(),v?.()};let y=t.createAclLogic(h),b=u.createContainerLogic(h),x=d.createUtilityLogic(h,y,b),S=s.createProfileLogic(h,_,x),C=i.createChatLogic(h,S),w=a.createInboxLogic(h,S,x,b,y),T=c.createTypeIndexLogic(h,_,S,x),E=l.createDirectoryLogic(h,_,T),D=o.createResourceLogic(h,y,b,T);f.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":["rdf","flagAuthorizationOnSessionTransitions","SolidAuthnLogic","createAclLogic","createContainerLogic","createUtilityLogic","createProfileLogic","createChatLogic","createInboxLogic","createTypeIndexLogic","createDirectoryLogic","createResourceLogic","require_runtime","require_debug","require_aclLogic","require_SolidAuthnLogic","require_flagAuthorizationOnTransitions","require_chatLogic","require_inboxLogic","require_resourceLogic","require_containerLogic","require_profileLogic","require_typeIndexLogic","require_directoryLogic","require_utilityLogic","rdflib","createSolidLogic","store","specialFetch","unsubscribeAuthorization","session","authn","disposeAuthn","acl","containerLogic","utilityLogic","profile","chat","inbox","typeIndex","directory","resource","load","doc","updatePromise","del","ins","ok","resolve","reject","errorBody","clearStore"],"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,SAAgB0B,EAAiB,EAA8D,EAA8C,CAEzIb,EAAA,IAAU,0EAA0E,EACpF,IAAMc,EAAmB3B,EAAI,MAAM,EACnCyB,EAAI,QAAQE,EAAO,CAAC,MAAOC,EAAa,KAAK,CAAC,EAC9C,EAAM,QAAU,IAAI5B,EAAI,cAAc2B,CAAK,EAC3C,EAAM,SAAW,CAAC,EAKlB,IAAME,EAA2B5B,EAAAA,sCAAsC0B,EAAOG,CAAO,EAE/EC,EAAoB,IAAI7B,EAAAA,gBAAgB4B,CAAO,EAK/CE,EAAeD,EAAM,SAAS,KAAKA,CAAK,EAC9C,EAAM,YAAsB,CAC1BF,EAAyB,EACzBG,IAAe,CACjB,EAEA,IAAMC,EAAM9B,EAAAA,eAAewB,CAAK,EAC1BO,EAAiB9B,EAAAA,qBAAqBuB,CAAK,EAC3CQ,EAAe9B,EAAAA,mBAAmBsB,EAAOM,EAAKC,CAAc,EAC5DE,EAAU9B,EAAAA,mBAAmBqB,EAAOI,EAAOI,CAAY,EACvDE,EAAO9B,EAAAA,gBAAgBoB,EAAOS,CAAO,EACrCE,EAAQ9B,EAAAA,iBAAiBmB,EAAOS,EAASD,EAAcD,EAAgBD,CAAG,EAC1EM,EAAY9B,EAAAA,qBAAqBkB,EAAOI,EAAOK,EAASD,CAAY,EACpEK,EAAY9B,EAAAA,qBAAqBiB,EAAOI,EAAOQ,CAAS,EACxDE,EAAW9B,EAAAA,oBAAoBgB,EAAOM,EAAKC,EAAgBK,CAAS,EAC1E1B,EAAA,IAAU,6BAA6B,EAEvC,SAAS6B,EAAK,EAAuC,CACjD,OAAOf,EAAM,QAAQ,KAAKgB,CAAG,CACjC,CAGA,SAASC,EACL,EACA,EAAwB,CAAC,EACZ,CACb,OAAO,IAAI,SAAS,EAAS,IAAW,CACxCjB,EAAM,QAAQ,OAAOkB,EAAKC,EAAK,SAAU,EAAM,EAAI,EAAW,CACrDC,EAGLC,EAAQ,EAFRC,EAAW,MAAMC,CAAS,CAAC,CAI/B,CAAC,CACD,CAAC,CACL,CAEA,SAASC,GAAa,CAClBxB,EAAM,WAAW,MAAM,CAAC,CAAC,QAAQA,EAAM,OAAO,KAAKA,CAAK,CAAC,CAC7D,CAEA,MAAO,CACH,QACA,QACA,MACA,WACA,QACA,OACA,UACA,YACA,YACA,OACA,gBACA,YACJ,CACJ"}
1
+ {"version":3,"file":"solidLogic.cjs.js","names":["rdf","flagAuthorizationOnSessionTransitions","SolidAuthnLogic","createAclLogic","createContainerLogic","createUtilityLogic","createProfileLogic","createChatLogic","createInboxLogic","createTypeIndexLogic","createDirectoryLogic","createResourceLogic","require_runtime","require_aclLogic","require_SolidAuthnLogic","require_flagAuthorizationOnTransitions","require_chatLogic","require_inboxLogic","require_resourceLogic","require_profileLogic","require_typeIndexLogic","require_directoryLogic","require_containerLogic","require_utilityLogic","require_debug","rdflib","createSolidLogic","store","specialFetch","unsubscribeAuthorization","session","authn","disposeAuthn","acl","containerLogic","utilityLogic","profile","chat","inbox","typeIndex","directory","resource","load","doc","updatePromise","del","ins","ok","resolve","reject","errorBody","clearStore"],"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":"A,gnBAsBA,SAAgB0B,EAAiB,EAA8D,EAA8C,CAEzIF,EAAA,IAAU,0EAA0E,EACpF,IAAMG,EAAmB3B,EAAI,MAAM,EACnCyB,EAAI,QAAQE,EAAO,CAAC,MAAOC,EAAa,KAAK,CAAC,EAC9C,EAAM,QAAU,IAAI5B,EAAI,cAAc2B,CAAK,EAC3C,EAAM,SAAW,CAAC,EAKlB,IAAME,EAA2B5B,EAAAA,sCAAsC0B,EAAOG,CAAO,EAE/EC,EAAoB,IAAI7B,EAAAA,gBAAgB4B,CAAO,EAK/CE,EAAeD,EAAM,SAAS,KAAKA,CAAK,EAC9C,EAAM,YAAsB,CAC1BF,EAAyB,EACzBG,IAAe,CACjB,EAEA,IAAMC,EAAM9B,EAAAA,eAAewB,CAAK,EAC1BO,EAAiB9B,EAAAA,qBAAqBuB,CAAK,EAC3CQ,EAAe9B,EAAAA,mBAAmBsB,EAAOM,EAAKC,CAAc,EAC5DE,EAAU9B,EAAAA,mBAAmBqB,EAAOI,EAAOI,CAAY,EACvDE,EAAO9B,EAAAA,gBAAgBoB,EAAOS,CAAO,EACrCE,EAAQ9B,EAAAA,iBAAiBmB,EAAOS,EAASD,EAAcD,EAAgBD,CAAG,EAC1EM,EAAY9B,EAAAA,qBAAqBkB,EAAOI,EAAOK,EAASD,CAAY,EACpEK,EAAY9B,EAAAA,qBAAqBiB,EAAOI,EAAOQ,CAAS,EACxDE,EAAW9B,EAAAA,oBAAoBgB,EAAOM,EAAKC,EAAgBK,CAAS,EAC1Ef,EAAA,IAAU,6BAA6B,EAEvC,SAASkB,EAAK,EAAuC,CACjD,OAAOf,EAAM,QAAQ,KAAKgB,CAAG,CACjC,CAGA,SAASC,EACL,EACA,EAAwB,CAAC,EACZ,CACb,OAAO,IAAI,SAAS,EAAS,IAAW,CACxCjB,EAAM,QAAQ,OAAOkB,EAAKC,EAAK,SAAU,EAAM,EAAI,EAAW,CACrDC,EAGLC,EAAQ,EAFRC,EAAW,MAAMC,CAAS,CAAC,CAI/B,CAAC,CACD,CAAC,CACL,CAEA,SAASC,GAAa,CAClBxB,EAAM,WAAW,MAAM,CAAC,CAAC,QAAQA,EAAM,OAAO,KAAKA,CAAK,CAAC,CAC7D,CAEA,MAAO,CACH,QACA,QACA,MACA,WACA,QACA,OACA,UACA,YACA,YACA,OACA,gBACA,YACJ,CACJ,C"}
@@ -1,27 +1,27 @@
1
- import { log as e } from "../util/debug.esm.js";
2
- import { createAclLogic as t } from "../acl/aclLogic.esm.js";
3
- import { SolidAuthnLogic as n } from "../authn/SolidAuthnLogic.esm.js";
4
- import { flagAuthorizationOnSessionTransitions as r } from "../authSession/flagAuthorizationOnTransitions.esm.js";
5
- import { createChatLogic as i } from "../chat/chatLogic.esm.js";
6
- import { createInboxLogic as a } from "../inbox/inboxLogic.esm.js";
7
- import { createResourceLogic as o } from "../resource/resourceLogic.esm.js";
8
- import { createContainerLogic as s } from "../util/containerLogic.esm.js";
9
- import { createProfileLogic as c } from "../profile/profileLogic.esm.js";
10
- import { createTypeIndexLogic as l } from "../typeIndex/typeIndexLogic.esm.js";
11
- import { createDirectoryLogic as u } from "../directory/directoryLogic.esm.js";
12
- import { createUtilityLogic as d } from "../util/utilityLogic.esm.js";
1
+ import { createAclLogic as e } from "../acl/aclLogic.esm.js";
2
+ import { SolidAuthnLogic as t } from "../authn/SolidAuthnLogic.esm.js";
3
+ import { flagAuthorizationOnSessionTransitions as n } from "../authSession/flagAuthorizationOnTransitions.esm.js";
4
+ import { createChatLogic as r } from "../chat/chatLogic.esm.js";
5
+ import { createInboxLogic as i } from "../inbox/inboxLogic.esm.js";
6
+ import { createResourceLogic as a } from "../resource/resourceLogic.esm.js";
7
+ import { createProfileLogic as o } from "../profile/profileLogic.esm.js";
8
+ import { createTypeIndexLogic as s } from "../typeIndex/typeIndexLogic.esm.js";
9
+ import { createDirectoryLogic as c } from "../directory/directoryLogic.esm.js";
10
+ import { createContainerLogic as l } from "../util/containerLogic.esm.js";
11
+ import { createUtilityLogic as u } from "../util/utilityLogic.esm.js";
12
+ import { log as d } from "../util/debug.esm.js";
13
13
  import * as f from "rdflib";
14
- //#region src/logic/solidLogic.ts
14
+ // src/logic/solidLogic.ts
15
15
  function p(p, m) {
16
- e("SolidLogic: Unique instance created. There should only be one of these.");
16
+ d("SolidLogic: Unique instance created. There should only be one of these.");
17
17
  let h = f.graph();
18
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(_);
19
+ let g = n(h, m), _ = new t(m), v = _.dispose?.bind(_);
20
20
  _.dispose = () => {
21
21
  g(), v?.();
22
22
  };
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);
24
- e("SolidAuthnLogic initialized");
23
+ let y = e(h), b = l(h), x = u(h, y, b), S = o(h, _, x), C = r(h, S), w = i(h, S, x, b, y), T = s(h, _, S, x), E = c(h, _, T), D = a(h, y, b, T);
24
+ d("SolidAuthnLogic initialized");
25
25
  function O(e) {
26
26
  return h.fetcher.load(e);
27
27
  }
@@ -50,7 +50,6 @@ function p(p, m) {
50
50
  clearStore: A
51
51
  };
52
52
  }
53
- //#endregion
54
53
  export { p as createSolidLogic };
55
54
 
56
55
  //# sourceMappingURL=solidLogic.esm.js.map
@@ -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.authFetch==`function`?a.authFetch.bind(a):typeof a.fetch==`function`?a.fetch.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;
1
+ const e=require("../util/debug.cjs.js"),t=require("../authSession/authSession.cjs.js"),n=require("../authSession/identityState.cjs.js"),r=require("./solidLogic.cjs.js");var i=async(e,r)=>{let i=r&&r.credentials&&r.credentials==`omit`,a=t.authSession;if(!n.sessionExplicitlyInactive(a)&&(a?.info?.webId||a?.webId)&&!i){let t=typeof a.authFetch==`function`?a.authFetch.bind(a):typeof a.fetch==`function`?a.fetch.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},t.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":["authSession","sessionExplicitlyInactive","createSolidLogic","require_debug","require_identityState","require_authSession","require_solidLogic","_fetch","omitCreds","requestInit","sessionAny","authenticatedFetch","url","SINGLETON_SYMBOL","globalTarget","getOrCreateSingleton","solidLogicSingleton"],"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.authFetch === 'function')\n ? sessionAny.authFetch.bind(sessionAny)\n : (typeof sessionAny.fetch === 'function' ? sessionAny.fetch.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,IAAMO,EAAS,MAAO,EAAK,IAAgB,CACvC,IAAMC,EAAYC,GAAeA,EAAY,aAAeA,EAAY,aAAe,OACjFC,EAAaV,EAAAA,YAOnB,GAHqBC,GAAAA,0BAA0BS,CAAU,IAElDA,GAAY,MAAM,OAASA,GAAY,QAC1B,CAACF,EAAW,CAE5B,IAAMG,EAAsB,OAAOD,EAAW,WAAc,WACtDA,EAAW,UAAU,KAAKA,CAAU,EACnC,OAAOA,EAAW,OAAU,WAAaA,EAAW,MAAM,KAAKA,CAAU,EAAI,KAIpF,OAHIC,EACOA,EAAmBC,EAAKH,CAAW,EAEvC,OAAO,MAAMG,EAAKH,CAAW,CACxC,CACI,OAAO,OAAO,MAAMG,EAAKH,CAAW,CAE5C,EAGMI,EAAmB,OAAO,IAAI,uBAAuB,EAOrDC,EAAgB,OAAO,OAAW,IAAc,OAAS,OAE/D,SAASC,GAAmC,CAQxC,OAPKD,EAAaD,GAKdV,EAAA,IAAU,uDAAuD,GAJjEA,EAAA,IAAU,qDAAqD,EAC/D,EAAaU,GAAoBX,EAAAA,iBAAiB,CAAE,MAAOK,CAAO,EAAGP,EAAAA,WAAW,EAChFG,EAAA,IAAU,+BAA+B,GAItCW,EAAaD,EACxB,CAEA,IAAMG,EAAsBD,EAAqB"}
1
+ {"version":3,"file":"solidLogicSingleton.cjs.js","names":["authSession","sessionExplicitlyInactive","createSolidLogic","require_debug","require_authSession","require_identityState","require_solidLogic","_fetch","omitCreds","requestInit","sessionAny","authenticatedFetch","url","SINGLETON_SYMBOL","globalTarget","getOrCreateSingleton","solidLogicSingleton"],"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.authFetch === 'function')\n ? sessionAny.authFetch.bind(sessionAny)\n : (typeof sessionAny.fetch === 'function' ? sessionAny.fetch.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":"A,yKAMA,IAAMO,EAAS,MAAO,EAAK,IAAgB,CACvC,IAAMC,EAAYC,GAAeA,EAAY,aAAeA,EAAY,aAAe,OACjFC,EAAaV,EAAAA,YAOnB,GAHqBC,GAAAA,0BAA0BS,CAAU,IAElDA,GAAY,MAAM,OAASA,GAAY,QAC1B,CAACF,EAAW,CAE5B,IAAMG,EAAsB,OAAOD,EAAW,WAAc,WACtDA,EAAW,UAAU,KAAKA,CAAU,EACnC,OAAOA,EAAW,OAAU,WAAaA,EAAW,MAAM,KAAKA,CAAU,EAAI,KAIpF,OAHIC,EACOA,EAAmBC,EAAKH,CAAW,EAEvC,OAAO,MAAMG,EAAKH,CAAW,CACxC,CACI,OAAO,OAAO,MAAMG,EAAKH,CAAW,CAE5C,EAGMI,EAAmB,OAAO,IAAI,uBAAuB,EAOrDC,EAAgB,OAAO,OAAW,IAAc,OAAS,OAE/D,SAASC,GAAmC,CAQxC,OAPKD,EAAaD,GAKdV,EAAA,IAAU,uDAAuD,GAJjEA,EAAA,IAAU,qDAAqD,EAC/D,EAAaU,GAAoBX,EAAAA,iBAAiB,CAAE,MAAOK,CAAO,EAAGP,EAAAA,WAAW,EAChFG,EAAA,IAAU,+BAA+B,GAItCW,EAAaD,EACxB,CAEA,IAAMG,EAAsBD,EAAqB,E"}
@@ -1,21 +1,20 @@
1
1
  import { log as e } from "../util/debug.esm.js";
2
- import { sessionExplicitlyInactive as t } from "../authSession/identityState.esm.js";
3
- import { authSession as n } from "../authSession/authSession.esm.js";
2
+ import { authSession as t } from "../authSession/authSession.esm.js";
3
+ import { sessionExplicitlyInactive as n } from "../authSession/identityState.esm.js";
4
4
  import { createSolidLogic as r } from "./solidLogic.esm.js";
5
- //#region src/logic/solidLogicSingleton.ts
5
+ // src/logic/solidLogicSingleton.ts
6
6
  var i = async (e, r) => {
7
- let i = r && r.credentials && r.credentials == "omit", a = n;
8
- if (!t(a) && (a?.info?.webId || a?.webId) && !i) {
7
+ let i = r && r.credentials && r.credentials == "omit", a = t;
8
+ if (!n(a) && (a?.info?.webId || a?.webId) && !i) {
9
9
  let t = typeof a.authFetch == "function" ? a.authFetch.bind(a) : typeof a.fetch == "function" ? a.fetch.bind(a) : null;
10
10
  return t ? t(e, r) : window.fetch(e, r);
11
11
  }
12
12
  return window.fetch(e, r);
13
13
  }, a = Symbol.for("solid-logic-singleton"), o = typeof window < "u" ? window : global;
14
14
  function s() {
15
- return o[a] ? e("SolidLogic: Using existing global singleton instance.") : (e("SolidLogic: Creating new global singleton instance."), o[a] = r({ fetch: i }, n), e("Unique quadstore initialized.")), o[a];
15
+ return o[a] ? e("SolidLogic: Using existing global singleton instance.") : (e("SolidLogic: Creating new global singleton instance."), o[a] = r({ fetch: i }, t), e("Unique quadstore initialized.")), o[a];
16
16
  }
17
17
  var c = s();
18
- //#endregion
19
18
  export { c as solidLogicSingleton };
20
19
 
21
20
  //# sourceMappingURL=solidLogicSingleton.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileAclDocuments.cjs.js","names":["ownerOnlyContainerAclDocument","webId"],"sources":["../../src/profile/profileAclDocuments.ts"],"sourcesContent":["export function ownerOnlyContainerAclDocument(webId: string): string {\n return [\n '@prefix acl: <http://www.w3.org/ns/auth/acl#>.',\n '',\n '<#owner>',\n 'a acl:Authorization;',\n `acl:agent <${webId}>;`,\n 'acl:accessTo <./>;',\n 'acl:default <./>;',\n 'acl:mode acl:Read, acl:Write, acl:Control.'\n ].join('\\n')\n}\n"],"mappings":"AAAA,SAAgBA,EAA8B,EAAuB,CACjE,MAAO,CACH,iDACA,GACA,WACA,uBACA,cAAcC,EAAM,IACpB,qBACA,oBACA,4CACJ,CAAC,CAAC,KAAK;CAAI,CACf"}
1
+ {"version":3,"file":"profileAclDocuments.cjs.js","names":["ownerOnlyContainerAclDocument","webId"],"sources":["../../src/profile/profileAclDocuments.ts"],"sourcesContent":["export function ownerOnlyContainerAclDocument(webId: string): string {\n return [\n '@prefix acl: <http://www.w3.org/ns/auth/acl#>.',\n '',\n '<#owner>',\n 'a acl:Authorization;',\n `acl:agent <${webId}>;`,\n 'acl:accessTo <./>;',\n 'acl:default <./>;',\n 'acl:mode acl:Read, acl:Write, acl:Control.'\n ].join('\\n')\n}\n"],"mappings":"AAAA,SAAgBA,EAA8B,EAAuB,CACjE,MAAO,CACH,iDACA,GACA,WACA,uBACA,cAAcC,EAAM,IACpB,qBACA,oBACA,4CACJ,CAAC,CAAC,KAAK;CAAI,CACf,C"}
@@ -1,4 +1,4 @@
1
- //#region src/profile/profileAclDocuments.ts
1
+ // src/profile/profileAclDocuments.ts
2
2
  function e(e) {
3
3
  return [
4
4
  "@prefix acl: <http://www.w3.org/ns/auth/acl#>.",
@@ -11,7 +11,6 @@ function e(e) {
11
11
  "acl:mode acl:Read, acl:Write, acl:Control."
12
12
  ].join("\n");
13
13
  }
14
- //#endregion
15
14
  export { e as ownerOnlyContainerAclDocument };
16
15
 
17
16
  //# sourceMappingURL=profileAclDocuments.esm.js.map
@@ -1,3 +1,7 @@
1
- function e(){return[`@prefix dct: <http://purl.org/dc/terms/>.`,`@prefix pim: <http://www.w3.org/ns/pim/space#>.`,`@prefix solid: <http://www.w3.org/ns/solid/terms#>.`,`<>`,` a pim:ConfigurationFile ;`,` dct:title "Preferences file".`].join(`
2
- `)}exports.preferencesFileDocument=e;
1
+ function e(){return`@prefix dct: <http://purl.org/dc/terms/>.
2
+ @prefix pim: <http://www.w3.org/ns/pim/space#>.
3
+ @prefix solid: <http://www.w3.org/ns/solid/terms#>.
4
+ <>
5
+ a pim:ConfigurationFile ;
6
+ dct:title "Preferences file".`}exports.preferencesFileDocument=e;
3
7
  //# sourceMappingURL=profileDocuments.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileDocuments.cjs.js","names":["preferencesFileDocument"],"sources":["../../src/profile/profileDocuments.ts"],"sourcesContent":["export function preferencesFileDocument(): string {\n return [\n '@prefix dct: <http://purl.org/dc/terms/>.',\n '@prefix pim: <http://www.w3.org/ns/pim/space#>.',\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a pim:ConfigurationFile ;',\n ' dct:title \"Preferences file\".'\n ].join('\\n')\n}\n"],"mappings":"AAAA,SAAgBA,GAAkC,CAC9C,MAAO,CACH,4CACA,kDACA,sDACA,KACA,gCACA,mCACJ,CAAC,CAAC,KAAK;CAAI,CACf"}
1
+ {"version":3,"file":"profileDocuments.cjs.js","names":["preferencesFileDocument"],"sources":["../../src/profile/profileDocuments.ts"],"sourcesContent":["export function preferencesFileDocument(): string {\n return [\n '@prefix dct: <http://purl.org/dc/terms/>.',\n '@prefix pim: <http://www.w3.org/ns/pim/space#>.',\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a pim:ConfigurationFile ;',\n ' dct:title \"Preferences file\".'\n ].join('\\n')\n}\n"],"mappings":"AAAA,SAAgBA,GAAkC,CAC9C,MAAO;;;;;kCAQX,C"}
@@ -1,15 +1,7 @@
1
- //#region src/profile/profileDocuments.ts
1
+ // src/profile/profileDocuments.ts
2
2
  function e() {
3
- return [
4
- "@prefix dct: <http://purl.org/dc/terms/>.",
5
- "@prefix pim: <http://www.w3.org/ns/pim/space#>.",
6
- "@prefix solid: <http://www.w3.org/ns/solid/terms#>.",
7
- "<>",
8
- " a pim:ConfigurationFile ;",
9
- " dct:title \"Preferences file\"."
10
- ].join("\n");
3
+ return "@prefix dct: <http://purl.org/dc/terms/>.\n@prefix pim: <http://www.w3.org/ns/pim/space#>.\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n<>\n a pim:ConfigurationFile ;\n dct:title \"Preferences file\".";
11
4
  }
12
- //#endregion
13
5
  export { e as preferencesFileDocument };
14
6
 
15
7
  //# sourceMappingURL=profileDocuments.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileDocuments.esm.js","names":["preferencesFileDocument"],"sources":["../../src/profile/profileDocuments.ts"],"sourcesContent":["export function preferencesFileDocument(): string {\n return [\n '@prefix dct: <http://purl.org/dc/terms/>.',\n '@prefix pim: <http://www.w3.org/ns/pim/space#>.',\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a pim:ConfigurationFile ;',\n ' dct:title \"Preferences file\".'\n ].join('\\n')\n}\n"],"mappings":";AAAA,SAAgBA,IAAkC;CAC9C,OAAO;EACH;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC,CAAC,KAAK,IAAI;AACf"}
1
+ {"version":3,"file":"profileDocuments.esm.js","names":["preferencesFileDocument"],"sources":["../../src/profile/profileDocuments.ts"],"sourcesContent":["export function preferencesFileDocument(): string {\n return [\n '@prefix dct: <http://purl.org/dc/terms/>.',\n '@prefix pim: <http://www.w3.org/ns/pim/space#>.',\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a pim:ConfigurationFile ;',\n ' dct:title \"Preferences file\".'\n ].join('\\n')\n}\n"],"mappings":";AAAA,SAAgBA,IAAkC;CAC9C,OAAO;AAQX"}
@@ -1,2 +1,2 @@
1
- const e=require("../util/debug.cjs.js"),t=require("../util/ns.cjs.js"),n=require("../acl/aclLogic.cjs.js"),r=require("../util/utils.cjs.js"),i=require("../logic/CustomError.cjs.js"),a=require("../typeIndex/typeIndexDocuments.cjs.js"),o=require("../typeIndex/typeIndexAclDocuments.cjs.js"),s=require("./profileDocuments.cjs.js"),c=require("./profileAclDocuments.cjs.js"),l=require("../util/containerLogic.cjs.js");let u=require("rdflib");function d(d,f,p){let m=t.ns,h=l.createContainerLogic(d),g=new Map,_=new Map;function v(e){return!!e&&(e.startsWith(`https://`)||e.startsWith(`http://`))}function y(e){let t=e.doc(),n=t.dir();if(n?.uri&&v(n.uri))return n.uri;let r=t.uri;if(!r||!v(r))return null;let i=r.split(`#`)[0],a=i.lastIndexOf(`/`);return a===-1?null:i.slice(0,a+1)}function b(e,t){let n=y(e);if(!n)throw Error(`Cannot derive directory for preferences file ${e.uri}`);return(0,u.sym)(n+t)}function x(e){if(e?.response?.status===404)return!0;let t=`${e?.message||e||``}`;return t.includes(`404`)||t.includes(`Not Found`)}async function S(e){let t=(0,u.sym)(e);try{await d.fetcher.load(t);return}catch(e){if(!x(e))throw e}await h.createContainer(e)}async function C(e,t){let r=y(t);if(!r)throw Error(`Cannot derive settings directory from ${t.uri}`);await S(r);let i=(0,u.sym)(r),a;try{await d.fetcher.load(i),a=d.any(i,n.ACL_LINK)?.value}catch(e){if(!x(e))throw e}a||=`${r}.acl`;let o=(0,u.sym)(a);try{await d.fetcher.load(o);return}catch(e){if(!x(e))throw e}await d.fetcher.webOperation(`PUT`,o.uri,{data:c.ownerOnlyContainerAclDocument(e.uri),contentType:`text/turtle`})}async function w(e,t,r=!1){if(!await p.loadOrCreateWithContentOnCreate(t,a.publicTypeIndexDocument())&&!r)return;let i;try{await d.fetcher.load(t),i=d.any(t,n.ACL_LINK)?.value}catch(e){if(!x(e))throw e}i||=`${t.uri}.acl`;let s=(0,u.sym)(i);try{await d.fetcher.webOperation(`PUT`,s.uri,{data:o.publicTypeIndexAclDocument(e.uri,t.uri),contentType:`text/turtle`,headers:{"If-None-Match":`*`}})}catch(e){if((e?.response?.status??e?.status)!==412)throw e}}async function T(e){await p.loadOrCreateWithContentOnCreate(e,a.privateTypeIndexDocument())}async function E(e,t){let n=t.doc(),r=e.doc();await d.fetcher.load(n);let i=d.any(e,m.solid(`publicTypeIndex`),null,r),o=d.any(e,m.solid(`publicTypeIndex`),null,n),s=i||o||b(t,`publicTypeIndex.ttl`),c=d.any(e,m.solid(`privateTypeIndex`),null,n)||b(t,`privateTypeIndex.ttl`),l=!i;l&&await p.followOrCreateLinkWithContentOnCreate(e,m.solid(`publicTypeIndex`),s,r,a.publicTypeIndexDocument());let f=[];d.holds(n,m.rdf(`type`),m.space(`ConfigurationFile`),n)||f.push((0,u.st)(n,m.rdf(`type`),m.space(`ConfigurationFile`),n)),d.holds(n,m.dct(`title`),void 0,n)||f.push((0,u.st)(n,m.dct(`title`),(0,u.literal)(`Preferences file`),n)),d.holds(e,m.solid(`publicTypeIndex`),s,n)||f.push((0,u.st)(e,m.solid(`publicTypeIndex`),s,n)),d.holds(e,m.solid(`privateTypeIndex`),c,n)||f.push((0,u.st)(e,m.solid(`privateTypeIndex`),c,n)),f.length>0&&(await d.updater.update([],f),await d.fetcher.load(n)),await w(e,s,l),await T(c)}async function D(e){try{return!!await p.loadOrCreateWithContentOnCreate(e,s.preferencesFileDocument())}catch(t){throw t.response?.status===401?new i.UnauthorizedError:t.response?.status===403?r.differentOrigin(e)?new i.CrossOriginForbiddenError:new i.SameOriginForbiddenError:t}}async function O(e){try{return await k(e)}catch{return}}async function k(t){let n=_.get(t.uri);if(n)return n;let a=g.get(t.uri);if(a)return a;let o=(async()=>{await A(t);let n=r.suggestPreferencesFile(t),a;try{a=d.any(t,m.space(`preferencesFile`),null,t.doc())||await p.followOrCreateLink(t,m.space(`preferencesFile`),n,t.doc()),await C(t,a),await D(a),await E(t,a)}catch(n){let r=`User ${t} has no pointer in profile to preferences file.`;throw e.warn(r),n instanceof i.NotEditableError||n instanceof i.WebOperationError||n instanceof i.UnauthorizedError||n instanceof i.CrossOriginForbiddenError||n instanceof i.SameOriginForbiddenError||n instanceof i.FetchError,n}try{await d.fetcher.load(a)}catch(n){let o=`Unable to load preference of user ${t}: ${n}`;if(n.response?.status===404)return await C(t,a),await D(a),await E(t,a),await d.fetcher.load(a),a;throw e.warn(o),n.response.status===401?new i.UnauthorizedError:n.response.status===403?r.differentOrigin(a)?new i.CrossOriginForbiddenError:new i.SameOriginForbiddenError:Error(o)}return _.set(t.uri,a),a})();g.set(t.uri,o);try{return await o}finally{g.get(t.uri)===o&&g.delete(t.uri)}}async function A(e){if(!e)throw Error(`loadProfile: no user given.`);try{await d.fetcher.load(e.doc())}catch(t){throw Error(`Unable to load profile of user ${e}: ${t}`)}return e.doc()}async function j(){let e=f.currentUser();if(e===null)throw Error(`Current user not found! Not logged in?`);return await d.fetcher.load(e.doc()),e}function M(e){let t=P(e);if(!t)throw Error(`User pod root not found!`);return t}async function N(e){await d.fetcher.load(e);let t=d.any(e,m.ldp(`inbox`),void 0,e.doc());if(!t)throw Error(`User main inbox not found!`);return t}function P(e){return d.any(e,m.space(`storage`),void 0,e.doc())}return{loadMe:j,getPodRoot:M,getMainInbox:N,findStorage:P,loadPreferences:k,loadProfile:A,silencedLoadPreferences:O}}exports.createProfileLogic=d;
1
+ const e=require("../acl/aclLogic.cjs.js"),t=require("../logic/CustomError.cjs.js"),n=require("../util/debug.cjs.js"),r=require("../util/ns.cjs.js"),i=require("../typeIndex/typeIndexDocuments.cjs.js"),a=require("../typeIndex/typeIndexAclDocuments.cjs.js"),o=require("./profileDocuments.cjs.js"),s=require("./profileAclDocuments.cjs.js"),c=require("../util/containerLogic.cjs.js"),l=require("../util/utils.cjs.js");let u=require("rdflib");function d(d,f,p){let m=r.ns,h=c.createContainerLogic(d),g=new Map,_=new Map;function v(e){return!!e&&(e.startsWith(`https://`)||e.startsWith(`http://`))}function y(e){let t=e.doc(),n=t.dir();if(n?.uri&&v(n.uri))return n.uri;let r=t.uri;if(!r||!v(r))return null;let i=r.split(`#`)[0],a=i.lastIndexOf(`/`);return a===-1?null:i.slice(0,a+1)}function b(e,t){let n=y(e);if(!n)throw Error(`Cannot derive directory for preferences file ${e.uri}`);return(0,u.sym)(n+t)}function x(e){if(e?.response?.status===404)return!0;let t=`${e?.message||e||``}`;return t.includes(`404`)||t.includes(`Not Found`)}async function S(e){let t=(0,u.sym)(e);try{await d.fetcher.load(t);return}catch(e){if(!x(e))throw e}await h.createContainer(e)}async function C(t,n){let r=y(n);if(!r)throw Error(`Cannot derive settings directory from ${n.uri}`);await S(r);let i=(0,u.sym)(r),a;try{await d.fetcher.load(i),a=d.any(i,e.ACL_LINK)?.value}catch(e){if(!x(e))throw e}a||=`${r}.acl`;let o=(0,u.sym)(a);try{await d.fetcher.load(o);return}catch(e){if(!x(e))throw e}await d.fetcher.webOperation(`PUT`,o.uri,{data:s.ownerOnlyContainerAclDocument(t.uri),contentType:`text/turtle`})}async function w(t,n,r=!1){if(!await p.loadOrCreateWithContentOnCreate(n,i.publicTypeIndexDocument())&&!r)return;let o;try{await d.fetcher.load(n),o=d.any(n,e.ACL_LINK)?.value}catch(e){if(!x(e))throw e}o||=`${n.uri}.acl`;let s=(0,u.sym)(o);try{await d.fetcher.webOperation(`PUT`,s.uri,{data:a.publicTypeIndexAclDocument(t.uri,n.uri),contentType:`text/turtle`,headers:{"If-None-Match":`*`}})}catch(e){if((e?.response?.status??e?.status)!==412)throw e}}async function T(e){await p.loadOrCreateWithContentOnCreate(e,i.privateTypeIndexDocument())}async function E(e,t){let n=t.doc(),r=e.doc();await d.fetcher.load(n);let a=d.any(e,m.solid(`publicTypeIndex`),null,r),o=d.any(e,m.solid(`publicTypeIndex`),null,n),s=a||o||b(t,`publicTypeIndex.ttl`),c=d.any(e,m.solid(`privateTypeIndex`),null,n)||b(t,`privateTypeIndex.ttl`),l=!a;l&&await p.followOrCreateLinkWithContentOnCreate(e,m.solid(`publicTypeIndex`),s,r,i.publicTypeIndexDocument());let f=[];d.holds(n,m.rdf(`type`),m.space(`ConfigurationFile`),n)||f.push((0,u.st)(n,m.rdf(`type`),m.space(`ConfigurationFile`),n)),d.holds(n,m.dct(`title`),void 0,n)||f.push((0,u.st)(n,m.dct(`title`),(0,u.literal)(`Preferences file`),n)),d.holds(e,m.solid(`publicTypeIndex`),s,n)||f.push((0,u.st)(e,m.solid(`publicTypeIndex`),s,n)),d.holds(e,m.solid(`privateTypeIndex`),c,n)||f.push((0,u.st)(e,m.solid(`privateTypeIndex`),c,n)),f.length>0&&(await d.updater.update([],f),await d.fetcher.load(n)),await w(e,s,l),await T(c)}async function D(e){try{return!!await p.loadOrCreateWithContentOnCreate(e,o.preferencesFileDocument())}catch(n){throw n.response?.status===401?new t.UnauthorizedError:n.response?.status===403?l.differentOrigin(e)?new t.CrossOriginForbiddenError:new t.SameOriginForbiddenError:n}}async function O(e){try{return await k(e)}catch{return}}async function k(e){let r=_.get(e.uri);if(r)return r;let i=g.get(e.uri);if(i)return i;let a=(async()=>{await A(e);let r=l.suggestPreferencesFile(e),i;try{i=d.any(e,m.space(`preferencesFile`),null,e.doc())||await p.followOrCreateLink(e,m.space(`preferencesFile`),r,e.doc()),await C(e,i),await D(i),await E(e,i)}catch(r){let i=`User ${e} has no pointer in profile to preferences file.`;throw n.warn(i),r instanceof t.NotEditableError||r instanceof t.WebOperationError||r instanceof t.UnauthorizedError||r instanceof t.CrossOriginForbiddenError||r instanceof t.SameOriginForbiddenError||r instanceof t.FetchError,r}try{await d.fetcher.load(i)}catch(r){let a=`Unable to load preference of user ${e}: ${r}`;if(r.response?.status===404)return await C(e,i),await D(i),await E(e,i),await d.fetcher.load(i),i;throw n.warn(a),r.response.status===401?new t.UnauthorizedError:r.response.status===403?l.differentOrigin(i)?new t.CrossOriginForbiddenError:new t.SameOriginForbiddenError:Error(a)}return _.set(e.uri,i),i})();g.set(e.uri,a);try{return await a}finally{g.get(e.uri)===a&&g.delete(e.uri)}}async function A(e){if(!e)throw Error(`loadProfile: no user given.`);try{await d.fetcher.load(e.doc())}catch(t){throw Error(`Unable to load profile of user ${e}: ${t}`)}return e.doc()}async function j(){let e=f.currentUser();if(e===null)throw Error(`Current user not found! Not logged in?`);return await d.fetcher.load(e.doc()),e}function M(e){let t=P(e);if(!t)throw Error(`User pod root not found!`);return t}async function N(e){await d.fetcher.load(e);let t=d.any(e,m.ldp(`inbox`),void 0,e.doc());if(!t)throw Error(`User main inbox not found!`);return t}function P(e){return d.any(e,m.space(`storage`),void 0,e.doc())}return{loadMe:j,getPodRoot:M,getMainInbox:N,findStorage:P,loadPreferences:k,loadProfile:A,silencedLoadPreferences:O}}exports.createProfileLogic=d;
2
2
  //# sourceMappingURL=profileLogic.cjs.js.map