@bytescale/sdk 3.51.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 -57
- package/dist/browser/esm/main.mjs +82 -57
- package/dist/node/cjs/main.js +82 -57
- package/dist/node/esm/main.mjs +82 -57
- 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/runtime.d.ts +1 -1
- package/dist/worker/cjs/main.js +82 -57
- package/dist/worker/esm/main.mjs +82 -57
- package/package.json +1 -1
package/dist/worker/esm/main.mjs
CHANGED
|
@@ -272,6 +272,29 @@ var ConsoleUtils = /*#__PURE__*/function () {
|
|
|
272
272
|
}
|
|
273
273
|
}]);
|
|
274
274
|
}();
|
|
275
|
+
;// CONCATENATED MODULE: ./src/private/FilePathUtils.ts
|
|
276
|
+
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); }
|
|
277
|
+
function FilePathUtils_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
278
|
+
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); } }
|
|
279
|
+
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; }
|
|
280
|
+
function FilePathUtils_toPropertyKey(t) { var i = FilePathUtils_toPrimitive(t, "string"); return "symbol" == FilePathUtils_typeof(i) ? i : i + ""; }
|
|
281
|
+
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); }
|
|
282
|
+
var FilePathUtils = /*#__PURE__*/function () {
|
|
283
|
+
function FilePathUtils() {
|
|
284
|
+
FilePathUtils_classCallCheck(this, FilePathUtils);
|
|
285
|
+
}
|
|
286
|
+
return FilePathUtils_createClass(FilePathUtils, null, [{
|
|
287
|
+
key: "encodeFilePath",
|
|
288
|
+
value: function encodeFilePath(filePath) {
|
|
289
|
+
// To convert a Bytescale File Path into a Bytescale File URL:
|
|
290
|
+
// a) Call encodeURIComponent() on the file path. (This allows file paths to contain ANY character.)
|
|
291
|
+
// b) Replace all occurrences of "%2F" with "/". (Allows file paths to appear as hierarchical paths on the URL.)
|
|
292
|
+
// c) Replace all occurrences of "!" with "%21". (Prevents file paths with "!" inside being treated as "query bangs".)
|
|
293
|
+
// SYNC: FileUrlUtils.makeFileUrl (internal)
|
|
294
|
+
return encodeURIComponent(filePath).replace(/%2F/g, "/").replace(/!/g, "%21");
|
|
295
|
+
}
|
|
296
|
+
}]);
|
|
297
|
+
}();
|
|
275
298
|
;// CONCATENATED MODULE: ./src/public/shared/generated/runtime.ts
|
|
276
299
|
function runtime_await(value, then, direct) {
|
|
277
300
|
if (direct) {
|
|
@@ -329,6 +352,7 @@ function runtime_toPropertyKey(t) { var i = runtime_toPrimitive(t, "string"); re
|
|
|
329
352
|
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); }
|
|
330
353
|
|
|
331
354
|
|
|
355
|
+
|
|
332
356
|
var BytescaleApiClientConfigUtils = /*#__PURE__*/function () {
|
|
333
357
|
function BytescaleApiClientConfigUtils() {
|
|
334
358
|
runtime_classCallCheck(this, BytescaleApiClientConfigUtils);
|
|
@@ -431,15 +455,14 @@ var BaseAPI = /*#__PURE__*/function () {
|
|
|
431
455
|
}
|
|
432
456
|
}
|
|
433
457
|
}, {
|
|
434
|
-
key: "
|
|
435
|
-
value: function
|
|
458
|
+
key: "encodePathParam",
|
|
459
|
+
value: function encodePathParam(paramName, paramValue) {
|
|
436
460
|
if (paramName === "filePath") {
|
|
437
461
|
if (!paramValue.startsWith("/")) {
|
|
438
462
|
// Non-obvious errors are returned by the Bytescale CDN if forward slashes are omitted, so catch it client-side:
|
|
439
463
|
throw new Error("The 'filePath' parameter must begin with a '/' character.");
|
|
440
464
|
}
|
|
441
|
-
|
|
442
|
-
return paramValue;
|
|
465
|
+
return FilePathUtils.encodeFilePath(paramValue);
|
|
443
466
|
}
|
|
444
467
|
return encodeURIComponent(paramValue);
|
|
445
468
|
}
|
|
@@ -781,7 +804,7 @@ var CacheApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
781
804
|
return CacheApi_await(_this.request({
|
|
782
805
|
path: "/v2/accounts/{accountId}/cache/reset".replace("{".concat("accountId", "}"),
|
|
783
806
|
// @ts-ignore
|
|
784
|
-
_this.
|
|
807
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
785
808
|
method: "POST",
|
|
786
809
|
headers: headers,
|
|
787
810
|
query: query,
|
|
@@ -854,7 +877,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
854
877
|
return FileApi_await(_this.request({
|
|
855
878
|
path: "/v2/accounts/{accountId}/files/copy".replace("{".concat("accountId", "}"),
|
|
856
879
|
// @ts-ignore
|
|
857
|
-
_this.
|
|
880
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
858
881
|
method: "POST",
|
|
859
882
|
headers: headers,
|
|
860
883
|
query: query,
|
|
@@ -880,7 +903,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
880
903
|
return FileApi_await(_this2.request({
|
|
881
904
|
path: "/v2/accounts/{accountId}/files/copy/batch".replace("{".concat("accountId", "}"),
|
|
882
905
|
// @ts-ignore
|
|
883
|
-
_this2.
|
|
906
|
+
_this2.encodePathParam("accountId", params.accountId)),
|
|
884
907
|
method: "POST",
|
|
885
908
|
headers: headers,
|
|
886
909
|
query: query,
|
|
@@ -908,7 +931,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
908
931
|
return FileApi_await(_this3.request({
|
|
909
932
|
path: "/v2/accounts/{accountId}/files".replace("{".concat("accountId", "}"),
|
|
910
933
|
// @ts-ignore
|
|
911
|
-
_this3.
|
|
934
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
912
935
|
method: "DELETE",
|
|
913
936
|
headers: headers,
|
|
914
937
|
query: query
|
|
@@ -933,7 +956,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
933
956
|
return FileApi_await(_this4.request({
|
|
934
957
|
path: "/v2/accounts/{accountId}/files/batch".replace("{".concat("accountId", "}"),
|
|
935
958
|
// @ts-ignore
|
|
936
|
-
_this4.
|
|
959
|
+
_this4.encodePathParam("accountId", params.accountId)),
|
|
937
960
|
method: "DELETE",
|
|
938
961
|
headers: headers,
|
|
939
962
|
query: query,
|
|
@@ -958,10 +981,13 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
958
981
|
query["cache"] = params.cache;
|
|
959
982
|
}
|
|
960
983
|
if (params.cacheTtl !== undefined) {
|
|
961
|
-
query["
|
|
984
|
+
query["cache-ttl"] = params.cacheTtl;
|
|
962
985
|
}
|
|
963
986
|
if (params.cacheTtl404 !== undefined) {
|
|
964
|
-
query["
|
|
987
|
+
query["cache-ttl-404"] = params.cacheTtl404;
|
|
988
|
+
}
|
|
989
|
+
if (params.exp !== undefined) {
|
|
990
|
+
query["exp"] = params.exp;
|
|
965
991
|
}
|
|
966
992
|
if (params.version !== undefined) {
|
|
967
993
|
query["version"] = params.version;
|
|
@@ -970,9 +996,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
970
996
|
return FileApi_await(_this5.request({
|
|
971
997
|
path: "/{accountId}/raw{filePath}".replace("{".concat("accountId", "}"),
|
|
972
998
|
// @ts-ignore
|
|
973
|
-
_this5.
|
|
999
|
+
_this5.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
974
1000
|
// @ts-ignore
|
|
975
|
-
_this5.
|
|
1001
|
+
_this5.encodePathParam("filePath", params.filePath)),
|
|
976
1002
|
method: "GET",
|
|
977
1003
|
headers: headers,
|
|
978
1004
|
query: query
|
|
@@ -999,7 +1025,7 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
999
1025
|
return FileApi_await(_this6.request({
|
|
1000
1026
|
path: "/v2/accounts/{accountId}/files/details".replace("{".concat("accountId", "}"),
|
|
1001
1027
|
// @ts-ignore
|
|
1002
|
-
_this6.
|
|
1028
|
+
_this6.encodePathParam("accountId", params.accountId)),
|
|
1003
1029
|
method: "GET",
|
|
1004
1030
|
headers: headers,
|
|
1005
1031
|
query: query
|
|
@@ -1019,6 +1045,9 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1019
1045
|
try {
|
|
1020
1046
|
var _this7 = this;
|
|
1021
1047
|
var query = {};
|
|
1048
|
+
if (params.transformationParams !== undefined) {
|
|
1049
|
+
query["<transformation-params>"] = params.transformationParams;
|
|
1050
|
+
}
|
|
1022
1051
|
if (params.artifact !== undefined) {
|
|
1023
1052
|
query["artifact"] = params.artifact;
|
|
1024
1053
|
}
|
|
@@ -1026,19 +1055,19 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1026
1055
|
query["cache"] = params.cache;
|
|
1027
1056
|
}
|
|
1028
1057
|
if (params.cacheOnly !== undefined) {
|
|
1029
|
-
query["
|
|
1058
|
+
query["cache-only"] = params.cacheOnly;
|
|
1030
1059
|
}
|
|
1031
1060
|
if (params.cachePerm !== undefined) {
|
|
1032
|
-
query["
|
|
1061
|
+
query["cache-perm"] = params.cachePerm;
|
|
1033
1062
|
}
|
|
1034
1063
|
if (params.cacheTtl !== undefined) {
|
|
1035
|
-
query["
|
|
1064
|
+
query["cache-ttl"] = params.cacheTtl;
|
|
1036
1065
|
}
|
|
1037
1066
|
if (params.cacheTtl404 !== undefined) {
|
|
1038
|
-
query["
|
|
1067
|
+
query["cache-ttl-404"] = params.cacheTtl404;
|
|
1039
1068
|
}
|
|
1040
|
-
if (params.
|
|
1041
|
-
query["
|
|
1069
|
+
if (params.exp !== undefined) {
|
|
1070
|
+
query["exp"] = params.exp;
|
|
1042
1071
|
}
|
|
1043
1072
|
if (params.version !== undefined) {
|
|
1044
1073
|
query["version"] = params.version;
|
|
@@ -1047,11 +1076,11 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1047
1076
|
return FileApi_await(_this7.request({
|
|
1048
1077
|
path: "/{accountId}/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1049
1078
|
// @ts-ignore
|
|
1050
|
-
_this7.
|
|
1079
|
+
_this7.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1051
1080
|
// @ts-ignore
|
|
1052
|
-
_this7.
|
|
1081
|
+
_this7.encodePathParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1053
1082
|
// @ts-ignore
|
|
1054
|
-
_this7.
|
|
1083
|
+
_this7.encodePathParam("transformation", params.transformation)),
|
|
1055
1084
|
method: "GET",
|
|
1056
1085
|
headers: headers,
|
|
1057
1086
|
query: query
|
|
@@ -1072,18 +1101,18 @@ var FileApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1072
1101
|
var _this8 = this;
|
|
1073
1102
|
var query = {};
|
|
1074
1103
|
if (params.transformationParams !== undefined) {
|
|
1075
|
-
query["
|
|
1104
|
+
query["<transformation-params>"] = params.transformationParams;
|
|
1076
1105
|
}
|
|
1077
1106
|
var headers = {};
|
|
1078
1107
|
headers["Content-Type"] = "application/json";
|
|
1079
1108
|
return FileApi_await(_this8.request({
|
|
1080
1109
|
path: "/{accountId}/save/{transformation}{filePath}".replace("{".concat("accountId", "}"),
|
|
1081
1110
|
// @ts-ignore
|
|
1082
|
-
_this8.
|
|
1111
|
+
_this8.encodePathParam("accountId", params.accountId)).replace("{".concat("filePath", "}"),
|
|
1083
1112
|
// @ts-ignore
|
|
1084
|
-
_this8.
|
|
1113
|
+
_this8.encodePathParam("filePath", params.filePath)).replace("{".concat("transformation", "}"),
|
|
1085
1114
|
// @ts-ignore
|
|
1086
|
-
_this8.
|
|
1115
|
+
_this8.encodePathParam("transformation", params.transformation)),
|
|
1087
1116
|
method: "POST",
|
|
1088
1117
|
headers: headers,
|
|
1089
1118
|
query: query,
|
|
@@ -1156,7 +1185,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1156
1185
|
return FolderApi_await(_this.request({
|
|
1157
1186
|
path: "/v2/accounts/{accountId}/folders/copy".replace("{".concat("accountId", "}"),
|
|
1158
1187
|
// @ts-ignore
|
|
1159
|
-
_this.
|
|
1188
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
1160
1189
|
method: "POST",
|
|
1161
1190
|
headers: headers,
|
|
1162
1191
|
query: query,
|
|
@@ -1182,7 +1211,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1182
1211
|
return FolderApi_await(_this2.request({
|
|
1183
1212
|
path: "/v2/accounts/{accountId}/folders/copy/batch".replace("{".concat("accountId", "}"),
|
|
1184
1213
|
// @ts-ignore
|
|
1185
|
-
_this2.
|
|
1214
|
+
_this2.encodePathParam("accountId", params.accountId)),
|
|
1186
1215
|
method: "POST",
|
|
1187
1216
|
headers: headers,
|
|
1188
1217
|
query: query,
|
|
@@ -1208,7 +1237,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1208
1237
|
return FolderApi_await(_this3.request({
|
|
1209
1238
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1210
1239
|
// @ts-ignore
|
|
1211
|
-
_this3.
|
|
1240
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
1212
1241
|
method: "DELETE",
|
|
1213
1242
|
headers: headers,
|
|
1214
1243
|
query: query,
|
|
@@ -1234,7 +1263,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1234
1263
|
return FolderApi_await(_this4.request({
|
|
1235
1264
|
path: "/v2/accounts/{accountId}/folders/batch".replace("{".concat("accountId", "}"),
|
|
1236
1265
|
// @ts-ignore
|
|
1237
|
-
_this4.
|
|
1266
|
+
_this4.encodePathParam("accountId", params.accountId)),
|
|
1238
1267
|
method: "DELETE",
|
|
1239
1268
|
headers: headers,
|
|
1240
1269
|
query: query,
|
|
@@ -1262,7 +1291,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1262
1291
|
return FolderApi_await(_this5.request({
|
|
1263
1292
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1264
1293
|
// @ts-ignore
|
|
1265
|
-
_this5.
|
|
1294
|
+
_this5.encodePathParam("accountId", params.accountId)),
|
|
1266
1295
|
method: "GET",
|
|
1267
1296
|
headers: headers,
|
|
1268
1297
|
query: query
|
|
@@ -1313,7 +1342,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1313
1342
|
return FolderApi_await(_this6.request({
|
|
1314
1343
|
path: "/v2/accounts/{accountId}/folders/list".replace("{".concat("accountId", "}"),
|
|
1315
1344
|
// @ts-ignore
|
|
1316
|
-
_this6.
|
|
1345
|
+
_this6.encodePathParam("accountId", params.accountId)),
|
|
1317
1346
|
method: "GET",
|
|
1318
1347
|
headers: headers,
|
|
1319
1348
|
query: query
|
|
@@ -1338,7 +1367,7 @@ var FolderApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1338
1367
|
return FolderApi_await(_this7.request({
|
|
1339
1368
|
path: "/v2/accounts/{accountId}/folders".replace("{".concat("accountId", "}"),
|
|
1340
1369
|
// @ts-ignore
|
|
1341
|
-
_this7.
|
|
1370
|
+
_this7.encodePathParam("accountId", params.accountId)),
|
|
1342
1371
|
method: "PUT",
|
|
1343
1372
|
headers: headers,
|
|
1344
1373
|
query: query,
|
|
@@ -1410,11 +1439,11 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1410
1439
|
return JobApi_await(_this.request({
|
|
1411
1440
|
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
1412
1441
|
// @ts-ignore
|
|
1413
|
-
_this.
|
|
1442
|
+
_this.encodePathParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
1414
1443
|
// @ts-ignore
|
|
1415
|
-
_this.
|
|
1444
|
+
_this.encodePathParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
1416
1445
|
// @ts-ignore
|
|
1417
|
-
_this.
|
|
1446
|
+
_this.encodePathParam("jobType", params.jobType)),
|
|
1418
1447
|
method: "DELETE",
|
|
1419
1448
|
headers: headers,
|
|
1420
1449
|
query: query
|
|
@@ -1438,11 +1467,11 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1438
1467
|
return JobApi_await(_this2.request({
|
|
1439
1468
|
path: "/v2/accounts/{accountId}/jobs/{jobType}/{jobId}".replace("{".concat("accountId", "}"),
|
|
1440
1469
|
// @ts-ignore
|
|
1441
|
-
_this2.
|
|
1470
|
+
_this2.encodePathParam("accountId", params.accountId)).replace("{".concat("jobId", "}"),
|
|
1442
1471
|
// @ts-ignore
|
|
1443
|
-
_this2.
|
|
1472
|
+
_this2.encodePathParam("jobId", params.jobId)).replace("{".concat("jobType", "}"),
|
|
1444
1473
|
// @ts-ignore
|
|
1445
|
-
_this2.
|
|
1474
|
+
_this2.encodePathParam("jobType", params.jobType)),
|
|
1446
1475
|
method: "GET",
|
|
1447
1476
|
headers: headers,
|
|
1448
1477
|
query: query
|
|
@@ -1469,7 +1498,7 @@ var JobApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1469
1498
|
return JobApi_await(_this3.request({
|
|
1470
1499
|
path: "/v2/accounts/{accountId}/jobs".replace("{".concat("accountId", "}"),
|
|
1471
1500
|
// @ts-ignore
|
|
1472
|
-
_this3.
|
|
1501
|
+
_this3.encodePathParam("accountId", params.accountId)),
|
|
1473
1502
|
method: "GET",
|
|
1474
1503
|
headers: headers,
|
|
1475
1504
|
query: query
|
|
@@ -1541,7 +1570,7 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1541
1570
|
return UploadApi_await(_this.request({
|
|
1542
1571
|
path: "/v2/accounts/{accountId}/uploads".replace("{".concat("accountId", "}"),
|
|
1543
1572
|
// @ts-ignore
|
|
1544
|
-
_this.
|
|
1573
|
+
_this.encodePathParam("accountId", params.accountId)),
|
|
1545
1574
|
method: "POST",
|
|
1546
1575
|
headers: headers,
|
|
1547
1576
|
query: query,
|
|
@@ -1567,11 +1596,11 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1567
1596
|
return UploadApi_await(_this2.request({
|
|
1568
1597
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
1569
1598
|
// @ts-ignore
|
|
1570
|
-
_this2.
|
|
1599
|
+
_this2.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1571
1600
|
// @ts-ignore
|
|
1572
|
-
_this2.
|
|
1601
|
+
_this2.encodePathParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
1573
1602
|
// @ts-ignore
|
|
1574
|
-
_this2.
|
|
1603
|
+
_this2.encodePathParam("uploadPartIndex", params.uploadPartIndex)),
|
|
1575
1604
|
method: "PUT",
|
|
1576
1605
|
headers: headers,
|
|
1577
1606
|
query: query,
|
|
@@ -1596,11 +1625,11 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1596
1625
|
return UploadApi_await(_this3.request({
|
|
1597
1626
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts/{uploadPartIndex}".replace("{".concat("accountId", "}"),
|
|
1598
1627
|
// @ts-ignore
|
|
1599
|
-
_this3.
|
|
1628
|
+
_this3.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1600
1629
|
// @ts-ignore
|
|
1601
|
-
_this3.
|
|
1630
|
+
_this3.encodePathParam("uploadId", params.uploadId)).replace("{".concat("uploadPartIndex", "}"),
|
|
1602
1631
|
// @ts-ignore
|
|
1603
|
-
_this3.
|
|
1632
|
+
_this3.encodePathParam("uploadPartIndex", params.uploadPartIndex)),
|
|
1604
1633
|
method: "GET",
|
|
1605
1634
|
headers: headers,
|
|
1606
1635
|
query: query
|
|
@@ -1624,9 +1653,9 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1624
1653
|
return UploadApi_await(_this4.request({
|
|
1625
1654
|
path: "/v2/accounts/{accountId}/uploads/{uploadId}/parts".replace("{".concat("accountId", "}"),
|
|
1626
1655
|
// @ts-ignore
|
|
1627
|
-
_this4.
|
|
1656
|
+
_this4.encodePathParam("accountId", params.accountId)).replace("{".concat("uploadId", "}"),
|
|
1628
1657
|
// @ts-ignore
|
|
1629
|
-
_this4.
|
|
1658
|
+
_this4.encodePathParam("uploadId", params.uploadId)),
|
|
1630
1659
|
method: "GET",
|
|
1631
1660
|
headers: headers,
|
|
1632
1661
|
query: query
|
|
@@ -1651,7 +1680,7 @@ var UploadApi = /*#__PURE__*/function (_runtime$BaseAPI) {
|
|
|
1651
1680
|
return UploadApi_await(_this5.request({
|
|
1652
1681
|
path: "/v2/accounts/{accountId}/uploads/url".replace("{".concat("accountId", "}"),
|
|
1653
1682
|
// @ts-ignore
|
|
1654
|
-
_this5.
|
|
1683
|
+
_this5.encodePathParam("accountId", params.accountId)),
|
|
1655
1684
|
method: "POST",
|
|
1656
1685
|
headers: headers,
|
|
1657
1686
|
query: query,
|
|
@@ -1710,6 +1739,7 @@ function UrlBuilder_toPropertyKey(t) { var i = UrlBuilder_toPrimitive(t, "string
|
|
|
1710
1739
|
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); }
|
|
1711
1740
|
|
|
1712
1741
|
|
|
1742
|
+
|
|
1713
1743
|
var UrlBuilder = /*#__PURE__*/function () {
|
|
1714
1744
|
function UrlBuilder() {
|
|
1715
1745
|
UrlBuilder_classCallCheck(this, UrlBuilder);
|
|
@@ -1764,12 +1794,7 @@ var UrlBuilder = /*#__PURE__*/function () {
|
|
|
1764
1794
|
value: function getBaseUrl(params, prefix) {
|
|
1765
1795
|
var _a, _b;
|
|
1766
1796
|
var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
|
|
1767
|
-
|
|
1768
|
-
// a) Call encodeURIComponent() on the file path. (This allows file paths to contain ANY character.)
|
|
1769
|
-
// b) Replace all occurrences of "%2F" with "/". (Allows file paths to appear as hierarchical paths on the URL.)
|
|
1770
|
-
// c) Replace all occurrences of "!" with "%21". (Prevents file paths with "!" inside being treated as "query bangs".)
|
|
1771
|
-
// SYNC: FileUrlUtils.makeFileUrl (internal)
|
|
1772
|
-
var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/").replace(/!/g, "%21");
|
|
1797
|
+
var filePathEncoded = FilePathUtils.encodeFilePath(params.filePath);
|
|
1773
1798
|
return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
|
|
1774
1799
|
}
|
|
1775
1800
|
}, {
|