eventregistry 8.10.1 → 8.10.3

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 (70) hide show
  1. package/dist/eventRegistry.d.ts +1 -0
  2. package/dist/eventRegistry.js +10 -2
  3. package/dist/eventRegistry.js.map +1 -1
  4. package/dist/queryArticles.js +1 -1
  5. package/dist/queryArticles.js.map +1 -1
  6. package/dist/queryEvent.js +1 -1
  7. package/dist/queryEvent.js.map +1 -1
  8. package/dist/queryEvents.js +1 -1
  9. package/dist/queryEvents.js.map +1 -1
  10. package/dist/queryMentions.js +1 -1
  11. package/dist/queryMentions.js.map +1 -1
  12. package/{src → dist}/types.d.ts +199 -255
  13. package/dist/types.js +3 -0
  14. package/dist/types.js.map +1 -0
  15. package/package.json +6 -5
  16. package/CHANGELOG.md +0 -116
  17. package/dist/correlations.d.ts +0 -50
  18. package/dist/correlations.js +0 -397
  19. package/dist/correlations.js.map +0 -1
  20. package/examples/autoSuggestionsExamples.ts +0 -46
  21. package/examples/countsExamples.ts +0 -34
  22. package/examples/dailySharesExamples.ts +0 -54
  23. package/examples/eventForTextExamples.ts +0 -32
  24. package/examples/feedOfNewArticlesExamples.ts +0 -82
  25. package/examples/feedOfNewEventsExamples.ts +0 -70
  26. package/examples/queryArticleExamples.ts +0 -42
  27. package/examples/queryArticlesExamples.ts +0 -248
  28. package/examples/queryEventExamples.ts +0 -99
  29. package/examples/queryEventsExamples.ts +0 -232
  30. package/examples/queryMentionsExamples.ts +0 -20
  31. package/examples/topicPageExamples.ts +0 -99
  32. package/examples/trendsExamples.ts +0 -34
  33. package/src/analytics.ts +0 -181
  34. package/src/base.ts +0 -198
  35. package/src/counts.ts +0 -119
  36. package/src/dailyShares.ts +0 -48
  37. package/src/eventForText.ts +0 -61
  38. package/src/eventRegistry.ts +0 -733
  39. package/src/index.ts +0 -125
  40. package/src/info.ts +0 -121
  41. package/src/query.ts +0 -257
  42. package/src/queryArticle.ts +0 -139
  43. package/src/queryArticles.ts +0 -608
  44. package/src/queryEvent.ts +0 -473
  45. package/src/queryEvents.ts +0 -689
  46. package/src/queryMentions.ts +0 -516
  47. package/src/queryStory.ts +0 -152
  48. package/src/recent.ts +0 -63
  49. package/src/returnInfo.ts +0 -363
  50. package/src/topicPage.ts +0 -479
  51. package/src/trends.ts +0 -63
  52. package/test/index.d.ts +0 -18
  53. package/test/jasmine.json +0 -10
  54. package/test/spec/analytics.spec.ts +0 -150
  55. package/test/spec/autoSuggestions.spec.ts +0 -54
  56. package/test/spec/info.spec.ts +0 -84
  57. package/test/spec/invalidQueries.spec.ts +0 -147
  58. package/test/spec/queryArticle.spec.ts +0 -62
  59. package/test/spec/queryArticles.spec.ts +0 -541
  60. package/test/spec/queryArticlesComplex.spec.ts +0 -298
  61. package/test/spec/queryEvent.spec.ts +0 -194
  62. package/test/spec/queryEvents.spec.ts +0 -491
  63. package/test/spec/queryEventsComplex.spec.ts +0 -188
  64. package/test/spec/queryPaging.spec.ts +0 -318
  65. package/test/spec/returnInfo.spec.ts +0 -34
  66. package/test/spec/topicPage.spec.ts +0 -83
  67. package/test/spec/utils.ts +0 -436
  68. package/test/tsconfig.json +0 -31
  69. package/tsconfig.json +0 -32
  70. package/tslint.json +0 -25
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Anže Sršen",
3
3
  "name": "eventregistry",
4
4
  "description": "Package containing wrapper functions for Event Registry API",
5
- "version": "8.10.1",
5
+ "version": "8.10.3",
6
6
  "license": "MIT",
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
@@ -10,6 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/EventRegistry/event-registry-node-js.git"
12
12
  },
