@xberg-io/crawlberg-wasm 1.11.1 → 1.12.2
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/package.json +3 -3
- package/pkg/bundler/crawlberg_wasm.d.ts +51 -4
- package/pkg/bundler/crawlberg_wasm.js +1 -1
- package/pkg/bundler/crawlberg_wasm_bg.js +313 -10
- package/pkg/bundler/crawlberg_wasm_bg.wasm +0 -0
- package/pkg/bundler/crawlberg_wasm_bg.wasm.d.ts +35 -4
- package/pkg/bundler/package.json +1 -1
- package/pkg/deno/crawlberg_wasm.d.ts +51 -4
- package/pkg/deno/crawlberg_wasm.js +313 -10
- package/pkg/deno/crawlberg_wasm_bg.wasm +0 -0
- package/pkg/deno/crawlberg_wasm_bg.wasm.d.ts +35 -4
- package/pkg/nodejs/crawlberg_wasm.d.ts +51 -4
- package/pkg/nodejs/crawlberg_wasm.js +314 -10
- package/pkg/nodejs/crawlberg_wasm_bg.wasm +0 -0
- package/pkg/nodejs/crawlberg_wasm_bg.wasm.d.ts +35 -4
- package/pkg/nodejs/package.json +1 -1
- package/pkg/web/crawlberg_wasm.d.ts +86 -8
- package/pkg/web/crawlberg_wasm.js +313 -10
- package/pkg/web/crawlberg_wasm_bg.wasm +0 -0
- package/pkg/web/crawlberg_wasm_bg.wasm.d.ts +35 -4
- package/pkg/web/package.json +1 -1
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"name": "@xberg-io/crawlberg-wasm",
|
|
13
|
-
"version": "1.
|
|
13
|
+
"version": "1.12.2",
|
|
14
14
|
"private": false,
|
|
15
15
|
"description": "High-performance web crawling engine",
|
|
16
16
|
"license": "MIT",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"node": ">= 22"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@vitest/coverage-v8": "^5.0.
|
|
49
|
-
"vitest": "^5.0.
|
|
48
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
49
|
+
"vitest": "^5.0.5"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "wasm-pack build --target nodejs --out-dir pkg/nodejs",
|
|
@@ -260,7 +260,7 @@ export class WasmBrowserConfig {
|
|
|
260
260
|
* keep a handle you already hold, build with `default()` and assign the property instead:
|
|
261
261
|
* the generated setter borrows and leaves your handle alive.
|
|
262
262
|
*/
|
|
263
|
-
constructor(mode?: WasmBrowserMode | null, backend?: WasmBrowserBackend | null, timeout?: bigint | null, overallTimeout?: bigint | null, shutdownTimeout?: bigint | null, wait?: WasmBrowserWait | null, blockUrlPatterns?: string[] | null, captureNetworkEvents?: boolean | null, sessionAffinity?: boolean | null, chromeArgs?: string[] | null, endpoint?: string | null, waitSelector?: string | null, extraWait?: bigint | null, proxy?: WasmProxyConfig | null, evalScript?: string | null, robotsUserAgent?: string | null, chromePath?: string | null);
|
|
263
|
+
constructor(mode?: WasmBrowserMode | null, backend?: WasmBrowserBackend | null, timeout?: bigint | null, overallTimeout?: bigint | null, shutdownTimeout?: bigint | null, wait?: WasmBrowserWait | null, blockUrlPatterns?: string[] | null, captureNetworkEvents?: boolean | null, sessionAffinity?: boolean | null, chromeArgs?: string[] | null, endpoint?: string | null, waitSelector?: string | null, extraWait?: bigint | null, proxy?: WasmProxyConfig | null, evalScript?: string | null, robotsUserAgent?: string | null, chromePath?: string | null, scrollContainers?: boolean | null, domQuietWindow?: bigint | null, domQuietCap?: bigint | null);
|
|
264
264
|
get backend(): string;
|
|
265
265
|
set backend(value: WasmBrowserBackend);
|
|
266
266
|
blockUrlPatterns: string[];
|
|
@@ -268,6 +268,10 @@ export class WasmBrowserConfig {
|
|
|
268
268
|
chromeArgs: string[];
|
|
269
269
|
get chromePath(): string | undefined;
|
|
270
270
|
set chromePath(value: string | null | undefined);
|
|
271
|
+
get domQuietCap(): bigint | undefined;
|
|
272
|
+
set domQuietCap(value: bigint | null | undefined);
|
|
273
|
+
get domQuietWindow(): bigint | undefined;
|
|
274
|
+
set domQuietWindow(value: bigint | null | undefined);
|
|
271
275
|
get endpoint(): string | undefined;
|
|
272
276
|
set endpoint(value: string | null | undefined);
|
|
273
277
|
get evalScript(): string | undefined;
|
|
@@ -288,6 +292,7 @@ export class WasmBrowserConfig {
|
|
|
288
292
|
set proxy(value: WasmProxyConfig);
|
|
289
293
|
get robotsUserAgent(): string | undefined;
|
|
290
294
|
set robotsUserAgent(value: string | null | undefined);
|
|
295
|
+
scrollContainers: boolean;
|
|
291
296
|
sessionAffinity: boolean;
|
|
292
297
|
get shutdownTimeout(): bigint | undefined;
|
|
293
298
|
set shutdownTimeout(value: bigint | null | undefined);
|
|
@@ -427,12 +432,16 @@ export class WasmContentConfig {
|
|
|
427
432
|
*/
|
|
428
433
|
copyForTransfer(): WasmContentConfig;
|
|
429
434
|
static default(): WasmContentConfig;
|
|
430
|
-
constructor(outputFormat?: string | null, preprocessingPreset?: string | null, removeNavigation?: boolean | null, removeForms?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, excludeSelectors?: string[] | null, skipImages?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, includeDocumentStructure?: boolean | null, extractMetadata?: boolean | null, maxDepth?: number | null, stripNewlines?: boolean | null, bullets?: string | null, listIndentWidth?: number | null, strongEmSymbol?: string | null, compactTables?: boolean | null, keepInlineImagesIn?: string[] | null, keepHidden?: boolean | null);
|
|
435
|
+
constructor(outputFormat?: string | null, preprocessingPreset?: string | null, removeNavigation?: boolean | null, removeForms?: boolean | null, stripTags?: string[] | null, preserveTags?: string[] | null, excludeSelectors?: string[] | null, skipImages?: boolean | null, wrap?: boolean | null, wrapWidth?: number | null, includeDocumentStructure?: boolean | null, extractMetadata?: boolean | null, maxDepth?: number | null, stripNewlines?: boolean | null, bullets?: string | null, listIndentWidth?: number | null, strongEmSymbol?: string | null, compactTables?: boolean | null, keepInlineImagesIn?: string[] | null, keepHidden?: boolean | null, expandAbbreviations?: boolean | null, escapeMisc?: boolean | null, escapeAsterisks?: boolean | null, includeIconLabels?: boolean | null);
|
|
431
436
|
bullets: string;
|
|
432
437
|
compactTables: boolean;
|
|
438
|
+
escapeAsterisks: boolean;
|
|
439
|
+
escapeMisc: boolean;
|
|
433
440
|
excludeSelectors: string[];
|
|
441
|
+
expandAbbreviations: boolean;
|
|
434
442
|
extractMetadata: boolean;
|
|
435
443
|
includeDocumentStructure: boolean;
|
|
444
|
+
includeIconLabels: boolean;
|
|
436
445
|
keepHidden: boolean;
|
|
437
446
|
keepInlineImagesIn: string[];
|
|
438
447
|
listIndentWidth: number;
|
|
@@ -506,7 +515,7 @@ export class WasmCrawlConfig {
|
|
|
506
515
|
* keep a handle you already hold, build with `default()` and assign the property instead:
|
|
507
516
|
* the generated setter borrows and leaves your handle alive.
|
|
508
517
|
*/
|
|
509
|
-
constructor(crawlStrategy?: WasmCrawlStrategyKind | null, respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, pathPatternsMatchQuery?: boolean | null, pathPatternsMatchUrl?: boolean | null, dedupIncludeQuery?: boolean | null, stripTrackingParams?: boolean | null, trackingParams?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, retryInitialDelayMs?: bigint | null, retryMaxDelayMs?: bigint | null, rateLimitJitterRatio?: number | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: WasmAssetCategory[] | null, browser?: WasmBrowserConfig | null, userAgents?: string[] | null, captureScreenshot?: boolean | null, followDocumentUrls?: boolean | null, downloadDocuments?: boolean | null, documentMimeTypes?: string[] | null, saveBrowserProfile?: boolean | null, ssrf?: WasmSsrfPolicy | null, maxDepth?: number | null, maxPages?: number | null, maxLinksPerPage?: number | null, maxConcurrent?: number | null, contentFilter?: WasmContentFilterKind | null, bm25Query?: string | null, bm25Threshold?: number | null, userAgent?: string | null, rateLimitMs?: bigint | null, auth?: any | null, maxBodySize?: number | null, mapLimit?: number | null, mapSearch?: string | null, maxAssetSize?: number | null, proxy?: WasmProxyConfig | null, documentUrlDepth?: number | null, documentMaxSize?: number | null, documentOutputDir?: string | null, documentContentEncoding?: WasmDocumentContentEncoding | null, warcOutput?: string | null, browserProfile?: string | null, ssrfDenyPrivateExplicit?: boolean | null);
|
|
518
|
+
constructor(crawlStrategy?: WasmCrawlStrategyKind | null, respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, pathPatternsMatchQuery?: boolean | null, pathPatternsMatchUrl?: boolean | null, dedupIncludeQuery?: boolean | null, stripTrackingParams?: boolean | null, trackingParams?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, retryInitialDelayMs?: bigint | null, retryMaxDelayMs?: bigint | null, rateLimitJitterRatio?: number | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: WasmAssetCategory[] | null, browser?: WasmBrowserConfig | null, userAgents?: string[] | null, captureScreenshot?: boolean | null, followDocumentUrls?: boolean | null, downloadDocuments?: boolean | null, documentMimeTypes?: string[] | null, saveBrowserProfile?: boolean | null, ssrf?: WasmSsrfPolicy | null, maxDepth?: number | null, maxPages?: number | null, maxLinksPerPage?: number | null, maxConcurrent?: number | null, contentFilter?: WasmContentFilterKind | null, bm25Query?: string | null, bm25Threshold?: number | null, userAgent?: string | null, rateLimitMs?: bigint | null, auth?: any | null, maxBodySize?: number | null, mapLimit?: number | null, mapSearch?: string | null, maxAssetSize?: number | null, proxy?: WasmProxyConfig | null, documentUrlDepth?: number | null, documentMaxSize?: number | null, documentOutputDir?: string | null, documentContentEncoding?: WasmDocumentContentEncoding | null, warcOutput?: string | null, browserProfile?: string | null, ssrfDenyPrivateExplicit?: boolean | null, dangerAcceptInvalidCerts?: boolean | null, subdomainHeaderAllowlist?: string[] | null);
|
|
510
519
|
/**
|
|
511
520
|
* Validate the configuration, returning an error if any values are invalid.
|
|
512
521
|
*
|
|
@@ -545,6 +554,7 @@ export class WasmCrawlConfig {
|
|
|
545
554
|
get crawlStrategy(): string;
|
|
546
555
|
set crawlStrategy(value: WasmCrawlStrategyKind);
|
|
547
556
|
customHeaders: any;
|
|
557
|
+
dangerAcceptInvalidCerts: boolean;
|
|
548
558
|
dedupIncludeQuery: boolean;
|
|
549
559
|
get documentContentEncoding(): string | undefined;
|
|
550
560
|
set documentContentEncoding(value: WasmDocumentContentEncoding | null | undefined);
|
|
@@ -611,6 +621,7 @@ export class WasmCrawlConfig {
|
|
|
611
621
|
ssrf: WasmSsrfPolicy;
|
|
612
622
|
stayOnDomain: boolean;
|
|
613
623
|
stripTrackingParams: boolean;
|
|
624
|
+
subdomainHeaderAllowlist: string[];
|
|
614
625
|
trackingParams: string[];
|
|
615
626
|
get userAgent(): string | undefined;
|
|
616
627
|
set userAgent(value: string | null | undefined);
|
|
@@ -754,6 +765,7 @@ export class WasmCrawlPageResult {
|
|
|
754
765
|
export class WasmCrawlResult {
|
|
755
766
|
free(): void;
|
|
756
767
|
[Symbol.dispose](): void;
|
|
768
|
+
clearWafBlock(): void;
|
|
757
769
|
/**
|
|
758
770
|
* Return an independent handle for an ownership-taking API.
|
|
759
771
|
*
|
|
@@ -763,11 +775,16 @@ export class WasmCrawlResult {
|
|
|
763
775
|
copyForTransfer(): WasmCrawlResult;
|
|
764
776
|
static default(): WasmCrawlResult;
|
|
765
777
|
/**
|
|
778
|
+
* Takes ownership of `wafBlock`.
|
|
779
|
+
* wasm-bindgen lowers a by-value class argument through `__destroy_into_raw()`, so each
|
|
780
|
+
* of those handles is dead once this returns. Passing a freshly built value is fine. To
|
|
781
|
+
* keep a handle you already hold, build with `default()` and assign the property instead:
|
|
782
|
+
* the generated setter borrows and leaves your handle alive.
|
|
766
783
|
* Takes ownership of every element in `pages`, `cookies`.
|
|
767
784
|
* wasm-bindgen cannot borrow class values nested in an array. To keep those handles,
|
|
768
785
|
* copy each retained element with `copyForTransfer()` before passing the array.
|
|
769
786
|
*/
|
|
770
|
-
constructor(pages?: WasmCrawlPageResult[] | null, finalUrl?: string | null, redirectCount?: number | null, wasSkipped?: boolean | null, cookies?: WasmCookieInfo[] | null, stayedOnDomain?: boolean | null, browserUsed?: boolean | null, error?: string | null);
|
|
787
|
+
constructor(pages?: WasmCrawlPageResult[] | null, finalUrl?: string | null, redirectCount?: number | null, wasSkipped?: boolean | null, cookies?: WasmCookieInfo[] | null, stayedOnDomain?: boolean | null, browserUsed?: boolean | null, error?: string | null, wafBlock?: WasmWafBlockDetails | null);
|
|
771
788
|
/**
|
|
772
789
|
* Returns the count of unique normalized URLs encountered during crawling.
|
|
773
790
|
*
|
|
@@ -799,6 +816,14 @@ export class WasmCrawlResult {
|
|
|
799
816
|
pages: WasmCrawlPageResult[];
|
|
800
817
|
redirectCount: number;
|
|
801
818
|
stayedOnDomain: boolean;
|
|
819
|
+
/**
|
|
820
|
+
* Returns a detached copy of `wafBlock`.
|
|
821
|
+
*
|
|
822
|
+
* Changes to the returned value do not update this object. To update `wafBlock`,
|
|
823
|
+
* read it, modify the copy, then assign the copy back to `wafBlock`.
|
|
824
|
+
*/
|
|
825
|
+
get wafBlock(): WasmWafBlockDetails | undefined;
|
|
826
|
+
set wafBlock(value: WasmWafBlockDetails);
|
|
802
827
|
wasSkipped: boolean;
|
|
803
828
|
}
|
|
804
829
|
|
|
@@ -1661,6 +1686,28 @@ export class WasmSsrfPolicy {
|
|
|
1661
1686
|
schemeAllowlist: string[];
|
|
1662
1687
|
}
|
|
1663
1688
|
|
|
1689
|
+
/**
|
|
1690
|
+
* Structured context for a WAF-blocked response. <!-- -->
|
|
1691
|
+
*/
|
|
1692
|
+
export class WasmWafBlockDetails {
|
|
1693
|
+
free(): void;
|
|
1694
|
+
[Symbol.dispose](): void;
|
|
1695
|
+
/**
|
|
1696
|
+
* Return an independent handle for an ownership-taking API.
|
|
1697
|
+
*
|
|
1698
|
+
* Use `copyForTransfer()` for each class value placed in an array when the original
|
|
1699
|
+
* handle must remain usable.
|
|
1700
|
+
*/
|
|
1701
|
+
copyForTransfer(): WasmWafBlockDetails;
|
|
1702
|
+
static default(): WasmWafBlockDetails;
|
|
1703
|
+
constructor(vendor?: string | null, status?: number | null, bodyPrefix?: string | null);
|
|
1704
|
+
get bodyPrefix(): string | undefined;
|
|
1705
|
+
set bodyPrefix(value: string | null | undefined);
|
|
1706
|
+
get status(): number | undefined;
|
|
1707
|
+
set status(value: number | null | undefined);
|
|
1708
|
+
vendor: string;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1664
1711
|
/**
|
|
1665
1712
|
* Crawl multiple seed URLs concurrently, each following links to configured depth.
|
|
1666
1713
|
*/
|
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./crawlberg_wasm_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
WasmActionResult, WasmArticleMetadata, WasmAssetCategory, WasmAuthConfig, WasmBatchCrawlResult, WasmBatchCrawlResults, WasmBatchScrapeResult, WasmBatchScrapeResults, WasmBrowserBackend, WasmBrowserConfig, WasmBrowserExtras, WasmBrowserMode, WasmBrowserWait, WasmCitationReference, WasmCitationResult, WasmContentConfig, WasmContentFilterKind, WasmCookieInfo, WasmCrawlConfig, WasmCrawlEngineHandle, WasmCrawlPageResult, WasmCrawlResult, WasmCrawlStrategyKind, WasmDocumentContentEncoding, WasmDownloadedAsset, WasmDownloadedDocument, WasmExtractionMeta, WasmFaviconInfo, WasmFeedInfo, WasmFeedType, WasmHeadingInfo, WasmHostMatcher, WasmHreflangEntry, WasmImageInfo, WasmImageSource, WasmInteractionResult, WasmJsonLdEntry, WasmLinkInfo, WasmLinkType, WasmMapResult, WasmMarkdownResult, WasmPageAction, WasmPageMetadata, WasmProxyConfig, WasmResponseMeta, WasmScrapeResult, WasmScrollDirection, WasmSitemapUrl, WasmSsrfPolicy, batchCrawl, batchScrape, crawl, createEngine, generateCitations, interact, mapUrls, scrape
|
|
8
|
+
WasmActionResult, WasmArticleMetadata, WasmAssetCategory, WasmAuthConfig, WasmBatchCrawlResult, WasmBatchCrawlResults, WasmBatchScrapeResult, WasmBatchScrapeResults, WasmBrowserBackend, WasmBrowserConfig, WasmBrowserExtras, WasmBrowserMode, WasmBrowserWait, WasmCitationReference, WasmCitationResult, WasmContentConfig, WasmContentFilterKind, WasmCookieInfo, WasmCrawlConfig, WasmCrawlEngineHandle, WasmCrawlPageResult, WasmCrawlResult, WasmCrawlStrategyKind, WasmDocumentContentEncoding, WasmDownloadedAsset, WasmDownloadedDocument, WasmExtractionMeta, WasmFaviconInfo, WasmFeedInfo, WasmFeedType, WasmHeadingInfo, WasmHostMatcher, WasmHreflangEntry, WasmImageInfo, WasmImageSource, WasmInteractionResult, WasmJsonLdEntry, WasmLinkInfo, WasmLinkType, WasmMapResult, WasmMarkdownResult, WasmPageAction, WasmPageMetadata, WasmProxyConfig, WasmResponseMeta, WasmScrapeResult, WasmScrollDirection, WasmSitemapUrl, WasmSsrfPolicy, WasmWafBlockDetails, batchCrawl, batchScrape, crawl, createEngine, generateCitations, interact, mapUrls, scrape
|
|
9
9
|
} from "./crawlberg_wasm_bg.js";
|