@airtop/sdk 0.1.3 → 0.1.5
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/api/resources/profiles/client/Client.js +4 -4
- package/api/resources/sessions/client/Client.d.ts +2 -2
- package/api/resources/sessions/client/Client.js +12 -12
- package/api/resources/windows/client/Client.d.ts +18 -2
- package/api/resources/windows/client/Client.js +85 -16
- package/api/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +3 -0
- package/api/resources/windows/client/requests/index.d.ts +0 -1
- package/api/types/PageQueryConfig.d.ts +7 -0
- package/api/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +1 -1
- package/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → types/SessionPageQueryHandlerRequestBody.d.ts} +6 -9
- package/api/types/SummaryConfig.d.ts +2 -2
- package/api/types/index.d.ts +3 -2
- package/api/types/index.js +3 -2
- package/dist/api/resources/profiles/client/Client.js +4 -4
- package/dist/api/resources/sessions/client/Client.d.ts +2 -2
- package/dist/api/resources/sessions/client/Client.js +12 -12
- package/dist/api/resources/windows/client/Client.d.ts +18 -2
- package/dist/api/resources/windows/client/Client.js +85 -16
- package/dist/api/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +3 -0
- package/dist/api/resources/windows/client/requests/index.d.ts +0 -1
- package/dist/api/types/PageQueryConfig.d.ts +7 -0
- package/dist/api/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +1 -1
- package/dist/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → types/SessionPageQueryHandlerRequestBody.d.ts} +6 -9
- package/dist/api/types/SummaryConfig.d.ts +2 -2
- package/dist/api/types/index.d.ts +3 -2
- package/dist/api/types/index.js +3 -2
- package/dist/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +2 -0
- package/dist/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.js +2 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +0 -1
- package/dist/serialization/resources/windows/client/requests/index.js +1 -3
- package/dist/serialization/types/PageQueryConfig.d.ts +12 -0
- package/dist/serialization/types/{PromptContentConfig.js → PageQueryConfig.js} +3 -4
- package/dist/serialization/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +2 -2
- package/dist/serialization/types/{PromptContentExperimentalConfig.js → PageQueryExperimentalConfig.js} +2 -2
- package/dist/serialization/types/SessionPageQueryHandlerRequestBody.d.ts +18 -0
- package/{serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → dist/serialization/types/SessionPageQueryHandlerRequestBody.js} +5 -3
- package/dist/serialization/types/SummaryConfig.d.ts +1 -2
- package/dist/serialization/types/SummaryConfig.js +1 -2
- package/dist/serialization/types/index.d.ts +3 -2
- package/dist/serialization/types/index.js +3 -2
- package/dist/wrapper/AirtopClient.d.ts +6 -5
- package/dist/wrapper/AirtopClient.js +11 -10
- package/dist/wrapper/AirtopSessions.d.ts +11 -11
- package/dist/wrapper/AirtopSessions.js +16 -17
- package/dist/wrapper/AirtopWindows.d.ts +62 -14
- package/dist/wrapper/AirtopWindows.js +73 -31
- package/package.json +3 -2
- package/reference.md +99 -3
- package/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +2 -0
- package/serialization/resources/windows/client/requests/SessionSummaryHandlerRequestBody.js +2 -0
- package/serialization/resources/windows/client/requests/index.d.ts +0 -1
- package/serialization/resources/windows/client/requests/index.js +1 -3
- package/serialization/types/PageQueryConfig.d.ts +12 -0
- package/serialization/types/{PromptContentConfig.js → PageQueryConfig.js} +3 -4
- package/serialization/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +2 -2
- package/serialization/types/{PromptContentExperimentalConfig.js → PageQueryExperimentalConfig.js} +2 -2
- package/serialization/types/SessionPageQueryHandlerRequestBody.d.ts +18 -0
- package/{dist/serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → serialization/types/SessionPageQueryHandlerRequestBody.js} +5 -3
- package/serialization/types/SummaryConfig.d.ts +1 -2
- package/serialization/types/SummaryConfig.js +1 -2
- package/serialization/types/index.d.ts +3 -2
- package/serialization/types/index.js +3 -2
- package/wrapper/AirtopClient.d.ts +6 -5
- package/wrapper/AirtopClient.js +11 -10
- package/wrapper/AirtopSessions.d.ts +11 -11
- package/wrapper/AirtopSessions.js +16 -17
- package/wrapper/AirtopWindows.d.ts +62 -14
- package/wrapper/AirtopWindows.js +73 -31
- package/api/types/PromptContentConfig.d.ts +0 -8
- package/dist/api/types/PromptContentConfig.d.ts +0 -8
- package/dist/serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts +0 -16
- package/dist/serialization/types/PromptContentConfig.d.ts +0 -13
- package/serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts +0 -16
- package/serialization/types/PromptContentConfig.d.ts +0 -13
- /package/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → types/PageQueryConfig.js} +0 -0
- /package/api/types/{PromptContentConfig.js → PageQueryExperimentalConfig.js} +0 -0
- /package/api/types/{PromptContentExperimentalConfig.js → SessionPageQueryHandlerRequestBody.js} +0 -0
- /package/dist/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → types/PageQueryConfig.js} +0 -0
- /package/dist/api/types/{PromptContentConfig.js → PageQueryExperimentalConfig.js} +0 -0
- /package/dist/api/types/{PromptContentExperimentalConfig.js → SessionPageQueryHandlerRequestBody.js} +0 -0
@@ -32,10 +32,10 @@ __exportStar(require("./ExternalSessionAiResponseMetadataUsage"), exports);
|
|
32
32
|
__exportStar(require("./ExternalSessionConfig"), exports);
|
33
33
|
__exportStar(require("./ExternalSessionWithConnectionInfo"), exports);
|
34
34
|
__exportStar(require("./Issue"), exports);
|
35
|
+
__exportStar(require("./PageQueryConfig"), exports);
|
36
|
+
__exportStar(require("./PageQueryExperimentalConfig"), exports);
|
35
37
|
__exportStar(require("./Pagination"), exports);
|
36
38
|
__exportStar(require("./ProfilesResponse"), exports);
|
37
|
-
__exportStar(require("./PromptContentConfig"), exports);
|
38
|
-
__exportStar(require("./PromptContentExperimentalConfig"), exports);
|
39
39
|
__exportStar(require("./ScrapeResponse"), exports);
|
40
40
|
__exportStar(require("./ScrapeResponseContent"), exports);
|
41
41
|
__exportStar(require("./ScrapeResponseEnvelope"), exports);
|
@@ -45,6 +45,7 @@ __exportStar(require("./CustomProxy"), exports);
|
|
45
45
|
__exportStar(require("./SessionConfigV1ProxyItem"), exports);
|
46
46
|
__exportStar(require("./SessionConfigV1Proxy"), exports);
|
47
47
|
__exportStar(require("./SessionConfigV1"), exports);
|
48
|
+
__exportStar(require("./SessionPageQueryHandlerRequestBody"), exports);
|
48
49
|
__exportStar(require("./SessionResponse"), exports);
|
49
50
|
__exportStar(require("./SessionsResponse"), exports);
|
50
51
|
__exportStar(require("./SessionsWithPagination"), exports);
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import { AirtopClient as FernClient } from '../Client';
|
2
|
-
import { AirtopWindows } from './AirtopWindows';
|
3
2
|
import { AirtopSessions } from './AirtopSessions';
|
3
|
+
import { AirtopWindows } from './AirtopWindows';
|
4
4
|
declare type AugmentedOptions = FernClient.Options & {
|
5
5
|
debug?: boolean;
|
6
6
|
};
|
7
7
|
export declare class AirtopClient {
|
8
|
+
private _options;
|
8
9
|
debug: boolean;
|
9
10
|
private _client;
|
10
|
-
private
|
11
|
-
private
|
12
|
-
constructor(
|
13
|
-
get windows(): AirtopWindows;
|
11
|
+
private _windows;
|
12
|
+
private _sessions;
|
13
|
+
constructor(_options: AugmentedOptions);
|
14
14
|
get sessions(): AirtopSessions;
|
15
|
+
get windows(): AirtopWindows;
|
15
16
|
get profiles(): import("../api/resources/profiles/client/Client").Profiles;
|
16
17
|
log(message: string): void;
|
17
18
|
error(err: any): void;
|
package/wrapper/AirtopClient.js
CHANGED
@@ -2,20 +2,21 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.AirtopClient = void 0;
|
4
4
|
const Client_1 = require("../Client"); // alias the Fern generated client
|
5
|
-
const AirtopWindows_1 = require("./AirtopWindows");
|
6
5
|
const AirtopSessions_1 = require("./AirtopSessions");
|
6
|
+
const AirtopWindows_1 = require("./AirtopWindows");
|
7
7
|
class AirtopClient {
|
8
|
-
constructor(
|
9
|
-
this.
|
10
|
-
this.
|
11
|
-
this.
|
12
|
-
this._sessionsWrapper = new AirtopSessions_1.AirtopSessions(this._client, options === null || options === void 0 ? void 0 : options.debug);
|
13
|
-
}
|
14
|
-
get windows() {
|
15
|
-
return this._windowsWrapper;
|
8
|
+
constructor(_options) {
|
9
|
+
this._options = _options;
|
10
|
+
this._client = new Client_1.AirtopClient(_options);
|
11
|
+
this.debug = (_options === null || _options === void 0 ? void 0 : _options.debug) || false;
|
16
12
|
}
|
17
13
|
get sessions() {
|
18
|
-
|
14
|
+
var _a;
|
15
|
+
return ((_a = this._sessions) !== null && _a !== void 0 ? _a : (this._sessions = new AirtopSessions_1.AirtopSessions(this._options, this.debug)));
|
16
|
+
}
|
17
|
+
get windows() {
|
18
|
+
var _a;
|
19
|
+
return ((_a = this._windows) !== null && _a !== void 0 ? _a : (this._windows = new AirtopWindows_1.AirtopWindows(this._options, this._options.apiKey)));
|
19
20
|
}
|
20
21
|
get profiles() {
|
21
22
|
return this._client.profiles;
|
@@ -1,7 +1,5 @@
|
|
1
|
-
import { AirtopClient as FernClient } from '../Client';
|
2
1
|
import * as Airtop from '../api';
|
3
|
-
import
|
4
|
-
import { Sessions as SessionsNamespace } from '../api/resources/sessions/client/Client';
|
2
|
+
import { Sessions as SessionsClass, Sessions as SessionsNamespace } from '../api/resources/sessions/client/Client';
|
5
3
|
export interface AirtopSessionConfigV1 extends Airtop.SessionConfigV1 {
|
6
4
|
skipWaitSessionReady?: boolean;
|
7
5
|
}
|
@@ -9,16 +7,18 @@ export interface AirtopSessionRestInputV1 {
|
|
9
7
|
/** Session configuration */
|
10
8
|
configuration?: AirtopSessionConfigV1;
|
11
9
|
}
|
12
|
-
export declare class AirtopSessions {
|
13
|
-
|
10
|
+
export declare class AirtopSessions extends SessionsClass {
|
11
|
+
readonly _options: SessionsNamespace.Options;
|
14
12
|
private debug;
|
15
|
-
|
16
|
-
constructor(airtopClient: FernClient, debug?: boolean);
|
13
|
+
constructor(_options: SessionsNamespace.Options, debug?: boolean);
|
17
14
|
log(message: any): void;
|
18
|
-
|
15
|
+
/**
|
16
|
+
* @param {Airtop.SessionRestInputV1} request
|
17
|
+
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
18
|
+
*
|
19
|
+
* @example
|
20
|
+
* await client.sessions.create()
|
21
|
+
*/
|
19
22
|
create(request?: AirtopSessionRestInputV1, requestOptions?: SessionsNamespace.RequestOptions): Promise<Airtop.SessionResponse>;
|
20
23
|
waitForSessionReady(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<Airtop.SessionsEventsResponse | null>;
|
21
|
-
getInfo(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<Airtop.SessionResponse>;
|
22
|
-
terminate(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<void>;
|
23
|
-
events(id: string, requestOptions?: SessionsNamespace.RequestOptions): Promise<core.Stream<Airtop.SessionsEventsResponse>>;
|
24
24
|
}
|
@@ -17,24 +17,32 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
17
17
|
};
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
19
19
|
exports.AirtopSessions = void 0;
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
const Client_1 = require("../api/resources/sessions/client/Client");
|
21
|
+
class AirtopSessions extends Client_1.Sessions {
|
22
|
+
constructor(_options, debug = false) {
|
23
|
+
super(_options);
|
24
|
+
this._options = _options;
|
23
25
|
this.debug = debug;
|
24
|
-
this._sessions = airtopClient.sessions;
|
25
26
|
}
|
26
27
|
log(message) {
|
27
28
|
if (this.debug) {
|
28
29
|
console.log(message);
|
29
30
|
}
|
30
31
|
}
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
/**
|
33
|
+
* @param {Airtop.SessionRestInputV1} request
|
34
|
+
* @param {Sessions.RequestOptions} requestOptions - Request-specific configuration.
|
35
|
+
*
|
36
|
+
* @example
|
37
|
+
* await client.sessions.create()
|
38
|
+
*/
|
34
39
|
create(request, requestOptions) {
|
40
|
+
const _super = Object.create(null, {
|
41
|
+
create: { get: () => super.create }
|
42
|
+
});
|
35
43
|
var _a;
|
36
44
|
return __awaiter(this, void 0, void 0, function* () {
|
37
|
-
const createSessionResponse = yield
|
45
|
+
const createSessionResponse = yield _super.create.call(this, request, requestOptions);
|
38
46
|
if (!createSessionResponse.data) {
|
39
47
|
throw new Error(`Error creating browser session`);
|
40
48
|
}
|
@@ -82,14 +90,5 @@ class AirtopSessions {
|
|
82
90
|
return null;
|
83
91
|
});
|
84
92
|
}
|
85
|
-
getInfo(id, requestOptions) {
|
86
|
-
return this._sessions.getinfo(id, requestOptions);
|
87
|
-
}
|
88
|
-
terminate(id, requestOptions) {
|
89
|
-
return this._sessions.terminate(id, requestOptions);
|
90
|
-
}
|
91
|
-
events(id, requestOptions) {
|
92
|
-
return this._sessions.events(id, requestOptions);
|
93
|
-
}
|
94
93
|
}
|
95
94
|
exports.AirtopSessions = AirtopSessions;
|
@@ -14,22 +14,70 @@ declare namespace seleniumWebdriver {
|
|
14
14
|
createCDPConnection(domain: string): Promise<any>;
|
15
15
|
}
|
16
16
|
}
|
17
|
-
import
|
18
|
-
import
|
19
|
-
import
|
20
|
-
|
21
|
-
|
22
|
-
private airtopClient;
|
17
|
+
import * as Airtop from "../api";
|
18
|
+
import { Windows as WindowsClass, Windows as WindowsNamespace } from "../api/resources/windows/client/Client";
|
19
|
+
import * as core from "../core";
|
20
|
+
export declare class AirtopWindows extends WindowsClass {
|
21
|
+
readonly _options: WindowsNamespace.Options;
|
23
22
|
private apiKeySupplier;
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
constructor(_options: WindowsNamespace.Options, apiKeySupplier: core.Supplier<core.BearerToken | undefined>);
|
24
|
+
/**
|
25
|
+
* @param {string} sessionId - The session id for the window.
|
26
|
+
* @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
|
27
|
+
* @param {Airtop.SessionContentPromptHandlerRequestBody} request
|
28
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
29
|
+
*
|
30
|
+
* @deprecated Use pageQuery instead
|
31
|
+
* @example
|
32
|
+
* await client.windows.promptContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
33
|
+
* prompt: "What is the main idea of this page?"
|
34
|
+
* })
|
35
|
+
*/
|
36
|
+
promptContent(sessionId: string, windowId: string, request: Omit<Airtop.SessionPageQueryHandlerRequestBody, "configuration"> & {
|
37
|
+
configuration?: Omit<Airtop.SessionPageQueryHandlerRequestBody["configuration"], "outputSchema"> & {
|
38
|
+
outputSchema?: string | object;
|
39
|
+
};
|
40
|
+
}, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
|
41
|
+
/**
|
42
|
+
* @param {string} sessionId - The session id for the window.
|
43
|
+
* @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
|
44
|
+
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
|
45
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
46
|
+
*
|
47
|
+
* @example
|
48
|
+
* await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
49
|
+
* prompt: "What is the main idea of this page?"
|
50
|
+
* })
|
51
|
+
*/
|
52
|
+
pageQuery(sessionId: string, windowId: string, request: Omit<Airtop.SessionPageQueryHandlerRequestBody, "configuration"> & {
|
53
|
+
configuration?: Omit<Airtop.SessionPageQueryHandlerRequestBody["configuration"], "outputSchema"> & {
|
54
|
+
outputSchema?: string | object;
|
55
|
+
};
|
56
|
+
}, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
|
57
|
+
/**
|
58
|
+
* @param {string} sessionId - The session id for the window.
|
59
|
+
* @param {string} windowId - The Airtop window id of the browser window to scrape.
|
60
|
+
* @param {Airtop.ScrapeContentRequest} request
|
61
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
62
|
+
*
|
63
|
+
* @example
|
64
|
+
* await client.windows.scrapeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
65
|
+
*/
|
31
66
|
scrapeContent(sessionId: string, windowId: string, request?: Airtop.ScrapeContentRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.ScrapeResponse>;
|
32
|
-
|
67
|
+
/**
|
68
|
+
* @param {string} sessionId - The session id for the window.
|
69
|
+
* @param {string} windowId - The Airtop window id of the browser window to summarize.
|
70
|
+
* @param {Airtop.SessionSummaryHandlerRequestBody} request
|
71
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
72
|
+
*
|
73
|
+
* @example
|
74
|
+
* await client.windows.summarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
75
|
+
*/
|
76
|
+
summarizeContent(sessionId: string, windowId: string, request?: Omit<Airtop.SessionSummaryHandlerRequestBody, "configuration"> & {
|
77
|
+
configuration?: Omit<Airtop.SessionSummaryHandlerRequestBody["configuration"], "outputSchema"> & {
|
78
|
+
outputSchema?: string | object;
|
79
|
+
};
|
80
|
+
}, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.AiPromptResponse>;
|
33
81
|
getWindowInfoForPuppeteerPage(session: Airtop.ExternalSessionWithConnectionInfo, page: puppeteer.Page, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowResponse>;
|
34
82
|
getWindowInfoForPlaywrightPage(session: Airtop.ExternalSessionWithConnectionInfo, page: playwright.Page, request?: Airtop.GetWindowInfoRequest, requestOptions?: WindowsNamespace.RequestOptions): Promise<Airtop.WindowResponse>;
|
35
83
|
private executeSeleniumCDPCommand;
|
package/wrapper/AirtopWindows.js
CHANGED
@@ -37,43 +37,85 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
38
38
|
exports.AirtopWindows = void 0;
|
39
39
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
40
|
+
const Client_1 = require("../api/resources/windows/client/Client");
|
40
41
|
const core = __importStar(require("../core"));
|
41
|
-
class AirtopWindows {
|
42
|
-
constructor(
|
43
|
-
|
42
|
+
class AirtopWindows extends Client_1.Windows {
|
43
|
+
constructor(_options, apiKeySupplier) {
|
44
|
+
super(_options);
|
45
|
+
this._options = _options;
|
44
46
|
this.apiKeySupplier = apiKeySupplier;
|
45
|
-
this._windows = airtopClient.windows;
|
46
47
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
48
|
+
/**
|
49
|
+
* @param {string} sessionId - The session id for the window.
|
50
|
+
* @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
|
51
|
+
* @param {Airtop.SessionContentPromptHandlerRequestBody} request
|
52
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
53
|
+
*
|
54
|
+
* @deprecated Use pageQuery instead
|
55
|
+
* @example
|
56
|
+
* await client.windows.promptContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
57
|
+
* prompt: "What is the main idea of this page?"
|
58
|
+
* })
|
59
|
+
*/
|
60
|
+
promptContent(sessionId, windowId, request, requestOptions) {
|
61
|
+
const _super = Object.create(null, {
|
62
|
+
promptContent: { get: () => super.promptContent }
|
55
63
|
});
|
56
|
-
|
57
|
-
close(sessionId, windowId, requestOptions) {
|
64
|
+
var _a, _b;
|
58
65
|
return __awaiter(this, void 0, void 0, function* () {
|
59
|
-
return
|
66
|
+
return _super.promptContent.call(this, sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request.configuration), { outputSchema: typeof ((_a = request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === "object"
|
67
|
+
? JSON.stringify(request.configuration.outputSchema)
|
68
|
+
: (_b = request.configuration) === null || _b === void 0 ? void 0 : _b.outputSchema }) }), Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
|
60
69
|
});
|
61
70
|
}
|
62
|
-
|
63
|
-
|
64
|
-
|
71
|
+
/**
|
72
|
+
* @param {string} sessionId - The session id for the window.
|
73
|
+
* @param {string} windowId - The Airtop window id of the browser window to target with an Airtop AI prompt.
|
74
|
+
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
|
75
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
76
|
+
*
|
77
|
+
* @example
|
78
|
+
* await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
79
|
+
* prompt: "What is the main idea of this page?"
|
80
|
+
* })
|
81
|
+
*/
|
82
|
+
pageQuery(sessionId, windowId, request, requestOptions) {
|
83
|
+
const _super = Object.create(null, {
|
84
|
+
pageQuery: { get: () => super.pageQuery }
|
65
85
|
});
|
66
|
-
|
67
|
-
promptContent(sessionId, windowId, request, requestOptions) {
|
86
|
+
var _a, _b;
|
68
87
|
return __awaiter(this, void 0, void 0, function* () {
|
69
|
-
return
|
88
|
+
return _super.pageQuery.call(this, sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request.configuration), { outputSchema: typeof ((_a = request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === "object"
|
89
|
+
? JSON.stringify(request.configuration.outputSchema)
|
90
|
+
: (_b = request.configuration) === null || _b === void 0 ? void 0 : _b.outputSchema }) }), Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
|
70
91
|
});
|
71
92
|
}
|
93
|
+
/**
|
94
|
+
* @param {string} sessionId - The session id for the window.
|
95
|
+
* @param {string} windowId - The Airtop window id of the browser window to scrape.
|
96
|
+
* @param {Airtop.ScrapeContentRequest} request
|
97
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
98
|
+
*
|
99
|
+
* @example
|
100
|
+
* await client.windows.scrapeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
101
|
+
*/
|
72
102
|
scrapeContent(sessionId, windowId, request, requestOptions) {
|
73
|
-
return
|
103
|
+
return super.scrapeContent(sessionId, windowId, request, Object.assign({ timeoutInSeconds: 600 }, requestOptions));
|
74
104
|
}
|
105
|
+
/**
|
106
|
+
* @param {string} sessionId - The session id for the window.
|
107
|
+
* @param {string} windowId - The Airtop window id of the browser window to summarize.
|
108
|
+
* @param {Airtop.SessionSummaryHandlerRequestBody} request
|
109
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
110
|
+
*
|
111
|
+
* @example
|
112
|
+
* await client.windows.summarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
113
|
+
*/
|
75
114
|
summarizeContent(sessionId, windowId, request, requestOptions) {
|
76
|
-
|
115
|
+
var _a, _b, _c;
|
116
|
+
return super.summarizeContent(sessionId, windowId, Object.assign(Object.assign({}, request), { configuration: Object.assign(Object.assign({}, request === null || request === void 0 ? void 0 : request.configuration), { outputSchema: typeof ((_a = request === null || request === void 0 ? void 0 : request.configuration) === null || _a === void 0 ? void 0 : _a.outputSchema) === "object"
|
117
|
+
? JSON.stringify((_b = request === null || request === void 0 ? void 0 : request.configuration) === null || _b === void 0 ? void 0 : _b.outputSchema)
|
118
|
+
: (_c = request === null || request === void 0 ? void 0 : request.configuration) === null || _c === void 0 ? void 0 : _c.outputSchema }) }), Object.assign(Object.assign({ timeoutInSeconds: 600 }, requestOptions), { maxRetries: 0 }));
|
77
119
|
}
|
78
120
|
getWindowInfoForPuppeteerPage(session, page, request, requestOptions) {
|
79
121
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -85,10 +127,10 @@ class AirtopWindows {
|
|
85
127
|
return __awaiter(this, void 0, void 0, function* () {
|
86
128
|
// Retrieve target information
|
87
129
|
const cdpSession = yield page.context().newCDPSession(page);
|
88
|
-
const { targetInfo } = yield cdpSession.send(
|
130
|
+
const { targetInfo } = yield cdpSession.send("Target.getTargetInfo");
|
89
131
|
const targetId = targetInfo.targetId;
|
90
132
|
if (!targetId) {
|
91
|
-
throw new Error(
|
133
|
+
throw new Error("TargetId not found");
|
92
134
|
}
|
93
135
|
return yield this.getWindowInfo(session.id, targetId, request, requestOptions);
|
94
136
|
});
|
@@ -98,17 +140,17 @@ class AirtopWindows {
|
|
98
140
|
// Get the current WebDriver session ID
|
99
141
|
const webDriverSessionId = (yield driver.getSession()).getId();
|
100
142
|
if (!webDriverSessionId) {
|
101
|
-
throw new Error(
|
143
|
+
throw new Error("No WebDriver session available");
|
102
144
|
}
|
103
145
|
const chromedriverSessionUrl = `${session.chromedriverUrl}/session/${webDriverSessionId}/chromium/send_command_and_get_result`;
|
104
146
|
const response = yield (0, node_fetch_1.default)(chromedriverSessionUrl, {
|
105
|
-
method:
|
147
|
+
method: "POST",
|
106
148
|
headers: {
|
107
|
-
|
149
|
+
"Content-Type": "application/json",
|
108
150
|
Authorization: `Bearer ${apiKey}`,
|
109
151
|
},
|
110
152
|
body: JSON.stringify({
|
111
|
-
cmd:
|
153
|
+
cmd: "Target.getTargetInfo",
|
112
154
|
params: {},
|
113
155
|
}),
|
114
156
|
});
|
@@ -119,10 +161,10 @@ class AirtopWindows {
|
|
119
161
|
var _a, _b;
|
120
162
|
return __awaiter(this, void 0, void 0, function* () {
|
121
163
|
const apiKey = yield core.Supplier.get(this.apiKeySupplier);
|
122
|
-
const result = yield this.executeSeleniumCDPCommand(driver, session, apiKey ||
|
164
|
+
const result = yield this.executeSeleniumCDPCommand(driver, session, apiKey || "");
|
123
165
|
const targetId = (_b = (_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.targetInfo) === null || _b === void 0 ? void 0 : _b.targetId;
|
124
166
|
if (!targetId) {
|
125
|
-
throw new Error(
|
167
|
+
throw new Error("TargetId not found");
|
126
168
|
}
|
127
169
|
return yield this.getWindowInfo(session.id, targetId, request, requestOptions);
|
128
170
|
});
|
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as Airtop from "../index";
|
5
|
-
export interface PromptContentConfig {
|
6
|
-
/** Experimental configuration options. These may be subject to change and are not guaranteed to be stable across versions. */
|
7
|
-
experimental?: Airtop.PromptContentExperimentalConfig;
|
8
|
-
}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as Airtop from "../index";
|
5
|
-
export interface PromptContentConfig {
|
6
|
-
/** Experimental configuration options. These may be subject to change and are not guaranteed to be stable across versions. */
|
7
|
-
experimental?: Airtop.PromptContentExperimentalConfig;
|
8
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as serializers from "../../../../index";
|
5
|
-
import * as Airtop from "../../../../../api/index";
|
6
|
-
import * as core from "../../../../../core";
|
7
|
-
export declare const SessionContentPromptHandlerRequestBody: core.serialization.Schema<serializers.SessionContentPromptHandlerRequestBody.Raw, Airtop.SessionContentPromptHandlerRequestBody>;
|
8
|
-
export declare namespace SessionContentPromptHandlerRequestBody {
|
9
|
-
interface Raw {
|
10
|
-
clientRequestId?: string | null;
|
11
|
-
costThresholdCredits?: number | null;
|
12
|
-
followPaginationLinks?: boolean | null;
|
13
|
-
prompt: string;
|
14
|
-
timeThresholdSeconds?: number | null;
|
15
|
-
}
|
16
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as serializers from "../index";
|
5
|
-
import * as Airtop from "../../api/index";
|
6
|
-
import * as core from "../../core";
|
7
|
-
import { PromptContentExperimentalConfig } from "./PromptContentExperimentalConfig";
|
8
|
-
export declare const PromptContentConfig: core.serialization.ObjectSchema<serializers.PromptContentConfig.Raw, Airtop.PromptContentConfig>;
|
9
|
-
export declare namespace PromptContentConfig {
|
10
|
-
interface Raw {
|
11
|
-
experimental?: PromptContentExperimentalConfig.Raw | null;
|
12
|
-
}
|
13
|
-
}
|
package/serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as serializers from "../../../../index";
|
5
|
-
import * as Airtop from "../../../../../api/index";
|
6
|
-
import * as core from "../../../../../core";
|
7
|
-
export declare const SessionContentPromptHandlerRequestBody: core.serialization.Schema<serializers.SessionContentPromptHandlerRequestBody.Raw, Airtop.SessionContentPromptHandlerRequestBody>;
|
8
|
-
export declare namespace SessionContentPromptHandlerRequestBody {
|
9
|
-
interface Raw {
|
10
|
-
clientRequestId?: string | null;
|
11
|
-
costThresholdCredits?: number | null;
|
12
|
-
followPaginationLinks?: boolean | null;
|
13
|
-
prompt: string;
|
14
|
-
timeThresholdSeconds?: number | null;
|
15
|
-
}
|
16
|
-
}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
3
|
-
*/
|
4
|
-
import * as serializers from "../index";
|
5
|
-
import * as Airtop from "../../api/index";
|
6
|
-
import * as core from "../../core";
|
7
|
-
import { PromptContentExperimentalConfig } from "./PromptContentExperimentalConfig";
|
8
|
-
export declare const PromptContentConfig: core.serialization.ObjectSchema<serializers.PromptContentConfig.Raw, Airtop.PromptContentConfig>;
|
9
|
-
export declare namespace PromptContentConfig {
|
10
|
-
interface Raw {
|
11
|
-
experimental?: PromptContentExperimentalConfig.Raw | null;
|
12
|
-
}
|
13
|
-
}
|
File without changes
|
File without changes
|
/package/api/types/{PromptContentExperimentalConfig.js → SessionPageQueryHandlerRequestBody.js}
RENAMED
File without changes
|
File without changes
|
File without changes
|
/package/dist/api/types/{PromptContentExperimentalConfig.js → SessionPageQueryHandlerRequestBody.js}
RENAMED
File without changes
|