@spiffcommerce/core 34.2.0-beta.8768fb84-fcf9-5f74-887a-269c132438f2 → 34.3.0-beta.30ca33a3-7b27-57c0-87b4-33dd497ec9b8

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
@@ -10935,7 +10935,7 @@ const Nd = (n, t) => {
10935
10935
  bundleDelete(id: $id)
10936
10936
  }
10937
10937
  `, al = C`
10938
- mutation FindBundleForTransactions($ids: [String!]!) {
10938
+ query FindBundleForTransactions($ids: [String!]!) {
10939
10939
  transactions(ids: $ids) {
10940
10940
  id
10941
10941
  bundle {
@@ -15497,17 +15497,28 @@ class dn {
15497
15497
  async loadExistingWorkflowExperiences(t, e, a) {
15498
15498
  if (t.length === 0) return;
15499
15499
  const i = await this.client.getWorkflowExperiences(
15500
- t.map((r) => ({
15500
+ t.map((s) => ({
15501
15501
  type: "transaction",
15502
- transactionId: r
15502
+ transactionId: s
15503
15503
  })),
15504
15504
  e,
15505
15505
  void 0,
15506
15506
  a
15507
15507
  );
15508
- if (i.forEach((r) => r.setBundle(this)), i.forEach((r) => r.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15509
- for (const r of i)
15510
- await this.injectExperienceIntoPreviewService(r);
15508
+ if (i.forEach((s) => s.setBundle(this)), i.forEach((s) => s.checkForPriceBreakChanges()), this.workflowExperiences = i, this.previewService)
15509
+ for (const s of i)
15510
+ await this.injectExperienceIntoPreviewService(s);
15511
+ const r = this.getIntegrationProductIds() || [], o = this.getProductCollection();
15512
+ if (o && r.length > 0) {
15513
+ await o.fetchProducts();
15514
+ const s = o.getProducts();
15515
+ for (const l of r)
15516
+ if (!s.find((d) => d.getCurrentIntegration().id === l)) {
15517
+ for (const d of i)
15518
+ d.getProduct()?.integrationProducts?.map((A) => A.id)?.includes(l) && await d.clearProduct();
15519
+ await this.removeIntegrationProductIds([l]);
15520
+ }
15521
+ }
15511
15522
  }
15512
15523
  async updateBundle() {
15513
15524
  if (!(await y.getShadowGraphqlClient().mutate({
@@ -16167,7 +16178,7 @@ class Ld {
16167
16178
  } catch (a) {
16168
16179
  throw console.error(a), new gt("Critical - Unable to synchronize workflow state with server.");
16169
16180
  }
16170
- }, this.options = t, this.options.applicationKey && ir(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.2.0-beta.72ed91da-b1c4-541e-88ce-25cf7d5b1199"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16181
+ }, this.options = t, this.options.applicationKey && ir(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 34.3.0"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16171
16182
  }
16172
16183
  configure(t) {
16173
16184
  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 && or(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Lt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);
@@ -16895,7 +16906,7 @@ const qd = async (n) => {
16895
16906
  }
16896
16907
  });
16897
16908
  if (!e.data?.transactions || e.data.transactions.length !== 1 || e.data.transactions[0].id !== n)
16898
- throw new Error(`Failed to find transaction to read bundle id: ${e.errors}`);
16909
+ throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(e.errors)}`);
16899
16910
  return e.data.transactions[0].bundle?.id;
16900
16911
  };
16901
16912
  function uc(n, t, e, a) {