@nitpicker/archive 0.0.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 (739) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +106 -0
  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 +1055 -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 +803 -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 +45 -0
  315. package/lib/filesystem/parse-tar-size-field.d.ts +13 -0
  316. package/lib/filesystem/parse-tar-size-field.js +37 -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 +132 -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/compare-strings.d.ts +12 -0
  576. package/lib/test-utils/compare-strings.js +14 -0
  577. package/lib/test-utils/create-legacy-analysis-tables.d.ts +13 -0
  578. package/lib/test-utils/create-legacy-analysis-tables.js +37 -0
  579. package/lib/test-utils/fk-parent-tables.d.ts +15 -0
  580. package/lib/test-utils/fk-parent-tables.js +19 -0
  581. package/lib/test-utils/seed-content-item.d.ts +35 -0
  582. package/lib/test-utils/seed-content-item.js +42 -0
  583. package/lib/test-utils/setup-legacy-fk-db.d.ts +34 -0
  584. package/lib/test-utils/setup-legacy-fk-db.js +271 -0
  585. package/lib/transfer/attach-source-database.d.ts +31 -0
  586. package/lib/transfer/attach-source-database.js +40 -0
  587. package/lib/transfer/build-split-config.d.ts +30 -0
  588. package/lib/transfer/build-split-config.js +42 -0
  589. package/lib/transfer/clear-replaced-page-rows.d.ts +23 -0
  590. package/lib/transfer/clear-replaced-page-rows.js +61 -0
  591. package/lib/transfer/concat-archives.d.ts +55 -0
  592. package/lib/transfer/concat-archives.js +95 -0
  593. package/lib/transfer/concat-source-transfer-phases.d.ts +10 -0
  594. package/lib/transfer/concat-source-transfer-phases.js +17 -0
  595. package/lib/transfer/content-item-rank-sql.d.ts +21 -0
  596. package/lib/transfer/content-item-rank-sql.js +23 -0
  597. package/lib/transfer/copy-anchor-edges.d.ts +28 -0
  598. package/lib/transfer/copy-anchor-edges.js +42 -0
  599. package/lib/transfer/copy-dictionaries-for-concat.d.ts +39 -0
  600. package/lib/transfer/copy-dictionaries-for-concat.js +81 -0
  601. package/lib/transfer/copy-dictionaries-for-split.d.ts +29 -0
  602. package/lib/transfer/copy-dictionaries-for-split.js +224 -0
  603. package/lib/transfer/copy-header-set-children.d.ts +27 -0
  604. package/lib/transfer/copy-header-set-children.js +51 -0
  605. package/lib/transfer/copy-image-items.d.ts +21 -0
  606. package/lib/transfer/copy-image-items.js +62 -0
  607. package/lib/transfer/copy-inventory-source-lists.d.ts +30 -0
  608. package/lib/transfer/copy-inventory-source-lists.js +61 -0
  609. package/lib/transfer/copy-journal-tables.d.ts +30 -0
  610. package/lib/transfer/copy-journal-tables.js +56 -0
  611. package/lib/transfer/copy-page-console-logs.d.ts +16 -0
  612. package/lib/transfer/copy-page-console-logs.js +27 -0
  613. package/lib/transfer/copy-page-html-blobs.d.ts +31 -0
  614. package/lib/transfer/copy-page-html-blobs.js +43 -0
  615. package/lib/transfer/copy-page-meta.d.ts +27 -0
  616. package/lib/transfer/copy-page-meta.js +68 -0
  617. package/lib/transfer/copy-page-template-clusters.d.ts +31 -0
  618. package/lib/transfer/copy-page-template-clusters.js +56 -0
  619. package/lib/transfer/copy-page-template-labels.d.ts +34 -0
  620. package/lib/transfer/copy-page-template-labels.js +88 -0
  621. package/lib/transfer/copy-resource-items.d.ts +29 -0
  622. package/lib/transfer/copy-resource-items.js +89 -0
  623. package/lib/transfer/copy-resource-ref-edges.d.ts +20 -0
  624. package/lib/transfer/copy-resource-ref-edges.js +33 -0
  625. package/lib/transfer/copy-simple-page-scoped-tables.d.ts +15 -0
  626. package/lib/transfer/copy-simple-page-scoped-tables.js +34 -0
  627. package/lib/transfer/count-external-pages-in-scope.d.ts +26 -0
  628. package/lib/transfer/count-external-pages-in-scope.js +40 -0
  629. package/lib/transfer/create-transfer-temp-tables.d.ts +30 -0
  630. package/lib/transfer/create-transfer-temp-tables.js +59 -0
  631. package/lib/transfer/dictionary-copy-specs.d.ts +32 -0
  632. package/lib/transfer/dictionary-copy-specs.js +28 -0
  633. package/lib/transfer/drop-transfer-temp-tables.d.ts +9 -0
  634. package/lib/transfer/drop-transfer-temp-tables.js +18 -0
  635. package/lib/transfer/flatten-redirect-chains.d.ts +44 -0
  636. package/lib/transfer/flatten-redirect-chains.js +74 -0
  637. package/lib/transfer/insert-content-items.d.ts +35 -0
  638. package/lib/transfer/insert-content-items.js +116 -0
  639. package/lib/transfer/list-transfer-columns.d.ts +35 -0
  640. package/lib/transfer/list-transfer-columns.js +45 -0
  641. package/lib/transfer/mark-in-scope-content-items.d.ts +31 -0
  642. package/lib/transfer/mark-in-scope-content-items.js +54 -0
  643. package/lib/transfer/merge-archive-configs.d.ts +51 -0
  644. package/lib/transfer/merge-archive-configs.js +85 -0
  645. package/lib/transfer/plan-content-items-for-concat.d.ts +33 -0
  646. package/lib/transfer/plan-content-items-for-concat.js +51 -0
  647. package/lib/transfer/plan-content-items-for-split.d.ts +42 -0
  648. package/lib/transfer/plan-content-items-for-split.js +83 -0
  649. package/lib/transfer/plan-resource-items.d.ts +40 -0
  650. package/lib/transfer/plan-resource-items.js +69 -0
  651. package/lib/transfer/quote-transfer-identifier.d.ts +18 -0
  652. package/lib/transfer/quote-transfer-identifier.js +20 -0
  653. package/lib/transfer/reclassify-resource-externality.d.ts +37 -0
  654. package/lib/transfer/reclassify-resource-externality.js +66 -0
  655. package/lib/transfer/remap-redirect-dest-ids.d.ts +34 -0
  656. package/lib/transfer/remap-redirect-dest-ids.js +51 -0
  657. package/lib/transfer/replace-content-items.d.ts +39 -0
  658. package/lib/transfer/replace-content-items.js +83 -0
  659. package/lib/transfer/simple-page-scoped-tables.d.ts +25 -0
  660. package/lib/transfer/simple-page-scoped-tables.js +38 -0
  661. package/lib/transfer/split-archive.d.ts +55 -0
  662. package/lib/transfer/split-archive.js +98 -0
  663. package/lib/transfer/split-source-transfer-phases.d.ts +11 -0
  664. package/lib/transfer/split-source-transfer-phases.js +18 -0
  665. package/lib/transfer/transfer-action.d.ts +34 -0
  666. package/lib/transfer/transfer-action.js +32 -0
  667. package/lib/transfer/transfer-archive-rows.d.ts +65 -0
  668. package/lib/transfer/transfer-archive-rows.js +156 -0
  669. package/lib/transfer/transfer-dictionary-tables.d.ts +12 -0
  670. package/lib/transfer/transfer-dictionary-tables.js +22 -0
  671. package/lib/transfer/transfer-post-phases.d.ts +10 -0
  672. package/lib/transfer/transfer-post-phases.js +13 -0
  673. package/lib/transfer/transfer-source-alias.d.ts +9 -0
  674. package/lib/transfer/transfer-source-alias.js +9 -0
  675. package/lib/transfer/types.d.ts +111 -0
  676. package/lib/transfer/types.js +35 -0
  677. package/lib/types.d.ts +772 -0
  678. package/lib/types.js +1 -0
  679. package/lib/url-alias/compute-tier-a-alias-key.d.ts +44 -0
  680. package/lib/url-alias/compute-tier-a-alias-key.js +47 -0
  681. package/lib/url-alias/compute-tier-b-alias-key.d.ts +23 -0
  682. package/lib/url-alias/compute-tier-b-alias-key.js +26 -0
  683. package/lib/url-alias/group-alias-candidates.d.ts +27 -0
  684. package/lib/url-alias/group-alias-candidates.js +29 -0
  685. package/lib/url-alias/types.d.ts +12 -0
  686. package/lib/url-alias/types.js +1 -0
  687. package/lib/url-pattern/compute-shape-key.d.ts +58 -0
  688. package/lib/url-pattern/compute-shape-key.js +129 -0
  689. package/lib/url-pattern/decompose-url.d.ts +33 -0
  690. package/lib/url-pattern/decompose-url.js +79 -0
  691. package/lib/url-pattern/reconstruct-url.d.ts +15 -0
  692. package/lib/url-pattern/reconstruct-url.js +33 -0
  693. package/lib/url-sort/compute-url-sort-ranks.d.ts +30 -0
  694. package/lib/url-sort/compute-url-sort-ranks.js +33 -0
  695. package/lib/utils/array/each-splitted.d.ts +10 -0
  696. package/lib/utils/array/each-splitted.js +14 -0
  697. package/lib/utils/debug.d.ts +8 -0
  698. package/lib/utils/debug.js +8 -0
  699. package/lib/utils/error/emit-error-with-retry.d.ts +40 -0
  700. package/lib/utils/error/emit-error-with-retry.js +44 -0
  701. package/lib/utils/error/emit-error.d.ts +39 -0
  702. package/lib/utils/error/emit-error.js +41 -0
  703. package/lib/utils/object/parse-response-headers.d.ts +12 -0
  704. package/lib/utils/object/parse-response-headers.js +26 -0
  705. package/lib/utils/object/redact-request-headers.d.ts +15 -0
  706. package/lib/utils/object/redact-request-headers.js +27 -0
  707. package/lib/utils/types/types.d.ts +383 -0
  708. package/lib/utils/types/types.js +1 -0
  709. package/lib/verify-migration/capture-rejection.d.ts +24 -0
  710. package/lib/verify-migration/capture-rejection.js +31 -0
  711. package/lib/verify-migration/check-anchor-edges-count.d.ts +34 -0
  712. package/lib/verify-migration/check-anchor-edges-count.js +72 -0
  713. package/lib/verify-migration/check-anchor-edges-sum.d.ts +13 -0
  714. package/lib/verify-migration/check-anchor-edges-sum.js +27 -0
  715. package/lib/verify-migration/check-content-items-count.d.ts +16 -0
  716. package/lib/verify-migration/check-content-items-count.js +30 -0
  717. package/lib/verify-migration/check-content-type-preservation.d.ts +22 -0
  718. package/lib/verify-migration/check-content-type-preservation.js +40 -0
  719. package/lib/verify-migration/check-foreign-key-integrity.d.ts +31 -0
  720. package/lib/verify-migration/check-foreign-key-integrity.js +47 -0
  721. package/lib/verify-migration/check-image-items-count.d.ts +12 -0
  722. package/lib/verify-migration/check-image-items-count.js +26 -0
  723. package/lib/verify-migration/check-page-meta-count.d.ts +15 -0
  724. package/lib/verify-migration/check-page-meta-count.js +31 -0
  725. package/lib/verify-migration/check-reader-parity.d.ts +23 -0
  726. package/lib/verify-migration/check-reader-parity.js +182 -0
  727. package/lib/verify-migration/check-resource-items-count.d.ts +17 -0
  728. package/lib/verify-migration/check-resource-items-count.js +33 -0
  729. package/lib/verify-migration/check-url-round-trip.d.ts +43 -0
  730. package/lib/verify-migration/check-url-round-trip.js +112 -0
  731. package/lib/verify-migration/types.d.ts +70 -0
  732. package/lib/verify-migration/types.js +63 -0
  733. package/lib/verify-migration/verify-migration.d.ts +41 -0
  734. package/lib/verify-migration/verify-migration.js +120 -0
  735. package/lib/with-bulk-write-pragmas.d.ts +51 -0
  736. package/lib/with-bulk-write-pragmas.js +132 -0
  737. package/lib/write-queue.d.ts +32 -0
  738. package/lib/write-queue.js +55 -0
  739. package/package.json +350 -3
