eventregistry 9.1.1 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/CHANGELOG.md +207 -0
  2. package/LICENSE +21 -21
  3. package/MIGRATION.md +177 -0
  4. package/README.md +292 -234
  5. package/dist/{analytics.d.ts → cjs/analytics.d.ts} +2 -1
  6. package/dist/cjs/analytics.js +174 -0
  7. package/dist/cjs/analytics.js.map +1 -0
  8. package/dist/{base.d.ts → cjs/base.d.ts} +9 -9
  9. package/dist/cjs/base.js +189 -0
  10. package/dist/cjs/base.js.map +1 -0
  11. package/dist/cjs/counts.js +120 -0
  12. package/dist/cjs/counts.js.map +1 -0
  13. package/dist/cjs/dailyShares.js +46 -0
  14. package/dist/cjs/dailyShares.js.map +1 -0
  15. package/dist/{data.d.ts → cjs/data.d.ts} +32 -5
  16. package/dist/cjs/data.js.map +1 -0
  17. package/dist/{eventForText.d.ts → cjs/eventForText.d.ts} +1 -1
  18. package/dist/cjs/eventForText.js +61 -0
  19. package/dist/cjs/eventForText.js.map +1 -0
  20. package/dist/{eventRegistry.d.ts → cjs/eventRegistry.d.ts} +127 -28
  21. package/dist/cjs/eventRegistry.js +887 -0
  22. package/dist/cjs/eventRegistry.js.map +1 -0
  23. package/dist/cjs/fluent/analytics.d.ts +24 -0
  24. package/dist/cjs/fluent/analytics.js +47 -0
  25. package/dist/cjs/fluent/analytics.js.map +1 -0
  26. package/dist/cjs/fluent/articles.d.ts +23 -0
  27. package/dist/cjs/fluent/articles.js +34 -0
  28. package/dist/cjs/fluent/articles.js.map +1 -0
  29. package/dist/cjs/fluent/counts.d.ts +8 -0
  30. package/dist/cjs/fluent/counts.js +17 -0
  31. package/dist/cjs/fluent/counts.js.map +1 -0
  32. package/dist/cjs/fluent/eventForText.d.ts +4 -0
  33. package/dist/cjs/fluent/eventForText.js +8 -0
  34. package/dist/cjs/fluent/eventForText.js.map +1 -0
  35. package/dist/cjs/fluent/events.d.ts +23 -0
  36. package/dist/cjs/fluent/events.js +34 -0
  37. package/dist/cjs/fluent/events.js.map +1 -0
  38. package/dist/cjs/fluent/info.d.ts +10 -0
  39. package/dist/cjs/fluent/info.js +23 -0
  40. package/dist/cjs/fluent/info.js.map +1 -0
  41. package/dist/cjs/fluent/mentions.d.ts +18 -0
  42. package/dist/cjs/fluent/mentions.js +31 -0
  43. package/dist/cjs/fluent/mentions.js.map +1 -0
  44. package/dist/cjs/fluent/recent.d.ts +8 -0
  45. package/dist/cjs/fluent/recent.js +17 -0
  46. package/dist/cjs/fluent/recent.js.map +1 -0
  47. package/dist/cjs/fluent/shares.d.ts +8 -0
  48. package/dist/cjs/fluent/shares.js +17 -0
  49. package/dist/cjs/fluent/shares.js.map +1 -0
  50. package/dist/cjs/fluent/stories.d.ts +8 -0
  51. package/dist/cjs/fluent/stories.js +14 -0
  52. package/dist/cjs/fluent/stories.js.map +1 -0
  53. package/dist/cjs/fluent/topicPages.d.ts +10 -0
  54. package/dist/cjs/fluent/topicPages.js +20 -0
  55. package/dist/cjs/fluent/topicPages.js.map +1 -0
  56. package/dist/cjs/fluent/trends.d.ts +11 -0
  57. package/dist/cjs/fluent/trends.js +23 -0
  58. package/dist/cjs/fluent/trends.js.map +1 -0
  59. package/dist/cjs/helpers/analytics.d.ts +68 -0
  60. package/dist/cjs/helpers/analytics.js +100 -0
  61. package/dist/cjs/helpers/analytics.js.map +1 -0
  62. package/dist/cjs/helpers/articles.d.ts +24 -0
  63. package/dist/cjs/helpers/articles.js +31 -0
  64. package/dist/cjs/helpers/articles.js.map +1 -0
  65. package/dist/cjs/helpers/counts.d.ts +4 -0
  66. package/dist/cjs/helpers/counts.js +12 -0
  67. package/dist/cjs/helpers/counts.js.map +1 -0
  68. package/dist/cjs/helpers/eventForText.d.ts +6 -0
  69. package/dist/cjs/helpers/eventForText.js +13 -0
  70. package/dist/cjs/helpers/eventForText.js.map +1 -0
  71. package/dist/cjs/helpers/events.d.ts +18 -0
  72. package/dist/cjs/helpers/events.js +31 -0
  73. package/dist/cjs/helpers/events.js.map +1 -0
  74. package/dist/cjs/helpers/info.d.ts +6 -0
  75. package/dist/cjs/helpers/info.js +20 -0
  76. package/dist/cjs/helpers/info.js.map +1 -0
  77. package/dist/cjs/helpers/mentions.d.ts +10 -0
  78. package/dist/cjs/helpers/mentions.js +21 -0
  79. package/dist/cjs/helpers/mentions.js.map +1 -0
  80. package/dist/cjs/helpers/recent.d.ts +10 -0
  81. package/dist/cjs/helpers/recent.js +18 -0
  82. package/dist/cjs/helpers/recent.js.map +1 -0
  83. package/dist/cjs/helpers/shares.d.ts +4 -0
  84. package/dist/cjs/helpers/shares.js +12 -0
  85. package/dist/cjs/helpers/shares.js.map +1 -0
  86. package/dist/cjs/helpers/stories.d.ts +7 -0
  87. package/dist/cjs/helpers/stories.js +13 -0
  88. package/dist/cjs/helpers/stories.js.map +1 -0
  89. package/dist/cjs/helpers/topicPages.d.ts +16 -0
  90. package/dist/cjs/helpers/topicPages.js +29 -0
  91. package/dist/cjs/helpers/topicPages.js.map +1 -0
  92. package/dist/cjs/helpers/trends.d.ts +7 -0
  93. package/dist/cjs/helpers/trends.js +20 -0
  94. package/dist/cjs/helpers/trends.js.map +1 -0
  95. package/dist/cjs/helpers/uri.d.ts +42 -0
  96. package/dist/cjs/helpers/uri.js +78 -0
  97. package/dist/cjs/helpers/uri.js.map +1 -0
  98. package/dist/cjs/http.d.ts +18 -0
  99. package/dist/cjs/http.js +88 -0
  100. package/dist/cjs/http.js.map +1 -0
  101. package/dist/cjs/index.d.ts +47 -0
  102. package/dist/{index.js → cjs/index.js} +90 -2
  103. package/dist/cjs/index.js.map +1 -0
  104. package/dist/cjs/info.js +115 -0
  105. package/dist/cjs/info.js.map +1 -0
  106. package/dist/{logger.d.ts → cjs/logger.d.ts} +13 -11
  107. package/dist/cjs/logger.js +179 -0
  108. package/dist/cjs/logger.js.map +1 -0
  109. package/dist/cjs/mutex.d.ts +6 -0
  110. package/dist/cjs/mutex.js +27 -0
  111. package/dist/cjs/mutex.js.map +1 -0
  112. package/dist/cjs/package.json +3 -0
  113. package/dist/{query.d.ts → cjs/query.d.ts} +5 -8
  114. package/dist/cjs/query.js +248 -0
  115. package/dist/cjs/query.js.map +1 -0
  116. package/dist/{queryArticle.d.ts → cjs/queryArticle.d.ts} +5 -5
  117. package/dist/cjs/queryArticle.js +120 -0
  118. package/dist/cjs/queryArticle.js.map +1 -0
  119. package/dist/{queryArticles.d.ts → cjs/queryArticles.d.ts} +40 -73
  120. package/dist/cjs/queryArticles.js +456 -0
  121. package/dist/cjs/queryArticles.js.map +1 -0
  122. package/dist/{queryEvent.d.ts → cjs/queryEvent.d.ts} +6 -6
  123. package/dist/cjs/queryEvent.js +417 -0
  124. package/dist/cjs/queryEvent.js.map +1 -0
  125. package/dist/{queryEvents.d.ts → cjs/queryEvents.d.ts} +30 -39
  126. package/dist/cjs/queryEvents.js +567 -0
  127. package/dist/cjs/queryEvents.js.map +1 -0
  128. package/dist/cjs/queryIterator.d.ts +34 -0
  129. package/dist/cjs/queryIterator.js +77 -0
  130. package/dist/cjs/queryIterator.js.map +1 -0
  131. package/dist/{queryMentions.d.ts → cjs/queryMentions.d.ts} +18 -18
  132. package/dist/cjs/queryMentions.js +440 -0
  133. package/dist/cjs/queryMentions.js.map +1 -0
  134. package/dist/{queryStory.d.ts → cjs/queryStory.d.ts} +23 -23
  135. package/dist/cjs/queryStory.js +120 -0
  136. package/dist/cjs/queryStory.js.map +1 -0
  137. package/dist/{recent.d.ts → cjs/recent.d.ts} +8 -8
  138. package/dist/cjs/recent.js +63 -0
  139. package/dist/cjs/recent.js.map +1 -0
  140. package/dist/{returnInfo.d.ts → cjs/returnInfo.d.ts} +21 -23
  141. package/dist/cjs/returnInfo.js +292 -0
  142. package/dist/cjs/returnInfo.js.map +1 -0
  143. package/dist/{topicPage.d.ts → cjs/topicPage.d.ts} +3 -3
  144. package/dist/cjs/topicPage.js +454 -0
  145. package/dist/cjs/topicPage.js.map +1 -0
  146. package/dist/cjs/topicPages.d.ts +13 -0
  147. package/dist/cjs/topicPages.js +22 -0
  148. package/dist/cjs/topicPages.js.map +1 -0
  149. package/dist/{trends.d.ts → cjs/trends.d.ts} +13 -13
  150. package/dist/cjs/trends.js +64 -0
  151. package/dist/cjs/trends.js.map +1 -0
  152. package/dist/{types.d.ts → cjs/types.d.ts} +135 -33
  153. package/dist/cjs/types.js.map +1 -0
  154. package/dist/cjs/version.d.ts +1 -0
  155. package/dist/cjs/version.js +5 -0
  156. package/dist/cjs/version.js.map +1 -0
  157. package/dist/esm/analytics.d.ts +83 -0
  158. package/dist/esm/analytics.js +170 -0
  159. package/dist/esm/analytics.js.map +1 -0
  160. package/dist/esm/base.d.ts +82 -0
  161. package/dist/esm/base.js +182 -0
  162. package/dist/esm/base.js.map +1 -0
  163. package/dist/esm/counts.d.ts +81 -0
  164. package/dist/esm/counts.js +114 -0
  165. package/dist/esm/counts.js.map +1 -0
  166. package/dist/esm/dailyShares.d.ts +10 -0
  167. package/dist/esm/dailyShares.js +41 -0
  168. package/dist/esm/dailyShares.js.map +1 -0
  169. package/dist/esm/data.d.ts +296 -0
  170. package/dist/esm/data.js +3 -0
  171. package/dist/esm/data.js.map +1 -0
  172. package/dist/esm/eventForText.d.ts +48 -0
  173. package/dist/esm/eventForText.js +57 -0
  174. package/dist/esm/eventForText.js.map +1 -0
  175. package/dist/esm/eventRegistry.d.ts +343 -0
  176. package/dist/esm/eventRegistry.js +849 -0
  177. package/dist/esm/eventRegistry.js.map +1 -0
  178. package/dist/esm/fluent/analytics.d.ts +24 -0
  179. package/dist/esm/fluent/analytics.js +43 -0
  180. package/dist/esm/fluent/analytics.js.map +1 -0
  181. package/dist/esm/fluent/articles.d.ts +23 -0
  182. package/dist/esm/fluent/articles.js +30 -0
  183. package/dist/esm/fluent/articles.js.map +1 -0
  184. package/dist/esm/fluent/counts.d.ts +8 -0
  185. package/dist/esm/fluent/counts.js +13 -0
  186. package/dist/esm/fluent/counts.js.map +1 -0
  187. package/dist/esm/fluent/eventForText.d.ts +4 -0
  188. package/dist/esm/fluent/eventForText.js +5 -0
  189. package/dist/esm/fluent/eventForText.js.map +1 -0
  190. package/dist/esm/fluent/events.d.ts +23 -0
  191. package/dist/esm/fluent/events.js +30 -0
  192. package/dist/esm/fluent/events.js.map +1 -0
  193. package/dist/esm/fluent/info.d.ts +10 -0
  194. package/dist/esm/fluent/info.js +19 -0
  195. package/dist/esm/fluent/info.js.map +1 -0
  196. package/dist/esm/fluent/mentions.d.ts +18 -0
  197. package/dist/esm/fluent/mentions.js +27 -0
  198. package/dist/esm/fluent/mentions.js.map +1 -0
  199. package/dist/esm/fluent/recent.d.ts +8 -0
  200. package/dist/esm/fluent/recent.js +13 -0
  201. package/dist/esm/fluent/recent.js.map +1 -0
  202. package/dist/esm/fluent/shares.d.ts +8 -0
  203. package/dist/esm/fluent/shares.js +13 -0
  204. package/dist/esm/fluent/shares.js.map +1 -0
  205. package/dist/esm/fluent/stories.d.ts +8 -0
  206. package/dist/esm/fluent/stories.js +10 -0
  207. package/dist/esm/fluent/stories.js.map +1 -0
  208. package/dist/esm/fluent/topicPages.d.ts +10 -0
  209. package/dist/esm/fluent/topicPages.js +16 -0
  210. package/dist/esm/fluent/topicPages.js.map +1 -0
  211. package/dist/esm/fluent/trends.d.ts +11 -0
  212. package/dist/esm/fluent/trends.js +19 -0
  213. package/dist/esm/fluent/trends.js.map +1 -0
  214. package/dist/esm/helpers/analytics.d.ts +68 -0
  215. package/dist/esm/helpers/analytics.js +86 -0
  216. package/dist/esm/helpers/analytics.js.map +1 -0
  217. package/dist/esm/helpers/articles.d.ts +24 -0
  218. package/dist/esm/helpers/articles.js +26 -0
  219. package/dist/esm/helpers/articles.js.map +1 -0
  220. package/dist/esm/helpers/counts.d.ts +4 -0
  221. package/dist/esm/helpers/counts.js +8 -0
  222. package/dist/esm/helpers/counts.js.map +1 -0
  223. package/dist/esm/helpers/eventForText.d.ts +6 -0
  224. package/dist/esm/helpers/eventForText.js +10 -0
  225. package/dist/esm/helpers/eventForText.js.map +1 -0
  226. package/dist/esm/helpers/events.d.ts +18 -0
  227. package/dist/esm/helpers/events.js +26 -0
  228. package/dist/esm/helpers/events.js.map +1 -0
  229. package/dist/esm/helpers/info.d.ts +6 -0
  230. package/dist/esm/helpers/info.js +14 -0
  231. package/dist/esm/helpers/info.js.map +1 -0
  232. package/dist/esm/helpers/mentions.d.ts +10 -0
  233. package/dist/esm/helpers/mentions.js +17 -0
  234. package/dist/esm/helpers/mentions.js.map +1 -0
  235. package/dist/esm/helpers/recent.d.ts +10 -0
  236. package/dist/esm/helpers/recent.js +14 -0
  237. package/dist/esm/helpers/recent.js.map +1 -0
  238. package/dist/esm/helpers/shares.d.ts +4 -0
  239. package/dist/esm/helpers/shares.js +8 -0
  240. package/dist/esm/helpers/shares.js.map +1 -0
  241. package/dist/esm/helpers/stories.d.ts +7 -0
  242. package/dist/esm/helpers/stories.js +10 -0
  243. package/dist/esm/helpers/stories.js.map +1 -0
  244. package/dist/esm/helpers/topicPages.d.ts +16 -0
  245. package/dist/esm/helpers/topicPages.js +24 -0
  246. package/dist/esm/helpers/topicPages.js.map +1 -0
  247. package/dist/esm/helpers/trends.d.ts +7 -0
  248. package/dist/esm/helpers/trends.js +14 -0
  249. package/dist/esm/helpers/trends.js.map +1 -0
  250. package/dist/esm/helpers/uri.d.ts +42 -0
  251. package/dist/esm/helpers/uri.js +68 -0
  252. package/dist/esm/helpers/uri.js.map +1 -0
  253. package/dist/esm/http.d.ts +18 -0
  254. package/dist/esm/http.js +85 -0
  255. package/dist/esm/http.js.map +1 -0
  256. package/dist/esm/index.d.ts +47 -0
  257. package/dist/esm/index.js +47 -0
  258. package/dist/esm/index.js.map +1 -0
  259. package/dist/esm/info.d.ts +61 -0
  260. package/dist/esm/info.js +108 -0
  261. package/dist/esm/info.js.map +1 -0
  262. package/dist/esm/logger.d.ts +47 -0
  263. package/dist/esm/logger.js +142 -0
  264. package/dist/esm/logger.js.map +1 -0
  265. package/dist/esm/mutex.d.ts +6 -0
  266. package/dist/esm/mutex.js +23 -0
  267. package/dist/esm/mutex.js.map +1 -0
  268. package/dist/esm/package.json +3 -0
  269. package/dist/esm/query.d.ts +50 -0
  270. package/dist/esm/query.js +240 -0
  271. package/dist/esm/query.js.map +1 -0
  272. package/dist/esm/queryArticle.d.ts +61 -0
  273. package/dist/esm/queryArticle.js +111 -0
  274. package/dist/esm/queryArticle.js.map +1 -0
  275. package/dist/esm/queryArticles.d.ts +111 -0
  276. package/dist/esm/queryArticles.js +438 -0
  277. package/dist/esm/queryArticles.js.map +1 -0
  278. package/dist/esm/queryEvent.d.ts +140 -0
  279. package/dist/esm/queryEvent.js +403 -0
  280. package/dist/esm/queryEvent.js.map +1 -0
  281. package/dist/esm/queryEvents.d.ts +201 -0
  282. package/dist/esm/queryEvents.js +545 -0
  283. package/dist/esm/queryEvents.js.map +1 -0
  284. package/dist/esm/queryIterator.d.ts +34 -0
  285. package/dist/esm/queryIterator.js +73 -0
  286. package/dist/esm/queryIterator.js.map +1 -0
  287. package/dist/esm/queryMentions.d.ts +96 -0
  288. package/dist/esm/queryMentions.js +425 -0
  289. package/dist/esm/queryMentions.js.map +1 -0
  290. package/dist/esm/queryStory.d.ts +58 -0
  291. package/dist/esm/queryStory.js +110 -0
  292. package/dist/esm/queryStory.js.map +1 -0
  293. package/dist/esm/recent.d.ts +23 -0
  294. package/dist/esm/recent.js +58 -0
  295. package/dist/esm/recent.js.map +1 -0
  296. package/dist/esm/returnInfo.d.ts +66 -0
  297. package/dist/esm/returnInfo.js +245 -0
  298. package/dist/esm/returnInfo.js.map +1 -0
  299. package/dist/esm/topicPage.d.ts +157 -0
  300. package/dist/esm/topicPage.js +417 -0
  301. package/dist/esm/topicPage.js.map +1 -0
  302. package/dist/esm/topicPages.d.ts +13 -0
  303. package/dist/esm/topicPages.js +18 -0
  304. package/dist/esm/topicPages.js.map +1 -0
  305. package/dist/esm/trends.d.ts +35 -0
  306. package/dist/esm/trends.js +56 -0
  307. package/dist/esm/trends.js.map +1 -0
  308. package/dist/esm/types.d.ts +2555 -0
  309. package/dist/esm/types.js +2 -0
  310. package/dist/esm/types.js.map +1 -0
  311. package/dist/esm/version.d.ts +1 -0
  312. package/dist/esm/version.js +2 -0
  313. package/dist/esm/version.js.map +1 -0
  314. package/package.json +71 -42
  315. package/src/analytics.ts +197 -0
  316. package/src/base.ts +200 -0
  317. package/src/counts.ts +118 -0
  318. package/src/dailyShares.ts +46 -0
  319. package/src/data.ts +310 -0
  320. package/src/eventForText.ts +60 -0
  321. package/src/eventRegistry.ts +1005 -0
  322. package/src/fluent/analytics.ts +84 -0
  323. package/src/fluent/articles.ts +40 -0
  324. package/src/fluent/counts.ts +15 -0
  325. package/src/fluent/eventForText.ts +10 -0
  326. package/src/fluent/events.ts +40 -0
  327. package/src/fluent/info.ts +23 -0
  328. package/src/fluent/mentions.ts +34 -0
  329. package/src/fluent/recent.ts +15 -0
  330. package/src/fluent/shares.ts +15 -0
  331. package/src/fluent/stories.ts +12 -0
  332. package/src/fluent/topicPages.ts +20 -0
  333. package/src/fluent/trends.ts +34 -0
  334. package/src/helpers/analytics.ts +134 -0
  335. package/src/helpers/articles.ts +42 -0
  336. package/src/helpers/counts.ts +19 -0
  337. package/src/helpers/eventForText.ts +16 -0
  338. package/src/helpers/events.ts +43 -0
  339. package/src/helpers/info.ts +31 -0
  340. package/src/helpers/mentions.ts +27 -0
  341. package/src/helpers/recent.ts +22 -0
  342. package/src/helpers/shares.ts +17 -0
  343. package/src/helpers/stories.ts +16 -0
  344. package/src/helpers/topicPages.ts +28 -0
  345. package/src/helpers/trends.ts +36 -0
  346. package/src/helpers/uri.ts +78 -0
  347. package/src/http.ts +110 -0
  348. package/src/index.ts +205 -0
  349. package/src/info.ts +120 -0
  350. package/src/logger.ts +177 -0
  351. package/src/mutex.ts +22 -0
  352. package/src/query.ts +258 -0
  353. package/src/queryArticle.ts +138 -0
  354. package/src/queryArticles.ts +576 -0
  355. package/src/queryEvent.ts +503 -0
  356. package/src/queryEvents.ts +672 -0
  357. package/src/queryIterator.ts +89 -0
  358. package/src/queryMentions.ts +552 -0
  359. package/src/queryStory.ts +152 -0
  360. package/src/recent.ts +73 -0
  361. package/src/returnInfo.ts +372 -0
  362. package/src/topicPage.ts +481 -0
  363. package/src/topicPages.ts +18 -0
  364. package/src/trends.ts +62 -0
  365. package/src/types.ts +2678 -0
  366. package/src/version.ts +1 -0
  367. package/dist/analytics.js +0 -337
  368. package/dist/analytics.js.map +0 -1
  369. package/dist/base.js +0 -262
  370. package/dist/base.js.map +0 -1
  371. package/dist/counts.js +0 -163
  372. package/dist/counts.js.map +0 -1
  373. package/dist/dailyShares.js +0 -91
  374. package/dist/dailyShares.js.map +0 -1
  375. package/dist/data.js.map +0 -1
  376. package/dist/eventForText.js +0 -127
  377. package/dist/eventForText.js.map +0 -1
  378. package/dist/eventRegistry.js +0 -1099
  379. package/dist/eventRegistry.js.map +0 -1
  380. package/dist/index.d.ts +0 -21
  381. package/dist/index.js.map +0 -1
  382. package/dist/info.js +0 -172
  383. package/dist/info.js.map +0 -1
  384. package/dist/logger.js +0 -156
  385. package/dist/logger.js.map +0 -1
  386. package/dist/query.js +0 -334
  387. package/dist/query.js.map +0 -1
  388. package/dist/queryArticle.js +0 -184
  389. package/dist/queryArticle.js.map +0 -1
  390. package/dist/queryArticles.js +0 -730
  391. package/dist/queryArticles.js.map +0 -1
  392. package/dist/queryEvent.js +0 -588
  393. package/dist/queryEvent.js.map +0 -1
  394. package/dist/queryEvents.js +0 -826
  395. package/dist/queryEvents.js.map +0 -1
  396. package/dist/queryMentions.js +0 -638
  397. package/dist/queryMentions.js.map +0 -1
  398. package/dist/queryStory.js +0 -195
  399. package/dist/queryStory.js.map +0 -1
  400. package/dist/recent.js +0 -200
  401. package/dist/recent.js.map +0 -1
  402. package/dist/returnInfo.js +0 -333
  403. package/dist/returnInfo.js.map +0 -1
  404. package/dist/topicPage.js +0 -600
  405. package/dist/topicPage.js.map +0 -1
  406. package/dist/trends.js +0 -116
  407. package/dist/trends.js.map +0 -1
  408. package/dist/types.js.map +0 -1
  409. /package/dist/{counts.d.ts → cjs/counts.d.ts} +0 -0
  410. /package/dist/{dailyShares.d.ts → cjs/dailyShares.d.ts} +0 -0
  411. /package/dist/{data.js → cjs/data.js} +0 -0
  412. /package/dist/{info.d.ts → cjs/info.d.ts} +0 -0
  413. /package/dist/{types.js → cjs/types.js} +0 -0
