@deepvision/adventist-fsapi
v0.1.7
Published
FS JS Library for Adventist.ua
Downloads
4
Keywords
Readme
File Storage API
Installing
To install library run:
bit import deep.api/_/file-storage
Initializing
For working using api library import to your script file
and create instance with new
. Notice, that endpoint
argument is required in constructor.
import FSApi from '<path_to_library>';
const fsApi = new FSApi({
endpoint: 'your-enpoint',
token: 'your-token',
});
Usage
File Types
- image.course.cover – обложка курса (оригинал)
- image.course.cover.cropped – обложка курса
Actions
Upload file
Upload file to the server
fsApi.upload(fileType, file)
- fileType – type of transferred file
- file – the file
Upload Child file
Upload file to the server with dependency
fsApi.uploadChild(fileType, parentId, file)
- fileType – type of transferred file
- parentId – id of the parent file
- file – the file
Get validation rules
Validation rules for file type
fsApi.validationRules(fileType)
- fileType – type of transferred file
License
This project is licensed under the DeepVision License