@pod-os/core 0.25.0 → 0.26.0-rc.2729248.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/index.js +557 -428
- package/lib/index.js +557 -428
- package/package.json +1 -1
- package/types/Store.d.ts +77 -3
- package/types/Store.quad-patterns.spec.d.ts +1 -0
- package/types/ldp-container/LdpContainer.d.ts +3 -3
- package/types/profile/WebIdProfile.d.ts +3 -3
- package/types/rdf-document/RdfDocument.d.ts +3 -3
- package/types/search/LabelIndex.d.ts +3 -3
- package/types/thing/Thing.d.ts +4 -4
- package/types/type-index/TypeIndex.d.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -11613,348 +11613,6 @@ var require_browser_ponyfill = __commonJS({
|
|
|
11613
11613
|
}
|
|
11614
11614
|
});
|
|
11615
11615
|
|
|
11616
|
-
// ../node_modules/short-unique-id/dist/short-unique-id.js
|
|
11617
|
-
var require_short_unique_id = __commonJS({
|
|
11618
|
-
"../node_modules/short-unique-id/dist/short-unique-id.js"(exports, module3) {
|
|
11619
|
-
"use strict";
|
|
11620
|
-
var ShortUniqueId2 = (() => {
|
|
11621
|
-
var __defProp = Object.defineProperty;
|
|
11622
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11623
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11624
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11625
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11626
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11627
|
-
var __defNormalProp = (obj, key3, value7) => key3 in obj ? __defProp(obj, key3, { enumerable: true, configurable: true, writable: true, value: value7 }) : obj[key3] = value7;
|
|
11628
|
-
var __spreadValues = (a, b) => {
|
|
11629
|
-
for (var prop in b || (b = {}))
|
|
11630
|
-
if (__hasOwnProp.call(b, prop))
|
|
11631
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11632
|
-
if (__getOwnPropSymbols)
|
|
11633
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
11634
|
-
if (__propIsEnum.call(b, prop))
|
|
11635
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11636
|
-
}
|
|
11637
|
-
return a;
|
|
11638
|
-
};
|
|
11639
|
-
var __export2 = (target6, all) => {
|
|
11640
|
-
for (var name9 in all)
|
|
11641
|
-
__defProp(target6, name9, { get: all[name9], enumerable: true });
|
|
11642
|
-
};
|
|
11643
|
-
var __copyProps = (to2, from2, except, desc) => {
|
|
11644
|
-
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
11645
|
-
for (let key3 of __getOwnPropNames(from2))
|
|
11646
|
-
if (!__hasOwnProp.call(to2, key3) && key3 !== except)
|
|
11647
|
-
__defProp(to2, key3, { get: () => from2[key3], enumerable: !(desc = __getOwnPropDesc(from2, key3)) || desc.enumerable });
|
|
11648
|
-
}
|
|
11649
|
-
return to2;
|
|
11650
|
-
};
|
|
11651
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
11652
|
-
var __publicField = (obj, key3, value7) => {
|
|
11653
|
-
__defNormalProp(obj, typeof key3 !== "symbol" ? key3 + "" : key3, value7);
|
|
11654
|
-
return value7;
|
|
11655
|
-
};
|
|
11656
|
-
var src_exports = {};
|
|
11657
|
-
__export2(src_exports, {
|
|
11658
|
-
DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
|
|
11659
|
-
DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
|
|
11660
|
-
default: () => ShortUniqueId3
|
|
11661
|
-
});
|
|
11662
|
-
var version6 = "5.2.0";
|
|
11663
|
-
var DEFAULT_UUID_LENGTH = 6;
|
|
11664
|
-
var DEFAULT_OPTIONS = {
|
|
11665
|
-
dictionary: "alphanum",
|
|
11666
|
-
shuffle: true,
|
|
11667
|
-
debug: false,
|
|
11668
|
-
length: DEFAULT_UUID_LENGTH,
|
|
11669
|
-
counter: 0
|
|
11670
|
-
};
|
|
11671
|
-
var _ShortUniqueId = class _ShortUniqueId {
|
|
11672
|
-
constructor(argOptions = {}) {
|
|
11673
|
-
__publicField(this, "counter");
|
|
11674
|
-
__publicField(this, "debug");
|
|
11675
|
-
__publicField(this, "dict");
|
|
11676
|
-
__publicField(this, "version");
|
|
11677
|
-
__publicField(this, "dictIndex", 0);
|
|
11678
|
-
__publicField(this, "dictRange", []);
|
|
11679
|
-
__publicField(this, "lowerBound", 0);
|
|
11680
|
-
__publicField(this, "upperBound", 0);
|
|
11681
|
-
__publicField(this, "dictLength", 0);
|
|
11682
|
-
__publicField(this, "uuidLength");
|
|
11683
|
-
__publicField(this, "_digit_first_ascii", 48);
|
|
11684
|
-
__publicField(this, "_digit_last_ascii", 58);
|
|
11685
|
-
__publicField(this, "_alpha_lower_first_ascii", 97);
|
|
11686
|
-
__publicField(this, "_alpha_lower_last_ascii", 123);
|
|
11687
|
-
__publicField(this, "_hex_last_ascii", 103);
|
|
11688
|
-
__publicField(this, "_alpha_upper_first_ascii", 65);
|
|
11689
|
-
__publicField(this, "_alpha_upper_last_ascii", 91);
|
|
11690
|
-
__publicField(this, "_number_dict_ranges", {
|
|
11691
|
-
digits: [this._digit_first_ascii, this._digit_last_ascii]
|
|
11692
|
-
});
|
|
11693
|
-
__publicField(this, "_alpha_dict_ranges", {
|
|
11694
|
-
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
|
|
11695
|
-
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
11696
|
-
});
|
|
11697
|
-
__publicField(this, "_alpha_lower_dict_ranges", {
|
|
11698
|
-
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
|
|
11699
|
-
});
|
|
11700
|
-
__publicField(this, "_alpha_upper_dict_ranges", {
|
|
11701
|
-
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
11702
|
-
});
|
|
11703
|
-
__publicField(this, "_alphanum_dict_ranges", {
|
|
11704
|
-
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
11705
|
-
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
|
|
11706
|
-
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
11707
|
-
});
|
|
11708
|
-
__publicField(this, "_alphanum_lower_dict_ranges", {
|
|
11709
|
-
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
11710
|
-
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
|
|
11711
|
-
});
|
|
11712
|
-
__publicField(this, "_alphanum_upper_dict_ranges", {
|
|
11713
|
-
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
11714
|
-
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
11715
|
-
});
|
|
11716
|
-
__publicField(this, "_hex_dict_ranges", {
|
|
11717
|
-
decDigits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
11718
|
-
alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
|
|
11719
|
-
});
|
|
11720
|
-
__publicField(this, "_dict_ranges", {
|
|
11721
|
-
_number_dict_ranges: this._number_dict_ranges,
|
|
11722
|
-
_alpha_dict_ranges: this._alpha_dict_ranges,
|
|
11723
|
-
_alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
|
|
11724
|
-
_alpha_upper_dict_ranges: this._alpha_upper_dict_ranges,
|
|
11725
|
-
_alphanum_dict_ranges: this._alphanum_dict_ranges,
|
|
11726
|
-
_alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
|
|
11727
|
-
_alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
|
|
11728
|
-
_hex_dict_ranges: this._hex_dict_ranges
|
|
11729
|
-
});
|
|
11730
|
-
__publicField(this, "log", (...args) => {
|
|
11731
|
-
const finalArgs = [...args];
|
|
11732
|
-
finalArgs[0] = `[short-unique-id] ${args[0]}`;
|
|
11733
|
-
if (this.debug === true) {
|
|
11734
|
-
if (typeof console !== "undefined" && console !== null) {
|
|
11735
|
-
return console.log(...finalArgs);
|
|
11736
|
-
}
|
|
11737
|
-
}
|
|
11738
|
-
});
|
|
11739
|
-
__publicField(this, "_normalizeDictionary", (dictionary2, shuffle2) => {
|
|
11740
|
-
let finalDict;
|
|
11741
|
-
if (dictionary2 && Array.isArray(dictionary2) && dictionary2.length > 1) {
|
|
11742
|
-
finalDict = dictionary2;
|
|
11743
|
-
} else {
|
|
11744
|
-
finalDict = [];
|
|
11745
|
-
let i;
|
|
11746
|
-
this.dictIndex = i = 0;
|
|
11747
|
-
const rangesName = `_${dictionary2}_dict_ranges`;
|
|
11748
|
-
const ranges = this._dict_ranges[rangesName];
|
|
11749
|
-
Object.keys(ranges).forEach((rangeType) => {
|
|
11750
|
-
const rangeTypeKey = rangeType;
|
|
11751
|
-
this.dictRange = ranges[rangeTypeKey];
|
|
11752
|
-
this.lowerBound = this.dictRange[0];
|
|
11753
|
-
this.upperBound = this.dictRange[1];
|
|
11754
|
-
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) {
|
|
11755
|
-
finalDict.push(String.fromCharCode(this.dictIndex));
|
|
11756
|
-
}
|
|
11757
|
-
});
|
|
11758
|
-
}
|
|
11759
|
-
if (shuffle2) {
|
|
11760
|
-
const PROBABILITY = 0.5;
|
|
11761
|
-
finalDict = finalDict.sort(() => Math.random() - PROBABILITY);
|
|
11762
|
-
}
|
|
11763
|
-
return finalDict;
|
|
11764
|
-
});
|
|
11765
|
-
__publicField(this, "setDictionary", (dictionary2, shuffle2) => {
|
|
11766
|
-
this.dict = this._normalizeDictionary(dictionary2, shuffle2);
|
|
11767
|
-
this.dictLength = this.dict.length;
|
|
11768
|
-
this.setCounter(0);
|
|
11769
|
-
});
|
|
11770
|
-
__publicField(this, "seq", () => {
|
|
11771
|
-
return this.sequentialUUID();
|
|
11772
|
-
});
|
|
11773
|
-
__publicField(this, "sequentialUUID", () => {
|
|
11774
|
-
let counterDiv;
|
|
11775
|
-
let counterRem;
|
|
11776
|
-
let id4 = "";
|
|
11777
|
-
counterDiv = this.counter;
|
|
11778
|
-
do {
|
|
11779
|
-
counterRem = counterDiv % this.dictLength;
|
|
11780
|
-
counterDiv = Math.trunc(counterDiv / this.dictLength);
|
|
11781
|
-
id4 += this.dict[counterRem];
|
|
11782
|
-
} while (counterDiv !== 0);
|
|
11783
|
-
this.counter += 1;
|
|
11784
|
-
return id4;
|
|
11785
|
-
});
|
|
11786
|
-
__publicField(this, "rnd", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
|
|
11787
|
-
return this.randomUUID(uuidLength);
|
|
11788
|
-
});
|
|
11789
|
-
__publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
|
|
11790
|
-
let id4;
|
|
11791
|
-
let randomPartIdx;
|
|
11792
|
-
let j;
|
|
11793
|
-
if (uuidLength === null || typeof uuidLength === "undefined" || uuidLength < 1) {
|
|
11794
|
-
throw new Error("Invalid UUID Length Provided");
|
|
11795
|
-
}
|
|
11796
|
-
const isPositive = uuidLength >= 0;
|
|
11797
|
-
id4 = "";
|
|
11798
|
-
for (j = 0; j < uuidLength; j += 1) {
|
|
11799
|
-
randomPartIdx = parseInt(
|
|
11800
|
-
(Math.random() * this.dictLength).toFixed(0),
|
|
11801
|
-
10
|
|
11802
|
-
) % this.dictLength;
|
|
11803
|
-
id4 += this.dict[randomPartIdx];
|
|
11804
|
-
}
|
|
11805
|
-
return id4;
|
|
11806
|
-
});
|
|
11807
|
-
__publicField(this, "fmt", (format4, date6) => {
|
|
11808
|
-
return this.formattedUUID(format4, date6);
|
|
11809
|
-
});
|
|
11810
|
-
__publicField(this, "formattedUUID", (format4, date6) => {
|
|
11811
|
-
const fnMap = {
|
|
11812
|
-
"$r": this.randomUUID,
|
|
11813
|
-
"$s": this.sequentialUUID,
|
|
11814
|
-
"$t": this.stamp
|
|
11815
|
-
};
|
|
11816
|
-
const result6 = format4.replace(
|
|
11817
|
-
/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
|
|
11818
|
-
(m) => {
|
|
11819
|
-
const fn2 = m.slice(0, 2);
|
|
11820
|
-
const len = parseInt(m.slice(2), 10);
|
|
11821
|
-
if (fn2 === "$s") {
|
|
11822
|
-
return fnMap[fn2]().padStart(len, "0");
|
|
11823
|
-
}
|
|
11824
|
-
if (fn2 === "$t" && date6) {
|
|
11825
|
-
return fnMap[fn2](len, date6);
|
|
11826
|
-
}
|
|
11827
|
-
return fnMap[fn2](len);
|
|
11828
|
-
}
|
|
11829
|
-
);
|
|
11830
|
-
return result6;
|
|
11831
|
-
});
|
|
11832
|
-
__publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
|
|
11833
|
-
return parseFloat(
|
|
11834
|
-
Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
|
|
11835
|
-
);
|
|
11836
|
-
});
|
|
11837
|
-
__publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
|
|
11838
|
-
return parseFloat(
|
|
11839
|
-
Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
|
|
11840
|
-
);
|
|
11841
|
-
});
|
|
11842
|
-
__publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
|
|
11843
|
-
return parseFloat(
|
|
11844
|
-
(this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
|
|
11845
|
-
);
|
|
11846
|
-
});
|
|
11847
|
-
__publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
|
|
11848
|
-
const score2 = parseFloat(
|
|
11849
|
-
(1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
|
|
11850
|
-
);
|
|
11851
|
-
return score2 > 1 ? 1 : score2 < 0 ? 0 : score2;
|
|
11852
|
-
});
|
|
11853
|
-
__publicField(this, "getVersion", () => {
|
|
11854
|
-
return this.version;
|
|
11855
|
-
});
|
|
11856
|
-
__publicField(this, "stamp", (finalLength, date6) => {
|
|
11857
|
-
const hexStamp = Math.floor(+(date6 || /* @__PURE__ */ new Date()) / 1e3).toString(16);
|
|
11858
|
-
if (typeof finalLength === "number" && finalLength === 0) {
|
|
11859
|
-
return hexStamp;
|
|
11860
|
-
}
|
|
11861
|
-
if (typeof finalLength !== "number" || finalLength < 10) {
|
|
11862
|
-
throw new Error(
|
|
11863
|
-
[
|
|
11864
|
-
"Param finalLength must be a number greater than or equal to 10,",
|
|
11865
|
-
"or 0 if you want the raw hexadecimal timestamp"
|
|
11866
|
-
].join("\n")
|
|
11867
|
-
);
|
|
11868
|
-
}
|
|
11869
|
-
const idLength = finalLength - 9;
|
|
11870
|
-
const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
|
|
11871
|
-
const id4 = this.randomUUID(idLength);
|
|
11872
|
-
return `${id4.substring(0, rndIdx)}${hexStamp}${id4.substring(rndIdx)}${rndIdx.toString(16)}`;
|
|
11873
|
-
});
|
|
11874
|
-
__publicField(this, "parseStamp", (suid, format4) => {
|
|
11875
|
-
if (format4 && !/t0|t[1-9]\d{1,}/.test(format4)) {
|
|
11876
|
-
throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
|
|
11877
|
-
}
|
|
11878
|
-
const stamp = format4 ? format4.replace(
|
|
11879
|
-
/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
|
|
11880
|
-
(m) => {
|
|
11881
|
-
const fnMap = {
|
|
11882
|
-
"$r": (len2) => [...Array(len2)].map(() => "r").join(""),
|
|
11883
|
-
"$s": (len2) => [...Array(len2)].map(() => "s").join(""),
|
|
11884
|
-
"$t": (len2) => [...Array(len2)].map(() => "t").join("")
|
|
11885
|
-
};
|
|
11886
|
-
const fn2 = m.slice(0, 2);
|
|
11887
|
-
const len = parseInt(m.slice(2), 10);
|
|
11888
|
-
return fnMap[fn2](len);
|
|
11889
|
-
}
|
|
11890
|
-
).replace(
|
|
11891
|
-
/^(.*?)(t{8,})(.*)$/g,
|
|
11892
|
-
(_m, p1, p2) => {
|
|
11893
|
-
return suid.substring(p1.length, p1.length + p2.length);
|
|
11894
|
-
}
|
|
11895
|
-
) : suid;
|
|
11896
|
-
if (stamp.length === 8) {
|
|
11897
|
-
return new Date(parseInt(stamp, 16) * 1e3);
|
|
11898
|
-
}
|
|
11899
|
-
if (stamp.length < 10) {
|
|
11900
|
-
throw new Error("Stamp length invalid");
|
|
11901
|
-
}
|
|
11902
|
-
const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
|
|
11903
|
-
return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
|
|
11904
|
-
});
|
|
11905
|
-
__publicField(this, "setCounter", (counter2) => {
|
|
11906
|
-
this.counter = counter2;
|
|
11907
|
-
});
|
|
11908
|
-
__publicField(this, "validate", (uid4, dictionary2) => {
|
|
11909
|
-
const finalDictionary = dictionary2 ? this._normalizeDictionary(dictionary2) : this.dict;
|
|
11910
|
-
return uid4.split("").every((c) => finalDictionary.includes(c));
|
|
11911
|
-
});
|
|
11912
|
-
const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
|
|
11913
|
-
this.counter = 0;
|
|
11914
|
-
this.debug = false;
|
|
11915
|
-
this.dict = [];
|
|
11916
|
-
this.version = version6;
|
|
11917
|
-
const {
|
|
11918
|
-
dictionary,
|
|
11919
|
-
shuffle,
|
|
11920
|
-
length: length3,
|
|
11921
|
-
counter
|
|
11922
|
-
} = options;
|
|
11923
|
-
this.uuidLength = length3;
|
|
11924
|
-
this.setDictionary(dictionary, shuffle);
|
|
11925
|
-
this.setCounter(counter);
|
|
11926
|
-
this.debug = options.debug;
|
|
11927
|
-
this.log(this.dict);
|
|
11928
|
-
this.log(
|
|
11929
|
-
`Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
|
|
11930
|
-
);
|
|
11931
|
-
this.log = this.log.bind(this);
|
|
11932
|
-
this.setDictionary = this.setDictionary.bind(this);
|
|
11933
|
-
this.setCounter = this.setCounter.bind(this);
|
|
11934
|
-
this.seq = this.seq.bind(this);
|
|
11935
|
-
this.sequentialUUID = this.sequentialUUID.bind(this);
|
|
11936
|
-
this.rnd = this.rnd.bind(this);
|
|
11937
|
-
this.randomUUID = this.randomUUID.bind(this);
|
|
11938
|
-
this.fmt = this.fmt.bind(this);
|
|
11939
|
-
this.formattedUUID = this.formattedUUID.bind(this);
|
|
11940
|
-
this.availableUUIDs = this.availableUUIDs.bind(this);
|
|
11941
|
-
this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this);
|
|
11942
|
-
this.collisionProbability = this.collisionProbability.bind(this);
|
|
11943
|
-
this.uniqueness = this.uniqueness.bind(this);
|
|
11944
|
-
this.getVersion = this.getVersion.bind(this);
|
|
11945
|
-
this.stamp = this.stamp.bind(this);
|
|
11946
|
-
this.parseStamp = this.parseStamp.bind(this);
|
|
11947
|
-
return this;
|
|
11948
|
-
}
|
|
11949
|
-
};
|
|
11950
|
-
__publicField(_ShortUniqueId, "default", _ShortUniqueId);
|
|
11951
|
-
var ShortUniqueId3 = _ShortUniqueId;
|
|
11952
|
-
return __toCommonJS(src_exports);
|
|
11953
|
-
})();
|
|
11954
|
-
"undefined" != typeof module3 && (module3.exports = ShortUniqueId2.default), "undefined" != typeof window && (ShortUniqueId2 = ShortUniqueId2.default);
|
|
11955
|
-
}
|
|
11956
|
-
});
|
|
11957
|
-
|
|
11958
11616
|
// ../node_modules/lunr/lunr.js
|
|
11959
11617
|
var require_lunr = __commonJS({
|
|
11960
11618
|
"../node_modules/lunr/lunr.js"(exports, module3) {
|
|
@@ -13686,6 +13344,348 @@ var require_lunr = __commonJS({
|
|
|
13686
13344
|
}
|
|
13687
13345
|
});
|
|
13688
13346
|
|
|
13347
|
+
// ../node_modules/short-unique-id/dist/short-unique-id.js
|
|
13348
|
+
var require_short_unique_id = __commonJS({
|
|
13349
|
+
"../node_modules/short-unique-id/dist/short-unique-id.js"(exports, module3) {
|
|
13350
|
+
"use strict";
|
|
13351
|
+
var ShortUniqueId2 = (() => {
|
|
13352
|
+
var __defProp = Object.defineProperty;
|
|
13353
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13354
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13355
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
13356
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13357
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13358
|
+
var __defNormalProp = (obj, key3, value7) => key3 in obj ? __defProp(obj, key3, { enumerable: true, configurable: true, writable: true, value: value7 }) : obj[key3] = value7;
|
|
13359
|
+
var __spreadValues = (a, b) => {
|
|
13360
|
+
for (var prop in b || (b = {}))
|
|
13361
|
+
if (__hasOwnProp.call(b, prop))
|
|
13362
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13363
|
+
if (__getOwnPropSymbols)
|
|
13364
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13365
|
+
if (__propIsEnum.call(b, prop))
|
|
13366
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13367
|
+
}
|
|
13368
|
+
return a;
|
|
13369
|
+
};
|
|
13370
|
+
var __export2 = (target6, all) => {
|
|
13371
|
+
for (var name9 in all)
|
|
13372
|
+
__defProp(target6, name9, { get: all[name9], enumerable: true });
|
|
13373
|
+
};
|
|
13374
|
+
var __copyProps = (to2, from2, except, desc) => {
|
|
13375
|
+
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
13376
|
+
for (let key3 of __getOwnPropNames(from2))
|
|
13377
|
+
if (!__hasOwnProp.call(to2, key3) && key3 !== except)
|
|
13378
|
+
__defProp(to2, key3, { get: () => from2[key3], enumerable: !(desc = __getOwnPropDesc(from2, key3)) || desc.enumerable });
|
|
13379
|
+
}
|
|
13380
|
+
return to2;
|
|
13381
|
+
};
|
|
13382
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
13383
|
+
var __publicField = (obj, key3, value7) => {
|
|
13384
|
+
__defNormalProp(obj, typeof key3 !== "symbol" ? key3 + "" : key3, value7);
|
|
13385
|
+
return value7;
|
|
13386
|
+
};
|
|
13387
|
+
var src_exports = {};
|
|
13388
|
+
__export2(src_exports, {
|
|
13389
|
+
DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
|
|
13390
|
+
DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
|
|
13391
|
+
default: () => ShortUniqueId3
|
|
13392
|
+
});
|
|
13393
|
+
var version6 = "5.2.0";
|
|
13394
|
+
var DEFAULT_UUID_LENGTH = 6;
|
|
13395
|
+
var DEFAULT_OPTIONS = {
|
|
13396
|
+
dictionary: "alphanum",
|
|
13397
|
+
shuffle: true,
|
|
13398
|
+
debug: false,
|
|
13399
|
+
length: DEFAULT_UUID_LENGTH,
|
|
13400
|
+
counter: 0
|
|
13401
|
+
};
|
|
13402
|
+
var _ShortUniqueId = class _ShortUniqueId {
|
|
13403
|
+
constructor(argOptions = {}) {
|
|
13404
|
+
__publicField(this, "counter");
|
|
13405
|
+
__publicField(this, "debug");
|
|
13406
|
+
__publicField(this, "dict");
|
|
13407
|
+
__publicField(this, "version");
|
|
13408
|
+
__publicField(this, "dictIndex", 0);
|
|
13409
|
+
__publicField(this, "dictRange", []);
|
|
13410
|
+
__publicField(this, "lowerBound", 0);
|
|
13411
|
+
__publicField(this, "upperBound", 0);
|
|
13412
|
+
__publicField(this, "dictLength", 0);
|
|
13413
|
+
__publicField(this, "uuidLength");
|
|
13414
|
+
__publicField(this, "_digit_first_ascii", 48);
|
|
13415
|
+
__publicField(this, "_digit_last_ascii", 58);
|
|
13416
|
+
__publicField(this, "_alpha_lower_first_ascii", 97);
|
|
13417
|
+
__publicField(this, "_alpha_lower_last_ascii", 123);
|
|
13418
|
+
__publicField(this, "_hex_last_ascii", 103);
|
|
13419
|
+
__publicField(this, "_alpha_upper_first_ascii", 65);
|
|
13420
|
+
__publicField(this, "_alpha_upper_last_ascii", 91);
|
|
13421
|
+
__publicField(this, "_number_dict_ranges", {
|
|
13422
|
+
digits: [this._digit_first_ascii, this._digit_last_ascii]
|
|
13423
|
+
});
|
|
13424
|
+
__publicField(this, "_alpha_dict_ranges", {
|
|
13425
|
+
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
|
|
13426
|
+
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
13427
|
+
});
|
|
13428
|
+
__publicField(this, "_alpha_lower_dict_ranges", {
|
|
13429
|
+
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
|
|
13430
|
+
});
|
|
13431
|
+
__publicField(this, "_alpha_upper_dict_ranges", {
|
|
13432
|
+
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
13433
|
+
});
|
|
13434
|
+
__publicField(this, "_alphanum_dict_ranges", {
|
|
13435
|
+
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
13436
|
+
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
|
|
13437
|
+
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
13438
|
+
});
|
|
13439
|
+
__publicField(this, "_alphanum_lower_dict_ranges", {
|
|
13440
|
+
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
13441
|
+
lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
|
|
13442
|
+
});
|
|
13443
|
+
__publicField(this, "_alphanum_upper_dict_ranges", {
|
|
13444
|
+
digits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
13445
|
+
upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
|
|
13446
|
+
});
|
|
13447
|
+
__publicField(this, "_hex_dict_ranges", {
|
|
13448
|
+
decDigits: [this._digit_first_ascii, this._digit_last_ascii],
|
|
13449
|
+
alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
|
|
13450
|
+
});
|
|
13451
|
+
__publicField(this, "_dict_ranges", {
|
|
13452
|
+
_number_dict_ranges: this._number_dict_ranges,
|
|
13453
|
+
_alpha_dict_ranges: this._alpha_dict_ranges,
|
|
13454
|
+
_alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
|
|
13455
|
+
_alpha_upper_dict_ranges: this._alpha_upper_dict_ranges,
|
|
13456
|
+
_alphanum_dict_ranges: this._alphanum_dict_ranges,
|
|
13457
|
+
_alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
|
|
13458
|
+
_alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
|
|
13459
|
+
_hex_dict_ranges: this._hex_dict_ranges
|
|
13460
|
+
});
|
|
13461
|
+
__publicField(this, "log", (...args) => {
|
|
13462
|
+
const finalArgs = [...args];
|
|
13463
|
+
finalArgs[0] = `[short-unique-id] ${args[0]}`;
|
|
13464
|
+
if (this.debug === true) {
|
|
13465
|
+
if (typeof console !== "undefined" && console !== null) {
|
|
13466
|
+
return console.log(...finalArgs);
|
|
13467
|
+
}
|
|
13468
|
+
}
|
|
13469
|
+
});
|
|
13470
|
+
__publicField(this, "_normalizeDictionary", (dictionary2, shuffle2) => {
|
|
13471
|
+
let finalDict;
|
|
13472
|
+
if (dictionary2 && Array.isArray(dictionary2) && dictionary2.length > 1) {
|
|
13473
|
+
finalDict = dictionary2;
|
|
13474
|
+
} else {
|
|
13475
|
+
finalDict = [];
|
|
13476
|
+
let i;
|
|
13477
|
+
this.dictIndex = i = 0;
|
|
13478
|
+
const rangesName = `_${dictionary2}_dict_ranges`;
|
|
13479
|
+
const ranges = this._dict_ranges[rangesName];
|
|
13480
|
+
Object.keys(ranges).forEach((rangeType) => {
|
|
13481
|
+
const rangeTypeKey = rangeType;
|
|
13482
|
+
this.dictRange = ranges[rangeTypeKey];
|
|
13483
|
+
this.lowerBound = this.dictRange[0];
|
|
13484
|
+
this.upperBound = this.dictRange[1];
|
|
13485
|
+
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) {
|
|
13486
|
+
finalDict.push(String.fromCharCode(this.dictIndex));
|
|
13487
|
+
}
|
|
13488
|
+
});
|
|
13489
|
+
}
|
|
13490
|
+
if (shuffle2) {
|
|
13491
|
+
const PROBABILITY = 0.5;
|
|
13492
|
+
finalDict = finalDict.sort(() => Math.random() - PROBABILITY);
|
|
13493
|
+
}
|
|
13494
|
+
return finalDict;
|
|
13495
|
+
});
|
|
13496
|
+
__publicField(this, "setDictionary", (dictionary2, shuffle2) => {
|
|
13497
|
+
this.dict = this._normalizeDictionary(dictionary2, shuffle2);
|
|
13498
|
+
this.dictLength = this.dict.length;
|
|
13499
|
+
this.setCounter(0);
|
|
13500
|
+
});
|
|
13501
|
+
__publicField(this, "seq", () => {
|
|
13502
|
+
return this.sequentialUUID();
|
|
13503
|
+
});
|
|
13504
|
+
__publicField(this, "sequentialUUID", () => {
|
|
13505
|
+
let counterDiv;
|
|
13506
|
+
let counterRem;
|
|
13507
|
+
let id4 = "";
|
|
13508
|
+
counterDiv = this.counter;
|
|
13509
|
+
do {
|
|
13510
|
+
counterRem = counterDiv % this.dictLength;
|
|
13511
|
+
counterDiv = Math.trunc(counterDiv / this.dictLength);
|
|
13512
|
+
id4 += this.dict[counterRem];
|
|
13513
|
+
} while (counterDiv !== 0);
|
|
13514
|
+
this.counter += 1;
|
|
13515
|
+
return id4;
|
|
13516
|
+
});
|
|
13517
|
+
__publicField(this, "rnd", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
|
|
13518
|
+
return this.randomUUID(uuidLength);
|
|
13519
|
+
});
|
|
13520
|
+
__publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
|
|
13521
|
+
let id4;
|
|
13522
|
+
let randomPartIdx;
|
|
13523
|
+
let j;
|
|
13524
|
+
if (uuidLength === null || typeof uuidLength === "undefined" || uuidLength < 1) {
|
|
13525
|
+
throw new Error("Invalid UUID Length Provided");
|
|
13526
|
+
}
|
|
13527
|
+
const isPositive = uuidLength >= 0;
|
|
13528
|
+
id4 = "";
|
|
13529
|
+
for (j = 0; j < uuidLength; j += 1) {
|
|
13530
|
+
randomPartIdx = parseInt(
|
|
13531
|
+
(Math.random() * this.dictLength).toFixed(0),
|
|
13532
|
+
10
|
|
13533
|
+
) % this.dictLength;
|
|
13534
|
+
id4 += this.dict[randomPartIdx];
|
|
13535
|
+
}
|
|
13536
|
+
return id4;
|
|
13537
|
+
});
|
|
13538
|
+
__publicField(this, "fmt", (format4, date6) => {
|
|
13539
|
+
return this.formattedUUID(format4, date6);
|
|
13540
|
+
});
|
|
13541
|
+
__publicField(this, "formattedUUID", (format4, date6) => {
|
|
13542
|
+
const fnMap = {
|
|
13543
|
+
"$r": this.randomUUID,
|
|
13544
|
+
"$s": this.sequentialUUID,
|
|
13545
|
+
"$t": this.stamp
|
|
13546
|
+
};
|
|
13547
|
+
const result6 = format4.replace(
|
|
13548
|
+
/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
|
|
13549
|
+
(m) => {
|
|
13550
|
+
const fn2 = m.slice(0, 2);
|
|
13551
|
+
const len = parseInt(m.slice(2), 10);
|
|
13552
|
+
if (fn2 === "$s") {
|
|
13553
|
+
return fnMap[fn2]().padStart(len, "0");
|
|
13554
|
+
}
|
|
13555
|
+
if (fn2 === "$t" && date6) {
|
|
13556
|
+
return fnMap[fn2](len, date6);
|
|
13557
|
+
}
|
|
13558
|
+
return fnMap[fn2](len);
|
|
13559
|
+
}
|
|
13560
|
+
);
|
|
13561
|
+
return result6;
|
|
13562
|
+
});
|
|
13563
|
+
__publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
|
|
13564
|
+
return parseFloat(
|
|
13565
|
+
Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
|
|
13566
|
+
);
|
|
13567
|
+
});
|
|
13568
|
+
__publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
|
|
13569
|
+
return parseFloat(
|
|
13570
|
+
Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
|
|
13571
|
+
);
|
|
13572
|
+
});
|
|
13573
|
+
__publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
|
|
13574
|
+
return parseFloat(
|
|
13575
|
+
(this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
|
|
13576
|
+
);
|
|
13577
|
+
});
|
|
13578
|
+
__publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
|
|
13579
|
+
const score2 = parseFloat(
|
|
13580
|
+
(1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
|
|
13581
|
+
);
|
|
13582
|
+
return score2 > 1 ? 1 : score2 < 0 ? 0 : score2;
|
|
13583
|
+
});
|
|
13584
|
+
__publicField(this, "getVersion", () => {
|
|
13585
|
+
return this.version;
|
|
13586
|
+
});
|
|
13587
|
+
__publicField(this, "stamp", (finalLength, date6) => {
|
|
13588
|
+
const hexStamp = Math.floor(+(date6 || /* @__PURE__ */ new Date()) / 1e3).toString(16);
|
|
13589
|
+
if (typeof finalLength === "number" && finalLength === 0) {
|
|
13590
|
+
return hexStamp;
|
|
13591
|
+
}
|
|
13592
|
+
if (typeof finalLength !== "number" || finalLength < 10) {
|
|
13593
|
+
throw new Error(
|
|
13594
|
+
[
|
|
13595
|
+
"Param finalLength must be a number greater than or equal to 10,",
|
|
13596
|
+
"or 0 if you want the raw hexadecimal timestamp"
|
|
13597
|
+
].join("\n")
|
|
13598
|
+
);
|
|
13599
|
+
}
|
|
13600
|
+
const idLength = finalLength - 9;
|
|
13601
|
+
const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
|
|
13602
|
+
const id4 = this.randomUUID(idLength);
|
|
13603
|
+
return `${id4.substring(0, rndIdx)}${hexStamp}${id4.substring(rndIdx)}${rndIdx.toString(16)}`;
|
|
13604
|
+
});
|
|
13605
|
+
__publicField(this, "parseStamp", (suid, format4) => {
|
|
13606
|
+
if (format4 && !/t0|t[1-9]\d{1,}/.test(format4)) {
|
|
13607
|
+
throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
|
|
13608
|
+
}
|
|
13609
|
+
const stamp = format4 ? format4.replace(
|
|
13610
|
+
/\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
|
|
13611
|
+
(m) => {
|
|
13612
|
+
const fnMap = {
|
|
13613
|
+
"$r": (len2) => [...Array(len2)].map(() => "r").join(""),
|
|
13614
|
+
"$s": (len2) => [...Array(len2)].map(() => "s").join(""),
|
|
13615
|
+
"$t": (len2) => [...Array(len2)].map(() => "t").join("")
|
|
13616
|
+
};
|
|
13617
|
+
const fn2 = m.slice(0, 2);
|
|
13618
|
+
const len = parseInt(m.slice(2), 10);
|
|
13619
|
+
return fnMap[fn2](len);
|
|
13620
|
+
}
|
|
13621
|
+
).replace(
|
|
13622
|
+
/^(.*?)(t{8,})(.*)$/g,
|
|
13623
|
+
(_m, p1, p2) => {
|
|
13624
|
+
return suid.substring(p1.length, p1.length + p2.length);
|
|
13625
|
+
}
|
|
13626
|
+
) : suid;
|
|
13627
|
+
if (stamp.length === 8) {
|
|
13628
|
+
return new Date(parseInt(stamp, 16) * 1e3);
|
|
13629
|
+
}
|
|
13630
|
+
if (stamp.length < 10) {
|
|
13631
|
+
throw new Error("Stamp length invalid");
|
|
13632
|
+
}
|
|
13633
|
+
const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
|
|
13634
|
+
return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
|
|
13635
|
+
});
|
|
13636
|
+
__publicField(this, "setCounter", (counter2) => {
|
|
13637
|
+
this.counter = counter2;
|
|
13638
|
+
});
|
|
13639
|
+
__publicField(this, "validate", (uid4, dictionary2) => {
|
|
13640
|
+
const finalDictionary = dictionary2 ? this._normalizeDictionary(dictionary2) : this.dict;
|
|
13641
|
+
return uid4.split("").every((c) => finalDictionary.includes(c));
|
|
13642
|
+
});
|
|
13643
|
+
const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
|
|
13644
|
+
this.counter = 0;
|
|
13645
|
+
this.debug = false;
|
|
13646
|
+
this.dict = [];
|
|
13647
|
+
this.version = version6;
|
|
13648
|
+
const {
|
|
13649
|
+
dictionary,
|
|
13650
|
+
shuffle,
|
|
13651
|
+
length: length3,
|
|
13652
|
+
counter
|
|
13653
|
+
} = options;
|
|
13654
|
+
this.uuidLength = length3;
|
|
13655
|
+
this.setDictionary(dictionary, shuffle);
|
|
13656
|
+
this.setCounter(counter);
|
|
13657
|
+
this.debug = options.debug;
|
|
13658
|
+
this.log(this.dict);
|
|
13659
|
+
this.log(
|
|
13660
|
+
`Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
|
|
13661
|
+
);
|
|
13662
|
+
this.log = this.log.bind(this);
|
|
13663
|
+
this.setDictionary = this.setDictionary.bind(this);
|
|
13664
|
+
this.setCounter = this.setCounter.bind(this);
|
|
13665
|
+
this.seq = this.seq.bind(this);
|
|
13666
|
+
this.sequentialUUID = this.sequentialUUID.bind(this);
|
|
13667
|
+
this.rnd = this.rnd.bind(this);
|
|
13668
|
+
this.randomUUID = this.randomUUID.bind(this);
|
|
13669
|
+
this.fmt = this.fmt.bind(this);
|
|
13670
|
+
this.formattedUUID = this.formattedUUID.bind(this);
|
|
13671
|
+
this.availableUUIDs = this.availableUUIDs.bind(this);
|
|
13672
|
+
this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this);
|
|
13673
|
+
this.collisionProbability = this.collisionProbability.bind(this);
|
|
13674
|
+
this.uniqueness = this.uniqueness.bind(this);
|
|
13675
|
+
this.getVersion = this.getVersion.bind(this);
|
|
13676
|
+
this.stamp = this.stamp.bind(this);
|
|
13677
|
+
this.parseStamp = this.parseStamp.bind(this);
|
|
13678
|
+
return this;
|
|
13679
|
+
}
|
|
13680
|
+
};
|
|
13681
|
+
__publicField(_ShortUniqueId, "default", _ShortUniqueId);
|
|
13682
|
+
var ShortUniqueId3 = _ShortUniqueId;
|
|
13683
|
+
return __toCommonJS(src_exports);
|
|
13684
|
+
})();
|
|
13685
|
+
"undefined" != typeof module3 && (module3.exports = ShortUniqueId2.default), "undefined" != typeof window && (ShortUniqueId2 = ShortUniqueId2.default);
|
|
13686
|
+
}
|
|
13687
|
+
});
|
|
13688
|
+
|
|
13689
13689
|
// ../node_modules/slugify/slugify.js
|
|
13690
13690
|
var require_slugify = __commonJS({
|
|
13691
13691
|
"../node_modules/slugify/slugify.js"(exports, module3) {
|
|
@@ -27841,8 +27841,8 @@ var Thing = class {
|
|
|
27841
27841
|
* Retrieves a list of RDF types for this thing.
|
|
27842
27842
|
*/
|
|
27843
27843
|
types() {
|
|
27844
|
-
const
|
|
27845
|
-
return
|
|
27844
|
+
const uris = this.store.findTypes(this.uri);
|
|
27845
|
+
return uris.map((uri6) => ({
|
|
27846
27846
|
uri: uri6,
|
|
27847
27847
|
label: labelForType(uri6)
|
|
27848
27848
|
}));
|
|
@@ -27999,77 +27999,6 @@ var PictureGateway = class {
|
|
|
27999
27999
|
}
|
|
28000
28000
|
};
|
|
28001
28001
|
|
|
28002
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js
|
|
28003
|
-
async function executeUpdate(fetcher2, updater, operation3) {
|
|
28004
|
-
await updater.updateMany(operation3.deletions, operation3.insertions);
|
|
28005
|
-
operation3.filesToCreate.map((file2) => {
|
|
28006
|
-
createEmptyTurtleFile(fetcher2, file2.url);
|
|
28007
|
-
});
|
|
28008
|
-
}
|
|
28009
|
-
function createEmptyTurtleFile(fetcher2, url7) {
|
|
28010
|
-
return fetcher2.webOperation("PUT", url7, {
|
|
28011
|
-
contentType: "text/turtle"
|
|
28012
|
-
});
|
|
28013
|
-
}
|
|
28014
|
-
|
|
28015
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
|
|
28016
|
-
var rdf3 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
28017
|
-
var solid = Namespace("http://www.w3.org/ns/solid/terms#");
|
|
28018
|
-
var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
28019
|
-
var ldp = Namespace("http://www.w3.org/ns/ldp#");
|
|
28020
|
-
|
|
28021
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
28022
|
-
var PreferencesQuery = class {
|
|
28023
|
-
constructor(store, webIdNode, preferencesDoc) {
|
|
28024
|
-
this.store = store;
|
|
28025
|
-
this.webIdNode = webIdNode;
|
|
28026
|
-
this.preferencesDoc = preferencesDoc;
|
|
28027
|
-
}
|
|
28028
|
-
/**
|
|
28029
|
-
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
28030
|
-
*/
|
|
28031
|
-
queryPrivateTypeIndex() {
|
|
28032
|
-
const node3 = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
|
|
28033
|
-
if (isNamedNode(node3)) {
|
|
28034
|
-
return node3;
|
|
28035
|
-
}
|
|
28036
|
-
return null;
|
|
28037
|
-
}
|
|
28038
|
-
};
|
|
28039
|
-
|
|
28040
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js
|
|
28041
|
-
var ProfileQuery = class {
|
|
28042
|
-
constructor(webIdNode, store) {
|
|
28043
|
-
this.webIdNode = webIdNode;
|
|
28044
|
-
this.store = store;
|
|
28045
|
-
}
|
|
28046
|
-
/**
|
|
28047
|
-
* Look up the public type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
28048
|
-
*/
|
|
28049
|
-
queryPublicTypeIndex() {
|
|
28050
|
-
const predicate4 = solid("publicTypeIndex");
|
|
28051
|
-
return this.queryNamedNode(predicate4);
|
|
28052
|
-
}
|
|
28053
|
-
/**
|
|
28054
|
-
* Look up the preferences file. Returns null if none is found or if the predicated does not link to a proper named node
|
|
28055
|
-
*/
|
|
28056
|
-
queryPreferencesFile() {
|
|
28057
|
-
const predicate4 = pim2("preferencesFile");
|
|
28058
|
-
return this.queryNamedNode(predicate4);
|
|
28059
|
-
}
|
|
28060
|
-
queryNamedNode(predicate4) {
|
|
28061
|
-
const node3 = this.store.any(this.webIdNode, predicate4, null, this.webIdNode.doc());
|
|
28062
|
-
if (isNamedNode(node3)) {
|
|
28063
|
-
return node3;
|
|
28064
|
-
}
|
|
28065
|
-
return null;
|
|
28066
|
-
}
|
|
28067
|
-
};
|
|
28068
|
-
|
|
28069
|
-
// node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
28070
|
-
var import_short_unique_id = __toESM(require_short_unique_id(), 1);
|
|
28071
|
-
var uid = new import_short_unique_id.default({ length: 10 });
|
|
28072
|
-
|
|
28073
28002
|
// src/profile/WebIdProfile.ts
|
|
28074
28003
|
var WebIdProfile = class extends Thing {
|
|
28075
28004
|
constructor(webId, store, editable = false) {
|
|
@@ -28077,7 +28006,7 @@ var WebIdProfile = class extends Thing {
|
|
|
28077
28006
|
this.webId = webId;
|
|
28078
28007
|
this.store = store;
|
|
28079
28008
|
this.editable = editable;
|
|
28080
|
-
this.profileQuery =
|
|
28009
|
+
this.profileQuery = this.store.profileQuery(this.webId);
|
|
28081
28010
|
}
|
|
28082
28011
|
/**
|
|
28083
28012
|
* Returns the URI of the preferences document
|
|
@@ -28099,11 +28028,7 @@ var WebIdProfile = class extends Thing {
|
|
|
28099
28028
|
getPrivateTypeIndex() {
|
|
28100
28029
|
const preferences = this.profileQuery.queryPreferencesFile();
|
|
28101
28030
|
if (!preferences) return void 0;
|
|
28102
|
-
const query4 =
|
|
28103
|
-
this.store,
|
|
28104
|
-
namedNode(this.webId),
|
|
28105
|
-
preferences
|
|
28106
|
-
);
|
|
28031
|
+
const query4 = this.store.preferencesQuery(this.webId, preferences);
|
|
28107
28032
|
return query4.queryPrivateTypeIndex()?.value;
|
|
28108
28033
|
}
|
|
28109
28034
|
/**
|
|
@@ -28271,6 +28196,77 @@ var LabelIndex = class extends RdfDocument {
|
|
|
28271
28196
|
}
|
|
28272
28197
|
};
|
|
28273
28198
|
|
|
28199
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js
|
|
28200
|
+
async function executeUpdate(fetcher2, updater, operation3) {
|
|
28201
|
+
await updater.updateMany(operation3.deletions, operation3.insertions);
|
|
28202
|
+
operation3.filesToCreate.map((file2) => {
|
|
28203
|
+
createEmptyTurtleFile(fetcher2, file2.url);
|
|
28204
|
+
});
|
|
28205
|
+
}
|
|
28206
|
+
function createEmptyTurtleFile(fetcher2, url7) {
|
|
28207
|
+
return fetcher2.webOperation("PUT", url7, {
|
|
28208
|
+
contentType: "text/turtle"
|
|
28209
|
+
});
|
|
28210
|
+
}
|
|
28211
|
+
|
|
28212
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
|
|
28213
|
+
var rdf3 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
28214
|
+
var solid = Namespace("http://www.w3.org/ns/solid/terms#");
|
|
28215
|
+
var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
|
|
28216
|
+
var ldp = Namespace("http://www.w3.org/ns/ldp#");
|
|
28217
|
+
|
|
28218
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/PreferencesQuery.js
|
|
28219
|
+
var PreferencesQuery = class {
|
|
28220
|
+
constructor(store, webIdNode, preferencesDoc) {
|
|
28221
|
+
this.store = store;
|
|
28222
|
+
this.webIdNode = webIdNode;
|
|
28223
|
+
this.preferencesDoc = preferencesDoc;
|
|
28224
|
+
}
|
|
28225
|
+
/**
|
|
28226
|
+
* Look up the private type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
28227
|
+
*/
|
|
28228
|
+
queryPrivateTypeIndex() {
|
|
28229
|
+
const node3 = this.store.any(this.webIdNode, solid("privateTypeIndex"), null, this.preferencesDoc);
|
|
28230
|
+
if (isNamedNode(node3)) {
|
|
28231
|
+
return node3;
|
|
28232
|
+
}
|
|
28233
|
+
return null;
|
|
28234
|
+
}
|
|
28235
|
+
};
|
|
28236
|
+
|
|
28237
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/queries/ProfileQuery.js
|
|
28238
|
+
var ProfileQuery = class {
|
|
28239
|
+
constructor(webIdNode, store) {
|
|
28240
|
+
this.webIdNode = webIdNode;
|
|
28241
|
+
this.store = store;
|
|
28242
|
+
}
|
|
28243
|
+
/**
|
|
28244
|
+
* Look up the public type index. Returns null if none is found or if the predicated does not link to a proper named node
|
|
28245
|
+
*/
|
|
28246
|
+
queryPublicTypeIndex() {
|
|
28247
|
+
const predicate4 = solid("publicTypeIndex");
|
|
28248
|
+
return this.queryNamedNode(predicate4);
|
|
28249
|
+
}
|
|
28250
|
+
/**
|
|
28251
|
+
* Look up the preferences file. Returns null if none is found or if the predicated does not link to a proper named node
|
|
28252
|
+
*/
|
|
28253
|
+
queryPreferencesFile() {
|
|
28254
|
+
const predicate4 = pim2("preferencesFile");
|
|
28255
|
+
return this.queryNamedNode(predicate4);
|
|
28256
|
+
}
|
|
28257
|
+
queryNamedNode(predicate4) {
|
|
28258
|
+
const node3 = this.store.any(this.webIdNode, predicate4, null, this.webIdNode.doc());
|
|
28259
|
+
if (isNamedNode(node3)) {
|
|
28260
|
+
return node3;
|
|
28261
|
+
}
|
|
28262
|
+
return null;
|
|
28263
|
+
}
|
|
28264
|
+
};
|
|
28265
|
+
|
|
28266
|
+
// node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
|
|
28267
|
+
var import_short_unique_id = __toESM(require_short_unique_id(), 1);
|
|
28268
|
+
var uid = new import_short_unique_id.default({ length: 10 });
|
|
28269
|
+
|
|
28274
28270
|
// src/search/createDefaultLabelIndex.ts
|
|
28275
28271
|
function createDefaultLabelIndex(profile2) {
|
|
28276
28272
|
const webId = namedNode(profile2.webId);
|
|
@@ -28471,7 +28467,7 @@ var Store = class {
|
|
|
28471
28467
|
*/
|
|
28472
28468
|
get(uri6) {
|
|
28473
28469
|
const editable = !!this.updater.editable(uri6);
|
|
28474
|
-
return new Thing(uri6, this
|
|
28470
|
+
return new Thing(uri6, this, editable);
|
|
28475
28471
|
}
|
|
28476
28472
|
/**
|
|
28477
28473
|
* Adds a new value to the property of the given thing
|
|
@@ -28554,6 +28550,139 @@ var Store = class {
|
|
|
28554
28550
|
distinctUntilChanged((prev2, curr) => prev2.length == curr.length)
|
|
28555
28551
|
);
|
|
28556
28552
|
}
|
|
28553
|
+
/**
|
|
28554
|
+
* Finds types of the given resource
|
|
28555
|
+
*
|
|
28556
|
+
* @param {string|NamedNode|BlankNode} uri String or RDF/JS object
|
|
28557
|
+
* @returns {string[]} An array of URIs of types
|
|
28558
|
+
*/
|
|
28559
|
+
findTypes(uri6) {
|
|
28560
|
+
if (typeof uri6 === "string") uri6 = namedNode(uri6);
|
|
28561
|
+
return Object.keys(this.internalStore.findTypeURIs(uri6));
|
|
28562
|
+
}
|
|
28563
|
+
/**
|
|
28564
|
+
* Determines whether the store includes a certain quad pattern, returning true or false as appropriate.
|
|
28565
|
+
*
|
|
28566
|
+
* @param {Quad_Subject|null|undefined} subject
|
|
28567
|
+
* @param {Quad_Predicate|null|undefined} predicate
|
|
28568
|
+
* @param {Quad_Object|null|undefined} object
|
|
28569
|
+
* @param {Quad_Graph|null|undefined} graph
|
|
28570
|
+
* @returns {boolean} Whether the store includes the quad pattern
|
|
28571
|
+
*/
|
|
28572
|
+
holds(subject8, predicate4, object8, graph3) {
|
|
28573
|
+
return this.internalStore.holds(subject8, predicate4, object8, graph3);
|
|
28574
|
+
}
|
|
28575
|
+
/**
|
|
28576
|
+
* Statements matching the provided quad pattern
|
|
28577
|
+
*
|
|
28578
|
+
* @param {Quad_Subject|null|undefined} subject
|
|
28579
|
+
* @param {Quad_Predicate|null|undefined} predicate
|
|
28580
|
+
* @param {Quad_Object|null|undefined} object
|
|
28581
|
+
* @param {Quad_Graph|null|undefined} graph
|
|
28582
|
+
* @returns {Quad[]} Array of statements
|
|
28583
|
+
*/
|
|
28584
|
+
statementsMatching(subject8, predicate4, object8, graph3) {
|
|
28585
|
+
return this.internalStore.statementsMatching(
|
|
28586
|
+
subject8,
|
|
28587
|
+
predicate4,
|
|
28588
|
+
object8,
|
|
28589
|
+
graph3
|
|
28590
|
+
);
|
|
28591
|
+
}
|
|
28592
|
+
/**
|
|
28593
|
+
* RDF/JS terms matching the first wildcard in the provided quad pattern
|
|
28594
|
+
*
|
|
28595
|
+
* @param {Quad_Subject|null|undefined} subject
|
|
28596
|
+
* @param {Quad_Predicate|null|undefined} predicate
|
|
28597
|
+
* @param {Quad_Object|null|undefined} object
|
|
28598
|
+
* @param {Quad_Graph|null|undefined} graph
|
|
28599
|
+
* @returns {Term[]} Array of terms
|
|
28600
|
+
*/
|
|
28601
|
+
each(subject8, predicate4, object8, graph3) {
|
|
28602
|
+
const statements = this.statementsMatching(
|
|
28603
|
+
subject8,
|
|
28604
|
+
predicate4,
|
|
28605
|
+
object8,
|
|
28606
|
+
graph3
|
|
28607
|
+
);
|
|
28608
|
+
if (!subject8) {
|
|
28609
|
+
return statements.map((statement2) => statement2.subject);
|
|
28610
|
+
} else if (!predicate4) {
|
|
28611
|
+
return statements.map((statement2) => statement2.predicate);
|
|
28612
|
+
} else if (!object8) {
|
|
28613
|
+
return statements.map((statement2) => statement2.object);
|
|
28614
|
+
} else if (!graph3) {
|
|
28615
|
+
return statements.map((statement2) => statement2.graph);
|
|
28616
|
+
}
|
|
28617
|
+
throw new Error("No wildcard specified");
|
|
28618
|
+
}
|
|
28619
|
+
/**
|
|
28620
|
+
* Any one RDF/JS term matching the first wildcard in the provided quad pattern
|
|
28621
|
+
*
|
|
28622
|
+
* @param {Quad_Subject|null|undefined} subject
|
|
28623
|
+
* @param {Quad_Predicate|null|undefined} predicate
|
|
28624
|
+
* @param {Quad_Object|null|undefined} object
|
|
28625
|
+
* @param {Quad_Graph|null|undefined} graph
|
|
28626
|
+
* @returns {Term | null} RDF/JS term
|
|
28627
|
+
*/
|
|
28628
|
+
any(subject8, predicate4, object8, graph3) {
|
|
28629
|
+
const justOne = true;
|
|
28630
|
+
const statements = this.internalStore.statementsMatching(
|
|
28631
|
+
subject8,
|
|
28632
|
+
predicate4,
|
|
28633
|
+
object8,
|
|
28634
|
+
graph3,
|
|
28635
|
+
justOne
|
|
28636
|
+
);
|
|
28637
|
+
if (statements.length == 0) return null;
|
|
28638
|
+
if (!subject8) {
|
|
28639
|
+
return statements[0].subject;
|
|
28640
|
+
} else if (!predicate4) {
|
|
28641
|
+
return statements[0].predicate;
|
|
28642
|
+
} else if (!object8) {
|
|
28643
|
+
return statements[0].object;
|
|
28644
|
+
} else if (!graph3) {
|
|
28645
|
+
return statements[0].graph;
|
|
28646
|
+
}
|
|
28647
|
+
throw new Error("No wildcard specified");
|
|
28648
|
+
}
|
|
28649
|
+
/**
|
|
28650
|
+
* Value of any one RDF/JS term matching the first wildcard in the provided quad pattern
|
|
28651
|
+
*
|
|
28652
|
+
* @param {Quad_Subject|null|undefined} subject
|
|
28653
|
+
* @param {Quad_Predicate|null|undefined} predicate
|
|
28654
|
+
* @param {Quad_Object|null|undefined} object
|
|
28655
|
+
* @param {Quad_Graph|null|undefined} graph
|
|
28656
|
+
* @returns {string | undefined} value of RDF/JS term
|
|
28657
|
+
*/
|
|
28658
|
+
anyValue(subject8, predicate4, object8, graph3) {
|
|
28659
|
+
return this.any(subject8, predicate4, object8, graph3)?.value;
|
|
28660
|
+
}
|
|
28661
|
+
/**
|
|
28662
|
+
* Create a query to fetch information from a user's preferences file
|
|
28663
|
+
*
|
|
28664
|
+
* @param webId
|
|
28665
|
+
* @param preferencesDoc
|
|
28666
|
+
* @returns {PreferencesQuery} PreferencesQuery instance. See [@solid-data-modules/rdflib-utils
|
|
28667
|
+
](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.PreferencesQuery.html)
|
|
28668
|
+
*/
|
|
28669
|
+
preferencesQuery(webId, preferencesDoc) {
|
|
28670
|
+
if (typeof webId === "string") webId = namedNode(webId);
|
|
28671
|
+
if (typeof preferencesDoc === "string")
|
|
28672
|
+
preferencesDoc = namedNode(preferencesDoc);
|
|
28673
|
+
return new PreferencesQuery(this.internalStore, webId, preferencesDoc);
|
|
28674
|
+
}
|
|
28675
|
+
/**
|
|
28676
|
+
* Create a query to fetch information from a user's profile document
|
|
28677
|
+
*
|
|
28678
|
+
* @param webId
|
|
28679
|
+
* @returns {ProfileQuery} ProfileQuery instance. See [@solid-data-modules/rdflib-utils
|
|
28680
|
+
](https://solid-contrib.github.io/data-modules/rdflib-utils/classes/index.ProfileQuery.html)
|
|
28681
|
+
*/
|
|
28682
|
+
profileQuery(webId) {
|
|
28683
|
+
if (typeof webId === "string") webId = namedNode(webId);
|
|
28684
|
+
return new ProfileQuery(webId, this.internalStore);
|
|
28685
|
+
}
|
|
28557
28686
|
};
|
|
28558
28687
|
|
|
28559
28688
|
// ../node_modules/rdf-namespaces/dist/index.es.js
|
|
@@ -38493,7 +38622,7 @@ var langString = "http://www.w3.org/1999/02/22-rdf-syntax-ns#langString";
|
|
|
38493
38622
|
var PlainLiteral = "http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral";
|
|
38494
38623
|
var type4 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
|
|
38495
38624
|
var Property2 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Property";
|
|
38496
|
-
var
|
|
38625
|
+
var Statement3 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement";
|
|
38497
38626
|
var subject5 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject";
|
|
38498
38627
|
var predicate = "http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate";
|
|
38499
38628
|
var object3 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#object";
|
|
@@ -38515,7 +38644,7 @@ var rdfImport = /* @__PURE__ */ Object.freeze({
|
|
|
38515
38644
|
PlainLiteral,
|
|
38516
38645
|
type: type4,
|
|
38517
38646
|
Property: Property2,
|
|
38518
|
-
Statement:
|
|
38647
|
+
Statement: Statement3,
|
|
38519
38648
|
subject: subject5,
|
|
38520
38649
|
predicate,
|
|
38521
38650
|
object: object3,
|
|
@@ -39392,7 +39521,7 @@ var SportsTeam = "http://schema.org/SportsTeam";
|
|
|
39392
39521
|
var SpreadsheetDigitalDocument = "http://schema.org/SpreadsheetDigitalDocument";
|
|
39393
39522
|
var StadiumOrArena = "http://schema.org/StadiumOrArena";
|
|
39394
39523
|
var State = "http://schema.org/State";
|
|
39395
|
-
var
|
|
39524
|
+
var Statement4 = "http://schema.org/Statement";
|
|
39396
39525
|
var StatisticalPopulation = "http://schema.org/StatisticalPopulation";
|
|
39397
39526
|
var StatisticalVariable = "http://schema.org/StatisticalVariable";
|
|
39398
39527
|
var StatusEnumeration = "http://schema.org/StatusEnumeration";
|
|
@@ -41831,7 +41960,7 @@ var schemaImport = /* @__PURE__ */ Object.freeze({
|
|
|
41831
41960
|
SpreadsheetDigitalDocument,
|
|
41832
41961
|
StadiumOrArena,
|
|
41833
41962
|
State,
|
|
41834
|
-
Statement:
|
|
41963
|
+
Statement: Statement4,
|
|
41835
41964
|
StatisticalPopulation,
|
|
41836
41965
|
StatisticalVariable,
|
|
41837
41966
|
StatusEnumeration,
|
|
@@ -44272,7 +44401,7 @@ var SportsTeam2 = "https://schema.org/SportsTeam";
|
|
|
44272
44401
|
var SpreadsheetDigitalDocument2 = "https://schema.org/SpreadsheetDigitalDocument";
|
|
44273
44402
|
var StadiumOrArena2 = "https://schema.org/StadiumOrArena";
|
|
44274
44403
|
var State2 = "https://schema.org/State";
|
|
44275
|
-
var
|
|
44404
|
+
var Statement5 = "https://schema.org/Statement";
|
|
44276
44405
|
var StatisticalPopulation2 = "https://schema.org/StatisticalPopulation";
|
|
44277
44406
|
var StatisticalVariable2 = "https://schema.org/StatisticalVariable";
|
|
44278
44407
|
var StatusEnumeration2 = "https://schema.org/StatusEnumeration";
|
|
@@ -46711,7 +46840,7 @@ var schema_httpsImport = /* @__PURE__ */ Object.freeze({
|
|
|
46711
46840
|
SpreadsheetDigitalDocument: SpreadsheetDigitalDocument2,
|
|
46712
46841
|
StadiumOrArena: StadiumOrArena2,
|
|
46713
46842
|
State: State2,
|
|
46714
|
-
Statement:
|
|
46843
|
+
Statement: Statement5,
|
|
46715
46844
|
StatisticalPopulation: StatisticalPopulation2,
|
|
46716
46845
|
StatisticalVariable: StatisticalVariable2,
|
|
46717
46846
|
StatusEnumeration: StatusEnumeration2,
|