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,56 +1,141 @@
1
- import { ns as e } from "../util/ns.esm.js";
2
- import { ACL_LINK as t } from "../acl/aclLogic.esm.js";
1
+ import { ACL_LINK as e } from "../acl/aclLogic.esm.js";
2
+ import { ns as t } from "../util/ns.esm.js";
3
3
  import { assertSuccessfulHttpResponse as n, isMissingError as r } from "./resourceHttp.esm.js";
4
4
  import { readWacAccessInfo as i } from "./resourceMetadata.esm.js";
5
- import { Util as a, sym as o } from "rdflib";
6
- //#region src/resource/resourceLogic.ts
7
- function s(s, c, l, u) {
8
- function d(e) {
9
- return l.createContainer(e);
5
+ import { ResourceUploadError as a } from "../types.esm.js";
6
+ import { log as o } from "../util/debug.esm.js";
7
+ import { Util as s, sym as c } from "rdflib";
8
+ import * as l from "mime-types";
9
+ // src/resource/resourceLogic.ts
10
+ function u(u, d, f, p) {
11
+ function m(e, t) {
12
+ let n = (e, t) => {
13
+ let n = typeof t == "object" && t ? t : void 0, r = n?.response?.status, i = n?.status, o = typeof r == "number" ? r : typeof i == "number" ? i : void 0, s = t instanceof Error ? t.message : typeof n?.message == "string" ? n.message : typeof t == "string" ? t : "Upload failed";
14
+ return new a(s, e, o);
15
+ };
16
+ return Promise.all(e.map((e) => new Promise((r) => {
17
+ let i = new FileReader();
18
+ i.onload = (i) => {
19
+ try {
20
+ let o = i.target?.result;
21
+ if (!(o instanceof ArrayBuffer)) {
22
+ r({
23
+ success: !1,
24
+ file: e,
25
+ error: n(void 0, /* @__PURE__ */ Error("Unable to read file as an ArrayBuffer"))
26
+ });
27
+ return;
28
+ }
29
+ let s = "", c = e.type;
30
+ if (c) {
31
+ let t = l.extension(e.type);
32
+ t && t !== "false" && !e.name.endsWith(`.${t}`) && e.type !== l.lookup(e.name) && (s = `_.${t}`);
33
+ } else if (c = l.lookup(e.name) || "", !c) {
34
+ r({
35
+ success: !1,
36
+ file: e,
37
+ error: n(void 0, /* @__PURE__ */ Error("Filename has no recognized content type"))
38
+ });
39
+ return;
40
+ }
41
+ let d = `${t}${t.endsWith("/") ? "" : "/"}${encodeURIComponent(e.name)}${s}`;
42
+ u.fetcher.webOperation("PUT", d, {
43
+ data: o,
44
+ contentType: c
45
+ }).then((t) => r(t.ok ? {
46
+ success: !0,
47
+ file: e,
48
+ uploadedUri: d
49
+ } : {
50
+ success: !1,
51
+ file: e,
52
+ error: new a(`HTTP error on PUT! Status: ${t.status}`, d, t.status)
53
+ }), (t) => r({
54
+ success: !1,
55
+ file: e,
56
+ error: n(d, t)
57
+ }));
58
+ } catch (t) {
59
+ r({
60
+ success: !1,
61
+ file: e,
62
+ error: n(void 0, t)
63
+ });
64
+ }
65
+ }, i.onerror = () => {
66
+ r({
67
+ success: !1,
68
+ file: e,
69
+ error: n(void 0, /* @__PURE__ */ Error("Unable to read file"))
70
+ });
71
+ }, i.onabort = () => {
72
+ r({
73
+ success: !1,
74
+ file: e,
75
+ error: n(void 0, /* @__PURE__ */ Error("File reading was aborted"))
76
+ });
77
+ };
78
+ try {
79
+ i.readAsArrayBuffer(e);
80
+ } catch (t) {
81
+ r({
82
+ success: !1,
83
+ file: e,
84
+ error: n(void 0, t)
85
+ });
86
+ }
87
+ }).catch((t) => ({
88
+ success: !1,
89
+ file: e,
90
+ error: n(void 0, t)
91
+ }))));
10
92
  }
11
- function f(e) {
12
- return l.isContainer(e);
93
+ function h(e) {
94
+ return f.createContainer(e);
13
95
  }
14
- function p(e) {
15
- return l.getContainerMemberCount(e);
96
+ function g(e) {
97
+ return f.isContainer(e);
16
98
  }
17
- function m(e) {
18
- return l.getContainerElements(e);
99
+ function _(e) {
100
+ return f.getContainerMemberCount(e);
19
101
  }
20
- function h(e) {
102
+ function v(e) {
103
+ return f.getContainerElements(e);
104
+ }
105
+ function y(e) {
21
106
  let t = e.uri.endsWith("/") ? e.uri : `${e.uri}/`;
22
- return s.sym(`${t}index.ttl#this`);
107
+ return u.sym(`${t}index.ttl#this`);
23
108
  }
24
- function g(t) {
25
- return s.holds(t, e.ldp("contains"), h(t).doc());
109
+ function b(e) {
110
+ return u.holds(e, t.ldp("contains"), y(e).doc());
26
111
  }
27
- function _(t) {
28
- return s.holds(t, e.rdf("type"), e.space("Storage"), t.doc());
112
+ function x(e) {
113
+ return u.holds(e, t.rdf("type"), t.space("Storage"), e.doc());
29
114
  }
30
- function v(e) {
115
+ function S(e) {
31
116
  let t = e.dir();
32
117
  if (!t) return !1;
33
118
  let n = e.uri.slice(t.uri.length);
34
119
  return n.startsWith(".") || n.endsWith(".acl") || n.endsWith(".meta") || n.endsWith("~");
35
120
  }
36
- function y(e, t) {
37
- let n = s.findTypeURIs(e), r = t.toLowerCase(), i = a.mediaTypeClass(`${r}/*`).uri.split("*")[0];
121
+ function C(e, t) {
122
+ let n = u.findTypeURIs(e), r = t.toLowerCase(), i = s.mediaTypeClass(`${r}/*`).uri.split("*")[0];
38
123
  return Object.keys(n).some((e) => e.startsWith(i)) || {
39
124
  audio: "http://purl.org/dc/dcmitype/Sound",
40
125
  image: "http://purl.org/dc/dcmitype/Image",
41
126
  video: "http://purl.org/dc/dcmitype/MovingImage"
42
- }[r] in n ? !0 : (s.fetcher.getHeader(e, "content-type") || []).some((e) => e.split(";", 1)[0].trim().toLowerCase().startsWith(`${r}/`));
127
+ }[r] in n ? !0 : (u.fetcher.getHeader(e, "content-type") || []).some((e) => e.split(";", 1)[0].trim().toLowerCase().startsWith(`${r}/`));
43
128
  }
44
- function b(e) {
45
- return y(e, "image");
129
+ function w(e) {
130
+ return C(e, "image");
46
131
  }
47
- function x(e) {
48
- return y(e, "audio");
132
+ function T(e) {
133
+ return C(e, "audio");
49
134
  }
50
- function S(e) {
51
- return y(e, "video");
135
+ function E(e) {
136
+ return C(e, "video");
52
137
  }
53
- function C(e) {
138
+ function D(e) {
54
139
  let t = typeof e == "string" ? e : e.value;
55
140
  try {
56
141
  let e = new URL(t);
@@ -59,64 +144,64 @@ function s(s, c, l, u) {
59
144
  return !1;
60
145
  }
61
146
  }
62
- function w(n, r) {
63
- let a, o = !1, c = !1, l = !1, u = !1, d, f;
147
+ function O(n, r) {
148
+ let a, o = !1, s = !1, c = !1, l = !1, d, f;
64
149
  if (r.headers) {
65
150
  a = r.headers.get("content-type")?.split(";")[0] ?? void 0;
66
- let t = i(r.headers.get("wac-allow"));
67
- o = t.canEdit, c = t.canManageAccess, l = t.isPublic, u = t.isPublicKnown, d = r.headers.get("etag") ?? void 0, f = s.anyValue(n, e.dct("modified")) || s.anyValue(n, e.dc("modified")) || void 0;
151
+ let e = i(r.headers.get("wac-allow"));
152
+ o = e.canEdit, s = e.canManageAccess, c = e.isPublic, l = e.isPublicKnown, d = r.headers.get("etag") ?? void 0, f = u.anyValue(n, t.dct("modified")) || u.anyValue(n, t.dc("modified")) || void 0;
68
153
  }
69
- (!r.headers || !r.headers.get("content-type")) && (!r.headers || !r.headers.get("wac-allow") || !r.headers.get("etag")) && s.each(null, s.sym("http://www.w3.org/2007/ont/link#requestedURI"), n).map((t) => {
70
- let r = s.any(t, s.sym("http://www.w3.org/2007/ont/link#response"));
154
+ r.headers && r.headers.get("content-type") || r.headers && r.headers.get("wac-allow") && r.headers.get("etag") || u.each(null, u.sym("http://www.w3.org/2007/ont/link#requestedURI"), n).map((e) => {
155
+ let r = u.any(e, u.sym("http://www.w3.org/2007/ont/link#response"));
71
156
  if (r && r.termType === "NamedNode") {
72
- let t = s.anyValue(r, e.httph("content-type")) || void 0;
73
- a === void 0 && (a = t);
74
- let p = s.anyValue(r, e.httph("wac-allow")) || s.anyValue(r, e.httph("WAC-Allow")), m = i(p);
75
- o ||= m.canEdit, c ||= m.canManageAccess, l ||= m.isPublic, u ||= m.isPublicKnown;
76
- let h = s.anyValue(r, e.httph("etag")) || void 0;
77
- d === void 0 && (d = h), f = s.anyValue(n, e.dct("modified")) || s.anyValue(n, e.dc("modified")) || void 0;
157
+ let e = u.anyValue(r, t.httph("content-type")) || void 0;
158
+ a === void 0 && (a = e);
159
+ let p = u.anyValue(r, t.httph("wac-allow")) || u.anyValue(r, t.httph("WAC-Allow")), m = i(p);
160
+ o ||= m.canEdit, s ||= m.canManageAccess, c ||= m.isPublic, l ||= m.isPublicKnown;
161
+ let h = u.anyValue(r, t.httph("etag")) || void 0;
162
+ d === void 0 && (d = h), f = u.anyValue(n, t.dct("modified")) || u.anyValue(n, t.dc("modified")) || void 0;
78
163
  }
79
164
  });
80
- let p = s.any(n, t)?.value || void 0;
165
+ let p = u.any(n, e)?.value || void 0;
81
166
  return {
82
167
  contentType: a,
83
168
  access: {
84
169
  canEdit: o,
85
- canManageAccess: c,
86
- isPublic: l,
87
- isPublicKnown: u
170
+ canManageAccess: s,
171
+ isPublic: c,
172
+ isPublicKnown: l
88
173
  },
89
174
  aclUri: p,
90
175
  eTag: d,
91
176
  modified: f
92
177
  };
93
178
  }
94
- async function T(e) {
95
- let t = await s.fetcher.webOperation("HEAD", e.uri);
96
- return n(t, "HEAD"), w(e, t);
179
+ async function k(e) {
180
+ let t = await u.fetcher.webOperation("HEAD", e.uri);
181
+ return n(t, "HEAD"), O(e, t);
97
182
  }
98
- async function E(t) {
99
- let n = s.any(t, e.ldp("contains")) || t.dir();
183
+ async function A(e) {
184
+ let n = u.any(e, t.ldp("contains")) || e.dir();
100
185
  if (!n || n.termType !== "NamedNode") return !1;
101
186
  try {
102
- return (await T(n)).access.canEdit;
187
+ return (await k(n)).access.canEdit;
103
188
  } catch {
104
189
  return !1;
105
190
  }
106
191
  }
107
- async function D(e) {
108
- return E(e);
192
+ async function j(e) {
193
+ return A(e);
109
194
  }
110
- async function O(e) {
111
- return T(e);
195
+ async function M(e) {
196
+ return k(e);
112
197
  }
113
- async function k(e) {
198
+ async function N(e) {
114
199
  try {
115
- let t = await s.fetcher.webOperation("GET", e.uri);
200
+ let t = await u.fetcher.webOperation("GET", e.uri);
116
201
  n(t, "GET");
117
202
  let r = t.responseText;
118
203
  if (r === void 0) throw Error("No text in response object");
119
- let i = w(e, t);
204
+ let i = O(e, t);
120
205
  if (!i.contentType) throw Error("No content-type available");
121
206
  return {
122
207
  content: r,
@@ -126,10 +211,10 @@ function s(s, c, l, u) {
126
211
  throw Error(`Error reading file: ${e instanceof Error ? e.message : String(e)}`);
127
212
  }
128
213
  }
129
- async function A(e) {
214
+ async function P(e) {
130
215
  let t;
131
216
  try {
132
- t = await T(e);
217
+ t = await k(e);
133
218
  } catch {
134
219
  t = {
135
220
  contentType: void 0,
@@ -143,7 +228,7 @@ function s(s, c, l, u) {
143
228
  modified: void 0
144
229
  };
145
230
  }
146
- let n = await D(e), r = {
231
+ let n = await j(e), r = {
147
232
  canEdit: t.access?.canEdit ?? !1,
148
233
  canManageAccess: t.access?.canManageAccess ?? !1,
149
234
  isPublic: t.access?.isPublic ?? !1,
@@ -155,53 +240,53 @@ function s(s, c, l, u) {
155
240
  access: r
156
241
  };
157
242
  }
158
- async function j(e, t) {
243
+ async function F(e, t) {
159
244
  if (t) try {
160
- await u.deleteTypeIndexRegistrationForResource(e, t);
245
+ await p.deleteTypeIndexRegistrationForResource(e, t);
161
246
  } catch {}
162
247
  }
163
- async function M(t, i = {}) {
164
- let a = t.dir();
165
- if (f(t)) {
166
- let e = await l.getContainerMembers(t);
167
- await Promise.all(e.map((e) => M(o(e), i)));
248
+ async function I(e, i = {}) {
249
+ let a = e.dir();
250
+ if (g(e)) {
251
+ let t = await f.getContainerMembers(e);
252
+ await Promise.all(t.map((e) => I(c(e), i)));
168
253
  }
169
- let c;
254
+ let s;
170
255
  try {
171
- c = await s.fetcher._fetch(t.value, { method: "DELETE" }), n(c, "DELETE", { allowNotFound: !0 });
256
+ s = await u.fetcher._fetch(e.value, { method: "DELETE" }), n(s, "DELETE", { allowNotFound: !0 });
172
257
  } catch (e) {
173
258
  if (!r(e)) throw e;
174
259
  }
175
- return i.deleteTypeIndexes && await j(t, i.user), a && s.removeMatches(a, e.ldp("contains"), t, a.doc()), s.removeDocument(t), s.fetcher.unload(t.doc()), c;
260
+ return i.deleteTypeIndexes && await F(e, i.user), a && u.removeMatches(a, t.ldp("contains"), e), u.removeDocument(e), u.fetcher.unload(e.doc()), o(`Deleted resource: ${e.value}`), s;
176
261
  }
177
- async function N(e, t) {
178
- await M(e, {
262
+ async function L(e, t) {
263
+ await I(e, {
179
264
  deleteTypeIndexes: !0,
180
265
  user: t
181
266
  });
182
267
  }
183
268
  return {
184
- recursiveDelete: M,
185
- deleteResourceAndTypeIndexIfExists: N,
186
- fetchMetadata: O,
187
- fetchMetadataWithDelete: A,
188
- fetchContentAndMetadata: k,
189
- createContainer: d,
190
- isContainer: f,
191
- getContainerMembers: m,
192
- getContainerMemberCount: p,
193
- getContainerIndexThing: h,
194
- containerHasIndexDocument: g,
195
- isStorageRoot: _,
196
- isHiddenFile: v,
197
- isMediaType: y,
198
- isImage: b,
199
- isAudio: x,
200
- isVideo: S,
201
- isWebId: C
269
+ uploadFiles: m,
270
+ recursiveDelete: I,
271
+ deleteResourceAndTypeIndexIfExists: L,
272
+ fetchMetadata: M,
273
+ fetchMetadataWithDelete: P,
274
+ fetchContentAndMetadata: N,
275
+ createContainer: h,
276
+ isContainer: g,
277
+ getContainerMembers: v,
278
+ getContainerMemberCount: _,
279
+ getContainerIndexThing: y,
280
+ containerHasIndexDocument: b,
281
+ isStorageRoot: x,
282
+ isHiddenFile: S,
283
+ isMediaType: C,
284
+ isImage: w,
285
+ isAudio: T,
286
+ isVideo: E,
287
+ isWebId: D
202
288
  };
203
289
  }
204
- //#endregion
205
- export { s as createResourceLogic };
290
+ export { u as createResourceLogic };
206
291
 
207
292
  //# sourceMappingURL=resourceLogic.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resourceLogic.esm.js","names":["createResourceLogic","createContainer","containerLogic","url","isContainer","resourceNode","getContainerMemberCount","getContainerMembers","getContainerIndexThing","folderUri","containerNode","store","containerHasIndexDocument","ns","isStorageRoot","isHiddenFile","directory","pathEnd","isMediaType","typeURIs","normalizedMediaType","mediaType","mediaTypePrefix","Util","typeURI","contentType","isImage","isAudio","isVideo","isWebId","uri","resource","parsed","readMetadata","canEdit","canManageAccess","isPublic","isPublicKnown","eTag","modified","response","accessFlags","readWacAccessInfo","subject","responseNode","req","responseContentType","wacAllow","responseETag","aclUri","ACL_LINK","fetchHeadMetadata","assertSuccessfulHttpResponse","userCanWriteToContainingContainer","userCanDeleteResource","fetchMetadata","fetchContentAndMetadata","content","metadata","error","fetchMetadataWithDelete","resourceMetadata","canDelete","access","deleteTypeIndexesForResource","user","typeIndexLogic","recursiveDelete","resourceParent","containerMembers","sym","options","deleted","isMissingError","deleteResourceAndTypeIndexIfExists"],"sources":["../../src/resource/resourceLogic.ts"],"sourcesContent":["import { NamedNode, sym, Util } from 'rdflib'\nimport { ACL_LINK } from '../acl/aclLogic'\nimport { ns } from '../util/ns'\nimport { assertSuccessfulHttpResponse, isMissingError } from './resourceHttp'\nimport { readWacAccessInfo } from './resourceMetadata'\nimport { type ResourceAccess, type ResourceAccessWithDelete, type ResourceContent, type ResourceDeleteOptions, type ResourceLogic, type ResourceMetadata, type ResourceMetadataWithDelete, type TypeIndexLogic } from '../types'\nimport type { AclLogic } from '../types'\n\nexport function createResourceLogic(store, aclLogic: AclLogic, containerLogic, typeIndexLogic: TypeIndexLogic): ResourceLogic {\n function createContainer(url: string) {\n return containerLogic.createContainer(url)\n }\n\n function isContainer(resourceNode: NamedNode) {\n return containerLogic.isContainer(resourceNode)\n }\n\n function getContainerMemberCount(resourceNode: NamedNode) {\n return containerLogic.getContainerMemberCount(resourceNode)\n }\n\n function getContainerMembers(resourceNode: NamedNode) {\n return containerLogic.getContainerElements(resourceNode)\n }\n\n function getContainerIndexThing(containerNode: NamedNode) {\n const folderUri = containerNode.uri.endsWith('/') ? containerNode.uri : `${containerNode.uri}/`\n return store.sym(`${folderUri}index.ttl#this`)\n }\n\n function containerHasIndexDocument(containerNode: NamedNode) {\n return store.holds(\n containerNode,\n ns.ldp('contains'),\n getContainerIndexThing(containerNode).doc()\n )\n }\n\n function isStorageRoot(resourceNode: NamedNode) {\n return store.holds(\n resourceNode,\n ns.rdf('type'),\n ns.space('Storage'),\n resourceNode.doc()\n )\n }\n\n function isHiddenFile(resourceNode: NamedNode) {\n const directory = resourceNode.dir()\n if (!directory) {\n return false\n }\n\n const pathEnd = resourceNode.uri.slice(directory.uri.length)\n return pathEnd.startsWith('.') || pathEnd.endsWith('.acl') || pathEnd.endsWith('.meta') || pathEnd.endsWith('~')\n }\n\n function isMediaType(resourceNode: NamedNode, mediaType: string) {\n const typeURIs = store.findTypeURIs(resourceNode as any)\n const normalizedMediaType = mediaType.toLowerCase()\n const mediaTypePrefix = Util.mediaTypeClass(`${normalizedMediaType}/*`).uri.split('*')[0]\n\n if (Object.keys(typeURIs).some(typeURI => typeURI.startsWith(mediaTypePrefix))) {\n return true\n }\n\n const mediaTypeClasses: Record<string, string> = {\n audio: 'http://purl.org/dc/dcmitype/Sound',\n image: 'http://purl.org/dc/dcmitype/Image',\n video: 'http://purl.org/dc/dcmitype/MovingImage'\n }\n if (mediaTypeClasses[normalizedMediaType] in typeURIs) {\n return true\n }\n\n const contentTypes = store.fetcher.getHeader(resourceNode, 'content-type') || []\n return contentTypes.some((contentType: string) =>\n contentType.split(';', 1)[0].trim().toLowerCase().startsWith(`${normalizedMediaType}/`)\n )\n }\n\n function isImage(resourceNode: NamedNode) {\n return isMediaType(resourceNode, 'image')\n }\n\n function isAudio(resourceNode: NamedNode) {\n return isMediaType(resourceNode, 'audio')\n }\n\n function isVideo(resourceNode: NamedNode) {\n return isMediaType(resourceNode, 'video')\n }\n\n function isWebId(resource: string | NamedNode) {\n const uri = typeof resource === 'string' ? resource : resource.value\n\n try {\n const parsed = new URL(uri)\n return parsed.hash === '#me' && /\\/profile\\/card\\.ttl$/.test(parsed.pathname)\n } catch (_error) {\n return false\n }\n }\n\n function readMetadata(subject: NamedNode, response: Response): ResourceMetadata {\n let contentType: string | undefined\n let canEdit = false\n let canManageAccess = false\n let isPublic = false\n let isPublicKnown = false\n let eTag: string | undefined\n let modified: string | undefined\n\n if (response.headers) {\n const contentTypeHeader = response.headers.get('content-type')\n contentType = contentTypeHeader?.split(';')[0] ?? undefined\n\n const accessFlags = readWacAccessInfo(response.headers.get('wac-allow'))\n canEdit = accessFlags.canEdit\n canManageAccess = accessFlags.canManageAccess\n isPublic = accessFlags.isPublic\n isPublicKnown = accessFlags.isPublicKnown\n eTag = response.headers.get('etag') ?? undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n\n if ((!response.headers || !response.headers.get('content-type')) && (!response.headers || !response.headers.get('wac-allow') || !response.headers.get('etag'))) {\n const reqs = store.each(\n null,\n store.sym('http://www.w3.org/2007/ont/link#requestedURI'),\n subject\n )\n reqs.map((req: any) => {\n const responseNode = store.any(\n req as any,\n store.sym('http://www.w3.org/2007/ont/link#response')\n )\n if (responseNode && responseNode.termType === 'NamedNode') {\n const responseContentType = store.anyValue(responseNode as any, ns.httph('content-type')) || undefined\n if (contentType === undefined) {\n contentType = responseContentType\n }\n const wacAllow = (store.anyValue(responseNode as any, ns.httph('wac-allow')) as string | undefined) ||\n (store.anyValue(responseNode as any, ns.httph('WAC-Allow')) as string | undefined)\n const accessFlags = readWacAccessInfo(wacAllow)\n canEdit = canEdit || accessFlags.canEdit\n canManageAccess = canManageAccess || accessFlags.canManageAccess\n isPublic = isPublic || accessFlags.isPublic\n isPublicKnown = isPublicKnown || accessFlags.isPublicKnown\n const responseETag = store.anyValue(responseNode as any, ns.httph('etag')) || undefined\n if (eTag === undefined) {\n eTag = responseETag\n }\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n })\n }\n\n const aclUri = store.any(subject, ACL_LINK)?.value || undefined\n const access: ResourceAccess = { canEdit, canManageAccess, isPublic, isPublicKnown }\n return { contentType, access, aclUri, eTag, modified }\n }\n\n async function fetchHeadMetadata(subject: NamedNode): Promise<ResourceMetadata> {\n const response = await store.fetcher.webOperation('HEAD', subject.uri)\n assertSuccessfulHttpResponse(response, 'HEAD')\n return readMetadata(subject, response)\n }\n\n async function userCanWriteToContainingContainer(resourceNode: NamedNode): Promise<boolean> {\n const containerNode = store.any(resourceNode, ns.ldp('contains')) || resourceNode.dir()\n if (!containerNode || containerNode.termType !== 'NamedNode') {\n return false\n }\n\n try {\n const containerMetadata = await fetchHeadMetadata(containerNode as NamedNode)\n return containerMetadata.access.canEdit\n } catch (_error) {\n return false\n }\n }\n\n async function userCanDeleteResource(resourceNode: NamedNode): Promise<boolean> {\n return userCanWriteToContainingContainer(resourceNode)\n }\n\n async function fetchMetadata(subject: NamedNode): Promise<ResourceMetadata> {\n return fetchHeadMetadata(subject)\n }\n\n async function fetchContentAndMetadata(subject: NamedNode): Promise<ResourceContent> {\n try {\n const response = await store.fetcher.webOperation('GET', subject.uri)\n assertSuccessfulHttpResponse(response, 'GET')\n\n const content = (response as Response & { responseText?: string }).responseText\n if (content === undefined) {\n throw new Error('No text in response object')\n }\n\n const metadata = readMetadata(subject, response)\n if (!metadata.contentType) {\n throw new Error('No content-type available')\n }\n\n return { content, metadata }\n } catch (error) {\n throw new Error(`Error reading file: ${error instanceof Error ? error.message : String(error)}`)\n }\n }\n\n async function fetchMetadataWithDelete(subject: NamedNode): Promise<ResourceMetadataWithDelete> {\n let resourceMetadata: ResourceMetadata\n\n try {\n resourceMetadata = await fetchHeadMetadata(subject)\n } catch (_error) {\n resourceMetadata = {\n contentType: undefined,\n access: { canEdit: false, canManageAccess: false, isPublic: false },\n aclUri: undefined,\n eTag: undefined,\n modified: undefined\n }\n }\n\n const canDelete = await userCanDeleteResource(subject)\n const access: ResourceAccessWithDelete = {\n canEdit: resourceMetadata.access?.canEdit ?? false,\n canManageAccess: resourceMetadata.access?.canManageAccess ?? false,\n isPublic: resourceMetadata.access?.isPublic ?? false,\n isPublicKnown: resourceMetadata.access?.isPublicKnown ?? false,\n canDelete\n }\n return { ...resourceMetadata, access }\n }\n\n async function deleteTypeIndexesForResource(resourceNode: NamedNode, user?: NamedNode | null) {\n if (!user) return\n\n try {\n await typeIndexLogic.deleteTypeIndexRegistrationForResource(resourceNode, user)\n } catch (_error) {\n // Keep resource deletion best-effort even if type-index cleanup fails.\n }\n }\n\n async function recursiveDelete(resourceNode: NamedNode, options: ResourceDeleteOptions = {}) {\n const resourceParent = resourceNode.dir()\n\n if (isContainer(resourceNode)) {\n const containerMembers = await containerLogic.getContainerMembers(resourceNode)\n await Promise.all(containerMembers.map((url) => recursiveDelete(sym(url), options)))\n }\n\n let deleted\n try {\n deleted = await store.fetcher._fetch(resourceNode.value, { method: 'DELETE' })\n assertSuccessfulHttpResponse(deleted, 'DELETE', { allowNotFound: true })\n } catch (error) {\n if (!isMissingError(error)) {\n throw error\n }\n }\n\n if (options.deleteTypeIndexes) {\n await deleteTypeIndexesForResource(resourceNode, options.user)\n }\n\n if (resourceParent) {\n store.removeMatches(resourceParent, ns.ldp('contains'), resourceNode, resourceParent.doc())\n }\n\n store.removeDocument(resourceNode)\n store.fetcher.unload(resourceNode.doc())\n return deleted\n }\n\n async function deleteResourceAndTypeIndexIfExists(resourceNode: NamedNode, user?: NamedNode | null) {\n await recursiveDelete(resourceNode, { deleteTypeIndexes: true, user })\n }\n\n return {\n recursiveDelete,\n deleteResourceAndTypeIndexIfExists,\n fetchMetadata,\n fetchMetadataWithDelete,\n fetchContentAndMetadata,\n createContainer,\n isContainer,\n getContainerMembers,\n getContainerMemberCount,\n getContainerIndexThing,\n containerHasIndexDocument,\n isStorageRoot,\n isHiddenFile,\n isMediaType,\n isImage,\n isAudio,\n isVideo,\n isWebId\n }\n}\n"],"mappings":";;;;;;AAQA,SAAgBA,EAAoB,GAAO,GAAoB,GAAgB,GAA+C;CAC5H,SAASC,EAAgB,GAAa;EACpC,OAAOC,EAAe,gBAAgBC,CAAG;CAC3C;CAEA,SAASC,EAAY,GAAyB;EAC5C,OAAOF,EAAe,YAAYG,CAAY;CAChD;CAEA,SAASC,EAAwB,GAAyB;EACxD,OAAOJ,EAAe,wBAAwBG,CAAY;CAC5D;CAEA,SAASE,EAAoB,GAAyB;EACpD,OAAOL,EAAe,qBAAqBG,CAAY;CACzD;CAEA,SAASG,EAAuB,GAA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IAAI;GACF,MAAMC,EAAe,uCAAuC7D,GAAc4D,CAAI;EAChF,QAAiB,CAEjB;CACF;CAEA,eAAeE,EAAgB,GAAyB,IAAiC,CAAC,GAAG;EAC3F,IAAMC,IAAiB/D,EAAa,IAAI;EAExC,IAAID,EAAYC,CAAY,GAAG;GAC7B,IAAMgE,IAAmB,MAAMnE,EAAe,oBAAoBG,CAAY;GAC9E,MAAM,QAAQ,IAAIgE,EAAiB,KAAK,MAAQF,EAAgBG,EAAInE,CAAG,GAAGoE,CAAO,CAAC,CAAC;EACrF;EAEA,IAAIC;EACJ,IAAI;GAEF,AADA,IAAU,MAAM7D,EAAM,QAAQ,OAAON,EAAa,OAAO,EAAE,QAAQ,SAAS,CAAC,GAC7E+C,EAA6BoB,GAAS,UAAU,EAAE,eAAe,GAAK,CAAC;EACzE,SAASb,GAAO;GACd,IAAI,CAACc,EAAed,CAAK,GACvB,MAAMA;EAEV;EAYA,OAVIY,EAAQ,qBACV,MAAMP,EAA6B3D,GAAckE,EAAQ,IAAI,GAG3DH,KACFzD,EAAM,cAAcyD,GAAgBvD,EAAG,IAAI,UAAU,GAAGR,GAAc+D,EAAe,IAAI,CAAC,GAG5FzD,EAAM,eAAeN,CAAY,GACjCM,EAAM,QAAQ,OAAON,EAAa,IAAI,CAAC,GAChCmE;CACT;CAEA,eAAeE,EAAmC,GAAyB,GAAyB;EAClG,MAAMP,EAAgB9D,GAAc;GAAE,mBAAmB;GAAM;EAAK,CAAC;CACvE;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
1
+ {"version":3,"file":"resourceLogic.esm.js","names":["mime","createResourceLogic","uploadFiles","getUploadError","uploadError","error","responseStatus","directStatus","status","message","ResourceUploadError","destUri","files","reader","data","event","suffix","contentType","file","extension","destination","resolve","response","createContainer","containerLogic","url","isContainer","resourceNode","getContainerMemberCount","getContainerMembers","getContainerIndexThing","folderUri","containerNode","store","containerHasIndexDocument","ns","isStorageRoot","isHiddenFile","directory","pathEnd","isMediaType","typeURIs","normalizedMediaType","mediaType","mediaTypePrefix","Util","typeURI","isImage","isAudio","isVideo","isWebId","uri","resource","parsed","readMetadata","canEdit","canManageAccess","isPublic","isPublicKnown","eTag","modified","accessFlags","readWacAccessInfo","subject","responseNode","req","responseContentType","wacAllow","responseETag","aclUri","ACL_LINK","fetchHeadMetadata","assertSuccessfulHttpResponse","userCanWriteToContainingContainer","userCanDeleteResource","fetchMetadata","fetchContentAndMetadata","content","metadata","fetchMetadataWithDelete","resourceMetadata","canDelete","access","deleteTypeIndexesForResource","user","typeIndexLogic","recursiveDelete","resourceParent","containerMembers","sym","options","deleted","isMissingError","log","deleteResourceAndTypeIndexIfExists"],"sources":["../../src/resource/resourceLogic.ts"],"sourcesContent":["import { NamedNode, sym, Util } from 'rdflib'\nimport { ACL_LINK } from '../acl/aclLogic'\nimport { ns } from '../util/ns'\nimport { assertSuccessfulHttpResponse, isMissingError } from './resourceHttp'\nimport { readWacAccessInfo } from './resourceMetadata'\nimport { ResourceUploadError, type ResourceAccess, type ResourceAccessWithDelete, type ResourceContent, type ResourceDeleteOptions, type ResourceLogic, type ResourceMetadata, type ResourceMetadataWithDelete, type ResourceUploadResult, type TypeIndexLogic } from '../types'\nimport type { AclLogic } from '../types'\nimport * as mime from 'mime-types'\nimport * as debug from '../util/debug'\n\nexport function createResourceLogic(store, aclLogic: AclLogic, containerLogic, typeIndexLogic: TypeIndexLogic): ResourceLogic {\n function uploadFiles (\n files: File[],\n destination: string\n ): Promise<ResourceUploadResult[]> {\n const getUploadError = (destUri: string | undefined, error: unknown) => {\n const uploadError = typeof error === 'object' && error !== null\n ? error as { response?: { status?: unknown }, status?: unknown, message?: unknown }\n : undefined\n const responseStatus = uploadError?.response?.status\n const directStatus = uploadError?.status\n const status = typeof responseStatus === 'number'\n ? responseStatus\n : typeof directStatus === 'number' ? directStatus : undefined\n const message = error instanceof Error\n ? error.message\n : typeof uploadError?.message === 'string'\n ? uploadError.message\n : typeof error === 'string' ? error : 'Upload failed'\n return new ResourceUploadError(message, destUri, status)\n }\n\n const upload = (file: File): Promise<ResourceUploadResult> => new Promise<ResourceUploadResult>(resolve => {\n const reader = new FileReader()\n reader.onload = event => {\n try {\n const data = event.target?.result\n if (!(data instanceof ArrayBuffer)) {\n resolve({ success: false, file, error: getUploadError(undefined, new Error('Unable to read file as an ArrayBuffer')) })\n return\n }\n\n let suffix = ''\n let contentType = file.type\n if (!contentType) {\n contentType = mime.lookup(file.name) || ''\n if (!contentType) {\n resolve({ success: false, file, error: getUploadError(undefined, new Error('Filename has no recognized content type')) })\n return\n }\n } else {\n const extension = mime.extension(file.type)\n if (extension && extension !== 'false' && !file.name.endsWith(`.${extension}`) && file.type !== mime.lookup(file.name)) {\n suffix = `_.${extension}`\n }\n }\n\n const destUri = `${destination}${destination.endsWith('/') ? '' : '/'}${encodeURIComponent(file.name)}${suffix}`\n\n store.fetcher.webOperation('PUT', destUri, { data, contentType }).then(\n response => resolve(response.ok\n ? { success: true, file, uploadedUri: destUri }\n : { success: false, file, error: new ResourceUploadError(`HTTP error on PUT! Status: ${response.status}`, destUri, response.status) }),\n error => resolve({ success: false, file, error: getUploadError(destUri, error) })\n )\n } catch (error) {\n resolve({ success: false, file, error: getUploadError(undefined, error) })\n }\n }\n reader.onerror = () => {\n resolve({ success: false, file, error: getUploadError(undefined, new Error('Unable to read file')) })\n }\n reader.onabort = () => {\n resolve({ success: false, file, error: getUploadError(undefined, new Error('File reading was aborted')) })\n }\n try {\n reader.readAsArrayBuffer(file)\n } catch (error) {\n resolve({ success: false, file, error: getUploadError(undefined, error) })\n }\n }).catch(error => ({\n success: false as const,\n file,\n error: getUploadError(undefined, error)\n }))\n\n return Promise.all(files.map(upload))\n }\n\n function createContainer(url: string) {\n return containerLogic.createContainer(url)\n }\n\n function isContainer(resourceNode: NamedNode) {\n return containerLogic.isContainer(resourceNode)\n }\n\n function getContainerMemberCount(resourceNode: NamedNode) {\n return containerLogic.getContainerMemberCount(resourceNode)\n }\n\n function getContainerMembers(resourceNode: NamedNode) {\n return containerLogic.getContainerElements(resourceNode)\n }\n\n function getContainerIndexThing(containerNode: NamedNode) {\n const folderUri = containerNode.uri.endsWith('/') ? containerNode.uri : `${containerNode.uri}/`\n return store.sym(`${folderUri}index.ttl#this`)\n }\n\n function containerHasIndexDocument(containerNode: NamedNode) {\n return store.holds(\n containerNode,\n ns.ldp('contains'),\n getContainerIndexThing(containerNode).doc()\n )\n }\n\n function isStorageRoot(resourceNode: NamedNode) {\n return store.holds(\n resourceNode,\n ns.rdf('type'),\n ns.space('Storage'),\n resourceNode.doc()\n )\n }\n\n function isHiddenFile(resourceNode: NamedNode) {\n const directory = resourceNode.dir()\n if (!directory) {\n return false\n }\n\n const pathEnd = resourceNode.uri.slice(directory.uri.length)\n return pathEnd.startsWith('.') || pathEnd.endsWith('.acl') || pathEnd.endsWith('.meta') || pathEnd.endsWith('~')\n }\n\n function isMediaType(resourceNode: NamedNode, mediaType: string) {\n const typeURIs = store.findTypeURIs(resourceNode as any)\n const normalizedMediaType = mediaType.toLowerCase()\n const mediaTypePrefix = Util.mediaTypeClass(`${normalizedMediaType}/*`).uri.split('*')[0]\n\n if (Object.keys(typeURIs).some(typeURI => typeURI.startsWith(mediaTypePrefix))) {\n return true\n }\n\n const mediaTypeClasses: Record<string, string> = {\n audio: 'http://purl.org/dc/dcmitype/Sound',\n image: 'http://purl.org/dc/dcmitype/Image',\n video: 'http://purl.org/dc/dcmitype/MovingImage'\n }\n if (mediaTypeClasses[normalizedMediaType] in typeURIs) {\n return true\n }\n\n const contentTypes = store.fetcher.getHeader(resourceNode, 'content-type') || []\n return contentTypes.some((contentType: string) =>\n contentType.split(';', 1)[0].trim().toLowerCase().startsWith(`${normalizedMediaType}/`)\n )\n }\n\n function isImage(resourceNode: NamedNode) {\n return isMediaType(resourceNode, 'image')\n }\n\n function isAudio(resourceNode: NamedNode) {\n return isMediaType(resourceNode, 'audio')\n }\n\n function isVideo(resourceNode: NamedNode) {\n return isMediaType(resourceNode, 'video')\n }\n\n function isWebId(resource: string | NamedNode) {\n const uri = typeof resource === 'string' ? resource : resource.value\n\n try {\n const parsed = new URL(uri)\n return parsed.hash === '#me' && /\\/profile\\/card\\.ttl$/.test(parsed.pathname)\n } catch (_error) {\n return false\n }\n }\n\n function readMetadata(subject: NamedNode, response: Response): ResourceMetadata {\n let contentType: string | undefined\n let canEdit = false\n let canManageAccess = false\n let isPublic = false\n let isPublicKnown = false\n let eTag: string | undefined\n let modified: string | undefined\n\n if (response.headers) {\n const contentTypeHeader = response.headers.get('content-type')\n contentType = contentTypeHeader?.split(';')[0] ?? undefined\n\n const accessFlags = readWacAccessInfo(response.headers.get('wac-allow'))\n canEdit = accessFlags.canEdit\n canManageAccess = accessFlags.canManageAccess\n isPublic = accessFlags.isPublic\n isPublicKnown = accessFlags.isPublicKnown\n eTag = response.headers.get('etag') ?? undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n\n if ((!response.headers || !response.headers.get('content-type')) && (!response.headers || !response.headers.get('wac-allow') || !response.headers.get('etag'))) {\n const reqs = store.each(\n null,\n store.sym('http://www.w3.org/2007/ont/link#requestedURI'),\n subject\n )\n reqs.map((req: any) => {\n const responseNode = store.any(\n req as any,\n store.sym('http://www.w3.org/2007/ont/link#response')\n )\n if (responseNode && responseNode.termType === 'NamedNode') {\n const responseContentType = store.anyValue(responseNode as any, ns.httph('content-type')) || undefined\n if (contentType === undefined) {\n contentType = responseContentType\n }\n const wacAllow = (store.anyValue(responseNode as any, ns.httph('wac-allow')) as string | undefined) ||\n (store.anyValue(responseNode as any, ns.httph('WAC-Allow')) as string | undefined)\n const accessFlags = readWacAccessInfo(wacAllow)\n canEdit = canEdit || accessFlags.canEdit\n canManageAccess = canManageAccess || accessFlags.canManageAccess\n isPublic = isPublic || accessFlags.isPublic\n isPublicKnown = isPublicKnown || accessFlags.isPublicKnown\n const responseETag = store.anyValue(responseNode as any, ns.httph('etag')) || undefined\n if (eTag === undefined) {\n eTag = responseETag\n }\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n })\n }\n\n const aclUri = store.any(subject, ACL_LINK)?.value || undefined\n const access: ResourceAccess = { canEdit, canManageAccess, isPublic, isPublicKnown }\n return { contentType, access, aclUri, eTag, modified }\n }\n\n async function fetchHeadMetadata(subject: NamedNode): Promise<ResourceMetadata> {\n const response = await store.fetcher.webOperation('HEAD', subject.uri)\n assertSuccessfulHttpResponse(response, 'HEAD')\n return readMetadata(subject, response)\n }\n\n async function userCanWriteToContainingContainer(resourceNode: NamedNode): Promise<boolean> {\n const containerNode = store.any(resourceNode, ns.ldp('contains')) || resourceNode.dir()\n if (!containerNode || containerNode.termType !== 'NamedNode') {\n return false\n }\n\n try {\n const containerMetadata = await fetchHeadMetadata(containerNode as NamedNode)\n return containerMetadata.access.canEdit\n } catch (_error) {\n return false\n }\n }\n\n async function userCanDeleteResource(resourceNode: NamedNode): Promise<boolean> {\n return userCanWriteToContainingContainer(resourceNode)\n }\n\n async function fetchMetadata(subject: NamedNode): Promise<ResourceMetadata> {\n return fetchHeadMetadata(subject)\n }\n\n async function fetchContentAndMetadata(subject: NamedNode): Promise<ResourceContent> {\n try {\n const response = await store.fetcher.webOperation('GET', subject.uri)\n assertSuccessfulHttpResponse(response, 'GET')\n\n const content = (response as Response & { responseText?: string }).responseText\n if (content === undefined) {\n throw new Error('No text in response object')\n }\n\n const metadata = readMetadata(subject, response)\n if (!metadata.contentType) {\n throw new Error('No content-type available')\n }\n\n return { content, metadata }\n } catch (error) {\n throw new Error(`Error reading file: ${error instanceof Error ? error.message : String(error)}`)\n }\n }\n\n async function fetchMetadataWithDelete(subject: NamedNode): Promise<ResourceMetadataWithDelete> {\n let resourceMetadata: ResourceMetadata\n\n try {\n resourceMetadata = await fetchHeadMetadata(subject)\n } catch (_error) {\n resourceMetadata = {\n contentType: undefined,\n access: { canEdit: false, canManageAccess: false, isPublic: false },\n aclUri: undefined,\n eTag: undefined,\n modified: undefined\n }\n }\n\n const canDelete = await userCanDeleteResource(subject)\n const access: ResourceAccessWithDelete = {\n canEdit: resourceMetadata.access?.canEdit ?? false,\n canManageAccess: resourceMetadata.access?.canManageAccess ?? false,\n isPublic: resourceMetadata.access?.isPublic ?? false,\n isPublicKnown: resourceMetadata.access?.isPublicKnown ?? false,\n canDelete\n }\n return { ...resourceMetadata, access }\n }\n\n async function deleteTypeIndexesForResource(resourceNode: NamedNode, user?: NamedNode | null) {\n if (!user) return\n\n try {\n await typeIndexLogic.deleteTypeIndexRegistrationForResource(resourceNode, user)\n } catch (_error) {\n // Keep resource deletion best-effort even if type-index cleanup fails.\n }\n }\n\n async function recursiveDelete(resourceNode: NamedNode, options: ResourceDeleteOptions = {}) {\n const resourceParent = resourceNode.dir()\n\n if (isContainer(resourceNode)) {\n const containerMembers = await containerLogic.getContainerMembers(resourceNode)\n await Promise.all(containerMembers.map((url) => recursiveDelete(sym(url), options)))\n }\n\n let deleted\n try {\n deleted = await store.fetcher._fetch(resourceNode.value, { method: 'DELETE' })\n assertSuccessfulHttpResponse(deleted, 'DELETE', { allowNotFound: true })\n } catch (error) {\n if (!isMissingError(error)) {\n throw error\n }\n }\n\n if (options.deleteTypeIndexes) {\n await deleteTypeIndexesForResource(resourceNode, options.user)\n }\n\n if (resourceParent) {\n store.removeMatches(resourceParent, ns.ldp('contains'), resourceNode)\n }\n\n store.removeDocument(resourceNode)\n store.fetcher.unload(resourceNode.doc())\n debug.log(`Deleted resource: ${resourceNode.value}`)\n return deleted\n }\n\n async function deleteResourceAndTypeIndexIfExists(resourceNode: NamedNode, user?: NamedNode | null) {\n await recursiveDelete(resourceNode, { deleteTypeIndexes: true, user })\n }\n\n return {\n uploadFiles,\n recursiveDelete,\n deleteResourceAndTypeIndexIfExists,\n fetchMetadata,\n fetchMetadataWithDelete,\n fetchContentAndMetadata,\n createContainer,\n isContainer,\n getContainerMembers,\n getContainerMemberCount,\n getContainerIndexThing,\n containerHasIndexDocument,\n isStorageRoot,\n isHiddenFile,\n isMediaType,\n isImage,\n isAudio,\n isVideo,\n isWebId\n }\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgBC,EAAoB,GAAO,GAAoB,GAAgB,GAA+C;CAC5H,SAASC,EACP,GACA,GACiC;EACjC,IAAMC,KAAkB,GAA6B,MAAmB;GACtE,IAAMC,IAAc,OAAOC,KAAU,YAAYA,IAC7CA,IACA,KAAA,GACEC,IAAiBF,GAAa,UAAU,QACxCG,IAAeH,GAAa,QAC5BI,IAAS,OAAOF,KAAmB,WACrCA,IACA,OAAOC,KAAiB,WAAWA,IAAe,KAAA,GAChDE,IAAUJ,aAAiB,QAC7BA,EAAM,UACN,OAAOD,GAAa,WAAY,WAC9BA,EAAY,UACZ,OAAOC,KAAU,WAAWA,IAAQ;GAC1C,OAAO,IAAIK,EAAoBD,GAASE,GAASH,CAAM;EACzD;EAwDA,OAAO,QAAQ,IAAII,EAAM,KAtDT,MAA8C,IAAI,SAA8B,MAAW;GACzG,IAAMC,IAAS,IAAI,WAAW;GAuC9B,AAtCA,EAAO,UAAS,MAAS;IACvB,IAAI;KACF,IAAMC,IAAOC,EAAM,QAAQ;KAC3B,IAAI,EAAED,aAAgB,cAAc;MAClC,EAAQ;OAAE,SAAS;OAAO;OAAM,OAAOX,EAAe,KAAA,GAAW,gBAAI,MAAM,uCAAuC,CAAC;MAAE,CAAC;MACtH;KACF;KAEA,IAAIa,IAAS,IACTC,IAAcC,EAAK;KACvB,IAAKD,GAME;MACL,IAAME,IAAYnB,EAAK,UAAUkB,EAAK,IAAI;MAC1C,AAAIC,KAAaA,MAAc,WAAW,CAACD,EAAK,KAAK,SAAS,IAAIC,GAAW,KAAKD,EAAK,SAASlB,EAAK,OAAOkB,EAAK,IAAI,MACnH,IAAS,KAAKC;KAElB,OATE,IADA,IAAcnB,EAAK,OAAOkB,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O;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"resourceMetadata.cjs.js","names":["parseWacAllowHeader","permissions","headerValue","entry","match","permissionGroup","accessModes","modes","mode","readWacAccessInfo","wacAllow","userModes","publicModes"],"sources":["../../src/resource/resourceMetadata.ts"],"sourcesContent":["function parseWacAllowHeader (headerValue: string | null | undefined) {\n const permissions = new Map<string, Set<string>>()\n if (!headerValue) return permissions\n\n for (const entry of headerValue.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) {\n const [, permissionGroup, accessModes] = match\n const modes = accessModes.trim().split(/\\s+/).filter(Boolean)\n permissions.set(permissionGroup.toLowerCase(), new Set(modes.map(mode => mode.toLowerCase())))\n }\n }\n\n return permissions\n}\n\nexport function readWacAccessInfo (wacAllow: string | null | undefined) {\n if (!wacAllow) {\n return { canEdit: false, canManageAccess: false, isPublic: false, isPublicKnown: false }\n }\n\n const permissions = parseWacAllowHeader(wacAllow)\n const userModes = permissions.get('user') ?? new Set<string>()\n const publicModes = permissions.get('public') ?? new Set<string>()\n\n return {\n canEdit: userModes.has('write'),\n canManageAccess: userModes.has('control'),\n isPublic: publicModes.has('read') || publicModes.has('write'),\n isPublicKnown: true\n }\n}\n"],"mappings":"AAAA,SAASA,EAAqB,EAAwC,CACpE,IAAMC,EAAc,IAAI,IACxB,GAAI,CAACC,EAAa,OAAOD,EAEzB,IAAK,IAAME,KAASD,EAAY,MAAM,GAAG,EAAG,CAC1C,IAAME,EAAQD,EAAM,KAAK,CAAC,CAAC,MAAM,+BAA+B,EAChE,GAAIC,EAAO,CACT,GAAM,EAAGC,EAAiBC,GAAeF,EACnCG,EAAQD,EAAY,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO,EAC5DL,EAAY,IAAII,EAAgB,YAAY,EAAG,IAAI,IAAIE,EAAM,IAAI,GAAQC,EAAK,YAAY,CAAC,CAAC,CAAC,CAC/F,CACF,CAEA,OAAOP,CACT,CAEA,SAAgBQ,EAAmB,EAAqC,CACtE,GAAI,CAACC,EACH,MAAO,CAAE,QAAS,GAAO,gBAAiB,GAAO,SAAU,GAAO,cAAe,EAAM,EAGzF,IAAMT,EAAcD,EAAoBU,CAAQ,EAC1CC,EAAYV,EAAY,IAAI,MAAM,GAAK,IAAI,IAC3CW,EAAcX,EAAY,IAAI,QAAQ,GAAK,IAAI,IAErD,MAAO,CACL,QAASU,EAAU,IAAI,OAAO,EAC9B,gBAAiBA,EAAU,IAAI,SAAS,EACxC,SAAUC,EAAY,IAAI,MAAM,GAAKA,EAAY,IAAI,OAAO,EAC5D,cAAe,EACjB,CACF"}
1
+ {"version":3,"file":"resourceMetadata.cjs.js","names":["parseWacAllowHeader","permissions","headerValue","entry","match","permissionGroup","accessModes","modes","mode","readWacAccessInfo","wacAllow","userModes","publicModes"],"sources":["../../src/resource/resourceMetadata.ts"],"sourcesContent":["function parseWacAllowHeader (headerValue: string | null | undefined) {\n const permissions = new Map<string, Set<string>>()\n if (!headerValue) return permissions\n\n for (const entry of headerValue.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) {\n const [, permissionGroup, accessModes] = match\n const modes = accessModes.trim().split(/\\s+/).filter(Boolean)\n permissions.set(permissionGroup.toLowerCase(), new Set(modes.map(mode => mode.toLowerCase())))\n }\n }\n\n return permissions\n}\n\nexport function readWacAccessInfo (wacAllow: string | null | undefined) {\n if (!wacAllow) {\n return { canEdit: false, canManageAccess: false, isPublic: false, isPublicKnown: false }\n }\n\n const permissions = parseWacAllowHeader(wacAllow)\n const userModes = permissions.get('user') ?? new Set<string>()\n const publicModes = permissions.get('public') ?? new Set<string>()\n\n return {\n canEdit: userModes.has('write'),\n canManageAccess: userModes.has('control'),\n isPublic: publicModes.has('read') || publicModes.has('write'),\n isPublicKnown: true\n }\n}\n"],"mappings":"AAAA,SAASA,EAAqB,EAAwC,CACpE,IAAMC,EAAc,IAAI,IACxB,GAAI,CAACC,EAAa,OAAOD,EAEzB,IAAK,IAAME,KAASD,EAAY,MAAM,GAAG,EAAG,CAC1C,IAAME,EAAQD,EAAM,KAAK,CAAC,CAAC,MAAM,+BAA+B,EAChE,GAAIC,EAAO,CACT,GAAM,EAAGC,EAAiBC,GAAeF,EACnCG,EAAQD,EAAY,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,OAAO,EAC5DL,EAAY,IAAII,EAAgB,YAAY,EAAG,IAAI,IAAIE,EAAM,IAAI,GAAQC,EAAK,YAAY,CAAC,CAAC,CAAC,CAC/F,CACF,CAEA,OAAOP,CACT,CAEA,SAAgBQ,EAAmB,EAAqC,CACtE,GAAI,CAACC,EACH,MAAO,CAAE,QAAS,GAAO,gBAAiB,GAAO,SAAU,GAAO,cAAe,EAAM,EAGzF,IAAMT,EAAcD,EAAoBU,CAAQ,EAC1CC,EAAYV,EAAY,IAAI,MAAM,GAAK,IAAI,IAC3CW,EAAcX,EAAY,IAAI,QAAQ,GAAK,IAAI,IAErD,MAAO,CACL,QAASU,EAAU,IAAI,OAAO,EAC9B,gBAAiBA,EAAU,IAAI,SAAS,EACxC,SAAUC,EAAY,IAAI,MAAM,GAAKA,EAAY,IAAI,OAAO,EAC5D,cAAe,EACjB,CACF,C"}
@@ -1,4 +1,4 @@
1
- //#region src/resource/resourceMetadata.ts
1
+ // src/resource/resourceMetadata.ts
2
2
  function e(e) {
3
3
  let t = /* @__PURE__ */ new Map();
4
4
  if (!e) return t;
@@ -26,7 +26,6 @@ function t(t) {
26
26
  isPublicKnown: !0
27
27
  };
28
28
  }
29
- //#endregion
30
29
  export { t as readWacAccessInfo };
31
30
 
32
31
  //# sourceMappingURL=resourceMetadata.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeIndexAclDocuments.cjs.js","names":["publicTypeIndexAclDocument","fileName","publicTypeIndexUri","webId"],"sources":["../../src/typeIndex/typeIndexAclDocuments.ts"],"sourcesContent":["export function publicTypeIndexAclDocument(webId: string, publicTypeIndexUri: string): string {\n const fileName = new URL(publicTypeIndexUri).pathname.split('/').pop() || 'publicTypeIndex.ttl'\n return [\n '# ACL resource for the Public Type Index',\n '',\n '@prefix acl: <http://www.w3.org/ns/auth/acl#>.',\n '@prefix foaf: <http://xmlns.com/foaf/0.1/>.',\n '',\n '<#owner>',\n ' a acl:Authorization;',\n '',\n ' acl:agent',\n ` <${webId}>;`,\n '',\n ` acl:accessTo <./${fileName}>;`,\n '',\n ' acl:mode',\n ' acl:Read, acl:Write, acl:Control.',\n '',\n '# Public-readable',\n '<#public>',\n ' a acl:Authorization;',\n '',\n ' acl:agentClass foaf:Agent;',\n '',\n ` acl:accessTo <./${fileName}>;`,\n '',\n ' acl:mode acl:Read.'\n ].join('\\n')\n}\n"],"mappings":"AAAA,SAAgBA,EAA2B,EAAe,EAAoC,CAC1F,IAAMC,EAAW,IAAI,IAAIC,CAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,GAAK,sBAC1E,MAAO,CACH,2CACA,GACA,iDACA,8CACA,GACA,WACA,2BACA,GACA,gBACA,YAAYC,EAAM,IAClB,GACA,uBAAuBF,EAAS,IAChC,GACA,eACA,4CACA,GACA,oBACA,YACA,2BACA,GACA,iCACA,GACA,uBAAuBA,EAAS,IAChC,GACA,wBACJ,CAAC,CAAC,KAAK;CAAI,CACf"}
1
+ {"version":3,"file":"typeIndexAclDocuments.cjs.js","names":["publicTypeIndexAclDocument","fileName","publicTypeIndexUri","webId"],"sources":["../../src/typeIndex/typeIndexAclDocuments.ts"],"sourcesContent":["export function publicTypeIndexAclDocument(webId: string, publicTypeIndexUri: string): string {\n const fileName = new URL(publicTypeIndexUri).pathname.split('/').pop() || 'publicTypeIndex.ttl'\n return [\n '# ACL resource for the Public Type Index',\n '',\n '@prefix acl: <http://www.w3.org/ns/auth/acl#>.',\n '@prefix foaf: <http://xmlns.com/foaf/0.1/>.',\n '',\n '<#owner>',\n ' a acl:Authorization;',\n '',\n ' acl:agent',\n ` <${webId}>;`,\n '',\n ` acl:accessTo <./${fileName}>;`,\n '',\n ' acl:mode',\n ' acl:Read, acl:Write, acl:Control.',\n '',\n '# Public-readable',\n '<#public>',\n ' a acl:Authorization;',\n '',\n ' acl:agentClass foaf:Agent;',\n '',\n ` acl:accessTo <./${fileName}>;`,\n '',\n ' acl:mode acl:Read.'\n ].join('\\n')\n}\n"],"mappings":"AAAA,SAAgBA,EAA2B,EAAe,EAAoC,CAC1F,IAAMC,EAAW,IAAI,IAAIC,CAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,IAAI,GAAK,sBAC1E,MAAO,CACH,2CACA,GACA,iDACA,8CACA,GACA,WACA,2BACA,GACA,gBACA,YAAYC,EAAM,IAClB,GACA,uBAAuBF,EAAS,IAChC,GACA,eACA,4CACA,GACA,oBACA,YACA,2BACA,GACA,iCACA,GACA,uBAAuBA,EAAS,IAChC,GACA,wBACJ,CAAC,CAAC,KAAK;CAAI,CACf,C"}
@@ -1,4 +1,4 @@
1
- //#region src/typeIndex/typeIndexAclDocuments.ts
1
+ // src/typeIndex/typeIndexAclDocuments.ts
2
2
  function e(e, t) {
3
3
  let n = new URL(t).pathname.split("/").pop() || "publicTypeIndex.ttl";
4
4
  return [
@@ -29,7 +29,6 @@ function e(e, t) {
29
29
  " acl:mode acl:Read."
30
30
  ].join("\n");
31
31
  }
32
- //#endregion
33
32
  export { e as publicTypeIndexAclDocument };
34
33
 
35
34
  //# sourceMappingURL=typeIndexAclDocuments.esm.js.map
@@ -1,4 +1,8 @@
1
- function e(){return[`@prefix solid: <http://www.w3.org/ns/solid/terms#>.`,`<>`,` a solid:TypeIndex ;`,` a solid:ListedDocument.`].join(`
2
- `)}function t(){return[`@prefix solid: <http://www.w3.org/ns/solid/terms#>.`,`<>`,` a solid:TypeIndex ;`,` a solid:UnlistedDocument.`].join(`
3
- `)}exports.privateTypeIndexDocument=t,exports.publicTypeIndexDocument=e;
1
+ function e(){return`@prefix solid: <http://www.w3.org/ns/solid/terms#>.
2
+ <>
3
+ a solid:TypeIndex ;
4
+ a solid:ListedDocument.`}function t(){return`@prefix solid: <http://www.w3.org/ns/solid/terms#>.
5
+ <>
6
+ a solid:TypeIndex ;
7
+ a solid:UnlistedDocument.`}exports.privateTypeIndexDocument=t,exports.publicTypeIndexDocument=e;
4
8
  //# sourceMappingURL=typeIndexDocuments.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeIndexDocuments.cjs.js","names":["publicTypeIndexDocument","privateTypeIndexDocument"],"sources":["../../src/typeIndex/typeIndexDocuments.ts"],"sourcesContent":["export function publicTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:ListedDocument.'\n ].join('\\n')\n}\n\nexport function privateTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:UnlistedDocument.'\n ].join('\\n')\n}"],"mappings":"AAAA,SAAgBA,GAAkC,CAC9C,MAAO,CACH,sDACA,KACA,0BACA,6BACJ,CAAC,CAAC,KAAK;CAAI,CACf,CAEA,SAAgBC,GAAmC,CAC/C,MAAO,CACH,sDACA,KACA,0BACA,+BACJ,CAAC,CAAC,KAAK;CAAI,CACf"}
1
+ {"version":3,"file":"typeIndexDocuments.cjs.js","names":["publicTypeIndexDocument","privateTypeIndexDocument"],"sources":["../../src/typeIndex/typeIndexDocuments.ts"],"sourcesContent":["export function publicTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:ListedDocument.'\n ].join('\\n')\n}\n\nexport function privateTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:UnlistedDocument.'\n ].join('\\n')\n}"],"mappings":"AAAA,SAAgBA,GAAkC,CAC9C,MAAO;;;4BAMX,CAEA,SAAgBC,GAAmC,CAC/C,MAAO;;;8BAMX,C"}
@@ -1,21 +1,10 @@
1
- //#region src/typeIndex/typeIndexDocuments.ts
1
+ // src/typeIndex/typeIndexDocuments.ts
2
2
  function e() {
3
- return [
4
- "@prefix solid: <http://www.w3.org/ns/solid/terms#>.",
5
- "<>",
6
- " a solid:TypeIndex ;",
7
- " a solid:ListedDocument."
8
- ].join("\n");
3
+ return "@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n<>\n a solid:TypeIndex ;\n a solid:ListedDocument.";
9
4
  }
10
5
  function t() {
11
- return [
12
- "@prefix solid: <http://www.w3.org/ns/solid/terms#>.",
13
- "<>",
14
- " a solid:TypeIndex ;",
15
- " a solid:UnlistedDocument."
16
- ].join("\n");
6
+ return "@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n<>\n a solid:TypeIndex ;\n a solid:UnlistedDocument.";
17
7
  }
18
- //#endregion
19
8
  export { t as privateTypeIndexDocument, e as publicTypeIndexDocument };
20
9
 
21
10
  //# sourceMappingURL=typeIndexDocuments.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeIndexDocuments.esm.js","names":["publicTypeIndexDocument","privateTypeIndexDocument"],"sources":["../../src/typeIndex/typeIndexDocuments.ts"],"sourcesContent":["export function publicTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:ListedDocument.'\n ].join('\\n')\n}\n\nexport function privateTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:UnlistedDocument.'\n ].join('\\n')\n}"],"mappings":";AAAA,SAAgBA,IAAkC;CAC9C,OAAO;EACH;EACA;EACA;EACA;CACJ,CAAC,CAAC,KAAK,IAAI;AACf;AAEA,SAAgBC,IAAmC;CAC/C,OAAO;EACH;EACA;EACA;EACA;CACJ,CAAC,CAAC,KAAK,IAAI;AACf"}
1
+ {"version":3,"file":"typeIndexDocuments.esm.js","names":["publicTypeIndexDocument","privateTypeIndexDocument"],"sources":["../../src/typeIndex/typeIndexDocuments.ts"],"sourcesContent":["export function publicTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:ListedDocument.'\n ].join('\\n')\n}\n\nexport function privateTypeIndexDocument(): string {\n return [\n '@prefix solid: <http://www.w3.org/ns/solid/terms#>.',\n '<>',\n ' a solid:TypeIndex ;',\n ' a solid:UnlistedDocument.'\n ].join('\\n')\n}"],"mappings":";AAAA,SAAgBA,IAAkC;CAC9C,OAAO;AAMX;AAEA,SAAgBC,IAAmC;CAC/C,OAAO;AAMX"}