@bytescale/sdk 3.4.4 → 3.6.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.
@@ -563,8 +563,8 @@ var BaseAPI = /*#__PURE__*/function () {
563
563
  }
564
564
  var configHeaders = _this4.config.headers;
565
565
  var _Object$assign3 = Object.assign({}, context.headers);
566
- return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
567
- var headers = Object.assign(_Object$assign3, _configHeaders);
566
+ return runtime_await(configHeaders === undefined ? {} : typeof configHeaders === "function" ? configHeaders() : configHeaders, function (_configHeaders) {
567
+ var headers = Object.assign(_Object$assign3, configHeaders === undefined ? _configHeaders : _configHeaders);
568
568
  Object.keys(headers).forEach(function (key) {
569
569
  return headers[key] === undefined ? delete headers[key] : {};
570
570
  });
@@ -590,7 +590,7 @@ var BaseAPI = /*#__PURE__*/function () {
590
590
  init: init
591
591
  };
592
592
  });
593
- }, configHeaders === undefined);
593
+ }, configHeaders === undefined || !(typeof configHeaders === "function"));
594
594
  } catch (e) {
595
595
  return Promise.reject(e);
596
596
  }
@@ -1004,9 +1004,6 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1004
1004
  if (params.cacheTtl !== undefined) {
1005
1005
  query["cache_ttl"] = params.cacheTtl;
1006
1006
  }
1007
- if (params.large !== undefined) {
1008
- query["large"] = params.large;
1009
- }
1010
1007
  if (params.transformationParams !== undefined) {
1011
1008
  query["transformationParams"] = params.transformationParams;
1012
1009
  }
@@ -1744,7 +1741,7 @@ var UrlBuilder = /*#__PURE__*/function () {
1744
1741
  }, {
1745
1742
  key: "getCommonTransformationQueryParams",
1746
1743
  value: function getCommonTransformationQueryParams(trans) {
1747
- return this.makeQueryParams(["cachePermanently", "large", "artifact"], {
1744
+ return this.makeQueryParams(["cachePermanently", "artifact"], {
1748
1745
  cachePermanently: "cache_perm"
1749
1746
  })(trans);
1750
1747
  }
@@ -548,8 +548,8 @@ var BaseAPI = /*#__PURE__*/function () {
548
548
  }
549
549
  var configHeaders = _this4.config.headers;
550
550
  var _Object$assign3 = Object.assign({}, context.headers);
551
- return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
552
- var headers = Object.assign(_Object$assign3, _configHeaders);
551
+ return runtime_await(configHeaders === undefined ? {} : typeof configHeaders === "function" ? configHeaders() : configHeaders, function (_configHeaders) {
552
+ var headers = Object.assign(_Object$assign3, configHeaders === undefined ? _configHeaders : _configHeaders);
553
553
  Object.keys(headers).forEach(function (key) {
554
554
  return headers[key] === undefined ? delete headers[key] : {};
555
555
  });
@@ -575,7 +575,7 @@ var BaseAPI = /*#__PURE__*/function () {
575
575
  init: init
576
576
  };
577
577
  });
578
- }, configHeaders === undefined);
578
+ }, configHeaders === undefined || !(typeof configHeaders === "function"));
579
579
  } catch (e) {
580
580
  return Promise.reject(e);
581
581
  }
@@ -989,9 +989,6 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
989
989
  if (params.cacheTtl !== undefined) {
990
990
  query["cache_ttl"] = params.cacheTtl;
991
991
  }
992
- if (params.large !== undefined) {
993
- query["large"] = params.large;
994
- }
995
992
  if (params.transformationParams !== undefined) {
996
993
  query["transformationParams"] = params.transformationParams;
997
994
  }
