eventregistry 8.11.2 → 9.1.0

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.
Files changed (65) hide show
  1. package/dist/analytics.d.ts +82 -82
  2. package/dist/analytics.js +336 -330
  3. package/dist/analytics.js.map +1 -1
  4. package/dist/base.d.ts +82 -81
  5. package/dist/base.js +261 -219
  6. package/dist/base.js.map +1 -1
  7. package/dist/counts.d.ts +81 -81
  8. package/dist/counts.js +162 -149
  9. package/dist/counts.js.map +1 -1
  10. package/dist/dailyShares.d.ts +10 -10
  11. package/dist/dailyShares.js +90 -77
  12. package/dist/dailyShares.js.map +1 -1
  13. package/dist/data.d.ts +269 -268
  14. package/dist/data.js +3 -3
  15. package/dist/eventForText.d.ts +48 -48
  16. package/dist/eventForText.js +126 -123
  17. package/dist/eventForText.js.map +1 -1
  18. package/dist/eventRegistry.d.ts +244 -224
  19. package/dist/eventRegistry.js +1098 -1018
  20. package/dist/eventRegistry.js.map +1 -1
  21. package/dist/index.d.ts +21 -20
  22. package/dist/index.js +128 -122
  23. package/dist/index.js.map +1 -1
  24. package/dist/info.d.ts +61 -61
  25. package/dist/info.js +171 -158
  26. package/dist/info.js.map +1 -1
  27. package/dist/logger.d.ts +44 -0
  28. package/dist/logger.js +144 -0
  29. package/dist/logger.js.map +1 -0
  30. package/dist/query.d.ts +53 -53
  31. package/dist/query.js +333 -290
  32. package/dist/query.js.map +1 -1
  33. package/dist/queryArticle.d.ts +61 -61
  34. package/dist/queryArticle.js +183 -168
  35. package/dist/queryArticle.js.map +1 -1
  36. package/dist/queryArticles.d.ts +144 -160
  37. package/dist/queryArticles.js +729 -701
  38. package/dist/queryArticles.js.map +1 -1
  39. package/dist/queryEvent.d.ts +140 -140
  40. package/dist/queryEvent.js +587 -569
  41. package/dist/queryEvent.js.map +1 -1
  42. package/dist/queryEvents.d.ts +210 -210
  43. package/dist/queryEvents.js +825 -798
  44. package/dist/queryEvents.js.map +1 -1
  45. package/dist/queryMentions.d.ts +96 -96
  46. package/dist/queryMentions.js +637 -600
  47. package/dist/queryMentions.js.map +1 -1
  48. package/dist/queryStory.d.ts +58 -58
  49. package/dist/queryStory.js +194 -174
  50. package/dist/queryStory.js.map +1 -1
  51. package/dist/recent.d.ts +23 -23
  52. package/dist/recent.js +199 -179
  53. package/dist/recent.js.map +1 -1
  54. package/dist/returnInfo.d.ts +68 -66
  55. package/dist/returnInfo.js +332 -304
  56. package/dist/returnInfo.js.map +1 -1
  57. package/dist/topicPage.d.ts +157 -157
  58. package/dist/topicPage.js +599 -604
  59. package/dist/topicPage.js.map +1 -1
  60. package/dist/trends.d.ts +35 -35
  61. package/dist/trends.js +115 -102
  62. package/dist/trends.js.map +1 -1
  63. package/dist/types.d.ts +2453 -2155
  64. package/dist/types.js +2 -2
  65. package/package.json +13 -13