@@ -43,34 +43,34 @@ export declare namespace ER {
43
43
  */
44
44
  apiKey?: string;
45
45
  /**
46
- * Host to use to access the Event Registry backend
46
+ * Host to use to access the Event Registry backend.
47
+ * @default "https://eventregistry.org"
47
48
  */
48
49
  host?: string;
49
50
  /**
50
- * host address to use to perform the analytics api calls
51
+ * Host address to use to perform the analytics api calls.
52
+ * @default "https://analytics.eventregistry.org"
51
53
  */
52
54
  hostAnalytics?: string;
53
55
  /**
54
- * log all requests
56
+ * Log all requests.
55
57
  */
56
58
  logging?: boolean;
57
59
  /**
58
- * The minimum number of seconds between individual api calls
60
+ * The minimum number of seconds between individual api calls.
61
+ * @default 0.5
59
62
  */
60
63
  minDelayBetweenRequests?: number;
61
64
  /**
62
- * if a request fails (for example, because ER is down),
63
- * what is the max number of times the request should be repeated
65
+ * If a request fails (for example, because ER is down),
66
+ * what is the max number of times the request should be repeated.
67
+ * @default -1
64
68
  */
65
69
  repeatFailedRequestCount?: number;
66
70
  /**
67
- * if true, additional info about errors etc. will be printed to console
71
+ * If true, additional info about errors etc. will be printed to console.
68
72
  */
69
73
  verboseOutput?: boolean;
70
- /**
71
- * print which urls are used as the hosts
72
- */
73
- printHostInfo?: boolean;
74
74
  settingsFName?: string;
75
75
  allowUseOfArchive?: boolean;
76
76
  }
