Options
All
  • Public
  • Public/Protected
  • All
Menu


Javascript SDK for the Filestack API and content management system.



What's in the box?

  • A multi-part uploader powered on the backend by the Filestack CIN.
  • An interface to the Filestack Processing Engine for transforming assets via URLs.
  • The Filestack Picker - an upload widget for the web that integrates over a dozen cloud providers and provides pre-upload image editing.

Installation

npm install filestack-js

Usage

Browsers

ES module:

import * as filestack from 'filestack-js';
const client = filestack.init('apikey');

UMD module:

<script src="//static.filestackapi.com/filestack-js/1.x.x/filestack.min.js"></script>
<script>
  const client = filestack.init('apikey');
</script>

Node

CommonJS module:

const client = require('filestack-js').init('apikey');

Module Overview

The package.json specifies two separate modules:

  • main for the CommonJS module (intended for Node runtimes)
  • browser for the pre-bundled ES module (intended for browser runtimes)

Node projects which depend on filestack-js will follow the main field in package.json. When building for the browser, newer tools (like Webpack, Rollup, and Parcel) follow the browser field, which will resolve to the pre-bundled ES module. Both modules follow the same API, but some methods behave differently based on their runtime. For example, client.upload treats the file argument as a file path in Node but in browsers it assumes a Blob object.

The pre-bundled browser module is also available in UMD format. This is useful if you are using script tags on a web page instead of bundling your application. It can be retrieved from both the Filestack CDN and the unpkg CDN:

Live examples (JSFiddle)

Upload image
Open picker
Open picker in inline mode
Crop images
Multiple drop panes
Preview
Import using RequireJS
Retrieve image data
Transform image
Custom Picker CSS
Assign file to user

Examples can be run locally with:

npm run examples

Picker Quick Start

If you are here to use the picker widget, it can be initialized from the Filestack client by calling client.picker(options). Options for the picker are documented here.

The picker instance returned from client.picker can be controlled with a few methods:

  • open - Create the application and mount it into the DOM based on the displayMode.
  • close - Close the application and remove its resources from the DOM.
  • crop(files) - Create the application, mount it, and pre-select the passed files for cropping.
  • cancel - Cancel all uploads controlled by this instance.

Please see our examples above to learn more about customizing the picker for your use case.

API Documentation

https://filestack.github.io/filestack-js/

Promises

This library requires an environment that implements the Promise object spec. If you target IE11 or iOS before 8.0 you will need to add a Promise polyfill to your page or application.

Polyfills we recommend:

Module (for bundling):

Script (for script tag):

Development

Most tests in this library are expected to interface with actual backend services. Because we like to run tests during development, these services are mocked during unit testing.

All tests are using Mocha. Browser tests are run with Karma.

To run units:

npm test

To run integration tests:

npm run test:integration

Integration tests require a .env file in the root of your project with the following fields:

BROWSERSTACK_USERNAME=
BROWSERSTACK_ACCESS_KEY=
TEST_APIKEY=
TEST_CLOUD_APIKEY=
TEST_INTELLIGENT_APIKEY=
TEST_SECURE_APIKEY=
TEST_SIGNATURE=
TEST_POLICY=
TEST_FILELINK=
TEST_SECURE_FILELINK=

You will need to acquire this data from a Filestack developer if you plan on running the integration suite.

Contributing

We follow the conventional commits specification to ensure consistent commit messages and changelog formatting.

Index

Enumerations

Classes

Interfaces

Variables

Functions

Object literals

Variables

ENV

ENV: any

Private Const MIN_CHUNK_SIZE

MIN_CHUNK_SIZE: number = 32 * 1024

Private Const PICKER_KEY

PICKER_KEY: "__fs_picker_token" = "__fs_picker_token"

Private Const PICKER_VERSION

PICKER_VERSION: "1.2.6" = "1.2.6"

Private Let config

config: Config

Const instance

instance: Ajv = (new validator())

navigator

navigator: any

Private Const request

request: agent.SuperAgentStatic = agent

Let validator

validator: object = Ajv

Type declaration

    • (options?: Options): Ajv
    • Parameters

      • Optional options: Options

      Returns Ajv

  • constructor: function
    • new __type(options?: Options): Ajv
    • Parameters

      • Optional options: Options

      Returns Ajv

  • $dataMetaSchema: object
  • MissingRefError: MissingRefError
  • ValidationError: ValidationError

Const version

version: "@{VERSION}" = "@{VERSION}"

