@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.esm.js CHANGED
@@ -950,7 +950,7 @@ function toError(err) {
950
950
 
951
951
  var DEFAULT_API_VERSION = 'v3';
952
952
 
953
- var SDK_VERSION = '6.0.3';
953
+ var SDK_VERSION = '6.0.5';
954
954
 
955
955
  function datePlusMinutes(minutes) {
956
956
  if (minutes === void 0) { minutes = 30; }
@@ -1105,6 +1105,7 @@ var Builder = /** @class */ (function () {
1105
1105
  this.apiEndpoint$ = new BehaviorSubject('query');
1106
1106
  this.apiVersion$ = new BehaviorSubject(undefined);
1107
1107
  this.canTrack$ = new BehaviorSubject(!this.browserTrackingDisabled);
1108
+ this.hasOverriddenCanTrack = false;
1108
1109
  this.apiKey$ = new BehaviorSubject(null);
1109
1110
  this.authToken$ = new BehaviorSubject(null);
1110
1111
  this.userAttributesChanged = new BehaviorSubject(null);
@@ -1476,6 +1477,7 @@ var Builder = /** @class */ (function () {
1476
1477
  return this.canTrack$.value;
1477
1478
  },
1478
1479
  set: function (canTrack) {
1480
+ this.hasOverriddenCanTrack = true;
1479
1481
  if (this.canTrack !== canTrack) {
1480
1482
  this.canTrack$.next(canTrack);
1481
1483
  }
@@ -2051,7 +2053,9 @@ var Builder = /** @class */ (function () {
2051
2053
  if (res) {
2052
2054
  this.response = res;
2053
2055
  }
2054
- this.canTrack = canTrack;
2056
+ if (!this.hasOverriddenCanTrack) {
2057
+ this.canTrack = canTrack;
2058
+ }
2055
2059
  this.apiKey = apiKey;
2056
2060
  if (authToken) {
2057
2061
  this.authToken = authToken;
@@ -2338,7 +2342,7 @@ var Builder = /** @class */ (function () {
2338
2342
  };
2339
2343
  Builder.prototype.flushGetContentQueue = function (usePastQueue, useQueue) {
2340
2344
  var _this = this;
2341
- var _a;
2345
+ var _a, _b;
2342
2346
  if (usePastQueue === void 0) { usePastQueue = false; }
2343
2347
  if (!this.apiKey) {
2344
2348
  throw new Error("Fetching content failed, expected apiKey to be defined instead got: ".concat(this.apiKey));
@@ -2359,7 +2363,7 @@ var Builder = /** @class */ (function () {
2359
2363
  this.getOverridesFromQueryString();
2360
2364
  var queryParams = __assign(__assign({
2361
2365
  // TODO: way to force a request to be in a separate queue. or just lower queue limit to be 1 by default
2362
- omit: queue[0].omit || 'meta.componentsUsed', apiKey: this.apiKey }, queue[0].options), this.queryOptions);
2366
+ omit: (_a = queue[0].omit) !== null && _a !== void 0 ? _a : 'meta.componentsUsed', apiKey: this.apiKey }, queue[0].options), this.queryOptions);
2363
2367
  if (queue[0].locale) {
2364
2368
  queryParams.locale = queue[0].locale;
2365
2369
  }
@@ -2464,8 +2468,8 @@ var Builder = /** @class */ (function () {
2464
2468
  'static',
2465
2469
  'includeRefs',
2466
2470
  ];
2467
- for (var _b = 0, properties_1 = properties; _b < properties_1.length; _b++) {
2468
- var key = properties_1[_b];
2471
+ for (var _c = 0, properties_1 = properties; _c < properties_1.length; _c++) {
2472
+ var key = properties_1[_c];
2469
2473
  var value = options[key];
2470
2474
  if (value !== undefined) {
2471
2475
  if (this.apiEndpoint === 'query') {
@@ -2479,7 +2483,7 @@ var Builder = /** @class */ (function () {
2479
2483
  }
2480
2484
  }
2481
2485
  }
2482
- if (this.preview && this.previewingModel === ((_a = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _a === void 0 ? void 0 : _a.model)) {
2486
+ if (this.preview && this.previewingModel === ((_b = queue === null || queue === void 0 ? void 0 : queue[0]) === null || _b === void 0 ? void 0 : _b.model)) {
2483
2487
  queryParams.preview = 'true';
2484
2488
  }
2485
2489
  var hasParams = Object.keys(queryParams).length > 0;