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.
Files changed (71) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/eventRegistry.js +2 -2
  3. package/dist/eventRegistry.js.map +1 -1
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +13 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/queryArticles.js +6 -0
  8. package/dist/queryArticles.js.map +1 -1
  9. package/dist/queryEvents.js +6 -0
  10. package/dist/queryEvents.js.map +1 -1
  11. package/dist/queryMentions.d.ts +95 -0
  12. package/dist/queryMentions.js +579 -0
  13. package/dist/queryMentions.js.map +1 -0
  14. package/dist/topicPage.js +2 -2
  15. package/dist/topicPage.js.map +1 -1
  16. package/{src → dist}/types.d.ts +284 -195
  17. package/dist/types.js +3 -0
  18. package/dist/types.js.map +1 -0
  19. package/package.json +6 -5
  20. package/dist/correlations.d.ts +0 -50
  21. package/dist/correlations.js +0 -397
  22. package/dist/correlations.js.map +0 -1
  23. package/examples/autoSuggestionsExamples.ts +0 -46
  24. package/examples/countsExamples.ts +0 -34
  25. package/examples/dailySharesExamples.ts +0 -54
  26. package/examples/eventForTextExamples.ts +0 -32
  27. package/examples/feedOfNewArticlesExamples.ts +0 -82
  28. package/examples/feedOfNewEventsExamples.ts +0 -70
  29. package/examples/queryArticleExamples.ts +0 -42
  30. package/examples/queryArticlesExamples.ts +0 -242
  31. package/examples/queryEventExamples.ts +0 -99
  32. package/examples/queryEventsExamples.ts +0 -232
  33. package/examples/topicPageExamples.ts +0 -97
  34. package/examples/trendsExamples.ts +0 -34
  35. package/src/analytics.ts +0 -181
  36. package/src/base.ts +0 -198
  37. package/src/counts.ts +0 -119
  38. package/src/dailyShares.ts +0 -48
  39. package/src/eventForText.ts +0 -61
  40. package/src/eventRegistry.ts +0 -733
  41. package/src/index.ts +0 -111
  42. package/src/info.ts +0 -121
  43. package/src/query.ts +0 -257
  44. package/src/queryArticle.ts +0 -139
  45. package/src/queryArticles.ts +0 -603
  46. package/src/queryEvent.ts +0 -473
  47. package/src/queryEvents.ts +0 -684
  48. package/src/queryStory.ts +0 -152
  49. package/src/recent.ts +0 -63
  50. package/src/returnInfo.ts +0 -363
  51. package/src/topicPage.ts +0 -479
  52. package/src/trends.ts +0 -63
  53. package/test/index.d.ts +0 -18
  54. package/test/jasmine.json +0 -10
  55. package/test/spec/analytics.spec.ts +0 -150
  56. package/test/spec/autoSuggestions.spec.ts +0 -54
  57. package/test/spec/info.spec.ts +0 -84
  58. package/test/spec/invalidQueries.spec.ts +0 -147
  59. package/test/spec/queryArticle.spec.ts +0 -62
  60. package/test/spec/queryArticles.spec.ts +0 -541
  61. package/test/spec/queryArticlesComplex.spec.ts +0 -298
  62. package/test/spec/queryEvent.spec.ts +0 -194
  63. package/test/spec/queryEvents.spec.ts +0 -491
  64. package/test/spec/queryEventsComplex.spec.ts +0 -188
  65. package/test/spec/queryPaging.spec.ts +0 -318
  66. package/test/spec/returnInfo.spec.ts +0 -34
  67. package/test/spec/topicPage.spec.ts +0 -83
  68. package/test/spec/utils.ts +0 -436
  69. package/test/tsconfig.json +0 -31
  70. package/tsconfig.json +0 -32
  71. package/tslint.json +0 -25
