@nimble-way/nimble-js 0.13.0 → 0.16.0
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/CHANGELOG.md +52 -0
- package/api-promise.d.mts +1 -0
- package/api-promise.d.mts.map +1 -1
- package/api-promise.d.ts +1 -0
- package/api-promise.d.ts.map +1 -1
- package/api-promise.mjs +1 -0
- package/api-promise.mjs.map +1 -1
- package/client.d.mts +17 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +17 -2
- package/client.d.ts.map +1 -1
- package/client.js +24 -1
- package/client.js.map +1 -1
- package/client.mjs +24 -1
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/uploads.d.mts.map +1 -1
- package/core/uploads.d.ts.map +1 -1
- package/core/uploads.mjs.map +1 -1
- package/error.d.mts +1 -0
- package/error.d.mts.map +1 -1
- package/error.d.ts +1 -0
- package/error.d.ts.map +1 -1
- package/error.mjs +1 -0
- package/error.mjs.map +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.mjs.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.d.mts +6 -0
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +6 -0
- package/internal/shims.d.ts.map +1 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.mjs.map +1 -1
- package/internal/tslib.js +22 -22
- package/internal/types.d.mts +4 -4
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +4 -4
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/resource.d.mts +1 -0
- package/resource.d.mts.map +1 -1
- package/resource.d.ts +1 -0
- package/resource.d.ts.map +1 -1
- package/resource.mjs +1 -0
- package/resource.mjs.map +1 -1
- package/resources/agent.d.mts +33 -26
- package/resources/agent.d.mts.map +1 -1
- package/resources/agent.d.ts +33 -26
- package/resources/agent.d.ts.map +1 -1
- package/resources/agent.js +0 -8
- package/resources/agent.js.map +1 -1
- package/resources/agent.mjs +0 -8
- package/resources/agent.mjs.map +1 -1
- package/resources/batches.d.mts +1 -1
- package/resources/batches.d.mts.map +1 -1
- package/resources/batches.d.ts +1 -1
- package/resources/batches.d.ts.map +1 -1
- package/resources/batches.mjs.map +1 -1
- package/resources/crawl.d.mts +5 -1
- package/resources/crawl.d.mts.map +1 -1
- package/resources/crawl.d.ts +5 -1
- package/resources/crawl.d.ts.map +1 -1
- package/resources/crawl.mjs.map +1 -1
- package/resources/domain-knowledge.d.mts +50 -0
- package/resources/domain-knowledge.d.mts.map +1 -0
- package/resources/domain-knowledge.d.ts +50 -0
- package/resources/domain-knowledge.d.ts.map +1 -0
- package/resources/domain-knowledge.js +16 -0
- package/resources/domain-knowledge.js.map +1 -0
- package/resources/domain-knowledge.mjs +12 -0
- package/resources/domain-knowledge.mjs.map +1 -0
- package/resources/index.d.mts +6 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +6 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +11 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -0
- package/resources/index.mjs.map +1 -1
- package/resources/jobs/index.d.mts +3 -0
- package/resources/jobs/index.d.mts.map +1 -0
- package/resources/jobs/index.d.ts +3 -0
- package/resources/jobs/index.d.ts.map +1 -0
- package/resources/jobs/index.js +9 -0
- package/resources/jobs/index.js.map +1 -0
- package/resources/jobs/index.mjs +4 -0
- package/resources/jobs/index.mjs.map +1 -0
- package/resources/jobs/jobs.d.mts +248 -0
- package/resources/jobs/jobs.d.mts.map +1 -0
- package/resources/jobs/jobs.d.ts +248 -0
- package/resources/jobs/jobs.d.ts.map +1 -0
- package/resources/jobs/jobs.js +58 -0
- package/resources/jobs/jobs.js.map +1 -0
- package/resources/jobs/jobs.mjs +53 -0
- package/resources/jobs/jobs.mjs.map +1 -0
- package/resources/jobs/runs/artifacts.d.mts +62 -0
- package/resources/jobs/runs/artifacts.d.mts.map +1 -0
- package/resources/jobs/runs/artifacts.d.ts +62 -0
- package/resources/jobs/runs/artifacts.d.ts.map +1 -0
- package/resources/jobs/runs/artifacts.js +37 -0
- package/resources/jobs/runs/artifacts.js.map +1 -0
- package/resources/jobs/runs/artifacts.mjs +33 -0
- package/resources/jobs/runs/artifacts.mjs.map +1 -0
- package/resources/jobs/runs/index.d.mts +3 -0
- package/resources/jobs/runs/index.d.mts.map +1 -0
- package/resources/jobs/runs/index.d.ts +3 -0
- package/resources/jobs/runs/index.d.ts.map +1 -0
- package/resources/jobs/runs/index.js +9 -0
- package/resources/jobs/runs/index.js.map +1 -0
- package/resources/jobs/runs/index.mjs +4 -0
- package/resources/jobs/runs/index.mjs.map +1 -0
- package/resources/jobs/runs/runs.d.mts +95 -0
- package/resources/jobs/runs/runs.d.mts.map +1 -0
- package/resources/jobs/runs/runs.d.ts +95 -0
- package/resources/jobs/runs/runs.d.ts.map +1 -0
- package/resources/jobs/runs/runs.js +36 -0
- package/resources/jobs/runs/runs.js.map +1 -0
- package/resources/jobs/runs/runs.mjs +31 -0
- package/resources/jobs/runs/runs.mjs.map +1 -0
- package/resources/jobs/runs.d.mts +2 -0
- package/resources/jobs/runs.d.mts.map +1 -0
- package/resources/jobs/runs.d.ts +2 -0
- package/resources/jobs/runs.d.ts.map +1 -0
- package/resources/jobs/runs.js +6 -0
- package/resources/jobs/runs.js.map +1 -0
- package/resources/jobs/runs.mjs +3 -0
- package/resources/jobs/runs.mjs.map +1 -0
- package/resources/jobs.d.mts +2 -0
- package/resources/jobs.d.mts.map +1 -0
- package/resources/jobs.d.ts +2 -0
- package/resources/jobs.d.ts.map +1 -0
- package/resources/jobs.js +6 -0
- package/resources/jobs.js.map +1 -0
- package/resources/jobs.mjs +3 -0
- package/resources/jobs.mjs.map +1 -0
- package/resources/media.d.mts +390 -0
- package/resources/media.d.mts.map +1 -0
- package/resources/media.d.ts +390 -0
- package/resources/media.d.ts.map +1 -0
- package/resources/media.js +35 -0
- package/resources/media.js.map +1 -0
- package/resources/media.mjs +31 -0
- package/resources/media.mjs.map +1 -0
- package/resources/serp.d.mts +714 -0
- package/resources/serp.d.mts.map +1 -0
- package/resources/serp.d.ts +714 -0
- package/resources/serp.d.ts.map +1 -0
- package/resources/serp.js +48 -0
- package/resources/serp.js.map +1 -0
- package/resources/serp.mjs +44 -0
- package/resources/serp.mjs.map +1 -0
- package/resources/task-agent/index.d.mts +4 -0
- package/resources/task-agent/index.d.mts.map +1 -0
- package/resources/task-agent/index.d.ts +4 -0
- package/resources/task-agent/index.d.ts.map +1 -0
- package/resources/task-agent/index.js +11 -0
- package/resources/task-agent/index.js.map +1 -0
- package/resources/task-agent/index.mjs +5 -0
- package/resources/task-agent/index.mjs.map +1 -0
- package/resources/task-agent/runs.d.mts +277 -0
- package/resources/task-agent/runs.d.mts.map +1 -0
- package/resources/task-agent/runs.d.ts +277 -0
- package/resources/task-agent/runs.d.ts.map +1 -0
- package/resources/task-agent/runs.js +50 -0
- package/resources/task-agent/runs.js.map +1 -0
- package/resources/task-agent/runs.mjs +46 -0
- package/resources/task-agent/runs.mjs.map +1 -0
- package/resources/task-agent/task-agent.d.mts +383 -0
- package/resources/task-agent/task-agent.d.mts.map +1 -0
- package/resources/task-agent/task-agent.d.ts +383 -0
- package/resources/task-agent/task-agent.d.ts.map +1 -0
- package/resources/task-agent/task-agent.js +70 -0
- package/resources/task-agent/task-agent.js.map +1 -0
- package/resources/task-agent/task-agent.mjs +65 -0
- package/resources/task-agent/task-agent.mjs.map +1 -0
- package/resources/task-agent/templates.d.mts +98 -0
- package/resources/task-agent/templates.d.mts.map +1 -0
- package/resources/task-agent/templates.d.ts +98 -0
- package/resources/task-agent/templates.d.ts.map +1 -0
- package/resources/task-agent/templates.js +22 -0
- package/resources/task-agent/templates.js.map +1 -0
- package/resources/task-agent/templates.mjs +18 -0
- package/resources/task-agent/templates.mjs.map +1 -0
- package/resources/task-agent.d.mts +2 -0
- package/resources/task-agent.d.mts.map +1 -0
- package/resources/task-agent.d.ts +2 -0
- package/resources/task-agent.d.ts.map +1 -0
- package/resources/task-agent.js +6 -0
- package/resources/task-agent.js.map +1 -0
- package/resources/task-agent.mjs +3 -0
- package/resources/task-agent.mjs.map +1 -0
- package/resources/tasks.d.mts +2 -2
- package/resources/tasks.d.mts.map +1 -1
- package/resources/tasks.d.ts +2 -2
- package/resources/tasks.d.ts.map +1 -1
- package/resources/tasks.mjs.map +1 -1
- package/resources/top-level.d.mts +32 -8
- package/resources/top-level.d.mts.map +1 -1
- package/resources/top-level.d.ts +32 -8
- package/resources/top-level.d.ts.map +1 -1
- package/resources.d.mts.map +1 -1
- package/resources.d.ts.map +1 -1
- package/resources.mjs.map +1 -1
- package/src/client.ts +112 -5
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/agent.ts +21 -38
- package/src/resources/batches.ts +1 -1
- package/src/resources/crawl.ts +6 -1
- package/src/resources/domain-knowledge.ts +69 -0
- package/src/resources/index.ts +44 -2
- package/src/resources/jobs/index.ts +20 -0
- package/src/resources/jobs/jobs.ts +413 -0
- package/src/resources/jobs/runs/artifacts.ts +115 -0
- package/src/resources/jobs/runs/index.ts +19 -0
- package/src/resources/jobs/runs/runs.ts +177 -0
- package/src/resources/jobs/runs.ts +3 -0
- package/src/resources/jobs.ts +3 -0
- package/src/resources/media.ts +570 -0
- package/src/resources/serp.ts +1001 -0
- package/src/resources/task-agent/index.ts +32 -0
- package/src/resources/task-agent/runs.ts +416 -0
- package/src/resources/task-agent/task-agent.ts +652 -0
- package/src/resources/task-agent/templates.ts +163 -0
- package/src/resources/task-agent.ts +3 -0
- package/src/resources/tasks.ts +2 -2
- package/src/resources/top-level.ts +35 -8
- package/src/version.ts +1 -1
- package/uploads.d.mts +1 -0
- package/uploads.d.mts.map +1 -1
- package/uploads.d.ts +1 -0
- package/uploads.d.ts.map +1 -1
- package/uploads.mjs +1 -0
- package/uploads.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class Serp extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* SERP
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const response = await client.serp.run({
|
|
11
|
+
* search_engine: 'google_search',
|
|
12
|
+
* });
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
run(body: SerpRunParams, options?: RequestOptions): APIPromise<SerpRunResponse>;
|
|
16
|
+
/**
|
|
17
|
+
* SERP Async Endpoint
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const response = await client.serp.runAsync({
|
|
22
|
+
* search_engine: 'google_search',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
runAsync(body: SerpRunAsyncParams, options?: RequestOptions): APIPromise<SerpRunAsyncResponse>;
|
|
27
|
+
/**
|
|
28
|
+
* SERP Batch Endpoint
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const response = await client.serp.runBatch({
|
|
33
|
+
* inputs: [{}],
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
runBatch(body: SerpRunBatchParams, options?: RequestOptions): APIPromise<SerpRunBatchResponse>;
|
|
38
|
+
}
|
|
39
|
+
export interface SerpRunResponse {
|
|
40
|
+
data: SerpRunResponse.Data;
|
|
41
|
+
metadata: SerpRunResponse.Metadata;
|
|
42
|
+
/**
|
|
43
|
+
* The status of the task.
|
|
44
|
+
*/
|
|
45
|
+
status: 'success' | 'skipped' | 'fatal' | 'error' | 'postponed' | 'ignored' | 'rejected' | 'blocked';
|
|
46
|
+
/**
|
|
47
|
+
* Unique identifier for the task.
|
|
48
|
+
*/
|
|
49
|
+
task_id: string;
|
|
50
|
+
/**
|
|
51
|
+
* The final URL.
|
|
52
|
+
*/
|
|
53
|
+
url: string;
|
|
54
|
+
debug?: SerpRunResponse.Debug;
|
|
55
|
+
/**
|
|
56
|
+
* Pagination information if applicable.
|
|
57
|
+
*/
|
|
58
|
+
pagination?: SerpRunResponse.NextPageParams | Array<SerpRunResponse.UnionMember1>;
|
|
59
|
+
/**
|
|
60
|
+
* The HTTP status code of the task.
|
|
61
|
+
*/
|
|
62
|
+
status_code?: number;
|
|
63
|
+
/**
|
|
64
|
+
* List of warnings generated during the task.
|
|
65
|
+
*/
|
|
66
|
+
warnings?: Array<string>;
|
|
67
|
+
}
|
|
68
|
+
export declare namespace SerpRunResponse {
|
|
69
|
+
interface Data {
|
|
70
|
+
/**
|
|
71
|
+
* Browser actions execution results. Present only when browser_actions were
|
|
72
|
+
* specified in the request.
|
|
73
|
+
*/
|
|
74
|
+
browser_actions?: Data.BrowserActions;
|
|
75
|
+
/**
|
|
76
|
+
* The cookies collected from browser actions during the task.
|
|
77
|
+
*/
|
|
78
|
+
cookies?: Array<unknown>;
|
|
79
|
+
/**
|
|
80
|
+
* The evaluation results from browser actions during the task.
|
|
81
|
+
*/
|
|
82
|
+
eval?: Array<unknown>;
|
|
83
|
+
/**
|
|
84
|
+
* The http requests from browser actions made during the task.
|
|
85
|
+
*/
|
|
86
|
+
fetch?: Array<unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* The headers received during the task.
|
|
89
|
+
*/
|
|
90
|
+
headers?: {
|
|
91
|
+
[key: string]: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* The HTML content of the page.
|
|
95
|
+
*/
|
|
96
|
+
html?: string;
|
|
97
|
+
/**
|
|
98
|
+
* List of all unique URLs found on the page.
|
|
99
|
+
*/
|
|
100
|
+
links?: Array<string>;
|
|
101
|
+
/**
|
|
102
|
+
* The Markdown version of the HTML content.
|
|
103
|
+
*/
|
|
104
|
+
markdown?: string;
|
|
105
|
+
/**
|
|
106
|
+
* The network capture data collected during the task.
|
|
107
|
+
*/
|
|
108
|
+
network_capture?: Array<Data.NetworkCapture>;
|
|
109
|
+
/**
|
|
110
|
+
* Individual HTML content of each pagination page, before merging.
|
|
111
|
+
*/
|
|
112
|
+
pages_html?: Array<string>;
|
|
113
|
+
/**
|
|
114
|
+
* The parsing results extracted from the HTML & network content.
|
|
115
|
+
*/
|
|
116
|
+
parsing?: Data.ParsingSuccessResult | Data.ParsingErrorResult | {
|
|
117
|
+
[key: string]: unknown;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* The list of redirects that occurred during the task.
|
|
121
|
+
*/
|
|
122
|
+
redirects?: Array<Data.Redirect>;
|
|
123
|
+
/**
|
|
124
|
+
* Screenshots taken during the task, from browser actions, or the screenshot
|
|
125
|
+
* format.
|
|
126
|
+
*/
|
|
127
|
+
screenshots?: Array<unknown>;
|
|
128
|
+
}
|
|
129
|
+
namespace Data {
|
|
130
|
+
/**
|
|
131
|
+
* Browser actions execution results. Present only when browser_actions were
|
|
132
|
+
* specified in the request.
|
|
133
|
+
*/
|
|
134
|
+
interface BrowserActions {
|
|
135
|
+
results: Array<BrowserActions.Result>;
|
|
136
|
+
success: boolean;
|
|
137
|
+
total_duration: number;
|
|
138
|
+
}
|
|
139
|
+
namespace BrowserActions {
|
|
140
|
+
interface Result {
|
|
141
|
+
duration: number;
|
|
142
|
+
name: 'goto' | 'wait' | 'wait_for_element' | 'wait_for_navigation' | 'click' | 'fill' | 'press' | 'scroll' | 'auto_scroll' | 'screenshot' | 'get_cookies' | 'eval' | 'fetch';
|
|
143
|
+
status: 'no-run' | 'in-progress' | 'done' | 'error' | 'skipped';
|
|
144
|
+
error?: string;
|
|
145
|
+
result?: unknown;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
interface NetworkCapture {
|
|
149
|
+
filter: NetworkCapture.Filter;
|
|
150
|
+
results: Array<NetworkCapture.Result>;
|
|
151
|
+
errorMessage?: string;
|
|
152
|
+
}
|
|
153
|
+
namespace NetworkCapture {
|
|
154
|
+
interface Filter {
|
|
155
|
+
validation: boolean;
|
|
156
|
+
wait_for_requests_count: number;
|
|
157
|
+
method?: 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
|
|
158
|
+
/**
|
|
159
|
+
* Resource type for network capture filtering
|
|
160
|
+
*/
|
|
161
|
+
resource_type?: 'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'prefetch' | 'eventsource' | 'websocket' | 'manifest' | 'signedexchange' | 'ping' | 'cspviolationreport' | 'preflight' | 'other' | 'fedcm' | Array<'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'prefetch' | 'eventsource' | 'websocket' | 'manifest' | 'signedexchange' | 'ping' | 'cspviolationreport' | 'preflight' | 'other' | 'fedcm'>;
|
|
162
|
+
status_code?: number | Array<number>;
|
|
163
|
+
url?: Filter.URL;
|
|
164
|
+
wait_for_requests_count_timeout?: number;
|
|
165
|
+
}
|
|
166
|
+
namespace Filter {
|
|
167
|
+
interface URL {
|
|
168
|
+
type: 'exact' | 'contains';
|
|
169
|
+
value: string;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
interface Result {
|
|
173
|
+
request: Result.Request;
|
|
174
|
+
response: Result.Response;
|
|
175
|
+
}
|
|
176
|
+
namespace Result {
|
|
177
|
+
interface Request {
|
|
178
|
+
headers: {
|
|
179
|
+
[key: string]: string;
|
|
180
|
+
};
|
|
181
|
+
method: string;
|
|
182
|
+
/**
|
|
183
|
+
* Resource type for network capture filtering
|
|
184
|
+
*/
|
|
185
|
+
resource_type: 'document' | 'stylesheet' | 'image' | 'media' | 'font' | 'script' | 'texttrack' | 'xhr' | 'fetch' | 'prefetch' | 'eventsource' | 'websocket' | 'manifest' | 'signedexchange' | 'ping' | 'cspviolationreport' | 'preflight' | 'other' | 'fedcm';
|
|
186
|
+
url: string;
|
|
187
|
+
body?: string;
|
|
188
|
+
}
|
|
189
|
+
interface Response {
|
|
190
|
+
body: string;
|
|
191
|
+
headers: {
|
|
192
|
+
[key: string]: string;
|
|
193
|
+
};
|
|
194
|
+
serialization: 'none' | 'base64';
|
|
195
|
+
status: number;
|
|
196
|
+
status_text: string;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
interface ParsingSuccessResult {
|
|
201
|
+
entities: {
|
|
202
|
+
[key: string]: unknown;
|
|
203
|
+
};
|
|
204
|
+
status: 'success';
|
|
205
|
+
}
|
|
206
|
+
interface ParsingErrorResult {
|
|
207
|
+
error: string;
|
|
208
|
+
status: 'error';
|
|
209
|
+
}
|
|
210
|
+
interface Redirect {
|
|
211
|
+
status_code: number;
|
|
212
|
+
url: string;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
interface Metadata {
|
|
216
|
+
/**
|
|
217
|
+
* The name of the agent used for the query.
|
|
218
|
+
*/
|
|
219
|
+
agent?: string;
|
|
220
|
+
/**
|
|
221
|
+
* The driver used for the task.
|
|
222
|
+
*/
|
|
223
|
+
driver?: string;
|
|
224
|
+
/**
|
|
225
|
+
* The localization identifier for the query.
|
|
226
|
+
*/
|
|
227
|
+
localization_id?: string;
|
|
228
|
+
/**
|
|
229
|
+
* The duration in milliseconds of the query processing.
|
|
230
|
+
*/
|
|
231
|
+
query_duration?: number;
|
|
232
|
+
/**
|
|
233
|
+
* The time when the query was received.
|
|
234
|
+
*/
|
|
235
|
+
query_time?: string;
|
|
236
|
+
/**
|
|
237
|
+
* Additional response parameters.
|
|
238
|
+
*/
|
|
239
|
+
response_parameters?: unknown;
|
|
240
|
+
/**
|
|
241
|
+
* A tag associated with the query.
|
|
242
|
+
*/
|
|
243
|
+
tag?: string;
|
|
244
|
+
}
|
|
245
|
+
interface Debug {
|
|
246
|
+
/**
|
|
247
|
+
* Performance metrics collected during the task.
|
|
248
|
+
*/
|
|
249
|
+
performance_metrics?: {
|
|
250
|
+
[key: string]: number;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Total bytes used by the proxy during the task.
|
|
254
|
+
*/
|
|
255
|
+
proxy_total_bytes_usage?: number;
|
|
256
|
+
/**
|
|
257
|
+
* The transformed output after applying any transformations.
|
|
258
|
+
*/
|
|
259
|
+
transformed_output?: unknown;
|
|
260
|
+
/**
|
|
261
|
+
* The userbrowser instance using during the task.
|
|
262
|
+
*/
|
|
263
|
+
userbrowser?: unknown;
|
|
264
|
+
}
|
|
265
|
+
interface NextPageParams {
|
|
266
|
+
next_page_params: {
|
|
267
|
+
[key: string]: unknown;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
interface UnionMember1 {
|
|
271
|
+
next_page_params: {
|
|
272
|
+
[key: string]: unknown;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Response when an async SERP task is created successfully.
|
|
278
|
+
*/
|
|
279
|
+
export interface SerpRunAsyncResponse {
|
|
280
|
+
/**
|
|
281
|
+
* Status indicating the async SERP task was created successfully.
|
|
282
|
+
*/
|
|
283
|
+
status: 'success';
|
|
284
|
+
/**
|
|
285
|
+
* The created async task details.
|
|
286
|
+
*/
|
|
287
|
+
task: SerpRunAsyncResponse.Task;
|
|
288
|
+
}
|
|
289
|
+
export declare namespace SerpRunAsyncResponse {
|
|
290
|
+
/**
|
|
291
|
+
* The created async task details.
|
|
292
|
+
*/
|
|
293
|
+
interface Task {
|
|
294
|
+
/**
|
|
295
|
+
* Unique task identifier.
|
|
296
|
+
*/
|
|
297
|
+
id: string;
|
|
298
|
+
_query: unknown;
|
|
299
|
+
/**
|
|
300
|
+
* Timestamp when the task was created.
|
|
301
|
+
*/
|
|
302
|
+
created_at: string;
|
|
303
|
+
/**
|
|
304
|
+
* Original input data for the task.
|
|
305
|
+
*/
|
|
306
|
+
input: unknown;
|
|
307
|
+
/**
|
|
308
|
+
* Current state of the task.
|
|
309
|
+
*/
|
|
310
|
+
state: 'pending' | 'success' | 'error';
|
|
311
|
+
/**
|
|
312
|
+
* URL for checking the task status.
|
|
313
|
+
*/
|
|
314
|
+
status_url: string;
|
|
315
|
+
/**
|
|
316
|
+
* Account name that owns the task.
|
|
317
|
+
*/
|
|
318
|
+
account_name?: string;
|
|
319
|
+
api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp';
|
|
320
|
+
/**
|
|
321
|
+
* Batch ID if this task is part of a batch.
|
|
322
|
+
*/
|
|
323
|
+
batch_id?: string;
|
|
324
|
+
/**
|
|
325
|
+
* URL for downloading the task results.
|
|
326
|
+
*/
|
|
327
|
+
download_url?: string;
|
|
328
|
+
/**
|
|
329
|
+
* Error message if the task failed.
|
|
330
|
+
*/
|
|
331
|
+
error?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Classification of the error type.
|
|
334
|
+
*/
|
|
335
|
+
error_type?: string;
|
|
336
|
+
/**
|
|
337
|
+
* Timestamp when the task was last modified.
|
|
338
|
+
*/
|
|
339
|
+
modified_at?: string;
|
|
340
|
+
/**
|
|
341
|
+
* Storage location of the output data.
|
|
342
|
+
*/
|
|
343
|
+
output_url?: string;
|
|
344
|
+
/**
|
|
345
|
+
* HTTP status code from the task execution.
|
|
346
|
+
*/
|
|
347
|
+
status_code?: number;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Response when a batch of SERP tasks is created successfully.
|
|
352
|
+
*/
|
|
353
|
+
export interface SerpRunBatchResponse {
|
|
354
|
+
/**
|
|
355
|
+
* Unique identifier for the batch.
|
|
356
|
+
*/
|
|
357
|
+
batch_id: string;
|
|
358
|
+
/**
|
|
359
|
+
* Number of tasks in the batch.
|
|
360
|
+
*/
|
|
361
|
+
batch_size: number;
|
|
362
|
+
/**
|
|
363
|
+
* List of created tasks.
|
|
364
|
+
*/
|
|
365
|
+
tasks: Array<SerpRunBatchResponse.Task>;
|
|
366
|
+
}
|
|
367
|
+
export declare namespace SerpRunBatchResponse {
|
|
368
|
+
interface Task {
|
|
369
|
+
/**
|
|
370
|
+
* Unique task identifier.
|
|
371
|
+
*/
|
|
372
|
+
id: string;
|
|
373
|
+
_query: unknown;
|
|
374
|
+
/**
|
|
375
|
+
* Timestamp when the task was created.
|
|
376
|
+
*/
|
|
377
|
+
created_at: string;
|
|
378
|
+
/**
|
|
379
|
+
* Original input data for the task.
|
|
380
|
+
*/
|
|
381
|
+
input: unknown;
|
|
382
|
+
/**
|
|
383
|
+
* Current state of the task.
|
|
384
|
+
*/
|
|
385
|
+
state: 'pending' | 'success' | 'error';
|
|
386
|
+
/**
|
|
387
|
+
* URL for checking the task status.
|
|
388
|
+
*/
|
|
389
|
+
status_url: string;
|
|
390
|
+
/**
|
|
391
|
+
* Account name that owns the task.
|
|
392
|
+
*/
|
|
393
|
+
account_name?: string;
|
|
394
|
+
api_type?: 'web' | 'serp' | 'ecommerce' | 'social' | 'media' | 'agent' | 'extract' | 'fast-serp';
|
|
395
|
+
/**
|
|
396
|
+
* Batch ID if this task is part of a batch.
|
|
397
|
+
*/
|
|
398
|
+
batch_id?: string;
|
|
399
|
+
/**
|
|
400
|
+
* URL for downloading the task results.
|
|
401
|
+
*/
|
|
402
|
+
download_url?: string;
|
|
403
|
+
/**
|
|
404
|
+
* Error message if the task failed.
|
|
405
|
+
*/
|
|
406
|
+
error?: string;
|
|
407
|
+
/**
|
|
408
|
+
* Classification of the error type.
|
|
409
|
+
*/
|
|
410
|
+
error_type?: string;
|
|
411
|
+
/**
|
|
412
|
+
* Timestamp when the task was last modified.
|
|
413
|
+
*/
|
|
414
|
+
modified_at?: string;
|
|
415
|
+
/**
|
|
416
|
+
* Storage location of the output data.
|
|
417
|
+
*/
|
|
418
|
+
output_url?: string;
|
|
419
|
+
/**
|
|
420
|
+
* HTTP status code from the task execution.
|
|
421
|
+
*/
|
|
422
|
+
status_code?: number;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
export interface SerpRunParams {
|
|
426
|
+
/**
|
|
427
|
+
* The search engine to query.
|
|
428
|
+
*/
|
|
429
|
+
search_engine: 'google_search' | 'google_sge' | 'google_aio' | 'google_maps_search' | 'google_maps_reviews' | 'google_maps_place' | 'google_news' | 'google_images' | 'bing_search' | 'yandex_search';
|
|
430
|
+
/**
|
|
431
|
+
* ISO Alpha-2 country code used to access the target search engine (e.g. US, DE,
|
|
432
|
+
* GB).
|
|
433
|
+
*/
|
|
434
|
+
country?: string;
|
|
435
|
+
/**
|
|
436
|
+
* Device type used for the search request.
|
|
437
|
+
*/
|
|
438
|
+
device?: 'desktop' | 'mobile';
|
|
439
|
+
/**
|
|
440
|
+
* Top-level domain for the search engine (e.g. "com", "co.uk", "de").
|
|
441
|
+
*/
|
|
442
|
+
domain?: string;
|
|
443
|
+
/**
|
|
444
|
+
* Locale used for the search request.
|
|
445
|
+
*/
|
|
446
|
+
locale?: string;
|
|
447
|
+
/**
|
|
448
|
+
* Geo-location for the search (canonical Google location name).
|
|
449
|
+
*/
|
|
450
|
+
location?: string;
|
|
451
|
+
/**
|
|
452
|
+
* Number of results to return (1–100).
|
|
453
|
+
*/
|
|
454
|
+
num_results?: number;
|
|
455
|
+
/**
|
|
456
|
+
* The result page number for pagination.
|
|
457
|
+
*/
|
|
458
|
+
page?: number;
|
|
459
|
+
/**
|
|
460
|
+
* When true, the SERP response is parsed into structured JSON.
|
|
461
|
+
*/
|
|
462
|
+
parse?: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* The search keyword or phrase to query.
|
|
465
|
+
*/
|
|
466
|
+
query?: string;
|
|
467
|
+
/**
|
|
468
|
+
* Whether to render the page in a browser before extracting.
|
|
469
|
+
*/
|
|
470
|
+
render?: boolean;
|
|
471
|
+
/**
|
|
472
|
+
* When true, disables Google result filtering (filter=0) so omitted/duplicate and
|
|
473
|
+
* highly similar pages are also returned. Applies to Google search engines.
|
|
474
|
+
*/
|
|
475
|
+
show_hidden_results?: boolean;
|
|
476
|
+
}
|
|
477
|
+
export interface SerpRunAsyncParams {
|
|
478
|
+
/**
|
|
479
|
+
* The search engine to query.
|
|
480
|
+
*/
|
|
481
|
+
search_engine: 'google_search' | 'google_sge' | 'google_aio' | 'google_maps_search' | 'google_maps_reviews' | 'google_maps_place' | 'google_news' | 'google_images' | 'bing_search' | 'yandex_search';
|
|
482
|
+
/**
|
|
483
|
+
* URL to call back when async operation completes
|
|
484
|
+
*/
|
|
485
|
+
callback_url?: string;
|
|
486
|
+
/**
|
|
487
|
+
* ISO Alpha-2 country code used to access the target search engine (e.g. US, DE,
|
|
488
|
+
* GB).
|
|
489
|
+
*/
|
|
490
|
+
country?: string;
|
|
491
|
+
/**
|
|
492
|
+
* Device type used for the search request.
|
|
493
|
+
*/
|
|
494
|
+
device?: 'desktop' | 'mobile';
|
|
495
|
+
/**
|
|
496
|
+
* Top-level domain for the search engine (e.g. "com", "co.uk", "de").
|
|
497
|
+
*/
|
|
498
|
+
domain?: string;
|
|
499
|
+
/**
|
|
500
|
+
* Locale used for the search request.
|
|
501
|
+
*/
|
|
502
|
+
locale?: string;
|
|
503
|
+
/**
|
|
504
|
+
* Geo-location for the search (canonical Google location name).
|
|
505
|
+
*/
|
|
506
|
+
location?: string;
|
|
507
|
+
/**
|
|
508
|
+
* Number of results to return (1–100).
|
|
509
|
+
*/
|
|
510
|
+
num_results?: number;
|
|
511
|
+
/**
|
|
512
|
+
* The result page number for pagination.
|
|
513
|
+
*/
|
|
514
|
+
page?: number;
|
|
515
|
+
/**
|
|
516
|
+
* When true, the SERP response is parsed into structured JSON.
|
|
517
|
+
*/
|
|
518
|
+
parse?: boolean;
|
|
519
|
+
/**
|
|
520
|
+
* The search keyword or phrase to query.
|
|
521
|
+
*/
|
|
522
|
+
query?: string;
|
|
523
|
+
/**
|
|
524
|
+
* Whether to render the page in a browser before extracting.
|
|
525
|
+
*/
|
|
526
|
+
render?: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* When true, disables Google result filtering (filter=0) so omitted/duplicate and
|
|
529
|
+
* highly similar pages are also returned. Applies to Google search engines.
|
|
530
|
+
*/
|
|
531
|
+
show_hidden_results?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* Whether to compress stored data
|
|
534
|
+
*/
|
|
535
|
+
storage_compress?: boolean;
|
|
536
|
+
/**
|
|
537
|
+
* Custom name for the stored object
|
|
538
|
+
*/
|
|
539
|
+
storage_object_name?: string;
|
|
540
|
+
/**
|
|
541
|
+
* Type of storage to use for results
|
|
542
|
+
*/
|
|
543
|
+
storage_type?: string;
|
|
544
|
+
/**
|
|
545
|
+
* URL for storage location
|
|
546
|
+
*/
|
|
547
|
+
storage_url?: string;
|
|
548
|
+
}
|
|
549
|
+
export interface SerpRunBatchParams {
|
|
550
|
+
/**
|
|
551
|
+
* Array of SERP requests. Each object can include search parameters and
|
|
552
|
+
* async/storage settings.
|
|
553
|
+
*/
|
|
554
|
+
inputs: Array<SerpRunBatchParams.Input>;
|
|
555
|
+
/**
|
|
556
|
+
* Shared parameters applied to the entire batch. Can include search parameters and
|
|
557
|
+
* async/storage settings.
|
|
558
|
+
*/
|
|
559
|
+
shared_inputs?: SerpRunBatchParams.SharedInputs;
|
|
560
|
+
}
|
|
561
|
+
export declare namespace SerpRunBatchParams {
|
|
562
|
+
interface Input {
|
|
563
|
+
/**
|
|
564
|
+
* URL to call back when async operation completes
|
|
565
|
+
*/
|
|
566
|
+
callback_url?: string;
|
|
567
|
+
/**
|
|
568
|
+
* ISO Alpha-2 country code used to access the target search engine (e.g. US, DE,
|
|
569
|
+
* GB).
|
|
570
|
+
*/
|
|
571
|
+
country?: string;
|
|
572
|
+
/**
|
|
573
|
+
* Device type used for the search request.
|
|
574
|
+
*/
|
|
575
|
+
device?: 'desktop' | 'mobile';
|
|
576
|
+
/**
|
|
577
|
+
* Top-level domain for the search engine (e.g. "com", "co.uk", "de").
|
|
578
|
+
*/
|
|
579
|
+
domain?: string;
|
|
580
|
+
/**
|
|
581
|
+
* Locale used for the search request.
|
|
582
|
+
*/
|
|
583
|
+
locale?: string;
|
|
584
|
+
/**
|
|
585
|
+
* Geo-location for the search (canonical Google location name).
|
|
586
|
+
*/
|
|
587
|
+
location?: string;
|
|
588
|
+
/**
|
|
589
|
+
* Number of results to return (1–100).
|
|
590
|
+
*/
|
|
591
|
+
num_results?: number;
|
|
592
|
+
/**
|
|
593
|
+
* The result page number for pagination.
|
|
594
|
+
*/
|
|
595
|
+
page?: number;
|
|
596
|
+
/**
|
|
597
|
+
* When true, the SERP response is parsed into structured JSON.
|
|
598
|
+
*/
|
|
599
|
+
parse?: boolean;
|
|
600
|
+
/**
|
|
601
|
+
* The search keyword or phrase to query.
|
|
602
|
+
*/
|
|
603
|
+
query?: string;
|
|
604
|
+
/**
|
|
605
|
+
* Whether to render the page in a browser before extracting.
|
|
606
|
+
*/
|
|
607
|
+
render?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* The search engine to query.
|
|
610
|
+
*/
|
|
611
|
+
search_engine?: 'google_search' | 'google_sge' | 'google_aio' | 'google_maps_search' | 'google_maps_reviews' | 'google_maps_place' | 'google_news' | 'google_images' | 'bing_search' | 'yandex_search';
|
|
612
|
+
/**
|
|
613
|
+
* When true, disables Google result filtering (filter=0) so omitted/duplicate and
|
|
614
|
+
* highly similar pages are also returned. Applies to Google search engines.
|
|
615
|
+
*/
|
|
616
|
+
show_hidden_results?: boolean;
|
|
617
|
+
/**
|
|
618
|
+
* Whether to compress stored data
|
|
619
|
+
*/
|
|
620
|
+
storage_compress?: boolean;
|
|
621
|
+
/**
|
|
622
|
+
* Custom name for the stored object
|
|
623
|
+
*/
|
|
624
|
+
storage_object_name?: string;
|
|
625
|
+
/**
|
|
626
|
+
* Type of storage to use for results
|
|
627
|
+
*/
|
|
628
|
+
storage_type?: string;
|
|
629
|
+
/**
|
|
630
|
+
* URL for storage location
|
|
631
|
+
*/
|
|
632
|
+
storage_url?: string;
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Shared parameters applied to the entire batch. Can include search parameters and
|
|
636
|
+
* async/storage settings.
|
|
637
|
+
*/
|
|
638
|
+
interface SharedInputs {
|
|
639
|
+
/**
|
|
640
|
+
* URL to call back when async operation completes
|
|
641
|
+
*/
|
|
642
|
+
callback_url?: string;
|
|
643
|
+
/**
|
|
644
|
+
* ISO Alpha-2 country code used to access the target search engine (e.g. US, DE,
|
|
645
|
+
* GB).
|
|
646
|
+
*/
|
|
647
|
+
country?: string;
|
|
648
|
+
/**
|
|
649
|
+
* Device type used for the search request.
|
|
650
|
+
*/
|
|
651
|
+
device?: 'desktop' | 'mobile';
|
|
652
|
+
/**
|
|
653
|
+
* Top-level domain for the search engine (e.g. "com", "co.uk", "de").
|
|
654
|
+
*/
|
|
655
|
+
domain?: string;
|
|
656
|
+
/**
|
|
657
|
+
* Locale used for the search request.
|
|
658
|
+
*/
|
|
659
|
+
locale?: string;
|
|
660
|
+
/**
|
|
661
|
+
* Geo-location for the search (canonical Google location name).
|
|
662
|
+
*/
|
|
663
|
+
location?: string;
|
|
664
|
+
/**
|
|
665
|
+
* Number of results to return (1–100).
|
|
666
|
+
*/
|
|
667
|
+
num_results?: number;
|
|
668
|
+
/**
|
|
669
|
+
* The result page number for pagination.
|
|
670
|
+
*/
|
|
671
|
+
page?: number;
|
|
672
|
+
/**
|
|
673
|
+
* When true, the SERP response is parsed into structured JSON.
|
|
674
|
+
*/
|
|
675
|
+
parse?: boolean;
|
|
676
|
+
/**
|
|
677
|
+
* The search keyword or phrase to query.
|
|
678
|
+
*/
|
|
679
|
+
query?: string;
|
|
680
|
+
/**
|
|
681
|
+
* Whether to render the page in a browser before extracting.
|
|
682
|
+
*/
|
|
683
|
+
render?: boolean;
|
|
684
|
+
/**
|
|
685
|
+
* The search engine to query.
|
|
686
|
+
*/
|
|
687
|
+
search_engine?: 'google_search' | 'google_sge' | 'google_aio' | 'google_maps_search' | 'google_maps_reviews' | 'google_maps_place' | 'google_news' | 'google_images' | 'bing_search' | 'yandex_search';
|
|
688
|
+
/**
|
|
689
|
+
* When true, disables Google result filtering (filter=0) so omitted/duplicate and
|
|
690
|
+
* highly similar pages are also returned. Applies to Google search engines.
|
|
691
|
+
*/
|
|
692
|
+
show_hidden_results?: boolean;
|
|
693
|
+
/**
|
|
694
|
+
* Whether to compress stored data
|
|
695
|
+
*/
|
|
696
|
+
storage_compress?: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* Custom name for the stored object
|
|
699
|
+
*/
|
|
700
|
+
storage_object_name?: string;
|
|
701
|
+
/**
|
|
702
|
+
* Type of storage to use for results
|
|
703
|
+
*/
|
|
704
|
+
storage_type?: string;
|
|
705
|
+
/**
|
|
706
|
+
* URL for storage location
|
|
707
|
+
*/
|
|
708
|
+
storage_url?: string;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
export declare namespace Serp {
|
|
712
|
+
export { type SerpRunResponse as SerpRunResponse, type SerpRunAsyncResponse as SerpRunAsyncResponse, type SerpRunBatchResponse as SerpRunBatchResponse, type SerpRunParams as SerpRunParams, type SerpRunAsyncParams as SerpRunAsyncParams, type SerpRunBatchParams as SerpRunBatchParams, };
|
|
713
|
+
}
|
|
714
|
+
//# sourceMappingURL=serp.d.mts.map
|