eventregistry 9.1.1 → 11.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/AGENT-RECIPES.md +86 -0
- package/CHANGELOG.md +254 -0
- package/LICENSE +21 -21
- package/MIGRATION.md +195 -0
- package/README.md +340 -234
- package/dist/cjs/abort.d.ts +14 -0
- package/dist/cjs/abort.js +71 -0
- package/dist/cjs/abort.js.map +1 -0
- 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 +195 -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/cjs/errors.d.ts +66 -0
- package/dist/cjs/errors.js +75 -0
- package/dist/cjs/errors.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} +167 -36
- package/dist/cjs/eventRegistry.js +939 -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 +13 -0
- package/dist/cjs/fluent/recent.js +21 -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/guards.d.ts +12 -0
- package/dist/cjs/guards.js +75 -0
- package/dist/cjs/guards.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 +23 -0
- package/dist/cjs/http.js +141 -0
- package/dist/cjs/http.js.map +1 -0
- package/dist/cjs/index.d.ts +54 -0
- package/dist/{index.js → cjs/index.js} +104 -3
- 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} +15 -11
- package/dist/cjs/logger.js +183 -0
- package/dist/cjs/logger.js.map +1 -0
- package/dist/cjs/mutex.d.ts +7 -0
- package/dist/cjs/mutex.js +44 -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 +121 -0
- package/dist/cjs/queryArticle.js.map +1 -0
- package/dist/{queryArticles.d.ts → cjs/queryArticles.d.ts} +36 -69
- package/dist/cjs/queryArticles.js +457 -0
- package/dist/cjs/queryArticles.js.map +1 -0
- package/dist/{queryEvent.d.ts → cjs/queryEvent.d.ts} +7 -6
- package/dist/cjs/queryEvent.js +423 -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 +568 -0
- package/dist/cjs/queryEvents.js.map +1 -0
- package/dist/cjs/queryIterator.d.ts +36 -0
- package/dist/cjs/queryIterator.js +85 -0
- package/dist/cjs/queryIterator.js.map +1 -0
- package/dist/{queryMentions.d.ts → cjs/queryMentions.d.ts} +19 -18
- package/dist/cjs/queryMentions.js +446 -0
- package/dist/cjs/queryMentions.js.map +1 -0
- package/dist/{queryStory.d.ts → cjs/queryStory.d.ts} +24 -21
- package/dist/cjs/queryStory.js +120 -0
- package/dist/cjs/queryStory.js.map +1 -0
- package/dist/cjs/recent.d.ts +35 -0
- package/dist/cjs/recent.js +81 -0
- package/dist/cjs/recent.js.map +1 -0
- package/dist/cjs/recentFeed.d.ts +35 -0
- package/dist/cjs/recentFeed.js +76 -0
- package/dist/cjs/recentFeed.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 +458 -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} +195 -37
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/usage.d.ts +39 -0
- package/dist/cjs/usage.js +62 -0
- package/dist/cjs/usage.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/abort.d.ts +14 -0
- package/dist/esm/abort.js +65 -0
- package/dist/esm/abort.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 +188 -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/errors.d.ts +66 -0
- package/dist/esm/errors.js +67 -0
- package/dist/esm/errors.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 +375 -0
- package/dist/esm/eventRegistry.js +901 -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 +13 -0
- package/dist/esm/fluent/recent.js +17 -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/guards.d.ts +12 -0
- package/dist/esm/guards.js +70 -0
- package/dist/esm/guards.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 +23 -0
- package/dist/esm/http.js +138 -0
- package/dist/esm/http.js.map +1 -0
- package/dist/esm/index.d.ts +54 -0
- package/dist/esm/index.js +51 -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 +49 -0
- package/dist/esm/logger.js +146 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/mutex.d.ts +7 -0
- package/dist/esm/mutex.js +40 -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 +112 -0
- package/dist/esm/queryArticle.js.map +1 -0
- package/dist/esm/queryArticles.d.ts +111 -0
- package/dist/esm/queryArticles.js +439 -0
- package/dist/esm/queryArticles.js.map +1 -0
- package/dist/esm/queryEvent.d.ts +141 -0
- package/dist/esm/queryEvent.js +409 -0
- package/dist/esm/queryEvent.js.map +1 -0
- package/dist/esm/queryEvents.d.ts +201 -0
- package/dist/esm/queryEvents.js +546 -0
- package/dist/esm/queryEvents.js.map +1 -0
- package/dist/esm/queryIterator.d.ts +36 -0
- package/dist/esm/queryIterator.js +81 -0
- package/dist/esm/queryIterator.js.map +1 -0
- package/dist/esm/queryMentions.d.ts +97 -0
- package/dist/esm/queryMentions.js +431 -0
- package/dist/esm/queryMentions.js.map +1 -0
- package/dist/esm/queryStory.d.ts +61 -0
- package/dist/esm/queryStory.js +110 -0
- package/dist/esm/queryStory.js.map +1 -0
- package/dist/esm/recent.d.ts +35 -0
- package/dist/esm/recent.js +76 -0
- package/dist/esm/recent.js.map +1 -0
- package/dist/esm/recentFeed.d.ts +35 -0
- package/dist/esm/recentFeed.js +70 -0
- package/dist/esm/recentFeed.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 +421 -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 +2611 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/usage.d.ts +39 -0
- package/dist/esm/usage.js +58 -0
- package/dist/esm/usage.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 +80 -42
- package/src/abort.ts +70 -0
- package/src/analytics.ts +197 -0
- package/src/base.ts +206 -0
- package/src/counts.ts +118 -0
- package/src/dailyShares.ts +46 -0
- package/src/data.ts +310 -0
- package/src/errors.ts +105 -0
- package/src/eventForText.ts +60 -0
- package/src/eventRegistry.ts +1105 -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 +19 -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/guards.ts +79 -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 +169 -0
- package/src/index.ts +212 -0
- package/src/info.ts +120 -0
- package/src/logger.ts +182 -0
- package/src/mutex.ts +40 -0
- package/src/query.ts +258 -0
- package/src/queryArticle.ts +139 -0
- package/src/queryArticles.ts +584 -0
- package/src/queryEvent.ts +510 -0
- package/src/queryEvents.ts +673 -0
- package/src/queryIterator.ts +100 -0
- package/src/queryMentions.ts +559 -0
- package/src/queryStory.ts +159 -0
- package/src/recent.ts +98 -0
- package/src/recentFeed.ts +91 -0
- package/src/returnInfo.ts +372 -0
- package/src/topicPage.ts +485 -0
- package/src/topicPages.ts +18 -0
- package/src/trends.ts +62 -0
- package/src/types.ts +2737 -0
- package/src/usage.ts +79 -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.d.ts +0 -23
- 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/queryArticles.js
DELETED
|
@@ -1,730 +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.RequestArticlesRecentActivity = exports.RequestArticlesDateMentionAggr = exports.RequestArticlesConceptTrends = exports.RequestArticlesConceptMatrix = exports.RequestArticlesConceptGraph = exports.RequestArticlesKeywordAggr = exports.RequestArticlesSourceAggr = exports.RequestArticlesCategoryAggr = exports.RequestArticlesConceptAggr = exports.RequestArticlesTimeAggr = exports.RequestArticlesUriWgtList = exports.RequestArticlesInfo = exports.RequestArticles = exports.QueryArticlesIter = exports.QueryArticles = 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
|
-
var QueryArticles = /** @class */ (function (_super) {
|
|
107
|
-
__extends(QueryArticles, _super);
|
|
108
|
-
function QueryArticles(args) {
|
|
109
|
-
if (args === void 0) { args = {}; }
|
|
110
|
-
var _this = _super.call(this) || this;
|
|
111
|
-
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, 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, _a = args.keywordsLoc, keywordsLoc = _a === void 0 ? "body" : _a, _b = args.keywordSearchMode, keywordSearchMode = _b === void 0 ? "phrase" : _b, _c = args.ignoreKeywordsLoc, ignoreKeywordsLoc = _c === void 0 ? "body" : _c, _d = args.ignoreKeywordSearchMode, ignoreKeywordSearchMode = _d === void 0 ? "phrase" : _d, _e = args.isDuplicateFilter, isDuplicateFilter = _e === void 0 ? "keepAll" : _e, _f = args.hasDuplicateFilter, hasDuplicateFilter = _f === void 0 ? "keepAll" : _f, _g = args.eventFilter, eventFilter = _g === void 0 ? "keepAll" : _g, _h = args.authorsFilter, authorsFilter = _h === void 0 ? "keepAll" : _h, _j = args.videosFilter, videosFilter = _j === void 0 ? "keepAll" : _j, _k = args.linksFilter, linksFilter = _k === void 0 ? "keepAll" : _k, _l = args.startSourceRankPercentile, startSourceRankPercentile = _l === void 0 ? 0 : _l, _m = args.endSourceRankPercentile, endSourceRankPercentile = _m === void 0 ? 100 : _m, _o = args.minSentiment, minSentiment = _o === void 0 ? -1 : _o, _p = args.maxSentiment, maxSentiment = _p === void 0 ? 1 : _p, _q = args.dataType, dataType = _q === void 0 ? "news" : _q, _r = args.requestedResult, requestedResult = _r === void 0 ? new RequestArticlesInfo() : _r, unsupported = __rest(args, ["keywords", "conceptUri", "categoryUri", "sourceUri", "sourceLocationUri", "sourceGroupUri", "authorUri", "locationUri", "lang", "dateStart", "dateEnd", "dateMentionStart", "dateMentionEnd", "ignoreKeywords", "ignoreConceptUri", "ignoreCategoryUri", "ignoreSourceUri", "ignoreSourceLocationUri", "ignoreSourceGroupUri", "ignoreAuthorUri", "ignoreLocationUri", "ignoreLang", "keywordsLoc", "keywordSearchMode", "ignoreKeywordsLoc", "ignoreKeywordSearchMode", "isDuplicateFilter", "hasDuplicateFilter", "eventFilter", "authorsFilter", "videosFilter", "linksFilter", "startSourceRankPercentile", "endSourceRankPercentile", "minSentiment", "maxSentiment", "dataType", "requestedResult"]);
|
|
112
|
-
if (Object.keys(unsupported).length > 0) {
|
|
113
|
-
var unsupportedKeys_1 = ["sortBy", "sortByAsc", "returnInfo", "maxItems"];
|
|
114
|
-
if (!Object.keys(unsupported).some(function (key) { return unsupportedKeys_1.includes(key); })) {
|
|
115
|
-
console.warn("QueryArticles: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
_this.setVal("action", "getArticles");
|
|
119
|
-
_this.setQueryArrVal(keywords, "keyword", "keywordOper", "and");
|
|
120
|
-
_this.setQueryArrVal(conceptUri, "conceptUri", "conceptOper", "and");
|
|
121
|
-
_this.setQueryArrVal(categoryUri, "categoryUri", "categoryOper", "or");
|
|
122
|
-
_this.setQueryArrVal(sourceUri, "sourceUri", "sourceOper", "or");
|
|
123
|
-
_this.setQueryArrVal(sourceLocationUri, "sourceLocationUri", undefined, "or");
|
|
124
|
-
_this.setQueryArrVal(sourceGroupUri, "sourceGroupUri", "sourceGroupOper", "or");
|
|
125
|
-
_this.setQueryArrVal(authorUri, "authorUri", "authorOper", "or");
|
|
126
|
-
_this.setQueryArrVal(locationUri, "locationUri", undefined, "or");
|
|
127
|
-
_this.setQueryArrVal(lang, "lang", undefined, "or");
|
|
128
|
-
if (dateStart !== undefined) {
|
|
129
|
-
_this.setDateVal("dateStart", dateStart);
|
|
130
|
-
}
|
|
131
|
-
if (dateEnd !== undefined) {
|
|
132
|
-
_this.setDateVal("dateEnd", dateEnd);
|
|
133
|
-
}
|
|
134
|
-
if (dateMentionStart !== undefined) {
|
|
135
|
-
_this.setDateVal("dateMentionStart", dateMentionStart);
|
|
136
|
-
}
|
|
137
|
-
if (dateMentionEnd !== undefined) {
|
|
138
|
-
_this.setDateVal("dateMentionEnd", dateMentionEnd);
|
|
139
|
-
}
|
|
140
|
-
_this.setQueryArrVal(ignoreKeywords, "ignoreKeyword", undefined, "or");
|
|
141
|
-
_this.setQueryArrVal(ignoreConceptUri, "ignoreConceptUri", undefined, "or");
|
|
142
|
-
_this.setQueryArrVal(ignoreCategoryUri, "ignoreCategoryUri", undefined, "or");
|
|
143
|
-
_this.setQueryArrVal(ignoreSourceUri, "ignoreSourceUri", undefined, "or");
|
|
144
|
-
_this.setQueryArrVal(ignoreSourceLocationUri, "ignoreSourceLocationUri", undefined, "or");
|
|
145
|
-
_this.setQueryArrVal(ignoreSourceGroupUri, "ignoreSourceGroupUri", undefined, "or");
|
|
146
|
-
_this.setQueryArrVal(ignoreAuthorUri, "ignoreAuthorUri", undefined, "or");
|
|
147
|
-
_this.setQueryArrVal(ignoreLocationUri, "ignoreLocationUri", undefined, "or");
|
|
148
|
-
_this.setQueryArrVal(ignoreLang, "ignoreLang", undefined, "or");
|
|
149
|
-
_this.setValIfNotDefault("keywordLoc", keywordsLoc, "body");
|
|
150
|
-
_this.setValIfNotDefault("ignoreKeywordLoc", ignoreKeywordsLoc, "body");
|
|
151
|
-
_this.setValIfNotDefault("keywordSearchMode", keywordSearchMode, "phrase");
|
|
152
|
-
_this.setValIfNotDefault("ignoreKeywordSearchMode", ignoreKeywordSearchMode, "phrase");
|
|
153
|
-
_this.setValIfNotDefault("isDuplicateFilter", isDuplicateFilter, "keepAll");
|
|
154
|
-
_this.setValIfNotDefault("hasDuplicateFilter", hasDuplicateFilter, "keepAll");
|
|
155
|
-
_this.setValIfNotDefault("eventFilter", eventFilter, "keepAll");
|
|
156
|
-
if (startSourceRankPercentile < 0 || startSourceRankPercentile % 10 !== 0 || startSourceRankPercentile > 100) {
|
|
157
|
-
throw new Error("StartSourceRankPercentile: Value should be in range 0-90 and divisible by 10.");
|
|
158
|
-
}
|
|
159
|
-
if (endSourceRankPercentile < 0 || endSourceRankPercentile % 10 !== 0 || endSourceRankPercentile > 100) {
|
|
160
|
-
throw new Error("EndSourceRankPercentile: Value should be in range 0-90 and divisible by 10.");
|
|
161
|
-
}
|
|
162
|
-
if (startSourceRankPercentile > endSourceRankPercentile) {
|
|
163
|
-
throw new Error("SourceRankPercentile: startSourceRankPercentile should be less than endSourceRankPercentile");
|
|
164
|
-
}
|
|
165
|
-
if (startSourceRankPercentile !== 0) {
|
|
166
|
-
_this.setVal("startSourceRankPercentile", startSourceRankPercentile);
|
|
167
|
-
}
|
|
168
|
-
if (endSourceRankPercentile !== 100) {
|
|
169
|
-
_this.setVal("endSourceRankPercentile", endSourceRankPercentile);
|
|
170
|
-
}
|
|
171
|
-
if (minSentiment > -1 && minSentiment <= 1) {
|
|
172
|
-
_this.setVal("minSentiment", minSentiment);
|
|
173
|
-
}
|
|
174
|
-
if (maxSentiment >= -1 && maxSentiment < 1) {
|
|
175
|
-
_this.setVal("maxSentiment", maxSentiment);
|
|
176
|
-
}
|
|
177
|
-
_this.setValIfNotDefault("dataType", dataType, "news");
|
|
178
|
-
_this.setRequestedResult(requestedResult);
|
|
179
|
-
return _this;
|
|
180
|
-
}
|
|
181
|
-
Object.defineProperty(QueryArticles.prototype, "path", {
|
|
182
|
-
get: function () {
|
|
183
|
-
return "/api/v1/article";
|
|
184
|
-
},
|
|
185
|
-
enumerable: false,
|
|
186
|
-
configurable: true
|
|
187
|
-
});
|
|
188
|
-
QueryArticles.prototype.setRequestedResult = function (requestArticles) {
|
|
189
|
-
if (!(requestArticles instanceof RequestArticles)) {
|
|
190
|
-
throw new Error("QueryArticles class can only accept result requests that are of type RequestArticles");
|
|
191
|
-
}
|
|
192
|
-
this.resultTypeList = [requestArticles];
|
|
193
|
-
};
|
|
194
|
-
QueryArticles.initWithArticleUriList = function (uriList) {
|
|
195
|
-
var q = new QueryArticles();
|
|
196
|
-
if (!Array.isArray(uriList)) {
|
|
197
|
-
throw new Error("uriList has to be a list of strings that represent article uris");
|
|
198
|
-
}
|
|
199
|
-
q.params = {
|
|
200
|
-
action: "getArticles",
|
|
201
|
-
articleUri: uriList,
|
|
202
|
-
};
|
|
203
|
-
return q;
|
|
204
|
-
};
|
|
205
|
-
QueryArticles.initWithArticleUriWgtList = function (uriWgtList) {
|
|
206
|
-
var q = new QueryArticles();
|
|
207
|
-
if (!Array.isArray(uriWgtList)) {
|
|
208
|
-
throw new Error("uriList has to be a list of strings that represent article uris");
|
|
209
|
-
}
|
|
210
|
-
q.params = {
|
|
211
|
-
action: "getArticles",
|
|
212
|
-
articleUriWgtList: uriWgtList.join(","),
|
|
213
|
-
};
|
|
214
|
-
return q;
|
|
215
|
-
};
|
|
216
|
-
QueryArticles.initWithComplexQuery = function (complexQuery) {
|
|
217
|
-
var query = new QueryArticles();
|
|
218
|
-
if (complexQuery instanceof query_1.ComplexArticleQuery) {
|
|
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
|
-
console.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 ComplexArticleQuery, a string or an object");
|
|
235
|
-
}
|
|
236
|
-
return query;
|
|
237
|
-
};
|
|
238
|
-
return QueryArticles;
|
|
239
|
-
}(base_1.Query));
|
|
240
|
-
exports.QueryArticles = QueryArticles;
|
|
241
|
-
var QueryArticlesIter = /** @class */ (function (_super) {
|
|
242
|
-
__extends(QueryArticlesIter, _super);
|
|
243
|
-
function QueryArticlesIter(er, args) {
|
|
244
|
-
if (args === void 0) { args = {}; }
|
|
245
|
-
var _this = _super.call(this, args) || this;
|
|
246
|
-
_this.page = 0;
|
|
247
|
-
_this.pages = 1;
|
|
248
|
-
_this.items = [];
|
|
249
|
-
_this.returnedSoFar = 0;
|
|
250
|
-
_this.index = 0;
|
|
251
|
-
_this.callback = function () { };
|
|
252
|
-
_this.doneCallback = function () { };
|
|
253
|
-
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;
|
|
254
|
-
_this.er = er;
|
|
255
|
-
_this.sortBy = sortBy;
|
|
256
|
-
_this.sortByAsc = sortByAsc;
|
|
257
|
-
_this.returnInfo = returnInfo;
|
|
258
|
-
_this.maxItems = maxItems;
|
|
259
|
-
return _this;
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Async Iterator function that returns the next item in the list of articles
|
|
263
|
-
*/
|
|
264
|
-
QueryArticlesIter.prototype[Symbol.asyncIterator] = function () {
|
|
265
|
-
var _this = this;
|
|
266
|
-
return {
|
|
267
|
-
next: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
268
|
-
var item;
|
|
269
|
-
return __generator(this, function (_a) {
|
|
270
|
-
switch (_a.label) {
|
|
271
|
-
case 0: return [4 /*yield*/, this.getNextBatch()];
|
|
272
|
-
case 1:
|
|
273
|
-
_a.sent();
|
|
274
|
-
item = this.items[this.index];
|
|
275
|
-
this.index++;
|
|
276
|
-
return [2 /*return*/, { value: item, done: !item }];
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}); },
|
|
280
|
-
};
|
|
281
|
-
};
|
|
282
|
-
QueryArticlesIter.prototype.count = function () {
|
|
283
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
284
|
-
var response;
|
|
285
|
-
var _a;
|
|
286
|
-
return __generator(this, function (_b) {
|
|
287
|
-
switch (_b.label) {
|
|
288
|
-
case 0:
|
|
289
|
-
this.setRequestedResult(new RequestArticlesInfo());
|
|
290
|
-
return [4 /*yield*/, this.er.execQuery(this)];
|
|
291
|
-
case 1:
|
|
292
|
-
response = _b.sent();
|
|
293
|
-
if (response.hasOwnProperty("error")) {
|
|
294
|
-
this.er.logger.error(response.error);
|
|
295
|
-
}
|
|
296
|
-
return [2 /*return*/, ((_a = response.articles) === null || _a === void 0 ? void 0 : _a.totalResults) || 0];
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
};
|
|
301
|
-
QueryArticlesIter.prototype.execQuery = function (callback, doneCallback) {
|
|
302
|
-
if (callback) {
|
|
303
|
-
this.callback = callback;
|
|
304
|
-
}
|
|
305
|
-
if (doneCallback) {
|
|
306
|
-
this.doneCallback = doneCallback;
|
|
307
|
-
}
|
|
308
|
-
this.iterate();
|
|
309
|
-
};
|
|
310
|
-
QueryArticlesIter.initWithComplexQuery = function (er, complexQuery, params) {
|
|
311
|
-
if (params === void 0) { params = {}; }
|
|
312
|
-
var query = new QueryArticlesIter(er, params);
|
|
313
|
-
if (complexQuery instanceof query_1.ComplexArticleQuery) {
|
|
314
|
-
query.setVal("query", JSON.stringify(complexQuery.getQuery()));
|
|
315
|
-
}
|
|
316
|
-
else if (typeof complexQuery === 'string') {
|
|
317
|
-
query.setVal("query", complexQuery);
|
|
318
|
-
}
|
|
319
|
-
else if (typeof complexQuery === 'object' && complexQuery !== null) {
|
|
320
|
-
query.setVal("query", JSON.stringify(complexQuery));
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
throw new Error("The instance of query parameter was not a ComplexArticleQuery, a string or an object");
|
|
324
|
-
}
|
|
325
|
-
return query;
|
|
326
|
-
};
|
|
327
|
-
QueryArticlesIter.prototype.iterate = function () {
|
|
328
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
329
|
-
return __generator(this, function (_a) {
|
|
330
|
-
switch (_a.label) {
|
|
331
|
-
case 0:
|
|
332
|
-
if (!this.current) return [3 /*break*/, 1];
|
|
333
|
-
this.callback(this.current);
|
|
334
|
-
this.index += 1;
|
|
335
|
-
return [3 /*break*/, 3];
|
|
336
|
-
case 1: return [4 /*yield*/, this.getNextBatch()];
|
|
337
|
-
case 2:
|
|
338
|
-
if (!(_a.sent())) {
|
|
339
|
-
this.doneCallback(this.errorMessage);
|
|
340
|
-
return [2 /*return*/];
|
|
341
|
-
}
|
|
342
|
-
_a.label = 3;
|
|
343
|
-
case 3: return [2 /*return*/, this.iterate()];
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
});
|
|
347
|
-
};
|
|
348
|
-
/**
|
|
349
|
-
* Extract the results according to maxItems
|
|
350
|
-
* @param response response from the backend
|
|
351
|
-
*/
|
|
352
|
-
QueryArticlesIter.prototype.extractResults = function (response) {
|
|
353
|
-
var _a;
|
|
354
|
-
var results = ((_a = response === null || response === void 0 ? void 0 : response.articles) === null || _a === void 0 ? void 0 : _a.results) || [];
|
|
355
|
-
var extractedSize = this.maxItems !== -1 ? this.maxItems - this.returnedSoFar : results.length;
|
|
356
|
-
return results.slice(0, extractedSize).filter(Boolean);
|
|
357
|
-
};
|
|
358
|
-
Object.defineProperty(QueryArticlesIter.prototype, "current", {
|
|
359
|
-
get: function () {
|
|
360
|
-
return this.items[this.index] || undefined;
|
|
361
|
-
},
|
|
362
|
-
enumerable: false,
|
|
363
|
-
configurable: true
|
|
364
|
-
});
|
|
365
|
-
QueryArticlesIter.prototype.getNextBatch = function () {
|
|
366
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
367
|
-
var requestArticles, response, error, results, error_1;
|
|
368
|
-
var _a;
|
|
369
|
-
return __generator(this, function (_b) {
|
|
370
|
-
switch (_b.label) {
|
|
371
|
-
case 0:
|
|
372
|
-
_b.trys.push([0, 2, , 3]);
|
|
373
|
-
this.page += 1;
|
|
374
|
-
if (this.page > this.pages || (this.maxItems !== -1 && this.returnedSoFar >= this.maxItems)) {
|
|
375
|
-
return [2 /*return*/, false];
|
|
376
|
-
}
|
|
377
|
-
requestArticles = new RequestArticlesInfo({
|
|
378
|
-
page: this.page,
|
|
379
|
-
sortBy: this.sortBy,
|
|
380
|
-
sortByAsc: this.sortByAsc,
|
|
381
|
-
returnInfo: this.returnInfo,
|
|
382
|
-
});
|
|
383
|
-
this.setRequestedResult(requestArticles);
|
|
384
|
-
if (this.er.verboseOutput) {
|
|
385
|
-
this.er.logger.info("Downloading article page ".concat(this.page, "..."));
|
|
386
|
-
}
|
|
387
|
-
return [4 /*yield*/, this.er.execQuery(this, this.er.allowUseOfArchive)];
|
|
388
|
-
case 1:
|
|
389
|
-
response = _b.sent();
|
|
390
|
-
error = response.error || "";
|
|
391
|
-
if (error) {
|
|
392
|
-
this.errorMessage = "Error while obtaining a list of articles: ".concat(this.errorMessage);
|
|
393
|
-
}
|
|
394
|
-
else {
|
|
395
|
-
this.pages = ((_a = response.articles) === null || _a === void 0 ? void 0 : _a.pages) || 0;
|
|
396
|
-
}
|
|
397
|
-
results = this.extractResults(response);
|
|
398
|
-
this.returnedSoFar += results.length;
|
|
399
|
-
this.items = __spreadArray(__spreadArray([], __read(this.items), false), __read(results), false);
|
|
400
|
-
return [2 /*return*/, true];
|
|
401
|
-
case 2:
|
|
402
|
-
error_1 = _b.sent();
|
|
403
|
-
this.er.logger.error(error_1);
|
|
404
|
-
return [2 /*return*/, false];
|
|
405
|
-
case 3: return [2 /*return*/];
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
});
|
|
409
|
-
};
|
|
410
|
-
return QueryArticlesIter;
|
|
411
|
-
}(QueryArticles));
|
|
412
|
-
exports.QueryArticlesIter = QueryArticlesIter;
|
|
413
|
-
var RequestArticles = /** @class */ (function () {
|
|
414
|
-
function RequestArticles() {
|
|
415
|
-
}
|
|
416
|
-
return RequestArticles;
|
|
417
|
-
}());
|
|
418
|
-
exports.RequestArticles = RequestArticles;
|
|
419
|
-
var RequestArticlesInfo = /** @class */ (function (_super) {
|
|
420
|
-
__extends(RequestArticlesInfo, _super);
|
|
421
|
-
function RequestArticlesInfo(parameters) {
|
|
422
|
-
if (parameters === void 0) { parameters = {}; }
|
|
423
|
-
var _this = _super.call(this) || this;
|
|
424
|
-
_this.resultType = "articles";
|
|
425
|
-
var _a = parameters.page, page = _a === void 0 ? 1 : _a, _b = parameters.count, count = _b === void 0 ? 100 : _b, _c = parameters.sortBy, sortBy = _c === void 0 ? "date" : _c, _d = parameters.sortByAsc, sortByAsc = _d === void 0 ? false : _d, returnInfo = parameters.returnInfo, unsupported = __rest(parameters, ["page", "count", "sortBy", "sortByAsc", "returnInfo"]);
|
|
426
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
427
|
-
logger_1.Logger.warn("RequestArticlesInfo: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
428
|
-
}
|
|
429
|
-
if (page < 1) {
|
|
430
|
-
throw new RangeError("page has to be >= 1");
|
|
431
|
-
}
|
|
432
|
-
if (count > 200) {
|
|
433
|
-
throw new RangeError("at most 200 articles can be returned per call");
|
|
434
|
-
}
|
|
435
|
-
_this.params = {};
|
|
436
|
-
_this.params["articlesPage"] = page;
|
|
437
|
-
_this.params["articlesCount"] = count;
|
|
438
|
-
_this.params["articlesSortBy"] = sortBy;
|
|
439
|
-
_this.params["articlesSortByAsc"] = sortByAsc;
|
|
440
|
-
if (returnInfo) {
|
|
441
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("articles"));
|
|
442
|
-
}
|
|
443
|
-
return _this;
|
|
444
|
-
}
|
|
445
|
-
return RequestArticlesInfo;
|
|
446
|
-
}(RequestArticles));
|
|
447
|
-
exports.RequestArticlesInfo = RequestArticlesInfo;
|
|
448
|
-
var RequestArticlesUriWgtList = /** @class */ (function (_super) {
|
|
449
|
-
__extends(RequestArticlesUriWgtList, _super);
|
|
450
|
-
function RequestArticlesUriWgtList(parameters) {
|
|
451
|
-
if (parameters === void 0) { parameters = {}; }
|
|
452
|
-
var _this = _super.call(this) || this;
|
|
453
|
-
_this.resultType = "uriWgtList";
|
|
454
|
-
var _a = parameters.page, page = _a === void 0 ? 1 : _a, _b = parameters.count, count = _b === void 0 ? 10000 : _b, _c = parameters.sortBy, sortBy = _c === void 0 ? "fq" : _c, _d = parameters.sortByAsc, sortByAsc = _d === void 0 ? false : _d, unsupported = __rest(parameters, ["page", "count", "sortBy", "sortByAsc"]);
|
|
455
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
456
|
-
logger_1.Logger.warn("RequestArticlesUriWgtList: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
457
|
-
}
|
|
458
|
-
if (page < 1) {
|
|
459
|
-
throw new RangeError("page has to be >= 1");
|
|
460
|
-
}
|
|
461
|
-
if (count > 50000) {
|
|
462
|
-
throw new RangeError("at most 50000 items can be returned per call");
|
|
463
|
-
}
|
|
464
|
-
_this.params = {};
|
|
465
|
-
_this.params["uriWgtListPage"] = page;
|
|
466
|
-
_this.params["uriWgtListCount"] = count;
|
|
467
|
-
_this.params["uriWgtListSortBy"] = sortBy;
|
|
468
|
-
_this.params["uriWgtListSortByAsc"] = sortByAsc;
|
|
469
|
-
return _this;
|
|
470
|
-
}
|
|
471
|
-
RequestArticlesUriWgtList.prototype.setPage = function (page) {
|
|
472
|
-
if (page < 1) {
|
|
473
|
-
throw new RangeError("page has to be >= 1");
|
|
474
|
-
}
|
|
475
|
-
this.params["uriWgtListPage"] = page;
|
|
476
|
-
};
|
|
477
|
-
return RequestArticlesUriWgtList;
|
|
478
|
-
}(RequestArticles));
|
|
479
|
-
exports.RequestArticlesUriWgtList = RequestArticlesUriWgtList;
|
|
480
|
-
var RequestArticlesTimeAggr = /** @class */ (function (_super) {
|
|
481
|
-
__extends(RequestArticlesTimeAggr, _super);
|
|
482
|
-
function RequestArticlesTimeAggr() {
|
|
483
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
484
|
-
_this.resultType = "timeAggr";
|
|
485
|
-
return _this;
|
|
486
|
-
}
|
|
487
|
-
return RequestArticlesTimeAggr;
|
|
488
|
-
}(RequestArticles));
|
|
489
|
-
exports.RequestArticlesTimeAggr = RequestArticlesTimeAggr;
|
|
490
|
-
var RequestArticlesConceptAggr = /** @class */ (function (_super) {
|
|
491
|
-
__extends(RequestArticlesConceptAggr, _super);
|
|
492
|
-
function RequestArticlesConceptAggr(_a) {
|
|
493
|
-
if (_a === void 0) { _a = {}; }
|
|
494
|
-
var _this = this;
|
|
495
|
-
var _b = _a.conceptCount, conceptCount = _b === void 0 ? 25 : _b, _c = _a.conceptCountPerType, conceptCountPerType = _c === void 0 ? undefined : _c, _d = _a.conceptScoring, conceptScoring = _d === void 0 ? "importance" : _d, _e = _a.articlesSampleSize, articlesSampleSize = _e === void 0 ? 10000 : _e, _f = _a.returnInfo, returnInfo = _f === void 0 ? new returnInfo_1.ReturnInfo() : _f, unsupported = __rest(_a, ["conceptCount", "conceptCountPerType", "conceptScoring", "articlesSampleSize", "returnInfo"]);
|
|
496
|
-
_this = _super.call(this) || this;
|
|
497
|
-
_this.resultType = "conceptAggr";
|
|
498
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
499
|
-
logger_1.Logger.warn("RequestArticlesConceptAggr: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
500
|
-
}
|
|
501
|
-
if (conceptCount > 500) {
|
|
502
|
-
throw new RangeError("At most 500 concepts can be returned per call");
|
|
503
|
-
}
|
|
504
|
-
if (articlesSampleSize > 20000) {
|
|
505
|
-
throw new RangeError("at most 20000 articles can be used for computation sample");
|
|
506
|
-
}
|
|
507
|
-
_this.params = {};
|
|
508
|
-
_this.params["conceptAggrConceptCount"] = conceptCount;
|
|
509
|
-
_this.params["conceptAggrSampleSize"] = articlesSampleSize;
|
|
510
|
-
_this.params["conceptAggrScoring"] = conceptScoring;
|
|
511
|
-
if (conceptCountPerType !== undefined) {
|
|
512
|
-
_this.params["conceptAggrConceptCountPerType"] = conceptCountPerType;
|
|
513
|
-
}
|
|
514
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptAggr"));
|
|
515
|
-
return _this;
|
|
516
|
-
}
|
|
517
|
-
return RequestArticlesConceptAggr;
|
|
518
|
-
}(RequestArticles));
|
|
519
|
-
exports.RequestArticlesConceptAggr = RequestArticlesConceptAggr;
|
|
520
|
-
var RequestArticlesCategoryAggr = /** @class */ (function (_super) {
|
|
521
|
-
__extends(RequestArticlesCategoryAggr, _super);
|
|
522
|
-
function RequestArticlesCategoryAggr(_a) {
|
|
523
|
-
if (_a === void 0) { _a = {}; }
|
|
524
|
-
var _this = this;
|
|
525
|
-
var _b = _a.articlesSampleSize, articlesSampleSize = _b === void 0 ? 20000 : _b, _c = _a.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c, unsupported = __rest(_a, ["articlesSampleSize", "returnInfo"]);
|
|
526
|
-
_this = _super.call(this) || this;
|
|
527
|
-
_this.resultType = "categoryAggr";
|
|
528
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
529
|
-
logger_1.Logger.warn("RequestArticlesCategoryAggr: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
530
|
-
}
|
|
531
|
-
if (articlesSampleSize > 50000) {
|
|
532
|
-
throw new RangeError("at most 50000 articles can be used for computation sample");
|
|
533
|
-
}
|
|
534
|
-
_this.params = {};
|
|
535
|
-
_this.params["categoryAggrSampleSize"] = articlesSampleSize;
|
|
536
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("categoryAggr"));
|
|
537
|
-
return _this;
|
|
538
|
-
}
|
|
539
|
-
return RequestArticlesCategoryAggr;
|
|
540
|
-
}(RequestArticles));
|
|
541
|
-
exports.RequestArticlesCategoryAggr = RequestArticlesCategoryAggr;
|
|
542
|
-
var RequestArticlesSourceAggr = /** @class */ (function (_super) {
|
|
543
|
-
__extends(RequestArticlesSourceAggr, _super);
|
|
544
|
-
function RequestArticlesSourceAggr(_a) {
|
|
545
|
-
if (_a === void 0) { _a = {}; }
|
|
546
|
-
var _this = this;
|
|
547
|
-
var _b = _a.sourceCount, sourceCount = _b === void 0 ? 50 : _b, _c = _a.normalizeBySourceArts, normalizeBySourceArts = _c === void 0 ? false : _c, _d = _a.returnInfo, returnInfo = _d === void 0 ? new returnInfo_1.ReturnInfo() : _d, unsupported = __rest(_a, ["sourceCount", "normalizeBySourceArts", "returnInfo"]);
|
|
548
|
-
_this = _super.call(this) || this;
|
|
549
|
-
_this.resultType = "sourceAggr";
|
|
550
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
551
|
-
logger_1.Logger.warn("RequestArticlesSourceAggr: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
552
|
-
}
|
|
553
|
-
_this.params = {};
|
|
554
|
-
_this.params["sourceAggrSourceCount"] = sourceCount;
|
|
555
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("sourceAggr"));
|
|
556
|
-
return _this;
|
|
557
|
-
}
|
|
558
|
-
return RequestArticlesSourceAggr;
|
|
559
|
-
}(RequestArticles));
|
|
560
|
-
exports.RequestArticlesSourceAggr = RequestArticlesSourceAggr;
|
|
561
|
-
var RequestArticlesKeywordAggr = /** @class */ (function (_super) {
|
|
562
|
-
__extends(RequestArticlesKeywordAggr, _super);
|
|
563
|
-
function RequestArticlesKeywordAggr(_a) {
|
|
564
|
-
if (_a === void 0) { _a = {}; }
|
|
565
|
-
var _this = this;
|
|
566
|
-
var _b = _a.articlesSampleSize, articlesSampleSize = _b === void 0 ? 2000 : _b, unsupported = __rest(_a, ["articlesSampleSize"]);
|
|
567
|
-
_this = _super.call(this) || this;
|
|
568
|
-
_this.resultType = "keywordAggr";
|
|
569
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
570
|
-
logger_1.Logger.warn("RequestArticlesKeywordAggr: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
571
|
-
}
|
|
572
|
-
if (articlesSampleSize > 20000) {
|
|
573
|
-
throw new RangeError("at most 20000 articles can be used for computation sample");
|
|
574
|
-
}
|
|
575
|
-
_this.params = {};
|
|
576
|
-
_this.params["keywordAggrSampleSize"] = articlesSampleSize;
|
|
577
|
-
return _this;
|
|
578
|
-
}
|
|
579
|
-
return RequestArticlesKeywordAggr;
|
|
580
|
-
}(RequestArticles));
|
|
581
|
-
exports.RequestArticlesKeywordAggr = RequestArticlesKeywordAggr;
|
|
582
|
-
var RequestArticlesConceptGraph = /** @class */ (function (_super) {
|
|
583
|
-
__extends(RequestArticlesConceptGraph, _super);
|
|
584
|
-
function RequestArticlesConceptGraph(_a) {
|
|
585
|
-
if (_a === void 0) { _a = {}; }
|
|
586
|
-
var _this = this;
|
|
587
|
-
var _b = _a.conceptCount, conceptCount = _b === void 0 ? 25 : _b, _c = _a.linkCount, linkCount = _c === void 0 ? 50 : _c, _d = _a.articlesSampleSize, articlesSampleSize = _d === void 0 ? 10000 : _d, _e = _a.skipQueryConcepts, skipQueryConcepts = _e === void 0 ? true : _e, _f = _a.returnInfo, returnInfo = _f === void 0 ? new returnInfo_1.ReturnInfo() : _f, unsupported = __rest(_a, ["conceptCount", "linkCount", "articlesSampleSize", "skipQueryConcepts", "returnInfo"]);
|
|
588
|
-
_this = _super.call(this) || this;
|
|
589
|
-
_this.resultType = "conceptGraph";
|
|
590
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
591
|
-
logger_1.Logger.warn("RequestArticlesConceptGraph: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
592
|
-
}
|
|
593
|
-
if (conceptCount > 1000) {
|
|
594
|
-
throw new RangeError("At most 1000 concepts can be returned per call");
|
|
595
|
-
}
|
|
596
|
-
if (linkCount > 2000) {
|
|
597
|
-
throw new RangeError("at most 2000 links can be returned per call");
|
|
598
|
-
}
|
|
599
|
-
if (articlesSampleSize > 50000) {
|
|
600
|
-
throw new RangeError("at most 50000 results can be used for computation sample");
|
|
601
|
-
}
|
|
602
|
-
_this.params = {};
|
|
603
|
-
_this.params["conceptGraphConceptCount"] = conceptCount;
|
|
604
|
-
_this.params["conceptGraphLinkCount"] = linkCount;
|
|
605
|
-
_this.params["conceptGraphSampleSize"] = articlesSampleSize;
|
|
606
|
-
_this.params["conceptGraphSkipQueryConcepts"] = skipQueryConcepts;
|
|
607
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptGraph"));
|
|
608
|
-
return _this;
|
|
609
|
-
}
|
|
610
|
-
return RequestArticlesConceptGraph;
|
|
611
|
-
}(RequestArticles));
|
|
612
|
-
exports.RequestArticlesConceptGraph = RequestArticlesConceptGraph;
|
|
613
|
-
var RequestArticlesConceptMatrix = /** @class */ (function (_super) {
|
|
614
|
-
__extends(RequestArticlesConceptMatrix, _super);
|
|
615
|
-
function RequestArticlesConceptMatrix(_a) {
|
|
616
|
-
if (_a === void 0) { _a = {}; }
|
|
617
|
-
var _this = this;
|
|
618
|
-
var _b = _a.conceptCount, conceptCount = _b === void 0 ? 25 : _b, _c = _a.measure, measure = _c === void 0 ? "pmi" : _c, _d = _a.articlesSampleSize, articlesSampleSize = _d === void 0 ? 10000 : _d, _e = _a.returnInfo, returnInfo = _e === void 0 ? new returnInfo_1.ReturnInfo() : _e, unsupported = __rest(_a, ["conceptCount", "measure", "articlesSampleSize", "returnInfo"]);
|
|
619
|
-
_this = _super.call(this) || this;
|
|
620
|
-
_this.resultType = "conceptMatrix";
|
|
621
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
622
|
-
logger_1.Logger.warn("RequestArticlesConceptMatrix: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
623
|
-
}
|
|
624
|
-
if (conceptCount > 200) {
|
|
625
|
-
throw new RangeError("At most 200 concepts can be returned per call");
|
|
626
|
-
}
|
|
627
|
-
if (articlesSampleSize > 50000) {
|
|
628
|
-
throw new RangeError("at most 50000 results can be used for computation sample");
|
|
629
|
-
}
|
|
630
|
-
_this.params = {};
|
|
631
|
-
_this.params["conceptMatrixConceptCount"] = conceptCount;
|
|
632
|
-
_this.params["conceptMatrixMeasure"] = measure;
|
|
633
|
-
_this.params["conceptMatrixSampleSize"] = articlesSampleSize;
|
|
634
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptMatrix"));
|
|
635
|
-
return _this;
|
|
636
|
-
}
|
|
637
|
-
return RequestArticlesConceptMatrix;
|
|
638
|
-
}(RequestArticles));
|
|
639
|
-
exports.RequestArticlesConceptMatrix = RequestArticlesConceptMatrix;
|
|
640
|
-
var RequestArticlesConceptTrends = /** @class */ (function (_super) {
|
|
641
|
-
__extends(RequestArticlesConceptTrends, _super);
|
|
642
|
-
function RequestArticlesConceptTrends(parameters) {
|
|
643
|
-
if (parameters === void 0) { parameters = {}; }
|
|
644
|
-
var _this = _super.call(this) || this;
|
|
645
|
-
_this.resultType = "conceptTrends";
|
|
646
|
-
var conceptUris = parameters.conceptUris, _a = parameters.conceptCount, conceptCount = _a === void 0 ? 25 : _a, _b = parameters.articlesSampleSize, articlesSampleSize = _b === void 0 ? 10000 : _b, _c = parameters.returnInfo, returnInfo = _c === void 0 ? new returnInfo_1.ReturnInfo() : _c, unsupported = __rest(parameters, ["conceptUris", "conceptCount", "articlesSampleSize", "returnInfo"]);
|
|
647
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
648
|
-
logger_1.Logger.warn("RequestArticlesConceptTrends: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
649
|
-
}
|
|
650
|
-
if (conceptCount > 50) {
|
|
651
|
-
throw new RangeError("At most 50 concepts can be returned per call");
|
|
652
|
-
}
|
|
653
|
-
if (articlesSampleSize > 50000) {
|
|
654
|
-
throw new RangeError("at most 50000 results can be used for computation sample");
|
|
655
|
-
}
|
|
656
|
-
_this.params = {};
|
|
657
|
-
if (conceptUris !== undefined) {
|
|
658
|
-
_this.params["conceptTrendsConceptUri"] = conceptUris;
|
|
659
|
-
}
|
|
660
|
-
_this.params["conceptTrendsConceptCount"] = conceptCount;
|
|
661
|
-
_this.params["conceptTrendsSampleSize"] = articlesSampleSize;
|
|
662
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("conceptTrends"));
|
|
663
|
-
return _this;
|
|
664
|
-
}
|
|
665
|
-
return RequestArticlesConceptTrends;
|
|
666
|
-
}(RequestArticles));
|
|
667
|
-
exports.RequestArticlesConceptTrends = RequestArticlesConceptTrends;
|
|
668
|
-
var RequestArticlesDateMentionAggr = /** @class */ (function (_super) {
|
|
669
|
-
__extends(RequestArticlesDateMentionAggr, _super);
|
|
670
|
-
function RequestArticlesDateMentionAggr() {
|
|
671
|
-
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
672
|
-
_this.resultType = "dateMentionAggr";
|
|
673
|
-
return _this;
|
|
674
|
-
}
|
|
675
|
-
return RequestArticlesDateMentionAggr;
|
|
676
|
-
}(RequestArticles));
|
|
677
|
-
exports.RequestArticlesDateMentionAggr = RequestArticlesDateMentionAggr;
|
|
678
|
-
var RequestArticlesRecentActivity = /** @class */ (function (_super) {
|
|
679
|
-
__extends(RequestArticlesRecentActivity, _super);
|
|
680
|
-
function RequestArticlesRecentActivity(_a) {
|
|
681
|
-
if (_a === void 0) { _a = {}; }
|
|
682
|
-
var _this = this;
|
|
683
|
-
var _b = _a.maxArticleCount, maxArticleCount = _b === void 0 ? 100 : _b, _c = _a.updatesAfterNewsUri, updatesAfterNewsUri = _c === void 0 ? undefined : _c, _d = _a.updatesafterBlogUri, updatesafterBlogUri = _d === void 0 ? undefined : _d, _e = _a.updatesAfterPrUri, updatesAfterPrUri = _e === void 0 ? undefined : _e, _f = _a.updatesAfterTm, updatesAfterTm = _f === void 0 ? undefined : _f, _g = _a.updatesAfterMinsAgo, updatesAfterMinsAgo = _g === void 0 ? undefined : _g, _h = _a.updatesUntilTm, updatesUntilTm = _h === void 0 ? undefined : _h, _j = _a.updatesUntilMinsAgo, updatesUntilMinsAgo = _j === void 0 ? undefined : _j, _k = _a.mandatorySourceLocation, mandatorySourceLocation = _k === void 0 ? false : _k, _l = _a.returnInfo, returnInfo = _l === void 0 ? undefined : _l, unsupported = __rest(_a, ["maxArticleCount", "updatesAfterNewsUri", "updatesafterBlogUri", "updatesAfterPrUri", "updatesAfterTm", "updatesAfterMinsAgo", "updatesUntilTm", "updatesUntilMinsAgo", "mandatorySourceLocation", "returnInfo"]);
|
|
684
|
-
_this = _super.call(this) || this;
|
|
685
|
-
_this.resultType = "recentActivityArticles";
|
|
686
|
-
if (Object.keys(unsupported).length !== 0) {
|
|
687
|
-
logger_1.Logger.warn("RequestArticlesRecentActivity: Unsupported parameters detected: ".concat(JSON.stringify(unsupported), ". Please check the documentation."));
|
|
688
|
-
}
|
|
689
|
-
if (maxArticleCount > 2000) {
|
|
690
|
-
throw new RangeError("At most 2000 articles can be returned per call");
|
|
691
|
-
}
|
|
692
|
-
if (updatesAfterTm !== undefined && updatesAfterMinsAgo !== undefined) {
|
|
693
|
-
throw new Error("You should specify either updatesAfterTm or updatesAfterMinsAgo parameter, but not both");
|
|
694
|
-
}
|
|
695
|
-
if (updatesUntilTm !== undefined && updatesUntilMinsAgo !== undefined) {
|
|
696
|
-
throw new Error("You should specify either updatesUntilTm or updatesUntilMinsAgo parameter, but not both");
|
|
697
|
-
}
|
|
698
|
-
_this.params = {};
|
|
699
|
-
_this.params["recentActivityArticlesMaxArticleCount"] = maxArticleCount;
|
|
700
|
-
if (updatesAfterTm !== undefined) {
|
|
701
|
-
_this.params["recentActivityArticlesUpdatesAfterTm"] = base_1.QueryParamsBase.encodeDateTime(updatesAfterTm);
|
|
702
|
-
}
|
|
703
|
-
if (updatesAfterMinsAgo !== undefined) {
|
|
704
|
-
_this.params["recentActivityArticlesUpdatesAfterMinsAgo"] = updatesAfterMinsAgo;
|
|
705
|
-
}
|
|
706
|
-
if (updatesUntilTm !== undefined) {
|
|
707
|
-
_this.params["recentActivityArticlesUpdatesUntilTm"] = base_1.QueryParamsBase.encodeDateTime(updatesUntilTm);
|
|
708
|
-
}
|
|
709
|
-
if (updatesUntilMinsAgo !== undefined) {
|
|
710
|
-
_this.params["recentActivityArticlesUpdatesUntilMinsAgo"] = updatesUntilMinsAgo;
|
|
711
|
-
}
|
|
712
|
-
if (updatesAfterNewsUri !== undefined) {
|
|
713
|
-
_this.params["recentActivityArticlesNewsUpdatesAfterUri"] = updatesAfterNewsUri;
|
|
714
|
-
}
|
|
715
|
-
if (updatesafterBlogUri !== undefined) {
|
|
716
|
-
_this.params["recentActivityArticlesNewsUpdatesAfterUri"] = updatesafterBlogUri;
|
|
717
|
-
}
|
|
718
|
-
if (updatesAfterPrUri !== undefined) {
|
|
719
|
-
_this.params["recentActivityArticlesNewsUpdatesAfterUri"] = updatesAfterPrUri;
|
|
720
|
-
}
|
|
721
|
-
_this.params["recentActivityArticlesMandatorySourceLocation"] = mandatorySourceLocation;
|
|
722
|
-
if (returnInfo) {
|
|
723
|
-
_this.params = __assign(__assign({}, _this.params), returnInfo.getParams("recentActivityArticles"));
|
|
724
|
-
}
|
|
725
|
-
return _this;
|
|
726
|
-
}
|
|
727
|
-
return RequestArticlesRecentActivity;
|
|
728
|
-
}(RequestArticles));
|
|
729
|
-
exports.RequestArticlesRecentActivity = RequestArticlesRecentActivity;
|
|
730
|
-
//# sourceMappingURL=queryArticles.js.map
|