Constructor
# new DevUp(params)
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | string | Можно передать либо токен, либо набор параметров (IOptions) |
Example
const { DevUp } = require(`api-devup`);
const API = new DevUp("token");
// Or
const API = new DevUp({
token: "token",
apiHeaders: {
"User-Agent": "Custom-UserAgent"
}
});
Methods
# async call(method, paramsopt)
Метод для выполнения запроса к недобавленным методам
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
method |
string | Метод |
||
params |
Record.<string, any> |
<optional> |
{} | Параметры |
Example
API.call("profile.get").then(res => console.log(res));
# async ping() → {Object}
Позволяет узнать текущий пинг до API
Объект с результатом PingResponse
Object
Example
API.ping().then(res => console.log(res));