@spider-cloud/spider-client 0.0.53 → 0.0.54

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 +55 -0
  2. package/package.json +1 -1
package/dist/config.d.ts CHANGED
@@ -28,6 +28,56 @@ export interface ChunkingAlg {
28
28
  type: ChunkingAlgType;
29
29
  value: number;
30
30
  }
31
+ /**
32
+ * Represents a timeout configuration.
33
+ * @typedef {Object} Timeout
34
+ * @property {number} secs - The number of seconds.
35
+ * @property {number} nanos - The number of nanoseconds.
36
+ */
37
+ interface Timeout {
38
+ secs: number;
39
+ nanos: number;
40
+ }
41
+ /**
42
+ * Represents the idle network configuration.
43
+ * @typedef {Object} IdleNetwork
44
+ * @property {Timeout} timeout - The timeout configuration.
45
+ */
46
+ interface IdleNetwork {
47
+ timeout: Timeout;
48
+ }
49
+ /**
50
+ * Represents the selector configuration.
51
+ * @typedef {Object} Selector
52
+ * @property {Timeout} timeout - The timeout configuration.
53
+ * @property {string} selector - The CSS selector to wait for.
54
+ */
55
+ interface Selector {
56
+ timeout: Timeout;
57
+ selector: string;
58
+ }
59
+ /**
60
+ * Represents the delay configuration.
61
+ * @typedef {Object} Delay
62
+ * @property {Timeout} timeout - The timeout configuration.
63
+ */
64
+ interface Delay {
65
+ timeout: Timeout;
66
+ }
67
+ /**
68
+ * Represents the wait_for configuration.
69
+ * @typedef {Object} WaitFor
70
+ * @property {IdleNetwork} [idle_network] - Configuration to wait for network to be idle.
71
+ * @property {Selector} [selector] - Configuration to wait for a CSS selector.
72
+ * @property {Delay} [delay] - Configuration to wait for a delay.
73
+ * @property {boolean} [page_navigations] - Whether to wait for page navigations.
74
+ */
75
+ interface WaitFor {
76
+ idle_network?: IdleNetwork;
77
+ selector?: Selector;
78
+ delay?: Delay;
79
+ page_navigations?: boolean;
80
+ }
31
81
  /**
32
82
  * Represents the options available for making a spider request.
33
83
  */
@@ -176,6 +226,10 @@ export interface SpiderParams {
176
226
  * The chunking algorithm to use.
177
227
  */
178
228
  chunking_alg?: ChunkingAlg;
229
+ /**
230
+ * The wait for events on the page. You need to make your `request` `chrome` or `smart`.
231
+ */
232
+ wait_for?: WaitFor;
179
233
  }
180
234
  export type SpiderCoreResponse = {
181
235
  content?: string;
@@ -185,3 +239,4 @@ export type SpiderCoreResponse = {
185
239
  url?: string;
186
240
  };
187
241
  export type ChunkCallbackFunction = (data: SpiderCoreResponse) => void;
242
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spider-cloud/spider-client",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "description": "Isomorphic Javascript SDK for Spider Cloud services",
5
5
  "scripts": {
6
6
  "test": "node --import tsx --test __tests__/*test.ts",