From 2abe63565fafface57a683ed065f44229c28ee5b Mon Sep 17 00:00:00 2001 From: Lawrence Wagerfield Date: Wed, 31 Jan 2024 14:47:41 +0000 Subject: [PATCH] Update to latest API spec --- src/public/shared/generated/apis/FileApi.ts | 6 +- src/public/shared/generated/apis/FolderApi.ts | 2 +- src/public/shared/generated/apis/JobApi.ts | 2 +- src/public/shared/generated/apis/UploadApi.ts | 2 +- src/public/shared/generated/models/index.ts | 62 ++++++++++++++----- 5 files changed, 54 insertions(+), 20 deletions(-) diff --git a/src/public/shared/generated/apis/FileApi.ts b/src/public/shared/generated/apis/FileApi.ts index b59c51f..16f497b 100644 --- a/src/public/shared/generated/apis/FileApi.ts +++ b/src/public/shared/generated/apis/FileApi.ts @@ -37,7 +37,7 @@ import type { // Omitted by generator (so we add manually). // @ts-ignore -import type { ProcessFileTransformationParamsParameter } from "../models"; +import type { TransformationParams } from "../models"; export interface CopyFileOperationParams { accountId: string; @@ -175,7 +175,7 @@ export interface ProcessFileParams { * - https://www.bytescale.com/docs/audio-processing-api * - https://www.bytescale.com/docs/archive-processing-api */ - transformationParams?: ProcessFileTransformationParamsParameter; + transformationParams?: TransformationParams; /** * Add this parameter and increment its value to force the file to be reprocessed. @@ -214,7 +214,7 @@ export interface ProcessFileAndSaveOperationParams { * - https://www.bytescale.com/docs/audio-processing-api * - https://www.bytescale.com/docs/archive-processing-api */ - transformationParams?: ProcessFileTransformationParamsParameter; + transformationParams?: TransformationParams; } export class FileApi extends runtime.BaseAPI { diff --git a/src/public/shared/generated/apis/FolderApi.ts b/src/public/shared/generated/apis/FolderApi.ts index 259d7d6..ec1059e 100644 --- a/src/public/shared/generated/apis/FolderApi.ts +++ b/src/public/shared/generated/apis/FolderApi.ts @@ -37,7 +37,7 @@ import type { // Omitted by generator (so we add manually). // @ts-ignore -import type { ProcessFileTransformationParamsParameter } from "../models"; +import type { TransformationParams } from "../models"; export interface CopyFolderOperationParams { accountId: string; diff --git a/src/public/shared/generated/apis/JobApi.ts b/src/public/shared/generated/apis/JobApi.ts index 417c569..598b1fb 100644 --- a/src/public/shared/generated/apis/JobApi.ts +++ b/src/public/shared/generated/apis/JobApi.ts @@ -27,7 +27,7 @@ import type { // Omitted by generator (so we add manually). // @ts-ignore -import type { ProcessFileTransformationParamsParameter } from "../models"; +import type { TransformationParams } from "../models"; export interface CancelJobParams { accountId: string; diff --git a/src/public/shared/generated/apis/UploadApi.ts b/src/public/shared/generated/apis/UploadApi.ts index c0e7e0f..e5c21a1 100644 --- a/src/public/shared/generated/apis/UploadApi.ts +++ b/src/public/shared/generated/apis/UploadApi.ts @@ -35,7 +35,7 @@ import type { // Omitted by generator (so we add manually). // @ts-ignore -import type { ProcessFileTransformationParamsParameter } from "../models"; +import type { TransformationParams } from "../models"; export interface BeginMultipartUploadOperationParams { accountId: string; diff --git a/src/public/shared/generated/models/index.ts b/src/public/shared/generated/models/index.ts index b1f1cbc..801d1e3 100644 --- a/src/public/shared/generated/models/index.ts +++ b/src/public/shared/generated/models/index.ts @@ -1477,6 +1477,12 @@ export interface ProcessFileAndSaveRequest { * @memberof ProcessFileAndSaveRequest */ destination?: FilePathDefinition; + /** + * + * @type {TransformationParams} + * @memberof ProcessFileAndSaveRequest + */ + extendedParams?: TransformationParams; /** * * @type {CopyableFileDataFileMetadata} @@ -1641,20 +1647,6 @@ export interface ProcessFileAndSaveResponseSync { */ export type ProcessFileAndSaveResponseSyncAsyncEnum = false; -/** - * @type ProcessFileTransformationParamsParameter - * - * @export - */ -export type ProcessFileTransformationParamsParameter = - | Array<{ [key: string]: ProcessFileTransformationParamsParameterOneOfValue }> - | { [key: string]: ProcessFileTransformationParamsParameterOneOfValue }; -/** - * @type ProcessFileTransformationParamsParameterOneOfValue - * - * @export - */ -export type ProcessFileTransformationParamsParameterOneOfValue = boolean | number | string; /** * Permissions applied to anonymous users who attempt to download files from a folder. * @@ -1958,6 +1950,48 @@ export type StorageLayerUpdate = | R2Storage | S3Storage | WebStorage; +/** + * @type TransformationParamValue + * A single transformation parameter provided to a Bytescale File Processing API. + * + * See TransformationParams for more information. + * @export + */ +export type TransformationParamValue = boolean | number | string; +/** + * @type TransformationParams + * Transformation parameters provided to a Bytescale File Processing API. + * + * *Array support:* + * + * Arrays are specified by repeating the same parameter name multiple times on the querystring. + * + * For example, the following querystring declares a `file` parameter as an array containing two values (`/file1.txt` and `/file2.txt`): + * + * ```?file=/file1.txt&file=/file2.txt``` + * + * The Bytescale SDKs and the ProcessFileAndSave request body (the `extendedParams` field) also support arrays of transformation parameters. These are specified by providing an array of objects as the field value instead of an object, for example: + * + * ```transformationParams: [{ file: "/file1.txt" }, { file: "/file2.txt" }]``` + * + * This structure allows parameter groups to be retained, which is important for certain transformations. For example, the Video Processing API allows developers to specify multiple clusters of `w`, `h` and `q` parameters when specifying the Adaptive Bitrate (ABR) variants in an HTTP Live Streaming (HLS) output video. + * + * *Parameters are order sensitive:* + * + * The order of the parameters may be important. Please refer to the documentation of each File Processing API for more information. + * + * *Maximum URL length:* + * + * Bytescale URLs have a maximum total length of 1000 bytes (excluding the hostname and protocol). + * + * To provide a longer list of parameters to a Bytescale File Processing API, you must use ProcessFileAndSave (POST) instead of ProcessFile (GET). This allows you to specify parameters via the ProcessFileAndSave HTTP request body (via the `extendedParams` field) instead of via the querystring. + * + * The `extendedParams` field supports up to 400KB of transformation parameter data. + * @export + */ +export type TransformationParams = + | Array<{ [key: string]: TransformationParamValue }> + | { [key: string]: TransformationParamValue }; /** * This data type specifies no update is to be performed. * @export