13
+ "files": ["dist"],
13
14
  "scripts": {
14
15
  "build": "tsc --project tsconfig.json",
15
16
  "build:watch": "tsc --watch --project tsconfig.json",
@@ -21,15 +22,15 @@
21
22
  "node": ">=5.0.0"
22
23
  },
23
24
  "devDependencies": {
25
+ "@types/jasmine": "2.8.6",
26
+ "@types/lodash": "4.14.108",
27
+ "@types/node": "8.0.50",
28
+ "@types/qs": "6.5.1",
24
29
  "jasmine": "2.8.0",
25
30
  "tslint": "^6.0.0",
26
31
  "typescript": "3.0.1"
27
32
  },
28
33
  "dependencies": {
29
- "@types/jasmine": "2.8.6",
30
- "@types/lodash": "4.14.108",
31
- "@types/node": "8.0.50",
32
- "@types/qs": "6.5.1",
33
34
  "axios": "^0.21.1",
34
35
  "lodash": "^4.17.21",
35
36
  "moment": "^2.29.1",
package/CHANGELOG.md DELETED
@@ -1,116 +0,0 @@
1
- # NodeJS SDK: Change Log
2
-
3
- This log contains changes specific to the NodeJS SDK.
4
- ## [v8.10.1]() (2022-03-23)
5
-
6
- **Breaking**
7
-
8
- - `TopicPage.getArticles` and `TopicPage.getEvents` return full response with additional page/pages information (instead of simple array of articles/events).
9
-
10
- ## [v8.10.0]() (2021-10-19)
11
-
12
- **Added**
13
-
14
- - 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.
15
-
16
- **Updated**
17
- - When using method `initWithComplexQuery` we now check if the provided json is valid json object and report error in case it is not
18
-
19
- ## [v8.9.2]() (2021-05-12)
20
-
21
- **Updated**
22
-
23
- - Updated dependencies of the SDK library
24
-
25
- ## [v8.9]() (2020-11-24)
26
-
27
- **Added**
28
-
29
- - added `required` and `excluded` optional parameters to the TopicPage class to methods `addConcept`, `addKeyword`, `addCategory`, `addSource`, `addSourceLocation` and `addSourceGroup`.
30
- - exceptions are now raised by the SDK library in case of status codes 204, 400, 401, 403 and 530. The meaning of the above status codes is described on the [documentation page](https://eventregistry.org/documentation?tab=introduction).
31
-
32
- ## [v8.8.0]() (2020-10-07)
33
-
34
- **Added**
35
-
36
- - added filters `reportingDateStart` and `reportingDateEnd` to `QueryEvents`. You can use these dates to find the events where the average date of reporting matches this date range. Note that `dateStart` and `dateEnd` will return events based on when they (supposedly) happened and it can be quite different than the reporting dates.
37
- - added parameters `updatesAfterNewsUri`, `updatesafterBlogUri`, `updatesAfterPrUri` to the `RequestArticlesRecentActivity`. Can be used to make sure that absolutely no article is missed when using the `QueryArticles` with `RequestArticlesRecentActivity` requested result. See [this file](https://github.com/EventRegistry/event-registry-node-js/blob/master/examples/feedOfNewArticlesExamples.ts) for an example of use.
38
-
39
-
40
- ## [v8.7.0]() (2020-01-31)
41
-
42
- **Added**
43
- - added `EventRegistry.getServiceStatus()` method that reports status of the services
44
- - We added sentiment, which can now be used in querying of articles and events. The `QueryArticles`, `QueryArticlesIter`, `QueryEvents`, `QueryEventsIter` now all have additional parameters `minSentiment` and `maxSentiment` that can be used to filter the articles and events. The valid values are between -1 (very negative sentiment) and 1 (very positive sentiment). Value 0 represents neutral sentiment.
45
- - Sentiment was also added as a property in the returned articles and events.
46
- - `ComplexQueryArticles` and `ComplexQueryEvents` classes now support in the constructor additional filters like `minSentiment`, `maxSentiment`, `minFacebookShares`, `endSourceRankPercentile`, etc.
47
-
48
- **Updated**
49
- - `ReturnInfo` classes (`ArticleInfoFlags`, `ConceptInfoFlags`, ...) were updated. Some obsolete parameters were removed and we've also added support to directly pass any rarely used parameters, that are not a part of the typings.
50
- - `TopicPage.getArticles` and `TopicPage.getEvents` methods now also support passing any rarely used parameters directly, that are not a part of the typings.
51
- - Analytics: We updated `trainTopicOnTweets()`, `trainTopicClearTopic()` and `trainTopicGetTrainedTopic()` methods in the `Analytics` class.
52
- - `Analytics.annotate()` method now supports passing custom parameters that should be used when annotating the text.
53
- - Changed some defaults in the returned data. When searching articles, we now by default return article image and sentiment.
54
- - Analytics. updated `trainTopicOnTweets()`, `trainTopicClearTopic()` and `trainTopicGetTrainedTopic()` methods in the `Analytics` class.
55
- - `QueryArticles.initWithComplexQuery()` was updated - the parameter `dataType` was removed (since the `dataType` value should be provided in the `$filter` section of the query)
56
- - `TopicPage` now supports setting also the source rank percentile
57
- - `Analytics.extractArticleInfo` now also supports setting the headers and cookies to be used when making the requests
58
-
59
- **Removed**
60
-
61
- - removed `EventRegistry.suggestCustomConcepts()` and `EventRegistry.getCustomConceptUri()` methods. Not used anymore since we are not supporting anymore the correlation feature.
62
-
63
- ## [v8.5.13]() (2018-10-10)
64
-
65
- **Changed**
66
- - Better exposure of Typescript type definitions (affects Typescript users)
67
-
68
- ## [v8.5.1]() (2018-09-17)
69
-
70
- **Changed**
71
- - A couple of minor fixes and improvements for examples and other minor things
72
-
73
- ## [v8.5.0]() (2018-09-14)
74
-
75
- **Added**
76
- - Added `Analytics.trainTopicOnTweets()` method that can be used to train a topic by analyzing a group of tweets. See example of usage on the [wiki page](https://github.com/EventRegistry/event-registry-python/wiki/Text-analytics#train-a-topic-based-on-the-tweets).
77
- - Added a group of `Analytics.trainTopic*()` methods that can be used to analyze your own documents and build a topic from them. See example of usage on the [wiki page](https://github.com/EventRegistry/event-registry-python/wiki/Text-analytics#train-a-custom-topic).
78
-
79
- ## [v8.4.0]() (2018-09-13)
80
-
81
- **Added**
82
- - added searching of articles and events based on article authors. You can now provide `authorUri` parameter when creating the `QueryArticles` and `QueryEvents` instances.
83
- - added author related methods to `EventRegistry` class: `EventRegistry.suggestAuthors()` to obtain uris of authors for given (partial) name and `EventRegistry.getAuthorUri()` to obtain a single author uri for the given (partial) name.
84
- - added ability to search articles and events by authors. `QueryArticles` and `QueryEvents` constructors now also accept `authorUri` parameter that can be used to limit the results to articles/events by those authors. Use `QueryOper.AND()` or `QueryOper.OR()` to specify multiple authors in the same query.
85
- - BETA: added a filter for returning only articles that are written by sources that have a certain ranking. The filter can be specified by setting the parameters `startSourceRankPercentile` and `endSourceRankPercentile` when creating the `QueryArticles` instance. The default value for `startSourceRankPercentile` is 0 and for `endSourceRankPercentile` is 100. The values that can be set are not any value between 0 and 100 but has to be a number divisible by 10. By setting `startSourceRankPercentile` to 0 and `endSourceRankPercentile` to 20 you would get only articles from top ranked news sources (according to [Alexa site ranking](https://www.alexa.com/siteinfo)) that would amount to about *approximately 20%* of all matching content. Note: 20 percentiles do not represent 20% of all top sources. The value is used to identify the subset of news sources that generate approximately 20% of our collected news content. The reason for this choice is that top ranked 10% of news sources writes about 30% of all news content and our choice normalizes this effect. This feature could potentially change in the future.
86
- - `QueryEventArticlesIter` is now able to return only a subset of articles assigned to an event. You can use the same filters as with the `QueryArticles` constructor and you can specify them when constructing the instance of `QueryEventArticlesIter`. The same kind of filtering is also possible if you want to use the `RequestEventArticles()` class instead.
87
- - added some parameters and changed default values in some of the result types to reflect the backend changes.
88
- - added optional parameter `proxyUrl` to `Analytics.extractArticleInfo()`. It can be used to download article info through a proxy that you provide (to avoid potential GDPR issues). The `proxyUrl` should be in format `{schema}://{username}:{pass}@{proxy url/ip}`.
89
-
90
- ## [v8.3.12]() (2018-08-16)
91
-
92
- **Added**
93
- - Added `getUsageInfo` method which returns usage information. It returns an object with two properties: availableTokens and usedTokens
94
-
95
- ## [v8.3.11]() (2018-08-13)
96
-
97
- **Added**
98
- - Missing utility methods`getRemainingAvailableRequests`, `getDailyAvailableRequests`, `getLastHeaders` and `getLastHeader`.
99
-
100
- ## [v8.3.1]() (2018-08-06)
101
-
102
- **Changed**
103
- - Switched to POST requests instead of GET
104
-
105
- ## [v8.3.0]() (2018-08-06)
106
-
107
- **Added**
108
- - Implemented all the latest changes as seen in the Python SDK 8.3.0.
109
-
110
- **Breaking**
111
- - `QueryArticlesIter`, `QueryEventArticlesIter` and `QueryEventsIter` now return one item at a time instead of the whole page (array) of items.
112
-
113
- **Changed**
114
- - Updated to Typescript 3.0.
115
- - Version bump to be more inline with the Python SDK versioning
116
- - It's no longer possible to specify batch sizes for `QueryArticlesIter`, `QueryEventArticlesIter` and `QueryEventsIter`.
@@ -1,50 +0,0 @@
1
- import { QueryParamsBase } from "./base";
2
- import { GetCounts } from "./counts";
3
- import { EventRegistry } from "./eventRegistry";
4
- import { QueryArticles } from "./queryArticles";
5
- import { EventRegistryStatic } from "./types";
6
- /**
7
- * @class GetTopCorrelations
8
- * Provides classes needed to identify concepts or categories
9
- * that trend the most with a concept, category or a custom time series
10
- */
11
- export declare class GetTopCorrelations extends QueryParamsBase {
12
- private er;
13
- constructor(er: EventRegistry);
14
- readonly path: string;
15
- /**
16
- * Specify the user defined array of input data
17
- * @param inputDataArr: array of tuples (date, val) where date is a date object or string in YYYY-MM-DD format and val is the value/counts for that date
18
- */
19
- setCustomInputData(inputDataArr: any): void;
20
- /**
21
- * Use the queryArticles to find articles that match the criteria. For the articles that match
22
- * criteria in queryArticles compute the time-series (number of resulting articles for each date)
23
- * an use the time series as the input data.
24
- * @param queryArticles An instance of QueryArticles class, containing the conditions that are use to find the matching time-series. You don't need to specify any requested result.
25
- */
26
- loadInputDataWithQuery(queryArticles: QueryArticles): Promise<void>;
27
- /**
28
- * Use GetCounts class to obtain daily counts information for concept/category of interest.
29
- * @param getCounts An instance of GetCounts class.
30
- */
31
- loadInputDataWithCounts(getCounts: GetCounts): Promise<void>;
32
- /**
33
- * Do we have valid input data (needed before we can compute correlations)
34
- */
35
- hasValidInputData(): boolean;
36
- /**
37
- * Compute concepts that correlate the most with the input data. If candidateConceptsQuery is provided we first identify the
38
- * concepts that are potentially returned as top correlations. Candidates are obtained by making the query and analyzing the
39
- * concepts that appear in the resulting articles. The top concepts are used as candidates among which we return the top correlations.
40
- * If conceptType is provided then only concepts of the specified type can be provided as the result.
41
- *
42
- * @param args Object which contains a host of optional parameters
43
- */
44
- getTopConceptCorrelations(args?: EventRegistryStatic.Correlations.TopConceptArguments): Promise<any>;
45
- /**
46
- * Compute categories that correlate the most with the input data.
47
- * @param args Object which contains a host of optional parameters
48
- */
49
- getTopCategoryCorrelations(args?: EventRegistryStatic.Correlations.TopCategoryArguments): Promise<any>;
50
- }
@@ -1,397 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- }
9
- return function (d, b) {
10
- extendStatics(d, b);
11
- function __() { this.constructor = d; }
12
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
- };
14
- })();
15
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- var __generator = (this && this.__generator) || function (thisArg, body) {
24
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
25
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
- function verb(n) { return function (v) { return step([n, v]); }; }
27
- function step(op) {
28
- if (f) throw new TypeError("Generator is already executing.");
29
- while (_) try {
30
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
- if (y = 0, t) op = [op[0] & 2, t.value];
32
- switch (op[0]) {
33
- case 0: case 1: t = op; break;
34
- case 4: _.label++; return { value: op[1], done: false };
35
- case 5: _.label++; y = op[1]; op = [0]; continue;
36
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
- default:
38
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
- if (t[2]) _.ops.pop();
43
- _.trys.pop(); continue;
44
- }
45
- op = body.call(thisArg, _);
46
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
- }
49
- };
50
- var __values = (this && this.__values) || function (o) {
51
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
52
- if (m) return m.call(o);
53
- return {
54
- next: function () {
55
- if (o && i >= o.length) o = void 0;
56
- return { value: o && o[i++], done: !o };
57
- }
58
- };
59
- };
60
- var __read = (this && this.__read) || function (o, n) {
61
- var m = typeof Symbol === "function" && o[Symbol.iterator];
62
- if (!m) return o;
63
- var i = m.call(o), r, ar = [], e;
64
- try {
65
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
66
- }
67
- catch (error) { e = { error: error }; }
68
- finally {
69
- try {
70
- if (r && !r.done && (m = i["return"])) m.call(i);
71
- }
72
- finally { if (e) throw e.error; }
73
- }
74
- return ar;
75
- };
76
- var __spread = (this && this.__spread) || function () {
77
- for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
78
- return ar;
79
- };
80
- Object.defineProperty(exports, "__esModule", { value: true });
81
- var _ = require("lodash");
82
- var base_1 = require("./base");
83
- var counts_1 = require("./counts");
84
- var info_1 = require("./info");
85
- var queryArticles_1 = require("./queryArticles");
86
- var returnInfo_1 = require("./returnInfo");
87
- /**
88
- * @class GetTopCorrelations
89
- * Provides classes needed to identify concepts or categories
90
- * that trend the most with a concept, category or a custom time series
91
- */
92
- var GetTopCorrelations = /** @class */ (function (_super) {
93
- __extends(GetTopCorrelations, _super);
94
- function GetTopCorrelations(er) {
95
- var _this = _super.call(this) || this;
96
- _this.er = er;
97
- _this.setVal("action", "findTopCorrelations");
98
- return _this;
99
- }
100
- Object.defineProperty(GetTopCorrelations.prototype, "path", {
101
- get: function () {
102
- return "/json/correlate";
103
- },
104
- enumerable: true,
105
- configurable: true
106
- });
107
- /**
108
- * Specify the user defined array of input data
109
- * @param inputDataArr: array of tuples (date, val) where date is a date object or string in YYYY-MM-DD format and val is the value/counts for that date
110
- */
111
- GetTopCorrelations.prototype.setCustomInputData = function (inputDataArr) {
112
- var e_1, _a;
113
- this.clearVal("testData");
114
- try {
115
- for (var inputDataArr_1 = __values(inputDataArr), inputDataArr_1_1 = inputDataArr_1.next(); !inputDataArr_1_1.done; inputDataArr_1_1 = inputDataArr_1.next()) {
116
- var _b = inputDataArr_1_1.value, date = _b.date, val = _b.val;
117
- if (!_.isNumber(val)) {
118
- throw new Error("Value is expected to be a number");
119
- }
120
- this.addArrayVal("testData", { date: base_1.QueryParamsBase.encodeDateTime(date), count: val });
121
- }
122
- }
123
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
124
- finally {
125
- try {
126
- if (inputDataArr_1_1 && !inputDataArr_1_1.done && (_a = inputDataArr_1.return)) _a.call(inputDataArr_1);
127
- }
128
- finally { if (e_1) throw e_1.error; }
129
- }
130
- };
131
- /**
132
- * Use the queryArticles to find articles that match the criteria. For the articles that match
133
- * criteria in queryArticles compute the time-series (number of resulting articles for each date)
134
- * an use the time series as the input data.
135
- * @param queryArticles An instance of QueryArticles class, containing the conditions that are use to find the matching time-series. You don't need to specify any requested result.
136
- */
137
- GetTopCorrelations.prototype.loadInputDataWithQuery = function (queryArticles) {
138
- return __awaiter(this, void 0, void 0, function () {
139
- var e_2, _a, requestArticlesTimeAggr, response, _b, _c, object;
140
- return __generator(this, function (_d) {
141
- switch (_d.label) {
142
- case 0:
143
- this.clearVal("testData");
144
- if (!(queryArticles instanceof queryArticles_1.QueryArticles)) {
145
- throw new Error("'queryArticles' expected to be an instance of QueryArticles");
146
- }
147
- requestArticlesTimeAggr = new queryArticles_1.RequestArticlesTimeAggr();
148
- queryArticles.setRequestedResult(requestArticlesTimeAggr);
149
- return [4 /*yield*/, this.er.execQuery(queryArticles)];
150
- case 1:
151
- response = _d.sent();
152
- if (_.has(response, "timeAggr")) {
153
- try {
154
- // Potential issue if response["timeAggr"] is an object
155
- for (_b = __values(response["timeAggr"]), _c = _b.next(); !_c.done; _c = _b.next()) {
156
- object = _c.value;
157
- this.addArrayVal("testData", JSON.stringify(object));
158
- }
159
- }
160
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
161
- finally {
162
- try {
163
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
164
- }
165
- finally { if (e_2) throw e_2.error; }
166
- }
167
- }
168
- return [2 /*return*/];
169
- }
170
- });
171
- });
172
- };
173
- /**
174
- * Use GetCounts class to obtain daily counts information for concept/category of interest.
175
- * @param getCounts An instance of GetCounts class.
176
- */
177
- GetTopCorrelations.prototype.loadInputDataWithCounts = function (getCounts) {
178
- return __awaiter(this, void 0, void 0, function () {
179
- var e_3, _a, response, key, _b, _c, object;
180
- return __generator(this, function (_d) {
181
- switch (_d.label) {
182
- case 0:
183
- this.clearVal("testData");
184
- if (!(getCounts instanceof counts_1.GetCounts)) {
185
- throw new Error("'getCounts' is expected to be an instance of GetCounts");
186
- }
187
- return [4 /*yield*/, this.er.execQuery(getCounts)];
188
- case 1:
189
- response = _d.sent();
190
- if (_.size(response) > 1) {
191
- throw new Error("The returned object had multiple keys. When creating the GetCounts instance use only one uri.");
192
- }
193
- if (_.isEmpty(response)) {
194
- throw new Error("Obtained an empty object");
195
- }
196
- if (_.has(response, "error")) {
197
- throw new Error(_.get(response, "error"));
198
- }
199
- key = _.first(_.keys(response));
200
- if (!_.isArray(response[key])) {
201
- throw new Error("Expected an array");
202
- }
203
- try {
204
- for (_b = __values(response[key]), _c = _b.next(); !_c.done; _c = _b.next()) {
205
- object = _c.value;
206
- this.addArrayVal("testData", JSON.stringify(object));
207
- }
208
- }
209
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
210
- finally {
211
- try {
212
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
213
- }
214
- finally { if (e_3) throw e_3.error; }
215
- }
216
- return [2 /*return*/];
217
- }
218
- });
219
- });
220
- };
221
- /**
222
- * Do we have valid input data (needed before we can compute correlations)
223
- */
224
- GetTopCorrelations.prototype.hasValidInputData = function () {
225
- return this.hasVal("testData");
226
- };
227
- /**
228
- * Compute concepts that correlate the most with the input data. If candidateConceptsQuery is provided we first identify the
229
- * concepts that are potentially returned as top correlations. Candidates are obtained by making the query and analyzing the
230
- * concepts that appear in the resulting articles. The top concepts are used as candidates among which we return the top correlations.
231
- * If conceptType is provided then only concepts of the specified type can be provided as the result.
232
- *
233
- * @param args Object which contains a host of optional parameters
234
- */
235
- GetTopCorrelations.prototype.getTopConceptCorrelations = function (args) {
236
- if (args === void 0) { args = {}; }
237
- return __awaiter(this, void 0, void 0, function () {
238
- var e_4, _a, _b, candidateConceptsQuery, _c, candidatesPerType, _d, conceptType, _e, exactCount, _f, approxCount, _g, returnInfo, getTopCorrelations, response, res, corrs, conceptIds, conceptInfos_1, _h, _j, i, ids, q, info, e_4_1;
239
- return __generator(this, function (_k) {
240
- switch (_k.label) {
241
- case 0:
242
- _b = args.candidateConceptsQuery, candidateConceptsQuery = _b === void 0 ? undefined : _b, _c = args.candidatesPerType, candidatesPerType = _c === void 0 ? 1000 : _c, _d = args.conceptType, conceptType = _d === void 0 ? undefined : _d, _e = args.exactCount, exactCount = _e === void 0 ? 10 : _e, _f = args.approxCount, approxCount = _f === void 0 ? 0 : _f, _g = args.returnInfo, returnInfo = _g === void 0 ? new returnInfo_1.ReturnInfo() : _g;
243
- this.clearVal("contextConceptIds");
244
- getTopCorrelations = _.cloneDeep(this);
245
- if (!!_.isUndefined(candidateConceptsQuery)) return [3 /*break*/, 2];
246
- if (!(candidateConceptsQuery instanceof (queryArticles_1.QueryArticles))) {
247
- throw new Error("'candidateConceptsQuery' is expected to be of type QueryArticles");
248
- }
249
- candidateConceptsQuery.setRequestedResult(new queryArticles_1.RequestArticlesConceptAggr());
250
- candidateConceptsQuery.setVal("conceptAggrConceptCountPerType", candidatesPerType);
251
- candidateConceptsQuery.setVal("conceptAggrConceptIdOnly", true);
252
- return [4 /*yield*/, this.er.execQuery(candidateConceptsQuery)];
253
- case 1:
254
- response = _k.sent();
255
- if (_.has(response, "conceptAggr")) {
256
- getTopCorrelations.setVal("contextConceptIds", _.join(response["conceptAggr"], ","));
257
- }
258
- else {
259
- console.warn("Warning: Failed to compute a candidate set of concepts");
260
- }
261
- _k.label = 2;
262
- case 2:
263
- if (conceptType) {
264
- getTopCorrelations.setVal("conceptType", conceptType);
265
- }
266
- getTopCorrelations.setVal("exactCount", exactCount);
267
- getTopCorrelations.setVal("approxCount", approxCount);
268
- getTopCorrelations.setVal("sourceType", "news-concept");
269
- return [4 /*yield*/, this.er.jsonRequest(this.path, getTopCorrelations.params)];
270
- case 3:
271
- res = _k.sent();
272
- if (!!_.isUndefined(returnInfo)) return [3 /*break*/, 12];
273
- corrs = __spread(_.get(res, "news-concept.exactCorrelations", []), _.get(res, "news-concept.approximateCorrelations", []));
274
- conceptIds = _.map(corrs, "id");
275
- conceptInfos_1 = {};
276
- _k.label = 4;
277
- case 4:
278
- _k.trys.push([4, 9, 10, 11]);
279
- _h = __values(_.range(0, _.size(conceptIds), 500)), _j = _h.next();
280
- _k.label = 5;
281
- case 5:
282
- if (!!_j.done) return [3 /*break*/, 8];
283
- i = _j.value;
284
- ids = _.slice(conceptIds, i, i + 500);
285
- q = new info_1.GetConceptInfo({ returnInfo: returnInfo });
286
- // @ts-ignore
287
- q.queryById(ids);
288
- return [4 /*yield*/, this.er.execQuery(q)];
289
- case 6:
290
- info = _k.sent();
291
- conceptInfos_1 = _.extend({}, conceptInfos_1, info);
292
- _k.label = 7;
293
- case 7:
294
- _j = _h.next();
295
- return [3 /*break*/, 5];
296
- case 8: return [3 /*break*/, 11];
297
- case 9:
298
- e_4_1 = _k.sent();
299
- e_4 = { error: e_4_1 };
300
- return [3 /*break*/, 11];
301
- case 10:
302
- try {
303
- if (_j && !_j.done && (_a = _h.return)) _a.call(_h);
304
- }
305
- finally { if (e_4) throw e_4.error; }
306
- return [7 /*endfinally*/];
307
- case 11:
308
- if (_.has(res, "news-concept.exactCorrelations")) {
309
- _.update(res, "news-concept.exactCorrelations", function (items) {
310
- return _.map(items, function (item) {
311
- item["conceptInfo"] = _.get(conceptInfos_1, item["id"], {});
312
- return item;
313
- });
314
- });
315
- }
316
- if (_.has(res, "news-concept.approximateCorrelations")) {
317
- _.update(res, "news-concept.approximateCorrelations", function (items) {
318
- return _.map(items, function (item) {
319
- item["conceptInfo"] = _.get(conceptInfos_1, item["id"], {});
320
- return item;
321
- });
322
- });
323
- }
324
- _k.label = 12;
325
- case 12: return [2 /*return*/, res];
326
- }
327
- });
328
- });
329
- };
330
- /**
331
- * Compute categories that correlate the most with the input data.
332
- * @param args Object which contains a host of optional parameters
333
- */
334
- GetTopCorrelations.prototype.getTopCategoryCorrelations = function (args) {
335
- if (args === void 0) { args = {}; }
336
- return __awaiter(this, void 0, void 0, function () {
337
- var e_5, _a, _b, exactCount, _c, approxCount, _d, returnInfo, getTopCorrelations, res, corrs, categoryIds, categoryInfos_1, _e, _f, i, ids, q, info;
338
- return __generator(this, function (_g) {
339
- switch (_g.label) {
340
- case 0:
341
- _b = args.exactCount, exactCount = _b === void 0 ? 10 : _b, _c = args.approxCount, approxCount = _c === void 0 ? 0 : _c, _d = args.returnInfo, returnInfo = _d === void 0 ? new returnInfo_1.ReturnInfo() : _d;
342
- getTopCorrelations = _.cloneDeep(this);
343
- getTopCorrelations.clearVal("contextConceptIds");
344
- getTopCorrelations.setVal("exactCount", exactCount);
345
- getTopCorrelations.setVal("approxCount", approxCount);
346
- getTopCorrelations.setVal("sourceType", "news-category");
347
- return [4 /*yield*/, this.er.jsonRequest(this.path, getTopCorrelations.params)];
348
- case 1:
349
- res = _g.sent();
350
- if (!_.isUndefined(returnInfo)) {
351
- corrs = __spread(_.get(res, "news-category.exactCorrelations", []), _.get(res, "news-category.approximateCorrelations", []));
352
- categoryIds = _.map(corrs, "id");
353
- categoryInfos_1 = {};
354
- try {
355
- for (_e = __values(_.range(0, _.size(categoryIds), 500)), _f = _e.next(); !_f.done; _f = _e.next()) {
356
- i = _f.value;
357
- ids = _.slice(categoryIds, i, i + 500);
358
- q = new info_1.GetCategoryInfo({ returnInfo: returnInfo });
359
- // @ts-ignore
360
- q.queryById(ids);
361
- info = this.er.execQuery(q);
362
- categoryInfos_1 = _.extend({}, categoryInfos_1, info);
363
- }
364
- }
365
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
366
- finally {
367
- try {
368
- if (_f && !_f.done && (_a = _e.return)) _a.call(_e);
369
- }
370
- finally { if (e_5) throw e_5.error; }
371
- }
372
- if (_.has(res, "news-category.exactCorrelations")) {
373
- _.update(res, "news-category.exactCorrelations", function (items) {
374
- return _.map(items, function (item) {
375
- item["categoryInfo"] = _.get(categoryInfos_1, item["id"], {});
376
- return item;
377
- });
378
- });
379
- }
380
- if (_.has(res, "news-category.approximateCorrelations")) {
381
- _.update(res, "news-category.approximateCorrelations", function (items) {
382
- return _.map(items, function (item) {
383
- item["categoryInfo"] = _.get(categoryInfos_1, item["id"], {});
384
- return item;
385
- });
386
- });
387
- }
388
- }
389
- return [2 /*return*/, res];
390
- }
391
- });
392
- });
393
- };
394
- return GetTopCorrelations;
395
- }(base_1.QueryParamsBase));
396
- exports.GetTopCorrelations = GetTopCorrelations;
397
- //# sourceMappingURL=correlations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"correlations.js","sourceRoot":"","sources":["../src/correlations.ts"],"names":[],"mappings":";;;;;;;;;;;;;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