@bytescale/sdk 3.36.0 → 3.38.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 +18 -0
- package/dist/browser/cjs/main.js +13 -5
- package/dist/browser/esm/main.mjs +13 -5
- package/dist/node/cjs/main.js +13 -5
- package/dist/node/esm/main.mjs +13 -5
- package/dist/types/public/shared/UrlBuilderTypes.d.ts +15 -1
- package/dist/types/public/shared/generated/apis/CacheApi.d.ts +1 -1
- package/dist/types/public/shared/generated/apis/FileApi.d.ts +18 -6
- package/dist/types/public/shared/generated/models/index.d.ts +2 -2
- package/dist/worker/cjs/main.js +13 -5
- package/dist/worker/esm/main.mjs +13 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -536,6 +536,24 @@ UrlBuilder.url({
|
|
|
536
536
|
|
|
537
537
|
[Archive Processing API Docs »](https://www.bytescale.com/docs/archive-processing-api)
|
|
538
538
|
|
|
539
|
+
#### Antivirus
|
|
540
|
+
|
|
541
|
+
To scan the file `document.docx` for viruses:
|
|
542
|
+
|
|
543
|
+
```javascript
|
|
544
|
+
// Returns: "https://upcdn.io/1234abc/antivirus/example.zip"
|
|
545
|
+
UrlBuilder.url({
|
|
546
|
+
accountId: "1234abc",
|
|
547
|
+
filePath: "/example.zip",
|
|
548
|
+
options: {
|
|
549
|
+
transformation: "antivirus",
|
|
550
|
+
artifact: "/document.docx"
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
[Antivirus API Docs »](https://www.bytescale.com/docs/antivirus-api)
|
|
556
|
+
|
|
539
557
|
## 🙋 Can I use my own storage?
|
|
540
558
|
|
|
541
559
|
Bytescale supports AWS S3, Cloudflare R2, Google Storage, DigitalOcean, and Bytescale Storage.
|
package/dist/browser/cjs/main.js
CHANGED
|
@@ -781,7 +781,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
781
781
|
key: "resetCache",
|
|
782
782
|
value:
|
|
783
783
|
/**
|
|
784
|
-
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
784
|
+
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
785
785
|
*/
|
|
786
786
|
function resetCache(params) {
|
|
787
787
|
try {
|
|
@@ -966,11 +966,14 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
966
966
|
var _this5 = this;
|
|
967
967
|
var query = {};
|
|
968
968
|
if (params.cache !== undefined) {
|
|
969
|
-
query["
|
|
969
|
+
query["cache"] = params.cache;
|
|
970
970
|
}
|
|
971
971
|
if (params.cacheTtl !== undefined) {
|
|
972
972
|
query["cache_ttl"] = params.cacheTtl;
|
|
973
973
|
}
|
|
974
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
975
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
976
|
+
}
|
|
974
977
|
if (params.version !== undefined) {
|
|
975
978
|
query["version"] = params.version;
|
|
976
979
|
}
|
|
@@ -1027,12 +1030,12 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1027
1030
|
try {
|
|
1028
1031
|
var _this7 = this;
|
|
1029
1032
|
var query = {};
|
|
1030
|
-
if (params.cache !== undefined) {
|
|
1031
|
-
query["Cache"] = params.cache;
|
|
1032
|
-
}
|
|
1033
1033
|
if (params.artifact !== undefined) {
|
|
1034
1034
|
query["artifact"] = params.artifact;
|
|
1035
1035
|
}
|
|
1036
|
+
if (params.cache !== undefined) {
|
|
1037
|
+
query["cache"] = params.cache;
|
|
1038
|
+
}
|
|
1036
1039
|
if (params.cacheOnly !== undefined) {
|
|
1037
1040
|
query["cache_only"] = params.cacheOnly;
|
|
1038
1041
|
}
|
|
@@ -1042,6 +1045,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1042
1045
|
if (params.cacheTtl !== undefined) {
|
|
1043
1046
|
query["cache_ttl"] = params.cacheTtl;
|
|
1044
1047
|
}
|
|
1048
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
1049
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
1050
|
+
}
|
|
1045
1051
|
if (params.transformationParams !== undefined) {
|
|
1046
1052
|
query["transformationParams"] = params.transformationParams;
|
|
1047
1053
|
}
|
|
@@ -1796,10 +1802,12 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1796
1802
|
return this.makeQueryParams({
|
|
1797
1803
|
cache: null,
|
|
1798
1804
|
cacheTtl: null,
|
|
1805
|
+
cacheTtlNotFound: null,
|
|
1799
1806
|
version: null,
|
|
1800
1807
|
forceDownloadPrompt: null
|
|
1801
1808
|
}, {
|
|
1802
1809
|
cacheTtl: "cache_ttl",
|
|
1810
|
+
cacheTtlNotFound: "cache_ttl_not_found",
|
|
1803
1811
|
forceDownloadPrompt: "download"
|
|
1804
1812
|
})(params);
|
|
1805
1813
|
}
|
|
@@ -766,7 +766,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
766
766
|
key: "resetCache",
|
|
767
767
|
value:
|
|
768
768
|
/**
|
|
769
|
-
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
769
|
+
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
770
770
|
*/
|
|
771
771
|
function resetCache(params) {
|
|
772
772
|
try {
|
|
@@ -951,11 +951,14 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
951
951
|
var _this5 = this;
|
|
952
952
|
var query = {};
|
|
953
953
|
if (params.cache !== undefined) {
|
|
954
|
-
query["
|
|
954
|
+
query["cache"] = params.cache;
|
|
955
955
|
}
|
|
956
956
|
if (params.cacheTtl !== undefined) {
|
|
957
957
|
query["cache_ttl"] = params.cacheTtl;
|
|
958
958
|
}
|
|
959
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
960
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
961
|
+
}
|
|
959
962
|
if (params.version !== undefined) {
|
|
960
963
|
query["version"] = params.version;
|
|
961
964
|
}
|
|
@@ -1012,12 +1015,12 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1012
1015
|
try {
|
|
1013
1016
|
var _this7 = this;
|
|
1014
1017
|
var query = {};
|
|
1015
|
-
if (params.cache !== undefined) {
|
|
1016
|
-
query["Cache"] = params.cache;
|
|
1017
|
-
}
|
|
1018
1018
|
if (params.artifact !== undefined) {
|
|
1019
1019
|
query["artifact"] = params.artifact;
|
|
1020
1020
|
}
|
|
1021
|
+
if (params.cache !== undefined) {
|
|
1022
|
+
query["cache"] = params.cache;
|
|
1023
|
+
}
|
|
1021
1024
|
if (params.cacheOnly !== undefined) {
|
|
1022
1025
|
query["cache_only"] = params.cacheOnly;
|
|
1023
1026
|
}
|
|
@@ -1027,6 +1030,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1027
1030
|
if (params.cacheTtl !== undefined) {
|
|
1028
1031
|
query["cache_ttl"] = params.cacheTtl;
|
|
1029
1032
|
}
|
|
1033
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
1034
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
1035
|
+
}
|
|
1030
1036
|
if (params.transformationParams !== undefined) {
|
|
1031
1037
|
query["transformationParams"] = params.transformationParams;
|
|
1032
1038
|
}
|
|
@@ -1781,10 +1787,12 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1781
1787
|
return this.makeQueryParams({
|
|
1782
1788
|
cache: null,
|
|
1783
1789
|
cacheTtl: null,
|
|
1790
|
+
cacheTtlNotFound: null,
|
|
1784
1791
|
version: null,
|
|
1785
1792
|
forceDownloadPrompt: null
|
|
1786
1793
|
}, {
|
|
1787
1794
|
cacheTtl: "cache_ttl",
|
|
1795
|
+
cacheTtlNotFound: "cache_ttl_not_found",
|
|
1788
1796
|
forceDownloadPrompt: "download"
|
|
1789
1797
|
})(params);
|
|
1790
1798
|
}
|
package/dist/node/cjs/main.js
CHANGED
|
@@ -781,7 +781,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
781
781
|
key: "resetCache",
|
|
782
782
|
value:
|
|
783
783
|
/**
|
|
784
|
-
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
784
|
+
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
785
785
|
*/
|
|
786
786
|
function resetCache(params) {
|
|
787
787
|
try {
|
|
@@ -966,11 +966,14 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
966
966
|
var _this5 = this;
|
|
967
967
|
var query = {};
|
|
968
968
|
if (params.cache !== undefined) {
|
|
969
|
-
query["
|
|
969
|
+
query["cache"] = params.cache;
|
|
970
970
|
}
|
|
971
971
|
if (params.cacheTtl !== undefined) {
|
|
972
972
|
query["cache_ttl"] = params.cacheTtl;
|
|
973
973
|
}
|
|
974
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
975
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
976
|
+
}
|
|
974
977
|
if (params.version !== undefined) {
|
|
975
978
|
query["version"] = params.version;
|
|
976
979
|
}
|
|
@@ -1027,12 +1030,12 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1027
1030
|
try {
|
|
1028
1031
|
var _this7 = this;
|
|
1029
1032
|
var query = {};
|
|
1030
|
-
if (params.cache !== undefined) {
|
|
1031
|
-
query["Cache"] = params.cache;
|
|
1032
|
-
}
|
|
1033
1033
|
if (params.artifact !== undefined) {
|
|
1034
1034
|
query["artifact"] = params.artifact;
|
|
1035
1035
|
}
|
|
1036
|
+
if (params.cache !== undefined) {
|
|
1037
|
+
query["cache"] = params.cache;
|
|
1038
|
+
}
|
|
1036
1039
|
if (params.cacheOnly !== undefined) {
|
|
1037
1040
|
query["cache_only"] = params.cacheOnly;
|
|
1038
1041
|
}
|
|
@@ -1042,6 +1045,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1042
1045
|
if (params.cacheTtl !== undefined) {
|
|
1043
1046
|
query["cache_ttl"] = params.cacheTtl;
|
|
1044
1047
|
}
|
|
1048
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
1049
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
1050
|
+
}
|
|
1045
1051
|
if (params.transformationParams !== undefined) {
|
|
1046
1052
|
query["transformationParams"] = params.transformationParams;
|
|
1047
1053
|
}
|
|
@@ -1796,10 +1802,12 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1796
1802
|
return this.makeQueryParams({
|
|
1797
1803
|
cache: null,
|
|
1798
1804
|
cacheTtl: null,
|
|
1805
|
+
cacheTtlNotFound: null,
|
|
1799
1806
|
version: null,
|
|
1800
1807
|
forceDownloadPrompt: null
|
|
1801
1808
|
}, {
|
|
1802
1809
|
cacheTtl: "cache_ttl",
|
|
1810
|
+
cacheTtlNotFound: "cache_ttl_not_found",
|
|
1803
1811
|
forceDownloadPrompt: "download"
|
|
1804
1812
|
})(params);
|
|
1805
1813
|
}
|
package/dist/node/esm/main.mjs
CHANGED
|
@@ -768,7 +768,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
768
768
|
key: "resetCache",
|
|
769
769
|
value:
|
|
770
770
|
/**
|
|
771
|
-
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
771
|
+
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
772
772
|
*/
|
|
773
773
|
function resetCache(params) {
|
|
774
774
|
try {
|
|
@@ -953,11 +953,14 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
953
953
|
var _this5 = this;
|
|
954
954
|
var query = {};
|
|
955
955
|
if (params.cache !== undefined) {
|
|
956
|
-
query["
|
|
956
|
+
query["cache"] = params.cache;
|
|
957
957
|
}
|
|
958
958
|
if (params.cacheTtl !== undefined) {
|
|
959
959
|
query["cache_ttl"] = params.cacheTtl;
|
|
960
960
|
}
|
|
961
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
962
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
963
|
+
}
|
|
961
964
|
if (params.version !== undefined) {
|
|
962
965
|
query["version"] = params.version;
|
|
963
966
|
}
|
|
@@ -1014,12 +1017,12 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1014
1017
|
try {
|
|
1015
1018
|
var _this7 = this;
|
|
1016
1019
|
var query = {};
|
|
1017
|
-
if (params.cache !== undefined) {
|
|
1018
|
-
query["Cache"] = params.cache;
|
|
1019
|
-
}
|
|
1020
1020
|
if (params.artifact !== undefined) {
|
|
1021
1021
|
query["artifact"] = params.artifact;
|
|
1022
1022
|
}
|
|
1023
|
+
if (params.cache !== undefined) {
|
|
1024
|
+
query["cache"] = params.cache;
|
|
1025
|
+
}
|
|
1023
1026
|
if (params.cacheOnly !== undefined) {
|
|
1024
1027
|
query["cache_only"] = params.cacheOnly;
|
|
1025
1028
|
}
|
|
@@ -1029,6 +1032,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1029
1032
|
if (params.cacheTtl !== undefined) {
|
|
1030
1033
|
query["cache_ttl"] = params.cacheTtl;
|
|
1031
1034
|
}
|
|
1035
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
1036
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
1037
|
+
}
|
|
1032
1038
|
if (params.transformationParams !== undefined) {
|
|
1033
1039
|
query["transformationParams"] = params.transformationParams;
|
|
1034
1040
|
}
|
|
@@ -1783,10 +1789,12 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1783
1789
|
return this.makeQueryParams({
|
|
1784
1790
|
cache: null,
|
|
1785
1791
|
cacheTtl: null,
|
|
1792
|
+
cacheTtlNotFound: null,
|
|
1786
1793
|
version: null,
|
|
1787
1794
|
forceDownloadPrompt: null
|
|
1788
1795
|
}, {
|
|
1789
1796
|
cacheTtl: "cache_ttl",
|
|
1797
|
+
cacheTtlNotFound: "cache_ttl_not_found",
|
|
1790
1798
|
forceDownloadPrompt: "download"
|
|
1791
1799
|
})(params);
|
|
1792
1800
|
}
|
|
@@ -22,7 +22,7 @@ export interface UrlBuilderParams {
|
|
|
22
22
|
}
|
|
23
23
|
export type UrlBuilderOptions = UrlBuilderOptionsRaw | UrlBuilderTransformationOptions;
|
|
24
24
|
export type UrlBuilderTransformationOptions = UrlBuilderTransformationApiOptions | UrlBuilderOptionsPreset;
|
|
25
|
-
export type UrlBuilderTransformationApiOptions = UrlBuilderOptionsImage | UrlBuilderOptionsVideo | UrlBuilderOptionsAudio | UrlBuilderOptionsArchive;
|
|
25
|
+
export type UrlBuilderTransformationApiOptions = UrlBuilderOptionsImage | UrlBuilderOptionsVideo | UrlBuilderOptionsAudio | UrlBuilderOptionsArchive | UrlBuilderOptionsAntivirus;
|
|
26
26
|
export interface UrlBuilderOptionsBase extends NonDeprecatedCommonQueryParams, DeprecatedCommonQueryParams {
|
|
27
27
|
/**
|
|
28
28
|
* The base URL of the Bytescale CDN. (Excludes trailing "/".)
|
|
@@ -44,6 +44,12 @@ export interface NonDeprecatedCommonQueryParams {
|
|
|
44
44
|
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
45
45
|
*/
|
|
46
46
|
cacheTtl?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Specifies the maximum amount of time, in seconds, that 404 responses will be cached in the Bytescale CDN's edge cache.
|
|
49
|
+
*
|
|
50
|
+
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
51
|
+
*/
|
|
52
|
+
cacheTtlNotFound?: number;
|
|
47
53
|
/**
|
|
48
54
|
* Forces the browser to display a download prompt for the file, instead of displaying the file in the browser.
|
|
49
55
|
*
|
|
@@ -94,6 +100,14 @@ export interface UrlBuilderOptionsAudio extends UrlBuilderOptionsTransformationA
|
|
|
94
100
|
*/
|
|
95
101
|
transformation: "audio";
|
|
96
102
|
}
|
|
103
|
+
export interface UrlBuilderOptionsAntivirus extends UrlBuilderOptionsTransformationApi<ParameterGroup> {
|
|
104
|
+
/**
|
|
105
|
+
* Set to "antivirus" to use Bytescale's Antivirus API:
|
|
106
|
+
*
|
|
107
|
+
* https://www.bytescale.com/docs/antivirus-api
|
|
108
|
+
*/
|
|
109
|
+
transformation: "antivirus";
|
|
110
|
+
}
|
|
97
111
|
export interface UrlBuilderOptionsArchive extends UrlBuilderOptionsTransformationApi<ParameterGroup> {
|
|
98
112
|
/**
|
|
99
113
|
* Set to "archive" to use Bytescale's Archive Processing API:
|
|
@@ -17,7 +17,7 @@ export interface ResetCacheOperationParams {
|
|
|
17
17
|
}
|
|
18
18
|
export declare class CacheApi extends runtime.BaseAPI {
|
|
19
19
|
/**
|
|
20
|
-
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
20
|
+
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
21
21
|
*/
|
|
22
22
|
resetCache(params: ResetCacheOperationParams): Promise<AsyncResponse>;
|
|
23
23
|
}
|
|
@@ -43,6 +43,12 @@ export interface DownloadFileParams {
|
|
|
43
43
|
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
44
44
|
*/
|
|
45
45
|
cacheTtl?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Specifies the maximum amount of time, in seconds, that 404 responses will be cached in the Bytescale CDN's edge cache.
|
|
48
|
+
*
|
|
49
|
+
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
50
|
+
*/
|
|
51
|
+
cacheTtlNotFound?: number;
|
|
46
52
|
/**
|
|
47
53
|
* Downloads the latest version of your file (if you have overwritten it) when added to the URL with a unique value.
|
|
48
54
|
*
|
|
@@ -63,6 +69,12 @@ export interface ProcessFileParams {
|
|
|
63
69
|
* The name of the File Processing API (e.g. `image`, `video`, `audio`) or transformation preset (created in the Bytescale Dashboard) to use when processing the file.
|
|
64
70
|
*/
|
|
65
71
|
transformation: string;
|
|
72
|
+
/**
|
|
73
|
+
* Some transformations output multiple files, called artifacts.
|
|
74
|
+
*
|
|
75
|
+
* You can download each individual transformation artifact by specifying its path with this parameter
|
|
76
|
+
*/
|
|
77
|
+
artifact?: string;
|
|
66
78
|
/**
|
|
67
79
|
* Specifies whether to cache the transformed result.
|
|
68
80
|
*
|
|
@@ -73,12 +85,6 @@ export interface ProcessFileParams {
|
|
|
73
85
|
* Default: true
|
|
74
86
|
*/
|
|
75
87
|
cache?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Some transformations output multiple files, called artifacts.
|
|
78
|
-
*
|
|
79
|
-
* You can download each individual transformation artifact by specifying its path with this parameter
|
|
80
|
-
*/
|
|
81
|
-
artifact?: string;
|
|
82
88
|
/**
|
|
83
89
|
* Only serve transformations from the cache; do not perform new transformations on cache miss.
|
|
84
90
|
*
|
|
@@ -115,6 +121,12 @@ export interface ProcessFileParams {
|
|
|
115
121
|
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
116
122
|
*/
|
|
117
123
|
cacheTtl?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Specifies the maximum amount of time, in seconds, that 404 responses will be cached in the Bytescale CDN's edge cache.
|
|
126
|
+
*
|
|
127
|
+
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
128
|
+
*/
|
|
129
|
+
cacheTtlNotFound?: number;
|
|
118
130
|
/**
|
|
119
131
|
* Parameters to submit to the File Processing API (e.g. the Image Processing API).
|
|
120
132
|
*
|
|
@@ -761,7 +761,7 @@ export interface FileDetails {
|
|
|
761
761
|
*/
|
|
762
762
|
accountId: string;
|
|
763
763
|
/**
|
|
764
|
-
*
|
|
764
|
+
* The file's ETag, short for "entity tag", reflects the file's version and changes whenever the file is modified.
|
|
765
765
|
* @type {string}
|
|
766
766
|
* @memberof FileDetails
|
|
767
767
|
*/
|
|
@@ -1865,7 +1865,7 @@ export interface R2StorageCredentials {
|
|
|
1865
1865
|
*
|
|
1866
1866
|
* *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request.
|
|
1867
1867
|
*
|
|
1868
|
-
* *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations.
|
|
1868
|
+
* *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database.
|
|
1869
1869
|
*
|
|
1870
1870
|
* *Example patterns:*
|
|
1871
1871
|
*
|
package/dist/worker/cjs/main.js
CHANGED
|
@@ -781,7 +781,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
781
781
|
key: "resetCache",
|
|
782
782
|
value:
|
|
783
783
|
/**
|
|
784
|
-
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
784
|
+
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
785
785
|
*/
|
|
786
786
|
function resetCache(params) {
|
|
787
787
|
try {
|
|
@@ -966,11 +966,14 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
966
966
|
var _this5 = this;
|
|
967
967
|
var query = {};
|
|
968
968
|
if (params.cache !== undefined) {
|
|
969
|
-
query["
|
|
969
|
+
query["cache"] = params.cache;
|
|
970
970
|
}
|
|
971
971
|
if (params.cacheTtl !== undefined) {
|
|
972
972
|
query["cache_ttl"] = params.cacheTtl;
|
|
973
973
|
}
|
|
974
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
975
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
976
|
+
}
|
|
974
977
|
if (params.version !== undefined) {
|
|
975
978
|
query["version"] = params.version;
|
|
976
979
|
}
|
|
@@ -1027,12 +1030,12 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1027
1030
|
try {
|
|
1028
1031
|
var _this7 = this;
|
|
1029
1032
|
var query = {};
|
|
1030
|
-
if (params.cache !== undefined) {
|
|
1031
|
-
query["Cache"] = params.cache;
|
|
1032
|
-
}
|
|
1033
1033
|
if (params.artifact !== undefined) {
|
|
1034
1034
|
query["artifact"] = params.artifact;
|
|
1035
1035
|
}
|
|
1036
|
+
if (params.cache !== undefined) {
|
|
1037
|
+
query["cache"] = params.cache;
|
|
1038
|
+
}
|
|
1036
1039
|
if (params.cacheOnly !== undefined) {
|
|
1037
1040
|
query["cache_only"] = params.cacheOnly;
|
|
1038
1041
|
}
|
|
@@ -1042,6 +1045,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1042
1045
|
if (params.cacheTtl !== undefined) {
|
|
1043
1046
|
query["cache_ttl"] = params.cacheTtl;
|
|
1044
1047
|
}
|
|
1048
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
1049
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
1050
|
+
}
|
|
1045
1051
|
if (params.transformationParams !== undefined) {
|
|
1046
1052
|
query["transformationParams"] = params.transformationParams;
|
|
1047
1053
|
}
|
|
@@ -1796,10 +1802,12 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1796
1802
|
return this.makeQueryParams({
|
|
1797
1803
|
cache: null,
|
|
1798
1804
|
cacheTtl: null,
|
|
1805
|
+
cacheTtlNotFound: null,
|
|
1799
1806
|
version: null,
|
|
1800
1807
|
forceDownloadPrompt: null
|
|
1801
1808
|
}, {
|
|
1802
1809
|
cacheTtl: "cache_ttl",
|
|
1810
|
+
cacheTtlNotFound: "cache_ttl_not_found",
|
|
1803
1811
|
forceDownloadPrompt: "download"
|
|
1804
1812
|
})(params);
|
|
1805
1813
|
}
|
package/dist/worker/esm/main.mjs
CHANGED
|
@@ -766,7 +766,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
766
766
|
key: "resetCache",
|
|
767
767
|
value:
|
|
768
768
|
/**
|
|
769
|
-
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
769
|
+
* Resets the Bytescale CDN cache for a specific path, path prefix, or for your entire account. You can choose to reset the edge cache, or permanent cache, or both caches. *Warning:* Resetting the permanent cache (by setting ```resetPermanentCache: true```) may lead to a significant increase in processing time if numerous file transformations need to be re-performed upon their next request. *Recommended:* Prevent cache resets by adding a ```?v=<etag>``` querystring parameter to your URLs. This ensures your URLs change when your files change, eliminating the need for cache resets. The `etag` field is returned by GetFileDetails and all upload operations, and can be saved to your database. *Example patterns:* - ```\"/_*\"``` - ```\"/raw/example.jpg\"``` - ```\"/image/example.jpg\"``` - ```\"/image/customers/abc/_*\"``` You may only use ```*``` at the end of the pattern. You must not include your account ID prefix in the pattern.
|
|
770
770
|
*/
|
|
771
771
|
function resetCache(params) {
|
|
772
772
|
try {
|
|
@@ -951,11 +951,14 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
951
951
|
var _this5 = this;
|
|
952
952
|
var query = {};
|
|
953
953
|
if (params.cache !== undefined) {
|
|
954
|
-
query["
|
|
954
|
+
query["cache"] = params.cache;
|
|
955
955
|
}
|
|
956
956
|
if (params.cacheTtl !== undefined) {
|
|
957
957
|
query["cache_ttl"] = params.cacheTtl;
|
|
958
958
|
}
|
|
959
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
960
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
961
|
+
}
|
|
959
962
|
if (params.version !== undefined) {
|
|
960
963
|
query["version"] = params.version;
|
|
961
964
|
}
|
|
@@ -1012,12 +1015,12 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1012
1015
|
try {
|
|
1013
1016
|
var _this7 = this;
|
|
1014
1017
|
var query = {};
|
|
1015
|
-
if (params.cache !== undefined) {
|
|
1016
|
-
query["Cache"] = params.cache;
|
|
1017
|
-
}
|
|
1018
1018
|
if (params.artifact !== undefined) {
|
|
1019
1019
|
query["artifact"] = params.artifact;
|
|
1020
1020
|
}
|
|
1021
|
+
if (params.cache !== undefined) {
|
|
1022
|
+
query["cache"] = params.cache;
|
|
1023
|
+
}
|
|
1021
1024
|
if (params.cacheOnly !== undefined) {
|
|
1022
1025
|
query["cache_only"] = params.cacheOnly;
|
|
1023
1026
|
}
|
|
@@ -1027,6 +1030,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1027
1030
|
if (params.cacheTtl !== undefined) {
|
|
1028
1031
|
query["cache_ttl"] = params.cacheTtl;
|
|
1029
1032
|
}
|
|
1033
|
+
if (params.cacheTtlNotFound !== undefined) {
|
|
1034
|
+
query["cache_ttl_not_found"] = params.cacheTtlNotFound;
|
|
1035
|
+
}
|
|
1030
1036
|
if (params.transformationParams !== undefined) {
|
|
1031
1037
|
query["transformationParams"] = params.transformationParams;
|
|
1032
1038
|
}
|
|
@@ -1781,10 +1787,12 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1781
1787
|
return this.makeQueryParams({
|
|
1782
1788
|
cache: null,
|
|
1783
1789
|
cacheTtl: null,
|
|
1790
|
+
cacheTtlNotFound: null,
|
|
1784
1791
|
version: null,
|
|
1785
1792
|
forceDownloadPrompt: null
|
|
1786
1793
|
}, {
|
|
1787
1794
|
cacheTtl: "cache_ttl",
|
|
1795
|
+
cacheTtlNotFound: "cache_ttl_not_found",
|
|
1788
1796
|
forceDownloadPrompt: "download"
|
|
1789
1797
|
})(params);
|
|
1790
1798
|
}
|