@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/browser/cjs/main.js
CHANGED
|
@@ -287,6 +287,29 @@ var ConsoleUtils = /*#__PURE__*/function () {
|
|
|
287
287
|
}
|
|
288
288
|
}]);
|
|
289
289
|
}();
|
|
290
|
+
;// CONCATENATED MODULE: ./src/private/FilePathUtils.ts
|
|
291
|
+
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); }
|
|
292
|
+
function FilePathUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
293
|
+
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); } }
|
|
294
|
+
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; }
|
|
295
|
+
function FilePathUtils_toPropertyKey(t) { var i = FilePathUtils_toPrimitive(t, "string"); return "symbol" == FilePathUtils_typeof(i) ? i : i + ""; }
|
|
296
|
+
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); }
|
|
297
|
+
var FilePathUtils = /*#__PURE__*/function () {
|
|
298
|
+
function FilePathUtils() {
|
|
299
|
+
FilePathUtils_classCallCheck(this, FilePathUtils);
|
|
300
|
+
}
|
|
301
|
+
return FilePathUtils_createClass(FilePathUtils, null, [{
|
|
302
|
+
key: "encodeFilePath",
|
|
303
|
+
value: function encodeFilePath(filePath) {
|
|
304
|
+
// To convert a Bytescale File Path into a Bytescale File URL:
|
|
305
|
+
// a) Call encodeURIComponent() on the file path. (This allows file paths to contain ANY character.)
|
|
306
|
+
// b) Replace all occurrences of "%2F" with "/". (Allows file paths to appear as hierarchical paths on the URL.)
|
|
307
|
+
// c) Replace all occurrences of "!" with "%21". (Prevents file paths with "!" inside being treated as "query bangs".)
|
|
308
|
+
// SYNC: FileUrlUtils.makeFileUrl (internal)
|
|
309
|
+
return encodeURIComponent(filePath).replace(/%2F/g, "/").replace(/!/g, "%21");
|
|
310
|
+
}
|
|
311
|
+
}]);
|
|
312
|
+
}();
|
|
290
313
|
;// CONCATENATED MODULE: ./src/public/shared/generated/runtime.ts
|
|
291
314
|
function runtime_await(value, then, direct) {
|
|
292
315
|
if (direct) {
|
|
@@ -344,6 +367,7 @@ function runtime_toPropertyKey(t) { var i = runtime_toPrimitive(t, "string"); re
|
|
|
344
367
|
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); }
|
|
345
368
|
|
|
346
369
|
|
|
370
|
+
|
|
347
371
|
var BytescaleApiClientConfigUtils = /*#__PURE__*/function () {
|
|
348
372
|
function BytescaleApiClientConfigUtils() {
|
|
349
373
|
runtime_classCallCheck(this, BytescaleApiClientConfigUtils);
|
|
@@ -446,15 +470,14 @@ var BaseAPI = /*#__PURE__*/function () {
|
|
|
446
470
|
}
|
|
447
471
|
}
|
|
448
472
|
}, {
|
|
449
|
-
key: "
|
|
450
|
-
value: function
|
|
473
|
+
key: "encodePathParam",
|
|
474
|
+
value: function encodePathParam(paramName, paramValue) {
|
|
451
475
|
if (paramName === "filePath") {
|
|
452
476
|
if (!paramValue.startsWith("/")) {
|
|
453
477
|
// Non-obvious errors are returned by the Bytescale CDN if forward slashes are omitted, so catch it client-side:
|
|
454
478
|
throw new Error("The 'filePath' parameter must begin with a '/' character.");
|
|
455
479
|
}
|
|
456
|
-
|
|
457
|
-
return paramValue;
|
|
480
|
+
return FilePathUtils.encodeFilePath(paramValue);
|
|
458
481
|
}
|
|
459
482
|
return encodeURIComponent(paramValue);
|
|
460
483
|
}
|
|
@@ -796,7 +819,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
796
819
|
return CacheApi_await(_this.request({
|
|
797
820
|
path: "/v2/accounts/{accountId}/cache/reset".replace("{".concat("accountId", "}"),
|
|
798
821
|
// @ts-ignore
|
|
799
|
-
_this.
|
|
822
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
800
823
|
method: "POST",
|
|
801
824
|
headers: headers,
|
|
802
825
|
query: query,
|
|
@@ -869,7 +892,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
869
892
|
return FileApi_await(_this.request({
|
|
870
893
|
path: "/v2/accounts/{accountId}/files/copy".replace("{".concat("accountId", "}"),
|
|
871
894
|
// @ts-ignore
|
|
872
|
-
_this.
|
|
895
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
873
896
|
method: "POST",
|
|
874
897
|
headers: headers,
|
|
875
898
|
query: query,
|
|
@@ -895,7 +918,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
895
918
|
return FileApi_await(_this2.request({
|
|
896
919
|
path: "/v2/accounts/{accountId}/files/copy/batch".replace("{".concat("accountId", "}"),
|
|
897
920
|
// @ts-ignore
|
|
898
|
-
_this2.
|
|
921
|
+
_this2.encodePathParam("accountId", params.accountId)),
|
|
899
922
|
method: "POST",
|
|
900
923
|
headers: headers,
|
|
901
924
|
query: query,
|
|
@@ -923,7 +946,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
923
946
|
return FileApi_await(_this3.request({
|
|
924
947
|
path: "/v2/accounts/{accountId}/files".replace("{".concat("accountId", "}"),
|
|
925
948
|
// @ts-ignore
|
|
926
|
-
_this3.
|
|
949
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
927
950
|
method: "DELETE",
|
|
928
951
|
headers: headers,
|
|
929
952
|
query: query
|
|
@@ -948,7 +971,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
948
971
|
return FileApi_await(_this4.request({
|
|
949
972
|
path: "/v2/accounts/{accountId}/files/batch".replace("{".concat("accountId", "}"),
|
|
950
973
|
// @ts-ignore
|
|
951
|
-
_this4.
|
|
974
|
+
_this4.encodePathParam("accountId", params.accountId)),
|
|
952
975
|
method: "DELETE",
|
|
953
976
|
headers: headers,
|
|
954
977
|
query: query,
|
|
@@ -973,10 +996,13 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
973
996
|
query["cache"] = params.cache;
|
|
974
997
|
}
|
|
975
998
|
if (params.cacheTtl !== undefined) {
|
|
976
|
-
query["
|
|
999
|
+
query["cache-ttl"] = params.cacheTtl;
|
|
977
1000
|
}
|
|
978
1001
|
if (params.cacheTtl404 !== undefined) {
|
|
979
|
-
query["
|
|
1002
|
+
query["cache-ttl-404"] = params.cacheTtl404;
|
|
1003
|
+
}
|
|
1004
|
+
if (params.exp !== undefined) {
|
|
1005
|
+
query["exp"] = params.exp;
|
|
980
1006
|
}
|
|
981
1007
|
if (params.version !== undefined) {
|
|
982
1008
|
query["version"] = params.version;
|
|
@@ -985,9 +1011,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
985
1011
|
return FileApi_await(_this5.request({
|
|
986
1012
|
path: "/{accountId}/raw{filePath}".replace("{".concat("accountId", "}"),
|
|
987
1013
|
// @ts-ignore
|
|
988
|
-
_this5.
|
|
1014
|
+
_this5.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
989
1015
|
// @ts-ignore
|
|
990
|
-
_this5.
|
|
1016
|
+
_this5.encodePathParam("filePath", params.filePath)),
|
|
991
1017
|
method: "GET",
|
|
992
1018
|
headers: headers,
|
|
993
1019
|
query: query
|
|
@@ -1014,7 +1040,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1014
1040
|
return FileApi_await(_this6.request({
|
|
1015
1041
|
path: "/v2/accounts/{accountId}/files/details".replace("{".concat("accountId", "}"),
|
|
1016
1042
|
// @ts-ignore
|
|
1017
|
-
_this6.
|
|
1043
|
+
_this6.encodePathParam("accountId", params.accountId)),
|
|
1018
1044
|
method: "GET",
|
|
1019
1045
|
headers: headers,
|
|
1020
1046
|
query: query
|
|
@@ -1034,6 +1060,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1034
1060
|
try {
|
|
1035
1061
|
var _this7 = this;
|
|
1036
1062
|
var query = {};
|
|
1063
|
+
if (params.transformationParams !== undefined) {
|
|
1064
|
+
query["<transformation-params>"] = params.transformationParams;
|
|
1065
|
+
}
|
|
1037
1066
|
if (params.artifact !== undefined) {
|
|
1038
1067
|
query["artifact"] = params.artifact;
|
|
1039
1068
|
}
|
|
@@ -1041,19 +1070,19 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1041
1070
|
query["cache"] = params.cache;
|
|
1042
1071
|
}
|
|
1043
1072
|
if (params.cacheOnly !== undefined) {
|
|
1044
|
-
query["
|
|
1073
|
+
query["cache-only"] = params.cacheOnly;
|
|
1045
1074
|
}
|
|
1046
1075
|
if (params.cachePerm !== undefined) {
|
|
1047
|
-
query["
|
|
1076
|
+
query["cache-perm"] = params.cachePerm;
|
|
1048
1077
|
}
|
|
1049
1078
|
if (params.cacheTtl !== undefined) {
|
|
1050
|
-
query["
|
|
1079
|
+
query["cache-ttl"] = params.cacheTtl;
|
|
1051
1080
|
}
|
|
1052
1081
|
if (params.cacheTtl404 !== undefined) {
|
|
1053
|
-
query["
|
|
1082
|
+
query["cache-ttl-404"] = params.cacheTtl404;
|
|
1054
1083
|
}
|
|
1055
|
-
if (params.
|
|
1056
|
-
query["
|
|
1084
|
+
if (params.exp !== undefined) {
|
|
1085
|
+
query["exp"] = params.exp;
|
|
1057
1086
|
}
|
|
1058
1087
|
if (params.version !== undefined) {
|
|
1059
1088
|
query["version"] = params.version;
|
|
@@ -1062,11 +1091,11 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1062
1091
|
return FileApi_await(_this7.request({
|
|
1063
1092
|
path: "/{accountId}/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1064
1093
|
// @ts-ignore
|
|
1065
|
-
_this7.
|
|
1094
|
+
_this7.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1066
1095
|
// @ts-ignore
|
|
1067
|
-
_this7.
|
|
1096
|
+
_this7.encodePathParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1068
1097
|
// @ts-ignore
|
|
1069
|
-
_this7.
|
|
1098
|
+
_this7.encodePathParam("transformation", params.transformation)),
|
|
1070
1099
|
method: "GET",
|
|
1071
1100
|
headers: headers,
|
|
1072
1101
|
query: query
|
|
@@ -1087,18 +1116,18 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1087
1116
|
var _this8 = this;
|
|
1088
1117
|
var query = {};
|
|
1089
1118
|
if (params.transformationParams !== undefined) {
|
|
1090
|
-
query["
|
|
1119
|
+
query["<transformation-params>"] = params.transformationParams;
|
|
1091
1120
|
}
|
|
1092
1121
|
var headers = {};
|
|
1093
1122
|
headers["Content-Type"] = "application/json";
|
|
1094
1123
|
return FileApi_await(_this8.request({
|
|
1095
1124
|
path: "/{accountId}/save/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1096
1125
|
// @ts-ignore
|
|
1097
|
-
_this8.
|
|
1126
|
+
_this8.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1098
1127
|
// @ts-ignore
|
|
1099
|
-
_this8.
|
|
1128
|
+
_this8.encodePathParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1100
1129
|
// @ts-ignore
|
|
1101
|
-
_this8.
|
|
1130
|
+
_this8.encodePathParam("transformation", params.transformation)),
|
|
1102
1131
|
method: "POST",
|
|
1103
1132
|
headers: headers,
|
|
1104
1133
|
query: query,
|
|
@@ -1171,7 +1200,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1171
1200
|
return FolderApi_await(_this.request({
|
|
1172
1201
|
path: "/v2/accounts/{accountId}/folders/copy".replace("{".concat("accountId", "}"),
|
|
1173
1202
|
// @ts-ignore
|
|
1174
|
-
_this.
|
|
1203
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
1175
1204
|
method: "POST",
|
|
1176
1205
|
headers: headers,
|
|
1177
1206
|
query: query,
|
|
@@ -1197,7 +1226,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1197
1226
|
return FolderApi_await(_this2.request({
|
|
1198
1227
|
path: "/v2/accounts/{accountId}/folders/copy/batch".replace("{".concat("accountId", "}"),
|
|
1199
1228
|
// @ts-ignore
|
|
1200
|
-
_this2.
|
|
1229
|
+
_this2.encodePathParam("accountId", params.accountId)),
|
|
1201
1230
|
method: "POST",
|
|
1202
1231
|
headers: headers,
|
|
1203
1232
|
query: query,
|
|
@@ -1223,7 +1252,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1223
1252
|
return FolderApi_await(_this3.request({
|
|
1224
1253
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1225
1254
|
// @ts-ignore
|
|
1226
|
-
_this3.
|
|
1255
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
1227
1256
|
method: "DELETE",
|
|
1228
1257
|
headers: headers,
|
|
1229
1258
|
query: query,
|
|
@@ -1249,7 +1278,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1249
1278
|
return FolderApi_await(_this4.request({
|
|
1250
1279
|
path: "/v2/accounts/{accountId}/folders/batch".replace("{".concat("accountId", "}"),
|
|
1251
1280
|
// @ts-ignore
|
|
1252
|
-
_this4.
|
|
1281
|
+
_this4.encodePathParam("accountId", params.accountId)),
|
|
1253
1282
|
method: "DELETE",
|
|
1254
1283
|
headers: headers,
|
|
1255
1284
|
query: query,
|
|
@@ -1277,7 +1306,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1277
1306
|
return FolderApi_await(_this5.request({
|
|
1278
1307
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1279
1308
|
// @ts-ignore
|
|
1280
|
-
_this5.
|
|
1309
|
+
_this5.encodePathParam("accountId", params.accountId)),
|
|
1281
1310
|
method: "GET",
|
|
1282
1311
|
headers: headers,
|
|
1283
1312
|
query: query
|
|
@@ -1328,7 +1357,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1328
1357
|
return FolderApi_await(_this6.request({
|
|
1329
1358
|
path: "/v2/accounts/{accountId}/folders/list".replace("{".concat("accountId", "}"),
|
|
1330
1359
|
// @ts-ignore
|
|
1331
|
-
_this6.
|
|
1360
|
+
_this6.encodePathParam("accountId", params.accountId)),
|
|
1332
1361
|
method: "GET",
|
|
1333
1362
|
headers: headers,
|
|
1334
1363
|
query: query
|
|
@@ -1353,7 +1382,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1353
1382
|
return FolderApi_await(_this7.request({
|
|
1354
1383
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1355
1384
|
// @ts-ignore
|
|
1356
|
-
_this7.
|
|
1385
|
+
_this7.encodePathParam("accountId", params.accountId)),
|
|
1357
1386
|
method: "PUT",
|
|
1358
1387
|
headers: headers,
|
|
1359
1388
|
query: query,
|
|
@@ -1425,11 +1454,11 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1425
1454
|
return JobApi_await(_this.request({
|
|
1426
1455
|
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
1427
1456
|
// @ts-ignore
|
|
1428
|
-
_this.
|
|
1457
|
+
_this.encodePathParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
1429
1458
|
// @ts-ignore
|
|
1430
|
-
_this.
|
|
1459
|
+
_this.encodePathParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
1431
1460
|
// @ts-ignore
|
|
1432
|
-
_this.
|
|
1461
|
+
_this.encodePathParam("jobType", params.jobType)),
|
|
1433
1462
|
method: "DELETE",
|
|
1434
1463
|
headers: headers,
|
|
1435
1464
|
query: query
|
|
@@ -1453,11 +1482,11 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1453
1482
|
return JobApi_await(_this2.request({
|
|
1454
1483
|
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
1455
1484
|
// @ts-ignore
|
|
1456
|
-
_this2.
|
|
1485
|
+
_this2.encodePathParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
1457
1486
|
// @ts-ignore
|
|
1458
|
-
_this2.
|
|
1487
|
+
_this2.encodePathParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
1459
1488
|
// @ts-ignore
|
|
1460
|
-
_this2.
|
|
1489
|
+
_this2.encodePathParam("jobType", params.jobType)),
|
|
1461
1490
|
method: "GET",
|
|
1462
1491
|
headers: headers,
|
|
1463
1492
|
query: query
|
|
@@ -1484,7 +1513,7 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1484
1513
|
return JobApi_await(_this3.request({
|
|
1485
1514
|
path: "/v2/accounts/{accountId}/jobs".replace("{".concat("accountId", "}"),
|
|
1486
1515
|
// @ts-ignore
|
|
1487
|
-
_this3.
|
|
1516
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
1488
1517
|
method: "GET",
|
|
1489
1518
|
headers: headers,
|
|
1490
1519
|
query: query
|
|
@@ -1556,7 +1585,7 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1556
1585
|
return UploadApi_await(_this.request({
|
|
1557
1586
|
path: "/v2/accounts/{accountId}/uploads".replace("{".concat("accountId", "}"),
|
|
1558
1587
|
// @ts-ignore
|
|
1559
|
-
_this.
|
|
1588
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
1560
1589
|
method: "POST",
|
|
1561
1590
|
headers: headers,
|
|
1562
1591
|
query: query,
|
|
@@ -1582,11 +1611,11 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1582
1611
|
return UploadApi_await(_this2.request({
|
|
1583
1612
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
1584
1613
|
// @ts-ignore
|
|
1585
|
-
_this2.
|
|
1614
|
+
_this2.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1586
1615
|
// @ts-ignore
|
|
1587
|
-
_this2.
|
|
1616
|
+
_this2.encodePathParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
1588
1617
|
// @ts-ignore
|
|
1589
|
-
_this2.
|
|
1618
|
+
_this2.encodePathParam("uploadPartIndex", params.uploadPartIndex)),
|
|
1590
1619
|
method: "PUT",
|
|
1591
1620
|
headers: headers,
|
|
1592
1621
|
query: query,
|
|
@@ -1611,11 +1640,11 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1611
1640
|
return UploadApi_await(_this3.request({
|
|
1612
1641
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
1613
1642
|
// @ts-ignore
|
|
1614
|
-
_this3.
|
|
1643
|
+
_this3.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1615
1644
|
// @ts-ignore
|
|
1616
|
-
_this3.
|
|
1645
|
+
_this3.encodePathParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
1617
1646
|
// @ts-ignore
|
|
1618
|
-
_this3.
|
|
1647
|
+
_this3.encodePathParam("uploadPartIndex", params.uploadPartIndex)),
|
|
1619
1648
|
method: "GET",
|
|
1620
1649
|
headers: headers,
|
|
1621
1650
|
query: query
|
|
@@ -1639,9 +1668,9 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1639
1668
|
return UploadApi_await(_this4.request({
|
|
1640
1669
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts".replace("{".concat("accountId", "}"),
|
|
1641
1670
|
// @ts-ignore
|
|
1642
|
-
_this4.
|
|
1671
|
+
_this4.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1643
1672
|
// @ts-ignore
|
|
1644
|
-
_this4.
|
|
1673
|
+
_this4.encodePathParam("uploadId", params.uploadId)),
|
|
1645
1674
|
method: "GET",
|
|
1646
1675
|
headers: headers,
|
|
1647
1676
|
query: query
|
|
@@ -1666,7 +1695,7 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1666
1695
|
return UploadApi_await(_this5.request({
|
|
1667
1696
|
path: "/v2/accounts/{accountId}/uploads/url".replace("{".concat("accountId", "}"),
|
|
1668
1697
|
// @ts-ignore
|
|
1669
|
-
_this5.
|
|
1698
|
+
_this5.encodePathParam("accountId", params.accountId)),
|
|
1670
1699
|
method: "POST",
|
|
1671
1700
|
headers: headers,
|
|
1672
1701
|
query: query,
|
|
@@ -1725,6 +1754,7 @@ function UrlBuilder_toPropertyKey(t) { var i = UrlBuilder_toPrimitive(t, "string
|
|
|
1725
1754
|
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); }
|
|
1726
1755
|
|
|
1727
1756
|
|
|
1757
|
+
|
|
1728
1758
|
var UrlBuilder = /*#__PURE__*/function () {
|
|
1729
1759
|
function UrlBuilder() {
|
|
1730
1760
|
UrlBuilder_classCallCheck(this, UrlBuilder);
|
|
@@ -1779,11 +1809,7 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1779
1809
|
value: function getBaseUrl(params, prefix) {
|
|
1780
1810
|
var _a, _b;
|
|
1781
1811
|
var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
|
|
1782
|
-
|
|
1783
|
-
// a) Call encodeURIComponent() on the file path. (This allows file paths to contain ANY character.)
|
|
1784
|
-
// b) Replace all occurrences of "%2F" with "/". (Allows file paths to appear as hierarchical paths on the URL.)
|
|
1785
|
-
// c) Replace all occurrences of "!" with "%21". (Prevents file paths with "!" inside being treated as "query bangs".)
|
|
1786
|
-
var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/").replace(/!/g, "%21");
|
|
1812
|
+
var filePathEncoded = FilePathUtils.encodeFilePath(params.filePath);
|
|
1787
1813
|
return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
|
|
1788
1814
|
}
|
|
1789
1815
|
}, {
|