@xberg-io/crawlberg-wasm 1.2.1 → 1.3.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.
@@ -1768,6 +1768,14 @@ export class WasmContentConfig {
1768
1768
  }
1769
1769
  if (Symbol.dispose) WasmContentConfig.prototype[Symbol.dispose] = WasmContentConfig.prototype.free;
1770
1770
 
1771
+ /**
1772
+ * Content filter applied to each crawled page before it reaches the result.
1773
+ * @enum {0}
1774
+ */
1775
+ export const WasmContentFilterKind = Object.freeze({
1776
+ Bm25: 0, "0": "Bm25",
1777
+ });
1778
+
1771
1779
  /**
1772
1780
  * Information about an HTTP cookie received from a response.
1773
1781
  */
@@ -1953,6 +1961,25 @@ export class WasmCrawlConfig {
1953
1961
  const ret = wasm.wasmcrawlconfig_auth(this.__wbg_ptr);
1954
1962
  return ret;
1955
1963
  }
1964
+ /**
1965
+ * @returns {string | undefined}
1966
+ */
1967
+ get bm25Query() {
1968
+ const ret = wasm.wasmcrawlconfig_bm25Query(this.__wbg_ptr);
1969
+ let v1;
1970
+ if (ret[0] !== 0) {
1971
+ v1 = getStringFromWasm0(ret[0], ret[1]);
1972
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1973
+ }
1974
+ return v1;
1975
+ }
1976
+ /**
1977
+ * @returns {number | undefined}
1978
+ */
1979
+ get bm25Threshold() {
1980
+ const ret = wasm.wasmcrawlconfig_bm25Threshold(this.__wbg_ptr);
1981
+ return ret[0] === 0 ? undefined : ret[1];
1982
+ }
1956
1983
  /**
1957
1984
  * @returns {WasmBrowserConfig}
1958
1985
  */
@@ -1986,6 +2013,18 @@ export class WasmCrawlConfig {
1986
2013
  const ret = wasm.wasmcrawlconfig_content(this.__wbg_ptr);
1987
2014
  return WasmContentConfig.__wrap(ret);
1988
2015
  }
2016
+ /**
2017
+ * @returns {string | undefined}
2018
+ */
2019
+ get contentFilter() {
2020
+ const ret = wasm.wasmcrawlconfig_contentFilter(this.__wbg_ptr);
2021
+ let v1;
2022
+ if (ret[0] !== 0) {
2023
+ v1 = getStringFromWasm0(ret[0], ret[1]);
2024
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
2025
+ }
2026
+ return v1;
2027
+ }
1989
2028
  /**
1990
2029
  * @returns {boolean}
1991
2030
  */
@@ -1993,6 +2032,21 @@ export class WasmCrawlConfig {
1993
2032
  const ret = wasm.wasmcrawlconfig_cookiesEnabled(this.__wbg_ptr);
1994
2033
  return ret !== 0;
1995
2034
  }
2035
+ /**
2036
+ * @returns {string}
2037
+ */
2038
+ get crawlStrategy() {
2039
+ let deferred1_0;
2040
+ let deferred1_1;
2041
+ try {
2042
+ const ret = wasm.wasmcrawlconfig_crawlStrategy(this.__wbg_ptr);
2043
+ deferred1_0 = ret[0];
2044
+ deferred1_1 = ret[1];
2045
+ return getStringFromWasm0(ret[0], ret[1]);
2046
+ } finally {
2047
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
2048
+ }
2049
+ }
1996
2050
  /**
1997
2051
  * @returns {any}
1998
2052
  */
@@ -2162,6 +2216,7 @@ export class WasmCrawlConfig {
2162
2216
  return ret >>> 0;
2163
2217
  }
2164
2218
  /**
2219
+ * @param {WasmCrawlStrategyKind | null} [crawlStrategy]
2165
2220
  * @param {boolean | null} [respectRobotsTxt]
2166
2221
  * @param {boolean | null} [softHttpErrors]
2167
2222
  * @param {boolean | null} [stayOnDomain]
@@ -2190,6 +2245,9 @@ export class WasmCrawlConfig {
2190
2245
  * @param {number | null} [maxPages]
2191
2246
  * @param {number | null} [maxLinksPerPage]
2192
2247
  * @param {number | null} [maxConcurrent]
2248
+ * @param {WasmContentFilterKind | null} [contentFilter]
2249
+ * @param {string | null} [bm25Query]
2250
+ * @param {number | null} [bm25Threshold]
2193
2251
  * @param {string | null} [userAgent]
2194
2252
  * @param {bigint | null} [rateLimitMs]
2195
2253
  * @param {any | null} [auth]
@@ -2206,7 +2264,7 @@ export class WasmCrawlConfig {
2206
2264
  * @param {string | null} [browserProfile]
2207
2265
  * @param {boolean | null} [ssrfDenyPrivateExplicit]
2208
2266
  */
