@deepvision/fs.js
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @deepvision/fs.js

Weekly Downloads

15

Version

1.5.1

License

none

Unpacked Size

131 kB

Total Files

54

Last publish

Collaborators

  • cerj
  • andrew.vlasiuk
  • deepbot
  • denys.shnurenko
  • ftornik
  • v.angolenko