eventregistry 9.1.0 → 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 -10
- 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 -144
- 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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# NodeJS SDK: Change Log
|
|
2
|
+
|
|
3
|
+
This log contains changes specific to the NodeJS SDK.
|
|
4
|
+
|
|
5
|
+
## [v10.0.0](https://www.npmjs.com/package/eventregistry/v/10.0.0) (2026-10-09)
|
|
6
|
+
|
|
7
|
+
Upgrade guide for the last published line (`9.1.1`): [MIGRATION.md](MIGRATION.md). **The classic class-based API (`QueryArticles`, `QueryEvents`, `execQuery()`, iterators, complex queries, …) remains fully supported** — class names were not removed or renamed.
|
|
8
|
+
|
|
9
|
+
**Breaking**
|
|
10
|
+
- Node.js **18+ is required**. `9.1.1` declared `engines: >=5` and used Axios, so it still ran on older Node. `10.0.0` uses native `fetch` / `Headers` / `AbortController` with no polyfill; Node 16 and below fail at runtime (`fetch is not defined`). Upgrade Node before upgrading this package. See [MIGRATION.md](MIGRATION.md#4-http-transport-axios-removed-fetch-required).
|
|
11
|
+
- API requests now use HTTPS by default (`https://eventregistry.org` and `https://analytics.eventregistry.org`). `9.1.1` defaulted to `http://`.
|
|
12
|
+
- The default `minDelayBetweenRequests` is now `0.5` seconds (was `1`). Throttling is enforced with `Date.now()` under a per-instance mutex.
|
|
13
|
+
- The default `repeatFailedRequestCount` is now `-1` (retry indefinitely; was `2`). Stop codes `204`, `400`, `401`, `403`, `530` still do not retry. Programmer errors (`JSON.stringify` of a circular body) and JSON parse failures on HTTP 200 are **not** retried.
|
|
14
|
+
- Replaced the Axios HTTP client with a native `fetch`-based transport (`src/http.ts`). Axios-specific error shapes (`error.isAxiosError`, interceptors, `getLastHeaders()` as a plain object) are gone. See [MIGRATION.md](MIGRATION.md#4-http-transport-axios-removed-fetch-required).
|
|
15
|
+
- Removed Winston. `Logger`/`LogLevel` keep the same public API (`er.logger.logLevel`, `LogLevel.{ERROR,WARN,INFO,DEBUG,REQUEST}`, constructor `logging`); custom Winston transports no longer apply. See [MIGRATION.md](MIGRATION.md#5-logging-winston-removed-loggerloglevel-api-unchanged).
|
|
16
|
+
- The TypeScript source now compiles under `strict` mode, producing tighter `.d.ts` typings. See [MIGRATION.md](MIGRATION.md#3-typescript-strict-mode-and-tighter-dts).
|
|
17
|
+
- Dual CommonJS and ES module builds under `dist/cjs` and `dist/esm` (`package.json` `exports`). Importing or requiring `eventregistry` keeps the same API.
|
|
18
|
+
- Transport failures returned from `execQuery` / `jsonRequest` expose `error` as a **string** (matching API error payloads) instead of an `Error` instance that JSON-serialized to `{}`.
|
|
19
|
+
- `GetRecentEvents.getUpdates()` now returns the `activity` **array** (`[]` if missing) and advances the `newestUri` polling cursor, matching `GetRecentArticles`. `9.1.1` returned `activity || {}` and did not persist the cursor.
|
|
20
|
+
|
|
21
|
+
**Added**
|
|
22
|
+
- Full-surface ergonomic layer: helper functions (`searchArticles`, `iterateArticles`, `getArticle`, `searchEvents`, `iterateEvents`, `getEvent`, `searchMentions`, `iterateMentions`, `getStory`, `getTrending*`, `getCounts`/`getCountsEx`, `getTopShared*`, `getRecent*`, `getSourceInfo`/`getConceptInfo`/`getCategoryInfo`/`getSourceStats`, `getMyTopicPages`/`loadTopicPage`/`createTopicPage`, `annotateText`/`categorizeText`/`analyzeSentiment`/`semanticSimilarity`/`detectLanguage`/`extractArticleInfo`/`ner`/`trainTopic*`, `getEventForText`) and URI-resolution helpers (`conceptUri`, `categoryUri`, `sourceUri`, `sourceGroupUri`, `locationUri`, `eventTypeUri`, `conceptClassUri`, `authorUri`) that throw on no-match instead of resolving to `undefined`.
|
|
23
|
+
- Matching fluent namespaces on `EventRegistry`: `er.articles`, `er.events`, `er.mentions`, `er.stories`, `er.trends`, `er.counts`, `er.shares`, `er.recent`, `er.info`, `er.topicPages`, `er.analytics`, `er.eventForText(...)`, and `er.concepts`/`er.categories`/`er.sources`/`er.locations`/`er.eventTypes`/`er.conceptClasses`/`er.authors` for URI resolution. Search-style namespaces expose `.search(args).info(opts).exec()`, `.iterate(args)`, and `.get(uri)` where applicable.
|
|
24
|
+
- `RequestEventsBreakingEvents` for querying currently breaking events.
|
|
25
|
+
- `TopicPages` class with `getMyTopicPages()` to list user-owned topic pages.
|
|
26
|
+
- `EventRegistry.getEventTypeUri()` helper for resolving event type labels to URIs.
|
|
27
|
+
- Optional `concepts` parameter on `Analytics.categorize()`.
|
|
28
|
+
- `EventRegistry.setExtraParams()` for adding parameters to every request.
|
|
29
|
+
- `EventRegistry.checkVersion()` for checking the latest SDK version. Reads `/static/nodejsSDKVersion.txt` on the API host, then falls back to the npm registry `latest` document if that file is missing.
|
|
30
|
+
- Configuration getters: `getHost()`, `getHostAnalytics()`, `getApiKey()`, `getMinDelayBetweenRequests()`, and `getRepeatFailedRequestCount()`.
|
|
31
|
+
|
|
32
|
+
**Updated**
|
|
33
|
+
- Node.js 24.11.0 is the supported development target; `engines` is `>=18.0.0`.
|
|
34
|
+
- Zero runtime dependencies (Axios, Winston, moment, and `semaphore-async-await` removed). Dates use native `Date`; request locking uses an in-house `Mutex`.
|
|
35
|
+
- TypeScript compile target raised to ES2020.
|
|
36
|
+
- Upgraded linting to ESLint 9 (TSLint removed).
|
|
37
|
+
- Offline unit tests migrated to Vitest (`npm run test:unit`). Jasmine integration tests replay committed fixtures by default (`npm test`).
|
|
38
|
+
- GitHub Actions CI runs build, lint, unit tests, fixture replay, example typecheck, and `publint` on Node 18 and Node 24.
|
|
39
|
+
- `package.json` declares `"type": "commonjs"` and a `git+https` repository URL (publint).
|
|
40
|
+
- The published tarball now ships `src/` alongside `dist/`, so the emitted `.js.map` source maps resolve to the real TypeScript sources instead of dangling.
|
|
41
|
+
- Hardened integration tests against live API volatility (awaited iterators, range assertions, dynamic fixtures, paging safety caps).
|
|
42
|
+
|
|
43
|
+
**Fixed**
|
|
44
|
+
- Removed accidental `fdescribe` focus in integration tests so the full suite runs.
|
|
45
|
+
- `checkVersion()` no longer silently no-ops when `/static/nodejsSDKVersion.txt` is missing (the live URL currently 404s); it falls back to the npm registry.
|
|
46
|
+
- `getLastHeaders()` declares an explicit `Headers` return type, so the published `.d.ts` no longer references `undici-types` (an internal `@types/node` package consumers do not install).
|
|
47
|
+
- `QueryArticles` now sends `authorsFilter` / `videosFilter` / `linksFilter` as the API params `hasAuthorsFilter` / `hasVideosFilter` / `hasLinksFilter` (matching the Python SDK). The constructor argument names are unchanged.
|
|
48
|
+
|
|
49
|
+
## [v9.1.1](https://www.npmjs.com/package/eventregistry/v/9.1.1) (2024-11-14)
|
|
50
|
+
**Fixed**
|
|
51
|
+
- fixed the issue when passing `logging` as `false` to the `EventRegistry` constructor the logs folder was still created. Now the logs are created only when `logging` is set to `true`.
|
|
52
|
+
|
|
53
|
+
## [v9.1]() (2024-06-27)
|
|
54
|
+
**Updated**
|
|
55
|
+
- Updated several external packages used internally by the SDK.
|
|
56
|
+
- Removed `lodash` as a dependency.
|
|
57
|
+
**Added**
|
|
58
|
+
- added `keywordSearchMode` parameter that can be used in `QueryArticles`, `QueryArticlesIter`, `QueryEvents`, `QueryEventsIter` and `QueryEvent` constructors.
|
|
59
|
+
**Updated**
|
|
60
|
+
- `QueryArticles` class. Added filters `authorsFilter`, `videosFilter`, `linksFilter`
|
|
61
|
+
- `QueryMentions` class. Added several filters: `industryUri`, `sdgUri`, `sasbUri`, `esgUri`, `minSentenceIndex`, `maxSentenceIndex`, `showDuplicates`
|
|
62
|
+
- Changed how logging works. If you would like to see host information or manually adjust logging level then you can do the following
|
|
63
|
+
``` javascript
|
|
64
|
+
const er = new EventRegistry();
|
|
65
|
+
er.logger.logLevel = LogLevel.DEBUG; // or LogLevel.INFO, LogLevel.WARN, LogLevel.ERROR
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## [v8.11.1]() (2023-05-11)
|
|
69
|
+
**Fixed**
|
|
70
|
+
- fixed the `RequestEventsRecentActivity` response type to the correct value.
|
|
71
|
+
```
|
|
72
|
+
## [v8.11.1]() (2023-03-24)
|
|
73
|
+
**Updated**
|
|
74
|
+
- the `QueryEventArticlesIter` class will be significantly faster in returning the articles when you specify the language filter
|
|
75
|
+
**Added**
|
|
76
|
+
- New option for usage for the following classes: `QueryEventsIter`, `QueryEventArticlesIter`, `QueryArticlesIter` and `QueryMentionsIter`. Example below shows how to use it with `QueryEventsIter` class.
|
|
77
|
+
```javascript
|
|
78
|
+
(async () => {
|
|
79
|
+
const er = new EventRegistry();
|
|
80
|
+
const events = new QueryEventsIter(er, { keywords: "Obama", maxItems: 30 });
|
|
81
|
+
for await (const event of events) {
|
|
82
|
+
console.info(event);
|
|
83
|
+
}
|
|
84
|
+
})();
|
|
85
|
+
```
|
|
86
|
+
## [v8.10.4]() (2022-12-08)
|
|
87
|
+
- Apply correct default value for article count when querying for articles when using RequestArticlesInfo (was 200 instead of 100).
|
|
88
|
+
|
|
89
|
+
## [v8.10.3]() (2022-12-08)
|
|
90
|
+
- Correctly apply allowUseOfArchive parameter when querying for articles and events with iterator classes.
|
|
91
|
+
|
|
92
|
+
## [v8.10.2]() (2022-05-09)
|
|
93
|
+
- Correctly exposed internal types and move other types to development dependencies. Thanks to the [PR #17](https://github.com/EventRegistry/event-registry-node-js/pull/17).
|
|
94
|
+
|
|
95
|
+
## [v8.10.1]() (2022-03-23)
|
|
96
|
+
|
|
97
|
+
**Breaking**
|
|
98
|
+
|
|
99
|
+
- `TopicPage.getArticles` and `TopicPage.getEvents` return full response with additional page/pages information (instead of simple array of articles/events).
|
|
100
|
+
|
|
101
|
+
## [v8.10.0]() (2021-10-19)
|
|
102
|
+
|
|
103
|
+
**Added**
|
|
104
|
+
|
|
105
|
+
- added file `QueryMentions` that can be used to query mentions of specific event types. The class is currently in beta and not available to users unless they have permissions to use this endpoint. The classes `QueryMentions` and `QueryMentionsIter` can be used in the same way as classes for querying articles and events, except that some query parameters are added and some removed. Examples for the classes were also added.
|
|
106
|
+
|
|
107
|
+
**Updated**
|
|
108
|
+
- When using method `initWithComplexQuery` we now check if the provided json is valid json object and report error in case it is not
|
|
109
|
+
|
|
110
|
+
## [v8.9.2]() (2021-05-12)
|
|
111
|
+
|
|
112
|
+
**Updated**
|
|
113
|
+
|
|
114
|
+
- Updated dependencies of the SDK library
|
|
115
|
+
|
|
116
|
+
## [v8.9]() (2020-11-24)
|
|
117
|
+
|
|
118
|
+
**Added**
|
|
119
|
+
|
|
120
|
+
- added `required` and `excluded` optional parameters to the TopicPage class to methods `addConcept`, `addKeyword`, `addCategory`, `addSource`, `addSourceLocation` and `addSourceGroup`.
|
|
121
|
+
- exceptions are now raised by the SDK library in case of status codes 204, 400, 401, 403 and 530. The meaning of the above status codes is described on the [documentation page](https://eventregistry.org/documentation?tab=introduction).
|
|
122
|
+
|
|
123
|
+
## [v8.8.0]() (2020-10-07)
|
|
124
|
+
|
|
125
|
+
**Added**
|
|
126
|
+
|
|
127
|
+
- added filters `reportingDateStart` and `reportingDateEnd` to `QueryEvents`. You can use these dates to find the events where the average date of reporting matches this date range. Note that `dateStart` and `dateEnd` will return events based on when they (supposedly) happened and it can be quite different than the reporting dates.
|
|
128
|
+
- added parameters `updatesAfterNewsUri`, `updatesafterBlogUri`, `updatesAfterPrUri` to the `RequestArticlesRecentActivity`. Can be used to make sure that absolutely no article is missed when using the `QueryArticles` with `RequestArticlesRecentActivity` requested result. See [this file](https://github.com/EventRegistry/event-registry-node-js/blob/master/examples/feedOfNewArticlesExamples.ts) for an example of use.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## [v8.7.0]() (2020-01-31)
|
|
132
|
+
|
|
133
|
+
**Added**
|
|
134
|
+
- added `EventRegistry.getServiceStatus()` method that reports status of the services
|
|
135
|
+
- We added sentiment, which can now be used in querying of articles and events. The `QueryArticles`, `QueryArticlesIter`, `QueryEvents`, `QueryEventsIter` now all have additional parameters `minSentiment` and `maxSentiment` that can be used to filter the articles and events. The valid values are between -1 (very negative sentiment) and 1 (very positive sentiment). Value 0 represents neutral sentiment.
|
|
136
|
+
- Sentiment was also added as a property in the returned articles and events.
|
|
137
|
+
- `ComplexQueryArticles` and `ComplexQueryEvents` classes now support in the constructor additional filters like `minSentiment`, `maxSentiment`, `minFacebookShares`, `endSourceRankPercentile`, etc.
|
|
138
|
+
|
|
139
|
+
**Updated**
|
|
140
|
+
- `ReturnInfo` classes (`ArticleInfoFlags`, `ConceptInfoFlags`, ...) were updated. Some obsolete parameters were removed and we've also added support to directly pass any rarely used parameters, that are not a part of the typings.
|
|
141
|
+
- `TopicPage.getArticles` and `TopicPage.getEvents` methods now also support passing any rarely used parameters directly, that are not a part of the typings.
|
|
142
|
+
- Analytics: We updated `trainTopicOnTweets()`, `trainTopicClearTopic()` and `trainTopicGetTrainedTopic()` methods in the `Analytics` class.
|
|
143
|
+
- `Analytics.annotate()` method now supports passing custom parameters that should be used when annotating the text.
|
|
144
|
+
- Changed some defaults in the returned data. When searching articles, we now by default return article image and sentiment.
|
|
145
|
+
- Analytics. updated `trainTopicOnTweets()`, `trainTopicClearTopic()` and `trainTopicGetTrainedTopic()` methods in the `Analytics` class.
|
|
146
|
+
- `QueryArticles.initWithComplexQuery()` was updated - the parameter `dataType` was removed (since the `dataType` value should be provided in the `$filter` section of the query)
|
|
147
|
+
- `TopicPage` now supports setting also the source rank percentile
|
|
148
|
+
- `Analytics.extractArticleInfo` now also supports setting the headers and cookies to be used when making the requests
|
|
149
|
+
|
|
150
|
+
**Removed**
|
|
151
|
+
|
|
152
|
+
- removed `EventRegistry.suggestCustomConcepts()` and `EventRegistry.getCustomConceptUri()` methods. Not used anymore since we are not supporting anymore the correlation feature.
|
|
153
|
+
|
|
154
|
+
## [v8.5.13]() (2018-10-10)
|
|
155
|
+
|
|
156
|
+
**Changed**
|
|
157
|
+
- Better exposure of Typescript type definitions (affects Typescript users)
|
|
158
|
+
|
|
159
|
+
## [v8.5.1]() (2018-09-17)
|
|
160
|
+
|
|
161
|
+
**Changed**
|
|
162
|
+
- A couple of minor fixes and improvements for examples and other minor things
|
|
163
|
+
|
|
164
|
+
## [v8.5.0]() (2018-09-14)
|
|
165
|
+
|
|
166
|
+
**Added**
|
|
167
|
+
- Added `Analytics.trainTopicOnTweets()` method that can be used to train a topic by analyzing a group of tweets. See example of usage on the [wiki page](https://github.com/EventRegistry/event-registry-python/wiki/Text-analytics#train-a-topic-based-on-the-tweets).
|
|
168
|
+
- Added a group of `Analytics.trainTopic*()` methods that can be used to analyze your own documents and build a topic from them. See example of usage on the [wiki page](https://github.com/EventRegistry/event-registry-python/wiki/Text-analytics#train-a-custom-topic).
|
|
169
|
+
|
|
170
|
+
## [v8.4.0]() (2018-09-13)
|
|
171
|
+
|
|
172
|
+
**Added**
|
|
173
|
+
- added searching of articles and events based on article authors. You can now provide `authorUri` parameter when creating the `QueryArticles` and `QueryEvents` instances.
|
|
174
|
+
- added author related methods to `EventRegistry` class: `EventRegistry.suggestAuthors()` to obtain uris of authors for given (partial) name and `EventRegistry.getAuthorUri()` to obtain a single author uri for the given (partial) name.
|
|
175
|
+
- added ability to search articles and events by authors. `QueryArticles` and `QueryEvents` constructors now also accept `authorUri` parameter that can be used to limit the results to articles/events by those authors. Use `QueryOper.AND()` or `QueryOper.OR()` to specify multiple authors in the same query.
|
|
176
|
+
- BETA: added a filter for returning only articles that are written by sources that have a certain ranking. The filter can be specified by setting the parameters `startSourceRankPercentile` and `endSourceRankPercentile` when creating the `QueryArticles` instance. The default value for `startSourceRankPercentile` is 0 and for `endSourceRankPercentile` is 100. The values that can be set are not any value between 0 and 100 but has to be a number divisible by 10. By setting `startSourceRankPercentile` to 0 and `endSourceRankPercentile` to 20 you would get only articles from top ranked news sources (according to [Alexa site ranking](https://www.alexa.com/siteinfo)) that would amount to about *approximately 20%* of all matching content. Note: 20 percentiles do not represent 20% of all top sources. The value is used to identify the subset of news sources that generate approximately 20% of our collected news content. The reason for this choice is that top ranked 10% of news sources writes about 30% of all news content and our choice normalizes this effect. This feature could potentially change in the future.
|
|
177
|
+
- `QueryEventArticlesIter` is now able to return only a subset of articles assigned to an event. You can use the same filters as with the `QueryArticles` constructor and you can specify them when constructing the instance of `QueryEventArticlesIter`. The same kind of filtering is also possible if you want to use the `RequestEventArticles()` class instead.
|
|
178
|
+
- added some parameters and changed default values in some of the result types to reflect the backend changes.
|
|
179
|
+
- added optional parameter `proxyUrl` to `Analytics.extractArticleInfo()`. It can be used to download article info through a proxy that you provide (to avoid potential GDPR issues). The `proxyUrl` should be in format `{schema}://{username}:{pass}@{proxy url/ip}`.
|
|
180
|
+
|
|
181
|
+
## [v8.3.12]() (2018-08-16)
|
|
182
|
+
|
|
183
|
+
**Added**
|
|
184
|
+
- Added `getUsageInfo` method which returns usage information. It returns an object with two properties: availableTokens and usedTokens
|
|
185
|
+
|
|
186
|
+
## [v8.3.11]() (2018-08-13)
|
|
187
|
+
|
|
188
|
+
**Added**
|
|
189
|
+
- Missing utility methods`getRemainingAvailableRequests`, `getDailyAvailableRequests`, `getLastHeaders` and `getLastHeader`.
|
|
190
|
+
|
|
191
|
+
## [v8.3.1]() (2018-08-06)
|
|
192
|
+
|
|
193
|
+
**Changed**
|
|
194
|
+
- Switched to POST requests instead of GET
|
|
195
|
+
|
|
196
|
+
## [v8.3.0]() (2018-08-06)
|
|
197
|
+
|
|
198
|
+
**Added**
|
|
199
|
+
- Implemented all the latest changes as seen in the Python SDK 8.3.0.
|
|
200
|
+
|
|
201
|
+
**Breaking**
|
|
202
|
+
- `QueryArticlesIter`, `QueryEventArticlesIter` and `QueryEventsIter` now return one item at a time instead of the whole page (array) of items.
|
|
203
|
+
|
|
204
|
+
**Changed**
|
|
205
|
+
- Updated to Typescript 3.0.
|
|
206
|
+
- Version bump to be more inline with the Python SDK versioning
|
|
207
|
+
- It's no longer possible to specify batch sizes for `QueryArticlesIter`, `QueryEventArticlesIter` and `QueryEventsIter`.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014 gregorleban
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 gregorleban
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/MIGRATION.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Migrating to eventregistry 10.0.0
|
|
2
|
+
|
|
3
|
+
This guide covers moving from **`9.1.1`** (the last version on npm) to **`10.0.0`**. Read the [CHANGELOG](CHANGELOG.md) for the itemized list; this document explains the *why* and shows copy-paste examples.
|
|
4
|
+
|
|
5
|
+
There was no published `9.1.2` or `11.0.0`. Everything that landed on `development` after `9.1.1` ships as this major.
|
|
6
|
+
|
|
7
|
+
## TL;DR
|
|
8
|
+
|
|
9
|
+
- **Classic class names still work.** `EventRegistry`, `QueryArticles`, `QueryEvents`, `RequestArticlesInfo`, iterators, complex queries, `execQuery()` were not removed or renamed. See [Classic API (fully supported)](README.md#classic-api-fully-supported) in the README.
|
|
10
|
+
- **Upgrade Node first.** `9.1.1` ran on Node 5+ via Axios. `10.0.0` needs **Node.js 18+** (`fetch`). Then bump the package, run your tests, ship.
|
|
11
|
+
- Several **defaults and return shapes changed** (HTTPS hosts, delay `0.5s`, retry `-1`, `GetRecentEvents` array + cursor, `error` as a string). Those are in [section 1](#1-classic-api--still-supported-runtime-defaults-changed).
|
|
12
|
+
- New in 10.0.0: an optional ergonomic surface (`er.articles`, `searchArticles()`, `conceptUri()`, …) that wraps the same classic classes.
|
|
13
|
+
- Under the hood: Axios → native `fetch`, Winston → a lightweight built-in `Logger`, moment → `Date`, dual CJS/ESM, TypeScript `strict`.
|
|
14
|
+
|
|
15
|
+
## 1. Classic API — still supported; runtime defaults changed
|
|
16
|
+
|
|
17
|
+
This `9.1.1` pattern is still valid:
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import { EventRegistry, QueryArticles, RequestArticlesInfo, QueryArticlesIter } from "eventregistry";
|
|
21
|
+
|
|
22
|
+
const er = new EventRegistry({ apiKey: "YOUR_API_KEY" });
|
|
23
|
+
|
|
24
|
+
const conceptUri = await er.getConceptUri("Barack Obama");
|
|
25
|
+
const q = new QueryArticles({ conceptUri });
|
|
26
|
+
q.setRequestedResult(new RequestArticlesInfo({ count: 30, sortBy: "date" }));
|
|
27
|
+
const response = await er.execQuery(q);
|
|
28
|
+
|
|
29
|
+
const iter = new QueryArticlesIter(er, { conceptUri, maxItems: 500 });
|
|
30
|
+
iter.execQuery((article) => console.info(article));
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`Query*` / `Request*` / `execQuery()` / `get*Uri()` (still `undefined` on no match) keep their names. What **does** change vs `9.1.1` if you relied on defaults or internals:
|
|
34
|
+
|
|
35
|
+
| `9.1.1` | `10.0.0` |
|
|
36
|
+
|---|---|
|
|
37
|
+
| Node `engines: >=5`, Axios | Node **18+**, native `fetch` |
|
|
38
|
+
| Default host `http://eventregistry.org` | `https://eventregistry.org` |
|
|
39
|
+
| `minDelayBetweenRequests: 1` (often ineffective) | `0.5` seconds, actually throttled |
|
|
40
|
+
| `repeatFailedRequestCount: 2` | `-1` (retry indefinitely, except stop codes and non-HTTP errors) |
|
|
41
|
+
| `getLastHeaders()` Axios dict | Fetch `Headers` — use `.get("x-ratelimit-remaining")` |
|
|
42
|
+
| `response.error` sometimes an `Error` (`JSON.stringify` → `{}`) | `error` is a **string** |
|
|
43
|
+
| `GetRecentEvents.getUpdates()` → `activity \|\| {}`, no cursor | **array** (`[]` if missing), advances `newestUri` like `GetRecentArticles` |
|
|
44
|
+
| `er.logger` was Winston | same `logLevel` API; no Winston transports |
|
|
45
|
+
|
|
46
|
+
`GetRecentArticles` already used `lang` (not `articleLang`) in `9.1.1`. If you still pass `articleLang`, it is **not** mapped to `recentActivityArticlesLang`.
|
|
47
|
+
|
|
48
|
+
## 2. Recommended: fluent + helpers
|
|
49
|
+
|
|
50
|
+
`10.0.0` adds a thin ergonomic layer on top of the same classes above. It's optional, additive, and every call still goes through the same classic classes and the same HTTP path.
|
|
51
|
+
|
|
52
|
+
### Articles
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import { EventRegistry, searchArticles, conceptUri } from "eventregistry";
|
|
56
|
+
|
|
57
|
+
const er = new EventRegistry({ apiKey: "YOUR_API_KEY" });
|
|
58
|
+
|
|
59
|
+
// one-shot search + fetch (helper function)
|
|
60
|
+
const uri = await conceptUri(er, "Barack Obama"); // throws if no match is found
|
|
61
|
+
const response = await searchArticles(er, { conceptUri: uri, count: 30, sortBy: "date" });
|
|
62
|
+
|
|
63
|
+
// same thing, fluent style
|
|
64
|
+
const response2 = await er.articles
|
|
65
|
+
.search({ conceptUri: await er.concepts.uri("Barack Obama") })
|
|
66
|
+
.info({ count: 30, sortBy: "date" })
|
|
67
|
+
.exec();
|
|
68
|
+
|
|
69
|
+
// single article
|
|
70
|
+
const article = await er.articles.get("some-article-uri");
|
|
71
|
+
|
|
72
|
+
// auto-paging iterator (returns an AsyncIterable, same paging as QueryArticlesIter)
|
|
73
|
+
for await (const item of er.articles.iterate({ conceptUri: uri, maxItems: 500 })) {
|
|
74
|
+
console.info(item);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`conceptUri()` / `er.concepts.uri()` **throw** (instead of resolving to `undefined`) when no concept matches the label — this makes the non-optional `Promise<string>` return type honest and lets you `try`/`catch` a "not found" case explicitly instead of getting an `undefined` uri deep in a query. The same throw-on-miss behavior applies to `categoryUri`, `sourceUri`, `sourceGroupUri`, `locationUri`, `eventTypeUri`, `conceptClassUri`, and `authorUri` (and their `er.categories.uri`, `er.sources.uri`/`.groupUri`, `er.locations.uri`, `er.eventTypes.uri`, `er.conceptClasses.uri`, `er.authors.uri` fluent equivalents).
|
|
79
|
+
|
|
80
|
+
**Do not mix** classic `await er.getConceptUri("nope")` (`undefined`) into `er.articles.search({ conceptUri })`. Falsy URIs are dropped from the query, so you can run an unscoped search. Use `er.concepts.uri()` (throws) or guard the classic result before searching.
|
|
81
|
+
|
|
82
|
+
### Events and mentions
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import { EventRegistry, searchEvents } from "eventregistry";
|
|
86
|
+
|
|
87
|
+
const er = new EventRegistry({ apiKey: "YOUR_API_KEY" });
|
|
88
|
+
const conceptUri = await er.concepts.uri("Star Wars");
|
|
89
|
+
|
|
90
|
+
// helper
|
|
91
|
+
const events = await searchEvents(er, { conceptUri, count: 10, sortBy: "date" });
|
|
92
|
+
|
|
93
|
+
// fluent
|
|
94
|
+
const events2 = await er.events.search({ conceptUri }).info({ count: 10, sortBy: "date" }).exec();
|
|
95
|
+
const event = await er.events.get("eng-1234567");
|
|
96
|
+
for await (const event of er.events.iterate({ conceptUri, maxItems: 300 })) {
|
|
97
|
+
console.info(event);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// mentions (beta endpoint) follow the same shape, minus a single-item `.get()`
|
|
101
|
+
const mentions = await er.mentions.search({ keywords: "inflation" }).info({ count: 20 }).exec();
|
|
102
|
+
for await (const mention of er.mentions.iterate({ keywords: "inflation", maxItems: 200 })) {
|
|
103
|
+
console.info(mention);
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The mentions filter field is **`keywords`**, not `keyword`.
|
|
108
|
+
|
|
109
|
+
### Everything else
|
|
110
|
+
|
|
111
|
+
The ergonomic layer wraps the common-case path: `*Info` search, iterate, single-item get, and the `Get*` / `Analytics` one-shot classes. Aggregations (`RequestArticlesConceptAggr`, …), complex queries, `QueryEventArticlesIter`, suggest/URI extras, and `ArticleMapper` stay on the classic classes.
|
|
112
|
+
|
|
113
|
+
| Domain | Fluent | Helper functions |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| Stories | `er.stories.get(uri)` | `getStory` |
|
|
116
|
+
| Trends | `er.trends.concepts()`, `.categories()`, `.customItems()`, `.conceptGroups()` | `getTrendingConcepts`, `getTrendingCategories`, `getTrendingCustomItems`, `getTrendingConceptGroups` |
|
|
117
|
+
| Counts | `er.counts.get()`, `.ex()` | `getCounts`, `getCountsEx` |
|
|
118
|
+
| Social shares | `er.shares.articles()`, `.events()` | `getTopSharedArticles`, `getTopSharedEvents` |
|
|
119
|
+
| Recent activity | `er.recent.events()`, `.articles()` | `getRecentEvents`, `getRecentArticles` |
|
|
120
|
+
| Info lookups | `er.info.source()`, `.concept()`, `.category()`, `.sourceStats()` | `getSourceInfo`, `getConceptInfo`, `getCategoryInfo`, `getSourceStats` |
|
|
121
|
+
| Topic pages | `er.topicPages.mine()`, `.load()`, `.create()` | `getMyTopicPages`, `loadTopicPage`, `createTopicPage` |
|
|
122
|
+
| Analytics | `er.analytics.annotate()`, `.categorize()`, `.sentiment()`, `.semanticSimilarity()`, `.detectLanguage()`, `.extractArticleInfo()`, `.ner()`, `.trainTopic*()` | `annotateText`, `categorizeText`, `analyzeSentiment`, `semanticSimilarity`, `detectLanguage`, `extractArticleInfo`, `ner`, `trainTopicOnTweets`, `trainTopicCreateTopic`, `trainTopicClearTopic`, `trainTopicAddDocument`, `trainTopicGetTrainedTopic` |
|
|
123
|
+
| Event-for-text | `er.eventForText(text, lang?, nrOfEventsToReturn?)` (directly callable) | `getEventForText` |
|
|
124
|
+
|
|
125
|
+
`er.info.concept()` / helper `getConceptInfo(er, { uriOrUriList })` wrap the `GetConceptInfo` class (`/api/v1/concept`). That is **not** the same call as the classic instance method `er.getConceptInfo(uri)` (`/api/v1/concept/getInfo`, richer default flags).
|
|
126
|
+
|
|
127
|
+
Every fluent method and helper function is a thin wrapper — same request shape, same response shape, same underlying `Query*`/`Get*`/`Request*` class as the classic API. Mix classic and fluent freely **except** URI resolution (throw vs `undefined`, above).
|
|
128
|
+
|
|
129
|
+
## 3. TypeScript: `strict` mode and tighter `.d.ts`
|
|
130
|
+
|
|
131
|
+
The library's own source now compiles under TypeScript `strict` mode. Consequences for consumers:
|
|
132
|
+
|
|
133
|
+
- Emitted `.d.ts` files are more precise — fewer `any`s, more accurate optional/`undefined` handling on response and argument shapes. If your project also runs under `strict`, you may see new (usually correct) type errors surface at your call sites — most are `possibly undefined` warnings on fields that were always optional at runtime but weren't typed as such before.
|
|
134
|
+
- If your project is **not** under `strict`, nothing changes for you at compile time; the emitted `.d.ts` is a superset-compatible refinement, not a breaking shape change.
|
|
135
|
+
- The library's own `strict` mode is internal — it doesn't force your project to enable `strict`. Enable it on your own timeline.
|
|
136
|
+
- Spot check any code that relied on a field always being present that's now typed as optional (e.g. narrow with `if (x)` or `??` where TypeScript now asks you to).
|
|
137
|
+
|
|
138
|
+
## 4. HTTP transport: Axios removed, `fetch` required
|
|
139
|
+
|
|
140
|
+
`9.1.1` used a per-instance Axios client. `10.0.0` replaces it with the platform `fetch` API (retry/timeout/mutex — see `src/http.ts`).
|
|
141
|
+
|
|
142
|
+
- **Node.js 18+ is a hard requirement** — `fetch`/`Headers`/`AbortController` are global built-ins starting with Node 18. There is no polyfill bundled.
|
|
143
|
+
- Axios is no longer a dependency — smaller install, no transitive Axios CVEs to track.
|
|
144
|
+
- Stop-status-code list (`204`, `400`, `401`, `403`, `530`) does not retry. Transient HTTP/network failures still retry (`repeatFailedRequestCount: -1` by default). Invalid JSON bodies and JSON parse failures on HTTP 200 fail immediately instead of looping.
|
|
145
|
+
- If you were reaching into Axios-specific error shapes (`error.response`, `error.isAxiosError`, interceptors, etc.) anywhere in your own error handling, update those call sites — `jsonRequest` still swallows transport failures into `{ error: string, … }` rather than throwing an Axios error. `getLastHeaders()` is a Fetch `Headers` object.
|
|
146
|
+
|
|
147
|
+
## 5. Logging: Winston removed, `Logger`/`LogLevel` API unchanged
|
|
148
|
+
|
|
149
|
+
Winston is gone; `Logger` is now a small dependency-free class (`src/logger.ts`) writing to `logs/` or the console. The public surface you use is **identical**:
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { LogLevel } from "eventregistry";
|
|
153
|
+
|
|
154
|
+
er.logger.logLevel = LogLevel.DEBUG;
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
`new EventRegistry({ logging: true })`, `er.logger`, `LogLevel.{ERROR,WARN,INFO,DEBUG,REQUEST}` all behave the same as `9.1.1` for this API. If you never configured a custom Winston transport against this package's logger, there is nothing to change. If you did attach custom Winston transports/formats directly to this library's logger instance, that integration point no longer exists — the replacement `Logger` only supports `logging` toggles and `logLevel`. Two `EventRegistry` instances no longer share one process-wide Winston singleton.
|
|
158
|
+
|
|
159
|
+
## 6. Package/build changes
|
|
160
|
+
|
|
161
|
+
- `package.json` now declares dual `exports` (`import`/`require`, each with `types`) — no change needed on your end; `import { EventRegistry } from "eventregistry"` and `const { EventRegistry } = require("eventregistry")` both keep working.
|
|
162
|
+
- Runtime dependencies are gone (Axios, Winston, moment, `semaphore-async-await`).
|
|
163
|
+
- Offline unit tests moved from ad-hoc scripts to Vitest (`npm run test:unit`); irrelevant to consumers, only affects contributors.
|
|
164
|
+
|
|
165
|
+
## Checklist
|
|
166
|
+
|
|
167
|
+
- [ ] Confirm your runtime is Node.js 18+.
|
|
168
|
+
- [ ] Upgrade `eventregistry` to `10.0.0`.
|
|
169
|
+
- [ ] `npm install` (removes Axios/Winston/moment transitive deps automatically).
|
|
170
|
+
- [ ] Re-check constructors that relied on `http://` hosts, delay `1`, or retry `2`.
|
|
171
|
+
- [ ] If you poll `GetRecentEvents.getUpdates()`, treat the result as an array and expect the cursor to advance.
|
|
172
|
+
- [ ] If you read `getLastHeaders()` as a dict or `response.error instanceof Error`, update those call sites (section 4).
|
|
173
|
+
- [ ] If you attached custom Winston transports to this package's logger, update those call sites (section 5).
|
|
174
|
+
- [ ] Run your test suite.
|
|
175
|
+
- [ ] Optionally, start using `er.articles`/`er.events`/`searchArticles()`/`conceptUri()` etc. in new code — no rush; classic and fluent can live side by side. Use `keywords` (not `keyword`) for mentions.
|
|
176
|
+
|
|
177
|
+
See also: [README — Classic API (fully supported)](README.md#classic-api-fully-supported), [CHANGELOG](CHANGELOG.md).
|