@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.
- package/LICENSE +191 -0
- package/README.md +106 -0
- package/lib/apply-connection-pragmas.d.ts +18 -0
- package/lib/apply-connection-pragmas.js +40 -0
- package/lib/archive-accessor.d.ts +265 -0
- package/lib/archive-accessor.js +477 -0
- package/lib/archive-lock.d.ts +45 -0
- package/lib/archive-lock.js +154 -0
- package/lib/archive.d.ts +736 -0
- package/lib/archive.js +1055 -0
- package/lib/body-hash/compute-body-hash.d.ts +32 -0
- package/lib/body-hash/compute-body-hash.js +35 -0
- package/lib/cache/clear-archive-cache-entry.d.ts +18 -0
- package/lib/cache/clear-archive-cache-entry.js +24 -0
- package/lib/cache/clear-archive-cache-root.d.ts +26 -0
- package/lib/cache/clear-archive-cache-root.js +32 -0
- package/lib/cache/compute-archive-cache-key.d.ts +39 -0
- package/lib/cache/compute-archive-cache-key.js +95 -0
- package/lib/cache/extract-archive-to-cache.d.ts +57 -0
- package/lib/cache/extract-archive-to-cache.js +326 -0
- package/lib/cache/get-archive-cache-root.d.ts +20 -0
- package/lib/cache/get-archive-cache-root.js +53 -0
- package/lib/cache/is-archive-cache-disabled.d.ts +24 -0
- package/lib/cache/is-archive-cache-disabled.js +34 -0
- package/lib/cache/list-archive-cache-entries.d.ts +23 -0
- package/lib/cache/list-archive-cache-entries.js +130 -0
- package/lib/cache/path-exists.d.ts +9 -0
- package/lib/cache/path-exists.js +18 -0
- package/lib/cache/resolve-archive-cache-dir.d.ts +26 -0
- package/lib/cache/resolve-archive-cache-dir.js +32 -0
- package/lib/cache/types.d.ts +33 -0
- package/lib/cache/types.js +1 -0
- package/lib/content-type/is-html-content-type.d.ts +17 -0
- package/lib/content-type/is-html-content-type.js +19 -0
- package/lib/content-type/normalize-content-type.d.ts +14 -0
- package/lib/content-type/normalize-content-type.js +20 -0
- package/lib/create-adjunct-tables.d.ts +66 -0
- package/lib/create-adjunct-tables.js +510 -0
- package/lib/create-entity-tables.d.ts +191 -0
- package/lib/create-entity-tables.js +387 -0
- package/lib/create-progress-reporter.d.ts +30 -0
- package/lib/create-progress-reporter.js +38 -0
- package/lib/create-ref-tables.d.ts +35 -0
- package/lib/create-ref-tables.js +185 -0
- package/lib/create-template-tables.d.ts +28 -0
- package/lib/create-template-tables.js +92 -0
- package/lib/database.d.ts +549 -0
- package/lib/database.js +803 -0
- package/lib/db-ops/_shared/clear-write-ref-caches.d.ts +27 -0
- package/lib/db-ops/_shared/clear-write-ref-caches.js +35 -0
- package/lib/db-ops/_shared/compress-payload.d.ts +26 -0
- package/lib/db-ops/_shared/compress-payload.js +30 -0
- package/lib/db-ops/_shared/create-write-ref-caches.d.ts +17 -0
- package/lib/db-ops/_shared/create-write-ref-caches.js +27 -0
- package/lib/db-ops/_shared/decode-json-ref.d.ts +17 -0
- package/lib/db-ops/_shared/decode-json-ref.js +31 -0
- package/lib/db-ops/_shared/keyset-paginate-by-id.d.ts +49 -0
- package/lib/db-ops/_shared/keyset-paginate-by-id.js +69 -0
- package/lib/db-ops/_shared/load-response-headers-by-set-ids.d.ts +20 -0
- package/lib/db-ops/_shared/load-response-headers-by-set-ids.js +53 -0
- package/lib/db-ops/_shared/resolve-content-item-id.d.ts +62 -0
- package/lib/db-ops/_shared/resolve-content-item-id.js +143 -0
- package/lib/db-ops/_shared/resolve-url-or-blob.d.ts +23 -0
- package/lib/db-ops/_shared/resolve-url-or-blob.js +29 -0
- package/lib/db-ops/_shared/retry-setting.d.ts +16 -0
- package/lib/db-ops/_shared/retry-setting.js +18 -0
- package/lib/db-ops/_shared/safe-parse-json.d.ts +11 -0
- package/lib/db-ops/_shared/safe-parse-json.js +18 -0
- package/lib/db-ops/_shared/types.d.ts +94 -0
- package/lib/db-ops/_shared/types.js +1 -0
- package/lib/db-ops/_shared/upsert-blob-ref.d.ts +25 -0
- package/lib/db-ops/_shared/upsert-blob-ref.js +48 -0
- package/lib/db-ops/_shared/upsert-content-type-ref.d.ts +30 -0
- package/lib/db-ops/_shared/upsert-content-type-ref.js +45 -0
- package/lib/db-ops/_shared/upsert-json-ref.d.ts +22 -0
- package/lib/db-ops/_shared/upsert-json-ref.js +41 -0
- package/lib/db-ops/_shared/upsert-response-headers.d.ts +35 -0
- package/lib/db-ops/_shared/upsert-response-headers.js +49 -0
- package/lib/db-ops/_shared/upsert-url-ref.d.ts +39 -0
- package/lib/db-ops/_shared/upsert-url-ref.js +62 -0
- package/lib/db-ops/anchors/get-anchors-on-page.d.ts +10 -0
- package/lib/db-ops/anchors/get-anchors-on-page.js +21 -0
- package/lib/db-ops/config/get-base-url.d.ts +8 -0
- package/lib/db-ops/config/get-base-url.js +14 -0
- package/lib/db-ops/config/get-config.d.ts +10 -0
- package/lib/db-ops/config/get-config.js +29 -0
- package/lib/db-ops/config/get-created-cwd.d.ts +11 -0
- package/lib/db-ops/config/get-created-cwd.js +13 -0
- package/lib/db-ops/config/get-name.d.ts +8 -0
- package/lib/db-ops/config/get-name.js +14 -0
- package/lib/db-ops/config/info-column-allowlist.d.ts +7 -0
- package/lib/db-ops/config/info-column-allowlist.js +29 -0
- package/lib/db-ops/config/info-json-columns.d.ts +5 -0
- package/lib/db-ops/config/info-json-columns.js +11 -0
- package/lib/db-ops/config/set-config.d.ts +12 -0
- package/lib/db-ops/config/set-config.js +21 -0
- package/lib/db-ops/config/update-config.d.ts +17 -0
- package/lib/db-ops/config/update-config.js +36 -0
- package/lib/db-ops/console-logs/compute-console-log-hash.d.ts +19 -0
- package/lib/db-ops/console-logs/compute-console-log-hash.js +30 -0
- package/lib/db-ops/console-logs/replace-console-logs.d.ts +34 -0
- package/lib/db-ops/console-logs/replace-console-logs.js +123 -0
- package/lib/db-ops/console-logs/stringify-console-log-args.d.ts +16 -0
- package/lib/db-ops/console-logs/stringify-console-log-args.js +26 -0
- package/lib/db-ops/console-logs/types.d.ts +38 -0
- package/lib/db-ops/console-logs/types.js +1 -0
- package/lib/db-ops/console-logs/upsert-console-log-item.d.ts +29 -0
- package/lib/db-ops/console-logs/upsert-console-log-item.js +52 -0
- package/lib/db-ops/dedupe-cap/accumulate-dedupe-cap-rejected-count.d.ts +18 -0
- package/lib/db-ops/dedupe-cap/accumulate-dedupe-cap-rejected-count.js +23 -0
- package/lib/db-ops/dedupe-cap/finalize-dedupe-cap-event.d.ts +12 -0
- package/lib/db-ops/dedupe-cap/finalize-dedupe-cap-event.js +15 -0
- package/lib/db-ops/dedupe-cap/insert-dedupe-cap-event.d.ts +14 -0
- package/lib/db-ops/dedupe-cap/insert-dedupe-cap-event.js +30 -0
- package/lib/db-ops/dedupe-cap/list-dedupe-cap-observations.d.ts +57 -0
- package/lib/db-ops/dedupe-cap/list-dedupe-cap-observations.js +87 -0
- package/lib/db-ops/dedupe-cap/list-dedupe-cap-shape-keys.d.ts +21 -0
- package/lib/db-ops/dedupe-cap/list-dedupe-cap-shape-keys.js +27 -0
- package/lib/db-ops/errors/insert-crawl-error.d.ts +15 -0
- package/lib/db-ops/errors/insert-crawl-error.js +21 -0
- package/lib/db-ops/errors/insert-page-error.d.ts +21 -0
- package/lib/db-ops/errors/insert-page-error.js +30 -0
- package/lib/db-ops/errors/list-dns-burned-host-candidates.d.ts +33 -0
- package/lib/db-ops/errors/list-dns-burned-host-candidates.js +158 -0
- package/lib/db-ops/html/read-page-html-blob.d.ts +17 -0
- package/lib/db-ops/html/read-page-html-blob.js +20 -0
- package/lib/db-ops/lifecycle/checkpoint.d.ts +8 -0
- package/lib/db-ops/lifecycle/checkpoint.js +9 -0
- package/lib/db-ops/lifecycle/destroy.d.ts +6 -0
- package/lib/db-ops/lifecycle/destroy.js +7 -0
- package/lib/db-ops/lifecycle/init.d.ts +58 -0
- package/lib/db-ops/lifecycle/init.js +122 -0
- package/lib/db-ops/list-reconcile/record-list-reconcile-run.d.ts +22 -0
- package/lib/db-ops/list-reconcile/record-list-reconcile-run.js +41 -0
- package/lib/db-ops/meta/get-audios-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-audios-of-page.js +15 -0
- package/lib/db-ops/meta/get-buttons-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-buttons-of-page.js +15 -0
- package/lib/db-ops/meta/get-canvases-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-canvases-of-page.js +15 -0
- package/lib/db-ops/meta/get-custom-elements-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-custom-elements-of-page.js +15 -0
- package/lib/db-ops/meta/get-headings-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-headings-of-page.js +15 -0
- package/lib/db-ops/meta/get-iframes-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-iframes-of-page.js +15 -0
- package/lib/db-ops/meta/get-jsonld-of-page.d.ts +13 -0
- package/lib/db-ops/meta/get-jsonld-of-page.js +27 -0
- package/lib/db-ops/meta/get-main-content-images-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-main-content-images-of-page.js +15 -0
- package/lib/db-ops/meta/get-main-content-tables-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-main-content-tables-of-page.js +15 -0
- package/lib/db-ops/meta/get-page-technologies-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-page-technologies-of-page.js +15 -0
- package/lib/db-ops/meta/get-technology-signals-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-technology-signals-of-page.js +15 -0
- package/lib/db-ops/meta/get-videos-of-page.d.ts +11 -0
- package/lib/db-ops/meta/get-videos-of-page.js +15 -0
- package/lib/db-ops/outages/close-network-outage.d.ts +12 -0
- package/lib/db-ops/outages/close-network-outage.js +15 -0
- package/lib/db-ops/outages/close-stale-open-network-outages.d.ts +26 -0
- package/lib/db-ops/outages/close-stale-open-network-outages.js +42 -0
- package/lib/db-ops/outages/compute-outage-clamp-timestamp.d.ts +26 -0
- package/lib/db-ops/outages/compute-outage-clamp-timestamp.js +31 -0
- package/lib/db-ops/outages/insert-network-outage.d.ts +14 -0
- package/lib/db-ops/outages/insert-network-outage.js +29 -0
- package/lib/db-ops/outages/list-network-outages.d.ts +28 -0
- package/lib/db-ops/outages/list-network-outages.js +42 -0
- package/lib/db-ops/pages/order/set-url-order.d.ts +13 -0
- package/lib/db-ops/pages/order/set-url-order.js +38 -0
- package/lib/db-ops/pages/read/build-page-query.d.ts +18 -0
- package/lib/db-ops/pages/read/build-page-query.js +40 -0
- package/lib/db-ops/pages/read/get-crawling-state.d.ts +117 -0
- package/lib/db-ops/pages/read/get-crawling-state.js +161 -0
- package/lib/db-ops/pages/read/get-existing-page-urls.d.ts +15 -0
- package/lib/db-ops/pages/read/get-existing-page-urls.js +30 -0
- package/lib/db-ops/pages/read/get-page-count.d.ts +12 -0
- package/lib/db-ops/pages/read/get-page-count.js +21 -0
- package/lib/db-ops/pages/read/get-page-source-by-url.d.ts +24 -0
- package/lib/db-ops/pages/read/get-page-source-by-url.js +28 -0
- package/lib/db-ops/pages/read/get-pages-with-rels.d.ts +38 -0
- package/lib/db-ops/pages/read/get-pages-with-rels.js +107 -0
- package/lib/db-ops/pages/read/get-pages.d.ts +11 -0
- package/lib/db-ops/pages/read/get-pages.js +51 -0
- package/lib/db-ops/pages/read/get-scraped-html-page-count.d.ts +18 -0
- package/lib/db-ops/pages/read/get-scraped-html-page-count.js +25 -0
- package/lib/db-ops/pages/read/reconstruct-page-rows.d.ts +31 -0
- package/lib/db-ops/pages/read/reconstruct-page-rows.js +32 -0
- package/lib/db-ops/pages/reset/clear-page-derived-rows.d.ts +20 -0
- package/lib/db-ops/pages/reset/clear-page-derived-rows.js +37 -0
- package/lib/db-ops/pages/reset/repromote-external-pages.d.ts +30 -0
- package/lib/db-ops/pages/reset/repromote-external-pages.js +91 -0
- package/lib/db-ops/pages/reset/reset-failed-pages.d.ts +88 -0
- package/lib/db-ops/pages/reset/reset-failed-pages.js +216 -0
- package/lib/db-ops/pages/reset/reset-pages-by-urls.d.ts +80 -0
- package/lib/db-ops/pages/reset/reset-pages-by-urls.js +151 -0
- package/lib/db-ops/pages/reset/retryable-image-scan-codes.d.ts +24 -0
- package/lib/db-ops/pages/reset/retryable-image-scan-codes.js +24 -0
- package/lib/db-ops/pages/write/insert-audios.d.ts +14 -0
- package/lib/db-ops/pages/write/insert-audios.js +25 -0
- package/lib/db-ops/pages/write/insert-buttons.d.ts +14 -0
- package/lib/db-ops/pages/write/insert-buttons.js +29 -0
- package/lib/db-ops/pages/write/insert-canvases.d.ts +14 -0
- package/lib/db-ops/pages/write/insert-canvases.js +26 -0
- package/lib/db-ops/pages/write/insert-custom-elements.d.ts +27 -0
- package/lib/db-ops/pages/write/insert-custom-elements.js +40 -0
- package/lib/db-ops/pages/write/insert-headings.d.ts +15 -0
- package/lib/db-ops/pages/write/insert-headings.js +27 -0
- package/lib/db-ops/pages/write/insert-iframes.d.ts +14 -0
- package/lib/db-ops/pages/write/insert-iframes.js +28 -0
- package/lib/db-ops/pages/write/insert-inventory-content-items.d.ts +38 -0
- package/lib/db-ops/pages/write/insert-inventory-content-items.js +60 -0
- package/lib/db-ops/pages/write/insert-inventory-seeds.d.ts +36 -0
- package/lib/db-ops/pages/write/insert-inventory-seeds.js +48 -0
- package/lib/db-ops/pages/write/insert-inventory-skipped-pages.d.ts +42 -0
- package/lib/db-ops/pages/write/insert-inventory-skipped-pages.js +56 -0
- package/lib/db-ops/pages/write/insert-jsonld.d.ts +17 -0
- package/lib/db-ops/pages/write/insert-jsonld.js +49 -0
- package/lib/db-ops/pages/write/insert-main-content-images.d.ts +20 -0
- package/lib/db-ops/pages/write/insert-main-content-images.js +32 -0
- package/lib/db-ops/pages/write/insert-main-content-tables.d.ts +14 -0
- package/lib/db-ops/pages/write/insert-main-content-tables.js +29 -0
- package/lib/db-ops/pages/write/insert-page.d.ts +56 -0
- package/lib/db-ops/pages/write/insert-page.js +259 -0
- package/lib/db-ops/pages/write/insert-technologies.d.ts +25 -0
- package/lib/db-ops/pages/write/insert-technologies.js +45 -0
- package/lib/db-ops/pages/write/insert-videos.d.ts +14 -0
- package/lib/db-ops/pages/write/insert-videos.js +28 -0
- package/lib/db-ops/pages/write/link-redirect-sources.d.ts +42 -0
- package/lib/db-ops/pages/write/link-redirect-sources.js +101 -0
- package/lib/db-ops/pages/write/record-redirect.d.ts +35 -0
- package/lib/db-ops/pages/write/record-redirect.js +100 -0
- package/lib/db-ops/pages/write/set-skipped-page.d.ts +13 -0
- package/lib/db-ops/pages/write/set-skipped-page.js +24 -0
- package/lib/db-ops/pages/write/update-page.d.ts +40 -0
- package/lib/db-ops/pages/write/update-page.js +419 -0
- package/lib/db-ops/pages/write/write-page-html-blob.d.ts +19 -0
- package/lib/db-ops/pages/write/write-page-html-blob.js +41 -0
- package/lib/db-ops/referrers/get-redirects-for-pages.d.ts +9 -0
- package/lib/db-ops/referrers/get-redirects-for-pages.js +15 -0
- package/lib/db-ops/referrers/get-referrers-of-page.d.ts +17 -0
- package/lib/db-ops/referrers/get-referrers-of-page.js +32 -0
- package/lib/db-ops/referrers/get-referrers-of-resource.d.ts +8 -0
- package/lib/db-ops/referrers/get-referrers-of-resource.js +15 -0
- package/lib/db-ops/resources/build-resource-query.d.ts +25 -0
- package/lib/db-ops/resources/build-resource-query.js +29 -0
- package/lib/db-ops/resources/get-existing-resource-urls.d.ts +9 -0
- package/lib/db-ops/resources/get-existing-resource-urls.js +24 -0
- package/lib/db-ops/resources/get-resource-by-url.d.ts +13 -0
- package/lib/db-ops/resources/get-resource-by-url.js +22 -0
- package/lib/db-ops/resources/get-resource-url-list.d.ts +17 -0
- package/lib/db-ops/resources/get-resource-url-list.js +26 -0
- package/lib/db-ops/resources/get-resources.d.ts +8 -0
- package/lib/db-ops/resources/get-resources.js +11 -0
- package/lib/db-ops/resources/insert-inventory-resources.d.ts +24 -0
- package/lib/db-ops/resources/insert-inventory-resources.js +64 -0
- package/lib/db-ops/resources/insert-resource-referrers.d.ts +15 -0
- package/lib/db-ops/resources/insert-resource-referrers.js +54 -0
- package/lib/db-ops/resources/insert-resource.d.ts +34 -0
- package/lib/db-ops/resources/insert-resource.js +73 -0
- package/lib/db-ops/resources/reconstruct-resource-rows.d.ts +26 -0
- package/lib/db-ops/resources/reconstruct-resource-rows.js +30 -0
- package/lib/db-ops/templates/assign-template-labels.d.ts +60 -0
- package/lib/db-ops/templates/assign-template-labels.js +187 -0
- package/lib/db-ops/templates/replace-page-templates.d.ts +44 -0
- package/lib/db-ops/templates/replace-page-templates.js +174 -0
- package/lib/db-ops/templates/serialize-template-cluster-reason.d.ts +16 -0
- package/lib/db-ops/templates/serialize-template-cluster-reason.js +17 -0
- package/lib/db-ops/templates/types.d.ts +103 -0
- package/lib/db-ops/templates/types.js +1 -0
- package/lib/debug.d.ts +8 -0
- package/lib/debug.js +9 -0
- package/lib/decode-html-blob.d.ts +20 -0
- package/lib/decode-html-blob.js +23 -0
- package/lib/decode-page-html-blob-bytes.d.ts +25 -0
- package/lib/decode-page-html-blob-bytes.js +29 -0
- package/lib/decode-stored-blob-bytes.d.ts +25 -0
- package/lib/decode-stored-blob-bytes.js +47 -0
- package/lib/derive-lineage-from-parent.d.ts +37 -0
- package/lib/derive-lineage-from-parent.js +42 -0
- package/lib/drop-legacy-tables.d.ts +45 -0
- package/lib/drop-legacy-tables.js +56 -0
- package/lib/error-kind/classify-error-kind.d.ts +20 -0
- package/lib/error-kind/classify-error-kind.js +136 -0
- package/lib/error-kind/network-related-error-kinds.d.ts +23 -0
- package/lib/error-kind/network-related-error-kinds.js +28 -0
- package/lib/error-kind/permanent-error-kinds.d.ts +48 -0
- package/lib/error-kind/permanent-error-kinds.js +54 -0
- package/lib/error-kind/types.d.ts +54 -0
- package/lib/error-kind/types.js +1 -0
- package/lib/filesystem/append-text.d.ts +9 -0
- package/lib/filesystem/append-text.js +14 -0
- package/lib/filesystem/copy-dir-sync.d.ts +6 -0
- package/lib/filesystem/copy-dir-sync.js +9 -0
- package/lib/filesystem/copy-dir.d.ts +7 -0
- package/lib/filesystem/copy-dir.js +13 -0
- package/lib/filesystem/copy-file-with-progress.d.ts +20 -0
- package/lib/filesystem/copy-file-with-progress.js +34 -0
- package/lib/filesystem/exists.d.ts +6 -0
- package/lib/filesystem/exists.js +9 -0
- package/lib/filesystem/get-file-list.d.ts +8 -0
- package/lib/filesystem/get-file-list.js +12 -0
- package/lib/filesystem/is-dir.d.ts +6 -0
- package/lib/filesystem/is-dir.js +10 -0
- package/lib/filesystem/mkdir.d.ts +8 -0
- package/lib/filesystem/mkdir.js +15 -0
- package/lib/filesystem/output-binary.d.ts +12 -0
- package/lib/filesystem/output-binary.js +17 -0
- package/lib/filesystem/output-json.d.ts +9 -0
- package/lib/filesystem/output-json.js +14 -0
- package/lib/filesystem/output-text.d.ts +11 -0
- package/lib/filesystem/output-text.js +32 -0
- package/lib/filesystem/parse-pax-path.d.ts +18 -0
- package/lib/filesystem/parse-pax-path.js +45 -0
- package/lib/filesystem/parse-tar-size-field.d.ts +13 -0
- package/lib/filesystem/parse-tar-size-field.js +37 -0
- package/lib/filesystem/peek-tar-top-dir.d.ts +35 -0
- package/lib/filesystem/peek-tar-top-dir.js +215 -0
- package/lib/filesystem/read-json.d.ts +7 -0
- package/lib/filesystem/read-json.js +11 -0
- package/lib/filesystem/read-text.d.ts +6 -0
- package/lib/filesystem/read-text.js +10 -0
- package/lib/filesystem/readline.d.ts +11 -0
- package/lib/filesystem/readline.js +26 -0
- package/lib/filesystem/remove.d.ts +5 -0
- package/lib/filesystem/remove.js +10 -0
- package/lib/filesystem/rename.d.ts +16 -0
- package/lib/filesystem/rename.js +48 -0
- package/lib/filesystem/tar.d.ts +23 -0
- package/lib/filesystem/tar.js +78 -0
- package/lib/filesystem/untar.d.ts +33 -0
- package/lib/filesystem/untar.js +84 -0
- package/lib/get-failed-page-messages.d.ts +56 -0
- package/lib/get-failed-page-messages.js +146 -0
- package/lib/get-json.d.ts +10 -0
- package/lib/get-json.js +25 -0
- package/lib/html-snapshot/match-selector-html.d.ts +25 -0
- package/lib/html-snapshot/match-selector-html.js +28 -0
- package/lib/html-snapshot/match-selector-snapshots.d.ts +33 -0
- package/lib/html-snapshot/match-selector-snapshots.js +33 -0
- package/lib/html-snapshot/search-html-document.d.ts +29 -0
- package/lib/html-snapshot/search-html-document.js +27 -0
- package/lib/html-snapshot/search-html-snapshots.d.ts +36 -0
- package/lib/html-snapshot/search-html-snapshots.js +35 -0
- package/lib/html-snapshot/types.d.ts +111 -0
- package/lib/html-snapshot/types.js +7 -0
- package/lib/html-snapshot/validate-search-pattern.d.ts +15 -0
- package/lib/html-snapshot/validate-search-pattern.js +17 -0
- package/lib/init-schema.d.ts +48 -0
- package/lib/init-schema.js +124 -0
- package/lib/is-inventory-source.d.ts +21 -0
- package/lib/is-inventory-source.js +22 -0
- package/lib/is-within-outage-window.d.ts +49 -0
- package/lib/is-within-outage-window.js +33 -0
- package/lib/isolated-cluster/create-isolated-cluster-run.d.ts +24 -0
- package/lib/isolated-cluster/create-isolated-cluster-run.js +26 -0
- package/lib/libsql-dialect.d.ts +115 -0
- package/lib/libsql-dialect.js +116 -0
- package/lib/limited-page-ids.d.ts +9 -0
- package/lib/limited-page-ids.js +18 -0
- package/lib/meta/assert-compatible-version.d.ts +60 -0
- package/lib/meta/assert-compatible-version.js +93 -0
- package/lib/meta/classify-jsonld-type.d.ts +23 -0
- package/lib/meta/classify-jsonld-type.js +43 -0
- package/lib/meta/compare-semver.d.ts +23 -0
- package/lib/meta/compare-semver.js +51 -0
- package/lib/meta/compute-main-contents-denormalized.d.ts +41 -0
- package/lib/meta/compute-main-contents-denormalized.js +88 -0
- package/lib/meta/compute-page-denormalized.d.ts +20 -0
- package/lib/meta/compute-page-denormalized.js +35 -0
- package/lib/meta/derive-flat-from-meta.d.ts +34 -0
- package/lib/meta/derive-flat-from-meta.js +158 -0
- package/lib/meta/derive-meta-extras.d.ts +20 -0
- package/lib/meta/derive-meta-extras.js +23 -0
- package/lib/meta/extract-tags-for-archive.d.ts +17 -0
- package/lib/meta/extract-tags-for-archive.js +36 -0
- package/lib/meta/parse-main-content-class-list.d.ts +19 -0
- package/lib/meta/parse-main-content-class-list.js +34 -0
- package/lib/meta/summarize-jsonld.d.ts +17 -0
- package/lib/meta/summarize-jsonld.js +29 -0
- package/lib/meta/technologies/combine-technology-confidence.d.ts +46 -0
- package/lib/meta/technologies/combine-technology-confidence.js +93 -0
- package/lib/meta/technologies/convert-legacy-page-tags-to-inserts.d.ts +45 -0
- package/lib/meta/technologies/convert-legacy-page-tags-to-inserts.js +53 -0
- package/lib/meta/technologies/convert-tag-row-to-wappalyzer-signal.d.ts +33 -0
- package/lib/meta/technologies/convert-tag-row-to-wappalyzer-signal.js +46 -0
- package/lib/meta/technologies/extract-technologies-for-archive.d.ts +33 -0
- package/lib/meta/technologies/extract-technologies-for-archive.js +30 -0
- package/lib/meta/technologies/match-js-license-comment-signal.d.ts +21 -0
- package/lib/meta/technologies/match-js-license-comment-signal.js +23 -0
- package/lib/meta/technologies/match-structural-technology-signals.d.ts +26 -0
- package/lib/meta/technologies/match-structural-technology-signals.js +48 -0
- package/lib/meta/technologies/normalize-wappalyzer-entries.d.ts +25 -0
- package/lib/meta/technologies/normalize-wappalyzer-entries.js +35 -0
- package/lib/meta/technologies/technology-signal-definitions.d.ts +44 -0
- package/lib/meta/technologies/technology-signal-definitions.js +60 -0
- package/lib/meta/technologies/types.d.ts +70 -0
- package/lib/meta/technologies/types.js +13 -0
- package/lib/meta/types.d.ts +1490 -0
- package/lib/meta/types.js +65 -0
- package/lib/migrate-content-items-alias-of-id.d.ts +52 -0
- package/lib/migrate-content-items-alias-of-id.js +69 -0
- package/lib/migrate-content-items-dedupe-cap-event-id.d.ts +46 -0
- package/lib/migrate-content-items-dedupe-cap-event-id.js +62 -0
- package/lib/migrate-content-items-is-metadata-only.d.ts +44 -0
- package/lib/migrate-content-items-is-metadata-only.js +60 -0
- package/lib/migrate-entity-tables.d.ts +55 -0
- package/lib/migrate-entity-tables.js +66 -0
- package/lib/migrate-info-created-cwd.d.ts +17 -0
- package/lib/migrate-info-created-cwd.js +36 -0
- package/lib/migrate-info-main-content-selector.d.ts +16 -0
- package/lib/migrate-info-main-content-selector.js +35 -0
- package/lib/migrate-info-request-header-names.d.ts +16 -0
- package/lib/migrate-info-request-header-names.js +35 -0
- package/lib/migrate-info-roots.d.ts +20 -0
- package/lib/migrate-info-roots.js +52 -0
- package/lib/migrate-inventory-runs-to-list-reconcile-runs.d.ts +34 -0
- package/lib/migrate-inventory-runs-to-list-reconcile-runs.js +51 -0
- package/lib/migrate-list-reconcile-runs-exclude-skipped.d.ts +25 -0
- package/lib/migrate-list-reconcile-runs-exclude-skipped.js +44 -0
- package/lib/migrate-list-reconcile-runs-invalid-skipped.d.ts +16 -0
- package/lib/migrate-list-reconcile-runs-invalid-skipped.js +35 -0
- package/lib/migrate-main-contents-columns.d.ts +26 -0
- package/lib/migrate-main-contents-columns.js +61 -0
- package/lib/migrate-page-meta-body-hash.d.ts +44 -0
- package/lib/migrate-page-meta-body-hash.js +63 -0
- package/lib/migrate-page-meta-console-error-count.d.ts +27 -0
- package/lib/migrate-page-meta-console-error-count.js +45 -0
- package/lib/migrate-page-meta-custom-element-count.d.ts +33 -0
- package/lib/migrate-page-meta-custom-element-count.js +51 -0
- package/lib/migrate-page-meta-image-scan.d.ts +27 -0
- package/lib/migrate-page-meta-image-scan.js +52 -0
- package/lib/migrate-page-tags-to-page-technologies.d.ts +39 -0
- package/lib/migrate-page-tags-to-page-technologies.js +79 -0
- package/lib/migrate-ref-tables.d.ts +25 -0
- package/lib/migrate-ref-tables.js +38 -0
- package/lib/native-executor/check-native-executor-config.d.ts +17 -0
- package/lib/native-executor/check-native-executor-config.js +20 -0
- package/lib/page-meta-column-maps.d.ts +32 -0
- package/lib/page-meta-column-maps.js +43 -0
- package/lib/page.d.ts +546 -0
- package/lib/page.js +764 -0
- package/lib/peek-archive-lock.d.ts +40 -0
- package/lib/peek-archive-lock.js +62 -0
- package/lib/populate-entity-tables/collapse-anchor-rows.d.ts +41 -0
- package/lib/populate-entity-tables/collapse-anchor-rows.js +87 -0
- package/lib/populate-entity-tables/derive-dom-path.d.ts +35 -0
- package/lib/populate-entity-tables/derive-dom-path.js +72 -0
- package/lib/populate-entity-tables/is-blob-ref-value.d.ts +16 -0
- package/lib/populate-entity-tables/is-blob-ref-value.js +19 -0
- package/lib/populate-entity-tables/match-images-to-dom-paths.d.ts +66 -0
- package/lib/populate-entity-tables/match-images-to-dom-paths.js +96 -0
- package/lib/populate-entity-tables/populate-anchor-edges.d.ts +33 -0
- package/lib/populate-entity-tables/populate-anchor-edges.js +153 -0
- package/lib/populate-entity-tables/populate-content-items.d.ts +40 -0
- package/lib/populate-entity-tables/populate-content-items.js +141 -0
- package/lib/populate-entity-tables/populate-entities.d.ts +81 -0
- package/lib/populate-entity-tables/populate-entities.js +110 -0
- package/lib/populate-entity-tables/populate-image-items.d.ts +91 -0
- package/lib/populate-entity-tables/populate-image-items.js +226 -0
- package/lib/populate-entity-tables/populate-page-meta.d.ts +33 -0
- package/lib/populate-entity-tables/populate-page-meta.js +267 -0
- package/lib/populate-entity-tables/populate-resource-items.d.ts +22 -0
- package/lib/populate-entity-tables/populate-resource-items.js +114 -0
- package/lib/populate-entity-tables/populate-resource-ref-edges.d.ts +31 -0
- package/lib/populate-entity-tables/populate-resource-ref-edges.js +33 -0
- package/lib/populate-entity-tables/resolve-blob-refs.d.ts +31 -0
- package/lib/populate-entity-tables/resolve-blob-refs.js +100 -0
- package/lib/populate-entity-tables/resolve-content-type-refs.d.ts +22 -0
- package/lib/populate-entity-tables/resolve-content-type-refs.js +27 -0
- package/lib/populate-entity-tables/resolve-header-sets.d.ts +49 -0
- package/lib/populate-entity-tables/resolve-header-sets.js +122 -0
- package/lib/populate-entity-tables/resolve-json-refs.d.ts +25 -0
- package/lib/populate-entity-tables/resolve-json-refs.js +67 -0
- package/lib/populate-entity-tables/resolve-text-refs.d.ts +30 -0
- package/lib/populate-entity-tables/resolve-text-refs.js +61 -0
- package/lib/populate-entity-tables/resolve-url-or-blob-from-maps.d.ts +21 -0
- package/lib/populate-entity-tables/resolve-url-or-blob-from-maps.js +27 -0
- package/lib/populate-entity-tables/resolve-url-refs.d.ts +33 -0
- package/lib/populate-entity-tables/resolve-url-refs.js +60 -0
- package/lib/populate-entity-tables/test-utils/count-rows.d.ts +17 -0
- package/lib/populate-entity-tables/test-utils/count-rows.js +20 -0
- package/lib/populate-entity-tables/test-utils/seed-content-items.d.ts +25 -0
- package/lib/populate-entity-tables/test-utils/seed-content-items.js +42 -0
- package/lib/populate-entity-tables/test-utils/setup-entities-db.d.ts +30 -0
- package/lib/populate-entity-tables/test-utils/setup-entities-db.js +175 -0
- package/lib/populate-entity-tables/types.d.ts +157 -0
- package/lib/populate-entity-tables/types.js +12 -0
- package/lib/populate-entity-tables/upsert-text-refs.d.ts +38 -0
- package/lib/populate-entity-tables/upsert-text-refs.js +78 -0
- package/lib/populate-ref-tables/classify-content-type.d.ts +16 -0
- package/lib/populate-ref-tables/classify-content-type.js +52 -0
- package/lib/populate-ref-tables/compute-content-hash.d.ts +22 -0
- package/lib/populate-ref-tables/compute-content-hash.js +26 -0
- package/lib/populate-ref-tables/compute-header-flags.d.ts +16 -0
- package/lib/populate-ref-tables/compute-header-flags.js +70 -0
- package/lib/populate-ref-tables/content-type-rules.d.ts +38 -0
- package/lib/populate-ref-tables/content-type-rules.js +133 -0
- package/lib/populate-ref-tables/create-header-table-caches.d.ts +25 -0
- package/lib/populate-ref-tables/create-header-table-caches.js +49 -0
- package/lib/populate-ref-tables/data-uri-url-refs-limit.d.ts +15 -0
- package/lib/populate-ref-tables/data-uri-url-refs-limit.js +15 -0
- package/lib/populate-ref-tables/decode-data-uri.d.ts +21 -0
- package/lib/populate-ref-tables/decode-data-uri.js +126 -0
- package/lib/populate-ref-tables/decompose-header-set.d.ts +29 -0
- package/lib/populate-ref-tables/decompose-header-set.js +157 -0
- package/lib/populate-ref-tables/decompose-url.d.ts +25 -0
- package/lib/populate-ref-tables/decompose-url.js +70 -0
- package/lib/populate-ref-tables/header-stability.d.ts +19 -0
- package/lib/populate-ref-tables/header-stability.js +22 -0
- package/lib/populate-ref-tables/header-value-cache-key.d.ts +17 -0
- package/lib/populate-ref-tables/header-value-cache-key.js +19 -0
- package/lib/populate-ref-tables/normalize-mime.d.ts +24 -0
- package/lib/populate-ref-tables/normalize-mime.js +36 -0
- package/lib/populate-ref-tables/populate-blob-refs.d.ts +38 -0
- package/lib/populate-ref-tables/populate-blob-refs.js +134 -0
- package/lib/populate-ref-tables/populate-content-type-refs.d.ts +27 -0
- package/lib/populate-ref-tables/populate-content-type-refs.js +70 -0
- package/lib/populate-ref-tables/populate-header-tables.d.ts +35 -0
- package/lib/populate-ref-tables/populate-header-tables.js +80 -0
- package/lib/populate-ref-tables/populate-json-refs.d.ts +29 -0
- package/lib/populate-ref-tables/populate-json-refs.js +101 -0
- package/lib/populate-ref-tables/populate-refs.d.ts +51 -0
- package/lib/populate-ref-tables/populate-refs.js +62 -0
- package/lib/populate-ref-tables/populate-text-refs.d.ts +32 -0
- package/lib/populate-ref-tables/populate-text-refs.js +133 -0
- package/lib/populate-ref-tables/populate-url-refs.d.ts +28 -0
- package/lib/populate-ref-tables/populate-url-refs.js +148 -0
- package/lib/populate-ref-tables/test-utils/count-rows.d.ts +15 -0
- package/lib/populate-ref-tables/test-utils/count-rows.js +17 -0
- package/lib/populate-ref-tables/types.d.ts +197 -0
- package/lib/populate-ref-tables/types.js +7 -0
- package/lib/populate-ref-tables/upsert-one-header-set.d.ts +34 -0
- package/lib/populate-ref-tables/upsert-one-header-set.js +208 -0
- package/lib/populate-ref-tables/volatile-header-names.d.ts +20 -0
- package/lib/populate-ref-tables/volatile-header-names.js +33 -0
- package/lib/redirect-table.d.ts +9 -0
- package/lib/redirect-table.js +28 -0
- package/lib/release-finished-statements.d.ts +42 -0
- package/lib/release-finished-statements.js +45 -0
- package/lib/resolve-redirect-chain.d.ts +33 -0
- package/lib/resolve-redirect-chain.js +27 -0
- package/lib/resource.d.ts +46 -0
- package/lib/resource.js +62 -0
- package/lib/retarget-legacy-fk-tables.d.ts +61 -0
- package/lib/retarget-legacy-fk-tables.js +137 -0
- package/lib/safe-path.d.ts +9 -0
- package/lib/safe-path.js +17 -0
- package/lib/scope/build-scope-map.d.ts +21 -0
- package/lib/scope/build-scope-map.js +32 -0
- package/lib/scope/find-scope-entry.d.ts +25 -0
- package/lib/scope/find-scope-entry.js +45 -0
- package/lib/template-classification/classify-archive-page-templates.d.ts +42 -0
- package/lib/template-classification/classify-archive-page-templates.js +70 -0
- package/lib/template-classification/classify-page-templates.d.ts +33 -0
- package/lib/template-classification/classify-page-templates.js +60 -0
- package/lib/template-classification/collect-page-ids-with-html.d.ts +24 -0
- package/lib/template-classification/collect-page-ids-with-html.js +30 -0
- package/lib/template-classification/collect-page-stylesheet-urls.d.ts +32 -0
- package/lib/template-classification/collect-page-stylesheet-urls.js +132 -0
- package/lib/template-classification/create-content-root-hint.d.ts +41 -0
- package/lib/template-classification/create-content-root-hint.js +51 -0
- package/lib/template-classification/create-page-cluster-factory.d.ts +36 -0
- package/lib/template-classification/create-page-cluster-factory.js +52 -0
- package/lib/template-classification/load-page-cluster-candidates.d.ts +32 -0
- package/lib/template-classification/load-page-cluster-candidates.js +93 -0
- package/lib/template-classification/page-cluster/resolve-page-cluster-keys.d.ts +34 -0
- package/lib/template-classification/page-cluster/resolve-page-cluster-keys.js +236 -0
- package/lib/template-classification/page-cluster/types.d.ts +123 -0
- package/lib/template-classification/page-cluster/types.js +1 -0
- package/lib/template-classification/types.d.ts +234 -0
- package/lib/template-classification/types.js +1 -0
- package/lib/test-utils/build-full-schema-test-db.d.ts +34 -0
- package/lib/test-utils/build-full-schema-test-db.js +74 -0
- package/lib/test-utils/compare-strings.d.ts +12 -0
- package/lib/test-utils/compare-strings.js +14 -0
- package/lib/test-utils/create-legacy-analysis-tables.d.ts +13 -0
- package/lib/test-utils/create-legacy-analysis-tables.js +37 -0
- package/lib/test-utils/fk-parent-tables.d.ts +15 -0
- package/lib/test-utils/fk-parent-tables.js +19 -0
- package/lib/test-utils/seed-content-item.d.ts +35 -0
- package/lib/test-utils/seed-content-item.js +42 -0
- package/lib/test-utils/setup-legacy-fk-db.d.ts +34 -0
- package/lib/test-utils/setup-legacy-fk-db.js +271 -0
- package/lib/transfer/attach-source-database.d.ts +31 -0
- package/lib/transfer/attach-source-database.js +40 -0
- package/lib/transfer/build-split-config.d.ts +30 -0
- package/lib/transfer/build-split-config.js +42 -0
- package/lib/transfer/clear-replaced-page-rows.d.ts +23 -0
- package/lib/transfer/clear-replaced-page-rows.js +61 -0
- package/lib/transfer/concat-archives.d.ts +55 -0
- package/lib/transfer/concat-archives.js +95 -0
- package/lib/transfer/concat-source-transfer-phases.d.ts +10 -0
- package/lib/transfer/concat-source-transfer-phases.js +17 -0
- package/lib/transfer/content-item-rank-sql.d.ts +21 -0
- package/lib/transfer/content-item-rank-sql.js +23 -0
- package/lib/transfer/copy-anchor-edges.d.ts +28 -0
- package/lib/transfer/copy-anchor-edges.js +42 -0
- package/lib/transfer/copy-dictionaries-for-concat.d.ts +39 -0
- package/lib/transfer/copy-dictionaries-for-concat.js +81 -0
- package/lib/transfer/copy-dictionaries-for-split.d.ts +29 -0
- package/lib/transfer/copy-dictionaries-for-split.js +224 -0
- package/lib/transfer/copy-header-set-children.d.ts +27 -0
- package/lib/transfer/copy-header-set-children.js +51 -0
- package/lib/transfer/copy-image-items.d.ts +21 -0
- package/lib/transfer/copy-image-items.js +62 -0
- package/lib/transfer/copy-inventory-source-lists.d.ts +30 -0
- package/lib/transfer/copy-inventory-source-lists.js +61 -0
- package/lib/transfer/copy-journal-tables.d.ts +30 -0
- package/lib/transfer/copy-journal-tables.js +56 -0
- package/lib/transfer/copy-page-console-logs.d.ts +16 -0
- package/lib/transfer/copy-page-console-logs.js +27 -0
- package/lib/transfer/copy-page-html-blobs.d.ts +31 -0
- package/lib/transfer/copy-page-html-blobs.js +43 -0
- package/lib/transfer/copy-page-meta.d.ts +27 -0
- package/lib/transfer/copy-page-meta.js +68 -0
- package/lib/transfer/copy-page-template-clusters.d.ts +31 -0
- package/lib/transfer/copy-page-template-clusters.js +56 -0
- package/lib/transfer/copy-page-template-labels.d.ts +34 -0
- package/lib/transfer/copy-page-template-labels.js +88 -0
- package/lib/transfer/copy-resource-items.d.ts +29 -0
- package/lib/transfer/copy-resource-items.js +89 -0
- package/lib/transfer/copy-resource-ref-edges.d.ts +20 -0
- package/lib/transfer/copy-resource-ref-edges.js +33 -0
- package/lib/transfer/copy-simple-page-scoped-tables.d.ts +15 -0
- package/lib/transfer/copy-simple-page-scoped-tables.js +34 -0
- package/lib/transfer/count-external-pages-in-scope.d.ts +26 -0
- package/lib/transfer/count-external-pages-in-scope.js +40 -0
- package/lib/transfer/create-transfer-temp-tables.d.ts +30 -0
- package/lib/transfer/create-transfer-temp-tables.js +59 -0
- package/lib/transfer/dictionary-copy-specs.d.ts +32 -0
- package/lib/transfer/dictionary-copy-specs.js +28 -0
- package/lib/transfer/drop-transfer-temp-tables.d.ts +9 -0
- package/lib/transfer/drop-transfer-temp-tables.js +18 -0
- package/lib/transfer/flatten-redirect-chains.d.ts +44 -0
- package/lib/transfer/flatten-redirect-chains.js +74 -0
- package/lib/transfer/insert-content-items.d.ts +35 -0
- package/lib/transfer/insert-content-items.js +116 -0
- package/lib/transfer/list-transfer-columns.d.ts +35 -0
- package/lib/transfer/list-transfer-columns.js +45 -0
- package/lib/transfer/mark-in-scope-content-items.d.ts +31 -0
- package/lib/transfer/mark-in-scope-content-items.js +54 -0
- package/lib/transfer/merge-archive-configs.d.ts +51 -0
- package/lib/transfer/merge-archive-configs.js +85 -0
- package/lib/transfer/plan-content-items-for-concat.d.ts +33 -0
- package/lib/transfer/plan-content-items-for-concat.js +51 -0
- package/lib/transfer/plan-content-items-for-split.d.ts +42 -0
- package/lib/transfer/plan-content-items-for-split.js +83 -0
- package/lib/transfer/plan-resource-items.d.ts +40 -0
- package/lib/transfer/plan-resource-items.js +69 -0
- package/lib/transfer/quote-transfer-identifier.d.ts +18 -0
- package/lib/transfer/quote-transfer-identifier.js +20 -0
- package/lib/transfer/reclassify-resource-externality.d.ts +37 -0
- package/lib/transfer/reclassify-resource-externality.js +66 -0
- package/lib/transfer/remap-redirect-dest-ids.d.ts +34 -0
- package/lib/transfer/remap-redirect-dest-ids.js +51 -0
- package/lib/transfer/replace-content-items.d.ts +39 -0
- package/lib/transfer/replace-content-items.js +83 -0
- package/lib/transfer/simple-page-scoped-tables.d.ts +25 -0
- package/lib/transfer/simple-page-scoped-tables.js +38 -0
- package/lib/transfer/split-archive.d.ts +55 -0
- package/lib/transfer/split-archive.js +98 -0
- package/lib/transfer/split-source-transfer-phases.d.ts +11 -0
- package/lib/transfer/split-source-transfer-phases.js +18 -0
- package/lib/transfer/transfer-action.d.ts +34 -0
- package/lib/transfer/transfer-action.js +32 -0
- package/lib/transfer/transfer-archive-rows.d.ts +65 -0
- package/lib/transfer/transfer-archive-rows.js +156 -0
- package/lib/transfer/transfer-dictionary-tables.d.ts +12 -0
- package/lib/transfer/transfer-dictionary-tables.js +22 -0
- package/lib/transfer/transfer-post-phases.d.ts +10 -0
- package/lib/transfer/transfer-post-phases.js +13 -0
- package/lib/transfer/transfer-source-alias.d.ts +9 -0
- package/lib/transfer/transfer-source-alias.js +9 -0
- package/lib/transfer/types.d.ts +111 -0
- package/lib/transfer/types.js +35 -0
- package/lib/types.d.ts +772 -0
- package/lib/types.js +1 -0
- package/lib/url-alias/compute-tier-a-alias-key.d.ts +44 -0
- package/lib/url-alias/compute-tier-a-alias-key.js +47 -0
- package/lib/url-alias/compute-tier-b-alias-key.d.ts +23 -0
- package/lib/url-alias/compute-tier-b-alias-key.js +26 -0
- package/lib/url-alias/group-alias-candidates.d.ts +27 -0
- package/lib/url-alias/group-alias-candidates.js +29 -0
- package/lib/url-alias/types.d.ts +12 -0
- package/lib/url-alias/types.js +1 -0
- package/lib/url-pattern/compute-shape-key.d.ts +58 -0
- package/lib/url-pattern/compute-shape-key.js +129 -0
- package/lib/url-pattern/decompose-url.d.ts +33 -0
- package/lib/url-pattern/decompose-url.js +79 -0
- package/lib/url-pattern/reconstruct-url.d.ts +15 -0
- package/lib/url-pattern/reconstruct-url.js +33 -0
- package/lib/url-sort/compute-url-sort-ranks.d.ts +30 -0
- package/lib/url-sort/compute-url-sort-ranks.js +33 -0
- package/lib/utils/array/each-splitted.d.ts +10 -0
- package/lib/utils/array/each-splitted.js +14 -0
- package/lib/utils/debug.d.ts +8 -0
- package/lib/utils/debug.js +8 -0
- package/lib/utils/error/emit-error-with-retry.d.ts +40 -0
- package/lib/utils/error/emit-error-with-retry.js +44 -0
- package/lib/utils/error/emit-error.d.ts +39 -0
- package/lib/utils/error/emit-error.js +41 -0
- package/lib/utils/object/parse-response-headers.d.ts +12 -0
- package/lib/utils/object/parse-response-headers.js +26 -0
- package/lib/utils/object/redact-request-headers.d.ts +15 -0
- package/lib/utils/object/redact-request-headers.js +27 -0
- package/lib/utils/types/types.d.ts +383 -0
- package/lib/utils/types/types.js +1 -0
- package/lib/verify-migration/capture-rejection.d.ts +24 -0
- package/lib/verify-migration/capture-rejection.js +31 -0
- package/lib/verify-migration/check-anchor-edges-count.d.ts +34 -0
- package/lib/verify-migration/check-anchor-edges-count.js +72 -0
- package/lib/verify-migration/check-anchor-edges-sum.d.ts +13 -0
- package/lib/verify-migration/check-anchor-edges-sum.js +27 -0
- package/lib/verify-migration/check-content-items-count.d.ts +16 -0
- package/lib/verify-migration/check-content-items-count.js +30 -0
- package/lib/verify-migration/check-content-type-preservation.d.ts +22 -0
- package/lib/verify-migration/check-content-type-preservation.js +40 -0
- package/lib/verify-migration/check-foreign-key-integrity.d.ts +31 -0
- package/lib/verify-migration/check-foreign-key-integrity.js +47 -0
- package/lib/verify-migration/check-image-items-count.d.ts +12 -0
- package/lib/verify-migration/check-image-items-count.js +26 -0
- package/lib/verify-migration/check-page-meta-count.d.ts +15 -0
- package/lib/verify-migration/check-page-meta-count.js +31 -0
- package/lib/verify-migration/check-reader-parity.d.ts +23 -0
- package/lib/verify-migration/check-reader-parity.js +182 -0
- package/lib/verify-migration/check-resource-items-count.d.ts +17 -0
- package/lib/verify-migration/check-resource-items-count.js +33 -0
- package/lib/verify-migration/check-url-round-trip.d.ts +43 -0
- package/lib/verify-migration/check-url-round-trip.js +112 -0
- package/lib/verify-migration/types.d.ts +70 -0
- package/lib/verify-migration/types.js +63 -0
- package/lib/verify-migration/verify-migration.d.ts +41 -0
- package/lib/verify-migration/verify-migration.js +120 -0
- package/lib/with-bulk-write-pragmas.d.ts +51 -0
- package/lib/with-bulk-write-pragmas.js +132 -0
- package/lib/write-queue.d.ts +32 -0
- package/lib/write-queue.js +55 -0
- package/package.json +350 -3
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import type { TemplateClusterReason } from './db-ops/templates/types.js';
|
|
2
|
+
import type { OutageWindow } from './is-within-outage-window.js';
|
|
3
|
+
import type { JsonLdRow, MainContentAudioRow, MainContentButtonRow, MainContentCanvasRow, MainContentCustomElementRow, MainContentHeadingRow, MainContentIframeRow, MainContentImageRow, MainContentTableRow, MainContentVideoRow, PageTechnologyRow, TechnologySignalRow } from './meta/types.js';
|
|
4
|
+
import type { Config, DatabaseOption, DB_Redirect, DB_Resource, DatabaseEvent, DedupeCapObservationRow, InsertDedupeCapEventParams, InsertNetworkOutageParams, ListReconcileRunMeta, PageFilter, PageSource, ResetPagesByUrlsResult } from './types.js';
|
|
5
|
+
import type { PageData, Resource, ConsoleLogEntry } from './utils/types/types.js';
|
|
6
|
+
import type { ExURL, ParseURLOptions } from '@d-zero/shared/parse-url';
|
|
7
|
+
import type { Knex } from 'knex';
|
|
8
|
+
import { TypedAwaitEventEmitter as EventEmitter } from '@d-zero/shared/typed-await-event-emitter';
|
|
9
|
+
/**
|
|
10
|
+
* Low-level database abstraction layer for the archive's SQLite database.
|
|
11
|
+
*
|
|
12
|
+
* Every method is a thin dispatcher: the SQL itself lives in a dedicated
|
|
13
|
+
* single-export op module under `./db-ops/` (one file per operation), and
|
|
14
|
+
* the class contributes only the connection (`this.#instance`) plus the
|
|
15
|
+
* error/retry wrapper. Public methods that perform database queries use the
|
|
16
|
+
* `emitErrorAndRetry` HOF for automatic retry on transient failures combined
|
|
17
|
+
* with error-event propagation, or `emitError` when retry is not appropriate.
|
|
18
|
+
* The set of tables this layer manages is defined by `init-schema.ts` (the
|
|
19
|
+
* source of truth — query that file for the canonical list).
|
|
20
|
+
*
|
|
21
|
+
* **Label sync caveat**: each `emitError` / `emitErrorAndRetry` call passes
|
|
22
|
+
* the method name as a string literal (e.g. `'Database.getAnchorsOnPage'`).
|
|
23
|
+
* TypeScript cannot check that the string matches the enclosing method's
|
|
24
|
+
* real name — the two-way sync is manual. Renaming a method here **must**
|
|
25
|
+
* update the literal string too, otherwise debug logs and `RetryTimeoutError`
|
|
26
|
+
* messages will silently report the old name.
|
|
27
|
+
*
|
|
28
|
+
* Use the static {@link Database.connect} factory method to create instances.
|
|
29
|
+
* The constructor is private.
|
|
30
|
+
*/
|
|
31
|
+
export declare class Database extends EventEmitter<DatabaseEvent> {
|
|
32
|
+
#private;
|
|
33
|
+
private constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Adds onto the `rejected_count` of a shape's `dedupe_cap_events` row,
|
|
36
|
+
* looked up by `shape_key` rather than `id`. Delegates to
|
|
37
|
+
* {@link accumulateDedupeCapRejectedCountOp}.
|
|
38
|
+
* @param shapeKey - The capped shape whose rejection count to accumulate.
|
|
39
|
+
* @param rejectedCount - Additional anchors rejected for this shape in the current session.
|
|
40
|
+
*/
|
|
41
|
+
accumulateDedupeCapRejectedCount(shapeKey: string, rejectedCount: number): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Forces a WAL checkpoint, writing all pending WAL data back to the main
|
|
44
|
+
* database file. Delegates to {@link checkpointOp}.
|
|
45
|
+
*/
|
|
46
|
+
checkpoint(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Closes an outage row by stamping `ended_at` — a no-op if the row is
|
|
49
|
+
* already closed. Delegates to {@link closeNetworkOutageOp}.
|
|
50
|
+
* @param id - The `network_outages.id` to close.
|
|
51
|
+
* @param endedAt - Epoch ms the outage is considered to have ended.
|
|
52
|
+
*/
|
|
53
|
+
closeNetworkOutage(id: number, endedAt: number): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Destroys the database connection, releasing all pooled resources.
|
|
56
|
+
* Delegates to {@link destroyOp}.
|
|
57
|
+
*/
|
|
58
|
+
destroy(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Finalizes a `dedupe_cap_events` row by stamping `rejected_count` — a
|
|
61
|
+
* no-op if the row is already finalized. Delegates to
|
|
62
|
+
* {@link finalizeDedupeCapEventOp}.
|
|
63
|
+
* @param id - The `dedupe_cap_events.id` to finalize.
|
|
64
|
+
* @param rejectedCount - Number of anchors rejected for this shape after it capped.
|
|
65
|
+
*/
|
|
66
|
+
finalizeDedupeCapEvent(id: number, rejectedCount: number): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Retrieves all anchors (outgoing links) on a specific page.
|
|
69
|
+
* Delegates to {@link getAnchorsOnPageOp}.
|
|
70
|
+
* @param pageId - The database ID of the page whose anchors to retrieve.
|
|
71
|
+
* @returns An array of anchor records with resolved URL, title, status, and content type.
|
|
72
|
+
*/
|
|
73
|
+
getAnchorsOnPage(pageId: number): Promise<any[]>;
|
|
74
|
+
/**
|
|
75
|
+
* Retrieves all `page_main_content_audios` rows for the given page id.
|
|
76
|
+
* Delegates to {@link getAudiosOfPageOp}.
|
|
77
|
+
* @param pageId
|
|
78
|
+
*/
|
|
79
|
+
getAudiosOfPage(pageId: number): Promise<MainContentAudioRow[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Retrieves the base URL of the crawl session from the `info` table.
|
|
82
|
+
* Delegates to {@link getBaseUrlOp}.
|
|
83
|
+
* @returns The base URL string.
|
|
84
|
+
* @throws {Error} If no base URL is found in the database.
|
|
85
|
+
*/
|
|
86
|
+
getBaseUrl(): Promise<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Retrieves all `page_main_content_buttons` rows for the given page id.
|
|
89
|
+
* Delegates to {@link getButtonsOfPageOp}.
|
|
90
|
+
* @param pageId
|
|
91
|
+
*/
|
|
92
|
+
getButtonsOfPage(pageId: number): Promise<MainContentButtonRow[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves all `page_main_content_canvases` rows for the given page id.
|
|
95
|
+
* Delegates to {@link getCanvasesOfPageOp}.
|
|
96
|
+
* @param pageId
|
|
97
|
+
*/
|
|
98
|
+
getCanvasesOfPage(pageId: number): Promise<MainContentCanvasRow[]>;
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves the full crawl configuration from the `info` table.
|
|
101
|
+
* Delegates to {@link getConfigOp}.
|
|
102
|
+
* @returns The parsed {@link Config} object.
|
|
103
|
+
* @throws {Error} If no configuration is found in the database.
|
|
104
|
+
*/
|
|
105
|
+
getConfig(): Promise<Config>;
|
|
106
|
+
/**
|
|
107
|
+
* Retrieves the current crawling state by listing scraped and pending URLs.
|
|
108
|
+
* Delegates to {@link getCrawlingStateOp} — see the op for the strict
|
|
109
|
+
* pending-set rationale.
|
|
110
|
+
* @returns An object with `scraped` (completed URLs), `pending` (the
|
|
111
|
+
* strict set of in-scope, anchor-referenced, unfinished URLs), and
|
|
112
|
+
* `pendingMetadataOnly` (the subset of `pending` fated for a
|
|
113
|
+
* metadata-only scrape — see the op's doc).
|
|
114
|
+
*/
|
|
115
|
+
getCrawlingState(): Promise<{
|
|
116
|
+
scraped: string[];
|
|
117
|
+
pending: string[];
|
|
118
|
+
pendingMetadataOnly: string[];
|
|
119
|
+
}>;
|
|
120
|
+
/**
|
|
121
|
+
* Retrieves the `info.createdCwd` value stamped at stub-creation time.
|
|
122
|
+
* Delegates to {@link getCreatedCwdOp}.
|
|
123
|
+
* @returns The recorded cwd, or `null` if never stamped.
|
|
124
|
+
*/
|
|
125
|
+
getCreatedCwd(): Promise<string | null>;
|
|
126
|
+
/**
|
|
127
|
+
* Retrieves all `page_main_content_custom_elements` rows for the given
|
|
128
|
+
* page id. Delegates to {@link getCustomElementsOfPageOp}.
|
|
129
|
+
* @param pageId
|
|
130
|
+
*/
|
|
131
|
+
getCustomElementsOfPage(pageId: number): Promise<MainContentCustomElementRow[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Return the subset of `urls` that already exist in the `pages` table.
|
|
134
|
+
* Delegates to {@link getExistingPageUrlsOp}.
|
|
135
|
+
* @param urls - URL strings to probe (already in `withoutHashAndAuth` form).
|
|
136
|
+
* @returns URLs found in `pages`. Order is not preserved.
|
|
137
|
+
*/
|
|
138
|
+
getExistingPageUrls(urls: readonly string[]): Promise<string[]>;
|
|
139
|
+
/**
|
|
140
|
+
* Return the subset of `urls` that already exist in the `resources` table.
|
|
141
|
+
* Delegates to {@link getExistingResourceUrlsOp}.
|
|
142
|
+
* @param urls - URL strings to probe.
|
|
143
|
+
* @returns URLs found in `resources`.
|
|
144
|
+
*/
|
|
145
|
+
getExistingResourceUrls(urls: readonly string[]): Promise<string[]>;
|
|
146
|
+
/**
|
|
147
|
+
* Retrieves all `page_main_content_headings` rows for the given page id.
|
|
148
|
+
* Delegates to {@link getHeadingsOfPageOp}.
|
|
149
|
+
* @param pageId
|
|
150
|
+
*/
|
|
151
|
+
getHeadingsOfPage(pageId: number): Promise<MainContentHeadingRow[]>;
|
|
152
|
+
/**
|
|
153
|
+
* Reads the HTML snapshot stored as a zstd-compressed BLOB for the given page.
|
|
154
|
+
* Reads the row through {@link readPageHtmlBlobOp} with retries, then
|
|
155
|
+
* decodes it once: a decode failure is in the stored bytes and would only
|
|
156
|
+
* repeat, so it is not retried.
|
|
157
|
+
* @param pageId - The database ID of the page.
|
|
158
|
+
* @returns The decompressed HTML string, or `null` if no snapshot is stored.
|
|
159
|
+
* @throws {Error} `HTML snapshot of page <id> (page_html_blobs hash <hex>) could not be decoded: …`
|
|
160
|
+
* when the snapshot is corrupt or decompresses past `MAX_DECODED_SNAPSHOT_BYTES`
|
|
161
|
+
* (also emitted as an `'error'` event).
|
|
162
|
+
*/
|
|
163
|
+
getHtmlOfPageById(pageId: number): Promise<string | null>;
|
|
164
|
+
/**
|
|
165
|
+
* Retrieves all `page_main_content_iframes` rows for the given page id.
|
|
166
|
+
* Delegates to {@link getIframesOfPageOp}.
|
|
167
|
+
* @param pageId
|
|
168
|
+
*/
|
|
169
|
+
getIframesOfPage(pageId: number): Promise<MainContentIframeRow[]>;
|
|
170
|
+
/**
|
|
171
|
+
* Retrieves all `page_jsonld` rows for the given page id, parsed back into
|
|
172
|
+
* {@link JsonLdRow} shape. Delegates to {@link getJsonLdOfPageOp}.
|
|
173
|
+
* @param pageId
|
|
174
|
+
*/
|
|
175
|
+
getJsonLdOfPage(pageId: number): Promise<JsonLdRow[]>;
|
|
176
|
+
/**
|
|
177
|
+
* Returns the underlying Knex query builder instance for direct SQL access.
|
|
178
|
+
* This enables advanced queries (GROUP BY, HAVING, JOINs) at the database
|
|
179
|
+
* layer for performance with large datasets.
|
|
180
|
+
* @returns The Knex instance connected to the SQLite database.
|
|
181
|
+
*/
|
|
182
|
+
getKnex(): Knex;
|
|
183
|
+
/**
|
|
184
|
+
* Retrieves all `page_main_content_images` rows for the given page id.
|
|
185
|
+
* Delegates to {@link getMainContentImagesOfPageOp}.
|
|
186
|
+
* @param pageId
|
|
187
|
+
*/
|
|
188
|
+
getMainContentImagesOfPage(pageId: number): Promise<MainContentImageRow[]>;
|
|
189
|
+
/**
|
|
190
|
+
* Retrieves all `page_main_content_tables` rows for the given page id.
|
|
191
|
+
* Delegates to {@link getMainContentTablesOfPageOp}.
|
|
192
|
+
* @param pageId
|
|
193
|
+
*/
|
|
194
|
+
getMainContentTablesOfPage(pageId: number): Promise<MainContentTableRow[]>;
|
|
195
|
+
/**
|
|
196
|
+
* Retrieves the crawl session name from the `info` table.
|
|
197
|
+
* Delegates to {@link getNameOp}.
|
|
198
|
+
* @returns The name string.
|
|
199
|
+
* @throws {Error} If no name is found in the database.
|
|
200
|
+
*/
|
|
201
|
+
getName(): Promise<string>;
|
|
202
|
+
/**
|
|
203
|
+
* Counts the total number of pages in the database.
|
|
204
|
+
* Delegates to {@link getPageCountOp}.
|
|
205
|
+
* @returns The total page count.
|
|
206
|
+
* @throws {Error} If the count query fails.
|
|
207
|
+
*/
|
|
208
|
+
getPageCount(): Promise<number>;
|
|
209
|
+
/**
|
|
210
|
+
* Retrieves pages from the database with optional filtering, pagination via
|
|
211
|
+
* offset and limit. Delegates to {@link getPagesOp}.
|
|
212
|
+
* @param filter - An optional {@link PageFilter} to narrow results by content type and origin.
|
|
213
|
+
* @param offset - The number of rows to skip. Defaults to `0`.
|
|
214
|
+
* @param limit - The maximum number of rows to return. Defaults to `100000`.
|
|
215
|
+
* @returns An array of raw `DB_Page` rows.
|
|
216
|
+
*/
|
|
217
|
+
getPages(filter?: PageFilter, offset?: number, limit?: number): Promise<import("./types.js").DB_Page[]>;
|
|
218
|
+
/**
|
|
219
|
+
* Look up the `source` column of a single page by its URL key.
|
|
220
|
+
* Delegates to {@link getPageSourceByUrlOp}.
|
|
221
|
+
* @param url - URL key in `url.withoutHashAndAuth` form.
|
|
222
|
+
* @returns The recorded `source`, or `undefined` when no row exists.
|
|
223
|
+
*/
|
|
224
|
+
getPageSourceByUrl(url: string): Promise<PageSource | undefined>;
|
|
225
|
+
/**
|
|
226
|
+
* Retrieves pages along with their related redirect, anchor, and referrer data.
|
|
227
|
+
* Results are ordered by the natural URL sort order. Only non-redirected pages
|
|
228
|
+
* are returned. Delegates to {@link getPagesWithRelsOp}.
|
|
229
|
+
* @param offset - The number of rows to skip.
|
|
230
|
+
* @param limit - The maximum number of pages to return.
|
|
231
|
+
* @returns An object containing `pages`, `redirects`, `anchors`, and `referrers` arrays.
|
|
232
|
+
*/
|
|
233
|
+
getPagesWithRels(offset: number, limit: number): Promise<{
|
|
234
|
+
pages: import("./types.js").DB_Page[];
|
|
235
|
+
redirects: DB_Redirect[];
|
|
236
|
+
anchors: import("./types.js").DB_Anchor[];
|
|
237
|
+
referrers: import("./types.js").DB_Referrer[];
|
|
238
|
+
}>;
|
|
239
|
+
/**
|
|
240
|
+
* Retrieves all `page_technologies` rows for the given page id.
|
|
241
|
+
* Delegates to {@link getPageTechnologiesOfPageOp}.
|
|
242
|
+
* @param pageId
|
|
243
|
+
*/
|
|
244
|
+
getPageTechnologiesOfPage(pageId: number): Promise<PageTechnologyRow[]>;
|
|
245
|
+
/**
|
|
246
|
+
* Retrieves redirect sources for the given page IDs in bulk.
|
|
247
|
+
* Delegates to {@link getRedirectsForPagesOp}.
|
|
248
|
+
* @param pageIds - The database IDs of the destination pages.
|
|
249
|
+
* @returns An array of {@link DB_Redirect} records mapping destination pages to their redirect sources.
|
|
250
|
+
*/
|
|
251
|
+
getRedirectsForPages(pageIds: number[]): Promise<DB_Redirect[]>;
|
|
252
|
+
/**
|
|
253
|
+
* Retrieves pages that link to a specific page (incoming links / referrers),
|
|
254
|
+
* resolved through redirects. Delegates to {@link getReferrersOfPageOp}.
|
|
255
|
+
* @param pageId - The database ID of the target page.
|
|
256
|
+
* @returns An array of referrer records with URL, hash, and text content.
|
|
257
|
+
*/
|
|
258
|
+
getReferrersOfPage(pageId: number): Promise<any[]>;
|
|
259
|
+
/**
|
|
260
|
+
* Retrieves the page URLs that reference a specific resource.
|
|
261
|
+
* Delegates to {@link getReferrersOfResourceOp}.
|
|
262
|
+
* @param id - The database ID of the resource.
|
|
263
|
+
* @returns An array of page URL strings that reference the resource.
|
|
264
|
+
*/
|
|
265
|
+
getReferrersOfResource(id: number): Promise<string[]>;
|
|
266
|
+
/**
|
|
267
|
+
* Retrieves a single sub-resource from the `resources` table by its URL.
|
|
268
|
+
* Delegates to {@link getResourceByUrlOp}.
|
|
269
|
+
*
|
|
270
|
+
* Deliberately NOT wrapped with `emitError`/`emitErrorAndRetry`: the only caller (the
|
|
271
|
+
* crawler's resource-reuse hook) has a full fallback (the HEAD pre-flight),
|
|
272
|
+
* so a read failure here must not surface as a database `error` event —
|
|
273
|
+
* the orchestrator aborts the whole crawl on that event, which is the
|
|
274
|
+
* correct reaction to write failures but not to a recoverable read.
|
|
275
|
+
* @param urls - URL candidates to match against the `url` column.
|
|
276
|
+
* @returns The raw {@link DB_Resource} row, or `null` if none match.
|
|
277
|
+
*/
|
|
278
|
+
getResourceByUrl(urls: readonly string[]): Promise<DB_Resource | null>;
|
|
279
|
+
/**
|
|
280
|
+
* Retrieves all sub-resources from the `resources` table.
|
|
281
|
+
* Delegates to {@link getResourcesOp}.
|
|
282
|
+
* @returns An array of raw {@link DB_Resource} rows.
|
|
283
|
+
*/
|
|
284
|
+
getResources(): Promise<DB_Resource[]>;
|
|
285
|
+
/**
|
|
286
|
+
* Retrieves a flat list of all resource URLs from the `resources` table.
|
|
287
|
+
* Delegates to {@link getResourceUrlListOp}.
|
|
288
|
+
*
|
|
289
|
+
* `onProgress` is clamped to a high-water mark across retries: a
|
|
290
|
+
* transient failure partway through the keyset scan restarts
|
|
291
|
+
* {@link getResourceUrlListOp} from `id = 0` (its own `lastId` is a local
|
|
292
|
+
* closure variable, reset on every `fn` invocation `retryCall` retries),
|
|
293
|
+
* which would otherwise visibly rewind the reported progress backwards
|
|
294
|
+
* before catching back up.
|
|
295
|
+
* @param onProgress - Forwarded to {@link getResourceUrlListOp} — see
|
|
296
|
+
* that function's docs.
|
|
297
|
+
* @returns An array of resource URL strings.
|
|
298
|
+
*/
|
|
299
|
+
getResourceUrlList(onProgress?: (scannedUpToId: number, maxId: number) => void): Promise<string[]>;
|
|
300
|
+
/**
|
|
301
|
+
* Counts pages that were scraped as crawl targets (full HTML render).
|
|
302
|
+
* Delegates to {@link getScrapedHtmlPageCountOp}.
|
|
303
|
+
* @returns The number of `text/html` rows with `isTarget = 1` and `scraped = 1`.
|
|
304
|
+
*/
|
|
305
|
+
getScrapedHtmlPageCount(): Promise<number>;
|
|
306
|
+
/**
|
|
307
|
+
* Retrieves all `technology_signals` rows for the given page id.
|
|
308
|
+
* Delegates to {@link getTechnologySignalsOfPageOp}.
|
|
309
|
+
* @param pageId
|
|
310
|
+
*/
|
|
311
|
+
getTechnologySignalsOfPage(pageId: number): Promise<TechnologySignalRow[]>;
|
|
312
|
+
/**
|
|
313
|
+
* Retrieves all `page_main_content_videos` rows for the given page id.
|
|
314
|
+
* Delegates to {@link getVideosOfPageOp}.
|
|
315
|
+
* @param pageId
|
|
316
|
+
*/
|
|
317
|
+
getVideosOfPage(pageId: number): Promise<MainContentVideoRow[]>;
|
|
318
|
+
/**
|
|
319
|
+
* Records a crawler-level (`error` channel) failure into `crawl_errors`.
|
|
320
|
+
* Delegates to {@link insertCrawlErrorOp}.
|
|
321
|
+
* @param url - The URL the error is about, or `null` for a process-level error.
|
|
322
|
+
* @param message - The error message (one line is enough for classification).
|
|
323
|
+
* @param isExternal - Whether the URL is external to the crawl scope.
|
|
324
|
+
*/
|
|
325
|
+
insertCrawlError(url: string | null, message: string, isExternal?: boolean): Promise<void>;
|
|
326
|
+
/**
|
|
327
|
+
* Appends one row (`rejected_count = NULL`) to the `dedupe_cap_events`
|
|
328
|
+
* journal. Delegates to {@link insertDedupeCapEventOp}.
|
|
329
|
+
* @param params - The newly-capped shape's fields to record.
|
|
330
|
+
* @returns The autoincremented `id` of the newly-inserted row.
|
|
331
|
+
*/
|
|
332
|
+
insertDedupeCapEvent(params: InsertDedupeCapEventParams): Promise<number>;
|
|
333
|
+
/**
|
|
334
|
+
* Pre-insert inventory non-HTML URLs into `resources` as placeholder rows.
|
|
335
|
+
* Delegates to {@link insertInventoryResourcesOp}.
|
|
336
|
+
* @param urls - URL strings (already in `withoutHashAndAuth` form).
|
|
337
|
+
*/
|
|
338
|
+
insertInventoryResources(urls: readonly string[]): Promise<void>;
|
|
339
|
+
/**
|
|
340
|
+
* Pre-insert inventory HTML seeds into `pages` as `scraped = 0`,
|
|
341
|
+
* `source = 'inventory-seed'` placeholders. Delegates to
|
|
342
|
+
* {@link insertInventorySeedsOp} — see the op for the Ctrl+C tolerance
|
|
343
|
+
* rationale.
|
|
344
|
+
* @param urls - URL strings already in `withoutHashAndAuth` form.
|
|
345
|
+
*/
|
|
346
|
+
insertInventorySeeds(urls: readonly string[]): Promise<void>;
|
|
347
|
+
/**
|
|
348
|
+
* Records exclude-matched inventory URLs as terminal skipped pages
|
|
349
|
+
* (`scraped=1`, `is_skipped=1`, `skip_reason='excluded'`,
|
|
350
|
+
* `source='inventory-seed'`). Delegates to
|
|
351
|
+
* {@link insertInventorySkippedPagesOp} — see that op's JSDoc for the
|
|
352
|
+
* normal-crawl parity rationale.
|
|
353
|
+
* @param urls - URL strings already in `withoutHashAndAuth` form.
|
|
354
|
+
*/
|
|
355
|
+
insertInventorySkippedPages(urls: readonly string[]): Promise<void>;
|
|
356
|
+
/**
|
|
357
|
+
* Appends one open (`ended_at = NULL`) row to the `network_outages`
|
|
358
|
+
* journal. Delegates to {@link insertNetworkOutageOp}.
|
|
359
|
+
* @param params - The confirmed-outage fields to record.
|
|
360
|
+
* @returns The autoincremented `id` of the newly-inserted row.
|
|
361
|
+
*/
|
|
362
|
+
insertNetworkOutage(params: InsertNetworkOutageParams): Promise<number>;
|
|
363
|
+
/**
|
|
364
|
+
* Records a partial scrape failure against the page identified by `url`.
|
|
365
|
+
* Delegates to {@link insertPageErrorOp}.
|
|
366
|
+
* @param url - URL of the page being scraped.
|
|
367
|
+
* @param phase - Scrape phase name (typically `'retryExhausted'`).
|
|
368
|
+
* @param message - Human-readable failure message.
|
|
369
|
+
* @param isExternal - Whether the URL is external. Defaults to `false`.
|
|
370
|
+
*/
|
|
371
|
+
insertPageError(url: string, phase: string, message: string, isExternal?: boolean): Promise<void>;
|
|
372
|
+
/**
|
|
373
|
+
* Inserts a sub-resource into the `resources` table.
|
|
374
|
+
* Delegates to {@link insertResourceOp}.
|
|
375
|
+
* @param resource - The resource data to insert.
|
|
376
|
+
* @param source - Provenance label for new rows. `undefined` leaves the DB DEFAULT (`'crawled'`).
|
|
377
|
+
*/
|
|
378
|
+
insertResource(resource: Resource, source?: PageSource): Promise<void>;
|
|
379
|
+
/**
|
|
380
|
+
* Inserts a referrer relationship between a resource and a page into the
|
|
381
|
+
* `resources-referrers` table. Delegates to {@link insertResourceReferrersOp}.
|
|
382
|
+
* @param src - The URL of the resource.
|
|
383
|
+
* @param pageUrl - The URL of the page that references the resource.
|
|
384
|
+
*/
|
|
385
|
+
insertResourceReferrers(src: string, pageUrl: string): Promise<void>;
|
|
386
|
+
/**
|
|
387
|
+
* Every previously-scraped internal page's raw fields, in the shape
|
|
388
|
+
* `buildDedupeCapObservation` needs to replay this archive's prior
|
|
389
|
+
* `DedupeCapTracker` observations into a fresh tracker instance.
|
|
390
|
+
* Delegates to {@link listDedupeCapObservationsOp} — see that function
|
|
391
|
+
* for the row selection criteria.
|
|
392
|
+
* @param onProgress - Forwarded to {@link listDedupeCapObservationsOp} —
|
|
393
|
+
* see that function's docs.
|
|
394
|
+
* @returns Every qualifying page's raw fields, in `content_items.id` order.
|
|
395
|
+
*/
|
|
396
|
+
listDedupeCapObservations(onProgress?: (scannedUpToId: number, maxId: number) => void): Promise<DedupeCapObservationRow[]>;
|
|
397
|
+
/**
|
|
398
|
+
* Every distinct `dedupe_cap_events.shape_key` recorded in this archive.
|
|
399
|
+
* Delegates to {@link listDedupeCapShapeKeysOp}.
|
|
400
|
+
* @returns Distinct shape keys already confirmed capped, or `[]` on an
|
|
401
|
+
* archive that predates `dedupe_cap_events` or has recorded none.
|
|
402
|
+
*/
|
|
403
|
+
listDedupeCapShapeKeys(): Promise<string[]>;
|
|
404
|
+
/**
|
|
405
|
+
* Hostnames whose `crawl_errors` history is consistently DNS failures and
|
|
406
|
+
* for which no recent 2xx-3xx page or resource is recorded.
|
|
407
|
+
* Delegates to {@link listDnsBurnedHostCandidatesOp}.
|
|
408
|
+
* @returns Lower-cased hostnames safe to short-circuit.
|
|
409
|
+
*/
|
|
410
|
+
listDnsBurnedHostCandidates(): Promise<string[]>;
|
|
411
|
+
/**
|
|
412
|
+
* Lists every recorded outage as a resolved {@link OutageWindow}.
|
|
413
|
+
* Delegates to {@link listNetworkOutagesOp}.
|
|
414
|
+
* @returns Resolved outage windows, or `[]` on an archive that predates
|
|
415
|
+
* `network_outages` or has recorded no outages.
|
|
416
|
+
*/
|
|
417
|
+
listNetworkOutages(): Promise<OutageWindow[]>;
|
|
418
|
+
/**
|
|
419
|
+
* Appends one row to the `list_reconcile_runs` audit log.
|
|
420
|
+
* Delegates to {@link recordListReconcileRunOp}.
|
|
421
|
+
* @param meta - The run metadata to record. Only `ran_at` is required.
|
|
422
|
+
* @returns The autoincremented `id` of the newly-inserted row.
|
|
423
|
+
*/
|
|
424
|
+
recordListReconcileRun(meta: ListReconcileRunMeta): Promise<number>;
|
|
425
|
+
/**
|
|
426
|
+
* Records a redirect edge (source → destination) **without** re-storing the
|
|
427
|
+
* destination's content. Delegates to {@link recordRedirectOp}.
|
|
428
|
+
* @param page - HEAD-resolved page data carrying the redirect chain. Its
|
|
429
|
+
* `anchorList` / `imageList` are ignored (a redirect source owns no content).
|
|
430
|
+
* @param source - Inventory provenance forwarded by the orchestrator for
|
|
431
|
+
* the redirect-edge fast path. `undefined` keeps the DB DEFAULT
|
|
432
|
+
* `'crawled'` on a brand-new destination row.
|
|
433
|
+
*/
|
|
434
|
+
recordRedirect(page: PageData, source?: PageSource): Promise<void>;
|
|
435
|
+
/**
|
|
436
|
+
* Replaces one page's `page_console_logs` rows with a freshly captured
|
|
437
|
+
* set of console messages / page errors. Delegates to
|
|
438
|
+
* {@link replaceConsoleLogsOp}.
|
|
439
|
+
* @param pageUrl - The originally-requested URL, normalised (`withoutHashAndAuth` form).
|
|
440
|
+
* @param redirectPaths - The redirect chain hops captured during fetch, in order.
|
|
441
|
+
* @param entries - The console log entries to persist.
|
|
442
|
+
*/
|
|
443
|
+
replaceConsoleLogs(pageUrl: string, redirectPaths: readonly string[], entries: readonly ConsoleLogEntry[]): Promise<void>;
|
|
444
|
+
/**
|
|
445
|
+
* Replaces the stored DOM-structure template classification with a
|
|
446
|
+
* freshly generated set. Delegates to {@link replacePageTemplatesOp}.
|
|
447
|
+
* @param templateKeysByUrl - Page URL → template key.
|
|
448
|
+
* @param clusterReasonsByTemplateKey - Template key → cluster-selection
|
|
449
|
+
* evidence, if the caller captured it.
|
|
450
|
+
*/
|
|
451
|
+
replacePageTemplates(templateKeysByUrl: ReadonlyMap<string, string>, clusterReasonsByTemplateKey?: ReadonlyMap<string, TemplateClusterReason>): Promise<void>;
|
|
452
|
+
/**
|
|
453
|
+
* Promote previously-external pages whose URL falls under any of the new
|
|
454
|
+
* scope entries back to a "needs scraping" state.
|
|
455
|
+
* Delegates to {@link repromoteExternalPagesOp}.
|
|
456
|
+
* @param scopes - The hostname-indexed scope map after the new roots are merged.
|
|
457
|
+
* @param options - URL parsing options forwarded to the scope matcher.
|
|
458
|
+
* @param onProgress - Forwarded to {@link repromoteExternalPagesOp} — see
|
|
459
|
+
* that function's docs.
|
|
460
|
+
* @returns The URLs of the pages that were promoted.
|
|
461
|
+
*/
|
|
462
|
+
repromoteExternalPages(scopes: ReadonlyMap<string, readonly ExURL[]>, options?: ParseURLOptions, onProgress?: (processed: number, total: number) => void): Promise<string[]>;
|
|
463
|
+
/**
|
|
464
|
+
* Reset previously-attempted pages that ended in a recoverable failure so a
|
|
465
|
+
* follow-up crawl can re-fetch them from scratch. Delegates to
|
|
466
|
+
* {@link resetFailedPagesOp} — see the op for the permanent-failure
|
|
467
|
+
* exclusion rationale.
|
|
468
|
+
* @param onProgress - Forwarded to {@link resetFailedPagesOp} — see that
|
|
469
|
+
* function's docs.
|
|
470
|
+
* @returns The URLs of the pages that were reset to pending.
|
|
471
|
+
*/
|
|
472
|
+
resetFailedPages(onProgress?: (processed: number, total: number) => void): Promise<string[]>;
|
|
473
|
+
/**
|
|
474
|
+
* Reset pages matching an operator-supplied URL list back to pending so a
|
|
475
|
+
* follow-up crawl re-fetches them from scratch. Delegates to
|
|
476
|
+
* {@link resetPagesByUrlsOp} — see the op for the conservative exclusion
|
|
477
|
+
* rationale (redirect sources / intentionally-skipped / external pages).
|
|
478
|
+
* @param urls - URL strings to match, already in `withoutHashAndAuth` form.
|
|
479
|
+
* @param onProgress - Forwarded to {@link resetPagesByUrlsOp} — see that
|
|
480
|
+
* function's docs.
|
|
481
|
+
* @returns The reset URLs plus the excluded URLs grouped by reason.
|
|
482
|
+
*/
|
|
483
|
+
resetPagesByUrls(urls: readonly string[], onProgress?: (processed: number, total: number) => void): Promise<ResetPagesByUrlsResult>;
|
|
484
|
+
/**
|
|
485
|
+
* Stores the crawl configuration in the `info` table.
|
|
486
|
+
* Delegates to {@link setConfigOp}.
|
|
487
|
+
* @param config - The {@link Config} object to store.
|
|
488
|
+
*/
|
|
489
|
+
setConfig(config: Config): Promise<number[]>;
|
|
490
|
+
/**
|
|
491
|
+
* Marks a page as skipped in the database with the given reason.
|
|
492
|
+
* Delegates to {@link setSkippedPageOp}.
|
|
493
|
+
* @param url - The URL of the skipped page.
|
|
494
|
+
* @param reason - The reason the page was skipped.
|
|
495
|
+
* @param isExternal - Whether the page is on an external domain. Defaults to `false`.
|
|
496
|
+
*/
|
|
497
|
+
setSkippedPage(url: string, reason: string, isExternal?: boolean): Promise<void>;
|
|
498
|
+
/**
|
|
499
|
+
* Assigns natural URL sort order values to all internal pages.
|
|
500
|
+
* Delegates to {@link setUrlOrderOp}.
|
|
501
|
+
* @param onProgress - Forwarded to {@link setUrlOrderOp} — see that
|
|
502
|
+
* function's docs.
|
|
503
|
+
*/
|
|
504
|
+
setUrlOrder(onProgress?: (processed: number, total: number) => void): Promise<void>;
|
|
505
|
+
/**
|
|
506
|
+
* Update the single row in the `info` table with a partial config patch.
|
|
507
|
+
* Delegates to {@link updateConfigOp}.
|
|
508
|
+
* @param patch - Partial {@link Config} fields to overwrite. `undefined` values are skipped.
|
|
509
|
+
*/
|
|
510
|
+
updateConfig(patch: Partial<Config>): Promise<void>;
|
|
511
|
+
/**
|
|
512
|
+
* Inserts or updates a crawled page in the database, including its redirect
|
|
513
|
+
* chain, anchors, images, and (when `writeHtml`) its compressed HTML
|
|
514
|
+
* snapshot BLOB. Delegates to {@link updatePageOp}.
|
|
515
|
+
* @param page - The page data to store.
|
|
516
|
+
* @param writeHtml - When `true`, this call is allowed to insert (or clear)
|
|
517
|
+
* the page's HTML blob. `setExternalPage` passes `false` because external
|
|
518
|
+
* metadata-only scrapes never carry HTML and must not perturb an already
|
|
519
|
+
* stored body.
|
|
520
|
+
* @param isTarget - Whether this page is a crawl target.
|
|
521
|
+
* @param source - Provenance label written ONLY when the row is freshly
|
|
522
|
+
* inserted. Existing rows keep their original `source`.
|
|
523
|
+
* @param bodyHash - Precomputed body hash for the page's HTML (see
|
|
524
|
+
* `CrawlerEventTypes.page.bodyHash`). `undefined`/`null` falls back to
|
|
525
|
+
* computing it from the HTML instead.
|
|
526
|
+
* @param recursive - See {@link updatePageOp}'s `recursive` doc.
|
|
527
|
+
* @returns The database `pageId` of the inserted/updated row.
|
|
528
|
+
*/
|
|
529
|
+
updatePage(page: PageData, writeHtml: boolean, isTarget: boolean, source?: PageSource, bodyHash?: Buffer | null, recursive?: boolean): Promise<number>;
|
|
530
|
+
/**
|
|
531
|
+
* Creates and initializes a new Database instance.
|
|
532
|
+
*
|
|
533
|
+
* **Writer mode (default)**: creates the parent directory for the
|
|
534
|
+
* database file if needed, establishes the connection, and initializes
|
|
535
|
+
* the schema + migrations.
|
|
536
|
+
*
|
|
537
|
+
* **Read-only mode** (`options.readOnly`): refuses to resurrect a
|
|
538
|
+
* missing parent directory or db file — throws if either is absent at
|
|
539
|
+
* the time of the call. Skips schema init and migrations entirely so
|
|
540
|
+
* the user's tmpDir is never modified. Required by viewer / MCP
|
|
541
|
+
* stub-mode opens, where a TOCTOU window between classification and
|
|
542
|
+
* `connect()` could otherwise leave behind a phantom empty tmpDir.
|
|
543
|
+
* @param options - Database connection options.
|
|
544
|
+
* @returns A fully initialized Database instance.
|
|
545
|
+
* @throws {Error} In read-only mode, if the parent directory or db
|
|
546
|
+
* file does not exist when `connect()` runs.
|
|
547
|
+
*/
|
|
548
|
+
static connect(options: DatabaseOption): Promise<Database>;
|
|
549
|
+
}
|