@builder.io/sdk 2.0.5-0 → 2.0.6

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
@@ -129,7 +129,7 @@ function assertAllowedPropertyName(name) {
129
129
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
130
130
  }
131
131
 
132
- var version = "2.0.4";
132
+ var version = "2.0.5";
133
133
 
134
134
  var Subscription = /** @class */ (function () {
135
135
  function Subscription(listeners, listener) {
@@ -166,9 +166,18 @@ var Subscription = /** @class */ (function () {
166
166
  // TODO: follow minimal basic spec: https://github.com/tc39/proposal-observable
167
167
  var BehaviorSubject = /** @class */ (function () {
168
168
  function BehaviorSubject(value) {
169
+ var _this = this;
169
170
  this.value = value;
170
171
  this.listeners = [];
171
172
  this.errorListeners = [];
173
+ this.then = function () {
174
+ var _a;
175
+ var args = [];
176
+ for (var _i = 0; _i < arguments.length; _i++) {
177
+ args[_i] = arguments[_i];
178
+ }
179
+ return (_a = _this.toPromise()).then.apply(_a, args);
180
+ };
172
181
  }
173
182
  BehaviorSubject.prototype.next = function (value) {
174
183
  this.value = value;
@@ -2241,7 +2250,7 @@ var Builder = /** @class */ (function () {
2241
2250
  // even though we only use `fetch()` now, we prefer to keep the old behavior and use the `fetch` that comes from
2242
2251
  // the core SDK for consistency
2243
2252
  Builder.prototype.requestUrl = function (url, options) {
2244
- return getFetch()(url, options).then(function (res) { return res.json(); });
2253
+ return getFetch()(url, tslib.__assign({ next: tslib.__assign({ revalidate: 1 }, options === null || options === void 0 ? void 0 : options.next) }, options)).then(function (res) { return res.json(); });
2245
2254
  };
2246
2255
  Object.defineProperty(Builder.prototype, "host", {
2247
2256
  get: function () {
@@ -2406,7 +2415,7 @@ var Builder = /** @class */ (function () {
2406
2415
  }
2407
2416
  var queryStr = QueryString.stringifyDeep(queryParams);
2408
2417
  var format = queryParams.format;
2409
- var requestOptions = { headers: {} };
2418
+ var requestOptions = { headers: {}, next: { revalidate: 1 } };
2410
2419
  if (this.authToken) {
2411
2420
  requestOptions.headers = tslib.__assign(tslib.__assign({}, requestOptions.headers), { Authorization: "Bearer ".concat(this.authToken) });
2412
2421
  }