solid-logic 1.3.13-c2b08ef1 → 1.3.13-c448e6a9
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/.github/workflows/ci.yml +19 -21
- package/jest.config.js +1 -4
- package/jest.setup.ts +2 -0
- package/lib/authn/NoAuthnLogic.d.ts +9 -0
- package/lib/authn/NoAuthnLogic.d.ts.map +1 -0
- package/lib/authn/NoAuthnLogic.js +17 -0
- package/lib/authn/NoAuthnLogic.js.map +1 -0
- package/lib/authn/SolidAuthnLogic.d.ts +6 -26
- package/lib/authn/SolidAuthnLogic.d.ts.map +1 -1
- package/lib/authn/SolidAuthnLogic.js +5 -161
- package/lib/authn/SolidAuthnLogic.js.map +1 -1
- package/lib/authn/index.d.ts +5 -0
- package/lib/authn/index.d.ts.map +1 -0
- package/lib/{types.js → authn/index.js} +1 -1
- package/lib/authn/index.js.map +1 -0
- package/lib/chat/ChatLogic.d.ts +2 -2
- package/lib/chat/ChatLogic.d.ts.map +1 -1
- package/lib/chat/ChatLogic.js +2 -2
- package/lib/chat/ChatLogic.js.map +1 -1
- package/lib/chat/integration.test.d.ts +2 -0
- package/lib/chat/integration.test.d.ts.map +1 -0
- package/lib/chat/integration.test.js +318 -0
- package/lib/chat/integration.test.js.map +1 -0
- package/lib/{util/debug.d.ts → debug.d.ts} +0 -0
- package/lib/debug.d.ts.map +1 -0
- package/lib/{util/debug.js → debug.js} +0 -0
- package/lib/debug.js.map +1 -0
- package/lib/inbox/InboxLogic.d.ts +2 -2
- package/lib/inbox/InboxLogic.d.ts.map +1 -1
- package/lib/inbox/InboxLogic.js.map +1 -1
- package/lib/inbox/unit.test.d.ts +2 -0
- package/lib/inbox/unit.test.d.ts.map +1 -0
- package/lib/inbox/unit.test.js +264 -0
- package/lib/inbox/unit.test.js.map +1 -0
- package/lib/index.d.ts +67 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +385 -31
- package/lib/index.js.map +1 -1
- package/lib/profile/ProfileLogic.d.ts +3 -2
- package/lib/profile/ProfileLogic.d.ts.map +1 -1
- package/lib/profile/ProfileLogic.js.map +1 -1
- package/lib/{util/uri.d.ts → uri.d.ts} +0 -0
- package/lib/uri.d.ts.map +1 -0
- package/lib/{util/uri.js → uri.js} +0 -0
- package/lib/uri.js.map +1 -0
- package/lib/util/UtilityLogic.d.ts +2 -2
- package/lib/util/UtilityLogic.d.ts.map +1 -1
- package/lib/util/UtilityLogic.js.map +1 -1
- package/lib/util/unit.test.d.ts +2 -0
- package/lib/util/unit.test.d.ts.map +1 -0
- package/lib/util/unit.test.js +200 -0
- package/lib/util/unit.test.js.map +1 -0
- package/package.json +2 -4
- package/src/authn/NoAuthnLogic.ts +16 -0
- package/src/authn/SolidAuthnLogic.ts +10 -112
- package/src/authn/index.ts +5 -0
- package/src/chat/ChatLogic.ts +4 -4
- package/{test/chatLogic.test.ts → src/chat/integration.test.ts} +8 -8
- package/src/{util/debug.ts → debug.ts} +0 -0
- package/src/inbox/InboxLogic.ts +14 -2
- package/{test/inboxLogic.test.ts → src/inbox/unit.test.ts} +6 -5
- package/src/index.ts +310 -18
- package/src/profile/ProfileLogic.ts +3 -2
- package/src/{util/uri.ts → uri.ts} +0 -0
- package/src/util/UtilityLogic.ts +14 -2
- package/{test/utilityLogic.test.ts → src/util/unit.test.ts} +4 -3
- package/lib/acl/aclLogic.d.ts +0 -32
- package/lib/acl/aclLogic.d.ts.map +0 -1
- package/lib/acl/aclLogic.js +0 -132
- package/lib/acl/aclLogic.js.map +0 -1
- package/lib/authSession/authSession.d.ts +0 -4
- package/lib/authSession/authSession.d.ts.map +0 -1
- package/lib/authSession/authSession.js +0 -18
- package/lib/authSession/authSession.js.map +0 -1
- package/lib/authn/authUtil.d.ts +0 -17
- package/lib/authn/authUtil.d.ts.map +0 -1
- package/lib/authn/authUtil.js +0 -88
- package/lib/authn/authUtil.js.map +0 -1
- package/lib/issuer/issuerLogic.d.ts +0 -8
- package/lib/issuer/issuerLogic.d.ts.map +0 -1
- package/lib/issuer/issuerLogic.js +0 -53
- package/lib/issuer/issuerLogic.js.map +0 -1
- package/lib/logic/CustomError.d.ts +0 -17
- package/lib/logic/CustomError.d.ts.map +0 -1
- package/lib/logic/CustomError.js +0 -73
- package/lib/logic/CustomError.js.map +0 -1
- package/lib/logic/SolidLogic.d.ts +0 -49
- package/lib/logic/SolidLogic.d.ts.map +0 -1
- package/lib/logic/SolidLogic.js +0 -316
- package/lib/logic/SolidLogic.js.map +0 -1
- package/lib/logic/solidLogicSingleton.d.ts +0 -8
- package/lib/logic/solidLogicSingleton.d.ts.map +0 -1
- package/lib/logic/solidLogicSingleton.js +0 -88
- package/lib/logic/solidLogicSingleton.js.map +0 -1
- package/lib/typeIndex/typeIndexLogic.d.ts +0 -22
- package/lib/typeIndex/typeIndexLogic.d.ts.map +0 -1
- package/lib/typeIndex/typeIndexLogic.js +0 -302
- package/lib/typeIndex/typeIndexLogic.js.map +0 -1
- package/lib/types.d.ts +0 -29
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/util/debug.d.ts.map +0 -1
- package/lib/util/debug.js.map +0 -1
- package/lib/util/uri.d.ts.map +0 -1
- package/lib/util/uri.js.map +0 -1
- package/src/acl/aclLogic.ts +0 -137
- package/src/authSession/authSession.ts +0 -22
- package/src/authn/authUtil.ts +0 -67
- package/src/issuer/issuerLogic.ts +0 -40
- package/src/logic/CustomError.ts +0 -25
- package/src/logic/SolidLogic.ts +0 -264
- package/src/logic/solidLogicSingleton.ts +0 -24
- package/src/typeIndex/typeIndexLogic.ts +0 -170
- package/src/types.ts +0 -41
- package/test/aclLogic.test.ts +0 -15
- package/test/authUtil.test.ts +0 -19
- package/test/helpers/setup.ts +0 -13
- package/test/logic.test.ts +0 -28
- package/test/solidAuthLogic.test.ts +0 -45
- package/test/typeIndexLogic.test.ts +0 -26
package/src/index.ts
CHANGED
|
@@ -1,18 +1,310 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { Session } from "@inrupt/solid-client-authn-browser";
|
|
2
|
+
import * as rdf from "rdflib";
|
|
3
|
+
import { Fetcher, NamedNode, Statement, Store, UpdateManager } from "rdflib";
|
|
4
|
+
import solidNamespace from "solid-namespace";
|
|
5
|
+
import { AuthnLogic } from "./authn";
|
|
6
|
+
import { NoAuthnLogic } from "./authn/NoAuthnLogic";
|
|
7
|
+
import { SolidAuthnLogic } from "./authn/SolidAuthnLogic";
|
|
8
|
+
|
|
9
|
+
import { ChatLogic } from "./chat/ChatLogic";
|
|
10
|
+
import * as debug from "./debug";
|
|
11
|
+
import { ProfileLogic } from "./profile/ProfileLogic";
|
|
12
|
+
import { UtilityLogic } from "./util/UtilityLogic";
|
|
13
|
+
import { ConnectedStore, LiveStore } from 'rdflib'
|
|
14
|
+
|
|
15
|
+
export { ACL_LINK } from './util/UtilityLogic';
|
|
16
|
+
|
|
17
|
+
const ns: SolidNamespace = solidNamespace(rdf);
|
|
18
|
+
|
|
19
|
+
/* interface ConnectedStore extends Store {
|
|
20
|
+
fetcher: Fetcher;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface LiveStore extends ConnectedStore {
|
|
24
|
+
updater: UpdateManager;
|
|
25
|
+
} */
|
|
26
|
+
|
|
27
|
+
export interface SolidNamespace {
|
|
28
|
+
[key: string]: (term: string) => NamedNode;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class SolidLogic {
|
|
32
|
+
cache: {
|
|
33
|
+
profileDocument: {
|
|
34
|
+
[WebID: string]: NamedNode;
|
|
35
|
+
};
|
|
36
|
+
preferencesFile: {
|
|
37
|
+
[WebID: string]: NamedNode;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
store: LiveStore;
|
|
42
|
+
me: string | undefined;
|
|
43
|
+
fetcher: { fetch: (url: string, options?: any) => any };
|
|
44
|
+
|
|
45
|
+
chat: ChatLogic;
|
|
46
|
+
profile: ProfileLogic;
|
|
47
|
+
authn: AuthnLogic;
|
|
48
|
+
util: UtilityLogic;
|
|
49
|
+
|
|
50
|
+
constructor(fetcher: { fetch: (url: any, requestInit: any) => any }, solidAuthSession: Session) {
|
|
51
|
+
this.store = rdf.graph() as LiveStore; // Make a Quad store
|
|
52
|
+
rdf.fetcher(this.store, fetcher); // Attach a web I/O module, store.fetcher
|
|
53
|
+
this.store.updater = new rdf.UpdateManager(this.store); // Add real-time live updates store.updater
|
|
54
|
+
this.store.features = [] // disable automatic node merging on store load
|
|
55
|
+
|
|
56
|
+
this.cache = {
|
|
57
|
+
profileDocument: {},
|
|
58
|
+
preferencesFile: {},
|
|
59
|
+
};
|
|
60
|
+
this.fetcher = fetcher;
|
|
61
|
+
if (solidAuthSession) {
|
|
62
|
+
this.authn = new SolidAuthnLogic(solidAuthSession);
|
|
63
|
+
} else {
|
|
64
|
+
this.authn = new NoAuthnLogic();
|
|
65
|
+
}
|
|
66
|
+
this.profile = new ProfileLogic(this.store, ns, this.authn);
|
|
67
|
+
this.chat = new ChatLogic(this.store, ns, this.profile);
|
|
68
|
+
this.util = new UtilityLogic(this.store, ns, this.fetcher);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
findAclDocUrl(url: string) {
|
|
72
|
+
return this.util.findAclDocUrl(url);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
loadDoc(doc: NamedNode): Promise<void> {
|
|
76
|
+
return this.util.loadDoc(doc);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async loadProfile(me: NamedNode): Promise<NamedNode> {
|
|
80
|
+
// console.log('loadProfile', me)
|
|
81
|
+
if (this.cache.profileDocument[me.value]) {
|
|
82
|
+
return this.cache.profileDocument[me.value];
|
|
83
|
+
}
|
|
84
|
+
let profileDocument;
|
|
85
|
+
try {
|
|
86
|
+
profileDocument = me.doc();
|
|
87
|
+
await this.loadDoc(profileDocument);
|
|
88
|
+
return profileDocument;
|
|
89
|
+
} catch (err) {
|
|
90
|
+
const message = `Logged in but cannot load profile ${profileDocument} : ${err}`;
|
|
91
|
+
throw new Error(message);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async loadPreferences(me: NamedNode): Promise<NamedNode> {
|
|
96
|
+
// console.log('loadPreferences', me)
|
|
97
|
+
if (this.cache.preferencesFile[me.value]) {
|
|
98
|
+
return this.cache.preferencesFile[me.value];
|
|
99
|
+
}
|
|
100
|
+
const preferencesFile = this.store.any(me, ns.space("preferencesFile"));
|
|
101
|
+
|
|
102
|
+
// console.log('this.store.any()', this.store.any())
|
|
103
|
+
/**
|
|
104
|
+
* Are we working cross-origin?
|
|
105
|
+
* Returns True if we are in a webapp at an origin, and the file origin is different
|
|
106
|
+
*/
|
|
107
|
+
function differentOrigin(): boolean {
|
|
108
|
+
if (!preferencesFile) {
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
return (
|
|
112
|
+
`${window.location.origin}/` !== new URL(preferencesFile.value).origin
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!preferencesFile) {
|
|
117
|
+
throw new Error(
|
|
118
|
+
`Can't find a preference file pointer in profile ${me.doc()}`
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!this.store.fetcher) {
|
|
123
|
+
throw new Error("Cannot load doc, have no fetcher");
|
|
124
|
+
}
|
|
125
|
+
// //// Load preference file
|
|
126
|
+
try {
|
|
127
|
+
await this.store.fetcher.load(preferencesFile as NamedNode, {
|
|
128
|
+
withCredentials: true,
|
|
129
|
+
});
|
|
130
|
+
} catch (err) {
|
|
131
|
+
// Really important to look at why
|
|
132
|
+
const status = err.status;
|
|
133
|
+
debug.log(`HTTP status ${status} for preference file ${preferencesFile}`);
|
|
134
|
+
if (status === 401) {
|
|
135
|
+
throw new UnauthorizedError();
|
|
136
|
+
}
|
|
137
|
+
if (status === 403) {
|
|
138
|
+
if (differentOrigin()) {
|
|
139
|
+
throw new CrossOriginForbiddenError();
|
|
140
|
+
}
|
|
141
|
+
throw new SameOriginForbiddenError();
|
|
142
|
+
}
|
|
143
|
+
if (status === 404) {
|
|
144
|
+
throw new NotFoundError(preferencesFile.value);
|
|
145
|
+
}
|
|
146
|
+
throw new FetchError(err.status, err.message);
|
|
147
|
+
}
|
|
148
|
+
return preferencesFile as NamedNode;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
getTypeIndex(
|
|
152
|
+
me: NamedNode | string,
|
|
153
|
+
preferencesFile: NamedNode | string,
|
|
154
|
+
isPublic: boolean
|
|
155
|
+
): NamedNode[] {
|
|
156
|
+
// console.log('getTypeIndex', this.store.each(me, undefined, undefined, preferencesFile), isPublic, preferencesFile)
|
|
157
|
+
return this.store.each(
|
|
158
|
+
me as NamedNode,
|
|
159
|
+
isPublic ? ns.solid("publicTypeIndex") : ns.solid("privateTypeIndex"),
|
|
160
|
+
undefined,
|
|
161
|
+
preferencesFile as NamedNode
|
|
162
|
+
) as NamedNode[];
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
getRegistrations(instance, theClass) {
|
|
166
|
+
return this.store
|
|
167
|
+
.each(undefined, ns.solid("instance"), instance)
|
|
168
|
+
.filter((r) => {
|
|
169
|
+
return this.store.holds(r, ns.solid("forClass"), theClass);
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
load(doc: NamedNode | NamedNode[] | string) {
|
|
174
|
+
if (!this.store.fetcher) {
|
|
175
|
+
throw new Error("Cannot load doc(s), have no fetcher");
|
|
176
|
+
}
|
|
177
|
+
return this.store.fetcher.load(doc);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async loadIndexes(
|
|
181
|
+
me: NamedNode | string,
|
|
182
|
+
publicProfile: NamedNode | string | null,
|
|
183
|
+
preferencesFile: NamedNode | string | null,
|
|
184
|
+
onWarning = async (_err: Error) => {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
): Promise<{
|
|
188
|
+
private: any;
|
|
189
|
+
public: any;
|
|
190
|
+
}> {
|
|
191
|
+
let privateIndexes: any[] = [];
|
|
192
|
+
let publicIndexes: any[] = [];
|
|
193
|
+
if (publicProfile) {
|
|
194
|
+
publicIndexes = this.getTypeIndex(me, publicProfile, true);
|
|
195
|
+
try {
|
|
196
|
+
await this.load(publicIndexes as NamedNode[]);
|
|
197
|
+
} catch (err) {
|
|
198
|
+
onWarning(new Error(`loadIndex: loading public type index(es) ${err}`));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (preferencesFile) {
|
|
202
|
+
privateIndexes = this.getTypeIndex(me, preferencesFile, false);
|
|
203
|
+
// console.log({ privateIndexes })
|
|
204
|
+
if (privateIndexes.length === 0) {
|
|
205
|
+
await onWarning(
|
|
206
|
+
new Error(
|
|
207
|
+
`Your preference file ${preferencesFile} does not point to a private type index.`
|
|
208
|
+
)
|
|
209
|
+
);
|
|
210
|
+
} else {
|
|
211
|
+
try {
|
|
212
|
+
await this.load(privateIndexes);
|
|
213
|
+
} catch (err) {
|
|
214
|
+
onWarning(
|
|
215
|
+
new Error(`loadIndex: loading private type index(es) ${err}`)
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// } else {
|
|
220
|
+
// debug.log(
|
|
221
|
+
// 'We know your preference file is not available, so we are not bothering with private type indexes.'
|
|
222
|
+
// )
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return {
|
|
226
|
+
private: privateIndexes,
|
|
227
|
+
public: publicIndexes,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async createEmptyRdfDoc(doc: NamedNode, comment: string) {
|
|
232
|
+
if (!this.store.fetcher) {
|
|
233
|
+
throw new Error("Cannot create empty rdf doc, have no fetcher");
|
|
234
|
+
}
|
|
235
|
+
await this.store.fetcher.webOperation("PUT", doc.uri, {
|
|
236
|
+
data: `# ${new Date()} ${comment}
|
|
237
|
+
`,
|
|
238
|
+
contentType: "text/turtle",
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// @@@@ use the one in rdflib.js when it is available and delete this
|
|
243
|
+
updatePromise(
|
|
244
|
+
del: Array<Statement>,
|
|
245
|
+
ins: Array<Statement> = []
|
|
246
|
+
): Promise<void> {
|
|
247
|
+
return new Promise((resolve, reject) => {
|
|
248
|
+
if (!this.store.updater) {
|
|
249
|
+
throw new Error("Cannot updatePromise, have no updater");
|
|
250
|
+
}
|
|
251
|
+
this.store.updater.update(del, ins, function (_uri, ok, errorBody) {
|
|
252
|
+
if (!ok) {
|
|
253
|
+
reject(new Error(errorBody));
|
|
254
|
+
} else {
|
|
255
|
+
resolve();
|
|
256
|
+
}
|
|
257
|
+
}); // callback
|
|
258
|
+
}); // promise
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
isContainer(url: string) {
|
|
262
|
+
return this.util.isContainer(url);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
getContainerElements(containerNode: NamedNode): NamedNode[] {
|
|
266
|
+
return this.util.getContainerElements(containerNode);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
getContainerMembers(containerUrl: string): Promise<string[]> {
|
|
270
|
+
return this.util.getContainerMembers(containerUrl);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
async recursiveDelete(url: string) {
|
|
274
|
+
return this.util.recursiveDelete(url);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
clearStore() {
|
|
278
|
+
return this.util.clearStore();
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
async fetch(url: string, options?: any) {
|
|
282
|
+
return this.fetcher.fetch(url, options);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
class CustomError extends Error {
|
|
287
|
+
constructor(message?: string) {
|
|
288
|
+
super(message);
|
|
289
|
+
// see: typescriptlang.org/docs/handbook/release-notes/typescript-2-2.html
|
|
290
|
+
Object.setPrototypeOf(this, new.target.prototype); // restore prototype chain
|
|
291
|
+
this.name = new.target.name; // stack traces display correctly now
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export class UnauthorizedError extends CustomError {}
|
|
296
|
+
|
|
297
|
+
export class CrossOriginForbiddenError extends CustomError {}
|
|
298
|
+
|
|
299
|
+
export class SameOriginForbiddenError extends CustomError {}
|
|
300
|
+
|
|
301
|
+
export class NotFoundError extends CustomError {}
|
|
302
|
+
|
|
303
|
+
export class FetchError extends CustomError {
|
|
304
|
+
status: number;
|
|
305
|
+
|
|
306
|
+
constructor(status: number, message?: string) {
|
|
307
|
+
super(message);
|
|
308
|
+
this.status = status;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AuthnLogic
|
|
1
|
+
import { LiveStore, NamedNode } from "rdflib";
|
|
2
|
+
import { AuthnLogic } from "../authn";
|
|
3
|
+
import { SolidNamespace } from "../index";
|
|
3
4
|
|
|
4
5
|
export class ProfileLogic {
|
|
5
6
|
store: LiveStore;
|
|
File without changes
|
package/src/util/UtilityLogic.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import { NamedNode,
|
|
2
|
-
import { SolidNamespace } from "../
|
|
1
|
+
import { LiveStore, NamedNode, Node, st, term, sym, Statement } from "rdflib";
|
|
2
|
+
import { SolidNamespace } from "../index";
|
|
3
|
+
import { ProfileLogic } from "../profile/ProfileLogic";
|
|
4
|
+
import { newThing } from "../uri";
|
|
3
5
|
|
|
4
6
|
export const ACL_LINK = sym(
|
|
5
7
|
"http://www.iana.org/assignments/link-relations/acl"
|
|
6
8
|
);
|
|
7
9
|
|
|
10
|
+
interface NewPaneOptions {
|
|
11
|
+
me?: NamedNode;
|
|
12
|
+
newInstance?: NamedNode;
|
|
13
|
+
newBase: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface CreatedPaneOptions {
|
|
17
|
+
newInstance: NamedNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
8
20
|
/**
|
|
9
21
|
* Utility-related logic
|
|
10
22
|
*/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
|
-
import { UtilityLogic } from "
|
|
2
|
+
import { UtilityLogic } from "./UtilityLogic";
|
|
3
3
|
import solidNamespace from "solid-namespace";
|
|
4
|
+
|
|
4
5
|
import * as rdf from "rdflib";
|
|
6
|
+
import { ProfileLogic } from "../profile/ProfileLogic";
|
|
5
7
|
import fetchMock from "jest-fetch-mock";
|
|
6
8
|
import { UpdateManager } from "rdflib";
|
|
7
|
-
import { SolidNamespace } from "../src/types";
|
|
8
9
|
|
|
9
|
-
const ns
|
|
10
|
+
const ns = solidNamespace(rdf);
|
|
10
11
|
|
|
11
12
|
const alice = rdf.sym("https://alice.example/profile/card#me");
|
|
12
13
|
const bob = rdf.sym("https://bob.example/profile/card#me");
|
package/lib/acl/aclLogic.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple Access Control
|
|
3
|
-
*
|
|
4
|
-
* This function sets up a simple default ACL for a resource, with
|
|
5
|
-
* RWC for the owner, and a specified access (default none) for the public.
|
|
6
|
-
* In all cases owner has read write control.
|
|
7
|
-
* Parameter lists modes allowed to public
|
|
8
|
-
*
|
|
9
|
-
* @param options
|
|
10
|
-
* @param options.public eg ['Read', 'Write']
|
|
11
|
-
*
|
|
12
|
-
* @returns Resolves with aclDoc uri on successful write
|
|
13
|
-
*/
|
|
14
|
-
import { NamedNode } from "rdflib";
|
|
15
|
-
export declare const ns: any;
|
|
16
|
-
export declare function setACLUserPublic(docURI: string, me: NamedNode, options: {
|
|
17
|
-
defaultForNew?: boolean;
|
|
18
|
-
public?: [];
|
|
19
|
-
}): Promise<NamedNode>;
|
|
20
|
-
/**
|
|
21
|
-
* @param docURI
|
|
22
|
-
* @param me
|
|
23
|
-
* @param aclURI
|
|
24
|
-
* @param options
|
|
25
|
-
*
|
|
26
|
-
* @returns Serialized ACL
|
|
27
|
-
*/
|
|
28
|
-
export declare function genACLText(docURI: string, me: NamedNode, aclURI: string, options?: {
|
|
29
|
-
defaultForNew?: boolean;
|
|
30
|
-
public?: [];
|
|
31
|
-
}): string | undefined;
|
|
32
|
-
//# sourceMappingURL=aclLogic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aclLogic.d.ts","sourceRoot":"","sources":["../../src/acl/aclLogic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAS,SAAS,EAAwB,MAAM,QAAQ,CAAA;AAM/D,eAAO,MAAM,EAAE,KAAuB,CAAA;AAEtC,wBAAgB,gBAAgB,CAChC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,SAAS,EACb,OAAO,EAAE;IACL,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,EAAE,CAAA;CACd,GACE,OAAO,CAAC,SAAS,CAAC,CAkCpB;AA8BD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAC1B,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,SAAS,EACb,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IACL,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,EAAE,CAAA;CACT,GACH,MAAM,GAAG,SAAS,CA2BpB"}
|
package/lib/acl/aclLogic.js
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Simple Access Control
|
|
4
|
-
*
|
|
5
|
-
* This function sets up a simple default ACL for a resource, with
|
|
6
|
-
* RWC for the owner, and a specified access (default none) for the public.
|
|
7
|
-
* In all cases owner has read write control.
|
|
8
|
-
* Parameter lists modes allowed to public
|
|
9
|
-
*
|
|
10
|
-
* @param options
|
|
11
|
-
* @param options.public eg ['Read', 'Write']
|
|
12
|
-
*
|
|
13
|
-
* @returns Resolves with aclDoc uri on successful write
|
|
14
|
-
*/
|
|
15
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
18
|
-
}) : (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
o[k2] = m[k];
|
|
21
|
-
}));
|
|
22
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
-
}) : function(o, v) {
|
|
25
|
-
o["default"] = v;
|
|
26
|
-
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.genACLText = exports.setACLUserPublic = exports.ns = void 0;
|
|
39
|
-
var rdflib_1 = require("rdflib");
|
|
40
|
-
var solid_namespace_1 = __importDefault(require("solid-namespace"));
|
|
41
|
-
var $rdf = __importStar(require("rdflib"));
|
|
42
|
-
var solidLogicSingleton_1 = require("../logic/solidLogicSingleton");
|
|
43
|
-
var UtilityLogic_1 = require("../util/UtilityLogic");
|
|
44
|
-
exports.ns = (0, solid_namespace_1.default)($rdf);
|
|
45
|
-
function setACLUserPublic(docURI, me, options) {
|
|
46
|
-
var aclDoc = solidLogicSingleton_1.solidLogicSingleton.store.any(solidLogicSingleton_1.solidLogicSingleton.store.sym(docURI), UtilityLogic_1.ACL_LINK);
|
|
47
|
-
return Promise.resolve()
|
|
48
|
-
.then(function () {
|
|
49
|
-
if (aclDoc) {
|
|
50
|
-
return aclDoc;
|
|
51
|
-
}
|
|
52
|
-
return fetchACLRel(docURI).catch(function (err) {
|
|
53
|
-
throw new Error("Error fetching rel=ACL header for ".concat(docURI, ": ").concat(err));
|
|
54
|
-
});
|
|
55
|
-
})
|
|
56
|
-
.then(function (aclDoc) {
|
|
57
|
-
var aclText = genACLText(docURI, me, aclDoc.uri, options);
|
|
58
|
-
if (!solidLogicSingleton_1.solidLogicSingleton.store.fetcher) {
|
|
59
|
-
throw new Error('Cannot PUT this, store has no fetcher');
|
|
60
|
-
}
|
|
61
|
-
return solidLogicSingleton_1.solidLogicSingleton.store.fetcher
|
|
62
|
-
.webOperation('PUT', aclDoc.uri, {
|
|
63
|
-
data: aclText,
|
|
64
|
-
contentType: 'text/turtle'
|
|
65
|
-
})
|
|
66
|
-
.then(function (result) {
|
|
67
|
-
if (!result.ok) {
|
|
68
|
-
throw new Error('Error writing ACL text: ' + result.error);
|
|
69
|
-
}
|
|
70
|
-
return aclDoc;
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
exports.setACLUserPublic = setACLUserPublic;
|
|
75
|
-
/**
|
|
76
|
-
* @param docURI
|
|
77
|
-
* @returns
|
|
78
|
-
*/
|
|
79
|
-
function fetchACLRel(docURI) {
|
|
80
|
-
var fetcher = solidLogicSingleton_1.solidLogicSingleton.store.fetcher;
|
|
81
|
-
if (!fetcher) {
|
|
82
|
-
throw new Error('Cannot fetch ACL rel, store has no fetcher');
|
|
83
|
-
}
|
|
84
|
-
return fetcher.load(docURI).then(function (result) {
|
|
85
|
-
if (!result.ok) {
|
|
86
|
-
throw new Error('fetchACLRel: While loading:' + result.error);
|
|
87
|
-
}
|
|
88
|
-
var aclDoc = solidLogicSingleton_1.solidLogicSingleton.store.any(solidLogicSingleton_1.solidLogicSingleton.store.sym(docURI), UtilityLogic_1.ACL_LINK);
|
|
89
|
-
if (!aclDoc) {
|
|
90
|
-
throw new Error('fetchACLRel: No Link rel=ACL header for ' + docURI);
|
|
91
|
-
}
|
|
92
|
-
return aclDoc;
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* @param docURI
|
|
97
|
-
* @param me
|
|
98
|
-
* @param aclURI
|
|
99
|
-
* @param options
|
|
100
|
-
*
|
|
101
|
-
* @returns Serialized ACL
|
|
102
|
-
*/
|
|
103
|
-
function genACLText(docURI, me, aclURI, options) {
|
|
104
|
-
if (options === void 0) { options = {}; }
|
|
105
|
-
var optPublic = options.public || [];
|
|
106
|
-
var g = (0, rdflib_1.graph)();
|
|
107
|
-
var auth = (0, rdflib_1.Namespace)('http://www.w3.org/ns/auth/acl#');
|
|
108
|
-
var a = g.sym("".concat(aclURI, "#a1"));
|
|
109
|
-
var acl = g.sym(aclURI);
|
|
110
|
-
var doc = g.sym(docURI);
|
|
111
|
-
g.add(a, exports.ns.rdf('type'), auth('Authorization'), acl);
|
|
112
|
-
g.add(a, auth('accessTo'), doc, acl);
|
|
113
|
-
if (options.defaultForNew) {
|
|
114
|
-
g.add(a, auth('default'), doc, acl);
|
|
115
|
-
}
|
|
116
|
-
g.add(a, auth('agent'), me, acl);
|
|
117
|
-
g.add(a, auth('mode'), auth('Read'), acl);
|
|
118
|
-
g.add(a, auth('mode'), auth('Write'), acl);
|
|
119
|
-
g.add(a, auth('mode'), auth('Control'), acl);
|
|
120
|
-
if (optPublic.length) {
|
|
121
|
-
a = g.sym("".concat(aclURI, "#a2"));
|
|
122
|
-
g.add(a, exports.ns.rdf('type'), auth('Authorization'), acl);
|
|
123
|
-
g.add(a, auth('accessTo'), doc, acl);
|
|
124
|
-
g.add(a, auth('agentClass'), exports.ns.foaf('Agent'), acl);
|
|
125
|
-
for (var p = 0; p < optPublic.length; p++) {
|
|
126
|
-
g.add(a, auth('mode'), auth(optPublic[p]), acl); // Like 'Read' etc
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return (0, rdflib_1.serialize)(acl, g, aclURI);
|
|
130
|
-
}
|
|
131
|
-
exports.genACLText = genACLText;
|
|
132
|
-
//# sourceMappingURL=aclLogic.js.map
|
package/lib/acl/aclLogic.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aclLogic.js","sourceRoot":"","sources":["../../src/acl/aclLogic.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,iCAA+D;AAC/D,oEAA4C;AAC5C,2CAA8B;AAC9B,oEAAkE;AAClE,qDAA+C;AAElC,QAAA,EAAE,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAA;AAEtC,SAAgB,gBAAgB,CAChC,MAAc,EACd,EAAa,EACb,OAGC;IAED,IAAM,MAAM,GAAG,yCAAmB,CAAC,KAAK,CAAC,GAAG,CACxC,yCAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EACrC,uBAAQ,CACX,CAAA;IAED,OAAO,OAAO,CAAC,OAAO,EAAE;SACnB,IAAI,CAAC;QACN,IAAI,MAAM,EAAE;YACR,OAAO,MAAmB,CAAA;SAC7B;QAED,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,UAAA,GAAG;YAChC,MAAM,IAAI,KAAK,CAAC,4CAAqC,MAAM,eAAK,GAAG,CAAE,CAAC,CAAA;QAC1E,CAAC,CAAC,CAAA;IACF,CAAC,CAAC;SACD,IAAI,CAAC,UAAA,MAAM;QACZ,IAAM,OAAO,GA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 -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var solid_client_authn_browser_1 = require("@inrupt/solid-client-authn-browser");
|
|
4
|
-
var authSession;
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
if (!window.authSession) {
|
|
7
|
-
authSession = new solid_client_authn_browser_1.Session({
|
|
8
|
-
clientAuthentication: (0, solid_client_authn_browser_1.getClientAuthenticationWithDependencies)({})
|
|
9
|
-
}, 'mySession');
|
|
10
|
-
// @ts-ignore
|
|
11
|
-
window.authSession = authSession;
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
authSession = window.authSession;
|
|
16
|
-
}
|
|
17
|
-
exports.default = authSession;
|
|
18
|
-
//# sourceMappingURL=authSession.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authSession.js","sourceRoot":"","sources":["../../src/authSession/authSession.ts"],"names":[],"mappings":";;AAAA,iFAG2C;AAE3C,IAAI,WAAoB,CAAA;AACxB,aAAa;AACb,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;IACvB,WAAW,GAAG,IAAI,oCAAO,CACvB;QACE,oBAAoB,EAAE,IAAA,oEAAuC,EAAC,EAAE,CAAC;KAClE,EACD,WAAW,CACZ,CAAA;IACD,aAAa;IACb,MAAM,CAAC,WAAW,GAAG,WAAW,CAAA;CACjC;KAAM;IACL,aAAa;IACb,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;CACjC;AAED,kBAAe,WAAW,CAAA"}
|
package/lib/authn/authUtil.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { NamedNode } from "rdflib";
|
|
2
|
-
/**
|
|
3
|
-
* find a user or app's context as set in window.SolidAppContext
|
|
4
|
-
* this is a const, not a function, because we have problems to jest mock it otherwise
|
|
5
|
-
* see: https://github.com/facebook/jest/issues/936#issuecomment-545080082 for more
|
|
6
|
-
* @return {any} - an appContext object
|
|
7
|
-
*/
|
|
8
|
-
export declare const appContext: () => any;
|
|
9
|
-
/**
|
|
10
|
-
* Returns `sym($SolidTestEnvironment.username)` if
|
|
11
|
-
* `$SolidTestEnvironment.username` is defined as a global
|
|
12
|
-
* or
|
|
13
|
-
* returns testID defined in the HTML page
|
|
14
|
-
* @returns {NamedNode|null}
|
|
15
|
-
*/
|
|
16
|
-
export declare function offlineTestID(): NamedNode | null;
|
|
17
|
-
//# sourceMappingURL=authUtil.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authUtil.d.ts","sourceRoot":"","sources":["../../src/authn/authUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAGvC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,QAAM,GAuB5B,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,IAAK,SAAS,GAAG,IAAI,CAyBjD"}
|