@nitpicker/crawler 0.24.0 → 0.25.1

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 (744) hide show
  1. package/README.md +2 -2
  2. package/lib/beholder-type-mirror-parity.d.ts +96 -0
  3. package/lib/crawler/capture-custom-elements.d.ts +4 -4
  4. package/lib/crawler/capture-custom-elements.js +3 -3
  5. package/lib/crawler/capture-image-dom-paths.d.ts +3 -3
  6. package/lib/crawler/capture-image-dom-paths.js +2 -2
  7. package/lib/crawler/collect-custom-elements.d.ts +1 -1
  8. package/lib/crawler/collect-image-dom-paths.d.ts +2 -2
  9. package/lib/crawler/collect-image-dom-paths.js +1 -1
  10. package/lib/crawler/crawler.js +6 -6
  11. package/lib/crawler/dedupe/build-dedupe-cap-observation.d.ts +3 -3
  12. package/lib/crawler/dedupe/build-dedupe-cap-observation.js +3 -3
  13. package/lib/crawler/dedupe/resolve-og-url-mismatch.d.ts +1 -1
  14. package/lib/crawler/dedupe/resolve-og-url-mismatch.js +1 -1
  15. package/lib/crawler/derive-page-source.d.ts +1 -1
  16. package/lib/crawler/derive-resource-source.d.ts +1 -1
  17. package/lib/crawler/destination-cache.d.ts +1 -1
  18. package/lib/crawler/detect-pagination-pattern.js +1 -1
  19. package/lib/crawler/dns-burned-host-cache.d.ts +1 -1
  20. package/lib/crawler/evict-network-classified-destination-cache-entries.js +2 -2
  21. package/lib/crawler/evict-outage-tainted-dns-burns.d.ts +2 -2
  22. package/lib/crawler/evict-outage-tainted-dns-burns.js +1 -1
  23. package/lib/crawler/fetch-robots-txt.js +1 -3
  24. package/lib/crawler/generate-predicted-urls.js +2 -2
  25. package/lib/crawler/handle-scrape-end.js +1 -1
  26. package/lib/crawler/is-external-url.js +1 -1
  27. package/lib/crawler/is-puppeteer-fallback-candidate.js +1 -1
  28. package/lib/crawler/link-list.js +1 -1
  29. package/lib/crawler/network-outage-detector.js +1 -1
  30. package/lib/crawler/plan-sub-resource-emits.d.ts +1 -1
  31. package/lib/crawler/resource-to-page-data.js +1 -1
  32. package/lib/crawler/scan-js-resource-for-license-comment.d.ts +4 -3
  33. package/lib/crawler/scan-js-resource-for-license-comment.js +11 -23
  34. package/lib/crawler/scan-js-resources-for-technology-signals.d.ts +1 -1
  35. package/lib/crawler/scan-js-resources-for-technology-signals.js +1 -1
  36. package/lib/crawler/should-burn-host.d.ts +1 -1
  37. package/lib/crawler/should-get-fallback-on-head-failure.js +1 -1
  38. package/lib/crawler/types.d.ts +4 -18
  39. package/lib/crawler-orchestrator.d.ts +6 -9
  40. package/lib/crawler-orchestrator.js +27 -30
  41. package/lib/crawler.d.ts +5 -58
  42. package/lib/crawler.js +10 -73
  43. package/lib/resolve-output-path.js +1 -1
  44. package/lib/resource-row-to-lookup-result.d.ts +1 -1
  45. package/lib/resource-row-to-lookup-result.js +1 -1
  46. package/lib/types.d.ts +4 -53
  47. package/lib/utils/types/types.d.ts +0 -15
  48. package/package.json +11 -18
  49. package/lib/archive/archive-accessor.d.ts +0 -274
  50. package/lib/archive/archive-accessor.js +0 -505
  51. package/lib/archive/archive-lock.d.ts +0 -45
  52. package/lib/archive/archive-lock.js +0 -154
  53. package/lib/archive/archive.d.ts +0 -762
  54. package/lib/archive/archive.js +0 -1073
  55. package/lib/archive/body-hash/compute-body-hash.d.ts +0 -22
  56. package/lib/archive/body-hash/compute-body-hash.js +0 -31
  57. package/lib/archive/body-hash/extract-body.d.ts +0 -18
  58. package/lib/archive/body-hash/extract-body.js +0 -29
  59. package/lib/archive/body-hash/mask-dynamic-ids.d.ts +0 -33
  60. package/lib/archive/body-hash/mask-dynamic-ids.js +0 -44
  61. package/lib/archive/body-hash/normalize-url-like-strings.d.ts +0 -16
  62. package/lib/archive/body-hash/normalize-url-like-strings.js +0 -19
  63. package/lib/archive/cache/clear-archive-cache-entry.d.ts +0 -19
  64. package/lib/archive/cache/clear-archive-cache-entry.js +0 -25
  65. package/lib/archive/cache/clear-archive-cache-root.d.ts +0 -26
  66. package/lib/archive/cache/clear-archive-cache-root.js +0 -32
  67. package/lib/archive/cache/compute-archive-cache-key.d.ts +0 -39
  68. package/lib/archive/cache/compute-archive-cache-key.js +0 -95
  69. package/lib/archive/cache/extract-archive-to-cache.d.ts +0 -57
  70. package/lib/archive/cache/extract-archive-to-cache.js +0 -326
  71. package/lib/archive/cache/get-archive-cache-root.d.ts +0 -20
  72. package/lib/archive/cache/get-archive-cache-root.js +0 -53
  73. package/lib/archive/cache/is-archive-cache-disabled.d.ts +0 -24
  74. package/lib/archive/cache/is-archive-cache-disabled.js +0 -34
  75. package/lib/archive/cache/list-archive-cache-entries.d.ts +0 -23
  76. package/lib/archive/cache/list-archive-cache-entries.js +0 -125
  77. package/lib/archive/cache/path-exists.d.ts +0 -9
  78. package/lib/archive/cache/path-exists.js +0 -18
  79. package/lib/archive/cache/resolve-archive-cache-dir.d.ts +0 -26
  80. package/lib/archive/cache/resolve-archive-cache-dir.js +0 -32
  81. package/lib/archive/cache/types.d.ts +0 -33
  82. package/lib/archive/create-adjunct-tables.d.ts +0 -68
  83. package/lib/archive/create-adjunct-tables.js +0 -548
  84. package/lib/archive/create-entity-tables.d.ts +0 -191
  85. package/lib/archive/create-entity-tables.js +0 -387
  86. package/lib/archive/create-progress-reporter.d.ts +0 -30
  87. package/lib/archive/create-progress-reporter.js +0 -38
  88. package/lib/archive/create-ref-tables.d.ts +0 -35
  89. package/lib/archive/create-ref-tables.js +0 -188
  90. package/lib/archive/create-template-tables.d.ts +0 -30
  91. package/lib/archive/create-template-tables.js +0 -95
  92. package/lib/archive/database.d.ts +0 -560
  93. package/lib/archive/database.js +0 -805
  94. package/lib/archive/db-ops/_shared/clear-write-ref-caches.d.ts +0 -27
  95. package/lib/archive/db-ops/_shared/clear-write-ref-caches.js +0 -35
  96. package/lib/archive/db-ops/_shared/compress-payload.d.ts +0 -26
  97. package/lib/archive/db-ops/_shared/compress-payload.js +0 -30
  98. package/lib/archive/db-ops/_shared/create-write-ref-caches.d.ts +0 -17
  99. package/lib/archive/db-ops/_shared/create-write-ref-caches.js +0 -27
  100. package/lib/archive/db-ops/_shared/decode-json-ref.d.ts +0 -17
  101. package/lib/archive/db-ops/_shared/decode-json-ref.js +0 -31
  102. package/lib/archive/db-ops/_shared/keyset-paginate-by-id.d.ts +0 -49
  103. package/lib/archive/db-ops/_shared/keyset-paginate-by-id.js +0 -69
  104. package/lib/archive/db-ops/_shared/load-response-headers-by-set-ids.d.ts +0 -20
  105. package/lib/archive/db-ops/_shared/load-response-headers-by-set-ids.js +0 -53
  106. package/lib/archive/db-ops/_shared/resolve-content-item-id.d.ts +0 -62
  107. package/lib/archive/db-ops/_shared/resolve-content-item-id.js +0 -143
  108. package/lib/archive/db-ops/_shared/resolve-url-or-blob.d.ts +0 -23
  109. package/lib/archive/db-ops/_shared/resolve-url-or-blob.js +0 -29
  110. package/lib/archive/db-ops/_shared/retry-setting.d.ts +0 -16
  111. package/lib/archive/db-ops/_shared/retry-setting.js +0 -18
  112. package/lib/archive/db-ops/_shared/safe-parse-json.d.ts +0 -11
  113. package/lib/archive/db-ops/_shared/safe-parse-json.js +0 -18
  114. package/lib/archive/db-ops/_shared/types.d.ts +0 -94
  115. package/lib/archive/db-ops/_shared/types.js +0 -1
  116. package/lib/archive/db-ops/_shared/upsert-blob-ref.d.ts +0 -25
  117. package/lib/archive/db-ops/_shared/upsert-blob-ref.js +0 -48
  118. package/lib/archive/db-ops/_shared/upsert-content-type-ref.d.ts +0 -30
  119. package/lib/archive/db-ops/_shared/upsert-content-type-ref.js +0 -45
  120. package/lib/archive/db-ops/_shared/upsert-json-ref.d.ts +0 -22
  121. package/lib/archive/db-ops/_shared/upsert-json-ref.js +0 -41
  122. package/lib/archive/db-ops/_shared/upsert-response-headers.d.ts +0 -35
  123. package/lib/archive/db-ops/_shared/upsert-response-headers.js +0 -49
  124. package/lib/archive/db-ops/_shared/upsert-url-ref.d.ts +0 -39
  125. package/lib/archive/db-ops/_shared/upsert-url-ref.js +0 -62
  126. package/lib/archive/db-ops/analysis/replace-analysis-violations.d.ts +0 -28
  127. package/lib/archive/db-ops/analysis/replace-analysis-violations.js +0 -155
  128. package/lib/archive/db-ops/anchors/get-anchors-on-page.d.ts +0 -10
  129. package/lib/archive/db-ops/anchors/get-anchors-on-page.js +0 -21
  130. package/lib/archive/db-ops/config/get-base-url.d.ts +0 -8
  131. package/lib/archive/db-ops/config/get-base-url.js +0 -14
  132. package/lib/archive/db-ops/config/get-config.d.ts +0 -10
  133. package/lib/archive/db-ops/config/get-config.js +0 -29
  134. package/lib/archive/db-ops/config/get-created-cwd.d.ts +0 -11
  135. package/lib/archive/db-ops/config/get-created-cwd.js +0 -13
  136. package/lib/archive/db-ops/config/get-name.d.ts +0 -8
  137. package/lib/archive/db-ops/config/get-name.js +0 -14
  138. package/lib/archive/db-ops/config/info-column-allowlist.d.ts +0 -7
  139. package/lib/archive/db-ops/config/info-column-allowlist.js +0 -29
  140. package/lib/archive/db-ops/config/info-json-columns.d.ts +0 -5
  141. package/lib/archive/db-ops/config/info-json-columns.js +0 -11
  142. package/lib/archive/db-ops/config/set-config.d.ts +0 -12
  143. package/lib/archive/db-ops/config/set-config.js +0 -21
  144. package/lib/archive/db-ops/config/update-config.d.ts +0 -17
  145. package/lib/archive/db-ops/config/update-config.js +0 -36
  146. package/lib/archive/db-ops/console-logs/compute-console-log-hash.d.ts +0 -19
  147. package/lib/archive/db-ops/console-logs/compute-console-log-hash.js +0 -30
  148. package/lib/archive/db-ops/console-logs/replace-console-logs.d.ts +0 -34
  149. package/lib/archive/db-ops/console-logs/replace-console-logs.js +0 -123
  150. package/lib/archive/db-ops/console-logs/stringify-console-log-args.d.ts +0 -16
  151. package/lib/archive/db-ops/console-logs/stringify-console-log-args.js +0 -26
  152. package/lib/archive/db-ops/console-logs/types.d.ts +0 -38
  153. package/lib/archive/db-ops/console-logs/types.js +0 -1
  154. package/lib/archive/db-ops/console-logs/upsert-console-log-item.d.ts +0 -29
  155. package/lib/archive/db-ops/console-logs/upsert-console-log-item.js +0 -52
  156. package/lib/archive/db-ops/dedupe-cap/accumulate-dedupe-cap-rejected-count.d.ts +0 -18
  157. package/lib/archive/db-ops/dedupe-cap/accumulate-dedupe-cap-rejected-count.js +0 -23
  158. package/lib/archive/db-ops/dedupe-cap/finalize-dedupe-cap-event.d.ts +0 -12
  159. package/lib/archive/db-ops/dedupe-cap/finalize-dedupe-cap-event.js +0 -15
  160. package/lib/archive/db-ops/dedupe-cap/insert-dedupe-cap-event.d.ts +0 -14
  161. package/lib/archive/db-ops/dedupe-cap/insert-dedupe-cap-event.js +0 -30
  162. package/lib/archive/db-ops/dedupe-cap/list-dedupe-cap-observations.d.ts +0 -57
  163. package/lib/archive/db-ops/dedupe-cap/list-dedupe-cap-observations.js +0 -87
  164. package/lib/archive/db-ops/dedupe-cap/list-dedupe-cap-shape-keys.d.ts +0 -21
  165. package/lib/archive/db-ops/dedupe-cap/list-dedupe-cap-shape-keys.js +0 -27
  166. package/lib/archive/db-ops/errors/insert-crawl-error.d.ts +0 -15
  167. package/lib/archive/db-ops/errors/insert-crawl-error.js +0 -21
  168. package/lib/archive/db-ops/errors/insert-page-error.d.ts +0 -21
  169. package/lib/archive/db-ops/errors/insert-page-error.js +0 -30
  170. package/lib/archive/db-ops/errors/list-dns-burned-host-candidates.d.ts +0 -33
  171. package/lib/archive/db-ops/errors/list-dns-burned-host-candidates.js +0 -158
  172. package/lib/archive/db-ops/html/get-html-of-page-by-id.d.ts +0 -18
  173. package/lib/archive/db-ops/html/get-html-of-page-by-id.js +0 -29
  174. package/lib/archive/db-ops/lifecycle/checkpoint.d.ts +0 -8
  175. package/lib/archive/db-ops/lifecycle/checkpoint.js +0 -9
  176. package/lib/archive/db-ops/lifecycle/destroy.d.ts +0 -6
  177. package/lib/archive/db-ops/lifecycle/destroy.js +0 -7
  178. package/lib/archive/db-ops/lifecycle/init.d.ts +0 -58
  179. package/lib/archive/db-ops/lifecycle/init.js +0 -121
  180. package/lib/archive/db-ops/list-reconcile/record-list-reconcile-run.d.ts +0 -22
  181. package/lib/archive/db-ops/list-reconcile/record-list-reconcile-run.js +0 -41
  182. package/lib/archive/db-ops/meta/get-audios-of-page.d.ts +0 -11
  183. package/lib/archive/db-ops/meta/get-audios-of-page.js +0 -15
  184. package/lib/archive/db-ops/meta/get-buttons-of-page.d.ts +0 -11
  185. package/lib/archive/db-ops/meta/get-buttons-of-page.js +0 -15
  186. package/lib/archive/db-ops/meta/get-canvases-of-page.d.ts +0 -11
  187. package/lib/archive/db-ops/meta/get-canvases-of-page.js +0 -15
  188. package/lib/archive/db-ops/meta/get-custom-elements-of-page.d.ts +0 -11
  189. package/lib/archive/db-ops/meta/get-custom-elements-of-page.js +0 -15
  190. package/lib/archive/db-ops/meta/get-headings-of-page.d.ts +0 -11
  191. package/lib/archive/db-ops/meta/get-headings-of-page.js +0 -15
  192. package/lib/archive/db-ops/meta/get-iframes-of-page.d.ts +0 -11
  193. package/lib/archive/db-ops/meta/get-iframes-of-page.js +0 -15
  194. package/lib/archive/db-ops/meta/get-jsonld-of-page.d.ts +0 -13
  195. package/lib/archive/db-ops/meta/get-jsonld-of-page.js +0 -27
  196. package/lib/archive/db-ops/meta/get-main-content-images-of-page.d.ts +0 -11
  197. package/lib/archive/db-ops/meta/get-main-content-images-of-page.js +0 -15
  198. package/lib/archive/db-ops/meta/get-main-content-tables-of-page.d.ts +0 -11
  199. package/lib/archive/db-ops/meta/get-main-content-tables-of-page.js +0 -15
  200. package/lib/archive/db-ops/meta/get-page-technologies-of-page.d.ts +0 -11
  201. package/lib/archive/db-ops/meta/get-page-technologies-of-page.js +0 -15
  202. package/lib/archive/db-ops/meta/get-technology-signals-of-page.d.ts +0 -11
  203. package/lib/archive/db-ops/meta/get-technology-signals-of-page.js +0 -15
  204. package/lib/archive/db-ops/meta/get-videos-of-page.d.ts +0 -11
  205. package/lib/archive/db-ops/meta/get-videos-of-page.js +0 -15
  206. package/lib/archive/db-ops/outages/close-network-outage.d.ts +0 -12
  207. package/lib/archive/db-ops/outages/close-network-outage.js +0 -15
  208. package/lib/archive/db-ops/outages/close-stale-open-network-outages.d.ts +0 -26
  209. package/lib/archive/db-ops/outages/close-stale-open-network-outages.js +0 -42
  210. package/lib/archive/db-ops/outages/compute-outage-clamp-timestamp.d.ts +0 -26
  211. package/lib/archive/db-ops/outages/compute-outage-clamp-timestamp.js +0 -31
  212. package/lib/archive/db-ops/outages/insert-network-outage.d.ts +0 -14
  213. package/lib/archive/db-ops/outages/insert-network-outage.js +0 -29
  214. package/lib/archive/db-ops/outages/list-network-outages.d.ts +0 -28
  215. package/lib/archive/db-ops/outages/list-network-outages.js +0 -42
  216. package/lib/archive/db-ops/pages/order/set-url-order.d.ts +0 -13
  217. package/lib/archive/db-ops/pages/order/set-url-order.js +0 -38
  218. package/lib/archive/db-ops/pages/read/build-page-query.d.ts +0 -18
  219. package/lib/archive/db-ops/pages/read/build-page-query.js +0 -40
  220. package/lib/archive/db-ops/pages/read/get-crawling-state.d.ts +0 -117
  221. package/lib/archive/db-ops/pages/read/get-crawling-state.js +0 -161
  222. package/lib/archive/db-ops/pages/read/get-existing-page-urls.d.ts +0 -15
  223. package/lib/archive/db-ops/pages/read/get-existing-page-urls.js +0 -30
  224. package/lib/archive/db-ops/pages/read/get-page-count.d.ts +0 -12
  225. package/lib/archive/db-ops/pages/read/get-page-count.js +0 -21
  226. package/lib/archive/db-ops/pages/read/get-page-source-by-url.d.ts +0 -24
  227. package/lib/archive/db-ops/pages/read/get-page-source-by-url.js +0 -28
  228. package/lib/archive/db-ops/pages/read/get-pages-with-rels.d.ts +0 -38
  229. package/lib/archive/db-ops/pages/read/get-pages-with-rels.js +0 -107
  230. package/lib/archive/db-ops/pages/read/get-pages.d.ts +0 -11
  231. package/lib/archive/db-ops/pages/read/get-pages.js +0 -51
  232. package/lib/archive/db-ops/pages/read/get-scraped-html-page-count.d.ts +0 -18
  233. package/lib/archive/db-ops/pages/read/get-scraped-html-page-count.js +0 -25
  234. package/lib/archive/db-ops/pages/read/reconstruct-page-rows.d.ts +0 -31
  235. package/lib/archive/db-ops/pages/read/reconstruct-page-rows.js +0 -32
  236. package/lib/archive/db-ops/pages/reset/clear-page-derived-rows.d.ts +0 -20
  237. package/lib/archive/db-ops/pages/reset/clear-page-derived-rows.js +0 -37
  238. package/lib/archive/db-ops/pages/reset/repromote-external-pages.d.ts +0 -30
  239. package/lib/archive/db-ops/pages/reset/repromote-external-pages.js +0 -91
  240. package/lib/archive/db-ops/pages/reset/reset-failed-pages.d.ts +0 -88
  241. package/lib/archive/db-ops/pages/reset/reset-failed-pages.js +0 -216
  242. package/lib/archive/db-ops/pages/reset/reset-pages-by-urls.d.ts +0 -78
  243. package/lib/archive/db-ops/pages/reset/reset-pages-by-urls.js +0 -146
  244. package/lib/archive/db-ops/pages/reset/retryable-image-scan-codes.d.ts +0 -24
  245. package/lib/archive/db-ops/pages/reset/retryable-image-scan-codes.js +0 -24
  246. package/lib/archive/db-ops/pages/write/insert-audios.d.ts +0 -14
  247. package/lib/archive/db-ops/pages/write/insert-audios.js +0 -25
  248. package/lib/archive/db-ops/pages/write/insert-buttons.d.ts +0 -14
  249. package/lib/archive/db-ops/pages/write/insert-buttons.js +0 -29
  250. package/lib/archive/db-ops/pages/write/insert-canvases.d.ts +0 -14
  251. package/lib/archive/db-ops/pages/write/insert-canvases.js +0 -26
  252. package/lib/archive/db-ops/pages/write/insert-custom-elements.d.ts +0 -27
  253. package/lib/archive/db-ops/pages/write/insert-custom-elements.js +0 -40
  254. package/lib/archive/db-ops/pages/write/insert-headings.d.ts +0 -15
  255. package/lib/archive/db-ops/pages/write/insert-headings.js +0 -27
  256. package/lib/archive/db-ops/pages/write/insert-iframes.d.ts +0 -14
  257. package/lib/archive/db-ops/pages/write/insert-iframes.js +0 -28
  258. package/lib/archive/db-ops/pages/write/insert-inventory-content-items.d.ts +0 -38
  259. package/lib/archive/db-ops/pages/write/insert-inventory-content-items.js +0 -60
  260. package/lib/archive/db-ops/pages/write/insert-inventory-seeds.d.ts +0 -36
  261. package/lib/archive/db-ops/pages/write/insert-inventory-seeds.js +0 -48
  262. package/lib/archive/db-ops/pages/write/insert-inventory-skipped-pages.d.ts +0 -42
  263. package/lib/archive/db-ops/pages/write/insert-inventory-skipped-pages.js +0 -56
  264. package/lib/archive/db-ops/pages/write/insert-jsonld.d.ts +0 -17
  265. package/lib/archive/db-ops/pages/write/insert-jsonld.js +0 -49
  266. package/lib/archive/db-ops/pages/write/insert-main-content-images.d.ts +0 -20
  267. package/lib/archive/db-ops/pages/write/insert-main-content-images.js +0 -32
  268. package/lib/archive/db-ops/pages/write/insert-main-content-tables.d.ts +0 -14
  269. package/lib/archive/db-ops/pages/write/insert-main-content-tables.js +0 -29
  270. package/lib/archive/db-ops/pages/write/insert-page.d.ts +0 -56
  271. package/lib/archive/db-ops/pages/write/insert-page.js +0 -259
  272. package/lib/archive/db-ops/pages/write/insert-technologies.d.ts +0 -25
  273. package/lib/archive/db-ops/pages/write/insert-technologies.js +0 -45
  274. package/lib/archive/db-ops/pages/write/insert-videos.d.ts +0 -14
  275. package/lib/archive/db-ops/pages/write/insert-videos.js +0 -28
  276. package/lib/archive/db-ops/pages/write/link-redirect-sources.d.ts +0 -42
  277. package/lib/archive/db-ops/pages/write/link-redirect-sources.js +0 -101
  278. package/lib/archive/db-ops/pages/write/record-redirect.d.ts +0 -35
  279. package/lib/archive/db-ops/pages/write/record-redirect.js +0 -100
  280. package/lib/archive/db-ops/pages/write/set-skipped-page.d.ts +0 -13
  281. package/lib/archive/db-ops/pages/write/set-skipped-page.js +0 -24
  282. package/lib/archive/db-ops/pages/write/update-page.d.ts +0 -40
  283. package/lib/archive/db-ops/pages/write/update-page.js +0 -419
  284. package/lib/archive/db-ops/pages/write/write-page-html-blob.d.ts +0 -19
  285. package/lib/archive/db-ops/pages/write/write-page-html-blob.js +0 -41
  286. package/lib/archive/db-ops/referrers/get-redirects-for-pages.d.ts +0 -9
  287. package/lib/archive/db-ops/referrers/get-redirects-for-pages.js +0 -15
  288. package/lib/archive/db-ops/referrers/get-referrers-of-page.d.ts +0 -17
  289. package/lib/archive/db-ops/referrers/get-referrers-of-page.js +0 -32
  290. package/lib/archive/db-ops/referrers/get-referrers-of-resource.d.ts +0 -8
  291. package/lib/archive/db-ops/referrers/get-referrers-of-resource.js +0 -15
  292. package/lib/archive/db-ops/resources/build-resource-query.d.ts +0 -25
  293. package/lib/archive/db-ops/resources/build-resource-query.js +0 -29
  294. package/lib/archive/db-ops/resources/get-existing-resource-urls.d.ts +0 -9
  295. package/lib/archive/db-ops/resources/get-existing-resource-urls.js +0 -24
  296. package/lib/archive/db-ops/resources/get-resource-by-url.d.ts +0 -13
  297. package/lib/archive/db-ops/resources/get-resource-by-url.js +0 -22
  298. package/lib/archive/db-ops/resources/get-resource-url-list.d.ts +0 -17
  299. package/lib/archive/db-ops/resources/get-resource-url-list.js +0 -26
  300. package/lib/archive/db-ops/resources/get-resources.d.ts +0 -8
  301. package/lib/archive/db-ops/resources/get-resources.js +0 -11
  302. package/lib/archive/db-ops/resources/insert-inventory-resources.d.ts +0 -24
  303. package/lib/archive/db-ops/resources/insert-inventory-resources.js +0 -64
  304. package/lib/archive/db-ops/resources/insert-resource-referrers.d.ts +0 -15
  305. package/lib/archive/db-ops/resources/insert-resource-referrers.js +0 -54
  306. package/lib/archive/db-ops/resources/insert-resource.d.ts +0 -34
  307. package/lib/archive/db-ops/resources/insert-resource.js +0 -73
  308. package/lib/archive/db-ops/resources/reconstruct-resource-rows.d.ts +0 -26
  309. package/lib/archive/db-ops/resources/reconstruct-resource-rows.js +0 -30
  310. package/lib/archive/db-ops/templates/assign-template-labels.d.ts +0 -60
  311. package/lib/archive/db-ops/templates/assign-template-labels.js +0 -187
  312. package/lib/archive/db-ops/templates/replace-page-templates.d.ts +0 -45
  313. package/lib/archive/db-ops/templates/replace-page-templates.js +0 -174
  314. package/lib/archive/db-ops/templates/types.d.ts +0 -99
  315. package/lib/archive/db-ops/templates/types.js +0 -1
  316. package/lib/archive/debug.d.ts +0 -8
  317. package/lib/archive/debug.js +0 -9
  318. package/lib/archive/decode-html-blob.d.ts +0 -18
  319. package/lib/archive/decode-html-blob.js +0 -31
  320. package/lib/archive/derive-lineage-from-parent.d.ts +0 -37
  321. package/lib/archive/derive-lineage-from-parent.js +0 -42
  322. package/lib/archive/drop-legacy-tables.d.ts +0 -45
  323. package/lib/archive/drop-legacy-tables.js +0 -56
  324. package/lib/archive/filesystem/append-text.d.ts +0 -9
  325. package/lib/archive/filesystem/append-text.js +0 -14
  326. package/lib/archive/filesystem/copy-dir-sync.d.ts +0 -6
  327. package/lib/archive/filesystem/copy-dir-sync.js +0 -9
  328. package/lib/archive/filesystem/copy-dir.d.ts +0 -7
  329. package/lib/archive/filesystem/copy-dir.js +0 -13
  330. package/lib/archive/filesystem/copy-file-with-progress.d.ts +0 -20
  331. package/lib/archive/filesystem/copy-file-with-progress.js +0 -34
  332. package/lib/archive/filesystem/exists.d.ts +0 -6
  333. package/lib/archive/filesystem/exists.js +0 -9
  334. package/lib/archive/filesystem/get-file-list.d.ts +0 -8
  335. package/lib/archive/filesystem/get-file-list.js +0 -12
  336. package/lib/archive/filesystem/is-dir.d.ts +0 -6
  337. package/lib/archive/filesystem/is-dir.js +0 -10
  338. package/lib/archive/filesystem/mkdir.d.ts +0 -8
  339. package/lib/archive/filesystem/mkdir.js +0 -15
  340. package/lib/archive/filesystem/output-binary.d.ts +0 -12
  341. package/lib/archive/filesystem/output-binary.js +0 -17
  342. package/lib/archive/filesystem/output-json.d.ts +0 -9
  343. package/lib/archive/filesystem/output-json.js +0 -14
  344. package/lib/archive/filesystem/output-text.d.ts +0 -11
  345. package/lib/archive/filesystem/output-text.js +0 -32
  346. package/lib/archive/filesystem/parse-pax-path.d.ts +0 -18
  347. package/lib/archive/filesystem/parse-pax-path.js +0 -47
  348. package/lib/archive/filesystem/parse-tar-size-field.d.ts +0 -13
  349. package/lib/archive/filesystem/parse-tar-size-field.js +0 -40
  350. package/lib/archive/filesystem/peek-tar-top-dir.d.ts +0 -35
  351. package/lib/archive/filesystem/peek-tar-top-dir.js +0 -215
  352. package/lib/archive/filesystem/read-json.d.ts +0 -7
  353. package/lib/archive/filesystem/read-json.js +0 -11
  354. package/lib/archive/filesystem/read-text.d.ts +0 -6
  355. package/lib/archive/filesystem/read-text.js +0 -10
  356. package/lib/archive/filesystem/readline.d.ts +0 -11
  357. package/lib/archive/filesystem/readline.js +0 -26
  358. package/lib/archive/filesystem/remove.d.ts +0 -5
  359. package/lib/archive/filesystem/remove.js +0 -10
  360. package/lib/archive/filesystem/rename.d.ts +0 -16
  361. package/lib/archive/filesystem/rename.js +0 -48
  362. package/lib/archive/filesystem/tar.d.ts +0 -23
  363. package/lib/archive/filesystem/tar.js +0 -78
  364. package/lib/archive/filesystem/untar.d.ts +0 -33
  365. package/lib/archive/filesystem/untar.js +0 -84
  366. package/lib/archive/get-failed-page-messages.d.ts +0 -56
  367. package/lib/archive/get-failed-page-messages.js +0 -146
  368. package/lib/archive/get-json.d.ts +0 -10
  369. package/lib/archive/get-json.js +0 -25
  370. package/lib/archive/init-schema.d.ts +0 -59
  371. package/lib/archive/init-schema.js +0 -158
  372. package/lib/archive/is-inventory-source.d.ts +0 -21
  373. package/lib/archive/is-inventory-source.js +0 -22
  374. package/lib/archive/libsql-dialect.d.ts +0 -25
  375. package/lib/archive/libsql-dialect.js +0 -28
  376. package/lib/archive/limited-page-ids.d.ts +0 -9
  377. package/lib/archive/limited-page-ids.js +0 -18
  378. package/lib/archive/meta/assert-compatible-version.d.ts +0 -60
  379. package/lib/archive/meta/assert-compatible-version.js +0 -93
  380. package/lib/archive/meta/classify-jsonld-type.d.ts +0 -23
  381. package/lib/archive/meta/classify-jsonld-type.js +0 -43
  382. package/lib/archive/meta/compare-semver.d.ts +0 -23
  383. package/lib/archive/meta/compare-semver.js +0 -51
  384. package/lib/archive/meta/compute-main-contents-denormalized.d.ts +0 -41
  385. package/lib/archive/meta/compute-main-contents-denormalized.js +0 -88
  386. package/lib/archive/meta/compute-page-denormalized.d.ts +0 -21
  387. package/lib/archive/meta/compute-page-denormalized.js +0 -35
  388. package/lib/archive/meta/derive-flat-from-meta.d.ts +0 -35
  389. package/lib/archive/meta/derive-flat-from-meta.js +0 -158
  390. package/lib/archive/meta/derive-meta-extras.d.ts +0 -20
  391. package/lib/archive/meta/derive-meta-extras.js +0 -23
  392. package/lib/archive/meta/extract-tags-for-archive.d.ts +0 -18
  393. package/lib/archive/meta/extract-tags-for-archive.js +0 -36
  394. package/lib/archive/meta/summarize-jsonld.d.ts +0 -17
  395. package/lib/archive/meta/summarize-jsonld.js +0 -29
  396. package/lib/archive/meta/technologies/combine-technology-confidence.d.ts +0 -46
  397. package/lib/archive/meta/technologies/combine-technology-confidence.js +0 -93
  398. package/lib/archive/meta/technologies/convert-legacy-page-tags-to-inserts.d.ts +0 -45
  399. package/lib/archive/meta/technologies/convert-legacy-page-tags-to-inserts.js +0 -53
  400. package/lib/archive/meta/technologies/convert-tag-row-to-wappalyzer-signal.d.ts +0 -33
  401. package/lib/archive/meta/technologies/convert-tag-row-to-wappalyzer-signal.js +0 -46
  402. package/lib/archive/meta/technologies/extract-technologies-for-archive.d.ts +0 -30
  403. package/lib/archive/meta/technologies/extract-technologies-for-archive.js +0 -27
  404. package/lib/archive/meta/technologies/match-structural-technology-signals.d.ts +0 -13
  405. package/lib/archive/meta/technologies/match-structural-technology-signals.js +0 -44
  406. package/lib/archive/meta/technologies/normalize-wappalyzer-entries.d.ts +0 -25
  407. package/lib/archive/meta/technologies/normalize-wappalyzer-entries.js +0 -35
  408. package/lib/archive/meta/technologies/technology-signal-definitions.d.ts +0 -43
  409. package/lib/archive/meta/technologies/technology-signal-definitions.js +0 -193
  410. package/lib/archive/meta/technologies/types.d.ts +0 -68
  411. package/lib/archive/meta/technologies/types.js +0 -13
  412. package/lib/archive/meta/types.d.ts +0 -647
  413. package/lib/archive/meta/types.js +0 -65
  414. package/lib/archive/migrate-content-items-alias-of-id.d.ts +0 -52
  415. package/lib/archive/migrate-content-items-alias-of-id.js +0 -69
  416. package/lib/archive/migrate-content-items-dedupe-cap-event-id.d.ts +0 -46
  417. package/lib/archive/migrate-content-items-dedupe-cap-event-id.js +0 -62
  418. package/lib/archive/migrate-content-items-is-metadata-only.d.ts +0 -44
  419. package/lib/archive/migrate-content-items-is-metadata-only.js +0 -60
  420. package/lib/archive/migrate-entity-tables.d.ts +0 -55
  421. package/lib/archive/migrate-entity-tables.js +0 -66
  422. package/lib/archive/migrate-info-created-cwd.d.ts +0 -17
  423. package/lib/archive/migrate-info-created-cwd.js +0 -36
  424. package/lib/archive/migrate-info-main-content-selector.d.ts +0 -16
  425. package/lib/archive/migrate-info-main-content-selector.js +0 -35
  426. package/lib/archive/migrate-info-request-header-names.d.ts +0 -16
  427. package/lib/archive/migrate-info-request-header-names.js +0 -35
  428. package/lib/archive/migrate-info-roots.d.ts +0 -20
  429. package/lib/archive/migrate-info-roots.js +0 -52
  430. package/lib/archive/migrate-inventory-runs-to-list-reconcile-runs.d.ts +0 -34
  431. package/lib/archive/migrate-inventory-runs-to-list-reconcile-runs.js +0 -51
  432. package/lib/archive/migrate-list-reconcile-runs-exclude-skipped.d.ts +0 -25
  433. package/lib/archive/migrate-list-reconcile-runs-exclude-skipped.js +0 -44
  434. package/lib/archive/migrate-list-reconcile-runs-invalid-skipped.d.ts +0 -16
  435. package/lib/archive/migrate-list-reconcile-runs-invalid-skipped.js +0 -35
  436. package/lib/archive/migrate-main-contents-columns.d.ts +0 -26
  437. package/lib/archive/migrate-main-contents-columns.js +0 -61
  438. package/lib/archive/migrate-page-meta-body-hash.d.ts +0 -44
  439. package/lib/archive/migrate-page-meta-body-hash.js +0 -63
  440. package/lib/archive/migrate-page-meta-console-error-count.d.ts +0 -27
  441. package/lib/archive/migrate-page-meta-console-error-count.js +0 -45
  442. package/lib/archive/migrate-page-meta-custom-element-count.d.ts +0 -33
  443. package/lib/archive/migrate-page-meta-custom-element-count.js +0 -51
  444. package/lib/archive/migrate-page-meta-image-scan.d.ts +0 -27
  445. package/lib/archive/migrate-page-meta-image-scan.js +0 -52
  446. package/lib/archive/migrate-page-tags-to-page-technologies.d.ts +0 -39
  447. package/lib/archive/migrate-page-tags-to-page-technologies.js +0 -79
  448. package/lib/archive/migrate-ref-tables.d.ts +0 -25
  449. package/lib/archive/migrate-ref-tables.js +0 -38
  450. package/lib/archive/page-meta-column-maps.d.ts +0 -32
  451. package/lib/archive/page-meta-column-maps.js +0 -43
  452. package/lib/archive/page.d.ts +0 -532
  453. package/lib/archive/page.js +0 -750
  454. package/lib/archive/peek-archive-lock.d.ts +0 -40
  455. package/lib/archive/peek-archive-lock.js +0 -62
  456. package/lib/archive/populate-entity-tables/collapse-anchor-rows.d.ts +0 -41
  457. package/lib/archive/populate-entity-tables/collapse-anchor-rows.js +0 -87
  458. package/lib/archive/populate-entity-tables/derive-dom-path.d.ts +0 -35
  459. package/lib/archive/populate-entity-tables/derive-dom-path.js +0 -72
  460. package/lib/archive/populate-entity-tables/is-blob-ref-value.d.ts +0 -16
  461. package/lib/archive/populate-entity-tables/is-blob-ref-value.js +0 -19
  462. package/lib/archive/populate-entity-tables/match-images-to-dom-paths.d.ts +0 -66
  463. package/lib/archive/populate-entity-tables/match-images-to-dom-paths.js +0 -96
  464. package/lib/archive/populate-entity-tables/populate-anchor-edges.d.ts +0 -33
  465. package/lib/archive/populate-entity-tables/populate-anchor-edges.js +0 -153
  466. package/lib/archive/populate-entity-tables/populate-content-items.d.ts +0 -40
  467. package/lib/archive/populate-entity-tables/populate-content-items.js +0 -141
  468. package/lib/archive/populate-entity-tables/populate-entities.d.ts +0 -81
  469. package/lib/archive/populate-entity-tables/populate-entities.js +0 -111
  470. package/lib/archive/populate-entity-tables/populate-image-items.d.ts +0 -91
  471. package/lib/archive/populate-entity-tables/populate-image-items.js +0 -223
  472. package/lib/archive/populate-entity-tables/populate-page-meta.d.ts +0 -33
  473. package/lib/archive/populate-entity-tables/populate-page-meta.js +0 -267
  474. package/lib/archive/populate-entity-tables/populate-resource-items.d.ts +0 -22
  475. package/lib/archive/populate-entity-tables/populate-resource-items.js +0 -114
  476. package/lib/archive/populate-entity-tables/populate-resource-ref-edges.d.ts +0 -31
  477. package/lib/archive/populate-entity-tables/populate-resource-ref-edges.js +0 -33
  478. package/lib/archive/populate-entity-tables/resolve-blob-refs.d.ts +0 -31
  479. package/lib/archive/populate-entity-tables/resolve-blob-refs.js +0 -100
  480. package/lib/archive/populate-entity-tables/resolve-content-type-refs.d.ts +0 -22
  481. package/lib/archive/populate-entity-tables/resolve-content-type-refs.js +0 -27
  482. package/lib/archive/populate-entity-tables/resolve-header-sets.d.ts +0 -49
  483. package/lib/archive/populate-entity-tables/resolve-header-sets.js +0 -122
  484. package/lib/archive/populate-entity-tables/resolve-json-refs.d.ts +0 -25
  485. package/lib/archive/populate-entity-tables/resolve-json-refs.js +0 -67
  486. package/lib/archive/populate-entity-tables/resolve-text-refs.d.ts +0 -30
  487. package/lib/archive/populate-entity-tables/resolve-text-refs.js +0 -61
  488. package/lib/archive/populate-entity-tables/resolve-url-or-blob-from-maps.d.ts +0 -21
  489. package/lib/archive/populate-entity-tables/resolve-url-or-blob-from-maps.js +0 -27
  490. package/lib/archive/populate-entity-tables/resolve-url-refs.d.ts +0 -33
  491. package/lib/archive/populate-entity-tables/resolve-url-refs.js +0 -60
  492. package/lib/archive/populate-entity-tables/test-utils/count-rows.d.ts +0 -17
  493. package/lib/archive/populate-entity-tables/test-utils/count-rows.js +0 -20
  494. package/lib/archive/populate-entity-tables/test-utils/seed-content-items.d.ts +0 -25
  495. package/lib/archive/populate-entity-tables/test-utils/seed-content-items.js +0 -42
  496. package/lib/archive/populate-entity-tables/test-utils/setup-entities-db.d.ts +0 -30
  497. package/lib/archive/populate-entity-tables/test-utils/setup-entities-db.js +0 -187
  498. package/lib/archive/populate-entity-tables/types.d.ts +0 -157
  499. package/lib/archive/populate-entity-tables/types.js +0 -12
  500. package/lib/archive/populate-entity-tables/upsert-text-refs.d.ts +0 -38
  501. package/lib/archive/populate-entity-tables/upsert-text-refs.js +0 -78
  502. package/lib/archive/populate-ref-tables/classify-content-type.d.ts +0 -16
  503. package/lib/archive/populate-ref-tables/classify-content-type.js +0 -52
  504. package/lib/archive/populate-ref-tables/compute-content-hash.d.ts +0 -22
  505. package/lib/archive/populate-ref-tables/compute-content-hash.js +0 -26
  506. package/lib/archive/populate-ref-tables/compute-header-flags.d.ts +0 -16
  507. package/lib/archive/populate-ref-tables/compute-header-flags.js +0 -70
  508. package/lib/archive/populate-ref-tables/content-type-rules.d.ts +0 -38
  509. package/lib/archive/populate-ref-tables/content-type-rules.js +0 -133
  510. package/lib/archive/populate-ref-tables/create-header-table-caches.d.ts +0 -25
  511. package/lib/archive/populate-ref-tables/create-header-table-caches.js +0 -49
  512. package/lib/archive/populate-ref-tables/data-uri-url-refs-limit.d.ts +0 -15
  513. package/lib/archive/populate-ref-tables/data-uri-url-refs-limit.js +0 -15
  514. package/lib/archive/populate-ref-tables/decode-data-uri.d.ts +0 -21
  515. package/lib/archive/populate-ref-tables/decode-data-uri.js +0 -126
  516. package/lib/archive/populate-ref-tables/decompose-header-set.d.ts +0 -29
  517. package/lib/archive/populate-ref-tables/decompose-header-set.js +0 -157
  518. package/lib/archive/populate-ref-tables/decompose-url.d.ts +0 -25
  519. package/lib/archive/populate-ref-tables/decompose-url.js +0 -70
  520. package/lib/archive/populate-ref-tables/header-stability.d.ts +0 -19
  521. package/lib/archive/populate-ref-tables/header-stability.js +0 -22
  522. package/lib/archive/populate-ref-tables/header-value-cache-key.d.ts +0 -17
  523. package/lib/archive/populate-ref-tables/header-value-cache-key.js +0 -19
  524. package/lib/archive/populate-ref-tables/normalize-mime.d.ts +0 -24
  525. package/lib/archive/populate-ref-tables/normalize-mime.js +0 -36
  526. package/lib/archive/populate-ref-tables/populate-blob-refs.d.ts +0 -38
  527. package/lib/archive/populate-ref-tables/populate-blob-refs.js +0 -134
  528. package/lib/archive/populate-ref-tables/populate-content-type-refs.d.ts +0 -27
  529. package/lib/archive/populate-ref-tables/populate-content-type-refs.js +0 -70
  530. package/lib/archive/populate-ref-tables/populate-header-tables.d.ts +0 -35
  531. package/lib/archive/populate-ref-tables/populate-header-tables.js +0 -80
  532. package/lib/archive/populate-ref-tables/populate-json-refs.d.ts +0 -29
  533. package/lib/archive/populate-ref-tables/populate-json-refs.js +0 -101
  534. package/lib/archive/populate-ref-tables/populate-refs.d.ts +0 -51
  535. package/lib/archive/populate-ref-tables/populate-refs.js +0 -62
  536. package/lib/archive/populate-ref-tables/populate-text-refs.d.ts +0 -32
  537. package/lib/archive/populate-ref-tables/populate-text-refs.js +0 -133
  538. package/lib/archive/populate-ref-tables/populate-url-refs.d.ts +0 -28
  539. package/lib/archive/populate-ref-tables/populate-url-refs.js +0 -148
  540. package/lib/archive/populate-ref-tables/test-utils/count-rows.d.ts +0 -15
  541. package/lib/archive/populate-ref-tables/test-utils/count-rows.js +0 -17
  542. package/lib/archive/populate-ref-tables/types.d.ts +0 -197
  543. package/lib/archive/populate-ref-tables/types.js +0 -7
  544. package/lib/archive/populate-ref-tables/upsert-one-header-set.d.ts +0 -34
  545. package/lib/archive/populate-ref-tables/upsert-one-header-set.js +0 -208
  546. package/lib/archive/populate-ref-tables/volatile-header-names.d.ts +0 -20
  547. package/lib/archive/populate-ref-tables/volatile-header-names.js +0 -33
  548. package/lib/archive/redirect-table.d.ts +0 -9
  549. package/lib/archive/redirect-table.js +0 -28
  550. package/lib/archive/resolve-redirect-chain.d.ts +0 -33
  551. package/lib/archive/resolve-redirect-chain.js +0 -27
  552. package/lib/archive/resource.d.ts +0 -46
  553. package/lib/archive/resource.js +0 -62
  554. package/lib/archive/retarget-legacy-fk-tables.d.ts +0 -60
  555. package/lib/archive/retarget-legacy-fk-tables.js +0 -153
  556. package/lib/archive/safe-path.d.ts +0 -9
  557. package/lib/archive/safe-path.js +0 -17
  558. package/lib/archive/test-utils/build-full-schema-test-db.d.ts +0 -34
  559. package/lib/archive/test-utils/build-full-schema-test-db.js +0 -74
  560. package/lib/archive/test-utils/fk-parent-tables.d.ts +0 -15
  561. package/lib/archive/test-utils/fk-parent-tables.js +0 -19
  562. package/lib/archive/test-utils/seed-content-item.d.ts +0 -35
  563. package/lib/archive/test-utils/seed-content-item.js +0 -42
  564. package/lib/archive/test-utils/setup-legacy-fk-db.d.ts +0 -33
  565. package/lib/archive/test-utils/setup-legacy-fk-db.js +0 -270
  566. package/lib/archive/transfer/attach-source-database.d.ts +0 -31
  567. package/lib/archive/transfer/attach-source-database.js +0 -40
  568. package/lib/archive/transfer/build-split-config.d.ts +0 -30
  569. package/lib/archive/transfer/build-split-config.js +0 -42
  570. package/lib/archive/transfer/clear-replaced-page-rows.d.ts +0 -20
  571. package/lib/archive/transfer/clear-replaced-page-rows.js +0 -57
  572. package/lib/archive/transfer/concat-archives.d.ts +0 -55
  573. package/lib/archive/transfer/concat-archives.js +0 -95
  574. package/lib/archive/transfer/content-item-rank-sql.d.ts +0 -21
  575. package/lib/archive/transfer/content-item-rank-sql.js +0 -23
  576. package/lib/archive/transfer/copy-analysis-violations.d.ts +0 -19
  577. package/lib/archive/transfer/copy-analysis-violations.js +0 -43
  578. package/lib/archive/transfer/copy-anchor-edges.d.ts +0 -28
  579. package/lib/archive/transfer/copy-anchor-edges.js +0 -42
  580. package/lib/archive/transfer/copy-dictionaries-for-concat.d.ts +0 -39
  581. package/lib/archive/transfer/copy-dictionaries-for-concat.js +0 -81
  582. package/lib/archive/transfer/copy-dictionaries-for-split.d.ts +0 -29
  583. package/lib/archive/transfer/copy-dictionaries-for-split.js +0 -235
  584. package/lib/archive/transfer/copy-header-set-children.d.ts +0 -27
  585. package/lib/archive/transfer/copy-header-set-children.js +0 -51
  586. package/lib/archive/transfer/copy-image-items.d.ts +0 -21
  587. package/lib/archive/transfer/copy-image-items.js +0 -62
  588. package/lib/archive/transfer/copy-inventory-source-lists.d.ts +0 -30
  589. package/lib/archive/transfer/copy-inventory-source-lists.js +0 -61
  590. package/lib/archive/transfer/copy-journal-tables.d.ts +0 -30
  591. package/lib/archive/transfer/copy-journal-tables.js +0 -56
  592. package/lib/archive/transfer/copy-page-console-logs.d.ts +0 -16
  593. package/lib/archive/transfer/copy-page-console-logs.js +0 -27
  594. package/lib/archive/transfer/copy-page-html-blobs.d.ts +0 -31
  595. package/lib/archive/transfer/copy-page-html-blobs.js +0 -43
  596. package/lib/archive/transfer/copy-page-meta.d.ts +0 -27
  597. package/lib/archive/transfer/copy-page-meta.js +0 -68
  598. package/lib/archive/transfer/copy-page-template-clusters.d.ts +0 -31
  599. package/lib/archive/transfer/copy-page-template-clusters.js +0 -56
  600. package/lib/archive/transfer/copy-page-template-labels.d.ts +0 -34
  601. package/lib/archive/transfer/copy-page-template-labels.js +0 -88
  602. package/lib/archive/transfer/copy-resource-items.d.ts +0 -29
  603. package/lib/archive/transfer/copy-resource-items.js +0 -89
  604. package/lib/archive/transfer/copy-resource-ref-edges.d.ts +0 -20
  605. package/lib/archive/transfer/copy-resource-ref-edges.js +0 -33
  606. package/lib/archive/transfer/copy-simple-page-scoped-tables.d.ts +0 -15
  607. package/lib/archive/transfer/copy-simple-page-scoped-tables.js +0 -34
  608. package/lib/archive/transfer/count-external-pages-in-scope.d.ts +0 -26
  609. package/lib/archive/transfer/count-external-pages-in-scope.js +0 -40
  610. package/lib/archive/transfer/create-transfer-temp-tables.d.ts +0 -30
  611. package/lib/archive/transfer/create-transfer-temp-tables.js +0 -59
  612. package/lib/archive/transfer/dictionary-copy-specs.d.ts +0 -32
  613. package/lib/archive/transfer/dictionary-copy-specs.js +0 -29
  614. package/lib/archive/transfer/drop-transfer-temp-tables.d.ts +0 -9
  615. package/lib/archive/transfer/drop-transfer-temp-tables.js +0 -18
  616. package/lib/archive/transfer/flatten-redirect-chains.d.ts +0 -44
  617. package/lib/archive/transfer/flatten-redirect-chains.js +0 -74
  618. package/lib/archive/transfer/insert-content-items.d.ts +0 -35
  619. package/lib/archive/transfer/insert-content-items.js +0 -116
  620. package/lib/archive/transfer/list-transfer-columns.d.ts +0 -35
  621. package/lib/archive/transfer/list-transfer-columns.js +0 -45
  622. package/lib/archive/transfer/mark-in-scope-content-items.d.ts +0 -31
  623. package/lib/archive/transfer/mark-in-scope-content-items.js +0 -54
  624. package/lib/archive/transfer/merge-archive-configs.d.ts +0 -51
  625. package/lib/archive/transfer/merge-archive-configs.js +0 -85
  626. package/lib/archive/transfer/plan-content-items-for-concat.d.ts +0 -33
  627. package/lib/archive/transfer/plan-content-items-for-concat.js +0 -51
  628. package/lib/archive/transfer/plan-content-items-for-split.d.ts +0 -42
  629. package/lib/archive/transfer/plan-content-items-for-split.js +0 -83
  630. package/lib/archive/transfer/plan-resource-items.d.ts +0 -40
  631. package/lib/archive/transfer/plan-resource-items.js +0 -69
  632. package/lib/archive/transfer/quote-transfer-identifier.d.ts +0 -18
  633. package/lib/archive/transfer/quote-transfer-identifier.js +0 -20
  634. package/lib/archive/transfer/reclassify-resource-externality.d.ts +0 -37
  635. package/lib/archive/transfer/reclassify-resource-externality.js +0 -66
  636. package/lib/archive/transfer/remap-redirect-dest-ids.d.ts +0 -34
  637. package/lib/archive/transfer/remap-redirect-dest-ids.js +0 -51
  638. package/lib/archive/transfer/replace-content-items.d.ts +0 -39
  639. package/lib/archive/transfer/replace-content-items.js +0 -83
  640. package/lib/archive/transfer/simple-page-scoped-tables.d.ts +0 -25
  641. package/lib/archive/transfer/simple-page-scoped-tables.js +0 -38
  642. package/lib/archive/transfer/split-archive.d.ts +0 -55
  643. package/lib/archive/transfer/split-archive.js +0 -98
  644. package/lib/archive/transfer/transfer-action.d.ts +0 -34
  645. package/lib/archive/transfer/transfer-action.js +0 -32
  646. package/lib/archive/transfer/transfer-archive-rows.d.ts +0 -65
  647. package/lib/archive/transfer/transfer-archive-rows.js +0 -158
  648. package/lib/archive/transfer/transfer-dictionary-tables.d.ts +0 -12
  649. package/lib/archive/transfer/transfer-dictionary-tables.js +0 -23
  650. package/lib/archive/transfer/transfer-source-alias.d.ts +0 -9
  651. package/lib/archive/transfer/transfer-source-alias.js +0 -9
  652. package/lib/archive/transfer/types.d.ts +0 -111
  653. package/lib/archive/transfer/types.js +0 -35
  654. package/lib/archive/types.d.ts +0 -755
  655. package/lib/archive/types.js +0 -1
  656. package/lib/archive/url-alias/compute-tier-a-alias-key.d.ts +0 -31
  657. package/lib/archive/url-alias/compute-tier-a-alias-key.js +0 -36
  658. package/lib/archive/url-alias/compute-tier-b-alias-key.d.ts +0 -19
  659. package/lib/archive/url-alias/compute-tier-b-alias-key.js +0 -30
  660. package/lib/archive/url-alias/format-alias-key.d.ts +0 -13
  661. package/lib/archive/url-alias/format-alias-key.js +0 -14
  662. package/lib/archive/url-alias/parse-alias-key-parts.d.ts +0 -15
  663. package/lib/archive/url-alias/parse-alias-key-parts.js +0 -40
  664. package/lib/archive/url-alias/types.d.ts +0 -7
  665. package/lib/archive/url-alias/types.js +0 -1
  666. package/lib/archive/verify-migration/capture-rejection.d.ts +0 -24
  667. package/lib/archive/verify-migration/capture-rejection.js +0 -31
  668. package/lib/archive/verify-migration/check-anchor-edges-count.d.ts +0 -34
  669. package/lib/archive/verify-migration/check-anchor-edges-count.js +0 -72
  670. package/lib/archive/verify-migration/check-anchor-edges-sum.d.ts +0 -13
  671. package/lib/archive/verify-migration/check-anchor-edges-sum.js +0 -27
  672. package/lib/archive/verify-migration/check-content-items-count.d.ts +0 -16
  673. package/lib/archive/verify-migration/check-content-items-count.js +0 -30
  674. package/lib/archive/verify-migration/check-content-type-preservation.d.ts +0 -22
  675. package/lib/archive/verify-migration/check-content-type-preservation.js +0 -40
  676. package/lib/archive/verify-migration/check-foreign-key-integrity.d.ts +0 -31
  677. package/lib/archive/verify-migration/check-foreign-key-integrity.js +0 -47
  678. package/lib/archive/verify-migration/check-image-items-count.d.ts +0 -12
  679. package/lib/archive/verify-migration/check-image-items-count.js +0 -26
  680. package/lib/archive/verify-migration/check-page-meta-count.d.ts +0 -15
  681. package/lib/archive/verify-migration/check-page-meta-count.js +0 -31
  682. package/lib/archive/verify-migration/check-reader-parity.d.ts +0 -23
  683. package/lib/archive/verify-migration/check-reader-parity.js +0 -211
  684. package/lib/archive/verify-migration/check-resource-items-count.d.ts +0 -17
  685. package/lib/archive/verify-migration/check-resource-items-count.js +0 -33
  686. package/lib/archive/verify-migration/check-url-round-trip.d.ts +0 -43
  687. package/lib/archive/verify-migration/check-url-round-trip.js +0 -112
  688. package/lib/archive/verify-migration/types.d.ts +0 -70
  689. package/lib/archive/verify-migration/types.js +0 -63
  690. package/lib/archive/verify-migration/verify-migration.d.ts +0 -41
  691. package/lib/archive/verify-migration/verify-migration.js +0 -120
  692. package/lib/classify-error-kind.d.ts +0 -20
  693. package/lib/classify-error-kind.js +0 -136
  694. package/lib/concat-source-transfer-phases.d.ts +0 -10
  695. package/lib/concat-source-transfer-phases.js +0 -17
  696. package/lib/crawler/build-scope-map.d.ts +0 -21
  697. package/lib/crawler/build-scope-map.js +0 -32
  698. package/lib/crawler/decompose-url.d.ts +0 -25
  699. package/lib/crawler/decompose-url.js +0 -71
  700. package/lib/crawler/dedupe/compute-shape-key.d.ts +0 -57
  701. package/lib/crawler/dedupe/compute-shape-key.js +0 -128
  702. package/lib/crawler/find-scope-entry.d.ts +0 -25
  703. package/lib/crawler/find-scope-entry.js +0 -45
  704. package/lib/crawler/is-html-content-type.d.ts +0 -17
  705. package/lib/crawler/is-html-content-type.js +0 -19
  706. package/lib/crawler/normalize-content-type.d.ts +0 -14
  707. package/lib/crawler/normalize-content-type.js +0 -20
  708. package/lib/crawler/reconstruct-url.d.ts +0 -10
  709. package/lib/crawler/reconstruct-url.js +0 -28
  710. package/lib/is-within-outage-window.d.ts +0 -49
  711. package/lib/is-within-outage-window.js +0 -33
  712. package/lib/network-related-error-kinds.d.ts +0 -23
  713. package/lib/network-related-error-kinds.js +0 -28
  714. package/lib/permanent-error-kinds.d.ts +0 -48
  715. package/lib/permanent-error-kinds.js +0 -54
  716. package/lib/split-source-transfer-phases.d.ts +0 -11
  717. package/lib/split-source-transfer-phases.js +0 -18
  718. package/lib/template-classification/classify-archive-page-templates.d.ts +0 -41
  719. package/lib/template-classification/classify-archive-page-templates.js +0 -79
  720. package/lib/template-classification/classify-page-templates.d.ts +0 -37
  721. package/lib/template-classification/classify-page-templates.js +0 -69
  722. package/lib/template-classification/collect-page-stylesheet-urls.d.ts +0 -32
  723. package/lib/template-classification/collect-page-stylesheet-urls.js +0 -130
  724. package/lib/template-classification/create-content-root-hint.d.ts +0 -36
  725. package/lib/template-classification/create-content-root-hint.js +0 -47
  726. package/lib/template-classification/create-page-cluster-factory.d.ts +0 -60
  727. package/lib/template-classification/create-page-cluster-factory.js +0 -98
  728. package/lib/template-classification/types.d.ts +0 -108
  729. package/lib/template-classification/types.js +0 -1
  730. package/lib/transfer-post-phases.d.ts +0 -10
  731. package/lib/transfer-post-phases.js +0 -13
  732. package/lib/utils/array/each-splitted.d.ts +0 -10
  733. package/lib/utils/array/each-splitted.js +0 -14
  734. package/lib/utils/error/emit-error-with-retry.d.ts +0 -40
  735. package/lib/utils/error/emit-error-with-retry.js +0 -44
  736. package/lib/utils/error/emit-error.d.ts +0 -39
  737. package/lib/utils/error/emit-error.js +0 -41
  738. package/lib/utils/object/parse-response-headers.d.ts +0 -12
  739. package/lib/utils/object/parse-response-headers.js +0 -26
  740. package/lib/utils/object/redact-request-headers.d.ts +0 -15
  741. package/lib/utils/object/redact-request-headers.js +0 -27
  742. package/lib/write-queue.d.ts +0 -32
  743. package/lib/write-queue.js +0 -55
  744. /package/lib/{archive/cache/types.js → beholder-type-mirror-parity.js} +0 -0