@@ -439,7 +439,7 @@ export declare namespace ER {
439
439
  categories?: Weight<CategoryWeight>[];
440
440
  locations?: Weight<LocationWeight>[];
441
441
  langs?: string[];
442
- dataType?: Array<"news" | "pr" | "blog">;
442
+ dataType?: ("news" | "pr" | "blog")[];
443
443
  owner?: {
444
444
  uri: string;
445
445
  };
@@ -595,7 +595,7 @@ export declare namespace ER {
595
595
  * What details should be included in the returned information
596
596
  */
597
597
  returnInfo?: ReturnInfo;
598
- [name: string]: (string | number | boolean | ReturnInfo) | (string | number | boolean)[];
598
+ [name: string]: (string | number | boolean | ReturnInfo) | (string | number | boolean)[] | undefined;
599
599
  }
600
600
  export interface TopicPageEvents {
601
601
  /**
@@ -618,7 +618,7 @@ export declare namespace ER {
618
618
  * What details should be included in the returned information
619
619
  */
620
620
  returnInfo?: ReturnInfo;
621
- [name: string]: (string | number | boolean | ReturnInfo) | (string | number | boolean)[];
621
+ [name: string]: (string | number | boolean | ReturnInfo) | (string | number | boolean)[] | undefined;
622
622
  }
623
623
  export namespace Correlations {
624
624
  interface TopConceptArguments {
@@ -986,6 +986,18 @@ export declare namespace ER {
986
986
  articlesSampleSize?: number;
987
987
  returnInfo?: ReturnInfo;
988
988
  }
989
+ export interface RequestArticlesRecentActivityParameters {
990
+ maxArticleCount?: number;
991
+ updatesAfterNewsUri?: string;
992
+ updatesafterBlogUri?: string;
993
+ updatesAfterPrUri?: string;
994
+ updatesAfterTm?: string | Date;
995
+ updatesAfterMinsAgo?: number;
996
+ updatesUntilTm?: string | Date;
997
+ updatesUntilMinsAgo?: number;
998
+ mandatorySourceLocation?: boolean;
999
+ returnInfo?: ReturnInfo;
1000
+ }
989
1001
  export namespace Aggr {
990
1002
  namespace Source {
991
1003
  interface CountsPerSource {
@@ -1143,9 +1155,27 @@ export declare namespace ER {
1143
1155
  * "keepAll" (no filtering, default)
1144
1156
  */
1145
1157
  eventFilter?: "skipArticlesWithoutEvent" | "keepOnlyArticlesWithoutEvent" | "keepAll";
1146
- authorsFilter?: string;
1147
- videosFilter?: string;
1148
- linksFilter?: string;
1158
+ /**
1159
+ * Some articles have an extracted author and some don't. What should be done with them. Possible values are:
1160
+ * "skipIfHasAuthors" (skip articles for which we have identified the author)
1161
+ * "keepOnlyIfHasAuthors" (return only articles for which we have extracted the author)
1162
+ * "keepAll" (no filtering, default)
1163
+ */
1164
+ authorsFilter?: "skipIfHasAuthors" | "keepOnlyIfHasAuthors" | "keepAll";
1165
+ /**
1166
+ * Some articles contain a link to a video and some don't. What should be done with them. Possible values are:
1167
+ * "skipIfHasVideos" (skip articles that contain a link to a video)
1168
+ * "keepOnlyIfHasVideos" (return only articles that contain a link to a video)
1169
+ * "keepAll" (no filtering, default)
1170
+ */
1171
+ videosFilter?: "skipIfHasVideos" | "keepOnlyIfHasVideos" | "keepAll";
1172
+ /**
1173
+ * Some articles contain links to other URLs and some don't. What should be done with them. Possible values are:
1174
+ * "skipIfHasLinks" (skip articles that contain one or more links)
1175
+ * "keepOnlyIfHasLinks" (return only articles that contain a link to other URLs)
1176
+ * "keepAll" (no filtering, default)
1177
+ */
1178
+ linksFilter?: "skipIfHasLinks" | "keepOnlyIfHasLinks" | "keepAll";
1149
1179
  /**
1150
1180
  * Starting percentile of the sources to consider in the results (default: 0). Value should be in range 0-90 and divisible by 10.
1151
1181
  */
@@ -1172,6 +1202,24 @@ export declare namespace ER {
1172
1202
  */
1173
1203
  requestedResult?: RequestArticles;
1174
1204
  }
1205
+ interface IteratorArguments extends Arguments {
1206
+ /**
1207
+ * how should the resulting articles be sorted. Options: "rel" (relevance), "date" (published date), "sourceImportance", "sourceImportanceRank", "sourceAlexaGlobalRank", "sourceAlexaCountryRank", "socialScore", "facebookShares"
1208
+ */
1209
+ sortBy?: string;
1210
+ /**
1211
+ * should the results be sorted in ascending order (true) or descending (false)
1212
+ */
1213
+ sortByAsc?: boolean;
1214
+ /**
1215
+ * what details should be included in the returned information
1216
+ */
1217
+ returnInfo?: ReturnInfo;
1218
+ /**
1219
+ * maximum number of items to be returned. Used to stop iteration sooner than results run out
1220
+ */
1221
+ maxItems?: number;
1222
+ }
1175
1223
  }
1176
1224
  export namespace QueryEvent {
1177
1225
  /**
@@ -1187,8 +1235,7 @@ export declare namespace ER {
1187
1235
  * - facebookShares (shares on Facebook only)
1188
1236
  */
1189
1237
  type SortByOptions = "id" | "date" | "cosSim" | "sourceImportance" | "sourceImportanceRank" | "sourceAlexaGlobalRank" | "sourceAlexaCountryRank" | "socialScore" | "facebookShares";
1190
- interface RequestEvent {
1191
- }
1238
+ type RequestEvent = Record<string, never>;
1192
1239
  interface IteratorArguments {
1193
1240
  /**
1194
1241
  * Array or a single language in which to return the list of matching articles
@@ -1320,10 +1367,10 @@ export declare namespace ER {
1320
1367
  /**
1321
1368
  * array of concepts and their importance, e.g. [{ "uri": "http://en.wikipedia.org/wiki/Barack_Obama", "wgt": 100 }, ...]
1322
1369
  */
1323
- conceptInfoList?: Array<{
1370
+ conceptInfoList?: {
1324
1371
  uri: string;
1325
1372
  wgt: number;
1326
- }>;
1373
+ }[];
1327
1374
  /**
1328
1375
  * number of similar events to return (at most 50)
1329
1376
  */
@@ -1351,10 +1398,10 @@ export declare namespace ER {
1351
1398
  /**
1352
1399
  * array of concepts and their importance, e.g. [{ "uri": "http://en.wikipedia.org/wiki/Barack_Obama", "wgt": 100 }, ...]
1353
1400
  */
1354
- conceptInfoList?: Array<{
1401
+ conceptInfoList?: {
1355
1402
  uri: string;
1356
1403
  wgt: number;
1357
- }>;
1404
+ }[];
1358
1405
  /**
1359
1406
  * number of similar stories to return (at most 5')
1360
1407
  */
@@ -1413,7 +1460,44 @@ export declare namespace ER {
1413
1460
  requestedResult?: RequestMentions;
1414
1461
  }
1415
1462
  interface IteratorArguments extends Arguments {
1416
- [key: string]: any;
1463
+ /**
1464
+ * how should the resulting mentions be sorted. Options: "none", "rel" (relevance), "date" (published date), "size", "socialScore"
1465
+ */
1466
+ sortBy?: "none" | "rel" | "date" | "size" | "socialScore";
1467
+ /**
1468
+ * should the results be sorted in ascending order (true) or descending (false)
1469
+ */
1470
+ sortByAsc?: boolean;
1471
+ /**
1472
+ * what details should be included in the returned information
1473
+ */
1474
+ returnInfo?: ReturnInfo;
1475
+ /**
1476
+ * maximum number of items to be returned. Used to stop iteration sooner than results run out
1477
+ */
1478
+ maxItems?: number;
1479
+ }
1480
+ interface RequestMentionsInfoArguments {
1481
+ /**
1482
+ * page of the results to return (1, 2, ...)
1483
+ */
1484
+ page?: number;
1485
+ /**
1486
+ * number of results to return per page
1487
+ */
1488
+ count?: number;
1489
+ /**
1490
+ * how mentions should be sorted
1491
+ */
1492
+ sortBy?: "none" | "rel" | "date" | "size" | "socialScore";
1493
+ /**
1494
+ * should the results be sorted in ascending order (true) or descending (false)
1495
+ */
1496
+ sortByAsc?: boolean;
1497
+ /**
1498
+ * what details should be included in the returned information
1499
+ */
1500
+ returnInfo?: ReturnInfo;
1417
1501
  }
1418
1502
  interface RequestMentionsUriWgtListArguments {
1419
1503
  /**
@@ -1937,6 +2021,24 @@ export declare namespace ER {
1937
2021
  */
1938
2022
  returnInfo?: ReturnInfo;
1939
2023
  }
2024
+ interface RequestEventsBreakingEventsArguments {
2025
+ /**
2026
+ * page of the results to return (1, 2, ...)
2027
+ */
2028
+ page?: number;
2029
+ /**
2030
+ * max events to return (at most 50)
2031
+ */
2032
+ count?: number;
2033
+ /**
2034
+ * the minimum score of "breakingness" of the events to be returned
2035
+ */
2036
+ minBreakingScore?: number;
2037
+ /**
2038
+ * what details should be included in the returned information
2039
+ */
2040
+ returnInfo?: ReturnInfo;
2041
+ }
1940
2042
  }
1941
2043
  export namespace ReturnInfo {
1942
2044
  /**
@@ -2019,7 +2121,7 @@ export declare namespace ER {
2019
2121
  * uri of the story (cluster) to which the article belongs
2020
2122
  */
2021
2123
  storyUri?: boolean;
2022
- [name: string]: boolean | string | number;
2124
+ [name: string]: boolean | string | number | undefined;
2023
2125
  }
2024
2126
  /**
2025
2127
  * What information about an article should be returned by the API call
@@ -2203,7 +2305,7 @@ export declare namespace ER {
2203
2305
  * number of images to be returned for a story
2204
2306
  */
2205
2307
  imageCount?: number;
2206
- [name: string]: boolean | string | number;
2308
+ [name: string]: boolean | string | number | undefined;
2207
2309
  }
2208
2310
  /**
2209
2311
  * What information about an event should be returned by the API call
@@ -2302,7 +2404,7 @@ export declare namespace ER {
2302
2404
  * number of images to be returned for an event
2303
2405
  */
2304
2406
  imageCount?: number;
2305
- [name: string]: boolean | string | number;
2407
+ [name: string]: boolean | string | number | undefined;
2306
2408
  }
2307
2409
  /**
2308
2410
  * What information about a news source should be returned by the API call
@@ -2369,7 +2471,7 @@ export declare namespace ER {
2369
2471
  * info about the names of the source groups to which the source belongs to
2370
2472
  */
2371
2473
  sourceGroups?: boolean;
2372
- [name: string]: boolean | string | number;
2474
+ [name: string]: boolean | string | number | undefined;
2373
2475
  }
2374
2476
  /**
2375
2477
  * What information about a category should be returned by the API call
@@ -2382,7 +2484,7 @@ export declare namespace ER {
2382
2484
  */
2383
2485
  interface CategoryInfo {
2384
2486
  trendingScore?: boolean;
2385
- [name: string]: boolean | string | number;
2487
+ [name: string]: boolean | string | number | undefined;
2386
2488
  }
2387
2489
  interface ConceptInfoFlags {
2388
2490
  ConceptType?: ConceptType;
@@ -2403,7 +2505,7 @@ export declare namespace ER {
2403
2505
  description?: boolean;
2404
2506
  trendingScore?: boolean;
2405
2507
  maxConceptsPerType?: number;
2406
- [name: string]: boolean | string | number | (boolean | string | number)[];
2508
+ [name: string]: boolean | string | number | (boolean | string | number)[] | undefined;
2407
2509
  }
2408
2510
  interface LocationInfoFlags {
2409
2511
  label?: boolean;
@@ -2428,7 +2530,7 @@ export declare namespace ER {
2428
2530
  countryContinent?: boolean;
2429
2531
  placeFeatureCode?: boolean;
2430
2532
  placeCountry?: boolean;
2431
- [name: string]: boolean | string | number;
2533
+ [name: string]: boolean | string | number | undefined;
2432
2534
  }
2433
2535
  interface ConceptClassInfoFlags {
2434
2536
  IncludeConceptClassParentLabels?: boolean;
@@ -2437,7 +2539,7 @@ export declare namespace ER {
2437
2539
  interface ConceptClassInfo {
2438
2540
  parentLabels?: boolean;
2439
2541
  concepts?: boolean;
2440
- [name: string]: boolean | string | number;
2542
+ [name: string]: boolean | string | number | undefined;
2441
2543
  }
2442
2544
  interface ConceptFolderInfoFlags {
2443
2545
  IncludeConceptFolderDefinition?: boolean;
@@ -2446,7 +2548,7 @@ export declare namespace ER {
2446
2548
  interface ConceptFolderInfo {
2447
2549
  definition?: boolean;
2448
2550
  owner?: boolean;
2449
- [name: string]: boolean | string | number;
2551
+ [name: string]: boolean | string | number | undefined;
2450
2552
  }
2451
2553
  }
2452
2554
  export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export declare const __version__ = "10.0.0";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.__version__ = void 0;
4
+ exports.__version__ = "10.0.0";
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,QAAQ,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { EventRegistry } from "./eventRegistry";
2
+ import { ER } from "./types";
3
+ export declare class Analytics {
4
+ private er;
5
+ /**
6
+ * @param eventRegistry: instance of EventRegistry class
7
+ */
8
+ constructor(er: EventRegistry);
9
+ /**
10
+ * Identify the list of entities and nonentities mentioned in the text
11
+ * @param text input text to annotate
12
+ * @param lang language of the provided document (can be an ISO2 or ISO3 code). If None is provided, the language will be automatically detected
13
+ */
14
+ annotate(text: string, lang?: string[], customParams?: {
15
+ [name: string]: unknown;
16
+ }): Promise<ER.Analytics.Response.Annotate>;
17
+ /**
18
+ * Determine the set of up to 5 categories the text is about. Currently, only English text can be categorized!
19
+ * @param text input text to categorize
20
+ * @param taxonomy: which taxonomy use for categorization. Options:
21
+ * - "dmoz" (over 5000 categories in 3 levels, English language only)
22
+ * - "news" (general news categorization, 9 categories, any langauge)
23
+ * @param concepts optional list of concept URIs to bias categorization
24
+ */
25
+ categorize(text: string, taxonomy?: "dmoz" | "news", concepts?: string[]): Promise<ER.Analytics.Response.Categorize>;
26
+ /**
27
+ * determine the sentiment of the provided text in English language
28
+ * @param text input text to categorize
29
+ * @param method method to use to compute the sentiment. possible values are "vocabulary" (vocabulary based sentiment analysis) and "rnn" (neural network based sentiment classification)
30
+ */
31
+ sentiment(text: string, method?: string, sentences?: number, returnSentences?: boolean): Promise<ER.Analytics.Response.Sentiment>;
32
+ semanticSimilarity(text1: string, text2: string, distanceMeasure?: "cosine" | "jaccard"): Promise<ER.Analytics.Response.SentimentSimilarity>;
33
+ /**
34
+ * Determine the language of the given text
35
+ * @param text input text to analyse
36
+ */
37
+ detectLanguage(text: string): Promise<ER.Analytics.Response.DetectLanguage>;
38
+ /**
39
+ * Extract all available information about an article available at url `url`.
40
+ * Returned information will include article title, body, authors, links in the articles,...
41
+ * @param url article url that'll be used for extraction
42
+ * @param proxyUrl proxy that should be used for downloading article information. format: {schema}://{username}:{pass}@{proxy url/ip}
43
+ */
44
+ extractArticleInfo(url: string, proxyUrl?: string, headers?: {
45
+ [name: string]: unknown;
46
+ }, cookies?: {
47
+ [name: string]: unknown;
48
+ }): Promise<ER.Analytics.Response.ExtractArticleInfo>;
49
+ /**
50
+ * Extract named entities from the provided text. Supported languages are English, German, Spanish and Chinese.
51
+ * @param text: text on which to extract named entities
52
+ */
53
+ ner(text: string): Promise<unknown>;
54
+ /**
55
+ * Create a new topic and train it using the tweets that match the twitterQuery
56
+ * @param twitterQuery string containing the content to search for. It can be a Twitter user account (using "@" prefix or user's Twitter url),a hash tag (using "#" prefix) or a regular keyword.
57
+ * @param args Object which contains a host of optional parameters
58
+ */
59
+ trainTopicOnTweets(twitterQuery: string, args?: ER.Analytics.TrainTopicOnTweetsArguments): Promise<ER.Analytics.Response>;
60
+ /**
61
+ * Create a new topic to train. The user should remember the "uri" parameter returned in the result.
62
+ * @param name name of the topic we want to create
63
+ * @returns object containing the "uri" property that should be used in the follow-up call to trainTopic* methods
64
+ */
65
+ trainTopicCreateTopic(name: string): Promise<ER.Analytics.Response>;
66
+ /**
67
+ * If the topic is already existing, clear the definition of the topic. Use this if you want to retrain an existing topic
68
+ * @param uri uri of the topic (obtained by calling trainTopicCreateTopic method) to clear
69
+ */
70
+ trainTopicClearTopic(uri: string): Promise<ER.Analytics.Response>;
71
+ /**
72
+ * Add the information extracted from the provided "text" to the topic with uri "uri".
73
+ * @param uri uri of the topic (obtained by calling trainTopicCreateTopic method)
74
+ * @param text text to analyze and extract information from
75
+ */
76
+ trainTopicAddDocument(uri: string, text: string): Promise<ER.Analytics.Response>;
77
+ /**
78
+ * Retrieve topic for the topic for which you have already finished training
79
+ * @param uri uri of the topic (obtained by calling trainTopicCreateTopic method)
80
+ * @returns returns the trained topic: { concepts: [], categories: [] }
81
+ */
82
+ trainTopicGetTrainedTopic(uri: string, args?: ER.Analytics.TrainTopicGetTrainedTopicArguments): Promise<ER.Analytics.Response>;
83
+ }
@@ -0,0 +1,170 @@
1
+ // The Analytics class can be used for access the text analytics services provided by the Event Registry.
2
+ // These include:
3
+ // - text annotation: identifying the list of entities and non-entities mentioned in the provided text
4
+ // - text categorization: identification of up to 5 categories that describe the topic of the given text.
5
+ // The list of available categories come from DMOZ open directory. Currently, only English text can be categorized!
6
+ // - sentiment detection: what is the sentiment expressed in the given text
7
+ // - language detection: detect in which language is the given text written
8
+ // NOTE: the functionality is currently in BETA. The API calls or the provided outputs may change in the future.
9
+ export class Analytics {
10
+ /**
11
+ * @param eventRegistry: instance of EventRegistry class
12
+ */
13
+ constructor(er) {
14
+ this.er = er;
15
+ }
16
+ /**
17
+ * Identify the list of entities and nonentities mentioned in the text
18
+ * @param text input text to annotate
19
+ * @param lang language of the provided document (can be an ISO2 or ISO3 code). If None is provided, the language will be automatically detected
20
+ */
21
+ async annotate(text, lang, customParams) {
22
+ let params = { lang, text };
23
+ if (!!customParams) {
24
+ params = { ...params, ...customParams };
25
+ }
26
+ const response = await this.er.jsonRequestAnalytics("/api/v1/annotate", params);
27
+ return response?.data;
28
+ }
29
+ /**
30
+ * Determine the set of up to 5 categories the text is about. Currently, only English text can be categorized!
31
+ * @param text input text to categorize
32
+ * @param taxonomy: which taxonomy use for categorization. Options:
33
+ * - "dmoz" (over 5000 categories in 3 levels, English language only)
34
+ * - "news" (general news categorization, 9 categories, any langauge)
35
+ * @param concepts optional list of concept URIs to bias categorization
36
+ */
37
+ async categorize(text, taxonomy = "dmoz", concepts) {
38
+ const params = { text, taxonomy };
39
+ if (Array.isArray(concepts) && concepts.length > 0) {
40
+ params.concepts = concepts;
41
+ }
42
+ const response = await this.er.jsonRequestAnalytics("/api/v1/categorize", params);
43
+ return response?.data;
44
+ }
45
+ /**
46
+ * determine the sentiment of the provided text in English language
47
+ * @param text input text to categorize
48
+ * @param method method to use to compute the sentiment. possible values are "vocabulary" (vocabulary based sentiment analysis) and "rnn" (neural network based sentiment classification)
49
+ */
50
+ async sentiment(text, method = "vocabulary", sentences = 10, returnSentences = true) {
51
+ if (!["vocabulary", "rnn"].includes(method)) {
52
+ throw new Error("method: Please pass in either 'vocabulary' or 'rnn'");
53
+ }
54
+ const params = {
55
+ text,
56
+ method,
57
+ sentences,
58
+ returnSentences
59
+ };
60
+ const response = await this.er.jsonRequestAnalytics("/api/v1/sentiment", params);
61
+ return response?.data;
62
+ }
63
+ async semanticSimilarity(text1, text2, distanceMeasure = "cosine") {
64
+ const response = await this.er.jsonRequestAnalytics("/api/v1/semanticSimilarity", { text1, text2, distanceMeasure });
65
+ return response?.data;
66
+ }
67
+ /**
68
+ * Determine the language of the given text
69
+ * @param text input text to analyse
70
+ */
71
+ async detectLanguage(text) {
72
+ const response = await this.er.jsonRequestAnalytics("/api/v1/detectLanguage", { text });
73
+ return response?.data;
74
+ }
75
+ /**
76
+ * Extract all available information about an article available at url `url`.
77
+ * Returned information will include article title, body, authors, links in the articles,...
78
+ * @param url article url that'll be used for extraction
79
+ * @param proxyUrl proxy that should be used for downloading article information. format: {schema}://{username}:{pass}@{proxy url/ip}
80
+ */
81
+ async extractArticleInfo(url, proxyUrl, headers, cookies) {
82
+ const params = { url };
83
+ if (!!proxyUrl) {
84
+ params.proxyUrl = proxyUrl;
85
+ }
86
+ const response = await this.er.jsonRequestAnalytics("/api/v1/extractArticleInfo", params, headers, cookies);
87
+ return response?.data;
88
+ }
89
+ /**
90
+ * Extract named entities from the provided text. Supported languages are English, German, Spanish and Chinese.
91
+ * @param text: text on which to extract named entities
92
+ */
93
+ async ner(text) {
94
+ const response = await this.er.jsonRequestAnalytics("/api/v1/ner", { text });
95
+ return response?.data;
96
+ }
97
+ /**
98
+ * Create a new topic and train it using the tweets that match the twitterQuery
99
+ * @param twitterQuery string containing the content to search for. It can be a Twitter user account (using "@" prefix or user's Twitter url),a hash tag (using "#" prefix) or a regular keyword.
100
+ * @param args Object which contains a host of optional parameters
101
+ */
102
+ async trainTopicOnTweets(twitterQuery, args = {}) {
103
+ const { useTweetText = true, useIdfNormalization = true, normalization = "linear", maxTweets = 2000, maxUsedLinks = 500, ignoreConceptTypes = [], maxConcepts = 20, maxCategories = 10, notifyEmailAddress = undefined } = args;
104
+ if (maxTweets > 5000) {
105
+ throw new Error("We can analyze at most 5000 tweets");
106
+ }
107
+ const params = {
108
+ twitterQuery,
109
+ useTweetText,
110
+ useIdfNormalization,
111
+ normalization,
112
+ maxTweets,
113
+ maxUsedLinks,
114
+ maxConcepts,
115
+ maxCategories
116
+ };
117
+ if (notifyEmailAddress) {
118
+ params.notifyEmailAddress = notifyEmailAddress;
119
+ }
120
+ if (ignoreConceptTypes && Object.keys(ignoreConceptTypes).length > 0) {
121
+ params.ignoreConceptTypes = ignoreConceptTypes;
122
+ }
123
+ const response = await this.er.jsonRequestAnalytics("/api/v1/trainTopicOnTwitter", params);
124
+ return response?.data;
125
+ }
126
+ /**
127
+ * Create a new topic to train. The user should remember the "uri" parameter returned in the result.
128
+ * @param name name of the topic we want to create
129
+ * @returns object containing the "uri" property that should be used in the follow-up call to trainTopic* methods
130
+ */
131
+ async trainTopicCreateTopic(name) {
132
+ const response = await this.er.jsonRequestAnalytics("/api/v1/trainTopic", { action: "createTopic", name });
133
+ return response?.data;
134
+ }
135
+ /**
136
+ * If the topic is already existing, clear the definition of the topic. Use this if you want to retrain an existing topic
137
+ * @param uri uri of the topic (obtained by calling trainTopicCreateTopic method) to clear
138
+ */
139
+ async trainTopicClearTopic(uri) {
140
+ const response = await this.er.jsonRequestAnalytics("/api/v1/trainTopic", { action: "clearTopic", uri });
141
+ return response?.data;
142
+ }
143
+ /**
144
+ * Add the information extracted from the provided "text" to the topic with uri "uri".
145
+ * @param uri uri of the topic (obtained by calling trainTopicCreateTopic method)
146
+ * @param text text to analyze and extract information from
147
+ */
148
+ async trainTopicAddDocument(uri, text) {
149
+ const response = await this.er.jsonRequestAnalytics("/api/v1/trainTopic", { action: "addDocument", uri, text });
150
+ return response?.data;
151
+ }
152
+ /**
153
+ * Retrieve topic for the topic for which you have already finished training
154
+ * @param uri uri of the topic (obtained by calling trainTopicCreateTopic method)
155
+ * @returns returns the trained topic: { concepts: [], categories: [] }
156
+ */
157
+ async trainTopicGetTrainedTopic(uri, args = {}) {
158
+ const { maxConcepts = 20, maxCategories = 10, idfNormalization = true } = args;
159
+ const params = {
160
+ action: "getTrainedTopic",
161
+ uri: uri,
162
+ maxConcepts: maxConcepts,
163
+ maxCategories: maxCategories,
164
+ idfNormalization: idfNormalization
165
+ };
166
+ const response = await this.er.jsonRequestAnalytics("/api/v1/trainTopic", params);
167
+ return response?.data;
168
+ }
169
+ }
170
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/analytics.ts"],"names":[],"mappings":"AAGA,yGAAyG;AACzG,iBAAiB;AACjB,sGAAsG;AACtG,yGAAyG;AACzG,uHAAuH;AACvH,2EAA2E;AAC3E,2EAA2E;AAE3E,gHAAgH;AAEhH,MAAM,OAAO,SAAS;IAClB;;OAEG;IACH,YAAoB,EAAiB;QAAjB,OAAE,GA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