@bytescale/sdk 3.50.0 → 3.52.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/dist/browser/cjs/main.js +82 -56
- package/dist/browser/esm/main.mjs +82 -56
- package/dist/node/cjs/main.js +82 -56
- package/dist/node/esm/main.mjs +82 -56
- package/dist/types/private/FilePathUtils.d.ts +3 -0
- package/dist/types/public/shared/generated/apis/FileApi.d.ts +34 -12
- package/dist/types/public/shared/generated/models/index.d.ts +55 -0
- package/dist/types/public/shared/generated/runtime.d.ts +1 -1
- package/dist/worker/cjs/main.js +82 -56
- package/dist/worker/esm/main.mjs +82 -56
- package/package.json +1 -1
package/dist/node/esm/main.mjs
CHANGED
|
@@ -274,6 +274,29 @@ var ConsoleUtils = /*#__PURE__*/function () {
|
|
|
274
274
|
}
|
|
275
275
|
}]);
|
|
276
276
|
}();
|
|
277
|
+
;// CONCATENATED MODULE: ./src/private/FilePathUtils.ts
|
|
278
|
+
function FilePathUtils_typeof(o) { "@babel/helpers - typeof"; return FilePathUtils_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, FilePathUtils_typeof(o); }
|
|
279
|
+
function FilePathUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
280
|
+
function FilePathUtils_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, FilePathUtils_toPropertyKey(descriptor.key), descriptor); } }
|
|
281
|
+
function FilePathUtils_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilePathUtils_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilePathUtils_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
282
|
+
function FilePathUtils_toPropertyKey(t) { var i = FilePathUtils_toPrimitive(t, "string"); return "symbol" == FilePathUtils_typeof(i) ? i : i + ""; }
|
|
283
|
+
function FilePathUtils_toPrimitive(t, r) { if ("object" != FilePathUtils_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != FilePathUtils_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
284
|
+
var FilePathUtils = /*#__PURE__*/function () {
|
|
285
|
+
function FilePathUtils() {
|
|
286
|
+
FilePathUtils_classCallCheck(this, FilePathUtils);
|
|
287
|
+
}
|
|
288
|
+
return FilePathUtils_createClass(FilePathUtils, null, [{
|
|
289
|
+
key: "encodeFilePath",
|
|
290
|
+
value: function encodeFilePath(filePath) {
|
|
291
|
+
// To convert a Bytescale File Path into a Bytescale File URL:
|
|
292
|
+
// a) Call encodeURIComponent() on the file path. (This allows file paths to contain ANY character.)
|
|
293
|
+
// b) Replace all occurrences of "%2F" with "/". (Allows file paths to appear as hierarchical paths on the URL.)
|
|
294
|
+
// c) Replace all occurrences of "!" with "%21". (Prevents file paths with "!" inside being treated as "query bangs".)
|
|
295
|
+
// SYNC: FileUrlUtils.makeFileUrl (internal)
|
|
296
|
+
return encodeURIComponent(filePath).replace(/%2F/g, "/").replace(/!/g, "%21");
|
|
297
|
+
}
|
|
298
|
+
}]);
|
|
299
|
+
}();
|
|
277
300
|
;// CONCATENATED MODULE: ./src/public/shared/generated/runtime.ts
|
|
278
301
|
function runtime_await(value, then, direct) {
|
|
279
302
|
if (direct) {
|
|
@@ -331,6 +354,7 @@ function runtime_toPropertyKey(t) { var i = runtime_toPrimitive(t, "string"); re
|
|
|
331
354
|
function runtime_toPrimitive(t, r) { if ("object" != runtime_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != runtime_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
332
355
|
|
|
333
356
|
|
|
357
|
+
|
|
334
358
|
var BytescaleApiClientConfigUtils = /*#__PURE__*/function () {
|
|
335
359
|
function BytescaleApiClientConfigUtils() {
|
|
336
360
|
runtime_classCallCheck(this, BytescaleApiClientConfigUtils);
|
|
@@ -433,15 +457,14 @@ var BaseAPI = /*#__PURE__*/function () {
|
|
|
433
457
|
}
|
|
434
458
|
}
|
|
435
459
|
}, {
|
|
436
|
-
key: "
|
|
437
|
-
value: function
|
|
460
|
+
key: "encodePathParam",
|
|
461
|
+
value: function encodePathParam(paramName, paramValue) {
|
|
438
462
|
if (paramName === "filePath") {
|
|
439
463
|
if (!paramValue.startsWith("/")) {
|
|
440
464
|
// Non-obvious errors are returned by the Bytescale CDN if forward slashes are omitted, so catch it client-side:
|
|
441
465
|
throw new Error("The 'filePath' parameter must begin with a '/' character.");
|
|
442
466
|
}
|
|
443
|
-
|
|
444
|
-
return paramValue;
|
|
467
|
+
return FilePathUtils.encodeFilePath(paramValue);
|
|
445
468
|
}
|
|
446
469
|
return encodeURIComponent(paramValue);
|
|
447
470
|
}
|
|
@@ -783,7 +806,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
783
806
|
return CacheApi_await(_this.request({
|
|
784
807
|
path: "/v2/accounts/{accountId}/cache/reset".replace("{".concat("accountId", "}"),
|
|
785
808
|
// @ts-ignore
|
|
786
|
-
_this.
|
|
809
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
787
810
|
method: "POST",
|
|
788
811
|
headers: headers,
|
|
789
812
|
query: query,
|
|
@@ -856,7 +879,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
856
879
|
return FileApi_await(_this.request({
|
|
857
880
|
path: "/v2/accounts/{accountId}/files/copy".replace("{".concat("accountId", "}"),
|
|
858
881
|
// @ts-ignore
|
|
859
|
-
_this.
|
|
882
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
860
883
|
method: "POST",
|
|
861
884
|
headers: headers,
|
|
862
885
|
query: query,
|
|
@@ -882,7 +905,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
882
905
|
return FileApi_await(_this2.request({
|
|
883
906
|
path: "/v2/accounts/{accountId}/files/copy/batch".replace("{".concat("accountId", "}"),
|
|
884
907
|
// @ts-ignore
|
|
885
|
-
_this2.
|
|
908
|
+
_this2.encodePathParam("accountId", params.accountId)),
|
|
886
909
|
method: "POST",
|
|
887
910
|
headers: headers,
|
|
888
911
|
query: query,
|
|
@@ -910,7 +933,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
910
933
|
return FileApi_await(_this3.request({
|
|
911
934
|
path: "/v2/accounts/{accountId}/files".replace("{".concat("accountId", "}"),
|
|
912
935
|
// @ts-ignore
|
|
913
|
-
_this3.
|
|
936
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
914
937
|
method: "DELETE",
|
|
915
938
|
headers: headers,
|
|
916
939
|
query: query
|
|
@@ -935,7 +958,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
935
958
|
return FileApi_await(_this4.request({
|
|
936
959
|
path: "/v2/accounts/{accountId}/files/batch".replace("{".concat("accountId", "}"),
|
|
937
960
|
// @ts-ignore
|
|
938
|
-
_this4.
|
|
961
|
+
_this4.encodePathParam("accountId", params.accountId)),
|
|
939
962
|
method: "DELETE",
|
|
940
963
|
headers: headers,
|
|
941
964
|
query: query,
|
|
@@ -960,10 +983,13 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
960
983
|
query["cache"] = params.cache;
|
|
961
984
|
}
|
|
962
985
|
if (params.cacheTtl !== undefined) {
|
|
963
|
-
query["
|
|
986
|
+
query["cache-ttl"] = params.cacheTtl;
|
|
964
987
|
}
|
|
965
988
|
if (params.cacheTtl404 !== undefined) {
|
|
966
|
-
query["
|
|
989
|
+
query["cache-ttl-404"] = params.cacheTtl404;
|
|
990
|
+
}
|
|
991
|
+
if (params.exp !== undefined) {
|
|
992
|
+
query["exp"] = params.exp;
|
|
967
993
|
}
|
|
968
994
|
if (params.version !== undefined) {
|
|
969
995
|
query["version"] = params.version;
|
|
@@ -972,9 +998,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
972
998
|
return FileApi_await(_this5.request({
|
|
973
999
|
path: "/{accountId}/raw{filePath}".replace("{".concat("accountId", "}"),
|
|
974
1000
|
// @ts-ignore
|
|
975
|
-
_this5.
|
|
1001
|
+
_this5.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
976
1002
|
// @ts-ignore
|
|
977
|
-
_this5.
|
|
1003
|
+
_this5.encodePathParam("filePath", params.filePath)),
|
|
978
1004
|
method: "GET",
|
|
979
1005
|
headers: headers,
|
|
980
1006
|
query: query
|
|
@@ -1001,7 +1027,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1001
1027
|
return FileApi_await(_this6.request({
|
|
1002
1028
|
path: "/v2/accounts/{accountId}/files/details".replace("{".concat("accountId", "}"),
|
|
1003
1029
|
// @ts-ignore
|
|
1004
|
-
_this6.
|
|
1030
|
+
_this6.encodePathParam("accountId", params.accountId)),
|
|
1005
1031
|
method: "GET",
|
|
1006
1032
|
headers: headers,
|
|
1007
1033
|
query: query
|
|
@@ -1021,6 +1047,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1021
1047
|
try {
|
|
1022
1048
|
var _this7 = this;
|
|
1023
1049
|
var query = {};
|
|
1050
|
+
if (params.transformationParams !== undefined) {
|
|
1051
|
+
query["<transformation-params>"] = params.transformationParams;
|
|
1052
|
+
}
|
|
1024
1053
|
if (params.artifact !== undefined) {
|
|
1025
1054
|
query["artifact"] = params.artifact;
|
|
1026
1055
|
}
|
|
@@ -1028,19 +1057,19 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1028
1057
|
query["cache"] = params.cache;
|
|
1029
1058
|
}
|
|
1030
1059
|
if (params.cacheOnly !== undefined) {
|
|
1031
|
-
query["
|
|
1060
|
+
query["cache-only"] = params.cacheOnly;
|
|
1032
1061
|
}
|
|
1033
1062
|
if (params.cachePerm !== undefined) {
|
|
1034
|
-
query["
|
|
1063
|
+
query["cache-perm"] = params.cachePerm;
|
|
1035
1064
|
}
|
|
1036
1065
|
if (params.cacheTtl !== undefined) {
|
|
1037
|
-
query["
|
|
1066
|
+
query["cache-ttl"] = params.cacheTtl;
|
|
1038
1067
|
}
|
|
1039
1068
|
if (params.cacheTtl404 !== undefined) {
|
|
1040
|
-
query["
|
|
1069
|
+
query["cache-ttl-404"] = params.cacheTtl404;
|
|
1041
1070
|
}
|
|
1042
|
-
if (params.
|
|
1043
|
-
query["
|
|
1071
|
+
if (params.exp !== undefined) {
|
|
1072
|
+
query["exp"] = params.exp;
|
|
1044
1073
|
}
|
|
1045
1074
|
if (params.version !== undefined) {
|
|
1046
1075
|
query["version"] = params.version;
|
|
@@ -1049,11 +1078,11 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1049
1078
|
return FileApi_await(_this7.request({
|
|
1050
1079
|
path: "/{accountId}/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1051
1080
|
// @ts-ignore
|
|
1052
|
-
_this7.
|
|
1081
|
+
_this7.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1053
1082
|
// @ts-ignore
|
|
1054
|
-
_this7.
|
|
1083
|
+
_this7.encodePathParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1055
1084
|
// @ts-ignore
|
|
1056
|
-
_this7.
|
|
1085
|
+
_this7.encodePathParam("transformation", params.transformation)),
|
|
1057
1086
|
method: "GET",
|
|
1058
1087
|
headers: headers,
|
|
1059
1088
|
query: query
|
|
@@ -1074,18 +1103,18 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1074
1103
|
var _this8 = this;
|
|
1075
1104
|
var query = {};
|
|
1076
1105
|
if (params.transformationParams !== undefined) {
|
|
1077
|
-
query["
|
|
1106
|
+
query["<transformation-params>"] = params.transformationParams;
|
|
1078
1107
|
}
|
|
1079
1108
|
var headers = {};
|
|
1080
1109
|
headers["Content-Type"] = "application/json";
|
|
1081
1110
|
return FileApi_await(_this8.request({
|
|
1082
1111
|
path: "/{accountId}/save/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1083
1112
|
// @ts-ignore
|
|
1084
|
-
_this8.
|
|
1113
|
+
_this8.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1085
1114
|
// @ts-ignore
|
|
1086
|
-
_this8.
|
|
1115
|
+
_this8.encodePathParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1087
1116
|
// @ts-ignore
|
|
1088
|
-
_this8.
|
|
1117
|
+
_this8.encodePathParam("transformation", params.transformation)),
|
|
1089
1118
|
method: "POST",
|
|
1090
1119
|
headers: headers,
|
|
1091
1120
|
query: query,
|
|
@@ -1158,7 +1187,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1158
1187
|
return FolderApi_await(_this.request({
|
|
1159
1188
|
path: "/v2/accounts/{accountId}/folders/copy".replace("{".concat("accountId", "}"),
|
|
1160
1189
|
// @ts-ignore
|
|
1161
|
-
_this.
|
|
1190
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
1162
1191
|
method: "POST",
|
|
1163
1192
|
headers: headers,
|
|
1164
1193
|
query: query,
|
|
@@ -1184,7 +1213,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1184
1213
|
return FolderApi_await(_this2.request({
|
|
1185
1214
|
path: "/v2/accounts/{accountId}/folders/copy/batch".replace("{".concat("accountId", "}"),
|
|
1186
1215
|
// @ts-ignore
|
|
1187
|
-
_this2.
|
|
1216
|
+
_this2.encodePathParam("accountId", params.accountId)),
|
|
1188
1217
|
method: "POST",
|
|
1189
1218
|
headers: headers,
|
|
1190
1219
|
query: query,
|
|
@@ -1210,7 +1239,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1210
1239
|
return FolderApi_await(_this3.request({
|
|
1211
1240
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1212
1241
|
// @ts-ignore
|
|
1213
|
-
_this3.
|
|
1242
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
1214
1243
|
method: "DELETE",
|
|
1215
1244
|
headers: headers,
|
|
1216
1245
|
query: query,
|
|
@@ -1236,7 +1265,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1236
1265
|
return FolderApi_await(_this4.request({
|
|
1237
1266
|
path: "/v2/accounts/{accountId}/folders/batch".replace("{".concat("accountId", "}"),
|
|
1238
1267
|
// @ts-ignore
|
|
1239
|
-
_this4.
|
|
1268
|
+
_this4.encodePathParam("accountId", params.accountId)),
|
|
1240
1269
|
method: "DELETE",
|
|
1241
1270
|
headers: headers,
|
|
1242
1271
|
query: query,
|
|
@@ -1264,7 +1293,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1264
1293
|
return FolderApi_await(_this5.request({
|
|
1265
1294
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1266
1295
|
// @ts-ignore
|
|
1267
|
-
_this5.
|
|
1296
|
+
_this5.encodePathParam("accountId", params.accountId)),
|
|
1268
1297
|
method: "GET",
|
|
1269
1298
|
headers: headers,
|
|
1270
1299
|
query: query
|
|
@@ -1315,7 +1344,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1315
1344
|
return FolderApi_await(_this6.request({
|
|
1316
1345
|
path: "/v2/accounts/{accountId}/folders/list".replace("{".concat("accountId", "}"),
|
|
1317
1346
|
// @ts-ignore
|
|
1318
|
-
_this6.
|
|
1347
|
+
_this6.encodePathParam("accountId", params.accountId)),
|
|
1319
1348
|
method: "GET",
|
|
1320
1349
|
headers: headers,
|
|
1321
1350
|
query: query
|
|
@@ -1340,7 +1369,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1340
1369
|
return FolderApi_await(_this7.request({
|
|
1341
1370
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1342
1371
|
// @ts-ignore
|
|
1343
|
-
_this7.
|
|
1372
|
+
_this7.encodePathParam("accountId", params.accountId)),
|
|
1344
1373
|
method: "PUT",
|
|
1345
1374
|
headers: headers,
|
|
1346
1375
|
query: query,
|
|
@@ -1412,11 +1441,11 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1412
1441
|
return JobApi_await(_this.request({
|
|
1413
1442
|
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
1414
1443
|
// @ts-ignore
|
|
1415
|
-
_this.
|
|
1444
|
+
_this.encodePathParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
1416
1445
|
// @ts-ignore
|
|
1417
|
-
_this.
|
|
1446
|
+
_this.encodePathParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
1418
1447
|
// @ts-ignore
|
|
1419
|
-
_this.
|
|
1448
|
+
_this.encodePathParam("jobType", params.jobType)),
|
|
1420
1449
|
method: "DELETE",
|
|
1421
1450
|
headers: headers,
|
|
1422
1451
|
query: query
|
|
@@ -1440,11 +1469,11 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1440
1469
|
return JobApi_await(_this2.request({
|
|
1441
1470
|
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
1442
1471
|
// @ts-ignore
|
|
1443
|
-
_this2.
|
|
1472
|
+
_this2.encodePathParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
1444
1473
|
// @ts-ignore
|
|
1445
|
-
_this2.
|
|
1474
|
+
_this2.encodePathParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
1446
1475
|
// @ts-ignore
|
|
1447
|
-
_this2.
|
|
1476
|
+
_this2.encodePathParam("jobType", params.jobType)),
|
|
1448
1477
|
method: "GET",
|
|
1449
1478
|
headers: headers,
|
|
1450
1479
|
query: query
|
|
@@ -1471,7 +1500,7 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1471
1500
|
return JobApi_await(_this3.request({
|
|
1472
1501
|
path: "/v2/accounts/{accountId}/jobs".replace("{".concat("accountId", "}"),
|
|
1473
1502
|
// @ts-ignore
|
|
1474
|
-
_this3.
|
|
1503
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
1475
1504
|
method: "GET",
|
|
1476
1505
|
headers: headers,
|
|
1477
1506
|
query: query
|
|
@@ -1543,7 +1572,7 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1543
1572
|
return UploadApi_await(_this.request({
|
|
1544
1573
|
path: "/v2/accounts/{accountId}/uploads".replace("{".concat("accountId", "}"),
|
|
1545
1574
|
// @ts-ignore
|
|
1546
|
-
_this.
|
|
1575
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
1547
1576
|
method: "POST",
|
|
1548
1577
|
headers: headers,
|
|
1549
1578
|
query: query,
|
|
@@ -1569,11 +1598,11 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1569
1598
|
return UploadApi_await(_this2.request({
|
|
1570
1599
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
1571
1600
|
// @ts-ignore
|
|
1572
|
-
_this2.
|
|
1601
|
+
_this2.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1573
1602
|
// @ts-ignore
|
|
1574
|
-
_this2.
|
|
1603
|
+
_this2.encodePathParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
1575
1604
|
// @ts-ignore
|
|
1576
|
-
_this2.
|
|
1605
|
+
_this2.encodePathParam("uploadPartIndex", params.uploadPartIndex)),
|
|
1577
1606
|
method: "PUT",
|
|
1578
1607
|
headers: headers,
|
|
1579
1608
|
query: query,
|
|
@@ -1598,11 +1627,11 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1598
1627
|
return UploadApi_await(_this3.request({
|
|
1599
1628
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
1600
1629
|
// @ts-ignore
|
|
1601
|
-
_this3.
|
|
1630
|
+
_this3.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1602
1631
|
// @ts-ignore
|
|
1603
|
-
_this3.
|
|
1632
|
+
_this3.encodePathParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
1604
1633
|
// @ts-ignore
|
|
1605
|
-
_this3.
|
|
1634
|
+
_this3.encodePathParam("uploadPartIndex", params.uploadPartIndex)),
|
|
1606
1635
|
method: "GET",
|
|
1607
1636
|
headers: headers,
|
|
1608
1637
|
query: query
|
|
@@ -1626,9 +1655,9 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1626
1655
|
return UploadApi_await(_this4.request({
|
|
1627
1656
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts".replace("{".concat("accountId", "}"),
|
|
1628
1657
|
// @ts-ignore
|
|
1629
|
-
_this4.
|
|
1658
|
+
_this4.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1630
1659
|
// @ts-ignore
|
|
1631
|
-
_this4.
|
|
1660
|
+
_this4.encodePathParam("uploadId", params.uploadId)),
|
|
1632
1661
|
method: "GET",
|
|
1633
1662
|
headers: headers,
|
|
1634
1663
|
query: query
|
|
@@ -1653,7 +1682,7 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1653
1682
|
return UploadApi_await(_this5.request({
|
|
1654
1683
|
path: "/v2/accounts/{accountId}/uploads/url".replace("{".concat("accountId", "}"),
|
|
1655
1684
|
// @ts-ignore
|
|
1656
|
-
_this5.
|
|
1685
|
+
_this5.encodePathParam("accountId", params.accountId)),
|
|
1657
1686
|
method: "POST",
|
|
1658
1687
|
headers: headers,
|
|
1659
1688
|
query: query,
|
|
@@ -1712,6 +1741,7 @@ function UrlBuilder_toPropertyKey(t) { var i = UrlBuilder_toPrimitive(t, "string
|
|
|
1712
1741
|
function UrlBuilder_toPrimitive(t, r) { if ("object" != UrlBuilder_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != UrlBuilder_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1713
1742
|
|
|
1714
1743
|
|
|
1744
|
+
|
|
1715
1745
|
var UrlBuilder = /*#__PURE__*/function () {
|
|
1716
1746
|
function UrlBuilder() {
|
|
1717
1747
|
UrlBuilder_classCallCheck(this, UrlBuilder);
|
|
@@ -1766,11 +1796,7 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1766
1796
|
value: function getBaseUrl(params, prefix) {
|
|
1767
1797
|
var _a, _b;
|
|
1768
1798
|
var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
|
|
1769
|
-
|
|
1770
|
-
// a) Call encodeURIComponent() on the file path. (This allows file paths to contain ANY character.)
|
|
1771
|
-
// b) Replace all occurrences of "%2F" with "/". (Allows file paths to appear as hierarchical paths on the URL.)
|
|
1772
|
-
// c) Replace all occurrences of "!" with "%21". (Prevents file paths with "!" inside being treated as "query bangs".)
|
|
1773
|
-
var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/").replace(/!/g, "%21");
|
|
1799
|
+
var filePathEncoded = FilePathUtils.encodeFilePath(params.filePath);
|
|
1774
1800
|
return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
|
|
1775
1801
|
}
|
|
1776
1802
|
}, {
|
|
@@ -49,6 +49,16 @@ export interface DownloadFileParams {
|
|
|
49
49
|
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
50
50
|
*/
|
|
51
51
|
cacheTtl404?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Expires the URL at the given Unix epoch timestamp.
|
|
54
|
+
*
|
|
55
|
+
* The value can be provided in either milliseconds or seconds since January 1, 1970, 00:00:00 UTC.
|
|
56
|
+
*
|
|
57
|
+
* Must less than 7 days in the future.
|
|
58
|
+
*
|
|
59
|
+
* See: Secure URLs
|
|
60
|
+
*/
|
|
61
|
+
exp?: number;
|
|
52
62
|
/**
|
|
53
63
|
* Downloads the latest version of your file (if you have overwritten it) when added to the URL with a unique value.
|
|
54
64
|
*
|
|
@@ -69,6 +79,18 @@ export interface ProcessFileParams {
|
|
|
69
79
|
* 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.
|
|
70
80
|
*/
|
|
71
81
|
transformation: string;
|
|
82
|
+
/**
|
|
83
|
+
* Each File Processing API requires additional query string parameters to specify the desired transformation behavior.
|
|
84
|
+
*
|
|
85
|
+
* For details, refer to the relevant documentation:
|
|
86
|
+
*
|
|
87
|
+
* - https://www.bytescale.com/docs/image-processing-api
|
|
88
|
+
* - https://www.bytescale.com/docs/video-processing-api
|
|
89
|
+
* - https://www.bytescale.com/docs/audio-processing-api
|
|
90
|
+
* - https://www.bytescale.com/docs/archive-processing-api
|
|
91
|
+
* - https://www.bytescale.com/docs/antivirus-api
|
|
92
|
+
*/
|
|
93
|
+
transformationParams?: TransformationParams;
|
|
72
94
|
/**
|
|
73
95
|
* Some transformations output multiple files, called artifacts.
|
|
74
96
|
*
|
|
@@ -80,7 +102,7 @@ export interface ProcessFileParams {
|
|
|
80
102
|
*
|
|
81
103
|
* If set to `false` the transformation will be executed on every request.
|
|
82
104
|
*
|
|
83
|
-
* *Recommendation:* instead of disabling the cache, a more performant solution is to use the `version` parameter and to increment it each time you require an updated result.
|
|
105
|
+
* *Recommendation:* instead of disabling the cache, a more performant solution is to use the `version` or `v` parameter and to increment it each time you require an updated result.
|
|
84
106
|
*
|
|
85
107
|
* Default: true
|
|
86
108
|
*/
|
|
@@ -102,7 +124,7 @@ export interface ProcessFileParams {
|
|
|
102
124
|
*
|
|
103
125
|
* When `cache=false` this parameter is automatically set to `false`.
|
|
104
126
|
*
|
|
105
|
-
* When `
|
|
127
|
+
* When `cache-perm=auto` the perma-cache will only be used for files that take more than 500ms to process.
|
|
106
128
|
*
|
|
107
129
|
* When the perma-cache is used, approximately 200ms of latency is added to the initial request. Thereafter, files will be served from the Bytescale CDN's edge cache or perma-cache, so will have minimal latency.
|
|
108
130
|
*
|
|
@@ -116,7 +138,7 @@ export interface ProcessFileParams {
|
|
|
116
138
|
*
|
|
117
139
|
* If the file is not perma-cached, then the file will be reprocessed on edge cache misses.
|
|
118
140
|
*
|
|
119
|
-
* For more information on perma-caching, see: `
|
|
141
|
+
* For more information on perma-caching, see: `cache-perm`
|
|
120
142
|
*
|
|
121
143
|
* Default: Please refer to your account's default cache settings in the Bytescale Dashboard.
|
|
122
144
|
*/
|
|
@@ -128,16 +150,15 @@ export interface ProcessFileParams {
|
|
|
128
150
|
*/
|
|
129
151
|
cacheTtl404?: number;
|
|
130
152
|
/**
|
|
131
|
-
*
|
|
153
|
+
* Expires the URL at the given Unix epoch timestamp.
|
|
132
154
|
*
|
|
133
|
-
*
|
|
155
|
+
* The value can be provided in either milliseconds or seconds since January 1, 1970, 00:00:00 UTC.
|
|
134
156
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* - https://www.bytescale.com/docs/archive-processing-api
|
|
157
|
+
* Must less than 7 days in the future.
|
|
158
|
+
*
|
|
159
|
+
* See: Secure URLs
|
|
139
160
|
*/
|
|
140
|
-
|
|
161
|
+
exp?: number;
|
|
141
162
|
/**
|
|
142
163
|
* Add this parameter and increment its value to force the file to be reprocessed.
|
|
143
164
|
*
|
|
@@ -161,14 +182,15 @@ export interface ProcessFileAndSaveOperationParams {
|
|
|
161
182
|
*/
|
|
162
183
|
processFileAndSaveRequest: ProcessFileAndSaveRequest;
|
|
163
184
|
/**
|
|
164
|
-
*
|
|
185
|
+
* Each File Processing API requires additional query string parameters to specify the desired transformation behavior.
|
|
165
186
|
*
|
|
166
|
-
*
|
|
187
|
+
* For details, refer to the relevant documentation:
|
|
167
188
|
*
|
|
168
189
|
* - https://www.bytescale.com/docs/image-processing-api
|
|
169
190
|
* - https://www.bytescale.com/docs/video-processing-api
|
|
170
191
|
* - https://www.bytescale.com/docs/audio-processing-api
|
|
171
192
|
* - https://www.bytescale.com/docs/archive-processing-api
|
|
193
|
+
* - https://www.bytescale.com/docs/antivirus-api
|
|
172
194
|
*/
|
|
173
195
|
transformationParams?: TransformationParams;
|
|
174
196
|
}
|
|
@@ -2387,6 +2387,12 @@ export interface WebStorage {
|
|
|
2387
2387
|
* @memberof WebStorage
|
|
2388
2388
|
*/
|
|
2389
2389
|
baseUrl?: string;
|
|
2390
|
+
/**
|
|
2391
|
+
*
|
|
2392
|
+
* @type {WebStorageQueryStringForwarding}
|
|
2393
|
+
* @memberof WebStorage
|
|
2394
|
+
*/
|
|
2395
|
+
queryStringForwarding?: WebStorageQueryStringForwarding;
|
|
2390
2396
|
/**
|
|
2391
2397
|
* The type of this storage layer.
|
|
2392
2398
|
* @type {string}
|
|
@@ -2398,6 +2404,55 @@ export interface WebStorage {
|
|
|
2398
2404
|
* @export
|
|
2399
2405
|
*/
|
|
2400
2406
|
export type WebStorageTypeEnum = "Web";
|
|
2407
|
+
/**
|
|
2408
|
+
* This object is used for the value of the `queryStringForwarding` field on the `WebStorage` object, and defines how user-provided query strings are forwarded to the HTTP origin. If left unset, no user-provided query strings will be forwarded to the HTTP origin.
|
|
2409
|
+
*
|
|
2410
|
+
* *Instructions:*
|
|
2411
|
+
* - To *block all* query string parameters: use `"Whitelist"` with an empty `parameters` array (default if unset).
|
|
2412
|
+
* - To *allow all* query string parameters: use `"Blacklist"` with an empty `parameters` array.
|
|
2413
|
+
* - To *allow some* query string parameters: use either `"Blacklist"` or `"Whitelist"` with one or more `parameters`.
|
|
2414
|
+
* @export
|
|
2415
|
+
* @interface WebStorageQueryStringForwarding
|
|
2416
|
+
*/
|
|
2417
|
+
export interface WebStorageQueryStringForwarding {
|
|
2418
|
+
/**
|
|
2419
|
+
* Determines which parameters to forward based on the `type` field:
|
|
2420
|
+
*
|
|
2421
|
+
* If `"Whitelist"` is set in the `type` field:
|
|
2422
|
+
* - Only parameters in this array will be forwarded.
|
|
2423
|
+
* - An empty array prevents all parameters from being forwarded.
|
|
2424
|
+
*
|
|
2425
|
+
* If `"Blacklist"` is set in the `type` field:
|
|
2426
|
+
* - Only parameters in this array will be blocked.
|
|
2427
|
+
* - An empty array allows all parameters to be forwarded.
|
|
2428
|
+
* @type {Array<WebStorageQueryStringParam>}
|
|
2429
|
+
* @memberof WebStorageQueryStringForwarding
|
|
2430
|
+
*/
|
|
2431
|
+
parameters: Array<WebStorageQueryStringParam>;
|
|
2432
|
+
/**
|
|
2433
|
+
* Determines whether the `parameters` array is interpreted as a blacklist or a whitelist.
|
|
2434
|
+
* @type {string}
|
|
2435
|
+
* @memberof WebStorageQueryStringForwarding
|
|
2436
|
+
*/
|
|
2437
|
+
type: WebStorageQueryStringForwardingTypeEnum;
|
|
2438
|
+
}
|
|
2439
|
+
/**
|
|
2440
|
+
* @export
|
|
2441
|
+
*/
|
|
2442
|
+
export type WebStorageQueryStringForwardingTypeEnum = "Whitelist" | "Blacklist";
|
|
2443
|
+
/**
|
|
2444
|
+
* Matches exactly one query string parameter. The value of the `name` field must be URL encoded.
|
|
2445
|
+
* @export
|
|
2446
|
+
* @interface WebStorageQueryStringParam
|
|
2447
|
+
*/
|
|
2448
|
+
export interface WebStorageQueryStringParam {
|
|
2449
|
+
/**
|
|
2450
|
+
* Query string parameter name. Must be URL-encoded.
|
|
2451
|
+
* @type {string}
|
|
2452
|
+
* @memberof WebStorageQueryStringParam
|
|
2453
|
+
*/
|
|
2454
|
+
name: string;
|
|
2455
|
+
}
|
|
2401
2456
|
/**
|
|
2402
2457
|
*
|
|
2403
2458
|
* @export
|
|
@@ -67,7 +67,7 @@ export declare class BaseAPI {
|
|
|
67
67
|
isBytescaleApi: boolean;
|
|
68
68
|
}): Promise<Response>;
|
|
69
69
|
protected request(context: RequestOpts, initOverrides: RequestInit | InitOverrideFunction | undefined, baseUrlOverride: string | undefined): Promise<Response>;
|
|
70
|
-
protected
|
|
70
|
+
protected encodePathParam(paramName: string, paramValue: string): string;
|
|
71
71
|
private createFetchParams;
|
|
72
72
|
}
|
|
73
73
|
export declare class CancelledError extends Error {
|