@airtop/sdk 0.1.38 → 0.1.40-beta0
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/README.md +9 -10
- package/api/errors/index.d.ts +2 -2
- package/api/errors/index.js +2 -2
- package/api/resources/automations/client/Client.js +12 -12
- package/api/resources/files/client/Client.js +12 -12
- package/api/resources/profiles/client/Client.js +3 -3
- package/api/resources/requests/client/Client.js +3 -3
- package/api/resources/sessions/client/Client.js +18 -18
- package/api/resources/sessions/types/SessionsEventsResponse.d.ts +10 -10
- package/api/resources/sessions/types/index.d.ts +3 -3
- package/api/resources/sessions/types/index.js +3 -3
- package/api/resources/windows/client/Client.d.ts +200 -0
- package/api/resources/windows/client/Client.js +1056 -211
- package/api/resources/windows/client/requests/ActRequest.d.ts +30 -0
- package/api/resources/windows/client/requests/ActRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncClickRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/AsyncHoverRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/AsyncMonitorRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncPageQueryRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +27 -0
- package/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
- package/api/resources/windows/client/requests/AsyncPromptContentRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
- package/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
- package/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
- package/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
- package/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
- package/api/resources/windows/client/requests/ExtractRequest.d.ts +30 -0
- package/api/resources/windows/client/requests/ExtractRequest.js +5 -0
- package/api/resources/windows/client/requests/FindManyRequest.d.ts +30 -0
- package/api/resources/windows/client/requests/FindManyRequest.js +5 -0
- package/api/resources/windows/client/requests/FindOneRequest.d.ts +30 -0
- package/api/resources/windows/client/requests/FindOneRequest.js +5 -0
- package/api/resources/windows/client/requests/LlmRequest.d.ts +25 -0
- package/api/resources/windows/client/requests/LlmRequest.js +5 -0
- package/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +25 -0
- package/api/resources/windows/client/requests/OperatorPromptV1Body.js +5 -0
- package/api/resources/windows/client/requests/index.d.ts +15 -0
- package/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +9 -0
- package/api/types/AsyncOperatorPromptResponseEnvelope.js +5 -0
- package/api/types/RequestStatusResponse.d.ts +2 -0
- package/api/types/SessionConfigV1.d.ts +2 -0
- package/api/types/index.d.ts +1 -0
- package/api/types/index.js +1 -0
- package/dist/api/errors/index.d.ts +2 -2
- package/dist/api/errors/index.js +2 -2
- package/dist/api/resources/automations/client/Client.js +12 -12
- package/dist/api/resources/files/client/Client.js +12 -12
- package/dist/api/resources/profiles/client/Client.js +3 -3
- package/dist/api/resources/requests/client/Client.js +3 -3
- package/dist/api/resources/sessions/client/Client.js +18 -18
- package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +10 -10
- package/dist/api/resources/sessions/types/index.d.ts +3 -3
- package/dist/api/resources/sessions/types/index.js +3 -3
- package/dist/api/resources/windows/client/Client.d.ts +200 -0
- package/dist/api/resources/windows/client/Client.js +1056 -211
- package/dist/api/resources/windows/client/requests/ActRequest.d.ts +30 -0
- package/dist/api/resources/windows/client/requests/ActRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncClickRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncHoverRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncMonitorRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncPageQueryRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +27 -0
- package/dist/api/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +29 -0
- package/dist/api/resources/windows/client/requests/AsyncPromptContentRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +23 -0
- package/dist/api/resources/windows/client/requests/AsyncScreenshotRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/AsyncSummarizeContentRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.d.ts +37 -0
- package/dist/api/resources/windows/client/requests/AsyncTypeRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/ExtractRequest.d.ts +30 -0
- package/dist/api/resources/windows/client/requests/ExtractRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/FindManyRequest.d.ts +30 -0
- package/dist/api/resources/windows/client/requests/FindManyRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/FindOneRequest.d.ts +30 -0
- package/dist/api/resources/windows/client/requests/FindOneRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/LlmRequest.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/LlmRequest.js +5 -0
- package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.d.ts +25 -0
- package/dist/api/resources/windows/client/requests/OperatorPromptV1Body.js +5 -0
- package/dist/api/resources/windows/client/requests/index.d.ts +15 -0
- package/dist/api/types/AsyncOperatorPromptResponseEnvelope.d.ts +9 -0
- package/dist/api/types/AsyncOperatorPromptResponseEnvelope.js +5 -0
- package/dist/api/types/RequestStatusResponse.d.ts +2 -0
- package/dist/api/types/SessionConfigV1.d.ts +2 -0
- package/dist/api/types/index.d.ts +1 -0
- package/dist/api/types/index.js +1 -0
- package/dist/environments.d.ts +1 -1
- package/dist/environments.js +1 -1
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +13 -13
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +6 -6
- package/dist/serialization/resources/sessions/types/index.d.ts +3 -3
- package/dist/serialization/resources/sessions/types/index.js +3 -3
- package/dist/serialization/resources/windows/client/requests/ActRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/ActRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncClickRequest.js +51 -0
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncHoverRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +51 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
- package/dist/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +51 -0
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
- package/dist/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +49 -0
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
- package/dist/serialization/resources/windows/client/requests/AsyncTypeRequest.js +55 -0
- package/dist/serialization/resources/windows/client/requests/ExtractRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/ExtractRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/FindManyRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/FindManyRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/FindOneRequest.d.ts +19 -0
- package/dist/serialization/resources/windows/client/requests/FindOneRequest.js +50 -0
- package/dist/serialization/resources/windows/client/requests/LlmRequest.d.ts +17 -0
- package/dist/serialization/resources/windows/client/requests/LlmRequest.js +48 -0
- package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +17 -0
- package/dist/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +48 -0
- package/dist/serialization/resources/windows/client/requests/index.d.ts +15 -0
- package/dist/serialization/resources/windows/client/requests/index.js +31 -1
- package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +15 -0
- package/dist/serialization/types/AsyncOperatorPromptResponseEnvelope.js +46 -0
- package/dist/serialization/types/RequestStatusResponse.d.ts +1 -0
- package/dist/serialization/types/RequestStatusResponse.js +1 -0
- package/dist/serialization/types/SessionConfigV1.d.ts +1 -0
- package/dist/serialization/types/SessionConfigV1.js +1 -0
- package/dist/serialization/types/index.d.ts +1 -0
- package/dist/serialization/types/index.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/environments.d.ts +1 -1
- package/environments.js +1 -1
- package/package.json +1 -1
- package/reference.md +1291 -140
- package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +13 -13
- package/serialization/resources/sessions/types/SessionsEventsResponse.js +6 -6
- package/serialization/resources/sessions/types/index.d.ts +3 -3
- package/serialization/resources/sessions/types/index.js +3 -3
- package/serialization/resources/windows/client/requests/ActRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/ActRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncClickRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncClickRequest.js +51 -0
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncHoverRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncMonitorRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncPageQueryRequest.js +51 -0
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncPaginatedExtractionRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.d.ts +20 -0
- package/serialization/resources/windows/client/requests/AsyncPromptContentRequest.js +51 -0
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.d.ts +18 -0
- package/serialization/resources/windows/client/requests/AsyncScreenshotRequest.js +49 -0
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/AsyncSummarizeContentRequest.js +50 -0
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.d.ts +24 -0
- package/serialization/resources/windows/client/requests/AsyncTypeRequest.js +55 -0
- package/serialization/resources/windows/client/requests/ExtractRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/ExtractRequest.js +50 -0
- package/serialization/resources/windows/client/requests/FindManyRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/FindManyRequest.js +50 -0
- package/serialization/resources/windows/client/requests/FindOneRequest.d.ts +19 -0
- package/serialization/resources/windows/client/requests/FindOneRequest.js +50 -0
- package/serialization/resources/windows/client/requests/LlmRequest.d.ts +17 -0
- package/serialization/resources/windows/client/requests/LlmRequest.js +48 -0
- package/serialization/resources/windows/client/requests/OperatorPromptV1Body.d.ts +17 -0
- package/serialization/resources/windows/client/requests/OperatorPromptV1Body.js +48 -0
- package/serialization/resources/windows/client/requests/index.d.ts +15 -0
- package/serialization/resources/windows/client/requests/index.js +31 -1
- package/serialization/types/AsyncOperatorPromptResponseEnvelope.d.ts +15 -0
- package/serialization/types/AsyncOperatorPromptResponseEnvelope.js +46 -0
- package/serialization/types/RequestStatusResponse.d.ts +1 -0
- package/serialization/types/RequestStatusResponse.js +1 -0
- package/serialization/types/SessionConfigV1.d.ts +1 -0
- package/serialization/types/SessionConfigV1.js +1 -0
- package/serialization/types/index.d.ts +1 -0
- package/serialization/types/index.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
@@ -58,6 +58,63 @@ class Windows {
|
|
58
58
|
constructor(_options) {
|
59
59
|
this._options = _options;
|
60
60
|
}
|
61
|
+
/**
|
62
|
+
* Execute a click interaction in a specific browser window asynchronously
|
63
|
+
*
|
64
|
+
* @param {string} sessionId - The session id for the window.
|
65
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
66
|
+
* @param {Airtop.AsyncClickRequest} request
|
67
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
68
|
+
*
|
69
|
+
* @example
|
70
|
+
* await client.windows.asyncClick("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
71
|
+
* elementDescription: "The login button"
|
72
|
+
* })
|
73
|
+
*/
|
74
|
+
asyncClick(sessionId, windowId, request, requestOptions) {
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
76
|
+
var _a, _b, _c;
|
77
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
78
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/click`),
|
79
|
+
method: "POST",
|
80
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
81
|
+
contentType: "application/json",
|
82
|
+
requestType: "json",
|
83
|
+
body: serializers.AsyncClickRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
84
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
85
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
86
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
87
|
+
});
|
88
|
+
if (_response.ok) {
|
89
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
90
|
+
unrecognizedObjectKeys: "passthrough",
|
91
|
+
allowUnrecognizedUnionMembers: true,
|
92
|
+
allowUnrecognizedEnumValues: true,
|
93
|
+
skipValidation: true,
|
94
|
+
breadcrumbsPrefix: ["response"],
|
95
|
+
});
|
96
|
+
}
|
97
|
+
if (_response.error.reason === "status-code") {
|
98
|
+
throw new errors.AirtopError({
|
99
|
+
statusCode: _response.error.statusCode,
|
100
|
+
body: _response.error.body,
|
101
|
+
});
|
102
|
+
}
|
103
|
+
switch (_response.error.reason) {
|
104
|
+
case "non-json":
|
105
|
+
throw new errors.AirtopError({
|
106
|
+
statusCode: _response.error.statusCode,
|
107
|
+
body: _response.error.rawBody,
|
108
|
+
});
|
109
|
+
case "timeout":
|
110
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/click.");
|
111
|
+
case "unknown":
|
112
|
+
throw new errors.AirtopError({
|
113
|
+
message: _response.error.errorMessage,
|
114
|
+
});
|
115
|
+
}
|
116
|
+
});
|
117
|
+
}
|
61
118
|
/**
|
62
119
|
* Create an automation of a browser window asynchronously
|
63
120
|
*
|
@@ -73,9 +130,9 @@ class Windows {
|
|
73
130
|
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
74
131
|
var _a, _b, _c;
|
75
132
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
76
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-automation`),
|
133
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-automation`),
|
77
134
|
method: "POST",
|
78
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
135
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
79
136
|
contentType: "application/json",
|
80
137
|
requestType: "json",
|
81
138
|
body: serializers.AsyncCreateAutomationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -105,7 +162,7 @@ class Windows {
|
|
105
162
|
body: _response.error.rawBody,
|
106
163
|
});
|
107
164
|
case "timeout":
|
108
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /async/sessions/{sessionId}/windows/{windowId}/create-automation.");
|
165
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/create-automation.");
|
109
166
|
case "unknown":
|
110
167
|
throw new errors.AirtopError({
|
111
168
|
message: _response.error.errorMessage,
|
@@ -128,9 +185,9 @@ class Windows {
|
|
128
185
|
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
129
186
|
var _a, _b, _c;
|
130
187
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
131
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-form-filler`),
|
188
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-form-filler`),
|
132
189
|
method: "POST",
|
133
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
190
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
134
191
|
contentType: "application/json",
|
135
192
|
requestType: "json",
|
136
193
|
body: serializers.AsyncCreateFormFillerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -160,7 +217,7 @@ class Windows {
|
|
160
217
|
body: _response.error.rawBody,
|
161
218
|
});
|
162
219
|
case "timeout":
|
163
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /async/sessions/{sessionId}/windows/{windowId}/create-form-filler.");
|
220
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/create-form-filler.");
|
164
221
|
case "unknown":
|
165
222
|
throw new errors.AirtopError({
|
166
223
|
message: _response.error.errorMessage,
|
@@ -185,9 +242,9 @@ class Windows {
|
|
185
242
|
return __awaiter(this, void 0, void 0, function* () {
|
186
243
|
var _a, _b, _c;
|
187
244
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
188
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/execute-automation`),
|
245
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/execute-automation`),
|
189
246
|
method: "POST",
|
190
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
247
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
191
248
|
contentType: "application/json",
|
192
249
|
requestType: "json",
|
193
250
|
body: serializers.AsyncExecuteAutomationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -217,7 +274,7 @@ class Windows {
|
|
217
274
|
body: _response.error.rawBody,
|
218
275
|
});
|
219
276
|
case "timeout":
|
220
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /async/sessions/{sessionId}/windows/{windowId}/execute-automation.");
|
277
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/execute-automation.");
|
221
278
|
case "unknown":
|
222
279
|
throw new errors.AirtopError({
|
223
280
|
message: _response.error.errorMessage,
|
@@ -242,9 +299,9 @@ class Windows {
|
|
242
299
|
return __awaiter(this, void 0, void 0, function* () {
|
243
300
|
var _a, _b, _c;
|
244
301
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
245
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/fill-form`),
|
302
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/fill-form`),
|
246
303
|
method: "POST",
|
247
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
304
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
248
305
|
contentType: "application/json",
|
249
306
|
requestType: "json",
|
250
307
|
body: serializers.AsyncFillFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
@@ -274,7 +331,7 @@ class Windows {
|
|
274
331
|
body: _response.error.rawBody,
|
275
332
|
});
|
276
333
|
case "timeout":
|
277
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /async/sessions/{sessionId}/windows/{windowId}/fill-form.");
|
334
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/fill-form.");
|
278
335
|
case "unknown":
|
279
336
|
throw new errors.AirtopError({
|
280
337
|
message: _response.error.errorMessage,
|
@@ -283,31 +340,820 @@ class Windows {
|
|
283
340
|
});
|
284
341
|
}
|
285
342
|
/**
|
286
|
-
*
|
343
|
+
* @param {string} sessionId - The session id for the window.
|
344
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
345
|
+
* @param {Airtop.AsyncHoverRequest} request
|
346
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
347
|
+
*
|
348
|
+
* @example
|
349
|
+
* await client.windows.asyncHover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
350
|
+
* elementDescription: "The search box input in the top right corner"
|
351
|
+
* })
|
352
|
+
*/
|
353
|
+
asyncHover(sessionId, windowId, request, requestOptions) {
|
354
|
+
return __awaiter(this, void 0, void 0, function* () {
|
355
|
+
var _a, _b, _c;
|
356
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
357
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/hover`),
|
358
|
+
method: "POST",
|
359
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
360
|
+
contentType: "application/json",
|
361
|
+
requestType: "json",
|
362
|
+
body: serializers.AsyncHoverRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
363
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
364
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
365
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
366
|
+
});
|
367
|
+
if (_response.ok) {
|
368
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
369
|
+
unrecognizedObjectKeys: "passthrough",
|
370
|
+
allowUnrecognizedUnionMembers: true,
|
371
|
+
allowUnrecognizedEnumValues: true,
|
372
|
+
skipValidation: true,
|
373
|
+
breadcrumbsPrefix: ["response"],
|
374
|
+
});
|
375
|
+
}
|
376
|
+
if (_response.error.reason === "status-code") {
|
377
|
+
throw new errors.AirtopError({
|
378
|
+
statusCode: _response.error.statusCode,
|
379
|
+
body: _response.error.body,
|
380
|
+
});
|
381
|
+
}
|
382
|
+
switch (_response.error.reason) {
|
383
|
+
case "non-json":
|
384
|
+
throw new errors.AirtopError({
|
385
|
+
statusCode: _response.error.statusCode,
|
386
|
+
body: _response.error.rawBody,
|
387
|
+
});
|
388
|
+
case "timeout":
|
389
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/hover.");
|
390
|
+
case "unknown":
|
391
|
+
throw new errors.AirtopError({
|
392
|
+
message: _response.error.errorMessage,
|
393
|
+
});
|
394
|
+
}
|
395
|
+
});
|
396
|
+
}
|
397
|
+
/**
|
398
|
+
* @param {string} sessionId - The session id for the window.
|
399
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
400
|
+
* @param {Airtop.AsyncMonitorRequest} request
|
401
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
402
|
+
*
|
403
|
+
* @example
|
404
|
+
* await client.windows.asyncMonitor("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
405
|
+
* condition: "Determine if the user appears to be signed in to the website"
|
406
|
+
* })
|
407
|
+
*/
|
408
|
+
asyncMonitor(sessionId, windowId, request, requestOptions) {
|
409
|
+
return __awaiter(this, void 0, void 0, function* () {
|
410
|
+
var _a, _b, _c;
|
411
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
412
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/monitor`),
|
413
|
+
method: "POST",
|
414
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
415
|
+
contentType: "application/json",
|
416
|
+
requestType: "json",
|
417
|
+
body: serializers.AsyncMonitorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
418
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
419
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
420
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
421
|
+
});
|
422
|
+
if (_response.ok) {
|
423
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
424
|
+
unrecognizedObjectKeys: "passthrough",
|
425
|
+
allowUnrecognizedUnionMembers: true,
|
426
|
+
allowUnrecognizedEnumValues: true,
|
427
|
+
skipValidation: true,
|
428
|
+
breadcrumbsPrefix: ["response"],
|
429
|
+
});
|
430
|
+
}
|
431
|
+
if (_response.error.reason === "status-code") {
|
432
|
+
throw new errors.AirtopError({
|
433
|
+
statusCode: _response.error.statusCode,
|
434
|
+
body: _response.error.body,
|
435
|
+
});
|
436
|
+
}
|
437
|
+
switch (_response.error.reason) {
|
438
|
+
case "non-json":
|
439
|
+
throw new errors.AirtopError({
|
440
|
+
statusCode: _response.error.statusCode,
|
441
|
+
body: _response.error.rawBody,
|
442
|
+
});
|
443
|
+
case "timeout":
|
444
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/monitor.");
|
445
|
+
case "unknown":
|
446
|
+
throw new errors.AirtopError({
|
447
|
+
message: _response.error.errorMessage,
|
448
|
+
});
|
449
|
+
}
|
450
|
+
});
|
451
|
+
}
|
452
|
+
/**
|
453
|
+
* @param {string} sessionId - The session id for the window.
|
454
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
455
|
+
* @param {Airtop.AsyncPageQueryRequest} request
|
456
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
457
|
+
*
|
458
|
+
* @example
|
459
|
+
* await client.windows.asyncPageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
460
|
+
* prompt: "What is the main idea of this page?"
|
461
|
+
* })
|
462
|
+
*/
|
463
|
+
asyncPageQuery(sessionId, windowId, request, requestOptions) {
|
464
|
+
return __awaiter(this, void 0, void 0, function* () {
|
465
|
+
var _a, _b, _c;
|
466
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
467
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/page-query`),
|
468
|
+
method: "POST",
|
469
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
470
|
+
contentType: "application/json",
|
471
|
+
requestType: "json",
|
472
|
+
body: serializers.AsyncPageQueryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
473
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
474
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
475
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
476
|
+
});
|
477
|
+
if (_response.ok) {
|
478
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
479
|
+
unrecognizedObjectKeys: "passthrough",
|
480
|
+
allowUnrecognizedUnionMembers: true,
|
481
|
+
allowUnrecognizedEnumValues: true,
|
482
|
+
skipValidation: true,
|
483
|
+
breadcrumbsPrefix: ["response"],
|
484
|
+
});
|
485
|
+
}
|
486
|
+
if (_response.error.reason === "status-code") {
|
487
|
+
throw new errors.AirtopError({
|
488
|
+
statusCode: _response.error.statusCode,
|
489
|
+
body: _response.error.body,
|
490
|
+
});
|
491
|
+
}
|
492
|
+
switch (_response.error.reason) {
|
493
|
+
case "non-json":
|
494
|
+
throw new errors.AirtopError({
|
495
|
+
statusCode: _response.error.statusCode,
|
496
|
+
body: _response.error.rawBody,
|
497
|
+
});
|
498
|
+
case "timeout":
|
499
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/page-query.");
|
500
|
+
case "unknown":
|
501
|
+
throw new errors.AirtopError({
|
502
|
+
message: _response.error.errorMessage,
|
503
|
+
});
|
504
|
+
}
|
505
|
+
});
|
506
|
+
}
|
507
|
+
/**
|
508
|
+
* @param {string} sessionId - The session id for the window.
|
509
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
510
|
+
* @param {Airtop.AsyncPaginatedExtractionRequest} request
|
511
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
512
|
+
*
|
513
|
+
* @example
|
514
|
+
* await client.windows.asyncPaginatedExtraction("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
515
|
+
* prompt: "This site contains a list of results about <provide details about the list>. Navigate through 3 pages of results and return the title and <provide details about the data you want to extract> about each result in this list."
|
516
|
+
* })
|
517
|
+
*/
|
518
|
+
asyncPaginatedExtraction(sessionId, windowId, request, requestOptions) {
|
519
|
+
return __awaiter(this, void 0, void 0, function* () {
|
520
|
+
var _a, _b, _c;
|
521
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
522
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/paginated-extraction`),
|
523
|
+
method: "POST",
|
524
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
525
|
+
contentType: "application/json",
|
526
|
+
requestType: "json",
|
527
|
+
body: serializers.AsyncPaginatedExtractionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
528
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
529
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
530
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
531
|
+
});
|
532
|
+
if (_response.ok) {
|
533
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
534
|
+
unrecognizedObjectKeys: "passthrough",
|
535
|
+
allowUnrecognizedUnionMembers: true,
|
536
|
+
allowUnrecognizedEnumValues: true,
|
537
|
+
skipValidation: true,
|
538
|
+
breadcrumbsPrefix: ["response"],
|
539
|
+
});
|
540
|
+
}
|
541
|
+
if (_response.error.reason === "status-code") {
|
542
|
+
throw new errors.AirtopError({
|
543
|
+
statusCode: _response.error.statusCode,
|
544
|
+
body: _response.error.body,
|
545
|
+
});
|
546
|
+
}
|
547
|
+
switch (_response.error.reason) {
|
548
|
+
case "non-json":
|
549
|
+
throw new errors.AirtopError({
|
550
|
+
statusCode: _response.error.statusCode,
|
551
|
+
body: _response.error.rawBody,
|
552
|
+
});
|
553
|
+
case "timeout":
|
554
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/paginated-extraction.");
|
555
|
+
case "unknown":
|
556
|
+
throw new errors.AirtopError({
|
557
|
+
message: _response.error.errorMessage,
|
558
|
+
});
|
559
|
+
}
|
560
|
+
});
|
561
|
+
}
|
562
|
+
/**
|
563
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
|
564
|
+
*
|
565
|
+
* @param {string} sessionId - The session id for the window.
|
566
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
567
|
+
* @param {Airtop.AsyncPromptContentRequest} request
|
568
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
569
|
+
*
|
570
|
+
* @example
|
571
|
+
* await client.windows.asyncPromptContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
572
|
+
* prompt: "What is the main idea of this page?"
|
573
|
+
* })
|
574
|
+
*/
|
575
|
+
asyncPromptContent(sessionId, windowId, request, requestOptions) {
|
576
|
+
return __awaiter(this, void 0, void 0, function* () {
|
577
|
+
var _a, _b, _c;
|
578
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
579
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/prompt-content`),
|
580
|
+
method: "POST",
|
581
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
582
|
+
contentType: "application/json",
|
583
|
+
requestType: "json",
|
584
|
+
body: serializers.AsyncPromptContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
585
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
586
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
587
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
588
|
+
});
|
589
|
+
if (_response.ok) {
|
590
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
591
|
+
unrecognizedObjectKeys: "passthrough",
|
592
|
+
allowUnrecognizedUnionMembers: true,
|
593
|
+
allowUnrecognizedEnumValues: true,
|
594
|
+
skipValidation: true,
|
595
|
+
breadcrumbsPrefix: ["response"],
|
596
|
+
});
|
597
|
+
}
|
598
|
+
if (_response.error.reason === "status-code") {
|
599
|
+
throw new errors.AirtopError({
|
600
|
+
statusCode: _response.error.statusCode,
|
601
|
+
body: _response.error.body,
|
602
|
+
});
|
603
|
+
}
|
604
|
+
switch (_response.error.reason) {
|
605
|
+
case "non-json":
|
606
|
+
throw new errors.AirtopError({
|
607
|
+
statusCode: _response.error.statusCode,
|
608
|
+
body: _response.error.rawBody,
|
609
|
+
});
|
610
|
+
case "timeout":
|
611
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/prompt-content.");
|
612
|
+
case "unknown":
|
613
|
+
throw new errors.AirtopError({
|
614
|
+
message: _response.error.errorMessage,
|
615
|
+
});
|
616
|
+
}
|
617
|
+
});
|
618
|
+
}
|
619
|
+
/**
|
620
|
+
* Take a screenshot of the current viewport of a browser window asynchronously
|
621
|
+
*
|
622
|
+
* @param {string} sessionId - The session id for the window.
|
623
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
624
|
+
* @param {Airtop.AsyncScreenshotRequest} request
|
625
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
626
|
+
*
|
627
|
+
* @example
|
628
|
+
* await client.windows.asyncScreenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
629
|
+
*/
|
630
|
+
asyncScreenshot(sessionId_1, windowId_1) {
|
631
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
632
|
+
var _a, _b, _c;
|
633
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
634
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/screenshot`),
|
635
|
+
method: "POST",
|
636
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
637
|
+
contentType: "application/json",
|
638
|
+
requestType: "json",
|
639
|
+
body: serializers.AsyncScreenshotRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
640
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
641
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
642
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
643
|
+
});
|
644
|
+
if (_response.ok) {
|
645
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
646
|
+
unrecognizedObjectKeys: "passthrough",
|
647
|
+
allowUnrecognizedUnionMembers: true,
|
648
|
+
allowUnrecognizedEnumValues: true,
|
649
|
+
skipValidation: true,
|
650
|
+
breadcrumbsPrefix: ["response"],
|
651
|
+
});
|
652
|
+
}
|
653
|
+
if (_response.error.reason === "status-code") {
|
654
|
+
throw new errors.AirtopError({
|
655
|
+
statusCode: _response.error.statusCode,
|
656
|
+
body: _response.error.body,
|
657
|
+
});
|
658
|
+
}
|
659
|
+
switch (_response.error.reason) {
|
660
|
+
case "non-json":
|
661
|
+
throw new errors.AirtopError({
|
662
|
+
statusCode: _response.error.statusCode,
|
663
|
+
body: _response.error.rawBody,
|
664
|
+
});
|
665
|
+
case "timeout":
|
666
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/screenshot.");
|
667
|
+
case "unknown":
|
668
|
+
throw new errors.AirtopError({
|
669
|
+
message: _response.error.errorMessage,
|
670
|
+
});
|
671
|
+
}
|
672
|
+
});
|
673
|
+
}
|
674
|
+
/**
|
675
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
|
676
|
+
*
|
677
|
+
* @param {string} sessionId - The session id for the window.
|
678
|
+
* @param {string} windowId - The Airtop window id of the browser window to summarize.
|
679
|
+
* @param {Airtop.AsyncSummarizeContentRequest} request
|
680
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
681
|
+
*
|
682
|
+
* @example
|
683
|
+
* await client.windows.asyncSummarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
684
|
+
*/
|
685
|
+
asyncSummarizeContent(sessionId_1, windowId_1) {
|
686
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
687
|
+
var _a, _b, _c;
|
688
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
689
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/summarize-content`),
|
690
|
+
method: "POST",
|
691
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
692
|
+
contentType: "application/json",
|
693
|
+
requestType: "json",
|
694
|
+
body: serializers.AsyncSummarizeContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
695
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
696
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
697
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
698
|
+
});
|
699
|
+
if (_response.ok) {
|
700
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
701
|
+
unrecognizedObjectKeys: "passthrough",
|
702
|
+
allowUnrecognizedUnionMembers: true,
|
703
|
+
allowUnrecognizedEnumValues: true,
|
704
|
+
skipValidation: true,
|
705
|
+
breadcrumbsPrefix: ["response"],
|
706
|
+
});
|
707
|
+
}
|
708
|
+
if (_response.error.reason === "status-code") {
|
709
|
+
throw new errors.AirtopError({
|
710
|
+
statusCode: _response.error.statusCode,
|
711
|
+
body: _response.error.body,
|
712
|
+
});
|
713
|
+
}
|
714
|
+
switch (_response.error.reason) {
|
715
|
+
case "non-json":
|
716
|
+
throw new errors.AirtopError({
|
717
|
+
statusCode: _response.error.statusCode,
|
718
|
+
body: _response.error.rawBody,
|
719
|
+
});
|
720
|
+
case "timeout":
|
721
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/summarize-content.");
|
722
|
+
case "unknown":
|
723
|
+
throw new errors.AirtopError({
|
724
|
+
message: _response.error.errorMessage,
|
725
|
+
});
|
726
|
+
}
|
727
|
+
});
|
728
|
+
}
|
729
|
+
/**
|
730
|
+
* @param {string} sessionId - The session id for the window.
|
731
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
732
|
+
* @param {Airtop.AsyncTypeRequest} request
|
733
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
734
|
+
*
|
735
|
+
* @example
|
736
|
+
* await client.windows.asyncType("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
737
|
+
* text: "Example text"
|
738
|
+
* })
|
739
|
+
*/
|
740
|
+
asyncType(sessionId, windowId, request, requestOptions) {
|
741
|
+
return __awaiter(this, void 0, void 0, function* () {
|
742
|
+
var _a, _b, _c;
|
743
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
744
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/async/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/type`),
|
745
|
+
method: "POST",
|
746
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
747
|
+
contentType: "application/json",
|
748
|
+
requestType: "json",
|
749
|
+
body: serializers.AsyncTypeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
750
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
751
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
752
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
753
|
+
});
|
754
|
+
if (_response.ok) {
|
755
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
756
|
+
unrecognizedObjectKeys: "passthrough",
|
757
|
+
allowUnrecognizedUnionMembers: true,
|
758
|
+
allowUnrecognizedEnumValues: true,
|
759
|
+
skipValidation: true,
|
760
|
+
breadcrumbsPrefix: ["response"],
|
761
|
+
});
|
762
|
+
}
|
763
|
+
if (_response.error.reason === "status-code") {
|
764
|
+
throw new errors.AirtopError({
|
765
|
+
statusCode: _response.error.statusCode,
|
766
|
+
body: _response.error.body,
|
767
|
+
});
|
768
|
+
}
|
769
|
+
switch (_response.error.reason) {
|
770
|
+
case "non-json":
|
771
|
+
throw new errors.AirtopError({
|
772
|
+
statusCode: _response.error.statusCode,
|
773
|
+
body: _response.error.rawBody,
|
774
|
+
});
|
775
|
+
case "timeout":
|
776
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/async/sessions/{sessionId}/windows/{windowId}/type.");
|
777
|
+
case "unknown":
|
778
|
+
throw new errors.AirtopError({
|
779
|
+
message: _response.error.errorMessage,
|
780
|
+
});
|
781
|
+
}
|
782
|
+
});
|
783
|
+
}
|
784
|
+
/**
|
785
|
+
* Creates a new browser window in a session. Optionally, you can specify a url to load on the window upon creation.
|
786
|
+
*
|
787
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
788
|
+
* @param {Airtop.CreateWindowInputV1Body} request
|
789
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
790
|
+
*
|
791
|
+
* @example
|
792
|
+
* await client.windows.create("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b")
|
793
|
+
*/
|
794
|
+
create(sessionId_1) {
|
795
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, request = {}, requestOptions) {
|
796
|
+
var _a, _b, _c;
|
797
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
798
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows`),
|
799
|
+
method: "POST",
|
800
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
801
|
+
contentType: "application/json",
|
802
|
+
requestType: "json",
|
803
|
+
body: serializers.CreateWindowInputV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
804
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
805
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
806
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
807
|
+
});
|
808
|
+
if (_response.ok) {
|
809
|
+
return serializers.WindowIdResponse.parseOrThrow(_response.body, {
|
810
|
+
unrecognizedObjectKeys: "passthrough",
|
811
|
+
allowUnrecognizedUnionMembers: true,
|
812
|
+
allowUnrecognizedEnumValues: true,
|
813
|
+
skipValidation: true,
|
814
|
+
breadcrumbsPrefix: ["response"],
|
815
|
+
});
|
816
|
+
}
|
817
|
+
if (_response.error.reason === "status-code") {
|
818
|
+
throw new errors.AirtopError({
|
819
|
+
statusCode: _response.error.statusCode,
|
820
|
+
body: _response.error.body,
|
821
|
+
});
|
822
|
+
}
|
823
|
+
switch (_response.error.reason) {
|
824
|
+
case "non-json":
|
825
|
+
throw new errors.AirtopError({
|
826
|
+
statusCode: _response.error.statusCode,
|
827
|
+
body: _response.error.rawBody,
|
828
|
+
});
|
829
|
+
case "timeout":
|
830
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows.");
|
831
|
+
case "unknown":
|
832
|
+
throw new errors.AirtopError({
|
833
|
+
message: _response.error.errorMessage,
|
834
|
+
});
|
835
|
+
}
|
836
|
+
});
|
837
|
+
}
|
838
|
+
/**
|
839
|
+
* Get information about a browser window in a session, including the live view url.
|
840
|
+
*
|
841
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
842
|
+
* @param {string} windowId - ID of the browser window, which can either be a normal AirTop windowId or a [CDP TargetId](https://chromedevtools.github.io/devtools-protocol/tot/Target/#type-TargetID) from a browser automation library like Puppeteer (typically associated with the page or main frame). Our SDKs will handle retrieving a TargetId for you from various popular browser automation libraries, but we also have details in our guides on how to do it manually.
|
843
|
+
* @param {Airtop.GetWindowInfoRequest} request
|
844
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
845
|
+
*
|
846
|
+
* @example
|
847
|
+
* await client.windows.getWindowInfo("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
|
848
|
+
* screenResolution: "1280x720"
|
849
|
+
* })
|
850
|
+
*/
|
851
|
+
getWindowInfo(sessionId_1, windowId_1) {
|
852
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
853
|
+
var _a, _b, _c;
|
854
|
+
const { includeNavigationBar, disableResize, screenResolution } = request;
|
855
|
+
const _queryParams = {};
|
856
|
+
if (includeNavigationBar != null) {
|
857
|
+
_queryParams["includeNavigationBar"] = includeNavigationBar.toString();
|
858
|
+
}
|
859
|
+
if (disableResize != null) {
|
860
|
+
_queryParams["disableResize"] = disableResize.toString();
|
861
|
+
}
|
862
|
+
if (screenResolution != null) {
|
863
|
+
_queryParams["screenResolution"] = screenResolution;
|
864
|
+
}
|
865
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
866
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
867
|
+
method: "GET",
|
868
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
869
|
+
contentType: "application/json",
|
870
|
+
queryParameters: _queryParams,
|
871
|
+
requestType: "json",
|
872
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
873
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
874
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
875
|
+
});
|
876
|
+
if (_response.ok) {
|
877
|
+
return serializers.WindowResponse.parseOrThrow(_response.body, {
|
878
|
+
unrecognizedObjectKeys: "passthrough",
|
879
|
+
allowUnrecognizedUnionMembers: true,
|
880
|
+
allowUnrecognizedEnumValues: true,
|
881
|
+
skipValidation: true,
|
882
|
+
breadcrumbsPrefix: ["response"],
|
883
|
+
});
|
884
|
+
}
|
885
|
+
if (_response.error.reason === "status-code") {
|
886
|
+
throw new errors.AirtopError({
|
887
|
+
statusCode: _response.error.statusCode,
|
888
|
+
body: _response.error.body,
|
889
|
+
});
|
890
|
+
}
|
891
|
+
switch (_response.error.reason) {
|
892
|
+
case "non-json":
|
893
|
+
throw new errors.AirtopError({
|
894
|
+
statusCode: _response.error.statusCode,
|
895
|
+
body: _response.error.rawBody,
|
896
|
+
});
|
897
|
+
case "timeout":
|
898
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling GET /v1/sessions/{sessionId}/windows/{windowId}.");
|
899
|
+
case "unknown":
|
900
|
+
throw new errors.AirtopError({
|
901
|
+
message: _response.error.errorMessage,
|
902
|
+
});
|
903
|
+
}
|
904
|
+
});
|
905
|
+
}
|
906
|
+
/**
|
907
|
+
* Loads a specified url on a given window
|
908
|
+
*
|
909
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
910
|
+
* @param {string} windowId - Airtop window ID of the browser window.
|
911
|
+
* @param {Airtop.WindowLoadUrlV1Body} request
|
912
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
913
|
+
*
|
914
|
+
* @example
|
915
|
+
* await client.windows.loadUrl("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
|
916
|
+
* url: "https://www.airtop.ai"
|
917
|
+
* })
|
918
|
+
*/
|
919
|
+
loadUrl(sessionId, windowId, request, requestOptions) {
|
920
|
+
return __awaiter(this, void 0, void 0, function* () {
|
921
|
+
var _a, _b, _c;
|
922
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
923
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
924
|
+
method: "POST",
|
925
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
926
|
+
contentType: "application/json",
|
927
|
+
requestType: "json",
|
928
|
+
body: serializers.WindowLoadUrlV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
929
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
930
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
931
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
932
|
+
});
|
933
|
+
if (_response.ok) {
|
934
|
+
return serializers.OperationOutcomeResponse.parseOrThrow(_response.body, {
|
935
|
+
unrecognizedObjectKeys: "passthrough",
|
936
|
+
allowUnrecognizedUnionMembers: true,
|
937
|
+
allowUnrecognizedEnumValues: true,
|
938
|
+
skipValidation: true,
|
939
|
+
breadcrumbsPrefix: ["response"],
|
940
|
+
});
|
941
|
+
}
|
942
|
+
if (_response.error.reason === "status-code") {
|
943
|
+
throw new errors.AirtopError({
|
944
|
+
statusCode: _response.error.statusCode,
|
945
|
+
body: _response.error.body,
|
946
|
+
});
|
947
|
+
}
|
948
|
+
switch (_response.error.reason) {
|
949
|
+
case "non-json":
|
950
|
+
throw new errors.AirtopError({
|
951
|
+
statusCode: _response.error.statusCode,
|
952
|
+
body: _response.error.rawBody,
|
953
|
+
});
|
954
|
+
case "timeout":
|
955
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}.");
|
956
|
+
case "unknown":
|
957
|
+
throw new errors.AirtopError({
|
958
|
+
message: _response.error.errorMessage,
|
959
|
+
});
|
960
|
+
}
|
961
|
+
});
|
962
|
+
}
|
963
|
+
/**
|
964
|
+
* Closes a browser window in a session
|
965
|
+
*
|
966
|
+
* @param {string} sessionId - ID of the session that owns the window.
|
967
|
+
* @param {string} windowId - Airtop window ID of the browser window.
|
968
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
969
|
+
*
|
970
|
+
* @example
|
971
|
+
* await client.windows.close("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430")
|
972
|
+
*/
|
973
|
+
close(sessionId, windowId, requestOptions) {
|
974
|
+
return __awaiter(this, void 0, void 0, function* () {
|
975
|
+
var _a, _b, _c;
|
976
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
977
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
978
|
+
method: "DELETE",
|
979
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
980
|
+
contentType: "application/json",
|
981
|
+
requestType: "json",
|
982
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
983
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
984
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
985
|
+
});
|
986
|
+
if (_response.ok) {
|
987
|
+
return serializers.WindowIdResponse.parseOrThrow(_response.body, {
|
988
|
+
unrecognizedObjectKeys: "passthrough",
|
989
|
+
allowUnrecognizedUnionMembers: true,
|
990
|
+
allowUnrecognizedEnumValues: true,
|
991
|
+
skipValidation: true,
|
992
|
+
breadcrumbsPrefix: ["response"],
|
993
|
+
});
|
994
|
+
}
|
995
|
+
if (_response.error.reason === "status-code") {
|
996
|
+
throw new errors.AirtopError({
|
997
|
+
statusCode: _response.error.statusCode,
|
998
|
+
body: _response.error.body,
|
999
|
+
});
|
1000
|
+
}
|
1001
|
+
switch (_response.error.reason) {
|
1002
|
+
case "non-json":
|
1003
|
+
throw new errors.AirtopError({
|
1004
|
+
statusCode: _response.error.statusCode,
|
1005
|
+
body: _response.error.rawBody,
|
1006
|
+
});
|
1007
|
+
case "timeout":
|
1008
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling DELETE /v1/sessions/{sessionId}/windows/{windowId}.");
|
1009
|
+
case "unknown":
|
1010
|
+
throw new errors.AirtopError({
|
1011
|
+
message: _response.error.errorMessage,
|
1012
|
+
});
|
1013
|
+
}
|
1014
|
+
});
|
1015
|
+
}
|
1016
|
+
/**
|
1017
|
+
* Execute a click interaction in a specific browser window
|
1018
|
+
*
|
1019
|
+
* @param {string} sessionId - The session id for the window.
|
1020
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1021
|
+
* @param {Airtop.SessionClickHandlerRequestBody} request
|
1022
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1023
|
+
*
|
1024
|
+
* @example
|
1025
|
+
* await client.windows.click("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1026
|
+
* elementDescription: "The login button"
|
1027
|
+
* })
|
1028
|
+
*/
|
1029
|
+
click(sessionId, windowId, request, requestOptions) {
|
1030
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1031
|
+
var _a, _b, _c;
|
1032
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1033
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/click`),
|
1034
|
+
method: "POST",
|
1035
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1036
|
+
contentType: "application/json",
|
1037
|
+
requestType: "json",
|
1038
|
+
body: serializers.SessionClickHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1039
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1040
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1041
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1042
|
+
});
|
1043
|
+
if (_response.ok) {
|
1044
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1045
|
+
unrecognizedObjectKeys: "passthrough",
|
1046
|
+
allowUnrecognizedUnionMembers: true,
|
1047
|
+
allowUnrecognizedEnumValues: true,
|
1048
|
+
skipValidation: true,
|
1049
|
+
breadcrumbsPrefix: ["response"],
|
1050
|
+
});
|
1051
|
+
}
|
1052
|
+
if (_response.error.reason === "status-code") {
|
1053
|
+
throw new errors.AirtopError({
|
1054
|
+
statusCode: _response.error.statusCode,
|
1055
|
+
body: _response.error.body,
|
1056
|
+
});
|
1057
|
+
}
|
1058
|
+
switch (_response.error.reason) {
|
1059
|
+
case "non-json":
|
1060
|
+
throw new errors.AirtopError({
|
1061
|
+
statusCode: _response.error.statusCode,
|
1062
|
+
body: _response.error.rawBody,
|
1063
|
+
});
|
1064
|
+
case "timeout":
|
1065
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/click.");
|
1066
|
+
case "unknown":
|
1067
|
+
throw new errors.AirtopError({
|
1068
|
+
message: _response.error.errorMessage,
|
1069
|
+
});
|
1070
|
+
}
|
1071
|
+
});
|
1072
|
+
}
|
1073
|
+
/**
|
1074
|
+
* Create a form-filler automation synchronously for the form loaded in the browser window
|
1075
|
+
*
|
1076
|
+
* @param {string} sessionId - The session id for the window.
|
1077
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1078
|
+
* @param {Airtop.CreateFormFillerRequest} request
|
1079
|
+
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1080
|
+
*
|
1081
|
+
* @example
|
1082
|
+
* await client.windows.createFormFiller("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
1083
|
+
*/
|
1084
|
+
createFormFiller(sessionId_1, windowId_1) {
|
1085
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
1086
|
+
var _a, _b, _c;
|
1087
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1088
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/create-form-filler`),
|
1089
|
+
method: "POST",
|
1090
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1091
|
+
contentType: "application/json",
|
1092
|
+
requestType: "json",
|
1093
|
+
body: serializers.CreateFormFillerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1094
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1095
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1096
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1097
|
+
});
|
1098
|
+
if (_response.ok) {
|
1099
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
1100
|
+
unrecognizedObjectKeys: "passthrough",
|
1101
|
+
allowUnrecognizedUnionMembers: true,
|
1102
|
+
allowUnrecognizedEnumValues: true,
|
1103
|
+
skipValidation: true,
|
1104
|
+
breadcrumbsPrefix: ["response"],
|
1105
|
+
});
|
1106
|
+
}
|
1107
|
+
if (_response.error.reason === "status-code") {
|
1108
|
+
throw new errors.AirtopError({
|
1109
|
+
statusCode: _response.error.statusCode,
|
1110
|
+
body: _response.error.body,
|
1111
|
+
});
|
1112
|
+
}
|
1113
|
+
switch (_response.error.reason) {
|
1114
|
+
case "non-json":
|
1115
|
+
throw new errors.AirtopError({
|
1116
|
+
statusCode: _response.error.statusCode,
|
1117
|
+
body: _response.error.rawBody,
|
1118
|
+
});
|
1119
|
+
case "timeout":
|
1120
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/create-form-filler.");
|
1121
|
+
case "unknown":
|
1122
|
+
throw new errors.AirtopError({
|
1123
|
+
message: _response.error.errorMessage,
|
1124
|
+
});
|
1125
|
+
}
|
1126
|
+
});
|
1127
|
+
}
|
1128
|
+
/**
|
1129
|
+
* Fill a form of a browser window synchronously using a form-filler automation
|
287
1130
|
*
|
288
|
-
* @param {string} sessionId -
|
289
|
-
* @param {Airtop.
|
1131
|
+
* @param {string} sessionId - The session id for the window.
|
1132
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1133
|
+
* @param {Airtop.FillFormRequest} request
|
290
1134
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
291
1135
|
*
|
292
1136
|
* @example
|
293
|
-
* await client.windows.
|
1137
|
+
* await client.windows.fillForm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1138
|
+
* automationId: "automationId"
|
1139
|
+
* })
|
294
1140
|
*/
|
295
|
-
|
296
|
-
return __awaiter(this,
|
1141
|
+
fillForm(sessionId, windowId, request, requestOptions) {
|
1142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
297
1143
|
var _a, _b, _c;
|
298
1144
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
299
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows`),
|
1145
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/fill-form`),
|
300
1146
|
method: "POST",
|
301
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1147
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
302
1148
|
contentType: "application/json",
|
303
1149
|
requestType: "json",
|
304
|
-
body: serializers.
|
1150
|
+
body: serializers.FillFormRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
305
1151
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
306
1152
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
307
1153
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
308
1154
|
});
|
309
1155
|
if (_response.ok) {
|
310
|
-
return serializers.
|
1156
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
311
1157
|
unrecognizedObjectKeys: "passthrough",
|
312
1158
|
allowUnrecognizedUnionMembers: true,
|
313
1159
|
allowUnrecognizedEnumValues: true,
|
@@ -328,7 +1174,7 @@ class Windows {
|
|
328
1174
|
body: _response.error.rawBody,
|
329
1175
|
});
|
330
1176
|
case "timeout":
|
331
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows.");
|
1177
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/fill-form.");
|
332
1178
|
case "unknown":
|
333
1179
|
throw new errors.AirtopError({
|
334
1180
|
message: _response.error.errorMessage,
|
@@ -337,45 +1183,34 @@ class Windows {
|
|
337
1183
|
});
|
338
1184
|
}
|
339
1185
|
/**
|
340
|
-
*
|
1186
|
+
* Execute a hover interaction in a specific browser window
|
341
1187
|
*
|
342
|
-
* @param {string} sessionId -
|
343
|
-
* @param {string} windowId -
|
344
|
-
* @param {Airtop.
|
1188
|
+
* @param {string} sessionId - The session id for the window.
|
1189
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1190
|
+
* @param {Airtop.SessionHoverHandlerRequestBody} request
|
345
1191
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
346
1192
|
*
|
347
1193
|
* @example
|
348
|
-
* await client.windows.
|
349
|
-
*
|
1194
|
+
* await client.windows.hover("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1195
|
+
* elementDescription: "The search box input in the top right corner"
|
350
1196
|
* })
|
351
1197
|
*/
|
352
|
-
|
353
|
-
return __awaiter(this,
|
1198
|
+
hover(sessionId, windowId, request, requestOptions) {
|
1199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
354
1200
|
var _a, _b, _c;
|
355
|
-
const { includeNavigationBar, disableResize, screenResolution } = request;
|
356
|
-
const _queryParams = {};
|
357
|
-
if (includeNavigationBar != null) {
|
358
|
-
_queryParams["includeNavigationBar"] = includeNavigationBar.toString();
|
359
|
-
}
|
360
|
-
if (disableResize != null) {
|
361
|
-
_queryParams["disableResize"] = disableResize.toString();
|
362
|
-
}
|
363
|
-
if (screenResolution != null) {
|
364
|
-
_queryParams["screenResolution"] = screenResolution;
|
365
|
-
}
|
366
1201
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
367
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
368
|
-
method: "
|
369
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1202
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/hover`),
|
1203
|
+
method: "POST",
|
1204
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
370
1205
|
contentType: "application/json",
|
371
|
-
queryParameters: _queryParams,
|
372
1206
|
requestType: "json",
|
1207
|
+
body: serializers.SessionHoverHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
373
1208
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
374
1209
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
375
1210
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
376
1211
|
});
|
377
1212
|
if (_response.ok) {
|
378
|
-
return serializers.
|
1213
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
379
1214
|
unrecognizedObjectKeys: "passthrough",
|
380
1215
|
allowUnrecognizedUnionMembers: true,
|
381
1216
|
allowUnrecognizedEnumValues: true,
|
@@ -396,7 +1231,7 @@ class Windows {
|
|
396
1231
|
body: _response.error.rawBody,
|
397
1232
|
});
|
398
1233
|
case "timeout":
|
399
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling
|
1234
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/hover.");
|
400
1235
|
case "unknown":
|
401
1236
|
throw new errors.AirtopError({
|
402
1237
|
message: _response.error.errorMessage,
|
@@ -405,34 +1240,34 @@ class Windows {
|
|
405
1240
|
});
|
406
1241
|
}
|
407
1242
|
/**
|
408
|
-
*
|
409
|
-
*
|
410
|
-
* @param {
|
411
|
-
* @param {string} windowId - Airtop window ID of the browser window.
|
412
|
-
* @param {Airtop.WindowLoadUrlV1Body} request
|
1243
|
+
* @param {string} sessionId - The session id for the window.
|
1244
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1245
|
+
* @param {Airtop.SessionMonitorHandlerRequestBody} request
|
413
1246
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
414
1247
|
*
|
415
1248
|
* @example
|
416
|
-
* await client.windows.
|
417
|
-
*
|
1249
|
+
* await client.windows.monitor("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1250
|
+
* condition: "Determine if the user appears to be signed in to the website"
|
418
1251
|
* })
|
419
1252
|
*/
|
420
|
-
|
1253
|
+
monitor(sessionId, windowId, request, requestOptions) {
|
421
1254
|
return __awaiter(this, void 0, void 0, function* () {
|
422
1255
|
var _a, _b, _c;
|
423
1256
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
424
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
1257
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/monitor`),
|
425
1258
|
method: "POST",
|
426
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1259
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
427
1260
|
contentType: "application/json",
|
428
1261
|
requestType: "json",
|
429
|
-
body: serializers.
|
1262
|
+
body: serializers.SessionMonitorHandlerRequestBody.jsonOrThrow(request, {
|
1263
|
+
unrecognizedObjectKeys: "strip",
|
1264
|
+
}),
|
430
1265
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
431
1266
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
432
1267
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
433
1268
|
});
|
434
1269
|
if (_response.ok) {
|
435
|
-
return serializers.
|
1270
|
+
return serializers.AiPromptResponse.parseOrThrow(_response.body, {
|
436
1271
|
unrecognizedObjectKeys: "passthrough",
|
437
1272
|
allowUnrecognizedUnionMembers: true,
|
438
1273
|
allowUnrecognizedEnumValues: true,
|
@@ -453,7 +1288,7 @@ class Windows {
|
|
453
1288
|
body: _response.error.rawBody,
|
454
1289
|
});
|
455
1290
|
case "timeout":
|
456
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}.");
|
1291
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/monitor.");
|
457
1292
|
case "unknown":
|
458
1293
|
throw new errors.AirtopError({
|
459
1294
|
message: _response.error.errorMessage,
|
@@ -462,30 +1297,34 @@ class Windows {
|
|
462
1297
|
});
|
463
1298
|
}
|
464
1299
|
/**
|
465
|
-
*
|
1300
|
+
* Prompt OpenAI Operator
|
466
1301
|
*
|
467
1302
|
* @param {string} sessionId - ID of the session that owns the window.
|
468
1303
|
* @param {string} windowId - Airtop window ID of the browser window.
|
1304
|
+
* @param {Airtop.OperatorPromptV1Body} request
|
469
1305
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
470
1306
|
*
|
471
1307
|
* @example
|
472
|
-
* await client.windows.
|
1308
|
+
* await client.windows.operatorPrompt("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "7334da2a-91b0-42c5-6156-76a5eba87430", {
|
1309
|
+
* prompt: "What is the latest news about OpenAI?"
|
1310
|
+
* })
|
473
1311
|
*/
|
474
|
-
|
1312
|
+
operatorPrompt(sessionId, windowId, request, requestOptions) {
|
475
1313
|
return __awaiter(this, void 0, void 0, function* () {
|
476
1314
|
var _a, _b, _c;
|
477
1315
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
478
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}`),
|
479
|
-
method: "
|
480
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1316
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/operator`),
|
1317
|
+
method: "POST",
|
1318
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
481
1319
|
contentType: "application/json",
|
482
1320
|
requestType: "json",
|
1321
|
+
body: serializers.OperatorPromptV1Body.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
483
1322
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
484
1323
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
485
1324
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
486
1325
|
});
|
487
1326
|
if (_response.ok) {
|
488
|
-
return serializers.
|
1327
|
+
return serializers.AsyncOperatorPromptResponseEnvelope.parseOrThrow(_response.body, {
|
489
1328
|
unrecognizedObjectKeys: "passthrough",
|
490
1329
|
allowUnrecognizedUnionMembers: true,
|
491
1330
|
allowUnrecognizedEnumValues: true,
|
@@ -506,7 +1345,7 @@ class Windows {
|
|
506
1345
|
body: _response.error.rawBody,
|
507
1346
|
});
|
508
1347
|
case "timeout":
|
509
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling
|
1348
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/operator.");
|
510
1349
|
case "unknown":
|
511
1350
|
throw new errors.AirtopError({
|
512
1351
|
message: _response.error.errorMessage,
|
@@ -515,28 +1354,30 @@ class Windows {
|
|
515
1354
|
});
|
516
1355
|
}
|
517
1356
|
/**
|
518
|
-
*
|
1357
|
+
* Submit a prompt that queries the content of a specific browser window. You may extract content from the page, or ask a question about the page and allow the AI to answer it (ex. Is the user logged in?).
|
519
1358
|
*
|
520
1359
|
* @param {string} sessionId - The session id for the window.
|
521
1360
|
* @param {string} windowId - The Airtop window id of the browser window.
|
522
|
-
* @param {Airtop.
|
1361
|
+
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
|
523
1362
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
524
1363
|
*
|
525
1364
|
* @example
|
526
|
-
* await client.windows.
|
527
|
-
*
|
1365
|
+
* await client.windows.pageQuery("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1366
|
+
* prompt: "What is the main idea of this page?"
|
528
1367
|
* })
|
529
1368
|
*/
|
530
|
-
|
1369
|
+
pageQuery(sessionId, windowId, request, requestOptions) {
|
531
1370
|
return __awaiter(this, void 0, void 0, function* () {
|
532
1371
|
var _a, _b, _c;
|
533
1372
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
534
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1373
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/page-query`),
|
535
1374
|
method: "POST",
|
536
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1375
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
537
1376
|
contentType: "application/json",
|
538
1377
|
requestType: "json",
|
539
|
-
body: serializers.
|
1378
|
+
body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
|
1379
|
+
unrecognizedObjectKeys: "strip",
|
1380
|
+
}),
|
540
1381
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
541
1382
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
542
1383
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -563,7 +1404,7 @@ class Windows {
|
|
563
1404
|
body: _response.error.rawBody,
|
564
1405
|
});
|
565
1406
|
case "timeout":
|
566
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1407
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/page-query.");
|
567
1408
|
case "unknown":
|
568
1409
|
throw new errors.AirtopError({
|
569
1410
|
message: _response.error.errorMessage,
|
@@ -572,26 +1413,30 @@ class Windows {
|
|
572
1413
|
});
|
573
1414
|
}
|
574
1415
|
/**
|
575
|
-
*
|
1416
|
+
* Submit a prompt that queries the content of a specific browser window and paginates through pages to return a list of results.
|
576
1417
|
*
|
577
1418
|
* @param {string} sessionId - The session id for the window.
|
578
1419
|
* @param {string} windowId - The Airtop window id of the browser window.
|
579
|
-
* @param {Airtop.
|
1420
|
+
* @param {Airtop.SessionPaginatedExtractionHandlerRequestBody} request
|
580
1421
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
581
1422
|
*
|
582
1423
|
* @example
|
583
|
-
* await client.windows.
|
1424
|
+
* await client.windows.paginatedExtraction("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1425
|
+
* prompt: "This site contains a list of results about <provide details about the list>. Navigate through 3 pages of results and return the title and <provide details about the data you want to extract> about each result in this list."
|
1426
|
+
* })
|
584
1427
|
*/
|
585
|
-
|
586
|
-
return __awaiter(this,
|
1428
|
+
paginatedExtraction(sessionId, windowId, request, requestOptions) {
|
1429
|
+
return __awaiter(this, void 0, void 0, function* () {
|
587
1430
|
var _a, _b, _c;
|
588
1431
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
589
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1432
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/paginated-extraction`),
|
590
1433
|
method: "POST",
|
591
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1434
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
592
1435
|
contentType: "application/json",
|
593
1436
|
requestType: "json",
|
594
|
-
body: serializers.
|
1437
|
+
body: serializers.SessionPaginatedExtractionHandlerRequestBody.jsonOrThrow(request, {
|
1438
|
+
unrecognizedObjectKeys: "strip",
|
1439
|
+
}),
|
595
1440
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
596
1441
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
597
1442
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -618,7 +1463,7 @@ class Windows {
|
|
618
1463
|
body: _response.error.rawBody,
|
619
1464
|
});
|
620
1465
|
case "timeout":
|
621
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1466
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/paginated-extraction.");
|
622
1467
|
case "unknown":
|
623
1468
|
throw new errors.AirtopError({
|
624
1469
|
message: _response.error.errorMessage,
|
@@ -627,28 +1472,30 @@ class Windows {
|
|
627
1472
|
});
|
628
1473
|
}
|
629
1474
|
/**
|
630
|
-
*
|
1475
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint instead.
|
631
1476
|
*
|
632
1477
|
* @param {string} sessionId - The session id for the window.
|
633
1478
|
* @param {string} windowId - The Airtop window id of the browser window.
|
634
|
-
* @param {Airtop.
|
1479
|
+
* @param {Airtop.SessionPageQueryHandlerRequestBody} request
|
635
1480
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
636
1481
|
*
|
637
1482
|
* @example
|
638
|
-
* await client.windows.
|
639
|
-
*
|
1483
|
+
* await client.windows.promptContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1484
|
+
* prompt: "What is the main idea of this page?"
|
640
1485
|
* })
|
641
1486
|
*/
|
642
|
-
|
1487
|
+
promptContent(sessionId, windowId, request, requestOptions) {
|
643
1488
|
return __awaiter(this, void 0, void 0, function* () {
|
644
1489
|
var _a, _b, _c;
|
645
1490
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
646
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1491
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/prompt-content`),
|
647
1492
|
method: "POST",
|
648
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1493
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
649
1494
|
contentType: "application/json",
|
650
1495
|
requestType: "json",
|
651
|
-
body: serializers.
|
1496
|
+
body: serializers.SessionPageQueryHandlerRequestBody.jsonOrThrow(request, {
|
1497
|
+
unrecognizedObjectKeys: "strip",
|
1498
|
+
}),
|
652
1499
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
653
1500
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
654
1501
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -675,7 +1522,7 @@ class Windows {
|
|
675
1522
|
body: _response.error.rawBody,
|
676
1523
|
});
|
677
1524
|
case "timeout":
|
678
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1525
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/prompt-content.");
|
679
1526
|
case "unknown":
|
680
1527
|
throw new errors.AirtopError({
|
681
1528
|
message: _response.error.errorMessage,
|
@@ -684,34 +1531,32 @@ class Windows {
|
|
684
1531
|
});
|
685
1532
|
}
|
686
1533
|
/**
|
687
|
-
*
|
1534
|
+
* Scrape a window and return the content as markdown
|
688
1535
|
*
|
689
1536
|
* @param {string} sessionId - The session id for the window.
|
690
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
691
|
-
* @param {Airtop.
|
1537
|
+
* @param {string} windowId - The Airtop window id of the browser window to scrape.
|
1538
|
+
* @param {Airtop.ScrapeContentRequest} request
|
692
1539
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
693
1540
|
*
|
694
1541
|
* @example
|
695
|
-
* await client.windows.
|
696
|
-
* elementDescription: "The search box input in the top right corner"
|
697
|
-
* })
|
1542
|
+
* await client.windows.scrapeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
698
1543
|
*/
|
699
|
-
|
700
|
-
return __awaiter(this,
|
1544
|
+
scrapeContent(sessionId_1, windowId_1) {
|
1545
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
701
1546
|
var _a, _b, _c;
|
702
1547
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
703
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1548
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/scrape-content`),
|
704
1549
|
method: "POST",
|
705
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1550
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
706
1551
|
contentType: "application/json",
|
707
1552
|
requestType: "json",
|
708
|
-
body: serializers.
|
1553
|
+
body: serializers.ScrapeContentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
709
1554
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
710
1555
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
711
1556
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
712
1557
|
});
|
713
1558
|
if (_response.ok) {
|
714
|
-
return serializers.
|
1559
|
+
return serializers.ScrapeResponse.parseOrThrow(_response.body, {
|
715
1560
|
unrecognizedObjectKeys: "passthrough",
|
716
1561
|
allowUnrecognizedUnionMembers: true,
|
717
1562
|
allowUnrecognizedEnumValues: true,
|
@@ -732,7 +1577,7 @@ class Windows {
|
|
732
1577
|
body: _response.error.rawBody,
|
733
1578
|
});
|
734
1579
|
case "timeout":
|
735
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1580
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/scrape-content.");
|
736
1581
|
case "unknown":
|
737
1582
|
throw new errors.AirtopError({
|
738
1583
|
message: _response.error.errorMessage,
|
@@ -741,26 +1586,26 @@ class Windows {
|
|
741
1586
|
});
|
742
1587
|
}
|
743
1588
|
/**
|
1589
|
+
* Take a screenshot of a browser window
|
1590
|
+
*
|
744
1591
|
* @param {string} sessionId - The session id for the window.
|
745
1592
|
* @param {string} windowId - The Airtop window id of the browser window.
|
746
|
-
* @param {Airtop.
|
1593
|
+
* @param {Airtop.SessionScreenshotHandlerRequestBody} request
|
747
1594
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
748
1595
|
*
|
749
1596
|
* @example
|
750
|
-
* await client.windows.
|
751
|
-
* condition: "Determine if the user appears to be signed in to the website"
|
752
|
-
* })
|
1597
|
+
* await client.windows.screenshot("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
753
1598
|
*/
|
754
|
-
|
755
|
-
return __awaiter(this,
|
1599
|
+
screenshot(sessionId_1, windowId_1) {
|
1600
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
756
1601
|
var _a, _b, _c;
|
757
1602
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
758
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1603
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/screenshot`),
|
759
1604
|
method: "POST",
|
760
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1605
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
761
1606
|
contentType: "application/json",
|
762
1607
|
requestType: "json",
|
763
|
-
body: serializers.
|
1608
|
+
body: serializers.SessionScreenshotHandlerRequestBody.jsonOrThrow(request, {
|
764
1609
|
unrecognizedObjectKeys: "strip",
|
765
1610
|
}),
|
766
1611
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -789,7 +1634,7 @@ class Windows {
|
|
789
1634
|
body: _response.error.rawBody,
|
790
1635
|
});
|
791
1636
|
case "timeout":
|
792
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1637
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/screenshot.");
|
793
1638
|
case "unknown":
|
794
1639
|
throw new errors.AirtopError({
|
795
1640
|
message: _response.error.errorMessage,
|
@@ -798,30 +1643,26 @@ class Windows {
|
|
798
1643
|
});
|
799
1644
|
}
|
800
1645
|
/**
|
801
|
-
*
|
1646
|
+
* Execute a scroll interaction in a specific browser window
|
802
1647
|
*
|
803
1648
|
* @param {string} sessionId - The session id for the window.
|
804
1649
|
* @param {string} windowId - The Airtop window id of the browser window.
|
805
|
-
* @param {Airtop.
|
1650
|
+
* @param {Airtop.SessionScrollHandlerRequestBody} request
|
806
1651
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
807
1652
|
*
|
808
1653
|
* @example
|
809
|
-
* await client.windows.
|
810
|
-
* prompt: "What is the main idea of this page?"
|
811
|
-
* })
|
1654
|
+
* await client.windows.scroll("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
812
1655
|
*/
|
813
|
-
|
814
|
-
return __awaiter(this,
|
1656
|
+
scroll(sessionId_1, windowId_1) {
|
1657
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
815
1658
|
var _a, _b, _c;
|
816
1659
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
817
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1660
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/scroll`),
|
818
1661
|
method: "POST",
|
819
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1662
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
820
1663
|
contentType: "application/json",
|
821
1664
|
requestType: "json",
|
822
|
-
body: serializers.
|
823
|
-
unrecognizedObjectKeys: "strip",
|
824
|
-
}),
|
1665
|
+
body: serializers.SessionScrollHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
825
1666
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
826
1667
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
827
1668
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -848,7 +1689,7 @@ class Windows {
|
|
848
1689
|
body: _response.error.rawBody,
|
849
1690
|
});
|
850
1691
|
case "timeout":
|
851
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1692
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/scroll.");
|
852
1693
|
case "unknown":
|
853
1694
|
throw new errors.AirtopError({
|
854
1695
|
message: _response.error.errorMessage,
|
@@ -857,28 +1698,26 @@ class Windows {
|
|
857
1698
|
});
|
858
1699
|
}
|
859
1700
|
/**
|
860
|
-
*
|
1701
|
+
* This endpoint is deprecated. Please use the `pageQuery` endpoint and ask for a summary in the prompt instead.
|
861
1702
|
*
|
862
1703
|
* @param {string} sessionId - The session id for the window.
|
863
|
-
* @param {string} windowId - The Airtop window id of the browser window.
|
864
|
-
* @param {Airtop.
|
1704
|
+
* @param {string} windowId - The Airtop window id of the browser window to summarize.
|
1705
|
+
* @param {Airtop.SessionSummaryHandlerRequestBody} request
|
865
1706
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
866
1707
|
*
|
867
1708
|
* @example
|
868
|
-
* await client.windows.
|
869
|
-
* prompt: "This site contains a list of results about <provide details about the list>. Navigate through 3 pages of results and return the title and <provide details about the data you want to extract> about each result in this list."
|
870
|
-
* })
|
1709
|
+
* await client.windows.summarizeContent("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430")
|
871
1710
|
*/
|
872
|
-
|
873
|
-
return __awaiter(this,
|
1711
|
+
summarizeContent(sessionId_1, windowId_1) {
|
1712
|
+
return __awaiter(this, arguments, void 0, function* (sessionId, windowId, request = {}, requestOptions) {
|
874
1713
|
var _a, _b, _c;
|
875
1714
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
876
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1715
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/summarize-content`),
|
877
1716
|
method: "POST",
|
878
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1717
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
879
1718
|
contentType: "application/json",
|
880
1719
|
requestType: "json",
|
881
|
-
body: serializers.
|
1720
|
+
body: serializers.SessionSummaryHandlerRequestBody.jsonOrThrow(request, {
|
882
1721
|
unrecognizedObjectKeys: "strip",
|
883
1722
|
}),
|
884
1723
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
@@ -907,7 +1746,7 @@ class Windows {
|
|
907
1746
|
body: _response.error.rawBody,
|
908
1747
|
});
|
909
1748
|
case "timeout":
|
910
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1749
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/summarize-content.");
|
911
1750
|
case "unknown":
|
912
1751
|
throw new errors.AirtopError({
|
913
1752
|
message: _response.error.errorMessage,
|
@@ -916,30 +1755,28 @@ class Windows {
|
|
916
1755
|
});
|
917
1756
|
}
|
918
1757
|
/**
|
919
|
-
*
|
1758
|
+
* Execute a type interaction in a specific browser window
|
920
1759
|
*
|
921
1760
|
* @param {string} sessionId - The session id for the window.
|
922
1761
|
* @param {string} windowId - The Airtop window id of the browser window.
|
923
|
-
* @param {Airtop.
|
1762
|
+
* @param {Airtop.SessionTypeHandlerRequestBody} request
|
924
1763
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
925
1764
|
*
|
926
1765
|
* @example
|
927
|
-
* await client.windows.
|
928
|
-
*
|
1766
|
+
* await client.windows.type("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1767
|
+
* text: "Example text"
|
929
1768
|
* })
|
930
1769
|
*/
|
931
|
-
|
1770
|
+
type(sessionId, windowId, request, requestOptions) {
|
932
1771
|
return __awaiter(this, void 0, void 0, function* () {
|
933
1772
|
var _a, _b, _c;
|
934
1773
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
935
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1774
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v1/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/type`),
|
936
1775
|
method: "POST",
|
937
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1776
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
938
1777
|
contentType: "application/json",
|
939
1778
|
requestType: "json",
|
940
|
-
body: serializers.
|
941
|
-
unrecognizedObjectKeys: "strip",
|
942
|
-
}),
|
1779
|
+
body: serializers.SessionTypeHandlerRequestBody.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
943
1780
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
944
1781
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
945
1782
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
@@ -966,7 +1803,7 @@ class Windows {
|
|
966
1803
|
body: _response.error.rawBody,
|
967
1804
|
});
|
968
1805
|
case "timeout":
|
969
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1806
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v1/sessions/{sessionId}/windows/{windowId}/type.");
|
970
1807
|
case "unknown":
|
971
1808
|
throw new errors.AirtopError({
|
972
1809
|
message: _response.error.errorMessage,
|
@@ -975,32 +1812,35 @@ class Windows {
|
|
975
1812
|
});
|
976
1813
|
}
|
977
1814
|
/**
|
978
|
-
*
|
1815
|
+
* Perform actions in a specific browser window based on a prompt
|
979
1816
|
*
|
980
1817
|
* @param {string} sessionId - The session id for the window.
|
981
|
-
* @param {string} windowId - The Airtop window id of the browser window
|
982
|
-
* @param {Airtop.
|
1818
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1819
|
+
* @param {Airtop.ActRequest} request
|
983
1820
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
984
1821
|
*
|
985
1822
|
* @example
|
986
|
-
* await client.windows.
|
1823
|
+
* await client.windows.act("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1824
|
+
* jobId: "123",
|
1825
|
+
* prompt: "Click the login button"
|
1826
|
+
* })
|
987
1827
|
*/
|
988
|
-
|
989
|
-
return __awaiter(this,
|
1828
|
+
act(sessionId, windowId, request, requestOptions) {
|
1829
|
+
return __awaiter(this, void 0, void 0, function* () {
|
990
1830
|
var _a, _b, _c;
|
991
1831
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
992
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1832
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v2/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/act`),
|
993
1833
|
method: "POST",
|
994
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1834
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
995
1835
|
contentType: "application/json",
|
996
1836
|
requestType: "json",
|
997
|
-
body: serializers.
|
1837
|
+
body: serializers.ActRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
998
1838
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
999
1839
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1000
1840
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1001
1841
|
});
|
1002
1842
|
if (_response.ok) {
|
1003
|
-
return serializers.
|
1843
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
1004
1844
|
unrecognizedObjectKeys: "passthrough",
|
1005
1845
|
allowUnrecognizedUnionMembers: true,
|
1006
1846
|
allowUnrecognizedEnumValues: true,
|
@@ -1021,7 +1861,7 @@ class Windows {
|
|
1021
1861
|
body: _response.error.rawBody,
|
1022
1862
|
});
|
1023
1863
|
case "timeout":
|
1024
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1864
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v2/sessions/{sessionId}/windows/{windowId}/act.");
|
1025
1865
|
case "unknown":
|
1026
1866
|
throw new errors.AirtopError({
|
1027
1867
|
message: _response.error.errorMessage,
|
@@ -1030,34 +1870,35 @@ class Windows {
|
|
1030
1870
|
});
|
1031
1871
|
}
|
1032
1872
|
/**
|
1033
|
-
*
|
1873
|
+
* Extract data from a specific browser window based on a prompt
|
1034
1874
|
*
|
1035
1875
|
* @param {string} sessionId - The session id for the window.
|
1036
1876
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1037
|
-
* @param {Airtop.
|
1877
|
+
* @param {Airtop.ExtractRequest} request
|
1038
1878
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1039
1879
|
*
|
1040
1880
|
* @example
|
1041
|
-
* await client.windows.
|
1881
|
+
* await client.windows.extract("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1882
|
+
* jobId: "123",
|
1883
|
+
* prompt: "Extract all product prices from this page"
|
1884
|
+
* })
|
1042
1885
|
*/
|
1043
|
-
|
1044
|
-
return __awaiter(this,
|
1886
|
+
extract(sessionId, windowId, request, requestOptions) {
|
1887
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1045
1888
|
var _a, _b, _c;
|
1046
1889
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1047
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1890
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v2/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/extract`),
|
1048
1891
|
method: "POST",
|
1049
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1892
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1050
1893
|
contentType: "application/json",
|
1051
1894
|
requestType: "json",
|
1052
|
-
body: serializers.
|
1053
|
-
unrecognizedObjectKeys: "strip",
|
1054
|
-
}),
|
1895
|
+
body: serializers.ExtractRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1055
1896
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1056
1897
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1057
1898
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1058
1899
|
});
|
1059
1900
|
if (_response.ok) {
|
1060
|
-
return serializers.
|
1901
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
1061
1902
|
unrecognizedObjectKeys: "passthrough",
|
1062
1903
|
allowUnrecognizedUnionMembers: true,
|
1063
1904
|
allowUnrecognizedEnumValues: true,
|
@@ -1078,7 +1919,7 @@ class Windows {
|
|
1078
1919
|
body: _response.error.rawBody,
|
1079
1920
|
});
|
1080
1921
|
case "timeout":
|
1081
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1922
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v2/sessions/{sessionId}/windows/{windowId}/extract.");
|
1082
1923
|
case "unknown":
|
1083
1924
|
throw new errors.AirtopError({
|
1084
1925
|
message: _response.error.errorMessage,
|
@@ -1087,32 +1928,35 @@ class Windows {
|
|
1087
1928
|
});
|
1088
1929
|
}
|
1089
1930
|
/**
|
1090
|
-
*
|
1931
|
+
* Find multiple elements in a browser window based on a prompt
|
1091
1932
|
*
|
1092
1933
|
* @param {string} sessionId - The session id for the window.
|
1093
1934
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1094
|
-
* @param {Airtop.
|
1935
|
+
* @param {Airtop.FindManyRequest} request
|
1095
1936
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1096
1937
|
*
|
1097
1938
|
* @example
|
1098
|
-
* await client.windows.
|
1939
|
+
* await client.windows.findMany("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1940
|
+
* jobId: "123",
|
1941
|
+
* prompt: "Find all the news articles"
|
1942
|
+
* })
|
1099
1943
|
*/
|
1100
|
-
|
1101
|
-
return __awaiter(this,
|
1944
|
+
findMany(sessionId, windowId, request, requestOptions) {
|
1945
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1102
1946
|
var _a, _b, _c;
|
1103
1947
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1104
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
1948
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v2/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/find-many`),
|
1105
1949
|
method: "POST",
|
1106
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
1950
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1107
1951
|
contentType: "application/json",
|
1108
1952
|
requestType: "json",
|
1109
|
-
body: serializers.
|
1953
|
+
body: serializers.FindManyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1110
1954
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1111
1955
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1112
1956
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1113
1957
|
});
|
1114
1958
|
if (_response.ok) {
|
1115
|
-
return serializers.
|
1959
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
1116
1960
|
unrecognizedObjectKeys: "passthrough",
|
1117
1961
|
allowUnrecognizedUnionMembers: true,
|
1118
1962
|
allowUnrecognizedEnumValues: true,
|
@@ -1133,7 +1977,7 @@ class Windows {
|
|
1133
1977
|
body: _response.error.rawBody,
|
1134
1978
|
});
|
1135
1979
|
case "timeout":
|
1136
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
1980
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v2/sessions/{sessionId}/windows/{windowId}/find-many.");
|
1137
1981
|
case "unknown":
|
1138
1982
|
throw new errors.AirtopError({
|
1139
1983
|
message: _response.error.errorMessage,
|
@@ -1142,34 +1986,35 @@ class Windows {
|
|
1142
1986
|
});
|
1143
1987
|
}
|
1144
1988
|
/**
|
1145
|
-
*
|
1989
|
+
* Find a specific element in a browser window based on a prompt
|
1146
1990
|
*
|
1147
1991
|
* @param {string} sessionId - The session id for the window.
|
1148
|
-
* @param {string} windowId - The Airtop window id of the browser window
|
1149
|
-
* @param {Airtop.
|
1992
|
+
* @param {string} windowId - The Airtop window id of the browser window.
|
1993
|
+
* @param {Airtop.FindOneRequest} request
|
1150
1994
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1151
1995
|
*
|
1152
1996
|
* @example
|
1153
|
-
* await client.windows.
|
1997
|
+
* await client.windows.findOne("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
1998
|
+
* jobId: "123",
|
1999
|
+
* prompt: "Find the login button"
|
2000
|
+
* })
|
1154
2001
|
*/
|
1155
|
-
|
1156
|
-
return __awaiter(this,
|
2002
|
+
findOne(sessionId, windowId, request, requestOptions) {
|
2003
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1157
2004
|
var _a, _b, _c;
|
1158
2005
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1159
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
2006
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v2/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/find-one`),
|
1160
2007
|
method: "POST",
|
1161
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
2008
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1162
2009
|
contentType: "application/json",
|
1163
2010
|
requestType: "json",
|
1164
|
-
body: serializers.
|
1165
|
-
unrecognizedObjectKeys: "strip",
|
1166
|
-
}),
|
2011
|
+
body: serializers.FindOneRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1167
2012
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1168
2013
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1169
2014
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1170
2015
|
});
|
1171
2016
|
if (_response.ok) {
|
1172
|
-
return serializers.
|
2017
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
1173
2018
|
unrecognizedObjectKeys: "passthrough",
|
1174
2019
|
allowUnrecognizedUnionMembers: true,
|
1175
2020
|
allowUnrecognizedEnumValues: true,
|
@@ -1190,7 +2035,7 @@ class Windows {
|
|
1190
2035
|
body: _response.error.rawBody,
|
1191
2036
|
});
|
1192
2037
|
case "timeout":
|
1193
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
2038
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v2/sessions/{sessionId}/windows/{windowId}/find-one.");
|
1194
2039
|
case "unknown":
|
1195
2040
|
throw new errors.AirtopError({
|
1196
2041
|
message: _response.error.errorMessage,
|
@@ -1199,34 +2044,34 @@ class Windows {
|
|
1199
2044
|
});
|
1200
2045
|
}
|
1201
2046
|
/**
|
1202
|
-
*
|
2047
|
+
* Send a prompt to an LLM with context from the browser window
|
1203
2048
|
*
|
1204
2049
|
* @param {string} sessionId - The session id for the window.
|
1205
2050
|
* @param {string} windowId - The Airtop window id of the browser window.
|
1206
|
-
* @param {Airtop.
|
2051
|
+
* @param {Airtop.LlmRequest} request
|
1207
2052
|
* @param {Windows.RequestOptions} requestOptions - Request-specific configuration.
|
1208
2053
|
*
|
1209
2054
|
* @example
|
1210
|
-
* await client.windows.
|
1211
|
-
*
|
2055
|
+
* await client.windows.llm("6aac6f73-bd89-4a76-ab32-5a6c422e8b0b", "0334da2a-91b0-42c5-6156-76a5eba87430", {
|
2056
|
+
* prompt: "Tell me about this webpage"
|
1212
2057
|
* })
|
1213
2058
|
*/
|
1214
|
-
|
2059
|
+
llm(sessionId, windowId, request, requestOptions) {
|
1215
2060
|
return __awaiter(this, void 0, void 0, function* () {
|
1216
2061
|
var _a, _b, _c;
|
1217
2062
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
1218
|
-
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/
|
2063
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AirtopEnvironment.Default, `v2/sessions/${encodeURIComponent(sessionId)}/windows/${encodeURIComponent(windowId)}/llm`),
|
1219
2064
|
method: "POST",
|
1220
|
-
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.
|
2065
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@airtop/sdk", "X-Fern-SDK-Version": "0.1.40-beta0", "User-Agent": "@airtop/sdk/0.1.40-beta0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
1221
2066
|
contentType: "application/json",
|
1222
2067
|
requestType: "json",
|
1223
|
-
body: serializers.
|
2068
|
+
body: serializers.LlmRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
1224
2069
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
1225
2070
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
1226
2071
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
1227
2072
|
});
|
1228
2073
|
if (_response.ok) {
|
1229
|
-
return serializers.
|
2074
|
+
return serializers.AsyncSessionAiResponseEnvelope.parseOrThrow(_response.body, {
|
1230
2075
|
unrecognizedObjectKeys: "passthrough",
|
1231
2076
|
allowUnrecognizedUnionMembers: true,
|
1232
2077
|
allowUnrecognizedEnumValues: true,
|
@@ -1247,7 +2092,7 @@ class Windows {
|
|
1247
2092
|
body: _response.error.rawBody,
|
1248
2093
|
});
|
1249
2094
|
case "timeout":
|
1250
|
-
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /sessions/{sessionId}/windows/{windowId}/
|
2095
|
+
throw new errors.AirtopTimeoutError("Timeout exceeded when calling POST /v2/sessions/{sessionId}/windows/{windowId}/llm.");
|
1251
2096
|
case "unknown":
|
1252
2097
|
throw new errors.AirtopError({
|
1253
2098
|
message: _response.error.errorMessage,
|