Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vkontakte-api

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vkontakte-api - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

dist/repositories/WidgetsRepository/index.d.ts

13

CHANGELOG.md

@@ -5,2 +5,15 @@ # Changelog

## [1.10.0](https://github.com/wolframdeus/vk-api/compare/v1.9.0...v1.10.0) (2020-06-24)
### Features
* **object:** create new objects ([ef15fb5](https://github.com/wolframdeus/vk-api/commit/ef15fb5539690a01bc82bc364f0c6f10912250bc))
* **widgets:** add widgets repository ([1eefde0](https://github.com/wolframdeus/vk-api/commit/1eefde0f893f5632804a6c73224758ee420f1d4f))
### Bug Fixes
* **utils.getlinkstats:** fix return type ([bcff1af](https://github.com/wolframdeus/vk-api/commit/bcff1af3ac4d18e38d861bc6189566ffaac76634))
## [1.9.0](https://github.com/wolframdeus/vk-api/compare/v1.8.2...v1.9.0) (2020-06-23)

@@ -7,0 +20,0 @@

3

dist/multithreading/VKAPIConsumer/VKAPIConsumer.d.ts
import { VKAPIInterface } from '../../VKAPI';
import { UsersRepository, MessagesRepository, NotificationsRepository, DatabaseRepository, UtilsRepository, StatsRepository, StreamingRepository } from '../../repositories';
import { UsersRepository, MessagesRepository, NotificationsRepository, DatabaseRepository, UtilsRepository, StatsRepository, StreamingRepository, WidgetsRepository } from '../../repositories';
import { SendRequest } from '../../types';

@@ -17,2 +17,3 @@ import { VKAPISlaveConstructorProps } from './types';

utils: UtilsRepository;
widgets: WidgetsRepository;
/**

@@ -19,0 +20,0 @@ * Tunnel name

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var utils_1=require("./utils"),repositories_1=require("../../repositories"),VKAPIConsumer=function(){return function(e){var s=this;if(void 0===e&&(e={}),this.requestId="0",this.addRequestToQueue=function(e){if(!process.send)throw new Error('Unable to process VKAPI request from slave due to there is no "process.send" method available. It looks like it was created in main thread, but not in fork');var t=(parseInt(s.requestId)+1).toString(16),o=process.pid,r={tunnelName:s.tunnelName,processId:o,requestId:t,isVKAPIMessage:!0,type:"process-request",config:e};return process.send(r),s.requestId=t,new Promise(function(e,r){var i=function(n){if(utils_1.isVKAPIRequestProcessedMessage(n)&&n.tunnelName===s.tunnelName&&n.requestId===t&&n.processId===o){if(process.off("message",i),n.error)return r(n.error);e(n.data)}};process.on("message",i)})},!process.send)throw new Error('Unable to create VKAPISlave due to there is no "process.send" method available. It looks like it was created in main thread, but not in fork');var t=e.tunnelName,o=void 0===t?"":t;this.tunnelName=o,this.database=new repositories_1.DatabaseRepository(this.addRequestToQueue),this.messages=new repositories_1.MessagesRepository(this.addRequestToQueue),this.notifications=new repositories_1.NotificationsRepository(this.addRequestToQueue),this.stats=new repositories_1.StatsRepository(this.addRequestToQueue),this.streaming=new repositories_1.StreamingRepository(this.addRequestToQueue),this.users=new repositories_1.UsersRepository(this.addRequestToQueue),this.utils=new repositories_1.UtilsRepository(this.addRequestToQueue)}}();exports.VKAPIConsumer=VKAPIConsumer,exports.VKAPISlave=VKAPIConsumer;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var utils_1=require("./utils"),repositories_1=require("../../repositories"),VKAPIConsumer=function(){return function(e){var s=this;if(void 0===e&&(e={}),this.requestId="0",this.addRequestToQueue=function(e){if(!process.send)throw new Error('Unable to process VKAPI request from slave due to there is no "process.send" method available. It looks like it was created in main thread, but not in fork');var t=(parseInt(s.requestId)+1).toString(16),o=process.pid,r={tunnelName:s.tunnelName,processId:o,requestId:t,isVKAPIMessage:!0,type:"process-request",config:e};return process.send(r),s.requestId=t,new Promise(function(e,r){var i=function(n){if(utils_1.isVKAPIRequestProcessedMessage(n)&&n.tunnelName===s.tunnelName&&n.requestId===t&&n.processId===o){if(process.off("message",i),n.error)return r(n.error);e(n.data)}};process.on("message",i)})},!process.send)throw new Error('Unable to create VKAPISlave due to there is no "process.send" method available. It looks like it was created in main thread, but not in fork');var t=e.tunnelName,o=void 0===t?"":t;this.tunnelName=o,this.database=new repositories_1.DatabaseRepository(this.addRequestToQueue),this.messages=new repositories_1.MessagesRepository(this.addRequestToQueue),this.notifications=new repositories_1.NotificationsRepository(this.addRequestToQueue),this.stats=new repositories_1.StatsRepository(this.addRequestToQueue),this.streaming=new repositories_1.StreamingRepository(this.addRequestToQueue),this.users=new repositories_1.UsersRepository(this.addRequestToQueue),this.utils=new repositories_1.UtilsRepository(this.addRequestToQueue),this.widgets=new repositories_1.WidgetsRepository(this.addRequestToQueue)}}();exports.VKAPIConsumer=VKAPIConsumer,exports.VKAPISlave=VKAPIConsumer;

@@ -8,1 +8,2 @@ export * from './DatabaseRepository';

export * from './UtilsRepository';
export * from './WidgetsRepository';

@@ -1,1 +0,1 @@

"use strict";function __export(e){for(var r in e)exports.hasOwnProperty(r)||(exports[r]=e[r])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(require("./DatabaseRepository")),__export(require("./MessagesRepository")),__export(require("./NotificationsRepository")),__export(require("./StatsRepository")),__export(require("./StreamingRepository")),__export(require("./UsersRepository")),__export(require("./UtilsRepository"));
"use strict";function __export(e){for(var r in e)exports.hasOwnProperty(r)||(exports[r]=e[r])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(require("./DatabaseRepository")),__export(require("./MessagesRepository")),__export(require("./NotificationsRepository")),__export(require("./StatsRepository")),__export(require("./StreamingRepository")),__export(require("./UsersRepository")),__export(require("./UtilsRepository")),__export(require("./WidgetsRepository"));

@@ -0,1 +1,2 @@

import { Button } from '../../types/objects';
/**

@@ -9,4 +10,3 @@ * @see https://vk.com/dev/messages.send

}>;
export interface SendParams {
userId?: number;
export declare type SendParams = {
randomId?: number;

@@ -16,7 +16,4 @@ peerId?: number;

chatId?: number;
userIds?: number[];
message?: string;
lat?: number;
long?: number;
attachment?: string;
replyTo?: number;

@@ -27,3 +24,3 @@ forwardMessages?: number[];

keyboard?: {
buttons: Array<Array<Record<any, any>>>;
buttons: Button[][];
} & ({

@@ -39,2 +36,11 @@ inline: true;

intent?: 'promo_newsletter' | 'bot_ad_invite' | 'bot_ad_promo';
}
} & ({
userId?: number;
} | {
userIds?: number[];
}) & ({
message: string;
} | {
message?: string;
attachment?: string;
});

@@ -1,2 +0,4 @@

import { NameCaseType, User, UserFieldType } from '../../types';
import { User } from '../../types';
export declare type NameCaseType = 'nom' | 'gen' | 'dat' | 'acc' | 'ins' | 'abl';
export declare type UserFieldType = 'about' | 'activities' | 'bdate' | 'blacklisted' | 'books' | 'can_post' | 'can_see_all_posts' | 'can_see_audio' | 'can_send_friend_request' | 'can_write_private_message' | 'career' | 'city' | 'common_count' | 'connections' | 'contacts' | 'counters' | 'country' | 'crop_photo' | 'domain' | 'education' | 'first_name_nom' | 'first_name_gen' | 'first_name_dat' | 'first_name_acc' | 'first_name_ins' | 'first_name_abl' | 'followers_count' | 'friend_status' | 'games' | 'has_mobile' | 'has_photo' | 'home_town' | 'interests' | 'is_favorite' | 'is_friend' | 'is_hidden_from_feed' | 'last_name_nom' | 'last_name_gen' | 'last_name_dat' | 'last_name_acc' | 'last_name_ins' | 'last_name_abl' | 'last_seen' | 'lists' | 'maiden_name' | 'military' | 'movies' | 'music' | 'nickname' | 'occupation' | 'online' | 'personal' | 'photo_50' | 'photo_100' | 'photo_200_orig' | 'photo_200' | 'photo_400_orig' | 'photo_id' | 'photo_max' | 'photo_max_orig' | 'quotes' | 'relatives' | 'relation' | 'schools' | 'screen_name' | 'sex' | 'site' | 'status' | 'timezone' | 'trending' | 'tv' | 'universities' | 'verified' | 'wall_default';
/**

@@ -3,0 +5,0 @@ * @see https://vk.com/dev/users.get

import { Repository } from '../Repository';
import { SendRequest } from '../../types';
import { CheckLinkParams, CheckLinkResult, DeleteFromLastShortenedParams, GetLastShortenedLinksParams, GetLastShortenedLinksResult, GetLinkStatsParams, GetServerTimeParams, GetShortLinkParams, GetShortLinkResult, ResolveScreenNameParams, ResolveScreenNameResult } from './types';
import { CheckLinkParams, CheckLinkResult, DeleteFromLastShortenedParams, GetLastShortenedLinksParams, GetLastShortenedLinksResult, GetLinkStatsParams, GetLinkStatsResult, GetServerTimeParams, GetShortLinkParams, GetShortLinkResult, ResolveScreenNameParams, ResolveScreenNameResult } from './types';
export declare class UtilsRepository extends Repository {

@@ -25,3 +25,3 @@ constructor(sendRequest: SendRequest);

*/
getLinkStats: import("../../types").RepositoryMethod<GetLinkStatsParams, GetLastShortenedLinksResult>;
getLinkStats: import("../../types").RepositoryMethod<GetLinkStatsParams, GetLinkStatsResult>;
/**

@@ -28,0 +28,0 @@ * @see https://vk.com/dev/utils.getServerTime

@@ -0,2 +1,3 @@

export * from './objects';
export * from './attachments';
export * from './shared';
export * from './user';

@@ -1,1 +0,1 @@

"use strict";function __export(e){for(var r in e)exports.hasOwnProperty(r)||(exports[r]=e[r])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(require("./shared")),__export(require("./user"));
"use strict";function __export(e){for(var r in e)exports.hasOwnProperty(r)||(exports[r]=e[r])}Object.defineProperty(exports,"__esModule",{value:!0}),__export(require("./objects")),__export(require("./attachments")),__export(require("./shared"));
import { RequestConfig, RequestOptionalParams, SendRequest } from '../types';
import { UsersRepository, StatsRepository, UtilsRepository, NotificationsRepository, MessagesRepository, DatabaseRepository, StreamingRepository } from '../repositories';
import { WidgetsRepository } from '../repositories/WidgetsRepository';
export interface QueueRequest {

@@ -35,2 +36,3 @@ /**

utils: UtilsRepository;
widgets: WidgetsRepository;
/**

@@ -37,0 +39,0 @@ * Adds request to queue and performs it after some time

import { SendRequest } from '../types';
import { VKAPIInterface, VKAPIConstructorProps } from './types';
import { UsersRepository, MessagesRepository, NotificationsRepository, StatsRepository, DatabaseRepository, UtilsRepository, StreamingRepository } from '../repositories';
import { UsersRepository, MessagesRepository, NotificationsRepository, StatsRepository, DatabaseRepository, UtilsRepository, StreamingRepository, WidgetsRepository } from '../repositories';
/**

@@ -15,2 +15,3 @@ * Class to perform request to VKontakte API

utils: UtilsRepository;
widgets: WidgetsRepository;
/**

@@ -17,0 +18,0 @@ * Queue of requests

@@ -1,1 +0,1 @@

"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function o(e){try{a(i.next(e))}catch(e){n(e)}}function u(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,u)}a((i=i.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var r,i,s,n,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return n={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function u(n){return function(u){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=(s=o.trys).length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],i=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,u])}}},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var isomorphic_fetch_1=__importDefault(require("isomorphic-fetch")),VKError_1=require("../VKError"),EventEmitter_1=require("../EventEmitter"),utils_1=require("../utils"),repositories_1=require("../repositories"),VKAPI=function(){function e(e){var t=this;void 0===e&&(e={}),this.queue=[],this.isQueueProcessing=!1,this.eventEmitter=new EventEmitter_1.EventEmitter,this.accessToken=null,this.sendRequest=function(e){return __awaiter(t,void 0,void 0,function(){var t,r,i,s,n,o;return __generator(this,function(u){switch(u.label){case 0:return t=e.method,r=e.params,i=utils_1.recursiveToSnakeCase(__assign({v:this.v,accessToken:this.accessToken,lang:this.lang},r)),s=Object.entries(i).map(function(e){var t=e[0],r=e[1],i="object"==typeof r?JSON.stringify(r):String(r);return encodeURIComponent(t)+"="+encodeURIComponent(i)}).join("&"),n="https://api.vk.com/method/"+t,this.isBrowser?[2,new Promise(function(e,t){var r="__vkapicallback"+Math.random().toString().slice(2),i=document.createElement("script");i.src=n+"?"+s+"&callback="+r,window[r]=function(r){if(document.head.removeChild(i),null==r?void 0:r.response)return e(utils_1.recursiveToCamelCase(r.response));t(new VKError_1.VKError(utils_1.recursiveToCamelCase((null==r?void 0:r.error)||{})))},document.head.appendChild(i)})]:[4,isomorphic_fetch_1.default(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:s})];case 1:return[4,u.sent().json()];case 2:if(null==(o=u.sent())?void 0:o.response)return[2,utils_1.recursiveToCamelCase(o.response)];throw new VKError_1.VKError(utils_1.recursiveToCamelCase((null==o?void 0:o.error)||{}))}})})},this.addRequestToQueue=function(e){var r=Symbol();t.queue.push({config:e,ref:r});var i=new Promise(function(e,i){var s=function(n,o,u){if(r===n){if(t.eventEmitter.off("request-performed",s),o)return i(o);e(u)}};t.eventEmitter.on("request-performed",s)});return t.processQueue(),i};var r=e.rps,i=void 0===r?3:r,s=e.accessToken,n=e.v,o=void 0===n?"5.110":n,u=e.lang,a=void 0===u?"ru":u,c=e.isBrowser,l=void 0!==c&&c;this.accessToken=s||null,this.v=o,this.lang=a,this.timeout=Math.ceil(1e3/i),this.isBrowser=l,this.database=new repositories_1.DatabaseRepository(this.addRequestToQueue),this.messages=new repositories_1.MessagesRepository(this.addRequestToQueue),this.notifications=new repositories_1.NotificationsRepository(this.addRequestToQueue),this.stats=new repositories_1.StatsRepository(this.addRequestToQueue),this.streaming=new repositories_1.StreamingRepository(this.addRequestToQueue),this.users=new repositories_1.UsersRepository(this.addRequestToQueue),this.utils=new repositories_1.UtilsRepository(this.addRequestToQueue)}return e.prototype.processQueue=function(){return __awaiter(this,void 0,void 0,function(){var e,t=this;return __generator(this,function(r){switch(r.label){case 0:return this.isQueueProcessing||0===this.queue.length?[2]:(this.isQueueProcessing=!0,(e=this.queue.map(function(e,r){return new Promise(function(i){setTimeout(function(){return __awaiter(t,void 0,void 0,function(){var t,r,s,n,o;return __generator(this,function(u){switch(u.label){case 0:t=e.config,r=e.ref,s=null,n=null,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.sendRequest(t)];case 2:return n=u.sent(),[3,4];case 3:return o=u.sent(),s=o,[3,4];case 4:return this.eventEmitter.emit("request-performed",r,s,n),this.queue.splice(this.queue.indexOf(e),1),i(),[2]}})})},r*t.timeout)})})).push(new Promise(function(e){setTimeout(e,t.queue.length*t.timeout)})),[4,Promise.all(e)]);case 1:return r.sent(),this.isQueueProcessing=!1,this.processQueue(),[2]}})})},e}();exports.VKAPI=VKAPI;
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function o(e){try{a(i.next(e))}catch(e){n(e)}}function u(e){try{a(i.throw(e))}catch(e){n(e)}}function a(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(o,u)}a((i=i.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var r,i,s,n,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return n={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function u(n){return function(u){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,i&&(s=2&n[0]?i.return:n[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,n[1])).done)return s;switch(i=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,i=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!(s=(s=o.trys).length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){o=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){o.label=n[1];break}if(6===n[0]&&o.label<s[1]){o.label=s[1],s=n;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(n);break}s[2]&&o.ops.pop(),o.trys.pop();continue}n=t.call(e,o)}catch(e){n=[6,e],i=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,u])}}},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var isomorphic_fetch_1=__importDefault(require("isomorphic-fetch")),VKError_1=require("../VKError"),EventEmitter_1=require("../EventEmitter"),utils_1=require("../utils"),repositories_1=require("../repositories"),VKAPI=function(){function e(e){var t=this;void 0===e&&(e={}),this.queue=[],this.isQueueProcessing=!1,this.eventEmitter=new EventEmitter_1.EventEmitter,this.accessToken=null,this.sendRequest=function(e){return __awaiter(t,void 0,void 0,function(){var t,r,i,s,n,o;return __generator(this,function(u){switch(u.label){case 0:return t=e.method,r=e.params,i=utils_1.recursiveToSnakeCase(__assign({v:this.v,accessToken:this.accessToken,lang:this.lang},r)),s=Object.entries(i).map(function(e){var t=e[0],r=e[1],i="object"==typeof r?JSON.stringify(r):String(r);return encodeURIComponent(t)+"="+encodeURIComponent(i)}).join("&"),n="https://api.vk.com/method/"+t,this.isBrowser?[2,new Promise(function(e,t){var r="__vkapicallback"+Math.random().toString().slice(2),i=document.createElement("script");i.src=n+"?"+s+"&callback="+r,window[r]=function(r){if(document.head.removeChild(i),null==r?void 0:r.response)return e(utils_1.recursiveToCamelCase(r.response));t(new VKError_1.VKError(utils_1.recursiveToCamelCase((null==r?void 0:r.error)||{})))},document.head.appendChild(i)})]:[4,isomorphic_fetch_1.default(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:s})];case 1:return[4,u.sent().json()];case 2:if(null==(o=u.sent())?void 0:o.response)return[2,utils_1.recursiveToCamelCase(o.response)];throw new VKError_1.VKError(utils_1.recursiveToCamelCase((null==o?void 0:o.error)||{}))}})})},this.addRequestToQueue=function(e){var r=Symbol();t.queue.push({config:e,ref:r});var i=new Promise(function(e,i){var s=function(n,o,u){if(r===n){if(t.eventEmitter.off("request-performed",s),o)return i(o);e(u)}};t.eventEmitter.on("request-performed",s)});return t.processQueue(),i};var r=e.rps,i=void 0===r?3:r,s=e.accessToken,n=e.v,o=void 0===n?"5.110":n,u=e.lang,a=void 0===u?"ru":u,c=e.isBrowser,l=void 0!==c&&c;this.accessToken=s||null,this.v=o,this.lang=a,this.timeout=Math.ceil(1e3/i),this.isBrowser=l,this.database=new repositories_1.DatabaseRepository(this.addRequestToQueue),this.messages=new repositories_1.MessagesRepository(this.addRequestToQueue),this.notifications=new repositories_1.NotificationsRepository(this.addRequestToQueue),this.stats=new repositories_1.StatsRepository(this.addRequestToQueue),this.streaming=new repositories_1.StreamingRepository(this.addRequestToQueue),this.users=new repositories_1.UsersRepository(this.addRequestToQueue),this.utils=new repositories_1.UtilsRepository(this.addRequestToQueue),this.widgets=new repositories_1.WidgetsRepository(this.addRequestToQueue)}return e.prototype.processQueue=function(){return __awaiter(this,void 0,void 0,function(){var e,t=this;return __generator(this,function(r){switch(r.label){case 0:return this.isQueueProcessing||0===this.queue.length?[2]:(this.isQueueProcessing=!0,(e=this.queue.map(function(e,r){return new Promise(function(i){setTimeout(function(){return __awaiter(t,void 0,void 0,function(){var t,r,s,n,o;return __generator(this,function(u){switch(u.label){case 0:t=e.config,r=e.ref,s=null,n=null,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this.sendRequest(t)];case 2:return n=u.sent(),[3,4];case 3:return o=u.sent(),s=o,[3,4];case 4:return this.eventEmitter.emit("request-performed",r,s,n),this.queue.splice(this.queue.indexOf(e),1),i(),[2]}})})},r*t.timeout)})})).push(new Promise(function(e){setTimeout(e,t.queue.length*t.timeout)})),[4,Promise.all(e)]);case 1:return r.sent(),this.isQueueProcessing=!1,this.processQueue(),[2]}})})},e}();exports.VKAPI=VKAPI;
{
"name": "vkontakte-api",
"version": "1.9.0",
"version": "1.10.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc