@spiffcommerce/core 26.23.0 → 26.23.2

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/index.mjs CHANGED
@@ -9840,6 +9840,12 @@ const xs = y`
9840
9840
  transactions {
9841
9841
  id
9842
9842
  }
9843
+ globalPropertyState {
9844
+ id
9845
+ aspects {
9846
+ ...GlobalPropertyStateAspectFields
9847
+ }
9848
+ }
9843
9849
  }
9844
9850
  }
9845
9851
  `, Os = y`
@@ -13833,14 +13839,14 @@ class qo {
13833
13839
  getProducts() {
13834
13840
  if (!this.collection.productCollectionProducts)
13835
13841
  throw new Error("Failed to find products on collection. Ensure you fetch them first!");
13836
- return this.collection.productCollectionProducts.map((t) => new se(t));
13842
+ return this.collection.productCollectionProducts.filter((t) => !!t.product).map((t) => new se(t));
13837
13843
  }
13838
13844
  /**
13839
13845
  * A list of products in this collections with useful helpers for interacting with them.
13840
13846
  */
13841
13847
  async fetchProducts(t) {
13842
13848
  if (this.fullFetched)
13843
- return this.collection.productCollectionProducts.map((a) => new se(a));
13849
+ return this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new se(a));
13844
13850
  const e = await b.getShadowGraphqlClient().query({
13845
13851
  query: Ms,
13846
13852
  variables: {
@@ -13849,7 +13855,7 @@ class qo {
13849
13855
  },
13850
13856
  errorPolicy: "all"
13851
13857
  });
13852
- return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.map((a) => new se(a));
13858
+ return t || (this.fullFetched = !0), this.collection.productCollectionProducts = e.data.productCollections[0].productCollectionProducts || [], this.collection.productCollectionProducts.filter((a) => !!a.product).map((a) => new se(a));
13853
13859
  }
13854
13860
  /**
13855
13861
  * Returns a list of collections products matching the associated metafield filters.
@@ -13905,7 +13911,7 @@ class qo {
13905
13911
  errorPolicy: "all"
13906
13912
  });
13907
13913
  return {
13908
- items: ((l = (o = (s = n == null ? void 0 : n.data) == null ? void 0 : s.productCollections) == null ? void 0 : o[0].productCollectionProductsFeed) == null ? void 0 : l.items.map((u) => new se(u))) || [],
13914
+ items: ((l = (o = (s = n == null ? void 0 : n.data) == null ? void 0 : s.productCollections) == null ? void 0 : o[0].productCollectionProductsFeed) == null ? void 0 : l.items.filter((u) => !!u.product).map((u) => new se(u))) || [],
13909
13915
  total: ((A = (d = (c = n == null ? void 0 : n.data) == null ? void 0 : c.productCollections) == null ? void 0 : d[0].productCollectionProductsFeed) == null ? void 0 : A.total) ?? 0
13910
13916
  };
13911
13917
  }
@@ -15218,7 +15224,7 @@ class kc {
15218
15224
  } catch (a) {
15219
15225
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15220
15226
  }
15221
- }, this.options = t, this.options.applicationKey && xr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 26.23.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15227
+ }, this.options = t, this.options.applicationKey && xr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 26.23.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15222
15228
  }
15223
15229
  configure(t) {
15224
15230
  wt.setHubUrl(t.hubUrl), wt.setServerUrl(t.serverUrl), wt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, t.bearerAuthenticationToken && kr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration();
@@ -15589,7 +15595,8 @@ class kc {
15589
15595
  const m = k.getMap("bundleOwnerIds") || /* @__PURE__ */ new Map();
15590
15596
  m.set(u.id, u.bundleOwnerId), k.setMap("bundleOwnerIds", m);
15591
15597
  const g = new He(this, u, void 0, void 0, u.bundleOwnerId, {
15592
- eagerFetchProducts: (E = (B = n == null ? void 0 : n.graphql) == null ? void 0 : B.productCollection) == null ? void 0 : E.eagerFetchProducts
15598
+ eagerFetchProducts: (E = (B = n == null ? void 0 : n.graphql) == null ? void 0 : B.productCollection) == null ? void 0 : E.eagerFetchProducts,
15599
+ existingGlobalPropertyState: u.globalPropertyState
15593
15600
  });
15594
15601
  return await g.getInitializationPromise(), g;
15595
15602
  }