@airtop/sdk 1.0.0-alpha2.4 → 1.0.0-alpha2.40
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/dist/index.cjs +1092 -189
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +810 -65
- package/dist/index.d.ts +810 -65
- package/dist/index.js +1084 -181
- package/dist/index.js.map +1 -1
- package/package.json +17 -15
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
|
+
import { SessionListParams, ProfileOutput, FileListParams, FileCreateFileParams, WindowCreateParams, WindowIDData, EnvelopeDefaultMeta as EnvelopeDefaultMeta$1, Issue as Issue$1, WindowInfo, WindowGetParams, AIPromptResponse, ScrapeResponse, FileContentData } from '@airtop/core/resources/index.js';
|
|
2
|
+
import * as index_js from '@airtop/core/resources/index.js';
|
|
3
|
+
export { index_js as AirtopCore };
|
|
4
|
+
export { AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
|
|
5
|
+
import * as _airtop_core_resources_shared_mjs from '@airtop/core/resources/shared.mjs';
|
|
6
|
+
export { _airtop_core_resources_shared_mjs as AirtopCoreShared };
|
|
7
|
+
import { WindowClickParams, WindowHoverParams, WindowLoadURLParams, WindowMonitorParams, WindowPageQueryParams, WindowPaginatedExtractionParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams, WindowFillFormParams } from '@airtop/core/resources/windows.js';
|
|
8
|
+
import * as windows_js from '@airtop/core/resources/windows.js';
|
|
9
|
+
export { windows_js as AirtopCoreWindows };
|
|
10
|
+
export { WindowActParams, WindowClickParams, WindowExtractParams, WindowFillFormParams, WindowFindManyParams, WindowFindOneParams, WindowGetParams, WindowHoverParams, WindowLlmParams, WindowLoadURLParams, WindowMonitorParams, WindowNavigateParams, WindowPageQueryParams, WindowPaginatedExtractionParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowWaitForPageParams } from '@airtop/core/resources/windows.js';
|
|
1
11
|
import * as _airtop_core from '@airtop/core';
|
|
2
12
|
import { Airtop } from '@airtop/core';
|
|
3
13
|
import { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
|
|
4
14
|
export { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
|
|
5
15
|
import { ILogLayer } from 'loglayer';
|
|
6
16
|
export { ILogLayer } from 'loglayer';
|
|
7
|
-
import
|
|
17
|
+
import { Issue, SessionConfigV1, ListAutomationsOutput, AutomationData, FilesResponse, EnvelopeDefaultMeta, GetFileData, CreateFileData, AirtopPagination, ExternalFile, ServicePromptActionResponseEnvelope, ServicePromptParameters, ExternalSessionWithConnectionInfo, ExtractActionResponseEnvelope, ActActionResponseEnvelope, LlmActionResponseEnvelope, NodeHandle, WaitForPageActionResponseEnvelope, NavigateActionResponseEnvelope, FindOneActionResponseEnvelope, FindManyActionResponseEnvelope, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse, WindowsResponse } from '@airtop/core/resources/shared.js';
|
|
18
|
+
export { AIResponseEnvelope, ActActionResponseData, AgentInvocationData, AgentVersionData, AirtopPagination, AsyncConfig, AsyncSessionAIResponseEnvelope, BrowserWaitNavigationConfig, ClickConfig, ClientProvidedResponseMetadata, CreateFileData, EnvelopeDefaultMeta, ExternalSessionAIResponseMetadata, ExternalSessionAIResponseMetadataUsage, ExternalSessionConfig, ExternalSessionWithConnectionInfo, ExtractActionResponseData, FindManyActionResponseData, FindOneActionResponseData, GetFileData, IntervalMonitorConfig, Issue, LlmActionResponseData, MonitorConfig, NavigateActionResponseData, OperationOutcome, OperationOutcomeResponse, PageQueryConfig, PageQueryExperimentalConfig, PaginatedExtractionConfig, ScrapeResponseContent, ScrapeResponseEnvelope, ScrapeResponseOutput, ScreenshotConfig, ScreenshotMetadata, ScreenshotRequestConfig, ScreenshotScrollPosition, ScreenshotViewportDimensions, ScrollByConfig, ScrollToEdgeConfig, ServicePromptActionResponseData, SummaryExperimentalConfig, VisualAnalysisConfig, WaitForPageActionResponseData, WindowIDData, WindowIDDataResponse, WindowInfo, WindowResponse, WindowsResponse, WindowsWithMeta } from '@airtop/core/resources/shared.js';
|
|
8
19
|
import { AutomationUpdateDescriptionParams } from '@airtop/core/resources/automations.js';
|
|
9
|
-
import { SessionListParams, ProfileOutput, FileListParams, FileCreateFileParams, WindowIDData, EnvelopeDefaultMeta as EnvelopeDefaultMeta$1, Issue as Issue$1, WindowInfo, WindowGetParams, AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
|
|
10
|
-
import * as _airtop_core_resources_shared_js from '@airtop/core/resources/shared.js';
|
|
11
|
-
import { SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, ExternalSessionWithConnectionInfo, EnvelopeDefaultMeta, Issue, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } from '@airtop/core/resources/shared.js';
|
|
12
|
-
export { AIResponseEnvelope, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } from '@airtop/core/resources/shared.js';
|
|
13
20
|
import * as _airtop_core_resources_sessions_mjs from '@airtop/core/resources/sessions.mjs';
|
|
14
|
-
import
|
|
21
|
+
import * as _airtop_core_resources_js from '@airtop/core/resources.js';
|
|
22
|
+
import { ConnectedServicesActionResponseEnvelope, SessionGetConnectedServicesParams } from '@airtop/core/resources.js';
|
|
23
|
+
import { DeepOmit } from 'deep-utility-types';
|
|
24
|
+
export { DeepOmit } from 'deep-utility-types';
|
|
15
25
|
|
|
16
26
|
/**
|
|
17
27
|
* Shared configuration between Airtop classes.
|
|
@@ -36,12 +46,25 @@ interface CommonAirtopConfig {
|
|
|
36
46
|
* Used for customizing output schema handling.
|
|
37
47
|
*/
|
|
38
48
|
outputSchemaAdapter?: AirtopJsonSchemaAdapter;
|
|
49
|
+
/**
|
|
50
|
+
* The automation job ID to use for the request.
|
|
51
|
+
*/
|
|
52
|
+
jobId?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Logger instance for publishing agent events.
|
|
55
|
+
* Used to send event data to external systems during automation execution.
|
|
56
|
+
*/
|
|
57
|
+
agentEventPublisher?: ILogLayer;
|
|
58
|
+
/**
|
|
59
|
+
* The default timeout in seconds for API requests.
|
|
60
|
+
*/
|
|
61
|
+
defaultTimeoutInSeconds?: number;
|
|
39
62
|
}
|
|
40
63
|
/**
|
|
41
64
|
* Configuration for defining the JSON schema output.
|
|
42
65
|
*/
|
|
43
66
|
interface OutputJsonSchemaConfig {
|
|
44
|
-
configuration
|
|
67
|
+
configuration?: {
|
|
45
68
|
/**
|
|
46
69
|
* JSON schema defining the structure of the output.
|
|
47
70
|
*/
|
|
@@ -75,6 +98,15 @@ interface CommonResponse {
|
|
|
75
98
|
warnings?: unknown;
|
|
76
99
|
errors?: unknown;
|
|
77
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Custom error class that implements the Issue interface.
|
|
103
|
+
* Extends the native Error class to provide a more structured error handling mechanism.
|
|
104
|
+
*/
|
|
105
|
+
declare class AirtopError extends Error {
|
|
106
|
+
issues: Issue[];
|
|
107
|
+
metadata?: Record<string, unknown>;
|
|
108
|
+
constructor(issues: Issue[], metadata?: Record<string, unknown>);
|
|
109
|
+
}
|
|
78
110
|
|
|
79
111
|
/**
|
|
80
112
|
* Base class for Airtop SDK implementation
|
|
@@ -97,11 +129,38 @@ declare class AirtopBase {
|
|
|
97
129
|
* @internal
|
|
98
130
|
**/
|
|
99
131
|
protected outputJsonAdapter: AirtopJsonSchemaAdapter;
|
|
132
|
+
/**
|
|
133
|
+
* The job id for the ongoing automation
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
protected jobId?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Instance for sending agent events
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
141
|
+
protected agentEventPublisher?: ILogLayer;
|
|
142
|
+
/**
|
|
143
|
+
* The default timeout in seconds for API requests.
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
protected defaultTimeoutInSeconds: number;
|
|
100
147
|
/**
|
|
101
148
|
* Creates a new instance of AirtopBase
|
|
102
149
|
* @param config - Configuration options for the SDK
|
|
103
150
|
*/
|
|
104
151
|
constructor(config: CommonAirtopConfig);
|
|
152
|
+
/**
|
|
153
|
+
* Sets the publisher for sending agent events. Internal use only.
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
_setAgentEventPublisher(logger: ILogLayer): void;
|
|
157
|
+
/**
|
|
158
|
+
* Sends a payload to the agent with the specified event name.
|
|
159
|
+
* @param eventName The name of the event
|
|
160
|
+
* @param payload The payload to send to the agent
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
163
|
+
protected _sendAgentPayload(eventName: string, payload: any): void;
|
|
105
164
|
/**
|
|
106
165
|
* Returns the API key used by the SDK
|
|
107
166
|
* @returns API key string
|
|
@@ -122,7 +181,7 @@ declare class AirtopBase {
|
|
|
122
181
|
* @returns Logger instance
|
|
123
182
|
* @see {@link https://loglayer.dev | LogLayer Documentation}
|
|
124
183
|
*/
|
|
125
|
-
getLogger(): ILogLayer
|
|
184
|
+
getLogger(): ILogLayer<ILogLayer<any>>;
|
|
126
185
|
/**
|
|
127
186
|
* Converts input data to JSON schema format
|
|
128
187
|
* @param input - Data to be converted (schema input, string, or object)
|
|
@@ -161,7 +220,7 @@ interface AirtopConstructorConfig {
|
|
|
161
220
|
apiKey: string;
|
|
162
221
|
/**
|
|
163
222
|
* The base URL for the Airtop API.
|
|
164
|
-
* Defaults to https://api.airtop.ai/api
|
|
223
|
+
* Defaults to https://api.airtop.ai/api if not specified.
|
|
165
224
|
*/
|
|
166
225
|
airtopUrl?: string;
|
|
167
226
|
/**
|
|
@@ -180,6 +239,24 @@ interface AirtopConstructorConfig {
|
|
|
180
239
|
* Used to customize how response data is structured.
|
|
181
240
|
*/
|
|
182
241
|
outputSchemaAdapter?: AirtopJsonSchemaAdapter;
|
|
242
|
+
/**
|
|
243
|
+
* The job ID to use for the ongoing automation.
|
|
244
|
+
*/
|
|
245
|
+
jobId?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Logger instance for publishing agent events.
|
|
248
|
+
* Used to send event data to external systems during automation execution.
|
|
249
|
+
*/
|
|
250
|
+
agentEventPublisher?: ILogLayer;
|
|
251
|
+
/**
|
|
252
|
+
* The default timeout in seconds for API requests.
|
|
253
|
+
* Defaults to 5 minutes if not specified.
|
|
254
|
+
*/
|
|
255
|
+
defaultTimeoutInSeconds?: number;
|
|
256
|
+
/**
|
|
257
|
+
* (Internal use only) Analytics environment. Used to track the source environment where the SDK is used.
|
|
258
|
+
*/
|
|
259
|
+
environment?: string;
|
|
183
260
|
}
|
|
184
261
|
/**
|
|
185
262
|
* Configuration options for creating a new session.
|
|
@@ -204,8 +281,6 @@ interface GetSessionsConfig extends Omit<SessionListParams, "sessionIds"> {
|
|
|
204
281
|
*/
|
|
205
282
|
interface GetFilesConfig extends Omit<FileListParams, "sessionIds"> {
|
|
206
283
|
}
|
|
207
|
-
interface AirtopFileResponse extends GetFileResponse {
|
|
208
|
-
}
|
|
209
284
|
interface AirtopAutomationUpdateDescriptionConfig extends AutomationUpdateDescriptionParams {
|
|
210
285
|
}
|
|
211
286
|
interface AirtopAutomationData extends AutomationData {
|
|
@@ -219,6 +294,222 @@ interface AirtopFileListParams extends FileListParams {
|
|
|
219
294
|
interface AirtopFilesResponse extends FilesResponse {
|
|
220
295
|
}
|
|
221
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Common data found in a file API call response.
|
|
299
|
+
*/
|
|
300
|
+
interface CommonFileResponse {
|
|
301
|
+
data: {
|
|
302
|
+
/**
|
|
303
|
+
* The ID of the file.
|
|
304
|
+
*/
|
|
305
|
+
id: string;
|
|
306
|
+
};
|
|
307
|
+
meta?: EnvelopeDefaultMeta;
|
|
308
|
+
warnings?: Issue[];
|
|
309
|
+
errors?: Issue[];
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* The file data containing details such as the id, file name, type, and download URL.
|
|
313
|
+
*/
|
|
314
|
+
interface FileData extends GetFileData {
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* The file data from creating a new file.
|
|
318
|
+
*/
|
|
319
|
+
interface FileCreateData extends CreateFileData {
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* The file data from listing files (external file data).
|
|
323
|
+
*/
|
|
324
|
+
interface FileListData extends ExternalFile {
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* The metadata associated with the file.
|
|
328
|
+
*/
|
|
329
|
+
interface FileMetadata extends EnvelopeDefaultMeta {
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* A non-fatal file operation issue.
|
|
333
|
+
*/
|
|
334
|
+
interface FileWarning extends Issue {
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* A fatal file operation issue.
|
|
338
|
+
*/
|
|
339
|
+
interface FileError extends Issue {
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Response object for getting file information.
|
|
343
|
+
*/
|
|
344
|
+
interface AirtopFileGetResponse {
|
|
345
|
+
/**
|
|
346
|
+
* The file data containing details such as the id, file name, type, and download URL.
|
|
347
|
+
* Includes all information about the file that was processed or retrieved.
|
|
348
|
+
*/
|
|
349
|
+
data: FileData;
|
|
350
|
+
/**
|
|
351
|
+
* The metadata associated with the file operation.
|
|
352
|
+
* Contains information about the request that processed the file.
|
|
353
|
+
*/
|
|
354
|
+
meta?: FileMetadata;
|
|
355
|
+
/**
|
|
356
|
+
* Warnings that occurred during file processing or operation.
|
|
357
|
+
* These are non-fatal issues that didn't prevent file processing.
|
|
358
|
+
*/
|
|
359
|
+
warnings?: FileWarning[];
|
|
360
|
+
/**
|
|
361
|
+
* Errors that occurred during file processing or operation.
|
|
362
|
+
* These are fatal issues that prevented file processing.
|
|
363
|
+
*/
|
|
364
|
+
errors?: FileError[];
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Response object for creating a new file.
|
|
368
|
+
*/
|
|
369
|
+
interface AirtopFileCreateResponse {
|
|
370
|
+
/**
|
|
371
|
+
* The file data containing details such as the id, file name, type, and download URL.
|
|
372
|
+
* Includes all information about the file that was created.
|
|
373
|
+
*/
|
|
374
|
+
data: FileCreateData;
|
|
375
|
+
/**
|
|
376
|
+
* The metadata associated with the file operation.
|
|
377
|
+
* Contains information about the request that created the file.
|
|
378
|
+
*/
|
|
379
|
+
meta?: FileMetadata;
|
|
380
|
+
/**
|
|
381
|
+
* Warnings that occurred during file processing or operation.
|
|
382
|
+
* These are non-fatal issues that didn't prevent file processing.
|
|
383
|
+
*/
|
|
384
|
+
warnings?: FileWarning[];
|
|
385
|
+
/**
|
|
386
|
+
* Errors that occurred during file processing or operation.
|
|
387
|
+
* These are fatal issues that prevented file processing.
|
|
388
|
+
*/
|
|
389
|
+
errors?: FileError[];
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Response object for listing file information.
|
|
393
|
+
*/
|
|
394
|
+
interface AirtopFileListResponse {
|
|
395
|
+
/**
|
|
396
|
+
* The file data containing details such as the id, file name, type, and download URL.
|
|
397
|
+
* Includes all information about the file from the list operation.
|
|
398
|
+
*/
|
|
399
|
+
data: FileListData;
|
|
400
|
+
/**
|
|
401
|
+
* The metadata associated with the file operation.
|
|
402
|
+
* Contains information about the request that listed the file.
|
|
403
|
+
*/
|
|
404
|
+
meta?: FileMetadata;
|
|
405
|
+
/**
|
|
406
|
+
* Warnings that occurred during file processing or operation.
|
|
407
|
+
* These are non-fatal issues that didn't prevent file processing.
|
|
408
|
+
*/
|
|
409
|
+
warnings?: FileWarning[];
|
|
410
|
+
/**
|
|
411
|
+
* Errors that occurred during file processing or operation.
|
|
412
|
+
* These are fatal issues that prevented file processing.
|
|
413
|
+
*/
|
|
414
|
+
errors?: FileError[];
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Response object for listing files with AirtopFile instances.
|
|
418
|
+
* Note: The files array contains AirtopFile<AirtopFileListInfoResponse> instances.
|
|
419
|
+
*/
|
|
420
|
+
interface AirtopFileListWithInstancesResponse {
|
|
421
|
+
/**
|
|
422
|
+
* Pagination information for the file list.
|
|
423
|
+
*/
|
|
424
|
+
pagination: AirtopPagination;
|
|
425
|
+
/**
|
|
426
|
+
* Array of AirtopFile instances (typed as any to avoid circular reference).
|
|
427
|
+
* In practice, these are AirtopFile<AirtopFileListInfoResponse> instances.
|
|
428
|
+
*/
|
|
429
|
+
files: any[];
|
|
430
|
+
/**
|
|
431
|
+
* Errors that occurred during file listing.
|
|
432
|
+
*/
|
|
433
|
+
errors?: FileError[];
|
|
434
|
+
/**
|
|
435
|
+
* The metadata associated with the file listing operation.
|
|
436
|
+
*/
|
|
437
|
+
meta?: FileMetadata;
|
|
438
|
+
/**
|
|
439
|
+
* Warnings that occurred during file listing.
|
|
440
|
+
*/
|
|
441
|
+
warnings?: FileWarning[];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Represents a file in the Airtop system.
|
|
446
|
+
*/
|
|
447
|
+
declare class AirtopFile<Response extends CommonFileResponse> extends AirtopFileClient {
|
|
448
|
+
/**
|
|
449
|
+
* The file data containing details such as the id, file name, type, and download URL.
|
|
450
|
+
* Includes all information about the file that was processed or retrieved.
|
|
451
|
+
*/
|
|
452
|
+
data: Response["data"];
|
|
453
|
+
/**
|
|
454
|
+
* The metadata associated with the file operation.
|
|
455
|
+
* Contains information about the request that processed the file.
|
|
456
|
+
*/
|
|
457
|
+
meta: Response["meta"];
|
|
458
|
+
/**
|
|
459
|
+
* Warnings that occurred during file processing or operation.
|
|
460
|
+
* These are non-fatal issues that didn't prevent file processing.
|
|
461
|
+
*/
|
|
462
|
+
warnings: Response["warnings"];
|
|
463
|
+
/**
|
|
464
|
+
* Errors that occurred during file processing or operation.
|
|
465
|
+
* These are fatal issues that prevented file processing.
|
|
466
|
+
*/
|
|
467
|
+
errors: Response["errors"];
|
|
468
|
+
/**
|
|
469
|
+
* Creates a new AirtopFile instance.
|
|
470
|
+
* @param config - Common configuration options for the file
|
|
471
|
+
* @param fileData - File data
|
|
472
|
+
*/
|
|
473
|
+
constructor(config: CommonAirtopConfig, fileData: Response);
|
|
474
|
+
/**
|
|
475
|
+
* Returns response data as a JSON object.
|
|
476
|
+
*/
|
|
477
|
+
toJSON(): {
|
|
478
|
+
data: Response["data"];
|
|
479
|
+
meta: Response["meta"];
|
|
480
|
+
warnings: Response["warnings"];
|
|
481
|
+
errors: Response["errors"];
|
|
482
|
+
};
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Client for making file-specific requests to the Airtop API.
|
|
487
|
+
*/
|
|
488
|
+
declare class AirtopFileClient extends AirtopBase {
|
|
489
|
+
/**
|
|
490
|
+
* The file id
|
|
491
|
+
* @internal
|
|
492
|
+
*/
|
|
493
|
+
protected fileId: string;
|
|
494
|
+
/**
|
|
495
|
+
* Creates a new AirtopFileClient instance.
|
|
496
|
+
* @param config - Common configuration options
|
|
497
|
+
* @param fileId - File id
|
|
498
|
+
*/
|
|
499
|
+
constructor(config: CommonAirtopConfig, fileId: string);
|
|
500
|
+
/**
|
|
501
|
+
* Gets a file by ID.
|
|
502
|
+
* @param requestOptions
|
|
503
|
+
* @returns AirtopFile instance
|
|
504
|
+
*/
|
|
505
|
+
getFile(requestOptions?: AirtopRequestOptions): Promise<AirtopFile<AirtopFileGetResponse>>;
|
|
506
|
+
/**
|
|
507
|
+
* Removes a file by ID.
|
|
508
|
+
* @param requestOptions - Request options
|
|
509
|
+
*/
|
|
510
|
+
removeFile(requestOptions?: AirtopRequestOptions): Promise<void>;
|
|
511
|
+
}
|
|
512
|
+
|
|
222
513
|
/**
|
|
223
514
|
* The session data containing connection and state information.
|
|
224
515
|
* Includes details about the browser session and its configuration.
|
|
@@ -273,8 +564,89 @@ interface AirtopSessionResponse {
|
|
|
273
564
|
* Configuration parameters for retrieving a window.
|
|
274
565
|
* Excludes session ID which is provided by the parent session.
|
|
275
566
|
*/
|
|
567
|
+
/**
|
|
568
|
+
* File status event data structure.
|
|
569
|
+
* Represents the status of a file in the session.
|
|
570
|
+
*/
|
|
571
|
+
interface FileStatusEvent {
|
|
572
|
+
/**
|
|
573
|
+
* The type of event.
|
|
574
|
+
*/
|
|
575
|
+
event: "file_status";
|
|
576
|
+
/**
|
|
577
|
+
* The status of the file.
|
|
578
|
+
*/
|
|
579
|
+
status: "available" | "processing" | "error";
|
|
580
|
+
/**
|
|
581
|
+
* The ID of the file.
|
|
582
|
+
*/
|
|
583
|
+
fileId: string;
|
|
584
|
+
/**
|
|
585
|
+
* The download URL for the file (when status is 'available').
|
|
586
|
+
*/
|
|
587
|
+
downloadUrl?: string;
|
|
588
|
+
/**
|
|
589
|
+
* The timestamp when the event occurred.
|
|
590
|
+
*/
|
|
591
|
+
eventTime: string;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Configuration for the waitForDownload method.
|
|
595
|
+
*/
|
|
596
|
+
interface WaitForDownloadConfig {
|
|
597
|
+
/**
|
|
598
|
+
* The number of seconds to look back for prior events.
|
|
599
|
+
* Default is 5. 0 means no lookback.
|
|
600
|
+
*/
|
|
601
|
+
lookbackSeconds?: number;
|
|
602
|
+
/**
|
|
603
|
+
* The file type to wait for, such as "browser_download".
|
|
604
|
+
* If provided, only files of this type will be considered.
|
|
605
|
+
*/
|
|
606
|
+
fileType?: string;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Result of waiting for a file download.
|
|
610
|
+
*/
|
|
611
|
+
interface WaitForDownloadResult {
|
|
612
|
+
/**
|
|
613
|
+
* The ID of the file.
|
|
614
|
+
*/
|
|
615
|
+
id: string;
|
|
616
|
+
/**
|
|
617
|
+
* The download URL for the file.
|
|
618
|
+
*/
|
|
619
|
+
downloadUrl: string;
|
|
620
|
+
/**
|
|
621
|
+
* The name of the file.
|
|
622
|
+
*/
|
|
623
|
+
fileName?: string;
|
|
624
|
+
/**
|
|
625
|
+
* The type of the file.
|
|
626
|
+
*/
|
|
627
|
+
fileType?: string;
|
|
628
|
+
}
|
|
276
629
|
interface CreateFileConfig extends Omit<FileCreateFileParams, "sessionId" | "fileName"> {
|
|
277
630
|
}
|
|
631
|
+
/**
|
|
632
|
+
* Extended service prompt parameters that allow outputSchema to be either a string or an object.
|
|
633
|
+
* The SDK will automatically convert object schemas to JSON strings.
|
|
634
|
+
*/
|
|
635
|
+
interface ExtendedServicePromptParameters extends Omit<ServicePromptParameters, "outputSchema"> {
|
|
636
|
+
/**
|
|
637
|
+
* JSON schema for structured output. Can be provided as a JSON string or as an object.
|
|
638
|
+
* If provided as an object, it will be automatically stringified.
|
|
639
|
+
*
|
|
640
|
+
* Requirements: root must be object, all fields required, every object needs
|
|
641
|
+
* additionalProperties:false. No format/pattern keywords. Include 'error' field for failures.
|
|
642
|
+
*/
|
|
643
|
+
outputSchema?: string | Record<string, any>;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Response from a session service call.
|
|
647
|
+
*/
|
|
648
|
+
interface SessionServiceResponse extends ServicePromptActionResponseEnvelope {
|
|
649
|
+
}
|
|
278
650
|
|
|
279
651
|
/**
|
|
280
652
|
* Common data found in a window API call response.
|
|
@@ -287,6 +659,8 @@ interface CommonWindowResponse extends CommonResponse {
|
|
|
287
659
|
windowId: string;
|
|
288
660
|
};
|
|
289
661
|
}
|
|
662
|
+
interface WindowCreateOptions extends Omit<WindowCreateParams, "url"> {
|
|
663
|
+
}
|
|
290
664
|
/**
|
|
291
665
|
* The window data from creating a new window.
|
|
292
666
|
*/
|
|
@@ -382,18 +756,20 @@ interface WindowLoadUrlConfig extends Omit<WindowLoadURLParams, "sessionId" | "u
|
|
|
382
756
|
* Configuration parameters for monitoring window events.
|
|
383
757
|
* Excludes session ID which is provided by the parent session.
|
|
384
758
|
*/
|
|
385
|
-
interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId"> {
|
|
759
|
+
interface WindowMonitorConfig extends Omit<WindowMonitorParams, "sessionId" | "condition"> {
|
|
760
|
+
}
|
|
761
|
+
interface WindowPageQueryParamsBase extends DeepOmit<WindowPageQueryParams, "sessionId" | "prompt" | "configuration.outputSchema"> {
|
|
386
762
|
}
|
|
387
763
|
/**
|
|
388
764
|
* Configuration parameters for performing a natural language query on page content.
|
|
389
765
|
*/
|
|
390
|
-
|
|
766
|
+
type WindowPageQueryConfig = WindowPageQueryParamsBase & OutputJsonSchemaConfig;
|
|
767
|
+
interface WindowPaginatedExtractionParamsBase extends DeepOmit<WindowPaginatedExtractionParams, "sessionId" | "prompt" | "configuration.outputSchema"> {
|
|
391
768
|
}
|
|
392
769
|
/**
|
|
393
770
|
* Configuration parameters for extracting paginated data from a window.
|
|
394
771
|
*/
|
|
395
|
-
|
|
396
|
-
}
|
|
772
|
+
type WindowPaginatedExtractionConfig = WindowPaginatedExtractionParamsBase & OutputJsonSchemaConfig;
|
|
397
773
|
/**
|
|
398
774
|
* Configuration parameters for scraping content from a window.
|
|
399
775
|
* Excludes session ID which is provided by the parent session.
|
|
@@ -422,6 +798,172 @@ interface WindowPromptResponse extends AIPromptResponse {
|
|
|
422
798
|
*/
|
|
423
799
|
interface WindowScrapeResponse extends ScrapeResponse {
|
|
424
800
|
}
|
|
801
|
+
/**
|
|
802
|
+
* Configuration parameters for extracting content from a window.
|
|
803
|
+
*/
|
|
804
|
+
interface WindowExtractConfig extends Omit<WindowExtractParams, "sessionId" | "prompt" | "jobId"> {
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Extract window response.
|
|
808
|
+
*/
|
|
809
|
+
interface WindowExtractResponse extends ExtractActionResponseEnvelope {
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Configuration parameters for acting on content in a window.
|
|
813
|
+
*/
|
|
814
|
+
interface WindowActConfig extends Omit<WindowActParams, "sessionId" | "prompt" | "jobId"> {
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* Act window response.
|
|
818
|
+
*/
|
|
819
|
+
interface WindowActResponse extends ActActionResponseEnvelope {
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Configuration parameters for executing an LLM call in a window.
|
|
823
|
+
*/
|
|
824
|
+
interface WindowLlmConfig extends Omit<WindowLlmParams, "sessionId" | "jobId" | "prompt" | "includeWebContext" | "outputSchema"> {
|
|
825
|
+
outputSchema?: string | object;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* File metadata to be used by the llm for additional context
|
|
829
|
+
*/
|
|
830
|
+
interface WindowLlmFileContentData extends FileContentData {
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* LLM window response.
|
|
834
|
+
*/
|
|
835
|
+
interface WindowLlmResponse extends LlmActionResponseEnvelope {
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* Configuration parameters for finding one element in a window.
|
|
839
|
+
*/
|
|
840
|
+
interface WindowFindOneConfig extends Omit<WindowFindOneParams, "sessionId" | "prompt" | "jobId"> {
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* Find one window response.
|
|
844
|
+
*/
|
|
845
|
+
interface WindowFindOneResponse extends FindOneActionResponseEnvelope {
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Configuration parameters for finding multiple elements in a window.
|
|
849
|
+
*/
|
|
850
|
+
interface WindowFindManyConfig extends Omit<WindowFindManyParams, "sessionId" | "prompt" | "jobId"> {
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Find many window response.
|
|
854
|
+
*/
|
|
855
|
+
interface WindowFindManyResponse extends FindManyActionResponseEnvelope {
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Configuration parameters for waiting for a page to load in a window.
|
|
859
|
+
*/
|
|
860
|
+
interface WindowWaitForPageConfig extends Omit<WindowWaitForPageParams, "sessionId"> {
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* Wait for page window response.
|
|
864
|
+
*/
|
|
865
|
+
interface WindowWaitForPageResponse extends WaitForPageActionResponseEnvelope {
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Configuration parameters for navigating browser history in a window.
|
|
869
|
+
*/
|
|
870
|
+
interface WindowNavigateConfig extends Omit<WindowNavigateParams, "sessionId"> {
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Navigate window response.
|
|
874
|
+
*/
|
|
875
|
+
interface WindowNavigateResponse extends NavigateActionResponseEnvelope {
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
* The direction to navigate in browser history.
|
|
879
|
+
*/
|
|
880
|
+
declare enum WindowNavigateDirection {
|
|
881
|
+
BACK = "backward",
|
|
882
|
+
FORWARD = "forward"
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Data object representing a node returned from the Airtop API.
|
|
886
|
+
*/
|
|
887
|
+
interface AirtopNodeApiResponseData extends NodeHandle {
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Configuration parameters for filling a form in a window.
|
|
891
|
+
*/
|
|
892
|
+
interface WindowFillFormConfig extends Omit<WindowFillFormParams, "sessionId" | "parameters"> {
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Represents a node in the DOM
|
|
897
|
+
*/
|
|
898
|
+
declare class AirtopNode {
|
|
899
|
+
/**
|
|
900
|
+
* The window client
|
|
901
|
+
*/
|
|
902
|
+
protected windowClient: AirtopWindowClient;
|
|
903
|
+
/**
|
|
904
|
+
* The node handle id to use for all requests
|
|
905
|
+
*/
|
|
906
|
+
nodeHandleId: string;
|
|
907
|
+
/**
|
|
908
|
+
* The xpath selector of the node
|
|
909
|
+
*/
|
|
910
|
+
selector: string;
|
|
911
|
+
/**
|
|
912
|
+
* Constructor
|
|
913
|
+
* @param client - The window client
|
|
914
|
+
* @param nodeData - The node data to use for all requests
|
|
915
|
+
*/
|
|
916
|
+
constructor(client: AirtopWindowClient, nodeData: AirtopNodeApiResponseData);
|
|
917
|
+
/**
|
|
918
|
+
* Extract content from the node
|
|
919
|
+
* @param prompt - The prompt to use for the extraction
|
|
920
|
+
* @param config - The configuration to use for the extraction
|
|
921
|
+
* @param requestOptions - The request options to use for the extraction
|
|
922
|
+
*/
|
|
923
|
+
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
|
|
924
|
+
/**
|
|
925
|
+
* Act on the node
|
|
926
|
+
* @param prompt - The prompt to use for the action
|
|
927
|
+
* @param config - The configuration to use for the action
|
|
928
|
+
* @param requestOptions - The request options to use for the action
|
|
929
|
+
*/
|
|
930
|
+
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
|
|
931
|
+
/**
|
|
932
|
+
* Execute an LLM call on the node
|
|
933
|
+
* @param prompt - The prompt to use for the LLM call
|
|
934
|
+
* @param config - The configuration to use for the LLM call
|
|
935
|
+
* @param requestOptions - The request options to use for the LLM call
|
|
936
|
+
*/
|
|
937
|
+
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
|
|
938
|
+
/**
|
|
939
|
+
* Find one element in the node
|
|
940
|
+
* @param prompt - The prompt to use for the find one
|
|
941
|
+
* @param config - The configuration to use for the find one
|
|
942
|
+
* @param requestOptions - The request options to use for the find one
|
|
943
|
+
*/
|
|
944
|
+
findOne(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
|
|
945
|
+
/**
|
|
946
|
+
* Find one element in the node
|
|
947
|
+
* @param prompt - The prompt to use for the find one
|
|
948
|
+
* @param config - The configuration to use for the find one
|
|
949
|
+
* @param requestOptions - The request options to use for the find one
|
|
950
|
+
*/
|
|
951
|
+
findOneOptional(prompt: string, config?: WindowFindOneConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
|
|
952
|
+
/**
|
|
953
|
+
* Find many elements in the node
|
|
954
|
+
* @param prompt - The prompt to use for the find many
|
|
955
|
+
* @param config - The configuration to use for the find many
|
|
956
|
+
* @param requestOptions - The request options to use for the find many
|
|
957
|
+
*/
|
|
958
|
+
findMany(prompt: string, config?: WindowFindManyConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
|
959
|
+
/**
|
|
960
|
+
* Find many elements in the node
|
|
961
|
+
* @param prompt - The prompt to use for the find many
|
|
962
|
+
* @param config - The configuration to use for the find many
|
|
963
|
+
* @param requestOptions - The request options to use for the find many
|
|
964
|
+
*/
|
|
965
|
+
findManyOptional(prompt: string, config?: WindowFindManyConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
|
966
|
+
}
|
|
425
967
|
|
|
426
968
|
/**
|
|
427
969
|
* Response object for a screenshot operation.
|
|
@@ -460,10 +1002,10 @@ declare class AirtopWindowScreenshot {
|
|
|
460
1002
|
* Returns response data as a JSON object.
|
|
461
1003
|
*/
|
|
462
1004
|
toJSON(): {
|
|
463
|
-
data:
|
|
464
|
-
meta:
|
|
465
|
-
warnings:
|
|
466
|
-
errors:
|
|
1005
|
+
data: _airtop_core_resources_js.AIResponseEnvelope;
|
|
1006
|
+
meta: _airtop_core_resources_js.ExternalSessionAIResponseMetadata;
|
|
1007
|
+
warnings: _airtop_core_resources_js.Issue[];
|
|
1008
|
+
errors: _airtop_core_resources_js.Issue[];
|
|
467
1009
|
};
|
|
468
1010
|
}
|
|
469
1011
|
|
|
@@ -584,7 +1126,19 @@ declare class AirtopWindowClient extends AirtopBase {
|
|
|
584
1126
|
* @param requestOptions - Request options
|
|
585
1127
|
* @returns Promise resolving when the text has been typed
|
|
586
1128
|
*/
|
|
587
|
-
type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<
|
|
1129
|
+
type(text: string, config?: WindowTypeConfig, requestOptions?: AirtopRequestOptions): Promise<WindowPromptResponse>;
|
|
1130
|
+
extract(prompt: string, config?: WindowExtractConfig, requestOptions?: AirtopRequestOptions): Promise<WindowExtractResponse>;
|
|
1131
|
+
act(prompt: string, config?: WindowActConfig, requestOptions?: AirtopRequestOptions): Promise<WindowActResponse>;
|
|
1132
|
+
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
|
|
1133
|
+
private findOnePrivate;
|
|
1134
|
+
findOne(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode>;
|
|
1135
|
+
findOneOptional(prompt: string, config?: Omit<WindowFindOneConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode | null>;
|
|
1136
|
+
private findManyPrivate;
|
|
1137
|
+
findMany(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
|
1138
|
+
findManyOptional(prompt: string, config?: Omit<WindowFindManyConfig, "optional">, requestOptions?: AirtopRequestOptions): Promise<AirtopNode[]>;
|
|
1139
|
+
waitForPage(config?: WindowWaitForPageConfig, requestOptions?: AirtopRequestOptions): Promise<WindowWaitForPageResponse>;
|
|
1140
|
+
navigate(direction: WindowNavigateDirection, config?: WindowNavigateConfig, requestOptions?: AirtopRequestOptions): Promise<WindowNavigateResponse>;
|
|
1141
|
+
fillForm(formData: string | object, config?: WindowFillFormConfig, requestOptions?: AirtopRequestOptions): Promise<AIPromptResponse>;
|
|
588
1142
|
}
|
|
589
1143
|
|
|
590
1144
|
/**
|
|
@@ -637,7 +1191,7 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
|
637
1191
|
*/
|
|
638
1192
|
protected sessionId: string;
|
|
639
1193
|
/**
|
|
640
|
-
* Creates a new
|
|
1194
|
+
* Creates a new AirtopSessionClient instance.
|
|
641
1195
|
* @param config - Common configuration options for the session
|
|
642
1196
|
* @param sessionId - Browser session id
|
|
643
1197
|
*/
|
|
@@ -646,6 +1200,7 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
|
646
1200
|
* Returns the browser session ID.
|
|
647
1201
|
*/
|
|
648
1202
|
getSessionId(): string;
|
|
1203
|
+
listWindows(requestOptions?: AirtopRequestOptions): Promise<WindowsResponse>;
|
|
649
1204
|
/**
|
|
650
1205
|
* Gets the state of the session using the attached session id.
|
|
651
1206
|
* @param requestOptions - Request options
|
|
@@ -674,7 +1229,7 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
|
674
1229
|
* @param requestOptions - Request options
|
|
675
1230
|
* @returns A new AirtopWindow<AirtopWindowCreateResponse> instance
|
|
676
1231
|
*/
|
|
677
|
-
createWindow(url: string, requestOptions?: AirtopRequestOptions): Promise<AirtopWindow<AirtopWindowCreateResponse>>;
|
|
1232
|
+
createWindow(url: string, createOptions?: WindowCreateOptions, requestOptions?: AirtopRequestOptions): Promise<AirtopWindow<AirtopWindowCreateResponse>>;
|
|
678
1233
|
/**
|
|
679
1234
|
* Returns a window client instance for making window-based requests for a given window id.
|
|
680
1235
|
*
|
|
@@ -686,8 +1241,54 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
|
686
1241
|
* @param fileName - The name of the file to create
|
|
687
1242
|
* @param config - Additional configuration options for creating the file
|
|
688
1243
|
* @param requestOptions - Request options
|
|
1244
|
+
* @returns AirtopFile instance
|
|
1245
|
+
*/
|
|
1246
|
+
createFile(fileName: string, config?: CreateFileConfig, requestOptions?: AirtopRequestOptions): Promise<AirtopFile<AirtopFileCreateResponse>>;
|
|
1247
|
+
llm(prompt: string, config?: WindowLlmConfig, requestOptions?: AirtopRequestOptions): Promise<WindowLlmResponse>;
|
|
1248
|
+
/**
|
|
1249
|
+
* Calls the service endpoint with a string prompt.
|
|
1250
|
+
* @param prompt - Natural language description of the task to perform with third-party services (e.g., "read data from Google Sheets", "create a HubSpot lead", "update this document")
|
|
1251
|
+
* @param service - The service id or array of service ids that will be leveraged to achieve the intent of the prompt
|
|
1252
|
+
* @param requestOptions - Request options
|
|
1253
|
+
* @deprecated Use `service(args: ExtendedServicePromptParameters, requestOptions?: AirtopRequestOptions)` instead
|
|
1254
|
+
*/
|
|
1255
|
+
service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
|
1256
|
+
/**
|
|
1257
|
+
* Calls the service endpoint with ExtendedServicePromptParameters.
|
|
1258
|
+
* @param parameters - The service parameters object
|
|
1259
|
+
* @param requestOptions - Request options
|
|
689
1260
|
*/
|
|
690
|
-
|
|
1261
|
+
service(parameters: ExtendedServicePromptParameters, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
|
1262
|
+
/**
|
|
1263
|
+
* Retrieves the list of connected services available for the current session.
|
|
1264
|
+
* @param requestOptions - Request options
|
|
1265
|
+
* @returns A promise that resolves to the connected services response containing service details
|
|
1266
|
+
* @deprecated Use `getConnectedServices({ options, requestOptions })` instead
|
|
1267
|
+
*/
|
|
1268
|
+
getConnectedServices(requestOptions?: AirtopRequestOptions): Promise<ConnectedServicesActionResponseEnvelope>;
|
|
1269
|
+
/**
|
|
1270
|
+
* Retrieves the list of connected services available for the current session.
|
|
1271
|
+
* @param config - Configuration object containing options and requestOptions
|
|
1272
|
+
* @param config.options - Query parameters for filtering connected services
|
|
1273
|
+
* @param config.requestOptions - Request options
|
|
1274
|
+
* @returns A promise that resolves to the connected services response containing service details
|
|
1275
|
+
*/
|
|
1276
|
+
getConnectedServices(config: {
|
|
1277
|
+
options?: SessionGetConnectedServicesParams;
|
|
1278
|
+
requestOptions?: AirtopRequestOptions;
|
|
1279
|
+
}): Promise<ConnectedServicesActionResponseEnvelope>;
|
|
1280
|
+
/**
|
|
1281
|
+
* Waits for a file to be downloaded in a session and reach 'available' status.
|
|
1282
|
+
* Defaults to looking back 5 seconds in the event stream for the file to be available.
|
|
1283
|
+
* Use `lookbackSeconds` to control this behavior.
|
|
1284
|
+
*
|
|
1285
|
+
* @param configuration - The optional configuration parameters for the function
|
|
1286
|
+
* @param configuration.lookbackSeconds - The number of seconds to look back for prior events. Default `5`. 0 means no lookback.
|
|
1287
|
+
* @param configuration.fileType - The file type to wait for, such as "browser_download". If provided, only files of this type will be considered.
|
|
1288
|
+
* @param requestOptions - Optional request configuration including timeout
|
|
1289
|
+
* @returns Object containing file's id and downloadUrl, or null if timed out
|
|
1290
|
+
*/
|
|
1291
|
+
waitForDownload(configuration?: WaitForDownloadConfig, requestOptions?: AirtopRequestOptions): Promise<WaitForDownloadResult | null>;
|
|
691
1292
|
}
|
|
692
1293
|
|
|
693
1294
|
/**
|
|
@@ -787,6 +1388,11 @@ declare class AirtopClient extends AirtopBase {
|
|
|
787
1388
|
* @param sessionId - The session ID to attach to the AirtopSessionClient instance
|
|
788
1389
|
**/
|
|
789
1390
|
withSessionId(sessionId: string): AirtopSessionClient;
|
|
1391
|
+
/**
|
|
1392
|
+
* Returns a file client instance for making file-based requests for a given file id.
|
|
1393
|
+
* @param fileId - The file ID to attach to the AirtopFileClient instance
|
|
1394
|
+
*/
|
|
1395
|
+
withFileId(fileId: string): AirtopFileClient;
|
|
790
1396
|
/**
|
|
791
1397
|
* Retrieves the status of a request.
|
|
792
1398
|
* @param requestId - ID of the request to check
|
|
@@ -795,23 +1401,12 @@ declare class AirtopClient extends AirtopBase {
|
|
|
795
1401
|
*/
|
|
796
1402
|
getRequestStatus(requestId: string, requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.RequestStatusResponse>;
|
|
797
1403
|
/**
|
|
798
|
-
*
|
|
799
|
-
* @param
|
|
800
|
-
* @param requestOptions
|
|
801
|
-
*/
|
|
802
|
-
getFile(fileId: string, requestOptions?: AirtopRequestOptions): Promise<AirtopFileResponse>;
|
|
803
|
-
/**
|
|
804
|
-
* Removes a file by ID.
|
|
805
|
-
* @param fileId - ID of the file to remove
|
|
1404
|
+
* List files
|
|
1405
|
+
* @param query - File list parameters
|
|
806
1406
|
* @param requestOptions - Request options
|
|
1407
|
+
* @returns Object containing pagination info and array of AirtopFile instances
|
|
807
1408
|
*/
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* Lists files
|
|
811
|
-
* @param query
|
|
812
|
-
* @param requestOptions
|
|
813
|
-
*/
|
|
814
|
-
getFiles(query: AirtopFileListParams, requestOptions?: AirtopRequestOptions): Promise<AirtopFilesResponse>;
|
|
1409
|
+
listFiles(query: AirtopFileListParams, requestOptions?: AirtopRequestOptions): Promise<AirtopFileListWithInstancesResponse>;
|
|
815
1410
|
/**
|
|
816
1411
|
* List all automations
|
|
817
1412
|
* @param requestOptions - Request options
|
|
@@ -831,6 +1426,182 @@ declare class AirtopClient extends AirtopBase {
|
|
|
831
1426
|
removeAutomation(automationID: string, requestOptions?: AirtopRequestOptions): _airtop_core.APIPromise<unknown>;
|
|
832
1427
|
}
|
|
833
1428
|
|
|
1429
|
+
/**
|
|
1430
|
+
* Provides utility methods for creating mock instances of Airtop classes.
|
|
1431
|
+
* @hideconstructor
|
|
1432
|
+
*/
|
|
1433
|
+
declare class AirtopMocks {
|
|
1434
|
+
/**
|
|
1435
|
+
* Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.
|
|
1436
|
+
*/
|
|
1437
|
+
static getAirtopBaseMock(config?: Partial<CommonAirtopConfig>): AirtopBase;
|
|
1438
|
+
/**
|
|
1439
|
+
* Creates an Airtop instance with a mock client and data.
|
|
1440
|
+
*/
|
|
1441
|
+
static getAirtopClientMock(config?: Partial<AirtopConstructorConfig>): AirtopClient;
|
|
1442
|
+
/**
|
|
1443
|
+
* Creates an AirtopSession instance with a mock client and data.
|
|
1444
|
+
*/
|
|
1445
|
+
static getAirtopSessionMock(responseData?: Partial<AirtopSessionResponse>): AirtopSession;
|
|
1446
|
+
/**
|
|
1447
|
+
* Creates an AirtopWindow instance with a mock client and data.
|
|
1448
|
+
*/
|
|
1449
|
+
static getAirtopWindowMock({ sessionId, windowData, }?: {
|
|
1450
|
+
sessionId?: string;
|
|
1451
|
+
windowData?: AirtopWindowGetInfoResponse;
|
|
1452
|
+
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
interface AirtopAgentCreateAgentParams extends Airtop.AgentCreateAgentParams {
|
|
1456
|
+
}
|
|
1457
|
+
interface AirtopAgentGetAgentParams extends Airtop.AgentGetAgentParams {
|
|
1458
|
+
}
|
|
1459
|
+
interface AirtopAgentGetAgentsParams extends Airtop.AgentGetAgentsParams {
|
|
1460
|
+
}
|
|
1461
|
+
interface AirtopAgentUpdateAgentParams extends Airtop.AgentUpdateAgentParams {
|
|
1462
|
+
}
|
|
1463
|
+
interface AirtopAgentDeleteAgentsParams extends Airtop.AgentDeleteAgentsParams {
|
|
1464
|
+
}
|
|
1465
|
+
interface AirtopAgentCreateInvocationParams extends Airtop.AgentCreateInvocationParams {
|
|
1466
|
+
}
|
|
1467
|
+
interface AirtopAgentGetInvocationsParams extends Airtop.AgentGetInvocationsParams {
|
|
1468
|
+
}
|
|
1469
|
+
interface AirtopAgentCancelInvocationParams extends Omit<Airtop.AgentCancelInvocationParams, "id"> {
|
|
1470
|
+
}
|
|
1471
|
+
interface AirtopAgentGetVersionDataParams extends Airtop.AgentGetCurrentAgentVersionParams {
|
|
1472
|
+
}
|
|
1473
|
+
interface AirtopAgentUpdateVersionDataParams extends Omit<Airtop.AgentUpdateAgentVersionDataParams, "id"> {
|
|
1474
|
+
}
|
|
1475
|
+
interface AirtopAgentPublishAgentParams extends Airtop.AgentPublishAgentParams {
|
|
1476
|
+
}
|
|
1477
|
+
interface AirtopCreateAgentResponse extends Airtop.CreateAgentResponse {
|
|
1478
|
+
}
|
|
1479
|
+
interface AirtopGetAgentResponse extends Airtop.GetAgentResponse {
|
|
1480
|
+
}
|
|
1481
|
+
interface AirtopGetAgentsResponse extends Airtop.GetAgentsResponse {
|
|
1482
|
+
}
|
|
1483
|
+
interface AirtopUpdateAgentResponse extends Airtop.UpdateAgentResponse {
|
|
1484
|
+
}
|
|
1485
|
+
interface AirtopDeleteAgentsResponse extends Airtop.DeleteResponse {
|
|
1486
|
+
}
|
|
1487
|
+
interface AirtopCreateAgentInvocationResponse extends Airtop.CreateAgentInvocationResponse {
|
|
1488
|
+
}
|
|
1489
|
+
interface AirtopGetAgentInvocationsResponse extends Airtop.GetAgentInvocationsResponse {
|
|
1490
|
+
}
|
|
1491
|
+
interface AirtopAgentResponse extends Airtop.GetAgentResponse {
|
|
1492
|
+
}
|
|
1493
|
+
interface AirtopCreateNewAgentDraftResponse extends Airtop.AgentCreateDraftResponse {
|
|
1494
|
+
}
|
|
1495
|
+
interface AirtopPublishNewAgentResponse extends Airtop.AgentPublishDraftResponse {
|
|
1496
|
+
}
|
|
1497
|
+
interface AirtopGetAgentVersionDataResponse extends Airtop.AgentGetVersionDataResponse {
|
|
1498
|
+
}
|
|
1499
|
+
interface AirtopUpdateVersionDataResponse extends Airtop.AgentUpdateVersionDataResponse {
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* Client for making Agent-specific requests to the Airtop API.
|
|
1504
|
+
*/
|
|
1505
|
+
declare class AirtopAgentClient extends AirtopBase {
|
|
1506
|
+
/**
|
|
1507
|
+
* Creates a new instance of the Airtop SDK.
|
|
1508
|
+
* @param config - Configuration options for the Airtop SDK
|
|
1509
|
+
*/
|
|
1510
|
+
constructor(config: AirtopConstructorConfig);
|
|
1511
|
+
/**
|
|
1512
|
+
* Creates a new agent. A new draft version is created by default.
|
|
1513
|
+
* @param params - Parameters for creating the agent.
|
|
1514
|
+
* @param requestOptions - Request options.
|
|
1515
|
+
* @returns The created agent data.
|
|
1516
|
+
*/
|
|
1517
|
+
createAgent(params: AirtopAgentCreateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentResponse>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Retrieves a specific agent by its ID.
|
|
1520
|
+
* @param agentId - The ID of the agent to retrieve.
|
|
1521
|
+
* @param requestOptions - Request options.
|
|
1522
|
+
* @returns The agent data.
|
|
1523
|
+
*/
|
|
1524
|
+
getAgent(agentId: string, params?: AirtopAgentGetAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentResponse>;
|
|
1525
|
+
/**
|
|
1526
|
+
* Lists agents.
|
|
1527
|
+
* @param params - Optional parameters for listing agents (e.g., pagination).
|
|
1528
|
+
* @param requestOptions - Request options.
|
|
1529
|
+
* @returns A list of agents.
|
|
1530
|
+
*/
|
|
1531
|
+
listAgents(params?: AirtopAgentGetAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentsResponse>;
|
|
1532
|
+
/**
|
|
1533
|
+
* Creates a new draft version of an agent. If one already exists, does nothing.
|
|
1534
|
+
* @param agentId - The ID of the agent for which to create a new draft version.
|
|
1535
|
+
* @param requestOptions - Request options.
|
|
1536
|
+
* @returns The draft version data.
|
|
1537
|
+
*/
|
|
1538
|
+
createNewAgentDraftVersion(agentId: string, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateNewAgentDraftResponse>;
|
|
1539
|
+
/**
|
|
1540
|
+
* Publishes a new version of an agent from the current draft.
|
|
1541
|
+
* @param agentId - The ID of the agent to publish.
|
|
1542
|
+
* @returns The published version data
|
|
1543
|
+
*/
|
|
1544
|
+
publishNewAgentVersion(agentId: string, params?: AirtopAgentPublishAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopPublishNewAgentResponse>;
|
|
1545
|
+
/**
|
|
1546
|
+
* Retrieves the data for a specific version of an agent.
|
|
1547
|
+
* @param agentId - The ID of the agent.
|
|
1548
|
+
* @param version - The version number of the agent to retrieve.
|
|
1549
|
+
* @param requestOptions - Request options.
|
|
1550
|
+
* @returns The agent version data.
|
|
1551
|
+
*/
|
|
1552
|
+
getAgentVersionData(agentId: string, version: number, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentVersionDataResponse>;
|
|
1553
|
+
updateAgentVersionData(agentId: string, version: number, params: AirtopAgentUpdateVersionDataParams, requestOptions?: AirtopRequestOptions): Promise<AirtopUpdateVersionDataResponse>;
|
|
1554
|
+
/**
|
|
1555
|
+
* Retrieves the current version data of an agent. This is the version that is currently active or in draft state.
|
|
1556
|
+
* @param agentId - The ID of the agent.
|
|
1557
|
+
* @param params - Optional parameters for retrieving the version data.
|
|
1558
|
+
* @param requestOptions - Request options.
|
|
1559
|
+
* @returns The current agent version data
|
|
1560
|
+
*/
|
|
1561
|
+
getCurrentAgentVersionData(agentId: string, params?: AirtopAgentGetVersionDataParams, requestOptions?: AirtopRequestOptions): Promise<_airtop_core_resources_shared_mjs.AgentGetCurrentVersionDataResponse>;
|
|
1562
|
+
/**
|
|
1563
|
+
* Updates an existing agent.
|
|
1564
|
+
* @param agentId - The ID of the agent to update.
|
|
1565
|
+
* @param params - The new data for the agent.
|
|
1566
|
+
* @param requestOptions - Request options.
|
|
1567
|
+
* @returns The updated agent data.
|
|
1568
|
+
*/
|
|
1569
|
+
updateAgent(agentId: string, params: AirtopAgentUpdateAgentParams, requestOptions?: AirtopRequestOptions): Promise<AirtopUpdateAgentResponse>;
|
|
1570
|
+
/**
|
|
1571
|
+
* Deletes one or more agents.
|
|
1572
|
+
* @param params - Parameters for deleting agents.
|
|
1573
|
+
* @param requestOptions - Request options.
|
|
1574
|
+
* @returns A response confirming the deletion.
|
|
1575
|
+
*/
|
|
1576
|
+
deleteAgents(params: AirtopAgentDeleteAgentsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopDeleteAgentsResponse>;
|
|
1577
|
+
/**
|
|
1578
|
+
* Creates an invocation for an agent.
|
|
1579
|
+
* @param agentId - The ID of the agent for which to create an invocation.
|
|
1580
|
+
* @param params - Parameters for creating the agent invocation.
|
|
1581
|
+
* @param requestOptions - Request options.
|
|
1582
|
+
* @returns The created agent invocation data.
|
|
1583
|
+
*/
|
|
1584
|
+
createAgentInvocation(agentId: string, params: AirtopAgentCreateInvocationParams, requestOptions?: AirtopRequestOptions): Promise<AirtopCreateAgentInvocationResponse>;
|
|
1585
|
+
/**
|
|
1586
|
+
* Lists invocations of an agent.
|
|
1587
|
+
* @param agentIds - The ID of the agent whose invocations to list.
|
|
1588
|
+
* @param params - Optional parameters for listing agent invocations.
|
|
1589
|
+
* @param requestOptions - Request options.
|
|
1590
|
+
* @returns A list of agent invocations.
|
|
1591
|
+
*/
|
|
1592
|
+
listAgentInvocations(agentIds: string, // Renamed
|
|
1593
|
+
params?: AirtopAgentGetInvocationsParams, requestOptions?: AirtopRequestOptions): Promise<AirtopGetAgentInvocationsResponse>;
|
|
1594
|
+
/**
|
|
1595
|
+
* Cancels a specific invocation of an agent.
|
|
1596
|
+
* @param agentId - The ID of the agent.
|
|
1597
|
+
* @param invocationId - The ID of the invocation to cancel.
|
|
1598
|
+
* @param paramsBody - Optional body parameters for cancelling the invocation.
|
|
1599
|
+
* @param requestOptions - Request options.
|
|
1600
|
+
* @returns A promise that resolves when the operation is complete.
|
|
1601
|
+
*/
|
|
1602
|
+
cancelAgentInvocation(agentId: string, invocationId: string, paramsBody?: AirtopAgentCancelInvocationParams, requestOptions?: AirtopRequestOptions): Promise<void>;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
834
1605
|
/**
|
|
835
1606
|
* Enumeration of available plugin augmentation types.
|
|
836
1607
|
* Determines which part of the SDK a plugin can extend.
|
|
@@ -999,30 +1770,4 @@ interface AirtopPluginRegistration {
|
|
|
999
1770
|
*/
|
|
1000
1771
|
declare function registerAirtopPlugin(plugin: AirtopPluginRegistration): void;
|
|
1001
1772
|
|
|
1002
|
-
|
|
1003
|
-
* Provides utility methods for creating mock instances of Airtop classes.
|
|
1004
|
-
* @hideconstructor
|
|
1005
|
-
*/
|
|
1006
|
-
declare class AirtopMocks {
|
|
1007
|
-
/**
|
|
1008
|
-
* Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.
|
|
1009
|
-
*/
|
|
1010
|
-
static getAirtopBaseMock(config?: Partial<CommonAirtopConfig>): AirtopBase;
|
|
1011
|
-
/**
|
|
1012
|
-
* Creates an Airtop instance with a mock client and data.
|
|
1013
|
-
*/
|
|
1014
|
-
static getAirtopClientMock(config?: Partial<AirtopConstructorConfig>): AirtopClient;
|
|
1015
|
-
/**
|
|
1016
|
-
* Creates an AirtopSession instance with a mock client and data.
|
|
1017
|
-
*/
|
|
1018
|
-
static getAirtopSessionMock(responseData?: Partial<AirtopSessionResponse>): AirtopSession;
|
|
1019
|
-
/**
|
|
1020
|
-
* Creates an AirtopWindow instance with a mock client and data.
|
|
1021
|
-
*/
|
|
1022
|
-
static getAirtopWindowMock({ sessionId, windowData, }?: {
|
|
1023
|
-
sessionId?: string;
|
|
1024
|
-
windowData?: AirtopWindowGetInfoResponse;
|
|
1025
|
-
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
export { type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, AirtopMocks, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionWarning, type WindowClickConfig, type WindowCreateData, type WindowError, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWarning, registerAirtopPlugin };
|
|
1773
|
+
export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentGetAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionDataParams, type AirtopAgentPublishAgentParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAgentUpdateVersionDataParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateNewAgentDraftResponse, type AirtopDeleteAgentsResponse, AirtopError, AirtopFile, AirtopFileClient, type AirtopFileCreateResponse, type AirtopFileGetResponse, type AirtopFileListParams, type AirtopFileListResponse, type AirtopFileListWithInstancesResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionDataResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopPublishNewAgentResponse, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, type AirtopUpdateVersionDataResponse, AirtopWindow, AirtopWindowClient, type AirtopWindowClientPlugin, type AirtopWindowCreateResponse, type AirtopWindowGetInfoResponse, type AirtopWindowPlugin, AirtopWindowScreenshot, type AirtopWindowScreenshotPlugin, type AirtopWindowScreenshotResponse, type CommonAirtopConfig, type CommonFileResponse, type CommonResponse, type CommonWindowResponse, type CreateFileConfig, type CreateSessionConfig, type ExtendedServicePromptParameters, type FileCreateData, type FileData, type FileError, type FileListData, type FileMetadata, type FileStatusEvent, type FileWarning, type GetFilesConfig, type GetSessionsConfig, type OutputJsonSchemaConfig, type ScreenshotData, type SessionData, type SessionError, type SessionMetadata, type SessionServiceResponse, type SessionWarning, type WaitForDownloadConfig, type WaitForDownloadResult, type WindowActConfig, type WindowActResponse, type WindowClickConfig, type WindowCreateData, type WindowCreateOptions, type WindowError, type WindowExtractConfig, type WindowExtractResponse, type WindowFillFormConfig, type WindowFindManyConfig, type WindowFindManyResponse, type WindowFindOneConfig, type WindowFindOneResponse, type WindowGetConfig, type WindowHoverConfig, type WindowInfoData, type WindowLlmConfig, type WindowLlmFileContentData, type WindowLlmResponse, type WindowLoadUrlConfig, type WindowMetadata, type WindowMonitorConfig, type WindowNavigateConfig, WindowNavigateDirection, type WindowNavigateResponse, type WindowPageQueryConfig, type WindowPaginatedExtractionConfig, type WindowPromptResponse, type WindowScrapeConfig, type WindowScrapeResponse, type WindowScreenshotConfig, type WindowScrollConfig, type WindowTypeConfig, type WindowWaitForPageConfig, type WindowWaitForPageResponse, type WindowWarning, registerAirtopPlugin };
|