solid-logic 1.3.17-2bf19bb6 → 1.3.17-64c8b7a5
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/lib/authn/SolidAuthnLogic.js +1 -1
- package/lib/authn/SolidAuthnLogic.js.map +1 -1
- package/lib/discovery/discoveryLogic.d.ts +31 -7
- package/lib/discovery/discoveryLogic.d.ts.map +1 -1
- package/lib/discovery/discoveryLogic.js +380 -81
- package/lib/discovery/discoveryLogic.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -4
- package/lib/index.js.map +1 -1
- package/lib/typeIndex/typeIndexLogic.js.map +1 -1
- package/lib/util/UtilityLogic.js +1 -1
- package/lib/util/UtilityLogic.js.map +1 -1
- package/package.json +3 -1
- package/src/authn/SolidAuthnLogic.ts +5 -5
- package/src/discovery/discoveryLogic.ts +227 -48
- package/src/index.ts +16 -3
- package/src/typeIndex/typeIndexLogic.ts +1 -1
- package/src/util/UtilityLogic.ts +1 -1
- package/test/discoveryLogic.test.ts +712 -0
- package/test/typeIndexLogic.test.ts +5 -4
|
@@ -78,7 +78,7 @@ var SolidAuthnLogic = /** @class */ (function () {
|
|
|
78
78
|
if (app.viewingNoAuthPage) {
|
|
79
79
|
return (0, rdflib_1.sym)(app.webId);
|
|
80
80
|
}
|
|
81
|
-
if (this.session.info.webId && this.session.info.isLoggedIn) {
|
|
81
|
+
if (this && this.session && this.session.info && this.session.info.webId && this.session.info.isLoggedIn) {
|
|
82
82
|
return (0, rdflib_1.sym)(this.session.info.webId);
|
|
83
83
|
}
|
|
84
84
|
return (0, authUtil_1.offlineTestID)(); // null unless testing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidAuthnLogic.js","sourceRoot":"","sources":["../../src/authn/SolidAuthnLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;gBACX,OAAO,CAAC,EAAE,GAAG,EAAE,CAAA;aAChB;YACD,OAAO,EAAE,CAAA;SACV;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,0CAAgB,GAAhB,UAAkB,OAAiD;QACjE,IAAM,KAAK,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,KAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;QACzE,OAAO,KAAK,CAAA;IACd,CAAC;IAEH,sBAAC;AAAD,CAAC,AArHD,IAqHC;AArHY,0CAAe"}
|
|
@@ -1,13 +1,37 @@
|
|
|
1
|
-
import { NamedNode, LiveStore } from
|
|
2
|
-
declare type
|
|
1
|
+
import { NamedNode, LiveStore } from 'rdflib';
|
|
2
|
+
declare type TypeIndexScope = {
|
|
3
3
|
label: string;
|
|
4
4
|
index: NamedNode;
|
|
5
5
|
agent: NamedNode;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
declare type ScopedApp = {
|
|
8
|
+
instance: NamedNode;
|
|
9
|
+
scope: TypeIndexScope;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Create a resource if it really does not exist
|
|
13
|
+
* Be absolutely sure something does not exist before creating a new empty file
|
|
14
|
+
* as otherwise existing could be deleted.
|
|
15
|
+
* @param doc {NamedNode} - The resource
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadOrCreateIfNotExists(store: LiveStore, doc: NamedNode): Promise<any>;
|
|
18
|
+
export declare function suggestPreferencesFile(me: NamedNode): NamedNode;
|
|
19
|
+
export declare function suggestPublicTypeIndex(me: NamedNode): NamedNode;
|
|
20
|
+
export declare function suggestPrivateTypeIndex(preferencesFile: NamedNode): NamedNode;
|
|
21
|
+
export declare function followOrCreateLink(store: LiveStore, subject: NamedNode, predicate: NamedNode, object: NamedNode, doc: NamedNode): Promise<NamedNode | null>;
|
|
22
|
+
export declare function loadProfile(store: LiveStore, user: NamedNode): Promise<NamedNode>;
|
|
23
|
+
export declare function loadPreferences(store: LiveStore, user: NamedNode): Promise<NamedNode | undefined>;
|
|
24
|
+
export declare function loadTypeIndexesFor(store: LiveStore, user: NamedNode): Promise<Array<TypeIndexScope>>;
|
|
25
|
+
export declare function loadCommunityTypeIndexes(store: LiveStore, user: NamedNode): Promise<TypeIndexScope[][]>;
|
|
26
|
+
export declare function loadAllTypeIndexes(store: LiveStore, user: NamedNode): Promise<TypeIndexScope[]>;
|
|
27
|
+
export declare function uniqueNodes(arr: NamedNode[]): NamedNode[];
|
|
28
|
+
export declare function getScopedAppsFromIndex(store: any, scope: any, theClass: NamedNode | null): Promise<{
|
|
29
|
+
instance: NamedNode;
|
|
30
|
+
scope: any;
|
|
31
|
+
}[]>;
|
|
32
|
+
export declare function getScopedAppInstances(store: LiveStore, klass: NamedNode, user: NamedNode): Promise<ScopedApp[]>;
|
|
33
|
+
export declare function getAppInstances(store: LiveStore, klass: NamedNode): Promise<NamedNode[]>;
|
|
34
|
+
export declare function registerInstanceInTypeIndex(store: LiveStore, instance: NamedNode, index: NamedNode, theClass: NamedNode): Promise<NamedNode | null>;
|
|
35
|
+
export declare function deleteTypeIndexRegistration(store: LiveStore, item: any): Promise<void>;
|
|
12
36
|
export {};
|
|
13
37
|
//# sourceMappingURL=discoveryLogic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discoveryLogic.d.ts","sourceRoot":"","sources":["../../src/discovery/discoveryLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"discoveryLogic.d.ts","sourceRoot":"","sources":["../../src/discovery/discoveryLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AAUtD,aAAK,cAAc,GAAG;IAAE,KAAK,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;AAED,wBAAsB,sBAAsB,CAAE,KAAK,KAAA,EAAE,KAAK,KAAA,EAAE,QAAQ,EAAE,SAAS,GAAG,IAAI;;;KAuBrF;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,GAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAQpH;AAKD,wBAAsB,eAAe,CAAE,KAAK,EAAC,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAK9F;AAOD,wBAAsB,2BAA2B,CAC/C,KAAK,EAAC,SAAS,EACf,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,SAAS,GAElB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAgB3B;AAED,wBAAsB,2BAA2B,CAAE,KAAK,EAAE,SAAS,EAAE,IAAI,KAAA,iBAKxE"}
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -35,16 +58,128 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
58
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
59
|
}
|
|
37
60
|
};
|
|
61
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
+
};
|
|
38
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.loadAllTypeIndexes = exports.loadCommunityTypeIndexes = exports.loadTypeIndexesFor = exports.loadPreferences = exports.loadProfile = void 0;
|
|
65
|
+
exports.deleteTypeIndexRegistration = exports.registerInstanceInTypeIndex = exports.getAppInstances = exports.getScopedAppInstances = exports.getScopedAppsFromIndex = exports.uniqueNodes = exports.loadAllTypeIndexes = exports.loadCommunityTypeIndexes = exports.loadTypeIndexesFor = exports.loadPreferences = exports.loadProfile = exports.followOrCreateLink = exports.suggestPrivateTypeIndex = exports.suggestPublicTypeIndex = exports.suggestPreferencesFile = exports.loadOrCreateIfNotExists = void 0;
|
|
40
66
|
var rdflib_1 = require("rdflib");
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
67
|
+
var $rdf = __importStar(require("rdflib"));
|
|
68
|
+
var solidLogicSingleton_1 = require("../logic/solidLogicSingleton");
|
|
69
|
+
var uri_1 = require("../util/uri");
|
|
70
|
+
var solid_namespace_1 = __importDefault(require("solid-namespace"));
|
|
71
|
+
var authn = solidLogicSingleton_1.solidLogicSingleton.authn;
|
|
72
|
+
var currentUser = authn.currentUser;
|
|
73
|
+
var ns = (0, solid_namespace_1.default)($rdf);
|
|
74
|
+
/**
|
|
75
|
+
* Create a resource if it really does not exist
|
|
76
|
+
* Be absolutely sure something does not exist before creating a new empty file
|
|
77
|
+
* as otherwise existing could be deleted.
|
|
78
|
+
* @param doc {NamedNode} - The resource
|
|
79
|
+
*/
|
|
80
|
+
function loadOrCreateIfNotExists(store, doc) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
var response, err_1, msg, msg;
|
|
83
|
+
return __generator(this, function (_a) {
|
|
84
|
+
switch (_a.label) {
|
|
85
|
+
case 0:
|
|
86
|
+
_a.trys.push([0, 2, , 3]);
|
|
87
|
+
return [4 /*yield*/, store.fetcher.load(doc)];
|
|
88
|
+
case 1:
|
|
89
|
+
response = _a.sent();
|
|
90
|
+
return [3 /*break*/, 3];
|
|
91
|
+
case 2:
|
|
92
|
+
err_1 = _a.sent();
|
|
93
|
+
if (err_1.response.status === 404) {
|
|
94
|
+
try {
|
|
95
|
+
store.fetcher.webOperation('PUT', doc, { data: '', contentType: 'text/turtle' });
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
msg = 'createIfNotExists: PUT FAILED: ' + doc + ': ' + err;
|
|
99
|
+
throw new Error(msg);
|
|
100
|
+
}
|
|
101
|
+
delete store.fetcher.requested[doc.uri]; // delete cached 404 error
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
msg = 'createIfNotExists doc load error NOT 404: ' + doc + ': ' + err_1;
|
|
105
|
+
throw new Error(msg); // @@ add nested errors
|
|
106
|
+
}
|
|
107
|
+
return [3 /*break*/, 3];
|
|
108
|
+
case 3: return [2 /*return*/, response];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
exports.loadOrCreateIfNotExists = loadOrCreateIfNotExists;
|
|
114
|
+
function suggestPreferencesFile(me) {
|
|
115
|
+
var stripped = me.uri.replace('/profile/', '/').replace('/public/', '/');
|
|
116
|
+
// const stripped = me.uri.replace(\/[p|P]rofile/\g, '/').replace(\/[p|P]ublic/\g, '/')
|
|
117
|
+
var folderURI = stripped.split('/').slice(0, -1).join('/') + '/Settings/';
|
|
118
|
+
var fileURI = folderURI + 'Preferences.ttl';
|
|
119
|
+
return (0, rdflib_1.sym)(fileURI);
|
|
120
|
+
}
|
|
121
|
+
exports.suggestPreferencesFile = suggestPreferencesFile;
|
|
122
|
+
function suggestPublicTypeIndex(me) {
|
|
123
|
+
var _a;
|
|
124
|
+
return (0, rdflib_1.sym)(((_a = me.doc().dir()) === null || _a === void 0 ? void 0 : _a.uri) + 'publicTypeIndex.ttl');
|
|
125
|
+
}
|
|
126
|
+
exports.suggestPublicTypeIndex = suggestPublicTypeIndex;
|
|
127
|
+
// Note this one is based off the pref file not the profile
|
|
128
|
+
function suggestPrivateTypeIndex(preferencesFile) {
|
|
129
|
+
var _a;
|
|
130
|
+
return (0, rdflib_1.sym)(((_a = preferencesFile.doc().dir()) === null || _a === void 0 ? void 0 : _a.uri) + 'privateTypeIndex.ttl');
|
|
131
|
+
}
|
|
132
|
+
exports.suggestPrivateTypeIndex = suggestPrivateTypeIndex;
|
|
133
|
+
/* Follow link from this doc to another thing, or else make a new link
|
|
134
|
+
**
|
|
135
|
+
** return: null no ld one and failed to make a new one
|
|
136
|
+
*/
|
|
137
|
+
function followOrCreateLink(store, subject, predicate, object, doc) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
+
var result, err_2, err_3;
|
|
140
|
+
return __generator(this, function (_a) {
|
|
141
|
+
switch (_a.label) {
|
|
142
|
+
case 0: return [4 /*yield*/, store.fetcher.load(doc)];
|
|
143
|
+
case 1:
|
|
144
|
+
_a.sent();
|
|
145
|
+
result = store.any(subject, predicate, null, doc);
|
|
146
|
+
if (result)
|
|
147
|
+
return [2 /*return*/, result];
|
|
148
|
+
if (!store.updater.editable(doc)) {
|
|
149
|
+
return [2 /*return*/, null];
|
|
150
|
+
}
|
|
151
|
+
_a.label = 2;
|
|
152
|
+
case 2:
|
|
153
|
+
_a.trys.push([2, 4, , 5]);
|
|
154
|
+
return [4 /*yield*/, store.updater.update([], [(0, rdflib_1.st)(subject, predicate, object, doc)])];
|
|
155
|
+
case 3:
|
|
156
|
+
_a.sent();
|
|
157
|
+
return [3 /*break*/, 5];
|
|
158
|
+
case 4:
|
|
159
|
+
err_2 = _a.sent();
|
|
160
|
+
console.warn("followOrCreateLink: Error making link in ".concat(doc, " to ").concat(object, ": ").concat(err_2));
|
|
161
|
+
return [2 /*return*/, null];
|
|
162
|
+
case 5:
|
|
163
|
+
_a.trys.push([5, 7, , 8]);
|
|
164
|
+
return [4 /*yield*/, loadOrCreateIfNotExists(store, object)
|
|
165
|
+
// store.fetcher.webOperation('PUT', object, { data: '', contentType: 'text/turtle'})
|
|
166
|
+
];
|
|
167
|
+
case 6:
|
|
168
|
+
_a.sent();
|
|
169
|
+
return [3 /*break*/, 8];
|
|
170
|
+
case 7:
|
|
171
|
+
err_3 = _a.sent();
|
|
172
|
+
console.warn("followOrCreateLink: Error loading or saving new linked document: ".concat(object, ": ").concat(err_3));
|
|
173
|
+
return [3 /*break*/, 8];
|
|
174
|
+
case 8: return [2 /*return*/, object];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
exports.followOrCreateLink = followOrCreateLink;
|
|
45
180
|
function loadProfile(store, user) {
|
|
46
181
|
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
-
var
|
|
182
|
+
var err_4;
|
|
48
183
|
return __generator(this, function (_a) {
|
|
49
184
|
switch (_a.label) {
|
|
50
185
|
case 0:
|
|
@@ -59,8 +194,8 @@ function loadProfile(store, user) {
|
|
|
59
194
|
_a.sent();
|
|
60
195
|
return [3 /*break*/, 4];
|
|
61
196
|
case 3:
|
|
62
|
-
|
|
63
|
-
throw new Error("Unable to load profile of user
|
|
197
|
+
err_4 = _a.sent();
|
|
198
|
+
throw new Error("Unable to load profile of user ".concat(user, ": ").concat(err_4));
|
|
64
199
|
case 4: return [2 /*return*/, user.doc()];
|
|
65
200
|
}
|
|
66
201
|
});
|
|
@@ -69,27 +204,32 @@ function loadProfile(store, user) {
|
|
|
69
204
|
exports.loadProfile = loadProfile;
|
|
70
205
|
function loadPreferences(store, user) {
|
|
71
206
|
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
-
var
|
|
207
|
+
var possiblePreferencesFile, preferencesFile, message, err_5;
|
|
73
208
|
return __generator(this, function (_a) {
|
|
74
209
|
switch (_a.label) {
|
|
75
210
|
case 0: return [4 /*yield*/, loadProfile(store, user)];
|
|
76
211
|
case 1:
|
|
77
|
-
|
|
78
|
-
|
|
212
|
+
_a.sent();
|
|
213
|
+
possiblePreferencesFile = suggestPreferencesFile(user);
|
|
214
|
+
return [4 /*yield*/, followOrCreateLink(store, user, ns.space('preferencesFile'), possiblePreferencesFile, user.doc())];
|
|
215
|
+
case 2:
|
|
216
|
+
preferencesFile = _a.sent();
|
|
79
217
|
if (!preferencesFile) {
|
|
80
|
-
|
|
218
|
+
message = "User ".concat(user, " has no pointer in profile to preferences file.");
|
|
219
|
+
console.warn(message);
|
|
81
220
|
return [2 /*return*/, undefined];
|
|
82
221
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return [2 /*return*/,
|
|
222
|
+
_a.label = 3;
|
|
223
|
+
case 3:
|
|
224
|
+
_a.trys.push([3, 5, , 6]);
|
|
225
|
+
return [4 /*yield*/, store.fetcher.load(preferencesFile)];
|
|
226
|
+
case 4:
|
|
227
|
+
_a.sent();
|
|
228
|
+
return [3 /*break*/, 6];
|
|
229
|
+
case 5:
|
|
230
|
+
err_5 = _a.sent();
|
|
231
|
+
return [2 /*return*/, undefined];
|
|
232
|
+
case 6: return [2 /*return*/, preferencesFile];
|
|
93
233
|
}
|
|
94
234
|
});
|
|
95
235
|
});
|
|
@@ -97,7 +237,7 @@ function loadPreferences(store, user) {
|
|
|
97
237
|
exports.loadPreferences = loadPreferences;
|
|
98
238
|
function loadTypeIndexesFor(store, user) {
|
|
99
239
|
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
-
var profile,
|
|
240
|
+
var profile, suggestion, publicTypeIndex, publicScopes, preferencesFile, err_6, privateScopes, suggestedPrivateTypeIndex, privateTypeIndex, _a, scopes, files, err_7;
|
|
101
241
|
return __generator(this, function (_b) {
|
|
102
242
|
switch (_b.label) {
|
|
103
243
|
case 0:
|
|
@@ -106,30 +246,55 @@ function loadTypeIndexesFor(store, user) {
|
|
|
106
246
|
return [4 /*yield*/, loadProfile(store, user)];
|
|
107
247
|
case 1:
|
|
108
248
|
profile = _b.sent();
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
_b.label = 2;
|
|
249
|
+
suggestion = suggestPublicTypeIndex(user);
|
|
250
|
+
return [4 /*yield*/, followOrCreateLink(store, user, ns.solid('publicTypeIndex'), suggestion, profile)];
|
|
112
251
|
case 2:
|
|
113
|
-
_b.
|
|
114
|
-
|
|
252
|
+
publicTypeIndex = _b.sent();
|
|
253
|
+
publicScopes = publicTypeIndex ? [{ label: 'public', index: publicTypeIndex, agent: user }] : [];
|
|
254
|
+
_b.label = 3;
|
|
115
255
|
case 3:
|
|
116
|
-
_b.
|
|
117
|
-
return [
|
|
256
|
+
_b.trys.push([3, 5, , 6]);
|
|
257
|
+
return [4 /*yield*/, loadPreferences(store, user)];
|
|
118
258
|
case 4:
|
|
119
|
-
|
|
120
|
-
return [3 /*break*/,
|
|
259
|
+
preferencesFile = _b.sent();
|
|
260
|
+
return [3 /*break*/, 6];
|
|
121
261
|
case 5:
|
|
122
|
-
|
|
123
|
-
|
|
262
|
+
err_6 = _b.sent();
|
|
263
|
+
preferencesFile = null;
|
|
264
|
+
return [3 /*break*/, 6];
|
|
124
265
|
case 6:
|
|
125
|
-
preferencesFile
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
266
|
+
if (!preferencesFile) return [3 /*break*/, 9];
|
|
267
|
+
suggestedPrivateTypeIndex = suggestPrivateTypeIndex(preferencesFile);
|
|
268
|
+
_a = store.any(user, ns.solid('privateTypeIndex'), undefined, profile);
|
|
269
|
+
if (_a) return [3 /*break*/, 8];
|
|
270
|
+
return [4 /*yield*/, followOrCreateLink(store, user, ns.solid('privateTypeIndex'), suggestedPrivateTypeIndex, preferencesFile)];
|
|
271
|
+
case 7:
|
|
272
|
+
_a = (_b.sent());
|
|
273
|
+
_b.label = 8;
|
|
274
|
+
case 8:
|
|
275
|
+
privateTypeIndex = _a;
|
|
276
|
+
privateScopes = privateTypeIndex ? [{ label: 'private', index: privateTypeIndex, agent: user }] : [];
|
|
277
|
+
return [3 /*break*/, 10];
|
|
278
|
+
case 9:
|
|
279
|
+
privateScopes = [];
|
|
280
|
+
_b.label = 10;
|
|
281
|
+
case 10:
|
|
282
|
+
scopes = publicScopes.concat(privateScopes);
|
|
283
|
+
if (scopes.length === 0)
|
|
284
|
+
return [2 /*return*/, scopes];
|
|
285
|
+
files = scopes.map(function (scope) { return scope.index; });
|
|
286
|
+
_b.label = 11;
|
|
287
|
+
case 11:
|
|
288
|
+
_b.trys.push([11, 13, , 14]);
|
|
289
|
+
return [4 /*yield*/, store.fetcher.load(files)];
|
|
290
|
+
case 12:
|
|
291
|
+
_b.sent();
|
|
292
|
+
return [3 /*break*/, 14];
|
|
293
|
+
case 13:
|
|
294
|
+
err_7 = _b.sent();
|
|
295
|
+
console.warn('Problems loading type index: ', err_7);
|
|
296
|
+
return [3 /*break*/, 14];
|
|
297
|
+
case 14: return [2 /*return*/, scopes];
|
|
133
298
|
}
|
|
134
299
|
});
|
|
135
300
|
});
|
|
@@ -137,44 +302,30 @@ function loadTypeIndexesFor(store, user) {
|
|
|
137
302
|
exports.loadTypeIndexesFor = loadTypeIndexesFor;
|
|
138
303
|
function loadCommunityTypeIndexes(store, user) {
|
|
139
304
|
return __awaiter(this, void 0, void 0, function () {
|
|
140
|
-
var preferencesFile, communities,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
switch (_a.label) {
|
|
305
|
+
var preferencesFile, communities, result, _i, communities_1, org, _a, _b;
|
|
306
|
+
return __generator(this, function (_c) {
|
|
307
|
+
switch (_c.label) {
|
|
144
308
|
case 0: return [4 /*yield*/, loadPreferences(store, user)];
|
|
145
309
|
case 1:
|
|
146
|
-
preferencesFile =
|
|
147
|
-
if (preferencesFile)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
*/
|
|
166
|
-
// return communityTypeIndexesPromise.resolve()
|
|
167
|
-
];
|
|
168
|
-
// const communityTypeIndexes = await Promise.all(communityTypeIndexesPromise)
|
|
169
|
-
/*
|
|
170
|
-
let result = [] as TypeIndex[]
|
|
171
|
-
for(const community of communities) {
|
|
172
|
-
result = result.concat(await loadTypeIndexesFor(store, community as NamedNode)) as TypeIndex[] // @@ how oto make functional with async?
|
|
173
|
-
}
|
|
174
|
-
*/
|
|
175
|
-
// return communityTypeIndexesPromise.resolve()
|
|
176
|
-
}
|
|
177
|
-
return [2 /*return*/, []];
|
|
310
|
+
preferencesFile = _c.sent();
|
|
311
|
+
if (!preferencesFile) return [3 /*break*/, 6];
|
|
312
|
+
communities = store.each(user, ns.solid('community'), undefined, preferencesFile).concat(store.each(user, ns.solid('community'), undefined, user.doc()));
|
|
313
|
+
result = [];
|
|
314
|
+
_i = 0, communities_1 = communities;
|
|
315
|
+
_c.label = 2;
|
|
316
|
+
case 2:
|
|
317
|
+
if (!(_i < communities_1.length)) return [3 /*break*/, 5];
|
|
318
|
+
org = communities_1[_i];
|
|
319
|
+
_b = (_a = result).concat;
|
|
320
|
+
return [4 /*yield*/, loadTypeIndexesFor(store, org)];
|
|
321
|
+
case 3:
|
|
322
|
+
result = _b.apply(_a, [_c.sent()]);
|
|
323
|
+
_c.label = 4;
|
|
324
|
+
case 4:
|
|
325
|
+
_i++;
|
|
326
|
+
return [3 /*break*/, 2];
|
|
327
|
+
case 5: return [2 /*return*/, result];
|
|
328
|
+
case 6: return [2 /*return*/, []]; // No communities
|
|
178
329
|
}
|
|
179
330
|
});
|
|
180
331
|
});
|
|
@@ -195,9 +346,157 @@ function loadAllTypeIndexes(store, user) {
|
|
|
195
346
|
});
|
|
196
347
|
}
|
|
197
348
|
exports.loadAllTypeIndexes = loadAllTypeIndexes;
|
|
349
|
+
// Utility: remove duplicates from Array of NamedNodes
|
|
350
|
+
function uniqueNodes(arr) {
|
|
351
|
+
var uris = arr.map(function (x) { return x.uri; });
|
|
352
|
+
var set = new Set(uris);
|
|
353
|
+
var uris2 = Array.from(set);
|
|
354
|
+
var arr2 = uris2.map(function (u) { return new rdflib_1.NamedNode(u); });
|
|
355
|
+
return arr2; // Array.from(new Set(arr.map(x => x.uri))).map(u => sym(u))
|
|
356
|
+
}
|
|
357
|
+
exports.uniqueNodes = uniqueNodes;
|
|
358
|
+
function getScopedAppsFromIndex(store, scope, theClass) {
|
|
359
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
360
|
+
var index, registrations, relevant, directInstances, instances, instanceContainers, containers, i, cont, contents;
|
|
361
|
+
return __generator(this, function (_a) {
|
|
362
|
+
switch (_a.label) {
|
|
363
|
+
case 0:
|
|
364
|
+
index = scope.index;
|
|
365
|
+
registrations = store.statementsMatching(null, ns.solid('instance'), null, index)
|
|
366
|
+
.concat(store.statementsMatching(null, ns.solid('instanceContainer'), null, index))
|
|
367
|
+
.map(function (st) { return st.subject; });
|
|
368
|
+
relevant = theClass ? registrations.filter(function (reg) { return store.any(reg, ns.solid('forClass'), null, index).sameTerm(theClass); })
|
|
369
|
+
: registrations;
|
|
370
|
+
directInstances = relevant.map(function (reg) { return store.each(reg, ns.solid('instance'), null, index); }).flat();
|
|
371
|
+
instances = uniqueNodes(directInstances);
|
|
372
|
+
instanceContainers = relevant.map(function (reg) { return store.each(reg, ns.solid('instanceContainer'), null, index); }).flat();
|
|
373
|
+
containers = uniqueNodes(instanceContainers);
|
|
374
|
+
if (containers.length > 0) {
|
|
375
|
+
console.log('@@ getScopedAppsFromIndex containers ', containers);
|
|
376
|
+
}
|
|
377
|
+
i = 0;
|
|
378
|
+
_a.label = 1;
|
|
379
|
+
case 1:
|
|
380
|
+
if (!(i < containers.length)) return [3 /*break*/, 4];
|
|
381
|
+
cont = containers[i];
|
|
382
|
+
return [4 /*yield*/, store.fetcher.load(cont)];
|
|
383
|
+
case 2:
|
|
384
|
+
_a.sent();
|
|
385
|
+
contents = store.each(cont, ns.ldp('contains'), null, cont);
|
|
386
|
+
instances = instances.concat(contents);
|
|
387
|
+
_a.label = 3;
|
|
388
|
+
case 3:
|
|
389
|
+
i++;
|
|
390
|
+
return [3 /*break*/, 1];
|
|
391
|
+
case 4: return [2 /*return*/, instances.map(function (instance) { return { instance: instance, scope: scope }; })];
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
exports.getScopedAppsFromIndex = getScopedAppsFromIndex;
|
|
397
|
+
function getScopedAppInstances(store, klass, user) {
|
|
398
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
399
|
+
var scopes, scopedApps, _i, scopes_1, scope, scopedApps0;
|
|
400
|
+
return __generator(this, function (_a) {
|
|
401
|
+
switch (_a.label) {
|
|
402
|
+
case 0: return [4 /*yield*/, loadAllTypeIndexes(store, user)];
|
|
403
|
+
case 1:
|
|
404
|
+
scopes = _a.sent();
|
|
405
|
+
scopedApps = [];
|
|
406
|
+
_i = 0, scopes_1 = scopes;
|
|
407
|
+
_a.label = 2;
|
|
408
|
+
case 2:
|
|
409
|
+
if (!(_i < scopes_1.length)) return [3 /*break*/, 5];
|
|
410
|
+
scope = scopes_1[_i];
|
|
411
|
+
return [4 /*yield*/, getScopedAppsFromIndex(store, scope, klass)];
|
|
412
|
+
case 3:
|
|
413
|
+
scopedApps0 = _a.sent();
|
|
414
|
+
scopedApps = scopedApps.concat(scopedApps0);
|
|
415
|
+
_a.label = 4;
|
|
416
|
+
case 4:
|
|
417
|
+
_i++;
|
|
418
|
+
return [3 /*break*/, 2];
|
|
419
|
+
case 5: return [2 /*return*/, scopedApps];
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
exports.getScopedAppInstances = getScopedAppInstances;
|
|
425
|
+
// This is the function signature which used to be in solid-ui/logic
|
|
426
|
+
// Recommended to use getScopedAppInstances instead as it provides more information.
|
|
427
|
+
//
|
|
428
|
+
function getAppInstances(store, klass) {
|
|
429
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
430
|
+
var user, scopedAppInstances;
|
|
431
|
+
return __generator(this, function (_a) {
|
|
432
|
+
switch (_a.label) {
|
|
433
|
+
case 0:
|
|
434
|
+
user = currentUser();
|
|
435
|
+
if (!user)
|
|
436
|
+
throw new Error('getAppInstances: Must be logged in to find apps.');
|
|
437
|
+
return [4 /*yield*/, getScopedAppInstances(store, klass, user)];
|
|
438
|
+
case 1:
|
|
439
|
+
scopedAppInstances = _a.sent();
|
|
440
|
+
return [2 /*return*/, scopedAppInstances.map(function (scoped) { return scoped.instance; })];
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
exports.getAppInstances = getAppInstances;
|
|
198
446
|
/*
|
|
199
|
-
|
|
200
|
-
|
|
447
|
+
* Register a new app in a type index
|
|
448
|
+
* used in chat in bookmark.js (solid-ui)
|
|
449
|
+
* Returns the registration object if successful else null
|
|
450
|
+
*/
|
|
451
|
+
function registerInstanceInTypeIndex(store, instance, index, theClass) {
|
|
452
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
453
|
+
var registration, ins, err_8, msg;
|
|
454
|
+
return __generator(this, function (_a) {
|
|
455
|
+
switch (_a.label) {
|
|
456
|
+
case 0:
|
|
457
|
+
registration = (0, uri_1.newThing)(index);
|
|
458
|
+
ins = [
|
|
459
|
+
// See https://github.com/solid/solid/blob/main/proposals/data-discovery.md
|
|
460
|
+
(0, rdflib_1.st)(registration, ns.rdf('type'), ns.solid('TypeRegistration'), index),
|
|
461
|
+
(0, rdflib_1.st)(registration, ns.solid('forClass'), theClass, index),
|
|
462
|
+
(0, rdflib_1.st)(registration, ns.solid('instance'), instance, index)
|
|
463
|
+
];
|
|
464
|
+
_a.label = 1;
|
|
465
|
+
case 1:
|
|
466
|
+
_a.trys.push([1, 3, , 4]);
|
|
467
|
+
return [4 /*yield*/, store.updater.update([], ins)];
|
|
468
|
+
case 2:
|
|
469
|
+
_a.sent();
|
|
470
|
+
return [3 /*break*/, 4];
|
|
471
|
+
case 3:
|
|
472
|
+
err_8 = _a.sent();
|
|
473
|
+
msg = "Unable to register ".concat(instance, " in index ").concat(index, ": ").concat(err_8);
|
|
474
|
+
console.warn(msg);
|
|
475
|
+
return [2 /*return*/, null];
|
|
476
|
+
case 4: return [2 /*return*/, registration];
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
});
|
|
201
480
|
}
|
|
202
|
-
|
|
481
|
+
exports.registerInstanceInTypeIndex = registerInstanceInTypeIndex;
|
|
482
|
+
function deleteTypeIndexRegistration(store, item) {
|
|
483
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
484
|
+
var reg, statements;
|
|
485
|
+
return __generator(this, function (_a) {
|
|
486
|
+
switch (_a.label) {
|
|
487
|
+
case 0:
|
|
488
|
+
reg = store.the(null, ns.solid('instance'), item.instance, item.scope.index);
|
|
489
|
+
if (!reg)
|
|
490
|
+
throw new Error("deleteTypeIndexRegistration: No registration found for ".concat(item.instance));
|
|
491
|
+
statements = store.statementsMatching(reg, null, null, item.scope.index);
|
|
492
|
+
return [4 /*yield*/, store.updater.update(statements, [])];
|
|
493
|
+
case 1:
|
|
494
|
+
_a.sent();
|
|
495
|
+
return [2 /*return*/];
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
exports.deleteTypeIndexRegistration = deleteTypeIndexRegistration;
|
|
501
|
+
// ENDS
|
|
203
502
|
//# sourceMappingURL=discoveryLogic.js.map
|