@startinblox/core 2.0.6-beta.7 → 2.0.6-beta.9
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/{custom-getter-DFIdqwHu.js → custom-getter-4u-Xg-ue.js} +2 -2
- package/dist/{helpers-vZrb1UDN.js → helpers-DtCY-jxq.js} +33 -33
- package/dist/helpers.js +1 -1
- package/dist/index.js +23305 -15068
- package/dist/{store-pxHgUL4R.js → store-DsK-vxfo.js} +597 -262
- package/dist/store.js +1 -1
- package/package.json +2 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { l as isUrlOrRelativePath, m as jsonldContextParserExports, o as getRawContext, n as normalizeContext, q as mergeContexts, c as doesResourceContainList, r as requireJsonldContextParser, v as requireErrorCoded, w as requireLink } from "./helpers-
|
|
5
|
-
let StoreService, formatAttributesToServerSearchOptions, base_context, StoreType, StoreFactory, hasQueryIndex, formatAttributesToServerPaginationOptions, getDefaultExportFromCjs, hasSetLocalData, sibStore, mergeServerSearchOptions, semantizer;
|
|
4
|
+
import { l as isUrlOrRelativePath, m as jsonldContextParserExports, o as getRawContext, n as normalizeContext, q as mergeContexts, c as doesResourceContainList, r as requireJsonldContextParser, v as requireErrorCoded, w as requireLink } from "./helpers-DtCY-jxq.js";
|
|
5
|
+
let AuthFetchResolver, DEFAULT_AUTH_SELECTORS, StoreService, formatAttributesToServerSearchOptions, base_context, StoreType, StoreFactory, hasQueryIndex, formatAttributesToServerPaginationOptions, getDefaultExportFromCjs, hasSetLocalData, sibStore, mergeServerSearchOptions, semantizer;
|
|
6
6
|
let __tla = (async () => {
|
|
7
7
|
var _a;
|
|
8
8
|
getDefaultExportFromCjs = function(x) {
|
|
9
9
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
10
10
|
};
|
|
11
11
|
function getAugmentedNamespace(n) {
|
|
12
|
-
if (n
|
|
12
|
+
if (Object.prototype.hasOwnProperty.call(n, "__esModule")) return n;
|
|
13
13
|
var f = n.default;
|
|
14
14
|
if (typeof f == "function") {
|
|
15
15
|
var a = function a2() {
|
|
@@ -268,6 +268,17 @@ let __tla = (async () => {
|
|
|
268
268
|
}
|
|
269
269
|
async negotiateContract(counterPartyAddress, _offerId, policy, counterPartyId) {
|
|
270
270
|
await this.ensureAuthenticated();
|
|
271
|
+
console.log("[DataspaceConnectorStore] Received policy for negotiation:", policy);
|
|
272
|
+
console.log("[DataspaceConnectorStore] Policy keys:", Object.keys(policy));
|
|
273
|
+
const cleanPolicy = {};
|
|
274
|
+
for (const key in policy) {
|
|
275
|
+
if (!/^\d+$/.test(key)) {
|
|
276
|
+
cleanPolicy[key] = policy[key];
|
|
277
|
+
} else {
|
|
278
|
+
console.warn(`[DataspaceConnectorStore] Removing numeric key "${key}" from policy`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
console.log("[DataspaceConnectorStore] Cleaned policy keys:", Object.keys(cleanPolicy));
|
|
271
282
|
const negotiationRequest = {
|
|
272
283
|
"@context": {
|
|
273
284
|
"@vocab": "https://w3id.org/edc/v0.0.1/ns/"
|
|
@@ -278,13 +289,15 @@ let __tla = (async () => {
|
|
|
278
289
|
protocol: "dataspace-protocol-http",
|
|
279
290
|
policy: {
|
|
280
291
|
"@context": "http://www.w3.org/ns/odrl.jsonld",
|
|
281
|
-
...
|
|
282
|
-
"@type": policy["@type"] || "Offer",
|
|
283
|
-
assigner: policy.assigner || counterPartyId || "provider",
|
|
284
|
-
target: policy.target
|
|
292
|
+
...cleanPolicy,
|
|
293
|
+
"@type": cleanPolicy["@type"] || policy["@type"] || "Offer",
|
|
294
|
+
assigner: cleanPolicy.assigner || policy.assigner || counterPartyId || "provider",
|
|
295
|
+
target: cleanPolicy.target || cleanPolicy["odrl:target"] || policy.target || policy["odrl:target"],
|
|
296
|
+
"odrl:target": cleanPolicy["odrl:target"] || cleanPolicy.target || policy["odrl:target"] || policy.target
|
|
285
297
|
}
|
|
286
298
|
};
|
|
287
299
|
console.log("[DataspaceConnectorStore] Contract negotiation request:", JSON.stringify(negotiationRequest, null, 2));
|
|
300
|
+
console.log("[DataspaceConnectorStore] \u{1F50D} POSTing negotiation to consumer connector:", this.config.contractNegotiationEndpoint);
|
|
288
301
|
const response = await this.fetchAuthn(this.config.contractNegotiationEndpoint, {
|
|
289
302
|
method: "POST",
|
|
290
303
|
headers: this.headers,
|
|
@@ -705,11 +718,11 @@ let __tla = (async () => {
|
|
|
705
718
|
async ensureAuthenticated() {
|
|
706
719
|
if (this.authToken && this.headers) return;
|
|
707
720
|
switch (this.config.authMethod) {
|
|
708
|
-
case "
|
|
709
|
-
if (!this.config.
|
|
710
|
-
throw new Error("
|
|
721
|
+
case "dsp-api-key":
|
|
722
|
+
if (!this.config.dspApiKey) {
|
|
723
|
+
throw new Error("DSP API key required but not provided. Set dspApiKey in configuration.");
|
|
711
724
|
}
|
|
712
|
-
this.authToken = this.config.
|
|
725
|
+
this.authToken = this.config.dspApiKey;
|
|
713
726
|
this.headers = {
|
|
714
727
|
...this.headers,
|
|
715
728
|
"X-Api-Key": this.authToken
|
|
@@ -1339,21 +1352,100 @@ let __tla = (async () => {
|
|
|
1339
1352
|
return property;
|
|
1340
1353
|
}
|
|
1341
1354
|
}
|
|
1342
|
-
|
|
1355
|
+
class DataspaceConnectorStoreAdapter {
|
|
1343
1356
|
constructor() {
|
|
1344
1357
|
}
|
|
1345
1358
|
static getStoreInstance(cfg) {
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1359
|
+
var _a2;
|
|
1360
|
+
if (!cfg) {
|
|
1361
|
+
throw new Error("DataspaceConnectorStore configuration is required");
|
|
1362
|
+
}
|
|
1363
|
+
const dspConfig = cfg;
|
|
1364
|
+
console.log("\u{1F3ED} [DataspaceConnectorStoreAdapter.getStoreInstance] Creating new store with config:", {
|
|
1365
|
+
endpoint: dspConfig.endpoint,
|
|
1366
|
+
catalogEndpoint: dspConfig.catalogEndpoint,
|
|
1367
|
+
negotiationEndpoint: dspConfig.contractNegotiationEndpoint
|
|
1368
|
+
});
|
|
1369
|
+
const newStore = new DataspaceConnectorStore(dspConfig);
|
|
1370
|
+
console.log("\u2705 [DataspaceConnectorStoreAdapter.getStoreInstance] Created store:", {
|
|
1371
|
+
storeType: typeof newStore,
|
|
1372
|
+
configEndpoint: (_a2 = newStore.config) == null ? void 0 : _a2.endpoint
|
|
1373
|
+
});
|
|
1374
|
+
return newStore;
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
DEFAULT_AUTH_SELECTORS = [
|
|
1378
|
+
"sib-auth-oidc",
|
|
1379
|
+
"sib-auth"
|
|
1380
|
+
];
|
|
1381
|
+
function findAuthElement(selectors = [
|
|
1382
|
+
...DEFAULT_AUTH_SELECTORS
|
|
1383
|
+
]) {
|
|
1384
|
+
for (const selector of selectors) {
|
|
1385
|
+
const element = document.querySelector(selector);
|
|
1386
|
+
if (element && typeof element.getFetch === "function") {
|
|
1387
|
+
return element;
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
return null;
|
|
1391
|
+
}
|
|
1392
|
+
function getAuthFetch(selectors) {
|
|
1393
|
+
const authElement = findAuthElement(selectors);
|
|
1394
|
+
if (authElement) {
|
|
1395
|
+
try {
|
|
1396
|
+
const authFetch = authElement.getFetch();
|
|
1397
|
+
if (typeof authFetch === "function") {
|
|
1398
|
+
return authFetch;
|
|
1349
1399
|
}
|
|
1350
|
-
|
|
1400
|
+
} catch (error2) {
|
|
1401
|
+
console.warn("[AuthFetchResolver] Error getting auth fetch:", error2);
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
return fetch.bind(globalThis);
|
|
1405
|
+
}
|
|
1406
|
+
function onAuthActivated(callback, eventName = "sib-auth:activated") {
|
|
1407
|
+
const handler2 = (event) => {
|
|
1408
|
+
var _a2;
|
|
1409
|
+
if (((_a2 = event.detail) == null ? void 0 : _a2.fetch) && typeof event.detail.fetch === "function") {
|
|
1410
|
+
callback(event);
|
|
1351
1411
|
}
|
|
1352
|
-
|
|
1412
|
+
};
|
|
1413
|
+
document.addEventListener(eventName, handler2);
|
|
1414
|
+
return () => {
|
|
1415
|
+
document.removeEventListener(eventName, handler2);
|
|
1416
|
+
};
|
|
1417
|
+
}
|
|
1418
|
+
async function waitForAuthElement(selectors = [
|
|
1419
|
+
...DEFAULT_AUTH_SELECTORS
|
|
1420
|
+
], timeout = 5e3) {
|
|
1421
|
+
const existing = findAuthElement(selectors);
|
|
1422
|
+
if (existing) {
|
|
1423
|
+
return existing;
|
|
1353
1424
|
}
|
|
1425
|
+
return new Promise((resolve, reject) => {
|
|
1426
|
+
const observer = new MutationObserver(() => {
|
|
1427
|
+
const element = findAuthElement(selectors);
|
|
1428
|
+
if (element) {
|
|
1429
|
+
observer.disconnect();
|
|
1430
|
+
resolve(element);
|
|
1431
|
+
}
|
|
1432
|
+
});
|
|
1433
|
+
observer.observe(document.body, {
|
|
1434
|
+
childList: true,
|
|
1435
|
+
subtree: true
|
|
1436
|
+
});
|
|
1437
|
+
setTimeout(() => {
|
|
1438
|
+
observer.disconnect();
|
|
1439
|
+
reject(new Error(`No auth element found with selectors: ${selectors.join(", ")}`));
|
|
1440
|
+
}, timeout);
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
AuthFetchResolver = {
|
|
1444
|
+
findAuthElement,
|
|
1445
|
+
getAuthFetch,
|
|
1446
|
+
onAuthActivated,
|
|
1447
|
+
waitForAuthElement
|
|
1354
1448
|
};
|
|
1355
|
-
__publicField(_DataspaceConnectorStoreAdapter, "store");
|
|
1356
|
-
let DataspaceConnectorStoreAdapter = _DataspaceConnectorStoreAdapter;
|
|
1357
1449
|
const _LocalStorageCacheMetadataManager = class _LocalStorageCacheMetadataManager {
|
|
1358
1450
|
constructor(endpoint, ttlMs = _LocalStorageCacheMetadataManager.DEFAULT_TTL_MS) {
|
|
1359
1451
|
this.endpoint = endpoint;
|
|
@@ -1539,16 +1631,69 @@ let __tla = (async () => {
|
|
|
1539
1631
|
__publicField(_LocalStorageCacheMetadataManager, "DEFAULT_TTL_MS", 2 * 60 * 60 * 1e3);
|
|
1540
1632
|
let LocalStorageCacheMetadataManager = _LocalStorageCacheMetadataManager;
|
|
1541
1633
|
class FederatedCatalogueAPIWrapper {
|
|
1542
|
-
constructor(options, fcBaseUrl) {
|
|
1634
|
+
constructor(options, fcBaseUrl, fetchAuth) {
|
|
1543
1635
|
__publicField(this, "fcBaseUrl");
|
|
1544
|
-
__publicField(this, "
|
|
1636
|
+
__publicField(this, "loginOptions");
|
|
1637
|
+
__publicField(this, "tokenState", null);
|
|
1638
|
+
__publicField(this, "tokenRefreshBuffer", 5 * 60 * 1e3);
|
|
1639
|
+
__publicField(this, "isRefreshing", false);
|
|
1640
|
+
__publicField(this, "refreshPromise", null);
|
|
1641
|
+
__publicField(this, "STORAGE_KEY", "fc_token_state");
|
|
1642
|
+
__publicField(this, "_fetch");
|
|
1643
|
+
__publicField(this, "useKeycloakAuth");
|
|
1545
1644
|
this.fcBaseUrl = fcBaseUrl;
|
|
1645
|
+
this.loginOptions = options;
|
|
1646
|
+
if (fetchAuth && (!options.kc_url || options.kc_url === "")) {
|
|
1647
|
+
this._fetch = fetchAuth;
|
|
1648
|
+
this.useKeycloakAuth = false;
|
|
1649
|
+
} else {
|
|
1650
|
+
this._fetch = fetch.bind(globalThis);
|
|
1651
|
+
this.useKeycloakAuth = true;
|
|
1652
|
+
this.loadTokenState();
|
|
1653
|
+
}
|
|
1654
|
+
if (this.useKeycloakAuth) {
|
|
1655
|
+
try {
|
|
1656
|
+
this.firstConnect(options);
|
|
1657
|
+
} catch (e) {
|
|
1658
|
+
console.log("Error while establishing the first connection", e);
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
saveTokenState() {
|
|
1663
|
+
if (this.tokenState) {
|
|
1664
|
+
try {
|
|
1665
|
+
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(this.tokenState));
|
|
1666
|
+
console.log("\u{1F4BE} [FederatedCatalogueAPIWrapper] Token state saved to localStorage");
|
|
1667
|
+
} catch (error2) {
|
|
1668
|
+
console.error("Failed to save token state to localStorage:", error2);
|
|
1669
|
+
}
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
loadTokenState() {
|
|
1673
|
+
var _a2, _b, _c;
|
|
1546
1674
|
try {
|
|
1547
|
-
const
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1675
|
+
const stored = localStorage.getItem(this.STORAGE_KEY);
|
|
1676
|
+
if (stored) {
|
|
1677
|
+
this.tokenState = JSON.parse(stored);
|
|
1678
|
+
console.log("\u{1F4C2} [FederatedCatalogueAPIWrapper] Token state loaded from localStorage:", {
|
|
1679
|
+
hasAccessToken: !!((_a2 = this.tokenState) == null ? void 0 : _a2.access_token),
|
|
1680
|
+
hasRefreshToken: !!((_b = this.tokenState) == null ? void 0 : _b.refresh_token),
|
|
1681
|
+
expiresAt: (_c = this.tokenState) == null ? void 0 : _c.expires_at,
|
|
1682
|
+
isExpired: this.tokenState ? Date.now() >= this.tokenState.expires_at : "N/A"
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1685
|
+
} catch (error2) {
|
|
1686
|
+
console.error("Failed to load token state from localStorage:", error2);
|
|
1687
|
+
this.clearTokenState();
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
clearTokenState() {
|
|
1691
|
+
this.tokenState = null;
|
|
1692
|
+
try {
|
|
1693
|
+
localStorage.removeItem(this.STORAGE_KEY);
|
|
1694
|
+
console.log("\u{1F5D1}\uFE0F [FederatedCatalogueAPIWrapper] Token state cleared");
|
|
1695
|
+
} catch (error2) {
|
|
1696
|
+
console.error("Failed to clear token state from localStorage:", error2);
|
|
1552
1697
|
}
|
|
1553
1698
|
}
|
|
1554
1699
|
async firstConnect(options) {
|
|
@@ -1563,7 +1708,7 @@ let __tla = (async () => {
|
|
|
1563
1708
|
const headers = new Headers({
|
|
1564
1709
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
1565
1710
|
});
|
|
1566
|
-
const response = await
|
|
1711
|
+
const response = await this._fetch(options.kc_url, {
|
|
1567
1712
|
method: "POST",
|
|
1568
1713
|
headers,
|
|
1569
1714
|
body
|
|
@@ -1575,30 +1720,130 @@ let __tla = (async () => {
|
|
|
1575
1720
|
cause: data
|
|
1576
1721
|
});
|
|
1577
1722
|
}
|
|
1723
|
+
this.tokenState = {
|
|
1724
|
+
access_token: token,
|
|
1725
|
+
refresh_token: data.refresh_token || null,
|
|
1726
|
+
expires_at: Date.now() + (data.expires_in || 3600) * 1e3
|
|
1727
|
+
};
|
|
1728
|
+
this.saveTokenState();
|
|
1578
1729
|
return token;
|
|
1579
1730
|
}
|
|
1580
|
-
async
|
|
1581
|
-
if (
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1731
|
+
async refreshToken() {
|
|
1732
|
+
if (this.isRefreshing && this.refreshPromise) {
|
|
1733
|
+
return this.refreshPromise;
|
|
1734
|
+
}
|
|
1735
|
+
this.isRefreshing = true;
|
|
1736
|
+
this.refreshPromise = this._performRefresh();
|
|
1737
|
+
try {
|
|
1738
|
+
const token = await this.refreshPromise;
|
|
1739
|
+
return token;
|
|
1740
|
+
} finally {
|
|
1741
|
+
this.isRefreshing = false;
|
|
1742
|
+
this.refreshPromise = null;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
async _performRefresh() {
|
|
1746
|
+
var _a2;
|
|
1747
|
+
if (!((_a2 = this.tokenState) == null ? void 0 : _a2.refresh_token)) {
|
|
1748
|
+
console.log("No refresh token available, re-authenticating with credentials");
|
|
1749
|
+
return this.firstConnect(this.loginOptions);
|
|
1750
|
+
}
|
|
1751
|
+
try {
|
|
1752
|
+
const body = new URLSearchParams({
|
|
1753
|
+
grant_type: "refresh_token",
|
|
1754
|
+
client_id: this.loginOptions.kc_client_id,
|
|
1755
|
+
client_secret: this.loginOptions.kc_client_secret,
|
|
1756
|
+
refresh_token: this.tokenState.refresh_token
|
|
1757
|
+
});
|
|
1758
|
+
const headers = new Headers({
|
|
1759
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
1760
|
+
});
|
|
1761
|
+
const response = await this._fetch(this.loginOptions.kc_url, {
|
|
1762
|
+
method: "POST",
|
|
1763
|
+
headers,
|
|
1764
|
+
body
|
|
1765
|
+
});
|
|
1766
|
+
if (!response.ok) {
|
|
1767
|
+
console.warn("Token refresh failed, re-authenticating with credentials");
|
|
1768
|
+
return this.firstConnect(this.loginOptions);
|
|
1769
|
+
}
|
|
1770
|
+
const data = await response.json();
|
|
1771
|
+
const token = data.access_token;
|
|
1772
|
+
if (token == null) {
|
|
1773
|
+
throw new Error("Token refresh failed: no access_token in response", {
|
|
1774
|
+
cause: data
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
this.tokenState = {
|
|
1778
|
+
access_token: token,
|
|
1779
|
+
refresh_token: data.refresh_token || this.tokenState.refresh_token,
|
|
1780
|
+
expires_at: Date.now() + (data.expires_in || 3600) * 1e3
|
|
1781
|
+
};
|
|
1782
|
+
this.saveTokenState();
|
|
1783
|
+
return token;
|
|
1784
|
+
} catch (error2) {
|
|
1785
|
+
console.error("Error refreshing token:", error2);
|
|
1786
|
+
this.clearTokenState();
|
|
1787
|
+
return this.firstConnect(this.loginOptions);
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
async getValidToken() {
|
|
1791
|
+
if (!this.tokenState) {
|
|
1792
|
+
return await this.firstConnect(this.loginOptions);
|
|
1793
|
+
}
|
|
1794
|
+
const now = Date.now();
|
|
1795
|
+
const isExpiringSoon = now >= this.tokenState.expires_at - this.tokenRefreshBuffer;
|
|
1796
|
+
if (isExpiringSoon) {
|
|
1797
|
+
return await this.refreshToken();
|
|
1798
|
+
}
|
|
1799
|
+
return this.tokenState.access_token;
|
|
1800
|
+
}
|
|
1801
|
+
async fetchWithAuth(url2, options = {}) {
|
|
1802
|
+
var _a2;
|
|
1803
|
+
if (!this.useKeycloakAuth) {
|
|
1804
|
+
return this._fetch(url2, options);
|
|
1805
|
+
}
|
|
1806
|
+
const token = await this.getValidToken();
|
|
1807
|
+
const headers = new Headers(options.headers);
|
|
1808
|
+
headers.set("Authorization", `Bearer ${token}`);
|
|
1809
|
+
let response = await this._fetch(url2, {
|
|
1810
|
+
...options,
|
|
1588
1811
|
headers
|
|
1589
1812
|
});
|
|
1813
|
+
if (response.status === 401 || response.status === 403) {
|
|
1814
|
+
console.log(`\u{1F510} [FederatedCatalogueAPIWrapper] Authentication failed (${response.status}) for ${url2}`);
|
|
1815
|
+
console.log("\u{1F504} [FederatedCatalogueAPIWrapper] Attempting token refresh...", {
|
|
1816
|
+
hasRefreshToken: !!((_a2 = this.tokenState) == null ? void 0 : _a2.refresh_token),
|
|
1817
|
+
tokenExpired: this.tokenState ? Date.now() >= this.tokenState.expires_at : "N/A"
|
|
1818
|
+
});
|
|
1819
|
+
try {
|
|
1820
|
+
const newToken = await this.refreshToken();
|
|
1821
|
+
console.log("\u2705 [FederatedCatalogueAPIWrapper] Token refreshed successfully, retrying request...");
|
|
1822
|
+
headers.set("Authorization", `Bearer ${newToken}`);
|
|
1823
|
+
response = await this._fetch(url2, {
|
|
1824
|
+
...options,
|
|
1825
|
+
headers
|
|
1826
|
+
});
|
|
1827
|
+
if (response.status === 401 || response.status === 403) {
|
|
1828
|
+
console.error(`\u274C [FederatedCatalogueAPIWrapper] Authentication still failed after token refresh (${response.status}). Please check credentials.`);
|
|
1829
|
+
} else {
|
|
1830
|
+
console.log(`\u2705 [FederatedCatalogueAPIWrapper] Retry succeeded with status ${response.status}`);
|
|
1831
|
+
}
|
|
1832
|
+
} catch (error2) {
|
|
1833
|
+
console.error("\u274C [FederatedCatalogueAPIWrapper] Failed to refresh token:", error2);
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
return response;
|
|
1837
|
+
}
|
|
1838
|
+
async getAllSelfDescriptions() {
|
|
1839
|
+
const url2 = `${this.fcBaseUrl}/self-descriptions`;
|
|
1840
|
+
const response = await this.fetchWithAuth(url2);
|
|
1590
1841
|
return await response.json();
|
|
1591
1842
|
}
|
|
1592
1843
|
async getSelfDescriptionByHash(sdHash) {
|
|
1593
|
-
if (!this.connect) return null;
|
|
1594
|
-
const token = await this.connect();
|
|
1595
1844
|
const url2 = `${this.fcBaseUrl}/self-descriptions/${sdHash}`;
|
|
1596
|
-
const
|
|
1597
|
-
|
|
1598
|
-
});
|
|
1599
|
-
const response = await fetch(url2, {
|
|
1600
|
-
method: "GET",
|
|
1601
|
-
headers
|
|
1845
|
+
const response = await this.fetchWithAuth(url2, {
|
|
1846
|
+
method: "GET"
|
|
1602
1847
|
});
|
|
1603
1848
|
if (!response.ok) throw new Error(`GET /self-descriptions/${sdHash} failed: ${response.status} ${response.statusText}`, {
|
|
1604
1849
|
cause: response
|
|
@@ -1606,20 +1851,16 @@ let __tla = (async () => {
|
|
|
1606
1851
|
return await response.json();
|
|
1607
1852
|
}
|
|
1608
1853
|
async postQuery(statement, parameters = {}) {
|
|
1609
|
-
if (!this.connect) return null;
|
|
1610
|
-
const token = await this.connect();
|
|
1611
1854
|
const url2 = `${this.fcBaseUrl}/query`;
|
|
1612
|
-
const headers = new Headers({
|
|
1613
|
-
Authorization: `Bearer ${token}`,
|
|
1614
|
-
"Content-Type": "application/json"
|
|
1615
|
-
});
|
|
1616
1855
|
const body = JSON.stringify({
|
|
1617
1856
|
statement,
|
|
1618
1857
|
parameters
|
|
1619
1858
|
});
|
|
1620
|
-
const response = await
|
|
1859
|
+
const response = await this.fetchWithAuth(url2, {
|
|
1621
1860
|
method: "POST",
|
|
1622
|
-
headers
|
|
1861
|
+
headers: {
|
|
1862
|
+
"Content-Type": "application/json"
|
|
1863
|
+
},
|
|
1623
1864
|
body
|
|
1624
1865
|
});
|
|
1625
1866
|
if (!response.ok) {
|
|
@@ -1630,13 +1871,7 @@ let __tla = (async () => {
|
|
|
1630
1871
|
return await response.json();
|
|
1631
1872
|
}
|
|
1632
1873
|
async postQuerySearch(statement, parameters = {}, queryLanguage = "OPENCYPHER", annotations) {
|
|
1633
|
-
if (!this.connect) return null;
|
|
1634
|
-
const token = await this.connect();
|
|
1635
1874
|
const url2 = `${this.fcBaseUrl}/query/search`;
|
|
1636
|
-
const headers = new Headers({
|
|
1637
|
-
Authorization: `Bearer ${token}`,
|
|
1638
|
-
"Content-Type": "application/json"
|
|
1639
|
-
});
|
|
1640
1875
|
const body = JSON.stringify({
|
|
1641
1876
|
statement,
|
|
1642
1877
|
parameters,
|
|
@@ -1644,9 +1879,11 @@ let __tla = (async () => {
|
|
|
1644
1879
|
queryLanguage
|
|
1645
1880
|
}
|
|
1646
1881
|
});
|
|
1647
|
-
const response = await
|
|
1882
|
+
const response = await this.fetchWithAuth(url2, {
|
|
1648
1883
|
method: "POST",
|
|
1649
|
-
headers
|
|
1884
|
+
headers: {
|
|
1885
|
+
"Content-Type": "application/json"
|
|
1886
|
+
},
|
|
1650
1887
|
body
|
|
1651
1888
|
});
|
|
1652
1889
|
if (!response.ok) {
|
|
@@ -1657,28 +1894,36 @@ let __tla = (async () => {
|
|
|
1657
1894
|
return await response.json();
|
|
1658
1895
|
}
|
|
1659
1896
|
}
|
|
1660
|
-
function getFederatedCatalogueAPIWrapper(baseUrl, loginOptions) {
|
|
1661
|
-
return new FederatedCatalogueAPIWrapper(loginOptions, baseUrl);
|
|
1897
|
+
function getFederatedCatalogueAPIWrapper(baseUrl, loginOptions, fetch2) {
|
|
1898
|
+
return new FederatedCatalogueAPIWrapper(loginOptions, baseUrl, fetch2);
|
|
1662
1899
|
}
|
|
1663
1900
|
class FederatedCatalogueStore {
|
|
1664
1901
|
constructor(cfg) {
|
|
1665
1902
|
__publicField(this, "cache");
|
|
1666
|
-
__publicField(this, "session");
|
|
1667
1903
|
__publicField(this, "fcApi");
|
|
1668
1904
|
__publicField(this, "metadataManager");
|
|
1669
1905
|
__publicField(this, "enableCaching");
|
|
1906
|
+
__publicField(this, "cleanupAuth");
|
|
1907
|
+
__publicField(this, "isFetching", false);
|
|
1908
|
+
__publicField(this, "pendingGetData", null);
|
|
1909
|
+
__publicField(this, "resolveFetch", (event) => {
|
|
1910
|
+
if (!this.cfg.endpoint) {
|
|
1911
|
+
throw new Error("Missing required `endpoint` in StoreConfig for FederatedCatalogueStore");
|
|
1912
|
+
}
|
|
1913
|
+
if (event.detail.fetch) {
|
|
1914
|
+
this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, event.detail.fetch);
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1670
1917
|
this.cfg = cfg;
|
|
1671
|
-
if (!this.cfg.login) {
|
|
1672
|
-
throw new Error("Login must be provided for FederatedCatalogueStore");
|
|
1673
|
-
}
|
|
1674
1918
|
if (!this.cfg.endpoint) {
|
|
1675
1919
|
throw new Error("Missing required `endpoint` in StoreConfig for FederatedCatalogueStore");
|
|
1676
1920
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1921
|
+
const fetchAuth = AuthFetchResolver.getAuthFetch();
|
|
1922
|
+
this.cleanupAuth = AuthFetchResolver.onAuthActivated(this.resolveFetch.bind(this));
|
|
1923
|
+
if (fetchAuth && !this.cfg.login) {
|
|
1924
|
+
this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, {}, fetchAuth);
|
|
1925
|
+
} else {
|
|
1926
|
+
this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, this.cfg.login, fetchAuth);
|
|
1682
1927
|
}
|
|
1683
1928
|
this.cache = new InMemoryCacheManager();
|
|
1684
1929
|
this.enableCaching = this.cfg.enableLocalStorageMetadata === true;
|
|
@@ -1690,6 +1935,10 @@ let __tla = (async () => {
|
|
|
1690
1935
|
this.metadataManager = null;
|
|
1691
1936
|
}
|
|
1692
1937
|
}
|
|
1938
|
+
disconnectedCallback() {
|
|
1939
|
+
var _a2;
|
|
1940
|
+
(_a2 = this.cleanupAuth) == null ? void 0 : _a2.call(this);
|
|
1941
|
+
}
|
|
1693
1942
|
handlePageReload() {
|
|
1694
1943
|
var _a2, _b;
|
|
1695
1944
|
try {
|
|
@@ -1714,21 +1963,40 @@ let __tla = (async () => {
|
|
|
1714
1963
|
}
|
|
1715
1964
|
return "";
|
|
1716
1965
|
}
|
|
1717
|
-
|
|
1966
|
+
buildContainerId(containerType = "default") {
|
|
1718
1967
|
var _a2;
|
|
1719
|
-
const
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
if (cacheIsValid && !hasCached && this.metadataManager) {
|
|
1729
|
-
this.metadataManager.clear();
|
|
1968
|
+
const endpointHash = ((_a2 = this.cfg.endpoint) == null ? void 0 : _a2.replace(/[^a-zA-Z0-9]/g, "")) || "unknown";
|
|
1969
|
+
return `store://local.fc-${endpointHash}-${containerType}/`;
|
|
1970
|
+
}
|
|
1971
|
+
async getData(args) {
|
|
1972
|
+
if (this.isFetching) {
|
|
1973
|
+
if (this.pendingGetData) {
|
|
1974
|
+
return this.pendingGetData;
|
|
1975
|
+
}
|
|
1976
|
+
return null;
|
|
1730
1977
|
}
|
|
1731
|
-
|
|
1978
|
+
this.isFetching = true;
|
|
1979
|
+
const executeGetData = async () => {
|
|
1980
|
+
var _a2;
|
|
1981
|
+
const targetType = this.resolveTargetType(args);
|
|
1982
|
+
if (!this.fcApi) {
|
|
1983
|
+
throw new Error("Federated API not initialized, returning empty data.");
|
|
1984
|
+
}
|
|
1985
|
+
const cacheIsValid = this.enableCaching && ((_a2 = this.metadataManager) == null ? void 0 : _a2.isCacheValid());
|
|
1986
|
+
const hasCached = this.hasCachedData();
|
|
1987
|
+
if (cacheIsValid && hasCached) {
|
|
1988
|
+
return await this.getDeltaUpdatedData(targetType);
|
|
1989
|
+
}
|
|
1990
|
+
if (cacheIsValid && !hasCached && this.metadataManager) {
|
|
1991
|
+
this.metadataManager.clear();
|
|
1992
|
+
}
|
|
1993
|
+
return await this.getFullData(targetType);
|
|
1994
|
+
};
|
|
1995
|
+
this.pendingGetData = executeGetData().finally(() => {
|
|
1996
|
+
this.isFetching = false;
|
|
1997
|
+
this.pendingGetData = null;
|
|
1998
|
+
});
|
|
1999
|
+
return this.pendingGetData;
|
|
1732
2000
|
}
|
|
1733
2001
|
hasCachedData() {
|
|
1734
2002
|
try {
|
|
@@ -1759,7 +2027,7 @@ let __tla = (async () => {
|
|
|
1759
2027
|
return await this.getFullData(targetType);
|
|
1760
2028
|
}
|
|
1761
2029
|
if (!resource["@id"]) {
|
|
1762
|
-
resource["@id"] =
|
|
2030
|
+
resource["@id"] = this.buildContainerId();
|
|
1763
2031
|
}
|
|
1764
2032
|
if (!resource["ldp:contains"]) {
|
|
1765
2033
|
resource["ldp:contains"] = [];
|
|
@@ -1851,11 +2119,11 @@ let __tla = (async () => {
|
|
|
1851
2119
|
return await this.getFullData(targetType);
|
|
1852
2120
|
}
|
|
1853
2121
|
}
|
|
1854
|
-
async getFullData(
|
|
2122
|
+
async getFullData(_targetType) {
|
|
1855
2123
|
if (!this.fcApi) {
|
|
1856
2124
|
throw new Error("Federated API not initialized");
|
|
1857
2125
|
}
|
|
1858
|
-
const resource = await this.initLocalDataSourceContainer(
|
|
2126
|
+
const resource = await this.initLocalDataSourceContainer();
|
|
1859
2127
|
const dataset2 = await this.fcApi.getAllSelfDescriptions();
|
|
1860
2128
|
const newMetadata = [];
|
|
1861
2129
|
if ((dataset2 == null ? void 0 : dataset2.items) && Array.isArray(dataset2.items)) {
|
|
@@ -1899,11 +2167,8 @@ let __tla = (async () => {
|
|
|
1899
2167
|
return resource;
|
|
1900
2168
|
}
|
|
1901
2169
|
async initLocalDataSourceContainer(dataSrc = "", containerType = "default") {
|
|
1902
|
-
var _a2;
|
|
1903
|
-
const endpointHash = ((_a2 = this.cfg.endpoint) == null ? void 0 : _a2.replace(/[^a-zA-Z0-9]/g, "")) || "unknown";
|
|
1904
|
-
const idField = `fc-${endpointHash}-${containerType}`;
|
|
1905
2170
|
if (!dataSrc) {
|
|
1906
|
-
dataSrc =
|
|
2171
|
+
dataSrc = this.buildContainerId(containerType);
|
|
1907
2172
|
}
|
|
1908
2173
|
const localContainer = {
|
|
1909
2174
|
"@context": "https://cdn.startinblox.com/owl/context.jsonld",
|
|
@@ -1964,8 +2229,8 @@ let __tla = (async () => {
|
|
|
1964
2229
|
}
|
|
1965
2230
|
subscribeResourceTo(_resourceId, _nestedResourceId) {
|
|
1966
2231
|
}
|
|
1967
|
-
fetchAuthn(_iri, _options) {
|
|
1968
|
-
return Promise.resolve({});
|
|
2232
|
+
async fetchAuthn(_iri, _options) {
|
|
2233
|
+
return await Promise.resolve({});
|
|
1969
2234
|
}
|
|
1970
2235
|
async setLocalData(resource, id) {
|
|
1971
2236
|
try {
|
|
@@ -2124,18 +2389,44 @@ let __tla = (async () => {
|
|
|
2124
2389
|
const assetId = this.stripUrnPrefix(cs["@id"], "urn:uuid:");
|
|
2125
2390
|
let datasetId;
|
|
2126
2391
|
let policy;
|
|
2392
|
+
let policies = [];
|
|
2127
2393
|
if (cs["dcat:dataset"] && cs["dcat:dataset"].length > 0) {
|
|
2128
2394
|
const dataset2 = cs["dcat:dataset"][0];
|
|
2129
2395
|
if (dataset2["@id"]) {
|
|
2130
2396
|
datasetId = this.stripUrnPrefix(dataset2["@id"], "urn:uuid:");
|
|
2131
2397
|
}
|
|
2132
2398
|
if (dataset2["odrl:hasPolicy"]) {
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2399
|
+
const rawPolicy = dataset2["odrl:hasPolicy"];
|
|
2400
|
+
const processSinglePolicy = (policyObj) => {
|
|
2401
|
+
const processedPolicy = this.stripTemsUrnFromPolicy(JSON.parse(JSON.stringify(policyObj)));
|
|
2402
|
+
if (datasetId) {
|
|
2403
|
+
processedPolicy.target = datasetId;
|
|
2404
|
+
}
|
|
2405
|
+
return processedPolicy;
|
|
2406
|
+
};
|
|
2407
|
+
if (Array.isArray(rawPolicy)) {
|
|
2408
|
+
policies = rawPolicy.map(processSinglePolicy);
|
|
2409
|
+
policy = policies[0];
|
|
2410
|
+
} else {
|
|
2411
|
+
policy = processSinglePolicy(rawPolicy);
|
|
2412
|
+
policies = [
|
|
2413
|
+
policy
|
|
2414
|
+
];
|
|
2136
2415
|
}
|
|
2137
2416
|
}
|
|
2138
2417
|
}
|
|
2418
|
+
console.log("[FederatedCatalogueStore] \u{1F50D} Policy processing for", name, ":", {
|
|
2419
|
+
hasPolicy: !!policy,
|
|
2420
|
+
policiesCount: policies.length,
|
|
2421
|
+
policy: policy ? {
|
|
2422
|
+
"@id": policy["@id"],
|
|
2423
|
+
hasTarget: !!policy.target
|
|
2424
|
+
} : null,
|
|
2425
|
+
policies: policies.map((p) => ({
|
|
2426
|
+
"@id": p["@id"],
|
|
2427
|
+
hasTarget: !!p.target
|
|
2428
|
+
}))
|
|
2429
|
+
});
|
|
2139
2430
|
const dest = {
|
|
2140
2431
|
"@id": serviceId,
|
|
2141
2432
|
creation_date,
|
|
@@ -2174,12 +2465,20 @@ let __tla = (async () => {
|
|
|
2174
2465
|
},
|
|
2175
2466
|
...policy && {
|
|
2176
2467
|
policy
|
|
2468
|
+
},
|
|
2469
|
+
...policies.length > 0 && {
|
|
2470
|
+
policies
|
|
2177
2471
|
}
|
|
2178
2472
|
};
|
|
2473
|
+
console.log("[FederatedCatalogueStore] \u{1F50D} Destination object contract fields:", {
|
|
2474
|
+
hasPolicy: "policy" in dest,
|
|
2475
|
+
hasPolicies: "policies" in dest,
|
|
2476
|
+
policiesValue: dest.policies
|
|
2477
|
+
});
|
|
2179
2478
|
return dest;
|
|
2180
2479
|
}
|
|
2181
2480
|
}
|
|
2182
|
-
|
|
2481
|
+
class FederatedCatalogueStoreAdapter {
|
|
2183
2482
|
constructor() {
|
|
2184
2483
|
}
|
|
2185
2484
|
static validateConfiguration(cfg) {
|
|
@@ -2195,18 +2494,13 @@ let __tla = (async () => {
|
|
|
2195
2494
|
}
|
|
2196
2495
|
}
|
|
2197
2496
|
static getStoreInstance(cfg) {
|
|
2198
|
-
if (!
|
|
2199
|
-
|
|
2200
|
-
throw new Error("[FederatedCatalogueStoreAdapter] configuration is required");
|
|
2201
|
-
}
|
|
2202
|
-
_FederatedCatalogueStoreAdapter.validateConfiguration(cfg);
|
|
2203
|
-
_FederatedCatalogueStoreAdapter.store = new FederatedCatalogueStore(cfg);
|
|
2497
|
+
if (!cfg) {
|
|
2498
|
+
throw new Error("[FederatedCatalogueStoreAdapter] configuration is required");
|
|
2204
2499
|
}
|
|
2205
|
-
|
|
2500
|
+
FederatedCatalogueStoreAdapter.validateConfiguration(cfg);
|
|
2501
|
+
return new FederatedCatalogueStore(cfg);
|
|
2206
2502
|
}
|
|
2207
|
-
}
|
|
2208
|
-
__publicField(_FederatedCatalogueStoreAdapter, "store");
|
|
2209
|
-
let FederatedCatalogueStoreAdapter = _FederatedCatalogueStoreAdapter;
|
|
2503
|
+
}
|
|
2210
2504
|
var lib = {};
|
|
2211
2505
|
var IdentifierIssuer_1;
|
|
2212
2506
|
var hasRequiredIdentifierIssuer;
|
|
@@ -3523,7 +3817,7 @@ let __tla = (async () => {
|
|
|
3523
3817
|
function requireLib() {
|
|
3524
3818
|
if (hasRequiredLib) return lib;
|
|
3525
3819
|
hasRequiredLib = 1;
|
|
3526
|
-
(function(exports) {
|
|
3820
|
+
(function(exports$1) {
|
|
3527
3821
|
const URDNA2015 = requireURDNA2015();
|
|
3528
3822
|
const URGNA20122 = requireURGNA2012();
|
|
3529
3823
|
const URDNA2015Sync = requireURDNA2015Sync();
|
|
@@ -3535,19 +3829,19 @@ let __tla = (async () => {
|
|
|
3535
3829
|
}
|
|
3536
3830
|
function _inputToDataset(input) {
|
|
3537
3831
|
if (!Array.isArray(input)) {
|
|
3538
|
-
return exports.NQuads.legacyDatasetToQuads(input);
|
|
3832
|
+
return exports$1.NQuads.legacyDatasetToQuads(input);
|
|
3539
3833
|
}
|
|
3540
3834
|
return input;
|
|
3541
3835
|
}
|
|
3542
|
-
exports.NQuads = requireNQuads$1();
|
|
3543
|
-
exports.IdentifierIssuer = requireIdentifierIssuer();
|
|
3544
|
-
exports._rdfCanonizeNative = function(api) {
|
|
3836
|
+
exports$1.NQuads = requireNQuads$1();
|
|
3837
|
+
exports$1.IdentifierIssuer = requireIdentifierIssuer();
|
|
3838
|
+
exports$1._rdfCanonizeNative = function(api) {
|
|
3545
3839
|
if (api) {
|
|
3546
3840
|
rdfCanonizeNative = api;
|
|
3547
3841
|
}
|
|
3548
3842
|
return rdfCanonizeNative;
|
|
3549
3843
|
};
|
|
3550
|
-
exports.canonize = async function(input, options) {
|
|
3844
|
+
exports$1.canonize = async function(input, options) {
|
|
3551
3845
|
const dataset2 = _inputToDataset(input);
|
|
3552
3846
|
if (options.useNative) {
|
|
3553
3847
|
if (!rdfCanonizeNative) {
|
|
@@ -3572,7 +3866,7 @@ let __tla = (async () => {
|
|
|
3572
3866
|
}
|
|
3573
3867
|
throw new Error("Invalid RDF Dataset Canonicalization algorithm: " + options.algorithm);
|
|
3574
3868
|
};
|
|
3575
|
-
exports._canonizeSync = function(input, options) {
|
|
3869
|
+
exports$1._canonizeSync = function(input, options) {
|
|
3576
3870
|
const dataset2 = _inputToDataset(input);
|
|
3577
3871
|
if (options.useNative) {
|
|
3578
3872
|
if (!rdfCanonizeNative) {
|
|
@@ -10398,7 +10692,7 @@ let __tla = (async () => {
|
|
|
10398
10692
|
function requirePubsub() {
|
|
10399
10693
|
if (hasRequiredPubsub) return pubsub$1.exports;
|
|
10400
10694
|
hasRequiredPubsub = 1;
|
|
10401
|
-
(function(module, exports) {
|
|
10695
|
+
(function(module, exports$1) {
|
|
10402
10696
|
(function(root, factory2) {
|
|
10403
10697
|
var PubSub2 = {};
|
|
10404
10698
|
if (root.PubSub) {
|
|
@@ -10410,10 +10704,10 @@ let __tla = (async () => {
|
|
|
10410
10704
|
}
|
|
10411
10705
|
{
|
|
10412
10706
|
if (module !== void 0 && module.exports) {
|
|
10413
|
-
exports = module.exports = PubSub2;
|
|
10707
|
+
exports$1 = module.exports = PubSub2;
|
|
10414
10708
|
}
|
|
10415
|
-
exports.PubSub = PubSub2;
|
|
10416
|
-
module.exports = exports = PubSub2;
|
|
10709
|
+
exports$1.PubSub = PubSub2;
|
|
10710
|
+
module.exports = exports$1 = PubSub2;
|
|
10417
10711
|
}
|
|
10418
10712
|
})(typeof window === "object" && window || pubsub || globalThis, function(PubSub2) {
|
|
10419
10713
|
var messages = {}, lastUid = -1, ALL_SUBSCRIBING_MSG = "*";
|
|
@@ -11186,15 +11480,15 @@ let __tla = (async () => {
|
|
|
11186
11480
|
function requireBuffer() {
|
|
11187
11481
|
if (hasRequiredBuffer) return buffer;
|
|
11188
11482
|
hasRequiredBuffer = 1;
|
|
11189
|
-
(function(exports) {
|
|
11483
|
+
(function(exports$1) {
|
|
11190
11484
|
const base64 = requireBase64Js();
|
|
11191
11485
|
const ieee7542 = requireIeee754();
|
|
11192
11486
|
const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
|
|
11193
|
-
exports.Buffer = Buffer2;
|
|
11194
|
-
exports.SlowBuffer = SlowBuffer;
|
|
11195
|
-
exports.INSPECT_MAX_BYTES = 50;
|
|
11487
|
+
exports$1.Buffer = Buffer2;
|
|
11488
|
+
exports$1.SlowBuffer = SlowBuffer;
|
|
11489
|
+
exports$1.INSPECT_MAX_BYTES = 50;
|
|
11196
11490
|
const K_MAX_LENGTH = 2147483647;
|
|
11197
|
-
exports.kMaxLength = K_MAX_LENGTH;
|
|
11491
|
+
exports$1.kMaxLength = K_MAX_LENGTH;
|
|
11198
11492
|
Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport();
|
|
11199
11493
|
if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
|
|
11200
11494
|
console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
|
|
@@ -11608,7 +11902,7 @@ let __tla = (async () => {
|
|
|
11608
11902
|
};
|
|
11609
11903
|
Buffer2.prototype.inspect = function inspect2() {
|
|
11610
11904
|
let str = "";
|
|
11611
|
-
const max = exports.INSPECT_MAX_BYTES;
|
|
11905
|
+
const max = exports$1.INSPECT_MAX_BYTES;
|
|
11612
11906
|
str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
|
|
11613
11907
|
if (this.length > max) str += " ... ";
|
|
11614
11908
|
return "<Buffer " + str + ">";
|
|
@@ -12699,7 +12993,7 @@ let __tla = (async () => {
|
|
|
12699
12993
|
function numberIsNaN(obj) {
|
|
12700
12994
|
return obj !== obj;
|
|
12701
12995
|
}
|
|
12702
|
-
const hexSliceLookupTable = function() {
|
|
12996
|
+
const hexSliceLookupTable = (function() {
|
|
12703
12997
|
const alphabet = "0123456789abcdef";
|
|
12704
12998
|
const table = new Array(256);
|
|
12705
12999
|
for (let i = 0; i < 16; ++i) {
|
|
@@ -12709,7 +13003,7 @@ let __tla = (async () => {
|
|
|
12709
13003
|
}
|
|
12710
13004
|
}
|
|
12711
13005
|
return table;
|
|
12712
|
-
}();
|
|
13006
|
+
})();
|
|
12713
13007
|
function defineBigIntMethod(fn) {
|
|
12714
13008
|
return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;
|
|
12715
13009
|
}
|
|
@@ -12800,7 +13094,7 @@ let __tla = (async () => {
|
|
|
12800
13094
|
function copyBuffer(src, target, offset) {
|
|
12801
13095
|
Buffer2.prototype.copy.call(src, target, offset);
|
|
12802
13096
|
}
|
|
12803
|
-
buffer_list$1 = function() {
|
|
13097
|
+
buffer_list$1 = (function() {
|
|
12804
13098
|
function BufferList() {
|
|
12805
13099
|
_classCallCheck(this, BufferList);
|
|
12806
13100
|
this.head = null;
|
|
@@ -12968,7 +13262,7 @@ let __tla = (async () => {
|
|
|
12968
13262
|
}
|
|
12969
13263
|
]);
|
|
12970
13264
|
return BufferList;
|
|
12971
|
-
}();
|
|
13265
|
+
})();
|
|
12972
13266
|
return buffer_list$1;
|
|
12973
13267
|
}
|
|
12974
13268
|
var destroy_1$1;
|
|
@@ -13082,13 +13376,13 @@ let __tla = (async () => {
|
|
|
13082
13376
|
return message(arg1, arg2, arg3);
|
|
13083
13377
|
}
|
|
13084
13378
|
}
|
|
13085
|
-
var NodeError = function(_Base) {
|
|
13379
|
+
var NodeError = (function(_Base) {
|
|
13086
13380
|
_inheritsLoose(NodeError2, _Base);
|
|
13087
13381
|
function NodeError2(arg1, arg2, arg3) {
|
|
13088
13382
|
return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
|
|
13089
13383
|
}
|
|
13090
13384
|
return NodeError2;
|
|
13091
|
-
}(Base);
|
|
13385
|
+
})(Base);
|
|
13092
13386
|
NodeError.prototype.name = Base.name;
|
|
13093
13387
|
NodeError.prototype.code = code;
|
|
13094
13388
|
codes[code] = NodeError;
|
|
@@ -13783,7 +14077,7 @@ let __tla = (async () => {
|
|
|
13783
14077
|
function requireSafeBuffer() {
|
|
13784
14078
|
if (hasRequiredSafeBuffer) return safeBuffer.exports;
|
|
13785
14079
|
hasRequiredSafeBuffer = 1;
|
|
13786
|
-
(function(module, exports) {
|
|
14080
|
+
(function(module, exports$1) {
|
|
13787
14081
|
var buffer2 = requireBuffer();
|
|
13788
14082
|
var Buffer2 = buffer2.Buffer;
|
|
13789
14083
|
function copyProps(src, dst) {
|
|
@@ -13794,8 +14088,8 @@ let __tla = (async () => {
|
|
|
13794
14088
|
if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) {
|
|
13795
14089
|
module.exports = buffer2;
|
|
13796
14090
|
} else {
|
|
13797
|
-
copyProps(buffer2, exports);
|
|
13798
|
-
exports.Buffer = SafeBuffer;
|
|
14091
|
+
copyProps(buffer2, exports$1);
|
|
14092
|
+
exports$1.Buffer = SafeBuffer;
|
|
13799
14093
|
}
|
|
13800
14094
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
13801
14095
|
return Buffer2(arg, encodingOrOffset, length);
|
|
@@ -14982,11 +15276,11 @@ let __tla = (async () => {
|
|
|
14982
15276
|
});
|
|
14983
15277
|
for (var i in stream2) {
|
|
14984
15278
|
if (this[i] === void 0 && typeof stream2[i] === "function") {
|
|
14985
|
-
this[i] = /* @__PURE__ */ function methodWrap(method) {
|
|
15279
|
+
this[i] = /* @__PURE__ */ (function methodWrap(method) {
|
|
14986
15280
|
return function methodWrapReturnFunction() {
|
|
14987
15281
|
return stream2[method].apply(stream2, arguments);
|
|
14988
15282
|
};
|
|
14989
|
-
}(i);
|
|
15283
|
+
})(i);
|
|
14990
15284
|
}
|
|
14991
15285
|
}
|
|
14992
15286
|
for (var n = 0; n < kProxyEvents.length; n++) {
|
|
@@ -19752,50 +20046,64 @@ let __tla = (async () => {
|
|
|
19752
20046
|
createDebug.namespaces = namespaces2;
|
|
19753
20047
|
createDebug.names = [];
|
|
19754
20048
|
createDebug.skips = [];
|
|
19755
|
-
|
|
19756
|
-
|
|
19757
|
-
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
20049
|
+
const split = (typeof namespaces2 === "string" ? namespaces2 : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
20050
|
+
for (const ns2 of split) {
|
|
20051
|
+
if (ns2[0] === "-") {
|
|
20052
|
+
createDebug.skips.push(ns2.slice(1));
|
|
20053
|
+
} else {
|
|
20054
|
+
createDebug.names.push(ns2);
|
|
19761
20055
|
}
|
|
19762
|
-
|
|
19763
|
-
|
|
19764
|
-
|
|
20056
|
+
}
|
|
20057
|
+
}
|
|
20058
|
+
function matchesTemplate(search, template) {
|
|
20059
|
+
let searchIndex = 0;
|
|
20060
|
+
let templateIndex = 0;
|
|
20061
|
+
let starIndex = -1;
|
|
20062
|
+
let matchIndex = 0;
|
|
20063
|
+
while (searchIndex < search.length) {
|
|
20064
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
20065
|
+
if (template[templateIndex] === "*") {
|
|
20066
|
+
starIndex = templateIndex;
|
|
20067
|
+
matchIndex = searchIndex;
|
|
20068
|
+
templateIndex++;
|
|
20069
|
+
} else {
|
|
20070
|
+
searchIndex++;
|
|
20071
|
+
templateIndex++;
|
|
20072
|
+
}
|
|
20073
|
+
} else if (starIndex !== -1) {
|
|
20074
|
+
templateIndex = starIndex + 1;
|
|
20075
|
+
matchIndex++;
|
|
20076
|
+
searchIndex = matchIndex;
|
|
19765
20077
|
} else {
|
|
19766
|
-
|
|
20078
|
+
return false;
|
|
19767
20079
|
}
|
|
19768
20080
|
}
|
|
20081
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
20082
|
+
templateIndex++;
|
|
20083
|
+
}
|
|
20084
|
+
return templateIndex === template.length;
|
|
19769
20085
|
}
|
|
19770
20086
|
function disable() {
|
|
19771
20087
|
const namespaces2 = [
|
|
19772
|
-
...createDebug.names
|
|
19773
|
-
...createDebug.skips.map(
|
|
20088
|
+
...createDebug.names,
|
|
20089
|
+
...createDebug.skips.map((namespace2) => "-" + namespace2)
|
|
19774
20090
|
].join(",");
|
|
19775
20091
|
createDebug.enable("");
|
|
19776
20092
|
return namespaces2;
|
|
19777
20093
|
}
|
|
19778
20094
|
function enabled(name) {
|
|
19779
|
-
|
|
19780
|
-
|
|
19781
|
-
}
|
|
19782
|
-
let i;
|
|
19783
|
-
let len;
|
|
19784
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
19785
|
-
if (createDebug.skips[i].test(name)) {
|
|
20095
|
+
for (const skip of createDebug.skips) {
|
|
20096
|
+
if (matchesTemplate(name, skip)) {
|
|
19786
20097
|
return false;
|
|
19787
20098
|
}
|
|
19788
20099
|
}
|
|
19789
|
-
for (
|
|
19790
|
-
if (
|
|
20100
|
+
for (const ns2 of createDebug.names) {
|
|
20101
|
+
if (matchesTemplate(name, ns2)) {
|
|
19791
20102
|
return true;
|
|
19792
20103
|
}
|
|
19793
20104
|
}
|
|
19794
20105
|
return false;
|
|
19795
20106
|
}
|
|
19796
|
-
function toNamespace(regexp) {
|
|
19797
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
19798
|
-
}
|
|
19799
20107
|
function coerce(val) {
|
|
19800
20108
|
if (val instanceof Error) {
|
|
19801
20109
|
return val.stack || val.message;
|
|
@@ -19815,13 +20123,13 @@ let __tla = (async () => {
|
|
|
19815
20123
|
function requireBrowser$3() {
|
|
19816
20124
|
if (hasRequiredBrowser$3) return browser$3.exports;
|
|
19817
20125
|
hasRequiredBrowser$3 = 1;
|
|
19818
|
-
(function(module, exports) {
|
|
19819
|
-
exports.formatArgs = formatArgs;
|
|
19820
|
-
exports.save = save;
|
|
19821
|
-
exports.load = load;
|
|
19822
|
-
exports.useColors = useColors;
|
|
19823
|
-
exports.storage = localstorage();
|
|
19824
|
-
exports.destroy = /* @__PURE__ */ (() => {
|
|
20126
|
+
(function(module, exports$1) {
|
|
20127
|
+
exports$1.formatArgs = formatArgs;
|
|
20128
|
+
exports$1.save = save;
|
|
20129
|
+
exports$1.load = load;
|
|
20130
|
+
exports$1.useColors = useColors;
|
|
20131
|
+
exports$1.storage = localstorage();
|
|
20132
|
+
exports$1.destroy = /* @__PURE__ */ (() => {
|
|
19825
20133
|
let warned = false;
|
|
19826
20134
|
return () => {
|
|
19827
20135
|
if (!warned) {
|
|
@@ -19830,7 +20138,7 @@ let __tla = (async () => {
|
|
|
19830
20138
|
}
|
|
19831
20139
|
};
|
|
19832
20140
|
})();
|
|
19833
|
-
exports.colors = [
|
|
20141
|
+
exports$1.colors = [
|
|
19834
20142
|
"#0000CC",
|
|
19835
20143
|
"#0000FF",
|
|
19836
20144
|
"#0033CC",
|
|
@@ -19915,7 +20223,8 @@ let __tla = (async () => {
|
|
|
19915
20223
|
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
19916
20224
|
return false;
|
|
19917
20225
|
}
|
|
19918
|
-
|
|
20226
|
+
let m;
|
|
20227
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
19919
20228
|
}
|
|
19920
20229
|
function formatArgs(args) {
|
|
19921
20230
|
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
|
|
@@ -19937,14 +20246,14 @@ let __tla = (async () => {
|
|
|
19937
20246
|
});
|
|
19938
20247
|
args.splice(lastC, 0, c);
|
|
19939
20248
|
}
|
|
19940
|
-
exports.log = console.debug || console.log || (() => {
|
|
20249
|
+
exports$1.log = console.debug || console.log || (() => {
|
|
19941
20250
|
});
|
|
19942
20251
|
function save(namespaces2) {
|
|
19943
20252
|
try {
|
|
19944
20253
|
if (namespaces2) {
|
|
19945
|
-
exports.storage.setItem("debug", namespaces2);
|
|
20254
|
+
exports$1.storage.setItem("debug", namespaces2);
|
|
19946
20255
|
} else {
|
|
19947
|
-
exports.storage.removeItem("debug");
|
|
20256
|
+
exports$1.storage.removeItem("debug");
|
|
19948
20257
|
}
|
|
19949
20258
|
} catch (error2) {
|
|
19950
20259
|
}
|
|
@@ -19952,7 +20261,7 @@ let __tla = (async () => {
|
|
|
19952
20261
|
function load() {
|
|
19953
20262
|
let r;
|
|
19954
20263
|
try {
|
|
19955
|
-
r = exports.storage.getItem("debug");
|
|
20264
|
+
r = exports$1.storage.getItem("debug") || exports$1.storage.getItem("DEBUG");
|
|
19956
20265
|
} catch (error2) {
|
|
19957
20266
|
}
|
|
19958
20267
|
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
@@ -19966,7 +20275,7 @@ let __tla = (async () => {
|
|
|
19966
20275
|
} catch (error2) {
|
|
19967
20276
|
}
|
|
19968
20277
|
}
|
|
19969
|
-
module.exports = requireCommon()(exports);
|
|
20278
|
+
module.exports = requireCommon()(exports$1);
|
|
19970
20279
|
const { formatters } = module.exports;
|
|
19971
20280
|
formatters.j = function(v) {
|
|
19972
20281
|
try {
|
|
@@ -20811,8 +21120,8 @@ let __tla = (async () => {
|
|
|
20811
21120
|
function requireRdfDataFactory() {
|
|
20812
21121
|
if (hasRequiredRdfDataFactory) return rdfDataFactory;
|
|
20813
21122
|
hasRequiredRdfDataFactory = 1;
|
|
20814
|
-
(function(exports) {
|
|
20815
|
-
var __createBinding = rdfDataFactory && rdfDataFactory.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
21123
|
+
(function(exports$1) {
|
|
21124
|
+
var __createBinding = rdfDataFactory && rdfDataFactory.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
20816
21125
|
if (k2 === void 0) k2 = k;
|
|
20817
21126
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20818
21127
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -20824,23 +21133,23 @@ let __tla = (async () => {
|
|
|
20824
21133
|
};
|
|
20825
21134
|
}
|
|
20826
21135
|
Object.defineProperty(o, k2, desc);
|
|
20827
|
-
} : function(o, m, k, k2) {
|
|
21136
|
+
}) : (function(o, m, k, k2) {
|
|
20828
21137
|
if (k2 === void 0) k2 = k;
|
|
20829
21138
|
o[k2] = m[k];
|
|
20830
|
-
});
|
|
20831
|
-
var __exportStar = rdfDataFactory && rdfDataFactory.__exportStar || function(m,
|
|
20832
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(
|
|
21139
|
+
}));
|
|
21140
|
+
var __exportStar = rdfDataFactory && rdfDataFactory.__exportStar || function(m, exports$12) {
|
|
21141
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$12, p)) __createBinding(exports$12, m, p);
|
|
20833
21142
|
};
|
|
20834
|
-
Object.defineProperty(exports, "__esModule", {
|
|
21143
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
20835
21144
|
value: true
|
|
20836
21145
|
});
|
|
20837
|
-
__exportStar(requireBlankNode(), exports);
|
|
20838
|
-
__exportStar(requireDataFactory(), exports);
|
|
20839
|
-
__exportStar(requireDefaultGraph(), exports);
|
|
20840
|
-
__exportStar(requireLiteral(), exports);
|
|
20841
|
-
__exportStar(requireNamedNode(), exports);
|
|
20842
|
-
__exportStar(requireQuad(), exports);
|
|
20843
|
-
__exportStar(requireVariable(), exports);
|
|
21146
|
+
__exportStar(requireBlankNode(), exports$1);
|
|
21147
|
+
__exportStar(requireDataFactory(), exports$1);
|
|
21148
|
+
__exportStar(requireDefaultGraph(), exports$1);
|
|
21149
|
+
__exportStar(requireLiteral(), exports$1);
|
|
21150
|
+
__exportStar(requireNamedNode(), exports$1);
|
|
21151
|
+
__exportStar(requireQuad(), exports$1);
|
|
21152
|
+
__exportStar(requireVariable(), exports$1);
|
|
20844
21153
|
})(rdfDataFactory);
|
|
20845
21154
|
return rdfDataFactory;
|
|
20846
21155
|
}
|
|
@@ -21144,8 +21453,8 @@ let __tla = (async () => {
|
|
|
21144
21453
|
function requireHandler() {
|
|
21145
21454
|
if (hasRequiredHandler) return handler;
|
|
21146
21455
|
hasRequiredHandler = 1;
|
|
21147
|
-
(function(exports) {
|
|
21148
|
-
var __createBinding = handler && handler.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
21456
|
+
(function(exports$1) {
|
|
21457
|
+
var __createBinding = handler && handler.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
21149
21458
|
if (k2 === void 0) k2 = k;
|
|
21150
21459
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21151
21460
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -21157,21 +21466,21 @@ let __tla = (async () => {
|
|
|
21157
21466
|
};
|
|
21158
21467
|
}
|
|
21159
21468
|
Object.defineProperty(o, k2, desc);
|
|
21160
|
-
} : function(o, m, k, k2) {
|
|
21469
|
+
}) : (function(o, m, k, k2) {
|
|
21161
21470
|
if (k2 === void 0) k2 = k;
|
|
21162
21471
|
o[k2] = m[k];
|
|
21163
|
-
});
|
|
21164
|
-
var __exportStar = handler && handler.__exportStar || function(m,
|
|
21165
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(
|
|
21472
|
+
}));
|
|
21473
|
+
var __exportStar = handler && handler.__exportStar || function(m, exports$12) {
|
|
21474
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$12, p)) __createBinding(exports$12, m, p);
|
|
21166
21475
|
};
|
|
21167
|
-
Object.defineProperty(exports, "__esModule", {
|
|
21476
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
21168
21477
|
value: true
|
|
21169
21478
|
});
|
|
21170
|
-
__exportStar(requireTypeHandlerBoolean(), exports);
|
|
21171
|
-
__exportStar(requireTypeHandlerDate(), exports);
|
|
21172
|
-
__exportStar(requireTypeHandlerNumberDouble(), exports);
|
|
21173
|
-
__exportStar(requireTypeHandlerNumberInteger(), exports);
|
|
21174
|
-
__exportStar(requireTypeHandlerString(), exports);
|
|
21479
|
+
__exportStar(requireTypeHandlerBoolean(), exports$1);
|
|
21480
|
+
__exportStar(requireTypeHandlerDate(), exports$1);
|
|
21481
|
+
__exportStar(requireTypeHandlerNumberDouble(), exports$1);
|
|
21482
|
+
__exportStar(requireTypeHandlerNumberInteger(), exports$1);
|
|
21483
|
+
__exportStar(requireTypeHandlerString(), exports$1);
|
|
21175
21484
|
})(handler);
|
|
21176
21485
|
return handler;
|
|
21177
21486
|
}
|
|
@@ -21189,8 +21498,8 @@ let __tla = (async () => {
|
|
|
21189
21498
|
function requireRdfLiteral() {
|
|
21190
21499
|
if (hasRequiredRdfLiteral) return rdfLiteral;
|
|
21191
21500
|
hasRequiredRdfLiteral = 1;
|
|
21192
|
-
(function(exports) {
|
|
21193
|
-
var __createBinding = rdfLiteral && rdfLiteral.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
21501
|
+
(function(exports$1) {
|
|
21502
|
+
var __createBinding = rdfLiteral && rdfLiteral.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
21194
21503
|
if (k2 === void 0) k2 = k;
|
|
21195
21504
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21196
21505
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -21202,27 +21511,27 @@ let __tla = (async () => {
|
|
|
21202
21511
|
};
|
|
21203
21512
|
}
|
|
21204
21513
|
Object.defineProperty(o, k2, desc);
|
|
21205
|
-
} : function(o, m, k, k2) {
|
|
21514
|
+
}) : (function(o, m, k, k2) {
|
|
21206
21515
|
if (k2 === void 0) k2 = k;
|
|
21207
21516
|
o[k2] = m[k];
|
|
21208
|
-
});
|
|
21209
|
-
var __exportStar = rdfLiteral && rdfLiteral.__exportStar || function(m,
|
|
21210
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(
|
|
21517
|
+
}));
|
|
21518
|
+
var __exportStar = rdfLiteral && rdfLiteral.__exportStar || function(m, exports$12) {
|
|
21519
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$12, p)) __createBinding(exports$12, m, p);
|
|
21211
21520
|
};
|
|
21212
|
-
Object.defineProperty(exports, "__esModule", {
|
|
21521
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
21213
21522
|
value: true
|
|
21214
21523
|
});
|
|
21215
|
-
exports.fromRdf = fromRdf2;
|
|
21216
|
-
exports.toRdf = toRdf2;
|
|
21217
|
-
exports.getTermRaw = getTermRaw;
|
|
21218
|
-
exports.getSupportedRdfDatatypes = getSupportedRdfDatatypes;
|
|
21219
|
-
exports.getSupportedJavaScriptPrimitives = getSupportedJavaScriptPrimitives;
|
|
21524
|
+
exports$1.fromRdf = fromRdf2;
|
|
21525
|
+
exports$1.toRdf = toRdf2;
|
|
21526
|
+
exports$1.getTermRaw = getTermRaw;
|
|
21527
|
+
exports$1.getSupportedRdfDatatypes = getSupportedRdfDatatypes;
|
|
21528
|
+
exports$1.getSupportedJavaScriptPrimitives = getSupportedJavaScriptPrimitives;
|
|
21220
21529
|
const rdf_data_factory_1 = requireRdfDataFactory();
|
|
21221
21530
|
const handler_1 = requireHandler();
|
|
21222
21531
|
const Translator_1 = requireTranslator();
|
|
21223
|
-
__exportStar(requireHandler(), exports);
|
|
21224
|
-
__exportStar(requireITypeHandler(), exports);
|
|
21225
|
-
__exportStar(requireTranslator(), exports);
|
|
21532
|
+
__exportStar(requireHandler(), exports$1);
|
|
21533
|
+
__exportStar(requireITypeHandler(), exports$1);
|
|
21534
|
+
__exportStar(requireTranslator(), exports$1);
|
|
21226
21535
|
const DF = new rdf_data_factory_1.DataFactory();
|
|
21227
21536
|
const translator = new Translator_1.Translator();
|
|
21228
21537
|
translator.registerHandler(new handler_1.TypeHandlerString(), handler_1.TypeHandlerString.TYPES.map((t) => DF.namedNode(t)), [
|
|
@@ -25560,8 +25869,8 @@ let __tla = (async () => {
|
|
|
25560
25869
|
this.pipes = [];
|
|
25561
25870
|
this.flowing = null;
|
|
25562
25871
|
this[kPaused] = null;
|
|
25563
|
-
if (options && options.emitClose === false) this.state &=
|
|
25564
|
-
if (options && options.autoDestroy === false) this.state &=
|
|
25872
|
+
if (options && options.emitClose === false) this.state &= ~kEmitClose;
|
|
25873
|
+
if (options && options.autoDestroy === false) this.state &= ~kAutoDestroy;
|
|
25565
25874
|
this.errored = null;
|
|
25566
25875
|
this.defaultEncoding = options && options.defaultEncoding || "utf8";
|
|
25567
25876
|
this.awaitDrainWriters = null;
|
|
@@ -25642,7 +25951,7 @@ let __tla = (async () => {
|
|
|
25642
25951
|
if (err) {
|
|
25643
25952
|
errorOrDestroy(stream2, err);
|
|
25644
25953
|
} else if (chunk === null) {
|
|
25645
|
-
state2.state &=
|
|
25954
|
+
state2.state &= ~kReading;
|
|
25646
25955
|
onEofChunk(stream2, state2);
|
|
25647
25956
|
} else if ((state2.state & kObjectMode) !== 0 || chunk && chunk.length > 0) {
|
|
25648
25957
|
if (addToFront) {
|
|
@@ -25654,7 +25963,7 @@ let __tla = (async () => {
|
|
|
25654
25963
|
} else if (state2.destroyed || state2.errored) {
|
|
25655
25964
|
return false;
|
|
25656
25965
|
} else {
|
|
25657
|
-
state2.state &=
|
|
25966
|
+
state2.state &= ~kReading;
|
|
25658
25967
|
if (state2.decoder && !encoding) {
|
|
25659
25968
|
chunk = state2.decoder.write(chunk);
|
|
25660
25969
|
if (state2.objectMode || chunk.length !== 0) addChunk(stream2, state2, chunk, false);
|
|
@@ -25664,7 +25973,7 @@ let __tla = (async () => {
|
|
|
25664
25973
|
}
|
|
25665
25974
|
}
|
|
25666
25975
|
} else if (!addToFront) {
|
|
25667
|
-
state2.state &=
|
|
25976
|
+
state2.state &= ~kReading;
|
|
25668
25977
|
maybeReadMore(stream2, state2);
|
|
25669
25978
|
}
|
|
25670
25979
|
return !state2.ended && (state2.length < state2.highWaterMark || state2.length === 0);
|
|
@@ -25739,7 +26048,7 @@ let __tla = (async () => {
|
|
|
25739
26048
|
const state2 = this._readableState;
|
|
25740
26049
|
const nOrig = n;
|
|
25741
26050
|
if (n > state2.highWaterMark) state2.highWaterMark = computeNewHighWaterMark(n);
|
|
25742
|
-
if (n !== 0) state2.state &=
|
|
26051
|
+
if (n !== 0) state2.state &= ~kEmittedReadable;
|
|
25743
26052
|
if (n === 0 && state2.needReadable && ((state2.highWaterMark !== 0 ? state2.length >= state2.highWaterMark : state2.length > 0) || state2.ended)) {
|
|
25744
26053
|
debug2("read: emitReadable", state2.length, state2.ended);
|
|
25745
26054
|
if (state2.length === 0 && state2.ended) endReadable(this);
|
|
@@ -25769,7 +26078,7 @@ let __tla = (async () => {
|
|
|
25769
26078
|
} catch (err) {
|
|
25770
26079
|
errorOrDestroy(this, err);
|
|
25771
26080
|
}
|
|
25772
|
-
state2.state &=
|
|
26081
|
+
state2.state &= ~kSync;
|
|
25773
26082
|
if (!state2.reading) n = howMuchToRead(nOrig, state2);
|
|
25774
26083
|
}
|
|
25775
26084
|
let ret;
|
|
@@ -27145,7 +27454,7 @@ let __tla = (async () => {
|
|
|
27145
27454
|
let { promise, resolve } = createDeferredPromise();
|
|
27146
27455
|
const ac = new AbortController();
|
|
27147
27456
|
const signal = ac.signal;
|
|
27148
|
-
const value = fn(async function* () {
|
|
27457
|
+
const value = fn((async function* () {
|
|
27149
27458
|
while (true) {
|
|
27150
27459
|
const _promise = promise;
|
|
27151
27460
|
promise = null;
|
|
@@ -27158,7 +27467,7 @@ let __tla = (async () => {
|
|
|
27158
27467
|
({ promise, resolve } = createDeferredPromise());
|
|
27159
27468
|
yield chunk;
|
|
27160
27469
|
}
|
|
27161
|
-
}(), {
|
|
27470
|
+
})(), {
|
|
27162
27471
|
signal
|
|
27163
27472
|
});
|
|
27164
27473
|
return {
|
|
@@ -29056,9 +29365,9 @@ sh:property [
|
|
|
29056
29365
|
__publicField(this, "loadingList");
|
|
29057
29366
|
__publicField(this, "headers");
|
|
29058
29367
|
__publicField(this, "fetch");
|
|
29059
|
-
__publicField(this, "session");
|
|
29060
29368
|
__publicField(this, "contextParser");
|
|
29061
29369
|
__publicField(this, "searchProvider");
|
|
29370
|
+
__publicField(this, "cleanupAuth");
|
|
29062
29371
|
__publicField(this, "resolveResource", (id, resolve) => {
|
|
29063
29372
|
const handler2 = (event) => {
|
|
29064
29373
|
if (event.detail.id === id) {
|
|
@@ -29072,6 +29381,11 @@ sh:property [
|
|
|
29072
29381
|
};
|
|
29073
29382
|
return handler2;
|
|
29074
29383
|
});
|
|
29384
|
+
__publicField(this, "resolveFetch", (event) => {
|
|
29385
|
+
if (event.detail.fetch) {
|
|
29386
|
+
this.fetch = event.detail.fetch.bind ? event.detail.fetch.bind(globalThis) : event.detail.fetch;
|
|
29387
|
+
}
|
|
29388
|
+
});
|
|
29075
29389
|
this.storeOptions = storeOptions;
|
|
29076
29390
|
this.cache = this.storeOptions.cacheManager ?? new InMemoryCacheManager();
|
|
29077
29391
|
this.subscriptionIndex = /* @__PURE__ */ new Map();
|
|
@@ -29082,15 +29396,35 @@ sh:property [
|
|
|
29082
29396
|
"Content-Type": "application/ld+json",
|
|
29083
29397
|
"Cache-Control": "must-revalidate"
|
|
29084
29398
|
};
|
|
29085
|
-
this.fetch = this.storeOptions.fetchMethod;
|
|
29086
|
-
this.session = this.storeOptions.session;
|
|
29087
29399
|
this.contextParser = new jsonldContextParserExports.ContextParser();
|
|
29088
29400
|
this.searchProvider = new SolidIndexingSearchProvider(this.getData.bind(this));
|
|
29401
|
+
if (this.storeOptions.fetchMethod) {
|
|
29402
|
+
this.fetch = this.storeOptions.fetchMethod.bind(globalThis);
|
|
29403
|
+
} else {
|
|
29404
|
+
const authFetch = AuthFetchResolver.getAuthFetch();
|
|
29405
|
+
this.fetch = authFetch.bind ? authFetch.bind(globalThis) : authFetch;
|
|
29406
|
+
this.cleanupAuth = AuthFetchResolver.onAuthActivated(this.resolveFetch.bind(this));
|
|
29407
|
+
}
|
|
29408
|
+
if (!this.fetch) {
|
|
29409
|
+
this.fetch = fetch;
|
|
29410
|
+
}
|
|
29411
|
+
const event = new CustomEvent("sib-core:loaded", {
|
|
29412
|
+
bubbles: true,
|
|
29413
|
+
composed: true,
|
|
29414
|
+
detail: {
|
|
29415
|
+
store: this
|
|
29416
|
+
}
|
|
29417
|
+
});
|
|
29418
|
+
window.dispatchEvent(event);
|
|
29089
29419
|
}
|
|
29090
29420
|
async initGetter() {
|
|
29091
|
-
const { CustomGetter } = await import("./custom-getter-
|
|
29421
|
+
const { CustomGetter } = await import("./custom-getter-4u-Xg-ue.js");
|
|
29092
29422
|
return CustomGetter;
|
|
29093
29423
|
}
|
|
29424
|
+
disconnectedCallback() {
|
|
29425
|
+
var _a2;
|
|
29426
|
+
(_a2 = this.cleanupAuth) == null ? void 0 : _a2.call(this);
|
|
29427
|
+
}
|
|
29094
29428
|
async getData(id, context2, parentId, localData, forceFetch, serverPagination, serverSearch, headers, bypassLoadingList) {
|
|
29095
29429
|
var _a2;
|
|
29096
29430
|
let key = id;
|
|
@@ -29156,17 +29490,7 @@ sh:property [
|
|
|
29156
29490
|
if (!this.fetch) {
|
|
29157
29491
|
console.warn("No fetch method available");
|
|
29158
29492
|
}
|
|
29159
|
-
|
|
29160
|
-
if (this.session) authenticated = await this.session;
|
|
29161
|
-
if (this.fetch && authenticated) {
|
|
29162
|
-
return this.fetch.then((fn) => {
|
|
29163
|
-
return fn(iri, options);
|
|
29164
|
-
});
|
|
29165
|
-
}
|
|
29166
|
-
if (options.headers) {
|
|
29167
|
-
options.headers = this._convertHeaders(options.headers);
|
|
29168
|
-
}
|
|
29169
|
-
return fetch(iri, options).then((response) => response);
|
|
29493
|
+
return await this.fetch(iri, options);
|
|
29170
29494
|
}
|
|
29171
29495
|
async fetchData(id, context2 = null, parentId = "", serverPagination, serverSearch, headers) {
|
|
29172
29496
|
let iri = this._getAbsoluteIri(id, context2, parentId);
|
|
@@ -29409,19 +29733,19 @@ sh:property [
|
|
|
29409
29733
|
]);
|
|
29410
29734
|
}
|
|
29411
29735
|
_getAbsoluteIri(id, context2, parentId) {
|
|
29736
|
+
var _a2;
|
|
29412
29737
|
let iri = normalizeContext(context2, base_context).expandTerm(id);
|
|
29413
29738
|
if (!iri) return "";
|
|
29414
|
-
|
|
29415
|
-
const
|
|
29416
|
-
|
|
29417
|
-
|
|
29418
|
-
iri = new URL(iri,
|
|
29739
|
+
try {
|
|
29740
|
+
const baseHref = ((_a2 = document == null ? void 0 : document.location) == null ? void 0 : _a2.href) || "";
|
|
29741
|
+
const canUseParent = parentId && !parentId.startsWith("store://local");
|
|
29742
|
+
const base = canUseParent ? new URL(parentId, baseHref).href : baseHref;
|
|
29743
|
+
iri = new URL(iri, base).href;
|
|
29744
|
+
} catch (err) {
|
|
29745
|
+
console.log("[LDPStore _getAbsoluteIri()]", err);
|
|
29419
29746
|
}
|
|
29420
29747
|
return iri;
|
|
29421
29748
|
}
|
|
29422
|
-
async getSession() {
|
|
29423
|
-
return await this.session;
|
|
29424
|
-
}
|
|
29425
29749
|
_getLanguage() {
|
|
29426
29750
|
return localStorage.getItem("language") || window.navigator.language.slice(0, 2);
|
|
29427
29751
|
}
|
|
@@ -29439,16 +29763,8 @@ sh:property [
|
|
|
29439
29763
|
if (window.sibStore) {
|
|
29440
29764
|
return window.sibStore;
|
|
29441
29765
|
}
|
|
29442
|
-
const storeOptions = {};
|
|
29443
|
-
const sibAuth = document.querySelector("sib-auth");
|
|
29444
|
-
if (sibAuth) {
|
|
29445
|
-
const sibAuthDefined = customElements.whenDefined(sibAuth.localName);
|
|
29446
|
-
storeOptions.session = sibAuthDefined.then(() => sibAuth.session);
|
|
29447
|
-
storeOptions.fetchMethod = sibAuthDefined.then(() => sibAuth.getFetch());
|
|
29448
|
-
}
|
|
29449
29766
|
const store2 = new LdpStore({
|
|
29450
|
-
..._cfg == null ? void 0 : _cfg.options
|
|
29451
|
-
...storeOptions
|
|
29767
|
+
..._cfg == null ? void 0 : _cfg.options
|
|
29452
29768
|
});
|
|
29453
29769
|
window.sibStore = store2;
|
|
29454
29770
|
return store2;
|
|
@@ -29495,6 +29811,7 @@ sh:property [
|
|
|
29495
29811
|
StoreFactory.register(StoreType.DataspaceConnector, DataspaceConnectorStoreAdapter);
|
|
29496
29812
|
StoreService = (_a = class {
|
|
29497
29813
|
static addStore(name, config) {
|
|
29814
|
+
var _a2;
|
|
29498
29815
|
const trimmedName = name.trim();
|
|
29499
29816
|
if (!trimmedName) {
|
|
29500
29817
|
throw new Error("[StoreService] Store name cannot be empty.");
|
|
@@ -29502,10 +29819,20 @@ sh:property [
|
|
|
29502
29819
|
if (!config) {
|
|
29503
29820
|
throw new Error("[StoreService] Store configuration is required.");
|
|
29504
29821
|
}
|
|
29822
|
+
console.log(`\u{1F527} [StoreService.addStore] Adding store "${trimmedName}":`, {
|
|
29823
|
+
storeType: config.type,
|
|
29824
|
+
endpoint: config.endpoint,
|
|
29825
|
+
alreadyExists: StoreService.stores.has(trimmedName)
|
|
29826
|
+
});
|
|
29505
29827
|
if (StoreService.stores.has(trimmedName)) {
|
|
29506
29828
|
StoreService.logWarning(`Store with name "${trimmedName}" already exists. Overwriting.`);
|
|
29507
29829
|
}
|
|
29508
29830
|
const store2 = StoreFactory.create(config);
|
|
29831
|
+
console.log(`\u2705 [StoreService.addStore] Created store for "${trimmedName}":`, {
|
|
29832
|
+
storeType: typeof store2,
|
|
29833
|
+
storeConfig: store2.config,
|
|
29834
|
+
storeEndpoint: (_a2 = store2.config) == null ? void 0 : _a2.endpoint
|
|
29835
|
+
});
|
|
29509
29836
|
StoreService.stores.set(trimmedName, {
|
|
29510
29837
|
store: store2,
|
|
29511
29838
|
config
|
|
@@ -29513,6 +29840,7 @@ sh:property [
|
|
|
29513
29840
|
return store2;
|
|
29514
29841
|
}
|
|
29515
29842
|
static getStore(name) {
|
|
29843
|
+
var _a2;
|
|
29516
29844
|
const storeName = StoreService.resolveStoreName(name);
|
|
29517
29845
|
if (!storeName) {
|
|
29518
29846
|
return null;
|
|
@@ -29525,6 +29853,11 @@ sh:property [
|
|
|
29525
29853
|
StoreService.logWarning(`Store with name "${storeName}" not found.`);
|
|
29526
29854
|
return null;
|
|
29527
29855
|
}
|
|
29856
|
+
console.log(`\u{1F4E6} [StoreService.getStore] Retrieving store "${storeName}":`, {
|
|
29857
|
+
found: !!instance,
|
|
29858
|
+
storeEndpoint: (_a2 = instance.store.config) == null ? void 0 : _a2.endpoint,
|
|
29859
|
+
configEndpoint: instance.config.endpoint
|
|
29860
|
+
});
|
|
29528
29861
|
return instance.store;
|
|
29529
29862
|
}
|
|
29530
29863
|
static setDefaultStore(name) {
|
|
@@ -33393,8 +33726,8 @@ sh:property [
|
|
|
33393
33726
|
function requireJsonldStreamingParser() {
|
|
33394
33727
|
if (hasRequiredJsonldStreamingParser) return jsonldStreamingParser;
|
|
33395
33728
|
hasRequiredJsonldStreamingParser = 1;
|
|
33396
|
-
(function(exports) {
|
|
33397
|
-
var __createBinding = jsonldStreamingParser && jsonldStreamingParser.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
33729
|
+
(function(exports$1) {
|
|
33730
|
+
var __createBinding = jsonldStreamingParser && jsonldStreamingParser.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
33398
33731
|
if (k2 === void 0) k2 = k;
|
|
33399
33732
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
33400
33733
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -33406,17 +33739,17 @@ sh:property [
|
|
|
33406
33739
|
};
|
|
33407
33740
|
}
|
|
33408
33741
|
Object.defineProperty(o, k2, desc);
|
|
33409
|
-
} : function(o, m, k, k2) {
|
|
33742
|
+
}) : (function(o, m, k, k2) {
|
|
33410
33743
|
if (k2 === void 0) k2 = k;
|
|
33411
33744
|
o[k2] = m[k];
|
|
33412
|
-
});
|
|
33413
|
-
var __exportStar = jsonldStreamingParser && jsonldStreamingParser.__exportStar || function(m,
|
|
33414
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(
|
|
33745
|
+
}));
|
|
33746
|
+
var __exportStar = jsonldStreamingParser && jsonldStreamingParser.__exportStar || function(m, exports$12) {
|
|
33747
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$12, p)) __createBinding(exports$12, m, p);
|
|
33415
33748
|
};
|
|
33416
|
-
Object.defineProperty(exports, "__esModule", {
|
|
33749
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
33417
33750
|
value: true
|
|
33418
33751
|
});
|
|
33419
|
-
__exportStar(requireJsonLdParser(), exports);
|
|
33752
|
+
__exportStar(requireJsonLdParser(), exports$1);
|
|
33420
33753
|
})(jsonldStreamingParser);
|
|
33421
33754
|
return jsonldStreamingParser;
|
|
33422
33755
|
}
|
|
@@ -33622,6 +33955,8 @@ sh:property [
|
|
|
33622
33955
|
semantizer = globalThis.SEMANTIZER;
|
|
33623
33956
|
})();
|
|
33624
33957
|
export {
|
|
33958
|
+
AuthFetchResolver as A,
|
|
33959
|
+
DEFAULT_AUTH_SELECTORS as D,
|
|
33625
33960
|
StoreService as S,
|
|
33626
33961
|
__tla,
|
|
33627
33962
|
formatAttributesToServerSearchOptions as a,
|