@@ -0,0 +1,1490 @@
1
+ /**
2
+ * Shared type definitions for archive-side meta processing helpers under {@link ./}.
3
+ *
4
+ * Mirrors the shape of {@link Meta} after archive-side
5
+ * derivation: flat columns persisted to the `pages` table, denormalised
6
+ * aggregates, per-row shapes for `page_jsonld` / `page_tags`, and the summary
7
+ * objects returned by `get-page-detail` consumers.
8
+ * @module
9
+ */
10
+ /**
11
+ * Flat columns of the `pages` table derived from {@link Meta}.
12
+ *
13
+ * Each field maps to a single SQL column (string / number / boolean / null).
14
+ * URL-shaped columns are absolutised by the deriver before persistence so
15
+ * downstream consumers (e.g. `find-mismatches`) can compare against the
16
+ * absolute page URL directly.
17
+ * @see derive-flat-from-meta.ts
18
+ * @example
19
+ * // A `pages` row projected onto (a subset of) its flat meta columns:
20
+ * const meta: Partial<FlatPageMetaColumns> = {
21
+ * title: 'Home',
22
+ * canonical: 'https://example.com/',
23
+ * robots_noindex: 0,
24
+ * og_type: 'website',
25
+ * };
26
+ */
27
+ export interface FlatPageMetaColumns {
28
+ lang: string | null;
29
+ dir: string | null;
30
+ charset: string | null;
31
+ baseHref: string | null;
32
+ viewport_raw: string | null;
33
+ themeColor: string | null;
34
+ applicationName: string | null;
35
+ author: string | null;
36
+ generator: string | null;
37
+ publisher: string | null;
38
+ robots_raw: string | null;
39
+ robots_noindex: number | null;
40
+ robots_nofollow: number | null;
41
+ robots_noarchive: number | null;
42
+ robots_noimageindex: number | null;
43
+ googlebot: string | null;
44
+ canonical: string | null;
45
+ amphtml: string | null;
46
+ manifest: string | null;
47
+ icon_href: string | null;
48
+ appleTouchIcon_href: string | null;
49
+ og_type: string | null;
50
+ og_title: string | null;
51
+ og_url: string | null;
52
+ og_site_name: string | null;
53
+ og_description: string | null;
54
+ og_image: string | null;
55
+ og_image_alt: string | null;
56
+ og_image_width: string | null;
57
+ og_image_height: string | null;
58
+ og_locale: string | null;
59
+ og_article_published_time: string | null;
60
+ og_article_modified_time: string | null;
61
+ twitter_card: string | null;
62
+ twitter_site: string | null;
63
+ twitter_creator: string | null;
64
+ twitter_title: string | null;
65
+ twitter_description: string | null;
66
+ twitter_image: string | null;
67
+ fb_app_id: string | null;
68
+ verification_google: string | null;
69
+ formatDetection_telephone: number | null;
70
+ title: string | null;
71
+ description: string | null;
72
+ keywords: string | null;
73
+ }
74
+ /**
75
+ * Denormalised aggregates computed at write time from `meta.tags` / `meta.jsonLd`.
76
+ *
77
+ * Stored on the `pages` table so list / report read paths can avoid joining
78
+ * `page_tags` / `page_jsonld` for the common "how many?" and "which
79
+ * providers?" questions.
80
+ * @see compute-page-denormalized.ts
81
+ * @example
82
+ * const denorm: PageDenormalizedColumns = {
83
+ * tag_count: 3,
84
+ * jsonld_count: 1,
85
+ * tags_providers_csv: 'Google Analytics,Google Tag Manager',
86
+ * };
87
+ */
88
+ export interface PageDenormalizedColumns {
89
+ /** Total Wappalyzer tag entries for the page. */
90
+ tag_count: number;
91
+ /** `meta.jsonLd.length + meta.speculationRules.length`. */
92
+ jsonld_count: number;
93
+ /** Sorted unique providers, comma-separated (empty string when no tags). */
94
+ tags_providers_csv: string;
95
+ }
96
+ /**
97
+ * Denormalised aggregates computed at write time from beholder's
98
+ * `MainContentsData` / `ScrollHeightData`.
99
+ *
100
+ * Stored on `page_meta` following the same pattern as
101
+ * {@link PageDenormalizedColumns} (`tag_count` / `jsonld_count`): the full
102
+ * per-element detail lives in the `page_main_content_*` child tables, while
103
+ * these scalar columns let list / detail reads answer "how many headings?"
104
+ * without joining them. All fields are `null` when the page was not fully
105
+ * rendered (external / non-HTML / metadata-only scrape) — see
106
+ * `compute-main-contents-denormalized.ts` for the `null`-in-null-out contract.
107
+ * @see compute-main-contents-denormalized.ts
108
+ * @example
109
+ * const denorm: MainContentsDenormalizedColumns = {
110
+ * main_content_node_name: 'MAIN',
111
+ * main_content_id: null,
112
+ * main_content_role: null,
113
+ * main_content_selector: 'main.l-main',
114
+ * main_content_class_list: '["l-main"]',
115
+ * main_content_word_count: 1240,
116
+ * main_content_body_word_count: 1580,
117
+ * main_content_heading_count: 6,
118
+ * main_content_image_count: 3,
119
+ * main_content_table_count: 0,
120
+ * main_content_button_count: 1,
121
+ * main_content_iframe_count: 0,
122
+ * main_content_video_count: 0,
123
+ * main_content_audio_count: 0,
124
+ * main_content_canvas_count: 0,
125
+ * main_content_custom_element_count: 0,
126
+ * scroll_height_desktop: 3200,
127
+ * scroll_height_mobile: 5400,
128
+ * image_scan_desktop: 0,
129
+ * image_scan_mobile: 1,
130
+ * };
131
+ */
132
+ export interface MainContentsDenormalizedColumns {
133
+ /** Detected main-content element's `nodeName` (e.g. `'MAIN'`), or `null`. */
134
+ main_content_node_name: string | null;
135
+ /** Detected main-content element's `id`, or `null`. */
136
+ main_content_id: string | null;
137
+ /** Detected main-content element's `role` attribute, or `null`. */
138
+ main_content_role: string | null;
139
+ /** Diagnostic tag+id+class selector for the detected element, or `null`. */
140
+ main_content_selector: string | null;
141
+ /** JSON-encoded array of the detected element's CSS classes, or `null`. */
142
+ main_content_class_list: string | null;
143
+ /** Character count of the main region's text content, or `null`. */
144
+ main_content_word_count: number | null;
145
+ /** Character count of `document.body`'s text content, or `null`. */
146
+ main_content_body_word_count: number | null;
147
+ /** Number of headings within the main region, or `null`. */
148
+ main_content_heading_count: number | null;
149
+ /** Number of images within the main region, or `null`. */
150
+ main_content_image_count: number | null;
151
+ /** Number of tables within the main region, or `null`. */
152
+ main_content_table_count: number | null;
153
+ /** Number of button-like elements within the main region, or `null`. */
154
+ main_content_button_count: number | null;
155
+ /** Number of iframes within the main region, or `null`. */
156
+ main_content_iframe_count: number | null;
157
+ /** Number of videos within the main region, or `null`. */
158
+ main_content_video_count: number | null;
159
+ /** Number of audios within the main region, or `null`. */
160
+ main_content_audio_count: number | null;
161
+ /** Number of canvases within the main region, or `null`. */
162
+ main_content_canvas_count: number | null;
163
+ /**
164
+ * Number of Web Components (custom elements) within the main region, or
165
+ * `null`. Unlike its siblings above, `null` is not solely "page not
166
+ * rendered" — it also covers "rendered, but nitpicker's own
167
+ * `captureCustomElements` best-effort capture failed" (a distinct state
168
+ * from "captured, zero found" = `0`), since this column is not sourced
169
+ * from beholder's `MainContentsData` at all. See
170
+ * `compute-main-contents-denormalized.ts`.
171
+ */
172
+ main_content_custom_element_count: number | null;
173
+ /** `document.body.scrollHeight` at the desktop-compact preset, or `null`. */
174
+ scroll_height_desktop: number | null;
175
+ /** `document.body.scrollHeight` at the mobile-small preset, or `null`. */
176
+ scroll_height_mobile: number | null;
177
+ /**
178
+ * `@d-zero/beholder`'s `IMAGE_SCAN_CODE` outcome for the desktop-compact
179
+ * `<img>` element scan (0=ok, 1=degraded, 2=nav-unsettled, 3=frame-lost,
180
+ * 4=scroll-height-exceeded, 255=unknown), or `null` when not attempted
181
+ * (page not fully rendered, or the archive predates this column).
182
+ */
183
+ image_scan_desktop: number | null;
184
+ /** Same as {@link MainContentsDenormalizedColumns.image_scan_desktop}, for the mobile-small preset. */
185
+ image_scan_mobile: number | null;
186
+ }
187
+ /**
188
+ * Per-viewport `@d-zero/beholder` `IMAGE_SCAN_CODE` outcome, as passed into
189
+ * `computeMainContentsDenormalized`. Deliberately plain `number | null`
190
+ * rather than beholder's `ImageScanCode` type — this shape is written by
191
+ * `@nitpicker/archive` independently of which `@d-zero/beholder` version is
192
+ * currently installed (see `compute-main-contents-denormalized.ts`).
193
+ */
194
+ export interface ImageScanColumns {
195
+ /** Outcome for the desktop-compact viewport, or `null` when not attempted. */
196
+ desktop: number | null;
197
+ /** Outcome for the mobile-small viewport, or `null` when not attempted. */
198
+ mobile: number | null;
199
+ }
200
+ /**
201
+ * One row in the `page_main_content_headings` table.
202
+ * @example
203
+ * const row: MainContentHeadingRow = { id: 1, pageId: 42, order: 0, text: 'Welcome', level: 1 };
204
+ */
205
+ export interface MainContentHeadingRow {
206
+ /** Auto-increment primary key. */
207
+ id: number;
208
+ /** FK to `content_items.id`. */
209
+ pageId: number;
210
+ /** 0-based DOM traversal order within the main content region. */
211
+ order: number;
212
+ /** Heading text after whitespace removal, or `null` when empty. */
213
+ text: string | null;
214
+ /** Heading level (1-6) from the tag name. */
215
+ level: 1 | 2 | 3 | 4 | 5 | 6;
216
+ }
217
+ /**
218
+ * One row in the `page_main_content_images` table.
219
+ * @example
220
+ * const row: MainContentImageRow = {
221
+ * id: 1,
222
+ * pageId: 42,
223
+ * order: 0,
224
+ * src: 'https://example.com/a.png',
225
+ * alt: 'A photo',
226
+ * };
227
+ */
228
+ export interface MainContentImageRow {
229
+ /** Auto-increment primary key. */
230
+ id: number;
231
+ /** FK to `content_items.id`. */
232
+ pageId: number;
233
+ /** 0-based DOM traversal order within the main content region. */
234
+ order: number;
235
+ /** Resolved absolute `src` URL. */
236
+ src: string;
237
+ /** `alt` attribute value (may be an empty string). */
238
+ alt: string;
239
+ }
240
+ /**
241
+ * One row in the `page_main_content_tables` table.
242
+ * @example
243
+ * const row: MainContentTableRow = {
244
+ * id: 1,
245
+ * pageId: 42,
246
+ * order: 0,
247
+ * rows: 3,
248
+ * cols: 4,
249
+ * hasHeader: 1,
250
+ * hasFooter: 0,
251
+ * hasMergedCell: 0,
252
+ * };
253
+ */
254
+ export interface MainContentTableRow {
255
+ /** Auto-increment primary key. */
256
+ id: number;
257
+ /** FK to `content_items.id`. */
258
+ pageId: number;
259
+ /** 0-based DOM traversal order within the main content region. */
260
+ order: number;
261
+ /** Number of `<tr>` elements. */
262
+ rows: number;
263
+ /** Number of `th`/`td` cells in the first row. */
264
+ cols: number;
265
+ /** Whether the table contains a `<thead>` (raw SQLite 0/1; knex does not round-trip `.boolean()` columns back to JS `boolean` on read). */
266
+ hasHeader: 0 | 1;
267
+ /** Whether the table contains a `<tfoot>` (raw SQLite 0/1). */
268
+ hasFooter: 0 | 1;
269
+ /** Whether any cell uses `colspan` or `rowspan` (raw SQLite 0/1). */
270
+ hasMergedCell: 0 | 1;
271
+ }
272
+ /**
273
+ * One row in the `page_main_content_buttons` table.
274
+ * @example
275
+ * const row: MainContentButtonRow = {
276
+ * id: 1,
277
+ * pageId: 42,
278
+ * order: 0,
279
+ * nodeName: 'BUTTON',
280
+ * role: null,
281
+ * type: 'submit',
282
+ * text: 'Send',
283
+ * disabled: 0,
284
+ * };
285
+ */
286
+ export interface MainContentButtonRow {
287
+ /** Auto-increment primary key. */
288
+ id: number;
289
+ /** FK to `content_items.id`. */
290
+ pageId: number;
291
+ /** 0-based DOM traversal order within the main content region. */
292
+ order: number;
293
+ /** Element tag name (e.g. `'BUTTON'`, `'A'`, `'DIV'`). */
294
+ nodeName: string;
295
+ /** `role` attribute, or `null` when absent. */
296
+ role: string | null;
297
+ /** `type` for `<button>` / `<input>`, otherwise `null`. */
298
+ type: string | null;
299
+ /** Label text after whitespace removal, or `null` when empty. */
300
+ text: string | null;
301
+ /** `true` when `disabled` or `aria-disabled="true"` (raw SQLite 0/1). */
302
+ disabled: 0 | 1;
303
+ }
304
+ /**
305
+ * One row in the `page_main_content_iframes` table.
306
+ * @example
307
+ * const row: MainContentIframeRow = {
308
+ * id: 1,
309
+ * pageId: 42,
310
+ * order: 0,
311
+ * src: 'https://example.com/embed',
312
+ * title: null,
313
+ * width: '640',
314
+ * height: '360',
315
+ * };
316
+ */
317
+ export interface MainContentIframeRow {
318
+ /** Auto-increment primary key. */
319
+ id: number;
320
+ /** FK to `content_items.id`. */
321
+ pageId: number;
322
+ /** 0-based DOM traversal order within the main content region. */
323
+ order: number;
324
+ /** Resolved absolute `src` URL. */
325
+ src: string;
326
+ /** `title` attribute, or `null` when absent. */
327
+ title: string | null;
328
+ /** Raw `width` attribute string, or `null` when absent. */
329
+ width: string | null;
330
+ /** Raw `height` attribute string, or `null` when absent. */
331
+ height: string | null;
332
+ }
333
+ /**
334
+ * One row in the `page_main_content_videos` table.
335
+ * @example
336
+ * const row: MainContentVideoRow = {
337
+ * id: 1,
338
+ * pageId: 42,
339
+ * order: 0,
340
+ * src: 'https://example.com/v.mp4',
341
+ * poster: null,
342
+ * width: 640,
343
+ * height: 360,
344
+ * };
345
+ */
346
+ export interface MainContentVideoRow {
347
+ /** Auto-increment primary key. */
348
+ id: number;
349
+ /** FK to `content_items.id`. */
350
+ pageId: number;
351
+ /** 0-based DOM traversal order within the main content region. */
352
+ order: number;
353
+ /** Resolved media URL. */
354
+ src: string;
355
+ /** Resolved `poster` URL, or `null` when unset. */
356
+ poster: string | null;
357
+ /** IDL `width` in pixels. */
358
+ width: number;
359
+ /** IDL `height` in pixels. */
360
+ height: number;
361
+ }
362
+ /**
363
+ * One row in the `page_main_content_audios` table.
364
+ * @example
365
+ * const row: MainContentAudioRow = { id: 1, pageId: 42, order: 0, src: 'https://example.com/a.mp3' };
366
+ */
367
+ export interface MainContentAudioRow {
368
+ /** Auto-increment primary key. */
369
+ id: number;
370
+ /** FK to `content_items.id`. */
371
+ pageId: number;
372
+ /** 0-based DOM traversal order within the main content region. */
373
+ order: number;
374
+ /** Resolved media URL. */
375
+ src: string;
376
+ }
377
+ /**
378
+ * One row in the `page_main_content_canvases` table.
379
+ * @example
380
+ * const row: MainContentCanvasRow = { id: 1, pageId: 42, order: 0, width: 300, height: 150 };
381
+ */
382
+ export interface MainContentCanvasRow {
383
+ /** Auto-increment primary key. */
384
+ id: number;
385
+ /** FK to `content_items.id`. */
386
+ pageId: number;
387
+ /** 0-based DOM traversal order within the main content region. */
388
+ order: number;
389
+ /** IDL bitmap width. */
390
+ width: number;
391
+ /** IDL bitmap height. */
392
+ height: number;
393
+ }
394
+ /**
395
+ * One row in the `page_main_content_custom_elements` table. Unlike its
396
+ * seven `MainContentXxxRow` siblings, the source data is not beholder's
397
+ * `MainContentsData` but nitpicker's own `capture-custom-elements.ts`.
398
+ * @example
399
+ * const row: MainContentCustomElementRow = { id: 1, pageId: 42, order: 0, nodeName: 'MY-WIDGET', elementId: 'widget-1', classList: '["foo"]' };
400
+ */
401
+ export interface MainContentCustomElementRow {
402
+ /** Auto-increment primary key. */
403
+ id: number;
404
+ /** FK to `content_items.id`. */
405
+ pageId: number;
406
+ /** 0-based DOM traversal order within the main content region. */
407
+ order: number;
408
+ /** The element's `nodeName` (e.g. `'MY-WIDGET'`). */
409
+ nodeName: string;
410
+ /** The element's `id` attribute, or `null`. */
411
+ elementId: string | null;
412
+ /** JSON-encoded array of the element's CSS classes, or `null`. */
413
+ classList: string | null;
414
+ }
415
+ /**
416
+ * One row in the `page_jsonld` table.
417
+ *
418
+ * Captures both `<script type="application/ld+json">` (`kind = 'ld+json'`) and
419
+ * `<script type="speculationrules">` (`kind = 'speculationrules'`) entries.
420
+ * @see extract-tags-for-archive.ts (sibling for tags) and the table definition
421
+ * in `archive/init-schema.ts`.
422
+ * @example
423
+ * const row: JsonLdRow = {
424
+ * id: 1,
425
+ * pageId: 42,
426
+ * kind: 'ld+json',
427
+ * type: 'Article',
428
+ * raw: '{"@type":"Article","headline":"Hello"}',
429
+ * parsed: { '@type': 'Article', headline: 'Hello' },
430
+ * parseError: null,
431
+ * };
432
+ */
433
+ export interface JsonLdRow {
434
+ /** Auto-increment primary key. */
435
+ id: number;
436
+ /** FK to `pages.id`. */
437
+ pageId: number;
438
+ /** `'ld+json'` for `application/ld+json` scripts, `'speculationrules'` for speculation rules. */
439
+ kind: 'ld+json' | 'speculationrules';
440
+ /** Top-level `@type` extracted from `parsed`, normalised to a single string. `null` when missing / unparseable. */
441
+ type: string | null;
442
+ /** Original script text content (uncompressed; SQLite overflow pages handle large rows). */
443
+ raw: string;
444
+ /** Parsed JSON object (`null` when `parseError` is set). */
445
+ parsed: unknown;
446
+ /** Parse error message preserved from beholder; `null` when the entry parsed cleanly. */
447
+ parseError: string | null;
448
+ }
449
+ /**
450
+ * Insert shape for {@link JsonLdRow}.
451
+ *
452
+ * Mirrors the row shape minus the auto-increment `id`. `parsed` is the raw
453
+ * JSON value (the database layer JSON-stringifies it before write).
454
+ * @example
455
+ * const insert: JsonLdRowForInsert = {
456
+ * pageId: 42,
457
+ * kind: 'speculationrules',
458
+ * type: null,
459
+ * raw: '{"prerender":[]}',
460
+ * parsed: { prerender: [] },
461
+ * parseError: null,
462
+ * };
463
+ */
464
+ export type JsonLdRowForInsert = Omit<JsonLdRow, 'id'>;
465
+ /**
466
+ * One row in the `page_tags` table.
467
+ *
468
+ * Each row represents one detected Wappalyzer provider × external-id tuple for
469
+ * one page. A page typically has 1–10 rows.
470
+ * @example
471
+ * const row: TagRow = {
472
+ * id: 1,
473
+ * pageId: 42,
474
+ * provider: 'Google Tag Manager',
475
+ * category: 'Tag managers',
476
+ * externalId: 'GTM-XXXX',
477
+ * version: null,
478
+ * confidence: 100,
479
+ * categories: ['Tag managers'],
480
+ * sources: [
481
+ * {
482
+ * type: 'script-src',
483
+ * src: 'https://www.googletagmanager.com/gtm.js',
484
+ * location: 'head',
485
+ * },
486
+ * ],
487
+ * };
488
+ */
489
+ export interface TagRow {
490
+ /** Auto-increment primary key. */
491
+ id: number;
492
+ /** FK to `pages.id`. */
493
+ pageId: number;
494
+ /** Wappalyzer provider name (e.g. `'Google Tag Manager'`). */
495
+ provider: string;
496
+ /** First entry of `categories`. `null` when Wappalyzer did not report a category. Convenient projection only; canonical list is `categories`. */
497
+ category: string | null;
498
+ /** Real external identifier extracted by `meta/id-extractors` (e.g. `GTM-XXXX`, `G-XXXX`). `null` when none. */
499
+ externalId: string | null;
500
+ /** Wappalyzer-reported version, when available. */
501
+ version: string | null;
502
+ /** Wappalyzer-reported confidence 0–100, when available. */
503
+ confidence: number | null;
504
+ /** Full `categories` array preserved as JSON. */
505
+ categories: readonly string[];
506
+ /** `TagSource[]` preserved as JSON; describes where the provider was detected (script-src / inline / iframe-src / window-global / etc.). */
507
+ sources: ReadonlyArray<{
508
+ type: 'script-src' | 'inline' | 'iframe-src' | 'window-global' | 'img-src' | 'header' | 'meta' | 'html';
509
+ src?: string;
510
+ location?: 'head' | 'body' | 'noscript';
511
+ globalName?: string;
512
+ }>;
513
+ }
514
+ /**
515
+ * Insert shape for {@link TagRow}.
516
+ *
517
+ * Mirrors the row shape minus the auto-increment `id`. `categories` and
518
+ * `sources` are passed as plain JS arrays (the database layer JSON-stringifies
519
+ * them before write).
520
+ * @example
521
+ * const insert: TagRowForInsert = {
522
+ * pageId: 42,
523
+ * provider: 'Google Analytics',
524
+ * category: 'Analytics',
525
+ * externalId: 'G-XXXX',
526
+ * version: null,
527
+ * confidence: 100,
528
+ * categories: ['Analytics'],
529
+ * sources: [{ type: 'window-global', globalName: 'gtag' }],
530
+ * };
531
+ */
532
+ export type TagRowForInsert = Omit<TagRow, 'id'>;
533
+ /**
534
+ * One row in the `technology_signals` table — one un-combined signal for
535
+ * one technology on one page. See
536
+ * `archive/meta/technologies/types.ts#TechnologySignalPartial` for the
537
+ * pre-insert shape (no `pageId`/`id`) this is built from.
538
+ * @example
539
+ * const row: TechnologySignalRow = {
540
+ * id: 1,
541
+ * pageId: 42,
542
+ * technology: 'Next.js',
543
+ * signalType: 'html-marker',
544
+ * evidence: '<script id="__NEXT_DATA__"',
545
+ * weight: 70,
546
+ * };
547
+ */
548
+ export interface TechnologySignalRow {
549
+ /** Auto-increment primary key. */
550
+ id: number;
551
+ /** FK to `content_items.id`. */
552
+ pageId: number;
553
+ /** Normalized technology name (e.g. `'Next.js'`, `'Google Analytics'`). */
554
+ technology: string;
555
+ /** How this signal was detected. */
556
+ signalType: 'wappalyzer' | 'meta-generator' | 'html-marker' | 'url-pattern' | 'scoped-attr' | 'weak-marker' | 'js-license-comment';
557
+ /** Matched fragment or raw value, truncated to ~200 chars, or `null`. */
558
+ evidence: string | null;
559
+ /** This signal's confidence in isolation, 0-100. */
560
+ weight: number;
561
+ }
562
+ /** Insert shape for {@link TechnologySignalRow}. */
563
+ export type TechnologySignalRowForInsert = Omit<TechnologySignalRow, 'id'>;
564
+ /**
565
+ * One row in the `page_technologies` table — the confidence-combined
566
+ * roll-up of every {@link TechnologySignalRow} for one technology on one
567
+ * page. Read-optimised counterpart of `technology_signals`, analogous to
568
+ * `page_meta.tag_count` being the roll-up of `page_tags` — except here the
569
+ * roll-up is a full row, not just a count, because `confidence` is a
570
+ * per-technology computed value (`combineTechnologyConfidence`), not a
571
+ * simple count.
572
+ * @example
573
+ * const row: PageTechnologyRow = {
574
+ * id: 1,
575
+ * pageId: 42,
576
+ * technology: 'Next.js',
577
+ * category: 'JavaScript frameworks',
578
+ * version: null,
579
+ * confidence: 80,
580
+ * signalCount: 2,
581
+ * };
582
+ */
583
+ export interface PageTechnologyRow {
584
+ /** Auto-increment primary key. */
585
+ id: number;
586
+ /** FK to `content_items.id`. */
587
+ pageId: number;
588
+ technology: string;
589
+ category: string | null;
590
+ version: string | null;
591
+ /** `combineTechnologyConfidence`'s noisy-OR result, 0-100. */
592
+ confidence: number;
593
+ /** Count of distinct `signalType`s that contributed to `confidence`. */
594
+ signalCount: number;
595
+ }
596
+ /** Insert shape for {@link PageTechnologyRow}. */
597
+ export type PageTechnologyRowForInsert = Omit<PageTechnologyRow, 'id'>;
598
+ /**
599
+ * Summary of one page's JSON-LD entries returned by `get-page-detail`.
600
+ *
601
+ * Keeps the response token-bounded for MCP / LLM consumers; the full `raw`
602
+ * payload is fetched separately via `get-page-jsonld(url)`.
603
+ * @see summarize-jsonld.ts
604
+ * @example
605
+ * const summary: JsonLdSummary = {
606
+ * count: 2,
607
+ * types: ['Article', 'BreadcrumbList'],
608
+ * parseErrorCount: 0,
609
+ * };
610
+ */
611
+ export interface JsonLdSummary {
612
+ /** Total entries across `ld+json` and `speculationrules`. */
613
+ count: number;
614
+ /** Unique `@type` values (sorted). `null` slots are emitted as the string `'(unknown)'`. */
615
+ types: readonly string[];
616
+ /** Number of entries that failed to parse (i.e. have a non-null `parseError`). */
617
+ parseErrorCount: number;
618
+ }
619
+ /**
620
+ * Error thrown by `assert-compatible-version` when the archive's
621
+ * `info.version` is older than the format version this build accepts.
622
+ *
623
+ * Catch this at CLI / viewer boundaries to print a friendly message; do not
624
+ * confuse with generic `Error` thrown by `Database.connect` (lockfile / I/O).
625
+ * @example
626
+ * try {
627
+ * const accessor = await Archive.openCached(filePath);
628
+ * } catch (error) {
629
+ * if (error instanceof IncompatibleArchiveError) {
630
+ * // Message names the migration script(s) to run.
631
+ * console.error(error.message);
632
+ * } else {
633
+ * throw error;
634
+ * }
635
+ * }
636
+ */
637
+ export declare class IncompatibleArchiveError extends Error {
638
+ readonly archiveVersion: string;
639
+ readonly requiredVersion: string;
640
+ /**
641
+ * @param archiveVersion - The `info.version` value read from the archive
642
+ * (or `'unknown'` when the column is missing / null).
643
+ * @param requiredVersion - The minimum format version this build accepts
644
+ * (semver string, e.g. `'0.13.0'`).
645
+ */
646
+ constructor(archiveVersion: string, requiredVersion: string);
647
+ }
648
+ /**
649
+ * Top-level metadata extracted from a page's `<head>` and surrounding markup
650
+ * (`<html>`, `<base>`, `<noscript>`, `<iframe>` in body, `<script>` of known
651
+ * structured-data types).
652
+ *
653
+ * Required fields (`title`, `jsonLd`, `speculationRules`, `others`, `tags`)
654
+ * always exist so downstream consumers can iterate without null-checking the
655
+ * top level.
656
+ */
657
+ export interface Meta {
658
+ /** The text content of the `<title>` element. */
659
+ title: string;
660
+ /** The `lang` attribute of the `<html>` element. */
661
+ lang?: string;
662
+ /** The `dir` attribute of the `<html>` element. */
663
+ dir?: string;
664
+ /** The `xmlns` attribute of the `<html>` element (rare; RDFa contexts). */
665
+ xmlns?: string;
666
+ /** The `prefix` attribute of the `<html>` element (RDFa). */
667
+ prefix?: string;
668
+ /** The `vocab` attribute of the `<html>` element (RDFa). */
669
+ vocab?: string;
670
+ /** The `typeof` attribute of the `<html>` element (RDFa). */
671
+ typeOf?: string;
672
+ /** The `itemtype` attribute of the `<html>` element (Microdata). */
673
+ itemType?: string;
674
+ /** The `<meta charset>` value, or `null` if absent. */
675
+ charset?: string;
676
+ /** The `<base href>` value, or `null` if absent. */
677
+ baseHref?: string;
678
+ /** The `<base target>` value, or `null` if absent. */
679
+ baseTarget?: string;
680
+ /** `<meta name="description">` content. */
681
+ description?: string;
682
+ /** `<meta name="keywords">` content. */
683
+ keywords?: string;
684
+ /** `<meta name="application-name">` content. */
685
+ applicationName?: string;
686
+ /** `<meta name="author">` content. */
687
+ author?: string;
688
+ /** `<meta name="generator">` content. */
689
+ generator?: string;
690
+ /** `<meta name="creator">` content. */
691
+ creator?: string;
692
+ /** `<meta name="publisher">` content. */
693
+ publisher?: string;
694
+ /** `<meta name="theme-color">` (no `media` attribute) content. */
695
+ themeColor?: string;
696
+ /** `<meta name="theme-color" media="(prefers-color-scheme: light)">` content. */
697
+ themeColorLight?: string;
698
+ /** `<meta name="theme-color" media="(prefers-color-scheme: dark)">` content. */
699
+ themeColorDark?: string;
700
+ /** `<meta name="color-scheme">` content. */
701
+ colorScheme?: string;
702
+ /** `<meta name="supported-color-schemes">` content. */
703
+ supportedColorSchemes?: string;
704
+ /** Parsed `<meta name="viewport">`. */
705
+ viewport?: ViewportMeta;
706
+ /** Parsed `<meta name="robots">`. */
707
+ robots?: RobotsMeta;
708
+ /** Parsed `<meta name="referrer">` and its sub-policies. */
709
+ referrer?: ReferrerMeta;
710
+ /** Parsed `<meta name="format-detection">` and Apple cross-references. */
711
+ formatDetection?: FormatDetectionMeta;
712
+ /** `<meta name="googlebot">` and other crawler-specific directives. */
713
+ googlebot?: string;
714
+ googlebotNews?: string;
715
+ googlebotImage?: string;
716
+ googlebotVideo?: string;
717
+ bingbot?: string;
718
+ slurp?: string;
719
+ duckduckbot?: string;
720
+ yandex?: string;
721
+ baiduspider?: string;
722
+ iaArchiver?: string;
723
+ revisitAfter?: string;
724
+ rating?: string;
725
+ distribution?: string;
726
+ classification?: string;
727
+ category?: string;
728
+ subject?: string;
729
+ topic?: string;
730
+ summary?: string;
731
+ abstract?: string;
732
+ audience?: string;
733
+ target?: string;
734
+ copyright?: string;
735
+ designer?: string;
736
+ owner?: string;
737
+ replyTo?: string;
738
+ contact?: string;
739
+ identifierUrl?: string;
740
+ language?: string;
741
+ revision?: string;
742
+ build?: string;
743
+ version?: string;
744
+ handheldFriendly?: string;
745
+ mobileOptimized?: string;
746
+ mobileWebAppCapable?: string;
747
+ applicationUrl?: string;
748
+ theme?: string;
749
+ /** Parsed `http-equiv` attributes. */
750
+ httpEquiv?: HttpEquivMeta;
751
+ /** Open Graph tags (`og:*`, `article:*`, `book:*`, `profile:*`, `music:*`, `video:*`). */
752
+ og?: OpenGraphMeta;
753
+ /** Twitter Card tags (`twitter:*`). */
754
+ twitter?: TwitterMeta;
755
+ /** Facebook tags (`fb:*`). */
756
+ fb?: FbMeta;
757
+ /** Fediverse tags (`fediverse:*`). */
758
+ fediverse?: FediverseMeta;
759
+ /** Apple iOS tags. */
760
+ apple?: AppleMeta;
761
+ /** Microsoft application tile tags (`msapplication-*`). */
762
+ msapplication?: MsApplicationMeta;
763
+ /** Site verification tags. */
764
+ verification?: VerificationMeta;
765
+ /** Google-specific tags (`google`, `google-*`). */
766
+ google?: GoogleMeta;
767
+ /** Dublin Core (`DC.*`) tags. */
768
+ dc?: Record<string, string>;
769
+ /** DC Terms (`DCTERMS.*`) tags. */
770
+ dcterms?: Record<string, string>;
771
+ /** Geo tags. */
772
+ geo?: GeoMeta;
773
+ /** `<meta name="ICBM" content="{lat}, {lng}">` content. */
774
+ icbm?: string;
775
+ /** Academic citation (`citation_*`) tags. */
776
+ citation?: CitationMeta;
777
+ /** CSRF param name (`<meta name="csrf-param">`). */
778
+ csrfParam?: string;
779
+ /** CSRF token (`<meta name="csrf-token">`). */
780
+ csrfToken?: string;
781
+ /** Misc single-value tags. */
782
+ goImport?: string;
783
+ bitcoin?: string;
784
+ originTrial: string[];
785
+ monetization?: string;
786
+ paymentPointer?: string;
787
+ ampExperimentsOptIn?: string;
788
+ ampGoogleClientIdApi?: string;
789
+ /** `<meta itemprop="...">` tags (Microdata in head). */
790
+ itemprop?: {
791
+ name?: string;
792
+ description?: string;
793
+ image?: string;
794
+ } & Record<string, string | string[]>;
795
+ /** Parsed `<link>` elements. */
796
+ link?: LinkMeta;
797
+ /** All `<script type="application/ld+json">` entries. */
798
+ jsonLd: JsonLdEntry[];
799
+ /** All `<script type="speculationrules">` entries. */
800
+ speculationRules: JsonLdEntry[];
801
+ /** RDFa attributes on `<html>` (mirror of top-level fields, kept for explicit access). */
802
+ rdfa?: RdfaMeta;
803
+ /** Microdata attributes on `<html>`. */
804
+ microdata?: MicrodataMeta;
805
+ /** AMP-related markers. */
806
+ amp?: AmpMeta;
807
+ /** Legacy meta tags (kept for completeness). */
808
+ legacy?: LegacyMeta;
809
+ /** Mobile-specific meta tags. */
810
+ mobile?: MobileMeta;
811
+ /** Microformats2 markers in head. */
812
+ microformats?: MicroformatsMeta;
813
+ /** Pinterest-specific tags. */
814
+ pinterest?: PinterestMeta;
815
+ /** Slack/LinkedIn-specific notes (cross-references to og:* tags). */
816
+ slack?: SlackMeta;
817
+ linkedin?: LinkedInMeta;
818
+ /** Experimental / vendor-specific tags. */
819
+ experimental?: ExperimentalMeta;
820
+ /** Wikipedia / MediaWiki-specific tags. */
821
+ wiki?: WikiMeta;
822
+ /** Detected third-party tags (analytics, frameworks, libraries, etc.). */
823
+ tags: TagsMeta;
824
+ /** Unknown / future / vendor-specific markup not covered by typed fields. */
825
+ others: OthersBucket;
826
+ /** Raw head entries for debugging. Only present when `getMeta` is called with `includeRaw: true`. */
827
+ _raw?: readonly RawHeadEntry[];
828
+ }
829
+ /**
830
+ * Parsed `<meta name="viewport">` content.
831
+ * The `raw` string is always preserved so consumers can re-parse unknown directives.
832
+ */
833
+ export interface ViewportMeta {
834
+ raw: string;
835
+ width?: string;
836
+ height?: string;
837
+ initialScale?: number;
838
+ minimumScale?: number;
839
+ maximumScale?: number;
840
+ userScalable?: boolean | string;
841
+ viewportFit?: string;
842
+ interactiveWidget?: string;
843
+ }
844
+ /**
845
+ * Parsed `<meta name="robots">` and crawler directives.
846
+ */
847
+ export interface RobotsMeta {
848
+ raw: string;
849
+ index?: boolean;
850
+ noindex?: boolean;
851
+ follow?: boolean;
852
+ nofollow?: boolean;
853
+ none?: boolean;
854
+ all?: boolean;
855
+ noarchive?: boolean;
856
+ nosnippet?: boolean;
857
+ noimageindex?: boolean;
858
+ nocache?: boolean;
859
+ notranslate?: boolean;
860
+ noodp?: boolean;
861
+ noydir?: boolean;
862
+ indexifembedded?: boolean;
863
+ maxSnippet?: number;
864
+ maxImagePreview?: string;
865
+ maxVideoPreview?: number;
866
+ unavailableAfter?: string;
867
+ }
868
+ /**
869
+ * Parsed `<meta name="referrer">` and its individual policy values.
870
+ */
871
+ export interface ReferrerMeta {
872
+ raw: string;
873
+ noReferrer?: boolean;
874
+ origin?: boolean;
875
+ originWhenCrossOrigin?: boolean;
876
+ strictOrigin?: boolean;
877
+ strictOriginWhenCrossOrigin?: boolean;
878
+ unsafeUrl?: boolean;
879
+ sameOrigin?: boolean;
880
+ noReferrerWhenDowngrade?: boolean;
881
+ }
882
+ /**
883
+ * Parsed `<meta name="format-detection">` content.
884
+ */
885
+ export interface FormatDetectionMeta {
886
+ raw: string;
887
+ telephone?: boolean;
888
+ email?: boolean;
889
+ address?: boolean;
890
+ date?: boolean;
891
+ }
892
+ /**
893
+ * Parsed `http-equiv` attribute values.
894
+ */
895
+ export interface HttpEquivMeta {
896
+ contentType?: string;
897
+ contentLanguage?: string;
898
+ defaultStyle?: string;
899
+ refresh?: HttpEquivRefresh;
900
+ xUaCompatible?: string;
901
+ contentSecurityPolicy?: string;
902
+ contentSecurityPolicyReportOnly?: string;
903
+ setCookie?: string;
904
+ pragma?: string;
905
+ cacheControl?: string;
906
+ expires?: string;
907
+ acceptCh?: string;
908
+ delegateCh?: string;
909
+ permissionsPolicy?: string;
910
+ originTrial?: string;
911
+ originTrialToken: string[];
912
+ xDnsPrefetchControl?: string;
913
+ windowTarget?: string;
914
+ imagetoolbar?: string;
915
+ cleartype?: string;
916
+ permissionsPolicyValue?: string;
917
+ }
918
+ export interface HttpEquivRefresh {
919
+ raw: string;
920
+ seconds?: number;
921
+ url?: string;
922
+ }
923
+ /**
924
+ * Open Graph tags including all sub-namespaces (article, book, profile, music, video).
925
+ */
926
+ export interface OpenGraphMeta {
927
+ title?: string;
928
+ type?: string;
929
+ url?: string;
930
+ siteName?: string;
931
+ description?: string;
932
+ determiner?: string;
933
+ locale?: string;
934
+ localeAlternate: string[];
935
+ image: string[];
936
+ imageUrl?: string;
937
+ imageSecureUrl?: string;
938
+ imageType?: string;
939
+ imageWidth?: string;
940
+ imageHeight?: string;
941
+ imageAlt?: string;
942
+ video: string[];
943
+ videoUrl?: string;
944
+ videoSecureUrl?: string;
945
+ videoType?: string;
946
+ videoWidth?: string;
947
+ videoHeight?: string;
948
+ videoAlt?: string;
949
+ audio: string[];
950
+ audioUrl?: string;
951
+ audioSecureUrl?: string;
952
+ audioType?: string;
953
+ article?: OgArticleMeta;
954
+ book?: OgBookMeta;
955
+ profile?: OgProfileMeta;
956
+ music?: OgMusicMeta;
957
+ videoNs?: OgVideoNsMeta;
958
+ }
959
+ export interface OgArticleMeta {
960
+ publishedTime?: string;
961
+ modifiedTime?: string;
962
+ expirationTime?: string;
963
+ author: string[];
964
+ section?: string;
965
+ tag: string[];
966
+ publisher?: string;
967
+ }
968
+ export interface OgBookMeta {
969
+ author: string[];
970
+ isbn?: string;
971
+ releaseDate?: string;
972
+ tag: string[];
973
+ }
974
+ export interface OgProfileMeta {
975
+ firstName?: string;
976
+ lastName?: string;
977
+ username?: string;
978
+ gender?: string;
979
+ }
980
+ export interface OgMusicMeta {
981
+ duration?: string;
982
+ album: string[];
983
+ albumDisc?: string;
984
+ albumTrack?: string;
985
+ musician: string[];
986
+ song: string[];
987
+ songDisc?: string;
988
+ songTrack?: string;
989
+ releaseDate?: string;
990
+ creator: string[];
991
+ }
992
+ export interface OgVideoNsMeta {
993
+ actor: string[];
994
+ actorRole?: string;
995
+ director: string[];
996
+ writer: string[];
997
+ duration?: string;
998
+ releaseDate?: string;
999
+ tag: string[];
1000
+ series?: string;
1001
+ }
1002
+ /**
1003
+ * Twitter Card tags.
1004
+ */
1005
+ export interface TwitterMeta {
1006
+ card?: string;
1007
+ site?: string;
1008
+ siteId?: string;
1009
+ creator?: string;
1010
+ creatorId?: string;
1011
+ title?: string;
1012
+ description?: string;
1013
+ image?: string;
1014
+ imageSrc?: string;
1015
+ imageAlt?: string;
1016
+ imageWidth?: string;
1017
+ imageHeight?: string;
1018
+ url?: string;
1019
+ domain?: string;
1020
+ player?: string;
1021
+ playerWidth?: string;
1022
+ playerHeight?: string;
1023
+ playerStream?: string;
1024
+ playerStreamContentType?: string;
1025
+ appNameIphone?: string;
1026
+ appIdIphone?: string;
1027
+ appUrlIphone?: string;
1028
+ appNameIpad?: string;
1029
+ appIdIpad?: string;
1030
+ appUrlIpad?: string;
1031
+ appNameGoogleplay?: string;
1032
+ appIdGoogleplay?: string;
1033
+ appUrlGoogleplay?: string;
1034
+ appCountry?: string;
1035
+ label1?: string;
1036
+ data1?: string;
1037
+ label2?: string;
1038
+ data2?: string;
1039
+ widgetsCsp?: string;
1040
+ widgetsNewEmbedDesign?: string;
1041
+ dnt?: string;
1042
+ }
1043
+ export interface FbMeta {
1044
+ appId?: string;
1045
+ admins: string[];
1046
+ pages: string[];
1047
+ }
1048
+ export interface FediverseMeta {
1049
+ creator?: string;
1050
+ }
1051
+ export interface AppleMeta {
1052
+ mobileWebAppCapable?: boolean | string;
1053
+ mobileWebAppStatusBarStyle?: string;
1054
+ mobileWebAppTitle?: string;
1055
+ touchFullscreen?: boolean | string;
1056
+ itunesApp?: string;
1057
+ mobileWebAppOrientations?: string;
1058
+ touchIconTitle?: string;
1059
+ touchStartupImage?: string;
1060
+ formatDetectionTelephone?: boolean;
1061
+ }
1062
+ export interface MsApplicationMeta {
1063
+ tileColor?: string;
1064
+ tileImage?: string;
1065
+ config?: string;
1066
+ configFile?: string;
1067
+ navbuttonColor?: string;
1068
+ square70x70logo?: string;
1069
+ square150x150logo?: string;
1070
+ square310x310logo?: string;
1071
+ wide310x150logo?: string;
1072
+ starturl?: string;
1073
+ window?: string;
1074
+ task: string[];
1075
+ taskSeparator?: string;
1076
+ tooltip?: string;
1077
+ notification?: string;
1078
+ badge?: string;
1079
+ tapHighlight?: string;
1080
+ allowDomainApiCalls?: string;
1081
+ allowDomainMetaTags?: string;
1082
+ cleartype?: string;
1083
+ smartTagsPreventParsing?: string;
1084
+ ieRmOff?: string;
1085
+ }
1086
+ export interface VerificationMeta {
1087
+ google?: string;
1088
+ bing?: string;
1089
+ yandex?: string;
1090
+ baidu?: string;
1091
+ naver?: string;
1092
+ pinterest?: string;
1093
+ facebook?: string;
1094
+ alexa?: string;
1095
+ norton?: string;
1096
+ ahrefs?: string;
1097
+ detectify?: string;
1098
+ zoho?: string;
1099
+ wot?: string;
1100
+ seznam?: string;
1101
+ shopify?: string;
1102
+ brave?: string;
1103
+ }
1104
+ export interface GoogleMeta {
1105
+ notranslate?: boolean;
1106
+ nositelinkssearchbox?: boolean;
1107
+ nopagereadaloud?: boolean;
1108
+ translateCustomization?: string;
1109
+ adsenseAccount?: string;
1110
+ playApp?: string;
1111
+ googlebotNotranslate?: boolean;
1112
+ }
1113
+ export interface GeoMeta {
1114
+ region?: string;
1115
+ placename?: string;
1116
+ position?: string;
1117
+ country?: string;
1118
+ a1?: string;
1119
+ a2?: string;
1120
+ a3?: string;
1121
+ lmk?: string;
1122
+ }
1123
+ export interface CitationMeta {
1124
+ title?: string;
1125
+ author: string[];
1126
+ authorEmail: string[];
1127
+ authorInstitution: string[];
1128
+ publicationDate?: string;
1129
+ date?: string;
1130
+ journalTitle?: string;
1131
+ journalAbbrev?: string;
1132
+ conferenceTitle?: string;
1133
+ publisher?: string;
1134
+ volume?: string;
1135
+ issue?: string;
1136
+ firstpage?: string;
1137
+ lastpage?: string;
1138
+ doi?: string;
1139
+ isbn?: string;
1140
+ issn?: string;
1141
+ language?: string;
1142
+ keywords?: string;
1143
+ pdfUrl?: string;
1144
+ fulltextHtmlUrl?: string;
1145
+ dissertationInstitution?: string;
1146
+ technicalReportInstitution?: string;
1147
+ technicalReportNumber?: string;
1148
+ }
1149
+ export interface RdfaMeta {
1150
+ prefix?: string;
1151
+ vocab?: string;
1152
+ typeOf?: string;
1153
+ }
1154
+ export interface MicrodataMeta {
1155
+ itemscope?: boolean;
1156
+ itemtype?: string;
1157
+ }
1158
+ export interface AmpMeta {
1159
+ enabled?: boolean;
1160
+ lightning?: boolean;
1161
+ canonicalFromAmp?: string;
1162
+ amphtml?: string;
1163
+ experimentsOptIn?: string;
1164
+ runtimeScript?: boolean;
1165
+ }
1166
+ export interface LegacyMeta {
1167
+ msSmartTagsPreventParsing?: string;
1168
+ imagetoolbar?: string;
1169
+ pageVersion?: string;
1170
+ audience?: string;
1171
+ resourceType?: string;
1172
+ distribution?: string;
1173
+ docClass?: string;
1174
+ docRights?: string;
1175
+ docType?: string;
1176
+ mobileOptimized?: string;
1177
+ handheldFriendly?: string;
1178
+ }
1179
+ export interface MobileMeta {
1180
+ handheldFriendly?: string;
1181
+ mobileOptimized?: string;
1182
+ mobileAgent?: string;
1183
+ fullScreen?: string;
1184
+ browsermode?: string;
1185
+ x5Orientation?: string;
1186
+ x5Fullscreen?: string;
1187
+ x5PageMode?: string;
1188
+ screenOrientation?: string;
1189
+ layoutmode?: string;
1190
+ imagemode?: string;
1191
+ }
1192
+ export interface MicroformatsMeta {
1193
+ relMe: string[];
1194
+ }
1195
+ export interface PinterestMeta {
1196
+ richPin?: boolean;
1197
+ nopin?: boolean;
1198
+ disableRichPin?: boolean;
1199
+ }
1200
+ export interface SlackMeta {
1201
+ ogImageWidth?: string;
1202
+ }
1203
+ export interface LinkedInMeta {
1204
+ ogType?: string;
1205
+ }
1206
+ export interface ExperimentalMeta {
1207
+ darkreaderLock?: boolean;
1208
+ turboCacheControl?: string;
1209
+ turboVisitControl?: string;
1210
+ viewTransition?: string;
1211
+ }
1212
+ export interface WikiMeta {
1213
+ resourceLoaderDynamicStyles?: string;
1214
+ mediawikiGenerator?: string;
1215
+ }
1216
+ /**
1217
+ * Parsed `<link>` elements grouped by `rel`. Single-rel entries are stored on
1218
+ * named fields; multi-rel and unknown rels are stored on `others.link[]`.
1219
+ */
1220
+ export interface LinkMeta {
1221
+ canonical?: string;
1222
+ alternateHreflang: LinkEntry[];
1223
+ alternateMedia: LinkEntry[];
1224
+ alternateRss: LinkEntry[];
1225
+ alternateAtom: LinkEntry[];
1226
+ alternateJsonFeed: LinkEntry[];
1227
+ oembedJson?: LinkEntry;
1228
+ oembedXml?: LinkEntry;
1229
+ alternateActivityJson?: LinkEntry;
1230
+ amphtml?: string;
1231
+ author?: string;
1232
+ bookmark?: string;
1233
+ help?: string;
1234
+ license?: string;
1235
+ next?: string;
1236
+ prev?: string;
1237
+ previous?: string;
1238
+ first?: string;
1239
+ last?: string;
1240
+ up?: string;
1241
+ index?: string;
1242
+ contents?: string;
1243
+ start?: string;
1244
+ search?: LinkEntry;
1245
+ tag: LinkEntry[];
1246
+ archives: LinkEntry[];
1247
+ publisher?: string;
1248
+ privacyPolicy?: string;
1249
+ termsOfService?: string;
1250
+ copyright?: string;
1251
+ appendix: LinkEntry[];
1252
+ chapter: LinkEntry[];
1253
+ section: LinkEntry[];
1254
+ subsection: LinkEntry[];
1255
+ glossary?: string;
1256
+ profile: LinkEntry[];
1257
+ editUri?: string;
1258
+ pingback?: string;
1259
+ webmention?: string;
1260
+ micropub?: string;
1261
+ microsub?: string;
1262
+ me: LinkEntry[];
1263
+ authorizationEndpoint?: string;
1264
+ tokenEndpoint?: string;
1265
+ indieauthMetadata?: string;
1266
+ openidServer?: string;
1267
+ openidDelegate?: string;
1268
+ openid2Provider?: string;
1269
+ openid2LocalId?: string;
1270
+ hub?: string;
1271
+ self?: string;
1272
+ payment?: string;
1273
+ enclosure: LinkEntry[];
1274
+ external: LinkEntry[];
1275
+ nofollow: LinkEntry[];
1276
+ sponsored: LinkEntry[];
1277
+ ugc: LinkEntry[];
1278
+ noopener: LinkEntry[];
1279
+ noreferrer: LinkEntry[];
1280
+ opener: LinkEntry[];
1281
+ imageSrc?: string;
1282
+ shortlink?: string;
1283
+ dnsPrefetch: LinkEntry[];
1284
+ preconnect: LinkEntry[];
1285
+ prefetch: LinkEntry[];
1286
+ prerender: LinkEntry[];
1287
+ preload: LinkEntry[];
1288
+ modulepreload: LinkEntry[];
1289
+ expect: LinkEntry[];
1290
+ stylesheet: LinkEntry[];
1291
+ manifest?: string;
1292
+ serviceworker?: string;
1293
+ dpp?: string;
1294
+ gbfs?: string;
1295
+ syndication: LinkEntry[];
1296
+ apiCatalog?: string;
1297
+ memento?: string;
1298
+ timegate?: string;
1299
+ timemap?: string;
1300
+ versionHistory?: string;
1301
+ latestVersion?: string;
1302
+ predecessorVersion?: string;
1303
+ successorVersion?: string;
1304
+ workingCopy?: string;
1305
+ workingCopyOf?: string;
1306
+ describedby?: string;
1307
+ describes?: string;
1308
+ via?: string;
1309
+ related: LinkEntry[];
1310
+ citeAs?: string;
1311
+ disclosure?: string;
1312
+ status?: string;
1313
+ sunset?: string;
1314
+ deprecation?: string;
1315
+ lrdd?: string;
1316
+ hosts?: string;
1317
+ service?: string;
1318
+ serviceDesc?: string;
1319
+ serviceDoc?: string;
1320
+ serviceMeta?: string;
1321
+ c2paManifest?: string;
1322
+ compressionDictionary?: string;
1323
+ icon?: LinkEntry;
1324
+ iconAny?: LinkEntry;
1325
+ iconSvg?: LinkEntry;
1326
+ iconSized: LinkEntry[];
1327
+ shortcutIcon?: string;
1328
+ appleTouchIcon?: LinkEntry;
1329
+ appleTouchIconSized: LinkEntry[];
1330
+ appleTouchIconPrecomposed: LinkEntry[];
1331
+ appleTouchStartupImage: LinkEntry[];
1332
+ appleTouchStartupImageIphone?: LinkEntry;
1333
+ appleTouchStartupImageIpadPortrait?: LinkEntry;
1334
+ appleTouchStartupImageIpadLandscape?: LinkEntry;
1335
+ maskIcon?: LinkEntry;
1336
+ fluidIcon?: LinkEntry;
1337
+ securityTxt?: string;
1338
+ }
1339
+ /**
1340
+ * Common shape of a parsed `<link>` element.
1341
+ */
1342
+ export interface LinkEntry {
1343
+ href: string;
1344
+ rel: readonly string[];
1345
+ type?: string;
1346
+ media?: string;
1347
+ sizes?: string;
1348
+ title?: string;
1349
+ hreflang?: string;
1350
+ as?: string;
1351
+ crossorigin?: string;
1352
+ color?: string;
1353
+ blocking?: string;
1354
+ imagesrcset?: string;
1355
+ }
1356
+ /**
1357
+ * A `<script type="application/ld+json">` or `<script type="speculationrules">`
1358
+ * entry. `parsed` holds the result of `JSON.parse(raw)`; on parse failure
1359
+ * `parseError` is set and `parsed` is `undefined`.
1360
+ */
1361
+ export interface JsonLdEntry {
1362
+ raw: string;
1363
+ parsed?: unknown;
1364
+ parseError?: string;
1365
+ }
1366
+ /**
1367
+ * Catch-all bucket for markup not covered by typed fields above. Always present
1368
+ * (empty values when no unknowns were found) so consumers can iterate without
1369
+ * null-checking.
1370
+ */
1371
+ export interface OthersBucket {
1372
+ /** Unknown `<meta name>` → list of `content` values. */
1373
+ meta: Record<string, string[]>;
1374
+ /** Unknown `<meta property>` → list of `content` values. */
1375
+ property: Record<string, string[]>;
1376
+ /** Unknown `<meta http-equiv>` → list of `content` values. */
1377
+ httpEquiv: Record<string, string[]>;
1378
+ /** Unknown `<meta itemprop>` → list of `content` values. */
1379
+ itemprop: Record<string, string[]>;
1380
+ /** `<link>` elements whose every `rel` is unknown. */
1381
+ link: LinkEntry[];
1382
+ /** `<script>` elements with unknown `type` (kept for raw inspection). */
1383
+ script: ScriptEntry[];
1384
+ /** `<iframe>` elements (used to capture GTM noscript iframes, etc.). */
1385
+ iframe: IframeEntry[];
1386
+ }
1387
+ export interface ScriptEntry {
1388
+ type: string;
1389
+ content?: string;
1390
+ src?: string;
1391
+ location: 'head' | 'body' | 'noscript';
1392
+ }
1393
+ export interface IframeEntry {
1394
+ src: string;
1395
+ location: 'head' | 'body' | 'noscript';
1396
+ }
1397
+ /**
1398
+ * Detected third-party tags from the page (analytics, frameworks, libraries,
1399
+ * etc.). Produced by `tag-detection.ts` by combining `simple-wappalyzer`
1400
+ * results with ID extractors.
1401
+ */
1402
+ export interface TagsMeta {
1403
+ /** Wappalyzer category name → provider name → detection detail. */
1404
+ detected: Record<string, Record<string, TagDetail>>;
1405
+ /** Flat list of all detected entries (one per (provider, id) tuple). */
1406
+ entries: TagEntry[];
1407
+ }
1408
+ export interface TagDetail {
1409
+ /** Real IDs extracted from the page (e.g., `G-XXXX`, `GTM-XXXX`). */
1410
+ ids: string[];
1411
+ /** Wappalyzer-reported version, if available. */
1412
+ version?: string;
1413
+ /** Wappalyzer-reported confidence (0-100), if available. */
1414
+ confidence?: number;
1415
+ }
1416
+ export interface TagEntry {
1417
+ provider: string;
1418
+ categories: readonly string[];
1419
+ id?: string;
1420
+ version?: string;
1421
+ confidence?: number;
1422
+ sources: readonly TagSource[];
1423
+ }
1424
+ export interface TagSource {
1425
+ type: 'script-src' | 'inline' | 'iframe-src' | 'window-global' | 'img-src' | 'header' | 'meta' | 'html';
1426
+ src?: string;
1427
+ location?: 'head' | 'body' | 'noscript';
1428
+ globalName?: string;
1429
+ }
1430
+ /**
1431
+ * Discriminated union of raw entries collected from the page by `collectHead`.
1432
+ * Used as the input shape for `classify()`. Keeping this serializable lets us
1433
+ * collect on the browser side and process on the Node side.
1434
+ */
1435
+ export type RawHeadEntry = {
1436
+ kind: 'html';
1437
+ lang?: string;
1438
+ dir?: string;
1439
+ xmlns?: string;
1440
+ prefix?: string;
1441
+ vocab?: string;
1442
+ typeOf?: string;
1443
+ itemscope?: boolean;
1444
+ itemtype?: string;
1445
+ amp?: boolean;
1446
+ lightning?: boolean;
1447
+ } | {
1448
+ kind: 'title';
1449
+ content: string;
1450
+ } | {
1451
+ kind: 'base';
1452
+ href?: string;
1453
+ target?: string;
1454
+ } | {
1455
+ kind: 'meta';
1456
+ name?: string;
1457
+ property?: string;
1458
+ httpEquiv?: string;
1459
+ itemprop?: string;
1460
+ charset?: string;
1461
+ content?: string;
1462
+ media?: string;
1463
+ } | {
1464
+ kind: 'link';
1465
+ rel: readonly string[];
1466
+ href: string;
1467
+ type?: string;
1468
+ media?: string;
1469
+ sizes?: string;
1470
+ title?: string;
1471
+ hreflang?: string;
1472
+ as?: string;
1473
+ crossorigin?: string;
1474
+ color?: string;
1475
+ blocking?: string;
1476
+ imagesrcset?: string;
1477
+ } | {
1478
+ kind: 'script';
1479
+ scriptType: string;
1480
+ content?: string;
1481
+ src?: string;
1482
+ location: 'head' | 'body' | 'noscript';
1483
+ } | {
1484
+ kind: 'iframe';
1485
+ src: string;
1486
+ location: 'head' | 'body' | 'noscript';
1487
+ } | {
1488
+ kind: 'window-global';
1489
+ names: readonly string[];
1490
+ };