@@ -1,270 +0,0 @@
1
- /**
2
- * Provisions the pre-0.13 legacy table shape on a test database:
3
- * the five legacy write-model tables (`pages` / `anchors` / `images` /
4
- * `resources` / `resources-referrers`) plus the five adjunct tables in
5
- * their old form whose FK columns still point at `pages(id)`
6
- * (`page_html_ref` / `page_tags` / `page_jsonld` / `page_errors` /
7
- * `analysis_violations`, with their companion tables `page_html_blobs` /
8
- * `analysis_text_refs`).
9
- *
10
- * `initSchema` no longer creates any of these shapes — fresh archives get
11
- * neither the legacy write-model tables nor `pages(id)`-referencing
12
- * adjunct tables — so specs that exercise the migration input format
13
- * (`scripts/migrate-to-0.13.mjs` integration, `retargetLegacyFkTables`,
14
- * `dropLegacyTables`) build it through this helper instead. The DDL is a
15
- * verbatim copy of what pre-0.13 archives actually contain: the legacy
16
- * write-model tables match the pre-0.13 `initSchema`, and the adjunct
17
- * tables match the `scripts/migrate-to-0.10.mjs` / lazy-runtime-migration
18
- * output of that era.
19
- *
20
- * Any current-form adjunct tables already present (e.g. created by
21
- * `Archive.create()` on the current schema) are dropped first so the
22
- * old-FK versions can take their place — callers get a deterministic
23
- * "genuine pre-0.13 archive" shape regardless of how the underlying DB
24
- * was provisioned.
25
- * @param db - Knex connected to the test DB (or a transaction).
26
- * @example
27
- * await createRefTables(db);
28
- * await createEntityTables(db);
29
- * await setupLegacyFkDb(db);
30
- * await db('pages').insert({ url: 'https://example.com/', scraped: 1, isTarget: 1 });
31
- */
32
- export async function setupLegacyFkDb(db) {
33
- // Children before parents so the drops never trip FK enforcement
34
- // when the caller has `PRAGMA foreign_keys = ON`.
35
- await db.raw('DROP TABLE IF EXISTS "page_html_ref"');
36
- await db.raw('DROP TABLE IF EXISTS "page_html_blobs"');
37
- await db.raw('DROP TABLE IF EXISTS "analysis_violations"');
38
- await db.raw('DROP TABLE IF EXISTS "analysis_text_refs"');
39
- await db.raw('DROP TABLE IF EXISTS "page_tags"');
40
- await db.raw('DROP TABLE IF EXISTS "page_jsonld"');
41
- await db.raw('DROP TABLE IF EXISTS "page_errors"');
42
- await db.schema
43
- .createTable('pages', (t) => {
44
- t.increments('id');
45
- t.string('url', 8190).notNullable().unique();
46
- t.integer('redirectDestId').unsigned().references('pages.id').defaultTo(null);
47
- t.boolean('scraped').notNullable();
48
- t.boolean('isTarget').notNullable();
49
- t.boolean('isExternal');
50
- t.integer('status');
51
- t.string('statusText');
52
- t.string('contentType').nullable();
53
- t.integer('contentLength').unsigned().nullable();
54
- t.json('responseHeaders').nullable();
55
- // Document basics
56
- t.string('lang');
57
- t.string('dir');
58
- t.string('charset');
59
- t.string('baseHref');
60
- t.text('viewport_raw');
61
- t.string('themeColor');
62
- t.string('applicationName');
63
- t.string('author');
64
- t.string('generator');
65
- t.string('publisher');
66
- // Title / description / keywords (top-level Meta fields)
67
- t.string('title');
68
- t.text('description');
69
- t.text('keywords');
70
- // Robots
71
- t.text('robots_raw');
72
- t.integer('robots_noindex');
73
- t.integer('robots_nofollow');
74
- t.integer('robots_noarchive');
75
- t.integer('robots_noimageindex');
76
- t.string('googlebot');
77
- // Link (1:1 only — array shapes live in meta_extras)
78
- t.string('canonical', 8190);
79
- t.string('amphtml', 8190);
80
- t.string('manifest', 8190);
81
- t.string('icon_href', 8190);
82
- t.string('appleTouchIcon_href', 8190);
83
- // Open Graph
84
- t.string('og_type');
85
- t.string('og_title');
86
- t.string('og_url', 8190);
87
- t.string('og_site_name');
88
- t.text('og_description');
89
- t.string('og_image', 8190);
90
- t.string('og_image_alt');
91
- t.string('og_image_width');
92
- t.string('og_image_height');
93
- t.string('og_locale');
94
- t.string('og_article_published_time');
95
- t.string('og_article_modified_time');
96
- // Twitter
97
- t.string('twitter_card');
98
- t.string('twitter_site');
99
- t.string('twitter_creator');
100
- t.string('twitter_title');
101
- t.text('twitter_description');
102
- t.string('twitter_image', 8190);
103
- // One-offs
104
- t.string('fb_app_id');
105
- t.string('verification_google');
106
- t.integer('formatDetection_telephone');
107
- // Within-archive observation timestamps (UNIX ms)
108
- t.integer('firstCrawledAt');
109
- t.integer('lastCrawledAt');
110
- // Denormalised aggregates
111
- t.integer('tag_count');
112
- t.integer('jsonld_count');
113
- t.text('tags_providers_csv');
114
- // Catch-all JSON for nested Meta sub-objects not flattened above
115
- t.json('meta_extras');
116
- // Crawl lifecycle
117
- t.boolean('isSkipped');
118
- t.string('skipReason');
119
- t.integer('order').unsigned().nullable();
120
- t.string('source').notNullable().defaultTo('crawled');
121
- t.index('isExternal');
122
- t.index('contentType');
123
- t.index('scraped');
124
- t.index('redirectDestId');
125
- t.index('order');
126
- t.index('robots_noindex');
127
- t.index('og_type');
128
- t.index('source');
129
- })
130
- .createTable('anchors', (t) => {
131
- t.increments('id');
132
- t.integer('pageId').notNullable().unsigned().references('pages.id');
133
- t.integer('hrefId').notNullable().unsigned().references('pages.id');
134
- t.string('hash');
135
- t.string('textContent').nullable();
136
- t.index('pageId');
137
- t.index('hrefId');
138
- })
139
- .createTable('images', (t) => {
140
- t.increments('id');
141
- t.integer('pageId').notNullable().unsigned().references('pages.id');
142
- t.string('src', 8190);
143
- t.string('currentSrc', 8190);
144
- t.string('alt');
145
- t.float('width').unsigned().notNullable();
146
- t.float('height').unsigned().notNullable();
147
- t.integer('naturalWidth').unsigned().notNullable();
148
- t.integer('naturalHeight').unsigned().notNullable();
149
- t.boolean('isLazy');
150
- t.integer('viewportWidth').unsigned().notNullable();
151
- t.string('sourceCode');
152
- t.index('pageId');
153
- })
154
- .createTable('resources', (t) => {
155
- t.increments('id');
156
- t.string('url', 8190).notNullable().unique();
157
- t.boolean('isExternal');
158
- t.integer('status');
159
- t.string('statusText');
160
- t.string('contentType').nullable();
161
- t.integer('contentLength').unsigned().nullable();
162
- t.string('compress').nullable();
163
- t.string('cdn').nullable();
164
- t.json('responseHeaders').nullable();
165
- t.string('source').notNullable().defaultTo('crawled');
166
- t.index('source');
167
- })
168
- .createTable('resources-referrers', (t) => {
169
- t.increments('id');
170
- t.integer('resourceId').notNullable().unsigned().references('resources.id');
171
- t.integer('pageId').notNullable().unsigned().references('pages.id');
172
- t.unique(['resourceId', 'pageId']);
173
- t.index('resourceId');
174
- t.index('pageId');
175
- });
176
- // Adjunct tables in their pre-0.13 shape: FK columns point at
177
- // `pages(id)` — the exact declarations that
178
- // `scripts/migrate-to-0.10.mjs` and the runtime lazy migrations of
179
- // that era produced.
180
- await db.schema.createTable('page_errors', (t) => {
181
- t.increments('id');
182
- t.integer('pageId').notNullable().unsigned().references('pages.id');
183
- t.string('phase').notNullable();
184
- t.text('message').notNullable();
185
- t.integer('createdAt').notNullable();
186
- t.index('pageId');
187
- });
188
- await db.schema.createTable('page_tags', (t) => {
189
- t.increments('id');
190
- t.integer('pageId')
191
- .notNullable()
192
- .unsigned()
193
- .references('pages.id')
194
- .onDelete('CASCADE');
195
- t.string('provider').notNullable();
196
- t.string('category');
197
- t.string('externalId');
198
- t.string('version');
199
- t.integer('confidence');
200
- t.json('categories');
201
- t.json('sources');
202
- t.index('pageId');
203
- t.index('provider');
204
- t.index('externalId');
205
- });
206
- await db.raw('CREATE INDEX page_tags_provider_extId ON page_tags(provider, externalId)');
207
- await db.raw('CREATE INDEX page_tags_provider_pageId ON page_tags(provider, pageId)');
208
- await db.schema.createTable('page_jsonld', (t) => {
209
- t.increments('id');
210
- t.integer('pageId')
211
- .notNullable()
212
- .unsigned()
213
- .references('pages.id')
214
- .onDelete('CASCADE');
215
- t.string('kind').notNullable();
216
- t.string('type');
217
- t.text('raw').notNullable();
218
- t.json('parsed');
219
- t.text('parseError');
220
- t.index('pageId');
221
- t.index('type');
222
- });
223
- await db.raw('CREATE INDEX page_jsonld_type_pageId ON page_jsonld(type, pageId)');
224
- await db.raw(`
225
- CREATE TABLE analysis_text_refs (
226
- id integer primary key,
227
- text text not null,
228
- sha256 text not null,
229
- unique(sha256, text)
230
- )
231
- `);
232
- await db.raw(`
233
- CREATE TABLE analysis_violations (
234
- id integer primary key,
235
- page_id integer not null references pages(id),
236
- validator text not null,
237
- severity text not null,
238
- rule text not null,
239
- message_text_id integer not null references analysis_text_refs(id),
240
- code_text_id integer references analysis_text_refs(id),
241
- page_url_sort_key text not null,
242
- message_sort_key text not null,
243
- code_sort_key text not null
244
- )
245
- `);
246
- await db.raw('CREATE INDEX av_url_order ON analysis_violations(page_url_sort_key, id)');
247
- await db.raw('CREATE INDEX av_filter_url ON analysis_violations(validator, severity, rule, page_url_sort_key, id)');
248
- await db.raw('CREATE INDEX av_validator_url ON analysis_violations(validator, page_url_sort_key, id)');
249
- await db.raw('CREATE INDEX av_severity_url ON analysis_violations(severity, page_url_sort_key, id)');
250
- await db.raw('CREATE INDEX av_rule_url ON analysis_violations(rule, page_url_sort_key, id)');
251
- await db.raw('CREATE INDEX av_message_order ON analysis_violations(message_sort_key, id)');
252
- await db.raw('CREATE INDEX av_code_order ON analysis_violations(code_sort_key, id)');
253
- await db.raw('CREATE INDEX av_page ON analysis_violations(page_id, id)');
254
- await db.raw(`
255
- CREATE TABLE page_html_blobs (
256
- hash BLOB PRIMARY KEY,
257
- body BLOB NOT NULL,
258
- codec TEXT NOT NULL CHECK(codec IN ('zstd', 'none')),
259
- size_raw INTEGER NOT NULL,
260
- size_stored INTEGER NOT NULL
261
- ) WITHOUT ROWID
262
- `);
263
- await db.raw(`
264
- CREATE TABLE page_html_ref (
265
- page_id INTEGER PRIMARY KEY REFERENCES pages(id) ON DELETE CASCADE,
266
- hash BLOB NOT NULL REFERENCES page_html_blobs(hash)
267
- ) WITHOUT ROWID
268
- `);
269
- await db.raw('CREATE INDEX idx_page_html_ref_hash ON page_html_ref(hash)');
270
- }
@@ -1,31 +0,0 @@
1
- import type { Knex } from 'knex';
2
- /**
3
- * Attaches a source archive's `db.sqlite` file to the destination
4
- * connection under the {@link TRANSFER_SOURCE_ALIAS} schema alias, so a
5
- * transfer can read the source and write the destination in the same SQL
6
- * statement (`INSERT INTO main.content_items SELECT ... FROM xfer_src.content_items`).
7
- *
8
- * `ATTACH DATABASE` must run OUTSIDE any transaction — SQLite rejects it
9
- * with "cannot ATTACH database within transaction" otherwise — so this is
10
- * always called before `knex.transaction(...)` opens, never inside it. The
11
- * returned function detaches and must be called after the transaction
12
- * commits or rolls back, in a `finally`.
13
- * @param knex - Knex query builder connected to the destination archive DB
14
- * (the connection whose schema this attaches to — not a transaction).
15
- * @param sourceDbPath - Absolute path to the source's `db.sqlite` file
16
- * (typically `path.join(accessor.tmpDir, Archive.SQLITE_DB_FILE_NAME)`).
17
- * @returns An async function that detaches the source. Idempotent-safe to
18
- * call even if the attach itself failed partway (best-effort).
19
- * @throws {Error} If `ATTACH DATABASE` fails (e.g. the path does not exist,
20
- * or a transaction is already open on this connection).
21
- * @example
22
- * ```ts
23
- * const detach = await attachSourceDatabase(knex, sourceDbPath);
24
- * try {
25
- * await knex.transaction(async (trx) => { ... trx.raw('SELECT * FROM xfer_src.content_items') ... });
26
- * } finally {
27
- * await detach();
28
- * }
29
- * ```
30
- */
31
- export declare function attachSourceDatabase(knex: Knex, sourceDbPath: string): Promise<() => Promise<void>>;
@@ -1,40 +0,0 @@
1
- import { TRANSFER_SOURCE_ALIAS } from './transfer-source-alias.js';
2
- /**
3
- * Attaches a source archive's `db.sqlite` file to the destination
4
- * connection under the {@link TRANSFER_SOURCE_ALIAS} schema alias, so a
5
- * transfer can read the source and write the destination in the same SQL
6
- * statement (`INSERT INTO main.content_items SELECT ... FROM xfer_src.content_items`).
7
- *
8
- * `ATTACH DATABASE` must run OUTSIDE any transaction — SQLite rejects it
9
- * with "cannot ATTACH database within transaction" otherwise — so this is
10
- * always called before `knex.transaction(...)` opens, never inside it. The
11
- * returned function detaches and must be called after the transaction
12
- * commits or rolls back, in a `finally`.
13
- * @param knex - Knex query builder connected to the destination archive DB
14
- * (the connection whose schema this attaches to — not a transaction).
15
- * @param sourceDbPath - Absolute path to the source's `db.sqlite` file
16
- * (typically `path.join(accessor.tmpDir, Archive.SQLITE_DB_FILE_NAME)`).
17
- * @returns An async function that detaches the source. Idempotent-safe to
18
- * call even if the attach itself failed partway (best-effort).
19
- * @throws {Error} If `ATTACH DATABASE` fails (e.g. the path does not exist,
20
- * or a transaction is already open on this connection).
21
- * @example
22
- * ```ts
23
- * const detach = await attachSourceDatabase(knex, sourceDbPath);
24
- * try {
25
- * await knex.transaction(async (trx) => { ... trx.raw('SELECT * FROM xfer_src.content_items') ... });
26
- * } finally {
27
- * await detach();
28
- * }
29
- * ```
30
- */
31
- export async function attachSourceDatabase(knex, sourceDbPath) {
32
- await knex.raw('ATTACH DATABASE ? AS ' + TRANSFER_SOURCE_ALIAS, [sourceDbPath]);
33
- const attached = await knex.raw('PRAGMA database_list');
34
- if (!attached.some((row) => row.name === TRANSFER_SOURCE_ALIAS)) {
35
- throw new Error(`Failed to attach source database at ${sourceDbPath} — PRAGMA database_list does not list "${TRANSFER_SOURCE_ALIAS}" after ATTACH.`);
36
- }
37
- return async () => {
38
- await knex.raw('DETACH DATABASE ' + TRANSFER_SOURCE_ALIAS).catch(() => { });
39
- };
40
- }
@@ -1,30 +0,0 @@
1
- import type { Config } from '../types.js';
2
- /**
3
- * Derives the output {@link Config} for a `split`, from the source's own
4
- * config plus the scope URLs the operator gave on the command line.
5
- *
6
- * `roots` becomes exactly the given URLs (their `withoutHash` form,
7
- * matching how `crawl`'s own roots are recorded); `baseUrl` is the first
8
- * one. Every other scalar field is carried over verbatim from the
9
- * source — a split narrows WHICH pages are kept, it does not change HOW
10
- * they were crawled (`recursive`/`interval`/`userAgent`/etc. all still
11
- * describe the original session honestly). `excludes`/`excludeKeywords`/
12
- * `excludeUrls` are likewise carried over unchanged (they described the
13
- * source's own crawl-time exclusions, still true of the subset that
14
- * survives). `version` is pinned to {@link REQUIRED_FORMAT_VERSION} and
15
- * `createdCwd` is always `null`, matching `mergeArchiveConfigs`'s same
16
- * two fields for the same reasons.
17
- *
18
- * Callers must reject a `fromList` source BEFORE calling this — `roots`
19
- * for such an archive is a URL LIST, not a scope, so "roots = the given
20
- * scope URLs" has no coherent meaning for it (see `docs/split.md`).
21
- * @param source - The source archive's `getConfig()` result.
22
- * @param scopeUrls - The scope URLs the operator gave (`withoutHash` form).
23
- * @param name - The output archive's `name` (typically its basename).
24
- * @returns The derived {@link Config} to write via `Archive#setConfig`.
25
- * @example
26
- * ```ts
27
- * const config = buildSplitConfig(await source.getConfig(), ['https://example.com/blog/'], 'blog');
28
- * ```
29
- */
30
- export declare function buildSplitConfig(source: Config, scopeUrls: readonly string[], name: string): Config;
@@ -1,42 +0,0 @@
1
- import { REQUIRED_FORMAT_VERSION } from '../meta/assert-compatible-version.js';
2
- /**
3
- * Derives the output {@link Config} for a `split`, from the source's own
4
- * config plus the scope URLs the operator gave on the command line.
5
- *
6
- * `roots` becomes exactly the given URLs (their `withoutHash` form,
7
- * matching how `crawl`'s own roots are recorded); `baseUrl` is the first
8
- * one. Every other scalar field is carried over verbatim from the
9
- * source — a split narrows WHICH pages are kept, it does not change HOW
10
- * they were crawled (`recursive`/`interval`/`userAgent`/etc. all still
11
- * describe the original session honestly). `excludes`/`excludeKeywords`/
12
- * `excludeUrls` are likewise carried over unchanged (they described the
13
- * source's own crawl-time exclusions, still true of the subset that
14
- * survives). `version` is pinned to {@link REQUIRED_FORMAT_VERSION} and
15
- * `createdCwd` is always `null`, matching `mergeArchiveConfigs`'s same
16
- * two fields for the same reasons.
17
- *
18
- * Callers must reject a `fromList` source BEFORE calling this — `roots`
19
- * for such an archive is a URL LIST, not a scope, so "roots = the given
20
- * scope URLs" has no coherent meaning for it (see `docs/split.md`).
21
- * @param source - The source archive's `getConfig()` result.
22
- * @param scopeUrls - The scope URLs the operator gave (`withoutHash` form).
23
- * @param name - The output archive's `name` (typically its basename).
24
- * @returns The derived {@link Config} to write via `Archive#setConfig`.
25
- * @example
26
- * ```ts
27
- * const config = buildSplitConfig(await source.getConfig(), ['https://example.com/blog/'], 'blog');
28
- * ```
29
- */
30
- export function buildSplitConfig(source, scopeUrls, name) {
31
- if (scopeUrls.length === 0) {
32
- throw new Error('buildSplitConfig: at least one scope URL is required');
33
- }
34
- return {
35
- ...source,
36
- version: REQUIRED_FORMAT_VERSION,
37
- name,
38
- roots: [...scopeUrls],
39
- baseUrl: scopeUrls[0],
40
- createdCwd: null,
41
- };
42
- }
@@ -1,20 +0,0 @@
1
- import type { Knex } from 'knex';
2
- /**
3
- * Deletes every page-scoped derived row for a concat source's `replace`-
4
- * action destination ids (`temp.xfer_ci_plan.dest_id`), across all 21
5
- * tables in {@link REMAPPED_PAGE_ROW_TABLES} + {@link SIMPLE_PAGE_SCOPED_TABLES}
6
- * combined — set-based (`WHERE ... IN (subquery)`), so there is no
7
- * `SQLITE_LIMIT_VARIABLE_NUMBER` bind-count concern regardless of how many
8
- * rows are being replaced.
9
- *
10
- * Must run BEFORE the page-scoped table copies
11
- * (`copy-page-meta.ts` et al.) so their `INSERT`s never collide with
12
- * stale rows left over from the losing destination row's own prior data.
13
- * @param trx - Transaction with the source ATTACHed.
14
- * @example
15
- * ```ts
16
- * await clearReplacedPageRows(trx);
17
- * await replaceContentItems(trx, { crawlOrderOffset: 0 });
18
- * ```
19
- */
20
- export declare function clearReplacedPageRows(trx: Knex): Promise<void>;
@@ -1,57 +0,0 @@
1
- import { SIMPLE_PAGE_SCOPED_TABLES } from './simple-page-scoped-tables.js';
2
- import { TRANSFER_ACTION } from './transfer-action.js';
3
- /**
4
- * The page-scoped tables NOT covered by {@link SIMPLE_PAGE_SCOPED_TABLES}
5
- * (which this file also clears — see below) — each of these has its own
6
- * dedicated FK-remapping copy function (`copy-page-meta.ts`,
7
- * `copy-anchor-edges.ts`, `copy-image-items.ts`,
8
- * `copy-resource-ref-edges.ts`, `copy-page-console-logs.ts`,
9
- * `copy-analysis-violations.ts`), so they are listed explicitly rather
10
- * than folded into the shared "plain passthrough" table. Together the two
11
- * lists are a superset of `clearPageDerivedRows`' 17 tables (reused by
12
- * `resetFailedPages`/`repromoteExternalPages` for the same
13
- * un-scrape-then-re-insert shape) — this combined 21 additionally covers
14
- * `page_console_logs`/`page_templates`/`analysis_violations`/`page_errors`,
15
- * which that shared helper deliberately omits (see its own JSDoc for why:
16
- * `repromoteExternalPages` never needed them cleared, and folding them in
17
- * would have silently changed its existing behaviour). Concat's replace
18
- * path needs all 21 — a `replace` is a full Scoped-Replace of every
19
- * page-scoped table, not a partial one.
20
- */
21
- const REMAPPED_PAGE_ROW_TABLES = [
22
- { table: 'page_meta', pageColumn: 'page_id' },
23
- { table: 'anchor_edges', pageColumn: 'page_id' },
24
- { table: 'image_items', pageColumn: 'page_id' },
25
- { table: 'resource_ref_edges', pageColumn: 'page_id' },
26
- { table: 'page_console_logs', pageColumn: 'pageId' },
27
- { table: 'analysis_violations', pageColumn: 'page_id' },
28
- ];
29
- /**
30
- * Deletes every page-scoped derived row for a concat source's `replace`-
31
- * action destination ids (`temp.xfer_ci_plan.dest_id`), across all 21
32
- * tables in {@link REMAPPED_PAGE_ROW_TABLES} + {@link SIMPLE_PAGE_SCOPED_TABLES}
33
- * combined — set-based (`WHERE ... IN (subquery)`), so there is no
34
- * `SQLITE_LIMIT_VARIABLE_NUMBER` bind-count concern regardless of how many
35
- * rows are being replaced.
36
- *
37
- * Must run BEFORE the page-scoped table copies
38
- * (`copy-page-meta.ts` et al.) so their `INSERT`s never collide with
39
- * stale rows left over from the losing destination row's own prior data.
40
- * @param trx - Transaction with the source ATTACHed.
41
- * @example
42
- * ```ts
43
- * await clearReplacedPageRows(trx);
44
- * await replaceContentItems(trx, { crawlOrderOffset: 0 });
45
- * ```
46
- */
47
- export async function clearReplacedPageRows(trx) {
48
- const tables = [...REMAPPED_PAGE_ROW_TABLES, ...SIMPLE_PAGE_SCOPED_TABLES];
49
- for (const { table, pageColumn } of tables) {
50
- await trx.raw(`
51
- DELETE FROM main.${table}
52
- WHERE ${pageColumn} IN (
53
- SELECT dest_id FROM xfer_ci_plan WHERE action = ${TRANSFER_ACTION.replace}
54
- )
55
- `);
56
- }
57
- }
@@ -1,55 +0,0 @@
1
- import type { ArchiveAccessor } from '../archive-accessor.js';
2
- import type Archive from '../archive.js';
3
- import type { ConcatArchivesResult, TransferCallbacks } from './types.js';
4
- /**
5
- * Merges two or more read-only-opened source archives into an already
6
- * `Archive.create`d, empty destination — the crawler-side half of the
7
- * `concat` CLI command. Does not open/close/write anything itself: the
8
- * caller owns every accessor's and the destination's lifecycle (see
9
- * `docs/concat.md` and the CLI's `commands/concat.ts`, which owns the
10
- * full open → transfer → rebuild-read-model → write sequence this is one
11
- * step of).
12
- *
13
- * Sources are transferred ONE AT A TIME, in argument order, each one's
14
- * `crawlOrderOffset` set to the destination's current
15
- * `MAX(content_items.crawl_order)` so a later source's pages always sort
16
- * after an earlier one's — this is what makes "ties go to the later
17
- * argument" (see `plan-content-items-for-concat.ts`) match the pages'
18
- * OWN display order too, not just their win/lose outcome.
19
- *
20
- * After every source is transferred: `flattenRedirectChains` (a merge can
21
- * reintroduce a two-hop redirect chain no single source ever has),
22
- * `reclassifyResourceExternality` against the MERGED scope, and
23
- * `countExternalPagesInScope` for the CLI's `--append` hint (concat never
24
- * promotes such pages itself — see `types.ts`'s
25
- * `ConcatArchivesResult.externalInScopeCount` docs).
26
- * @param options - See individual properties.
27
- * @param options.sources - Every source, read-only opened
28
- * (`Archive.openCached`), in argument order.
29
- * @param options.destination - The empty destination, already
30
- * `Archive.create`d by the caller.
31
- * @param options.name - The output archive's `name` config field
32
- * (typically its basename without extension).
33
- * @param options.callbacks - Progress callbacks; see `types.ts`.
34
- * @returns The merged config, each source's transfer outcome, and the
35
- * two summary counts.
36
- * @throws {import('./types.js').ArchiveConfigConflictError} If sources
37
- * disagree on `disableQueries`/`fromList` — see `mergeArchiveConfigs`.
38
- * @example
39
- * ```ts
40
- * const destination = await Archive.create({ filePath: outputPath, cwd });
41
- * const sources = await Promise.all(
42
- * inputPaths.map(async (p) => ({ path: p, accessor: await Archive.openCached(p) })),
43
- * );
44
- * const result = await concatArchives({ sources, destination, name: 'merged' });
45
- * ```
46
- */
47
- export declare function concatArchives(options: {
48
- readonly sources: readonly {
49
- readonly accessor: ArchiveAccessor;
50
- readonly path: string;
51
- }[];
52
- readonly destination: Archive;
53
- readonly name: string;
54
- readonly callbacks?: TransferCallbacks;
55
- }): Promise<ConcatArchivesResult>;
@@ -1,95 +0,0 @@
1
- import path from 'node:path';
2
- import { buildScopeMap } from '../../crawler/build-scope-map.js';
3
- import ArchiveDefault from '../archive.js';
4
- import { copyInventorySourceLists } from './copy-inventory-source-lists.js';
5
- import { countExternalPagesInScope } from './count-external-pages-in-scope.js';
6
- import { flattenRedirectChains } from './flatten-redirect-chains.js';
7
- import { mergeArchiveConfigs } from './merge-archive-configs.js';
8
- import { reclassifyResourceExternality } from './reclassify-resource-externality.js';
9
- import { transferArchiveRows } from './transfer-archive-rows.js';
10
- /**
11
- * Merges two or more read-only-opened source archives into an already
12
- * `Archive.create`d, empty destination — the crawler-side half of the
13
- * `concat` CLI command. Does not open/close/write anything itself: the
14
- * caller owns every accessor's and the destination's lifecycle (see
15
- * `docs/concat.md` and the CLI's `commands/concat.ts`, which owns the
16
- * full open → transfer → rebuild-read-model → write sequence this is one
17
- * step of).
18
- *
19
- * Sources are transferred ONE AT A TIME, in argument order, each one's
20
- * `crawlOrderOffset` set to the destination's current
21
- * `MAX(content_items.crawl_order)` so a later source's pages always sort
22
- * after an earlier one's — this is what makes "ties go to the later
23
- * argument" (see `plan-content-items-for-concat.ts`) match the pages'
24
- * OWN display order too, not just their win/lose outcome.
25
- *
26
- * After every source is transferred: `flattenRedirectChains` (a merge can
27
- * reintroduce a two-hop redirect chain no single source ever has),
28
- * `reclassifyResourceExternality` against the MERGED scope, and
29
- * `countExternalPagesInScope` for the CLI's `--append` hint (concat never
30
- * promotes such pages itself — see `types.ts`'s
31
- * `ConcatArchivesResult.externalInScopeCount` docs).
32
- * @param options - See individual properties.
33
- * @param options.sources - Every source, read-only opened
34
- * (`Archive.openCached`), in argument order.
35
- * @param options.destination - The empty destination, already
36
- * `Archive.create`d by the caller.
37
- * @param options.name - The output archive's `name` config field
38
- * (typically its basename without extension).
39
- * @param options.callbacks - Progress callbacks; see `types.ts`.
40
- * @returns The merged config, each source's transfer outcome, and the
41
- * two summary counts.
42
- * @throws {import('./types.js').ArchiveConfigConflictError} If sources
43
- * disagree on `disableQueries`/`fromList` — see `mergeArchiveConfigs`.
44
- * @example
45
- * ```ts
46
- * const destination = await Archive.create({ filePath: outputPath, cwd });
47
- * const sources = await Promise.all(
48
- * inputPaths.map(async (p) => ({ path: p, accessor: await Archive.openCached(p) })),
49
- * );
50
- * const result = await concatArchives({ sources, destination, name: 'merged' });
51
- * ```
52
- */
53
- export async function concatArchives(options) {
54
- const { sources, destination, name, callbacks } = options;
55
- if (sources.length < 2) {
56
- throw new Error('concatArchives: at least two sources are required');
57
- }
58
- const configs = await Promise.all(sources.map((s) => s.accessor.getConfig()));
59
- const merged = mergeArchiveConfigs(configs, name);
60
- await destination.setConfig(merged);
61
- const knex = destination.getKnex();
62
- const scope = buildScopeMap(merged.roots, merged);
63
- const results = [];
64
- for (const [index, source] of sources.entries()) {
65
- callbacks?.onSourceStart?.(index, source.path);
66
- const sourceDbPath = path.join(source.accessor.tmpDir, ArchiveDefault.SQLITE_DB_FILE_NAME);
67
- const maxRows = await knex('content_items').max({
68
- max: 'crawl_order',
69
- });
70
- const crawlOrderOffset = maxRows[0]?.max ?? 0;
71
- const result = await transferArchiveRows({
72
- knex,
73
- sourceDbPath,
74
- mode: { kind: 'concat' },
75
- crawlOrderOffset,
76
- sourceIndex: index,
77
- callbacks,
78
- });
79
- results.push(result);
80
- }
81
- const postIndex = sources.length;
82
- callbacks?.onPhase?.(postIndex, 'flatteningRedirects');
83
- await flattenRedirectChains(knex);
84
- callbacks?.onPhase?.(postIndex, 'reclassifyingResources');
85
- await reclassifyResourceExternality(knex, scope, merged);
86
- callbacks?.onPhase?.(postIndex, 'countingExternalInScope');
87
- const externalInScopeCount = await countExternalPagesInScope(knex, scope, merged);
88
- const inventoryListsCopied = await copyInventorySourceLists(destination, sources.map((s) => s.accessor.tmpDir));
89
- return {
90
- config: merged,
91
- sources: results,
92
- externalInScopeCount,
93
- inventoryListsCopied,
94
- };
95
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * SQL fragment computing a `content_items` row's "richness" rank for
3
- * concat's same-URL conflict resolution: `2` (scraped internal page) beats
4
- * `1` (scraped external HEAD-only observation) beats `0` (never scraped).
5
- * Concat keeps whichever source's row ranks highest for a given URL; a tie
6
- * is resolved by processing sources in argument order and overwriting on
7
- * `>=` (see {@link import('./plan-content-items-for-concat.js').planContentItemsForConcat}),
8
- * so the LAST source with an equal-or-better rank wins.
9
- *
10
- * This is the single definition of the ranking lattice — every other
11
- * ranking (or a change to it) must go through this function so concat's
12
- * conflict resolution cannot silently drift from what this doc describes.
13
- * @param alias - The table alias (or bare table name) the fragment reads
14
- * `scraped`/`is_external` from, e.g. `'s'` for `xfer_src.content_items s`.
15
- * @returns A SQL expression (no trailing semicolon) evaluating to `0`, `1`, or `2`.
16
- * @example
17
- * ```ts
18
- * trx.raw(`SELECT ${contentItemRankSql('s')} as rank FROM xfer_src.content_items s`);
19
- * ```
20
- */
21
- export declare function contentItemRankSql(alias: string): string;