package/src/topicPage.ts DELETED
@@ -1,479 +0,0 @@
1
- import * as fs from "fs";
2
- import * as _ from "lodash";
3
- import { QueryParamsBase } from "./base";
4
- import { EventRegistry } from "./eventRegistry";
5
- import { ReturnInfo } from "./returnInfo";
6
- import { EventRegistryStatic } from "./types";
7
-
8
- export class TopicPage extends QueryParamsBase {
9
- private topicPage: EventRegistryStatic.TopicPage;
10
- private readonly emptyTopicPage: EventRegistryStatic.TopicPage = {
11
- autoAddArticles: true,
12
- articleHasDuplicate: "keepAll",
13
- articleHasEvent: "keepAll",
14
- articleIsDuplicate: "skipDuplicates",
15
- maxDaysBack: 7,
16
- articleTreshWgt: 0,
17
- eventTreshWgt: 0,
18
- concepts: [],
19
- keywords: [],
20
- categories: [],
21
- sources: [],
22
- sourceGroups: [],
23
- sourceLocations: [],
24
- locations: [],
25
- langs: [],
26
- restrictToSetConcepts: false,
27
- restrictToSetCategories: false,
28
- restrictToSetSources: false,
29
- restrictToSetLocations: false,
30
- dataType: [ "news" ]
31
- };
32
- private concept = {};
33
-
34
- constructor(private eventRegistry: EventRegistry) {
35
- super();
36
- this.topicPage = this.createEmptyTopicPage();
37
- }
38
-
39
- private isTopicPage(definition: {[name: string]: any}): definition is EventRegistryStatic.TopicPage {
40
- return _.isEqual(_.keys(this.emptyTopicPage), _.keys(definition));
41
- }
42
-
43
- private createEmptyTopicPage(): EventRegistryStatic.TopicPage {
44
- return this.emptyTopicPage;
45
- }
46
-
47
- /**
48
- * Load an existing topic page from Event Registry based on the topic page URI
49
- * @param uri uri of the topic page saved in your Event Registry account
50
- */
51
- public async loadTopicPageFromER(uri: string) {
52
- const params = {
53
- action: "getTopicPageJson",
54
- includeConceptDescription: true,
55
- includeConceptImage: true,
56
- includeTopicPageDefinition: true,
57
- includeTopicPageOwner: true,
58
- uri: uri
59
- };
60
- this.topicPage = this.createEmptyTopicPage();
61
- this.concept = await this.eventRegistry.jsonRequest("/api/v1/topicPage", params);
62
- if (_.has(this.concept, "data.error")) {
63
- throw new Error(_.get(this.concept, "data.error", ""));
64
- }
65
- this.topicPage = _.extend({}, this.topicPage, _.get(this.concept, "data.topicPage", {}));
66
- return this.topicPage;
67
- }
68
-
69
- /**
70
- * Load the topic page definition from an object
71
- * @param definition topic page definition
72
- */
73
- public loadTopicPageFromDefinition(definition: {}) {
74
- if (this.isTopicPage(definition)) {
75
- this.topicPage = definition;
76
- }
77
- }
78
-
79
- /**
80
- * Load topic page from an existing file
81
- * @param filepath file that contains the topic page definition
82
- */
83
- public loadTopicPageFromFile(filepath: string) {
84
- if (fs && fs.existsSync(filepath)) {
85
- const definition = JSON.parse(fs.readFileSync(filepath, "utf8"));
86
- if (this.isTopicPage(definition)) {
87
- this.topicPage = definition;
88
- }
89
- }
90
- }
91
-
92
- /**
93
- * Return an object containing the topic page definition. you can use it to load a topic page later
94
- */
95
- public saveTopicPageDefinition(): EventRegistryStatic.TopicPage {
96
- return this.topicPage;
97
- }
98
-
99
- /**
100
- * Save the topic page definition to a file
101
- * @param filepath location of the file to which you'll save the topic page definition
102
- */
103
- public saveTopicPageDefinitionToFile(filepath: string) {
104
- fs.writeFileSync(filepath, JSON.stringify(this.topicPage, null, 4), "utf8");
105
- }
106
-
107
- /**
108
- * What is the minimum total weight that an article has to have in order to get it among the results?
109
- */
110
- public set articleThreshold(value: number) {
111
- if (_.isNumber(value) && value >= 0) {
112
- this.topicPage.articleTreshWgt = value;
113
- }
114
- }
115
-
116
- /**
117
- * What is the minimum total weight that an event has to have in order to get it among the results?
118
- */
119
- public set eventThreshold(value: number) {
120
- if (_.isNumber(value) && value >= 0) {
121
- this.topicPage.eventTreshWgt = value;
122
- }
123
- }
124
-
125
- /**
126
- * Some articles can be duplicates of other articles. What should be done with them. Possible values are:
127
- * "skipDuplicates" (skip the resulting articles that are duplicates of other articles),
128
- * "keepOnlyDuplicates" (return only the duplicate articles) and
129
- * "keepAll" (no filtering, default)
130
- */
131
- public set articleIsDuplicateFilter(value: "skipDuplicates" | "keepOnlyDuplicates" | "keepAll") {
132
- if (value === "skipDuplicates" || value === "keepOnlyDuplicates" || value === "keepAll") {
133
- this.topicPage.articleIsDuplicate = value;
134
- }
135
- }
136
-
137
- /**
138
- * Some articles describe a known event and some don't. This filter allows you to filter the resulting articles based on this criteria.
139
- * Possible values are:
140
- * "skipArticlesWithoutEvent" (skip articles that are not describing any known event in ER),
141
- * "keepOnlyArticlesWithoutEvent" (return only the articles that are not describing any known event in ER) and
142
- * "keepAll" (no filtering, default)
143
- */
144
- public set articleHasEventFilter(value: "skipArticlesWithoutEvent" | "keepOnlyArticlesWithoutEvent" | "keepAll") {
145
- if (value === "skipArticlesWithoutEvent" || value === "keepOnlyArticlesWithoutEvent" || value === "keepAll") {
146
- this.topicPage.articleHasEvent = value;
147
- }
148
- }
149
-
150
- /**
151
- * Some articles are later copied by others. What should be done with such articles. Possible values are:
152
- * "skipHasDuplicates" (skip the articles that have been later copied by others),
153
- * "keepOnlyHasDuplicates" (return only the articles that have been later copied by others) and
154
- * "keepAll" (no filtering, default)
155
- */
156
- public set articleHasDuplicateFilter(value: "skipHasDuplicates" | "keepOnlyHasDuplicates" | "keepAll") {
157
- if (value === "skipHasDuplicates" || value === "keepOnlyHasDuplicates" || value === "keepAll") {
158
- this.topicPage.articleHasDuplicate = value;
159
- }
160
- }
161
-
162
- /**
163
- * What data types should we search? "news" (news content, default), "pr" (press releases), or "blog".
164
- * If you want to use multiple data types, put them in an array (e.g. ["news", "pr"])
165
- */
166
- public set dataTypes(dataTypes: EventRegistryStatic.DataType | EventRegistryStatic.DataType[]) {
167
- this.topicPage.dataType = dataTypes;
168
- }
169
-
170
- public set sourceRankStartPercentile(startPercentile: number) {
171
- if (_.isUndefined(startPercentile)) {
172
- startPercentile = 0;
173
- }
174
-
175
- if (startPercentile < 0 || startPercentile > 90) {
176
- throw new RangeError("startPercentile is out of valid values (0 - 90)");
177
- }
178
-
179
- if (!_.isNil(this.topicPage.endSourceRankPercentile) && _.isNumber(this.topicPage.endSourceRankPercentile) && startPercentile >= this.topicPage.endSourceRankPercentile ) {
180
- throw new RangeError("startPercentile has to be smaller than endPercentile");
181
- }
182
-
183
- if (startPercentile % 10 !== 0) {
184
- throw new Error("startPecentile has to be a multiple of 10");
185
- }
186
-
187
- this.topicPage.startSourceRankPercentile = startPercentile;
188
- }
189
-
190
- public set sourceRankEndPercentile(endPercentile: number) {
191
- if (_.isUndefined(endPercentile)) {
192
- endPercentile = 100;
193
- }
194
-
195
- if (endPercentile < 10 || endPercentile > 100) {
196
- throw new RangeError("endPercentile is out of valid values (10 - 100)");
197
- }
198
-
199
- if (!_.isNil(this.topicPage.startSourceRankPercentile) && _.isNumber(this.topicPage.startSourceRankPercentile) && this.topicPage.startSourceRankPercentile >= endPercentile ) {
200
- throw new RangeError("startPercentile has to be smaller than endPercentile");
201
- }
202
-
203
- if (endPercentile % 10 !== 0) {
204
- throw new Error("endPercentile has to be a multiple of 10");
205
- }
206
- this.topicPage.endSourceRankPercentile = endPercentile;
207
- }
208
-
209
- /**
210
- * What is the maximum allowed age of the results?
211
- */
212
- public set maxDaysBack(maxDaysBack: number) {
213
- if (!_.isNumber(maxDaysBack)) {
214
- throw new Error("maxDaysBack value has to be a positive number");
215
- }
216
- if (maxDaysBack <= 0) {
217
- throw new RangeError("maxDaysBack value has to be a positive number");
218
- }
219
- this.topicPage.maxDaysBack = maxDaysBack;
220
- }
221
-
222
- public clearConcepts() {
223
- this.topicPage.concepts = [];
224
- }
225
-
226
- public clearKeywords() {
227
- this.topicPage.keywords = [];
228
- }
229
-
230
- public clearCategories() {
231
- this.topicPage.categories = [];
232
- }
233
-
234
- public clearSources() {
235
- this.topicPage.sources = [];
236
- }
237
-
238
- public clearSourceLocations() {
239
- this.topicPage.sourceLocations = [];
240
- }
241
-
242
- public clearSourceGroups() {
243
- this.topicPage.sourceGroups = [];
244
- }
245
-
246
- public clearLocations() {
247
- this.topicPage.locations = [];
248
- }
249
-
250
- /**
251
- * Add a relevant concept to the topic page
252
- * @param uri uri of the concept to be added
253
- * @param weight importance of the provided concept (typically in range 1 - 50)
254
- */
255
- public addConcept(uri: string, wgt: number, args: EventRegistryStatic.TopicPageAddConceptArguments = {}) {
256
- if (!_.isNumber(wgt)) {
257
- throw new Error("Weight value has to be a positive or negative number");
258
- }
259
- const {
260
- label,
261
- conceptType,
262
- required = false,
263
- excluded = false,
264
- } = args;
265
- if (required && excluded) {
266
- throw new Error("Parameters required and excluded can not be true at the same time");
267
- }
268
- const concept = { uri, wgt, required, excluded };
269
- if (!_.isUndefined(label)) {
270
- _.set(concept, "label", label);
271
- }
272
- if (!_.isUndefined(conceptType)) {
273
- _.set(concept, "type", conceptType);
274
- }
275
- this.topicPage.concepts = [...this.topicPage.concepts, concept];
276
- }
277
-
278
- /**
279
- * Add a relevant keyword to the topic page
280
- * @param keyword keyword or phrase to be added
281
- * @param weight importance of the provided keyword (typically in range 1 - 50)
282
- */
283
- public addKeyword(keyword: string, wgt: number, args: EventRegistryStatic.TopicPageAddKeywordArguments = {}) {
284
- if (!_.isNumber(wgt)) {
285
- throw new Error("Weight value has to be a positive or negative number");
286
- }
287
- const {
288
- required = false,
289
- excluded = false,
290
- } = args;
291
- this.topicPage.keywords = [...this.topicPage.keywords, {keyword, wgt, required, excluded}];
292
- }
293
-
294
- /**
295
- * Add a relevant category to the topic page
296
- * @param uri uri of the category to be added
297
- * @param weight importance of the provided category (typically in range 1 - 50)
298
- */
299
- public addCategory(uri: string, wgt: number, args: EventRegistryStatic.TopicPageAddCategoryArguments = {}) {
300
- if (!_.isNumber(wgt)) {
301
- throw new Error("Weight value has to be a positive or negative number");
302
- }
303
- const {
304
- required = false,
305
- excluded = false,
306
- } = args;
307
- this.topicPage.categories = [...this.topicPage.categories, {uri, wgt, required, excluded}];
308
- }
309
-
310
- /**
311
- * Add a news source to the topic page
312
- * @param uri uri of the news source to add to the topic page
313
- * @param weight importance of the news source (typically in range 1 - 50)
314
- */
315
- public addSource(uri: string, wgt: number, args: EventRegistryStatic.TopicPageAddSourceArguments = {}) {
316
- if (!_.isNumber(wgt)) {
317
- throw new Error("Weight value has to be a positive or negative number");
318
- }
319
- const {
320
- excluded = false,
321
- } = args;
322
- this.topicPage.sources = [...this.topicPage.sources, {uri, wgt, excluded}];
323
- }
324
-
325
- /**
326
- * Add a list of relevant sources by identifying them by their geographic location
327
- * @param uri uri of the location where the sources should be geographically located
328
- * @param weight importance of the provided list of sources (typically in range 1 - 50)
329
- */
330
- public addSourceLocation(uri: string, wgt: number, args: EventRegistryStatic.TopicPageAddSourceLocationArguments = {}) {
331
- if (!_.isNumber(wgt)) {
332
- throw new Error("Weight value has to be a positive or negative number");
333
- }
334
- const {
335
- excluded = false,
336
- } = args;
337
- this.topicPage.sourceLocations = [...this.topicPage.sourceLocations, {uri, wgt, excluded}];
338
- }
339
-
340
- /**
341
- * Add a list of relevant sources by specifying a whole source group to the topic page
342
- * @param sourceGroupUri uri of the source group to add
343
- * @param weight importance of the provided list of sources (typically in range 1 - 50)
344
- */
345
- public addSourceGroup(uri: string, wgt: number, args: EventRegistryStatic.TopicPageAddSourceGroupArguments = {}) {
346
- if (!_.isNumber(wgt)) {
347
- throw new Error("Weight value has to be a positive or negative number");
348
- }
349
- const {
350
- excluded = false,
351
- } = args;
352
- this.topicPage.sourceGroups = [...this.topicPage.sourceGroups, {uri, wgt, excluded}];
353
- }
354
-
355
- /**
356
- * Add relevant location to the topic page
357
- * @param locationUri uri of the location to add
358
- * @param weight importance of the provided location (typically in range 1 - 50)
359
- */
360
- public addLocation(locationUri: string, weight: number) {
361
- if (!_.isNumber(weight)) {
362
- throw new Error("Weight value has to be a positive or negative number");
363
- }
364
- this.topicPage.locations = [...this.topicPage.locations, {uri: locationUri, wgt: weight}];
365
- }
366
-
367
- /**
368
- * Restrict the results to the list of specified languages
369
- */
370
- public set languages(languages: string | string[]) {
371
- if (!_.isArray(languages)) {
372
- languages = [languages];
373
- }
374
- if (_.every(languages, (language) => _.size(language) === 3)) {
375
- this.topicPage.langs = languages;
376
- } else {
377
- throw new Error("Expected to get language in ISO3 code");
378
- }
379
- }
380
-
381
- /**
382
- * if true then the results have to mention at least one of the specified concepts or keywords
383
- */
384
- public set restrictToSetConceptsAndKeywords(restrict: boolean) {
385
- if (!_.isBoolean(restrict)) {
386
- throw new Error("Restrict value has to be a boolean value");
387
- }
388
- this.topicPage.restrictToSetConcepts = restrict;
389
- }
390
-
391
- /**
392
- * if set to true then return only results that are assigned to one of the specified categories
393
- */
394
- public set restrictToSetCategories(restrict: boolean) {
395
- if (!_.isBoolean(restrict)) {
396
- throw new Error("Restrict value has to be a boolean value");
397
- }
398
- this.topicPage.restrictToSetCategories = restrict;
399
- }
400
-
401
- /**
402
- * if set to true then return only results from one of the specified news sources
403
- * this includes also sources set by source groups or by source locations
404
- */
405
- public set restrictToSetSources(restrict: boolean) {
406
- if (!_.isBoolean(restrict)) {
407
- throw new Error("Restrict value has to be a boolean value");
408
- }
409
- this.topicPage.restrictToSetSources = restrict;
410
- }
411
-
412
- /**
413
- * if set to true, then return only results that are located at one of the specified locations
414
- */
415
- public set restrictToSetLocations(restrict: boolean) {
416
- if (!_.isBoolean(restrict)) {
417
- throw new Error("Restrict value has to be a boolean value");
418
- }
419
- this.topicPage.restrictToSetLocations = restrict;
420
- }
421
-
422
- /**
423
- * Return a list of articles that match the topic page
424
- * @param args {EventRegistryStatic.TopicPageArticles} Object which contains a host of optional parameters
425
- */
426
- public async getArticles(args: EventRegistryStatic.TopicPageArticles = {}) {
427
- const {page = 1, count = 100, sortBy = "rel", sortByAsc = false, dataType = "news", returnInfo = new ReturnInfo(), ...otherParameters} = args;
428
- if (page < 1) {
429
- throw new RangeError("page has to be >= 1");
430
- }
431
- if (count > 100) {
432
- throw new RangeError("At most 100 articles can be returned at a time");
433
- }
434
- let params = _.extend({}, {
435
- action: "getArticlesForTopicPage",
436
- resultType: "articles",
437
- dataType: this.topicPage.dataType,
438
- articlesCount: count,
439
- articlesSortBy: sortBy,
440
- articlesSortByAsc: sortByAsc,
441
- articlesPage: page,
442
- topicPage: JSON.stringify(this.topicPage),
443
- }, returnInfo.getParams());
444
- if (!_.isEmpty(otherParameters)) {
445
- params = {...params, ...otherParameters};
446
- }
447
- const request = await this.eventRegistry.jsonRequest("/api/v1/article", params);
448
- return _.get(request, "data.articles.results", []);
449
- }
450
- /**
451
- * Return a list of events that match the topic page
452
- * @param args {EventRegistryStatic.TopicPageEvents} Object which contains a host of optional parameters
453
- */
454
- public async getEvents(args: EventRegistryStatic.TopicPageEvents = {}) {
455
- const {page = 1, count = 50, sortBy = "rel", sortByAsc = false, returnInfo = new ReturnInfo(), ...otherParameters} = args;
456
- if (page < 1) {
457
- throw new RangeError("page has to be >= 1");
458
- }
459
- if (count > 50) {
460
- throw new RangeError("At most 50 events can be returned at a time");
461
- }
462
- let params = _.extend({}, {
463
- action: "getEventsForTopicPage",
464
- resultType: "events",
465
- dataType: this.topicPage.dataType,
466
- eventsCount: count,
467
- eventsSortBy: sortBy,
468
- eventsSortByAsc: sortByAsc,
469
- eventsPage: page,
470
- topicPage: JSON.stringify(this.topicPage),
471
- }, returnInfo.getParams());
472
- if (!_.isEmpty(otherParameters)) {
473
- params = {...params, ...otherParameters};
474
- }
475
- const request = await this.eventRegistry.jsonRequest("/api/v1/event", params);
476
- return _.get(request, "data.events.results", []);
477
- }
478
-
479
- }
package/src/trends.ts DELETED
@@ -1,63 +0,0 @@
1
- import * as _ from "lodash";
2
- import { QueryParamsBase } from "./base";
3
- import { ReturnInfo } from "./returnInfo";
4
-
5
- export abstract class TrendsBase extends QueryParamsBase {
6
- public get path() {
7
- return "/api/v1/trends";
8
- }
9
- }
10
-
11
- export class GetTrendingConcepts extends TrendsBase {
12
- constructor({source = "news", count = 20, conceptType = ["person", "org", "loc"], returnInfo = new ReturnInfo()} = {}) {
13
- super();
14
- this.setVal("action", "getTrendingConcepts");
15
- this.setVal("source", source);
16
- if (source !== "social") {
17
- this.setVal("dataType", source);
18
- }
19
- this.setVal("conceptCount", count);
20
- this.setVal("conceptType", conceptType);
21
- this.params = _.extend({}, this.params, returnInfo.getParams());
22
- }
23
- }
24
-
25
- export class GetTrendingCategories extends TrendsBase {
26
- constructor({source = "news", count = 20, returnInfo = new ReturnInfo()} = {}) {
27
- super();
28
- this.setVal("action", "getTrendingCategories");
29
- this.setVal("source", source);
30
- if (source !== "social") {
31
- this.setVal("dataType", source);
32
- }
33
- this.setVal("categoryCount", count);
34
- this.params = _.extend({}, this.params, returnInfo.getParams());
35
- }
36
- }
37
-
38
- export class GetTrendingCustomItems extends TrendsBase {
39
- constructor({count = 20, returnInfo = new ReturnInfo()} = {}) {
40
- super();
41
- this.setVal("action", "getTrendingCustom");
42
- this.setVal("conceptCount", count);
43
- this.params = _.extend({}, this.params, returnInfo.getParams());
44
- }
45
- }
46
-
47
- export class GetTrendingConceptGroups extends TrendsBase {
48
- constructor({source = "news", count = 20, returnInfo = new ReturnInfo()} = {}) {
49
- super();
50
- this.setVal("action", "getConceptTrendGroups");
51
- this.setVal("source", source);
52
- this.setVal("conceptCount", count);
53
- this.params = _.extend({}, this.params, returnInfo.getParams());
54
- }
55
-
56
- public getConceptTypeGroups(types = ["person", "org", "loc"]) {
57
- this.setVal("conceptType", types);
58
- }
59
-
60
- public getConceptClassUris(conceptClassUris) {
61
- this.setVal("conceptClassUri", conceptClassUris);
62
- }
63
- }
package/test/index.d.ts DELETED
@@ -1,18 +0,0 @@
1
- // tslint:disable-next-line:no-namespace
2
- declare namespace jasmine {
3
- interface Matchers<T> {
4
- toBeValidConcept(): boolean;
5
- toBeValidArticle(): boolean;
6
- toBeValidGeneralArticleList(): boolean;
7
- toBeValidCategory(): boolean;
8
- toBeValidSource(): boolean;
9
- toBeValidEvent(): boolean;
10
- toBeValidGeneralEventList(): boolean;
11
- toBeValidStory(): boolean;
12
- toContainConcept(test1: string): boolean;
13
- toContainSource(test1: string): boolean;
14
- toContainCategory(test1: string): boolean;
15
- toContainBodyText(test1: string): boolean;
16
- toHaveProperty(propName: string): boolean;
17
- }
18
- }
package/test/jasmine.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "spec_dir": "test",
3
- "spec_files": [
4
- "./dist/**/*[sS]pec.js"
5
- ],
6
- "helpers": [
7
- "/dist/utils.js"
8
- ],
9
- "stopSpecOnExpectationFailure": false
10
- }