1.5.1 • Published 5 years ago

@deepvision/fs.js v1.5.1

Weekly downloads
9
License
-
Repository
-
Last release
5 years ago

File Storage API

Installing

To install library run:

npm i @deepvision/fs.js

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',
    getAccessToken: auth.getAccessToken,
});

Usage

File Types

  • image.course.cover

Upload File

Upload original image to the server

fsApi.files.upload(file, {
    org: 'org-id'
})
  • file – instance of FormData

Upload Original Image

Upload original image to the server

fsApi.images.upload(file, {
    type: 'file-type',
    org: 'org-id'
})
  • file – instance of FormData

Upload Cropped Image

Upload cropped image to the server

fsApi.images.upload(file, {
    type: 'file-type',
    parentId: 'parent-id',
    cropMask: 'x,y,h,w', // '12,345,22,65',
    org: 'org-id',
})
  • file – instance of FormData

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

1.5.1

5 years ago

1.5.0

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.4.2

6 years ago

0.4.1

7 years ago

0.4.0

7 years ago