@pod-os/core 0.12.1-fef97c9.0 → 0.13.1-0b8a8a5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7VQUARYZ.js → chunk-XBA7NYKJ.js} +344 -1
- package/dist/{dist-F3EUFQHU.js → dist-5TZZFAHE.js} +2 -344
- package/dist/index.js +159 -85
- package/lib/index.js +176 -97
- package/package.json +13 -12
- package/types/Store.d.ts +2 -0
- package/types/index.d.ts +7 -1
- package/types/namespaces/index.d.ts +1 -0
- package/types/search/addToLabelIndex.d.ts +4 -0
- package/types/search/addToLabelIndex.spec.d.ts +1 -0
- package/types/thing/Thing.d.ts +2 -0
- package/types/thing/index.d.ts +1 -0
- package/types/thing/labelFromUri.d.ts +5 -0
- package/types/thing/labelFromUri.spec.d.ts +1 -0
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(
|
|
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
|
|
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
|
|
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
|
|
41262
|
-
__export2(
|
|
41261
|
+
var src_exports = {};
|
|
41262
|
+
__export2(src_exports, {
|
|
41263
41263
|
DEFAULT_OPTIONS: () => DEFAULT_OPTIONS,
|
|
41264
41264
|
DEFAULT_UUID_LENGTH: () => DEFAULT_UUID_LENGTH,
|
|
41265
|
-
default: () =>
|
|
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", (
|
|
41513
|
+
__publicField(this, "validate", (uid5, dictionary2) => {
|
|
41514
41514
|
const finalDictionary = dictionary2 ? this._normalizeDictionary(dictionary2) : this.dict;
|
|
41515
|
-
return
|
|
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
|
|
41557
|
-
return __toCommonJS2(
|
|
41556
|
+
var ShortUniqueId4 = _ShortUniqueId;
|
|
41557
|
+
return __toCommonJS2(src_exports);
|
|
41558
41558
|
})();
|
|
41559
|
-
"undefined" != typeof module3 && (module3.exports =
|
|
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
|
|
44272
|
-
__export(
|
|
44271
|
+
var index_exports = {};
|
|
44272
|
+
__export(index_exports, {
|
|
44273
44273
|
BinaryFile: () => BinaryFile,
|
|
44274
44274
|
BrokenFile: () => BrokenFile,
|
|
44275
44275
|
BrowserSession: () => BrowserSession,
|
|
@@ -44280,7 +44280,8 @@ var PodOS = (() => {
|
|
|
44280
44280
|
RdfDocument: () => RdfDocument,
|
|
44281
44281
|
SearchIndex: () => SearchIndex,
|
|
44282
44282
|
Thing: () => Thing,
|
|
44283
|
-
WebIdProfile: () => WebIdProfile
|
|
44283
|
+
WebIdProfile: () => WebIdProfile,
|
|
44284
|
+
labelFromUri: () => labelFromUri
|
|
44284
44285
|
});
|
|
44285
44286
|
|
|
44286
44287
|
// ../node_modules/tslib/tslib.es6.mjs
|
|
@@ -45975,125 +45976,118 @@ var PodOS = (() => {
|
|
|
45975
45976
|
|
|
45976
45977
|
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/util/errors.js
|
|
45977
45978
|
var JOSEError = class extends Error {
|
|
45978
|
-
|
|
45979
|
-
|
|
45980
|
-
}
|
|
45981
|
-
constructor(message4) {
|
|
45982
|
-
super(message4);
|
|
45979
|
+
constructor(message4, options) {
|
|
45980
|
+
super(message4, options);
|
|
45983
45981
|
this.code = "ERR_JOSE_GENERIC";
|
|
45984
45982
|
this.name = this.constructor.name;
|
|
45985
45983
|
Error.captureStackTrace?.(this, this.constructor);
|
|
45986
45984
|
}
|
|
45987
45985
|
};
|
|
45986
|
+
JOSEError.code = "ERR_JOSE_GENERIC";
|
|
45988
45987
|
var JWTClaimValidationFailed = class extends JOSEError {
|
|
45989
|
-
static get code() {
|
|
45990
|
-
return "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
45991
|
-
}
|
|
45992
45988
|
constructor(message4, payload4, claim2 = "unspecified", reason2 = "unspecified") {
|
|
45993
|
-
super(message4);
|
|
45989
|
+
super(message4, { cause: { claim: claim2, reason: reason2, payload: payload4 } });
|
|
45994
45990
|
this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
45995
45991
|
this.claim = claim2;
|
|
45996
45992
|
this.reason = reason2;
|
|
45997
45993
|
this.payload = payload4;
|
|
45998
45994
|
}
|
|
45999
45995
|
};
|
|
45996
|
+
JWTClaimValidationFailed.code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
46000
45997
|
var JWTExpired = class extends JOSEError {
|
|
46001
|
-
static get code() {
|
|
46002
|
-
return "ERR_JWT_EXPIRED";
|
|
46003
|
-
}
|
|
46004
45998
|
constructor(message4, payload4, claim2 = "unspecified", reason2 = "unspecified") {
|
|
46005
|
-
super(message4);
|
|
45999
|
+
super(message4, { cause: { claim: claim2, reason: reason2, payload: payload4 } });
|
|
46006
46000
|
this.code = "ERR_JWT_EXPIRED";
|
|
46007
46001
|
this.claim = claim2;
|
|
46008
46002
|
this.reason = reason2;
|
|
46009
46003
|
this.payload = payload4;
|
|
46010
46004
|
}
|
|
46011
46005
|
};
|
|
46006
|
+
JWTExpired.code = "ERR_JWT_EXPIRED";
|
|
46012
46007
|
var JOSEAlgNotAllowed = class extends JOSEError {
|
|
46013
46008
|
constructor() {
|
|
46014
46009
|
super(...arguments);
|
|
46015
46010
|
this.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
46016
46011
|
}
|
|
46017
|
-
static get code() {
|
|
46018
|
-
return "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
46019
|
-
}
|
|
46020
46012
|
};
|
|
46013
|
+
JOSEAlgNotAllowed.code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
46021
46014
|
var JOSENotSupported = class extends JOSEError {
|
|
46022
46015
|
constructor() {
|
|
46023
46016
|
super(...arguments);
|
|
46024
46017
|
this.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
46025
46018
|
}
|
|
46026
|
-
|
|
46027
|
-
|
|
46019
|
+
};
|
|
46020
|
+
JOSENotSupported.code = "ERR_JOSE_NOT_SUPPORTED";
|
|
46021
|
+
var JWEDecryptionFailed = class extends JOSEError {
|
|
46022
|
+
constructor(message4 = "decryption operation failed", options) {
|
|
46023
|
+
super(message4, options);
|
|
46024
|
+
this.code = "ERR_JWE_DECRYPTION_FAILED";
|
|
46028
46025
|
}
|
|
46029
46026
|
};
|
|
46027
|
+
JWEDecryptionFailed.code = "ERR_JWE_DECRYPTION_FAILED";
|
|
46028
|
+
var JWEInvalid = class extends JOSEError {
|
|
46029
|
+
constructor() {
|
|
46030
|
+
super(...arguments);
|
|
46031
|
+
this.code = "ERR_JWE_INVALID";
|
|
46032
|
+
}
|
|
46033
|
+
};
|
|
46034
|
+
JWEInvalid.code = "ERR_JWE_INVALID";
|
|
46030
46035
|
var JWSInvalid = class extends JOSEError {
|
|
46031
46036
|
constructor() {
|
|
46032
46037
|
super(...arguments);
|
|
46033
46038
|
this.code = "ERR_JWS_INVALID";
|
|
46034
46039
|
}
|
|
46035
|
-
static get code() {
|
|
46036
|
-
return "ERR_JWS_INVALID";
|
|
46037
|
-
}
|
|
46038
46040
|
};
|
|
46041
|
+
JWSInvalid.code = "ERR_JWS_INVALID";
|
|
46039
46042
|
var JWTInvalid = class extends JOSEError {
|
|
46040
46043
|
constructor() {
|
|
46041
46044
|
super(...arguments);
|
|
46042
46045
|
this.code = "ERR_JWT_INVALID";
|
|
46043
46046
|
}
|
|
46044
|
-
|
|
46045
|
-
|
|
46047
|
+
};
|
|
46048
|
+
JWTInvalid.code = "ERR_JWT_INVALID";
|
|
46049
|
+
var JWKInvalid = class extends JOSEError {
|
|
46050
|
+
constructor() {
|
|
46051
|
+
super(...arguments);
|
|
46052
|
+
this.code = "ERR_JWK_INVALID";
|
|
46046
46053
|
}
|
|
46047
46054
|
};
|
|
46055
|
+
JWKInvalid.code = "ERR_JWK_INVALID";
|
|
46048
46056
|
var JWKSInvalid = class extends JOSEError {
|
|
46049
46057
|
constructor() {
|
|
46050
46058
|
super(...arguments);
|
|
46051
46059
|
this.code = "ERR_JWKS_INVALID";
|
|
46052
46060
|
}
|
|
46053
|
-
static get code() {
|
|
46054
|
-
return "ERR_JWKS_INVALID";
|
|
46055
|
-
}
|
|
46056
46061
|
};
|
|
46062
|
+
JWKSInvalid.code = "ERR_JWKS_INVALID";
|
|
46057
46063
|
var JWKSNoMatchingKey = class extends JOSEError {
|
|
46058
|
-
constructor() {
|
|
46059
|
-
super(
|
|
46064
|
+
constructor(message4 = "no applicable key found in the JSON Web Key Set", options) {
|
|
46065
|
+
super(message4, options);
|
|
46060
46066
|
this.code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
46061
|
-
this.message = "no applicable key found in the JSON Web Key Set";
|
|
46062
|
-
}
|
|
46063
|
-
static get code() {
|
|
46064
|
-
return "ERR_JWKS_NO_MATCHING_KEY";
|
|
46065
46067
|
}
|
|
46066
46068
|
};
|
|
46069
|
+
JWKSNoMatchingKey.code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
46067
46070
|
var JWKSMultipleMatchingKeys = class extends JOSEError {
|
|
46068
|
-
constructor() {
|
|
46069
|
-
super(
|
|
46071
|
+
constructor(message4 = "multiple matching keys found in the JSON Web Key Set", options) {
|
|
46072
|
+
super(message4, options);
|
|
46070
46073
|
this.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
46071
|
-
this.message = "multiple matching keys found in the JSON Web Key Set";
|
|
46072
|
-
}
|
|
46073
|
-
static get code() {
|
|
46074
|
-
return "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
46075
46074
|
}
|
|
46076
46075
|
};
|
|
46076
|
+
JWKSMultipleMatchingKeys.code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
46077
46077
|
var JWKSTimeout = class extends JOSEError {
|
|
46078
|
-
constructor() {
|
|
46079
|
-
super(
|
|
46078
|
+
constructor(message4 = "request timed out", options) {
|
|
46079
|
+
super(message4, options);
|
|
46080
46080
|
this.code = "ERR_JWKS_TIMEOUT";
|
|
46081
|
-
this.message = "request timed out";
|
|
46082
|
-
}
|
|
46083
|
-
static get code() {
|
|
46084
|
-
return "ERR_JWKS_TIMEOUT";
|
|
46085
46081
|
}
|
|
46086
46082
|
};
|
|
46083
|
+
JWKSTimeout.code = "ERR_JWKS_TIMEOUT";
|
|
46087
46084
|
var JWSSignatureVerificationFailed = class extends JOSEError {
|
|
46088
|
-
constructor() {
|
|
46089
|
-
super(
|
|
46085
|
+
constructor(message4 = "signature verification failed", options) {
|
|
46086
|
+
super(message4, options);
|
|
46090
46087
|
this.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
46091
|
-
this.message = "signature verification failed";
|
|
46092
|
-
}
|
|
46093
|
-
static get code() {
|
|
46094
|
-
return "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
46095
46088
|
}
|
|
46096
46089
|
};
|
|
46090
|
+
JWSSignatureVerificationFailed.code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
46097
46091
|
|
|
46098
46092
|
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/jose/dist/browser/lib/crypto_key.js
|
|
46099
46093
|
function unusable(name7, prop = "algorithm.name") {
|
|
@@ -47323,7 +47317,7 @@ var PodOS = (() => {
|
|
|
47323
47317
|
var USER_AGENT;
|
|
47324
47318
|
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) {
|
|
47325
47319
|
const NAME = "jose";
|
|
47326
|
-
const VERSION = "v5.9.
|
|
47320
|
+
const VERSION = "v5.9.6";
|
|
47327
47321
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
47328
47322
|
}
|
|
47329
47323
|
var jwksCache = Symbol();
|
|
@@ -47544,10 +47538,9 @@ var PodOS = (() => {
|
|
|
47544
47538
|
|
|
47545
47539
|
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/uuid/dist/esm-browser/stringify.js
|
|
47546
47540
|
var byteToHex = [];
|
|
47547
|
-
for (i = 0; i < 256; ++i) {
|
|
47541
|
+
for (let i = 0; i < 256; ++i) {
|
|
47548
47542
|
byteToHex.push((i + 256).toString(16).slice(1));
|
|
47549
47543
|
}
|
|
47550
|
-
var i;
|
|
47551
47544
|
function unsafeStringify(arr, offset3 = 0) {
|
|
47552
47545
|
return (byteToHex[arr[offset3 + 0]] + byteToHex[arr[offset3 + 1]] + byteToHex[arr[offset3 + 2]] + byteToHex[arr[offset3 + 3]] + "-" + byteToHex[arr[offset3 + 4]] + byteToHex[arr[offset3 + 5]] + "-" + byteToHex[arr[offset3 + 6]] + byteToHex[arr[offset3 + 7]] + "-" + byteToHex[arr[offset3 + 8]] + byteToHex[arr[offset3 + 9]] + "-" + byteToHex[arr[offset3 + 10]] + byteToHex[arr[offset3 + 11]] + byteToHex[arr[offset3 + 12]] + byteToHex[arr[offset3 + 13]] + byteToHex[arr[offset3 + 14]] + byteToHex[arr[offset3 + 15]]).toLowerCase();
|
|
47553
47546
|
}
|
|
@@ -47557,19 +47550,17 @@ var PodOS = (() => {
|
|
|
47557
47550
|
var rnds8 = new Uint8Array(16);
|
|
47558
47551
|
function rng() {
|
|
47559
47552
|
if (!getRandomValues) {
|
|
47560
|
-
|
|
47561
|
-
if (!getRandomValues) {
|
|
47553
|
+
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
47562
47554
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
47563
47555
|
}
|
|
47556
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
47564
47557
|
}
|
|
47565
47558
|
return getRandomValues(rnds8);
|
|
47566
47559
|
}
|
|
47567
47560
|
|
|
47568
47561
|
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/uuid/dist/esm-browser/native.js
|
|
47569
47562
|
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
47570
|
-
var native_default = {
|
|
47571
|
-
randomUUID
|
|
47572
|
-
};
|
|
47563
|
+
var native_default = { randomUUID };
|
|
47573
47564
|
|
|
47574
47565
|
// ../node_modules/@inrupt/solid-client-authn-core/node_modules/uuid/dist/esm-browser/v4.js
|
|
47575
47566
|
function v4(options, buf, offset3) {
|
|
@@ -47577,12 +47568,12 @@ var PodOS = (() => {
|
|
|
47577
47568
|
return native_default.randomUUID();
|
|
47578
47569
|
}
|
|
47579
47570
|
options = options || {};
|
|
47580
|
-
|
|
47571
|
+
const rnds = options.random || (options.rng || rng)();
|
|
47581
47572
|
rnds[6] = rnds[6] & 15 | 64;
|
|
47582
47573
|
rnds[8] = rnds[8] & 63 | 128;
|
|
47583
47574
|
if (buf) {
|
|
47584
47575
|
offset3 = offset3 || 0;
|
|
47585
|
-
for (
|
|
47576
|
+
for (let i = 0; i < 16; ++i) {
|
|
47586
47577
|
buf[offset3 + i] = rnds[i];
|
|
47587
47578
|
}
|
|
47588
47579
|
return buf;
|
|
@@ -48265,10 +48256,9 @@ var PodOS = (() => {
|
|
|
48265
48256
|
|
|
48266
48257
|
// ../node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/esm-browser/stringify.js
|
|
48267
48258
|
var byteToHex2 = [];
|
|
48268
|
-
for (i = 0; i < 256; ++i) {
|
|
48259
|
+
for (let i = 0; i < 256; ++i) {
|
|
48269
48260
|
byteToHex2.push((i + 256).toString(16).slice(1));
|
|
48270
48261
|
}
|
|
48271
|
-
var i;
|
|
48272
48262
|
function unsafeStringify2(arr, offset3 = 0) {
|
|
48273
48263
|
return (byteToHex2[arr[offset3 + 0]] + byteToHex2[arr[offset3 + 1]] + byteToHex2[arr[offset3 + 2]] + byteToHex2[arr[offset3 + 3]] + "-" + byteToHex2[arr[offset3 + 4]] + byteToHex2[arr[offset3 + 5]] + "-" + byteToHex2[arr[offset3 + 6]] + byteToHex2[arr[offset3 + 7]] + "-" + byteToHex2[arr[offset3 + 8]] + byteToHex2[arr[offset3 + 9]] + "-" + byteToHex2[arr[offset3 + 10]] + byteToHex2[arr[offset3 + 11]] + byteToHex2[arr[offset3 + 12]] + byteToHex2[arr[offset3 + 13]] + byteToHex2[arr[offset3 + 14]] + byteToHex2[arr[offset3 + 15]]).toLowerCase();
|
|
48274
48264
|
}
|
|
@@ -48278,19 +48268,17 @@ var PodOS = (() => {
|
|
|
48278
48268
|
var rnds82 = new Uint8Array(16);
|
|
48279
48269
|
function rng2() {
|
|
48280
48270
|
if (!getRandomValues2) {
|
|
48281
|
-
|
|
48282
|
-
if (!getRandomValues2) {
|
|
48271
|
+
if (typeof crypto === "undefined" || !crypto.getRandomValues) {
|
|
48283
48272
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
48284
48273
|
}
|
|
48274
|
+
getRandomValues2 = crypto.getRandomValues.bind(crypto);
|
|
48285
48275
|
}
|
|
48286
48276
|
return getRandomValues2(rnds82);
|
|
48287
48277
|
}
|
|
48288
48278
|
|
|
48289
48279
|
// ../node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/esm-browser/native.js
|
|
48290
48280
|
var randomUUID2 = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
48291
|
-
var native_default2 = {
|
|
48292
|
-
randomUUID: randomUUID2
|
|
48293
|
-
};
|
|
48281
|
+
var native_default2 = { randomUUID: randomUUID2 };
|
|
48294
48282
|
|
|
48295
48283
|
// ../node_modules/@inrupt/solid-client-authn-browser/node_modules/uuid/dist/esm-browser/v4.js
|
|
48296
48284
|
function v42(options, buf, offset3) {
|
|
@@ -48298,12 +48286,12 @@ var PodOS = (() => {
|
|
|
48298
48286
|
return native_default2.randomUUID();
|
|
48299
48287
|
}
|
|
48300
48288
|
options = options || {};
|
|
48301
|
-
|
|
48289
|
+
const rnds = options.random || (options.rng || rng2)();
|
|
48302
48290
|
rnds[6] = rnds[6] & 15 | 64;
|
|
48303
48291
|
rnds[8] = rnds[8] & 63 | 128;
|
|
48304
48292
|
if (buf) {
|
|
48305
48293
|
offset3 = offset3 || 0;
|
|
48306
|
-
for (
|
|
48294
|
+
for (let i = 0; i < 16; ++i) {
|
|
48307
48295
|
buf[offset3 + i] = rnds[i];
|
|
48308
48296
|
}
|
|
48309
48297
|
return buf;
|
|
@@ -49447,6 +49435,30 @@ var PodOS = (() => {
|
|
|
49447
49435
|
}
|
|
49448
49436
|
}
|
|
49449
49437
|
|
|
49438
|
+
// src/thing/labelFromUri.ts
|
|
49439
|
+
function labelFromUri(uri6) {
|
|
49440
|
+
const url7 = new URL(uri6);
|
|
49441
|
+
if (isTooGeneric(url7.hash)) {
|
|
49442
|
+
return (getFilename(url7) || url7.host + url7.pathname) + url7.hash;
|
|
49443
|
+
}
|
|
49444
|
+
return labelFromFragment(url7.hash) || getFilename(url7) || url7.host;
|
|
49445
|
+
}
|
|
49446
|
+
function labelFromFragment(fragment) {
|
|
49447
|
+
return fragment ? fragment.split("#")[1] : null;
|
|
49448
|
+
}
|
|
49449
|
+
function isTooGeneric(fragment) {
|
|
49450
|
+
const genericFragments = ["#it", "#this", "#me", "#i"];
|
|
49451
|
+
return genericFragments.includes(fragment);
|
|
49452
|
+
}
|
|
49453
|
+
function getFilename(url7) {
|
|
49454
|
+
if (url7.pathname.endsWith("/")) {
|
|
49455
|
+
const containerName = url7.pathname.split("/").at(-2);
|
|
49456
|
+
return containerName ? containerName + "/" : null;
|
|
49457
|
+
} else {
|
|
49458
|
+
return url7.pathname.split("/").pop();
|
|
49459
|
+
}
|
|
49460
|
+
}
|
|
49461
|
+
|
|
49450
49462
|
// src/thing/Thing.ts
|
|
49451
49463
|
var Thing = class {
|
|
49452
49464
|
constructor(uri6, store, editable = false) {
|
|
@@ -49468,13 +49480,17 @@ var PodOS = (() => {
|
|
|
49468
49480
|
"http://schema.org/caption",
|
|
49469
49481
|
"https://schema.org/caption"
|
|
49470
49482
|
);
|
|
49471
|
-
|
|
49483
|
+
if (value6) {
|
|
49484
|
+
return value6;
|
|
49485
|
+
}
|
|
49486
|
+
return labelFromUri(this.uri);
|
|
49472
49487
|
}
|
|
49473
49488
|
literals() {
|
|
49474
49489
|
const statements = this.store.statementsMatching(namedNode2(this.uri));
|
|
49475
49490
|
const values = statements.filter((it) => isLiteral(it.object)).reduce(accumulateValues, {});
|
|
49476
49491
|
return Object.keys(values).map((predicate2) => ({
|
|
49477
49492
|
predicate: predicate2,
|
|
49493
|
+
label: labelFromUri(predicate2),
|
|
49478
49494
|
values: values[predicate2]
|
|
49479
49495
|
}));
|
|
49480
49496
|
}
|
|
@@ -49483,6 +49499,7 @@ var PodOS = (() => {
|
|
|
49483
49499
|
const values = statements.filter((it) => isNamedNode(it.object) && !isRdfType(it.predicate)).reduce(accumulateValues, {});
|
|
49484
49500
|
return Object.keys(values).map((predicate2) => ({
|
|
49485
49501
|
predicate: predicate2,
|
|
49502
|
+
label: labelFromUri(predicate2),
|
|
49486
49503
|
uris: values[predicate2]
|
|
49487
49504
|
}));
|
|
49488
49505
|
}
|
|
@@ -49495,6 +49512,7 @@ var PodOS = (() => {
|
|
|
49495
49512
|
const values = statements.reduce(accumulateSubjects, {});
|
|
49496
49513
|
return Object.keys(values).map((predicate2) => ({
|
|
49497
49514
|
predicate: predicate2,
|
|
49515
|
+
label: labelFromUri(predicate2),
|
|
49498
49516
|
uris: values[predicate2]
|
|
49499
49517
|
}));
|
|
49500
49518
|
}
|
|
@@ -49719,6 +49737,55 @@ var PodOS = (() => {
|
|
|
49719
49737
|
|
|
49720
49738
|
// src/Store.ts
|
|
49721
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
|
|
49722
49789
|
var Store = class {
|
|
49723
49790
|
constructor(session4) {
|
|
49724
49791
|
this.graph = graph2();
|
|
@@ -49802,6 +49869,10 @@ var PodOS = (() => {
|
|
|
49802
49869
|
}
|
|
49803
49870
|
);
|
|
49804
49871
|
}
|
|
49872
|
+
async addToLabelIndex(thing, labelIndex) {
|
|
49873
|
+
const operation3 = addToLabelIndex(thing, labelIndex);
|
|
49874
|
+
await executeUpdate2(this.fetcher, this.updater, operation3);
|
|
49875
|
+
}
|
|
49805
49876
|
};
|
|
49806
49877
|
|
|
49807
49878
|
// ../node_modules/rdf-namespaces/dist/index.es.js
|
|
@@ -49818,21 +49889,21 @@ var PodOS = (() => {
|
|
|
49818
49889
|
foaf: () => foaf,
|
|
49819
49890
|
http: () => http,
|
|
49820
49891
|
hydra: () => hydra,
|
|
49821
|
-
ldp: () =>
|
|
49892
|
+
ldp: () => ldp3,
|
|
49822
49893
|
link: () => link3,
|
|
49823
49894
|
log: () => log2,
|
|
49824
49895
|
meeting: () => meeting,
|
|
49825
49896
|
owl: () => owl,
|
|
49826
49897
|
qu: () => qu,
|
|
49827
|
-
rdf: () =>
|
|
49828
|
-
rdfs: () =>
|
|
49898
|
+
rdf: () => rdf5,
|
|
49899
|
+
rdfs: () => rdfs2,
|
|
49829
49900
|
sched: () => sched,
|
|
49830
49901
|
schema: () => schema,
|
|
49831
49902
|
schema_https: () => schema_https,
|
|
49832
49903
|
sec: () => sec,
|
|
49833
49904
|
sioc: () => sioc,
|
|
49834
49905
|
skos: () => skos,
|
|
49835
|
-
solid: () =>
|
|
49906
|
+
solid: () => solid3,
|
|
49836
49907
|
space: () => space,
|
|
49837
49908
|
tab: () => tab,
|
|
49838
49909
|
tabont: () => tabont,
|
|
@@ -50185,7 +50256,7 @@ var PodOS = (() => {
|
|
|
50185
50256
|
var DomainOf_rrule = "http://www.w3.org/2002/12/cal/ical#DomainOf_rrule";
|
|
50186
50257
|
var relatedTo = "http://www.w3.org/2002/12/cal/ical#relatedTo";
|
|
50187
50258
|
var url2 = "http://www.w3.org/2002/12/cal/ical#url";
|
|
50188
|
-
var
|
|
50259
|
+
var uid3 = "http://www.w3.org/2002/12/cal/ical#uid";
|
|
50189
50260
|
var exdate = "http://www.w3.org/2002/12/cal/ical#exdate";
|
|
50190
50261
|
var exrule = "http://www.w3.org/2002/12/cal/ical#exrule";
|
|
50191
50262
|
var Value_RECUR = "http://www.w3.org/2002/12/cal/ical#Value_RECUR";
|
|
@@ -50245,7 +50316,7 @@ var PodOS = (() => {
|
|
|
50245
50316
|
DomainOf_rrule,
|
|
50246
50317
|
relatedTo,
|
|
50247
50318
|
url: url2,
|
|
50248
|
-
uid:
|
|
50319
|
+
uid: uid3,
|
|
50249
50320
|
exdate,
|
|
50250
50321
|
exrule,
|
|
50251
50322
|
Value_RECUR,
|
|
@@ -52673,7 +52744,7 @@ var PodOS = (() => {
|
|
|
52673
52744
|
var _daysSupply = "http://hl7.org/fhir/_daysSupply";
|
|
52674
52745
|
var reportingVendor = "http://hl7.org/fhir/reportingVendor";
|
|
52675
52746
|
var current = "http://hl7.org/fhir/current";
|
|
52676
|
-
var
|
|
52747
|
+
var uid4 = "http://hl7.org/fhir/uid";
|
|
52677
52748
|
var order = "http://hl7.org/fhir/order";
|
|
52678
52749
|
var priorPrescription = "http://hl7.org/fhir/priorPrescription";
|
|
52679
52750
|
var distanceFromLandmark = "http://hl7.org/fhir/distanceFromLandmark";
|
|
@@ -56906,7 +56977,7 @@ var PodOS = (() => {
|
|
|
56906
56977
|
_daysSupply,
|
|
56907
56978
|
reportingVendor,
|
|
56908
56979
|
current,
|
|
56909
|
-
uid:
|
|
56980
|
+
uid: uid4,
|
|
56910
56981
|
order,
|
|
56911
56982
|
priorPrescription,
|
|
56912
56983
|
distanceFromLandmark,
|
|
@@ -70067,22 +70138,22 @@ var PodOS = (() => {
|
|
|
70067
70138
|
var foaf = foafImport;
|
|
70068
70139
|
var http = httpImport;
|
|
70069
70140
|
var hydra = hydraImport;
|
|
70070
|
-
var
|
|
70141
|
+
var ldp3 = ldpImport;
|
|
70071
70142
|
var link3 = linkImport;
|
|
70072
70143
|
var log2 = logImport;
|
|
70073
70144
|
var meeting = meetingImport;
|
|
70074
70145
|
var owl = owlImport;
|
|
70075
70146
|
var qu = quImport;
|
|
70076
70147
|
var trip3 = tripImport;
|
|
70077
|
-
var
|
|
70078
|
-
var
|
|
70148
|
+
var rdf5 = rdfImport;
|
|
70149
|
+
var rdfs2 = rdfsImport;
|
|
70079
70150
|
var sched = schedImport;
|
|
70080
70151
|
var schema = schemaImport;
|
|
70081
70152
|
var schema_https = schema_httpsImport;
|
|
70082
70153
|
var sec = secImport;
|
|
70083
70154
|
var sioc = siocImport;
|
|
70084
70155
|
var skos = skosImport;
|
|
70085
|
-
var
|
|
70156
|
+
var solid3 = solidImport;
|
|
70086
70157
|
var space = spaceImport;
|
|
70087
70158
|
var tab = tabImport;
|
|
70088
70159
|
var tabont = tabontImport;
|
|
@@ -70256,8 +70327,16 @@ var PodOS = (() => {
|
|
|
70256
70327
|
loadContactsModule() {
|
|
70257
70328
|
return loadContactsModule(this.store);
|
|
70258
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
|
+
}
|
|
70259
70338
|
};
|
|
70260
|
-
return __toCommonJS(
|
|
70339
|
+
return __toCommonJS(index_exports);
|
|
70261
70340
|
})();
|
|
70262
70341
|
/*! Bundled license information:
|
|
70263
70342
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pod-os/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1-0b8a8a5.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -24,26 +24,27 @@
|
|
|
24
24
|
"author": "Angelo Veltens",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@babel/preset-env": "^7.
|
|
28
|
-
"@babel/preset-typescript": "^7.
|
|
29
|
-
"@eslint/js": "^9.
|
|
30
|
-
"@types/jest": "^29.5.
|
|
27
|
+
"@babel/preset-env": "^7.26.0",
|
|
28
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
29
|
+
"@eslint/js": "^9.18.0",
|
|
30
|
+
"@types/jest": "^29.5.14",
|
|
31
31
|
"@types/jest-when": "^3.5.5",
|
|
32
|
-
"@types/sparqljs": "^3.1.
|
|
33
|
-
"esbuild": "^0.24.
|
|
34
|
-
"eslint": "^9.
|
|
32
|
+
"@types/sparqljs": "^3.1.12",
|
|
33
|
+
"esbuild": "^0.24.2",
|
|
34
|
+
"eslint": "^9.18.0",
|
|
35
35
|
"jest": "^29.7.0",
|
|
36
|
-
"jest-when": "^3.
|
|
37
|
-
"prettier": "^3.
|
|
36
|
+
"jest-when": "^3.7.0",
|
|
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.
|
|
41
|
+
"typescript": "5.7.3",
|
|
42
42
|
"typescript-eslint": "^7.18.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@inrupt/solid-client-authn-browser": "^2.
|
|
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;
|