eventregistry 8.9.2 → 8.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/dist/eventRegistry.js +2 -2
- package/dist/eventRegistry.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/queryArticles.js +6 -0
- package/dist/queryArticles.js.map +1 -1
- package/dist/queryEvents.js +6 -0
- package/dist/queryEvents.js.map +1 -1
- package/dist/queryMentions.d.ts +95 -0
- package/dist/queryMentions.js +579 -0
- package/dist/queryMentions.js.map +1 -0
- package/dist/topicPage.js +2 -2
- package/dist/topicPage.js.map +1 -1
- package/{src → dist}/types.d.ts +284 -195
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +6 -5
- package/dist/correlations.d.ts +0 -50
- package/dist/correlations.js +0 -397
- package/dist/correlations.js.map +0 -1
- package/examples/autoSuggestionsExamples.ts +0 -46
- package/examples/countsExamples.ts +0 -34
- package/examples/dailySharesExamples.ts +0 -54
- package/examples/eventForTextExamples.ts +0 -32
- package/examples/feedOfNewArticlesExamples.ts +0 -82
- package/examples/feedOfNewEventsExamples.ts +0 -70
- package/examples/queryArticleExamples.ts +0 -42
- package/examples/queryArticlesExamples.ts +0 -242
- package/examples/queryEventExamples.ts +0 -99
- package/examples/queryEventsExamples.ts +0 -232
- package/examples/topicPageExamples.ts +0 -97
- package/examples/trendsExamples.ts +0 -34
- package/src/analytics.ts +0 -181
- package/src/base.ts +0 -198
- package/src/counts.ts +0 -119
- package/src/dailyShares.ts +0 -48
- package/src/eventForText.ts +0 -61
- package/src/eventRegistry.ts +0 -733
- package/src/index.ts +0 -111
- package/src/info.ts +0 -121
- package/src/query.ts +0 -257
- package/src/queryArticle.ts +0 -139
- package/src/queryArticles.ts +0 -603
- package/src/queryEvent.ts +0 -473
- package/src/queryEvents.ts +0 -684
- package/src/queryStory.ts +0 -152
- package/src/recent.ts +0 -63
- package/src/returnInfo.ts +0 -363
- package/src/topicPage.ts +0 -479
- package/src/trends.ts +0 -63
- package/test/index.d.ts +0 -18
- package/test/jasmine.json +0 -10
- package/test/spec/analytics.spec.ts +0 -150
- package/test/spec/autoSuggestions.spec.ts +0 -54
- package/test/spec/info.spec.ts +0 -84
- package/test/spec/invalidQueries.spec.ts +0 -147
- package/test/spec/queryArticle.spec.ts +0 -62
- package/test/spec/queryArticles.spec.ts +0 -541
- package/test/spec/queryArticlesComplex.spec.ts +0 -298
- package/test/spec/queryEvent.spec.ts +0 -194
- package/test/spec/queryEvents.spec.ts +0 -491
- package/test/spec/queryEventsComplex.spec.ts +0 -188
- package/test/spec/queryPaging.spec.ts +0 -318
- package/test/spec/returnInfo.spec.ts +0 -34
- package/test/spec/topicPage.spec.ts +0 -83
- package/test/spec/utils.ts +0 -436
- package/test/tsconfig.json +0 -31
- package/tsconfig.json +0 -32
- package/tslint.json +0 -25
package/src/queryStory.ts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import * as _ from "lodash";
|
|
2
|
-
import {mainLangs, Query, QueryParamsBase } from "./base";
|
|
3
|
-
import {ArticleInfoFlags, ReturnInfo } from "./returnInfo";
|
|
4
|
-
|
|
5
|
-
export class QueryStory extends Query<RequestStory> {
|
|
6
|
-
constructor(storyUriOrList) {
|
|
7
|
-
super();
|
|
8
|
-
this.setVal("action", "getStory");
|
|
9
|
-
this.queryByUri(storyUriOrList);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
public get path() {
|
|
13
|
-
return "/api/v1/story";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Search stories by their uri(s)
|
|
18
|
-
*/
|
|
19
|
-
public queryByUri(uriOrUriList: string | string[]) {
|
|
20
|
-
this.setVal("storyUri", uriOrUriList);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public setRequestedResult(requestStory) {
|
|
24
|
-
if (!(requestStory instanceof RequestStory)) {
|
|
25
|
-
throw Error("QueryStory class can only accept result requests that are of type RequestStory");
|
|
26
|
-
}
|
|
27
|
-
this.resultTypeList = [requestStory];
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export class RequestStory {}
|
|
33
|
-
|
|
34
|
-
export class RequestStoryInfo extends RequestStory {
|
|
35
|
-
public resultType = "info";
|
|
36
|
-
public params;
|
|
37
|
-
|
|
38
|
-
constructor(returnInfo = new ReturnInfo()) {
|
|
39
|
-
super();
|
|
40
|
-
this.params = returnInfo.getParams("info");
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export class RequestStoryArticles extends RequestStory {
|
|
45
|
-
public resultType = "articles";
|
|
46
|
-
public params;
|
|
47
|
-
|
|
48
|
-
constructor({ page = 1,
|
|
49
|
-
count = 100,
|
|
50
|
-
sortBy = "cosSim",
|
|
51
|
-
sortByAsc = false,
|
|
52
|
-
returnInfo = new ReturnInfo({articleInfo: new ArticleInfoFlags({bodyLen: 200})}),
|
|
53
|
-
...unsupported
|
|
54
|
-
} = {}) {
|
|
55
|
-
super();
|
|
56
|
-
if (!_.isEmpty(unsupported)) {
|
|
57
|
-
console.warn(`RequestStoryArticles: Unsupported parameters detected: ${JSON.stringify(unsupported)}. Please check the documentation.`);
|
|
58
|
-
}
|
|
59
|
-
if (page < 1) {
|
|
60
|
-
throw new RangeError("Page has to be >= 1");
|
|
61
|
-
}
|
|
62
|
-
if (count > 100) {
|
|
63
|
-
throw new RangeError("At most 100 articles can be returned per call");
|
|
64
|
-
}
|
|
65
|
-
this.params = {};
|
|
66
|
-
this.params["articlesPage"] = page;
|
|
67
|
-
this.params["articlesCount"] = count;
|
|
68
|
-
this.params["articlesSortBy"] = sortBy;
|
|
69
|
-
this.params["articlesSortByAsc"] = sortByAsc;
|
|
70
|
-
this.params = _.extend({}, this.params, returnInfo.getParams("articles"));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export class RequestStoryArticleUris extends RequestStory {
|
|
75
|
-
public resultType = "articleUris";
|
|
76
|
-
public params;
|
|
77
|
-
|
|
78
|
-
constructor({ sortBy = "cosSim",
|
|
79
|
-
sortByAsc = false,
|
|
80
|
-
...unsupported
|
|
81
|
-
} = {}) {
|
|
82
|
-
super();
|
|
83
|
-
if (!_.isEmpty(unsupported)) {
|
|
84
|
-
console.warn(`RequestStoryArticleUris: Unsupported parameters detected: ${JSON.stringify(unsupported)}. Please check the documentation.`);
|
|
85
|
-
}
|
|
86
|
-
this.params = {};
|
|
87
|
-
this.params["articleUrisSortBy"] = sortBy;
|
|
88
|
-
this.params["articleUrisSortByAsc"] = sortByAsc;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export class RequestStoryArticleTrend extends RequestStory {
|
|
93
|
-
public resultType = "articleTrend";
|
|
94
|
-
public params;
|
|
95
|
-
|
|
96
|
-
constructor({ lang = mainLangs,
|
|
97
|
-
minArticleCosSim = -1,
|
|
98
|
-
returnInfo = new ReturnInfo({articleInfo: new ArticleInfoFlags({bodyLen: 0})}),
|
|
99
|
-
...unsupported
|
|
100
|
-
} = {}) {
|
|
101
|
-
super();
|
|
102
|
-
if (!_.isEmpty(unsupported)) {
|
|
103
|
-
console.warn(`RequestStoryArticleTrend: Unsupported parameters detected: ${JSON.stringify(unsupported)}. Please check the documentation.`);
|
|
104
|
-
}
|
|
105
|
-
this.params = {};
|
|
106
|
-
this.params["articleTrendLang"] = lang;
|
|
107
|
-
this.params["articleTrendMinArticleCosSim"] = minArticleCosSim;
|
|
108
|
-
this.params = _.extend({}, this.params, returnInfo.getParams("articles"));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export class RequestStorySimilarStories extends RequestStory {
|
|
113
|
-
public resultType = "similarStories";
|
|
114
|
-
public params;
|
|
115
|
-
|
|
116
|
-
constructor({ conceptInfoList = undefined,
|
|
117
|
-
count = 50,
|
|
118
|
-
dateStart = undefined,
|
|
119
|
-
dateEnd = undefined,
|
|
120
|
-
lang = [],
|
|
121
|
-
returnInfo = new ReturnInfo(),
|
|
122
|
-
...unsupported
|
|
123
|
-
} = {}) {
|
|
124
|
-
super();
|
|
125
|
-
if (!_.isEmpty(unsupported)) {
|
|
126
|
-
console.warn(`RequestStorySimilarStories: Unsupported parameters detected: ${JSON.stringify(unsupported)}. Please check the documentation.`);
|
|
127
|
-
}
|
|
128
|
-
if (count > 50) {
|
|
129
|
-
throw new RangeError("At most 50 stories can be returned per call");
|
|
130
|
-
}
|
|
131
|
-
if (!_.isArray(conceptInfoList)) {
|
|
132
|
-
throw new Error("Concept list is not an array!");
|
|
133
|
-
}
|
|
134
|
-
this.params = {};
|
|
135
|
-
this.params["action"] = "getSimilarStories";
|
|
136
|
-
this.params["concepts"] = JSON.stringify(conceptInfoList);
|
|
137
|
-
this.params["storiesCount"] = count;
|
|
138
|
-
|
|
139
|
-
if (!!dateStart) {
|
|
140
|
-
this.params["dateStart"] = QueryParamsBase.encodeDateTime( dateStart, "YYYY-MM-DD" );
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (!!dateEnd) {
|
|
144
|
-
this.params["dateEnd"] = QueryParamsBase.encodeDateTime( dateEnd, "YYYY-MM-DD" );
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (!_.isEmpty(lang)) {
|
|
148
|
-
this.params["lang"] = lang;
|
|
149
|
-
}
|
|
150
|
-
this.params = _.extend({}, this.params, returnInfo.getParams("similarStories"));
|
|
151
|
-
}
|
|
152
|
-
}
|
package/src/recent.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as _ from "lodash";
|
|
2
|
-
import { QueryParamsBase } from "./base";
|
|
3
|
-
import { EventRegistry } from "./eventRegistry";
|
|
4
|
-
import { ReturnInfo } from "./returnInfo";
|
|
5
|
-
|
|
6
|
-
export class GetRecentEvents extends QueryParamsBase {
|
|
7
|
-
private er: EventRegistry;
|
|
8
|
-
constructor(er: EventRegistry, { mandatoryLang = undefined,
|
|
9
|
-
mandatoryLocation = true,
|
|
10
|
-
returnInfo = new ReturnInfo(),
|
|
11
|
-
} = {}) {
|
|
12
|
-
super();
|
|
13
|
-
this.er = er;
|
|
14
|
-
this.setVal("recentActivityEventsMandatoryLocation", mandatoryLocation);
|
|
15
|
-
if (!_.isUndefined(mandatoryLang)) {
|
|
16
|
-
this.setVal("recentActivityEventsMandatoryLang", mandatoryLang);
|
|
17
|
-
}
|
|
18
|
-
this.params = _.extend({}, this.params, returnInfo.getParams("recentActivityEvents"));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public get path() {
|
|
22
|
-
return "/api/v1/minuteStreamEvents";
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public async getUpdates() {
|
|
26
|
-
const response = await this.er.execQuery(this);
|
|
27
|
-
return _.get(response, "recentActivityEvents.activity", {});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export class GetRecentArticles extends QueryParamsBase {
|
|
32
|
-
private er: EventRegistry;
|
|
33
|
-
constructor(er: EventRegistry, { mandatorySourceLocation = undefined,
|
|
34
|
-
lang = undefined,
|
|
35
|
-
returnInfo = new ReturnInfo(),
|
|
36
|
-
...kwargs
|
|
37
|
-
} = {}) {
|
|
38
|
-
super();
|
|
39
|
-
this.er = er;
|
|
40
|
-
this.setVal("recentActivityArticlesMandatorySourceLocation", mandatorySourceLocation);
|
|
41
|
-
if (!_.isUndefined(lang)) {
|
|
42
|
-
this.setVal("recentActivityArticlesLang", lang);
|
|
43
|
-
}
|
|
44
|
-
this.params = _.extend({}, this.params, kwargs);
|
|
45
|
-
this.params = _.extend({}, this.params, returnInfo.getParams("recentActivityArticles"));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public get path() {
|
|
49
|
-
return "/api/v1/minuteStreamArticles";
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public async getUpdates() {
|
|
53
|
-
const response = await this.er.execQuery(this);
|
|
54
|
-
if (_.has(response, "recentActivityArticles")) {
|
|
55
|
-
for (const [key, value] of _.entries(_.get(response, "recentActivityArticles.newestUri", {}))) {
|
|
56
|
-
const splitKey = _.split(key, "");
|
|
57
|
-
this.setVal("recentActivityArticles" + _.upperCase(splitKey[0]) + _.join(_.tail(splitKey)), value);
|
|
58
|
-
}
|
|
59
|
-
return _.get(response, "recentActivityArticles.activity", []);
|
|
60
|
-
}
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
}
|
package/src/returnInfo.ts
DELETED
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
import * as _ from "lodash";
|
|
2
|
-
import { EventRegistryStatic } from "./types";
|
|
3
|
-
import * as fs from "fs";
|
|
4
|
-
|
|
5
|
-
export abstract class ReturnInfoFlagsBase<T extends {}> {
|
|
6
|
-
protected type: string;
|
|
7
|
-
private data = {};
|
|
8
|
-
|
|
9
|
-
public setFlag(key: string, value: boolean, defaultValue?: boolean) {
|
|
10
|
-
this.setProperty("Include" + this.type + _.upperFirst(key), value, defaultValue);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
public setValue(key: string, value: any, defaultValue?: any, skipKeyMod = false) {
|
|
14
|
-
const constructedKey = skipKeyMod ? _.upperFirst(key) : this.type + _.upperFirst(key);
|
|
15
|
-
this.setProperty(constructedKey, value, defaultValue);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public getProperties(prefix = "") {
|
|
19
|
-
return _.mapKeys(this.data, (value, key) => {
|
|
20
|
-
if (_.startsWith(_.toLower(key), _.toLower(prefix))) {
|
|
21
|
-
return _.camelCase(key);
|
|
22
|
-
} else {
|
|
23
|
-
return _.camelCase(prefix + key);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
public addProperties(properties: object) {
|
|
29
|
-
if (properties instanceof Object) {
|
|
30
|
-
for (const name in properties) {
|
|
31
|
-
if (properties.hasOwnProperty(name)) {
|
|
32
|
-
const value = properties[name];
|
|
33
|
-
if (typeof value === "boolean") {
|
|
34
|
-
this.setFlag(name, value, !value);
|
|
35
|
-
} else {
|
|
36
|
-
this.setValue(name, value);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
private setProperty(key, value, defaultValue?) {
|
|
44
|
-
if (value !== defaultValue) {
|
|
45
|
-
_.set(this.data, key, value);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class ReturnInfo {
|
|
52
|
-
private articleInfo: ArticleInfoFlags;
|
|
53
|
-
private eventInfo: EventInfoFlags;
|
|
54
|
-
private sourceInfo: SourceInfoFlags;
|
|
55
|
-
private categoryInfo: CategoryInfoFlags;
|
|
56
|
-
private conceptInfo: ConceptInfoFlags;
|
|
57
|
-
private locationInfo: LocationInfoFlags;
|
|
58
|
-
private storyInfo: StoryInfoFlags;
|
|
59
|
-
private conceptClassInfo: ConceptClassInfoFlags;
|
|
60
|
-
private conceptFolderInfo: ConceptFolderInfoFlags;
|
|
61
|
-
// Accepts all InfoFlags
|
|
62
|
-
constructor({
|
|
63
|
-
articleInfo = new ArticleInfoFlags(),
|
|
64
|
-
eventInfo = new EventInfoFlags(),
|
|
65
|
-
sourceInfo = new SourceInfoFlags(),
|
|
66
|
-
categoryInfo = new CategoryInfoFlags(),
|
|
67
|
-
conceptInfo = new ConceptInfoFlags(),
|
|
68
|
-
locationInfo = new LocationInfoFlags(),
|
|
69
|
-
storyInfo = new StoryInfoFlags(),
|
|
70
|
-
conceptClassInfo = new ConceptClassInfoFlags(),
|
|
71
|
-
conceptFolderInfo = new ConceptFolderInfoFlags(),
|
|
72
|
-
...unsupported
|
|
73
|
-
} = {}) {
|
|
74
|
-
if (!_.isEmpty(unsupported)) {
|
|
75
|
-
console.warn(`ReturnInfo: Unsupported parameters detected: ${JSON.stringify(unsupported)}. Please check the documentation.`);
|
|
76
|
-
}
|
|
77
|
-
this.articleInfo = articleInfo;
|
|
78
|
-
this.eventInfo = eventInfo;
|
|
79
|
-
this.sourceInfo = sourceInfo;
|
|
80
|
-
this.categoryInfo = categoryInfo;
|
|
81
|
-
this.conceptInfo = conceptInfo;
|
|
82
|
-
this.locationInfo = locationInfo;
|
|
83
|
-
this.storyInfo = storyInfo;
|
|
84
|
-
this.conceptClassInfo = conceptClassInfo;
|
|
85
|
-
this.conceptFolderInfo = conceptFolderInfo;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
public getParams(prefix?: string) {
|
|
89
|
-
return _.extend(
|
|
90
|
-
{},
|
|
91
|
-
this.articleInfo.getProperties(prefix),
|
|
92
|
-
this.eventInfo.getProperties(prefix),
|
|
93
|
-
this.sourceInfo.getProperties(prefix),
|
|
94
|
-
this.categoryInfo.getProperties(prefix),
|
|
95
|
-
this.conceptInfo.getProperties(prefix),
|
|
96
|
-
this.locationInfo.getProperties(prefix),
|
|
97
|
-
this.storyInfo.getProperties(prefix),
|
|
98
|
-
this.conceptClassInfo.getProperties(prefix),
|
|
99
|
-
this.conceptFolderInfo.getProperties(prefix),
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* load the configuration for the ReturnInfo from a filename
|
|
105
|
-
* @param filename filename that contains the json configuration to use in the ReturnInfo
|
|
106
|
-
*/
|
|
107
|
-
public static loadFromFile(filename: string): ReturnInfo {
|
|
108
|
-
if (!(fs && fs.existsSync(filename))) {
|
|
109
|
-
throw new Error(`File ${filename} does not exist`);
|
|
110
|
-
}
|
|
111
|
-
const conf = JSON.parse(fs.readFileSync(filename, "utf8"));
|
|
112
|
-
return new ReturnInfo({
|
|
113
|
-
articleInfo: new ArticleInfoFlags(_.get(conf, "articleInfo", {})),
|
|
114
|
-
eventInfo: new EventInfoFlags(_.get(conf, "eventInfo", {})),
|
|
115
|
-
sourceInfo: new SourceInfoFlags(_.get(conf, "sourceInfo", {})),
|
|
116
|
-
categoryInfo: new CategoryInfoFlags(_.get(conf, "categoryInfo", {})),
|
|
117
|
-
conceptInfo: new ConceptInfoFlags(_.get(conf, "conceptInfo", {})),
|
|
118
|
-
locationInfo: new LocationInfoFlags(_.get(conf, "locationInfo", {})),
|
|
119
|
-
storyInfo: new StoryInfoFlags(_.get(conf, "storyInfo", {})),
|
|
120
|
-
conceptClassInfo: new ConceptClassInfoFlags(_.get(conf, "conceptClassInfo", {})),
|
|
121
|
-
conceptFolderInfo: new ConceptFolderInfoFlags(_.get(conf, "conceptFolderInfo", {})),
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export class ArticleInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.ArticleInfoFlags> {
|
|
127
|
-
constructor(params: EventRegistryStatic.ReturnInfo.ArticleInfo = {}) {
|
|
128
|
-
super();
|
|
129
|
-
this.type = "Article";
|
|
130
|
-
const {
|
|
131
|
-
bodyLen = -1,
|
|
132
|
-
basicInfo = true,
|
|
133
|
-
title = true,
|
|
134
|
-
body = true,
|
|
135
|
-
url = true,
|
|
136
|
-
eventUri = true,
|
|
137
|
-
authors = true,
|
|
138
|
-
concepts = false,
|
|
139
|
-
categories = false,
|
|
140
|
-
links = false,
|
|
141
|
-
videos = false,
|
|
142
|
-
image = true,
|
|
143
|
-
socialScore = false,
|
|
144
|
-
sentiment = true,
|
|
145
|
-
location = false,
|
|
146
|
-
extractedDates = false,
|
|
147
|
-
originalArticle = false,
|
|
148
|
-
storyUri = false,
|
|
149
|
-
...properties
|
|
150
|
-
} = params;
|
|
151
|
-
this.setValue("bodyLen", bodyLen);
|
|
152
|
-
this.setFlag("basicInfo", basicInfo);
|
|
153
|
-
this.setFlag("title", title);
|
|
154
|
-
this.setFlag("body", body);
|
|
155
|
-
this.setFlag("url", url);
|
|
156
|
-
this.setFlag("eventUri", eventUri);
|
|
157
|
-
this.setFlag("authors", authors);
|
|
158
|
-
this.setFlag("concepts", concepts);
|
|
159
|
-
this.setFlag("categories", categories);
|
|
160
|
-
this.setFlag("links", links);
|
|
161
|
-
this.setFlag("videos", videos);
|
|
162
|
-
this.setFlag("image", image);
|
|
163
|
-
this.setFlag("socialScore", socialScore);
|
|
164
|
-
this.setFlag("sentiment", sentiment);
|
|
165
|
-
this.setFlag("location", location);
|
|
166
|
-
this.setFlag("extractedDates", extractedDates);
|
|
167
|
-
this.setFlag("originalArticle", originalArticle);
|
|
168
|
-
this.setFlag("storyUri", storyUri);
|
|
169
|
-
this.addProperties(properties);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export class StoryInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.StoryInfoFlags> {
|
|
174
|
-
constructor(params: EventRegistryStatic.ReturnInfo.StoryInfo = {}) {
|
|
175
|
-
super();
|
|
176
|
-
this.type = "Story";
|
|
177
|
-
const {
|
|
178
|
-
basicStats = true,
|
|
179
|
-
location = true,
|
|
180
|
-
date = false,
|
|
181
|
-
title = false,
|
|
182
|
-
summary = false,
|
|
183
|
-
concepts = false,
|
|
184
|
-
categories = false,
|
|
185
|
-
medoidArticle = false,
|
|
186
|
-
infoArticle = false,
|
|
187
|
-
commonDates = false,
|
|
188
|
-
socialScore = false,
|
|
189
|
-
imageCount = 0,
|
|
190
|
-
...properties
|
|
191
|
-
} = params;
|
|
192
|
-
this.setFlag("basicStats", basicStats);
|
|
193
|
-
this.setFlag("location", location);
|
|
194
|
-
this.setFlag("date", date);
|
|
195
|
-
this.setFlag("title", title);
|
|
196
|
-
this.setFlag("summary", summary);
|
|
197
|
-
this.setFlag("concepts", concepts);
|
|
198
|
-
this.setFlag("categories", categories);
|
|
199
|
-
this.setFlag("medoidArticle", medoidArticle);
|
|
200
|
-
this.setFlag("infoArticle", infoArticle);
|
|
201
|
-
this.setFlag("commonDates", commonDates);
|
|
202
|
-
this.setFlag("socialScore", socialScore);
|
|
203
|
-
this.setValue("imageCount", imageCount);
|
|
204
|
-
this.addProperties(properties);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export class EventInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.EventInfoFlags> {
|
|
209
|
-
constructor(params: EventRegistryStatic.ReturnInfo.EventInfo = {}) {
|
|
210
|
-
super();
|
|
211
|
-
this.type = "Event";
|
|
212
|
-
const {
|
|
213
|
-
title = true,
|
|
214
|
-
summary = true,
|
|
215
|
-
articleCounts = true,
|
|
216
|
-
concepts = true,
|
|
217
|
-
categories = true,
|
|
218
|
-
date = true,
|
|
219
|
-
commonDates = false,
|
|
220
|
-
infoArticle = false,
|
|
221
|
-
stories = false,
|
|
222
|
-
socialScore = false,
|
|
223
|
-
imageCount = 0,
|
|
224
|
-
...properties
|
|
225
|
-
} = params;
|
|
226
|
-
this.setFlag("title", title);
|
|
227
|
-
this.setFlag("summary", summary);
|
|
228
|
-
this.setFlag("articleCounts", articleCounts);
|
|
229
|
-
this.setFlag("concepts", concepts);
|
|
230
|
-
this.setFlag("categories", categories);
|
|
231
|
-
this.setFlag("date", date);
|
|
232
|
-
this.setFlag("commonDates", commonDates);
|
|
233
|
-
this.setFlag("infoArticle", infoArticle as boolean);
|
|
234
|
-
this.setFlag("stories", stories);
|
|
235
|
-
this.setFlag("socialScore", socialScore);
|
|
236
|
-
this.setValue("imageCount", imageCount);
|
|
237
|
-
this.addProperties(properties);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
export class SourceInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.SourceInfoFlags> {
|
|
242
|
-
constructor(params: EventRegistryStatic.ReturnInfo.SourceInfo = {}) {
|
|
243
|
-
super();
|
|
244
|
-
const {
|
|
245
|
-
title = true,
|
|
246
|
-
description = false,
|
|
247
|
-
location = false,
|
|
248
|
-
ranking = false,
|
|
249
|
-
image = false,
|
|
250
|
-
socialMedia = false,
|
|
251
|
-
...properties
|
|
252
|
-
} = params;
|
|
253
|
-
this.type = "Source";
|
|
254
|
-
this.setFlag("title", title);
|
|
255
|
-
this.setFlag("description", description);
|
|
256
|
-
this.setFlag("location", location);
|
|
257
|
-
this.setFlag("ranking", ranking);
|
|
258
|
-
this.setFlag("image", image);
|
|
259
|
-
this.setFlag("socialMedia", socialMedia);
|
|
260
|
-
this.addProperties(properties);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export class CategoryInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.CategoryInfoFlags> {
|
|
265
|
-
constructor(params: EventRegistryStatic.ReturnInfo.CategoryInfo = {}) {
|
|
266
|
-
super();
|
|
267
|
-
this.type = "Category";
|
|
268
|
-
const {
|
|
269
|
-
trendingScore = true,
|
|
270
|
-
...properties
|
|
271
|
-
} = params;
|
|
272
|
-
this.setFlag("trendingScore", trendingScore);
|
|
273
|
-
this.addProperties(properties);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export class ConceptInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.ConceptInfoFlags> {
|
|
278
|
-
constructor(params: EventRegistryStatic.ReturnInfo.ConceptInfo = {}) {
|
|
279
|
-
super();
|
|
280
|
-
this.type = "Concept";
|
|
281
|
-
const {
|
|
282
|
-
type = "concepts",
|
|
283
|
-
lang = "eng",
|
|
284
|
-
label = true,
|
|
285
|
-
synonyms = false,
|
|
286
|
-
image = false,
|
|
287
|
-
description = false,
|
|
288
|
-
trendingScore = false,
|
|
289
|
-
maxConceptsPerType = 20,
|
|
290
|
-
...properties
|
|
291
|
-
} = params;
|
|
292
|
-
this.setValue("type", type);
|
|
293
|
-
this.setValue("lang", lang);
|
|
294
|
-
this.setFlag("label", label);
|
|
295
|
-
this.setFlag("synonyms", synonyms);
|
|
296
|
-
this.setFlag("image", image);
|
|
297
|
-
this.setFlag("description", description);
|
|
298
|
-
this.setFlag("trendingScore", trendingScore);
|
|
299
|
-
this.setValue("maxConceptsPerType", maxConceptsPerType, 20, true);
|
|
300
|
-
this.addProperties(properties);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export class LocationInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.LocationInfoFlags> {
|
|
305
|
-
constructor(params: EventRegistryStatic.ReturnInfo.LocationInfo = {}) {
|
|
306
|
-
super();
|
|
307
|
-
this.type = "Location";
|
|
308
|
-
const {
|
|
309
|
-
label = true,
|
|
310
|
-
wikiUri = false,
|
|
311
|
-
geoNamesId = false,
|
|
312
|
-
population = false,
|
|
313
|
-
geoLocation = false,
|
|
314
|
-
countryArea = false,
|
|
315
|
-
countryDetails = false,
|
|
316
|
-
countryContinent = false,
|
|
317
|
-
placeFeatureCode = false,
|
|
318
|
-
placeCountry = true,
|
|
319
|
-
...properties
|
|
320
|
-
} = params;
|
|
321
|
-
this.setFlag("label", label);
|
|
322
|
-
this.setFlag("wikiUri", wikiUri);
|
|
323
|
-
this.setFlag("geoNamesId", geoNamesId);
|
|
324
|
-
this.setFlag("population", population);
|
|
325
|
-
this.setFlag("geoLocation", geoLocation);
|
|
326
|
-
this.setFlag("countryArea", countryArea);
|
|
327
|
-
this.setFlag("countryDetails", countryDetails);
|
|
328
|
-
this.setFlag("countryContinent", countryContinent);
|
|
329
|
-
this.setFlag("placeFeatureCode", placeFeatureCode);
|
|
330
|
-
this.setFlag("placeCountry", placeCountry);
|
|
331
|
-
this.addProperties(properties);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
export class ConceptClassInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.ConceptClassInfoFlags> {
|
|
336
|
-
constructor(params: EventRegistryStatic.ReturnInfo.ConceptClassInfo = {}) {
|
|
337
|
-
super();
|
|
338
|
-
this.type = "ConceptClass";
|
|
339
|
-
const {
|
|
340
|
-
parentLabels = true,
|
|
341
|
-
concepts = false,
|
|
342
|
-
...properties
|
|
343
|
-
} = params;
|
|
344
|
-
this.setFlag("parentLabels", parentLabels);
|
|
345
|
-
this.setFlag("concepts", concepts);
|
|
346
|
-
this.addProperties(properties);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export class ConceptFolderInfoFlags extends ReturnInfoFlagsBase<EventRegistryStatic.ReturnInfo.ConceptFolderInfoFlags> {
|
|
351
|
-
constructor(params: EventRegistryStatic.ReturnInfo.ConceptFolderInfo = {}) {
|
|
352
|
-
super();
|
|
353
|
-
this.type = "ConceptFolder";
|
|
354
|
-
const {
|
|
355
|
-
definition = true,
|
|
356
|
-
owner = false,
|
|
357
|
-
...properties
|
|
358
|
-
} = params;
|
|
359
|
-
this.setFlag("owner", definition);
|
|
360
|
-
this.setFlag("owner", owner);
|
|
361
|
-
this.addProperties(properties);
|
|
362
|
-
}
|
|
363
|
-
}
|