@pod-os/core 0.12.1-b3f906d.0 → 0.12.1-cc6dad2.0
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/{chunk-GBIS3SJI.js → chunk-7VQUARYZ.js} +60 -1
- package/dist/{dist-TVYD2Q5S.js → dist-F3EUFQHU.js} +227 -193
- package/dist/index.js +874 -485
- package/lib/index.js +1347 -804
- package/package.json +16 -16
- package/types/Store.spec.d.ts +0 -1
- package/types/thing/Thing.d.ts +2 -0
- package/types/thing/index.d.ts +1 -0
- package/types/thing/labelFromUri.d.ts +1 -0
- package/types/thing/labelFromUri.spec.d.ts +1 -0
package/lib/index.js
CHANGED
|
@@ -60,22 +60,22 @@ var PodOS = (() => {
|
|
|
60
60
|
var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value6) {
|
|
61
61
|
return value6 !== value6;
|
|
62
62
|
};
|
|
63
|
-
function
|
|
64
|
-
|
|
63
|
+
function EventEmitter2() {
|
|
64
|
+
EventEmitter2.init.call(this);
|
|
65
65
|
}
|
|
66
|
-
module3.exports =
|
|
66
|
+
module3.exports = EventEmitter2;
|
|
67
67
|
module3.exports.once = once;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
EventEmitter2.EventEmitter = EventEmitter2;
|
|
69
|
+
EventEmitter2.prototype._events = void 0;
|
|
70
|
+
EventEmitter2.prototype._eventsCount = 0;
|
|
71
|
+
EventEmitter2.prototype._maxListeners = void 0;
|
|
72
72
|
var defaultMaxListeners = 10;
|
|
73
73
|
function checkListener(listener) {
|
|
74
74
|
if (typeof listener !== "function") {
|
|
75
75
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
Object.defineProperty(
|
|
78
|
+
Object.defineProperty(EventEmitter2, "defaultMaxListeners", {
|
|
79
79
|
enumerable: true,
|
|
80
80
|
get: function() {
|
|
81
81
|
return defaultMaxListeners;
|
|
@@ -87,14 +87,14 @@ var PodOS = (() => {
|
|
|
87
87
|
defaultMaxListeners = arg2;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
|
|
90
|
+
EventEmitter2.init = function() {
|
|
91
91
|
if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
|
|
92
92
|
this._events = /* @__PURE__ */ Object.create(null);
|
|
93
93
|
this._eventsCount = 0;
|
|
94
94
|
}
|
|
95
95
|
this._maxListeners = this._maxListeners || void 0;
|
|
96
96
|
};
|
|
97
|
-
|
|
97
|
+
EventEmitter2.prototype.setMaxListeners = function setMaxListeners(n2) {
|
|
98
98
|
if (typeof n2 !== "number" || n2 < 0 || NumberIsNaN(n2)) {
|
|
99
99
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + ".");
|
|
100
100
|
}
|
|
@@ -103,13 +103,13 @@ var PodOS = (() => {
|
|
|
103
103
|
};
|
|
104
104
|
function _getMaxListeners(that) {
|
|
105
105
|
if (that._maxListeners === void 0)
|
|
106
|
-
return
|
|
106
|
+
return EventEmitter2.defaultMaxListeners;
|
|
107
107
|
return that._maxListeners;
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
EventEmitter2.prototype.getMaxListeners = function getMaxListeners() {
|
|
110
110
|
return _getMaxListeners(this);
|
|
111
111
|
};
|
|
112
|
-
|
|
112
|
+
EventEmitter2.prototype.emit = function emit(type5) {
|
|
113
113
|
var args = [];
|
|
114
114
|
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
|
|
115
115
|
var doError = type5 === "error";
|
|
@@ -186,11 +186,11 @@ var PodOS = (() => {
|
|
|
186
186
|
}
|
|
187
187
|
return target5;
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
EventEmitter2.prototype.addListener = function addListener(type5, listener) {
|
|
190
190
|
return _addListener(this, type5, listener, false);
|
|
191
191
|
};
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
EventEmitter2.prototype.on = EventEmitter2.prototype.addListener;
|
|
193
|
+
EventEmitter2.prototype.prependListener = function prependListener(type5, listener) {
|
|
194
194
|
return _addListener(this, type5, listener, true);
|
|
195
195
|
};
|
|
196
196
|
function onceWrapper() {
|
|
@@ -209,17 +209,17 @@ var PodOS = (() => {
|
|
|
209
209
|
state2.wrapFn = wrapped;
|
|
210
210
|
return wrapped;
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
EventEmitter2.prototype.once = function once2(type5, listener) {
|
|
213
213
|
checkListener(listener);
|
|
214
214
|
this.on(type5, _onceWrap(this, type5, listener));
|
|
215
215
|
return this;
|
|
216
216
|
};
|
|
217
|
-
|
|
217
|
+
EventEmitter2.prototype.prependOnceListener = function prependOnceListener(type5, listener) {
|
|
218
218
|
checkListener(listener);
|
|
219
219
|
this.prependListener(type5, _onceWrap(this, type5, listener));
|
|
220
220
|
return this;
|
|
221
221
|
};
|
|
222
|
-
|
|
222
|
+
EventEmitter2.prototype.removeListener = function removeListener(type5, listener) {
|
|
223
223
|
var list, events3, position4, i, originalListener;
|
|
224
224
|
checkListener(listener);
|
|
225
225
|
events3 = this._events;
|
|
@@ -259,8 +259,8 @@ var PodOS = (() => {
|
|
|
259
259
|
}
|
|
260
260
|
return this;
|
|
261
261
|
};
|
|
262
|
-
|
|
263
|
-
|
|
262
|
+
EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
|
|
263
|
+
EventEmitter2.prototype.removeAllListeners = function removeAllListeners(type5) {
|
|
264
264
|
var listeners, events3, i;
|
|
265
265
|
events3 = this._events;
|
|
266
266
|
if (events3 === void 0)
|
|
@@ -300,7 +300,7 @@ var PodOS = (() => {
|
|
|
300
300
|
}
|
|
301
301
|
return this;
|
|
302
302
|
};
|
|
303
|
-
function _listeners(target5, type5,
|
|
303
|
+
function _listeners(target5, type5, unwrap) {
|
|
304
304
|
var events3 = target5._events;
|
|
305
305
|
if (events3 === void 0)
|
|
306
306
|
return [];
|
|
@@ -308,23 +308,23 @@ var PodOS = (() => {
|
|
|
308
308
|
if (evlistener === void 0)
|
|
309
309
|
return [];
|
|
310
310
|
if (typeof evlistener === "function")
|
|
311
|
-
return
|
|
312
|
-
return
|
|
311
|
+
return unwrap ? [evlistener.listener || evlistener] : [evlistener];
|
|
312
|
+
return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
|
|
313
313
|
}
|
|
314
|
-
|
|
314
|
+
EventEmitter2.prototype.listeners = function listeners(type5) {
|
|
315
315
|
return _listeners(this, type5, true);
|
|
316
316
|
};
|
|
317
|
-
|
|
317
|
+
EventEmitter2.prototype.rawListeners = function rawListeners(type5) {
|
|
318
318
|
return _listeners(this, type5, false);
|
|
319
319
|
};
|
|
320
|
-
|
|
320
|
+
EventEmitter2.listenerCount = function(emitter, type5) {
|
|
321
321
|
if (typeof emitter.listenerCount === "function") {
|
|
322
322
|
return emitter.listenerCount(type5);
|
|
323
323
|
} else {
|
|
324
324
|
return listenerCount.call(emitter, type5);
|
|
325
325
|
}
|
|
326
326
|
};
|
|
327
|
-
|
|
327
|
+
EventEmitter2.prototype.listenerCount = listenerCount;
|
|
328
328
|
function listenerCount(type5) {
|
|
329
329
|
var events3 = this._events;
|
|
330
330
|
if (events3 !== void 0) {
|
|
@@ -337,7 +337,7 @@ var PodOS = (() => {
|
|
|
337
337
|
}
|
|
338
338
|
return 0;
|
|
339
339
|
}
|
|
340
|
-
|
|
340
|
+
EventEmitter2.prototype.eventNames = function eventNames() {
|
|
341
341
|
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
|
|
342
342
|
};
|
|
343
343
|
function arrayClone(arr, n2) {
|
|
@@ -7770,7 +7770,7 @@ var PodOS = (() => {
|
|
|
7770
7770
|
return t3[e2] = r2;
|
|
7771
7771
|
};
|
|
7772
7772
|
}
|
|
7773
|
-
function
|
|
7773
|
+
function wrap(t2, e2, r2, n3) {
|
|
7774
7774
|
var i2 = e2 && e2.prototype instanceof Generator ? e2 : Generator, a2 = Object.create(i2.prototype), c2 = new Context(n3 || []);
|
|
7775
7775
|
return o(a2, "_invoke", {
|
|
7776
7776
|
value: makeInvokeMethod(t2, r2, c2)
|
|
@@ -7789,7 +7789,7 @@ var PodOS = (() => {
|
|
|
7789
7789
|
};
|
|
7790
7790
|
}
|
|
7791
7791
|
}
|
|
7792
|
-
e.wrap =
|
|
7792
|
+
e.wrap = wrap;
|
|
7793
7793
|
var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {};
|
|
7794
7794
|
function Generator() {
|
|
7795
7795
|
}
|
|
@@ -7935,7 +7935,7 @@ var PodOS = (() => {
|
|
|
7935
7935
|
return this;
|
|
7936
7936
|
}), e.AsyncIterator = AsyncIterator, e.async = function(t2, r2, n3, o2, i2) {
|
|
7937
7937
|
void 0 === i2 && (i2 = Promise);
|
|
7938
|
-
var a2 = new AsyncIterator(
|
|
7938
|
+
var a2 = new AsyncIterator(wrap(t2, r2, n3, o2), i2);
|
|
7939
7939
|
return e.isGeneratorFunction(r2) ? a2 : a2.next().then(function(t3) {
|
|
7940
7940
|
return t3.done ? t3.value : a2.next();
|
|
7941
7941
|
});
|
|
@@ -10088,6 +10088,8 @@ var PodOS = (() => {
|
|
|
10088
10088
|
return buf.push("<?", node2.target, " ", node2.data, "?>");
|
|
10089
10089
|
case ENTITY_REFERENCE_NODE:
|
|
10090
10090
|
return buf.push("&", node2.nodeName, ";");
|
|
10091
|
+
//case ENTITY_NODE:
|
|
10092
|
+
//case NOTATION_NODE:
|
|
10091
10093
|
default:
|
|
10092
10094
|
buf.push("??", node2.nodeName);
|
|
10093
10095
|
}
|
|
@@ -10098,6 +10100,11 @@ var PodOS = (() => {
|
|
|
10098
10100
|
case ELEMENT_NODE:
|
|
10099
10101
|
node22 = node2.cloneNode(false);
|
|
10100
10102
|
node22.ownerDocument = doc;
|
|
10103
|
+
//var attrs = node2.attributes;
|
|
10104
|
+
//var len = attrs.length;
|
|
10105
|
+
//for(var i=0;i<len;i++){
|
|
10106
|
+
//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
|
|
10107
|
+
//}
|
|
10101
10108
|
case DOCUMENT_FRAGMENT_NODE:
|
|
10102
10109
|
break;
|
|
10103
10110
|
case ATTRIBUTE_NODE:
|
|
@@ -12500,6 +12507,7 @@ var PodOS = (() => {
|
|
|
12500
12507
|
}
|
|
12501
12508
|
end2++;
|
|
12502
12509
|
break;
|
|
12510
|
+
// end elment
|
|
12503
12511
|
case "?":
|
|
12504
12512
|
locator && position4(tagStart);
|
|
12505
12513
|
end2 = parseInstruction(source8, tagStart, domBuilder);
|
|
@@ -12635,6 +12643,7 @@ var PodOS = (() => {
|
|
|
12635
12643
|
case S_ATTR_SPACE:
|
|
12636
12644
|
el.closed = true;
|
|
12637
12645
|
break;
|
|
12646
|
+
//case S_EQ:
|
|
12638
12647
|
default:
|
|
12639
12648
|
throw new Error("attribute invalid close char('/')");
|
|
12640
12649
|
}
|
|
@@ -12653,7 +12662,9 @@ var PodOS = (() => {
|
|
|
12653
12662
|
case S_TAG_SPACE:
|
|
12654
12663
|
case S_TAG_CLOSE:
|
|
12655
12664
|
break;
|
|
12665
|
+
//normal
|
|
12656
12666
|
case S_ATTR_NOQUOT_VALUE:
|
|
12667
|
+
//Compatible state
|
|
12657
12668
|
case S_ATTR:
|
|
12658
12669
|
value6 = source8.slice(start2, p);
|
|
12659
12670
|
if (value6.slice(-1) === "/") {
|
|
@@ -12678,6 +12689,7 @@ var PodOS = (() => {
|
|
|
12678
12689
|
throw new Error("attribute value missed!!");
|
|
12679
12690
|
}
|
|
12680
12691
|
return p;
|
|
12692
|
+
/*xml space '\x20' | #x9 | #xD | #xA; */
|
|
12681
12693
|
case "\x80":
|
|
12682
12694
|
c = " ";
|
|
12683
12695
|
default:
|
|
@@ -12701,6 +12713,9 @@ var PodOS = (() => {
|
|
|
12701
12713
|
}
|
|
12702
12714
|
} else {
|
|
12703
12715
|
switch (s) {
|
|
12716
|
+
//case S_TAG:void();break;
|
|
12717
|
+
//case S_ATTR:void();break;
|
|
12718
|
+
//case S_ATTR_NOQUOT_VALUE:void();break;
|
|
12704
12719
|
case S_ATTR_SPACE:
|
|
12705
12720
|
var tagName = el.tagName;
|
|
12706
12721
|
if (!NAMESPACE.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
|
|
@@ -13562,7 +13577,7 @@ var PodOS = (() => {
|
|
|
13562
13577
|
}
|
|
13563
13578
|
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
13564
13579
|
}
|
|
13565
|
-
function
|
|
13580
|
+
function decode3(input2) {
|
|
13566
13581
|
var output2 = [], inputLength = input2.length, out, i = 0, n2 = initialN, bias = initialBias, basic, j, index2, oldi, w, k, digit, t, baseMinusT;
|
|
13567
13582
|
basic = input2.lastIndexOf(delimiter);
|
|
13568
13583
|
if (basic < 0) {
|
|
@@ -13666,7 +13681,7 @@ var PodOS = (() => {
|
|
|
13666
13681
|
}
|
|
13667
13682
|
function toUnicode(input2) {
|
|
13668
13683
|
return mapDomain(input2, function(string2) {
|
|
13669
|
-
return regexPunycode.test(string2) ?
|
|
13684
|
+
return regexPunycode.test(string2) ? decode3(string2.slice(4).toLowerCase()) : string2;
|
|
13670
13685
|
});
|
|
13671
13686
|
}
|
|
13672
13687
|
function toASCII(input2) {
|
|
@@ -13692,7 +13707,7 @@ var PodOS = (() => {
|
|
|
13692
13707
|
"decode": ucs2decode,
|
|
13693
13708
|
"encode": ucs2encode
|
|
13694
13709
|
},
|
|
13695
|
-
"decode":
|
|
13710
|
+
"decode": decode3,
|
|
13696
13711
|
"encode": encode3,
|
|
13697
13712
|
"toASCII": toASCII,
|
|
13698
13713
|
"toUnicode": toUnicode
|
|
@@ -14716,14 +14731,14 @@ var PodOS = (() => {
|
|
|
14716
14731
|
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
14717
14732
|
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
14718
14733
|
var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
|
|
14719
|
-
var
|
|
14734
|
+
var tag4 = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
14720
14735
|
if (ys.length === 0) {
|
|
14721
|
-
return
|
|
14736
|
+
return tag4 + "{}";
|
|
14722
14737
|
}
|
|
14723
14738
|
if (indent) {
|
|
14724
|
-
return
|
|
14739
|
+
return tag4 + "{" + indentedJoin(ys, indent) + "}";
|
|
14725
14740
|
}
|
|
14726
|
-
return
|
|
14741
|
+
return tag4 + "{ " + $join.call(ys, ", ") + " }";
|
|
14727
14742
|
}
|
|
14728
14743
|
return String(obj);
|
|
14729
14744
|
};
|
|
@@ -15236,7 +15251,7 @@ var PodOS = (() => {
|
|
|
15236
15251
|
return acc;
|
|
15237
15252
|
}, target5);
|
|
15238
15253
|
};
|
|
15239
|
-
var
|
|
15254
|
+
var decode3 = function(str, decoder2, charset) {
|
|
15240
15255
|
var strWithoutPlus = str.replace(/\+/g, " ");
|
|
15241
15256
|
if (charset === "iso-8859-1") {
|
|
15242
15257
|
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
@@ -15339,7 +15354,7 @@ var PodOS = (() => {
|
|
|
15339
15354
|
assign,
|
|
15340
15355
|
combine,
|
|
15341
15356
|
compact,
|
|
15342
|
-
decode:
|
|
15357
|
+
decode: decode3,
|
|
15343
15358
|
encode: encode3,
|
|
15344
15359
|
isBuffer,
|
|
15345
15360
|
isRegExp,
|
|
@@ -15655,6 +15670,7 @@ var PodOS = (() => {
|
|
|
15655
15670
|
parameterLimit: 1e3,
|
|
15656
15671
|
parseArrays: true,
|
|
15657
15672
|
plainObjects: false,
|
|
15673
|
+
strictDepth: false,
|
|
15658
15674
|
strictNullHandling: false
|
|
15659
15675
|
};
|
|
15660
15676
|
var interpretNumericEntities = function(str) {
|
|
@@ -15673,6 +15689,7 @@ var PodOS = (() => {
|
|
|
15673
15689
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
15674
15690
|
var obj = { __proto__: null };
|
|
15675
15691
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
15692
|
+
cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
15676
15693
|
var limit3 = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
15677
15694
|
var parts = cleanStr.split(options.delimiter, limit3);
|
|
15678
15695
|
var skipIndex = -1;
|
|
@@ -15732,7 +15749,7 @@ var PodOS = (() => {
|
|
|
15732
15749
|
var obj;
|
|
15733
15750
|
var root = chain2[i];
|
|
15734
15751
|
if (root === "[]" && options.parseArrays) {
|
|
15735
|
-
obj = options.allowEmptyArrays && leaf === "" ? [] : [].concat(leaf);
|
|
15752
|
+
obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
|
|
15736
15753
|
} else {
|
|
15737
15754
|
obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
15738
15755
|
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
@@ -15780,6 +15797,9 @@ var PodOS = (() => {
|
|
|
15780
15797
|
keys.push(segment[1]);
|
|
15781
15798
|
}
|
|
15782
15799
|
if (segment) {
|
|
15800
|
+
if (options.strictDepth === true) {
|
|
15801
|
+
throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
|
|
15802
|
+
}
|
|
15783
15803
|
keys.push("[" + key3.slice(segment.index) + "]");
|
|
15784
15804
|
}
|
|
15785
15805
|
return parseObject(keys, val, options, valuesParsed);
|
|
@@ -15826,6 +15846,7 @@ var PodOS = (() => {
|
|
|
15826
15846
|
parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
|
|
15827
15847
|
parseArrays: opts.parseArrays !== false,
|
|
15828
15848
|
plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
|
|
15849
|
+
strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
|
|
15829
15850
|
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
15830
15851
|
};
|
|
15831
15852
|
};
|
|
@@ -21859,7 +21880,7 @@ var PodOS = (() => {
|
|
|
21859
21880
|
throw new Error("Can't serialize object of type " + st3.object.termType + " into XML");
|
|
21860
21881
|
}
|
|
21861
21882
|
}
|
|
21862
|
-
var
|
|
21883
|
+
var tag4 = type5 ? qname(type5) : "rdf:Description";
|
|
21863
21884
|
var attrs = "";
|
|
21864
21885
|
if (subject5.termType === "BlankNode") {
|
|
21865
21886
|
if (!stats.incoming[subject5] || stats.incoming[subject5].length !== 1) {
|
|
@@ -21868,7 +21889,7 @@ var PodOS = (() => {
|
|
|
21868
21889
|
} else {
|
|
21869
21890
|
attrs = ' rdf:about="' + relURI(subject5) + '"';
|
|
21870
21891
|
}
|
|
21871
|
-
return ["<" +
|
|
21892
|
+
return ["<" + tag4 + attrs + ">"].concat([results]).concat(["</" + tag4 + ">"]);
|
|
21872
21893
|
}
|
|
21873
21894
|
var subjectXMLTree = subjectXMLTreeMethod.bind(this);
|
|
21874
21895
|
function collectionXMLTree(subject5, stats) {
|
|
@@ -23777,6 +23798,7 @@ var PodOS = (() => {
|
|
|
23777
23798
|
return new BlankNode(term3.value);
|
|
23778
23799
|
case CollectionTermType:
|
|
23779
23800
|
return term3;
|
|
23801
|
+
// non-RDF/JS type, should just need to cast
|
|
23780
23802
|
case DefaultGraphTermType:
|
|
23781
23803
|
return new DefaultGraph();
|
|
23782
23804
|
case EmptyTermType:
|
|
@@ -23898,6 +23920,7 @@ var PodOS = (() => {
|
|
|
23898
23920
|
break;
|
|
23899
23921
|
case "Literal":
|
|
23900
23922
|
case "BlankNode":
|
|
23923
|
+
// @ts-ignore Collections can appear here
|
|
23901
23924
|
case "Collection":
|
|
23902
23925
|
this.add(target5, st3.predicate, st3.object.copy(this));
|
|
23903
23926
|
}
|
|
@@ -24629,7 +24652,7 @@ var PodOS = (() => {
|
|
|
24629
24652
|
return utftext;
|
|
24630
24653
|
},
|
|
24631
24654
|
// public method for url decoding
|
|
24632
|
-
decode: function
|
|
24655
|
+
decode: function decode2(utftext) {
|
|
24633
24656
|
var string2 = "";
|
|
24634
24657
|
var i = 0;
|
|
24635
24658
|
while (i < utftext.length) {
|
|
@@ -28992,15 +29015,15 @@ var PodOS = (() => {
|
|
|
28992
29015
|
}
|
|
28993
29016
|
return resolved;
|
|
28994
29017
|
}
|
|
28995
|
-
_cacheResolvedContext({ key: key3, resolved, tag:
|
|
29018
|
+
_cacheResolvedContext({ key: key3, resolved, tag: tag4 }) {
|
|
28996
29019
|
this.perOpCache.set(key3, resolved);
|
|
28997
|
-
if (
|
|
29020
|
+
if (tag4 !== void 0) {
|
|
28998
29021
|
let tagMap = this.sharedCache.get(key3);
|
|
28999
29022
|
if (!tagMap) {
|
|
29000
29023
|
tagMap = /* @__PURE__ */ new Map();
|
|
29001
29024
|
this.sharedCache.set(key3, tagMap);
|
|
29002
29025
|
}
|
|
29003
|
-
tagMap.set(
|
|
29026
|
+
tagMap.set(tag4, resolved);
|
|
29004
29027
|
}
|
|
29005
29028
|
return resolved;
|
|
29006
29029
|
}
|
|
@@ -34734,6 +34757,7 @@ var PodOS = (() => {
|
|
|
34734
34757
|
}
|
|
34735
34758
|
break;
|
|
34736
34759
|
}
|
|
34760
|
+
// Fall through in case the type is an IRI
|
|
34737
34761
|
case "<":
|
|
34738
34762
|
if (match = this._unescapedIri.exec(input2))
|
|
34739
34763
|
type5 = "IRI", value6 = match[1];
|
|
@@ -34799,6 +34823,7 @@ var PodOS = (() => {
|
|
|
34799
34823
|
matchLength = 1;
|
|
34800
34824
|
break;
|
|
34801
34825
|
}
|
|
34826
|
+
// Fall through to numerical case (could be a decimal dot)
|
|
34802
34827
|
case "0":
|
|
34803
34828
|
case "1":
|
|
34804
34829
|
case "2":
|
|
@@ -35346,19 +35371,23 @@ var PodOS = (() => {
|
|
|
35346
35371
|
// ### `_readInTopContext` reads a token when in the top context
|
|
35347
35372
|
_readInTopContext(token) {
|
|
35348
35373
|
switch (token.type) {
|
|
35374
|
+
// If an EOF token arrives in the top context, signal that we're done
|
|
35349
35375
|
case "eof":
|
|
35350
35376
|
if (this._graph !== null)
|
|
35351
35377
|
return this._error("Unclosed graph", token);
|
|
35352
35378
|
delete this._prefixes._;
|
|
35353
35379
|
return this._callback(null, null, this._prefixes);
|
|
35380
|
+
// It could be a prefix declaration
|
|
35354
35381
|
case "PREFIX":
|
|
35355
35382
|
this._sparqlStyle = true;
|
|
35356
35383
|
case "@prefix":
|
|
35357
35384
|
return this._readPrefix;
|
|
35385
|
+
// It could be a base declaration
|
|
35358
35386
|
case "BASE":
|
|
35359
35387
|
this._sparqlStyle = true;
|
|
35360
35388
|
case "@base":
|
|
35361
35389
|
return this._readBaseIRI;
|
|
35390
|
+
// It could be a graph
|
|
35362
35391
|
case "{":
|
|
35363
35392
|
if (this._supportsNamedGraphs) {
|
|
35364
35393
|
this._graph = "";
|
|
@@ -35368,6 +35397,7 @@ var PodOS = (() => {
|
|
|
35368
35397
|
case "GRAPH":
|
|
35369
35398
|
if (this._supportsNamedGraphs)
|
|
35370
35399
|
return this._readNamedGraphLabel;
|
|
35400
|
+
// Otherwise, the next token must be a subject
|
|
35371
35401
|
default:
|
|
35372
35402
|
return this._readSubject(token);
|
|
35373
35403
|
}
|
|
@@ -35376,6 +35406,7 @@ var PodOS = (() => {
|
|
|
35376
35406
|
_readEntity(token, quantifier) {
|
|
35377
35407
|
let value6;
|
|
35378
35408
|
switch (token.type) {
|
|
35409
|
+
// Read a relative or absolute IRI
|
|
35379
35410
|
case "IRI":
|
|
35380
35411
|
case "typeIRI":
|
|
35381
35412
|
const iri = this._resolveIRI(token.value);
|
|
@@ -35383,6 +35414,7 @@ var PodOS = (() => {
|
|
|
35383
35414
|
return this._error("Invalid IRI", token);
|
|
35384
35415
|
value6 = this._namedNode(iri);
|
|
35385
35416
|
break;
|
|
35417
|
+
// Read a prefixed name
|
|
35386
35418
|
case "type":
|
|
35387
35419
|
case "prefixed":
|
|
35388
35420
|
const prefix2 = this._prefixes[token.prefix];
|
|
@@ -35390,12 +35422,15 @@ var PodOS = (() => {
|
|
|
35390
35422
|
return this._error(`Undefined prefix "${token.prefix}:"`, token);
|
|
35391
35423
|
value6 = this._namedNode(prefix2 + token.value);
|
|
35392
35424
|
break;
|
|
35425
|
+
// Read a blank node
|
|
35393
35426
|
case "blank":
|
|
35394
35427
|
value6 = this._blankNode(this._prefixes[token.prefix] + token.value);
|
|
35395
35428
|
break;
|
|
35429
|
+
// Read a variable
|
|
35396
35430
|
case "var":
|
|
35397
35431
|
value6 = this._variable(token.value.substr(1));
|
|
35398
35432
|
break;
|
|
35433
|
+
// Everything else is not an entity
|
|
35399
35434
|
default:
|
|
35400
35435
|
return this._error(`Expected entity but got ${token.type}`, token);
|
|
35401
35436
|
}
|
|
@@ -35699,6 +35734,7 @@ var PodOS = (() => {
|
|
|
35699
35734
|
_completeLiteral(token) {
|
|
35700
35735
|
let literal5 = this._literal(this._literalValue);
|
|
35701
35736
|
switch (token.type) {
|
|
35737
|
+
// Create a datatyped literal
|
|
35702
35738
|
case "type":
|
|
35703
35739
|
case "typeIRI":
|
|
35704
35740
|
const datatype = this._readEntity(token);
|
|
@@ -35706,6 +35742,7 @@ var PodOS = (() => {
|
|
|
35706
35742
|
literal5 = this._literal(this._literalValue, datatype);
|
|
35707
35743
|
token = null;
|
|
35708
35744
|
break;
|
|
35745
|
+
// Create a language-tagged string
|
|
35709
35746
|
case "langcode":
|
|
35710
35747
|
literal5 = this._literal(this._literalValue, token.value);
|
|
35711
35748
|
token = null;
|
|
@@ -35747,23 +35784,28 @@ var PodOS = (() => {
|
|
|
35747
35784
|
let next3, graph4 = this._graph;
|
|
35748
35785
|
const subject5 = this._subject, inversePredicate = this._inversePredicate;
|
|
35749
35786
|
switch (token.type) {
|
|
35787
|
+
// A closing brace ends a graph
|
|
35750
35788
|
case "}":
|
|
35751
35789
|
if (this._graph === null)
|
|
35752
35790
|
return this._error("Unexpected graph closing", token);
|
|
35753
35791
|
if (this._n3Mode)
|
|
35754
35792
|
return this._readFormulaTail(token);
|
|
35755
35793
|
this._graph = null;
|
|
35794
|
+
// A dot just ends the statement, without sharing anything with the next
|
|
35756
35795
|
case ".":
|
|
35757
35796
|
this._subject = null;
|
|
35758
35797
|
next3 = this._contextStack.length ? this._readSubject : this._readInTopContext;
|
|
35759
35798
|
if (inversePredicate) this._inversePredicate = false;
|
|
35760
35799
|
break;
|
|
35800
|
+
// Semicolon means the subject is shared; predicate and object are different
|
|
35761
35801
|
case ";":
|
|
35762
35802
|
next3 = this._readPredicate;
|
|
35763
35803
|
break;
|
|
35804
|
+
// Comma means both the subject and predicate are shared; the object is different
|
|
35764
35805
|
case ",":
|
|
35765
35806
|
next3 = this._readObject;
|
|
35766
35807
|
break;
|
|
35808
|
+
// {| means that the current triple is annotated with predicate-object pairs.
|
|
35767
35809
|
case "{|":
|
|
35768
35810
|
if (!this._supportsRDFStar)
|
|
35769
35811
|
return this._error("Unexpected RDF* syntax", token);
|
|
@@ -35771,6 +35813,7 @@ var PodOS = (() => {
|
|
|
35771
35813
|
this._subject = this._quad(subject5, predicate2, object6, this.DEFAULTGRAPH);
|
|
35772
35814
|
next3 = this._readPredicate;
|
|
35773
35815
|
break;
|
|
35816
|
+
// |} means that the current quoted triple in annotation syntax is finalized.
|
|
35774
35817
|
case "|}":
|
|
35775
35818
|
if (this._subject.termType !== "Quad")
|
|
35776
35819
|
return this._error("Unexpected asserted triple closing", token);
|
|
@@ -35797,9 +35840,11 @@ var PodOS = (() => {
|
|
|
35797
35840
|
_readBlankNodePunctuation(token) {
|
|
35798
35841
|
let next3;
|
|
35799
35842
|
switch (token.type) {
|
|
35843
|
+
// Semicolon means the subject is shared; predicate and object are different
|
|
35800
35844
|
case ";":
|
|
35801
35845
|
next3 = this._readPredicate;
|
|
35802
35846
|
break;
|
|
35847
|
+
// Comma means both the subject and predicate are shared; the object is different
|
|
35803
35848
|
case ",":
|
|
35804
35849
|
next3 = this._readObject;
|
|
35805
35850
|
break;
|
|
@@ -35922,10 +35967,13 @@ var PodOS = (() => {
|
|
|
35922
35967
|
// ### `_readPath` reads a potential path
|
|
35923
35968
|
_readPath(token) {
|
|
35924
35969
|
switch (token.type) {
|
|
35970
|
+
// Forward path
|
|
35925
35971
|
case "!":
|
|
35926
35972
|
return this._readForwardPath;
|
|
35973
|
+
// Backward path
|
|
35927
35974
|
case "^":
|
|
35928
35975
|
return this._readBackwardPath;
|
|
35976
|
+
// Not a path; resume reading where we left off
|
|
35929
35977
|
default:
|
|
35930
35978
|
const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
|
|
35931
35979
|
if (parent4 && parent4.type === "item") {
|
|
@@ -36031,12 +36079,16 @@ var PodOS = (() => {
|
|
|
36031
36079
|
if (!iri.length)
|
|
36032
36080
|
return this._base;
|
|
36033
36081
|
switch (iri[0]) {
|
|
36082
|
+
// Resolve relative fragment IRIs against the base IRI
|
|
36034
36083
|
case "#":
|
|
36035
36084
|
return this._base + iri;
|
|
36085
|
+
// Resolve relative query string IRIs by replacing the query string
|
|
36036
36086
|
case "?":
|
|
36037
36087
|
return this._base.replace(/(?:\?.*)?$/, iri);
|
|
36088
|
+
// Resolve root-relative IRIs at the root of the base IRI
|
|
36038
36089
|
case "/":
|
|
36039
36090
|
return (iri[1] === "/" ? this._baseScheme : this._baseRoot) + this._removeDotSegments(iri);
|
|
36091
|
+
// Resolve all other IRIs at the base IRI's path
|
|
36040
36092
|
default:
|
|
36041
36093
|
return /^[^/:]*:/.test(iri) ? null : this._removeDotSegments(this._basePath + iri);
|
|
36042
36094
|
}
|
|
@@ -36049,6 +36101,7 @@ var PodOS = (() => {
|
|
|
36049
36101
|
let result5 = "", i = -1, pathStart = -1, segmentStart = 0, next3 = "/";
|
|
36050
36102
|
while (i < length2) {
|
|
36051
36103
|
switch (next3) {
|
|
36104
|
+
// The path starts with the first slash after the authority
|
|
36052
36105
|
case ":":
|
|
36053
36106
|
if (pathStart < 0) {
|
|
36054
36107
|
if (iri[++i] === "/" && iri[++i] === "/")
|
|
@@ -36056,22 +36109,27 @@ var PodOS = (() => {
|
|
|
36056
36109
|
i = pathStart;
|
|
36057
36110
|
}
|
|
36058
36111
|
break;
|
|
36112
|
+
// Don't modify a query string or fragment
|
|
36059
36113
|
case "?":
|
|
36060
36114
|
case "#":
|
|
36061
36115
|
i = length2;
|
|
36062
36116
|
break;
|
|
36117
|
+
// Handle '/.' or '/..' path segments
|
|
36063
36118
|
case "/":
|
|
36064
36119
|
if (iri[i + 1] === ".") {
|
|
36065
36120
|
next3 = iri[++i + 1];
|
|
36066
36121
|
switch (next3) {
|
|
36122
|
+
// Remove a '/.' segment
|
|
36067
36123
|
case "/":
|
|
36068
36124
|
result5 += iri.substring(segmentStart, i - 1);
|
|
36069
36125
|
segmentStart = i + 1;
|
|
36070
36126
|
break;
|
|
36127
|
+
// Remove a trailing '/.' segment
|
|
36071
36128
|
case void 0:
|
|
36072
36129
|
case "?":
|
|
36073
36130
|
case "#":
|
|
36074
36131
|
return result5 + iri.substring(segmentStart, i) + iri.substr(i + 1);
|
|
36132
|
+
// Remove a '/..' segment
|
|
36075
36133
|
case ".":
|
|
36076
36134
|
next3 = iri[++i + 1];
|
|
36077
36135
|
if (next3 === void 0 || next3 === "/" || next3 === "?" || next3 === "#") {
|
|
@@ -37954,7 +38012,7 @@ var PodOS = (() => {
|
|
|
37954
38012
|
};
|
|
37955
38013
|
if (support2.formData) {
|
|
37956
38014
|
this.formData = function() {
|
|
37957
|
-
return this.text().then(
|
|
38015
|
+
return this.text().then(decode3);
|
|
37958
38016
|
};
|
|
37959
38017
|
}
|
|
37960
38018
|
this.json = function() {
|
|
@@ -37967,10 +38025,10 @@ var PodOS = (() => {
|
|
|
37967
38025
|
var upcased = method5.toUpperCase();
|
|
37968
38026
|
return methods.indexOf(upcased) > -1 ? upcased : method5;
|
|
37969
38027
|
}
|
|
37970
|
-
function
|
|
38028
|
+
function Request(input2, options) {
|
|
37971
38029
|
options = options || {};
|
|
37972
38030
|
var body = options.body;
|
|
37973
|
-
if (input2 instanceof
|
|
38031
|
+
if (input2 instanceof Request) {
|
|
37974
38032
|
if (input2.bodyUsed) {
|
|
37975
38033
|
throw new TypeError("Already read");
|
|
37976
38034
|
}
|
|
@@ -38002,10 +38060,10 @@ var PodOS = (() => {
|
|
|
38002
38060
|
}
|
|
38003
38061
|
this._initBody(body);
|
|
38004
38062
|
}
|
|
38005
|
-
|
|
38006
|
-
return new
|
|
38063
|
+
Request.prototype.clone = function() {
|
|
38064
|
+
return new Request(this, { body: this._bodyInit });
|
|
38007
38065
|
};
|
|
38008
|
-
function
|
|
38066
|
+
function decode3(body) {
|
|
38009
38067
|
var form2 = new FormData();
|
|
38010
38068
|
body.trim().split("&").forEach(function(bytes) {
|
|
38011
38069
|
if (bytes) {
|
|
@@ -38030,8 +38088,8 @@ var PodOS = (() => {
|
|
|
38030
38088
|
});
|
|
38031
38089
|
return headers;
|
|
38032
38090
|
}
|
|
38033
|
-
Body.call(
|
|
38034
|
-
function
|
|
38091
|
+
Body.call(Request.prototype);
|
|
38092
|
+
function Response4(bodyInit, options) {
|
|
38035
38093
|
if (!options) {
|
|
38036
38094
|
options = {};
|
|
38037
38095
|
}
|
|
@@ -38043,26 +38101,26 @@ var PodOS = (() => {
|
|
|
38043
38101
|
this.url = options.url || "";
|
|
38044
38102
|
this._initBody(bodyInit);
|
|
38045
38103
|
}
|
|
38046
|
-
Body.call(
|
|
38047
|
-
|
|
38048
|
-
return new
|
|
38104
|
+
Body.call(Response4.prototype);
|
|
38105
|
+
Response4.prototype.clone = function() {
|
|
38106
|
+
return new Response4(this._bodyInit, {
|
|
38049
38107
|
status: this.status,
|
|
38050
38108
|
statusText: this.statusText,
|
|
38051
38109
|
headers: new Headers3(this.headers),
|
|
38052
38110
|
url: this.url
|
|
38053
38111
|
});
|
|
38054
38112
|
};
|
|
38055
|
-
|
|
38056
|
-
var response6 = new
|
|
38113
|
+
Response4.error = function() {
|
|
38114
|
+
var response6 = new Response4(null, { status: 0, statusText: "" });
|
|
38057
38115
|
response6.type = "error";
|
|
38058
38116
|
return response6;
|
|
38059
38117
|
};
|
|
38060
38118
|
var redirectStatuses = [301, 302, 303, 307, 308];
|
|
38061
|
-
|
|
38119
|
+
Response4.redirect = function(url7, status9) {
|
|
38062
38120
|
if (redirectStatuses.indexOf(status9) === -1) {
|
|
38063
38121
|
throw new RangeError("Invalid status code");
|
|
38064
38122
|
}
|
|
38065
|
-
return new
|
|
38123
|
+
return new Response4(null, { status: status9, headers: { location: url7 } });
|
|
38066
38124
|
};
|
|
38067
38125
|
exports2.DOMException = self2.DOMException;
|
|
38068
38126
|
try {
|
|
@@ -38077,9 +38135,9 @@ var PodOS = (() => {
|
|
|
38077
38135
|
exports2.DOMException.prototype = Object.create(Error.prototype);
|
|
38078
38136
|
exports2.DOMException.prototype.constructor = exports2.DOMException;
|
|
38079
38137
|
}
|
|
38080
|
-
function
|
|
38138
|
+
function fetch2(input2, init) {
|
|
38081
38139
|
return new Promise(function(resolve, reject2) {
|
|
38082
|
-
var request2 = new
|
|
38140
|
+
var request2 = new Request(input2, init);
|
|
38083
38141
|
if (request2.signal && request2.signal.aborted) {
|
|
38084
38142
|
return reject2(new exports2.DOMException("Aborted", "AbortError"));
|
|
38085
38143
|
}
|
|
@@ -38095,7 +38153,7 @@ var PodOS = (() => {
|
|
|
38095
38153
|
};
|
|
38096
38154
|
options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
|
|
38097
38155
|
var body = "response" in xhr ? xhr.response : xhr.responseText;
|
|
38098
|
-
resolve(new
|
|
38156
|
+
resolve(new Response4(body, options));
|
|
38099
38157
|
};
|
|
38100
38158
|
xhr.onerror = function() {
|
|
38101
38159
|
reject2(new TypeError("Network request failed"));
|
|
@@ -38129,17 +38187,17 @@ var PodOS = (() => {
|
|
|
38129
38187
|
xhr.send(typeof request2._bodyInit === "undefined" ? null : request2._bodyInit);
|
|
38130
38188
|
});
|
|
38131
38189
|
}
|
|
38132
|
-
|
|
38190
|
+
fetch2.polyfill = true;
|
|
38133
38191
|
if (!self2.fetch) {
|
|
38134
|
-
self2.fetch =
|
|
38192
|
+
self2.fetch = fetch2;
|
|
38135
38193
|
self2.Headers = Headers3;
|
|
38136
|
-
self2.Request =
|
|
38137
|
-
self2.Response =
|
|
38194
|
+
self2.Request = Request;
|
|
38195
|
+
self2.Response = Response4;
|
|
38138
38196
|
}
|
|
38139
38197
|
exports2.Headers = Headers3;
|
|
38140
|
-
exports2.Request =
|
|
38141
|
-
exports2.Response =
|
|
38142
|
-
exports2.fetch =
|
|
38198
|
+
exports2.Request = Request;
|
|
38199
|
+
exports2.Response = Response4;
|
|
38200
|
+
exports2.fetch = fetch2;
|
|
38143
38201
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
38144
38202
|
return exports2;
|
|
38145
38203
|
}({});
|
|
@@ -40959,6 +41017,7 @@ var PodOS = (() => {
|
|
|
40959
41017
|
case "text/n3":
|
|
40960
41018
|
case "text/turtle":
|
|
40961
41019
|
case "application/x-turtle":
|
|
41020
|
+
// Legacy
|
|
40962
41021
|
case "application/n3":
|
|
40963
41022
|
documentString = sz.statementsToN3(data2);
|
|
40964
41023
|
break;
|
|
@@ -41150,14 +41209,11 @@ var PodOS = (() => {
|
|
|
41150
41209
|
});
|
|
41151
41210
|
|
|
41152
41211
|
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/namespaces.js
|
|
41153
|
-
var
|
|
41212
|
+
var vcard, dc;
|
|
41154
41213
|
var init_namespaces = __esm({
|
|
41155
41214
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/namespaces.js"() {
|
|
41156
41215
|
init_esm();
|
|
41157
|
-
rdf3 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
41158
41216
|
vcard = Namespace("http://www.w3.org/2006/vcard/ns#");
|
|
41159
|
-
solid = Namespace("http://www.w3.org/ns/solid/terms#");
|
|
41160
|
-
pim = Namespace("http://www.w3.org/ns/pim/space#");
|
|
41161
41217
|
dc = Namespace("http://purl.org/dc/elements/1.1/");
|
|
41162
41218
|
}
|
|
41163
41219
|
});
|
|
@@ -41504,25 +41560,32 @@ var PodOS = (() => {
|
|
|
41504
41560
|
}
|
|
41505
41561
|
});
|
|
41506
41562
|
|
|
41507
|
-
// ../node_modules/@solid-data-modules/
|
|
41563
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
41508
41564
|
function generateId() {
|
|
41509
41565
|
return uid.rnd(6);
|
|
41510
41566
|
}
|
|
41511
41567
|
var import_short_unique_id, uid;
|
|
41512
41568
|
var init_generate_id = __esm({
|
|
41513
|
-
"../node_modules/@solid-data-modules/
|
|
41569
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js"() {
|
|
41514
41570
|
import_short_unique_id = __toESM(require_short_unique_id(), 1);
|
|
41515
41571
|
uid = new import_short_unique_id.default({ length: 10 });
|
|
41516
41572
|
}
|
|
41517
41573
|
});
|
|
41518
41574
|
|
|
41575
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/identifier/index.js
|
|
41576
|
+
var init_identifier = __esm({
|
|
41577
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/identifier/index.js"() {
|
|
41578
|
+
init_generate_id();
|
|
41579
|
+
}
|
|
41580
|
+
});
|
|
41581
|
+
|
|
41519
41582
|
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/AddressBookQuery.js
|
|
41520
41583
|
var AddressBookQuery;
|
|
41521
41584
|
var init_AddressBookQuery = __esm({
|
|
41522
41585
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/AddressBookQuery.js"() {
|
|
41523
41586
|
init_esm();
|
|
41524
41587
|
init_namespaces();
|
|
41525
|
-
|
|
41588
|
+
init_identifier();
|
|
41526
41589
|
AddressBookQuery = class {
|
|
41527
41590
|
constructor(store, addressBookNode) {
|
|
41528
41591
|
this.store = store;
|
|
@@ -41640,11 +41703,37 @@ var PodOS = (() => {
|
|
|
41640
41703
|
}
|
|
41641
41704
|
});
|
|
41642
41705
|
|
|
41706
|
+
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/GroupQuery.js
|
|
41707
|
+
var GroupQuery;
|
|
41708
|
+
var init_GroupQuery = __esm({
|
|
41709
|
+
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/GroupQuery.js"() {
|
|
41710
|
+
init_esm();
|
|
41711
|
+
init_namespaces();
|
|
41712
|
+
GroupQuery = class {
|
|
41713
|
+
constructor(store, groupNode) {
|
|
41714
|
+
this.store = store;
|
|
41715
|
+
this.groupNode = groupNode;
|
|
41716
|
+
this.groupDoc = groupNode.doc();
|
|
41717
|
+
}
|
|
41718
|
+
queryName() {
|
|
41719
|
+
return this.store.anyValue(this.groupNode, vcard("fn"), void 0, this.groupDoc) ?? "";
|
|
41720
|
+
}
|
|
41721
|
+
queryMembers() {
|
|
41722
|
+
return this.store.each(this.groupNode, vcard("hasMember"), null, this.groupDoc).filter((it) => isNamedNode(it)).map((node2) => ({
|
|
41723
|
+
uri: node2.value,
|
|
41724
|
+
name: this.store.anyValue(node2, vcard("fn"), null, this.groupDoc) ?? ""
|
|
41725
|
+
}));
|
|
41726
|
+
}
|
|
41727
|
+
};
|
|
41728
|
+
}
|
|
41729
|
+
});
|
|
41730
|
+
|
|
41643
41731
|
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/index.js
|
|
41644
41732
|
var init_queries = __esm({
|
|
41645
41733
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/index.js"() {
|
|
41646
41734
|
init_AddressBookQuery();
|
|
41647
41735
|
init_ContactQuery();
|
|
41736
|
+
init_GroupQuery();
|
|
41648
41737
|
}
|
|
41649
41738
|
});
|
|
41650
41739
|
|
|
@@ -41664,14 +41753,251 @@ var PodOS = (() => {
|
|
|
41664
41753
|
uri: uri6,
|
|
41665
41754
|
deletions: [],
|
|
41666
41755
|
insertions,
|
|
41667
|
-
filesToCreate: [{
|
|
41756
|
+
filesToCreate: [{ url: nameEmailIndexUri }, { url: groupIndexUri }]
|
|
41668
41757
|
};
|
|
41669
41758
|
}
|
|
41670
41759
|
var init_createAddressBook = __esm({
|
|
41671
41760
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/createAddressBook.js"() {
|
|
41672
41761
|
init_esm();
|
|
41673
41762
|
init_namespaces();
|
|
41674
|
-
|
|
41763
|
+
init_identifier();
|
|
41764
|
+
}
|
|
41765
|
+
});
|
|
41766
|
+
|
|
41767
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js
|
|
41768
|
+
async function executeUpdate(fetcher3, updater, operation3) {
|
|
41769
|
+
await updater.updateMany(operation3.deletions, operation3.insertions);
|
|
41770
|
+
operation3.filesToCreate.map((file2) => {
|
|
41771
|
+
createEmptyTurtleFile(fetcher3, file2.url);
|
|
41772
|
+
});
|
|
41773
|
+
}
|
|
41774
|
+
function createEmptyTurtleFile(fetcher3, url7) {
|
|
41775
|
+
return fetcher3.webOperation("PUT", url7, {
|
|
41776
|
+
contentType: "text/turtle"
|
|
41777
|
+
});
|
|
41778
|
+
}
|
|
41779
|
+
var init_executeUpdate = __esm({
|
|
41780
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js"() {
|
|
41781
|
+
}
|
|
41782
|
+
});
|
|
41783
|
+
|
|
41784
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/fetchNode.js
|
|
41785
|
+
async function fetchNode(fetcher3, node2) {
|
|
41786
|
+
if (node2) {
|
|
41787
|
+
await fetcher3.load(node2.value);
|
|
41788
|
+
}
|
|
41789
|
+
}
|
|
41790
|
+
var init_fetchNode = __esm({
|
|
41791
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/fetchNode.js"() {
|
|
41792
|
+
}
|
|
41793
|
+
});
|
|
41794
|
+
|
|
41795
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/index.js
|
|
41796
|
+
var init_web_operations = __esm({
|
|
41797
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/index.js"() {
|
|
41798
|
+
init_executeUpdate();
|
|
41799
|
+
init_fetchNode();
|
|
41800
|
+
}
|
|
41801
|
+
});
|
|
41802
|
+
|
|
41803
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
|
|
41804
|
+
var rdf3, solid, pim, ldp;
|
|
41805
|
+
var init_namespaces2 = __esm({
|
|
41806
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js"() {
|
|
41807
|
+
init_esm();
|
|
41808
|
+
rdf3 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
41809
|
+
solid = Namespace("http://www.w3.org/ns/solid/terms#");
|
|
41810
|
+
pim = Namespace("http://www.w3.org/ns/pim/space#");
|
|
41811
|
+
ldp = Namespace("http://www.w3.org/ns/ldp#");
|
|
41812
|
+
}
|
|
41813
|
+
});
|
|
41814
|
+
|
|
41815
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
41816
|
+
var PreferencesQuery;
|
|
41817
|
+
var init_PreferencesQuery = __esm({
|
|
41818
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js"() {
|
|
41819
|
+
init_esm();
|
|
41820
|
+
init_namespaces2();
|
|
41821
|
+
PreferencesQuery = class {
|
|
41822
|
+
constructor(store, webIdNode, preferencesDoc) {
|
|
41823
|
+
this.store = store;
|
|
41824
|
+
this.webIdNode = webIdNode;
|
|
41825
|
+
this.preferencesDoc = preferencesDoc;
|
|
41826
|
+
}
|
|
41827
|
+
/**
|
|
41828
|
+
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
41829
|
+
*/
|
|
41830
|
+
queryPrivateTypeIndex() {
|
|
41831
|
+
const node2 = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
|
|
41832
|
+
if (isNamedNode(node2)) {
|
|
41833
|
+
return node2;
|
|
41834
|
+
}
|
|
41835
|
+
return null;
|
|
41836
|
+
}
|
|
41837
|
+
};
|
|
41838
|
+
}
|
|
41839
|
+
});
|
|
41840
|
+
|
|
41841
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js
|
|
41842
|
+
var ProfileQuery;
|
|
41843
|
+
var init_ProfileQuery = __esm({
|
|
41844
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js"() {
|
|
41845
|
+
init_esm();
|
|
41846
|
+
init_namespaces2();
|
|
41847
|
+
ProfileQuery = class {
|
|
41848
|
+
constructor(webIdNode, store) {
|
|
41849
|
+
this.webIdNode = webIdNode;
|
|
41850
|
+
this.store = store;
|
|
41851
|
+
}
|
|
41852
|
+
/**
|
|
41853
|
+
* Look up the public type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
41854
|
+
*/
|
|
41855
|
+
queryPublicTypeIndex() {
|
|
41856
|
+
const predicate2 = solid("publicTypeIndex");
|
|
41857
|
+
return this.queryNamedNode(predicate2);
|
|
41858
|
+
}
|
|
41859
|
+
/**
|
|
41860
|
+
* Look up the preferences file. Returns null if none is found or if the predicated does not link to a proper named node
|
|
41861
|
+
*/
|
|
41862
|
+
queryPreferencesFile() {
|
|
41863
|
+
const predicate2 = pim("preferencesFile");
|
|
41864
|
+
return this.queryNamedNode(predicate2);
|
|
41865
|
+
}
|
|
41866
|
+
queryNamedNode(predicate2) {
|
|
41867
|
+
const node2 = this.store.any(this.webIdNode, predicate2, null, this.webIdNode.doc());
|
|
41868
|
+
if (isNamedNode(node2)) {
|
|
41869
|
+
return node2;
|
|
41870
|
+
}
|
|
41871
|
+
return null;
|
|
41872
|
+
}
|
|
41873
|
+
};
|
|
41874
|
+
}
|
|
41875
|
+
});
|
|
41876
|
+
|
|
41877
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/queries/TypeIndexQuery.js
|
|
41878
|
+
var TypeIndexQuery;
|
|
41879
|
+
var init_TypeIndexQuery = __esm({
|
|
41880
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/queries/TypeIndexQuery.js"() {
|
|
41881
|
+
init_esm();
|
|
41882
|
+
init_namespaces2();
|
|
41883
|
+
TypeIndexQuery = class {
|
|
41884
|
+
constructor(store, typeIndexDoc) {
|
|
41885
|
+
this.store = store;
|
|
41886
|
+
this.typeIndexDoc = typeIndexDoc;
|
|
41887
|
+
}
|
|
41888
|
+
/**
|
|
41889
|
+
* Look up the instances in the type registration for the given RDF class
|
|
41890
|
+
* @param type - The RDF class to look up
|
|
41891
|
+
* @returns A list of the URIs of the found instances
|
|
41892
|
+
*/
|
|
41893
|
+
queryInstancesForClass(type5) {
|
|
41894
|
+
const registrations = this.store.each(null, solid("forClass"), type5, this.typeIndexDoc);
|
|
41895
|
+
return registrations.flatMap((registration) => {
|
|
41896
|
+
if (!isNamedNode(registration))
|
|
41897
|
+
return [];
|
|
41898
|
+
return this.getInstanceValues(registration);
|
|
41899
|
+
});
|
|
41900
|
+
}
|
|
41901
|
+
getInstanceValues(registration) {
|
|
41902
|
+
return this.store.each(registration, solid("instance"), null, this.typeIndexDoc).map((it) => it.value);
|
|
41903
|
+
}
|
|
41904
|
+
};
|
|
41905
|
+
}
|
|
41906
|
+
});
|
|
41907
|
+
|
|
41908
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/queries/index.js
|
|
41909
|
+
var init_queries2 = __esm({
|
|
41910
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/queries/index.js"() {
|
|
41911
|
+
init_PreferencesQuery();
|
|
41912
|
+
init_ProfileQuery();
|
|
41913
|
+
init_TypeIndexQuery();
|
|
41914
|
+
}
|
|
41915
|
+
});
|
|
41916
|
+
|
|
41917
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/module/ModuleSupport.js
|
|
41918
|
+
var ModuleSupport;
|
|
41919
|
+
var init_ModuleSupport = __esm({
|
|
41920
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/module/ModuleSupport.js"() {
|
|
41921
|
+
init_esm();
|
|
41922
|
+
init_dist();
|
|
41923
|
+
init_namespaces2();
|
|
41924
|
+
ModuleSupport = class {
|
|
41925
|
+
constructor(config2) {
|
|
41926
|
+
this.store = config2.store;
|
|
41927
|
+
this.fetcher = config2.fetcher;
|
|
41928
|
+
this.updater = config2.updater;
|
|
41929
|
+
}
|
|
41930
|
+
/**
|
|
41931
|
+
* Nullsafe fetching of a node
|
|
41932
|
+
* @param node - A node to fetch, or null to do nothing at all
|
|
41933
|
+
*/
|
|
41934
|
+
async fetchNode(node2) {
|
|
41935
|
+
return fetchNode(this.fetcher, node2);
|
|
41936
|
+
}
|
|
41937
|
+
/**
|
|
41938
|
+
* Fetch all the given nodes in parallel
|
|
41939
|
+
* @param nodes
|
|
41940
|
+
*/
|
|
41941
|
+
async fetchAll(nodes) {
|
|
41942
|
+
return Promise.all(nodes.map((it) => this.fetchNode(it)));
|
|
41943
|
+
}
|
|
41944
|
+
/**
|
|
41945
|
+
* Checks whether the resource identified by the given URL is a LDP container
|
|
41946
|
+
* @param storageUrl - The URL to check
|
|
41947
|
+
* @returns true if it is a container, false otherwise
|
|
41948
|
+
*/
|
|
41949
|
+
async isContainer(storageUrl) {
|
|
41950
|
+
const storageNode = namedNode2(storageUrl);
|
|
41951
|
+
await this.fetcher.load(storageNode.value);
|
|
41952
|
+
return this.store.holds(storageNode, rdf3("type"), ldp("Container"), storageNode.doc());
|
|
41953
|
+
}
|
|
41954
|
+
};
|
|
41955
|
+
}
|
|
41956
|
+
});
|
|
41957
|
+
|
|
41958
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/module/index.js
|
|
41959
|
+
var init_module = __esm({
|
|
41960
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/module/index.js"() {
|
|
41961
|
+
init_ModuleSupport();
|
|
41962
|
+
}
|
|
41963
|
+
});
|
|
41964
|
+
|
|
41965
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/update-operations/addInstanceToTypeIndex.js
|
|
41966
|
+
function addInstanceToTypeIndex(typeIndexDoc, instanceUri, type5) {
|
|
41967
|
+
const registrationNode = namedNode2(`${typeIndexDoc.value}#${generateId()}`);
|
|
41968
|
+
return {
|
|
41969
|
+
deletions: [],
|
|
41970
|
+
filesToCreate: [],
|
|
41971
|
+
insertions: [
|
|
41972
|
+
st2(registrationNode, rdf3("type"), solid("TypeRegistration"), typeIndexDoc),
|
|
41973
|
+
st2(registrationNode, solid("forClass"), type5, typeIndexDoc),
|
|
41974
|
+
st2(registrationNode, solid("instance"), namedNode2(instanceUri), typeIndexDoc)
|
|
41975
|
+
]
|
|
41976
|
+
};
|
|
41977
|
+
}
|
|
41978
|
+
var init_addInstanceToTypeIndex = __esm({
|
|
41979
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/update-operations/addInstanceToTypeIndex.js"() {
|
|
41980
|
+
init_esm();
|
|
41981
|
+
init_identifier();
|
|
41982
|
+
init_namespaces2();
|
|
41983
|
+
}
|
|
41984
|
+
});
|
|
41985
|
+
|
|
41986
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/update-operations/index.js
|
|
41987
|
+
var init_update_operations = __esm({
|
|
41988
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/update-operations/index.js"() {
|
|
41989
|
+
init_addInstanceToTypeIndex();
|
|
41990
|
+
}
|
|
41991
|
+
});
|
|
41992
|
+
|
|
41993
|
+
// ../node_modules/@solid-data-modules/rdflib-utils/dist/index.js
|
|
41994
|
+
var init_dist = __esm({
|
|
41995
|
+
"../node_modules/@solid-data-modules/rdflib-utils/dist/index.js"() {
|
|
41996
|
+
init_web_operations();
|
|
41997
|
+
init_queries2();
|
|
41998
|
+
init_module();
|
|
41999
|
+
init_update_operations();
|
|
42000
|
+
init_namespaces2();
|
|
41675
42001
|
}
|
|
41676
42002
|
});
|
|
41677
42003
|
|
|
@@ -41707,42 +42033,7 @@ var PodOS = (() => {
|
|
|
41707
42033
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/createNewContact.js"() {
|
|
41708
42034
|
init_esm();
|
|
41709
42035
|
init_namespaces();
|
|
41710
|
-
|
|
41711
|
-
});
|
|
41712
|
-
|
|
41713
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/index.js
|
|
41714
|
-
var init_update_operations = __esm({
|
|
41715
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/index.js"() {
|
|
41716
|
-
init_createAddressBook();
|
|
41717
|
-
init_createNewContact();
|
|
41718
|
-
}
|
|
41719
|
-
});
|
|
41720
|
-
|
|
41721
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/web-operations/executeUpdate.js
|
|
41722
|
-
async function executeUpdate(fetcher3, updater, operation3) {
|
|
41723
|
-
await updater.updateMany(operation3.deletions, operation3.insertions);
|
|
41724
|
-
operation3.filesToCreate.map((file2) => {
|
|
41725
|
-
createEmptyTurtleFile(fetcher3, file2.uri);
|
|
41726
|
-
});
|
|
41727
|
-
}
|
|
41728
|
-
function createEmptyTurtleFile(fetcher3, uri6) {
|
|
41729
|
-
return fetcher3.webOperation("PUT", uri6, {
|
|
41730
|
-
contentType: "text/turtle"
|
|
41731
|
-
});
|
|
41732
|
-
}
|
|
41733
|
-
var init_executeUpdate = __esm({
|
|
41734
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/web-operations/executeUpdate.js"() {
|
|
41735
|
-
}
|
|
41736
|
-
});
|
|
41737
|
-
|
|
41738
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/web-operations/fetchNode.js
|
|
41739
|
-
async function fetchNode(fetcher3, node2) {
|
|
41740
|
-
if (node2) {
|
|
41741
|
-
await fetcher3.load(node2.value);
|
|
41742
|
-
}
|
|
41743
|
-
}
|
|
41744
|
-
var init_fetchNode = __esm({
|
|
41745
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/web-operations/fetchNode.js"() {
|
|
42036
|
+
init_dist();
|
|
41746
42037
|
}
|
|
41747
42038
|
});
|
|
41748
42039
|
|
|
@@ -41770,31 +42061,7 @@ var PodOS = (() => {
|
|
|
41770
42061
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/createNewGroup.js"() {
|
|
41771
42062
|
init_esm();
|
|
41772
42063
|
init_namespaces();
|
|
41773
|
-
|
|
41774
|
-
});
|
|
41775
|
-
|
|
41776
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/GroupQuery.js
|
|
41777
|
-
var GroupQuery;
|
|
41778
|
-
var init_GroupQuery = __esm({
|
|
41779
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/GroupQuery.js"() {
|
|
41780
|
-
init_esm();
|
|
41781
|
-
init_namespaces();
|
|
41782
|
-
GroupQuery = class {
|
|
41783
|
-
constructor(store, groupNode) {
|
|
41784
|
-
this.store = store;
|
|
41785
|
-
this.groupNode = groupNode;
|
|
41786
|
-
this.groupDoc = groupNode.doc();
|
|
41787
|
-
}
|
|
41788
|
-
queryName() {
|
|
41789
|
-
return this.store.anyValue(this.groupNode, vcard("fn"), void 0, this.groupDoc) ?? "";
|
|
41790
|
-
}
|
|
41791
|
-
queryMembers() {
|
|
41792
|
-
return this.store.each(this.groupNode, vcard("hasMember"), null, this.groupDoc).filter((it) => isNamedNode(it)).map((node2) => ({
|
|
41793
|
-
uri: node2.value,
|
|
41794
|
-
name: this.store.anyValue(node2, vcard("fn"), null, this.groupDoc) ?? ""
|
|
41795
|
-
}));
|
|
41796
|
-
}
|
|
41797
|
-
};
|
|
42064
|
+
init_dist();
|
|
41798
42065
|
}
|
|
41799
42066
|
});
|
|
41800
42067
|
|
|
@@ -41802,7 +42069,6 @@ var PodOS = (() => {
|
|
|
41802
42069
|
function addContactToGroup(contactQuery, groupQuery) {
|
|
41803
42070
|
const name7 = contactQuery.queryName();
|
|
41804
42071
|
return {
|
|
41805
|
-
uri: "",
|
|
41806
42072
|
insertions: [
|
|
41807
42073
|
st2(groupQuery.groupNode, vcard("hasMember"), contactQuery.contactNode, groupQuery.groupNode.doc()),
|
|
41808
42074
|
st2(contactQuery.contactNode, vcard("fn"), lit2(name7), groupQuery.groupNode.doc())
|
|
@@ -41818,27 +42084,25 @@ var PodOS = (() => {
|
|
|
41818
42084
|
}
|
|
41819
42085
|
});
|
|
41820
42086
|
|
|
41821
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/
|
|
41822
|
-
function
|
|
41823
|
-
const
|
|
41824
|
-
const
|
|
41825
|
-
if (!member9) {
|
|
41826
|
-
throw new Error("member not found in group");
|
|
41827
|
-
}
|
|
42087
|
+
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewEmailAddress.js
|
|
42088
|
+
function addNewEmailAddress(contactNode, emailAddress) {
|
|
42089
|
+
const id6 = generateId();
|
|
42090
|
+
const uri6 = `${contactNode.doc().uri}#${id6}`;
|
|
41828
42091
|
return {
|
|
41829
|
-
uri:
|
|
41830
|
-
insertions: [
|
|
41831
|
-
|
|
41832
|
-
st2(
|
|
41833
|
-
st2(contactQuery.contactNode, vcard("fn"), lit2(member9.name), groupQuery.groupNode.doc())
|
|
42092
|
+
uri: uri6,
|
|
42093
|
+
insertions: [
|
|
42094
|
+
st2(contactNode, vcard("hasEmail"), namedNode2(uri6), contactNode.doc()),
|
|
42095
|
+
st2(namedNode2(uri6), vcard("value"), namedNode2("mailto:" + emailAddress), contactNode.doc())
|
|
41834
42096
|
],
|
|
42097
|
+
deletions: [],
|
|
41835
42098
|
filesToCreate: []
|
|
41836
42099
|
};
|
|
41837
42100
|
}
|
|
41838
|
-
var
|
|
41839
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/
|
|
42101
|
+
var init_addNewEmailAddress = __esm({
|
|
42102
|
+
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewEmailAddress.js"() {
|
|
41840
42103
|
init_esm();
|
|
41841
42104
|
init_namespaces();
|
|
42105
|
+
init_identifier();
|
|
41842
42106
|
}
|
|
41843
42107
|
});
|
|
41844
42108
|
|
|
@@ -41859,48 +42123,29 @@ var PodOS = (() => {
|
|
|
41859
42123
|
var init_addNewPhoneNumber = __esm({
|
|
41860
42124
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewPhoneNumber.js"() {
|
|
41861
42125
|
init_esm();
|
|
41862
|
-
init_generate_id();
|
|
41863
42126
|
init_namespaces();
|
|
42127
|
+
init_identifier();
|
|
41864
42128
|
}
|
|
41865
42129
|
});
|
|
41866
42130
|
|
|
41867
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/
|
|
41868
|
-
function
|
|
41869
|
-
const
|
|
41870
|
-
const
|
|
41871
|
-
|
|
41872
|
-
|
|
41873
|
-
insertions: [
|
|
41874
|
-
st2(contactNode, vcard("hasEmail"), namedNode2(uri6), contactNode.doc()),
|
|
41875
|
-
st2(namedNode2(uri6), vcard("value"), namedNode2("mailto:" + emailAddress), contactNode.doc())
|
|
41876
|
-
],
|
|
41877
|
-
deletions: [],
|
|
41878
|
-
filesToCreate: []
|
|
41879
|
-
};
|
|
41880
|
-
}
|
|
41881
|
-
var init_addNewEmailAddress = __esm({
|
|
41882
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewEmailAddress.js"() {
|
|
41883
|
-
init_esm();
|
|
41884
|
-
init_generate_id();
|
|
41885
|
-
init_namespaces();
|
|
42131
|
+
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removeContactFromGroup.js
|
|
42132
|
+
function removeContactFromGroup(contactQuery, groupQuery) {
|
|
42133
|
+
const contactUri = contactQuery.contactNode.uri;
|
|
42134
|
+
const member9 = groupQuery.queryMembers().find((it) => it.uri === contactUri);
|
|
42135
|
+
if (!member9) {
|
|
42136
|
+
throw new Error("member not found in group");
|
|
41886
42137
|
}
|
|
41887
|
-
});
|
|
41888
|
-
|
|
41889
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removePhoneNumber.js
|
|
41890
|
-
function removePhoneNumber(contactNode, phoneNode, store) {
|
|
41891
|
-
const phoneStatements = store.statementsMatching(phoneNode, null, null, phoneNode.doc());
|
|
41892
42138
|
return {
|
|
41893
|
-
uri: "",
|
|
41894
42139
|
insertions: [],
|
|
41895
42140
|
deletions: [
|
|
41896
|
-
|
|
41897
|
-
st2(contactNode, vcard("
|
|
42141
|
+
st2(groupQuery.groupNode, vcard("hasMember"), contactQuery.contactNode, groupQuery.groupNode.doc()),
|
|
42142
|
+
st2(contactQuery.contactNode, vcard("fn"), lit2(member9.name), groupQuery.groupNode.doc())
|
|
41898
42143
|
],
|
|
41899
42144
|
filesToCreate: []
|
|
41900
42145
|
};
|
|
41901
42146
|
}
|
|
41902
|
-
var
|
|
41903
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/
|
|
42147
|
+
var init_removeContactFromGroup = __esm({
|
|
42148
|
+
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removeContactFromGroup.js"() {
|
|
41904
42149
|
init_esm();
|
|
41905
42150
|
init_namespaces();
|
|
41906
42151
|
}
|
|
@@ -41910,7 +42155,6 @@ var PodOS = (() => {
|
|
|
41910
42155
|
function removeEmailAddress(contactNode, emailNode, store) {
|
|
41911
42156
|
const emailStatements = store.statementsMatching(emailNode, null, null, emailNode.doc());
|
|
41912
42157
|
return {
|
|
41913
|
-
uri: "",
|
|
41914
42158
|
insertions: [],
|
|
41915
42159
|
deletions: [
|
|
41916
42160
|
...emailStatements,
|
|
@@ -41926,82 +42170,22 @@ var PodOS = (() => {
|
|
|
41926
42170
|
}
|
|
41927
42171
|
});
|
|
41928
42172
|
|
|
41929
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/
|
|
41930
|
-
|
|
41931
|
-
|
|
41932
|
-
|
|
41933
|
-
|
|
41934
|
-
|
|
41935
|
-
|
|
41936
|
-
|
|
41937
|
-
|
|
41938
|
-
|
|
41939
|
-
|
|
41940
|
-
|
|
41941
|
-
|
|
41942
|
-
|
|
41943
|
-
}
|
|
41944
|
-
queryPreferencesFile() {
|
|
41945
|
-
const predicate2 = pim("preferencesFile");
|
|
41946
|
-
return this.queryNamedNode(predicate2);
|
|
41947
|
-
}
|
|
41948
|
-
queryNamedNode(predicate2) {
|
|
41949
|
-
const node2 = this.store.any(this.webIdNode, predicate2, null, this.webIdNode.doc());
|
|
41950
|
-
if (isNamedNode(node2)) {
|
|
41951
|
-
return node2;
|
|
41952
|
-
}
|
|
41953
|
-
return null;
|
|
41954
|
-
}
|
|
41955
|
-
};
|
|
41956
|
-
}
|
|
41957
|
-
});
|
|
41958
|
-
|
|
41959
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/TypeIndexQuery.js
|
|
41960
|
-
var TypeIndexQuery;
|
|
41961
|
-
var init_TypeIndexQuery = __esm({
|
|
41962
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/TypeIndexQuery.js"() {
|
|
41963
|
-
init_esm();
|
|
41964
|
-
init_namespaces();
|
|
41965
|
-
TypeIndexQuery = class {
|
|
41966
|
-
constructor(store, typeIndexDoc) {
|
|
41967
|
-
this.store = store;
|
|
41968
|
-
this.typeIndexDoc = typeIndexDoc;
|
|
41969
|
-
}
|
|
41970
|
-
queryAddressBookInstances() {
|
|
41971
|
-
const addressBookRegistrations = this.store.each(null, solid("forClass"), vcard("AddressBook"), this.typeIndexDoc);
|
|
41972
|
-
return addressBookRegistrations.flatMap((registration) => {
|
|
41973
|
-
if (!isNamedNode(registration))
|
|
41974
|
-
return [];
|
|
41975
|
-
return this.getInstanceValues(registration);
|
|
41976
|
-
});
|
|
41977
|
-
}
|
|
41978
|
-
getInstanceValues(registration) {
|
|
41979
|
-
return this.store.each(registration, solid("instance"), null, this.typeIndexDoc).map((it) => it.value);
|
|
41980
|
-
}
|
|
41981
|
-
};
|
|
41982
|
-
}
|
|
41983
|
-
});
|
|
41984
|
-
|
|
41985
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/PreferencesQuery.js
|
|
41986
|
-
var PreferencesQuery;
|
|
41987
|
-
var init_PreferencesQuery = __esm({
|
|
41988
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/PreferencesQuery.js"() {
|
|
42173
|
+
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removePhoneNumber.js
|
|
42174
|
+
function removePhoneNumber(contactNode, phoneNode, store) {
|
|
42175
|
+
const phoneStatements = store.statementsMatching(phoneNode, null, null, phoneNode.doc());
|
|
42176
|
+
return {
|
|
42177
|
+
insertions: [],
|
|
42178
|
+
deletions: [
|
|
42179
|
+
...phoneStatements,
|
|
42180
|
+
st2(contactNode, vcard("hasTelephone"), phoneNode, contactNode.doc())
|
|
42181
|
+
],
|
|
42182
|
+
filesToCreate: []
|
|
42183
|
+
};
|
|
42184
|
+
}
|
|
42185
|
+
var init_removePhoneNumber = __esm({
|
|
42186
|
+
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removePhoneNumber.js"() {
|
|
41989
42187
|
init_esm();
|
|
41990
42188
|
init_namespaces();
|
|
41991
|
-
PreferencesQuery = class {
|
|
41992
|
-
constructor(store, webIdNode, preferencesDoc) {
|
|
41993
|
-
this.store = store;
|
|
41994
|
-
this.webIdNode = webIdNode;
|
|
41995
|
-
this.preferencesDoc = preferencesDoc;
|
|
41996
|
-
}
|
|
41997
|
-
queryPrivateTypeIndex() {
|
|
41998
|
-
const node2 = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
|
|
41999
|
-
if (isNamedNode(node2)) {
|
|
42000
|
-
return node2;
|
|
42001
|
-
}
|
|
42002
|
-
return null;
|
|
42003
|
-
}
|
|
42004
|
-
};
|
|
42005
42189
|
}
|
|
42006
42190
|
});
|
|
42007
42191
|
|
|
@@ -42010,7 +42194,6 @@ var PodOS = (() => {
|
|
|
42010
42194
|
const deletions = store.statementsMatching(contactNode, vcard("fn"), null, null);
|
|
42011
42195
|
const insertions = deletions.map((it) => st2(it.subject, it.predicate, lit2(newName), it.graph));
|
|
42012
42196
|
return {
|
|
42013
|
-
uri: "",
|
|
42014
42197
|
insertions,
|
|
42015
42198
|
deletions,
|
|
42016
42199
|
filesToCreate: []
|
|
@@ -42023,25 +42206,23 @@ var PodOS = (() => {
|
|
|
42023
42206
|
}
|
|
42024
42207
|
});
|
|
42025
42208
|
|
|
42026
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/
|
|
42027
|
-
function
|
|
42028
|
-
const
|
|
42209
|
+
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/updateEmailAddress.js
|
|
42210
|
+
function updateEmailAddress(emailAddressNode, newEmailAddress, store) {
|
|
42211
|
+
const oldValue = store.any(emailAddressNode, vcard("value"));
|
|
42212
|
+
const deletions = oldValue ? [st2(emailAddressNode, vcard("value"), oldValue, emailAddressNode.doc())] : [];
|
|
42213
|
+
const insertions = [
|
|
42214
|
+
st2(emailAddressNode, vcard("value"), namedNode2("mailto:" + newEmailAddress), emailAddressNode.doc())
|
|
42215
|
+
];
|
|
42029
42216
|
return {
|
|
42030
|
-
|
|
42031
|
-
|
|
42032
|
-
|
|
42033
|
-
st2(registrationNode, rdf3("type"), solid("TypeRegistration"), typeIndexDoc),
|
|
42034
|
-
st2(registrationNode, solid("forClass"), vcard("AddressBook"), typeIndexDoc),
|
|
42035
|
-
st2(registrationNode, solid("instance"), namedNode2(addressBookUri), typeIndexDoc)
|
|
42036
|
-
],
|
|
42037
|
-
uri: ""
|
|
42217
|
+
insertions,
|
|
42218
|
+
deletions,
|
|
42219
|
+
filesToCreate: []
|
|
42038
42220
|
};
|
|
42039
42221
|
}
|
|
42040
|
-
var
|
|
42041
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/
|
|
42222
|
+
var init_updateEmailAddress = __esm({
|
|
42223
|
+
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/updateEmailAddress.js"() {
|
|
42042
42224
|
init_esm();
|
|
42043
42225
|
init_namespaces();
|
|
42044
|
-
init_generate_id();
|
|
42045
42226
|
}
|
|
42046
42227
|
});
|
|
42047
42228
|
|
|
@@ -42053,7 +42234,6 @@ var PodOS = (() => {
|
|
|
42053
42234
|
st2(phoneNumberNode, vcard("value"), namedNode2("tel:" + newPhoneNumber), phoneNumberNode.doc())
|
|
42054
42235
|
];
|
|
42055
42236
|
return {
|
|
42056
|
-
uri: "",
|
|
42057
42237
|
insertions,
|
|
42058
42238
|
deletions,
|
|
42059
42239
|
filesToCreate: []
|
|
@@ -42066,69 +42246,49 @@ var PodOS = (() => {
|
|
|
42066
42246
|
}
|
|
42067
42247
|
});
|
|
42068
42248
|
|
|
42069
|
-
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/
|
|
42070
|
-
|
|
42071
|
-
|
|
42072
|
-
|
|
42073
|
-
|
|
42074
|
-
|
|
42075
|
-
|
|
42076
|
-
|
|
42077
|
-
|
|
42078
|
-
|
|
42079
|
-
|
|
42080
|
-
|
|
42081
|
-
|
|
42082
|
-
|
|
42083
|
-
|
|
42084
|
-
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/updateEmailAddress.js"() {
|
|
42085
|
-
init_esm();
|
|
42086
|
-
init_namespaces();
|
|
42249
|
+
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/index.js
|
|
42250
|
+
var init_update_operations2 = __esm({
|
|
42251
|
+
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/index.js"() {
|
|
42252
|
+
init_createAddressBook();
|
|
42253
|
+
init_createNewContact();
|
|
42254
|
+
init_createNewGroup();
|
|
42255
|
+
init_addContactToGroup();
|
|
42256
|
+
init_addNewEmailAddress();
|
|
42257
|
+
init_addNewPhoneNumber();
|
|
42258
|
+
init_removeContactFromGroup();
|
|
42259
|
+
init_removeEmailAddress();
|
|
42260
|
+
init_removePhoneNumber();
|
|
42261
|
+
init_renameContact();
|
|
42262
|
+
init_updateEmailAddress();
|
|
42263
|
+
init_updatePhoneNumber();
|
|
42087
42264
|
}
|
|
42088
42265
|
});
|
|
42089
42266
|
|
|
42090
42267
|
// ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/ContactsModuleRdfLib.js
|
|
42091
|
-
var ContactsModuleRdfLib;
|
|
42268
|
+
var VCARD_ADDRESS_BOOK, ContactsModuleRdfLib;
|
|
42092
42269
|
var init_ContactsModuleRdfLib = __esm({
|
|
42093
42270
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/ContactsModuleRdfLib.js"() {
|
|
42094
42271
|
init_esm();
|
|
42095
42272
|
init_queries();
|
|
42096
|
-
|
|
42097
|
-
|
|
42098
|
-
|
|
42099
|
-
|
|
42100
|
-
init_GroupQuery();
|
|
42101
|
-
init_addContactToGroup();
|
|
42102
|
-
init_removeContactFromGroup();
|
|
42103
|
-
init_addNewPhoneNumber();
|
|
42104
|
-
init_addNewEmailAddress();
|
|
42105
|
-
init_removePhoneNumber();
|
|
42106
|
-
init_removeEmailAddress();
|
|
42107
|
-
init_ProfileQuery();
|
|
42108
|
-
init_TypeIndexQuery();
|
|
42109
|
-
init_PreferencesQuery();
|
|
42110
|
-
init_renameContact();
|
|
42111
|
-
init_addAddressBookToTypeIndex();
|
|
42112
|
-
init_updatePhoneNumber();
|
|
42113
|
-
init_updateEmailAddress();
|
|
42273
|
+
init_update_operations2();
|
|
42274
|
+
init_dist();
|
|
42275
|
+
init_namespaces();
|
|
42276
|
+
VCARD_ADDRESS_BOOK = vcard("AddressBook");
|
|
42114
42277
|
ContactsModuleRdfLib = class {
|
|
42115
42278
|
constructor(config2) {
|
|
42279
|
+
this.support = new ModuleSupport(config2);
|
|
42116
42280
|
this.store = config2.store;
|
|
42117
42281
|
this.fetcher = config2.fetcher;
|
|
42118
42282
|
this.updater = config2.updater;
|
|
42119
42283
|
}
|
|
42120
42284
|
async readAddressBook(uri6) {
|
|
42121
42285
|
const addressBookNode = namedNode2(uri6);
|
|
42122
|
-
await this.fetchNode(addressBookNode);
|
|
42286
|
+
await this.support.fetchNode(addressBookNode);
|
|
42123
42287
|
const query4 = new AddressBookQuery(this.store, addressBookNode);
|
|
42124
42288
|
const title9 = query4.queryTitle();
|
|
42125
42289
|
const nameEmailIndex = query4.queryNameEmailIndex();
|
|
42126
42290
|
const groupIndex = query4.queryGroupIndex();
|
|
42127
|
-
await
|
|
42128
|
-
this.fetchNode(nameEmailIndex),
|
|
42129
|
-
this.fetchNode(groupIndex)
|
|
42130
|
-
]);
|
|
42131
|
-
await this.fetchAll([nameEmailIndex, groupIndex]);
|
|
42291
|
+
await this.support.fetchAll([nameEmailIndex, groupIndex]);
|
|
42132
42292
|
const contacts = query4.queryContacts();
|
|
42133
42293
|
const groups = query4.queryGroups();
|
|
42134
42294
|
return {
|
|
@@ -42138,12 +42298,6 @@ var PodOS = (() => {
|
|
|
42138
42298
|
groups
|
|
42139
42299
|
};
|
|
42140
42300
|
}
|
|
42141
|
-
async fetchNode(node2) {
|
|
42142
|
-
return fetchNode(this.fetcher, node2);
|
|
42143
|
-
}
|
|
42144
|
-
async fetchAll(nodes) {
|
|
42145
|
-
return Promise.all(nodes.map((it) => this.fetchNode(it)));
|
|
42146
|
-
}
|
|
42147
42301
|
async createAddressBook({ containerUri, name: name7, ownerWebId }) {
|
|
42148
42302
|
const operation3 = createAddressBook(containerUri, name7);
|
|
42149
42303
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
@@ -42154,14 +42308,14 @@ var PodOS = (() => {
|
|
|
42154
42308
|
}
|
|
42155
42309
|
async updatePrivateTypeIndex(ownerWebId, addressBookUri) {
|
|
42156
42310
|
const profileNode = namedNode2(ownerWebId);
|
|
42157
|
-
await this.fetchNode(profileNode);
|
|
42311
|
+
await this.support.fetchNode(profileNode);
|
|
42158
42312
|
const profileQuery = new ProfileQuery(profileNode, this.store);
|
|
42159
42313
|
const preferencesFile2 = profileQuery.queryPreferencesFile();
|
|
42160
42314
|
const privateTypeIndex2 = await this.fetchPrivateTypeIndex(profileNode, preferencesFile2);
|
|
42161
42315
|
if (!privateTypeIndex2) {
|
|
42162
42316
|
throw new Error(`Private type not found for WebID ${ownerWebId}.`);
|
|
42163
42317
|
}
|
|
42164
|
-
const operation3 =
|
|
42318
|
+
const operation3 = addInstanceToTypeIndex(privateTypeIndex2, addressBookUri, VCARD_ADDRESS_BOOK);
|
|
42165
42319
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
42166
42320
|
}
|
|
42167
42321
|
async createNewContact({ addressBookUri, contact: contact4, groupUris }) {
|
|
@@ -42171,7 +42325,7 @@ var PodOS = (() => {
|
|
|
42171
42325
|
}
|
|
42172
42326
|
async executeAddContactToGroups(groupUris, contactQuery) {
|
|
42173
42327
|
const groupNodes = (groupUris ?? []).map((it) => namedNode2(it));
|
|
42174
|
-
await this.fetchAll(groupNodes);
|
|
42328
|
+
await this.support.fetchAll(groupNodes);
|
|
42175
42329
|
const groupUpdates = groupNodes.map((groupNode) => {
|
|
42176
42330
|
const groupQuery = new GroupQuery(this.store, groupNode);
|
|
42177
42331
|
const operation3 = addContactToGroup(contactQuery, groupQuery);
|
|
@@ -42181,14 +42335,14 @@ var PodOS = (() => {
|
|
|
42181
42335
|
}
|
|
42182
42336
|
async executeCreateNewContact(addressBookUri, contact4) {
|
|
42183
42337
|
const addressBookNode = namedNode2(addressBookUri);
|
|
42184
|
-
await this.fetchNode(addressBookNode);
|
|
42338
|
+
await this.support.fetchNode(addressBookNode);
|
|
42185
42339
|
const operation3 = createNewContact(new AddressBookQuery(this.store, addressBookNode), contact4);
|
|
42186
42340
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
42187
42341
|
return new ContactQuery(this.store, namedNode2(operation3.uri));
|
|
42188
42342
|
}
|
|
42189
42343
|
async readContact(uri6) {
|
|
42190
42344
|
const contactNode = namedNode2(uri6);
|
|
42191
|
-
await this.fetchNode(contactNode);
|
|
42345
|
+
await this.support.fetchNode(contactNode);
|
|
42192
42346
|
const query4 = new ContactQuery(this.store, contactNode);
|
|
42193
42347
|
const name7 = query4.queryName();
|
|
42194
42348
|
const emails = query4.queryEmails();
|
|
@@ -42202,7 +42356,7 @@ var PodOS = (() => {
|
|
|
42202
42356
|
}
|
|
42203
42357
|
async createNewGroup({ addressBookUri, groupName }) {
|
|
42204
42358
|
const addressBookNode = namedNode2(addressBookUri);
|
|
42205
|
-
await this.fetchNode(addressBookNode);
|
|
42359
|
+
await this.support.fetchNode(addressBookNode);
|
|
42206
42360
|
const query4 = new AddressBookQuery(this.store, addressBookNode);
|
|
42207
42361
|
const operation3 = createNewGroup(query4, groupName);
|
|
42208
42362
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
@@ -42210,7 +42364,7 @@ var PodOS = (() => {
|
|
|
42210
42364
|
}
|
|
42211
42365
|
async readGroup(uri6) {
|
|
42212
42366
|
const groupNode = namedNode2(uri6);
|
|
42213
|
-
await this.fetchNode(groupNode);
|
|
42367
|
+
await this.support.fetchNode(groupNode);
|
|
42214
42368
|
const query4 = new GroupQuery(this.store, groupNode);
|
|
42215
42369
|
const name7 = query4.queryName();
|
|
42216
42370
|
const members4 = query4.queryMembers();
|
|
@@ -42223,7 +42377,7 @@ var PodOS = (() => {
|
|
|
42223
42377
|
async addContactToGroup({ contactUri, groupUri }) {
|
|
42224
42378
|
const contactNode = namedNode2(contactUri);
|
|
42225
42379
|
const groupNode = namedNode2(groupUri);
|
|
42226
|
-
await this.fetchNode(contactNode);
|
|
42380
|
+
await this.support.fetchNode(contactNode);
|
|
42227
42381
|
const contactQuery = new ContactQuery(this.store, contactNode);
|
|
42228
42382
|
const groupQuery = new GroupQuery(this.store, groupNode);
|
|
42229
42383
|
const operation3 = addContactToGroup(contactQuery, groupQuery);
|
|
@@ -42232,7 +42386,7 @@ var PodOS = (() => {
|
|
|
42232
42386
|
async removeContactFromGroup({ contactUri, groupUri }) {
|
|
42233
42387
|
const contactNode = namedNode2(contactUri);
|
|
42234
42388
|
const groupNode = namedNode2(groupUri);
|
|
42235
|
-
await this.fetchNode(groupNode);
|
|
42389
|
+
await this.support.fetchNode(groupNode);
|
|
42236
42390
|
const contactQuery = new ContactQuery(this.store, contactNode);
|
|
42237
42391
|
const groupQuery = new GroupQuery(this.store, groupNode);
|
|
42238
42392
|
const operation3 = removeContactFromGroup(contactQuery, groupQuery);
|
|
@@ -42253,32 +42407,32 @@ var PodOS = (() => {
|
|
|
42253
42407
|
async removePhoneNumber({ contactUri, phoneNumberUri }) {
|
|
42254
42408
|
const contactNode = namedNode2(contactUri);
|
|
42255
42409
|
const phoneNumberNode = namedNode2(phoneNumberUri);
|
|
42256
|
-
await this.fetchNode(phoneNumberNode);
|
|
42410
|
+
await this.support.fetchNode(phoneNumberNode);
|
|
42257
42411
|
const operation3 = removePhoneNumber(contactNode, phoneNumberNode, this.store);
|
|
42258
42412
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
42259
42413
|
}
|
|
42260
42414
|
async removeEmailAddress({ contactUri, emailAddressUri }) {
|
|
42261
42415
|
const contactNode = namedNode2(contactUri);
|
|
42262
42416
|
const emailAddressNode = namedNode2(emailAddressUri);
|
|
42263
|
-
await this.fetchNode(emailAddressNode);
|
|
42417
|
+
await this.support.fetchNode(emailAddressNode);
|
|
42264
42418
|
const operation3 = removeEmailAddress(contactNode, emailAddressNode, this.store);
|
|
42265
42419
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
42266
42420
|
}
|
|
42267
42421
|
async updatePhoneNumber({ phoneNumberUri, newPhoneNumber }) {
|
|
42268
42422
|
const phoneNumberNode = namedNode2(phoneNumberUri);
|
|
42269
|
-
await this.fetchNode(phoneNumberNode);
|
|
42423
|
+
await this.support.fetchNode(phoneNumberNode);
|
|
42270
42424
|
const operation3 = updatePhoneNumber(phoneNumberNode, newPhoneNumber, this.store);
|
|
42271
42425
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
42272
42426
|
}
|
|
42273
42427
|
async updateEmailAddress({ emailAddressUri, newEmailAddress }) {
|
|
42274
42428
|
const emailAddressNode = namedNode2(emailAddressUri);
|
|
42275
|
-
await this.fetchNode(emailAddressNode);
|
|
42429
|
+
await this.support.fetchNode(emailAddressNode);
|
|
42276
42430
|
const operation3 = updateEmailAddress(emailAddressNode, newEmailAddress, this.store);
|
|
42277
42431
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
42278
42432
|
}
|
|
42279
42433
|
async listAddressBooks(webId) {
|
|
42280
42434
|
const profileNode = namedNode2(webId);
|
|
42281
|
-
await this.fetchNode(profileNode);
|
|
42435
|
+
await this.support.fetchNode(profileNode);
|
|
42282
42436
|
const profileQuery = new ProfileQuery(profileNode, this.store);
|
|
42283
42437
|
const publicTypeIndexNode = profileQuery.queryPublicTypeIndex();
|
|
42284
42438
|
const preferencesFile2 = profileQuery.queryPreferencesFile();
|
|
@@ -42298,20 +42452,20 @@ var PodOS = (() => {
|
|
|
42298
42452
|
if (!publicTypeIndexNode) {
|
|
42299
42453
|
return [];
|
|
42300
42454
|
}
|
|
42301
|
-
await this.fetchNode(publicTypeIndexNode);
|
|
42302
|
-
return new TypeIndexQuery(this.store, publicTypeIndexNode).
|
|
42455
|
+
await this.support.fetchNode(publicTypeIndexNode);
|
|
42456
|
+
return new TypeIndexQuery(this.store, publicTypeIndexNode).queryInstancesForClass(VCARD_ADDRESS_BOOK);
|
|
42303
42457
|
}
|
|
42304
42458
|
async fetchPrivateTypeIndex(profileNode, preferencesFile2) {
|
|
42305
42459
|
if (!preferencesFile2) {
|
|
42306
42460
|
return null;
|
|
42307
42461
|
}
|
|
42308
|
-
await this.fetchNode(preferencesFile2);
|
|
42462
|
+
await this.support.fetchNode(preferencesFile2);
|
|
42309
42463
|
const preferencesQuery = new PreferencesQuery(this.store, profileNode, preferencesFile2);
|
|
42310
42464
|
return preferencesQuery.queryPrivateTypeIndex();
|
|
42311
42465
|
}
|
|
42312
42466
|
async renameContact({ contactUri, newName }) {
|
|
42313
42467
|
const contactNode = namedNode2(contactUri);
|
|
42314
|
-
await this.fetchNode(contactNode);
|
|
42468
|
+
await this.support.fetchNode(contactNode);
|
|
42315
42469
|
const operation3 = renameContact(this.store, contactNode, newName);
|
|
42316
42470
|
await executeUpdate(this.fetcher, this.updater, operation3);
|
|
42317
42471
|
}
|
|
@@ -42325,7 +42479,7 @@ var PodOS = (() => {
|
|
|
42325
42479
|
default: () => dist_default
|
|
42326
42480
|
});
|
|
42327
42481
|
var dist_default;
|
|
42328
|
-
var
|
|
42482
|
+
var init_dist2 = __esm({
|
|
42329
42483
|
"../node_modules/@solid-data-modules/contacts-rdflib/dist/index.js"() {
|
|
42330
42484
|
init_ContactsModuleRdfLib();
|
|
42331
42485
|
dist_default = ContactsModuleRdfLib;
|
|
@@ -42369,20 +42523,20 @@ var PodOS = (() => {
|
|
|
42369
42523
|
if (obj === null || obj === void 0) {
|
|
42370
42524
|
return obj;
|
|
42371
42525
|
}
|
|
42372
|
-
var
|
|
42526
|
+
var clone2 = /* @__PURE__ */ Object.create(null), keys = Object.keys(obj);
|
|
42373
42527
|
for (var i = 0; i < keys.length; i++) {
|
|
42374
42528
|
var key3 = keys[i], val = obj[key3];
|
|
42375
42529
|
if (Array.isArray(val)) {
|
|
42376
|
-
|
|
42530
|
+
clone2[key3] = val.slice();
|
|
42377
42531
|
continue;
|
|
42378
42532
|
}
|
|
42379
42533
|
if (typeof val === "string" || typeof val === "number" || typeof val === "boolean") {
|
|
42380
|
-
|
|
42534
|
+
clone2[key3] = val;
|
|
42381
42535
|
continue;
|
|
42382
42536
|
}
|
|
42383
42537
|
throw new TypeError("clone is not deep and does not support nested objects");
|
|
42384
42538
|
}
|
|
42385
|
-
return
|
|
42539
|
+
return clone2;
|
|
42386
42540
|
};
|
|
42387
42541
|
lunr2.FieldRef = function(docRef, fieldName, stringValue) {
|
|
42388
42542
|
this.docRef = docRef;
|
|
@@ -44126,7 +44280,8 @@ var PodOS = (() => {
|
|
|
44126
44280
|
RdfDocument: () => RdfDocument,
|
|
44127
44281
|
SearchIndex: () => SearchIndex,
|
|
44128
44282
|
Thing: () => Thing,
|
|
44129
|
-
WebIdProfile: () => WebIdProfile
|
|
44283
|
+
WebIdProfile: () => WebIdProfile,
|
|
44284
|
+
labelFromUri: () => labelFromUri
|
|
44130
44285
|
});
|
|
44131
44286
|
|
|
44132
44287
|
// ../node_modules/tslib/tslib.es6.mjs
|
|
@@ -45763,18 +45918,11 @@ var PodOS = (() => {
|
|
|
45763
45918
|
}) : identity;
|
|
45764
45919
|
}
|
|
45765
45920
|
|
|
45766
|
-
// ../node_modules/@inrupt/solid-client-authn-core/dist/
|
|
45767
|
-
var import_events = __toESM(require_events(), 1);
|
|
45768
|
-
|
|
45769
|
-
// ../node_modules/@inrupt/universal-fetch/dist/index-browser.mjs
|
|
45770
|
-
var indexBrowser = globalThis.fetch;
|
|
45771
|
-
var { fetch: fetch2, Response, Request, Headers } = globalThis;
|
|
45772
|
-
|
|
45773
|
-
// ../node_modules/jose/dist/browser/runtime/webcrypto.js
|
|
45921
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/webcrypto.js
|
|
45774
45922
|
var webcrypto_default = crypto;
|
|
45775
45923
|
var isCryptoKey = (key3) => key3 instanceof CryptoKey;
|
|
45776
45924
|
|
|
45777
|
-
// ../node_modules/jose/dist/browser/lib/buffer_utils.js
|
|
45925
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/buffer_utils.js
|
|
45778
45926
|
var encoder = new TextEncoder();
|
|
45779
45927
|
var decoder = new TextDecoder();
|
|
45780
45928
|
var MAX_INT32 = 2 ** 32;
|
|
@@ -45782,14 +45930,14 @@ var PodOS = (() => {
|
|
|
45782
45930
|
const size4 = buffers.reduce((acc, { length: length2 }) => acc + length2, 0);
|
|
45783
45931
|
const buf = new Uint8Array(size4);
|
|
45784
45932
|
let i = 0;
|
|
45785
|
-
|
|
45933
|
+
for (const buffer of buffers) {
|
|
45786
45934
|
buf.set(buffer, i);
|
|
45787
45935
|
i += buffer.length;
|
|
45788
|
-
}
|
|
45936
|
+
}
|
|
45789
45937
|
return buf;
|
|
45790
45938
|
}
|
|
45791
45939
|
|
|
45792
|
-
// ../node_modules/jose/dist/browser/runtime/base64url.js
|
|
45940
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/base64url.js
|
|
45793
45941
|
var encodeBase64 = (input2) => {
|
|
45794
45942
|
let unencoded = input2;
|
|
45795
45943
|
if (typeof unencoded === "string") {
|
|
@@ -45821,44 +45969,45 @@ var PodOS = (() => {
|
|
|
45821
45969
|
encoded = encoded.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "");
|
|
45822
45970
|
try {
|
|
45823
45971
|
return decodeBase64(encoded);
|
|
45824
|
-
} catch
|
|
45972
|
+
} catch {
|
|
45825
45973
|
throw new TypeError("The input to be decoded is not correctly encoded.");
|
|
45826
45974
|
}
|
|
45827
45975
|
};
|
|
45828
45976
|
|
|
45829
|
-
// ../node_modules/jose/dist/browser/util/errors.js
|
|
45977
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/util/errors.js
|
|
45830
45978
|
var JOSEError = class extends Error {
|
|
45831
45979
|
static get code() {
|
|
45832
45980
|
return "ERR_JOSE_GENERIC";
|
|
45833
45981
|
}
|
|
45834
45982
|
constructor(message4) {
|
|
45835
|
-
var _a;
|
|
45836
45983
|
super(message4);
|
|
45837
45984
|
this.code = "ERR_JOSE_GENERIC";
|
|
45838
45985
|
this.name = this.constructor.name;
|
|
45839
|
-
|
|
45986
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
45840
45987
|
}
|
|
45841
45988
|
};
|
|
45842
45989
|
var JWTClaimValidationFailed = class extends JOSEError {
|
|
45843
45990
|
static get code() {
|
|
45844
45991
|
return "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
45845
45992
|
}
|
|
45846
|
-
constructor(message4, claim2 = "unspecified", reason2 = "unspecified") {
|
|
45993
|
+
constructor(message4, payload4, claim2 = "unspecified", reason2 = "unspecified") {
|
|
45847
45994
|
super(message4);
|
|
45848
45995
|
this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
45849
45996
|
this.claim = claim2;
|
|
45850
45997
|
this.reason = reason2;
|
|
45998
|
+
this.payload = payload4;
|
|
45851
45999
|
}
|
|
45852
46000
|
};
|
|
45853
46001
|
var JWTExpired = class extends JOSEError {
|
|
45854
46002
|
static get code() {
|
|
45855
46003
|
return "ERR_JWT_EXPIRED";
|
|
45856
46004
|
}
|
|
45857
|
-
constructor(message4, claim2 = "unspecified", reason2 = "unspecified") {
|
|
46005
|
+
constructor(message4, payload4, claim2 = "unspecified", reason2 = "unspecified") {
|
|
45858
46006
|
super(message4);
|
|
45859
46007
|
this.code = "ERR_JWT_EXPIRED";
|
|
45860
46008
|
this.claim = claim2;
|
|
45861
46009
|
this.reason = reason2;
|
|
46010
|
+
this.payload = payload4;
|
|
45862
46011
|
}
|
|
45863
46012
|
};
|
|
45864
46013
|
var JOSEAlgNotAllowed = class extends JOSEError {
|
|
@@ -45897,6 +46046,45 @@ var PodOS = (() => {
|
|
|
45897
46046
|
return "ERR_JWT_INVALID";
|
|
45898
46047
|
}
|
|
45899
46048
|
};
|
|
46049
|
+
var JWKSInvalid = class extends JOSEError {
|
|
46050
|
+
constructor() {
|
|
46051
|
+
super(...arguments);
|
|
46052
|
+
this.code = "ERR_JWKS_INVALID";
|
|
46053
|
+
}
|
|
46054
|
+
static get code() {
|
|
46055
|
+
return "ERR_JWKS_INVALID";
|
|
46056
|
+
}
|
|
46057
|
+
};
|
|
46058
|
+
var JWKSNoMatchingKey = class extends JOSEError {
|
|
46059
|
+
constructor() {
|
|
46060
|
+
super(...arguments);
|
|
46061
|
+
this.code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
46062
|
+
this.message = "no applicable key found in the JSON Web Key Set";
|
|
46063
|
+
}
|
|
46064
|
+
static get code() {
|
|
46065
|
+
return "ERR_JWKS_NO_MATCHING_KEY";
|
|
46066
|
+
}
|
|
46067
|
+
};
|
|
46068
|
+
var JWKSMultipleMatchingKeys = class extends JOSEError {
|
|
46069
|
+
constructor() {
|
|
46070
|
+
super(...arguments);
|
|
46071
|
+
this.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
46072
|
+
this.message = "multiple matching keys found in the JSON Web Key Set";
|
|
46073
|
+
}
|
|
46074
|
+
static get code() {
|
|
46075
|
+
return "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
46076
|
+
}
|
|
46077
|
+
};
|
|
46078
|
+
var JWKSTimeout = class extends JOSEError {
|
|
46079
|
+
constructor() {
|
|
46080
|
+
super(...arguments);
|
|
46081
|
+
this.code = "ERR_JWKS_TIMEOUT";
|
|
46082
|
+
this.message = "request timed out";
|
|
46083
|
+
}
|
|
46084
|
+
static get code() {
|
|
46085
|
+
return "ERR_JWKS_TIMEOUT";
|
|
46086
|
+
}
|
|
46087
|
+
};
|
|
45900
46088
|
var JWSSignatureVerificationFailed = class extends JOSEError {
|
|
45901
46089
|
constructor() {
|
|
45902
46090
|
super(...arguments);
|
|
@@ -45908,10 +46096,7 @@ var PodOS = (() => {
|
|
|
45908
46096
|
}
|
|
45909
46097
|
};
|
|
45910
46098
|
|
|
45911
|
-
// ../node_modules/jose/dist/browser/
|
|
45912
|
-
var random_default = webcrypto_default.getRandomValues.bind(webcrypto_default);
|
|
45913
|
-
|
|
45914
|
-
// ../node_modules/jose/dist/browser/lib/crypto_key.js
|
|
46099
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/crypto_key.js
|
|
45915
46100
|
function unusable(name7, prop = "algorithm.name") {
|
|
45916
46101
|
return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name7}`);
|
|
45917
46102
|
}
|
|
@@ -46005,8 +46190,9 @@ var PodOS = (() => {
|
|
|
46005
46190
|
checkUsage(key3, usages);
|
|
46006
46191
|
}
|
|
46007
46192
|
|
|
46008
|
-
// ../node_modules/jose/dist/browser/lib/invalid_key_input.js
|
|
46193
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/invalid_key_input.js
|
|
46009
46194
|
function message(msg2, actual2, ...types2) {
|
|
46195
|
+
types2 = types2.filter(Boolean);
|
|
46010
46196
|
if (types2.length > 2) {
|
|
46011
46197
|
const last3 = types2.pop();
|
|
46012
46198
|
msg2 += `one of type ${types2.join(", ")}, or ${last3}.`;
|
|
@@ -46020,7 +46206,7 @@ var PodOS = (() => {
|
|
|
46020
46206
|
} else if (typeof actual2 === "function" && actual2.name) {
|
|
46021
46207
|
msg2 += ` Received function ${actual2.name}`;
|
|
46022
46208
|
} else if (typeof actual2 === "object" && actual2 != null) {
|
|
46023
|
-
if (actual2.constructor
|
|
46209
|
+
if (actual2.constructor?.name) {
|
|
46024
46210
|
msg2 += ` Received an instance of ${actual2.constructor.name}`;
|
|
46025
46211
|
}
|
|
46026
46212
|
}
|
|
@@ -46033,13 +46219,16 @@ var PodOS = (() => {
|
|
|
46033
46219
|
return message(`Key for the ${alg} algorithm must be `, actual2, ...types2);
|
|
46034
46220
|
}
|
|
46035
46221
|
|
|
46036
|
-
// ../node_modules/jose/dist/browser/runtime/is_key_like.js
|
|
46222
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/is_key_like.js
|
|
46037
46223
|
var is_key_like_default = (key3) => {
|
|
46038
|
-
|
|
46224
|
+
if (isCryptoKey(key3)) {
|
|
46225
|
+
return true;
|
|
46226
|
+
}
|
|
46227
|
+
return key3?.[Symbol.toStringTag] === "KeyObject";
|
|
46039
46228
|
};
|
|
46040
46229
|
var types = ["CryptoKey"];
|
|
46041
46230
|
|
|
46042
|
-
// ../node_modules/jose/dist/browser/lib/is_disjoint.js
|
|
46231
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/is_disjoint.js
|
|
46043
46232
|
var isDisjoint = (...headers) => {
|
|
46044
46233
|
const sources = headers.filter(Boolean);
|
|
46045
46234
|
if (sources.length === 0 || sources.length === 1) {
|
|
@@ -46063,7 +46252,7 @@ var PodOS = (() => {
|
|
|
46063
46252
|
};
|
|
46064
46253
|
var is_disjoint_default = isDisjoint;
|
|
46065
46254
|
|
|
46066
|
-
// ../node_modules/jose/dist/browser/lib/is_object.js
|
|
46255
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/is_object.js
|
|
46067
46256
|
function isObjectLike(value6) {
|
|
46068
46257
|
return typeof value6 === "object" && value6 !== null;
|
|
46069
46258
|
}
|
|
@@ -46081,7 +46270,7 @@ var PodOS = (() => {
|
|
|
46081
46270
|
return Object.getPrototypeOf(input2) === proto;
|
|
46082
46271
|
}
|
|
46083
46272
|
|
|
46084
|
-
// ../node_modules/jose/dist/browser/runtime/check_key_length.js
|
|
46273
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/check_key_length.js
|
|
46085
46274
|
var check_key_length_default = (alg, key3) => {
|
|
46086
46275
|
if (alg.startsWith("RS") || alg.startsWith("PS")) {
|
|
46087
46276
|
const { modulusLength } = key3.algorithm;
|
|
@@ -46091,49 +46280,25 @@ var PodOS = (() => {
|
|
|
46091
46280
|
}
|
|
46092
46281
|
};
|
|
46093
46282
|
|
|
46094
|
-
// ../node_modules/jose/dist/browser/
|
|
46283
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/is_jwk.js
|
|
46284
|
+
function isJWK(key3) {
|
|
46285
|
+
return isObject(key3) && typeof key3.kty === "string";
|
|
46286
|
+
}
|
|
46287
|
+
function isPrivateJWK(key3) {
|
|
46288
|
+
return key3.kty !== "oct" && typeof key3.d === "string";
|
|
46289
|
+
}
|
|
46290
|
+
function isPublicJWK(key3) {
|
|
46291
|
+
return key3.kty !== "oct" && typeof key3.d === "undefined";
|
|
46292
|
+
}
|
|
46293
|
+
function isSecretJWK(key3) {
|
|
46294
|
+
return isJWK(key3) && key3.kty === "oct" && typeof key3.k === "string";
|
|
46295
|
+
}
|
|
46296
|
+
|
|
46297
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/jwk_to_key.js
|
|
46095
46298
|
function subtleMapping(jwk) {
|
|
46096
46299
|
let algorithm3;
|
|
46097
46300
|
let keyUsages;
|
|
46098
46301
|
switch (jwk.kty) {
|
|
46099
|
-
case "oct": {
|
|
46100
|
-
switch (jwk.alg) {
|
|
46101
|
-
case "HS256":
|
|
46102
|
-
case "HS384":
|
|
46103
|
-
case "HS512":
|
|
46104
|
-
algorithm3 = { name: "HMAC", hash: `SHA-${jwk.alg.slice(-3)}` };
|
|
46105
|
-
keyUsages = ["sign", "verify"];
|
|
46106
|
-
break;
|
|
46107
|
-
case "A128CBC-HS256":
|
|
46108
|
-
case "A192CBC-HS384":
|
|
46109
|
-
case "A256CBC-HS512":
|
|
46110
|
-
throw new JOSENotSupported(`${jwk.alg} keys cannot be imported as CryptoKey instances`);
|
|
46111
|
-
case "A128GCM":
|
|
46112
|
-
case "A192GCM":
|
|
46113
|
-
case "A256GCM":
|
|
46114
|
-
case "A128GCMKW":
|
|
46115
|
-
case "A192GCMKW":
|
|
46116
|
-
case "A256GCMKW":
|
|
46117
|
-
algorithm3 = { name: "AES-GCM" };
|
|
46118
|
-
keyUsages = ["encrypt", "decrypt"];
|
|
46119
|
-
break;
|
|
46120
|
-
case "A128KW":
|
|
46121
|
-
case "A192KW":
|
|
46122
|
-
case "A256KW":
|
|
46123
|
-
algorithm3 = { name: "AES-KW" };
|
|
46124
|
-
keyUsages = ["wrapKey", "unwrapKey"];
|
|
46125
|
-
break;
|
|
46126
|
-
case "PBES2-HS256+A128KW":
|
|
46127
|
-
case "PBES2-HS384+A192KW":
|
|
46128
|
-
case "PBES2-HS512+A256KW":
|
|
46129
|
-
algorithm3 = { name: "PBKDF2" };
|
|
46130
|
-
keyUsages = ["deriveBits"];
|
|
46131
|
-
break;
|
|
46132
|
-
default:
|
|
46133
|
-
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
46134
|
-
}
|
|
46135
|
-
break;
|
|
46136
|
-
}
|
|
46137
46302
|
case "RSA": {
|
|
46138
46303
|
switch (jwk.alg) {
|
|
46139
46304
|
case "PS256":
|
|
@@ -46213,19 +46378,15 @@ var PodOS = (() => {
|
|
|
46213
46378
|
return { algorithm: algorithm3, keyUsages };
|
|
46214
46379
|
}
|
|
46215
46380
|
var parse = async (jwk) => {
|
|
46216
|
-
var _a, _b;
|
|
46217
46381
|
if (!jwk.alg) {
|
|
46218
46382
|
throw new TypeError('"alg" argument is required when "jwk.alg" is not present');
|
|
46219
46383
|
}
|
|
46220
46384
|
const { algorithm: algorithm3, keyUsages } = subtleMapping(jwk);
|
|
46221
46385
|
const rest3 = [
|
|
46222
46386
|
algorithm3,
|
|
46223
|
-
|
|
46224
|
-
|
|
46387
|
+
jwk.ext ?? false,
|
|
46388
|
+
jwk.key_ops ?? keyUsages
|
|
46225
46389
|
];
|
|
46226
|
-
if (algorithm3.name === "PBKDF2") {
|
|
46227
|
-
return webcrypto_default.subtle.importKey("raw", decode(jwk.k), ...rest3);
|
|
46228
|
-
}
|
|
46229
46390
|
const keyData = { ...jwk };
|
|
46230
46391
|
delete keyData.alg;
|
|
46231
46392
|
delete keyData.use;
|
|
@@ -46233,9 +46394,74 @@ var PodOS = (() => {
|
|
|
46233
46394
|
};
|
|
46234
46395
|
var jwk_to_key_default = parse;
|
|
46235
46396
|
|
|
46236
|
-
// ../node_modules/jose/dist/browser/
|
|
46237
|
-
|
|
46238
|
-
|
|
46397
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/normalize_key.js
|
|
46398
|
+
var exportKeyValue = (k) => decode(k);
|
|
46399
|
+
var privCache;
|
|
46400
|
+
var pubCache;
|
|
46401
|
+
var isKeyObject = (key3) => {
|
|
46402
|
+
return key3?.[Symbol.toStringTag] === "KeyObject";
|
|
46403
|
+
};
|
|
46404
|
+
var importAndCache = async (cache, key3, jwk, alg, freeze = false) => {
|
|
46405
|
+
let cached = cache.get(key3);
|
|
46406
|
+
if (cached?.[alg]) {
|
|
46407
|
+
return cached[alg];
|
|
46408
|
+
}
|
|
46409
|
+
const cryptoKey = await jwk_to_key_default({ ...jwk, alg });
|
|
46410
|
+
if (freeze)
|
|
46411
|
+
Object.freeze(key3);
|
|
46412
|
+
if (!cached) {
|
|
46413
|
+
cache.set(key3, { [alg]: cryptoKey });
|
|
46414
|
+
} else {
|
|
46415
|
+
cached[alg] = cryptoKey;
|
|
46416
|
+
}
|
|
46417
|
+
return cryptoKey;
|
|
46418
|
+
};
|
|
46419
|
+
var normalizePublicKey = (key3, alg) => {
|
|
46420
|
+
if (isKeyObject(key3)) {
|
|
46421
|
+
let jwk = key3.export({ format: "jwk" });
|
|
46422
|
+
delete jwk.d;
|
|
46423
|
+
delete jwk.dp;
|
|
46424
|
+
delete jwk.dq;
|
|
46425
|
+
delete jwk.p;
|
|
46426
|
+
delete jwk.q;
|
|
46427
|
+
delete jwk.qi;
|
|
46428
|
+
if (jwk.k) {
|
|
46429
|
+
return exportKeyValue(jwk.k);
|
|
46430
|
+
}
|
|
46431
|
+
pubCache || (pubCache = /* @__PURE__ */ new WeakMap());
|
|
46432
|
+
return importAndCache(pubCache, key3, jwk, alg);
|
|
46433
|
+
}
|
|
46434
|
+
if (isJWK(key3)) {
|
|
46435
|
+
if (key3.k)
|
|
46436
|
+
return decode(key3.k);
|
|
46437
|
+
pubCache || (pubCache = /* @__PURE__ */ new WeakMap());
|
|
46438
|
+
const cryptoKey = importAndCache(pubCache, key3, key3, alg, true);
|
|
46439
|
+
return cryptoKey;
|
|
46440
|
+
}
|
|
46441
|
+
return key3;
|
|
46442
|
+
};
|
|
46443
|
+
var normalizePrivateKey = (key3, alg) => {
|
|
46444
|
+
if (isKeyObject(key3)) {
|
|
46445
|
+
let jwk = key3.export({ format: "jwk" });
|
|
46446
|
+
if (jwk.k) {
|
|
46447
|
+
return exportKeyValue(jwk.k);
|
|
46448
|
+
}
|
|
46449
|
+
privCache || (privCache = /* @__PURE__ */ new WeakMap());
|
|
46450
|
+
return importAndCache(privCache, key3, jwk, alg);
|
|
46451
|
+
}
|
|
46452
|
+
if (isJWK(key3)) {
|
|
46453
|
+
if (key3.k)
|
|
46454
|
+
return decode(key3.k);
|
|
46455
|
+
privCache || (privCache = /* @__PURE__ */ new WeakMap());
|
|
46456
|
+
const cryptoKey = importAndCache(privCache, key3, key3, alg, true);
|
|
46457
|
+
return cryptoKey;
|
|
46458
|
+
}
|
|
46459
|
+
return key3;
|
|
46460
|
+
};
|
|
46461
|
+
var normalize_key_default = { normalizePublicKey, normalizePrivateKey };
|
|
46462
|
+
|
|
46463
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/key/import.js
|
|
46464
|
+
async function importJWK(jwk, alg) {
|
|
46239
46465
|
if (!isObject(jwk)) {
|
|
46240
46466
|
throw new TypeError("JWK must be an object");
|
|
46241
46467
|
}
|
|
@@ -46245,10 +46471,6 @@ var PodOS = (() => {
|
|
|
46245
46471
|
if (typeof jwk.k !== "string" || !jwk.k) {
|
|
46246
46472
|
throw new TypeError('missing "k" (Key Value) Parameter value');
|
|
46247
46473
|
}
|
|
46248
|
-
octAsKeyObject !== null && octAsKeyObject !== void 0 ? octAsKeyObject : octAsKeyObject = jwk.ext !== true;
|
|
46249
|
-
if (octAsKeyObject) {
|
|
46250
|
-
return jwk_to_key_default({ ...jwk, alg, ext: (_a = jwk.ext) !== null && _a !== void 0 ? _a : false });
|
|
46251
|
-
}
|
|
46252
46474
|
return decode(jwk.k);
|
|
46253
46475
|
case "RSA":
|
|
46254
46476
|
if (jwk.oth !== void 0) {
|
|
@@ -46262,50 +46484,81 @@ var PodOS = (() => {
|
|
|
46262
46484
|
}
|
|
46263
46485
|
}
|
|
46264
46486
|
|
|
46265
|
-
// ../node_modules/jose/dist/browser/lib/check_key_type.js
|
|
46266
|
-
var
|
|
46487
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/check_key_type.js
|
|
46488
|
+
var tag = (key3) => key3?.[Symbol.toStringTag];
|
|
46489
|
+
var jwkMatchesOp = (alg, key3, usage2) => {
|
|
46490
|
+
if (key3.use !== void 0 && key3.use !== "sig") {
|
|
46491
|
+
throw new TypeError("Invalid key for this operation, when present its use must be sig");
|
|
46492
|
+
}
|
|
46493
|
+
if (key3.key_ops !== void 0 && key3.key_ops.includes?.(usage2) !== true) {
|
|
46494
|
+
throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${usage2}`);
|
|
46495
|
+
}
|
|
46496
|
+
if (key3.alg !== void 0 && key3.alg !== alg) {
|
|
46497
|
+
throw new TypeError(`Invalid key for this operation, when present its alg must be ${alg}`);
|
|
46498
|
+
}
|
|
46499
|
+
return true;
|
|
46500
|
+
};
|
|
46501
|
+
var symmetricTypeCheck = (alg, key3, usage2, allowJwk) => {
|
|
46267
46502
|
if (key3 instanceof Uint8Array)
|
|
46268
46503
|
return;
|
|
46504
|
+
if (allowJwk && isJWK(key3)) {
|
|
46505
|
+
if (isSecretJWK(key3) && jwkMatchesOp(alg, key3, usage2))
|
|
46506
|
+
return;
|
|
46507
|
+
throw new TypeError(`JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present`);
|
|
46508
|
+
}
|
|
46269
46509
|
if (!is_key_like_default(key3)) {
|
|
46270
|
-
throw new TypeError(withAlg(alg, key3, ...types, "Uint8Array"));
|
|
46510
|
+
throw new TypeError(withAlg(alg, key3, ...types, "Uint8Array", allowJwk ? "JSON Web Key" : null));
|
|
46271
46511
|
}
|
|
46272
46512
|
if (key3.type !== "secret") {
|
|
46273
|
-
throw new TypeError(`${
|
|
46513
|
+
throw new TypeError(`${tag(key3)} instances for symmetric algorithms must be of type "secret"`);
|
|
46274
46514
|
}
|
|
46275
46515
|
};
|
|
46276
|
-
var asymmetricTypeCheck = (alg, key3, usage2) => {
|
|
46516
|
+
var asymmetricTypeCheck = (alg, key3, usage2, allowJwk) => {
|
|
46517
|
+
if (allowJwk && isJWK(key3)) {
|
|
46518
|
+
switch (usage2) {
|
|
46519
|
+
case "sign":
|
|
46520
|
+
if (isPrivateJWK(key3) && jwkMatchesOp(alg, key3, usage2))
|
|
46521
|
+
return;
|
|
46522
|
+
throw new TypeError(`JSON Web Key for this operation be a private JWK`);
|
|
46523
|
+
case "verify":
|
|
46524
|
+
if (isPublicJWK(key3) && jwkMatchesOp(alg, key3, usage2))
|
|
46525
|
+
return;
|
|
46526
|
+
throw new TypeError(`JSON Web Key for this operation be a public JWK`);
|
|
46527
|
+
}
|
|
46528
|
+
}
|
|
46277
46529
|
if (!is_key_like_default(key3)) {
|
|
46278
|
-
throw new TypeError(withAlg(alg, key3, ...types));
|
|
46530
|
+
throw new TypeError(withAlg(alg, key3, ...types, allowJwk ? "JSON Web Key" : null));
|
|
46279
46531
|
}
|
|
46280
46532
|
if (key3.type === "secret") {
|
|
46281
|
-
throw new TypeError(`${
|
|
46533
|
+
throw new TypeError(`${tag(key3)} instances for asymmetric algorithms must not be of type "secret"`);
|
|
46282
46534
|
}
|
|
46283
46535
|
if (usage2 === "sign" && key3.type === "public") {
|
|
46284
|
-
throw new TypeError(`${
|
|
46536
|
+
throw new TypeError(`${tag(key3)} instances for asymmetric algorithm signing must be of type "private"`);
|
|
46285
46537
|
}
|
|
46286
46538
|
if (usage2 === "decrypt" && key3.type === "public") {
|
|
46287
|
-
throw new TypeError(`${
|
|
46539
|
+
throw new TypeError(`${tag(key3)} instances for asymmetric algorithm decryption must be of type "private"`);
|
|
46288
46540
|
}
|
|
46289
46541
|
if (key3.algorithm && usage2 === "verify" && key3.type === "private") {
|
|
46290
|
-
throw new TypeError(`${
|
|
46542
|
+
throw new TypeError(`${tag(key3)} instances for asymmetric algorithm verifying must be of type "public"`);
|
|
46291
46543
|
}
|
|
46292
46544
|
if (key3.algorithm && usage2 === "encrypt" && key3.type === "private") {
|
|
46293
|
-
throw new TypeError(`${
|
|
46545
|
+
throw new TypeError(`${tag(key3)} instances for asymmetric algorithm encryption must be of type "public"`);
|
|
46294
46546
|
}
|
|
46295
46547
|
};
|
|
46296
|
-
|
|
46548
|
+
function checkKeyType(allowJwk, alg, key3, usage2) {
|
|
46297
46549
|
const symmetric = alg.startsWith("HS") || alg === "dir" || alg.startsWith("PBES2") || /^A\d{3}(?:GCM)?KW$/.test(alg);
|
|
46298
46550
|
if (symmetric) {
|
|
46299
|
-
symmetricTypeCheck(alg, key3);
|
|
46551
|
+
symmetricTypeCheck(alg, key3, usage2, allowJwk);
|
|
46300
46552
|
} else {
|
|
46301
|
-
asymmetricTypeCheck(alg, key3, usage2);
|
|
46553
|
+
asymmetricTypeCheck(alg, key3, usage2, allowJwk);
|
|
46302
46554
|
}
|
|
46303
|
-
}
|
|
46304
|
-
var check_key_type_default = checkKeyType;
|
|
46555
|
+
}
|
|
46556
|
+
var check_key_type_default = checkKeyType.bind(void 0, false);
|
|
46557
|
+
var checkKeyTypeWithJwk = checkKeyType.bind(void 0, true);
|
|
46305
46558
|
|
|
46306
|
-
// ../node_modules/jose/dist/browser/lib/validate_crit.js
|
|
46559
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/validate_crit.js
|
|
46307
46560
|
function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
|
|
46308
|
-
if (joseHeader.crit !== void 0 && protectedHeader
|
|
46561
|
+
if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0) {
|
|
46309
46562
|
throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
46310
46563
|
}
|
|
46311
46564
|
if (!protectedHeader || protectedHeader.crit === void 0) {
|
|
@@ -46326,7 +46579,8 @@ var PodOS = (() => {
|
|
|
46326
46579
|
}
|
|
46327
46580
|
if (joseHeader[parameter2] === void 0) {
|
|
46328
46581
|
throw new Err(`Extension Header Parameter "${parameter2}" is missing`);
|
|
46329
|
-
}
|
|
46582
|
+
}
|
|
46583
|
+
if (recognized.get(parameter2) && protectedHeader[parameter2] === void 0) {
|
|
46330
46584
|
throw new Err(`Extension Header Parameter "${parameter2}" MUST be integrity protected`);
|
|
46331
46585
|
}
|
|
46332
46586
|
}
|
|
@@ -46334,7 +46588,7 @@ var PodOS = (() => {
|
|
|
46334
46588
|
}
|
|
46335
46589
|
var validate_crit_default = validateCrit;
|
|
46336
46590
|
|
|
46337
|
-
// ../node_modules/jose/dist/browser/lib/validate_algorithms.js
|
|
46591
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/validate_algorithms.js
|
|
46338
46592
|
var validateAlgorithms = (option5, algorithms) => {
|
|
46339
46593
|
if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s) => typeof s !== "string"))) {
|
|
46340
46594
|
throw new TypeError(`"${option5}" option must be an array of strings`);
|
|
@@ -46346,7 +46600,7 @@ var PodOS = (() => {
|
|
|
46346
46600
|
};
|
|
46347
46601
|
var validate_algorithms_default = validateAlgorithms;
|
|
46348
46602
|
|
|
46349
|
-
// ../node_modules/jose/dist/browser/runtime/key_to_jwk.js
|
|
46603
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/key_to_jwk.js
|
|
46350
46604
|
var keyToJWK = async (key3) => {
|
|
46351
46605
|
if (key3 instanceof Uint8Array) {
|
|
46352
46606
|
return {
|
|
@@ -46365,15 +46619,12 @@ var PodOS = (() => {
|
|
|
46365
46619
|
};
|
|
46366
46620
|
var key_to_jwk_default = keyToJWK;
|
|
46367
46621
|
|
|
46368
|
-
// ../node_modules/jose/dist/browser/key/export.js
|
|
46622
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/key/export.js
|
|
46369
46623
|
async function exportJWK(key3) {
|
|
46370
46624
|
return key_to_jwk_default(key3);
|
|
46371
46625
|
}
|
|
46372
46626
|
|
|
46373
|
-
// ../node_modules/jose/dist/browser/
|
|
46374
|
-
var unprotected = Symbol();
|
|
46375
|
-
|
|
46376
|
-
// ../node_modules/jose/dist/browser/runtime/subtle_dsa.js
|
|
46627
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/subtle_dsa.js
|
|
46377
46628
|
function subtleDsa(alg, algorithm3) {
|
|
46378
46629
|
const hash2 = `SHA-${alg.slice(-3)}`;
|
|
46379
46630
|
switch (alg) {
|
|
@@ -46400,8 +46651,14 @@ var PodOS = (() => {
|
|
|
46400
46651
|
}
|
|
46401
46652
|
}
|
|
46402
46653
|
|
|
46403
|
-
// ../node_modules/jose/dist/browser/runtime/get_sign_verify_key.js
|
|
46404
|
-
function getCryptoKey(alg, key3, usage2) {
|
|
46654
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/get_sign_verify_key.js
|
|
46655
|
+
async function getCryptoKey(alg, key3, usage2) {
|
|
46656
|
+
if (usage2 === "sign") {
|
|
46657
|
+
key3 = await normalize_key_default.normalizePrivateKey(key3, alg);
|
|
46658
|
+
}
|
|
46659
|
+
if (usage2 === "verify") {
|
|
46660
|
+
key3 = await normalize_key_default.normalizePublicKey(key3, alg);
|
|
46661
|
+
}
|
|
46405
46662
|
if (isCryptoKey(key3)) {
|
|
46406
46663
|
checkSigCryptoKey(key3, alg, usage2);
|
|
46407
46664
|
return key3;
|
|
@@ -46412,25 +46669,24 @@ var PodOS = (() => {
|
|
|
46412
46669
|
}
|
|
46413
46670
|
return webcrypto_default.subtle.importKey("raw", key3, { hash: `SHA-${alg.slice(-3)}`, name: "HMAC" }, false, [usage2]);
|
|
46414
46671
|
}
|
|
46415
|
-
throw new TypeError(invalid_key_input_default(key3, ...types, "Uint8Array"));
|
|
46672
|
+
throw new TypeError(invalid_key_input_default(key3, ...types, "Uint8Array", "JSON Web Key"));
|
|
46416
46673
|
}
|
|
46417
46674
|
|
|
46418
|
-
// ../node_modules/jose/dist/browser/runtime/verify.js
|
|
46675
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/verify.js
|
|
46419
46676
|
var verify = async (alg, key3, signature2, data2) => {
|
|
46420
46677
|
const cryptoKey = await getCryptoKey(alg, key3, "verify");
|
|
46421
46678
|
check_key_length_default(alg, cryptoKey);
|
|
46422
46679
|
const algorithm3 = subtleDsa(alg, cryptoKey.algorithm);
|
|
46423
46680
|
try {
|
|
46424
46681
|
return await webcrypto_default.subtle.verify(algorithm3, cryptoKey, signature2, data2);
|
|
46425
|
-
} catch
|
|
46682
|
+
} catch {
|
|
46426
46683
|
return false;
|
|
46427
46684
|
}
|
|
46428
46685
|
};
|
|
46429
46686
|
var verify_default = verify;
|
|
46430
46687
|
|
|
46431
|
-
// ../node_modules/jose/dist/browser/jws/flattened/verify.js
|
|
46688
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jws/flattened/verify.js
|
|
46432
46689
|
async function flattenedVerify(jws2, key3, options) {
|
|
46433
|
-
var _a;
|
|
46434
46690
|
if (!isObject(jws2)) {
|
|
46435
46691
|
throw new JWSInvalid("Flattened JWS must be an object");
|
|
46436
46692
|
}
|
|
@@ -46454,7 +46710,7 @@ var PodOS = (() => {
|
|
|
46454
46710
|
try {
|
|
46455
46711
|
const protectedHeader = decode(jws2.protected);
|
|
46456
46712
|
parsedProt = JSON.parse(decoder.decode(protectedHeader));
|
|
46457
|
-
} catch
|
|
46713
|
+
} catch {
|
|
46458
46714
|
throw new JWSInvalid("JWS Protected Header is invalid");
|
|
46459
46715
|
}
|
|
46460
46716
|
}
|
|
@@ -46465,7 +46721,7 @@ var PodOS = (() => {
|
|
|
46465
46721
|
...parsedProt,
|
|
46466
46722
|
...jws2.header
|
|
46467
46723
|
};
|
|
46468
|
-
const extensions = validate_crit_default(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options
|
|
46724
|
+
const extensions = validate_crit_default(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, parsedProt, joseHeader);
|
|
46469
46725
|
let b64 = true;
|
|
46470
46726
|
if (extensions.has("b64")) {
|
|
46471
46727
|
b64 = parsedProt.b64;
|
|
@@ -46479,7 +46735,7 @@ var PodOS = (() => {
|
|
|
46479
46735
|
}
|
|
46480
46736
|
const algorithms = options && validate_algorithms_default("algorithms", options.algorithms);
|
|
46481
46737
|
if (algorithms && !algorithms.has(alg)) {
|
|
46482
|
-
throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter not allowed');
|
|
46738
|
+
throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');
|
|
46483
46739
|
}
|
|
46484
46740
|
if (b64) {
|
|
46485
46741
|
if (typeof jws2.payload !== "string") {
|
|
@@ -46492,13 +46748,18 @@ var PodOS = (() => {
|
|
|
46492
46748
|
if (typeof key3 === "function") {
|
|
46493
46749
|
key3 = await key3(parsedProt, jws2);
|
|
46494
46750
|
resolvedKey = true;
|
|
46751
|
+
checkKeyTypeWithJwk(alg, key3, "verify");
|
|
46752
|
+
if (isJWK(key3)) {
|
|
46753
|
+
key3 = await importJWK(key3, alg);
|
|
46754
|
+
}
|
|
46755
|
+
} else {
|
|
46756
|
+
checkKeyTypeWithJwk(alg, key3, "verify");
|
|
46495
46757
|
}
|
|
46496
|
-
|
|
46497
|
-
const data2 = concat(encoder.encode((_a = jws2.protected) !== null && _a !== void 0 ? _a : ""), encoder.encode("."), typeof jws2.payload === "string" ? encoder.encode(jws2.payload) : jws2.payload);
|
|
46758
|
+
const data2 = concat(encoder.encode(jws2.protected ?? ""), encoder.encode("."), typeof jws2.payload === "string" ? encoder.encode(jws2.payload) : jws2.payload);
|
|
46498
46759
|
let signature2;
|
|
46499
46760
|
try {
|
|
46500
46761
|
signature2 = decode(jws2.signature);
|
|
46501
|
-
} catch
|
|
46762
|
+
} catch {
|
|
46502
46763
|
throw new JWSInvalid("Failed to base64url decode the signature");
|
|
46503
46764
|
}
|
|
46504
46765
|
const verified2 = await verify_default(alg, key3, signature2, data2);
|
|
@@ -46509,7 +46770,7 @@ var PodOS = (() => {
|
|
|
46509
46770
|
if (b64) {
|
|
46510
46771
|
try {
|
|
46511
46772
|
payload4 = decode(jws2.payload);
|
|
46512
|
-
} catch
|
|
46773
|
+
} catch {
|
|
46513
46774
|
throw new JWSInvalid("Failed to base64url decode the payload");
|
|
46514
46775
|
}
|
|
46515
46776
|
} else if (typeof jws2.payload === "string") {
|
|
@@ -46530,7 +46791,7 @@ var PodOS = (() => {
|
|
|
46530
46791
|
return result5;
|
|
46531
46792
|
}
|
|
46532
46793
|
|
|
46533
|
-
// ../node_modules/jose/dist/browser/jws/compact/verify.js
|
|
46794
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jws/compact/verify.js
|
|
46534
46795
|
async function compactVerify(jws2, key3, options) {
|
|
46535
46796
|
if (jws2 instanceof Uint8Array) {
|
|
46536
46797
|
jws2 = decoder.decode(jws2);
|
|
@@ -46550,56 +46811,67 @@ var PodOS = (() => {
|
|
|
46550
46811
|
return result5;
|
|
46551
46812
|
}
|
|
46552
46813
|
|
|
46553
|
-
// ../node_modules/jose/dist/browser/lib/epoch.js
|
|
46814
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/epoch.js
|
|
46554
46815
|
var epoch_default = (date5) => Math.floor(date5.getTime() / 1e3);
|
|
46555
46816
|
|
|
46556
|
-
// ../node_modules/jose/dist/browser/lib/secs.js
|
|
46817
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/secs.js
|
|
46557
46818
|
var minute = 60;
|
|
46558
46819
|
var hour = minute * 60;
|
|
46559
46820
|
var day = hour * 24;
|
|
46560
46821
|
var week = day * 7;
|
|
46561
46822
|
var year = day * 365.25;
|
|
46562
|
-
var REGEX = /^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)
|
|
46823
|
+
var REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;
|
|
46563
46824
|
var secs_default = (str) => {
|
|
46564
46825
|
const matched = REGEX.exec(str);
|
|
46565
|
-
if (!matched) {
|
|
46826
|
+
if (!matched || matched[4] && matched[1]) {
|
|
46566
46827
|
throw new TypeError("Invalid time period format");
|
|
46567
46828
|
}
|
|
46568
|
-
const value6 = parseFloat(matched[
|
|
46569
|
-
const unit2 = matched[
|
|
46829
|
+
const value6 = parseFloat(matched[2]);
|
|
46830
|
+
const unit2 = matched[3].toLowerCase();
|
|
46831
|
+
let numericDate;
|
|
46570
46832
|
switch (unit2) {
|
|
46571
46833
|
case "sec":
|
|
46572
46834
|
case "secs":
|
|
46573
46835
|
case "second":
|
|
46574
46836
|
case "seconds":
|
|
46575
46837
|
case "s":
|
|
46576
|
-
|
|
46838
|
+
numericDate = Math.round(value6);
|
|
46839
|
+
break;
|
|
46577
46840
|
case "minute":
|
|
46578
46841
|
case "minutes":
|
|
46579
46842
|
case "min":
|
|
46580
46843
|
case "mins":
|
|
46581
46844
|
case "m":
|
|
46582
|
-
|
|
46845
|
+
numericDate = Math.round(value6 * minute);
|
|
46846
|
+
break;
|
|
46583
46847
|
case "hour":
|
|
46584
46848
|
case "hours":
|
|
46585
46849
|
case "hr":
|
|
46586
46850
|
case "hrs":
|
|
46587
46851
|
case "h":
|
|
46588
|
-
|
|
46852
|
+
numericDate = Math.round(value6 * hour);
|
|
46853
|
+
break;
|
|
46589
46854
|
case "day":
|
|
46590
46855
|
case "days":
|
|
46591
46856
|
case "d":
|
|
46592
|
-
|
|
46857
|
+
numericDate = Math.round(value6 * day);
|
|
46858
|
+
break;
|
|
46593
46859
|
case "week":
|
|
46594
46860
|
case "weeks":
|
|
46595
46861
|
case "w":
|
|
46596
|
-
|
|
46862
|
+
numericDate = Math.round(value6 * week);
|
|
46863
|
+
break;
|
|
46597
46864
|
default:
|
|
46598
|
-
|
|
46865
|
+
numericDate = Math.round(value6 * year);
|
|
46866
|
+
break;
|
|
46867
|
+
}
|
|
46868
|
+
if (matched[1] === "-" || matched[4] === "ago") {
|
|
46869
|
+
return -numericDate;
|
|
46599
46870
|
}
|
|
46871
|
+
return numericDate;
|
|
46600
46872
|
};
|
|
46601
46873
|
|
|
46602
|
-
// ../node_modules/jose/dist/browser/lib/jwt_claims_set.js
|
|
46874
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/jwt_claims_set.js
|
|
46603
46875
|
var normalizeTyp = (value6) => value6.toLowerCase().replace(/^application\//, "");
|
|
46604
46876
|
var checkAudiencePresence = (audPayload, audOption) => {
|
|
46605
46877
|
if (typeof audPayload === "string") {
|
|
@@ -46611,40 +46883,41 @@ var PodOS = (() => {
|
|
|
46611
46883
|
return false;
|
|
46612
46884
|
};
|
|
46613
46885
|
var jwt_claims_set_default = (protectedHeader, encodedPayload, options = {}) => {
|
|
46614
|
-
const { typ } = options;
|
|
46615
|
-
if (typ && (typeof protectedHeader.typ !== "string" || normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) {
|
|
46616
|
-
throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', "typ", "check_failed");
|
|
46617
|
-
}
|
|
46618
46886
|
let payload4;
|
|
46619
46887
|
try {
|
|
46620
46888
|
payload4 = JSON.parse(decoder.decode(encodedPayload));
|
|
46621
|
-
} catch
|
|
46889
|
+
} catch {
|
|
46622
46890
|
}
|
|
46623
46891
|
if (!isObject(payload4)) {
|
|
46624
46892
|
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
46625
46893
|
}
|
|
46894
|
+
const { typ } = options;
|
|
46895
|
+
if (typ && (typeof protectedHeader.typ !== "string" || normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ))) {
|
|
46896
|
+
throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', payload4, "typ", "check_failed");
|
|
46897
|
+
}
|
|
46626
46898
|
const { requiredClaims = [], issuer: issuer2, subject: subject5, audience: audience5, maxTokenAge } = options;
|
|
46899
|
+
const presenceCheck = [...requiredClaims];
|
|
46627
46900
|
if (maxTokenAge !== void 0)
|
|
46628
|
-
|
|
46901
|
+
presenceCheck.push("iat");
|
|
46629
46902
|
if (audience5 !== void 0)
|
|
46630
|
-
|
|
46903
|
+
presenceCheck.push("aud");
|
|
46631
46904
|
if (subject5 !== void 0)
|
|
46632
|
-
|
|
46905
|
+
presenceCheck.push("sub");
|
|
46633
46906
|
if (issuer2 !== void 0)
|
|
46634
|
-
|
|
46635
|
-
for (const claim2 of new Set(
|
|
46907
|
+
presenceCheck.push("iss");
|
|
46908
|
+
for (const claim2 of new Set(presenceCheck.reverse())) {
|
|
46636
46909
|
if (!(claim2 in payload4)) {
|
|
46637
|
-
throw new JWTClaimValidationFailed(`missing required "${claim2}" claim`, claim2, "missing");
|
|
46910
|
+
throw new JWTClaimValidationFailed(`missing required "${claim2}" claim`, payload4, claim2, "missing");
|
|
46638
46911
|
}
|
|
46639
46912
|
}
|
|
46640
46913
|
if (issuer2 && !(Array.isArray(issuer2) ? issuer2 : [issuer2]).includes(payload4.iss)) {
|
|
46641
|
-
throw new JWTClaimValidationFailed('unexpected "iss" claim value', "iss", "check_failed");
|
|
46914
|
+
throw new JWTClaimValidationFailed('unexpected "iss" claim value', payload4, "iss", "check_failed");
|
|
46642
46915
|
}
|
|
46643
46916
|
if (subject5 && payload4.sub !== subject5) {
|
|
46644
|
-
throw new JWTClaimValidationFailed('unexpected "sub" claim value', "sub", "check_failed");
|
|
46917
|
+
throw new JWTClaimValidationFailed('unexpected "sub" claim value', payload4, "sub", "check_failed");
|
|
46645
46918
|
}
|
|
46646
46919
|
if (audience5 && !checkAudiencePresence(payload4.aud, typeof audience5 === "string" ? [audience5] : audience5)) {
|
|
46647
|
-
throw new JWTClaimValidationFailed('unexpected "aud" claim value', "aud", "check_failed");
|
|
46920
|
+
throw new JWTClaimValidationFailed('unexpected "aud" claim value', payload4, "aud", "check_failed");
|
|
46648
46921
|
}
|
|
46649
46922
|
let tolerance;
|
|
46650
46923
|
switch (typeof options.clockTolerance) {
|
|
@@ -46663,42 +46936,41 @@ var PodOS = (() => {
|
|
|
46663
46936
|
const { currentDate } = options;
|
|
46664
46937
|
const now = epoch_default(currentDate || /* @__PURE__ */ new Date());
|
|
46665
46938
|
if ((payload4.iat !== void 0 || maxTokenAge) && typeof payload4.iat !== "number") {
|
|
46666
|
-
throw new JWTClaimValidationFailed('"iat" claim must be a number', "iat", "invalid");
|
|
46939
|
+
throw new JWTClaimValidationFailed('"iat" claim must be a number', payload4, "iat", "invalid");
|
|
46667
46940
|
}
|
|
46668
46941
|
if (payload4.nbf !== void 0) {
|
|
46669
46942
|
if (typeof payload4.nbf !== "number") {
|
|
46670
|
-
throw new JWTClaimValidationFailed('"nbf" claim must be a number', "nbf", "invalid");
|
|
46943
|
+
throw new JWTClaimValidationFailed('"nbf" claim must be a number', payload4, "nbf", "invalid");
|
|
46671
46944
|
}
|
|
46672
46945
|
if (payload4.nbf > now + tolerance) {
|
|
46673
|
-
throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', "nbf", "check_failed");
|
|
46946
|
+
throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload4, "nbf", "check_failed");
|
|
46674
46947
|
}
|
|
46675
46948
|
}
|
|
46676
46949
|
if (payload4.exp !== void 0) {
|
|
46677
46950
|
if (typeof payload4.exp !== "number") {
|
|
46678
|
-
throw new JWTClaimValidationFailed('"exp" claim must be a number', "exp", "invalid");
|
|
46951
|
+
throw new JWTClaimValidationFailed('"exp" claim must be a number', payload4, "exp", "invalid");
|
|
46679
46952
|
}
|
|
46680
46953
|
if (payload4.exp <= now - tolerance) {
|
|
46681
|
-
throw new JWTExpired('"exp" claim timestamp check failed', "exp", "check_failed");
|
|
46954
|
+
throw new JWTExpired('"exp" claim timestamp check failed', payload4, "exp", "check_failed");
|
|
46682
46955
|
}
|
|
46683
46956
|
}
|
|
46684
46957
|
if (maxTokenAge) {
|
|
46685
46958
|
const age2 = now - payload4.iat;
|
|
46686
46959
|
const max2 = typeof maxTokenAge === "number" ? maxTokenAge : secs_default(maxTokenAge);
|
|
46687
46960
|
if (age2 - tolerance > max2) {
|
|
46688
|
-
throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', "iat", "check_failed");
|
|
46961
|
+
throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload4, "iat", "check_failed");
|
|
46689
46962
|
}
|
|
46690
46963
|
if (age2 < 0 - tolerance) {
|
|
46691
|
-
throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', "iat", "check_failed");
|
|
46964
|
+
throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload4, "iat", "check_failed");
|
|
46692
46965
|
}
|
|
46693
46966
|
}
|
|
46694
46967
|
return payload4;
|
|
46695
46968
|
};
|
|
46696
46969
|
|
|
46697
|
-
// ../node_modules/jose/dist/browser/jwt/verify.js
|
|
46970
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jwt/verify.js
|
|
46698
46971
|
async function jwtVerify(jwt, key3, options) {
|
|
46699
|
-
var _a;
|
|
46700
46972
|
const verified2 = await compactVerify(jwt, key3, options);
|
|
46701
|
-
if (
|
|
46973
|
+
if (verified2.protectedHeader.crit?.includes("b64") && verified2.protectedHeader.b64 === false) {
|
|
46702
46974
|
throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
46703
46975
|
}
|
|
46704
46976
|
const payload4 = jwt_claims_set_default(verified2.protectedHeader, verified2.payload, options);
|
|
@@ -46709,7 +46981,7 @@ var PodOS = (() => {
|
|
|
46709
46981
|
return result5;
|
|
46710
46982
|
}
|
|
46711
46983
|
|
|
46712
|
-
// ../node_modules/jose/dist/browser/runtime/sign.js
|
|
46984
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/sign.js
|
|
46713
46985
|
var sign = async (alg, key3, data2) => {
|
|
46714
46986
|
const cryptoKey = await getCryptoKey(alg, key3, "sign");
|
|
46715
46987
|
check_key_length_default(alg, cryptoKey);
|
|
@@ -46718,7 +46990,7 @@ var PodOS = (() => {
|
|
|
46718
46990
|
};
|
|
46719
46991
|
var sign_default = sign;
|
|
46720
46992
|
|
|
46721
|
-
// ../node_modules/jose/dist/browser/jws/flattened/sign.js
|
|
46993
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jws/flattened/sign.js
|
|
46722
46994
|
var FlattenedSign = class {
|
|
46723
46995
|
constructor(payload4) {
|
|
46724
46996
|
if (!(payload4 instanceof Uint8Array)) {
|
|
@@ -46751,7 +47023,7 @@ var PodOS = (() => {
|
|
|
46751
47023
|
...this._protectedHeader,
|
|
46752
47024
|
...this._unprotectedHeader
|
|
46753
47025
|
};
|
|
46754
|
-
const extensions = validate_crit_default(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options
|
|
47026
|
+
const extensions = validate_crit_default(JWSInvalid, /* @__PURE__ */ new Map([["b64", true]]), options?.crit, this._protectedHeader, joseHeader);
|
|
46755
47027
|
let b64 = true;
|
|
46756
47028
|
if (extensions.has("b64")) {
|
|
46757
47029
|
b64 = this._protectedHeader.b64;
|
|
@@ -46763,7 +47035,7 @@ var PodOS = (() => {
|
|
|
46763
47035
|
if (typeof alg !== "string" || !alg) {
|
|
46764
47036
|
throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
46765
47037
|
}
|
|
46766
|
-
|
|
47038
|
+
checkKeyTypeWithJwk(alg, key3, "sign");
|
|
46767
47039
|
let payload4 = this._payload;
|
|
46768
47040
|
if (b64) {
|
|
46769
47041
|
payload4 = encoder.encode(encode(payload4));
|
|
@@ -46793,7 +47065,7 @@ var PodOS = (() => {
|
|
|
46793
47065
|
}
|
|
46794
47066
|
};
|
|
46795
47067
|
|
|
46796
|
-
// ../node_modules/jose/dist/browser/jws/compact/sign.js
|
|
47068
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jws/compact/sign.js
|
|
46797
47069
|
var CompactSign = class {
|
|
46798
47070
|
constructor(payload4) {
|
|
46799
47071
|
this._flattened = new FlattenedSign(payload4);
|
|
@@ -46811,9 +47083,15 @@ var PodOS = (() => {
|
|
|
46811
47083
|
}
|
|
46812
47084
|
};
|
|
46813
47085
|
|
|
46814
|
-
// ../node_modules/jose/dist/browser/jwt/produce.js
|
|
47086
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jwt/produce.js
|
|
47087
|
+
function validateInput(label4, input2) {
|
|
47088
|
+
if (!Number.isFinite(input2)) {
|
|
47089
|
+
throw new TypeError(`Invalid ${label4} input`);
|
|
47090
|
+
}
|
|
47091
|
+
return input2;
|
|
47092
|
+
}
|
|
46815
47093
|
var ProduceJWT = class {
|
|
46816
|
-
constructor(payload4) {
|
|
47094
|
+
constructor(payload4 = {}) {
|
|
46817
47095
|
if (!isObject(payload4)) {
|
|
46818
47096
|
throw new TypeError("JWT Claims Set MUST be an object");
|
|
46819
47097
|
}
|
|
@@ -46837,7 +47115,9 @@ var PodOS = (() => {
|
|
|
46837
47115
|
}
|
|
46838
47116
|
setNotBefore(input2) {
|
|
46839
47117
|
if (typeof input2 === "number") {
|
|
46840
|
-
this._payload = { ...this._payload, nbf: input2 };
|
|
47118
|
+
this._payload = { ...this._payload, nbf: validateInput("setNotBefore", input2) };
|
|
47119
|
+
} else if (input2 instanceof Date) {
|
|
47120
|
+
this._payload = { ...this._payload, nbf: validateInput("setNotBefore", epoch_default(input2)) };
|
|
46841
47121
|
} else {
|
|
46842
47122
|
this._payload = { ...this._payload, nbf: epoch_default(/* @__PURE__ */ new Date()) + secs_default(input2) };
|
|
46843
47123
|
}
|
|
@@ -46845,7 +47125,9 @@ var PodOS = (() => {
|
|
|
46845
47125
|
}
|
|
46846
47126
|
setExpirationTime(input2) {
|
|
46847
47127
|
if (typeof input2 === "number") {
|
|
46848
|
-
this._payload = { ...this._payload, exp: input2 };
|
|
47128
|
+
this._payload = { ...this._payload, exp: validateInput("setExpirationTime", input2) };
|
|
47129
|
+
} else if (input2 instanceof Date) {
|
|
47130
|
+
this._payload = { ...this._payload, exp: validateInput("setExpirationTime", epoch_default(input2)) };
|
|
46849
47131
|
} else {
|
|
46850
47132
|
this._payload = { ...this._payload, exp: epoch_default(/* @__PURE__ */ new Date()) + secs_default(input2) };
|
|
46851
47133
|
}
|
|
@@ -46854,41 +47136,318 @@ var PodOS = (() => {
|
|
|
46854
47136
|
setIssuedAt(input2) {
|
|
46855
47137
|
if (typeof input2 === "undefined") {
|
|
46856
47138
|
this._payload = { ...this._payload, iat: epoch_default(/* @__PURE__ */ new Date()) };
|
|
47139
|
+
} else if (input2 instanceof Date) {
|
|
47140
|
+
this._payload = { ...this._payload, iat: validateInput("setIssuedAt", epoch_default(input2)) };
|
|
47141
|
+
} else if (typeof input2 === "string") {
|
|
47142
|
+
this._payload = {
|
|
47143
|
+
...this._payload,
|
|
47144
|
+
iat: validateInput("setIssuedAt", epoch_default(/* @__PURE__ */ new Date()) + secs_default(input2))
|
|
47145
|
+
};
|
|
46857
47146
|
} else {
|
|
46858
|
-
this._payload = { ...this._payload, iat: input2 };
|
|
47147
|
+
this._payload = { ...this._payload, iat: validateInput("setIssuedAt", input2) };
|
|
46859
47148
|
}
|
|
46860
47149
|
return this;
|
|
46861
47150
|
}
|
|
46862
47151
|
};
|
|
46863
47152
|
|
|
46864
|
-
// ../node_modules/jose/dist/browser/jwt/sign.js
|
|
47153
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jwt/sign.js
|
|
46865
47154
|
var SignJWT = class extends ProduceJWT {
|
|
46866
47155
|
setProtectedHeader(protectedHeader) {
|
|
46867
47156
|
this._protectedHeader = protectedHeader;
|
|
46868
47157
|
return this;
|
|
46869
47158
|
}
|
|
46870
47159
|
async sign(key3, options) {
|
|
46871
|
-
var _a;
|
|
46872
47160
|
const sig = new CompactSign(encoder.encode(JSON.stringify(this._payload)));
|
|
46873
47161
|
sig.setProtectedHeader(this._protectedHeader);
|
|
46874
|
-
if (Array.isArray(
|
|
47162
|
+
if (Array.isArray(this._protectedHeader?.crit) && this._protectedHeader.crit.includes("b64") && this._protectedHeader.b64 === false) {
|
|
46875
47163
|
throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
46876
47164
|
}
|
|
46877
47165
|
return sig.sign(key3, options);
|
|
46878
47166
|
}
|
|
46879
47167
|
};
|
|
46880
47168
|
|
|
46881
|
-
// ../node_modules/jose/dist/browser/
|
|
47169
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jwks/local.js
|
|
47170
|
+
function getKtyFromAlg(alg) {
|
|
47171
|
+
switch (typeof alg === "string" && alg.slice(0, 2)) {
|
|
47172
|
+
case "RS":
|
|
47173
|
+
case "PS":
|
|
47174
|
+
return "RSA";
|
|
47175
|
+
case "ES":
|
|
47176
|
+
return "EC";
|
|
47177
|
+
case "Ed":
|
|
47178
|
+
return "OKP";
|
|
47179
|
+
default:
|
|
47180
|
+
throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set');
|
|
47181
|
+
}
|
|
47182
|
+
}
|
|
47183
|
+
function isJWKSLike(jwks) {
|
|
47184
|
+
return jwks && typeof jwks === "object" && Array.isArray(jwks.keys) && jwks.keys.every(isJWKLike);
|
|
47185
|
+
}
|
|
47186
|
+
function isJWKLike(key3) {
|
|
47187
|
+
return isObject(key3);
|
|
47188
|
+
}
|
|
47189
|
+
function clone(obj) {
|
|
47190
|
+
if (typeof structuredClone === "function") {
|
|
47191
|
+
return structuredClone(obj);
|
|
47192
|
+
}
|
|
47193
|
+
return JSON.parse(JSON.stringify(obj));
|
|
47194
|
+
}
|
|
47195
|
+
var LocalJWKSet = class {
|
|
47196
|
+
constructor(jwks) {
|
|
47197
|
+
this._cached = /* @__PURE__ */ new WeakMap();
|
|
47198
|
+
if (!isJWKSLike(jwks)) {
|
|
47199
|
+
throw new JWKSInvalid("JSON Web Key Set malformed");
|
|
47200
|
+
}
|
|
47201
|
+
this._jwks = clone(jwks);
|
|
47202
|
+
}
|
|
47203
|
+
async getKey(protectedHeader, token) {
|
|
47204
|
+
const { alg, kid } = { ...protectedHeader, ...token?.header };
|
|
47205
|
+
const kty = getKtyFromAlg(alg);
|
|
47206
|
+
const candidates = this._jwks.keys.filter((jwk2) => {
|
|
47207
|
+
let candidate4 = kty === jwk2.kty;
|
|
47208
|
+
if (candidate4 && typeof kid === "string") {
|
|
47209
|
+
candidate4 = kid === jwk2.kid;
|
|
47210
|
+
}
|
|
47211
|
+
if (candidate4 && typeof jwk2.alg === "string") {
|
|
47212
|
+
candidate4 = alg === jwk2.alg;
|
|
47213
|
+
}
|
|
47214
|
+
if (candidate4 && typeof jwk2.use === "string") {
|
|
47215
|
+
candidate4 = jwk2.use === "sig";
|
|
47216
|
+
}
|
|
47217
|
+
if (candidate4 && Array.isArray(jwk2.key_ops)) {
|
|
47218
|
+
candidate4 = jwk2.key_ops.includes("verify");
|
|
47219
|
+
}
|
|
47220
|
+
if (candidate4 && alg === "EdDSA") {
|
|
47221
|
+
candidate4 = jwk2.crv === "Ed25519" || jwk2.crv === "Ed448";
|
|
47222
|
+
}
|
|
47223
|
+
if (candidate4) {
|
|
47224
|
+
switch (alg) {
|
|
47225
|
+
case "ES256":
|
|
47226
|
+
candidate4 = jwk2.crv === "P-256";
|
|
47227
|
+
break;
|
|
47228
|
+
case "ES256K":
|
|
47229
|
+
candidate4 = jwk2.crv === "secp256k1";
|
|
47230
|
+
break;
|
|
47231
|
+
case "ES384":
|
|
47232
|
+
candidate4 = jwk2.crv === "P-384";
|
|
47233
|
+
break;
|
|
47234
|
+
case "ES512":
|
|
47235
|
+
candidate4 = jwk2.crv === "P-521";
|
|
47236
|
+
break;
|
|
47237
|
+
}
|
|
47238
|
+
}
|
|
47239
|
+
return candidate4;
|
|
47240
|
+
});
|
|
47241
|
+
const { 0: jwk, length: length2 } = candidates;
|
|
47242
|
+
if (length2 === 0) {
|
|
47243
|
+
throw new JWKSNoMatchingKey();
|
|
47244
|
+
}
|
|
47245
|
+
if (length2 !== 1) {
|
|
47246
|
+
const error5 = new JWKSMultipleMatchingKeys();
|
|
47247
|
+
const { _cached } = this;
|
|
47248
|
+
error5[Symbol.asyncIterator] = async function* () {
|
|
47249
|
+
for (const jwk2 of candidates) {
|
|
47250
|
+
try {
|
|
47251
|
+
yield await importWithAlgCache(_cached, jwk2, alg);
|
|
47252
|
+
} catch {
|
|
47253
|
+
}
|
|
47254
|
+
}
|
|
47255
|
+
};
|
|
47256
|
+
throw error5;
|
|
47257
|
+
}
|
|
47258
|
+
return importWithAlgCache(this._cached, jwk, alg);
|
|
47259
|
+
}
|
|
47260
|
+
};
|
|
47261
|
+
async function importWithAlgCache(cache, jwk, alg) {
|
|
47262
|
+
const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk);
|
|
47263
|
+
if (cached[alg] === void 0) {
|
|
47264
|
+
const key3 = await importJWK({ ...jwk, ext: true }, alg);
|
|
47265
|
+
if (key3 instanceof Uint8Array || key3.type !== "public") {
|
|
47266
|
+
throw new JWKSInvalid("JSON Web Key Set members must be public keys");
|
|
47267
|
+
}
|
|
47268
|
+
cached[alg] = key3;
|
|
47269
|
+
}
|
|
47270
|
+
return cached[alg];
|
|
47271
|
+
}
|
|
47272
|
+
function createLocalJWKSet(jwks) {
|
|
47273
|
+
const set = new LocalJWKSet(jwks);
|
|
47274
|
+
const localJWKSet = async (protectedHeader, token) => set.getKey(protectedHeader, token);
|
|
47275
|
+
Object.defineProperties(localJWKSet, {
|
|
47276
|
+
jwks: {
|
|
47277
|
+
value: () => clone(set._jwks),
|
|
47278
|
+
enumerable: true,
|
|
47279
|
+
configurable: false,
|
|
47280
|
+
writable: false
|
|
47281
|
+
}
|
|
47282
|
+
});
|
|
47283
|
+
return localJWKSet;
|
|
47284
|
+
}
|
|
47285
|
+
|
|
47286
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/fetch_jwks.js
|
|
47287
|
+
var fetchJwks = async (url7, timeout2, options) => {
|
|
47288
|
+
let controller2;
|
|
47289
|
+
let id6;
|
|
47290
|
+
let timedOut = false;
|
|
47291
|
+
if (typeof AbortController === "function") {
|
|
47292
|
+
controller2 = new AbortController();
|
|
47293
|
+
id6 = setTimeout(() => {
|
|
47294
|
+
timedOut = true;
|
|
47295
|
+
controller2.abort();
|
|
47296
|
+
}, timeout2);
|
|
47297
|
+
}
|
|
47298
|
+
const response6 = await fetch(url7.href, {
|
|
47299
|
+
signal: controller2 ? controller2.signal : void 0,
|
|
47300
|
+
redirect: "manual",
|
|
47301
|
+
headers: options.headers
|
|
47302
|
+
}).catch((err) => {
|
|
47303
|
+
if (timedOut)
|
|
47304
|
+
throw new JWKSTimeout();
|
|
47305
|
+
throw err;
|
|
47306
|
+
});
|
|
47307
|
+
if (id6 !== void 0)
|
|
47308
|
+
clearTimeout(id6);
|
|
47309
|
+
if (response6.status !== 200) {
|
|
47310
|
+
throw new JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");
|
|
47311
|
+
}
|
|
47312
|
+
try {
|
|
47313
|
+
return await response6.json();
|
|
47314
|
+
} catch {
|
|
47315
|
+
throw new JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON");
|
|
47316
|
+
}
|
|
47317
|
+
};
|
|
47318
|
+
var fetch_jwks_default = fetchJwks;
|
|
47319
|
+
|
|
47320
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/jwks/remote.js
|
|
47321
|
+
function isCloudflareWorkers() {
|
|
47322
|
+
return typeof WebSocketPair !== "undefined" || typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime !== "undefined" && EdgeRuntime === "vercel";
|
|
47323
|
+
}
|
|
47324
|
+
var USER_AGENT;
|
|
47325
|
+
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) {
|
|
47326
|
+
const NAME = "jose";
|
|
47327
|
+
const VERSION = "v5.9.3";
|
|
47328
|
+
USER_AGENT = `${NAME}/${VERSION}`;
|
|
47329
|
+
}
|
|
47330
|
+
var jwksCache = Symbol();
|
|
47331
|
+
function isFreshJwksCache(input2, cacheMaxAge) {
|
|
47332
|
+
if (typeof input2 !== "object" || input2 === null) {
|
|
47333
|
+
return false;
|
|
47334
|
+
}
|
|
47335
|
+
if (!("uat" in input2) || typeof input2.uat !== "number" || Date.now() - input2.uat >= cacheMaxAge) {
|
|
47336
|
+
return false;
|
|
47337
|
+
}
|
|
47338
|
+
if (!("jwks" in input2) || !isObject(input2.jwks) || !Array.isArray(input2.jwks.keys) || !Array.prototype.every.call(input2.jwks.keys, isObject)) {
|
|
47339
|
+
return false;
|
|
47340
|
+
}
|
|
47341
|
+
return true;
|
|
47342
|
+
}
|
|
47343
|
+
var RemoteJWKSet = class {
|
|
47344
|
+
constructor(url7, options) {
|
|
47345
|
+
if (!(url7 instanceof URL)) {
|
|
47346
|
+
throw new TypeError("url must be an instance of URL");
|
|
47347
|
+
}
|
|
47348
|
+
this._url = new URL(url7.href);
|
|
47349
|
+
this._options = { agent: options?.agent, headers: options?.headers };
|
|
47350
|
+
this._timeoutDuration = typeof options?.timeoutDuration === "number" ? options?.timeoutDuration : 5e3;
|
|
47351
|
+
this._cooldownDuration = typeof options?.cooldownDuration === "number" ? options?.cooldownDuration : 3e4;
|
|
47352
|
+
this._cacheMaxAge = typeof options?.cacheMaxAge === "number" ? options?.cacheMaxAge : 6e5;
|
|
47353
|
+
if (options?.[jwksCache] !== void 0) {
|
|
47354
|
+
this._cache = options?.[jwksCache];
|
|
47355
|
+
if (isFreshJwksCache(options?.[jwksCache], this._cacheMaxAge)) {
|
|
47356
|
+
this._jwksTimestamp = this._cache.uat;
|
|
47357
|
+
this._local = createLocalJWKSet(this._cache.jwks);
|
|
47358
|
+
}
|
|
47359
|
+
}
|
|
47360
|
+
}
|
|
47361
|
+
coolingDown() {
|
|
47362
|
+
return typeof this._jwksTimestamp === "number" ? Date.now() < this._jwksTimestamp + this._cooldownDuration : false;
|
|
47363
|
+
}
|
|
47364
|
+
fresh() {
|
|
47365
|
+
return typeof this._jwksTimestamp === "number" ? Date.now() < this._jwksTimestamp + this._cacheMaxAge : false;
|
|
47366
|
+
}
|
|
47367
|
+
async getKey(protectedHeader, token) {
|
|
47368
|
+
if (!this._local || !this.fresh()) {
|
|
47369
|
+
await this.reload();
|
|
47370
|
+
}
|
|
47371
|
+
try {
|
|
47372
|
+
return await this._local(protectedHeader, token);
|
|
47373
|
+
} catch (err) {
|
|
47374
|
+
if (err instanceof JWKSNoMatchingKey) {
|
|
47375
|
+
if (this.coolingDown() === false) {
|
|
47376
|
+
await this.reload();
|
|
47377
|
+
return this._local(protectedHeader, token);
|
|
47378
|
+
}
|
|
47379
|
+
}
|
|
47380
|
+
throw err;
|
|
47381
|
+
}
|
|
47382
|
+
}
|
|
47383
|
+
async reload() {
|
|
47384
|
+
if (this._pendingFetch && isCloudflareWorkers()) {
|
|
47385
|
+
this._pendingFetch = void 0;
|
|
47386
|
+
}
|
|
47387
|
+
const headers = new Headers(this._options.headers);
|
|
47388
|
+
if (USER_AGENT && !headers.has("User-Agent")) {
|
|
47389
|
+
headers.set("User-Agent", USER_AGENT);
|
|
47390
|
+
this._options.headers = Object.fromEntries(headers.entries());
|
|
47391
|
+
}
|
|
47392
|
+
this._pendingFetch || (this._pendingFetch = fetch_jwks_default(this._url, this._timeoutDuration, this._options).then((json) => {
|
|
47393
|
+
this._local = createLocalJWKSet(json);
|
|
47394
|
+
if (this._cache) {
|
|
47395
|
+
this._cache.uat = Date.now();
|
|
47396
|
+
this._cache.jwks = json;
|
|
47397
|
+
}
|
|
47398
|
+
this._jwksTimestamp = Date.now();
|
|
47399
|
+
this._pendingFetch = void 0;
|
|
47400
|
+
}).catch((err) => {
|
|
47401
|
+
this._pendingFetch = void 0;
|
|
47402
|
+
throw err;
|
|
47403
|
+
}));
|
|
47404
|
+
await this._pendingFetch;
|
|
47405
|
+
}
|
|
47406
|
+
};
|
|
47407
|
+
function createRemoteJWKSet(url7, options) {
|
|
47408
|
+
const set = new RemoteJWKSet(url7, options);
|
|
47409
|
+
const remoteJWKSet = async (protectedHeader, token) => set.getKey(protectedHeader, token);
|
|
47410
|
+
Object.defineProperties(remoteJWKSet, {
|
|
47411
|
+
coolingDown: {
|
|
47412
|
+
get: () => set.coolingDown(),
|
|
47413
|
+
enumerable: true,
|
|
47414
|
+
configurable: false
|
|
47415
|
+
},
|
|
47416
|
+
fresh: {
|
|
47417
|
+
get: () => set.fresh(),
|
|
47418
|
+
enumerable: true,
|
|
47419
|
+
configurable: false
|
|
47420
|
+
},
|
|
47421
|
+
reload: {
|
|
47422
|
+
value: () => set.reload(),
|
|
47423
|
+
enumerable: true,
|
|
47424
|
+
configurable: false,
|
|
47425
|
+
writable: false
|
|
47426
|
+
},
|
|
47427
|
+
reloading: {
|
|
47428
|
+
get: () => !!set._pendingFetch,
|
|
47429
|
+
enumerable: true,
|
|
47430
|
+
configurable: false
|
|
47431
|
+
},
|
|
47432
|
+
jwks: {
|
|
47433
|
+
value: () => set._local?.jwks(),
|
|
47434
|
+
enumerable: true,
|
|
47435
|
+
configurable: false,
|
|
47436
|
+
writable: false
|
|
47437
|
+
}
|
|
47438
|
+
});
|
|
47439
|
+
return remoteJWKSet;
|
|
47440
|
+
}
|
|
47441
|
+
|
|
47442
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/runtime/generate.js
|
|
46882
47443
|
function getModulusLengthOption(options) {
|
|
46883
|
-
|
|
46884
|
-
const modulusLength = (_a = options === null || options === void 0 ? void 0 : options.modulusLength) !== null && _a !== void 0 ? _a : 2048;
|
|
47444
|
+
const modulusLength = options?.modulusLength ?? 2048;
|
|
46885
47445
|
if (typeof modulusLength !== "number" || modulusLength < 2048) {
|
|
46886
47446
|
throw new JOSENotSupported("Invalid or unsupported modulusLength option provided, 2048 bits or larger keys must be used");
|
|
46887
47447
|
}
|
|
46888
47448
|
return modulusLength;
|
|
46889
47449
|
}
|
|
46890
47450
|
async function generateKeyPair(alg, options) {
|
|
46891
|
-
var _a, _b, _c;
|
|
46892
47451
|
let algorithm3;
|
|
46893
47452
|
let keyUsages;
|
|
46894
47453
|
switch (alg) {
|
|
@@ -46938,9 +47497,9 @@ var PodOS = (() => {
|
|
|
46938
47497
|
algorithm3 = { name: "ECDSA", namedCurve: "P-521" };
|
|
46939
47498
|
keyUsages = ["sign", "verify"];
|
|
46940
47499
|
break;
|
|
46941
|
-
case "EdDSA":
|
|
47500
|
+
case "EdDSA": {
|
|
46942
47501
|
keyUsages = ["sign", "verify"];
|
|
46943
|
-
const crv =
|
|
47502
|
+
const crv = options?.crv ?? "Ed25519";
|
|
46944
47503
|
switch (crv) {
|
|
46945
47504
|
case "Ed25519":
|
|
46946
47505
|
case "Ed448":
|
|
@@ -46950,22 +47509,23 @@ var PodOS = (() => {
|
|
|
46950
47509
|
throw new JOSENotSupported("Invalid or unsupported crv option provided");
|
|
46951
47510
|
}
|
|
46952
47511
|
break;
|
|
47512
|
+
}
|
|
46953
47513
|
case "ECDH-ES":
|
|
46954
47514
|
case "ECDH-ES+A128KW":
|
|
46955
47515
|
case "ECDH-ES+A192KW":
|
|
46956
47516
|
case "ECDH-ES+A256KW": {
|
|
46957
47517
|
keyUsages = ["deriveKey", "deriveBits"];
|
|
46958
|
-
const
|
|
46959
|
-
switch (
|
|
47518
|
+
const crv = options?.crv ?? "P-256";
|
|
47519
|
+
switch (crv) {
|
|
46960
47520
|
case "P-256":
|
|
46961
47521
|
case "P-384":
|
|
46962
47522
|
case "P-521": {
|
|
46963
|
-
algorithm3 = { name: "ECDH", namedCurve:
|
|
47523
|
+
algorithm3 = { name: "ECDH", namedCurve: crv };
|
|
46964
47524
|
break;
|
|
46965
47525
|
}
|
|
46966
47526
|
case "X25519":
|
|
46967
47527
|
case "X448":
|
|
46968
|
-
algorithm3 = { name:
|
|
47528
|
+
algorithm3 = { name: crv };
|
|
46969
47529
|
break;
|
|
46970
47530
|
default:
|
|
46971
47531
|
throw new JOSENotSupported("Invalid or unsupported crv option provided, supported values are P-256, P-384, P-521, X25519, and X448");
|
|
@@ -46975,15 +47535,25 @@ var PodOS = (() => {
|
|
|
46975
47535
|
default:
|
|
46976
47536
|
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
46977
47537
|
}
|
|
46978
|
-
return webcrypto_default.subtle.generateKey(algorithm3,
|
|
47538
|
+
return webcrypto_default.subtle.generateKey(algorithm3, options?.extractable ?? false, keyUsages);
|
|
46979
47539
|
}
|
|
46980
47540
|
|
|
46981
|
-
// ../node_modules/jose/dist/browser/key/generate_key_pair.js
|
|
47541
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/key/generate_key_pair.js
|
|
46982
47542
|
async function generateKeyPair2(alg, options) {
|
|
46983
47543
|
return generateKeyPair(alg, options);
|
|
46984
47544
|
}
|
|
46985
47545
|
|
|
46986
|
-
// ../node_modules/uuid/dist/esm-browser/
|
|
47546
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/uuid/dist/esm-browser/stringify.js
|
|
47547
|
+
var byteToHex = [];
|
|
47548
|
+
for (i = 0; i < 256; ++i) {
|
|
47549
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
47550
|
+
}
|
|
47551
|
+
var i;
|
|
47552
|
+
function unsafeStringify(arr, offset3 = 0) {
|
|
47553
|
+
return (byteToHex[arr[offset3 + 0]] + byteToHex[arr[offset3 + 1]] + byteToHex[arr[offset3 + 2]] + byteToHex[arr[offset3 + 3]] + "-" + byteToHex[arr[offset3 + 4]] + byteToHex[arr[offset3 + 5]] + "-" + byteToHex[arr[offset3 + 6]] + byteToHex[arr[offset3 + 7]] + "-" + byteToHex[arr[offset3 + 8]] + byteToHex[arr[offset3 + 9]] + "-" + byteToHex[arr[offset3 + 10]] + byteToHex[arr[offset3 + 11]] + byteToHex[arr[offset3 + 12]] + byteToHex[arr[offset3 + 13]] + byteToHex[arr[offset3 + 14]] + byteToHex[arr[offset3 + 15]]).toLowerCase();
|
|
47554
|
+
}
|
|
47555
|
+
|
|
47556
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/uuid/dist/esm-browser/rng.js
|
|
46987
47557
|
var getRandomValues;
|
|
46988
47558
|
var rnds8 = new Uint8Array(16);
|
|
46989
47559
|
function rng() {
|
|
@@ -46996,33 +47566,24 @@ var PodOS = (() => {
|
|
|
46996
47566
|
return getRandomValues(rnds8);
|
|
46997
47567
|
}
|
|
46998
47568
|
|
|
46999
|
-
// ../node_modules/uuid/dist/esm-browser/
|
|
47000
|
-
var byteToHex = [];
|
|
47001
|
-
for (let i = 0; i < 256; ++i) {
|
|
47002
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
47003
|
-
}
|
|
47004
|
-
function unsafeStringify(arr, offset3 = 0) {
|
|
47005
|
-
return byteToHex[arr[offset3 + 0]] + byteToHex[arr[offset3 + 1]] + byteToHex[arr[offset3 + 2]] + byteToHex[arr[offset3 + 3]] + "-" + byteToHex[arr[offset3 + 4]] + byteToHex[arr[offset3 + 5]] + "-" + byteToHex[arr[offset3 + 6]] + byteToHex[arr[offset3 + 7]] + "-" + byteToHex[arr[offset3 + 8]] + byteToHex[arr[offset3 + 9]] + "-" + byteToHex[arr[offset3 + 10]] + byteToHex[arr[offset3 + 11]] + byteToHex[arr[offset3 + 12]] + byteToHex[arr[offset3 + 13]] + byteToHex[arr[offset3 + 14]] + byteToHex[arr[offset3 + 15]];
|
|
47006
|
-
}
|
|
47007
|
-
|
|
47008
|
-
// ../node_modules/uuid/dist/esm-browser/native.js
|
|
47569
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/uuid/dist/esm-browser/native.js
|
|
47009
47570
|
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
47010
47571
|
var native_default = {
|
|
47011
47572
|
randomUUID
|
|
47012
47573
|
};
|
|
47013
47574
|
|
|
47014
|
-
// ../node_modules/uuid/dist/esm-browser/v4.js
|
|
47575
|
+
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/uuid/dist/esm-browser/v4.js
|
|
47015
47576
|
function v4(options, buf, offset3) {
|
|
47016
47577
|
if (native_default.randomUUID && !buf && !options) {
|
|
47017
47578
|
return native_default.randomUUID();
|
|
47018
47579
|
}
|
|
47019
47580
|
options = options || {};
|
|
47020
|
-
|
|
47581
|
+
var rnds = options.random || (options.rng || rng)();
|
|
47021
47582
|
rnds[6] = rnds[6] & 15 | 64;
|
|
47022
47583
|
rnds[8] = rnds[8] & 63 | 128;
|
|
47023
47584
|
if (buf) {
|
|
47024
47585
|
offset3 = offset3 || 0;
|
|
47025
|
-
for (
|
|
47586
|
+
for (var i = 0; i < 16; ++i) {
|
|
47026
47587
|
buf[offset3 + i] = rnds[i];
|
|
47027
47588
|
}
|
|
47028
47589
|
return buf;
|
|
@@ -47050,17 +47611,6 @@ var PodOS = (() => {
|
|
|
47050
47611
|
var SCOPE_OFFLINE = "offline_access";
|
|
47051
47612
|
var SCOPE_WEBID = "webid";
|
|
47052
47613
|
var DEFAULT_SCOPES = [SCOPE_OPENID, SCOPE_OFFLINE, SCOPE_WEBID].join(" ");
|
|
47053
|
-
var buildProxyHandler = (toExclude, errorMessage) => ({
|
|
47054
|
-
// This proxy is only a temporary measure until Session no longer extends
|
|
47055
|
-
// SessionEventEmitter, and the proxying is no longer necessary.
|
|
47056
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47057
|
-
get(target5, prop, receiver2) {
|
|
47058
|
-
if (!Object.getOwnPropertyNames(import_events.EventEmitter).includes(prop) && Object.getOwnPropertyNames(toExclude).includes(prop)) {
|
|
47059
|
-
throw new Error(`${errorMessage}: [${prop}] is not supported`);
|
|
47060
|
-
}
|
|
47061
|
-
return Reflect.get(target5, prop, receiver2);
|
|
47062
|
-
}
|
|
47063
|
-
});
|
|
47064
47614
|
var AggregateHandler = class {
|
|
47065
47615
|
constructor(handleables) {
|
|
47066
47616
|
this.handleables = handleables;
|
|
@@ -47097,24 +47647,11 @@ var PodOS = (() => {
|
|
|
47097
47647
|
}).join(", ")}`);
|
|
47098
47648
|
}
|
|
47099
47649
|
};
|
|
47100
|
-
async function fetchJwks(jwksIri, issuerIri) {
|
|
47101
|
-
const jwksResponse = await fetch2.call(globalThis, jwksIri);
|
|
47102
|
-
if (jwksResponse.status !== 200) {
|
|
47103
|
-
throw new Error(`Could not fetch JWKS for [${issuerIri}] at [${jwksIri}]: ${jwksResponse.status} ${jwksResponse.statusText}`);
|
|
47104
|
-
}
|
|
47105
|
-
let jwk;
|
|
47106
|
-
try {
|
|
47107
|
-
jwk = (await jwksResponse.json()).keys[0];
|
|
47108
|
-
} catch (e) {
|
|
47109
|
-
throw new Error(`Malformed JWKS for [${issuerIri}] at [${jwksIri}]: ${e.message}`);
|
|
47110
|
-
}
|
|
47111
|
-
return jwk;
|
|
47112
|
-
}
|
|
47113
47650
|
async function getWebidFromTokenPayload(idToken, jwksIri, issuerIri, clientId) {
|
|
47114
|
-
const jwk = await fetchJwks(jwksIri, issuerIri);
|
|
47115
47651
|
let payload4;
|
|
47652
|
+
let clientIdInPayload;
|
|
47116
47653
|
try {
|
|
47117
|
-
const { payload: verifiedPayload } = await jwtVerify(idToken,
|
|
47654
|
+
const { payload: verifiedPayload } = await jwtVerify(idToken, createRemoteJWKSet(new URL(jwksIri)), {
|
|
47118
47655
|
issuer: issuerIri,
|
|
47119
47656
|
audience: clientId
|
|
47120
47657
|
});
|
|
@@ -47122,15 +47659,24 @@ var PodOS = (() => {
|
|
|
47122
47659
|
} catch (e) {
|
|
47123
47660
|
throw new Error(`Token verification failed: ${e.stack}`);
|
|
47124
47661
|
}
|
|
47662
|
+
if (typeof payload4.azp === "string") {
|
|
47663
|
+
clientIdInPayload = payload4.azp;
|
|
47664
|
+
}
|
|
47125
47665
|
if (typeof payload4.webid === "string") {
|
|
47126
|
-
return
|
|
47666
|
+
return {
|
|
47667
|
+
webId: payload4.webid,
|
|
47668
|
+
clientId: clientIdInPayload
|
|
47669
|
+
};
|
|
47127
47670
|
}
|
|
47128
47671
|
if (typeof payload4.sub !== "string") {
|
|
47129
47672
|
throw new Error(`The token ${JSON.stringify(payload4)} is invalid: it has no 'webid' claim and no 'sub' claim.`);
|
|
47130
47673
|
}
|
|
47131
47674
|
try {
|
|
47132
47675
|
new URL(payload4.sub);
|
|
47133
|
-
return
|
|
47676
|
+
return {
|
|
47677
|
+
webId: payload4.sub,
|
|
47678
|
+
clientId: clientIdInPayload
|
|
47679
|
+
};
|
|
47134
47680
|
} catch (e) {
|
|
47135
47681
|
throw new Error(`The token has no 'webid' claim, and its 'sub' claim of [${payload4.sub}] is invalid as a URL - error [${e}].`);
|
|
47136
47682
|
}
|
|
@@ -47154,17 +47700,29 @@ var PodOS = (() => {
|
|
|
47154
47700
|
cleanedUpUrl.searchParams.delete("iss");
|
|
47155
47701
|
return cleanedUpUrl;
|
|
47156
47702
|
}
|
|
47703
|
+
function booleanWithFallback(value6, fallback) {
|
|
47704
|
+
if (typeof value6 === "boolean") {
|
|
47705
|
+
return Boolean(value6);
|
|
47706
|
+
}
|
|
47707
|
+
return Boolean(fallback);
|
|
47708
|
+
}
|
|
47157
47709
|
var AuthorizationCodeWithPkceOidcHandlerBase = class {
|
|
47158
47710
|
constructor(storageUtility, redirector) {
|
|
47159
47711
|
this.storageUtility = storageUtility;
|
|
47160
47712
|
this.redirector = redirector;
|
|
47713
|
+
this.parametersGuard = (oidcLoginOptions) => {
|
|
47714
|
+
return oidcLoginOptions.issuerConfiguration.grantTypesSupported !== void 0 && oidcLoginOptions.issuerConfiguration.grantTypesSupported.indexOf("authorization_code") > -1 && oidcLoginOptions.redirectUrl !== void 0;
|
|
47715
|
+
};
|
|
47161
47716
|
this.storageUtility = storageUtility;
|
|
47162
47717
|
this.redirector = redirector;
|
|
47163
47718
|
}
|
|
47164
47719
|
async canHandle(oidcLoginOptions) {
|
|
47165
|
-
return
|
|
47720
|
+
return this.parametersGuard(oidcLoginOptions);
|
|
47166
47721
|
}
|
|
47167
47722
|
async handleRedirect({ oidcLoginOptions, state: state2, codeVerifier, targetUrl: targetUrl3 }) {
|
|
47723
|
+
if (!this.parametersGuard(oidcLoginOptions)) {
|
|
47724
|
+
throw new Error("The authorization code grant requires a redirectUrl.");
|
|
47725
|
+
}
|
|
47168
47726
|
await Promise.all([
|
|
47169
47727
|
// We use the OAuth 'state' value (which should be crypto-random) as
|
|
47170
47728
|
// the key in our storage to store our actual SessionID. We do this
|
|
@@ -47175,7 +47733,6 @@ var PodOS = (() => {
|
|
|
47175
47733
|
// that session ID can be any developer-specified value, and therefore
|
|
47176
47734
|
// may not be appropriate (since the OAuth 'state' value should really
|
|
47177
47735
|
// be an unguessable crypto-random value).
|
|
47178
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
47179
47736
|
this.storageUtility.setForUser(state2, {
|
|
47180
47737
|
sessionId: oidcLoginOptions.sessionId
|
|
47181
47738
|
}),
|
|
@@ -47184,12 +47741,12 @@ var PodOS = (() => {
|
|
|
47184
47741
|
// our session ID is unnecessary, but it provides a slightly cleaner
|
|
47185
47742
|
// separation of concerns.
|
|
47186
47743
|
this.storageUtility.setForUser(oidcLoginOptions.sessionId, {
|
|
47187
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
47188
47744
|
codeVerifier,
|
|
47189
47745
|
issuer: oidcLoginOptions.issuer.toString(),
|
|
47190
47746
|
// The redirect URL is read after redirect, so it must be stored now.
|
|
47191
47747
|
redirectUrl: oidcLoginOptions.redirectUrl,
|
|
47192
|
-
dpop: oidcLoginOptions.dpop
|
|
47748
|
+
dpop: Boolean(oidcLoginOptions.dpop).toString(),
|
|
47749
|
+
keepAlive: booleanWithFallback(oidcLoginOptions.keepAlive, true).toString()
|
|
47193
47750
|
})
|
|
47194
47751
|
]);
|
|
47195
47752
|
this.redirector.redirect(targetUrl3, {
|
|
@@ -47251,7 +47808,7 @@ var PodOS = (() => {
|
|
|
47251
47808
|
return {
|
|
47252
47809
|
isLoggedIn: false,
|
|
47253
47810
|
sessionId: v4_default(),
|
|
47254
|
-
fetch: (...args) =>
|
|
47811
|
+
fetch: (...args) => fetch(...args)
|
|
47255
47812
|
};
|
|
47256
47813
|
}
|
|
47257
47814
|
async function clear(sessionId, storage2) {
|
|
@@ -47345,48 +47902,51 @@ var PodOS = (() => {
|
|
|
47345
47902
|
return supported.includes(signingAlg);
|
|
47346
47903
|
})) !== null && _a !== void 0 ? _a : null;
|
|
47347
47904
|
}
|
|
47348
|
-
function
|
|
47349
|
-
|
|
47350
|
-
|
|
47351
|
-
|
|
47352
|
-
|
|
47353
|
-
|
|
47354
|
-
|
|
47355
|
-
return "dynamic";
|
|
47905
|
+
function isStaticClient(options) {
|
|
47906
|
+
return options.clientId !== void 0 && !isValidUrl(options.clientId);
|
|
47907
|
+
}
|
|
47908
|
+
function isSolidOidcClient(options, issuerConfig) {
|
|
47909
|
+
return issuerConfig.scopesSupported.includes("webid") && options.clientId !== void 0 && isValidUrl(options.clientId);
|
|
47910
|
+
}
|
|
47911
|
+
function isKnownClientType(clientType) {
|
|
47912
|
+
return typeof clientType === "string" && ["dynamic", "static", "solid-oidc"].includes(clientType);
|
|
47356
47913
|
}
|
|
47357
47914
|
async function handleRegistration(options, issuerConfig, storageUtility, clientRegistrar) {
|
|
47358
|
-
|
|
47359
|
-
if (
|
|
47915
|
+
let clientInfo;
|
|
47916
|
+
if (isSolidOidcClient(options, issuerConfig)) {
|
|
47917
|
+
clientInfo = {
|
|
47918
|
+
clientId: options.clientId,
|
|
47919
|
+
clientName: options.clientName,
|
|
47920
|
+
clientType: "solid-oidc"
|
|
47921
|
+
};
|
|
47922
|
+
} else if (isStaticClient(options)) {
|
|
47923
|
+
clientInfo = {
|
|
47924
|
+
clientId: options.clientId,
|
|
47925
|
+
clientSecret: options.clientSecret,
|
|
47926
|
+
clientName: options.clientName,
|
|
47927
|
+
clientType: "static"
|
|
47928
|
+
};
|
|
47929
|
+
} else {
|
|
47360
47930
|
return clientRegistrar.getClient({
|
|
47361
47931
|
sessionId: options.sessionId,
|
|
47362
47932
|
clientName: options.clientName,
|
|
47363
47933
|
redirectUrl: options.redirectUrl
|
|
47364
47934
|
}, issuerConfig);
|
|
47365
47935
|
}
|
|
47366
|
-
|
|
47367
|
-
|
|
47368
|
-
|
|
47369
|
-
|
|
47370
|
-
|
|
47371
|
-
|
|
47372
|
-
await storageUtility.setForUser(options.sessionId, {
|
|
47373
|
-
clientSecret: options.clientSecret
|
|
47374
|
-
});
|
|
47936
|
+
const infoToSave = {
|
|
47937
|
+
clientId: clientInfo.clientId,
|
|
47938
|
+
clientType: clientInfo.clientType
|
|
47939
|
+
};
|
|
47940
|
+
if (clientInfo.clientType === "static") {
|
|
47941
|
+
infoToSave.clientSecret = clientInfo.clientSecret;
|
|
47375
47942
|
}
|
|
47376
|
-
if (
|
|
47377
|
-
|
|
47378
|
-
clientName: options.clientName
|
|
47379
|
-
});
|
|
47943
|
+
if (clientInfo.clientName) {
|
|
47944
|
+
infoToSave.clientName = clientInfo.clientName;
|
|
47380
47945
|
}
|
|
47381
|
-
|
|
47382
|
-
|
|
47383
|
-
clientId: options.clientId,
|
|
47384
|
-
clientSecret: options.clientSecret,
|
|
47385
|
-
clientName: options.clientName,
|
|
47386
|
-
clientType
|
|
47387
|
-
};
|
|
47946
|
+
await storageUtility.setForUser(options.sessionId, infoToSave);
|
|
47947
|
+
return clientInfo;
|
|
47388
47948
|
}
|
|
47389
|
-
var
|
|
47949
|
+
var boundFetch = (request2, init) => fetch(request2, init);
|
|
47390
47950
|
var ClientAuthentication = class {
|
|
47391
47951
|
constructor(loginHandler, redirectHandler, logoutHandler, sessionInfoManager, issuerConfigFetcher) {
|
|
47392
47952
|
this.loginHandler = loginHandler;
|
|
@@ -47394,13 +47954,13 @@ var PodOS = (() => {
|
|
|
47394
47954
|
this.logoutHandler = logoutHandler;
|
|
47395
47955
|
this.sessionInfoManager = sessionInfoManager;
|
|
47396
47956
|
this.issuerConfigFetcher = issuerConfigFetcher;
|
|
47397
|
-
this.fetch =
|
|
47957
|
+
this.fetch = boundFetch;
|
|
47398
47958
|
this.logout = async (sessionId, options) => {
|
|
47399
47959
|
await this.logoutHandler.handle(sessionId, (options === null || options === void 0 ? void 0 : options.logoutType) === "idp" ? {
|
|
47400
47960
|
...options,
|
|
47401
47961
|
toLogoutUrl: this.boundLogout
|
|
47402
47962
|
} : options);
|
|
47403
|
-
this.fetch =
|
|
47963
|
+
this.fetch = boundFetch;
|
|
47404
47964
|
delete this.boundLogout;
|
|
47405
47965
|
};
|
|
47406
47966
|
this.getSessionInfo = async (sessionId) => {
|
|
@@ -47418,13 +47978,14 @@ var PodOS = (() => {
|
|
|
47418
47978
|
};
|
|
47419
47979
|
async function loadOidcContextFromStorage(sessionId, storageUtility, configFetcher) {
|
|
47420
47980
|
try {
|
|
47421
|
-
const [issuerIri, codeVerifier, storedRedirectIri, dpop] = await Promise.all([
|
|
47981
|
+
const [issuerIri, codeVerifier, storedRedirectIri, dpop, keepAlive] = await Promise.all([
|
|
47422
47982
|
storageUtility.getForUser(sessionId, "issuer", {
|
|
47423
47983
|
errorIfNull: true
|
|
47424
47984
|
}),
|
|
47425
47985
|
storageUtility.getForUser(sessionId, "codeVerifier"),
|
|
47426
47986
|
storageUtility.getForUser(sessionId, "redirectUrl"),
|
|
47427
|
-
storageUtility.getForUser(sessionId, "dpop", { errorIfNull: true })
|
|
47987
|
+
storageUtility.getForUser(sessionId, "dpop", { errorIfNull: true }),
|
|
47988
|
+
storageUtility.getForUser(sessionId, "keepAlive")
|
|
47428
47989
|
]);
|
|
47429
47990
|
await storageUtility.deleteForUser(sessionId, "codeVerifier");
|
|
47430
47991
|
const issuerConfig = await configFetcher.fetchConfig(issuerIri);
|
|
@@ -47432,12 +47993,34 @@ var PodOS = (() => {
|
|
|
47432
47993
|
codeVerifier,
|
|
47433
47994
|
redirectUrl: storedRedirectIri,
|
|
47434
47995
|
issuerConfig,
|
|
47435
|
-
dpop: dpop === "true"
|
|
47996
|
+
dpop: dpop === "true",
|
|
47997
|
+
// Default keepAlive to true if not found in storage.
|
|
47998
|
+
keepAlive: typeof keepAlive === "string" ? keepAlive === "true" : true
|
|
47436
47999
|
};
|
|
47437
48000
|
} catch (e) {
|
|
47438
48001
|
throw new Error(`Failed to retrieve OIDC context from storage associated with session [${sessionId}]: ${e}`);
|
|
47439
48002
|
}
|
|
47440
48003
|
}
|
|
48004
|
+
async function saveSessionInfoToStorage(storageUtility, sessionId, webId, clientId, isLoggedIn2, refreshToken, secure, dpopKey) {
|
|
48005
|
+
if (refreshToken !== void 0) {
|
|
48006
|
+
await storageUtility.setForUser(sessionId, { refreshToken }, { secure });
|
|
48007
|
+
}
|
|
48008
|
+
if (webId !== void 0) {
|
|
48009
|
+
await storageUtility.setForUser(sessionId, { webId }, { secure });
|
|
48010
|
+
}
|
|
48011
|
+
if (clientId !== void 0) {
|
|
48012
|
+
await storageUtility.setForUser(sessionId, { clientId }, { secure });
|
|
48013
|
+
}
|
|
48014
|
+
if (isLoggedIn2 !== void 0) {
|
|
48015
|
+
await storageUtility.setForUser(sessionId, { isLoggedIn: isLoggedIn2 }, { secure });
|
|
48016
|
+
}
|
|
48017
|
+
if (dpopKey !== void 0) {
|
|
48018
|
+
await storageUtility.setForUser(sessionId, {
|
|
48019
|
+
publicKey: JSON.stringify(dpopKey.publicKey),
|
|
48020
|
+
privateKey: JSON.stringify(await exportJWK(dpopKey.privateKey))
|
|
48021
|
+
}, { secure });
|
|
48022
|
+
}
|
|
48023
|
+
}
|
|
47441
48024
|
var StorageUtility = class {
|
|
47442
48025
|
constructor(secureStorage, insecureStorage) {
|
|
47443
48026
|
this.secureStorage = secureStorage;
|
|
@@ -47589,8 +48172,8 @@ var PodOS = (() => {
|
|
|
47589
48172
|
headers
|
|
47590
48173
|
};
|
|
47591
48174
|
}
|
|
47592
|
-
async function makeAuthenticatedRequest(
|
|
47593
|
-
return
|
|
48175
|
+
async function makeAuthenticatedRequest(accessToken, url7, defaultRequestInit, dpopKey) {
|
|
48176
|
+
return fetch(url7, await buildAuthenticatedHeaders(url7.toString(), accessToken, dpopKey, defaultRequestInit));
|
|
47594
48177
|
}
|
|
47595
48178
|
async function refreshAccessToken(refreshOptions, dpopKey, eventEmitter) {
|
|
47596
48179
|
var _a;
|
|
@@ -47614,7 +48197,7 @@ var PodOS = (() => {
|
|
|
47614
48197
|
}
|
|
47615
48198
|
return DEFAULT_EXPIRATION_TIME_SECONDS;
|
|
47616
48199
|
};
|
|
47617
|
-
async function buildAuthenticatedFetch(
|
|
48200
|
+
async function buildAuthenticatedFetch(accessToken, options) {
|
|
47618
48201
|
var _a;
|
|
47619
48202
|
let currentAccessToken = accessToken;
|
|
47620
48203
|
let latestTimeout;
|
|
@@ -47662,7 +48245,7 @@ var PodOS = (() => {
|
|
|
47662
48245
|
options.eventEmitter.emit(EVENTS.TIMEOUT_SET, expirationTimeout);
|
|
47663
48246
|
}
|
|
47664
48247
|
return async (url7, requestInit) => {
|
|
47665
|
-
let response6 = await makeAuthenticatedRequest(
|
|
48248
|
+
let response6 = await makeAuthenticatedRequest(currentAccessToken, url7, requestInit, options === null || options === void 0 ? void 0 : options.dpopKey);
|
|
47666
48249
|
const failedButNotExpectedAuthError = !response6.ok && !isExpectedAuthError(response6.status);
|
|
47667
48250
|
if (response6.ok || failedButNotExpectedAuthError) {
|
|
47668
48251
|
return response6;
|
|
@@ -47670,7 +48253,6 @@ var PodOS = (() => {
|
|
|
47670
48253
|
const hasBeenRedirected = response6.url !== url7;
|
|
47671
48254
|
if (hasBeenRedirected && (options === null || options === void 0 ? void 0 : options.dpopKey) !== void 0) {
|
|
47672
48255
|
response6 = await makeAuthenticatedRequest(
|
|
47673
|
-
unauthFetch,
|
|
47674
48256
|
currentAccessToken,
|
|
47675
48257
|
// Replace the original target IRI (`url`) by the redirection target
|
|
47676
48258
|
response6.url,
|
|
@@ -47682,8 +48264,57 @@ var PodOS = (() => {
|
|
|
47682
48264
|
};
|
|
47683
48265
|
}
|
|
47684
48266
|
|
|
48267
|
+
// ../node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/esm-browser/stringify.js
|
|
48268
|
+
var byteToHex2 = [];
|
|
48269
|
+
for (i = 0; i < 256; ++i) {
|
|
48270
|
+
byteToHex2.push((i + 256).toString(16).slice(1));
|
|
48271
|
+
}
|
|
48272
|
+
var i;
|
|
48273
|
+
function unsafeStringify2(arr, offset3 = 0) {
|
|
48274
|
+
return (byteToHex2[arr[offset3 + 0]] + byteToHex2[arr[offset3 + 1]] + byteToHex2[arr[offset3 + 2]] + byteToHex2[arr[offset3 + 3]] + "-" + byteToHex2[arr[offset3 + 4]] + byteToHex2[arr[offset3 + 5]] + "-" + byteToHex2[arr[offset3 + 6]] + byteToHex2[arr[offset3 + 7]] + "-" + byteToHex2[arr[offset3 + 8]] + byteToHex2[arr[offset3 + 9]] + "-" + byteToHex2[arr[offset3 + 10]] + byteToHex2[arr[offset3 + 11]] + byteToHex2[arr[offset3 + 12]] + byteToHex2[arr[offset3 + 13]] + byteToHex2[arr[offset3 + 14]] + byteToHex2[arr[offset3 + 15]]).toLowerCase();
|
|
48275
|
+
}
|
|
48276
|
+
|
|
48277
|
+
// ../node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/esm-browser/rng.js
|
|
48278
|
+
var getRandomValues2;
|
|
48279
|
+
var rnds82 = new Uint8Array(16);
|
|
48280
|
+
function rng2() {
|
|
48281
|
+
if (!getRandomValues2) {
|
|
48282
|
+
getRandomValues2 = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
48283
|
+
if (!getRandomValues2) {
|
|
48284
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
48285
|
+
}
|
|
48286
|
+
}
|
|
48287
|
+
return getRandomValues2(rnds82);
|
|
48288
|
+
}
|
|
48289
|
+
|
|
48290
|
+
// ../node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/esm-browser/native.js
|
|
48291
|
+
var randomUUID2 = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
48292
|
+
var native_default2 = {
|
|
48293
|
+
randomUUID: randomUUID2
|
|
48294
|
+
};
|
|
48295
|
+
|
|
48296
|
+
// ../node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/esm-browser/v4.js
|
|
48297
|
+
function v42(options, buf, offset3) {
|
|
48298
|
+
if (native_default2.randomUUID && !buf && !options) {
|
|
48299
|
+
return native_default2.randomUUID();
|
|
48300
|
+
}
|
|
48301
|
+
options = options || {};
|
|
48302
|
+
var rnds = options.random || (options.rng || rng2)();
|
|
48303
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
48304
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
48305
|
+
if (buf) {
|
|
48306
|
+
offset3 = offset3 || 0;
|
|
48307
|
+
for (var i = 0; i < 16; ++i) {
|
|
48308
|
+
buf[offset3 + i] = rnds[i];
|
|
48309
|
+
}
|
|
48310
|
+
return buf;
|
|
48311
|
+
}
|
|
48312
|
+
return unsafeStringify2(rnds);
|
|
48313
|
+
}
|
|
48314
|
+
var v4_default2 = v42;
|
|
48315
|
+
|
|
47685
48316
|
// ../node_modules/@inrupt/solid-client-authn-browser/dist/index.mjs
|
|
47686
|
-
var
|
|
48317
|
+
var import_events = __toESM(require_events(), 1);
|
|
47687
48318
|
|
|
47688
48319
|
// ../node_modules/@inrupt/oidc-client-ext/dist/index.es.js
|
|
47689
48320
|
var import_oidc_client = __toESM(require_oidc_client_min());
|
|
@@ -47831,79 +48462,20 @@ var PodOS = (() => {
|
|
|
47831
48462
|
headers,
|
|
47832
48463
|
body: new URLSearchParams(requestBody).toString()
|
|
47833
48464
|
};
|
|
47834
|
-
const rawTokenResponse = await
|
|
48465
|
+
const rawTokenResponse = await fetch(issuer2.tokenEndpoint, tokenRequestInit);
|
|
47835
48466
|
const jsonTokenResponse = await rawTokenResponse.json();
|
|
47836
48467
|
const tokenResponse = validateTokenEndpointResponse(jsonTokenResponse, dpop);
|
|
47837
|
-
const webId = await getWebidFromTokenPayload(tokenResponse.id_token, issuer2.jwksUri, issuer2.issuer, client.clientId);
|
|
48468
|
+
const { webId, clientId } = await getWebidFromTokenPayload(tokenResponse.id_token, issuer2.jwksUri, issuer2.issuer, client.clientId);
|
|
47838
48469
|
return {
|
|
47839
48470
|
accessToken: tokenResponse.access_token,
|
|
47840
48471
|
idToken: tokenResponse.id_token,
|
|
47841
48472
|
refreshToken: hasRefreshToken(tokenResponse) ? tokenResponse.refresh_token : void 0,
|
|
47842
48473
|
webId,
|
|
48474
|
+
clientId,
|
|
47843
48475
|
dpopKey,
|
|
47844
48476
|
expiresIn: tokenResponse.expires_in
|
|
47845
48477
|
};
|
|
47846
48478
|
}
|
|
47847
|
-
async function getBearerToken(redirectUrl) {
|
|
47848
|
-
let signinResponse;
|
|
47849
|
-
try {
|
|
47850
|
-
const client = new import_oidc_client.OidcClient({
|
|
47851
|
-
// TODO: We should look at the various interfaces being used for storage,
|
|
47852
|
-
// i.e. between oidc-client-js (WebStorageStoreState), localStorage
|
|
47853
|
-
// (which has an interface Storage), and our own proprietary interface
|
|
47854
|
-
// IStorage - i.e. we should really just be using the browser Web Storage
|
|
47855
|
-
// API, e.g. "stateStore: window.localStorage,".
|
|
47856
|
-
// We are instantiating a new instance here, so the only value we need to
|
|
47857
|
-
// explicitly provide is the response mode (default otherwise will look
|
|
47858
|
-
// for a hash '#' fragment!).
|
|
47859
|
-
// eslint-disable-next-line camelcase
|
|
47860
|
-
response_mode: "query",
|
|
47861
|
-
// The userinfo endpoint on NSS fails, so disable this for now
|
|
47862
|
-
// Note that in Solid, information should be retrieved from the
|
|
47863
|
-
// profile referenced by the WebId.
|
|
47864
|
-
// TODO: Note that this is heavy-handed, and that this userinfo check
|
|
47865
|
-
// verifies that the `sub` claim in the id token you get along with the
|
|
47866
|
-
// access token matches the sub claim associated with the access token at
|
|
47867
|
-
// the userinfo endpoint.
|
|
47868
|
-
// That is a useful check, and in the future it should be only disabled
|
|
47869
|
-
// against NSS, and not in general.
|
|
47870
|
-
// Issue tracker: https://github.com/solid/node-solid-server/issues/1490
|
|
47871
|
-
loadUserInfo: false
|
|
47872
|
-
});
|
|
47873
|
-
signinResponse = await client.processSigninResponse(redirectUrl);
|
|
47874
|
-
if (client.settings.metadata === void 0) {
|
|
47875
|
-
throw new Error("Cannot retrieve issuer metadata from client information in storage.");
|
|
47876
|
-
}
|
|
47877
|
-
if (client.settings.metadata.jwks_uri === void 0) {
|
|
47878
|
-
throw new Error("Missing some issuer metadata from client information in storage: 'jwks_uri' is undefined");
|
|
47879
|
-
}
|
|
47880
|
-
if (client.settings.metadata.issuer === void 0) {
|
|
47881
|
-
throw new Error("Missing some issuer metadata from client information in storage: 'issuer' is undefined");
|
|
47882
|
-
}
|
|
47883
|
-
if (client.settings.client_id === void 0) {
|
|
47884
|
-
throw new Error("Missing some client information in storage: 'client_id' is undefined");
|
|
47885
|
-
}
|
|
47886
|
-
const webId = await getWebidFromTokenPayload(signinResponse.id_token, client.settings.metadata.jwks_uri, client.settings.metadata.issuer, client.settings.client_id);
|
|
47887
|
-
return {
|
|
47888
|
-
accessToken: signinResponse.access_token,
|
|
47889
|
-
idToken: signinResponse.id_token,
|
|
47890
|
-
webId,
|
|
47891
|
-
// Although not a field in the TypeScript response interface, the refresh
|
|
47892
|
-
// token (which can optionally come back with the access token (if, as per
|
|
47893
|
-
// the OAuth2 spec, we requested one using the scope of 'offline_access')
|
|
47894
|
-
// will be included in the signin response object.
|
|
47895
|
-
// eslint-disable-next-line camelcase
|
|
47896
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
47897
|
-
// @ts-ignore
|
|
47898
|
-
refreshToken: signinResponse.refresh_token
|
|
47899
|
-
};
|
|
47900
|
-
} catch (err) {
|
|
47901
|
-
throw new Error(`Problem handling Auth Code Grant (Flow) redirect - URL [${redirectUrl}]: ${err}`);
|
|
47902
|
-
}
|
|
47903
|
-
}
|
|
47904
|
-
async function getDpopToken(issuer2, client, data2) {
|
|
47905
|
-
return getTokens(issuer2, client, data2, true);
|
|
47906
|
-
}
|
|
47907
48479
|
var isValidUrl2 = (url7) => {
|
|
47908
48480
|
try {
|
|
47909
48481
|
new URL(url7);
|
|
@@ -47937,7 +48509,7 @@ var PodOS = (() => {
|
|
|
47937
48509
|
} else if (isValidUrl2(client.clientId)) {
|
|
47938
48510
|
requestBody.client_id = client.clientId;
|
|
47939
48511
|
}
|
|
47940
|
-
const rawResponse = await
|
|
48512
|
+
const rawResponse = await fetch(issuer2.tokenEndpoint, {
|
|
47941
48513
|
method: "POST",
|
|
47942
48514
|
body: new URLSearchParams(requestBody).toString(),
|
|
47943
48515
|
headers: {
|
|
@@ -47953,7 +48525,7 @@ var PodOS = (() => {
|
|
|
47953
48525
|
throw new Error(`The token endpoint of issuer ${issuer2.issuer} returned a malformed response.`);
|
|
47954
48526
|
}
|
|
47955
48527
|
const validatedResponse = validateTokenEndpointResponse(response6, dpopKey !== void 0);
|
|
47956
|
-
const webId = await getWebidFromTokenPayload(validatedResponse.id_token, issuer2.jwksUri, issuer2.issuer, client.clientId);
|
|
48528
|
+
const { webId } = await getWebidFromTokenPayload(validatedResponse.id_token, issuer2.jwksUri, issuer2.issuer, client.clientId);
|
|
47957
48529
|
return {
|
|
47958
48530
|
accessToken: validatedResponse.access_token,
|
|
47959
48531
|
idToken: validatedResponse.id_token,
|
|
@@ -48035,7 +48607,7 @@ var PodOS = (() => {
|
|
|
48035
48607
|
};
|
|
48036
48608
|
this.handleIncomingRedirect = async (url7, eventEmitter) => {
|
|
48037
48609
|
try {
|
|
48038
|
-
const redirectInfo = await this.redirectHandler.handle(url7, eventEmitter);
|
|
48610
|
+
const redirectInfo = await this.redirectHandler.handle(url7, eventEmitter, void 0);
|
|
48039
48611
|
this.fetch = redirectInfo.fetch.bind(window);
|
|
48040
48612
|
this.boundLogout = redirectInfo.getLogoutUrl;
|
|
48041
48613
|
await this.cleanUrlAfterRedirect(url7);
|
|
@@ -48043,7 +48615,8 @@ var PodOS = (() => {
|
|
|
48043
48615
|
isLoggedIn: redirectInfo.isLoggedIn,
|
|
48044
48616
|
webId: redirectInfo.webId,
|
|
48045
48617
|
sessionId: redirectInfo.sessionId,
|
|
48046
|
-
expirationDate: redirectInfo.expirationDate
|
|
48618
|
+
expirationDate: redirectInfo.expirationDate,
|
|
48619
|
+
clientAppId: redirectInfo.clientAppId
|
|
48047
48620
|
};
|
|
48048
48621
|
} catch (err) {
|
|
48049
48622
|
await this.cleanUrlAfterRedirect(url7);
|
|
@@ -48114,8 +48687,7 @@ var PodOS = (() => {
|
|
|
48114
48687
|
authority: oidcLoginOptions.issuer.toString(),
|
|
48115
48688
|
client_id: oidcLoginOptions.client.clientId,
|
|
48116
48689
|
client_secret: oidcLoginOptions.client.clientSecret,
|
|
48117
|
-
redirect_uri: oidcLoginOptions.redirectUrl
|
|
48118
|
-
post_logout_redirect_uri: oidcLoginOptions.redirectUrl.toString(),
|
|
48690
|
+
redirect_uri: oidcLoginOptions.redirectUrl,
|
|
48119
48691
|
response_type: "code",
|
|
48120
48692
|
scope: DEFAULT_SCOPES,
|
|
48121
48693
|
filterProtocolClaims: true,
|
|
@@ -48261,7 +48833,7 @@ var PodOS = (() => {
|
|
|
48261
48833
|
// includes the full issuer path. See https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfig.
|
|
48262
48834
|
issuer2.endsWith("/") ? issuer2 : `${issuer2}/`
|
|
48263
48835
|
).href;
|
|
48264
|
-
const issuerConfigRequestBody = await
|
|
48836
|
+
const issuerConfigRequestBody = await fetch(openIdConfigUrl);
|
|
48265
48837
|
try {
|
|
48266
48838
|
issuerConfig = processConfig(await issuerConfigRequestBody.json());
|
|
48267
48839
|
} catch (err) {
|
|
@@ -48352,7 +48924,6 @@ var PodOS = (() => {
|
|
|
48352
48924
|
return getUnauthenticatedSession();
|
|
48353
48925
|
}
|
|
48354
48926
|
};
|
|
48355
|
-
var globalFetch2 = (...args) => fetch2.call(globalThis, ...args);
|
|
48356
48927
|
var AuthCodeRedirectHandler = class {
|
|
48357
48928
|
constructor(storageUtility, sessionInfoManager, issuerConfigFetcher, clientRegistrar, tokerRefresher) {
|
|
48358
48929
|
this.storageUtility = storageUtility;
|
|
@@ -48395,21 +48966,16 @@ var PodOS = (() => {
|
|
|
48395
48966
|
throw new Error(`The redirect URL for session ${storedSessionId} is missing from storage.`);
|
|
48396
48967
|
}
|
|
48397
48968
|
const client = await this.clientRegistrar.getClient({ sessionId: storedSessionId }, issuerConfig);
|
|
48398
|
-
let tokens;
|
|
48399
48969
|
const tokenCreatedAt = Date.now();
|
|
48400
|
-
|
|
48401
|
-
|
|
48402
|
-
|
|
48403
|
-
|
|
48404
|
-
|
|
48405
|
-
|
|
48406
|
-
|
|
48407
|
-
|
|
48408
|
-
|
|
48409
|
-
window.localStorage.removeItem(`oidc.${oauthState}`);
|
|
48410
|
-
} else {
|
|
48411
|
-
tokens = await getBearerToken(url7.toString());
|
|
48412
|
-
}
|
|
48970
|
+
const tokens = await getTokens(issuerConfig, client, {
|
|
48971
|
+
grantType: "authorization_code",
|
|
48972
|
+
// We rely on our 'canHandle' function checking that the OAuth 'code'
|
|
48973
|
+
// parameter is present in our query string.
|
|
48974
|
+
code: url7.searchParams.get("code"),
|
|
48975
|
+
codeVerifier,
|
|
48976
|
+
redirectUrl: storedRedirectIri
|
|
48977
|
+
}, isDpop);
|
|
48978
|
+
window.localStorage.removeItem(`oidc.${oauthState}`);
|
|
48413
48979
|
let refreshOptions;
|
|
48414
48980
|
if (tokens.refreshToken !== void 0) {
|
|
48415
48981
|
refreshOptions = {
|
|
@@ -48418,16 +48984,13 @@ var PodOS = (() => {
|
|
|
48418
48984
|
tokenRefresher: this.tokerRefresher
|
|
48419
48985
|
};
|
|
48420
48986
|
}
|
|
48421
|
-
const authFetch = await buildAuthenticatedFetch(
|
|
48987
|
+
const authFetch = await buildAuthenticatedFetch(tokens.accessToken, {
|
|
48422
48988
|
dpopKey: tokens.dpopKey,
|
|
48423
48989
|
refreshOptions,
|
|
48424
48990
|
eventEmitter,
|
|
48425
48991
|
expiresIn: tokens.expiresIn
|
|
48426
48992
|
});
|
|
48427
|
-
await this.storageUtility
|
|
48428
|
-
webId: tokens.webId,
|
|
48429
|
-
isLoggedIn: "true"
|
|
48430
|
-
}, { secure: true });
|
|
48993
|
+
await saveSessionInfoToStorage(this.storageUtility, storedSessionId, tokens.webId, tokens.clientId, "true", void 0, true);
|
|
48431
48994
|
const sessionInfo = await this.sessionInfoManager.get(storedSessionId);
|
|
48432
48995
|
if (!sessionInfo) {
|
|
48433
48996
|
throw new Error(`Could not retrieve session: [${storedSessionId}].`);
|
|
@@ -48478,33 +49041,34 @@ var PodOS = (() => {
|
|
|
48478
49041
|
this.storageUtility = storageUtility;
|
|
48479
49042
|
}
|
|
48480
49043
|
async getClient(options, issuerConfig) {
|
|
48481
|
-
const [
|
|
48482
|
-
storedClientId,
|
|
48483
|
-
storedClientSecret
|
|
48484
|
-
// storedClientName,
|
|
48485
|
-
] = await Promise.all([
|
|
49044
|
+
const [storedClientId, storedClientSecret, storedClientName, storedClientType] = await Promise.all([
|
|
48486
49045
|
this.storageUtility.getForUser(options.sessionId, "clientId", {
|
|
48487
49046
|
secure: false
|
|
48488
49047
|
}),
|
|
48489
49048
|
this.storageUtility.getForUser(options.sessionId, "clientSecret", {
|
|
48490
49049
|
secure: false
|
|
49050
|
+
}),
|
|
49051
|
+
this.storageUtility.getForUser(options.sessionId, "clientName", {
|
|
49052
|
+
secure: false
|
|
49053
|
+
}),
|
|
49054
|
+
this.storageUtility.getForUser(options.sessionId, "clientType", {
|
|
49055
|
+
secure: false
|
|
48491
49056
|
})
|
|
48492
|
-
// this.storageUtility.getForUser(options.sessionId, "clientName", {
|
|
48493
|
-
// // FIXME: figure out how to persist secure storage at reload
|
|
48494
|
-
// secure: false,
|
|
48495
|
-
// }),
|
|
48496
49057
|
]);
|
|
48497
|
-
if (storedClientId) {
|
|
49058
|
+
if (storedClientId && isKnownClientType(storedClientType)) {
|
|
48498
49059
|
return {
|
|
48499
49060
|
clientId: storedClientId,
|
|
48500
49061
|
clientSecret: storedClientSecret,
|
|
48501
|
-
|
|
49062
|
+
clientName: storedClientName,
|
|
49063
|
+
// Note: static clients are not applicable in a browser context.
|
|
49064
|
+
clientType: storedClientType
|
|
48502
49065
|
};
|
|
48503
49066
|
}
|
|
48504
49067
|
try {
|
|
48505
49068
|
const registeredClient = await registerClient(options, issuerConfig);
|
|
48506
49069
|
const infoToSave = {
|
|
48507
|
-
clientId: registeredClient.clientId
|
|
49070
|
+
clientId: registeredClient.clientId,
|
|
49071
|
+
clientType: "dynamic"
|
|
48508
49072
|
};
|
|
48509
49073
|
if (registeredClient.clientSecret) {
|
|
48510
49074
|
infoToSave.clientSecret = registeredClient.clientSecret;
|
|
@@ -48563,9 +49127,6 @@ var PodOS = (() => {
|
|
|
48563
49127
|
const tokenSet = await refresh(refreshToken, oidcContext.issuerConfig, clientInfo, dpopKey);
|
|
48564
49128
|
if (tokenSet.refreshToken !== void 0) {
|
|
48565
49129
|
eventEmitter === null || eventEmitter === void 0 ? void 0 : eventEmitter.emit(EVENTS.NEW_REFRESH_TOKEN, tokenSet.refreshToken);
|
|
48566
|
-
await this.storageUtility.setForUser(sessionId, {
|
|
48567
|
-
refreshToken: tokenSet.refreshToken
|
|
48568
|
-
});
|
|
48569
49130
|
}
|
|
48570
49131
|
return tokenSet;
|
|
48571
49132
|
}
|
|
@@ -48613,7 +49174,7 @@ var PodOS = (() => {
|
|
|
48613
49174
|
function isLoggedIn(sessionInfo) {
|
|
48614
49175
|
return !!(sessionInfo === null || sessionInfo === void 0 ? void 0 : sessionInfo.isLoggedIn);
|
|
48615
49176
|
}
|
|
48616
|
-
var Session = class
|
|
49177
|
+
var Session = class {
|
|
48617
49178
|
/**
|
|
48618
49179
|
* Session object constructor. Typically called as follows:
|
|
48619
49180
|
*
|
|
@@ -48630,7 +49191,6 @@ var PodOS = (() => {
|
|
|
48630
49191
|
*
|
|
48631
49192
|
*/
|
|
48632
49193
|
constructor(sessionOptions = {}, sessionId = void 0) {
|
|
48633
|
-
super();
|
|
48634
49194
|
this.tokenRequestInProgress = false;
|
|
48635
49195
|
this.login = async (options) => {
|
|
48636
49196
|
var _a;
|
|
@@ -48687,7 +49247,7 @@ var PodOS = (() => {
|
|
|
48687
49247
|
this.tokenRequestInProgress = false;
|
|
48688
49248
|
return sessionInfo;
|
|
48689
49249
|
};
|
|
48690
|
-
this.events = new
|
|
49250
|
+
this.events = new import_events.default();
|
|
48691
49251
|
if (sessionOptions.clientAuthentication) {
|
|
48692
49252
|
this.clientAuthentication = sessionOptions.clientAuthentication;
|
|
48693
49253
|
} else if (sessionOptions.secureStorage && sessionOptions.insecureStorage) {
|
|
@@ -48702,11 +49262,12 @@ var PodOS = (() => {
|
|
|
48702
49262
|
this.info = {
|
|
48703
49263
|
sessionId: sessionOptions.sessionInfo.sessionId,
|
|
48704
49264
|
isLoggedIn: false,
|
|
48705
|
-
webId: sessionOptions.sessionInfo.webId
|
|
49265
|
+
webId: sessionOptions.sessionInfo.webId,
|
|
49266
|
+
clientAppId: sessionOptions.sessionInfo.clientAppId
|
|
48706
49267
|
};
|
|
48707
49268
|
} else {
|
|
48708
49269
|
this.info = {
|
|
48709
|
-
sessionId: sessionId !== null && sessionId !== void 0 ? sessionId :
|
|
49270
|
+
sessionId: sessionId !== null && sessionId !== void 0 ? sessionId : v4_default2(),
|
|
48710
49271
|
isLoggedIn: false
|
|
48711
49272
|
};
|
|
48712
49273
|
}
|
|
@@ -48714,62 +49275,11 @@ var PodOS = (() => {
|
|
|
48714
49275
|
this.events.on(EVENTS.SESSION_EXPIRED, () => this.internalLogout(false));
|
|
48715
49276
|
this.events.on(EVENTS.ERROR, () => this.internalLogout(false));
|
|
48716
49277
|
}
|
|
48717
|
-
/**
|
|
48718
|
-
* Register a callback function to be called when a user completes login.
|
|
48719
|
-
*
|
|
48720
|
-
* The callback is called when {@link handleIncomingRedirect} completes successfully.
|
|
48721
|
-
*
|
|
48722
|
-
* @param callback The function called when a user completes login.
|
|
48723
|
-
* @deprecated Prefer session.events.on(EVENTS.LOGIN, callback)
|
|
48724
|
-
*/
|
|
48725
|
-
onLogin(callback) {
|
|
48726
|
-
this.events.on(EVENTS.LOGIN, callback);
|
|
48727
|
-
}
|
|
48728
|
-
/**
|
|
48729
|
-
* Register a callback function to be called when a user logs out:
|
|
48730
|
-
*
|
|
48731
|
-
* @param callback The function called when a user completes logout.
|
|
48732
|
-
* @deprecated Prefer session.events.on(EVENTS.LOGOUT, callback)
|
|
48733
|
-
*/
|
|
48734
|
-
onLogout(callback) {
|
|
48735
|
-
this.events.on(EVENTS.LOGOUT, callback);
|
|
48736
|
-
}
|
|
48737
|
-
/**
|
|
48738
|
-
* Register a callback function to be called when a user logs out:
|
|
48739
|
-
*
|
|
48740
|
-
* @param callback The function called when an error occurs.
|
|
48741
|
-
* @since 1.11.0
|
|
48742
|
-
* @deprecated Prefer session.events.on(EVENTS.ERROR, callback)
|
|
48743
|
-
*/
|
|
48744
|
-
onError(callback) {
|
|
48745
|
-
this.events.on(EVENTS.ERROR, callback);
|
|
48746
|
-
}
|
|
48747
|
-
/**
|
|
48748
|
-
* Register a callback function to be called when a session is restored.
|
|
48749
|
-
*
|
|
48750
|
-
* Note: the callback will be called with the saved value of the 'current URL'
|
|
48751
|
-
* at the time the session was restored.
|
|
48752
|
-
*
|
|
48753
|
-
* @param callback The function called when a user's already logged-in session is restored, e.g., after a silent authentication is completed after a page refresh.
|
|
48754
|
-
* @deprecated Prefer session.events.on(EVENTS.SESSION_RESTORED, callback)
|
|
48755
|
-
*/
|
|
48756
|
-
onSessionRestore(callback) {
|
|
48757
|
-
this.events.on(EVENTS.SESSION_RESTORED, callback);
|
|
48758
|
-
}
|
|
48759
|
-
/**
|
|
48760
|
-
* Register a callback that runs when the session expires and can no longer
|
|
48761
|
-
* make authenticated requests, but following a user logout.
|
|
48762
|
-
* @param callback The function that runs on session expiration.
|
|
48763
|
-
* @since 1.11.0
|
|
48764
|
-
* @deprecated Prefer session.events.on(EVENTS.SESSION_EXPIRED, callback)
|
|
48765
|
-
*/
|
|
48766
|
-
onSessionExpiration(callback) {
|
|
48767
|
-
this.events.on(EVENTS.SESSION_EXPIRED, callback);
|
|
48768
|
-
}
|
|
48769
49278
|
setSessionInfo(sessionInfo) {
|
|
48770
49279
|
this.info.isLoggedIn = sessionInfo.isLoggedIn;
|
|
48771
49280
|
this.info.webId = sessionInfo.webId;
|
|
48772
49281
|
this.info.sessionId = sessionInfo.sessionId;
|
|
49282
|
+
this.info.clientAppId = sessionInfo.clientAppId;
|
|
48773
49283
|
this.info.expirationDate = sessionInfo.expirationDate;
|
|
48774
49284
|
this.events.on(EVENTS.SESSION_EXTENDED, (expiresIn) => {
|
|
48775
49285
|
this.info.expirationDate = Date.now() + expiresIn * 1e3;
|
|
@@ -48816,16 +49326,19 @@ var PodOS = (() => {
|
|
|
48816
49326
|
* @deprecated use observeSession instead
|
|
48817
49327
|
*/
|
|
48818
49328
|
trackSession(callback) {
|
|
48819
|
-
this.session.on(EVENTS.LOGIN, () => callback(this.session.info));
|
|
48820
|
-
this.session.on(EVENTS.LOGOUT, () => callback(this.session.info));
|
|
48821
|
-
this.session.on(
|
|
49329
|
+
this.session.events.on(EVENTS.LOGIN, () => callback(this.session.info));
|
|
49330
|
+
this.session.events.on(EVENTS.LOGOUT, () => callback(this.session.info));
|
|
49331
|
+
this.session.events.on(
|
|
49332
|
+
EVENTS.SESSION_RESTORED,
|
|
49333
|
+
() => callback(this.session.info)
|
|
49334
|
+
);
|
|
48822
49335
|
callback(this.session.info);
|
|
48823
49336
|
}
|
|
48824
49337
|
observeSession() {
|
|
48825
49338
|
return this.sessionInfo$;
|
|
48826
49339
|
}
|
|
48827
49340
|
onSessionRestore(callback) {
|
|
48828
|
-
this.session.on(EVENTS.SESSION_RESTORED, callback);
|
|
49341
|
+
this.session.events.on(EVENTS.SESSION_RESTORED, callback);
|
|
48829
49342
|
}
|
|
48830
49343
|
};
|
|
48831
49344
|
|
|
@@ -48886,7 +49399,7 @@ var PodOS = (() => {
|
|
|
48886
49399
|
|
|
48887
49400
|
// src/modules/contacts.ts
|
|
48888
49401
|
async function loadContactsModule(store) {
|
|
48889
|
-
const module3 = await Promise.resolve().then(() => (
|
|
49402
|
+
const module3 = await Promise.resolve().then(() => (init_dist2(), dist_exports));
|
|
48890
49403
|
return new module3.default({
|
|
48891
49404
|
store: store.graph,
|
|
48892
49405
|
fetcher: store.fetcher,
|
|
@@ -48935,6 +49448,30 @@ var PodOS = (() => {
|
|
|
48935
49448
|
}
|
|
48936
49449
|
}
|
|
48937
49450
|
|
|
49451
|
+
// src/thing/labelFromUri.ts
|
|
49452
|
+
function labelFromUri(uri6) {
|
|
49453
|
+
const url7 = new URL(uri6);
|
|
49454
|
+
if (isTooGeneric(url7.hash)) {
|
|
49455
|
+
return (getFilename(url7) || url7.host + url7.pathname) + url7.hash;
|
|
49456
|
+
}
|
|
49457
|
+
return labelFromFragment(url7.hash) || getFilename(url7) || url7.host;
|
|
49458
|
+
}
|
|
49459
|
+
function labelFromFragment(fragment) {
|
|
49460
|
+
return fragment ? fragment.split("#")[1] : null;
|
|
49461
|
+
}
|
|
49462
|
+
function isTooGeneric(fragment) {
|
|
49463
|
+
const genericFragments = ["#it", "#this", "#me", "#i"];
|
|
49464
|
+
return genericFragments.includes(fragment);
|
|
49465
|
+
}
|
|
49466
|
+
function getFilename(url7) {
|
|
49467
|
+
if (url7.pathname.endsWith("/")) {
|
|
49468
|
+
const containerName = url7.pathname.split("/").at(-2);
|
|
49469
|
+
return containerName ? containerName + "/" : null;
|
|
49470
|
+
} else {
|
|
49471
|
+
return url7.pathname.split("/").pop();
|
|
49472
|
+
}
|
|
49473
|
+
}
|
|
49474
|
+
|
|
48938
49475
|
// src/thing/Thing.ts
|
|
48939
49476
|
var Thing = class {
|
|
48940
49477
|
constructor(uri6, store, editable = false) {
|
|
@@ -48956,13 +49493,17 @@ var PodOS = (() => {
|
|
|
48956
49493
|
"http://schema.org/caption",
|
|
48957
49494
|
"https://schema.org/caption"
|
|
48958
49495
|
);
|
|
48959
|
-
|
|
49496
|
+
if (value6) {
|
|
49497
|
+
return value6;
|
|
49498
|
+
}
|
|
49499
|
+
return labelFromUri(this.uri);
|
|
48960
49500
|
}
|
|
48961
49501
|
literals() {
|
|
48962
49502
|
const statements = this.store.statementsMatching(namedNode2(this.uri));
|
|
48963
49503
|
const values = statements.filter((it) => isLiteral(it.object)).reduce(accumulateValues, {});
|
|
48964
49504
|
return Object.keys(values).map((predicate2) => ({
|
|
48965
49505
|
predicate: predicate2,
|
|
49506
|
+
label: labelFromUri(predicate2),
|
|
48966
49507
|
values: values[predicate2]
|
|
48967
49508
|
}));
|
|
48968
49509
|
}
|
|
@@ -48971,6 +49512,7 @@ var PodOS = (() => {
|
|
|
48971
49512
|
const values = statements.filter((it) => isNamedNode(it.object) && !isRdfType(it.predicate)).reduce(accumulateValues, {});
|
|
48972
49513
|
return Object.keys(values).map((predicate2) => ({
|
|
48973
49514
|
predicate: predicate2,
|
|
49515
|
+
label: labelFromUri(predicate2),
|
|
48974
49516
|
uris: values[predicate2]
|
|
48975
49517
|
}));
|
|
48976
49518
|
}
|
|
@@ -48983,6 +49525,7 @@ var PodOS = (() => {
|
|
|
48983
49525
|
const values = statements.reduce(accumulateSubjects, {});
|
|
48984
49526
|
return Object.keys(values).map((predicate2) => ({
|
|
48985
49527
|
predicate: predicate2,
|
|
49528
|
+
label: labelFromUri(predicate2),
|
|
48986
49529
|
uris: values[predicate2]
|
|
48987
49530
|
}));
|
|
48988
49531
|
}
|
|
@@ -49306,7 +49849,7 @@ var PodOS = (() => {
|
|
|
49306
49849
|
foaf: () => foaf,
|
|
49307
49850
|
http: () => http,
|
|
49308
49851
|
hydra: () => hydra,
|
|
49309
|
-
ldp: () =>
|
|
49852
|
+
ldp: () => ldp2,
|
|
49310
49853
|
link: () => link3,
|
|
49311
49854
|
log: () => log2,
|
|
49312
49855
|
meeting: () => meeting,
|
|
@@ -49413,7 +49956,7 @@ var PodOS = (() => {
|
|
|
49413
49956
|
var replies = "http://www.w3.org/ns/activitystreams#replies";
|
|
49414
49957
|
var result = "http://www.w3.org/ns/activitystreams#result";
|
|
49415
49958
|
var audience = "http://www.w3.org/ns/activitystreams#audience";
|
|
49416
|
-
var
|
|
49959
|
+
var tag2 = "http://www.w3.org/ns/activitystreams#tag";
|
|
49417
49960
|
var tags = "http://www.w3.org/ns/activitystreams#tags";
|
|
49418
49961
|
var target = "http://www.w3.org/ns/activitystreams#target";
|
|
49419
49962
|
var origin2 = "http://www.w3.org/ns/activitystreams#origin";
|
|
@@ -49531,7 +50074,7 @@ var PodOS = (() => {
|
|
|
49531
50074
|
replies,
|
|
49532
50075
|
result,
|
|
49533
50076
|
audience,
|
|
49534
|
-
tag,
|
|
50077
|
+
tag: tag2,
|
|
49535
50078
|
tags,
|
|
49536
50079
|
target,
|
|
49537
50080
|
origin: origin2,
|
|
@@ -53982,7 +54525,7 @@ var PodOS = (() => {
|
|
|
53982
54525
|
var _identified = "http://hl7.org/fhir/_identified";
|
|
53983
54526
|
var ExplanationOfBenefitAdjudication = "http://hl7.org/fhir/ExplanationOfBenefitAdjudication";
|
|
53984
54527
|
var _Subscription = "http://hl7.org/fhir/_Subscription";
|
|
53985
|
-
var
|
|
54528
|
+
var tag3 = "http://hl7.org/fhir/tag";
|
|
53986
54529
|
var _performed = "http://hl7.org/fhir/_performed";
|
|
53987
54530
|
var _formOf = "http://hl7.org/fhir/_formOf";
|
|
53988
54531
|
var DeviceDefinitionPackagingComponentPackagingPackaging = "http://hl7.org/fhir/DeviceDefinitionPackagingComponentPackagingPackaging";
|
|
@@ -58215,7 +58758,7 @@ var PodOS = (() => {
|
|
|
58215
58758
|
_identified,
|
|
58216
58759
|
ExplanationOfBenefitAdjudication,
|
|
58217
58760
|
_Subscription,
|
|
58218
|
-
tag:
|
|
58761
|
+
tag: tag3,
|
|
58219
58762
|
_performed,
|
|
58220
58763
|
_formOf,
|
|
58221
58764
|
DeviceDefinitionPackagingComponentPackagingPackaging,
|
|
@@ -58819,7 +59362,7 @@ var PodOS = (() => {
|
|
|
58819
59362
|
var Mailbox = "http://www.w3.org/2007/ont/link#Mailbox";
|
|
58820
59363
|
var ProtocolEvent = "http://www.w3.org/2007/ont/link#ProtocolEvent";
|
|
58821
59364
|
var RDFDocument = "http://www.w3.org/2007/ont/link#RDFDocument";
|
|
58822
|
-
var
|
|
59365
|
+
var Response = "http://www.w3.org/2007/ont/link#Response";
|
|
58823
59366
|
var Session3 = "http://www.w3.org/2007/ont/link#Session";
|
|
58824
59367
|
var isMentionedIn = "http://www.w3.org/2007/ont/link#isMentionedIn";
|
|
58825
59368
|
var mentionsClass = "http://www.w3.org/2007/ont/link#mentionsClass";
|
|
@@ -58839,7 +59382,7 @@ var PodOS = (() => {
|
|
|
58839
59382
|
Mailbox,
|
|
58840
59383
|
ProtocolEvent,
|
|
58841
59384
|
RDFDocument,
|
|
58842
|
-
Response
|
|
59385
|
+
Response,
|
|
58843
59386
|
Session: Session3,
|
|
58844
59387
|
isMentionedIn,
|
|
58845
59388
|
mentionsClass,
|
|
@@ -69105,7 +69648,7 @@ var PodOS = (() => {
|
|
|
69105
69648
|
var Mailbox2 = "http://www.w3.org/2007/ont/link#Mailbox";
|
|
69106
69649
|
var ProtocolEvent2 = "http://www.w3.org/2007/ont/link#ProtocolEvent";
|
|
69107
69650
|
var RDFDocument2 = "http://www.w3.org/2007/ont/link#RDFDocument";
|
|
69108
|
-
var
|
|
69651
|
+
var Response2 = "http://www.w3.org/2007/ont/link#Response";
|
|
69109
69652
|
var Session4 = "http://www.w3.org/2007/ont/link#Session";
|
|
69110
69653
|
var isMentionedIn2 = "http://www.w3.org/2007/ont/link#isMentionedIn";
|
|
69111
69654
|
var mentionsClass2 = "http://www.w3.org/2007/ont/link#mentionsClass";
|
|
@@ -69125,7 +69668,7 @@ var PodOS = (() => {
|
|
|
69125
69668
|
Mailbox: Mailbox2,
|
|
69126
69669
|
ProtocolEvent: ProtocolEvent2,
|
|
69127
69670
|
RDFDocument: RDFDocument2,
|
|
69128
|
-
Response:
|
|
69671
|
+
Response: Response2,
|
|
69129
69672
|
Session: Session4,
|
|
69130
69673
|
isMentionedIn: isMentionedIn2,
|
|
69131
69674
|
mentionsClass: mentionsClass2,
|
|
@@ -69147,7 +69690,7 @@ var PodOS = (() => {
|
|
|
69147
69690
|
var Mailbox3 = "http://www.w3.org/2007/ont/link#Mailbox";
|
|
69148
69691
|
var ProtocolEvent3 = "http://www.w3.org/2007/ont/link#ProtocolEvent";
|
|
69149
69692
|
var RDFDocument3 = "http://www.w3.org/2007/ont/link#RDFDocument";
|
|
69150
|
-
var
|
|
69693
|
+
var Response3 = "http://www.w3.org/2007/ont/link#Response";
|
|
69151
69694
|
var Session5 = "http://www.w3.org/2007/ont/link#Session";
|
|
69152
69695
|
var isMentionedIn3 = "http://www.w3.org/2007/ont/link#isMentionedIn";
|
|
69153
69696
|
var mentionsClass3 = "http://www.w3.org/2007/ont/link#mentionsClass";
|
|
@@ -69167,7 +69710,7 @@ var PodOS = (() => {
|
|
|
69167
69710
|
Mailbox: Mailbox3,
|
|
69168
69711
|
ProtocolEvent: ProtocolEvent3,
|
|
69169
69712
|
RDFDocument: RDFDocument3,
|
|
69170
|
-
Response:
|
|
69713
|
+
Response: Response3,
|
|
69171
69714
|
Session: Session5,
|
|
69172
69715
|
isMentionedIn: isMentionedIn3,
|
|
69173
69716
|
mentionsClass: mentionsClass3,
|
|
@@ -69555,7 +70098,7 @@ var PodOS = (() => {
|
|
|
69555
70098
|
var foaf = foafImport;
|
|
69556
70099
|
var http = httpImport;
|
|
69557
70100
|
var hydra = hydraImport;
|
|
69558
|
-
var
|
|
70101
|
+
var ldp2 = ldpImport;
|
|
69559
70102
|
var link3 = linkImport;
|
|
69560
70103
|
var log2 = logImport;
|
|
69561
70104
|
var meeting = meetingImport;
|