vkontakte-api
Advanced tools
Comparing version 2.5.3 to 2.5.4
@@ -5,2 +5,9 @@ # Changelog | ||
### [2.5.4](https://github.com/wolframdeus/vk-api/compare/v2.5.3...v2.5.4) (2021-06-25) | ||
### Bug Fixes | ||
* **consumer:** fix addRepository typings ([39cd64c](https://github.com/wolframdeus/vk-api/commit/39cd64ce36788f164886eab47c64eaea7575e593)) | ||
### [2.5.3](https://github.com/wolframdeus/vk-api/compare/v2.5.2...v2.5.3) (2021-06-24) | ||
@@ -7,0 +14,0 @@ |
@@ -112,2 +112,5 @@ "use strict"; | ||
}; | ||
_this.addRepository = function (name, Repo) { | ||
return _super.prototype.addRepository.call(_this, name, Repo, _this.addRequestToQueue); | ||
}; | ||
if (!process.send) { | ||
@@ -125,7 +128,4 @@ throw new Error('Unable to create VKAPIConsumer due to there is no "process.send" ' + | ||
} | ||
VKAPIConsumer.prototype.addRepository = function (name, Repo) { | ||
return _super.prototype.addRepository.call(this, name, Repo, this.addRequestToQueue); | ||
}; | ||
return VKAPIConsumer; | ||
}(Core_1.Core)); | ||
exports.VKAPIConsumer = VKAPIConsumer; |
import { IVKAPI } from '../../VKAPI'; | ||
import { TSendRequest } from '../../types'; | ||
import { TAddRepository, TSendRequest } from '../../types'; | ||
import { IVKAPIConsumerConstructorProps } from './types'; | ||
import { Core } from '../../Core'; | ||
import { Repository } from '../../repositories'; | ||
/** | ||
@@ -29,6 +28,3 @@ * Stub class which wants to get data from API VKontakte and has to | ||
addRequestToQueue: TSendRequest; | ||
addRepository<N extends string, R extends Repository>(name: N extends keyof this ? never : N, Repo: { | ||
new (sendRequest: TSendRequest): R; | ||
prototype: R; | ||
}): this & Record<N, R>; | ||
addRepository: TAddRepository<this>; | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{a(r.next(e))}catch(e){s(e)}}function u(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,u)}a((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.VKAPIConsumer=void 0;var utils_1=require("./utils"),Core_1=require("../../Core"),constants_1=require("../constants"),VKAPIConsumer=function(e){function t(t){var n=e.call(this)||this;if(n.requestId="0",n.sendRequest=function(e){return n.instance.sendRequest(e)},n.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(n.requestId)+1).toString(16),r={tunnelName:n.tunnelName,requestId:t,isVKAPIMessage:!0,type:constants_1.PERFORM_REQUEST_EVENT};n.requestId=t;var o=new Promise(function(r,o){var s=function(i){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(n){if(utils_1.isVKAPIRequestPerformAllowedMessage(i)&&i.tunnelName===this.tunnelName&&i.requestId===t){process.off("message",s);try{r(this.instance.sendRequest(e))}catch(e){o(e)}}return[2]})})};process.on("message",s)});return process.send(r),o},!process.send)throw new Error('Unable to create VKAPIConsumer due to there is no "process.send" method available. It looks like it was created in main thread, but not in fork.');var r=t.tunnelName,o=void 0===r?"":r,s=t.instance;return n.tunnelName=o,n.instance=s,n.init(n.addRequestToQueue),n}return __extends(t,e),t.prototype.addRepository=function(t,n){return e.prototype.addRepository.call(this,t,n,this.addRequestToQueue)},t}(Core_1.Core);exports.VKAPIConsumer=VKAPIConsumer; | ||
"use strict";var __extends=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),__awaiter=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,s){function i(e){try{a(r.next(e))}catch(e){s(e)}}function u(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(i,u)}a((r=r.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function u(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.VKAPIConsumer=void 0;var utils_1=require("./utils"),Core_1=require("../../Core"),constants_1=require("../constants"),VKAPIConsumer=function(e){function t(t){var n=e.call(this)||this;if(n.requestId="0",n.sendRequest=function(e){return n.instance.sendRequest(e)},n.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(n.requestId)+1).toString(16),r={tunnelName:n.tunnelName,requestId:t,isVKAPIMessage:!0,type:constants_1.PERFORM_REQUEST_EVENT};n.requestId=t;var o=new Promise(function(r,o){var s=function(i){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(n){if(utils_1.isVKAPIRequestPerformAllowedMessage(i)&&i.tunnelName===this.tunnelName&&i.requestId===t){process.off("message",s);try{r(this.instance.sendRequest(e))}catch(e){o(e)}}return[2]})})};process.on("message",s)});return process.send(r),o},n.addRepository=function(t,r){return e.prototype.addRepository.call(n,t,r,n.addRequestToQueue)},!process.send)throw new Error('Unable to create VKAPIConsumer due to there is no "process.send" method available. It looks like it was created in main thread, but not in fork.');var r=t.tunnelName,o=void 0===r?"":r,s=t.instance;return n.tunnelName=o,n.instance=s,n.init(n.addRequestToQueue),n}return __extends(t,e),t}(Core_1.Core);exports.VKAPIConsumer=VKAPIConsumer; |
{ | ||
"name": "vkontakte-api", | ||
"version": "2.5.3", | ||
"version": "2.5.4", | ||
"description": "TypeScript library to make requests performing to VK API simple", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/wolframdeus/vk-api", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
367069
6127