solid-logic 1.3.12 → 1.3.13-2814f205
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/.babelrc +0 -0
- package/.eslintrc.js +0 -0
- package/.github/workflows/ci.yml +38 -5
- package/.github/workflows/release.yml +0 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/jest.config.js +0 -0
- package/jest.setup.ts +0 -0
- package/lib/authn/NoAuthnLogic.d.ts +0 -0
- package/lib/authn/NoAuthnLogic.d.ts.map +0 -0
- package/lib/authn/NoAuthnLogic.js +0 -0
- package/lib/authn/NoAuthnLogic.js.map +0 -0
- package/lib/authn/SolidAuthnLogic.d.ts +0 -0
- package/lib/authn/SolidAuthnLogic.d.ts.map +0 -0
- package/lib/authn/SolidAuthnLogic.js +0 -0
- package/lib/authn/SolidAuthnLogic.js.map +0 -0
- package/lib/authn/index.d.ts +0 -0
- package/lib/authn/index.d.ts.map +0 -0
- package/lib/authn/index.js +0 -0
- package/lib/authn/index.js.map +0 -0
- package/lib/chat/ChatLogic.d.ts +2 -2
- package/lib/chat/ChatLogic.d.ts.map +1 -1
- package/lib/chat/ChatLogic.js +37 -32
- package/lib/chat/ChatLogic.js.map +1 -1
- package/lib/chat/determineChatContainer.d.ts +0 -0
- package/lib/chat/determineChatContainer.d.ts.map +0 -0
- package/lib/chat/determineChatContainer.js +0 -0
- package/lib/chat/determineChatContainer.js.map +0 -0
- package/lib/chat/integration.test.d.ts +0 -0
- package/lib/chat/integration.test.d.ts.map +0 -0
- package/lib/chat/integration.test.js +0 -0
- package/lib/chat/integration.test.js.map +0 -0
- package/lib/debug.d.ts +0 -0
- package/lib/debug.d.ts.map +0 -0
- package/lib/debug.js +0 -0
- package/lib/debug.js.map +0 -0
- package/lib/inbox/InboxLogic.d.ts +2 -2
- package/lib/inbox/InboxLogic.d.ts.map +1 -1
- package/lib/inbox/InboxLogic.js +14 -13
- package/lib/inbox/InboxLogic.js.map +1 -1
- package/lib/inbox/unit.test.d.ts +0 -0
- package/lib/inbox/unit.test.d.ts.map +0 -0
- package/lib/inbox/unit.test.js +0 -0
- package/lib/inbox/unit.test.js.map +0 -0
- package/lib/index.d.ts +2 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -0
- package/lib/index.js.map +1 -1
- package/lib/profile/ProfileLogic.d.ts +2 -2
- package/lib/profile/ProfileLogic.d.ts.map +1 -1
- package/lib/profile/ProfileLogic.js +10 -8
- package/lib/profile/ProfileLogic.js.map +1 -1
- package/lib/uri.d.ts +0 -0
- package/lib/uri.d.ts.map +0 -0
- package/lib/uri.js +0 -0
- package/lib/uri.js.map +0 -0
- package/lib/util/UtilityLogic.d.ts +2 -2
- package/lib/util/UtilityLogic.d.ts.map +1 -1
- package/lib/util/UtilityLogic.js +10 -8
- package/lib/util/UtilityLogic.js.map +1 -1
- package/lib/util/unit.test.d.ts +0 -0
- package/lib/util/unit.test.d.ts.map +0 -0
- package/lib/util/unit.test.js +0 -0
- package/lib/util/unit.test.js.map +0 -0
- package/package.json +3 -3
- package/renovate.json +0 -0
- package/src/authn/NoAuthnLogic.ts +0 -0
- package/src/authn/SolidAuthnLogic.ts +0 -0
- package/src/authn/index.ts +0 -0
- package/src/chat/ChatLogic.ts +12 -12
- package/src/chat/determineChatContainer.ts +0 -0
- package/src/chat/integration.test.ts +0 -0
- package/src/debug.ts +0 -0
- package/src/inbox/InboxLogic.ts +3 -3
- package/src/inbox/unit.test.ts +0 -0
- package/src/index.ts +3 -2
- package/src/profile/ProfileLogic.ts +4 -4
- package/src/uri.ts +0 -0
- package/src/util/UtilityLogic.ts +4 -4
- package/src/util/unit.test.ts +0 -0
- package/tsconfig.json +0 -0
- package/lib/index-alain.d.ts +0 -75
- package/lib/index-alain.d.ts.map +0 -1
- package/lib/index-alain.js +0 -398
- package/lib/index-alain.js.map +0 -1
- package/lib/util/UtilityLogic-alain.d.ts +0 -32
- package/lib/util/UtilityLogic-alain.d.ts.map +0 -1
- package/lib/util/UtilityLogic-alain.js +0 -248
- package/lib/util/UtilityLogic-alain.js.map +0 -1
- package/src/index-alain.txt +0 -316
- package/src/util/UtilityLogic-alain.txt +0 -181
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UtilityLogic.d.ts","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAkC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"UtilityLogic.d.ts","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAkC,MAAM,QAAQ,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI1C,eAAO,MAAM,QAAQ,WAEpB,CAAC;AAYF;;GAEG;AACH,qBAAa,YAAY;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,cAAc,CAAC;IACnB,OAAO,EAAE;QAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,CAAA;KAAE,CAAC;gBAE5C,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE;QAAE,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,KAAK,GAAG,CAAA;KAAE;IAMnG,aAAa,CAAC,GAAG,EAAE,MAAM;IAWzB,mBAAmB,CAAC,OAAO,EAAE;QACjC,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,EAAE,MAAM,CAAA;KACf;IAsCK,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5C,WAAW,CAAC,GAAG,EAAE,MAAM;IAIjB,eAAe,CAAC,GAAG,EAAE,MAAM;IAmBjC,oBAAoB,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,EAAE;IAWrD,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO5D,eAAe,CAAC,GAAG,EAAE,MAAM;IAgBjC,UAAU;IAIV,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI;CAQ1C"}
|
package/lib/util/UtilityLogic.js
CHANGED
|
@@ -49,15 +49,16 @@ var UtilityLogic = /** @class */ (function () {
|
|
|
49
49
|
this.fetcher = fetcher;
|
|
50
50
|
}
|
|
51
51
|
UtilityLogic.prototype.findAclDocUrl = function (url) {
|
|
52
|
+
var _a;
|
|
52
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
53
54
|
var doc, docNode;
|
|
54
|
-
return __generator(this, function (
|
|
55
|
-
switch (
|
|
55
|
+
return __generator(this, function (_b) {
|
|
56
|
+
switch (_b.label) {
|
|
56
57
|
case 0:
|
|
57
58
|
doc = this.store.sym(url);
|
|
58
|
-
return [4 /*yield*/, this.store.fetcher.load(doc)];
|
|
59
|
+
return [4 /*yield*/, ((_a = this.store.fetcher) === null || _a === void 0 ? void 0 : _a.load(doc))];
|
|
59
60
|
case 1:
|
|
60
|
-
|
|
61
|
+
_b.sent();
|
|
61
62
|
docNode = this.store.any(doc, exports.ACL_LINK);
|
|
62
63
|
if (!docNode) {
|
|
63
64
|
throw new Error("No ACL link discovered for ".concat(url));
|
|
@@ -175,15 +176,16 @@ var UtilityLogic = /** @class */ (function () {
|
|
|
175
176
|
.map(function (st) { return st.object; });
|
|
176
177
|
};
|
|
177
178
|
UtilityLogic.prototype.getContainerMembers = function (containerUrl) {
|
|
179
|
+
var _a;
|
|
178
180
|
return __awaiter(this, void 0, void 0, function () {
|
|
179
181
|
var containerNode, nodes;
|
|
180
|
-
return __generator(this, function (
|
|
181
|
-
switch (
|
|
182
|
+
return __generator(this, function (_b) {
|
|
183
|
+
switch (_b.label) {
|
|
182
184
|
case 0:
|
|
183
185
|
containerNode = this.store.sym(containerUrl);
|
|
184
|
-
return [4 /*yield*/, this.store.fetcher.load(containerNode)];
|
|
186
|
+
return [4 /*yield*/, ((_a = this.store.fetcher) === null || _a === void 0 ? void 0 : _a.load(containerNode))];
|
|
185
187
|
case 1:
|
|
186
|
-
|
|
188
|
+
_b.sent();
|
|
187
189
|
nodes = this.getContainerElements(containerNode);
|
|
188
190
|
return [2 /*return*/, nodes.map(function (node) { return node.value; })];
|
|
189
191
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UtilityLogic.js","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"UtilityLogic.js","sourceRoot":"","sources":["../../src/util/UtilityLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA8E;AAKjE,QAAA,QAAQ,GAAG,IAAA,YAAG,EACzB,oDAAoD,CACrD,CAAC;AAYF;;GAEG;AACH;IAKE,sBAAY,KAAgB,EAAE,EAAkB,EAAE,OAAuD;QACvG,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,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,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,CACzD,EAAA;;wBAFD,SAEC,CAAC;;4BAEJ,sBAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAC;;;;;;;;KAIxD;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/lib/util/unit.test.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/util/unit.test.js
CHANGED
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-logic",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.13-2814f205",
|
|
4
4
|
"description": "Core business logic of Solid OS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"test": "jest",
|
|
10
10
|
"preversion": "npm test",
|
|
11
11
|
"postversion": "git push --follow-tags",
|
|
12
|
-
"prepublishOnly": "npm run build",
|
|
12
|
+
"ignore:prepublishOnly": "npm run build",
|
|
13
13
|
"watch": "tsc --watch"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"typescript": "4.5.4"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"rdflib": "^2.2.
|
|
44
|
+
"rdflib": "^2.2.17",
|
|
45
45
|
"solid-namespace": "^0.5.2"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/renovate.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/authn/index.ts
CHANGED
|
File without changes
|
package/src/chat/ChatLogic.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NamedNode, Node, st, term } from "rdflib";
|
|
2
|
-
import {
|
|
1
|
+
import { LiveStore, NamedNode, Node, st, term } from "rdflib";
|
|
2
|
+
import { SolidNamespace } from "../index";
|
|
3
3
|
import { ProfileLogic } from "../profile/ProfileLogic";
|
|
4
4
|
import { newThing } from "../uri";
|
|
5
5
|
import { determineChatContainer } from "./determineChatContainer";
|
|
@@ -38,7 +38,7 @@ export class ChatLogic {
|
|
|
38
38
|
// Some servers don't present a Link http response header
|
|
39
39
|
// if the container doesn't exist yet, so refetch the container
|
|
40
40
|
// now that it has been created:
|
|
41
|
-
await this.store.fetcher
|
|
41
|
+
await this.store.fetcher?.load(chatContainer);
|
|
42
42
|
|
|
43
43
|
// FIXME: check the Why value on this quad:
|
|
44
44
|
const chatAclDoc = this.store.any(
|
|
@@ -66,7 +66,7 @@ export class ChatLogic {
|
|
|
66
66
|
acl:mode
|
|
67
67
|
acl:Read, acl:Append.
|
|
68
68
|
`;
|
|
69
|
-
await this.store.fetcher
|
|
69
|
+
await this.store.fetcher?.webOperation("PUT", chatAclDoc.value, {
|
|
70
70
|
data: aclBody,
|
|
71
71
|
contentType: "text/turtle",
|
|
72
72
|
});
|
|
@@ -81,7 +81,7 @@ export class ChatLogic {
|
|
|
81
81
|
if (!privateTypeIndex) {
|
|
82
82
|
throw new Error("Private type index not found!");
|
|
83
83
|
}
|
|
84
|
-
await this.store.fetcher
|
|
84
|
+
await this.store.fetcher?.load(privateTypeIndex);
|
|
85
85
|
const reg = newThing(privateTypeIndex);
|
|
86
86
|
const ins = [
|
|
87
87
|
st(
|
|
@@ -99,7 +99,7 @@ export class ChatLogic {
|
|
|
99
99
|
st(reg, this.ns.solid("instance"), chatThing, privateTypeIndex.doc()),
|
|
100
100
|
];
|
|
101
101
|
await new Promise((resolve, reject) => {
|
|
102
|
-
this.store.updater
|
|
102
|
+
this.store.updater?.update([], ins, function (_uri, ok, errm) {
|
|
103
103
|
if (!ok) {
|
|
104
104
|
reject(new Error(errm));
|
|
105
105
|
} else {
|
|
@@ -115,7 +115,7 @@ export class ChatLogic {
|
|
|
115
115
|
const chatContainer = determineChatContainer(invitee, podRoot);
|
|
116
116
|
let exists = true;
|
|
117
117
|
try {
|
|
118
|
-
await this.store.fetcher
|
|
118
|
+
await this.store.fetcher?.load(
|
|
119
119
|
new NamedNode(chatContainer.value + "index.ttl#this")
|
|
120
120
|
);
|
|
121
121
|
} catch (e) {
|
|
@@ -165,7 +165,7 @@ export class ChatLogic {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
return new Promise(function (resolve, reject) {
|
|
168
|
-
updater
|
|
168
|
+
updater?.put(
|
|
169
169
|
newChatDoc,
|
|
170
170
|
kb.statementsMatching(undefined, undefined, undefined, newChatDoc),
|
|
171
171
|
"text/turtle",
|
|
@@ -213,7 +213,7 @@ export class ChatLogic {
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
private async sendInvite(invitee: NamedNode, chatThing: NamedNode) {
|
|
216
|
-
await this.store.fetcher
|
|
216
|
+
await this.store.fetcher?.load(invitee.doc());
|
|
217
217
|
const inviteeInbox = this.store.any(
|
|
218
218
|
invitee,
|
|
219
219
|
this.ns.ldp("inbox"),
|
|
@@ -228,7 +228,7 @@ export class ChatLogic {
|
|
|
228
228
|
${this.ns.rdf("seeAlso")} <${chatThing.value}> .
|
|
229
229
|
`;
|
|
230
230
|
|
|
231
|
-
const inviteResponse = await this.store.fetcher
|
|
231
|
+
const inviteResponse = await this.store.fetcher?.webOperation(
|
|
232
232
|
"POST",
|
|
233
233
|
inviteeInbox.value,
|
|
234
234
|
{
|
|
@@ -236,9 +236,9 @@ ${this.ns.rdf("seeAlso")} <${chatThing.value}> .
|
|
|
236
236
|
contentType: "text/turtle",
|
|
237
237
|
}
|
|
238
238
|
);
|
|
239
|
-
const locationStr = inviteResponse
|
|
239
|
+
const locationStr = inviteResponse?.headers.get("location");
|
|
240
240
|
if (!locationStr) {
|
|
241
|
-
throw new Error(`Invite sending returned a ${inviteResponse
|
|
241
|
+
throw new Error(`Invite sending returned a ${inviteResponse?.status}`);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
}
|
|
File without changes
|
|
File without changes
|
package/src/debug.ts
CHANGED
|
File without changes
|
package/src/inbox/InboxLogic.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// import { v4 as uuid } from "uuid";
|
|
2
|
-
import { NamedNode, Node, st, term } from "rdflib";
|
|
3
|
-
import {
|
|
2
|
+
import { LiveStore, NamedNode, Node, st, term } from "rdflib";
|
|
3
|
+
import { SolidNamespace } from "../index";
|
|
4
4
|
import { ProfileLogic } from "../profile/ProfileLogic";
|
|
5
5
|
import { UtilityLogic } from "../util/UtilityLogic";
|
|
6
6
|
// import { newThing } from "../uri";
|
|
@@ -70,7 +70,7 @@ export class InboxLogic {
|
|
|
70
70
|
};
|
|
71
71
|
const uploaded = await this.util.fetcher.fetch(archiveUrl, options);
|
|
72
72
|
if (uploaded.status.toString()[0] === '2') {
|
|
73
|
-
await this.store.fetcher
|
|
73
|
+
await this.store.fetcher?._fetch(url, {
|
|
74
74
|
method: 'DELETE'
|
|
75
75
|
});
|
|
76
76
|
}
|
package/src/inbox/unit.test.ts
CHANGED
|
File without changes
|
package/src/index.ts
CHANGED
|
@@ -10,18 +10,19 @@ import { ChatLogic } from "./chat/ChatLogic";
|
|
|
10
10
|
import * as debug from "./debug";
|
|
11
11
|
import { ProfileLogic } from "./profile/ProfileLogic";
|
|
12
12
|
import { UtilityLogic } from "./util/UtilityLogic";
|
|
13
|
+
import { ConnectedStore, LiveStore } from 'rdflib'
|
|
13
14
|
|
|
14
15
|
export { ACL_LINK } from './util/UtilityLogic';
|
|
15
16
|
|
|
16
17
|
const ns: SolidNamespace = solidNamespace(rdf);
|
|
17
18
|
|
|
18
|
-
interface ConnectedStore extends Store {
|
|
19
|
+
/* interface ConnectedStore extends Store {
|
|
19
20
|
fetcher: Fetcher;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface LiveStore extends ConnectedStore {
|
|
23
24
|
updater: UpdateManager;
|
|
24
|
-
}
|
|
25
|
+
} */
|
|
25
26
|
|
|
26
27
|
export interface SolidNamespace {
|
|
27
28
|
[key: string]: (term: string) => NamedNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NamedNode } from "rdflib";
|
|
1
|
+
import { LiveStore, NamedNode } from "rdflib";
|
|
2
2
|
import { AuthnLogic } from "../authn";
|
|
3
|
-
import {
|
|
3
|
+
import { SolidNamespace } from "../index";
|
|
4
4
|
|
|
5
5
|
export class ProfileLogic {
|
|
6
6
|
store: LiveStore;
|
|
@@ -18,7 +18,7 @@ export class ProfileLogic {
|
|
|
18
18
|
if (me === null) {
|
|
19
19
|
throw new Error("Current user not found! Not logged in?");
|
|
20
20
|
}
|
|
21
|
-
await this.store.fetcher
|
|
21
|
+
await this.store.fetcher?.load(me.doc());
|
|
22
22
|
return me;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -31,7 +31,7 @@ export class ProfileLogic {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
async getMainInbox(user: NamedNode): Promise<NamedNode> {
|
|
34
|
-
await this.store.fetcher
|
|
34
|
+
await this.store.fetcher?.load(user);
|
|
35
35
|
const mainInbox = this.store.any(user, this.ns.ldp("inbox"), undefined, user.doc());
|
|
36
36
|
if (!mainInbox) {
|
|
37
37
|
throw new Error("User main inbox not found!");
|
package/src/uri.ts
CHANGED
|
File without changes
|
package/src/util/UtilityLogic.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NamedNode, Node, st, term, sym, Statement } from "rdflib";
|
|
2
|
-
import {
|
|
1
|
+
import { LiveStore, NamedNode, Node, st, term, sym, Statement } from "rdflib";
|
|
2
|
+
import { SolidNamespace } from "../index";
|
|
3
3
|
import { ProfileLogic } from "../profile/ProfileLogic";
|
|
4
4
|
import { newThing } from "../uri";
|
|
5
5
|
|
|
@@ -33,7 +33,7 @@ export class UtilityLogic {
|
|
|
33
33
|
|
|
34
34
|
async findAclDocUrl(url: string) {
|
|
35
35
|
const doc = this.store.sym(url);
|
|
36
|
-
await this.store.fetcher
|
|
36
|
+
await this.store.fetcher?.load(doc);
|
|
37
37
|
const docNode = this.store.any(doc, ACL_LINK);
|
|
38
38
|
if (!docNode) {
|
|
39
39
|
throw new Error(`No ACL link discovered for ${url}`);
|
|
@@ -137,7 +137,7 @@ export class UtilityLogic {
|
|
|
137
137
|
|
|
138
138
|
async getContainerMembers(containerUrl: string): Promise<string[]> {
|
|
139
139
|
const containerNode = this.store.sym(containerUrl);
|
|
140
|
-
await this.store.fetcher
|
|
140
|
+
await this.store.fetcher?.load(containerNode);
|
|
141
141
|
const nodes = this.getContainerElements(containerNode);
|
|
142
142
|
return nodes.map(node => node.value);
|
|
143
143
|
}
|
package/src/util/unit.test.ts
CHANGED
|
File without changes
|
package/tsconfig.json
CHANGED
|
File without changes
|
package/lib/index-alain.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
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 { AuthnLogic } from "./authn";
|
|
5
|
-
import { ChatLogic } from "./chat/ChatLogic";
|
|
6
|
-
import { ProfileLogic } from "./profile/ProfileLogic";
|
|
7
|
-
import { UtilityLogic } from "./util/UtilityLogic";
|
|
8
|
-
export { ACL_LINK } from './util/UtilityLogic';
|
|
9
|
-
interface ConnectedStore extends Store {
|
|
10
|
-
fetcher: Fetcher;
|
|
11
|
-
}
|
|
12
|
-
export interface LiveStore extends ConnectedStore {
|
|
13
|
-
updater: UpdateManager;
|
|
14
|
-
}
|
|
15
|
-
export interface SolidNamespace {
|
|
16
|
-
[key: string]: (term: string) => NamedNode;
|
|
17
|
-
}
|
|
18
|
-
export declare class SolidLogic {
|
|
19
|
-
cache: {
|
|
20
|
-
profileDocument: {
|
|
21
|
-
[WebID: string]: NamedNode;
|
|
22
|
-
};
|
|
23
|
-
preferencesFile: {
|
|
24
|
-
[WebID: string]: NamedNode;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
store: LiveStore;
|
|
28
|
-
me: string | undefined;
|
|
29
|
-
fetcher: {
|
|
30
|
-
fetch: (url: string, options?: any) => any;
|
|
31
|
-
};
|
|
32
|
-
_fetch: Function;
|
|
33
|
-
chat: ChatLogic;
|
|
34
|
-
profile: ProfileLogic;
|
|
35
|
-
authn: AuthnLogic;
|
|
36
|
-
util: UtilityLogic;
|
|
37
|
-
constructor(fetcher: {
|
|
38
|
-
fetch: (url: any, requestInit: any) => any;
|
|
39
|
-
}, solidAuthSession: Session);
|
|
40
|
-
findAclDocUrl(url: string): Promise<string>;
|
|
41
|
-
loadDoc(doc: NamedNode): Promise<void>;
|
|
42
|
-
loadProfile(me: NamedNode): Promise<NamedNode>;
|
|
43
|
-
loadPreferences(me: NamedNode): Promise<NamedNode>;
|
|
44
|
-
getTypeIndex(me: NamedNode | string, preferencesFile: NamedNode | string, isPublic: boolean): NamedNode[];
|
|
45
|
-
getRegistrations(instance: any, theClass: any): rdf.Node[];
|
|
46
|
-
load(doc: NamedNode | NamedNode[] | string): Promise<Response> | Promise<Response[]>;
|
|
47
|
-
loadIndexes(me: NamedNode | string, publicProfile: NamedNode | string | null, preferencesFile: NamedNode | string | null, onWarning?: (_err: Error) => Promise<undefined>): Promise<{
|
|
48
|
-
private: any;
|
|
49
|
-
public: any;
|
|
50
|
-
}>;
|
|
51
|
-
createEmptyRdfDoc(doc: NamedNode, comment: string): Promise<void>;
|
|
52
|
-
updatePromise(del: Array<Statement>, ins?: Array<Statement>): Promise<void>;
|
|
53
|
-
isContainer(url: string): boolean;
|
|
54
|
-
getContainerElements(containerNode: NamedNode): NamedNode[];
|
|
55
|
-
getContainerMembers(containerUrl: string): Promise<string[]>;
|
|
56
|
-
recursiveDelete(url: string): Promise<any>;
|
|
57
|
-
clearStore(): void;
|
|
58
|
-
fetch(url: string, options?: any): Promise<any>;
|
|
59
|
-
}
|
|
60
|
-
declare class CustomError extends Error {
|
|
61
|
-
constructor(message?: string);
|
|
62
|
-
}
|
|
63
|
-
export declare class UnauthorizedError extends CustomError {
|
|
64
|
-
}
|
|
65
|
-
export declare class CrossOriginForbiddenError extends CustomError {
|
|
66
|
-
}
|
|
67
|
-
export declare class SameOriginForbiddenError extends CustomError {
|
|
68
|
-
}
|
|
69
|
-
export declare class NotFoundError extends CustomError {
|
|
70
|
-
}
|
|
71
|
-
export declare class FetchError extends CustomError {
|
|
72
|
-
status: number;
|
|
73
|
-
constructor(status: number, message?: string);
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=index-alain.d.ts.map
|
package/lib/index-alain.d.ts.map
DELETED
|
@@ -1 +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