@pod-os/core 0.11.2-dec48f2.0 → 0.11.2-e654d19.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/lib/index.js CHANGED
@@ -406,83 +406,6 @@ var PodOS = (() => {
406
406
  }
407
407
  });
408
408
 
409
- // ../node_modules/uuid/dist/esm-browser/rng.js
410
- function rng() {
411
- if (!getRandomValues) {
412
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
413
- if (!getRandomValues) {
414
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
415
- }
416
- }
417
- return getRandomValues(rnds8);
418
- }
419
- var getRandomValues, rnds8;
420
- var init_rng = __esm({
421
- "../node_modules/uuid/dist/esm-browser/rng.js"() {
422
- rnds8 = new Uint8Array(16);
423
- }
424
- });
425
-
426
- // ../node_modules/uuid/dist/esm-browser/stringify.js
427
- function unsafeStringify(arr, offset3 = 0) {
428
- 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]];
429
- }
430
- var byteToHex;
431
- var init_stringify = __esm({
432
- "../node_modules/uuid/dist/esm-browser/stringify.js"() {
433
- byteToHex = [];
434
- for (let i = 0; i < 256; ++i) {
435
- byteToHex.push((i + 256).toString(16).slice(1));
436
- }
437
- }
438
- });
439
-
440
- // ../node_modules/uuid/dist/esm-browser/native.js
441
- var randomUUID, native_default;
442
- var init_native = __esm({
443
- "../node_modules/uuid/dist/esm-browser/native.js"() {
444
- randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
445
- native_default = {
446
- randomUUID
447
- };
448
- }
449
- });
450
-
451
- // ../node_modules/uuid/dist/esm-browser/v4.js
452
- function v4(options, buf, offset3) {
453
- if (native_default.randomUUID && !buf && !options) {
454
- return native_default.randomUUID();
455
- }
456
- options = options || {};
457
- const rnds = options.random || (options.rng || rng)();
458
- rnds[6] = rnds[6] & 15 | 64;
459
- rnds[8] = rnds[8] & 63 | 128;
460
- if (buf) {
461
- offset3 = offset3 || 0;
462
- for (let i = 0; i < 16; ++i) {
463
- buf[offset3 + i] = rnds[i];
464
- }
465
- return buf;
466
- }
467
- return unsafeStringify(rnds);
468
- }
469
- var v4_default;
470
- var init_v4 = __esm({
471
- "../node_modules/uuid/dist/esm-browser/v4.js"() {
472
- init_native();
473
- init_rng();
474
- init_stringify();
475
- v4_default = v4;
476
- }
477
- });
478
-
479
- // ../node_modules/uuid/dist/esm-browser/index.js
480
- var init_esm_browser = __esm({
481
- "../node_modules/uuid/dist/esm-browser/index.js"() {
482
- init_v4();
483
- }
484
- });
485
-
486
409
  // ../node_modules/@inrupt/oidc-client/lib/oidc-client.min.js
