@saasquatch/squatch-js 2.8.1-0 → 2.8.1

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/squatch.js CHANGED
@@ -1800,11 +1800,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1800
1800
  _log$3("No _saasquatchExtra param");
1801
1801
  return;
1802
1802
  }
1803
- const config = validateConfig();
1804
- if (!config.domain || !config.tenantAlias) {
1805
- _log$3(
1806
- "domain and tenantAlias must be provided in config to use _saasquatchExtra"
1807
- );
1803
+ const config = validateConfig({
1804
+ tenantAlias: "UNKNOWN"
1805
+ });
1806
+ if (!config.domain) {
1807
+ _log$3("domain must be provided in config to use _saasquatchExtra");
1808
1808
  return;
1809
1809
  }
1810
1810
  let raw;
@@ -1818,7 +1818,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1818
1818
  return domain.replace(/^https?:\/\//, "");
1819
1819
  }
1820
1820
  const normalizedDomain = normalizeDomain(config.domain);
1821
- const widgetConfig = (_a2 = raw == null ? void 0 : raw[normalizedDomain]) == null ? void 0 : _a2[config.tenantAlias];
1821
+ const tenantAlias = Object.keys((raw == null ? void 0 : raw[normalizedDomain]) || {})[0];
1822
+ const widgetConfig = (_a2 = raw == null ? void 0 : raw[normalizedDomain]) == null ? void 0 : _a2[tenantAlias];
1822
1823
  if (!widgetConfig) {
1823
1824
  _log$3("_saasquatchExtra did not have an expected structure");
1824
1825
  return void 0;
@@ -1832,8 +1833,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1832
1833
  },
1833
1834
  squatchConfig: {
1834
1835
  ...config,
1835
- domain: config.domain,
1836
- tenantAlias: config.tenantAlias
1836
+ tenantAlias
1837
1837
  }
1838
1838
  };
1839
1839
  }