@crawlee/puppeteer 4.0.0-beta.103 → 4.0.0-beta.105

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.
@@ -9,11 +9,9 @@ import type { PuppeteerLaunchContext } from './puppeteer-launcher.js';
9
9
  import type { InterceptHandler } from './utils/puppeteer_request_interception.js';
10
10
  import type { BlockRequestsOptions, DirectNavigationOptions, InfiniteScrollOptions, InjectFileOptions, PuppeteerContextUtils, SaveSnapshotOptions } from './utils/puppeteer_utils.js';
11
11
  export type PuppeteerGoToOptions = NonNullable<Parameters<Page['goto']>[1]>;
12
- export interface PuppeteerCrawlingContext<UserData extends Dictionary = Dictionary> extends BrowserCrawlingContext<Page, HTTPResponse, UserData, PuppeteerGoToOptions>, PuppeteerContextUtils {
13
- }
14
- // @ts-ignore optional peer dependency or compatibility with es2022
15
- export interface PuppeteerHook extends BrowserHook<PuppeteerCrawlingContext> {
12
+ export interface PuppeteerCrawlingContext<UserData extends Dictionary = any> extends BrowserCrawlingContext<Page, HTTPResponse, UserData, PuppeteerGoToOptions>, PuppeteerContextUtils {
16
13
  }
14
+ export type PuppeteerHook<UserData extends Dictionary = any> = BrowserHook<PuppeteerCrawlingContext<UserData>>;
17
15
  export interface PuppeteerCrawlerOptions<ContextExtension = Dictionary<never>, ExtendedContext extends PuppeteerCrawlingContext = PuppeteerCrawlingContext & ContextExtension, Routes extends Record<keyof Routes, Dictionary> = Record<string, GetUserDataFromRequest<PuppeteerCrawlingContext['request']>>> extends BrowserCrawlerOptions<Page, HTTPResponse, PuppeteerCrawlingContext, ContextExtension, ExtendedContext, {
18
16
  browserPlugins: [PuppeteerPlugin];
19
17
  }, Routes> {
@@ -37,7 +35,7 @@ export interface PuppeteerCrawlerOptions<ContextExtension = Dictionary<never>, E
37
35
  * ]
38
36
  * ```
39
37
  */
40
- preNavigationHooks?: BrowserHook<PuppeteerCrawlingContext, ContextExtension>[];
38
+ preNavigationHooks?: BrowserHook<PuppeteerCrawlingContext<GetUserDataFromRequest<ExtendedContext['request']>>, ContextExtension>[];
41
39
  /**
42
40
  * Async functions that are sequentially evaluated after the navigation. Good for checking if the navigation was successful.
43
41
  * The function accepts `crawlingContext` as the only parameter. A hook may optionally return a partial object
@@ -54,7 +52,7 @@ export interface PuppeteerCrawlerOptions<ContextExtension = Dictionary<never>, E
54
52
  * ]
55
53
  * ```
56
54
  */
57
- postNavigationHooks?: BrowserHook<PuppeteerCrawlingContext, ContextExtension>[];
55
+ postNavigationHooks?: BrowserHook<PuppeteerCrawlingContext<GetUserDataFromRequest<ExtendedContext['request']>>, ContextExtension>[];
58
56
  }
59
57
  /**
60
58
  * Provides a simple framework for parallel crawling of web pages
@@ -189,6 +187,8 @@ export declare class PuppeteerCrawler<ContextExtension = Dictionary<never>, Exte
189
187
  retryOnBlocked: import("ow").BooleanPredicate & import("ow").BasePredicate<boolean | undefined>;
190
188
  // @ts-ignore optional peer dependency or compatibility with es2022
191
189
  respectRobotsTxtFile: import("ow").AnyPredicate<boolean | object>;
190
+ // @ts-ignore optional peer dependency or compatibility with es2022
191
+ transactionalStorage: import("ow").BasePredicate<boolean | Partial<import("@crawlee/browser").StorageWritePolicy> | undefined>;
192
192
  // @ts-ignore optional peer dependency or compatibility with es2022
193
193
  onSkippedRequest: import("ow").Predicate<Function> & import("ow").BasePredicate<Function | undefined>;
194
194
  // @ts-ignore optional peer dependency or compatibility with es2022
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/puppeteer",
3
- "version": "4.0.0-beta.103",
3
+ "version": "4.0.0-beta.105",
4
4
  "description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -48,11 +48,11 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@apify/datastructures": "^2.0.3",
51
- "@crawlee/browser": "4.0.0-beta.103",
52
- "@crawlee/browser-pool": "4.0.0-beta.103",
53
- "@crawlee/core": "4.0.0-beta.103",
54
- "@crawlee/types": "4.0.0-beta.103",
55
- "@crawlee/utils": "4.0.0-beta.103",
51
+ "@crawlee/browser": "4.0.0-beta.105",
52
+ "@crawlee/browser-pool": "4.0.0-beta.105",
53
+ "@crawlee/core": "4.0.0-beta.105",
54
+ "@crawlee/types": "4.0.0-beta.105",
55
+ "@crawlee/utils": "4.0.0-beta.105",
56
56
  "cheerio": "^1.0.0",
57
57
  "devtools-protocol": "*",
58
58
  "idcac-playwright": "^0.2.0",
@@ -79,5 +79,5 @@
79
79
  }
80
80
  }
81
81
  },
82
- "gitHead": "fe5d0ae11067683e27a2d17b4edd226ccf112cf5"
82
+ "gitHead": "26073a822c7699ac487931383a39192bc3daae7a"
83
83
  }