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,83 @@
1
+ import { EventRegistry } from "./eventRegistry.js";
2
+ import { ER } from "./types.js";
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,GAAF,EAAE,CAAe;IAAI,CAAC;IAE1C;;;;OAIG;IACI,KAAK,CAAC,QAAQ,CAAC,IAAY,EAAE,IAAe,EAAE,YAAwC;QACzF,IAAI,MAAM,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;YACjB,MAAM,GAAG,EAAC,GAAG,MAAM,EAAE,GAAG,YAAY,EAAC,CAAC;QAC1C,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;QAChF,OAAO,QAAQ,EAAE,IAAsC,CAAC;IAC5D,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,WAA4B,MAAM,EAAE,QAAmB;QACzF,MAAM,MAAM,GAAqE,EAAE,IAAI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,CAAC,yBAAyB,CAAC,GAAW,EAAE,OAAwD,EAAE;QAC1G,MAAM,EACF,WAAW,GAAG,EAAE,EAChB,aAAa,GAAG,EAAE,EAClB,gBAAgB,GAAG,IAAI,EAC1B,GAAG,IAAI,CAAC;QACT,MAAM,MAAM,GAAG;YACX,MAAM,EAAE,iBAAiB;YACzB,GAAG,EAAE,GAAG;YACR,WAAW,EAAE,WAAW;YACxB,aAAa,EAAE,aAAa;YAC5B,gBAAgB,EAAE,gBAAgB;SACrC,CAAC;QACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;QAClF,OAAO,QAAQ,EAAE,IAA6B,CAAC;IACnD,CAAC;CACJ"}
@@ -0,0 +1,82 @@
1
+ export declare const mainLangs: string[];
2
+ export declare const allLangs: string[];
3
+ export declare class QueryItems {
4
+ static AND: (items: unknown[]) => QueryItems;
5
+ static OR: (items: unknown[]) => QueryItems;
6
+ private oper;
7
+ private items;
8
+ constructor(oper: string, items: unknown[]);
9
+ getOper(): string;
10
+ getItems(): unknown[];
11
+ }
12
+ /**
13
+ * @class QueryParamsBase
14
+ * Base class for Query and AdminQuery
15
+ * used for storing parameters for a query. Parameter values can either be
16
+ * simple values (set by setVal()) or an array of values (set by multiple
17
+ * calls to addArrayVal() method)
18
+ */
19
+ export declare class QueryParamsBase {
20
+ protected params: Record<string, unknown>;
21
+ /**
22
+ * Encode datetime into UTC ISO format which can be sent to ER.
23
+ */
24
+ static encodeDateTime(val: string | Date, format?: string): string;
25
+ /**
26
+ * Return the parameters.
27
+ */
28
+ getQueryParams(): Record<string, unknown>;
29
+ /**
30
+ * Set a value of a property in the query.
31
+ */
32
+ setVal(key: string, value: unknown): void;
33
+ /**
34
+ * Do we have in the query property named 'key'?
35
+ */
36
+ hasVal(key: string): boolean;
37
+ /**
38
+ * Remove the value of a property key (if existing).
39
+ */
40
+ clearVal(key: string): void;
41
+ /**
42
+ * Add a value to an array of values for a property.
43
+ */
44
+ addArrayVal(key: string, val: unknown): void;
45
+ /**
46
+ * Set value in query params if the 'val' is different from 'defVal'.
47
+ */
48
+ setValIfNotDefault(propName: string, val: unknown, defVal: unknown): void;
49
+ /**
50
+ * Set a property value that represents date.
51
+ * Value can be string in YYYY-MM-DD format or a Date object.
52
+ */
53
+ setDateVal(propName: string, val: string | Date): void;
54
+ /**
55
+ * Parse the value "value" and use it to set the property propName and the operator with name propOperName
56
+ * @param value String, QueryItems or an array.
57
+ * @param propName Values to be set using property name propName.
58
+ * @param propOperName Property to set containing the "and" or "or". Relevant only if multiple items are provided in "value". Can be None if only one value is possible.
59
+ * @param defaultOperName Which operator should be used in case "value" is an array. If an array, we will print also a warning to suggest use of QueryItems.
60
+ */
61
+ setQueryArrVal(value: string | QueryItems | unknown[] | undefined, propName: string, propOperName: string | undefined, defaultOperName: string): void;
62
+ }
63
+ export declare abstract class Query<T> extends QueryParamsBase {
64
+ resultTypeList: T[];
65
+ /**
66
+ * Set it to a default path.
67
+ */
68
+ protected internalPath: string;
69
+ protected params: Record<string, unknown>;
70
+ get path(): string;
71
+ set path(path: string);
72
+ /**
73
+ * Prepare the request parameters
74
+ */
75
+ getQueryParams(): Record<string, unknown>;
76
+ getFormattedResultTypeList(): string | string[];
77
+ abstract setRequestedResult(args: unknown): void;
78
+ }
79
+ /**
80
+ * Utility function used in conjunction with a async/await and/or Promise
81
+ */
82
+ export declare function sleep(ms: number): Promise<void>;
@@ -0,0 +1,188 @@
1
+ import { Logger } from "./logger.js";
2
+ export const mainLangs = ["eng", "deu", "zho", "slv", "spa"];
3
+ export const allLangs = ["eng", "deu", "spa", "cat", "por", "ita", "fra", "rus", "ara", "tur", "zho", "slv", "hrv", "srp"];
4
+ // Utility classes for Event Registry
5
+ export class QueryItems {
6
+ constructor(oper, items) {
7
+ this.oper = oper;
8
+ this.items = items;
9
+ }
10
+ getOper() {
11
+ return this.oper;
12
+ }
13
+ getItems() {
14
+ return this.items;
15
+ }
16
+ }
17
+ QueryItems.AND = (items) => new QueryItems("$and", items);
18
+ QueryItems.OR = (items) => new QueryItems("$or", items);
19
+ /**
20
+ * @class QueryParamsBase
21
+ * Base class for Query and AdminQuery
22
+ * used for storing parameters for a query. Parameter values can either be
23
+ * simple values (set by setVal()) or an array of values (set by multiple
24
+ * calls to addArrayVal() method)
25
+ */
26
+ export class QueryParamsBase {
27
+ constructor() {
28
+ this.params = {};
29
+ }
30
+ /**
31
+ * Encode datetime into UTC ISO format which can be sent to ER.
32
+ */
33
+ static encodeDateTime(val, format) {
34
+ // As in the Python SDK, a datetime string without a zone is UTC, not local time.
35
+ const zoneless = typeof val === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?$/.test(val);
36
+ const date = val instanceof Date ? val : new Date(zoneless ? `${val}Z` : val);
37
+ if (isNaN(date.getTime())) {
38
+ throw new Error("Datetime was not recognizable. Use `new Date()` or string in ISO format");
39
+ }
40
+ if (format === "YYYY-MM-DD") {
41
+ return date.toISOString().slice(0, 10);
42
+ }
43
+ if (zoneless) {
44
+ return val;
45
+ }
46
+ // The API takes UTC without a zone suffix, which is what the Python SDK sends.
47
+ return date.toISOString().replace(/(\.000)?Z$/, "");
48
+ }
49
+ /**
50
+ * Return the parameters.
51
+ */
52
+ getQueryParams() {
53
+ return this.params;
54
+ }
55
+ /**
56
+ * Set a value of a property in the query.
57
+ */
58
+ setVal(key, value) {
59
+ this.params[key] = value;
60
+ }
61
+ /**
62
+ * Do we have in the query property named 'key'?
63
+ */
64
+ hasVal(key) {
65
+ return this.params.hasOwnProperty(key);
66
+ }
67
+ /**
68
+ * Remove the value of a property key (if existing).
69
+ */
70
+ clearVal(key) {
71
+ delete this.params[key];
72
+ }
73
+ /**
74
+ * Add a value to an array of values for a property.
75
+ */
76
+ addArrayVal(key, val) {
77
+ this.params[key] = [...(this.params[key] || []), val];
78
+ }
79
+ /**
80
+ * Set value in query params if the 'val' is different from 'defVal'.
81
+ */
82
+ setValIfNotDefault(propName, val, defVal) {
83
+ if (val !== defVal) {
84
+ this.setVal(propName, val);
85
+ }
86
+ }
87
+ /**
88
+ * Set a property value that represents date.
89
+ * Value can be string in YYYY-MM-DD format or a Date object.
90
+ */
91
+ setDateVal(propName, val) {
92
+ this.setVal(propName, QueryParamsBase.encodeDateTime(val, "YYYY-MM-DD"));
93
+ }
94
+ /**
95
+ * Parse the value "value" and use it to set the property propName and the operator with name propOperName
96
+ * @param value String, QueryItems or an array.
97
+ * @param propName Values to be set using property name propName.
98
+ * @param propOperName Property to set containing the "and" or "or". Relevant only if multiple items are provided in "value". Can be None if only one value is possible.
99
+ * @param defaultOperName Which operator should be used in case "value" is an array. If an array, we will print also a warning to suggest use of QueryItems.
100
+ */
101
+ setQueryArrVal(value, propName, propOperName, defaultOperName) {
102
+ if (!value) {
103
+ return;
104
+ }
105
+ if (value instanceof QueryItems) {
106
+ this.params[propName] = value.getItems();
107
+ const formattedOperator = value.getOper().replace(/\$/g, "");
108
+ if (propOperName) {
109
+ this.params[propOperName] = formattedOperator;
110
+ }
111
+ if (propOperName === undefined && formattedOperator !== defaultOperName) {
112
+ throw new Error(`An invalid operator type '${formattedOperator}' was used for property '${propName}'`);
113
+ }
114
+ }
115
+ else if (typeof value === "string") {
116
+ this.params[propName] = value;
117
+ }
118
+ else if (Array.isArray(value)) {
119
+ this.params[propName] = value;
120
+ if (propOperName !== undefined) {
121
+ this.params[propOperName] = defaultOperName;
122
+ if (value.length > 1) {
123
+ Logger.warn(`
124
+ Warning: The value of parameter '${propName}' was provided as a list and '${defaultOperName}' operator was used implicitly between the items.
125
+ We suggest specifying the list using the QueryItems.AND() or QueryItems.OR() to ensure the appropriate operator is used.
126
+ `);
127
+ }
128
+ }
129
+ }
130
+ else {
131
+ throw new Error(`Parameter '${propName}' was of unsupported type. It should either be None, a string or an instance of QueryItems`);
132
+ }
133
+ }
134
+ }
135
+ export class Query extends QueryParamsBase {
136
+ constructor() {
137
+ super(...arguments);
138
+ this.resultTypeList = [];
139
+ /**
140
+ * Set it to a default path.
141
+ */
142
+ this.internalPath = "";
143
+ this.params = {};
144
+ }
145
+ get path() {
146
+ return this.internalPath;
147
+ }
148
+ set path(path) {
149
+ this.internalPath = path;
150
+ }
151
+ /**
152
+ * Prepare the request parameters
153
+ */
154
+ getQueryParams() {
155
+ if (this.resultTypeList.length === 0) {
156
+ throw new Error("The query does not have any result type specified. No sense in performing such a query");
157
+ }
158
+ let allParams = this.params;
159
+ for (const resultType of this.resultTypeList) {
160
+ allParams = { ...allParams, ...resultType?.params };
161
+ }
162
+ const formattedResultTypeList = this.getFormattedResultTypeList();
163
+ if (formattedResultTypeList?.length > 0) {
164
+ allParams = { ...allParams, resultType: formattedResultTypeList };
165
+ }
166
+ return structuredClone(allParams);
167
+ }
168
+ getFormattedResultTypeList() {
169
+ if (!this.resultTypeList.every((result) => result?.resultType !== undefined)) {
170
+ return [];
171
+ }
172
+ if (this.resultTypeList.length === 1) {
173
+ return this.resultTypeList[0]?.resultType;
174
+ }
175
+ else {
176
+ return this.resultTypeList.map((result) => result?.resultType);
177
+ }
178
+ }
179
+ }
180
+ /**
181
+ * Utility function used in conjunction with a async/await and/or Promise
182
+ */
183
+ export function sleep(ms) {
184
+ return new Promise((resolve) => {
185
+ setTimeout(resolve, ms);
186
+ });
187
+ }
188
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK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E,UAAU,CAAC;QAC1E,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAE,MAAiC,EAAE,UAAU,CAAC,CAAC;QAC/F,CAAC;IACL,CAAC;CAGJ;AAED;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,EAAU;IAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC3B,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { QueryParamsBase } from "./base.js";
2
+ import { ER } from "./types.js";
3
+ export declare abstract class CountsBase extends QueryParamsBase {
4
+ get path(): string;
5
+ }
6
+ /**
7
+ * @class GetCounts
8
+ * Obtain information about how frequently a concept or category is mentioned in the articles on particular dates
9
+ * by specifying source="custom" one can obtain counts for custom concepts, such as stocks, macroeconomic indicators, etc. The uri
10
+ * for these can be found using EventRegistry.getCustomConceptUri() method.
11
+ * Usage example:
12
+ *
13
+ * q = GetCounts([er.getConceptUri("Obama"), er.getConceptUri("ebola")])
14
+ * ret = er.execQuery(q)
15
+ *
16
+ * Return object:
17
+ *
18
+ * {
19
+ * "http://en.wikipedia.org/wiki/Barack_Obama": [
20
+ * {
21
+ * "count": 1,
22
+ * "date": "2015-05-07"
23
+ * },
24
+ * {
25
+ * "count": 4,
26
+ * "date": "2015-05-08"
27
+ * },
28
+ * ...
29
+ * ],
30
+ * "http://en.wikipedia.org/wiki/Ebola_virus_disease": [
31
+ * {
32
+ * "count": 0,
33
+ * "date": "2015-05-07"
34
+ * },
35
+ * ...a
36
+ * ]
37
+ * }
38
+ *
39
+ * @param uriOrUriList: concept/category uri or a list of uris
40
+ * @param args Object which contains a host of optional parameters
41
+ */
42
+ export declare class GetCounts extends CountsBase {
43
+ constructor(uriOrUriList: string | string[], args?: ER.Counts.Arguments);
44
+ }
45
+ /**
46
+ * @class GetCountsEx
47
+ * Obtain information about how frequently a concept or category is mentioned in the articles on particular dates
48
+ * Similar to GetCounts, but the output is more friendly for a larger set of provided uris/ids at once
49
+ * Usage example:
50
+ * q = GetCountsEx(type = "category")
51
+ * q.queryById(range(10)) # return trends of first 10 categories
52
+ * ret = er.execQuery(q)
53
+ * Return object:
54
+ * {
55
+ * "categoryInfo": [
56
+ * {
57
+ * "id": 0,
58
+ * "label": "Root",
59
+ * "uri": "http://www.dmoz.org"
60
+ * },
61
+ * {
62
+ * "id": 1,
63
+ * "label": "Recreation",
64
+ * "uri": "http://www.dmoz.org/Recreation"
65
+ * },
66
+ * ...
67
+ * ],
68
+ * "counts": [
69
+ * {
70
+ * "0": 23, "1": 42, "2": 52, "3": 32, "4": 21, "5": 65, "6": 32, "7": 654, "8": 1, "9": 34,
71
+ * "date": "2015-05-07"
72
+ * },
73
+ * ...
74
+ * ]
75
+ * }
76
+ * @param uriOrUriList: concept/category uri or a list of uris
77
+ * @param args Object which contains a host of optional parameters
78
+ */
79
+ export declare class GetCountsEx extends CountsBase {
80
+ constructor(uriOrUriList: string | string[], args?: ER.Counts.Arguments);
81
+ }