filestack-js version. Interpolated at build time.

window

window: any

Functions

Private Const arrayToString

  • arrayToString(arr: any[]): string

Private Const b64toBlob

  • b64toBlob(b64Data: string, sliceSize?: number): Blob
  • Convert encoded base64 string or dataURI to blob

    Parameters

    • b64Data: string
    • Default value sliceSize: number = 512

      Byte quantity to split data into

    Returns Blob

Private Const calcMD5

  • calcMD5(data: any): string
  • Calculates a MD5 checksum for passed buffer

    Parameters

    • data: any

      Data to be hashed

    Returns string

    base64 encoded MD5 hash

Private Const checkOptions

  • checkOptions(name: string, allowed: any, options?: any): __type
  • Check config options

    Parameters

    • name: string
    • allowed: any
    • Default value options: any = {}

    Returns __type

Const closeFile

  • closeFile(): any

Private Const commitPart

Private Const complete

  • complete(etags: string, __namedParameters: object): Promise<any>
  • Completes upload flow (/multipart/complete)

    Parameters

    • etags: string

      An array of etags from each S3 part

    • __namedParameters: object

    Returns Promise<any>

Const escapeValue

  • escapeValue(value: any): any

Private Const flowControl

  • flowControl(ctx: Context, func: any): (Anonymous function)
  • Returns a Promise based on the flow state If the flow is paused it will return a Promise that resolves when resumed If the flow failed it will resolve harmlessly

    Parameters

    • ctx: Context
    • func: any

      function that returns a Promise

    Returns (Anonymous function)

Private Const formatETags

  • formatETags(etags: any): string
  • Convert array of Etags into format for /multipart/complete call

    Parameters

    • etags: any

      Array of Etag strings

    Returns string

Private Const gc

Private Const getFile

  • getFile(fileOrString: any): Promise<Blob>
  • getFile(inputFile: string | Buffer): Promise<FileObj>
  • Get a Blob from a File or string. Given a file path, returns a file object

    Parameters

    • fileOrString: any

    Returns Promise<Blob>

  • Get a Blob from a File or string. Given a file path, returns a file object

    Parameters

    • inputFile: string | Buffer

      A valid path to a file on your filesystem or buffer.

    Returns Promise<FileObj>

Private Const getFormData

  • getFormData(fields: any, __namedParameters: object): __type
  • Generates multi-part fields for all requests

    Parameters

    • fields: any

      Object containing form data keys

    • __namedParameters: object
      • store: any

    Returns __type

Private Const getHost

  • getHost(host?: string): string

Private Const getLocationURL

  • getLocationURL(url: string): string

Const getMimetype

  • getMimetype(buffer: any): any

Private Const getName

  • getName(file: any, cfg: any): any

Private Const getPart

  • Reads a slice of a file based on the current part. Given a file with a valid descriptor this will return a part object The part object represents a chunk of the file

    Parameters

    Returns Promise<object>

  • Reads a slice of a file based on the current part. Given a file with a valid descriptor this will return a part object The part object represents a chunk of the file

    Parameters

    Returns Promise<PartObj>

Private Const getProgress

  • getProgress(__namedParameters: object): object

Private Const getRange

  • getRange(__namedParameters: object, partNumber: number): object

Private Const getS3PartData

  • getS3PartData(part: PartObj, __namedParameters: object): Promise<any>

Const getSecurity

  • getSecurity(): void
  • getSecurity(policyOptions: SecurityOptions, appSecret: string): Security
  • getSecurity is disabled for browsers. Returns Filestack base64 policy and HMAC-SHA256 signature

    Example

    import * as filestack from 'filestack-js';
    
    const jsonPolicy = { 'expiry': 253381964415 };
    const security = filestack.getSecurity(jsonPolicy, '<YOUR_APP_SECRET>');
    

    Returns void

  • getSecurity is disabled for browsers. Returns Filestack base64 policy and HMAC-SHA256 signature

    Example

    import * as filestack from 'filestack-js';
    
    const jsonPolicy = { 'expiry': 253381964415 };
    const security = filestack.getSecurity(jsonPolicy, '<YOUR_APP_SECRET>');
    

    Parameters

    • policyOptions: SecurityOptions
    • appSecret: string

    Returns Security

Private Const getUrl

  • getUrl(session: Session, handle: string, opts?: any, security?: Security): string

Const getValidator

  • getValidator(schema: any): ValidateFunction
  • Returns validator instance

    Parameters

    • schema: any

    Returns ValidateFunction

