solid-logic 1.3.14 → 1.3.15
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 +0 -1
- package/.nvmrc +1 -0
- package/lib/acl/aclLogic.js +5 -1
- package/lib/acl/aclLogic.js.map +1 -1
- package/lib/authn/SolidAuthnLogic.js +5 -1
- package/lib/authn/SolidAuthnLogic.js.map +1 -1
- package/lib/authn/authUtil.js +5 -1
- package/lib/authn/authUtil.js.map +1 -1
- package/lib/discovery/discoveryLogic.d.ts +13 -0
- package/lib/discovery/discoveryLogic.d.ts.map +1 -0
- package/lib/discovery/discoveryLogic.js +203 -0
- package/lib/discovery/discoveryLogic.js.map +1 -0
- package/lib/inbox/InboxLogic.js +2 -2
- package/lib/inbox/InboxLogic.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/index.js.map +1 -1
- package/lib/logic/SolidLogic.d.ts +2 -3
- package/lib/logic/SolidLogic.d.ts.map +1 -1
- package/lib/logic/SolidLogic.js +47 -42
- package/lib/logic/SolidLogic.js.map +1 -1
- package/lib/logic/solidLogicSingleton.d.ts.map +1 -1
- package/lib/logic/solidLogicSingleton.js +9 -2
- package/lib/logic/solidLogicSingleton.js.map +1 -1
- package/lib/typeIndex/typeIndexLogic.d.ts +4 -4
- package/lib/typeIndex/typeIndexLogic.d.ts.map +1 -1
- package/lib/typeIndex/typeIndexLogic.js +98 -32
- package/lib/typeIndex/typeIndexLogic.js.map +1 -1
- package/lib/util/UtilityLogic.d.ts +2 -2
- package/lib/util/UtilityLogic.d.ts.map +1 -1
- package/lib/util/UtilityLogic.js +6 -6
- package/lib/util/UtilityLogic.js.map +1 -1
- package/package.json +15 -18
- package/src/discovery/discoveryLogic.ts +90 -0
- package/src/inbox/InboxLogic.ts +2 -2
- package/src/index.ts +10 -0
- package/src/logic/SolidLogic.ts +31 -32
- package/src/logic/solidLogicSingleton.ts +3 -1
- package/src/typeIndex/typeIndexLogic.ts +92 -61
- package/src/util/UtilityLogic.ts +8 -8
- package/test/chatLogic.test.ts +1 -1
- package/test/typeIndexLogic.test.ts +4 -3
- package/renovate.json +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UtilityLogic.js","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8D;AAGjD,QAAA,QAAQ,GAAG,IAAA,YAAG,EACzB,oDAAoD,CACrD,CAAC;AAEF;;GAEG;AACH;IAKE,sBAAY,KAAgB,EAAE,EAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"UtilityLogic.js","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8D;AAGjD,QAAA,QAAQ,GAAG,IAAA,YAAG,EACzB,oDAAoD,CACrD,CAAC;AAEF;;GAEG;AACH;IAKE,sBAAY,KAAgB,EAAE,EAAkB,EAAE,eAA+D;QAC/G,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAEK,oCAAa,GAAnB,UAAoB,GAAW;;;;;;;wBACvB,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBAChC,qBAAM,CAAA,MAAA,IAAI,CAAC,KAAK,CAAC,OAAO,0CAAE,IAAI,CAAC,GAAG,CAAC,CAAA,EAAA;;wBAAnC,SAAmC,CAAC;wBAC9B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,gBAAQ,CAAC,CAAC;wBAC9C,IAAI,CAAC,OAAO,EAAE;4BACZ,MAAM,IAAI,K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,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAC;;;;;;;;KAIhE;IAED,iCAAU,GAAV;QACE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,oCAAa,GAAb,UAAc,OAAe,EAAE,IAAU;QACvC,IAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACnC,IAAM,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,IAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,IAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAE,CAAC,CAAE,CAAC;QACzC,OAAO,IAAI,GAAG,CAAC,oBAAa,IAAI,cAAI,KAAK,cAAI,GAAG,cAAI,QAAQ,CAAE,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACtF,CAAC;IACH,mBAAC;AAAD,CAAC,AAtJD,IAsJC;AAtJY,oCAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-logic",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.15",
|
|
4
4
|
"description": "Core business logic of Solid OS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -24,26 +24,23 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/solid/solid-logic#readme",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/plugin-proposal-class-properties": "7.16.
|
|
28
|
-
"@babel/plugin-proposal-optional-chaining": "7.16.
|
|
29
|
-
"@babel/plugin-transform-async-to-generator": "7.16.
|
|
30
|
-
"@babel/plugin-transform-runtime": "7.
|
|
31
|
-
"@babel/preset-env": "7.16.
|
|
32
|
-
"@babel/preset-typescript": "7.16.
|
|
33
|
-
"@types/jest": "^27.
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
35
|
-
"@typescript-eslint/parser": "^5.
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"jest": "27.
|
|
27
|
+
"@babel/plugin-proposal-class-properties": "~7.16.7",
|
|
28
|
+
"@babel/plugin-proposal-optional-chaining": "~7.16.7",
|
|
29
|
+
"@babel/plugin-transform-async-to-generator": "~7.16.8",
|
|
30
|
+
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
31
|
+
"@babel/preset-env": "~7.16.11",
|
|
32
|
+
"@babel/preset-typescript": "~7.16.7",
|
|
33
|
+
"@types/jest": "^27.4.1",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
|
35
|
+
"@typescript-eslint/parser": "^5.16.0",
|
|
36
|
+
"eslint": "^8.12.0",
|
|
37
|
+
"jest": "^27.5.1",
|
|
38
38
|
"jest-fetch-mock": "^3.0.3",
|
|
39
|
-
"
|
|
40
|
-
"standard": "^16.0.4",
|
|
41
|
-
"ts-jest": "27.1.2",
|
|
42
|
-
"typescript": "4.5.4"
|
|
39
|
+
"typescript": "^4.6.3"
|
|
43
40
|
},
|
|
44
41
|
"dependencies": {
|
|
45
|
-
"@inrupt/solid-client-authn-browser": "^1.11.
|
|
46
|
-
"rdflib": "^2.2.
|
|
42
|
+
"@inrupt/solid-client-authn-browser": "^1.11.7",
|
|
43
|
+
"rdflib": "^2.2.19",
|
|
47
44
|
"solid-namespace": "^0.5.2"
|
|
48
45
|
}
|
|
49
46
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { NamedNode, Namespace, LiveStore } from "rdflib";
|
|
2
|
+
|
|
3
|
+
type TypeIndex = { label: string, index: NamedNode, agent: NamedNode } ;
|
|
4
|
+
|
|
5
|
+
const ns ={
|
|
6
|
+
solid: Namespace('http://www.w3.org/ns/solid/terms#'),
|
|
7
|
+
space: Namespace('http://www.w3.org/ns/pim/space#')
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function loadProfile(store: LiveStore, user) {
|
|
11
|
+
if (!user) {
|
|
12
|
+
throw new Error(`loadProfile: no user given.`)
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
await store.fetcher.load(user.doc())
|
|
16
|
+
} catch (err) {
|
|
17
|
+
throw new Error(`Unable to load profile of user <${user}>: ${err}`)
|
|
18
|
+
}
|
|
19
|
+
return user.doc()
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export async function loadPreferences(store: LiveStore, user): Promise <NamedNode | undefined > {
|
|
23
|
+
const profile = await loadProfile(store as LiveStore, user)
|
|
24
|
+
const preferencesFile = store.any(user, ns.space('preferencesFile'), undefined, profile)
|
|
25
|
+
if (!preferencesFile) {
|
|
26
|
+
// throw new Error(`USer ${user} has no pointer in profile to preferences file.`)
|
|
27
|
+
return undefined
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
store.fetcher.load(preferencesFile as NamedNode)
|
|
31
|
+
} catch (err) { // Mabeb a permission propblem or origin problem
|
|
32
|
+
return undefined
|
|
33
|
+
// throw new Error(`Unable to load preferences file ${preferencesFile} of user <${user}>: ${err}`)
|
|
34
|
+
}
|
|
35
|
+
return preferencesFile as NamedNode
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export async function loadTypeIndexesFor(store: LiveStore, user:NamedNode): Promise<Array<TypeIndex>> {
|
|
39
|
+
if (!user) throw new Error(`loadTypeIndexesFor: No user given`)
|
|
40
|
+
const profile = await loadProfile(store, user)
|
|
41
|
+
const publicTypeIndex = store.any(user, ns.solid('publicTypeIndex'), undefined, profile)
|
|
42
|
+
if (publicTypeIndex) {
|
|
43
|
+
try {
|
|
44
|
+
await store.fetcher.load(publicTypeIndex as NamedNode)
|
|
45
|
+
} catch {
|
|
46
|
+
// never mind
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const pub = publicTypeIndex ? [ { label: 'public', index: publicTypeIndex as NamedNode, agent: user } ] : []
|
|
50
|
+
|
|
51
|
+
const preferencesFile = await loadPreferences(store, user)
|
|
52
|
+
if (preferencesFile) { // watch out - can be in either as spec was not clear
|
|
53
|
+
const privateTypeIndexes = store.each(user, ns.solid('privateTypeIndex'), undefined, preferencesFile as NamedNode)
|
|
54
|
+
.concat(store.each(user, ns.solid('privateTypeIndex'), undefined, profile))
|
|
55
|
+
const priv = privateTypeIndexes.length > 0 ? [ { label: 'priSo @@@@@vate', index: privateTypeIndexes[0] as NamedNode, agent: user } ] : []
|
|
56
|
+
return pub.concat(priv)
|
|
57
|
+
}
|
|
58
|
+
return pub
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export async function loadCommunityTypeIndexes (store:LiveStore, user:NamedNode): Promise<TypeIndex[][]> {
|
|
62
|
+
const preferencesFile = await loadPreferences(store, user)
|
|
63
|
+
if (preferencesFile) {
|
|
64
|
+
const communities = store.each(user, ns.solid('community'), undefined, preferencesFile as NamedNode)
|
|
65
|
+
const communityTypeIndexesPromise = communities.map(async community => await loadTypeIndexesFor(store, community as NamedNode))
|
|
66
|
+
const result1 = Promise.all(communityTypeIndexesPromise)
|
|
67
|
+
// const result2 = Promise.all(result1)
|
|
68
|
+
// const flat = result2.flat()
|
|
69
|
+
return result1
|
|
70
|
+
// const communityTypeIndexes = await Promise.all(communityTypeIndexesPromise)
|
|
71
|
+
/*
|
|
72
|
+
let result = [] as TypeIndex[]
|
|
73
|
+
for(const community of communities) {
|
|
74
|
+
result = result.concat(await loadTypeIndexesFor(store, community as NamedNode)) as TypeIndex[] // @@ how oto make functional with async?
|
|
75
|
+
}
|
|
76
|
+
*/
|
|
77
|
+
// return communityTypeIndexesPromise.resolve()
|
|
78
|
+
}
|
|
79
|
+
return []
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export async function loadAllTypeIndexes (store:LiveStore, user:NamedNode) {
|
|
83
|
+
return (await loadTypeIndexesFor(store, user)).concat((await loadCommunityTypeIndexes(store, user)).flat())
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/*
|
|
87
|
+
export async function getAppInstances (store:LiveStore, klass: NamedNode) {
|
|
88
|
+
|
|
89
|
+
}
|
|
90
|
+
*/
|
package/src/inbox/InboxLogic.ts
CHANGED
|
@@ -44,7 +44,7 @@ export class InboxLogic {
|
|
|
44
44
|
return ourInbox;
|
|
45
45
|
}
|
|
46
46
|
async markAsRead(url: string, date: Date) {
|
|
47
|
-
const downloaded = await this.util.
|
|
47
|
+
const downloaded = await this.util.underlyingFetch.fetch(url);
|
|
48
48
|
if (downloaded.status !== 200) {
|
|
49
49
|
throw new Error(`Not OK! ${url}`);
|
|
50
50
|
}
|
|
@@ -56,7 +56,7 @@ export class InboxLogic {
|
|
|
56
56
|
[ 'Content-Type', downloaded.headers.get('Content-Type') || 'application/octet-stream' ]
|
|
57
57
|
]
|
|
58
58
|
};
|
|
59
|
-
const uploaded = await this.util.
|
|
59
|
+
const uploaded = await this.util.underlyingFetch.fetch(archiveUrl, options);
|
|
60
60
|
if (uploaded.status.toString()[0] === '2') {
|
|
61
61
|
await this.store.fetcher?._fetch(url, {
|
|
62
62
|
method: 'DELETE'
|
package/src/index.ts
CHANGED
|
@@ -12,12 +12,22 @@ export {
|
|
|
12
12
|
setACLUserPublic,
|
|
13
13
|
genACLText
|
|
14
14
|
} from './acl/aclLogic'
|
|
15
|
+
|
|
15
16
|
export {
|
|
16
17
|
ensureTypeIndexes,
|
|
17
18
|
loadTypeIndexes,
|
|
18
19
|
registerInTypeIndex,
|
|
19
20
|
loadIndex
|
|
20
21
|
} from './typeIndex/typeIndexLogic'
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
loadProfile,
|
|
25
|
+
loadPreferences,
|
|
26
|
+
loadTypeIndexesFor,
|
|
27
|
+
loadCommunityTypeIndexes,
|
|
28
|
+
loadAllTypeIndexes
|
|
29
|
+
} from './discovery/discoveryLogic'
|
|
30
|
+
|
|
21
31
|
export { SolidLogic } from './logic/SolidLogic'
|
|
22
32
|
export { offlineTestID, appContext } from './authn/authUtil'
|
|
23
33
|
export { ACL_LINK } from './util/UtilityLogic'
|
package/src/logic/SolidLogic.ts
CHANGED
|
@@ -10,6 +10,13 @@ import * as debug from "../util/debug";
|
|
|
10
10
|
import { UtilityLogic } from "../util/UtilityLogic";
|
|
11
11
|
import { CrossOriginForbiddenError, FetchError, NotFoundError, SameOriginForbiddenError, UnauthorizedError } from "./CustomError";
|
|
12
12
|
|
|
13
|
+
import { solidLogicSingleton } from "../logic/solidLogicSingleton"
|
|
14
|
+
/*
|
|
15
|
+
** It is important to distinquish `fetch`, a function provided by the browser
|
|
16
|
+
** and `Fetcher`, a helper object for the rdflib Store which turns it
|
|
17
|
+
** into a `ConnectedStore` or a `LiveStore`. A Fetcher object is
|
|
18
|
+
** available at store.fetcher, and `fetch` function at `store.fetcher._fetch`,
|
|
19
|
+
*/
|
|
13
20
|
|
|
14
21
|
const ns: SolidNamespace = solidNamespace(rdf);
|
|
15
22
|
|
|
@@ -25,60 +32,64 @@ export class SolidLogic {
|
|
|
25
32
|
|
|
26
33
|
store: LiveStore;
|
|
27
34
|
me: string | undefined;
|
|
28
|
-
|
|
35
|
+
underlyingFetch: { fetch: (url: string, options?: any) => any };
|
|
29
36
|
|
|
30
37
|
chat: ChatLogic;
|
|
31
38
|
profile: ProfileLogic;
|
|
32
39
|
authn: AuthnLogic;
|
|
33
40
|
util: UtilityLogic;
|
|
34
41
|
|
|
35
|
-
constructor(
|
|
42
|
+
constructor(specialFetch: { fetch: (url: any, requestInit: any) => any }, session: Session) {
|
|
43
|
+
// would xpect to be able to do it this way: but get TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation status: 999
|
|
44
|
+
// this.store = new rdf.LiveStore({})
|
|
45
|
+
// this.store.fetcher._fetch = fetch
|
|
46
|
+
console.log("SolidLogic: Unique instance created. There should only be one of these.")
|
|
36
47
|
this.store = rdf.graph() as LiveStore; // Make a Quad store
|
|
37
|
-
rdf.fetcher(this.store,
|
|
48
|
+
rdf.fetcher(this.store, { fetch: specialFetch.fetch}); // Attach a web I/O module, store.fetcher
|
|
38
49
|
this.store.updater = new rdf.UpdateManager(this.store); // Add real-time live updates store.updater
|
|
50
|
+
|
|
39
51
|
this.store.features = [] // disable automatic node merging on store load
|
|
40
52
|
this.cache = {
|
|
41
53
|
profileDocument: {},
|
|
42
54
|
preferencesFile: {},
|
|
43
55
|
};
|
|
44
|
-
this.
|
|
56
|
+
this.underlyingFetch = { fetch: fetch }; // Note global one not the one passed
|
|
45
57
|
this.authn = new SolidAuthnLogic(session);
|
|
46
58
|
debug.log('SolidAuthnLogic initialized')
|
|
47
59
|
this.profile = new ProfileLogic(this.store, ns, this.authn);
|
|
48
60
|
this.chat = new ChatLogic(this.store, ns, this.profile);
|
|
49
|
-
this.util = new UtilityLogic(this.store, ns, this.
|
|
61
|
+
this.util = new UtilityLogic(this.store, ns, this.underlyingFetch);
|
|
50
62
|
}
|
|
51
63
|
|
|
52
64
|
findAclDocUrl(url: string) {
|
|
53
65
|
return this.util.findAclDocUrl(url);
|
|
54
66
|
}
|
|
55
67
|
|
|
56
|
-
loadDoc(doc: NamedNode): Promise<void> {
|
|
57
|
-
return this.util.loadDoc(doc);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
68
|
async loadProfile(me: NamedNode): Promise<NamedNode> {
|
|
61
|
-
|
|
69
|
+
/*
|
|
70
|
+
// console.log('loadProfile cache ', this.cache)
|
|
62
71
|
if (this.cache.profileDocument[me.value]) {
|
|
63
72
|
return this.cache.profileDocument[me.value];
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
} @@ just use the cache in the store
|
|
74
|
+
*/
|
|
75
|
+
console.log('loadProfile me ', me)
|
|
76
|
+
const profileDocument = me.doc()
|
|
66
77
|
try {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return profileDocument;
|
|
78
|
+
await this.store.fetcher.load(profileDocument);
|
|
79
|
+
return profileDocument;
|
|
70
80
|
} catch (err) {
|
|
71
|
-
const message = `
|
|
81
|
+
const message = `Cannot load profile ${profileDocument} : ${err}`;
|
|
72
82
|
throw new Error(message);
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
async loadPreferences(me: NamedNode): Promise<NamedNode> {
|
|
77
|
-
|
|
87
|
+
console.log('loadPreferences cache ', this.cache)
|
|
78
88
|
if (this.cache.preferencesFile[me.value]) {
|
|
79
89
|
return this.cache.preferencesFile[me.value];
|
|
80
90
|
}
|
|
81
|
-
|
|
91
|
+
await this.loadProfile(me) // Load pointer to pref file
|
|
92
|
+
const preferencesFile = this.store.any(me, ns.space('preferencesFile'), null, me.doc());
|
|
82
93
|
|
|
83
94
|
// console.log('this.store.any()', this.store.any())
|
|
84
95
|
/**
|
|
@@ -100,12 +111,9 @@ export class SolidLogic {
|
|
|
100
111
|
);
|
|
101
112
|
}
|
|
102
113
|
|
|
103
|
-
if (!this.store.fetcher) {
|
|
104
|
-
throw new Error("Cannot load doc, have no fetcher");
|
|
105
|
-
}
|
|
106
114
|
// //// Load preference file
|
|
107
115
|
try {
|
|
108
|
-
await
|
|
116
|
+
await solidLogicSingleton.store.fetcher.load(preferencesFile as NamedNode, { // @@ was this.store.
|
|
109
117
|
withCredentials: true,
|
|
110
118
|
});
|
|
111
119
|
} catch (err) {
|
|
@@ -152,9 +160,6 @@ export class SolidLogic {
|
|
|
152
160
|
}
|
|
153
161
|
|
|
154
162
|
load(doc: NamedNode | NamedNode[] | string) {
|
|
155
|
-
if (!this.store.fetcher) {
|
|
156
|
-
throw new Error("Cannot load doc(s), have no fetcher");
|
|
157
|
-
}
|
|
158
163
|
return this.store.fetcher.load(doc);
|
|
159
164
|
}
|
|
160
165
|
|
|
@@ -210,9 +215,6 @@ export class SolidLogic {
|
|
|
210
215
|
}
|
|
211
216
|
|
|
212
217
|
async createEmptyRdfDoc(doc: NamedNode, comment: string) {
|
|
213
|
-
if (!this.store.fetcher) {
|
|
214
|
-
throw new Error("Cannot create empty rdf doc, have no fetcher");
|
|
215
|
-
}
|
|
216
218
|
await this.store.fetcher.webOperation("PUT", doc.uri, {
|
|
217
219
|
data: `# ${new Date()} ${comment}
|
|
218
220
|
`,
|
|
@@ -226,9 +228,6 @@ export class SolidLogic {
|
|
|
226
228
|
ins: Array<Statement> = []
|
|
227
229
|
): Promise<void> {
|
|
228
230
|
return new Promise((resolve, reject) => {
|
|
229
|
-
if (!this.store.updater) {
|
|
230
|
-
throw new Error("Cannot updatePromise, have no updater");
|
|
231
|
-
}
|
|
232
231
|
this.store.updater.update(del, ins, function (_uri, ok, errorBody) {
|
|
233
232
|
if (!ok) {
|
|
234
233
|
reject(new Error(errorBody));
|
|
@@ -260,6 +259,6 @@ export class SolidLogic {
|
|
|
260
259
|
}
|
|
261
260
|
|
|
262
261
|
async fetch(url: string, options?: any) {
|
|
263
|
-
return this.
|
|
262
|
+
return this.underlyingFetch.fetch(url, options);
|
|
264
263
|
}
|
|
265
264
|
}
|
|
@@ -3,7 +3,9 @@ import { authSession } from "../authSession/authSession"
|
|
|
3
3
|
import { SolidLogic } from "./SolidLogic"
|
|
4
4
|
|
|
5
5
|
const _fetch = async (url, requestInit) => {
|
|
6
|
-
|
|
6
|
+
const omitCreds = requestInit && requestInit.credentials && requestInit.credentials == 'omit'
|
|
7
|
+
if (authSession.info.webId && !omitCreds) { // see https://github.com/solid/solidos/issues/114
|
|
8
|
+
// In fact ftech should respect crentials omit itself
|
|
7
9
|
return authSession.fetch(url, requestInit)
|
|
8
10
|
} else {
|
|
9
11
|
return window.fetch(url, requestInit)
|
|
@@ -5,13 +5,23 @@ import * as $rdf from 'rdflib'
|
|
|
5
5
|
import { newThing } from "../util/uri"
|
|
6
6
|
import { AuthenticationContext } from "../types"
|
|
7
7
|
import { solidLogicSingleton } from "../logic/solidLogicSingleton"
|
|
8
|
-
|
|
8
|
+
// import { ensureLoadedPreferences } from '../logic/logic'
|
|
9
|
+
import { loadPreferences, loadProfile } from '../discovery/discoveryLogic'
|
|
9
10
|
export const ns = solidNamespace($rdf)
|
|
10
11
|
|
|
12
|
+
const store = solidLogicSingleton.store
|
|
13
|
+
|
|
14
|
+
async function ensureLoadedPreferences (context:AuthenticationContext) {
|
|
15
|
+
if (!context.me) throw new Error('@@ ensureLoadedPreferences: no user specified')
|
|
16
|
+
context.publicProfile = await loadProfile(store, context.me)
|
|
17
|
+
context.preferencesFile = await loadPreferences(store, context.me)
|
|
18
|
+
return context
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
/**
|
|
12
22
|
* Resolves with the same context, outputting
|
|
13
23
|
* output: index.public, index.private
|
|
14
|
-
*
|
|
24
|
+
* @@ This is a very bizare function
|
|
15
25
|
* @see https://github.com/solid/solid/blob/main/proposals/data-discovery.md#discoverability
|
|
16
26
|
*/
|
|
17
27
|
export async function loadIndex (
|
|
@@ -26,32 +36,44 @@ const indexes = await solidLogicSingleton.loadIndexes(
|
|
|
26
36
|
async (err: Error) => debug.error(err.message) as undefined
|
|
27
37
|
)
|
|
28
38
|
context.index = context.index || {}
|
|
29
|
-
context.index.private = indexes.private
|
|
30
|
-
context.index.public = indexes.public
|
|
39
|
+
context.index.private = indexes.private.concat(context.index.private)
|
|
40
|
+
context.index.public = indexes.public.concat(context.index.public)
|
|
31
41
|
return context
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
export async function loadTypeIndexes (context: AuthenticationContext) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
context.
|
|
43
|
-
context.
|
|
44
|
-
context.
|
|
45
|
-
|
|
45
|
+
try {
|
|
46
|
+
await loadPreferences(solidLogicSingleton.store, context.me)
|
|
47
|
+
} catch (error) {
|
|
48
|
+
debug.warn(error.message) as undefined
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const indexes = await solidLogicSingleton.loadIndexes(
|
|
52
|
+
context.me as NamedNode,
|
|
53
|
+
context.publicProfile || null,
|
|
54
|
+
context.preferencesFile || null,
|
|
55
|
+
// async (err: Error) => widgets.complain(context, err.message)
|
|
56
|
+
// async (err: Error) => debug.warn(err.message) as undefined
|
|
57
|
+
)
|
|
58
|
+
context.index = context.index || {}
|
|
59
|
+
context.index.private = indexes.private || context.index.private
|
|
60
|
+
context.index.public = indexes.public || context.index.public
|
|
61
|
+
return context
|
|
62
|
+
} catch (error) {
|
|
63
|
+
async (error: Error) => debug.warn(error.message) as undefined
|
|
64
|
+
}
|
|
46
65
|
}
|
|
47
66
|
|
|
48
67
|
/**
|
|
49
68
|
* Resolves with the same context, outputting
|
|
50
69
|
* @see https://github.com/solid/solid/blob/main/proposals/data-discovery.md#discoverability
|
|
51
70
|
*/
|
|
52
|
-
export async function ensureTypeIndexes (context: AuthenticationContext): Promise<AuthenticationContext> {
|
|
53
|
-
|
|
54
|
-
|
|
71
|
+
export async function ensureTypeIndexes (context: AuthenticationContext, agent?: NamedNode): Promise<AuthenticationContext> {
|
|
72
|
+
if (!context.me) {
|
|
73
|
+
throw new Error(`ensureTypeIndexes: @@ no user`)
|
|
74
|
+
}
|
|
75
|
+
await ensureOneTypeIndex(context, true, agent)
|
|
76
|
+
await ensureOneTypeIndex(context, false, agent)
|
|
55
77
|
return context
|
|
56
78
|
}
|
|
57
79
|
|
|
@@ -63,9 +85,10 @@ return context
|
|
|
63
85
|
* Adds its output to the context
|
|
64
86
|
* @see https://github.com/solid/solid/blob/main/proposals/data-discovery.md#discoverability
|
|
65
87
|
*/
|
|
66
|
-
async function ensureOneTypeIndex (context: AuthenticationContext, isPublic: boolean): Promise<AuthenticationContext | void> {
|
|
88
|
+
async function ensureOneTypeIndex (context: AuthenticationContext, isPublic: boolean, agent?: NamedNode): Promise<AuthenticationContext | void> {
|
|
67
89
|
async function makeIndexIfNecessary (context, isPublic) {
|
|
68
90
|
const relevant = isPublic ? context.publicProfile : context.preferencesFile
|
|
91
|
+
if (!relevant) alert ('@@@@ relevent null')
|
|
69
92
|
const visibility = isPublic ? 'public' : 'private'
|
|
70
93
|
|
|
71
94
|
async function putIndex (newIndex) {
|
|
@@ -79,58 +102,65 @@ async function ensureOneTypeIndex (context: AuthenticationContext, isPublic: boo
|
|
|
79
102
|
}
|
|
80
103
|
} // putIndex
|
|
81
104
|
|
|
105
|
+
|
|
82
106
|
context.index = context.index || {}
|
|
83
107
|
context.index[visibility] = context.index[visibility] || []
|
|
84
108
|
let newIndex
|
|
85
109
|
if (context.index[visibility].length === 0) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
if (!store.updater.editable(relevant)) {
|
|
111
|
+
debug.log(`Not adding new type index as ${relevant} is not editable`)
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
newIndex = sym(`${relevant.dir().uri + visibility}TypeIndex.ttl`)
|
|
115
|
+
debug.log(`Linking to new fresh type index ${newIndex}`)
|
|
116
|
+
if (!confirm(`OK to create a new empty index file at ${newIndex}, overwriting anything that is now there?`)) {
|
|
117
|
+
throw new Error('cancelled by user')
|
|
118
|
+
}
|
|
119
|
+
debug.log(`Linking to new fresh type index ${newIndex}`)
|
|
120
|
+
const addMe = [
|
|
121
|
+
st(context.me, ns.solid(`${visibility}TypeIndex`), newIndex, relevant)
|
|
122
|
+
]
|
|
123
|
+
try {
|
|
124
|
+
await solidLogicSingleton.updatePromise([], addMe)
|
|
125
|
+
} catch (err) {
|
|
126
|
+
const msg = `Error saving type index link saving back ${newIndex}: ${err}`
|
|
127
|
+
//widgets.complain(context, msg)
|
|
128
|
+
debug.warn(msg)
|
|
129
|
+
return context
|
|
130
|
+
}
|
|
103
131
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
debug.log(`Creating new fresh type index file${newIndex}`)
|
|
133
|
+
await putIndex(newIndex)
|
|
134
|
+
context.index[visibility].push(newIndex) // @@ wait
|
|
107
135
|
} else {
|
|
108
136
|
// officially exists
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
137
|
+
const ixs = context.index[visibility]
|
|
138
|
+
try {
|
|
139
|
+
await solidLogicSingleton.load(ixs)
|
|
140
|
+
} catch (err) {
|
|
141
|
+
const msg = `ensureOneTypeIndex: loading indexes ${err}`
|
|
142
|
+
debug.warn(msg)
|
|
143
|
+
// widgets.complain(context, `ensureOneTypeIndex: loading indexes ${err}`)
|
|
144
|
+
}
|
|
117
145
|
}
|
|
118
146
|
} // makeIndexIfNecessary
|
|
119
147
|
|
|
148
|
+
const context2 = await ensureLoadedPreferences(context)
|
|
149
|
+
if (!context2.publicProfile) throw new Error(`@@ type index: no publicProfile`)
|
|
150
|
+
if (!context2.preferencesFile) throw new Error(`@@ type index: no preferencesFile for profile ${context2.publicProfile}`)
|
|
151
|
+
const relevant = isPublic ? context2.publicProfile : context2.preferencesFile
|
|
152
|
+
|
|
120
153
|
try {
|
|
121
|
-
await loadIndex(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
: context.index.private[0]
|
|
127
|
-
}`
|
|
128
|
-
)
|
|
154
|
+
await loadIndex(context2, isPublic)
|
|
155
|
+
const pp = isPublic ? 'public' : 'private'
|
|
156
|
+
if (context2.index && context2.index[pp]&& context2.index[pp].length > 0) {
|
|
157
|
+
debug.log(`ensureOneTypeIndex: Type index exists already ${context2.index[pp]}`)
|
|
158
|
+
return context2
|
|
129
159
|
}
|
|
130
|
-
|
|
160
|
+
await makeIndexIfNecessary(context2, isPublic)
|
|
131
161
|
} catch (error) {
|
|
132
|
-
await makeIndexIfNecessary(
|
|
133
|
-
// widgets.complain(
|
|
162
|
+
await makeIndexIfNecessary(context2, isPublic)
|
|
163
|
+
// widgets.complain(context2, 'calling loadIndex:' + error)
|
|
134
164
|
}
|
|
135
165
|
}
|
|
136
166
|
|
|
@@ -142,9 +172,10 @@ export async function registerInTypeIndex (
|
|
|
142
172
|
context: AuthenticationContext,
|
|
143
173
|
instance: NamedNode,
|
|
144
174
|
theClass: NamedNode,
|
|
145
|
-
isPublic: boolean
|
|
175
|
+
isPublic: boolean,
|
|
176
|
+
agent?: NamedNode // Defaults to current user
|
|
146
177
|
): Promise<AuthenticationContext> {
|
|
147
|
-
await ensureOneTypeIndex(context, isPublic)
|
|
178
|
+
await ensureOneTypeIndex(context, isPublic, agent)
|
|
148
179
|
if (!context.index) {
|
|
149
180
|
throw new Error('registerInTypeIndex: No type index found')
|
|
150
181
|
}
|
|
@@ -167,4 +198,4 @@ isPublic: boolean
|
|
|
167
198
|
alert(e)
|
|
168
199
|
}
|
|
169
200
|
return context
|
|
170
|
-
}
|
|
201
|
+
}
|
package/src/util/UtilityLogic.ts
CHANGED
|
@@ -11,12 +11,12 @@ export const ACL_LINK = sym(
|
|
|
11
11
|
export class UtilityLogic {
|
|
12
12
|
store: LiveStore;
|
|
13
13
|
ns: SolidNamespace;
|
|
14
|
-
|
|
14
|
+
underlyingFetch: { fetch: (url: string, options?: any) => any };
|
|
15
15
|
|
|
16
|
-
constructor(store: LiveStore, ns: SolidNamespace,
|
|
16
|
+
constructor(store: LiveStore, ns: SolidNamespace, underlyingFetch: { fetch: (url: string, options?: any) => any }) {
|
|
17
17
|
this.store = store;
|
|
18
18
|
this.ns = ns;
|
|
19
|
-
this.
|
|
19
|
+
this.underlyingFetch = underlyingFetch;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async findAclDocUrl(url: string) {
|
|
@@ -65,7 +65,7 @@ export class UtilityLogic {
|
|
|
65
65
|
].join('\n')
|
|
66
66
|
}
|
|
67
67
|
const aclDocUrl = await this.findAclDocUrl(options.target);
|
|
68
|
-
return this.
|
|
68
|
+
return this.underlyingFetch.fetch(aclDocUrl, {
|
|
69
69
|
method: 'PUT',
|
|
70
70
|
body: str,
|
|
71
71
|
headers: [
|
|
@@ -83,7 +83,7 @@ export class UtilityLogic {
|
|
|
83
83
|
throw new Error("Cannot load doc, have no fetcher");
|
|
84
84
|
}
|
|
85
85
|
await this.store.fetcher.load(doc, {
|
|
86
|
-
withCredentials: false,
|
|
86
|
+
withCredentials: false, // @@ BUT this won't work when logged in an accessing private stuff!
|
|
87
87
|
cache: "reload",
|
|
88
88
|
});
|
|
89
89
|
// console.log('loaded', profileDocument, this.store)
|
|
@@ -98,7 +98,7 @@ export class UtilityLogic {
|
|
|
98
98
|
throw new Error(`Not a container URL ${url}`);
|
|
99
99
|
}
|
|
100
100
|
// Copied from https://github.com/solid/solid-crud-tests/blob/v3.1.0/test/surface/create-container.test.ts#L56-L64
|
|
101
|
-
const result = await this.
|
|
101
|
+
const result = await this.underlyingFetch.fetch(url, {
|
|
102
102
|
method: "PUT",
|
|
103
103
|
headers: {
|
|
104
104
|
"Content-Type": "text/turtle",
|
|
@@ -134,13 +134,13 @@ export class UtilityLogic {
|
|
|
134
134
|
try {
|
|
135
135
|
if (this.isContainer(url)) {
|
|
136
136
|
const aclDocUrl = await this.findAclDocUrl(url);
|
|
137
|
-
await this.
|
|
137
|
+
await this.underlyingFetch.fetch(aclDocUrl, { method: "DELETE" });
|
|
138
138
|
const containerMembers = await this.getContainerMembers(url);
|
|
139
139
|
await Promise.all(
|
|
140
140
|
containerMembers.map((url) => this.recursiveDelete(url))
|
|
141
141
|
);
|
|
142
142
|
}
|
|
143
|
-
return this.
|
|
143
|
+
return this.underlyingFetch.fetch(url, { method: "DELETE" });
|
|
144
144
|
} catch (e) {
|
|
145
145
|
// console.log(`Please manually remove ${url} from your system under test.`, e);
|
|
146
146
|
}
|
package/test/chatLogic.test.ts
CHANGED
|
@@ -20,7 +20,7 @@ describe("Chat logic", () => {
|
|
|
20
20
|
status: 404,
|
|
21
21
|
});
|
|
22
22
|
store = rdf.graph();
|
|
23
|
-
store.fetcher = rdf.fetcher(store, { fetch: fetchMock });
|
|
23
|
+
store.fetcher = rdf.fetcher(store, { fetch: fetchMock, timeout: 5 });
|
|
24
24
|
store.updater = new UpdateManager(store);
|
|
25
25
|
const authn = {
|
|
26
26
|
currentUser: () => {
|