diawi-nodejs-uploader/readme.md

66 lines
1.3 KiB
Markdown
Raw Permalink Normal View History

2020-09-25 08:52:24 +00:00
# diawi-nodejs-uploader
2020-09-25 08:55:28 +00:00
A NodeJS tool for [Diawi](https://www.diawi.com/) integration written with [Typescript](https://www.typescriptlang.org/)
2020-09-25 08:52:24 +00:00
## Installation
```sh
$ yarn add diawi-nodejs-uploader
=== or ===
$ npm install diawi-nodejs-uploader
```
## Usage
#### Programmatic
2020-09-25 08:55:28 +00:00
All options except token and file are optional.
2020-09-25 08:52:24 +00:00
```js
import { upload } from 'diawi-nodejs-uploader';
2020-11-25 08:19:00 +00:00
const result = await upload({
file: '/files/bundle.apk',
token: 'token',
});
console.log(result);
2020-09-25 08:52:24 +00:00
```
2020-11-25 08:19:00 +00:00
Full example
```js
import { upload } from 'diawi-nodejs-uploader';
const result = await upload({
file: '/file/bundle.apk',
token: 'token',
callback_emails: 'email@mail.com',
callback_url: 'myUrl.com/cb',
comment: 'comment text',
find_by_udid: true,
installation_notifications: true,
password: 'passwordForBundle',
wall_of_apps: true,
}, {
apiUploadEndpoint: 'rewriteDefauitDiawiUploadEndpoint',
apiStatusEndpoint: 'rewriteDefauitDiawiStatusEndpoint',
maxApiStatusCalls: 99,
onUploadProgress: (progressPercent) => {
console.log(`uploading: ${progressPercent}`);
},
onStatusProgress: (status) => {
console.log(`status: ${status}`);
},
});
console.log(result);
```
2020-09-25 08:52:24 +00:00
#### CLI
```js
// in development
```