@builder.io/sdk 2.2.8 → 2.2.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @builder.io/sdk
2
2
 
3
+ ## 2.2.9
4
+
5
+ ### Patch Changes
6
+
7
+ - b7c00cf: Silence errors from non essential query params parsing
8
+
3
9
  ## 2.2.8
4
10
 
5
11
  ### Patch Changes
@@ -152,7 +152,7 @@
152
152
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
153
153
  }
154
154
 
155
- var version = "2.2.8";
155
+ var version = "2.2.9";
156
156
 
157
157
  var Subscription = /** @class */ (function () {
158
158
  function Subscription(listeners, listener) {
@@ -1850,15 +1850,20 @@
1850
1850
  };
1851
1851
  Builder.prototype.setTestsFromUrl = function () {
1852
1852
  var search = this.getLocation().search;
1853
- var params = QueryString.parseDeep(this.modifySearch(search || '').substr(1));
1854
- var tests = params.builder && params.builder.tests;
1855
- if (tests && typeof tests === 'object') {
1856
- for (var key in tests) {
1857
- if (tests.hasOwnProperty(key)) {
1858
- this.setTestCookie(key, tests[key]);
1853
+ try {
1854
+ var params = QueryString.parseDeep(this.modifySearch(search || '').substr(1));
1855
+ var tests = params.builder && params.builder.tests;
1856
+ if (tests && typeof tests === 'object') {
1857
+ for (var key in tests) {
1858
+ if (tests.hasOwnProperty(key)) {
1859
+ this.setTestCookie(key, tests[key]);
1860
+ }
1859
1861
  }
1860
1862
  }
1861
1863
  }
1864
+ catch (e) {
1865
+ console.debug('Error parsing tests from URL', e);
1866
+ }
1862
1867
  };
1863
1868
  Builder.prototype.resetOverrides = function () {
1864
1869
  // Ugly - pass down instances per request instead using react context
@@ -1876,41 +1881,46 @@
1876
1881
  };
1877
1882
  Builder.prototype.getOverridesFromQueryString = function () {
1878
1883
  var location = this.getLocation();
1879
- var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
1880
- var builder = params.builder;
1881
- if (builder) {
1882
- var userAttributes = builder.userAttributes, overrides = builder.overrides, env = builder.env; builder.host; var api = builder.api, cachebust = builder.cachebust, noCache = builder.noCache, preview = builder.preview, editing = builder.editing, frameEditing = builder.frameEditing, options = builder.options, overrideParams = builder.params;
1883
- if (userAttributes) {
1884
- this.setUserAttributes(userAttributes);
1885
- }
1886
- if (options) {
1887
- // picking only locale, includeRefs, and enrich for now
1888
- this.queryOptions = __assign(__assign(__assign({}, (options.locale && { locale: options.locale })), (options.includeRefs && { includeRefs: options.includeRefs })), (options.enrich && { enrich: options.enrich }));
1889
- }
1890
- if (overrides) {
1891
- this.overrides = overrides;
1892
- }
1893
- if (validEnvList.indexOf(env || api) > -1) {
1894
- this.env = env || api;
1895
- }
1896
- if (Builder.isEditing) {
1897
- var editingModel = frameEditing || editing || preview;
1898
- if (editingModel && editingModel !== 'true') {
1899
- this.editingModel = editingModel;
1884
+ try {
1885
+ var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
1886
+ var builder = params.builder;
1887
+ if (builder) {
1888
+ var userAttributes = builder.userAttributes, overrides = builder.overrides, env = builder.env, host = builder.host, api = builder.api, cachebust = builder.cachebust, noCache = builder.noCache, preview = builder.preview, editing = builder.editing, frameEditing = builder.frameEditing, options = builder.options, overrideParams = builder.params;
1889
+ if (userAttributes) {
1890
+ this.setUserAttributes(userAttributes);
1891
+ }
1892
+ if (options) {
1893
+ // picking only locale, includeRefs, and enrich for now
1894
+ this.queryOptions = __assign(__assign(__assign({}, (options.locale && { locale: options.locale })), (options.includeRefs && { includeRefs: options.includeRefs })), (options.enrich && { enrich: options.enrich }));
1895
+ }
1896
+ if (overrides) {
1897
+ this.overrides = overrides;
1898
+ }
1899
+ if (validEnvList.indexOf(env || api) > -1) {
1900
+ this.env = env || api;
1901
+ }
1902
+ if (Builder.isEditing) {
1903
+ var editingModel = frameEditing || editing || preview;
1904
+ if (editingModel && editingModel !== 'true') {
1905
+ this.editingModel = editingModel;
1906
+ }
1907
+ }
1908
+ if (cachebust) {
1909
+ this.cachebust = true;
1910
+ }
1911
+ if (noCache) {
1912
+ this.noCache = true;
1913
+ }
1914
+ if (preview) {
1915
+ this.preview = true;
1916
+ }
1917
+ if (params) {
1918
+ this.overrideParams = overrideParams;
1900
1919
  }
1901
1920
  }
1902
- if (cachebust) {
1903
- this.cachebust = true;
1904
- }
1905
- if (noCache) {
1906
- this.noCache = true;
1907
- }
1908
- if (preview) {
1909
- this.preview = true;
1910
- }
1911
- if (params) {
1912
- this.overrideParams = overrideParams;
1913
- }
1921
+ }
1922
+ catch (e) {
1923
+ console.debug('Error parsing overrides from URL', e);
1914
1924
  }
1915
1925
  };
1916
1926
  Builder.prototype.messageFrameLoaded = function () {