eventregistry 9.1.1 → 10.0.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.
- package/CHANGELOG.md +207 -0
- package/LICENSE +21 -21
- package/MIGRATION.md +177 -0
- package/README.md +292 -234
- package/dist/{analytics.d.ts → cjs/analytics.d.ts} +2 -1
- package/dist/cjs/analytics.js +174 -0
- package/dist/cjs/analytics.js.map +1 -0
- package/dist/{base.d.ts → cjs/base.d.ts} +9 -9
- package/dist/cjs/base.js +189 -0
- package/dist/cjs/base.js.map +1 -0
- package/dist/cjs/counts.js +120 -0
- package/dist/cjs/counts.js.map +1 -0
- package/dist/cjs/dailyShares.js +46 -0
- package/dist/cjs/dailyShares.js.map +1 -0
- package/dist/{data.d.ts → cjs/data.d.ts} +32 -5
- package/dist/cjs/data.js.map +1 -0
- package/dist/{eventForText.d.ts → cjs/eventForText.d.ts} +1 -1
- package/dist/cjs/eventForText.js +61 -0
- package/dist/cjs/eventForText.js.map +1 -0
- package/dist/{eventRegistry.d.ts → cjs/eventRegistry.d.ts} +127 -28
- package/dist/cjs/eventRegistry.js +887 -0
- package/dist/cjs/eventRegistry.js.map +1 -0
- package/dist/cjs/fluent/analytics.d.ts +24 -0
- package/dist/cjs/fluent/analytics.js +47 -0
- package/dist/cjs/fluent/analytics.js.map +1 -0
- package/dist/cjs/fluent/articles.d.ts +23 -0
- package/dist/cjs/fluent/articles.js +34 -0
- package/dist/cjs/fluent/articles.js.map +1 -0
- package/dist/cjs/fluent/counts.d.ts +8 -0
- package/dist/cjs/fluent/counts.js +17 -0
- package/dist/cjs/fluent/counts.js.map +1 -0
- package/dist/cjs/fluent/eventForText.d.ts +4 -0
- package/dist/cjs/fluent/eventForText.js +8 -0
- package/dist/cjs/fluent/eventForText.js.map +1 -0
- package/dist/cjs/fluent/events.d.ts +23 -0
- package/dist/cjs/fluent/events.js +34 -0
- package/dist/cjs/fluent/events.js.map +1 -0
- package/dist/cjs/fluent/info.d.ts +10 -0
- package/dist/cjs/fluent/info.js +23 -0
- package/dist/cjs/fluent/info.js.map +1 -0
- package/dist/cjs/fluent/mentions.d.ts +18 -0
- package/dist/cjs/fluent/mentions.js +31 -0
- package/dist/cjs/fluent/mentions.js.map +1 -0
- package/dist/cjs/fluent/recent.d.ts +8 -0
- package/dist/cjs/fluent/recent.js +17 -0
- package/dist/cjs/fluent/recent.js.map +1 -0
- package/dist/cjs/fluent/shares.d.ts +8 -0
- package/dist/cjs/fluent/shares.js +17 -0
- package/dist/cjs/fluent/shares.js.map +1 -0
- package/dist/cjs/fluent/stories.d.ts +8 -0
- package/dist/cjs/fluent/stories.js +14 -0
- package/dist/cjs/fluent/stories.js.map +1 -0
- package/dist/cjs/fluent/topicPages.d.ts +10 -0
- package/dist/cjs/fluent/topicPages.js +20 -0
- package/dist/cjs/fluent/topicPages.js.map +1 -0
- package/dist/cjs/fluent/trends.d.ts +11 -0
- package/dist/cjs/fluent/trends.js +23 -0
- package/dist/cjs/fluent/trends.js.map +1 -0
- package/dist/cjs/helpers/analytics.d.ts +68 -0
- package/dist/cjs/helpers/analytics.js +100 -0
- package/dist/cjs/helpers/analytics.js.map +1 -0
- package/dist/cjs/helpers/articles.d.ts +24 -0
- package/dist/cjs/helpers/articles.js +31 -0
- package/dist/cjs/helpers/articles.js.map +1 -0
- package/dist/cjs/helpers/counts.d.ts +4 -0
- package/dist/cjs/helpers/counts.js +12 -0
- package/dist/cjs/helpers/counts.js.map +1 -0
- package/dist/cjs/helpers/eventForText.d.ts +6 -0
- package/dist/cjs/helpers/eventForText.js +13 -0
- package/dist/cjs/helpers/eventForText.js.map +1 -0
- package/dist/cjs/helpers/events.d.ts +18 -0
- package/dist/cjs/helpers/events.js +31 -0
- package/dist/cjs/helpers/events.js.map +1 -0
- package/dist/cjs/helpers/info.d.ts +6 -0
- package/dist/cjs/helpers/info.js +20 -0
- package/dist/cjs/helpers/info.js.map +1 -0
- package/dist/cjs/helpers/mentions.d.ts +10 -0
- package/dist/cjs/helpers/mentions.js +21 -0
- package/dist/cjs/helpers/mentions.js.map +1 -0
- package/dist/cjs/helpers/recent.d.ts +10 -0
- package/dist/cjs/helpers/recent.js +18 -0
- package/dist/cjs/helpers/recent.js.map +1 -0
- package/dist/cjs/helpers/shares.d.ts +4 -0
- package/dist/cjs/helpers/shares.js +12 -0
- package/dist/cjs/helpers/shares.js.map +1 -0
- package/dist/cjs/helpers/stories.d.ts +7 -0
- package/dist/cjs/helpers/stories.js +13 -0
- package/dist/cjs/helpers/stories.js.map +1 -0
- package/dist/cjs/helpers/topicPages.d.ts +16 -0
- package/dist/cjs/helpers/topicPages.js +29 -0
- package/dist/cjs/helpers/topicPages.js.map +1 -0
- package/dist/cjs/helpers/trends.d.ts +7 -0
- package/dist/cjs/helpers/trends.js +20 -0
- package/dist/cjs/helpers/trends.js.map +1 -0
- package/dist/cjs/helpers/uri.d.ts +42 -0
- package/dist/cjs/helpers/uri.js +78 -0
- package/dist/cjs/helpers/uri.js.map +1 -0
- package/dist/cjs/http.d.ts +18 -0
- package/dist/cjs/http.js +88 -0
- package/dist/cjs/http.js.map +1 -0
- package/dist/cjs/index.d.ts +47 -0
- package/dist/{index.js → cjs/index.js} +90 -2
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/info.js +115 -0
- package/dist/cjs/info.js.map +1 -0
- package/dist/{logger.d.ts → cjs/logger.d.ts} +13 -11
- package/dist/cjs/logger.js +179 -0
- package/dist/cjs/logger.js.map +1 -0
- package/dist/cjs/mutex.d.ts +6 -0
- package/dist/cjs/mutex.js +27 -0
- package/dist/cjs/mutex.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/{query.d.ts → cjs/query.d.ts} +5 -8
- package/dist/cjs/query.js +248 -0
- package/dist/cjs/query.js.map +1 -0
- package/dist/{queryArticle.d.ts → cjs/queryArticle.d.ts} +5 -5
- package/dist/cjs/queryArticle.js +120 -0
- package/dist/cjs/queryArticle.js.map +1 -0
- package/dist/{queryArticles.d.ts → cjs/queryArticles.d.ts} +40 -73
- package/dist/cjs/queryArticles.js +456 -0
- package/dist/cjs/queryArticles.js.map +1 -0
- package/dist/{queryEvent.d.ts → cjs/queryEvent.d.ts} +6 -6
- package/dist/cjs/queryEvent.js +417 -0
- package/dist/cjs/queryEvent.js.map +1 -0
- package/dist/{queryEvents.d.ts → cjs/queryEvents.d.ts} +30 -39
- package/dist/cjs/queryEvents.js +567 -0
- package/dist/cjs/queryEvents.js.map +1 -0
- package/dist/cjs/queryIterator.d.ts +34 -0
- package/dist/cjs/queryIterator.js +77 -0
- package/dist/cjs/queryIterator.js.map +1 -0
- package/dist/{queryMentions.d.ts → cjs/queryMentions.d.ts} +18 -18
- package/dist/cjs/queryMentions.js +440 -0
- package/dist/cjs/queryMentions.js.map +1 -0
- package/dist/{queryStory.d.ts → cjs/queryStory.d.ts} +23 -23
- package/dist/cjs/queryStory.js +120 -0
- package/dist/cjs/queryStory.js.map +1 -0
- package/dist/{recent.d.ts → cjs/recent.d.ts} +8 -8
- package/dist/cjs/recent.js +63 -0
- package/dist/cjs/recent.js.map +1 -0
- package/dist/{returnInfo.d.ts → cjs/returnInfo.d.ts} +21 -23
- package/dist/cjs/returnInfo.js +292 -0
- package/dist/cjs/returnInfo.js.map +1 -0
- package/dist/{topicPage.d.ts → cjs/topicPage.d.ts} +3 -3
- package/dist/cjs/topicPage.js +454 -0
- package/dist/cjs/topicPage.js.map +1 -0
- package/dist/cjs/topicPages.d.ts +13 -0
- package/dist/cjs/topicPages.js +22 -0
- package/dist/cjs/topicPages.js.map +1 -0
- package/dist/{trends.d.ts → cjs/trends.d.ts} +13 -13
- package/dist/cjs/trends.js +64 -0
- package/dist/cjs/trends.js.map +1 -0
- package/dist/{types.d.ts → cjs/types.d.ts} +135 -33
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/version.js.map +1 -0
- package/dist/esm/analytics.d.ts +83 -0
- package/dist/esm/analytics.js +170 -0
- package/dist/esm/analytics.js.map +1 -0
- package/dist/esm/base.d.ts +82 -0
- package/dist/esm/base.js +182 -0
- package/dist/esm/base.js.map +1 -0
- package/dist/esm/counts.d.ts +81 -0
- package/dist/esm/counts.js +114 -0
- package/dist/esm/counts.js.map +1 -0
- package/dist/esm/dailyShares.d.ts +10 -0
- package/dist/esm/dailyShares.js +41 -0
- package/dist/esm/dailyShares.js.map +1 -0
- package/dist/esm/data.d.ts +296 -0
- package/dist/esm/data.js +3 -0
- package/dist/esm/data.js.map +1 -0
- package/dist/esm/eventForText.d.ts +48 -0
- package/dist/esm/eventForText.js +57 -0
- package/dist/esm/eventForText.js.map +1 -0
- package/dist/esm/eventRegistry.d.ts +343 -0
- package/dist/esm/eventRegistry.js +849 -0
- package/dist/esm/eventRegistry.js.map +1 -0
- package/dist/esm/fluent/analytics.d.ts +24 -0
- package/dist/esm/fluent/analytics.js +43 -0
- package/dist/esm/fluent/analytics.js.map +1 -0
- package/dist/esm/fluent/articles.d.ts +23 -0
- package/dist/esm/fluent/articles.js +30 -0
- package/dist/esm/fluent/articles.js.map +1 -0
- package/dist/esm/fluent/counts.d.ts +8 -0
- package/dist/esm/fluent/counts.js +13 -0
- package/dist/esm/fluent/counts.js.map +1 -0
- package/dist/esm/fluent/eventForText.d.ts +4 -0
- package/dist/esm/fluent/eventForText.js +5 -0
- package/dist/esm/fluent/eventForText.js.map +1 -0
- package/dist/esm/fluent/events.d.ts +23 -0
- package/dist/esm/fluent/events.js +30 -0
- package/dist/esm/fluent/events.js.map +1 -0
- package/dist/esm/fluent/info.d.ts +10 -0
- package/dist/esm/fluent/info.js +19 -0
- package/dist/esm/fluent/info.js.map +1 -0
- package/dist/esm/fluent/mentions.d.ts +18 -0
- package/dist/esm/fluent/mentions.js +27 -0
- package/dist/esm/fluent/mentions.js.map +1 -0
- package/dist/esm/fluent/recent.d.ts +8 -0
- package/dist/esm/fluent/recent.js +13 -0
- package/dist/esm/fluent/recent.js.map +1 -0
- package/dist/esm/fluent/shares.d.ts +8 -0
- package/dist/esm/fluent/shares.js +13 -0
- package/dist/esm/fluent/shares.js.map +1 -0
- package/dist/esm/fluent/stories.d.ts +8 -0
- package/dist/esm/fluent/stories.js +10 -0
- package/dist/esm/fluent/stories.js.map +1 -0
- package/dist/esm/fluent/topicPages.d.ts +10 -0
- package/dist/esm/fluent/topicPages.js +16 -0
- package/dist/esm/fluent/topicPages.js.map +1 -0
- package/dist/esm/fluent/trends.d.ts +11 -0
- package/dist/esm/fluent/trends.js +19 -0
- package/dist/esm/fluent/trends.js.map +1 -0
- package/dist/esm/helpers/analytics.d.ts +68 -0
- package/dist/esm/helpers/analytics.js +86 -0
- package/dist/esm/helpers/analytics.js.map +1 -0
- package/dist/esm/helpers/articles.d.ts +24 -0
- package/dist/esm/helpers/articles.js +26 -0
- package/dist/esm/helpers/articles.js.map +1 -0
- package/dist/esm/helpers/counts.d.ts +4 -0
- package/dist/esm/helpers/counts.js +8 -0
- package/dist/esm/helpers/counts.js.map +1 -0
- package/dist/esm/helpers/eventForText.d.ts +6 -0
- package/dist/esm/helpers/eventForText.js +10 -0
- package/dist/esm/helpers/eventForText.js.map +1 -0
- package/dist/esm/helpers/events.d.ts +18 -0
- package/dist/esm/helpers/events.js +26 -0
- package/dist/esm/helpers/events.js.map +1 -0
- package/dist/esm/helpers/info.d.ts +6 -0
- package/dist/esm/helpers/info.js +14 -0
- package/dist/esm/helpers/info.js.map +1 -0
- package/dist/esm/helpers/mentions.d.ts +10 -0
- package/dist/esm/helpers/mentions.js +17 -0
- package/dist/esm/helpers/mentions.js.map +1 -0
- package/dist/esm/helpers/recent.d.ts +10 -0
- package/dist/esm/helpers/recent.js +14 -0
- package/dist/esm/helpers/recent.js.map +1 -0
- package/dist/esm/helpers/shares.d.ts +4 -0
- package/dist/esm/helpers/shares.js +8 -0
- package/dist/esm/helpers/shares.js.map +1 -0
- package/dist/esm/helpers/stories.d.ts +7 -0
- package/dist/esm/helpers/stories.js +10 -0
- package/dist/esm/helpers/stories.js.map +1 -0
- package/dist/esm/helpers/topicPages.d.ts +16 -0
- package/dist/esm/helpers/topicPages.js +24 -0
- package/dist/esm/helpers/topicPages.js.map +1 -0
- package/dist/esm/helpers/trends.d.ts +7 -0
- package/dist/esm/helpers/trends.js +14 -0
- package/dist/esm/helpers/trends.js.map +1 -0
- package/dist/esm/helpers/uri.d.ts +42 -0
- package/dist/esm/helpers/uri.js +68 -0
- package/dist/esm/helpers/uri.js.map +1 -0
- package/dist/esm/http.d.ts +18 -0
- package/dist/esm/http.js +85 -0
- package/dist/esm/http.js.map +1 -0
- package/dist/esm/index.d.ts +47 -0
- package/dist/esm/index.js +47 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/info.d.ts +61 -0
- package/dist/esm/info.js +108 -0
- package/dist/esm/info.js.map +1 -0
- package/dist/esm/logger.d.ts +47 -0
- package/dist/esm/logger.js +142 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/mutex.d.ts +6 -0
- package/dist/esm/mutex.js +23 -0
- package/dist/esm/mutex.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/query.d.ts +50 -0
- package/dist/esm/query.js +240 -0
- package/dist/esm/query.js.map +1 -0
- package/dist/esm/queryArticle.d.ts +61 -0
- package/dist/esm/queryArticle.js +111 -0
- package/dist/esm/queryArticle.js.map +1 -0
- package/dist/esm/queryArticles.d.ts +111 -0
- package/dist/esm/queryArticles.js +438 -0
- package/dist/esm/queryArticles.js.map +1 -0
- package/dist/esm/queryEvent.d.ts +140 -0
- package/dist/esm/queryEvent.js +403 -0
- package/dist/esm/queryEvent.js.map +1 -0
- package/dist/esm/queryEvents.d.ts +201 -0
- package/dist/esm/queryEvents.js +545 -0
- package/dist/esm/queryEvents.js.map +1 -0
- package/dist/esm/queryIterator.d.ts +34 -0
- package/dist/esm/queryIterator.js +73 -0
- package/dist/esm/queryIterator.js.map +1 -0
- package/dist/esm/queryMentions.d.ts +96 -0
- package/dist/esm/queryMentions.js +425 -0
- package/dist/esm/queryMentions.js.map +1 -0
- package/dist/esm/queryStory.d.ts +58 -0
- package/dist/esm/queryStory.js +110 -0
- package/dist/esm/queryStory.js.map +1 -0
- package/dist/esm/recent.d.ts +23 -0
- package/dist/esm/recent.js +58 -0
- package/dist/esm/recent.js.map +1 -0
- package/dist/esm/returnInfo.d.ts +66 -0
- package/dist/esm/returnInfo.js +245 -0
- package/dist/esm/returnInfo.js.map +1 -0
- package/dist/esm/topicPage.d.ts +157 -0
- package/dist/esm/topicPage.js +417 -0
- package/dist/esm/topicPage.js.map +1 -0
- package/dist/esm/topicPages.d.ts +13 -0
- package/dist/esm/topicPages.js +18 -0
- package/dist/esm/topicPages.js.map +1 -0
- package/dist/esm/trends.d.ts +35 -0
- package/dist/esm/trends.js +56 -0
- package/dist/esm/trends.js.map +1 -0
- package/dist/esm/types.d.ts +2555 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/package.json +71 -42
- package/src/analytics.ts +197 -0
- package/src/base.ts +200 -0
- package/src/counts.ts +118 -0
- package/src/dailyShares.ts +46 -0
- package/src/data.ts +310 -0
- package/src/eventForText.ts +60 -0
- package/src/eventRegistry.ts +1005 -0
- package/src/fluent/analytics.ts +84 -0
- package/src/fluent/articles.ts +40 -0
- package/src/fluent/counts.ts +15 -0
- package/src/fluent/eventForText.ts +10 -0
- package/src/fluent/events.ts +40 -0
- package/src/fluent/info.ts +23 -0
- package/src/fluent/mentions.ts +34 -0
- package/src/fluent/recent.ts +15 -0
- package/src/fluent/shares.ts +15 -0
- package/src/fluent/stories.ts +12 -0
- package/src/fluent/topicPages.ts +20 -0
- package/src/fluent/trends.ts +34 -0
- package/src/helpers/analytics.ts +134 -0
- package/src/helpers/articles.ts +42 -0
- package/src/helpers/counts.ts +19 -0
- package/src/helpers/eventForText.ts +16 -0
- package/src/helpers/events.ts +43 -0
- package/src/helpers/info.ts +31 -0
- package/src/helpers/mentions.ts +27 -0
- package/src/helpers/recent.ts +22 -0
- package/src/helpers/shares.ts +17 -0
- package/src/helpers/stories.ts +16 -0
- package/src/helpers/topicPages.ts +28 -0
- package/src/helpers/trends.ts +36 -0
- package/src/helpers/uri.ts +78 -0
- package/src/http.ts +110 -0
- package/src/index.ts +205 -0
- package/src/info.ts +120 -0
- package/src/logger.ts +177 -0
- package/src/mutex.ts +22 -0
- package/src/query.ts +258 -0
- package/src/queryArticle.ts +138 -0
- package/src/queryArticles.ts +576 -0
- package/src/queryEvent.ts +503 -0
- package/src/queryEvents.ts +672 -0
- package/src/queryIterator.ts +89 -0
- package/src/queryMentions.ts +552 -0
- package/src/queryStory.ts +152 -0
- package/src/recent.ts +73 -0
- package/src/returnInfo.ts +372 -0
- package/src/topicPage.ts +481 -0
- package/src/topicPages.ts +18 -0
- package/src/trends.ts +62 -0
- package/src/types.ts +2678 -0
- package/src/version.ts +1 -0
- package/dist/analytics.js +0 -337
- package/dist/analytics.js.map +0 -1
- package/dist/base.js +0 -262
- package/dist/base.js.map +0 -1
- package/dist/counts.js +0 -163
- package/dist/counts.js.map +0 -1
- package/dist/dailyShares.js +0 -91
- package/dist/dailyShares.js.map +0 -1
- package/dist/data.js.map +0 -1
- package/dist/eventForText.js +0 -127
- package/dist/eventForText.js.map +0 -1
- package/dist/eventRegistry.js +0 -1099
- package/dist/eventRegistry.js.map +0 -1
- package/dist/index.d.ts +0 -21
- package/dist/index.js.map +0 -1
- package/dist/info.js +0 -172
- package/dist/info.js.map +0 -1
- package/dist/logger.js +0 -156
- package/dist/logger.js.map +0 -1
- package/dist/query.js +0 -334
- package/dist/query.js.map +0 -1
- package/dist/queryArticle.js +0 -184
- package/dist/queryArticle.js.map +0 -1
- package/dist/queryArticles.js +0 -730
- package/dist/queryArticles.js.map +0 -1
- package/dist/queryEvent.js +0 -588
- package/dist/queryEvent.js.map +0 -1
- package/dist/queryEvents.js +0 -826
- package/dist/queryEvents.js.map +0 -1
- package/dist/queryMentions.js +0 -638
- package/dist/queryMentions.js.map +0 -1
- package/dist/queryStory.js +0 -195
- package/dist/queryStory.js.map +0 -1
- package/dist/recent.js +0 -200
- package/dist/recent.js.map +0 -1
- package/dist/returnInfo.js +0 -333
- package/dist/returnInfo.js.map +0 -1
- package/dist/topicPage.js +0 -600
- package/dist/topicPage.js.map +0 -1
- package/dist/trends.js +0 -116
- package/dist/trends.js.map +0 -1
- package/dist/types.js.map +0 -1
- /package/dist/{counts.d.ts → cjs/counts.d.ts} +0 -0
- /package/dist/{dailyShares.d.ts → cjs/dailyShares.d.ts} +0 -0
- /package/dist/{data.js → cjs/data.js} +0 -0
- /package/dist/{info.d.ts → cjs/info.d.ts} +0 -0
- /package/dist/{types.js → cjs/types.js} +0 -0
package/dist/queryEvents.js
DELETED
|
@@ -1,826 +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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
-
function step(op) {
|
|
42
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
44
|
-
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;
|
|
45
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
-
switch (op[0]) {
|
|
47
|
-
case 0: case 1: t = op; break;
|
|
48
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
-
default:
|
|
52
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
-
if (t[2]) _.ops.pop();
|
|
57
|
-
_.trys.pop(); continue;
|
|
58
|
-
}
|
|
59
|
-
op = body.call(thisArg, _);
|
|
60
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
65
|
-
var t = {};
|
|
66
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
67
|
-
t[p] = s[p];
|
|
68
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
69
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
70
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
71
|
-
t[p[i]] = s[p[i]];
|
|
72
|
-
}
|
|
73
|
-
return t;
|
|
74
|
-
};
|
|
75
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
76
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
77
|
-
if (!m) return o;
|
|
78
|
-
var i = m.call(o), r, ar = [], e;
|
|
79
|
-
try {
|
|
80
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
81
|
-
}
|
|
82
|
-
catch (error) { e = { error: error }; }
|
|
83
|
-
finally {
|
|
84
|
-
try {
|
|
85
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
86
|
-
}
|
|
87
|
-
finally { if (e) throw e.error; }
|
|
88
|
-
}
|
|
89
|
-
return ar;
|
|
90
|
-
};
|
|
91
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
92
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
93
|
-
if (ar || !(i in from)) {
|
|
94
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
95
|
-
ar[i] = from[i];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
99
|
-
};
|
|
100
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101
|
-
exports.RequestEventsRecentActivity = exports.RequestEventsCategoryAggr = exports.RequestEventsEventClusters = exports.RequestEventsDateMentionAggr = exports.RequestEventsSourceAggr = exports.RequestEventsConceptTrends = exports.RequestEventsConceptMatrix = exports.RequestEventsConceptGraph = exports.RequestEventsConceptAggr = exports.RequestEventsLocTimeAggr = exports.RequestEventsLocAggr = exports.RequestEventsKeywordAggr = exports.RequestEventsTimeAggr = exports.RequestEventsUriWgtList = exports.RequestEventsInfo = exports.RequestEvents = exports.QueryEventsIter = exports.QueryEvents = void 0;
|
|
102
|
-
var base_1 = require("./base");
|
|
103
|
-
var query_1 = require("./query");
|
|
104
|
-
var returnInfo_1 = require("./returnInfo");
|
|
105
|
-
var logger_1 = require("./logger");
|
|
106
|
-
/**
|
|
107
|
-
* @class QueryEvents
|
|
108
|
-
* Class for obtaining available info for one or more events in the Event Registry
|
|
109
|
-
*/
|
|
110
|
-
var QueryEvents = /** @class */ (function (_super) {
|
|
111
|
-
__extends(QueryEvents, _super);
|
|
112
|
-
function QueryEvents(args) {
|
|
113
|
-
if (args === void 0) { args = {}; }
|
|
114
|
-
var _this = _super.call(this) || this;
|
|
115
|
-
_this.params = {};
|
|
116
|
-
var keywords = args.keywords, conceptUri = args.conceptUri, categoryUri = args.categoryUri, sourceUri = args.sourceUri, sourceLocationUri = args.sourceLocationUri, sourceGroupUri = args.sourceGroupUri, authorUri = args.authorUri, locationUri = args.locationUri, lang = args.lang, dateStart = args.dateStart, dateEnd = args.dateEnd, reportingDateStart = args.reportingDateStart, reportingDateEnd = args.reportingDateEnd, _a = args.minSentiment, minSentiment = _a === void 0 ? -1 : _a, _b = args.maxSentiment, maxSentiment = _b === void 0 ? 1 : _b, minArticlesInEvent = args.minArticlesInEvent, maxArticlesInEvent = args.maxArticlesInEvent, dateMentionStart = args.dateMentionStart, dateMentionEnd = args.dateMentionEnd, ignoreKeywords = args.ignoreKeywords, ignoreConceptUri = args.ignoreConceptUri, ignoreCategoryUri = args.ignoreCategoryUri, ignoreSourceUri = args.ignoreSourceUri, ignoreSourceLocationUri = args.ignoreSourceLocationUri, ignoreSourceGroupUri = args.ignoreSourceGroupUri, ignoreAuthorUri = args.ignoreAuthorUri, ignoreLocationUri = args.ignoreLocationUri, ignoreLang = args.ignoreLang, _c = args.keywordsLoc, keywordsLoc = _c === void 0 ? "body" : _c, _d = args.ignoreKeywordsLoc, ignoreKeywordsLoc = _d === void 0 ? "body" : _d, _e = args.keywordSearchMode, keywordSearchMode = _e === void 0 ? "phrase" : _e, _f = args.ignoreKeywordSearchMode, ignoreKeywordSearchMode = _f === void 0 ? "phrase" : _f, _g = args.categoryIncludeSub, categoryIncludeSub = _g === void 0 ? true : _g, _h = args.ignoreCategoryIncludeSub, ignoreCategoryIncludeSub = _h === void 0 ? true : _h, _j = args.requestedResult, requestedResult = _j === void 0 ? new RequestEventsInfo() : _j;
|
|
117
|
-
_this.setVal("action", "getEvents");
|
|
118
|
-
_this.setQueryArrVal(keywords, "keyword", "keywordOper", "and");
|
|
119
|
-
_this.setQueryArrVal(conceptUri, "conceptUri", "conceptOper", "and");
|
|
120
|
-
_this.setQueryArrVal(categoryUri, "categoryUri", "categoryOper", "or");
|
|
121
|
-
_this.setQueryArrVal(sourceUri, "sourceUri", undefined, "or");
|
|
122
|
-
_this.setQueryArrVal(sourceLocationUri, "sourceLocationUri", undefined, "or");
|
|
123
|
-
_this.setQueryArrVal(sourceGroupUri, "sourceGroupUri", undefined, "or");
|
|
124
|
-
_this.setQueryArrVal(authorUri, "authorUri", "authorOper", "or");
|
|
125
|
-
_this.setQueryArrVal(locationUri, "locationUri", undefined, "or");
|
|
126
|
-
_this.setQueryArrVal(lang, "lang", undefined, "or");
|
|
127
|
-
if (dateStart !== undefined) {
|
|
128
|
-
_this.setDateVal("dateStart", dateStart);
|
|
129
|
-
}
|
|
130
|
-
if (dateEnd !== undefined) {
|
|
131
|
-
_this.setDateVal("dateEnd", dateEnd);
|
|
132
|
-
}
|
|
133
|
-
if (reportingDateStart !== undefined) {
|
|
134
|
-
_this.setDateVal("reportingDateStart", reportingDateStart);
|
|
135
|
-
}
|
|
136
|
-
if (reportingDateEnd !== undefined) {
|
|
137
|
-
_this.setDateVal("reportingDateEnd", reportingDateEnd);
|
|
138
|
-
}
|
|
139
|
-
if (minSentiment > -1 && minSentiment <= 1) {
|
|
140
|
-
_this.setVal("minSentiment", minSentiment);
|
|
141
|
-
}
|
|
142
|
-
if (maxSentiment >= -1 && maxSentiment < 1) {
|
|
143
|
-
_this.setVal("maxSentiment", maxSentiment);
|
|
144
|
-
}
|
|
145
|
-
_this.setValIfNotDefault("minArticlesInEvent", minArticlesInEvent, undefined);
|
|
146
|
-
_this.setValIfNotDefault("maxArticlesInEvent", maxArticlesInEvent, undefined);
|
|
147
|
-
if (dateMentionStart !== undefined) {
|
|
148
|
-
_this.setDateVal("dateMentionStart", dateMentionStart);
|
|
149
|
-
}
|
|
150
|
-
if (dateMentionEnd !== undefined) {
|
|
151
|
-
_this.setDateVal("dateMentionEnd", dateMentionEnd);
|
|
152
|
-
}
|
|
153
|
-
// for the negative conditions, only the OR is a valid operator type
|
|
154
|
-
_this.setQueryArrVal(ignoreKeywords, "ignoreKeywords", undefined, "or");
|
|
155
|
-
_this.setQueryArrVal(ignoreConceptUri, "ignoreConceptUri", undefined, "or");
|
|
156
|
-
_this.setQueryArrVal(ignoreCategoryUri, "ignoreCategoryUri", undefined, "or");
|
|
157
|
-
_this.setQueryArrVal(ignoreSourceUri, "ignoreSourceUri", undefined, "or");
|
|
158
|
-
_this.setQueryArrVal(ignoreSourceLocationUri, "ignoreSourceLocationUri", undefined, "or");
|
|
159
|
-
_this.setQueryArrVal(ignoreSourceGroupUri, "ignoreSourceGroupUri", undefined, "or");
|
|
160
|
-
_this.setQueryArrVal(ignoreAuthorUri, "ignoreAuthorUri", undefined, "or");
|
|
161
|
-
_this.setQueryArrVal(ignoreLocationUri, "ignoreLocationUri", undefined, "or");
|
|
162
|
-
_this.setQueryArrVal(ignoreLang, "ignoreLang", undefined, "or");
|
|
163
|
-
_this.setValIfNotDefault("keywordLoc", keywordsLoc, "body");
|
|
164
|
-
_this.setValIfNotDefault("ignoreKeywordLoc", ignoreKeywordsLoc, "body");
|
|
165
|
-
_this.setValIfNotDefault("keywordSearchMode", keywordSearchMode, "phrase");
|
|
166
|
-
_this.setValIfNotDefault("ignoreKeywordSearchMode", ignoreKeywordSearchMode, "phrase");
|
|
167
|
-
_this.setValIfNotDefault("categoryIncludeSub", categoryIncludeSub, true);
|
|
168
|
-
_this.setValIfNotDefault("ignoreCategoryIncludeSub", ignoreCategoryIncludeSub, true);
|
|
169
|
-
_this.setRequestedResult(requestedResult);
|
|
170
|
-
return _this;
|
|
171
|
-
}
|
|
172
|
-
Object.defineProperty(QueryEvents.prototype, "path", {
|
|
173
|
-
get: function () {
|
|
174
|
-
return "/api/v1/event";
|
|
175
|
-
},
|
|
176
|
-
enumerable: false,
|
|
177
|
-
configurable: true
|
|
178
|
-
});
|
|
179
|
-
/**
|
|
180
|
-
* Set the single result type that you would like to be returned. Any previously set result types will be overwritten.
|
|
181
|
-
* Result types can be the classes that extend RequestEvent base class (see classes below).
|
|
182
|
-
*/
|
|
183
|
-
QueryEvents.prototype.setRequestedResult = function (requestEvents) {
|
|
184
|
-
if (!(requestEvents instanceof RequestEvents)) {
|
|
185
|
-
throw new Error("QueryEvents class can only accept result requests that are of type RequestEvents");
|
|
186
|
-
}
|
|
187
|
-
this.resultTypeList = [
|
|
188
|
-
requestEvents,
|
|
189
|
-
];
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* Set a custom list of event uris. The results will be then computed on this list - no query will be done (all conditions will be ignored).
|
|
193
|
-
*/
|
|
194
|
-
QueryEvents.initWithEventUriList = function (uriList) {
|
|
195
|
-
var query = new QueryEvents();
|
|
196
|
-
if (!Array.isArray(uriList)) {
|
|
197
|
-
throw new Error("uriList has to be a list of strings that represent event uris");
|
|
198
|
-
}
|
|
199
|
-
query.params = {
|
|
200
|
-
action: "getEvents",
|
|
201
|
-
eventUriList: uriList.join(","),
|
|
202
|
-
};
|
|
203
|
-
return query;
|
|
204
|
-
};
|
|
205
|
-
QueryEvents.initWithEventUriWgtList = function (uriWgtList) {
|
|
206
|
-
var query = new QueryEvents();
|
|
207
|
-
if (!Array.isArray(uriWgtList)) {
|
|
208
|
-
throw new Error("uriWgtList has to be a list of strings that represent event uris");
|
|
209
|
-
}
|
|
210
|
-
query.params = {
|
|
211
|
-
action: "getEvents",
|
|
212
|
-
eventUriWgtList: uriWgtList.join(","),
|
|
213
|
-
};
|
|
214
|
-
return query;
|
|
215
|
-
};
|
|
216
|
-
QueryEvents.initWithComplexQuery = function (complexQuery) {
|
|
217
|
-
var query = new QueryEvents();
|
|
218
|
-
if (complexQuery instanceof query_1.ComplexEventQuery) {
|
|
219
|
-
query.setVal("query", JSON.stringify(complexQuery.getQuery()));
|
|
220
|
-
}
|
|
221
|
-
else if (typeof complexQuery === 'string') {
|
|
222
|
-
try {
|
|
223
|
-
JSON.parse(complexQuery);
|
|
224
|
-
}
|
|
225
|
-
catch (_a) {
|
|
226
|
-
logger_1.Logger.error("Failed to parse the provided string content as a JSON object. Please check the content provided as a parameter to the initWithComplexQuery() method");
|
|
227
|
-
}
|
|
228
|
-
query.setVal("query", complexQuery);
|
|
229
|
-
}
|
|
230
|
-
else if (typeof complexQuery === 'object' && complexQuery !== null) {
|
|
231
|
-
query.setVal("query", JSON.stringify(complexQuery));
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
throw new Error("The instance of query parameter was not a ComplexEventQuery, a string or an object");
|
|
235
|
-
}
|
|
236
|
-
return query;
|
|
237
|
-
};
|
|
238
|
-
return QueryEvents;
|
|
239
|
-
}(base_1.Query));
|
|
240
|
-
exports.QueryEvents = QueryEvents;
|
|
241
|
-
/**
|
|
242
|
-
* @class QueryEventsIter
|
|
243
|
-
* Class for iterating through all the events via callbacks
|
|
244
|
-
*/
|
|
245
|
-
var QueryEventsIter = /** @class */ (function (_super) {
|
|
246
|
-
__extends(QueryEventsIter, _super);
|
|
247
|
-
function QueryEventsIter(er, args) {
|
|
248
|
-
if (args === void 0) { args = {}; }
|
|
249
|
-
var _this = _super.call(this, args) || this;
|
|
250
|
-
_this.page = 0;
|
|
251
|
-
_this.pages = 1;
|
|
252
|
-
_this.items = [];
|
|
253
|
-
_this.returnedSoFar = 0;
|
|
254
|
-
_this.index = 0;
|
|
255
|
-
_this.callback = function () { return undefined; };
|
|
256
|
-
_this.doneCallback = function () { return undefined; };
|
|
257
|
-
var _a = args.sortBy, sortBy = _a === void 0 ? "rel" : _a, _b = args.sortByAsc, sortByAsc = _b === void 0 ? false : _b, _c = args.returnInfo, returnInfo = _c === void 0 ? undefined : _c, _d = args.maxItems, maxItems = _d === void 0 ? -1 : _d;
|
|
258
|
-
_this.er = er;
|
|
259
|
-
_this.sortBy = sortBy;
|
|
260
|
-
_this.sortByAsc = sortByAsc;
|
|
261
|
-
_this.returnInfo = returnInfo;
|
|
262
|
-
_this.maxItems = maxItems;
|
|
263
|
-
return _this;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Async Iterator function that returns the next item in the list of events
|
|
267
|
-
*/
|
|
268
|
-
QueryEventsIter.prototype[Symbol.asyncIterator] = function () {
|
|
269
|
-
var _this = this;
|
|
270
|
-
return {
|
|
271
|
-
next: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
272
|
-
var item;
|
|
273
|
-
return __generator(this, function (_a) {
|
|
274
|
-
switch (_a.label) {
|
|
275
|
-
case 0:
|
|
276
|
-
if (!(this.index >= this.items.length)) return [3 /*break*/, 2];
|
|
277
|
-
return [4 /*yield*/, this.getNextBatch()];
|
|
278
|
-
case 1:
|
|
279
|
-
_a.sent();
|
|
280
|
-
_a.label = 2;
|
|
281
|
-
case 2:
|
|
282
|
-
item = this.items[this.index];
|
|
283
|
-
this.index++;
|
|
284
|
-
return [2 /*return*/, { value: item, done: !item }];
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
}); },
|
|
288
|
-
};
|
|
289
|
-
};
|
|
290
|
-
QueryEventsIter.prototype.count = function () {
|
|
291
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
292
|
-
var response;
|
|
293
|
-
var _a;
|
|
294
|
-
return __generator(this, function (_b) {
|
|
295
|
-
switch (_b.label) {
|
|
296
|
-
case 0:
|
|
297
|
-
this.setRequestedResult(new RequestEventsInfo());
|
|
298
|
-
return [4 /*yield*/, this.er.execQuery(this)];
|
|
299
|
-
case 1:
|
|
300
|
-
response = _b.sent();
|
|
301
|
-
if (response === null || response === void 0 ? void 0 : response.error) {
|
|
302
|
-
this.er.logger.error(response.error);
|
|
303
|
-
}
|
|
304
|
-
return [2 /*return*/, ((_a = response === null || response === void 0 ? void 0 : response.events) === null || _a === void 0 ? void 0 : _a.totalResults) || 0];
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
};
|
|
309
|
-
/**
|
|
310
|
-
* Execute query and fetch batches of events of the specified size (eventBatchSize)
|
|
311
|
-
* @param callback callback function that'll be called every time we get a new batch of events from the backend
|
|
312
|
-
* @param doneCallback callback function that'll be called when everything is complete
|
|
313
|
-
*/
|
|
314
|
-
QueryEventsIter.prototype.execQuery = function (callback, doneCallback) {
|
|
315
|
-
if (callback) {
|
|
316
|
-
this.callback = callback;
|
|
317
|
-
}
|
|
318
|
-
if (doneCallback) {
|
|
319
|
-
this.doneCallback = doneCallback;
|
|
320
|
-
}
|
|
321
|
-
this.iterate();
|
|
322
|
-
};
|
|
323
|
-
QueryEventsIter.initWithComplexQuery = function (er, complexQuery, args) {
|
|
324
|
-
if (args === void 0) { args = {}; }
|
|
325
|
-
var query = new QueryEventsIter(er, args);
|
|
326
|
-
if (complexQuery instanceof query_1.ComplexEventQuery) {
|
|
327
|
-
query.setVal("query", JSON.stringify(complexQuery.getQuery()));
|
|
328
|
-
}
|
|
329
|
-
else if (typeof complexQuery === "string") {
|
|
330
|
-
query.setVal("query", complexQuery);
|
|
331
|
-
}
|
|
332
|
-
else if (typeof complexQuery === "object" && complexQuery !== null) {
|
|
333
|
-
query.setVal("query", JSON.stringify(complexQuery));
|
|
334
|
-
}
|
|
335
|
-
else {
|
|
336
|
-
throw new Error("The instance of query parameter was not a ComplexEventQuery, a string or an object");
|
|
337
|
-
}
|
|
338
|
-
return query;
|
|
339
|
-
};
|
|
340
|
-
QueryEventsIter.prototype.iterate = function () {
|
|
341
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
342
|
-
return __generator(this, function (_a) {
|
|
343
|
-
switch (_a.label) {
|
|
344
|
-
case 0:
|
|
345
|
-
if (!this.current) return [3 /*break*/, 1];
|
|
346
|
-
this.callback(this.current);
|
|
347
|
-
this.index += 1;
|
|
348
|
-
return [3 /*break*/, 3];
|
|
349
|
-
case 1: return [4 /*yield*/, this.getNextBatch()];
|
|
350
|
-
case 2:
|
|
351
|
-
if (!(_a.sent())) {
|
|
352
|
-
this.doneCallback(this.errorMessage);
|
|
353
|
-
return [2 /*return*/];
|
|
354
|
-
}
|
|
355
|
-
_a.label = 3;
|
|
356
|
-
case 3: return [2 /*return*/, this.iterate()];
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
});
|
|
360
|
-
};
|
|
361
|
-
/**
|
|
362
|
-
* Extract the results according to maxItems
|
|
363
|
-
* @param response response from the backend
|
|
364
|
-
*/
|
|
365
|
-
QueryEventsIter.prototype.extractResults = function (response) {
|
|
366
|
-
var _a;
|
|
367
|
-
var results = ((_a = response === null || response === void 0 ? void 0 : response.events) === null || _a === void 0 ? void 0 : _a.results) || [];
|
|
368
|
-
var extractedSize = this.maxItems !== -1 ? this.maxItems - this.returnedSoFar : results.length;
|
|
369
|
-
return results.slice(0, extractedSize).filter(Boolean);
|
|
370
|
-
};
|
|
371
|
-
Object.defineProperty(QueryEventsIter.prototype, "current", {
|
|
372
|
-
get: function () {
|
|
373
|
-
return this.items[this.index] || undefined;
|
|
374
|
-
},
|
|
375
|
-
enumerable: false,
|
|
376
|
-
configurable: true
|
|
377
|
-
});
|
|
378
|
-
QueryEventsIter.prototype.getNextBatch = function () {
|
|
379
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
380
|
-
var requestEventsInfo, response, error, results, error_1;
|
|
381
|
-
var _a;
|
|
382
|
-
return __generator(this, function (_b) {
|
|
383
|
-
switch (_b.label) {
|
|
384
|
-
case 0:
|
|
385
|
-
_b.trys.push([0, 2, , 3]);
|
|
386
|
-
this.page += 1;
|
|
387
|
-
if (this.page > this.pages || (this.maxItems !== -1 && this.returnedSoFar >= this.maxItems)) {
|
|
388
|
-
return [2 /*return*/, false];
|
|
389
|
-
}
|
|
390
|
-
requestEventsInfo = new RequestEventsInfo({
|
|
391
|
-
page: this.page,
|
|
392
|
-
count: 50,
|
|
393
|
-
sortBy: this.sortBy,
|
|
394
|
-
sortByAsc: this.sortByAsc,
|
|
395
|
-
returnInfo: this.returnInfo,
|
|
396
|
-
});
|
|
397
|
-
this.setRequestedResult(requestEventsInfo);
|
|
398
|
-
if (this.er.verboseOutput) {
|
|
399
|
-
this.er.logger.info("Downloading event page ".concat(this.page, "..."));
|
|
400
|
-
}
|
|
401
|
-
return [4 /*yield*/, this.er.execQuery(this, this.er.allowUseOfArchive)];
|
|
402
|
-
case 1:
|
|
403
|
-
response = _b.sent();
|
|
404
|
-
error = response.error || "";
|
|
405
|
-
if (error) {
|
|
406
|
-
this.errorMessage = "Error while obtaining a list of events: ".concat(response.error);
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
this.pages = ((_a = response.events) === null || _a === void 0 ? void 0 : _a.pages) || 0;
|
|
410
|
-
}
|
|
411
|
-
results = this.extractResults(response);
|
|
412
|
-
this.returnedSoFar += results.length;
|
|
413
|
-
this.items = __spreadArray(__spreadArray([], __read(this.items), false), __read(results), false);
|
|
414
|
-
return [2 /*return*/, true];
|
|
415
|
-
case 2:
|
|
416
|
-
error_1 = _b.sent();
|
|
417
|
-
this.er.logger.error(error_1);
|
|
418
|
-
return [2 /*return*/, false];
|
|
419
|
-
case 3: return [2 /*return*/];
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
};
|
|
424
|
-
return QueryEventsIter;
|
|
425
|
-
}(QueryEvents));
|
|
426
|
-
exports.QueryEventsIter = QueryEventsIter;
|
|
427
|
-
var RequestEvents = /** @class */ (function () {
|
|
428
|
-
function RequestEvents() {
|
|
429
|
-
}
|
|
430
|
-
return RequestEvents;
|
|
431
|
-
}());
|
|
432
|
-
exports.RequestEvents = RequestEvents;
|
|
433
|
-
/**
|
|
434
|
-
* @class RequestEventsInfo
|
|
435
|
-
* Return event details for resulting events.
|
|
436
|
-
*/
|
|
437
|
-
var RequestEventsInfo = /** @class */ (function (_super) {
|
|
438
|
-
__extends(RequestEventsInfo, _super);
|
|
439
|
-
function RequestEventsInfo(args) {
|
|
440
|
-
if (args === void 0) { args = {}; }
|
|
441
|
-
var _this = _super.call(this) || this;
|
|
442
|
-
_this.resultType = "events";
|
|
443
|
-
var _a = args.page, page = _a === void 0 ? 1 : _a, _b = args.count, count = _b === void 0 ? 50 : _b, _c = args.sortBy, sortBy = _c === void 0 ? "rel" : _c, _d = args.sortByAsc, sortByAsc = _d === void 0 ? false : _d, _e = args.returnInfo, returnInfo = _e === void 0 ? undefined : _e;
|
|
444
|
-
if (page < 1) {
|
|
445
|
-
throw new RangeError("Page has to be >= 1");
|
|
446
|
-
}
|
|
447
|
-
if (count > 50) {
|
|
448
|
-
throw new RangeError("At most 50 events can be returned per call");
|
|
449
|
-
}
|
|
450
|
-
_this.params = {};
|
|
451
|
-
_this.params["eventsPage"] = page;
|
|
452
|
-
_this.params["eventsCount"] = count;
|
|
453
|
-
_this.params["eventsSortBy"] = sortBy;
|
|
454
|
-
_this.params["eventsSortByAsc"] = sortByAsc;
|
|
455
|
-
if (!!returnInfo) {
|
|
456
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("events"));
|
|
457
|
-
}
|
|
458
|
-
return _this;
|
|
459
|
-
}
|
|
460
|
-
return RequestEventsInfo;
|
|
461
|
-
}(RequestEvents));
|
|
462
|
-
exports.RequestEventsInfo = RequestEventsInfo;
|
|
463
|
-
/**
|
|
464
|
-
* @class RequestEventsUriList
|
|
465
|
-
* Return a simple list of event uris together with the scores for resulting events.
|
|
466
|
-
*/
|
|
467
|
-
var RequestEventsUriWgtList = /** @class */ (function (_super) {
|
|
468
|
-
__extends(RequestEventsUriWgtList, _super);
|
|
469
|
-
function RequestEventsUriWgtList(args) {
|
|
470
|
-
if (args === void 0) { args = {}; }
|
|
471
|
-
var _this = _super.call(this) || this;
|
|
472
|
-
_this.resultType = "uriWgtList";
|
|
473
|
-
var _a = args.page, page = _a === void 0 ? 1 : _a, _b = args.count, count = _b === void 0 ? 50000 : _b, _c = args.sortBy, sortBy = _c === void 0 ? "rel" : _c, _d = args.sortByAsc, sortByAsc = _d === void 0 ? false : _d, unsupported = __rest(args, ["page", "count", "sortBy", "sortByAsc"]);
|
|
474
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
475
|
-
logger_1.Logger.warn("RequestEventsUriWgtList: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
476
|
-
}
|
|
477
|
-
if (page < 1) {
|
|
478
|
-
throw new RangeError("Page has to be >= 1");
|
|
479
|
-
}
|
|
480
|
-
if (count > 100000) {
|
|
481
|
-
throw new RangeError("At most 100000 results can be returned per call");
|
|
482
|
-
}
|
|
483
|
-
_this.params = {};
|
|
484
|
-
_this.params["uriWgtListPage"] = page;
|
|
485
|
-
_this.params["uriWgtListCount"] = count;
|
|
486
|
-
_this.params["uriWgtListSortBy"] = sortBy;
|
|
487
|
-
_this.params["uriWgtListSortByAsc"] = sortByAsc;
|
|
488
|
-
return _this;
|
|
489
|
-
}
|
|
490
|
-
Object.defineProperty(RequestEventsUriWgtList.prototype, "page", {
|
|
491
|
-
set: function (page) {
|
|
492
|
-
if (page < 1) {
|
|
493
|
-
throw new RangeError("Page has to be >= 1");
|
|
494
|
-
}
|
|
495
|
-
this.params["uriWgtListPage"] = page;
|
|
496
|
-
},
|
|
497
|
-
enumerable: false,
|
|
498
|
-
configurable: true
|
|
499
|
-
});
|
|
500
|
-
return RequestEventsUriWgtList;
|
|
501
|
-
}(RequestEvents));
|
|
502
|
-
exports.RequestEventsUriWgtList = RequestEventsUriWgtList;
|
|
503
|
-
/**
|
|
504
|
-
* @class RequestEventsTimeAggr
|
|
505
|
-
* Return time distribution of resulting events.
|
|
506
|
-
*/
|
|
507
|
-
var RequestEventsTimeAggr = /** @class */ (function (_super) {
|
|
508
|
-
__extends(RequestEventsTimeAggr, _super);
|
|
509
|
-
function RequestEventsTimeAggr() {
|
|
510
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
511
|
-
_this.resultType = "timeAggr";
|
|
512
|
-
return _this;
|
|
513
|
-
}
|
|
514
|
-
return RequestEventsTimeAggr;
|
|
515
|
-
}(RequestEvents));
|
|
516
|
-
exports.RequestEventsTimeAggr = RequestEventsTimeAggr;
|
|
517
|
-
/**
|
|
518
|
-
* Return keyword aggregate (tag cloud) on words in articles in resulting events.
|
|
519
|
-
* @class RequestEventsTimeAggr
|
|
520
|
-
*/
|
|
521
|
-
var RequestEventsKeywordAggr = /** @class */ (function (_super) {
|
|
522
|
-
__extends(RequestEventsKeywordAggr, _super);
|
|
523
|
-
/**
|
|
524
|
-
* @param lang: in which language to produce the list of top keywords. If undefined, then compute on all articles
|
|
525
|
-
*/
|
|
526
|
-
function RequestEventsKeywordAggr(lang) {
|
|
527
|
-
var _this = _super.call(this) || this;
|
|
528
|
-
_this.resultType = "keywordAggr";
|
|
529
|
-
_this.params = {};
|
|
530
|
-
if (lang !== undefined) {
|
|
531
|
-
_this.params["keywordAggrLang"] = lang;
|
|
532
|
-
}
|
|
533
|
-
return _this;
|
|
534
|
-
}
|
|
535
|
-
return RequestEventsKeywordAggr;
|
|
536
|
-
}(RequestEvents));
|
|
537
|
-
exports.RequestEventsKeywordAggr = RequestEventsKeywordAggr;
|
|
538
|
-
/**
|
|
539
|
-
* @class RequestEventsLocAggr
|
|
540
|
-
* Return aggregate of locations of resulting events.
|
|
541
|
-
*/
|
|
542
|
-
var RequestEventsLocAggr = /** @class */ (function (_super) {
|
|
543
|
-
__extends(RequestEventsLocAggr, _super);
|
|
544
|
-
function RequestEventsLocAggr(args) {
|
|
545
|
-
if (args === void 0) { args = {}; }
|
|
546
|
-
var _this = _super.call(this) || this;
|
|
547
|
-
_this.resultType = "locAggr";
|
|
548
|
-
var _a = args.eventsSampleSize, eventsSampleSize = _a === void 0 ? 100000 : _a, _b = args.returnInfo, returnInfo = _b === void 0 ? new returnInfo_1.ReturnInfo() : _b, unsupported = __rest(args, ["eventsSampleSize", "returnInfo"]);
|
|
549
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
550
|
-
logger_1.Logger.warn("RequestEventsLocAggr: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
551
|
-
}
|
|
552
|
-
if (eventsSampleSize > 100000) {
|
|
553
|
-
throw new RangeError("At most 100000 results can be used for computing");
|
|
554
|
-
}
|
|
555
|
-
_this.params = {};
|
|
556
|
-
_this.params["locAggrSampleSize"] = eventsSampleSize;
|
|
557
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("locAggr"));
|
|
558
|
-
return _this;
|
|
559
|
-
}
|
|
560
|
-
return RequestEventsLocAggr;
|
|
561
|
-
}(RequestEvents));
|
|
562
|
-
exports.RequestEventsLocAggr = RequestEventsLocAggr;
|
|
563
|
-
/**
|
|
564
|
-
* @class RequestEventsLocTimeAggr
|
|
565
|
-
* Return aggregate of locations and times of resulting events.
|
|
566
|
-
*/
|
|
567
|
-
var RequestEventsLocTimeAggr = /** @class */ (function (_super) {
|
|
568
|
-
__extends(RequestEventsLocTimeAggr, _super);
|
|
569
|
-
function RequestEventsLocTimeAggr(args) {
|
|
570
|
-
if (args === void 0) { args = {}; }
|
|
571
|
-
var _this = _super.call(this) || this;
|
|
572
|
-
_this.resultType = "locTimeAggr";
|
|
573
|
-
var _a = args.eventsSampleSize, eventsSampleSize = _a === void 0 ? 100000 : _a, _b = args.returnInfo, returnInfo = _b === void 0 ? new returnInfo_1.ReturnInfo() : _b, unsupported = __rest(args, ["eventsSampleSize", "returnInfo"]);
|
|
574
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
575
|
-
logger_1.Logger.warn("RequestEventsLocTimeAggr: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
576
|
-
}
|
|
577
|
-
if (eventsSampleSize > 100000) {
|
|
578
|
-
throw new RangeError("At most 100000 results can be used for computing");
|
|
579
|
-
}
|
|
580
|
-
_this.params = {};
|
|
581
|
-
_this.params["locTimeAggrSampleSize"] = eventsSampleSize;
|
|
582
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("locTimeAggr"));
|
|
583
|
-
return _this;
|
|
584
|
-
}
|
|
585
|
-
return RequestEventsLocTimeAggr;
|
|
586
|
-
}(RequestEvents));
|
|
587
|
-
exports.RequestEventsLocTimeAggr = RequestEventsLocTimeAggr;
|
|
588
|
-
/**
|
|
589
|
-
* @class RequestEventsConceptAggr
|
|
590
|
-
* Compute which concept are the most frequently occurring in the list of resulting events.
|
|
591
|
-
*/
|
|
592
|
-
var RequestEventsConceptAggr = /** @class */ (function (_super) {
|
|
593
|
-
__extends(RequestEventsConceptAggr, _super);
|
|
594
|
-
function RequestEventsConceptAggr(args) {
|
|
595
|
-
if (args === void 0) { args = {}; }
|
|
596
|
-
var _this = _super.call(this) || this;
|
|
597
|
-
_this.resultType = "conceptAggr";
|
|
598
|
-
var _a = args.conceptCount, conceptCount = _a === void 0 ? 20 : _a, _b = args.eventsSampleSize, eventsSampleSize = _b === void 0 ? 100000 : _b, _c = args.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c;
|
|
599
|
-
if (conceptCount > 200) {
|
|
600
|
-
throw new RangeError("At most 200 top concepts can be returned");
|
|
601
|
-
}
|
|
602
|
-
if (eventsSampleSize > 300000) {
|
|
603
|
-
throw new RangeError("At most 300000 results can be used for computing");
|
|
604
|
-
}
|
|
605
|
-
_this.params = {};
|
|
606
|
-
_this.params["conceptAggrConceptCount"] = conceptCount;
|
|
607
|
-
_this.params["conceptAggrSampleSize"] = eventsSampleSize;
|
|
608
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptAggr"));
|
|
609
|
-
return _this;
|
|
610
|
-
}
|
|
611
|
-
return RequestEventsConceptAggr;
|
|
612
|
-
}(RequestEvents));
|
|
613
|
-
exports.RequestEventsConceptAggr = RequestEventsConceptAggr;
|
|
614
|
-
/**
|
|
615
|
-
* @class RequestEventsConceptGraph
|
|
616
|
-
* Compute which concept pairs frequently co-occur together in the resulting events.
|
|
617
|
-
*/
|
|
618
|
-
var RequestEventsConceptGraph = /** @class */ (function (_super) {
|
|
619
|
-
__extends(RequestEventsConceptGraph, _super);
|
|
620
|
-
function RequestEventsConceptGraph(args) {
|
|
621
|
-
if (args === void 0) { args = {}; }
|
|
622
|
-
var _this = _super.call(this) || this;
|
|
623
|
-
_this.resultType = "conceptGraph";
|
|
624
|
-
var _a = args.conceptCount, conceptCount = _a === void 0 ? 25 : _a, _b = args.linkCount, linkCount = _b === void 0 ? 150 : _b, _c = args.eventsSampleSize, eventsSampleSize = _c === void 0 ? 50000 : _c, _d = args.returnInfo, returnInfo = _d === void 0 ? new returnInfo_1.ReturnInfo() : _d;
|
|
625
|
-
if (conceptCount > 1000) {
|
|
626
|
-
throw new RangeError("At most 1000 top concepts can be returned");
|
|
627
|
-
}
|
|
628
|
-
if (linkCount > 2000) {
|
|
629
|
-
throw new RangeError("At most 2000 links between concepts can be returned");
|
|
630
|
-
}
|
|
631
|
-
if (eventsSampleSize > 300000) {
|
|
632
|
-
throw new RangeError("At most 300000 results can be used for computing");
|
|
633
|
-
}
|
|
634
|
-
_this.params = {};
|
|
635
|
-
_this.params["conceptGraphConceptCount"] = conceptCount;
|
|
636
|
-
_this.params["conceptGraphLinkCount"] = linkCount;
|
|
637
|
-
_this.params["conceptGraphSampleSize"] = eventsSampleSize;
|
|
638
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptGraph"));
|
|
639
|
-
return _this;
|
|
640
|
-
}
|
|
641
|
-
return RequestEventsConceptGraph;
|
|
642
|
-
}(RequestEvents));
|
|
643
|
-
exports.RequestEventsConceptGraph = RequestEventsConceptGraph;
|
|
644
|
-
/**
|
|
645
|
-
* @class RequestEventsConceptMatrix
|
|
646
|
-
* Get a matrix of concepts and their dependencies.
|
|
647
|
-
* For individual concept pairs return how frequently
|
|
648
|
-
* they co-occur in the resulting events and how "surprising" this is,
|
|
649
|
-
* based on the frequency of individual concepts.
|
|
650
|
-
*/
|
|
651
|
-
var RequestEventsConceptMatrix = /** @class */ (function (_super) {
|
|
652
|
-
__extends(RequestEventsConceptMatrix, _super);
|
|
653
|
-
function RequestEventsConceptMatrix(args) {
|
|
654
|
-
if (args === void 0) { args = {}; }
|
|
655
|
-
var _this = _super.call(this) || this;
|
|
656
|
-
_this.resultType = "conceptMatrix";
|
|
657
|
-
var _a = args.conceptCount, conceptCount = _a === void 0 ? 25 : _a, _b = args.measure, measure = _b === void 0 ? "pmi" : _b, _c = args.eventsSampleSize, eventsSampleSize = _c === void 0 ? 100000 : _c, _d = args.returnInfo, returnInfo = _d === void 0 ? new returnInfo_1.ReturnInfo() : _d;
|
|
658
|
-
if (conceptCount > 200) {
|
|
659
|
-
throw new RangeError("At most 200 top concepts can be returned");
|
|
660
|
-
}
|
|
661
|
-
if (eventsSampleSize > 300000) {
|
|
662
|
-
throw new RangeError("At most 300000 results can be used for computing");
|
|
663
|
-
}
|
|
664
|
-
_this.params = {};
|
|
665
|
-
_this.params["conceptMatrixConceptCount"] = conceptCount;
|
|
666
|
-
_this.params["conceptMatrixMeasure"] = measure;
|
|
667
|
-
_this.params["conceptMatrixSampleSize"] = eventsSampleSize;
|
|
668
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptMatrix"));
|
|
669
|
-
return _this;
|
|
670
|
-
}
|
|
671
|
-
return RequestEventsConceptMatrix;
|
|
672
|
-
}(RequestEvents));
|
|
673
|
-
exports.RequestEventsConceptMatrix = RequestEventsConceptMatrix;
|
|
674
|
-
/**
|
|
675
|
-
* @class RequestEventsConceptTrends
|
|
676
|
-
* Return a list of top trending concepts and their daily trending info over time
|
|
677
|
-
*/
|
|
678
|
-
var RequestEventsConceptTrends = /** @class */ (function (_super) {
|
|
679
|
-
__extends(RequestEventsConceptTrends, _super);
|
|
680
|
-
function RequestEventsConceptTrends(args) {
|
|
681
|
-
if (args === void 0) { args = {}; }
|
|
682
|
-
var _this = _super.call(this) || this;
|
|
683
|
-
_this.resultType = "conceptTrends";
|
|
684
|
-
var _a = args.conceptCount, conceptCount = _a === void 0 ? 10 : _a, _b = args.conceptUris, conceptUris = _b === void 0 ? [] : _b, _c = args.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c;
|
|
685
|
-
if (conceptCount > 50) {
|
|
686
|
-
throw new RangeError("At most 50 top concepts can be returned");
|
|
687
|
-
}
|
|
688
|
-
_this.params = {};
|
|
689
|
-
_this.params["conceptTrendsConceptCount"] = conceptCount;
|
|
690
|
-
if (conceptUris.length > 0) {
|
|
691
|
-
_this.params["conceptTrendsConceptUri"] = conceptUris;
|
|
692
|
-
}
|
|
693
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptTrends"));
|
|
694
|
-
return _this;
|
|
695
|
-
}
|
|
696
|
-
return RequestEventsConceptTrends;
|
|
697
|
-
}(RequestEvents));
|
|
698
|
-
exports.RequestEventsConceptTrends = RequestEventsConceptTrends;
|
|
699
|
-
/**
|
|
700
|
-
* @class RequestEventsSourceAggr
|
|
701
|
-
* Return top news sources that report about the events that match the search conditions
|
|
702
|
-
*/
|
|
703
|
-
var RequestEventsSourceAggr = /** @class */ (function (_super) {
|
|
704
|
-
__extends(RequestEventsSourceAggr, _super);
|
|
705
|
-
function RequestEventsSourceAggr(args) {
|
|
706
|
-
if (args === void 0) { args = {}; }
|
|
707
|
-
var _this = _super.call(this) || this;
|
|
708
|
-
_this.resultType = "sourceAggr";
|
|
709
|
-
var _a = args.sourceCount, sourceCount = _a === void 0 ? 30 : _a, _b = args.eventsSampleSize, eventsSampleSize = _b === void 0 ? 50000 : _b, _c = args.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c;
|
|
710
|
-
if (sourceCount > 200) {
|
|
711
|
-
throw new RangeError("At most 200 top sources can be returned");
|
|
712
|
-
}
|
|
713
|
-
if (eventsSampleSize > 100000) {
|
|
714
|
-
throw new RangeError("At most 100000 results can be used for computing");
|
|
715
|
-
}
|
|
716
|
-
_this.params = {};
|
|
717
|
-
_this.params["sourceAggrSourceCount"] = sourceCount;
|
|
718
|
-
_this.params["sourceAggrSampleSize"] = eventsSampleSize;
|
|
719
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("sourceAggr"));
|
|
720
|
-
return _this;
|
|
721
|
-
}
|
|
722
|
-
return RequestEventsSourceAggr;
|
|
723
|
-
}(RequestEvents));
|
|
724
|
-
exports.RequestEventsSourceAggr = RequestEventsSourceAggr;
|
|
725
|
-
/**
|
|
726
|
-
* @class RequestEventsDateMentionAggr
|
|
727
|
-
* Return events and the dates that are mentioned in articles about these events
|
|
728
|
-
*/
|
|
729
|
-
var RequestEventsDateMentionAggr = /** @class */ (function (_super) {
|
|
730
|
-
__extends(RequestEventsDateMentionAggr, _super);
|
|
731
|
-
function RequestEventsDateMentionAggr(args) {
|
|
732
|
-
if (args === void 0) { args = {}; }
|
|
733
|
-
var _this = _super.call(this) || this;
|
|
734
|
-
_this.resultType = "dateMentionAggr";
|
|
735
|
-
var _a = args.minDaysApart, minDaysApart = _a === void 0 ? 0 : _a, _b = args.minDateMentionCount, minDateMentionCount = _b === void 0 ? 5 : _b, _c = args.eventsSampleSize, eventsSampleSize = _c === void 0 ? 100000 : _c, _d = args.returnInfo, returnInfo = _d === void 0 ? new returnInfo_1.ReturnInfo() : _d;
|
|
736
|
-
if (eventsSampleSize > 300000) {
|
|
737
|
-
throw new RangeError("At most 300000 results can be used for computing");
|
|
738
|
-
}
|
|
739
|
-
_this.params = {};
|
|
740
|
-
_this.params["dateMentionAggrMinDaysApart"] = minDaysApart;
|
|
741
|
-
_this.params["dateMentionAggrMinDateMentionCount"] = minDateMentionCount;
|
|
742
|
-
_this.params["dateMentionAggrSampleSize"] = eventsSampleSize;
|
|
743
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("dateMentionAggr"));
|
|
744
|
-
return _this;
|
|
745
|
-
}
|
|
746
|
-
return RequestEventsDateMentionAggr;
|
|
747
|
-
}(RequestEvents));
|
|
748
|
-
exports.RequestEventsDateMentionAggr = RequestEventsDateMentionAggr;
|
|
749
|
-
/**
|
|
750
|
-
* @class RequestEventsEventClusters
|
|
751
|
-
* Return hierarchical clustering of events into smaller clusters. 2-means clustering is applied on each node in the tree
|
|
752
|
-
*/
|
|
753
|
-
var RequestEventsEventClusters = /** @class */ (function (_super) {
|
|
754
|
-
__extends(RequestEventsEventClusters, _super);
|
|
755
|
-
function RequestEventsEventClusters(args) {
|
|
756
|
-
if (args === void 0) { args = {}; }
|
|
757
|
-
var _this = _super.call(this) || this;
|
|
758
|
-
_this.resultType = "eventClusters";
|
|
759
|
-
var _a = args.keywordCount, keywordCount = _a === void 0 ? 30 : _a, _b = args.maxEventsToCluster, maxEventsToCluster = _b === void 0 ? 10000 : _b, _c = args.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c;
|
|
760
|
-
if (keywordCount > 100) {
|
|
761
|
-
throw new RangeError("At most 100 keywords can be reported in each of the clusters");
|
|
762
|
-
}
|
|
763
|
-
if (maxEventsToCluster > 10000) {
|
|
764
|
-
throw new RangeError("At most 10000 events can be clustered together");
|
|
765
|
-
}
|
|
766
|
-
_this.params = {};
|
|
767
|
-
_this.params["eventClustersKeywordCount"] = keywordCount;
|
|
768
|
-
_this.params["eventClustersMaxEventsToCluster"] = maxEventsToCluster;
|
|
769
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("eventClusters"));
|
|
770
|
-
return _this;
|
|
771
|
-
}
|
|
772
|
-
return RequestEventsEventClusters;
|
|
773
|
-
}(RequestEvents));
|
|
774
|
-
exports.RequestEventsEventClusters = RequestEventsEventClusters;
|
|
775
|
-
/**
|
|
776
|
-
* @class RequestEventsCategoryAggr
|
|
777
|
-
* Return distribution of events into dmoz categories.
|
|
778
|
-
*/
|
|
779
|
-
var RequestEventsCategoryAggr = /** @class */ (function (_super) {
|
|
780
|
-
__extends(RequestEventsCategoryAggr, _super);
|
|
781
|
-
function RequestEventsCategoryAggr(returnInfo) {
|
|
782
|
-
if (returnInfo === void 0) { returnInfo = new returnInfo_1.ReturnInfo(); }
|
|
783
|
-
var _this = _super.call(this) || this;
|
|
784
|
-
_this.resultType = "categoryAggr";
|
|
785
|
-
_this.params = returnInfo.getParams("categoryAggr");
|
|
786
|
-
return _this;
|
|
787
|
-
}
|
|
788
|
-
return RequestEventsCategoryAggr;
|
|
789
|
-
}(RequestEvents));
|
|
790
|
-
exports.RequestEventsCategoryAggr = RequestEventsCategoryAggr;
|
|
791
|
-
/**
|
|
792
|
-
* @class RequestEventsRecentActivity
|
|
793
|
-
* Return a list of recently changed events that match search conditions.
|
|
794
|
-
*/
|
|
795
|
-
var RequestEventsRecentActivity = /** @class */ (function (_super) {
|
|
796
|
-
__extends(RequestEventsRecentActivity, _super);
|
|
797
|
-
function RequestEventsRecentActivity(args) {
|
|
798
|
-
if (args === void 0) { args = {}; }
|
|
799
|
-
var _this = _super.call(this) || this;
|
|
800
|
-
_this.resultType = "recentActivityEvents";
|
|
801
|
-
var _a = args.maxEventCount, maxEventCount = _a === void 0 ? 50 : _a, updatesAfterTm = args.updatesAfterTm, updatesAfterMinsAgo = args.updatesAfterMinsAgo, _b = args.mandatoryLocation, mandatoryLocation = _b === void 0 ? true : _b, _c = args.minAvgCosSim, minAvgCosSim = _c === void 0 ? 0 : _c, _d = args.returnInfo, returnInfo = _d === void 0 ? undefined : _d;
|
|
802
|
-
if (maxEventCount > 2000) {
|
|
803
|
-
throw new RangeError("At most 2000 events can be returned");
|
|
804
|
-
}
|
|
805
|
-
if (updatesAfterTm !== undefined && updatesAfterMinsAgo !== undefined) {
|
|
806
|
-
throw new Error("You should specify either updatesAfterTm or updatesAfterMinsAgo parameter, but not both");
|
|
807
|
-
}
|
|
808
|
-
_this.params = {};
|
|
809
|
-
_this.params["recentActivityEventsMaxEventCount"] = maxEventCount;
|
|
810
|
-
_this.params["recentActivityEventsMandatoryLocation"] = mandatoryLocation;
|
|
811
|
-
if (updatesAfterTm !== undefined) {
|
|
812
|
-
_this.params["recentActivityEventsUpdatesAfterTm"] = base_1.QueryParamsBase.encodeDateTime(updatesAfterTm);
|
|
813
|
-
}
|
|
814
|
-
if (updatesAfterMinsAgo !== undefined) {
|
|
815
|
-
_this.params["recentActivityEventsUpdatesAfterMinsAgo"] = updatesAfterMinsAgo;
|
|
816
|
-
}
|
|
817
|
-
_this.params["recentActivityEventsMinAvgCosSim"] = minAvgCosSim;
|
|
818
|
-
if (!!returnInfo) {
|
|
819
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("recentActivityEvents"));
|
|
820
|
-
}
|
|
821
|
-
return _this;
|
|
822
|
-
}
|
|
823
|
-
return RequestEventsRecentActivity;
|
|
824
|
-
}(RequestEvents));
|
|
825
|
-
exports.RequestEventsRecentActivity = RequestEventsRecentActivity;
|
|
826
|
-
//# sourceMappingURL=queryEvents.js.map
|