@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/dist/index.cjs.js CHANGED
@@ -126,7 +126,7 @@ function assertAllowedPropertyName(name) {
126
126
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
127
127
  }
128
128
 
129
- var version = "2.0.7";
129
+ var version = "2.1.0";
130
130
 
131
131
  var Subscription = /** @class */ (function () {
132
132
  function Subscription(listeners, listener) {
@@ -2304,9 +2304,12 @@ var Builder = /** @class */ (function () {
2304
2304
  if (queue[0].format) {
2305
2305
  queryParams.format = queue[0].format;
2306
2306
  }
2307
+ if ('noTraverse' in queue[0]) {
2308
+ queryParams.noTraverse = queue[0].noTraverse;
2309
+ }
2307
2310
  var pageQueryParams = typeof location !== 'undefined'
2308
2311
  ? QueryString.parseDeep(location.search.substr(1))
2309
- : {};
2312
+ : {}; // TODO: WHAT about SSR (this.request) ?
2310
2313
  var userAttributes =
2311
2314
  // FIXME: HACK: only checks first in queue for user attributes overrides, should check all
2312
2315
  // TODO: merge user attributes provided here with defaults and current user attiributes (?)
@@ -2545,7 +2548,7 @@ var Builder = /** @class */ (function () {
2545
2548
  if (options === void 0) { options = {}; }
2546
2549
  var instance = this;
2547
2550
  if (!Builder.isBrowser) {
2548
- instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false, null, options.apiVersion || this.apiVersion);
2551
+ instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false, options.authToken || this.authToken, options.apiVersion || this.apiVersion);
2549
2552
  instance.setUserAttributes(this.getUserAttributes());
2550
2553
  }
2551
2554
  else {
@@ -2554,10 +2557,17 @@ var Builder = /** @class */ (function () {
2554
2557
  if (options.apiKey && !this.apiKey) {
2555
2558
  this.apiKey = options.apiKey;
2556
2559
  }
2560
+ if (options.authToken && !this.authToken) {
2561
+ this.authToken = options.authToken;
2562
+ }
2557
2563
  if (options.apiVersion && !this.apiVersion) {
2558
2564
  this.apiVersion = options.apiVersion;
2559
2565
  }
2560
2566
  }
2567
+ // Set noTraverse=true if NOT already passed by user, for query performance
2568
+ if (!('noTraverse' in options)) {
2569
+ options.noTraverse = true;
2570
+ }
2561
2571
  return instance
2562
2572
  .getContent(modelName, tslib.__assign(tslib.__assign({ limit: 30 }, options), { key: options.key ||
2563
2573
  // Make the key include all options, so we don't reuse cache for the same content fetched