@spiffcommerce/core 33.8.2 → 33.8.4

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
@@ -14921,12 +14921,22 @@ class ta {
14921
14921
  getIntegrationProductIds() {
14922
14922
  return this.bundleStateManager.getState()?.integrationProductIds;
14923
14923
  }
14924
- addIntegrationProductId(t) {
14924
+ async addIntegrationProductId(t) {
14925
14925
  const e = this.bundleStateManager.getState();
14926
14926
  if (e) {
14927
- e.integrationProductIds || (e.integrationProductIds = []), e.integrationProductIds = [...e.integrationProductIds, t];
14927
+ if (!e.integrationProductIds)
14928
+ e.integrationProductIds = [];
14929
+ else if (e.integrationProductIds.some((r) => r === t)) {
14930
+ this.fireEvent("bundle-integration-products-added", {
14931
+ integrationProductIds: e.integrationProductIds
14932
+ });
14933
+ return;
14934
+ }
14935
+ e.integrationProductIds = [...e.integrationProductIds, t];
14928
14936
  const a = JSON.stringify(e);
14929
- S.getShadowGraphqlClient().mutate({
14937
+ this.bundleStateManager.setState(a), this.fireEvent("bundle-integration-products-added", {
14938
+ integrationProductIds: e.integrationProductIds
14939
+ }), await S.getShadowGraphqlClient().mutate({
14930
14940
  mutation: Za,
14931
14941
  variables: {
14932
14942
  id: this.id,
@@ -14935,8 +14945,6 @@ class ta {
14935
14945
  context: {
14936
14946
  bundleOwnerId: this.ownerId
14937
14947
  }
14938
- }), this.bundleStateManager.setState(a), this.fireEvent("bundle-integration-products-added", {
14939
- integrationProductIds: e.integrationProductIds
14940
14948
  });
14941
14949
  }
14942
14950
  }
@@ -16164,7 +16172,7 @@ class xd {
16164
16172
  } catch (a) {
16165
16173
  throw console.error(a), new ht("Critical - Unable to synchronize workflow state with server.");
16166
16174
  }
16167
- }, this.options = t, this.options.applicationKey && Xr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.8.2"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16175
+ }, this.options = t, this.options.applicationKey && Xr(this.options.applicationKey), console.debug("------------------------"), console.debug("Spiff Commerce Core SDK"), console.debug("Version: 33.8.4"), console.debug(`Application Key Provided: ${!!this.options.applicationKey}`), console.debug("------------------------");
16168
16176
  }
16169
16177
  configure(t) {
16170
16178
  gt.setHubUrl(t.hubUrl), gt.setServerUrl(t.serverUrl), gt.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 && ti(t.bearerAuthenticationToken), this.options.applicationKey && this.getIntegration(), this.spiffRegion && this.userPoolRegion && this.userPoolClientId && Vt.init(this.spiffRegion, this.userPoolRegion, this.userPoolClientId);