package/dist/data.d.ts CHANGED
@@ -1,268 +1,269 @@
1
- export declare module Data {
2
- type TranslationObject = Record<string, string>;
3
- type Label = TranslationObject;
4
- type Summary = TranslationObject;
5
- type Shares = Record<string, number>;
6
- interface Item {
7
- uri: string;
8
- label: string;
9
- }
10
- interface Concept {
11
- uri: string;
12
- type: "person" | "loc" | "org" | "wiki";
13
- image: string;
14
- label: Label;
15
- conceptClassMembership: string[];
16
- location: Location;
17
- synonyms: Record<string, string[]>;
18
- }
19
- interface Category {
20
- uri: string;
21
- parentUri: string;
22
- label: string;
23
- }
24
- interface Country {
25
- area: number;
26
- code2: string;
27
- code3: string;
28
- continent: string;
29
- currencyCode: string;
30
- currencyName: string;
31
- geoNamesId: string;
32
- label: Label;
33
- lat: number;
34
- long: number;
35
- population: number;
36
- type: string;
37
- webExt: string;
38
- wikiUri: string;
39
- }
40
- interface Location extends Country {
41
- }
42
- interface SourceLocation {
43
- country: Country;
44
- featureCode: string;
45
- geoNamesId: string;
46
- label: Label;
47
- lat: number;
48
- long: number;
49
- population: number;
50
- type: string;
51
- wikiUri: string;
52
- }
53
- interface EventLocation extends SourceLocation {
54
- }
55
- interface Source {
56
- uri: string;
57
- title: string;
58
- articleCount: number;
59
- description: string;
60
- socialMedia: Record<string, string>;
61
- ranking: {
62
- importanceRank: number;
63
- alexaGlobalRank: number;
64
- alexaCountryRank: number;
65
- };
66
- location: SourceLocation;
67
- sourceGroup: string[];
68
- image: string;
69
- thumbImage: string;
70
- }
71
- interface ExtractedDate {
72
- /**
73
- * Ambiguous?
74
- */
75
- amb: boolean;
76
- /**
77
- * Normalized date
78
- */
79
- date: string;
80
- dateEnd: string;
81
- detectedDate: string;
82
- /**
83
- * Was the year value imputed?
84
- */
85
- imp: boolean;
86
- /**
87
- * Location in text
88
- */
89
- posInText: number;
90
- textSnippet: string;
91
- }
92
- interface Article {
93
- /**
94
- * Article's URI (unique article's ID - not necessarily a number)
95
- */
96
- uri: string;
97
- /**
98
- * Web url
99
- */
100
- url?: string;
101
- /**
102
- * Article's title
103
- */
104
- title?: string;
105
- /**
106
- * Article's full body
107
- */
108
- body?: string;
109
- /**
110
- * Date of publishing in UTC timezone
111
- */
112
- date: string;
113
- /**
114
- * Time of publishing in UTC timezone
115
- */
116
- time: string;
117
- /**
118
- * When was the article serialized. Each next article added to Event Registry has to have a higher value
119
- */
120
- dateTime: string;
121
- /**
122
- * When was the article first discovered in the RSS feeds. Value is closer to the actual time when the article was published,
123
- * but the value is not monotonically increasing as the articles are added to Event Registry
124
- */
125
- dateTimePub: string;
126
- /**
127
- * Type of the article (news, blog, pr)
128
- */
129
- dataType: "news" | "blog" | "pr";
130
- /**
131
- * Sentiment of the article (can be null if value is not set). Between -1 and 1.
132
- */
133
- sentiment?: number;
134
- /**
135
- * Event URI to which the article is assigned to (if any)
136
- */
137
- eventUri?: string;
138
- /**
139
- * Relevance represents how well does the article match the query - the higher the value, the better the match.
140
- * If search results are sorted by relevance, this is the value used for sorting
141
- */
142
- relevance: number;
143
- /**
144
- * Cluster/story URI to which the article is assigned to (if any)
145
- */
146
- storyUri?: string;
147
- /**
148
- * Details about the news source
149
- */
150
- source: Source;
151
- /**
152
- * List of categories
153
- */
154
- categories: Category[];
155
- /**
156
- * List of categories
157
- */
158
- concepts?: Concept[];
159
- links?: string[];
160
- videos?: Item[];
161
- /**
162
- * Article's image
163
- */
164
- image?: string;
165
- /**
166
- * If an article is a duplicate, this list will contain them
167
- */
168
- duplicateList?: Article[];
169
- /**
170
- * Dates that were extracted from the article
171
- */
172
- extractedDates?: ExtractedDate[];
173
- /**
174
- * Is article a duplicate of another article?
175
- */
176
- isDuplicate: boolean;
177
- /**
178
- * Language of the article
179
- */
180
- lang: string;
181
- /**
182
- * Was there explicit location extracted from dateline?
183
- */
184
- location: Location;
185
- /**
186
- * If this is a duplicate, this would be original article's object
187
- */
188
- originalArticle?: Article;
189
- /**
190
- * If this is a duplicate, this would be original article's object
191
- */
192
- sim: number;
193
- /**
194
- * Parameter used internally for sorting purposes (DO NOT USE THE VALUE)
195
- */
196
- wgt: number;
197
- /**
198
- * Number of shares on social media
199
- */
200
- shares: Shares;
201
- }
202
- interface CommonDate {
203
- date: string;
204
- freq: number;
205
- }
206
- interface Event {
207
- /**
208
- * Event URI
209
- */
210
- uri: string;
211
- /**
212
- * Total articles reporting about the event
213
- */
214
- totalArticleCount: number;
215
- /**
216
- * Articles per language
217
- */
218
- articlesCounts: Record<string, number>;
219
- /**
220
- * List of concepts
221
- */
222
- concepts?: Concept[];
223
- /**
224
- * List of categories
225
- */
226
- categories?: Category[];
227
- /**
228
- * Event title in available languages
229
- */
230
- title: Label;
231
- /**
232
- * Event summary in available languages
233
- */
234
- summary: Summary;
235
- /**
236
- * Which dates have been frequently found in articles about this event
237
- */
238
- commonDates: CommonDate[];
239
- /**
240
- * When the event happened
241
- */
242
- eventDate: string;
243
- /**
244
- * Sentiment of the event (can be null if value is not set). Between -1 and 1.
245
- */
246
- sentiment: number;
247
- /**
248
- * How much impact on social media did articles about the event get
249
- */
250
- socialScore: number;
251
- /**
252
- * Parameter used internally for sorting purposes. DO NOT USE THE VALUE
253
- */
254
- wgt: number;
255
- /**
256
- * Images of the event
257
- */
258
- images: string[];
259
- /**
260
- * Where did the event happen
261
- */
262
- location: EventLocation;
263
- /**
264
- * List of clusters reporting about the event
265
- */
266
- stories: any[];
267
- }
268
- }
1
+ export declare namespace Data {
2
+ type TranslationObject = Record<string, string>;
3
+ type Label = TranslationObject;
4
+ type Summary = TranslationObject;
5
+ type Shares = Record<string, number>;
6
+ export interface Item {
7
+ uri: string;
8
+ label: string;
9
+ }
10
+ export interface Concept {
11
+ uri: string;
12
+ type: "person" | "loc" | "org" | "wiki";
13
+ image: string;
14
+ label: Label;
15
+ conceptClassMembership: string[];
16
+ location: Location;
17
+ synonyms: Record<string, string[]>;
18
+ }
19
+ export interface Category {
20
+ uri: string;
21
+ parentUri: string;
22
+ label: string;
23
+ }
24
+ export interface Country {
25
+ area: number;
26
+ code2: string;
27
+ code3: string;
28
+ continent: string;
29
+ currencyCode: string;
30
+ currencyName: string;
31
+ geoNamesId: string;
32
+ label: Label;
33
+ lat: number;
34
+ long: number;
35
+ population: number;
36
+ type: string;
37
+ webExt: string;
38
+ wikiUri: string;
39
+ }
40
+ export interface Location extends Country {
41
+ }
42
+ export interface SourceLocation {
43
+ country: Country;
44
+ featureCode: string;
45
+ geoNamesId: string;
46
+ label: Label;
47
+ lat: number;
48
+ long: number;
49
+ population: number;
50
+ type: string;
51
+ wikiUri: string;
52
+ }
53
+ export interface EventLocation extends SourceLocation {
54
+ }
55
+ interface Source {
56
+ uri: string;
57
+ title: string;
58
+ articleCount: number;
59
+ description: string;
60
+ socialMedia: Record<string, string>;
61
+ ranking: {
62
+ importanceRank: number;
63
+ alexaGlobalRank: number;
64
+ alexaCountryRank: number;
65
+ };
66
+ location: SourceLocation;
67
+ sourceGroup: string[];
68
+ image: string;
69
+ thumbImage: string;
70
+ }
71
+ interface ExtractedDate {
72
+ /**
73
+ * Ambiguous?
74
+ */
75
+ amb: boolean;
76
+ /**
77
+ * Normalized date
78
+ */
79
+ date: string;
80
+ dateEnd: string;
81
+ detectedDate: string;
82
+ /**
83
+ * Was the year value imputed?
84
+ */
85
+ imp: boolean;
86
+ /**
87
+ * Location in text
88
+ */
89
+ posInText: number;
90
+ textSnippet: string;
91
+ }
92
+ export interface Article {
93
+ /**
94
+ * Article's URI (unique article's ID - not necessarily a number)
95
+ */
96
+ uri: string;
97
+ /**
98
+ * Web url
99
+ */
100
+ url?: string;
101
+ /**
102
+ * Article's title
103
+ */
104
+ title?: string;
105
+ /**
106
+ * Article's full body
107
+ */
108
+ body?: string;
109
+ /**
110
+ * Date of publishing in UTC timezone
111
+ */
112
+ date: string;
113
+ /**
114
+ * Time of publishing in UTC timezone
115
+ */
116
+ time: string;
117
+ /**
118
+ * When was the article serialized. Each next article added to Event Registry has to have a higher value
119
+ */
120
+ dateTime: string;
121
+ /**
122
+ * When was the article first discovered in the RSS feeds. Value is closer to the actual time when the article was published,
123
+ * but the value is not monotonically increasing as the articles are added to Event Registry
124
+ */
125
+ dateTimePub: string;
126
+ /**
127
+ * Type of the article (news, blog, pr)
128
+ */
129
+ dataType: "news" | "blog" | "pr";
130
+ /**
131
+ * Sentiment of the article (can be null if value is not set). Between -1 and 1.
132
+ */
133
+ sentiment?: number;
134
+ /**
135
+ * Event URI to which the article is assigned to (if any)
136
+ */
137
+ eventUri?: string;
138
+ /**
139
+ * Relevance represents how well does the article match the query - the higher the value, the better the match.
140
+ * If search results are sorted by relevance, this is the value used for sorting
141
+ */
142
+ relevance: number;
143
+ /**
144
+ * Cluster/story URI to which the article is assigned to (if any)
145
+ */
146
+ storyUri?: string;
147
+ /**
148
+ * Details about the news source
149
+ */
150
+ source: Source;
151
+ /**
152
+ * List of categories
153
+ */
154
+ categories: Category[];
155
+ /**
156
+ * List of categories
157
+ */
158
+ concepts?: Concept[];
159
+ links?: string[];
160
+ videos?: Item[];
161
+ /**
162
+ * Article's image
163
+ */
164
+ image?: string;
165
+ /**
166
+ * If an article is a duplicate, this list will contain them
167
+ */
168
+ duplicateList?: Article[];
169
+ /**
170
+ * Dates that were extracted from the article
171
+ */
172
+ extractedDates?: ExtractedDate[];
173
+ /**
174
+ * Is article a duplicate of another article?
175
+ */
176
+ isDuplicate: boolean;
177
+ /**
178
+ * Language of the article
179
+ */
180
+ lang: string;
181
+ /**
182
+ * Was there explicit location extracted from dateline?
183
+ */
184
+ location: Location;
185
+ /**
186
+ * If this is a duplicate, this would be original article's object
187
+ */
188
+ originalArticle?: Article;
189
+ /**
190
+ * If this is a duplicate, this would be original article's object
191
+ */
192
+ sim: number;
193
+ /**
194
+ * Parameter used internally for sorting purposes (DO NOT USE THE VALUE)
195
+ */
196
+ wgt: number;
197
+ /**
198
+ * Number of shares on social media
199
+ */
200
+ shares: Shares;
201
+ }
202
+ export interface CommonDate {
203
+ date: string;
204
+ freq: number;
205
+ }
206
+ export interface Event {
207
+ /**
208
+ * Event URI
209
+ */
210
+ uri: string;
211
+ /**
212
+ * Total articles reporting about the event
213
+ */
214
+ totalArticleCount: number;
215
+ /**
216
+ * Articles per language
217
+ */
218
+ articlesCounts: Record<string, number>;
219
+ /**
220
+ * List of concepts
221
+ */
222
+ concepts?: Concept[];
223
+ /**
224
+ * List of categories
225
+ */
226
+ categories?: Category[];
227
+ /**
228
+ * Event title in available languages
229
+ */
230
+ title: Label;
231
+ /**
232
+ * Event summary in available languages
233
+ */
234
+ summary: Summary;
235
+ /**
236
+ * Which dates have been frequently found in articles about this event
237
+ */
238
+ commonDates: CommonDate[];
239
+ /**
240
+ * When the event happened
241
+ */
242
+ eventDate: string;
243
+ /**
244
+ * Sentiment of the event (can be null if value is not set). Between -1 and 1.
245
+ */
246
+ sentiment: number;
247
+ /**
248
+ * How much impact on social media did articles about the event get
249
+ */
250
+ socialScore: number;
251
+ /**
252
+ * Parameter used internally for sorting purposes. DO NOT USE THE VALUE
253
+ */
254
+ wgt: number;
255
+ /**
256
+ * Images of the event
257
+ */
258
+ images: string[];
259
+ /**
260
+ * Where did the event happen
261
+ */
262
+ location: EventLocation;
263
+ /**
264
+ * List of clusters reporting about the event
265
+ */
266
+ stories: any[];
267
+ }
268
+ export {};
269
+ }
package/dist/data.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";
2
- // This file contains type definitions of actual results (articles, events,...) from the API
3
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ // This file contains type definitions of actual results (articles, events,...) from the API
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  //# sourceMappingURL=data.js.map
@@ -1,48 +1,48 @@
1
- import { QueryParamsBase } from "./base";
2
- import { EventRegistry } from "./eventRegistry";
3
- /**
4
- * The GetEventForText class can be used to find the event(s) that best matches the given input text.
5
- * The request is performed asynchronously.
6
- *
7
- * Note: The functionality can only be used to find the events in the last 5 days. Older events cannot
8
- * be matched in this way
9
- *
10
- * Return info from the compute() method is in the form:
11
- *
12
- * [
13
- * {
14
- * "cosSim": 0.07660648086468567,
15
- * "eventUri": "4969",
16
- * "storyUri": "eng-af6ce79f-cb91-4010-8ddf-7ad924bc5638-40591"
17
- * },
18
- * {
19
- * "cosSim": 0.05851939237670918,
20
- * "eventUri": "5157",
21
- * "storyUri": "eng-af6ce79f-cb91-4010-8ddf-7ad924bc5638-56286"
22
- * },
23
- * ...
24
- * ]
25
- *
26
- * Where
27
- * - cosSim represents the cosine similarity of the document to the cluster
28
- * - eventUri is the uri of the corresponding event in the Event Registry
29
- * - storyUri is the uri of the story in the Event Registry
30
- *
31
- * You can use QueryEvent or QueryStory to obtain more information about these events/stories
32
- *
33
- */
34
- export declare class GetEventForText extends QueryParamsBase {
35
- private er;
36
- private nrOfEventsToReturn;
37
- /**
38
- * @param er instance of EventRegistry class
39
- * @param nrOfEventsToReturn number of events to return for the given text
40
- */
41
- constructor(er: EventRegistry, nrOfEventsToReturn?: number);
42
- /**
43
- * Compute the list of most similar events for the given text
44
- * @param text text for which to find the most similar event
45
- * @param lang language in which the text is written
46
- */
47
- compute(text: string, lang?: string): Promise<any>;
48
- }
1
+ import { QueryParamsBase } from "./base";
2
+ import { EventRegistry } from "./eventRegistry";
3
+ /**
4
+ * The GetEventForText class can be used to find the event(s) that best matches the given input text.
5
+ * The request is performed asynchronously.
6
+ *
7
+ * Note: The functionality can only be used to find the events in the last 5 days. Older events cannot
8
+ * be matched in this way
9
+ *
10
+ * Return info from the compute() method is in the form:
11
+ *
12
+ * [
13
+ * {
14
+ * "cosSim": 0.07660648086468567,
15
+ * "eventUri": "4969",
16
+ * "storyUri": "eng-af6ce79f-cb91-4010-8ddf-7ad924bc5638-40591"
17
+ * },
18
+ * {
19
+ * "cosSim": 0.05851939237670918,
20
+ * "eventUri": "5157",
21
+ * "storyUri": "eng-af6ce79f-cb91-4010-8ddf-7ad924bc5638-56286"
22
+ * },
23
+ * ...
24
+ * ]
25
+ *
26
+ * Where
27
+ * - cosSim represents the cosine similarity of the document to the cluster
28
+ * - eventUri is the uri of the corresponding event in the Event Registry
29
+ * - storyUri is the uri of the story in the Event Registry
30
+ *
31
+ * You can use QueryEvent or QueryStory to obtain more information about these events/stories
32
+ *
33
+ */
34
+ export declare class GetEventForText extends QueryParamsBase {
35
+ private er;
36
+ private nrOfEventsToReturn;
37
+ /**
38
+ * @param er instance of EventRegistry class
39
+ * @param nrOfEventsToReturn number of events to return for the given text
40
+ */
41
+ constructor(er: EventRegistry, nrOfEventsToReturn?: number);
42
+ /**
43
+ * Compute the list of most similar events for the given text
44
+ * @param text text for which to find the most similar event
45
+ * @param lang language in which the text is written
46
+ */
47
+ compute(text: string, lang?: string): Promise<string | import("axios").AxiosResponse<Record<string, string>, any>>;
48
+ }