@airtop/sdk 1.0.0-alpha2.4 → 1.0.0-alpha2.6
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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
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.6",
|
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.24",
|
51
51
|
"date-fns": "4.1.0",
|
52
52
|
loglayer: "6.3.3",
|
53
53
|
"serialize-error": "12.0.0",
|
@@ -1012,11 +1012,11 @@ var AirtopClient = class extends AirtopBase {
|
|
1012
1012
|
return this.client.files.delete(fileId, this.resolveRequestOptions(requestOptions));
|
1013
1013
|
}
|
1014
1014
|
/**
|
1015
|
-
*
|
1015
|
+
* List files
|
1016
1016
|
* @param query
|
1017
1017
|
* @param requestOptions
|
1018
1018
|
*/
|
1019
|
-
async
|
1019
|
+
async listFiles(query, requestOptions = {}) {
|
1020
1020
|
return this.client.files.list(query, this.resolveRequestOptions(requestOptions));
|
1021
1021
|
}
|
1022
1022
|
/**
|
package/dist/index.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/airtop-sdk/airtop-sdk/typescript/sdk/dist/index.cjs","../package.json","../src/AirtopBase.ts","../src/AirtopClient.ts","../src/logger-utils.ts","../src/session/AirtopSessionClient.ts","../src/window/AirtopWindowClient.ts","../src/window/AirtopWindowScreenshot.ts","../src/window/AirtopWindow.ts","../src/session/AirtopSession.ts","../src/plugin/AirtopPlugin.types.ts","../src/plugin/AirtopPlugin.ts","../src/AirtopMocks.ts"],"names":["secondsToMilliseconds","AirtopPluginAugmentationType","AirtopCore"],"mappings":"AAAA,qrBAAI,kBAAkB,EAAE,MAAM,CAAC,mBAAmB;AAClD,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,SAAS,SAAS,CAAC,EAAE;AACnD,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO;AACpG,CAAC;AACD;AACA;ACLA,IAAA,gBAAA,EAAA,UAAA,CAAA;AAAA,EAAA,cAAA,CAAA,OAAA,EAAA,MAAA,EAAA;AAAA,IAAA,MAAA,CAAA,QAAA,EAAA;AAAA,MACE,IAAA,EAAQ,aAAA;AAAA,MACR,WAAA,EAAe,2BAAA;AAAA,MACf,OAAA,EAAW,gBAAA;AAAA,MACX,IAAA,EAAQ,QAAA;AAAA,MACR,IAAA,EAAQ,kBAAA;AAAA,MACR,MAAA,EAAU,iBAAA;AAAA,MACV,OAAA,EAAW;AAAA,QACT,MAAA,EAAU;AAAA,UACR,KAAA,EAAS,mBAAA;AAAA,UACT,MAAA,EAAU;AAAA,QACZ,CAAA;AAAA,QACA,OAAA,EAAW;AAAA,UACT,KAAA,EAAS,oBAAA;AAAA,UACT,OAAA,EAAW;AAAA,QACb;AAAA,MACF,CAAA;AAAA,MACA,KAAA,EAAS,mBAAA;AAAA,MAC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AoB;AAAA,IACzB,SAAA;AAAA,IACA;AAAA,EACF,EAAA,EAGI,CAAC,CAAA,EAA8C;AACjD,IAAA,OAAO,IAAI,YAAA,CAAa,8BAAA,CAA+B,CAAA,EAAG,UAAA,GAAa,sBAAA,CAAO,EAAG;AAAA,MAC/E,IAAA,EAAM;AAAA,QACJ,QAAA,EAAU,sBAAA,CAAO;AAAA,QACjB,QAAA,EAAU,sBAAA,CAAO;AAAA,QACjB,WAAA,EAAa;AAAA,MACf,CAAA;AAAA,MACA,IAAA,EAAM,CAAC,CAAA;AAAA,MACP,QAAA,EAAU,CAAC,CAAA;AAAA,MACX,GAAI,WAAA,GAAc,CAAC;AAAA,IACrB,CAAC,CAAA;AAAA,EACH;AACF,CAAA;AZkhCA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,2cAAC","file":"/home/runner/work/airtop-sdk/airtop-sdk/typescript/sdk/dist/index.cjs","sourcesContent":[null,"{\n \"name\": \"@airtop/sdk\",\n \"description\": \"Airtop SDK for TypeScript\",\n \"version\": \"1.0.0-alpha2.4\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"exports\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"require\": \"./dist/index.cjs\"\n }\n },\n \"types\": \"./dist/index.d.ts\",\n \"license\": \"MIT\",\n \"repository\": \"airtop-ai/airtop-sdk.git\",\n \"author\": \"Theo Gravity <theo@airtop.ai>\",\n \"keywords\": [\n \"airtop\",\n \"browser automation\",\n \"ai\",\n \"playwright\",\n \"puppeteer\",\n \"selenium\",\n \"web scraping\",\n \"agentic\"\n ],\n \"scripts\": {\n \"build:second-stage\": \"tsup src/index.ts\",\n \"test:e2e\": \"vitest --run\",\n \"build:dev\": \"node_modules/.bin/hash-runner\",\n \"clean\": \"rm -rf .turbo node_modules dist\",\n \"lint\": \"biome check --write --unsafe src && biome format src --write && biome lint src --fix\",\n \"verify-types\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@airtop/json-schema-adapter\": \"workspace:*\",\n \"@airtop/core\": \"0.1.0-alpha.22\",\n \"date-fns\": \"4.1.0\",\n \"loglayer\": \"6.3.3\",\n \"serialize-error\": \"12.0.0\",\n \"uuid\": \"11.1.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"1.9.4\",\n \"@dotenvx/dotenvx\": \"1.39.0\",\n \"@internal/tsconfig\": \"workspace:*\",\n \"deep-utility-types\": \"1.3.1\",\n \"env-var\": \"7.5.0\",\n \"hash-runner\": \"2.0.1\",\n \"nanoid\": \"5.1.5\",\n \"tsup\": \"8.4.0\",\n \"typescript\": \"5.8.2\",\n \"utility-types\": \"3.11.0\",\n \"uuid\": \"11.1.0\",\n \"vitest\": \"3.1.1\",\n \"zod\": \"*\"\n },\n \"bugs\": \"https://github.com/airtop-ai/airtop-sdk/issues\",\n \"engines\": {\n \"node\": \">=18\"\n },\n \"files\": [\n \"dist\"\n ],\n \"homepage\": \"https://airtop.ai\",\n \"optionalDependencies\": {\n \"@airtop/json-schema-adapter-zod\": \"workspace:*\"\n },\n \"packageManager\": \"pnpm@10.5.0\"\n}\n","import type { Airtop as AirtopCore } from \"@airtop/core\";\n/**\n * Import required types and utilities\n */\nimport type { AirtopJsonSchemaAdapter } from \"@airtop/json-schema-adapter\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport type { ILogLayer } from \"loglayer\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"./types.js\";\n\n/**\n * Base class for Airtop SDK implementation\n * Provides common functionality for JSON schema conversion, error handling, and request configuration\n * @hidden\n */\nexport class AirtopBase {\n /**\n * Logger instance for the SDK\n * @internal\n **/\n protected log: ILogLayer;\n /**\n * Airtop Core SDK client instance\n * @internal\n **/\n protected client: AirtopCore;\n\n /**\n * JSON schema adapter for output conversion\n * @internal\n **/\n protected outputJsonAdapter: AirtopJsonSchemaAdapter;\n\n /**\n * Creates a new instance of AirtopBase\n * @param config - Configuration options for the SDK\n */\n constructor(config: CommonAirtopConfig) {\n this.log = config.log.withPrefix(\"[Airtop]\");\n this.client = config.client;\n this.outputJsonAdapter = config.outputSchemaAdapter;\n }\n\n /**\n * Returns the API key used by the SDK\n * @returns API key string\n */\n getApiKey() {\n return this.client.apiKey;\n }\n\n /**\n * Sets the base URL for the Airtop API.\n * @param airtopUrl - The base URL for the Airtop API\n */\n setAirtopUrl(airtopUrl: string) {\n this.client.baseURL = airtopUrl;\n }\n\n /**\n * Sets the API key for authentication.\n * @param apiKey - The API key to use for authentication\n */\n setApiKey(apiKey: string) {\n this.client.apiKey = apiKey;\n }\n\n /**\n * Returns the LogLayer logger instance used by the SDK\n * @returns Logger instance\n * @see {@link https://loglayer.dev | LogLayer Documentation}\n */\n getLogger() {\n return this.log;\n }\n\n /**\n * Converts input data to JSON schema format\n * @param input - Data to be converted (schema input, string, or object)\n * @returns JSON string representation of the input\n * @internal\n */\n protected convertToJsonSchema(input?: any): string {\n if (input && this.outputJsonAdapter?.shouldRunConversion(input)) {\n return JSON.stringify(this.outputJsonAdapter.toJsonSchema(input));\n }\n\n if (typeof input === \"object\") {\n return JSON.stringify(input);\n }\n\n return input as string;\n }\n\n /**\n * Returns the common configuration used by the SDK\n * @returns Common configuration object\n * @internal\n */\n protected getCommonConfig(): CommonAirtopConfig {\n return {\n client: this.client,\n log: this.log,\n };\n }\n\n /**\n * Translates the request options to ones used by the Core SDK\n * @param options - Request options to be resolved\n * @returns Resolved request options with defaults\n * @internal\n */\n protected resolveRequestOptions(options: AirtopRequestOptions = {}) {\n return {\n timeout: secondsToMilliseconds(options.timeoutInSeconds || 60),\n maxRetries: options.maxRetries || 0,\n signal: options.abortSignal,\n };\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { minutesToMilliseconds } from \"date-fns/minutesToMilliseconds\";\nimport { ConsoleTransport, LogLayer } from \"loglayer\";\nimport { serializeError } from \"serialize-error\";\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport type {\n AirtopAutomationData,\n AirtopAutomationListResponse,\n AirtopAutomationUpdateDescriptionConfig,\n AirtopConstructorConfig,\n AirtopFileListParams,\n AirtopFileResponse,\n AirtopFilesResponse,\n AirtopProfile,\n CreateSessionConfig,\n GetSessionsConfig,\n} from \"./AirtopClient.types.js\";\nimport { processLogMessage } from \"./logger-utils.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport { AirtopSessionClient } from \"./session/AirtopSessionClient.js\";\nimport type { AirtopRequestOptions } from \"./types.js\";\n\nconst version = require(\"../package.json\").version;\n\n/**\n * Main Airtop SDK class that provides functionality for managing sessions, profiles, and windows.\n */\nexport class AirtopClient extends AirtopBase {\n /**\n * Creates a new instance of the Airtop SDK.\n * @param config - Configuration options for the Airtop SDK\n */\n constructor(config: AirtopConstructorConfig) {\n super({\n logLevel: config?.logLevel,\n client: new AirtopCore({\n maxRetries: 0,\n timeout: minutesToMilliseconds(1),\n apiKey: config.apiKey,\n baseURL: config?.airtopUrl,\n logLevel: config?.logLevel || \"off\",\n defaultHeaders: {\n \"x-airtop-sdk-source\": \"typescript\",\n \"x-airtop-sdk-version\": version,\n },\n }),\n log:\n config?.logger ||\n new LogLayer({\n errorSerializer: serializeError,\n transport: new ConsoleTransport({\n logger: console,\n messageField: \"message\",\n enabled: config.logLevel !== \"off\",\n level: config.logLevel === \"off\" ? \"error\" : config.logLevel || \"error\",\n }),\n contextFieldName: \"context\",\n metadataFieldName: \"metadata\",\n }),\n outputSchemaAdapter: config.outputSchemaAdapter,\n });\n\n this.log.withPrefix(\"[Airtop SDK]\");\n\n this.client.logLevel = config.logLevel;\n\n this.client.logger = {\n debug: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"debug\", message, rest);\n },\n error: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"error\", message, rest);\n },\n info: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"info\", message, rest);\n },\n warn: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"warn\", message, rest);\n },\n };\n }\n\n /**\n * Creates a new Airtop session.\n * @param config - Configuration options for the session\n * @param options - Request options\n * @returns A new AirtopSession instance\n */\n async createSession(config?: CreateSessionConfig, options: AirtopRequestOptions = {}) {\n const skipWaitSessionReady = config.skipWaitSessionReady ?? false;\n delete config.skipWaitSessionReady;\n\n const sessionResponse = await this.client.sessions.create(\n {\n configuration: config,\n },\n options,\n );\n\n const session = new AirtopSession(this.getCommonConfig(), sessionResponse);\n\n if (skipWaitSessionReady) {\n return session;\n }\n\n await session.waitForSessionReady();\n\n return session;\n }\n\n /**\n * Retrieves multiple sessions by their IDs.\n * @param sessionIds - Array of session IDs to retrieve\n * @param config - Configuration options for the request\n * @param requestOptions - Request options\n * @returns Object containing pagination info and array of AirtopSession instances\n */\n async getSessions(sessionIds: string[], config?: GetSessionsConfig, requestOptions: AirtopRequestOptions = {}) {\n const sessions = await this.client.sessions.list(\n {\n sessionIds,\n limit: config.limit,\n offset: config.offset,\n status: config.status,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return {\n pagination: sessions.data.pagination,\n sessions: sessions.data.sessions.map(\n (session) =>\n new AirtopSession(this.getCommonConfig(), {\n data: session,\n }),\n ),\n errors: sessions.errors,\n meta: sessions.meta,\n warnings: sessions.warnings,\n };\n }\n\n /**\n * Removes one or more profiles.\n * @param profileNames - Name(s) of the profile(s) to remove\n * @param requestOptions - Request options\n */\n async removeProfile(profileNames: string[] | string, requestOptions: AirtopRequestOptions = {}) {\n await this.client.profile.delete(\n {\n profileNames: Array.isArray(profileNames) ? profileNames : [profileNames],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Retrieves a profile by name.\n * @param profileName - Name of the profile to retrieve\n * @param requestOptions - Request options\n * @returns The profile\n */\n async getProfile(profileName: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopProfile> {\n return this.client.profile.get(profileName, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Renames a profile.\n * @param sourceName - Current name of the profile\n * @param targetName - New name for the profile\n * @param requestOptions - Request options\n */\n async renameProfile(sourceName: string, targetName: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.profile.rename(\n {\n source: sourceName,\n target: targetName,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Returns a session client instance for making session-based requests for a given session id.\n *\n * @param sessionId - The session ID to attach to the AirtopSessionClient instance\n **/\n withSessionId(sessionId: string) {\n return new AirtopSessionClient(this.getCommonConfig(), sessionId);\n }\n\n /**\n * Retrieves the status of a request.\n * @param requestId - ID of the request to check\n * @param requestOptions - Request options\n * @returns Status of the request\n */\n async getRequestStatus(requestId: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n requestId,\n })\n .info(\"Getting request status\");\n\n return this.client.requests.getRequestStatus(requestId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Gets a file by ID.\n * @param fileId\n * @param requestOptions\n */\n async getFile(fileId: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopFileResponse> {\n return this.client.files.get(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Removes a file by ID.\n * @param fileId - ID of the file to remove\n * @param requestOptions - Request options\n */\n async removeFile(fileId: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.files.delete(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Lists files\n * @param query\n * @param requestOptions\n */\n async getFiles(query: AirtopFileListParams, requestOptions: AirtopRequestOptions = {}): Promise<AirtopFilesResponse> {\n return this.client.files.list(query, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * List all automations\n * @param requestOptions - Request options\n */\n listAutomations(requestOptions: AirtopRequestOptions = {}): Promise<AirtopAutomationListResponse> {\n return this.client.automations.list(this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Update the description of a specific automation\n * @param body - Request body\n * @param requestOptions - Request options\n */\n updateAutomationDescription(\n body: AirtopAutomationUpdateDescriptionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopAutomationData> {\n return this.client.automations.updateDescription(body, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Delete a specific automation\n * @param automationID - ID of the automation to delete\n * @param requestOptions - Request options\n */\n removeAutomation(automationID: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.automations.delete(automationID, this.resolveRequestOptions(requestOptions));\n }\n}\n","import type { LogLevel } from \"@airtop/core/client\";\nimport type { ILogLayer } from \"loglayer\";\n\nexport const processLogMessage = (log: ILogLayer, logLevel: LogLevel, ...args: unknown[]) => {\n if (logLevel === \"off\") {\n return;\n }\n\n const data: Record<string, unknown> = {};\n let hasData = false;\n let error: Error | null = null;\n const messages: string[] = [];\n\n for (const arg of args) {\n if (arg instanceof Error) {\n error = arg;\n continue;\n }\n\n if (typeof arg === \"object\" && arg !== null) {\n Object.assign(data, arg);\n hasData = true;\n continue;\n }\n\n if (typeof arg === \"string\") {\n messages.push(arg);\n }\n }\n\n let finalMessage = messages.join(\" \").trim();\n\n // next.js uses an \"x\" for the error message when it's an error object\n if (finalMessage === \"⨯\" && error) {\n finalMessage = error?.message || \"\";\n }\n\n if (error && hasData && messages.length > 0) {\n log.withError(error).withMetadata(data)[logLevel](finalMessage);\n } else if (error && messages.length > 0) {\n log.withError(error)[logLevel](finalMessage);\n } else if (hasData && messages.length > 0) {\n log.withMetadata(data)[logLevel](finalMessage);\n } else if (error && hasData && messages.length === 0) {\n log.withError(error).withMetadata(data)[logLevel](\"\");\n } else if (error && messages.length === 0) {\n log.errorOnly(error);\n } else if (hasData && messages.length === 0) {\n log.metadataOnly(data);\n } else {\n log[logLevel](finalMessage);\n }\n};\n","import { NotFoundError } from \"@airtop/core\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\nimport { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowCreateResponse } from \"../window/AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"../window/AirtopWindowClient.js\";\nimport { AirtopSession } from \"./AirtopSession.js\";\nimport type { CreateFileConfig } from \"./AirtopSession.types.js\";\n\n/**\n * Client for making session-specific requests to the Airtop API.\n */\nexport class AirtopSessionClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionId - Browser session id\n */\n constructor(config: CommonAirtopConfig, sessionId: string) {\n super(config);\n this.log = this.log.child().withContext({\n sessionId: sessionId,\n });\n\n this.sessionId = sessionId;\n }\n\n /**\n * Returns the browser session ID.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Gets the state of the session using the attached session id.\n * @param requestOptions - Request options\n * @returns AirtopSession instance or null if not found\n */\n async getSessionInfo(requestOptions: AirtopRequestOptions = {}) {\n try {\n const results = await this.client.sessions.get(this.sessionId, this.resolveRequestOptions(requestOptions));\n\n return new AirtopSession(this.getCommonConfig(), {\n data: results.data,\n meta: results.meta,\n warnings: results.warnings,\n errors: results.errors,\n });\n } catch (e) {\n if (e instanceof NotFoundError) {\n return null;\n }\n\n throw e;\n }\n }\n\n /**\n * Configures the session to save a profile when it terminates.\n * @param profileName - Name of the profile to save\n * @param requestOptions - Request options\n */\n async saveProfileOnTermination(profileName: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n profileName,\n })\n .info(\"Saving profile on termination\");\n\n await this.client.sessions.saveProfileOnTermination(\n profileName,\n {\n sessionId: this.sessionId,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Waits for the session to be in a ready state.\n * @returns The event indicating the session is ready\n */\n async waitForSessionReady() {\n this.log.info(\"Waiting for session to be ready\");\n\n const sessionEvents = await this.client.sessions.getEvents(this.sessionId);\n\n for await (const event of sessionEvents) {\n this.log\n .withMetadata({\n event,\n })\n .info(\"status message received\");\n\n const e = event as any;\n\n if (e.event === \"status\" && e.status === \"running\") {\n return event;\n }\n }\n }\n\n /**\n * Terminates the current session.\n * If the session is already terminated, this method will log a message and return.\n */\n async terminateSession() {\n this.log.info(\"Terminating session\");\n await this.client.sessions.terminate(this.sessionId);\n }\n\n /**\n * Creates a new window in the current session.\n * @param url - The URL to load in the new window\n * @param requestOptions - Request options\n * @returns A new AirtopWindow<AirtopWindowCreateResponse> instance\n */\n async createWindow(url: string, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating window\");\n\n const results = await this.client.windows.create(\n this.sessionId,\n {\n url,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowCreateResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Returns a window client instance for making window-based requests for a given window id.\n *\n * @param windowId - The session ID to attach to the AirtopWindowClient instance\n **/\n withWindowId(windowId: string) {\n return new AirtopWindowClient(this.getCommonConfig(), this.sessionId, windowId);\n }\n\n /**\n * Creates a new file in the current session.\n * @param fileName - The name of the file to create\n * @param config - Additional configuration options for creating the file\n * @param requestOptions - Request options\n */\n createFile(fileName: string, config: CreateFileConfig = {}, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating file\");\n\n return this.client.files.createFile(\n {\n ...config,\n fileName,\n sessionIds: [this.sessionId],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n}\n","import type { WindowPageQueryParams, WindowPaginatedExtractionParams } from \"@airtop/core/resources/windows.js\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\n\nimport type { OperationOutcomeResponse, WindowIDDataResponse } from \"@airtop/core/resources/shared.js\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport { AirtopWindow } from \"./AirtopWindow.js\";\nimport type { AirtopWindowGetInfoResponse } from \"./AirtopWindow.types.js\";\nimport type {\n WindowClickConfig,\n WindowGetConfig,\n WindowHoverConfig,\n WindowLoadUrlConfig,\n WindowMonitorConfig,\n WindowPageQueryConfig,\n WindowPaginatedExtractionConfig,\n WindowPromptResponse,\n WindowScrapeConfig,\n WindowScrapeResponse,\n WindowScreenshotConfig,\n WindowScrollConfig,\n WindowTypeConfig,\n} from \"./AirtopWindowClient.types.js\";\nimport { AirtopWindowScreenshot } from \"./AirtopWindowScreenshot.js\";\n\n/**\n * Client for making window-specific requests to the Airtop API.\n */\nexport class AirtopWindowClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * The window id\n * @internal\n */\n protected windowId: string;\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowId - Browser window id\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowId: string) {\n super(config);\n\n this.log = this.log.child().withContext({\n sessionId,\n windowId,\n });\n\n this.windowId = windowId;\n this.sessionId = sessionId;\n }\n\n /**\n * Gets the window ID.\n */\n getWindowId() {\n return this.windowId;\n }\n\n /**\n * Gets the browser session id associated with the window.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Retrieves a window from a specific session.\n * @param config - Configuration options for the window\n * @param requestOptions - Request options\n * @returns AirtopWindow<AirtopWindowGetInfoResponse> instance\n */\n async getWindowInfo(config?: WindowGetConfig, requestOptions: AirtopRequestOptions = {}) {\n const results = await this.client.windows.get(\n this.windowId,\n {\n sessionId: this.sessionId,\n ...config,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowGetInfoResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Simulates a click on an element in the window.\n * @param elementDescription - Description or selector of the element to click\n * @param config - Additional configuration options for the click action\n * @param requestOptions - Request options\n * @returns Promise resolving to the click operation result\n */\n async click(\n elementDescription: string,\n config?: WindowClickConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n elementDescription,\n })\n .info(\"Clicking on element\");\n\n return this.client.windows.click(\n this.getWindowId(),\n {\n ...config,\n elementDescription,\n sessionId: this.sessionId,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Closes the window.\n * @returns Promise resolving when the window is closed\n */\n async close(): Promise<WindowIDDataResponse> {\n this.log.info(\"Closing window\");\n\n return this.client.windows.close(this.getWindowId(), {\n sessionId: this.sessionId,\n });\n }\n\n /**\n * Simulates hovering over an element in the window.\n * @param elementDescription - Description or selector of the element to hover over\n * @param config - Additional configuration options for the hover action\n * @param requestOptions - Request options\n * @returns Promise resolving to the hover operation result\n */\n async hover(\n elementDescription: string,\n config?: WindowHoverConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata(config).info(\"Hovering over window\");\n\n return this.client.windows.hover(\n this.getWindowId(),\n {\n elementDescription,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Loads a URL in the window.\n * @param url - The URL to load\n * @param config - Additional configuration options for loading the URL\n * @param requestOptions - Request options\n * @returns Promise resolving when the URL is loaded\n */\n async loadUrl(\n url: string,\n config?: WindowLoadUrlConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<OperationOutcomeResponse> {\n this.log\n .withMetadata({\n url,\n })\n .info(\"Loading a URL\");\n\n return this.client.windows.loadURL(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n url,\n ...config,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Monitors the window for changes or events.\n * @param condition - A natural language description of the condition to monitor for in the browser window\n * @param config - Configuration options for monitoring\n * @param requestOptions - Request options\n * @returns Promise resolving to the monitoring operation result\n */\n async monitor(\n condition: string,\n config?: WindowMonitorConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata().info(\"Monitoring window\");\n\n return this.client.windows.monitor(\n this.getWindowId(),\n {\n condition,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs a natural language query on the page content.\n * @param prompt - The natural language query prompt\n * @param config - Configuration options for the query\n * @param requestOptions - Request options\n * @returns Promise resolving to the query results\n */\n async pageQuery(\n prompt: string,\n config?: WindowPageQueryConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a page query\");\n\n const newConfig = config as Omit<WindowPageQueryParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.pageQuery(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n prompt,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs paginated data extraction from the window content.\n * @param prompt - The extraction prompt\n * @param config - Configuration options for the extraction\n * @param requestOptions - Request options\n * @returns Promise resolving to the extracted data\n */\n async paginatedExtraction(\n prompt: string,\n config?: WindowPaginatedExtractionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a paginated extraction\");\n\n const newConfig = config as Omit<WindowPaginatedExtractionParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.paginatedExtraction(\n this.getWindowId(),\n {\n prompt,\n sessionId: this.sessionId,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Scrapes content from the window.\n * @param config - Configuration options for scraping\n * @param requestOptions - Request options\n * @returns Promise resolving to the scraped content\n */\n async scrape(config?: WindowScrapeConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowScrapeResponse> {\n this.log.info(\"Scraping window\");\n\n return this.client.windows.scrape(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Takes a screenshot of the window.\n * @param config - Configuration options for the screenshot\n * @param requestOptions - Request options\n * @returns Promise resolving to the screenshot data\n */\n async screenshot(\n config?: WindowScreenshotConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopWindowScreenshot> {\n this.log.info(\"Screenshotting window\");\n\n const resp = await this.client.windows.screenshot(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n\n return new AirtopWindowScreenshot(resp);\n }\n\n /**\n * Scrolls the window content.\n * @param config - Configuration options for scrolling\n * @param requestOptions - Request options\n * @returns Promise resolving when the scroll operation is complete\n */\n async scroll(config?: WindowScrollConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowPromptResponse> {\n this.log.info(\"Scrolling window\");\n\n return this.client.windows.scroll(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Types text into the window.\n * @param text - The text to type\n * @param config - Configuration options for typing\n * @param requestOptions - Request options\n * @returns Promise resolving when the text has been typed\n */\n async type(text: string, config?: WindowTypeConfig, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n text,\n })\n .info(\"Typing text\");\n\n return this.client.windows.type(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n text,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n}\n","import type { ScreenshotMetadata } from \"@airtop/core/resources/shared\";\nimport type { AirtopWindowScreenshotResponse, ScreenshotData } from \"./AirtopWindowScreenshot.types.js\";\n\nfunction extractMimeAndBase64(dataUrl: string): {\n mimeType: string;\n base64Data: string;\n} {\n const match = dataUrl.match(/^data:(image\\/\\w+);base64,(.+)$/);\n if (match) {\n return { mimeType: match[1], base64Data: match[2] };\n }\n return {\n mimeType: \"image/jpeg\",\n base64Data: dataUrl.replace(/^data:image\\/jpeg;base64,/, \"\"),\n };\n}\n\n/**\n * The result of a screenshot operation.\n */\nexport class AirtopWindowScreenshot {\n data: AirtopWindowScreenshotResponse[\"data\"];\n meta: AirtopWindowScreenshotResponse[\"meta\"];\n warnings: AirtopWindowScreenshotResponse[\"warnings\"];\n errors: AirtopWindowScreenshotResponse[\"errors\"];\n\n /**\n * Creates a new AirtopWindowScreenshot instance.\n * @param screenshotData - Initial screenshot data and configuration\n */\n constructor(screenshotData: AirtopWindowScreenshotResponse) {\n this.meta = screenshotData.meta;\n this.data = screenshotData.data;\n this.warnings = screenshotData.warnings;\n this.errors = screenshotData.errors;\n }\n\n /**\n * Processes the screenshots and returns them as JPG images.\n */\n screenshotsAsJpg(): ScreenshotData[] {\n const screenshots = this.meta.screenshots;\n\n if (!screenshots) {\n return [];\n }\n\n return screenshots.map((screenshot: ScreenshotMetadata, index: number) => {\n if (!screenshot.dataUrl) {\n return {\n index,\n error: new Error(\"Screenshot data URL not found\"),\n success: false,\n };\n }\n\n try {\n const { mimeType, base64Data } = extractMimeAndBase64(screenshot.dataUrl);\n const binaryData = Buffer.from(base64Data, \"base64\");\n return {\n index,\n binaryData,\n mimeType,\n success: true,\n };\n } catch (err) {\n return {\n index,\n error: err instanceof Error ? err : new Error(String(err)),\n success: false,\n };\n }\n });\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type { CommonWindowResponse } from \"./AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"./AirtopWindowClient.js\";\n\n/**\n * Represents a browser window in a browser session.\n */\nexport class AirtopWindow<Response extends CommonWindowResponse> extends AirtopWindowClient {\n /**\n * The window data containing window-specific information.\n */\n data: Response[\"data\"];\n /**\n * The metadata associated with the window.\n */\n meta: Response[\"meta\"];\n /**\n * Warnings associated with the creation of the window.\n * These are non-fatal issues that occurred during window creation.\n */\n warnings: Response[\"warnings\"];\n /**\n * Errors that occurred during window creation or operation.\n * These are fatal issues that prevented window creation.\n */\n errors: Response[\"errors\"];\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowData - Initial window data and configuration\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowData: Response) {\n super(config, sessionId, windowData.data.windowId);\n\n this.meta = windowData.meta;\n this.data = windowData.data;\n this.warnings = windowData.warnings;\n this.errors = windowData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type {\n AirtopSessionResponse,\n SessionData,\n SessionError,\n SessionMetadata,\n SessionWarning,\n} from \"./AirtopSession.types.js\";\nimport { AirtopSessionClient } from \"./AirtopSessionClient.js\";\n\n/**\n * Represents a browser session.\n */\nexport class AirtopSession extends AirtopSessionClient {\n /**\n * The session data containing connection and state information.\n * Includes details about the browser session and its configuration.\n */\n data: SessionData;\n /**\n * The metadata associated with the session.\n * Contains information about the request that created the session.\n */\n meta?: SessionMetadata;\n /**\n * Warnings that occurred during session creation or operation.\n * These are non-fatal issues that didn't prevent session creation.\n */\n warnings?: SessionWarning[];\n /**\n * Errors that occurred during session creation or operation.\n * These are fatal issues that prevented session creation.\n */\n errors?: SessionError[];\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionData - Browser session data\n */\n constructor(config: CommonAirtopConfig, sessionData: AirtopSessionResponse) {\n super(config, sessionData.data.id);\n\n this.meta = sessionData.meta;\n this.data = sessionData.data;\n this.warnings = sessionData.warnings;\n this.errors = sessionData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { AirtopClient } from \"../AirtopClient.js\";\nimport type { AirtopSession } from \"../session/AirtopSession.js\";\nimport type { AirtopSessionClient } from \"../session/index.js\";\nimport type { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport type { AirtopWindowClient } from \"../window/index.js\";\n\n/**\n * Enumeration of available plugin augmentation types.\n * Determines which part of the SDK a plugin can extend.\n * @group Plugin Development\n */\nexport enum AirtopPluginAugmentationType {\n /** Plugin for extending the AirtopClient class */\n AirtopClient = \"AirtopClient\",\n /** Plugin for extending AirtopWindowClient class functionality */\n AirtopWindowClient = \"AirtopWindowClient\",\n /** Plugin for extending AirtopWindow class functionality */\n AirtopWindow = \"AirtopWindow\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSessionClient = \"AirtopSessionClient\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSession = \"AirtopSession\",\n /** Plugin for extending AirtopWindowScreenshot class functionality */\n AirtopWindowScreenshot = \"AirtopWindowScreenshot\",\n}\n\n/**\n * Interface for plugins that extend the main AirtopClient class.\n * Plugins allow you to add custom functionality to the AirtopClient prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopClientPlugin {\n /**\n * Specifies that this plugin augments the main AirtopClient class.\n * This type discrimination allows TypeScript to properly type-check plugin usage.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopClient;\n\n /**\n * Function that performs the augmentation of the AirtopClient prototype.\n *\n * @param prototype - The AirtopClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowClient class functionality.\n * These plugins can modify or enhance the behavior of all window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowClientPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowClient class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowClient;\n\n /**\n * Function that performs the augmentation of the AirtopWindowClient prototype.\n *\n * @param prototype - The AirtopWindowClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSessionClient class functionality.\n * These plugins can modify or enhance the behavior of all session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionClientPlugin {\n /**\n * Specifies that this plugin augments AirtopSessionClient class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient;\n\n /**\n * Function that performs the augmentation of the AirtopSessionClient prototype.\n *\n * @param prototype - The AirtopSessionClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopSessionClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindow class functionality.\n * These plugins can modify or enhance the behavior of window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowPlugin {\n /**\n * Specifies that this plugin augments AirtopWindow class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindow;\n\n /**\n * Function that performs the augmentation of the AirtopWindow prototype.\n *\n * @param prototype - The AirtopWindow class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindow.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSession class functionality.\n * These plugins can modify or enhance the behavior of session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionPlugin {\n /**\n * Specifies that this plugin augments AirtopSession class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSession;\n\n /**\n * Function that performs the augmentation of the AirtopSession prototype.\n *\n * @param prototype - The AirtopSession class prototype being augmented\n */\n augment: (prototype: typeof AirtopSession.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowScreenshot class functionality.\n * These plugins can modify or enhance the behavior of screenshot instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowScreenshotPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowScreenshot class functionality.\n * This type discrimination ensures proper type checking when using screenshot plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowScreenshot;\n\n /**\n * Function that performs the augmentation of the AirtopWindowScreenshot prototype.\n *\n * @param prototype - The AirtopWindowScreenshot class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowScreenshot.prototype) => void;\n}\n\n/**\n * Union type of all possible plugin types.\n * Used when handling plugins generically.\n *\n * @group Plugin Development\n *\n * @see {@link AirtopClientPlugin | AirtopClientPlugin}\n * @see {@link AirtopWindowClientPlugin | AirtopWindowClientPlugin}\n * @see {@link AirtopSessionClientPlugin | AirtopSessionClientPlugin}\n * @see {@link AirtopWindowPlugin | AirtopWindowPlugin}\n * @see {@link AirtopSessionPlugin | AirtopSessionPlugin}\n * @see {@link AirtopWindowScreenshotPlugin | AirtopWindowScreenshotPlugin}\n */\nexport type AirtopPluginType =\n | AirtopClientPlugin\n | AirtopWindowClientPlugin\n | AirtopSessionClientPlugin\n | AirtopWindowPlugin\n | AirtopSessionPlugin\n | AirtopWindowScreenshotPlugin;\n\n/**\n * Interface for registering plugins with the SDK.\n */\nexport interface AirtopPluginRegistration {\n /**\n * Array of plugins to add to the SDK.\n */\n pluginsToAdd: AirtopPluginType[];\n}\n","import { AirtopClient } from \"../AirtopClient.js\";\nimport { AirtopSession, AirtopSessionClient } from \"../session/index.js\";\nimport { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport { AirtopWindow, AirtopWindowClient } from \"../window/index.js\";\nimport { AirtopPluginAugmentationType, type AirtopPluginRegistration } from \"./AirtopPlugin.types.js\";\n\n/**\n * Registers a plugin with the SDK.\n * @param plugin - The plugin to register\n */\nexport function registerAirtopPlugin(plugin: AirtopPluginRegistration): void {\n for (const pluginToAdd of plugin.pluginsToAdd) {\n switch (pluginToAdd.augmentationType) {\n case AirtopPluginAugmentationType.AirtopClient:\n pluginToAdd.augment(AirtopClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSessionClient:\n pluginToAdd.augment(AirtopSessionClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSession:\n pluginToAdd.augment(AirtopSession.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowClient:\n pluginToAdd.augment(AirtopWindowClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindow:\n pluginToAdd.augment(AirtopWindow.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowScreenshot:\n pluginToAdd.augment(AirtopWindowScreenshot.prototype);\n break;\n }\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { MockLogLayer } from \"loglayer\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport { AirtopClient } from \"./AirtopClient.js\";\nimport type { AirtopConstructorConfig } from \"./AirtopClient.types.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport type { AirtopSessionResponse } from \"./session/AirtopSession.types.js\";\nimport type { CommonAirtopConfig } from \"./types.js\";\nimport { AirtopWindow } from \"./window/AirtopWindow.js\";\n\nimport type { AirtopWindowGetInfoResponse } from \"./window/AirtopWindow.types.js\";\n\n/**\n * Creates a no-op version of the client by recursively traversing through its methods\n * and replacing them with empty functions that return resolved promises.\n * @param client - The client instance to create a no-op version of\n * @returns A proxy object that makes all methods no-op\n */\nfunction createNoOpClient<T extends object>(client: T): T {\n return new Proxy(client, {\n get(target: T, prop: string | symbol) {\n const value = Reflect.get(target, prop);\n\n // If it's a function, return a no-op function that returns a resolved promise\n if (typeof value === \"function\") {\n return async () => ({\n data: {},\n meta: {},\n warnings: [],\n errors: [],\n });\n }\n\n // If it's an object (but not null), recursively create a no-op version\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n return createNoOpClient(value);\n }\n\n // Otherwise return the original value\n return value;\n },\n });\n}\n\n/**\n * Generates a mock configuration object for the Airtop SDK for use as the\n * first parameter in the constructor of the AirtopSession and AirtopWindow classes.\n */\nfunction generateCommonAirtopConfigMock(): CommonAirtopConfig {\n const client = new AirtopCore({\n apiKey: \"test-api-key\",\n });\n\n return {\n log: new MockLogLayer(),\n client: createNoOpClient(client),\n };\n}\n\n/**\n * Provides utility methods for creating mock instances of Airtop classes.\n * @hideconstructor\n */\nexport class AirtopMocks {\n /**\n * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.\n */\n static getAirtopBaseMock(config: Partial<CommonAirtopConfig> = {}): AirtopBase {\n return new AirtopBase({\n ...generateCommonAirtopConfigMock(),\n ...config,\n });\n }\n\n /**\n * Creates an Airtop instance with a mock client and data.\n */\n static getAirtopClientMock(config: Partial<AirtopConstructorConfig> = {}): AirtopClient {\n const client = new AirtopClient({\n apiKey: \"test-api-key\",\n ...config,\n });\n\n const mocks = generateCommonAirtopConfigMock();\n\n client[\"log\"] = mocks.log;\n client[\"client\"] = mocks.client;\n\n return client;\n }\n\n /**\n * Creates an AirtopSession instance with a mock client and data.\n */\n static getAirtopSessionMock(responseData: Partial<AirtopSessionResponse> = {}): AirtopSession {\n return new AirtopSession(generateCommonAirtopConfigMock(), {\n data: {\n id: uuidv4(),\n configuration: {},\n chromedriverUrl: \"http://localhost:9515\",\n status: \"active\",\n },\n meta: {},\n warnings: [],\n ...responseData,\n });\n }\n\n /**\n * Creates an AirtopWindow instance with a mock client and data.\n */\n static getAirtopWindowMock({\n sessionId,\n windowData,\n }: {\n sessionId?: string;\n windowData?: AirtopWindowGetInfoResponse;\n } = {}): AirtopWindow<AirtopWindowGetInfoResponse> {\n return new AirtopWindow(generateCommonAirtopConfigMock(), sessionId || uuidv4(), {\n data: {\n targetId: uuidv4(),\n windowId: uuidv4(),\n liveViewUrl: \"http://localhost:4567\",\n },\n meta: {},\n warnings: [],\n ...(windowData || {}),\n });\n }\n}\n"]}
|
1
|
+
{"version":3,"sources":["/home/runner/work/airtop-sdk/airtop-sdk/typescript/sdk/dist/index.cjs","../package.json","../src/AirtopBase.ts","../src/AirtopClient.ts","../src/logger-utils.ts","../src/session/AirtopSessionClient.ts","../src/window/AirtopWindowClient.ts","../src/window/AirtopWindowScreenshot.ts","../src/window/AirtopWindow.ts","../src/session/AirtopSession.ts","../src/plugin/AirtopPlugin.types.ts","../src/plugin/AirtopPlugin.ts","../src/AirtopMocks.ts"],"names":["secondsToMilliseconds","AirtopPluginAugmentationType","AirtopCore"],"mappings":"AAAA,qrBAAI,kBAAkB,EAAE,MAAM,CAAC,mBAAmB;AAClD,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,SAAS,SAAS,CAAC,EAAE;AACnD,EAAE,OAAO,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO;AACpG,CAAC;AACD;AACA;ACLA,IAAA,gBAAA,EAAA,UAAA,CAAA;AAAA,EAAA,cAAA,CAAA,OAAA,EAAA,MAAA,EAAA;AAAA,IAAA,MAAA,CAAA,QAAA,EAAA;AAAA,MACE,IAAA,EAAQ,aAAA;AAAA,MACR,WAAA,EAAe,2BAAA;AAAA,MACf,OAAA,EAAW,gBAA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CAAA,EAAG;AAAA,MACzD,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,sBAAA,CAAO;AAAA,QACX,aAAA,EAAe,CAAC,CAAA;AAAA,QAChB,eAAA,EAAiB,uBAAA;AAAA,QACjB,MAAA,EAAQ;AAAA,MACV,CAAA;AAAA,MACA,IAAA,EAAM,CAAC,CAAA;AAAA,MACP,QAAA,EAAU,CAAC,CAAA;AAAA,MACX,GAAG;AAAA,IACL,CAAC,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,mBAAA,CAAoB;AAAA,IACzB,SAAA;AAAA,IACA;AAAA,EACF,EAAA,EAGI,CAAC,CAAA,EAA8C;AACjD,IAAA,OAAO,IAAI,YAAA,CAAa,8BAAA,CAA+B,CAAA,EAAG,UAAA,GAAa,sBAAA,CAAO,EAAG;AAAA,MAC/E,IAAA,EAAM;AAAA,QACJ,QAAA,EAAU,sBAAA,CAAO;AAAA,QACjB,QAAA,EAAU,sBAAA,CAAO;AAAA,QACjB,WAAA,EAAa;AAAA,MACf,CAAA;AAAA,MACA,IAAA,EAAM,CAAC,CAAA;AAAA,MACP,QAAA,EAAU,CAAC,CAAA;AAAA,MACX,GAAI,WAAA,GAAc,CAAC;AAAA,IACrB,CAAC,CAAA;AAAA,EACH;AACF,CAAA;AZkhCA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,2cAAC","file":"/home/runner/work/airtop-sdk/airtop-sdk/typescript/sdk/dist/index.cjs","sourcesContent":[null,"{\n \"name\": \"@airtop/sdk\",\n \"description\": \"Airtop SDK for TypeScript\",\n \"version\": \"1.0.0-alpha2.6\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"exports\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"require\": \"./dist/index.cjs\"\n }\n },\n \"types\": \"./dist/index.d.ts\",\n \"license\": \"MIT\",\n \"repository\": \"airtop-ai/airtop-sdk.git\",\n \"author\": \"Theo Gravity <theo@airtop.ai>\",\n \"keywords\": [\n \"airtop\",\n \"browser automation\",\n \"ai\",\n \"playwright\",\n \"puppeteer\",\n \"selenium\",\n \"web scraping\",\n \"agentic\"\n ],\n \"scripts\": {\n \"build:second-stage\": \"tsup src/index.ts\",\n \"test:e2e\": \"vitest --run\",\n \"build:dev\": \"node_modules/.bin/hash-runner\",\n \"clean\": \"rm -rf .turbo node_modules dist\",\n \"lint\": \"biome check --write --unsafe src && biome format src --write && biome lint src --fix\",\n \"verify-types\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@airtop/json-schema-adapter\": \"workspace:*\",\n \"@airtop/core\": \"0.1.0-alpha.24\",\n \"date-fns\": \"4.1.0\",\n \"loglayer\": \"6.3.3\",\n \"serialize-error\": \"12.0.0\",\n \"uuid\": \"11.1.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"1.9.4\",\n \"@dotenvx/dotenvx\": \"1.39.0\",\n \"@internal/tsconfig\": \"workspace:*\",\n \"deep-utility-types\": \"1.3.1\",\n \"env-var\": \"7.5.0\",\n \"hash-runner\": \"2.0.1\",\n \"nanoid\": \"5.1.5\",\n \"tsup\": \"8.4.0\",\n \"typescript\": \"5.8.2\",\n \"utility-types\": \"3.11.0\",\n \"uuid\": \"11.1.0\",\n \"vitest\": \"3.1.1\",\n \"zod\": \"*\"\n },\n \"bugs\": \"https://github.com/airtop-ai/airtop-sdk/issues\",\n \"engines\": {\n \"node\": \">=18\"\n },\n \"files\": [\n \"dist\"\n ],\n \"homepage\": \"https://airtop.ai\",\n \"optionalDependencies\": {\n \"@airtop/json-schema-adapter-zod\": \"workspace:*\"\n },\n \"packageManager\": \"pnpm@10.5.0\"\n}\n","import type { Airtop as AirtopCore } from \"@airtop/core\";\n/**\n * Import required types and utilities\n */\nimport type { AirtopJsonSchemaAdapter } from \"@airtop/json-schema-adapter\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport type { ILogLayer } from \"loglayer\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"./types.js\";\n\n/**\n * Base class for Airtop SDK implementation\n * Provides common functionality for JSON schema conversion, error handling, and request configuration\n * @hidden\n */\nexport class AirtopBase {\n /**\n * Logger instance for the SDK\n * @internal\n **/\n protected log: ILogLayer;\n /**\n * Airtop Core SDK client instance\n * @internal\n **/\n protected client: AirtopCore;\n\n /**\n * JSON schema adapter for output conversion\n * @internal\n **/\n protected outputJsonAdapter: AirtopJsonSchemaAdapter;\n\n /**\n * Creates a new instance of AirtopBase\n * @param config - Configuration options for the SDK\n */\n constructor(config: CommonAirtopConfig) {\n this.log = config.log.withPrefix(\"[Airtop]\");\n this.client = config.client;\n this.outputJsonAdapter = config.outputSchemaAdapter;\n }\n\n /**\n * Returns the API key used by the SDK\n * @returns API key string\n */\n getApiKey() {\n return this.client.apiKey;\n }\n\n /**\n * Sets the base URL for the Airtop API.\n * @param airtopUrl - The base URL for the Airtop API\n */\n setAirtopUrl(airtopUrl: string) {\n this.client.baseURL = airtopUrl;\n }\n\n /**\n * Sets the API key for authentication.\n * @param apiKey - The API key to use for authentication\n */\n setApiKey(apiKey: string) {\n this.client.apiKey = apiKey;\n }\n\n /**\n * Returns the LogLayer logger instance used by the SDK\n * @returns Logger instance\n * @see {@link https://loglayer.dev | LogLayer Documentation}\n */\n getLogger() {\n return this.log;\n }\n\n /**\n * Converts input data to JSON schema format\n * @param input - Data to be converted (schema input, string, or object)\n * @returns JSON string representation of the input\n * @internal\n */\n protected convertToJsonSchema(input?: any): string {\n if (input && this.outputJsonAdapter?.shouldRunConversion(input)) {\n return JSON.stringify(this.outputJsonAdapter.toJsonSchema(input));\n }\n\n if (typeof input === \"object\") {\n return JSON.stringify(input);\n }\n\n return input as string;\n }\n\n /**\n * Returns the common configuration used by the SDK\n * @returns Common configuration object\n * @internal\n */\n protected getCommonConfig(): CommonAirtopConfig {\n return {\n client: this.client,\n log: this.log,\n };\n }\n\n /**\n * Translates the request options to ones used by the Core SDK\n * @param options - Request options to be resolved\n * @returns Resolved request options with defaults\n * @internal\n */\n protected resolveRequestOptions(options: AirtopRequestOptions = {}) {\n return {\n timeout: secondsToMilliseconds(options.timeoutInSeconds || 60),\n maxRetries: options.maxRetries || 0,\n signal: options.abortSignal,\n };\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { minutesToMilliseconds } from \"date-fns/minutesToMilliseconds\";\nimport { ConsoleTransport, LogLayer } from \"loglayer\";\nimport { serializeError } from \"serialize-error\";\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport type {\n AirtopAutomationData,\n AirtopAutomationListResponse,\n AirtopAutomationUpdateDescriptionConfig,\n AirtopConstructorConfig,\n AirtopFileListParams,\n AirtopFileResponse,\n AirtopFilesResponse,\n AirtopProfile,\n CreateSessionConfig,\n GetSessionsConfig,\n} from \"./AirtopClient.types.js\";\nimport { processLogMessage } from \"./logger-utils.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport { AirtopSessionClient } from \"./session/AirtopSessionClient.js\";\nimport type { AirtopRequestOptions } from \"./types.js\";\n\nconst version = require(\"../package.json\").version;\n\n/**\n * Main Airtop SDK class that provides functionality for managing sessions, profiles, and windows.\n */\nexport class AirtopClient extends AirtopBase {\n /**\n * Creates a new instance of the Airtop SDK.\n * @param config - Configuration options for the Airtop SDK\n */\n constructor(config: AirtopConstructorConfig) {\n super({\n logLevel: config?.logLevel,\n client: new AirtopCore({\n maxRetries: 0,\n timeout: minutesToMilliseconds(1),\n apiKey: config.apiKey,\n baseURL: config?.airtopUrl,\n logLevel: config?.logLevel || \"off\",\n defaultHeaders: {\n \"x-airtop-sdk-source\": \"typescript\",\n \"x-airtop-sdk-version\": version,\n },\n }),\n log:\n config?.logger ||\n new LogLayer({\n errorSerializer: serializeError,\n transport: new ConsoleTransport({\n logger: console,\n messageField: \"message\",\n enabled: config.logLevel !== \"off\",\n level: config.logLevel === \"off\" ? \"error\" : config.logLevel || \"error\",\n }),\n contextFieldName: \"context\",\n metadataFieldName: \"metadata\",\n }),\n outputSchemaAdapter: config.outputSchemaAdapter,\n });\n\n this.log.withPrefix(\"[Airtop SDK]\");\n\n this.client.logLevel = config.logLevel;\n\n this.client.logger = {\n debug: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"debug\", message, rest);\n },\n error: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"error\", message, rest);\n },\n info: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"info\", message, rest);\n },\n warn: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"warn\", message, rest);\n },\n };\n }\n\n /**\n * Creates a new Airtop session.\n * @param config - Configuration options for the session\n * @param options - Request options\n * @returns A new AirtopSession instance\n */\n async createSession(config?: CreateSessionConfig, options: AirtopRequestOptions = {}) {\n const skipWaitSessionReady = config.skipWaitSessionReady ?? false;\n delete config.skipWaitSessionReady;\n\n const sessionResponse = await this.client.sessions.create(\n {\n configuration: config,\n },\n options,\n );\n\n const session = new AirtopSession(this.getCommonConfig(), sessionResponse);\n\n if (skipWaitSessionReady) {\n return session;\n }\n\n await session.waitForSessionReady();\n\n return session;\n }\n\n /**\n * Retrieves multiple sessions by their IDs.\n * @param sessionIds - Array of session IDs to retrieve\n * @param config - Configuration options for the request\n * @param requestOptions - Request options\n * @returns Object containing pagination info and array of AirtopSession instances\n */\n async getSessions(sessionIds: string[], config?: GetSessionsConfig, requestOptions: AirtopRequestOptions = {}) {\n const sessions = await this.client.sessions.list(\n {\n sessionIds,\n limit: config.limit,\n offset: config.offset,\n status: config.status,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return {\n pagination: sessions.data.pagination,\n sessions: sessions.data.sessions.map(\n (session) =>\n new AirtopSession(this.getCommonConfig(), {\n data: session,\n }),\n ),\n errors: sessions.errors,\n meta: sessions.meta,\n warnings: sessions.warnings,\n };\n }\n\n /**\n * Removes one or more profiles.\n * @param profileNames - Name(s) of the profile(s) to remove\n * @param requestOptions - Request options\n */\n async removeProfile(profileNames: string[] | string, requestOptions: AirtopRequestOptions = {}) {\n await this.client.profile.delete(\n {\n profileNames: Array.isArray(profileNames) ? profileNames : [profileNames],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Retrieves a profile by name.\n * @param profileName - Name of the profile to retrieve\n * @param requestOptions - Request options\n * @returns The profile\n */\n async getProfile(profileName: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopProfile> {\n return this.client.profile.get(profileName, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Renames a profile.\n * @param sourceName - Current name of the profile\n * @param targetName - New name for the profile\n * @param requestOptions - Request options\n */\n async renameProfile(sourceName: string, targetName: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.profile.rename(\n {\n source: sourceName,\n target: targetName,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Returns a session client instance for making session-based requests for a given session id.\n *\n * @param sessionId - The session ID to attach to the AirtopSessionClient instance\n **/\n withSessionId(sessionId: string) {\n return new AirtopSessionClient(this.getCommonConfig(), sessionId);\n }\n\n /**\n * Retrieves the status of a request.\n * @param requestId - ID of the request to check\n * @param requestOptions - Request options\n * @returns Status of the request\n */\n async getRequestStatus(requestId: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n requestId,\n })\n .info(\"Getting request status\");\n\n return this.client.requests.getRequestStatus(requestId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Gets a file by ID.\n * @param fileId\n * @param requestOptions\n */\n async getFile(fileId: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopFileResponse> {\n return this.client.files.get(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Removes a file by ID.\n * @param fileId - ID of the file to remove\n * @param requestOptions - Request options\n */\n async removeFile(fileId: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.files.delete(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * List files\n * @param query\n * @param requestOptions\n */\n async listFiles(\n query: AirtopFileListParams,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopFilesResponse> {\n return this.client.files.list(query, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * List all automations\n * @param requestOptions - Request options\n */\n listAutomations(requestOptions: AirtopRequestOptions = {}): Promise<AirtopAutomationListResponse> {\n return this.client.automations.list(this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Update the description of a specific automation\n * @param body - Request body\n * @param requestOptions - Request options\n */\n updateAutomationDescription(\n body: AirtopAutomationUpdateDescriptionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopAutomationData> {\n return this.client.automations.updateDescription(body, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Delete a specific automation\n * @param automationID - ID of the automation to delete\n * @param requestOptions - Request options\n */\n removeAutomation(automationID: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.automations.delete(automationID, this.resolveRequestOptions(requestOptions));\n }\n}\n","import type { LogLevel } from \"@airtop/core/client\";\nimport type { ILogLayer } from \"loglayer\";\n\nexport const processLogMessage = (log: ILogLayer, logLevel: LogLevel, ...args: unknown[]) => {\n if (logLevel === \"off\") {\n return;\n }\n\n const data: Record<string, unknown> = {};\n let hasData = false;\n let error: Error | null = null;\n const messages: string[] = [];\n\n for (const arg of args) {\n if (arg instanceof Error) {\n error = arg;\n continue;\n }\n\n if (typeof arg === \"object\" && arg !== null) {\n Object.assign(data, arg);\n hasData = true;\n continue;\n }\n\n if (typeof arg === \"string\") {\n messages.push(arg);\n }\n }\n\n let finalMessage = messages.join(\" \").trim();\n\n // next.js uses an \"x\" for the error message when it's an error object\n if (finalMessage === \"⨯\" && error) {\n finalMessage = error?.message || \"\";\n }\n\n if (error && hasData && messages.length > 0) {\n log.withError(error).withMetadata(data)[logLevel](finalMessage);\n } else if (error && messages.length > 0) {\n log.withError(error)[logLevel](finalMessage);\n } else if (hasData && messages.length > 0) {\n log.withMetadata(data)[logLevel](finalMessage);\n } else if (error && hasData && messages.length === 0) {\n log.withError(error).withMetadata(data)[logLevel](\"\");\n } else if (error && messages.length === 0) {\n log.errorOnly(error);\n } else if (hasData && messages.length === 0) {\n log.metadataOnly(data);\n } else {\n log[logLevel](finalMessage);\n }\n};\n","import { NotFoundError } from \"@airtop/core\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\nimport { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowCreateResponse } from \"../window/AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"../window/AirtopWindowClient.js\";\nimport { AirtopSession } from \"./AirtopSession.js\";\nimport type { CreateFileConfig } from \"./AirtopSession.types.js\";\n\n/**\n * Client for making session-specific requests to the Airtop API.\n */\nexport class AirtopSessionClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionId - Browser session id\n */\n constructor(config: CommonAirtopConfig, sessionId: string) {\n super(config);\n this.log = this.log.child().withContext({\n sessionId: sessionId,\n });\n\n this.sessionId = sessionId;\n }\n\n /**\n * Returns the browser session ID.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Gets the state of the session using the attached session id.\n * @param requestOptions - Request options\n * @returns AirtopSession instance or null if not found\n */\n async getSessionInfo(requestOptions: AirtopRequestOptions = {}) {\n try {\n const results = await this.client.sessions.get(this.sessionId, this.resolveRequestOptions(requestOptions));\n\n return new AirtopSession(this.getCommonConfig(), {\n data: results.data,\n meta: results.meta,\n warnings: results.warnings,\n errors: results.errors,\n });\n } catch (e) {\n if (e instanceof NotFoundError) {\n return null;\n }\n\n throw e;\n }\n }\n\n /**\n * Configures the session to save a profile when it terminates.\n * @param profileName - Name of the profile to save\n * @param requestOptions - Request options\n */\n async saveProfileOnTermination(profileName: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n profileName,\n })\n .info(\"Saving profile on termination\");\n\n await this.client.sessions.saveProfileOnTermination(\n profileName,\n {\n sessionId: this.sessionId,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Waits for the session to be in a ready state.\n * @returns The event indicating the session is ready\n */\n async waitForSessionReady() {\n this.log.info(\"Waiting for session to be ready\");\n\n const sessionEvents = await this.client.sessions.getEvents(this.sessionId);\n\n for await (const event of sessionEvents) {\n this.log\n .withMetadata({\n event,\n })\n .info(\"status message received\");\n\n const e = event as any;\n\n if (e.event === \"status\" && e.status === \"running\") {\n return event;\n }\n }\n }\n\n /**\n * Terminates the current session.\n * If the session is already terminated, this method will log a message and return.\n */\n async terminateSession() {\n this.log.info(\"Terminating session\");\n await this.client.sessions.terminate(this.sessionId);\n }\n\n /**\n * Creates a new window in the current session.\n * @param url - The URL to load in the new window\n * @param requestOptions - Request options\n * @returns A new AirtopWindow<AirtopWindowCreateResponse> instance\n */\n async createWindow(url: string, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating window\");\n\n const results = await this.client.windows.create(\n this.sessionId,\n {\n url,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowCreateResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Returns a window client instance for making window-based requests for a given window id.\n *\n * @param windowId - The session ID to attach to the AirtopWindowClient instance\n **/\n withWindowId(windowId: string) {\n return new AirtopWindowClient(this.getCommonConfig(), this.sessionId, windowId);\n }\n\n /**\n * Creates a new file in the current session.\n * @param fileName - The name of the file to create\n * @param config - Additional configuration options for creating the file\n * @param requestOptions - Request options\n */\n createFile(fileName: string, config: CreateFileConfig = {}, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating file\");\n\n return this.client.files.createFile(\n {\n ...config,\n fileName,\n sessionIds: [this.sessionId],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n}\n","import type { WindowPageQueryParams, WindowPaginatedExtractionParams } from \"@airtop/core/resources/windows.js\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\n\nimport type { OperationOutcomeResponse, WindowIDDataResponse } from \"@airtop/core/resources/shared.js\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport { AirtopWindow } from \"./AirtopWindow.js\";\nimport type { AirtopWindowGetInfoResponse } from \"./AirtopWindow.types.js\";\nimport type {\n WindowClickConfig,\n WindowGetConfig,\n WindowHoverConfig,\n WindowLoadUrlConfig,\n WindowMonitorConfig,\n WindowPageQueryConfig,\n WindowPaginatedExtractionConfig,\n WindowPromptResponse,\n WindowScrapeConfig,\n WindowScrapeResponse,\n WindowScreenshotConfig,\n WindowScrollConfig,\n WindowTypeConfig,\n} from \"./AirtopWindowClient.types.js\";\nimport { AirtopWindowScreenshot } from \"./AirtopWindowScreenshot.js\";\n\n/**\n * Client for making window-specific requests to the Airtop API.\n */\nexport class AirtopWindowClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * The window id\n * @internal\n */\n protected windowId: string;\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowId - Browser window id\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowId: string) {\n super(config);\n\n this.log = this.log.child().withContext({\n sessionId,\n windowId,\n });\n\n this.windowId = windowId;\n this.sessionId = sessionId;\n }\n\n /**\n * Gets the window ID.\n */\n getWindowId() {\n return this.windowId;\n }\n\n /**\n * Gets the browser session id associated with the window.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Retrieves a window from a specific session.\n * @param config - Configuration options for the window\n * @param requestOptions - Request options\n * @returns AirtopWindow<AirtopWindowGetInfoResponse> instance\n */\n async getWindowInfo(config?: WindowGetConfig, requestOptions: AirtopRequestOptions = {}) {\n const results = await this.client.windows.get(\n this.windowId,\n {\n sessionId: this.sessionId,\n ...config,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowGetInfoResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Simulates a click on an element in the window.\n * @param elementDescription - Description or selector of the element to click\n * @param config - Additional configuration options for the click action\n * @param requestOptions - Request options\n * @returns Promise resolving to the click operation result\n */\n async click(\n elementDescription: string,\n config?: WindowClickConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n elementDescription,\n })\n .info(\"Clicking on element\");\n\n return this.client.windows.click(\n this.getWindowId(),\n {\n ...config,\n elementDescription,\n sessionId: this.sessionId,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Closes the window.\n * @returns Promise resolving when the window is closed\n */\n async close(): Promise<WindowIDDataResponse> {\n this.log.info(\"Closing window\");\n\n return this.client.windows.close(this.getWindowId(), {\n sessionId: this.sessionId,\n });\n }\n\n /**\n * Simulates hovering over an element in the window.\n * @param elementDescription - Description or selector of the element to hover over\n * @param config - Additional configuration options for the hover action\n * @param requestOptions - Request options\n * @returns Promise resolving to the hover operation result\n */\n async hover(\n elementDescription: string,\n config?: WindowHoverConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata(config).info(\"Hovering over window\");\n\n return this.client.windows.hover(\n this.getWindowId(),\n {\n elementDescription,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Loads a URL in the window.\n * @param url - The URL to load\n * @param config - Additional configuration options for loading the URL\n * @param requestOptions - Request options\n * @returns Promise resolving when the URL is loaded\n */\n async loadUrl(\n url: string,\n config?: WindowLoadUrlConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<OperationOutcomeResponse> {\n this.log\n .withMetadata({\n url,\n })\n .info(\"Loading a URL\");\n\n return this.client.windows.loadURL(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n url,\n ...config,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Monitors the window for changes or events.\n * @param condition - A natural language description of the condition to monitor for in the browser window\n * @param config - Configuration options for monitoring\n * @param requestOptions - Request options\n * @returns Promise resolving to the monitoring operation result\n */\n async monitor(\n condition: string,\n config?: WindowMonitorConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata().info(\"Monitoring window\");\n\n return this.client.windows.monitor(\n this.getWindowId(),\n {\n condition,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs a natural language query on the page content.\n * @param prompt - The natural language query prompt\n * @param config - Configuration options for the query\n * @param requestOptions - Request options\n * @returns Promise resolving to the query results\n */\n async pageQuery(\n prompt: string,\n config?: WindowPageQueryConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a page query\");\n\n const newConfig = config as Omit<WindowPageQueryParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.pageQuery(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n prompt,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs paginated data extraction from the window content.\n * @param prompt - The extraction prompt\n * @param config - Configuration options for the extraction\n * @param requestOptions - Request options\n * @returns Promise resolving to the extracted data\n */\n async paginatedExtraction(\n prompt: string,\n config?: WindowPaginatedExtractionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a paginated extraction\");\n\n const newConfig = config as Omit<WindowPaginatedExtractionParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.paginatedExtraction(\n this.getWindowId(),\n {\n prompt,\n sessionId: this.sessionId,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Scrapes content from the window.\n * @param config - Configuration options for scraping\n * @param requestOptions - Request options\n * @returns Promise resolving to the scraped content\n */\n async scrape(config?: WindowScrapeConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowScrapeResponse> {\n this.log.info(\"Scraping window\");\n\n return this.client.windows.scrape(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Takes a screenshot of the window.\n * @param config - Configuration options for the screenshot\n * @param requestOptions - Request options\n * @returns Promise resolving to the screenshot data\n */\n async screenshot(\n config?: WindowScreenshotConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopWindowScreenshot> {\n this.log.info(\"Screenshotting window\");\n\n const resp = await this.client.windows.screenshot(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n\n return new AirtopWindowScreenshot(resp);\n }\n\n /**\n * Scrolls the window content.\n * @param config - Configuration options for scrolling\n * @param requestOptions - Request options\n * @returns Promise resolving when the scroll operation is complete\n */\n async scroll(config?: WindowScrollConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowPromptResponse> {\n this.log.info(\"Scrolling window\");\n\n return this.client.windows.scroll(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Types text into the window.\n * @param text - The text to type\n * @param config - Configuration options for typing\n * @param requestOptions - Request options\n * @returns Promise resolving when the text has been typed\n */\n async type(text: string, config?: WindowTypeConfig, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n text,\n })\n .info(\"Typing text\");\n\n return this.client.windows.type(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n text,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n}\n","import type { ScreenshotMetadata } from \"@airtop/core/resources/shared\";\nimport type { AirtopWindowScreenshotResponse, ScreenshotData } from \"./AirtopWindowScreenshot.types.js\";\n\nfunction extractMimeAndBase64(dataUrl: string): {\n mimeType: string;\n base64Data: string;\n} {\n const match = dataUrl.match(/^data:(image\\/\\w+);base64,(.+)$/);\n if (match) {\n return { mimeType: match[1], base64Data: match[2] };\n }\n return {\n mimeType: \"image/jpeg\",\n base64Data: dataUrl.replace(/^data:image\\/jpeg;base64,/, \"\"),\n };\n}\n\n/**\n * The result of a screenshot operation.\n */\nexport class AirtopWindowScreenshot {\n data: AirtopWindowScreenshotResponse[\"data\"];\n meta: AirtopWindowScreenshotResponse[\"meta\"];\n warnings: AirtopWindowScreenshotResponse[\"warnings\"];\n errors: AirtopWindowScreenshotResponse[\"errors\"];\n\n /**\n * Creates a new AirtopWindowScreenshot instance.\n * @param screenshotData - Initial screenshot data and configuration\n */\n constructor(screenshotData: AirtopWindowScreenshotResponse) {\n this.meta = screenshotData.meta;\n this.data = screenshotData.data;\n this.warnings = screenshotData.warnings;\n this.errors = screenshotData.errors;\n }\n\n /**\n * Processes the screenshots and returns them as JPG images.\n */\n screenshotsAsJpg(): ScreenshotData[] {\n const screenshots = this.meta.screenshots;\n\n if (!screenshots) {\n return [];\n }\n\n return screenshots.map((screenshot: ScreenshotMetadata, index: number) => {\n if (!screenshot.dataUrl) {\n return {\n index,\n error: new Error(\"Screenshot data URL not found\"),\n success: false,\n };\n }\n\n try {\n const { mimeType, base64Data } = extractMimeAndBase64(screenshot.dataUrl);\n const binaryData = Buffer.from(base64Data, \"base64\");\n return {\n index,\n binaryData,\n mimeType,\n success: true,\n };\n } catch (err) {\n return {\n index,\n error: err instanceof Error ? err : new Error(String(err)),\n success: false,\n };\n }\n });\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type { CommonWindowResponse } from \"./AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"./AirtopWindowClient.js\";\n\n/**\n * Represents a browser window in a browser session.\n */\nexport class AirtopWindow<Response extends CommonWindowResponse> extends AirtopWindowClient {\n /**\n * The window data containing window-specific information.\n */\n data: Response[\"data\"];\n /**\n * The metadata associated with the window.\n */\n meta: Response[\"meta\"];\n /**\n * Warnings associated with the creation of the window.\n * These are non-fatal issues that occurred during window creation.\n */\n warnings: Response[\"warnings\"];\n /**\n * Errors that occurred during window creation or operation.\n * These are fatal issues that prevented window creation.\n */\n errors: Response[\"errors\"];\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowData - Initial window data and configuration\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowData: Response) {\n super(config, sessionId, windowData.data.windowId);\n\n this.meta = windowData.meta;\n this.data = windowData.data;\n this.warnings = windowData.warnings;\n this.errors = windowData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type {\n AirtopSessionResponse,\n SessionData,\n SessionError,\n SessionMetadata,\n SessionWarning,\n} from \"./AirtopSession.types.js\";\nimport { AirtopSessionClient } from \"./AirtopSessionClient.js\";\n\n/**\n * Represents a browser session.\n */\nexport class AirtopSession extends AirtopSessionClient {\n /**\n * The session data containing connection and state information.\n * Includes details about the browser session and its configuration.\n */\n data: SessionData;\n /**\n * The metadata associated with the session.\n * Contains information about the request that created the session.\n */\n meta?: SessionMetadata;\n /**\n * Warnings that occurred during session creation or operation.\n * These are non-fatal issues that didn't prevent session creation.\n */\n warnings?: SessionWarning[];\n /**\n * Errors that occurred during session creation or operation.\n * These are fatal issues that prevented session creation.\n */\n errors?: SessionError[];\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionData - Browser session data\n */\n constructor(config: CommonAirtopConfig, sessionData: AirtopSessionResponse) {\n super(config, sessionData.data.id);\n\n this.meta = sessionData.meta;\n this.data = sessionData.data;\n this.warnings = sessionData.warnings;\n this.errors = sessionData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { AirtopClient } from \"../AirtopClient.js\";\nimport type { AirtopSession } from \"../session/AirtopSession.js\";\nimport type { AirtopSessionClient } from \"../session/index.js\";\nimport type { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport type { AirtopWindowClient } from \"../window/index.js\";\n\n/**\n * Enumeration of available plugin augmentation types.\n * Determines which part of the SDK a plugin can extend.\n * @group Plugin Development\n */\nexport enum AirtopPluginAugmentationType {\n /** Plugin for extending the AirtopClient class */\n AirtopClient = \"AirtopClient\",\n /** Plugin for extending AirtopWindowClient class functionality */\n AirtopWindowClient = \"AirtopWindowClient\",\n /** Plugin for extending AirtopWindow class functionality */\n AirtopWindow = \"AirtopWindow\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSessionClient = \"AirtopSessionClient\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSession = \"AirtopSession\",\n /** Plugin for extending AirtopWindowScreenshot class functionality */\n AirtopWindowScreenshot = \"AirtopWindowScreenshot\",\n}\n\n/**\n * Interface for plugins that extend the main AirtopClient class.\n * Plugins allow you to add custom functionality to the AirtopClient prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopClientPlugin {\n /**\n * Specifies that this plugin augments the main AirtopClient class.\n * This type discrimination allows TypeScript to properly type-check plugin usage.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopClient;\n\n /**\n * Function that performs the augmentation of the AirtopClient prototype.\n *\n * @param prototype - The AirtopClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowClient class functionality.\n * These plugins can modify or enhance the behavior of all window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowClientPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowClient class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowClient;\n\n /**\n * Function that performs the augmentation of the AirtopWindowClient prototype.\n *\n * @param prototype - The AirtopWindowClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSessionClient class functionality.\n * These plugins can modify or enhance the behavior of all session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionClientPlugin {\n /**\n * Specifies that this plugin augments AirtopSessionClient class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient;\n\n /**\n * Function that performs the augmentation of the AirtopSessionClient prototype.\n *\n * @param prototype - The AirtopSessionClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopSessionClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindow class functionality.\n * These plugins can modify or enhance the behavior of window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowPlugin {\n /**\n * Specifies that this plugin augments AirtopWindow class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindow;\n\n /**\n * Function that performs the augmentation of the AirtopWindow prototype.\n *\n * @param prototype - The AirtopWindow class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindow.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSession class functionality.\n * These plugins can modify or enhance the behavior of session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionPlugin {\n /**\n * Specifies that this plugin augments AirtopSession class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSession;\n\n /**\n * Function that performs the augmentation of the AirtopSession prototype.\n *\n * @param prototype - The AirtopSession class prototype being augmented\n */\n augment: (prototype: typeof AirtopSession.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowScreenshot class functionality.\n * These plugins can modify or enhance the behavior of screenshot instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowScreenshotPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowScreenshot class functionality.\n * This type discrimination ensures proper type checking when using screenshot plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowScreenshot;\n\n /**\n * Function that performs the augmentation of the AirtopWindowScreenshot prototype.\n *\n * @param prototype - The AirtopWindowScreenshot class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowScreenshot.prototype) => void;\n}\n\n/**\n * Union type of all possible plugin types.\n * Used when handling plugins generically.\n *\n * @group Plugin Development\n *\n * @see {@link AirtopClientPlugin | AirtopClientPlugin}\n * @see {@link AirtopWindowClientPlugin | AirtopWindowClientPlugin}\n * @see {@link AirtopSessionClientPlugin | AirtopSessionClientPlugin}\n * @see {@link AirtopWindowPlugin | AirtopWindowPlugin}\n * @see {@link AirtopSessionPlugin | AirtopSessionPlugin}\n * @see {@link AirtopWindowScreenshotPlugin | AirtopWindowScreenshotPlugin}\n */\nexport type AirtopPluginType =\n | AirtopClientPlugin\n | AirtopWindowClientPlugin\n | AirtopSessionClientPlugin\n | AirtopWindowPlugin\n | AirtopSessionPlugin\n | AirtopWindowScreenshotPlugin;\n\n/**\n * Interface for registering plugins with the SDK.\n */\nexport interface AirtopPluginRegistration {\n /**\n * Array of plugins to add to the SDK.\n */\n pluginsToAdd: AirtopPluginType[];\n}\n","import { AirtopClient } from \"../AirtopClient.js\";\nimport { AirtopSession, AirtopSessionClient } from \"../session/index.js\";\nimport { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport { AirtopWindow, AirtopWindowClient } from \"../window/index.js\";\nimport { AirtopPluginAugmentationType, type AirtopPluginRegistration } from \"./AirtopPlugin.types.js\";\n\n/**\n * Registers a plugin with the SDK.\n * @param plugin - The plugin to register\n */\nexport function registerAirtopPlugin(plugin: AirtopPluginRegistration): void {\n for (const pluginToAdd of plugin.pluginsToAdd) {\n switch (pluginToAdd.augmentationType) {\n case AirtopPluginAugmentationType.AirtopClient:\n pluginToAdd.augment(AirtopClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSessionClient:\n pluginToAdd.augment(AirtopSessionClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSession:\n pluginToAdd.augment(AirtopSession.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowClient:\n pluginToAdd.augment(AirtopWindowClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindow:\n pluginToAdd.augment(AirtopWindow.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowScreenshot:\n pluginToAdd.augment(AirtopWindowScreenshot.prototype);\n break;\n }\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { MockLogLayer } from \"loglayer\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport { AirtopClient } from \"./AirtopClient.js\";\nimport type { AirtopConstructorConfig } from \"./AirtopClient.types.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport type { AirtopSessionResponse } from \"./session/AirtopSession.types.js\";\nimport type { CommonAirtopConfig } from \"./types.js\";\nimport { AirtopWindow } from \"./window/AirtopWindow.js\";\n\nimport type { AirtopWindowGetInfoResponse } from \"./window/AirtopWindow.types.js\";\n\n/**\n * Creates a no-op version of the client by recursively traversing through its methods\n * and replacing them with empty functions that return resolved promises.\n * @param client - The client instance to create a no-op version of\n * @returns A proxy object that makes all methods no-op\n */\nfunction createNoOpClient<T extends object>(client: T): T {\n return new Proxy(client, {\n get(target: T, prop: string | symbol) {\n const value = Reflect.get(target, prop);\n\n // If it's a function, return a no-op function that returns a resolved promise\n if (typeof value === \"function\") {\n return async () => ({\n data: {},\n meta: {},\n warnings: [],\n errors: [],\n });\n }\n\n // If it's an object (but not null), recursively create a no-op version\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n return createNoOpClient(value);\n }\n\n // Otherwise return the original value\n return value;\n },\n });\n}\n\n/**\n * Generates a mock configuration object for the Airtop SDK for use as the\n * first parameter in the constructor of the AirtopSession and AirtopWindow classes.\n */\nfunction generateCommonAirtopConfigMock(): CommonAirtopConfig {\n const client = new AirtopCore({\n apiKey: \"test-api-key\",\n });\n\n return {\n log: new MockLogLayer(),\n client: createNoOpClient(client),\n };\n}\n\n/**\n * Provides utility methods for creating mock instances of Airtop classes.\n * @hideconstructor\n */\nexport class AirtopMocks {\n /**\n * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.\n */\n static getAirtopBaseMock(config: Partial<CommonAirtopConfig> = {}): AirtopBase {\n return new AirtopBase({\n ...generateCommonAirtopConfigMock(),\n ...config,\n });\n }\n\n /**\n * Creates an Airtop instance with a mock client and data.\n */\n static getAirtopClientMock(config: Partial<AirtopConstructorConfig> = {}): AirtopClient {\n const client = new AirtopClient({\n apiKey: \"test-api-key\",\n ...config,\n });\n\n const mocks = generateCommonAirtopConfigMock();\n\n client[\"log\"] = mocks.log;\n client[\"client\"] = mocks.client;\n\n return client;\n }\n\n /**\n * Creates an AirtopSession instance with a mock client and data.\n */\n static getAirtopSessionMock(responseData: Partial<AirtopSessionResponse> = {}): AirtopSession {\n return new AirtopSession(generateCommonAirtopConfigMock(), {\n data: {\n id: uuidv4(),\n configuration: {},\n chromedriverUrl: \"http://localhost:9515\",\n status: \"active\",\n },\n meta: {},\n warnings: [],\n ...responseData,\n });\n }\n\n /**\n * Creates an AirtopWindow instance with a mock client and data.\n */\n static getAirtopWindowMock({\n sessionId,\n windowData,\n }: {\n sessionId?: string;\n windowData?: AirtopWindowGetInfoResponse;\n } = {}): AirtopWindow<AirtopWindowGetInfoResponse> {\n return new AirtopWindow(generateCommonAirtopConfigMock(), sessionId || uuidv4(), {\n data: {\n targetId: uuidv4(),\n windowId: uuidv4(),\n liveViewUrl: \"http://localhost:4567\",\n },\n meta: {},\n warnings: [],\n ...(windowData || {}),\n });\n }\n}\n"]}
|
package/dist/index.d.cts
CHANGED
@@ -807,11 +807,11 @@ declare class AirtopClient extends AirtopBase {
|
|
807
807
|
*/
|
808
808
|
removeFile(fileId: string, requestOptions?: AirtopRequestOptions): Promise<void>;
|
809
809
|
/**
|
810
|
-
*
|
810
|
+
* List files
|
811
811
|
* @param query
|
812
812
|
* @param requestOptions
|
813
813
|
*/
|
814
|
-
|
814
|
+
listFiles(query: AirtopFileListParams, requestOptions?: AirtopRequestOptions): Promise<AirtopFilesResponse>;
|
815
815
|
/**
|
816
816
|
* List all automations
|
817
817
|
* @param requestOptions - Request options
|
package/dist/index.d.ts
CHANGED
@@ -807,11 +807,11 @@ declare class AirtopClient extends AirtopBase {
|
|
807
807
|
*/
|
808
808
|
removeFile(fileId: string, requestOptions?: AirtopRequestOptions): Promise<void>;
|
809
809
|
/**
|
810
|
-
*
|
810
|
+
* List files
|
811
811
|
* @param query
|
812
812
|
* @param requestOptions
|
813
813
|
*/
|
814
|
-
|
814
|
+
listFiles(query: AirtopFileListParams, requestOptions?: AirtopRequestOptions): Promise<AirtopFilesResponse>;
|
815
815
|
/**
|
816
816
|
* List all automations
|
817
817
|
* @param requestOptions - Request options
|
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.6",
|
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.24",
|
51
51
|
"date-fns": "4.1.0",
|
52
52
|
loglayer: "6.3.3",
|
53
53
|
"serialize-error": "12.0.0",
|
@@ -1012,11 +1012,11 @@ var AirtopClient = class extends AirtopBase {
|
|
1012
1012
|
return this.client.files.delete(fileId, this.resolveRequestOptions(requestOptions));
|
1013
1013
|
}
|
1014
1014
|
/**
|
1015
|
-
*
|
1015
|
+
* List files
|
1016
1016
|
* @param query
|
1017
1017
|
* @param requestOptions
|
1018
1018
|
*/
|
1019
|
-
async
|
1019
|
+
async listFiles(query, requestOptions = {}) {
|
1020
1020
|
return this.client.files.list(query, this.resolveRequestOptions(requestOptions));
|
1021
1021
|
}
|
1022
1022
|
/**
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/AirtopBase.ts","../src/AirtopClient.ts","../src/logger-utils.ts","../src/session/AirtopSessionClient.ts","../src/window/AirtopWindowClient.ts","../src/window/AirtopWindowScreenshot.ts","../src/window/AirtopWindow.ts","../src/session/AirtopSession.ts","../src/plugin/AirtopPlugin.types.ts","../src/plugin/AirtopPlugin.ts","../src/AirtopMocks.ts"],"sourcesContent":["{\n \"name\": \"@airtop/sdk\",\n \"description\": \"Airtop SDK for TypeScript\",\n \"version\": \"1.0.0-alpha2.4\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"exports\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"require\": \"./dist/index.cjs\"\n }\n },\n \"types\": \"./dist/index.d.ts\",\n \"license\": \"MIT\",\n \"repository\": \"airtop-ai/airtop-sdk.git\",\n \"author\": \"Theo Gravity <theo@airtop.ai>\",\n \"keywords\": [\n \"airtop\",\n \"browser automation\",\n \"ai\",\n \"playwright\",\n \"puppeteer\",\n \"selenium\",\n \"web scraping\",\n \"agentic\"\n ],\n \"scripts\": {\n \"build:second-stage\": \"tsup src/index.ts\",\n \"test:e2e\": \"vitest --run\",\n \"build:dev\": \"node_modules/.bin/hash-runner\",\n \"clean\": \"rm -rf .turbo node_modules dist\",\n \"lint\": \"biome check --write --unsafe src && biome format src --write && biome lint src --fix\",\n \"verify-types\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@airtop/json-schema-adapter\": \"workspace:*\",\n \"@airtop/core\": \"0.1.0-alpha.22\",\n \"date-fns\": \"4.1.0\",\n \"loglayer\": \"6.3.3\",\n \"serialize-error\": \"12.0.0\",\n \"uuid\": \"11.1.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"1.9.4\",\n \"@dotenvx/dotenvx\": \"1.39.0\",\n \"@internal/tsconfig\": \"workspace:*\",\n \"deep-utility-types\": \"1.3.1\",\n \"env-var\": \"7.5.0\",\n \"hash-runner\": \"2.0.1\",\n \"nanoid\": \"5.1.5\",\n \"tsup\": \"8.4.0\",\n \"typescript\": \"5.8.2\",\n \"utility-types\": \"3.11.0\",\n \"uuid\": \"11.1.0\",\n \"vitest\": \"3.1.1\",\n \"zod\": \"*\"\n },\n \"bugs\": \"https://github.com/airtop-ai/airtop-sdk/issues\",\n \"engines\": {\n \"node\": \">=18\"\n },\n \"files\": [\n \"dist\"\n ],\n \"homepage\": \"https://airtop.ai\",\n \"optionalDependencies\": {\n \"@airtop/json-schema-adapter-zod\": \"workspace:*\"\n },\n \"packageManager\": \"pnpm@10.5.0\"\n}\n","import type { Airtop as AirtopCore } from \"@airtop/core\";\n/**\n * Import required types and utilities\n */\nimport type { AirtopJsonSchemaAdapter } from \"@airtop/json-schema-adapter\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport type { ILogLayer } from \"loglayer\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"./types.js\";\n\n/**\n * Base class for Airtop SDK implementation\n * Provides common functionality for JSON schema conversion, error handling, and request configuration\n * @hidden\n */\nexport class AirtopBase {\n /**\n * Logger instance for the SDK\n * @internal\n **/\n protected log: ILogLayer;\n /**\n * Airtop Core SDK client instance\n * @internal\n **/\n protected client: AirtopCore;\n\n /**\n * JSON schema adapter for output conversion\n * @internal\n **/\n protected outputJsonAdapter: AirtopJsonSchemaAdapter;\n\n /**\n * Creates a new instance of AirtopBase\n * @param config - Configuration options for the SDK\n */\n constructor(config: CommonAirtopConfig) {\n this.log = config.log.withPrefix(\"[Airtop]\");\n this.client = config.client;\n this.outputJsonAdapter = config.outputSchemaAdapter;\n }\n\n /**\n * Returns the API key used by the SDK\n * @returns API key string\n */\n getApiKey() {\n return this.client.apiKey;\n }\n\n /**\n * Sets the base URL for the Airtop API.\n * @param airtopUrl - The base URL for the Airtop API\n */\n setAirtopUrl(airtopUrl: string) {\n this.client.baseURL = airtopUrl;\n }\n\n /**\n * Sets the API key for authentication.\n * @param apiKey - The API key to use for authentication\n */\n setApiKey(apiKey: string) {\n this.client.apiKey = apiKey;\n }\n\n /**\n * Returns the LogLayer logger instance used by the SDK\n * @returns Logger instance\n * @see {@link https://loglayer.dev | LogLayer Documentation}\n */\n getLogger() {\n return this.log;\n }\n\n /**\n * Converts input data to JSON schema format\n * @param input - Data to be converted (schema input, string, or object)\n * @returns JSON string representation of the input\n * @internal\n */\n protected convertToJsonSchema(input?: any): string {\n if (input && this.outputJsonAdapter?.shouldRunConversion(input)) {\n return JSON.stringify(this.outputJsonAdapter.toJsonSchema(input));\n }\n\n if (typeof input === \"object\") {\n return JSON.stringify(input);\n }\n\n return input as string;\n }\n\n /**\n * Returns the common configuration used by the SDK\n * @returns Common configuration object\n * @internal\n */\n protected getCommonConfig(): CommonAirtopConfig {\n return {\n client: this.client,\n log: this.log,\n };\n }\n\n /**\n * Translates the request options to ones used by the Core SDK\n * @param options - Request options to be resolved\n * @returns Resolved request options with defaults\n * @internal\n */\n protected resolveRequestOptions(options: AirtopRequestOptions = {}) {\n return {\n timeout: secondsToMilliseconds(options.timeoutInSeconds || 60),\n maxRetries: options.maxRetries || 0,\n signal: options.abortSignal,\n };\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { minutesToMilliseconds } from \"date-fns/minutesToMilliseconds\";\nimport { ConsoleTransport, LogLayer } from \"loglayer\";\nimport { serializeError } from \"serialize-error\";\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport type {\n AirtopAutomationData,\n AirtopAutomationListResponse,\n AirtopAutomationUpdateDescriptionConfig,\n AirtopConstructorConfig,\n AirtopFileListParams,\n AirtopFileResponse,\n AirtopFilesResponse,\n AirtopProfile,\n CreateSessionConfig,\n GetSessionsConfig,\n} from \"./AirtopClient.types.js\";\nimport { processLogMessage } from \"./logger-utils.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport { AirtopSessionClient } from \"./session/AirtopSessionClient.js\";\nimport type { AirtopRequestOptions } from \"./types.js\";\n\nconst version = require(\"../package.json\").version;\n\n/**\n * Main Airtop SDK class that provides functionality for managing sessions, profiles, and windows.\n */\nexport class AirtopClient extends AirtopBase {\n /**\n * Creates a new instance of the Airtop SDK.\n * @param config - Configuration options for the Airtop SDK\n */\n constructor(config: AirtopConstructorConfig) {\n super({\n logLevel: config?.logLevel,\n client: new AirtopCore({\n maxRetries: 0,\n timeout: minutesToMilliseconds(1),\n apiKey: config.apiKey,\n baseURL: config?.airtopUrl,\n logLevel: config?.logLevel || \"off\",\n defaultHeaders: {\n \"x-airtop-sdk-source\": \"typescript\",\n \"x-airtop-sdk-version\": version,\n },\n }),\n log:\n config?.logger ||\n new LogLayer({\n errorSerializer: serializeError,\n transport: new ConsoleTransport({\n logger: console,\n messageField: \"message\",\n enabled: config.logLevel !== \"off\",\n level: config.logLevel === \"off\" ? \"error\" : config.logLevel || \"error\",\n }),\n contextFieldName: \"context\",\n metadataFieldName: \"metadata\",\n }),\n outputSchemaAdapter: config.outputSchemaAdapter,\n });\n\n this.log.withPrefix(\"[Airtop SDK]\");\n\n this.client.logLevel = config.logLevel;\n\n this.client.logger = {\n debug: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"debug\", message, rest);\n },\n error: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"error\", message, rest);\n },\n info: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"info\", message, rest);\n },\n warn: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"warn\", message, rest);\n },\n };\n }\n\n /**\n * Creates a new Airtop session.\n * @param config - Configuration options for the session\n * @param options - Request options\n * @returns A new AirtopSession instance\n */\n async createSession(config?: CreateSessionConfig, options: AirtopRequestOptions = {}) {\n const skipWaitSessionReady = config.skipWaitSessionReady ?? false;\n delete config.skipWaitSessionReady;\n\n const sessionResponse = await this.client.sessions.create(\n {\n configuration: config,\n },\n options,\n );\n\n const session = new AirtopSession(this.getCommonConfig(), sessionResponse);\n\n if (skipWaitSessionReady) {\n return session;\n }\n\n await session.waitForSessionReady();\n\n return session;\n }\n\n /**\n * Retrieves multiple sessions by their IDs.\n * @param sessionIds - Array of session IDs to retrieve\n * @param config - Configuration options for the request\n * @param requestOptions - Request options\n * @returns Object containing pagination info and array of AirtopSession instances\n */\n async getSessions(sessionIds: string[], config?: GetSessionsConfig, requestOptions: AirtopRequestOptions = {}) {\n const sessions = await this.client.sessions.list(\n {\n sessionIds,\n limit: config.limit,\n offset: config.offset,\n status: config.status,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return {\n pagination: sessions.data.pagination,\n sessions: sessions.data.sessions.map(\n (session) =>\n new AirtopSession(this.getCommonConfig(), {\n data: session,\n }),\n ),\n errors: sessions.errors,\n meta: sessions.meta,\n warnings: sessions.warnings,\n };\n }\n\n /**\n * Removes one or more profiles.\n * @param profileNames - Name(s) of the profile(s) to remove\n * @param requestOptions - Request options\n */\n async removeProfile(profileNames: string[] | string, requestOptions: AirtopRequestOptions = {}) {\n await this.client.profile.delete(\n {\n profileNames: Array.isArray(profileNames) ? profileNames : [profileNames],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Retrieves a profile by name.\n * @param profileName - Name of the profile to retrieve\n * @param requestOptions - Request options\n * @returns The profile\n */\n async getProfile(profileName: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopProfile> {\n return this.client.profile.get(profileName, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Renames a profile.\n * @param sourceName - Current name of the profile\n * @param targetName - New name for the profile\n * @param requestOptions - Request options\n */\n async renameProfile(sourceName: string, targetName: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.profile.rename(\n {\n source: sourceName,\n target: targetName,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Returns a session client instance for making session-based requests for a given session id.\n *\n * @param sessionId - The session ID to attach to the AirtopSessionClient instance\n **/\n withSessionId(sessionId: string) {\n return new AirtopSessionClient(this.getCommonConfig(), sessionId);\n }\n\n /**\n * Retrieves the status of a request.\n * @param requestId - ID of the request to check\n * @param requestOptions - Request options\n * @returns Status of the request\n */\n async getRequestStatus(requestId: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n requestId,\n })\n .info(\"Getting request status\");\n\n return this.client.requests.getRequestStatus(requestId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Gets a file by ID.\n * @param fileId\n * @param requestOptions\n */\n async getFile(fileId: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopFileResponse> {\n return this.client.files.get(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Removes a file by ID.\n * @param fileId - ID of the file to remove\n * @param requestOptions - Request options\n */\n async removeFile(fileId: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.files.delete(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Lists files\n * @param query\n * @param requestOptions\n */\n async getFiles(query: AirtopFileListParams, requestOptions: AirtopRequestOptions = {}): Promise<AirtopFilesResponse> {\n return this.client.files.list(query, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * List all automations\n * @param requestOptions - Request options\n */\n listAutomations(requestOptions: AirtopRequestOptions = {}): Promise<AirtopAutomationListResponse> {\n return this.client.automations.list(this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Update the description of a specific automation\n * @param body - Request body\n * @param requestOptions - Request options\n */\n updateAutomationDescription(\n body: AirtopAutomationUpdateDescriptionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopAutomationData> {\n return this.client.automations.updateDescription(body, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Delete a specific automation\n * @param automationID - ID of the automation to delete\n * @param requestOptions - Request options\n */\n removeAutomation(automationID: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.automations.delete(automationID, this.resolveRequestOptions(requestOptions));\n }\n}\n","import type { LogLevel } from \"@airtop/core/client\";\nimport type { ILogLayer } from \"loglayer\";\n\nexport const processLogMessage = (log: ILogLayer, logLevel: LogLevel, ...args: unknown[]) => {\n if (logLevel === \"off\") {\n return;\n }\n\n const data: Record<string, unknown> = {};\n let hasData = false;\n let error: Error | null = null;\n const messages: string[] = [];\n\n for (const arg of args) {\n if (arg instanceof Error) {\n error = arg;\n continue;\n }\n\n if (typeof arg === \"object\" && arg !== null) {\n Object.assign(data, arg);\n hasData = true;\n continue;\n }\n\n if (typeof arg === \"string\") {\n messages.push(arg);\n }\n }\n\n let finalMessage = messages.join(\" \").trim();\n\n // next.js uses an \"x\" for the error message when it's an error object\n if (finalMessage === \"⨯\" && error) {\n finalMessage = error?.message || \"\";\n }\n\n if (error && hasData && messages.length > 0) {\n log.withError(error).withMetadata(data)[logLevel](finalMessage);\n } else if (error && messages.length > 0) {\n log.withError(error)[logLevel](finalMessage);\n } else if (hasData && messages.length > 0) {\n log.withMetadata(data)[logLevel](finalMessage);\n } else if (error && hasData && messages.length === 0) {\n log.withError(error).withMetadata(data)[logLevel](\"\");\n } else if (error && messages.length === 0) {\n log.errorOnly(error);\n } else if (hasData && messages.length === 0) {\n log.metadataOnly(data);\n } else {\n log[logLevel](finalMessage);\n }\n};\n","import { NotFoundError } from \"@airtop/core\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\nimport { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowCreateResponse } from \"../window/AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"../window/AirtopWindowClient.js\";\nimport { AirtopSession } from \"./AirtopSession.js\";\nimport type { CreateFileConfig } from \"./AirtopSession.types.js\";\n\n/**\n * Client for making session-specific requests to the Airtop API.\n */\nexport class AirtopSessionClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionId - Browser session id\n */\n constructor(config: CommonAirtopConfig, sessionId: string) {\n super(config);\n this.log = this.log.child().withContext({\n sessionId: sessionId,\n });\n\n this.sessionId = sessionId;\n }\n\n /**\n * Returns the browser session ID.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Gets the state of the session using the attached session id.\n * @param requestOptions - Request options\n * @returns AirtopSession instance or null if not found\n */\n async getSessionInfo(requestOptions: AirtopRequestOptions = {}) {\n try {\n const results = await this.client.sessions.get(this.sessionId, this.resolveRequestOptions(requestOptions));\n\n return new AirtopSession(this.getCommonConfig(), {\n data: results.data,\n meta: results.meta,\n warnings: results.warnings,\n errors: results.errors,\n });\n } catch (e) {\n if (e instanceof NotFoundError) {\n return null;\n }\n\n throw e;\n }\n }\n\n /**\n * Configures the session to save a profile when it terminates.\n * @param profileName - Name of the profile to save\n * @param requestOptions - Request options\n */\n async saveProfileOnTermination(profileName: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n profileName,\n })\n .info(\"Saving profile on termination\");\n\n await this.client.sessions.saveProfileOnTermination(\n profileName,\n {\n sessionId: this.sessionId,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Waits for the session to be in a ready state.\n * @returns The event indicating the session is ready\n */\n async waitForSessionReady() {\n this.log.info(\"Waiting for session to be ready\");\n\n const sessionEvents = await this.client.sessions.getEvents(this.sessionId);\n\n for await (const event of sessionEvents) {\n this.log\n .withMetadata({\n event,\n })\n .info(\"status message received\");\n\n const e = event as any;\n\n if (e.event === \"status\" && e.status === \"running\") {\n return event;\n }\n }\n }\n\n /**\n * Terminates the current session.\n * If the session is already terminated, this method will log a message and return.\n */\n async terminateSession() {\n this.log.info(\"Terminating session\");\n await this.client.sessions.terminate(this.sessionId);\n }\n\n /**\n * Creates a new window in the current session.\n * @param url - The URL to load in the new window\n * @param requestOptions - Request options\n * @returns A new AirtopWindow<AirtopWindowCreateResponse> instance\n */\n async createWindow(url: string, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating window\");\n\n const results = await this.client.windows.create(\n this.sessionId,\n {\n url,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowCreateResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Returns a window client instance for making window-based requests for a given window id.\n *\n * @param windowId - The session ID to attach to the AirtopWindowClient instance\n **/\n withWindowId(windowId: string) {\n return new AirtopWindowClient(this.getCommonConfig(), this.sessionId, windowId);\n }\n\n /**\n * Creates a new file in the current session.\n * @param fileName - The name of the file to create\n * @param config - Additional configuration options for creating the file\n * @param requestOptions - Request options\n */\n createFile(fileName: string, config: CreateFileConfig = {}, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating file\");\n\n return this.client.files.createFile(\n {\n ...config,\n fileName,\n sessionIds: [this.sessionId],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n}\n","import type { WindowPageQueryParams, WindowPaginatedExtractionParams } from \"@airtop/core/resources/windows.js\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\n\nimport type { OperationOutcomeResponse, WindowIDDataResponse } from \"@airtop/core/resources/shared.js\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport { AirtopWindow } from \"./AirtopWindow.js\";\nimport type { AirtopWindowGetInfoResponse } from \"./AirtopWindow.types.js\";\nimport type {\n WindowClickConfig,\n WindowGetConfig,\n WindowHoverConfig,\n WindowLoadUrlConfig,\n WindowMonitorConfig,\n WindowPageQueryConfig,\n WindowPaginatedExtractionConfig,\n WindowPromptResponse,\n WindowScrapeConfig,\n WindowScrapeResponse,\n WindowScreenshotConfig,\n WindowScrollConfig,\n WindowTypeConfig,\n} from \"./AirtopWindowClient.types.js\";\nimport { AirtopWindowScreenshot } from \"./AirtopWindowScreenshot.js\";\n\n/**\n * Client for making window-specific requests to the Airtop API.\n */\nexport class AirtopWindowClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * The window id\n * @internal\n */\n protected windowId: string;\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowId - Browser window id\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowId: string) {\n super(config);\n\n this.log = this.log.child().withContext({\n sessionId,\n windowId,\n });\n\n this.windowId = windowId;\n this.sessionId = sessionId;\n }\n\n /**\n * Gets the window ID.\n */\n getWindowId() {\n return this.windowId;\n }\n\n /**\n * Gets the browser session id associated with the window.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Retrieves a window from a specific session.\n * @param config - Configuration options for the window\n * @param requestOptions - Request options\n * @returns AirtopWindow<AirtopWindowGetInfoResponse> instance\n */\n async getWindowInfo(config?: WindowGetConfig, requestOptions: AirtopRequestOptions = {}) {\n const results = await this.client.windows.get(\n this.windowId,\n {\n sessionId: this.sessionId,\n ...config,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowGetInfoResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Simulates a click on an element in the window.\n * @param elementDescription - Description or selector of the element to click\n * @param config - Additional configuration options for the click action\n * @param requestOptions - Request options\n * @returns Promise resolving to the click operation result\n */\n async click(\n elementDescription: string,\n config?: WindowClickConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n elementDescription,\n })\n .info(\"Clicking on element\");\n\n return this.client.windows.click(\n this.getWindowId(),\n {\n ...config,\n elementDescription,\n sessionId: this.sessionId,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Closes the window.\n * @returns Promise resolving when the window is closed\n */\n async close(): Promise<WindowIDDataResponse> {\n this.log.info(\"Closing window\");\n\n return this.client.windows.close(this.getWindowId(), {\n sessionId: this.sessionId,\n });\n }\n\n /**\n * Simulates hovering over an element in the window.\n * @param elementDescription - Description or selector of the element to hover over\n * @param config - Additional configuration options for the hover action\n * @param requestOptions - Request options\n * @returns Promise resolving to the hover operation result\n */\n async hover(\n elementDescription: string,\n config?: WindowHoverConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata(config).info(\"Hovering over window\");\n\n return this.client.windows.hover(\n this.getWindowId(),\n {\n elementDescription,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Loads a URL in the window.\n * @param url - The URL to load\n * @param config - Additional configuration options for loading the URL\n * @param requestOptions - Request options\n * @returns Promise resolving when the URL is loaded\n */\n async loadUrl(\n url: string,\n config?: WindowLoadUrlConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<OperationOutcomeResponse> {\n this.log\n .withMetadata({\n url,\n })\n .info(\"Loading a URL\");\n\n return this.client.windows.loadURL(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n url,\n ...config,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Monitors the window for changes or events.\n * @param condition - A natural language description of the condition to monitor for in the browser window\n * @param config - Configuration options for monitoring\n * @param requestOptions - Request options\n * @returns Promise resolving to the monitoring operation result\n */\n async monitor(\n condition: string,\n config?: WindowMonitorConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata().info(\"Monitoring window\");\n\n return this.client.windows.monitor(\n this.getWindowId(),\n {\n condition,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs a natural language query on the page content.\n * @param prompt - The natural language query prompt\n * @param config - Configuration options for the query\n * @param requestOptions - Request options\n * @returns Promise resolving to the query results\n */\n async pageQuery(\n prompt: string,\n config?: WindowPageQueryConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a page query\");\n\n const newConfig = config as Omit<WindowPageQueryParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.pageQuery(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n prompt,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs paginated data extraction from the window content.\n * @param prompt - The extraction prompt\n * @param config - Configuration options for the extraction\n * @param requestOptions - Request options\n * @returns Promise resolving to the extracted data\n */\n async paginatedExtraction(\n prompt: string,\n config?: WindowPaginatedExtractionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a paginated extraction\");\n\n const newConfig = config as Omit<WindowPaginatedExtractionParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.paginatedExtraction(\n this.getWindowId(),\n {\n prompt,\n sessionId: this.sessionId,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Scrapes content from the window.\n * @param config - Configuration options for scraping\n * @param requestOptions - Request options\n * @returns Promise resolving to the scraped content\n */\n async scrape(config?: WindowScrapeConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowScrapeResponse> {\n this.log.info(\"Scraping window\");\n\n return this.client.windows.scrape(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Takes a screenshot of the window.\n * @param config - Configuration options for the screenshot\n * @param requestOptions - Request options\n * @returns Promise resolving to the screenshot data\n */\n async screenshot(\n config?: WindowScreenshotConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopWindowScreenshot> {\n this.log.info(\"Screenshotting window\");\n\n const resp = await this.client.windows.screenshot(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n\n return new AirtopWindowScreenshot(resp);\n }\n\n /**\n * Scrolls the window content.\n * @param config - Configuration options for scrolling\n * @param requestOptions - Request options\n * @returns Promise resolving when the scroll operation is complete\n */\n async scroll(config?: WindowScrollConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowPromptResponse> {\n this.log.info(\"Scrolling window\");\n\n return this.client.windows.scroll(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Types text into the window.\n * @param text - The text to type\n * @param config - Configuration options for typing\n * @param requestOptions - Request options\n * @returns Promise resolving when the text has been typed\n */\n async type(text: string, config?: WindowTypeConfig, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n text,\n })\n .info(\"Typing text\");\n\n return this.client.windows.type(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n text,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n}\n","import type { ScreenshotMetadata } from \"@airtop/core/resources/shared\";\nimport type { AirtopWindowScreenshotResponse, ScreenshotData } from \"./AirtopWindowScreenshot.types.js\";\n\nfunction extractMimeAndBase64(dataUrl: string): {\n mimeType: string;\n base64Data: string;\n} {\n const match = dataUrl.match(/^data:(image\\/\\w+);base64,(.+)$/);\n if (match) {\n return { mimeType: match[1], base64Data: match[2] };\n }\n return {\n mimeType: \"image/jpeg\",\n base64Data: dataUrl.replace(/^data:image\\/jpeg;base64,/, \"\"),\n };\n}\n\n/**\n * The result of a screenshot operation.\n */\nexport class AirtopWindowScreenshot {\n data: AirtopWindowScreenshotResponse[\"data\"];\n meta: AirtopWindowScreenshotResponse[\"meta\"];\n warnings: AirtopWindowScreenshotResponse[\"warnings\"];\n errors: AirtopWindowScreenshotResponse[\"errors\"];\n\n /**\n * Creates a new AirtopWindowScreenshot instance.\n * @param screenshotData - Initial screenshot data and configuration\n */\n constructor(screenshotData: AirtopWindowScreenshotResponse) {\n this.meta = screenshotData.meta;\n this.data = screenshotData.data;\n this.warnings = screenshotData.warnings;\n this.errors = screenshotData.errors;\n }\n\n /**\n * Processes the screenshots and returns them as JPG images.\n */\n screenshotsAsJpg(): ScreenshotData[] {\n const screenshots = this.meta.screenshots;\n\n if (!screenshots) {\n return [];\n }\n\n return screenshots.map((screenshot: ScreenshotMetadata, index: number) => {\n if (!screenshot.dataUrl) {\n return {\n index,\n error: new Error(\"Screenshot data URL not found\"),\n success: false,\n };\n }\n\n try {\n const { mimeType, base64Data } = extractMimeAndBase64(screenshot.dataUrl);\n const binaryData = Buffer.from(base64Data, \"base64\");\n return {\n index,\n binaryData,\n mimeType,\n success: true,\n };\n } catch (err) {\n return {\n index,\n error: err instanceof Error ? err : new Error(String(err)),\n success: false,\n };\n }\n });\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type { CommonWindowResponse } from \"./AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"./AirtopWindowClient.js\";\n\n/**\n * Represents a browser window in a browser session.\n */\nexport class AirtopWindow<Response extends CommonWindowResponse> extends AirtopWindowClient {\n /**\n * The window data containing window-specific information.\n */\n data: Response[\"data\"];\n /**\n * The metadata associated with the window.\n */\n meta: Response[\"meta\"];\n /**\n * Warnings associated with the creation of the window.\n * These are non-fatal issues that occurred during window creation.\n */\n warnings: Response[\"warnings\"];\n /**\n * Errors that occurred during window creation or operation.\n * These are fatal issues that prevented window creation.\n */\n errors: Response[\"errors\"];\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowData - Initial window data and configuration\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowData: Response) {\n super(config, sessionId, windowData.data.windowId);\n\n this.meta = windowData.meta;\n this.data = windowData.data;\n this.warnings = windowData.warnings;\n this.errors = windowData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type {\n AirtopSessionResponse,\n SessionData,\n SessionError,\n SessionMetadata,\n SessionWarning,\n} from \"./AirtopSession.types.js\";\nimport { AirtopSessionClient } from \"./AirtopSessionClient.js\";\n\n/**\n * Represents a browser session.\n */\nexport class AirtopSession extends AirtopSessionClient {\n /**\n * The session data containing connection and state information.\n * Includes details about the browser session and its configuration.\n */\n data: SessionData;\n /**\n * The metadata associated with the session.\n * Contains information about the request that created the session.\n */\n meta?: SessionMetadata;\n /**\n * Warnings that occurred during session creation or operation.\n * These are non-fatal issues that didn't prevent session creation.\n */\n warnings?: SessionWarning[];\n /**\n * Errors that occurred during session creation or operation.\n * These are fatal issues that prevented session creation.\n */\n errors?: SessionError[];\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionData - Browser session data\n */\n constructor(config: CommonAirtopConfig, sessionData: AirtopSessionResponse) {\n super(config, sessionData.data.id);\n\n this.meta = sessionData.meta;\n this.data = sessionData.data;\n this.warnings = sessionData.warnings;\n this.errors = sessionData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { AirtopClient } from \"../AirtopClient.js\";\nimport type { AirtopSession } from \"../session/AirtopSession.js\";\nimport type { AirtopSessionClient } from \"../session/index.js\";\nimport type { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport type { AirtopWindowClient } from \"../window/index.js\";\n\n/**\n * Enumeration of available plugin augmentation types.\n * Determines which part of the SDK a plugin can extend.\n * @group Plugin Development\n */\nexport enum AirtopPluginAugmentationType {\n /** Plugin for extending the AirtopClient class */\n AirtopClient = \"AirtopClient\",\n /** Plugin for extending AirtopWindowClient class functionality */\n AirtopWindowClient = \"AirtopWindowClient\",\n /** Plugin for extending AirtopWindow class functionality */\n AirtopWindow = \"AirtopWindow\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSessionClient = \"AirtopSessionClient\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSession = \"AirtopSession\",\n /** Plugin for extending AirtopWindowScreenshot class functionality */\n AirtopWindowScreenshot = \"AirtopWindowScreenshot\",\n}\n\n/**\n * Interface for plugins that extend the main AirtopClient class.\n * Plugins allow you to add custom functionality to the AirtopClient prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopClientPlugin {\n /**\n * Specifies that this plugin augments the main AirtopClient class.\n * This type discrimination allows TypeScript to properly type-check plugin usage.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopClient;\n\n /**\n * Function that performs the augmentation of the AirtopClient prototype.\n *\n * @param prototype - The AirtopClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowClient class functionality.\n * These plugins can modify or enhance the behavior of all window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowClientPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowClient class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowClient;\n\n /**\n * Function that performs the augmentation of the AirtopWindowClient prototype.\n *\n * @param prototype - The AirtopWindowClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSessionClient class functionality.\n * These plugins can modify or enhance the behavior of all session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionClientPlugin {\n /**\n * Specifies that this plugin augments AirtopSessionClient class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient;\n\n /**\n * Function that performs the augmentation of the AirtopSessionClient prototype.\n *\n * @param prototype - The AirtopSessionClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopSessionClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindow class functionality.\n * These plugins can modify or enhance the behavior of window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowPlugin {\n /**\n * Specifies that this plugin augments AirtopWindow class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindow;\n\n /**\n * Function that performs the augmentation of the AirtopWindow prototype.\n *\n * @param prototype - The AirtopWindow class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindow.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSession class functionality.\n * These plugins can modify or enhance the behavior of session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionPlugin {\n /**\n * Specifies that this plugin augments AirtopSession class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSession;\n\n /**\n * Function that performs the augmentation of the AirtopSession prototype.\n *\n * @param prototype - The AirtopSession class prototype being augmented\n */\n augment: (prototype: typeof AirtopSession.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowScreenshot class functionality.\n * These plugins can modify or enhance the behavior of screenshot instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowScreenshotPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowScreenshot class functionality.\n * This type discrimination ensures proper type checking when using screenshot plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowScreenshot;\n\n /**\n * Function that performs the augmentation of the AirtopWindowScreenshot prototype.\n *\n * @param prototype - The AirtopWindowScreenshot class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowScreenshot.prototype) => void;\n}\n\n/**\n * Union type of all possible plugin types.\n * Used when handling plugins generically.\n *\n * @group Plugin Development\n *\n * @see {@link AirtopClientPlugin | AirtopClientPlugin}\n * @see {@link AirtopWindowClientPlugin | AirtopWindowClientPlugin}\n * @see {@link AirtopSessionClientPlugin | AirtopSessionClientPlugin}\n * @see {@link AirtopWindowPlugin | AirtopWindowPlugin}\n * @see {@link AirtopSessionPlugin | AirtopSessionPlugin}\n * @see {@link AirtopWindowScreenshotPlugin | AirtopWindowScreenshotPlugin}\n */\nexport type AirtopPluginType =\n | AirtopClientPlugin\n | AirtopWindowClientPlugin\n | AirtopSessionClientPlugin\n | AirtopWindowPlugin\n | AirtopSessionPlugin\n | AirtopWindowScreenshotPlugin;\n\n/**\n * Interface for registering plugins with the SDK.\n */\nexport interface AirtopPluginRegistration {\n /**\n * Array of plugins to add to the SDK.\n */\n pluginsToAdd: AirtopPluginType[];\n}\n","import { AirtopClient } from \"../AirtopClient.js\";\nimport { AirtopSession, AirtopSessionClient } from \"../session/index.js\";\nimport { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport { AirtopWindow, AirtopWindowClient } from \"../window/index.js\";\nimport { AirtopPluginAugmentationType, type AirtopPluginRegistration } from \"./AirtopPlugin.types.js\";\n\n/**\n * Registers a plugin with the SDK.\n * @param plugin - The plugin to register\n */\nexport function registerAirtopPlugin(plugin: AirtopPluginRegistration): void {\n for (const pluginToAdd of plugin.pluginsToAdd) {\n switch (pluginToAdd.augmentationType) {\n case AirtopPluginAugmentationType.AirtopClient:\n pluginToAdd.augment(AirtopClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSessionClient:\n pluginToAdd.augment(AirtopSessionClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSession:\n pluginToAdd.augment(AirtopSession.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowClient:\n pluginToAdd.augment(AirtopWindowClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindow:\n pluginToAdd.augment(AirtopWindow.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowScreenshot:\n pluginToAdd.augment(AirtopWindowScreenshot.prototype);\n break;\n }\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { MockLogLayer } from \"loglayer\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport { AirtopClient } from \"./AirtopClient.js\";\nimport type { AirtopConstructorConfig } from \"./AirtopClient.types.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport type { AirtopSessionResponse } from \"./session/AirtopSession.types.js\";\nimport type { CommonAirtopConfig } from \"./types.js\";\nimport { AirtopWindow } from \"./window/AirtopWindow.js\";\n\nimport type { AirtopWindowGetInfoResponse } from \"./window/AirtopWindow.types.js\";\n\n/**\n * Creates a no-op version of the client by recursively traversing through its methods\n * and replacing them with empty functions that return resolved promises.\n * @param client - The client instance to create a no-op version of\n * @returns A proxy object that makes all methods no-op\n */\nfunction createNoOpClient<T extends object>(client: T): T {\n return new Proxy(client, {\n get(target: T, prop: string | symbol) {\n const value = Reflect.get(target, prop);\n\n // If it's a function, return a no-op function that returns a resolved promise\n if (typeof value === \"function\") {\n return async () => ({\n data: {},\n meta: {},\n warnings: [],\n errors: [],\n });\n }\n\n // If it's an object (but not null), recursively create a no-op version\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n return createNoOpClient(value);\n }\n\n // Otherwise return the original value\n return value;\n },\n });\n}\n\n/**\n * Generates a mock configuration object for the Airtop SDK for use as the\n * first parameter in the constructor of the AirtopSession and AirtopWindow classes.\n */\nfunction generateCommonAirtopConfigMock(): CommonAirtopConfig {\n const client = new AirtopCore({\n apiKey: \"test-api-key\",\n });\n\n return {\n log: new MockLogLayer(),\n client: createNoOpClient(client),\n };\n}\n\n/**\n * Provides utility methods for creating mock instances of Airtop classes.\n * @hideconstructor\n */\nexport class AirtopMocks {\n /**\n * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.\n */\n static getAirtopBaseMock(config: Partial<CommonAirtopConfig> = {}): AirtopBase {\n return new AirtopBase({\n ...generateCommonAirtopConfigMock(),\n ...config,\n });\n }\n\n /**\n * Creates an Airtop instance with a mock client and data.\n */\n static getAirtopClientMock(config: Partial<AirtopConstructorConfig> = {}): AirtopClient {\n const client = new AirtopClient({\n apiKey: \"test-api-key\",\n ...config,\n });\n\n const mocks = generateCommonAirtopConfigMock();\n\n client[\"log\"] = mocks.log;\n client[\"client\"] = mocks.client;\n\n return client;\n }\n\n /**\n * Creates an AirtopSession instance with a mock client and data.\n */\n static getAirtopSessionMock(responseData: Partial<AirtopSessionResponse> = {}): AirtopSession {\n return new AirtopSession(generateCommonAirtopConfigMock(), {\n data: {\n id: uuidv4(),\n configuration: {},\n chromedriverUrl: \"http://localhost:9515\",\n status: \"active\",\n },\n meta: {},\n warnings: [],\n ...responseData,\n });\n }\n\n /**\n * Creates an AirtopWindow instance with a mock client and data.\n */\n static getAirtopWindowMock({\n sessionId,\n windowData,\n }: {\n sessionId?: string;\n windowData?: AirtopWindowGetInfoResponse;\n } = {}): AirtopWindow<AirtopWindowGetInfoResponse> {\n return new AirtopWindow(generateCommonAirtopConfigMock(), sessionId || uuidv4(), {\n data: {\n targetId: uuidv4(),\n windowId: uuidv4(),\n liveViewUrl: \"http://localhost:4567\",\n },\n meta: {},\n warnings: [],\n ...(windowData || {}),\n });\n }\n}\n"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,SAAW;AAAA,MACX,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,QAAU;AAAA,MACV,SAAW;AAAA,QACT,QAAU;AAAA,UACR,OAAS;AAAA,UACT,QAAU;AAAA,QACZ;AAAA,QACA,SAAW;AAAA,UACT,OAAS;AAAA,UACT,SAAW;A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AKA,OAAO,qBAAqB,eAA+C,CAAC,GAAkB;AAC5F,WAAO,IAAI,cAAc,+BAA+B,GAAG;AAAA,MACzD,MAAM;AAAA,QACJ,IAAI,OAAO;AAAA,QACX,eAAe,CAAC;AAAA,QAChB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,MACV;AAAA,MACA,MAAM,CAAC;AAAA,MACP,UAAU,CAAC;AAAA,MACX,GAAG;AAAA,IACL,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,oBAAoB;AAAA,IACzB;AAAA,IACA;AAAA,EACF,IAGI,CAAC,GAA8C;AACjD,WAAO,IAAI,aAAa,+BAA+B,GAAG,aAAa,OAAO,GAAG;AAAA,MAC/E,MAAM;AAAA,QACJ,UAAU,OAAO;AAAA,QACjB,UAAU,OAAO;AAAA,QACjB,aAAa;AAAA,MACf;AAAA,MACA,MAAM,CAAC;AAAA,MACP,UAAU,CAAC;AAAA,MACX,GAAI,cAAc,CAAC;AAAA,IACrB,CAAC;AAAA,EACH;AACF;","names":["secondsToMilliseconds","secondsToMilliseconds","AirtopPluginAugmentationType","AirtopCore","AirtopCore"]}
|
1
|
+
{"version":3,"sources":["../package.json","../src/AirtopBase.ts","../src/AirtopClient.ts","../src/logger-utils.ts","../src/session/AirtopSessionClient.ts","../src/window/AirtopWindowClient.ts","../src/window/AirtopWindowScreenshot.ts","../src/window/AirtopWindow.ts","../src/session/AirtopSession.ts","../src/plugin/AirtopPlugin.types.ts","../src/plugin/AirtopPlugin.ts","../src/AirtopMocks.ts"],"sourcesContent":["{\n \"name\": \"@airtop/sdk\",\n \"description\": \"Airtop SDK for TypeScript\",\n \"version\": \"1.0.0-alpha2.6\",\n \"type\": \"module\",\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"exports\": {\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\"\n },\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"require\": \"./dist/index.cjs\"\n }\n },\n \"types\": \"./dist/index.d.ts\",\n \"license\": \"MIT\",\n \"repository\": \"airtop-ai/airtop-sdk.git\",\n \"author\": \"Theo Gravity <theo@airtop.ai>\",\n \"keywords\": [\n \"airtop\",\n \"browser automation\",\n \"ai\",\n \"playwright\",\n \"puppeteer\",\n \"selenium\",\n \"web scraping\",\n \"agentic\"\n ],\n \"scripts\": {\n \"build:second-stage\": \"tsup src/index.ts\",\n \"test:e2e\": \"vitest --run\",\n \"build:dev\": \"node_modules/.bin/hash-runner\",\n \"clean\": \"rm -rf .turbo node_modules dist\",\n \"lint\": \"biome check --write --unsafe src && biome format src --write && biome lint src --fix\",\n \"verify-types\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@airtop/json-schema-adapter\": \"workspace:*\",\n \"@airtop/core\": \"0.1.0-alpha.24\",\n \"date-fns\": \"4.1.0\",\n \"loglayer\": \"6.3.3\",\n \"serialize-error\": \"12.0.0\",\n \"uuid\": \"11.1.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"1.9.4\",\n \"@dotenvx/dotenvx\": \"1.39.0\",\n \"@internal/tsconfig\": \"workspace:*\",\n \"deep-utility-types\": \"1.3.1\",\n \"env-var\": \"7.5.0\",\n \"hash-runner\": \"2.0.1\",\n \"nanoid\": \"5.1.5\",\n \"tsup\": \"8.4.0\",\n \"typescript\": \"5.8.2\",\n \"utility-types\": \"3.11.0\",\n \"uuid\": \"11.1.0\",\n \"vitest\": \"3.1.1\",\n \"zod\": \"*\"\n },\n \"bugs\": \"https://github.com/airtop-ai/airtop-sdk/issues\",\n \"engines\": {\n \"node\": \">=18\"\n },\n \"files\": [\n \"dist\"\n ],\n \"homepage\": \"https://airtop.ai\",\n \"optionalDependencies\": {\n \"@airtop/json-schema-adapter-zod\": \"workspace:*\"\n },\n \"packageManager\": \"pnpm@10.5.0\"\n}\n","import type { Airtop as AirtopCore } from \"@airtop/core\";\n/**\n * Import required types and utilities\n */\nimport type { AirtopJsonSchemaAdapter } from \"@airtop/json-schema-adapter\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport type { ILogLayer } from \"loglayer\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"./types.js\";\n\n/**\n * Base class for Airtop SDK implementation\n * Provides common functionality for JSON schema conversion, error handling, and request configuration\n * @hidden\n */\nexport class AirtopBase {\n /**\n * Logger instance for the SDK\n * @internal\n **/\n protected log: ILogLayer;\n /**\n * Airtop Core SDK client instance\n * @internal\n **/\n protected client: AirtopCore;\n\n /**\n * JSON schema adapter for output conversion\n * @internal\n **/\n protected outputJsonAdapter: AirtopJsonSchemaAdapter;\n\n /**\n * Creates a new instance of AirtopBase\n * @param config - Configuration options for the SDK\n */\n constructor(config: CommonAirtopConfig) {\n this.log = config.log.withPrefix(\"[Airtop]\");\n this.client = config.client;\n this.outputJsonAdapter = config.outputSchemaAdapter;\n }\n\n /**\n * Returns the API key used by the SDK\n * @returns API key string\n */\n getApiKey() {\n return this.client.apiKey;\n }\n\n /**\n * Sets the base URL for the Airtop API.\n * @param airtopUrl - The base URL for the Airtop API\n */\n setAirtopUrl(airtopUrl: string) {\n this.client.baseURL = airtopUrl;\n }\n\n /**\n * Sets the API key for authentication.\n * @param apiKey - The API key to use for authentication\n */\n setApiKey(apiKey: string) {\n this.client.apiKey = apiKey;\n }\n\n /**\n * Returns the LogLayer logger instance used by the SDK\n * @returns Logger instance\n * @see {@link https://loglayer.dev | LogLayer Documentation}\n */\n getLogger() {\n return this.log;\n }\n\n /**\n * Converts input data to JSON schema format\n * @param input - Data to be converted (schema input, string, or object)\n * @returns JSON string representation of the input\n * @internal\n */\n protected convertToJsonSchema(input?: any): string {\n if (input && this.outputJsonAdapter?.shouldRunConversion(input)) {\n return JSON.stringify(this.outputJsonAdapter.toJsonSchema(input));\n }\n\n if (typeof input === \"object\") {\n return JSON.stringify(input);\n }\n\n return input as string;\n }\n\n /**\n * Returns the common configuration used by the SDK\n * @returns Common configuration object\n * @internal\n */\n protected getCommonConfig(): CommonAirtopConfig {\n return {\n client: this.client,\n log: this.log,\n };\n }\n\n /**\n * Translates the request options to ones used by the Core SDK\n * @param options - Request options to be resolved\n * @returns Resolved request options with defaults\n * @internal\n */\n protected resolveRequestOptions(options: AirtopRequestOptions = {}) {\n return {\n timeout: secondsToMilliseconds(options.timeoutInSeconds || 60),\n maxRetries: options.maxRetries || 0,\n signal: options.abortSignal,\n };\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { minutesToMilliseconds } from \"date-fns/minutesToMilliseconds\";\nimport { ConsoleTransport, LogLayer } from \"loglayer\";\nimport { serializeError } from \"serialize-error\";\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport type {\n AirtopAutomationData,\n AirtopAutomationListResponse,\n AirtopAutomationUpdateDescriptionConfig,\n AirtopConstructorConfig,\n AirtopFileListParams,\n AirtopFileResponse,\n AirtopFilesResponse,\n AirtopProfile,\n CreateSessionConfig,\n GetSessionsConfig,\n} from \"./AirtopClient.types.js\";\nimport { processLogMessage } from \"./logger-utils.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport { AirtopSessionClient } from \"./session/AirtopSessionClient.js\";\nimport type { AirtopRequestOptions } from \"./types.js\";\n\nconst version = require(\"../package.json\").version;\n\n/**\n * Main Airtop SDK class that provides functionality for managing sessions, profiles, and windows.\n */\nexport class AirtopClient extends AirtopBase {\n /**\n * Creates a new instance of the Airtop SDK.\n * @param config - Configuration options for the Airtop SDK\n */\n constructor(config: AirtopConstructorConfig) {\n super({\n logLevel: config?.logLevel,\n client: new AirtopCore({\n maxRetries: 0,\n timeout: minutesToMilliseconds(1),\n apiKey: config.apiKey,\n baseURL: config?.airtopUrl,\n logLevel: config?.logLevel || \"off\",\n defaultHeaders: {\n \"x-airtop-sdk-source\": \"typescript\",\n \"x-airtop-sdk-version\": version,\n },\n }),\n log:\n config?.logger ||\n new LogLayer({\n errorSerializer: serializeError,\n transport: new ConsoleTransport({\n logger: console,\n messageField: \"message\",\n enabled: config.logLevel !== \"off\",\n level: config.logLevel === \"off\" ? \"error\" : config.logLevel || \"error\",\n }),\n contextFieldName: \"context\",\n metadataFieldName: \"metadata\",\n }),\n outputSchemaAdapter: config.outputSchemaAdapter,\n });\n\n this.log.withPrefix(\"[Airtop SDK]\");\n\n this.client.logLevel = config.logLevel;\n\n this.client.logger = {\n debug: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"debug\", message, rest);\n },\n error: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"error\", message, rest);\n },\n info: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"info\", message, rest);\n },\n warn: (message: string, ...rest: unknown[]) => {\n processLogMessage(this.log, \"warn\", message, rest);\n },\n };\n }\n\n /**\n * Creates a new Airtop session.\n * @param config - Configuration options for the session\n * @param options - Request options\n * @returns A new AirtopSession instance\n */\n async createSession(config?: CreateSessionConfig, options: AirtopRequestOptions = {}) {\n const skipWaitSessionReady = config.skipWaitSessionReady ?? false;\n delete config.skipWaitSessionReady;\n\n const sessionResponse = await this.client.sessions.create(\n {\n configuration: config,\n },\n options,\n );\n\n const session = new AirtopSession(this.getCommonConfig(), sessionResponse);\n\n if (skipWaitSessionReady) {\n return session;\n }\n\n await session.waitForSessionReady();\n\n return session;\n }\n\n /**\n * Retrieves multiple sessions by their IDs.\n * @param sessionIds - Array of session IDs to retrieve\n * @param config - Configuration options for the request\n * @param requestOptions - Request options\n * @returns Object containing pagination info and array of AirtopSession instances\n */\n async getSessions(sessionIds: string[], config?: GetSessionsConfig, requestOptions: AirtopRequestOptions = {}) {\n const sessions = await this.client.sessions.list(\n {\n sessionIds,\n limit: config.limit,\n offset: config.offset,\n status: config.status,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return {\n pagination: sessions.data.pagination,\n sessions: sessions.data.sessions.map(\n (session) =>\n new AirtopSession(this.getCommonConfig(), {\n data: session,\n }),\n ),\n errors: sessions.errors,\n meta: sessions.meta,\n warnings: sessions.warnings,\n };\n }\n\n /**\n * Removes one or more profiles.\n * @param profileNames - Name(s) of the profile(s) to remove\n * @param requestOptions - Request options\n */\n async removeProfile(profileNames: string[] | string, requestOptions: AirtopRequestOptions = {}) {\n await this.client.profile.delete(\n {\n profileNames: Array.isArray(profileNames) ? profileNames : [profileNames],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Retrieves a profile by name.\n * @param profileName - Name of the profile to retrieve\n * @param requestOptions - Request options\n * @returns The profile\n */\n async getProfile(profileName: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopProfile> {\n return this.client.profile.get(profileName, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Renames a profile.\n * @param sourceName - Current name of the profile\n * @param targetName - New name for the profile\n * @param requestOptions - Request options\n */\n async renameProfile(sourceName: string, targetName: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.profile.rename(\n {\n source: sourceName,\n target: targetName,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Returns a session client instance for making session-based requests for a given session id.\n *\n * @param sessionId - The session ID to attach to the AirtopSessionClient instance\n **/\n withSessionId(sessionId: string) {\n return new AirtopSessionClient(this.getCommonConfig(), sessionId);\n }\n\n /**\n * Retrieves the status of a request.\n * @param requestId - ID of the request to check\n * @param requestOptions - Request options\n * @returns Status of the request\n */\n async getRequestStatus(requestId: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n requestId,\n })\n .info(\"Getting request status\");\n\n return this.client.requests.getRequestStatus(requestId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Gets a file by ID.\n * @param fileId\n * @param requestOptions\n */\n async getFile(fileId: string, requestOptions: AirtopRequestOptions = {}): Promise<AirtopFileResponse> {\n return this.client.files.get(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Removes a file by ID.\n * @param fileId - ID of the file to remove\n * @param requestOptions - Request options\n */\n async removeFile(fileId: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.files.delete(fileId, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * List files\n * @param query\n * @param requestOptions\n */\n async listFiles(\n query: AirtopFileListParams,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopFilesResponse> {\n return this.client.files.list(query, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * List all automations\n * @param requestOptions - Request options\n */\n listAutomations(requestOptions: AirtopRequestOptions = {}): Promise<AirtopAutomationListResponse> {\n return this.client.automations.list(this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Update the description of a specific automation\n * @param body - Request body\n * @param requestOptions - Request options\n */\n updateAutomationDescription(\n body: AirtopAutomationUpdateDescriptionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopAutomationData> {\n return this.client.automations.updateDescription(body, this.resolveRequestOptions(requestOptions));\n }\n\n /**\n * Delete a specific automation\n * @param automationID - ID of the automation to delete\n * @param requestOptions - Request options\n */\n removeAutomation(automationID: string, requestOptions: AirtopRequestOptions = {}) {\n return this.client.automations.delete(automationID, this.resolveRequestOptions(requestOptions));\n }\n}\n","import type { LogLevel } from \"@airtop/core/client\";\nimport type { ILogLayer } from \"loglayer\";\n\nexport const processLogMessage = (log: ILogLayer, logLevel: LogLevel, ...args: unknown[]) => {\n if (logLevel === \"off\") {\n return;\n }\n\n const data: Record<string, unknown> = {};\n let hasData = false;\n let error: Error | null = null;\n const messages: string[] = [];\n\n for (const arg of args) {\n if (arg instanceof Error) {\n error = arg;\n continue;\n }\n\n if (typeof arg === \"object\" && arg !== null) {\n Object.assign(data, arg);\n hasData = true;\n continue;\n }\n\n if (typeof arg === \"string\") {\n messages.push(arg);\n }\n }\n\n let finalMessage = messages.join(\" \").trim();\n\n // next.js uses an \"x\" for the error message when it's an error object\n if (finalMessage === \"⨯\" && error) {\n finalMessage = error?.message || \"\";\n }\n\n if (error && hasData && messages.length > 0) {\n log.withError(error).withMetadata(data)[logLevel](finalMessage);\n } else if (error && messages.length > 0) {\n log.withError(error)[logLevel](finalMessage);\n } else if (hasData && messages.length > 0) {\n log.withMetadata(data)[logLevel](finalMessage);\n } else if (error && hasData && messages.length === 0) {\n log.withError(error).withMetadata(data)[logLevel](\"\");\n } else if (error && messages.length === 0) {\n log.errorOnly(error);\n } else if (hasData && messages.length === 0) {\n log.metadataOnly(data);\n } else {\n log[logLevel](finalMessage);\n }\n};\n","import { NotFoundError } from \"@airtop/core\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\nimport { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowCreateResponse } from \"../window/AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"../window/AirtopWindowClient.js\";\nimport { AirtopSession } from \"./AirtopSession.js\";\nimport type { CreateFileConfig } from \"./AirtopSession.types.js\";\n\n/**\n * Client for making session-specific requests to the Airtop API.\n */\nexport class AirtopSessionClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionId - Browser session id\n */\n constructor(config: CommonAirtopConfig, sessionId: string) {\n super(config);\n this.log = this.log.child().withContext({\n sessionId: sessionId,\n });\n\n this.sessionId = sessionId;\n }\n\n /**\n * Returns the browser session ID.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Gets the state of the session using the attached session id.\n * @param requestOptions - Request options\n * @returns AirtopSession instance or null if not found\n */\n async getSessionInfo(requestOptions: AirtopRequestOptions = {}) {\n try {\n const results = await this.client.sessions.get(this.sessionId, this.resolveRequestOptions(requestOptions));\n\n return new AirtopSession(this.getCommonConfig(), {\n data: results.data,\n meta: results.meta,\n warnings: results.warnings,\n errors: results.errors,\n });\n } catch (e) {\n if (e instanceof NotFoundError) {\n return null;\n }\n\n throw e;\n }\n }\n\n /**\n * Configures the session to save a profile when it terminates.\n * @param profileName - Name of the profile to save\n * @param requestOptions - Request options\n */\n async saveProfileOnTermination(profileName: string, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n profileName,\n })\n .info(\"Saving profile on termination\");\n\n await this.client.sessions.saveProfileOnTermination(\n profileName,\n {\n sessionId: this.sessionId,\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n\n /**\n * Waits for the session to be in a ready state.\n * @returns The event indicating the session is ready\n */\n async waitForSessionReady() {\n this.log.info(\"Waiting for session to be ready\");\n\n const sessionEvents = await this.client.sessions.getEvents(this.sessionId);\n\n for await (const event of sessionEvents) {\n this.log\n .withMetadata({\n event,\n })\n .info(\"status message received\");\n\n const e = event as any;\n\n if (e.event === \"status\" && e.status === \"running\") {\n return event;\n }\n }\n }\n\n /**\n * Terminates the current session.\n * If the session is already terminated, this method will log a message and return.\n */\n async terminateSession() {\n this.log.info(\"Terminating session\");\n await this.client.sessions.terminate(this.sessionId);\n }\n\n /**\n * Creates a new window in the current session.\n * @param url - The URL to load in the new window\n * @param requestOptions - Request options\n * @returns A new AirtopWindow<AirtopWindowCreateResponse> instance\n */\n async createWindow(url: string, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating window\");\n\n const results = await this.client.windows.create(\n this.sessionId,\n {\n url,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowCreateResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Returns a window client instance for making window-based requests for a given window id.\n *\n * @param windowId - The session ID to attach to the AirtopWindowClient instance\n **/\n withWindowId(windowId: string) {\n return new AirtopWindowClient(this.getCommonConfig(), this.sessionId, windowId);\n }\n\n /**\n * Creates a new file in the current session.\n * @param fileName - The name of the file to create\n * @param config - Additional configuration options for creating the file\n * @param requestOptions - Request options\n */\n createFile(fileName: string, config: CreateFileConfig = {}, requestOptions: AirtopRequestOptions = {}) {\n this.log.info(\"Creating file\");\n\n return this.client.files.createFile(\n {\n ...config,\n fileName,\n sessionIds: [this.sessionId],\n },\n this.resolveRequestOptions(requestOptions),\n );\n }\n}\n","import type { WindowPageQueryParams, WindowPaginatedExtractionParams } from \"@airtop/core/resources/windows.js\";\nimport { AirtopBase } from \"../AirtopBase.js\";\nimport type { AirtopRequestOptions, CommonAirtopConfig } from \"../types.js\";\n\nimport type { OperationOutcomeResponse, WindowIDDataResponse } from \"@airtop/core/resources/shared.js\";\nimport { secondsToMilliseconds } from \"date-fns\";\nimport { AirtopWindow } from \"./AirtopWindow.js\";\nimport type { AirtopWindowGetInfoResponse } from \"./AirtopWindow.types.js\";\nimport type {\n WindowClickConfig,\n WindowGetConfig,\n WindowHoverConfig,\n WindowLoadUrlConfig,\n WindowMonitorConfig,\n WindowPageQueryConfig,\n WindowPaginatedExtractionConfig,\n WindowPromptResponse,\n WindowScrapeConfig,\n WindowScrapeResponse,\n WindowScreenshotConfig,\n WindowScrollConfig,\n WindowTypeConfig,\n} from \"./AirtopWindowClient.types.js\";\nimport { AirtopWindowScreenshot } from \"./AirtopWindowScreenshot.js\";\n\n/**\n * Client for making window-specific requests to the Airtop API.\n */\nexport class AirtopWindowClient extends AirtopBase {\n /**\n * The browser session id\n * @internal\n */\n protected sessionId: string;\n\n /**\n * The window id\n * @internal\n */\n protected windowId: string;\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowId - Browser window id\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowId: string) {\n super(config);\n\n this.log = this.log.child().withContext({\n sessionId,\n windowId,\n });\n\n this.windowId = windowId;\n this.sessionId = sessionId;\n }\n\n /**\n * Gets the window ID.\n */\n getWindowId() {\n return this.windowId;\n }\n\n /**\n * Gets the browser session id associated with the window.\n */\n getSessionId() {\n return this.sessionId;\n }\n\n /**\n * Retrieves a window from a specific session.\n * @param config - Configuration options for the window\n * @param requestOptions - Request options\n * @returns AirtopWindow<AirtopWindowGetInfoResponse> instance\n */\n async getWindowInfo(config?: WindowGetConfig, requestOptions: AirtopRequestOptions = {}) {\n const results = await this.client.windows.get(\n this.windowId,\n {\n sessionId: this.sessionId,\n ...config,\n },\n this.resolveRequestOptions(requestOptions),\n );\n\n return new AirtopWindow<AirtopWindowGetInfoResponse>(this.getCommonConfig(), this.sessionId, results);\n }\n\n /**\n * Simulates a click on an element in the window.\n * @param elementDescription - Description or selector of the element to click\n * @param config - Additional configuration options for the click action\n * @param requestOptions - Request options\n * @returns Promise resolving to the click operation result\n */\n async click(\n elementDescription: string,\n config?: WindowClickConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n elementDescription,\n })\n .info(\"Clicking on element\");\n\n return this.client.windows.click(\n this.getWindowId(),\n {\n ...config,\n elementDescription,\n sessionId: this.sessionId,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Closes the window.\n * @returns Promise resolving when the window is closed\n */\n async close(): Promise<WindowIDDataResponse> {\n this.log.info(\"Closing window\");\n\n return this.client.windows.close(this.getWindowId(), {\n sessionId: this.sessionId,\n });\n }\n\n /**\n * Simulates hovering over an element in the window.\n * @param elementDescription - Description or selector of the element to hover over\n * @param config - Additional configuration options for the hover action\n * @param requestOptions - Request options\n * @returns Promise resolving to the hover operation result\n */\n async hover(\n elementDescription: string,\n config?: WindowHoverConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata(config).info(\"Hovering over window\");\n\n return this.client.windows.hover(\n this.getWindowId(),\n {\n elementDescription,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Loads a URL in the window.\n * @param url - The URL to load\n * @param config - Additional configuration options for loading the URL\n * @param requestOptions - Request options\n * @returns Promise resolving when the URL is loaded\n */\n async loadUrl(\n url: string,\n config?: WindowLoadUrlConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<OperationOutcomeResponse> {\n this.log\n .withMetadata({\n url,\n })\n .info(\"Loading a URL\");\n\n return this.client.windows.loadURL(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n url,\n ...config,\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Monitors the window for changes or events.\n * @param condition - A natural language description of the condition to monitor for in the browser window\n * @param config - Configuration options for monitoring\n * @param requestOptions - Request options\n * @returns Promise resolving to the monitoring operation result\n */\n async monitor(\n condition: string,\n config?: WindowMonitorConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log.withMetadata().info(\"Monitoring window\");\n\n return this.client.windows.monitor(\n this.getWindowId(),\n {\n condition,\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs a natural language query on the page content.\n * @param prompt - The natural language query prompt\n * @param config - Configuration options for the query\n * @param requestOptions - Request options\n * @returns Promise resolving to the query results\n */\n async pageQuery(\n prompt: string,\n config?: WindowPageQueryConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a page query\");\n\n const newConfig = config as Omit<WindowPageQueryParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.pageQuery(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n prompt,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Performs paginated data extraction from the window content.\n * @param prompt - The extraction prompt\n * @param config - Configuration options for the extraction\n * @param requestOptions - Request options\n * @returns Promise resolving to the extracted data\n */\n async paginatedExtraction(\n prompt: string,\n config?: WindowPaginatedExtractionConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<WindowPromptResponse> {\n this.log\n .withMetadata({\n prompt,\n })\n .info(\"Performing a paginated extraction\");\n\n const newConfig = config as Omit<WindowPaginatedExtractionParams, \"sessionId\" | \"prompt\">;\n\n if (config?.configuration.outputSchema) {\n newConfig.configuration.outputSchema = this.convertToJsonSchema(config.configuration.outputSchema) as string;\n }\n\n return this.client.windows.paginatedExtraction(\n this.getWindowId(),\n {\n prompt,\n sessionId: this.sessionId,\n ...(newConfig || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Scrapes content from the window.\n * @param config - Configuration options for scraping\n * @param requestOptions - Request options\n * @returns Promise resolving to the scraped content\n */\n async scrape(config?: WindowScrapeConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowScrapeResponse> {\n this.log.info(\"Scraping window\");\n\n return this.client.windows.scrape(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Takes a screenshot of the window.\n * @param config - Configuration options for the screenshot\n * @param requestOptions - Request options\n * @returns Promise resolving to the screenshot data\n */\n async screenshot(\n config?: WindowScreenshotConfig,\n requestOptions: AirtopRequestOptions = {},\n ): Promise<AirtopWindowScreenshot> {\n this.log.info(\"Screenshotting window\");\n\n const resp = await this.client.windows.screenshot(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n\n return new AirtopWindowScreenshot(resp);\n }\n\n /**\n * Scrolls the window content.\n * @param config - Configuration options for scrolling\n * @param requestOptions - Request options\n * @returns Promise resolving when the scroll operation is complete\n */\n async scroll(config?: WindowScrollConfig, requestOptions: AirtopRequestOptions = {}): Promise<WindowPromptResponse> {\n this.log.info(\"Scrolling window\");\n\n return this.client.windows.scroll(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n\n /**\n * Types text into the window.\n * @param text - The text to type\n * @param config - Configuration options for typing\n * @param requestOptions - Request options\n * @returns Promise resolving when the text has been typed\n */\n async type(text: string, config?: WindowTypeConfig, requestOptions: AirtopRequestOptions = {}) {\n this.log\n .withMetadata({\n text,\n })\n .info(\"Typing text\");\n\n return this.client.windows.type(\n this.getWindowId(),\n {\n sessionId: this.sessionId,\n text,\n ...(config || {}),\n },\n {\n timeout: secondsToMilliseconds(600),\n ...this.resolveRequestOptions(requestOptions),\n },\n );\n }\n}\n","import type { ScreenshotMetadata } from \"@airtop/core/resources/shared\";\nimport type { AirtopWindowScreenshotResponse, ScreenshotData } from \"./AirtopWindowScreenshot.types.js\";\n\nfunction extractMimeAndBase64(dataUrl: string): {\n mimeType: string;\n base64Data: string;\n} {\n const match = dataUrl.match(/^data:(image\\/\\w+);base64,(.+)$/);\n if (match) {\n return { mimeType: match[1], base64Data: match[2] };\n }\n return {\n mimeType: \"image/jpeg\",\n base64Data: dataUrl.replace(/^data:image\\/jpeg;base64,/, \"\"),\n };\n}\n\n/**\n * The result of a screenshot operation.\n */\nexport class AirtopWindowScreenshot {\n data: AirtopWindowScreenshotResponse[\"data\"];\n meta: AirtopWindowScreenshotResponse[\"meta\"];\n warnings: AirtopWindowScreenshotResponse[\"warnings\"];\n errors: AirtopWindowScreenshotResponse[\"errors\"];\n\n /**\n * Creates a new AirtopWindowScreenshot instance.\n * @param screenshotData - Initial screenshot data and configuration\n */\n constructor(screenshotData: AirtopWindowScreenshotResponse) {\n this.meta = screenshotData.meta;\n this.data = screenshotData.data;\n this.warnings = screenshotData.warnings;\n this.errors = screenshotData.errors;\n }\n\n /**\n * Processes the screenshots and returns them as JPG images.\n */\n screenshotsAsJpg(): ScreenshotData[] {\n const screenshots = this.meta.screenshots;\n\n if (!screenshots) {\n return [];\n }\n\n return screenshots.map((screenshot: ScreenshotMetadata, index: number) => {\n if (!screenshot.dataUrl) {\n return {\n index,\n error: new Error(\"Screenshot data URL not found\"),\n success: false,\n };\n }\n\n try {\n const { mimeType, base64Data } = extractMimeAndBase64(screenshot.dataUrl);\n const binaryData = Buffer.from(base64Data, \"base64\");\n return {\n index,\n binaryData,\n mimeType,\n success: true,\n };\n } catch (err) {\n return {\n index,\n error: err instanceof Error ? err : new Error(String(err)),\n success: false,\n };\n }\n });\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type { CommonWindowResponse } from \"./AirtopWindow.types.js\";\nimport { AirtopWindowClient } from \"./AirtopWindowClient.js\";\n\n/**\n * Represents a browser window in a browser session.\n */\nexport class AirtopWindow<Response extends CommonWindowResponse> extends AirtopWindowClient {\n /**\n * The window data containing window-specific information.\n */\n data: Response[\"data\"];\n /**\n * The metadata associated with the window.\n */\n meta: Response[\"meta\"];\n /**\n * Warnings associated with the creation of the window.\n * These are non-fatal issues that occurred during window creation.\n */\n warnings: Response[\"warnings\"];\n /**\n * Errors that occurred during window creation or operation.\n * These are fatal issues that prevented window creation.\n */\n errors: Response[\"errors\"];\n\n /**\n * Creates a new AirtopWindow instance.\n * @param config - Common configuration options for the window\n * @param sessionId - Browser session id\n * @param windowData - Initial window data and configuration\n */\n constructor(config: CommonAirtopConfig, sessionId: string, windowData: Response) {\n super(config, sessionId, windowData.data.windowId);\n\n this.meta = windowData.meta;\n this.data = windowData.data;\n this.warnings = windowData.warnings;\n this.errors = windowData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { CommonAirtopConfig } from \"../types.js\";\nimport type {\n AirtopSessionResponse,\n SessionData,\n SessionError,\n SessionMetadata,\n SessionWarning,\n} from \"./AirtopSession.types.js\";\nimport { AirtopSessionClient } from \"./AirtopSessionClient.js\";\n\n/**\n * Represents a browser session.\n */\nexport class AirtopSession extends AirtopSessionClient {\n /**\n * The session data containing connection and state information.\n * Includes details about the browser session and its configuration.\n */\n data: SessionData;\n /**\n * The metadata associated with the session.\n * Contains information about the request that created the session.\n */\n meta?: SessionMetadata;\n /**\n * Warnings that occurred during session creation or operation.\n * These are non-fatal issues that didn't prevent session creation.\n */\n warnings?: SessionWarning[];\n /**\n * Errors that occurred during session creation or operation.\n * These are fatal issues that prevented session creation.\n */\n errors?: SessionError[];\n\n /**\n * Creates a new AirtopSession instance.\n * @param config - Common configuration options for the session\n * @param sessionData - Browser session data\n */\n constructor(config: CommonAirtopConfig, sessionData: AirtopSessionResponse) {\n super(config, sessionData.data.id);\n\n this.meta = sessionData.meta;\n this.data = sessionData.data;\n this.warnings = sessionData.warnings;\n this.errors = sessionData.errors;\n }\n\n /**\n * Returns response data as a JSON object.\n */\n toJSON() {\n return {\n data: this.data,\n meta: this.meta,\n warnings: this.warnings,\n errors: this.errors,\n };\n }\n}\n","import type { AirtopClient } from \"../AirtopClient.js\";\nimport type { AirtopSession } from \"../session/AirtopSession.js\";\nimport type { AirtopSessionClient } from \"../session/index.js\";\nimport type { AirtopWindow } from \"../window/AirtopWindow.js\";\nimport type { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport type { AirtopWindowClient } from \"../window/index.js\";\n\n/**\n * Enumeration of available plugin augmentation types.\n * Determines which part of the SDK a plugin can extend.\n * @group Plugin Development\n */\nexport enum AirtopPluginAugmentationType {\n /** Plugin for extending the AirtopClient class */\n AirtopClient = \"AirtopClient\",\n /** Plugin for extending AirtopWindowClient class functionality */\n AirtopWindowClient = \"AirtopWindowClient\",\n /** Plugin for extending AirtopWindow class functionality */\n AirtopWindow = \"AirtopWindow\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSessionClient = \"AirtopSessionClient\",\n /** Plugin for extending AirtopSession class functionality */\n AirtopSession = \"AirtopSession\",\n /** Plugin for extending AirtopWindowScreenshot class functionality */\n AirtopWindowScreenshot = \"AirtopWindowScreenshot\",\n}\n\n/**\n * Interface for plugins that extend the main AirtopClient class.\n * Plugins allow you to add custom functionality to the AirtopClient prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopClientPlugin {\n /**\n * Specifies that this plugin augments the main AirtopClient class.\n * This type discrimination allows TypeScript to properly type-check plugin usage.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopClient;\n\n /**\n * Function that performs the augmentation of the AirtopClient prototype.\n *\n * @param prototype - The AirtopClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowClient class functionality.\n * These plugins can modify or enhance the behavior of all window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowClientPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowClient class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowClient;\n\n /**\n * Function that performs the augmentation of the AirtopWindowClient prototype.\n *\n * @param prototype - The AirtopWindowClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSessionClient class functionality.\n * These plugins can modify or enhance the behavior of all session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionClientPlugin {\n /**\n * Specifies that this plugin augments AirtopSessionClient class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSessionClient;\n\n /**\n * Function that performs the augmentation of the AirtopSessionClient prototype.\n *\n * @param prototype - The AirtopSessionClient class prototype being augmented\n */\n augment: (prototype: typeof AirtopSessionClient.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindow class functionality.\n * These plugins can modify or enhance the behavior of window instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowPlugin {\n /**\n * Specifies that this plugin augments AirtopWindow class functionality.\n * This type discrimination ensures proper type checking when using window plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindow;\n\n /**\n * Function that performs the augmentation of the AirtopWindow prototype.\n *\n * @param prototype - The AirtopWindow class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindow.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopSession class functionality.\n * These plugins can modify or enhance the behavior of session instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopSessionPlugin {\n /**\n * Specifies that this plugin augments AirtopSession class functionality.\n * This type discrimination ensures proper type checking when using session plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopSession;\n\n /**\n * Function that performs the augmentation of the AirtopSession prototype.\n *\n * @param prototype - The AirtopSession class prototype being augmented\n */\n augment: (prototype: typeof AirtopSession.prototype) => void;\n}\n\n/**\n * Interface for plugins that extend the AirtopWindowScreenshot class functionality.\n * These plugins can modify or enhance the behavior of screenshot instances\n * by modifying the prototype.\n *\n * @group Plugin Development\n */\nexport interface AirtopWindowScreenshotPlugin {\n /**\n * Specifies that this plugin augments AirtopWindowScreenshot class functionality.\n * This type discrimination ensures proper type checking when using screenshot plugins.\n */\n augmentationType: AirtopPluginAugmentationType.AirtopWindowScreenshot;\n\n /**\n * Function that performs the augmentation of the AirtopWindowScreenshot prototype.\n *\n * @param prototype - The AirtopWindowScreenshot class prototype being augmented\n */\n augment: (prototype: typeof AirtopWindowScreenshot.prototype) => void;\n}\n\n/**\n * Union type of all possible plugin types.\n * Used when handling plugins generically.\n *\n * @group Plugin Development\n *\n * @see {@link AirtopClientPlugin | AirtopClientPlugin}\n * @see {@link AirtopWindowClientPlugin | AirtopWindowClientPlugin}\n * @see {@link AirtopSessionClientPlugin | AirtopSessionClientPlugin}\n * @see {@link AirtopWindowPlugin | AirtopWindowPlugin}\n * @see {@link AirtopSessionPlugin | AirtopSessionPlugin}\n * @see {@link AirtopWindowScreenshotPlugin | AirtopWindowScreenshotPlugin}\n */\nexport type AirtopPluginType =\n | AirtopClientPlugin\n | AirtopWindowClientPlugin\n | AirtopSessionClientPlugin\n | AirtopWindowPlugin\n | AirtopSessionPlugin\n | AirtopWindowScreenshotPlugin;\n\n/**\n * Interface for registering plugins with the SDK.\n */\nexport interface AirtopPluginRegistration {\n /**\n * Array of plugins to add to the SDK.\n */\n pluginsToAdd: AirtopPluginType[];\n}\n","import { AirtopClient } from \"../AirtopClient.js\";\nimport { AirtopSession, AirtopSessionClient } from \"../session/index.js\";\nimport { AirtopWindowScreenshot } from \"../window/AirtopWindowScreenshot.js\";\nimport { AirtopWindow, AirtopWindowClient } from \"../window/index.js\";\nimport { AirtopPluginAugmentationType, type AirtopPluginRegistration } from \"./AirtopPlugin.types.js\";\n\n/**\n * Registers a plugin with the SDK.\n * @param plugin - The plugin to register\n */\nexport function registerAirtopPlugin(plugin: AirtopPluginRegistration): void {\n for (const pluginToAdd of plugin.pluginsToAdd) {\n switch (pluginToAdd.augmentationType) {\n case AirtopPluginAugmentationType.AirtopClient:\n pluginToAdd.augment(AirtopClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSessionClient:\n pluginToAdd.augment(AirtopSessionClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopSession:\n pluginToAdd.augment(AirtopSession.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowClient:\n pluginToAdd.augment(AirtopWindowClient.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindow:\n pluginToAdd.augment(AirtopWindow.prototype);\n break;\n case AirtopPluginAugmentationType.AirtopWindowScreenshot:\n pluginToAdd.augment(AirtopWindowScreenshot.prototype);\n break;\n }\n }\n}\n","import { Airtop as AirtopCore } from \"@airtop/core\";\nimport { MockLogLayer } from \"loglayer\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport { AirtopBase } from \"./AirtopBase.js\";\nimport { AirtopClient } from \"./AirtopClient.js\";\nimport type { AirtopConstructorConfig } from \"./AirtopClient.types.js\";\nimport { AirtopSession } from \"./session/AirtopSession.js\";\nimport type { AirtopSessionResponse } from \"./session/AirtopSession.types.js\";\nimport type { CommonAirtopConfig } from \"./types.js\";\nimport { AirtopWindow } from \"./window/AirtopWindow.js\";\n\nimport type { AirtopWindowGetInfoResponse } from \"./window/AirtopWindow.types.js\";\n\n/**\n * Creates a no-op version of the client by recursively traversing through its methods\n * and replacing them with empty functions that return resolved promises.\n * @param client - The client instance to create a no-op version of\n * @returns A proxy object that makes all methods no-op\n */\nfunction createNoOpClient<T extends object>(client: T): T {\n return new Proxy(client, {\n get(target: T, prop: string | symbol) {\n const value = Reflect.get(target, prop);\n\n // If it's a function, return a no-op function that returns a resolved promise\n if (typeof value === \"function\") {\n return async () => ({\n data: {},\n meta: {},\n warnings: [],\n errors: [],\n });\n }\n\n // If it's an object (but not null), recursively create a no-op version\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n return createNoOpClient(value);\n }\n\n // Otherwise return the original value\n return value;\n },\n });\n}\n\n/**\n * Generates a mock configuration object for the Airtop SDK for use as the\n * first parameter in the constructor of the AirtopSession and AirtopWindow classes.\n */\nfunction generateCommonAirtopConfigMock(): CommonAirtopConfig {\n const client = new AirtopCore({\n apiKey: \"test-api-key\",\n });\n\n return {\n log: new MockLogLayer(),\n client: createNoOpClient(client),\n };\n}\n\n/**\n * Provides utility methods for creating mock instances of Airtop classes.\n * @hideconstructor\n */\nexport class AirtopMocks {\n /**\n * Creates an AirtopBase instance (the class used as the base for other Airtop classes) with a mock client and logger.\n */\n static getAirtopBaseMock(config: Partial<CommonAirtopConfig> = {}): AirtopBase {\n return new AirtopBase({\n ...generateCommonAirtopConfigMock(),\n ...config,\n });\n }\n\n /**\n * Creates an Airtop instance with a mock client and data.\n */\n static getAirtopClientMock(config: Partial<AirtopConstructorConfig> = {}): AirtopClient {\n const client = new AirtopClient({\n apiKey: \"test-api-key\",\n ...config,\n });\n\n const mocks = generateCommonAirtopConfigMock();\n\n client[\"log\"] = mocks.log;\n client[\"client\"] = mocks.client;\n\n return client;\n }\n\n /**\n * Creates an AirtopSession instance with a mock client and data.\n */\n static getAirtopSessionMock(responseData: Partial<AirtopSessionResponse> = {}): AirtopSession {\n return new AirtopSession(generateCommonAirtopConfigMock(), {\n data: {\n id: uuidv4(),\n configuration: {},\n chromedriverUrl: \"http://localhost:9515\",\n status: \"active\",\n },\n meta: {},\n warnings: [],\n ...responseData,\n });\n }\n\n /**\n * Creates an AirtopWindow instance with a mock client and data.\n */\n static getAirtopWindowMock({\n sessionId,\n windowData,\n }: {\n sessionId?: string;\n windowData?: AirtopWindowGetInfoResponse;\n } = {}): AirtopWindow<AirtopWindowGetInfoResponse> {\n return new AirtopWindow(generateCommonAirtopConfigMock(), sessionId || uuidv4(), {\n data: {\n targetId: uuidv4(),\n windowId: uuidv4(),\n liveViewUrl: \"http://localhost:4567\",\n },\n meta: {},\n warnings: [],\n ...(windowData || {}),\n });\n }\n}\n"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA,MACE,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,SAAW;AAAA,MACX,MAAQ;AAAA,MACR,MAAQ;AAAA,MACR,QAAU;AAAA,MACV,SAAW;AAAA,QACT,QAAU;AAAA,UACR,OAAS;AAAA,UACT,QAAU;AAAA,QACZ;AAAA,QACA,SAAW;AAAA,UACT,OAAS;AAAA,UACT,SAAW;AAAA,QACb;AAAA,MACF;AAAA,MACA,OAAS;AAAA,MACT,SAAW;AAAA,MACX,YAAc;AAAA,MACd,QAAU;AAAA,MACV,UAAY;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,SAAW;AAAA,QACT,sBAAsB;AAAA,QACtB,YAAY;AAAA,QACZ,aAAa;AAAA,QACb,OAAS;AAAA,QACT,MA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,EAKA,OAAO,oBAAoB;AAAA,IACzB;AAAA,IACA;AAAA,EACF,IAGI,CAAC,GAA8C;AACjD,WAAO,IAAI,aAAa,+BAA+B,GAAG,aAAa,OAAO,GAAG;AAAA,MAC/E,MAAM;AAAA,QACJ,UAAU,OAAO;AAAA,QACjB,UAAU,OAAO;AAAA,QACjB,aAAa;AAAA,MACf;AAAA,MACA,MAAM,CAAC;AAAA,MACP,UAAU,CAAC;AAAA,MACX,GAAI,cAAc,CAAC;AAAA,IACrB,CAAC;AAAA,EACH;AACF;","names":["secondsToMilliseconds","secondsToMilliseconds","AirtopPluginAugmentationType","AirtopCore","AirtopCore"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@airtop/sdk",
|
3
3
|
"description": "Airtop SDK for TypeScript",
|
4
|
-
"version": "1.0.0-alpha2.
|
4
|
+
"version": "1.0.0-alpha2.6",
|
5
5
|
"type": "module",
|
6
6
|
"main": "./dist/index.cjs",
|
7
7
|
"module": "./dist/index.js",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"agentic"
|
31
31
|
],
|
32
32
|
"dependencies": {
|
33
|
-
"@airtop/core": "0.1.0-alpha.
|
33
|
+
"@airtop/core": "0.1.0-alpha.24",
|
34
34
|
"date-fns": "4.1.0",
|
35
35
|
"loglayer": "6.3.3",
|
36
36
|
"serialize-error": "12.0.0",
|