@spider-cloud/spider-client 0.1.81 → 0.1.84

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.
Files changed (2) hide show
  1. package/dist/config.d.ts +60 -1
  2. package/package.json +1 -1
package/dist/config.d.ts CHANGED
@@ -152,9 +152,41 @@ export type ClickAll = {
152
152
  };
153
153
  export type ClickAllClickable = {};
154
154
  export type ClickPoint = {
155
+ /** Rust: ClickPoint { x: f64, y: f64 } */
155
156
  x: number;
156
157
  y: number;
157
158
  };
159
+ /** Rust: ClickHold { selector: String, hold_for_ms: u64 } */
160
+ export type ClickHold = {
161
+ selector: string;
162
+ /** Duration to hold in milliseconds */
163
+ hold_for_ms: number;
164
+ };
165
+ /** Rust: ClickHoldPoint { x: f64, y: f64, hold_for_ms: u64 } */
166
+ export type ClickHoldPoint = {
167
+ x: number;
168
+ y: number;
169
+ /** Duration to hold in milliseconds */
170
+ hold_for_ms: number;
171
+ };
172
+ /** Rust: ClickDrag { from: String, to: String, modifier: Option<i64> } */
173
+ export type ClickDrag = {
174
+ /** CSS selector for the drag start element */
175
+ from: string;
176
+ /** CSS selector for the drag destination element */
177
+ to: string;
178
+ /** Optional keyboard modifier (e.g. Shift=8), maps to Option<i64> */
179
+ modifier?: number | null;
180
+ };
181
+ /** Rust: ClickDragPoint { from_x, from_y, to_x, to_y, modifier: Option<i64> } */
182
+ export type ClickDragPoint = {
183
+ from_x: number;
184
+ from_y: number;
185
+ to_x: number;
186
+ to_y: number;
187
+ /** Optional keyboard modifier (e.g. Shift=8), maps to Option<i64> */
188
+ modifier?: number | null;
189
+ };
158
190
  export type Wait = {
159
191
  /** Rust: u64 (milliseconds) */
160
192
  ms: number;
@@ -204,7 +236,7 @@ export type Screenshot = {
204
236
  output: string;
205
237
  };
206
238
  export type ValidateChain = {};
207
- export type WebAutomation = Evaluate | Click | ClickAll | ClickAllClickable | ClickPoint | Wait | WaitForNavigation | WaitForDom | WaitFor | WaitForWithTimeout | WaitForAndClick | ScrollX | ScrollY | Fill | Type | InfiniteScroll | Screenshot | ValidateChain;
239
+ export type WebAutomation = Evaluate | Click | ClickAll | ClickAllClickable | ClickPoint | ClickHold | ClickHoldPoint | ClickDrag | ClickDragPoint | Wait | WaitForNavigation | WaitForDom | WaitFor | WaitForWithTimeout | WaitForAndClick | ScrollX | ScrollY | Fill | Type | InfiniteScroll | Screenshot | ValidateChain;
208
240
  export type ReturnFormat = "markdown" | "commonmark" | "raw" | "screenshot" | "text" | "html2text" | "bytes" | "xml" | "empty";
209
241
  export type WebAutomationMap = Record<string, WebAutomation[]>;
210
242
  export type ExecutionScriptsMap = Record<string, string>;
@@ -226,6 +258,27 @@ export type EventTracker = {
226
258
  * - 'isp' → ISP-grade residential (alias: 'datacenter')
227
259
  */
228
260
  export type Proxy = "residential" | "mobile" | "isp";
261
+ export type LinkRewriteReplace = {
262
+ type: "replace";
263
+ /**
264
+ * Only apply when the link's host matches this value.
265
+ * Optional key; null means "no host filter".
266
+ */
267
+ host?: string | null;
268
+ find: string;
269
+ replace_with: string;
270
+ };
271
+ export type LinkRewriteRegex = {
272
+ type: "regex";
273
+ /**
274
+ * Only apply when the link's host matches this value.
275
+ * Optional key; null means "no host filter".
276
+ */
277
+ host?: string | null;
278
+ pattern: string;
279
+ replace_with: string;
280
+ };
281
+ export type LinkRewriteRule = LinkRewriteReplace | LinkRewriteRegex;
229
282
  /**
230
283
  * Represents the options available for making a spider request.
231
284
  */
@@ -318,6 +371,7 @@ export interface SpiderParams {
318
371
  * Use webhooks to send data.
319
372
  */
320
373
  webhooks?: WebhookSettings;
374
+ link_rewrite?: LinkRewriteRule;
321
375
  /**
322
376
  * Specifies whether to use fingerprinting protection.
323
377
  */
@@ -398,6 +452,11 @@ export interface SpiderParams {
398
452
  * The wait for events on the page. You need to make your `request` `chrome` or `smart`.
399
453
  */
400
454
  wait_for?: WaitForConfiguration;
455
+ /**
456
+ * Disables service-provided hints that add request optimizations to improve crawl outcomes,
457
+ * such as network blacklists, request-type selection, geo handling, and more.
458
+ */
459
+ disable_hints?: boolean;
401
460
  /**
402
461
  * Disable request interception when running 'request' as 'chrome' or 'smart'. This can help when the page uses 3rd party or external scripts to load content.
403
462
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spider-cloud/spider-client",
3
- "version": "0.1.81",
3
+ "version": "0.1.84",
4
4
  "description": "Isomorphic Javascript SDK for Spider Cloud services",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test __tests__/*test.ts",