solid-logic 4.0.0 → 4.0.1-58e8410
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/dist/solid-logic.esm.js +36 -36
- package/dist/solid-logic.esm.js.map +1 -1
- package/dist/solid-logic.esm.min.js +1 -1
- package/dist/solid-logic.esm.min.js.map +1 -1
- package/dist/solid-logic.js.map +1 -1
- package/dist/solid-logic.min.js.map +1 -1
- package/dist/versionInfo.js +8 -8
- package/package.json +2 -2
package/dist/solid-logic.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_rdflib__ from "rdflib";
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
4
|
/***/ 7:
|
|
@@ -6117,8 +6117,8 @@ function dist_events() {
|
|
|
6117
6117
|
|
|
6118
6118
|
const authSession = new Session();
|
|
6119
6119
|
|
|
6120
|
-
;// external "
|
|
6121
|
-
const
|
|
6120
|
+
;// external "rdflib"
|
|
6121
|
+
const external_rdflib_namespaceObject = __WEBPACK_EXTERNAL_MODULE_rdflib__;
|
|
6122
6122
|
// EXTERNAL MODULE: ./node_modules/solid-namespace/index.js
|
|
6123
6123
|
var solid_namespace = __webpack_require__(386);
|
|
6124
6124
|
var solid_namespace_default = /*#__PURE__*/__webpack_require__.n(solid_namespace);
|
|
@@ -6126,12 +6126,12 @@ var solid_namespace_default = /*#__PURE__*/__webpack_require__.n(solid_namespace
|
|
|
6126
6126
|
// Namespaces we commonly use and have common prefixes for around Solid
|
|
6127
6127
|
// Delegate to this which takes RDFlib as param.
|
|
6128
6128
|
|
|
6129
|
-
const ns_ns = solid_namespace_default()(
|
|
6129
|
+
const ns_ns = solid_namespace_default()(external_rdflib_namespaceObject);
|
|
6130
6130
|
|
|
6131
6131
|
;// ./src/acl/aclLogic.ts
|
|
6132
6132
|
|
|
6133
6133
|
|
|
6134
|
-
const ACL_LINK = (0,
|
|
6134
|
+
const ACL_LINK = (0,external_rdflib_namespaceObject.sym)('http://www.iana.org/assignments/link-relations/acl');
|
|
6135
6135
|
function createAclLogic(store) {
|
|
6136
6136
|
const ns = ns_ns;
|
|
6137
6137
|
async function findAclDocUrl(url) {
|
|
@@ -6214,8 +6214,8 @@ function createAclLogic(store) {
|
|
|
6214
6214
|
*/
|
|
6215
6215
|
function genACLText(docURI, me, aclURI, options = {}) {
|
|
6216
6216
|
const optPublic = options.public || [];
|
|
6217
|
-
const g = (0,
|
|
6218
|
-
const auth = (0,
|
|
6217
|
+
const g = (0,external_rdflib_namespaceObject.graph)();
|
|
6218
|
+
const auth = (0,external_rdflib_namespaceObject.Namespace)('http://www.w3.org/ns/auth/acl#');
|
|
6219
6219
|
let a = g.sym(`${aclURI}#a1`);
|
|
6220
6220
|
const acl = g.sym(aclURI);
|
|
6221
6221
|
const doc = g.sym(docURI);
|
|
@@ -6237,7 +6237,7 @@ function createAclLogic(store) {
|
|
|
6237
6237
|
g.add(a, auth('mode'), auth(optPublic[p]), acl); // Like 'Read' etc
|
|
6238
6238
|
}
|
|
6239
6239
|
}
|
|
6240
|
-
return (0,
|
|
6240
|
+
return (0,external_rdflib_namespaceObject.serialize)(acl, g, aclURI);
|
|
6241
6241
|
}
|
|
6242
6242
|
return {
|
|
6243
6243
|
findAclDocUrl,
|
|
@@ -6292,7 +6292,7 @@ function offlineTestID() {
|
|
|
6292
6292
|
$SolidTestEnvironment.username) {
|
|
6293
6293
|
// Test setup
|
|
6294
6294
|
log('Assuming the user is ' + $SolidTestEnvironment.username);
|
|
6295
|
-
return (0,
|
|
6295
|
+
return (0,external_rdflib_namespaceObject.sym)($SolidTestEnvironment.username);
|
|
6296
6296
|
}
|
|
6297
6297
|
// hack that makes SolidOS work in offline mode by adding the webId directly in html
|
|
6298
6298
|
// example usage: https://github.com/solidos/mashlib/blob/29b8b53c46bf02e0e219f0bacd51b0e9951001dd/test/contact/local.html#L37
|
|
@@ -6306,7 +6306,7 @@ function offlineTestID() {
|
|
|
6306
6306
|
if (!id)
|
|
6307
6307
|
return null;
|
|
6308
6308
|
log('Assuming user is ' + id);
|
|
6309
|
-
return (0,
|
|
6309
|
+
return (0,external_rdflib_namespaceObject.sym)(id);
|
|
6310
6310
|
}
|
|
6311
6311
|
return null;
|
|
6312
6312
|
}
|
|
@@ -6325,10 +6325,10 @@ class SolidAuthnLogic {
|
|
|
6325
6325
|
currentUser() {
|
|
6326
6326
|
const app = appContext();
|
|
6327
6327
|
if (app.viewingNoAuthPage) {
|
|
6328
|
-
return (0,
|
|
6328
|
+
return (0,external_rdflib_namespaceObject.sym)(app.webId);
|
|
6329
6329
|
}
|
|
6330
6330
|
if (this && this.session && this.session.info && this.session.info.webId && this.session.info.isLoggedIn) {
|
|
6331
|
-
return (0,
|
|
6331
|
+
return (0,external_rdflib_namespaceObject.sym)(this.session.info.webId);
|
|
6332
6332
|
}
|
|
6333
6333
|
return offlineTestID(); // null unless testing
|
|
6334
6334
|
}
|
|
@@ -6404,7 +6404,7 @@ class SolidAuthnLogic {
|
|
|
6404
6404
|
let webIdUri;
|
|
6405
6405
|
if (webId) {
|
|
6406
6406
|
webIdUri = (typeof webId === 'string') ? webId : webId.uri;
|
|
6407
|
-
const me = (0,
|
|
6407
|
+
const me = (0,external_rdflib_namespaceObject.namedNode)(webIdUri);
|
|
6408
6408
|
if (context) {
|
|
6409
6409
|
context.me = me;
|
|
6410
6410
|
}
|
|
@@ -6424,7 +6424,7 @@ class SolidAuthnLogic {
|
|
|
6424
6424
|
;// ./src/util/utils.ts
|
|
6425
6425
|
|
|
6426
6426
|
function newThing(doc) {
|
|
6427
|
-
return (0,
|
|
6427
|
+
return (0,external_rdflib_namespaceObject.sym)(doc.uri + '#' + 'id' + ('' + Date.now()));
|
|
6428
6428
|
}
|
|
6429
6429
|
function uniqueNodes(arr) {
|
|
6430
6430
|
const uris = arr.map(x => x.uri);
|
|
@@ -6452,13 +6452,13 @@ function suggestPreferencesFile(me) {
|
|
|
6452
6452
|
// const stripped = me.uri.replace(\/[p|P]rofile/\g, '/').replace(\/[p|P]ublic/\g, '/')
|
|
6453
6453
|
const folderURI = stripped.split('/').slice(0, -1).join('/') + '/Settings/';
|
|
6454
6454
|
const fileURI = folderURI + 'Preferences.ttl';
|
|
6455
|
-
return (0,
|
|
6455
|
+
return (0,external_rdflib_namespaceObject.sym)(fileURI);
|
|
6456
6456
|
}
|
|
6457
6457
|
function determineChatContainer(invitee, podRoot) {
|
|
6458
6458
|
// Create chat
|
|
6459
6459
|
// See https://gitter.im/solid/chat-app?at=5f3c800f855be416a23ae74a
|
|
6460
6460
|
const chatContainerStr = new URL(`IndividualChats/${new URL(invitee.value).host}/`, podRoot.value).toString();
|
|
6461
|
-
return new
|
|
6461
|
+
return new external_rdflib_namespaceObject.NamedNode(chatContainerStr);
|
|
6462
6462
|
}
|
|
6463
6463
|
|
|
6464
6464
|
;// ./src/chat/chatLogic.ts
|
|
@@ -6474,7 +6474,7 @@ function createChatLogic(store, profileLogic) {
|
|
|
6474
6474
|
// now that it has been created:
|
|
6475
6475
|
await store.fetcher.load(chatContainer);
|
|
6476
6476
|
// FIXME: check the Why value on this quad:
|
|
6477
|
-
const chatAclDoc = store.any(chatContainer, new
|
|
6477
|
+
const chatAclDoc = store.any(chatContainer, new external_rdflib_namespaceObject.NamedNode('http://www.iana.org/assignments/link-relations/acl'));
|
|
6478
6478
|
if (!chatAclDoc) {
|
|
6479
6479
|
throw new Error('Chat ACL doc not found!');
|
|
6480
6480
|
}
|
|
@@ -6509,9 +6509,9 @@ function createChatLogic(store, profileLogic) {
|
|
|
6509
6509
|
await store.fetcher.load(privateTypeIndex);
|
|
6510
6510
|
const reg = newThing(privateTypeIndex);
|
|
6511
6511
|
const ins = [
|
|
6512
|
-
(0,
|
|
6513
|
-
(0,
|
|
6514
|
-
(0,
|
|
6512
|
+
(0,external_rdflib_namespaceObject.st)(reg, ns.rdf('type'), ns.solid('TypeRegistration'), privateTypeIndex.doc()),
|
|
6513
|
+
(0,external_rdflib_namespaceObject.st)(reg, ns.solid('forClass'), ns.meeting('LongChat'), privateTypeIndex.doc()),
|
|
6514
|
+
(0,external_rdflib_namespaceObject.st)(reg, ns.solid('instance'), chatThing, privateTypeIndex.doc()),
|
|
6515
6515
|
];
|
|
6516
6516
|
await new Promise((resolve, reject) => {
|
|
6517
6517
|
store.updater.update([], ins, function (_uri, ok, errm) {
|
|
@@ -6530,7 +6530,7 @@ function createChatLogic(store, profileLogic) {
|
|
|
6530
6530
|
const chatContainer = determineChatContainer(invitee, podRoot);
|
|
6531
6531
|
let exists = true;
|
|
6532
6532
|
try {
|
|
6533
|
-
await store.fetcher.load(new
|
|
6533
|
+
await store.fetcher.load(new external_rdflib_namespaceObject.NamedNode(chatContainer.value + 'index.ttl#this'));
|
|
6534
6534
|
}
|
|
6535
6535
|
catch (e) {
|
|
6536
6536
|
exists = false;
|
|
@@ -6556,7 +6556,7 @@ function createChatLogic(store, profileLogic) {
|
|
|
6556
6556
|
const newChatDoc = newInstance.doc();
|
|
6557
6557
|
kb.add(newInstance, ns.rdf('type'), ns.meeting('LongChat'), newChatDoc);
|
|
6558
6558
|
kb.add(newInstance, ns.dc('title'), 'Chat channel', newChatDoc);
|
|
6559
|
-
kb.add(newInstance, ns.dc('created'), (0,
|
|
6559
|
+
kb.add(newInstance, ns.dc('created'), (0,external_rdflib_namespaceObject.term)(new Date(Date.now())), newChatDoc);
|
|
6560
6560
|
if (newPaneOptions.me) {
|
|
6561
6561
|
kb.add(newInstance, ns.dc('author'), newPaneOptions.me, newChatDoc);
|
|
6562
6562
|
}
|
|
@@ -6583,7 +6583,7 @@ function createChatLogic(store, profileLogic) {
|
|
|
6583
6583
|
async function getChat(invitee, createIfMissing = true) {
|
|
6584
6584
|
const { me, chatContainer, exists } = await findChat(invitee);
|
|
6585
6585
|
if (exists) {
|
|
6586
|
-
return new
|
|
6586
|
+
return new external_rdflib_namespaceObject.NamedNode(chatContainer.value + CHAT_LOCATION_IN_CONTAINER);
|
|
6587
6587
|
}
|
|
6588
6588
|
if (createIfMissing) {
|
|
6589
6589
|
const chatThing = await createChatThing(chatContainer, me);
|
|
@@ -6937,12 +6937,12 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
|
|
|
6937
6937
|
}
|
|
6938
6938
|
function suggestPublicTypeIndex(me) {
|
|
6939
6939
|
var _a;
|
|
6940
|
-
return (0,
|
|
6940
|
+
return (0,external_rdflib_namespaceObject.sym)(((_a = me.doc().dir()) === null || _a === void 0 ? void 0 : _a.uri) + 'publicTypeIndex.ttl');
|
|
6941
6941
|
}
|
|
6942
6942
|
// Note this one is based off the pref file not the profile
|
|
6943
6943
|
function suggestPrivateTypeIndex(preferencesFile) {
|
|
6944
6944
|
var _a;
|
|
6945
|
-
return (0,
|
|
6945
|
+
return (0,external_rdflib_namespaceObject.sym)(((_a = preferencesFile.doc().dir()) === null || _a === void 0 ? void 0 : _a.uri) + 'privateTypeIndex.ttl');
|
|
6946
6946
|
}
|
|
6947
6947
|
/*
|
|
6948
6948
|
* Register a new app in a type index
|
|
@@ -6953,9 +6953,9 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
|
|
|
6953
6953
|
const registration = newThing(index);
|
|
6954
6954
|
const ins = [
|
|
6955
6955
|
// See https://github.com/solid/solid/blob/main/proposals/data-discovery.md
|
|
6956
|
-
(0,
|
|
6957
|
-
(0,
|
|
6958
|
-
(0,
|
|
6956
|
+
(0,external_rdflib_namespaceObject.st)(registration, ns.rdf('type'), ns.solid('TypeRegistration'), index),
|
|
6957
|
+
(0,external_rdflib_namespaceObject.st)(registration, ns.solid('forClass'), theClass, index),
|
|
6958
|
+
(0,external_rdflib_namespaceObject.st)(registration, ns.solid('instance'), instance, index)
|
|
6959
6959
|
];
|
|
6960
6960
|
try {
|
|
6961
6961
|
await store.updater.update([], ins);
|
|
@@ -6990,7 +6990,7 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
|
|
|
6990
6990
|
const containers = store.each(reg, ns.solid('instanceContainer'), null, index);
|
|
6991
6991
|
for (const instance of containers) {
|
|
6992
6992
|
await store.fetcher.load(instance);
|
|
6993
|
-
results.push({ instance: (0,
|
|
6993
|
+
results.push({ instance: (0,external_rdflib_namespaceObject.sym)(instance.value), type: klass, scope });
|
|
6994
6994
|
}
|
|
6995
6995
|
}
|
|
6996
6996
|
}
|
|
@@ -7019,7 +7019,7 @@ function createTypeIndexLogic(store, authn, profileLogic, utilityLogic) {
|
|
|
7019
7019
|
function createContainerLogic(store) {
|
|
7020
7020
|
function getContainerElements(containerNode) {
|
|
7021
7021
|
return store
|
|
7022
|
-
.statementsMatching(containerNode, (0,
|
|
7022
|
+
.statementsMatching(containerNode, (0,external_rdflib_namespaceObject.sym)('http://www.w3.org/ns/ldp#contains'), undefined)
|
|
7023
7023
|
.map((st) => st.object);
|
|
7024
7024
|
}
|
|
7025
7025
|
function isContainer(url) {
|
|
@@ -7027,7 +7027,7 @@ function createContainerLogic(store) {
|
|
|
7027
7027
|
return nodeToString.charAt(nodeToString.length - 1) === '/';
|
|
7028
7028
|
}
|
|
7029
7029
|
async function createContainer(url) {
|
|
7030
|
-
const stringToNode = (0,
|
|
7030
|
+
const stringToNode = (0,external_rdflib_namespaceObject.sym)(url);
|
|
7031
7031
|
if (!isContainer(stringToNode)) {
|
|
7032
7032
|
throw new Error(`Not a container URL ${url}`);
|
|
7033
7033
|
}
|
|
@@ -7131,7 +7131,7 @@ function createUtilityLogic(store, aclLogic, containerLogic) {
|
|
|
7131
7131
|
throw new NotEditableError(msg);
|
|
7132
7132
|
}
|
|
7133
7133
|
try {
|
|
7134
|
-
await store.updater.update([], [(0,
|
|
7134
|
+
await store.updater.update([], [(0,external_rdflib_namespaceObject.st)(subject, predicate, object, doc)]);
|
|
7135
7135
|
}
|
|
7136
7136
|
catch (err) {
|
|
7137
7137
|
const msg = `followOrCreateLink: Error making link in ${doc} to ${object}: ${err}`;
|
|
@@ -7177,7 +7177,7 @@ function createUtilityLogic(store, aclLogic, containerLogic) {
|
|
|
7177
7177
|
''
|
|
7178
7178
|
].join('\n');
|
|
7179
7179
|
}
|
|
7180
|
-
const aclDocUrl = await aclLogic.findAclDocUrl((0,
|
|
7180
|
+
const aclDocUrl = await aclLogic.findAclDocUrl((0,external_rdflib_namespaceObject.sym)(options.target));
|
|
7181
7181
|
return store.fetcher._fetch(aclDocUrl, {
|
|
7182
7182
|
method: 'PUT',
|
|
7183
7183
|
body: str,
|
|
@@ -7221,9 +7221,9 @@ function createUtilityLogic(store, aclLogic, containerLogic) {
|
|
|
7221
7221
|
*/
|
|
7222
7222
|
function createSolidLogic(specialFetch, session) {
|
|
7223
7223
|
log('SolidLogic: Unique instance created. There should only be one of these.');
|
|
7224
|
-
const store =
|
|
7225
|
-
|
|
7226
|
-
store.updater = new
|
|
7224
|
+
const store = external_rdflib_namespaceObject.graph();
|
|
7225
|
+
external_rdflib_namespaceObject.fetcher(store, { fetch: specialFetch.fetch }); // Attach a web I/O module, store.fetcher
|
|
7226
|
+
store.updater = new external_rdflib_namespaceObject.UpdateManager(store); // Add real-time live updates store.updater
|
|
7227
7227
|
store.features = []; // disable automatic node merging on store load
|
|
7228
7228
|
const authn = new SolidAuthnLogic(session);
|
|
7229
7229
|
const acl = createAclLogic(store);
|