@ncukondo/search-hub 0.12.1 → 0.12.2

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 (334) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +30 -0
  2. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  3. package/dist/_virtual/aliases.js +5 -0
  4. package/dist/_virtual/aliases.js.map +1 -0
  5. package/dist/_virtual/attributes.js +5 -0
  6. package/dist/_virtual/attributes.js.map +1 -0
  7. package/dist/_virtual/back.js +5 -0
  8. package/dist/_virtual/back.js.map +1 -0
  9. package/dist/_virtual/comment.js +5 -0
  10. package/dist/_virtual/comment.js.map +1 -0
  11. package/dist/_virtual/compile.js +5 -0
  12. package/dist/_virtual/compile.js.map +1 -0
  13. package/dist/_virtual/compile2.js +5 -0
  14. package/dist/_virtual/compile2.js.map +1 -0
  15. package/dist/_virtual/decode-data-html.js +5 -0
  16. package/dist/_virtual/decode-data-html.js.map +1 -0
  17. package/dist/_virtual/decode-data-xml.js +5 -0
  18. package/dist/_virtual/decode-data-xml.js.map +1 -0
  19. package/dist/_virtual/decode.js +5 -0
  20. package/dist/_virtual/decode.js.map +1 -0
  21. package/dist/_virtual/decode_codepoint.js +5 -0
  22. package/dist/_virtual/decode_codepoint.js.map +1 -0
  23. package/dist/_virtual/encode-html.js +5 -0
  24. package/dist/_virtual/encode-html.js.map +1 -0
  25. package/dist/_virtual/encode.js +5 -0
  26. package/dist/_virtual/encode.js.map +1 -0
  27. package/dist/_virtual/escape.js +5 -0
  28. package/dist/_virtual/escape.js.map +1 -0
  29. package/dist/_virtual/feeds.js +5 -0
  30. package/dist/_virtual/feeds.js.map +1 -0
  31. package/dist/_virtual/filters.js +5 -0
  32. package/dist/_virtual/filters.js.map +1 -0
  33. package/dist/_virtual/foreignNames.js +5 -0
  34. package/dist/_virtual/foreignNames.js.map +1 -0
  35. package/dist/_virtual/general.js +5 -0
  36. package/dist/_virtual/general.js.map +1 -0
  37. package/dist/_virtual/he.js +5 -0
  38. package/dist/_virtual/he.js.map +1 -0
  39. package/dist/_virtual/helpers.js +5 -0
  40. package/dist/_virtual/helpers.js.map +1 -0
  41. package/dist/_virtual/html.js +5 -0
  42. package/dist/_virtual/html.js.map +1 -0
  43. package/dist/_virtual/index.js +6 -0
  44. package/dist/_virtual/index.js.map +1 -0
  45. package/dist/_virtual/index10.js +5 -0
  46. package/dist/_virtual/index10.js.map +1 -0
  47. package/dist/_virtual/index11.js +5 -0
  48. package/dist/_virtual/index11.js.map +1 -0
  49. package/dist/_virtual/index2.js +5 -0
  50. package/dist/_virtual/index2.js.map +1 -0
  51. package/dist/_virtual/index3.js +5 -0
  52. package/dist/_virtual/index3.js.map +1 -0
  53. package/dist/_virtual/index4.js +5 -0
  54. package/dist/_virtual/index4.js.map +1 -0
  55. package/dist/_virtual/index5.js +7 -0
  56. package/dist/_virtual/index5.js.map +1 -0
  57. package/dist/_virtual/index6.js +5 -0
  58. package/dist/_virtual/index6.js.map +1 -0
  59. package/dist/_virtual/index7.js +5 -0
  60. package/dist/_virtual/index7.js.map +1 -0
  61. package/dist/_virtual/index8.js +5 -0
  62. package/dist/_virtual/index8.js.map +1 -0
  63. package/dist/_virtual/index9.js +5 -0
  64. package/dist/_virtual/index9.js.map +1 -0
  65. package/dist/_virtual/legacy.js +5 -0
  66. package/dist/_virtual/legacy.js.map +1 -0
  67. package/dist/_virtual/manipulation.js +5 -0
  68. package/dist/_virtual/manipulation.js.map +1 -0
  69. package/dist/_virtual/matcher.js +5 -0
  70. package/dist/_virtual/matcher.js.map +1 -0
  71. package/dist/_virtual/node.js +5 -0
  72. package/dist/_virtual/node.js.map +1 -0
  73. package/dist/_virtual/node2.js +5 -0
  74. package/dist/_virtual/node2.js.map +1 -0
  75. package/dist/_virtual/parse.js +5 -0
  76. package/dist/_virtual/parse.js.map +1 -0
  77. package/dist/_virtual/parse2.js +5 -0
  78. package/dist/_virtual/parse2.js.map +1 -0
  79. package/dist/_virtual/pseudos.js +5 -0
  80. package/dist/_virtual/pseudos.js.map +1 -0
  81. package/dist/_virtual/querying.js +5 -0
  82. package/dist/_virtual/querying.js.map +1 -0
  83. package/dist/_virtual/sort.js +5 -0
  84. package/dist/_virtual/sort.js.map +1 -0
  85. package/dist/_virtual/stringify.js +5 -0
  86. package/dist/_virtual/stringify.js.map +1 -0
  87. package/dist/_virtual/subselects.js +5 -0
  88. package/dist/_virtual/subselects.js.map +1 -0
  89. package/dist/_virtual/text.js +5 -0
  90. package/dist/_virtual/text.js.map +1 -0
  91. package/dist/_virtual/traversal.js +5 -0
  92. package/dist/_virtual/traversal.js.map +1 -0
  93. package/dist/_virtual/type.js +5 -0
  94. package/dist/_virtual/type.js.map +1 -0
  95. package/dist/_virtual/valid.js +5 -0
  96. package/dist/_virtual/valid.js.map +1 -0
  97. package/dist/_virtual/void-tag.js +5 -0
  98. package/dist/_virtual/void-tag.js.map +1 -0
  99. package/dist/cli/commands/fulltext/attach.js +1 -1
  100. package/dist/cli/commands/fulltext/attach.js.map +1 -1
  101. package/dist/cli/commands/fulltext/check.d.ts +1 -2
  102. package/dist/cli/commands/fulltext/check.d.ts.map +1 -1
  103. package/dist/cli/commands/fulltext/check.js +4 -2
  104. package/dist/cli/commands/fulltext/check.js.map +1 -1
  105. package/dist/cli/commands/fulltext/convert.d.ts.map +1 -1
  106. package/dist/cli/commands/fulltext/convert.js +8 -8
  107. package/dist/cli/commands/fulltext/convert.js.map +1 -1
  108. package/dist/cli/commands/fulltext/fetch.d.ts.map +1 -1
  109. package/dist/cli/commands/fulltext/fetch.js +10 -6
  110. package/dist/cli/commands/fulltext/fetch.js.map +1 -1
  111. package/dist/cli/commands/fulltext/index.d.ts.map +1 -1
  112. package/dist/cli/commands/fulltext/index.js +2 -0
  113. package/dist/cli/commands/fulltext/index.js.map +1 -1
  114. package/dist/cli/commands/fulltext/init.d.ts.map +1 -1
  115. package/dist/cli/commands/fulltext/init.js +6 -5
  116. package/dist/cli/commands/fulltext/init.js.map +1 -1
  117. package/dist/cli/commands/fulltext/pending.d.ts +1 -1
  118. package/dist/cli/commands/fulltext/pending.d.ts.map +1 -1
  119. package/dist/cli/commands/fulltext/pending.js +4 -2
  120. package/dist/cli/commands/fulltext/pending.js.map +1 -1
  121. package/dist/cli/commands/fulltext/status.d.ts.map +1 -1
  122. package/dist/cli/commands/fulltext/status.js +4 -2
  123. package/dist/cli/commands/fulltext/status.js.map +1 -1
  124. package/dist/cli/commands/fulltext/sync.d.ts.map +1 -1
  125. package/dist/cli/commands/fulltext/sync.js +6 -2
  126. package/dist/cli/commands/fulltext/sync.js.map +1 -1
  127. package/dist/cli/commands/review/types.d.ts +1 -1
  128. package/dist/cli/commands/review/types.d.ts.map +1 -1
  129. package/dist/cli/commands/review/types.js.map +1 -1
  130. package/dist/config/schema.d.ts +2 -0
  131. package/dist/config/schema.d.ts.map +1 -1
  132. package/dist/config/schema.js +6 -0
  133. package/dist/config/schema.js.map +1 -1
  134. package/dist/{fulltext → integration}/attach-shared.d.ts +2 -2
  135. package/dist/integration/attach-shared.d.ts.map +1 -0
  136. package/dist/integration/attach-shared.js.map +1 -0
  137. package/dist/integration/fulltext-attach.js +1 -1
  138. package/dist/integration/fulltext-attach.js.map +1 -1
  139. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/citation-key.js +1 -1
  140. package/dist/node_modules/@ncukondo/academic-fulltext/dist/citation-key.js.map +1 -0
  141. package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/arxiv-html-parser.js +434 -0
  142. package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/arxiv-html-parser.js.map +1 -0
  143. package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/index.js +93 -0
  144. package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/index.js.map +1 -0
  145. package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/jats-parser.js +1060 -0
  146. package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/jats-parser.js.map +1 -0
  147. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/convert/markdown-writer.js +146 -117
  148. package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/markdown-writer.js.map +1 -0
  149. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/arxiv.js +8 -1
  150. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/arxiv.js.map +1 -0
  151. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/core.js +6 -3
  152. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/core.js.map +1 -0
  153. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/index.js +139 -0
  154. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/index.js.map +1 -0
  155. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/ncbi-id-converter.js +46 -0
  156. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/ncbi-id-converter.js.map +1 -0
  157. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/pmc.js +8 -4
  158. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/pmc.js.map +1 -0
  159. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/unpaywall.js +43 -9
  160. package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/unpaywall.js.map +1 -0
  161. package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/arxiv-html.js +48 -0
  162. package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/arxiv-html.js.map +1 -0
  163. package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/downloader.js +64 -0
  164. package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/downloader.js.map +1 -0
  165. package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/orchestrator.js +236 -0
  166. package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/orchestrator.js.map +1 -0
  167. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/download/pmc-xml.js +2 -1
  168. package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/pmc-xml.js.map +1 -0
  169. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/meta.js +15 -10
  170. package/dist/node_modules/@ncukondo/academic-fulltext/dist/meta.js.map +1 -0
  171. package/dist/node_modules/@ncukondo/academic-fulltext/dist/paths.js.map +1 -0
  172. package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/readme.js +8 -4
  173. package/dist/node_modules/@ncukondo/academic-fulltext/dist/readme.js.map +1 -0
  174. package/dist/node_modules/boolbase/index.js +19 -0
  175. package/dist/node_modules/boolbase/index.js.map +1 -0
  176. package/dist/node_modules/css-select/lib/attributes.js +203 -0
  177. package/dist/node_modules/css-select/lib/attributes.js.map +1 -0
  178. package/dist/node_modules/css-select/lib/compile.js +141 -0
  179. package/dist/node_modules/css-select/lib/compile.js.map +1 -0
  180. package/dist/node_modules/css-select/lib/general.js +154 -0
  181. package/dist/node_modules/css-select/lib/general.js.map +1 -0
  182. package/dist/node_modules/css-select/lib/index.js +128 -0
  183. package/dist/node_modules/css-select/lib/index.js.map +1 -0
  184. package/dist/node_modules/css-select/lib/pseudo-selectors/aliases.js +40 -0
  185. package/dist/node_modules/css-select/lib/pseudo-selectors/aliases.js.map +1 -0
  186. package/dist/node_modules/css-select/lib/pseudo-selectors/filters.js +163 -0
  187. package/dist/node_modules/css-select/lib/pseudo-selectors/filters.js.map +1 -0
  188. package/dist/node_modules/css-select/lib/pseudo-selectors/index.js +71 -0
  189. package/dist/node_modules/css-select/lib/pseudo-selectors/index.js.map +1 -0
  190. package/dist/node_modules/css-select/lib/pseudo-selectors/pseudos.js +93 -0
  191. package/dist/node_modules/css-select/lib/pseudo-selectors/pseudos.js.map +1 -0
  192. package/dist/node_modules/css-select/lib/pseudo-selectors/subselects.js +111 -0
  193. package/dist/node_modules/css-select/lib/pseudo-selectors/subselects.js.map +1 -0
  194. package/dist/node_modules/css-select/lib/sort.js +78 -0
  195. package/dist/node_modules/css-select/lib/sort.js.map +1 -0
  196. package/dist/node_modules/css-what/lib/es/index.js +12 -0
  197. package/dist/node_modules/css-what/lib/es/index.js.map +1 -0
  198. package/dist/node_modules/css-what/lib/es/parse.js +349 -0
  199. package/dist/node_modules/css-what/lib/es/parse.js.map +1 -0
  200. package/dist/node_modules/css-what/lib/es/stringify.js +102 -0
  201. package/dist/node_modules/css-what/lib/es/stringify.js.map +1 -0
  202. package/dist/node_modules/css-what/lib/es/types.js +37 -0
  203. package/dist/node_modules/css-what/lib/es/types.js.map +1 -0
  204. package/dist/node_modules/dom-serializer/lib/foreignNames.js +117 -0
  205. package/dist/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
  206. package/dist/node_modules/dom-serializer/lib/index.js +207 -0
  207. package/dist/node_modules/dom-serializer/lib/index.js.map +1 -0
  208. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js +368 -0
  209. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +1 -0
  210. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js +70 -0
  211. package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map +1 -0
  212. package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js +61 -0
  213. package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map +1 -0
  214. package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js +79 -0
  215. package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map +1 -0
  216. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +18 -0
  217. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
  218. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +18 -0
  219. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
  220. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js +19 -0
  221. package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map +1 -0
  222. package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js +139 -0
  223. package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js.map +1 -0
  224. package/dist/node_modules/domelementtype/lib/index.js +40 -0
  225. package/dist/node_modules/domelementtype/lib/index.js.map +1 -0
  226. package/dist/node_modules/domhandler/lib/index.js +167 -0
  227. package/dist/node_modules/domhandler/lib/index.js.map +1 -0
  228. package/dist/node_modules/domhandler/lib/node.js +439 -0
  229. package/dist/node_modules/domhandler/lib/node.js.map +1 -0
  230. package/dist/node_modules/domutils/lib/feeds.js +146 -0
  231. package/dist/node_modules/domutils/lib/feeds.js.map +1 -0
  232. package/dist/node_modules/domutils/lib/helpers.js +97 -0
  233. package/dist/node_modules/domutils/lib/helpers.js.map +1 -0
  234. package/dist/node_modules/domutils/lib/index.js +65 -0
  235. package/dist/node_modules/domutils/lib/index.js.map +1 -0
  236. package/dist/node_modules/domutils/lib/legacy.js +124 -0
  237. package/dist/node_modules/domutils/lib/legacy.js.map +1 -0
  238. package/dist/node_modules/domutils/lib/manipulation.js +107 -0
  239. package/dist/node_modules/domutils/lib/manipulation.js.map +1 -0
  240. package/dist/node_modules/domutils/lib/querying.js +102 -0
  241. package/dist/node_modules/domutils/lib/querying.js.map +1 -0
  242. package/dist/node_modules/domutils/lib/stringify.js +65 -0
  243. package/dist/node_modules/domutils/lib/stringify.js.map +1 -0
  244. package/dist/node_modules/domutils/lib/traversal.js +69 -0
  245. package/dist/node_modules/domutils/lib/traversal.js.map +1 -0
  246. package/dist/node_modules/he/he.js +256 -0
  247. package/dist/node_modules/he/he.js.map +1 -0
  248. package/dist/node_modules/node-html-parser/dist/back.js +16 -0
  249. package/dist/node_modules/node-html-parser/dist/back.js.map +1 -0
  250. package/dist/node_modules/node-html-parser/dist/index.js +48 -0
  251. package/dist/node_modules/node-html-parser/dist/index.js.map +1 -0
  252. package/dist/node_modules/node-html-parser/dist/matcher.js +112 -0
  253. package/dist/node_modules/node-html-parser/dist/matcher.js.map +1 -0
  254. package/dist/node_modules/node-html-parser/dist/nodes/comment.js +41 -0
  255. package/dist/node_modules/node-html-parser/dist/nodes/comment.js.map +1 -0
  256. package/dist/node_modules/node-html-parser/dist/nodes/html.js +1048 -0
  257. package/dist/node_modules/node-html-parser/dist/nodes/html.js.map +1 -0
  258. package/dist/node_modules/node-html-parser/dist/nodes/node.js +49 -0
  259. package/dist/node_modules/node-html-parser/dist/nodes/node.js.map +1 -0
  260. package/dist/node_modules/node-html-parser/dist/nodes/text.js +106 -0
  261. package/dist/node_modules/node-html-parser/dist/nodes/text.js.map +1 -0
  262. package/dist/node_modules/node-html-parser/dist/nodes/type.js +19 -0
  263. package/dist/node_modules/node-html-parser/dist/nodes/type.js.map +1 -0
  264. package/dist/node_modules/node-html-parser/dist/parse.js +20 -0
  265. package/dist/node_modules/node-html-parser/dist/parse.js.map +1 -0
  266. package/dist/node_modules/node-html-parser/dist/valid.js +19 -0
  267. package/dist/node_modules/node-html-parser/dist/valid.js.map +1 -0
  268. package/dist/node_modules/node-html-parser/dist/void-tag.js +36 -0
  269. package/dist/node_modules/node-html-parser/dist/void-tag.js.map +1 -0
  270. package/dist/node_modules/nth-check/lib/compile.js +76 -0
  271. package/dist/node_modules/nth-check/lib/compile.js.map +1 -0
  272. package/dist/node_modules/nth-check/lib/index.js +36 -0
  273. package/dist/node_modules/nth-check/lib/index.js.map +1 -0
  274. package/dist/node_modules/nth-check/lib/parse.js +69 -0
  275. package/dist/node_modules/nth-check/lib/parse.js.map +1 -0
  276. package/package.json +2 -2
  277. package/dist/fulltext/attach-shared.d.ts.map +0 -1
  278. package/dist/fulltext/attach-shared.js.map +0 -1
  279. package/dist/fulltext/citation-key.d.ts +0 -15
  280. package/dist/fulltext/citation-key.d.ts.map +0 -1
  281. package/dist/fulltext/citation-key.js.map +0 -1
  282. package/dist/fulltext/convert/index.d.ts +0 -20
  283. package/dist/fulltext/convert/index.d.ts.map +0 -1
  284. package/dist/fulltext/convert/index.js +0 -50
  285. package/dist/fulltext/convert/index.js.map +0 -1
  286. package/dist/fulltext/convert/jats-parser.d.ts +0 -36
  287. package/dist/fulltext/convert/jats-parser.d.ts.map +0 -1
  288. package/dist/fulltext/convert/jats-parser.js +0 -887
  289. package/dist/fulltext/convert/jats-parser.js.map +0 -1
  290. package/dist/fulltext/convert/markdown-writer.d.ts +0 -6
  291. package/dist/fulltext/convert/markdown-writer.d.ts.map +0 -1
  292. package/dist/fulltext/convert/markdown-writer.js.map +0 -1
  293. package/dist/fulltext/convert/types.d.ts +0 -141
  294. package/dist/fulltext/convert/types.d.ts.map +0 -1
  295. package/dist/fulltext/discovery/arxiv.d.ts +0 -11
  296. package/dist/fulltext/discovery/arxiv.d.ts.map +0 -1
  297. package/dist/fulltext/discovery/arxiv.js.map +0 -1
  298. package/dist/fulltext/discovery/core.d.ts +0 -11
  299. package/dist/fulltext/discovery/core.d.ts.map +0 -1
  300. package/dist/fulltext/discovery/core.js.map +0 -1
  301. package/dist/fulltext/discovery/index.d.ts +0 -28
  302. package/dist/fulltext/discovery/index.d.ts.map +0 -1
  303. package/dist/fulltext/discovery/index.js +0 -75
  304. package/dist/fulltext/discovery/index.js.map +0 -1
  305. package/dist/fulltext/discovery/pmc.d.ts +0 -19
  306. package/dist/fulltext/discovery/pmc.d.ts.map +0 -1
  307. package/dist/fulltext/discovery/pmc.js.map +0 -1
  308. package/dist/fulltext/discovery/unpaywall.d.ts +0 -11
  309. package/dist/fulltext/discovery/unpaywall.d.ts.map +0 -1
  310. package/dist/fulltext/discovery/unpaywall.js.map +0 -1
  311. package/dist/fulltext/download/downloader.d.ts +0 -21
  312. package/dist/fulltext/download/downloader.d.ts.map +0 -1
  313. package/dist/fulltext/download/downloader.js +0 -59
  314. package/dist/fulltext/download/downloader.js.map +0 -1
  315. package/dist/fulltext/download/orchestrator.d.ts +0 -33
  316. package/dist/fulltext/download/orchestrator.d.ts.map +0 -1
  317. package/dist/fulltext/download/orchestrator.js +0 -125
  318. package/dist/fulltext/download/orchestrator.js.map +0 -1
  319. package/dist/fulltext/download/pmc-xml.d.ts +0 -13
  320. package/dist/fulltext/download/pmc-xml.d.ts.map +0 -1
  321. package/dist/fulltext/download/pmc-xml.js.map +0 -1
  322. package/dist/fulltext/meta.d.ts +0 -25
  323. package/dist/fulltext/meta.d.ts.map +0 -1
  324. package/dist/fulltext/meta.js.map +0 -1
  325. package/dist/fulltext/paths.d.ts +0 -12
  326. package/dist/fulltext/paths.d.ts.map +0 -1
  327. package/dist/fulltext/paths.js.map +0 -1
  328. package/dist/fulltext/readme.d.ts +0 -4
  329. package/dist/fulltext/readme.d.ts.map +0 -1
  330. package/dist/fulltext/readme.js.map +0 -1
  331. package/dist/fulltext/types.d.ts +0 -90
  332. package/dist/fulltext/types.d.ts.map +0 -1
  333. /package/dist/{fulltext → integration}/attach-shared.js +0 -0
  334. /package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/paths.js +0 -0