Const init

Private Const isBlob

  • isBlob(blob: any): boolean

Private Const isFile

  • isFile(file: any): boolean

Const Private isMobile

  • isMobile(): boolean
  • isMobile(): boolean

Private Const makePart

Private Const metadata

Private Const optionToString

  • optionToString(key: string, values: any): string
  • Flatten transformation option to string

    Parameters

    • key: string

      option key

    • values: any

      option params

    Returns string

Private Const percentOfFile

  • percentOfFile(bytes: number, file: FileObj): number

Private Const picker

Private Const preview

Private Const range

  • range(start: number, stop: number, step?: number): any[]
  • Parameters

    • start: number
    • stop: number
    • Default value step: number = 1

    Returns any[]

Private Const readFile

  • readFile(file: any): Promise<Object>
  • Reads file as ArrayBuffer using HTML5 FileReader implementation

    Parameters

    • file: any

      Valid File instance

    Returns Promise<Object>

Private Const remove

  • remove(session: Session, handle?: string, skipStorage?: boolean, security?: Security): Promise<any>
  • Remove given file

    Parameters

    • session: Session
    • Optional handle: string
    • Optional skipStorage: boolean
    • Optional security: Security

    Returns Promise<any>

Private Const removeEmpty

  • removeEmpty(obj: any): any

Private Const requestWithSource

  • requestWithSource(method: string, url: string): CustomReq

