solid-logic 1.3.14-9c8003a0 → 1.3.14-d30bbbcf
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/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 +1 -2
- package/lib/logic/SolidLogic.d.ts.map +1 -1
- package/lib/logic/SolidLogic.js +38 -39
- package/lib/logic/SolidLogic.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 +93 -31
- 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 +2 -2
- 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 +28 -31
- 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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NamedNode, LiveStore } from "rdflib";
|
|
2
|
+
declare type TypeIndex = {
|
|
3
|
+
label: string;
|
|
4
|
+
index: NamedNode;
|
|
5
|
+
agent: NamedNode;
|
|
6
|
+
};
|
|
7
|
+
export declare function loadProfile(store: LiveStore, user: any): Promise<any>;
|
|
8
|
+
export declare function loadPreferences(store: LiveStore, user: any): Promise<NamedNode | undefined>;
|
|
9
|
+
export declare function loadTypeIndexesFor(store: LiveStore, user: NamedNode): Promise<Array<TypeIndex>>;
|
|
10
|
+
export declare function loadCommunityTypeIndexes(store: LiveStore, user: NamedNode): Promise<TypeIndex[][]>;
|
|
11
|
+
export declare function loadAllTypeIndexes(store: LiveStore, user: NamedNode): Promise<TypeIndex[]>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=discoveryLogic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discoveryLogic.d.ts","sourceRoot":"","sources":["../../src/discovery/discoveryLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzD,aAAK,SAAS,GAAG;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAE;AAOzE,wBAAsB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,KAAA,gBAUvD;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,KAAA,GAAG,OAAO,CAAE,SAAS,GAAG,SAAS,CAAE,CAc9F;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAqBpG;AAED,wBAAsB,wBAAwB,CAAE,KAAK,EAAC,SAAS,EAAE,IAAI,EAAC,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAmBvG;AAED,wBAAsB,kBAAkB,CAAE,KAAK,EAAC,SAAS,EAAE,IAAI,EAAC,SAAS,wBAExE"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.loadAllTypeIndexes = exports.loadCommunityTypeIndexes = exports.loadTypeIndexesFor = exports.loadPreferences = exports.loadProfile = void 0;
|
|
40
|
+
var rdflib_1 = require("rdflib");
|
|
41
|
+
var ns = {
|
|
42
|
+
solid: (0, rdflib_1.Namespace)('http://www.w3.org/ns/solid/terms#'),
|
|
43
|
+
space: (0, rdflib_1.Namespace)('http://www.w3.org/ns/pim/space#')
|
|
44
|
+
};
|
|
45
|
+
function loadProfile(store, user) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
var err_1;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
if (!user) {
|
|
52
|
+
throw new Error("loadProfile: no user given.");
|
|
53
|
+
}
|
|
54
|
+
_a.label = 1;
|
|
55
|
+
case 1:
|
|
56
|
+
_a.trys.push([1, 3, , 4]);
|
|
57
|
+
return [4 /*yield*/, store.fetcher.load(user.doc())];
|
|
58
|
+
case 2:
|
|
59
|
+
_a.sent();
|
|
60
|
+
return [3 /*break*/, 4];
|
|
61
|
+
case 3:
|
|
62
|
+
err_1 = _a.sent();
|
|
63
|
+
throw new Error("Unable to load profile of user <".concat(user, ">: ").concat(err_1));
|
|
64
|
+
case 4: return [2 /*return*/, user.doc()];
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
exports.loadProfile = loadProfile;
|
|
70
|
+
function loadPreferences(store, user) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var profile, preferencesFile;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0: return [4 /*yield*/, loadProfile(store, user)];
|
|
76
|
+
case 1:
|
|
77
|
+
profile = _a.sent();
|
|
78
|
+
preferencesFile = store.any(user, ns.space('preferencesFile'), undefined, profile);
|
|
79
|
+
if (!preferencesFile) {
|
|
80
|
+
// throw new Error(`USer ${user} has no pointer in profile to preferences file.`)
|
|
81
|
+
return [2 /*return*/, undefined];
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
store.fetcher.load(preferencesFile);
|
|
85
|
+
}
|
|
86
|
+
catch (err) { // Mabeb a permission propblem or origin problem
|
|
87
|
+
return [2 /*return*/, undefined
|
|
88
|
+
// throw new Error(`Unable to load preferences file ${preferencesFile} of user <${user}>: ${err}`)
|
|
89
|
+
];
|
|
90
|
+
// throw new Error(`Unable to load preferences file ${preferencesFile} of user <${user}>: ${err}`)
|
|
91
|
+
}
|
|
92
|
+
return [2 /*return*/, preferencesFile];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
exports.loadPreferences = loadPreferences;
|
|
98
|
+
function loadTypeIndexesFor(store, user) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
100
|
+
var profile, publicTypeIndex, _a, pub, preferencesFile, privateTypeIndexes, priv;
|
|
101
|
+
return __generator(this, function (_b) {
|
|
102
|
+
switch (_b.label) {
|
|
103
|
+
case 0:
|
|
104
|
+
if (!user)
|
|
105
|
+
throw new Error("loadTypeIndexesFor: No user given");
|
|
106
|
+
return [4 /*yield*/, loadProfile(store, user)];
|
|
107
|
+
case 1:
|
|
108
|
+
profile = _b.sent();
|
|
109
|
+
publicTypeIndex = store.any(user, ns.solid('publicTypeIndex'), undefined, profile);
|
|
110
|
+
if (!publicTypeIndex) return [3 /*break*/, 5];
|
|
111
|
+
_b.label = 2;
|
|
112
|
+
case 2:
|
|
113
|
+
_b.trys.push([2, 4, , 5]);
|
|
114
|
+
return [4 /*yield*/, store.fetcher.load(publicTypeIndex)];
|
|
115
|
+
case 3:
|
|
116
|
+
_b.sent();
|
|
117
|
+
return [3 /*break*/, 5];
|
|
118
|
+
case 4:
|
|
119
|
+
_a = _b.sent();
|
|
120
|
+
return [3 /*break*/, 5];
|
|
121
|
+
case 5:
|
|
122
|
+
pub = publicTypeIndex ? [{ label: 'public', index: publicTypeIndex, agent: user }] : [];
|
|
123
|
+
return [4 /*yield*/, loadPreferences(store, user)];
|
|
124
|
+
case 6:
|
|
125
|
+
preferencesFile = _b.sent();
|
|
126
|
+
if (preferencesFile) { // watch out - can be in either as spec was not clear
|
|
127
|
+
privateTypeIndexes = store.each(user, ns.solid('privateTypeIndex'), undefined, preferencesFile)
|
|
128
|
+
.concat(store.each(user, ns.solid('privateTypeIndex'), undefined, profile));
|
|
129
|
+
priv = privateTypeIndexes.length > 0 ? [{ label: 'priSo @@@@@vate', index: privateTypeIndexes[0], agent: user }] : [];
|
|
130
|
+
return [2 /*return*/, pub.concat(priv)];
|
|
131
|
+
}
|
|
132
|
+
return [2 /*return*/, pub];
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
exports.loadTypeIndexesFor = loadTypeIndexesFor;
|
|
138
|
+
function loadCommunityTypeIndexes(store, user) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
140
|
+
var preferencesFile, communities, communityTypeIndexesPromise, result1;
|
|
141
|
+
var _this = this;
|
|
142
|
+
return __generator(this, function (_a) {
|
|
143
|
+
switch (_a.label) {
|
|
144
|
+
case 0: return [4 /*yield*/, loadPreferences(store, user)];
|
|
145
|
+
case 1:
|
|
146
|
+
preferencesFile = _a.sent();
|
|
147
|
+
if (preferencesFile) {
|
|
148
|
+
communities = store.each(user, ns.solid('community'), undefined, preferencesFile);
|
|
149
|
+
communityTypeIndexesPromise = communities.map(function (community) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
150
|
+
switch (_a.label) {
|
|
151
|
+
case 0: return [4 /*yield*/, loadTypeIndexesFor(store, community)];
|
|
152
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
153
|
+
}
|
|
154
|
+
}); }); });
|
|
155
|
+
result1 = Promise.all(communityTypeIndexesPromise);
|
|
156
|
+
// const result2 = Promise.all(result1)
|
|
157
|
+
// const flat = result2.flat()
|
|
158
|
+
return [2 /*return*/, result1
|
|
159
|
+
// const communityTypeIndexes = await Promise.all(communityTypeIndexesPromise)
|
|
160
|
+
/*
|
|
161
|
+
let result = [] as TypeIndex[]
|
|
162
|
+
for(const community of communities) {
|
|
163
|
+
result = result.concat(await loadTypeIndexesFor(store, community as NamedNode)) as TypeIndex[] // @@ how oto make functional with async?
|
|
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*/, []];
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
exports.loadCommunityTypeIndexes = loadCommunityTypeIndexes;
|
|
183
|
+
function loadAllTypeIndexes(store, user) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
185
|
+
var _a, _b;
|
|
186
|
+
return __generator(this, function (_c) {
|
|
187
|
+
switch (_c.label) {
|
|
188
|
+
case 0: return [4 /*yield*/, loadTypeIndexesFor(store, user)];
|
|
189
|
+
case 1:
|
|
190
|
+
_b = (_a = (_c.sent())).concat;
|
|
191
|
+
return [4 /*yield*/, loadCommunityTypeIndexes(store, user)];
|
|
192
|
+
case 2: return [2 /*return*/, _b.apply(_a, [(_c.sent()).flat()])];
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
exports.loadAllTypeIndexes = loadAllTypeIndexes;
|
|
198
|
+
/*
|
|
199
|
+
export async function getAppInstances (store:LiveStore, klass: NamedNode) {
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
*/
|
|
203
|
+
//# sourceMappingURL=discoveryLogic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discoveryLogic.js","sourceRoot":"","sources":["../../src/discovery/discoveryLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAyD;AAIzD,IAAM,EAAE,GAAE;IACR,KAAK,EAAE,IAAA,kBAAS,EAAC,mCAAmC,CAAC;IACrD,KAAK,EAAE,IAAA,kBAAS,EAAC,iCAAiC,CAAC;CACpD,CAAA;AAED,SAAsB,WAAW,CAAC,KAAgB,EAAE,IAAI;;;;;;oBACtD,IAAI,CAAC,IAAI,EAAE;wBACT,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAA;qBAC/C;;;;oBAEC,qBAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAA;;oBAApC,SAAoC,CAAA;;;;oBAEpC,MAAM,IAAI,KAAK,CAAC,0CAAmC,IAAI,gBAAM,KAAG,CAAE,CAAC,CAAA;wBAErE,sBAAO,IAAI,CAAC,GAAG,EAAE,EAAA;;;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AA2B,CAAC,CAAA;wBACxD,uCAAuC;wBACvC,8BAA8B;wBAC9B,sBAAO,OAAO;4BACd,8EAA8E;4BAC5E;;;;;4BAKA;4BACF,+CAA+C;0BARjC;wBACd,8EAA8E;wBAC5E;;;;;wBAKA;wBACF,+CAA+C;qBAChD;oBACD,sBAAO,EAAE,EAAA;;;;CACV;AAnBD,4DAmBC;AAED,SAAsB,kBAAkB,CAAE,KAAe,EAAE,IAAc;;;;;wBAC/D,qBAAM,kBAAkB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAA;;oBAAtC,KAAA,CAAA,KAAA,CAAC,SAAqC,CAAC,CAAA,CAAC,MAAM,CAAA;oBAAE,qBAAM,wBAAwB,CAAC,KAAK,EAAE,IAAI,CAAC,EAAA;wBAAlG,sBAAO,cAA+C,CAAC,SAA2C,CAAC,CAAC,IAAI,EAAE,EAAC,EAAA;;;;CAC5G;AAFD,gDAEC;AAED;;;;EAIE"}
|
package/lib/inbox/InboxLogic.js
CHANGED
|
@@ -108,7 +108,7 @@ var InboxLogic = /** @class */ (function () {
|
|
|
108
108
|
var _b;
|
|
109
109
|
return __generator(this, function (_c) {
|
|
110
110
|
switch (_c.label) {
|
|
111
|
-
case 0: return [4 /*yield*/, this.util.
|
|
111
|
+
case 0: return [4 /*yield*/, this.util.underlyingFetch.fetch(url)];
|
|
112
112
|
case 1:
|
|
113
113
|
downloaded = _c.sent();
|
|
114
114
|
if (downloaded.status !== 200) {
|
|
@@ -125,7 +125,7 @@ var InboxLogic = /** @class */ (function () {
|
|
|
125
125
|
['Content-Type', downloaded.headers.get('Content-Type') || 'application/octet-stream']
|
|
126
126
|
],
|
|
127
127
|
_b);
|
|
128
|
-
return [4 /*yield*/, this.util.
|
|
128
|
+
return [4 /*yield*/, this.util.underlyingFetch.fetch(archiveUrl, options)];
|
|
129
129
|
case 3:
|
|
130
130
|
uploaded = _c.sent();
|
|
131
131
|
if (!(uploaded.status.toString()[0] === '2')) return [3 /*break*/, 5];
|
|
@@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AAI,KAAK,CAAC,kBAAW,GAAG,CAAE,CAAC,CAAC;yBACnC;wBACK,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;;4BAEpD,MAAM,EAAE,KAAK;;wBACP,qBAAM,UAAU,CAAC,IAAI,EAAE,EAAA;;wBAFzB,OAAO,IAEX,OAAI,GAAE,SAAuB;4BAC7B,UAAO,GAAE;gCACP,CAAE,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,0BAA0B,CAAE;6BACzF;+BACF;wBACgB,qBAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;wBAArE,QAAQ,GAAG,SAA0D;6BACvE,CAAA,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAA,EAArC,wBAAqC;wBACvC,qBAAM,CAAA,MAAA,IAAI,CAAC,KAAK,CAAC,OAAO,0CAAE,MAAM,CAAC,GAAG,EAAE;gCACpC,MAAM,EAAE,QAAQ;6BACjB,CAAC,CAAA,EAAA;;wBAFF,SAEE,CAAC;;;;;;KAEN;IACH,iBAAC;AAAD,CAAC,AAzDD,IAyDC;AAzDY,gCAAU"}
|
package/lib/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ declare const chat: import("./chat/ChatLogic").ChatLogic;
|
|
|
5
5
|
declare const profile: import("./profile/ProfileLogic").ProfileLogic;
|
|
6
6
|
export { setACLUserPublic, genACLText } from './acl/aclLogic';
|
|
7
7
|
export { ensureTypeIndexes, loadTypeIndexes, registerInTypeIndex, loadIndex } from './typeIndex/typeIndexLogic';
|
|
8
|
+
export { loadProfile, loadPreferences, loadTypeIndexesFor, loadCommunityTypeIndexes, loadAllTypeIndexes } from './discovery/discoveryLogic';
|
|
8
9
|
export { SolidLogic } from './logic/SolidLogic';
|
|
9
10
|
export { offlineTestID, appContext } from './authn/authUtil';
|
|
10
11
|
export { ACL_LINK } from './util/UtilityLogic';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,KAAK,8BAA4B,CAAA;AACvC,QAAA,MAAM,WAAW,sDAAwC,CAAA;AACzD,QAAA,MAAM,KAAK,4BAA4B,CAAA;AAEvC,QAAA,MAAM,IAAI,sCAA2B,CAAA;AACrC,QAAA,MAAM,OAAO,+CAA8B,CAAA;AAE3C,OAAO,EACL,gBAAgB,EAChB,UAAU,EACX,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,KAAK,8BAA4B,CAAA;AACvC,QAAA,MAAM,WAAW,sDAAwC,CAAA;AACzD,QAAA,MAAM,KAAK,4BAA4B,CAAA;AAEvC,QAAA,MAAM,IAAI,sCAA2B,CAAA;AACrC,QAAA,MAAM,OAAO,+CAA8B,CAAA;AAE3C,OAAO,EACL,gBAAgB,EAChB,UAAU,EACX,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,SAAS,EACV,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACvI,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.profile = exports.chat = exports.store = exports.authSession = exports.authn = exports.FetchError = exports.NotFoundError = exports.SameOriginForbiddenError = exports.CrossOriginForbiddenError = exports.UnauthorizedError = exports.solidLogicSingleton = exports.getSuggestedIssuers = exports.ACL_LINK = exports.appContext = exports.offlineTestID = exports.SolidLogic = exports.loadIndex = exports.registerInTypeIndex = exports.loadTypeIndexes = exports.ensureTypeIndexes = exports.genACLText = exports.setACLUserPublic = void 0;
|
|
3
|
+
exports.profile = exports.chat = exports.store = exports.authSession = exports.authn = exports.FetchError = exports.NotFoundError = exports.SameOriginForbiddenError = exports.CrossOriginForbiddenError = exports.UnauthorizedError = exports.solidLogicSingleton = exports.getSuggestedIssuers = exports.ACL_LINK = exports.appContext = exports.offlineTestID = exports.SolidLogic = exports.loadAllTypeIndexes = exports.loadCommunityTypeIndexes = exports.loadTypeIndexesFor = exports.loadPreferences = exports.loadProfile = exports.loadIndex = exports.registerInTypeIndex = exports.loadTypeIndexes = exports.ensureTypeIndexes = exports.genACLText = exports.setACLUserPublic = void 0;
|
|
4
4
|
// Make these variables directly accessible as it is what you need most of the time
|
|
5
5
|
// This also makes these variable globaly accesible in mashlib
|
|
6
6
|
var solidLogicSingleton_1 = require("./logic/solidLogicSingleton");
|
|
@@ -22,6 +22,12 @@ Object.defineProperty(exports, "ensureTypeIndexes", { enumerable: true, get: fun
|
|
|
22
22
|
Object.defineProperty(exports, "loadTypeIndexes", { enumerable: true, get: function () { return typeIndexLogic_1.loadTypeIndexes; } });
|
|
23
23
|
Object.defineProperty(exports, "registerInTypeIndex", { enumerable: true, get: function () { return typeIndexLogic_1.registerInTypeIndex; } });
|
|
24
24
|
Object.defineProperty(exports, "loadIndex", { enumerable: true, get: function () { return typeIndexLogic_1.loadIndex; } });
|
|
25
|
+
var discoveryLogic_1 = require("./discovery/discoveryLogic");
|
|
26
|
+
Object.defineProperty(exports, "loadProfile", { enumerable: true, get: function () { return discoveryLogic_1.loadProfile; } });
|
|
27
|
+
Object.defineProperty(exports, "loadPreferences", { enumerable: true, get: function () { return discoveryLogic_1.loadPreferences; } });
|
|
28
|
+
Object.defineProperty(exports, "loadTypeIndexesFor", { enumerable: true, get: function () { return discoveryLogic_1.loadTypeIndexesFor; } });
|
|
29
|
+
Object.defineProperty(exports, "loadCommunityTypeIndexes", { enumerable: true, get: function () { return discoveryLogic_1.loadCommunityTypeIndexes; } });
|
|
30
|
+
Object.defineProperty(exports, "loadAllTypeIndexes", { enumerable: true, get: function () { return discoveryLogic_1.loadAllTypeIndexes; } });
|
|
25
31
|
var SolidLogic_1 = require("./logic/SolidLogic");
|
|
26
32
|
Object.defineProperty(exports, "SolidLogic", { enumerable: true, get: function () { return SolidLogic_1.SolidLogic; } });
|
|
27
33
|
var authUtil_1 = require("./authn/authUtil");
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAmF;AACnF,8DAA8D;AAC9D,mEAAiE;AACjE,IAAM,KAAK,GAAG,yCAAmB,CAAC,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mFAAmF;AACnF,8DAA8D;AAC9D,mEAAiE;AACjE,IAAM,KAAK,GAAG,yCAAmB,CAAC,KAAK,CAAA;AAmC9B,sBAAK;AAlCd,IAAM,WAAW,GAAG,yCAAmB,CAAC,KAAK,CAAC,WAAW,CAAA;AAkCzC,kCAAW;AAjC3B,IAAM,KAAK,GAAG,yCAAmB,CAAC,KAAK,CAAA;AAiCV,sBAAK;AA/BlC,IAAM,IAAI,GAAG,yCAAmB,CAAC,IAAI,CAAA;AA+BD,oBAAI;AA9BxC,IAAM,OAAO,GAAG,yCAAmB,CAAC,OAAO,CAAA;AA8BD,0BAAO;AA5BjD,2CAGuB;AAFrB,4GAAA,gBAAgB,OAAA;AAChB,sGAAA,UAAU,OAAA;AAGZ,6DAKmC;AAJjC,mHAAA,iBAAiB,OAAA;AACjB,iHAAA,eAAe,OAAA;AACf,qHAAA,mBAAmB,OAAA;AACnB,2GAAA,SAAS,OAAA;AAGX,6DAMmC;AALjC,6GAAA,WAAW,OAAA;AACX,iHAAA,eAAe,OAAA;AACf,oHAAA,kBAAkB,OAAA;AAClB,0HAAA,wBAAwB,OAAA;AACxB,oHAAA,kBAAkB,OAAA;AAGpB,iDAA+C;AAAtC,wGAAA,UAAU,OAAA;AACnB,6CAA4D;AAAnD,yGAAA,aAAa,OAAA;AAAE,sGAAA,UAAU,OAAA;AAClC,oDAA8C;AAArC,wGAAA,QAAQ,OAAA;AACjB,oDAA0D;AAAjD,kHAAA,mBAAmB,OAAA;AAE5B,6EAA6E;AAC7E,mEAAiE;AAAxD,0HAAA,mBAAmB,OAAA;AAC5B,mDAAuI;AAA9H,gHAAA,iBAAiB,OAAA;AAAE,wHAAA,yBAAyB,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAAE,4GAAA,aAAa,OAAA;AAAE,yGAAA,UAAU,OAAA"}
|
|
@@ -16,7 +16,7 @@ export declare class SolidLogic {
|
|
|
16
16
|
};
|
|
17
17
|
store: LiveStore;
|
|
18
18
|
me: string | undefined;
|
|
19
|
-
|
|
19
|
+
underlyingFetch: {
|
|
20
20
|
fetch: (url: string, options?: any) => any;
|
|
21
21
|
};
|
|
22
22
|
chat: ChatLogic;
|
|
@@ -27,7 +27,6 @@ export declare class SolidLogic {
|
|
|
27
27
|
fetch: (url: any, requestInit: any) => any;
|
|
28
28
|
}, session: Session);
|
|
29
29
|
findAclDocUrl(url: string): Promise<string>;
|
|
30
|
-
loadDoc(doc: NamedNode): Promise<void>;
|
|
31
30
|
loadProfile(me: NamedNode): Promise<NamedNode>;
|
|
32
31
|
loadPreferences(me: NamedNode): Promise<NamedNode>;
|
|
33
32
|
getTypeIndex(me: NamedNode | string, preferencesFile: NamedNode | string, isPublic: boolean): NamedNode[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidLogic.d.ts","sourceRoot":"","sources":["../../src/logic/SolidLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGzD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAkB,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"SolidLogic.d.ts","sourceRoot":"","sources":["../../src/logic/SolidLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGzD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,E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AS,GAAG,MAAM,GAAG,IAAI,EACxC,eAAe,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,EAC1C,SAAS,UAAgB,KAAK,uBAE7B,GACF,OAAO,CAAC;QACP,OAAO,EAAE,GAAG,CAAC;QACb,MAAM,EAAE,GAAG,CAAC;KACf,CAAC;IAyCI,iBAAiB,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM;IASvD,aAAa,CACT,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,EACrB,GAAG,GAAE,KAAK,CAAC,SAAS,CAAM,GAC3B,OAAO,CAAC,IAAI,CAAC;IAYhB,WAAW,CAAC,GAAG,EAAE,MAAM;IAIvB,oBAAoB,CAAC,aAAa,EAAE,SAAS,GAAG,SAAS,EAAE;IAI3D,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAItD,eAAe,CAAC,GAAG,EAAE,MAAM;IAIjC,UAAU;IAIJ,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAGzC"}
|
package/lib/logic/SolidLogic.js
CHANGED
|
@@ -67,51 +67,60 @@ var ProfileLogic_1 = require("../profile/ProfileLogic");
|
|
|
67
67
|
var debug = __importStar(require("../util/debug"));
|
|
68
68
|
var UtilityLogic_1 = require("../util/UtilityLogic");
|
|
69
69
|
var CustomError_1 = require("./CustomError");
|
|
70
|
+
/*
|
|
71
|
+
** It is important to distinquish `fetch`, a function provided by the browser
|
|
72
|
+
** and `Fetcher`, a helper object for the rdflib Store which turns it
|
|
73
|
+
** into a `ConnectedStore` or a `LiveStore`. A Fetcher object is
|
|
74
|
+
** available at store.fetcher, and `fetch` function at `store.fetcher._fetch`,
|
|
75
|
+
*/
|
|
70
76
|
var ns = (0, solid_namespace_1.default)(rdf);
|
|
71
77
|
var SolidLogic = /** @class */ (function () {
|
|
72
78
|
function SolidLogic(fetcher, session) {
|
|
79
|
+
// would xpect to be able to do it this way: but get TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation status: 999
|
|
80
|
+
// this.store = new rdf.LiveStore({})
|
|
81
|
+
// this.store.fetcher._fetch = fetch
|
|
73
82
|
this.store = rdf.graph(); // Make a Quad store
|
|
74
|
-
rdf.fetcher(this.store,
|
|
83
|
+
rdf.fetcher(this.store, fetch); // Attach a web I/O module, store.fetcher
|
|
75
84
|
this.store.updater = new rdf.UpdateManager(this.store); // Add real-time live updates store.updater
|
|
76
85
|
this.store.features = []; // disable automatic node merging on store load
|
|
77
86
|
this.cache = {
|
|
78
87
|
profileDocument: {},
|
|
79
88
|
preferencesFile: {},
|
|
80
89
|
};
|
|
81
|
-
this.
|
|
90
|
+
this.underlyingFetch = { fetch: fetch };
|
|
82
91
|
this.authn = new SolidAuthnLogic_1.SolidAuthnLogic(session);
|
|
83
92
|
debug.log('SolidAuthnLogic initialized');
|
|
84
93
|
this.profile = new ProfileLogic_1.ProfileLogic(this.store, ns, this.authn);
|
|
85
94
|
this.chat = new ChatLogic_1.ChatLogic(this.store, ns, this.profile);
|
|
86
|
-
this.util = new UtilityLogic_1.UtilityLogic(this.store, ns, this.
|
|
95
|
+
this.util = new UtilityLogic_1.UtilityLogic(this.store, ns, this.underlyingFetch);
|
|
87
96
|
}
|
|
88
97
|
SolidLogic.prototype.findAclDocUrl = function (url) {
|
|
89
98
|
return this.util.findAclDocUrl(url);
|
|
90
99
|
};
|
|
91
|
-
SolidLogic.prototype.loadDoc = function (doc) {
|
|
92
|
-
return this.util.loadDoc(doc);
|
|
93
|
-
};
|
|
94
100
|
SolidLogic.prototype.loadProfile = function (me) {
|
|
95
101
|
return __awaiter(this, void 0, void 0, function () {
|
|
96
102
|
var profileDocument, err_1, message;
|
|
97
103
|
return __generator(this, function (_a) {
|
|
98
104
|
switch (_a.label) {
|
|
99
105
|
case 0:
|
|
100
|
-
|
|
106
|
+
/*
|
|
107
|
+
// console.log('loadProfile cache ', this.cache)
|
|
101
108
|
if (this.cache.profileDocument[me.value]) {
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
return this.cache.profileDocument[me.value];
|
|
110
|
+
} @@ just use the cache in the store
|
|
111
|
+
*/
|
|
112
|
+
console.log('loadProfile me ', me);
|
|
113
|
+
profileDocument = me.doc();
|
|
104
114
|
_a.label = 1;
|
|
105
115
|
case 1:
|
|
106
116
|
_a.trys.push([1, 3, , 4]);
|
|
107
|
-
|
|
108
|
-
return [4 /*yield*/, this.loadDoc(profileDocument)];
|
|
117
|
+
return [4 /*yield*/, this.store.fetcher.load(profileDocument)];
|
|
109
118
|
case 2:
|
|
110
119
|
_a.sent();
|
|
111
120
|
return [2 /*return*/, profileDocument];
|
|
112
121
|
case 3:
|
|
113
122
|
err_1 = _a.sent();
|
|
114
|
-
message = "
|
|
123
|
+
message = "Cannot load profile ".concat(profileDocument, " : ").concat(err_1);
|
|
115
124
|
throw new Error(message);
|
|
116
125
|
case 4: return [2 /*return*/];
|
|
117
126
|
}
|
|
@@ -135,27 +144,27 @@ var SolidLogic = /** @class */ (function () {
|
|
|
135
144
|
return __generator(this, function (_a) {
|
|
136
145
|
switch (_a.label) {
|
|
137
146
|
case 0:
|
|
138
|
-
|
|
147
|
+
console.log('loadPreferences cache ', this.cache);
|
|
139
148
|
if (this.cache.preferencesFile[me.value]) {
|
|
140
149
|
return [2 /*return*/, this.cache.preferencesFile[me.value]];
|
|
141
150
|
}
|
|
142
|
-
|
|
151
|
+
return [4 /*yield*/, this.loadProfile(me)]; // Load pointer to pref file
|
|
152
|
+
case 1:
|
|
153
|
+
_a.sent(); // Load pointer to pref file
|
|
154
|
+
preferencesFile = this.store.any(me, ns.space('preferencesFile'), null, me.doc());
|
|
143
155
|
if (!preferencesFile) {
|
|
144
156
|
throw new Error("Can't find a preference file pointer in profile ".concat(me.doc()));
|
|
145
157
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
_a.label = 1;
|
|
150
|
-
case 1:
|
|
151
|
-
_a.trys.push([1, 3, , 4]);
|
|
158
|
+
_a.label = 2;
|
|
159
|
+
case 2:
|
|
160
|
+
_a.trys.push([2, 4, , 5]);
|
|
152
161
|
return [4 /*yield*/, this.store.fetcher.load(preferencesFile, {
|
|
153
162
|
withCredentials: true,
|
|
154
163
|
})];
|
|
155
|
-
case 2:
|
|
156
|
-
_a.sent();
|
|
157
|
-
return [3 /*break*/, 4];
|
|
158
164
|
case 3:
|
|
165
|
+
_a.sent();
|
|
166
|
+
return [3 /*break*/, 5];
|
|
167
|
+
case 4:
|
|
159
168
|
err_2 = _a.sent();
|
|
160
169
|
status_1 = err_2.status;
|
|
161
170
|
debug.log("HTTP status ".concat(status_1, " for preference file ").concat(preferencesFile));
|
|
@@ -172,7 +181,7 @@ var SolidLogic = /** @class */ (function () {
|
|
|
172
181
|
throw new CustomError_1.NotFoundError(preferencesFile.value);
|
|
173
182
|
}
|
|
174
183
|
throw new CustomError_1.FetchError(err_2.status, err_2.message);
|
|
175
|
-
case
|
|
184
|
+
case 5: return [2 /*return*/, preferencesFile];
|
|
176
185
|
}
|
|
177
186
|
});
|
|
178
187
|
});
|
|
@@ -190,9 +199,6 @@ var SolidLogic = /** @class */ (function () {
|
|
|
190
199
|
});
|
|
191
200
|
};
|
|
192
201
|
SolidLogic.prototype.load = function (doc) {
|
|
193
|
-
if (!this.store.fetcher) {
|
|
194
|
-
throw new Error("Cannot load doc(s), have no fetcher");
|
|
195
|
-
}
|
|
196
202
|
return this.store.fetcher.load(doc);
|
|
197
203
|
};
|
|
198
204
|
SolidLogic.prototype.loadIndexes = function (me, publicProfile, preferencesFile, onWarning) {
|
|
@@ -252,14 +258,10 @@ var SolidLogic = /** @class */ (function () {
|
|
|
252
258
|
return __awaiter(this, void 0, void 0, function () {
|
|
253
259
|
return __generator(this, function (_a) {
|
|
254
260
|
switch (_a.label) {
|
|
255
|
-
case 0:
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}
|
|
259
|
-
return [4 /*yield*/, this.store.fetcher.webOperation("PUT", doc.uri, {
|
|
260
|
-
data: "# ".concat(new Date(), " ").concat(comment, "\n "),
|
|
261
|
-
contentType: "text/turtle",
|
|
262
|
-
})];
|
|
261
|
+
case 0: return [4 /*yield*/, this.store.fetcher.webOperation("PUT", doc.uri, {
|
|
262
|
+
data: "# ".concat(new Date(), " ").concat(comment, "\n "),
|
|
263
|
+
contentType: "text/turtle",
|
|
264
|
+
})];
|
|
263
265
|
case 1:
|
|
264
266
|
_a.sent();
|
|
265
267
|
return [2 /*return*/];
|
|
@@ -272,9 +274,6 @@ var SolidLogic = /** @class */ (function () {
|
|
|
272
274
|
var _this = this;
|
|
273
275
|
if (ins === void 0) { ins = []; }
|
|
274
276
|
return new Promise(function (resolve, reject) {
|
|
275
|
-
if (!_this.store.updater) {
|
|
276
|
-
throw new Error("Cannot updatePromise, have no updater");
|
|
277
|
-
}
|
|
278
277
|
_this.store.updater.update(del, ins, function (_uri, ok, errorBody) {
|
|
279
278
|
if (!ok) {
|
|
280
279
|
reject(new Error(errorBody));
|
|
@@ -307,7 +306,7 @@ var SolidLogic = /** @class */ (function () {
|
|
|
307
306
|
SolidLogic.prototype.fetch = function (url, options) {
|
|
308
307
|
return __awaiter(this, void 0, void 0, function () {
|
|
309
308
|
return __generator(this, function (_a) {
|
|
310
|
-
return [2 /*return*/, this.
|
|
309
|
+
return [2 /*return*/, this.underlyingFetch.fetch(url, options)];
|
|
311
310
|
});
|
|
312
311
|
});
|
|
313
312
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolidLogic.js","sourceRoot":"","sources":["../../src/logic/SolidLogic.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA8B;AAE9B,oEAA6C;AAC7C,4DAA2D;AAC3D,+CAA8C;AAC9C,wDAAuD;AAEvD,mDAAuC;AACvC,qDAAoD;AACpD,6CAAkI;
|
|
1
|
+
{"version":3,"file":"SolidL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CAAC,CAAC,CAAC,CAAC,UAAU;IAClB,CAAC;IAED,gCAAW,GAAX,UAAY,GAAW;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;IAED,yCAAoB,GAApB,UAAqB,aAAwB;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC;IACzD,CAAC;IAED,wCAAmB,GAAnB,UAAoB,YAAoB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;IACvD,CAAC;IAEK,oCAAe,GAArB,UAAsB,GAAW;;;gBAC7B,sBAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAC;;;KACzC;IAED,+BAAU,GAAV;QACI,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IAEK,0BAAK,GAAX,UAAY,GAAW,EAAE,OAAa;;;gBAClC,sBAAO,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,EAAC;;;KACnD;IACL,iBAAC;AAAD,CAAC,AAjPD,IAiPC;AAjPY,gCAAU"}
|
|
@@ -4,19 +4,19 @@ export declare const ns: any;
|
|
|
4
4
|
/**
|
|
5
5
|
* Resolves with the same context, outputting
|
|
6
6
|
* output: index.public, index.private
|
|
7
|
-
*
|
|
7
|
+
* @@ This is a very bizare function
|
|
8
8
|
* @see https://github.com/solid/solid/blob/main/proposals/data-discovery.md#discoverability
|
|
9
9
|
*/
|
|
10
10
|
export declare function loadIndex(context: AuthenticationContext, isPublic: boolean): Promise<AuthenticationContext>;
|
|
11
|
-
export declare function loadTypeIndexes(context: AuthenticationContext): Promise<AuthenticationContext>;
|
|
11
|
+
export declare function loadTypeIndexes(context: AuthenticationContext): Promise<AuthenticationContext | undefined>;
|
|
12
12
|
/**
|
|
13
13
|
* Resolves with the same context, outputting
|
|
14
14
|
* @see https://github.com/solid/solid/blob/main/proposals/data-discovery.md#discoverability
|
|
15
15
|
*/
|
|
16
|
-
export declare function ensureTypeIndexes(context: AuthenticationContext): Promise<AuthenticationContext>;
|
|
16
|
+
export declare function ensureTypeIndexes(context: AuthenticationContext, agent?: NamedNode): Promise<AuthenticationContext>;
|
|
17
17
|
/**
|
|
18
18
|
* Register a new app in a type index
|
|
19
19
|
* used in chat in bookmark.js (solid-ui)
|
|
20
20
|
*/
|
|
21
|
-
export declare function registerInTypeIndex(context: AuthenticationContext, instance: NamedNode, theClass: NamedNode, isPublic: boolean): Promise<AuthenticationContext>;
|
|
21
|
+
export declare function registerInTypeIndex(context: AuthenticationContext, instance: NamedNode, theClass: NamedNode, isPublic: boolean, agent?: NamedNode): Promise<AuthenticationContext>;
|
|
22
22
|
//# sourceMappingURL=typeIndexLogic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndexLogic.d.ts","sourceRoot":"","sources":["../../src/typeIndex/typeIndexLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AAK3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"typeIndexLogic.d.ts","sourceRoot":"","sources":["../../src/typeIndex/typeIndexLogic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,QAAQ,CAAA;AAK3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAIhD,eAAO,MAAM,EAAE,KAAuB,CAAA;AAWtC;;;;;GAKG;AACH,wBAAsB,SAAS,CAC/B,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,OAAO,GACd,OAAO,CAAC,qBAAqB,CAAC,CAYhC;AAED,wBAAsB,eAAe,CAAE,OAAO,EAAE,qBAAqB,8CAqBpE;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAE,OAAO,EAAE,qBAAqB,EAAE,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAO1H;AAyFD;;;GAGG;AACH,wBAAsB,mBAAmB,CACzC,OAAO,EAAE,qBAAqB,EAC9B,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,OAAO,EACjB,KAAK,CAAC,EAAE,SAAS,GACd,OAAO,CAAC,qBAAqB,CAAC,CAwBhC"}
|