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.
- package/dist/acl/accessControlSubjects.cjs.js +1 -1
- package/dist/acl/accessControlSubjects.cjs.js.map +1 -1
- package/dist/acl/accessControlSubjects.esm.js +16 -17
- package/dist/acl/aclLogic.cjs.js.map +1 -1
- package/dist/acl/aclLogic.esm.js +1 -2
- package/dist/authSession/authSession.cjs.js.map +1 -1
- package/dist/authSession/authSession.esm.js +1 -2
- package/dist/authSession/events.cjs.js.map +1 -1
- package/dist/authSession/events.esm.js +1 -2
- package/dist/authSession/flagAuthorizationOnTransitions.cjs.js.map +1 -1
- package/dist/authSession/flagAuthorizationOnTransitions.esm.js +1 -2
- package/dist/authSession/identityState.cjs.js.map +1 -1
- package/dist/authSession/identityState.esm.js +1 -2
- package/dist/authSession/issuer.cjs.js.map +1 -1
- package/dist/authSession/issuer.esm.js +1 -2
- package/dist/authSession/session.cjs.js +1 -1
- package/dist/authSession/session.cjs.js.map +1 -1
- package/dist/authSession/session.esm.js +2 -3
- package/dist/authSession/session.esm.js.map +1 -1
- package/dist/authn/SolidAuthnLogic.cjs.js +1 -1
- package/dist/authn/SolidAuthnLogic.cjs.js.map +1 -1
- package/dist/authn/SolidAuthnLogic.esm.js +41 -42
- package/dist/authn/authUtil.cjs.js.map +1 -1
- package/dist/authn/authUtil.esm.js +1 -2
- package/dist/authn/serverLogout.cjs.js.map +1 -1
- package/dist/authn/serverLogout.esm.js +1 -2
- package/dist/chat/chatLogic.cjs.js.map +1 -1
- package/dist/chat/chatLogic.esm.js +1 -2
- package/dist/directory/catalogDirectory.cjs.js +1 -1
- package/dist/directory/catalogDirectory.cjs.js.map +1 -1
- package/dist/directory/catalogDirectory.esm.js +15 -16
- package/dist/directory/contactsDirectory.cjs.js.map +1 -1
- package/dist/directory/contactsDirectory.esm.js +1 -2
- package/dist/directory/directoryHelpers.cjs.js.map +1 -1
- package/dist/directory/directoryHelpers.esm.js +1 -2
- package/dist/directory/directoryLogic.cjs.js +1 -1
- package/dist/directory/directoryLogic.cjs.js.map +1 -1
- package/dist/directory/directoryLogic.esm.js +14 -15
- package/dist/directory/friendsDirectory.cjs.js.map +1 -1
- package/dist/directory/friendsDirectory.esm.js +1 -2
- package/dist/inbox/inboxLogic.cjs.js.map +1 -1
- package/dist/inbox/inboxLogic.esm.js +1 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +11 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/issuer/issuerLogic.cjs.js.map +1 -1
- package/dist/issuer/issuerLogic.esm.js +1 -2
- package/dist/logic/CustomError.cjs.js.map +1 -1
- package/dist/logic/CustomError.esm.js +1 -2
- package/dist/logic/solidLogic.cjs.js +1 -1
- package/dist/logic/solidLogic.cjs.js.map +1 -1
- package/dist/logic/solidLogic.esm.js +17 -18
- package/dist/logic/solidLogicSingleton.cjs.js +1 -1
- package/dist/logic/solidLogicSingleton.cjs.js.map +1 -1
- package/dist/logic/solidLogicSingleton.esm.js +6 -7
- package/dist/profile/profileAclDocuments.cjs.js.map +1 -1
- package/dist/profile/profileAclDocuments.esm.js +1 -2
- package/dist/profile/profileDocuments.cjs.js +6 -2
- package/dist/profile/profileDocuments.cjs.js.map +1 -1
- package/dist/profile/profileDocuments.esm.js +2 -10
- package/dist/profile/profileDocuments.esm.js.map +1 -1
- package/dist/profile/profileLogic.cjs.js +1 -1
- package/dist/profile/profileLogic.cjs.js.map +1 -1
- package/dist/profile/profileLogic.esm.js +47 -48
- package/dist/resource/resourceHttp.cjs.js.map +1 -1
- package/dist/resource/resourceHttp.esm.js +1 -2
- package/dist/resource/resourceLogic.cjs.js +1 -1
- package/dist/resource/resourceLogic.cjs.js.map +1 -1
- package/dist/resource/resourceLogic.d.ts.map +1 -1
- package/dist/resource/resourceLogic.esm.js +179 -94
- package/dist/resource/resourceLogic.esm.js.map +1 -1
- package/dist/resource/resourceMetadata.cjs.js.map +1 -1
- package/dist/resource/resourceMetadata.esm.js +1 -2
- package/dist/typeIndex/typeIndexAclDocuments.cjs.js.map +1 -1
- package/dist/typeIndex/typeIndexAclDocuments.esm.js +1 -2
- package/dist/typeIndex/typeIndexDocuments.cjs.js +7 -3
- package/dist/typeIndex/typeIndexDocuments.cjs.js.map +1 -1
- package/dist/typeIndex/typeIndexDocuments.esm.js +3 -14
- package/dist/typeIndex/typeIndexDocuments.esm.js.map +1 -1
- package/dist/typeIndex/typeIndexLogic.cjs.js.map +1 -1
- package/dist/typeIndex/typeIndexLogic.esm.js +1 -2
- package/dist/types.cjs.js +2 -0
- package/dist/types.cjs.js.map +1 -0
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.esm.js +9 -0
- package/dist/types.esm.js.map +1 -0
- package/dist/util/containerLogic.cjs.js.map +1 -1
- package/dist/util/containerLogic.esm.js +1 -2
- package/dist/util/debug.cjs.js.map +1 -1
- package/dist/util/debug.esm.js +1 -2
- package/dist/util/ns.cjs.js.map +1 -1
- package/dist/util/ns.esm.js +1 -2
- package/dist/util/utilityLogic.cjs.js +1 -1
- package/dist/util/utilityLogic.cjs.js.map +1 -1
- package/dist/util/utilityLogic.esm.js +42 -43
- package/dist/util/utils.cjs.js.map +1 -1
- package/dist/util/utils.esm.js +1 -2
- package/package.json +11 -11
|
@@ -1,56 +1,141 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
12
|
-
return
|
|
93
|
+
function h(e) {
|
|
94
|
+
return f.createContainer(e);
|
|
13
95
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
96
|
+
function g(e) {
|
|
97
|
+
return f.isContainer(e);
|
|
16
98
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
99
|
+
function _(e) {
|
|
100
|
+
return f.getContainerMemberCount(e);
|
|
19
101
|
}
|
|
20
|
-
function
|
|
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
|
|
107
|
+
return u.sym(`${t}index.ttl#this`);
|
|
23
108
|
}
|
|
24
|
-
function
|
|
25
|
-
return
|
|
109
|
+
function b(e) {
|
|
110
|
+
return u.holds(e, t.ldp("contains"), y(e).doc());
|
|
26
111
|
}
|
|
27
|
-
function
|
|
28
|
-
return
|
|
112
|
+
function x(e) {
|
|
113
|
+
return u.holds(e, t.rdf("type"), t.space("Storage"), e.doc());
|
|
29
114
|
}
|
|
30
|
-
function
|
|
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
|
|
37
|
-
let n =
|
|
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 : (
|
|
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
|
|
45
|
-
return
|
|
129
|
+
function w(e) {
|
|
130
|
+
return C(e, "image");
|
|
46
131
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
132
|
+
function T(e) {
|
|
133
|
+
return C(e, "audio");
|
|
49
134
|
}
|
|
50
|
-
function
|
|
51
|
-
return
|
|
135
|
+
function E(e) {
|
|
136
|
+
return C(e, "video");
|
|
52
137
|
}
|
|
53
|
-
function
|
|
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
|
|
63
|
-
let a, o = !1,
|
|
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
|
|
67
|
-
o =
|
|
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
|
-
|
|
70
|
-
let r =
|
|
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
|
|
73
|
-
a === void 0 && (a =
|
|
74
|
-
let p =
|
|
75
|
-
o ||= m.canEdit,
|
|
76
|
-
let h =
|
|
77
|
-
d === void 0 && (d = h), f =
|
|
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 =
|
|
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:
|
|
86
|
-
isPublic:
|
|
87
|
-
isPublicKnown:
|
|
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
|
|
95
|
-
let t = await
|
|
96
|
-
return n(t, "HEAD"),
|
|
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
|
|
99
|
-
let n =
|
|
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
|
|
187
|
+
return (await k(n)).access.canEdit;
|
|
103
188
|
} catch {
|
|
104
189
|
return !1;
|
|
105
190
|
}
|
|
106
191
|
}
|
|
107
|
-
async function
|
|
108
|
-
return
|
|
192
|
+
async function j(e) {
|
|
193
|
+
return A(e);
|
|
109
194
|
}
|
|
110
|
-
async function
|
|
111
|
-
return
|
|
195
|
+
async function M(e) {
|
|
196
|
+
return k(e);
|
|
112
197
|
}
|
|
113
|
-
async function
|
|
198
|
+
async function N(e) {
|
|
114
199
|
try {
|
|
115
|
-
let t = await
|
|
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 =
|
|
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
|
|
214
|
+
async function P(e) {
|
|
130
215
|
let t;
|
|
131
216
|
try {
|
|
132
|
-
t = await
|
|
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
|
|
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
|
|
243
|
+
async function F(e, t) {
|
|
159
244
|
if (t) try {
|
|
160
|
-
await
|
|
245
|
+
await p.deleteTypeIndexRegistrationForResource(e, t);
|
|
161
246
|
} catch {}
|
|
162
247
|
}
|
|
163
|
-
async function
|
|
164
|
-
let a =
|
|
165
|
-
if (
|
|
166
|
-
let
|
|
167
|
-
await Promise.all(
|
|
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
|
|
254
|
+
let s;
|
|
170
255
|
try {
|
|
171
|
-
|
|
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
|
|
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
|
|
178
|
-
await
|
|
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
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
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,GAA0B;EACxD,IAAMC,IAAYC,EAAc,IAAI,SAAS,GAAG,IAAIA,EAAc,MAAM,GAAGA,EAAc,IAAI;EAC7F,OAAOC,EAAM,IAAI,GAAGF,EAAU,eAAe;CAC/C;CAEA,SAASG,EAA0B,GAA0B;EAC3D,OAAOD,EAAM,MACXD,GACAG,EAAG,IAAI,UAAU,GACjBL,EAAuBE,CAAa,CAAC,CAAC,IAAI,CAC5C;CACF;CAEA,SAASI,EAAc,GAAyB;EAC9C,OAAOH,EAAM,MACXN,GACAQ,EAAG,IAAI,MAAM,GACbA,EAAG,MAAM,SAAS,GAClBR,EAAa,IAAI,CACnB;CACF;CAEA,SAASU,EAAa,GAAyB;EAC7C,IAAMC,IAAYX,EAAa,IAAI;EACnC,IAAI,CAACW,GACH,OAAO;EAGT,IAAMC,IAAUZ,EAAa,IAAI,MAAMW,EAAU,I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,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,WA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,MAAM,QAAQ,IAAI6D,EAAiB,KAAK,MAAQF,EAAgBG,EAAIhE,CAAG,GAAGiE,CAAO,CAAC,CAAC;EACrF;EAEA,IAAIC;EACJ,IAAI;GAEF,AADA,IAAU,MAAM1D,EAAM,QAAQ,OAAON,EAAa,OAAO,EAAE,QAAQ,SAAS,CAAC,GAC7E6C,EAA6BmB,GAAS,UAAU,EAAE,eAAe,GAAK,CAAC;EACzE,SAAStF,GAAO;GACd,IAAI,CAACuF,EAAevF,CAAK,GACvB,MAAMA;EAEV;EAaA,OAXIqF,EAAQ,qBACV,MAAMP,EAA6BxD,GAAc+D,EAAQ,IAAI,GAG3DH,KACFtD,EAAM,cAAcsD,GAAgBpD,EAAG,IAAI,UAAU,GAAGR,CAAY,GAGtEM,EAAM,eAAeN,CAAY,GACjCM,EAAM,QAAQ,OAAON,EAAa,IAAI,CAAC,GACvCkE,EAAU,qBAAqBlE,EAAa,OAAO,GAC5CgE;CACT;CAEA,eAAeG,EAAmC,GAAyB,GAAyB;EAClG,MAAMR,EAAgB3D,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;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
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
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,
|
|
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
|
-
|
|
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;
|
|
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"}
|