eventregistry
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -72,3 +72,3 @@ "use strict"; | ||
} | ||
if (config.logging) { | ||
if (this.config.logging) { | ||
this.logger = winston.createLogger({ | ||
@@ -156,5 +156,8 @@ level: "info", | ||
// try to print out the error that should be passed by in case the server is down or responds with errors | ||
if (this.config.verboseOutput) { | ||
if (this.config.logging) { | ||
this.logger.error(_.get(error_1, "errno", error_1)); | ||
} | ||
if (this.config.verboseOutput) { | ||
console.error(error_1); | ||
} | ||
return [3 /*break*/, 3]; | ||
@@ -208,6 +211,8 @@ case 3: return [2 /*return*/, request]; | ||
// try to print out the error that should be passed by in case the server is down or responds with errors | ||
if (this.config.verboseOutput) { | ||
if (this.config.logging) { | ||
this.logger.error(_.get(error_2, "errno", error_2)); | ||
throw new Error(error_2); | ||
} | ||
if (this.config.verboseOutput) { | ||
console.error(error_2); | ||
} | ||
return [3 /*break*/, 6]; | ||
@@ -214,0 +219,0 @@ case 6: return [2 /*return*/, request]; |
@@ -162,8 +162,8 @@ "use strict"; | ||
returnInfo: new returnInfo_1.ReturnInfo(), | ||
articleBatchSize: 200, | ||
articleBatchSize: 100, | ||
maxItems: -1, | ||
}); | ||
var sortBy = args.sortBy, sortByAsc = args.sortByAsc, returnInfo = args.returnInfo, articleBatchSize = args.articleBatchSize, maxItems = args.maxItems; | ||
if (articleBatchSize > 200) { | ||
throw new Error("You can not have a batch size > 200 items"); | ||
if (articleBatchSize > 100) { | ||
throw new Error("Batch size should not exceed 100"); | ||
} | ||
@@ -312,4 +312,4 @@ _this.er = er; | ||
} | ||
if (count > 200) { | ||
throw new RangeError("at most 200 articles can be returned per call"); | ||
if (count > 100) { | ||
throw new RangeError("at most 100 articles can be returned per call"); | ||
} | ||
@@ -316,0 +316,0 @@ _this.params = {}; |
@@ -130,3 +130,3 @@ "use strict"; | ||
action: "getEvents", | ||
eventUriList: uriList, | ||
eventUriList: _.join(uriList, ","), | ||
}; | ||
@@ -175,3 +175,6 @@ return query; | ||
_this.uriPage = 0; | ||
var _a = args.sortBy, sortBy = _a === void 0 ? "rel" : _a, _b = args.sortByAsc, sortByAsc = _b === void 0 ? false : _b, _c = args.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c, _d = args.eventBatchSize, eventBatchSize = _d === void 0 ? 200 : _d, _e = args.maxItems, maxItems = _e === void 0 ? -1 : _e; | ||
var _a = args.sortBy, sortBy = _a === void 0 ? "rel" : _a, _b = args.sortByAsc, sortByAsc = _b === void 0 ? false : _b, _c = args.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c, _d = args.eventBatchSize, eventBatchSize = _d === void 0 ? 50 : _d, _e = args.maxItems, maxItems = _e === void 0 ? -1 : _e; | ||
if (eventBatchSize > 50) { | ||
throw new Error("Batch size should not exceed 50"); | ||
} | ||
_this.er = er; | ||
@@ -320,4 +323,4 @@ _this.sortBy = sortBy; | ||
} | ||
if (count > 200) { | ||
throw new RangeError("At most 200 articles can be returned per call"); | ||
if (count > 50) { | ||
throw new RangeError("At most 50 events can be returned per call"); | ||
} | ||
@@ -324,0 +327,0 @@ _this.params = {}; |
@@ -5,3 +5,3 @@ { | ||
"description": "Package containing wrapper functions for Event Registry API", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "./dist/index.js", |
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
2630643
28717