487
410
  var require_oidc_client_min = __commonJS({
488
411
  "../node_modules/@inrupt/oidc-client/lib/oidc-client.min.js"(exports, module3) {
@@ -42495,23 +42418,372 @@ var PodOS = (() => {
42495
42418
  });
42496
42419
 
42497
42420
  // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/namespaces.js
42498
- var rdf3, vcard, dc;
42421
+ var rdf3, vcard, solid, pim, dc;
42499
42422
  var init_namespaces = __esm({
42500
42423
  "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/namespaces.js"() {
42501
42424
  init_esm();
42502
42425
  rdf3 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
42503
42426
  vcard = Namespace("http://www.w3.org/2006/vcard/ns#");
42427
+ solid = Namespace("http://www.w3.org/ns/solid/terms#");
42428
+ pim = Namespace("http://www.w3.org/ns/pim/space#");
42504
42429
  dc = Namespace("http://purl.org/dc/elements/1.1/");
42505
42430
  }
42506
42431
  });
42507
42432
 
42433
+ // ../node_modules/short-unique-id/dist/short-unique-id.js
42434
+ var require_short_unique_id = __commonJS({
42435
+ "../node_modules/short-unique-id/dist/short-unique-id.js"(exports, module3) {
42436
+ "use strict";
42437
+ var ShortUniqueId2 = (() => {
42438
+ var __defProp2 = Object.defineProperty;
42439
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
42440
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
42441
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
42442
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
42443
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
42444
+ var __defNormalProp = (obj, key3, value6) => key3 in obj ? __defProp2(obj, key3, { enumerable: true, configurable: true, writable: true, value: value6 }) : obj[key3] = value6;
42445
+ var __spreadValues = (a, b) => {
42446
+ for (var prop in b || (b = {}))
42447
+ if (__hasOwnProp2.call(b, prop))
42448
+ __defNormalProp(a, prop, b[prop]);
42449
+ if (__getOwnPropSymbols)
42450
+ for (var prop of __getOwnPropSymbols(b)) {
42451
+ if (__propIsEnum.call(b, prop))
42452
+ __defNormalProp(a, prop, b[prop]);
42453
+ }
42454
+ return a;
42455
+ };
42456
+ var __export2 = (target5, all) => {
42457
+ for (var name7 in all)
42458
+ __defProp2(target5, name7, { get: all[name7], enumerable: true });
42459
+ };
42460
+ var __copyProps2 = (to2, from, except, desc) => {
42461
+ if (from && typeof from === "object" || typeof from === "function") {
42462
+ for (let key3 of __getOwnPropNames2(from))
42463
+ if (!__hasOwnProp2.call(to2, key3) && key3 !== except)
42464
+ __defProp2(to2, key3, { get: () => from[key3], enumerable: !(desc = __getOwnPropDesc2(from, key3)) || desc.enumerable });
42465
+ }
42466
+ return to2;
42467
+ };
42468
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
42469
+ var __publicField = (obj, key3, value6) => {
42470
+ __defNormalProp(obj, typeof key3 !== "symbol" ? key3 + "" : key3, value6);
42471
+ return value6;
42472
+ };
42473
+ var src_exports2 = {};
42474
+ __export2(src_exports2, {
42475
+ DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
42476
+ DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
42477
+ default: () => ShortUniqueId3
42478
+ });
42479
+ var version6 = "5.0.3";
42480
+ var DEFAULT_UUID_LENGTH = 6;
42481
+ var DEFAULT_OPTIONS = {
42482
+ dictionary: "alphanum",
42483
+ shuffle: true,
42484
+ debug: false,
42485
+ length: DEFAULT_UUID_LENGTH,
42486
+ counter: 0
42487
+ };
42488
+ var _ShortUniqueId = class _ShortUniqueId {
42489
+ constructor(argOptions = {}) {
42490
+ __publicField(this, "counter");
42491
+ __publicField(this, "debug");
42492
+ __publicField(this, "dict");
42493
+ __publicField(this, "version");
42494
+ __publicField(this, "dictIndex", 0);
42495
+ __publicField(this, "dictRange", []);
42496
+ __publicField(this, "lowerBound", 0);
42497
+ __publicField(this, "upperBound", 0);
42498
+ __publicField(this, "dictLength", 0);
42499
+ __publicField(this, "uuidLength");
42500
+ __publicField(this, "_digit_first_ascii", 48);
42501
+ __publicField(this, "_digit_last_ascii", 58);
42502
+ __publicField(this, "_alpha_lower_first_ascii", 97);
42503
+ __publicField(this, "_alpha_lower_last_ascii", 123);
42504
+ __publicField(this, "_hex_last_ascii", 103);
42505
+ __publicField(this, "_alpha_upper_first_ascii", 65);
42506
+ __publicField(this, "_alpha_upper_last_ascii", 91);
42507
+ __publicField(this, "_number_dict_ranges", {
42508
+ digits: [this._digit_first_ascii, this._digit_last_ascii]
42509
+ });
42510
+ __publicField(this, "_alpha_dict_ranges", {
42511
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
42512
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
42513
+ });
42514
+ __publicField(this, "_alpha_lower_dict_ranges", {
42515
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
42516
+ });
42517
+ __publicField(this, "_alpha_upper_dict_ranges", {
42518
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
42519
+ });
42520
+ __publicField(this, "_alphanum_dict_ranges", {
42521
+ digits: [this._digit_first_ascii, this._digit_last_ascii],
42522
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
42523
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
42524
+ });
42525
+ __publicField(this, "_alphanum_lower_dict_ranges", {
42526
+ digits: [this._digit_first_ascii, this._digit_last_ascii],
42527
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
42528
+ });
42529
+ __publicField(this, "_alphanum_upper_dict_ranges", {
42530
+ digits: [this._digit_first_ascii, this._digit_last_ascii],
42531
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
42532
+ });
42533
+ __publicField(this, "_hex_dict_ranges", {
42534
+ decDigits: [this._digit_first_ascii, this._digit_last_ascii],
42535
+ alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
42536
+ });
42537
+ __publicField(this, "_dict_ranges", {
42538
+ _number_dict_ranges: this._number_dict_ranges,
42539
+ _alpha_dict_ranges: this._alpha_dict_ranges,
42540
+ _alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
42541
+ _alpha_upper_dict_ranges: this._alpha_upper_dict_ranges,
42542
+ _alphanum_dict_ranges: this._alphanum_dict_ranges,
42543
+ _alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
42544
+ _alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
42545
+ _hex_dict_ranges: this._hex_dict_ranges
42546
+ });
42547
+ __publicField(this, "log", (...args) => {
42548
+ const finalArgs = [...args];
42549
+ finalArgs[0] = `[short-unique-id] ${args[0]}`;
42550
+ if (this.debug === true) {
42551
+ if (typeof console !== "undefined" && console !== null) {
42552
+ return console.log(...finalArgs);
42553
+ }
42554
+ }
42555
+ });
42556
+ __publicField(this, "setDictionary", (dictionary2, shuffle2) => {
42557
+ let finalDict;
42558
+ if (dictionary2 && Array.isArray(dictionary2) && dictionary2.length > 1) {
42559
+ finalDict = dictionary2;
42560
+ } else {
42561
+ finalDict = [];
42562
+ let i;
42563
+ this.dictIndex = i = 0;
42564
+ const rangesName = `_${dictionary2}_dict_ranges`;
42565
+ const ranges = this._dict_ranges[rangesName];
42566
+ Object.keys(ranges).forEach((rangeType) => {
42567
+ const rangeTypeKey = rangeType;
42568
+ this.dictRange = ranges[rangeTypeKey];
42569
+ this.lowerBound = this.dictRange[0];
42570
+ this.upperBound = this.dictRange[1];
42571
+ for (this.dictIndex = i = this.lowerBound; this.lowerBound <= this.upperBound ? i < this.upperBound : i > this.upperBound; this.dictIndex = this.lowerBound <= this.upperBound ? i += 1 : i -= 1) {
42572
+ finalDict.push(String.fromCharCode(this.dictIndex));
42573
+ }
42574
+ });
42575
+ }
42576
+ if (shuffle2) {
42577
+ const PROBABILITY = 0.5;
42578
+ finalDict = finalDict.sort(() => Math.random() - PROBABILITY);
42579
+ }
42580
+ this.dict = finalDict;
42581
+ this.dictLength = this.dict.length;
42582
+ this.setCounter(0);
42583
+ });
42584
+ __publicField(this, "seq", () => {
42585
+ return this.sequentialUUID();
42586
+ });
42587
+ __publicField(this, "sequentialUUID", () => {
42588
+ let counterDiv;
42589
+ let counterRem;
42590
+ let id6 = "";
42591
+ counterDiv = this.counter;
42592
+ do {
42593
+ counterRem = counterDiv % this.dictLength;
42594
+ counterDiv = Math.trunc(counterDiv / this.dictLength);
42595
+ id6 += this.dict[counterRem];
42596
+ } while (counterDiv !== 0);
42597
+ this.counter += 1;
42598
+ return id6;
42599
+ });
42600
+ __publicField(this, "rnd", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
42601
+ return this.randomUUID(uuidLength);
42602
+ });
42603
+ __publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
42604
+ let id6;
42605
+ let randomPartIdx;
42606
+ let j;
42607
+ if (uuidLength === null || typeof uuidLength === "undefined" || uuidLength < 1) {
42608
+ throw new Error("Invalid UUID Length Provided");
42609
+ }
42610
+ const isPositive = uuidLength >= 0;
42611
+ id6 = "";
42612
+ for (j = 0; j < uuidLength; j += 1) {
42613
+ randomPartIdx = parseInt(
42614
+ (Math.random() * this.dictLength).toFixed(0),
42615
+ 10
42616
+ ) % this.dictLength;
42617
+ id6 += this.dict[randomPartIdx];
42618
+ }
42619
+ return id6;
42620
+ });
42621
+ __publicField(this, "fmt", (format4, date5) => {
42622
+ return this.formattedUUID(format4, date5);
42623
+ });
42624
+ __publicField(this, "formattedUUID", (format4, date5) => {
42625
+ const fnMap = {
42626
+ "$r": this.randomUUID,
42627
+ "$s": this.sequentialUUID,
42628
+ "$t": this.stamp
42629
+ };
42630
+ const result5 = format4.replace(
42631
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
42632
+ (m) => {
42633
+ const fn2 = m.slice(0, 2);
42634
+ const len = parseInt(m.slice(2), 10);
42635
+ if (fn2 === "$s") {
42636
+ return fnMap[fn2]().padStart(len, "0");
42637
+ }
42638
+ if (fn2 === "$t" && date5) {
42639
+ return fnMap[fn2](len, date5);
42640
+ }
42641
+ return fnMap[fn2](len);
42642
+ }
42643
+ );
42644
+ return result5;
42645
+ });
42646
+ __publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
42647
+ return parseFloat(
42648
+ Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
42649
+ );
42650
+ });
42651
+ __publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
42652
+ return parseFloat(
42653
+ Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
42654
+ );
42655
+ });
42656
+ __publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
42657
+ return parseFloat(
42658
+ (this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
42659
+ );
42660
+ });
42661
+ __publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
42662
+ const score2 = parseFloat(
42663
+ (1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
42664
+ );
42665
+ return score2 > 1 ? 1 : score2 < 0 ? 0 : score2;
42666
+ });
42667
+ __publicField(this, "getVersion", () => {
42668
+ return this.version;
42669
+ });
42670
+ __publicField(this, "stamp", (finalLength, date5) => {
42671
+ const hexStamp = Math.floor(+(date5 || /* @__PURE__ */ new Date()) / 1e3).toString(16);
42672
+ if (typeof finalLength === "number" && finalLength === 0) {
42673
+ return hexStamp;
42674
+ }
42675
+ if (typeof finalLength !== "number" || finalLength < 10) {
42676
+ throw new Error(
42677
+ [
42678
+ "Param finalLength must be a number greater than or equal to 10,",
42679
+ "or 0 if you want the raw hexadecimal timestamp"
42680
+ ].join("\n")
42681
+ );
42682
+ }
42683
+ const idLength = finalLength - 9;
42684
+ const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
42685
+ const id6 = this.randomUUID(idLength);
42686
+ return `${id6.substring(0, rndIdx)}${hexStamp}${id6.substring(rndIdx)}${rndIdx.toString(16)}`;
42687
+ });
42688
+ __publicField(this, "parseStamp", (suid, format4) => {
42689
+ if (format4 && !/t0|t[1-9]\d{1,}/.test(format4)) {
42690
+ throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
42691
+ }
42692
+ const stamp = format4 ? format4.replace(
42693
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
42694
+ (m) => {
42695
+ const fnMap = {
42696
+ "$r": (len2) => [...Array(len2)].map(() => "r").join(""),
42697
+ "$s": (len2) => [...Array(len2)].map(() => "s").join(""),
42698
+ "$t": (len2) => [...Array(len2)].map(() => "t").join("")
42699
+ };
42700
+ const fn2 = m.slice(0, 2);
42701
+ const len = parseInt(m.slice(2), 10);
42702
+ return fnMap[fn2](len);
42703
+ }
42704
+ ).replace(
42705
+ /^(.*?)(t{8,})(.*)$/g,
42706
+ (_m, p1, p2) => {
42707
+ return suid.substring(p1.length, p1.length + p2.length);
42708
+ }
42709
+ ) : suid;
42710
+ if (stamp.length === 8) {
42711
+ return new Date(parseInt(stamp, 16) * 1e3);
42712
+ }
42713
+ if (stamp.length < 10) {
42714
+ throw new Error("Stamp length invalid");
42715
+ }
42716
+ const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
42717
+ return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
42718
+ });
42719
+ __publicField(this, "setCounter", (counter2) => {
42720
+ this.counter = counter2;
42721
+ });
42722
+ const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
42723
+ this.counter = 0;
42724
+ this.debug = false;
42725
+ this.dict = [];
42726
+ this.version = version6;
42727
+ const {
42728
+ dictionary,
42729
+ shuffle,
42730
+ length: length2,
42731
+ counter
42732
+ } = options;
42733
+ this.uuidLength = length2;
42734
+ this.setDictionary(dictionary, shuffle);
42735
+ this.setCounter(counter);
42736
+ this.debug = options.debug;
42737
+ this.log(this.dict);
42738
+ this.log(
42739
+ `Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
42740
+ );
42741
+ this.log = this.log.bind(this);
42742
+ this.setDictionary = this.setDictionary.bind(this);
42743
+ this.setCounter = this.setCounter.bind(this);
42744
+ this.seq = this.seq.bind(this);
42745
+ this.sequentialUUID = this.sequentialUUID.bind(this);
42746
+ this.rnd = this.rnd.bind(this);
42747
+ this.randomUUID = this.randomUUID.bind(this);
42748
+ this.fmt = this.fmt.bind(this);
42749
+ this.formattedUUID = this.formattedUUID.bind(this);
42750
+ this.availableUUIDs = this.availableUUIDs.bind(this);
42751
+ this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this);
42752
+ this.collisionProbability = this.collisionProbability.bind(this);
42753
+ this.uniqueness = this.uniqueness.bind(this);
42754
+ this.getVersion = this.getVersion.bind(this);
42755
+ this.stamp = this.stamp.bind(this);
42756
+ this.parseStamp = this.parseStamp.bind(this);
42757
+ return this;
42758
+ }
42759
+ };
42760
+ __publicField(_ShortUniqueId, "default", _ShortUniqueId);
42761
+ var ShortUniqueId3 = _ShortUniqueId;
42762
+ return __toCommonJS2(src_exports2);
42763
+ })();
42764
+ "undefined" != typeof module3 && (module3.exports = ShortUniqueId2.default), "undefined" != typeof window && (ShortUniqueId2 = ShortUniqueId2.default);
42765
+ }
42766
+ });
42767
+
42768
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/generate-id.js
42769
+ function generateId() {
42770
+ return uid.rnd(6);
42771
+ }
42772
+ var import_short_unique_id, uid;
42773
+ var init_generate_id = __esm({
42774
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/generate-id.js"() {
42775
+ import_short_unique_id = __toESM(require_short_unique_id(), 1);
42776
+ uid = new import_short_unique_id.default({ length: 10 });
42777
+ }
42778
+ });
42779
+
42508
42780
  // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/AddressBookQuery.js
42509
42781
  var AddressBookQuery;
42510
42782
  var init_AddressBookQuery = __esm({
42511
42783
  "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/AddressBookQuery.js"() {
42512
42784
  init_esm();
42513
42785
  init_namespaces();
42514
- init_esm_browser();
42786
+ init_generate_id();
42515
42787
  AddressBookQuery = class {
42516
42788
  constructor(store, addressBookNode) {
42517
42789
  this.store = store;
@@ -42525,7 +42797,7 @@ var PodOS = (() => {
42525
42797
  return this.proposeNewNode("Group");
42526
42798
  }
42527
42799
  proposeNewNode(containerPath) {
42528
- const id6 = v4_default();
42800
+ const id6 = generateId();
42529
42801
  const baseUri = this.addressBookNode.dir()?.uri;
42530
42802
  return namedNode2(`${baseUri}${containerPath}/${id6}/index.ttl#this`);
42531
42803
  }
@@ -42639,7 +42911,7 @@ var PodOS = (() => {
42639
42911
 
42640
42912
  // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/createAddressBook.js
42641
42913
  function createAddressBook(container2, name7) {
42642
- const id6 = v4_default();
42914
+ const id6 = generateId();
42643
42915
  const uri6 = `${container2}${id6}/index.ttl#this`;
42644
42916
  const nameEmailIndexUri = `${container2}${id6}/people.ttl`;
42645
42917
  const groupIndexUri = `${container2}${id6}/groups.ttl`;
@@ -42659,8 +42931,8 @@ var PodOS = (() => {
42659
42931
  var init_createAddressBook = __esm({
42660
42932
  "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/createAddressBook.js"() {
42661
42933
  init_esm();
42662
- init_esm_browser();
42663
42934
  init_namespaces();
42935
+ init_generate_id();
42664
42936
  }
42665
42937
  });
42666
42938
 
@@ -42831,6 +43103,169 @@ var PodOS = (() => {
42831
43103
  }
42832
43104
  });
42833
43105
 
43106
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewPhoneNumber.js
43107
+ function addNewPhoneNumber(contactNode, phoneNumber) {
43108
+ const id6 = generateId();
43109
+ const uri6 = `${contactNode.doc().uri}#${id6}`;
43110
+ return {
43111
+ uri: uri6,
43112
+ insertions: [
43113
+ st2(contactNode, vcard("hasTelephone"), namedNode2(uri6), contactNode.doc()),
43114
+ st2(namedNode2(uri6), vcard("value"), namedNode2("tel:" + phoneNumber), contactNode.doc())
43115
+ ],
43116
+ deletions: [],
43117
+ filesToCreate: []
43118
+ };
43119
+ }
43120
+ var init_addNewPhoneNumber = __esm({
43121
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewPhoneNumber.js"() {
43122
+ init_esm();
43123
+ init_generate_id();
43124
+ init_namespaces();
43125
+ }
43126
+ });
43127
+
43128
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewEmailAddress.js
43129
+ function addNewEmailAddress(contactNode, emailAddress) {
43130
+ const id6 = generateId();
43131
+ const uri6 = `${contactNode.doc().uri}#${id6}`;
43132
+ return {
43133
+ uri: uri6,
43134
+ insertions: [
43135
+ st2(contactNode, vcard("hasEmail"), namedNode2(uri6), contactNode.doc()),
43136
+ st2(namedNode2(uri6), vcard("value"), namedNode2("mailto:" + emailAddress), contactNode.doc())
43137
+ ],
43138
+ deletions: [],
43139
+ filesToCreate: []
43140
+ };
43141
+ }
43142
+ var init_addNewEmailAddress = __esm({
43143
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/addNewEmailAddress.js"() {
43144
+ init_esm();
43145
+ init_generate_id();
43146
+ init_namespaces();
43147
+ }
43148
+ });
43149
+
43150
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removePhoneNumber.js
43151
+ function removePhoneNumber(contactNode, phoneNode, store) {
43152
+ const phoneStatements = store.statementsMatching(phoneNode, null, null, phoneNode.doc());
43153
+ return {
43154
+ uri: "",
43155
+ insertions: [],
43156
+ deletions: [
43157
+ ...phoneStatements,
43158
+ st2(contactNode, vcard("hasTelephone"), phoneNode, contactNode.doc())
43159
+ ],
43160
+ filesToCreate: []
43161
+ };
43162
+ }
43163
+ var init_removePhoneNumber = __esm({
43164
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removePhoneNumber.js"() {
43165
+ init_esm();
43166
+ init_namespaces();
43167
+ }
43168
+ });
43169
+
43170
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removeEmailAddress.js
43171
+ function removeEmailAddress(contactNode, emailNode, store) {
43172
+ const emailStatements = store.statementsMatching(emailNode, null, null, emailNode.doc());
43173
+ return {
43174
+ uri: "",
43175
+ insertions: [],
43176
+ deletions: [
43177
+ ...emailStatements,
43178
+ st2(contactNode, vcard("hasEmail"), emailNode, contactNode.doc())
43179
+ ],
43180
+ filesToCreate: []
43181
+ };
43182
+ }
43183
+ var init_removeEmailAddress = __esm({
43184
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/update-operations/removeEmailAddress.js"() {
43185
+ init_esm();
43186
+ init_namespaces();
43187
+ }
43188
+ });
43189
+
43190
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/ProfileQuery.js
43191
+ var ProfileQuery;
43192
+ var init_ProfileQuery = __esm({
43193
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/ProfileQuery.js"() {
43194
+ init_esm();
43195
+ init_namespaces();
43196
+ ProfileQuery = class {
43197
+ constructor(webIdNode, store) {
43198
+ this.webIdNode = webIdNode;
43199
+ this.store = store;
43200
+ }
43201
+ queryPublicTypeIndex() {
43202
+ const predicate2 = solid("publicTypeIndex");
43203
+ return this.queryNamedNode(predicate2);
43204
+ }
43205
+ queryPreferencesFile() {
43206
+ const predicate2 = pim("preferencesFile");
43207
+ return this.queryNamedNode(predicate2);
43208
+ }
43209
+ queryNamedNode(predicate2) {
43210
+ const node2 = this.store.any(this.webIdNode, predicate2, null, this.webIdNode.doc());
43211
+ if (isNamedNode(node2)) {
43212
+ return node2;
43213
+ }
43214
+ return null;
43215
+ }
43216
+ };
43217
+ }
43218
+ });
43219
+
43220
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/TypeIndexQuery.js
43221
+ var TypeIndexQuery;
43222
+ var init_TypeIndexQuery = __esm({
43223
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/TypeIndexQuery.js"() {
43224
+ init_esm();
43225
+ init_namespaces();
43226
+ TypeIndexQuery = class {
43227
+ constructor(store, typeIndexDoc) {
43228
+ this.store = store;
43229
+ this.typeIndexDoc = typeIndexDoc;
43230
+ }
43231
+ queryAddressBookInstances() {
43232
+ const addressBookRegistrations = this.store.each(null, solid("forClass"), vcard("AddressBook"), this.typeIndexDoc);
43233
+ return addressBookRegistrations.flatMap((registration) => {
43234
+ if (!isNamedNode(registration))
43235
+ return [];
43236
+ return this.getInstanceValues(registration);
43237
+ });
43238
+ }
43239
+ getInstanceValues(registration) {
43240
+ return this.store.each(registration, solid("instance"), null, this.typeIndexDoc).map((it) => it.value);
43241
+ }
43242
+ };
43243
+ }
43244
+ });
43245
+
43246
+ // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/PreferencesQuery.js
43247
+ var PreferencesQuery;
43248
+ var init_PreferencesQuery = __esm({
43249
+ "../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/queries/PreferencesQuery.js"() {
43250
+ init_esm();
43251
+ init_namespaces();
43252
+ PreferencesQuery = class {
43253
+ constructor(store, webIdNode, preferencesDoc) {
43254
+ this.store = store;
43255
+ this.webIdNode = webIdNode;
43256
+ this.preferencesDoc = preferencesDoc;
43257
+ }
43258
+ queryPrivateTypeIndex() {
43259
+ const node2 = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
43260
+ if (isNamedNode(node2)) {
43261
+ return node2;
43262
+ }
43263
+ return null;
43264
+ }
43265
+ };
43266
+ }
43267
+ });
43268
+
42834
43269
  // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/ContactsModuleRdfLib.js