Private Const resolveCdnUrl

  • resolveCdnUrl(session: Session, handle: string): string
  • Resolve cdn url based on handle type

    Parameters

    • session: Session

      session object

    • handle: string

      file handle (hash, src://alias, url)

    Returns string

Private Const retrieve

Private Const sliceFile

  • sliceFile(ctx: Context, partNumber: number): Blob

Private Const slicePartIntoChunks

  • slicePartIntoChunks(part: PartObj, size: number): any[]

Private Const start

  • start(__namedParameters: object): Promise<any>

Private Const storeURL

  • storeURL(session: any, url?: string, opts?: StoreOptions, token?: any, security?: Security): Promise<__type>

Private Const sumBytes

  • sumBytes(bytes: number[]): number
  • Helpers to calculate total progress of file upload in bytes and percent

    Parameters

    • bytes: number[]

    Returns number

Private Const throat

  • throat(size: number, fn: any): (Anonymous function)

Private Const throttle

  • throttle(fn: any, interval: number, callFirst?: boolean): (Anonymous function)
  • Parameters

    • fn: any
    • interval: number
    • Optional callFirst: boolean

    Returns (Anonymous function)

Private Const toSnakeCase

  • toSnakeCase(original: object): object
  • Parameters

    • original: object
      • [index: string]: any

    Returns object

    • [index: string]: any

Private Const transform

  • Creates filestack transform url. Transform params can be provided in camelCase or snakeCase style

    Parameters

    Returns string

Private Const upload

  • User facing method to upload a single file

    Parameters

    • session: Session

      Session object that contains apikey

    • fileOrString: any
    • Default value options: UploadOptions = {}

      Configures the uploader

    • Default value storeOptions: StoreOptions = {}

      Storage options for the backend

    • Default value token: any = {}

      Control token

    • Optional security: Security

    Returns Promise<any>

Private Const uploadChunk

  • uploadChunk(chunk: any, ctx: Context): Promise<any>

Private Const uploadFile

  • uploadFile(ctx: Context, token: any): Promise<any>

Private Const uploadPart

Private Const uploadToS3

  • uploadToS3(part: ArrayBuffer, params: any, onProgress: any, cfg: UploadConfig): Promise<any>
  • Uploads bytes directly to S3 with HTTP PUT

    Parameters

    • part: ArrayBuffer

      ArrayBuffer with part data

    • params: any

      Params for this part returned by getS3PartData response

    • onProgress: any

      A function to be called on progress event for this part

    • cfg: UploadConfig

    Returns Promise<any>

Const valuesToLowerCase

  • valuesToLowerCase(ob: any): any

Object literals

Const Definitions

Definitions: object

$id

$id: string = "https://filestack.com/schemas/defs.json"

$schema

$schema: string = "http://json-schema.org/draft-07/schema#"

additionalProperties

additionalProperties: boolean = false

description

description: string = "Filestack transformations parameters"

title

title: string = "Filestack Transformations"

type

type: string = "object"

definitions

definitions: object

colorDef

colorDef: object

$id

$id: string = "#colorDef"

oneOf

oneOf: (object | object)[] = [{type: 'string',pattern: '^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$', // without # at the begining}, {type: 'string',enum: ['aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fractal', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray0', 'gray1', 'gray2', 'gray3', 'gray4', 'gray5', 'gray6', 'gray7', 'gray8', 'gray9', 'gray10', 'gray11', 'gray12', 'gray13', 'gray14', 'gray15', 'gray16', 'gray17', 'gray18', 'gray19', 'gray20', 'gray21', 'gray22', 'gray23', 'gray24', 'gray25', 'gray26', 'gray27', 'gray28', 'gray29', 'gray30', 'gray31', 'gray32', 'gray33', 'gray34', 'gray35', 'gray36', 'gray37', 'gray38', 'gray39', 'gray40', 'gray41', 'gray42', 'gray43', 'gray44', 'gray45', 'gray46', 'gray47', 'gray48', 'gray49', 'gray50', 'gray51', 'gray52', 'gray53', 'gray54', 'gray55', 'gray56', 'gray57', 'gray58', 'gray59', 'gray60', 'gray61', 'gray62', 'gray63', 'gray64', 'gray65', 'gray66', 'gray67', 'gray68', 'gray69', 'gray70', 'gray71', 'gray72', 'gray73', 'gray74', 'gray75', 'gray76', 'gray77', 'gray78', 'gray79', 'gray80', 'gray81', 'gray82', 'gray83', 'gray84', 'gray85', 'gray86', 'gray87', 'gray88', 'gray89', 'gray90', 'gray91', 'gray92', 'gray93', 'gray94', 'gray95', 'gray96', 'gray97', 'gray98', 'gray99', 'gray100', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'none', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen',],}]

locationsDef

locationsDef: object

$id

$id: string = "#locationsDef"

enum

enum: string[] = ['s3', 'rackspace', 'gcs', 'azure', ' dropbox']

type

type: string = "string"

regionsDef

regionsDef: object

$id

$id: string = "#regionsDef"

enum

enum: string[] = ['us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', 'eu-central-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'sa-east-1']

type

type: string = "string"

securityCallDef

securityCallDef: object

$id

$id: string = "#securityCallDef"

enum

enum: string[] = ['pick', 'read', 'stat', 'write', 'writeUrl', 'store', 'convert', 'remove', 'exif', 'runWorkflow']

type

type: string = "string"

Const SecuritySchema

SecuritySchema: object

$id

$id: string = "https://filestack.com/schemas/security.json"

$schema

$schema: string = "http://json-schema.org/draft-07/schema#"

additionalProperties

additionalProperties: boolean = false

description

description: string = "Filestack security settings schema"

title

title: string = "Filestack Security Settings"

type

type: string = "object"

properties

properties: object

call

call: object

$ref

$ref: string = "defs.json#/definitions/securityCallDef"

container

container: object

type

type: string = "string"

handle

handle: object

type

type: string = "string"

maxSize

maxSize: object

type

type: string = "integer"

minSize

minSize: object

type

type: string = "integer"

path

path: object

type

type: string = "string"

url

url: object

type

type: string = "string"

Const TransformSchema

TransformSchema: object

$id

$id: string = "https://filestack.com/schemas/transforms.json"

$schema

$schema: string = "http://json-schema.org/draft-07/schema#"

additionalProperties

additionalProperties: boolean = false

description

description: string = "Filestack transformations parameters"

title

title: string = "Filestack Transformations"

type

type: string = "object"

definitions

definitions: object

facesDef

facesDef: object

$id

$id: string = "#facesDef"

oneOf

oneOf: (object | object | object)[] = [{type: 'string',enum: ['all'],}, {type: 'integer',minimum: 1,maximum: 1000,}, {type: 'array',uniqueItems: true,items: [{type: 'integer',minimum: 1,maximum: 1000,}],}]

objectsDef

objectsDef: object

$id

$id: string = "#objectsDef"

items

items: object[] = [{type: 'array',additionalItems: false,minItems: 4,items: [{type: 'integer',minimum: 0,maximum: 10000,}, {type: 'integer',minimum: 0,maximum: 10000,}, {type: 'integer',minimum: 1,maximum: 10000,}, {type: 'integer',minimum: 1,maximum: 10000,}],}]

maxItems

maxItems: number = 50

minItems

minItems: number = 1

type

type: string = "array"

positionDef

positionDef: object

$id

$id: string = "#positionDef"

default

default: string[] = ['middle', 'center']

oneOf

oneOf: (object | object)[] = [{type: 'string',enum: ['top','middle','bottom','left','center','right',],},{type: 'array',uniqueItems: true,additionalItems: false,minItems: 2,default: ['middle', 'center'],items: [{type: 'string',enum: ['top','middle','bottom',],}, {type: 'string',enum: ['left','center','right',],},],},]

properties

properties: object

asci

asci: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {foreground: {'$ref': 'defs.json#/definitions/colorDef',default: '000000FF',},background: {'$ref': 'defs.json#/definitions/colorDef',default: 'FFFFFFFF',},colored: {type: 'boolean',default: false,},size: {type: 'integer',minimum: 10,maximum: 100,default: 100,},reverse: {type: 'boolean',default: false,},},additionalProperties: false,}]

blackwhite

blackwhite: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {threshold: {type: 'integer',minimum: 0,maximum: 100,default: 50,},},additionalProperties: false,}]

