@spiffcommerce/core 40.3.10 → 40.3.12

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/CHANGELOG.md CHANGED
@@ -14,6 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
  - `Fixed` for any bug fixes.
15
15
  - `Security` in case of vulnerabilities.
16
16
 
17
+ ## [40.3.11] - 20-04-2026
18
+
19
+ ### Fixed
20
+
21
+ - If a product collection is assigned to a bundle, products not in the collection will be cleared from the bundle.
22
+
17
23
  ## [40.3.10] - 17-04-2026
18
24
 
19
25
  ### Fixed
@@ -69300,7 +69300,7 @@ class eE {
69300
69300
  if (t.data?.bundleAssignProductCollection.productCollection) {
69301
69301
  this.productCollection = t.data.bundleAssignProductCollection.productCollection;
69302
69302
  const n = t.data.bundleAssignProductCollection.productCollection.globalPropertyConfiguration;
69303
- this.globalPropertyStateManager.setConfiguration(n), await this.globalPropertyHandleService.getHandles(), this.globalConfigurationPropertyId = n?.id;
69303
+ this.globalPropertyStateManager.setConfiguration(n), await this.globalPropertyHandleService.getHandles(), this.globalConfigurationPropertyId = n?.id, await this.clearOldProducts(this.workflowExperiences);
69304
69304
  }
69305
69305
  }
69306
69306
  onModelLoadEvent(e) {
@@ -69330,19 +69330,23 @@ class eE {
69330
69330
  ), i.forEach((a) => a.setBundle(this)), i.forEach((a) => a.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService))
69331
69331
  for (const a of i)
69332
69332
  await this.injectExperienceIntoPreviewService(a);
69333
+ await this.clearOldProducts(i);
69334
+ }
69335
+ // Remove products from bundle that aren't in the collection.
69336
+ async clearOldProducts(e) {
69333
69337
  if (!this.globalPropertyStateManager.getBundleOptions()?.readonly) {
69334
- const a = this.getProductIds() || [], s = this.getProductCollection();
69335
- if (s && a.length > 0) {
69336
- await s.fetchProducts();
69337
- const o = s.getProducts(), l = [], u = [];
69338
- for (const h of a)
69339
- if (!o.find((d) => d.getId() === h)) {
69340
- for (const d of i)
69341
- d.getProduct()?.id === h && u.push(d);
69342
- l.push(h);
69338
+ const t = this.getProductIds() || [], n = this.getProductCollection();
69339
+ if (n && t.length > 0) {
69340
+ await n.fetchProducts();
69341
+ const i = n.getProducts(), a = [], s = [];
69342
+ for (const l of t)
69343
+ if (!i.find((c) => c.getId() === l)) {
69344
+ for (const c of e)
69345
+ c.getProduct()?.id === l && s.push(c);
69346
+ a.push(l);
69343
69347
  }
69344
- const c = [];
69345
- l.length > 0 && c.push(this.removeProductIds(l)), u.length > 0 && c.push(Promise.all(u.map((h) => h.clearProduct()))), c.length > 0 && await Promise.all(c);
69348
+ const o = [];
69349
+ a.length > 0 && o.push(this.removeProductIds(a)), s.length > 0 && o.push(Promise.all(s.map((l) => l.clearProduct()))), o.length > 0 && await Promise.all(o);
69346
69350
  }
69347
69351
  }
69348
69352
  }
@@ -70952,7 +70956,7 @@ class fV extends cV {
70952
70956
  });
70953
70957
  }
70954
70958
  async loadEventStreamCapability() {
70955
- const { EventStreamSerde: e } = await import("./index-Be2NvJRw.js");
70959
+ const { EventStreamSerde: e } = await import("./index-eRS5bBM0.js");
70956
70960
  return new e({
70957
70961
  marshaller: this.getEventStreamMarshaller(),
70958
70962
  serializer: this.serializer,
@@ -78515,7 +78519,7 @@ class AW {
78515
78519
  } catch (n) {
78516
78520
  throw console.error(n), new oo("Critical - Unable to synchronize workflow state with server.");
78517
78521
  }
78518
- }, this.options = e, this.options.applicationKey && j4(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 40.3.9"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
78522
+ }, this.options = e, this.options.applicationKey && j4(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 40.3.11"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
78519
78523
  }
78520
78524
  configure(e) {
78521
78525
  go.setHubUrl(e.hubUrl), go.setServerUrl(e.serverUrl), go.setServicesApiUrl(e.servicesApiUrl), this.marketplaceThemeInstallId = e.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = e.marketplaceThemeInstallConfigurationId, this.userPoolClientId = e.userPoolClientId, this.userPoolRegion = e.userPoolRegion, this.spiffRegion = e.spiffRegion, e.bearerAuthenticationToken && $4(e.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Pf.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -79370,18 +79374,22 @@ class hQ {
79370
79374
  const s = this.workflowManager.getRegionElements(this.stepName || ""), o = this.workflowManager.getCommandDispatcher();
79371
79375
  this.targetElements.forEach((l, u) => {
79372
79376
  let c = s.find((h) => h.id === l)?.regionIndex ?? u;
79373
- c >= e.length && (c = u), o(
79374
- new _n([
79375
- new QN(l, t, e[c]),
79376
- new WN(
79377
- l,
79378
- i.useThreshold,
79379
- i.invertThreshold,
79380
- i.threshold,
79381
- i.thresholdSaturation
79382
- )
79383
- ])
79384
- );
79377
+ c >= e.length && (c = u);
79378
+ try {
79379
+ o(
79380
+ new _n([
79381
+ new QN(l, t, e[c]),
79382
+ new WN(
79383
+ l,
79384
+ i.useThreshold,
79385
+ i.invertThreshold,
79386
+ i.threshold,
79387
+ i.thresholdSaturation
79388
+ )
79389
+ ])
79390
+ );
79391
+ } catch {
79392
+ }
79385
79393
  }), this.stepName && this.workflowManager.updateStorage(this.stepName, {
79386
79394
  frameOffsetsList: e
79387
79395
  }), a && a();
@@ -80344,4 +80352,4 @@ export {
80344
80352
  qN as y,
80345
80353
  GN as z
80346
80354
  };
80347
- //# sourceMappingURL=index-DQnieHbr.js.map
80355
+ //# sourceMappingURL=index-C5BLW3rS.js.map