@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.umd.js CHANGED
@@ -152,7 +152,7 @@
152
152
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
153
153
  }
154
154
 
155
- var version = "2.0.7";
155
+ var version = "2.1.0";
156
156
 
157
157
  var Subscription = /** @class */ (function () {
158
158
  function Subscription(listeners, listener) {
@@ -2398,9 +2398,12 @@
2398
2398
  if (queue[0].format) {
2399
2399
  queryParams.format = queue[0].format;
2400
2400
  }
2401
+ if ('noTraverse' in queue[0]) {
2402
+ queryParams.noTraverse = queue[0].noTraverse;
2403
+ }
2401
2404
  var pageQueryParams = typeof location !== 'undefined'
2402
2405
  ? QueryString.parseDeep(location.search.substr(1))
2403
- : {};
2406
+ : {}; // TODO: WHAT about SSR (this.request) ?
2404
2407
  var userAttributes =
2405
2408
  // FIXME: HACK: only checks first in queue for user attributes overrides, should check all
2406
2409
  // TODO: merge user attributes provided here with defaults and current user attiributes (?)
@@ -2639,7 +2642,7 @@
2639
2642
  if (options === void 0) { options = {}; }
2640
2643
  var instance = this;
2641
2644
  if (!Builder.isBrowser) {
2642
- instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false, null, options.apiVersion || this.apiVersion);
2645
+ instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false, options.authToken || this.authToken, options.apiVersion || this.apiVersion);
2643
2646
  instance.setUserAttributes(this.getUserAttributes());
2644
2647
  }
2645
2648
  else {
@@ -2648,10 +2651,17 @@
2648
2651
  if (options.apiKey && !this.apiKey) {
2649
2652
  this.apiKey = options.apiKey;
2650
2653
  }
2654
+ if (options.authToken && !this.authToken) {
2655
+ this.authToken = options.authToken;
2656
+ }
2651
2657
  if (options.apiVersion && !this.apiVersion) {
2652
2658
  this.apiVersion = options.apiVersion;
2653
2659
  }
2654
2660
  }
2661
+ // Set noTraverse=true if NOT already passed by user, for query performance
2662
+ if (!('noTraverse' in options)) {
2663
+ options.noTraverse = true;
2664
+ }
2655
2665
  return instance
2656
2666
  .getContent(modelName, __assign(__assign({ limit: 30 }, options), { key: options.key ||
2657
2667
  // Make the key include all options, so we don't reuse cache for the same content fetched