eventregistry
Advanced tools
Comparing version 8.9.2 to 8.10.0
@@ -5,2 +5,11 @@ # NodeJS SDK: Change Log | ||
## [v8.10.0]() (2021-10-19) | ||
**Added** | ||
- added file `QueryMentions` that can be used to query mentions of specific event types. The class is currently in beta and not available to users unless they have permissions to use this endpoint. The classes `QueryMentions` and `QueryMentionsIter` can be used in the same way as classes for querying articles and events, except that some query parameters are added and some removed. Examples for the classes were also added. | ||
**Updated** | ||
- When using method `initWithComplexQuery` we now check if the provided json is valid json object and report error in case it is not | ||
## [v8.9.2]() (2021-05-12) | ||
@@ -12,3 +21,2 @@ | ||
## [v8.9]() (2020-11-24) | ||
@@ -15,0 +23,0 @@ |
@@ -234,5 +234,5 @@ "use strict"; | ||
error_1 = _a.sent(); | ||
console.error("Event Registry Analytics exception while executing the request."); | ||
request = { data: { error: error_1 } }; | ||
if (this.config.verboseOutput) { | ||
console.error("Event Registry Analytics exception while executing the request."); | ||
if (error_1 && error_1.stack && error_1.message) { | ||
@@ -321,6 +321,6 @@ console.error(error_1.message); | ||
error_2 = _a.sent(); | ||
console.error("Event Registry exception while executing the request."); | ||
request = { data: { error: error_2 } }; | ||
// 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) { | ||
console.error("Event Registry exception while executing the request."); | ||
if (error_2 && error_2.stack && error_2.message) { | ||
@@ -327,0 +327,0 @@ console.error(error_2.message); |
@@ -15,2 +15,3 @@ export { Analytics } from "./analytics"; | ||
export { QueryEvents, QueryEventsIter, RequestEventsInfo, RequestEventsUriWgtList, RequestEventsTimeAggr, RequestEventsKeywordAggr, RequestEventsLocAggr, RequestEventsLocTimeAggr, RequestEventsConceptAggr, RequestEventsConceptGraph, RequestEventsConceptMatrix, RequestEventsConceptTrends, RequestEventsSourceAggr, RequestEventsDateMentionAggr, RequestEventsEventClusters, RequestEventsCategoryAggr, RequestEventsRecentActivity, } from "./queryEvents"; | ||
export { QueryMentions, QueryMentionsIter, RequestMentions, RequestMentionsInfo, RequestMentionsUriWgtList, RequestMentionsTimeAggr, RequestMentionsConceptAggr, RequestMentionsCategoryAggr, RequestMentionsSourceAggr, RequestMentionsKeywordAggr, RequestMentionsConceptGraph, RequestMentionsRecentActivity, } from "./queryMentions"; | ||
export { QueryStory, RequestStoryInfo, RequestStoryArticles, RequestStoryArticleUris, RequestStoryArticleTrend, RequestStorySimilarStories, } from "./queryStory"; | ||
@@ -17,0 +18,0 @@ export { GetRecentEvents, GetRecentArticles, } from "./recent"; |
@@ -82,2 +82,15 @@ "use strict"; | ||
exports.RequestEventsRecentActivity = queryEvents_1.RequestEventsRecentActivity; | ||
var queryMentions_1 = require("./queryMentions"); | ||
exports.QueryMentions = queryMentions_1.QueryMentions; | ||
exports.QueryMentionsIter = queryMentions_1.QueryMentionsIter; | ||
exports.RequestMentions = queryMentions_1.RequestMentions; | ||
exports.RequestMentionsInfo = queryMentions_1.RequestMentionsInfo; | ||
exports.RequestMentionsUriWgtList = queryMentions_1.RequestMentionsUriWgtList; | ||
exports.RequestMentionsTimeAggr = queryMentions_1.RequestMentionsTimeAggr; | ||
exports.RequestMentionsConceptAggr = queryMentions_1.RequestMentionsConceptAggr; | ||
exports.RequestMentionsCategoryAggr = queryMentions_1.RequestMentionsCategoryAggr; | ||
exports.RequestMentionsSourceAggr = queryMentions_1.RequestMentionsSourceAggr; | ||
exports.RequestMentionsKeywordAggr = queryMentions_1.RequestMentionsKeywordAggr; | ||
exports.RequestMentionsConceptGraph = queryMentions_1.RequestMentionsConceptGraph; | ||
exports.RequestMentionsRecentActivity = queryMentions_1.RequestMentionsRecentActivity; | ||
var queryStory_1 = require("./queryStory"); | ||
@@ -84,0 +97,0 @@ exports.QueryStory = queryStory_1.QueryStory; |
@@ -198,2 +198,8 @@ "use strict"; | ||
else if (_.isString(complexQuery)) { | ||
try { | ||
JSON.parse(complexQuery); | ||
} | ||
catch (_a) { | ||
console.error("Failed to parse the provided string content as a JSON object. Please check the content provided as a parameter to the initWithComplexQuery() method"); | ||
} | ||
query.setVal("query", complexQuery); | ||
@@ -200,0 +206,0 @@ } |
@@ -198,2 +198,8 @@ "use strict"; | ||
else if (_.isString(complexQuery)) { | ||
try { | ||
JSON.parse(complexQuery); | ||
} | ||
catch (_a) { | ||
console.error("Failed to parse the provided string content as a JSON object. Please check the content provided as a parameter to the initWithComplexQuery() method"); | ||
} | ||
query.setVal("query", complexQuery); | ||
@@ -200,0 +206,0 @@ } |
@@ -11,2 +11,8 @@ import { ArticleInfoFlags, BaseQuery, CombinedQuery, ComplexArticleQuery, EventRegistry, ConceptInfoFlags, QueryArticle, QueryArticles, QueryArticlesIter, QueryItems, RequestArticlesInfo, RequestArticlesRecentActivity, ReturnInfo } from "eventregistry"; | ||
const MAX_RESULTS = 100; | ||
const query = new QueryArticlesIter(er, {keywords: "Tesla Inc", maxItems: MAX_RESULTS}); | ||
query.execQuery((item) => { | ||
console.info(item); | ||
}); | ||
// search for the phrase "Barack Obama" - both words have to appear together | ||
@@ -13,0 +19,0 @@ const q1 = new QueryArticles({keywords: "Barack Obama"}); |
@@ -5,3 +5,3 @@ { | ||
"description": "Package containing wrapper functions for Event Registry API", | ||
"version": "8.9.2", | ||
"version": "8.10.0", | ||
"license": "MIT", | ||
@@ -8,0 +8,0 @@ "main": "./dist/index.js", |
@@ -167,5 +167,5 @@ import axios, { AxiosResponse, AxiosRequestConfig } from "axios"; | ||
} catch (error) { | ||
console.error("Event Registry Analytics exception while executing the request."); | ||
request = { data: {error} }; | ||
if (this.config.verboseOutput) { | ||
console.error("Event Registry Analytics exception while executing the request."); | ||
if (error && error.stack && error.message) { | ||
@@ -235,6 +235,6 @@ console.error(error.message); | ||
} catch (error) { | ||
console.error("Event Registry exception while executing the request."); | ||
request = { data: {error} }; | ||
// 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) { | ||
console.error("Event Registry exception while executing the request."); | ||
if (error && error.stack && error.message) { | ||
@@ -241,0 +241,0 @@ console.error(error.message); |
@@ -80,2 +80,16 @@ | ||
export { | ||
QueryMentions, | ||
QueryMentionsIter, | ||
RequestMentions, | ||
RequestMentionsInfo, | ||
RequestMentionsUriWgtList, | ||
RequestMentionsTimeAggr, | ||
RequestMentionsConceptAggr, | ||
RequestMentionsCategoryAggr, | ||
RequestMentionsSourceAggr, | ||
RequestMentionsKeywordAggr, | ||
RequestMentionsConceptGraph, | ||
RequestMentionsRecentActivity, | ||
} from "./queryMentions"; | ||
export { | ||
QueryStory, | ||
@@ -82,0 +96,0 @@ RequestStoryInfo, |
@@ -160,2 +160,7 @@ import * as _ from "lodash"; | ||
} else if (_.isString(complexQuery)) { | ||
try { | ||
JSON.parse(complexQuery); | ||
} catch { | ||
console.error("Failed to parse the provided string content as a JSON object. Please check the content provided as a parameter to the initWithComplexQuery() method"); | ||
} | ||
query.setVal("query", complexQuery); | ||
@@ -162,0 +167,0 @@ } else if (_.isObject(complexQuery)) { |
@@ -167,2 +167,7 @@ import * as _ from "lodash"; | ||
} else if (_.isString(complexQuery)) { | ||
try { | ||
JSON.parse(complexQuery); | ||
} catch { | ||
console.error("Failed to parse the provided string content as a JSON object. Please check the content provided as a parameter to the initWithComplexQuery() method"); | ||
} | ||
query.setVal("query", complexQuery); | ||
@@ -169,0 +174,0 @@ } else if (_.isObject(complexQuery)) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1110819
116
19742