1.10.0 • Published 21 days ago

@epilot/file-client v1.10.0

Weekly downloads
-
License
MIT
Repository
github
Last release
21 days ago

@epilot/file-client

CI npm version bundle size License

Client library for epilot File API

Uses openapi-client-axios

Installation

npm install --save @epilot/file-client

Usage

import fs from 'fs';
import { getClient } from '@epilot/file-client';
const fileClient = getClient();

// get upload params
const uploadFileRes = await fileClient.uploadFile(null, { filename: 'document.pdf', mime_type: 'application/pdf' });
const uploadParams = uploadFileRes.data;

// upload file to S3
const file = fs.readFileSync('./document.pdf')
const uploadRes = await fileClient.put(
  uploadParams.upload_url,
  file, 
  { headers: { 'content-type': 'application/json' }}
);

// save file as an entity
const uploadParams = await fileClient.saveFile(
  null,
  { s3ref: uploadParams.s3ref, access_control: 'private' },
);

Documentation

https://docs.epilot.io/docs/files/file-api

1.10.0

21 days ago

1.9.0

5 months ago

1.8.1

5 months ago

1.7.2

7 months ago

1.8.0

5 months ago

1.8.0-rc1

8 months ago

1.7.1

8 months ago

1.8.0-rc2

8 months ago

1.7.0

9 months ago

1.5.2

1 year ago

1.6.0

11 months ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.5

1 year ago

1.4.4

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago