eventregistry
Advanced tools
Comparing version 8.5.11 to 8.5.12
@@ -29,3 +29,3 @@ import { AxiosResponse } from "axios"; | ||
*/ | ||
jsonRequest(path: any, parameters?: any, allowUseOfArchive?: any): Promise<any>; | ||
jsonRequest(path: any, parameters?: any, allowUseOfArchive?: boolean): Promise<any>; | ||
/** | ||
@@ -32,0 +32,0 @@ * get the number of requests that are still available for the user today. Information is only accessible after you make some query. |
@@ -217,2 +217,3 @@ "use strict"; | ||
EventRegistry.prototype.jsonRequest = function (path, parameters, allowUseOfArchive) { | ||
if (allowUseOfArchive === void 0) { allowUseOfArchive = this.config.allowUseOfArchive; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -229,8 +230,9 @@ var request, current, errorMessage, error_2; | ||
_a.label = 2; | ||
case 2: | ||
// await this.lock.acquire(); | ||
case 2: return [4 /*yield*/, this.lock.acquire()]; | ||
case 3: | ||
_a.sent(); | ||
this.lastQueryTime = current; | ||
_a.label = 3; | ||
case 3: | ||
_a.trys.push([3, 5, 6, 7]); | ||
_a.label = 4; | ||
case 4: | ||
_a.trys.push([4, 6, 7, 8]); | ||
_.set(parameters, "apiKey", this.config.apiKey); | ||
@@ -250,3 +252,3 @@ if (!allowUseOfArchive) { | ||
})]; | ||
case 4: | ||
case 5: | ||
request = _a.sent(); | ||
@@ -266,4 +268,4 @@ this.headers = _.get(request, "headers", {}); | ||
} | ||
return [3 /*break*/, 7]; | ||
case 5: | ||
return [3 /*break*/, 8]; | ||
case 6: | ||
error_2 = _a.sent(); | ||
@@ -277,5 +279,7 @@ // try to print out the error that should be passed by in case the server is down or responds with errors | ||
} | ||
return [3 /*break*/, 7]; | ||
case 6: return [7 /*endfinally*/]; | ||
case 7: return [2 /*return*/, request]; | ||
return [3 /*break*/, 8]; | ||
case 7: | ||
this.lock.release(); | ||
return [7 /*endfinally*/]; | ||
case 8: return [2 /*return*/, request]; | ||
} | ||
@@ -282,0 +286,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"description": "Package containing wrapper functions for Event Registry API", | ||
"version": "8.5.11", | ||
"version": "8.5.12", | ||
"license": "MIT", | ||
@@ -37,3 +37,2 @@ "main": "./dist/index.js", | ||
"moment": "2.22.1", | ||
"qs": "6.5.1", | ||
"semaphore-async-await": "^1.5.1", | ||
@@ -40,0 +39,0 @@ "winston": "^3.0.0-rc5" |
@@ -5,4 +5,3 @@ import axios, { AxiosResponse } from "axios"; | ||
import * as moment from "moment"; | ||
import Semaphore from 'semaphore-async-await'; | ||
import * as Qs from "qs"; | ||
import Semaphore from "semaphore-async-await"; | ||
import * as winston from "winston"; | ||
@@ -143,3 +142,3 @@ import { sleep } from "./base"; | ||
*/ | ||
public async jsonRequest(path, parameters?, allowUseOfArchive?) { | ||
public async jsonRequest(path, parameters?, allowUseOfArchive = this.config.allowUseOfArchive) { | ||
let request; | ||
@@ -146,0 +145,0 @@ const current = moment.utc().milliseconds(); |
Sorry, the diff of this file is not supported yet
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
955600
9
17590