@builder.io/sdk 2.0.4 → 2.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/CHANGELOG.md +3 -0
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.js +14 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +14 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +14 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/package.json +3 -3
- package/dist/src/builder.class.d.ts +11 -0
- package/dist/src/builder.class.js +13 -2
- package/dist/src/builder.class.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/coverage/clover.xml +0 -155
- package/coverage/coverage-final.json +0 -3
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/classes/index.html +0 -116
- package/coverage/lcov-report/src/classes/query-string.class.ts.html +0 -328
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/url.ts.html +0 -253
- package/coverage/lcov.info +0 -238
package/dist/index.esm.js
CHANGED
|
@@ -123,7 +123,7 @@ function assertAllowedPropertyName(name) {
|
|
|
123
123
|
throw new Error("Property name \"".concat(name, "\" is not allowed"));
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
var version = "2.0.
|
|
126
|
+
var version = "2.0.5-0";
|
|
127
127
|
|
|
128
128
|
var Subscription = /** @class */ (function () {
|
|
129
129
|
function Subscription(listeners, listener) {
|
|
@@ -1265,6 +1265,17 @@ var Builder = /** @class */ (function () {
|
|
|
1265
1265
|
Builder.registerTrustedHost = function (host) {
|
|
1266
1266
|
this.trustedHosts.push(host);
|
|
1267
1267
|
};
|
|
1268
|
+
/**
|
|
1269
|
+
* @param context @type {import('isolated-vm').Context}
|
|
1270
|
+
* Use this function to control the execution context of custom code on the server.
|
|
1271
|
+
* const ivm = require('isolated-vm');
|
|
1272
|
+
* const isolate = new ivm.Isolate({ memoryLimit: 128 });
|
|
1273
|
+
* const context = isolate.createContextSync();
|
|
1274
|
+
* Builder.setServerContext(context);
|
|
1275
|
+
*/
|
|
1276
|
+
Builder.setServerContext = function (context) {
|
|
1277
|
+
this.serverContext = context;
|
|
1278
|
+
};
|
|
1268
1279
|
Builder.isTrustedHost = function (hostname) {
|
|
1269
1280
|
return (this.trustedHosts.findIndex(function (trustedHost) { return trustedHost === hostname || hostname.endsWith(".".concat(trustedHost)); }) > -1);
|
|
1270
1281
|
};
|
|
@@ -2224,7 +2235,7 @@ var Builder = /** @class */ (function () {
|
|
|
2224
2235
|
// even though we only use `fetch()` now, we prefer to keep the old behavior and use the `fetch` that comes from
|
|
2225
2236
|
// the core SDK for consistency
|
|
2226
2237
|
Builder.prototype.requestUrl = function (url, options) {
|
|
2227
|
-
return getFetch()(url, options).then(function (res) { return res.json(); });
|
|
2238
|
+
return getFetch()(url, __assign({ next: __assign({ revalidate: 1 }, options === null || options === void 0 ? void 0 : options.next) }, options)).then(function (res) { return res.json(); });
|
|
2228
2239
|
};
|
|
2229
2240
|
Object.defineProperty(Builder.prototype, "host", {
|
|
2230
2241
|
get: function () {
|
|
@@ -2389,7 +2400,7 @@ var Builder = /** @class */ (function () {
|
|
|
2389
2400
|
}
|
|
2390
2401
|
var queryStr = QueryString.stringifyDeep(queryParams);
|
|
2391
2402
|
var format = queryParams.format;
|
|
2392
|
-
var requestOptions = { headers: {} };
|
|
2403
|
+
var requestOptions = { headers: {}, next: { revalidate: 1 } };
|
|
2393
2404
|
if (this.authToken) {
|
|
2394
2405
|
requestOptions.headers = __assign(__assign({}, requestOptions.headers), { Authorization: "Bearer ".concat(this.authToken) });
|
|
2395
2406
|
}
|