blur

blur: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {amount: {type: 'integer',minimum: 0,maximum: 20,default: 2,},},additionalProperties: false,}]

blur_faces

blur_faces: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {faces: {'$ref': '#facesDef',default: 'all',},maxsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},minsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},buffer: {type: 'integer',minimum: 0,maximum: 10000,},amount: {type: 'number',minimum: 0,maximum: 10,default: 10,},blur: {type: 'number',minimum: 0,maximum: 20,default: 4,},type: {type: 'string',enum: ['rect', 'oval'],default: 'rect',},},additionalProperties: false,}]

border

border: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {color: {'$ref': 'defs.json#/definitions/colorDef',},background: {'$ref': 'defs.json#/definitions/colorDef',},width: {type: 'integer',minimum: 0,maximum: 1000,},},additionalProperties: false,}]

cache

cache: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {expiry: {type: 'integer',},},}]

circle

circle: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {background: {'$ref': 'defs.json#/definitions/colorDef',},},additionalProperties: false,}]

collage

collage: object

additionalProperties

additionalProperties: boolean = false

required

required: string[] = ['width', 'height', 'files']

type

type: string = "object"

properties

properties: object

autorotate

autorotate: object

default

default: boolean = false

type

type: string = "boolean"

color

color: object

$ref

$ref: string = "defs.json#/definitions/colorDef"

default

default: string = "FFFFFFFF"

files

files: object

additionalItems

additionalItems: boolean = false

items

items: object[] = [{type: 'string',}]

minItems

minItems: number = 1

type

type: string = "array"

fit

fit: object

enum

enum: string[] = ['auto', 'crop']

type

type: string = "string"

height

height: object

maximum

maximum: number = 10000

minimum

minimum: number = 0

type

type: string = "integer"

margin

margin: object

default

default: number = 10

maximum

maximum: number = 100

minimum

minimum: number = 1

type

type: string = "integer"

width

width: object

maximum

maximum: number = 10000

minimum

minimum: number = 0

type

type: string = "integer"

compress

compress: object

additionalProperties

additionalProperties: boolean = false

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {metadata: {type: 'boolean',default: false,},},}]

crop

crop: object

required

required: string[] = ['dim']

type

type: string = "object"

properties

properties: object

dim

dim: object

additionalItems

additionalItems: boolean = false

items

items: object[] = [{type: 'integer',minimum: 0,maximum: 100000,}, {type: 'integer',minimum: 0,maximum: 100000,}, {type: 'integer',minimum: 1,maximum: 100000,}, {type: 'integer',minimum: 1,maximum: 100000,}]

minItems

minItems: number = 4

type

type: string = "array"

crop_faces

crop_faces: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {faces: {default: 1,'$ref': '#facesDef',},width: {type: 'number',minimum: 1,maximum: 10000,},height: {type: 'number',minimum: 1,maximum: 10000,},maxsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},minsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},buffer: {type: 'integer',minimum: 0,maximum: 10000,},mode: {type: 'string',enum: ['crop', 'thumb', 'fill'],default: 'thumb',},},additionalProperties: false,}]

detect_faces

detect_faces: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {maxsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},minsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},export: {type: 'boolean',},color: {'$ref': 'defs.json#/definitions/colorDef',default: '000000FF',},},additionalProperties: false,}]

enchance

enchance: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

flip

flip: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

flop

flop: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

imagesize

imagesize: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

metadata

metadata: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "object"

params

params: object

