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

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/README.md CHANGED
@@ -44,7 +44,7 @@ If you only need the store (without the full component framework), use the dedic
44
44
  import { sibStore, StoreService, StoreType } from '@startinblox/core/store';
45
45
  ```
46
46
 
47
- When loaded via a `<script>` tag, the store is also accessible via the `window.sib` namespace (e.g., `window.sib.store`, `window.sib.storeService`). See the [Store API Documentation](./docs/store.md) for details.
47
+ When loaded via a `<script>` tag, the store is also accessible via the `window.sib.store` namespace (e.g., `window.sib.store.ldp`, `window.sib.store.service`). See the [Store API Documentation](./docs/store.md) for details.
48
48
 
49
49
  ## Testing
50
50
 
@@ -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-BkGWS8YT.js";
5
+ import { S as StoreService } from "./store-oRwI904x.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-BkGWS8YT.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-oRwI904x.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-BkGWS8YT.js";
7
- import { A, D } from "./store-BkGWS8YT.js";
6
+ import { __tla as __tla_1 } from "./store-oRwI904x.js";
7
+ import { A, D } from "./store-oRwI904x.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([
@@ -3543,6 +3543,20 @@ let __tla = (async () => {
3543
3543
  this._localKeycloakAuth = new LocalKeycloakAuthManager(config.localKeycloakConfig);
3544
3544
  }
3545
3545
  }
3546
+ mergeContext(base) {
3547
+ const extra = this.config.additionalContext;
3548
+ if (!extra || Object.keys(extra).length === 0) return base;
3549
+ if (Array.isArray(base)) {
3550
+ return [
3551
+ ...base,
3552
+ extra
3553
+ ];
3554
+ }
3555
+ return {
3556
+ ...base,
3557
+ ...extra
3558
+ };
3559
+ }
3546
3560
  _makeAssetAgreementKey(assetId, providerParticipantId) {
3547
3561
  if (providerParticipantId) {
3548
3562
  return `${assetId}:${providerParticipantId}`;
@@ -3635,9 +3649,9 @@ let __tla = (async () => {
3635
3649
  console.warn("[DataspaceConnectorStore] No target asset ID found for negotiation");
3636
3650
  }
3637
3651
  const negotiationRequest = {
3638
- "@context": {
3652
+ "@context": this.mergeContext({
3639
3653
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/"
3640
- },
3654
+ }),
3641
3655
  "@type": "ContractRequest",
3642
3656
  counterPartyAddress,
3643
3657
  counterPartyId,
@@ -3724,9 +3738,9 @@ let __tla = (async () => {
3724
3738
  method: "POST",
3725
3739
  headers: this.headers,
3726
3740
  body: JSON.stringify({
3727
- "@context": {
3741
+ "@context": this.mergeContext({
3728
3742
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/"
3729
- },
3743
+ }),
3730
3744
  "@type": "QuerySpec",
3731
3745
  offset: 0,
3732
3746
  limit: 1e3
@@ -3785,10 +3799,10 @@ let __tla = (async () => {
3785
3799
  async initiateTransfer(counterPartyAddress, contractId, dataDestination) {
3786
3800
  await this.ensureAuthenticated();
3787
3801
  const transferRequest = {
3788
- "@context": [
3802
+ "@context": this.mergeContext([
3789
3803
  "https://w3id.org/edc/v0.0.1/ns/",
3790
3804
  "https://w3id.org/dspace/2024/1/context.json"
3791
- ],
3805
+ ]),
3792
3806
  "@type": "https://w3id.org/edc/v0.0.1/ns/TransferRequestMessage",
3793
3807
  counterPartyAddress,
3794
3808
  contractId,
@@ -3810,9 +3824,9 @@ let __tla = (async () => {
3810
3824
  async initiateEDRTransfer(assetId, counterPartyAddress, contractId, providerParticipantId) {
3811
3825
  await this.ensureAuthenticated();
3812
3826
  const edrRequest = {
3813
- "@context": {
3827
+ "@context": this.mergeContext({
3814
3828
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/"
3815
- },
3829
+ }),
3816
3830
  "@type": "https://w3id.org/edc/v0.0.1/ns/TransferRequest",
3817
3831
  assetId,
3818
3832
  protocol: "dataspace-protocol-http",
@@ -4291,23 +4305,23 @@ let __tla = (async () => {
4291
4305
  const apiVersion = this.config.apiVersion || "v3";
4292
4306
  if (apiVersion === "v3") {
4293
4307
  return {
4294
- "@context": {
4308
+ "@context": this.mergeContext({
4295
4309
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4296
4310
  edc: "https://w3id.org/edc/v0.0.1/ns/",
4297
4311
  dcat: "https://www.w3.org/ns/dcat#",
4298
4312
  dct: "https://purl.org/dc/terms/",
4299
4313
  odrl: "http://www.w3.org/ns/odrl/2/"
4300
- },
4314
+ }),
4301
4315
  "@type": "CatalogRequestMessage",
4302
4316
  counterPartyAddress: counterPartyAddress || this.getProtocolEndpoint(),
4303
4317
  protocol: "dataspace-protocol-http"
4304
4318
  };
4305
4319
  }
4306
4320
  return {
4307
- "@context": [
4321
+ "@context": this.mergeContext([
4308
4322
  "https://w3id.org/edc/v0.0.1/ns/",
4309
4323
  "https://w3id.org/dspace/2024/1/context.json"
4310
- ],
4324
+ ]),
4311
4325
  "@type": "https://w3id.org/edc/v0.0.1/ns/CatalogRequestMessage",
4312
4326
  counterPartyAddress: counterPartyAddress || this.config.endpoint || "",
4313
4327
  protocol: "dataspace-protocol-http"
@@ -4409,10 +4423,10 @@ let __tla = (async () => {
4409
4423
  }
4410
4424
  buildV3QuerySpec(offset = 0, limit = 50) {
4411
4425
  return {
4412
- "@context": {
4426
+ "@context": this.mergeContext({
4413
4427
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4414
4428
  edc: "https://w3id.org/edc/v0.0.1/ns/"
4415
- },
4429
+ }),
4416
4430
  "@type": "QuerySpec",
4417
4431
  offset,
4418
4432
  limit,
@@ -4449,10 +4463,12 @@ let __tla = (async () => {
4449
4463
  const apiVersion = this.config.apiVersion || "v3";
4450
4464
  const assetsEndpoint = this.config.assetsEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/assets" : "/assets");
4451
4465
  const assetData = {
4452
- "@context": {
4466
+ "@context": this.mergeContext({
4453
4467
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4454
- edc: "https://w3id.org/edc/v0.0.1/ns/"
4455
- },
4468
+ edc: "https://w3id.org/edc/v0.0.1/ns/",
4469
+ dcterms: "http://purl.org/dc/terms/",
4470
+ dcat: "http://www.w3.org/ns/dcat#"
4471
+ }),
4456
4472
  "@type": "Asset",
4457
4473
  "@id": assetInput["@id"],
4458
4474
  properties: assetInput.properties || {},
@@ -4600,11 +4616,11 @@ let __tla = (async () => {
4600
4616
  const apiVersion = this.config.apiVersion || "v3";
4601
4617
  const policiesEndpoint = this.config.policiesEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/policydefinitions" : "/policydefinitions");
4602
4618
  const policyData = {
4603
- "@context": {
4619
+ "@context": this.mergeContext({
4604
4620
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4605
4621
  edc: "https://w3id.org/edc/v0.0.1/ns/",
4606
4622
  odrl: "http://www.w3.org/ns/odrl/2/"
4607
- },
4623
+ }),
4608
4624
  "@type": "PolicyDefinition",
4609
4625
  "@id": policyInput["@id"],
4610
4626
  policy: policyInput.policy
@@ -4634,11 +4650,11 @@ let __tla = (async () => {
4634
4650
  const apiVersion = this.config.apiVersion || "v3";
4635
4651
  const policiesEndpoint = this.config.policiesEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/policydefinitions" : "/policydefinitions");
4636
4652
  const policyData = {
4637
- "@context": {
4653
+ "@context": this.mergeContext({
4638
4654
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4639
4655
  edc: "https://w3id.org/edc/v0.0.1/ns/",
4640
4656
  odrl: "http://www.w3.org/ns/odrl/2/"
4641
- },
4657
+ }),
4642
4658
  "@type": "PolicyDefinition",
4643
4659
  "@id": policyInput["@id"],
4644
4660
  policy: policyInput.policy
@@ -4704,10 +4720,10 @@ let __tla = (async () => {
4704
4720
  const apiVersion = this.config.apiVersion || "v3";
4705
4721
  const contractDefsEndpoint = this.config.contractDefinitionsEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/contractdefinitions" : "/contractdefinitions");
4706
4722
  const contractData = {
4707
- "@context": {
4723
+ "@context": this.mergeContext({
4708
4724
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4709
4725
  edc: "https://w3id.org/edc/v0.0.1/ns/"
4710
- },
4726
+ }),
4711
4727
  "@type": "ContractDefinition",
4712
4728
  "@id": contractInput["@id"],
4713
4729
  accessPolicyId: contractInput.accessPolicyId,
@@ -4741,10 +4757,10 @@ let __tla = (async () => {
4741
4757
  const apiVersion = this.config.apiVersion || "v3";
4742
4758
  const contractDefsEndpoint = this.config.contractDefinitionsEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/contractdefinitions" : "/contractdefinitions");
4743
4759
  const contractData = {
4744
- "@context": {
4760
+ "@context": this.mergeContext({
4745
4761
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4746
4762
  edc: "https://w3id.org/edc/v0.0.1/ns/"
4747
- },
4763
+ }),
4748
4764
  "@type": "ContractDefinition",
4749
4765
  "@id": contractInput["@id"],
4750
4766
  accessPolicyId: contractInput.accessPolicyId,
@@ -33008,7 +33024,7 @@ sh:property [
33008
33024
  window.dispatchEvent(event);
33009
33025
  }
33010
33026
  async initGetter() {
33011
- const { CustomGetter } = await import("./custom-getter-1qsjH_ZX.js");
33027
+ const { CustomGetter } = await import("./custom-getter-C-pmD8Lu.js");
33012
33028
  return CustomGetter;
33013
33029
  }
33014
33030
  disconnectedCallback() {
@@ -37601,12 +37617,14 @@ sh:property [
37601
37617
  if (!window.sib) {
37602
37618
  window.sib = {};
37603
37619
  }
37604
- window.sib.store = sibStore;
37605
- window.sib.storeService = StoreService;
37606
- window.sib.storeType = StoreType;
37607
- window.sib.hasQueryIndex = hasQueryIndex;
37608
- window.sib.hasSetLocalData = hasSetLocalData;
37609
- window.sib.hasQueryIndexConjunction = hasQueryIndexConjunction;
37620
+ window.sib.store = {
37621
+ ldp: sibStore,
37622
+ service: StoreService,
37623
+ type: StoreType,
37624
+ hasQueryIndex,
37625
+ hasSetLocalData,
37626
+ hasQueryIndexConjunction
37627
+ };
37610
37628
  if (!window.sibStore) {
37611
37629
  window.sibStore = sibStore;
37612
37630
  }
package/dist/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s, S, c, b, e, j, h, i } from "./store-BkGWS8YT.js";
1
+ import { s, S, c, b, e, j, h, i } from "./store-oRwI904x.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.15",
3
+ "version": "2.0.6-beta.17",
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",