@builder.io/sdk 2.0.8 → 2.1.1-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/CHANGELOG.md +4 -0
- package/dist/index.browser.js +13 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +13 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +13 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +13 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/builder.class.d.ts +7 -0
- package/dist/src/builder.class.js +12 -2
- package/dist/src/builder.class.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
package/dist/index.esm.js
CHANGED
|
@@ -118,7 +118,7 @@ function assertAllowedPropertyName(name) {
|
|
|
118
118
|
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
var version = "2.0
|
|
121
|
+
var version = "2.1.0";
|
|
122
122
|
|
|
123
123
|
var Subscription = /** @class */ (function () {
|
|
124
124
|
function Subscription(listeners, listener) {
|
|
@@ -2296,9 +2296,12 @@ var Builder = /** @class */ (function () {
|
|
|
2296
2296
|
if (queue[0].format) {
|
|
2297
2297
|
queryParams.format = queue[0].format;
|
|
2298
2298
|
}
|
|
2299
|
+
if ('noTraverse' in queue[0]) {
|
|
2300
|
+
queryParams.noTraverse = queue[0].noTraverse;
|
|
2301
|
+
}
|
|
2299
2302
|
var pageQueryParams = typeof location !== 'undefined'
|
|
2300
2303
|
? QueryString.parseDeep(location.search.substr(1))
|
|
2301
|
-
: {};
|
|
2304
|
+
: {}; // TODO: WHAT about SSR (this.request) ?
|
|
2302
2305
|
var userAttributes =
|
|
2303
2306
|
// FIXME: HACK: only checks first in queue for user attributes overrides, should check all
|
|
2304
2307
|
// TODO: merge user attributes provided here with defaults and current user attiributes (?)
|
|
@@ -2537,7 +2540,7 @@ var Builder = /** @class */ (function () {
|
|
|
2537
2540
|
if (options === void 0) { options = {}; }
|
|
2538
2541
|
var instance = this;
|
|
2539
2542
|
if (!Builder.isBrowser) {
|
|
2540
|
-
instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false,
|
|
2543
|
+
instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false, options.authToken || this.authToken, options.apiVersion || this.apiVersion);
|
|
2541
2544
|
instance.setUserAttributes(this.getUserAttributes());
|
|
2542
2545
|
}
|
|
2543
2546
|
else {
|
|
@@ -2546,10 +2549,17 @@ var Builder = /** @class */ (function () {
|
|
|
2546
2549
|
if (options.apiKey && !this.apiKey) {
|
|
2547
2550
|
this.apiKey = options.apiKey;
|
|
2548
2551
|
}
|
|
2552
|
+
if (options.authToken && !this.authToken) {
|
|
2553
|
+
this.authToken = options.authToken;
|
|
2554
|
+
}
|
|
2549
2555
|
if (options.apiVersion && !this.apiVersion) {
|
|
2550
2556
|
this.apiVersion = options.apiVersion;
|
|
2551
2557
|
}
|
|
2552
2558
|
}
|
|
2559
|
+
// Set noTraverse=true if NOT already passed by user, for query performance
|
|
2560
|
+
if (!('noTraverse' in options)) {
|
|
2561
|
+
options.noTraverse = true;
|
|
2562
|
+
}
|
|
2553
2563
|
return instance
|
|
2554
2564
|
.getContent(modelName, __assign(__assign({ limit: 30 }, options), { key: options.key ||
|
|
2555
2565
|
// Make the key include all options, so we don't reuse cache for the same content fetched
|