additionalItems

additionalItems: boolean = false

minItems

minItems: number = 0

type

type: string = "array"

uniqueItems

uniqueItems: boolean = true

items

items: object

enum

enum: string[] = ['filename','mimetype','size','width','height','writeable','path','container','cloud','exif','source_url','md5','sha256','sha1','sha512',]

type

type: string = "string"

modulate

modulate: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {brightness: {type: 'integer',minimum: 0,maximum: 10000,default: 100,},saturation: {type: 'integer',minimum: 0,maximum: 10000,default: 100,},hue: {type: 'integer',minimum: 0,maximum: 359,default: 0,},},additionalProperties: false,}]

monochrome

monochrome: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

negative

negative: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

no_metadata

no_metadata: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

oil_paint

oil_paint: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {amount: {type: 'integer',minimum: 2,maximum: 100,default: 2,},},additionalProperties: false,}]

output

output: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "object"

properties

properties: object

background

background: object

$ref

$ref: string = "defs.json#/definitions/colorDef"

colorspace

colorspace: object

default

default: string = "rgb"

enum

enum: string[] = ['rgb', 'cmyk', 'input']

type

type: string = "string"

compress

compress: object

type

type: string = "boolean"

density

density: object

maximum

maximum: number = 500

minimum

minimum: number = 1

type

type: string = "integer"

docinfo

docinfo: object

default

default: boolean = false

type

type: string = "boolean"

format

format: object

enum

enum: string[] = ['doc', 'docx', 'html', 'jpg', 'odp', 'ods', 'odt', 'pjpg', 'pdf', 'png', 'ppt', 'pptx', 'svg', 'txt', 'webp', 'xls', 'xlsx']

type

type: string = "string"

page

page: object

maximum

maximum: number = 99999

minimum

minimum: number = 1

type

type: string = "integer"

pageformat

pageformat: object

enum

enum: string[] = ['a3', 'a4', 'a5', 'b4', 'b5', 'letter', 'legal', 'tabloid']

type

type: string = "string"

pageorientation

pageorientation: object

enum

enum: string[] = ['landscape', 'portrait']

type

type: string = "string"

quality

quality: object

oneOf

oneOf: (object | object)[] = [{type: 'string',enum: ['input'],}, {type: 'integer',minimum: 1,maximum: 100,default: 95,}]

secure

secure: object

default

default: boolean = false

type

type: string = "boolean"

strip

strip: object

default

default: boolean = false

type

type: string = "boolean"

partial_blur

partial_blur: object

required

required: string[] = ['objects']

type

type: string = "object"

properties

properties: object

amount

amount: object

maximum

maximum: number = 20

minimum

minimum: number = 0

type

type: string = "number"

blur

blur: object

maximum

maximum: number = 20

minimum

minimum: number = 0

type

type: string = "number"

objects

objects: object

$ref

$ref: string = "#objectsDef"

type

type: object

enum

enum: string[] = ['rect', 'oval']

type

type: string = "string"

partial_pixelate

partial_pixelate: object

required

required: string[] = ['objects']

type

type: string = "object"

properties

properties: object

amount

amount: object

maximum

maximum: number = 100

minimum

minimum: number = 2

type

type: string = "number"

blur

blur: object

maximum

maximum: number = 20

minimum

minimum: number = 0

type

type: string = "number"

objects

objects: object

$ref

$ref: string = "#objectsDef"

type

type: object

enum

enum: string[] = ['rect', 'oval']

type

type: string = "string"

pixelate

pixelate: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {amount: {type: 'integer',minimum: 2,maximum: 100,default: 2,},},additionalProperties: false,}]

pixelate_faces

pixelate_faces: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {faces: {'$ref': '#facesDef',default: 'all',},maxsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},minsize: {type: 'number',minimum: 0,maximum: 10000,default: 0.35,},buffer: {type: 'integer',minimum: 0,maximum: 10000,},amount: {type: 'integer',minimum: 2,maximum: 100,default: 10,},blur: {type: 'number',minimum: 0,maximum: 20,default: 4,},type: {type: 'string',enum: ['rect', 'oval'],default: 'rect',},},additionalProperties: false,}]

pjpg

pjpg: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',additionalProperties: false,properties: {quality: {type: 'integer',minimum: 0,maximum: 100,},metadata: {type: 'boolean',default: false,},},}]

polaroid

