solid-ui 2.4.27-fd5a7172 → 2.4.28-6f763399
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-ui.js +95 -72
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.map +1 -1
- package/lib/chat/chatLogic.js +2 -9
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/keys.d.ts.map +1 -1
- package/lib/chat/keys.js +9 -9
- package/lib/chat/keys.js.map +1 -1
- package/lib/chat/message.js +37 -12
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/signature.d.ts +0 -1
- package/lib/chat/signature.d.ts.map +1 -1
- package/lib/chat/signature.js +3 -4
- package/lib/chat/signature.js.map +1 -1
- package/lib/utils/keyHelpers/accessData.d.ts +2 -2
- package/lib/utils/keyHelpers/accessData.d.ts.map +1 -1
- package/lib/utils/keyHelpers/accessData.js +41 -35
- package/lib/utils/keyHelpers/accessData.js.map +1 -1
- package/lib/versionInfo.js +3 -3
- package/lib/versionInfo.js.map +1 -1
- package/package.json +1 -1
package/dist/solid-ui.js
CHANGED
|
@@ -2682,7 +2682,6 @@ var ChatChannel = /*#__PURE__*/function () {
|
|
|
2682
2682
|
if (deleteIt) {
|
|
2683
2683
|
// we need to add a specific signature, else anyone can delete a msg ?
|
|
2684
2684
|
sts.push($rdf.st(message, ns.schema('dateDeleted'), dateStamp, chatDocument));
|
|
2685
|
-
// msg.dateDeleted = dateStamp
|
|
2686
2685
|
}
|
|
2687
2686
|
_context2.next = 20;
|
|
2688
2687
|
break;
|
|
@@ -2714,14 +2713,8 @@ var ChatChannel = /*#__PURE__*/function () {
|
|
|
2714
2713
|
case 32:
|
|
2715
2714
|
privateKey = _context2.sent;
|
|
2716
2715
|
// me.uri)
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
/* const pubKey = await getPublicKey(me)
|
|
2720
|
-
const verify = verifySignature(sig, msg, pubKey) // alain to remove
|
|
2721
|
-
debug.warn('sig ' + sig)
|
|
2722
|
-
debug.warn('verifySign ' + verify)
|
|
2723
|
-
debug.warn(msg) */
|
|
2724
|
-
sts.push($rdf.st(message, $rdf.sym("".concat(_signature.SEC, "Proof")), $rdf.lit(sig), chatDocument));
|
|
2716
|
+
sig = (0, _signature.signMsg)(msg, privateKey);
|
|
2717
|
+
sts.push($rdf.st(message, $rdf.sym("".concat(_signature.SEC, "proofValue")), $rdf.lit(sig), chatDocument));
|
|
2725
2718
|
case 35:
|
|
2726
2719
|
_context2.prev = 35;
|
|
2727
2720
|
_context2.next = 38;
|
|
@@ -4040,7 +4033,7 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/r
|
|
|
4040
4033
|
var debug = _interopRequireWildcard(__webpack_require__(/*! ../debug */ "./lib/debug.js"));
|
|
4041
4034
|
var _secp256k = __webpack_require__(/*! @noble/curves/secp256k1 */ "./node_modules/@noble/curves/secp256k1.js");
|
|
4042
4035
|
var _utils = __webpack_require__(/*! @noble/hashes/utils */ "./node_modules/@noble/hashes/utils.js");
|
|
4043
|
-
var
|
|
4036
|
+
var ns = _interopRequireWildcard(__webpack_require__(/*! ../ns */ "./lib/ns.js"));
|
|
4044
4037
|
var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
|
|
4045
4038
|
var $rdf = _interopRequireWildcard(__webpack_require__(/*! rdflib */ "./node_modules/rdflib/esm/index.js"));
|
|
4046
4039
|
var _accessData = __webpack_require__(/*! ../utils/keyHelpers/accessData */ "./lib/utils/keyHelpers/accessData.js");
|
|
@@ -4082,7 +4075,7 @@ function _getPublicKey() {
|
|
|
4082
4075
|
return _solidLogic.store.fetcher.load(publicKeyDoc);
|
|
4083
4076
|
case 8:
|
|
4084
4077
|
// url.href)
|
|
4085
|
-
key = _solidLogic.store.any(webId,
|
|
4078
|
+
key = _solidLogic.store.any(webId, ns.solid('publicKey'));
|
|
4086
4079
|
return _context2.abrupt("return", key === null || key === void 0 ? void 0 : key.value);
|
|
4087
4080
|
case 12:
|
|
4088
4081
|
_context2.prev = 12;
|
|
@@ -4136,14 +4129,14 @@ function _getPrivateKey() {
|
|
|
4136
4129
|
break;
|
|
4137
4130
|
}
|
|
4138
4131
|
del = [];
|
|
4139
|
-
add = [];
|
|
4132
|
+
add = [];
|
|
4140
4133
|
if (privateKey) {
|
|
4141
4134
|
_context3.next = 24;
|
|
4142
4135
|
break;
|
|
4143
4136
|
}
|
|
4144
4137
|
// add = []
|
|
4145
4138
|
privateKey = generatePrivateKey();
|
|
4146
|
-
add = [$rdf.st(webId,
|
|
4139
|
+
add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), _solidLogic.store.sym(privateKeyDoc))];
|
|
4147
4140
|
_context3.next = 24;
|
|
4148
4141
|
return saveKey(privateKeyDoc, [], add, webId.uri);
|
|
4149
4142
|
case 24:
|
|
@@ -4154,12 +4147,12 @@ function _getPrivateKey() {
|
|
|
4154
4147
|
del = [];
|
|
4155
4148
|
// delete invalid public key
|
|
4156
4149
|
if (publicKey) {
|
|
4157
|
-
del = [$rdf.st(webId,
|
|
4150
|
+
del = [$rdf.st(webId, ns.solid('publicKey'), $rdf.lit(publicKey), _solidLogic.store.sym(publicKeyDoc))];
|
|
4158
4151
|
debug.log(del);
|
|
4159
4152
|
}
|
|
4160
4153
|
// update new valid key
|
|
4161
4154
|
newPublicKey = generatePublicKey(privateKey);
|
|
4162
|
-
add = [$rdf.st(webId,
|
|
4155
|
+
add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), _solidLogic.store.sym(publicKeyDoc))];
|
|
4163
4156
|
_context3.next = 31;
|
|
4164
4157
|
return saveKey(publicKeyDoc, del, add);
|
|
4165
4158
|
case 31:
|
|
@@ -4176,7 +4169,7 @@ function _getPrivateKey() {
|
|
|
4176
4169
|
}));
|
|
4177
4170
|
return _getPrivateKey.apply(this, arguments);
|
|
4178
4171
|
}
|
|
4179
|
-
var
|
|
4172
|
+
var deleteKeyAcl = /*#__PURE__*/function () {
|
|
4180
4173
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(keyDoc) {
|
|
4181
4174
|
var keyAclDoc, response;
|
|
4182
4175
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
@@ -4215,7 +4208,7 @@ var deleteKey = /*#__PURE__*/function () {
|
|
|
4215
4208
|
}
|
|
4216
4209
|
}, _callee, null, [[4, 11]]);
|
|
4217
4210
|
}));
|
|
4218
|
-
return function
|
|
4211
|
+
return function deleteKeyAcl(_x3) {
|
|
4219
4212
|
return _ref.apply(this, arguments);
|
|
4220
4213
|
};
|
|
4221
4214
|
}();
|
|
@@ -4237,7 +4230,7 @@ function _saveKey() {
|
|
|
4237
4230
|
while (1) switch (_context4.prev = _context4.next) {
|
|
4238
4231
|
case 0:
|
|
4239
4232
|
_context4.next = 2;
|
|
4240
|
-
return
|
|
4233
|
+
return deleteKeyAcl(keyDoc);
|
|
4241
4234
|
case 2:
|
|
4242
4235
|
_context4.next = 4;
|
|
4243
4236
|
return _solidLogic.store.updater.updateMany(del, add);
|
|
@@ -4308,7 +4301,11 @@ var messageBodyStyle = style.messageBodyStyle;
|
|
|
4308
4301
|
var label = utils.label;
|
|
4309
4302
|
|
|
4310
4303
|
/**
|
|
4304
|
+
* elementForImageURI
|
|
4311
4305
|
* HTML component for an image
|
|
4306
|
+
* @param imageUri
|
|
4307
|
+
* @param options { inlineImageHeightEms }
|
|
4308
|
+
* @returns HTMLAnchorElement For Image
|
|
4312
4309
|
*/
|
|
4313
4310
|
function elementForImageURI(imageUri, options) {
|
|
4314
4311
|
var img = dom.createElement('img');
|
|
@@ -4338,21 +4335,27 @@ var anchor = function anchor(text, term) {
|
|
|
4338
4335
|
a.textContent = text;
|
|
4339
4336
|
return a;
|
|
4340
4337
|
};
|
|
4341
|
-
function
|
|
4338
|
+
function nickname(person) {
|
|
4342
4339
|
var s = _solidLogic.store.any(person, ns.foaf('nick'));
|
|
4343
4340
|
if (s) return '' + s.value;
|
|
4344
4341
|
return '' + label(person);
|
|
4345
4342
|
}
|
|
4346
4343
|
|
|
4347
4344
|
/**
|
|
4345
|
+
* creatorAndDate
|
|
4348
4346
|
* Displays creator and date for a chat message
|
|
4349
4347
|
* inside the `td1` element
|
|
4348
|
+
* @param td1
|
|
4349
|
+
* @param creator
|
|
4350
|
+
* @param date
|
|
4351
|
+
* @param message
|
|
4352
|
+
* @returns HTMLAnchorElement For Image
|
|
4350
4353
|
*/
|
|
4351
4354
|
function creatorAndDate(td1, creator, date, message) {
|
|
4352
|
-
var nickAnchor = td1.appendChild(anchor(
|
|
4355
|
+
var nickAnchor = td1.appendChild(anchor(nickname(creator), creator));
|
|
4353
4356
|
if (creator.uri) {
|
|
4354
4357
|
_solidLogic.store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (_ok, _body) {
|
|
4355
|
-
nickAnchor.textContent =
|
|
4358
|
+
nickAnchor.textContent = nickname(creator);
|
|
4356
4359
|
});
|
|
4357
4360
|
}
|
|
4358
4361
|
td1.appendChild(dom.createElement('br'));
|
|
@@ -4360,14 +4363,20 @@ function creatorAndDate(td1, creator, date, message) {
|
|
|
4360
4363
|
}
|
|
4361
4364
|
|
|
4362
4365
|
/**
|
|
4366
|
+
* creatorAndDateHorizontal
|
|
4363
4367
|
* Horizontally displays creator and date for a chat message
|
|
4364
4368
|
* inside the `td1` element
|
|
4369
|
+
* @param td1
|
|
4370
|
+
* @param creator
|
|
4371
|
+
* @param date
|
|
4372
|
+
* @param message
|
|
4373
|
+
* @returns HTMLAnchorElement For Image
|
|
4365
4374
|
*/
|
|
4366
4375
|
function creatorAndDateHorizontal(td1, creator, date, message) {
|
|
4367
4376
|
var nickAnchor = td1.appendChild(anchor(label(creator), creator));
|
|
4368
4377
|
if (creator.uri) {
|
|
4369
4378
|
_solidLogic.store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (_ok, _body) {
|
|
4370
|
-
nickAnchor.textContent =
|
|
4379
|
+
nickAnchor.textContent = nickname(creator);
|
|
4371
4380
|
});
|
|
4372
4381
|
}
|
|
4373
4382
|
var dateBit = td1.appendChild(anchor(date, message));
|
|
@@ -4377,9 +4386,17 @@ function creatorAndDateHorizontal(td1, creator, date, message) {
|
|
|
4377
4386
|
}
|
|
4378
4387
|
|
|
4379
4388
|
/**
|
|
4389
|
+
* renderMessageRow
|
|
4380
4390
|
* Renders a chat message, read-only mode
|
|
4391
|
+
* @param channelObject
|
|
4392
|
+
* @param message
|
|
4393
|
+
* @param fresh
|
|
4394
|
+
* @param options
|
|
4395
|
+
* @param userContext
|
|
4396
|
+
* @returns Message Row HTML Table Element
|
|
4381
4397
|
*/
|
|
4382
4398
|
function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
4399
|
+
var unsignedMessage = false;
|
|
4383
4400
|
var colorizeByAuthor = options.colorizeByAuthor === '1' || options.colorizeByAuthor === true;
|
|
4384
4401
|
var creator = _solidLogic.store.any(message, ns.foaf('maker'));
|
|
4385
4402
|
var date = _solidLogic.store.any(message, ns.dct('created'));
|
|
@@ -4389,7 +4406,7 @@ function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
|
4389
4406
|
// use latest content if same owner, else use original
|
|
4390
4407
|
var msgId = creator.uri === latestVersionCreator.uri ? latestVersion : message;
|
|
4391
4408
|
var content = _solidLogic.store.any(msgId, ns.sioc('content'));
|
|
4392
|
-
var signature = _solidLogic.store.any(msgId, $rdf.sym("".concat(_signature.SEC, "
|
|
4409
|
+
var signature = _solidLogic.store.any(msgId, $rdf.sym("".concat(_signature.SEC, "proofValue")));
|
|
4393
4410
|
|
|
4394
4411
|
// set message object
|
|
4395
4412
|
var msg = (0, _signature.getBlankMsg)();
|
|
@@ -4399,10 +4416,11 @@ function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
|
4399
4416
|
msg.maker = creator.uri;
|
|
4400
4417
|
|
|
4401
4418
|
// unsigned message
|
|
4402
|
-
if (!(signature !== null && signature !== void 0 && signature.value))
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
else {
|
|
4419
|
+
if (!(signature !== null && signature !== void 0 && signature.value)) {
|
|
4420
|
+
unsignedMessage = true;
|
|
4421
|
+
debug.warn(msgId.uri + ' is unsigned'); // TODO replace with UI (colored message ?)
|
|
4422
|
+
} else {
|
|
4423
|
+
// signed message, get public key and check signature
|
|
4406
4424
|
(0, _keys.getPublicKey)(creator).then(function (publicKey) {
|
|
4407
4425
|
debug.log(creator.uri + '\n' + msg.created + '\n' + msg.id + '\n' + publicKey);
|
|
4408
4426
|
if (!publicKey) {
|
|
@@ -4422,6 +4440,7 @@ function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
|
4422
4440
|
var sortDate = _solidLogic.store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()); // In message
|
|
4423
4441
|
|
|
4424
4442
|
var messageRow = dom.createElement('tr');
|
|
4443
|
+
if (unsignedMessage) messageRow.setAttribute('style', 'background-color: red');
|
|
4425
4444
|
messageRow.AJAR_date = sortDate.value;
|
|
4426
4445
|
messageRow.AJAR_subject = message;
|
|
4427
4446
|
var td1 = dom.createElement('td');
|
|
@@ -4510,7 +4529,8 @@ function renderMessageRow(channelObject, message, fresh, options, userContext) {
|
|
|
4510
4529
|
toolsTD.appendChild(tools);
|
|
4511
4530
|
});
|
|
4512
4531
|
return messageRow;
|
|
4513
|
-
}
|
|
4532
|
+
} // END OF RENDERMESSAGE
|
|
4533
|
+
|
|
4514
4534
|
function switchToEditor(messageRow, message, channelObject, userContext) {
|
|
4515
4535
|
var messageTable = messageRow.parentNode;
|
|
4516
4536
|
var editRow = renderMessageEditor(channelObject, messageTable, userContext, channelObject.options, (0, _chatLogic.mostRecentVersion)(message));
|
|
@@ -4555,8 +4575,6 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
4555
4575
|
while (1) switch (_context7.prev = _context7.next) {
|
|
4556
4576
|
case 0:
|
|
4557
4577
|
sendComplete = function _sendComplete(message, _text2) {
|
|
4558
|
-
// const dateStamp = store.any(message, ns.dct('created'), null, message.doc())
|
|
4559
|
-
// const content = $rdf.literal(text2)
|
|
4560
4578
|
(0, _infinite.insertMessageIntoTable)(channelObject, messageTable, message, false, options, userContext); // not green
|
|
4561
4579
|
|
|
4562
4580
|
if (originalMessage) {
|
|
@@ -5209,7 +5227,7 @@ function messageToolbar(message, messageRow, userContext, channelObject) {
|
|
|
5209
5227
|
Object.defineProperty(exports, "__esModule", ({
|
|
5210
5228
|
value: true
|
|
5211
5229
|
}));
|
|
5212
|
-
exports.SEC =
|
|
5230
|
+
exports.SEC = void 0;
|
|
5213
5231
|
exports.getBlankMsg = getBlankMsg;
|
|
5214
5232
|
exports.getMsgHash = getMsgHash;
|
|
5215
5233
|
exports.serializeMsg = serializeMsg;
|
|
@@ -5227,8 +5245,7 @@ exports.utf8Decoder = utf8Decoder;
|
|
|
5227
5245
|
var utf8Encoder = new TextEncoder();
|
|
5228
5246
|
exports.utf8Encoder = utf8Encoder;
|
|
5229
5247
|
var SEC = 'https://w3id.org/security#'; // Proof, VerificationMethod
|
|
5230
|
-
|
|
5231
|
-
var CERT = 'http://www.w3.org/ns/auth/cert#'; // PrivateKey, PublicKey
|
|
5248
|
+
// export const CERT = 'http://www.w3.org/ns/auth/cert#' // PrivateKey, PublicKey, key
|
|
5232
5249
|
|
|
5233
5250
|
/* eslint-disable no-unused-vars */
|
|
5234
5251
|
/* export enum Kind {
|
|
@@ -5254,7 +5271,7 @@ var CERT = 'http://www.w3.org/ns/auth/cert#'; // PrivateKey, PublicKey
|
|
|
5254
5271
|
ProfileBadge = 30009,
|
|
5255
5272
|
Article = 30023
|
|
5256
5273
|
} */
|
|
5257
|
-
exports.
|
|
5274
|
+
exports.SEC = SEC;
|
|
5258
5275
|
function getBlankMsg() {
|
|
5259
5276
|
return {
|
|
5260
5277
|
id: '',
|
|
@@ -13259,14 +13276,12 @@ exports.pubKeyUrl = exports.privKeyUrl = exports.getPodRoot = void 0;
|
|
|
13259
13276
|
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));
|
|
13260
13277
|
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
13261
13278
|
var debug = _interopRequireWildcard(__webpack_require__(/*! ../../debug */ "./lib/debug.js"));
|
|
13262
|
-
var _signature = __webpack_require__(/*! ../../chat/signature */ "./lib/chat/signature.js");
|
|
13263
13279
|
var _solidLogic = __webpack_require__(/*! solid-logic */ "./node_modules/solid-logic/lib/index.js");
|
|
13264
13280
|
var ns = _interopRequireWildcard(__webpack_require__(/*! ../../ns */ "./lib/ns.js"));
|
|
13265
13281
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13266
13282
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13267
13283
|
var getPodRoot = /*#__PURE__*/function () {
|
|
13268
13284
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(webId) {
|
|
13269
|
-
var _podRoot;
|
|
13270
13285
|
var webIdURL, storages, podRoot, path, _res$headers$get, res;
|
|
13271
13286
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
13272
13287
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -13312,7 +13327,7 @@ var getPodRoot = /*#__PURE__*/function () {
|
|
|
13312
13327
|
});
|
|
13313
13328
|
if (!podRoot) podRoot = storages[0];
|
|
13314
13329
|
case 21:
|
|
13315
|
-
return _context.abrupt("return",
|
|
13330
|
+
return _context.abrupt("return", podRoot);
|
|
13316
13331
|
case 22:
|
|
13317
13332
|
case "end":
|
|
13318
13333
|
return _context.stop();
|
|
@@ -13333,7 +13348,7 @@ var pubKeyUrl = /*#__PURE__*/function () {
|
|
|
13333
13348
|
_context2.next = 3;
|
|
13334
13349
|
return getPodRoot(webId);
|
|
13335
13350
|
case 3:
|
|
13336
|
-
_context2.t0 = _context2.sent;
|
|
13351
|
+
_context2.t0 = _context2.sent.value;
|
|
13337
13352
|
return _context2.abrupt("return", _context2.t0 + 'profile/keys/publicKey.ttl');
|
|
13338
13353
|
case 7:
|
|
13339
13354
|
_context2.prev = 7;
|
|
@@ -13359,7 +13374,7 @@ function _getExistingPublicKey() {
|
|
|
13359
13374
|
while (1) switch (_context4.prev = _context4.next) {
|
|
13360
13375
|
case 0:
|
|
13361
13376
|
_context4.next = 2;
|
|
13362
|
-
return getKeyIfExists(webId, publicKeyUrl, '
|
|
13377
|
+
return getKeyIfExists(webId, publicKeyUrl, 'publicKey');
|
|
13363
13378
|
case 2:
|
|
13364
13379
|
return _context4.abrupt("return", _context4.sent);
|
|
13365
13380
|
case 3:
|
|
@@ -13372,24 +13387,34 @@ function _getExistingPublicKey() {
|
|
|
13372
13387
|
}
|
|
13373
13388
|
var privKeyUrl = /*#__PURE__*/function () {
|
|
13374
13389
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(webId) {
|
|
13390
|
+
var _store$any, _settings;
|
|
13391
|
+
var settings, _settings2, podRoot;
|
|
13375
13392
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
13376
13393
|
while (1) switch (_context3.prev = _context3.next) {
|
|
13377
13394
|
case 0:
|
|
13378
|
-
|
|
13379
|
-
|
|
13395
|
+
settings = (_store$any = _solidLogic.store.any(webId, ns.space('preferencesFile'), null, webId.doc())) === null || _store$any === void 0 ? void 0 : _store$any.value;
|
|
13396
|
+
settings = (_settings = settings) === null || _settings === void 0 ? void 0 : _settings.split('/').slice(0, -1).join('/');
|
|
13397
|
+
_context3.prev = 2;
|
|
13398
|
+
_context3.next = 5;
|
|
13380
13399
|
return getPodRoot(webId);
|
|
13381
|
-
case
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
throw new Error(
|
|
13388
|
-
case
|
|
13400
|
+
case 5:
|
|
13401
|
+
podRoot = _context3.sent;
|
|
13402
|
+
if ((_settings2 = settings) !== null && _settings2 !== void 0 && _settings2.startsWith(podRoot.value)) {
|
|
13403
|
+
_context3.next = 8;
|
|
13404
|
+
break;
|
|
13405
|
+
}
|
|
13406
|
+
throw new Error("/settings/ is expected to be in ".concat(podRoot.value));
|
|
13407
|
+
case 8:
|
|
13408
|
+
return _context3.abrupt("return", "".concat(settings, "/keys/privateKey.ttl"));
|
|
13409
|
+
case 11:
|
|
13410
|
+
_context3.prev = 11;
|
|
13411
|
+
_context3.t0 = _context3["catch"](2);
|
|
13412
|
+
throw new Error(_context3.t0);
|
|
13413
|
+
case 14:
|
|
13389
13414
|
case "end":
|
|
13390
13415
|
return _context3.stop();
|
|
13391
13416
|
}
|
|
13392
|
-
}, _callee3, null, [[
|
|
13417
|
+
}, _callee3, null, [[2, 11]]);
|
|
13393
13418
|
}));
|
|
13394
13419
|
return function privKeyUrl(_x5) {
|
|
13395
13420
|
return _ref3.apply(this, arguments);
|
|
@@ -13405,7 +13430,7 @@ function _getExistingPrivateKey() {
|
|
|
13405
13430
|
while (1) switch (_context5.prev = _context5.next) {
|
|
13406
13431
|
case 0:
|
|
13407
13432
|
_context5.next = 2;
|
|
13408
|
-
return getKeyIfExists(webId, privateKeyUrl, '
|
|
13433
|
+
return getKeyIfExists(webId, privateKeyUrl, 'privateKey');
|
|
13409
13434
|
case 2:
|
|
13410
13435
|
return _context5.abrupt("return", _context5.sent);
|
|
13411
13436
|
case 3:
|
|
@@ -13421,7 +13446,7 @@ function getKeyIfExists(_x8, _x9, _x10) {
|
|
|
13421
13446
|
}
|
|
13422
13447
|
function _getKeyIfExists() {
|
|
13423
13448
|
_getKeyIfExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(webId, keyUrl, keyType) {
|
|
13424
|
-
var key
|
|
13449
|
+
var key;
|
|
13425
13450
|
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
13426
13451
|
while (1) switch (_context6.prev = _context6.next) {
|
|
13427
13452
|
case 0:
|
|
@@ -13429,35 +13454,33 @@ function _getKeyIfExists() {
|
|
|
13429
13454
|
_context6.next = 3;
|
|
13430
13455
|
return _solidLogic.store.fetcher.load(keyUrl);
|
|
13431
13456
|
case 3:
|
|
13432
|
-
key = _solidLogic.store.any(webId,
|
|
13457
|
+
key = _solidLogic.store.any(webId, ns.solid(keyType)); // store.sym(CERT + keyType))
|
|
13433
13458
|
return _context6.abrupt("return", key === null || key === void 0 ? void 0 : key.value);
|
|
13434
13459
|
case 7:
|
|
13435
13460
|
_context6.prev = 7;
|
|
13436
13461
|
_context6.t0 = _context6["catch"](0);
|
|
13437
|
-
if (!(
|
|
13462
|
+
if (!(_context6.t0.response.status === 404)) {
|
|
13438
13463
|
_context6.next = 24;
|
|
13439
13464
|
break;
|
|
13440
13465
|
}
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
contentType = 'text/turtle';
|
|
13445
|
-
_context6.next = 15;
|
|
13466
|
+
debug.log('createIfNotExists: doc does NOT exist, will create... ' + keyUrl);
|
|
13467
|
+
_context6.prev = 11;
|
|
13468
|
+
_context6.next = 14;
|
|
13446
13469
|
return _solidLogic.store.fetcher.webOperation('PUT', keyUrl, {
|
|
13447
|
-
data:
|
|
13448
|
-
contentType:
|
|
13470
|
+
data: '',
|
|
13471
|
+
contentType: 'text/turtle'
|
|
13449
13472
|
});
|
|
13450
|
-
case
|
|
13451
|
-
|
|
13452
|
-
_context6.next = 22;
|
|
13473
|
+
case 14:
|
|
13474
|
+
_context6.next = 20;
|
|
13453
13475
|
break;
|
|
13454
|
-
case
|
|
13455
|
-
_context6.prev =
|
|
13456
|
-
_context6.t1 = _context6["catch"](
|
|
13476
|
+
case 16:
|
|
13477
|
+
_context6.prev = 16;
|
|
13478
|
+
_context6.t1 = _context6["catch"](11);
|
|
13457
13479
|
debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + _context6.t1);
|
|
13458
13480
|
throw _context6.t1;
|
|
13459
|
-
case
|
|
13481
|
+
case 20:
|
|
13460
13482
|
delete _solidLogic.store.fetcher.requested[keyUrl]; // delete cached 404 error
|
|
13483
|
+
// debug.log('createIfNotExists doc created ok ' + doc)
|
|
13461
13484
|
return _context6.abrupt("return", undefined);
|
|
13462
13485
|
case 24:
|
|
13463
13486
|
debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + _context6.t0);
|
|
@@ -13466,7 +13489,7 @@ function _getKeyIfExists() {
|
|
|
13466
13489
|
case "end":
|
|
13467
13490
|
return _context6.stop();
|
|
13468
13491
|
}
|
|
13469
|
-
}, _callee6, null, [[0, 7], [
|
|
13492
|
+
}, _callee6, null, [[0, 7], [11, 16]]);
|
|
13470
13493
|
}));
|
|
13471
13494
|
return _getKeyIfExists.apply(this, arguments);
|
|
13472
13495
|
}
|
|
@@ -13705,10 +13728,10 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
13705
13728
|
}));
|
|
13706
13729
|
exports.versionInfo = void 0;
|
|
13707
13730
|
var versionInfo = {
|
|
13708
|
-
buildTime: '2023-05-
|
|
13709
|
-
commit: '
|
|
13731
|
+
buildTime: '2023-05-25T09:43:51Z',
|
|
13732
|
+
commit: '6f763399cd83ecfe031ae11f0f50b71da1ff3bd5',
|
|
13710
13733
|
npmInfo: {
|
|
13711
|
-
'solid-ui': '2.4.
|
|
13734
|
+
'solid-ui': '2.4.28',
|
|
13712
13735
|
npm: '8.19.4',
|
|
13713
13736
|
node: '16.20.0',
|
|
13714
13737
|
v8: '9.4.146.26-node.26',
|