@nitpicker/archive 0.0.0-stage → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (737) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +105 -2
  3. package/lib/apply-connection-pragmas.d.ts +18 -0
  4. package/lib/apply-connection-pragmas.js +40 -0
  5. package/lib/archive-accessor.d.ts +265 -0
  6. package/lib/archive-accessor.js +477 -0
  7. package/lib/archive-lock.d.ts +45 -0
  8. package/lib/archive-lock.js +154 -0
  9. package/lib/archive.d.ts +736 -0
  10. package/lib/archive.js +1056 -0
  11. package/lib/body-hash/compute-body-hash.d.ts +32 -0
  12. package/lib/body-hash/compute-body-hash.js +35 -0
  13. package/lib/cache/clear-archive-cache-entry.d.ts +18 -0
  14. package/lib/cache/clear-archive-cache-entry.js +24 -0
  15. package/lib/cache/clear-archive-cache-root.d.ts +26 -0
  16. package/lib/cache/clear-archive-cache-root.js +32 -0
  17. package/lib/cache/compute-archive-cache-key.d.ts +39 -0
  18. package/lib/cache/compute-archive-cache-key.js +95 -0
  19. package/lib/cache/extract-archive-to-cache.d.ts +57 -0
  20. package/lib/cache/extract-archive-to-cache.js +326 -0
  21. package/lib/cache/get-archive-cache-root.d.ts +20 -0
  22. package/lib/cache/get-archive-cache-root.js +53 -0
  23. package/lib/cache/is-archive-cache-disabled.d.ts +24 -0
  24. package/lib/cache/is-archive-cache-disabled.js +34 -0
  25. package/lib/cache/list-archive-cache-entries.d.ts +23 -0
  26. package/lib/cache/list-archive-cache-entries.js +130 -0
  27. package/lib/cache/path-exists.d.ts +9 -0
  28. package/lib/cache/path-exists.js +18 -0
  29. package/lib/cache/resolve-archive-cache-dir.d.ts +26 -0
  30. package/lib/cache/resolve-archive-cache-dir.js +32 -0
  31. package/lib/cache/types.d.ts +33 -0
  32. package/lib/cache/types.js +1 -0
  33. package/lib/content-type/is-html-content-type.d.ts +17 -0
  34. package/lib/content-type/is-html-content-type.js +19 -0
  35. package/lib/content-type/normalize-content-type.d.ts +14 -0
  36. package/lib/content-type/normalize-content-type.js +20 -0
  37. package/lib/create-adjunct-tables.d.ts +66 -0
  38. package/lib/create-adjunct-tables.js +510 -0
  39. package/lib/create-entity-tables.d.ts +191 -0
  40. package/lib/create-entity-tables.js +387 -0
  41. package/lib/create-progress-reporter.d.ts +30 -0
  42. package/lib/create-progress-reporter.js +38 -0
  43. package/lib/create-ref-tables.d.ts +35 -0
  44. package/lib/create-ref-tables.js +185 -0
  45. package/lib/create-template-tables.d.ts +28 -0
  46. package/lib/create-template-tables.js +92 -0
  47. package/lib/database.d.ts +549 -0
  48. package/lib/database.js +804 -0
  49. package/lib/db-ops/_shared/clear-write-ref-caches.d.ts +27 -0
  50. package/lib/db-ops/_shared/clear-write-ref-caches.js +35 -0
  51. package/lib/db-ops/_shared/compress-payload.d.ts +26 -0
  52. package/lib/db-ops/_shared/compress-payload.js +30 -0
  53. package/lib/db-ops/_shared/create-write-ref-caches.d.ts +17 -0
  54. package/lib/db-ops/_shared/create-write-ref-caches.js +27 -0
  55. package/lib/db-ops/_shared/decode-json-ref.d.ts +17 -0
  56. package/lib/db-ops/_shared/decode-json-ref.js +31 -0
  57. package/lib/db-ops/_shared/keyset-paginate-by-id.d.ts +49 -0
  58. package/lib/db-ops/_shared/keyset-paginate-by-id.js +69 -0
  59. package/lib/db-ops/_shared/load-response-headers-by-set-ids.d.ts +20 -0
  60. package/lib/db-ops/_shared/load-response-headers-by-set-ids.js +53 -0
  61. package/lib/db-ops/_shared/resolve-content-item-id.d.ts +62 -0
  62. package/lib/db-ops/_shared/resolve-content-item-id.js +143 -0
  63. package/lib/db-ops/_shared/resolve-url-or-blob.d.ts +23 -0
  64. package/lib/db-ops/_shared/resolve-url-or-blob.js +29 -0
  65. package/lib/db-ops/_shared/retry-setting.d.ts +16 -0
  66. package/lib/db-ops/_shared/retry-setting.js +18 -0
  67. package/lib/db-ops/_shared/safe-parse-json.d.ts +11 -0
  68. package/lib/db-ops/_shared/safe-parse-json.js +18 -0
  69. package/lib/db-ops/_shared/types.d.ts +94 -0
  70. package/lib/db-ops/_shared/types.js +1 -0
  71. package/lib/db-ops/_shared/upsert-blob-ref.d.ts +25 -0
  72. package/lib/db-ops/_shared/upsert-blob-ref.js +48 -0
  73. package/lib/db-ops/_shared/upsert-content-type-ref.d.ts +30 -0
  74. package/lib/db-ops/_shared/upsert-content-type-ref.js +45 -0
  75. package/lib/db-ops/_shared/upsert-json-ref.d.ts +22 -0
  76. package/lib/db-ops/_shared/upsert-json-ref.js +41 -0
  77. package/lib/db-ops/_shared/upsert-response-headers.d.ts +35 -0
  78. package/lib/db-ops/_shared/upsert-response-headers.js +49 -0
  79. package/lib/db-ops/_shared/upsert-url-ref.d.ts +39 -0
  80. package/lib/db-ops/_shared/upsert-url-ref.js +62 -0
  81. package/lib/db-ops/anchors/get-anchors-on-page.d.ts +10 -0
  82. package/lib/db-ops/anchors/get-anchors-on-page.js +21 -0
  83. package/lib/db-ops/config/get-base-url.d.ts +8 -0
  84. package/lib/db-ops/config/get-base-url.js +14 -0
  85. package/lib/db-ops/config/get-config.d.ts +10 -0
  86. package/lib/db-ops/config/get-config.js +29 -0
  87. package/lib/db-ops/config/get-created-cwd.d.ts +11 -0
  88. package/lib/db-ops/config/get-created-cwd.js +13 -0
  89. package/lib/db-ops/config/get-name.d.ts +8 -0
  90. package/lib/db-ops/config/get-name.js +14 -0
  91. package/lib/db-ops/config/info-column-allowlist.d.ts +7 -0
  92. package/lib/db-ops/config/info-column-allowlist.js +29 -0
  93. package/lib/db-ops/config/info-json-columns.d.ts +5 -0
  94. package/lib/db-ops/config/info-json-columns.js +11 -0
  95. package/lib/db-ops/config/set-config.d.ts +12 -0
  96. package/lib/db-ops/config/set-config.js +21 -0
  97. package/lib/db-ops/config/update-config.d.ts +17 -0
  98. package/lib/db-ops/config/update-config.js +36 -0
  99. package/lib/db-ops/console-logs/compute-console-log-hash.d.ts +19 -0
  100. package/lib/db-ops/console-logs/compute-console-log-hash.js +30 -0
  101. package/lib/db-ops/console-logs/replace-console-logs.d.ts +34 -0
  102. package/lib/db-ops/console-logs/replace-console-logs.js +123 -0
  103. package/lib/db-ops/console-logs/stringify-console-log-args.d.ts +16 -0
  104. package/lib/db-ops/console-logs/stringify-console-log-args.js +26 -0
  105. package/lib/db-ops/console-logs/types.d.ts +38 -0
  106. package/lib/db-ops/console-logs/types.js +1 -0
  107. package/lib/db-ops/console-logs/upsert-console-log-item.d.ts +29 -0
  108. package/lib/db-ops/console-logs/upsert-console-log-item.js +52 -0
  109. package/lib/db-ops/dedupe-cap/accumulate-dedupe-cap-rejected-count.d.ts +18 -0
  110. package/lib/db-ops/dedupe-cap/accumulate-dedupe-cap-rejected-count.js +23 -0
  111. package/lib/db-ops/dedupe-cap/finalize-dedupe-cap-event.d.ts +12 -0
  112. package/lib/db-ops/dedupe-cap/finalize-dedupe-cap-event.js +15 -0
  113. package/lib/db-ops/dedupe-cap/insert-dedupe-cap-event.d.ts +14 -0
  114. package/lib/db-ops/dedupe-cap/insert-dedupe-cap-event.js +30 -0
  115. package/lib/db-ops/dedupe-cap/list-dedupe-cap-observations.d.ts +57 -0
  116. package/lib/db-ops/dedupe-cap/list-dedupe-cap-observations.js +87 -0
  117. package/lib/db-ops/dedupe-cap/list-dedupe-cap-shape-keys.d.ts +21 -0
  118. package/lib/db-ops/dedupe-cap/list-dedupe-cap-shape-keys.js +27 -0
  119. package/lib/db-ops/errors/insert-crawl-error.d.ts +15 -0
  120. package/lib/db-ops/errors/insert-crawl-error.js +21 -0
  121. package/lib/db-ops/errors/insert-page-error.d.ts +21 -0
  122. package/lib/db-ops/errors/insert-page-error.js +30 -0
  123. package/lib/db-ops/errors/list-dns-burned-host-candidates.d.ts +33 -0
  124. package/lib/db-ops/errors/list-dns-burned-host-candidates.js +158 -0
  125. package/lib/db-ops/html/read-page-html-blob.d.ts +17 -0
  126. package/lib/db-ops/html/read-page-html-blob.js +20 -0
  127. package/lib/db-ops/lifecycle/checkpoint.d.ts +8 -0
  128. package/lib/db-ops/lifecycle/checkpoint.js +9 -0
  129. package/lib/db-ops/lifecycle/destroy.d.ts +6 -0
  130. package/lib/db-ops/lifecycle/destroy.js +7 -0
  131. package/lib/db-ops/lifecycle/init.d.ts +58 -0
  132. package/lib/db-ops/lifecycle/init.js +122 -0
  133. package/lib/db-ops/list-reconcile/record-list-reconcile-run.d.ts +22 -0
  134. package/lib/db-ops/list-reconcile/record-list-reconcile-run.js +41 -0
  135. package/lib/db-ops/meta/get-audios-of-page.d.ts +11 -0
  136. package/lib/db-ops/meta/get-audios-of-page.js +15 -0
  137. package/lib/db-ops/meta/get-buttons-of-page.d.ts +11 -0
  138. package/lib/db-ops/meta/get-buttons-of-page.js +15 -0
  139. package/lib/db-ops/meta/get-canvases-of-page.d.ts +11 -0
  140. package/lib/db-ops/meta/get-canvases-of-page.js +15 -0
  141. package/lib/db-ops/meta/get-custom-elements-of-page.d.ts +11 -0
  142. package/lib/db-ops/meta/get-custom-elements-of-page.js +15 -0
  143. package/lib/db-ops/meta/get-headings-of-page.d.ts +11 -0
  144. package/lib/db-ops/meta/get-headings-of-page.js +15 -0
  145. package/lib/db-ops/meta/get-iframes-of-page.d.ts +11 -0
  146. package/lib/db-ops/meta/get-iframes-of-page.js +15 -0
  147. package/lib/db-ops/meta/get-jsonld-of-page.d.ts +13 -0
  148. package/lib/db-ops/meta/get-jsonld-of-page.js +27 -0
  149. package/lib/db-ops/meta/get-main-content-images-of-page.d.ts +11 -0
  150. package/lib/db-ops/meta/get-main-content-images-of-page.js +15 -0
  151. package/lib/db-ops/meta/get-main-content-tables-of-page.d.ts +11 -0
  152. package/lib/db-ops/meta/get-main-content-tables-of-page.js +15 -0
  153. package/lib/db-ops/meta/get-page-technologies-of-page.d.ts +11 -0
  154. package/lib/db-ops/meta/get-page-technologies-of-page.js +15 -0
  155. package/lib/db-ops/meta/get-technology-signals-of-page.d.ts +11 -0
  156. package/lib/db-ops/meta/get-technology-signals-of-page.js +15 -0
  157. package/lib/db-ops/meta/get-videos-of-page.d.ts +11 -0
  158. package/lib/db-ops/meta/get-videos-of-page.js +15 -0
  159. package/lib/db-ops/outages/close-network-outage.d.ts +12 -0
  160. package/lib/db-ops/outages/close-network-outage.js +15 -0
  161. package/lib/db-ops/outages/close-stale-open-network-outages.d.ts +26 -0
  162. package/lib/db-ops/outages/close-stale-open-network-outages.js +42 -0
  163. package/lib/db-ops/outages/compute-outage-clamp-timestamp.d.ts +26 -0
  164. package/lib/db-ops/outages/compute-outage-clamp-timestamp.js +31 -0
  165. package/lib/db-ops/outages/insert-network-outage.d.ts +14 -0
  166. package/lib/db-ops/outages/insert-network-outage.js +29 -0
  167. package/lib/db-ops/outages/list-network-outages.d.ts +28 -0
  168. package/lib/db-ops/outages/list-network-outages.js +42 -0
  169. package/lib/db-ops/pages/order/set-url-order.d.ts +13 -0
  170. package/lib/db-ops/pages/order/set-url-order.js +38 -0
  171. package/lib/db-ops/pages/read/build-page-query.d.ts +18 -0
  172. package/lib/db-ops/pages/read/build-page-query.js +40 -0
  173. package/lib/db-ops/pages/read/get-crawling-state.d.ts +117 -0
  174. package/lib/db-ops/pages/read/get-crawling-state.js +161 -0
  175. package/lib/db-ops/pages/read/get-existing-page-urls.d.ts +15 -0
  176. package/lib/db-ops/pages/read/get-existing-page-urls.js +30 -0
  177. package/lib/db-ops/pages/read/get-page-count.d.ts +12 -0
  178. package/lib/db-ops/pages/read/get-page-count.js +21 -0
  179. package/lib/db-ops/pages/read/get-page-source-by-url.d.ts +24 -0
  180. package/lib/db-ops/pages/read/get-page-source-by-url.js +28 -0
  181. package/lib/db-ops/pages/read/get-pages-with-rels.d.ts +38 -0
  182. package/lib/db-ops/pages/read/get-pages-with-rels.js +107 -0
  183. package/lib/db-ops/pages/read/get-pages.d.ts +11 -0
  184. package/lib/db-ops/pages/read/get-pages.js +51 -0
  185. package/lib/db-ops/pages/read/get-scraped-html-page-count.d.ts +18 -0
  186. package/lib/db-ops/pages/read/get-scraped-html-page-count.js +25 -0
  187. package/lib/db-ops/pages/read/reconstruct-page-rows.d.ts +31 -0
  188. package/lib/db-ops/pages/read/reconstruct-page-rows.js +32 -0
  189. package/lib/db-ops/pages/reset/clear-page-derived-rows.d.ts +20 -0
  190. package/lib/db-ops/pages/reset/clear-page-derived-rows.js +37 -0
  191. package/lib/db-ops/pages/reset/repromote-external-pages.d.ts +30 -0
  192. package/lib/db-ops/pages/reset/repromote-external-pages.js +91 -0
  193. package/lib/db-ops/pages/reset/reset-failed-pages.d.ts +88 -0
  194. package/lib/db-ops/pages/reset/reset-failed-pages.js +216 -0
  195. package/lib/db-ops/pages/reset/reset-pages-by-urls.d.ts +80 -0
  196. package/lib/db-ops/pages/reset/reset-pages-by-urls.js +151 -0
  197. package/lib/db-ops/pages/reset/retryable-image-scan-codes.d.ts +24 -0
  198. package/lib/db-ops/pages/reset/retryable-image-scan-codes.js +24 -0
  199. package/lib/db-ops/pages/write/insert-audios.d.ts +14 -0
  200. package/lib/db-ops/pages/write/insert-audios.js +25 -0
  201. package/lib/db-ops/pages/write/insert-buttons.d.ts +14 -0
  202. package/lib/db-ops/pages/write/insert-buttons.js +29 -0
  203. package/lib/db-ops/pages/write/insert-canvases.d.ts +14 -0
  204. package/lib/db-ops/pages/write/insert-canvases.js +26 -0
  205. package/lib/db-ops/pages/write/insert-custom-elements.d.ts +27 -0
  206. package/lib/db-ops/pages/write/insert-custom-elements.js +40 -0
  207. package/lib/db-ops/pages/write/insert-headings.d.ts +15 -0
  208. package/lib/db-ops/pages/write/insert-headings.js +27 -0
  209. package/lib/db-ops/pages/write/insert-iframes.d.ts +14 -0
  210. package/lib/db-ops/pages/write/insert-iframes.js +28 -0
  211. package/lib/db-ops/pages/write/insert-inventory-content-items.d.ts +38 -0
  212. package/lib/db-ops/pages/write/insert-inventory-content-items.js +60 -0
  213. package/lib/db-ops/pages/write/insert-inventory-seeds.d.ts +36 -0
  214. package/lib/db-ops/pages/write/insert-inventory-seeds.js +48 -0
  215. package/lib/db-ops/pages/write/insert-inventory-skipped-pages.d.ts +42 -0
  216. package/lib/db-ops/pages/write/insert-inventory-skipped-pages.js +56 -0
  217. package/lib/db-ops/pages/write/insert-jsonld.d.ts +17 -0
  218. package/lib/db-ops/pages/write/insert-jsonld.js +49 -0
  219. package/lib/db-ops/pages/write/insert-main-content-images.d.ts +20 -0
  220. package/lib/db-ops/pages/write/insert-main-content-images.js +32 -0
  221. package/lib/db-ops/pages/write/insert-main-content-tables.d.ts +14 -0
  222. package/lib/db-ops/pages/write/insert-main-content-tables.js +29 -0
  223. package/lib/db-ops/pages/write/insert-page.d.ts +56 -0
  224. package/lib/db-ops/pages/write/insert-page.js +259 -0
  225. package/lib/db-ops/pages/write/insert-technologies.d.ts +25 -0
  226. package/lib/db-ops/pages/write/insert-technologies.js +45 -0
  227. package/lib/db-ops/pages/write/insert-videos.d.ts +14 -0
  228. package/lib/db-ops/pages/write/insert-videos.js +28 -0
  229. package/lib/db-ops/pages/write/link-redirect-sources.d.ts +42 -0
  230. package/lib/db-ops/pages/write/link-redirect-sources.js +101 -0
  231. package/lib/db-ops/pages/write/record-redirect.d.ts +35 -0
  232. package/lib/db-ops/pages/write/record-redirect.js +100 -0
  233. package/lib/db-ops/pages/write/set-skipped-page.d.ts +13 -0
  234. package/lib/db-ops/pages/write/set-skipped-page.js +24 -0
  235. package/lib/db-ops/pages/write/update-page.d.ts +40 -0
  236. package/lib/db-ops/pages/write/update-page.js +419 -0
  237. package/lib/db-ops/pages/write/write-page-html-blob.d.ts +19 -0
  238. package/lib/db-ops/pages/write/write-page-html-blob.js +41 -0
  239. package/lib/db-ops/referrers/get-redirects-for-pages.d.ts +9 -0
  240. package/lib/db-ops/referrers/get-redirects-for-pages.js +15 -0
  241. package/lib/db-ops/referrers/get-referrers-of-page.d.ts +17 -0
  242. package/lib/db-ops/referrers/get-referrers-of-page.js +32 -0
  243. package/lib/db-ops/referrers/get-referrers-of-resource.d.ts +8 -0
  244. package/lib/db-ops/referrers/get-referrers-of-resource.js +15 -0
  245. package/lib/db-ops/resources/build-resource-query.d.ts +25 -0
  246. package/lib/db-ops/resources/build-resource-query.js +29 -0
  247. package/lib/db-ops/resources/get-existing-resource-urls.d.ts +9 -0
  248. package/lib/db-ops/resources/get-existing-resource-urls.js +24 -0
  249. package/lib/db-ops/resources/get-resource-by-url.d.ts +13 -0
  250. package/lib/db-ops/resources/get-resource-by-url.js +22 -0
  251. package/lib/db-ops/resources/get-resource-url-list.d.ts +17 -0
  252. package/lib/db-ops/resources/get-resource-url-list.js +26 -0
  253. package/lib/db-ops/resources/get-resources.d.ts +8 -0
  254. package/lib/db-ops/resources/get-resources.js +11 -0
  255. package/lib/db-ops/resources/insert-inventory-resources.d.ts +24 -0
  256. package/lib/db-ops/resources/insert-inventory-resources.js +64 -0
  257. package/lib/db-ops/resources/insert-resource-referrers.d.ts +15 -0
  258. package/lib/db-ops/resources/insert-resource-referrers.js +54 -0
  259. package/lib/db-ops/resources/insert-resource.d.ts +34 -0
  260. package/lib/db-ops/resources/insert-resource.js +73 -0
  261. package/lib/db-ops/resources/reconstruct-resource-rows.d.ts +26 -0
  262. package/lib/db-ops/resources/reconstruct-resource-rows.js +30 -0
  263. package/lib/db-ops/templates/assign-template-labels.d.ts +60 -0
  264. package/lib/db-ops/templates/assign-template-labels.js +187 -0
  265. package/lib/db-ops/templates/replace-page-templates.d.ts +44 -0
  266. package/lib/db-ops/templates/replace-page-templates.js +174 -0
  267. package/lib/db-ops/templates/serialize-template-cluster-reason.d.ts +16 -0
  268. package/lib/db-ops/templates/serialize-template-cluster-reason.js +17 -0
  269. package/lib/db-ops/templates/types.d.ts +103 -0
  270. package/lib/db-ops/templates/types.js +1 -0
  271. package/lib/debug.d.ts +8 -0
  272. package/lib/debug.js +9 -0
  273. package/lib/decode-html-blob.d.ts +20 -0
  274. package/lib/decode-html-blob.js +23 -0
  275. package/lib/decode-page-html-blob-bytes.d.ts +25 -0
  276. package/lib/decode-page-html-blob-bytes.js +29 -0
  277. package/lib/decode-stored-blob-bytes.d.ts +25 -0
  278. package/lib/decode-stored-blob-bytes.js +47 -0
  279. package/lib/derive-lineage-from-parent.d.ts +37 -0
  280. package/lib/derive-lineage-from-parent.js +42 -0
  281. package/lib/drop-legacy-tables.d.ts +45 -0
  282. package/lib/drop-legacy-tables.js +56 -0
  283. package/lib/error-kind/classify-error-kind.d.ts +20 -0
  284. package/lib/error-kind/classify-error-kind.js +136 -0
  285. package/lib/error-kind/network-related-error-kinds.d.ts +23 -0
  286. package/lib/error-kind/network-related-error-kinds.js +28 -0
  287. package/lib/error-kind/permanent-error-kinds.d.ts +48 -0
  288. package/lib/error-kind/permanent-error-kinds.js +54 -0
  289. package/lib/error-kind/types.d.ts +54 -0
  290. package/lib/error-kind/types.js +1 -0
  291. package/lib/filesystem/append-text.d.ts +9 -0
  292. package/lib/filesystem/append-text.js +14 -0
  293. package/lib/filesystem/copy-dir-sync.d.ts +6 -0
  294. package/lib/filesystem/copy-dir-sync.js +9 -0
  295. package/lib/filesystem/copy-dir.d.ts +7 -0
  296. package/lib/filesystem/copy-dir.js +13 -0
  297. package/lib/filesystem/copy-file-with-progress.d.ts +20 -0
  298. package/lib/filesystem/copy-file-with-progress.js +34 -0
  299. package/lib/filesystem/exists.d.ts +6 -0
  300. package/lib/filesystem/exists.js +9 -0
  301. package/lib/filesystem/get-file-list.d.ts +8 -0
  302. package/lib/filesystem/get-file-list.js +12 -0
  303. package/lib/filesystem/is-dir.d.ts +6 -0
  304. package/lib/filesystem/is-dir.js +10 -0
  305. package/lib/filesystem/mkdir.d.ts +8 -0
  306. package/lib/filesystem/mkdir.js +15 -0
  307. package/lib/filesystem/output-binary.d.ts +12 -0
  308. package/lib/filesystem/output-binary.js +17 -0
  309. package/lib/filesystem/output-json.d.ts +9 -0
  310. package/lib/filesystem/output-json.js +14 -0
  311. package/lib/filesystem/output-text.d.ts +11 -0
  312. package/lib/filesystem/output-text.js +32 -0
  313. package/lib/filesystem/parse-pax-path.d.ts +18 -0
  314. package/lib/filesystem/parse-pax-path.js +47 -0
  315. package/lib/filesystem/parse-tar-size-field.d.ts +13 -0
  316. package/lib/filesystem/parse-tar-size-field.js +40 -0
  317. package/lib/filesystem/peek-tar-top-dir.d.ts +35 -0
  318. package/lib/filesystem/peek-tar-top-dir.js +215 -0
  319. package/lib/filesystem/read-json.d.ts +7 -0
  320. package/lib/filesystem/read-json.js +11 -0
  321. package/lib/filesystem/read-text.d.ts +6 -0
  322. package/lib/filesystem/read-text.js +10 -0
  323. package/lib/filesystem/readline.d.ts +11 -0
  324. package/lib/filesystem/readline.js +26 -0
  325. package/lib/filesystem/remove.d.ts +5 -0
  326. package/lib/filesystem/remove.js +10 -0
  327. package/lib/filesystem/rename.d.ts +16 -0
  328. package/lib/filesystem/rename.js +48 -0
  329. package/lib/filesystem/tar.d.ts +23 -0
  330. package/lib/filesystem/tar.js +78 -0
  331. package/lib/filesystem/untar.d.ts +33 -0
  332. package/lib/filesystem/untar.js +84 -0
  333. package/lib/get-failed-page-messages.d.ts +56 -0
  334. package/lib/get-failed-page-messages.js +146 -0
  335. package/lib/get-json.d.ts +10 -0
  336. package/lib/get-json.js +25 -0
  337. package/lib/html-snapshot/match-selector-html.d.ts +25 -0
  338. package/lib/html-snapshot/match-selector-html.js +28 -0
  339. package/lib/html-snapshot/match-selector-snapshots.d.ts +33 -0
  340. package/lib/html-snapshot/match-selector-snapshots.js +33 -0
  341. package/lib/html-snapshot/search-html-document.d.ts +29 -0
  342. package/lib/html-snapshot/search-html-document.js +27 -0
  343. package/lib/html-snapshot/search-html-snapshots.d.ts +36 -0
  344. package/lib/html-snapshot/search-html-snapshots.js +35 -0
  345. package/lib/html-snapshot/types.d.ts +111 -0
  346. package/lib/html-snapshot/types.js +7 -0
  347. package/lib/html-snapshot/validate-search-pattern.d.ts +15 -0
  348. package/lib/html-snapshot/validate-search-pattern.js +17 -0
  349. package/lib/init-schema.d.ts +48 -0
  350. package/lib/init-schema.js +124 -0
  351. package/lib/is-inventory-source.d.ts +21 -0
  352. package/lib/is-inventory-source.js +22 -0
  353. package/lib/is-within-outage-window.d.ts +49 -0
  354. package/lib/is-within-outage-window.js +33 -0
  355. package/lib/isolated-cluster/create-isolated-cluster-run.d.ts +24 -0
  356. package/lib/isolated-cluster/create-isolated-cluster-run.js +26 -0
  357. package/lib/libsql-dialect.d.ts +115 -0
  358. package/lib/libsql-dialect.js +116 -0
  359. package/lib/limited-page-ids.d.ts +9 -0
  360. package/lib/limited-page-ids.js +18 -0
  361. package/lib/meta/assert-compatible-version.d.ts +60 -0
  362. package/lib/meta/assert-compatible-version.js +93 -0
  363. package/lib/meta/classify-jsonld-type.d.ts +23 -0
  364. package/lib/meta/classify-jsonld-type.js +43 -0
  365. package/lib/meta/compare-semver.d.ts +23 -0
  366. package/lib/meta/compare-semver.js +51 -0
  367. package/lib/meta/compute-main-contents-denormalized.d.ts +41 -0
  368. package/lib/meta/compute-main-contents-denormalized.js +88 -0
  369. package/lib/meta/compute-page-denormalized.d.ts +20 -0
  370. package/lib/meta/compute-page-denormalized.js +35 -0
  371. package/lib/meta/derive-flat-from-meta.d.ts +34 -0
  372. package/lib/meta/derive-flat-from-meta.js +158 -0
  373. package/lib/meta/derive-meta-extras.d.ts +20 -0
  374. package/lib/meta/derive-meta-extras.js +23 -0
  375. package/lib/meta/extract-tags-for-archive.d.ts +17 -0
  376. package/lib/meta/extract-tags-for-archive.js +36 -0
  377. package/lib/meta/parse-main-content-class-list.d.ts +19 -0
  378. package/lib/meta/parse-main-content-class-list.js +34 -0
  379. package/lib/meta/summarize-jsonld.d.ts +17 -0
  380. package/lib/meta/summarize-jsonld.js +29 -0
  381. package/lib/meta/technologies/combine-technology-confidence.d.ts +46 -0
  382. package/lib/meta/technologies/combine-technology-confidence.js +93 -0
  383. package/lib/meta/technologies/convert-legacy-page-tags-to-inserts.d.ts +45 -0
  384. package/lib/meta/technologies/convert-legacy-page-tags-to-inserts.js +53 -0
  385. package/lib/meta/technologies/convert-tag-row-to-wappalyzer-signal.d.ts +33 -0
  386. package/lib/meta/technologies/convert-tag-row-to-wappalyzer-signal.js +46 -0
  387. package/lib/meta/technologies/extract-technologies-for-archive.d.ts +33 -0
  388. package/lib/meta/technologies/extract-technologies-for-archive.js +30 -0
  389. package/lib/meta/technologies/match-js-license-comment-signal.d.ts +21 -0
  390. package/lib/meta/technologies/match-js-license-comment-signal.js +23 -0
  391. package/lib/meta/technologies/match-structural-technology-signals.d.ts +26 -0
  392. package/lib/meta/technologies/match-structural-technology-signals.js +48 -0
  393. package/lib/meta/technologies/normalize-wappalyzer-entries.d.ts +25 -0
  394. package/lib/meta/technologies/normalize-wappalyzer-entries.js +35 -0
  395. package/lib/meta/technologies/technology-signal-definitions.d.ts +44 -0
  396. package/lib/meta/technologies/technology-signal-definitions.js +60 -0
  397. package/lib/meta/technologies/types.d.ts +70 -0
  398. package/lib/meta/technologies/types.js +13 -0
  399. package/lib/meta/types.d.ts +1490 -0
  400. package/lib/meta/types.js +65 -0
  401. package/lib/migrate-content-items-alias-of-id.d.ts +52 -0
  402. package/lib/migrate-content-items-alias-of-id.js +69 -0
  403. package/lib/migrate-content-items-dedupe-cap-event-id.d.ts +46 -0
  404. package/lib/migrate-content-items-dedupe-cap-event-id.js +62 -0
  405. package/lib/migrate-content-items-is-metadata-only.d.ts +44 -0
  406. package/lib/migrate-content-items-is-metadata-only.js +60 -0
  407. package/lib/migrate-entity-tables.d.ts +55 -0
  408. package/lib/migrate-entity-tables.js +66 -0
  409. package/lib/migrate-info-created-cwd.d.ts +17 -0
  410. package/lib/migrate-info-created-cwd.js +36 -0
  411. package/lib/migrate-info-main-content-selector.d.ts +16 -0
  412. package/lib/migrate-info-main-content-selector.js +35 -0
  413. package/lib/migrate-info-request-header-names.d.ts +16 -0
  414. package/lib/migrate-info-request-header-names.js +35 -0
  415. package/lib/migrate-info-roots.d.ts +20 -0
  416. package/lib/migrate-info-roots.js +52 -0
  417. package/lib/migrate-inventory-runs-to-list-reconcile-runs.d.ts +34 -0
  418. package/lib/migrate-inventory-runs-to-list-reconcile-runs.js +51 -0
  419. package/lib/migrate-list-reconcile-runs-exclude-skipped.d.ts +25 -0
  420. package/lib/migrate-list-reconcile-runs-exclude-skipped.js +44 -0
  421. package/lib/migrate-list-reconcile-runs-invalid-skipped.d.ts +16 -0
  422. package/lib/migrate-list-reconcile-runs-invalid-skipped.js +35 -0
  423. package/lib/migrate-main-contents-columns.d.ts +26 -0
  424. package/lib/migrate-main-contents-columns.js +61 -0
  425. package/lib/migrate-page-meta-body-hash.d.ts +44 -0
  426. package/lib/migrate-page-meta-body-hash.js +63 -0
  427. package/lib/migrate-page-meta-console-error-count.d.ts +27 -0
  428. package/lib/migrate-page-meta-console-error-count.js +45 -0
  429. package/lib/migrate-page-meta-custom-element-count.d.ts +33 -0
  430. package/lib/migrate-page-meta-custom-element-count.js +51 -0
  431. package/lib/migrate-page-meta-image-scan.d.ts +27 -0
  432. package/lib/migrate-page-meta-image-scan.js +52 -0
  433. package/lib/migrate-page-tags-to-page-technologies.d.ts +39 -0
  434. package/lib/migrate-page-tags-to-page-technologies.js +79 -0
  435. package/lib/migrate-ref-tables.d.ts +25 -0
  436. package/lib/migrate-ref-tables.js +38 -0
  437. package/lib/native-executor/check-native-executor-config.d.ts +17 -0
  438. package/lib/native-executor/check-native-executor-config.js +20 -0
  439. package/lib/page-meta-column-maps.d.ts +32 -0
  440. package/lib/page-meta-column-maps.js +43 -0
  441. package/lib/page.d.ts +546 -0
  442. package/lib/page.js +764 -0
  443. package/lib/peek-archive-lock.d.ts +40 -0
  444. package/lib/peek-archive-lock.js +62 -0
  445. package/lib/populate-entity-tables/collapse-anchor-rows.d.ts +41 -0
  446. package/lib/populate-entity-tables/collapse-anchor-rows.js +87 -0
  447. package/lib/populate-entity-tables/derive-dom-path.d.ts +35 -0
  448. package/lib/populate-entity-tables/derive-dom-path.js +72 -0
  449. package/lib/populate-entity-tables/is-blob-ref-value.d.ts +16 -0
  450. package/lib/populate-entity-tables/is-blob-ref-value.js +19 -0
  451. package/lib/populate-entity-tables/match-images-to-dom-paths.d.ts +66 -0
  452. package/lib/populate-entity-tables/match-images-to-dom-paths.js +96 -0
  453. package/lib/populate-entity-tables/populate-anchor-edges.d.ts +33 -0
  454. package/lib/populate-entity-tables/populate-anchor-edges.js +153 -0
  455. package/lib/populate-entity-tables/populate-content-items.d.ts +40 -0
  456. package/lib/populate-entity-tables/populate-content-items.js +141 -0
  457. package/lib/populate-entity-tables/populate-entities.d.ts +81 -0
  458. package/lib/populate-entity-tables/populate-entities.js +110 -0
  459. package/lib/populate-entity-tables/populate-image-items.d.ts +91 -0
  460. package/lib/populate-entity-tables/populate-image-items.js +226 -0
  461. package/lib/populate-entity-tables/populate-page-meta.d.ts +33 -0
  462. package/lib/populate-entity-tables/populate-page-meta.js +267 -0
  463. package/lib/populate-entity-tables/populate-resource-items.d.ts +22 -0
  464. package/lib/populate-entity-tables/populate-resource-items.js +114 -0
  465. package/lib/populate-entity-tables/populate-resource-ref-edges.d.ts +31 -0
  466. package/lib/populate-entity-tables/populate-resource-ref-edges.js +33 -0
  467. package/lib/populate-entity-tables/resolve-blob-refs.d.ts +31 -0
  468. package/lib/populate-entity-tables/resolve-blob-refs.js +100 -0
  469. package/lib/populate-entity-tables/resolve-content-type-refs.d.ts +22 -0
  470. package/lib/populate-entity-tables/resolve-content-type-refs.js +27 -0
  471. package/lib/populate-entity-tables/resolve-header-sets.d.ts +49 -0
  472. package/lib/populate-entity-tables/resolve-header-sets.js +122 -0
  473. package/lib/populate-entity-tables/resolve-json-refs.d.ts +25 -0
  474. package/lib/populate-entity-tables/resolve-json-refs.js +67 -0
  475. package/lib/populate-entity-tables/resolve-text-refs.d.ts +30 -0
  476. package/lib/populate-entity-tables/resolve-text-refs.js +61 -0
  477. package/lib/populate-entity-tables/resolve-url-or-blob-from-maps.d.ts +21 -0
  478. package/lib/populate-entity-tables/resolve-url-or-blob-from-maps.js +27 -0
  479. package/lib/populate-entity-tables/resolve-url-refs.d.ts +33 -0
  480. package/lib/populate-entity-tables/resolve-url-refs.js +60 -0
  481. package/lib/populate-entity-tables/test-utils/count-rows.d.ts +17 -0
  482. package/lib/populate-entity-tables/test-utils/count-rows.js +20 -0
  483. package/lib/populate-entity-tables/test-utils/seed-content-items.d.ts +25 -0
  484. package/lib/populate-entity-tables/test-utils/seed-content-items.js +42 -0
  485. package/lib/populate-entity-tables/test-utils/setup-entities-db.d.ts +30 -0
  486. package/lib/populate-entity-tables/test-utils/setup-entities-db.js +175 -0
  487. package/lib/populate-entity-tables/types.d.ts +157 -0
  488. package/lib/populate-entity-tables/types.js +12 -0
  489. package/lib/populate-entity-tables/upsert-text-refs.d.ts +38 -0
  490. package/lib/populate-entity-tables/upsert-text-refs.js +78 -0
  491. package/lib/populate-ref-tables/classify-content-type.d.ts +16 -0
  492. package/lib/populate-ref-tables/classify-content-type.js +52 -0
  493. package/lib/populate-ref-tables/compute-content-hash.d.ts +22 -0
  494. package/lib/populate-ref-tables/compute-content-hash.js +26 -0
  495. package/lib/populate-ref-tables/compute-header-flags.d.ts +16 -0
  496. package/lib/populate-ref-tables/compute-header-flags.js +70 -0
  497. package/lib/populate-ref-tables/content-type-rules.d.ts +38 -0
  498. package/lib/populate-ref-tables/content-type-rules.js +133 -0
  499. package/lib/populate-ref-tables/create-header-table-caches.d.ts +25 -0
  500. package/lib/populate-ref-tables/create-header-table-caches.js +49 -0
  501. package/lib/populate-ref-tables/data-uri-url-refs-limit.d.ts +15 -0
  502. package/lib/populate-ref-tables/data-uri-url-refs-limit.js +15 -0
  503. package/lib/populate-ref-tables/decode-data-uri.d.ts +21 -0
  504. package/lib/populate-ref-tables/decode-data-uri.js +126 -0
  505. package/lib/populate-ref-tables/decompose-header-set.d.ts +29 -0
  506. package/lib/populate-ref-tables/decompose-header-set.js +157 -0
  507. package/lib/populate-ref-tables/decompose-url.d.ts +25 -0
  508. package/lib/populate-ref-tables/decompose-url.js +70 -0
  509. package/lib/populate-ref-tables/header-stability.d.ts +19 -0
  510. package/lib/populate-ref-tables/header-stability.js +22 -0
  511. package/lib/populate-ref-tables/header-value-cache-key.d.ts +17 -0
  512. package/lib/populate-ref-tables/header-value-cache-key.js +19 -0
  513. package/lib/populate-ref-tables/normalize-mime.d.ts +24 -0
  514. package/lib/populate-ref-tables/normalize-mime.js +36 -0
  515. package/lib/populate-ref-tables/populate-blob-refs.d.ts +38 -0
  516. package/lib/populate-ref-tables/populate-blob-refs.js +134 -0
  517. package/lib/populate-ref-tables/populate-content-type-refs.d.ts +27 -0
  518. package/lib/populate-ref-tables/populate-content-type-refs.js +70 -0
  519. package/lib/populate-ref-tables/populate-header-tables.d.ts +35 -0
  520. package/lib/populate-ref-tables/populate-header-tables.js +80 -0
  521. package/lib/populate-ref-tables/populate-json-refs.d.ts +29 -0
  522. package/lib/populate-ref-tables/populate-json-refs.js +101 -0
  523. package/lib/populate-ref-tables/populate-refs.d.ts +51 -0
  524. package/lib/populate-ref-tables/populate-refs.js +62 -0
  525. package/lib/populate-ref-tables/populate-text-refs.d.ts +32 -0
  526. package/lib/populate-ref-tables/populate-text-refs.js +133 -0
  527. package/lib/populate-ref-tables/populate-url-refs.d.ts +28 -0
  528. package/lib/populate-ref-tables/populate-url-refs.js +148 -0
  529. package/lib/populate-ref-tables/test-utils/count-rows.d.ts +15 -0
  530. package/lib/populate-ref-tables/test-utils/count-rows.js +17 -0
  531. package/lib/populate-ref-tables/types.d.ts +197 -0
  532. package/lib/populate-ref-tables/types.js +7 -0
  533. package/lib/populate-ref-tables/upsert-one-header-set.d.ts +34 -0
  534. package/lib/populate-ref-tables/upsert-one-header-set.js +208 -0
  535. package/lib/populate-ref-tables/volatile-header-names.d.ts +20 -0
  536. package/lib/populate-ref-tables/volatile-header-names.js +33 -0
  537. package/lib/redirect-table.d.ts +9 -0
  538. package/lib/redirect-table.js +28 -0
  539. package/lib/release-finished-statements.d.ts +42 -0
  540. package/lib/release-finished-statements.js +45 -0
  541. package/lib/resolve-redirect-chain.d.ts +33 -0
  542. package/lib/resolve-redirect-chain.js +27 -0
  543. package/lib/resource.d.ts +46 -0
  544. package/lib/resource.js +62 -0
  545. package/lib/retarget-legacy-fk-tables.d.ts +61 -0
  546. package/lib/retarget-legacy-fk-tables.js +137 -0
  547. package/lib/safe-path.d.ts +9 -0
  548. package/lib/safe-path.js +17 -0
  549. package/lib/scope/build-scope-map.d.ts +21 -0
  550. package/lib/scope/build-scope-map.js +32 -0
  551. package/lib/scope/find-scope-entry.d.ts +25 -0
  552. package/lib/scope/find-scope-entry.js +45 -0
  553. package/lib/template-classification/classify-archive-page-templates.d.ts +42 -0
  554. package/lib/template-classification/classify-archive-page-templates.js +70 -0
  555. package/lib/template-classification/classify-page-templates.d.ts +33 -0
  556. package/lib/template-classification/classify-page-templates.js +60 -0
  557. package/lib/template-classification/collect-page-ids-with-html.d.ts +24 -0
  558. package/lib/template-classification/collect-page-ids-with-html.js +30 -0
  559. package/lib/template-classification/collect-page-stylesheet-urls.d.ts +32 -0
  560. package/lib/template-classification/collect-page-stylesheet-urls.js +130 -0
  561. package/lib/template-classification/create-content-root-hint.d.ts +41 -0
  562. package/lib/template-classification/create-content-root-hint.js +51 -0
  563. package/lib/template-classification/create-page-cluster-factory.d.ts +36 -0
  564. package/lib/template-classification/create-page-cluster-factory.js +52 -0
  565. package/lib/template-classification/load-page-cluster-candidates.d.ts +32 -0
  566. package/lib/template-classification/load-page-cluster-candidates.js +93 -0
  567. package/lib/template-classification/page-cluster/resolve-page-cluster-keys.d.ts +34 -0
  568. package/lib/template-classification/page-cluster/resolve-page-cluster-keys.js +236 -0
  569. package/lib/template-classification/page-cluster/types.d.ts +123 -0
  570. package/lib/template-classification/page-cluster/types.js +1 -0
  571. package/lib/template-classification/types.d.ts +234 -0
  572. package/lib/template-classification/types.js +1 -0
  573. package/lib/test-utils/build-full-schema-test-db.d.ts +34 -0
  574. package/lib/test-utils/build-full-schema-test-db.js +74 -0
  575. package/lib/test-utils/create-legacy-analysis-tables.d.ts +13 -0
  576. package/lib/test-utils/create-legacy-analysis-tables.js +37 -0
  577. package/lib/test-utils/fk-parent-tables.d.ts +15 -0
  578. package/lib/test-utils/fk-parent-tables.js +19 -0
  579. package/lib/test-utils/seed-content-item.d.ts +35 -0
  580. package/lib/test-utils/seed-content-item.js +42 -0
  581. package/lib/test-utils/setup-legacy-fk-db.d.ts +34 -0
  582. package/lib/test-utils/setup-legacy-fk-db.js +271 -0
  583. package/lib/transfer/attach-source-database.d.ts +31 -0
  584. package/lib/transfer/attach-source-database.js +40 -0
  585. package/lib/transfer/build-split-config.d.ts +30 -0
  586. package/lib/transfer/build-split-config.js +42 -0
  587. package/lib/transfer/clear-replaced-page-rows.d.ts +23 -0
  588. package/lib/transfer/clear-replaced-page-rows.js +61 -0
  589. package/lib/transfer/concat-archives.d.ts +55 -0
  590. package/lib/transfer/concat-archives.js +95 -0
  591. package/lib/transfer/concat-source-transfer-phases.d.ts +10 -0
  592. package/lib/transfer/concat-source-transfer-phases.js +17 -0
  593. package/lib/transfer/content-item-rank-sql.d.ts +21 -0
  594. package/lib/transfer/content-item-rank-sql.js +23 -0
  595. package/lib/transfer/copy-anchor-edges.d.ts +28 -0
  596. package/lib/transfer/copy-anchor-edges.js +42 -0
  597. package/lib/transfer/copy-dictionaries-for-concat.d.ts +39 -0
  598. package/lib/transfer/copy-dictionaries-for-concat.js +81 -0
  599. package/lib/transfer/copy-dictionaries-for-split.d.ts +29 -0
  600. package/lib/transfer/copy-dictionaries-for-split.js +224 -0
  601. package/lib/transfer/copy-header-set-children.d.ts +27 -0
  602. package/lib/transfer/copy-header-set-children.js +51 -0
  603. package/lib/transfer/copy-image-items.d.ts +21 -0
  604. package/lib/transfer/copy-image-items.js +62 -0
  605. package/lib/transfer/copy-inventory-source-lists.d.ts +30 -0
  606. package/lib/transfer/copy-inventory-source-lists.js +61 -0
  607. package/lib/transfer/copy-journal-tables.d.ts +30 -0
  608. package/lib/transfer/copy-journal-tables.js +56 -0
  609. package/lib/transfer/copy-page-console-logs.d.ts +16 -0
  610. package/lib/transfer/copy-page-console-logs.js +27 -0
  611. package/lib/transfer/copy-page-html-blobs.d.ts +31 -0
  612. package/lib/transfer/copy-page-html-blobs.js +43 -0
  613. package/lib/transfer/copy-page-meta.d.ts +27 -0
  614. package/lib/transfer/copy-page-meta.js +68 -0
  615. package/lib/transfer/copy-page-template-clusters.d.ts +31 -0
  616. package/lib/transfer/copy-page-template-clusters.js +56 -0
  617. package/lib/transfer/copy-page-template-labels.d.ts +34 -0
  618. package/lib/transfer/copy-page-template-labels.js +88 -0
  619. package/lib/transfer/copy-resource-items.d.ts +29 -0
  620. package/lib/transfer/copy-resource-items.js +89 -0
  621. package/lib/transfer/copy-resource-ref-edges.d.ts +20 -0
  622. package/lib/transfer/copy-resource-ref-edges.js +33 -0
  623. package/lib/transfer/copy-simple-page-scoped-tables.d.ts +15 -0
  624. package/lib/transfer/copy-simple-page-scoped-tables.js +34 -0
  625. package/lib/transfer/count-external-pages-in-scope.d.ts +26 -0
  626. package/lib/transfer/count-external-pages-in-scope.js +40 -0
  627. package/lib/transfer/create-transfer-temp-tables.d.ts +30 -0
  628. package/lib/transfer/create-transfer-temp-tables.js +59 -0
  629. package/lib/transfer/dictionary-copy-specs.d.ts +32 -0
  630. package/lib/transfer/dictionary-copy-specs.js +28 -0
  631. package/lib/transfer/drop-transfer-temp-tables.d.ts +9 -0
  632. package/lib/transfer/drop-transfer-temp-tables.js +18 -0
  633. package/lib/transfer/flatten-redirect-chains.d.ts +44 -0
  634. package/lib/transfer/flatten-redirect-chains.js +74 -0
  635. package/lib/transfer/insert-content-items.d.ts +35 -0
  636. package/lib/transfer/insert-content-items.js +116 -0
  637. package/lib/transfer/list-transfer-columns.d.ts +35 -0
  638. package/lib/transfer/list-transfer-columns.js +45 -0
  639. package/lib/transfer/mark-in-scope-content-items.d.ts +31 -0
  640. package/lib/transfer/mark-in-scope-content-items.js +54 -0
  641. package/lib/transfer/merge-archive-configs.d.ts +51 -0
  642. package/lib/transfer/merge-archive-configs.js +85 -0
  643. package/lib/transfer/plan-content-items-for-concat.d.ts +33 -0
  644. package/lib/transfer/plan-content-items-for-concat.js +51 -0
  645. package/lib/transfer/plan-content-items-for-split.d.ts +42 -0
  646. package/lib/transfer/plan-content-items-for-split.js +83 -0
  647. package/lib/transfer/plan-resource-items.d.ts +40 -0
  648. package/lib/transfer/plan-resource-items.js +69 -0
  649. package/lib/transfer/quote-transfer-identifier.d.ts +18 -0
  650. package/lib/transfer/quote-transfer-identifier.js +20 -0
  651. package/lib/transfer/reclassify-resource-externality.d.ts +37 -0
  652. package/lib/transfer/reclassify-resource-externality.js +66 -0
  653. package/lib/transfer/remap-redirect-dest-ids.d.ts +34 -0
  654. package/lib/transfer/remap-redirect-dest-ids.js +51 -0
  655. package/lib/transfer/replace-content-items.d.ts +39 -0
  656. package/lib/transfer/replace-content-items.js +83 -0
  657. package/lib/transfer/simple-page-scoped-tables.d.ts +25 -0
  658. package/lib/transfer/simple-page-scoped-tables.js +38 -0
  659. package/lib/transfer/split-archive.d.ts +55 -0
  660. package/lib/transfer/split-archive.js +98 -0
  661. package/lib/transfer/split-source-transfer-phases.d.ts +11 -0
  662. package/lib/transfer/split-source-transfer-phases.js +18 -0
  663. package/lib/transfer/transfer-action.d.ts +34 -0
  664. package/lib/transfer/transfer-action.js +32 -0
  665. package/lib/transfer/transfer-archive-rows.d.ts +65 -0
  666. package/lib/transfer/transfer-archive-rows.js +156 -0
  667. package/lib/transfer/transfer-dictionary-tables.d.ts +12 -0
  668. package/lib/transfer/transfer-dictionary-tables.js +22 -0
  669. package/lib/transfer/transfer-post-phases.d.ts +10 -0
  670. package/lib/transfer/transfer-post-phases.js +13 -0
  671. package/lib/transfer/transfer-source-alias.d.ts +9 -0
  672. package/lib/transfer/transfer-source-alias.js +9 -0
  673. package/lib/transfer/types.d.ts +111 -0
  674. package/lib/transfer/types.js +35 -0
  675. package/lib/types.d.ts +772 -0
  676. package/lib/types.js +1 -0
  677. package/lib/url-alias/compute-tier-a-alias-key.d.ts +44 -0
  678. package/lib/url-alias/compute-tier-a-alias-key.js +47 -0
  679. package/lib/url-alias/compute-tier-b-alias-key.d.ts +23 -0
  680. package/lib/url-alias/compute-tier-b-alias-key.js +26 -0
  681. package/lib/url-alias/group-alias-candidates.d.ts +27 -0
  682. package/lib/url-alias/group-alias-candidates.js +29 -0
  683. package/lib/url-alias/types.d.ts +12 -0
  684. package/lib/url-alias/types.js +1 -0
  685. package/lib/url-pattern/compute-shape-key.d.ts +58 -0
  686. package/lib/url-pattern/compute-shape-key.js +129 -0
  687. package/lib/url-pattern/decompose-url.d.ts +33 -0
  688. package/lib/url-pattern/decompose-url.js +79 -0
  689. package/lib/url-pattern/reconstruct-url.d.ts +15 -0
  690. package/lib/url-pattern/reconstruct-url.js +33 -0
  691. package/lib/url-sort/compute-url-sort-ranks.d.ts +30 -0
  692. package/lib/url-sort/compute-url-sort-ranks.js +33 -0
  693. package/lib/utils/array/each-splitted.d.ts +10 -0
  694. package/lib/utils/array/each-splitted.js +14 -0
  695. package/lib/utils/debug.d.ts +8 -0
  696. package/lib/utils/debug.js +8 -0
  697. package/lib/utils/error/emit-error-with-retry.d.ts +40 -0
  698. package/lib/utils/error/emit-error-with-retry.js +44 -0
  699. package/lib/utils/error/emit-error.d.ts +39 -0
  700. package/lib/utils/error/emit-error.js +41 -0
  701. package/lib/utils/object/parse-response-headers.d.ts +12 -0
  702. package/lib/utils/object/parse-response-headers.js +26 -0
  703. package/lib/utils/object/redact-request-headers.d.ts +15 -0
  704. package/lib/utils/object/redact-request-headers.js +27 -0
  705. package/lib/utils/types/types.d.ts +383 -0
  706. package/lib/utils/types/types.js +1 -0
  707. package/lib/verify-migration/capture-rejection.d.ts +24 -0
  708. package/lib/verify-migration/capture-rejection.js +31 -0
  709. package/lib/verify-migration/check-anchor-edges-count.d.ts +34 -0
  710. package/lib/verify-migration/check-anchor-edges-count.js +72 -0
  711. package/lib/verify-migration/check-anchor-edges-sum.d.ts +13 -0
  712. package/lib/verify-migration/check-anchor-edges-sum.js +27 -0
  713. package/lib/verify-migration/check-content-items-count.d.ts +16 -0
  714. package/lib/verify-migration/check-content-items-count.js +30 -0
  715. package/lib/verify-migration/check-content-type-preservation.d.ts +22 -0
  716. package/lib/verify-migration/check-content-type-preservation.js +40 -0
  717. package/lib/verify-migration/check-foreign-key-integrity.d.ts +31 -0
  718. package/lib/verify-migration/check-foreign-key-integrity.js +47 -0
  719. package/lib/verify-migration/check-image-items-count.d.ts +12 -0
  720. package/lib/verify-migration/check-image-items-count.js +26 -0
  721. package/lib/verify-migration/check-page-meta-count.d.ts +15 -0
  722. package/lib/verify-migration/check-page-meta-count.js +31 -0
  723. package/lib/verify-migration/check-reader-parity.d.ts +23 -0
  724. package/lib/verify-migration/check-reader-parity.js +182 -0
  725. package/lib/verify-migration/check-resource-items-count.d.ts +17 -0
  726. package/lib/verify-migration/check-resource-items-count.js +33 -0
  727. package/lib/verify-migration/check-url-round-trip.d.ts +43 -0
  728. package/lib/verify-migration/check-url-round-trip.js +112 -0
  729. package/lib/verify-migration/types.d.ts +70 -0
  730. package/lib/verify-migration/types.js +63 -0
  731. package/lib/verify-migration/verify-migration.d.ts +41 -0
  732. package/lib/verify-migration/verify-migration.js +120 -0
  733. package/lib/with-bulk-write-pragmas.d.ts +51 -0
  734. package/lib/with-bulk-write-pragmas.js +132 -0
  735. package/lib/write-queue.d.ts +32 -0
  736. package/lib/write-queue.js +55 -0
  737. package/package.json +360 -5
