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.
Files changed (450) hide show
  1. package/AGENT-RECIPES.md +86 -0
  2. package/CHANGELOG.md +254 -0
  3. package/LICENSE +21 -21
  4. package/MIGRATION.md +195 -0
  5. package/README.md +340 -234
  6. package/dist/cjs/abort.d.ts +14 -0
  7. package/dist/cjs/abort.js +71 -0
  8. package/dist/cjs/abort.js.map +1 -0
  9. package/dist/{analytics.d.ts → cjs/analytics.d.ts} +2 -1
  10. package/dist/cjs/analytics.js +174 -0
  11. package/dist/cjs/analytics.js.map +1 -0
  12. package/dist/{base.d.ts → cjs/base.d.ts} +9 -9
  13. package/dist/cjs/base.js +195 -0
  14. package/dist/cjs/base.js.map +1 -0
  15. package/dist/cjs/counts.js +120 -0
  16. package/dist/cjs/counts.js.map +1 -0
  17. package/dist/cjs/dailyShares.js +46 -0
  18. package/dist/cjs/dailyShares.js.map +1 -0
  19. package/dist/{data.d.ts → cjs/data.d.ts} +32 -5
  20. package/dist/cjs/data.js.map +1 -0
  21. package/dist/cjs/errors.d.ts +66 -0
  22. package/dist/cjs/errors.js +75 -0
  23. package/dist/cjs/errors.js.map +1 -0
  24. package/dist/{eventForText.d.ts → cjs/eventForText.d.ts} +1 -1
  25. package/dist/cjs/eventForText.js +61 -0
  26. package/dist/cjs/eventForText.js.map +1 -0
  27. package/dist/{eventRegistry.d.ts → cjs/eventRegistry.d.ts} +167 -36
  28. package/dist/cjs/eventRegistry.js +939 -0
  29. package/dist/cjs/eventRegistry.js.map +1 -0
  30. package/dist/cjs/fluent/analytics.d.ts +24 -0
  31. package/dist/cjs/fluent/analytics.js +47 -0
  32. package/dist/cjs/fluent/analytics.js.map +1 -0
  33. package/dist/cjs/fluent/articles.d.ts +23 -0
  34. package/dist/cjs/fluent/articles.js +34 -0
  35. package/dist/cjs/fluent/articles.js.map +1 -0
  36. package/dist/cjs/fluent/counts.d.ts +8 -0
  37. package/dist/cjs/fluent/counts.js +17 -0
  38. package/dist/cjs/fluent/counts.js.map +1 -0
  39. package/dist/cjs/fluent/eventForText.d.ts +4 -0
  40. package/dist/cjs/fluent/eventForText.js +8 -0
  41. package/dist/cjs/fluent/eventForText.js.map +1 -0
  42. package/dist/cjs/fluent/events.d.ts +23 -0
  43. package/dist/cjs/fluent/events.js +34 -0
  44. package/dist/cjs/fluent/events.js.map +1 -0
  45. package/dist/cjs/fluent/info.d.ts +10 -0
  46. package/dist/cjs/fluent/info.js +23 -0
  47. package/dist/cjs/fluent/info.js.map +1 -0
  48. package/dist/cjs/fluent/mentions.d.ts +18 -0
  49. package/dist/cjs/fluent/mentions.js +31 -0
  50. package/dist/cjs/fluent/mentions.js.map +1 -0
  51. package/dist/cjs/fluent/recent.d.ts +13 -0
  52. package/dist/cjs/fluent/recent.js +21 -0
  53. package/dist/cjs/fluent/recent.js.map +1 -0
  54. package/dist/cjs/fluent/shares.d.ts +8 -0
  55. package/dist/cjs/fluent/shares.js +17 -0
  56. package/dist/cjs/fluent/shares.js.map +1 -0
  57. package/dist/cjs/fluent/stories.d.ts +8 -0
  58. package/dist/cjs/fluent/stories.js +14 -0
  59. package/dist/cjs/fluent/stories.js.map +1 -0
  60. package/dist/cjs/fluent/topicPages.d.ts +10 -0
  61. package/dist/cjs/fluent/topicPages.js +20 -0
  62. package/dist/cjs/fluent/topicPages.js.map +1 -0
  63. package/dist/cjs/fluent/trends.d.ts +11 -0
  64. package/dist/cjs/fluent/trends.js +23 -0
  65. package/dist/cjs/fluent/trends.js.map +1 -0
  66. package/dist/cjs/guards.d.ts +12 -0
  67. package/dist/cjs/guards.js +75 -0
  68. package/dist/cjs/guards.js.map +1 -0
  69. package/dist/cjs/helpers/analytics.d.ts +68 -0
  70. package/dist/cjs/helpers/analytics.js +100 -0
  71. package/dist/cjs/helpers/analytics.js.map +1 -0
  72. package/dist/cjs/helpers/articles.d.ts +24 -0
  73. package/dist/cjs/helpers/articles.js +31 -0
  74. package/dist/cjs/helpers/articles.js.map +1 -0
  75. package/dist/cjs/helpers/counts.d.ts +4 -0
  76. package/dist/cjs/helpers/counts.js +12 -0
  77. package/dist/cjs/helpers/counts.js.map +1 -0
  78. package/dist/cjs/helpers/eventForText.d.ts +6 -0
  79. package/dist/cjs/helpers/eventForText.js +13 -0
  80. package/dist/cjs/helpers/eventForText.js.map +1 -0
  81. package/dist/cjs/helpers/events.d.ts +18 -0
  82. package/dist/cjs/helpers/events.js +31 -0
  83. package/dist/cjs/helpers/events.js.map +1 -0
  84. package/dist/cjs/helpers/info.d.ts +6 -0
  85. package/dist/cjs/helpers/info.js +20 -0
  86. package/dist/cjs/helpers/info.js.map +1 -0
  87. package/dist/cjs/helpers/mentions.d.ts +10 -0
  88. package/dist/cjs/helpers/mentions.js +21 -0
  89. package/dist/cjs/helpers/mentions.js.map +1 -0
  90. package/dist/cjs/helpers/recent.d.ts +10 -0
  91. package/dist/cjs/helpers/recent.js +18 -0
  92. package/dist/cjs/helpers/recent.js.map +1 -0
  93. package/dist/cjs/helpers/shares.d.ts +4 -0
  94. package/dist/cjs/helpers/shares.js +12 -0
  95. package/dist/cjs/helpers/shares.js.map +1 -0
  96. package/dist/cjs/helpers/stories.d.ts +7 -0
  97. package/dist/cjs/helpers/stories.js +13 -0
  98. package/dist/cjs/helpers/stories.js.map +1 -0
  99. package/dist/cjs/helpers/topicPages.d.ts +16 -0
  100. package/dist/cjs/helpers/topicPages.js +29 -0
  101. package/dist/cjs/helpers/topicPages.js.map +1 -0
  102. package/dist/cjs/helpers/trends.d.ts +7 -0
  103. package/dist/cjs/helpers/trends.js +20 -0
  104. package/dist/cjs/helpers/trends.js.map +1 -0
  105. package/dist/cjs/helpers/uri.d.ts +42 -0
  106. package/dist/cjs/helpers/uri.js +78 -0
  107. package/dist/cjs/helpers/uri.js.map +1 -0
  108. package/dist/cjs/http.d.ts +23 -0
  109. package/dist/cjs/http.js +141 -0
  110. package/dist/cjs/http.js.map +1 -0
  111. package/dist/cjs/index.d.ts +54 -0
  112. package/dist/{index.js → cjs/index.js} +104 -3
  113. package/dist/cjs/index.js.map +1 -0
  114. package/dist/cjs/info.js +115 -0
  115. package/dist/cjs/info.js.map +1 -0
  116. package/dist/{logger.d.ts → cjs/logger.d.ts} +15 -11
  117. package/dist/cjs/logger.js +183 -0
  118. package/dist/cjs/logger.js.map +1 -0
  119. package/dist/cjs/mutex.d.ts +7 -0
  120. package/dist/cjs/mutex.js +44 -0
  121. package/dist/cjs/mutex.js.map +1 -0
  122. package/dist/cjs/package.json +3 -0
  123. package/dist/{query.d.ts → cjs/query.d.ts} +5 -8
  124. package/dist/cjs/query.js +248 -0
  125. package/dist/cjs/query.js.map +1 -0
  126. package/dist/{queryArticle.d.ts → cjs/queryArticle.d.ts} +5 -5
  127. package/dist/cjs/queryArticle.js +121 -0
  128. package/dist/cjs/queryArticle.js.map +1 -0
  129. package/dist/{queryArticles.d.ts → cjs/queryArticles.d.ts} +36 -69
  130. package/dist/cjs/queryArticles.js +457 -0
  131. package/dist/cjs/queryArticles.js.map +1 -0
  132. package/dist/{queryEvent.d.ts → cjs/queryEvent.d.ts} +7 -6
  133. package/dist/cjs/queryEvent.js +423 -0
  134. package/dist/cjs/queryEvent.js.map +1 -0
  135. package/dist/{queryEvents.d.ts → cjs/queryEvents.d.ts} +30 -39
  136. package/dist/cjs/queryEvents.js +568 -0
  137. package/dist/cjs/queryEvents.js.map +1 -0
  138. package/dist/cjs/queryIterator.d.ts +36 -0
  139. package/dist/cjs/queryIterator.js +85 -0
  140. package/dist/cjs/queryIterator.js.map +1 -0
  141. package/dist/{queryMentions.d.ts → cjs/queryMentions.d.ts} +19 -18
  142. package/dist/cjs/queryMentions.js +446 -0
  143. package/dist/cjs/queryMentions.js.map +1 -0
  144. package/dist/{queryStory.d.ts → cjs/queryStory.d.ts} +24 -21
  145. package/dist/cjs/queryStory.js +120 -0
  146. package/dist/cjs/queryStory.js.map +1 -0
  147. package/dist/cjs/recent.d.ts +35 -0
  148. package/dist/cjs/recent.js +81 -0
  149. package/dist/cjs/recent.js.map +1 -0
  150. package/dist/cjs/recentFeed.d.ts +35 -0
  151. package/dist/cjs/recentFeed.js +76 -0
  152. package/dist/cjs/recentFeed.js.map +1 -0
  153. package/dist/{returnInfo.d.ts → cjs/returnInfo.d.ts} +21 -23
  154. package/dist/cjs/returnInfo.js +292 -0
  155. package/dist/cjs/returnInfo.js.map +1 -0
  156. package/dist/{topicPage.d.ts → cjs/topicPage.d.ts} +3 -3
  157. package/dist/cjs/topicPage.js +458 -0
  158. package/dist/cjs/topicPage.js.map +1 -0
  159. package/dist/cjs/topicPages.d.ts +13 -0
  160. package/dist/cjs/topicPages.js +22 -0
  161. package/dist/cjs/topicPages.js.map +1 -0
  162. package/dist/{trends.d.ts → cjs/trends.d.ts} +13 -13
  163. package/dist/cjs/trends.js +64 -0
  164. package/dist/cjs/trends.js.map +1 -0
  165. package/dist/{types.d.ts → cjs/types.d.ts} +195 -37
  166. package/dist/cjs/types.js.map +1 -0
  167. package/dist/cjs/usage.d.ts +39 -0
  168. package/dist/cjs/usage.js +62 -0
  169. package/dist/cjs/usage.js.map +1 -0
  170. package/dist/cjs/version.d.ts +1 -0
  171. package/dist/cjs/version.js +5 -0
  172. package/dist/cjs/version.js.map +1 -0
  173. package/dist/esm/abort.d.ts +14 -0
  174. package/dist/esm/abort.js +65 -0
  175. package/dist/esm/abort.js.map +1 -0
  176. package/dist/esm/analytics.d.ts +83 -0
  177. package/dist/esm/analytics.js +170 -0
  178. package/dist/esm/analytics.js.map +1 -0
  179. package/dist/esm/base.d.ts +82 -0
  180. package/dist/esm/base.js +188 -0
  181. package/dist/esm/base.js.map +1 -0
  182. package/dist/esm/counts.d.ts +81 -0
  183. package/dist/esm/counts.js +114 -0
  184. package/dist/esm/counts.js.map +1 -0
  185. package/dist/esm/dailyShares.d.ts +10 -0
  186. package/dist/esm/dailyShares.js +41 -0
  187. package/dist/esm/dailyShares.js.map +1 -0
  188. package/dist/esm/data.d.ts +296 -0
  189. package/dist/esm/data.js +3 -0
  190. package/dist/esm/data.js.map +1 -0
  191. package/dist/esm/errors.d.ts +66 -0
  192. package/dist/esm/errors.js +67 -0
  193. package/dist/esm/errors.js.map +1 -0
  194. package/dist/esm/eventForText.d.ts +48 -0
  195. package/dist/esm/eventForText.js +57 -0
  196. package/dist/esm/eventForText.js.map +1 -0
  197. package/dist/esm/eventRegistry.d.ts +375 -0
  198. package/dist/esm/eventRegistry.js +901 -0
  199. package/dist/esm/eventRegistry.js.map +1 -0
  200. package/dist/esm/fluent/analytics.d.ts +24 -0
  201. package/dist/esm/fluent/analytics.js +43 -0
  202. package/dist/esm/fluent/analytics.js.map +1 -0
  203. package/dist/esm/fluent/articles.d.ts +23 -0
  204. package/dist/esm/fluent/articles.js +30 -0
  205. package/dist/esm/fluent/articles.js.map +1 -0
  206. package/dist/esm/fluent/counts.d.ts +8 -0
  207. package/dist/esm/fluent/counts.js +13 -0
  208. package/dist/esm/fluent/counts.js.map +1 -0
  209. package/dist/esm/fluent/eventForText.d.ts +4 -0
  210. package/dist/esm/fluent/eventForText.js +5 -0
  211. package/dist/esm/fluent/eventForText.js.map +1 -0
  212. package/dist/esm/fluent/events.d.ts +23 -0
  213. package/dist/esm/fluent/events.js +30 -0
  214. package/dist/esm/fluent/events.js.map +1 -0
  215. package/dist/esm/fluent/info.d.ts +10 -0
  216. package/dist/esm/fluent/info.js +19 -0
  217. package/dist/esm/fluent/info.js.map +1 -0
  218. package/dist/esm/fluent/mentions.d.ts +18 -0
  219. package/dist/esm/fluent/mentions.js +27 -0
  220. package/dist/esm/fluent/mentions.js.map +1 -0
  221. package/dist/esm/fluent/recent.d.ts +13 -0
  222. package/dist/esm/fluent/recent.js +17 -0
  223. package/dist/esm/fluent/recent.js.map +1 -0
  224. package/dist/esm/fluent/shares.d.ts +8 -0
  225. package/dist/esm/fluent/shares.js +13 -0
  226. package/dist/esm/fluent/shares.js.map +1 -0
  227. package/dist/esm/fluent/stories.d.ts +8 -0
  228. package/dist/esm/fluent/stories.js +10 -0
  229. package/dist/esm/fluent/stories.js.map +1 -0
  230. package/dist/esm/fluent/topicPages.d.ts +10 -0
  231. package/dist/esm/fluent/topicPages.js +16 -0
  232. package/dist/esm/fluent/topicPages.js.map +1 -0
  233. package/dist/esm/fluent/trends.d.ts +11 -0
  234. package/dist/esm/fluent/trends.js +19 -0
  235. package/dist/esm/fluent/trends.js.map +1 -0
  236. package/dist/esm/guards.d.ts +12 -0
  237. package/dist/esm/guards.js +70 -0
  238. package/dist/esm/guards.js.map +1 -0
  239. package/dist/esm/helpers/analytics.d.ts +68 -0
  240. package/dist/esm/helpers/analytics.js +86 -0
  241. package/dist/esm/helpers/analytics.js.map +1 -0
  242. package/dist/esm/helpers/articles.d.ts +24 -0
  243. package/dist/esm/helpers/articles.js +26 -0
  244. package/dist/esm/helpers/articles.js.map +1 -0
  245. package/dist/esm/helpers/counts.d.ts +4 -0
  246. package/dist/esm/helpers/counts.js +8 -0
  247. package/dist/esm/helpers/counts.js.map +1 -0
  248. package/dist/esm/helpers/eventForText.d.ts +6 -0
  249. package/dist/esm/helpers/eventForText.js +10 -0
  250. package/dist/esm/helpers/eventForText.js.map +1 -0
  251. package/dist/esm/helpers/events.d.ts +18 -0
  252. package/dist/esm/helpers/events.js +26 -0
  253. package/dist/esm/helpers/events.js.map +1 -0
  254. package/dist/esm/helpers/info.d.ts +6 -0
  255. package/dist/esm/helpers/info.js +14 -0
  256. package/dist/esm/helpers/info.js.map +1 -0
  257. package/dist/esm/helpers/mentions.d.ts +10 -0
  258. package/dist/esm/helpers/mentions.js +17 -0
  259. package/dist/esm/helpers/mentions.js.map +1 -0
  260. package/dist/esm/helpers/recent.d.ts +10 -0
  261. package/dist/esm/helpers/recent.js +14 -0
  262. package/dist/esm/helpers/recent.js.map +1 -0
  263. package/dist/esm/helpers/shares.d.ts +4 -0
  264. package/dist/esm/helpers/shares.js +8 -0
  265. package/dist/esm/helpers/shares.js.map +1 -0
  266. package/dist/esm/helpers/stories.d.ts +7 -0
  267. package/dist/esm/helpers/stories.js +10 -0
  268. package/dist/esm/helpers/stories.js.map +1 -0
  269. package/dist/esm/helpers/topicPages.d.ts +16 -0
  270. package/dist/esm/helpers/topicPages.js +24 -0
  271. package/dist/esm/helpers/topicPages.js.map +1 -0
  272. package/dist/esm/helpers/trends.d.ts +7 -0
  273. package/dist/esm/helpers/trends.js +14 -0
  274. package/dist/esm/helpers/trends.js.map +1 -0
  275. package/dist/esm/helpers/uri.d.ts +42 -0
  276. package/dist/esm/helpers/uri.js +68 -0
  277. package/dist/esm/helpers/uri.js.map +1 -0
  278. package/dist/esm/http.d.ts +23 -0
  279. package/dist/esm/http.js +138 -0
  280. package/dist/esm/http.js.map +1 -0
  281. package/dist/esm/index.d.ts +54 -0
  282. package/dist/esm/index.js +51 -0
  283. package/dist/esm/index.js.map +1 -0
  284. package/dist/esm/info.d.ts +61 -0
  285. package/dist/esm/info.js +108 -0
  286. package/dist/esm/info.js.map +1 -0
  287. package/dist/esm/logger.d.ts +49 -0
  288. package/dist/esm/logger.js +146 -0
  289. package/dist/esm/logger.js.map +1 -0
  290. package/dist/esm/mutex.d.ts +7 -0
  291. package/dist/esm/mutex.js +40 -0
  292. package/dist/esm/mutex.js.map +1 -0
  293. package/dist/esm/package.json +3 -0
  294. package/dist/esm/query.d.ts +50 -0
  295. package/dist/esm/query.js +240 -0
  296. package/dist/esm/query.js.map +1 -0
  297. package/dist/esm/queryArticle.d.ts +61 -0
  298. package/dist/esm/queryArticle.js +112 -0
  299. package/dist/esm/queryArticle.js.map +1 -0
  300. package/dist/esm/queryArticles.d.ts +111 -0
  301. package/dist/esm/queryArticles.js +439 -0
  302. package/dist/esm/queryArticles.js.map +1 -0
  303. package/dist/esm/queryEvent.d.ts +141 -0
  304. package/dist/esm/queryEvent.js +409 -0
  305. package/dist/esm/queryEvent.js.map +1 -0
  306. package/dist/esm/queryEvents.d.ts +201 -0
  307. package/dist/esm/queryEvents.js +546 -0
  308. package/dist/esm/queryEvents.js.map +1 -0
  309. package/dist/esm/queryIterator.d.ts +36 -0
  310. package/dist/esm/queryIterator.js +81 -0
  311. package/dist/esm/queryIterator.js.map +1 -0
  312. package/dist/esm/queryMentions.d.ts +97 -0
  313. package/dist/esm/queryMentions.js +431 -0
  314. package/dist/esm/queryMentions.js.map +1 -0
  315. package/dist/esm/queryStory.d.ts +61 -0
  316. package/dist/esm/queryStory.js +110 -0
  317. package/dist/esm/queryStory.js.map +1 -0
  318. package/dist/esm/recent.d.ts +35 -0
  319. package/dist/esm/recent.js +76 -0
  320. package/dist/esm/recent.js.map +1 -0
  321. package/dist/esm/recentFeed.d.ts +35 -0
  322. package/dist/esm/recentFeed.js +70 -0
  323. package/dist/esm/recentFeed.js.map +1 -0
  324. package/dist/esm/returnInfo.d.ts +66 -0
  325. package/dist/esm/returnInfo.js +245 -0
  326. package/dist/esm/returnInfo.js.map +1 -0
  327. package/dist/esm/topicPage.d.ts +157 -0
  328. package/dist/esm/topicPage.js +421 -0
  329. package/dist/esm/topicPage.js.map +1 -0
  330. package/dist/esm/topicPages.d.ts +13 -0
  331. package/dist/esm/topicPages.js +18 -0
  332. package/dist/esm/topicPages.js.map +1 -0
  333. package/dist/esm/trends.d.ts +35 -0
  334. package/dist/esm/trends.js +56 -0
  335. package/dist/esm/trends.js.map +1 -0
  336. package/dist/esm/types.d.ts +2611 -0
  337. package/dist/esm/types.js +2 -0
  338. package/dist/esm/types.js.map +1 -0
  339. package/dist/esm/usage.d.ts +39 -0
  340. package/dist/esm/usage.js +58 -0
  341. package/dist/esm/usage.js.map +1 -0
  342. package/dist/esm/version.d.ts +1 -0
  343. package/dist/esm/version.js +2 -0
  344. package/dist/esm/version.js.map +1 -0
  345. package/package.json +80 -42
  346. package/src/abort.ts +70 -0
  347. package/src/analytics.ts +197 -0
  348. package/src/base.ts +206 -0
  349. package/src/counts.ts +118 -0
  350. package/src/dailyShares.ts +46 -0
  351. package/src/data.ts +310 -0
  352. package/src/errors.ts +105 -0
  353. package/src/eventForText.ts +60 -0
  354. package/src/eventRegistry.ts +1105 -0
  355. package/src/fluent/analytics.ts +84 -0
  356. package/src/fluent/articles.ts +40 -0
  357. package/src/fluent/counts.ts +15 -0
  358. package/src/fluent/eventForText.ts +10 -0
  359. package/src/fluent/events.ts +40 -0
  360. package/src/fluent/info.ts +23 -0
  361. package/src/fluent/mentions.ts +34 -0
  362. package/src/fluent/recent.ts +19 -0
  363. package/src/fluent/shares.ts +15 -0
  364. package/src/fluent/stories.ts +12 -0
  365. package/src/fluent/topicPages.ts +20 -0
  366. package/src/fluent/trends.ts +34 -0
  367. package/src/guards.ts +79 -0
  368. package/src/helpers/analytics.ts +134 -0
  369. package/src/helpers/articles.ts +42 -0
  370. package/src/helpers/counts.ts +19 -0
  371. package/src/helpers/eventForText.ts +16 -0
  372. package/src/helpers/events.ts +43 -0
  373. package/src/helpers/info.ts +31 -0
  374. package/src/helpers/mentions.ts +27 -0
  375. package/src/helpers/recent.ts +22 -0
  376. package/src/helpers/shares.ts +17 -0
  377. package/src/helpers/stories.ts +16 -0
  378. package/src/helpers/topicPages.ts +28 -0
  379. package/src/helpers/trends.ts +36 -0
  380. package/src/helpers/uri.ts +78 -0
  381. package/src/http.ts +169 -0
  382. package/src/index.ts +212 -0
  383. package/src/info.ts +120 -0
  384. package/src/logger.ts +182 -0
  385. package/src/mutex.ts +40 -0
  386. package/src/query.ts +258 -0
  387. package/src/queryArticle.ts +139 -0
  388. package/src/queryArticles.ts +584 -0
  389. package/src/queryEvent.ts +510 -0
  390. package/src/queryEvents.ts +673 -0
  391. package/src/queryIterator.ts +100 -0
  392. package/src/queryMentions.ts +559 -0
  393. package/src/queryStory.ts +159 -0
  394. package/src/recent.ts +98 -0
  395. package/src/recentFeed.ts +91 -0
  396. package/src/returnInfo.ts +372 -0
  397. package/src/topicPage.ts +485 -0
  398. package/src/topicPages.ts +18 -0
  399. package/src/trends.ts +62 -0
  400. package/src/types.ts +2737 -0
  401. package/src/usage.ts +79 -0
  402. package/src/version.ts +1 -0
  403. package/dist/analytics.js +0 -337
  404. package/dist/analytics.js.map +0 -1
  405. package/dist/base.js +0 -262
  406. package/dist/base.js.map +0 -1
  407. package/dist/counts.js +0 -163
  408. package/dist/counts.js.map +0 -1
  409. package/dist/dailyShares.js +0 -91
  410. package/dist/dailyShares.js.map +0 -1
  411. package/dist/data.js.map +0 -1
  412. package/dist/eventForText.js +0 -127
  413. package/dist/eventForText.js.map +0 -1
  414. package/dist/eventRegistry.js +0 -1099
  415. package/dist/eventRegistry.js.map +0 -1
  416. package/dist/index.d.ts +0 -21
  417. package/dist/index.js.map +0 -1
  418. package/dist/info.js +0 -172
  419. package/dist/info.js.map +0 -1
  420. package/dist/logger.js +0 -156
  421. package/dist/logger.js.map +0 -1
  422. package/dist/query.js +0 -334
  423. package/dist/query.js.map +0 -1
  424. package/dist/queryArticle.js +0 -184
  425. package/dist/queryArticle.js.map +0 -1
  426. package/dist/queryArticles.js +0 -730
  427. package/dist/queryArticles.js.map +0 -1
  428. package/dist/queryEvent.js +0 -588
  429. package/dist/queryEvent.js.map +0 -1
  430. package/dist/queryEvents.js +0 -826
  431. package/dist/queryEvents.js.map +0 -1
  432. package/dist/queryMentions.js +0 -638
  433. package/dist/queryMentions.js.map +0 -1
  434. package/dist/queryStory.js +0 -195
  435. package/dist/queryStory.js.map +0 -1
  436. package/dist/recent.d.ts +0 -23
  437. package/dist/recent.js +0 -200
  438. package/dist/recent.js.map +0 -1
  439. package/dist/returnInfo.js +0 -333
  440. package/dist/returnInfo.js.map +0 -1
  441. package/dist/topicPage.js +0 -600
  442. package/dist/topicPage.js.map +0 -1
  443. package/dist/trends.js +0 -116
  444. package/dist/trends.js.map +0 -1
  445. package/dist/types.js.map +0 -1
  446. /package/dist/{counts.d.ts → cjs/counts.d.ts} +0 -0
  447. /package/dist/{dailyShares.d.ts → cjs/dailyShares.d.ts} +0 -0
  448. /package/dist/{data.js → cjs/data.js} +0 -0
  449. /package/dist/{info.d.ts → cjs/info.d.ts} +0 -0
  450. /package/dist/{types.js → cjs/types.js} +0 -0