2209
- constructor(respectRobotsTxt, softHttpErrors, stayOnDomain, allowSubdomains, includePaths, excludePaths, customHeaders, requestTimeout, maxRedirects, retryCount, retryCodes, cookiesEnabled, removeTags, content, downloadAssets, assetTypes, browser, userAgents, captureScreenshot, followDocumentUrls, downloadDocuments, documentMimeTypes, saveBrowserProfile, ssrf, maxDepth, maxPages, maxLinksPerPage, maxConcurrent, userAgent, rateLimitMs, auth, maxBodySize, mapLimit, mapSearch, maxAssetSize, proxy, documentUrlDepth, documentMaxSize, documentOutputDir, documentContentEncoding, warcOutput, browserProfile, ssrfDenyPrivateExplicit) {
2267
+ constructor(crawlStrategy, respectRobotsTxt, softHttpErrors, stayOnDomain, allowSubdomains, includePaths, excludePaths, customHeaders, requestTimeout, maxRedirects, retryCount, retryCodes, cookiesEnabled, removeTags, content, downloadAssets, assetTypes, browser, userAgents, captureScreenshot, followDocumentUrls, downloadDocuments, documentMimeTypes, saveBrowserProfile, ssrf, maxDepth, maxPages, maxLinksPerPage, maxConcurrent, contentFilter, bm25Query, bm25Threshold, userAgent, rateLimitMs, auth, maxBodySize, mapLimit, mapSearch, maxAssetSize, proxy, documentUrlDepth, documentMaxSize, documentOutputDir, documentContentEncoding, warcOutput, browserProfile, ssrfDenyPrivateExplicit) {
2210
2268
  var ptr0 = isLikeNone(includePaths) ? 0 : passArrayJsValueToWasm0(includePaths, wasm.__wbindgen_malloc);
2211
2269
  var len0 = WASM_VECTOR_LEN;
2212
2270
  var ptr1 = isLikeNone(excludePaths) ? 0 : passArrayJsValueToWasm0(excludePaths, wasm.__wbindgen_malloc);
@@ -2236,22 +2294,24 @@ export class WasmCrawlConfig {
2236
2294
  _assertClass(ssrf, WasmSsrfPolicy);
2237
2295
  ptr9 = ssrf.__destroy_into_raw();
2238
2296
  }
2239
- var ptr10 = isLikeNone(userAgent) ? 0 : passStringToWasm0(userAgent, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2297
+ var ptr10 = isLikeNone(bm25Query) ? 0 : passStringToWasm0(bm25Query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2240
2298
  var len10 = WASM_VECTOR_LEN;
2241
- var ptr11 = isLikeNone(mapSearch) ? 0 : passStringToWasm0(mapSearch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2299
+ var ptr11 = isLikeNone(userAgent) ? 0 : passStringToWasm0(userAgent, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2242
2300
  var len11 = WASM_VECTOR_LEN;
2243
- let ptr12 = 0;
2301
+ var ptr12 = isLikeNone(mapSearch) ? 0 : passStringToWasm0(mapSearch, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2302
+ var len12 = WASM_VECTOR_LEN;
2303
+ let ptr13 = 0;
2244
2304
  if (!isLikeNone(proxy)) {
2245
2305
  _assertClass(proxy, WasmProxyConfig);
2246
- ptr12 = proxy.__destroy_into_raw();
2306
+ ptr13 = proxy.__destroy_into_raw();
2247
2307
  }
2248
- var ptr13 = isLikeNone(documentOutputDir) ? 0 : passStringToWasm0(documentOutputDir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2249
- var len13 = WASM_VECTOR_LEN;
2250
- var ptr14 = isLikeNone(warcOutput) ? 0 : passStringToWasm0(warcOutput, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2308
+ var ptr14 = isLikeNone(documentOutputDir) ? 0 : passStringToWasm0(documentOutputDir, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2251
2309
  var len14 = WASM_VECTOR_LEN;
2252
- var ptr15 = isLikeNone(browserProfile) ? 0 : passStringToWasm0(browserProfile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2310
+ var ptr15 = isLikeNone(warcOutput) ? 0 : passStringToWasm0(warcOutput, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2253
2311
  var len15 = WASM_VECTOR_LEN;
2254
- const ret = wasm.wasmcrawlconfig_new(isLikeNone(respectRobotsTxt) ? 0xFFFFFF : respectRobotsTxt ? 1 : 0, isLikeNone(softHttpErrors) ? 0xFFFFFF : softHttpErrors ? 1 : 0, isLikeNone(stayOnDomain) ? 0xFFFFFF : stayOnDomain ? 1 : 0, isLikeNone(allowSubdomains) ? 0xFFFFFF : allowSubdomains ? 1 : 0, ptr0, len0, ptr1, len1, isLikeNone(customHeaders) ? 0 : addToExternrefTable0(customHeaders), !isLikeNone(requestTimeout), isLikeNone(requestTimeout) ? BigInt(0) : requestTimeout, isLikeNone(maxRedirects) ? Number.MAX_SAFE_INTEGER : (maxRedirects) >>> 0, isLikeNone(retryCount) ? Number.MAX_SAFE_INTEGER : (retryCount) >>> 0, ptr2, len2, isLikeNone(cookiesEnabled) ? 0xFFFFFF : cookiesEnabled ? 1 : 0, ptr3, len3, ptr4, isLikeNone(downloadAssets) ? 0xFFFFFF : downloadAssets ? 1 : 0, ptr5, len5, ptr6, ptr7, len7, isLikeNone(captureScreenshot) ? 0xFFFFFF : captureScreenshot ? 1 : 0, isLikeNone(followDocumentUrls) ? 0xFFFFFF : followDocumentUrls ? 1 : 0, isLikeNone(downloadDocuments) ? 0xFFFFFF : downloadDocuments ? 1 : 0, ptr8, len8, isLikeNone(saveBrowserProfile) ? 0xFFFFFF : saveBrowserProfile ? 1 : 0, ptr9, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, isLikeNone(maxPages) ? Number.MAX_SAFE_INTEGER : (maxPages) >>> 0, isLikeNone(maxLinksPerPage) ? Number.MAX_SAFE_INTEGER : (maxLinksPerPage) >>> 0, isLikeNone(maxConcurrent) ? Number.MAX_SAFE_INTEGER : (maxConcurrent) >>> 0, ptr10, len10, !isLikeNone(rateLimitMs), isLikeNone(rateLimitMs) ? BigInt(0) : rateLimitMs, isLikeNone(auth) ? 0 : addToExternrefTable0(auth), isLikeNone(maxBodySize) ? Number.MAX_SAFE_INTEGER : (maxBodySize) >>> 0, isLikeNone(mapLimit) ? Number.MAX_SAFE_INTEGER : (mapLimit) >>> 0, ptr11, len11, isLikeNone(maxAssetSize) ? Number.MAX_SAFE_INTEGER : (maxAssetSize) >>> 0, ptr12, isLikeNone(documentUrlDepth) ? Number.MAX_SAFE_INTEGER : (documentUrlDepth) >>> 0, isLikeNone(documentMaxSize) ? Number.MAX_SAFE_INTEGER : (documentMaxSize) >>> 0, ptr13, len13, isLikeNone(documentContentEncoding) ? 1 : documentContentEncoding, ptr14, len14, ptr15, len15, isLikeNone(ssrfDenyPrivateExplicit) ? 0xFFFFFF : ssrfDenyPrivateExplicit ? 1 : 0);
2312
+ var ptr16 = isLikeNone(browserProfile) ? 0 : passStringToWasm0(browserProfile, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2313
+ var len16 = WASM_VECTOR_LEN;
2314
+ const ret = wasm.wasmcrawlconfig_new(isLikeNone(crawlStrategy) ? 4 : crawlStrategy, isLikeNone(respectRobotsTxt) ? 0xFFFFFF : respectRobotsTxt ? 1 : 0, isLikeNone(softHttpErrors) ? 0xFFFFFF : softHttpErrors ? 1 : 0, isLikeNone(stayOnDomain) ? 0xFFFFFF : stayOnDomain ? 1 : 0, isLikeNone(allowSubdomains) ? 0xFFFFFF : allowSubdomains ? 1 : 0, ptr0, len0, ptr1, len1, isLikeNone(customHeaders) ? 0 : addToExternrefTable0(customHeaders), !isLikeNone(requestTimeout), isLikeNone(requestTimeout) ? BigInt(0) : requestTimeout, isLikeNone(maxRedirects) ? Number.MAX_SAFE_INTEGER : (maxRedirects) >>> 0, isLikeNone(retryCount) ? Number.MAX_SAFE_INTEGER : (retryCount) >>> 0, ptr2, len2, isLikeNone(cookiesEnabled) ? 0xFFFFFF : cookiesEnabled ? 1 : 0, ptr3, len3, ptr4, isLikeNone(downloadAssets) ? 0xFFFFFF : downloadAssets ? 1 : 0, ptr5, len5, ptr6, ptr7, len7, isLikeNone(captureScreenshot) ? 0xFFFFFF : captureScreenshot ? 1 : 0, isLikeNone(followDocumentUrls) ? 0xFFFFFF : followDocumentUrls ? 1 : 0, isLikeNone(downloadDocuments) ? 0xFFFFFF : downloadDocuments ? 1 : 0, ptr8, len8, isLikeNone(saveBrowserProfile) ? 0xFFFFFF : saveBrowserProfile ? 1 : 0, ptr9, isLikeNone(maxDepth) ? Number.MAX_SAFE_INTEGER : (maxDepth) >>> 0, isLikeNone(maxPages) ? Number.MAX_SAFE_INTEGER : (maxPages) >>> 0, isLikeNone(maxLinksPerPage) ? Number.MAX_SAFE_INTEGER : (maxLinksPerPage) >>> 0, isLikeNone(maxConcurrent) ? Number.MAX_SAFE_INTEGER : (maxConcurrent) >>> 0, isLikeNone(contentFilter) ? 1 : contentFilter, ptr10, len10, !isLikeNone(bm25Threshold), isLikeNone(bm25Threshold) ? 0 : bm25Threshold, ptr11, len11, !isLikeNone(rateLimitMs), isLikeNone(rateLimitMs) ? BigInt(0) : rateLimitMs, isLikeNone(auth) ? 0 : addToExternrefTable0(auth), isLikeNone(maxBodySize) ? Number.MAX_SAFE_INTEGER : (maxBodySize) >>> 0, isLikeNone(mapLimit) ? Number.MAX_SAFE_INTEGER : (mapLimit) >>> 0, ptr12, len12, isLikeNone(maxAssetSize) ? Number.MAX_SAFE_INTEGER : (maxAssetSize) >>> 0, ptr13, isLikeNone(documentUrlDepth) ? Number.MAX_SAFE_INTEGER : (documentUrlDepth) >>> 0, isLikeNone(documentMaxSize) ? Number.MAX_SAFE_INTEGER : (documentMaxSize) >>> 0, ptr14, len14, isLikeNone(documentContentEncoding) ? 1 : documentContentEncoding, ptr15, len15, ptr16, len16, isLikeNone(ssrfDenyPrivateExplicit) ? 0xFFFFFF : ssrfDenyPrivateExplicit ? 1 : 0);
2255
2315
  this.__wbg_ptr = ret;
2256
2316
  WasmCrawlConfigFinalization.register(this, this.__wbg_ptr, this);
2257
2317
  return this;
@@ -2336,6 +2396,20 @@ export class WasmCrawlConfig {
2336
2396
  set auth(value) {
2337
2397
  wasm.wasmcrawlconfig_set_auth(this.__wbg_ptr, isLikeNone(value) ? 0 : addToExternrefTable0(value));
2338
2398
  }
2399
+ /**
2400
+ * @param {string | null} [value]
2401
+ */
2402
+ set bm25Query(value) {
2403
+ var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2404
+ var len0 = WASM_VECTOR_LEN;
2405
+ wasm.wasmcrawlconfig_set_bm25Query(this.__wbg_ptr, ptr0, len0);
2406
+ }
2407
+ /**
2408
+ * @param {number | null} [value]
2409
+ */
2410
+ set bm25Threshold(value) {
2411
+ wasm.wasmcrawlconfig_set_bm25Threshold(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? 0 : value);
2412
+ }
2339
2413
  /**
2340
2414
  * @param {WasmBrowserConfig} value
2341
2415
  */
@@ -2366,12 +2440,24 @@ export class WasmCrawlConfig {
2366
2440
  var ptr0 = value.__destroy_into_raw();
2367
2441
  wasm.wasmcrawlconfig_set_content(this.__wbg_ptr, ptr0);
2368
2442
  }
2443
+ /**
2444
+ * @param {WasmContentFilterKind | null} [value]
2445
+ */
2446
+ set contentFilter(value) {
2447
+ wasm.wasmcrawlconfig_set_contentFilter(this.__wbg_ptr, isLikeNone(value) ? 1 : value);
2448
+ }
2369
2449
  /**
2370
2450
  * @param {boolean} value
2371
2451
  */
2372
2452
  set cookiesEnabled(value) {
2373
2453
  wasm.wasmcrawlconfig_set_cookiesEnabled(this.__wbg_ptr, value);
2374
2454
  }
2455
+ /**
2456
+ * @param {WasmCrawlStrategyKind} value
2457
+ */
2458
+ set crawlStrategy(value) {
2459
+ wasm.wasmcrawlconfig_set_crawlStrategy(this.__wbg_ptr, value);
2460
+ }
2375
2461
  /**
2376
2462
  * @param {any} value
2377
2463
  */
@@ -3362,6 +3448,21 @@ export class WasmCrawlResult {
3362
3448
  }
3363
3449
  if (Symbol.dispose) WasmCrawlResult.prototype[Symbol.dispose] = WasmCrawlResult.prototype.free;
3364
3450
 
3451
+ /**
3452
+ * Traversal order for a crawl.
3453
+ *
3454
+ * Selects both the queue discipline and the selection strategy, because global order is a
3455
+ * property of the frontier: the engine hands its bounded selection window to the strategy, so
3456
+ * a strategy alone can only reorder URLs that have already been dequeued.
3457
+ * @enum {0 | 1 | 2 | 3}
3458
+ */
3459
+ export const WasmCrawlStrategyKind = Object.freeze({
3460
+ Bfs: 0, "0": "Bfs",
3461
+ Dfs: 1, "1": "Dfs",
3462
+ BestFirst: 2, "2": "BestFirst",
3463
+ Adaptive: 3, "3": "Adaptive",
3464
+ });
3465
+
3365
3466
  /**
3366
3467
  * Opt-in encoding applied to a downloaded document's bytes for callers who need the
3367
3468
  * content available in a serializable field rather than reading it from disk.
@@ -7956,7 +8057,7 @@ function __wbg_get_imports() {
7956
8057
  const a = state0.a;
7957
8058
  state0.a = 0;
7958
8059
  try {
7959
- return wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d(a, state0.b, arg0, arg1);
8060
+ return wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3(a, state0.b, arg0, arg1);
7960
8061
  } finally {
7961
8062
  state0.a = a;
7962
8063
  }
@@ -7979,10 +8080,18 @@ function __wbg_get_imports() {
7979
8080
  const ret = arg0.next;
7980
8081
  return ret;
7981
8082
  },
8083
+ __wbg_now_e7c6795a7f81e10f: function(arg0) {
8084
+ const ret = arg0.now();
8085
+ return ret;
8086
+ },
7982
8087
  __wbg_parse_1cc93481b0865939: function() { return handleError(function (arg0, arg1) {
7983
8088
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
7984
8089
  return ret;
7985
8090
  }, arguments); },
8091
+ __wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
8092
+ const ret = arg0.performance;
8093
+ return ret;
8094
+ },
7986
8095
  __wbg_prototypesetcall_de8e0d9553586985: function(arg0, arg1, arg2) {
7987
8096
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
7988
8097
  },
@@ -8236,13 +8345,13 @@ function __wbg_get_imports() {
8236
8345
  return ret;
8237
8346
  },
8238
8347
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
8239
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 992, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
8240
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97);
8348
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1069, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
8349
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43);
8241
8350
  return ret;
8242
8351
  },
8243
8352
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
8244
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 882, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8245
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65);
8353
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 954, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
8354
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f);
8246
8355
  return ret;
8247
8356
  },
8248
8357
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -8281,19 +8390,19 @@ function __wbg_get_imports() {
8281
8390
  };
8282
8391
  }
8283
8392
 
8284
- function wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65(arg0, arg1) {
8285
- wasm.wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65(arg0, arg1);
8393
+ function wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f(arg0, arg1) {
8394
+ wasm.wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f(arg0, arg1);
8286
8395
  }
8287
8396
 
8288
- function wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97(arg0, arg1, arg2) {
8289
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97(arg0, arg1, arg2);
8397
+ function wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43(arg0, arg1, arg2) {
8398
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43(arg0, arg1, arg2);
8290
8399
  if (ret[1]) {
8291
8400
  throw takeFromExternrefTable0(ret[0]);
8292
8401
  }
8293
8402
  }
8294
8403
 
8295
- function wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d(arg0, arg1, arg2, arg3) {
8296
- wasm.wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d(arg0, arg1, arg2, arg3);
8404
+ function wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3(arg0, arg1, arg2, arg3) {
8405
+ wasm.wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3(arg0, arg1, arg2, arg3);
8297
8406
  }
8298
8407
 
8299
8408
 
Binary file
@@ -203,11 +203,15 @@ export const wasmcookieinfo_value: (a: number) => [number, number];
203
203
  export const wasmcrawlconfig_allowSubdomains: (a: number) => number;
204
204
  export const wasmcrawlconfig_assetTypes: (a: number) => [number, number];
205
205
  export const wasmcrawlconfig_auth: (a: number) => any;
206
+ export const wasmcrawlconfig_bm25Query: (a: number) => [number, number];
207
+ export const wasmcrawlconfig_bm25Threshold: (a: number) => [number, number];
206
208
  export const wasmcrawlconfig_browser: (a: number) => number;
207
209
  export const wasmcrawlconfig_browserProfile: (a: number) => [number, number];
208
210
  export const wasmcrawlconfig_captureScreenshot: (a: number) => number;
209
211
  export const wasmcrawlconfig_content: (a: number) => number;
212
+ export const wasmcrawlconfig_contentFilter: (a: number) => [number, number];
210
213
  export const wasmcrawlconfig_cookiesEnabled: (a: number) => number;
214
+ export const wasmcrawlconfig_crawlStrategy: (a: number) => [number, number];
211
215
  export const wasmcrawlconfig_customHeaders: (a: number) => any;
212
216
  export const wasmcrawlconfig_default: () => number;
213
217
  export const wasmcrawlconfig_documentContentEncoding: (a: number) => [number, number];
@@ -229,8 +233,9 @@ export const wasmcrawlconfig_maxDepth: (a: number) => number;
229
233
  export const wasmcrawlconfig_maxLinksPerPage: (a: number) => number;
230
234
  export const wasmcrawlconfig_maxPages: (a: number) => number;
231
235
  export const wasmcrawlconfig_maxRedirects: (a: number) => number;
232
- export const wasmcrawlconfig_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: bigint, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: bigint, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: number, v1: number, w1: number, x1: number, y1: number, z1: number, a2: number, b2: number, c2: number, d2: number, e2: number) => number;
236
+ export const wasmcrawlconfig_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: bigint, u1: number, v1: number, w1: number, x1: number, y1: number, z1: number, a2: number, b2: number, c2: number, d2: number, e2: number, f2: number, g2: number, h2: number, i2: number, j2: number, k2: number) => number;
233
237
  export const wasmcrawlconfig_proxy: (a: number) => number;
238
+ export const wasmcrawlconfig_rateLimitMs: (a: number) => [number, bigint];
234
239
  export const wasmcrawlconfig_removeTags: (a: number) => [number, number];
235
240
  export const wasmcrawlconfig_respectRobotsTxt: (a: number) => number;
236
241
  export const wasmcrawlconfig_retryCodes: (a: number) => [number, number];
@@ -239,11 +244,15 @@ export const wasmcrawlconfig_saveBrowserProfile: (a: number) => number;
239
244
  export const wasmcrawlconfig_set_allowSubdomains: (a: number, b: number) => void;
240
245
  export const wasmcrawlconfig_set_assetTypes: (a: number, b: number, c: number) => void;
241
246
  export const wasmcrawlconfig_set_auth: (a: number, b: number) => void;
247
+ export const wasmcrawlconfig_set_bm25Query: (a: number, b: number, c: number) => void;
248
+ export const wasmcrawlconfig_set_bm25Threshold: (a: number, b: number, c: number) => void;
242
249
  export const wasmcrawlconfig_set_browser: (a: number, b: number) => void;
243
250
  export const wasmcrawlconfig_set_browserProfile: (a: number, b: number, c: number) => void;
244
251
  export const wasmcrawlconfig_set_captureScreenshot: (a: number, b: number) => void;
245
252
  export const wasmcrawlconfig_set_content: (a: number, b: number) => void;
253
+ export const wasmcrawlconfig_set_contentFilter: (a: number, b: number) => void;
246
254
  export const wasmcrawlconfig_set_cookiesEnabled: (a: number, b: number) => void;
255
+ export const wasmcrawlconfig_set_crawlStrategy: (a: number, b: number) => void;
247
256
  export const wasmcrawlconfig_set_customHeaders: (a: number, b: any) => void;
248
257
  export const wasmcrawlconfig_set_documentContentEncoding: (a: number, b: number) => void;
249
258
  export const wasmcrawlconfig_set_documentMaxSize: (a: number, b: number) => void;
@@ -265,6 +274,7 @@ export const wasmcrawlconfig_set_maxLinksPerPage: (a: number, b: number) => void
265
274
  export const wasmcrawlconfig_set_maxPages: (a: number, b: number) => void;
266
275
  export const wasmcrawlconfig_set_maxRedirects: (a: number, b: number) => void;
267
276
  export const wasmcrawlconfig_set_proxy: (a: number, b: number) => void;
277
+ export const wasmcrawlconfig_set_rateLimitMs: (a: number, b: number, c: bigint) => void;
268
278
  export const wasmcrawlconfig_set_removeTags: (a: number, b: number, c: number) => void;
269
279
  export const wasmcrawlconfig_set_respectRobotsTxt: (a: number, b: number) => void;
270
280
  export const wasmcrawlconfig_set_retryCodes: (a: number, b: number, c: number) => void;
@@ -381,14 +391,10 @@ export const wasmdownloadeddocument_size: (a: number) => number;
381
391
  export const wasmdownloadeddocument_truncated: (a: number) => number;
382
392
  export const wasmdownloadeddocument_url: (a: number) => [number, number];
383
393
  export const wasmextractionmeta_chunksProcessed: (a: number) => number;
384
- export const wasmextractionmeta_completionTokens: (a: number) => [number, bigint];
385
- export const wasmextractionmeta_cost: (a: number) => [number, number];
386
394
  export const wasmextractionmeta_default: () => number;
387
395
  export const wasmextractionmeta_model: (a: number) => [number, number];
388
396
  export const wasmextractionmeta_new: (a: number, b: number, c: number, d: number, e: bigint, f: number, g: bigint, h: number, i: number) => number;
389
397
  export const wasmextractionmeta_set_chunksProcessed: (a: number, b: number) => void;
390
- export const wasmextractionmeta_set_completionTokens: (a: number, b: number, c: bigint) => void;
391
- export const wasmextractionmeta_set_cost: (a: number, b: number, c: number) => void;
392
398
  export const wasmextractionmeta_set_model: (a: number, b: number, c: number) => void;
393
399
  export const wasmfaviconinfo_mimeType: (a: number) => [number, number];
394
400
  export const wasmfaviconinfo_rel: (a: number) => [number, number];
@@ -682,11 +688,13 @@ export const wasmssrfpolicy_set_allowlist: (a: number, b: any) => void;
682
688
  export const wasmssrfpolicy_set_denyPrivate: (a: number, b: number) => void;
683
689
  export const wasmssrfpolicy_set_maxRedirects: (a: number, b: number) => void;
684
690
  export const wasmhostmatcher_new: () => number;
685
- export const wasmcrawlconfig_set_rateLimitMs: (a: number, b: number, c: bigint) => void;
691
+ export const wasmcrawlconfig_set_requestTimeout: (a: number, b: number, c: bigint) => void;
692
+ export const wasmextractionmeta_set_completionTokens: (a: number, b: number, c: bigint) => void;
686
693
  export const wasmextractionmeta_set_promptTokens: (a: number, b: number, c: bigint) => void;
687
694
  export const wasmpageaction_set_milliseconds: (a: number, b: number, c: bigint) => void;
688
- export const wasmcrawlconfig_rateLimitMs: (a: number) => [number, bigint];
689
695
  export const wasmcrawlconfig_requestTimeout: (a: number) => [number, bigint];
696
+ export const wasmextractionmeta_completionTokens: (a: number) => [number, bigint];
697
+ export const wasmextractionmeta_cost: (a: number) => [number, number];
690
698
  export const wasmextractionmeta_promptTokens: (a: number) => [number, bigint];
691
699
  export const wasmpageaction_amount: (a: number) => [number, bigint];
692
700
  export const wasmpageaction_milliseconds: (a: number) => [number, bigint];
@@ -708,13 +716,13 @@ export const wasmimageinfo_width: (a: number) => number;
708
716
  export const wasmpagemetadata_wordCount: (a: number) => number;
709
717
  export const wasmlinkinfo_nofollow: (a: number) => number;
710
718
  export const wasmauthconfig_new: () => number;
711
- export const wasmcrawlconfig_set_requestTimeout: (a: number, b: number, c: bigint) => void;
719
+ export const wasmextractionmeta_set_cost: (a: number, b: number, c: number) => void;
712
720
  export const wasmpageaction_set_amount: (a: number, b: number, c: bigint) => void;
713
721
  export const wasmscraperesult_set_crawlDelay: (a: number, b: number, c: bigint) => void;
714
722
  export const wasmpageaction_new: () => number;
715
- export const wasm_bindgen__convert__closures_____invoke__he29f1bb22c192c97: (a: number, b: number, c: any) => [number, number];
716
- export const wasm_bindgen__convert__closures_____invoke__h06ea3d672ad56c9d: (a: number, b: number, c: any, d: any) => void;
717
- export const wasm_bindgen__convert__closures_____invoke__hbe9f9227fe7d8a65: (a: number, b: number) => void;
723
+ export const wasm_bindgen__convert__closures_____invoke__h2deefa3c9140ef43: (a: number, b: number, c: any) => [number, number];
724
+ export const wasm_bindgen__convert__closures_____invoke__h072ef20b96c52fc3: (a: number, b: number, c: any, d: any) => void;
725
+ export const wasm_bindgen__convert__closures_____invoke__h99e891e0bdc2d97f: (a: number, b: number) => void;
718
726
  export const __wbindgen_malloc: (a: number, b: number) => number;
719
727
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
720
728
  export const __wbindgen_exn_store: (a: number) => void;
@@ -267,6 +267,13 @@ export class WasmContentConfig {
267
267
  wrapWidth: number;
268
268
  }
269
269
 
270
+ /**
271
+ * Content filter applied to each crawled page before it reaches the result.
272
+ */
273
+ export enum WasmContentFilterKind {
274
+ Bm25 = 0,
275
+ }
276
+
270
277
  /**
271
278
  * Information about an HTTP cookie received from a response.
272
279
  */
@@ -290,7 +297,7 @@ export class WasmCrawlConfig {
290
297
  free(): void;
291
298
  [Symbol.dispose](): void;
292
299
  static default(): WasmCrawlConfig;
293
- constructor(respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: any[] | 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, 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);
300
+ constructor(crawlStrategy?: WasmCrawlStrategyKind | null, respectRobotsTxt?: boolean | null, softHttpErrors?: boolean | null, stayOnDomain?: boolean | null, allowSubdomains?: boolean | null, includePaths?: string[] | null, excludePaths?: string[] | null, customHeaders?: any | null, requestTimeout?: bigint | null, maxRedirects?: number | null, retryCount?: number | null, retryCodes?: Uint16Array | null, cookiesEnabled?: boolean | null, removeTags?: string[] | null, content?: WasmContentConfig | null, downloadAssets?: boolean | null, assetTypes?: any[] | 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);
294
301
  /**
295
302
  * Validate the configuration, returning an error if any values are invalid.
296
303
  */
@@ -299,12 +306,20 @@ export class WasmCrawlConfig {
299
306
  assetTypes: string[];
300
307
  get auth(): any | undefined;
301
308
  set auth(value: any | null | undefined);
309
+ get bm25Query(): string | undefined;
310
+ set bm25Query(value: string | null | undefined);
311
+ get bm25Threshold(): number | undefined;
312
+ set bm25Threshold(value: number | null | undefined);
302
313
  browser: WasmBrowserConfig;
303
314
  get browserProfile(): string | undefined;
304
315
  set browserProfile(value: string | null | undefined);
305
316
  captureScreenshot: boolean;
306
317
  content: WasmContentConfig;
318
+ get contentFilter(): string | undefined;
319
+ set contentFilter(value: WasmContentFilterKind | null | undefined);
307
320
  cookiesEnabled: boolean;
321
+ get crawlStrategy(): string;
322
+ set crawlStrategy(value: WasmCrawlStrategyKind);
308
323
  customHeaders: any;
309
324
  get documentContentEncoding(): string | undefined;
310
325
  set documentContentEncoding(value: WasmDocumentContentEncoding | null | undefined);
@@ -438,6 +453,20 @@ export class WasmCrawlResult {
438
453
  wasSkipped: boolean;
439
454
  }
440
455
 
456
+ /**
457
+ * Traversal order for a crawl.
458
+ *
459
+ * Selects both the queue discipline and the selection strategy, because global order is a
460
+ * property of the frontier: the engine hands its bounded selection window to the strategy, so
461
+ * a strategy alone can only reorder URLs that have already been dequeued.
462
+ */
463
+ export enum WasmCrawlStrategyKind {
464
+ Bfs = 0,
465
+ Dfs = 1,
466
+ BestFirst = 2,
467
+ Adaptive = 3,
468
+ }
469
+
441
470
  /**
442
471
  * Opt-in encoding applied to a downloaded document's bytes for callers who need the
443
472
  * content available in a serializable field rather than reading it from disk.