@@ -1729,7 +1726,7 @@ var UrlBuilder = /*#__PURE__*/function () {
1729
1726
  }, {
1730
1727
  key: "getCommonTransformationQueryParams",
1731
1728
  value: function getCommonTransformationQueryParams(trans) {
1732
- return this.makeQueryParams(["cachePermanently", "large", "artifact"], {
1729
+ return this.makeQueryParams(["cachePermanently", "artifact"], {
1733
1730
  cachePermanently: "cache_perm"
1734
1731
  })(trans);
1735
1732
  }
@@ -563,8 +563,8 @@ var BaseAPI = /*#__PURE__*/function () {
563
563
  }
564
564
  var configHeaders = _this4.config.headers;
565
565
  var _Object$assign3 = Object.assign({}, context.headers);
566
- return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
567
- var headers = Object.assign(_Object$assign3, _configHeaders);
566
+ return runtime_await(configHeaders === undefined ? {} : typeof configHeaders === "function" ? configHeaders() : configHeaders, function (_configHeaders) {
567
+ var headers = Object.assign(_Object$assign3, configHeaders === undefined ? _configHeaders : _configHeaders);
568
568
  Object.keys(headers).forEach(function (key) {
569
569
  return headers[key] === undefined ? delete headers[key] : {};
570
570
  });
@@ -590,7 +590,7 @@ var BaseAPI = /*#__PURE__*/function () {
590
590
  init: init
591
591
  };
592
592
  });
593
- }, configHeaders === undefined);
593
+ }, configHeaders === undefined || !(typeof configHeaders === "function"));
594
594
  } catch (e) {
595
595
  return Promise.reject(e);
596
596
  }
@@ -1004,9 +1004,6 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1004
1004
  if (params.cacheTtl !== undefined) {
1005
1005
  query["cache_ttl"] = params.cacheTtl;
1006
1006
  }
1007
- if (params.large !== undefined) {
1008
- query["large"] = params.large;
1009
- }
1010
1007
  if (params.transformationParams !== undefined) {
1011
1008
  query["transformationParams"] = params.transformationParams;
1012
1009
  }
@@ -1744,7 +1741,7 @@ var UrlBuilder = /*#__PURE__*/function () {
1744
1741
  }, {
1745
1742
  key: "getCommonTransformationQueryParams",
1746
1743
  value: function getCommonTransformationQueryParams(trans) {
1747
- return this.makeQueryParams(["cachePermanently", "large", "artifact"], {
1744
+ return this.makeQueryParams(["cachePermanently", "artifact"], {
1748
1745
  cachePermanently: "cache_perm"
1749
1746
  })(trans);
1750
1747
  }
@@ -550,8 +550,8 @@ var BaseAPI = /*#__PURE__*/function () {
550
550
  }
551
551
  var configHeaders = _this4.config.headers;
552
552
  var _Object$assign3 = Object.assign({}, context.headers);
553
- return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
554
- var headers = Object.assign(_Object$assign3, _configHeaders);
553
+ return runtime_await(configHeaders === undefined ? {} : typeof configHeaders === "function" ? configHeaders() : configHeaders, function (_configHeaders) {
554
+ var headers = Object.assign(_Object$assign3, configHeaders === undefined ? _configHeaders : _configHeaders);
555
555
  Object.keys(headers).forEach(function (key) {
556
556
  return headers[key] === undefined ? delete headers[key] : {};
557
557
  });
@@ -577,7 +577,7 @@ var BaseAPI = /*#__PURE__*/function () {
577
577
  init: init
578
578
  };
579
579
  });
580
- }, configHeaders === undefined);
580
+ }, configHeaders === undefined || !(typeof configHeaders === "function"));
581
581
  } catch (e) {
582
582
  return Promise.reject(e);
583
583
  }
@@ -991,9 +991,6 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
991
991
  if (params.cacheTtl !== undefined) {
992
992
  query["cache_ttl"] = params.cacheTtl;
993
993
  }
994
- if (params.large !== undefined) {
995
- query["large"] = params.large;
996
- }
997
994
  if (params.transformationParams !== undefined) {
998
995
  query["transformationParams"] = params.transformationParams;
999
996
  }
