@builder.io/sdk 1.2.0 → 1.3.1-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.
Files changed (74) hide show
  1. package/.yarnrc.yml +1 -0
  2. package/CHANGELOG.md +4 -1
  3. package/README.md +5 -3
  4. package/coverage/clover.xml +3848 -0
  5. package/coverage/coverage-final.json +19 -0
  6. package/coverage/lcov-report/base.css +224 -0
  7. package/coverage/lcov-report/block-navigation.js +87 -0
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +176 -0
  10. package/coverage/lcov-report/prettify.css +1 -0
  11. package/coverage/lcov-report/prettify.js +2 -0
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +196 -0
  14. package/coverage/lcov-report/src/builder.class.ts.html +8107 -0
  15. package/coverage/lcov-report/src/classes/animator.class.ts.html +847 -0
  16. package/coverage/lcov-report/src/classes/cookies.class.ts.html +559 -0
  17. package/coverage/lcov-report/src/classes/index.html +176 -0
  18. package/coverage/lcov-report/src/classes/observable.class.ts.html +388 -0
  19. package/coverage/lcov-report/src/classes/promise.class.ts.html +607 -0
  20. package/coverage/lcov-report/src/classes/query-string.class.ts.html +328 -0
  21. package/coverage/lcov-report/src/functions/assign.function.ts.html +139 -0
  22. package/coverage/lcov-report/src/functions/fetch.function.ts.html +427 -0
  23. package/coverage/lcov-report/src/functions/get-top-level-domain.ts.html +121 -0
  24. package/coverage/lcov-report/src/functions/index.html +236 -0
  25. package/coverage/lcov-report/src/functions/next-tick.function.ts.html +184 -0
  26. package/coverage/lcov-report/src/functions/omit.function.ts.html +106 -0
  27. package/coverage/lcov-report/src/functions/server-only-require.function.ts.html +121 -0
  28. package/coverage/lcov-report/src/functions/throttle.function.ts.html +181 -0
  29. package/coverage/lcov-report/src/functions/to-error.ts.html +133 -0
  30. package/coverage/lcov-report/src/functions/uuid.ts.html +136 -0
  31. package/coverage/lcov-report/src/index.html +131 -0
  32. package/coverage/lcov-report/src/polyfills/custom-event-polyfill.js.html +121 -0
  33. package/coverage/lcov-report/src/polyfills/index.html +116 -0
  34. package/coverage/lcov-report/src/types/api-version.ts.html +91 -0
  35. package/coverage/lcov-report/src/types/index.html +116 -0
  36. package/coverage/lcov-report/src/url.ts.html +253 -0
  37. package/coverage/lcov.info +4317 -0
  38. package/dist/index.browser.js +1 -1
  39. package/dist/index.browser.js.map +1 -1
  40. package/dist/index.cjs.js +15 -5
  41. package/dist/index.cjs.js.map +1 -1
  42. package/dist/index.d.ts +7 -7
  43. package/dist/index.esm.js +15 -5
  44. package/dist/index.esm.js.map +1 -1
  45. package/dist/index.umd.js +15 -5
  46. package/dist/index.umd.js.map +1 -1
  47. package/dist/package.json +3 -7
  48. package/dist/src/builder.class.d.ts +1 -0
  49. package/dist/src/builder.class.js +13 -3
  50. package/dist/src/builder.class.js.map +1 -1
  51. package/dist/src/builder.class.test.d.ts +1 -0
  52. package/dist/src/builder.class.test.js +23 -0
  53. package/dist/src/builder.class.test.js.map +1 -0
  54. package/dist/src/classes/animator.class.d.ts +26 -26
  55. package/dist/src/classes/promise.class.d.ts +17 -17
  56. package/dist/src/classes/query-string.class.d.ts +9 -9
  57. package/dist/src/classes/query-string.class.test.d.ts +1 -1
  58. package/dist/src/constants/builder.d.ts +2 -2
  59. package/dist/src/functions/assign.function.d.ts +1 -1
  60. package/dist/src/functions/fetch.function.d.ts +28 -28
  61. package/dist/src/functions/finder.function.d.ts +10 -10
  62. package/dist/src/functions/get-top-level-domain.d.ts +6 -6
  63. package/dist/src/functions/omit.function.d.ts +1 -1
  64. package/dist/src/functions/throttle.function.d.ts +1 -1
  65. package/dist/src/functions/to-error.d.ts +13 -13
  66. package/dist/src/functions/uuid.d.ts +8 -8
  67. package/dist/src/types/api-version.d.ts +2 -2
  68. package/dist/src/types/api-version.js +1 -1
  69. package/dist/src/types/content.d.ts +31 -31
  70. package/dist/src/types/element.d.ts +60 -60
  71. package/dist/src/url.test.d.ts +1 -1
  72. package/dist/tsconfig.tsbuildinfo +1 -1
  73. package/jest.config.ts +1 -3
  74. package/package.json +4 -8
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 = "1.1.35";
132
+ var version = "1.3.1-0";
133
133
 
134
134
  var Subscription = /** @class */ (function () {
135
135
  function Subscription(listeners, listener) {
@@ -969,7 +969,7 @@ function toError(err) {
969
969
  return new Error(String(err));
970
970
  }
971
971
 
972
- var DEFAULT_API_VERSION = 'v3';
972
+ var DEFAULT_API_VERSION = 'v1';
973
973
 
974
974
  function datePlusMinutes(minutes) {
975
975
  if (minutes === void 0) { minutes = 30; }
@@ -1272,7 +1272,11 @@ var Builder = /** @class */ (function () {
1272
1272
  this.trustedHosts.push(host);
1273
1273
  };
1274
1274
  Builder.isTrustedHost = function (hostname) {
1275
- return (this.trustedHosts.findIndex(function (trustedHost) { return trustedHost === hostname || hostname.endsWith(".".concat(trustedHost)); }) > -1);
1275
+ return (this.trustedHosts.findIndex(function (trustedHost) {
1276
+ return trustedHost.startsWith('*.')
1277
+ ? hostname.endsWith(trustedHost.slice(1))
1278
+ : trustedHost === hostname;
1279
+ }) > -1);
1276
1280
  };
1277
1281
  Builder.runAction = function (action) {
1278
1282
  // TODO
@@ -2534,7 +2538,7 @@ var Builder = /** @class */ (function () {
2534
2538
  if (options === void 0) { options = {}; }
2535
2539
  var instance = this;
2536
2540
  if (!Builder.isBrowser) {
2537
- instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false, null, options.apiVersion);
2541
+ instance = new Builder(options.apiKey || this.apiKey, options.req, options.res, false, null, options.apiVersion || this.apiVersion);
2538
2542
  instance.setUserAttributes(this.getUserAttributes());
2539
2543
  }
2540
2544
  else {
@@ -2574,7 +2578,13 @@ var Builder = /** @class */ (function () {
2574
2578
  Builder.nextTick = nextTick;
2575
2579
  Builder.throttle = throttle;
2576
2580
  Builder.editors = [];
2577
- Builder.trustedHosts = ['builder.io', 'localhost'];
2581
+ Builder.trustedHosts = [
2582
+ '*.beta.builder.io',
2583
+ 'beta.builder.io',
2584
+ 'builder.io',
2585
+ 'localhost',
2586
+ 'qa.builder.io',
2587
+ ];
2578
2588
  Builder.plugins = [];
2579
2589
  Builder.actions = [];
2580
2590
  Builder.registry = {};