42835
43270
  var ContactsModuleRdfLib;
42836
43271
  var init_ContactsModuleRdfLib = __esm({
@@ -42844,6 +43279,13 @@ var PodOS = (() => {
42844
43279
  init_GroupQuery();
42845
43280
  init_addContactToGroup();
42846
43281
  init_removeContactFromGroup();
43282
+ init_addNewPhoneNumber();
43283
+ init_addNewEmailAddress();
43284
+ init_removePhoneNumber();
43285
+ init_removeEmailAddress();
43286
+ init_ProfileQuery();
43287
+ init_TypeIndexQuery();
43288
+ init_PreferencesQuery();
42847
43289
  ContactsModuleRdfLib = class {
42848
43290
  constructor(config) {
42849
43291
  this.store = config.store;
@@ -42956,6 +43398,65 @@ var PodOS = (() => {
42956
43398
  const operation3 = removeContactFromGroup(contactQuery, groupQuery);
42957
43399
  await executeUpdate(this.fetcher, this.updater, operation3);
42958
43400
  }
43401
+ async addNewPhoneNumber({ contactUri, newPhoneNumber }) {
43402
+ const contactNode = namedNode2(contactUri);
43403
+ const operation3 = addNewPhoneNumber(contactNode, newPhoneNumber);
43404
+ await executeUpdate(this.fetcher, this.updater, operation3);
43405
+ return operation3.uri;
43406
+ }
43407
+ async addNewEmailAddress({ contactUri, newEmailAddress }) {
43408
+ const contactNode = namedNode2(contactUri);
43409
+ const operation3 = addNewEmailAddress(contactNode, newEmailAddress);
43410
+ await executeUpdate(this.fetcher, this.updater, operation3);
43411
+ return operation3.uri;
43412
+ }
43413
+ async removePhoneNumber({ contactUri, phoneNumberUri }) {
43414
+ const contactNode = namedNode2(contactUri);
43415
+ const phoneNumberNode = namedNode2(phoneNumberUri);
43416
+ await this.fetchNode(phoneNumberNode);
43417
+ const operation3 = removePhoneNumber(contactNode, phoneNumberNode, this.store);
43418
+ await executeUpdate(this.fetcher, this.updater, operation3);
43419
+ }
43420
+ async removeEmailAddress({ contactUri, emailAddressUri }) {
43421
+ const contactNode = namedNode2(contactUri);
43422
+ const emailAddressNode = namedNode2(emailAddressUri);
43423
+ await this.fetchNode(emailAddressNode);
43424
+ const operation3 = removeEmailAddress(contactNode, emailAddressNode, this.store);
43425
+ await executeUpdate(this.fetcher, this.updater, operation3);
43426
+ }
43427
+ async listAddressBooks(webId) {
43428
+ const profileNode = namedNode2(webId);
43429
+ await this.fetchNode(profileNode);
43430
+ const profileQuery = new ProfileQuery(profileNode, this.store);
43431
+ const publicTypeIndexNode = profileQuery.queryPublicTypeIndex();
43432
+ const preferencesFile2 = profileQuery.queryPreferencesFile();
43433
+ const promisePublicUris = this.fetchIndexedAddressBooks(publicTypeIndexNode);
43434
+ const promisePrivateTypeIndex = this.fetchPrivateTypeIndex(profileNode, preferencesFile2);
43435
+ const [publicUris, privateTypeIndex2] = await Promise.allSettled([
43436
+ promisePublicUris,
43437
+ promisePrivateTypeIndex
43438
+ ]);
43439
+ const privateUris = privateTypeIndex2.status === "fulfilled" ? await this.fetchIndexedAddressBooks(privateTypeIndex2.value) : [];
43440
+ return {
43441
+ publicUris: publicUris.status === "fulfilled" ? publicUris.value : [],
43442
+ privateUris
43443
+ };
43444
+ }
43445
+ async fetchIndexedAddressBooks(publicTypeIndexNode) {
43446
+ if (!publicTypeIndexNode) {
43447
+ return [];
43448
+ }
43449
+ await this.fetchNode(publicTypeIndexNode);
43450
+ return new TypeIndexQuery(this.store, publicTypeIndexNode).queryAddressBookInstances();
43451
+ }
43452
+ async fetchPrivateTypeIndex(profileNode, preferencesFile2) {
43453
+ if (!preferencesFile2) {
43454
+ return null;
43455
+ }
43456
+ await this.fetchNode(preferencesFile2);
43457
+ const preferencesQuery = new PreferencesQuery(this.store, profileNode, preferencesFile2);
43458
+ return preferencesQuery.queryPrivateTypeIndex();
43459
+ }
42959
43460
  };
42960
43461
  }
42961
43462
  });
@@ -45998,8 +46499,55 @@ var PodOS = (() => {
45998
46499
  return generateKeyPair(alg, options);
45999
46500
  }
46000
46501
 
46502
+ // ../node_modules/uuid/dist/esm-browser/rng.js
46503
+ var getRandomValues;
46504
+ var rnds8 = new Uint8Array(16);
46505
+ function rng() {
46506
+ if (!getRandomValues) {
46507
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
46508
+ if (!getRandomValues) {
46509
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
46510
+ }
46511
+ }
46512
+ return getRandomValues(rnds8);
46513
+ }
46514
+
46515
+ // ../node_modules/uuid/dist/esm-browser/stringify.js
46516
+ var byteToHex = [];
46517
+ for (let i = 0; i < 256; ++i) {
46518
+ byteToHex.push((i + 256).toString(16).slice(1));
46519
+ }
46520
+ function unsafeStringify(arr, offset3 = 0) {
46521
+ 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]];
46522
+ }
46523
+
46524
+ // ../node_modules/uuid/dist/esm-browser/native.js
46525
+ var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
46526
+ var native_default = {
46527
+ randomUUID
46528
+ };
46529
+
46530
+ // ../node_modules/uuid/dist/esm-browser/v4.js
46531
+ function v4(options, buf, offset3) {
46532
+ if (native_default.randomUUID && !buf && !options) {
46533
+ return native_default.randomUUID();
46534
+ }
46535
+ options = options || {};
46536
+ const rnds = options.random || (options.rng || rng)();
46537
+ rnds[6] = rnds[6] & 15 | 64;
46538
+ rnds[8] = rnds[8] & 63 | 128;
46539
+ if (buf) {
46540
+ offset3 = offset3 || 0;
46541
+ for (let i = 0; i < 16; ++i) {
46542
+ buf[offset3 + i] = rnds[i];
46543
+ }
46544
+ return buf;
46545
+ }
46546
+ return unsafeStringify(rnds);
46547
+ }
46548
+ var v4_default = v4;
46549
+
46001
46550
  // ../node_modules/@inrupt/solid-client-authn-core/dist/index.mjs
46002
- init_esm_browser();
46003
46551
  var SOLID_CLIENT_AUTHN_KEY_PREFIX = "solidClientAuthn:";
46004
46552
  var PREFERRED_SIGNING_ALG = ["ES256", "RS256"];
46005
46553
  var EVENTS = {
@@ -46651,7 +47199,6 @@ var PodOS = (() => {
46651
47199
  }
46652
47200
 
46653
47201
  // ../node_modules/@inrupt/solid-client-authn-browser/dist/index.mjs
46654
- init_esm_browser();
46655
47202
  var import_events2 = __toESM(require_events(), 1);
46656
47203
 
46657
47204
  // ../node_modules/@inrupt/oidc-client-ext/dist/index.es.js
@@ -47773,9 +48320,9 @@ var PodOS = (() => {
47773
48320
  return this.session.logout();
47774
48321
  }
47775
48322
  trackSession(callback) {
47776
- this.session.onLogin(() => callback(this.session.info));
47777
- this.session.onLogout(() => callback(this.session.info));
47778
- this.session.onSessionRestore(() => callback(this.session.info));
48323
+ this.session.on(EVENTS.LOGIN, () => callback(this.session.info));
48324
+ this.session.on(EVENTS.LOGOUT, () => callback(this.session.info));
48325
+ this.session.on(EVENTS.SESSION_RESTORED, () => callback(this.session.info));
47779
48326
  callback(this.session.info);
47780
48327
  }
47781
48328
  };
@@ -48271,7 +48818,7 @@ var PodOS = (() => {
48271
48818
  sec: () => sec,
48272
48819
  sioc: () => sioc,
48273
48820
  skos: () => skos,
48274
- solid: () => solid,
48821
+ solid: () => solid2,
48275
48822
  space: () => space,
48276
48823
  tab: () => tab,
48277
48824
  tabont: () => tabont,
@@ -48624,7 +49171,7 @@ var PodOS = (() => {
48624
49171
  var DomainOf_rrule = "http://www.w3.org/2002/12/cal/ical#DomainOf_rrule";
48625
49172
  var relatedTo = "http://www.w3.org/2002/12/cal/ical#relatedTo";
48626
49173
  var url2 = "http://www.w3.org/2002/12/cal/ical#url";
48627
- var uid = "http://www.w3.org/2002/12/cal/ical#uid";
49174
+ var uid2 = "http://www.w3.org/2002/12/cal/ical#uid";
48628
49175
  var exdate = "http://www.w3.org/2002/12/cal/ical#exdate";
48629
49176
  var exrule = "http://www.w3.org/2002/12/cal/ical#exrule";
48630
49177
  var Value_RECUR = "http://www.w3.org/2002/12/cal/ical#Value_RECUR";
@@ -48684,7 +49231,7 @@ var PodOS = (() => {
48684
49231
  DomainOf_rrule,
48685
49232
  relatedTo,
48686
49233
  url: url2,
48687
- uid,
49234
+ uid: uid2,
48688
49235
  exdate,
48689
49236
  exrule,
48690
49237
  Value_RECUR,
@@ -51112,7 +51659,7 @@ var PodOS = (() => {
51112
51659
  var _daysSupply = "http://hl7.org/fhir/_daysSupply";
51113
51660
  var reportingVendor = "http://hl7.org/fhir/reportingVendor";
51114
51661
  var current = "http://hl7.org/fhir/current";
51115
- var uid2 = "http://hl7.org/fhir/uid";
51662
+ var uid3 = "http://hl7.org/fhir/uid";
51116
51663
  var order = "http://hl7.org/fhir/order";
51117
51664
  var priorPrescription = "http://hl7.org/fhir/priorPrescription";
51118
51665
  var distanceFromLandmark = "http://hl7.org/fhir/distanceFromLandmark";
@@ -55345,7 +55892,7 @@ var PodOS = (() => {
55345
55892
  _daysSupply,
55346
55893
  reportingVendor,
55347
55894
  current,
55348
- uid: uid2,
55895
+ uid: uid3,
55349
55896
  order,
55350
55897
  priorPrescription,
55351
55898
  distanceFromLandmark,
@@ -68521,7 +69068,7 @@ var PodOS = (() => {
68521
69068
  var sec = secImport;
68522
69069
  var sioc = siocImport;
68523
69070
  var skos = skosImport;
68524
- var solid = solidImport;
69071
+ var solid2 = solidImport;
68525
69072
  var space = spaceImport;
68526
69073
  var tab = tabImport;
68527
69074
  var tabont = tabontImport;
@@ -68622,9 +69169,9 @@ var PodOS = (() => {
68622
69169
  return this.uriService.proposeUriForNewThing(referenceUri, name7);
68623
69170
  }
68624
69171
  trackSession(callback) {
68625
- return this.session.trackSession((session4) => {
69172
+ return this.session.trackSession((sessionInfo) => {
68626
69173
  this.store.updater.flagAuthorizationMetadata();
68627
- callback(session4);
69174
+ callback(sessionInfo, this.session.authenticatedFetch);
68628
69175
  });
68629
69176
  }
68630
69177
  /**