@builder.io/sdk 2.0.4 → 2.0.5-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.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.4-0";
126
+ var version = "2.0.4";
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
  };