@startinblox/core 2.0.6-beta.16 → 2.0.6-beta.18

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-_V-vtjZ_.js";
5
+ import { S as StoreService } from "./store-BS4UzkyW.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-_V-vtjZ_.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-BS4UzkyW.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-_V-vtjZ_.js";
7
- import { A, D } from "./store-_V-vtjZ_.js";
6
+ import { __tla as __tla_1 } from "./store-BS4UzkyW.js";
7
+ import { A, D } from "./store-BS4UzkyW.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,12 @@ 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
- odrl: "http://www.w3.org/ns/odrl/2/"
4607
- },
4622
+ odrl: "http://www.w3.org/ns/odrl/2/",
4623
+ dsif: "https://spec.dsif.dev/ns#"
4624
+ }),
4608
4625
  "@type": "PolicyDefinition",
4609
4626
  "@id": policyInput["@id"],
4610
4627
  policy: policyInput.policy
@@ -4634,11 +4651,12 @@ let __tla = (async () => {
4634
4651
  const apiVersion = this.config.apiVersion || "v3";
4635
4652
  const policiesEndpoint = this.config.policiesEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/policydefinitions" : "/policydefinitions");
4636
4653
  const policyData = {
4637
- "@context": {
4654
+ "@context": this.mergeContext({
4638
4655
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4639
4656
  edc: "https://w3id.org/edc/v0.0.1/ns/",
4640
- odrl: "http://www.w3.org/ns/odrl/2/"
4641
- },
4657
+ odrl: "http://www.w3.org/ns/odrl/2/",
4658
+ dsif: "https://spec.dsif.dev/ns#"
4659
+ }),
4642
4660
  "@type": "PolicyDefinition",
4643
4661
  "@id": policyInput["@id"],
4644
4662
  policy: policyInput.policy
@@ -4704,10 +4722,10 @@ let __tla = (async () => {
4704
4722
  const apiVersion = this.config.apiVersion || "v3";
4705
4723
  const contractDefsEndpoint = this.config.contractDefinitionsEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/contractdefinitions" : "/contractdefinitions");
4706
4724
  const contractData = {
4707
- "@context": {
4725
+ "@context": this.mergeContext({
4708
4726
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4709
4727
  edc: "https://w3id.org/edc/v0.0.1/ns/"
4710
- },
4728
+ }),
4711
4729
  "@type": "ContractDefinition",
4712
4730
  "@id": contractInput["@id"],
4713
4731
  accessPolicyId: contractInput.accessPolicyId,
@@ -4741,10 +4759,10 @@ let __tla = (async () => {
4741
4759
  const apiVersion = this.config.apiVersion || "v3";
4742
4760
  const contractDefsEndpoint = this.config.contractDefinitionsEndpoint || this.config.catalogEndpoint.replace("/catalog/request", apiVersion === "v3" ? "/contractdefinitions" : "/contractdefinitions");
4743
4761
  const contractData = {
4744
- "@context": {
4762
+ "@context": this.mergeContext({
4745
4763
  "@vocab": "https://w3id.org/edc/v0.0.1/ns/",
4746
4764
  edc: "https://w3id.org/edc/v0.0.1/ns/"
4747
- },
4765
+ }),
4748
4766
  "@type": "ContractDefinition",
4749
4767
  "@id": contractInput["@id"],
4750
4768
  accessPolicyId: contractInput.accessPolicyId,
@@ -33008,7 +33026,7 @@ sh:property [
33008
33026
  window.dispatchEvent(event);
33009
33027
  }
33010
33028
  async initGetter() {
33011
- const { CustomGetter } = await import("./custom-getter-CigSDPI6.js");
33029
+ const { CustomGetter } = await import("./custom-getter-CRz-sS8r.js");
33012
33030
  return CustomGetter;
33013
33031
  }
33014
33032
  disconnectedCallback() {
package/dist/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s, S, c, b, e, j, h, i } from "./store-_V-vtjZ_.js";
1
+ import { s, S, c, b, e, j, h, i } from "./store-BS4UzkyW.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.16",
3
+ "version": "2.0.6-beta.18",
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",