Class

TemporaryFiles

TemporaryFiles(client)

Class corresponding to Aworks TemporaryFiles Endpoints
Constructor

# new TemporaryFiles(client)

Endpoint constructor
Parameters:
Name Type Description
client Client
See:
  • [TemporaryFiles in Awork API Docs](https://openapi.awork.com/#/TemporaryFiles)

View Source endpoints/TemporaryFiles.js, line 11

Classes

TemporaryFiles

Methods

# async create(file, metadata) → {Promise.<EntityFile>}

Uploads a new temporary file. Use this to upload a file as a form value along with the basic file meta data. The file size must not exceed 1GB.
Parameters:
Name Type Description
file File | Buffer
metadata FileMetaData

View Source endpoints/TemporaryFiles.js, line 58

Promise.<EntityFile>

# async download(fileId) → {Promise.<String>}

Returns the content of the temporary file.
Parameters:
Name Type Description
fileId String The id of the file.

View Source endpoints/TemporaryFiles.js, line 97

Promise.<String>

# async get(fileId) → {Promise.<EntityFile>}

Returns the meta information of the temporary file of the current user.
Parameters:
Name Type Description
fileId String The id of the file.

View Source endpoints/TemporaryFiles.js, line 28

Promise.<EntityFile>

# async list(optionsopt) → {Promise.<Array.<EntityFile>>}

Returns the meta information of all temporary files of the current user.
Parameters:
Name Type Attributes Description
options ListOptions <optional>
Pagination and filtering options

View Source endpoints/TemporaryFiles.js, line 39

Promise.<Array.<EntityFile>>

# async setEntity(fileId, entityObject) → {Promise.<void>}

Sets the temporary file to a global or entity file. Links the temporary file to the specified entity or switches to a global file if the 'EntityId' of the model is set to null. The file is no longer a temporary file afterwards and becomes visible.
Parameters:
Name Type Description
fileId String The id of the file.
entityObject LinkedEntity

View Source endpoints/TemporaryFiles.js, line 114

Promise.<void>

# async update(fileId, temporaryFile) → {Promise.<EntityFile>}

Updates the meta information of the temporary file with the specified id.
Parameters:
Name Type Description
fileId String The id of the file.
temporaryFile TemporaryFilesUpdateModel The model to update the temporary file.

View Source endpoints/TemporaryFiles.js, line 86

Promise.<EntityFile>