@airtop/sdk 0.1.4 → 0.1.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/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 +52 -2
- package/api/resources/windows/client/Client.js +272 -16
- package/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
- package/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
- package/api/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +3 -0
- package/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
- package/api/resources/windows/client/requests/index.d.ts +3 -1
- package/api/types/ClickConfig.d.ts +4 -0
- package/api/types/CustomProxy.d.ts +1 -1
- package/api/types/PageQueryConfig.d.ts +7 -0
- package/api/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +1 -1
- package/api/types/SessionConfigV1Proxy.d.ts +4 -1
- package/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → types/SessionPageQueryHandlerRequestBody.d.ts} +6 -9
- package/api/types/SessionPageQueryHandlerRequestBody.js +5 -0
- package/api/types/SummaryConfig.d.ts +2 -2
- package/api/types/index.d.ts +4 -2
- package/api/types/index.js +4 -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 +52 -2
- package/dist/api/resources/windows/client/Client.js +272 -16
- package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/SessionClickHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/SessionSummaryHandlerRequestBody.d.ts +3 -0
- package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +5 -0
- package/dist/api/resources/windows/client/requests/index.d.ts +3 -1
- package/dist/api/types/ClickConfig.d.ts +4 -0
- package/dist/api/types/ClickConfig.js +5 -0
- package/dist/api/types/CustomProxy.d.ts +1 -1
- package/dist/api/types/PageQueryConfig.d.ts +7 -0
- package/dist/api/types/PageQueryConfig.js +5 -0
- package/dist/api/types/{PromptContentExperimentalConfig.d.ts → PageQueryExperimentalConfig.d.ts} +1 -1
- package/dist/api/types/PageQueryExperimentalConfig.js +5 -0
- package/dist/api/types/SessionConfigV1Proxy.d.ts +4 -1
- package/dist/api/{resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → types/SessionPageQueryHandlerRequestBody.d.ts} +6 -9
- package/dist/api/types/SessionPageQueryHandlerRequestBody.js +5 -0
- package/dist/api/types/SummaryConfig.d.ts +2 -2
- package/dist/api/types/index.d.ts +4 -2
- package/dist/api/types/index.js +4 -2
- package/{serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts} +5 -4
- package/dist/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js +38 -0
- package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
- package/dist/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
- 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/SessionTypeHandlerRequestBody.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +3 -1
- package/dist/serialization/resources/windows/client/requests/index.js +7 -3
- package/dist/serialization/types/ClickConfig.d.ts +10 -0
- package/dist/serialization/types/ClickConfig.js +31 -0
- 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/SessionConfigV1Proxy.d.ts +1 -1
- package/dist/serialization/types/SessionConfigV1Proxy.js +5 -1
- 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 +4 -2
- package/dist/serialization/types/index.js +4 -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 +1 -1
- package/reference.md +295 -3
- package/{dist/serialization/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.d.ts → serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.d.ts} +5 -4
- package/serialization/resources/windows/client/requests/SessionClickHandlerRequestBody.js +38 -0
- package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.d.ts +17 -0
- package/serialization/resources/windows/client/requests/SessionHoverHandlerRequestBody.js +38 -0
- 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/SessionTypeHandlerRequestBody.d.ts +19 -0
- package/serialization/resources/windows/client/requests/SessionTypeHandlerRequestBody.js +40 -0
- package/serialization/resources/windows/client/requests/index.d.ts +3 -1
- package/serialization/resources/windows/client/requests/index.js +7 -3
- package/serialization/types/ClickConfig.d.ts +10 -0
- package/serialization/types/ClickConfig.js +31 -0
- 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/SessionConfigV1Proxy.d.ts +1 -1
- package/serialization/types/SessionConfigV1Proxy.js +5 -1
- 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 +4 -2
- package/serialization/types/index.js +4 -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/types/PromptContentConfig.d.ts +0 -13
- package/serialization/types/PromptContentConfig.d.ts +0 -13
- /package/api/resources/windows/client/requests/{SessionContentPromptHandlerRequestBody.js → SessionClickHandlerRequestBody.js} +0 -0
- /package/api/{types/PromptContentConfig.js → resources/windows/client/requests/SessionHoverHandlerRequestBody.js} +0 -0
- /package/api/{types/PromptContentExperimentalConfig.js → resources/windows/client/requests/SessionTypeHandlerRequestBody.js} +0 -0
- /package/{dist/api/resources/windows/client/requests/SessionContentPromptHandlerRequestBody.js → api/types/ClickConfig.js} +0 -0
- /package/{dist/api/types/PromptContentConfig.js → api/types/PageQueryConfig.js} +0 -0
- /package/{dist/api/types/PromptContentExperimentalConfig.js → api/types/PageQueryExperimentalConfig.js} +0 -0
@@ -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,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
|
-
}
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|