@crawlee/types 4.0.0-beta.207 → 4.0.0-beta.209

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/browser.d.ts CHANGED
@@ -120,14 +120,14 @@ export interface IBrowserPool<Page = unknown> {
120
120
  /**
121
121
  * Signals the pool that the caller is done with the page. The pool is
122
122
  * responsible for closing the page and performing any necessary cleanup
123
- * (e.g. retiring the underlying browser when a session has gone bad).
123
+ * (e.g. retiring the underlying browser once the page's session is finished).
124
124
  *
125
125
  * @param page The page to release back to the pool.
126
- * @param options.error If the page is being released because of an error,
127
- * pass the error here. In particular, if the error is a
128
- * {@link SessionError}, implementations should treat it as a signal
129
- * to purge all state associated with the session (e.g. discard any
130
- * browser that served the page).
126
+ * @param options.error If the error is a {@link SessionError}, the
127
+ * session that served the page is finished. A plain `SessionError`
128
+ * means it was blocked: discard any browser state tied to it. A
129
+ * {@link SessionRetiredError} means it merely reached its usage or
130
+ * age limit, so a pool may keep a warm page instead.
131
131
  */
132
132
  closePage(page: Page, options?: {
133
133
  error?: Error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/types",
3
- "version": "4.0.0-beta.207",
3
+ "version": "4.0.0-beta.209",
4
4
  "description": "Shared types for the crawlee projects",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -52,5 +52,5 @@
52
52
  }
53
53
  }
54
54
  },
55
- "gitHead": "8d4e54dfe0343e33f40a90d12abfb1840340c520"
55
+ "gitHead": "ccf82c59e230033a34bddcbecb1f4a8e803eaa11"
56
56
  }
package/session.d.ts CHANGED
@@ -108,6 +108,11 @@ export interface ISession {
108
108
  * Session is usable when it is not expired, not blocked and the maximum usage count has not been reached.
109
109
  */
110
110
  isUsable(): boolean;
111
+ /**
112
+ * Indicates whether the session is blocked, i.e. its error score reached the maximum or it was retired via `retire()`.
113
+ * Unlike other reasons for not being usable, this means the identity itself is burned.
114
+ */
115
+ isBlocked(): boolean;
111
116
  /**
112
117
  * This method should be called after a successful session usage.
113
118
  */