@bytescale/sdk 3.25.0 → 3.27.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.
@@ -600,6 +600,7 @@ function querystring(params) {
600
600
  }
601
601
  function querystringSingleKey(key, value) {
602
602
  if (value instanceof Object) {
603
+ // Matches 'array' or 'object' (which we want).
603
604
  return querystring(value);
604
605
  }
605
606
  return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(String(value)));
@@ -1654,7 +1655,8 @@ var UrlBuilder = /*#__PURE__*/function () {
1654
1655
  value: function getBaseUrl(params, prefix) {
1655
1656
  var _a, _b;
1656
1657
  var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
1657
- return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1658
+ var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/");
1659
+ return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
1658
1660
  }
1659
1661
  }, {
1660
1662
  key: "getCommonTransformationQueryParams",
@@ -585,6 +585,7 @@ function querystring(params) {
585
585
  }
586
586
  function querystringSingleKey(key, value) {
587
587
  if (value instanceof Object) {
588
+ // Matches 'array' or 'object' (which we want).
588
589
  return querystring(value);
589
590
  }
590
591
  return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(String(value)));
@@ -1639,7 +1640,8 @@ var UrlBuilder = /*#__PURE__*/function () {
1639
1640
  value: function getBaseUrl(params, prefix) {
1640
1641
  var _a, _b;
1641
1642
  var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
1642
- return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1643
+ var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/");
1644
+ return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
1643
1645
  }
1644
1646
  }, {
1645
1647
  key: "getCommonTransformationQueryParams",
@@ -600,6 +600,7 @@ function querystring(params) {
600
600
  }
601
601
  function querystringSingleKey(key, value) {
602
602
  if (value instanceof Object) {
603
+ // Matches 'array' or 'object' (which we want).
603
604
  return querystring(value);
604
605
  }
605
606
  return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(String(value)));
@@ -1654,7 +1655,8 @@ var UrlBuilder = /*#__PURE__*/function () {
1654
1655
  value: function getBaseUrl(params, prefix) {
1655
1656
  var _a, _b;
1656
1657
  var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
1657
- return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1658
+ var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/");
1659
+ return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
1658
1660
  }
1659
1661
  }, {
1660
1662
  key: "getCommonTransformationQueryParams",
@@ -587,6 +587,7 @@ function querystring(params) {
587
587
  }
588
588
  function querystringSingleKey(key, value) {
589
589
  if (value instanceof Object) {
590
+ // Matches 'array' or 'object' (which we want).
590
591
  return querystring(value);
591
592
  }
592
593
  return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(String(value)));
@@ -1641,7 +1642,8 @@ var UrlBuilder = /*#__PURE__*/function () {
1641
1642
  value: function getBaseUrl(params, prefix) {
1642
1643
  var _a, _b;
1643
1644
  var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
1644
- return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1645
+ var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/");
1646
+ return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
1645
1647
  }
1646
1648
  }, {
1647
1649
  key: "getCommonTransformationQueryParams",
@@ -10,7 +10,8 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from "../runtime";
13
- import type { AsyncResponse, CopyFileBatchRequest, CopyFileRequest, CopyFileResponse, DeleteFileBatchRequest, FileDetails, ProcessFileAndSaveRequest, ProcessFileAndSaveResponse, ProcessFileTransformationParamsParameterValue } from "../models";
13
+ import type { AsyncResponse, CopyFileBatchRequest, CopyFileRequest, CopyFileResponse, DeleteFileBatchRequest, FileDetails, ProcessFileAndSaveRequest, ProcessFileAndSaveResponse } from "../models";
14
+ import type { ProcessFileTransformationParamsParameter } from "../models";
14
15
  export interface CopyFileOperationParams {
15
16
  accountId: string;
16
17
  copyFileRequest: CopyFileRequest;
@@ -124,9 +125,7 @@ export interface ProcessFileParams {
124
125
  * - https://www.bytescale.com/docs/audio-processing-api
125
126
  * - https://www.bytescale.com/docs/archive-processing-api
126
127
  */
127
- transformationParams?: {
128
- [key: string]: ProcessFileTransformationParamsParameterValue;
129
- };
128
+ transformationParams?: ProcessFileTransformationParamsParameter;
130
129
  /**
131
130
  * Add this parameter and increment its value to force the file to be reprocessed.
132
131
  *
@@ -159,9 +158,7 @@ export interface ProcessFileAndSaveOperationParams {
159
158
  * - https://www.bytescale.com/docs/audio-processing-api
160
159
  * - https://www.bytescale.com/docs/archive-processing-api
161
160
  */
162
- transformationParams?: {
163
- [key: string]: ProcessFileTransformationParamsParameterValue;
164
- };
161
+ transformationParams?: ProcessFileTransformationParamsParameter;
165
162
  }
166
163
  export declare class FileApi extends runtime.BaseAPI {
167
164
  /**
@@ -1586,11 +1586,21 @@ export interface ProcessFileAndSaveResponseSync {
1586
1586
  */
1587
1587
  export declare type ProcessFileAndSaveResponseSyncAsyncEnum = false;
1588
1588
  /**
1589
- * @type ProcessFileTransformationParamsParameterValue
1589
+ * @type ProcessFileTransformationParamsParameter
1590
1590
  *
1591
1591
  * @export
1592
1592
  */
1593
- export declare type ProcessFileTransformationParamsParameterValue = boolean | number | string;
1593
+ export declare type ProcessFileTransformationParamsParameter = Array<{
1594
+ [key: string]: ProcessFileTransformationParamsParameterOneOfValue;
1595
+ }> | {
1596
+ [key: string]: ProcessFileTransformationParamsParameterOneOfValue;
1597
+ };
1598
+ /**
1599
+ * @type ProcessFileTransformationParamsParameterOneOfValue
1600
+ *
1601
+ * @export
1602
+ */
1603
+ export declare type ProcessFileTransformationParamsParameterOneOfValue = boolean | number | string;
1594
1604
  /**
1595
1605
  * Permissions applied to anonymous users who attempt to download files from a folder.
1596
1606
  *
@@ -600,6 +600,7 @@ function querystring(params) {
600
600
  }
601
601
  function querystringSingleKey(key, value) {
602
602
  if (value instanceof Object) {
603
+ // Matches 'array' or 'object' (which we want).
603
604
  return querystring(value);
604
605
  }
605
606
  return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(String(value)));
@@ -1654,7 +1655,8 @@ var UrlBuilder = /*#__PURE__*/function () {
1654
1655
  value: function getBaseUrl(params, prefix) {
1655
1656
  var _a, _b;
1656
1657
  var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
1657
- return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1658
+ var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/");
1659
+ return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
1658
1660
  }
1659
1661
  }, {
1660
1662
  key: "getCommonTransformationQueryParams",
@@ -585,6 +585,7 @@ function querystring(params) {
585
585
  }
586
586
  function querystringSingleKey(key, value) {
587
587
  if (value instanceof Object) {
588
+ // Matches 'array' or 'object' (which we want).
588
589
  return querystring(value);
589
590
  }
590
591
  return "".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(String(value)));
@@ -1639,7 +1640,8 @@ var UrlBuilder = /*#__PURE__*/function () {
1639
1640
  value: function getBaseUrl(params, prefix) {
1640
1641
  var _a, _b;
1641
1642
  var cdnUrl = (_b = (_a = params.options) === null || _a === void 0 ? void 0 : _a.cdnUrl) !== null && _b !== void 0 ? _b : BytescaleApiClientConfigUtils.defaultCdnUrl;
1642
- return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(params.filePath);
1643
+ var filePathEncoded = encodeURIComponent(params.filePath).replace(/%2F/g, "/");
1644
+ return "".concat(cdnUrl, "/").concat(params.accountId, "/").concat(prefix).concat(filePathEncoded);
1643
1645
  }
1644
1646
  }, {
1645
1647
  key: "getCommonTransformationQueryParams",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytescale/sdk",
3
- "version": "3.25.0",
3
+ "version": "3.27.0",
4
4
  "description": "Bytescale JavaScript SDK",
5
5
  "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)",
6
6
  "license": "MIT",