Jakub Sokołowski 325aa9bac9
parametrize sleep time and bump it to 600 milliseconds
The current value is too low and causes failures like this:
```
{ error: 4000000, message: 'Too many requests' }
```
According to Diawi support limit of status checks is two per second:

>Your guess is correct, there is a limit on the number of requests for the
>status check of an upload (2 requests every second)... >and it seems that
>the library your are using is making requests to fast.
>Could you try using 600ms instead of 300ms?

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-05-23 10:35:08 +02:00
2020-09-25 10:11:44 +03:00
2020-09-24 09:33:04 +03:00
2020-09-24 14:18:42 +03:00
2020-09-24 09:33:04 +03:00
2020-09-25 09:49:35 +03:00
2020-11-25 08:24:02 +00:00
2020-09-24 09:31:27 +03:00
2020-09-25 10:42:56 +03:00
2020-09-24 15:23:44 +03:00
2020-09-25 08:44:07 +03:00

diawi-nodejs-uploader

A NodeJS tool for Diawi integration written with Typescript

Installation

$ yarn add diawi-nodejs-uploader
=== or ===
$ npm install diawi-nodejs-uploader

Usage

Programmatic

All options except token and file are optional.

import { upload } from 'diawi-nodejs-uploader';

const result = await upload({
        file: '/files/bundle.apk',
        token: 'token',
    });
console.log(result);

Full example

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,
    sleepMilliseconds: 600,
    onUploadProgress: (progressPercent) => {
        console.log(`uploading: ${progressPercent}`);
    },
    onStatusProgress: (status) => {
        console.log(`status: ${status}`);
    },
});

console.log(result);

CLI

// in development
Description
No description provided
Readme
Languages
TypeScript 86.5%
JavaScript 13.5%