Skip to content

Commit

Permalink
Update to latest API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwagerfield committed Jan 31, 2024
1 parent c91142e commit 2abe635
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/public/shared/generated/apis/FileApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/public/shared/generated/apis/FolderApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/public/shared/generated/apis/JobApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/public/shared/generated/apis/UploadApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
62 changes: 48 additions & 14 deletions src/public/shared/generated/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,12 @@ export interface ProcessFileAndSaveRequest {
* @memberof ProcessFileAndSaveRequest
*/
destination?: FilePathDefinition;
/**
*
* @type {TransformationParams}
* @memberof ProcessFileAndSaveRequest
*/
extendedParams?: TransformationParams;
/**
*
* @type {CopyableFileDataFileMetadata}
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2abe635

Please sign in to comment.