@@ -0,0 +1,439 @@
1
+ import { __exports as node } from "../../../_virtual/node2.js";
2
+ import { __require as requireLib } from "../../domelementtype/lib/index.js";
3
+ var hasRequiredNode;
4
+ function requireNode() {
5
+ if (hasRequiredNode) return node;
6
+ hasRequiredNode = 1;
7
+ var __extends = node && node.__extends || /* @__PURE__ */ (function() {
8
+ var extendStatics = function(d, b) {
9
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
10
+ d2.__proto__ = b2;
11
+ } || function(d2, b2) {
12
+ for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
13
+ };
14
+ return extendStatics(d, b);
15
+ };
16
+ return function(d, b) {
17
+ if (typeof b !== "function" && b !== null)
18
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
19
+ extendStatics(d, b);
20
+ function __() {
21
+ this.constructor = d;
22
+ }
23
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
24
+ };
25
+ })();
26
+ var __assign = node && node.__assign || function() {
27
+ __assign = Object.assign || function(t) {
28
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
29
+ s = arguments[i];
30
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
31
+ t[p] = s[p];
32
+ }
33
+ return t;
34
+ };
35
+ return __assign.apply(this, arguments);
36
+ };
37
+ Object.defineProperty(node, "__esModule", { value: true });
38
+ node.cloneNode = node.hasChildren = node.isDocument = node.isDirective = node.isComment = node.isText = node.isCDATA = node.isTag = node.Element = node.Document = node.CDATA = node.NodeWithChildren = node.ProcessingInstruction = node.Comment = node.Text = node.DataNode = node.Node = void 0;
39
+ var domelementtype_1 = /* @__PURE__ */ requireLib();
40
+ var Node = (
41
+ /** @class */
42
+ (function() {
43
+ function Node2() {
44
+ this.parent = null;
45
+ this.prev = null;
46
+ this.next = null;
47
+ this.startIndex = null;
48
+ this.endIndex = null;
49
+ }
50
+ Object.defineProperty(Node2.prototype, "parentNode", {
51
+ // Read-write aliases for properties
52
+ /**
53
+ * Same as {@link parent}.
54
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
55
+ */
56
+ get: function() {
57
+ return this.parent;
58
+ },
59
+ set: function(parent) {
60
+ this.parent = parent;
61
+ },
62
+ enumerable: false,
63
+ configurable: true
64
+ });
65
+ Object.defineProperty(Node2.prototype, "previousSibling", {
66
+ /**
67
+ * Same as {@link prev}.
68
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
69
+ */
70
+ get: function() {
71
+ return this.prev;
72
+ },
73
+ set: function(prev) {
74
+ this.prev = prev;
75
+ },
76
+ enumerable: false,
77
+ configurable: true
78
+ });
79
+ Object.defineProperty(Node2.prototype, "nextSibling", {
80
+ /**
81
+ * Same as {@link next}.
82
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
83
+ */
84
+ get: function() {
85
+ return this.next;
86
+ },
87
+ set: function(next) {
88
+ this.next = next;
89
+ },
90
+ enumerable: false,
91
+ configurable: true
92
+ });
93
+ Node2.prototype.cloneNode = function(recursive) {
94
+ if (recursive === void 0) {
95
+ recursive = false;
96
+ }
97
+ return cloneNode(this, recursive);
98
+ };
99
+ return Node2;
100
+ })()
101
+ );
102
+ node.Node = Node;
103
+ var DataNode = (
104
+ /** @class */
105
+ (function(_super) {
106
+ __extends(DataNode2, _super);
107
+ function DataNode2(data) {
108
+ var _this = _super.call(this) || this;
109
+ _this.data = data;
110
+ return _this;
111
+ }
112
+ Object.defineProperty(DataNode2.prototype, "nodeValue", {
113
+ /**
114
+ * Same as {@link data}.
115
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
116
+ */
117
+ get: function() {
118
+ return this.data;
119
+ },
120
+ set: function(data) {
121
+ this.data = data;
122
+ },
123
+ enumerable: false,
124
+ configurable: true
125
+ });
126
+ return DataNode2;
127
+ })(Node)
128
+ );
129
+ node.DataNode = DataNode;
130
+ var Text = (
131
+ /** @class */
132
+ (function(_super) {
133
+ __extends(Text2, _super);
134
+ function Text2() {
135
+ var _this = _super !== null && _super.apply(this, arguments) || this;
136
+ _this.type = domelementtype_1.ElementType.Text;
137
+ return _this;
138
+ }
139
+ Object.defineProperty(Text2.prototype, "nodeType", {
140
+ get: function() {
141
+ return 3;
142
+ },
143
+ enumerable: false,
144
+ configurable: true
145
+ });
146
+ return Text2;
147
+ })(DataNode)
148
+ );
149
+ node.Text = Text;
150
+ var Comment = (
151
+ /** @class */
152
+ (function(_super) {
153
+ __extends(Comment2, _super);
154
+ function Comment2() {
155
+ var _this = _super !== null && _super.apply(this, arguments) || this;
156
+ _this.type = domelementtype_1.ElementType.Comment;
157
+ return _this;
158
+ }
159
+ Object.defineProperty(Comment2.prototype, "nodeType", {
160
+ get: function() {
161
+ return 8;
162
+ },
163
+ enumerable: false,
164
+ configurable: true
165
+ });
166
+ return Comment2;
167
+ })(DataNode)
168
+ );
169
+ node.Comment = Comment;
170
+ var ProcessingInstruction = (
171
+ /** @class */
172
+ (function(_super) {
173
+ __extends(ProcessingInstruction2, _super);
174
+ function ProcessingInstruction2(name, data) {
175
+ var _this = _super.call(this, data) || this;
176
+ _this.name = name;
177
+ _this.type = domelementtype_1.ElementType.Directive;
178
+ return _this;
179
+ }
180
+ Object.defineProperty(ProcessingInstruction2.prototype, "nodeType", {
181
+ get: function() {
182
+ return 1;
183
+ },
184
+ enumerable: false,
185
+ configurable: true
186
+ });
187
+ return ProcessingInstruction2;
188
+ })(DataNode)
189
+ );
190
+ node.ProcessingInstruction = ProcessingInstruction;
191
+ var NodeWithChildren = (
192
+ /** @class */
193
+ (function(_super) {
194
+ __extends(NodeWithChildren2, _super);
195
+ function NodeWithChildren2(children) {
196
+ var _this = _super.call(this) || this;
197
+ _this.children = children;
198
+ return _this;
199
+ }
200
+ Object.defineProperty(NodeWithChildren2.prototype, "firstChild", {
201
+ // Aliases
202
+ /** First child of the node. */
203
+ get: function() {
204
+ var _a;
205
+ return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;
206
+ },
207
+ enumerable: false,
208
+ configurable: true
209
+ });
210
+ Object.defineProperty(NodeWithChildren2.prototype, "lastChild", {
211
+ /** Last child of the node. */
212
+ get: function() {
213
+ return this.children.length > 0 ? this.children[this.children.length - 1] : null;
214
+ },
215
+ enumerable: false,
216
+ configurable: true
217
+ });
218
+ Object.defineProperty(NodeWithChildren2.prototype, "childNodes", {
219
+ /**
220
+ * Same as {@link children}.
221
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
222
+ */
223
+ get: function() {
224
+ return this.children;
225
+ },
226
+ set: function(children) {
227
+ this.children = children;
228
+ },
229
+ enumerable: false,
230
+ configurable: true
231
+ });
232
+ return NodeWithChildren2;
233
+ })(Node)
234
+ );
235
+ node.NodeWithChildren = NodeWithChildren;
236
+ var CDATA = (
237
+ /** @class */
238
+ (function(_super) {
239
+ __extends(CDATA2, _super);
240
+ function CDATA2() {
241
+ var _this = _super !== null && _super.apply(this, arguments) || this;
242
+ _this.type = domelementtype_1.ElementType.CDATA;
243
+ return _this;
244
+ }
245
+ Object.defineProperty(CDATA2.prototype, "nodeType", {
246
+ get: function() {
247
+ return 4;
248
+ },
249
+ enumerable: false,
250
+ configurable: true
251
+ });
252
+ return CDATA2;
253
+ })(NodeWithChildren)
254
+ );
255
+ node.CDATA = CDATA;
256
+ var Document = (
257
+ /** @class */
258
+ (function(_super) {
259
+ __extends(Document2, _super);
260
+ function Document2() {
261
+ var _this = _super !== null && _super.apply(this, arguments) || this;
262
+ _this.type = domelementtype_1.ElementType.Root;
263
+ return _this;
264
+ }
265
+ Object.defineProperty(Document2.prototype, "nodeType", {
266
+ get: function() {
267
+ return 9;
268
+ },
269
+ enumerable: false,
270
+ configurable: true
271
+ });
272
+ return Document2;
273
+ })(NodeWithChildren)
274
+ );
275
+ node.Document = Document;
276
+ var Element = (
277
+ /** @class */
278
+ (function(_super) {
279
+ __extends(Element2, _super);
280
+ function Element2(name, attribs, children, type) {
281
+ if (children === void 0) {
282
+ children = [];
283
+ }
284
+ if (type === void 0) {
285
+ type = name === "script" ? domelementtype_1.ElementType.Script : name === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag;
286
+ }
287
+ var _this = _super.call(this, children) || this;
288
+ _this.name = name;
289
+ _this.attribs = attribs;
290
+ _this.type = type;
291
+ return _this;
292
+ }
293
+ Object.defineProperty(Element2.prototype, "nodeType", {
294
+ get: function() {
295
+ return 1;
296
+ },
297
+ enumerable: false,
298
+ configurable: true
299
+ });
300
+ Object.defineProperty(Element2.prototype, "tagName", {
301
+ // DOM Level 1 aliases
302
+ /**
303
+ * Same as {@link name}.
304
+ * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
305
+ */
306
+ get: function() {
307
+ return this.name;
308
+ },
309
+ set: function(name) {
310
+ this.name = name;
311
+ },
312
+ enumerable: false,
313
+ configurable: true
314
+ });
315
+ Object.defineProperty(Element2.prototype, "attributes", {
316
+ get: function() {
317
+ var _this = this;
318
+ return Object.keys(this.attribs).map(function(name) {
319
+ var _a, _b;
320
+ return {
321
+ name,
322
+ value: _this.attribs[name],
323
+ namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name],
324
+ prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name]
325
+ };
326
+ });
327
+ },
328
+ enumerable: false,
329
+ configurable: true
330
+ });
331
+ return Element2;
332
+ })(NodeWithChildren)
333
+ );
334
+ node.Element = Element;
335
+ function isTag(node2) {
336
+ return (0, domelementtype_1.isTag)(node2);
337
+ }
338
+ node.isTag = isTag;
339
+ function isCDATA(node2) {
340
+ return node2.type === domelementtype_1.ElementType.CDATA;
341
+ }
342
+ node.isCDATA = isCDATA;
343
+ function isText(node2) {
344
+ return node2.type === domelementtype_1.ElementType.Text;
345
+ }
346
+ node.isText = isText;
347
+ function isComment(node2) {
348
+ return node2.type === domelementtype_1.ElementType.Comment;
349
+ }
350
+ node.isComment = isComment;
351
+ function isDirective(node2) {
352
+ return node2.type === domelementtype_1.ElementType.Directive;
353
+ }
354
+ node.isDirective = isDirective;
355
+ function isDocument(node2) {
356
+ return node2.type === domelementtype_1.ElementType.Root;
357
+ }
358
+ node.isDocument = isDocument;
359
+ function hasChildren(node2) {
360
+ return Object.prototype.hasOwnProperty.call(node2, "children");
361
+ }
362
+ node.hasChildren = hasChildren;
363
+ function cloneNode(node2, recursive) {
364
+ if (recursive === void 0) {
365
+ recursive = false;
366
+ }
367
+ var result;
368
+ if (isText(node2)) {
369
+ result = new Text(node2.data);
370
+ } else if (isComment(node2)) {
371
+ result = new Comment(node2.data);
372
+ } else if (isTag(node2)) {
373
+ var children = recursive ? cloneChildren(node2.children) : [];
374
+ var clone_1 = new Element(node2.name, __assign({}, node2.attribs), children);
375
+ children.forEach(function(child) {
376
+ return child.parent = clone_1;
377
+ });
378
+ if (node2.namespace != null) {
379
+ clone_1.namespace = node2.namespace;
380
+ }
381
+ if (node2["x-attribsNamespace"]) {
382
+ clone_1["x-attribsNamespace"] = __assign({}, node2["x-attribsNamespace"]);
383
+ }
384
+ if (node2["x-attribsPrefix"]) {
385
+ clone_1["x-attribsPrefix"] = __assign({}, node2["x-attribsPrefix"]);
386
+ }
387
+ result = clone_1;
388
+ } else if (isCDATA(node2)) {
389
+ var children = recursive ? cloneChildren(node2.children) : [];
390
+ var clone_2 = new CDATA(children);
391
+ children.forEach(function(child) {
392
+ return child.parent = clone_2;
393
+ });
394
+ result = clone_2;
395
+ } else if (isDocument(node2)) {
396
+ var children = recursive ? cloneChildren(node2.children) : [];
397
+ var clone_3 = new Document(children);
398
+ children.forEach(function(child) {
399
+ return child.parent = clone_3;
400
+ });
401
+ if (node2["x-mode"]) {
402
+ clone_3["x-mode"] = node2["x-mode"];
403
+ }
404
+ result = clone_3;
405
+ } else if (isDirective(node2)) {
406
+ var instruction = new ProcessingInstruction(node2.name, node2.data);
407
+ if (node2["x-name"] != null) {
408
+ instruction["x-name"] = node2["x-name"];
409
+ instruction["x-publicId"] = node2["x-publicId"];
410
+ instruction["x-systemId"] = node2["x-systemId"];
411
+ }
412
+ result = instruction;
413
+ } else {
414
+ throw new Error("Not implemented yet: ".concat(node2.type));
415
+ }
416
+ result.startIndex = node2.startIndex;
417
+ result.endIndex = node2.endIndex;
418
+ if (node2.sourceCodeLocation != null) {
419
+ result.sourceCodeLocation = node2.sourceCodeLocation;
420
+ }
421
+ return result;
422
+ }
423
+ node.cloneNode = cloneNode;
424
+ function cloneChildren(childs) {
425
+ var children = childs.map(function(child) {
426
+ return cloneNode(child, true);
427
+ });
428
+ for (var i = 1; i < children.length; i++) {
429
+ children[i].prev = children[i - 1];
430
+ children[i - 1].next = children[i];
431
+ }
432
+ return children;
433
+ }
434
+ return node;
435
+ }
436
+ export {
437
+ requireNode as __require
438
+ };
439
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","sources":["../../../../node_modules/domhandler/lib/node.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;\nvar domelementtype_1 = require(\"domelementtype\");\n/**\n * This object will be used as the prototype for Nodes when creating a\n * DOM-Level-1-compliant structure.\n */\nvar Node = /** @class */ (function () {\n function Node() {\n /** Parent of the node */\n this.parent = null;\n /** Previous sibling */\n this.prev = null;\n /** Next sibling */\n this.next = null;\n /** The start index of the node. Requires `withStartIndices` on the handler to be `true. */\n this.startIndex = null;\n /** The end index of the node. Requires `withEndIndices` on the handler to be `true. */\n this.endIndex = null;\n }\n Object.defineProperty(Node.prototype, \"parentNode\", {\n // Read-write aliases for properties\n /**\n * Same as {@link parent}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.parent;\n },\n set: function (parent) {\n this.parent = parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"previousSibling\", {\n /**\n * Same as {@link prev}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.prev;\n },\n set: function (prev) {\n this.prev = prev;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, \"nextSibling\", {\n /**\n * Same as {@link next}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.next;\n },\n set: function (next) {\n this.next = next;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Clone this node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\n Node.prototype.cloneNode = function (recursive) {\n if (recursive === void 0) { recursive = false; }\n return cloneNode(this, recursive);\n };\n return Node;\n}());\nexports.Node = Node;\n/**\n * A node that contains some data.\n */\nvar DataNode = /** @class */ (function (_super) {\n __extends(DataNode, _super);\n /**\n * @param data The content of the data node\n */\n function DataNode(data) {\n var _this = _super.call(this) || this;\n _this.data = data;\n return _this;\n }\n Object.defineProperty(DataNode.prototype, \"nodeValue\", {\n /**\n * Same as {@link data}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.data;\n },\n set: function (data) {\n this.data = data;\n },\n enumerable: false,\n configurable: true\n });\n return DataNode;\n}(Node));\nexports.DataNode = DataNode;\n/**\n * Text within the document.\n */\nvar Text = /** @class */ (function (_super) {\n __extends(Text, _super);\n function Text() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Text;\n return _this;\n }\n Object.defineProperty(Text.prototype, \"nodeType\", {\n get: function () {\n return 3;\n },\n enumerable: false,\n configurable: true\n });\n return Text;\n}(DataNode));\nexports.Text = Text;\n/**\n * Comments within the document.\n */\nvar Comment = /** @class */ (function (_super) {\n __extends(Comment, _super);\n function Comment() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Comment;\n return _this;\n }\n Object.defineProperty(Comment.prototype, \"nodeType\", {\n get: function () {\n return 8;\n },\n enumerable: false,\n configurable: true\n });\n return Comment;\n}(DataNode));\nexports.Comment = Comment;\n/**\n * Processing instructions, including doc types.\n */\nvar ProcessingInstruction = /** @class */ (function (_super) {\n __extends(ProcessingInstruction, _super);\n function ProcessingInstruction(name, data) {\n var _this = _super.call(this, data) || this;\n _this.name = name;\n _this.type = domelementtype_1.ElementType.Directive;\n return _this;\n }\n Object.defineProperty(ProcessingInstruction.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n return ProcessingInstruction;\n}(DataNode));\nexports.ProcessingInstruction = ProcessingInstruction;\n/**\n * A `Node` that can have children.\n */\nvar NodeWithChildren = /** @class */ (function (_super) {\n __extends(NodeWithChildren, _super);\n /**\n * @param children Children of the node. Only certain node types can have children.\n */\n function NodeWithChildren(children) {\n var _this = _super.call(this) || this;\n _this.children = children;\n return _this;\n }\n Object.defineProperty(NodeWithChildren.prototype, \"firstChild\", {\n // Aliases\n /** First child of the node. */\n get: function () {\n var _a;\n return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"lastChild\", {\n /** Last child of the node. */\n get: function () {\n return this.children.length > 0\n ? this.children[this.children.length - 1]\n : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(NodeWithChildren.prototype, \"childNodes\", {\n /**\n * Same as {@link children}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.children;\n },\n set: function (children) {\n this.children = children;\n },\n enumerable: false,\n configurable: true\n });\n return NodeWithChildren;\n}(Node));\nexports.NodeWithChildren = NodeWithChildren;\nvar CDATA = /** @class */ (function (_super) {\n __extends(CDATA, _super);\n function CDATA() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.CDATA;\n return _this;\n }\n Object.defineProperty(CDATA.prototype, \"nodeType\", {\n get: function () {\n return 4;\n },\n enumerable: false,\n configurable: true\n });\n return CDATA;\n}(NodeWithChildren));\nexports.CDATA = CDATA;\n/**\n * The root node of the document.\n */\nvar Document = /** @class */ (function (_super) {\n __extends(Document, _super);\n function Document() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = domelementtype_1.ElementType.Root;\n return _this;\n }\n Object.defineProperty(Document.prototype, \"nodeType\", {\n get: function () {\n return 9;\n },\n enumerable: false,\n configurable: true\n });\n return Document;\n}(NodeWithChildren));\nexports.Document = Document;\n/**\n * An element within the DOM.\n */\nvar Element = /** @class */ (function (_super) {\n __extends(Element, _super);\n /**\n * @param name Name of the tag, eg. `div`, `span`.\n * @param attribs Object mapping attribute names to attribute values.\n * @param children Children of the node.\n */\n function Element(name, attribs, children, type) {\n if (children === void 0) { children = []; }\n if (type === void 0) { type = name === \"script\"\n ? domelementtype_1.ElementType.Script\n : name === \"style\"\n ? domelementtype_1.ElementType.Style\n : domelementtype_1.ElementType.Tag; }\n var _this = _super.call(this, children) || this;\n _this.name = name;\n _this.attribs = attribs;\n _this.type = type;\n return _this;\n }\n Object.defineProperty(Element.prototype, \"nodeType\", {\n get: function () {\n return 1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"tagName\", {\n // DOM Level 1 aliases\n /**\n * Same as {@link name}.\n * [DOM spec](https://dom.spec.whatwg.org)-compatible alias.\n */\n get: function () {\n return this.name;\n },\n set: function (name) {\n this.name = name;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Element.prototype, \"attributes\", {\n get: function () {\n var _this = this;\n return Object.keys(this.attribs).map(function (name) {\n var _a, _b;\n return ({\n name: name,\n value: _this.attribs[name],\n namespace: (_a = _this[\"x-attribsNamespace\"]) === null || _a === void 0 ? void 0 : _a[name],\n prefix: (_b = _this[\"x-attribsPrefix\"]) === null || _b === void 0 ? void 0 : _b[name],\n });\n });\n },\n enumerable: false,\n configurable: true\n });\n return Element;\n}(NodeWithChildren));\nexports.Element = Element;\n/**\n * @param node Node to check.\n * @returns `true` if the node is a `Element`, `false` otherwise.\n */\nfunction isTag(node) {\n return (0, domelementtype_1.isTag)(node);\n}\nexports.isTag = isTag;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `CDATA`, `false` otherwise.\n */\nfunction isCDATA(node) {\n return node.type === domelementtype_1.ElementType.CDATA;\n}\nexports.isCDATA = isCDATA;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Text`, `false` otherwise.\n */\nfunction isText(node) {\n return node.type === domelementtype_1.ElementType.Text;\n}\nexports.isText = isText;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `Comment`, `false` otherwise.\n */\nfunction isComment(node) {\n return node.type === domelementtype_1.ElementType.Comment;\n}\nexports.isComment = isComment;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDirective(node) {\n return node.type === domelementtype_1.ElementType.Directive;\n}\nexports.isDirective = isDirective;\n/**\n * @param node Node to check.\n * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise.\n */\nfunction isDocument(node) {\n return node.type === domelementtype_1.ElementType.Root;\n}\nexports.isDocument = isDocument;\n/**\n * @param node Node to check.\n * @returns `true` if the node has children, `false` otherwise.\n */\nfunction hasChildren(node) {\n return Object.prototype.hasOwnProperty.call(node, \"children\");\n}\nexports.hasChildren = hasChildren;\n/**\n * Clone a node, and optionally its children.\n *\n * @param recursive Clone child nodes as well.\n * @returns A clone of the node.\n */\nfunction cloneNode(node, recursive) {\n if (recursive === void 0) { recursive = false; }\n var result;\n if (isText(node)) {\n result = new Text(node.data);\n }\n else if (isComment(node)) {\n result = new Comment(node.data);\n }\n else if (isTag(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_1 = new Element(node.name, __assign({}, node.attribs), children);\n children.forEach(function (child) { return (child.parent = clone_1); });\n if (node.namespace != null) {\n clone_1.namespace = node.namespace;\n }\n if (node[\"x-attribsNamespace\"]) {\n clone_1[\"x-attribsNamespace\"] = __assign({}, node[\"x-attribsNamespace\"]);\n }\n if (node[\"x-attribsPrefix\"]) {\n clone_1[\"x-attribsPrefix\"] = __assign({}, node[\"x-attribsPrefix\"]);\n }\n result = clone_1;\n }\n else if (isCDATA(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_2 = new CDATA(children);\n children.forEach(function (child) { return (child.parent = clone_2); });\n result = clone_2;\n }\n else if (isDocument(node)) {\n var children = recursive ? cloneChildren(node.children) : [];\n var clone_3 = new Document(children);\n children.forEach(function (child) { return (child.parent = clone_3); });\n if (node[\"x-mode\"]) {\n clone_3[\"x-mode\"] = node[\"x-mode\"];\n }\n result = clone_3;\n }\n else if (isDirective(node)) {\n var instruction = new ProcessingInstruction(node.name, node.data);\n if (node[\"x-name\"] != null) {\n instruction[\"x-name\"] = node[\"x-name\"];\n instruction[\"x-publicId\"] = node[\"x-publicId\"];\n instruction[\"x-systemId\"] = node[\"x-systemId\"];\n }\n result = instruction;\n }\n else {\n throw new Error(\"Not implemented yet: \".concat(node.type));\n }\n result.startIndex = node.startIndex;\n result.endIndex = node.endIndex;\n if (node.sourceCodeLocation != null) {\n result.sourceCodeLocation = node.sourceCodeLocation;\n }\n return result;\n}\nexports.cloneNode = cloneNode;\nfunction cloneChildren(childs) {\n var children = childs.map(function (child) { return cloneNode(child, true); });\n for (var i = 1; i < children.length; i++) {\n children[i].prev = children[i - 1];\n children[i - 1].next = children[i];\n }\n return children;\n}\n"],"names":["this","d","b","require$$0","Node","DataNode","Text","Comment","ProcessingInstruction","NodeWithChildren","CDATA","Document","Element","node"],"mappings":";;;;;;AACA,MAAI,YAAaA,QAAQA,KAAK,aAAe,4BAAY;AACrD,QAAI,gBAAgB,SAAU,GAAG,GAAG;AAChC,sBAAgB,OAAO,kBAClB,EAAE,WAAW,CAAA,eAAgB,SAAS,SAAUC,IAAGC,IAAG;AAAE,QAAAD,GAAE,YAAYC;AAAA,MAAE,KACzE,SAAUD,IAAGC,I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ds } from "../../../_virtual/feeds.js";
2
+ import { __require as requireStringify } from "./stringify.js";
3
+ import { __require as requireLegacy } from "./legacy.js";
4
+ var hasRequiredFeeds;
5
+ function requireFeeds() {
6
+ if (hasRequiredFeeds) return feeds;
7
+ hasRequiredFeeds = 1;
8
+ Object.defineProperty(feeds, "__esModule", { value: true });
9
+ feeds.getFeed = getFeed;
10
+ var stringify_js_1 = /* @__PURE__ */ requireStringify();
11
+ var legacy_js_1 = /* @__PURE__ */ requireLegacy();
12
+ function getFeed(doc) {
13
+ var feedRoot = getOneElement(isValidFeed, doc);
14
+ return !feedRoot ? null : feedRoot.name === "feed" ? getAtomFeed(feedRoot) : getRssFeed(feedRoot);
15
+ }
16
+ function getAtomFeed(feedRoot) {
17
+ var _a;
18
+ var childs = feedRoot.children;
19
+ var feed = {
20
+ type: "atom",
21
+ items: (0, legacy_js_1.getElementsByTagName)("entry", childs).map(function(item) {
22
+ var _a2;
23
+ var children = item.children;
24
+ var entry = { media: getMediaElements(children) };
25
+ addConditionally(entry, "id", "id", children);
26
+ addConditionally(entry, "title", "title", children);
27
+ var href2 = (_a2 = getOneElement("link", children)) === null || _a2 === void 0 ? void 0 : _a2.attribs["href"];
28
+ if (href2) {
29
+ entry.link = href2;
30
+ }
31
+ var description = fetch("summary", children) || fetch("content", children);
32
+ if (description) {
33
+ entry.description = description;
34
+ }
35
+ var pubDate = fetch("updated", children);
36
+ if (pubDate) {
37
+ entry.pubDate = new Date(pubDate);
38
+ }
39
+ return entry;
40
+ })
41
+ };
42
+ addConditionally(feed, "id", "id", childs);
43
+ addConditionally(feed, "title", "title", childs);
44
+ var href = (_a = getOneElement("link", childs)) === null || _a === void 0 ? void 0 : _a.attribs["href"];
45
+ if (href) {
46
+ feed.link = href;
47
+ }
48
+ addConditionally(feed, "description", "subtitle", childs);
49
+ var updated = fetch("updated", childs);
50
+ if (updated) {
51
+ feed.updated = new Date(updated);
52
+ }
53
+ addConditionally(feed, "author", "email", childs, true);
54
+ return feed;
55
+ }
56
+ function getRssFeed(feedRoot) {
57
+ var _a, _b;
58
+ var childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];
59
+ var feed = {
60
+ type: feedRoot.name.substr(0, 3),
61
+ id: "",
62
+ items: (0, legacy_js_1.getElementsByTagName)("item", feedRoot.children).map(function(item) {
63
+ var children = item.children;
64
+ var entry = { media: getMediaElements(children) };
65
+ addConditionally(entry, "id", "guid", children);
66
+ addConditionally(entry, "title", "title", children);
67
+ addConditionally(entry, "link", "link", children);
68
+ addConditionally(entry, "description", "description", children);
69
+ var pubDate = fetch("pubDate", children) || fetch("dc:date", children);
70
+ if (pubDate)
71
+ entry.pubDate = new Date(pubDate);
72
+ return entry;
73
+ })
74
+ };
75
+ addConditionally(feed, "title", "title", childs);
76
+ addConditionally(feed, "link", "link", childs);
77
+ addConditionally(feed, "description", "description", childs);
78
+ var updated = fetch("lastBuildDate", childs);
79
+ if (updated) {
80
+ feed.updated = new Date(updated);
81
+ }
82
+ addConditionally(feed, "author", "managingEditor", childs, true);
83
+ return feed;
84
+ }
85
+ var MEDIA_KEYS_STRING = ["url", "type", "lang"];
86
+ var MEDIA_KEYS_INT = [
87
+ "fileSize",
88
+ "bitrate",
89
+ "framerate",
90
+ "samplingrate",
91
+ "channels",
92
+ "duration",
93
+ "height",
94
+ "width"
95
+ ];
96
+ function getMediaElements(where) {
97
+ return (0, legacy_js_1.getElementsByTagName)("media:content", where).map(function(elem) {
98
+ var attribs = elem.attribs;
99
+ var media = {
100
+ medium: attribs["medium"],
101
+ isDefault: !!attribs["isDefault"]
102
+ };
103
+ for (var _i = 0, MEDIA_KEYS_STRING_1 = MEDIA_KEYS_STRING; _i < MEDIA_KEYS_STRING_1.length; _i++) {
104
+ var attrib = MEDIA_KEYS_STRING_1[_i];
105
+ if (attribs[attrib]) {
106
+ media[attrib] = attribs[attrib];
107
+ }
108
+ }
109
+ for (var _a = 0, MEDIA_KEYS_INT_1 = MEDIA_KEYS_INT; _a < MEDIA_KEYS_INT_1.length; _a++) {
110
+ var attrib = MEDIA_KEYS_INT_1[_a];
111
+ if (attribs[attrib]) {
112
+ media[attrib] = parseInt(attribs[attrib], 10);
113
+ }
114
+ }
115
+ if (attribs["expression"]) {
116
+ media.expression = attribs["expression"];
117
+ }
118
+ return media;
119
+ });
120
+ }
121
+ function getOneElement(tagName, node) {
122
+ return (0, legacy_js_1.getElementsByTagName)(tagName, node, true, 1)[0];
123
+ }
124
+ function fetch(tagName, where, recurse) {
125
+ if (recurse === void 0) {
126
+ recurse = false;
127
+ }
128
+ return (0, stringify_js_1.textContent)((0, legacy_js_1.getElementsByTagName)(tagName, where, recurse, 1)).trim();
129
+ }
130
+ function addConditionally(obj, prop, tagName, where, recurse) {
131
+ if (recurse === void 0) {
132
+ recurse = false;
133
+ }
134
+ var val = fetch(tagName, where, recurse);
135
+ if (val)
136
+ obj[prop] = val;
137
+ }
138
+ function isValidFeed(value) {
139
+ return value === "rss" || value === "feed" || value === "rdf:RDF";
140
+ }
141
+ return feeds;
142
+ }
143
+ export {
144
+ requireFeeds as __require
145
+ };
146
+ //# sourceMappingURL=feeds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feeds.js","sources":["../../../../node_modules/domutils/lib/feeds.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFeed = getFeed;\nvar stringify_js_1 = require(\"./stringify.js\");\nvar legacy_js_1 = require(\"./legacy.js\");\n/**\n * Get the feed object from the root of a DOM tree.\n *\n * @category Feeds\n * @param doc - The DOM to to extract the feed from.\n * @returns The feed.\n */\nfunction getFeed(doc) {\n var feedRoot = getOneElement(isValidFeed, doc);\n return !feedRoot\n ? null\n : feedRoot.name === \"feed\"\n ? getAtomFeed(feedRoot)\n : getRssFeed(feedRoot);\n}\n/**\n * Parse an Atom feed.\n *\n * @param feedRoot The root of the feed.\n * @returns The parsed feed.\n */\nfunction getAtomFeed(feedRoot) {\n var _a;\n var childs = feedRoot.children;\n var feed = {\n type: \"atom\",\n items: (0, legacy_js_1.getElementsByTagName)(\"entry\", childs).map(function (item) {\n var _a;\n var children = item.children;\n var entry = { media: getMediaElements(children) };\n addConditionally(entry, \"id\", \"id\", children);\n addConditionally(entry, \"title\", \"title\", children);\n var href = (_a = getOneElement(\"link\", children)) === null || _a === void 0 ? void 0 : _a.attribs[\"href\"];\n if (href) {\n entry.link = href;\n }\n var description = fetch(\"summary\", children) || fetch(\"content\", children);\n if (description) {\n entry.description = description;\n }\n var pubDate = fetch(\"updated\", children);\n if (pubDate) {\n entry.pubDate = new Date(pubDate);\n }\n return entry;\n }),\n };\n addConditionally(feed, \"id\", \"id\", childs);\n addConditionally(feed, \"title\", \"title\", childs);\n var href = (_a = getOneElement(\"link\", childs)) === null || _a === void 0 ? void 0 : _a.attribs[\"href\"];\n if (href) {\n feed.link = href;\n }\n addConditionally(feed, \"description\", \"subtitle\", childs);\n var updated = fetch(\"updated\", childs);\n if (updated) {\n feed.updated = new Date(updated);\n }\n addConditionally(feed, \"author\", \"email\", childs, true);\n return feed;\n}\n/**\n * Parse a RSS feed.\n *\n * @param feedRoot The root of the feed.\n * @returns The parsed feed.\n */\nfunction getRssFeed(feedRoot) {\n var _a, _b;\n var childs = (_b = (_a = getOneElement(\"channel\", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];\n var feed = {\n type: feedRoot.name.substr(0, 3),\n id: \"\",\n items: (0, legacy_js_1.getElementsByTagName)(\"item\", feedRoot.children).map(function (item) {\n var children = item.children;\n var entry = { media: getMediaElements(children) };\n addConditionally(entry, \"id\", \"guid\", children);\n addConditionally(entry, \"title\", \"title\", children);\n addConditionally(entry, \"link\", \"link\", children);\n addConditionally(entry, \"description\", \"description\", children);\n var pubDate = fetch(\"pubDate\", children) || fetch(\"dc:date\", children);\n if (pubDate)\n entry.pubDate = new Date(pubDate);\n return entry;\n }),\n };\n addConditionally(feed, \"title\", \"title\", childs);\n addConditionally(feed, \"link\", \"link\", childs);\n addConditionally(feed, \"description\", \"description\", childs);\n var updated = fetch(\"lastBuildDate\", childs);\n if (updated) {\n feed.updated = new Date(updated);\n }\n addConditionally(feed, \"author\", \"managingEditor\", childs, true);\n return feed;\n}\nvar MEDIA_KEYS_STRING = [\"url\", \"type\", \"lang\"];\nvar MEDIA_KEYS_INT = [\n \"fileSize\",\n \"bitrate\",\n \"framerate\",\n \"samplingrate\",\n \"channels\",\n \"duration\",\n \"height\",\n \"width\",\n];\n/**\n * Get all media elements of a feed item.\n *\n * @param where Nodes to search in.\n * @returns Media elements.\n */\nfunction getMediaElements(where) {\n return (0, legacy_js_1.getElementsByTagName)(\"media:content\", where).map(function (elem) {\n var attribs = elem.attribs;\n var media = {\n medium: attribs[\"medium\"],\n isDefault: !!attribs[\"isDefault\"],\n };\n for (var _i = 0, MEDIA_KEYS_STRING_1 = MEDIA_KEYS_STRING; _i < MEDIA_KEYS_STRING_1.length; _i++) {\n var attrib = MEDIA_KEYS_STRING_1[_i];\n if (attribs[attrib]) {\n media[attrib] = attribs[attrib];\n }\n }\n for (var _a = 0, MEDIA_KEYS_INT_1 = MEDIA_KEYS_INT; _a < MEDIA_KEYS_INT_1.length; _a++) {\n var attrib = MEDIA_KEYS_INT_1[_a];\n if (attribs[attrib]) {\n media[attrib] = parseInt(attribs[attrib], 10);\n }\n }\n if (attribs[\"expression\"]) {\n media.expression = attribs[\"expression\"];\n }\n return media;\n });\n}\n/**\n * Get one element by tag name.\n *\n * @param tagName Tag name to look for\n * @param node Node to search in\n * @returns The element or null\n */\nfunction getOneElement(tagName, node) {\n return (0, legacy_js_1.getElementsByTagName)(tagName, node, true, 1)[0];\n}\n/**\n * Get the text content of an element with a certain tag name.\n *\n * @param tagName Tag name to look for.\n * @param where Node to search in.\n * @param recurse Whether to recurse into child nodes.\n * @returns The text content of the element.\n */\nfunction fetch(tagName, where, recurse) {\n if (recurse === void 0) { recurse = false; }\n return (0, stringify_js_1.textContent)((0, legacy_js_1.getElementsByTagName)(tagName, where, recurse, 1)).trim();\n}\n/**\n * Adds a property to an object if it has a value.\n *\n * @param obj Object to be extended\n * @param prop Property name\n * @param tagName Tag name that contains the conditionally added property\n * @param where Element to search for the property\n * @param recurse Whether to recurse into child nodes.\n */\nfunction addConditionally(obj, prop, tagName, where, recurse) {\n if (recurse === void 0) { recurse = false; }\n var val = fetch(tagName, where, recurse);\n if (val)\n obj[prop] = val;\n}\n/**\n * Checks if an element is a feed root node.\n *\n * @param value The name of the element to check.\n * @returns Whether an element is a feed root node.\n */\nfunction isValidFeed(value) {\n return value === \"rss\" || value === \"feed\" || value === \"rdf:RDF\";\n}\n//# sourceMappingURL=feeds.js.map"],"names":["require$$0","require$$1","_a","href"],"mappings":";;;;;;;AACA,SAAO,eAAe,OAAS,cAAc,EAAE,OAAO,MAAM;AAC5D,QAAA,UAAkB;AAClB,MAAI,iBAAiBA,iCAAA;AACrB,MAAI,cAAcC,8BAAA;AAQlB,WAAS,QAAQ,KAAK;AAClB,QAAI,WAAW,cAAc,aAAa,GAAG;AAC7C,WAAO,CAAC,WACF,OACA,SAAS,SAAS,SACd,YAAY,QAAQ,IACpB,WAAW,QAAQ;AAAA,EACjC;AAOA,WAAS,YAAY,UAAU;AAC3B,QAAI;AACJ,QAAI,SAAS,SAAS;AACtB,QAAI,OAAO;AAAA,MACP,MAAM;AAAA,MACN,QAAO,GAAI,YAAY,sBAAsB,SAAS,MAAM,EAAE,IAAI,SAAU,MAAM;AAC9E,YAAIC;AACJ,YAAI,WAAW,KAAK;AACpB,YAAI,QAAQ,EAAE,OAAO,iBAAiB,QAAQ,EAAC;AAC/C,yBAAiB,OAAO,MAAM,MAAM,QAAQ;AAC5C,yBAAiB,OAAO,SAAS,SAAS,QAAQ;AAClD,YAAIC,SAAQD,MAAK,cAAc,QAAQ,QAAQ,OAAO,QAAQA,QAAO,SAAS,SAASA,IAAG,QAAQ,MAAM;AACxG,YAAIC,OAAM;AAC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