polaroid: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {rotate: {type: 'integer',minimum: 0,maximum: 359,},color: {'$ref': 'defs.json#/definitions/colorDef',default: 'snow',},background: {'$ref': 'defs.json#/definitions/colorDef',},},additionalProperties: false,}]

quality

quality: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "object"

properties

properties: object

value

value: object

maximum

maximum: number = 100

minimum

minimum: number = 1

type

type: string = "integer"

redeye

redeye: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

resize

resize: object

additionalProperties

additionalProperties: boolean = false

anyOf

anyOf: object[] = [{ required: ['width'] },{ required: ['height'] },]

type

type: string = "object"

properties

properties: object

align

align: object

$ref

$ref: string = "#positionDef"

default

default: string = "center"

fit

fit: object

default

default: string = "clip"

enum

enum: string[] = ['clip', 'crop', 'scale' ,'max']

type

type: string = "string"

height

height: object

maximum

maximum: number = 10000

minimum

minimum: number = 0

type

type: string = "number"

width

width: object

maximum

maximum: number = 10000

minimum

minimum: number = 0

type

type: string = "number"

rotate

rotate: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "object"

properties

properties: object

background

background: object

$ref

$ref: string = "defs.json#/definitions/colorDef"

default

default: string = "FFFFFFFF"

deg

deg: object

oneOf

oneOf: (object | object)[] = [{type: 'string',num: ['exif'],}, {type: 'number',minimum: 0,maximum: 359,}]

exif

exif: object

type

type: string = "boolean"

rounded_corners

rounded_corners: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {radius: {oneOf: [{type: 'integer',minimum: 1,maximum: 10000,}, {type: 'string',enum: ['max'],}],},blur: {type: 'number',minimum: 0,maximum: 20,default: 0.3,},background: {'$ref': 'defs.json#/definitions/colorDef',},},additionalProperties: false,}]

security

security: object

additionalProperties

additionalProperties: boolean = false

required

required: string[] = ['policy', 'signature']

type

type: string = "object"

properties

properties: object

policy

policy: object

type

type: string = "string"

signature

signature: object

type

type: string = "string"

sepia

sepia: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {tone: {type: 'integer',minimum: 0,maximum: 100,default: 80,},},additionalProperties: false,}]

sfw

sfw: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

shadow

shadow: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {blur: {type: 'number',minimum: 0,maximum: 20,default: 100,},opacity: {type: 'integer',minimum: 0,maximum: 100,default: 60,},vector: {type: 'array',additionalItems: false,minItems: 2,items: [{type: 'integer',minimum: -1000,maximum: 1000,default: 4,}, {type: 'integer',minimum: -1000,maximum: 1000,default: 4,}],},color: {'$ref': 'defs.json#/definitions/colorDef',},background: {'$ref': 'defs.json#/definitions/colorDef',},},additionalProperties: false,}]

sharpen

sharpen: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {amount: {type: 'integer',minimum: 0,maximum: 20,default: 2,},},additionalProperties: false,}]

store

store: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',additionalProperties: false,properties: {filename: {type: 'string',},location: {'$ref': 'defs.json#/definitions/locationsDef',},path: {type: 'string',},container: {type: 'string',},region: {'$ref': 'defs.json#/definitions/regionsDef',},access: {type: 'string',enum: ['public', 'private'],default: 'private',},base64decode: {type: 'boolean',},workflows: {type: 'array',additionalItems: false,minItems: 1,maxItems: 20,items: [{type: 'string',}, {type: 'object',additionalProperties: false,properties: {id: {type: 'string',},},}],},},}]

tags

tags: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "boolean"

torn_edges

torn_edges: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {spread: {type: 'array',additionalItems: false,minItems: 2,items: [{type: 'integer',minimum: 1,maximum: 10000,default: 1,}, {type: 'integer',minimum: 1,maximum: 10000,default: 10,}],},background: {'$ref': 'defs.json#/definitions/colorDef',},},additionalProperties: false,}]

upscale

upscale: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {noise: {type: 'string',enum: ['none', 'low', 'medium', 'high'],default: 'none',},upscale: {type: 'boolean',default: true,},style: {type: 'string',enum: ['artwork', 'photo'],default: 'photo',},},additionalProperties: false,}]

urlscreenshot

