@spiffcommerce/core 34.4.1 → 34.4.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
@@ -15496,17 +15496,28 @@ class cn {
15496
15496
  async loadExistingWorkflowExperiences(t, e, a) {
15497
15497
  if (t.length === 0) return;
15498
15498
  const i = await this.client.getWorkflowExperiences(
15499
- t.map((r) => ({
15499
+ t.map((s) => ({
15500
15500
  type: "transaction",
15501
- transactionId: r
15501
+ transactionId: s
15502
15502
  })),
15503
15503
  e,
15504
15504
  void 0,
15505
15505
  a
15506
15506
  );
15507
- if (i.forEach((r) => r.setBundle(this)), i.forEach((r) => r.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15508
- for (const r of i)
15509
- await this.injectExperienceIntoPreviewService(r);
15507
+ if (i.forEach((s) => s.setBundle(this)), i.forEach((s) => s.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15508
+ for (const s of i)
15509
+ await this.injectExperienceIntoPreviewService(s);
15510
+ const r = this.getIntegrationProductIds() || [], o = this.getProductCollection();
15511
+ if (o && r.length > 0) {
15512
+ await o.fetchProducts();
15513
+ const s = o.getProducts();
15514
+ for (const l of r)
15515
+ if (!s.find((d) => d.getCurrentIntegration().id === l)) {
15516
+ for (const d of i)
15517
+ d.getProduct()?.integrationProducts?.map((A) => A.id)?.includes(l) && await d.clearProduct();
15518
+ await this.removeIntegrationProductIds([l]);
15519
+ }
15520
+ }
15510
15521
  }
15511
15522
  async updateBundle() {
15512
15523
  if (!(await y.getShadowGraphqlClient().mutate({
@@ -16166,7 +16177,7 @@ class Ud {
16166
16177
  } catch (a) {
16167
16178
  throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
16168
16179
  }
16169
- }, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.4.1"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16180
+ }, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.4.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16170
16181
  }
16171
16182
  configure(t) {
16172
16183
  pt.setHubUrl(t.hubUrl), pt.setServerUrl(t.serverUrl), pt.setServicesApiUrl(t.servicesApiUrl), this.marketplaceThemeInstallId = t.marketplaceThemeInstallId, this.marketplaceThemeInstallConfigurationId = t.marketplaceThemeInstallConfigurationId, this.userPoolClientId = t.userPoolClientId, this.userPoolRegion = t.userPoolRegion, this.spiffRegion = t.spiffRegion, t.bearerAuthenticationToken && rr(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);