@@ -1731,7 +1728,7 @@ var UrlBuilder = /*#__PURE__*/function () {
1731
1728
  }, {
1732
1729
  key: "getCommonTransformationQueryParams",
1733
1730
  value: function getCommonTransformationQueryParams(trans) {
1734
- return this.makeQueryParams(["cachePermanently", "large", "artifact"], {
1731
+ return this.makeQueryParams(["cachePermanently", "artifact"], {
1735
1732
  cachePermanently: "cache_perm"
1736
1733
  })(trans);
1737
1734
  }
@@ -152,16 +152,4 @@ export interface UrlBuilderOptionsTransformation extends UrlBuilderOptionsBase {
152
152
  * Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
153
153
  */
154
154
  cachePermanently?: "auto" | boolean;
155
- /**
156
- * Only set this parameter to `true` if you expect the HTTP response body for the transformation request to be over 6MB.
157
- *
158
- * We recommend leaving this parameter unset (so it defaults to `false`) and controlling the HTTP response body size via transformation parameters. E.g. for Image Processing API requests, you can shrink the HTTP response body by reducing the output image's dimensions and/or quality.
159
- *
160
- * Setting this parameter to `true` will route the request via an alternative CDN path, which allows responses over 6MB, but incurs a ~200ms latency on all CDN edge cache misses for the URL.
161
- *
162
- * Setting this parameter to `false` (default) results in faster routing. If a response over 6MB is returned, the initial response will be a JSON error indicating the response was too large to return. All subsequent requests to the same URL will successfully return the transformed file (forever).
163
- *
164
- * Default: false
165
- */
166
- large?: boolean;
167
155
  }
@@ -104,18 +104,6 @@ export interface ProcessFileParams {
104
104
  * Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
105
105
  */
106
106
  cacheTtl?: number;
107
- /**
108
- * Only set this parameter to `true` if you expect the HTTP response body for the transformation request to be over 6MB.
109
- *
110
- * We recommend leaving this parameter unset (so it defaults to `false`) and controlling the HTTP response body size via transformation parameters. E.g. for Image Processing API requests, you can shrink the HTTP response body by reducing the output image's dimensions and/or quality.
111
- *
112
- * Setting this parameter to `true` will route the request via an alternative CDN path, which allows responses over 6MB, but incurs a ~200ms latency on all CDN edge cache misses for the URL.
113
- *
114
- * Setting this parameter to `false` (default) results in faster routing. If a response over 6MB is returned, the initial response will be a JSON error indicating the response was too large to return. All subsequent requests to the same URL will successfully return the transformed file (forever).
115
- *
116
- * Default: `false`
117
- */
118
- large?: boolean;
119
107
  /**
120
108
  * Parameters to submit to the File Processing API (e.g. the Image Processing API).
121
109
  *
@@ -259,8 +259,6 @@ export interface CopyFolderBatchRequest {
259
259
  }
260
260
  /**
261
261
  * Request body for CopyFolder.
262
- *
263
- * You can use ListFolder to preview the operation: set `dryRun=true` with ```recursive```, ```includeFiles```, ```includeOverriddenStorage``` and ```includeVirtualFolders``` set to match the values you're using here. Leave all other flags unset.
264
262
  * @export
265
263
  * @interface CopyFolderRequest
266
264
  */
@@ -36,7 +36,7 @@ export interface BytescaleApiClientConfig {
36
36
  *
37
37
  * These headers take precedence over any headers automatically added by the SDK (e.g. "Authorization", "Content-Type", etc.).
38
38
  */
39
- headers?: () => Promise<HTTPHeaders>;
39
+ headers?: HTTPHeaders | (() => Promise<HTTPHeaders> | HTTPHeaders);
40
40
  }
41
41
  export declare class BytescaleApiClientConfigUtils {
42
42
  static defaultApiUrl: string;
@@ -563,8 +563,8 @@ var BaseAPI = /*#__PURE__*/function () {
563
563
  }
564
564
  var configHeaders = _this4.config.headers;
565
565
  var _Object$assign3 = Object.assign({}, context.headers);
566
- return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
567
- var headers = Object.assign(_Object$assign3, _configHeaders);
566
+ return runtime_await(configHeaders === undefined ? {} : typeof configHeaders === "function" ? configHeaders() : configHeaders, function (_configHeaders) {
567
+ var headers = Object.assign(_Object$assign3, configHeaders === undefined ? _configHeaders : _configHeaders);
568
568
  Object.keys(headers).forEach(function (key) {
569
569
  return headers[key] === undefined ? delete headers[key] : {};
570
570
  });
@@ -590,7 +590,7 @@ var BaseAPI = /*#__PURE__*/function () {
590
590
  init: init
591
591
  };
592
592
  });
593
- }, configHeaders === undefined);
593
+ }, configHeaders === undefined || !(typeof configHeaders === "function"));
594
594
  } catch (e) {
595
595
  return Promise.reject(e);
596
596
  }
@@ -1004,9 +1004,6 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
1004
1004
  if (params.cacheTtl !== undefined) {
1005
1005
  query["cache_ttl"] = params.cacheTtl;
1006
1006
  }
1007
- if (params.large !== undefined) {
1008
- query["large"] = params.large;
1009
- }
1010
1007
  if (params.transformationParams !== undefined) {
1011
1008
  query["transformationParams"] = params.transformationParams;
1012
1009
  }
