@builder.io/sdk 6.0.3 → 6.0.5

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
@@ -958,7 +958,7 @@ function toError(err) {
958
958
 
959
959
  var DEFAULT_API_VERSION = 'v3';
960
960
 
961
- var SDK_VERSION = '6.0.3';
961
+ var SDK_VERSION = '6.0.5';
962
962
 
963
963
  function datePlusMinutes(minutes) {
964
964
  if (minutes === void 0) { minutes = 30; }
@@ -1113,6 +1113,7 @@ var Builder = /** @class */ (function () {
1113
1113
  this.apiEndpoint$ = new BehaviorSubject('query');
1114
1114
  this.apiVersion$ = new BehaviorSubject(undefined);
1115
1115
  this.canTrack$ = new BehaviorSubject(!this.browserTrackingDisabled);
1116
+ this.hasOverriddenCanTrack = false;
1116
1117
  this.apiKey$ = new BehaviorSubject(null);
1117
1118
  this.authToken$ = new BehaviorSubject(null);
1118
1119
  this.userAttributesChanged = new BehaviorSubject(null);
@@ -1484,6 +1485,7 @@ var Builder = /** @class */ (function () {
1484
1485
  return this.canTrack$.value;
1485
1486
  },
1486
1487
  set: function (canTrack) {
1488
+ this.hasOverriddenCanTrack = true;
1487
1489
  if (this.canTrack !== canTrack) {
1488
1490
  this.canTrack$.next(canTrack);
1489
1491
  }
@@ -2059,7 +2061,9 @@ var Builder = /** @class */ (function () {
2059
2061
  if (res) {
2060
2062
  this.response = res;
2061
2063
  }
2062
- this.canTrack = canTrack;
2064
+ if (!this.hasOverriddenCanTrack) {
2065
+ this.canTrack = canTrack;
2066
+ }
2063
2067
  this.apiKey = apiKey;
2064
2068
  if (authToken) {
2065
2069
  this.authToken = authToken;
@@ -2346,7 +2350,7 @@ var Builder = /** @class */ (function () {
2346
2350
  };
2347
2351
  Builder.prototype.flushGetContentQueue = function (usePastQueue, useQueue) {
2348
2352
  var _this = this;
2349
- var _a;
2353
+ var _a, _b;
2350
2354
  if (usePastQueue === void 0) { usePastQueue = false; }
2351
2355
  if (!this.apiKey) {
2352
2356
  throw new Error("Fetching content failed, expected apiKey to be defined instead got: ".concat(this.apiKey));
@@ -2367,7 +2371,7 @@ var Builder = /** @class */ (function () {
2367
2371
  this.getOverridesFromQueryString();
2368
2372
  var queryParams = tslib.__assign(tslib.__assign({
2369
2373
  // TODO: way to force a request to be in a separate queue. or just lower queue limit to be 1 by default
2370
- omit: queue[0].omit || 'meta.componentsUsed', apiKey: this.apiKey }, queue[0].options), this.queryOptions);
2374
+ omit: (_a = queue[0].omit) !== null && _a !== void 0 ? _a : 'meta.componentsUsed', apiKey: this.apiKey }, queue[0].options), this.queryOptions);
2371
2375
  if (queue[0].locale) {
2372
2376
  queryParams.locale = queue[0].locale;
2373
2377
  }
@@ -2472,8 +2476,8 @@ var Builder = /** @class */ (function () {
2472
2476
  'static',
2473
2477
  'includeRefs',
2474
2478
  ];
2475
- for (var _b = 0, properties_1 = properties; _b < properties_1.length; _b++) {
2476
- var key = properties_1[_b];
2479
+ for (var _c = 0, properties_1 = properties; _c < properties_1.length; _c++) {
2480
+ var key = properties_1[_c];
2477
2481
  var value = options[key];
2478
2482
  if (value !== undefined) {
2479
2483
  if (this.apiEndpoint === 'query') {
@@ -2487,7 +2491,7 @@ var Builder = /** @class */ (function () {
2487
2491
  }
2488
2492
  }
2489
2493
  }
2490
- if (this.preview && this.previewingModel === ((_a = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _a === void 0 ? void 0 : _a.model)) {
2494
+ if (this.preview && this.previewingModel === ((_b = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _b === void 0 ? void 0 : _b.model)) {
2491
2495
  queryParams.preview = 'true';
2492
2496
  }
2493
2497
  var hasParams = Object.keys(queryParams).length > 0;