anchorbrowser 0.16.2 → 1.0.0-dev.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 +16 -0
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/sessions/sessions.d.mts +46 -0
- package/resources/sessions/sessions.d.mts.map +1 -1
- package/resources/sessions/sessions.d.ts +46 -0
- package/resources/sessions/sessions.d.ts.map +1 -1
- package/resources/sessions/sessions.js.map +1 -1
- package/resources/sessions/sessions.mjs.map +1 -1
- package/resources/task.d.mts +0 -731
- package/resources/task.d.mts.map +1 -1
- package/resources/task.d.ts +0 -731
- package/resources/task.d.ts.map +1 -1
- package/resources/task.js +0 -69
- package/resources/task.js.map +1 -1
- package/resources/task.mjs +0 -69
- package/resources/task.mjs.map +1 -1
- package/src/client.ts +2 -22
- package/src/resources/index.ts +1 -11
- package/src/resources/sessions/sessions.ts +51 -0
- package/src/resources/task.ts +1 -1476
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/resources/task.d.mts
CHANGED
|
@@ -1,735 +1,4 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
-
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
-
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
2
|
export declare class Task extends APIResource {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new task or updates an existing task with the same name. Tasks are
|
|
7
|
-
* reusable code snippets that can be executed in browser sessions. Tasks support
|
|
8
|
-
* versioning with draft and published versions.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```ts
|
|
12
|
-
* const task = await client.task.create({
|
|
13
|
-
* language: 'typescript',
|
|
14
|
-
* name: 'web-scraper',
|
|
15
|
-
* code: 'Y29uc3QgYW5jaG9yID0gcmVxdWlyZSgnYW5jaG9yYnJvd3NlcicpOwoKYXN5bmMgZnVuY3Rpb24gcnVuKCkgewogIGNvbnN0IHNlc3Npb24gPSBhd2FpdCBhbmNob3IuY3JlYXRlU2Vzc2lvbigpOwogIGF3YWl0IHNlc3Npb24uZ29UbygnaHR0cHM6Ly9leGFtcGxlLmNvbScpOwogIGNvbnN0IHRpdGxlID0gYXdhaXQgc2Vzc2lvbi5nZXRUaXRsZSgpOwogIGNvbnNvbGUubG9nKHRpdGxlKTsKICBhd2FpdCBzZXNzaW9uLmNsb3NlKCk7Cn0KcnVuKCk7',
|
|
16
|
-
* description:
|
|
17
|
-
* 'A task to scrape product information from e-commerce sites',
|
|
18
|
-
* });
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
create(body: TaskCreateParams, options?: RequestOptions): APIPromise<TaskCreateResponse>;
|
|
22
|
-
/**
|
|
23
|
-
* Retrieves a paginated list of all tasks for the authenticated team. Tasks are
|
|
24
|
-
* returned with their latest version information and metadata.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```ts
|
|
28
|
-
* const tasks = await client.task.list();
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
list(query?: TaskListParams | null | undefined, options?: RequestOptions): APIPromise<TaskListResponse>;
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves a single execution result by its ID. This endpoint is useful for
|
|
34
|
-
* polling execution status in async mode or retrieving detailed execution
|
|
35
|
-
* information.
|
|
36
|
-
*
|
|
37
|
-
* @example
|
|
38
|
-
* ```ts
|
|
39
|
-
* const response = await client.task.retrieveExecutionResult(
|
|
40
|
-
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
41
|
-
* { taskId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
|
|
42
|
-
* );
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
retrieveExecutionResult(executionID: string, params: TaskRetrieveExecutionResultParams, options?: RequestOptions): APIPromise<TaskRetrieveExecutionResultResponse>;
|
|
46
|
-
/**
|
|
47
|
-
* Executes a task in a browser session. The task can be run with a specific
|
|
48
|
-
* version or the latest version. Optionally, you can provide an existing session
|
|
49
|
-
* ID or let the system create a new one.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```ts
|
|
53
|
-
* const response = await client.task.run({
|
|
54
|
-
* taskId: '550e8400-e29b-41d4-a716-446655440000',
|
|
55
|
-
* inputs: {
|
|
56
|
-
* ANCHOR_TARGET_URL: 'https://example.com',
|
|
57
|
-
* ANCHOR_MAX_PAGES: '10',
|
|
58
|
-
* },
|
|
59
|
-
* version: '1',
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
run(body: TaskRunParams, options?: RequestOptions): APIPromise<TaskRunResponse>;
|
|
64
|
-
}
|
|
65
|
-
export interface TaskCreateResponse {
|
|
66
|
-
data?: TaskCreateResponse.Data;
|
|
67
|
-
}
|
|
68
|
-
export declare namespace TaskCreateResponse {
|
|
69
|
-
interface Data {
|
|
70
|
-
/**
|
|
71
|
-
* Unique identifier for the task
|
|
72
|
-
*/
|
|
73
|
-
id: string;
|
|
74
|
-
/**
|
|
75
|
-
* Base64 encoded task code
|
|
76
|
-
*/
|
|
77
|
-
code: string;
|
|
78
|
-
/**
|
|
79
|
-
* Task creation timestamp
|
|
80
|
-
*/
|
|
81
|
-
createdAt: string;
|
|
82
|
-
/**
|
|
83
|
-
* Whether the task is soft deleted
|
|
84
|
-
*/
|
|
85
|
-
deleted: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* Programming language for the task
|
|
88
|
-
*/
|
|
89
|
-
language: 'typescript';
|
|
90
|
-
/**
|
|
91
|
-
* Latest version identifier (draft, latest, or version number)
|
|
92
|
-
*/
|
|
93
|
-
latestVersion: string;
|
|
94
|
-
/**
|
|
95
|
-
* Task name (letters, numbers, hyphens, and underscores only)
|
|
96
|
-
*/
|
|
97
|
-
name: string;
|
|
98
|
-
/**
|
|
99
|
-
* Team identifier that owns this task
|
|
100
|
-
*/
|
|
101
|
-
teamId: string;
|
|
102
|
-
/**
|
|
103
|
-
* Task last update timestamp
|
|
104
|
-
*/
|
|
105
|
-
updatedAt: string;
|
|
106
|
-
/**
|
|
107
|
-
* Browser configuration for task execution
|
|
108
|
-
*/
|
|
109
|
-
browserConfiguration?: Data.BrowserConfiguration;
|
|
110
|
-
/**
|
|
111
|
-
* Optional description of the task
|
|
112
|
-
*/
|
|
113
|
-
description?: string;
|
|
114
|
-
}
|
|
115
|
-
namespace Data {
|
|
116
|
-
/**
|
|
117
|
-
* Browser configuration for task execution
|
|
118
|
-
*/
|
|
119
|
-
interface BrowserConfiguration {
|
|
120
|
-
/**
|
|
121
|
-
* The URL to navigate to when the browser session starts. If not provided, the
|
|
122
|
-
* browser will load an empty page.
|
|
123
|
-
*/
|
|
124
|
-
initial_url?: string;
|
|
125
|
-
/**
|
|
126
|
-
* Configuration for live viewing the browser session.
|
|
127
|
-
*/
|
|
128
|
-
live_view?: BrowserConfiguration.LiveView;
|
|
129
|
-
/**
|
|
130
|
-
* Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
|
|
131
|
-
*/
|
|
132
|
-
proxy?: BrowserConfiguration.AnchorProxy | BrowserConfiguration.CustomProxy;
|
|
133
|
-
/**
|
|
134
|
-
* Configuration for session recording.
|
|
135
|
-
*/
|
|
136
|
-
recording?: BrowserConfiguration.Recording;
|
|
137
|
-
/**
|
|
138
|
-
* Timeout configurations for the browser session.
|
|
139
|
-
*/
|
|
140
|
-
timeout?: BrowserConfiguration.Timeout;
|
|
141
|
-
}
|
|
142
|
-
namespace BrowserConfiguration {
|
|
143
|
-
/**
|
|
144
|
-
* Configuration for live viewing the browser session.
|
|
145
|
-
*/
|
|
146
|
-
interface LiveView {
|
|
147
|
-
/**
|
|
148
|
-
* Enable or disable read-only mode for live viewing. Defaults to `false`.
|
|
149
|
-
*/
|
|
150
|
-
read_only?: boolean;
|
|
151
|
-
}
|
|
152
|
-
interface AnchorProxy {
|
|
153
|
-
active: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* City name for precise geographic targeting. Supported for anchor_proxy only. Can
|
|
156
|
-
* only be used when region is also provided.
|
|
157
|
-
*/
|
|
158
|
-
city?: string;
|
|
159
|
-
/**
|
|
160
|
-
* Supported country codes ISO 2 lowercase
|
|
161
|
-
*/
|
|
162
|
-
country_code?: 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'as' | 'ag' | 'ar' | 'am' | 'aw' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bm' | 'bo' | 'ba' | 'br' | 'bg' | 'bf' | 'cm' | 'ca' | 'cv' | 'td' | 'cl' | 'co' | 'cg' | 'cr' | 'ci' | 'hr' | 'cu' | 'cy' | 'cz' | 'dk' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'ee' | 'et' | 'fo' | 'fi' | 'fr' | 'gf' | 'pf' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gi' | 'gr' | 'gd' | 'gp' | 'gt' | 'gg' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hu' | 'is' | 'in' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'kw' | 'kg' | 'lv' | 'lb' | 'ly' | 'li' | 'lt' | 'lu' | 'mk' | 'ml' | 'mt' | 'mq' | 'mr' | 'mx' | 'md' | 'mc' | 'me' | 'ma' | 'nl' | 'nz' | 'ni' | 'ng' | 'no' | 'pk' | 'pa' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'pr' | 'qa' | 'ro' | 'lc' | 'sm' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sk' | 'si' | 'so' | 'za' | 'kr' | 'es' | 'sr' | 'se' | 'ch' | 'sy' | 'st' | 'tw' | 'tj' | 'tg' | 'tt' | 'tn' | 'tr' | 'tc' | 'ua' | 'ae' | 'us' | 'uy' | 'uz' | 've' | 'ye';
|
|
163
|
-
/**
|
|
164
|
-
* Region code for more specific geographic targeting. The city parameter can only
|
|
165
|
-
* be used when region is also provided.
|
|
166
|
-
*/
|
|
167
|
-
region?: string;
|
|
168
|
-
/**
|
|
169
|
-
* Create a session with a proxy to access websites as if you're browsing from a
|
|
170
|
-
* computer in that country.
|
|
171
|
-
*/
|
|
172
|
-
type?: 'anchor_proxy';
|
|
173
|
-
}
|
|
174
|
-
interface CustomProxy {
|
|
175
|
-
active: boolean;
|
|
176
|
-
/**
|
|
177
|
-
* Proxy password
|
|
178
|
-
*/
|
|
179
|
-
password: string;
|
|
180
|
-
/**
|
|
181
|
-
* Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
|
|
182
|
-
* https://proxy.example.com:443). See [proxy page](/advanced/proxy#custom-proxy).
|
|
183
|
-
*/
|
|
184
|
-
server: string;
|
|
185
|
-
type: 'custom';
|
|
186
|
-
/**
|
|
187
|
-
* Proxy username
|
|
188
|
-
*/
|
|
189
|
-
username: string;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Configuration for session recording.
|
|
193
|
-
*/
|
|
194
|
-
interface Recording {
|
|
195
|
-
/**
|
|
196
|
-
* Enable or disable video recording of the browser session. Defaults to `true`.
|
|
197
|
-
*/
|
|
198
|
-
active?: boolean;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Timeout configurations for the browser session.
|
|
202
|
-
*/
|
|
203
|
-
interface Timeout {
|
|
204
|
-
/**
|
|
205
|
-
* The amount of time (in minutes) the browser session waits for new connections
|
|
206
|
-
* after all others are closed before stopping. Defaults to `5`.
|
|
207
|
-
*/
|
|
208
|
-
idle_timeout?: number;
|
|
209
|
-
/**
|
|
210
|
-
* Maximum amount of time (in minutes) for the browser to run before terminating.
|
|
211
|
-
* Defaults to `20`.
|
|
212
|
-
*/
|
|
213
|
-
max_duration?: number;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
export interface TaskListResponse {
|
|
219
|
-
data?: TaskListResponse.Data;
|
|
220
|
-
}
|
|
221
|
-
export declare namespace TaskListResponse {
|
|
222
|
-
interface Data {
|
|
223
|
-
/**
|
|
224
|
-
* Number of tasks per page
|
|
225
|
-
*/
|
|
226
|
-
limit: number;
|
|
227
|
-
/**
|
|
228
|
-
* Current page number
|
|
229
|
-
*/
|
|
230
|
-
page: number;
|
|
231
|
-
tasks: Array<Data.Task>;
|
|
232
|
-
/**
|
|
233
|
-
* Total number of tasks
|
|
234
|
-
*/
|
|
235
|
-
total: number;
|
|
236
|
-
}
|
|
237
|
-
namespace Data {
|
|
238
|
-
interface Task {
|
|
239
|
-
/**
|
|
240
|
-
* Unique identifier for the task
|
|
241
|
-
*/
|
|
242
|
-
id: string;
|
|
243
|
-
/**
|
|
244
|
-
* Base64 encoded task code
|
|
245
|
-
*/
|
|
246
|
-
code: string;
|
|
247
|
-
/**
|
|
248
|
-
* Task creation timestamp
|
|
249
|
-
*/
|
|
250
|
-
createdAt: string;
|
|
251
|
-
/**
|
|
252
|
-
* Whether the task is soft deleted
|
|
253
|
-
*/
|
|
254
|
-
deleted: boolean;
|
|
255
|
-
/**
|
|
256
|
-
* Programming language for the task
|
|
257
|
-
*/
|
|
258
|
-
language: 'typescript';
|
|
259
|
-
/**
|
|
260
|
-
* Latest version identifier (draft, latest, or version number)
|
|
261
|
-
*/
|
|
262
|
-
latestVersion: string;
|
|
263
|
-
/**
|
|
264
|
-
* Task name (letters, numbers, hyphens, and underscores only)
|
|
265
|
-
*/
|
|
266
|
-
name: string;
|
|
267
|
-
/**
|
|
268
|
-
* Team identifier that owns this task
|
|
269
|
-
*/
|
|
270
|
-
teamId: string;
|
|
271
|
-
/**
|
|
272
|
-
* Task last update timestamp
|
|
273
|
-
*/
|
|
274
|
-
updatedAt: string;
|
|
275
|
-
/**
|
|
276
|
-
* Browser configuration for task execution
|
|
277
|
-
*/
|
|
278
|
-
browserConfiguration?: Task.BrowserConfiguration;
|
|
279
|
-
/**
|
|
280
|
-
* Optional description of the task
|
|
281
|
-
*/
|
|
282
|
-
description?: string;
|
|
283
|
-
}
|
|
284
|
-
namespace Task {
|
|
285
|
-
/**
|
|
286
|
-
* Browser configuration for task execution
|
|
287
|
-
*/
|
|
288
|
-
interface BrowserConfiguration {
|
|
289
|
-
/**
|
|
290
|
-
* The URL to navigate to when the browser session starts. If not provided, the
|
|
291
|
-
* browser will load an empty page.
|
|
292
|
-
*/
|
|
293
|
-
initial_url?: string;
|
|
294
|
-
/**
|
|
295
|
-
* Configuration for live viewing the browser session.
|
|
296
|
-
*/
|
|
297
|
-
live_view?: BrowserConfiguration.LiveView;
|
|
298
|
-
/**
|
|
299
|
-
* Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
|
|
300
|
-
*/
|
|
301
|
-
proxy?: BrowserConfiguration.AnchorProxy | BrowserConfiguration.CustomProxy;
|
|
302
|
-
/**
|
|
303
|
-
* Configuration for session recording.
|
|
304
|
-
*/
|
|
305
|
-
recording?: BrowserConfiguration.Recording;
|
|
306
|
-
/**
|
|
307
|
-
* Timeout configurations for the browser session.
|
|
308
|
-
*/
|
|
309
|
-
timeout?: BrowserConfiguration.Timeout;
|
|
310
|
-
}
|
|
311
|
-
namespace BrowserConfiguration {
|
|
312
|
-
/**
|
|
313
|
-
* Configuration for live viewing the browser session.
|
|
314
|
-
*/
|
|
315
|
-
interface LiveView {
|
|
316
|
-
/**
|
|
317
|
-
* Enable or disable read-only mode for live viewing. Defaults to `false`.
|
|
318
|
-
*/
|
|
319
|
-
read_only?: boolean;
|
|
320
|
-
}
|
|
321
|
-
interface AnchorProxy {
|
|
322
|
-
active: boolean;
|
|
323
|
-
/**
|
|
324
|
-
* City name for precise geographic targeting. Supported for anchor_proxy only. Can
|
|
325
|
-
* only be used when region is also provided.
|
|
326
|
-
*/
|
|
327
|
-
city?: string;
|
|
328
|
-
/**
|
|
329
|
-
* Supported country codes ISO 2 lowercase
|
|
330
|
-
*/
|
|
331
|
-
country_code?: 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'as' | 'ag' | 'ar' | 'am' | 'aw' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bm' | 'bo' | 'ba' | 'br' | 'bg' | 'bf' | 'cm' | 'ca' | 'cv' | 'td' | 'cl' | 'co' | 'cg' | 'cr' | 'ci' | 'hr' | 'cu' | 'cy' | 'cz' | 'dk' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'ee' | 'et' | 'fo' | 'fi' | 'fr' | 'gf' | 'pf' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gi' | 'gr' | 'gd' | 'gp' | 'gt' | 'gg' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hu' | 'is' | 'in' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'kw' | 'kg' | 'lv' | 'lb' | 'ly' | 'li' | 'lt' | 'lu' | 'mk' | 'ml' | 'mt' | 'mq' | 'mr' | 'mx' | 'md' | 'mc' | 'me' | 'ma' | 'nl' | 'nz' | 'ni' | 'ng' | 'no' | 'pk' | 'pa' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'pr' | 'qa' | 'ro' | 'lc' | 'sm' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sk' | 'si' | 'so' | 'za' | 'kr' | 'es' | 'sr' | 'se' | 'ch' | 'sy' | 'st' | 'tw' | 'tj' | 'tg' | 'tt' | 'tn' | 'tr' | 'tc' | 'ua' | 'ae' | 'us' | 'uy' | 'uz' | 've' | 'ye';
|
|
332
|
-
/**
|
|
333
|
-
* Region code for more specific geographic targeting. The city parameter can only
|
|
334
|
-
* be used when region is also provided.
|
|
335
|
-
*/
|
|
336
|
-
region?: string;
|
|
337
|
-
/**
|
|
338
|
-
* Create a session with a proxy to access websites as if you're browsing from a
|
|
339
|
-
* computer in that country.
|
|
340
|
-
*/
|
|
341
|
-
type?: 'anchor_proxy';
|
|
342
|
-
}
|
|
343
|
-
interface CustomProxy {
|
|
344
|
-
active: boolean;
|
|
345
|
-
/**
|
|
346
|
-
* Proxy password
|
|
347
|
-
*/
|
|
348
|
-
password: string;
|
|
349
|
-
/**
|
|
350
|
-
* Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
|
|
351
|
-
* https://proxy.example.com:443). See [proxy page](/advanced/proxy#custom-proxy).
|
|
352
|
-
*/
|
|
353
|
-
server: string;
|
|
354
|
-
type: 'custom';
|
|
355
|
-
/**
|
|
356
|
-
* Proxy username
|
|
357
|
-
*/
|
|
358
|
-
username: string;
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Configuration for session recording.
|
|
362
|
-
*/
|
|
363
|
-
interface Recording {
|
|
364
|
-
/**
|
|
365
|
-
* Enable or disable video recording of the browser session. Defaults to `true`.
|
|
366
|
-
*/
|
|
367
|
-
active?: boolean;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Timeout configurations for the browser session.
|
|
371
|
-
*/
|
|
372
|
-
interface Timeout {
|
|
373
|
-
/**
|
|
374
|
-
* The amount of time (in minutes) the browser session waits for new connections
|
|
375
|
-
* after all others are closed before stopping. Defaults to `5`.
|
|
376
|
-
*/
|
|
377
|
-
idle_timeout?: number;
|
|
378
|
-
/**
|
|
379
|
-
* Maximum amount of time (in minutes) for the browser to run before terminating.
|
|
380
|
-
* Defaults to `20`.
|
|
381
|
-
*/
|
|
382
|
-
max_duration?: number;
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
export interface TaskRetrieveExecutionResultResponse {
|
|
389
|
-
data?: TaskRetrieveExecutionResultResponse.Data;
|
|
390
|
-
}
|
|
391
|
-
export declare namespace TaskRetrieveExecutionResultResponse {
|
|
392
|
-
interface Data {
|
|
393
|
-
/**
|
|
394
|
-
* Unique identifier for the execution result
|
|
395
|
-
*/
|
|
396
|
-
id: string;
|
|
397
|
-
/**
|
|
398
|
-
* Execution start time
|
|
399
|
-
*/
|
|
400
|
-
startTime: string;
|
|
401
|
-
/**
|
|
402
|
-
* Execution status
|
|
403
|
-
*/
|
|
404
|
-
status: 'success' | 'failure' | 'timeout' | 'cancelled';
|
|
405
|
-
/**
|
|
406
|
-
* Task version identifier
|
|
407
|
-
*/
|
|
408
|
-
taskVersionId: string;
|
|
409
|
-
/**
|
|
410
|
-
* Version that was executed
|
|
411
|
-
*/
|
|
412
|
-
version: string;
|
|
413
|
-
/**
|
|
414
|
-
* Error message if execution failed
|
|
415
|
-
*/
|
|
416
|
-
errorMessage?: string | null;
|
|
417
|
-
/**
|
|
418
|
-
* Execution duration in milliseconds
|
|
419
|
-
*/
|
|
420
|
-
executionTime?: number | null;
|
|
421
|
-
/**
|
|
422
|
-
* Task execution output
|
|
423
|
-
*/
|
|
424
|
-
output?: string | null;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
export interface TaskRunResponse {
|
|
428
|
-
data?: TaskRunResponse.Data;
|
|
429
|
-
}
|
|
430
|
-
export declare namespace TaskRunResponse {
|
|
431
|
-
interface Data {
|
|
432
|
-
/**
|
|
433
|
-
* Execution result message
|
|
434
|
-
*/
|
|
435
|
-
message: string;
|
|
436
|
-
/**
|
|
437
|
-
* Whether the task executed successfully
|
|
438
|
-
*/
|
|
439
|
-
success: boolean;
|
|
440
|
-
/**
|
|
441
|
-
* Task identifier
|
|
442
|
-
*/
|
|
443
|
-
taskId: string;
|
|
444
|
-
/**
|
|
445
|
-
* Error message if execution failed
|
|
446
|
-
*/
|
|
447
|
-
error?: string;
|
|
448
|
-
/**
|
|
449
|
-
* Execution duration in milliseconds
|
|
450
|
-
*/
|
|
451
|
-
executionTime?: number;
|
|
452
|
-
/**
|
|
453
|
-
* Task execution output
|
|
454
|
-
*/
|
|
455
|
-
output?: string;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
export interface TaskCreateParams {
|
|
459
|
-
/**
|
|
460
|
-
* Programming language for the task
|
|
461
|
-
*/
|
|
462
|
-
language: 'typescript';
|
|
463
|
-
/**
|
|
464
|
-
* Task name (letters, numbers, hyphens, and underscores only)
|
|
465
|
-
*/
|
|
466
|
-
name: string;
|
|
467
|
-
/**
|
|
468
|
-
* Browser configuration for task execution
|
|
469
|
-
*/
|
|
470
|
-
browserConfiguration?: TaskCreateParams.BrowserConfiguration;
|
|
471
|
-
/**
|
|
472
|
-
* Base64 encoded task code (optional)
|
|
473
|
-
*/
|
|
474
|
-
code?: string;
|
|
475
|
-
/**
|
|
476
|
-
* Optional description of the task
|
|
477
|
-
*/
|
|
478
|
-
description?: string;
|
|
479
|
-
}
|
|
480
|
-
export declare namespace TaskCreateParams {
|
|
481
|
-
/**
|
|
482
|
-
* Browser configuration for task execution
|
|
483
|
-
*/
|
|
484
|
-
interface BrowserConfiguration {
|
|
485
|
-
/**
|
|
486
|
-
* The URL to navigate to when the browser session starts. If not provided, the
|
|
487
|
-
* browser will load an empty page.
|
|
488
|
-
*/
|
|
489
|
-
initial_url?: string;
|
|
490
|
-
/**
|
|
491
|
-
* Configuration for live viewing the browser session.
|
|
492
|
-
*/
|
|
493
|
-
live_view?: BrowserConfiguration.LiveView;
|
|
494
|
-
/**
|
|
495
|
-
* Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
|
|
496
|
-
*/
|
|
497
|
-
proxy?: BrowserConfiguration.AnchorProxy | BrowserConfiguration.CustomProxy;
|
|
498
|
-
/**
|
|
499
|
-
* Configuration for session recording.
|
|
500
|
-
*/
|
|
501
|
-
recording?: BrowserConfiguration.Recording;
|
|
502
|
-
/**
|
|
503
|
-
* Timeout configurations for the browser session.
|
|
504
|
-
*/
|
|
505
|
-
timeout?: BrowserConfiguration.Timeout;
|
|
506
|
-
}
|
|
507
|
-
namespace BrowserConfiguration {
|
|
508
|
-
/**
|
|
509
|
-
* Configuration for live viewing the browser session.
|
|
510
|
-
*/
|
|
511
|
-
interface LiveView {
|
|
512
|
-
/**
|
|
513
|
-
* Enable or disable read-only mode for live viewing. Defaults to `false`.
|
|
514
|
-
*/
|
|
515
|
-
read_only?: boolean;
|
|
516
|
-
}
|
|
517
|
-
interface AnchorProxy {
|
|
518
|
-
active: boolean;
|
|
519
|
-
/**
|
|
520
|
-
* City name for precise geographic targeting. Supported for anchor_proxy only. Can
|
|
521
|
-
* only be used when region is also provided.
|
|
522
|
-
*/
|
|
523
|
-
city?: string;
|
|
524
|
-
/**
|
|
525
|
-
* Supported country codes ISO 2 lowercase
|
|
526
|
-
*/
|
|
527
|
-
country_code?: 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'as' | 'ag' | 'ar' | 'am' | 'aw' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bm' | 'bo' | 'ba' | 'br' | 'bg' | 'bf' | 'cm' | 'ca' | 'cv' | 'td' | 'cl' | 'co' | 'cg' | 'cr' | 'ci' | 'hr' | 'cu' | 'cy' | 'cz' | 'dk' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'ee' | 'et' | 'fo' | 'fi' | 'fr' | 'gf' | 'pf' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gi' | 'gr' | 'gd' | 'gp' | 'gt' | 'gg' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hu' | 'is' | 'in' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'kw' | 'kg' | 'lv' | 'lb' | 'ly' | 'li' | 'lt' | 'lu' | 'mk' | 'ml' | 'mt' | 'mq' | 'mr' | 'mx' | 'md' | 'mc' | 'me' | 'ma' | 'nl' | 'nz' | 'ni' | 'ng' | 'no' | 'pk' | 'pa' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'pr' | 'qa' | 'ro' | 'lc' | 'sm' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sk' | 'si' | 'so' | 'za' | 'kr' | 'es' | 'sr' | 'se' | 'ch' | 'sy' | 'st' | 'tw' | 'tj' | 'tg' | 'tt' | 'tn' | 'tr' | 'tc' | 'ua' | 'ae' | 'us' | 'uy' | 'uz' | 've' | 'ye';
|
|
528
|
-
/**
|
|
529
|
-
* Region code for more specific geographic targeting. The city parameter can only
|
|
530
|
-
* be used when region is also provided.
|
|
531
|
-
*/
|
|
532
|
-
region?: string;
|
|
533
|
-
/**
|
|
534
|
-
* Create a session with a proxy to access websites as if you're browsing from a
|
|
535
|
-
* computer in that country.
|
|
536
|
-
*/
|
|
537
|
-
type?: 'anchor_proxy';
|
|
538
|
-
}
|
|
539
|
-
interface CustomProxy {
|
|
540
|
-
active: boolean;
|
|
541
|
-
/**
|
|
542
|
-
* Proxy password
|
|
543
|
-
*/
|
|
544
|
-
password: string;
|
|
545
|
-
/**
|
|
546
|
-
* Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
|
|
547
|
-
* https://proxy.example.com:443). See [proxy page](/advanced/proxy#custom-proxy).
|
|
548
|
-
*/
|
|
549
|
-
server: string;
|
|
550
|
-
type: 'custom';
|
|
551
|
-
/**
|
|
552
|
-
* Proxy username
|
|
553
|
-
*/
|
|
554
|
-
username: string;
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
* Configuration for session recording.
|
|
558
|
-
*/
|
|
559
|
-
interface Recording {
|
|
560
|
-
/**
|
|
561
|
-
* Enable or disable video recording of the browser session. Defaults to `true`.
|
|
562
|
-
*/
|
|
563
|
-
active?: boolean;
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* Timeout configurations for the browser session.
|
|
567
|
-
*/
|
|
568
|
-
interface Timeout {
|
|
569
|
-
/**
|
|
570
|
-
* The amount of time (in minutes) the browser session waits for new connections
|
|
571
|
-
* after all others are closed before stopping. Defaults to `5`.
|
|
572
|
-
*/
|
|
573
|
-
idle_timeout?: number;
|
|
574
|
-
/**
|
|
575
|
-
* Maximum amount of time (in minutes) for the browser to run before terminating.
|
|
576
|
-
* Defaults to `20`.
|
|
577
|
-
*/
|
|
578
|
-
max_duration?: number;
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
export interface TaskListParams {
|
|
583
|
-
/**
|
|
584
|
-
* Number of tasks per page
|
|
585
|
-
*/
|
|
586
|
-
limit?: string;
|
|
587
|
-
/**
|
|
588
|
-
* Page number
|
|
589
|
-
*/
|
|
590
|
-
page?: string;
|
|
591
|
-
}
|
|
592
|
-
export interface TaskRetrieveExecutionResultParams {
|
|
593
|
-
/**
|
|
594
|
-
* The ID of the task
|
|
595
|
-
*/
|
|
596
|
-
taskId: string;
|
|
597
|
-
}
|
|
598
|
-
export interface TaskRunParams {
|
|
599
|
-
/**
|
|
600
|
-
* Task identifier
|
|
601
|
-
*/
|
|
602
|
-
taskId: string;
|
|
603
|
-
/**
|
|
604
|
-
* Whether to run the task asynchronously.
|
|
605
|
-
*/
|
|
606
|
-
async?: boolean;
|
|
607
|
-
/**
|
|
608
|
-
* Whether to cleanup browser sessions after task execution. Defaults to true.
|
|
609
|
-
*/
|
|
610
|
-
cleanupSessions?: boolean;
|
|
611
|
-
/**
|
|
612
|
-
* Environment variables for task execution (keys must start with ANCHOR\_)
|
|
613
|
-
*/
|
|
614
|
-
inputs?: {
|
|
615
|
-
[key: string]: string;
|
|
616
|
-
};
|
|
617
|
-
/**
|
|
618
|
-
* Override browser configuration for this execution
|
|
619
|
-
*/
|
|
620
|
-
overrideBrowserConfiguration?: TaskRunParams.OverrideBrowserConfiguration;
|
|
621
|
-
/**
|
|
622
|
-
* Optional existing browser session ID to use for task execution
|
|
623
|
-
*/
|
|
624
|
-
sessionId?: string;
|
|
625
|
-
/**
|
|
626
|
-
* Version to run (draft, latest, or version number)
|
|
627
|
-
*/
|
|
628
|
-
version?: string;
|
|
629
|
-
}
|
|
630
|
-
export declare namespace TaskRunParams {
|
|
631
|
-
/**
|
|
632
|
-
* Override browser configuration for this execution
|
|
633
|
-
*/
|
|
634
|
-
interface OverrideBrowserConfiguration {
|
|
635
|
-
/**
|
|
636
|
-
* The URL to navigate to when the browser session starts. If not provided, the
|
|
637
|
-
* browser will load an empty page.
|
|
638
|
-
*/
|
|
639
|
-
initial_url?: string;
|
|
640
|
-
/**
|
|
641
|
-
* Configuration for live viewing the browser session.
|
|
642
|
-
*/
|
|
643
|
-
live_view?: OverrideBrowserConfiguration.LiveView;
|
|
644
|
-
/**
|
|
645
|
-
* Proxy Documentation available at [Proxy Documentation](/advanced/proxy)
|
|
646
|
-
*/
|
|
647
|
-
proxy?: OverrideBrowserConfiguration.AnchorProxy | OverrideBrowserConfiguration.CustomProxy;
|
|
648
|
-
/**
|
|
649
|
-
* Configuration for session recording.
|
|
650
|
-
*/
|
|
651
|
-
recording?: OverrideBrowserConfiguration.Recording;
|
|
652
|
-
/**
|
|
653
|
-
* Timeout configurations for the browser session.
|
|
654
|
-
*/
|
|
655
|
-
timeout?: OverrideBrowserConfiguration.Timeout;
|
|
656
|
-
}
|
|
657
|
-
namespace OverrideBrowserConfiguration {
|
|
658
|
-
/**
|
|
659
|
-
* Configuration for live viewing the browser session.
|
|
660
|
-
*/
|
|
661
|
-
interface LiveView {
|
|
662
|
-
/**
|
|
663
|
-
* Enable or disable read-only mode for live viewing. Defaults to `false`.
|
|
664
|
-
*/
|
|
665
|
-
read_only?: boolean;
|
|
666
|
-
}
|
|
667
|
-
interface AnchorProxy {
|
|
668
|
-
active: boolean;
|
|
669
|
-
/**
|
|
670
|
-
* City name for precise geographic targeting. Supported for anchor_proxy only. Can
|
|
671
|
-
* only be used when region is also provided.
|
|
672
|
-
*/
|
|
673
|
-
city?: string;
|
|
674
|
-
/**
|
|
675
|
-
* Supported country codes ISO 2 lowercase
|
|
676
|
-
*/
|
|
677
|
-
country_code?: 'af' | 'al' | 'dz' | 'ad' | 'ao' | 'as' | 'ag' | 'ar' | 'am' | 'aw' | 'au' | 'at' | 'az' | 'bs' | 'bh' | 'bb' | 'by' | 'be' | 'bz' | 'bj' | 'bm' | 'bo' | 'ba' | 'br' | 'bg' | 'bf' | 'cm' | 'ca' | 'cv' | 'td' | 'cl' | 'co' | 'cg' | 'cr' | 'ci' | 'hr' | 'cu' | 'cy' | 'cz' | 'dk' | 'dm' | 'do' | 'ec' | 'eg' | 'sv' | 'ee' | 'et' | 'fo' | 'fi' | 'fr' | 'gf' | 'pf' | 'ga' | 'gm' | 'ge' | 'de' | 'gh' | 'gi' | 'gr' | 'gd' | 'gp' | 'gt' | 'gg' | 'gn' | 'gw' | 'gy' | 'ht' | 'hn' | 'hu' | 'is' | 'in' | 'ir' | 'iq' | 'ie' | 'il' | 'it' | 'jm' | 'jp' | 'jo' | 'kz' | 'kw' | 'kg' | 'lv' | 'lb' | 'ly' | 'li' | 'lt' | 'lu' | 'mk' | 'ml' | 'mt' | 'mq' | 'mr' | 'mx' | 'md' | 'mc' | 'me' | 'ma' | 'nl' | 'nz' | 'ni' | 'ng' | 'no' | 'pk' | 'pa' | 'py' | 'pe' | 'ph' | 'pl' | 'pt' | 'pr' | 'qa' | 'ro' | 'lc' | 'sm' | 'sa' | 'sn' | 'rs' | 'sc' | 'sl' | 'sk' | 'si' | 'so' | 'za' | 'kr' | 'es' | 'sr' | 'se' | 'ch' | 'sy' | 'st' | 'tw' | 'tj' | 'tg' | 'tt' | 'tn' | 'tr' | 'tc' | 'ua' | 'ae' | 'us' | 'uy' | 'uz' | 've' | 'ye';
|
|
678
|
-
/**
|
|
679
|
-
* Region code for more specific geographic targeting. The city parameter can only
|
|
680
|
-
* be used when region is also provided.
|
|
681
|
-
*/
|
|
682
|
-
region?: string;
|
|
683
|
-
/**
|
|
684
|
-
* Create a session with a proxy to access websites as if you're browsing from a
|
|
685
|
-
* computer in that country.
|
|
686
|
-
*/
|
|
687
|
-
type?: 'anchor_proxy';
|
|
688
|
-
}
|
|
689
|
-
interface CustomProxy {
|
|
690
|
-
active: boolean;
|
|
691
|
-
/**
|
|
692
|
-
* Proxy password
|
|
693
|
-
*/
|
|
694
|
-
password: string;
|
|
695
|
-
/**
|
|
696
|
-
* Proxy address in **PROTOCOL://HOST:PORT** format (e.g.,
|
|
697
|
-
* https://proxy.example.com:443). See [proxy page](/advanced/proxy#custom-proxy).
|
|
698
|
-
*/
|
|
699
|
-
server: string;
|
|
700
|
-
type: 'custom';
|
|
701
|
-
/**
|
|
702
|
-
* Proxy username
|
|
703
|
-
*/
|
|
704
|
-
username: string;
|
|
705
|
-
}
|
|
706
|
-
/**
|
|
707
|
-
* Configuration for session recording.
|
|
708
|
-
*/
|
|
709
|
-
interface Recording {
|
|
710
|
-
/**
|
|
711
|
-
* Enable or disable video recording of the browser session. Defaults to `true`.
|
|
712
|
-
*/
|
|
713
|
-
active?: boolean;
|
|
714
|
-
}
|
|
715
|
-
/**
|
|
716
|
-
* Timeout configurations for the browser session.
|
|
717
|
-
*/
|
|
718
|
-
interface Timeout {
|
|
719
|
-
/**
|
|
720
|
-
* The amount of time (in minutes) the browser session waits for new connections
|
|
721
|
-
* after all others are closed before stopping. Defaults to `5`.
|
|
722
|
-
*/
|
|
723
|
-
idle_timeout?: number;
|
|
724
|
-
/**
|
|
725
|
-
* Maximum amount of time (in minutes) for the browser to run before terminating.
|
|
726
|
-
* Defaults to `20`.
|
|
727
|
-
*/
|
|
728
|
-
max_duration?: number;
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
export declare namespace Task {
|
|
733
|
-
export { type TaskCreateResponse as TaskCreateResponse, type TaskListResponse as TaskListResponse, type TaskRetrieveExecutionResultResponse as TaskRetrieveExecutionResultResponse, type TaskRunResponse as TaskRunResponse, type TaskCreateParams as TaskCreateParams, type TaskListParams as TaskListParams, type TaskRetrieveExecutionResultParams as TaskRetrieveExecutionResultParams, type TaskRunParams as TaskRunParams, };
|
|
734
3
|
}
|
|
735
4
|
//# sourceMappingURL=task.d.mts.map
|