@@ -1744,7 +1741,7 @@ var UrlBuilder = /*#__PURE__*/function () {
1744
1741
  }, {
1745
1742
  key: "getCommonTransformationQueryParams",
1746
1743
  value: function getCommonTransformationQueryParams(trans) {
1747
- return this.makeQueryParams(["cachePermanently", "large", "artifact"], {
1744
+ return this.makeQueryParams(["cachePermanently", "artifact"], {
1748
1745
  cachePermanently: "cache_perm"
1749
1746
  })(trans);
1750
1747
  }
@@ -548,8 +548,8 @@ var BaseAPI = /*#__PURE__*/function () {
548
548
  }
549
549
  var configHeaders = _this4.config.headers;
550
550
  var _Object$assign3 = Object.assign({}, context.headers);
551
- return runtime_await(configHeaders === undefined ? {} : configHeaders(), function (_configHeaders) {
552
- var headers = Object.assign(_Object$assign3, _configHeaders);
551
+ return runtime_await(configHeaders === undefined ? {} : typeof configHeaders === "function" ? configHeaders() : configHeaders, function (_configHeaders) {
552
+ var headers = Object.assign(_Object$assign3, configHeaders === undefined ? _configHeaders : _configHeaders);
553
553
  Object.keys(headers).forEach(function (key) {
554
554
  return headers[key] === undefined ? delete headers[key] : {};
555
555
  });
@@ -575,7 +575,7 @@ var BaseAPI = /*#__PURE__*/function () {
575
575
  init: init
576
576
  };
577
577
  });
578
- }, configHeaders === undefined);
578
+ }, configHeaders === undefined || !(typeof configHeaders === "function"));
579
579
  } catch (e) {
580
580
  return Promise.reject(e);
581
581
  }
@@ -989,9 +989,6 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
989
989
  if (params.cacheTtl !== undefined) {
990
990
  query["cache_ttl"] = params.cacheTtl;
991
991
  }
992
- if (params.large !== undefined) {
993
- query["large"] = params.large;
994
- }
995
992
  if (params.transformationParams !== undefined) {
996
993
  query["transformationParams"] = params.transformationParams;
997
994
  }
@@ -1729,7 +1726,7 @@ var UrlBuilder = /*#__PURE__*/function () {
1729
1726
  }, {
1730
1727
  key: "getCommonTransformationQueryParams",
1731
1728
  value: function getCommonTransformationQueryParams(trans) {
1732
- return this.makeQueryParams(["cachePermanently", "large", "artifact"], {
1729
+ return this.makeQueryParams(["cachePermanently", "artifact"], {
1733
1730
  cachePermanently: "cache_perm"
1734
1731
  })(trans);
1735
1732
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytescale/sdk",
3
- "version": "3.4.4",
3
+ "version": "3.6.0",
4
4
  "description": "Bytescale JavaScript SDK",
5
5
  "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)",
6
6
  "license": "MIT",
@@ -57,9 +57,9 @@ describe("UrlBuilder", () => {
57
57
  const actual = UrlBuilder.url({
58
58
  accountId: "1234abc",
59
59
  filePath: "/example.jpg",
60
- options: { transformation: "preset", transformationPreset: "thumbnail", artifact: "/foo", large: false }
60
+ options: { transformation: "preset", transformationPreset: "thumbnail", artifact: "/foo" }
61
61
  });
62
- const expected = "https://upcdn.io/1234abc/thumbnail/example.jpg?large=false&artifact=%2Ffoo";
62
+ const expected = "https://upcdn.io/1234abc/thumbnail/example.jpg?artifact=%2Ffoo";
63
63
  expect(actual).toEqual(expected);
64
64
  });
65
65
 
@@ -117,13 +117,12 @@ describe("UrlBuilder", () => {
117
117
  },
118
118
  cachePermanently: "auto",
119
119
  artifact: "/foo",
120
- large: true,
121
120
  version: "50",
122
121
  auth: true
123
122
  }
124
123
  });
125
124
  const expected =
126
- "https://upcdn.io/1234abc/image/example.jpg?w=42&h=50&auth=true&version=50&cache_perm=auto&large=true&artifact=%2Ffoo";
125
+ "https://upcdn.io/1234abc/image/example.jpg?w=42&h=50&auth=true&version=50&cache_perm=auto&artifact=%2Ffoo";
127
126
  expect(actual).toEqual(expected);
128
127
  });
129
128