urlscreenshot: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {agent: {type : 'string',enum: ['desktop', 'mobile'],default: 'desktop',},width: {type: 'integer',minimum: 1,maximum: 1920,default: 1024,},height: {type: 'integer',minimum: 1,maximum: 8000,default: 768,},mode: {type: 'string',enum: ['all', 'window'],default: 'all',},delay: {type: 'integer',minimum: 0,maximum: 20000,default: 1000,},orientation: {type: 'string',enum: ['portrait', 'landscape'],default: 'portrait',},device: {type: 'string',default: '',},},additionalProperties: false,}]

video_convert

video_convert: object

additionalProperties

additionalProperties: boolean = false

type

type: string = "object"

properties

properties: object

access

access: object

default

default: string = "public"

enum

enum: string[] = ['public', 'private']

type

type: string = "string"

aspect_mode

aspect_mode: object

default

default: string = "letterbox"

enum

enum: string[] = ['letterbox', 'pad', 'crop', 'preserve', 'constrain']

type

type: string = "string"

audio_bitrate

audio_bitrate: object

maximum

maximum: number = 999

minimum

minimum: number = 1

type

type: string = "integer"

audio_channels

audio_channels: object

maximum

maximum: number = 12

minimum

minimum: number = 1

type

type: string = "integer"

audio_sample_rate

audio_sample_rate: object

maximum

maximum: number = 99999

minimum

minimum: number = 1

type

type: string = "integer"

clip_length

clip_length: object

pattern

pattern: string = "^([0-1]?d|2[0-3])(?::([0-5]?d))?(?::([0-5]?d))?$"

type

type: string = "string"

clip_offset

clip_offset: object

pattern

pattern: string = "^([0-1]?d|2[0-3])(?::([0-5]?d))?(?::([0-5]?d))?$"

type

type: string = "string"

container

container: object

type

type: string = "string"

extname

extname: object

type

type: string = "string"

filename

filename: object

type

type: string = "string"

force

force: object

type

type: string = "boolean"

fps

fps: object

maximum

maximum: number = 300

minimum

minimum: number = 1

type

type: string = "integer"

frame_count

frame_count: object

default

default: number = 1

maximum

maximum: number = 1

minimum

minimum: number = 1

type

type: string = "integer"

height

height: object

maximum

maximum: number = 100

minimum

minimum: number = 1

type

type: string = "integer"

keyframe_interval

keyframe_interval: object

maximum

maximum: number = 250

minimum

minimum: number = 250

type

type: string = "integer"

location

location: object

$ref

$ref: string = "defs.json#/definitions/locationsDef"

path

path: object

type

type: string = "string"

preset

preset: object

type

type: string = "string"

title

title: object

type

type: string = "string"

two_pass

two_pass: object

type

type: string = "boolean"

upscale

upscale: object

type

type: string = "boolean"

video_bitrate

video_bitrate: object

maximum

maximum: number = 5000

minimum

minimum: number = 1

type

type: string = "integer"

watermark_bottom

watermark_bottom: object

maximum

maximum: number = 9999

minimum

minimum: number = 0

type

type: string = "integer"

watermark_left

watermark_left: object

maximum

maximum: number = 9999

minimum

minimum: number = 0

type

type: string = "integer"

watermark_right

watermark_right: object

maximum

maximum: number = 9999

minimum

minimum: number = 0

type

type: string = "integer"

watermark_top

watermark_top: object

maximum

maximum: number = 9999

minimum

minimum: number = 0

type

type: string = "integer"

watermark_url

watermark_url: object

type

type: string = "string"

width

width: object

maximum

maximum: number = 100

minimum

minimum: number = 1

type

type: string = "integer"

vignette

vignette: object

oneOf

oneOf: (object | object)[] = [{type: 'boolean',}, {type: 'object',properties: {amount: {type: 'integer',minimum: 0,maximum: 100,default: 20,},blurmode: {type: 'string',enum: ['gaussian', 'linear'],default: 'gaussian',},background: {'$ref': 'defs.json#/definitions/colorDef',},},additionalProperties: false,}]

watermark

watermark: object

additionalProperties

additionalProperties: boolean = false

required

required: string[] = ['file',]

type

type: string = "object"

properties

properties: object

file

file: object

type

type: string = "string"

position

position: object

$ref

$ref: string = "#positionDef"

size

size: object

maximum

maximum: number = 500

minimum

minimum: number = 0

type

type: string = "number"

Private Const statuses

statuses: object

DONE

DONE: Status = Status.DONE

FAILED

FAILED: Status = Status.FAILED

INIT

INIT: Status = Status.INIT

PAUSED

PAUSED: Status = Status.PAUSED

RUNNING

RUNNING: Status = Status.RUNNING