@spiffcommerce/core 34.4.1 → 34.4.3

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
@@ -9007,7 +9007,10 @@ class Xo {
9007
9007
  e.getCommandDispatcher()(f);
9008
9008
  }
9009
9009
  ), s.length === 0 && l) {
9010
- const p = V.getDefaultVariant(l, t.overrideDefaultVariantId);
9010
+ const p = V.getDefaultVariant(
9011
+ l,
9012
+ t.overrideDefaultVariantId
9013
+ );
9011
9014
  if (p) {
9012
9015
  const f = await this.selectVariantCommand(
9013
9016
  t,
@@ -9043,7 +9046,10 @@ class Xo {
9043
9046
  const h = c.getGlobalPropertyStateManager().getAspect(A.name);
9044
9047
  if (h)
9045
9048
  if (s.length === 0 && l) {
9046
- const g = V.getDefaultVariant(l, t.overrideDefaultVariantId);
9049
+ const g = V.getDefaultVariant(
9050
+ l,
9051
+ t.overrideDefaultVariantId
9052
+ );
9047
9053
  if (g) {
9048
9054
  const m = await this.selectVariantCommand(
9049
9055
  t,
@@ -9112,9 +9118,7 @@ class Xo {
9112
9118
  u.push(...m);
9113
9119
  }
9114
9120
  if (c) {
9115
- const m = i.map(
9116
- (p) => new ta(p.id, c, t.data.strokeThickness)
9117
- );
9121
+ const m = i.map((p) => new ta(p.id, c, t.data.strokeThickness));
9118
9122
  u.push(...m);
9119
9123
  }
9120
9124
  const h = await this.changeInputTextWithRegion(
@@ -9160,8 +9164,8 @@ class Xo {
9160
9164
  g.push(...p);
9161
9165
  }
9162
9166
  if (c) {
9163
- const p = i.map(
9164
- (f) => new ta(f.id, c, t.data.strokeThickness)
9167
+ const p = u.map(
9168
+ (f) => new ta(f.newElement.id, c, t.data.strokeThickness)
9165
9169
  );
9166
9170
  g.push(...p);
9167
9171
  }
@@ -15496,17 +15500,28 @@ class cn {
15496
15500
  async loadExistingWorkflowExperiences(t, e, a) {
15497
15501
  if (t.length === 0) return;
15498
15502
  const i = await this.client.getWorkflowExperiences(
15499
- t.map((r) => ({
15503
+ t.map((s) => ({
15500
15504
  type: "transaction",
15501
- transactionId: r
15505
+ transactionId: s
15502
15506
  })),
15503
15507
  e,
15504
15508
  void 0,
15505
15509
  a
15506
15510
  );
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);
15511
+ if (i.forEach((s) => s.setBundle(this)), i.forEach((s) => s.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15512
+ for (const s of i)
15513
+ await this.injectExperienceIntoPreviewService(s);
15514
+ const r = this.getIntegrationProductIds() || [], o = this.getProductCollection();
15515
+ if (o && r.length > 0) {
15516
+ await o.fetchProducts();
15517
+ const s = o.getProducts();
15518
+ for (const l of r)
15519
+ if (!s.find((d) => d.getCurrentIntegration().id === l)) {
15520
+ for (const d of i)
15521
+ d.getProduct()?.integrationProducts?.map((A) => A.id)?.includes(l) && await d.clearProduct();
15522
+ await this.removeIntegrationProductIds([l]);
15523
+ }
15524
+ }
15510
15525
  }
15511
15526
  async updateBundle() {
15512
15527
  if (!(await y.getShadowGraphqlClient().mutate({
@@ -16166,7 +16181,7 @@ class Ud {
16166
16181
  } catch (a) {
16167
16182
  throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
16168
16183
  }
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("------------------------");
16184
+ }, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.4.3"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16170
16185
  }
16171
16186
  configure(t) {
16172
16187
  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);