@startinblox/core 2.0.6-beta.17 → 2.0.6-beta.19

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.
@@ -2,7 +2,7 @@ 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
4
  import { q as mergeContexts, o as getRawContext, n as normalizeContext } from "./helpers-DtCY-jxq.js";
5
- import { S as StoreService } from "./store-oRwI904x.js";
5
+ import { S as StoreService } from "./store-BpnX896B.js";
6
6
  const store = StoreService.getInstance();
7
7
  class CustomGetter {
8
8
  // search attributes to give to server
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
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 { g as getDefaultExportFromCjs, S as StoreService, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as StoreType, d as StoreFactory, h as hasSetLocalData, e as hasQueryIndex, __tla as __tla_0 } from "./store-oRwI904x.js";
4
+ import { g as getDefaultExportFromCjs, S as StoreService, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as StoreType, d as StoreFactory, h as hasSetLocalData, e as hasQueryIndex, __tla as __tla_0 } from "./store-BpnX896B.js";
5
5
  import { d as defineComponent, n as normalizeContext, u as uniqID, f as fuzzyCompare, a as asyncQuerySelector, i as importInlineCSS, b as importCSS, c as doesResourceContainList, e as findClosingBracketMatchIndex, p as parseFieldsString, g as evalTemplateString, h as compare, j as generalComparator, t as transformArrayToContainer, s as setDeepProperty } from "./helpers-DtCY-jxq.js";
6
- import { __tla as __tla_1 } from "./store-oRwI904x.js";
7
- import { A, D } from "./store-oRwI904x.js";
6
+ import { __tla as __tla_1 } from "./store-BpnX896B.js";
7
+ import { A, D } from "./store-BpnX896B.js";
8
8
  import { k } from "./helpers-DtCY-jxq.js";
9
9
  let index$4, BaseWidgetMixin, index$3, CounterMixin, DspCatalogDisplay, EdcAssetsDisplay, FederationMixin, FilterMixin, GrouperMixin, HighlighterMixin, ListMixin, NextMixin, PaginateMixin, RequiredMixin, Sib, SolidAcChecker, SolidDelete, SolidDisplay, SolidForm, SolidFormSearch, SolidLang, SolidMemberAdd, SolidMemberDelete, SolidMembership, SolidTable, SolidTemplateElement, SolidWidget, SorterMixin, StoreMixin, index$2, index$1, index, TranslationMixin, ValidationMixin, WidgetMixin, b, o$2, newWidgetFactory, D2, o$1, m, widgetFactory;
10
10
  let __tla = Promise.all([
@@ -4619,7 +4619,8 @@ let __tla = (async () => {
4619
4619
  "@context": this.mergeContext({
4620
4620
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4621
4621
  edc: "https://w3id.org/edc/v0.0.1/ns/",
4622
- odrl: "http://www.w3.org/ns/odrl/2/"
4622
+ odrl: "http://www.w3.org/ns/odrl/2/",
4623
+ dsif: "https://spec.dsif.dev/ns#"
4623
4624
  }),
4624
4625
  "@type": "PolicyDefinition",
4625
4626
  "@id": policyInput["@id"],
@@ -4653,7 +4654,8 @@ let __tla = (async () => {
4653
4654
  "@context": this.mergeContext({
4654
4655
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4655
4656
  edc: "https://w3id.org/edc/v0.0.1/ns/",
4656
- odrl: "http://www.w3.org/ns/odrl/2/"
4657
+ odrl: "http://www.w3.org/ns/odrl/2/",
4658
+ dsif: "https://spec.dsif.dev/ns#"
4657
4659
  }),
4658
4660
  "@type": "PolicyDefinition",
4659
4661
  "@id": policyInput["@id"],
@@ -5381,6 +5383,9 @@ let __tla = (async () => {
5381
5383
  __publicField(this, "cleanupAuth");
5382
5384
  __publicField(this, "isFetching", false);
5383
5385
  __publicField(this, "pendingGetData", null);
5386
+ __publicField(this, "apiReady");
5387
+ __publicField(this, "resolveApiReady");
5388
+ __publicField(this, "apiReadyTimer");
5384
5389
  __publicField(this, "resolveFetch", async (event) => {
5385
5390
  if (!this.cfg.endpoint) {
5386
5391
  throw new Error("Missing required `endpoint` in StoreConfig for FederatedCatalogueStore");
@@ -5392,19 +5397,34 @@ let __tla = (async () => {
5392
5397
  console.warn("[FederatedCatalogueStore] Auth activation event received but token not ready, skipping initialization");
5393
5398
  return;
5394
5399
  }
5400
+ const wasAlreadyReady = this.fcApi !== null;
5395
5401
  this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, {}, event.detail.fetch);
5396
- console.log("[FederatedCatalogueStore] Auth verified and ready, triggering data refetch");
5397
- this.triggerRefetch();
5402
+ this.markApiReady();
5403
+ if (wasAlreadyReady) {
5404
+ console.log("[FederatedCatalogueStore] Auth re-activated, triggering data refetch");
5405
+ this.triggerRefetch();
5406
+ }
5398
5407
  }
5399
5408
  });
5400
5409
  this.cfg = cfg;
5401
5410
  if (!this.cfg.endpoint) {
5402
5411
  throw new Error("Missing required `endpoint` in StoreConfig for FederatedCatalogueStore");
5403
5412
  }
5413
+ this.apiReady = new Promise((resolve) => {
5414
+ this.resolveApiReady = resolve;
5415
+ });
5416
+ this.apiReadyTimer = setTimeout(() => {
5417
+ if (!this.fcApi && this.cfg.endpoint) {
5418
+ console.warn("[FederatedCatalogueStore] Auth did not activate within 5s; falling back to unauthenticated fetch.");
5419
+ this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, {}, fetch.bind(globalThis));
5420
+ }
5421
+ this.resolveApiReady();
5422
+ }, 5e3);
5404
5423
  this.cleanupAuth = AuthFetchResolver.onAuthActivated(this.resolveFetch.bind(this));
5405
5424
  if (this.cfg.login) {
5406
5425
  const fetchAuth = AuthFetchResolver.getAuthFetch();
5407
5426
  this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, this.cfg.login, fetchAuth);
5427
+ this.markApiReady();
5408
5428
  } else {
5409
5429
  this.initializeWithOidcAuth();
5410
5430
  }
@@ -5421,6 +5441,17 @@ let __tla = (async () => {
5421
5441
  disconnectedCallback() {
5422
5442
  var _a2;
5423
5443
  (_a2 = this.cleanupAuth) == null ? void 0 : _a2.call(this);
5444
+ if (this.apiReadyTimer !== void 0) {
5445
+ clearTimeout(this.apiReadyTimer);
5446
+ this.apiReadyTimer = void 0;
5447
+ }
5448
+ }
5449
+ markApiReady() {
5450
+ if (this.apiReadyTimer !== void 0) {
5451
+ clearTimeout(this.apiReadyTimer);
5452
+ this.apiReadyTimer = void 0;
5453
+ }
5454
+ this.resolveApiReady();
5424
5455
  }
5425
5456
  async initializeWithOidcAuth() {
5426
5457
  var _a2;
@@ -5432,6 +5463,7 @@ let __tla = (async () => {
5432
5463
  if (!authElement) {
5433
5464
  console.log("[FederatedCatalogueStore] No auth element found, initializing with basic fetch (anonymous mode)");
5434
5465
  this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, {}, fetch.bind(window));
5466
+ this.markApiReady();
5435
5467
  return;
5436
5468
  }
5437
5469
  const isReady = await checkAuthElementReady(authElement);
@@ -5440,7 +5472,7 @@ let __tla = (async () => {
5440
5472
  if (typeof fetchAuth === "function") {
5441
5473
  console.log("[FederatedCatalogueStore] Auth is ready, initializing fcApi");
5442
5474
  this.fcApi = getFederatedCatalogueAPIWrapper(this.cfg.endpoint, {}, fetchAuth);
5443
- this.triggerRefetch();
5475
+ this.markApiReady();
5444
5476
  }
5445
5477
  } else {
5446
5478
  console.log("[FederatedCatalogueStore] Auth not ready yet, will wait for activation event");
@@ -5504,9 +5536,10 @@ let __tla = (async () => {
5504
5536
  this.isFetching = true;
5505
5537
  const executeGetData = async () => {
5506
5538
  var _a2;
5539
+ await this.apiReady;
5507
5540
  const targetType = this.resolveTargetType(args);
5508
5541
  if (!this.fcApi) {
5509
- console.warn("[FederatedCatalogueStore] API not initialized yet, waiting for auth activation");
5542
+ console.warn("[FederatedCatalogueStore] apiReady resolved without fcApi, returning empty container");
5510
5543
  return await this.initLocalDataSourceContainer();
5511
5544
  }
5512
5545
  const cacheIsValid = this.enableCaching && ((_a2 = this.metadataManager) == null ? void 0 : _a2.isCacheValid());
@@ -33024,7 +33057,7 @@ sh:property [
33024
33057
  window.dispatchEvent(event);
33025
33058
  }
33026
33059
  async initGetter() {
33027
- const { CustomGetter } = await import("./custom-getter-C-pmD8Lu.js");
33060
+ const { CustomGetter } = await import("./custom-getter-CBnSj88B.js");
33028
33061
  return CustomGetter;
33029
33062
  }
33030
33063
  disconnectedCallback() {
package/dist/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s, S, c, b, e, j, h, i } from "./store-oRwI904x.js";
1
+ import { s, S, c, b, e, j, h, i } from "./store-BpnX896B.js";
2
2
  export {
3
3
  s as SEMANTIZER,
4
4
  S as StoreService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "2.0.6-beta.17",
3
+ "version": "2.0.6-beta.19",
4
4
  "description": "This is a series of web component respecting both the web components standards and the Linked Data Platform convention.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",