vkontakte-api
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.3.2](https://github.com/wolframdeus/vk-api/compare/v1.3.1...v1.3.2) (2020-06-11) | ||
### Bug Fixes | ||
* **errors handling:** fixed error handling ([517a698](https://github.com/wolframdeus/vk-api/commit/517a6981320d146baf96b0c8cfb9ef984f6f8b58)) | ||
### [1.3.1](https://github.com/wolframdeus/vk-api/compare/v1.3.0...v1.3.1) (2020-06-11) | ||
@@ -7,0 +14,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,t,r,s){return new(r||(r=Promise))(function(n,o){function i(e){try{a(s.next(e))}catch(e){o(e)}}function u(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,u)}a((s=s.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var r,s,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,s&&(n=2&o[0]?s.return:o[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,o[1])).done)return n;switch(s=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,s=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(6===o[0]&&i.label<n[1]){i.label=n[1],n=o;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(o);break}n[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],s=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,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")),RequestsQueue_1=require("../RequestsQueue"),repositories_1=require("../repositories"),VKError_1=require("../VKError"),utils_1=require("./utils"),utils_2=require("../utils"),VKAPI=function(){return function(e){var t=this;this.accessToken=null,this.processRequest=function(e){return t.requestsQueue.add(e)},this.sendRequest=function(e){return __awaiter(t,void 0,void 0,function(){var t,r,s,n,o;return __generator(this,function(i){switch(i.label){case 0:t=e.method,r=e.options,s=utils_2.formatQuery(__assign({v:this.version,accessToken:this.accessToken},r)),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,isomorphic_fetch_1.default("https://api.vk.com/method/"+t+"?"+s).then(function(e){return e.json()})];case 2:return n=i.sent(),[2,utils_1.recursiveToCamelCase(n.response)];case 3:if((o=i.sent()).error)throw new VKError_1.VKError(o.error);throw new Error("Unknown error");case 4:return[2]}})})};var r=e.requestsPerSecond,s=e.accessToken,n=e.version;this.accessToken=s||null,this.version=n||"5.122",this.requestsQueue=new RequestsQueue_1.RequestsQueue({requestsPerSecond:r,sendRequest:this.sendRequest}),this.users=new repositories_1.UsersRepository({processRequest:this.processRequest}),this.notifications=new repositories_1.NotificationsRepository({processRequest:this.processRequest}),this.messages=new repositories_1.MessagesRepository({processRequest:this.processRequest})}}();exports.VKAPI=VKAPI; | ||
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},__awaiter=this&&this.__awaiter||function(e,t,r,s){return new(r||(r=Promise))(function(n,o){function i(e){try{a(s.next(e))}catch(e){o(e)}}function u(e){try{a(s.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,u)}a((s=s.apply(e,t||[])).next())})},__generator=this&&this.__generator||function(e,t){var r,s,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,s&&(n=2&o[0]?s.return:o[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,o[1])).done)return n;switch(s=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,s=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(n=(n=i.trys).length>0&&n[n.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){i.label=o[1];break}if(6===o[0]&&i.label<n[1]){i.label=n[1],n=o;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(o);break}n[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],s=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,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")),RequestsQueue_1=require("../RequestsQueue"),repositories_1=require("../repositories"),VKError_1=require("../VKError"),utils_1=require("./utils"),utils_2=require("../utils"),VKAPI=function(){return function(e){var t=this;this.accessToken=null,this.processRequest=function(e){return t.requestsQueue.add(e)},this.sendRequest=function(e){return __awaiter(t,void 0,void 0,function(){var t,r,s,n;return __generator(this,function(o){switch(o.label){case 0:return t=e.method,r=e.options,s=utils_2.formatQuery(__assign({v:this.version,accessToken:this.accessToken},r)),[4,isomorphic_fetch_1.default("https://api.vk.com/method/"+t+"?"+s).then(function(e){return e.json()})];case 1:if((n=o.sent()).error)throw new VKError_1.VKError(n.error);return[2,utils_1.recursiveToCamelCase(n.response)]}})})};var r=e.requestsPerSecond,s=e.accessToken,n=e.version;this.accessToken=s||null,this.version=n||"5.122",this.requestsQueue=new RequestsQueue_1.RequestsQueue({requestsPerSecond:r,sendRequest:this.sendRequest}),this.users=new repositories_1.UsersRepository({processRequest:this.processRequest}),this.notifications=new repositories_1.NotificationsRepository({processRequest:this.processRequest}),this.messages=new repositories_1.MessagesRepository({processRequest:this.processRequest})}}();exports.VKAPI=VKAPI; |
{ | ||
"name": "vkontakte-api", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
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
49626