@bytescale/sdk 3.4.3 โ†’ 3.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/README.md CHANGED
@@ -351,12 +351,61 @@ folderApi
351
351
  );
352
352
  ```
353
353
 
354
- ## More Operations
354
+ ## ๐Ÿ“™ Bytescale SDK API Reference
355
355
 
356
356
  For a complete list of operations, please see:
357
357
 
358
358
  **[Bytescale JavaScript SDK Docs ยป](https://www.bytescale.com/docs/sdks/javascript)**
359
359
 
360
+ ## ๐ŸŒ Media Processing APIs (Image/Video/Audio)
361
+
362
+ Bytescale provides several real-time [Media Processing APIs](https://www.bytescale.com/docs/media-processing-apis):
363
+
364
+ - **[Image Processing APIs](https://www.bytescale.com/docs/image-processing-api)** ([resize](https://www.bytescale.com/docs/image-processing-api#image-resizing-api), [crop](https://www.bytescale.com/docs/image-processing-api#image-cropping-api), [convert](https://www.bytescale.com/docs/image-processing-api#f), [compress](https://www.bytescale.com/docs/image-processing-api#image-compression-api) & [watermark](https://www.bytescale.com/docs/image-processing-api#Text-layering-api))
365
+ - **[Video Processing APIs](https://www.bytescale.com/docs/video-processing-api)** ([transcode](https://www.bytescale.com/docs/video-processing-api#video-transcoding-api), [optimize](https://www.bytescale.com/docs/video-processing-api#video-compression-api), [resize](https://www.bytescale.com/docs/video-processing-api#video-resizing-api) & [extract metadata](https://www.bytescale.com/docs/video-processing-api#video-metadata-api))
366
+ - **[Audio Processing APIs](https://www.bytescale.com/docs/audio-processing-api)** ([transcode](https://www.bytescale.com/docs/audio-processing-api#audio-transcoding-api), [optimize](https://www.bytescale.com/docs/audio-processing-api#audio-compression-api), [trim](https://www.bytescale.com/docs/audio-processing-api#audio-trimming-api) & [extract metadata](https://www.bytescale.com/docs/audio-processing-api#audio-metadata-api))
367
+
368
+ ### Image Processing API (Original Image)
369
+
370
+ Here's an example using [a photo of Chicago](https://upcdn.io/W142hJk/raw/example/city-landscape.jpg):
371
+
372
+ <img src="https://upcdn.io/W142hJk/raw/example/city-landscape.jpg" />
373
+
374
+ ```
375
+ https://upcdn.io/W142hJk/raw/example/city-landscape.jpg
376
+ ```
377
+
378
+ ### Image Processing API (Transformed Image)
379
+
380
+ Using the [Image Processing API](https://www.bytescale.com/docs/image-processing-api), you can produce [this image](https://upcdn.io/W142hJk/image/example/city-landscape.jpg?w=900&h=600&fit=crop&f=webp&q=80&blur=4&text=WATERMARK&layer-opacity=80&blend=overlay&layer-rotate=315&font-size=100&padding=10&font-weight=900&color=ffffff&repeat=true&text=Chicago&gravity=bottom&padding-x=50&padding-bottom=20&font=/example/fonts/Lobster.ttf&color=ffe400):
381
+
382
+ <img src="https://upcdn.io/W142hJk/image/example/city-landscape.jpg?w=900&h=600&fit=crop&f=webp&q=80&blur=4&text=WATERMARK&layer-opacity=80&blend=overlay&layer-rotate=315&font-size=100&padding=10&font-weight=900&color=ffffff&repeat=true&text=Chicago&gravity=bottom&padding-x=50&padding-bottom=20&font=/example/fonts/Lobster.ttf&color=ffe400" />
383
+
384
+ ```
385
+ https://upcdn.io/W142hJk/image/example/city-landscape.jpg
386
+ ?w=900
387
+ &h=600
388
+ &fit=crop
389
+ &f=webp
390
+ &q=80
391
+ &blur=4
392
+ &text=WATERMARK
393
+ &layer-opacity=80
394
+ &blend=overlay
395
+ &layer-rotate=315
396
+ &font-size=100
397
+ &padding=10
398
+ &font-weight=900
399
+ &color=ffffff
400
+ &repeat=true
401
+ &text=Chicago
402
+ &gravity=bottom
403
+ &padding-x=50
404
+ &padding-bottom=20
405
+ &font=/example/fonts/Lobster.ttf
406
+ &color=ffe400
407
+ ```
408
+
360
409
  ## Authorization
361
410
 
362
411
  The Bytescale JavaScript SDK supports two types of authorization:
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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
  */
@@ -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
  }
@@ -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.3",
3
+ "version": "3.5.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