@@ -0,0 +1,86 @@
1
+ # Recipes for agents and automated pipelines
2
+
3
+ Programs that read news on their own, such as agents, monitors and enrichment jobs, share a few needs: spend tokens on purpose, stop when told to, and survive a flaky network. This page shows the pattern we recommend and the SDK options that support it. Everything here uses plain SDK calls; a runnable version is in [`examples/agentRecipesExamples.ts`](examples/agentRecipesExamples.ts).
4
+
5
+ ## Suggest, scan, triage, retrieve
6
+
7
+ Most questions can be answered by reading a handful of articles out of hundreds. Reading all of them is slow and costs tokens, so work in four steps, each cheaper than the next.
8
+
9
+ 1. **Suggest.** Turn names into Event Registry URIs. A concept URI is far more precise than a keyword, because it already separates "Apple" the company from the fruit.
10
+
11
+ ```ts
12
+ const conceptUri = await er.concepts.uri("Tesla"); // throws if nothing matches
13
+ ```
14
+
15
+ 2. **Scan.** Fetch many articles but only their titles. Set `bodyLen: 0` in `ArticleInfoFlags` so no body text is returned, and set `isDuplicateFilter: "skipDuplicates"` so a wire story that 40 outlets copied appears once.
16
+
17
+ ```ts
18
+ const titlesOnly = new ReturnInfo({ articleInfo: new ArticleInfoFlags({ bodyLen: 0 }) });
19
+ const response = await er.articles
20
+ .search({ conceptUri, lang: "eng", isDuplicateFilter: "skipDuplicates" })
21
+ .info({ count: 100, returnInfo: titlesOnly })
22
+ .exec();
23
+ ```
24
+
25
+ If the scan returns fewer than about 20 rows, widen or tighten the filter once (for example `keywordLoc: "title"`, or a different `sortBy`) instead of repeating the search with reworded keywords. Each search costs tokens.
26
+
27
+ 3. **Triage.** Read the titles and choose the articles worth a full read. This is the step where your agent or your own code decides; the SDK is not involved. Keep the article URIs, discard the rest.
28
+
29
+ 4. **Retrieve.** Ask for full details of the chosen URIs only. `QueryArticle` accepts a list of up to 100 URIs, so one call is enough.
30
+
31
+ ```ts
32
+ const details = await er.execQuery(new QueryArticle(uris, new RequestArticleInfo()));
33
+ ```
34
+
35
+ The same pattern works for events: scan with `er.events.search(...)`, triage on titles, and retrieve the chosen events. Event queries cost more tokens per call than article queries, so prefer a concept URI to keywords and avoid repeating them.
36
+
37
+ ## Set a token budget
38
+
39
+ Give an unattended job a ceiling so a bug cannot drain the account.
40
+
41
+ ```ts
42
+ const er = new EventRegistry({ apiKey, maxTokens: 500 });
43
+ ```
44
+
45
+ Once the tokens reported by the API since the client was created (plus the last reported cost of the endpoint about to be called) would pass `maxTokens`, the next call throws `ErBudgetExceededError` without sending a request. The API reports a call's cost only after it has run, so the guard can overshoot by one call; treat it as a safety net, not an exact meter. Read the totals with `er.usage.session`, the last call with `er.usage.last`, and the account balance with `await er.getRemainingTokens()`.
46
+
47
+ ## Stop on demand and bound the time
48
+
49
+ Pass an `AbortSignal` and an overall deadline in the constructor or per call.
50
+
51
+ ```ts
52
+ const controller = new AbortController();
53
+ const scoped = er.withOptions({ signal: controller.signal, timeoutMs: 30_000 });
54
+ const response = await scoped.articles.search({ conceptUri }).exec();
55
+ ```
56
+
57
+ `withOptions` returns a view of the same client, so rate limits, usage totals and the request queue stay shared. The deadline covers queueing, retries and backoff waits together. Aborting rejects with the abort reason, and an expired deadline rejects with `ErTimeoutError`; no request is left running.
58
+
59
+ ## Retry behaviour
60
+
61
+ Failed requests are retried with exponential backoff, capped at 30 seconds, and `Retry-After` is honoured on 429 and 503. By default a request is retried up to 5 times; set `repeatFailedRequestCount` to change that (`-1` retries until the request succeeds, `0` fails fast). When the API answers with an error that is not retried, the response carries an `ErApiError` with the status, the API's error code and, when present, the request id and token cost, so an agent can decide what to do next.
62
+
63
+ ## Watch for new content
64
+
65
+ `er.recent.articles()` and `er.recent.events()` poll the minute stream. Awaiting them does one poll; iterating them keeps polling.
66
+
67
+ ```ts
68
+ for await (const article of er.recent.articles({
69
+ pollMs: 60_000,
70
+ signal: controller.signal,
71
+ cursor: await loadCursor(), // resume where the last run stopped
72
+ onCursor: (cursor) => saveCursor(cursor) // called whenever the position moves
73
+ })) {
74
+ handle(article);
75
+ }
76
+ ```
77
+
78
+ Store the cursor wherever your job keeps state. Without one, the feed starts at the stream's current position and skips what was published while the job was down.
79
+
80
+ ## Refuse malformed data
81
+
82
+ A pipeline that acts on responses should not continue on a payload that lost its results array. Set `validate: true` and every `execQuery` response is checked against the documented top-level shapes; a mismatch throws `ErValidationError` listing each problem by JSON path. Unknown extra fields never fail the check, so API additions do not break you. The option is off by default.
83
+
84
+ ```ts
85
+ const er = new EventRegistry({ apiKey, validate: true });
86
+ ```
package/CHANGELOG.md ADDED
@@ -0,0 +1,254 @@
1
+ # NodeJS SDK: Change Log
2
+
3
+ This log contains changes specific to the NodeJS SDK.
4
+
5
+ ## [v11.0.0](https://www.npmjs.com/package/eventregistry/v/11.0.0) (2026-11-25)
6
+
7
+ Also contains everything listed under `10.1.0` below, which was never published to npm.
8
+
9
+ **Breaking**
10
+ - The default `repeatFailedRequestCount` is now `5` (was `-1`, retry indefinitely), so a down API no longer hangs a call forever. Set `repeatFailedRequestCount: -1` to keep the old behaviour.
11
+
12
+ **Added**
13
+ - `throwOnError` config option: failed calls throw (`ErApiError` for HTTP failures) instead of resolving to `{ error }`. Off by default.
14
+ - `suggestAuthors`, `suggestEventTypes` and `suggestIndustries` also take `{ page, count }` as the second argument, and `suggestSourcesAtCoordinate` takes `{ count }` as the fourth. The positional forms still work. Extra parameters are now sent correctly (the old `...otherParams` rest array was spread as numeric keys).
15
+ - `retryDelayMs` and `maxRetryDelayMs` are part of the client config type.
16
+
17
+ **Changed**
18
+ - A malformed `settings.json` now reports the file and the parse error. Unsupported-parameter warnings go through one logger helper. Iterators buffer pages and `jsonRequest` and `jsonRequestAnalytics` share one request path; behaviour is unchanged.
19
+
20
+ **Fixed**
21
+ - `throwOnError` applies to every request, not only `execQuery()`: suggesters (`suggestConcepts`, …), URI lookups (`getConceptUri`, …), analytics calls and other `jsonRequest` / `jsonRequestAnalytics` callers throw on failure instead of resolving to `{ error }`.
22
+ - `new RequestMentionsConceptAggr()` no longer throws with its defaults: `mentionsSampleSize` now defaults to `20000` (was `100000`, above the `20000` cap).
23
+ - `TopicPage.loadTopicPageFromER()` starts from a clean definition; concepts, keywords and settings added earlier no longer leak into the loaded page.
24
+ - `TopicPage.loadTopicPageFromDefinition()` and `loadTopicPageFromFile()` accept definitions that carry `startSourceRankPercentile` or `endSourceRankPercentile`, so a saved definition with source rank limits loads again instead of being ignored.
25
+ - `ComplexArticleQuery`'s `hasDuplicateFilter` option is typed `"skipHasDuplicates" | "keepOnlyHasDuplicates" | "keepAll"`, the values the API accepts (it was typed with the `isDuplicateFilter` values, so the valid values needed a cast).
26
+ - `RequestArticlesRecentActivity` sends `updatesafterBlogUri` and `updatesAfterPrUri` as `recentActivityArticlesBlogUpdatesAfterUri` and `recentActivityArticlesPrUpdatesAfterUri` (both were sent as the news key and overwrote `updatesAfterNewsUri`). `updatesAfterBlogUri` is accepted as a camel-case alias for `updatesafterBlogUri`.
27
+ - `new QueryMentions()` without `requestedResult` asks for the mention list (`RequestMentionsInfo`), like the other queries and the Python SDK. It sent no `resultType` before.
28
+ - `QueryMentions` has the same two fixes as `QueryEvents` below: it sends `ignoreKeywords` as `ignoreKeyword`, and sends `sourceOper` / `sourceGroupOper`.
29
+ - `QueryEvents` sends `ignoreKeywords` under the `ignoreKeyword` key the API reads (it was sent as `ignoreKeywords` and ignored), and sends `sourceOper` / `sourceGroupOper`, so `QueryItems.AND` on `sourceUri` or `sourceGroupUri` works instead of throwing. Both match `QueryArticles` and the Python SDK.
30
+ - Recent-activity times (`updatesAfterTm`, `updatesUntilTm`) are sent in UTC without a zone suffix (`2026-01-01T10:00:00`), as the Python SDK sends them. A datetime string without a zone is now read as UTC. Before, it was read as local time, so the time sent was shifted on machines outside UTC.
31
+ - `ComplexArticleQuery` and `ComplexEventQuery` keep a `minSentiment` or `maxSentiment` of `0` in the filter; it was dropped as if unset.
32
+ - TypeScript users can set options that were published as `undefined`-only in the `.d.ts`: `RequestArticlesConceptAggr`'s `conceptCountPerType`, `RequestStorySimilarStories`' `conceptInfoList`, `dateStart`, `dateEnd` and `lang`, `GetRecentEvents`' `mandatoryLang`, and `GetRecentArticles`' `mandatorySourceLocation` and `lang`. No runtime change.
33
+
34
+ ## [v10.1.0](https://www.npmjs.com/package/eventregistry/v/10.1.0) (2026-11-11)
35
+
36
+ Additive release on top of `10.0.0`; nothing was removed or renamed. **The classic class-based API is permanent**: it carries no `@deprecated` tags and there is no plan to remove it. See [MIGRATION.md](MIGRATION.md#the-classic-api-is-permanent).
37
+
38
+ **Added**
39
+ - Typed `ErApiError` for failed HTTP calls (status, API error code and message, request id, token cost, `Retry-After`). `execQuery` error responses expose it as `apiError` next to the existing string `error`.
40
+ - Retry backoff is now exponential with jitter (base `retryDelayMs`, capped at `maxRetryDelayMs`) and honours `Retry-After` on 429 and 503. The default of retrying indefinitely (`repeatFailedRequestCount: -1`) is unchanged.
41
+ - Cancellation and deadlines: `signal` (an `AbortSignal`) and `timeoutMs` in the constructor config, per call on the classic `execQuery`/`getUsageInfo`/`getRemainingTokens` options, and for helpers and fluent calls through `er.withOptions({ signal, timeoutMs })`. The signal also stops requests waiting in the queue and pending backoff waits. Timeouts reject with `ErTimeoutError`.
42
+ - Usage accounting and an optional budget guard: `er.usage` (last call and session totals from the `req-tokens`, `req-action` and `req-archive` headers) and the `maxTokens` option, which rejects with `ErBudgetExceededError` before a call that would exceed the budget. The guard estimates the next call from the last cost of the same endpoint, so it can overshoot by one call.
43
+ - `er.recent.articles()` and `er.recent.events()` return a `RecentFeed`: `await` it for one poll (as before) or iterate it with `for await` to poll continuously, with `pollMs`, a resumable cursor (`getCursor`/`setCursor`, `onCursor`), `signal` and `timeoutMs`. `recentArticlesFeed` and `recentEventsFeed` are exported for direct use.
44
+ - Opt-in `validate: true`: responses are checked with hand-written guards for the top-level shapes of articles, events, mentions, URI/weight lists, aggregates and concept trends, and a mismatch throws `ErValidationError`. Unknown fields are ignored. Off by default.
45
+ - API reference generated with TypeDoc and published to GitHub Pages (`npm run docs`).
46
+ - [AGENT-RECIPES.md](AGENT-RECIPES.md) and a runnable `examples/agentRecipesExamples.ts` for the suggest, scan, triage, retrieve workflow.
47
+ - CI imports the ESM build in Bun and in workerd (through Miniflare) and constructs the client. Supported runtimes are listed in the README.
48
+
49
+ **Changed**
50
+ - The package imports `node:fs` and `node:path` (was `fs` and `path`). Behaviour on Node is identical; on Cloudflare Workers the `nodejs_compat` flag is required.
51
+
52
+ ## [v10.0.0](https://www.npmjs.com/package/eventregistry/v/10.0.0) (2026-10-09)
53
+
54
+ 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.
55
+
56
+ **Breaking**
57
+ - 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).
58
+ - API requests now use HTTPS by default (`https://eventregistry.org` and `https://analytics.eventregistry.org`). `9.1.1` defaulted to `http://`.
59
+ - The default `minDelayBetweenRequests` is now `0.5` seconds (was `1`). Throttling is enforced with `Date.now()` under a per-instance mutex.
60
+ - 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.
61
+ - 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).
62
+ - 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).
63
+ - 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).
64
+ - Dual CommonJS and ES module builds under `dist/cjs` and `dist/esm` (`package.json` `exports`). Importing or requiring `eventregistry` keeps the same API.
65
+ - Transport failures returned from `execQuery` / `jsonRequest` expose `error` as a **string** (matching API error payloads) instead of an `Error` instance that JSON-serialized to `{}`.
66
+ - `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.
67
+
68
+ **Added**
69
+ - 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`.
70
+ - 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.
71
+ - `RequestEventsBreakingEvents` for querying currently breaking events.
72
+ - `TopicPages` class with `getMyTopicPages()` to list user-owned topic pages.
73
+ - `EventRegistry.getEventTypeUri()` helper for resolving event type labels to URIs.
74
+ - Optional `concepts` parameter on `Analytics.categorize()`.
75
+ - `EventRegistry.setExtraParams()` for adding parameters to every request.
76
+ - `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.
77
+ - Configuration getters: `getHost()`, `getHostAnalytics()`, `getApiKey()`, `getMinDelayBetweenRequests()`, and `getRepeatFailedRequestCount()`.
78
+
79
+ **Updated**
80
+ - Node.js 24.11.0 is the supported development target; `engines` is `>=18.0.0`.
81
+ - Zero runtime dependencies (Axios, Winston, moment, and `semaphore-async-await` removed). Dates use native `Date`; request locking uses an in-house `Mutex`.
82
+ - TypeScript compile target raised to ES2020.
83
+ - Upgraded linting to ESLint 9 (TSLint removed).
84
+ - Offline unit tests migrated to Vitest (`npm run test:unit`). Jasmine integration tests replay committed fixtures by default (`npm test`).
85
+ - GitHub Actions CI runs build, lint, unit tests, fixture replay, example typecheck, and `publint` on Node 18 and Node 24.
86
+ - `package.json` declares `"type": "commonjs"` and a `git+https` repository URL (publint).
87
+ - The published tarball now ships `src/` alongside `dist/`, so the emitted `.js.map` source maps resolve to the real TypeScript sources instead of dangling.
88
+ - Hardened integration tests against live API volatility (awaited iterators, range assertions, dynamic fixtures, paging safety caps).
89
+
90
+ **Fixed**
91
+ - Removed accidental `fdescribe` focus in integration tests so the full suite runs.
92
+ - `checkVersion()` no longer silently no-ops when `/static/nodejsSDKVersion.txt` is missing (the live URL currently 404s); it falls back to the npm registry.
93
+ - `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).
94
+ - `QueryArticles` now sends `authorsFilter` / `videosFilter` / `linksFilter` as the API params `hasAuthorsFilter` / `hasVideosFilter` / `hasLinksFilter` (matching the Python SDK). The constructor argument names are unchanged.
95
+
96
+ ## [v9.1.1](https://www.npmjs.com/package/eventregistry/v/9.1.1) (2024-11-14)
97
+ **Fixed**
98
+ - 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`.
99
+
100
+ ## [v9.1]() (2024-06-27)
101
+ **Updated**
102
+ - Updated several external packages used internally by the SDK.
103
+ - Removed `lodash` as a dependency.
104
+ **Added**
105
+ - added `keywordSearchMode` parameter that can be used in `QueryArticles`, `QueryArticlesIter`, `QueryEvents`, `QueryEventsIter` and `QueryEvent` constructors.
106
+ **Updated**
107
+ - `QueryArticles` class. Added filters `authorsFilter`, `videosFilter`, `linksFilter`
108
+ - `QueryMentions` class. Added several filters: `industryUri`, `sdgUri`, `sasbUri`, `esgUri`, `minSentenceIndex`, `maxSentenceIndex`, `showDuplicates`
109
+ - Changed how logging works. If you would like to see host information or manually adjust logging level then you can do the following
110
+ ``` javascript
111
+ const er = new EventRegistry();
112
+ er.logger.logLevel = LogLevel.DEBUG; // or LogLevel.INFO, LogLevel.WARN, LogLevel.ERROR
113
+ ```
114
+
115
+ ## [v8.11.1]() (2023-05-11)
116
+ **Fixed**
117
+ - fixed the `RequestEventsRecentActivity` response type to the correct value.
118
+ ```
119
+ ## [v8.11.1]() (2023-03-24)
120
+ **Updated**
121
+ - the `QueryEventArticlesIter` class will be significantly faster in returning the articles when you specify the language filter
122
+ **Added**
123
+ - New option for usage for the following classes: `QueryEventsIter`, `QueryEventArticlesIter`, `QueryArticlesIter` and `QueryMentionsIter`. Example below shows how to use it with `QueryEventsIter` class.
124
+ ```javascript
125
+ (async () => {
126
+ const er = new EventRegistry();
127
+ const events = new QueryEventsIter(er, { keywords: "Obama", maxItems: 30 });
128
+ for await (const event of events) {
129
+ console.info(event);
130
+ }
131
+ })();
132
+ ```
133
+ ## [v8.10.4]() (2022-12-08)
134
+ - Apply correct default value for article count when querying for articles when using RequestArticlesInfo (was 200 instead of 100).
135
+
136
+ ## [v8.10.3]() (2022-12-08)
137
+ - Correctly apply allowUseOfArchive parameter when querying for articles and events with iterator classes.
138
+
139
+ ## [v8.10.2]() (2022-05-09)
140
+ - 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).
141
+
142
+ ## [v8.10.1]() (2022-03-23)
143
+
144
+ **Breaking**
145
+
146
+ - `TopicPage.getArticles` and `TopicPage.getEvents` return full response with additional page/pages information (instead of simple array of articles/events).
147
+
148
+ ## [v8.10.0]() (2021-10-19)
149
+
150
+ **Added**
151
+
152
+ - 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.
153
+
154
+ **Updated**
155
+ - When using method `initWithComplexQuery` we now check if the provided json is valid json object and report error in case it is not
156
+
157
+ ## [v8.9.2]() (2021-05-12)
158
+
159
+ **Updated**
160
+
161
+ - Updated dependencies of the SDK library
162
+
163
+ ## [v8.9]() (2020-11-24)
164
+
165
+ **Added**
166
+
167
+ - added `required` and `excluded` optional parameters to the TopicPage class to methods `addConcept`, `addKeyword`, `addCategory`, `addSource`, `addSourceLocation` and `addSourceGroup`.
168
+ - 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).
169
+
170
+ ## [v8.8.0]() (2020-10-07)
171
+
172
+ **Added**
173
+
174
+ - 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.
175
+ - 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.
176
+
177
+
178
+ ## [v8.7.0]() (2020-01-31)
179
+
180
+ **Added**
181
+ - added `EventRegistry.getServiceStatus()` method that reports status of the services
182
+ - 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.
183
+ - Sentiment was also added as a property in the returned articles and events.
184
+ - `ComplexQueryArticles` and `ComplexQueryEvents` classes now support in the constructor additional filters like `minSentiment`, `maxSentiment`, `minFacebookShares`, `endSourceRankPercentile`, etc.
185
+
186
+ **Updated**
187
+ - `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.
188
+ - `TopicPage.getArticles` and `TopicPage.getEvents` methods now also support passing any rarely used parameters directly, that are not a part of the typings.
189
+ - Analytics: We updated `trainTopicOnTweets()`, `trainTopicClearTopic()` and `trainTopicGetTrainedTopic()` methods in the `Analytics` class.
190
+ - `Analytics.annotate()` method now supports passing custom parameters that should be used when annotating the text.
191
+ - Changed some defaults in the returned data. When searching articles, we now by default return article image and sentiment.
192
+ - Analytics. updated `trainTopicOnTweets()`, `trainTopicClearTopic()` and `trainTopicGetTrainedTopic()` methods in the `Analytics` class.
193
+ - `QueryArticles.initWithComplexQuery()` was updated - the parameter `dataType` was removed (since the `dataType` value should be provided in the `$filter` section of the query)
194
+ - `TopicPage` now supports setting also the source rank percentile
195
+ - `Analytics.extractArticleInfo` now also supports setting the headers and cookies to be used when making the requests
196
+
197
+ **Removed**
198
+
199
+ - removed `EventRegistry.suggestCustomConcepts()` and `EventRegistry.getCustomConceptUri()` methods. Not used anymore since we are not supporting anymore the correlation feature.
200
+
201
+ ## [v8.5.13]() (2018-10-10)
202
+
203
+ **Changed**
204
+ - Better exposure of Typescript type definitions (affects Typescript users)
205
+
206
+ ## [v8.5.1]() (2018-09-17)
207
+
208
+ **Changed**
209
+ - A couple of minor fixes and improvements for examples and other minor things
210
+
211
+ ## [v8.5.0]() (2018-09-14)
212
+
213
+ **Added**
214
+ - 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).
215
+ - 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).
216
+
217
+ ## [v8.4.0]() (2018-09-13)
218
+
219
+ **Added**
220
+ - added searching of articles and events based on article authors. You can now provide `authorUri` parameter when creating the `QueryArticles` and `QueryEvents` instances.
221
+ - 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.
222
+ - 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.
223
+ - 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.
224
+ - `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.
225
+ - added some parameters and changed default values in some of the result types to reflect the backend changes.
226
+ - 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}`.
227
+
228
+ ## [v8.3.12]() (2018-08-16)
229
+
230
+ **Added**
231
+ - Added `getUsageInfo` method which returns usage information. It returns an object with two properties: availableTokens and usedTokens
232
+
233
+ ## [v8.3.11]() (2018-08-13)
234
+
235
+ **Added**
236
+ - Missing utility methods`getRemainingAvailableRequests`, `getDailyAvailableRequests`, `getLastHeaders` and `getLastHeader`.
237
+
238
+ ## [v8.3.1]() (2018-08-06)
239
+
240
+ **Changed**
241
+ - Switched to POST requests instead of GET
242
+
243
+ ## [v8.3.0]() (2018-08-06)
244
+
245
+ **Added**
246
+ - Implemented all the latest changes as seen in the Python SDK 8.3.0.
247
+
248
+ **Breaking**
249
+ - `QueryArticlesIter`, `QueryEventArticlesIter` and `QueryEventsIter` now return one item at a time instead of the whole page (array) of items.
250
+
251
+ **Changed**
252
+ - Updated to Typescript 3.0.
253
+ - Version bump to be more inline with the Python SDK versioning
254
+ - 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,195 @@
1
+ # Migrating to eventregistry 11.0.0
2
+
3
+ Coming from `10.x`, read [From 10.x to 11.0.0](#from-10x-to-1100). Coming from `9.1.1`, read the whole guide: [From 9.1.1 to 10.0.0](#from-911-to-1000) first, then the `11.0.0` change. Read the [CHANGELOG](CHANGELOG.md) for the itemized list; this document explains the *why* and shows copy-paste examples.
4
+
5
+ ## From 10.x to 11.0.0
6
+
7
+ One breaking change: **failed requests are retried 5 times by default, not indefinitely.** `repeatFailedRequestCount` now defaults to `5` (was `-1`). Before, a down API or a broken network could hang a call forever; now it gives up after 5 retries and the call resolves to `{ error }` (or throws, with `throwOnError: true`).
8
+
9
+ To keep the old behaviour, set it back explicitly:
10
+
11
+ ```typescript
12
+ const er = new EventRegistry({ apiKey: "YOUR_API_KEY", repeatFailedRequestCount: -1 });
13
+ ```
14
+
15
+ Nothing else was removed or renamed. `11.0.0` also contains the additive `10.1.0` features (typed `ErApiError`, cancellation and deadlines, usage accounting and `maxTokens`, `RecentFeed`, opt-in `validate`), which were never published as a separate version, plus `throwOnError` and the `{ page, count }` form for the paged suggesters. See the [CHANGELOG](CHANGELOG.md) for details.
16
+
17
+ ## From 9.1.1 to 10.0.0
18
+
19
+ This part covers moving from **`9.1.1`** to **`10.0.0`**. There was no published `9.1.2`: everything that landed on `development` after `9.1.1` shipped as `10.0.0`. The retry default described below (`-1`) changed again in `11.0.0`.
20
+
21
+ ## TL;DR
22
+
23
+ - **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.
24
+ - **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.
25
+ - 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).
26
+ - New in 10.0.0: an optional ergonomic surface (`er.articles`, `searchArticles()`, `conceptUri()`, …) that wraps the same classic classes.
27
+ - Under the hood: Axios → native `fetch`, Winston → a lightweight built-in `Logger`, moment → `Date`, dual CJS/ESM, TypeScript `strict`.
28
+
29
+ ## The classic API is permanent
30
+
31
+ The classic class-based API (`QueryArticles`, `QueryEvents`, `Request*`, iterators, complex queries, `er.execQuery()`) is a permanent part of this package, not a stepping stone. It carries no `@deprecated` tags, no codemod is planned and it will not be removed in a future major. The helpers and fluent namespaces are thin wrappers over it, so both surfaces get the same fixes and features. Pick whichever reads better; mixing them in one codebase is fine.
32
+
33
+ ## 1. Classic API — still supported; runtime defaults changed
34
+
35
+ This `9.1.1` pattern is still valid:
36
+
37
+ ```typescript
38
+ import { EventRegistry, QueryArticles, RequestArticlesInfo, QueryArticlesIter } from "eventregistry";
39
+
40
+ const er = new EventRegistry({ apiKey: "YOUR_API_KEY" });
41
+
42
+ const conceptUri = await er.getConceptUri("Barack Obama");
43
+ const q = new QueryArticles({ conceptUri });
44
+ q.setRequestedResult(new RequestArticlesInfo({ count: 30, sortBy: "date" }));
45
+ const response = await er.execQuery(q);
46
+
47
+ const iter = new QueryArticlesIter(er, { conceptUri, maxItems: 500 });
48
+ iter.execQuery((article) => console.info(article));
49
+ ```
50
+
51
+ `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:
52
+
53
+ | `9.1.1` | `10.0.0` |
54
+ |---|---|
55
+ | Node `engines: >=5`, Axios | Node **18+**, native `fetch` |
56
+ | Default host `http://eventregistry.org` | `https://eventregistry.org` |
57
+ | `minDelayBetweenRequests: 1` (often ineffective) | `0.5` seconds, actually throttled |
58
+ | `repeatFailedRequestCount: 2` | `-1` (retry indefinitely, except stop codes and non-HTTP errors) |
59
+ | `getLastHeaders()` Axios dict | Fetch `Headers` — use `.get("x-ratelimit-remaining")` |
60
+ | `response.error` sometimes an `Error` (`JSON.stringify` → `{}`) | `error` is a **string** |
61
+ | `GetRecentEvents.getUpdates()` → `activity \|\| {}`, no cursor | **array** (`[]` if missing), advances `newestUri` like `GetRecentArticles` |
62
+ | `er.logger` was Winston | same `logLevel` API; no Winston transports |
63
+
64
+ `GetRecentArticles` already used `lang` (not `articleLang`) in `9.1.1`. If you still pass `articleLang`, it is **not** mapped to `recentActivityArticlesLang`.
65
+
66
+ ## 2. Recommended: fluent + helpers
67
+
68
+ `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.
69
+
70
+ ### Articles
71
+
72
+ ```typescript
73
+ import { EventRegistry, searchArticles, conceptUri } from "eventregistry";
74
+
75
+ const er = new EventRegistry({ apiKey: "YOUR_API_KEY" });
76
+
77
+ // one-shot search + fetch (helper function)
78
+ const uri = await conceptUri(er, "Barack Obama"); // throws if no match is found
79
+ const response = await searchArticles(er, { conceptUri: uri, count: 30, sortBy: "date" });
80
+
81
+ // same thing, fluent style
82
+ const response2 = await er.articles
83
+ .search({ conceptUri: await er.concepts.uri("Barack Obama") })
84
+ .info({ count: 30, sortBy: "date" })
85
+ .exec();
86
+
87
+ // single article
88
+ const article = await er.articles.get("some-article-uri");
89
+
90
+ // auto-paging iterator (returns an AsyncIterable, same paging as QueryArticlesIter)
91
+ for await (const item of er.articles.iterate({ conceptUri: uri, maxItems: 500 })) {
92
+ console.info(item);
93
+ }
94
+ ```
95
+
96
+ `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).
97
+
98
+ **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.
99
+
100
+ ### Events and mentions
101
+
102
+ ```typescript
103
+ import { EventRegistry, searchEvents } from "eventregistry";
104
+
105
+ const er = new EventRegistry({ apiKey: "YOUR_API_KEY" });
106
+ const conceptUri = await er.concepts.uri("Star Wars");
107
+
108
+ // helper
109
+ const events = await searchEvents(er, { conceptUri, count: 10, sortBy: "date" });
110
+
111
+ // fluent
112
+ const events2 = await er.events.search({ conceptUri }).info({ count: 10, sortBy: "date" }).exec();
113
+ const event = await er.events.get("eng-1234567");
114
+ for await (const event of er.events.iterate({ conceptUri, maxItems: 300 })) {
115
+ console.info(event);
116
+ }
117
+
118
+ // mentions (beta endpoint) follow the same shape, minus a single-item `.get()`
119
+ const mentions = await er.mentions.search({ keywords: "inflation" }).info({ count: 20 }).exec();
120
+ for await (const mention of er.mentions.iterate({ keywords: "inflation", maxItems: 200 })) {
121
+ console.info(mention);
122
+ }
123
+ ```
124
+
125
+ The mentions filter field is **`keywords`**, not `keyword`.
126
+
127
+ ### Everything else
128
+
129
+ 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.
130
+
131
+ | Domain | Fluent | Helper functions |
132
+ |---|---|---|
133
+ | Stories | `er.stories.get(uri)` | `getStory` |
134
+ | Trends | `er.trends.concepts()`, `.categories()`, `.customItems()`, `.conceptGroups()` | `getTrendingConcepts`, `getTrendingCategories`, `getTrendingCustomItems`, `getTrendingConceptGroups` |
135
+ | Counts | `er.counts.get()`, `.ex()` | `getCounts`, `getCountsEx` |
136
+ | Social shares | `er.shares.articles()`, `.events()` | `getTopSharedArticles`, `getTopSharedEvents` |
137
+ | Recent activity | `er.recent.events()`, `.articles()` | `getRecentEvents`, `getRecentArticles` |
138
+ | Info lookups | `er.info.source()`, `.concept()`, `.category()`, `.sourceStats()` | `getSourceInfo`, `getConceptInfo`, `getCategoryInfo`, `getSourceStats` |
139
+ | Topic pages | `er.topicPages.mine()`, `.load()`, `.create()` | `getMyTopicPages`, `loadTopicPage`, `createTopicPage` |
140
+ | Analytics | `er.analytics.annotate()`, `.categorize()`, `.sentiment()`, `.semanticSimilarity()`, `.detectLanguage()`, `.extractArticleInfo()`, `.ner()`, `.trainTopic*()` | `annotateText`, `categorizeText`, `analyzeSentiment`, `semanticSimilarity`, `detectLanguage`, `extractArticleInfo`, `ner`, `trainTopicOnTweets`, `trainTopicCreateTopic`, `trainTopicClearTopic`, `trainTopicAddDocument`, `trainTopicGetTrainedTopic` |
141
+ | Event-for-text | `er.eventForText(text, lang?, nrOfEventsToReturn?)` (directly callable) | `getEventForText` |
142
+
143
+ `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).
144
+
145
+ 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).
146
+
147
+ ## 3. TypeScript: `strict` mode and tighter `.d.ts`
148
+
149
+ The library's own source now compiles under TypeScript `strict` mode. Consequences for consumers:
150
+
151
+ - 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.
152
+ - 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.
153
+ - The library's own `strict` mode is internal — it doesn't force your project to enable `strict`. Enable it on your own timeline.
154
+ - 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).
155
+
156
+ ## 4. HTTP transport: Axios removed, `fetch` required
157
+
158
+ `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`).
159
+
160
+ - **Node.js 18+ is a hard requirement** — `fetch`/`Headers`/`AbortController` are global built-ins starting with Node 18. There is no polyfill bundled.
161
+ - Axios is no longer a dependency — smaller install, no transitive Axios CVEs to track.
162
+ - Stop-status-code list (`204`, `400`, `401`, `403`, `530`) does not retry. Transient HTTP/network failures still retry (`repeatFailedRequestCount: 5` by default since `11.0.0`, `-1` before; set `-1` to retry indefinitely). Invalid JSON bodies and JSON parse failures on HTTP 200 fail immediately instead of looping.
163
+ - 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.
164
+
165
+ ## 5. Logging: Winston removed, `Logger`/`LogLevel` API unchanged
166
+
167
+ 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**:
168
+
169
+ ```typescript
170
+ import { LogLevel } from "eventregistry";
171
+
172
+ er.logger.logLevel = LogLevel.DEBUG;
173
+ ```
174
+
175
+ `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.
176
+
177
+ ## 6. Package/build changes
178
+
179
+ - `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.
180
+ - Runtime dependencies are gone (Axios, Winston, moment, `semaphore-async-await`).
181
+ - Offline unit tests moved from ad-hoc scripts to Vitest (`npm run test:unit`); irrelevant to consumers, only affects contributors.
182
+
183
+ ## Checklist
184
+
185
+ - [ ] Confirm your runtime is Node.js 18+.
186
+ - [ ] Upgrade `eventregistry` to `10.0.0`.
187
+ - [ ] `npm install` (removes Axios/Winston/moment transitive deps automatically).
188
+ - [ ] Re-check constructors that relied on `http://` hosts, delay `1`, or retry `2`.
189
+ - [ ] If you poll `GetRecentEvents.getUpdates()`, treat the result as an array and expect the cursor to advance.
190
+ - [ ] If you read `getLastHeaders()` as a dict or `response.error instanceof Error`, update those call sites (section 4).
191
+ - [ ] If you attached custom Winston transports to this package's logger, update those call sites (section 5).
192
+ - [ ] Run your test suite.
193
+ - [ ] 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.
194
+
195
+ See also: [README — Classic API (fully supported)](README.md#classic-api-fully-supported), [CHANGELOG](CHANGELOG.md).