@spiffcommerce/core 34.1.0-beta.7a56a636-d7cf-54ee-8dfc-5407b655bd46 → 34.1.0-beta.7d1062f1-7d67-5ea3-8640-5d0681c80907

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
@@ -4186,7 +4186,6 @@ const Y = new Or(), Un = C`
4186
4186
  externalCartProductId
4187
4187
  externalCartProductVariantId
4188
4188
  id
4189
- bundleIndex
4190
4189
  completed
4191
4190
  lastSyncedAt
4192
4191
  priceModifierTotal
@@ -13084,9 +13083,6 @@ class bl {
13084
13083
  getBundle() {
13085
13084
  return this.bundle;
13086
13085
  }
13087
- getBundleIndex() {
13088
- return this.transaction.bundleIndex;
13089
- }
13090
13086
  setBundle(t) {
13091
13087
  this.bundle = t;
13092
13088
  }
@@ -15282,11 +15278,7 @@ class dn {
15282
15278
  this.workflowExperiences[t] = this.workflowExperiences[e], this.workflowExperiences[e] = a, await this.updateTransactionOrder();
15283
15279
  }
15284
15280
  getWorkflowExperiences() {
15285
- const t = [...this.workflowExperiences], e = (a, i) => {
15286
- const r = a.getBundleIndex(), o = i.getBundleIndex();
15287
- return r === void 0 || o === void 0 ? 0 : r < o ? -1 : 1;
15288
- };
15289
- return t.sort(e), t;
15281
+ return [...this.workflowExperiences];
15290
15282
  }
15291
15283
  async sortWorkflowExperiences(t) {
15292
15284
  this.workflowExperiences = this.workflowExperiences.sort(t), await this.updateTransactionOrder();
@@ -15496,17 +15488,30 @@ class dn {
15496
15488
  async loadExistingWorkflowExperiences(t, e, a) {
15497
15489
  if (t.length === 0) return;
15498
15490
  const i = await this.client.getWorkflowExperiences(
15499
- t.map((r) => ({
15491
+ t.map((s) => ({
15500
15492
  type: "transaction",
15501
- transactionId: r
15493
+ transactionId: s
15502
15494
  })),
15503
15495
  e,
15504
15496
  void 0,
15505
15497
  a
15506
15498
  );
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);
15499
+ if (i.forEach((s) => s.setBundle(this)), i.forEach((s) => s.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15500
+ for (const s of i)
15501
+ await this.injectExperienceIntoPreviewService(s);
15502
+ const r = this.getIntegrationProductIds() || [], o = this.getProductCollection();
15503
+ if (o) {
15504
+ const s = o.getProducts();
15505
+ if (s.length > 0) {
15506
+ await o.fetchProducts();
15507
+ for (const l of r)
15508
+ if (!s.find((d) => d.getCurrentIntegration().id === l)) {
15509
+ for (const d of i)
15510
+ d.getProduct()?.integrationProducts?.map((A) => A.id)?.includes(l) && await d.clearProduct();
15511
+ await this.removeIntegrationProductIds([l]);
15512
+ }
15513
+ }
15514
+ }
15510
15515
  }
15511
15516
  async updateBundle() {
15512
15517
  if (!(await y.getShadowGraphqlClient().mutate({
@@ -16166,7 +16171,7 @@ class Od {
16166
16171
  } catch (a) {
16167
16172
  throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
16168
16173
  }
16169
- }, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.1.0-beta.3fb0da60-1da5-5e84-b959-ca75a31ba2e9"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16174
+ }, this.options = t, this.options.applicationKey && nr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.1.0-beta.b737d236-4f23-52f6-9704-e61e958b8bf8"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16170
16175
  }
16171
16176
  configure(t) {
16172
16177
  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);