@builder.io/sdk 2.2.6 → 2.2.7-0
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.browser.js +50 -40
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +50 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +50 -40
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +50 -40
- package/dist/index.umd.js.map +1 -1
- package/dist/src/builder.class.js +50 -40
- package/dist/src/builder.class.js.map +1 -1
- package/dist/src/classes/promise.class.js +150 -154
- package/dist/src/classes/query-string.class.js +73 -74
- package/dist/src/classes/query-string.class.test.js +20 -20
- package/dist/src/functions/assign.function.js +19 -19
- package/dist/src/functions/fetch.function.js +97 -75
- package/dist/src/functions/finder.function.js +389 -274
- package/dist/src/functions/get-top-level-domain.js +8 -8
- package/dist/src/functions/next-tick.function.js +26 -23
- package/dist/src/functions/omit.function.js +13 -13
- package/dist/src/functions/server-only-require.function.js +10 -9
- package/dist/src/functions/throttle.function.js +35 -37
- package/dist/src/functions/to-error.js +5 -6
- package/dist/src/functions/uuid.js +9 -8
- package/dist/src/types/api-version.js +3 -3
- package/dist/src/types/element.js +3 -3
- package/dist/src/url.test.js +222 -118
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/.yarnrc.yml +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1767,15 +1767,20 @@ var Builder = /** @class */ (function () {
|
|
|
1767
1767
|
};
|
|
1768
1768
|
Builder.prototype.setTestsFromUrl = function () {
|
|
1769
1769
|
var search = this.getLocation().search;
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1770
|
+
try {
|
|
1771
|
+
var params = QueryString.parseDeep(this.modifySearch(search || '').substr(1));
|
|
1772
|
+
var tests = params.builder && params.builder.tests;
|
|
1773
|
+
if (tests && typeof tests === 'object') {
|
|
1774
|
+
for (var key in tests) {
|
|
1775
|
+
if (tests.hasOwnProperty(key)) {
|
|
1776
|
+
this.setTestCookie(key, tests[key]);
|
|
1777
|
+
}
|
|
1776
1778
|
}
|
|
1777
1779
|
}
|
|
1778
1780
|
}
|
|
1781
|
+
catch (e) {
|
|
1782
|
+
console.debug('Error parsing tests from URL', e);
|
|
1783
|
+
}
|
|
1779
1784
|
};
|
|
1780
1785
|
Builder.prototype.resetOverrides = function () {
|
|
1781
1786
|
// Ugly - pass down instances per request instead using react context
|
|
@@ -1793,41 +1798,46 @@ var Builder = /** @class */ (function () {
|
|
|
1793
1798
|
};
|
|
1794
1799
|
Builder.prototype.getOverridesFromQueryString = function () {
|
|
1795
1800
|
var location = this.getLocation();
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1801
|
+
try {
|
|
1802
|
+
var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
|
|
1803
|
+
var builder = params.builder;
|
|
1804
|
+
if (builder) {
|
|
1805
|
+
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;
|
|
1806
|
+
if (userAttributes) {
|
|
1807
|
+
this.setUserAttributes(userAttributes);
|
|
1808
|
+
}
|
|
1809
|
+
if (options) {
|
|
1810
|
+
// picking only locale, includeRefs, and enrich for now
|
|
1811
|
+
this.queryOptions = tslib.__assign(tslib.__assign(tslib.__assign({}, (options.locale && { locale: options.locale })), (options.includeRefs && { includeRefs: options.includeRefs })), (options.enrich && { enrich: options.enrich }));
|
|
1812
|
+
}
|
|
1813
|
+
if (overrides) {
|
|
1814
|
+
this.overrides = overrides;
|
|
1815
|
+
}
|
|
1816
|
+
if (validEnvList.indexOf(env || api) > -1) {
|
|
1817
|
+
this.env = env || api;
|
|
1818
|
+
}
|
|
1819
|
+
if (Builder.isEditing) {
|
|
1820
|
+
var editingModel = frameEditing || editing || preview;
|
|
1821
|
+
if (editingModel && editingModel !== 'true') {
|
|
1822
|
+
this.editingModel = editingModel;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
if (cachebust) {
|
|
1826
|
+
this.cachebust = true;
|
|
1827
|
+
}
|
|
1828
|
+
if (noCache) {
|
|
1829
|
+
this.noCache = true;
|
|
1830
|
+
}
|
|
1831
|
+
if (preview) {
|
|
1832
|
+
this.preview = true;
|
|
1833
|
+
}
|
|
1834
|
+
if (params) {
|
|
1835
|
+
this.overrideParams = overrideParams;
|
|
1817
1836
|
}
|
|
1818
1837
|
}
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
if (noCache) {
|
|
1823
|
-
this.noCache = true;
|
|
1824
|
-
}
|
|
1825
|
-
if (preview) {
|
|
1826
|
-
this.preview = true;
|
|
1827
|
-
}
|
|
1828
|
-
if (params) {
|
|
1829
|
-
this.overrideParams = overrideParams;
|
|
1830
|
-
}
|
|
1838
|
+
}
|
|
1839
|
+
catch (e) {
|
|
1840
|
+
console.debug('Error parsing overrides from URL', e);
|
|
1831
1841
|
}
|
|
1832
1842
|
};
|
|
1833
1843
|
Builder.prototype.messageFrameLoaded = function () {
|
|
@@ -2344,7 +2354,7 @@ var Builder = /** @class */ (function () {
|
|
|
2344
2354
|
}
|
|
2345
2355
|
// TODO: merge in the attribute from query string ones
|
|
2346
2356
|
// TODO: make this an option per component/request
|
|
2347
|
-
queryParams.userAttributes =
|
|
2357
|
+
queryParams.userAttributes = userAttributes;
|
|
2348
2358
|
if (!usePastQueue && !useQueue) {
|
|
2349
2359
|
this.priorContentQueue = queue;
|
|
2350
2360
|
this.getContentQueue = null;
|