@spiffcommerce/core 26.26.0 → 26.26.1-beta.5514dc7e-680a-53bf-8556-17b54be9d2ae

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
@@ -9766,10 +9766,14 @@ const Fs = y`
9766
9766
  }
9767
9767
  }
9768
9768
  `, Ts = y`
9769
- query GetProductCollectionForFilteredProducts($id: String!, $filters: ProductCollectionProductFilterInput!) {
9769
+ query GetProductCollectionForFilteredProducts(
9770
+ $id: String!
9771
+ $filters: ProductCollectionProductFilterInput!
9772
+ $tags: ProductCollectionProductTagFilterInput
9773
+ ) {
9770
9774
  productCollections(ids: [$id]) {
9771
9775
  id
9772
- productCollectionProducts(filters: $filters) {
9776
+ productCollectionProducts(filters: $filters, tags: $tags) {
9773
9777
  id
9774
9778
  product {
9775
9779
  id
@@ -9784,10 +9788,11 @@ const Fs = y`
9784
9788
  $limit: Int
9785
9789
  $offset: Int
9786
9790
  $filters: ProductCollectionProductFilterInput
9791
+ $tags: ProductCollectionProductTagFilterInput
9787
9792
  ) {
9788
9793
  productCollections(ids: [$id]) {
9789
9794
  id
9790
- productCollectionProductsFeed(filters: $filters, limit: $limit, offset: $offset) {
9795
+ productCollectionProductsFeed(filters: $filters, tags: $tags, limit: $limit, offset: $offset) {
9791
9796
  items {
9792
9797
  ...ProductCollectionProductFields
9793
9798
  }
@@ -13484,7 +13489,7 @@ class _n extends Ba {
13484
13489
  * @param variant The variant to select.
13485
13490
  */
13486
13491
  async selectVariant(t, e) {
13487
- console.log(`Selecting variant ${t.getId()} for option global property handle (channel ${e})`), await Promise.all([
13492
+ await Promise.all([
13488
13493
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13489
13494
  this.applyVariantSelection(t)
13490
13495
  ]);
@@ -13511,9 +13516,7 @@ class Ha extends _n {
13511
13516
  * @param variant The variant to select.
13512
13517
  */
13513
13518
  async selectVariant(t, e) {
13514
- console.log(
13515
- `Selecting variant ${t.getId()} for color option global property handle (channel ${e})`
13516
- ), await Promise.all([
13519
+ await Promise.all([
13517
13520
  this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name, t.getId(), void 0, e),
13518
13521
  this.applyColorVariant(t, void 0, e)
13519
13522
  ]);
@@ -13972,9 +13975,9 @@ class Xo {
13972
13975
  * Returns a list of collections products matching the associated metafield filters.
13973
13976
  * @param filters A list of filters to apply.
13974
13977
  */
13975
- async filterProducts(t) {
13976
- var i, s;
13977
- const e = await b.getShadowGraphqlClient().query({
13978
+ async filterProducts(t, e) {
13979
+ var s, o;
13980
+ const a = await b.getShadowGraphqlClient().query({
13978
13981
  query: Ts,
13979
13982
  errorPolicy: "all",
13980
13983
  variables: {
@@ -13982,15 +13985,19 @@ class Xo {
13982
13985
  filters: {
13983
13986
  link: "And",
13984
13987
  metafields: t
13985
- }
13988
+ },
13989
+ tags: e ? {
13990
+ include: e.include ?? [],
13991
+ exclude: e.exclude ?? []
13992
+ } : void 0
13986
13993
  }
13987
13994
  });
13988
- if (!((i = e.data) != null && i.productCollections) || ((s = e.data) == null ? void 0 : s.productCollections.length) === 0)
13995
+ if (!((s = a.data) != null && s.productCollections) || ((o = a.data) == null ? void 0 : o.productCollections.length) === 0)
13989
13996
  throw new Error("Failed to filter product collection products.");
13990
- const a = this.getProducts(), n = e.data.productCollections[0].productCollectionProducts.map(
13991
- (o) => o.product.id
13997
+ const n = this.getProducts(), i = a.data.productCollections[0].productCollectionProducts.map(
13998
+ (l) => l.product.id
13992
13999
  );
13993
- return a.filter((o) => n.includes(o.getId()));
14000
+ return n.filter((l) => i.includes(l.getId()));
13994
14001
  }
13995
14002
  /**
13996
14003
  * Fetches a paginated feed of products.
@@ -13999,16 +14006,16 @@ class Xo {
13999
14006
  * @param filters Optional filters to apply to the query.
14000
14007
  * @returns
14001
14008
  */
14002
- async fetchProductsFeed(t, e, a) {
14003
- var s, o, l, c, d, A;
14009
+ async fetchProductsFeed(t, e, a, n) {
14010
+ var o, l, c, d, A, u;
14004
14011
  if (this.fullFetched) {
14005
- const u = await (a ? this.filterProducts(a) : this.fetchProducts());
14012
+ const h = await (a ? this.filterProducts(a) : this.fetchProducts());
14006
14013
  return {
14007
- total: u.length,
14008
- items: u.slice(t, t + e)
14014
+ total: h.length,
14015
+ items: h.slice(t, t + e)
14009
14016
  };
14010
14017
  }
14011
- const n = await b.getShadowGraphqlClient().query({
14018
+ const i = await b.getShadowGraphqlClient().query({
14012
14019
  query: Qs,
14013
14020
  variables: {
14014
14021
  id: this.getId(),
@@ -14017,13 +14024,17 @@ class Xo {
14017
14024
  filters: a ? {
14018
14025
  link: "And",
14019
14026
  metafields: a
14027
+ } : void 0,
14028
+ tags: n ? {
14029
+ include: n.include ?? [],
14030
+ exclude: n.exclude ?? []
14020
14031
  } : void 0
14021
14032
  },
14022
14033
  errorPolicy: "all"
14023
14034
  });
14024
14035
  return {
14025
- 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))) || [],
14026
- 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
14036
+ items: ((c = (l = (o = i == null ? void 0 : i.data) == null ? void 0 : o.productCollections) == null ? void 0 : l[0].productCollectionProductsFeed) == null ? void 0 : c.items.filter((h) => !!h.product).map((h) => new se(h))) || [],
14037
+ total: ((u = (A = (d = i == null ? void 0 : i.data) == null ? void 0 : d.productCollections) == null ? void 0 : A[0].productCollectionProductsFeed) == null ? void 0 : u.total) ?? 0
14027
14038
  };
14028
14039
  }
14029
14040
  getTransformCollection() {
@@ -15365,7 +15376,7 @@ class Nc {
15365
15376
  } catch (a) {
15366
15377
  throw console.error(a), new ut("Critical - Unable to synchronize workflow state with server.");
15367
15378
  }
15368
- }, this.options = t, this.options.applicationKey && Fr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 26.26.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15379
+ }, this.options = t, this.options.applicationKey && Fr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 26.26.1"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
15369
15380
  }
15370
15381
  configure(t) {
15371
15382
  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();