@airtop/sdk 1.0.0-alpha2.18 → 1.0.0-alpha2.19
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 +72 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -4
- package/dist/index.d.ts +26 -4
- package/dist/index.js +59 -53
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
@@ -5,13 +5,16 @@ export { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
|
|
5
5
|
import { ILogLayer } from 'loglayer';
|
6
6
|
export { ILogLayer } from 'loglayer';
|
7
7
|
import * as _airtop_core_resources_shared_js from '@airtop/core/resources/shared.js';
|
8
|
-
import { Issue, SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, ExternalSessionWithConnectionInfo, EnvelopeDefaultMeta, ExtractActionResponseEnvelope, ActActionResponseEnvelope, LlmActionResponseEnvelope, NodeHandle, WaitForPageActionResponseEnvelope, NavigateActionResponseEnvelope, FindOneActionResponseEnvelope, FindManyActionResponseEnvelope, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } from '@airtop/core/resources/shared.js';
|
9
|
-
export { AIResponseEnvelope, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } from '@airtop/core/resources/shared.js';
|
8
|
+
import { Issue, SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, ServicePromptActionResponseEnvelope, ExternalSessionWithConnectionInfo, EnvelopeDefaultMeta, ExtractActionResponseEnvelope, ActActionResponseEnvelope, LlmActionResponseEnvelope, NodeHandle, WaitForPageActionResponseEnvelope, NavigateActionResponseEnvelope, FindOneActionResponseEnvelope, FindManyActionResponseEnvelope, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } from '@airtop/core/resources/shared.js';
|
9
|
+
export { AIResponseEnvelope, ActActionResponseData, AgentInvocationData, AgentVersionData, AirtopPagination, AsyncConfig, AsyncSessionAIResponseEnvelope, BrowserWaitNavigationConfig, ClickConfig, ClientProvidedResponseMetadata, CreateFileData, EnvelopeDefaultMeta, ExternalSessionAIResponseMetadata, ExternalSessionAIResponseMetadataUsage, ExternalSessionConfig, ExternalSessionWithConnectionInfo, ExtractActionResponseData, FindManyActionResponseData, FindOneActionResponseData, GetFileData, IntervalMonitorConfig, Issue, LlmActionResponseData, MicroInteractionConfig, 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 } from '@airtop/core/resources/shared.js';
|
10
10
|
import * as _airtop_core_resources_shared_mjs from '@airtop/core/resources/shared.mjs';
|
11
11
|
import { AutomationUpdateDescriptionParams } from '@airtop/core/resources/automations.js';
|
12
12
|
import { SessionListParams, ProfileOutput, FileListParams, FileCreateFileParams, WindowIDData, EnvelopeDefaultMeta as EnvelopeDefaultMeta$1, Issue as Issue$1, WindowInfo, WindowGetParams, AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
|
13
|
+
export { AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
|
13
14
|
import * as _airtop_core_resources_sessions_mjs from '@airtop/core/resources/sessions.mjs';
|
14
15
|
import { WindowClickParams, WindowHoverParams, WindowLoadURLParams, WindowMonitorParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams, WindowFillFormParams } from '@airtop/core/resources/windows.js';
|
16
|
+
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';
|
17
|
+
export { DeepOmit } from 'deep-utility-types';
|
15
18
|
|
16
19
|
/**
|
17
20
|
* Shared configuration between Airtop classes.
|
@@ -45,6 +48,10 @@ interface CommonAirtopConfig {
|
|
45
48
|
* Used to send event data to external systems during automation execution.
|
46
49
|
*/
|
47
50
|
agentEventPublisher?: ILogLayer;
|
51
|
+
/**
|
52
|
+
* The default timeout in seconds for API requests.
|
53
|
+
*/
|
54
|
+
defaultTimeoutInSeconds?: number;
|
48
55
|
}
|
49
56
|
/**
|
50
57
|
* Configuration for defining the JSON schema output.
|
@@ -125,6 +132,11 @@ declare class AirtopBase {
|
|
125
132
|
* @internal
|
126
133
|
*/
|
127
134
|
protected agentEventPublisher?: ILogLayer;
|
135
|
+
/**
|
136
|
+
* The default timeout in seconds for API requests.
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
protected defaultTimeoutInSeconds: number;
|
128
140
|
/**
|
129
141
|
* Creates a new instance of AirtopBase
|
130
142
|
* @param config - Configuration options for the SDK
|
@@ -229,6 +241,11 @@ interface AirtopConstructorConfig {
|
|
229
241
|
* Used to send event data to external systems during automation execution.
|
230
242
|
*/
|
231
243
|
agentEventPublisher?: ILogLayer;
|
244
|
+
/**
|
245
|
+
* The default timeout in seconds for API requests.
|
246
|
+
* Defaults to 5 minutes if not specified.
|
247
|
+
*/
|
248
|
+
defaultTimeoutInSeconds?: number;
|
232
249
|
}
|
233
250
|
/**
|
234
251
|
* Configuration options for creating a new session.
|
@@ -324,6 +341,11 @@ interface AirtopSessionResponse {
|
|
324
341
|
*/
|
325
342
|
interface CreateFileConfig extends Omit<FileCreateFileParams, "sessionId" | "fileName"> {
|
326
343
|
}
|
344
|
+
/**
|
345
|
+
* Response from a session service call.
|
346
|
+
*/
|
347
|
+
interface SessionServiceResponse extends ServicePromptActionResponseEnvelope {
|
348
|
+
}
|
327
349
|
|
328
350
|
/**
|
329
351
|
* Common data found in a window API call response.
|
@@ -918,7 +940,7 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
918
940
|
* @param service - The service to call, if not provided, the service will be inferred from the prompt
|
919
941
|
* @param requestOptions - Request options
|
920
942
|
*/
|
921
|
-
service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<
|
943
|
+
service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
922
944
|
}
|
923
945
|
|
924
946
|
/**
|
@@ -1402,4 +1424,4 @@ declare class AirtopMocks {
|
|
1402
1424
|
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
1403
1425
|
}
|
1404
1426
|
|
1405
|
-
export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, 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 WindowActConfig, type WindowActResponse, type WindowClickConfig, type WindowCreateData, 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 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 };
|
1427
|
+
export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, 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 SessionServiceResponse, type SessionWarning, type WindowActConfig, type WindowActResponse, type WindowClickConfig, type WindowCreateData, 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 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 };
|
package/dist/index.d.ts
CHANGED
@@ -5,13 +5,16 @@ export { AirtopJsonSchemaAdapter } from '@airtop/json-schema-adapter';
|
|
5
5
|
import { ILogLayer } from 'loglayer';
|
6
6
|
export { ILogLayer } from 'loglayer';
|
7
7
|
import * as _airtop_core_resources_shared_js from '@airtop/core/resources/shared.js';
|
8
|
-
import { Issue, SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, ExternalSessionWithConnectionInfo, EnvelopeDefaultMeta, ExtractActionResponseEnvelope, ActActionResponseEnvelope, LlmActionResponseEnvelope, NodeHandle, WaitForPageActionResponseEnvelope, NavigateActionResponseEnvelope, FindOneActionResponseEnvelope, FindManyActionResponseEnvelope, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } from '@airtop/core/resources/shared.js';
|
9
|
-
export { AIResponseEnvelope, AirtopPagination, ExternalSessionAIResponseMetadata, ExternalSessionWithConnectionInfo, Issue, OperationOutcomeResponse, WindowIDDataResponse } from '@airtop/core/resources/shared.js';
|
8
|
+
import { Issue, SessionConfigV1, GetFileResponse, FilesResponse, ListAutomationsOutput, AutomationData, ServicePromptActionResponseEnvelope, ExternalSessionWithConnectionInfo, EnvelopeDefaultMeta, ExtractActionResponseEnvelope, ActActionResponseEnvelope, LlmActionResponseEnvelope, NodeHandle, WaitForPageActionResponseEnvelope, NavigateActionResponseEnvelope, FindOneActionResponseEnvelope, FindManyActionResponseEnvelope, AIPromptResponse as AIPromptResponse$1, WindowIDDataResponse, OperationOutcomeResponse } from '@airtop/core/resources/shared.js';
|
9
|
+
export { AIResponseEnvelope, ActActionResponseData, AgentInvocationData, AgentVersionData, AirtopPagination, AsyncConfig, AsyncSessionAIResponseEnvelope, BrowserWaitNavigationConfig, ClickConfig, ClientProvidedResponseMetadata, CreateFileData, EnvelopeDefaultMeta, ExternalSessionAIResponseMetadata, ExternalSessionAIResponseMetadataUsage, ExternalSessionConfig, ExternalSessionWithConnectionInfo, ExtractActionResponseData, FindManyActionResponseData, FindOneActionResponseData, GetFileData, IntervalMonitorConfig, Issue, LlmActionResponseData, MicroInteractionConfig, 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 } from '@airtop/core/resources/shared.js';
|
10
10
|
import * as _airtop_core_resources_shared_mjs from '@airtop/core/resources/shared.mjs';
|
11
11
|
import { AutomationUpdateDescriptionParams } from '@airtop/core/resources/automations.js';
|
12
12
|
import { SessionListParams, ProfileOutput, FileListParams, FileCreateFileParams, WindowIDData, EnvelopeDefaultMeta as EnvelopeDefaultMeta$1, Issue as Issue$1, WindowInfo, WindowGetParams, AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
|
13
|
+
export { AIPromptResponse, ScrapeResponse } from '@airtop/core/resources/index.js';
|
13
14
|
import * as _airtop_core_resources_sessions_mjs from '@airtop/core/resources/sessions.mjs';
|
14
15
|
import { WindowClickParams, WindowHoverParams, WindowLoadURLParams, WindowMonitorParams, WindowScrapeParams, WindowScreenshotParams, WindowScrollParams, WindowTypeParams, WindowExtractParams, WindowActParams, WindowLlmParams, WindowFindOneParams, WindowFindManyParams, WindowWaitForPageParams, WindowNavigateParams, WindowFillFormParams } from '@airtop/core/resources/windows.js';
|
16
|
+
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';
|
17
|
+
export { DeepOmit } from 'deep-utility-types';
|
15
18
|
|
16
19
|
/**
|
17
20
|
* Shared configuration between Airtop classes.
|
@@ -45,6 +48,10 @@ interface CommonAirtopConfig {
|
|
45
48
|
* Used to send event data to external systems during automation execution.
|
46
49
|
*/
|
47
50
|
agentEventPublisher?: ILogLayer;
|
51
|
+
/**
|
52
|
+
* The default timeout in seconds for API requests.
|
53
|
+
*/
|
54
|
+
defaultTimeoutInSeconds?: number;
|
48
55
|
}
|
49
56
|
/**
|
50
57
|
* Configuration for defining the JSON schema output.
|
@@ -125,6 +132,11 @@ declare class AirtopBase {
|
|
125
132
|
* @internal
|
126
133
|
*/
|
127
134
|
protected agentEventPublisher?: ILogLayer;
|
135
|
+
/**
|
136
|
+
* The default timeout in seconds for API requests.
|
137
|
+
* @internal
|
138
|
+
*/
|
139
|
+
protected defaultTimeoutInSeconds: number;
|
128
140
|
/**
|
129
141
|
* Creates a new instance of AirtopBase
|
130
142
|
* @param config - Configuration options for the SDK
|
@@ -229,6 +241,11 @@ interface AirtopConstructorConfig {
|
|
229
241
|
* Used to send event data to external systems during automation execution.
|
230
242
|
*/
|
231
243
|
agentEventPublisher?: ILogLayer;
|
244
|
+
/**
|
245
|
+
* The default timeout in seconds for API requests.
|
246
|
+
* Defaults to 5 minutes if not specified.
|
247
|
+
*/
|
248
|
+
defaultTimeoutInSeconds?: number;
|
232
249
|
}
|
233
250
|
/**
|
234
251
|
* Configuration options for creating a new session.
|
@@ -324,6 +341,11 @@ interface AirtopSessionResponse {
|
|
324
341
|
*/
|
325
342
|
interface CreateFileConfig extends Omit<FileCreateFileParams, "sessionId" | "fileName"> {
|
326
343
|
}
|
344
|
+
/**
|
345
|
+
* Response from a session service call.
|
346
|
+
*/
|
347
|
+
interface SessionServiceResponse extends ServicePromptActionResponseEnvelope {
|
348
|
+
}
|
327
349
|
|
328
350
|
/**
|
329
351
|
* Common data found in a window API call response.
|
@@ -918,7 +940,7 @@ declare class AirtopSessionClient extends AirtopBase {
|
|
918
940
|
* @param service - The service to call, if not provided, the service will be inferred from the prompt
|
919
941
|
* @param requestOptions - Request options
|
920
942
|
*/
|
921
|
-
service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<
|
943
|
+
service(prompt: string, service?: string, requestOptions?: AirtopRequestOptions): Promise<SessionServiceResponse>;
|
922
944
|
}
|
923
945
|
|
924
946
|
/**
|
@@ -1402,4 +1424,4 @@ declare class AirtopMocks {
|
|
1402
1424
|
}): AirtopWindow<AirtopWindowGetInfoResponse>;
|
1403
1425
|
}
|
1404
1426
|
|
1405
|
-
export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, 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 WindowActConfig, type WindowActResponse, type WindowClickConfig, type WindowCreateData, 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 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 };
|
1427
|
+
export { type AirtopAgentCancelInvocationParams, AirtopAgentClient, type AirtopAgentCreateAgentParams, type AirtopAgentCreateInvocationParams, type AirtopAgentCreateVersionParams, type AirtopAgentDeleteAgentsParams, type AirtopAgentDuplicateAgentParams, type AirtopAgentGetAgentsParams, type AirtopAgentGetInvocationsParams, type AirtopAgentGetVersionsParams, type AirtopAgentResponse, type AirtopAgentUpdateAgentParams, type AirtopAutomationData, type AirtopAutomationListResponse, type AirtopAutomationUpdateDescriptionConfig, AirtopBase, AirtopClient, type AirtopClientPlugin, type AirtopConstructorConfig, type AirtopCreateAgentInvocationResponse, type AirtopCreateAgentResponse, type AirtopCreateAgentVersionResponse, type AirtopDeleteAgentsResponse, type AirtopDuplicateAgentResponse, AirtopError, type AirtopFileListParams, type AirtopFileResponse, type AirtopFilesResponse, type AirtopGetAgentInvocationsResponse, type AirtopGetAgentResponse, type AirtopGetAgentVersionsResponse, type AirtopGetAgentsResponse, AirtopMocks, AirtopNode, type AirtopNodeApiResponseData, AirtopPluginAugmentationType, type AirtopPluginRegistration, type AirtopPluginType, type AirtopProfile, type AirtopRequestOptions, AirtopSession, AirtopSessionClient, type AirtopSessionClientPlugin, type AirtopSessionPlugin, type AirtopSessionResponse, type AirtopUpdateAgentResponse, 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 SessionServiceResponse, type SessionWarning, type WindowActConfig, type WindowActResponse, type WindowClickConfig, type WindowCreateData, 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 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 };
|
package/dist/index.js
CHANGED
@@ -9,7 +9,7 @@ var require_package = __commonJS({
|
|
9
9
|
module.exports = {
|
10
10
|
name: "@airtop/sdk",
|
11
11
|
description: "Airtop SDK for TypeScript",
|
12
|
-
version: "1.0.0-alpha2.
|
12
|
+
version: "1.0.0-alpha2.19",
|
13
13
|
type: "module",
|
14
14
|
main: "./dist/index.cjs",
|
15
15
|
module: "./dist/index.js",
|
@@ -47,7 +47,7 @@ var require_package = __commonJS({
|
|
47
47
|
},
|
48
48
|
dependencies: {
|
49
49
|
"@airtop/json-schema-adapter": "workspace:*",
|
50
|
-
"@airtop/core": "0.1.0-alpha.
|
50
|
+
"@airtop/core": "0.1.0-alpha.34",
|
51
51
|
"date-fns": "4.1.0",
|
52
52
|
loglayer: "6.3.3",
|
53
53
|
"serialize-error": "12.0.0",
|
@@ -86,6 +86,12 @@ var require_package = __commonJS({
|
|
86
86
|
|
87
87
|
// src/AirtopBase.ts
|
88
88
|
import { secondsToMilliseconds } from "date-fns";
|
89
|
+
|
90
|
+
// src/constants.ts
|
91
|
+
var TIMEOUT_SECONDS_DEFAULT_VALUE = 300;
|
92
|
+
var DEFAULT_POLLING_INTERVAL_MS = 500;
|
93
|
+
|
94
|
+
// src/AirtopBase.ts
|
89
95
|
var AirtopBase = class {
|
90
96
|
/**
|
91
97
|
* Logger instance for the SDK
|
@@ -112,6 +118,11 @@ var AirtopBase = class {
|
|
112
118
|
* @internal
|
113
119
|
*/
|
114
120
|
agentEventPublisher;
|
121
|
+
/**
|
122
|
+
* The default timeout in seconds for API requests.
|
123
|
+
* @internal
|
124
|
+
*/
|
125
|
+
defaultTimeoutInSeconds;
|
115
126
|
/**
|
116
127
|
* Creates a new instance of AirtopBase
|
117
128
|
* @param config - Configuration options for the SDK
|
@@ -121,6 +132,7 @@ var AirtopBase = class {
|
|
121
132
|
this.client = config.client;
|
122
133
|
this.outputJsonAdapter = config.outputSchemaAdapter;
|
123
134
|
this.jobId = config.jobId;
|
135
|
+
this.defaultTimeoutInSeconds = config.defaultTimeoutInSeconds ?? TIMEOUT_SECONDS_DEFAULT_VALUE;
|
124
136
|
if (config.agentEventPublisher) {
|
125
137
|
this.agentEventPublisher = config.agentEventPublisher;
|
126
138
|
}
|
@@ -209,7 +221,7 @@ var AirtopBase = class {
|
|
209
221
|
*/
|
210
222
|
resolveRequestOptions(options = {}) {
|
211
223
|
return {
|
212
|
-
timeout: secondsToMilliseconds(options.timeoutInSeconds ||
|
224
|
+
timeout: secondsToMilliseconds(options.timeoutInSeconds || this.defaultTimeoutInSeconds),
|
213
225
|
maxRetries: options.maxRetries || 0,
|
214
226
|
signal: options.abortSignal
|
215
227
|
};
|
@@ -218,7 +230,7 @@ var AirtopBase = class {
|
|
218
230
|
|
219
231
|
// src/AirtopClient.ts
|
220
232
|
import { Airtop as AirtopCore } from "@airtop/core";
|
221
|
-
import {
|
233
|
+
import { secondsToMilliseconds as secondsToMilliseconds3 } from "date-fns/secondsToMilliseconds";
|
222
234
|
import { ConsoleTransport, LogLayer } from "loglayer";
|
223
235
|
import { serializeError } from "serialize-error";
|
224
236
|
|
@@ -268,7 +280,6 @@ var processLogMessage = (log, logLevel, ...args) => {
|
|
268
280
|
|
269
281
|
// src/session/AirtopSessionClient.ts
|
270
282
|
import { NotFoundError } from "@airtop/core";
|
271
|
-
import { secondsToMilliseconds as secondsToMilliseconds4 } from "date-fns";
|
272
283
|
|
273
284
|
// src/async-utils.ts
|
274
285
|
import { secondsToMilliseconds as secondsToMilliseconds2 } from "date-fns";
|
@@ -288,11 +299,9 @@ ${JSON.stringify(metadata)}` : errorMessage;
|
|
288
299
|
};
|
289
300
|
|
290
301
|
// src/async-utils.ts
|
291
|
-
var DEFAULT_TIMEOUT_SECONDS = 300;
|
292
|
-
var DEFAULT_POLLING_INTERVAL_MS = 500;
|
293
302
|
async function waitForRequestCompletion(client, requestId, requestOptions) {
|
294
303
|
const startTime = Date.now();
|
295
|
-
const timeoutMs = secondsToMilliseconds2(requestOptions?.timeoutInSeconds ||
|
304
|
+
const timeoutMs = secondsToMilliseconds2(requestOptions?.timeoutInSeconds || TIMEOUT_SECONDS_DEFAULT_VALUE);
|
296
305
|
while (Date.now() - startTime < timeoutMs) {
|
297
306
|
const apiResponse = await client.requests.getRequestStatusV2(requestId, requestOptions);
|
298
307
|
if (apiResponse.status === "completed") {
|
@@ -319,9 +328,6 @@ async function withRequestCompletionPolling(client, fn, requestOptions) {
|
|
319
328
|
}
|
320
329
|
}
|
321
330
|
|
322
|
-
// src/window/AirtopWindowClient.ts
|
323
|
-
import { secondsToMilliseconds as secondsToMilliseconds3 } from "date-fns";
|
324
|
-
|
325
331
|
// src/window/AirtopNode.ts
|
326
332
|
var AirtopNode = class {
|
327
333
|
/**
|
@@ -598,7 +604,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
598
604
|
sessionId: this.sessionId
|
599
605
|
},
|
600
606
|
{
|
601
|
-
timeout: secondsToMilliseconds3(600),
|
602
607
|
...this.resolveRequestOptions(requestOptions)
|
603
608
|
}
|
604
609
|
)
|
@@ -633,7 +638,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
633
638
|
...config || {}
|
634
639
|
},
|
635
640
|
{
|
636
|
-
timeout: secondsToMilliseconds3(600),
|
637
641
|
...this.resolveRequestOptions(requestOptions)
|
638
642
|
}
|
639
643
|
)
|
@@ -658,7 +662,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
658
662
|
...config
|
659
663
|
},
|
660
664
|
{
|
661
|
-
timeout: secondsToMilliseconds3(600),
|
662
665
|
...this.resolveRequestOptions(requestOptions)
|
663
666
|
}
|
664
667
|
);
|
@@ -670,8 +673,20 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
670
673
|
* @param requestOptions - Request options
|
671
674
|
* @returns Promise resolving to the monitoring operation result
|
672
675
|
*/
|
673
|
-
async monitor(condition, config, requestOptions = {}) {
|
676
|
+
async monitor(condition, config = {}, requestOptions = {}) {
|
674
677
|
this.log.withMetadata().info("Monitoring window");
|
678
|
+
if (!config?.configuration?.interval?.timeoutSeconds) {
|
679
|
+
if (!config.configuration) {
|
680
|
+
config.configuration = {};
|
681
|
+
}
|
682
|
+
if (!config.configuration.interval) {
|
683
|
+
config.configuration.interval = {};
|
684
|
+
}
|
685
|
+
config.configuration.interval.timeoutSeconds = this.defaultTimeoutInSeconds;
|
686
|
+
}
|
687
|
+
if (!config?.timeThresholdSeconds) {
|
688
|
+
config.timeThresholdSeconds = this.defaultTimeoutInSeconds;
|
689
|
+
}
|
675
690
|
return withRequestCompletionPolling(
|
676
691
|
this.client,
|
677
692
|
() => this.client.windows.monitorAsync(
|
@@ -682,7 +697,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
682
697
|
...config || {}
|
683
698
|
},
|
684
699
|
{
|
685
|
-
timeout: secondsToMilliseconds3(600),
|
686
700
|
...this.resolveRequestOptions(requestOptions)
|
687
701
|
}
|
688
702
|
)
|
@@ -713,7 +727,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
713
727
|
...newConfig || {}
|
714
728
|
},
|
715
729
|
{
|
716
|
-
timeout: secondsToMilliseconds3(600),
|
717
730
|
...this.resolveRequestOptions(requestOptions)
|
718
731
|
}
|
719
732
|
)
|
@@ -744,7 +757,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
744
757
|
...newConfig || {}
|
745
758
|
},
|
746
759
|
{
|
747
|
-
timeout: secondsToMilliseconds3(600),
|
748
760
|
...this.resolveRequestOptions(requestOptions)
|
749
761
|
}
|
750
762
|
)
|
@@ -758,16 +770,18 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
758
770
|
*/
|
759
771
|
async scrape(config, requestOptions = {}) {
|
760
772
|
this.log.info("Scraping window");
|
761
|
-
return
|
762
|
-
this.
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
773
|
+
return withRequestCompletionPolling(
|
774
|
+
this.client,
|
775
|
+
() => this.client.windows.scrapeAsync(
|
776
|
+
this.getWindowId(),
|
777
|
+
{
|
778
|
+
sessionId: this.sessionId,
|
779
|
+
...config || {}
|
780
|
+
},
|
781
|
+
{
|
782
|
+
...this.resolveRequestOptions(requestOptions)
|
783
|
+
}
|
784
|
+
)
|
771
785
|
);
|
772
786
|
}
|
773
787
|
/**
|
@@ -787,7 +801,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
787
801
|
...config || {}
|
788
802
|
},
|
789
803
|
{
|
790
|
-
timeout: secondsToMilliseconds3(600),
|
791
804
|
...this.resolveRequestOptions(requestOptions)
|
792
805
|
}
|
793
806
|
)
|
@@ -802,16 +815,18 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
802
815
|
*/
|
803
816
|
async scroll(config, requestOptions = {}) {
|
804
817
|
this.log.info("Scrolling window");
|
805
|
-
return
|
806
|
-
this.
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
818
|
+
return withRequestCompletionPolling(
|
819
|
+
this.client,
|
820
|
+
() => this.client.windows.scrollAsync(
|
821
|
+
this.getWindowId(),
|
822
|
+
{
|
823
|
+
sessionId: this.sessionId,
|
824
|
+
...config || {}
|
825
|
+
},
|
826
|
+
{
|
827
|
+
...this.resolveRequestOptions(requestOptions)
|
828
|
+
}
|
829
|
+
)
|
815
830
|
);
|
816
831
|
}
|
817
832
|
/**
|
@@ -835,7 +850,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
835
850
|
...config || {}
|
836
851
|
},
|
837
852
|
{
|
838
|
-
timeout: secondsToMilliseconds3(600),
|
839
853
|
...this.resolveRequestOptions(requestOptions)
|
840
854
|
}
|
841
855
|
)
|
@@ -854,7 +868,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
854
868
|
...config || {}
|
855
869
|
},
|
856
870
|
{
|
857
|
-
timeout: secondsToMilliseconds3(600),
|
858
871
|
...this.resolveRequestOptions(requestOptions)
|
859
872
|
}
|
860
873
|
)
|
@@ -873,7 +886,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
873
886
|
...config || {}
|
874
887
|
},
|
875
888
|
{
|
876
|
-
timeout: secondsToMilliseconds3(600),
|
877
889
|
...this.resolveRequestOptions(requestOptions)
|
878
890
|
}
|
879
891
|
)
|
@@ -895,7 +907,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
895
907
|
outputSchema: config?.outputSchema ? this.convertToJsonSchema(config.outputSchema) : void 0
|
896
908
|
},
|
897
909
|
{
|
898
|
-
timeout: secondsToMilliseconds3(600),
|
899
910
|
...this.resolveRequestOptions(requestOptions)
|
900
911
|
}
|
901
912
|
)
|
@@ -914,7 +925,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
914
925
|
...config || {}
|
915
926
|
},
|
916
927
|
{
|
917
|
-
timeout: secondsToMilliseconds3(600),
|
918
928
|
...this.resolveRequestOptions(requestOptions)
|
919
929
|
}
|
920
930
|
)
|
@@ -953,7 +963,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
953
963
|
...config || {}
|
954
964
|
},
|
955
965
|
{
|
956
|
-
timeout: secondsToMilliseconds3(600),
|
957
966
|
...this.resolveRequestOptions(requestOptions)
|
958
967
|
}
|
959
968
|
)
|
@@ -983,7 +992,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
983
992
|
...config || {}
|
984
993
|
},
|
985
994
|
{
|
986
|
-
timeout: secondsToMilliseconds3(600),
|
987
995
|
...this.resolveRequestOptions(requestOptions)
|
988
996
|
}
|
989
997
|
)
|
@@ -1001,7 +1009,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
1001
1009
|
...config || {}
|
1002
1010
|
},
|
1003
1011
|
{
|
1004
|
-
timeout: secondsToMilliseconds3(600),
|
1005
1012
|
...this.resolveRequestOptions(requestOptions)
|
1006
1013
|
}
|
1007
1014
|
)
|
@@ -1022,7 +1029,6 @@ var AirtopWindowClient = class extends AirtopBase {
|
|
1022
1029
|
}
|
1023
1030
|
},
|
1024
1031
|
{
|
1025
|
-
timeout: secondsToMilliseconds3(600),
|
1026
1032
|
...this.resolveRequestOptions(requestOptions)
|
1027
1033
|
}
|
1028
1034
|
)
|
@@ -1247,7 +1253,6 @@ var AirtopSessionClient = class extends AirtopBase {
|
|
1247
1253
|
outputSchema: config?.outputSchema ? this.convertToJsonSchema(config.outputSchema) : void 0
|
1248
1254
|
},
|
1249
1255
|
{
|
1250
|
-
timeout: secondsToMilliseconds4(600),
|
1251
1256
|
...this.resolveRequestOptions(requestOptions)
|
1252
1257
|
}
|
1253
1258
|
)
|
@@ -1328,7 +1333,7 @@ var AirtopClient = class extends AirtopBase {
|
|
1328
1333
|
logLevel: config?.logLevel,
|
1329
1334
|
client: new AirtopCore({
|
1330
1335
|
maxRetries: 0,
|
1331
|
-
timeout:
|
1336
|
+
timeout: secondsToMilliseconds3(config.defaultTimeoutInSeconds ?? TIMEOUT_SECONDS_DEFAULT_VALUE),
|
1332
1337
|
apiKey: config.apiKey,
|
1333
1338
|
baseURL: config?.airtopUrl,
|
1334
1339
|
logLevel: config?.logLevel || "off",
|
@@ -1350,7 +1355,8 @@ var AirtopClient = class extends AirtopBase {
|
|
1350
1355
|
}),
|
1351
1356
|
outputSchemaAdapter: config.outputSchemaAdapter,
|
1352
1357
|
jobId: config.jobId,
|
1353
|
-
agentEventPublisher: config.agentEventPublisher
|
1358
|
+
agentEventPublisher: config.agentEventPublisher,
|
1359
|
+
defaultTimeoutInSeconds: config.defaultTimeoutInSeconds ?? TIMEOUT_SECONDS_DEFAULT_VALUE
|
1354
1360
|
});
|
1355
1361
|
this.log.withPrefix("[Airtop SDK]");
|
1356
1362
|
this.client.logLevel = config.logLevel;
|
@@ -1573,7 +1579,7 @@ function registerAirtopPlugin(plugin) {
|
|
1573
1579
|
// src/agent/AirtopAgentClient.ts
|
1574
1580
|
import { version as version2 } from "node:process";
|
1575
1581
|
import { Airtop as AirtopCore2 } from "@airtop/core";
|
1576
|
-
import { minutesToMilliseconds
|
1582
|
+
import { minutesToMilliseconds } from "date-fns";
|
1577
1583
|
import { ConsoleTransport as ConsoleTransport2 } from "loglayer";
|
1578
1584
|
import { LogLayer as LogLayer2 } from "loglayer";
|
1579
1585
|
import { serializeError as serializeError2 } from "serialize-error";
|
@@ -1587,7 +1593,7 @@ var AirtopAgentClient = class extends AirtopBase {
|
|
1587
1593
|
logLevel: config?.logLevel,
|
1588
1594
|
client: new AirtopCore2({
|
1589
1595
|
maxRetries: 0,
|
1590
|
-
timeout:
|
1596
|
+
timeout: minutesToMilliseconds(1),
|
1591
1597
|
apiKey: config.apiKey,
|
1592
1598
|
baseURL: config?.airtopUrl,
|
1593
1599
|
logLevel: config?.logLevel || "off",
|