@pod-os/core 0.13.1-5f6551f.0 → 0.13.1-735eb6a.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.
@@ -12983,6 +12983,348 @@ var require_browser_ponyfill = __commonJS({
12983
12983
  }
12984
12984
  });
12985
12985
 
12986
+ // ../node_modules/short-unique-id/dist/short-unique-id.js
12987
+ var require_short_unique_id = __commonJS({
12988
+ "../node_modules/short-unique-id/dist/short-unique-id.js"(exports, module2) {
12989
+ "use strict";
12990
+ var ShortUniqueId = (() => {
12991
+ var __defProp = Object.defineProperty;
12992
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12993
+ var __getOwnPropNames = Object.getOwnPropertyNames;
12994
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
12995
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12996
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12997
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12998
+ var __spreadValues = (a, b) => {
12999
+ for (var prop in b || (b = {}))
13000
+ if (__hasOwnProp.call(b, prop))
13001
+ __defNormalProp(a, prop, b[prop]);
13002
+ if (__getOwnPropSymbols)
13003
+ for (var prop of __getOwnPropSymbols(b)) {
13004
+ if (__propIsEnum.call(b, prop))
13005
+ __defNormalProp(a, prop, b[prop]);
13006
+ }
13007
+ return a;
13008
+ };
13009
+ var __export2 = (target, all) => {
13010
+ for (var name in all)
13011
+ __defProp(target, name, { get: all[name], enumerable: true });
13012
+ };
13013
+ var __copyProps = (to, from, except, desc) => {
13014
+ if (from && typeof from === "object" || typeof from === "function") {
13015
+ for (let key of __getOwnPropNames(from))
13016
+ if (!__hasOwnProp.call(to, key) && key !== except)
13017
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13018
+ }
13019
+ return to;
13020
+ };
13021
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
13022
+ var __publicField = (obj, key, value) => {
13023
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
13024
+ return value;
13025
+ };
13026
+ var src_exports = {};
13027
+ __export2(src_exports, {
13028
+ DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
13029
+ DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
13030
+ default: () => ShortUniqueId2
13031
+ });
13032
+ var version = "5.2.0";
13033
+ var DEFAULT_UUID_LENGTH = 6;
13034
+ var DEFAULT_OPTIONS = {
13035
+ dictionary: "alphanum",
13036
+ shuffle: true,
13037
+ debug: false,
13038
+ length: DEFAULT_UUID_LENGTH,
13039
+ counter: 0
13040
+ };
13041
+ var _ShortUniqueId = class _ShortUniqueId {
13042
+ constructor(argOptions = {}) {
13043
+ __publicField(this, "counter");
13044
+ __publicField(this, "debug");
13045
+ __publicField(this, "dict");
13046
+ __publicField(this, "version");
13047
+ __publicField(this, "dictIndex", 0);
13048
+ __publicField(this, "dictRange", []);
13049
+ __publicField(this, "lowerBound", 0);
13050
+ __publicField(this, "upperBound", 0);
13051
+ __publicField(this, "dictLength", 0);
13052
+ __publicField(this, "uuidLength");
13053
+ __publicField(this, "_digit_first_ascii", 48);
13054
+ __publicField(this, "_digit_last_ascii", 58);
13055
+ __publicField(this, "_alpha_lower_first_ascii", 97);
13056
+ __publicField(this, "_alpha_lower_last_ascii", 123);
13057
+ __publicField(this, "_hex_last_ascii", 103);
13058
+ __publicField(this, "_alpha_upper_first_ascii", 65);
13059
+ __publicField(this, "_alpha_upper_last_ascii", 91);
13060
+ __publicField(this, "_number_dict_ranges", {
13061
+ digits: [this._digit_first_ascii, this._digit_last_ascii]
13062
+ });
13063
+ __publicField(this, "_alpha_dict_ranges", {
13064
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
13065
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
13066
+ });
13067
+ __publicField(this, "_alpha_lower_dict_ranges", {
13068
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
13069
+ });
13070
+ __publicField(this, "_alpha_upper_dict_ranges", {
13071
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
13072
+ });
13073
+ __publicField(this, "_alphanum_dict_ranges", {
13074
+ digits: [this._digit_first_ascii, this._digit_last_ascii],
13075
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
13076
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
13077
+ });
13078
+ __publicField(this, "_alphanum_lower_dict_ranges", {
13079
+ digits: [this._digit_first_ascii, this._digit_last_ascii],
13080
+ lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
13081
+ });
13082
+ __publicField(this, "_alphanum_upper_dict_ranges", {
13083
+ digits: [this._digit_first_ascii, this._digit_last_ascii],
13084
+ upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
13085
+ });
13086
+ __publicField(this, "_hex_dict_ranges", {
13087
+ decDigits: [this._digit_first_ascii, this._digit_last_ascii],
13088
+ alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
13089
+ });
13090
+ __publicField(this, "_dict_ranges", {
13091
+ _number_dict_ranges: this._number_dict_ranges,
13092
+ _alpha_dict_ranges: this._alpha_dict_ranges,
13093
+ _alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
13094
+ _alpha_upper_dict_ranges: this._alpha_upper_dict_ranges,
13095
+ _alphanum_dict_ranges: this._alphanum_dict_ranges,
13096
+ _alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
13097
+ _alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
13098
+ _hex_dict_ranges: this._hex_dict_ranges
13099
+ });
13100
+ __publicField(this, "log", (...args) => {
13101
+ const finalArgs = [...args];
13102
+ finalArgs[0] = `[short-unique-id] ${args[0]}`;
13103
+ if (this.debug === true) {
13104
+ if (typeof console !== "undefined" && console !== null) {
13105
+ return console.log(...finalArgs);
13106
+ }
13107
+ }
13108
+ });
13109
+ __publicField(this, "_normalizeDictionary", (dictionary2, shuffle2) => {
13110
+ let finalDict;
13111
+ if (dictionary2 && Array.isArray(dictionary2) && dictionary2.length > 1) {
13112
+ finalDict = dictionary2;
13113
+ } else {
13114
+ finalDict = [];
13115
+ let i;
13116
+ this.dictIndex = i = 0;
13117
+ const rangesName = `_${dictionary2}_dict_ranges`;
13118
+ const ranges = this._dict_ranges[rangesName];
13119
+ Object.keys(ranges).forEach((rangeType) => {
13120
+ const rangeTypeKey = rangeType;
13121
+ this.dictRange = ranges[rangeTypeKey];
13122
+ this.lowerBound = this.dictRange[0];
13123
+ this.upperBound = this.dictRange[1];
13124
+ 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) {
13125
+ finalDict.push(String.fromCharCode(this.dictIndex));
13126
+ }
13127
+ });
13128
+ }
13129
+ if (shuffle2) {
13130
+ const PROBABILITY = 0.5;
13131
+ finalDict = finalDict.sort(() => Math.random() - PROBABILITY);
13132
+ }
13133
+ return finalDict;
13134
+ });
13135
+ __publicField(this, "setDictionary", (dictionary2, shuffle2) => {
13136
+ this.dict = this._normalizeDictionary(dictionary2, shuffle2);
13137
+ this.dictLength = this.dict.length;
13138
+ this.setCounter(0);
13139
+ });
13140
+ __publicField(this, "seq", () => {
13141
+ return this.sequentialUUID();
13142
+ });
13143
+ __publicField(this, "sequentialUUID", () => {
13144
+ let counterDiv;
13145
+ let counterRem;
13146
+ let id3 = "";
13147
+ counterDiv = this.counter;
13148
+ do {
13149
+ counterRem = counterDiv % this.dictLength;
13150
+ counterDiv = Math.trunc(counterDiv / this.dictLength);
13151
+ id3 += this.dict[counterRem];
13152
+ } while (counterDiv !== 0);
13153
+ this.counter += 1;
13154
+ return id3;
13155
+ });
13156
+ __publicField(this, "rnd", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
13157
+ return this.randomUUID(uuidLength);
13158
+ });
13159
+ __publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
13160
+ let id3;
13161
+ let randomPartIdx;
13162
+ let j;
13163
+ if (uuidLength === null || typeof uuidLength === "undefined" || uuidLength < 1) {
13164
+ throw new Error("Invalid UUID Length Provided");
13165
+ }
13166
+ const isPositive = uuidLength >= 0;
13167
+ id3 = "";
13168
+ for (j = 0; j < uuidLength; j += 1) {
13169
+ randomPartIdx = parseInt(
13170
+ (Math.random() * this.dictLength).toFixed(0),
13171
+ 10
13172
+ ) % this.dictLength;
13173
+ id3 += this.dict[randomPartIdx];
13174
+ }
13175
+ return id3;
13176
+ });
13177
+ __publicField(this, "fmt", (format, date) => {
13178
+ return this.formattedUUID(format, date);
13179
+ });
13180
+ __publicField(this, "formattedUUID", (format, date) => {
13181
+ const fnMap = {
13182
+ "$r": this.randomUUID,
13183
+ "$s": this.sequentialUUID,
13184
+ "$t": this.stamp
13185
+ };
13186
+ const result = format.replace(
13187
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
13188
+ (m) => {
13189
+ const fn = m.slice(0, 2);
13190
+ const len = parseInt(m.slice(2), 10);
13191
+ if (fn === "$s") {
13192
+ return fnMap[fn]().padStart(len, "0");
13193
+ }
13194
+ if (fn === "$t" && date) {
13195
+ return fnMap[fn](len, date);
13196
+ }
13197
+ return fnMap[fn](len);
13198
+ }
13199
+ );
13200
+ return result;
13201
+ });
13202
+ __publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
13203
+ return parseFloat(
13204
+ Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
13205
+ );
13206
+ });
13207
+ __publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
13208
+ return parseFloat(
13209
+ Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
13210
+ );
13211
+ });
13212
+ __publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
13213
+ return parseFloat(
13214
+ (this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
13215
+ );
13216
+ });
13217
+ __publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
13218
+ const score = parseFloat(
13219
+ (1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
13220
+ );
13221
+ return score > 1 ? 1 : score < 0 ? 0 : score;
13222
+ });
13223
+ __publicField(this, "getVersion", () => {
13224
+ return this.version;
13225
+ });
13226
+ __publicField(this, "stamp", (finalLength, date) => {
13227
+ const hexStamp = Math.floor(+(date || /* @__PURE__ */ new Date()) / 1e3).toString(16);
13228
+ if (typeof finalLength === "number" && finalLength === 0) {
13229
+ return hexStamp;
13230
+ }
13231
+ if (typeof finalLength !== "number" || finalLength < 10) {
13232
+ throw new Error(
13233
+ [
13234
+ "Param finalLength must be a number greater than or equal to 10,",
13235
+ "or 0 if you want the raw hexadecimal timestamp"
13236
+ ].join("\n")
13237
+ );
13238
+ }
13239
+ const idLength = finalLength - 9;
13240
+ const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
13241
+ const id3 = this.randomUUID(idLength);
13242
+ return `${id3.substring(0, rndIdx)}${hexStamp}${id3.substring(rndIdx)}${rndIdx.toString(16)}`;
13243
+ });
13244
+ __publicField(this, "parseStamp", (suid, format) => {
13245
+ if (format && !/t0|t[1-9]\d{1,}/.test(format)) {
13246
+ throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
13247
+ }
13248
+ const stamp = format ? format.replace(
13249
+ /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
13250
+ (m) => {
13251
+ const fnMap = {
13252
+ "$r": (len2) => [...Array(len2)].map(() => "r").join(""),
13253
+ "$s": (len2) => [...Array(len2)].map(() => "s").join(""),
13254
+ "$t": (len2) => [...Array(len2)].map(() => "t").join("")
13255
+ };
13256
+ const fn = m.slice(0, 2);
13257
+ const len = parseInt(m.slice(2), 10);
13258
+ return fnMap[fn](len);
13259
+ }
13260
+ ).replace(
13261
+ /^(.*?)(t{8,})(.*)$/g,
13262
+ (_m, p1, p2) => {
13263
+ return suid.substring(p1.length, p1.length + p2.length);
13264
+ }
13265
+ ) : suid;
13266
+ if (stamp.length === 8) {
13267
+ return new Date(parseInt(stamp, 16) * 1e3);
13268
+ }
13269
+ if (stamp.length < 10) {
13270
+ throw new Error("Stamp length invalid");
13271
+ }
13272
+ const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
13273
+ return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
13274
+ });
13275
+ __publicField(this, "setCounter", (counter2) => {
13276
+ this.counter = counter2;
13277
+ });
13278
+ __publicField(this, "validate", (uid, dictionary2) => {
13279
+ const finalDictionary = dictionary2 ? this._normalizeDictionary(dictionary2) : this.dict;
13280
+ return uid.split("").every((c) => finalDictionary.includes(c));
13281
+ });
13282
+ const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
13283
+ this.counter = 0;
13284
+ this.debug = false;
13285
+ this.dict = [];
13286
+ this.version = version;
13287
+ const {
13288
+ dictionary,
13289
+ shuffle,
13290
+ length,
13291
+ counter
13292
+ } = options;
13293
+ this.uuidLength = length;
13294
+ this.setDictionary(dictionary, shuffle);
13295
+ this.setCounter(counter);
13296
+ this.debug = options.debug;
13297
+ this.log(this.dict);
13298
+ this.log(
13299
+ `Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
13300
+ );
13301
+ this.log = this.log.bind(this);
13302
+ this.setDictionary = this.setDictionary.bind(this);
13303
+ this.setCounter = this.setCounter.bind(this);
13304
+ this.seq = this.seq.bind(this);
13305
+ this.sequentialUUID = this.sequentialUUID.bind(this);
13306
+ this.rnd = this.rnd.bind(this);
13307
+ this.randomUUID = this.randomUUID.bind(this);
13308
+ this.fmt = this.fmt.bind(this);
13309
+ this.formattedUUID = this.formattedUUID.bind(this);
13310
+ this.availableUUIDs = this.availableUUIDs.bind(this);
13311
+ this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this);
13312
+ this.collisionProbability = this.collisionProbability.bind(this);
13313
+ this.uniqueness = this.uniqueness.bind(this);
13314
+ this.getVersion = this.getVersion.bind(this);
13315
+ this.stamp = this.stamp.bind(this);
13316
+ this.parseStamp = this.parseStamp.bind(this);
13317
+ return this;
13318
+ }
13319
+ };
13320
+ __publicField(_ShortUniqueId, "default", _ShortUniqueId);
13321
+ var ShortUniqueId2 = _ShortUniqueId;
13322
+ return __toCommonJS(src_exports);
13323
+ })();
13324
+ "undefined" != typeof module2 && (module2.exports = ShortUniqueId.default), "undefined" != typeof window && (ShortUniqueId = ShortUniqueId.default);
13325
+ }
13326
+ });
13327
+
12986
13328
  // ../node_modules/@babel/runtime/helpers/esm/typeof.js
12987
13329
  function _typeof(o) {
12988
13330
  "@babel/helpers - typeof";
@@ -25528,7 +25870,8 @@ export {
25528
25870
  graph2 as graph,
25529
25871
  lit2 as lit,
25530
25872
  st2 as st,
25531
- namedNode3 as namedNode
25873
+ namedNode3 as namedNode,
25874
+ require_short_unique_id
25532
25875
  };
25533
25876
  /*! Bundled license information:
25534
25877
 
@@ -3,355 +3,13 @@ import {
3
3
  isNamedNode,
4
4
  lit,
5
5
  namedNode,
6
+ require_short_unique_id,
6
7
  st
7
- } from "./chunk-7VQUARYZ.js";
8
+ } from "./chunk-XBA7NYKJ.js";
8
9
  import {
9
- __commonJS,
10
10
  __toESM
11
11
  } from "./chunk-U67V476Y.js";
12
12
 
13
- // ../node_modules/short-unique-id/dist/short-unique-id.js
14
- var require_short_unique_id = __commonJS({
15
- "../node_modules/short-unique-id/dist/short-unique-id.js"(exports, module) {
16
- "use strict";
17
- var ShortUniqueId2 = (() => {
18
- var __defProp = Object.defineProperty;
19
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
20
- var __getOwnPropNames = Object.getOwnPropertyNames;
21
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
22
- var __hasOwnProp = Object.prototype.hasOwnProperty;
23
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
24
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
25
- var __spreadValues = (a, b) => {
26
- for (var prop in b || (b = {}))
27
- if (__hasOwnProp.call(b, prop))
28
- __defNormalProp(a, prop, b[prop]);
29
- if (__getOwnPropSymbols)
30
- for (var prop of __getOwnPropSymbols(b)) {
31
- if (__propIsEnum.call(b, prop))
32
- __defNormalProp(a, prop, b[prop]);
33
- }
34
- return a;
35
- };
36
- var __export = (target, all) => {
37
- for (var name in all)
38
- __defProp(target, name, { get: all[name], enumerable: true });
39
- };
40
- var __copyProps = (to, from, except, desc) => {
41
- if (from && typeof from === "object" || typeof from === "function") {
42
- for (let key of __getOwnPropNames(from))
43
- if (!__hasOwnProp.call(to, key) && key !== except)
44
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
- }
46
- return to;
47
- };
48
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
49
- var __publicField = (obj, key, value) => {
50
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
51
- return value;
52
- };
53
- var src_exports = {};
54
- __export(src_exports, {
55
- DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
56
- DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
57
- default: () => ShortUniqueId3
58
- });
59
- var version = "5.2.0";
60
- var DEFAULT_UUID_LENGTH = 6;
61
- var DEFAULT_OPTIONS = {
62
- dictionary: "alphanum",
63
- shuffle: true,
64
- debug: false,
65
- length: DEFAULT_UUID_LENGTH,
66
- counter: 0
67
- };
68
- var _ShortUniqueId = class _ShortUniqueId {
69
- constructor(argOptions = {}) {
70
- __publicField(this, "counter");
71
- __publicField(this, "debug");
72
- __publicField(this, "dict");
73
- __publicField(this, "version");
74
- __publicField(this, "dictIndex", 0);
75
- __publicField(this, "dictRange", []);
76
- __publicField(this, "lowerBound", 0);
77
- __publicField(this, "upperBound", 0);
78
- __publicField(this, "dictLength", 0);
79
- __publicField(this, "uuidLength");
80
- __publicField(this, "_digit_first_ascii", 48);
81
- __publicField(this, "_digit_last_ascii", 58);
82
- __publicField(this, "_alpha_lower_first_ascii", 97);
83
- __publicField(this, "_alpha_lower_last_ascii", 123);
84
- __publicField(this, "_hex_last_ascii", 103);
85
- __publicField(this, "_alpha_upper_first_ascii", 65);
86
- __publicField(this, "_alpha_upper_last_ascii", 91);
87
- __publicField(this, "_number_dict_ranges", {
88
- digits: [this._digit_first_ascii, this._digit_last_ascii]
89
- });
90
- __publicField(this, "_alpha_dict_ranges", {
91
- lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
92
- upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
93
- });
94
- __publicField(this, "_alpha_lower_dict_ranges", {
95
- lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
96
- });
97
- __publicField(this, "_alpha_upper_dict_ranges", {
98
- upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
99
- });
100
- __publicField(this, "_alphanum_dict_ranges", {
101
- digits: [this._digit_first_ascii, this._digit_last_ascii],
102
- lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii],
103
- upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
104
- });
105
- __publicField(this, "_alphanum_lower_dict_ranges", {
106
- digits: [this._digit_first_ascii, this._digit_last_ascii],
107
- lowerCase: [this._alpha_lower_first_ascii, this._alpha_lower_last_ascii]
108
- });
109
- __publicField(this, "_alphanum_upper_dict_ranges", {
110
- digits: [this._digit_first_ascii, this._digit_last_ascii],
111
- upperCase: [this._alpha_upper_first_ascii, this._alpha_upper_last_ascii]
112
- });
113
- __publicField(this, "_hex_dict_ranges", {
114
- decDigits: [this._digit_first_ascii, this._digit_last_ascii],
115
- alphaDigits: [this._alpha_lower_first_ascii, this._hex_last_ascii]
116
- });
117
- __publicField(this, "_dict_ranges", {
118
- _number_dict_ranges: this._number_dict_ranges,
119
- _alpha_dict_ranges: this._alpha_dict_ranges,
120
- _alpha_lower_dict_ranges: this._alpha_lower_dict_ranges,
121
- _alpha_upper_dict_ranges: this._alpha_upper_dict_ranges,
122
- _alphanum_dict_ranges: this._alphanum_dict_ranges,
123
- _alphanum_lower_dict_ranges: this._alphanum_lower_dict_ranges,
124
- _alphanum_upper_dict_ranges: this._alphanum_upper_dict_ranges,
125
- _hex_dict_ranges: this._hex_dict_ranges
126
- });
127
- __publicField(this, "log", (...args) => {
128
- const finalArgs = [...args];
129
- finalArgs[0] = `[short-unique-id] ${args[0]}`;
130
- if (this.debug === true) {
131
- if (typeof console !== "undefined" && console !== null) {
132
- return console.log(...finalArgs);
133
- }
134
- }
135
- });
136
- __publicField(this, "_normalizeDictionary", (dictionary2, shuffle2) => {
137
- let finalDict;
138
- if (dictionary2 && Array.isArray(dictionary2) && dictionary2.length > 1) {
139
- finalDict = dictionary2;
140
- } else {
141
- finalDict = [];
142
- let i;
143
- this.dictIndex = i = 0;
144
- const rangesName = `_${dictionary2}_dict_ranges`;
145
- const ranges = this._dict_ranges[rangesName];
146
- Object.keys(ranges).forEach((rangeType) => {
147
- const rangeTypeKey = rangeType;
148
- this.dictRange = ranges[rangeTypeKey];
149
- this.lowerBound = this.dictRange[0];
150
- this.upperBound = this.dictRange[1];
151
- 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) {
152
- finalDict.push(String.fromCharCode(this.dictIndex));
153
- }
154
- });
155
- }
156
- if (shuffle2) {
157
- const PROBABILITY = 0.5;
158
- finalDict = finalDict.sort(() => Math.random() - PROBABILITY);
159
- }
160
- return finalDict;
161
- });
162
- __publicField(this, "setDictionary", (dictionary2, shuffle2) => {
163
- this.dict = this._normalizeDictionary(dictionary2, shuffle2);
164
- this.dictLength = this.dict.length;
165
- this.setCounter(0);
166
- });
167
- __publicField(this, "seq", () => {
168
- return this.sequentialUUID();
169
- });
170
- __publicField(this, "sequentialUUID", () => {
171
- let counterDiv;
172
- let counterRem;
173
- let id = "";
174
- counterDiv = this.counter;
175
- do {
176
- counterRem = counterDiv % this.dictLength;
177
- counterDiv = Math.trunc(counterDiv / this.dictLength);
178
- id += this.dict[counterRem];
179
- } while (counterDiv !== 0);
180
- this.counter += 1;
181
- return id;
182
- });
183
- __publicField(this, "rnd", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
184
- return this.randomUUID(uuidLength);
185
- });
186
- __publicField(this, "randomUUID", (uuidLength = this.uuidLength || DEFAULT_UUID_LENGTH) => {
187
- let id;
188
- let randomPartIdx;
189
- let j;
190
- if (uuidLength === null || typeof uuidLength === "undefined" || uuidLength < 1) {
191
- throw new Error("Invalid UUID Length Provided");
192
- }
193
- const isPositive = uuidLength >= 0;
194
- id = "";
195
- for (j = 0; j < uuidLength; j += 1) {
196
- randomPartIdx = parseInt(
197
- (Math.random() * this.dictLength).toFixed(0),
198
- 10
199
- ) % this.dictLength;
200
- id += this.dict[randomPartIdx];
201
- }
202
- return id;
203
- });
204
- __publicField(this, "fmt", (format, date) => {
205
- return this.formattedUUID(format, date);
206
- });
207
- __publicField(this, "formattedUUID", (format, date) => {
208
- const fnMap = {
209
- "$r": this.randomUUID,
210
- "$s": this.sequentialUUID,
211
- "$t": this.stamp
212
- };
213
- const result = format.replace(
214
- /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
215
- (m) => {
216
- const fn = m.slice(0, 2);
217
- const len = parseInt(m.slice(2), 10);
218
- if (fn === "$s") {
219
- return fnMap[fn]().padStart(len, "0");
220
- }
221
- if (fn === "$t" && date) {
222
- return fnMap[fn](len, date);
223
- }
224
- return fnMap[fn](len);
225
- }
226
- );
227
- return result;
228
- });
229
- __publicField(this, "availableUUIDs", (uuidLength = this.uuidLength) => {
230
- return parseFloat(
231
- Math.pow([...new Set(this.dict)].length, uuidLength).toFixed(0)
232
- );
233
- });
234
- __publicField(this, "approxMaxBeforeCollision", (rounds = this.availableUUIDs(this.uuidLength)) => {
235
- return parseFloat(
236
- Math.sqrt(Math.PI / 2 * rounds).toFixed(20)
237
- );
238
- });
239
- __publicField(this, "collisionProbability", (rounds = this.availableUUIDs(this.uuidLength), uuidLength = this.uuidLength) => {
240
- return parseFloat(
241
- (this.approxMaxBeforeCollision(rounds) / this.availableUUIDs(uuidLength)).toFixed(20)
242
- );
243
- });
244
- __publicField(this, "uniqueness", (rounds = this.availableUUIDs(this.uuidLength)) => {
245
- const score = parseFloat(
246
- (1 - this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20)
247
- );
248
- return score > 1 ? 1 : score < 0 ? 0 : score;
249
- });
250
- __publicField(this, "getVersion", () => {
251
- return this.version;
252
- });
253
- __publicField(this, "stamp", (finalLength, date) => {
254
- const hexStamp = Math.floor(+(date || /* @__PURE__ */ new Date()) / 1e3).toString(16);
255
- if (typeof finalLength === "number" && finalLength === 0) {
256
- return hexStamp;
257
- }
258
- if (typeof finalLength !== "number" || finalLength < 10) {
259
- throw new Error(
260
- [
261
- "Param finalLength must be a number greater than or equal to 10,",
262
- "or 0 if you want the raw hexadecimal timestamp"
263
- ].join("\n")
264
- );
265
- }
266
- const idLength = finalLength - 9;
267
- const rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
268
- const id = this.randomUUID(idLength);
269
- return `${id.substring(0, rndIdx)}${hexStamp}${id.substring(rndIdx)}${rndIdx.toString(16)}`;
270
- });
271
- __publicField(this, "parseStamp", (suid, format) => {
272
- if (format && !/t0|t[1-9]\d{1,}/.test(format)) {
273
- throw new Error("Cannot extract date from a formated UUID with no timestamp in the format");
274
- }
275
- const stamp = format ? format.replace(
276
- /\$[rs]\d{0,}|\$t0|\$t[1-9]\d{1,}/g,
277
- (m) => {
278
- const fnMap = {
279
- "$r": (len2) => [...Array(len2)].map(() => "r").join(""),
280
- "$s": (len2) => [...Array(len2)].map(() => "s").join(""),
281
- "$t": (len2) => [...Array(len2)].map(() => "t").join("")
282
- };
283
- const fn = m.slice(0, 2);
284
- const len = parseInt(m.slice(2), 10);
285
- return fnMap[fn](len);
286
- }
287
- ).replace(
288
- /^(.*?)(t{8,})(.*)$/g,
289
- (_m, p1, p2) => {
290
- return suid.substring(p1.length, p1.length + p2.length);
291
- }
292
- ) : suid;
293
- if (stamp.length === 8) {
294
- return new Date(parseInt(stamp, 16) * 1e3);
295
- }
296
- if (stamp.length < 10) {
297
- throw new Error("Stamp length invalid");
298
- }
299
- const rndIdx = parseInt(stamp.substring(stamp.length - 1), 16);
300
- return new Date(parseInt(stamp.substring(rndIdx, rndIdx + 8), 16) * 1e3);
301
- });
302
- __publicField(this, "setCounter", (counter2) => {
303
- this.counter = counter2;
304
- });
305
- __publicField(this, "validate", (uid2, dictionary2) => {
306
- const finalDictionary = dictionary2 ? this._normalizeDictionary(dictionary2) : this.dict;
307
- return uid2.split("").every((c) => finalDictionary.includes(c));
308
- });
309
- const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
310
- this.counter = 0;
311
- this.debug = false;
312
- this.dict = [];
313
- this.version = version;
314
- const {
315
- dictionary,
316
- shuffle,
317
- length,
318
- counter
319
- } = options;
320
- this.uuidLength = length;
321
- this.setDictionary(dictionary, shuffle);
322
- this.setCounter(counter);
323
- this.debug = options.debug;
324
- this.log(this.dict);
325
- this.log(
326
- `Generator instantiated with Dictionary Size ${this.dictLength} and counter set to ${this.counter}`
327
- );
328
- this.log = this.log.bind(this);
329
- this.setDictionary = this.setDictionary.bind(this);
330
- this.setCounter = this.setCounter.bind(this);
331
- this.seq = this.seq.bind(this);
332
- this.sequentialUUID = this.sequentialUUID.bind(this);
333
- this.rnd = this.rnd.bind(this);
334
- this.randomUUID = this.randomUUID.bind(this);
335
- this.fmt = this.fmt.bind(this);
336
- this.formattedUUID = this.formattedUUID.bind(this);
337
- this.availableUUIDs = this.availableUUIDs.bind(this);
338
- this.approxMaxBeforeCollision = this.approxMaxBeforeCollision.bind(this);
339
- this.collisionProbability = this.collisionProbability.bind(this);
340
- this.uniqueness = this.uniqueness.bind(this);
341
- this.getVersion = this.getVersion.bind(this);
342
- this.stamp = this.stamp.bind(this);
343
- this.parseStamp = this.parseStamp.bind(this);
344
- return this;
345
- }
346
- };
347
- __publicField(_ShortUniqueId, "default", _ShortUniqueId);
348
- var ShortUniqueId3 = _ShortUniqueId;
349
- return __toCommonJS(src_exports);
350
- })();
351
- "undefined" != typeof module && (module.exports = ShortUniqueId2.default), "undefined" != typeof window && (ShortUniqueId2 = ShortUniqueId2.default);
352
- }
353
- });
354
-
355
13
  // ../node_modules/@solid-data-modules/contacts-rdflib/dist/rdflib/namespaces.js
356
14
  var vcard = Namespace("http://www.w3.org/2006/vcard/ns#");
357
15
  var dc = Namespace("http://purl.org/dc/elements/1.1/");
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import {
2
+ Namespace,
2
3
  UpdateManager,
3
4
  fetcher,
4
5
  graph,
@@ -7,8 +8,9 @@ import {
7
8
  isNamedNode,
8
9
  lit,
9
10
  namedNode,
11
+ require_short_unique_id,
10
12
  st
11
- } from "./chunk-7VQUARYZ.js";
13
+ } from "./chunk-XBA7NYKJ.js";
12
14
  import {
13
15
  __commonJS,
14
16
  __export,
@@ -13587,7 +13589,7 @@ var FileFetcher = class {
13587
13589
 
13588
13590
  // src/modules/contacts.ts
13589
13591
  async function loadContactsModule(store) {
13590
- const module2 = await import("./dist-F3EUFQHU.js");
13592
+ const module2 = await import("./dist-5TZZFAHE.js");
13591
13593
  return new module2.default({
13592
13594
  store: store.graph,
13593
13595
  fetcher: store.fetcher,
@@ -13925,6 +13927,48 @@ var LabelIndex = class extends RdfDocument {
13925
13927
  }
13926
13928
  };
13927
13929
 
13930
+ // node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js
13931
+ async function executeUpdate(fetcher2, updater, operation3) {
13932
+ await updater.updateMany(operation3.deletions, operation3.insertions);
13933
+ operation3.filesToCreate.map((file2) => {
13934
+ createEmptyTurtleFile(fetcher2, file2.url);
13935
+ });
13936
+ }
13937
+ function createEmptyTurtleFile(fetcher2, url7) {
13938
+ return fetcher2.webOperation("PUT", url7, {
13939
+ contentType: "text/turtle"
13940
+ });
13941
+ }
13942
+
13943
+ // node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
13944
+ var rdf = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
13945
+ var solid = Namespace("http://www.w3.org/ns/solid/terms#");
13946
+ var pim = Namespace("http://www.w3.org/ns/pim/space#");
13947
+ var ldp = Namespace("http://www.w3.org/ns/ldp#");
13948
+
13949
+ // node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
13950
+ var import_short_unique_id = __toESM(require_short_unique_id(), 1);
13951
+ var uid = new import_short_unique_id.default({ length: 10 });
13952
+
13953
+ // src/namespaces/index.ts
13954
+ var rdfs = Namespace("http://www.w3.org/2000/01/rdf-schema#");
13955
+
13956
+ // src/search/addToLabelIndex.ts
13957
+ var addToLabelIndex = (thing, labelIndex) => {
13958
+ return {
13959
+ deletions: [],
13960
+ filesToCreate: [],
13961
+ insertions: [
13962
+ st(
13963
+ namedNode(thing.uri),
13964
+ rdfs("label"),
13965
+ lit(thing.label()),
13966
+ namedNode(labelIndex.uri)
13967
+ )
13968
+ ]
13969
+ };
13970
+ };
13971
+
13928
13972
  // src/Store.ts
13929
13973
  var Store = class {
13930
13974
  constructor(session4) {
@@ -14009,6 +14053,10 @@ var Store = class {
14009
14053
  }
14010
14054
  );
14011
14055
  }
14056
+ async addToLabelIndex(thing, labelIndex) {
14057
+ const operation3 = addToLabelIndex(thing, labelIndex);
14058
+ await executeUpdate(this.fetcher, this.updater, operation3);
14059
+ }
14012
14060
  };
14013
14061
 
14014
14062
  // ../node_modules/rdf-namespaces/dist/index.es.js
@@ -14025,21 +14073,21 @@ __export(index_es_exports, {
14025
14073
  foaf: () => foaf,
14026
14074
  http: () => http,
14027
14075
  hydra: () => hydra,
14028
- ldp: () => ldp,
14076
+ ldp: () => ldp2,
14029
14077
  link: () => link3,
14030
14078
  log: () => log,
14031
14079
  meeting: () => meeting,
14032
14080
  owl: () => owl,
14033
14081
  qu: () => qu,
14034
- rdf: () => rdf,
14035
- rdfs: () => rdfs,
14082
+ rdf: () => rdf2,
14083
+ rdfs: () => rdfs2,
14036
14084
  sched: () => sched,
14037
14085
  schema: () => schema,
14038
14086
  schema_https: () => schema_https,
14039
14087
  sec: () => sec,
14040
14088
  sioc: () => sioc,
14041
14089
  skos: () => skos,
14042
- solid: () => solid,
14090
+ solid: () => solid2,
14043
14091
  space: () => space,
14044
14092
  tab: () => tab,
14045
14093
  tabont: () => tabont,
@@ -14392,7 +14440,7 @@ var recurrenceId = "http://www.w3.org/2002/12/cal/ical#recurrenceId";
14392
14440
  var DomainOf_rrule = "http://www.w3.org/2002/12/cal/ical#DomainOf_rrule";
14393
14441
  var relatedTo = "http://www.w3.org/2002/12/cal/ical#relatedTo";
14394
14442
  var url2 = "http://www.w3.org/2002/12/cal/ical#url";
14395
- var uid = "http://www.w3.org/2002/12/cal/ical#uid";
14443
+ var uid2 = "http://www.w3.org/2002/12/cal/ical#uid";
14396
14444
  var exdate = "http://www.w3.org/2002/12/cal/ical#exdate";
14397
14445
  var exrule = "http://www.w3.org/2002/12/cal/ical#exrule";
14398
14446
  var Value_RECUR = "http://www.w3.org/2002/12/cal/ical#Value_RECUR";
@@ -14452,7 +14500,7 @@ var calImport = /* @__PURE__ */ Object.freeze({
14452
14500
  DomainOf_rrule,
14453
14501
  relatedTo,
14454
14502
  url: url2,
14455
- uid,
14503
+ uid: uid2,
14456
14504
  exdate,
14457
14505
  exrule,
14458
14506
  Value_RECUR,
@@ -16880,7 +16928,7 @@ var _containedItemQuantity = "http://hl7.org/fhir/_containedItemQuantity";
16880
16928
  var _daysSupply = "http://hl7.org/fhir/_daysSupply";
16881
16929
  var reportingVendor = "http://hl7.org/fhir/reportingVendor";
16882
16930
  var current = "http://hl7.org/fhir/current";
16883
- var uid2 = "http://hl7.org/fhir/uid";
16931
+ var uid3 = "http://hl7.org/fhir/uid";
16884
16932
  var order = "http://hl7.org/fhir/order";
16885
16933
  var priorPrescription = "http://hl7.org/fhir/priorPrescription";
16886
16934
  var distanceFromLandmark = "http://hl7.org/fhir/distanceFromLandmark";
@@ -21113,7 +21161,7 @@ var fhirImport = /* @__PURE__ */ Object.freeze({
21113
21161
  _daysSupply,
21114
21162
  reportingVendor,
21115
21163
  current,
21116
- uid: uid2,
21164
+ uid: uid3,
21117
21165
  order,
21118
21166
  priorPrescription,
21119
21167
  distanceFromLandmark,
@@ -34274,22 +34322,22 @@ var fhir = fhirImport;
34274
34322
  var foaf = foafImport;
34275
34323
  var http = httpImport;
34276
34324
  var hydra = hydraImport;
34277
- var ldp = ldpImport;
34325
+ var ldp2 = ldpImport;
34278
34326
  var link3 = linkImport;
34279
34327
  var log = logImport;
34280
34328
  var meeting = meetingImport;
34281
34329
  var owl = owlImport;
34282
34330
  var qu = quImport;
34283
34331
  var trip3 = tripImport;
34284
- var rdf = rdfImport;
34285
- var rdfs = rdfsImport;
34332
+ var rdf2 = rdfImport;
34333
+ var rdfs2 = rdfsImport;
34286
34334
  var sched = schedImport;
34287
34335
  var schema = schemaImport;
34288
34336
  var schema_https = schema_httpsImport;
34289
34337
  var sec = secImport;
34290
34338
  var sioc = siocImport;
34291
34339
  var skos = skosImport;
34292
- var solid = solidImport;
34340
+ var solid2 = solidImport;
34293
34341
  var space = spaceImport;
34294
34342
  var tab = tabImport;
34295
34343
  var tabont = tabontImport;
@@ -34462,6 +34510,14 @@ var PodOS = class {
34462
34510
  loadContactsModule() {
34463
34511
  return loadContactsModule(this.store);
34464
34512
  }
34513
+ /**
34514
+ * Adds a label of the given thing to the label index, so that it can be found after the search index has been rebuilt
34515
+ * @param thing - The thing to index
34516
+ * @param labelIndex - The index to update
34517
+ */
34518
+ async addToLabelIndex(thing, labelIndex) {
34519
+ await this.store.addToLabelIndex(thing, labelIndex);
34520
+ }
34465
34521
  };
34466
34522
  export {
34467
34523
  BinaryFile,
package/lib/index.js CHANGED
@@ -13470,12 +13470,12 @@ var PodOS = (() => {
13470
13470
  bookmark: "http://www.w3.org/2002/01/bookmark#",
13471
13471
  vann: "http://purl.org/vocab/vann/"
13472
13472
  };
13473
- function vocab(rdf5 = { namedNode: (u) => u }) {
13473
+ function vocab(rdf6 = { namedNode: (u) => u }) {
13474
13474
  const namespaces = {};
13475
13475
  for (const alias2 in aliases) {
13476
13476
  const expansion2 = aliases[alias2];
13477
13477
  namespaces[alias2] = function(localName = "") {
13478
- return rdf5.namedNode(expansion2 + localName);
13478
+ return rdf6.namedNode(expansion2 + localName);
13479
13479
  };
13480
13480
  }
13481
13481
  ;
@@ -41222,7 +41222,7 @@ var PodOS = (() => {
41222
41222
  var require_short_unique_id = __commonJS({
41223
41223
  "../node_modules/short-unique-id/dist/short-unique-id.js"(exports, module3) {
41224
41224
  "use strict";
41225
- var ShortUniqueId2 = (() => {
41225
+ var ShortUniqueId3 = (() => {
41226
41226
  var __defProp2 = Object.defineProperty;
41227
41227
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
41228
41228
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
@@ -41258,11 +41258,11 @@ var PodOS = (() => {
41258
41258
  __defNormalProp(obj, typeof key3 !== "symbol" ? key3 + "" : key3, value6);
41259
41259
  return value6;
41260
41260
  };
41261
- var src_exports2 = {};
41262
- __export2(src_exports2, {
41261
+ var src_exports = {};
41262
+ __export2(src_exports, {
41263
41263
  DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
41264
41264
  DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
41265
- default: () => ShortUniqueId3
41265
+ default: () => ShortUniqueId4
41266
41266
  });
41267
41267
  var version6 = "5.2.0";
41268
41268
  var DEFAULT_UUID_LENGTH = 6;
@@ -41510,9 +41510,9 @@ var PodOS = (() => {
41510
41510
  __publicField(this, "setCounter", (counter2) => {
41511
41511
  this.counter = counter2;
41512
41512
  });
41513
- __publicField(this, "validate", (uid4, dictionary2) => {
41513
+ __publicField(this, "validate", (uid5, dictionary2) => {
41514
41514
  const finalDictionary = dictionary2 ? this._normalizeDictionary(dictionary2) : this.dict;
41515
- return uid4.split("").every((c) => finalDictionary.includes(c));
41515
+ return uid5.split("").every((c) => finalDictionary.includes(c));
41516
41516
  });
41517
41517
  const options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
41518
41518
  this.counter = 0;
@@ -41553,10 +41553,10 @@ var PodOS = (() => {
41553
41553
  }
41554
41554
  };
41555
41555
  __publicField(_ShortUniqueId, "default", _ShortUniqueId);
41556
- var ShortUniqueId3 = _ShortUniqueId;
41557
- return __toCommonJS2(src_exports2);
41556
+ var ShortUniqueId4 = _ShortUniqueId;
41557
+ return __toCommonJS2(src_exports);
41558
41558
  })();
41559
- "undefined" != typeof module3 && (module3.exports = ShortUniqueId2.default), "undefined" != typeof window && (ShortUniqueId2 = ShortUniqueId2.default);
41559
+ "undefined" != typeof module3 && (module3.exports = ShortUniqueId3.default), "undefined" != typeof window && (ShortUniqueId3 = ShortUniqueId3.default);
41560
41560
  }
41561
41561
  });
41562
41562
 
@@ -44268,8 +44268,8 @@ var PodOS = (() => {
44268
44268
  });
44269
44269
 
44270
44270
  // src/index.ts
44271
- var src_exports = {};
44272
- __export(src_exports, {
44271
+ var index_exports = {};
44272
+ __export(index_exports, {
44273
44273
  BinaryFile: () => BinaryFile,
44274
44274
  BrokenFile: () => BrokenFile,
44275
44275
  BrowserSession: () => BrowserSession,
@@ -49737,6 +49737,55 @@ var PodOS = (() => {
49737
49737
 
49738
49738
  // src/Store.ts
49739
49739
  init_esm();
49740
+
49741
+ // node_modules/@solid-data-modules/rdflib-utils/dist/web-operations/executeUpdate.js
49742
+ async function executeUpdate2(fetcher3, updater, operation3) {
49743
+ await updater.updateMany(operation3.deletions, operation3.insertions);
49744
+ operation3.filesToCreate.map((file2) => {
49745
+ createEmptyTurtleFile2(fetcher3, file2.url);
49746
+ });
49747
+ }
49748
+ function createEmptyTurtleFile2(fetcher3, url7) {
49749
+ return fetcher3.webOperation("PUT", url7, {
49750
+ contentType: "text/turtle"
49751
+ });
49752
+ }
49753
+
49754
+ // node_modules/@solid-data-modules/rdflib-utils/dist/namespaces/index.js
49755
+ init_esm();
49756
+ var rdf4 = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
49757
+ var solid2 = Namespace("http://www.w3.org/ns/solid/terms#");
49758
+ var pim2 = Namespace("http://www.w3.org/ns/pim/space#");
49759
+ var ldp2 = Namespace("http://www.w3.org/ns/ldp#");
49760
+
49761
+ // node_modules/@solid-data-modules/rdflib-utils/dist/identifier/generate-id.js
49762
+ var import_short_unique_id2 = __toESM(require_short_unique_id(), 1);
49763
+ var uid2 = new import_short_unique_id2.default({ length: 10 });
49764
+
49765
+ // src/search/addToLabelIndex.ts
49766
+ init_esm();
49767
+
49768
+ // src/namespaces/index.ts
49769
+ init_esm();
49770
+ var rdfs = Namespace("http://www.w3.org/2000/01/rdf-schema#");
49771
+
49772
+ // src/search/addToLabelIndex.ts
49773
+ var addToLabelIndex = (thing, labelIndex) => {
49774
+ return {
49775
+ deletions: [],
49776
+ filesToCreate: [],
49777
+ insertions: [
49778
+ st2(
49779
+ namedNode2(thing.uri),
49780
+ rdfs("label"),
49781
+ lit2(thing.label()),
49782
+ namedNode2(labelIndex.uri)
49783
+ )
49784
+ ]
49785
+ };
49786
+ };
49787
+
49788
+ // src/Store.ts
49740
49789
  var Store = class {
49741
49790
  constructor(session4) {
49742
49791
  this.graph = graph2();
@@ -49820,6 +49869,10 @@ var PodOS = (() => {
49820
49869
  }
49821
49870
  );
49822
49871
  }
49872
+ async addToLabelIndex(thing, labelIndex) {
49873
+ const operation3 = addToLabelIndex(thing, labelIndex);
49874
+ await executeUpdate2(this.fetcher, this.updater, operation3);
49875
+ }
49823
49876
  };
49824
49877
 
49825
49878
  // ../node_modules/rdf-namespaces/dist/index.es.js
@@ -49836,21 +49889,21 @@ var PodOS = (() => {
49836
49889
  foaf: () => foaf,
49837
49890
  http: () => http,
49838
49891
  hydra: () => hydra,
49839
- ldp: () => ldp2,
49892
+ ldp: () => ldp3,
49840
49893
  link: () => link3,
49841
49894
  log: () => log2,
49842
49895
  meeting: () => meeting,
49843
49896
  owl: () => owl,
49844
49897
  qu: () => qu,
49845
- rdf: () => rdf4,
49846
- rdfs: () => rdfs,
49898
+ rdf: () => rdf5,
49899
+ rdfs: () => rdfs2,
49847
49900
  sched: () => sched,
49848
49901
  schema: () => schema,
49849
49902
  schema_https: () => schema_https,
49850
49903
  sec: () => sec,
49851
49904
  sioc: () => sioc,
49852
49905
  skos: () => skos,
49853
- solid: () => solid2,
49906
+ solid: () => solid3,
49854
49907
  space: () => space,
49855
49908
  tab: () => tab,
49856
49909
  tabont: () => tabont,
@@ -50203,7 +50256,7 @@ var PodOS = (() => {
50203
50256
  var DomainOf_rrule = "http://www.w3.org/2002/12/cal/ical#DomainOf_rrule";
50204
50257
  var relatedTo = "http://www.w3.org/2002/12/cal/ical#relatedTo";
50205
50258
  var url2 = "http://www.w3.org/2002/12/cal/ical#url";
50206
- var uid2 = "http://www.w3.org/2002/12/cal/ical#uid";
50259
+ var uid3 = "http://www.w3.org/2002/12/cal/ical#uid";
50207
50260
  var exdate = "http://www.w3.org/2002/12/cal/ical#exdate";
50208
50261
  var exrule = "http://www.w3.org/2002/12/cal/ical#exrule";
50209
50262
  var Value_RECUR = "http://www.w3.org/2002/12/cal/ical#Value_RECUR";
@@ -50263,7 +50316,7 @@ var PodOS = (() => {
50263
50316
  DomainOf_rrule,
50264
50317
  relatedTo,
50265
50318
  url: url2,
50266
- uid: uid2,
50319
+ uid: uid3,
50267
50320
  exdate,
50268
50321
  exrule,
50269
50322
  Value_RECUR,
@@ -52691,7 +52744,7 @@ var PodOS = (() => {
52691
52744
  var _daysSupply = "http://hl7.org/fhir/_daysSupply";
52692
52745
  var reportingVendor = "http://hl7.org/fhir/reportingVendor";
52693
52746
  var current = "http://hl7.org/fhir/current";
52694
- var uid3 = "http://hl7.org/fhir/uid";
52747
+ var uid4 = "http://hl7.org/fhir/uid";
52695
52748
  var order = "http://hl7.org/fhir/order";
52696
52749
  var priorPrescription = "http://hl7.org/fhir/priorPrescription";
52697
52750
  var distanceFromLandmark = "http://hl7.org/fhir/distanceFromLandmark";
@@ -56924,7 +56977,7 @@ var PodOS = (() => {
56924
56977
  _daysSupply,
56925
56978
  reportingVendor,
56926
56979
  current,
56927
- uid: uid3,
56980
+ uid: uid4,
56928
56981
  order,
56929
56982
  priorPrescription,
56930
56983
  distanceFromLandmark,
@@ -70085,22 +70138,22 @@ var PodOS = (() => {
70085
70138
  var foaf = foafImport;
70086
70139
  var http = httpImport;
70087
70140
  var hydra = hydraImport;
70088
- var ldp2 = ldpImport;
70141
+ var ldp3 = ldpImport;
70089
70142
  var link3 = linkImport;
70090
70143
  var log2 = logImport;
70091
70144
  var meeting = meetingImport;
70092
70145
  var owl = owlImport;
70093
70146
  var qu = quImport;
70094
70147
  var trip3 = tripImport;
70095
- var rdf4 = rdfImport;
70096
- var rdfs = rdfsImport;
70148
+ var rdf5 = rdfImport;
70149
+ var rdfs2 = rdfsImport;
70097
70150
  var sched = schedImport;
70098
70151
  var schema = schemaImport;
70099
70152
  var schema_https = schema_httpsImport;
70100
70153
  var sec = secImport;
70101
70154
  var sioc = siocImport;
70102
70155
  var skos = skosImport;
70103
- var solid2 = solidImport;
70156
+ var solid3 = solidImport;
70104
70157
  var space = spaceImport;
70105
70158
  var tab = tabImport;
70106
70159
  var tabont = tabontImport;
@@ -70274,8 +70327,16 @@ var PodOS = (() => {
70274
70327
  loadContactsModule() {
70275
70328
  return loadContactsModule(this.store);
70276
70329
  }
70330
+ /**
70331
+ * Adds a label of the given thing to the label index, so that it can be found after the search index has been rebuilt
70332
+ * @param thing - The thing to index
70333
+ * @param labelIndex - The index to update
70334
+ */
70335
+ async addToLabelIndex(thing, labelIndex) {
70336
+ await this.store.addToLabelIndex(thing, labelIndex);
70337
+ }
70277
70338
  };
70278
- return __toCommonJS(src_exports);
70339
+ return __toCommonJS(index_exports);
70279
70340
  })();
70280
70341
  /*! Bundled license information:
70281
70342
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pod-os/core",
3
- "version": "0.13.1-5f6551f.0",
3
+ "version": "0.13.1-735eb6a.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./types/index.d.ts",
6
6
  "files": [
@@ -26,24 +26,25 @@
26
26
  "devDependencies": {
27
27
  "@babel/preset-env": "^7.26.0",
28
28
  "@babel/preset-typescript": "^7.26.0",
29
- "@eslint/js": "^9.17.0",
29
+ "@eslint/js": "^9.18.0",
30
30
  "@types/jest": "^29.5.14",
31
31
  "@types/jest-when": "^3.5.5",
32
32
  "@types/sparqljs": "^3.1.12",
33
- "esbuild": "^0.24.0",
34
- "eslint": "^9.17.0",
33
+ "esbuild": "^0.24.2",
34
+ "eslint": "^9.18.0",
35
35
  "jest": "^29.7.0",
36
36
  "jest-when": "^3.7.0",
37
37
  "prettier": "^3.4.2",
38
38
  "rdf-namespaces": "^1.12.0",
39
39
  "rimraf": "^6.0.1",
40
40
  "sparqljs": "^3.7.3",
41
- "typescript": "5.7.2",
41
+ "typescript": "5.7.3",
42
42
  "typescript-eslint": "^7.18.0"
43
43
  },
44
44
  "dependencies": {
45
45
  "@inrupt/solid-client-authn-browser": "^2.3.0",
46
46
  "@solid-data-modules/contacts-rdflib": "^0.7.0",
47
+ "@solid-data-modules/rdflib-utils": "^0.5.0",
47
48
  "@types/lunr": "^2.3.7",
48
49
  "buffer": "^6.0.3",
49
50
  "lunr": "^2.3.9",
package/types/Store.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { Fetcher, IndexedFormula, UpdateManager } from "rdflib";
2
2
  import { PodOsSession } from "./authentication";
3
3
  import { Thing } from "./thing";
4
+ import { LabelIndex } from "./search";
4
5
  /**
5
6
  * The store contains all data that is known locally.
6
7
  * It can be used to fetch additional data from the web and also update data and sync it back to editable resources.
@@ -33,4 +34,5 @@ export declare class Store {
33
34
  */
34
35
  addPropertyValue(thing: Thing, property: string, value: string): Promise<void>;
35
36
  addNewThing(uri: string, name: string, type: string): Promise<void>;
37
+ addToLabelIndex(thing: Thing, labelIndex: LabelIndex): Promise<void>;
36
38
  }
package/types/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { BehaviorSubject } from "rxjs";
3
3
  import { SessionInfo } from "./authentication";
4
4
  import { SolidFile } from "./files";
5
5
  import { WebIdProfile } from "./profile";
6
- import { SearchIndex } from "./search";
6
+ import { LabelIndex, SearchIndex } from "./search";
7
7
  import { Store } from "./Store";
8
8
  import { Term } from "./terms";
9
9
  import { Thing } from "./thing";
@@ -57,4 +57,10 @@ export declare class PodOS {
57
57
  logout(): Promise<void>;
58
58
  login(oidcIssuer?: string): Promise<void>;
59
59
  loadContactsModule(): Promise<ContactsModule>;
60
+ /**
61
+ * Adds a label of the given thing to the label index, so that it can be found after the search index has been rebuilt
62
+ * @param thing - The thing to index
63
+ * @param labelIndex - The index to update
64
+ */
65
+ addToLabelIndex(thing: Thing, labelIndex: LabelIndex): Promise<void>;
60
66
  }
@@ -0,0 +1 @@
1
+ export declare const rdfs: (ln: string) => import("rdflib/lib/tf-types").NamedNode;
@@ -0,0 +1,4 @@
1
+ import { UpdateOperation } from "@solid-data-modules/rdflib-utils";
2
+ import { LabelIndex } from "./LabelIndex";
3
+ import { Thing } from "../thing";
4
+ export declare const addToLabelIndex: (thing: Thing, labelIndex: LabelIndex) => UpdateOperation;
@@ -0,0 +1 @@
1
+ export {};