@@ -0,0 +1,14 @@
1
+ import { splitArray } from '@d-zero/shared/split-array';
2
+ /**
3
+ * Splits an array into chunks of the specified size and executes a callback
4
+ * on each chunk in parallel using `Promise.all`.
5
+ * @template T - The element type of the array.
6
+ * @param a - The array to split into chunks.
7
+ * @param count - The maximum number of elements per chunk.
8
+ * @param callback - A function to invoke on each chunk. May be synchronous or asynchronous.
9
+ * @returns A promise that resolves when all chunk callbacks have completed.
10
+ */
11
+ export async function eachSplitted(a, count, callback) {
12
+ const splitted = splitArray(a, count);
13
+ await Promise.all(splitted.map((items) => callback(items)));
14
+ }
@@ -0,0 +1,8 @@
1
+ import debug from 'debug';
2
+ /**
3
+ * Debug logger for the archive layer's shared utilities. Namespace:
4
+ * `Nitpicker:Utils` — the same namespace as `@nitpicker/crawler`'s utility
5
+ * logger, so one `DEBUG=Nitpicker:Utils*` filter covers both packages
6
+ * (`../debug.ts` extends it to `Nitpicker:Utils:Archive`).
7
+ */
8
+ export declare const log: debug.Debugger;
@@ -0,0 +1,8 @@
1
+ import debug from 'debug';
2
+ /**
3
+ * Debug logger for the archive layer's shared utilities. Namespace:
4
+ * `Nitpicker:Utils` — the same namespace as `@nitpicker/crawler`'s utility
5
+ * logger, so one `DEBUG=Nitpicker:Utils*` filter covers both packages
6
+ * (`../debug.ts` extends it to `Nitpicker:Utils:Archive`).
7
+ */
8
+ export const log = debug('Nitpicker:Utils');
@@ -0,0 +1,40 @@
1
+ import type { RetryCallOptions } from '@d-zero/shared/retry';
2
+ /**
3
+ * Minimal object shape required by {@link emitErrorAndRetry}: an emitter
4
+ * able to publish an `'error'` event carrying an `Error` payload. Same
5
+ * contract as `emitError` — see {@link ./emit-error.js} for details.
6
+ */
7
+ interface Emitter {
8
+ /**
9
+ * Emits the `'error'` event with the given `Error` payload.
10
+ * @param event - Event name; always `'error'` here.
11
+ * @param payload - The error instance to publish.
12
+ * @returns Anything; the caller ignores it.
13
+ */
14
+ emit(event: 'error', payload: Error): unknown;
15
+ }
16
+ /**
17
+ * Retries `fn` per `retryOptions`, then — if retries are exhausted with a
18
+ * final `Error` — logs and re-emits it as an `'error'` event on `emitter`
19
+ * before re-throwing. `label` is forwarded into `retryCall` so its own
20
+ * onWait / onGiveUp / timeout messages identify the call site (previously
21
+ * derived automatically by the `@retry` decorator via
22
+ * `ClassMethodDecoratorContext.name`).
23
+ *
24
+ * Inlined try/catch rather than composing `emitError` with a
25
+ * `() => retryCall(...)` closure to keep the per-invocation closure count
26
+ * at 1 — this method is called on the DB write hot path (`updatePage`,
27
+ * `insertResource`), where wrapping decorators previously ran with zero
28
+ * per-call allocation.
29
+ * @template T - The return type of `fn`.
30
+ * @param emitter - The event emitter that receives the `'error'` event.
31
+ * @param label - Human-readable label; forwarded into `retryCall`
32
+ * (visible in retry timeouts / onWait / onGiveUp) and used
33
+ * as the debug log prefix on final failure.
34
+ * @param fn - The async operation to retry.
35
+ * @param retryOptions - Retry configuration; `label` is overwritten
36
+ * with the `label` argument here.
37
+ * @returns The resolved value of `fn`.
38
+ */
39
+ export declare function emitErrorAndRetry<T>(emitter: Emitter, label: string, fn: () => Promise<T>, retryOptions: RetryCallOptions): Promise<T>;
40
+ export {};
@@ -0,0 +1,44 @@
1
+ import { retryCall } from '@d-zero/shared/retry';
2
+ import { log } from '../debug.js';
3
+ /**
4
+ * Debug logger for the ErrorEmitter helper family.
5
+ * Namespace: `Nitpicker:Utils:ErrorEmitter`. Kept identical to the namespace
6
+ * used by the deleted `@ErrorEmitter()` decorator so existing `DEBUG` env
7
+ * filters keep working after the decorator-to-HOF migration.
8
+ */
9
+ const errorLog = log.extend('ErrorEmitter');
10
+ /**
11
+ * Retries `fn` per `retryOptions`, then — if retries are exhausted with a
12
+ * final `Error` — logs and re-emits it as an `'error'` event on `emitter`
13
+ * before re-throwing. `label` is forwarded into `retryCall` so its own
14
+ * onWait / onGiveUp / timeout messages identify the call site (previously
15
+ * derived automatically by the `@retry` decorator via
16
+ * `ClassMethodDecoratorContext.name`).
17
+ *
18
+ * Inlined try/catch rather than composing `emitError` with a
19
+ * `() => retryCall(...)` closure to keep the per-invocation closure count
20
+ * at 1 — this method is called on the DB write hot path (`updatePage`,
21
+ * `insertResource`), where wrapping decorators previously ran with zero
22
+ * per-call allocation.
23
+ * @template T - The return type of `fn`.
24
+ * @param emitter - The event emitter that receives the `'error'` event.
25
+ * @param label - Human-readable label; forwarded into `retryCall`
26
+ * (visible in retry timeouts / onWait / onGiveUp) and used
27
+ * as the debug log prefix on final failure.
28
+ * @param fn - The async operation to retry.
29
+ * @param retryOptions - Retry configuration; `label` is overwritten
30
+ * with the `label` argument here.
31
+ * @returns The resolved value of `fn`.
32
+ */
33
+ export async function emitErrorAndRetry(emitter, label, fn, retryOptions) {
34
+ try {
35
+ return await retryCall(fn, { ...retryOptions, label });
36
+ }
37
+ catch (error) {
38
+ if (error instanceof Error) {
39
+ errorLog('%s: %O', label, error);
40
+ void emitter.emit('error', error);
41
+ }
42
+ throw error;
43
+ }
44
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Minimal object shape required by {@link emitError}: an emitter able to
3
+ * publish an `'error'` event carrying an `Error` payload. Any class that
4
+ * extends `TypedAwaitEventEmitter<{ error: Error, ... }>` satisfies this,
5
+ * and so does Node's built-in `EventEmitter`.
6
+ */
7
+ interface Emitter {
8
+ /**
9
+ * Emits the `'error'` event with the given `Error` payload.
10
+ * The return value is intentionally unspecified — callers ignore it.
11
+ * @param event - Event name; always `'error'` here.
12
+ * @param payload - The error instance to publish.
13
+ * @returns Anything; the caller ignores it.
14
+ */
15
+ emit(event: 'error', payload: Error): unknown;
16
+ }
17
+ /**
18
+ * Wraps `fn` so that any thrown `Error` is logged with `label` and
19
+ * re-emitted as an `'error'` event on `emitter` before being re-thrown.
20
+ * Non-`Error` throws pass through unchanged — no log, no emit — matching
21
+ * the behaviour of the deleted `@ErrorEmitter()` decorator so that
22
+ * downstream `'error'` listeners (e.g. the crawler orchestrator that
23
+ * aborts on any emitted error) are only invoked with real `Error`
24
+ * instances.
25
+ *
26
+ * Kept as a standalone HOF (instead of a decorator) because Vite 8 /
27
+ * Vitest 4.1 switched from esbuild to Rolldown + oxc, which emit
28
+ * TC39 Stage 3 decorator syntax as-is and let it reach Node, causing
29
+ * `SyntaxError: Invalid or unexpected token` at test runtime.
30
+ * @template T - The return type of `fn`.
31
+ * @param emitter - The event emitter that receives the `'error'` event.
32
+ * @param label - Human-readable label included in the debug log line
33
+ * (typically `'ClassName.methodName'`). Also useful as the
34
+ * grep target when triaging failed crawls.
35
+ * @param fn - The async operation to wrap.
36
+ * @returns The resolved value of `fn`.
37
+ */
38
+ export declare function emitError<T>(emitter: Emitter, label: string, fn: () => Promise<T>): Promise<T>;
39
+ export {};
@@ -0,0 +1,41 @@
1
+ import { log } from '../debug.js';
2
+ /**
3
+ * Debug logger for the ErrorEmitter helper family.
4
+ * Namespace: `Nitpicker:Utils:ErrorEmitter`. Kept identical to the namespace
5
+ * used by the deleted `@ErrorEmitter()` decorator so existing `DEBUG` env
6
+ * filters keep working after the decorator-to-HOF migration.
7
+ */
8
+ const errorLog = log.extend('ErrorEmitter');
9
+ /**
10
+ * Wraps `fn` so that any thrown `Error` is logged with `label` and
11
+ * re-emitted as an `'error'` event on `emitter` before being re-thrown.
12
+ * Non-`Error` throws pass through unchanged — no log, no emit — matching
13
+ * the behaviour of the deleted `@ErrorEmitter()` decorator so that
14
+ * downstream `'error'` listeners (e.g. the crawler orchestrator that
15
+ * aborts on any emitted error) are only invoked with real `Error`
16
+ * instances.
17
+ *
18
+ * Kept as a standalone HOF (instead of a decorator) because Vite 8 /
19
+ * Vitest 4.1 switched from esbuild to Rolldown + oxc, which emit
20
+ * TC39 Stage 3 decorator syntax as-is and let it reach Node, causing
21
+ * `SyntaxError: Invalid or unexpected token` at test runtime.
22
+ * @template T - The return type of `fn`.
23
+ * @param emitter - The event emitter that receives the `'error'` event.
24
+ * @param label - Human-readable label included in the debug log line
25
+ * (typically `'ClassName.methodName'`). Also useful as the
26
+ * grep target when triaging failed crawls.
27
+ * @param fn - The async operation to wrap.
28
+ * @returns The resolved value of `fn`.
29
+ */
30
+ export async function emitError(emitter, label, fn) {
31
+ try {
32
+ return await fn();
33
+ }
34
+ catch (error) {
35
+ if (error instanceof Error) {
36
+ errorLog('%s: %O', label, error);
37
+ void emitter.emit('error', error);
38
+ }
39
+ throw error;
40
+ }
41
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Parse a JSON-serialized HTTP response headers column from the archive
3
+ * database.
4
+ *
5
+ * The columns hold JSON produced by `JSON.stringify` at insert time; absent,
6
+ * malformed, or non-object JSON (the string `"null"`, arrays, primitives)
7
+ * degrades to `null` instead of throwing because a missing header set only
8
+ * loses fidelity — callers decide their own fallback (`?? {}` etc.).
9
+ * @param json - The raw column value.
10
+ * @returns The parsed header record, or `null` when absent or malformed.
11
+ */
12
+ export declare function parseResponseHeaders(json: string | null): Record<string, string | string[] | undefined> | null;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Parse a JSON-serialized HTTP response headers column from the archive
3
+ * database.
4
+ *
5
+ * The columns hold JSON produced by `JSON.stringify` at insert time; absent,
6
+ * malformed, or non-object JSON (the string `"null"`, arrays, primitives)
7
+ * degrades to `null` instead of throwing because a missing header set only
8
+ * loses fidelity — callers decide their own fallback (`?? {}` etc.).
9
+ * @param json - The raw column value.
10
+ * @returns The parsed header record, or `null` when absent or malformed.
11
+ */
12
+ export function parseResponseHeaders(json) {
13
+ if (json == null) {
14
+ return null;
15
+ }
16
+ try {
17
+ const parsed = JSON.parse(json);
18
+ if (parsed == null || typeof parsed !== 'object' || Array.isArray(parsed)) {
19
+ return null;
20
+ }
21
+ return parsed;
22
+ }
23
+ catch {
24
+ return null;
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Returns a copy of `config` whose `requestHeaders` values are replaced with
3
+ * `***`, leaving the header names visible. Use it before a config object is
4
+ * logged or printed.
5
+ *
6
+ * WHY: request header values are credentials. The runtime config that flows
7
+ * through the orchestrator carries them, and it is dumped by `debug` logs and
8
+ * the crawl-start header — neither may show a token.
9
+ * @param config - Any config object that may carry `requestHeaders`.
10
+ * @returns The same object when it has no `requestHeaders`, otherwise a shallow copy with masked values.
11
+ * @example
12
+ * redactRequestHeaders({ userAgent: 'x', requestHeaders: { Authorization: 'Bearer t' } });
13
+ * // => { userAgent: 'x', requestHeaders: { Authorization: '***' } }
14
+ */
15
+ export declare function redactRequestHeaders<T extends object>(config: T): T;
@@ -0,0 +1,27 @@
1
+ /** Placeholder shown instead of a request header value. */
2
+ const REDACTED = '***';
3
+ /**
4
+ * Returns a copy of `config` whose `requestHeaders` values are replaced with
5
+ * `***`, leaving the header names visible. Use it before a config object is
6
+ * logged or printed.
7
+ *
8
+ * WHY: request header values are credentials. The runtime config that flows
9
+ * through the orchestrator carries them, and it is dumped by `debug` logs and
10
+ * the crawl-start header — neither may show a token.
11
+ * @param config - Any config object that may carry `requestHeaders`.
12
+ * @returns The same object when it has no `requestHeaders`, otherwise a shallow copy with masked values.
13
+ * @example
14
+ * redactRequestHeaders({ userAgent: 'x', requestHeaders: { Authorization: 'Bearer t' } });
15
+ * // => { userAgent: 'x', requestHeaders: { Authorization: '***' } }
16
+ */
17
+ export function redactRequestHeaders(config) {
18
+ const { requestHeaders } = config;
19
+ if (!requestHeaders) {
20
+ return config;
21
+ }
22
+ const masked = {};
23
+ for (const name of Object.keys(requestHeaders)) {
24
+ masked[name] = REDACTED;
25
+ }
26
+ return { ...config, requestHeaders: masked };
27
+ }
@@ -0,0 +1,383 @@
1
+ /**
2
+ * Scrape-result shapes the archive layer persists.
3
+ *
4
+ * Structurally equivalent mirrors of `@d-zero/beholder`'s exported types
5
+ * (`PageData`, `Resource`, `MainContentsData`, `ConsoleLogEntry`, …) so
6
+ * that `@nitpicker/archive` — and every read-only consumer that depends on
7
+ * it (query / viewer / mcp-server / report-*) — does not pull in beholder,
8
+ * puppeteer or dealer. The crawler passes beholder's values straight
9
+ * through: TypeScript's structural typing accepts them without conversion.
10
+ * Structural typing alone would NOT catch a field beholder adds, so
11
+ * `@nitpicker/crawler`'s `beholder-type-mirror-parity.ts` asserts at build
12
+ * time that every mirror here is identical to the installed beholder's —
13
+ * update this file in the same change that bumps `@d-zero/beholder`.
14
+ *
15
+ * The only intentional widening is `ConsoleLogEntry.type` (puppeteer's
16
+ * `ConsoleMessageType` union becomes `string`), because naming the union
17
+ * would require a `puppeteer` dependency. `Meta` and its sub-types live in
18
+ * `../../meta/types.ts`.
19
+ * @module
20
+ */
21
+ import type { Meta } from '../../meta/types.js';
22
+ import type { CDNType } from '@d-zero/shared/detect-cdn';
23
+ import type { CompressType } from '@d-zero/shared/detect-compress';
24
+ import type { ExURL } from '@d-zero/shared/parse-url';
25
+ /**
26
+ * Numeric outcome code for one device preset's `<img>` scan, mirroring
27
+ * `@d-zero/beholder`'s `ImageScanCode` (`IMAGE_SCAN_CODE`: 0=ok /
28
+ * 1=degraded / 2=nav-unsettled / 3=frame-lost / 4=scroll-height-exceeded /
29
+ * 255=unknown).
30
+ */
31
+ export type ImageScanCode = 0 | 1 | 2 | 3 | 4 | 255;
32
+ /**
33
+ * Scraped page data returned by the scraper after successfully processing a page.
34
+ */
35
+ export interface PageData {
36
+ /** The parsed URL of the page. */
37
+ url: ExURL;
38
+ /** Chain of redirect URLs traversed to reach the final destination. */
39
+ redirectPaths: string[];
40
+ /** Whether this page is a target page (internal and within the crawl scope). */
41
+ isTarget: boolean;
42
+ /** Whether this page is external to the crawl scope. */
43
+ isExternal: boolean;
44
+ /** HTTP status code of the response. */
45
+ status: number;
46
+ /** HTTP status text of the response. */
47
+ statusText: string;
48
+ /** The Content-Type header value, or `null` if unavailable. */
49
+ contentType: string | null;
50
+ /** The Content-Length header value in bytes, or `null` if unavailable. */
51
+ contentLength: number | null;
52
+ /** Raw HTTP response headers, or `null` if unavailable. */
53
+ responseHeaders: Record<string, string | string[] | undefined> | null;
54
+ /** Extracted metadata from the page (title, description, OGP, etc.). */
55
+ meta: Meta;
56
+ /** List of anchor elements found on the page. */
57
+ anchorList: AnchorData[];
58
+ /** List of image elements found on the page. */
59
+ imageList: ImageElement[];
60
+ /** HTML snapshot of the rendered DOM. */
61
+ html: string;
62
+ /**
63
+ * Quantitative main-content metrics extracted in the browser after load.
64
+ * `null` when the page is non-HTML, external, non-HTTP, or otherwise not fully scraped.
65
+ * When HTML is scraped but no main region is found, this is still an object with empty arrays and `wordCount: 0`.
66
+ */
67
+ mainContents: MainContentsData | null;
68
+ /**
69
+ * `document.body.scrollHeight` at desktop-compact and mobile-small viewports.
70
+ * `null` when not measured (non-HTML, external, non-HTTP, or skipped).
71
+ */
72
+ scrollHeight: ScrollHeightData | null;
73
+ /**
74
+ * Per-device-preset outcome of the `<img>` element scan performed by
75
+ * `Scraper#fetchImages`, keyed the same way as {@link ScrollHeightData}.
76
+ * A field is `null` when that device preset's image scan was never
77
+ * attempted (non-HTML, external, non-HTTP page, or `captureImages: false`);
78
+ * otherwise it is an {@link ImageScanCode} recording why the scan
79
+ * succeeded, degraded, or was abandoned. See `@d-zero/beholder`'s `IMAGE_SCAN_CODE`.
80
+ * @example
81
+ * ```ts
82
+ * if (pageData.imageScan.mobile === IMAGE_SCAN_CODE.SCROLL_HEIGHT_EXCEEDED) {
83
+ * // mobile images were skipped due to an oversized scrollHeight
84
+ * }
85
+ * ```
86
+ */
87
+ imageScan: ImageScanData;
88
+ /** Always `false` for successfully scraped pages. Skipped pages are never passed to the archive as `PageData`. */
89
+ isSkipped: false;
90
+ }
91
+ /**
92
+ * `document.body.scrollHeight` measured at the scraper's desktop and mobile device presets.
93
+ */
94
+ export interface ScrollHeightData {
95
+ /** Height at `desktop-compact` (width 1280), or `null` if that preset failed. */
96
+ desktop: number | null;
97
+ /** Height at `mobile-small` (width 320 @ 2x), or `null` if that preset failed. */
98
+ mobile: number | null;
99
+ }
100
+ /**
101
+ * Per-device-preset {@link ImageScanCode} outcome of `Scraper#fetchImages`,
102
+ * mirroring {@link ScrollHeightData}'s desktop/mobile shape.
103
+ */
104
+ export interface ImageScanData {
105
+ /** Outcome for `desktop-compact` (width 1280), or `null` if not attempted. */
106
+ desktop: ImageScanCode | null;
107
+ /** Outcome for `mobile-small` (width 320 @ 2x), or `null` if not attempted. */
108
+ mobile: ImageScanCode | null;
109
+ }
110
+ /**
111
+ * Quantitative metrics for the detected main content region of a page.
112
+ * @example
113
+ * ```ts
114
+ * const { mainContents } = pageData;
115
+ * if (mainContents) {
116
+ * console.log(mainContents.wordCount, mainContents.headings.length);
117
+ * }
118
+ * ```
119
+ */
120
+ export interface MainContentsData {
121
+ /** `document.title` trimmed. Empty string when the title is empty. */
122
+ title: string;
123
+ /**
124
+ * Identifying info for the detected main region element.
125
+ * `null` when no selector matched (arrays are empty and `wordCount` is `0`).
126
+ */
127
+ main: MainContentsMainTag | null;
128
+ /**
129
+ * Character count of the main region's `textContent` after whitespace removal.
130
+ * `0` when no main region was found or the text is whitespace-only.
131
+ */
132
+ wordCount: number;
133
+ /**
134
+ * Character count of `document.body` `textContent` after whitespace removal.
135
+ * Measured even when no main region is found (`0` if `body` is missing).
136
+ */
137
+ bodyWordCount: number;
138
+ /** Headings (`h1`–`h6`) inside the main region, in DOM order. */
139
+ headings: MainContentsHeading[];
140
+ /** Images (`img`, `input[type=image]`) inside the main region, in DOM order. */
141
+ images: MainContentsImage[];
142
+ /** Tables inside the main region, in DOM order. */
143
+ tables: MainContentsTable[];
144
+ /** Button-like elements inside the main region, in DOM order. */
145
+ buttons: MainContentsButton[];
146
+ /** Iframes inside the main region, in DOM order. */
147
+ iframes: MainContentsIframe[];
148
+ /** Videos inside the main region, in DOM order. */
149
+ videos: MainContentsVideo[];
150
+ /** Audios inside the main region, in DOM order. */
151
+ audios: MainContentsAudio[];
152
+ /** Canvases inside the main region, in DOM order. */
153
+ canvases: MainContentsCanvas[];
154
+ }
155
+ /**
156
+ * Identifying information about the DOM element used as the main content area.
157
+ */
158
+ export interface MainContentsMainTag {
159
+ /** Element tag name (e.g. `"MAIN"`, `"DIV"`), as reported by `nodeName`. */
160
+ nodeName: string;
161
+ /** The element's `id`, or `null` when empty/absent. */
162
+ id: string | null;
163
+ /** CSS class names on the element. */
164
+ classList: string[];
165
+ /** The WAI-ARIA `role` attribute value, or `null` when absent. */
166
+ role: string | null;
167
+ /**
168
+ * A simple diagnostic CSS selector built from tag + id + classes
169
+ * (not `@medv/finder`). // cspell:disable-line
170
+ */
171
+ selector: string;
172
+ }
173
+ /**
174
+ * A heading element (`h1`–`h6`) found within the main content area.
175
+ */
176
+ export interface MainContentsHeading {
177
+ /** Heading text after whitespace removal, or `null` when empty. */
178
+ text: string | null;
179
+ /** Heading level from the tag name. */
180
+ level: 1 | 2 | 3 | 4 | 5 | 6;
181
+ }
182
+ /**
183
+ * An `<img>` or `<input type="image">` element found in the main content.
184
+ */
185
+ export interface MainContentsImage {
186
+ /** Resolved absolute `src` URL. */
187
+ src: string;
188
+ /** `alt` attribute value (may be an empty string). */
189
+ alt: string;
190
+ }
191
+ /**
192
+ * Structural summary of a `<table>` found within the main content.
193
+ */
194
+ export interface MainContentsTable {
195
+ /** Number of `<tr>` elements. */
196
+ rows: number;
197
+ /** Number of `th`/`td` cells in the first row, or `0` when there is no row. */
198
+ cols: number;
199
+ /** Whether the table contains a `<thead>`. */
200
+ hasHeader: boolean;
201
+ /** Whether the table contains a `<tfoot>`. */
202
+ hasFooter: boolean;
203
+ /** Whether any cell uses `colspan` or `rowspan`. */
204
+ hasMergedCell: boolean;
205
+ }
206
+ /**
207
+ * A button-like element found in the main content
208
+ * (`button`, `[role=button]`, `[class*=button]`, `[class*=btn]`).
209
+ */
210
+ export interface MainContentsButton {
211
+ /** Element tag name (e.g. `"BUTTON"`, `"A"`, `"DIV"`). */
212
+ nodeName: string;
213
+ /** `role` attribute, or `null` when absent. */
214
+ role: string | null;
215
+ /** `type` for `<button>` / `<input>`, otherwise `null`. */
216
+ type: string | null;
217
+ /** Label text after whitespace removal, or `null` when empty. */
218
+ text: string | null;
219
+ /** `true` when `disabled` or `aria-disabled="true"`. */
220
+ disabled: boolean;
221
+ }
222
+ /**
223
+ * An `<iframe>` found in the main content.
224
+ */
225
+ export interface MainContentsIframe {
226
+ /** Resolved absolute `src` URL (empty string when unset). */
227
+ src: string;
228
+ /** `title` attribute, or `null` when the attribute is absent. */
229
+ title: string | null;
230
+ /** Raw `width` attribute string, or `null` when absent. */
231
+ width: string | null;
232
+ /** Raw `height` attribute string, or `null` when absent. */
233
+ height: string | null;
234
+ }
235
+ /**
236
+ * A `<video>` found in the main content.
237
+ */
238
+ export interface MainContentsVideo {
239
+ /**
240
+ * Resolved media URL: `currentSrc`, else `src` attribute, else first `source[src]`, else `""`.
241
+ */
242
+ src: string;
243
+ /** Resolved `poster` URL, or `null` when unset. */
244
+ poster: string | null;
245
+ /** IDL `width` in pixels. */
246
+ width: number;
247
+ /** IDL `height` in pixels. */
248
+ height: number;
249
+ }
250
+ /**
251
+ * An `<audio>` found in the main content.
252
+ */
253
+ export interface MainContentsAudio {
254
+ /**
255
+ * Resolved media URL: `currentSrc`, else `src` attribute, else first `source[src]`, else `""`.
256
+ */
257
+ src: string;
258
+ }
259
+ /**
260
+ * A `<canvas>` found in the main content.
261
+ */
262
+ export interface MainContentsCanvas {
263
+ /** IDL bitmap width. */
264
+ width: number;
265
+ /** IDL bitmap height. */
266
+ height: number;
267
+ }
268
+ /**
269
+ * Information about an image element found on a page.
270
+ */
271
+ export interface ImageElement {
272
+ /** The `src` attribute value of the image element. */
273
+ src: string;
274
+ /** The `currentSrc` property value (the actual URL loaded by the browser). */
275
+ currentSrc: string;
276
+ /** The `alt` attribute value of the image element. */
277
+ alt: string;
278
+ /** The CSS layout width of the image in pixels. */
279
+ width: number;
280
+ /** The CSS layout height of the image in pixels. */
281
+ height: number;
282
+ /** The intrinsic width of the image in pixels. */
283
+ naturalWidth: number;
284
+ /** The intrinsic height of the image in pixels. */
285
+ naturalHeight: number;
286
+ /** Whether the image uses lazy loading (`loading="lazy"` or IntersectionObserver). */
287
+ isLazy: boolean;
288
+ /** The viewport width at which this image was captured. */
289
+ viewportWidth: number;
290
+ /** The outer HTML source code of the image element. */
291
+ sourceCode: string;
292
+ }
293
+ /**
294
+ * A network resource (CSS, JS, image, etc.) captured during page scraping.
295
+ */
296
+ export interface Resource {
297
+ /** The URL of the resource. */
298
+ url: ExURL;
299
+ /** Whether the resource is from an external domain. */
300
+ isExternal: boolean;
301
+ /** Whether the resource request resulted in an error. */
302
+ isError: boolean;
303
+ /** HTTP status code, or `null` if the request failed. */
304
+ status: number | null;
305
+ /** HTTP status text, or `null` if the request failed. */
306
+ statusText: string | null;
307
+ /** The Content-Type header value, or `null` if unavailable. */
308
+ contentType: string | null;
309
+ /** The Content-Length header value in bytes, or `null` if unavailable. */
310
+ contentLength: number | null;
311
+ /** The compression algorithm used, or `false` if uncompressed. */
312
+ compress: false | CompressType;
313
+ /** The CDN provider detected from response headers, or `false` if none detected. */
314
+ cdn: false | CDNType;
315
+ /** Raw HTTP response headers, or `null` if unavailable. */
316
+ headers: Record<string, string | string[] | undefined> | null;
317
+ }
318
+ /**
319
+ * Data extracted from an anchor element (`<a>` or `<area>`) on a page.
320
+ */
321
+ export interface AnchorData {
322
+ /**
323
+ * Extracts the value of the `href` attribute from anchor element (`<a>` `<area>`)
324
+ */
325
+ href: ExURL;
326
+ /**
327
+ * The accessible name of the anchor element
328
+ */
329
+ textContent: string;
330
+ /**
331
+ * Whether the anchor points to an external URL.
332
+ * Set by `processAnchors()` in the crawler; not available in the sub-process.
333
+ */
334
+ isExternal?: boolean;
335
+ }
336
+ /**
337
+ * A single console message or uncaught page error captured during page scraping.
338
+ * Captured via Puppeteer's `console` and `pageerror` page events; internal pages only.
339
+ */
340
+ export interface ConsoleLogEntry {
341
+ /** The URL (without hash) of the page that produced this message. */
342
+ pageUrl: string;
343
+ /**
344
+ * The console message type (Puppeteer's `ConsoleMessageType`, e.g. `"log"`, `"warn"`, `"error"`),
345
+ * or `"pageerror"` for an uncaught exception / unhandled Promise rejection.
346
+ * Widened to `string` so the archive does not depend on `puppeteer`.
347
+ */
348
+ type: string;
349
+ /** The message text, or the error's `message` for `"pageerror"` entries. */
350
+ text: string;
351
+ /**
352
+ * Arguments passed to the console call, resolved via `JSHandle.jsonValue()`.
353
+ * An individual argument is `undefined` when it could not be resolved (e.g. a
354
+ * destroyed execution context or a value `jsonValue()` cannot serialize).
355
+ * Always empty for `"pageerror"` entries.
356
+ */
357
+ args: unknown[];
358
+ /** Source location of the message, or `undefined` when unavailable (always `undefined` for `"pageerror"`). */
359
+ location?: {
360
+ url?: string;
361
+ lineNumber?: number;
362
+ columnNumber?: number;
363
+ };
364
+ /** Stack trace text, present only for `"pageerror"` entries. */
365
+ stack?: string;
366
+ /** Timestamp (ms since epoch) when the message was captured. */
367
+ ts: number;
368
+ }
369
+ /**
370
+ * An error event emitted during crawling or scraping.
371
+ */
372
+ export interface CrawlerError {
373
+ /** The process ID where the error occurred. */
374
+ pid: number;
375
+ /** Whether the error occurred in the main process (as opposed to a sub-process). */
376
+ isMainProcess: boolean;
377
+ /** The URL being processed when the error occurred, or `null` if not applicable. */
378
+ url: string | null;
379
+ /** Whether the error occurred while processing an external (out-of-scope) URL. */
380
+ isExternal: boolean;
381
+ /** The error object. */
382
+ error: Error;
383
+ }
@@ -0,0 +1 @@
1
+ export {};