@builder.io/sdk 3.0.3 → 3.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 CHANGED
@@ -1,5 +1,33 @@
1
1
  # @builder.io/sdk
2
2
 
3
+ ## 3.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 2ae3cc5: Feature: add `fetchOptions` to `options` argument within `.get(modelName, options)` and `.getAll(modelName, options)`, which is passed to the `fetch` function.
8
+
9
+ ## 3.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 49d0aa3: [Types]: adds a second argument to the `onChange` argument for custom component Inputs called `previousOptions`. It contains the `options` argument in its old state before the current `onChange` event was triggered.
14
+
15
+ Before:
16
+
17
+ ```ts
18
+ onChange?:
19
+ | ((options: Map<string, any>) => void | Promise<void>)
20
+ | string;
21
+ ```
22
+
23
+ After:
24
+
25
+ ```ts
26
+ onChange?:
27
+ | ((options: Map<string, any>, previousOptions?: Map<string, any>) => void | Promise<void>)
28
+ | string;
29
+ ```
30
+
3
31
  ## 3.0.3
4
32
 
5
33
  ### Patch Changes
@@ -152,7 +152,7 @@
152
152
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
153
153
  }
154
154
 
155
- var version = "3.0.3";
155
+ var version = "3.0.5";
156
156
 
157
157
  var Subscription = /** @class */ (function () {
158
158
  function Subscription(listeners, listener) {
@@ -2556,9 +2556,9 @@
2556
2556
  }
2557
2557
  }
2558
2558
  var queryStr = QueryString.stringifyDeep(queryParams);
2559
- var requestOptions = { headers: {} };
2559
+ var fetchOptions = __assign({ headers: {} }, queue[0].fetchOptions);
2560
2560
  if (this.authToken) {
2561
- requestOptions.headers = __assign(__assign({}, requestOptions.headers), { Authorization: "Bearer ".concat(this.authToken) });
2561
+ fetchOptions.headers = __assign(__assign({}, fetchOptions.headers), { Authorization: "Bearer ".concat(this.authToken) });
2562
2562
  }
2563
2563
  var url;
2564
2564
  if (isApiCallForCodegen) {
@@ -2571,7 +2571,7 @@
2571
2571
  url = "".concat(host, "/api/v3/content/").concat(queue[0].model);
2572
2572
  }
2573
2573
  url = url + (queryParams && hasParams ? "?".concat(queryStr) : '');
2574
- var promise = this.makeFetchApiCall(url, requestOptions)
2574
+ var promise = this.makeFetchApiCall(url, fetchOptions)
2575
2575
  .then(function (res) { return res.json(); })
2576
2576
  .then(function (result) {
2577
2577
  for (var _i = 0, queue_3 = queue; _i < queue_3.length; _i++) {