@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
package/lib/page.js
ADDED
|
@@ -0,0 +1,764 @@
|
|
|
1
|
+
import { tryParseUrl as parseUrl } from '@d-zero/shared/parse-url';
|
|
2
|
+
import { isHtmlContentType } from './content-type/is-html-content-type.js';
|
|
3
|
+
import { parseMainContentClassList } from './meta/parse-main-content-class-list.js';
|
|
4
|
+
import { summarizeJsonLd } from './meta/summarize-jsonld.js';
|
|
5
|
+
import { parseResponseHeaders } from './utils/object/parse-response-headers.js';
|
|
6
|
+
/**
|
|
7
|
+
* Subset of {@link DB_Page} that maps to the flat meta columns derived from
|
|
8
|
+
* beholder's nested Meta. Used by {@link Page.metaFlat} so consumers can
|
|
9
|
+
* iterate every meta column without enumerating each one.
|
|
10
|
+
*
|
|
11
|
+
* Keep in sync with {@link import('./meta/types.js').FlatPageMetaColumns} —
|
|
12
|
+
* one row of `pages` has the same shape.
|
|
13
|
+
*/
|
|
14
|
+
const FLAT_META_COLUMNS = [
|
|
15
|
+
'lang',
|
|
16
|
+
'dir',
|
|
17
|
+
'charset',
|
|
18
|
+
'baseHref',
|
|
19
|
+
'viewport_raw',
|
|
20
|
+
'themeColor',
|
|
21
|
+
'applicationName',
|
|
22
|
+
'author',
|
|
23
|
+
'generator',
|
|
24
|
+
'publisher',
|
|
25
|
+
'title',
|
|
26
|
+
'description',
|
|
27
|
+
'keywords',
|
|
28
|
+
'robots_raw',
|
|
29
|
+
'robots_noindex',
|
|
30
|
+
'robots_nofollow',
|
|
31
|
+
'robots_noarchive',
|
|
32
|
+
'robots_noimageindex',
|
|
33
|
+
'googlebot',
|
|
34
|
+
'canonical',
|
|
35
|
+
'amphtml',
|
|
36
|
+
'manifest',
|
|
37
|
+
'icon_href',
|
|
38
|
+
'appleTouchIcon_href',
|
|
39
|
+
'og_type',
|
|
40
|
+
'og_title',
|
|
41
|
+
'og_url',
|
|
42
|
+
'og_site_name',
|
|
43
|
+
'og_description',
|
|
44
|
+
'og_image',
|
|
45
|
+
'og_image_alt',
|
|
46
|
+
'og_image_width',
|
|
47
|
+
'og_image_height',
|
|
48
|
+
'og_locale',
|
|
49
|
+
'og_article_published_time',
|
|
50
|
+
'og_article_modified_time',
|
|
51
|
+
'twitter_card',
|
|
52
|
+
'twitter_site',
|
|
53
|
+
'twitter_creator',
|
|
54
|
+
'twitter_title',
|
|
55
|
+
'twitter_description',
|
|
56
|
+
'twitter_image',
|
|
57
|
+
'fb_app_id',
|
|
58
|
+
'verification_google',
|
|
59
|
+
'formatDetection_telephone',
|
|
60
|
+
'tag_count',
|
|
61
|
+
'jsonld_count',
|
|
62
|
+
'tags_providers_csv',
|
|
63
|
+
'main_content_node_name',
|
|
64
|
+
'main_content_id',
|
|
65
|
+
'main_content_role',
|
|
66
|
+
'main_content_selector',
|
|
67
|
+
'main_content_class_list',
|
|
68
|
+
'main_content_word_count',
|
|
69
|
+
'main_content_body_word_count',
|
|
70
|
+
'main_content_heading_count',
|
|
71
|
+
'main_content_image_count',
|
|
72
|
+
'main_content_table_count',
|
|
73
|
+
'main_content_button_count',
|
|
74
|
+
'main_content_iframe_count',
|
|
75
|
+
'main_content_video_count',
|
|
76
|
+
'main_content_audio_count',
|
|
77
|
+
'main_content_canvas_count',
|
|
78
|
+
'scroll_height_desktop',
|
|
79
|
+
'scroll_height_mobile',
|
|
80
|
+
];
|
|
81
|
+
/**
|
|
82
|
+
* Represents a crawled page stored in the archive.
|
|
83
|
+
*
|
|
84
|
+
* Provides typed getters for the most-used meta columns (title, canonical,
|
|
85
|
+
* og:*, twitter_card, robots flags, lang), plus {@link Page.metaFlat} as an
|
|
86
|
+
* iterable view over all ~47 flat meta columns and {@link Page.metaExtras} for
|
|
87
|
+
* the JSON catch-all of nested sub-objects not flattened to columns.
|
|
88
|
+
*
|
|
89
|
+
* JSON-LD entries and detected technology signals live in dedicated tables
|
|
90
|
+
* and are fetched on demand via {@link Page.getJsonLd} /
|
|
91
|
+
* {@link Page.getTechnologySignals} / {@link Page.getPageTechnologies} (lazy
|
|
92
|
+
* reads, same pattern as {@link Page.getAnchors}).
|
|
93
|
+
*
|
|
94
|
+
* Instances are created by {@link ArchiveAccessor.getPages} or
|
|
95
|
+
* {@link ArchiveAccessor.getPagesWithRefs}.
|
|
96
|
+
*/
|
|
97
|
+
export default class Page {
|
|
98
|
+
/**
|
|
99
|
+
* An array of URLs that redirect to this page.
|
|
100
|
+
* Each entry contains the source URL and its page ID.
|
|
101
|
+
* Returns an empty array if no redirects exist.
|
|
102
|
+
*/
|
|
103
|
+
redirectFrom;
|
|
104
|
+
#archive;
|
|
105
|
+
#disableQueries;
|
|
106
|
+
#raw;
|
|
107
|
+
#rawAnchors;
|
|
108
|
+
#rawReferrers;
|
|
109
|
+
/**
|
|
110
|
+
* The canonical URL from `<link rel="canonical">` (absolutised against the
|
|
111
|
+
* page URL at write time), or null if not present.
|
|
112
|
+
*/
|
|
113
|
+
get canonical() {
|
|
114
|
+
return this.#raw.canonical;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The `<meta charset>` value, or null if not present.
|
|
118
|
+
*/
|
|
119
|
+
get charset() {
|
|
120
|
+
return this.#raw.charset;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The content length of the HTTP response in bytes, or null if unknown.
|
|
124
|
+
*/
|
|
125
|
+
get contentLength() {
|
|
126
|
+
return this.#raw.contentLength;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The MIME content type of the HTTP response (e.g., `"text/html"`), or null if unknown.
|
|
130
|
+
*/
|
|
131
|
+
get contentType() {
|
|
132
|
+
return this.#raw.contentType;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The meta description content, or null if not present.
|
|
136
|
+
*/
|
|
137
|
+
get description() {
|
|
138
|
+
return this.#raw.description;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* UNIX ms timestamp of the first time this page row was inserted, or
|
|
142
|
+
* null for legacy rows. Survives `resetFailedPages` so the discovery
|
|
143
|
+
* time of a page is preserved across retries.
|
|
144
|
+
*/
|
|
145
|
+
get firstCrawledAt() {
|
|
146
|
+
return this.#raw.firstCrawledAt;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The page's row id in the archive (`content_items.id`): stable within one
|
|
150
|
+
* archive, the key the page's own tables (`page_html_ref`, `page_templates`,
|
|
151
|
+
* …) reference it by. Not comparable across archives.
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* const pageIdsWithHtml = await collectPageIdsWithHtml(archive);
|
|
155
|
+
* const hasHtml = pageIdsWithHtml.has(page.id);
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
get id() {
|
|
159
|
+
return this.#raw.id;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Whether this page is on an external domain (outside the crawl scope).
|
|
163
|
+
*/
|
|
164
|
+
get isExternal() {
|
|
165
|
+
return !!this.#raw.isExternal;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Whether this page was skipped during crawling.
|
|
169
|
+
*/
|
|
170
|
+
get isSkipped() {
|
|
171
|
+
return !!this.#raw.isSkipped;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Whether this page was a crawl target (as opposed to being discovered incidentally).
|
|
175
|
+
*/
|
|
176
|
+
get isTarget() {
|
|
177
|
+
return !!this.#raw.isTarget;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Number of JSON-LD + SpeculationRules entries detected on this page
|
|
181
|
+
* (denormalised aggregate written at scrape time).
|
|
182
|
+
*/
|
|
183
|
+
get jsonldCount() {
|
|
184
|
+
return this.#raw.jsonld_count;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The meta keywords content, or null if not present.
|
|
188
|
+
*/
|
|
189
|
+
get keywords() {
|
|
190
|
+
return this.#raw.keywords;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The `lang` attribute value from the HTML element, or null if not present.
|
|
194
|
+
*/
|
|
195
|
+
get lang() {
|
|
196
|
+
return this.#raw.lang;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* UNIX ms timestamp of the most recent successful scrape for this page,
|
|
200
|
+
* or null for legacy rows / never-scraped pages.
|
|
201
|
+
*/
|
|
202
|
+
get lastCrawledAt() {
|
|
203
|
+
return this.#raw.lastCrawledAt;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Detected main-content element's `nodeName` (e.g. `'MAIN'`), or null when
|
|
207
|
+
* no main region was found or the page was not fully rendered.
|
|
208
|
+
*/
|
|
209
|
+
get mainContentNodeName() {
|
|
210
|
+
return this.#raw.main_content_node_name;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Detected main-content element's `id`, or null.
|
|
214
|
+
*/
|
|
215
|
+
get mainContentId() {
|
|
216
|
+
return this.#raw.main_content_id;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Detected main-content element's `role` attribute, or null.
|
|
220
|
+
*/
|
|
221
|
+
get mainContentRole() {
|
|
222
|
+
return this.#raw.main_content_role;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Diagnostic tag+id+class selector for the detected main-content element, or null.
|
|
226
|
+
*/
|
|
227
|
+
get mainContentSelector() {
|
|
228
|
+
return this.#raw.main_content_selector;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Detected main-content element's CSS classes, or null when no main region
|
|
232
|
+
* was found. Parsed from the JSON-encoded `main_content_class_list` column.
|
|
233
|
+
* @throws {Error} When the stored value is not a JSON array of strings — a
|
|
234
|
+
* corrupt archive; a silently dropped class list would change which
|
|
235
|
+
* template the page is classified into.
|
|
236
|
+
*/
|
|
237
|
+
get mainContentClassList() {
|
|
238
|
+
return parseMainContentClassList(this.#raw.main_content_class_list);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Character count of the main region's text content (denormalised
|
|
242
|
+
* aggregate written at scrape time), or null.
|
|
243
|
+
*/
|
|
244
|
+
get mainContentWordCount() {
|
|
245
|
+
return this.#raw.main_content_word_count;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Character count of `document.body`'s text content (denormalised
|
|
249
|
+
* aggregate written at scrape time), or null.
|
|
250
|
+
*/
|
|
251
|
+
get mainContentBodyWordCount() {
|
|
252
|
+
return this.#raw.main_content_body_word_count;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Number of headings within the main region (denormalised aggregate), or null.
|
|
256
|
+
*/
|
|
257
|
+
get mainContentHeadingCount() {
|
|
258
|
+
return this.#raw.main_content_heading_count;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Number of images within the main region (denormalised aggregate), or null.
|
|
262
|
+
*/
|
|
263
|
+
get mainContentImageCount() {
|
|
264
|
+
return this.#raw.main_content_image_count;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Number of tables within the main region (denormalised aggregate), or null.
|
|
268
|
+
*/
|
|
269
|
+
get mainContentTableCount() {
|
|
270
|
+
return this.#raw.main_content_table_count;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Number of button-like elements within the main region (denormalised
|
|
274
|
+
* aggregate), or null.
|
|
275
|
+
*/
|
|
276
|
+
get mainContentButtonCount() {
|
|
277
|
+
return this.#raw.main_content_button_count;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Number of iframes within the main region (denormalised aggregate), or null.
|
|
281
|
+
*/
|
|
282
|
+
get mainContentIframeCount() {
|
|
283
|
+
return this.#raw.main_content_iframe_count;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Number of videos within the main region (denormalised aggregate), or null.
|
|
287
|
+
*/
|
|
288
|
+
get mainContentVideoCount() {
|
|
289
|
+
return this.#raw.main_content_video_count;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Number of audios within the main region (denormalised aggregate), or null.
|
|
293
|
+
*/
|
|
294
|
+
get mainContentAudioCount() {
|
|
295
|
+
return this.#raw.main_content_audio_count;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Number of canvases within the main region (denormalised aggregate), or null.
|
|
299
|
+
*/
|
|
300
|
+
get mainContentCanvasCount() {
|
|
301
|
+
return this.#raw.main_content_canvas_count;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Number of Web Components (custom elements) within the main region
|
|
305
|
+
* (denormalised aggregate), `null` when unknown (page not rendered, or
|
|
306
|
+
* nitpicker's own capture failed — see `compute-main-contents-denormalized.ts`).
|
|
307
|
+
*/
|
|
308
|
+
get mainContentCustomElementCount() {
|
|
309
|
+
return this.#raw.main_content_custom_element_count;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Iterable view over every flat meta column (~47 fields). Returns a frozen
|
|
313
|
+
* record so consumers can pick fields by name without re-enumerating
|
|
314
|
+
* typed getters.
|
|
315
|
+
*
|
|
316
|
+
* Use the typed getters for high-frequency fields (title, canonical, og_*
|
|
317
|
+
* etc.); use `metaFlat` for bulk projection (Sheets row generation,
|
|
318
|
+
* `toJSON`, debug dumps).
|
|
319
|
+
*/
|
|
320
|
+
get metaFlat() {
|
|
321
|
+
const out = {};
|
|
322
|
+
for (const col of FLAT_META_COLUMNS) {
|
|
323
|
+
out[col] = this.#raw[col];
|
|
324
|
+
}
|
|
325
|
+
return Object.freeze(out);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Parsed `meta_extras` JSON: nested Meta sub-objects (referrer, viewport,
|
|
329
|
+
* httpEquiv, og.image[], twitter.*, apple.*, msapplication.*, geo,
|
|
330
|
+
* citation, link.alternateHreflang[], others.*, etc.) that were not
|
|
331
|
+
* flattened to dedicated columns.
|
|
332
|
+
*
|
|
333
|
+
* Returns an empty object when the column is null or invalid JSON.
|
|
334
|
+
*/
|
|
335
|
+
get metaExtras() {
|
|
336
|
+
const raw = this.#raw.meta_extras;
|
|
337
|
+
if (raw === null)
|
|
338
|
+
return {};
|
|
339
|
+
try {
|
|
340
|
+
const parsed = JSON.parse(raw);
|
|
341
|
+
if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)) {
|
|
342
|
+
return parsed;
|
|
343
|
+
}
|
|
344
|
+
return {};
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
return {};
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Open Graph description, or null if not present.
|
|
352
|
+
*/
|
|
353
|
+
get og_description() {
|
|
354
|
+
return this.#raw.og_description;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Open Graph image URL (first image when og:image is multi-valued;
|
|
358
|
+
* absolutised against the page URL at write time), or null if not present.
|
|
359
|
+
*/
|
|
360
|
+
get og_image() {
|
|
361
|
+
return this.#raw.og_image;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Open Graph site name, or null if not present.
|
|
365
|
+
*/
|
|
366
|
+
get og_site_name() {
|
|
367
|
+
return this.#raw.og_site_name;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Open Graph title, or null if not present.
|
|
371
|
+
*/
|
|
372
|
+
get og_title() {
|
|
373
|
+
return this.#raw.og_title;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Open Graph type, or null if not present.
|
|
377
|
+
*/
|
|
378
|
+
get og_type() {
|
|
379
|
+
return this.#raw.og_type;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Open Graph URL (absolutised), or null if not present.
|
|
383
|
+
*/
|
|
384
|
+
get og_url() {
|
|
385
|
+
return this.#raw.og_url;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* The parsed HTTP response headers as a key-value record.
|
|
389
|
+
* Header values may be arrays for multi-value headers (e.g. `set-cookie`).
|
|
390
|
+
* Returns an empty object if headers are absent or cannot be parsed.
|
|
391
|
+
*/
|
|
392
|
+
get responseHeaders() {
|
|
393
|
+
return parseResponseHeaders(this.#raw.responseHeaders) ?? {};
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Whether the robots:noarchive directive is set.
|
|
397
|
+
*/
|
|
398
|
+
get robots_noarchive() {
|
|
399
|
+
return !!this.#raw.robots_noarchive;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Whether the robots:nofollow directive is set.
|
|
403
|
+
*/
|
|
404
|
+
get robots_nofollow() {
|
|
405
|
+
return !!this.#raw.robots_nofollow;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Whether the robots:noindex directive is set.
|
|
409
|
+
*/
|
|
410
|
+
get robots_noindex() {
|
|
411
|
+
return !!this.#raw.robots_noindex;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Raw `<meta name="robots">` content, or null if not present.
|
|
415
|
+
* Use for diagnostics; specific directive flags live on `robots_*` getters.
|
|
416
|
+
*/
|
|
417
|
+
get robots_raw() {
|
|
418
|
+
return this.#raw.robots_raw;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* `document.body.scrollHeight` at the desktop-compact preset (denormalised
|
|
422
|
+
* aggregate written at scrape time), or null.
|
|
423
|
+
*/
|
|
424
|
+
get scrollHeightDesktop() {
|
|
425
|
+
return this.#raw.scroll_height_desktop;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* `document.body.scrollHeight` at the mobile-small preset (denormalised
|
|
429
|
+
* aggregate written at scrape time), or null.
|
|
430
|
+
*/
|
|
431
|
+
get scrollHeightMobile() {
|
|
432
|
+
return this.#raw.scroll_height_mobile;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* `@d-zero/beholder`'s `IMAGE_SCAN_CODE` outcome for the desktop-compact
|
|
436
|
+
* `<img>` element scan (denormalised aggregate written at scrape time), or
|
|
437
|
+
* null when not attempted.
|
|
438
|
+
*/
|
|
439
|
+
get imageScanDesktop() {
|
|
440
|
+
return this.#raw.image_scan_desktop;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* `@d-zero/beholder`'s `IMAGE_SCAN_CODE` outcome for the mobile-small
|
|
444
|
+
* `<img>` element scan (denormalised aggregate written at scrape time), or
|
|
445
|
+
* null when not attempted.
|
|
446
|
+
*/
|
|
447
|
+
get imageScanMobile() {
|
|
448
|
+
return this.#raw.image_scan_mobile;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* The reason this page was skipped during crawling, or null if it was not skipped.
|
|
452
|
+
*/
|
|
453
|
+
get skipReason() {
|
|
454
|
+
return this.#raw.skipReason;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* The HTTP response status code, or null if the page has not been fetched.
|
|
458
|
+
*/
|
|
459
|
+
get status() {
|
|
460
|
+
return this.#raw.status;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* The HTTP response status text (e.g., `"OK"`, `"Not Found"`), or null if not fetched.
|
|
464
|
+
*/
|
|
465
|
+
get statusText() {
|
|
466
|
+
return this.#raw.statusText;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Number of Wappalyzer tag entries detected on this page (denormalised
|
|
470
|
+
* aggregate written at scrape time).
|
|
471
|
+
*/
|
|
472
|
+
get tagCount() {
|
|
473
|
+
return this.#raw.tag_count;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Sorted unique Wappalyzer provider names, comma-separated, empty string
|
|
477
|
+
* when no tags. Denormalised aggregate; for the structured form (with
|
|
478
|
+
* confidence, category, and every raw signal) fetch
|
|
479
|
+
* {@link Page.getTechnologySignals} / {@link Page.getPageTechnologies} (lazy).
|
|
480
|
+
*/
|
|
481
|
+
get tagsProvidersCsv() {
|
|
482
|
+
return this.#raw.tags_providers_csv ?? '';
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* The page title from the `<title>` element.
|
|
486
|
+
* Returns an empty string if no title is set.
|
|
487
|
+
*/
|
|
488
|
+
get title() {
|
|
489
|
+
return this.#raw.title || '';
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Twitter Card type (`twitter:card`), or null if not present.
|
|
493
|
+
*/
|
|
494
|
+
get twitter_card() {
|
|
495
|
+
return this.#raw.twitter_card;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* The parsed URL of this page as an ExURL object.
|
|
499
|
+
* Respects the `disableQueries` option for query string handling.
|
|
500
|
+
*/
|
|
501
|
+
get url() {
|
|
502
|
+
return parseUrl(this.#raw.url, {
|
|
503
|
+
disableQueries: this.#disableQueries,
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Creates a new Page instance.
|
|
508
|
+
* @param archive - The ArchiveAccessor used for lazy-loading relationships.
|
|
509
|
+
* @param raw - The raw database row for this page.
|
|
510
|
+
* @param rawRedirects - Pre-loaded redirect records, or undefined for lazy loading.
|
|
511
|
+
* @param rawAnchors - Pre-loaded anchor records, or undefined for lazy loading.
|
|
512
|
+
* @param rawReferrers - Pre-loaded referrer records, or undefined for lazy loading.
|
|
513
|
+
* @param disableQueries - Whether to strip query strings from the URL.
|
|
514
|
+
*/
|
|
515
|
+
constructor(archive, raw, rawRedirects, rawAnchors, rawReferrers, disableQueries) {
|
|
516
|
+
this.#archive = archive;
|
|
517
|
+
this.#raw = raw;
|
|
518
|
+
this.redirectFrom = (rawRedirects || []).map((r) => ({
|
|
519
|
+
url: r.from,
|
|
520
|
+
pageId: r.fromId,
|
|
521
|
+
}));
|
|
522
|
+
this.#rawAnchors = rawAnchors || null;
|
|
523
|
+
this.#rawReferrers = rawReferrers || null;
|
|
524
|
+
this.#disableQueries = disableQueries ?? false;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Retrieves the anchors (outgoing links) found on this page.
|
|
528
|
+
* Uses pre-loaded data if available, otherwise queries the database.
|
|
529
|
+
* @returns An array of {@link Anchor} objects representing the links on this page.
|
|
530
|
+
*/
|
|
531
|
+
async getAnchors() {
|
|
532
|
+
if (this.#rawAnchors) {
|
|
533
|
+
return this.#rawAnchors.map((a) => ({
|
|
534
|
+
url: a.url,
|
|
535
|
+
href: a.href,
|
|
536
|
+
isExternal: !!a.isExternal,
|
|
537
|
+
title: a.title,
|
|
538
|
+
status: a.status,
|
|
539
|
+
statusText: a.statusText,
|
|
540
|
+
contentType: a.contentType,
|
|
541
|
+
hash: a.hash,
|
|
542
|
+
textContent: a.textContent,
|
|
543
|
+
}));
|
|
544
|
+
}
|
|
545
|
+
return this.#archive.getAnchorsOnPage(this.#raw.id);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Retrieves the audios within this page's detected main content region
|
|
549
|
+
* from `page_main_content_audios`. Lazy — runs a single SELECT per call.
|
|
550
|
+
* @returns Ordered audio rows.
|
|
551
|
+
*/
|
|
552
|
+
async getAudios() {
|
|
553
|
+
return this.#archive.getAudiosOfPage(this.#raw.id);
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Retrieves the button-like elements within this page's detected main
|
|
557
|
+
* content region from `page_main_content_buttons`. Lazy — runs a single
|
|
558
|
+
* SELECT per call.
|
|
559
|
+
* @returns Ordered button rows.
|
|
560
|
+
*/
|
|
561
|
+
async getButtons() {
|
|
562
|
+
return this.#archive.getButtonsOfPage(this.#raw.id);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Retrieves the canvases within this page's detected main content region
|
|
566
|
+
* from `page_main_content_canvases`. Lazy — runs a single SELECT per call.
|
|
567
|
+
* @returns Ordered canvas rows.
|
|
568
|
+
*/
|
|
569
|
+
async getCanvases() {
|
|
570
|
+
return this.#archive.getCanvasesOfPage(this.#raw.id);
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Retrieves the Web Components (custom elements) within this page's
|
|
574
|
+
* detected main content region from `page_main_content_custom_elements`.
|
|
575
|
+
* Lazy — runs a single SELECT per call.
|
|
576
|
+
* @returns Ordered custom-element rows.
|
|
577
|
+
*/
|
|
578
|
+
async getCustomElements() {
|
|
579
|
+
return this.#archive.getCustomElementsOfPage(this.#raw.id);
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Retrieves the headings within this page's detected main content region
|
|
583
|
+
* from `page_main_content_headings`. Lazy — runs a single SELECT per call.
|
|
584
|
+
* @returns Ordered heading rows.
|
|
585
|
+
*/
|
|
586
|
+
async getHeadings() {
|
|
587
|
+
return this.#archive.getHeadingsOfPage(this.#raw.id);
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Thin wrapper that forwards this page's id to the accessor's
|
|
591
|
+
* BLOB-read path. Lets callers hold a `Page` reference and ask for its
|
|
592
|
+
* HTML without having to thread the page id through.
|
|
593
|
+
* @returns The HTML content, or `null` if no snapshot was saved.
|
|
594
|
+
* @see {@link ArchiveAccessor.getHtmlOfPage} for the resolution rules.
|
|
595
|
+
* @example
|
|
596
|
+
* for (const page of await archive.getPages()) {
|
|
597
|
+
* const html = await page.getHtml();
|
|
598
|
+
* if (html !== null) processBody(html);
|
|
599
|
+
* }
|
|
600
|
+
*/
|
|
601
|
+
async getHtml() {
|
|
602
|
+
return this.#archive.getHtmlOfPage(this.#raw.id);
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Retrieves the iframes within this page's detected main content region
|
|
606
|
+
* from `page_main_content_iframes`. Lazy — runs a single SELECT per call.
|
|
607
|
+
* @returns Ordered iframe rows.
|
|
608
|
+
*/
|
|
609
|
+
async getIframes() {
|
|
610
|
+
return this.#archive.getIframesOfPage(this.#raw.id);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Retrieves the JSON-LD entries for this page from `page_jsonld`.
|
|
614
|
+
* Lazy — runs a single SELECT per call. Returns entries in insertion
|
|
615
|
+
* order (matches the scraper's traversal order).
|
|
616
|
+
* @returns Ordered JSON-LD / SpeculationRules rows.
|
|
617
|
+
*/
|
|
618
|
+
async getJsonLd() {
|
|
619
|
+
return this.#archive.getJsonLdOfPage(this.#raw.id);
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Retrieves the images within this page's detected main content region
|
|
623
|
+
* from `page_main_content_images`. Lazy — runs a single SELECT per call.
|
|
624
|
+
* Distinct from the whole-page image scan (`image_items`).
|
|
625
|
+
* @returns Ordered image rows.
|
|
626
|
+
*/
|
|
627
|
+
async getMainContentImages() {
|
|
628
|
+
return this.#archive.getMainContentImagesOfPage(this.#raw.id);
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Retrieves the tables within this page's detected main content region
|
|
632
|
+
* from `page_main_content_tables`. Lazy — runs a single SELECT per call.
|
|
633
|
+
* @returns Ordered table rows.
|
|
634
|
+
*/
|
|
635
|
+
async getMainContentTables() {
|
|
636
|
+
return this.#archive.getMainContentTablesOfPage(this.#raw.id);
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Retrieves the confidence-combined technology roll-up for this page
|
|
640
|
+
* from `page_technologies`. Lazy — runs a single SELECT per call.
|
|
641
|
+
* @returns Technology rows, highest confidence first.
|
|
642
|
+
*/
|
|
643
|
+
async getPageTechnologies() {
|
|
644
|
+
return this.#archive.getPageTechnologiesOfPage(this.#raw.id);
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Retrieves the referrers (incoming links) pointing to this page.
|
|
648
|
+
* Uses pre-loaded data if available, otherwise queries the database.
|
|
649
|
+
* @returns An array of {@link Referrer} objects representing pages that link to this page.
|
|
650
|
+
*/
|
|
651
|
+
async getReferrers() {
|
|
652
|
+
if (this.#rawReferrers) {
|
|
653
|
+
return this.#rawReferrers.map((r) => ({
|
|
654
|
+
url: r.url,
|
|
655
|
+
through: r.through,
|
|
656
|
+
throughId: r.throughId,
|
|
657
|
+
hash: r.hash,
|
|
658
|
+
textContent: r.textContent || '',
|
|
659
|
+
}));
|
|
660
|
+
}
|
|
661
|
+
const refs = await this.#archive.getReferrersOfPage(this.#raw.id);
|
|
662
|
+
return refs.map((r) => ({
|
|
663
|
+
url: r.url,
|
|
664
|
+
through: r.through,
|
|
665
|
+
throughId: r.throughId,
|
|
666
|
+
hash: r.hash,
|
|
667
|
+
textContent: r.textContent || '',
|
|
668
|
+
}));
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Retrieves all request referrers for this page directly from the database.
|
|
672
|
+
* Unlike {@link getReferrers}, this always queries the database and does not use pre-loaded data.
|
|
673
|
+
* @returns An array of {@link Referrer} objects.
|
|
674
|
+
*/
|
|
675
|
+
async getRequests() {
|
|
676
|
+
const refs = await this.#archive.getReferrersOfPage(this.#raw.id);
|
|
677
|
+
return refs.map((r) => ({
|
|
678
|
+
url: r.url,
|
|
679
|
+
through: r.through,
|
|
680
|
+
throughId: r.throughId,
|
|
681
|
+
hash: r.hash,
|
|
682
|
+
textContent: r.textContent || '',
|
|
683
|
+
}));
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Retrieves the raw technology-detection signals for this page from
|
|
687
|
+
* `technology_signals`. Lazy — runs a single SELECT per call.
|
|
688
|
+
* @returns Ordered signal rows.
|
|
689
|
+
*/
|
|
690
|
+
async getTechnologySignals() {
|
|
691
|
+
return this.#archive.getTechnologySignalsOfPage(this.#raw.id);
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Retrieves the videos within this page's detected main content region
|
|
695
|
+
* from `page_main_content_videos`. Lazy — runs a single SELECT per call.
|
|
696
|
+
* @returns Ordered video rows.
|
|
697
|
+
*/
|
|
698
|
+
async getVideos() {
|
|
699
|
+
return this.#archive.getVideosOfPage(this.#raw.id);
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Checks whether this page is an internal HTML page (not external and has `text/html` content type).
|
|
703
|
+
* @returns `true` if this is an internal HTML page, `false` otherwise.
|
|
704
|
+
*/
|
|
705
|
+
isInternalPage() {
|
|
706
|
+
return this.isPage() && !this.isExternal;
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Checks whether this entry represents an HTML page (content type is `text/html`).
|
|
710
|
+
* @returns `true` if the content type is `text/html`, `false` otherwise.
|
|
711
|
+
*/
|
|
712
|
+
isPage() {
|
|
713
|
+
return isHtmlContentType(this.contentType);
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Serializes the page data to a plain JSON object including the full flat
|
|
717
|
+
* meta column set, the `meta_extras` catch-all, a **summary** of the
|
|
718
|
+
* JSON-LD rows, and the confidence-combined technology roll-up
|
|
719
|
+
* (`page_technologies` — already compact, one row per detected
|
|
720
|
+
* technology, so no further summarization is needed the way `page_tags`'
|
|
721
|
+
* per-`externalId` granularity used to require).
|
|
722
|
+
*
|
|
723
|
+
* Summaries (not raw entries) are inlined so a Page detail payload stays
|
|
724
|
+
* token-bounded for MCP / LLM consumers — the full `raw` JSON-LD payload
|
|
725
|
+
* is fetched separately via `getJsonLd()` / the dedicated CLI/MCP
|
|
726
|
+
* endpoints.
|
|
727
|
+
*
|
|
728
|
+
* Anchors and referrers are still resolved eagerly because consumers
|
|
729
|
+
* (Sheets `eachPage`, viewer detail) depend on having them inline.
|
|
730
|
+
* @returns A plain object containing all page metadata and relationships.
|
|
731
|
+
*/
|
|
732
|
+
async toJSON() {
|
|
733
|
+
const [anchors, referrers, jsonLdRows, technologies] = await Promise.all([
|
|
734
|
+
this.getAnchors(),
|
|
735
|
+
this.getReferrers(),
|
|
736
|
+
this.getJsonLd(),
|
|
737
|
+
this.getPageTechnologies(),
|
|
738
|
+
]);
|
|
739
|
+
const jsonLdSummary = summarizeJsonLd(jsonLdRows);
|
|
740
|
+
return {
|
|
741
|
+
url: this.url.href,
|
|
742
|
+
status: this.status,
|
|
743
|
+
statusText: this.statusText,
|
|
744
|
+
contentType: this.contentType,
|
|
745
|
+
contentLength: this.contentLength,
|
|
746
|
+
responseHeaders: this.responseHeaders,
|
|
747
|
+
isExternal: this.isExternal,
|
|
748
|
+
isSkipped: this.isSkipped,
|
|
749
|
+
skipReason: this.skipReason,
|
|
750
|
+
isTarget: this.isTarget,
|
|
751
|
+
firstCrawledAt: this.firstCrawledAt,
|
|
752
|
+
lastCrawledAt: this.lastCrawledAt,
|
|
753
|
+
...this.metaFlat,
|
|
754
|
+
metaExtras: this.metaExtras,
|
|
755
|
+
jsonLd: jsonLdSummary,
|
|
756
|
+
technologies,
|
|
757
|
+
redirectFrom: this.redirectFrom,
|
|
758
|
+
isPage: this.isPage(),
|
|
759
|
+
isInternalPage: this.isInternalPage(),
|
|
760
|
+
getAnchors: anchors,
|
|
761
|
+
getReferrers: referrers,
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
}
|