Interface IAPIOptions

interface IAPIOptions {
    agent: Agent;
    apiBaseUrl: string;
    apiExecuteCount: number;
    apiExecuteMethods: string[];
    apiExecuteUnsupportedMethods: string[];
    apiHeaders: Record<string, string>;
    apiLimit: number;
    apiMode: "sequential" | "parallel" | "parallel_selected";
    apiRequestMode: "sequential" | "burst";
    apiRetryLimit: number;
    apiTimeout: number;
    apiVersion: string;
    apiWait: number;
    callbackService?: CallbackService;
    language?: "ru" | "be" | "en" | "es" | "fi" | "de" | "it" | "uk";
    token: string;
}

Properties

agent: Agent

HTTPS agent

apiBaseUrl: string

Base API URL

Default Value

https://api.vk.com/method

apiExecuteCount: number

Number of requests per execute

Default Value

25

apiExecuteMethods: string[]

Methods for call execute (apiMode=parallel_selected)

Default Value

['messages.send']

apiExecuteUnsupportedMethods: string[]

Methods that are not supported in execute (apiMode=parallel & apiMode=parallel_selected)

Basically it's upload methods

Default Value

[
'photos.save',
'photos.saveWallPhoto',
'photos.saveOwnerPhoto',
'photos.saveMessagesPhoto',
'messages.setChatPhoto',
'photos.saveMarketPhoto',
'photos.saveMarketAlbumPhoto',
'audio.save',
'docs.save',
'photos.saveOwnerCoverPhoto',
'stories.save',
'polls.savePhoto'
]
apiHeaders: Record<string, string>

Headers sent to the API

Default Value

{ User-Agent': 'vk-io/${version} (+https://github.com/negezor/vk-io)' }

apiLimit: number

Requests per second

Default Value

3

apiMode: "sequential" | "parallel" | "parallel_selected"

Determines how requests will be collected

  • sequential - in order
  • parallel - all requests are sent through execute
  • parallel_selected - only the specified methods in apiExecuteMethods are collected in execute, other methods as in sequential mode

Default Value

sequential

apiRequestMode: "sequential" | "burst"

Determines how requests will be sent

  • sequential - through the interval
  • burst - in parallel, the maximum number of requests (attention, may cause an EAI_AGAIN error)

Default Value

sequential

apiRetryLimit: number

The number of retries at calling

Default Value

3

apiTimeout: number

Wait time for one request

Default Value

10000

apiVersion: string

VK API version

apiWait: number

Time to wait before re-querying

Default Value

3000

callbackService?: CallbackService
language?: "ru" | "be" | "en" | "es" | "fi" | "de" | "it" | "uk"

The return data language

token: string

Access token

Generated using TypeDoc