@spider-cloud/spider-client 0.0.64 → 0.0.67

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 +38 -0
  2. package/package.json +3 -3
package/dist/config.d.ts CHANGED
@@ -102,6 +102,32 @@ type CSSSelector = {
102
102
  type CSSExtractionMap = {
103
103
  [path: string]: CSSSelector[];
104
104
  };
105
+ export type WebAutomation = {
106
+ Evaluate: string;
107
+ } | {
108
+ Click: string;
109
+ } | {
110
+ Wait: number;
111
+ } | {
112
+ WaitForNavigation: boolean;
113
+ } | {
114
+ WaitFor: string;
115
+ } | {
116
+ WaitForAndClick: string;
117
+ } | {
118
+ ScrollX: number;
119
+ } | {
120
+ ScrollY: number;
121
+ } | {
122
+ Fill: {
123
+ selector: string;
124
+ value?: string;
125
+ };
126
+ } | {
127
+ InfiniteScroll: number;
128
+ };
129
+ export type WebAutomationMap = Record<string, WebAutomation[]>;
130
+ export type ExecutionScriptsMap = Record<string, string>;
105
131
  /**
106
132
  * Represents the options available for making a spider request.
107
133
  */
@@ -246,6 +272,10 @@ export interface SpiderParams {
246
272
  * Specifies whether to run the request in the background.
247
273
  */
248
274
  run_in_background?: boolean;
275
+ /**
276
+ * Perform an infinite scroll on the page as new content arises. The request param also needs to be set to 'chrome' or 'smart'.
277
+ */
278
+ scroll?: number;
249
279
  /**
250
280
  * Specifies whether to skip configuration checks.
251
281
  */
@@ -262,6 +292,14 @@ export interface SpiderParams {
262
292
  * 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.
263
293
  */
264
294
  disable_intercept?: boolean;
295
+ /**
296
+ * Perform custom web automated tasks on a url or url path. You need to make your `request` `chrome` or `smart`.
297
+ */
298
+ automation_scripts?: WebAutomationMap;
299
+ /**
300
+ * Perform custom Javascript tasks on a url or url path. You need to make your `request` `chrome` or `smart`.
301
+ */
302
+ execution_scripts?: ExecutionScriptsMap;
265
303
  }
266
304
  export type SpiderCoreResponse = {
267
305
  content?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spider-cloud/spider-client",
3
- "version": "0.0.64",
3
+ "version": "0.0.67",
4
4
  "description": "Isomorphic Javascript SDK for Spider Cloud services",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test __tests__/*test.ts",
@@ -23,10 +23,10 @@
23
23
  "author": "Jeff Mendez<jeff@a11ywatch.com>",
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@supabase/supabase-js": "^2.44.3",
26
+ "@supabase/supabase-js": "^2.45.0",
27
27
  "@types/node": "20.14.2",
28
28
  "dotenv": "^16.4.5",
29
- "tsx": "^4.16.2",
29
+ "tsx": "^4.16.5",
30
30
  "typescript": "5.4.5"
31
31
  }
32
32
  }